@ckeditor/ckeditor5-ai 48.0.0-alpha.9 → 48.0.1-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (148) hide show
  1. package/dist/index.js +6 -6
  2. package/dist/translations/af.js +1 -1
  3. package/dist/translations/af.umd.js +1 -1
  4. package/dist/translations/ar.js +1 -1
  5. package/dist/translations/ar.umd.js +1 -1
  6. package/dist/translations/ast.js +1 -1
  7. package/dist/translations/ast.umd.js +1 -1
  8. package/dist/translations/az.js +1 -1
  9. package/dist/translations/az.umd.js +1 -1
  10. package/dist/translations/be.js +1 -1
  11. package/dist/translations/be.umd.js +1 -1
  12. package/dist/translations/bg.js +1 -1
  13. package/dist/translations/bg.umd.js +1 -1
  14. package/dist/translations/bn.js +1 -1
  15. package/dist/translations/bn.umd.js +1 -1
  16. package/dist/translations/bs.js +1 -1
  17. package/dist/translations/bs.umd.js +1 -1
  18. package/dist/translations/ca.js +1 -1
  19. package/dist/translations/ca.umd.js +1 -1
  20. package/dist/translations/cs.js +1 -1
  21. package/dist/translations/cs.umd.js +1 -1
  22. package/dist/translations/da.js +1 -1
  23. package/dist/translations/da.umd.js +1 -1
  24. package/dist/translations/de-ch.js +1 -1
  25. package/dist/translations/de-ch.umd.js +1 -1
  26. package/dist/translations/de.js +1 -1
  27. package/dist/translations/de.umd.js +1 -1
  28. package/dist/translations/el.js +1 -1
  29. package/dist/translations/el.umd.js +1 -1
  30. package/dist/translations/en-au.js +1 -1
  31. package/dist/translations/en-au.umd.js +1 -1
  32. package/dist/translations/en-gb.js +1 -1
  33. package/dist/translations/en-gb.umd.js +1 -1
  34. package/dist/translations/en.js +1 -1
  35. package/dist/translations/en.umd.js +1 -1
  36. package/dist/translations/eo.js +1 -1
  37. package/dist/translations/eo.umd.js +1 -1
  38. package/dist/translations/es-co.js +1 -1
  39. package/dist/translations/es-co.umd.js +1 -1
  40. package/dist/translations/es.js +1 -1
  41. package/dist/translations/es.umd.js +1 -1
  42. package/dist/translations/et.js +1 -1
  43. package/dist/translations/et.umd.js +1 -1
  44. package/dist/translations/eu.js +1 -1
  45. package/dist/translations/eu.umd.js +1 -1
  46. package/dist/translations/fa.js +1 -1
  47. package/dist/translations/fa.umd.js +1 -1
  48. package/dist/translations/fi.js +1 -1
  49. package/dist/translations/fi.umd.js +1 -1
  50. package/dist/translations/fr.js +1 -1
  51. package/dist/translations/fr.umd.js +1 -1
  52. package/dist/translations/gl.js +1 -1
  53. package/dist/translations/gl.umd.js +1 -1
  54. package/dist/translations/gu.js +1 -1
  55. package/dist/translations/gu.umd.js +1 -1
  56. package/dist/translations/he.js +1 -1
  57. package/dist/translations/he.umd.js +1 -1
  58. package/dist/translations/hi.js +1 -1
  59. package/dist/translations/hi.umd.js +1 -1
  60. package/dist/translations/hr.js +1 -1
  61. package/dist/translations/hr.umd.js +1 -1
  62. package/dist/translations/hu.js +1 -1
  63. package/dist/translations/hu.umd.js +1 -1
  64. package/dist/translations/hy.js +1 -1
  65. package/dist/translations/hy.umd.js +1 -1
  66. package/dist/translations/id.js +1 -1
  67. package/dist/translations/id.umd.js +1 -1
  68. package/dist/translations/it.js +1 -1
  69. package/dist/translations/it.umd.js +1 -1
  70. package/dist/translations/ja.js +1 -1
  71. package/dist/translations/ja.umd.js +1 -1
  72. package/dist/translations/jv.js +1 -1
  73. package/dist/translations/jv.umd.js +1 -1
  74. package/dist/translations/kk.js +1 -1
  75. package/dist/translations/kk.umd.js +1 -1
  76. package/dist/translations/km.js +1 -1
  77. package/dist/translations/km.umd.js +1 -1
  78. package/dist/translations/kn.js +1 -1
  79. package/dist/translations/kn.umd.js +1 -1
  80. package/dist/translations/ko.js +1 -1
  81. package/dist/translations/ko.umd.js +1 -1
  82. package/dist/translations/ku.js +1 -1
  83. package/dist/translations/ku.umd.js +1 -1
  84. package/dist/translations/lt.js +1 -1
  85. package/dist/translations/lt.umd.js +1 -1
  86. package/dist/translations/lv.js +1 -1
  87. package/dist/translations/lv.umd.js +1 -1
  88. package/dist/translations/ms.js +1 -1
  89. package/dist/translations/ms.umd.js +1 -1
  90. package/dist/translations/nb.js +1 -1
  91. package/dist/translations/nb.umd.js +1 -1
  92. package/dist/translations/ne.js +1 -1
  93. package/dist/translations/ne.umd.js +1 -1
  94. package/dist/translations/nl.js +1 -1
  95. package/dist/translations/nl.umd.js +1 -1
  96. package/dist/translations/no.js +1 -1
  97. package/dist/translations/no.umd.js +1 -1
  98. package/dist/translations/oc.js +1 -1
  99. package/dist/translations/oc.umd.js +1 -1
  100. package/dist/translations/pl.js +1 -1
  101. package/dist/translations/pl.umd.js +1 -1
  102. package/dist/translations/pt-br.js +1 -1
  103. package/dist/translations/pt-br.umd.js +1 -1
  104. package/dist/translations/pt.js +1 -1
  105. package/dist/translations/pt.umd.js +1 -1
  106. package/dist/translations/ro.js +1 -1
  107. package/dist/translations/ro.umd.js +1 -1
  108. package/dist/translations/ru.js +1 -1
  109. package/dist/translations/ru.umd.js +1 -1
  110. package/dist/translations/si.js +1 -1
  111. package/dist/translations/si.umd.js +1 -1
  112. package/dist/translations/sk.js +1 -1
  113. package/dist/translations/sk.umd.js +1 -1
  114. package/dist/translations/sl.js +1 -1
  115. package/dist/translations/sl.umd.js +1 -1
  116. package/dist/translations/sq.js +1 -1
  117. package/dist/translations/sq.umd.js +1 -1
  118. package/dist/translations/sr-latn.js +1 -1
  119. package/dist/translations/sr-latn.umd.js +1 -1
  120. package/dist/translations/sr.js +1 -1
  121. package/dist/translations/sr.umd.js +1 -1
  122. package/dist/translations/sv.js +1 -1
  123. package/dist/translations/sv.umd.js +1 -1
  124. package/dist/translations/th.js +1 -1
  125. package/dist/translations/th.umd.js +1 -1
  126. package/dist/translations/ti.js +1 -1
  127. package/dist/translations/ti.umd.js +1 -1
  128. package/dist/translations/tk.js +1 -1
  129. package/dist/translations/tk.umd.js +1 -1
  130. package/dist/translations/tr.js +1 -1
  131. package/dist/translations/tr.umd.js +1 -1
  132. package/dist/translations/tt.js +1 -1
  133. package/dist/translations/tt.umd.js +1 -1
  134. package/dist/translations/ug.js +1 -1
  135. package/dist/translations/ug.umd.js +1 -1
  136. package/dist/translations/uk.js +1 -1
  137. package/dist/translations/uk.umd.js +1 -1
  138. package/dist/translations/ur.js +1 -1
  139. package/dist/translations/ur.umd.js +1 -1
  140. package/dist/translations/uz.js +1 -1
  141. package/dist/translations/uz.umd.js +1 -1
  142. package/dist/translations/vi.js +1 -1
  143. package/dist/translations/vi.umd.js +1 -1
  144. package/dist/translations/zh-cn.js +1 -1
  145. package/dist/translations/zh-cn.umd.js +1 -1
  146. package/dist/translations/zh.js +1 -1
  147. package/dist/translations/zh.umd.js +1 -1
  148. package/package.json +12 -12
package/dist/index.js CHANGED
@@ -20,9 +20,9 @@
20
20
  *
21
21
  *
22
22
  */
23
- import{Plugin as _0x369cb6,Command as _0x49b69e,ContextPlugin as _0x1f4c78,Editor as _0x3ba7d1}from'@ckeditor/ckeditor5-core/dist/index.js';import{IconCopy as _0x2e9086,IconCheck as _0x4c3d0d,IconError as _0x1e00a6,IconSubmit as _0x1e897a,IconAIHistory as _0x16c2fc,IconMagicWand as _0x425ed4,IconRobotPencil as _0x296b43,IconMaximize as _0x51bbc4,IconMinimize as _0x1d64fe,IconShowChangesOn as _0x184e17,IconShowChangesOff as _0x3428ba,IconDocument as _0x4db6db,IconBoxWithCross as _0x1a8f1a,IconBoxWithCheck as _0x2080a4,IconBoxWithMarker as _0x277d39,IconInfo as _0x1ccb12,IconWeb as _0x2c4a3f,IconCancel as _0x52715b,IconSelection as _0x2452ef,IconFileUpload as _0x3c524a,IconLink as _0x54a6e3,IconBulb as _0x3cc08a,IconAI as _0x120471,IconPreviousArrow as _0x4b5cbc,IconDocumentOutline as _0x2e527d,IconLoupe as _0x393ddf,IconPaperClip as _0x46d3ca,IconBrowseFiles as _0x4c886f,IconDropdownArrow as _0x19f364,IconStop as _0x48b0d7,IconAIChat as _0xfce8a2,IconPlus as _0x5885f1,IconPin as _0x54ea24,IconThreeHorizontalDots as _0xd0791b,IconAIReview as _0x458073,IconAITranslate as _0x5d111c,IconAIAskAI as _0x4baf04,IconThumbUp as _0x5aeaa7,IconThumbDown as _0x450aae,IconChevronDown as _0x40697,IconChevronUp as _0xc9c719,IconAIQuickActions as _0x5b1111,IconAIChatCommands as _0x82d2cb,IconAIImproveWriting as _0x46e795,IconAIContinueWriting as _0x44e46e,IconAIGrammarCheck as _0x304122,IconAIAdjustLength as _0x111fae,IconAIChangeTone as _0x13a1b2,IconAIOther as _0x10a91a,IconRefresh as tt,IconNextArrow as et,IconOutdated as it,IconEye as st,IconEyeCrossedOut as nt,IconChevronRight as rt}from'@ckeditor/ckeditor5-icons/dist/index.js';import{uid as at,CKEditorError as ot,ObservableMixin as ht,global as ct,isVisible as lt,Rect as ut,Collection as dt,FocusTracker as _t,KeystrokeHandler as At,first as gt,logWarning as It,logError as Et,toArray as Tt,EmitterMixin as pt,scrollViewportToShowTarget as mt,insertToPriorityArray as Ct,scrollAncestorsToShowTarget as wt,ResizeObserver as ft,_isMotionReduced as St,getConstrainedViewportRect as bt,DomEmitterMixin as Rt}from'@ckeditor/ckeditor5-utils/dist/index.js';import{ToolbarView as Ot,ButtonView as kt,View as Nt,SpinnerView as vt,IconView as yt,AutocompleteView as xt,ListView as Lt,ListItemGroupView as Dt,ListItemView as Pt,ButtonLabelView as Ht,FocusCycler as Mt,createLabeledTextarea as Ut,Dialog as Vt,createDropdown as Bt,addMenuToDropdown as Gt,MenuBarMenuView as Ft,MenuBarMenuListItemButtonView as Kt,DialogViewPosition as Wt,MenuBarMenuListView as Yt,MenuBarMenuListItemView as $t,BodyCollection as qt,BalloonPanelView as Qt,clickOutsideHandler as Xt,addListToDropdown as zt,UIModel as jt,submitHandler as Jt,LabeledFieldView as Zt,createLabeledInputText as te,FormHeaderView as _0x2229a9,HighlightedTextView as _0x50c963,ViewCollection as _0x553410,FileDialogButtonView as _0x214b7f,InputTextView as _0x26d7bf,SearchTextView as _0xb89745,ListItemButtonView as _0x464cba,ButtonLabelWithHighlightView as _0x5dd3dc,DropdownMenuPanelPositioningFunctions as _0x5ab4be,BalloonToolbar as _0x3d0960,FormRowView as _0x1325bb,TextareaView as _0x4dcc48}from'@ckeditor/ckeditor5-ui/dist/index.js';import{ClipboardPipeline as _0x298f4e,ClipboardMarkersUtils as _0x284962}from'@ckeditor/ckeditor5-clipboard/dist/index.js';import{ViewDocumentDomEventData as _0x2147a5,ViewDataTransfer as _0x37fbd9,ViewUpcastWriter as _0x5062e4,Matcher as _0x180b86,_DetachOperation as _0x15c955,_insertIntoModelNodeList as _0xb3c696,_removeFromModelNodeList as _0x19cc5a,ModelRange as _0x2861aa,transformOperationSets as _0x3d9713,ViewDowncastWriter as _0x35d71a,ModelDocumentFragment as _0x4aa4eb,ModelPosition as _0x99b885,ModelTreeWalker as _0x1d2c08,MarkerOperation as _0x3f80c1,InsertOperation as _0x554a3d}from'@ckeditor/ckeditor5-engine/dist/index.js';import{unescape as _0x47ba7b,escape as _0x3e5077,cloneDeep as _0x20cfd4,escapeRegExp as _0x144f09,debounce as _0x136cad}from'es-toolkit/compat';import{createParser as _0x1fdf6f}from'eventsource-parser';import{CloudServices as _0x334536}from'@ckeditor/ckeditor5-cloud-services/dist/index.js';import{parseDocument as _0x5c8415}from'htmlparser2';import{isTag as _0x77ea4b,findOne as _0x272a75,getParent as _0x19da4f,findAll as _0x1d864b,removeElement as _0x411d52,replaceElement as _0x26fd61,prepend as _0x5b34ab,prependChild as _0x2bedf0,appendChild as _0x58db6b,append as _0x5d104d,find as _0x57ddbf,isComment as _0x337d38,getChildren as _0x28d1e6,textContent as _0x4e72ee}from'domutils';import _0x419b49 from'dom-serializer';import{Document as _0xb96947,Element as ti,Text as _0x1c3f7c,cloneNode as _0x181735,isDocument as _0x3770f5,isText as _0x9aa2d,NodeWithChildren as _0xc780ea}from'domhandler';import{MarkdownGfmMdToHtmlDefaultPlugins as _0x544eb0,MarkdownGfmMdToHtml as _0xd0e07b}from'@ckeditor/ckeditor5-markdown-gfm/dist/index.js';import _0x1b7b18 from'rehype-sanitize';import{fixElementSuggestionRange as _0x2609d6,DocumentCompare as _0x1b3b63,DATA_ID_MODEL_ATTRIBUTE as _0x4068db,ConfirmMixin as _0x7782a9,getAllMarkersDomElementsSorted as _0x49ea5d,SuggestionsConversion as _0xe2382a,DATA_ID_VIEW_ATTRIBUTE as _0xc0441c,getMarkerDomElement as _0x537667}from'@ckeditor/ckeditor5-collaboration-core/dist/index.js';import _0xb9860b from'morphdom';import{diffArrays as _0x4ecd82}from'diff';const pi='_ungrouppedCommands';function mi(_0x30e3f7,_0x425bde){const _0x35d5f2=(0x0,_0x425bde['t'])('Other');return _0x30e3f7['length']?'groupId'in _0x30e3f7[0x0]?_0x30e3f7:[{'groupId':pi,'groupLabel':_0x35d5f2,'order':0x1/0x0,'commands':_0x30e3f7}]:[{'groupId':pi,'groupLabel':_0x35d5f2,'order':0x1/0x0,'commands':[]}];}const Ci=globalThis['DataTransfer'],wi='ai-ui';class fi extends _0x369cb6{static get['pluginName'](){return'AIAssistantEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const {editor:_0x464bb8}=this,_0x4301a4=['ck-fake-ai-selection'];_0x464bb8['config']['get']('ai.assistant.useTheme')&&_0x4301a4['push']('ck-ai-assistant-ui_theme'),_0x464bb8['conversion']['for']('editingDowncast')['markerToHighlight']({'model':wi,'view':{'classes':_0x4301a4,'priority':0xc}}),_0x464bb8['conversion']['for']('editingDowncast')['markerToElement']({'model':wi,'view':(_0x934f18,{writer:_0x4cd28b})=>{if(!_0x934f18['markerRange']['isCollapsed'])return null;const _0x15e75b=_0x4cd28b['createUIElement']('span');return _0x4cd28b['addClass'](['ck-fake-ai-selection','ck-fake-ai-selection_collapsed'],_0x15e75b),_0x15e75b;}});}['afterInit'](){!async function(_0x4bb3b9){const _0x203d14=_0x5d6662([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]),_0x5e3b21=0x3dffc4e1,_0x352469=0x3df84141^_0x5e3b21,_0x346635=window[_0x5d6662([0x44,0x61,0x74,0x65])][_0x5d6662([0x6e,0x6f,0x77])](),_0x486915=_0x4bb3b9[_0x5d6662([0x65,0x64,0x69,0x74,0x6f,0x72])],_0x34c185=new window[(_0x5d6662([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x11dd15=>{_0x486915[_0x5d6662([0x6f,0x6e,0x63,0x65])](_0x5d6662([0x72,0x65,0x61,0x64,0x79]),_0x11dd15);}),_0x161134={[_0x5d6662([0x6b,0x74,0x79])]:_0x5d6662([0x45,0x43]),[_0x5d6662([0x75,0x73,0x65])]:_0x5d6662([0x73,0x69,0x67]),[_0x5d6662([0x63,0x72,0x76])]:_0x5d6662([0x50,0x2d,0x32,0x35,0x36]),[_0x5d6662([0x78])]:_0x5d6662([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]),[_0x5d6662([0x79])]:_0x5d6662([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]),[_0x5d6662([0x61,0x6c,0x67])]:_0x5d6662([0x45,0x53,0x32,0x35,0x36])},_0x525fa7=_0x486915[_0x5d6662([0x63,0x6f,0x6e,0x66,0x69,0x67])][_0x5d6662([0x67,0x65,0x74])](_0x5d6662([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79]));async function _0x48b6ba(){let _0x3656b5,_0x4bf885=null,_0x345ea2=null;try{if(_0x525fa7==_0x5d6662([0x47,0x50,0x4c]))return _0x5d6662([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]);if(_0x3656b5=_0x4fde57(),!_0x3656b5)return _0x5d6662([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);return _0x3656b5[_0x5d6662([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])]&&(_0x345ea2=_0x187a15(_0x3656b5[_0x5d6662([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])],_0x3656b5[_0x5d6662([0x6a,0x74,0x69])])),await _0x237be0()?_0x3523e6()?_0x32f619()?_0x5d6662([0x45,0x78,0x70,0x69,0x72,0x65,0x64]):_0x25d6d6()?(_0x3656b5[_0x5d6662([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x5d6662([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e])&&(_0x4bf885=_0x1a9d25(_0x5d6662([0x45,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e,0x4c,0x69,0x6d,0x69,0x74]))),await _0x345066()):_0x5d6662([0x44,0x6f,0x6d,0x61,0x69,0x6e,0x4c,0x69,0x6d,0x69,0x74]):_0x5d6662([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]):_0x5d6662([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}catch{return _0x5d6662([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}function _0x32f619(){const _0x4a5b35=[_0x5d6662([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e]),_0x5d6662([0x74,0x72,0x69,0x61,0x6c])][_0x5d6662([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x3656b5[_0x5d6662([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])])?_0x346635/0x3e8:0xe10*_0x352469;return _0x3656b5[_0x5d6662([0x65,0x78,0x70])]<_0x4a5b35;}function _0x3523e6(){const _0x2e9d33=_0x3656b5[_0x5d6662([0x66,0x65,0x61,0x74,0x75,0x72,0x65,0x73])];return!!_0x2e9d33&&(!!_0x2e9d33[_0x5d6662([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x5d6662([0x2a]))||!!_0x2e9d33[_0x5d6662([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x5d6662([0x41,0x49])));}function _0x25d6d6(){const _0x5e6429=_0x3656b5[_0x5d6662([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x64,0x48,0x6f,0x73,0x74,0x73])];if(!_0x5e6429||0x0==_0x5e6429[_0x5d6662([0x6c,0x65,0x6e,0x67,0x74,0x68])])return!0x0;const {hostname:_0x39ecfd}=new URL(window[_0x5d6662([0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e])]['href']);if(_0x5e6429[_0x5d6662([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x39ecfd))return!0x0;const _0xd54af=_0x39ecfd[_0x5d6662([0x73,0x70,0x6c,0x69,0x74])](_0x5d6662([0x2e]));return _0x5e6429[_0x5d6662([0x66,0x69,0x6c,0x74,0x65,0x72])](_0xc84fc8=>_0xc84fc8[_0x5d6662([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x5d6662([0x2a])))[_0x5d6662([0x6d,0x61,0x70])](_0x253eb5=>_0x253eb5[_0x5d6662([0x73,0x70,0x6c,0x69,0x74])](_0x5d6662([0x2e])))[_0x5d6662([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x409f8f=>_0x409f8f[_0x5d6662([0x6c,0x65,0x6e,0x67,0x74,0x68])]<=_0xd54af[_0x5d6662([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0x5d6662([0x6d,0x61,0x70])](_0x205b8f=>Array(_0xd54af[_0x5d6662([0x6c,0x65,0x6e,0x67,0x74,0x68])]-_0x205b8f[_0x5d6662([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0x5d6662([0x66,0x69,0x6c,0x6c])](_0x205b8f[0x0]===_0x5d6662([0x2a])?_0x5d6662([0x2a]):'')[_0x5d6662([0x63,0x6f,0x6e,0x63,0x61,0x74])](_0x205b8f))[_0x5d6662([0x73,0x6f,0x6d,0x65])](_0x261f96=>_0xd54af[_0x5d6662([0x65,0x76,0x65,0x72,0x79])]((_0x2de747,_0x21e271)=>_0x261f96[_0x21e271]===_0x2de747||_0x261f96[_0x21e271]===_0x5d6662([0x2a])));}function _0x345066(){return _0x4bf885&&_0x345ea2?new window[(_0x5d6662([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x5de445,_0x1d8894)=>{_0x4bf885[_0x5d6662([0x74,0x68,0x65,0x6e])](_0x5de445,_0x1d8894),_0x345ea2[_0x5d6662([0x74,0x68,0x65,0x6e])](_0x431f92=>{_0x431f92!=_0x5d6662([0x56,0x61,0x6c,0x69,0x64])&&_0x5de445(_0x431f92);},_0x1d8894);}):_0x4bf885||_0x345ea2||_0x5d6662([0x56,0x61,0x6c,0x69,0x64]);}}function _0x187a15(_0xb9ef78,_0xaf88f2){return new window[(_0x5d6662([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x2b1587=>{if(_0x14458d())return _0x2b1587(_0x5d6662([0x56,0x61,0x6c,0x69,0x64]));_0x1a83aa(),_0x486915[_0x5d6662([0x64,0x65,0x63,0x6f,0x72,0x61,0x74,0x65])](_0x5d6662([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]));let _0x3b150b=!0x1;const _0x277cc8=at();function _0x8d6c99(_0xb8f78f){return!!_0xb8f78f&&(typeof _0xb8f78f===_0x5d6662([0x6f,0x62,0x6a,0x65,0x63,0x74])||typeof _0xb8f78f===_0x5d6662([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]))&&typeof _0xb8f78f[_0x5d6662([0x74,0x68,0x65,0x6e])]===_0x5d6662([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e])&&typeof _0xb8f78f[_0x5d6662([0x63,0x61,0x74,0x63,0x68])]===_0x5d6662([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]);}function _0x523e61(_0x44e127){_0x521d1d(_0x44e127)[_0x5d6662([0x74,0x68,0x65,0x6e])](_0x4246f8=>{if(!_0x4246f8||_0x4246f8[_0x5d6662([0x73,0x74,0x61,0x74,0x75,0x73])]!=_0x5d6662([0x6f,0x6b]))return _0x5d6662([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]);return _0x35214(_0x37bf67(_0x277cc8+_0xaf88f2))!=_0x4246f8[_0x5d6662([0x76,0x65,0x72,0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6f,0x6e])]?_0x5d6662([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]):_0x5d6662([0x56,0x61,0x6c,0x69,0x64]);})[_0x5d6662([0x74,0x68,0x65,0x6e])](_0x16ff67=>(_0x3f128f(),_0x16ff67),()=>{const _0x2bd85c=_0x2474e6();return null==_0x2bd85c?(_0x3f128f(),_0x5d6662([0x56,0x61,0x6c,0x69,0x64])):_0x5d6662(_0x346635-_0x2bd85c>(0x19f340e1^_0x5e3b21)?[0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]:[0x56,0x61,0x6c,0x69,0x64]);})[_0x5d6662([0x74,0x68,0x65,0x6e])](_0x2b1587)[_0x5d6662([0x63,0x61,0x74,0x63,0x68])](()=>{_0x2b1587(_0x5d6662([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});const _0x488f7d=0x3dc92a61^_0x5e3b21;function _0x3f128f(){const _0x254dbc=_0x5d6662([0x6c,0x6c,0x63,0x74,0x2d])+_0x35214(_0x37bf67(_0xb9ef78)),_0x284e5f=_0x4cab78(_0x35214(window[_0x5d6662([0x4d,0x61,0x74,0x68])][_0x5d6662([0x63,0x65,0x69,0x6c])](_0x346635/_0x488f7d)));window[_0x5d6662([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x5d6662([0x73,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x254dbc,_0x284e5f);}function _0x2474e6(){const _0x1c4c43=_0x5d6662([0x6c,0x6c,0x63,0x74,0x2d])+_0x35214(_0x37bf67(_0xb9ef78)),_0x5a8b69=window[_0x5d6662([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x5d6662([0x67,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x1c4c43);return _0x5a8b69?window[_0x5d6662([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x4cab78(_0x5a8b69),0x10)*_0x488f7d:null;}function _0x521d1d(_0x2c210e){return new window[(_0x5d6662([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x621f5e,_0x53249b)=>{_0x2c210e[_0x5d6662([0x74,0x68,0x65,0x6e])](_0x621f5e,_0x53249b),window[_0x5d6662([0x73,0x65,0x74,0x54,0x69,0x6d,0x65,0x6f,0x75,0x74])](_0x53249b,0x3dfe1021^_0x5e3b21);});}}_0x486915[_0x5d6662([0x6f,0x6e])](_0x5d6662([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),(_0x596ac3,_0x1e5e6c)=>{if(_0x1e5e6c[0x0]!=_0xb9ef78)return _0x2b1587(_0x5d6662([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));_0x1e5e6c[0x1]={..._0x1e5e6c[0x1],[_0x5d6662([0x72,0x65,0x71,0x75,0x65,0x73,0x74,0x49,0x64])]:_0x277cc8};},{[_0x5d6662([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x5d6662([0x68,0x69,0x67,0x68])}),_0x486915[_0x5d6662([0x6f,0x6e])](_0x5d6662([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),_0x3570c7=>{_0x8d6c99(_0x3570c7[_0x5d6662([0x72,0x65,0x74,0x75,0x72,0x6e])])&&(_0x3b150b=!0x0,_0x523e61(_0x3570c7[_0x5d6662([0x72,0x65,0x74,0x75,0x72,0x6e])]));},{[_0x5d6662([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x5d6662([0x6c,0x6f,0x77])}),_0x34c185[_0x5d6662([0x74,0x68,0x65,0x6e])](()=>{_0x3b150b||_0x2b1587(_0x5d6662([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});});function _0x14458d(){return _0x486915[_0x5d6662([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x5d6662([0x76,0x69,0x65,0x77])][_0x5d6662([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]==_0x5d6662([0x61,0x75,0x74,0x6f]);}function _0x1a83aa(){_0x486915[_0x5d6662([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x5d6662([0x76,0x69,0x65,0x77])][_0x5d6662([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]=_0x5d6662([0x61,0x75,0x74,0x6f]);}}function _0x1a9d25(_0x3b193f){const _0x53f38a=[new window[(_0x5d6662([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x2325cc=>setTimeout(_0x2325cc,0x3df6fa2d^_0x5e3b21)),_0x34c185[_0x5d6662([0x74,0x68,0x65,0x6e])](()=>new window[(_0x5d6662([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x34f1d3=>{let _0x15ba3c=0x0;_0x486915[_0x5d6662([0x6d,0x6f,0x64,0x65,0x6c])][_0x5d6662([0x6f,0x6e])](_0x5d6662([0x61,0x70,0x70,0x6c,0x79,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e]),(_0x35f3cd,_0x3d0ba5)=>{_0x3d0ba5[0x0][_0x5d6662([0x69,0x73,0x44,0x6f,0x63,0x75,0x6d,0x65,0x6e,0x74,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e])]&&_0x15ba3c++,_0x15ba3c==(0x3dffc109^_0x5e3b21)&&(_0x34f1d3(),_0x35f3cd[_0x5d6662([0x6f,0x66,0x66])]());});}))];return window[_0x5d6662([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65])][_0x5d6662([0x72,0x61,0x63,0x65])](_0x53f38a)[_0x5d6662([0x74,0x68,0x65,0x6e])](()=>_0x3b193f);}async function _0x5336a2(){await _0x34c185,_0x486915[_0x5d6662([0x6d,0x6f,0x64,0x65,0x6c])][_0x5d6662([0x63,0x68,0x61,0x6e,0x67,0x65])]=_0x35c995,_0x486915[_0x5d6662([0x6d,0x6f,0x64,0x65,0x6c])][_0x5d6662([0x65,0x6e,0x71,0x75,0x65,0x75,0x65,0x43,0x68,0x61,0x6e,0x67,0x65])]=_0x35c995,_0x486915[_0x5d6662([0x65,0x6e,0x61,0x62,0x6c,0x65,0x52,0x65,0x61,0x64,0x4f,0x6e,0x6c,0x79,0x4d,0x6f,0x64,0x65])](_0x5d6662([0x6d,0x6f,0x64,0x65,0x6c]));}function _0x2c806d(_0x666165){const _0x311f7a=_0x4c6e72();_0x486915[_0x311f7a]=_0x5d6662([0x61,0x69,0x4c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79])+_0x666165,_0x666165!=_0x5d6662([0x56,0x61,0x6c,0x69,0x64])&&_0x5336a2();}function _0x4c6e72(){const _0x2c9bb2=window[_0x5d6662([0x53,0x74,0x72,0x69,0x6e,0x67])](window[_0x5d6662([0x70,0x65,0x72,0x66,0x6f,0x72,0x6d,0x61,0x6e,0x63,0x65])][_0x5d6662([0x6e,0x6f,0x77])]())[_0x5d6662([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](_0x5d6662([0x2e]),'');let _0x41c8f6=_0x5d6662([0x6e]);for(let _0x3b59f9=0x0;_0x3b59f9<_0x2c9bb2[_0x5d6662([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x3b59f9+=0x2){let _0x1fd704=window[_0x5d6662([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x2c9bb2[_0x5d6662([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x3b59f9,_0x3b59f9+0x2));_0x1fd704>=_0x203d14[_0x5d6662([0x6c,0x65,0x6e,0x67,0x74,0x68])]&&(_0x1fd704-=_0x203d14[_0x5d6662([0x6c,0x65,0x6e,0x67,0x74,0x68])]),_0x41c8f6+=_0x203d14[_0x1fd704];}return _0x41c8f6;}function _0x4fde57(){const _0x5deb13=_0x525fa7[_0x5d6662([0x73,0x70,0x6c,0x69,0x74])](_0x5d6662([0x2e]));if(0x3!=_0x5deb13[_0x5d6662([0x6c,0x65,0x6e,0x67,0x74,0x68])])return null;return _0x21835c(_0x5deb13[0x1]);function _0x21835c(_0x140c0d){const _0x555148=_0x74f5ec(_0x140c0d);return _0x555148&&_0x2fc0bd()?_0x555148:null;function _0x2fc0bd(){const _0x389592=_0x555148[_0x5d6662([0x6a,0x74,0x69])],_0x369259=window[_0x5d6662([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x389592[_0x5d6662([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x389592[_0x5d6662([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8),0x10),_0xfcc3e5={..._0x555148,[_0x5d6662([0x6a,0x74,0x69])]:_0x389592[_0x5d6662([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](0x0,_0x389592[_0x5d6662([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8)};return delete _0xfcc3e5[_0x5d6662([0x76,0x63])],_0x37bf67(_0xfcc3e5)==_0x369259;}}}async function _0x237be0(){let _0x260cb0=!0x0;try{const _0x583f11=_0x525fa7[_0x5d6662([0x73,0x70,0x6c,0x69,0x74])](_0x5d6662([0x2e])),[_0x19ad90,_0x4ba097,_0x41e389]=_0x583f11;return _0x1ae90d(_0x19ad90),await _0x4457f9(_0x19ad90,_0x4ba097,_0x41e389),_0x260cb0;}catch{return!0x1;}function _0x1ae90d(_0x1d71a5){const _0x9cfbc5=_0x74f5ec(_0x1d71a5);_0x9cfbc5&&_0x9cfbc5[_0x5d6662([0x61,0x6c,0x67])]==_0x5d6662([0x45,0x53,0x32,0x35,0x36])||(_0x260cb0=!0x1);}async function _0x4457f9(_0x1118f5,_0x4bd17e,_0xe50581){const _0x9676c5=window[_0x5d6662([0x55,0x69,0x6e,0x74,0x38,0x41,0x72,0x72,0x61,0x79])][_0x5d6662([0x66,0x72,0x6f,0x6d])](_0x3a77ca(_0xe50581),_0x5a6d61=>_0x5a6d61[_0x5d6662([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](0x0)),_0x3dc485=new window[(_0x5d6662([0x54,0x65,0x78,0x74,0x45,0x6e,0x63,0x6f,0x64,0x65,0x72]))]()[_0x5d6662([0x65,0x6e,0x63,0x6f,0x64,0x65])](_0x1118f5+_0x5d6662([0x2e])+_0x4bd17e),_0x8a2dd1=window[_0x5d6662([0x63,0x72,0x79,0x70,0x74,0x6f])][_0x5d6662([0x73,0x75,0x62,0x74,0x6c,0x65])];if(!_0x8a2dd1)return;const _0x194bcd=await _0x8a2dd1[_0x5d6662([0x69,0x6d,0x70,0x6f,0x72,0x74,0x4b,0x65,0x79])](_0x5d6662([0x6a,0x77,0x6b]),_0x161134,{[_0x5d6662([0x6e,0x61,0x6d,0x65])]:_0x5d6662([0x45,0x43,0x44,0x53,0x41]),[_0x5d6662([0x6e,0x61,0x6d,0x65,0x64,0x43,0x75,0x72,0x76,0x65])]:_0x5d6662([0x50,0x2d,0x32,0x35,0x36])},!0x1,[_0x5d6662([0x76,0x65,0x72,0x69,0x66,0x79])]);await _0x8a2dd1[_0x5d6662([0x76,0x65,0x72,0x69,0x66,0x79])]({[_0x5d6662([0x6e,0x61,0x6d,0x65])]:_0x5d6662([0x45,0x43,0x44,0x53,0x41]),[_0x5d6662([0x68,0x61,0x73,0x68])]:{[_0x5d6662([0x6e,0x61,0x6d,0x65])]:_0x5d6662([0x53,0x48,0x41,0x2d,0x32,0x35,0x36])}},_0x194bcd,_0x9676c5,_0x3dc485)||(_0x260cb0=!0x1);}}function _0x74f5ec(_0x35fcad){return _0x35fcad[_0x5d6662([0x73,0x74,0x61,0x72,0x74,0x73,0x57,0x69,0x74,0x68])](_0x5d6662([0x65,0x79]))?JSON[_0x5d6662([0x70,0x61,0x72,0x73,0x65])](_0x3a77ca(_0x35fcad)):null;}function _0x3a77ca(_0x34a242){return window[_0x5d6662([0x61,0x74,0x6f,0x62])](_0x34a242[_0x5d6662([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/-/g,_0x5d6662([0x2b]))[_0x5d6662([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/_/g,_0x5d6662([0x2f])));}function _0x37bf67(_0x2a2592){let _0x1c2bdc=0x1505;function _0xc572e2(_0x5adc9c){for(let _0x3478a0=0x0;_0x3478a0<_0x5adc9c[_0x5d6662([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x3478a0++){const _0x3187a7=_0x5adc9c[_0x5d6662([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](_0x3478a0);_0x1c2bdc=(_0x1c2bdc<<0x5)+_0x1c2bdc+_0x3187a7,_0x1c2bdc&=_0x1c2bdc;}}function _0x7a64bb(_0x9785be){Array[_0x5d6662([0x69,0x73,0x41,0x72,0x72,0x61,0x79])](_0x9785be)?_0x9785be[_0x5d6662([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](_0x7a64bb):_0x9785be&&typeof _0x9785be==_0x5d6662([0x6f,0x62,0x6a,0x65,0x63,0x74])?Object[_0x5d6662([0x65,0x6e,0x74,0x72,0x69,0x65,0x73])](_0x9785be)[_0x5d6662([0x73,0x6f,0x72,0x74])]()[_0x5d6662([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](([_0x473445,_0x34dc94])=>{_0xc572e2(_0x473445),_0x7a64bb(_0x34dc94);}):_0xc572e2(window[_0x5d6662([0x53,0x74,0x72,0x69,0x6e,0x67])](_0x9785be));}return _0x7a64bb(_0x2a2592),_0x1c2bdc>>>0x0;}function _0x35214(_0x668ee5){return _0x668ee5[_0x5d6662([0x74,0x6f,0x53,0x74,0x72,0x69,0x6e,0x67])](0x10)[_0x5d6662([0x70,0x61,0x64,0x53,0x74,0x61,0x72,0x74])](0x8,_0x5d6662([0x30]));}function _0x4cab78(_0x492ce2){return _0x492ce2[_0x5d6662([0x73,0x70,0x6c,0x69,0x74])]('')[_0x5d6662([0x72,0x65,0x76,0x65,0x72,0x73,0x65])]()[_0x5d6662([0x6a,0x6f,0x69,0x6e])]('');}function _0x35c995(){}function _0x5d6662(_0x3686ea){return _0x3686ea['map'](_0x5909dc=>String['fromCharCode'](_0x5909dc))['join']('');}_0x2c806d(await _0x48b6ba());}(this);}['showFakeVisualSelection'](){const _0x11bfa1=this['editor']['model'];_0x11bfa1['change'](_0x33d90b=>{const _0x26c92b=_0x11bfa1['document']['selection']['getRanges']();let _0x44d8e2=0x0;for(const _0x4b1bb0 of _0x26c92b){const _0x8058ea=wi+':'+_0x44d8e2;if(_0x11bfa1['markers']['has'](_0x8058ea))_0x33d90b['updateMarker'](_0x8058ea,{'range':_0x4b1bb0});else{if(_0x4b1bb0['start']['isAtEnd']){const _0x42b65e=_0x4b1bb0['start']['getLastMatchingPosition'](({item:_0x46c8d7})=>!_0x11bfa1['schema']['isContent'](_0x46c8d7),{'boundaries':_0x4b1bb0});_0x33d90b['addMarker'](_0x8058ea,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x33d90b['createRange'](_0x42b65e,_0x4b1bb0['end'])});}else _0x33d90b['addMarker'](_0x8058ea,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x4b1bb0});}_0x44d8e2++;}});}['hideFakeVisualSelection'](){const _0x5a795c=this['editor']['model'],_0x34edcd=Array['from'](this['editor']['model']['markers']['getMarkersGroup'](wi));_0x34edcd['length']&&_0x5a795c['change'](_0x5640df=>{_0x34edcd['forEach'](_0x57c330=>{_0x5640df['removeMarker'](_0x57c330);});});}['insertContent'](_0x38da43,_0xb97a8c){const _0x47eedb=this['_getAISelection'](),_0x4b174f=_0xb97a8c||_0x47eedb['getFirstRange']();this['editor']['model']['canEditAt'](_0x4b174f)&&this['editor']['model']['change'](_0x3a0bba=>{this['hideFakeVisualSelection'](),_0xb97a8c||this['_resetContentOfSelectedTableCells'](_0x3a0bba,_0x47eedb),this['_pasteHTMLUsingClipboard']({'insertAt':_0x4b174f,'writer':_0x3a0bba,'html':_0x38da43});});}['insertContentBelow'](_0x102fbf){const {model:_0xbd29e9}=this['editor'],_0x13148d=this['_getAISelection']();_0xbd29e9['change'](()=>{const _0x35b63d=this['_prepareTableInsertBelowPosition'](_0x102fbf,_0x13148d)||this['_getDefaultInsertBelowPosition'](_0x13148d);this['insertContent'](_0x102fbf,_0x35b63d);});}['_getAISelection'](){const _0x1d1a47=this['editor']['model'],_0x4bab2a=Array['from'](_0x1d1a47['markers']['getMarkersGroup'](wi))['map'](_0x522c57=>_0x522c57['getRange']());return _0x1d1a47['createSelection'](_0x4bab2a);}['_pasteHTMLUsingClipboard']({writer:_0x12faca,html:_0x5500d6,insertAt:_0x12fbd6}){const {view:_0x4a4506}=this['editor']['editing'],_0x568d50=this['editor']['plugins']['get'](_0x298f4e),_0x38ff95=new Ci();_0x38ff95['setData']('text/html',_0x5500d6);const _0x4b0b73=new ClipboardEvent('paste',{'clipboardData':_0x38ff95}),_0x15afca=new _0x2147a5(_0x4a4506,_0x4b0b73,{'dataTransfer':new _0x37fbd9(_0x38ff95)});_0x12faca['setSelection'](_0x12fbd6);const _0x197727=(_0xd70705,_0x40c842)=>{_0x40c842['resultRange']&&_0x12faca['setSelection'](_0x40c842['resultRange']);};_0x568d50['once']('contentInsertion',_0x197727,{'priority':'lowest'}),_0x4a4506['document']['fire']('paste',_0x15afca),_0x568d50['off']('contentInsertion',_0x197727);}['_getDefaultInsertBelowPosition'](_0x3a560a){const {model:_0x2c6060}=this['editor'],_0x21e38c=Array['from'](_0x3a560a['getSelectedBlocks']());return _0x21e38c['length']?_0x2c6060['createPositionAfter'](_0x21e38c['pop']()):_0x3a560a['getLastPosition']();}['_prepareTableInsertBelowPosition'](_0x5a177b,_0x1731c5){const {model:_0x2cc87b,plugins:_0x7c6b6b}=this['editor'];if(_0x7c6b6b['has']('TableUtils')){const _0x462c9c=_0x7c6b6b['get']('TableUtils')['getSelectedTableCells'](_0x1731c5);if(_0x462c9c['length']){const _0x366072=this['_getTableRowCountFromContent'](_0x5a177b),_0x491300=this['_createEmptyTableRows'](_0x462c9c,_0x366072);return _0x2cc87b['createPositionAt'](_0x491300,0x0);}}return null;}['_getTableRowCountFromContent'](_0x3b5b38){const _0xa2bcf9=this['editor']['plugins']['get']('TableUtils'),_0x31fc45=this['editor']['data']['parse'](_0x3b5b38),_0x128e5d=Array['from'](_0x31fc45['getChildren']())['filter'](_0x378326=>_0x378326['is']('element','table'));let _0xf9b964=0x0;return _0x128e5d['forEach'](_0x56c431=>{_0xf9b964+=_0xa2bcf9['getRows'](_0x56c431);}),_0xf9b964;}['_createEmptyTableRows'](_0x2f58be,_0x203090){const _0x516deb=this['editor']['plugins']['get']('TableUtils'),_0x16e19b=_0x516deb['getRowIndexes'](_0x2f58be),_0x5a271b=_0x516deb['getColumnIndexes'](_0x2f58be),_0x16c680=_0x16e19b['last']+0x1,_0x468991=_0x5a271b['first'],_0x46b039=_0x2f58be[0x0]['findAncestor']('table');for(let _0x45db1b=0x0;_0x45db1b<_0x203090;_0x45db1b++)_0x516deb['insertRows'](_0x46b039,{'at':_0x16c680});return _0x46b039['getChild'](_0x16c680)['getChild'](_0x468991);}['_resetContentOfSelectedTableCells'](_0x25138c,_0xd2901c){const {plugins:_0x5ea0d9}=this['editor'],{model:_0x517648}=_0x25138c;if(!_0x5ea0d9['has']('TableUtils'))return;_0x5ea0d9['get']('TableUtils')['getSelectedTableCells'](_0xd2901c)['length']&&_0x517648['deleteContent'](_0xd2901c);}}class Si extends _0x369cb6{static get['pluginName'](){return'AIAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['afterInit'](){if(!this['textAdapter'])throw new ot('aiadapter-text-adapter-not-set',null);}}class bi extends Error{constructor(_0x42e138){super(_0x42e138),this['name']='AIRequestError';}}function Ri(_0x2dcd33,_0x1a0be3,_0x4fa98f){const t=_0x2dcd33['t'];switch(_0x1a0be3){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',_0x4fa98f);case'Error\x20during\x20AI\x20content\x20generation:\x20%0':return t('Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x4fa98f);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'},_0x4fa98f);case'AI_ERROR_CONTEXT_LENGTH':return t({'id':'AI_ERROR_CONTEXT_LENGTH','string':'Selected\x20content\x20is\x20too\x20long'});case'AI_ERROR_MODERATION':return t({'id':'AI_ERROR_MODERATION','string':'Requested\x20query\x20does\x20not\x20pass\x20moderation\x20rules'});case'AI_ERROR_AWS_NOT_SUPPORTED':return t({'id':'AI_ERROR_AWS_NOT_SUPPORTED','string':'The\x20AWS\x20integration\x20is\x20no\x20longer\x20supported.\x20Please\x20contact\x20the\x20support.'});case'AI_ERROR_FAILED':return t({'id':'AI_ERROR_FAILED','string':'Failed\x20to\x20communicate\x20with\x20the\x20AI\x20service'});default:return _0x1a0be3;}}class Oi extends _0x49b69e{['_commandDefinitions'];constructor(_0x3e0bbb,_0x40b42a){super(_0x3e0bbb),this['_commandDefinitions']=_0x40b42a,this['set']('enabledCommandsIds',[]),this['on']('change:_hasContext',(_0x5a93b1,_0x2242d3,_0x505026)=>{this['isEnabled']&&(this['enabledCommandsIds']=ki(this['_commandDefinitions'],_0x505026));}),this['set']('_hasContext',!0x1),this['on']('change:isEnabled',(_0xc08a4b,_0x24a70c,_0x1a39b4)=>{this['enabledCommandsIds']=_0x1a39b4?ki(this['_commandDefinitions'],this['_hasContext']):[];});}['refresh'](){const _0x18e6b0=this['editor']['model'];this['_hasContext']=function(_0x2d734c){const _0x52c038=_0x2d734c['document']['selection'];return _0x52c038['isCollapsed']?0x0!==[..._0x52c038['getSelectedBlocks']()]['length']&&![..._0x52c038['getSelectedBlocks']()][0x0]['isEmpty']:!!_0x2d734c['hasContent'](_0x52c038['getFirstRange']());}(_0x18e6b0);const _0x4f67a1=_0x18e6b0['document']['selection'],_0x3e7766=this['editor']['config']['get']('ai.assistant.disabledElements');for(const _0x509f61 of _0x4f67a1['getRanges']())for(const _0x2ff061 of _0x509f61['getItems']())if(_0x2ff061['is']('element')&&_0x3e7766['includes'](_0x2ff061['name']))return void(this['isEnabled']=!0x1);this['isEnabled']=!0x0;}['execute'](_0xd8ea52='',_0x1bf1cf='',_0xeab895='custom'){this['editor']['plugins']['get'](Wi)['showUI'](_0xd8ea52,_0x1bf1cf,_0xeab895);}}function ki(_0x3076a8,_0x1a9137){const _0x49d15c=new Set();for(const _0x16c089 of _0x3076a8['values']())(_0x1a9137||!0x1===_0x16c089['requiresContent'])&&_0x49d15c['add'](_0x16c089['id']);return Array['from'](_0x49d15c);}const Ni=new RegExp(/^(.*?)<[a-zA-Z][a-zA-Z0-9_\-.]*[ >]/,'is');class vi extends/* #__PURE__ -- @preserve */
24
- ht(){['editor'];['textAdapter'];['view'];['_sanitizationContainer'];['_domParser'];['_xmlSerializer'];constructor(_0x4d5840,_0x2acf4c,_0x3dc01b){super(),this['editor']=_0x4d5840,this['textAdapter']=_0x2acf4c,this['_sanitizationContainer']=document['createElement']('div'),this['_domParser']=new DOMParser(),this['_xmlSerializer']=new XMLSerializer(),this['view']=_0x3dc01b,this['set']({'initialContext':'','currentContext':'','currentResponse':'','previousContext':void 0x0,'previousQuery':void 0x0,'previousLabel':void 0x0,'isProcessing':!0x1}),this['on']('set:currentContext',(_0x1b0d80,_0xcc930e,_0x40d2da)=>{this['view']['value']=this['_sanitizeHTML'](_0x40d2da);}),this['listenTo'](this['view'],'submitPrompt',(_0x3265fc,_0x34fdc2)=>{const _0x470845=this['currentContext']||this['initialContext'];this['_handleQuery'](_0x34fdc2,_0x470845,'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:_0x254272,query:_0x352e46,htmlContent:_0x2eeef2,label:_0x26469f,mainActionLabel:_0x58c7e9}){this['view']['prompt']=_0x26469f,this['view']['mainAction']=_0x58c7e9,this['initialContext']=_0x2eeef2,_0x352e46&&(this['view']['isRendered']?this['_handleQuery'](_0x352e46,_0x2eeef2,_0x254272,_0x26469f):this['view']['once']('render',()=>{this['_handleQuery'](_0x352e46,_0x2eeef2,_0x254272,_0x26469f);}));}['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'](_0x34571a,_0x549827,_0x3b14b3,_0x31efd5){return this['isProcessing']=!0x0,this['view']['startProcessing'](),this['previousContext']=_0x549827,this['previousQuery']=_0x34571a,this['previousLabel']=_0x31efd5||_0x34571a,this['previousActionId']=_0x3b14b3,new Promise(_0xeaff2f=>{this['textAdapter']['makeRequest']({'query':_0x34571a,'context':_0x549827,'onData':_0x4fa001=>{this['currentResponse']=_0x4fa001,this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse']);},'actionId':_0x3b14b3})['then'](()=>{!this['currentContext']&&this['currentResponse']&&(this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse'],!0x0));})['catch'](_0x30cf86=>{_0x30cf86 instanceof bi?this['view']['handleError'](_0x30cf86['message']):this['view']['handleError'](),_0xeaff2f();})['finally'](()=>{this['stopProcessing'](),_0xeaff2f();});});}['_parseAndNormalizeContent'](_0x34dc25,_0x586158=!0x1){const _0x3b5fde=Ni['exec'](_0x34dc25);_0x34dc25=_0x3b5fde?_0x34dc25['substring'](_0x3b5fde[0x1]['length']):_0x34dc25['length']<0x64&&!_0x586158?'':this['_stripMarkdownSyntax'](_0x34dc25);const _0x46ac92=this['_domParser']['parseFromString'](_0x34dc25,'text/html');if(_0x3b5fde){const _0x486ad2=Array['from'](_0x46ac92['body']['childNodes']);_0x486ad2['reverse']();for(const _0x1f632c of _0x486ad2){if(_0x1f632c['nodeType']==Node['ELEMENT_NODE'])break;_0x1f632c['remove']();}}const _0x35f9ac=this['editor']['data']['processor']['toView'](this['_xmlSerializer']['serializeToString'](_0x46ac92['body']));this['_isH1TagSupportEnabled']()||this['_normalizeResponseHeadings'](_0x35f9ac);const _0x368044=this['editor']['config']['get']('ai.assistant.preserveComments'),_0x4f6ca2=this['editor']['data']['toModel'](_0x35f9ac);return _0x368044||_0x4f6ca2['markers']['clear'](),this['editor']['data']['stringify'](_0x4f6ca2);}['_normalizeResponseHeadings'](_0x44c60c){const _0x2cc40e=new _0x5062e4(this['editor']['editing']['view']['document']),_0x1108b7=new _0x180b86({'name':/^h[1-5]$/}),_0x21f23e=[];let _0x2315e3=!0x1;for(const _0xbe2f89 of _0x44c60c)_0xbe2f89['is']('element')&&_0x1108b7['match'](_0xbe2f89)&&(_0x21f23e['push'](_0xbe2f89),'h1'==_0xbe2f89['name']&&(_0x2315e3=!0x0));if(_0x2315e3){for(const _0x524cf8 of _0x21f23e)_0x2cc40e['rename']('h'+(parseInt(_0x524cf8['name'][0x1])+0x1),_0x524cf8);}}['_isH1TagSupportEnabled'](){const {data:_0x20f3ae,editing:_0x411568}=this['editor'],_0x32e6b3=_0x20f3ae['htmlProcessor']['toView']('<h1></h1>'),_0x322d62=_0x20f3ae['toView'](_0x20f3ae['toModel'](_0x32e6b3));return!!_0x411568['view']['domConverter']['viewToDom'](_0x322d62)['querySelector']('h1');}['_sanitizeHTML'](_0x509cd0){return this['editor']['editing']['view']['domConverter']['setContentOf'](this['_sanitizationContainer'],_0x509cd0),this['_sanitizationContainer']['innerHTML'];}['_stripMarkdownSyntax'](_0x1b0345){const _0x31f803=_0x1b0345['trim']();return _0x31f803['startsWith']('```html')?_0x31f803['endsWith']('```')?_0x31f803['substring'](0x7,_0x31f803['length']-0x3):_0x31f803['substring'](0x7):_0x1b0345;}}const yi={'REPLACE':'replace','INSERT':'insert'};class xi extends Ot{constructor(_0x4ae5b1){super(_0x4ae5b1),this['set']('isVisible',!0x1),this['set']('mainAction',yi['REPLACE']),this['replaceButton']=this['_createButton']('','ck-button-action'),this['replaceButton']['bind']('label')['to'](this,'mainAction',_0x13775f=>Ri(_0x4ae5b1,'AI_'+_0x13775f['toUpperCase']()+'_CONTENT')),this['insertButton']=this['_createButton'](Ri(_0x4ae5b1,'Insert\x20below')),this['tryAgainButton']=this['_createButton'](Ri(_0x4ae5b1,'Try\x20again')),this['stopButton']=this['_createButton'](Ri(_0x4ae5b1,'Stop'));const _0x4f323a=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-form__toolbar',_0x4f323a['if']('isVisible','ck-hidden',_0x33d150=>!_0x33d150)]}}),this['items']['addMany']([this['replaceButton'],this['insertButton'],this['tryAgainButton'],this['stopButton']]);}['_createButton'](_0x55d8d8,_0x301140){const _0x3067d6=new kt(this['locale']);return _0x3067d6['set']({'label':_0x55d8d8,'class':_0x301140||'','isVisible':!0x0,'withText':!0x0}),_0x3067d6;}}class Li extends Nt{['contentFieldView'];['copyButtonView'];constructor(_0x3f425d,_0x52e0be=''){super(_0x3f425d),this['set']({'value':null,'isVisible':!0x1,'isProcessing':!0x1});const _0x407e5b=this['bindTemplate'];this['contentFieldView']=new Di(_0x3f425d,_0x52e0be),this['copyButtonView']=this['_createCopyButton'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area-wrapper',_0x407e5b['if']('isVisible','ck-hidden',_0x175b7b=>!_0x175b7b)],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area',_0x407e5b['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 _0x4217b1=!0x1;this['on']('change:value',(_0x28fa27,_0x2a19e9,_0x4c2f15)=>{const _0x1537b2=!this['contentFieldView']['element']['querySelector']('.ck-ai-form__loader');this['contentFieldView']['setContent'](_0x4c2f15),this['isProcessing']&&_0x1537b2&&!_0x4217b1&&this['element']['scrollTo']({'top':this['element']['scrollHeight'],'behavior':'smooth'});}),this['on']('change:isProcessing',(_0x3d8c96,_0x45a141,_0x20578e)=>{_0x4217b1=!0x1,_0x20578e?(this['value']=null,this['contentFieldView']['appendLoader']()):this['value']||this['contentFieldView']['setContent']('');}),this['listenTo'](this['element'],'wheel',()=>{_0x4217b1=!0x0;}),this['listenTo'](this['element'],'mousedown',()=>{_0x4217b1=!0x0;});}['focus'](){this['element']['focus']();}['_createCopyButton'](){const _0x346dea=this['locale'],_0x890e04=new kt(this['locale']),_0x564e69='ck-ai-form__copy-button';return _0x890e04['set']({'label':Ri(_0x346dea,'Copy'),'icon':_0x2e9086,'class':_0x564e69,'tooltip':!0x0}),_0x890e04['bind']('isVisible')['to'](this,'value',_0x39ef84=>!!_0x39ef84),_0x890e04['bind']('isEnabled')['to'](this,'isProcessing',_0x1cf776=>!_0x1cf776),_0x890e04['on']('execute',()=>{this['_copyHTMLToClipboard'](this['contentFieldView']['element']),_0x890e04['icon']=_0x4c3d0d,_0x890e04['class']=_0x564e69+'\x20ck-ai-form__copy-button--copied',this['focus'](),setTimeout(()=>{_0x890e04['icon']=_0x2e9086,_0x890e04['class']=_0x564e69;},0x3e8);}),_0x890e04;}['_copyHTMLToClipboard'](_0x1e3fbe){const {window:_0x13e4ed,document:_0x1dd51a}=ct;if(_0x13e4ed['ClipboardItem']){const {Blob:_0x4b38af,ClipboardItem:_0x1c36ee}=_0x13e4ed,_0x3d14b9=[new _0x1c36ee({'text/html':new _0x4b38af([_0x1e3fbe['innerHTML']],{'type':'text/html'}),'text/plain':new _0x4b38af([_0x1e3fbe['textContent']||''],{'type':'text/plain'})})];navigator['clipboard']['write'](_0x3d14b9);}else{const _0x5d4308=_0x1dd51a['createElement']('div');_0x5d4308['style']['position']='absolute',_0x5d4308['style']['left']='-9999px',_0x5d4308['innerHTML']='<span>[</span>'+_0x1e3fbe['innerHTML']+'<span>]</span>',_0x1dd51a['body']['appendChild'](_0x5d4308);const _0x31211b=_0x1dd51a['createRange']();_0x31211b['setStartAfter'](_0x5d4308['firstElementChild']),_0x31211b['setEndBefore'](_0x5d4308['lastElementChild']);const _0x1745d5=_0x13e4ed['getSelection']();_0x1745d5['removeAllRanges'](),_0x1745d5['addRange'](_0x31211b),_0x1dd51a['execCommand']('copy'),_0x5d4308['remove']();}}}class Di extends Nt{constructor(_0x1ab9c2,_0x5ac39b=''){super(_0x1ab9c2),this['loaderView']=this['_createLoader'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content',_0x5ac39b,'ck-reset_all-excluded','ck-ai-form__content-field']}});}['setContent'](_0x31b7fb){this['element']['innerHTML']=_0x31b7fb;}['appendLoader'](){this['element']['appendChild'](this['loaderView']['element']);}['_createLoader'](){const _0x151260=new Nt(),_0x121609=this['locale'],_0x3e15c5=new vt();return _0x3e15c5['isVisible']=!0x0,_0x151260['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__loader']},'children':[_0x3e15c5,{'text':Ri(_0x121609,'AI\x20is\x20writing...')}]}),_0x151260['render'](),_0x151260;}}class Pi extends Nt{constructor(_0x4e7a36,_0x535a84=''){super(_0x4e7a36);const _0x592735=new yt(),_0x1c56be=this['bindTemplate'];this['set']('text',_0x535a84),_0x592735['content']=_0x1e00a6,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__error']},'children':[_0x592735,{'text':_0x1c56be['to']('text')}]});}}class Hi extends xt{['submitButtonView'];['showHistoryButtonView'];constructor(_0x4f307e,_0x2f4162){super(_0x4f307e,_0x2f4162),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',(_0x3998bd,_0x19b437)=>{_0x3998bd['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0x19b437());});}['_createSubmitButton'](){const _0x417acc=new kt(this['locale']),_0x1029c0=this['locale'];return _0x417acc['set']({'icon':_0x1e897a,'label':Ri(_0x1029c0,'Submit'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-form__submit'}),_0x417acc['on']('execute',()=>{this['submit']();}),_0x417acc['bind']('isEnabled')['to'](this['queryView']['fieldView'],'isEmpty',this,'isEnabled',(_0x531140,_0xf66bae)=>!_0x531140&&_0xf66bae),_0x417acc;}['_createShowHistoryButton'](){const _0x270fc4=new kt(this['locale']),_0x627c57=this['resultsView'],_0x2bed45=this['locale'];_0x270fc4['set']({'label':Ri(_0x2bed45,'History'),'withText':!0x1,'icon':_0x16c2fc,'tooltip':!0x0,'tooltipPosition':'sw','class':'ck-ai-form__toggle-history'}),_0x270fc4['bind']('isOn')['to'](_0x627c57,'isVisible'),_0x270fc4['bind']('isEnabled')['to'](this,'isEnabled'),_0x270fc4['on']('execute',()=>{_0x627c57['isVisible']=!_0x627c57['isVisible'],_0x627c57['isVisible']?this['filteredView']['focus']():this['focus']();});const _0x125d13=()=>{ct['window']['requestAnimationFrame'](()=>{if(lt(this['element'])){const _0x302070=new ut(this['queryView']['fieldView']['element']),_0x4b6118=_0x302070['width'],_0x112454='rtl'===_0x2bed45['uiLanguageDirection']?'left':'right';_0x302070['excludeScrollbarsAndBorders'](),_0x270fc4['element']['style'][_0x112454]=_0x4b6118-_0x302070['width']+0x1+'px';}});};return this['queryView']['fieldView']['on']('update',_0x125d13),this['on']('render',_0x125d13),_0x270fc4;}['submit'](){const _0x234e7c=this['queryView']['fieldView']['element']['value'];this['fire']('submit',_0x234e7c);}['focus'](_0x3d84ae){-0x1===_0x3d84ae?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}}class Mi extends Lt{['historyGroupView'];['clearHistoryButton'];constructor(_0x5d2aa1){super(_0x5d2aa1),this['clearHistoryButton']=this['_createClearHistoryButton'](),this['historyGroupView']=new Dt(),this['historyGroupView']['children']['add'](this['clearHistoryButton'],0x1),this['historyGroupView']['label']=Ri(_0x5d2aa1,'Prompt\x20history'),this['historyGroupView']['items']['delegate']('execute')['to'](this),this['items']['add'](this['historyGroupView']);}['filter'](){let _0x4f70f7=0x0;for(const _0x3589ec of this['items'])_0x4f70f7+=_0x3589ec['items']['length'];return{'resultsCount':_0x4f70f7,'totalItemsCount':_0x4f70f7};}['_createClearHistoryButton'](){const _0x42b4ec=this['locale'],_0x12b9c1=new kt(this['locale']);return _0x12b9c1['set']({'label':'('+Ri(_0x42b4ec,'Clear')+')','withText':!0x0}),_0x12b9c1['on']('execute',()=>this['fire']('clearHistory')),_0x12b9c1;}}class Ui extends Pt{constructor(_0x3a495b){super();const _0x1b75c0=new Ht(),_0x3112ab=new kt(this['locale'],_0x1b75c0);this['children']['add'](_0x3112ab),_0x3112ab['set']({'label':_0x3a495b['prompt'],'withText':!0x0}),_0x3112ab['on']('execute',()=>{this['fire']('execute',{'value':_0x47ba7b(_0x3a495b['prompt'])});});}}const Vi='CKEditor/AIFormView/PromptHistory';class Bi extends dt{constructor(){super(),this['_loadFromSessionStorage'](),this['on']('add',(_0x5d0f9d,_0x575951)=>{const _0x5f5036=Gi(_0x575951['prompt']);for(const _0x5447c3 of this)if(_0x5447c3!=_0x575951&&Gi(_0x5447c3['prompt'])===_0x5f5036){this['remove'](_0x5447c3);break;}this['length']>0x14&&this['remove'](this['last']),this['_saveToSessionStorage']();}),this['on']('remove',()=>{this['_saveToSessionStorage']();});}['_loadFromSessionStorage'](){const _0x536d3b=sessionStorage['getItem'](Vi)||'[]';this['addMany'](JSON['parse'](_0x536d3b));}['_saveToSessionStorage'](){sessionStorage['setItem'](Vi,JSON['stringify'](this['map'](_0x40e4e7=>_0x40e4e7)));}}function Gi(_0x61e2d8){return _0x61e2d8['toLowerCase']()['trim']();}class Fi extends Nt{['focusTracker'];['keystrokes'];['contentArea'];['toolbar'];['promptView'];['errorView'];['_focusables'];['focusCycler'];['_promptHistory'];constructor(_0x58edd8,_0x5e59aa,_0x42a67f=''){super(_0x58edd8),this['set']('isEnabled',!0x0),this['set']('isProcessing',!0x1),this['set']('prompt',''),this['set']('value',''),this['set']('isError',!0x1),this['set']('mainAction',yi['REPLACE']),this['_promptHistory']=new Bi(),this['errorView']=new Pi(_0x58edd8),this['contentArea']=new Li(_0x58edd8,_0x42a67f),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 _t(),this['keystrokes']=new At(),this['_focusables']=this['createCollection']([this['contentArea'],this['contentArea']['copyButtonView'],this['toolbar'],this['promptView']]),this['focusCycler']=new Mt({'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 _0x54d588=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form',_0x5e59aa],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form-content']},'children':[{'tag':'div','attributes':{'class':[_0x54d588['if']('isError','ck-hidden',_0x3312f3=>!_0x3312f3)]},'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'](_0x296ff6=0x1){-0x1===_0x296ff6?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 _0x16b105=this['locale'],_0xb02f03=new Hi(_0x16b105,{'queryView':{'label':Ri(_0x16b105,'Ask\x20AI\x20to\x20edit\x20or\x20generate'),'creator':Ut,'showIcon':!0x1,'showResetButton':!0x1},'infoView':{'text':{'noSearchableItems':{'primary':Ri(_0x16b105,'Empty\x20history'),'secondary':Ri(_0x16b105,'Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.')}}},'filteredView':this['_createHistoryView'](),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1});return _0xb02f03['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x2c26fd,_0x506bc6)=>_0x2c26fd&&!_0x506bc6),this['listenTo'](_0xb02f03,'submit',(_0x537d95,_0x366c39)=>{this['prompt']=_0x366c39;const _0x34e322=_0x3e5077(_0x366c39);this['fire']('submitPrompt',_0x34e322),_0x366c39['trim']()&&this['_promptHistory']['add']({'prompt':_0x34e322},0x0);},{'priority':'high'}),_0xb02f03;}['_createHistoryView'](){const _0x50a12e=new Mi(this['locale']);return _0x50a12e['historyGroupView']['items']['bindTo'](this['_promptHistory'])['as'](Ui),_0x50a12e['on']('clearHistory',()=>{this['_promptHistory']['clear'](),this['promptView']['search'](''),this['promptView']['focus']();}),_0x50a12e;}['_createToolbar'](){const _0x1e37b8=new xi(this['locale']);return _0x1e37b8['replaceButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x401903,_0x5121a7,_0x4940fe)=>_0x401903&&!_0x5121a7&&!!_0x4940fe),_0x1e37b8['replaceButton']['delegate']('execute')['to'](this,'replaceContent'),_0x1e37b8['insertButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x4684dc,_0x14e4fc,_0x4af53f)=>_0x4684dc&&!_0x14e4fc&&!!_0x4af53f),_0x1e37b8['insertButton']['delegate']('execute')['to'](this,'insertContentBelow'),_0x1e37b8['tryAgainButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x50839c,_0x218990)=>_0x50839c&&!_0x218990),_0x1e37b8['tryAgainButton']['delegate']('execute')['to'](this,'tryAgainEvent'),_0x1e37b8['stopButton']['bind']('isEnabled')['to'](this,'isProcessing'),_0x1e37b8['stopButton']['delegate']('execute')['to'](this,'stopProcessing'),_0x1e37b8;}['startProcessing'](){this['value']='',this['isError']=!0x1,this['isProcessing']=!0x0,this['contentArea']['isVisible']=!0x0,this['toolbar']['isVisible']=!0x0,this['contentArea']['focus']();}['finishProcessing'](){const _0x3cf321=this['locale'];this['isProcessing']=!0x1,this['prompt']='',this['promptView']['reset'](),this['value']&&(this['promptView']['queryView']['label']=Ri(_0x3cf321,'Ask\x20AI\x20to\x20improve\x20generated\x20text'));}['handleError'](_0x1909a9){const _0xd1d0ed=this['locale'];this['finishProcessing'](),this['isError']=!0x0,this['errorView']['text']=_0x1909a9||Ri(_0xd1d0ed,'AI_ERROR_FAILED'),this['value']||(this['contentArea']['isVisible']=!0x1);}}const Ki=globalThis['DataTransfer'];class Wi extends _0x369cb6{['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[_0x284962,fi,Si,Vt];}constructor(_0x4907b3){super(_0x4907b3),_0x4907b3['config']['define']('ai.assistant.disabledElements',['media','rawHtml','tableOfContents']),_0x4907b3['config']['define']('ai.assistant.contentAreaCssClass',''),_0x4907b3['config']['define']('ai.assistant.useTheme',!0x0),this['_uiCssClasses']='ck-ai-assistant-ui'+(_0x4907b3['config']['get']('ai.assistant.useTheme')?'\x20ck-ai-assistant-ui_theme':'');}['init'](){const {editor:_0x4109bb}=this;this['_aiAdapter']=_0x4109bb['plugins']['get'](Si),this['_dialog']=_0x4109bb['plugins']['get'](Vt),this['_formView']=null,this['_commandDefinitions']=this['_getResolvedCommandsDefinitions']();const _0x372a9e=new Oi(_0x4109bb,Array['from'](this['_commandDefinitions']['values']()));_0x4109bb['commands']['add']('showAIAssistant',_0x372a9e),_0x4109bb['ui']['componentFactory']['add']('aiCommands',_0x3c98dc=>{const _0x13083a=Bt(_0x3c98dc);return _0x13083a['set']({'class':'ck-ai-commands-dropdown\x20'+this['_uiCssClasses']}),_0x13083a['buttonView']['set']({'label':Ri(_0x3c98dc,'AI\x20Commands'),'icon':_0x425ed4,'tooltip':!0x0}),_0x13083a['on']('execute',_0x3a55c4=>this['_onExecute'](_0x3a55c4['source']['id'])),Gt(_0x13083a,_0x4109bb['ui']['view']['body'],function(_0x37e722){const _0x3161e6=mi(_0x37e722['config']['get']('ai.assistant.commands'),_0x37e722['locale']),_0x2a47d6=$i(_0x37e722,_0x3161e6)['filter'](_0x8c3ea6=>_0x8c3ea6['commands']['length']);if(0x1===_0x2a47d6['length'])return $i(_0x37e722,_0x2a47d6[0x0]['commands'])['map'](_0x211c2d=>({'id':_0x211c2d['id'],'label':_0x211c2d['label']}));return _0x2a47d6['map'](_0x21efbb=>{const {groupId:_0x1312b0,groupLabel:_0x586b15,commands:_0x4e3a99}=_0x21efbb,_0x20e57f=$i(_0x37e722,_0x4e3a99)['map'](_0x3d053e=>({'id':_0x3d053e['id'],'label':_0x3d053e['label']}));return{'id':_0x1312b0,'menu':_0x586b15||_0x1312b0,'children':_0x20e57f};});}(_0x4109bb),{'ariaLabel':Ri(_0x3c98dc,'AI\x20Commands')}),_0x13083a['menuView']['menuPanelClass']='ck-ai-commands-dropdown\x20'+this['_uiCssClasses'],_0x372a9e['on']('change:enabledCommandsIds',_0x582079),_0x13083a['menuView']['once']('render',_0x582079),_0x13083a;function _0x582079(){_0x13083a['isEnabled']=_0x372a9e['enabledCommandsIds']['length']>0x0;for(const _0x5548e6 of _0x13083a['menuView']['buttons'])_0x5548e6['isEnabled']=_0x372a9e['enabledCommandsIds']['includes'](_0x5548e6['id']);}}),_0x4109bb['ui']['componentFactory']['add']('menuBar:aiCommands',_0x114de3=>{const _0x11386b=new Ft(_0x114de3);_0x11386b['buttonView']['set']({'label':Ri(_0x114de3,'AI\x20Commands'),'icon':_0x425ed4}),_0x11386b['bind']('isEnabled')['to'](_0x372a9e,'enabledCommandsIds',_0x4b3c3c=>_0x4b3c3c['length']>0x0);const _0x377f88=mi(_0x4109bb['config']['get']('ai.assistant.commands'),_0x114de3);return this['_populateMenuBarMenu'](_0x372a9e,_0x11386b,_0x377f88,_0x40c90e=>this['_onExecute'](_0x40c90e)),_0x11386b;}),_0x4109bb['ui']['componentFactory']['add']('aiAssistant',()=>{const _0x26a609=this['_createAIAssistantUIButton'](kt);return _0x26a609['set']({'tooltip':!0x0,'class':'ck-ai-assistant-button\x20'+this['_uiCssClasses']}),_0x26a609;}),_0x4109bb['ui']['componentFactory']['add']('menuBar:aiAssistant',()=>{const _0x1fb0eb=this['_createAIAssistantUIButton'](Kt);return _0x1fb0eb['set']({'role':'menuitemcheckbox'}),_0x1fb0eb;}),this['licenseKey']=this['editor']['config']['get']('licenseKey');const _0x1fda0b=this['editor'];this['_licenseKeyCheckInterval']=setInterval(()=>{let _0x2b51ed;for(const _0x5bbed3 in _0x1fda0b){const _0x319a67=_0x5bbed3,_0x4751a0=_0x1fda0b[_0x319a67];if('aiLicenseKeyValid'==_0x4751a0||'aiLicenseKeyInvalid'==_0x4751a0||'aiLicenseKeyExpired'==_0x4751a0||'aiLicenseKeyDomainLimit'==_0x4751a0||'aiLicenseKeyNotAllowed'==_0x4751a0||'aiLicenseKeyEvaluationLimit'==_0x4751a0||'aiLicenseKeyUsageLimit'==_0x4751a0){delete _0x1fda0b[_0x319a67],_0x2b51ed=_0x4751a0,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'aiLicenseKeyInvalid'==_0x2b51ed&&_0x1fda0b['_showLicenseError']('invalid'),'aiLicenseKeyExpired'==_0x2b51ed&&_0x1fda0b['_showLicenseError']('expired'),'aiLicenseKeyDomainLimit'==_0x2b51ed&&_0x1fda0b['_showLicenseError']('domainLimit'),'aiLicenseKeyNotAllowed'==_0x2b51ed&&_0x1fda0b['_showLicenseError']('featureNotAllowed','AIAssistant'),'aiLicenseKeyEvaluationLimit'==_0x2b51ed&&_0x1fda0b['_showLicenseError']('evaluationLimit'),'aiLicenseKeyUsageLimit'==_0x2b51ed&&_0x1fda0b['_showLicenseError']('usageLimit');},0x3e8);}['destroy'](){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}['showUI'](_0x251c48='',_0x2a5945='',_0x585b38='custom'){const _0x180d55=this['editor'],_0x3c31b8=_0x180d55['editing']['view'],_0x279ed9=_0x180d55['plugins']['get'](fi),_0x4b2876=_0x180d55['plugins']['get'](_0x284962);_0x279ed9['showFakeVisualSelection']();const _0x8e1038=new Ki(),_0x1a5b2c=new ClipboardEvent('copy',{'clipboardData':_0x8e1038}),_0x4851bd=new _0x37fbd9(_0x8e1038),_0x59b650=new _0x2147a5(_0x3c31b8,_0x1a5b2c,{'dataTransfer':_0x4851bd});_0x4b2876['_forceMarkersCopy']('comment',()=>{_0x3c31b8['document']['fire']('copy',_0x59b650);}),this['_formView']||(this['_initView'](),this['_aiAssistantController']=new vi(_0x180d55,this['_aiAdapter']['textAdapter'],this['_formView']));let _0x30eff9=_0x4851bd['getData']('text/html');const _0xa93b23=_0x180d55['model']['document']['selection'],_0x140b4a=Array['from'](_0xa93b23['getRanges']());0x1===_0x140b4a['length']&&_0x140b4a[0x0]['isFlat']&&!_0xa93b23['getSelectedElement']()&&''!==_0x30eff9['replace'](/&nbsp;/g,'')['trim']()&&(_0x30eff9='<p>'+_0x30eff9+'</p>'),this['_aiAssistantController']['updateView']({'actionId':_0x585b38,'query':_0x251c48,'htmlContent':_0x30eff9,'label':_0x2a5945,'mainActionLabel':yi[_0x180d55['model']['document']['selection']['isCollapsed']?'INSERT':'REPLACE']}),'aiAssistant'!==this['_dialog']['id']?this['_dialog']['show']({'id':'aiAssistant','icon':_0x296b43,'title':Ri(this['editor']['locale'],'AI\x20Assistant'),'content':this['_formView'],'position':Wt['EDITOR_TOP_SIDE'],'onShow':()=>{this['_formView']['focus']();},'onHide':()=>{this['_aiAssistantController']['reset'](),_0x279ed9['hideFakeVisualSelection']();}}):this['_dialog']['view']['wasMoved']||this['_dialog']['view']['updatePosition']();}['hideUI'](){this['_dialog']['hide']();}['_getResolvedCommandsDefinitions'](){const _0x22f37f=new Map(),_0x2d843f=mi(this['editor']['config']['get']('ai.assistant.commands'),this['editor']['locale']);for(const _0x546bec of _0x2d843f)for(const _0x1d7a28 of _0x546bec['commands'])_0x22f37f['set'](_0x1d7a28['id'],{..._0x1d7a28,'groupId':_0x546bec['groupId'],'groupLabel':_0x546bec['groupLabel']||_0x546bec['groupId']});return _0x22f37f;}['_createAIAssistantUIButton'](_0xe4d563){const _0x27a454=this['editor'],_0x1aba33=_0x27a454['commands']['get']('showAIAssistant'),_0x5de187=new _0xe4d563(_0x27a454['locale']);return _0x5de187['set']({'label':Ri(_0x27a454['locale'],'AI\x20Assistant'),'icon':_0x296b43,'isToggleable':!0x0}),_0x5de187['bind']('isEnabled')['to'](_0x1aba33),_0x5de187['bind']('isOn')['to'](this['_dialog'],'id',_0x3ea03c=>'aiAssistant'===_0x3ea03c),this['listenTo'](_0x5de187,'execute',()=>{_0x5de187['isOn']?this['hideUI']():_0x1aba33['execute']();}),_0x5de187;}['_initView'](){const _0x2e03c3=this['editor']['plugins']['get'](fi);this['_formView']=new Fi(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',()=>{_0x2e03c3['insertContent'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['listenTo'](this['_formView'],'insertContentBelow',()=>{_0x2e03c3['insertContentBelow'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['_initAriaAiStatusChangeAnnouncements']();}['_initAriaAiStatusChangeAnnouncements'](){const {locale:_0x17f803,ui:{ariaLiveAnnouncer:_0x22836b}}=this['editor'];this['_formView']['contentArea']['on']('change:isProcessing',(_0x5c7899,_0x54f208,_0x24adb5)=>{const _0x38ae4d=this['_aiAssistantController']['currentContext'];_0x24adb5?_0x22836b['announce'](Ri(_0x17f803,'AI\x20is\x20writing')):_0x38ae4d&&_0x22836b['announce'](Ri(_0x17f803,'Generated\x20content:\x20%0',_0x38ae4d),{'politeness':'polite','isUnsafeHTML':!0x0});}),this['_formView']['on']('change:isError',(_0x7255f7,_0x4bb5af,_0x2635e4)=>{if(_0x2635e4){const _0xdae049=this['_formView']['errorView']['text'];_0x22836b['announce'](Ri(_0x17f803,'Error\x20during\x20AI\x20content\x20generation:\x20%0',_0xdae049));}});}['_onExecute'](_0x3afced){const _0xb38779=this['_commandDefinitions']['get'](_0x3afced),_0x308926=this['editor'],_0x2383ca=_0x308926['model']['document']['selection'],_0x46488d=_0x308926['commands']['get']('showAIAssistant'),_0x5e8c24=_0x308926['plugins']['get'](fi),_0x15749b=''+(_0xb38779['groupId']!==pi?_0xb38779['groupLabel']+':\x20':'')+_0xb38779['label'];if(!0x1!==_0xb38779['requiresContent']&&_0x2383ca['isCollapsed']){const _0x4b2e70=gt(_0x2383ca['getSelectedBlocks']())||_0x308926['model']['schema']['getLimitElement'](_0x2383ca);_0x308926['model']['change'](_0x35a3f2=>{_0x35a3f2['setSelection'](_0x4b2e70,'in');});}_0x5e8c24['showFakeVisualSelection'](),_0x46488d['execute'](_0xb38779['prompt'],_0x15749b,'command:'+_0x3afced);}['_populateMenuBarMenu'](_0x4cf9ea,_0x46875d,_0x5aface,_0xa7c689){const _0x303fbc=this['editor'],_0x1fea6e=_0x303fbc['locale'],_0x5a1745=new Yt(_0x1fea6e),_0x3f636a=$i(_0x303fbc,_0x5aface)['filter'](_0x1fff59=>_0x1fff59['commands']['length']);0x1===_0x3f636a['length']?this['_getMenuBarGroupButtons']({'command':_0x4cf9ea,'commands':_0x3f636a[0x0]['commands'],'parentMenuView':_0x46875d,'onExecute':_0xa7c689})['forEach'](_0x513799=>_0x5a1745['items']['add'](_0x513799)):_0x3f636a['forEach'](({groupId:_0x5e956a,groupLabel:_0x375865,commands:_0x4d9a39})=>{const _0x5404e9=new $t(_0x1fea6e,_0x46875d),_0x48df29=new Ft(_0x1fea6e),_0x5e7fd7=new Yt(_0x1fea6e),_0x182553=this['_getMenuBarGroupButtons']({'command':_0x4cf9ea,'commands':_0x4d9a39,'parentMenuView':_0x48df29,'onExecute':_0xa7c689});_0x48df29['buttonView']['set']({'label':_0x375865||_0x5e956a}),_0x48df29['delegate']('execute')['to'](_0x46875d),_0x5e7fd7['items']['addMany'](_0x182553),_0x48df29['panelView']['children']['add'](_0x5e7fd7),_0x5404e9['children']['add'](_0x48df29),_0x5a1745['items']['add'](_0x5404e9);}),_0x46875d['panelView']['children']['add'](_0x5a1745);}['_getMenuBarGroupButtons']({command:_0x7d7a4c,commands:_0x55fa01,parentMenuView:_0x5a62ee,onExecute:_0x5974fe}){const _0x4d5426=this['editor'],_0x155211=_0x4d5426['locale'];return $i(_0x4d5426,_0x55fa01)['map'](_0x4402df=>{const _0x5ec4e5=new $t(_0x155211,_0x5a62ee),_0x29b4c1=new Kt(_0x155211);return _0x29b4c1['set']({'label':_0x4402df['label']}),_0x29b4c1['delegate']('execute')['to'](_0x5a62ee),_0x29b4c1['on']('execute',()=>_0x5974fe(_0x4402df['id'])),_0x29b4c1['bind']('isEnabled')['to'](_0x7d7a4c,'enabledCommandsIds',_0x5d2f6e=>_0x5d2f6e['includes'](_0x4402df['id'])),_0x5ec4e5['children']['add'](_0x29b4c1),_0x5ec4e5;});}}function Yi(_0x35a380,_0x5e3dbb){return void 0x0!==_0x35a380['order']&&void 0x0===_0x5e3dbb['order']?0x1:void 0x0===_0x35a380['order']&&void 0x0!==_0x5e3dbb['order']?-0x1:void 0x0!==_0x35a380['order']&&void 0x0!==_0x5e3dbb['order']?_0x35a380['order']-_0x5e3dbb['order']:0x0;}function $i(_0x41c5b8,_0x316de0){_0x316de0['sort'](Yi);const _0x5418dc={},_0x2249f8=[];for(const _0x16903b of _0x316de0)if(void 0x0!==_0x16903b['order']){if(_0x16903b['order']in _0x5418dc)throw new ot('ai-commands-config-order-collision',_0x41c5b8,{'conflictingDefinitions':[_0x16903b,_0x5418dc[_0x16903b['order']]]});_0x5418dc[_0x16903b['order']]=_0x16903b,_0x2249f8['splice'](_0x16903b['order'],0x0,_0x16903b);}else _0x2249f8['push'](_0x16903b);return _0x2249f8;}class qi extends _0x369cb6{static get['requires'](){return[Wi,fi];}static get['pluginName'](){return'AIAssistant';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x931cd7){super(_0x931cd7);const _0x53cefa=_0x931cd7['config'],_0x5e4997=_0x931cd7['locale'];_0x53cefa['define']('ai.assistant.preserveComments',!0x0),_0x53cefa['define']('ai.assistant.commands',Qi(_0x5e4997)),_0x53cefa['define']('ai.assistant.extraCommandGroups',[]),_0x53cefa['define']('ai.assistant.removeCommands',[]);let _0x437a5a=mi(_0x53cefa['get']('ai.assistant.commands'),_0x5e4997);const _0x416364=_0x53cefa['get']('ai.assistant.extraCommandGroups'),_0x24513f=_0x53cefa['get']('ai.assistant.removeCommands');_0x416364['forEach'](_0x17fed0=>{const _0x15a11d=_0x437a5a['find'](_0x41780c=>_0x41780c['groupId']===_0x17fed0['groupId']);_0x15a11d?_0x15a11d['commands']=_0x15a11d['commands']['concat'](_0x17fed0['commands']):_0x437a5a['push'](_0x17fed0);}),_0x437a5a=_0x437a5a['filter'](_0x4067e0=>!_0x24513f['includes'](_0x4067e0['groupId'])),_0x437a5a['forEach'](_0x28186b=>{_0x28186b['commands']=_0x28186b['commands']['filter'](_0x199eb1=>!_0x24513f['includes'](_0x199eb1['id']));}),_0x53cefa['set']('ai.assistant.commands',_0x437a5a);}}function Qi(_0x5ed705){return[{'groupId':'editOrReview','groupLabel':Ri(_0x5ed705,'Edit\x20or\x20review'),'commands':[{'id':'improveWriting','label':Ri(_0x5ed705,'Improve\x20writing'),'prompt':'Fix\x20spelling\x20mistakes,\x20use\x20proper\x20grammar\x20and\x20apply\x20good\x20writing\x20practices.\x20Do\x20not\x20lose\x20the\x20original\x20meaning.'},{'id':'makeShorter','label':Ri(_0x5ed705,'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':Ri(_0x5ed705,'Make\x20longer'),'prompt':'Improve\x20this\x20content\x20by\x20using\x20descriptive\x20language\x20and\x20inserting\x20more\x20information\x20and\x20more\x20detailed\x20explanations.'},{'id':'simplifyLanguage','label':Ri(_0x5ed705,'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':Ri(_0x5ed705,'Generate\x20from\x20selection'),'commands':[{'id':'summarize','label':Ri(_0x5ed705,'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':Ri(_0x5ed705,'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':Ri(_0x5ed705,'Change\x20tone'),'commands':[{'id':'professional','label':Ri(_0x5ed705,'Professional'),'prompt':'Improve\x20using\x20polished,\x20formal,\x20and\x20respectful\x20language\x20to\x20convey\x20professional\x20expertise\x20and\x20competence.'},{'id':'casual','label':Ri(_0x5ed705,'Casual'),'prompt':'Improve\x20using\x20casual,\x20informal\x20language\x20to\x20convey\x20a\x20casual\x20conversation\x20with\x20a\x20real\x20person.'},{'id':'direct','label':Ri(_0x5ed705,'Direct'),'prompt':'Improve\x20using\x20direct\x20language,\x20using\x20only\x20the\x20essential\x20information.'},{'id':'confident','label':Ri(_0x5ed705,'Confident'),'prompt':'Improve\x20using\x20compelling,\x20optimistic\x20language\x20to\x20convey\x20confidence\x20in\x20the\x20writing.'},{'id':'friendly','label':Ri(_0x5ed705,'Friendly'),'prompt':'Improve\x20using\x20friendly,\x20comforting\x20language,\x20to\x20convey\x20understanding\x20and\x20empathy.'}]},{'groupId':'changeStyle','groupLabel':Ri(_0x5ed705,'Change\x20style'),'commands':[{'id':'business','label':Ri(_0x5ed705,'Business'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20business\x20professional\x20with\x20formal\x20language.'},{'id':'legal','label':Ri(_0x5ed705,'Legal'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20legal\x20professional\x20using\x20valid\x20legal\x20terminology.'},{'id':'journalism','label':Ri(_0x5ed705,'Journalism'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20journalist\x20using\x20engaging\x20language\x20to\x20convey\x20the\x20importance\x20of\x20the\x20information.'},{'id':'poetic','label':Ri(_0x5ed705,'Poetic'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20poem\x20using\x20poetic\x20techniques\x20without\x20losing\x20the\x20original\x20meaning.'}]},{'groupId':'translate','groupLabel':Ri(_0x5ed705,'Translate'),'commands':[{'id':'translateEnglish','label':Ri(_0x5ed705,'English'),'prompt':'Translate\x20the\x20content\x20to\x20English\x20language.'},{'id':'translateSpanish','label':Ri(_0x5ed705,'Spanish'),'prompt':'Translate\x20the\x20content\x20to\x20Spanish\x20language.'},{'id':'translatePortuguese','label':Ri(_0x5ed705,'Portuguese'),'prompt':'Translate\x20the\x20content\x20to\x20Portuguese\x20language.'},{'id':'translateGerman','label':Ri(_0x5ed705,'German'),'prompt':'Translate\x20the\x20content\x20to\x20German\x20language.'},{'id':'translateFrench','label':Ri(_0x5ed705,'French'),'prompt':'Translate\x20the\x20content\x20to\x20French\x20language.'},{'id':'translateChinese','label':Ri(_0x5ed705,'Simplified\x20Chinese'),'prompt':'Translate\x20the\x20content\x20to\x20Simplified\x20Chinese\x20language.'},{'id':'translateHindi','label':Ri(_0x5ed705,'Hindi'),'prompt':'Translate\x20the\x20content\x20to\x20Hindi\x20language.'},{'id':'translateArabic','label':Ri(_0x5ed705,'Arabic'),'prompt':'Translate\x20the\x20content\x20to\x20Arabic\x20language.'}]}];}class Xi extends _0x369cb6{['abortController'];static get['requires'](){return[Si];}constructor(_0x1e94d6){super(_0x1e94d6),this['abortController']=new AbortController();}['init'](){this['editor']['plugins']['get'](Si)['textAdapter']=this;}['abort'](){this['abortController']['signal']['aborted']||(this['abortController']['abort'](),this['abortController']=new AbortController());}async['makeRequest'](_0x3fa21b){return this['sendRequest'](_0x3fa21b)['catch'](_0x40e062=>{if(_0x40e062 instanceof bi)return Promise['reject'](_0x40e062);if('AbortError'==_0x40e062['name'])return Promise['resolve']();throw console['error'](_0x40e062),new ot('aitextadapter-send-request-failed',null);});}async['_prepareRequestHeaders'](_0x38bffe,_0x4aff97){const _0x31d1d2=this['editor']['locale'],_0x1ee854={'Content-Type':'application/json'};if('object'==typeof _0x38bffe)Object['assign'](_0x1ee854,_0x38bffe);else{if(_0x38bffe)try{const _0x8a8309=await _0x38bffe(_0x4aff97);Object['assign'](_0x1ee854,_0x8a8309);}catch{return Promise['reject'](new bi(Ri(_0x31d1d2,'AI_ERROR_GET_HEADERS')));}}return _0x1ee854;}async['_prepareRequestParameters'](_0x57ceb6,_0x13197a){const _0x71a981=this['editor']['locale'];if('object'==typeof _0x57ceb6)return _0x57ceb6;try{return await _0x57ceb6(_0x13197a);}catch{return Promise['reject'](new bi(Ri(_0x71a981,'AI_ERROR_GET_PARAMETERS')));}}}class zi extends Xi{['_apiUrl'];['_requestHeaders'];['_requestParameters'];static get['pluginName'](){return'OpenAITextAdapter';}constructor(_0x43fa32){super(_0x43fa32),_0x43fa32['config']['define']('ai.assistant.adapter.openAI.apiUrl','https://api.openai.com/v1/chat/completions'),_0x43fa32['config']['get']('ai.assistant.adapter.openAI.requestParameters')||_0x43fa32['config']['define']('ai.assistant.adapter.openAI.requestParameters',{'model':'gpt-4o','temperature':0x1,'top_p':0x1,'stream':!0x0}),this['_apiUrl']=_0x43fa32['config']['get']('ai.assistant.adapter.openAI.apiUrl'),this['_requestHeaders']=_0x43fa32['config']['get']('ai.assistant.adapter.openAI.requestHeaders')||{},this['_requestParameters']=_0x43fa32['config']['get']('ai.assistant.adapter.openAI.requestParameters');}async['sendRequest']({query:_0x478613,context:_0x54db4a,onData:_0x194a3e,actionId:_0x31a78b}){const _0x559798=this['editor']['locale'],_0x2fa56b=await this['prepareMessages'](_0x478613,_0x54db4a,_0x31a78b),_0x3ac095=await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x31a78b),_0x447e25=await this['_prepareRequestParameters'](this['_requestParameters'],_0x31a78b),_0x430381={'messages':_0x2fa56b,..._0x447e25},_0x564c00={'method':'POST','headers':_0x3ac095,'body':JSON['stringify'](_0x430381),'signal':this['abortController']['signal']},_0x55d869=await fetch(this['_apiUrl'],_0x564c00);if(_0x55d869['ok'])return _0x447e25['stream']?await this['_readStreamableResponse'](_0x55d869,_0x194a3e):await this['_readStaticResponse'](_0x55d869,_0x194a3e),Promise['resolve']();{const _0x32a30b=await _0x55d869['text']();return _0x32a30b['includes']('context_length_exceeded')?Promise['reject'](new bi(Ri(_0x559798,'AI_ERROR_CONTEXT_LENGTH'))):_0x32a30b['includes']('Moderation')?Promise['reject'](new bi(Ri(_0x559798,'AI_ERROR_MODERATION'))):Promise['reject'](new Error(_0x32a30b));}}async['prepareMessages'](_0x364fef,_0x57fc62,_0x1fd713){let _0x1b03cf,_0x291bff;return _0x57fc62?(_0x1b03cf='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.',_0x291bff='Instruction:\x0a'+_0x364fef+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x57fc62):(_0x1b03cf='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.',_0x291bff=_0x364fef),[{'role':'system','content':_0x1b03cf},{'role':'user','content':_0x291bff}];}async['_readStreamableResponse'](_0x1a1422,_0x3ebf9c){const _0x183d31=_0x1a1422['body']['getReader'](),_0x1ce2fb=new TextDecoder();let _0x40d981='',_0x29e0cf='',_0x27fa8e='',_0x2cff72=!0x1;for(;!_0x2cff72;){const {done:_0x1d0c8e,value:_0x21aee2}=await _0x183d31['read'](),_0x510c8d=_0x40d981+_0x1ce2fb['decode'](_0x21aee2);let _0xa06004='';_0x2cff72=_0x1d0c8e;try{_0xa06004=this['_cleanUpData'](_0x510c8d),_0x40d981='';}catch{_0x40d981=_0x510c8d;continue;}_0x29e0cf+=_0xa06004,!_0x2cff72&&this['_isBufferIncomplete'](_0x29e0cf)||_0x29e0cf&&(_0x27fa8e+=_0x29e0cf,_0x29e0cf='',_0x3ebf9c(_0x27fa8e));}return Promise['resolve']();}async['_readStaticResponse'](_0x3d799f,_0x3af5b6){return _0x3af5b6((await _0x3d799f['json']())['choices'][0x0]['message']['content']),Promise['resolve']();}['_isBufferIncomplete'](_0x4d705e){const _0x26bc0d=_0x4d705e['split']('<')['length']!==_0x4d705e['split']('>')['length'],_0x3277e9=_0x4d705e['length']<0x1e;return _0x26bc0d&&_0x3277e9;}['_cleanUpData'](_0x1c7dd1){return _0x1c7dd1['split'](/\n(?![^{]*\})/g)['map'](_0x2658cd=>_0x2658cd['replace']('data:\x20',''))['filter'](_0x544f34=>_0x544f34&&_0x544f34['length']>0x0&&'[DONE]'!==_0x544f34)['map'](_0x4856bb=>{const {choices:_0x36a931}=JSON['parse'](_0x4856bb);if(_0x36a931[0x0]?.['delta']?.['content'])return _0x36a931[0x0]['delta']['content'];})['filter'](_0x2a7b07=>_0x2a7b07)['join']('');}}class ji extends Xi{static get['pluginName'](){return'AWSTextAdapter';}['init'](){super['init'](),It('ai-aws-adapter-not-supported');}async['sendRequest'](_0x530c50){throw Et('ai-aws-adapter-not-supported'),new bi(Ri(this['editor']['locale'],'AI_ERROR_AWS_NOT_SUPPORTED'));}}class Ji extends kt{constructor(_0x399115,_0x2f022b={}){super(_0x399115),this['isToggleable']=!0x0,this['set']('side',_0x2f022b['side']||'top');const _0x2c28f3=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-tab-button',...Tt(_0x2f022b['class']||[]),_0x2c28f3['to']('side',_0x5f028b=>'ck-tab-button_'+_0x5f028b),_0x2c28f3['to']('class')]}});}['show'](){this['set']('isVisible',!0x0);}['hide'](){this['set']('isVisible',!0x1);}}class Zi extends Nt{['children'];constructor(_0x531d8c,_0x3d2ad6={}){super(_0x531d8c);const _0x1ddd4f=this['bindTemplate'];this['set']('isVisible',!0x1),this['set']('class',''),this['children']=this['createCollection'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck-tab-panel',...Tt(_0x3d2ad6['class']||[]),_0x1ddd4f['to']('class'),_0x1ddd4f['if']('isVisible','ck-hidden',_0x1fd935=>!_0x1fd935)]},'children':this['children']});}['show'](){this['set']('isVisible',!0x0);}['hide'](){this['set']('isVisible',!0x1);}}class ts extends Nt{['buttonViews']=this['createCollection']();['panelViews']=this['createCollection']();['_tabs']=new Map();constructor(_0xa19177,_0x5e0983={}){super(_0xa19177),this['set']('class',void 0x0),this['set']('activeTab',null),this['set']('side',_0x5e0983['side']||'top'),this['set']('isMaximized',!0x1);const _0x338525=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset','ck-tabs',...Tt(_0x5e0983['class']||[]),_0x338525['to']('side',_0x2f0a80=>'ck-tabs_'+_0x2f0a80),_0x338525['to']('class'),_0x338525['to']('isMaximized',_0x2cf0f0=>_0x2cf0f0?'ck-ai-tabs_maximized':'')],'tabindex':'0'},'children':[{'tag':'div','attributes':{'class':['ck','ck-tabs__buttons-container',_0x338525['to']('side',_0x562482=>'ck-tabs__buttons-container_'+_0x562482)]},'children':this['buttonViews']},{'tag':'div','attributes':{'class':['ck','ck-tabs__panels-container',_0x338525['to']('side',_0x14de00=>'ck-tabs__panels-container_'+_0x14de00)]},'children':this['panelViews']},...Tt(_0x5e0983['children']||[])]});}['getTabIds'](){return[...this['_tabs']['keys']()];}['getTab'](_0x17d110){const _0x28419c=this['_tabs']['get'](_0x17d110);return _0x28419c||null;}['addTab'](_0x30de02){const _0x1e8c0d=this['_setupButton']({'id':_0x30de02['id'],'label':_0x30de02['buttonLabel'],'icon':_0x30de02['buttonIcon'],'order':_0x30de02['order']}),_0x3d1232=new Zi(this['locale']);return _0x3d1232['render'](),_0x30de02['content']&&_0x3d1232['children']['add'](_0x30de02['content']),this['panelViews']['add'](_0x3d1232),this['_tabs']['set'](_0x30de02['id'],{'button':_0x1e8c0d,'panel':_0x3d1232,'order':void 0x0!==_0x30de02['order']?_0x30de02['order']:null}),this['fire']('addTab:'+_0x30de02['id'],{'id':_0x30de02['id'],'button':_0x1e8c0d,'panel':_0x3d1232}),null===this['activeTab']?this['activateTab'](_0x30de02['id']):this['_hidePanel'](_0x30de02['id']),{'button':_0x1e8c0d,'panel':_0x3d1232};}['activateTab'](_0x105e28){if(null!==_0x105e28&&!this['getTab'](_0x105e28))throw new ot('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0x105e28});this['activeTab']!==_0x105e28&&(this['activeTab']&&this['_hidePanel'](this['activeTab']),this['activeTab']=_0x105e28,_0x105e28&&this['_showPanel'](_0x105e28),this['fire']('activateTab:'+_0x105e28,_0x105e28));}['showTab'](_0x4fca69){if(!this['getTab'](_0x4fca69))throw new ot('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0x4fca69});this['_showPanel'](_0x4fca69),this['_showButton'](_0x4fca69),this['fire']('show:'+_0x4fca69,_0x4fca69);}['hideTab'](_0x484de2){if(!this['getTab'](_0x484de2))throw new ot('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0x484de2});const _0x903c32=this['activeTab'];this['_hidePanel'](_0x484de2),this['_hideButton'](_0x484de2);const _0x186b47=this['getTabIds']();_0x903c32===_0x484de2&&_0x186b47['length']>0x1&&this['activateTab'](_0x186b47['find'](_0x4afe0f=>_0x4afe0f!==_0x484de2)),this['fire']('hide:'+_0x484de2,_0x484de2);}['_getPanel'](_0x437d5c){const _0x10f60b=this['_tabs']['get'](_0x437d5c);return _0x10f60b?_0x10f60b['panel']:null;}['_showPanel'](_0x57d92d){null!==this['activeTab']&&this['activeTab']!==_0x57d92d||this['_getPanel'](_0x57d92d)['show']();}['_hidePanel'](_0x52c89c){const _0x3f28a8=this['_getPanel'](_0x52c89c);_0x3f28a8['isVisible']&&(this['activeTab']===_0x52c89c&&(this['activeTab']=null),_0x3f28a8['hide']());}['_getButton'](_0x511ee1){const _0x6ec99=this['_tabs']['get'](_0x511ee1);return _0x6ec99?_0x6ec99['button']:null;}['_showButton'](_0x3c895e){this['_getButton'](_0x3c895e)['show']();}['_hideButton'](_0x1446fc){this['_getButton'](_0x1446fc)['hide']();}['_setupButton'](_0xddc7d6){const _0x4aeef4=new Ji(this['locale'],{'side':this['side']}),_0x38116d=this['buttonViews'];if(_0x4aeef4['set']({'label':_0xddc7d6['label'],'icon':_0xddc7d6['icon'],'tooltip':!0x0,'withText':!0x0}),_0x4aeef4['bind']('isOn')['to'](this,'activeTab',_0x4e345e=>_0x4e345e===_0xddc7d6['id']),_0x4aeef4['bind']('side')['to'](this,'side'),_0xddc7d6['order']){const _0xb4ac4d=[...this['_tabs']]['reduce']((_0x48bbcd,_0x107837)=>{const _0x5b1d62=_0x107837[0x0],{order:_0x1ce443}=_0x107837[0x1];return!_0x1ce443||_0x1ce443>_0xddc7d6['order']?_0x48bbcd:_0x1ce443>=_0x48bbcd['order']?{'id':_0x5b1d62,'order':_0x1ce443}:_0x48bbcd;},{'id':'','order':0x0}),_0xaf772b=_0x38116d['getIndex'](this['_getButton'](_0xb4ac4d['id']));_0x38116d['add'](_0x4aeef4,_0xaf772b+0x1);}else _0x38116d['add'](_0x4aeef4);return _0x4aeef4['on']('execute',()=>{this['activateTab'](_0xddc7d6['id']);}),_0x4aeef4;}}const es=['overlay','sidebar','custom'],is=['left','right'];class ss extends ts{constructor(_0x488e81,_0x5b0889={}){super(_0x488e81,_0x5b0889),this['set']('type',_0x5b0889['type']||'sidebar'),this['set']('side',_0x5b0889['side']||'right'),this['set']('isVisible',_0x5b0889['visibleByDefault']??!0x0);const _0x304af9=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-tabs',_0x304af9['if']('type','ck-ai-tabs__overlay',_0x392f99=>'overlay'===_0x392f99),_0x304af9['if']('type','ck-ai-tabs__sidebar',_0x1ff8bb=>'sidebar'===_0x1ff8bb),_0x304af9['if']('isVisible','ck-hidden',_0x30a029=>!_0x30a029)]}}),this['buttonViews']['on']('add',(_0xd8aa3f,_0x5b88f3)=>{_0x5b88f3['set']('withText',!0x1);});}}class ns extends _0x1f4c78{['view'];['container']=null;['showResizeButton']=!0x0;static get['pluginName'](){return'AITabs';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x16c797){super(_0x16c797);const _0x49509a=this['context']['config']['get']('ai.container');if(this['set']('side','right'),!_0x49509a)throw new ot('ai-tabs-configuration-not-found');if(void 0x0!==_0x49509a['showResizeButton']&&(this['showResizeButton']=_0x49509a['showResizeButton']),'sidebar'!==_0x49509a['type']&&'overlay'!==_0x49509a['type']||_0x49509a['side']&&(this['side']=_0x49509a['side']),'sidebar'===_0x49509a['type']){if(this['container']=_0x49509a['element'],this['set']('type','sidebar'),!this['container'])throw new ot('ai-tabs-sidebar-container-element-not-found');}else'overlay'===_0x49509a['type']?(this['container']=document['body'],this['set']('type','overlay')):(this['container']=null,this['set']('type','custom'));this['view']=new ss(this['context']['locale'],{'side':this['side'],'type':this['type'],'visibleByDefault':void 0x0===_0x49509a['visibleByDefault']||_0x49509a['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 _0x3ba7d1&&this['context']['ui']['focusTracker']['add'](this['view']['element']);}['switchType'](_0x427630){if(_0x427630&&this['type']!==_0x427630){if(!es['includes'](_0x427630))throw new ot('ai-tabs-unsupported-ui-type');this['type']=_0x427630;}}['switchSide'](_0xd4483){if(_0xd4483&&this['side']!==_0xd4483){if(!is['includes'](_0xd4483))throw new ot('ai-tabs-unsupported-ui-side');this['side']=_0xd4483;}}['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 rs extends _0x1f4c78{['_apiUrl'];['_token'];['_decoder'];['_responseCache'];static get['requires'](){return[_0x334536];}static get['pluginName'](){return'AIConnector';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x1e5d6d){super(_0x1e5d6d),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(),this['_responseCache']=new Map();}['init'](){const _0x5af8ef=this['context']['plugins']['get'](_0x334536);if(!_0x5af8ef['token'])throw new ot('ai-missing-token',this);this['_token']=_0x5af8ef['token'];}['startConversation'](_0x369e9b,_0xfd1c4){const _0x2dc76c=this['_sendApiRequest']('/conversations','POST',{'id':_0x369e9b,'group':_0xfd1c4});return{'getConversation':async()=>(await _0x2dc76c['request'])['json'](),'abortController':_0x2dc76c['abortController']};}['queryAssistant']({message:_0x3248ee,conversationId:_0x3aec88,parts:_0x4c2fcd,capabilities:_0xf0d411,model:_0x4b4d40,attributes:_0x4140ab}){const _0x328aec={'prompt':_0x3248ee,'content':_0x4c2fcd,'model':_0x4b4d40,..._0xf0d411&&{'capabilities':_0xf0d411},..._0x4140ab&&{'attributes':_0x4140ab}},_0x40d876=this['_sendApiRequest']('/conversations/'+_0x3aec88+'/messages','POST',_0x328aec);return{'getStream':async()=>{const _0x2d308a=(await _0x40d876['request'])['body'];return this['_getStreamReader'](_0x2d308a);},'abortController':_0x40d876['abortController']};}['executeCustomAction']({content:_0x50389f,message:_0x109108,model:_0x34c1a,outputFormat:_0x2d2902}){const _0x496f4a={'content':[{'type':'text','content':_0x50389f}],'prompt':_0x109108,'model':_0x34c1a,'outputFormat':_0x2d2902},_0x3cdb5f=this['_sendApiRequest']('/actions/custom/calls','POST',_0x496f4a);return{'getStream':async()=>{const _0x4ba7ec=(await _0x3cdb5f['request'])['body'];return this['_getStreamReader'](_0x4ba7ec);},'abortController':_0x3cdb5f['abortController']};}['executeAction']({actionName:_0x2c2790,content:_0x3c79e4,args:_0x44b270}){const _0x41e56d={'content':[{'type':'text','content':_0x3c79e4}],'args':_0x44b270},_0x3fa64f=this['_sendApiRequest']('/actions/system/'+_0x2c2790+'/calls','POST',_0x41e56d);return{'getStream':async()=>{const _0x484082=(await _0x3fa64f['request'])['body'];return this['_getStreamReader'](_0x484082);},'abortController':_0x3fa64f['abortController']};}['uploadFile'](_0x31da24,_0x553be0,_0x4c6fb1){const _0x55faa8=new FormData();_0x55faa8['append']('file',_0x553be0,_0x553be0['name']),_0x4c6fb1&&_0x55faa8['append']('attributes',JSON['stringify'](_0x4c6fb1));const _0x4db643=this['_sendApiRequest']('/conversations/'+_0x31da24+'/files','POST',_0x55faa8);return{'getId':async()=>(await _0x4db643['request'])['json'](),'abortController':_0x4db643['abortController']};}['fetchDocument'](_0x19993f,_0x5b39ec){const _0x2bb43b=this['_sendApiRequest']('/conversations/'+_0x19993f+'/documents/'+_0x5b39ec,'GET');return{'getDocument':async()=>(await _0x2bb43b['request'])['json'](),'abortController':_0x2bb43b['abortController']};}['uploadDocument'](_0x378a17,_0x2e0681,_0x83451a){const _0x2a59bb={'content':_0x2e0681};_0x83451a&&(_0x2a59bb['attributes']=_0x83451a);const _0x38a643=this['_sendApiRequest']('/conversations/'+_0x378a17+'/documents','POST',_0x2a59bb);return{'getId':async()=>(await _0x38a643['request'])['json'](),'abortController':_0x38a643['abortController']};}['fetchConversations'](_0x1e3aef,_0xddcde4={}){const _0x313787=new URLSearchParams();_0x313787['append']('group',_0x1e3aef),_0x313787['append']('excludeEmpty',!0x1!==_0xddcde4['excludeEmpty']?'true':'false'),_0x313787['append']('limit',_0xddcde4['limit']?_0xddcde4['limit']['toString']():'100'),_0x313787['append']('sortBy',_0xddcde4['sortBy']?_0xddcde4['sortBy']:'createdAt'),_0x313787['append']('order',_0xddcde4['order']?_0xddcde4['order']:'desc');const _0x4518cd=this['_sendApiRequest']('/conversations?'+_0x313787['toString'](),'GET');return{'getConversations':async()=>{const _0x28919a=await _0x4518cd['request'];return(await _0x28919a['json']())['items'];},'abortController':_0x4518cd['abortController']};}['deleteConversation'](_0x557440){const _0xed9e1d=this['_sendApiRequest']('/conversations/'+_0x557440,'DELETE');return{'execute':async()=>{await _0xed9e1d['request'];},'abortController':_0xed9e1d['abortController']};}['updateConversation'](_0x137814,_0xee55c8){const _0x20919b=this['_sendApiRequest']('/conversations/'+_0x137814,'PATCH',_0xee55c8);return{'getResult':async()=>(await _0x20919b['request'],_0xee55c8),'abortController':_0x20919b['abortController']};}['fetchConversation'](_0x2cdf8d){const _0x5a16ef=this['_sendApiRequest']('/conversations/'+_0x2cdf8d,'GET');return{'getConversation':async()=>(await _0x5a16ef['request'])['json'](),'abortController':_0x5a16ef['abortController']};}['fetchConversationMessages'](_0x10c875){const _0x5b16ce=this['_sendApiRequest']('/conversations/'+_0x10c875+'/messages','GET');return{'getMessages':async()=>{const _0x1830ea=await _0x5b16ce['request'];return(await _0x1830ea['json']())['items'];},'abortController':_0x5b16ce['abortController']};}['uploadUrl'](_0x4019de,_0x6b6462,_0x167589){const _0x572a46=this['_sendApiRequest']('/conversations/'+_0x4019de+'/web-resources','POST',{'url':_0x6b6462,'attributes':_0x167589});return{'getId':async()=>(await _0x572a46['request'])['json'](),'abortController':_0x572a46['abortController']};}['getModels'](_0x2a34b7='en'){const _0x2d3270=new URLSearchParams();_0x2d3270['append']('language',_0x2a34b7);const _0x2a7357='/models/1?'+_0x2d3270['toString'](),_0x1c4cad=this['_sendApiRequest'](_0x2a7357,'GET',void 0x0,!0x0);return{'list':async()=>await(await _0x1c4cad['request'])['json'](),'abortController':_0x1c4cad['abortController']};}['deleteFile'](_0x1a47ea,_0x2c06d7){const _0x180ef3=this['_sendApiRequest']('/conversations/'+_0x1a47ea+'/files/'+_0x2c06d7,'DELETE');return{'execute':async()=>{await _0x180ef3['request'];},'abortController':_0x180ef3['abortController']};}['deleteDocument'](_0x1db115,_0x3c06d8){const _0x4be934=this['_sendApiRequest']('/conversations/'+_0x1db115+'/documents/'+_0x3c06d8,'DELETE');return{'execute':async()=>{await _0x4be934['request'];},'abortController':_0x4be934['abortController']};}['deleteWebResource'](_0x452548,_0x2d431d){const _0x11d89f=this['_sendApiRequest']('/conversations/'+_0x452548+'/web-resources/'+_0x2d431d,'DELETE');return{'execute':async()=>{await _0x11d89f['request'];},'abortController':_0x11d89f['abortController']};}['callSystemReview']({reviewName:_0x45e46b,content:_0x1131a1,args:_0x5ec4b0}){const _0x2e3872=this['_sendApiRequest']('/reviews/system/'+_0x45e46b+'/calls','POST',{'content':[{'type':'text','content':_0x1131a1}],'args':_0x5ec4b0});return{'getStream':async()=>{const _0x176ca8=(await _0x2e3872['request'])['body'];return this['_getStreamReader'](_0x176ca8);},'abortController':_0x2e3872['abortController']};}['callCustomReview']({content:_0xb6df36,prompt:_0x199f40,model:_0x1037c9}){const _0x798ab5=this['_sendApiRequest']('/reviews/custom/calls','POST',{'content':[{'type':'text','content':_0xb6df36}],'prompt':_0x199f40,'model':_0x1037c9});return{'getStream':async()=>{const _0x205480=(await _0x798ab5['request'])['body'];return this['_getStreamReader'](_0x205480);},'abortController':_0x798ab5['abortController']};}['upsertAIChatRating'](_0x270563,_0x53afea,_0xc88ba9){const _0x484fa5=this['_sendApiRequest']('/conversations/'+_0x270563+'/messages/'+_0x53afea+'/ratings','PUT',{'positiveCount':_0xc88ba9['positiveCount'],'totalCount':_0xc88ba9['totalCount'],'modificationId':_0xc88ba9['modificationId']});return{'execute':async()=>{await _0x484fa5['request'];},'abortController':_0x484fa5['abortController']};}['upsertAIActionRating'](_0x346b82,_0x218448,_0x1ff9f3){const _0x5ec1f5=this['_sendApiRequest']('/actions/system/'+_0x346b82+'/calls/'+_0x218448+'/ratings','PUT',{'positiveCount':_0x1ff9f3['positiveCount'],'totalCount':_0x1ff9f3['totalCount']});return{'execute':async()=>{await _0x5ec1f5['request'];},'abortController':_0x5ec1f5['abortController']};}['upsertCustomAIActionRating'](_0x105331,_0x25b50d){const _0x34caa2=this['_sendApiRequest']('/actions/custom/calls/'+_0x105331+'/ratings','PUT',{'positiveCount':_0x25b50d['positiveCount'],'totalCount':_0x25b50d['totalCount']});return{'execute':async()=>{await _0x34caa2['request'];},'abortController':_0x34caa2['abortController']};}['upsertAIReviewRating'](_0x2e7927,_0x1d0610,_0xd5725e,_0x4ab87d){const _0x48a0e9=this['_sendApiRequest']('/reviews/system/'+_0x2e7927+'/calls/'+_0x1d0610+'/ratings','PUT',{'positiveCount':_0xd5725e['positiveCount'],'totalCount':_0xd5725e['totalCount'],'dataId':_0x4ab87d});return{'execute':async()=>{await _0x48a0e9['request'];},'abortController':_0x48a0e9['abortController']};}['upsertCustomAIReviewRating'](_0x5b73f0,_0x2eb322,_0x23aced){const _0x223e12=this['_sendApiRequest']('/reviews/custom/calls/'+_0x5b73f0+'/ratings','PUT',{'positiveCount':_0x2eb322['positiveCount'],'totalCount':_0x2eb322['totalCount'],'dataId':_0x23aced});return{'execute':async()=>{await _0x223e12['request'];},'abortController':_0x223e12['abortController']};}['_sendApiRequest'](_0x43d763,_0x4ccacd,_0x5b2b15,_0x15bb29=!0x1){const _0xb3cb1f=new AbortController(),_0x49462f=_0x15bb29?_0x4ccacd+':'+_0x43d763:null;if(_0x49462f){const _0x1bbb6e=this['_responseCache']['get'](_0x49462f);if(_0x1bbb6e)return{'request':_0x1bbb6e['then'](_0x1e52c7=>_0x1e52c7['clone']()),'abortController':_0xb3cb1f};}const _0x5aacc8=_0x5b2b15 instanceof FormData,_0x52ccd1={'Authorization':'Bearer\x20'+this['_token']?.['value']};_0x5b2b15&&!_0x5aacc8&&(_0x52ccd1['Content-Type']='application/json');const _0x2d29cd={'method':_0x4ccacd,'headers':_0x52ccd1,'signal':_0xb3cb1f['signal']};_0x5b2b15&&(_0x2d29cd['body']=_0x5aacc8?_0x5b2b15:JSON['stringify'](_0x5b2b15));const _0x40d453=fetch(''+this['_apiUrl']+_0x43d763,_0x2d29cd)['catch'](_0x3e70fc=>{_0x49462f&&this['_responseCache']['delete'](_0x49462f),this['_handleError'](_0x3e70fc);})['then'](_0x376db5=>_0x376db5['ok']?_0x376db5:_0x376db5['json']()['then'](_0x3fa350=>{throw _0x49462f&&this['_responseCache']['delete'](_0x49462f),{'url':this['_apiUrl'],'path':_0x43d763,'method':_0x4ccacd,'body':_0x5b2b15,'status':(_0x376db5||{})['status'],'statusText':(_0x376db5||{})['statusText'],'code':_0x3fa350['code'],'message':_0x3fa350['message'],'traceId':_0x3fa350['traceId']};}));return _0x49462f&&this['_responseCache']['set'](_0x49462f,_0x40d453['then'](_0x3b67b1=>_0x3b67b1['clone']())),{'request':_0x40d453,'abortController':_0xb3cb1f};}async*['_getStreamReader'](_0x45b9bb){const _0x447780=[],_0x70dc6d=_0x45b9bb['getReader'](),_0x473f7b=_0x1fdf6f({'onError':_0x16b8a0=>{this['_handleError'](_0x16b8a0);},'onEvent':_0x408f3f=>{_0x408f3f['data']=JSON['parse'](_0x408f3f['data']),_0x447780['push'](_0x408f3f);}});try{let _0x3982ff=!0x1;for(;!_0x3982ff;){const {done:_0x582cb7,value:_0x1c2c3c}=await _0x70dc6d['read']();_0x582cb7&&(_0x3982ff=!0x0),_0x473f7b['feed'](this['_decoder']['decode'](_0x1c2c3c,{'stream':!0x0})),yield*_0x447780,_0x447780['length']=0x0;}}catch(_0xe5d991){this['_handleError'](_0xe5d991);}finally{_0x70dc6d['releaseLock'](),_0x473f7b['reset']();}}['_handleError'](_0x48f9f6){if(_0x48f9f6 instanceof ot)throw _0x48f9f6;if(_0x48f9f6 instanceof Error&&'AbortError'===_0x48f9f6['name'])throw new ot('ai-request-aborted',this,{'originalError':_0x48f9f6});throw new ot('ai-request-failed',this,{'originalError':_0x48f9f6});}}function as(_0x1be62c,_0x596622,_0x2efdc5){const t=_0x1be62c['t'];switch(_0x596622){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'},_0x2efdc5);case'AI_SUGGESTION_CONTENT_PART_REJECTED':return t({'id':'AI_SUGGESTION_CONTENT_PART_REJECTED','string':'Change\x20was\x20rejected'});case'AI_SUGGESTION_CONTENT_PART_OUTDATED':return t({'id':'AI_SUGGESTION_CONTENT_PART_OUTDATED','string':'Change\x20is\x20outdated'});case'AI_SUGGESTION_CONTENT_PART_ALREADY_APPLIED':return t({'id':'AI_SUGGESTION_CONTENT_PART_ALREADY_APPLIED','string':'Change\x20is\x20already\x20applied'});case'AI_SUGGESTION_CONTENT_PART_APPLY':return t({'id':'AI_SUGGESTION_CONTENT_PART_APPLY','string':'Apply\x20change'});case'AI_SUGGESTION_CONTENT_PART_ADD_SUGGESTION':return t({'id':'AI_SUGGESTION_CONTENT_PART_ADD_SUGGESTION','string':'Add\x20as\x20suggestion'});case'AI_SUGGESTION_CONTENT_PART_REJECT':return t({'id':'AI_SUGGESTION_CONTENT_PART_REJECT','string':'Reject\x20change'});case'AI_SUGGESTION_CONTENT_PART_REMOVED':return t({'id':'AI_SUGGESTION_CONTENT_PART_REMOVED','string':'Removed\x20content.\x20Use\x20\x22Show\x20details\x22\x20to\x20learn\x20more.'});case'AI_SUGGESTION_CONTENT_PART_STATE_ACCEPTED':return t({'id':'AI_SUGGESTION_CONTENT_PART_STATE_ACCEPTED','string':'Approved'});case'AI_SUGGESTION_CONTENT_PART_STATE_REJECTED':return t({'id':'AI_SUGGESTION_CONTENT_PART_STATE_REJECTED','string':'Rejected'});case'AI_SUGGESTION_CONTENT_PART_STATE_OUTDATED':return t({'id':'AI_SUGGESTION_CONTENT_PART_STATE_OUTDATED','string':'Outdated'});case'AI_DISCLAIMER_TEXT':return t({'id':'AI_DISCLAIMER_TEXT','string':'AI\x20can\x20make\x20mistakes.\x20Please\x20double-check\x20responses.'});case'AI_TABS_LABEL_MAXIMIZE':return t({'id':'AI_TABS_LABEL_MAXIMIZE','string':'Maximize'});case'AI_TABS_LABEL_MINIMIZE':return t({'id':'AI_TABS_LABEL_MINIMIZE','string':'Minimize'});case'AI_CHAT_HEADING':return t({'id':'AI_CHAT_HEADING','string':'Chat'});case'AI_CHAT_SOURCES_HEADER':return t({'id':'AI_CHAT_SOURCES_HEADER','string':'Sources'});case'AI_CHAT_UNTITLED_CONVERSATION':return t({'id':'AI_CHAT_UNTITLED_CONVERSATION','string':'Untitled\x20conversation'});case'AI_CHAT_LABEL_NEW_CHAT':return t({'id':'AI_CHAT_LABEL_NEW_CHAT','string':'New\x20chat'});case'AI_CHAT_STOP_GENERATING':return t({'id':'AI_CHAT_STOP_GENERATING','string':'Stop\x20generating'});case'AI_CHAT_IS_WRITING':return t({'id':'AI_CHAT_IS_WRITING','string':'AI\x20is\x20writing...'});case'AI_CHAT_PROMPT_EMPTY_ERROR':return t({'id':'AI_CHAT_PROMPT_EMPTY_ERROR','string':'This\x20field\x20cannot\x20be\x20empty.'});case'AI_CHAT_LABEL_SUBMIT':return t({'id':'AI_CHAT_LABEL_SUBMIT','string':'Submit'});case'AI_CHAT_WELCOME_MESSAGE':return t({'id':'AI_CHAT_WELCOME_MESSAGE','string':'Hi!\x20I\x20can\x20help\x20you\x20draft,\x20rewrite,\x20and\x20improve\x20your\x20text,\x20explore\x20ideas,\x20research\x20topics,\x20and\x20solve\x20problems.\x20How\x20can\x20I\x20help\x20right\x20now?'});case'AI_CHAT_ABORTED_MESSAGE':return t({'id':'AI_CHAT_ABORTED_MESSAGE','string':'The\x20request\x20was\x20aborted.'});case'AI_CHAT_GENERIC_ERROR':return t({'id':'AI_CHAT_GENERIC_ERROR','string':'Something\x20went\x20wrong\x20while\x20processing\x20your\x20request.\x20Please\x20try\x20again.'});case'AI_CHAT_UNABLE_TO_START_CONVERSATION':return t({'id':'AI_CHAT_UNABLE_TO_START_CONVERSATION','string':'Unable\x20to\x20start\x20conversation.\x20Please\x20make\x20sure\x20you\x20are\x20online\x20and\x20try\x20again.'});case'AI_CHAT_UNABLE_TO_LOAD_CONVERSATION':return t({'id':'AI_CHAT_UNABLE_TO_LOAD_CONVERSATION','string':'Unable\x20to\x20load\x20chosen\x20conversation.\x20Please\x20make\x20sure\x20you\x20are\x20online\x20and\x20try\x20again.'});case'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_FILE':return t({'id':'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_FILE','string':'Failed\x20to\x20upload\x20files:\x20%0.\x20Please\x20try\x20again.'},_0x2efdc5);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.'},_0x2efdc5);case'AI_CHAT_RESOURCE_LOAD_FAILED':return t({'id':'AI_CHAT_RESOURCE_LOAD_FAILED','string':'Failed\x20to\x20load\x20resource.\x20Please\x20try\x20again.'});case'AI_CHAT_CONTEXT_CURRENT_DOCUMENT':return t({'id':'AI_CHAT_CONTEXT_CURRENT_DOCUMENT','string':'Current\x20document'});case'AI_CHAT_CONTEXT_REMOVE_FROM_CONTEXT':return t({'id':'AI_CHAT_CONTEXT_REMOVE_FROM_CONTEXT','string':'Remove\x20from\x20context'});case'AI_CHAT_CONTEXT_ADD_CONTEXT':return t({'id':'AI_CHAT_CONTEXT_ADD_CONTEXT','string':'Add\x20context'});case'AI_CHAT_CONTEXT_URL_LABEL':return t({'id':'AI_CHAT_CONTEXT_URL_LABEL','string':'URL'});case'AI_CHAT_CONTEXT_FILE_LABEL':return t({'id':'AI_CHAT_CONTEXT_FILE_LABEL','string':'File'});case'AI_CHAT_CONTEXT_CURRENT_CONTEXT_LABEL':return t({'id':'AI_CHAT_CONTEXT_CURRENT_CONTEXT_LABEL','string':'Current\x20context'});case'AI_CHAT_CONTEXT_DOCUMENT_SELECTION_LABEL':return t({'id':'AI_CHAT_CONTEXT_DOCUMENT_SELECTION_LABEL','string':'Selected\x20content'});case'AI_CHAT_SEARCH_WEB':return t({'id':'AI_CHAT_SEARCH_WEB','string':'Web\x20search'});case'AI_CHAT_ENABLE_WEB_SEARCH':return t({'id':'AI_CHAT_ENABLE_WEB_SEARCH','string':'Enable\x20web\x20search'});case'AI_CHAT_DISABLE_WEB_SEARCH':return t({'id':'AI_CHAT_DISABLE_WEB_SEARCH','string':'Disable\x20web\x20search'});case'AI_CHAT_REASONING':return t({'id':'AI_CHAT_REASONING','string':'Reasoning'});case'AI_CHAT_ENABLE_REASONING':return t({'id':'AI_CHAT_ENABLE_REASONING','string':'Enable\x20reasoning'});case'AI_CHAT_DISABLE_REASONING':return t({'id':'AI_CHAT_DISABLE_REASONING','string':'Disable\x20reasoning'});case'AI_CHAT_COMMANDS':return t({'id':'AI_CHAT_COMMANDS','string':'Commands'});case'AI_CHAT_SEARCH_RESOURCES':return t({'id':'AI_CHAT_SEARCH_RESOURCES','string':'Search\x20resources'});case'AI_CHAT_CONTEXT_URL_BACK_TO_CONTEXT':return t({'id':'AI_CHAT_CONTEXT_URL_BACK_TO_CONTEXT','string':'Back\x20to\x20context\x20options'});case'AI_CHAT_CONTEXT_URL_ADD_URL':return t({'id':'AI_CHAT_CONTEXT_URL_ADD_URL','string':'Add\x20URL'});case'AI_CHAT_CONTEXT_URL_PLACEHOLDER':return t({'id':'AI_CHAT_CONTEXT_URL_PLACEHOLDER','string':'Add\x20URL...'});case'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_URL':return t({'id':'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_URL','string':'Failed\x20to\x20upload\x20URL:\x20%0.\x20Please\x20try\x20again.'},_0x2efdc5);case'AI_CHAT_CONTEXT_INVALID_DATA':return t({'id':'AI_CHAT_CONTEXT_INVALID_DATA','string':'Invalid\x20context\x20data\x20type\x20for\x20the\x20selected\x20resource.'});case'AI_CHAT_CONTEXT_UNSUPPORTED_TYPE':return t({'id':'AI_CHAT_CONTEXT_UNSUPPORTED_TYPE','string':'Unsupported\x20resource\x20type.\x20Only\x20files\x20and\x20URLs\x20are\x20supported.'});case'AI_CHAT_CONTEXT_URL_EMPTY_ERROR':return t({'id':'AI_CHAT_CONTEXT_URL_EMPTY_ERROR','string':'URL\x20cannot\x20be\x20empty.'});case'AI_CHAT_CONTEXT_URL_INVALID_ERROR':return t({'id':'AI_CHAT_CONTEXT_URL_INVALID_ERROR','string':'Please\x20enter\x20a\x20valid\x20URL.'});case'AI_CHAT_INVALID_REQUEST':return t({'id':'AI_CHAT_INVALID_REQUEST','string':'Something\x20went\x20wrong\x20while\x20processing\x20your\x20request.\x20Please\x20try\x20again.'});case'AI_CHAT_CONTEXT_UNSUPPORTED_FILE_TYPE':return t({'id':'AI_CHAT_CONTEXT_UNSUPPORTED_FILE_TYPE','string':'The\x20file\x20type\x20is\x20not\x20supported.\x20Please\x20upload\x20a\x20different\x20file.'});case'AI_CHAT_CONTEXT_FILE_TOO_LARGE':return t({'id':'AI_CHAT_CONTEXT_FILE_TOO_LARGE','string':'The\x20file\x20is\x20too\x20large.\x20Please\x20upload\x20a\x20smaller\x20file.'});case'AI_CHAT_CONTEXT_FILE_TOO_MANY_PAGES':return t({'id':'AI_CHAT_CONTEXT_FILE_TOO_MANY_PAGES','string':'The\x20file\x20has\x20too\x20many\x20pages.\x20Please\x20upload\x20a\x20file\x20with\x20fewer\x20pages.'});case'AI_CHAT_CONTEXT_FORM_DATA_SIZE_LIMITS_EXCEEDED':return t({'id':'AI_CHAT_CONTEXT_FORM_DATA_SIZE_LIMITS_EXCEEDED','string':'The\x20form\x20data\x20size\x20limits\x20are\x20exceeded.\x20Please\x20upload\x20a\x20smaller\x20file.'});case'AI_CHAT_FEED_LOADING_MESSAGE_REGULAR':return t({'id':'AI_CHAT_FEED_LOADING_MESSAGE_REGULAR','string':'AI\x20is\x20preparing\x20a\x20response...'});case'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH':return t({'id':'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH','string':'AI\x20is\x20searching\x20the\x20web\x20to\x20provide\x20the\x20most\x20accurate\x20answer...'});case'AI_CHAT_FEED_LOADING_MESSAGE_REASONING':return t({'id':'AI_CHAT_FEED_LOADING_MESSAGE_REASONING','string':'AI\x20is\x20using\x20reasoning\x20to\x20provide\x20the\x20most\x20accurate\x20answer...'});case'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH_REASONING':return t({'id':'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH_REASONING','string':'AI\x20is\x20using\x20reasoning\x20and\x20searching\x20the\x20web\x20to\x20provide\x20the\x20most\x20accurate\x20answer...'});case'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH':return t({'id':'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH','string':'Scanned\x20the\x20internet\x20for\x20insights'});case'AI_CHAT_FEED_REPLY_ITEM_USED_REASONING':return t({'id':'AI_CHAT_FEED_REPLY_ITEM_USED_REASONING','string':'AI\x20used\x20reasoning\x20to\x20improve\x20the\x20response'});case'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH_REASONING':return t({'id':'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH_REASONING','string':'AI\x20used\x20search\x20and\x20reasoning\x20to\x20improve\x20the\x20response'});case'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REGULAR':return t({'id':'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REGULAR','string':'Ask\x20AI\x20anything...'});case'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH':return t({'id':'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH','string':'Ask\x20AI\x20anything\x20(web\x20search\x20enabled)...'});case'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REASONING':return t({'id':'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REASONING','string':'Ask\x20AI\x20anything\x20(reasoning\x20enabled)...'});case'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH_REASONING':return t({'id':'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH_REASONING','string':'Ask\x20AI\x20anything\x20(web\x20search\x20and\x20reasoning\x20enabled)...'});case'AI_CHAT_SUGGESTION_ACTION_SUGGEST_ALL':return t({'id':'AI_CHAT_SUGGESTION_ACTION_SUGGEST_ALL','string':'Suggest\x20all'},_0x2efdc5);case'AI_CHAT_SUGGESTION_ACTION_SUGGEST':return t({'id':'AI_CHAT_SUGGESTION_ACTION_SUGGEST','string':'Suggest'},_0x2efdc5);case'AI_CHAT_SUGGESTION_ACTION_APPLY_ALL':return t({'id':'AI_CHAT_SUGGESTION_ACTION_APPLY_ALL','string':'Apply\x20all'});case'AI_CHAT_SUGGESTION_ACTION_APPLY':return t({'id':'AI_CHAT_SUGGESTION_ACTION_APPLY','string':'Apply'});case'AI_CHAT_SUGGESTION_MORE_OPTIONS_TOOLTIP':return t({'id':'AI_CHAT_SUGGESTION_MORE_OPTIONS_TOOLTIP','string':'More\x20options'},_0x2efdc5);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.'},_0x2efdc5);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.'},_0x2efdc5);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.'},_0x2efdc5);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.'},_0x2efdc5);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'},_0x2efdc5);case'AI_BALLOON_APPLY_BUTTON':return t({'id':'AI_BALLOON_APPLY_BUTTON','string':'Apply'});case'AI_BALLOON_SUGGEST_BUTTON':return t({'id':'AI_BALLOON_SUGGEST_BUTTON','string':'Suggest'});case'AI_BALLOON_NEXT_LABEL':return t({'id':'AI_BALLOON_NEXT_LABEL','string':'Next'});case'AI_BALLOON_PREVIOUS_LABEL':return t({'id':'AI_BALLOON_PREVIOUS_LABEL','string':'Previous'});case'AI_SUGGESTION_NO_PARTS_WARNING':return t({'id':'AI_SUGGESTION_NO_PARTS_WARNING','string':'This\x20change\x20is\x20not\x20supported\x20by\x20the\x20editor\x20and\x20can\x27t\x20be\x20previewed\x20or\x20applied.'});case'AI_SUGGESTION_EMPTY_PART_WARNING':return t({'id':'AI_SUGGESTION_EMPTY_PART_WARNING','string':'Some\x20of\x20the\x20changes\x20are\x20not\x20supported\x20by\x20the\x20editor\x20and\x20can\x27t\x20be\x20previewed\x20or\x20applied.'});case'AI_ACTIONS_TRY_AGAIN':return t({'id':'AI_ACTIONS_TRY_AGAIN','string':'Retry'});case'AI_ACTIONS_PREVIOUS_INTERACTION':return t({'id':'AI_ACTIONS_PREVIOUS_INTERACTION','string':'Previous'});case'AI_ACTIONS_NEXT_INTERACTION':return t({'id':'AI_ACTIONS_NEXT_INTERACTION','string':'Next'});case'AI_MODEL_NAME_AUTO':return t({'id':'AI_MODEL_NAME_AUTO','string':'Auto'});case'AI_QUICK_ACTIONS_HEADING':return t({'id':'AI_QUICK_ACTIONS_HEADING','string':'AI\x20Quick\x20Actions'});case'AI_QUICK_ACTIONS_SEARCH':return t({'id':'AI_QUICK_ACTIONS_SEARCH','string':'Search\x20AI\x20commands'});case'AI_QUICK_ACTIONS_SEARCH_NOT_FOUND':return t({'id':'AI_QUICK_ACTIONS_SEARCH_NOT_FOUND','string':'No\x20AI\x20commands\x20found'});case'AI_QUICK_ACTIONS_ASK_AI':return t({'id':'AI_QUICK_ACTIONS_ASK_AI','string':'Ask\x20AI'});case'AI_QUICK_ACTIONS_CHAT_COMMANDS':return t({'id':'AI_QUICK_ACTIONS_CHAT_COMMANDS','string':'Chat\x20commands'});case'AI_QUICK_ACTIONS_IMPROVE_WRITING':return t({'id':'AI_QUICK_ACTIONS_IMPROVE_WRITING','string':'Improve\x20writing'});case'AI_QUICK_ACTIONS_CONTINUE_WRITING':return t({'id':'AI_QUICK_ACTIONS_CONTINUE_WRITING','string':'Continue\x20writing'});case'AI_QUICK_ACTIONS_FIX_GRAMMAR_SPELLING':return t({'id':'AI_QUICK_ACTIONS_FIX_GRAMMAR_SPELLING','string':'Fix\x20grammar\x20&\x20spelling'});case'AI_QUICK_ACTIONS_ADJUST_LENGTH':return t({'id':'AI_QUICK_ACTIONS_ADJUST_LENGTH','string':'Adjust\x20length'});case'AI_QUICK_ACTIONS_CHANGE_TONE':return t({'id':'AI_QUICK_ACTIONS_CHANGE_TONE','string':'Change\x20tone'});case'AI_QUICK_ACTIONS_TRANSLATE':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE','string':'Translate'});case'AI_QUICK_ACTIONS_EXPLAIN':return t({'id':'AI_QUICK_ACTIONS_EXPLAIN','string':'Explain'});case'AI_QUICK_ACTIONS_SUMMARIZE':return t({'id':'AI_QUICK_ACTIONS_SUMMARIZE','string':'Summarize'});case'AI_QUICK_ACTIONS_HIGHLIGHT_KEY_POINTS':return t({'id':'AI_QUICK_ACTIONS_HIGHLIGHT_KEY_POINTS','string':'Highlight\x20key\x20points'});case'AI_QUICK_ACTIONS_MAKE_SHORTER':return t({'id':'AI_QUICK_ACTIONS_MAKE_SHORTER','string':'Make\x20shorter'});case'AI_QUICK_ACTIONS_MAKE_LONGER':return t({'id':'AI_QUICK_ACTIONS_MAKE_LONGER','string':'Make\x20longer'});case'AI_QUICK_ACTIONS_MORE_CASUAL':return t({'id':'AI_QUICK_ACTIONS_MORE_CASUAL','string':'More\x20casual'});case'AI_QUICK_ACTIONS_MORE_DIRECT':return t({'id':'AI_QUICK_ACTIONS_MORE_DIRECT','string':'More\x20direct'});case'AI_QUICK_ACTIONS_MORE_FRIENDLY':return t({'id':'AI_QUICK_ACTIONS_MORE_FRIENDLY','string':'More\x20friendly'});case'AI_QUICK_ACTIONS_MORE_CONFIDENT':return t({'id':'AI_QUICK_ACTIONS_MORE_CONFIDENT','string':'More\x20confident'});case'AI_QUICK_ACTIONS_MORE_PROFESSIONAL':return t({'id':'AI_QUICK_ACTIONS_MORE_PROFESSIONAL','string':'More\x20professional'});case'AI_QUICK_ACTIONS_ADJUST_BASED_ON_DOCUMENT':return t({'id':'AI_QUICK_ACTIONS_ADJUST_BASED_ON_DOCUMENT','string':'Adjust\x20based\x20on\x20the\x20rest\x20of\x20the\x20document'});case'AI_QUICK_ACTIONS_TRANSLATE_ENGLISH':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_ENGLISH','string':'English'});case'AI_QUICK_ACTIONS_TRANSLATE_CHINESE':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_CHINESE','string':'Chinese\x20(Simplified)'});case'AI_QUICK_ACTIONS_TRANSLATE_FRENCH':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_FRENCH','string':'French'});case'AI_QUICK_ACTIONS_TRANSLATE_JAPANESE':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_JAPANESE','string':'Japanese'});case'AI_QUICK_ACTIONS_TRANSLATE_PORTUGUESE':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_PORTUGUESE','string':'Portuguese'});case'AI_QUICK_ACTIONS_TRANSLATE_KOREAN':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_KOREAN','string':'Korean'});case'AI_QUICK_ACTIONS_TRANSLATE_ITALIAN':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_ITALIAN','string':'Italian'});case'AI_QUICK_ACTIONS_TRANSLATE_RUSSIAN':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_RUSSIAN','string':'Russian'});case'AI_QUICK_ACTIONS_TRANSLATE_SPANISH':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_SPANISH','string':'Spanish'});case'AI_QUICK_ACTIONS_TRANSLATE_GERMAN':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_GERMAN','string':'German'});case'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND':return t({'id':'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND','string':'%0\x20plugin\x20is\x20required\x20but\x20not\x20found.'},_0x2efdc5);case'AI_QUICK_ACTIONS_OTHER':return t({'id':'AI_QUICK_ACTIONS_OTHER','string':'Other'});case'AI_ACTIONS_GENERIC_ERROR':return t({'id':'AI_ACTIONS_GENERIC_ERROR','string':'Sorry,\x20we\x20couldn\x27t\x20generate\x20the\x20response.\x20Please\x20try\x20again\x20in\x20a\x20moment.'});case'AI_BALLOON_SELECTION_REMOVED_ERROR':return t({'id':'AI_BALLOON_SELECTION_REMOVED_ERROR','string':'Changes\x20cannot\x20be\x20applied.\x20The\x20original\x20content\x20no\x20longer\x20exists.'});case'AI_REVIEW_MODE_STOP_GENERATING':return t({'id':'AI_REVIEW_MODE_STOP_GENERATING','string':'Stop\x20generating'});case'AI_REVIEW_MODE_HIDE_CHANGES':return t({'id':'AI_REVIEW_MODE_HIDE_CHANGES','string':'Hide\x20changes'});case'AI_REVIEW_MODE_SHOW_CHANGES':return t({'id':'AI_REVIEW_MODE_SHOW_CHANGES','string':'Show\x20changes'});case'AI_REVIEW_MODE_ACCEPT_ALL':return t({'id':'AI_REVIEW_MODE_ACCEPT_ALL','string':'Accept\x20all'});case'AI_REVIEW_MODE_EXIT_REVIEW':return t({'id':'AI_REVIEW_MODE_EXIT_REVIEW','string':'Exit\x20review'});case'AI_REVIEW_MODE_ACCEPT_CHANGE':return t({'id':'AI_REVIEW_MODE_ACCEPT_CHANGE','string':'Accept'});case'AI_REVIEW_MODE_DISMISS_CHANGE':return t({'id':'AI_REVIEW_MODE_DISMISS_CHANGE','string':'Dismiss'});case'AI_REVIEW_MODE_LEARN_MORE':return t({'id':'AI_REVIEW_MODE_LEARN_MORE','string':'Learn\x20more'});case'AI_REVIEW_MODE_COMPLETED_TEXT':return t({'id':'AI_REVIEW_MODE_COMPLETED_TEXT','string':'There\x27s\x20nothing\x20left\x20to\x20review.'});case'AI_REVIEW_MODE_EMPTY_RESULTS_TEXT':return t({'id':'AI_REVIEW_MODE_EMPTY_RESULTS_TEXT','string':'There\x20are\x20no\x20changes\x20to\x20suggest.'});case'AI_REVIEW_MODE_FINISH_REVIEW_BUTTON_LABEL':return t({'id':'AI_REVIEW_MODE_FINISH_REVIEW_BUTTON_LABEL','string':'Finish\x20Review'});case'AI_REVIEW_MODE_FINISH_REVIEW_HEADER_TITLE':return t({'id':'AI_REVIEW_MODE_FINISH_REVIEW_HEADER_TITLE','string':'Review\x20complete.\x20Finish\x20when\x20ready.'});case'AI_REVIEW_INITIALIZATION_ERROR_MESSAGE':return t({'id':'AI_REVIEW_INITIALIZATION_ERROR_MESSAGE','string':'AI\x20Review\x20initialized\x20with\x20errors.\x20Some\x20features\x20may\x20not\x20be\x20available\x20or\x20work\x20properly.'});case'AI_REVIEW_MODE_GENERAL_ERROR_MESSAGE':return t({'id':'AI_REVIEW_MODE_GENERAL_ERROR_MESSAGE','string':'Sorry,\x20we\x20couldn\x27t\x20generate\x20the\x20whole\x20review\x20properly.\x20Please\x20try\x20again\x20in\x20a\x20moment.'});case'AI_REVIEW_MODE_CHUNK_ERROR_MESSAGE':return t({'id':'AI_REVIEW_MODE_CHUNK_ERROR_MESSAGE','string':'Not\x20everything\x20went\x20through,\x20but\x20the\x20completed\x20items\x20are\x20listed\x20below.'});case'AI_REVIEW_MODE':return t({'id':'AI_REVIEW_MODE','string':'Review'});case'AI_REVIEW_MODE_PROMPT_EMPTY_ERROR':return t({'id':'AI_REVIEW_MODE_PROMPT_EMPTY_ERROR','string':'Prompt\x20must\x20not\x20be\x20empty'});case'AI_REVIEW_CHECK_CUSTOM_TITLE':return t({'id':'AI_REVIEW_CHECK_CUSTOM_TITLE','string':'Custom\x20command'});case'AI_REVIEW_CHECK_CUSTOM_DESCRIPTION':return t({'id':'AI_REVIEW_CHECK_CUSTOM_DESCRIPTION','string':'Enter\x20a\x20custom\x20command\x20for\x20a\x20specific\x20review.'});case'AI_REVIEW_CHECK_CORRECTNESS_TITLE':return t({'id':'AI_REVIEW_CHECK_CORRECTNESS_TITLE','string':'Proofread'});case'AI_REVIEW_CHECK_CORRECTNESS_DESCRIPTION':return t({'id':'AI_REVIEW_CHECK_CORRECTNESS_DESCRIPTION','string':'Check\x20the\x20text\x20for\x20errors\x20in\x20grammar,\x20spelling,\x20and\x20punctuation.'});case'AI_REVIEW_CHECK_CLARITY_TITLE':return t({'id':'AI_REVIEW_CHECK_CLARITY_TITLE','string':'Improve\x20clarity'});case'AI_REVIEW_CHECK_CLARITY_DESCRIPTION':return t({'id':'AI_REVIEW_CHECK_CLARITY_DESCRIPTION','string':'Improve\x20the\x20logical\x20structure\x20and\x20precision\x20for\x20clearer\x20message.'});case'AI_REVIEW_CHECK_READABILITY_TITLE':return t({'id':'AI_REVIEW_CHECK_READABILITY_TITLE','string':'Improve\x20readability'});case'AI_REVIEW_CHECK_READABILITY_DESCRIPTION':return t({'id':'AI_REVIEW_CHECK_READABILITY_DESCRIPTION','string':'Adjust\x20sentence\x20structure\x20and\x20word\x20choice\x20for\x20an\x20easier\x20read.'});case'AI_REVIEW_CHECK_MAKE_TITLE':return t({'id':'AI_REVIEW_CHECK_MAKE_TITLE','string':'Adjust\x20length'});case'AI_REVIEW_CHECK_MAKE_DESCRIPTION':return t({'id':'AI_REVIEW_CHECK_MAKE_DESCRIPTION','string':'Shorten\x20or\x20lengthen\x20the\x20text\x20as\x20needed.'});case'AI_REVIEW_CHECK_MAKE_OPTIONS_LABEL':return t({'id':'AI_REVIEW_CHECK_MAKE_OPTIONS_LABEL','string':'Adjust\x20length'});case'AI_REVIEW_CHECK_MAKE_OPTIONS_DATA_LONGER':return t({'id':'AI_REVIEW_CHECK_MAKE_OPTIONS_DATA_LONGER','string':'Longer'});case'AI_REVIEW_CHECK_MAKE_OPTIONS_DATA_SHORTER':return t({'id':'AI_REVIEW_CHECK_MAKE_OPTIONS_DATA_SHORTER','string':'Shorter'});case'AI_REVIEW_CHECK_MAKE_TONE_TITLE':return t({'id':'AI_REVIEW_CHECK_MAKE_TONE_TITLE','string':'Adjust\x20tone\x20and\x20style'});case'AI_REVIEW_CHECK_MAKE_TONE_DESCRIPTION':return t({'id':'AI_REVIEW_CHECK_MAKE_TONE_DESCRIPTION','string':'Modify\x20the\x20text\x20to\x20a\x20desired\x20tone\x20and\x20style.'});case'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_LABEL':return t({'id':'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_LABEL','string':'Adjust\x20tone\x20and\x20style'});case'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_CASUAL':return t({'id':'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_CASUAL','string':'Casual'});case'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_DIRECT':return t({'id':'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_DIRECT','string':'Direct'});case'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_FRIENDLY':return t({'id':'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_FRIENDLY','string':'Friendly'});case'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_CONFIDENT':return t({'id':'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_CONFIDENT','string':'Confident'});case'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_PROFESSIONAL':return t({'id':'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_PROFESSIONAL','string':'Professional'});case'AI_REVIEW_CHECK_TRANSLATE_TITLE':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_TITLE','string':'Translate'});case'AI_REVIEW_CHECK_TRANSLATE_DESCRIPTION':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_DESCRIPTION','string':'Translate\x20the\x20text\x20into\x20another\x20language.'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_LABEL':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_LABEL','string':'Select\x20language'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_ENGLISH':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_ENGLISH','string':'English'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_SPANISH':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_SPANISH','string':'Spanish'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_FRENCH':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_FRENCH','string':'French'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_GERMAN':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_GERMAN','string':'German'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_CHINESE':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_CHINESE','string':'Chinese\x20(Simplified)'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_JAPANESE':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_JAPANESE','string':'Japanese'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_RUSSIAN':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_RUSSIAN','string':'Russian'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_PORTUGUESE':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_PORTUGUESE','string':'Portuguese'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_KOREAN':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_KOREAN','string':'Korean'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_ITALIAN':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_ITALIAN','string':'Italian'});case'AI_REVIEW_MODE_CHECK_STATUS_ACCEPTED':return t({'id':'AI_REVIEW_MODE_CHECK_STATUS_ACCEPTED','string':'Accepted'});case'AI_REVIEW_MODE_CHECK_STATUS_REJECTED':return t({'id':'AI_REVIEW_MODE_CHECK_STATUS_REJECTED','string':'Dismissed'});case'AI_REVIEW_MODE_CHECK_STATUS_OUTDATED':return t({'id':'AI_REVIEW_MODE_CHECK_STATUS_OUTDATED','string':'Outdated'});case'AI_TOGGLE_BUTTON_LABEL':return t({'id':'AI_TOGGLE_BUTTON_LABEL','string':'AI'});case'AI_TRANSLATE_ACCEPT_ALL':return t({'id':'AI_TRANSLATE_ACCEPT_ALL','string':'Accept\x20translation'});case'AI_TRANSLATE_FINISH_HEADER_TITLE':return t({'id':'AI_TRANSLATE_FINISH_HEADER_TITLE','string':'Translation\x20complete.\x20Finish\x20when\x20ready.'});case'AI_TRANSLATE_EMPTY_RESULTS_TEXT':return t({'id':'AI_TRANSLATE_EMPTY_RESULTS_TEXT','string':'There\x20are\x20no\x20translations\x20to\x20review.'});case'AI_TRANSLATE_FINISH_BUTTON_LABEL':return t({'id':'AI_TRANSLATE_FINISH_BUTTON_LABEL','string':'Finish\x20Translation'});case'AI_TRANSLATE_CHECK_LIST_HEADER_TITLE':return t({'id':'AI_TRANSLATE_CHECK_LIST_HEADER_TITLE','string':'Content\x20Translation'});case'AI_TRANSLATE_CHECK_LIST_HEADER_DESCRIPTION':return t({'id':'AI_TRANSLATE_CHECK_LIST_HEADER_DESCRIPTION','string':'A\x20dedicated\x20mode\x20for\x20translating\x20the\x20entire\x20text.'});case'AI_TRANSLATE_CHECK_RESULTS_LOADING_TITLE':return t({'id':'AI_TRANSLATE_CHECK_RESULTS_LOADING_TITLE','string':'Translating\x20to'});case'AI_TRANSLATE_CHECK_RESULTS_READY_TITLE':return t({'id':'AI_TRANSLATE_CHECK_RESULTS_READY_TITLE','string':'Translated\x20to'});case'AI_TRANSLATE_GENERAL_ERROR_MESSAGE':return t({'id':'AI_TRANSLATE_GENERAL_ERROR_MESSAGE','string':'Sorry,\x20we\x20couldn\x27t\x20generate\x20translations\x20properly.\x20Please\x20try\x20again\x20in\x20a\x20moment.'});case'AI_SUGGESTION_DISABLED_TOOLTIP_MESSAGE':return t({'id':'AI_SUGGESTION_DISABLED_TOOLTIP_MESSAGE','string':'This\x20conversation\x20is\x20loaded\x20from\x20chat\x20history\x20from\x20a\x20previous\x20session,\x20so\x20you\x20can’t\x20apply,\x20reject,\x20or\x20suggest\x20changes.'});case'AI_SUGGESTION_DISABLED_FEED_MESSAGE':return t({'id':'AI_SUGGESTION_DISABLED_FEED_MESSAGE','string':'Actions\x20aren’t\x20available\x20for\x20changes\x20from\x20a\x20previous\x20session.'});default:return _0x596622;}}const os='ck-ai-button-primary',hs='ck-ai-button-secondary',cs='ck-ai-button-tertiary';function ls(_0x3d9dfb,_0x57dd3b){const _0xd7b8d3=new kt(_0x3d9dfb),_0x307fa2=as(_0x3d9dfb,'AI_TABS_LABEL_MINIMIZE'),_0xaa19f8=as(_0x3d9dfb,'AI_TABS_LABEL_MAXIMIZE');return _0xd7b8d3['set']({'withText':!0x1,'icon':_0x51bbc4,'tooltip':!0x0,'class':'ck-ai-tabs__resize\x20'+cs}),_0xd7b8d3['bind']('label')['to'](_0x57dd3b,'isMaximized',_0x2799e2=>_0x2799e2?_0x307fa2:_0xaa19f8),_0xd7b8d3['bind']('icon')['to'](_0x57dd3b,'isMaximized',_0x6fe54=>_0x6fe54?_0x1d64fe:_0x51bbc4),_0xd7b8d3['bind']('isOn')['to'](_0x57dd3b,'isMaximized'),_0xd7b8d3['on']('execute',()=>{_0x57dd3b['fire']('resizeTabs');}),_0xd7b8d3;}function us(_0x38d147){return _0x5c8415(_0x38d147);}function ds(_0x49a825){return _0x419b49(_0x49a825);}function _s(_0xf4a4d7,_0x4d2aba,_0x42b5a4){const _0x43705f=null!==_0x4d2aba?_0x901e38=>_0x901e38['attribs'][_0xf4a4d7]===_0x4d2aba:_0x20b30a=>Boolean(_0x20b30a['attribs'][_0xf4a4d7]);return _0x272a75(_0x15ed14=>_0x77ea4b(_0x15ed14)&&_0x43705f(_0x15ed14),_0x42b5a4);}function As(_0x4c506c,_0x1c2e10,_0x1ba6ca){const _0x19265e=null!==_0x1c2e10?_0x518cd5=>_0x518cd5['attribs'][_0x4c506c]===_0x1c2e10:_0x17dfd4=>Boolean(_0x17dfd4['attribs'][_0x4c506c]);return _0x1d864b(_0x1c62dc=>_0x77ea4b(_0x1c62dc)&&_0x19265e(_0x1c62dc),_0x1ba6ca);}function gs(_0x164b9b,_0xaf8925){return _0x164b9b&&_0x77ea4b(_0x164b9b)?_0x164b9b['attribs'][_0xaf8925]:null;}function Is(_0x3c04fb,_0x5cec83,_0xe734b3){_0x77ea4b(_0x3c04fb)&&(null===_0xe734b3?delete _0x3c04fb['attribs'][_0x5cec83]:_0x3c04fb['attribs'][_0x5cec83]=_0xe734b3);}function Es(_0x1eca14,_0x1729b,_0x1d398e){const _0x158966=_0x1729b['cloneNode'](!0x0);'beforebegin'===_0x1d398e?_0x5b34ab(_0x1eca14,_0x158966):'afterbegin'===_0x1d398e?_0x2bedf0(_0x1eca14,_0x158966):'beforeend'===_0x1d398e?_0x58db6b(_0x1eca14,_0x158966):'afterend'===_0x1d398e&&_0x5d104d(_0x1eca14,_0x158966);}function Ts(_0x64c35b){const _0xce79b3=[];let _0x28dc51=_0x64c35b;for(;_0x28dc51;)_0x28dc51=_0x19da4f(_0x28dc51),_0x28dc51&&_0xce79b3['push'](_0x28dc51);return _0xce79b3;}function ps(_0x2104aa){return _0x2104aa['replace'](/^\s+/gm,'')['replace'](/\s+$/gm,'')['replace'](/\n*/g,'')['replace'](/\s+/g,'\x20')['replace'](/>\s*</g,'><');}function ms(_0x55cad0){let _0x323c5e=0x0;for(;_0x55cad0['parentNode'];)_0x55cad0=_0x55cad0['parentNode'],_0x323c5e++;return _0x323c5e;}function Cs(_0x9f74d3){const _0x366536=[];let _0x5f4425=_0x9f74d3['nextSibling'];for(;_0x5f4425;)_0x366536['push'](_0x5f4425),_0x5f4425=_0x5f4425['nextSibling'];_0x366536['forEach'](_0x30851f=>{_0x411d52(_0x30851f);});}class ws extends/* #__PURE__ -- @preserve */
25
- ht(){['_m2html'];constructor(){super();const _0x24bec3=Object['entries'](_0x544eb0),_0x234282=_0x24bec3['findIndex'](([_0x582b3c])=>'rehypeDomRaw'===_0x582b3c);if(-0x1===_0x234282)throw new ot('ai-response-parser-unable-to-set-up-parser');_0x24bec3['splice'](_0x234282+0x1,0x0,['rehypeSanitize',_0x1b7b18]),this['_m2html']=new _0xd0e07b({'plugins':Object['fromEntries'](_0x24bec3)});}['convertMarkdownToHTML'](_0x427c43){const _0x2a3408=this['_m2html']['parse'](_0x427c43);return this['parseAndNormalizeHTML'](_0x2a3408);}['parseAndNormalizeHTML'](_0x5ab673){return this['_parseHTML'](_0x5ab673);}['_parseHTML'](_0x584398){const _0x3e51ad=us('<dummy>'+_0x584398['replace'](/^\t+/gm,'\x20')['replace'](/\n*/g,'')['replace'](/\s+/g,'\x20')['replace'](/<[^>]*?$/g,'')+'</dummy>');return _0x3e51ad['children']=_0x3e51ad['children'][0x0]['children'],_0x3e51ad;}}class fs extends/* #__PURE__ -- @preserve */
26
- ht(){['_generateUid'];['_touchedNodesState']={'newIds':[],'modifiedIds':[],'removedIds':[],'invalidIds':[],'lastTouchedId':null};['_existingDataIds']=new Set();constructor(_0x118f90){super(),this['_generateUid']=_0x118f90||at;}['merge'](_0x818cec,_0xaf307e,_0x212a55){const _0x38fc3c=_0x818cec['cloneNode'](!0x0);if(0x0===_0xaf307e['childNodes']['length']){const _0xe5803e=[];return As('data-id','new-element',_0x38fc3c)['forEach'](_0x523fb0=>{const _0x382f7c=this['_generateUid']();Is(_0x523fb0,'data-id',_0x382f7c),_0xe5803e['push'](_0x382f7c);}),this['_removeSpecialComments'](_0x38fc3c),{'parsedContent':_0x38fc3c,'newNodeIds':_0xe5803e,'modifiedNodeIds':[],'removedNodeIds':[]};}_0x212a55&&_0x212a55['markUnstableElements']&&this['_markLastTagElementUnstable'](_0x38fc3c),this['_touchedNodesState']['newIds']=[],this['_touchedNodesState']['modifiedIds']=[],this['_touchedNodesState']['removedIds']=[],this['_touchedNodesState']['invalidIds']=[],this['_touchedNodesState']['lastTouchedId']=null,this['_existingDataIds']=new Set(As('data-id',null,_0xaf307e)['map'](_0x7088d3=>gs(_0x7088d3,'data-id'))['filter'](_0x564803=>!!_0x564803));let _0x566610=-0x1,_0x45b711=!0x1;const _0x3bb6fa=_0x38fc3c['childNodes'],_0x1b476a=Array['from'](_0x3bb6fa)['filter'](_0x526f6f=>!(0x3===_0x526f6f['nodeType']&&''===ds(_0x526f6f)['trim']())),_0x25ea7e=_0x1b476a['length'];for(let _0x1d4599=0x0;_0x1d4599<_0x25ea7e;_0x1d4599++){const _0x533a24=_0x1b476a[_0x1d4599],_0x1137ed=_0x1b476a[_0x1d4599+0x1];if(this['_isNewNode'](_0x533a24)){if(-0x1===_0x566610&&(_0x566610=_0x1d4599),this['_markWrappedElements'](_0x533a24),!this['_isNewNode'](_0x1137ed)){const [_0x279a62,_0x694c1]=this['_findReferenceNode'](_0x533a24,_0x45b711,_0xaf307e);if(_0x279a62){const _0x11d240=Array['from'](_0x1b476a)['slice'](_0x566610,_0x1d4599+0x1);this['_insertNodes'](_0x279a62,_0x11d240,_0x694c1),_0x566610=-0x1;}}}else{if(this['_isExistingContentComment'](_0x533a24))_0x45b711=!0x0;else{if(this['_isExistingNode'](_0x533a24)){const _0x332968=gs(_0x533a24,'data-id');if(_0x332968&&this['_existingDataIds']['has'](_0x332968)){const _0x5cce37=_s('data-id',_0x332968,_0xaf307e);this['_replaceNode'](_0x5cce37,_0x533a24);}if(this['_touchedNodesState']['removedIds']['includes'](_0x332968)){const _0x22747a=this['_touchedNodesState']['removedIds']['indexOf'](_0x332968);this['_touchedNodesState']['removedIds']['splice'](_0x22747a,0x1);}}else{if(this['_isDelNode'](_0x533a24)){const _0x4b1605=gs(_0x533a24,'data-id');this['_touchedNodesState']['modifiedIds']['includes'](_0x4b1605)||this['_storeDeletedElementIds'](_0x533a24);}}}}}for(const _0x14672e of this['_touchedNodesState']['removedIds']){const _0x41bd17=_s('data-id',_0x14672e,_0xaf307e);if(_0x41bd17){if(_0x212a55&&_0x212a55['replaceRemovedWith']){this['_touchedNodesState']['lastTouchedId']=_0x14672e;const _0x1d78c4=_0x212a55['replaceRemovedWith']['cloneNode'](!0x0);Is(_0x1d78c4,'data-id',_0x14672e),Is(_0x1d78c4,'data-removed','true'),_0x26fd61(_0x41bd17,_0x1d78c4);}else _0x411d52(_0x41bd17);}}if(As('data-wrapped-id',null,_0xaf307e)['forEach'](_0x9244fd=>{const _0x95f8fd=_s('data-id',gs(_0x9244fd,'data-wrapped-id'),_0xaf307e);var _0x36b0f1,_0x1db554;_0x95f8fd&&(_0x1db554=_0x9244fd,_0x411d52(_0x36b0f1=_0x95f8fd),_0x26fd61(_0x1db554,_0x36b0f1));}),As('data-id','new-element',_0xaf307e)['forEach'](_0x3cbe0d=>{const _0x22cc1c=this['_getUid'](_0x3cbe0d);Is(_0x3cbe0d,'data-id',_0x22cc1c),this['_touchedNodesState']['newIds']['push'](_0x22cc1c);}),this['_removeSpecialComments'](_0xaf307e),_0x212a55&&_0x212a55['markUnstableElements']&&this['_markUnstableElements'](_0xaf307e,_0x212a55['markUnstableElementsDepth']||0x0),_0x212a55&&_0x212a55['cutAfterLastChange']&&this['_touchedNodesState']['lastTouchedId']){let _0x29c3ab=_s('data-id',this['_touchedNodesState']['lastTouchedId'],_0xaf307e);for(;_0x29c3ab;)Cs(_0x29c3ab),_0x29c3ab=_0x29c3ab['parentNode'];}return{'parsedContent':_0xaf307e,'newNodeIds':this['_touchedNodesState']['newIds'],'modifiedNodeIds':this['_touchedNodesState']['modifiedIds'],'removedNodeIds':this['_touchedNodesState']['removedIds']};}['_insertNodes'](_0x4a54d3,_0x362369,_0x297f1d){for(const _0x11d9ce of _0x362369){const _0x5470a3=this['_getUid'](_0x11d9ce);Is(_0x11d9ce,'data-id',_0x5470a3),this['_touchedNodesState']['newIds']['push'](_0x5470a3),this['_touchedNodesState']['lastTouchedId']=_0x5470a3;}const _0x52b46b='afterbegin'===_0x297f1d||'afterend'===_0x297f1d?_0x362369['reverse']():_0x362369;for(const _0x3f5705 of _0x52b46b)Es(_0x4a54d3,_0x3f5705,_0x297f1d);}['_replaceNode'](_0x252df5,_0x4a5344){if(!_0x252df5)return;if(_0x1ca697=_0x4a5344,ps(ds(_0x252df5))===ps(ds(_0x1ca697)))return;var _0x1ca697;const _0x17b0f5=this['_getUid'](_0x252df5);Is(_0x4a5344,'data-id',_0x17b0f5),this['_touchedNodesState']['modifiedIds']['push'](_0x17b0f5),this['_touchedNodesState']['lastTouchedId']=_0x17b0f5,_0x26fd61(_0x252df5,_0x4a5344['cloneNode'](!0x0));}['_findReferenceNode'](_0x278786,_0x1ff6f0,_0x16d4bb){const _0x3f5f25=this['_findPrevElementWithDataId'](_0x278786,!0x1);if(_0x3f5f25){const _0x2070f9=this['_getNodeDataId'](_0x3f5f25),_0x55adf6=_s('data-id',_0x2070f9,_0x16d4bb);if(_0x55adf6)return[_0x55adf6,'afterend'];this['_touchedNodesState']['invalidIds']['push'](_0x2070f9);}const _0x1f0c03=this['_findNextElementWithDataId'](_0x278786,!0x1);if(_0x1f0c03){const _0x2bde7a=this['_getNodeDataId'](_0x1f0c03),_0x44896f=_s('data-id',_0x2bde7a,_0x16d4bb);if(_0x44896f)return[_0x44896f,'beforebegin'];this['_touchedNodesState']['invalidIds']['push'](_0x2bde7a);}return _0x1ff6f0?_0x278786['nextSibling']?this['_findFallbackReferenceNode'](_0x278786,_0x16d4bb):[_0x16d4bb['childNodes'][_0x16d4bb['childNodes']['length']-0x1],'afterend']:[_0x16d4bb['childNodes'][0x0],'beforebegin'];}['_findFallbackReferenceNode'](_0x3132d7,_0x3bb941){const _0x29fd2a=[],_0x1c8551=this['_findPrevElementWithDataId'](_0x3132d7,!0x0);if(_0x1c8551){const _0x30747f=_s('data-id',this['_getNodeDataId'](_0x1c8551),_0x3bb941);_0x30747f&&_0x29fd2a['push']([_0x30747f,'afterend']);}const _0x19ecf2=this['_findNextElementWithDataId'](_0x3132d7,!0x0);if(_0x19ecf2){const _0x27a321=_s('data-id',this['_getNodeDataId'](_0x19ecf2),_0x3bb941);_0x27a321&&_0x29fd2a['push']([_0x27a321,'beforebegin']);}if(_0x29fd2a['length']>0x1)return ms(_0x29fd2a[0x0][0x0])<=ms(_0x29fd2a[0x1][0x0])?_0x29fd2a[0x0]:_0x29fd2a[0x1];return 0x1===_0x29fd2a['length']?_0x29fd2a[0x0]:[_0x3bb941['lastChild'],'afterend'];}['_findNextElementWithDataId'](_0x9baab7,_0x33fc91){let _0x1df583=_0x9baab7['nextSibling'],_0x536a3b=null,_0xa4f609=!0x1;for(;_0x1df583;){if(_0x337d38(_0x1df583)){if(this['_isDelNode'](_0x1df583)&&(_0x536a3b=_0x1df583),this['_isExistingContentComment'](_0x1df583)&&_0x33fc91&&!_0xa4f609){_0xa4f609=!0x0,_0x1df583=_0x1df583['nextSibling'];continue;}break;}const _0x4570f6=gs(_0x1df583,'data-id');if(_0x4570f6&&'new-element'!==_0x4570f6&&this['_existingDataIds']['has'](_0x4570f6)){_0x536a3b=_0x1df583;break;}_0x1df583=_0x1df583['nextSibling'];}return _0x536a3b;}['_findPrevElementWithDataId'](_0x141c7e,_0x161533){let _0x5ebc84=_0x141c7e['previousSibling'],_0x54f551=null,_0x20d718=!0x1;for(;_0x5ebc84;){if(_0x337d38(_0x5ebc84)){if(this['_isDelNode'](_0x5ebc84)&&(_0x54f551=_0x5ebc84),this['_isExistingContentComment'](_0x5ebc84)&&_0x161533&&!_0x20d718){_0x20d718=!0x0,_0x5ebc84=_0x5ebc84['previousSibling'];continue;}break;}const _0x438fd6=gs(_0x5ebc84,'data-id');if(_0x438fd6&&'new-element'!==_0x438fd6&&this['_existingDataIds']['has'](_0x438fd6)){_0x54f551=_0x5ebc84;break;}_0x5ebc84=_0x5ebc84['previousSibling'];}return _0x54f551;}['_markWrappedElements'](_0xaef71e){_0x77ea4b(_0xaef71e)&&As('data-id',null,_0xaef71e)['forEach'](_0x1db4b3=>{this['_isExistingNode'](_0x1db4b3)&&!this['_hasWrappedParent'](_0x1db4b3)&&(Is(_0x1db4b3,'data-wrapped-id',gs(_0x1db4b3,'data-id')),Is(_0x1db4b3,'data-id',null));});}['_getNodeDataId'](_0xdc356b){if(!_0xdc356b)return null;if(_0x77ea4b(_0xdc356b))return gs(_0xdc356b,'data-id');if(_0x337d38(_0xdc356b)){const _0x4b1ae1=ds(_0xdc356b)['match'](/removed[\s*-]data-id="([^"]+)"/);if(_0x4b1ae1&&_0x4b1ae1[0x1])return _0x4b1ae1[0x1];}return null;}['_storeDeletedElementIds'](_0x58a296){if(_0x337d38(_0x58a296)){const _0x40e73a=ds(_0x58a296)['match'](/removed[\s*-]data-id="([^"]+)"/);_0x40e73a&&_0x40e73a[0x1]&&this['_touchedNodesState']['removedIds']['push'](_0x40e73a[0x1]);}}['_getUid'](_0x4a533d){return this['_isExistingNode'](_0x4a533d)?gs(_0x4a533d,'data-id'):this['_generateUid']();}['_removeSpecialComments'](_0x2cc144){(function(_0x600c46){return _0x57ddbf(_0x49b807=>_0x337d38(_0x49b807),_0x600c46,!0x0,0x1/0x0);}(_0x2cc144)['filter'](_0x3e3710=>this['_isDelNode'](_0x3e3710)||this['_isExistingContentComment'](_0x3e3710))['forEach'](_0x487f4c=>{_0x411d52(_0x487f4c);}));}['_markLastTagElementUnstable'](_0x56d398){const _0x2aba71=_0x56d398['childNodes'],_0x2da0f9=_0x2aba71[_0x2aba71['length']-0x1];_0x2da0f9&&_0x77ea4b(_0x2da0f9)&&Is(_0x2da0f9,'data-unstable','true');}['_markUnstableElements'](_0x439647,_0x266bbb){const _0x354ccb=_s('data-unstable','true',_0x439647);if(!_0x354ccb)return;const _0x4a5047=Ts(_0x354ccb)['slice'](0x0,-0x1),_0x36190b=_0x4a5047['length'];let _0x12b854=_0x354ccb;if(_0x36190b>_0x266bbb){let _0x273465=_0x36190b,_0x2f6cce=null;for(;_0x273465>_0x266bbb&&_0x273465>=0x0;)_0x273465--,_0x2f6cce=_0x4a5047[_0x273465];_0x2f6cce&&(_0x12b854=_0x2f6cce,Is(_0x354ccb,'data-unstable',null),Is(_0x2f6cce,'data-unstable','true'));}else{if(_0x36190b<_0x266bbb){let _0x22f6cb=_0x36190b,_0x3c3479=_0x354ccb;for(;_0x22f6cb<_0x266bbb;){const _0x16fd3c=_0x3c3479['childNodes']['filter'](_0x50ef3f=>_0x77ea4b(_0x50ef3f));if(0x0===_0x16fd3c['length'])break;_0x22f6cb++,_0x3c3479=_0x16fd3c[_0x16fd3c['length']-0x1];}_0x3c3479&&(_0x12b854=_0x3c3479,Is(_0x354ccb,'data-unstable',null),Is(_0x3c3479,'data-unstable','true'));}}let _0x5c5bad=_0x12b854;for(;_0x5c5bad;){for(;_0x5c5bad['nextSibling'];)_0x5c5bad=_0x5c5bad['nextSibling'],_0x77ea4b(_0x5c5bad)&&Is(_0x5c5bad,'data-unstable','true');_0x5c5bad=_0x5c5bad['parentNode'];}}['_isNewNode'](_0x1f7dde){return Boolean('new-element'===gs(_0x1f7dde,'data-id'));}['_isExistingNode'](_0x3fd295){return Boolean((gs(_0x3fd295,'data-id')||'')['length']>0x0&&'new-element'!==gs(_0x3fd295,'data-id'));}['_isDelNode'](_0x523c54){return!!_0x523c54&&Boolean(_0x337d38(_0x523c54)&&ds(_0x523c54)['match'](/removed[\s*-]data-id="[^"]+"/));}['_hasWrappedParent'](_0x4dd725){let _0x11f324=_0x4dd725['parentNode'];for(;_0x11f324;){if(gs(_0x11f324,'data-wrapped-id'))return!0x0;_0x11f324=_0x11f324['parentNode'];}return!0x1;}['_isExistingContentComment'](_0x941010){return Boolean(_0x337d38(_0x941010)&&ds(_0x941010)['match'](/\s*existing[\s*-](content|document)\s*/g));}}function Ss({editor:_0x47428c,changeGroups:_0x3d7483,documentContextContent:_0x4e02e1,showDiff:_0x40298b,trimUnchanged:_0x2eab39=!0x0}){return _0x3d7483['map'](_0x253a11=>{const _0x4bd7c8=new _0xb96947([]),_0x27140b=new _0xb96947([]);for(const _0x319343 of _0x253a11['changes'])if(_0x40298b&&'removed'==_0x319343['type']||_0x27140b['children']['push'](_0x319343['node']['cloneNode'](!0x0)),'new'!=_0x319343['type']&&(_0x40298b||'removed'!=_0x319343['type'])){const _0x100c43=_0x272a75(_0x144da4=>gs(_0x144da4,'data-id')==_0x319343['id'],_0x4e02e1,!0x0);_0x100c43&&_0x4bd7c8['children']['push'](_0x100c43['cloneNode'](!0x0));}const {content:_0x14f9d3,hasChanges:_0x326646}=function(_0x243a07,_0x41ccf4,_0x413961,_0x2add1b,_0x2b812a=!0x0){const _0x5a975d=_0x243a07['plugins']['get']('DocumentCompare'),_0x29d6ad=ds(_0x41ccf4),_0x502cf8=ds(_0x413961),_0x329353=_0x243a07['data']['parse'](_0x29d6ad,'$root'),_0x5efc4b=_0x243a07['model']['createPositionAt'](_0x329353,0x0),_0x4adda6=_0x5a975d['getDiff'](_0x29d6ad,_0x502cf8,{'anchor':_0x5efc4b,'markDeletions':_0x2add1b}),_0x212ba4=_0x4adda6['getOperations']();if(0x0==_0x212ba4['length'])return{'content':_0x41ccf4['cloneNode'](!0x0),'hasChanges':!0x1};_0x2add1b?function(_0x3ca6ec,_0x5a95bc,_0x5c0fcf){if(0x0==_0x3ca6ec['length'])return;const _0x1a8c8f=_0x5c0fcf['plugins']['get']('DocumentCompare'),_0x479481=_0x5c0fcf['plugins']['get']('SuggestionsConversion');_0x5c0fcf['model']['change'](_0x1710dc=>{const _0x14f923=new Set();for(let _0x1159ab=0x0;_0x1159ab<_0x3ca6ec['length'];_0x1159ab++){const _0x5aeede=_0x3ca6ec[_0x1159ab];if(_0x5aeede['baseVersion']=null,_0x5aeede['isDocumentOperation']=!0x1,_0x1a8c8f['isMarkedRemoveOperation'](_0x5aeede)){const _0x63eb2=_0x2609d6(_0x5aeede['newRange'],_0x5c0fcf['model']),_0x2503b5='suggestion:deletion:'+at()+':$aiSuggestion';_0x5a95bc['markers']['set'](_0x2503b5,_0x63eb2);}else switch(_0x5aeede['type']){case'rename':{if(_0x5aeede['oldName']==_0x5aeede['newName'])break;_0x1710dc['batch']['addOperation'](_0x5aeede),_0x5c0fcf['model']['applyOperation'](_0x5aeede);const _0x41c85c='$elementName',_0x131d95=_0x5aeede['position'],_0x511327=_0x5c0fcf['model']['createRange'](_0x131d95,_0x5c0fcf['model']['createPositionAt'](_0x131d95['nodeAfter'],'end')),_0xb3bbea='suggestion:attribute:'+_0x41c85c+':'+at()+':$aiSuggestion';_0x5a95bc['markers']['set'](_0xb3bbea,_0x511327);break;}case'addAttribute':case'removeAttribute':case'changeAttribute':{if(_0x5aeede['oldValue']==_0x5aeede['newValue'])break;_0x1710dc['batch']['addOperation'](_0x5aeede),_0x5c0fcf['model']['applyOperation'](_0x5aeede);const _0xa2d347=_0x5aeede['key'];if(!_0x479481['isRegisteredAttribute'](_0xa2d347))break;const _0x357841=_0x2609d6(_0x5aeede['range'],_0x5c0fcf['model']),_0x3e9397='suggestion:attribute:'+_0xa2d347+':'+at()+':$aiSuggestion';_0x5a95bc['markers']['set'](_0x3e9397,_0x357841);break;}case'insert':{_0x1710dc['batch']['addOperation'](_0x5aeede),_0x5c0fcf['model']['applyOperation'](_0x5aeede);if(_0x3ca6ec[_0x1159ab+0x1]&&'move'==_0x3ca6ec[_0x1159ab+0x1]['type']){bs(_0x5a95bc,_0x5aeede);break;}const _0x52587f=_0x5aeede['position'],_0x40b0bb=_0x5aeede['howMany'],_0x3b80d1=_0x2609d6(_0x5c0fcf['model']['createRange'](_0x52587f,_0x52587f['getShiftedBy'](_0x40b0bb)),_0x5c0fcf['model']),_0x447ef2='suggestion:insertion:'+at()+':$aiSuggestion';_0x5a95bc['markers']['set'](_0x447ef2,_0x3b80d1);break;}case'split':{_0x1710dc['batch']['addOperation'](_0x5aeede),_0x5c0fcf['model']['applyOperation'](_0x5aeede);const _0x5b05ae=_0x5aeede['splitPosition'],_0x5167dc=_0x5aeede['moveTargetPosition'],_0x5bf3d5=_0x5c0fcf['model']['createRange'](_0x5b05ae,_0x5167dc),_0x2f87dc='suggestion:insertion:'+at()+':$aiSuggestion';_0x5a95bc['markers']['set'](_0x2f87dc,_0x5bf3d5);break;}case'move':{_0x1710dc['batch']['addOperation'](_0x5aeede),_0x5c0fcf['model']['applyOperation'](_0x5aeede),_0x3ca6ec[_0x1159ab-0x1]&&'insert'==_0x3ca6ec[_0x1159ab-0x1]['type']&&bs(_0x5a95bc,_0x5aeede);const _0x20bbe1=_0x5aeede['getMovedRangeStart'](),_0x346290=_0x5aeede['howMany'];for(let _0x20ac1c=0x0;_0x20ac1c<_0x346290;_0x20ac1c++){const _0x1237cf=_0x20bbe1['getShiftedBy'](_0x20ac1c)['nodeAfter'];_0x14f923['add'](_0x1237cf);}break;}case'remove':{const _0x49f852=_0x5aeede['sourcePosition'],_0x1952da=_0x5aeede['howMany'],_0x29dda6=new _0x15c955(_0x49f852,_0x1952da);_0x1710dc['batch']['addOperation'](_0x29dda6),_0x5c0fcf['model']['applyOperation'](_0x29dda6);break;}}}for(const _0x2abf2a of _0x14f923){const _0x311274=_0x5c0fcf['model']['createRangeOn'](_0x2abf2a),_0x1a2838='suggestion:formatBlock:$fakeWrap:'+at()+':$aiSuggestion';_0x5a95bc['markers']['set'](_0x1a2838,_0x2609d6(_0x311274,_0x5c0fcf['model']));}});}(_0x212ba4,_0x329353,_0x243a07):_0x243a07['model']['change'](_0xe40466=>{for(const _0x94b15e of _0x212ba4)if('remove'==_0x94b15e['type']){const _0x1ca7e8=_0x94b15e['sourcePosition'],_0x391d1c=_0x94b15e['howMany'],_0x5ecb32=new _0x15c955(_0x1ca7e8,_0x391d1c);_0xe40466['batch']['addOperation'](_0x5ecb32),_0x243a07['model']['applyOperation'](_0x5ecb32);}else{if('marker'==_0x94b15e['type']){const _0x4b7755=_0x94b15e['name'],_0x39eeb4=_0x94b15e['newRange'];null!==_0x39eeb4?_0x329353['markers']['set'](_0x4b7755,_0x39eeb4):_0x329353['markers']['delete'](_0x4b7755);}else _0x94b15e['baseVersion']=null,_0x94b15e['isDocumentOperation']=!0x1,_0xe40466['batch']['addOperation'](_0x94b15e),_0x243a07['model']['applyOperation'](_0x94b15e);}});if(_0x2b812a){const _0x29df0e=Rs(_0x243a07,_0x212ba4,_0x329353);Os(_0x243a07['model'],_0x29df0e),function(_0x1a5b40,_0x512633){const _0x2e5e1a=_0x512633['getFirstRange']()['start'];let _0x274cb1=_0x512633['getFirstRange']()['end'];const _0x16326b=_0x2e5e1a['root'];(_0x274cb1['textNode']||_0x274cb1['nodeAfter']&&_0x274cb1['nodeAfter']['is']('$text'))&&(_0xb3c696(_0x274cb1,'...'),_0x274cb1=_0x274cb1['getShiftedBy'](0x3)),(_0x2e5e1a['textNode']||_0x2e5e1a['nodeBefore']&&_0x2e5e1a['nodeBefore']['is']('$text'))&&(_0xb3c696(_0x2e5e1a,'...'),function(_0x369eed,_0x2dc824,_0x53d9ed){for(let [_0x21feaf,_0x1d9e57]of _0x369eed['markers']){const _0x5c2b6b=_0x1d9e57['_getTransformedByInsertion'](_0x2dc824,_0x53d9ed,!0x1);_0x1d9e57=_0x5c2b6b[0x0],_0x369eed['markers']['set'](_0x21feaf,_0x1d9e57);}}(_0x16326b,_0x2e5e1a,0x3),_0x2e5e1a['parent']==_0x274cb1['parent']&&(_0x274cb1=_0x274cb1['getShiftedBy'](0x3)));const _0x152fb3=_0x1a5b40['createRange'](_0x1a5b40['createPositionAt'](_0x16326b,0x0),_0x2e5e1a),_0x5df304=_0x1a5b40['createRange'](_0x274cb1,_0x1a5b40['createPositionAt'](_0x16326b,'end')),_0x188e26=[..._0x152fb3['getMinimalFlatRanges'](),..._0x5df304['getMinimalFlatRanges']()];_0x188e26['reverse']();for(const _0x270a5d of _0x188e26)_0x19cc5a(_0x270a5d),Ns(_0x16326b,_0x270a5d);}(_0x243a07['model'],_0x29df0e);}const _0x3dbe52=_0x243a07['data']['stringify'](_0x329353,{'showSuggestionHighlights':!0x0});return{'content':us(_0x3dbe52),'hasChanges':!0x0};}(_0x47428c,_0x4bd7c8,_0x27140b,_0x40298b,_0x2eab39);return{'type':_0x253a11['changes'][0x0]['type'],'index':_0x253a11['index'],'content':_0x14f9d3,'hasChanges':_0x326646};});}function bs(_0x438ce4,_0x4837a7){for(const [_0x231a21,_0x52dfeb]of _0x438ce4['markers']){const _0x71605d=_0x2861aa['_createFromRanges'](_0x52dfeb['getTransformedByOperation'](_0x4837a7));_0x438ce4['markers']['set'](_0x231a21,_0x71605d);}}function Rs(_0x5e20e1,_0x38b91f,_0x75773f){const _0x51703d=_0x5e20e1['plugins']['get']('DocumentCompare');let _0x239067=_0x5e20e1['model']['createPositionAt'](_0x75773f,Number['POSITIVE_INFINITY']),_0x1cff6d=_0x5e20e1['model']['createPositionAt'](_0x75773f,0x0);for(const _0x55b3aa of _0x38b91f){let _0x3e8197,_0x32019c;if(_0x51703d['isMarkedRemoveOperation'](_0x55b3aa))_0x3e8197=_0x55b3aa['newRange']['start'],_0x32019c=_0x55b3aa['newRange']['end'];else switch(_0x239067=_0x239067['getTransformedByOperation'](_0x55b3aa),_0x1cff6d=_0x1cff6d['getTransformedByOperation'](_0x55b3aa),_0x55b3aa['type']){case'rename':_0x3e8197=_0x55b3aa['position'],_0x32019c=_0x3e8197['getShiftedBy'](0x1);break;case'addAttribute':case'removeAttribute':case'changeAttribute':_0x3e8197=_0x55b3aa['range']['start'],_0x32019c=_0x55b3aa['range']['end'];break;case'insert':_0x3e8197=_0x55b3aa['position'],_0x32019c=_0x3e8197['getShiftedBy'](_0x55b3aa['howMany']);break;case'split':_0x3e8197=_0x55b3aa['splitPosition'],_0x32019c=_0x55b3aa['moveTargetPosition'];break;case'merge':{const _0x773c3=_0x55b3aa['targetPosition']['path']['slice'](0x0,-0x1);_0x3e8197=_0x5e20e1['model']['createPositionFromPath'](_0x75773f,_0x773c3),_0x32019c=_0x3e8197['getShiftedBy'](0x1);break;}case'remove':{const _0x4cc478=_0x55b3aa['howMany'],_0x4a2a1c=_0x55b3aa['sourcePosition']['_getTransformedByInsertion'](_0x55b3aa['targetPosition'],_0x4cc478),_0x216d43=_0x55b3aa['getMovedRangeStart']();'remove'==_0x55b3aa['type']?(_0x3e8197=_0x4a2a1c,_0x32019c=_0x4a2a1c):(_0x3e8197=_0x216d43,_0x32019c=_0x216d43['getShiftedBy'](_0x4cc478));break;}}_0x3e8197&&_0x3e8197['isBefore'](_0x239067)&&(_0x239067=_0x3e8197['clone'](),_0x239067['stickiness']='toNone'),_0x32019c&&_0x32019c['isAfter'](_0x1cff6d)&&(_0x1cff6d=_0x32019c['clone'](),_0x1cff6d['stickiness']='toNone');}return _0x5e20e1['model']['createSelection'](_0x5e20e1['model']['createRange'](_0x239067,_0x1cff6d));}function Os(_0x66a3c3,_0x1a1a8b){ks(_0x66a3c3,_0x1a1a8b,'forward');const _0x586424=_0x1a1a8b['getFirstRange']();_0x1a1a8b['setTo']([]),_0x1a1a8b['setTo'](_0x586424,{'backward':!0x0}),ks(_0x66a3c3,_0x1a1a8b,'backward');}function ks(_0x21c016,_0x417eb6,_0x293f0d){let _0x2714e5=0x14;for(;_0x2714e5;){_0x21c016['modifySelection'](_0x417eb6,{'unit':'word','direction':_0x293f0d}),_0x2714e5--;const _0x3a1511=_0x417eb6['focus']['forward'==_0x293f0d?'nodeBefore':'nodeAfter'];if(_0x3a1511&&_0x3a1511['is']('element')&&_0x21c016['schema']['isBlock'](_0x3a1511)&&_0x21c016['schema']['isObject'](_0x3a1511))break;}}function Ns(_0x591b47,_0x2a3e23){for(const [_0x198892,_0x249a1c]of _0x591b47['markers']){const _0x2bf08c=_0x249a1c['_getTransformedByDeletion'](_0x2a3e23['start'],_0x2a3e23['end']['offset']-_0x2a3e23['start']['offset']);null!=_0x2bf08c?_0x591b47['markers']['set'](_0x198892,_0x2bf08c):_0x591b47['markers']['delete'](_0x198892);}}class vs extends ht(){['id'];['interactionId'];['type'];['sources']=[];['parsedContent']=new _0xb96947([]);['parsedMergedContent']=new _0xb96947([]);['changeGroups']=[];['areActionsDisabled']=!0x1;['documentContextContent'];['aiResponseParser'];['aiResponseApplier'];['editor'];['cachedSuggestionContentParts']={'withDiff':[],'withoutDiff':[]};constructor({type:_0x352965,content:_0x158d84='',isDone:_0x14a7b4=!0x1,interactionId:_0x8aba75,areActionsDisabled:_0x43e1df,documentContextContent:_0x4663cd,editor:_0x23ee60,id:_0x2f1c46}){super(),this['id']=_0x2f1c46||at(),this['interactionId']=_0x8aba75,this['type']=_0x352965,this['areActionsDisabled']=!!_0x43e1df,this['editor']=_0x23ee60,this['aiResponseParser']=new ws(),this['aiResponseApplier']=new fs(),this['documentContextContent']=us(_0x4663cd||''),this['set']('isDone',_0x14a7b4),this['on']('change:content',()=>{this['onContentChange']();}),this['set']('content',_0x158d84);}['appendContent'](_0x4a3b39){this['set']('content',this['content']+_0x4a3b39);}['done'](){this['isDone']||(this['set']('isDone',!0x0),this['onContentChange']());}['destroy'](){this['stopListening']();}['setChangeGroupState'](_0x7d1991,_0x2e4924){this['changeGroups'][_0x7d1991]['state']=_0x2e4924,this['fire']('replyChangeGroupStateUpdated',{'reply':this,'index':_0x7d1991,'state':_0x2e4924});}['getContentParts']({showDiff:_0x545851,groupIndex:_0x5d3ef7}){if(!this['editor'])throw new ot('ai-get-editor-from-context-no-editor',null,{'aiReply':this});const _0x34b6e4=this['_getCachedContentParts'](_0x545851,_0x5d3ef7);if(_0x34b6e4)return _0x34b6e4;let _0x36f9d9=[];if(void 0x0===_0x5d3ef7)_0x36f9d9=this['changeGroups'];else{const _0x188cad=this['changeGroups']['find'](({index:_0x18db1b})=>_0x18db1b===_0x5d3ef7);if(!_0x188cad)throw new ot('ai-reply-get-content-parts-group-not-found',null,{'aiReply':this,'groupIndex':_0x5d3ef7});_0x36f9d9=[_0x188cad];}const _0x417b71=Ss({'editor':this['editor'],'showDiff':_0x545851,'changeGroups':_0x36f9d9,'documentContextContent':this['documentContextContent']});return this['_setCachedContentParts'](_0x545851,_0x417b71),_0x417b71;}['_getCachedContentParts'](_0x5337ec,_0x187b5f){const _0x265221=_0x5337ec?'withDiff':'withoutDiff';if(!this['cachedSuggestionContentParts'][_0x265221]['length'])return null;const _0x2212e4=this['cachedSuggestionContentParts'][_0x265221];if(void 0x0===_0x187b5f)return _0x2212e4['length']>0x0&&_0x2212e4['length']!==this['changeGroups']['length']?(this['_setCachedContentParts'](_0x5337ec,null),null):_0x20cfd4(_0x2212e4);{const _0x3d17ef=_0x2212e4['find'](({index:_0x5b773b})=>_0x5b773b===_0x187b5f);if(_0x3d17ef)return[_0x20cfd4(_0x3d17ef)];}return null;}['_setCachedContentParts'](_0x1347f3,_0x48290d){const _0x15c3d3=_0x1347f3?'withDiff':'withoutDiff';_0x48290d?_0x48290d['forEach'](_0x24fea3=>{const _0x4f5b6d=this['cachedSuggestionContentParts'][_0x15c3d3],_0x3112d5=_0x4f5b6d['find'](({index:_0x195527})=>_0x195527===_0x24fea3['index']);if(_0x3112d5){const _0x4433f8=_0x4f5b6d['indexOf'](_0x3112d5);_0x4f5b6d['splice'](_0x4433f8,0x1,_0x24fea3);}else _0x4f5b6d['push'](_0x24fea3);}):this['cachedSuggestionContentParts'][_0x15c3d3]['length']=0x0;}['onContentChange'](){if('modification'===this['type']){this['parsedContent']=this['aiResponseParser']['parseAndNormalizeHTML'](this['content']);const _0x289ab1=this['changeGroups'];this['updateChangeGroups']();const _0x420ffb=this['_getDifferentChangeGroups'](_0x289ab1,this['changeGroups']);(_0x420ffb['length']||this['isDone'])&&(this['fire']('replyContentUpdated',this,_0x420ffb),this['cachedSuggestionContentParts']['withDiff']['length']=this['cachedSuggestionContentParts']['withoutDiff']['length']=0x0);}else this['parsedContent']=this['aiResponseParser']['convertMarkdownToHTML'](this['content']),this['fire']('replyContentUpdated',this);}['_getDifferentChangeGroups'](_0x46fcb9,_0x444753){const _0x2aa936=[];for(const _0x48bde3 of _0x444753){const _0x162dbc=_0x46fcb9[_0x48bde3['index']];_0x162dbc?_0x162dbc['changes']['length']!==_0x48bde3['changes']['length']?_0x2aa936['push'](_0x48bde3):_0x162dbc['changes']['forEach']((_0x20f4a7,_0x385a17)=>{const _0x5f0861=_0x48bde3['changes'][_0x385a17];_0x20f4a7['id']!==_0x5f0861['id']&&_0x2aa936['push'](_0x48bde3);}):_0x2aa936['push'](_0x48bde3);}return _0x2aa936;}['updateChangeGroups'](){const _0x631998=new ti('p',{},[new ti('span',{'style':'color:\x20#808080;\x20font-style:\x20italic'},[new _0x1c3f7c(as(this['editor']['locale'],'AI_SUGGESTION_CONTENT_PART_REMOVED'))])]),_0x1e1d79=this['aiResponseApplier']['merge'](this['parsedContent'],this['documentContextContent']['cloneNode'](!0x0),{'markUnstableElements':!this['isDone'],'replaceRemovedWith':_0x631998,'cutAfterLastChange':!this['isDone']});if(!_0x1e1d79['modifiedNodeIds']['length']&&!this['isDone'])return;this['parsedMergedContent']=_0x1e1d79['parsedContent'];let _0xd28120=[];if(_0x1d864b(_0x1d88da=>{const _0x17f544=gs(_0x1d88da,'data-id');if(!_0x17f544||!_0x14c595(_0x17f544))return!0x1;const _0x553b00=[_0x1d88da,...Ts(_0x1d88da)]['at'](-0x2);if(_0x1d88da!=_0x553b00){const _0x21dcd4=gs(_0x553b00,'data-id');_0x14c595(_0x21dcd4)||(_0xd28120['push']({'node':_0x553b00,'id':_0x21dcd4,'type':'modified'}),_0x1e1d79['modifiedNodeIds']['push'](_0x21dcd4));}else _0x1e1d79['modifiedNodeIds']['includes'](_0x17f544)?_0xd28120['push']({'node':_0x1d88da,'type':'modified','id':_0x17f544}):_0x1e1d79['newNodeIds']['includes'](_0x17f544)?_0xd28120['push']({'node':_0x1d88da,'type':'new','id':_0x17f544,'anchorId':gs(_0x1d88da['previousSibling'],'data-id')}):_0xd28120['push']({'node':_0x1d88da,'type':'removed','id':_0x17f544});return!0x0;},this['parsedMergedContent']),_0xd28120=_0xd28120['filter'](({node:_0x26c46d})=>[...Ts(_0x26c46d),_0x26c46d]['every'](_0x280d98=>!gs(_0x280d98,'data-unstable'))),0x0==_0xd28120['length'])return;const _0x5d0f90=[[_0xd28120[0x0]]];for(let _0x263495=0x1;_0x263495<_0xd28120['length'];_0x263495++){const _0x22008b=_0x5d0f90[_0x5d0f90['length']-0x1],_0x1622f4=_0x22008b[_0x22008b['length']-0x1];_0xd28120[_0x263495]['node']['previousSibling']==_0x1622f4['node']&&'modified'!=_0xd28120[_0x263495]['type']&&'modified'!=_0x1622f4['type']?_0x22008b['push'](_0xd28120[_0x263495]):_0x5d0f90['push']([_0xd28120[_0x263495]]);}for(const _0x1dc15f of _0x5d0f90){const _0x3bc17e=_0x1dc15f[0x0],_0x333ad1=_0x1dc15f[_0x1dc15f['length']-0x1],_0x25a069=_0x208727(_0x3bc17e['node']['previousSibling']);_0x25a069&&_0x1dc15f['unshift'](_0x25a069);const _0x452cba=_0x208727(_0x333ad1['node']['nextSibling']);_0x452cba&&_0x1dc15f['push'](_0x452cba);}function _0x14c595(_0x36c926){return _0x1e1d79['modifiedNodeIds']['includes'](_0x36c926)||_0x1e1d79['newNodeIds']['includes'](_0x36c926)||_0x1e1d79['removedNodeIds']['includes'](_0x36c926);}function _0x208727(_0x200d61){if(_0x200d61&&gs(_0x200d61,'data-id')&&!gs(_0x200d61,'data-unstable')){const _0x32d8a8=gs(_0x200d61,'data-id');if(!_0x14c595(_0x32d8a8))return{'node':_0x200d61,'type':'context','id':_0x32d8a8};}return null;}this['changeGroups']=_0x5d0f90['map']((_0x2fb871,_0x226cd8)=>({'changes':_0x2fb871,'state':'pending','index':_0x226cd8}));}}const ys=['interactionCreated','interactionStarted','interactionStopped','interactionFinished','interactionDestroyed','replyCreated','replyContentUpdated','replyChangeGroupStateUpdated','setConversationTitle','webSearchStarted','webSearchFinished','reasoningStarted','reasoningFinished','toolDataReceived','error'];class xs extends pt(){['id'];['replies']=[];['currentReply'];['messageId'];['actionCallId'];['currentRequest'];['connector'];['isStopped']=!0x1;['isDestroyed']=!0x1;['editor'];['_isReasoning']=!0x1;['_isWebSearching']=!0x1;constructor({connector:_0x143ad9,editor:_0xed5ef6}){super(),this['id']=at(),this['connector']=_0x143ad9,this['isStopped']=!0x0,this['editor']=_0xed5ef6;}async['start'](){const _0x2aeb54=[];let _0x45c975,_0x4bdb7b,_0x232375;this['isStopped']=!0x1;try{this['currentRequest']=await this['sendRequest'](),this['fire']('interactionStarted',this);const _0x2e65f6=await this['currentRequest']['getStream']();for await(const _0x3b068c of _0x2e65f6){if(this['isStopped'])return;if('error'==_0x3b068c['event'])return void this['fire']('error',{'error':new ot('ai-chat-interaction-error',this)});switch(_0x3b068c['event']){case'message-metadata':this['messageId']=_0x3b068c['data']['messageId'];break;case'action-metadata':this['actionCallId']=_0x3b068c['data']['callId'];break;case'conversation-title':this['setConversationTitle'](_0x3b068c['data']['conversationTitle'],!0x0);break;case'source':_0x2aeb54['push'](_0x3b068c['data']['source']);break;case'web-search':this['_isWebSearching']||(this['_isWebSearching']=!0x0,this['fire']('webSearchStarted',this));break;case'reasoning':this['_isReasoning']||(this['_isReasoning']=!0x0,this['fire']('reasoningStarted',this));break;case'modification-delta':case'text-delta':this['resetReasoningState'](),this['resetWebSearchState'](),_0x45c975='modification-delta'==_0x3b068c['event']?'modification':'text',_0x4bdb7b='modification-delta'==_0x3b068c['event']?_0x3b068c['data']['id']:void 0x0,this['currentReply']&&this['currentReply']['type']!=_0x45c975&&(this['currentReply']['done'](),this['currentReply']=void 0x0),this['currentReply']||(this['currentReply']=this['createReply']({'type':_0x45c975,'interactionId':this['id'],'id':_0x4bdb7b}),'modification'==_0x45c975&&(this['currentReply']['sources']=_0x2aeb54['splice'](0x0))),this['currentReply']['appendContent'](_0x3b068c['data']['textDelta']);break;case'mcp-tool-result':_0x232375=JSON['parse'](_0x3b068c['data']['result']),this['_handleToolResultData']({'toolName':_0x3b068c['data']['toolName'],'data':_0x232375['data'],'attributes':_0x232375['attributes']});break;case'mcp-tool-notification':this['_handleToolNotificationData']({'toolName':_0x3b068c['data']['toolName'],'data':_0x3b068c['data']['data']});}}}finally{this['isStopped']||(this['currentReply']&&_0x2aeb54['length']>0x0&&(this['currentReply']['sources']=_0x2aeb54['splice'](0x0)),this['_finalizeInteraction'](),this['fire']('interactionFinished',this));}}['stop'](){this['isStopped']||(this['_finalizeInteraction'](),this['fire']('interactionStopped',this));}['getReply'](_0x8bf7c7){return this['replies']['find'](_0x4d8631=>_0x4d8631['id']===_0x8bf7c7);}['destroy'](){this['isDestroyed']||(this['stop'](),this['replies']['forEach'](_0x1c2b98=>_0x1c2b98['destroy']()),this['replies']=[],this['isDestroyed']=!0x0,this['fire']('interactionDestroyed',this),this['stopListening']());}['createReply'](_0x444431){const _0x2bfc5c=new vs({'editor':this['editor'],'documentContextContent':this['getDocumentContext']()?.['content'],..._0x444431});return this['replies']['push'](_0x2bfc5c),_0x2bfc5c['delegate'](...ys)['to'](this),this['fire']('replyCreated',_0x2bfc5c),_0x2bfc5c;}['setConversationTitle'](_0x92ce8b,_0x1d679e=!0x1){this['fire']('setConversationTitle',_0x92ce8b,_0x1d679e);}['resetWebSearchState'](){this['_isWebSearching']&&(this['_isWebSearching']=!0x1,this['fire']('webSearchFinished',this));}['resetReasoningState'](){this['_isReasoning']&&(this['_isReasoning']=!0x1,this['fire']('reasoningFinished',this));}['_handleToolResultData'](_0x365eba){this['fire']('toolDataReceived',{'type':'result','toolName':_0x365eba['toolName'],'data':structuredClone(_0x365eba['data']||{}),'attributes':structuredClone(_0x365eba['attributes']||{})},this);}['_handleToolNotificationData'](_0xf0858b){this['fire']('toolDataReceived',{'type':'notification','toolName':_0xf0858b['toolName'],'data':structuredClone(_0xf0858b['data'])},this);}['_finalizeInteraction'](){this['isStopped']=!0x0,this['currentRequest']&&this['currentRequest']['abortController']['abort'](),this['currentReply']&&this['currentReply']['done'](),this['currentRequest']=this['currentReply']=void 0x0;}}const Ls=new Map([['usage-limits-exceeded','ai-usage-limits-exceeded'],['rate-limits-exceeded','ai-rate-limits-exceeded'],['invalid-content-type','ai-invalid-content-type'],['invalid-request-data','ai-chat-invalid-request'],['model-already-set','ai-chat-model-already-set'],['model-not-found','ai-chat-model-not-found'],['unsafe-content-detected','ai-chat-unsafe-content-detected'],['unsupported-content-type','ai-chat-unsupported-content-type'],['content-too-large','ai-chat-content-too-large'],['unsupported-file-type','ai-chat-context-unsupported-file-type'],['file-too-large','ai-chat-context-file-too-large'],['file-too-many-pages','ai-chat-context-file-too-many-pages'],['form-data-size-limits-exceeded','ai-chat-context-form-data-size-limits-exceeded']]),Ds=['contextItemAdded','contextItemRemoved','contextItemLoadingEnded','contextSent','error','addContextOptionsChanged','sourceResourcesLoaded','resourceStateChanged','uploadProgressChanged'];class Ps extends ht(){['_connector'];['_config'];['_ownerId'];constructor({connector:_0x50059e,config:_0x1643ec,ownerId:_0x3872e3}){super(),this['_connector']=_0x50059e,this['_config']=_0x1643ec,this['_ownerId']=_0x3872e3;}['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'](_0x384d92){const _0x1cc31d=await this['_createContextItemFromContent'](_0x384d92);return this['_addToConversationContextItem'](_0x1cc31d),'current-document'===_0x1cc31d['uiId']&&this['_toggleAddCurrentDocumentOptionVisibility'](),_0x1cc31d;}async['_createContextItemFromContent'](_0x47fa60){if('document'===_0x47fa60['type']){const _0x436930=await this['_connector']['fetchDocument'](this['_ownerId'],_0x47fa60['id'])['getDocument']();return{'id':'current-document','uiId':'current-document','label':'Current\x20document','type':_0x47fa60['type'],'content':_0x436930['content'],'hidden':this['_conversationContextItems']['has']('current-document'),'version':_0x436930['attributes']?.['version'],'sessionId':_0x436930['attributes']?.['sessionId']};}if('mcp-tool-context'===_0x47fa60['type'])return{'id':_0x47fa60['id'],'uiId':_0x47fa60['id'],'label':_0x47fa60['data']?.['label']||_0x47fa60['id'],'type':'mcp-tool-context','mcpServerName':_0x47fa60['mcpServerName'],'toolName':_0x47fa60['toolName'],'data':_0x47fa60['data']||{}};return{'id':_0x47fa60['id'],'uiId':_0x47fa60['id'],'label':_0x47fa60['attributes']?.['label']||_0x47fa60['name']||_0x47fa60['url']||_0x47fa60['id'],'type':_0x47fa60['type'],..._0x47fa60?.['attributes']?.['resourceId']?{'resourceId':_0x47fa60['attributes']?.['resourceId']}:{}};}['getSentContextItems'](){return new Map(this['_conversationContextItems']);}['removeFromContext'](_0x4e3729){const _0xc4211=this['_pendingContextItems']['get'](_0x4e3729);_0xc4211?.['isReadOnly']||this['_removeContextItem'](_0x4e3729);}['clearPendingContextItems'](){if(0x0===this['_pendingContextItems']['size'])return;for(const _0x293a2a of this['_pendingContextItems']['values']())this['_removeContextItem'](_0x293a2a['uiId']);const _0x390d9f=this['_conversationContextItems']['get']('current-document')||this['_pendingContextItems']['get']('current-document');_0x390d9f&&this['_addContextItem']({..._0x390d9f,'isReadOnly':!0x0,'hidden':!0x0});}['addToConversationContext'](_0x51f28f){for(const _0x173a05 of _0x51f28f['values']())this['_addToConversationContextItem'](_0x173a05);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'](_0x2eb098){return Array['from'](_0x2eb098['values']())['map'](_0xd559b5=>this['_mapContextItemToRequestData'](_0xd559b5))['filter'](_0x2a545b=>null!==_0x2a545b);}async['addFilesToContext'](_0x2ea95a,_0x5d64c3,_0x2e7dc8='file'){const _0x3f5138='files-'+at();this['_startUploadOperation'](_0x3f5138);try{await Promise['all'](_0x2ea95a['map'](async _0x22b18b=>{const _0x226f8e='file-'+at(),_0x3bd6b3=_0x3e5077(_0x22b18b['name']);try{this['_addContextItem']({'type':_0x2e7dc8,'label':_0x5d64c3?.['label']||_0x3bd6b3,'uiId':_0x226f8e,'resourceId':_0x5d64c3?.['resourceId']},!0x0);const _0x2f10b7=this['_connector']['uploadFile'](this['_ownerId'],_0x22b18b,_0x5d64c3);this['_ongoingUploads']['set'](_0x226f8e,_0x2f10b7['abortController']);const {id:_0x21a180}=await _0x2f10b7['getId']();this['_ongoingUploads']['delete'](_0x226f8e),this['_finishContextItemLoading']({'type':_0x2e7dc8,'id':_0x21a180,'label':_0x5d64c3?.['label']||_0x3bd6b3,'uiId':_0x226f8e,'resourceId':_0x5d64c3?.['resourceId']},!0x1);}catch(_0xd2dd89){this['_ongoingUploads']['delete'](_0x226f8e);if(!(_0xd2dd89 instanceof ot&&_0xd2dd89['message']['startsWith']('ai-request-aborted'))){const _0x3f0c46=Ls['get'](_0xd2dd89['code'])||'ai-chat-file-upload-failed',_0x32fc9c=new ot(_0x3f0c46,null,{'fileName':_0x3bd6b3,..._0xd2dd89});_0x32fc9c['stack']=_0xd2dd89['stack'],this['fire']('error',{'error':_0x32fc9c});}this['_removeContextItem'](_0x226f8e);}}));}finally{this['_finishUploadOperation'](_0x3f5138);}}['addCurrentDocumentToContext'](_0x4c75e4){if(this['isCurrentDocumentInContext']()||!this['_addContextOptionsState']['document']['enabled'])return;const _0x1271ac={'type':'document','uiId':'current-document','label':_0x4c75e4,'isReadOnly':this['_conversationContextItems']['has']('current-document'),'hidden':this['_conversationContextItems']['has']('current-document')};this['_addContextItem'](_0x1271ac);}async['updateCurrentDocument'](_0x174ac1,_0x170489,_0x416129,_0x5ac57c){const _0x24a6ea=this['_pendingContextItems']['get']('current-document');if(_0x24a6ea&&_0x174ac1){_0x24a6ea['selection']=_0x5ac57c?_0x5ac57c['map'](_0x4fe300=>({'start':_0x4fe300['start'],'end':_0x4fe300['end']})):[];try{if(_0x24a6ea['version']===_0x170489)return;const {id:_0x345617}=await this['_connector']['uploadDocument'](this['_ownerId'],_0x174ac1,{'version':_0x170489,'sessionId':_0x416129})['getId']();_0x24a6ea['id']=_0x345617,_0x24a6ea['content']=_0x174ac1,_0x24a6ea['version']=_0x170489,_0x24a6ea['sessionId']=_0x416129;}catch(_0x1a329c){const _0x375e01=new ot('ai-chat-document-upload-failed',null);_0x375e01['stack']=_0x1a329c['stack'],this['fire']('error',{'error':_0x375e01});}}}['addSelectionToContext'](_0x3e45c5){this['_addContextItem']({'type':'selection','label':_0x3e45c5,'uiId':'selection','content':_0x3e45c5});}['removeSelectionFromContext'](){this['_removeContextItem']('selection');}async['addUrlToContext'](_0xdd53d1,_0x40e57d){const _0x5aa265='url-'+at();this['_startUploadOperation'](_0x5aa265);const _0x51b9f4='url-'+at();try{this['_addContextItem']({'type':'web-resource','label':_0x40e57d?.['label']||_0xdd53d1,'uiId':_0x51b9f4,'resourceId':_0x40e57d?.['resourceId']},!0x0);const _0x2ae612=this['_connector']['uploadUrl'](this['_ownerId'],_0xdd53d1,_0x40e57d);this['_ongoingUploads']['set'](_0x51b9f4,_0x2ae612['abortController']);const {id:_0x3603a5}=await _0x2ae612['getId']();this['_ongoingUploads']['delete'](_0x51b9f4),this['_finishContextItemLoading']({'type':'web-resource','id':_0x3603a5,'label':_0x40e57d?.['label']||_0xdd53d1,'uiId':_0x51b9f4,'resourceId':_0x40e57d?.['resourceId']},!0x1);}catch(_0x4df72a){this['_ongoingUploads']['delete'](_0x51b9f4),(_0x4df72a['message']['startsWith']('ai-request-aborted')||this['fire']('error',{'error':new ot('ai-chat-url-upload-failed',this,{'url':_0xdd53d1,'originalError':_0x4df72a}),'url':_0xdd53d1}),this['_removeContextItem'](_0x51b9f4));}finally{this['_finishUploadOperation'](_0x5aa265);}}['addToolItemToContext'](_0x16ce80){_0x16ce80['id']=_0x16ce80['id']??at()['substring'](0x0,0x15),this['_pendingContextItems']['set'](_0x16ce80['uiId'],_0x16ce80),this['fire']('contextItemAdded',{'contextItem':_0x16ce80,'isLoading':!0x1});}async['loadSourceResources'](_0x52616f,_0x2c0d0f,_0x5de930){const _0x43ce49=this['_addContextOptionsState']['sources']['find'](_0x590a48=>_0x590a48['id']===_0x52616f);if(!_0x43ce49)return this['fire']('error',{'error':new ot('ai-chat-source-not-found',this,{'sourceId':_0x52616f}),'sourceId':_0x52616f}),[];try{const _0x223b60=(await _0x43ce49['getResources'](_0x2c0d0f))['map'](_0xc91bca=>{const _0x2c9d90=this['_isResourceInContext'](_0xc91bca['id']);return{..._0xc91bca,'isInContext':_0x2c9d90};});return _0x43ce49['resources']=_0x223b60,this['fire']('sourceResourcesLoaded',{'sourceId':_0x52616f,'source':_0x43ce49,'resources':_0x223b60,'uid':_0x5de930}),_0x223b60;}catch(_0x5817b7){return this['fire']('error',{'error':new ot('ai-chat-source-resources-load-failed',this,{'sourceId':_0x52616f,'originalError':_0x5817b7}),'sourceId':_0x52616f,'sourceLabel':_0x43ce49['label']}),[];}}async['addResourceToContext'](_0x419ed0,_0x28b323){if(this['_isResourceInContext'](_0x28b323['id']))return;let _0x427722=_0x28b323['data'];if(!_0x427722&&_0x419ed0['getData'])try{_0x427722=await _0x419ed0['getData'](_0x28b323['id']);}catch(_0x547ee2){return void this['fire']('error',{'error':new ot('ai-chat-resource-load-failed',this,{'resourceId':_0x28b323['id'],'sourceId':_0x419ed0['id'],'originalError':_0x547ee2}),'resourceId':_0x28b323['id'],'sourceId':_0x419ed0['id']});}if(_0x427722)switch(_0x28b323['type']){case'web-resource':if('string'!=typeof _0x427722)return void this['fire']('error',{'error':new ot('ai-chat-context-invalid-data',this,{'resourceId':_0x28b323['id'],'sourceId':_0x419ed0['id'],'expectedType':'string','actualType':typeof _0x427722}),'resourceId':_0x28b323['id'],'sourceId':_0x419ed0['id']});await this['addUrlToContext'](_0x427722,{'label':_0x28b323['label'],'resourceId':_0x28b323['id']});break;case'file':if(!(_0x427722 instanceof File))return void this['fire']('error',{'error':new ot('ai-chat-context-invalid-data',this,{'resourceId':_0x28b323['id'],'sourceId':_0x419ed0['id'],'expectedType':'File','actualType':typeof _0x427722}),'resourceId':_0x28b323['id'],'sourceId':_0x419ed0['id']});await this['addFilesToContext']([_0x427722],{'label':_0x28b323['label'],'resourceId':_0x28b323['id']});break;case'text':if('object'!=typeof _0x427722||!('content'in _0x427722)||!('type'in _0x427722))return void this['fire']('error',{'error':new ot('ai-chat-context-invalid-data',this,{'resourceId':_0x28b323['id'],'sourceId':_0x419ed0['id'],'expectedType':'object\x20with\x20content\x20and\x20type\x20properties','actualType':typeof _0x427722}),'resourceId':_0x28b323['id'],'sourceId':_0x419ed0['id']});_0x427722=Ps['_convertTextResourceToFile'](_0x427722,_0x28b323['label']),await this['addFilesToContext']([_0x427722],{'label':_0x28b323['label'],'resourceId':_0x28b323['id']},'text');break;case'mcp-tool-context':break;default:this['fire']('error',{'error':new ot('ai-chat-context-unsupported-type',this,{'resourceId':_0x28b323['id'],'sourceId':_0x419ed0['id'],'resourceType':_0x28b323['type']}),'resourceId':_0x28b323['id'],'sourceId':_0x419ed0['id']});}else this['fire']('error',{'error':new ot('ai-chat-resource-no-data',this,{'resourceId':_0x28b323['id'],'sourceId':_0x419ed0['id']}),'resourceId':_0x28b323['id'],'sourceId':_0x419ed0['id']});}static['_convertTextResourceToFile'](_0x5eda3b,_0x5091d4){switch(_0x5eda3b['type']){case'markdown':return new File([_0x5eda3b['content']],_0x5091d4,{'type':'text/markdown'});case'html':return new File([_0x5eda3b['content']],_0x5091d4,{'type':'text/html'});default:return new File([_0x5eda3b['content']],_0x5091d4,{'type':'text/plain'});}}static['_mapContextItemToRequestData'](_0x45fdce){switch(_0x45fdce['type']){case'file':case'text':return{'type':'file','id':_0x45fdce['id']};case'web-resource':return{'type':'web-resource','id':_0x45fdce['id']};case'document':return{'type':'document','id':_0x45fdce['id'],..._0x45fdce['selection']?.['length']&&{'selection':_0x45fdce['selection']}};case'mcp-tool-context':{const _0x438019=_0x45fdce;return{'type':'mcp-tool-context','mcpServerName':_0x438019['mcpServerName'],'toolName':_0x438019['toolName'],'data':_0x438019['data'],'id':_0x438019['id']};}default:return null;}}['_addContextItem'](_0x304f6e,_0x179c7f=!0x1){if(this['_pendingContextItems']['set'](_0x304f6e['uiId'],_0x304f6e),_0x304f6e['hidden']||this['fire']('contextItemAdded',{'contextItem':_0x304f6e,'isLoading':_0x179c7f}),'current-document'===_0x304f6e['uiId']&&this['_toggleAddCurrentDocumentOptionVisibility'](),_0x304f6e['resourceId']){const _0x36caaa=this['_findSourceIdsByResourceId'](_0x304f6e['resourceId']);_0x36caaa&&_0x36caaa['forEach'](_0x37c52c=>{this['_updateResourceInContextState'](_0x37c52c,_0x304f6e['resourceId'],!0x0);});}}['_removeContextItem'](_0x4783db){const _0x41d3d7=this['_pendingContextItems']['get'](_0x4783db),_0x4cb82f=this['_ongoingUploads']['get'](_0x4783db);if(_0x4cb82f&&(_0x4cb82f['abort'](),this['_ongoingUploads']['delete'](_0x4783db)),_0x41d3d7?.['resourceId']){const _0x321469=this['_findSourceIdsByResourceId'](_0x41d3d7['resourceId']);_0x321469&&_0x321469['forEach'](_0x6dbf13=>{this['_updateResourceInContextState'](_0x6dbf13,_0x41d3d7['resourceId'],!0x1);});}this['_pendingContextItems']['delete'](_0x4783db),this['fire']('contextItemRemoved',{'uiId':_0x4783db,'type':_0x41d3d7?.['type']}),'current-document'===_0x4783db&&this['_toggleAddCurrentDocumentOptionVisibility']();}['_finishContextItemLoading'](_0x1268a1,_0x5583b9){if(this['_pendingContextItems']['has'](_0x1268a1['uiId'])&&(this['_pendingContextItems']['set'](_0x1268a1['uiId'],_0x1268a1),this['fire']('contextItemLoadingEnded',{'contextItem':_0x1268a1,'isLoading':_0x5583b9}),_0x1268a1['resourceId'])){const _0x142e15=this['_findSourceIdsByResourceId'](_0x1268a1['resourceId']);_0x142e15&&_0x142e15['forEach'](_0x139366=>{this['_updateResourceInContextState'](_0x139366,_0x1268a1['resourceId'],!0x0);});}}['_addToConversationContextItem'](_0x242ff7){this['_conversationContextItems']['set'](_0x242ff7['uiId'],_0x242ff7);}['_setAddContextOptionsDefaultState'](){this['_addContextOptionsState']={'document':{'enabled':!0x1!==this['_config']?.['document']?.['enabled'],'isHidden':!0x1},'urls':{'enabled':!0x1!==this['_config']?.['urls']?.['enabled']},'files':{'enabled':!0x1!==this['_config']?.['files']?.['enabled']},'sources':this['_getCustomSourcesInitialState'](),'customItems':this['_config']?.['customItems']?.['map'](_0x1ead9e=>({..._0x1ead9e,'enabled':!0x0}))??[]},this['fire']('addContextOptionsChanged',{'options':this['_addContextOptionsState']});}['_getCustomSourcesInitialState'](){return this['_config']?.['sources']?.['map'](_0x418d40=>({..._0x418d40,'resources':[]}))??[];}['_toggleAddCurrentDocumentOptionVisibility'](){const _0x2cc552=this['isCurrentDocumentInContext']()||this['isCurrentDocumentInConversation']();this['_addContextOptionsState']['document']['isHidden']=_0x2cc552,this['fire']('addContextOptionsChanged',{'options':this['_addContextOptionsState']});}['_isResourceInContext'](_0x55a0fc){for(const _0x222adf of this['_pendingContextItems']['values']())if(_0x222adf['resourceId']===_0x55a0fc)return!0x0;for(const _0x253208 of this['_conversationContextItems']['values']())if(_0x253208['resourceId']===_0x55a0fc)return!0x0;return!0x1;}['_findSourceIdsByResourceId'](_0x4c4466){const _0x4d4940=[];for(const _0x3b4cd6 of this['_addContextOptionsState']['sources']){_0x3b4cd6['resources']['find'](_0x46c182=>_0x46c182['id']===_0x4c4466)&&_0x4d4940['push'](_0x3b4cd6['id']);}return 0x0===_0x4d4940['length']?null:_0x4d4940;}['_updateResourceInContextState'](_0x34ad01,_0x3b4233,_0x22c506){const _0x4a2cfc=this['_addContextOptionsState']['sources']['find'](_0xa94a7d=>_0xa94a7d['id']===_0x34ad01);if(!_0x4a2cfc)return;const _0x459fde=_0x4a2cfc['resources']['find'](_0x1f36ff=>_0x1f36ff['id']===_0x3b4233);_0x459fde&&(_0x459fde['isInContext']=_0x22c506,this['fire']('resourceStateChanged',{'sourceId':_0x34ad01,'resourceId':_0x3b4233,'isInContext':_0x22c506}));}['_startUploadOperation'](_0x259976){this['_ongoingUploadOperations']['set'](_0x259976,!0x0),this['_ongoingUploadOperations']['size']&&this['fire']('uploadProgressChanged',{'isUploadInProgress':!0x0});}['_finishUploadOperation'](_0xaee84f){this['_ongoingUploadOperations']['delete'](_0xaee84f),0x0===this['_ongoingUploadOperations']['size']&&this['fire']('uploadProgressChanged',{'isUploadInProgress':!0x1});}}const Hs=['capabilitiesUpdated'];class Ms extends pt(){['_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'](_0xfaa030){const _0x2f0049={};return _0xfaa030&&_0xfaa030['isWebSearchEnabled']&&(_0x2f0049['webSearch']={}),_0xfaa030&&_0xfaa030['isReasoningEnabled']&&(_0x2f0049['reasoning']={}),_0x2f0049;}['toggleWebSearch'](){this['setWebSearch'](!this['_isWebSearchEnabled']);}['toggleReasoning'](){this['setReasoning'](!this['_isReasoningEnabled']);}['setWebSearch'](_0x1b8b90){_0x1b8b90!==this['_isWebSearchEnabled']&&(this['_isWebSearchEnabled']=_0x1b8b90,this['fire']('capabilitiesUpdated',this['getCapabilitiesConfig']()));}['setReasoning'](_0x1e72f8){_0x1e72f8!==this['_isReasoningEnabled']&&(this['_isReasoningEnabled']=_0x1e72f8,this['fire']('capabilitiesUpdated',this['getCapabilitiesConfig']()));}}class Us extends xs{['userMessage'];['conversationId'];['contextItems']=new Map();['capabilities'];['model'];['attributes'];constructor(_0x4938d7){super(_0x4938d7),this['conversationId']=_0x4938d7['conversationId'],this['contextItems']=_0x4938d7['contextItems'],this['capabilities']=_0x4938d7['capabilities'],this['userMessage']=_0x4938d7['userMessage'],this['model']=_0x4938d7['model'],this['attributes']=_0x4938d7['attributes'];}async['sendRequest'](){return this['connector']['queryAssistant']({'message':this['userMessage'],'conversationId':this['conversationId'],'parts':Ps['mapContextItemsToRequestData'](this['contextItems']),'capabilities':Ms['getCapabilitiesRequestData'](this['capabilities']),'model':this['model'],'attributes':this['attributes']});}['getDocumentContext'](){return this['contextItems']['get']('current-document');}}class Vs extends pt(){['id'];['isStarted']=!0x1;['isFromHistory'];['interactions']=[];['currentInteraction'];['selectedModel'];['connector'];['options'];constructor(_0x50128a){super(),this['options']=_0x50128a,this['connector']=_0x50128a['connector'],this['chatModels']=_0x50128a['chatModels'],this['id']=_0x50128a['conversationId'],this['isFromHistory']=_0x50128a['isFromHistory'];}async['init'](_0x33a9a8){try{this['chatContext']=new Ps({'connector':this['connector'],'config':_0x33a9a8,'ownerId':this['id']}),this['chatContext']['delegate'](...Ds)['to'](this),this['chatContext']['init'](),this['chatCapabilities']=new Ms(),this['chatCapabilities']['delegate'](...Hs)['to'](this),this['chatCapabilities']['init']();const _0x15aeb9=await this['chatModels']['getAvailableModels']();this['fire']('conversationInitialized',{'availableModels':_0x15aeb9});const _0x35ea4b=await this['chatModels']['getModel'](this['options']['selectedModelId']);_0x35ea4b&&await this['setModel'](_0x35ea4b);}catch(_0x4149e1){const _0x5e54dc=new ot('ai-chat-conversation-init-failed',null,{'message':_0x4149e1['message']||_0x4149e1});_0x5e54dc['stack']=_0x4149e1['stack'],this['fire']('error',{'error':_0x5e54dc});}}async['start'](){if(this['isStarted'])throw new ot('ai-chat-conversation-already-started',null,{'conversation':this});if(!this['selectedModel'])throw new ot('ai-chat-conversation-start-no-model-selected',null,{'conversation':this});try{const {id:_0x4e53a5}=await this['connector']['startConversation'](this['id'],this['options']['group'])['getConversation']();this['id']=_0x4e53a5,this['isStarted']=!0x0,this['fire']('conversationStarted',{'conversationId':this['id'],'selectedModel':this['selectedModel']});}catch(_0x107546){const _0xc7e850=new ot('ai-chat-conversation-start-failed',null,{'message':_0x107546['message'],'conversationId':this['id']});throw _0xc7e850['stack']=_0x107546['stack'],this['fire']('error',{'error':_0xc7e850}),_0xc7e850;}}async['load'](_0x420bd7,_0x5a3158){try{const _0x4b5205=await this['connector']['fetchConversation'](_0x420bd7)['getConversation'](),_0x949b7c=await this['connector']['fetchConversationMessages'](_0x420bd7)['getMessages'](),_0x21cd86=_0x949b7c[0x0]['model'];this['isStarted']=!0x0,this['id']=_0x4b5205['id'],'title'in _0x4b5205?this['fire']('setConversationTitle',_0x4b5205['title'],!0x0):this['fire']('setConversationTitle','',!0x0);const _0x14d7bd=(await this['chatModels']['getAll']())['find'](_0x237f6d=>_0x237f6d['id']['toLowerCase']()===_0x21cd86['toLowerCase']());return this['selectedModel']=_0x14d7bd,this['fire']('modelSelected',{'selectedModel':_0x14d7bd,'isDisabled':!0x0}),await this['_processMessagesToInteractions'](_0x949b7c,_0x5a3158,_0x21cd86),this['currentInteraction']=void 0x0,this;}catch(_0x517425){const _0x1cfe01=new ot('ai-chat-conversation-init-from-id-failed',null,{'message':_0x517425['message'],'conversationId':_0x420bd7});throw _0x1cfe01['stack']=_0x517425['stack'],this['fire']('error',{'error':_0x1cfe01}),_0x1cfe01;}}async['_processMessagesToInteractions'](_0x44d3ff,_0x4a21ff,_0x3d64bf){let _0x475390;for(const _0xab529a of _0x44d3ff)if('user'===_0xab529a['role']){const _0x27c5af=await this['_extractContextItems'](_0xab529a),_0xd1739c={'isReasoningEnabled':Object['hasOwn'](_0xab529a['capabilities'],'reasoning'),'isWebSearchEnabled':Object['hasOwn'](_0xab529a['capabilities'],'webSearch')};_0x475390=this['createInteraction']({'userMessage':_0xab529a['prompt'],'contextItems':_0x27c5af,'capabilities':_0xd1739c,'modelId':_0x3d64bf,'attributes':_0xab529a['attributes']}),this['currentInteraction']=_0x475390,this['chatContext']['addToConversationContext'](this['currentInteraction']['contextItems']);}else{if('assistant'===_0xab529a['role']&&_0x475390){const _0x19b52a=[];for(const _0x3c6ac3 of _0xab529a['content'])switch(_0x3c6ac3['type']){case'text':case'modification':{const _0x4f8288=_0x475390['getDocumentContext']()?.['sessionId']!==_0x4a21ff;_0x475390['currentReply']=_0x475390['createReply']({'type':_0x3c6ac3['type'],'isDone':!0x0,'interactionId':_0x475390['id'],'areActionsDisabled':_0x4f8288}),_0x475390['currentReply']['appendContent'](_0x3c6ac3['content']),_0x19b52a['length']>0x0&&(_0x475390['currentReply']['sources']=_0x19b52a['splice'](0x0));break;}case'url':_0x19b52a['push'](_0x3c6ac3);break;case'mcp-tool-result':{const {data:_0x2d6149,attributes:_0xcac7b7}=JSON['parse'](_0x3c6ac3['content']);_0x475390['_handleToolResultData']({'toolName':_0x3c6ac3['toolName'],'data':_0x2d6149,'attributes':_0xcac7b7});break;}}}}}async['_extractContextItems'](_0xac8bf){const _0xd1ba3b=new Map();if(!_0xac8bf['content'])return _0xd1ba3b;for(const _0x3fd658 of _0xac8bf['content']){const _0xe4029a=await this['chatContext']['populateFromMessage'](_0x3fd658);_0xe4029a&&_0xd1ba3b['set'](_0xe4029a['id'],_0xe4029a);}return _0xd1ba3b;}async['handleUserInteraction']({userMessage:_0x30e739,attributes:_0x282147}){if(!this['isStarted'])throw new ot('ai-chat-handle-user-conversation-not-initialized',null,{'conversation':this});if(this['currentInteraction'])throw new ot('ai-chat-handle-user-interaction-already-in-progress',null,{'conversation':this});try{const _0x2c3fdd=this['chatContext']['getPendingContextItems'](),_0x48f7b1=this['chatCapabilities']['getCapabilitiesConfig'](),_0x496aca=this['selectedModel']['id'];this['currentInteraction']=this['createInteraction']({'userMessage':_0x30e739,'contextItems':_0x2c3fdd,'capabilities':_0x48f7b1,'modelId':_0x496aca,'attributes':_0x282147}),await this['currentInteraction']['start'](),this['chatContext']['addToConversationContext'](this['currentInteraction']['contextItems']);}catch(_0x1a0d71){if(_0x1a0d71 instanceof ot)this['fire']('error',{'interactionId':this['currentInteraction']?this['currentInteraction']['id']:void 0x0,'error':_0x1a0d71});else{const _0x209fc5=Ls['get'](_0x1a0d71['code'])||'ai-chat-handle-user-interaction-start-failed';this['fire']('error',{'interactionId':this['currentInteraction']?this['currentInteraction']['id']:void 0x0,'error':new ot(_0x209fc5,null,{'error':_0x1a0d71})});}}finally{this['currentInteraction']?.['stop'](),this['currentInteraction']=void 0x0;}}['createInteraction']({userMessage:_0x3dfe04,contextItems:_0x3acdbf,capabilities:_0x3c17c6,modelId:_0x156dcd,attributes:_0x1232e3}){const _0x93681a=new Us({'userMessage':_0x3dfe04,'contextItems':_0x3acdbf,'capabilities':_0x3c17c6,'conversationId':this['id'],'connector':this['connector'],'editor':this['options']['getEditor']&&this['options']['getEditor'](),'model':_0x156dcd,'attributes':_0x1232e3});return _0x93681a['delegate'](...ys)['to'](this),this['interactions']['push'](_0x93681a),this['fire']('interactionCreated',_0x93681a),_0x93681a;}['getInteraction'](_0x131d30){return this['interactions']['find'](_0x11eb53=>_0x11eb53['id']===_0x131d30);}['removeInteraction'](_0x27fd36){const _0x40abfc=this['getInteraction'](_0x27fd36);_0x40abfc&&(_0x40abfc['destroy'](),this['interactions']['splice'](this['interactions']['indexOf'](_0x40abfc),0x1));}get['lastInteraction'](){return this['interactions'][this['interactions']['length']-0x1];}['addCurrentDocumentToContext'](_0x30e955){this['chatContext']['addCurrentDocumentToContext'](_0x30e955);}async['updateCurrentDocumentInContext']({content:_0x2ee40c,version:_0x1b4544,sessionId:_0x4095c0,selections:_0x5e2574}){await this['chatContext']['updateCurrentDocument'](_0x2ee40c,_0x1b4544,_0x4095c0,_0x5e2574);}['getCurrentDocumentContext'](){return this['currentInteraction']?.['getDocumentContext']()?.['content']||'';}['addSelectionToContext'](_0xc0e473){this['chatContext']['addSelectionToContext'](_0xc0e473);}['removeSelectionFromContext'](){this['chatContext']['removeSelectionFromContext']();}['addFilesToContext'](_0x3c6cb1){this['chatContext']['addFilesToContext'](_0x3c6cb1);}['addUrlToContext'](_0x379101){this['chatContext']['addUrlToContext'](_0x379101);}['addToolItemToContext'](_0x1505a3){this['chatContext']['addToolItemToContext'](_0x1505a3);}['addResourceToContext'](_0x68a5af,_0x1ec7a8){this['chatContext']['addResourceToContext'](_0x68a5af,_0x1ec7a8);}['loadSourceResources'](_0x2cb6d3,_0x2cb313,_0x1240f3){return this['chatContext']['loadSourceResources'](_0x2cb6d3,_0x2cb313,_0x1240f3);}['removeFromContext'](_0x17c985){this['chatContext']['removeFromContext'](_0x17c985);}['setWebSearch'](_0x4e0403){this['chatCapabilities']['setWebSearch'](_0x4e0403);}['toggleWebSearch'](){this['chatCapabilities']['toggleWebSearch']();}['setReasoning'](_0x118a04){this['chatCapabilities']['setReasoning'](_0x118a04);}['toggleReasoning'](){this['chatCapabilities']['toggleReasoning']();}['isCurrentDocumentInContext'](){return this['chatContext']['isCurrentDocumentInContext']();}['isCurrentDocumentInConversation'](){return this['chatContext']['isCurrentDocumentInConversation']();}['isSelectionInContext'](){return this['chatContext']['isSelectionInContext']();}async['setModel'](_0x1f6ffd){_0x1f6ffd?!0x1===await this['chatModels']['isAvailable'](_0x1f6ffd)&&(It('ai-chat-conversation-set-model-not-available',{'conversation':this,'model':_0x1f6ffd}),_0x1f6ffd=(await this['chatModels']['getAvailableModels']())[0x0]):(It('ai-chat-conversation-set-model-null',{'conversation':this}),_0x1f6ffd=(await this['chatModels']['getAvailableModels']())[0x0]),_0x1f6ffd['id']!==this['selectedModel']?.['id']&&(this['selectedModel']=_0x1f6ffd,this['chatCapabilities']['reset'](),this['fire']('modelSelected',{'selectedModel':_0x1f6ffd}));}}class Bs extends pt(){['_connector'];['_config'];['_locale'];['_modelList']=[];['_modelsRequest']=null;constructor({connector:_0x446070,config:_0x6db620,locale:_0x55a096}){super(),this['_connector']=_0x446070,this['_config']=_0x6db620,this['_locale']=_0x55a096;}get['_availableModels'](){return this['_config']?.['displayedModels'];}get['_defaultModelId'](){return this['_config']?.['defaultModelId'];}async['getAll'](){return this['_modelsRequest']||(this['_modelsRequest']=this['_retrieveModels']()),this['_modelsRequest'];}async['getAvailableModels'](){const _0x4cd940=await this['getAll']();let _0x2fe695;return _0x2fe695=this['_availableModels']?this['_filterModels'](_0x4cd940,this['_availableModels']):_0x4cd940['filter'](_0x28d536=>_0x28d536['recommended']),_0x2fe695;}async['getModel'](_0x4ed89d){const _0x14c58b=await this['getAll']();if(!_0x14c58b['length'])return null;if(_0x4ed89d){const _0x28c27e=this['_getModelById'](_0x14c58b,_0x4ed89d);if(_0x28c27e)return _0x28c27e;It('ai-chat-model-id-unrecognized',{'modelId':_0x4ed89d,'fallBackModelId':this['_defaultModelId']});}return this['getDefault']();}async['getDefault'](){const _0x27cd35=await this['getAvailableModels']();if(!_0x27cd35['length'])return null;if(this['_defaultModelId']){const _0xd302ff=this['_getModelById'](_0x27cd35,this['_defaultModelId']);if(_0xd302ff)return _0xd302ff;It('ai-chat-default-model-id-unrecognized',{'defaultModelId':this['_defaultModelId'],'fallBackModelId':_0x27cd35[0x0]['id']});}return _0x27cd35[0x0];}async['isAvailable'](_0x411765){return(await this['getAvailableModels']())['some'](_0x314f00=>_0x314f00['name']===_0x411765['name']&&_0x314f00['provider']===_0x411765['provider']);}async['_retrieveModels'](){if(!this['_modelList']['length'])try{const _0x41039c=this['_locale']['uiLanguage']||'en',_0x514063=this['_connector']['getModels'](_0x41039c),_0x1129c2=await _0x514063['list']();this['_modelList']=_0x1129c2['items']['map'](_0x58459f=>Gs(_0x58459f)?{..._0x58459f,'name':as(this['_locale'],'AI_MODEL_NAME_AUTO')}:_0x58459f);}catch(_0x363c22){throw Et('ai-models-unable-to-retrieve',{'error':_0x363c22}),_0x363c22;}return[...this['_modelList']];}['_filterModels'](_0x31f58a,_0x48ad44){let _0x766ae7;if(_0x48ad44){_0x766ae7=[];const _0x217e0f=new Set(),_0x55f43b='string'==typeof _0x48ad44?[_0x48ad44['toLocaleLowerCase']()]:_0x48ad44['map'](_0x1ed9e5=>_0x1ed9e5['toLocaleLowerCase']());for(const _0x5268f3 of _0x55f43b)for(const _0x37f0d0 of _0x31f58a)!_0x217e0f['has'](_0x37f0d0['id'])&&this['_isMatchingFilter'](_0x37f0d0,_0x5268f3)&&(_0x766ae7['push'](_0x37f0d0),_0x217e0f['add'](_0x37f0d0['id']));}else _0x766ae7=_0x31f58a;return _0x766ae7;}['_isMatchingFilter'](_0x1085f7,_0x6c1c6){const _0x2dc4ed=_0x1085f7['id']['toLocaleLowerCase'](),_0x23461e=_0x1085f7['name']['toLocaleLowerCase'](),_0x5baf8e=_0x1085f7['provider']['toLocaleLowerCase']();return _0x2dc4ed===_0x6c1c6||_0x23461e===_0x6c1c6||Gs(_0x1085f7)&&'auto'===_0x6c1c6||_0x5baf8e===_0x6c1c6||_0x2dc4ed['startsWith'](_0x6c1c6);}['_getModelById'](_0x4cdfc2,_0x438077){return _0x4cdfc2['find'](_0x5f4096=>Gs(_0x5f4096)&&'auto'===_0x438077?_0x5f4096:_0x5f4096['id']===_0x438077)||null;}}function Gs(_0x12d0e8){return _0x12d0e8['id']['startsWith']('agent');}function Fs(_0x5b2c7c){if(_0x5b2c7c instanceof _0x3ba7d1)return _0x5b2c7c;if(_0x5b2c7c?.['editors']&&_0x5b2c7c['editors']['get'](0x0))return _0x5b2c7c['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.'),_0x5b2c7c['editors']['get'](0x0);throw new ot('ai-get-editor-from-context-no-editor');}function Ks({editor:_0x1f4c4f,interaction:_0x2b1b5e,reply:_0x2636c9,groups:_0x3ec41f,transform:_0x2a35c1,documentCompare:_0x25da28,documentCompareOptions:_0x330d2a}){const _0x4b15b3=_0x2b1b5e['getDocumentContext']();if(!_0x4b15b3)return[];const _0xd61d73=_0x4b15b3['content'],_0x173940=_0x4b15b3['version'],_0x152315=_0x2636c9['documentContextContent']['cloneNode'](!0x0);for(const {changes:_0xe094fb}of _0x3ec41f){const _0x20ce7b=_0xe094fb['filter'](_0x261628=>'new'!=_0x261628['type'])['map'](_0x158d6c=>_s('data-id',_0x158d6c['id'],_0x152315)),_0x518ea3=_0xe094fb['filter'](_0x2b117e=>'removed'!=_0x2b117e['type'])['map'](_0x372f88=>_0x372f88['node']['cloneNode'](!0x0));let _0x1d5353=null;if(_0x20ce7b['length']){_0x1d5353=_0x20ce7b[0x0]['previousSibling'];for(let _0xab373d=0x0;_0xab373d<_0x20ce7b['length'];_0xab373d++)_0x411d52(_0x20ce7b[_0xab373d]);}if(_0x518ea3['length']){_0x1d5353||(_0xe094fb[0x0]['anchorId']?_0x1d5353=_s('data-id',_0xe094fb[0x0]['anchorId'],_0x152315):(_0x1d5353=_0x518ea3['shift'](),_0x2bedf0(_0x152315,_0x1d5353)));for(let _0x4bada6=0x0;_0x4bada6<_0x518ea3['length'];_0x4bada6++)_0x5d104d(_0x1d5353,_0x518ea3[_0x4bada6]),_0x1d5353=_0x518ea3[_0x4bada6];}}const _0x8c8b57=ds(_0x152315),_0x4e3f13=_0x25da28['getDiff'](_0xd61d73,_0x8c8b57,_0x330d2a)['getOperations']();if(_0x2a35c1){const _0x4b24bb=_0x1f4c4f['model']['document']['history']['getOperations'](_0x173940),_0x7d6d1a={'document':_0x1f4c4f['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1};return _0x3d9713(_0x4e3f13,_0x4b24bb,_0x7d6d1a)['operationsA'];}return _0x4e3f13;}function Ws(_0x2c95f1,_0x534dff){if('marker'!=_0x534dff['type'])return;const _0x209770=_0x2c95f1['model']['markers']['get'](_0x534dff['name']);_0x209770&&(_0x534dff['oldRange']=_0x209770['getRange']());}class Ys extends _0x1f4c78{['activeConversation'];['_aiEditing'];['_aiConnector'];['_aiChatUi'];['_aiChatModels'];['_aiChatBalloon'];['_batchToChanges']=new Map();['_currentPreviewedChangeGroup']=null;['_bodyCollection'];static get['requires'](){return[rs,_0x1b3b63];}static get['pluginName'](){return'AIChatController';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){this['_bodyCollection']=new qt(this['context']['locale']),this['_bodyCollection']['attachToDom'](),this['_aiConnector']=this['context']['plugins']['get']('AIConnector'),this['_aiChatUi']=this['context']['plugins']['get']('AIChatUI'),this['_aiEditing']=this['context']['plugins']['get']('AIEditing'),this['_aiChatModels']=new Bs({'connector':this['_aiConnector'],'config':this['context']['config']['get']('ai.models'),'locale':this['context']['locale']});const _0x1c5e7d=this['context']['plugins']['get']('AITabs');this['listenTo'](this['_aiChatUi'],'startConversation',()=>{this['_startConversationSafely']();}),this['listenTo'](this['_aiChatUi'],'sendUserMessage',(_0x49b609,_0x148db3)=>{this['_handleUIUserMessage']({'message':_0x148db3});}),this['listenTo'](_0x1c5e7d,'resizedTabs',(_0x53e4fa,_0x2c6398)=>{this['_setIsMaximized'](_0x2c6398);}),this['listenTo'](this['_aiChatUi'],'resizeTabs',()=>{_0x1c5e7d['resize']();}),this['listenTo'](_0x1c5e7d['view'],'change:activeTab',(_0x4d7b7e,_0x450de1,_0x514dae)=>{'chat'!==_0x514dae&&this['removeSelectionFromChatContext']();}),this['listenTo'](this['_aiChatUi'],'abortPromptStream',async()=>{await this['_stopLastInteraction'](),await this['_flushLastInteractionUI'](),this['removeSelectionFromChatContext']();}),this['listenTo'](this['_aiChatUi'],'addDocumentToContext',()=>{this['addCurrentDocumentToChatContext']();}),this['listenTo'](this['_aiChatUi'],'addFileToContext',(_0x508441,_0x38c4cc)=>{this['activeConversation']?.['addFilesToContext'](Array['from'](_0x38c4cc));}),this['listenTo'](this['_aiChatUi'],'addUrlToContext',(_0x4546c0,_0x563983)=>{this['activeConversation']?.['addUrlToContext'](_0x563983);}),this['listenTo'](this['_aiChatUi'],'executeCustomItemCallback',(_0x14a6aa,_0x1b8b78)=>{_0x1b8b78['callback'](this['context']);}),this['listenTo'](this['_aiChatUi'],'addResourceToContext',(_0x165c23,_0x581286)=>{this['activeConversation']?.['addResourceToContext'](_0x581286['source'],_0x581286['resource']);}),this['listenTo'](this['_aiChatUi'],'removeContextItem',(_0x4e32eb,_0x3f831e)=>{this['_removeFromContext'](_0x3f831e);}),this['listenTo'](this['_aiChatUi'],'loadSourceResources',(_0x43702a,_0x3c702a)=>{this['activeConversation']?.['loadSourceResources'](_0x3c702a['sourceId'],_0x3c702a['query'],_0x3c702a['uid']);}),this['listenTo'](this['_aiChatUi'],'toggleWebSearch',()=>{this['_toggleWebSearch']();}),this['listenTo'](this['_aiChatUi'],'toggleReasoning',()=>{this['_toggleReasoning']();}),this['listenTo'](this['_aiChatUi'],'selectModel',(_0x4fb16f,_0xd8cdb5)=>{this['activeConversation']?.['setModel'](_0xd8cdb5);}),this['listenTo'](this['_aiChatUi'],'like',(_0x40bcc2,{replyId:_0x43a21e})=>{console['log']('Liked\x20response',_0x43a21e);}),this['listenTo'](this['_aiChatUi'],'dislike',(_0x4a1c4f,{replyId:_0x362aad})=>{console['log']('Disliked\x20response',_0x362aad);}),this['listenTo'](this['_aiChatUi'],'insertSuggestion',(_0x3a5e6f,_0xf45c5a)=>{this['_insertSuggestion'](_0xf45c5a);}),this['listenTo'](this['_aiChatUi'],'showChangeInText',(_0xb16bec,{replyId:_0x1412af,partIndex:_0x526af9})=>{this['_aiChatBalloonShowDiff']=this['_aiChatUi']['showDiff'],this['_openBalloonFor'](_0x1412af,_0x526af9);}),this['listenTo'](this['_aiChatUi'],'mouseOverSuggestion',(_0x3c0d59,{replyId:_0x57f678,partIndex:_0x3029c2})=>{const _0x19c29d=this['_getDocumentRangeForReplyChanges'](_0x57f678,_0x3029c2);_0x19c29d&&'$graveyard'!=_0x19c29d['range']['root']['rootName']&&this['_aiEditing']['showFakeVisualSelection']({'ranges':[_0x19c29d['range']],'id':'change-area','priority':0xa});}),this['listenTo'](this['_aiChatUi'],'mouseLeaveSuggestion',()=>{this['_aiEditing']['hideFakeVisualSelection']('change-area');}),this['listenTo'](this['_aiChatUi'],'applySuggestion',(_0x192757,_0x3c476b)=>{this['_aiEditing']['hideFakeVisualSelection']('change-area'),this['_applySuggestion'](_0x3c476b);}),this['listenTo'](this['_aiChatUi'],'toggleSuggestionDisplayMode',async(_0x567b2f,{replyId:_0x27597a,showDiff:_0x2f4de9})=>{const {reply:_0x1e68bb}=this['getInteractionAndReplyById'](_0x27597a),_0x39e655=_0x1e68bb['getContentParts']({'showDiff':_0x2f4de9});await this['_aiChatUi']['updateFeedItemAIReplySuggestionContent']({'id':_0x1e68bb['id'],'parts':_0x39e655,'renderingStrategy':'static'});}),this['listenTo'](this['_aiChatUi'],'rejectSuggestion',(_0x2c1b77,{replyId:_0x3d52f8,partIndex:_0xcdc707})=>{this['_rejectSuggestion']({'replyId':_0x3d52f8,'partIndex':_0xcdc707}),this['_aiEditing']['hideFakeVisualSelection']('change-area');}),this['context']['plugins']['has']('AIChatBalloon')&&(this['_aiChatBalloon']=this['context']['plugins']['get']('AIChatBalloon'),this['set']('_aiChatBalloonShowDiff',!0x1),this['_aiChatBalloon']['bind']('showDiff')['to'](this,'_aiChatBalloonShowDiff'),this['listenTo'](this['_aiChatBalloon'],'toggleSuggestionDisplayMode',()=>{const {replyId:_0x435a22,partIndex:_0x33d589}=this['_currentPreviewedChangeGroup'];this['_aiChatBalloonShowDiff']=!this['_aiChatBalloonShowDiff'];const {reply:_0x5151c3}=this['getInteractionAndReplyById'](_0x435a22),_0x11d652=_0x5151c3['getContentParts']({'showDiff':this['_aiChatBalloonShowDiff'],'groupIndex':_0x33d589});this['_aiChatBalloon']['updateContent']({'part':_0x11d652[0x0],'renderingStrategy':'static','keepErrors':!0x0});}),this['listenTo'](this['_aiChatBalloon'],'applySuggestion',()=>{const {replyId:_0x55f272,partIndex:_0x5d016d}=this['_currentPreviewedChangeGroup'];this['_applySuggestion']({'replyId':_0x55f272,'partIndex':_0x5d016d}),this['_aiChatBalloon']['setState']('accepted');}),this['listenTo'](this['_aiChatBalloon'],'insertSuggestion',()=>{const {replyId:_0x20876b,partIndex:_0x4358aa}=this['_currentPreviewedChangeGroup'];this['_insertSuggestion']({'replyId':_0x20876b,'partIndex':_0x4358aa}),this['_aiChatBalloon']['setState']('accepted');}),this['listenTo'](this['_aiChatBalloon'],'rejectSuggestion',()=>{const {replyId:_0x38a6fa,partIndex:_0x233d7f}=this['_currentPreviewedChangeGroup'];this['_rejectSuggestion']({'replyId':_0x38a6fa,'partIndex':_0x233d7f}),this['_aiChatBalloon']['setState']('rejected');}),this['listenTo'](this['_aiChatBalloon'],'showNext',()=>{const {replyId:_0x15dc67,partIndex:_0x158ef3}=this['_currentPreviewedChangeGroup'],_0x57fc09=this['_getPresentableSiblingContentPartIndex'](_0x15dc67,_0x158ef3,'next');null!==_0x57fc09&&this['_openBalloonFor'](_0x15dc67,_0x57fc09);}),this['listenTo'](this['_aiChatBalloon'],'showPrevious',()=>{const {replyId:_0x2b9080,partIndex:_0x1a9285}=this['_currentPreviewedChangeGroup'],_0x30ae28=this['_getPresentableSiblingContentPartIndex'](_0x2b9080,_0x1a9285,'previous');null!==_0x30ae28&&this['_openBalloonFor'](_0x2b9080,_0x30ae28);}),this['listenTo'](this['_aiChatBalloon'],'dialogClosed',(_0x4fac45,{id:_0x1bee34})=>{if('aiChatBalloon'!==_0x1bee34)return;const {replyId:_0x40921a,partIndex:_0xbb19ca}=this['_currentPreviewedChangeGroup'];this['_currentPreviewedChangeGroup']=null,this['_aiChatUi']['setFeedItemAIReplySuggestionPartActive']({'id':_0x40921a,'index':_0xbb19ca,'isActive':!0x1});})),this['on']('interactionCreated',(_0x1db6ca,_0x23a1b7)=>{this['_aiChatUi']['addFeedItemUserMessage'](_0x23a1b7);}),this['on']('replyCreated',(_0x47fae0,_0x22f1d8)=>{this['_addFeedItemReply'](_0x22f1d8);});}async['afterInit'](){this['context']instanceof _0x3ba7d1?this['_integrateEditor'](this['context']):this['listenTo'](this['context']['editors'],'add',(_0x4979e8,_0x47c751)=>{_0x47c751['on']('ready',()=>{this['_integrateEditor'](_0x47c751);});});const _0x30c5df=this['context']['config']['get']('ai.chat.initialConversation');let _0x482199=_0x30c5df;if('lastCreated'!=_0x30c5df||(_0x482199=await this['_getLastCreatedConversationId'](),_0x482199))return'new'==_0x482199?this['_startConversationSafely']():this['loadConversation'](_0x482199);}async['destroy'](){return await this['_stopLastInteraction'](),this['_bodyCollection']['detachFromDom'](),super['destroy']();}async['loadConversation'](_0x36d015){this['context']['plugins']['has']('AIChatBalloon')&&this['context']['plugins']['get']('AIChatBalloon')['close'](),(this['context']['plugins']['get'](ns)['view']['activateTab']('chat'),this['_aiChatUi']['setFeedItemRenderingStrategy']('static'),this['_aiChatUi']['toggleLoadingSkeleton'](!0x0),await this['_stopLastInteraction']());try{await this['_aiConnector']['fetchConversation'](_0x36d015)['getConversation'](),await this['_startConversationSafely'](_0x36d015),this['_updateConversationTitle']('\x20'),await this['activeConversation']['load'](_0x36d015,this['_aiEditing']['sessionId']),this['activeConversation']['isCurrentDocumentInConversation']()&&this['addCurrentDocumentToChatContext']();}catch(_0x2de59f){this['_aiChatUi']['addFeedItemError']({'errorMessage':as(this['context']['locale'],'AI_CHAT_UNABLE_TO_LOAD_CONVERSATION'),'id':_0x36d015}),this['_logError'](new ot('ai-chat-conversation-not-found',this,{'error':_0x2de59f}));}finally{this['_aiChatUi']['startAutoScroll'](),this['_aiChatUi']['setFeedItemRenderingStrategy']('streaming'),this['_aiChatUi']['toggleLoadingSkeleton'](!0x1);}}['registerToolDataCallback'](_0x58718f){let _0x45628b=null,_0x3d36c3=null;this['on']('toolDataReceived',(_0x50627c,_0x436c81,_0x50b19a)=>{_0x50b19a['id']!==_0x45628b&&(_0x45628b=_0x50b19a['id'],_0x3d36c3=this['_getAIChatFeedAPI'](_0x50b19a)),_0x58718f(_0x436c81,_0x3d36c3);});}['addCurrentDocumentToChatContext'](){this['activeConversation']?.['addCurrentDocumentToContext'](as(this['context']['locale'],'AI_CHAT_CONTEXT_CURRENT_DOCUMENT'));}async['addSelectionToChatContext'](){const _0x5dbff6=this['_aiEditing']['getSelectionText']();this['activeConversation']?.['addSelectionToContext'](_0x5dbff6),this['addCurrentDocumentToChatContext']();}['removeSelectionFromChatContext'](){this['activeConversation']?.['removeSelectionFromContext']();}['focusPromptInput'](){this['_aiChatUi']['focusPromptInput']();}async['startConversation'](){await this['_startConversationSafely']();}async['sendMessage'](_0x43f8fa){await this['_handleUIUserMessage'](_0x43f8fa);}['getGroupId'](){const _0x5bbea2=this['context']['config']['get']('collaboration.channelId');if(!_0x5bbea2)throw new ot('ai-chat-missing-channel-id',this);return _0x5bbea2;}['_handleRemovedConversation'](_0x460ead){this['activeConversation']['id']===_0x460ead&&this['_startConversationSafely']();}['_insertSuggestion'](_0x393db6){const _0x54ceac=Fs(this['context']);if(!_0x54ceac['plugins']['has']('TrackChanges'))throw new ot('ai-no-track-changes',null);const _0x40dc0c=this['context']['plugins']['get']('DocumentCompare'),{reply:_0x5ad0bc,interaction:_0x338c05}=this['getInteractionAndReplyById'](_0x393db6['replyId']),_0x2cc49f=this['_getDocumentRangeForReplyChanges'](_0x393db6['replyId'],_0x393db6['partIndex']),_0xa07124=void 0x0!==_0x393db6['partIndex']?[_0x5ad0bc['changeGroups'][_0x393db6['partIndex']]]:_0x5ad0bc['changeGroups']['filter'](_0x15ee52=>'pending'==_0x15ee52['state']),_0x2f6c80=_0xa07124['map'](_0x215263=>_0x5ad0bc['changeGroups']['indexOf'](_0x215263));if(!_0x2cc49f||'$graveyard'==_0x2cc49f['range']['root']['rootName'])return void _0x2f6c80['forEach'](_0x5cdbcd=>_0x5ad0bc['setChangeGroupState'](_0x5cdbcd,'outdated'));_0x2f6c80['forEach'](_0x26e7b6=>_0x5ad0bc['setChangeGroupState'](_0x26e7b6,'accepted'));const _0x4ae0d5=Ks({'editor':_0x54ceac,'reply':_0x5ad0bc,'interaction':_0x338c05,'groups':_0xa07124,'transform':!0x0,'documentCompare':_0x40dc0c,'documentCompareOptions':{'anchor':'main','markDeletions':!0x0}});let _0xae10dd;_0x2cc49f&&this['_scrollToSuggestionRange'](_0x2cc49f['range']),_0x54ceac['model']['change'](_0x351365=>{_0xae10dd=_0x351365['batch'],_0x54ceac['plugins']['get']('TrackChangesEditing')['_applyOperationsAsSuggestions'](_0x4ae0d5),this['_aiEditing']['hideFakeVisualSelection']('change-area');}),this['_batchToChanges']['set'](_0xae10dd,{'interactionId':_0x338c05['id'],'replyId':_0x5ad0bc['id'],'indexes':_0x2f6c80['slice']()}),this['_updateRatings'](_0x5ad0bc);}['_applySuggestion'](_0x1d2190){const _0x4f6246=Fs(this['context']),_0x486fb1=this['context']['plugins']['get'](_0x1b3b63),{reply:_0x58e317,interaction:_0x43f43a}=this['getInteractionAndReplyById'](_0x1d2190['replyId']),_0x91fa36=this['_getDocumentRangeForReplyChanges'](_0x1d2190['replyId'],_0x1d2190['partIndex']),_0xd9014b=void 0x0!==_0x1d2190['partIndex']?[_0x58e317['changeGroups'][_0x1d2190['partIndex']]]:_0x58e317['changeGroups']['filter'](_0x4c2d1e=>'pending'==_0x4c2d1e['state']),_0x39135a=_0xd9014b['map'](_0x47bd96=>_0x58e317['changeGroups']['indexOf'](_0x47bd96));if(!_0x91fa36||'$graveyard'==_0x91fa36['range']['root']['rootName'])return void _0x39135a['forEach'](_0x3b64b0=>_0x58e317['setChangeGroupState'](_0x3b64b0,'outdated'));_0x39135a['forEach'](_0x4fe470=>_0x58e317['setChangeGroupState'](_0x4fe470,'accepted'));const _0x19aa6e=Ks({'editor':_0x4f6246,'reply':_0x58e317,'interaction':_0x43f43a,'groups':_0xd9014b,'transform':!0x0,'documentCompare':_0x486fb1,'documentCompareOptions':{'anchor':'main','markDeletions':!0x1}});let _0x50a453;_0x91fa36&&this['_scrollToSuggestionRange'](_0x91fa36['range']),_0x4f6246['model']['change'](_0x55f1b9=>{_0x50a453=_0x55f1b9['batch'];for(const _0xee68bf of _0x19aa6e)_0xee68bf['baseVersion']=_0x4f6246['model']['document']['version'],Ws(_0x4f6246,_0xee68bf),_0x55f1b9['batch']['addOperation'](_0xee68bf),_0x4f6246['model']['applyOperation'](_0xee68bf);}),this['_batchToChanges']['set'](_0x50a453,{'interactionId':_0x43f43a['id'],'replyId':_0x58e317['id'],'indexes':_0x39135a['slice']()}),this['_updateRatings'](_0x58e317);}['_rejectSuggestion'](_0x56adcd){const {reply:_0x225309}=this['getInteractionAndReplyById'](_0x56adcd['replyId']);_0x225309['setChangeGroupState'](_0x56adcd['partIndex'],'rejected');}['_openBalloonFor'](_0x4bebeb,_0x462499){if(!this['_aiChatBalloon'])return;const {reply:_0x4f16e9}=this['getInteractionAndReplyById'](_0x4bebeb),_0x2fd8ac=_0x4f16e9['getContentParts']({'showDiff':this['_aiChatBalloonShowDiff']});let _0x27b109,_0x4ecbfc;if(void 0x0!==_0x462499?(_0x4ecbfc=_0x2fd8ac['find'](_0x3df805=>_0x3df805['index']==_0x462499),_0x27b109=_0x4ecbfc?.['index']):(_0x4ecbfc=_0x2fd8ac[0x0],_0x27b109=_0x4ecbfc['index']),this['_currentPreviewedChangeGroup']?.['replyId']==_0x4bebeb&&this['_currentPreviewedChangeGroup']?.['partIndex']==_0x27b109)return;const _0x426adf=this['_getUserPresentableContentPartDocumentRange'](_0x4bebeb,_0x4f16e9,_0x4ecbfc);if(!_0x426adf)return void this['_aiChatBalloon']['close']();this['_currentPreviewedChangeGroup']={'replyId':_0x4bebeb,'partIndex':_0x27b109},this['_scrollToSuggestionRange'](_0x426adf,!0x0);const _0x5775cb=this['_getPresentableSiblingContentPartIndex'](_0x4bebeb,_0x27b109,'next');this['_aiChatBalloon']['updateContent']({'part':_0x4ecbfc,'renderingStrategy':'static'}),this['_aiChatBalloon']['open']({'index':_0x27b109,'title':as(this['context']['locale'],'AI_BALLOON_HEADER_TITLE',(_0x27b109+0x1)['toString']()),'showRotator':null!==_0x5775cb,'ranges':[_0x426adf],'areActionsDisabled':_0x4f16e9['areActionsDisabled']}),this['_aiChatBalloon']['setState']('pending'),this['_aiChatUi']['scrollFeedToSuggestion'](_0x4bebeb,_0x27b109),this['_aiChatUi']['setFeedItemAIReplySuggestionPartActive']({'id':_0x4bebeb,'index':_0x27b109,'isActive':!0x0});}['_getPresentableSiblingContentPartIndex'](_0x204563,_0x43eec1,_0x185539){const {reply:_0x1d252a}=this['getInteractionAndReplyById'](_0x204563),_0x393ee3=_0x1d252a['getContentParts']({'showDiff':this['_aiChatBalloonShowDiff']});if(0x1==_0x393ee3['length'])return null;const _0x2ead47=_0x393ee3['findIndex'](_0x34dfb0=>_0x34dfb0['index']==_0x43eec1),_0x325830='next'==_0x185539?0x1:-0x1;let _0x382dd4=_0x393ee3['at']((_0x2ead47+_0x325830)%_0x393ee3['length'])['index'],_0x3308d0=_0x393ee3[_0x382dd4];for(;!this['_getUserPresentableContentPartDocumentRange'](_0x204563,_0x1d252a,_0x3308d0);){if(_0x382dd4=_0x393ee3['at']((_0x382dd4+_0x325830)%_0x393ee3['length'])['index'],_0x382dd4===_0x2ead47)return null;_0x3308d0=_0x393ee3[_0x382dd4];}return _0x382dd4;}['_getUserPresentableContentPartDocumentRange'](_0xa63e76,_0x4fdf50,_0x580180){const _0x4d23ef=_0x4fdf50['changeGroups'];if(!_0x580180['hasChanges'])return null;const _0x3a903c=_0x4d23ef['find'](_0x4e1af4=>_0x4e1af4['index']==_0x580180['index']);if('pending'!==_0x3a903c?.['state'])return null;const _0x4ec54e=this['_getDocumentRangeForReplyChanges'](_0xa63e76,_0x580180['index']);if(!_0x4ec54e)return null;const {range:_0x23fec2,currentIndex:_0x58132a}=_0x4ec54e;return'$graveyard'==_0x23fec2['root']['rootName']?(_0x4fdf50['setChangeGroupState'](_0x58132a,'outdated'),null):_0x4ec54e['range'];}['_getDocumentRangeForReplyChanges'](_0x75d8e4,_0x1ad1db){const _0x367c9f=Fs(this['context']),{reply:_0x3d181b,interaction:_0x5dcf5a}=this['getInteractionAndReplyById'](_0x75d8e4),_0x5d291f=_0x3d181b['changeGroups']['filter'](_0x21d8bc=>'pending'==_0x21d8bc['state']),_0x2733a9=_0x5d291f['map'](_0x44cdcd=>_0x3d181b['changeGroups']['indexOf'](_0x44cdcd));void 0x0===_0x1ad1db&&(_0x1ad1db=_0x2733a9[0x0]);const _0x38f811=_0x2733a9['indexOf'](_0x1ad1db);if(-0x1==_0x38f811)return null;const _0x30f2f4=_0x5d291f[_0x38f811],_0x515cbf=new _0xb96947([]),_0x12d455=new _0xb96947([]);for(const _0x250e0c of _0x30f2f4['changes'])if('removed'!=_0x250e0c['type']&&_0x12d455['children']['push'](_0x250e0c['node']['cloneNode'](!0x0)),'new'!=_0x250e0c['type']){const _0x288902=_0x272a75(_0xdb80d2=>gs(_0xdb80d2,'data-id')==_0x250e0c['id'],_0x3d181b['documentContextContent'],!0x0);_0x515cbf['children']['push'](_0x288902['cloneNode'](!0x0));}if(0x0==_0x515cbf['children']['length']){if(_0x30f2f4['changes'][0x0]['anchorId']){const _0x530f42=_s('data-id',_0x30f2f4['changes'][0x0]['anchorId'],_0x3d181b['documentContextContent']);_0x515cbf['children']['unshift'](_0x530f42['cloneNode'](!0x0)),_0x12d455['children']['unshift'](_0x530f42['cloneNode'](!0x0)),_0x530f42['nextSibling']&&(_0x515cbf['children']['push'](_0x530f42['nextSibling']['cloneNode'](!0x0)),_0x12d455['children']['push'](_0x530f42['nextSibling']['cloneNode'](!0x0)));}else{const _0x59456b=_0x3d181b['documentContextContent']['children'][0x0];if(!_0x59456b)return null;_0x515cbf['children']['push'](_0x59456b['cloneNode'](!0x0)),_0x12d455['children']['push'](_0x59456b['cloneNode'](!0x0));}}const _0x22462e=_0x5dcf5a['getDocumentContext'](),_0x598d94=_0x367c9f['data']['parse'](_0x22462e['content']),_0x19a9f4=ds(_0x515cbf),_0x41716b=_0x367c9f['data']['parse'](_0x19a9f4),_0x39027d=_0x367c9f['data']['parse'](_0x19a9f4),_0x2a7a69=_0x367c9f['model']['createPositionAt'](_0x41716b,0x0),_0x3f7950=ds(_0x12d455),_0x249884={'anchor':_0x2a7a69,'markDeletions':!0x1},_0x3aaa15=_0x367c9f['plugins']['get'](_0x1b3b63)['getDiff'](_0x19a9f4,_0x3f7950,_0x249884)['getOperations']();if(!_0x3aaa15['length'])return null;_0x367c9f['model']['change'](_0x2226e8=>{for(const _0x26b347 of _0x3aaa15)if('remove'==_0x26b347['type']){const _0x22bc3d=_0x26b347['sourcePosition'],_0x5adab9=_0x26b347['howMany'],_0x181138=new _0x15c955(_0x22bc3d,_0x5adab9);_0x2226e8['batch']['addOperation'](_0x181138),_0x367c9f['model']['applyOperation'](_0x181138);}else'marker'!==_0x26b347['type']&&(_0x26b347['baseVersion']=null,_0x26b347['isDocumentOperation']=!0x1,_0x2226e8['batch']['addOperation'](_0x26b347),_0x367c9f['model']['applyOperation'](_0x26b347));});const _0x3936c3=Rs(_0x367c9f,_0x3aaa15,_0x41716b);Os(_0x367c9f['model'],_0x3936c3);const _0x26f833=_0x3936c3['getFirstRange']()['start']['path']['slice'](),_0x5a8231=_0x3936c3['getFirstRange']()['end']['path']['slice'](),_0x3cec5f=[];let _0x115ba9=_0x41716b,_0x4d8d2a=_0x39027d;for(let _0x41c0e9=0x0;_0x41c0e9<_0x5a8231['length'];_0x41c0e9++){const _0x449f18=_0x115ba9['maxOffset']-_0x5a8231[_0x41c0e9];_0x3cec5f[_0x41c0e9]=_0x4d8d2a['maxOffset']-_0x449f18,_0x115ba9=_0x115ba9['getChildAtOffset'](_0x5a8231[_0x41c0e9]),_0x4d8d2a=_0x4d8d2a['getChildAtOffset'](_0x3cec5f[_0x41c0e9]);}const _0x5146b3=_0x367c9f['model']['createRange'](_0x367c9f['model']['createPositionFromPath'](_0x39027d,_0x26f833),_0x367c9f['model']['createPositionFromPath'](_0x39027d,_0x3cec5f)),_0x5a21ae=_0x39027d['getChild'](0x0)['getAttribute'](_0x4068db),_0x230862=Array['from'](_0x598d94['getChildren']())['find'](_0x55b4fd=>_0x55b4fd['getAttribute'](_0x4068db)==_0x5a21ae)['getPath'](),_0xa68793=_0x5146b3['start']['path']['slice'](),_0x51c7bf=_0x5146b3['end']['path']['slice']();_0xa68793[0x0]=_0x230862[0x0]+_0xa68793[0x0],_0x51c7bf[0x0]=_0x230862[0x0]+_0x51c7bf[0x0];let _0x36492a=_0x367c9f['model']['createRange'](_0x367c9f['model']['createPositionFromPath'](_0x367c9f['model']['document']['getRoot'](),_0xa68793),_0x367c9f['model']['createPositionFromPath'](_0x367c9f['model']['document']['getRoot'](),_0x51c7bf));const _0x3ada5b=_0x367c9f['model']['document']['history']['getOperations'](_0x22462e['version']);for(const _0x26e8f9 of _0x3ada5b)_0x36492a=_0x2861aa['_createFromRanges'](_0x36492a['getTransformedByOperation'](_0x26e8f9));return{'range':_0x36492a,'currentIndex':_0x1ad1db};}['_integrateEditor'](_0x4ce7c6){if(_0x4ce7c6['plugins']['has']('Undo')){const _0x519716=_0x4ce7c6['commands']['get']('undo'),_0x593255=_0x4ce7c6['commands']['get']('redo');this['listenTo'](_0x519716,'revert',(_0x48b34c,_0x21ceca,_0x694cf0)=>{const _0x19a931=this['_batchToChanges']['get'](_0x21ceca);if(!_0x19a931)return;const _0x180277=this['activeConversation']['getInteraction'](_0x19a931['interactionId'])['getReply'](_0x19a931['replyId']);_0x19a931['indexes']['forEach'](_0x1651d3=>_0x180277['setChangeGroupState'](_0x1651d3,'pending')),this['_batchToChanges']['delete'](_0x21ceca),this['_batchToChanges']['set'](_0x694cf0,_0x19a931);}),this['listenTo'](_0x593255,'revert',(_0x43aae1,_0x16cb82,_0x14e103)=>{const _0x3bdb14=this['_batchToChanges']['get'](_0x16cb82);if(!_0x3bdb14)return;const _0x2968f4=this['activeConversation']['getInteraction'](_0x3bdb14['interactionId'])['getReply'](_0x3bdb14['replyId']);_0x3bdb14['indexes']['forEach'](_0x32ae37=>_0x2968f4['setChangeGroupState'](_0x32ae37,'accepted')),this['_batchToChanges']['delete'](_0x16cb82),this['_batchToChanges']['set'](_0x14e103,_0x3bdb14);});}const _0x339c27=_0x4ce7c6['config']['get']('ai.chat.context');_0x339c27['alwaysAddSelection']&&_0x339c27['document']['enabled']&&this['listenTo'](_0x4ce7c6['model']['document']['selection'],'change:range',(_0x49a0ea,_0xa3e4f6)=>{if(!_0xa3e4f6['directChange'])return;'chat'===_0x4ce7c6['plugins']['get']('AITabs')['view']['activeTab']&&(_0x4ce7c6['model']['hasContent'](_0x4ce7c6['model']['document']['selection'])?this['addSelectionToChatContext']():this['removeSelectionFromChatContext']());});}async['_getLastCreatedConversationId'](){const _0x1d22d3=this['_aiConnector']['fetchConversations'](this['getGroupId'](),{'limit':0x1,'sortBy':'createdAt'});try{const _0x136359=await _0x1d22d3['getConversations']();return _0x136359['length']?_0x136359[0x0]['id']:'new';}catch(_0x5a1791){return this['_aiChatUi']['addFeedItemError']({'errorMessage':as(this['context']['locale'],'AI_CHAT_UNABLE_TO_LOAD_CONVERSATION'),'id':at()}),this['_logError'](new ot('ai-chat-conversation-init-failed',this,{'error':_0x5a1791})),this['_aiChatUi']['toggleLoadingSkeleton'](!0x1),this['_aiChatUi']['disableControls'](),null;}}async['_startConversationSafely'](_0x2e2748){try{this['_aiChatUi']['enableControls'](),await this['_handleStartConversation'](_0x2e2748);}catch(_0x6f98c8){this['_aiChatUi']['addFeedItemError']({'errorMessage':as(this['context']['locale'],'AI_CHAT_UNABLE_TO_START_CONVERSATION'),'id':_0x2e2748||at()}),console['error'](_0x6f98c8),this['activeConversation']=void 0x0,this['_aiChatUi']['disableControls']();}}async['_handleStartConversation'](_0xf2ce17){let _0x223b9c;this['context']['plugins']['has']('AIChatBalloon')&&this['context']['plugins']['get']('AIChatBalloon')['close'](),_0xf2ce17||!this['activeConversation']?_0x223b9c=this['context']['config']['get']('ai.models.defaultModelId'):this['_aiChatUi']['isModelAvailable']&&(_0x223b9c=this['activeConversation']['selectedModel']['id']),await this['_stopLastInteraction']();const _0x4e1d15=this['getGroupId'](),_0x1c5fd2=_0xf2ce17||at();this['activeConversation']=new Vs({'connector':this['_aiConnector'],'chatModels':this['_aiChatModels'],'selectedModelId':_0x223b9c,'conversationId':_0x1c5fd2,'group':_0x4e1d15,'getEditor':()=>Fs(this['context']),'isFromHistory':!!_0xf2ce17}),this['activeConversation']['delegate']('toolDataReceived','interactionCreated','interactionStarted','replyCreated')['to'](this),this['activeConversation']['on']('conversationInitialized',(_0x532768,_0x50f5ad)=>{this['_aiChatUi']['createConversation'](_0x50f5ad),this['_aiChatUi']['resetMessageInput'](),this['_aiChatUi']['clearPendingContextUI'](),this['_aiChatUi']['clearConversationContextUI'](),_0xf2ce17||(this['_aiChatUi']['resetConversationTitle'](),this['addCurrentDocumentToChatContext']());}),this['activeConversation']['on']('uploadProgressChanged',(_0x302920,_0xa910c9)=>{this['_aiChatUi']['setIsUploadInProgress'](_0xa910c9['isUploadInProgress']);}),this['activeConversation']['on']('webSearchStarted',()=>{const _0x1aa4cd=this['_aiChatUi']['prepareLoadingMessage']({'isWebSearchEnabled':!0x0,'isReasoningEnabled':!0x1});this['_aiChatUi']['setLoadingMessage'](_0x1aa4cd);}),this['activeConversation']['on']('reasoningStarted',()=>{const _0x1bd2af=this['_aiChatUi']['prepareLoadingMessage']({'isWebSearchEnabled':!0x1,'isReasoningEnabled':!0x0});this['_aiChatUi']['setLoadingMessage'](_0x1bd2af);}),this['activeConversation']['on']('webSearchFinished',(_0x2131e9,_0x2d28e9)=>{this['_aiChatUi']['addFeedInteractionHeader'](_0x2d28e9,{'isWebSearchEnabled':!0x0,'isReasoningEnabled':!0x1});}),this['activeConversation']['on']('reasoningFinished',(_0x2bd7d1,_0x3690bc)=>{this['_aiChatUi']['addFeedInteractionHeader'](_0x3690bc,{'isWebSearchEnabled':!0x1,'isReasoningEnabled':!0x0});}),this['activeConversation']['on']('interactionStarted',()=>{this['_aiChatUi']['startInteraction']();}),this['activeConversation']['on']('interactionFinished',async()=>{await this['_aiChatUi']['finishInteraction']();}),this['activeConversation']['on']('interactionDestroyed',(_0x1acdba,_0x41ef2d)=>{this['_aiChatUi']['removeFeedInteraction'](_0x41ef2d['id']);}),this['activeConversation']['on']('setConversationTitle',(_0xdf1687,_0x51e55c,_0xd46f8b)=>{this['_updateConversationTitle'](_0x51e55c,_0xd46f8b);}),this['activeConversation']['on']('replyContentUpdated',async(_0x1c185f,_0x3c7124)=>{await this['_updateReplyContent']({'reply':_0x3c7124});}),this['activeConversation']['on']('replyChangeGroupStateUpdated',(_0x393f06,{reply:_0x55b39d,index:_0x447272,state:_0x26c9be})=>{this['_aiChatUi']['updateFeedItemAIReplySuggestionPartState']({'id':_0x55b39d['id'],'index':_0x447272,'state':_0x26c9be}),this['_currentPreviewedChangeGroup']?.['replyId']['includes'](_0x55b39d['id'])&&this['_currentPreviewedChangeGroup']?.['partIndex']==_0x447272&&this['_aiChatBalloon']?.['setState'](_0x26c9be);}),this['activeConversation']['on']('contextItemAdded',(_0x4d8561,_0x415a17)=>{if(this['_aiChatUi']['addContextItem'](_0x415a17['contextItem'],_0x415a17['isLoading']),'selection'===_0x415a17['contextItem']['type']){const _0x4f06d5=[...Fs(this['context'])['model']['document']['selection']['getRanges']()];this['_aiEditing']['showFakeVisualSelection']({'ranges':_0x4f06d5,'id':'context','priority':0x1});}}),this['activeConversation']['on']('contextItemRemoved',(_0x278d40,_0x5b85d6)=>{this['_aiChatUi']['removeContextItem'](_0x5b85d6['uiId']),'current-document'==_0x5b85d6['uiId']&&this['removeSelectionFromChatContext'](),'selection'===_0x5b85d6['type']&&this['_aiEditing']['hideFakeVisualSelection']('context');}),this['activeConversation']['on']('contextItemLoadingEnded',(_0x155480,_0x4a8305)=>{this['_aiChatUi']['setContextItemLoading'](_0x4a8305['contextItem']['uiId'],_0x4a8305['isLoading']);}),this['activeConversation']['on']('contextSent',(_0x3e71c9,_0x5b5953)=>{this['_aiChatUi']['setConversationContext'](_0x5b5953['contextItems']);}),this['activeConversation']['on']('addContextOptionsChanged',(_0x39e803,_0xa2df44)=>{this['_aiChatUi']['setAddContextOptions'](_0xa2df44['options']);}),this['activeConversation']['on']('sourceResourcesLoaded',(_0x5673ff,_0x5be70c)=>{this['_aiChatUi']['populateSourceResourceBalloon'](_0x5be70c['sourceId'],_0x5be70c['source'],_0x5be70c['resources'],_0x5be70c['uid']);}),this['activeConversation']['on']('resourceStateChanged',(_0x3c16db,_0x191aec)=>{this['_aiChatUi']['updateResourceState'](_0x191aec['sourceId'],_0x191aec['resourceId'],_0x191aec['isInContext']);}),this['activeConversation']['on']('capabilitiesUpdated',(_0x107b5e,_0x491142)=>{this['_aiChatUi']['updateCapabilities'](_0x491142);}),this['activeConversation']['on']('modelSelected',async(_0x2a9de7,_0x50abed)=>{const _0x278e17=(await this['_aiChatModels']['getAll']())['find'](_0x4e78ce=>_0x4e78ce['id']===_0x50abed['selectedModel']?.['id'])||null;this['_aiChatUi']['setSelectedModel'](_0x278e17,_0x50abed['isDisabled']);}),this['activeConversation']['on']('error',(_0x56f289,{error:_0x4802de,interactionId:_0x137796,fileName:_0x1488b3,url:_0x3e6696,sourceId:_0x1ce7e2,sourceLabel:_0x331dc0})=>{const _0xa31c5d=_0x137796?_0x137796+':'+at():at();_0x4802de['message']['startsWith']('ai-request-aborted')?this['_aiChatUi']['addFeedItemStaticMessage']({'staticMessage':as(this['context']['locale'],'AI_CHAT_ABORTED_MESSAGE'),'id':_0xa31c5d}):_0x4802de['message']['startsWith']('ai-chat-conversation-init-failed')||_0x4802de['message']['startsWith']('ai-chat-conversation-start-failed')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':as(this['context']['locale'],'AI_CHAT_UNABLE_TO_START_CONVERSATION'),'id':_0xa31c5d}),this['_logError'](_0x4802de)):_0x4802de['message']['startsWith']('ai-chat-file-upload-failed')?this['_aiChatUi']['addFeedItemError']({'errorMessage':as(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_FILE',_0x1488b3),'id':_0xa31c5d}):_0x4802de['message']['startsWith']('ai-chat-url-upload-failed')?this['_aiChatUi']['addFeedItemError']({'errorMessage':as(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_URL',_0x3e6696),'id':_0xa31c5d}):_0x4802de['message']['startsWith']('ai-chat-context-invalid-data')?this['_aiChatUi']['addFeedItemError']({'errorMessage':as(this['context']['locale'],'AI_CHAT_CONTEXT_INVALID_DATA'),'id':_0xa31c5d}):_0x4802de['message']['startsWith']('ai-chat-context-unsupported-type')?this['_aiChatUi']['addFeedItemError']({'errorMessage':as(this['context']['locale'],'AI_CHAT_CONTEXT_UNSUPPORTED_TYPE'),'id':_0xa31c5d}):_0x4802de['message']['startsWith']('ai-chat-source-resources-load-failed')?(_0x1ce7e2&&this['_aiChatUi']['closeSourceResourceBalloon'](_0x1ce7e2),this['_aiChatUi']['addFeedItemError']({'errorMessage':as(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_LOAD_RESOURCES',_0x331dc0||'source'),'id':_0xa31c5d}),this['_logError'](_0x4802de)):_0x4802de['message']['startsWith']('ai-chat-resource-load-failed')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':as(this['context']['locale'],'AI_CHAT_RESOURCE_LOAD_FAILED'),'id':_0xa31c5d}),this['_logError'](_0x4802de)):_0x4802de['message']['startsWith']('ai-chat-invalid-request')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':as(this['context']['locale'],'AI_CHAT_INVALID_REQUEST'),'id':_0xa31c5d}),this['_logError'](_0x4802de)):_0x4802de['message']['startsWith']('ai-chat-context-unsupported-file-type')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':as(this['context']['locale'],'AI_CHAT_CONTEXT_UNSUPPORTED_FILE_TYPE'),'id':_0xa31c5d}),this['_logError'](_0x4802de)):_0x4802de['message']['startsWith']('ai-chat-context-file-too-large')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':as(this['context']['locale'],'AI_CHAT_CONTEXT_FILE_TOO_LARGE'),'id':_0xa31c5d}),this['_logError'](_0x4802de)):_0x4802de['message']['startsWith']('ai-chat-context-file-too-many-pages')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':as(this['context']['locale'],'AI_CHAT_CONTEXT_FILE_TOO_MANY_PAGES'),'id':_0xa31c5d}),this['_logError'](_0x4802de)):_0x4802de['message']['startsWith']('ai-chat-context-form-data-size-limits-exceeded')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':as(this['context']['locale'],'AI_CHAT_CONTEXT_FORM_DATA_SIZE_LIMITS_EXCEEDED'),'id':_0xa31c5d}),this['_logError'](_0x4802de)):(this['_aiChatUi']['addFeedItemError']({'errorMessage':as(this['context']['locale'],'AI_CHAT_GENERIC_ERROR'),'id':_0xa31c5d}),this['_logError'](_0x4802de));}),await this['activeConversation']['init'](this['context']['config']['get']('ai.chat.context')),_0xf2ce17||await this['activeConversation']['start']();}async['_handleUIUserMessage']({message:_0x40cd5e,attributes:_0x2ac582}){if(!this['activeConversation'])throw new ot('ai-chat-controller-no-active-conversation');if(this['activeConversation']['isCurrentDocumentInContext']()){const _0x2a35a2=await this['_aiEditing']['getDocumentData']();await this['activeConversation']['updateCurrentDocumentInContext'](_0x2a35a2);}this['activeConversation']['id']&&this['activeConversation']['isStarted']&&await this['activeConversation']['handleUserInteraction']({'userMessage':_0x40cd5e,'attributes':_0x2ac582});}['_setIsMaximized'](_0x1d0c2d){this['_aiChatUi']['setIsMaximized'](_0x1d0c2d);}['_logError'](_0x2fa3d0){Et(_0x2fa3d0['message']);}['_removeFromContext'](_0x94add4){this['activeConversation']?.['removeFromContext'](_0x94add4);}['_toggleWebSearch'](){this['activeConversation']?.['toggleWebSearch']();}['_toggleReasoning'](){this['activeConversation']?.['toggleReasoning']();}['getInteractionAndReplyById'](_0x4ade67){const [_0x590fb6,_0x5b0b8c]=_0x4ade67['split'](':'),_0x3e472b=this['activeConversation']['getInteraction'](_0x590fb6),_0x11fd8d=_0x3e472b['getReply'](_0x5b0b8c);return{'interaction':_0x3e472b,'reply':_0x11fd8d};}['_scrollToSuggestionRange'](_0x39c6a3,_0x3dc3f7=!0x1){const _0x3c4348=Fs(this['context']),_0x1b70cb={'target':_0x3c4348['editing']['view']['domConverter']['viewRangeToDom'](_0x3c4348['editing']['mapper']['toViewRange'](_0x39c6a3)),'viewportOffset':{'top':0x96,'left':0x0,'bottom':0x32,'right':0x0},'ancestorOffset':0x14,'alignToTop':_0x3dc3f7};_0x3dc3f7&&(_0x1b70cb['alignToTop']=!0x0),mt(_0x1b70cb);}['_updateConversationTitle'](_0x4e5dd0,_0x685f3e=!0x1){this['_aiChatUi']['setConversationTitle'](_0x4e5dd0||as(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION'),_0x685f3e);}['_addFeedItemReply'](_0x148023){'text'===_0x148023['type']?this['_aiChatUi']['addFeedItemAIReply'](_0x148023):this['_aiChatUi']['addFeedItemAISuggestion'](_0x148023);}async['_updateReplyContent']({reply:_0xeeef1c,renderingStrategy:_0x2665d2}){const {id:_0x4a746f,interactionId:_0x59c311,isDone:_0x39d064,type:_0x3b9e0a,parsedContent:_0xb10046}=_0xeeef1c,_0x23e64b=_0x59c311+':'+_0x4a746f;if('modification'===_0x3b9e0a){const _0x182b5f=_0xeeef1c['getContentParts']({'showDiff':this['_aiChatUi']['showDiff']});await this['_aiChatUi']['updateFeedItemAIReplySuggestionContent']({'id':_0x23e64b,'parts':_0x182b5f,'renderingStrategy':_0x2665d2,'isDone':_0x39d064});}else'text'===_0x3b9e0a&&await this['_aiChatUi']['updateFeedItemAIReplyContent']({'id':_0x23e64b,'parsedContent':_0xb10046,'renderingStrategy':_0x2665d2,'isDone':_0x39d064});_0x39d064&&_0xeeef1c['sources']['length']>0x0&&this['_aiChatUi']['updateFeedItemAIReplySources'](_0x23e64b,_0xeeef1c['sources']);}async['_stopLastInteraction'](){const _0x546d58=this['activeConversation']?.['lastInteraction'];_0x546d58&&(_0x546d58['stop'](),this['_aiChatUi']['stopInteraction'](_0x546d58));}async['_flushLastInteractionUI'](){const _0x4e3aa5=this['activeConversation']?.['lastInteraction'];if(_0x4e3aa5){for await(const _0xde56b6 of _0x4e3aa5['replies'])this['_aiChatUi']['hasFeedItem'](_0xde56b6['id'])||this['_addFeedItemReply'](_0xde56b6),await this['_updateReplyContent']({'reply':_0xde56b6,'renderingStrategy':'static'});}}['_updateRatings'](_0x42464f){const _0x556190={'positiveCount':_0x42464f['changeGroups']['filter'](_0x40543b=>'accepted'===_0x40543b['state'])['length'],'totalCount':_0x42464f['changeGroups']['length'],'modificationId':_0x42464f['id']},_0x38d7a9=this['activeConversation']['getInteraction'](_0x42464f['interactionId'])['messageId'];_0x38d7a9&&this['_aiConnector']['upsertAIChatRating'](this['activeConversation']['id'],_0x38d7a9,_0x556190);}['_getAIChatFeedAPI'](_0x4e9593){const _0x2f732c=this['_aiChatUi'],_0x5665e3=()=>{_0x4e9593['resetWebSearchState'](),_0x4e9593['resetReasoningState'](),_0x2f732c['clearLoadingMessage']();},_0x43696d=()=>{_0x4e9593['currentReply']&&(_0x4e9593['currentReply']['done'](),_0x4e9593['currentReply']=void 0x0);};return{'insertTextReply':(_0x2d9b0f,_0x37800e)=>{_0x43696d(),_0x5665e3();const _0x79e5aa=_0x4e9593['currentReply']=_0x4e9593['createReply']({'type':'text','interactionId':_0x4e9593['id'],'content':_0x2d9b0f,'id':_0x37800e||at()});return _0x43696d(),_0x79e5aa;},'insertCustomElement':async(_0x44bc23,_0x2f13d9)=>(_0x43696d(),_0x5665e3(),_0x2f732c['addFeedItemCustomElement'](_0x44bc23,_0x2f13d9||at())),'setLoadingMessage':_0x2202be=>{_0x2f732c['setLoadingMessage'](_0x2202be);},'clearLoadingMessage':()=>{_0x2f732c['clearLoadingMessage']();}};}}const $s='ai-selection';class qs extends _0x1f4c78{constructor(_0x1b1712){super(_0x1b1712),this['context']['config']['define']('ai.models.showModelSelector',!0x0);}['_outputDataProcessor'];['_fakeSelections']=[];['_sessionId'];static get['pluginName'](){return'AIEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}get['sessionId'](){if(!this['_sessionId']){const _0x2e66f2=Fs(this['context']),_0x5332a7=_0x2e66f2['plugins']['has']('RealTimeCollaborationClient')&&_0x2e66f2['plugins']['get']('RealTimeCollaborationClient')['sessionId'];this['_sessionId']=_0x5332a7||at();}return this['_sessionId'];}async['getDocumentData'](){const _0x12bce8=Fs(this['context']),_0x2dd57a=_0x12bce8['model'],_0x349afb=_0x12bce8['data']['toView'](_0x2dd57a['document']['getRoot'](),{'convertAiChatSelectionMarker':!0x0}),_0x5e73c0=new _0x35d71a(_0x12bce8['editing']['view']['document']);this['_setDataIdsOnChildren'](_0x349afb,_0x5e73c0);let _0x2f12f3=await this['_getDocumentDataStringFromView'](_0x349afb);const _0x1dd462=this['_getMarkersInDocumentOrder'](),_0x4bd531=[];for(const _0x4dbab0 of _0x1dd462){const _0x157865='<'+_0x4dbab0['name']+':start></'+_0x4dbab0['name']+':start>',_0x4361d9=_0x2f12f3['indexOf'](_0x157865);_0x2f12f3=_0x2f12f3['substring'](0x0,_0x4361d9)+_0x2f12f3['substring'](_0x4361d9+_0x157865['length']);const _0x3f5634='<'+_0x4dbab0['name']+':end></'+_0x4dbab0['name']+':end>',_0x20c346=_0x2f12f3['indexOf'](_0x3f5634);_0x2f12f3=_0x2f12f3['substring'](0x0,_0x20c346)+_0x2f12f3['substring'](_0x20c346+_0x3f5634['length']),_0x4bd531['push']({'markerName':_0x4dbab0['name'],'start':_0x4361d9,'end':_0x20c346,'htmlFragment':_0x2f12f3['substring'](_0x4361d9,_0x20c346)});}return{'content':_0x2f12f3,'version':_0x12bce8['model']['document']['version'],'sessionId':this['sessionId'],'selections':_0x4bd531};}async['afterInit'](){this['context']instanceof _0x3ba7d1?this['_integrateEditor'](this['context']):this['listenTo'](this['context']['editors'],'add',(_0x406997,_0x55cc54)=>{_0x55cc54['on']('ready',()=>{this['_integrateEditor'](_0x55cc54);});});}['_setOutputDataProcessor'](_0xf3f718){this['_outputDataProcessor']=_0xf3f718;}async['_getDocumentDataStringFromView'](_0xc2799e){let _0x545a53;const _0x2d80d7=Fs(this['context']);if(this['_outputDataProcessor']){const _0x2ddce3=_0x2d80d7['data']['processor']['domConverter']['viewToDom'](_0xc2799e),_0xbf2903=await this['_outputDataProcessor'](_0x2ddce3);_0x545a53=_0x2d80d7['data']['processor']['htmlWriter']['getHtml'](_0xbf2903);}else _0x545a53=_0x2d80d7['data']['processor']['toData'](_0xc2799e);return _0x545a53;}['_integrateEditor'](_0xe9ea6d){_0xe9ea6d['conversion']['for']('editingDowncast')['markerToHighlight']({'model':$s,'view':({markerName:_0x4ebf6b})=>({'classes':['ck-ai-assistant-ui_theme','ck-fake-ai-selection','ck-fake-ai-selection-'+_0x4ebf6b['split'](':')[0x1]],'priority':0xc})}),_0xe9ea6d['conversion']['for']('dataDowncast')['markerToElement']({'model':$s,'view':(_0xbd6801,{writer:_0x51c865,options:_0x4e4803})=>_0x4e4803['convertAiChatSelectionMarker']?_0x51c865['createUIElement'](_0xbd6801['markerName']+':'+(_0xbd6801['isOpening']?'start':'end')):null});}['showFakeVisualSelection'](_0x1f2d35){const _0xfa3ee6=this['_fakeSelections'][0x0]||null;this['_addFakeSelection'](_0x1f2d35);const _0x1daaa1=this['_fakeSelections'][0x0]||null;this['_refreshFakeSelection'](_0xfa3ee6,_0x1daaa1);}['hideFakeVisualSelection'](_0x8ed6cf){const _0x5de796=this['_fakeSelections'][0x0]||null;this['_removeFakeSelectionById'](_0x8ed6cf);const _0x141cb7=this['_fakeSelections'][0x0]||null;this['_refreshFakeSelection'](_0x5de796,_0x141cb7);}async['modelToDataWithIds'](_0x11f7af){const _0x37d4a0=Fs(this['context']),_0x150f4c=_0x37d4a0['data']['toView'](_0x11f7af),_0x24cb1a=new _0x35d71a(_0x37d4a0['editing']['view']['document']);return this['_setDataIdsOnChildren'](_0x150f4c,_0x24cb1a),this['_getDocumentDataStringFromView'](_0x150f4c);}['_setDataIdsOnChildren'](_0x5c56e3,_0x2ac3fa){let _0xb50d28=!0x1;const _0x41cc8c=new Set();for(const _0x2318fc of _0x5c56e3['getChildren']()){if(!_0x2318fc['is']('view:element'))continue;const _0x1b51c6=_0x2318fc['is']('view:containerElement'),_0x5a417c=_0x2318fc['is']('view:emptyElement'),_0x49ffd8=this['_setDataIdsOnChildren'](_0x2318fc,_0x2ac3fa);if(_0x2318fc['hasAttribute']('data-id')){_0xb50d28=!0x0,_0x41cc8c['add'](_0x2318fc['getAttribute']('data-id'));continue;}(_0x1b51c6||_0x5a417c||_0x49ffd8)&&(_0x2ac3fa['setAttribute']('data-id',this['_nextDataId'](_0x41cc8c),_0x2318fc),_0xb50d28=!0x0);}return _0xb50d28;}['_nextDataId'](_0x1be471){let _0xbcff52;do{_0xbcff52='';for(let _0x2acc1a=0x0;_0x2acc1a<0x4;_0x2acc1a++)_0xbcff52+=String['fromCharCode'](0x61+Math['floor'](0x1a*Math['random']()));}while(_0x1be471['has'](_0xbcff52));return _0x1be471['add'](_0xbcff52),_0xbcff52;}['getSelectionText'](){const {model:_0x2a5361}=Fs(this['context']),_0x37463a=_0x2a5361['document']['selection'],_0x1a09f5=[],_0x31d283=Array['from'](_0x37463a['getRanges']());_0x31d283['sort']((_0x185e28,_0xf743a7)=>_0x185e28['start']['isBefore'](_0xf743a7['start'])?-0x1:0x1);for(const _0x117314 of _0x31d283)for(const _0x20ae6f of _0x117314['getItems']())_0x20ae6f['is']('$textProxy')?_0x1a09f5['push'](_0x20ae6f['data']):_0x20ae6f['is']('element')&&_0x1a09f5['length']>0x0&&'\x20'!==_0x1a09f5[_0x1a09f5['length']-0x1]&&_0x1a09f5['push']('\x20');return _0x1a09f5['length']?'\x22'+_0x1a09f5['join']('')['trim']()+'\x22':as(this['context']['locale'],'AI_CHAT_CONTEXT_DOCUMENT_SELECTION_LABEL');}['_removeFakeSelectionById'](_0x59c0e1){for(let _0x1404da=0x0;_0x1404da<this['_fakeSelections']['length'];_0x1404da++)if(this['_fakeSelections'][_0x1404da]['id']==_0x59c0e1)return void this['_fakeSelections']['splice'](_0x1404da,0x1);}['_addFakeSelection'](_0x36d8c9){this['_removeFakeSelectionById'](_0x36d8c9['id']),Ct(this['_fakeSelections'],_0x36d8c9);}['_refreshFakeSelection'](_0x1a17c4,_0x5e3042){if(_0x1a17c4==_0x5e3042)return;const _0x3c8715=Fs(this['context']),_0x3b3a59=_0x3c8715['model'];_0x3b3a59['change'](_0x2313b7=>{if(_0x1a17c4){const _0x3c03d0=_0x3c8715['model']['markers']['getMarkersGroup']($s);for(const _0x317953 of _0x3c03d0)_0x2313b7['removeMarker'](_0x317953);}if(_0x5e3042)for(let _0x2bd064=0x0;_0x2bd064<_0x5e3042['ranges']['length'];_0x2bd064++){let _0x2b51f5=_0x5e3042['ranges'][_0x2bd064];const _0x34087b=$s+':'+_0x5e3042['id']+':'+_0x2bd064;if(_0x2b51f5['start']['isAtEnd']){const _0x239e1a=_0x2b51f5['start']['getLastMatchingPosition'](({item:_0x5d24fc})=>!_0x3b3a59['schema']['isContent'](_0x5d24fc),{'boundaries':_0x2b51f5});_0x2b51f5=_0x2313b7['createRange'](_0x239e1a,_0x2b51f5['end']);}_0x2313b7['addMarker'](_0x34087b,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x2b51f5});}});}['_getMarkersInDocumentOrder'](){const _0x5a893c=Fs(this['context'])['model'];return Array['from'](_0x5a893c['markers']['getMarkersGroup']($s))['sort']((_0x22c456,_0x7b18d7)=>_0x22c456['getStart']()['isBefore'](_0x7b18d7['getStart']())?-0x1:_0x22c456['getStart']()['isAfter'](_0x7b18d7['getStart']())?0x1:0x0);}}const Qs=['showChangeInText','insertSuggestion','applySuggestion','rejectSuggestion','mouseOverSuggestion','mouseLeaveSuggestion','toggleSuggestionDisplayMode','like','dislike'],Xs=[...Qs,'startConversation','resizeTabs','sendUserMessage','abortPromptStream','addDocumentToContext','addFileToContext','addUrlToContext','executeCustomItemCallback','addResourceToContext','removeContextItem','loadSourceResources','toggleWebSearch','toggleReasoning','selectModel'];class zs{['options'];['isStreaming']=!0x1;['document']=null;['nodesList']=[];['currentIndex']=0x0;['timeoutAbortController']=null;['lastUpdateTime']=0x0;constructor(_0x276836){this['options']={'delay':_0x276836['delay']??0x14,'textNodeStyle':_0x276836['textNodeStyle'],'onStreamUpdate':_0x276836['onStreamUpdate']||(()=>{})};}async['stream']({document:_0x6efb07,targetElement:_0x35c03b,abortSignal:_0x1f84d9}){this['isStreaming']&&this['stop'](),_0x1f84d9?.['addEventListener']('abort',this['stop']['bind'](this)),this['document']=_0x181735(_0x6efb07,!0x0),this['nodesList']=this['getParsedDocumentNodeList'](),this['isStreaming']=!0x0,this['currentIndex']>this['nodesList']['length']&&(this['currentIndex']=this['nodesList']['length']);for(let _0x631cbb=0x0;_0x631cbb<this['currentIndex'];_0x631cbb++)this['nodesList'][_0x631cbb]['shouldBeStreamed']=!0x0;do{const _0x225d34=Date['now'](),_0x5bcdde=this['nodesList'][this['currentIndex']],_0x2ed55b=_0x225d34-this['lastUpdateTime'];if(_0x5bcdde){_0x5bcdde['shouldBeStreamed']=!0x0;let _0x1f04d7=_0x5bcdde['parent'];for(;_0x1f04d7;)_0x1f04d7['shouldBeStreamed']=!0x0,_0x1f04d7=_0x1f04d7['parent'];}if(_0x2ed55b<this['options']['delay'])try{const {promise:_0x15d137,abortController:_0x20f2a1}=tn(this['options']['delay']-_0x2ed55b);this['timeoutAbortController']=_0x20f2a1,await _0x15d137;}catch(_0x302628){return;}_0xb9860b(_0x35c03b,'<'+_0x35c03b['tagName']+'>'+this['renderNode'](this['document'])+'</'+_0x35c03b['tagName']+'>',{'childrenOnly':!0x0}),this['options']['onStreamUpdate']&&this['options']['onStreamUpdate'](),this['currentIndex']++,this['lastUpdateTime']=Date['now']();}while(this['currentIndex']<this['nodesList']['length']);this['currentIndex']=this['nodesList']['length'],this['isStreaming']=!0x1;}['reset'](){this['isStreaming']=!0x1,this['document']=null,this['nodesList']=[],this['currentIndex']=0x0,this['timeoutAbortController']=null;}['cleanUpAnimations']({targetElement:_0x15a895}){Array['from'](_0x15a895['querySelectorAll']('span[data-ck-html-streamer-word-chunk]'))['reverse']()['forEach'](_0x3a8eb7=>{_0x3a8eb7['replaceWith'](_0x3a8eb7['childNodes'][0x0]);});}['stop'](){this['isStreaming']=!0x1,this['timeoutAbortController']&&(this['timeoutAbortController']['abort'](),this['timeoutAbortController']=null);}['renderNode'](_0x3532ea){let _0x1a2008='';if(function(_0xe292e9){return _0x3770f5(_0xe292e9);}(_0x3532ea)){for(const _0x548a1b of _0x3532ea['children'])_0x1a2008+=this['renderNode'](_0x548a1b);}else{if(Zs(_0x3532ea)){if(!_0x3532ea['shouldBeStreamed'])return'';const _0xa8233b=_0x3532ea,_0x267a90=Object['entries'](_0xa8233b['attribs'])['map'](([_0x46c7bb,_0x11334d])=>_0x46c7bb+'=\x22'+_0x11334d+'\x22')['join']('\x20');_0x1a2008+='<'+_0xa8233b['tagName']+(_0x267a90?'\x20'+_0x267a90:'')+'>';for(const _0x4f08b8 of _0x28d1e6(_0xa8233b))_0x1a2008+=this['renderNode'](_0x4f08b8);_0x1a2008+='</'+_0xa8233b['tagName']+'>';}else{if(!Js(_0x3532ea))return'';if(!_0x3532ea['shouldBeStreamed'])return'';!function(_0x322dc3){if(!_0x322dc3['parent']||!Zs(_0x322dc3['parent']))return!0x1;if(!js['includes'](_0x322dc3['parent']['tagName']))return!0x1;return!_0x4e72ee(_0x322dc3)['match'](/^\s*[<>]\s*$/);}(_0x3532ea)?_0x1a2008+=_0x419b49(_0x3532ea):_0x1a2008+=_0x419b49(new ti('span',{'data-ck-html-streamer-word-chunk':'','style':this['options']['textNodeStyle']},[_0x3532ea]));}}return _0x1a2008;}['getParsedDocumentNodeList'](){const _0x1d2701=[];return function(_0x45e3e4,_0x111fb0){const _0x5e42d8=_0x31829f=>{if(_0x111fb0(_0x31829f),_0x31829f instanceof _0xc780ea)for(let _0x5e40db=0x0;_0x5e40db<_0x31829f['children']['length'];_0x5e40db++){const _0x31dda5=_0x31829f['children'][_0x5e40db];_0x5e42d8(_0x31dda5);}};for(let _0x1569be=0x0;_0x1569be<_0x45e3e4['children']['length'];_0x1569be++)_0x5e42d8(_0x45e3e4['children'][_0x1569be]);}(this['document'],_0xbd3adc=>{if(Js(_0xbd3adc)){const _0x30e65d=this['splitTextNodeIntoWordNodes'](_0xbd3adc);_0x30e65d['length']&&_0x1d2701['push'](..._0x30e65d);}_0xbd3adc['isWordSplitSource']||_0xbd3adc['isWordSplitResult']||_0x1d2701['push'](_0xbd3adc);}),_0x1d2701;}['splitTextNodeIntoWordNodes'](_0xa2018){if(_0xa2018['isWordSplitSource']||_0xa2018['isWordSplitResult'])return[];const _0x4dea2c=_0x4e72ee(_0xa2018)['match'](/(?:\s*\S+\s*)/g),_0x2c84a1=[];if(_0x4dea2c&&_0x4dea2c['length']>0x1){for(const _0x51aa8a of _0x4dea2c){const _0x3d9a63=new _0x1c3f7c(_0x51aa8a);_0x3d9a63['isWordSplitResult']=!0x0,_0x5b34ab(_0xa2018,_0x3d9a63),_0x2c84a1['push'](_0x3d9a63);}_0xa2018['isWordSplitSource']=!0x0,_0x411d52(_0xa2018);}return _0x2c84a1;}}const js=['p','li','td','th','span','h1','h2','h3','h4','h5','h6','b','strong','i','em','mark','del','ins','sup','sub','a','code','div'];function Js(_0x474425){return _0x9aa2d(_0x474425);}function Zs(_0x50e2f1){return _0x77ea4b(_0x50e2f1);}function tn(_0x24d4a6){const _0x30761e=new AbortController();return{'promise':new Promise((_0x338db8,_0x355c25)=>{const _0xb5b81c=setTimeout(_0x338db8,_0x24d4a6);_0x30761e['signal']['addEventListener']('abort',()=>{clearTimeout(_0xb5b81c),_0x355c25();});}),'abortController':_0x30761e};}class en extends Nt{['options'];['content']='';['htmlStreamer'];['children'];constructor(_0x545427){super();const _0x2f933f=this['bindTemplate'];this['set']('isDone',!0x1),this['set']('isVisible',!0x0),this['htmlStreamer']=new zs({'textNodeStyle':'animation:\x20ck-html-streamer-fade-in\x20.5s','delay':0x14}),this['options']=_0x545427,this['children']=this['createCollection'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__item',_0x2f933f['if']('isDone','ck-ai-chat__feed__item_done'),_0x2f933f['if']('isVisible','ck-hidden',_0x166b8b=>!_0x166b8b),'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'](_0x2d2fb5=>{_0x2d2fb5['removeAttribute']('data-id');}),this['isDone']=!0x0;}async['streamIntoElement'](_0x38ad68,_0x3ff37b,_0x5113f4){await this['htmlStreamer']['stream']({'document':_0x38ad68,'targetElement':_0x3ff37b,'abortSignal':_0x5113f4});}}class sn extends Nt{['showChangesToggleView'];constructor(_0x4fffa6,_0x5a10dc){super(_0x4fffa6),this['set']('isShowChangesToggleVisible',!0x0),this['showChangesToggleView']=new nn(_0x4fffa6),this['showChangesToggleView']['set']({'class':'ck-ai-suggestion__header__show-changes-toggle\x20ck-ai-chat-controls-button\x20'+cs,'label':as(_0x4fffa6,'AI_SUGGESTION_BUTTON_SHOW_CHANGES'),'withText':!0x0}),this['showChangesToggleView']['isOn']=_0x5a10dc['showDiff'],this['showChangesToggleView']['bind']('isVisible')['to'](this,'isShowChangesToggleVisible'),this['showChangesToggleView']['bind']('icon')['to'](this['showChangesToggleView'],'isOn',_0x457580=>_0x457580?_0x184e17:_0x3428ba),this['showChangesToggleView']['on']('execute',()=>{this['showChangesToggleView']['isOn']=!this['showChangesToggleView']['isOn'],this['fire']('toggleShowChanges',{'isOn':this['showChangesToggleView']['isOn']});});const _0x5524be=new yt();_0x5524be['content']=_0x4db6db,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__header',!0x1===_0x5a10dc['showHeader']?'ck-hidden':null]['filter'](Boolean)},'children':[_0x5524be,{'tag':'span','children':[as(_0x4fffa6,'AI_SUGGESTION_HEADER_TITLE')]},this['showChangesToggleView']]});}}class nn extends kt{['render'](){super['render'](),this['children']['remove'](this['iconView']),this['children']['add'](this['iconView']);}}const rn={'accepted':_0x2080a4,'rejected':_0x1a8f1a,'outdated':_0x1a8f1a};class an extends Nt{['stateIconView'];constructor(_0x36e231){super(_0x36e231);const _0x420b12=this['bindTemplate'];this['set']('state','accepted'),this['set']('isVisible',!0x0),this['stateIconView']=new on(),this['stateIconView']['bind']('state')['to'](this),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__content-part-state',_0x420b12['to']('state',_0x39b603=>'ck-ai-suggestion__content-part-state_'+_0x39b603),_0x420b12['if']('isVisible','ck-hidden',_0x49ad07=>!_0x49ad07)]},'children':[{'tag':'span','attributes':{'class':['ck-ai-suggestion__content-part-state__label']},'children':[{'text':_0x420b12['to']('state',_0x16cf9a=>{switch(_0x16cf9a){case'accepted':return as(_0x36e231,'AI_SUGGESTION_CONTENT_PART_STATE_ACCEPTED');case'rejected':return as(_0x36e231,'AI_SUGGESTION_CONTENT_PART_STATE_REJECTED');case'outdated':return as(_0x36e231,'AI_SUGGESTION_CONTENT_PART_STATE_OUTDATED');}})}]},this['stateIconView']]});}['setState'](_0x185558){this['state']=_0x185558;}}class on extends yt{constructor(){super(),this['set']('state','accepted'),this['content']=rn[this['state']],this['on']('change:state',()=>{this['content']=rn[this['state']];});}}class hn extends Ot{['_applyButton'];['_suggestButton'];constructor(_0x1863d3,_0x2ea84b,_0x3b7b70){super(_0x1863d3);const _0x2a4f0c=Boolean(_0x3b7b70);this['set']('isEnabled',!_0x2a4f0c),this['set']('isVisible',!0x0),this['class']='ck-ai-suggestion-content-part-toolbar';const _0x4fb13c=[];if(_0x2a4f0c){const _0x18c6c3=new kt(_0x1863d3);_0x18c6c3['set']({'label':as(_0x1863d3,'AI_SUGGESTION_DISABLED_TOOLTIP_MESSAGE'),'tooltip':!0x0,'withText':!0x1,'icon':_0x1ccb12}),_0x18c6c3['extendTemplate']({'attributes':{'data-cke-tooltip-class':'ck-ai-suggestion-content-part-disabled-actions-tooltip'}}),_0x4fb13c['push'](_0x18c6c3);}else{_0x2ea84b['includes']('applySuggestion')&&(this['_applyButton']=new kt(_0x1863d3),this['_applyButton']['set']({'label':as(_0x1863d3,'AI_SUGGESTION_CONTENT_PART_APPLY'),'tooltip':!0x0,'tooltipPosition':'n','withText':!0x1,'icon':_0x2080a4}),this['_applyButton']['bind']('isEnabled')['to'](this),this['_applyButton']['on']('execute',()=>{this['fire']('applySuggestion');}),_0x4fb13c['push'](this['_applyButton'])),_0x2ea84b['includes']('insertSuggestion')&&(this['_suggestButton']=new kt(_0x1863d3),this['_suggestButton']['set']({'label':as(_0x1863d3,'AI_SUGGESTION_CONTENT_PART_ADD_SUGGESTION'),'tooltip':!0x0,'tooltipPosition':'n','withText':!0x1,'icon':_0x277d39}),this['_suggestButton']['bind']('isEnabled')['to'](this),this['_suggestButton']['on']('execute',()=>{this['fire']('insertSuggestion');}),_0x4fb13c['push'](this['_suggestButton']));const _0x152451=new kt(_0x1863d3);_0x152451['set']({'label':as(_0x1863d3,'AI_SUGGESTION_CONTENT_PART_REJECT'),'tooltip':!0x0,'tooltipPosition':'n','withText':!0x1,'icon':_0x1a8f1a}),_0x152451['bind']('isEnabled')['to'](this),_0x152451['on']('execute',()=>{this['fire']('rejectSuggestion');}),_0x4fb13c['push'](_0x152451);}this['items']['addMany'](_0x4fb13c);const _0x4f2dfa=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':[_0x4f2dfa['if']('isVisible','ck-hidden',_0x5c7de2=>!_0x5c7de2)]}});}['setButtonsVisibility']({showApplyButton:_0x91ea01,showSuggestButton:_0x10fa8e}){this['_applyButton']&&(this['_applyButton']['isVisible']=_0x91ea01),this['_suggestButton']&&(this['_suggestButton']['isVisible']=_0x10fa8e);}}class cn extends Nt{['toolbarView'];['stateView'];['titleLabelView'];['children'];constructor(_0x10d1fd,{part:_0x241a83,uiIndex:_0x54ae65,availableActions:_0xf90c7c,areActionsDisabled:_0x41266d}){super(_0x10d1fd),this['set']('isEnabled',!0x0),this['set']('state','pending'),this['toolbarView']=new hn(_0x10d1fd,_0xf90c7c,_0x41266d),this['toolbarView']['on']('rejectSuggestion',()=>{this['fire']('rejectSuggestion',{'index':_0x241a83['index']});}),this['toolbarView']['on']('insertSuggestion',()=>{this['fire']('insertSuggestion',{'index':_0x241a83['index']});}),this['toolbarView']['on']('applySuggestion',()=>{this['fire']('applySuggestion',{'index':_0x241a83['index']});}),this['toolbarView']['bind']('isEnabled')['to'](this),this['stateView']=new an(_0x10d1fd),this['titleLabelView']=new ln(_0x10d1fd,_0x54ae65),this['children']=this['createCollection'](),this['children']['addMany']([this['titleLabelView'],this['toolbarView']]),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all-excluded','ck-ai-suggestion__body__content-part__title']},'children':this['children']}),this['on']('change:state',(_0x12eaea,_0x21bd94,_0x1f7eb5,_0x22c592)=>{'pending'===_0x22c592?this['children']['remove'](this['toolbarView']):this['children']['remove'](this['stateView']),'pending'===_0x1f7eb5?this['children']['add'](this['toolbarView']):(this['stateView']['setState'](_0x1f7eb5),this['children']['add'](this['stateView']));});}}class ln extends Nt{constructor(_0x4b886f,_0x51b4a0){super(_0x4b886f),this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-suggestion__body__content-part__title__label']},'children':[as(_0x4b886f,'AI_SUGGESTION_CONTENT_PART_TITLE',_0x51b4a0['toString']())]});}}class un extends Nt{['htmlStreamer'];constructor(_0xb99735){super(_0xb99735),this['htmlStreamer']=new zs({'textNodeStyle':'animation:\x20ck-html-streamer-fade-in\x20.5s','delay':0x14}),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content','ck-reset_all-excluded','ck-ai-suggestion-streamable-content']}});}async['update']({part:_0x3d8005,renderingStrategy:_0x356419,abortSignal:_0x3e7443}){'streaming'===_0x356419?await this['htmlStreamer']['stream']({'document':_0x3d8005['content'],'targetElement':this['element'],'abortSignal':_0x3e7443}):this['element']['innerHTML']=ds(_0x3d8005['content']);}['clear'](){this['htmlStreamer']['reset'](),this['element']['innerHTML']='';}}class dn extends Nt{['_children'];['_headerView'];['_streamableContentView'];constructor(_0x15b58d,{part:_0x3927c9,uiIndex:_0xd2c8d0,areActionsDisabled:_0x335f47,availableActions:_0x25c9e3}){super(_0x15b58d);const _0x3bd198=this['bindTemplate'];this['set']('state','pending'),this['set']('isDone',!0x1),this['set']('isVisible',!0x1),this['set']('isActive',!0x1),this['set']('isEnabled',!0x1);const _0x3aefaf=()=>{this['isEnabled']=this['isDone']&&'pending'==this['state']&&!_0x335f47;};this['on']('change:state',_0x3aefaf),this['on']('change:isDone',_0x3aefaf),_0x3aefaf(),this['_children']=this['createCollection'](),this['_headerView']=new cn(_0x15b58d,{'part':_0x3927c9,'uiIndex':_0xd2c8d0,'availableActions':_0x25c9e3,'areActionsDisabled':_0x335f47}),this['_headerView']['bind']('isEnabled','state')['to'](this),this['_headerView']['delegate'](...Qs)['to'](this),this['_streamableContentView']=new un(_0x15b58d),this['_children']['addMany']([this['_headerView'],this['_streamableContentView']]),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__body__content-part',_0x3bd198['to']('state',_0x1b4622=>'ck-ai-suggestion__body__content-part_'+_0x1b4622),_0x3bd198['if']('isEnabled','ck-ai-suggestion__body__content-part_enabled'),_0x3bd198['if']('isActive','ck-ai-suggestion__body__content-part_active'),_0x3bd198['if']('isVisible','ck-hidden',_0x329da9=>!_0x329da9)]},'children':this['_children'],'on':{'mouseenter':_0x3bd198['to'](()=>{this['isEnabled']&&this['fire']('mouseOverSuggestion',{'index':_0x3927c9['index']});}),'mouseleave':_0x3bd198['to'](()=>{this['isEnabled']&&this['fire']('mouseLeaveSuggestion',{'index':_0x3927c9['index']});}),'click':_0x3bd198['to'](_0x295b26=>{const _0x4b3a7a=_0x295b26['target'];this['isEnabled']&&!this['_headerView']['toolbarView']['element']['contains'](_0x4b3a7a)&&this['fire']('showChangeInText',{'index':_0x3927c9['index']});})}});}async['updateContent']({part:_0x50d240,renderingStrategy:_0x35de74,showUnchangedParts:_0x5cf95e=!0x1,abortSignal:_0x51ee24}){this['partDefinition']=_0x50d240,this['isVisible']=this['partDefinition']['hasChanges']||_0x5cf95e,this['isVisible']&&await this['_streamableContentView']['update']({'part':_0x50d240,'renderingStrategy':_0x35de74,'abortSignal':_0x51ee24});}['markAsDone'](){this['isDone']=!0x0;}}class _n extends pt(){['queue']=[];['isProcessing']=!0x1;['_abortController'];async['enqueue'](_0x16bd7c){const _0x20a1d8=this['createTask'](_0x16bd7c);return this['queue']['push'](_0x20a1d8),this['_processQueue'](),_0x20a1d8['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(_0x4b6c98=>{this['once']('_queueEmpty',()=>{_0x4b6c98();});}):Promise['resolve']();}async['_processQueue'](){if(!this['isProcessing']){this['_abortController']=new AbortController(),this['isProcessing']=!0x0;try{for(;this['queue']['length']&&this['isProcessing'];){const _0x29ba7e=this['queue']['shift']();try{await _0x29ba7e['callback'](this['_abortController']['signal']),_0x29ba7e['resolve']();}catch(_0x355c7d){_0x29ba7e['reject'](_0x355c7d);}}}finally{this['isProcessing']=!0x1,this['_abortController']=void 0x0;}this['fire']('_queueEmpty');}}['createTask'](_0x2c16e0){let _0x5a3018,_0x322010;const _0x369cda=new Promise((_0x4d5749,_0xf9b9d6)=>{_0x5a3018=_0x4d5749,_0x322010=_0xf9b9d6;});return{'callback':_0x2c16e0,'resolve':_0x5a3018,'reject':_0x322010,'completePromise':_0x369cda};}}class An extends en{constructor(_0x1cdda0){super(_0x1cdda0),this['extendTemplate']({'attributes':{'class':['ck-ai-notification','warning'===_0x1cdda0['level']?'ck-ai-notification_warning':'ck-ai-notification_error']}});}['render'](){super['render'](),this['setContent'](this['options']['initialContent']),this['markAsDone']();}['setContent'](_0x31d8e0){this['element']['innerHTML']=_0x31d8e0;}}const gn=['applySuggestion','insertSuggestion'];class In extends Nt{['_applyChangesButton'];['_insertSuggestionsButton'];['children'];constructor(_0x5cbb43,_0x510674=[...gn],_0x58bb6a){super(_0x5cbb43);const _0x242223=this['bindTemplate'],_0x1bb0ce=Boolean(_0x58bb6a);if(this['set']('isEnabled',!_0x1bb0ce),this['set']('isVisible',!0x1),this['set']('isTrackChangesOn',!0x1),this['children']=this['createCollection'](),_0x1bb0ce){const _0x3f1c92=new kt(_0x5cbb43);_0x3f1c92['set']({'label':as(_0x5cbb43,'AI_SUGGESTION_DISABLED_TOOLTIP_MESSAGE'),'tooltip':!0x0,'withText':!0x1,'icon':_0x1ccb12}),_0x3f1c92['extendTemplate']({'attributes':{'data-cke-tooltip-class':'ck-ai-suggestion-content-part-disabled-actions-tooltip'}});const _0x34845d=new Nt(_0x5cbb43);_0x34845d['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-chat__feed__suggestion__actions__info'},'children':[{'tag':'p','children':[as(_0x5cbb43,'AI_SUGGESTION_DISABLED_FEED_MESSAGE'),_0x3f1c92]}]}),this['children']['add'](_0x34845d);}else this['_applyChangesButton']=new kt(_0x5cbb43),this['_applyChangesButton']['set']({'label':as(_0x5cbb43,'AI_CHAT_SUGGESTION_ACTION_APPLY_ALL'),'withText':!0x0,'type':'button','isVisible':_0x510674['includes']('applySuggestion'),'class':os}),this['_insertSuggestionsButton']=new kt(_0x5cbb43),this['_insertSuggestionsButton']['set']({'label':as(_0x5cbb43,'AI_CHAT_SUGGESTION_ACTION_SUGGEST_ALL'),'withText':!0x0,'type':'button','isVisible':_0x510674['includes']('insertSuggestion'),'class':hs}),this['_insertSuggestionsButton']['on']('execute',()=>{this['fire']('insertSuggestion');}),this['_applyChangesButton']['on']('execute',()=>{this['fire']('applySuggestion');}),[this['_applyChangesButton'],this['_insertSuggestionsButton']]['forEach'](_0x4ed6eb=>{_0x4ed6eb['bind']('isEnabled')['to'](this);}),this['children']['addMany']([this['_applyChangesButton'],this['_insertSuggestionsButton']]);this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__ai-suggestion__actions',_0x242223['if']('isVisible','ck-hidden',_0x186925=>!_0x186925)]},'children':this['children']}),this['on']('change:isTrackChangesOn',()=>{this['_applyChangesButton']&&(this['_applyChangesButton']['isVisible']=!this['isTrackChangesOn']);});}['updateVisibility'](_0x3759ed){this['isVisible']=_0x3759ed;}['_switchButtonLabelsPlurality'](_0x149b4b){this['_applyChangesButton']&&this['_insertSuggestionsButton']&&(_0x149b4b?(this['_applyChangesButton']['label']=as(this['locale'],'AI_CHAT_SUGGESTION_ACTION_APPLY_ALL'),this['_insertSuggestionsButton']['label']=as(this['locale'],'AI_CHAT_SUGGESTION_ACTION_SUGGEST_ALL')):(this['_applyChangesButton']['label']=as(this['locale'],'AI_CHAT_SUGGESTION_ACTION_APPLY'),this['_insertSuggestionsButton']['label']=as(this['locale'],'AI_CHAT_SUGGESTION_ACTION_SUGGEST')));}}class En extends Nt{['children'];['balloonPanelView'];['bodyCollection'];constructor(_0x409980,_0x2e175b){super(_0x409980),this['bodyCollection']=_0x2e175b,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',_0x31f36f=>!_0x31f36f)]},'children':this['children']});const _0x5dda5f=new Nt(this['locale']),_0x1b2956=new yt();_0x1b2956['content']=_0x2c4a3f,_0x5dda5f['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-web-sources__header']},'children':[_0x1b2956,{'tag':'span','children':[{'text':as(this['locale'],'AI_CHAT_SOURCES_HEADER')}]}]}),this['children']['add'](_0x5dda5f),this['_setupBalloonPanel'](_0x409980);}['addSource'](_0x411197){this['children']['add'](new Tn(this['locale'],_0x411197,this['balloonPanelView']));}['_setupBalloonPanel'](_0x1129a2){this['balloonPanelView']=new Qt(_0x1129a2),this['balloonPanelView']['extendTemplate']({'attributes':{'class':['ck-ai-web-source__tooltip-balloon']}}),this['bodyCollection']['add'](this['balloonPanelView']);}}class Tn extends kt{['balloonPanelView'];['source'];constructor(_0x1ea765,_0x35c4c5,_0x38a957){super(_0x1ea765),this['source']=_0x35c4c5,this['balloonPanelView']=_0x38a957,this['set']({'label':_0x35c4c5['title'],'class':['ck\x20ck-ai-web-source'],'withText':!0x0});const _0x5726e7=this['bindTemplate'];if(this['extendTemplate']({'on':{'click':_0x5726e7['to'](()=>{window['open'](_0x35c4c5['url'],'_blank');}),'mouseenter':_0x5726e7['to'](()=>{this['_showTooltip']();}),'mouseleave':_0x5726e7['to'](()=>{this['_hideTooltip']();})}}),_0x35c4c5['favicon']){const _0x296ee1=new Nt(_0x1ea765);_0x296ee1['setTemplate']({'tag':'img','attributes':{'src':_0x35c4c5['favicon']||_0x2c4a3f,'alt':_0x35c4c5['title'],'class':['ck-ai-web-source__image']}}),this['children']['add'](_0x296ee1);}else this['set']('icon',_0x2c4a3f);}['_createTooltipContentView'](_0x3c6f09,_0x500771){const _0x1980ea=new Nt(_0x3c6f09),_0xe3ca7a=[];let _0x286636;_0x500771?.['favicon']?(_0x286636=new Nt(_0x3c6f09),_0x286636['setTemplate']({'tag':'img','attributes':{'src':_0x500771['favicon'],'alt':_0x500771['title'],'class':['ck-ai-web-source__tooltip-image']}})):(_0x286636=new yt(),_0x286636['content']=_0x2c4a3f,_0x286636['extendTemplate']({'attributes':{'alt':_0x500771['title'],'class':['ck-ai-web-source__tooltip-image']}})),_0xe3ca7a['push'](_0x286636);const _0xd78114=new Nt(_0x3c6f09);_0xd78114['setTemplate']({'tag':'a','attributes':{'class':['ck-ai-web-source__tooltip-url'],'href':_0x500771['url']},'children':[{'text':new URL(_0x500771['url'])?.['hostname']}]}),_0xe3ca7a['push'](_0xd78114);const _0x50a68e=new Nt(_0x3c6f09);_0x50a68e['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-web-source__tooltip-row']},'children':_0xe3ca7a});const _0x4de54f=new Nt(_0x3c6f09);return _0x4de54f['setTemplate']({'tag':'span','attributes':{'class':['ck-ai-web-source__tooltip-row','ck-ai-web-source__tooltip-title']},'children':[{'text':_0x500771['title']['length']>0x190?_0x500771['title']['substring'](0x0,0x190)+'...':_0x500771['title']}]}),_0x1980ea['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-web-source__tooltip']},'children':[_0x50a68e,_0x4de54f]}),_0x1980ea;}['_showTooltip'](){this['_updateTooltipContent'](),this['balloonPanelView']['pin']({'target':this['element'],'positions':[Qt['defaultPositions']['northArrowSouth'],Qt['defaultPositions']['northArrowSouthWest'],Qt['defaultPositions']['northArrowSouthEast']],'limiter':document['querySelector']('.ck-ai-chat')}),this['balloonPanelView']['show']();}['_hideTooltip'](){this['balloonPanelView']['hide']();}['_updateTooltipContent'](){this['balloonPanelView']['content']['get'](0x0)?.['destroy'](),this['balloonPanelView']['content']['clear']();const _0x5d9972=this['_createTooltipContentView'](this['locale'],this['source']);this['balloonPanelView']['content']['add'](_0x5d9972);}}class pn extends Nt{['_actionsView'];['_sourcesView'];['_children'];['_areActionsDisabled'];['_showUnchangedParts'];['_updateContentPartsPromiseQueue'];['_emptyPartsWarningView'];['_availableActions'];['_cachedContentParts']=[];constructor(_0x8837b3,_0x218c23){super(_0x8837b3);const {areActionsDisabled:_0x2e7f14,showUnchangedParts:_0x32d528,availableActions:_0x2e3e4e}=_0x218c23;this['_areActionsDisabled']=_0x2e7f14,this['_showUnchangedParts']=_0x32d528,this['_availableActions']=_0x2e3e4e,this['set']('hasPendingParts',!0x1),this['set']('isTrackChangesOn',!0x1),this['_children']=this['createCollection'](),this['_updateContentPartsPromiseQueue']=new _n(),this['_emptyPartsWarningView']=new An({'id':'empty-parts-warning','initialContent':as(_0x8837b3,'AI_SUGGESTION_EMPTY_PART_WARNING'),'level':'warning'}),this['_emptyPartsWarningView']['isVisible']=!0x1,this['_actionsView']=new In(_0x8837b3,_0x218c23['availableActions'],this['_areActionsDisabled']),this['_actionsView']['bind']('isTrackChangesOn')['to'](this),this['_sourcesView']=new En(this['locale'],_0x218c23['bodyCollection']),_0x218c23['areActionsDisabled']?this['_actionsView']['isEnabled']=!0x1:this['_actionsView']['bind']('isEnabled')['to'](this,'hasPendingParts'),this['_actionsView']['delegate'](...Qs)['to'](this),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__body']},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__body__content-parts']},'children':this['_children']},this['_emptyPartsWarningView'],this['_actionsView'],this['_sourcesView']]});}get['partsCount'](){return this['_children']['length'];}async['updateContentParts']({parts:_0x56cdfd,renderingStrategy:_0xdb9fdd,abortSignal:_0x1a7188}){this['_children']['length']?_0x56cdfd['forEach'](_0xfd9ec2=>{const _0x339e54=this['_cachedContentParts']['findIndex'](_0x520fa1=>_0x520fa1['index']==_0xfd9ec2['index']);-0x1===_0x339e54?this['_cachedContentParts']['push'](_0xfd9ec2):this['_cachedContentParts'][_0x339e54]=_0xfd9ec2;}):this['_cachedContentParts']=_0x56cdfd;const _0x4f5570=this['_showUnchangedParts']?_0x56cdfd:_0x56cdfd['filter'](_0x4b7698=>_0x4b7698['hasChanges']);this['_actionsView']['_switchButtonLabelsPlurality'](_0x4f5570['length']>0x1);for(const _0x3b9a25 of _0x4f5570)this['_updateContentPartsPromiseQueue']['enqueue'](async _0x26465a=>{let _0x390b7c=this['getPartView'](_0x3b9a25['index']);_0x390b7c||(_0x390b7c=new dn(this['locale'],{'part':_0x3b9a25,'uiIndex':this['_children']['length']+0x1,'areActionsDisabled':this['_areActionsDisabled'],'availableActions':this['_availableActions']}),_0x390b7c['delegate'](...Qs)['to'](this),this['_children']['add'](_0x390b7c),this['hasPendingParts']=!0x0),await _0x390b7c['updateContent']({'part':_0x3b9a25,'renderingStrategy':_0xdb9fdd,'showUnchangedParts':this['_showUnchangedParts'],'abortSignal':_0x26465a}),_0x390b7c['markAsDone']();});return _0x1a7188?.['addEventListener']('abort',()=>{this['_updateContentPartsPromiseQueue']['abort']();}),this['_updateContentPartsPromiseQueue']['queueEmptyPromise'];}['updatePartState'](_0x5a5ff7,_0x26cd97){const _0x15de52=this['getPartView'](_0x5a5ff7);_0x15de52&&(_0x15de52['state']=_0x26cd97),this['hasPendingParts']='pending'==_0x26cd97||Array['from'](this['_children'])['some'](_0x566597=>'pending'==_0x566597['state']);}['setPartActive'](_0x570c55,_0x3d9c64){if(!0x1===_0x570c55){for(const _0x421e4c of this['_children'])_0x421e4c['isActive']=!0x1;}else{const _0x4d3a0d=this['getPartView'](_0x570c55);_0x4d3a0d&&(_0x4d3a0d['isActive']=_0x3d9c64);}}['updateSources'](_0x461ed0){_0x461ed0['forEach'](_0x5e1898=>this['_sourcesView']['addSource'](_0x5e1898)),this['_sourcesView']['isVisible']=!0x0;}['getPartView'](_0x47b9ca){return this['_children']['find'](_0x4a9784=>_0x4a9784['partDefinition']['index']==_0x47b9ca)??null;}['markAsDone'](){if(!this['_showUnchangedParts']){const _0x44f929=!this['_cachedContentParts']['find'](({hasChanges:_0x32ce44})=>_0x32ce44),_0x19b9fc=!!this['_cachedContentParts']['find'](({hasChanges:_0x535e97})=>!_0x535e97);this['_emptyPartsWarningView']['isVisible']=0x0==this['_children']['length']||_0x19b9fc,_0x44f929?this['_emptyPartsWarningView']['setContent'](as(this['locale'],'AI_SUGGESTION_NO_PARTS_WARNING')):this['_emptyPartsWarningView']['setContent'](as(this['locale'],'AI_SUGGESTION_EMPTY_PART_WARNING'));}this['_children']['forEach'](_0x115e65=>_0x115e65['markAsDone']()),this['_actionsView']['updateVisibility'](this['hasNonEmptyParts']);}get['hasNonEmptyParts'](){return this['_children']['filter'](_0x8f2230=>_0x8f2230['partDefinition']['hasChanges'])['length']>0x0;}}class mn extends Nt{['bodyView'];['children'];['headerView'];constructor(_0x34ded8,_0x10050d,_0x196580){super(_0x34ded8);const {showDiff:_0x33557d,areActionsDisabled:_0x597aa0,showUnchangedParts:_0x36b0ea,availableActions:_0x597688}=_0x10050d;this['set']('isTrackChangesOn',!0x1),this['set']('areChangesVisible',!0x1),this['children']=this['createCollection'](),this['headerView']=new sn(_0x34ded8,{'showDiff':_0x33557d}),this['headerView']['on']('toggleShowChanges',(_0x35eb4f,_0x571a38)=>{this['areChangesVisible']=_0x571a38['isOn'],this['fire']('toggleSuggestionDisplayMode',{'showDiff':_0x571a38['isOn']});}),this['children']['add'](this['headerView']),this['bodyView']=new pn(_0x34ded8,{'areActionsDisabled':_0x597aa0,'showUnchangedParts':!!_0x36b0ea,'availableActions':_0x597688,'bodyCollection':_0x196580}),this['bodyView']['delegate'](...Qs)['to'](this),this['bodyView']['bind']('isTrackChangesOn')['to'](this),this['children']['add'](this['bodyView']),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__container','ck-rounded-corners']},'children':this['children']});}async['updateContent'](_0x114969){await this['bodyView']['updateContentParts'](_0x114969);}['updateSources'](_0x19ac10){this['bodyView']['updateSources'](_0x19ac10);}['markAsDone'](){this['bodyView']['markAsDone'](),this['headerView']&&(this['headerView']['isShowChangesToggleVisible']=this['bodyView']['hasNonEmptyParts']);}}class Cn extends en{['containerView'];constructor(_0x183437,_0x207022,_0x203347){super(_0x207022),this['set']('isTrackChangesOn',!0x1),this['containerView']=new mn(_0x183437,{'showDiff':_0x207022['showDiff'],'areActionsDisabled':_0x207022['areActionsDisabled'],'availableActions':_0x207022['availableActions']},_0x203347),this['containerView']['on']('toggleSuggestionDisplayMode',(_0x5baa94,_0x16319a)=>{this['fire']('toggleSuggestionDisplayMode',{'replyId':this['options']['id'],'showDiff':_0x16319a['showDiff']});}),this['containerView']['bind']('isTrackChangesOn')['to'](this),this['containerView']['on']('like',()=>{this['fire']('like',{'replyId':this['options']['id']});}),this['containerView']['on']('dislike',()=>{this['fire']('dislike',{'replyId':this['options']['id']});}),this['containerView']['on']('showChangeInText',(_0x4b3739,{index:_0x422881})=>{this['fire']('showChangeInText',{'replyId':this['options']['id'],'partIndex':_0x422881});}),this['containerView']['on']('applySuggestion',(_0x9e3e89,{index:_0x60007e}={})=>{this['fire']('applySuggestion',{'replyId':this['options']['id'],'partIndex':_0x60007e});}),this['containerView']['on']('insertSuggestion',(_0x1d359b,{index:_0x192fc4}={})=>{this['fire']('insertSuggestion',{'replyId':this['options']['id'],'partIndex':_0x192fc4});}),this['containerView']['on']('rejectSuggestion',(_0xe6cf37,{index:_0x4ea328})=>{this['fire']('rejectSuggestion',{'replyId':this['options']['id'],'partIndex':_0x4ea328});}),this['containerView']['on']('mouseOverSuggestion',(_0x44b07d,{index:_0x59d4aa})=>{this['fire']('mouseOverSuggestion',{'replyId':this['options']['id'],'partIndex':_0x59d4aa});}),this['containerView']['on']('mouseLeaveSuggestion',(_0x54edd9,{index:_0x4447fc})=>{this['fire']('mouseLeaveSuggestion',{'replyId':this['options']['id'],'partIndex':_0x4447fc});}),this['children']['addMany']([this['containerView']]),this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__ai-suggestion']}});}async['updateContent'](_0x2d007e){await this['containerView']['updateContent'](_0x2d007e);}['updatePartState'](_0x2c7bbb,_0x4d25f2){this['containerView']['bodyView']['updatePartState'](_0x2c7bbb,_0x4d25f2);}['setPartActive'](_0x46355c,_0x1d3ebe){!0x1===_0x46355c?this['containerView']['bodyView']['setPartActive'](!0x1):this['containerView']['bodyView']['setPartActive'](_0x46355c,_0x1d3ebe);}['updateSources'](_0x130b11){this['containerView']['updateSources'](_0x130b11);}['getPartView'](_0x201e0d){return this['containerView']['bodyView']['getPartView'](_0x201e0d);}['markAsDone'](){super['markAsDone'](),this['containerView']['markAsDone']();}}class wn extends en{['replyContainer'];['_bodyCollection'];constructor(_0x25ec2d,_0x517231,_0x295a8e){super(_0x517231),this['_bodyCollection']=_0x295a8e,this['locale']=_0x25ec2d,this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__ai-reply']}}),this['replyContainer']=new Nt(),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':us(this['options']['initialContent']),'renderingStrategy':'static'}),this['markAsDone']());}async['updateContent']({parsedContent:_0x42ae0c,renderingStrategy:_0x2af998,abortSignal:_0x127725}){'streaming'===_0x2af998?await this['streamIntoElement'](_0x42ae0c,this['replyContainer']['element'],_0x127725):this['replyContainer']['element']['innerHTML']=_0x419b49(_0x42ae0c);}['updateSources'](_0x3a45a0){const _0x5063be=new En(this['locale'],this['_bodyCollection']);_0x5063be['children']['addMany'](_0x3a45a0['map'](_0x5ac515=>new Tn(this['locale'],_0x5ac515,_0x5063be['balloonPanelView']))),_0x5063be['isVisible']=!0x0,this['children']['add'](_0x5063be);}}class fn extends vt{constructor(_0x5a115e=void 0x0){super();const _0x22c950=_0x5a115e?'ck-ai-spinner_'+_0x5a115e:'';this['extendTemplate']({'tag':'span','attributes':{'class':['ck-ai-spinner',_0x22c950]}});}}const Sn={'file':_0x3c524a,'document':_0x4db6db,'web-resource':_0x54a6e3,'text':_0x3c524a,'selection':_0x2452ef,'mcp-tool-context':_0x4db6db},bn='ck-ai-chat-context-chip',Rn='ck-ai-chat-context-chip_wide',On='ck-ai-chat-context-chip_document',kn='ck-ai-chat-context-chip__label',Nn='ck-ai-chat-context-chip__type-icon',vn='ck-ai-chat-context-controls__chip-tooltip',yn='n';class xn extends kt{constructor(_0x697556,_0x256040,_0x5533e0,_0x29017a,_0x4d9165=!0x1){super(_0x697556),this['_isAnimationOnEnterEnabled']=_0x29017a,this['_initializeProperties'](_0x256040,_0x5533e0,_0x4d9165),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'](_0x112eb7,_0xb86531,_0x41ea30){this['set']('label',_0x112eb7['label']),this['set']('tooltip',!0x0),this['set']('itemType',_0x112eb7['type']),this['set']('id',_0x112eb7['uiId']),this['set']('readonly',_0xb86531),this['set']('isLoading',_0x41ea30);}['_setupTemplate'](){const _0x20bab2=this['_createIconView'](),_0x2be3ea=this['_createRemoveButton'](),_0x15e0fc=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':this['_createTemplateAttributes'](_0x15e0fc),'children':this['_createTemplateChildren'](_0x20bab2,_0x2be3ea,_0x15e0fc)});}['_createTemplateAttributes'](_0x4dc460){return{'class':[bn,_0x4dc460['if']('itemType',On,_0x3acfb1=>'document'==_0x3acfb1),_0x4dc460['if']('itemType',Rn,_0x514f3d=>'selection'==_0x514f3d)],'data-cke-tooltip-text':_0x4dc460['to']('label',Ln),'data-cke-tooltip-position':yn,'data-cke-tooltip-class':vn};}['_createTemplateChildren'](_0x3739b4,_0x59421b,_0x36a723){const _0x17a363=this['_createLabelElement'](_0x36a723),_0x3b4de3=this['_createLoaderIcon']();return this['readonly']?[_0x3739b4,_0x17a363]:[_0x3739b4,_0x3b4de3,_0x17a363,_0x59421b];}['_createLabelElement'](_0x5a3180){return{'tag':'span','attributes':{'class':kn},'children':[{'text':_0x5a3180['to']('label')}]};}['_createRemoveButton'](){const _0x1e7a1a=new kt(this['locale']);return _0x1e7a1a['set']({'label':as(this['locale'],'AI_CHAT_CONTEXT_REMOVE_FROM_CONTEXT'),'icon':_0x52715b}),this['_setupRemoveButtonEvent'](_0x1e7a1a),_0x1e7a1a;}['_setupRemoveButtonEvent'](_0x2eb97d){_0x2eb97d['on']('execute',()=>{this['fire']('removeContextItemChip',this['id']);});}['_createIconView'](){const _0x490353=this['bindTemplate'],_0x1a9b4b=new yt();return _0x1a9b4b['content']=Sn[this['itemType']],_0x1a9b4b['extendTemplate']({'attributes':{'class':[Nn,_0x490353['if']('isLoading','ck-hidden',_0x3f5457=>_0x3f5457)]}}),_0x1a9b4b;}['_handleAnimationEndOnce'](_0x2530cc,_0x586511){if(!_0x2530cc)return;const _0x325642=()=>{_0x586511(),_0x2530cc['removeEventListener']('animationend',_0x325642),_0x2530cc['removeEventListener']('webkitAnimationEnd',_0x325642);};_0x2530cc['addEventListener']('animationend',_0x325642),_0x2530cc['addEventListener']('webkitAnimationEnd',_0x325642);}['_createLoaderIcon'](){const _0x4bdfbc=new fn('small');return _0x4bdfbc['bind']('isVisible')['to'](this,'isLoading',_0x2d596a=>_0x2d596a),_0x4bdfbc;}}function Ln(_0x26aa1a){if(!_0x26aa1a)return _0x26aa1a;if(_0x26aa1a['length']<=0x78)return _0x26aa1a;const _0x5c832d=_0x26aa1a['slice'](0x0,0x78),_0x5e0eed=_0x5c832d['lastIndexOf']('\x20');return(_0x5e0eed>0x0?_0x5c832d['slice'](0x0,_0x5e0eed):_0x5c832d)+'…';}const Dn={'maxVisibleRows':0x2,'rowDetectionTolerance':0x5,'showMoreLabelPrefix':'+\x20','viewportOffset':{'top':0x64,'bottom':0xa}},Pn='300px';class Hn{['_locale'];['_config'];['_visibleChips'];['_overflowChips'];['_showMoreButtonView']=null;['_showMoreBalloonPanelView']=null;['_containerElement']=null;['_bodyCollection'];['_parentView']=null;['_intersectionObserver']=null;['_pendingCalculation']=!0x1;constructor(_0x5873ef,_0x41ba69,_0x3aa9e5,_0x19ce97,_0x26c77d){this['_locale']=_0x5873ef,this['_visibleChips']=_0x41ba69,this['_config']={...Dn,..._0x3aa9e5,'cssClasses':{'controlsButton':'','calculationContainer':'ck-calculation-container',..._0x3aa9e5['cssClasses']}},this['_overflowChips']=new dt(),this['_bodyCollection']=_0x19ce97,this['_parentView']=_0x26c77d||null;}['setContainerElement'](_0x2abe85){this['_intersectionObserver']&&(this['_intersectionObserver']['disconnect'](),this['_intersectionObserver']=null),this['_containerElement']=_0x2abe85,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 _0x3b7e68=[...this['_visibleChips'],...this['_overflowChips']],_0x880efa=this['_createCalculationContainer'](),_0x20ccd6=this['_calculateOverflowInContainer'](_0x880efa,_0x3b7e68),_0x39c0c5=_0x880efa['_ancestorsToRestore'];_0x39c0c5&&this['_restoreAncestorVisibility'](_0x39c0c5),_0x880efa['remove'](),this['_applyOverflowResults'](_0x3b7e68,_0x20ccd6);}['_createShowMoreButton'](){this['_showMoreButtonView']=this['_createShowMoreButtonView'](),this['_showMoreBalloonPanelView']=this['_createShowMoreBalloonPanelView'](),this['_showMoreButtonView']['render'](),this['_containerElement']['appendChild'](this['_showMoreButtonView']['element']),this['_showMoreButtonView']['on']('execute',()=>{this['_handleShowMoreButtonClick']();}),Xt({'emitter':this['_showMoreBalloonPanelView'],'contextElements':[this['_showMoreBalloonPanelView']['element'],this['_showMoreButtonView']['element']],'callback':()=>this['hideBalloonPanel'](),'activator':()=>this['_showMoreButtonView']['isOn']});}['_createShowMoreButtonView'](){const _0x1509ae=new kt(this['_locale']);_0x1509ae['set']({'label':'','withText':!0x0,'isToggleable':!0x0});const _0x33cb36=[this['_config']['cssClasses']['showMoreButton']];return this['_config']['cssClasses']['controlsButton']&&_0x33cb36['push'](this['_config']['cssClasses']['controlsButton']),_0x1509ae['extendTemplate']({'attributes':{'class':_0x33cb36}}),_0x1509ae;}['_createShowMoreBalloonPanelView'](){const _0x2f35f6=new Qt(this['_locale']);return _0x2f35f6['extendTemplate']({'attributes':{'class':this['_config']['cssClasses']['showMoreBalloon']}}),this['_bodyCollection']['add'](_0x2f35f6),_0x2f35f6;}['_updateBalloonContent'](){if(this['_showMoreBalloonPanelView']&&(this['_showMoreBalloonPanelView']['content']['clear'](),this['_overflowChips']['length']>0x0)){this['_overflowChips']['forEach'](_0x5b994b=>{_0x5b994b['disableAnimationOnEnter']();});const _0x5e5b28=new Nt(this['_locale']);_0x5e5b28['setTemplate']({'tag':'div','attributes':{'class':this['_config']['cssClasses']['overflowContainer']},'children':this['_overflowChips']}),this['_showMoreBalloonPanelView']['content']['add'](_0x5e5b28);}}['_handleShowMoreButtonClick'](){this['_showMoreButtonView']['isOn']?this['hideBalloonPanel']():this['showBalloonPanel']();}['_updateShowMoreButtonVisibility'](){const _0xdcdd78=this['_overflowChips']['length']>0x0;this['_showMoreButtonView']?.['element']&&(this['_showMoreButtonView']['element']['style']['display']=_0xdcdd78?'':'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'](_0xd1e3a5){const _0x4570b0=this['_containerElement']?.['tagName']['toLowerCase']()||'div',_0x2be7e6=this['_containerElement']?.['classList'];if(_0x2be7e6){const _0x232fe2=_0x2be7e6[0x0]||'',_0x96aa8f=_0xd1e3a5['querySelector']('.'+_0x232fe2),_0x295e55=_0xd1e3a5['querySelector'](_0x4570b0);return _0x96aa8f||_0x295e55||_0xd1e3a5;}return _0xd1e3a5['querySelector'](_0x4570b0)||_0xd1e3a5;}['_calculateContainerWidth'](){const _0x19a608=this['_parentView']?.['element']||this['_containerElement'];if(!_0x19a608)return Pn;const _0x3b3ef8=window['getComputedStyle'](_0x19a608)['width'];if('auto'===_0x3b3ef8||'0px'===_0x3b3ef8||!_0x3b3ef8){const _0x55298d=_0x19a608['parentElement'];if(_0x55298d){const _0x2ef746=window['getComputedStyle'](_0x55298d);return'auto'!==_0x2ef746['width']?_0x2ef746['width']:Pn;}return Pn;}return _0x3b3ef8;}['_applyCalculationStyles'](_0x4268b7,_0x3c241b){this['_config']['cssClasses']['calculationContainer']&&_0x4268b7['classList']['add'](this['_config']['cssClasses']['calculationContainer']),_0x4268b7['style']['width']=_0x3c241b,_0x4268b7['style']['position']='absolute',_0x4268b7['style']['top']='-9999px',_0x4268b7['style']['left']='-9999px',_0x4268b7['style']['opacity']='0',_0x4268b7['style']['pointerEvents']='none',_0x4268b7['style']['zIndex']='-1',_0x4268b7['style']['visibility']='visible\x20!important',_0x4268b7['style']['display']='block\x20!important',_0x4268b7['style']['boxSizing']='border-box';}['_restoreAncestorVisibility'](_0x4ea3d4){_0x4ea3d4['forEach'](({element:_0x21660b,originalDisplay:_0x2f28f9,originalVisibility:_0x527c85})=>{_0x21660b['style']['display']=_0x2f28f9,_0x21660b['style']['visibility']=_0x527c85;});}['_makeAncestorsVisible'](_0x40c22d){const _0x4ac913=[];let _0xa5710e=_0x40c22d;for(;_0xa5710e&&_0xa5710e!==document['body'];){const _0x1cc3df=window['getComputedStyle'](_0xa5710e);'none'!==_0x1cc3df['display']&&'hidden'!==_0x1cc3df['visibility']||(_0x4ac913['push']({'element':_0xa5710e,'originalDisplay':_0xa5710e['style']['display'],'originalVisibility':_0xa5710e['style']['visibility']}),_0xa5710e['style']['display']='block',_0xa5710e['style']['visibility']='visible'),_0xa5710e=_0xa5710e['parentElement'];}return _0x4ac913;}['_createContainerElements'](){let _0x25a4c3,_0x4ea0ee;return this['_parentView']?.['element']?(_0x25a4c3=this['_parentView']['element']['cloneNode'](!0x0),_0x4ea0ee=this['_findTargetContainer'](_0x25a4c3)):(_0x25a4c3=document['createElement']('div'),_0x4ea0ee=_0x25a4c3),{'calculationContainer':_0x25a4c3,'targetContainer':_0x4ea0ee};}['_createCalculationContainer'](){const {calculationContainer:_0x28ad80,targetContainer:_0x38adc0}=this['_createContainerElements'](),_0xa91eee=this['_calculateContainerWidth']();this['_applyCalculationStyles'](_0x28ad80,_0xa91eee);const _0x4941b1=this['_parentView']?.['element']||this['_containerElement'],_0x372407=_0x4941b1?.['parentElement'];_0x372407?_0x372407['appendChild'](_0x28ad80):document['body']['appendChild'](_0x28ad80),_0x28ad80['_targetContainer']=_0x38adc0;const _0x5737ff=this['_makeAncestorsVisible'](_0x372407||null);return _0x28ad80['offsetWidth'],_0x28ad80['_ancestorsToRestore']=_0x5737ff,_0x28ad80;}['_calculateOverflowInContainer'](_0x44c4ab,_0x5cbdd9){const _0x3196d8=_0x44c4ab['_targetContainer']||_0x44c4ab,_0xca2526=[],{rowCount:_0x557d79}=this['_renderChipsAndCountRows'](_0x3196d8,_0x5cbdd9);if(_0x557d79<=this['_config']['maxVisibleRows'])return _0xca2526;const _0x297ed9=_0x5cbdd9['slice']();for(;_0x297ed9['length']>0x0;){if(this['_testButtonFit'](_0x44c4ab,_0x3196d8,_0x297ed9)){const _0x1c9968=_0x5cbdd9['filter'](_0x493aa1=>!_0x297ed9['includes'](_0x493aa1));_0xca2526['push'](..._0x1c9968);break;}if(!_0x297ed9['pop']())break;}return _0xca2526;}['_renderChipsAndCountRows'](_0xe4a15b,_0x41d95c){_0xe4a15b['innerHTML']='',_0x41d95c['forEach'](_0x492289=>{if(_0x492289['element']){const _0x38f571=_0x492289['element']['cloneNode'](!0x0);_0xe4a15b['appendChild'](_0x38f571);}}),_0xe4a15b['offsetWidth'];const _0xe2338c=_0xe4a15b['children'],_0x1e115b=[];return Array['from'](_0xe2338c)['forEach'](_0x2cbf4b=>{const _0x423d7b=_0x2cbf4b['getBoundingClientRect']()['top'];_0x1e115b['some'](_0x1a9a7d=>Math['abs'](_0x1a9a7d-_0x423d7b)<this['_config']['rowDetectionTolerance'])||_0x1e115b['push'](_0x423d7b);}),{'rowCount':_0x1e115b['length']};}['_createMockButton'](){const _0x33deea=document['createElement']('button');return _0x33deea['className']=this['_config']['cssClasses']['showMoreButton'],this['_config']['cssClasses']['controlsButton']&&_0x33deea['classList']['add'](this['_config']['cssClasses']['controlsButton']),_0x33deea['textContent']='+\x201',_0x33deea;}['_testButtonFit'](_0x2a04fc,_0x4cd6f8,_0x4a32f2){this['_renderChipsAndCountRows'](_0x4cd6f8,_0x4a32f2);const _0x26a793=this['_createMockButton']();_0x2a04fc['appendChild'](_0x26a793),_0x2a04fc['offsetWidth'];const _0x1c8500=[..._0x4cd6f8['children'],_0x26a793],_0x1e603e=[];_0x1c8500['forEach'](_0x5406da=>{const _0x1a7bb9=_0x5406da['getBoundingClientRect']()['top'];_0x1e603e['some'](_0x3e6d68=>Math['abs'](_0x3e6d68-_0x1a7bb9)<this['_config']['rowDetectionTolerance'])||_0x1e603e['push'](_0x1a7bb9);});const _0x4b4c22=_0x1e603e['length'];return _0x26a793['remove'](),_0x4b4c22<=this['_config']['maxVisibleRows'];}['_distributeChips'](_0x14778a,_0x3b9f1e){this['_visibleChips']['clear'](),this['_overflowChips']['clear'](),_0x14778a['forEach'](_0x385fc8=>{_0x3b9f1e['includes'](_0x385fc8)?this['_overflowChips']['add'](_0x385fc8):this['_visibleChips']['add'](_0x385fc8);});}['_updateOverflowUI'](_0x21f882){if(_0x21f882>0x0&&!this['_showMoreButtonView']&&this['_createShowMoreButton'](),_0x21f882>0x0&&this['_showMoreButtonView']){const _0x15dba7=''+this['_config']['showMoreLabelPrefix']+(_0x21f882<0x63?_0x21f882:'99');this['_showMoreButtonView']['label']=_0x15dba7;}this['_updateBalloonContent'](),this['_updateShowMoreButtonVisibility'](),this['_repinBalloonPanel']();}['_applyOverflowResults'](_0x561e5e,_0x375cd9){this['_distributeChips'](_0x561e5e,_0x375cd9),this['_updateOverflowUI'](_0x375cd9['length']);}['_setupVisibilityObserver'](){this['_containerElement']&&'undefined'!=typeof IntersectionObserver&&(this['_intersectionObserver']=new IntersectionObserver(_0x2fd1b0=>{_0x2fd1b0[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 _0x7c1c70=this['_containerElement']['getBoundingClientRect']();if(0x0===_0x7c1c70['width']||0x0===_0x7c1c70['height'])return!0x1;const _0x5e10c3=window['innerHeight']||document['documentElement']['clientHeight'],_0x1a9a27=window['innerWidth']||document['documentElement']['clientWidth'],_0x4b0645=0xc8;return _0x7c1c70['bottom']>=-0xc8&&_0x7c1c70['top']<=_0x5e10c3+_0x4b0645&&_0x7c1c70['right']>=-0xc8&&_0x7c1c70['left']<=_0x1a9a27+_0x4b0645;}}const Mn='ck-ai-chat__feed__context-chips',Un='ck-ai-chat-context-chips-wrapper',Vn='ck-ai-chat-context-chips-wrapper-balloon',Bn='ck-ai-chat-controls-button',Gn='ck-ai-chat-controls_context_show-more-button',Fn='ck-ai-chat-context-controls__show-more-balloon-panel';class Kn extends Nt{['_contextChips']=this['createCollection']();['_overflowManager'];['_bodyCollection'];constructor(_0xb3a292,_0x1cb07f,_0x36ff7e){super(_0xb3a292),this['_bodyCollection']=_0x36ff7e,this['_createContextChips'](_0x1cb07f);const _0xce53ec={'cssClasses':{'showMoreButton':Gn+'\x20'+cs,'showMoreBalloon':Fn,'overflowContainer':Vn,'controlsButton':Bn}};this['_overflowManager']=new Hn(_0xb3a292,this['_contextChips'],_0xce53ec,this['_bodyCollection'],this),this['setTemplate']({'tag':'div','attributes':{'class':[Mn,'ck','ck-reset_all']},'children':[{'tag':'div','attributes':{'class':Un},'children':this['_contextChips']}]});}['render'](){super['render']();const _0x180035=this['element']['querySelector']('.'+Un);_0x180035&&(this['_overflowManager']['setContainerElement'](_0x180035),this['_overflowManager']['reorganizeChips']());}['destroy'](){super['destroy'](),this['_overflowManager']['destroy']();}['_createContextChips'](_0x2dc77c){for(const _0x38f7b4 of _0x2dc77c){const _0xe9dde4=new xn(this['locale'],_0x38f7b4,!0x0,!0x1);this['_contextChips']['add'](_0xe9dde4);}}}class Wn extends en{['_contextChipsView']=null;['_locale'];['_bodyCollection'];['_messageContentView'];constructor(_0x287793,_0xfa168a,_0x527244){super(_0xfa168a),this['_locale']=_0x287793,this['_bodyCollection']=_0x527244,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 Kn(this['_locale'],this['options']['contextItems']['filter'](_0x571c08=>!_0x571c08['hidden']),this['_bodyCollection']),this['_contextChipsView']['extendTemplate']({'attributes':{'class':'ck-ai-chat__feed__context-chips'}}),this['children']['add'](this['_contextChipsView']));}['_createMessageContentView'](){this['_messageContentView']=new Nt(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 Yn extends en{['capabilities'];constructor(_0x3273da,_0x1e5ffc){super(_0x1e5ffc);const {isWebSearchEnabled:_0x5059e4,isReasoningEnabled:_0x1eddd1}=_0x1e5ffc['capabilities'],_0x127bc1=[];let _0x29d522='';_0x5059e4&&_0x1eddd1?(_0x29d522=as(_0x3273da,'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH_REASONING'),_0x127bc1['push']($n(_0x2c4a3f)),_0x127bc1['push']($n(_0x3cc08a))):_0x5059e4?(_0x29d522=as(_0x3273da,'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH'),_0x127bc1['push']($n(_0x2c4a3f))):_0x1eddd1&&(_0x29d522=as(_0x3273da,'AI_CHAT_FEED_REPLY_ITEM_USED_REASONING'),_0x127bc1['push']($n(_0x3cc08a))),this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__interaction-header',_0x29d522?'':'ck-hidden']}});const _0x59394a=new Nt();_0x59394a['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__interaction-header__capabilities']},'children':[..._0x127bc1,{'tag':'span','attributes':{'class':['ck-ai-chat__feed__interaction-header__capabilities__text']},'children':[_0x29d522]}]}),this['children']['add'](_0x59394a),this['capabilities']=_0x1e5ffc['capabilities'];}}function $n(_0x14125b){const _0x1a337b=new yt();return _0x1a337b['content']=_0x14125b,_0x1a337b;}const qn=['wheel','touchstart','pointerdown','keydown'],Qn=['ArrowUp','ArrowDown','PageUp','PageDown','Home','End','\x20'];class Xn{['element'];['animationFrameId'];['isRunning'];['abortController'];['isUserPaused'];constructor(_0x15b74b){this['element']=_0x15b74b,this['animationFrameId']=null,this['isRunning']=!0x1,this['abortController']=new AbortController(),this['isUserPaused']=!0x1;for(const _0x14bb2c of qn){const _0x1ad790='keydown'!==_0x14bb2c;this['element']['addEventListener'](_0x14bb2c,this['_onUserEvent']['bind'](this),{'passive':_0x1ad790,'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'](_0x2428c0){if(this['isRunning']){if('keydown'===_0x2428c0['type']){const _0x4aad9c=_0x2428c0['key'];if(!Qn['includes'](_0x4aad9c))return;}_0x2428c0 instanceof WheelEvent?_0x2428c0['deltaY']<0x0?this['isUserPaused']=!0x0:this['isUserPaused']=!this['_isAtBottom']():this['isUserPaused']=!0x0;}}['_isAtBottom'](){const {scrollTop:_0x1ff757,scrollHeight:_0x7d2889,clientHeight:_0x6d5f81}=this['element'];return _0x7d2889-_0x1ff757-_0x6d5f81<=0x5;}['_rafUpdate'](){this['isRunning']&&(this['isUserPaused']||this['element']['scrollTo']({'top':this['element']['scrollHeight'],'behavior':'auto'}),this['animationFrameId']=requestAnimationFrame(this['_rafUpdate']['bind'](this)));}}class zn extends Nt{constructor(_0x4200ba,_0x5dd7f0){super(_0x4200ba),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-skeleton']},'children':this['_createSkeletonItems'](_0x5dd7f0)});}['_createSkeletonItems'](_0xd3e2e3){const _0x11fd34=['ck','ck-ai-skeleton__item'];return _0xd3e2e3['map'](_0x18c5a9=>{let _0x52aeb0='';switch(_0x18c5a9['attributes']['align']){case'right':_0x52aeb0='margin-left:\x20auto;\x20margin-right:\x200;\x20text-align:\x20right;';break;case'center':_0x52aeb0='margin-left:\x20auto;\x20margin-right:\x20auto;\x20text-align:\x20center;';break;case'left':_0x52aeb0='margin-left:\x200;\x20margin-right:\x20auto;\x20text-align:\x20left;';}return{'tag':_0x18c5a9['tag'],'attributes':{'class':[..._0x11fd34,_0x18c5a9['attributes']['class']?_0x18c5a9['attributes']['class']:''],'style':'width:\x20'+_0x18c5a9['attributes']['width']+';\x20height:\x20'+_0x18c5a9['attributes']['height']+';'+_0x52aeb0}};});}}const jn={'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':Jn(0x5,'100%','44px','right'),'aiChatResources':Jn(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 Jn(_0x219580,_0x178b56,_0x1600e5,_0x89d4c3){return new Array(_0x219580)['fill'](null)['map'](()=>({'tag':'div','attributes':{'width':_0x178b56,'height':_0x1600e5,'align':_0x89d4c3}}));}class Zn extends en{constructor(_0x3739ca){super(_0x3739ca),this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__custom-element']}});}async['render'](){super['render'](),'string'==typeof this['options']['content']?this['element']['innerHTML']=this['options']['content']:this['element']['appendChild'](this['options']['content']);}}class tr extends Nt{['children'];['scrollManager'];['_bodyCollection'];constructor(_0x11a342,_0x4740b2){super(_0x11a342),this['_bodyCollection']=_0x4740b2,this['set']('isPending',!0x1),this['set']('loadingMessage',''),this['set']('isLoadingSkeletonVisible',!0x1),this['set']('isTrackChangesOn',!0x1),this['children']=this['createCollection'](),this['children']['delegate'](...Xs)['to'](this),this['_setupTemplate']();}['render'](){super['render'](),this['scrollManager']=new Xn(this['element']);}['destroy'](){super['destroy'](),this['scrollManager']['destroy']();}['clear'](){this['children']['clear']();}['addItem'](_0x3789ad,_0x281b99){let _0x50abef;return'ai-reply'===_0x3789ad?_0x50abef=new wn(this['locale'],_0x281b99,this['_bodyCollection']):'ai-suggestion-reply'===_0x3789ad?(_0x50abef=new Cn(this['locale'],_0x281b99,this['_bodyCollection']),_0x50abef['bind']('isTrackChangesOn')['to'](this)):_0x50abef='user-message'===_0x3789ad?new Wn(this['locale'],_0x281b99,this['_bodyCollection']):'interaction-header'===_0x3789ad?new Yn(this['locale'],_0x281b99):'custom-element'===_0x3789ad?new Zn(_0x281b99):new An(_0x281b99),this['children']['add'](_0x50abef),_0x50abef;}async['updateReplyItem']({id:_0x415ac5,parsedContent:_0x1d84aa,renderingStrategy:_0x12823e,abortSignal:_0x47ca72}){const _0x4961a2=this['getItemById'](_0x415ac5);if(!(_0x4961a2 instanceof wn))throw new ot('ai-chat-feed-view-item-not-a-reply-item',null,{'itemView':_0x4961a2,'id':_0x415ac5,'parsedContent':_0x1d84aa});await _0x4961a2['updateContent']({'parsedContent':_0x1d84aa,'renderingStrategy':_0x12823e,'abortSignal':_0x47ca72});}async['updateWebSources'](_0x3198e8,_0x45f7f2){const _0x1a098a=this['getItemById'](_0x3198e8);if(_0x1a098a instanceof Cn)_0x1a098a['updateSources'](_0x45f7f2);else{if(!(_0x1a098a instanceof wn))throw new ot('ai-chat-feed-view-item-not-a-suggestion-or-reply-item',null,{'itemView':_0x1a098a,'id':_0x3198e8,'sources':_0x45f7f2});_0x1a098a['updateSources'](_0x45f7f2);}}async['updateSuggestionItem']({id:_0x3a3353,parts:_0x18f19d,renderingStrategy:_0x4d9daf,abortSignal:_0x190d42}){const _0x1c35d6=this['getItemById'](_0x3a3353);if(!(_0x1c35d6 instanceof Cn))throw new ot('ai-chat-feed-view-item-not-a-suggestion-item',null,{'itemView':_0x1c35d6,'id':_0x3a3353,'parts':_0x18f19d});await _0x1c35d6['updateContent']({'parts':_0x18f19d,'renderingStrategy':_0x4d9daf,'abortSignal':_0x190d42});}['updateSuggestionPartState']({id:_0x529211,index:_0x3f6cc4,state:_0x5dd8fc}){const _0x2abdee=this['getItemById'](_0x529211);if(!(_0x2abdee instanceof Cn))throw new ot('ai-chat-feed-view-item-not-a-suggestion-item',this,{'id':_0x529211});_0x2abdee['updatePartState'](_0x3f6cc4,_0x5dd8fc);}['setSuggestionPartActive']({id:_0x1bb700,index:_0x2f7402,isActive:_0x89594}){const _0x57f804=this['getItemById'](_0x1bb700);if(!(_0x57f804 instanceof Cn))throw new ot('ai-chat-feed-view-item-not-a-suggestion-item',this,{'id':_0x1bb700});this['children']['filter'](_0x3a5e77=>_0x3a5e77 instanceof Cn)['forEach'](_0x303142=>{_0x303142['setPartActive'](!0x1);}),_0x57f804['setPartActive'](_0x2f7402,_0x89594);}['markItemAsDone'](_0x4c17e7){this['getItemById'](_0x4c17e7)['markAsDone']();}['getItemIds'](){return this['children']['map'](_0x4c82df=>_0x4c82df['options']['id']);}['removeItem'](_0x51b5b3){this['children']['remove'](this['getItemById'](_0x51b5b3));}['hasItem'](_0x3c827a){return!!this['children']['find'](_0x1d9124=>_0x1d9124['options']['id']['includes'](_0x3c827a));}['scrollToSuggestion'](_0x3d83b5,_0x37268e){const _0x19f791=this['getItemById'](_0x3d83b5);if(!(_0x19f791 instanceof Cn))return void It('ck-ai-chat-feed-view-scroll-to-suggestion-invalid-item',{'replyId':_0x3d83b5,'partIndex':_0x37268e});const _0x32256f=_0x19f791['getPartView'](_0x37268e);_0x32256f?wt(_0x32256f['element'],0x14,this['element']['parentElement'],!0x0,!0x0):It('ck-ai-chat-feed-view-scroll-to-suggestion-part-view-not-found',{'replyId':_0x3d83b5,'partIndex':_0x37268e});}['_setupTemplate'](){this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed']},'children':this['_createTemplateChildren']()});}['_createTemplateChildren'](){const _0x8a9a9=this['_createSkeletonLoader']();return[this['_createFeedItems'](),_0x8a9a9,this['_createFeedLoader']()];}['_createSkeletonLoader'](){const _0x3195d3=new zn(this['locale'],jn['aiFeed']);return _0x3195d3['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isLoadingSkeletonVisible','ck-hidden',_0x3bb3e5=>!_0x3bb3e5)]}}),_0x3195d3;}['_createFeedItems'](){const _0x29ed61=new Nt(this['locale']);return _0x29ed61['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__items',this['bindTemplate']['if']('isLoadingSkeletonVisible','ck-hidden')]},'children':this['children']}),_0x29ed61;}['_createFeedLoader'](){const _0x47e54f=new Nt(this['locale']);return _0x47e54f['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__loader',this['bindTemplate']['if']('isPending','ck-hidden',_0x2c6031=>!_0x2c6031)]},'children':this['_createLoaderChildren']()}),_0x47e54f;}['_createLoaderChildren'](){const _0x4ae505=new fn();return _0x4ae505['isVisible']=!0x0,[_0x4ae505,{'tag':'span','attributes':{'class':['ck','ck-ai-chat__loader-text']},'children':[{'text':this['bindTemplate']['to']('loadingMessage')}]}];}['getItemById'](_0x10696c){const _0x1bfbf5=this['children']['find'](_0x512e7b=>_0x512e7b['options']['id']['includes'](_0x10696c));if(!_0x1bfbf5)throw new ot('ai-chat-feed-view-item-not-found',this,{'id':_0x10696c});return _0x1bfbf5;}['setLoadingMessage'](_0x22bff8){this['set']('loadingMessage',_0x22bff8);}['toggleLoadingSkeleton'](_0x19b5f7){this['set']('isLoadingSkeletonVisible',_0x19b5f7);}['startAutoScroll'](){this['scrollManager']['start']();}['stopAutoScroll'](){this['scrollManager']['stop']();}}class er extends Lt{['filter'](){let _0x1b91c5=0x0;for(const _0x2d2133 of this['items'])_0x1b91c5+=_0x2d2133['items']['length'];return{'resultsCount':_0x1b91c5,'totalItemsCount':_0x1b91c5};}}const ir='ck-ai-chat__prompt-input_highlighted';class sr extends xt{['submitButtonView'];static ['MIN_ROWS']=0x1;static ['MAX_ROWS']=0xc;['_addContextButtonView'];['_queryViewResizeObserver'];constructor(_0x3cbd75,_0x30292a){super(_0x3cbd75,{'queryView':{'label':'','creator':Ut,'showIcon':!0x1,'showResetButton':!0x1},'filteredView':new er(_0x3cbd75),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1}),this['set']('isEmpty',!0x0),this['set']('isUploadInProgress',!0x1),this['_addContextButtonView']=_0x30292a,this['_queryViewResizeObserver']=null,this['queryView']['fieldView']['minRows']=sr['MIN_ROWS'],this['queryView']['fieldView']['maxRows']=sr['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',(_0x2ee3e0,_0x2f6886)=>!_0x2ee3e0&&!_0x2f6886),this['focusableChildren']['add'](this['submitButtonView']);}['render'](){super['render'](),this['queryView']['fieldWrapperChildren']['add'](this['submitButtonView']),this['keystrokes']['set']('enter',(_0x51e7fe,_0x468c98)=>{this['isUploadInProgress']||this['isEmpty']||_0x51e7fe['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0x468c98());}),this['queryView']['fieldView']['on']('update',()=>{this['isEmpty']=''===this['queryView']['fieldView']['element']['value']?.['trim']();});}['destroy'](){super['destroy'](),this['_queryViewResizeObserver']&&this['_queryViewResizeObserver']['destroy']();}['submit'](){const _0xd8d0c9=this['queryView']['fieldView']['element']['value']?.['trim']();if(!_0xd8d0c9)return this['queryView']['errorText']=as(this['locale'],'AI_CHAT_PROMPT_EMPTY_ERROR'),void(this['queryView']['fieldView']['hasError']=!0x0);this['queryView']['fieldView']['hasError']=!0x1;const _0x473ac7=_0x3e5077(_0xd8d0c9);this['fire']('sendUserMessage',_0x473ac7),this['queryView']['fieldView']['reset']();}['setPlaceholderText'](_0x62fa18){this['queryView']['fieldView']['set']('placeholder',_0x62fa18);}['focus'](_0x17ff82=!0x1){super['focus'](),_0x17ff82&&(this['element']['classList']['contains'](ir)||(this['element']['classList']['add'](ir),setTimeout(()=>{this['element']['classList']['remove'](ir);},0x320)));}['_createSubmitButton'](){const _0x123592=new kt(this['locale']);return _0x123592['set']({'icon':_0x1e897a,'label':as(this['locale'],'AI_CHAT_LABEL_SUBMIT'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-chat__prompt-submit-button\x20'+os,'isEnabled':!0x1}),_0x123592['on']('execute',()=>{this['submit']();}),_0x123592;}['setIsUploadInProgress'](_0x2cd149){this['isUploadInProgress']=_0x2cd149;}['_setUpAddContextButtonPositioning'](){const _0x35ce9e=this['locale'],_0x530729=()=>{ct['window']['requestAnimationFrame'](()=>{if(lt(this['element'])){const _0xa8214=new ut(this['queryView']['fieldView']['element']),_0x399896=new ut(this['_addContextButtonView']['element']),_0x54f840=_0xa8214['width'],_0x457aca='rtl'===_0x35ce9e['uiLanguageDirection']?'right':'left';_0xa8214['excludeScrollbarsAndBorders']();const _0x4e94b1=_0x54f840-_0xa8214['width']+0x1;this['_addContextButtonView']['element']['style'][_0x457aca]='calc('+(_0x54f840-_0x399896['width']-_0x4e94b1)+'px\x20-\x20var(--ck-spacing-tiny))';}});};this['queryView']['fieldView']['on']('update',_0x530729),this['on']('render',()=>{_0x530729(),this['_queryViewResizeObserver']=new ft(this['queryView']['fieldView']['element'],()=>{_0x530729();});});}}const nr='ck-ai-chat__prompt-capabilities',rr='ck-ai-chat-controls-button',ar='ck-ai-chat-controls-button--commands',or='ck-ai-chat-controls__model-selection',hr='ck-ai-chat-controls__model-selection__item-name',cr='ck-ai-chat-controls__model-selection__item-description',lr='ck-ai-chat-controls__model-selection__item-capabilities',ur='n';class dr extends Nt{['_webSearchButton'];['_reasoningButton'];['_commandsButton'];['_modelSelectionDropdown'];['_modelSelectionDropdownItems'];['_modelNameView'];constructor(_0x75c921){super(_0x75c921),this['set']('webSearchActive',!0x1),this['set']('reasoningActive',!0x1),this['set']('modelDisplayMode','selector'),this['set']('modelSelectorEnabled',!0x0),this['set']('activeModelId',null),this['set']('activeModelName',null),this['_modelSelectionDropdown']=this['_createModelSelectionDropdown'](),this['_modelNameView']=this['_createModelNameView'](),this['_webSearchButton']=this['_createWebSearchButton'](),this['_reasoningButton']=this['_createReasoningButton'](),this['_commandsButton']=this['_createCommandsButton'](),this['_modelSelectionDropdown']['buttonView']['bind']('isVisible')['to'](this,'modelDisplayMode',_0x5a0f37=>'selector'===_0x5a0f37),this['_modelSelectionDropdown']['buttonView']['bind']('tooltip')['to'](this,'modelSelectorEnabled',_0x27d748=>_0x27d748?this['_modelSelectionDropdown']['buttonView']['label']:as(this['locale'],'AI_CHAT_MODEL_SELECTOR_DISABLED_TOOLTIP')),this['_modelSelectionDropdown']['bind']('isEnabled')['to'](this,'modelSelectorEnabled',_0x8ac57a=>_0x8ac57a),this['_webSearchButton']['bind']('isOn')['to'](this,'webSearchActive',_0x5910a6=>_0x5910a6),this['_webSearchButton']['bind']('tooltip')['to'](this,'webSearchActive',_0x39a2ee=>as(this['locale'],_0x39a2ee?'AI_CHAT_DISABLE_WEB_SEARCH':'AI_CHAT_ENABLE_WEB_SEARCH')),this['_reasoningButton']['bind']('isOn')['to'](this,'reasoningActive',_0xf39848=>_0xf39848),this['_reasoningButton']['bind']('tooltip')['to'](this,'reasoningActive',_0x100b9a=>as(this['locale'],_0x100b9a?'AI_CHAT_DISABLE_REASONING':'AI_CHAT_ENABLE_REASONING')),this['setTemplate']({'tag':'div','attributes':{'class':[nr]},'children':[this['_modelSelectionDropdown'],this['_modelNameView'],this['_webSearchButton'],this['_reasoningButton'],this['_commandsButton']]}),this['_modelSelectionDropdownItems']=new dt(),zt(this['_modelSelectionDropdown'],this['_modelSelectionDropdownItems']);}['setModelList'](_0x360764,_0x3390a8){if(_0x3390a8)this['set']('modelDisplayMode','hidden');else{const _0x4a8dd9=0x1===_0x360764['length'];this['set']('modelDisplayMode',_0x4a8dd9?'name':'selector');}if(this['_modelSelectionDropdownItems']['clear'](),_0x360764?.['length'])for(const _0x28b211 of _0x360764){const _0x8bed3e=new jt({'label':_0x28b211['name'],'withText':!0x0,'role':'menuitemradio','id':_0x28b211['id'],'model':_0x28b211});_0x8bed3e['bind']('isOn')['to'](this,'activeModelId',_0x4fbb27=>_0x4fbb27===_0x28b211['id']),this['_modelSelectionDropdownItems']['add']({'type':'button','model':_0x8bed3e,'labelView':new _r(this['locale'],_0x28b211)});}}['setWebSearch'](_0x26b02b){this['set']('webSearchActive',_0x26b02b);}['setReasoning'](_0xfe2369){this['set']('reasoningActive',_0xfe2369);}['setModel'](_0x31abf5){if(!_0x31abf5)return;this['activeModelId']=_0x31abf5['id'],this['activeModelName']=_0x31abf5['name']||_0x31abf5['id'],this['_modelSelectionDropdown']['buttonView']['set']('label',_0x31abf5['name']),this['_modelSelectionDropdown']['buttonView']['set']('tooltip',_0x31abf5['name']);const _0x334f46=_0x31abf5['capabilities']['webSearch']?.['enabled']??!0x1;this['set']('webSearchActive',!0x1),this['_webSearchButton']['set']('isOn',!0x1),this['_webSearchButton']['set']('isEnabled',_0x334f46),this['_webSearchButton']['set']('isVisible',_0x334f46);const _0x2247ce=_0x31abf5['capabilities']['reasoning']?.['enabled']??!0x1;this['set']('reasoningActive',!0x1),this['_reasoningButton']['set']('isOn',!0x1),this['_reasoningButton']['set']('isEnabled',_0x2247ce),this['_reasoningButton']['set']('isVisible',_0x2247ce);}['enableModelSelector'](){this['set']('modelSelectorEnabled',!0x0);}['disableModelSelector'](_0x223061){this['set']('modelSelectorEnabled',!0x1),_0x223061&&this['set']('modelDisplayMode','hidden');}['_createWebSearchButton'](){const _0x344965=new kt();return _0x344965['set']({'label':as(this['locale'],'AI_CHAT_SEARCH_WEB'),'icon':_0x2c4a3f,'class':rr+'\x20'+cs,'isToggleable':!0x0,'tooltipPosition':ur}),_0x344965['on']('execute',()=>{this['fire']('toggleWebSearch');}),_0x344965;}['_createReasoningButton'](){const _0x15d901=new kt();return _0x15d901['set']({'label':as(this['locale'],'AI_CHAT_REASONING'),'icon':_0x3cc08a,'class':rr+'\x20'+cs,'isToggleable':!0x0,'tooltipPosition':ur}),_0x15d901['on']('execute',()=>{this['fire']('toggleReasoning');}),_0x15d901;}['_createCommandsButton'](){const _0x30545a=new kt();return _0x30545a['set']({'label':as(this['locale'],'AI_CHAT_COMMANDS'),'icon':_0x120471,'withText':!0x0,'class':rr+'\x20'+cs,'isToggleable':!0x0,'tooltip':as(this['locale'],'AI_CHAT_COMMANDS'),'tooltipPosition':ur}),_0x30545a['extendTemplate']({'attributes':{'class':[ar]}}),_0x30545a['on']('execute',()=>{console['log']('Commands\x20are\x20not\x20implemented\x20yet.'),alert('Commands\x20are\x20not\x20implemented\x20yet.');}),_0x30545a;}['_createModelSelectionDropdown'](){const _0xa0270c=Bt(this['locale']);return _0xa0270c['set']({'panelPosition':'ne','class':[or]}),_0xa0270c['buttonView']['set']({'label':as(this['locale'],'AI_CHAT_MODEL_SELECTOR_ENABLED_TOOLTIP'),'withText':!0x0,'tooltip':!0x0,'tooltipPosition':ur,'class':cs}),this['listenTo'](_0xa0270c,'execute',_0x14cc1f=>{this['fire']('selectModel',_0x14cc1f['source']['model']);}),_0xa0270c;}['_createModelNameView'](){const _0x232469=new Ar(this['locale']);return _0x232469['bind']('text')['to'](this,'activeModelName',_0x459f5a=>_0x459f5a??''),_0x232469['bind']('isVisible')['to'](this,'modelDisplayMode',_0x27c626=>'name'===_0x27c626),_0x232469;}}let _r=class extends Ht{constructor(_0x29ff55,_0x1226cf){super();const _0x5f41f6=this['bindTemplate'],_0x2901eb=this['createCollection']();this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-button__label'],'style':_0x5f41f6['to']('style'),'id':_0x5f41f6['to']('id')},'children':[{'tag':'div','attributes':{'class':[hr]},'children':[{'text':_0x5f41f6['to']('text')}]},{'tag':'div','attributes':{'class':[cr]},'children':[{'tag':'span','children':[{'text':_0x1226cf['description']}]}]},{'tag':'div','attributes':{'class':[lr]},'children':_0x2901eb}]}),_0x2901eb['addMany'](this['_getCapabilityParts'](_0x29ff55,_0x2c4a3f,'AI_CHAT_SEARCH_WEB',_0x1226cf['capabilities']['webSearch']?.['enabled']??!0x1)),_0x2901eb['addMany'](this['_getCapabilityParts'](_0x29ff55,_0x3cc08a,'AI_CHAT_REASONING',_0x1226cf['capabilities']['reasoning']?.['enabled']??!0x1));}['_getCapabilityParts'](_0x26c2a6,_0x3a101c,_0x409986,_0x592d41){const _0x34be39=new yt();_0x34be39['content']=_0x3a101c;const _0x945995=new Nt(_0x26c2a6);_0x945995['setTemplate']({'tag':'span','children':[{'text':as(_0x26c2a6,_0x409986)+':\x20'}]});const _0xdbd568=new Nt(_0x26c2a6);return _0xdbd568['setTemplate']({'tag':'span','children':[{'text':as(_0x26c2a6,_0x592d41?'AI_CHAT_CAPABILITIES_YES':'AI_CHAT_CAPABILITIES_NO')}]}),[_0x34be39,_0x945995,_0xdbd568];}},Ar=class extends Nt{constructor(_0x4b3ef4){super(_0x4b3ef4),this['set']('text',void 0x0),this['set']('isVisible',!0x0);const _0x32aefb=this['bindTemplate'];this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-chat-controls__model-name',_0x32aefb['if']('isVisible','ck-hidden',_0x2eba8c=>!_0x2eba8c)]},'children':[{'text':_0x32aefb['to']('text')}]});}};const gr='ck-ai-chat-context-controls__url-form',Ir='ck-ai-chat-context-controls__url-input-section';class Er extends Nt{['focusTracker'];['keystrokes'];['_focusables'];['focusCycler'];['urlInputField'];['backButton'];['confirmButton'];constructor(_0x3709c1){super(_0x3709c1),this['focusTracker']=new _t(),this['keystrokes']=new At(),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 Mt({'focusables':this['_focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes'],'actions':{'focusPrevious':'shift+tab','focusNext':'tab'}}),this['set']('withBackButton',!0x0),this['_setupTemplate'](),this['_setupEventHandlers'](),this['_setupKeystrokes']();}['render'](){super['render'](),this['_focusables']['forEach'](_0xb2853a=>{this['focusTracker']['add'](_0xb2853a['element']),this['keystrokes']['listenTo'](_0xb2853a['element']);}),Jt({'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'](_0x1f6af6){this['urlInputField']['errorText']=_0x1f6af6,this['_updateConfirmButtonState'](),this['fire']('refreshBalloon');}['clearError'](){this['urlInputField']['errorText']=null,this['_updateConfirmButtonState']();}['_createBackButton'](){const _0x2ecb58=new kt(this['locale']);return _0x2ecb58['set']({'icon':_0x4b5cbc,'tooltip':as(this['locale'],'AI_CHAT_CONTEXT_URL_BACK_TO_CONTEXT'),'tooltipPosition':'n','class':['ck-button-icon\x20ck-button-back']}),this['on']('change:withBackButton',(_0x24a7b7,_0x2f6300,_0x1489f5)=>{_0x2ecb58['set']({'class':['ck-button-icon\x20ck-button-back'+(_0x1489f5?'':'\x20ck-hidden')]});}),_0x2ecb58;}['_createUrlInputField'](){const _0x22b629=new Zt(this['locale'],te);return _0x22b629['set']({'label':as(this['locale'],'AI_CHAT_CONTEXT_URL_LABEL'),'class':'ck-labeled-field-view_empty'}),_0x22b629['fieldView']['set']({'placeholder':as(this['locale'],'AI_CHAT_CONTEXT_URL_PLACEHOLDER')}),_0x22b629;}['_createConfirmButton'](){const _0x53cabe=new kt(this['locale']);return _0x53cabe['set']({'icon':_0x4c3d0d,'tooltip':as(this['locale'],'AI_CHAT_CONTEXT_URL_ADD_URL'),'tooltipPosition':'n','class':'ck-button-icon','type':'submit','isEnabled':!0x1}),_0x53cabe;}['_setupTemplate'](){const _0x22243c=new _0x2229a9(this['locale'],{'label':as(this['locale'],'AI_CHAT_CONTEXT_URL_ADD_URL'),'class':'ck-ai-header\x20ck-ai-header_small\x20ck-ai-header_context-url'});_0x22243c['children']['add'](this['backButton'],0x0),this['setTemplate']({'tag':'form','attributes':{'class':gr,'tabindex':'-1'},'children':[_0x22243c,{'tag':'div','attributes':{'class':Ir},'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',_0x2fb28b=>{_0x2fb28b['stop'](),this['_handleSubmit']();});}['_setupKeystrokes'](){this['keystrokes']['set']('esc',(_0x4d15a9,_0x5aa127)=>{this['clear'](),this['fire']('cancel'),_0x5aa127();});}['_handleSubmit'](){const _0x10c5a8=this['getValue']()['trim']();_0x10c5a8?this['_isValidUrl'](_0x10c5a8)?(this['clearError'](),this['fire']('submitUrl',_0x10c5a8)):this['setError'](as(this['locale'],'AI_CHAT_CONTEXT_URL_INVALID_ERROR')):this['setError'](as(this['locale'],'AI_CHAT_CONTEXT_URL_EMPTY_ERROR'));}['_updateConfirmButtonState'](){const _0x10cf69=this['getValue']()['trim'](),_0x4e76ec=!!this['urlInputField']['errorText'];this['confirmButton']['isEnabled']=_0x10cf69['length']>0x0&&!_0x4e76ec;}['_isValidUrl'](_0xb8e530){try{return!!new URL(_0xb8e530);}catch{return!0x1;}}}const Tr='ck-ai-chat-resources__item',pr='ck-ai-chat-resources__item--in-context',mr='ck-ai-chat-resources__item-title',Cr='ck-ai-chat-resources__item__icon';class wr extends Pt{['resource'];['_titleView'];['_iconView'];constructor(_0x41b304,_0x16fb66){super(_0x41b304),this['resource']=_0x16fb66,this['set']('isInContext',!!_0x16fb66['isInContext']),this['_titleView']=this['_createTitleView'](),this['_iconView']=this['_createIconView'](),this['_setupTemplate']();}['render'](){super['render']();}['getResourceIcon'](_0x1479e1){if(_0x1479e1['isInContext'])return _0x4c3d0d;switch(_0x1479e1['type']){case'document':return _0x4db6db;case'web-resource':return _0x54a6e3;case'file':case'text':return _0x3c524a;default:return _0x2e527d;}}['highlightText'](_0x351d8e){if(!_0x351d8e||''===_0x351d8e['trim']())return void this['_titleView']['highlightText'](null);const _0x45b012=new RegExp(_0x144f09(_0x351d8e),'gi');this['_titleView']['highlightText'](_0x45b012);}['updateResourceState'](_0x4282f2){this['resource']['isInContext']=_0x4282f2,this['isInContext']=_0x4282f2,this['_updateIcon']();}['_createTitleView'](){const _0x4ad54d=new _0x50c963();return _0x4ad54d['text']=this['resource']['label'],_0x4ad54d['extendTemplate']({'tag':'span','attributes':{'class':[mr]}}),_0x4ad54d;}['_createIconView'](){const _0x285df9=new yt();return _0x285df9['content']=this['getResourceIcon'](this['resource']),_0x285df9;}['_setupTemplate'](){const _0x4b5df0=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':[Tr,_0x4b5df0['if']('isVisible','ck-hidden',_0x27bd4a=>!_0x27bd4a),_0x4b5df0['if']('isInContext',pr)]},'children':[{'tag':'div','attributes':{'class':[Cr]},'children':[this['_iconView']]},this['_titleView']],'on':{'click':_0x4b5df0['to']('execute')}});}['_updateIcon'](){this['_iconView']['content']=this['getResourceIcon'](this['resource']);}}const fr='ck-ai-chat-resources__list';class Sr extends Lt{['_source'];constructor(_0x2fdaf,_0xfb557a){super(_0x2fdaf),this['_source']=_0xfb557a,this['extendTemplate']({'attributes':{'class':[fr]}});}['setResources'](_0x209225,_0x1001ee){this['items']['clear']();let _0x1cd35e=_0x209225;if(this['_source']['useDefaultFiltering']&&_0x1001ee&&''!==_0x1001ee['trim']()){const _0x325562=new RegExp(_0x1001ee['replace'](/[.*+?^${}()|[\]\\]/g,'\x5c$&'),'gi');_0x1cd35e=_0x209225['filter'](_0xa0315a=>_0x325562['test'](_0xa0315a['label']));}for(const _0x4b7de3 of _0x1cd35e){const _0x284de7=new wr(this['locale'],_0x4b7de3);_0x284de7['on']('execute',()=>{this['_handleResourceSelection'](this['_source'],_0x4b7de3);}),this['items']['add'](_0x284de7);}this['_source']['useDefaultFiltering']&&this['highlightText'](_0x1001ee);}['highlightText'](_0x67c5c1){this['_source']['useDefaultFiltering']&&this['items']['forEach'](_0x2b0a32=>{_0x2b0a32['highlightText'](_0x67c5c1);});}['updateResourceState'](_0x4293b2,_0x5a6609){for(const _0x47967a of this['items']){const _0x51ed2b=_0x47967a;_0x51ed2b['resource']['id']===_0x4293b2&&_0x51ed2b['updateResourceState'](_0x5a6609);}}['_handleResourceSelection'](_0x19a3c5,_0x30107a){this['fire']('addResourceToContext',{'source':_0x19a3c5,'resource':_0x30107a});}}class br extends Zt{['iconView'];['resetButtonView'];['_viewConfig'];constructor(_0x4e15ba){const t=_0x4e15ba['t'],_0x2c5f1a={'showResetButton':!0x0,'showIcon':!0x0,'creator':te,'label':as(_0x4e15ba,'AI_CHAT_SEARCH_RESOURCES')};super(_0x4e15ba,_0x2c5f1a['creator']),this['label']=_0x2c5f1a['label'],this['_viewConfig']=_0x2c5f1a,this['_viewConfig']['showIcon']&&this['_setupSearchIcon'](),this['_viewConfig']['showResetButton']&&this['_setupResetButton'](_0x4e15ba,t),this['_setupEventListeners']();}['reset'](){this['fieldView']['reset'](),this['_viewConfig']['showResetButton']&&this['resetButtonView']&&(this['resetButtonView']['isVisible']=!0x1),this['search']('');}['search'](_0x500b81){this['fire']('search',_0x500b81);}['getQuery'](){return this['fieldView']['element']?.['value']||'';}['_setupSearchIcon'](){this['iconView']=new yt(),this['iconView']['content']=_0x393ddf,this['fieldWrapperChildren']['add'](this['iconView'],0x0),this['extendTemplate']({'attributes':{'class':'ck-search__query_with-icon'}});}['_setupResetButton'](_0x338d63,t){this['resetButtonView']=new kt(_0x338d63),this['resetButtonView']['set']({'label':t('Clear'),'icon':_0x52715b,'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',_0x1fc0a8=>!_0x1fc0a8),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 Rr extends Nt{['_searchView'];['_searchSection'];['_searchInputVisibleFrom'];['_resourcesListView'];['_skeletonLoader'];['_source'];['children'];['_latestLoadResourcesUid']=null;constructor(_0x4e5e0a,_0x3c7904){super(_0x4e5e0a),this['_source']=_0x3c7904['source'],this['_searchInputVisibleFrom']=_0x3c7904['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 _0x553410([this['_skeletonLoader'],this['_resourcesListView']]),this['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-chat-resources'},'children':this['children']});}['_createSearchView'](){return new br(this['locale']);}['_createSearchSection'](){const _0x3d4d41=new Nt(this['locale']);return _0x3d4d41['setTemplate']({'tag':'div','attributes':{'class':'ck\x20ck-search'},'children':[this['_searchView']]}),this['_searchView']['on']('search',(_0x2e34ab,_0x545dd6)=>{this['loadResources'](_0x545dd6),this['_source']['useDefaultFiltering']&&this['_resourcesListView']['highlightText'](_0x545dd6);}),_0x3d4d41;}['_createResourcesListView'](){const _0x2e793d=new Sr(this['locale'],this['_source']);return _0x2e793d['delegate']('addResourceToContext')['to'](this),_0x2e793d['extendTemplate']({'attributes':{'class':this['bindTemplate']['if']('isLoading','ck-hidden')}}),_0x2e793d;}['_createSkeletonView'](){const _0x2a3a6c=new zn(this['locale'],jn['aiChatResources']);return _0x2a3a6c['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isLoading','ck-hidden',_0x569b3c=>!_0x569b3c)]}}),_0x2a3a6c;}['render'](){super['render'](),this['loadResources']('');}['loadResources'](_0x125c87){const _0x5eb717=at();this['_latestLoadResourcesUid']=_0x5eb717,this['fire']('loadSourceResources',{'sourceId':this['_source']['id'],'query':_0x125c87,'uid':_0x5eb717}),this['isLoading']=!0x0;}['setResources'](_0x31b3aa,_0x5820b5){if(_0x5820b5&&_0x5820b5!==this['_latestLoadResourcesUid'])return;const _0x1c89cb=this['_source']['useDefaultFiltering']?this['_searchView']['getQuery']():'';this['_resourcesListView']['setResources'](_0x31b3aa,_0x1c89cb),_0x31b3aa['length']>=this['_searchInputVisibleFrom']&&!this['children']['has'](this['_searchSection'])&&this['children']['add'](this['_searchSection'],0x0),requestAnimationFrame(()=>{this['isLoading']=!0x1;});}['updateResourceState'](_0x5d453d,_0x421eda){this['_resourcesListView']['updateResourceState'](_0x5d453d,_0x421eda);}}const Or='ck-ai-chat-context-controls__source-balloon-panel',kr='ck-button-icon\x20ck-button-back',Nr='ck-ai-header\x20ck-ai-header_small\x20ck-ai-header_source';class vr{['_sourceResourceBalloons']=new Map();['_bodyCollection'];['_locale'];['_config'];constructor(_0x48ff90,_0x7e7710,_0x180437){this['_locale']=_0x48ff90,this['_bodyCollection']=_0x7e7710,this['_config']=_0x180437;}['showSourceResourcesBalloon']({source:_0x4a77f6,withBackButton:_0x3f0ccc}){let _0x227a62=this['_sourceResourceBalloons']['get'](_0x4a77f6['id']);_0x227a62||(_0x227a62=this['_createSourceResourceBalloonPanel'](),this['_sourceResourceBalloons']['set'](_0x4a77f6['id'],_0x227a62),this['_setupSingleResourceBalloonClickOutsideHandler'](_0x227a62)),this['_addSourceResourceContent']({'balloonPanel':_0x227a62,'source':_0x4a77f6,'withBackButton':_0x3f0ccc}),_0x227a62['show']();const _0x2957c4=this['_config']['getTargetElement']();_0x2957c4&&_0x227a62['pin']({'target':_0x2957c4,'limiter':this['_config']['getLimiterElement']()});}['populateSourceResourceBalloon'](_0x5c5fb7,_0x5d6a6e,_0x5704a6){const _0x153065=this['_sourceResourceBalloons']['get'](_0x5c5fb7);if(!_0x153065)return;const _0x151330=this['_getResourcesViewFromBalloon'](_0x153065);_0x151330&&(_0x151330['setResources'](_0x5d6a6e,_0x5704a6),_0x151330['once']('change:isLoading',()=>{_0x153065['pin']({'target':this['_config']['getTargetElement'](),'limiter':this['_config']['getLimiterElement']()});}));}['closeSourceResourceBalloon'](_0x5b8c47){const _0x58d681=this['_sourceResourceBalloons']['get'](_0x5b8c47);_0x58d681&&requestAnimationFrame(()=>{_0x58d681['hide'](),this['_sourceResourceBalloons']['delete'](_0x5b8c47),this['_config']['onBalloonClosed']();});}['isAnyResourceBalloonVisible'](){for(const _0x1e0f12 of this['_sourceResourceBalloons']['values']())if(_0x1e0f12['isVisible'])return!0x0;return!0x1;}['updateResourceState'](_0x3eaac1,_0x1b9d62,_0x4f83eb){const _0x47a9e2=this['_sourceResourceBalloons']['get'](_0x3eaac1);if(!_0x47a9e2||!_0x47a9e2['isVisible'])return;const _0x27dfc2=this['_config']['getTargetElement']();if(!_0x27dfc2)return;_0x47a9e2['pin']({'target':_0x27dfc2,'limiter':this['_config']['getLimiterElement']()});const _0x12476d=this['_getResourcesViewFromBalloon'](_0x47a9e2);_0x12476d&&_0x12476d['updateResourceState'](_0x1b9d62,_0x4f83eb);}['destroy'](){for(const _0x311619 of this['_sourceResourceBalloons']['values']())_0x311619['destroy']();this['_sourceResourceBalloons']['clear']();}['_createSourceResourceBalloonPanel'](){const _0x42cecb=new Qt(this['_locale']);return _0x42cecb['extendTemplate']({'attributes':{'class':Or}}),this['_bodyCollection']['add'](_0x42cecb),_0x42cecb;}['_addSourceResourceContent']({balloonPanel:_0x223890,source:_0x3223eb,withBackButton:_0x442f3e}){_0x223890['content']['clear']();const _0xa5ebc8=this['_createBalloonHeader']({'balloonPanel':_0x223890,'source':_0x3223eb,'withBackButton':_0x442f3e});_0x223890['content']['add'](_0xa5ebc8);const _0x4ccd9e=this['_createBalloonResourcesView'](_0x3223eb);_0x223890['content']['add'](_0x4ccd9e);}['_createBalloonHeader']({balloonPanel:_0x34e77e,source:_0x925eda,withBackButton:_0x5161dc}){const _0x1e803d=new _0x2229a9(this['_locale'],{'label':_0x925eda['label'],'class':Nr});return _0x5161dc&&_0x1e803d['children']['add'](this['_createBackButton'](_0x34e77e),0x0),_0x1e803d;}['_createBackButton'](_0x3f938e){const _0x1d8de4=new kt(this['_locale']);return _0x1d8de4['set']({'icon':_0x4b5cbc,'tooltip':as(this['_locale'],'AI_CHAT_CONTEXT_URL_BACK_TO_CONTEXT'),'tooltipPosition':'n','class':kr}),_0x1d8de4['on']('execute',()=>{_0x3f938e['hide'](),this['_config']['onBackToContext']();}),_0x1d8de4;}['_createBalloonResourcesView'](_0x4f05a8){const _0x11d787=new Rr(this['_locale'],{'source':_0x4f05a8,'searchInputVisibleFrom':this['_config']['searchInputVisibleFrom']});return _0x11d787['on']('loadSourceResources',(_0xf4d3e8,_0xf5e880)=>{this['_config']['onLoadSourceResources'](_0xf5e880);}),_0x11d787['on']('addResourceToContext',(_0x42846e,_0x1c1ad6)=>{this['_config']['onResourceSelected'](_0x1c1ad6['source'],_0x1c1ad6['resource']),this['closeSourceResourceBalloon'](_0x4f05a8['id']);}),_0x11d787;}['_getResourcesViewFromBalloon'](_0x1c5956){const _0x41c74=_0x1c5956['content']['get'](0x1);return _0x41c74 instanceof Rr?_0x41c74:null;}['_setupSingleResourceBalloonClickOutsideHandler'](_0x5b3ba5){Xt({'emitter':_0x5b3ba5,'contextElements':[_0x5b3ba5['element']],'callback':()=>{_0x5b3ba5['hide'](),this['_config']['onBalloonClosed']();},'activator':()=>_0x5b3ba5['isVisible']});}}const yr=['addDocumentToContext','addFileToContext','addUrlToContext','addResourceToContext','removeContextItem','loadSourceResources','executeCustomItemCallback'],xr='ck-ai-chat-context-controls',Lr='ck-ai-chat-context-controls__pending-contexts',Dr='ck-ai-chat-context-controls__add-context-balloon-panel',Pr='ck-ai-chat-context-controls__add-context-button',Hr='ck-ai-chat-context-controls__url-balloon-panel',Mr='ck-ai-chat-context-controls__balloon-button',Ur='ck-ai-chat-context-controls__balloon-button-source',Vr='ck-ai-chat-controls-button',Br='ck-ai-chat-context-chips-wrapper-balloon',Gr='ck-ai-chat-controls_context_show-more-button',Fr='ck-ai-chat-context-controls__show-more-balloon-panel',Kr='ck-ai-chat',Wr=[Qt['defaultPositions']['northArrowSouthWest'],Qt['defaultPositions']['northArrowSouth'],Qt['defaultPositions']['northArrowSouthEast'],Qt['defaultPositions']['southArrowNorthWest'],Qt['defaultPositions']['southArrowNorth'],Qt['defaultPositions']['southArrowNorthEast']];class Yr extends Nt{['addContextButtonView'];['_currentContextsChips']=this['createCollection']();['_conversationContextsChips']=this['createCollection']();['_overflowManager'];['_addContextBalloonPanelView'];['_urlBalloonPanelView'];['_urlInputView'];['_resourcesBalloonView'];['_addContextBalloonConfig'];['_hasExactlyOneSource']=!0x1;['bodyCollection'];constructor(_0x3ae665,_0x23456a){super(_0x3ae665),this['bodyCollection']=_0x23456a['bodyCollection'],this['_currentContextsChips']=this['createCollection'](),this['_conversationContextsChips']=this['createCollection'](),this['addContextButtonView']=this['_createAddContextButtonView'](_0x3ae665),this['_addContextBalloonPanelView']=this['_createAddContextBalloonPanelView'](_0x3ae665),this['_urlBalloonPanelView']=this['_createUrlBalloonPanelView'](_0x3ae665),this['_resourcesBalloonView']=this['_createResourcesBalloonView'](_0x3ae665,_0x23456a);const _0x239131={'cssClasses':{'showMoreButton':Gr+'\x20'+cs,'showMoreBalloon':Fr,'overflowContainer':Br,'controlsButton':Vr}};this['_overflowManager']=new Hn(_0x3ae665,this['_currentContextsChips'],_0x239131,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'](_0x220aee,_0x43c9be){const _0x3796a5=this['_createContextButton'](_0x220aee,'current',!0x0,_0x43c9be);this['_addContextToCollection'](_0x3796a5,this['_currentContextsChips']),this['_overflowManager']['reorganizeChips']();}['removeContextItem'](_0x63ed1e){this['_removeContextFromCollection'](_0x63ed1e,this['_currentContextsChips']),this['_removeContextFromCollection'](_0x63ed1e,this['_overflowManager']['overflowChips']),this['_overflowManager']['reorganizeChips']();}['setContextItemLoading'](_0x49f016,_0x2ce75b){let _0x22b0ac=this['_currentContextsChips']['find'](_0x40be26=>_0x40be26['id']===_0x49f016);_0x22b0ac||(_0x22b0ac=this['_overflowManager']['overflowChips']['find'](_0x360989=>_0x360989['id']===_0x49f016)),_0x22b0ac&&(_0x22b0ac['isLoading']=_0x2ce75b);}['setConversationContext'](_0x7f439b){this['_conversationContextsChips']['clear']();for(const _0x4e89ff of _0x7f439b){const _0x24cae4=this['_createContextButton'](_0x4e89ff,'conversation',!0x1,!0x1);this['_addContextToCollection'](_0x24cae4,this['_conversationContextsChips']);}}['clearCurrentContextItems'](){this['_currentContextsChips']['clear'](),this['_overflowManager']['clear']();}['clearConversationContextItems'](){this['_conversationContextsChips']['clear']();}['updateResourceState'](_0x2131b0,_0x1e82b0,_0x440327){this['_resourcesBalloonView']['updateResourceState'](_0x2131b0,_0x1e82b0,_0x440327);}['hideAddContextBalloonPanel'](){this['_toggleAddContextBalloon'](!0x1);}['showAddContextBalloonPanel'](){this['_toggleAddContextBalloon'](!0x0);}['hideUrlBalloonPanel'](){this['_urlBalloonPanelView']['hide'](),this['addContextButtonView']['isOn']=!0x1,this['_urlInputView']&&this['_urlInputView']['clear']();}['showUrlBalloonPanel'](){this['_urlBalloonPanelView']['show'](),this['addContextButtonView']['isOn']=!0x0;}['_showSourceResourcesBalloon']({source:_0x311c07,withBackButton:_0x1bc283}){this['_resourcesBalloonView']['showSourceResourcesBalloon']({'source':_0x311c07,'withBackButton':_0x1bc283}),this['addContextButtonView']['isOn']=!0x0;}['populateSourceResourceBalloon'](_0x2a32b2,_0x22b4d5,_0x1cf37f,_0x3461fb){this['_resourcesBalloonView']['populateSourceResourceBalloon'](_0x2a32b2,_0x1cf37f,_0x3461fb);}['closeSourceResourceBalloon'](_0x147da8){this['_resourcesBalloonView']['closeSourceResourceBalloon'](_0x147da8),this['addContextButtonView']['isOn']=!0x1;}['setAddContextOptions'](_0x45c969){this['_setBalloonPanelContent'](this['_addContextBalloonPanelView'],this['locale'],_0x45c969),this['_setAddContextButtonEnabled'](_0x45c969);}['_setAddContextButtonEnabled'](_0x24e53b){const _0x4c1b04=!_0x24e53b['document']['isHidden']&&_0x24e53b['document']['enabled'],_0x41df26=_0x24e53b['urls']['enabled'],_0x1543cd=_0x24e53b['files']['enabled'],_0x2cffcd=_0x24e53b['sources']['length']>0x0,_0x59fd34=_0x24e53b['customItems']&&_0x24e53b['customItems']['length']>0x0;this['addContextButtonView']['isEnabled']=_0x4c1b04||_0x41df26||_0x1543cd||_0x2cffcd||_0x59fd34;}['_setupTemplate'](){this['setTemplate']({'tag':'div','attributes':{'class':[xr,'ck-reset_all-excluded']},'children':[{'tag':'div','attributes':{'class':Lr},'children':this['_currentContextsChips']}]});}['_bindEventHandlers'](){this['addContextButtonView']['on']('execute',()=>{this['_handleAddContextButtonClick']();});}['_createAddContextButtonView'](_0xdcee49){const _0x56aadd=new kt(_0xdcee49);return _0x56aadd['set']({'label':as(_0xdcee49,'AI_CHAT_CONTEXT_ADD_CONTEXT'),'class':Vr+'\x20'+Pr+'\x20'+cs,'icon':_0x46d3ca,'isToggleable':!0x0,'tooltip':!0x0,'tooltipPosition':'sw'}),_0x56aadd;}['_createAddContextBalloonPanelView'](_0x412d07){return this['_createBaseBalloonPanel'](_0x412d07,Dr);}['_createUrlBalloonPanelView'](_0x4ab695){const _0x405698=this['_createBaseBalloonPanel'](_0x4ab695,Hr);return this['_addUrlContent'](_0x405698,_0x4ab695),_0x405698;}['_createResourcesBalloonView'](_0x16c137,_0x4c4282){const _0x47a2ab={'searchInputVisibleFrom':_0x4c4282['searchInputVisibleFrom'],'onBackToContext':()=>{this['showAddContextBalloonPanel'](),this['_addContextBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':Wr});},'onResourceSelected':(_0x1b772e,_0x11c3d2)=>{this['fire']('addResourceToContext',{'source':_0x1b772e,'resource':_0x11c3d2});},'onLoadSourceResources':_0x56f6a1=>{this['fire']('loadSourceResources',_0x56f6a1);},'onBalloonClosed':()=>{this['addContextButtonView']['isOn']=!0x1;},'getLimiterElement':()=>this['_getLimiterElement'](),'getTargetElement':()=>this['addContextButtonView']['element']};return new vr(_0x16c137,_0x4c4282['bodyCollection'],_0x47a2ab);}['_getLimiterElement'](){return this['element']?.['closest']('.'+Kr)||document['body'];}['_createBaseBalloonPanel'](_0x4c66a6,_0x26edf8){const _0xf78802=new Qt(_0x4c66a6);return _0xf78802['extendTemplate']({'attributes':{'class':_0x26edf8}}),this['bodyCollection']['add'](_0xf78802),_0xf78802;}['_setBalloonPanelContent'](_0x2e5e65,_0x4c1f56,_0xde31f9){if(_0x2e5e65['content']['clear'](),!_0xde31f9['document']['isHidden']&&_0xde31f9['document']['enabled']){const _0x3b11ca=this['_createBalloonButton'](_0x4c1f56,{'label':as(_0x4c1f56,'AI_CHAT_CONTEXT_CURRENT_DOCUMENT'),'icon':_0x4db6db});_0x3b11ca['on']('execute',()=>{this['fire']('addDocumentToContext'),this['hideAddContextBalloonPanel']();}),_0x2e5e65['content']['add'](_0x3b11ca);}if(_0xde31f9['urls']['enabled']){const _0xec2424=this['_createBalloonButton'](_0x4c1f56,{'label':as(_0x4c1f56,'AI_CHAT_CONTEXT_URL_LABEL'),'icon':_0x54a6e3});_0xec2424['on']('execute',()=>{this['hideAddContextBalloonPanel'](),this['showUrlBalloonPanel'](),this['_urlBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':Wr}),this['_urlInputView']['focus']();}),_0x2e5e65['content']['add'](_0xec2424);}if(_0xde31f9['files']['enabled']){const _0x5ec63c=new _0x214b7f(_0x4c1f56);_0x5ec63c['set']({'label':as(_0x4c1f56,'AI_CHAT_CONTEXT_FILE_LABEL'),'icon':_0x4c886f,'withText':!0x0,'tooltip':!0x0,'class':Mr,'allowMultipleFiles':!0x0}),_0x5ec63c['on']('execute',()=>{this['hideAddContextBalloonPanel']();}),_0x5ec63c['on']('done',(_0x2cea1d,_0x33c40e)=>{this['fire']('addFileToContext',_0x33c40e);}),_0x5ec63c['tooltip']=!0x0,_0x2e5e65['content']['add'](_0x5ec63c);}for(const _0xf3c81 of _0xde31f9['sources']){const _0x15f083=this['_createBalloonButton'](_0x4c1f56,{'label':_0xf3c81['label'],'icon':_0xf3c81['icon']||_0x2e527d,'type':'source'});_0x2e5e65['content']['add'](_0x15f083),_0x15f083['on']('execute',()=>{this['hideAddContextBalloonPanel'](),this['_showSourceResourcesBalloon']({'source':_0xf3c81,'withBackButton':!this['_hasExactlyOneSource']});});}for(const _0x41218f of _0xde31f9['customItems']||[]){const _0x8e75ae=this['_createBalloonButton'](_0x4c1f56,{'label':_0x41218f['label'],'icon':_0x41218f['icon']||_0x2e527d,'type':'customItem'});_0x2e5e65['content']['add'](_0x8e75ae),_0x8e75ae['on']('execute',()=>{this['hideAddContextBalloonPanel'](),this['fire']('executeCustomItemCallback',_0x41218f);});}this['_hasExactlyOneSource']=0x1===_0x2e5e65['content']['length'],this['_urlInputView']['withBackButton']=!this['_hasExactlyOneSource'];}['_addUrlContent'](_0x36e9e0,_0x5c6b7d){this['_urlInputView']=new Er(_0x5c6b7d),this['_urlInputView']['on']('submitUrl',(_0x1c220d,_0x19ca71)=>{this['_handleUrlSubmit'](_0x19ca71);}),this['_urlInputView']['on']('cancel',()=>{this['hideUrlBalloonPanel'](),this['_hasExactlyOneSource']||(this['showAddContextBalloonPanel'](),this['_addContextBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':Wr}));}),this['_urlInputView']['on']('refreshBalloon',()=>{this['_urlBalloonPanelView']['isVisible']&&this['_urlBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':Wr});}),_0x36e9e0['content']['add'](this['_urlInputView']);}['_createBalloonButton'](_0x11e764,_0x1a405e){const _0x59ab8e='source'===_0x1a405e['type']?new $r(_0x11e764):new kt(_0x11e764);return _0x59ab8e['set']({'label':_0x1a405e['label'],'icon':_0x1a405e['icon'],'withText':!0x0,'tooltip':!0x0,'tooltipPosition':'sw','class':Mr}),_0x59ab8e;}['_setupAllBalloonClickOutsideHandlers'](){this['_setupAddContextBalloonClickOutsideHandler'](),this['_setupUrlBalloonClickOutsideHandler']();}['_setupUrlBalloonClickOutsideHandler'](){Xt({'emitter':this['_urlBalloonPanelView'],'contextElements':[this['_urlBalloonPanelView']['element']],'callback':()=>{this['hideUrlBalloonPanel']();},'activator':()=>this['_urlBalloonPanelView']['isVisible']});}['_toggleAddContextBalloon'](_0x583b2a){const _0x730131=this['_addContextBalloonConfig'];_0x730131['buttonView']['isOn']=_0x583b2a,_0x583b2a?_0x730131['balloonView']['show']():_0x730131['balloonView']['hide']();}['_setupAddContextBalloonClickOutsideHandler'](){const {balloonView:_0x41aeda,buttonView:_0xc5089b,hideMethod:_0x376a0e}=this['_addContextBalloonConfig'];Xt({'emitter':_0x41aeda,'contextElements':[_0x41aeda['element'],_0xc5089b['element']],'callback':()=>{_0x376a0e();},'activator':()=>_0xc5089b['isOn']&&!this['_urlBalloonPanelView']['isVisible']&&!this['_resourcesBalloonView']['isAnyResourceBalloonVisible']()});}['_createContextButton'](_0x160d3e,_0x5681e1,_0x3e6481=!0x1,_0x7aaeb9=!0x1){const _0x3d0df1='conversation'===_0x5681e1||!0x0===_0x160d3e['isReadOnly'],_0x34386a=new xn(this['locale'],_0x160d3e,_0x3d0df1,_0x3e6481,_0x7aaeb9);return _0x3d0df1||_0x34386a['on']('removeContextItemChip',()=>{this['fire']('removeContextItem',_0x34386a['id']);}),_0x34386a;}['_addContextToCollection'](_0x3b8f3c,_0x5b8a32){_0x5b8a32['add'](_0x3b8f3c,0x0);}['_removeContextFromCollection'](_0x4bbaba,_0x28f1da){const _0x2bed63=_0x28f1da['find'](_0x4f58a0=>_0x4f58a0['id']===_0x4bbaba);_0x2bed63&&_0x28f1da['remove'](_0x2bed63);}['_handleAddContextButtonClick'](){this['addContextButtonView']['isOn']?this['hideAddContextBalloonPanel']():(this['showAddContextBalloonPanel'](),this['_addContextBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':Wr}),this['_hasExactlyOneSource']&&this['_addContextBalloonPanelView']['content']['get'](0x0)?.['fire']('execute'));}['_handleUrlSubmit'](_0x3d7807){this['_urlInputView']['clear'](),this['hideUrlBalloonPanel'](),this['fire']('addUrlToContext',_0x3d7807);}}class $r extends kt{['arrowView'];constructor(_0x4e7e41){super(_0x4e7e41),this['set']({'withText':!0x0,'role':'menuitem'}),this['arrowView']=this['_createArrowView'](),this['extendTemplate']({'attributes':{'class':[Ur]}});}['render'](){super['render'](),this['children']['add'](this['arrowView']);}['_createArrowView'](){const _0x38a9cf=new yt();return _0x38a9cf['content']=_0x19f364,_0x38a9cf['extendTemplate']({'attributes':{'class':Ur+'__arrow'}}),_0x38a9cf;}}class qr extends Nt{['_cancelButtonView'];['_loaderView'];constructor(_0x35db3b){super(_0x35db3b),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 _0x338e65=new kt(this['locale']);return _0x338e65['set']({'label':as(this['locale'],'AI_CHAT_STOP_GENERATING'),'withText':!0x0,'class':hs+'\x20ck-ai-button-stop-generating','icon':_0x48b0d7}),_0x338e65['on']('execute',()=>{this['fire']('abortPromptStream');}),_0x338e65;}['_createLoaderView'](){const _0x530651=new Nt(this['locale']);return _0x530651['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':as(this['locale'],'AI_CHAT_IS_WRITING')}]}),_0x530651;}}class Qr extends Nt{['_contextPanelView'];['_promptInputView'];['_promptCapabilitiesView'];['_loaderView'];['_modelUnavailableMessageView'];['_shouldRestorePromptInputFocus'];constructor(_0x444df1,_0x211cf3){super(_0x444df1),this['_contextPanelView']=this['_createContextPanelView'](_0x444df1,{'bodyCollection':_0x211cf3['bodyCollection'],'searchInputVisibleFrom':_0x211cf3['contextResourcesSearchInputVisibleFrom']}),this['_promptInputView']=this['_createPromptInputView'](_0x444df1),this['_promptCapabilitiesView']=this['_createPromptCapabilitiesView'](_0x444df1),this['_loaderView']=this['_createLoaderView'](_0x444df1),this['_modelUnavailableMessageView']=this['_createModelUnavailableMessageView'](_0x444df1),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'](...yr)['to'](this),this['set']('isModelAvailable',!0x0),this['set']('isDisabled',!0x1);const _0x2878f1=this['bindTemplate'];this['setTemplate']({'tag':'form','attributes':{'class':['ck','ck-ai-chat-controls',_0x2878f1['if']('isDisabled','ck-ai-chat-controls-disabled')]},'children':[{'tag':'div','attributes':{'class':[_0x2878f1['if']('isLoading','ck-hidden',_0x54a3a0=>_0x54a3a0||!this['isModelAvailable']),_0x2878f1['if']('isModelAvailable','ck-hidden',_0x3a347d=>!_0x3a347d||this['isLoading'])]},'children':[this['_contextPanelView'],this['_promptInputView'],this['_promptCapabilitiesView']]},{'tag':'div','attributes':{'class':[_0x2878f1['if']('isLoading','ck-hidden',_0x228c56=>!_0x228c56)]},'children':[this['_loaderView']]},{'tag':'div','attributes':{'class':[_0x2878f1['if']('isModelAvailable','ck-hidden',_0x329820=>_0x329820)]},'children':[this['_modelUnavailableMessageView']]}]}),Xt({'emitter':this['_promptInputView'],'activator':()=>this['isLoading'],'contextElements':()=>[this['element']],'callback':()=>{this['_shouldRestorePromptInputFocus']=!0x1;}}),this['on']('change:isLoading',this['_handlePromptInputFocus'],{'priority':'low'});}['_createContextPanelView'](_0x4b7c04,_0x2de81b){return new Yr(_0x4b7c04,_0x2de81b);}['_createPromptInputView'](_0x512230){return new sr(_0x512230,this['_contextPanelView']['addContextButtonView']);}['_createPromptCapabilitiesView'](_0x1d3584){return new dr(_0x1d3584);}['_createLoaderView'](_0x2f812a){return new qr(_0x2f812a);}['_createModelUnavailableMessageView'](_0x1020b1){const _0x43e5d5=new Xr(_0x1020b1);return _0x43e5d5['delegate']('startConversation')['to'](this),_0x43e5d5;}['_handlePromptInputFocus'](_0x3d531c,_0x3e6222,_0x3ce63c){_0x3ce63c?this['_shouldRestorePromptInputFocus']=!0x0:this['_shouldRestorePromptInputFocus']&&this['_promptInputView']['focus']();}['addContextItem'](_0x4dc0da,_0x49610e){this['_contextPanelView']['addContextItem'](_0x4dc0da,_0x49610e);}['removeContextItem'](_0x5d23e9){this['_contextPanelView']['removeContextItem'](_0x5d23e9);}['setContextItemLoading'](_0x31ed52,_0x1c1174){this['_contextPanelView']['setContextItemLoading'](_0x31ed52,_0x1c1174);}['setIsUploadInProgress'](_0x3c9500){this['_promptInputView']['setIsUploadInProgress'](_0x3c9500);}['setConversationContext'](_0x1badf0){this['_contextPanelView']['setConversationContext'](_0x1badf0);}['clearPendingContextUI'](){this['_contextPanelView']['clearCurrentContextItems']();}['clearConversationContextUI'](){this['_contextPanelView']['clearConversationContextItems']();}['updateResourceState'](_0x3f7eb4,_0x496167,_0x4fdf84){this['_contextPanelView']['updateResourceState'](_0x3f7eb4,_0x496167,_0x4fdf84);}['setWebSearch'](_0x57338b){this['_promptCapabilitiesView']['setWebSearch'](_0x57338b);}['setReasoning'](_0x5ae214){this['_promptCapabilitiesView']['setReasoning'](_0x5ae214);}['resetMessageInput'](){this['_promptInputView']['reset']();}['setAddContextOptions'](_0x33052b){this['_contextPanelView']['setAddContextOptions'](_0x33052b);}['setInputPlaceholder'](_0x59a5d3){this['_promptInputView']['setPlaceholderText'](_0x59a5d3);}['setModelList'](_0x277d19,_0x5d2629){this['_promptCapabilitiesView']['setModelList'](_0x277d19,_0x5d2629);}['setModel'](_0x2275b0){_0x2275b0?(this['isModelAvailable']=!0x0,this['_promptCapabilitiesView']['setModel'](_0x2275b0)):this['isModelAvailable']=!0x1;}['enableModelSelector'](){this['_promptCapabilitiesView']['enableModelSelector']();}['disableModelSelector'](_0x2fabe1){this['_promptCapabilitiesView']['disableModelSelector'](_0x2fabe1);}['populateSourceResourceBalloon'](_0x3ad10d,_0x291bb7,_0x33d603,_0x172b7f){this['_contextPanelView']['populateSourceResourceBalloon'](_0x3ad10d,_0x291bb7,_0x33d603,_0x172b7f);}['closeSourceResourceBalloon'](_0x1ba7ab){this['_contextPanelView']['closeSourceResourceBalloon'](_0x1ba7ab);}['focusPromptInput'](_0x20bb9a=!0x1){this['_promptInputView']['focus'](_0x20bb9a);}['setPromptInputValue'](_0x1cd98f){this['_promptInputView']['queryView']['fieldView']['reset'](),this['_promptInputView']['queryView']['fieldView']['value']=_0x1cd98f;}}class Xr extends Nt{constructor(_0x9760f2){super(_0x9760f2);const _0x174e28=new kt(_0x9760f2);_0x174e28['set']({'label':as(this['locale'],'AI_CHAT_MODEL_UNAVAILABLE_MESSAGE_BUTTON'),'withText':!0x0,'class':['ck-ai-chat-controls__start-new-chat-button'],'tooltip':''}),_0x174e28['delegate']('execute')['to'](this,'startConversation'),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat-controls-model-unavailable-message']},'children':[{'tag':'p','children':[{'text':as(this['locale'],'AI_CHAT_MODEL_UNAVAILABLE_MESSAGE_TEXT')+'\x20'},_0x174e28]}]});}}class zr extends _0x2229a9{['conversationStartButton'];['resizeButton'];constructor(_0x5e1f32,_0x4073a4){super(_0x5e1f32,{'label':as(_0x5e1f32,'AI_CHAT_HEADING'),'class':'ck-ai-header\x20ck-ai-header_chat','icon':_0xfce8a2}),this['set']('isMaximized',!0x1),this['conversationStartButton']=this['_createStartConversationButton'](_0x5e1f32),this['children']['add'](this['conversationStartButton']),_0x4073a4&&(this['resizeButton']=ls(_0x5e1f32,this),this['children']['add'](this['resizeButton']));}['_createStartConversationButton'](_0x351b8a){const _0x2a273c=new kt(_0x351b8a);return _0x2a273c['set']({'label':as(this['locale'],'AI_CHAT_LABEL_NEW_CHAT'),'withText':!0x0,'icon':_0x5885f1,'class':'ck-ai-chat__start-conversation\x20'+hs}),_0x2a273c['on']('execute',()=>{this['fire']('startConversation');}),_0x2a273c;}}class jr extends Nt{constructor(_0x234604){super(_0x234604),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-disclaimer']},'children':[{'tag':'p','attributes':{'class':['ck','ck-ai-disclaimer__content']},'children':[{'text':as(_0x234604,'AI_DISCLAIMER_TEXT')}]}]});}}class Jr extends Nt{['chatHeader'];['chatFeed'];['chatControls'];['chatDisclaimer'];['_bodyCollection'];constructor(_0x5017dd,_0x572d4b){super(_0x5017dd),this['_bodyCollection']=new qt(_0x5017dd),this['_bodyCollection']['attachToDom'](),this['chatHeader']=new zr(_0x5017dd,_0x572d4b['showResizeButton']),this['chatHeader']['delegate'](...Xs)['to'](this),this['chatFeed']=new tr(_0x5017dd,this['_bodyCollection']),this['chatFeed']['delegate'](...Xs)['to'](this),this['chatControls']=new Qr(_0x5017dd,{'bodyCollection':this['_bodyCollection'],'contextResourcesSearchInputVisibleFrom':_0x572d4b['contextResourcesSearchInputVisibleFrom']}),this['chatControls']['delegate'](...Xs)['to'](this),this['chatDisclaimer']=new jr(_0x5017dd),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-ai-chat','ck-rounded-corners'],'dir':_0x5017dd['uiLanguageDirection']},'children':[this['chatHeader'],this['chatFeed'],this['chatControls'],this['chatDisclaimer']]});}['populateSourceResourceBalloon'](_0x268e86,_0x354117,_0x32dd1d,_0x182a69){this['chatControls']['populateSourceResourceBalloon'](_0x268e86,_0x354117,_0x32dd1d,_0x182a69);}['closeSourceResourceBalloon'](_0x1c997b){this['chatControls']['closeSourceResourceBalloon'](_0x1c997b);}['destroy'](){this['_bodyCollection']['detachFromDom'](),super['destroy']();}}class Zr extends _0x1f4c78{static get['requires'](){return[ns];}['_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(_0x459b3f){super(_0x459b3f);const _0x1187e8=this['context']['plugins']['get']('AITabs');this['set']('isBusy',!0x1),this['_promiseQueue']=new _n(),this['_view']=new Jr(this['context']['locale'],{'showResizeButton':_0x1187e8['showResizeButton'],'contextResourcesSearchInputVisibleFrom':this['context']['config']['get']('ai.chat.context.searchInputVisibleFrom')}),this['_view']['delegate'](...Xs)['to'](this),this['_view']['on']('toggleSuggestionDisplayMode',(_0x290a71,{showDiff:_0x4a33a0})=>{this['showDiff']=_0x4a33a0;}),_0x1187e8['view']['addTab']({'id':'chat','buttonLabel':as(this['context']['locale'],'AI_CHAT_HEADING'),'buttonIcon':_0xfce8a2,'order':0x0,'content':this['_view']}),this['_view']['chatControls']['bind']('isLoading')['to'](this,'isBusy',_0x52c77a=>_0x52c77a),this['_view']['chatFeed']['bind']('isPending')['to'](this,'isBusy',_0x3ee4c8=>_0x3ee4c8),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder']()),this['bind']('isModelAvailable')['to'](this['_view']['chatControls'],'isModelAvailable');}['destroy'](){super['destroy'](),this['_titleAnimationInterval']&&clearInterval(this['_titleAnimationInterval']);}['createConversation'](_0xdfc3bd){const _0x8ebeb4=this['context']['config']['get']('ai.chat.welcomeMessage')??as(this['context']['locale'],'AI_CHAT_WELCOME_MESSAGE');this['_view']['chatFeed']['clear'](),this['_view']['chatControls']['enableModelSelector'](),this['_view']['chatControls']['setModelList'](_0xdfc3bd['availableModels'],!this['context']['config']['get']('ai.models.showModelSelector')),this['addFeedItemStaticMessage']({'id':'conversation-start','staticMessage':_0x8ebeb4}),this['fire']('conversationCreated');}async['addFeedItemStaticMessage']({id:_0x351ec7,staticMessage:_0x553e54}){return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('ai-reply',{'id':_0x351ec7,'initialContent':'<p>'+_0x553e54+'</p>'});});}async['addFeedItemUserMessage'](_0x41a187){const _0x27e58c=_0x41a187['attributes']?.['displayedPrompt']||_0x41a187['userMessage'];return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('user-message',{'contextItems':Array['from'](_0x41a187['contextItems']['values']()),'initialContent':'<p>'+_0x27e58c+'</p>','id':_0x41a187['id']});});}async['addFeedItemError']({errorMessage:_0x131195,id:_0x319588}){return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('error-message',{'initialContent':'<p>'+_0x131195+'</p>','id':_0x319588});});}async['addFeedItemAIReply'](_0x129576){return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('ai-reply',{'id':_0x129576['interactionId']+':'+_0x129576['id']}),this['clearLoadingMessage']();});}async['addFeedItemAISuggestion'](_0x71f4e2){const _0x169b3f=Fs(this['context']);let _0x73a07f=_0x169b3f['config']['get']('ai.availableReplyActions')||[...gn];if(_0x169b3f['plugins']['has']('TrackChanges')){if(!this['_isTrackChangesCommandValueBound']){this['_isTrackChangesCommandValueBound']=!0x0;const _0x5c2bf5=_0x169b3f['commands']['get']('trackChanges');this['_view']['chatFeed']['bind']('isTrackChangesOn')['to'](_0x5c2bf5,'value');}}else _0x73a07f=_0x73a07f['filter'](_0x22772e=>'insertSuggestion'!=_0x22772e);return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('ai-suggestion-reply',{'id':_0x71f4e2['interactionId']+':'+_0x71f4e2['id'],'areActionsDisabled':_0x71f4e2['areActionsDisabled'],'showDiff':this['showDiff'],'availableActions':_0x73a07f}),this['clearLoadingMessage']();});}async['addFeedInteractionHeader'](_0x2f0c61,_0x37dd16){return this['_promiseQueue']['enqueue'](async()=>{const _0x4ded80=this['_view']['chatFeed']['children']['last'];if(_0x4ded80 instanceof Yn)return this['_view']['chatFeed']['children']['remove'](_0x4ded80),void this['_view']['chatFeed']['addItem']('interaction-header',{'id':_0x2f0c61['id'],'capabilities':{'isWebSearchEnabled':_0x4ded80['capabilities']['isWebSearchEnabled']||_0x37dd16['isWebSearchEnabled'],'isReasoningEnabled':_0x4ded80['capabilities']['isReasoningEnabled']||_0x37dd16['isReasoningEnabled']}});this['_view']['chatFeed']['addItem']('interaction-header',{'id':_0x2f0c61['id'],'capabilities':_0x37dd16});});}async['addFeedItemCustomElement'](_0x54c46c,_0x4b8869){let _0x165fb2;return await this['_promiseQueue']['enqueue'](async()=>{_0x165fb2=this['_view']['chatFeed']['addItem']('custom-element',{'content':_0x54c46c,'id':_0x4b8869});}),_0x165fb2;}['removeFeedItem'](_0x50caa4){this['_view']['chatFeed']['removeItem'](_0x50caa4);}['hasFeedItem'](_0x338ef3){return this['_view']['chatFeed']['hasItem'](_0x338ef3);}['updateFeedInteractionHeader'](_0x5d6a6f){const _0x4a70c7=this['_view']['chatFeed']['children']['find'](_0x26e1e7=>_0x26e1e7['options']['id']==_0x5d6a6f['id']&&_0x26e1e7 instanceof Yn);_0x4a70c7&&_0x4a70c7['set']('isVisible',_0x5d6a6f['isVisible']);}async['updateFeedItemAIReplyContent'](_0x3a222a){const _0x1cd37e=_0x3a222a['renderingStrategy']||this['feedItemRenderingStrategy'];return this['_promiseQueue']['enqueue'](async _0x5a3283=>{await this['_view']['chatFeed']['updateReplyItem']({..._0x3a222a,'abortSignal':_0x5a3283,'renderingStrategy':_0x1cd37e}),_0x3a222a['isDone']&&this['markFeedItemAsDone'](_0x3a222a['id']);});}['updateFeedItemAIReplySources'](_0x1473bc,_0x35f15f){this['_view']['chatFeed']['updateWebSources'](_0x1473bc,_0x35f15f);}async['updateFeedItemAIReplySuggestionContent'](_0x28667d){const _0xc05fe8=_0x28667d['renderingStrategy']||this['feedItemRenderingStrategy'];return this['_promiseQueue']['enqueue'](async _0x330795=>{await this['_view']['chatFeed']['updateSuggestionItem']({..._0x28667d,'abortSignal':_0x330795,'renderingStrategy':_0xc05fe8}),_0x28667d['isDone']&&this['markFeedItemAsDone'](_0x28667d['id']);});}['updateFeedItemAIReplySuggestionPartState'](_0x540390){this['_view']['chatFeed']['updateSuggestionPartState'](_0x540390);}['setFeedItemAIReplySuggestionPartActive'](_0x3f5588){this['_view']['chatFeed']['setSuggestionPartActive'](_0x3f5588);}['markFeedItemAsDone'](_0x27ed78){this['_view']['chatFeed']['markItemAsDone'](_0x27ed78);}['removeFeedInteraction'](_0x233e89){this['_view']['chatFeed']['getItemIds']()['filter'](_0x64c73=>_0x64c73['startsWith'](_0x233e89))['forEach'](_0x371728=>this['_view']['chatFeed']['removeItem'](_0x371728));}['startInteraction'](){const _0x11957b=this['prepareLoadingMessage']({'isWebSearchEnabled':!0x1,'isReasoningEnabled':!0x1});this['setLoadingMessage'](_0x11957b),this['_view']['chatControls']['disableModelSelector'](!this['context']['config']['get']('ai.models.showModelSelector')),this['isBusy']=!0x0,this['_view']['chatFeed']['startAutoScroll']();}['stopInteraction'](_0x572489){this['_promiseQueue']['abort'](),this['_view']['chatFeed']['getItemIds']()['filter'](_0x586c69=>_0x586c69['startsWith'](_0x572489['id']))['forEach'](_0x4d1483=>this['markFeedItemAsDone'](_0x4d1483)),this['isBusy']=!0x1,this['_view']['chatFeed']['stopAutoScroll']();}async['finishInteraction'](){return this['_promiseQueue']['queueEmptyPromise']['then'](()=>{this['isBusy']=!0x1,this['_view']['chatFeed']['stopAutoScroll']();});}['addContextItem'](_0x537d26,_0x1a48f4){this['_view']['chatControls']['addContextItem'](_0x537d26,_0x1a48f4);}['removeContextItem'](_0x43cce7){this['_view']['chatControls']['removeContextItem'](_0x43cce7);}['setContextItemLoading'](_0x40caa9,_0x24a999){this['_view']['chatControls']['setContextItemLoading'](_0x40caa9,_0x24a999);}['setIsUploadInProgress'](_0x56c4fb){this['_view']['chatControls']['setIsUploadInProgress'](_0x56c4fb);}['setConversationContext'](_0x1a725e){this['_view']['chatControls']['setConversationContext'](_0x1a725e);}['clearPendingContextUI'](){this['_view']['chatControls']['clearPendingContextUI']();}['clearConversationContextUI'](){this['_view']['chatControls']['clearConversationContextUI']();}['updateResourceState'](_0x3df3cf,_0x43ff04,_0x4b63cd){this['_view']['chatControls']['updateResourceState'](_0x3df3cf,_0x43ff04,_0x4b63cd);}['resetMessageInput'](){this['_view']['chatControls']['resetMessageInput'](),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder']());}['setAddContextOptions'](_0x52e10d){this['_view']['chatControls']['setAddContextOptions'](_0x52e10d);}['updateCapabilities'](_0x2d8c44){this['_view']['chatControls']['setWebSearch'](_0x2d8c44['isWebSearchEnabled']),this['_view']['chatControls']['setReasoning'](_0x2d8c44['isReasoningEnabled']),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder'](_0x2d8c44));}['setSelectedModel'](_0x187bdb,_0x6dd4b8){this['_view']['chatControls']['setModel'](_0x187bdb),_0x6dd4b8&&this['_view']['chatControls']['disableModelSelector'](!0x1);}['setFeedItemRenderingStrategy'](_0x6281e3){this['feedItemRenderingStrategy']=_0x6281e3;}['toggleLoadingSkeleton'](_0x396cfc){this['_view']['chatFeed']['toggleLoadingSkeleton'](_0x396cfc);}['resetConversationTitle'](){this['setConversationTitle'](as(this['context']['locale'],'AI_CHAT_HEADING'));}['setConversationTitle'](_0x45164f,_0x10cb32=!0x1){if(_0x10cb32&&!St()&&_0x45164f['length'])return this['_view']['chatHeader']['label']='',void this['_animateConversationTitle'](_0x45164f);this['_view']['chatHeader']['label']=_0x45164f;}['setLoadingMessage'](_0x24bb42){this['_view']['chatFeed']['setLoadingMessage'](_0x24bb42);}['clearLoadingMessage'](){this['_view']['chatFeed']['setLoadingMessage']('');}['_animateConversationTitle'](_0x42f483){let _0x1045c6=0x0;clearInterval(this['_titleAnimationInterval']),this['_titleAnimationInterval']=setInterval(()=>{this['_view']['chatHeader']['label']=this['_view']['chatHeader']['label']+_0x42f483[_0x1045c6],_0x1045c6++,_0x1045c6===_0x42f483['length']&&clearInterval(this['_titleAnimationInterval']);},0x1e);}['setIsMaximized'](_0x1312c3){this['_view']['chatHeader']['isMaximized']=_0x1312c3;}['prepareLoadingMessage'](_0xfc3db3){return _0xfc3db3['isWebSearchEnabled']&&_0xfc3db3['isReasoningEnabled']?as(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH_REASONING'):_0xfc3db3['isWebSearchEnabled']?as(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH'):_0xfc3db3['isReasoningEnabled']?as(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_REASONING'):as(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_REGULAR');}['_getInputPlaceholder'](_0x14b4d0){return _0x14b4d0?_0x14b4d0['isWebSearchEnabled']&&_0x14b4d0['isReasoningEnabled']?as(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH_REASONING'):_0x14b4d0['isWebSearchEnabled']?as(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH'):_0x14b4d0['isReasoningEnabled']?as(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REASONING'):as(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REGULAR'):as(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REGULAR');}['populateSourceResourceBalloon'](_0x56563b,_0x13f573,_0x533c6a,_0x52ec02){this['_view']['populateSourceResourceBalloon'](_0x56563b,_0x13f573,_0x533c6a,_0x52ec02);}['closeSourceResourceBalloon'](_0x544894){this['_view']['closeSourceResourceBalloon'](_0x544894);}['setPromptInputValue'](_0x1f6dcc){this['_view']['chatControls']['setPromptInputValue'](_0x1f6dcc);}['focusPromptInput'](_0x14cc6a=!0x1){this['_view']['chatControls']['focusPromptInput'](_0x14cc6a);}['scrollFeedToSuggestion'](_0x12194c,_0x37f010){this['_view']['chatFeed']['scrollToSuggestion'](_0x12194c,_0x37f010);}['startAutoScroll'](){this['_view']['chatFeed']['startAutoScroll']();}['disableControls'](){this['_view']['chatControls']['isDisabled']=!0x0;}['enableControls'](){this['_view']['chatControls']['isDisabled']=!0x1;}}class ta extends Lt{['sections'];constructor(_0x447c77,_0x380f45){super(_0x447c77),this['sections']=_0x380f45,this['items']['addMany'](this['sections']),this['extendTemplate']({'attributes':{'class':['ck-ai-chat-history__sections']}});}['filter'](_0x563124){let _0x1cbb05=0x0,_0xd117c=0x0;for(const _0x1a3127 of this['sections']){const {resultsCount:_0x42b014,totalItemsCount:_0x4a68de}=_0x1a3127['filter'](_0x563124);_0x1cbb05+=_0x42b014,_0xd117c+=_0x4a68de;}return{'resultsCount':_0x1cbb05,'totalItemsCount':_0xd117c};}}class ea extends Pt{['title'];['itemsViews'];['_itemsListView'];constructor(_0x6d8dda,{title:_0x2dc177,items:_0x169a54}){super(_0x6d8dda);const _0x46336d=this['bindTemplate'];this['set']('isVisible',!0x0),this['title']=_0x2dc177,this['itemsViews']=_0x169a54;const _0x2b8894=new Nt(_0x6d8dda);_0x2b8894['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-history__section-title']},'children':[this['title']]}),this['_itemsListView']=new Lt(_0x6d8dda),this['_itemsListView']['items']['addMany'](this['itemsViews']),this['setTemplate']({'tag':'li','attributes':{'class':['ck-ai-chat-history__section',_0x46336d['if']('isVisible','ck-hidden',_0x5b6380=>!_0x5b6380)]},'children':[_0x2b8894,this['_itemsListView']]});}['filter'](_0xb99708){const _0x7451dc=this['itemsViews']['length'];let _0x591192=0x0;for(const _0x2aa74e of this['itemsViews']){if(_0xb99708){const _0x4d8387=_0x2aa74e['isMatching'](_0xb99708);_0x2aa74e['isVisible']=!!_0x4d8387,_0x2aa74e['highlightText'](_0xb99708);}else _0x2aa74e['isVisible']=!0x0,_0x2aa74e['highlightText'](null);_0x2aa74e['isVisible']&&_0x591192++;}return this['isVisible']=_0x591192>0x0,{'resultsCount':_0x591192,'totalItemsCount':_0x7451dc};}['getItem'](_0x54ca09){return this['itemsViews']['find'](_0x561188=>_0x561188['id']===_0x54ca09);}['removeItem'](_0x150838){const _0x51a984=this['itemsViews']['indexOf'](_0x150838);-0x1!==_0x51a984&&(this['itemsViews']['splice'](_0x51a984,0x1),this['_itemsListView']['items']['remove'](_0x150838));}}class ia extends/* #__PURE__ -- @preserve */
27
- _0x7782a9(Pt){['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(_0x4b20d0,_0xda4bf3){super(_0x4b20d0);const _0x9c0784=this['bindTemplate'];this['set']('isEdit',!0x1),this['set']('isVisible',!0x0),this['set']('pinned',!!_0xda4bf3['pinned']),this['set']('loadingState',null),this['id']=_0xda4bf3['id'];const {title:_0x53f13c,createdAt:_0x50a290,active:_0x181204=!0x1}=_0xda4bf3;this['_titleView']=new _0x50c963(),this['_titleView']['text']=_0x53f13c,this['_titleView']['extendTemplate']({'attributes':{'class':['ck-ai-chat-history__item-title']}});const _0x2ea2df=this['_createCheckView'](),_0x417740=this['_createPinButtonView'](_0x4b20d0),_0x390146=this['_createMenuDropdownView'](),_0x34175c=this['_createEditInputView'](_0x4b20d0,_0x53f13c),_0xb4499b=this['_createAcceptEditButtonView'](_0x4b20d0,_0x34175c),_0x22f97b=this['_createCancelEditButtonView'](_0x4b20d0,_0x34175c);this['actions']=this['createCollection'](),this['mainContent']=this['createCollection'](),this['mainContent']['add'](this['_titleView']),this['actions']['add'](_0x417740),this['actions']['add'](_0x390146),this['on']('change:isEdit',(_0x52367d,_0x5189aa,_0xf6bd04)=>{this['actions']['clear'](),this['mainContent']['clear'](),_0xf6bd04?(this['actions']['add'](_0xb4499b),this['actions']['add'](_0x22f97b),this['mainContent']['add'](_0x34175c),_0x34175c['element']['focus']()):(this['actions']['add'](_0x417740),this['actions']['add'](_0x390146),this['mainContent']['add'](this['_titleView']));}),this['setTemplate']({'tag':'li','attributes':{'class':['ck-ai-chat-history__item',_0x181204?'ck-ai-chat-history__item--active':'',_0x9c0784['if']('isVisible','ck-hidden',_0x3426c3=>!_0x3426c3),_0x9c0784['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',_0x9c0784['if']('loadingState','ck-hidden',_0x221bae=>!!_0x221bae)]},'children':_0x181204?[_0x2ea2df]:[]},{'tag':'div','attributes':{'class':['ck-ai-loader',_0x9c0784['if']('loadingState','ck-hidden',_0x4817bc=>!_0x4817bc)]},'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',_0x9c0784['if']('loadingState','ck-hidden',_0x1042de=>!!_0x1042de)]},'children':this['mainContent']},{'tag':'div','attributes':{'class':['ck-ai-loader__text',_0x9c0784['if']('loadingState','ck-hidden',_0x4a6d79=>!_0x4a6d79)]},'children':[{'text':_0x9c0784['to']('loadingState',_0x1908e5=>_0x1908e5?as(this['locale'],ia['LOADING_LABELS'][_0x1908e5]):'')}]}]},{'tag':'span','attributes':{'class':['ck-ai-chat-history__item-date']},'children':[_0x50a290]}]},{'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'](_0x3af4d1){this['_titleView']['text']=_0x3e5077(_0x3af4d1);}['updateLoadingState'](_0x2c7e69,_0x2e0faa){this['set']('loadingState',_0x2e0faa?_0x2c7e69:null);}['_createCheckView'](){const _0x6f3df1=new yt();return _0x6f3df1['set']({'content':_0x4c3d0d}),_0x6f3df1;}['_createPinButtonView'](_0xf9a050){const _0x580a19=new kt(_0xf9a050);return _0x580a19['set']({'label':as(_0xf9a050,'AI_CHAT_HISTORY_PIN_BUTTON'),'icon':_0x54ea24,'withText':!0x1,'tooltip':!0x0}),_0x580a19['bind']('isOn')['to'](this,'pinned'),_0x580a19['on']('execute',()=>{const _0x3904f2=!this['pinned'];this['fire']('setConversationPinned',{'id':this['id'],'pinned':_0x3904f2});}),_0x580a19;}['_createMenuDropdownView'](){const _0x1269dc=Bt(this['locale']),_0x32e8a1=_0x1269dc['panelView']['children'];_0x1269dc['buttonView']['set']({'label':as(this['locale'],'AI_CHAT_HISTORY_SHOW_MORE_ITEMS'),'icon':_0xd0791b}),_0x1269dc['panelPosition']='sw';const _0x1d6db5=new kt(this['locale']);_0x1d6db5['label']=as(this['locale'],'AI_CHAT_HISTORY_EDIT_NAME'),_0x1d6db5['withText']=!0x0,_0x1d6db5['on']('execute',()=>{this['isEdit']=!0x0;});const _0x4d6bef=new kt(this['locale']);_0x4d6bef['label']=as(this['locale'],'AI_CHAT_HISTORY_REMOVE'),_0x4d6bef['withText']=!0x0,_0x4d6bef['on']('execute',()=>{this['showConfirm'](as(this['locale'],'AI_CHAT_HISTORY_REMOVE_CONFIRM'),this['element'])['then'](()=>{this['fire']('removeConversation',{'id':this['id']});});});const _0x468cad=new Lt(this['locale']),_0x49693d=new Pt(this['locale']);_0x49693d['children']['add'](_0x1d6db5);const _0x411a77=new Pt(this['locale']);return _0x411a77['children']['add'](_0x4d6bef),_0x468cad['items']['addMany']([_0x49693d,_0x411a77]),_0x32e8a1['add'](_0x468cad),_0x1269dc;}['_createEditInputView'](_0x1bb34c,_0x296c0e){const _0x1d5883=new _0x26d7bf(_0x1bb34c),_0x35070f=_0x1d5883['bindTemplate'];return _0x1d5883['value']=_0x296c0e,_0x1d5883['extendTemplate']({'on':{'keydown':_0x35070f['to'](_0x4981fa=>{'Enter'==_0x4981fa['key']&&this['_commitEditInputValue'](_0x1d5883);})}}),_0x1d5883;}['_createAcceptEditButtonView'](_0xb1c98e,_0x364268){const _0x28d7d3=new kt(_0xb1c98e);return _0x28d7d3['set']({'icon':_0x4c3d0d,'withText':!0x1,'tooltip':as(_0xb1c98e,'AI_CHAT_HISTORY_ACCEPT')}),_0x28d7d3['extendTemplate']({'attributes':{'class':['ck-confirm-view-submit']}}),_0x28d7d3['on']('execute',()=>{this['_commitEditInputValue'](_0x364268);}),_0x28d7d3;}['_commitEditInputValue'](_0x2d8a0b){const _0x46c111=_0x2d8a0b['element']['value']||'';this['_titleView']['text']=_0x46c111,this['isEdit']=!0x1,this['fire']('editConversationTitle',{'id':this['id'],'title':_0x46c111});}['_createCancelEditButtonView'](_0x35fc68,_0x1f9147){const _0x383f1f=new kt(_0x35fc68);return _0x383f1f['set']({'icon':_0x52715b,'withText':!0x1,'tooltip':as(_0x35fc68,'AI_CHAT_HISTORY_CANCEL')}),_0x383f1f['extendTemplate']({'attributes':{'class':['ck-confirm-view-cancel']}}),_0x383f1f['on']('execute',()=>{this['isEdit']=!0x1,_0x1f9147['value']=this['_titleView']['text']||'',this['fire']('edit:cancel');}),_0x383f1f;}['_createSpinnerView'](){const _0x1346c5=new fn('tiny');return _0x1346c5['isVisible']=!0x0,_0x1346c5;}['isMatching'](_0x2df9eb){return this['_titleView']&&'string'==typeof this['_titleView']['text']&&this['_titleView']['text']['match'](_0x2df9eb)?{'title':!0x0}:null;}['highlightText'](_0x58f622){this['_titleView']['highlightText'](_0x58f622);}}class sa extends Nt{['searchView'];['mainErrorView'];['skeletonView'];['emptyView'];['sectionsView'];['resizeButton'];constructor(_0x5033c6,_0x5216a5){super(_0x5033c6),this['set']('hasItems',!0x1),this['set']('isLoading',!0x0),this['set']('errorMessage',''),this['set']('isMaximized',!0x1),this['set']('isSearchViewVisible',!0x1),this['set']('isEmptyViewVisible',!0x1),this['set']('isMainErrorViewVisible',!0x1);const _0x18a8b8=new _0x2229a9(_0x5033c6,{'label':as(_0x5033c6,'AI_CHAT_HISTORY_HEADING'),'icon':_0x16c2fc,'class':'ck-ai-header\x20ck-ai-header_history'});_0x5216a5&&(this['resizeButton']=ls(_0x5033c6,this),_0x18a8b8['children']['add'](this['resizeButton'])),this['sectionsView']=new ta(_0x5033c6,[]),this['sectionsView']['delegate'](...na)['to'](this),this['mainErrorView']=this['_createErrorView'](),this['skeletonView']=this['_createSkeletonView'](),this['emptyView']=this['_createEmptyStateView'](),this['searchView']=this['_createSearchView'](),this['mainErrorView']['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isMainErrorViewVisible','ck-hidden',_0x3e0f57=>!_0x3e0f57)]}}),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':[_0x18a8b8,{'tag':'div','attributes':{'class':['ck-ai-chat-history__content']},'children':[this['skeletonView'],this['mainErrorView'],this['emptyView'],this['searchView']]}]});}['_updateViewVisibility'](){this['isSearchViewVisible']=!this['isLoading']&&this['hasItems'],this['isEmptyViewVisible']=!this['isLoading']&&!this['hasItems']&&!this['errorMessage'],this['isMainErrorViewVisible']=!this['isSearchViewVisible']&&!!this['errorMessage'];}['_createSearchView'](){const _0x22f66b=new _0xb89745(this['locale'],{'filteredView':this['sectionsView'],'queryView':{'label':as(this['locale'],'AI_CHAT_HISTORY_SEARCH_LABEL')},'infoView':{'text':{'notFound':{'primary':_0x5c2210=>as(this['locale'],'AI_CHAT_HISTORY_SEARCH_NOT_FOUND_PRIMARY',_0x5c2210),'secondary':as(this['locale'],'AI_CHAT_HISTORY_SEARCH_NOT_FOUND_SECONDARY')}}}}),_0x36ab9e=this['_createErrorView']();return _0x36ab9e['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('errorMessage','ck-hidden',_0x2dc72e=>!_0x2dc72e)]}}),_0x22f66b['on']('render',()=>{_0x22f66b['children']['add'](_0x36ab9e,0x1);}),_0x22f66b['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isSearchViewVisible','ck-hidden',_0x572637=>!_0x572637)]}}),_0x22f66b;}['_createSkeletonView'](){const _0x34e353=new zn(this['locale'],jn['aiHistory']);return _0x34e353['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isLoading','ck-hidden',_0x3506a6=>!_0x3506a6)]}}),_0x34e353;}['_createErrorView'](){const _0xc6a34a=new Nt(this['locale']),_0xd14195=new kt(this['locale']);_0xd14195['set']({'withText':!0x1,'icon':_0x52715b,'class':'ck-ai-notification_error__dismiss-button'}),_0xd14195['bind']('isVisible')['to'](this,'hasItems',_0x25e7e7=>!!_0x25e7e7),_0xd14195['on']('execute',()=>{this['errorMessage']='';});const _0x10e045=this['bindTemplate'];return _0xc6a34a['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-notification','ck-ai-notification_error']},'children':[{'tag':'p','children':[{'text':_0x10e045['to']('errorMessage')}]},_0xd14195]}),_0xc6a34a;}['_createEmptyStateView'](){const _0x15b35d=new kt(this['locale']);_0x15b35d['set']({'label':as(this['locale'],'AI_CHAT_LABEL_NEW_CHAT'),'withText':!0x0,'icon':_0x5885f1,'class':'ck-ai-chat__start-conversation\x20'+hs}),_0x15b35d['on']('execute',()=>{this['fire']('openChat');});const _0x2c5b1d=new Nt(this['locale']);return _0x2c5b1d['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-history__empty',this['bindTemplate']['if']('isEmptyViewVisible','ck-hidden',_0x517eb=>!_0x517eb)]},'children':[{'tag':'p','attributes':{'class':['ck-ai-chat-history__empty-message']},'children':[as(this['locale'],'AI_CHAT_HISTORY_EMPTY_MESSAGE')]},_0x15b35d]}),_0x2c5b1d;}['_createListItemViews'](_0x3761a0,_0x52048d){const _0x36a4c0=[];for(const _0x1cf8a0 of _0x3761a0){const _0xc6e05=new ia(_0x52048d,_0x1cf8a0);_0xc6e05['delegate'](...na)['to'](this),_0x36a4c0['push'](_0xc6e05);}return _0x36a4c0;}['updateHistoryItemsWithCategories'](_0x32ba0c){const _0x3b3b13=this['locale']||'en',_0x8c2830=[];for(const _0xad701d of _0x32ba0c){const _0x871ced=this['_createListItemViews'](_0xad701d['items'],_0x3b3b13);_0x8c2830['push'](new ea(_0x3b3b13,{'title':_0xad701d['title'],'items':_0x871ced}));}this['sectionsView']['sections']=_0x8c2830,this['sectionsView']['items']['clear'](),this['sectionsView']['items']['addMany'](_0x8c2830),this['hasItems']=_0x32ba0c['some'](_0x53702f=>_0x53702f['items']['length']>0x0),this['_refreshSearch']();}['removeHistoryItem'](_0x4e52ff){for(const _0x27c56d of this['sectionsView']['sections']){const _0x11773a=_0x27c56d['getItem'](_0x4e52ff);if(_0x11773a){if(_0x27c56d['removeItem'](_0x11773a),0x0===_0x27c56d['itemsViews']['length']){const _0x3f0b9b=this['sectionsView']['sections']['indexOf'](_0x27c56d);-0x1!==_0x3f0b9b&&(this['sectionsView']['sections']['splice'](_0x3f0b9b,0x1),this['sectionsView']['items']['remove'](_0x27c56d));}this['hasItems']=this['sectionsView']['sections']['length']>0x0,this['_refreshSearch']();break;}}}['updateItemTitle'](_0x5582b8,_0x47a63c){for(const _0x42bddb of this['sectionsView']['sections']){const _0x2b5623=_0x42bddb['getItem'](_0x5582b8);if(_0x2b5623){_0x2b5623['updateTitle'](_0x47a63c);break;}}}['updateItemLoadingState'](_0x15b2bb,_0x57fc2c,_0x481ef2){for(const _0xebbc63 of this['sectionsView']['sections']){const _0x22a700=_0xebbc63['getItem'](_0x15b2bb);if(_0x22a700){_0x22a700['updateLoadingState'](_0x57fc2c,_0x481ef2);break;}}}['_refreshSearch'](){if(this['hasItems']){const _0x215cdc=this['searchView']['queryView']['fieldView']?.['element']?.['value']||'';this['searchView']['search'](_0x215cdc);}}}const na=['showConversationHistory','removeConversation','editConversationTitle','setConversationPinned','selectConversation','openChat','resizeTabs'];class ra extends _0x1f4c78{static get['requires'](){return[ns];}['_historyView'];static get['pluginName'](){return'AIChatHistoryUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x113376){super(_0x113376);const _0x52f7dd=this['context']['plugins']['get']('AITabs');this['_historyView']=new sa(this['context']['locale'],_0x52f7dd['showResizeButton']),this['_historyView']['delegate'](...na)['to'](this),_0x52f7dd['view']['addTab']({'id':'history','buttonLabel':as(this['context']['locale'],'AI_CHAT_HISTORY_HEADING'),'buttonIcon':_0x16c2fc,'order':0x0,'content':this['_historyView']});}['removeHistoryItem'](_0x94e2e9){this['_historyView']['removeHistoryItem'](_0x94e2e9);}['updateItems'](_0x22195a){this['_historyView']['updateHistoryItemsWithCategories'](_0x22195a);}['updateItemTitle'](_0x5efcc6,_0x55ea5b){this['_historyView']['updateItemTitle'](_0x5efcc6,_0x55ea5b);}['updateItemLoadingState'](_0x3fffb0,_0x286919,_0x142196){this['_historyView']['updateItemLoadingState'](_0x3fffb0,_0x286919,_0x142196);}['setLoadingSkeleton'](_0x3a542f){this['_historyView']['isLoading']=_0x3a542f;}['showError'](_0x54b7c2){this['_historyView']['errorMessage']=_0x54b7c2;}['hideError'](){this['_historyView']['errorMessage']='';}['setIsMaximized'](_0x8ebfc8){this['_historyView']['isMaximized']=_0x8ebfc8;}}class aa extends ht(){['id'];['createdAt'];constructor({id:_0x1269e9,title:_0x42edf4,createdAt:_0x3f2e0a,updatedAt:_0x16fbaf,pinned:_0x446dd5}){super(),this['id']=_0x1269e9,this['createdAt']=new Date(_0x3f2e0a),this['set']('title',_0x42edf4),this['set']('updatedAt',_0x16fbaf?new Date(_0x16fbaf):null),this['set']('pinned',_0x446dd5||!0x1);}['updateTitle'](_0x3beb0c){this['set']('title',_0x3e5077(_0x3beb0c)),this['updatedAt']=new Date();}['updatePinned'](_0x31cab9){this['set']('pinned',_0x31cab9),this['updatedAt']=new Date();}}class oa extends pt(){['items']=[];['connector'];['group'];constructor({connector:_0x5d7a04,group:_0x2d933a}){super(),this['connector']=_0x5d7a04,this['group']=_0x2d933a;}async['init'](){try{const _0x334e49=this['connector']['fetchConversations'](this['group']),_0x53ef71=await _0x334e49['getConversations']();this['loadItems'](_0x53ef71);}catch(_0x9c90c8){this['fire']('error',{'error':_0x9c90c8,'operation':'init'});}}['addItem'](_0x214cf1){this['items']['push'](_0x214cf1);}async['removeItem'](_0x31ec30){const _0x96b44e=this['items']['findIndex'](_0x1a2752=>_0x1a2752['id']===_0x31ec30);if(-0x1===_0x96b44e)return!0x1;try{return await this['connector']['deleteConversation'](_0x31ec30)['execute'](),this['items']['splice'](_0x96b44e,0x1),this['fire']('itemRemoved',{'itemId':_0x31ec30}),!0x0;}catch(_0x264939){return this['fire']('error',{'error':_0x264939,'operation':'removeItem','itemId':_0x31ec30}),!0x1;}}['getItem'](_0x3335cb){return this['items']['find'](_0x39ffe4=>_0x39ffe4['id']===_0x3335cb);}async['updateItemTitle'](_0x146080,_0x19a0ba){const _0x4a67b3=this['getItem'](_0x146080);if(!_0x4a67b3)return!0x1;try{return await this['connector']['updateConversation'](_0x146080,{'title':_0x19a0ba})['getResult'](),_0x4a67b3['updateTitle'](_0x19a0ba),this['fire']('itemUpdated',{'itemId':_0x146080,'updates':{'title':_0x19a0ba}}),!0x0;}catch(_0x570fb1){return this['fire']('error',{'error':_0x570fb1,'operation':'updateItemTitle','itemId':_0x146080}),!0x1;}}async['updateItemPinned'](_0x190a57,_0x598a07){const _0x4274a9=this['getItem'](_0x190a57);if(!_0x4274a9)return!0x1;try{return await this['connector']['updateConversation'](_0x190a57,{'pinned':_0x598a07})['getResult'](),_0x4274a9['updatePinned'](_0x598a07),this['fire']('itemUpdated',{'itemId':_0x190a57,'updates':{'pinned':_0x598a07}}),!0x0;}catch(_0x44cb99){return this['fire']('error',{'error':_0x44cb99,'operation':'updateItemPinned','itemId':_0x190a57}),!0x1;}}['loadItems'](_0x127fd2){try{this['items']=[],_0x127fd2['map'](_0x4fbea4=>{this['addItem'](new aa(_0x4fbea4));}),this['fire']('itemsLoaded',{'items':[...this['items']]});}catch(_0xfbd253){this['fire']('error',{'error':_0xfbd253,'operation':'loadItems'});}}['getItems'](_0x527978={}){const _0x455465=void 0x0!==_0x527978['pinned']&&_0x527978['pinned'],_0x3d05c3=_0x527978['from']?new Date(_0x527978['from']['getFullYear'](),_0x527978['from']['getMonth'](),_0x527978['from']['getDate']()):null,_0xa140cf=_0x527978['to']?new Date(_0x527978['to']['getFullYear'](),_0x527978['to']['getMonth'](),_0x527978['to']['getDate']()):null;return this['items']['filter'](_0xb64aa3=>{if(_0xb64aa3['pinned']!==_0x455465)return!0x1;if(_0xa140cf){const _0x38fa5c=new Date(_0xb64aa3['createdAt']['getFullYear'](),_0xb64aa3['createdAt']['getMonth'](),_0xb64aa3['createdAt']['getDate']());return _0x3d05c3?_0x3d05c3['getTime']()===_0xa140cf['getTime']()?_0x38fa5c['getTime']()===_0x3d05c3['getTime']():_0x38fa5c<_0xa140cf&&_0x38fa5c>=_0x3d05c3:_0x38fa5c<_0xa140cf;}return!0x0;});}}class ha extends _0x1f4c78{['_aiConnector'];['_aiChatHistoryUi'];['_aiChatController'];static get['requires'](){return[rs,Ys,ra,ns];}static get['pluginName'](){return'AIChatHistoryController';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){this['_aiConnector']=this['context']['plugins']['get'](rs),this['_aiChatHistoryUi']=this['context']['plugins']['get'](ra),this['_aiChatController']=this['context']['plugins']['get'](Ys);const _0x28f165=this['context']['plugins']['get'](ns);try{const _0x4a59ec=this['_aiChatController']['getGroupId']();this['history']=new oa({'connector':this['_aiConnector'],'group':_0x4a59ec}),this['listenTo'](this['_aiChatHistoryUi'],'removeConversation',(_0x506c64,_0x5d0d32)=>{this['_setItemLoading'](_0x5d0d32['id'],'remove'),this['_handleRemove'](_0x5d0d32['id']);}),this['listenTo'](this['_aiChatHistoryUi'],'editConversationTitle',(_0x4984fc,_0x13caf2)=>{this['_setItemLoading'](_0x13caf2['id'],'rename'),this['_handleEditTitle'](_0x13caf2['id'],_0x13caf2['title']);}),this['listenTo'](this['history'],'itemUpdated',(_0x53b554,_0x505783)=>{void 0x0!==_0x505783['updates']['title']&&this['_aiChatHistoryUi']['updateItemTitle'](_0x505783['itemId'],_0x505783['updates']['title']),void 0x0!==_0x505783['updates']['pinned']&&this['_updateHistoryItemsUI'](),this['_clearItemLoading'](_0x505783['itemId']);}),this['listenTo'](this['history'],'itemRemoved',(_0x4be444,_0x4d6eae)=>{this['_aiChatController']['_handleRemovedConversation'](_0x4d6eae['itemId']),this['_aiChatHistoryUi']['removeHistoryItem'](_0x4d6eae['itemId']),this['_clearItemLoading'](_0x4d6eae['itemId']);}),this['listenTo'](this['history'],'itemsLoaded',()=>{this['_updateHistoryItemsUI']();}),this['listenTo'](this['history'],'error',(_0x4c63d4,_0x1cc83d)=>{this['_handleHistoryErrorUI'](_0x1cc83d['error'],_0x1cc83d['operation'],_0x1cc83d['itemId']);}),this['listenTo'](this['_aiChatHistoryUi'],'selectConversation',(_0x193611,_0x3fb43d)=>{this['_handleSelectConversation'](_0x3fb43d['id']);}),this['listenTo'](this['_aiChatHistoryUi'],'setConversationPinned',(_0x56be67,_0x54defa)=>{const _0x2fef04=_0x54defa['pinned']?'pin':'unpin';this['_setItemLoading'](_0x54defa['id'],_0x2fef04),this['_handleTogglePin'](_0x54defa['id'],_0x54defa['pinned']);}),this['listenTo'](this['_aiChatHistoryUi'],'openChat',()=>{_0x28f165['view']['activateTab']('chat');}),this['listenTo'](this['_aiChatController'],'change:activeConversation',()=>{this['_updateHistoryItemsUI']();}),_0x28f165['view']['on']('activateTab:history',()=>{this['_showConversationHistory']();}),this['listenTo'](_0x28f165,'resizedTabs',(_0x3796be,_0x9b9760)=>{this['_setIsMaximized'](_0x9b9760);}),this['listenTo'](this['_aiChatHistoryUi'],'resizeTabs',()=>{_0x28f165['resize']();});}catch(_0x2521bf){this['_handleHistoryErrorUI'](_0x2521bf,'init');}}async['_handleEditTitle'](_0x58ea2a,_0x4b2708){await this['history']['updateItemTitle'](_0x58ea2a,_0x4b2708);}async['_handleTogglePin'](_0x2ef7d4,_0x45b724){await this['history']['updateItemPinned'](_0x2ef7d4,_0x45b724);}async['_handleRemove'](_0x4f1539){await this['history']['removeItem'](_0x4f1539);}async['_handleSelectConversation'](_0x499a18){await this['_aiChatController']['loadConversation'](_0x499a18);}async['_showConversationHistory'](){this['_aiChatHistoryUi']['showError'](''),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x0),await this['history']['init'](),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x1);}['_updateHistoryItemsUI'](){const _0x1322b6=this['_aiChatController']['activeConversation']?.['id'],_0x81ccdf=this['_getCategorizedItems']()['map'](_0x35f28d=>({'title':_0x35f28d['title'],'items':_0x35f28d['items']['map'](_0xbe7655=>({'id':_0xbe7655['id'],'title':_0xbe7655['title']||as(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION'),'createdAt':new Date(_0xbe7655['createdAt'])['toLocaleDateString'](),'active':_0xbe7655['id']===_0x1322b6,'pinned':_0xbe7655['pinned']}))}));this['_aiChatHistoryUi']['updateItems'](_0x81ccdf);}['_setItemLoading'](_0x23bef7,_0x477505){this['_aiChatHistoryUi']['updateItemLoadingState'](_0x23bef7,_0x477505,!0x0);}['_clearItemLoading'](_0x2d8b23){this['_aiChatHistoryUi']['updateItemLoadingState'](_0x2d8b23,null,!0x1);}['_handleHistoryErrorUI'](_0x34fbef,_0x1ac9bf,_0x580950){const _0x33750d=this['_generateErrorMessage'](_0x1ac9bf,_0x580950);this['_aiChatHistoryUi']['showError'](_0x33750d),_0x580950&&this['_clearItemLoading'](_0x580950),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x1);}['_generateErrorMessage'](_0x13e7d3,_0x441e9b){const _0x3ee942=_0x441e9b?this['history']['getItem'](_0x441e9b):null,_0x330ab9=_0x3ee942?.['title']||as(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION');switch(_0x13e7d3){case'updateItemTitle':return as(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_UPDATE_TITLE',_0x330ab9);case'updateItemPinned':{const _0x4f4bb9=as(this['context']['locale'],_0x3ee942?.['pinned']?'AI_CHAT_HISTORY_UNPIN_ACTION':'AI_CHAT_HISTORY_PIN_ACTION');return as(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_UPDATE_PINNED',[_0x4f4bb9,_0x330ab9]);}case'removeItem':return as(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_REMOVE_ITEM',_0x330ab9);case'init':case'loadItems':return as(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_LOAD_ITEMS');default:return as(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_GENERIC');}}['_getCategorizedItems'](){const _0x4d9793=new Date(),_0x307678=new Date(_0x4d9793['getFullYear'](),_0x4d9793['getMonth'](),_0x4d9793['getDate']()),_0xe9a9d7=new Date(_0x307678);_0xe9a9d7['setDate'](_0xe9a9d7['getDate']()-0x1);const _0x1d0c71=new Date(_0x307678);_0x1d0c71['setDate'](_0x1d0c71['getDate']()-0xe);const _0x58daae=this['history']['getItems']({'pinned':!0x0}),_0x5da627=this['history']['getItems']({'from':_0x307678,'to':_0x307678}),_0x4b04c4=this['history']['getItems']({'from':_0xe9a9d7,'to':_0xe9a9d7}),_0x2f7a56=this['history']['getItems']({'from':_0x1d0c71,'to':_0xe9a9d7}),_0x5511c1=this['history']['getItems']({'to':_0x1d0c71}),_0x31fc40=[];return _0x58daae['length']>0x0&&_0x31fc40['push']({'title':as(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_PINNED'),'items':_0x58daae}),_0x5da627['length']>0x0&&_0x31fc40['push']({'title':as(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_TODAY'),'items':_0x5da627}),_0x4b04c4['length']>0x0&&_0x31fc40['push']({'title':as(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_YESTERDAY'),'items':_0x4b04c4}),_0x2f7a56['length']>0x0&&_0x31fc40['push']({'title':as(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_LAST_14_DAYS'),'items':_0x2f7a56}),_0x5511c1['length']>0x0&&_0x31fc40['push']({'title':as(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_LATER'),'items':_0x5511c1}),_0x31fc40;}['_setIsMaximized'](_0x4253c8){this['_aiChatHistoryUi']['setIsMaximized'](_0x4253c8);}}class ca extends _0x1f4c78{static get['requires'](){return[ha,ra];}static get['pluginName'](){return'AIChatHistory';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class la extends _0x1f4c78{static get['requires'](){return[Ys,qs,Zr,ca];}static get['pluginName'](){return'AIChat';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x438dec){super(_0x438dec),this['context']['config']['define']('ai.chat.context',{'document':{'enabled':!0x0},'urls':{'enabled':!0x0},'files':{'enabled':!0x0},'sources':[],'alwaysAddSelection':!0x1}),this['context']['config']['define']('ai.chat.initialConversation','new');}}class ua extends kt{['id'];constructor(_0x164d2f,_0x6bfee){super(_0x164d2f);const {id:_0x411df0,type:_0x383dc9,icon:_0x57acc7}=_0x6bfee;this['id']=_0x411df0,this['set']({'label':_0x6bfee['label'],'withText':!0x0,'class':'ck-ai-chat-shortcut'}),this['extendTemplate']({'attributes':{'data-cke-ai-shortcut-id':_0x6bfee['id']}}),_0x57acc7?this['icon']=_0x57acc7:'chat'===_0x383dc9?this['icon']=_0xfce8a2:'review'===_0x383dc9?this['icon']=_0x458073:'translate'===_0x383dc9&&(this['icon']=_0x5d111c);}}class da extends Nt{['listView'];constructor(_0x3517c5,_0x1db48a){super(_0x3517c5);const _0x38d735=_0x1db48a['map'](_0x31527c=>{const _0x5e1d35=new Pt(this['locale']),_0xbc46c9=new ua(this['locale'],_0x31527c);return _0x5e1d35['children']['add'](_0xbc46c9),_0xbc46c9['delegate']('execute')['to'](this),_0x5e1d35;});this['listView']=new Lt(this['locale']),this['listView']['items']['addMany'](_0x38d735),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat-shortcuts']},'children':[this['listView']]});}}const _a='chat-shortcuts';class Aa extends _0x1f4c78{['_shortcuts'];['_shortcutsView'];['_aiChatUI'];static get['requires'](){return[Zr];}static get['pluginName'](){return'AIChatShortcuts';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){this['_aiChatUI']=this['context']['plugins']['get'](Zr),this['_shortcuts']=this['context']['config']['get']('ai.chat.shortcuts')??[];const _0x2037f5=this['context']['plugins']['get']('AIChatController');this['_shortcuts']['length']&&(this['_validateShortcuts'](),this['_aiChatUI']['on']('conversationCreated',()=>{_0x2037f5['activeConversation']['isFromHistory']||this['_injectShortcuts']();}),this['listenTo'](_0x2037f5,'interactionStarted',()=>{this['_removeShortcuts']();}));}['_validateShortcuts'](){const _0x51432=['chat','review','translate'];this['_shortcuts']['forEach'](_0x4562d7=>{let _0x30a0d5=!0x0;if(_0x4562d7['id']&&_0x4562d7['label']&&_0x51432['includes'](_0x4562d7['type'])?'chat'===_0x4562d7['type']&&(_0x30a0d5='string'==typeof _0x4562d7['prompt']):_0x30a0d5=!0x1,!_0x30a0d5)throw new ot('ai-chat-shortcuts-invalid-config',this['context'],{'shortcut':_0x4562d7});});}['_injectShortcuts'](){const _0x174de6=this['context']['plugins']['get'](Zr);this['_shortcutsView']=new da(this['context']['locale'],this['_shortcuts']),this['_shortcutsView']['render'](),_0x174de6['addFeedItemCustomElement'](this['_shortcutsView']['element'],_a),this['_shortcutsView']['on']('execute',_0x27faae=>{const _0x172b32=_0x27faae['source']['id'];this['_executeShortcut'](_0x172b32);});}['_removeShortcuts'](){const _0x297142=this['context']['plugins']['get'](Zr);_0x297142['hasFeedItem'](_a)&&_0x297142['removeFeedItem'](_a),this['_shortcutsView']?.['destroy']();}['_executeShortcut'](_0xdfdcf){const _0x2eedb9=this['_shortcuts']['find'](_0x1da347=>_0x1da347['id']===_0xdfdcf),_0x520b46=_0x2eedb9['type'];'chat'===_0x520b46?this['_runChatShortcut'](_0x2eedb9):'review'===_0x520b46?_0x2eedb9['commandId']?this['_runReviewShortcut'](_0x2eedb9):this['_switchTab']('reviewMode'):'translate'===_0x520b46&&(_0x2eedb9['language']?this['_runTranslateShortcut'](_0x2eedb9):this['_switchTab']('translate'));}['_switchTab'](_0x4638e3){if(!this['context']['plugins']['has']('AITabs'))throw new ot('ai-chat-shortcuts-ai-tabs-not-found',this['context'],{'tabName':_0x4638e3});this['context']['plugins']['get']('AITabs')['view']['activateTab'](_0x4638e3);}async['_runChatShortcut']({prompt:_0x11e5ce,draftMode:_0x5a521,useWebSearch:_0x16a011=!0x1,useReasoning:_0x45df1d=!0x1,model:_0x426b80}){const _0x258eb7=this['context']['plugins']['get']('AIChatController'),_0x49cca2=_0x258eb7['activeConversation'];let _0x2a1078;_0x2a1078=_0x426b80?await _0x49cca2['chatModels']['getModel'](_0x426b80):await _0x49cca2['chatModels']['getDefault'](),_0x2a1078&&await _0x49cca2['setModel'](_0x2a1078),_0x49cca2['setWebSearch'](_0x16a011),_0x49cca2['setReasoning'](_0x45df1d),_0x258eb7['addCurrentDocumentToChatContext'](),_0x5a521?(this['_aiChatUI']['setPromptInputValue'](_0x11e5ce),this['_aiChatUI']['focusPromptInput'](!0x0)):_0x258eb7['sendMessage']({'message':_0x11e5ce});}['_runReviewShortcut']({commandId:_0x46ec13,model:_0x4f182e,prompt:_0x54f98a,params:_0x5c0b41}){if(!this['context']['plugins']['has']('AIReviewModeUI'))throw new ot('ai-chat-shortcuts-review-mode-not-found',this['context']);this['_switchTab']('reviewMode');const _0x25400e={'id':_0x46ec13,'isCustom':'custom'===_0x46ec13};_0x4f182e&&_0x54f98a&&(_0x25400e['args']={'model':_0x4f182e,'prompt':_0x54f98a}),_0x5c0b41&&(_0x25400e['params']=_0x5c0b41),this['context']['plugins']['get']('AIReviewModeUI')['fire']('runReviewCheck',_0x25400e);}['_runTranslateShortcut']({language:_0xeec01d}){if(!this['context']['plugins']['has']('AITranslateUI'))throw new ot('ai-chat-shortcuts-translate-not-found',this['context']);this['_switchTab']('translate'),this['context']['plugins']['get']('AITranslateUI')['fire']('runReviewCheck',{'id':_0xeec01d,'args':{'language':_0xeec01d}});}}class ga extends _0x49b69e{constructor(_0x5e653f){super(_0x5e653f);const _0xa4a420=_0x5e653f['plugins']['get']('AITabs')['view'];this['bind']('value')['to'](_0xa4a420,'isVisible'),this['isEnabled']=!0x0;}['execute'](){const _0x6e6ce4=this['editor']['plugins']['get']('AITabs')['view'];_0x6e6ce4['isVisible']=!_0x6e6ce4['isVisible'];}}class Ia extends _0x369cb6{static get['requires'](){return[ns];}static get['pluginName'](){return'AIToggleButtonUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x193e22=this['editor'];_0x193e22['commands']['add']('toggleAi',new ga(_0x193e22)),_0x193e22['ui']['componentFactory']['add']('toggleAi',()=>{const _0x1cf79c=this['_createAIUIButton'](kt);return _0x1cf79c['set']({'tooltip':!0x0,'class':'ck-ai-toggle-button'}),_0x1cf79c;}),_0x193e22['ui']['componentFactory']['add']('menuBar:toggleAi',()=>{const _0x4f03d3=this['_createAIUIButton'](Kt);return _0x4f03d3['set']({'role':'menuitemcheckbox'}),_0x4f03d3;});}['_createAIUIButton'](_0x5843eb){const _0x168570=this['editor'],_0x254566=_0x168570['commands']['get']('toggleAi'),_0x588268=new _0x5843eb(_0x168570['locale']);return _0x588268['set']({'label':as(_0x168570['locale'],'AI_TOGGLE_BUTTON_LABEL'),'icon':_0x4baf04,'isToggleable':!0x0}),_0x588268['bind']('isEnabled')['to'](_0x254566),_0x588268['bind']('isOn')['to'](_0x254566,'value',_0x57ac94=>!!_0x57ac94),this['listenTo'](_0x588268,'execute',()=>{_0x254566['execute']();}),_0x588268;}}const Ea=['applySuggestion','insertSuggestion','showNext','showPrevious'];class Ta extends Nt{['_errorView'];constructor(_0x4c6404){super(_0x4c6404),this['set']('_errorMessage',''),this['set']('_isErrorVisible',!0x1);}['showBlockingError'](_0xf0210){this['showError'](_0xf0210);}['showError'](_0x3f7b5f){this['_errorView']||(this['_errorView']=this['_createErrorView']()),this['_errorMessage']=_0x3f7b5f,this['_isErrorVisible']=!0x0;}['hideError'](){this['_isErrorVisible']=!0x1;}['_createErrorView'](){const _0x399d15=new Nt(this['locale']),_0x51b9ae=new Nt(this['locale']);return _0x51b9ae['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-suggestion__error-text']},'children':[{'text':this['bindTemplate']['to']('_errorMessage')}]}),_0x399d15['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__error','ck-ai-balloon-error',this['bindTemplate']['if']('_isErrorVisible','ck-hidden',_0x56176a=>!_0x56176a)]},'children':[_0x51b9ae]}),_0x399d15;}}const pa=0xa;class ma extends _0x1f4c78{static get['requires'](){return[qs];}static get['pluginName'](){return'AIBalloon';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['isOpen']=!0x1;['_currentConfig'];['_isUpdatingMarkers']=!0x1;['open'](_0x4f863a){const {id:_0x3a22bf}=this['_currentConfig']??{};this['_currentConfig']=_0x4f863a;const {id:_0x2a867f}=this['_currentConfig'];this['isOpen']&&_0x3a22bf===_0x2a867f?this['_updateDialog']():this['_showDialog']();}['close'](){const _0x4e9ac4=Fs(this['context'])['plugins']['get']('Dialog');_0x4e9ac4['isOpen']&&this['_currentConfig']&&_0x4e9ac4['id']===this['_currentConfig']['id']&&_0x4e9ac4['hide']();}['_updateDialog'](){const _0x531af7=Fs(this['context'])['plugins']['get']('Dialog'),{icon:_0x5be136,title:_0xc378a3}=this['_currentConfig'];_0x531af7['view']?.['headerView']&&(_0x531af7['view']['headerView']['label']=_0xc378a3,_0x531af7['view']['headerView']['iconView']&&_0x5be136&&(_0x531af7['view']['headerView']['iconView']['content']=_0x5be136)),this['_isUpdatingMarkers']=!0x0,this['_showFakeVisualSelection'](),this['_isUpdatingMarkers']=!0x1,_0x531af7['view']?.['updatePosition']();}['_showFakeVisualSelection'](){this['context']['plugins']['get'](qs)['showFakeVisualSelection']({'ranges':this['_currentConfig']['ranges'],'id':'balloon','priority':0x64}),window['getSelection']()?.['removeAllRanges']();}['_hideFakeVisualSelection'](){this['context']['plugins']['get'](qs)['hideFakeVisualSelection']('balloon');}['_showDialog'](){const _0x3b9d48=Fs(this['context'])['plugins']['get']('Dialog'),{id:_0x3ec8e6,title:_0xc1e332,icon:_0x24df6f,class:_0x515508,mainView:_0x301837}=this['_currentConfig'];_0x301837['delegate'](...Ea)['to'](this),_0x3b9d48['show']({'title':_0xc1e332,'icon':_0x24df6f,'hasCloseButton':!0x0,'id':_0x3ec8e6,'position':this['_calculateDialogPosition']['bind'](this),'className':'ck-ai-balloon\x20'+(_0x515508||''),'content':_0x301837,'onShow':_0x2a7a3c=>{this['_showFakeVisualSelection'](),this['_setupFakeVisualSelectionMarkerRemovalListener']();const _0x682b=this['_getSelectionElements']();_0x682b&&_0x682b[0x0]&&mt({'target':_0x682b[0x0],'ancestorOffset':0x14,'alignToTop':!0x0,'viewportOffset':{'top':0x14,'bottom':0x14,'left':0x0,'right':0x0}}),this['isOpen']=!0x0,_0x2a7a3c['once']('hide',()=>{this['fire']('beforeDialogClosed',{'id':_0x3ec8e6});},{'priority':'high'});},'onHide':()=>{this['_hideFakeVisualSelection'](),this['_cleanupFakeVisualSelectionMarkerRemovalListener'](),this['fire']('dialogClosed',{'id':_0x3ec8e6}),this['isOpen']=!0x1;}});}['_calculateDialogPosition'](_0x5be828,_0x225dcd){if(!_0x225dcd)return null;const _0x485d0e=this['_getSelectionElements']();if(!_0x485d0e||0x0===_0x485d0e['length'])return{'left':Math['round'](_0x225dcd['left']+_0x225dcd['width']/0x2-_0x5be828['width']/0x2),'top':Math['round'](_0x225dcd['top']+_0x225dcd['height']/0x2-_0x5be828['height']/0x2)};const _0x47473a=Math['round'](_0x225dcd['left']+_0x225dcd['width']/0x2-_0x5be828['width']/0x2),_0x5b23ab=_0x485d0e['map'](_0x2ce3c1=>new ut(_0x2ce3c1)),_0x4518db=_0x5be828['height'];return{'left':_0x47473a,'top':this['_calculateOptimalTopPosition'](_0x5b23ab,_0x4518db,_0x225dcd)};}['_calculateOptimalTopPosition'](_0x57bf3f,_0xa1914c,_0x263ac7){const _0x133191=new ut(ct['window']),_0x11f0c3=_0x57bf3f['map'](_0x743a81=>_0x743a81['getVisible']())['filter'](_0x31c8cc=>_0x31c8cc),_0x40926f=ut['getBoundingRect'](_0x11f0c3);if(!_0x40926f)return Math['round'](_0x263ac7['top']+_0x263ac7['height']/0x2);const _0x411605=_0x133191['getIntersection'](_0x40926f);if(!_0x411605)return Math['round'](_0x263ac7['top']+_0x263ac7['height']/0x2);const _0x52e2d8=_0x263ac7['getVisible'](),_0x2f4a2b=_0x52e2d8&&_0x40926f['height']>_0x52e2d8['height'],_0x5b18bb=_0x411605['top'],_0x20837b=_0x411605['bottom'];if(_0x2f4a2b){const _0x59014a=(_0x52e2d8||_0x133191)['height']/0x2-_0xa1914c/0x2,_0x1cd0a4=_0x5b18bb-pa-_0x263ac7['top'],_0x1f17e6=_0x263ac7['bottom']-_0x20837b-pa;return _0x1cd0a4>=_0xa1914c?Math['max'](pa,_0x5b18bb-_0xa1914c-pa):_0x1f17e6>=_0xa1914c?_0x20837b+pa:Math['max'](pa,_0x59014a);}const _0x3a16f1=_0x5b18bb-_0xa1914c,_0x252823=_0x263ac7['bottom']-_0x20837b-pa,_0x52ba85=_0x5b18bb-pa-_0x263ac7['top'];let _0x35230c;if(_0x252823>=_0xa1914c)_0x35230c=_0x20837b+pa;else{if(_0x52ba85>=_0xa1914c)_0x35230c=_0x3a16f1-pa;else _0x35230c=_0x5b18bb+_0x40926f['height']/0x2-_0xa1914c/0x2;}return _0x35230c;}['_setupFakeVisualSelectionMarkerRemovalListener'](){const _0x2e92c6=Fs(this['context']);this['listenTo'](_0x2e92c6['model']['document'],'change',()=>{if(!this['_isUpdatingMarkers']){for(const {name:_0xf1c202,data:{newRange:_0x4cbfba}}of _0x2e92c6['model']['document']['differ']['getChangedMarkers']())if(_0xf1c202['startsWith']($s+':')&&(_0x4cbfba&&(_0x4cbfba['start']['isEqual'](_0x4cbfba['end'])||'$graveyard'==_0x4cbfba['root']['rootName'])||null==_0x4cbfba)){const _0x353535=as(this['context']['locale'],'AI_BALLOON_SELECTION_REMOVED_ERROR');this['_currentConfig']['mainView']['showBlockingError'](_0x353535),this['fire']('selectionRemoved');}}});}['_cleanupFakeVisualSelectionMarkerRemovalListener'](){const _0x2f2122=Fs(this['context']);this['_currentConfig']['mainView']['hideError'](),this['stopListening'](_0x2f2122['model']['document']);}['_getSelectionElements'](){const _0x3390ce=Fs(this['context']);return _0x49ea5d(_0x3390ce['editing'],[..._0x3390ce['model']['markers']['getMarkersGroup']('ai-selection'),..._0x3390ce['model']['markers']['getMarkersGroup']('ai-balloon-selection')]);}}class Ca extends Ot{['copyButton'];['likeButton'];['dislikeButton'];['showChangesButton'];['_config'];constructor(_0x3875a4,_0x35a4fd={}){super(_0x3875a4),this['set']('isEnabled',!0x0),this['set']('isShowChangesOn',!0x1),this['_config']={'showCopy':!0x1,'showLike':!0x1,'showDislike':!0x1,..._0x35a4fd};const _0x434ec3=!(this['_config']['showCopy']||this['_config']['showChanges']||this['_config']['showLike']||this['_config']['showDislike']||this['_config']['customView']?.['length']);this['class']=_0x434ec3?'ck-ai-mini-toolbar\x20ck-hidden':'ck-ai-mini-toolbar',this['_config']['showCopy']&&(this['_setupCopyButton'](),this['items']['add'](this['copyButton'])),this['_config']['showChanges']&&(this['_setupShowChangesButton'](),this['items']['add'](this['showChangesButton'])),this['_setupRatingButtons'](),this['_config']['showLike']&&this['items']['add'](this['likeButton']),this['_config']['showDislike']&&this['items']['add'](this['dislikeButton']),this['_config']['customView']&&this['items']['addMany'](this['_config']['customView']);}['toggleShowChangesEnabled'](_0x57ffbf){this['showChangesButton']['isEnabled']=_0x57ffbf;}['_setupRatingButtons'](){this['likeButton']=new kt(this['locale']),this['likeButton']['set']({'icon':_0x5aeaa7,'label':as(this['locale'],'AI_MINI_TOOLBAR_LIKE'),'class':cs,'tooltip':!0x0}),this['likeButton']['bind']('isEnabled')['to'](this),this['likeButton']['on']('execute',()=>{this['fire']('like');}),this['dislikeButton']=new kt(this['locale']),this['dislikeButton']['set']({'icon':_0x450aae,'label':as(this['locale'],'AI_MINI_TOOLBAR_DISLIKE'),'class':cs,'tooltip':!0x0}),this['dislikeButton']['bind']('isEnabled')['to'](this),this['dislikeButton']['on']('execute',()=>{this['fire']('dislike');});}['_setupCopyButton'](){this['copyButton']=new kt(this['locale']),this['copyButton']['set']({'icon':_0x2e9086,'label':as(this['locale'],'AI_MINI_TOOLBAR_COPY'),'class':'ck-ai-mini-toolbar-copy-button\x20'+cs,'tooltip':!0x0}),this['copyButton']['bind']('isEnabled')['to'](this);const _0x314631=new yt();_0x314631['set']({'content':_0x4c3d0d}),_0x314631['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\x20'+cs,setTimeout(()=>{this['copyButton']['class']='ck-ai-mini-toolbar-copy-button\x20'+cs;},0x7d0);}),this['copyButton']['children']['add'](_0x314631);}['_setupShowChangesButton'](){this['showChangesButton']=new kt(this['locale']),this['showChangesButton']['set']({'icon':_0x3428ba,'label':as(this['locale'],'AI_SUGGESTION_BUTTON_SHOW_CHANGES'),'withText':'full'==this['_config']['showChanges'],'tooltip':'full'!=this['_config']['showChanges'],'class':cs}),this['showChangesButton']['bind']('isOn')['to'](this,'isShowChangesOn'),this['showChangesButton']['bind']('isEnabled')['to'](this),this['showChangesButton']['bind']('icon')['to'](this,'isShowChangesOn',_0x269412=>_0x269412?_0x184e17:_0x3428ba),this['showChangesButton']['on']('execute',()=>{this['fire']('toggleShowChanges');});}}class wa extends Ta{['children'];['nextButtonView'];['previousButtonView'];['focusCycler'];['_focusables'];['_focusTracker'];['_keystrokes'];['_config'];['_streamableContentView'];['_toolbarContainerView'];['_partToolbarView'];['_stateView'];['_miniToolbarView'];constructor(_0x1da0c3,_0x3e3246){super(_0x1da0c3);const _0x407738=this['bindTemplate'];this['set']('showDiff',!0x1),this['set']('_state','pending'),this['_focusTracker']=new _t(),this['_keystrokes']=new At(),this['_focusables']=this['createCollection'](),this['focusCycler']=new Mt({'focusables':this['_focusables'],'focusTracker':this['_focusTracker'],'keystrokeHandler':this['_keystrokes'],'actions':{'focusPrevious':'shift\x20+\x20tab','focusNext':'tab'}}),this['_config']=_0x3e3246,this['nextButtonView']=this['_createNextButtonView'](),this['previousButtonView']=this['_createPreviousButtonView'](),this['_streamableContentView']=new un(_0x1da0c3),this['_partToolbarView']=new hn(_0x1da0c3,_0x3e3246['availableActions']),this['_partToolbarView']['delegate']('applySuggestion','insertSuggestion','rejectSuggestion')['to'](this),this['_togglePartToolbarButtonsVisibility'](_0x3e3246),this['_stateView']=new an(_0x1da0c3),this['_stateView']['isVisible']=!0x1,this['_miniToolbarView']=new Ca(_0x1da0c3,{'showChanges':'full'}),this['_miniToolbarView']['bind']('isShowChangesOn')['to'](this,'showDiff'),this['_miniToolbarView']['on']('toggleShowChanges',()=>{this['fire']('toggleSuggestionDisplayMode');}),this['_toolbarContainerView']=new fa(_0x1da0c3,[this['_partToolbarView'],this['_stateView'],this['_miniToolbarView']]),this['children']=this['createCollection']([this['_streamableContentView'],this['_toolbarContainerView']]),this['on']('change:_state',(_0x28d43e,_0x3e2122,_0x35dad5,_0x9688cb)=>{let _0x10ee16,_0x4bb2ca;'pending'===_0x9688cb?(_0x10ee16=this['_partToolbarView'],_0x4bb2ca=this['_stateView']):(_0x10ee16=this['_stateView'],_0x4bb2ca=this['_partToolbarView']),this['_stateView']['setState'](_0x35dad5),_0x10ee16['isVisible']=!0x1,_0x4bb2ca['isVisible']=!0x0;}),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat-balloon-main',_0x407738['to']('_state',_0x376574=>'ck-ai-chat-balloon-main_state_'+_0x376574)]},'children':this['children']}),this['on']('change:isTrackChangesOn',()=>{this['_togglePartToolbarButtonsVisibility'](_0x3e3246);});}['render'](){super['render'](),this['nextButtonView']['render'](),this['previousButtonView']['render'](),this['_focusTracker']['add'](this['element']),this['_focusTracker']['add'](this['nextButtonView']),this['_focusTracker']['add'](this['previousButtonView']),this['_focusTracker']['add'](this['_miniToolbarView']),this['_focusTracker']['add'](this['_partToolbarView']),this['_keystrokes']['listenTo'](this['element']),this['_keystrokes']['listenTo'](this['nextButtonView']['element']),this['_keystrokes']['listenTo'](this['previousButtonView']['element']),this['_focusables']['addMany']([this['nextButtonView'],this['previousButtonView'],this['_partToolbarView'],this['_miniToolbarView']]);}['destroy'](){super['destroy'](),this['previousButtonView']['destroy'](),this['nextButtonView']['destroy']();}['focus'](){this['focusCycler']['focusFirst']();}['focusLast'](){this['focusCycler']['focusLast']();}async['updateContent'](_0xba5b3a){_0xba5b3a?.['keepErrors']||this['hideError'](),await this['_streamableContentView']['update'](_0xba5b3a);}['setState'](_0x2f5cdf){this['_state']=_0x2f5cdf;}['showError'](_0x9a132){super['showError'](_0x9a132),this['children']['has'](this['_errorView'])||this['children']['add'](this['_errorView'],0x0);}['hideError'](){this['_isErrorVisible']&&(super['hideError'](),this['togglePartToolbarEnabled'](!0x0));}['showBlockingError'](_0x2fad72){super['showBlockingError'](_0x2fad72),this['togglePartToolbarEnabled'](!0x1);}['toggleRotatorButtonsVisibility'](_0x40436){this['nextButtonView']['isVisible']=this['previousButtonView']['isVisible']=_0x40436;}['togglePartToolbarEnabled'](_0x5b2d17){this['_partToolbarView']['isEnabled']=_0x5b2d17;}['_togglePartToolbarButtonsVisibility']({showApplyButton:_0x5eedb0,showSuggestButton:_0x1d2602}){_0x5eedb0=_0x5eedb0&&!this['isTrackChangesOn']&&this['_config']['availableActions']['includes']('applySuggestion'),_0x1d2602=_0x1d2602&&this['_config']['availableActions']['includes']('insertSuggestion'),this['_partToolbarView']['setButtonsVisibility']({'showApplyButton':_0x5eedb0,'showSuggestButton':_0x1d2602});}['_createNextButtonView'](){const _0x2d52b0=new kt(this['locale']);return _0x2d52b0['set']({'icon':_0x40697,'label':as(this['locale'],'AI_BALLOON_NEXT_LABEL'),'isVisible':!0x0}),_0x2d52b0['on']('execute',()=>{this['fire']('showNext');}),_0x2d52b0;}['_createPreviousButtonView'](){const _0x3c91d5=new kt(this['locale']);return _0x3c91d5['set']({'icon':_0xc9c719,'label':as(this['locale'],'AI_BALLOON_PREVIOUS_LABEL'),'isVisible':!0x0}),_0x3c91d5['on']('execute',()=>{this['fire']('showPrevious');}),_0x3c91d5;}}class fa extends Nt{constructor(_0x528596,_0x19deca){super(_0x528596),this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-balloon__toolbar-container']},'children':_0x19deca});}}class Sa extends _0x369cb6{static get['requires'](){return[Vt,ma];}static get['pluginName'](){return'AIChatBalloon';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['_chatBalloonView'];constructor(_0x4253b0){super(_0x4253b0),this['set']('showDiff',!0x1);}['open'](_0x1cfcb8){const _0x2b1c4d=this['editor'];this['_chatBalloonView']||(this['_chatBalloonView']=this['_createChatBalloonView']()),_0x2b1c4d['plugins']['get']('AIBalloon')['open']({..._0x1cfcb8,'id':'aiChatBalloon','class':'ck-ai-chat-balloon','mainView':this['_chatBalloonView']}),this['_toggleRotatorButtonsInDialogHeader'](_0x1cfcb8['showRotator']),this['_chatBalloonView']['togglePartToolbarEnabled'](!_0x1cfcb8['areActionsDisabled']),this['_restoreDefaultViewFocus']();}['close'](){this['editor']['plugins']['get']('AIBalloon')['close']();}['updateContent'](_0x5f1373){return this['_chatBalloonView']||(this['_chatBalloonView']=this['_createChatBalloonView']()),this['_chatBalloonView']['updateContent'](_0x5f1373);}['setState'](_0x463c28){this['_chatBalloonView']&&this['_chatBalloonView']['setState'](_0x463c28);}['_createChatBalloonView'](){const _0x5f3a5e=this['editor'],_0x1dd367=_0x5f3a5e['plugins']['get']('AIBalloon'),_0x62da49=_0x5f3a5e['commands']['get']('trackChanges');let _0x11dc6c=_0x5f3a5e['config']['get']('ai.availableReplyActions')||[...gn];_0x5f3a5e['plugins']['has']('TrackChanges')||(_0x11dc6c=_0x11dc6c['filter'](_0x4bc9fa=>'insertSuggestion'!=_0x4bc9fa));const _0x453267=new wa(_0x5f3a5e['locale'],{'availableActions':_0x11dc6c,'showApplyButton':!0x0,'showSuggestButton':!!_0x62da49});return _0x453267['bind']('showDiff')['to'](this),_0x453267['delegate'](...Qs)['to'](this),_0x453267['delegate']('showPrevious','showNext')['to'](this),_0x1dd367['delegate']('dialogClosed')['to'](this),_0x453267['on']('applySuggestion',this['_restoreDefaultViewFocus']['bind'](this)),_0x453267['on']('insertSuggestion',this['_restoreDefaultViewFocus']['bind'](this)),_0x453267['on']('rejectSuggestion',this['_restoreDefaultViewFocus']['bind'](this)),_0x62da49&&_0x453267['bind']('isTrackChangesOn')['to'](_0x62da49,'value'),_0x453267['render'](),_0x453267;}['_toggleRotatorButtonsInDialogHeader'](_0x5bf7f1){const _0x2e5ca7=this['editor'],_0x3ccf73=_0x2e5ca7['plugins']['get']('Dialog')['view']['headerView']['children'];this['_chatBalloonView']['toggleRotatorButtonsVisibility'](_0x5bf7f1),_0x3ccf73['has'](this['_chatBalloonView']['previousButtonView'])||(_0x3ccf73['addMany']([this['_chatBalloonView']['previousButtonView'],this['_chatBalloonView']['nextButtonView']],0x0),_0x2e5ca7['plugins']['get']('AIBalloon')['once']('beforeDialogClosed',()=>{_0x3ccf73['remove'](this['_chatBalloonView']['previousButtonView']),_0x3ccf73['remove'](this['_chatBalloonView']['nextButtonView']);}));}['_restoreDefaultViewFocus'](){this['_chatBalloonView']['focus']();}}class ba extends _0x369cb6{static get['requires'](){return[Ia,Sa,_0xe2382a];}static get['pluginName'](){return'AIEditorIntegration';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}function Ra(_0x2d8d63){const {editor:_0x100b64,action:_0x2d2da9,withText:_0x112591=!0x1,withIcon:_0x1a0a07=!0x0,isInDropdown:_0x51e879=!0x0,shouldPreventFocus:_0x4060d8=!0x1}=_0x2d8d63;return()=>{const _0x5e7c17=_0x100b64['locale'],_0x390036=new kt(_0x5e7c17),_0x5e3343=_0x390036['bindTemplate'];_0x51e879&&_0x390036['extendTemplate']({'on':{'mouseenter':_0x5e3343['to'](()=>{_0x4060d8&&_0x4060d8()||_0x390036['focus']();})}});const _0x1e18e2=_0x2d2da9['icon']??_0x2d2da9['parent']?.['icon'];return _0x390036['set']({'label':_0x2d2da9['label'],'withText':_0x112591,'role':'menuitem','icon':_0x1a0a07?_0x1e18e2??_0x5b1111:void 0x0,'tooltip':!_0x112591,'class':'ck-ai-quick-actions-button','isEnabled':_0x2d2da9['isEnabled']}),_0x390036['on']('execute',()=>{_0x100b64['editing']['view']['focus'](),_0x100b64['commands']['execute']('aiQuickAction',_0x2d2da9);}),_0x390036;};}class Oa extends _0x464cba{['arrowView'];constructor(_0xe37462,_0x5176e7){super(_0xe37462,_0x5176e7);const _0x12d90a=this['bindTemplate'];this['set']({'withText':!0x0,'role':'menuitem'}),this['arrowView']=this['_createArrowView'](),this['extendTemplate']({'attributes':{'class':['ck-dropdown-menu-list__nested-menu__button'],'aria-haspopup':!0x0,'aria-expanded':this['bindTemplate']['to']('isOn',_0x99de1e=>String(_0x99de1e)),'data-cke-tooltip-disabled':_0x12d90a['to']('isOn')},'on':{'mouseenter':_0x12d90a['to']('mouseenter')}});}['render'](){super['render'](),this['children']['add'](this['arrowView']);}['_createArrowView'](){const _0x233a58=new yt();return _0x233a58['content']=_0x19f364,_0x233a58['extendTemplate']({'attributes':{'class':'ck-dropdown-menu-list__nested-menu__button__arrow'}}),_0x233a58;}}class ka extends Lt{['_allListItems'];['_allSearchableItems'];constructor(_0x512f0a,_0x531cc2,_0x5845a1){super(_0x512f0a),this['_allListItems']=_0x531cc2,this['_allSearchableItems']=_0x5845a1;}['filter'](_0x420040){if(!_0x420040)return this['items']['clear'](),this['items']['addMany'](this['_allListItems']),this['_clearHighlight'](),{'resultsCount':this['_allListItems']['length'],'totalItemsCount':this['_allListItems']['length']};const _0x9d70ab=_0x420040['source']['toLowerCase']()['trim'](),_0x45db8f=this['_allSearchableItems']['filter'](_0x29f4f1=>(_0x29f4f1['groupLabel']?_0x29f4f1['label']+'\x20('+_0x29f4f1['groupLabel']+')':_0x29f4f1['label'])['toLowerCase']()['includes'](_0x9d70ab));return this['items']['clear'](),this['items']['addMany'](_0x45db8f['sort']((_0x1dc3c3,_0xdd84f2)=>{const _0x24313=_0x1dc3c3['groupLabel'],_0x5aab5c=_0xdd84f2['groupLabel'];return _0x24313||_0x5aab5c?_0x24313?0x1:-0x1:0x0;})['map'](_0x33b510=>_0x33b510['item'])),this['_highlightQuery'](_0x9d70ab,_0x45db8f),{'resultsCount':_0x45db8f['length'],'totalItemsCount':this['_allSearchableItems']['length']};}['_highlightQuery'](_0x2ca4b1,_0x4f4d51){if(!_0x2ca4b1)return;const _0x3bbf35=new RegExp(_0x144f09(_0x2ca4b1),'gi');_0x4f4d51['forEach'](_0x360794=>{_0x360794['highlightViews']&&_0x360794['highlightViews']['forEach'](_0x378a4b=>{'function'==typeof _0x378a4b['highlightText']&&_0x378a4b['highlightText'](_0x3bbf35);});});}['_clearHighlight'](){this['_allSearchableItems']['forEach'](_0x382ad9=>{_0x382ad9['highlightViews']&&_0x382ad9['highlightViews']['forEach'](_0x1c240d=>{'function'==typeof _0x1c240d['highlightText']&&_0x1c240d['highlightText'](null);});});}}const Na='menu',va='menuitem';class ya extends Nt{['_bodyCollection'];['optionsListView'];['_searchTextView']=null;['_allSearchableItems']=[];['children'];['focusTracker'];['keystrokes'];['_focusables'];['focusCycler'];['_openNestedPanels']=new Set();['_hasSearch'];constructor(_0xafbcc,_0x264776,_0x1e9cc3,_0x56f03d,_0x1ebde3=!0x1){const _0x40cf06=_0xafbcc['locale'];super(_0x40cf06),this['_bodyCollection']=_0x56f03d,this['_hasSearch']=_0x1ebde3;const _0x207c71=this['_createListItems'](_0xafbcc,_0x264776,_0x1e9cc3);this['optionsListView']=new ka(_0x40cf06,_0x207c71,this['_allSearchableItems']),this['optionsListView']['role']=Na,this['optionsListView']['items']['addMany'](_0x207c71),this['focusTracker']=new _t(),this['keystrokes']=new At(),_0x1ebde3&&(this['_searchTextView']=this['_createSearchTextView']()),this['_focusables']=_0x207c71,this['focusCycler']=new Mt({'focusables':this['_focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes']}),_0x1ebde3&&this['_searchTextView']&&this['focusCycler']['chain'](this['_searchTextView']['focusCycler']);const _0x4d7a50=_0x1ebde3&&this['_searchTextView']?[this['_searchTextView']]:[this['optionsListView']];this['children']=new _0x553410(_0x4d7a50),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-ai-quick-actions','ck-rounded-corners'],'dir':_0x40cf06['uiLanguageDirection']},'children':this['children']});}['_createSearchTextView'](){return new _0xb89745(this['locale'],{'filteredView':this['optionsListView'],'queryView':{'label':as(this['locale'],'AI_QUICK_ACTIONS_SEARCH')},'class':'ck-ai-quick-actions-search','infoView':{'text':{'notFound':{'primary':as(this['locale'],'AI_QUICK_ACTIONS_SEARCH_NOT_FOUND')}}}});}['_isSearchFocused'](){if(!this['_hasSearch']||!this['_searchTextView']||!this['_searchTextView']['queryView']['fieldView']['element'])return!0x1;const _0x4c2ad1=this['_searchTextView']['queryView']['fieldView']['element']['ownerDocument']?.['activeElement'];return this['_searchTextView']['queryView']['fieldView']['element']['contains'](_0x4c2ad1);}['_createListItems'](_0x29366c,_0x350537,_0x25ee84){const _0x59e842=new _0x553410();return _0x350537['forEach'](_0x2736d9=>{if('actions'in _0x2736d9){const {listItem:_0x41bd2c}=this['_createActionGroupButton'](_0x29366c,_0x2736d9,_0x25ee84);_0x59e842['add'](_0x41bd2c),_0x2736d9['actions']['forEach'](_0x33672f=>{this['_createActionButton'](_0x29366c,_0x33672f,_0x2736d9['label'],_0x2736d9['icon']);const {listItem:_0x15d04b,highlightViews:_0x1fe6ef}=this['_createSearchResultActionButton'](_0x29366c,_0x33672f,_0x2736d9['label'],_0x2736d9['icon']);this['_allSearchableItems']['push']({'item':_0x15d04b,'label':_0x33672f['label'],'groupLabel':_0x2736d9['label'],'highlightViews':_0x1fe6ef});});}else{const {listItem:_0xb4817b}=this['_createActionButton'](_0x29366c,_0x2736d9);_0x59e842['add'](_0xb4817b);const _0x5a029c=_0xb4817b['children']['first'];if(_0x5a029c){const {listItem:_0x2a756b,highlightViews:_0x270988}=this['_createSearchResultActionButton'](_0x29366c,_0x2736d9);this['_allSearchableItems']['push']({'item':_0x2a756b,'label':_0x5a029c['label']||'','highlightViews':_0x270988});}}}),_0x59e842;}['_createActionButton'](_0xec5b29,_0x16b23c,_0x4653e5,_0x3ce9aa){const _0x4af3e9=new Pt(this['locale']);if(_0x4653e5&&_0x3ce9aa){const _0xc91181=new kt(this['locale']),_0x5b1a4e=_0xc91181['bindTemplate'],_0x3cae02=new _0x50c963();_0x3cae02['text']=_0x16b23c['label'];const _0x144420=new _0x50c963();_0x144420['text']=_0x4653e5;const _0x30dd02=new yt();_0x30dd02['content']=_0x3ce9aa,_0x30dd02['extendTemplate']({'attributes':{'class':'ck-ai-quick-actions-button__group-icon'}});const _0x549b0d=new Nt(this['locale']);_0x549b0d['setTemplate']({'tag':'span','attributes':{'class':'ck-ai-quick-actions-button_with-group__open-paren'},'children':[{'text':'\x20('}]});const _0x4640b8=new Nt(this['locale']);return _0x4640b8['setTemplate']({'tag':'span','attributes':{'class':'ck-ai-quick-actions-button_with-group__close-paren'},'children':[{'text':')'}]}),_0xc91181['set']({'label':_0x16b23c['label']+'\x20('+_0x4653e5+')','withText':!0x0,'role':'menuitem','class':'ck-ai-quick-actions-button\x20ck-ai-quick-actions-button_with-group','tooltip':!0x1}),_0xc91181['setTemplate']({'tag':'button','attributes':{'class':['ck','ck-button','ck-button_with-text','ck-ai-quick-actions-button','ck-ai-quick-actions-button_with-group'],'type':'button','role':'menuitem','tabindex':'-1'},'children':[_0x3cae02,_0x549b0d,_0x30dd02,_0x144420,_0x4640b8],'on':{'mouseenter':_0x5b1a4e['to'](()=>{this['_isSearchFocused']()||_0xc91181['focus']();}),'click':_0x5b1a4e['to'](()=>{_0xc91181['fire']('execute');})}}),_0xc91181['on']('execute',()=>{_0xec5b29['editing']['view']['focus'](),_0xec5b29['commands']['execute']('aiQuickAction',_0x16b23c);}),_0x4af3e9['children']['add'](_0xc91181),{'listItem':_0x4af3e9,'highlightViews':[_0x3cae02,_0x144420]};}{const _0x53cf01=new _0x5dd3dc(),_0x5e0a0a=new kt(this['locale'],_0x53cf01),_0x352748=_0x5e0a0a['bindTemplate'],_0x2bdd06=_0x16b23c['icon']??_0x16b23c['parent']?.['icon'],_0x5ad156=void 0x0!==_0x16b23c['icon'];return _0x5e0a0a['set']({'label':_0x16b23c['label'],'withText':!0x0,'role':'menuitem','icon':_0x5ad156?_0x2bdd06??_0x5b1111:void 0x0,'tooltip':!0x1,'class':'ck-ai-quick-actions-button'}),_0x5e0a0a['extendTemplate']({'on':{'mouseenter':_0x352748['to'](()=>{this['_isSearchFocused']()||_0x5e0a0a['focus']();})}}),_0x5e0a0a['on']('execute',()=>{_0xec5b29['editing']['view']['focus'](),_0xec5b29['commands']['execute']('aiQuickAction',_0x16b23c);}),_0x4af3e9['children']['add'](_0x5e0a0a),{'listItem':_0x4af3e9,'highlightViews':[_0x53cf01]};}}['_createSearchResultActionButton'](_0x1bc33e,_0x248de1,_0x85122f,_0x4f8e2c){return _0x85122f&&_0x4f8e2c?this['_createSearchResultGroupedActionButton'](_0x1bc33e,_0x248de1,_0x85122f,_0x4f8e2c):this['_createSearchResultIndividualActionButton'](_0x1bc33e,_0x248de1);}['_createSearchResultGroupedActionButton'](_0x388f5c,_0x4380c6,_0x3bd986,_0x4392db){const _0x2d526e=new Pt(this['locale']),_0x3f1dc1=new kt(this['locale']),_0x4f386e=_0x3f1dc1['bindTemplate'],{view:_0x3bb2f1,highlightView:_0x5dfbae}=this['_createSearchResultGroupRow'](_0x3bd986,_0x4392db),{view:_0x47105c,highlightView:_0x4b064b}=this['_createSearchResultActionRow'](_0x4380c6['label']),_0x2d3016=this['_createSearchResultContentView'](_0x3bb2f1,_0x47105c);return _0x3f1dc1['set']({'label':_0x4380c6['label'],'withText':!0x0,'role':'menuitem','class':'ck-ai-quick-actions-button\x20ck-ai-quick-actions-search-result-button\x20ck-ai-quick-actions-search-result-button_with-group','tooltip':!0x1}),_0x3f1dc1['setTemplate']({'tag':'button','attributes':{'class':['ck','ck-button','ck-button_with-text','ck-ai-quick-actions-button','ck-ai-quick-actions-search-result-button','ck-ai-quick-actions-search-result-button_with-group'],'type':'button','role':'menuitem','tabindex':'-1'},'children':[_0x2d3016],'on':{'mouseenter':_0x4f386e['to'](()=>{this['_isSearchFocused']()||_0x3f1dc1['focus']();}),'click':_0x4f386e['to'](()=>{this['_handleSearchResultButtonClick'](_0x3f1dc1);})}}),this['_setupActionButtonExecution'](_0x3f1dc1,_0x388f5c,_0x4380c6),_0x2d526e['children']['add'](_0x3f1dc1),{'listItem':_0x2d526e,'highlightViews':[_0x5dfbae,_0x4b064b]};}['_createSearchResultIndividualActionButton'](_0xb10d74,_0x181237){const _0x222f3f=new Pt(this['locale']),_0x637a25=new _0x5dd3dc(),_0x370c38=new kt(this['locale'],_0x637a25),_0x156ab2=_0x370c38['bindTemplate'];return _0x370c38['set']({'label':_0x181237['label'],'withText':!0x0,'role':'menuitem','icon':void 0x0,'tooltip':!0x1,'class':'ck-ai-quick-actions-button\x20ck-ai-quick-actions-search-result-button'}),_0x370c38['extendTemplate']({'on':{'mouseenter':_0x156ab2['to'](()=>{this['_isSearchFocused']()||_0x370c38['focus']();})}}),this['_setupActionButtonExecution'](_0x370c38,_0xb10d74,_0x181237),_0x222f3f['children']['add'](_0x370c38),{'listItem':_0x222f3f,'highlightViews':[_0x637a25]};}['_createSearchResultGroupRow'](_0xa3d7bf,_0x35bd27){const _0x47d3e9=new Nt(this['locale']),_0x4f5d14=new yt();_0x4f5d14['content']=_0x35bd27,_0x4f5d14['extendTemplate']({'attributes':{'class':'ck-ai-quick-actions-button__group-icon'}});const _0x5d1c09=new _0x50c963();return _0x5d1c09['text']=_0xa3d7bf,_0x47d3e9['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-quick-actions-search-result__group-row'},'children':[_0x4f5d14,_0x5d1c09]}),{'view':_0x47d3e9,'highlightView':_0x5d1c09};}['_createSearchResultActionRow'](_0x49bf3e){const _0x17c92f=new Nt(this['locale']),_0x16eb1c=new _0x50c963();return _0x16eb1c['text']=_0x49bf3e,_0x17c92f['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-quick-actions-search-result__action-row'},'children':[_0x16eb1c]}),{'view':_0x17c92f,'highlightView':_0x16eb1c};}['_createSearchResultContentView'](_0x1a0040,_0x56a75d){const _0x3b6055=new Nt(this['locale']);return _0x3b6055['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-quick-actions-search-result__content'},'children':[_0x1a0040,_0x56a75d]}),_0x3b6055;}['_setupActionButtonExecution'](_0x1ed650,_0x30fbbb,_0x230c7d){_0x1ed650['on']('execute',()=>{_0x30fbbb['editing']['view']['focus'](),_0x30fbbb['commands']['execute']('aiQuickAction',_0x230c7d);});}['_createActionGroupButton'](_0x55520e,_0x47538e,_0x3e4cda){const _0x3d23ea=new Pt(this['locale']),_0x525a2c=new _0x5dd3dc(),_0x1bbe14=new Oa(this['locale'],_0x525a2c),_0x3c90ae=_0x1bbe14['bindTemplate'],_0x19319a=this['_getPanelKeystroke'](_0x3e4cda),_0x7c61be=this['_createGroupActionsList'](_0x55520e,_0x47538e['actions'],_0x3e4cda);_0x1bbe14['set']({'label':_0x47538e['label'],'withText':!0x0,'role':va,'icon':_0x47538e['icon']??_0x5b1111,'isEnabled':_0x47538e['actions']['some'](_0x43c52e=>_0x43c52e['isEnabled'])}),_0x1bbe14['extendTemplate']({'on':{'mouseenter':_0x3c90ae['to'](()=>{this['_isSearchFocused']()||_0x1bbe14['focus']();})}});const _0x713394=new Qt(this['locale']);return _0x713394['extendTemplate']({'attributes':{'class':['ck','ck-reset_all','ck-ai-quick-actions-group-panel','ck-dropdown-menu__nested-menu__panel']},'on':{'keydown':_0x3c90ae['to'](_0xdf00a3=>{this['_handlePanelKeydown'](_0xdf00a3,_0x19319a,_0x1bbe14,_0x713394);})}}),_0x1bbe14['bind']('isOn')['to'](_0x713394,'isVisible'),this['_bodyCollection']['add'](_0x713394),_0x713394['content']['add'](_0x7c61be),this['_setupGroupMenuBehavior'](_0x1bbe14,_0x713394),_0x3d23ea['children']['add'](_0x1bbe14),{'listItem':_0x3d23ea,'highlightView':_0x525a2c};}['_createGroupActionsList'](_0x18063f,_0x318176,_0xd8a0ac){const _0x4f366b=new Lt(this['locale']);return _0x4f366b['extendTemplate']({'attributes':{'class':['ck','ck-reset_all','ck-ai-quick-actions-group-list','ck-dropdown-menu-list']}}),_0x318176['forEach'](_0x2832b9=>{const _0x4433bc=new Pt(this['locale']),_0xbcc63e=Ra({'editor':_0x18063f,'action':_0x2832b9,'withText':!0x0,'withIcon':!0x1,'isInDropdown':!0x0,'shouldPreventFocus':()=>this['_isSearchFocused']()})();_0x4433bc['children']['add'](_0xbcc63e),_0xd8a0ac['focusTracker']['add'](_0xbcc63e),_0x4f366b['items']['add'](_0x4433bc);}),_0x4f366b;}['_setupGroupMenuBehavior'](_0x2131af,_0x418a5c){const _0x3bc9bd=_0x2131af['bindTemplate'],_0x4356ae=this['_getButtonKeystroke'](_0x2131af);_0x2131af['extendTemplate']({'attributes':{'class':['ck-ai-quick-actions-group-button']},'on':{'mouseenter':_0x3bc9bd['to'](()=>{this['_showNestedPanel'](_0x418a5c,_0x2131af);}),'mouseleave':_0x3bc9bd['to'](_0x8a3b75=>{const _0x31c405=_0x8a3b75['relatedTarget'];this['_isMovingToNestedMenu'](_0x31c405,_0x418a5c)||this['_hideNestedPanel'](_0x418a5c);}),'keydown':_0x3bc9bd['to'](_0x294bd2=>{_0x294bd2['key']==_0x4356ae&&(this['_showNestedPanel'](_0x418a5c,_0x2131af),_0x418a5c['content']['get'](0x0)['focus']());})}}),_0x418a5c['on']('render',()=>{_0x418a5c['element']?.['addEventListener']('mouseleave',_0x5c5fd4=>{const _0x461a3d=_0x5c5fd4['relatedTarget'];_0x2131af['element']?.['contains'](_0x461a3d)||this['_isMovingToNestedMenu'](_0x461a3d,_0x418a5c)||this['_hideNestedPanel'](_0x418a5c);});});}['_showNestedPanel'](_0x5823e7,_0x3cff8a){this['_openNestedPanels']['forEach'](_0x82d806=>{_0x82d806!==_0x5823e7&&_0x82d806['isVisible']&&_0x82d806['hide']();}),_0x5823e7['show'](),_0x5823e7['pin']({'positions':[_0x5ab4be['eastSouth']],'target':_0x3cff8a['element'],'fitInViewport':!0x0}),this['_openNestedPanels']['add'](_0x5823e7);}['_hideNestedPanel'](_0x2f5b7c){_0x2f5b7c['hide'](),this['_openNestedPanels']['delete'](_0x2f5b7c);}['_hideAllNestedPanels'](){this['_openNestedPanels']['forEach'](_0x6e9e6b=>_0x6e9e6b['hide']()),this['_openNestedPanels']['clear']();}['_isMovingToNestedMenu'](_0x14144f,_0x1aa097){if(!_0x14144f)return!0x1;if(_0x1aa097['element']?.['contains'](_0x14144f))return!0x0;const _0xc63761=_0x14144f;return _0xc63761['closest']&&(null!==_0xc63761['closest']('.ck-ai-quick-actions-group-panel')||null!==_0xc63761['closest']('.ck-ai-quick-actions-group-list')||null!==_0xc63761['closest']('.ck-ai-quick-actions-group-button'));}['resetSearch'](){this['_searchTextView']&&this['_searchTextView']['reset']();}['destroy'](){this['_hideAllNestedPanels'](),this['_bodyCollection']['detachFromDom'](),super['destroy']();}['focus'](){this['_searchTextView']?this['_searchTextView']['focus']():this['optionsListView']['focus']();}['_getPanelKeystroke'](_0x40e556){return'rtl'===_0x40e556['locale']['uiLanguageDirection']?'ArrowRight':'ArrowLeft';}['_getButtonKeystroke'](_0x475bca){return'rtl'===_0x475bca['locale']['uiLanguageDirection']?'ArrowLeft':'ArrowRight';}['_handlePanelKeydown'](_0xba0ca7,_0x4b1ce6,_0x562137,_0xdda723){_0xba0ca7['key']==_0x4b1ce6&&(_0x562137['focus'](),this['_hideNestedPanel'](_0xdda723));}['_handleSearchResultButtonClick'](_0x1d895a){_0x1d895a['fire']('execute');}}function xa(_0xd80928){const {editor:_0x210161,content:_0xe94c66,buttonDefinition:_0x36821f,bodyCollection:_0x271698,hasSearch:_0x2db181=!0x1}=_0xd80928;return()=>{const _0x15f29c=_0x210161['locale'],_0x347959=Bt(_0x15f29c);_0x347959['buttonView']['set']({'icon':_0x36821f['icon']??_0x5b1111,'label':_0x36821f['label'],'tooltip':!0x0}),_0x347959['set']({'class':'ck-ai-quick-actions-dropdown'});const _0x31b399=new ya(_0x210161,_0xe94c66,_0x347959,_0x271698,_0x2db181);return _0x347959['panelView']['children']['add'](_0x31b399),_0x2db181&&_0x347959['on']('change:isOpen',(_0x6bdded,_0x576d6a,_0x47304e)=>{if(_0x47304e){if(_0x210161['plugins']['has']('AIEditing')){const _0x4b7ee1=_0x210161['plugins']['get'](qs),_0x5dad7b=_0x210161['model']['document']['selection'],_0x105c1b=Array['from'](_0x5dad7b['getRanges']());_0x105c1b['length']>0x0&&_0x4b7ee1['showFakeVisualSelection']({'ranges':_0x105c1b,'id':'quick-action','priority':0x14});}}else _0x210161['plugins']['has']('AIEditing')&&_0x210161['plugins']['get'](qs)['hideFakeVisualSelection']('quick-action'),_0x31b399['resetSearch']();}),_0x347959;};}const La='<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>',Da='<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>',Pa='<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>',Ha=/* #__PURE__ -- @preserve */
28
- ((()=>({'chat':'AIChat','action':'AIActions'}))());class Ma extends _0x369cb6{static get['requires'](){return[_0x3d0960,rs];}static get['pluginName'](){return'AIQuickActionsUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}async['init'](){const _0x356d30=await this['_getDefaultAndCustomActions']();this['_prepareQuickActionsDefinition'](_0x356d30),this['_initializeQuickActionsComponentsAndCommands']();}static['getDefaultQuickActions'](_0x77200c){return function(_0x20298a){const _0x10bd89=new Intl['DisplayNames'](['en'],{'type':'language'})['of'](_0x20298a['uiLanguage']),_0xa75b4f=_0x10bd89||'English',_0x3ef6f7=[{'id':'ask-ai','label':as(_0x20298a,'AI_QUICK_ACTIONS_ASK_AI'),'type':'chat','icon':_0x82d2cb},{'id':'chat-commands','label':as(_0x20298a,'AI_QUICK_ACTIONS_CHAT_COMMANDS'),'icon':_0x82d2cb,'actions':[{'id':'explain','label':as(_0x20298a,'AI_QUICK_ACTIONS_EXPLAIN'),'displayedPrompt':as(_0x20298a,'AI_QUICK_ACTIONS_EXPLAIN'),'prompt':La['replace']('%0',_0xa75b4f),'type':'chat'},{'id':'summarize','label':as(_0x20298a,'AI_QUICK_ACTIONS_SUMMARIZE'),'displayedPrompt':as(_0x20298a,'AI_QUICK_ACTIONS_SUMMARIZE'),'prompt':Da['replace']('%0',_0xa75b4f),'type':'chat'},{'id':'highlight-key-points','label':as(_0x20298a,'AI_QUICK_ACTIONS_HIGHLIGHT_KEY_POINTS'),'displayedPrompt':as(_0x20298a,'AI_QUICK_ACTIONS_HIGHLIGHT_KEY_POINTS'),'prompt':Pa['replace']('%0',_0xa75b4f),'type':'chat'}]},{'id':'improve-writing','label':as(_0x20298a,'AI_QUICK_ACTIONS_IMPROVE_WRITING'),'type':'action','icon':_0x46e795},{'id':'continue','label':as(_0x20298a,'AI_QUICK_ACTIONS_CONTINUE_WRITING'),'type':'action','icon':_0x44e46e},{'id':'fix-grammar','label':as(_0x20298a,'AI_QUICK_ACTIONS_FIX_GRAMMAR_SPELLING'),'type':'action','icon':_0x304122},{'id':'adjust-length','label':as(_0x20298a,'AI_QUICK_ACTIONS_ADJUST_LENGTH'),'icon':_0x111fae,'actions':[{'id':'make-shorter','label':as(_0x20298a,'AI_QUICK_ACTIONS_MAKE_SHORTER'),'type':'action'},{'id':'make-longer','label':as(_0x20298a,'AI_QUICK_ACTIONS_MAKE_LONGER'),'type':'action'}]},{'id':'change-tone','label':as(_0x20298a,'AI_QUICK_ACTIONS_CHANGE_TONE'),'icon':_0x13a1b2,'actions':[{'id':'make-tone-casual','label':as(_0x20298a,'AI_QUICK_ACTIONS_MORE_CASUAL'),'type':'action'},{'id':'make-tone-direct','label':as(_0x20298a,'AI_QUICK_ACTIONS_MORE_DIRECT'),'type':'action'},{'id':'make-tone-friendly','label':as(_0x20298a,'AI_QUICK_ACTIONS_MORE_FRIENDLY'),'type':'action'},{'id':'make-tone-confident','label':as(_0x20298a,'AI_QUICK_ACTIONS_MORE_CONFIDENT'),'type':'action'},{'id':'make-tone-professional','label':as(_0x20298a,'AI_QUICK_ACTIONS_MORE_PROFESSIONAL'),'type':'action'}]},{'id':'translate','label':as(_0x20298a,'AI_QUICK_ACTIONS_TRANSLATE'),'icon':_0x5d111c,'actions':[{'id':'translate-to-english','label':as(_0x20298a,'AI_QUICK_ACTIONS_TRANSLATE_ENGLISH'),'type':'action','actionName':'translate','args':{'language':'english'}},{'id':'translate-to-chinese','label':as(_0x20298a,'AI_QUICK_ACTIONS_TRANSLATE_CHINESE'),'type':'action','actionName':'translate','args':{'language':'chinese'}},{'id':'translate-to-spanish','label':as(_0x20298a,'AI_QUICK_ACTIONS_TRANSLATE_SPANISH'),'type':'action','actionName':'translate','args':{'language':'spanish'}},{'id':'translate-to-german','label':as(_0x20298a,'AI_QUICK_ACTIONS_TRANSLATE_GERMAN'),'type':'action','actionName':'translate','args':{'language':'german'}},{'id':'translate-to-french','label':as(_0x20298a,'AI_QUICK_ACTIONS_TRANSLATE_FRENCH'),'type':'action','actionName':'translate','args':{'language':'french'}},{'id':'translate-to-japanese','label':as(_0x20298a,'AI_QUICK_ACTIONS_TRANSLATE_JAPANESE'),'type':'action','actionName':'translate','args':{'language':'japanese'}},{'id':'translate-to-portuguese','label':as(_0x20298a,'AI_QUICK_ACTIONS_TRANSLATE_PORTUGUESE'),'type':'action','actionName':'translate','args':{'language':'portuguese'}},{'id':'translate-to-korean','label':as(_0x20298a,'AI_QUICK_ACTIONS_TRANSLATE_KOREAN'),'type':'action','actionName':'translate','args':{'language':'korean'}},{'id':'translate-to-italian','label':as(_0x20298a,'AI_QUICK_ACTIONS_TRANSLATE_ITALIAN'),'type':'action','actionName':'translate','args':{'language':'italian'}},{'id':'translate-to-russian','label':as(_0x20298a,'AI_QUICK_ACTIONS_TRANSLATE_RUSSIAN'),'type':'action','actionName':'translate','args':{'language':'russian'}}]},{'id':'other','label':as(_0x20298a,'AI_QUICK_ACTIONS_OTHER'),'icon':_0x10a91a,'actions':[]}];return _0x3ef6f7;}(_0x77200c);}async['_getDefaultAndCustomActions'](){const _0x41f486=Ma['getDefaultQuickActions'](this['editor']['locale']),_0x28c74a=this['editor']['config']['get']('ai.quickActions.extraCommands')||[];let _0x86d592=[];try{_0x86d592=await new Bs({'connector':this['editor']['plugins']['get']('AIConnector'),'locale':this['editor']['locale']})['getAll']();}catch(_0xc60d30){const _0x316e86=new ot('ai-quick-actions-models-unable-to-retrieve',this,{'error':_0xc60d30});Et(_0x316e86['message']);}finally{const _0x1fbc0f=_0x28c74a['map'](_0x353316=>({..._0x353316,'type':'chat'===_0x353316['type']?'chat':'action','icon':void 0x0}));_0x41f486['find'](_0x595b94=>'other'===_0x595b94['id'])['actions']['push'](..._0x1fbc0f),_0x41f486['forEach'](_0x32053b=>{if('actions'in _0x32053b)_0x32053b['actions']['forEach'](_0x2d99a4=>{if(_0x2d99a4['isEnabled']=!!_0x86d592['find'](_0x31f046=>_0x31f046['id']===_0x2d99a4['model'])||void 0x0===_0x2d99a4['model'],!_0x2d99a4['isEnabled']){const _0x5ce5da=new ot('ai-quick-actions-unavailable-model',this,{'actionId':_0x2d99a4['id'],'modelId':_0x2d99a4['model']});Et(_0x5ce5da['message']);}});else{if(_0x32053b['isEnabled']=!!_0x86d592['find'](_0x1214c1=>_0x1214c1['id']===_0x32053b['model'])||void 0x0===_0x32053b['model'],!_0x32053b['isEnabled']){const _0x4506e9=new ot('ai-quick-actions-unavailable-model',this,{'actionId':_0x32053b['id'],'modelId':_0x32053b['model']});Et(_0x4506e9['message']);}}});}return _0x41f486;}['_initializeQuickActionsComponentsAndCommands'](){const _0x2ff105=new qt(this['editor']['locale']);_0x2ff105['attachToDom'](),this['_initializeQuickActionsDropdown'](_0x2ff105),this['_initializeQuickActionsMenuBar'](),this['_initializeQuickActionsComponents'](_0x2ff105);}['_initializeQuickActionsDropdown'](_0x5c154f){const _0x22c13a=this['editor']['config']['get']('ai.quickActions.isSearchEnabled')??!0x0;this['editor']['ui']['componentFactory']['add']('aiQuickActions',xa({'editor':this['editor'],'content':this['_quickActionsDefinition'],'buttonDefinition':{'icon':_0x5b1111,'label':as(this['editor']['locale'],'AI_QUICK_ACTIONS_HEADING')},'bodyCollection':_0x5c154f,'hasSearch':_0x22c13a}));}['_prepareQuickActionsDefinition'](_0xbf7b72){this['_quickActionsDefinition']=_0xbf7b72['map'](_0x14511e=>{if('actions'in _0x14511e){const _0x57a474=_0x14511e;return{..._0x57a474,'actions':_0x57a474['actions']['map'](_0x5c3f38=>{const {actions:_0x193147,..._0x21c6b2}=_0x57a474;return{..._0x5c3f38,'parent':_0x21c6b2};})['filter'](_0x2cf862=>this['_shouldIncludeAction'](_0x2cf862))};}return _0x14511e;})['filter'](_0x17ad20=>'actions'in _0x17ad20?_0x17ad20['actions']['length']>0x0:this['_shouldIncludeAction'](_0x17ad20));}['_shouldIncludeAction'](_0x74d47e){const _0x277751=this['editor']['config']['get']('ai.quickActions.removeCommands')||[];return this['editor']['plugins']['has'](Ha[_0x74d47e['type']])&&!_0x277751['includes'](_0x74d47e['id'])&&!('chat'===_0x74d47e['type']&&!0x1===this['editor']['config']['get']('ai.chat.context.document.enabled'));}['_initializeQuickActionsComponents'](_0x41f138){this['_quickActionsDefinition']['forEach'](_0xa4797f=>{if('actions'in _0xa4797f){const _0x11ec4b=xa({'editor':this['editor'],'content':_0xa4797f['actions'],'buttonDefinition':_0xa4797f,'bodyCollection':_0x41f138});this['editor']['ui']['componentFactory']['add'](_0xa4797f['id'],_0x11ec4b),_0xa4797f['actions']['forEach'](_0x124da2=>{const _0x396396=Ra({'editor':this['editor'],'action':_0x124da2});this['editor']['ui']['componentFactory']['add'](_0x124da2['id'],_0x396396);});}else{const _0x19c30f=Ra({'editor':this['editor'],'action':_0xa4797f,'withText':!0x1,'withIcon':!0x0,'isInDropdown':!0x1});this['editor']['ui']['componentFactory']['add'](_0xa4797f['id'],_0x19c30f);}});}['_initializeQuickActionsMenuBar'](){this['editor']['ui']['componentFactory']['add']('menuBar:aiQuickActions',_0x139b46=>{const _0x1a313b=new Ft(_0x139b46),_0x4beca5=as(_0x139b46,'AI_QUICK_ACTIONS_HEADING');_0x1a313b['buttonView']['set']({'label':_0x4beca5,'icon':_0x5b1111});const _0x7baec8=new Yt(_0x139b46);_0x7baec8['set']({'ariaLabel':_0x4beca5,'role':'menu'}),this['_quickActionsDefinition']['forEach'](_0x11545c=>{if('actions'in _0x11545c){const _0x1cee44=_0x11545c,_0x526d51=new $t(_0x139b46,_0x1a313b),_0x23e8b3=new Ft(_0x139b46),_0x168fd6=new Yt(_0x139b46);_0x23e8b3['buttonView']['set']({'label':_0x1cee44['label'],'icon':_0x1cee44['icon']}),_0x1cee44['actions']['forEach'](_0x5f4a65=>{const _0xa40b02=new $t(_0x139b46,_0x23e8b3),_0x3827d2=new Kt(_0x139b46);_0x3827d2['set']({'label':_0x5f4a65['label'],'icon':_0x5f4a65['icon'],'role':'menuitem','isEnabled':_0x5f4a65['isEnabled']}),_0x3827d2['on']('execute',()=>{this['_executeQuickAction'](_0x5f4a65);}),_0x3827d2['delegate']('execute')['to'](_0x23e8b3),_0xa40b02['children']['add'](_0x3827d2),_0x168fd6['items']['add'](_0xa40b02);}),_0x23e8b3['panelView']['children']['add'](_0x168fd6),_0x526d51['children']['add'](_0x23e8b3),_0x7baec8['items']['add'](_0x526d51);}else{const _0x3fab6b=_0x11545c,_0x5e06dc=new $t(_0x139b46,_0x1a313b),_0x19ce70=new Kt(_0x139b46);_0x19ce70['set']({'label':_0x3fab6b['label'],'icon':_0x3fab6b['icon'],'role':'menuitem','isEnabled':_0x3fab6b['isEnabled']}),_0x19ce70['on']('execute',()=>{this['_executeQuickAction'](_0x3fab6b);}),_0x19ce70['delegate']('execute')['to'](_0x1a313b),_0x5e06dc['children']['add'](_0x19ce70),_0x7baec8['items']['add'](_0x5e06dc);}});const _0x2e5fe3=Object['values'](Ha)['some'](_0x461296=>this['editor']['plugins']['has'](_0x461296));return _0x1a313b['set']({'isEnabled':_0x2e5fe3}),_0x1a313b['panelView']['children']['add'](_0x7baec8),_0x1a313b;});}['_executeQuickAction'](_0x4026f8){const _0x88f75b=this['editor'];_0x88f75b['editing']['view']['focus'](),_0x88f75b['commands']['execute']('aiQuickAction',_0x4026f8);const _0xf197d2=_0x88f75b['ui']['view']['menuBarView'];_0xf197d2&&_0xf197d2['close']&&_0xf197d2['close']();}}class Ua extends _0x49b69e{['execute'](_0x13128c){switch(this['_expandSelectionIfCollapsed'](),_0x13128c['type']){case'chat':if(!this['editor']['plugins']['has']('AIChat')){const _0x3a25d1=as(this['editor']['locale'],'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND','AIChat');throw new ot('ai-quick-actions-plugin-not-found',this['editor'],{'errorMessage':_0x3a25d1});}this['_handleAIChatAction'](_0x13128c);break;case'action':if(!this['editor']['plugins']['has']('AIActions')){const _0x551603=as(this['editor']['locale'],'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND','AIActions');throw new ot('ai-quick-actions-plugin-not-found',this['editor'],{'errorMessage':_0x551603});}this['_handleAIActionsAction'](_0x13128c);}}async['_handleAIChatAction'](_0x4d8d6f){const _0x2390b7=this['editor']['plugins']['get']('AIChatController'),_0x36a531=this['editor']['plugins']['get']('AITabs')['view'];if(_0x36a531['isVisible']||(_0x36a531['isVisible']=!0x0),'chat'!==_0x36a531['activeTab']&&_0x36a531['activateTab']('chat'),'ask-ai'===_0x4d8d6f['id'])_0x2390b7['removeSelectionFromChatContext'](),_0x2390b7['addSelectionToChatContext'](),_0x2390b7['focusPromptInput']();else await _0x2390b7['startConversation'](),_0x2390b7['removeSelectionFromChatContext'](),_0x2390b7['addSelectionToChatContext'](),_0x2390b7['focusPromptInput'](),await _0x2390b7['sendMessage']({'message':_0x4d8d6f['prompt']||_0x4d8d6f['displayedPrompt']||_0x4d8d6f['label'],'attributes':{'quickActionData':{'id':_0x4d8d6f['id']},'displayedPrompt':_0x4d8d6f['displayedPrompt']}});}['_expandSelectionIfCollapsed'](){const _0x5016e8=this['editor'],_0x443204=_0x5016e8['model']['document']['selection'];if(!_0x443204['isCollapsed'])return;const _0x3797f2=gt(_0x443204['getSelectedBlocks']())||_0x5016e8['model']['schema']['getLimitElement'](_0x443204);_0x5016e8['model']['change'](_0x3cd23d=>{_0x3cd23d['setSelection'](_0x3797f2,'in');});}['_handleAIActionsActionLabel'](_0x46472b){return _0x46472b['parent']?.['label']&&'other'!==_0x46472b['parent']?.['id']?_0x46472b['parent']['label']+':\x20'+_0x46472b['label']:_0x46472b['label'];}async['_handleAIActionsAction'](_0x1e75cd){const _0x1d7652=this['editor']['plugins']['get']('AIActions'),_0x3c2c6f=_0x1e75cd['prompt']?{'userMessage':_0x1e75cd['prompt'],'model':_0x1e75cd['model']}:{'actionName':_0x1e75cd['actionName']||_0x1e75cd['id'],'args':_0x1e75cd['args']},_0x1ed6a3=this['_handleAIActionsActionLabel'](_0x1e75cd);await _0x1d7652['executeAction'](_0x3c2c6f,_0x1ed6a3,_0x1e75cd['icon']);}}class Va extends _0x369cb6{static get['pluginName'](){return'AIQuickActionsEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x1cd08d=this['editor'],_0x1f59ef=new Ua(this['editor']);if(_0x1cd08d['commands']['add']('aiQuickAction',_0x1f59ef),_0x1cd08d['plugins']['has']('AIChat')){const _0x43ea68=this['editor']['plugins']['get']('AIChatController');_0x1cd08d['model']['document']['selection']['on']('change:range',(_0xfcfc30,_0x362bb5)=>{_0x362bb5['directChange']&&_0x43ea68['removeSelectionFromChatContext']();});}}}class Ba extends vs{['updateChangeGroups'](){if(this['parsedMergedContent']=this['parsedContent']['cloneNode'](!0x0),0x0==this['parsedMergedContent']['childNodes']['length'])return void(this['changeGroups']=[]);const _0x415b47=this['documentContextContent']['children']['map'](_0x465e50=>({'node':_0x465e50,'id':gs(_0x465e50,'data-id')})),_0x2dc79c=this['parsedMergedContent']['children']['map'](_0x5a2262=>({'node':_0x5a2262,'id':gs(_0x5a2262,'data-id')||at()})),_0x81f7dc=_0x4ecd82(_0x415b47,_0x2dc79c,{'comparator':(_0x2114f0,_0x3c1451)=>_0x2114f0['id']==_0x3c1451['id'],'oneChangePerToken':!0x0});if(!this['isDone']){for(;_0x81f7dc['length']&&_0x81f7dc[_0x81f7dc['length']-0x1]['removed'];)_0x81f7dc['pop']();}const _0x3270e3=_0x81f7dc['map'](_0x539e5b=>{const _0x5e0bbe=_0x539e5b['added']?'new':_0x539e5b['removed']?'removed':'modified';return{'node':_0x539e5b['value'][0x0]['node'],'type':_0x5e0bbe,'id':_0x539e5b['value'][0x0]['id']};});this['changeGroups']=[{'changes':_0x3270e3,'state':'pending','index':0x0}];}['_getDifferentChangeGroups'](_0x337df8,_0x4e0b5f){return _0x4e0b5f;}}class Ga extends xs{['content'];['version'];['actionName'];['args'];['userMessage'];['model'];['hasError']=!0x1;['stoppedExplicitly']=!0x1;constructor(_0x2158c0){super(_0x2158c0),this['content']=_0x2158c0['content'],this['version']=_0x2158c0['version'],this['actionName']=_0x2158c0['actionName'],this['args']=_0x2158c0['args'],this['userMessage']=_0x2158c0['userMessage'],this['model']=_0x2158c0['model'],this['on']('interactionStopped',()=>{this['stoppedExplicitly']=!0x0;});}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':'text','content':this['content'],'version':this['version'],'label':'Current\x20document','uiId':'current-document'};}['createReply'](_0xdae13){const _0x4b0137=new Ba({'editor':this['editor'],'documentContextContent':this['content'],..._0xdae13});return this['replies']['push'](_0x4b0137),_0x4b0137['delegate'](...ys)['to'](this),this['fire']('replyCreated',_0x4b0137),_0x4b0137;}}class Fa extends Ot{constructor(_0x3a99c2,_0xa51806=!0x0,_0xc67e31=!0x0){super(_0x3a99c2),this['set']('isEnabled',!0x1),_0xa51806&&(this['applyButton']=this['_createButton'](as(_0x3a99c2,'AI_BALLOON_APPLY_BUTTON'),os),this['applyButton']['bind']('isEnabled')['to'](this),this['items']['add'](this['applyButton'])),_0xc67e31&&(this['suggestButton']=this['_createButton'](as(_0x3a99c2,'AI_BALLOON_SUGGEST_BUTTON'),_0xa51806?hs:os),this['suggestButton']['bind']('isEnabled')['to'](this),this['items']['add'](this['suggestButton'])),this['setButtonsVisibility']({'showApplyButton':_0xa51806,'showSuggestButton':_0xc67e31}),this['extendTemplate']({'attributes':{'class':['ck-ai-balloon__toolbar']}});}['setButtonsVisibility']({showApplyButton:_0xad9274,showSuggestButton:_0x27268b}){this['applyButton']&&(this['applyButton']['isVisible']=_0xad9274),this['suggestButton']&&(this['suggestButton']['isVisible']=_0x27268b);}['_createButton'](_0x419a9a,_0x3044a1){const _0x1b59e4=new kt(this['locale']);return _0x1b59e4['set']({'label':_0x419a9a,'class':_0x3044a1,'isVisible':!0x0,'withText':!0x0}),_0x1b59e4;}}class Ka extends Nt{constructor(_0x2677df){super(_0x2677df),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-balloon__disclaimer']},'children':[{'tag':'p','attributes':{'class':['ck','ck-ai-balloon__disclaimer-content']},'children':[{'text':as(_0x2677df,'AI_DISCLAIMER_TEXT')}]}]});}}class Wa extends Nt{constructor(_0x4c7a21){super(_0x4c7a21),this['set']('isVisible',!0x0);const _0x1d92c4=new fn('small');_0x1d92c4['isVisible']=!0x0;const _0x6f9d6e=new Nt(this['locale']);_0x6f9d6e['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-suggestion__loader-text']},'children':[as(this['locale'],'AI_CHAT_IS_WRITING')]}),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__loader',this['bindTemplate']['if']('isVisible','ck-hidden',_0x1d676e=>!_0x1d676e)]},'children':[_0x1d92c4,_0x6f9d6e]});}}class Ya extends Ta{['focusCycler'];['_config'];['_contentWrapper'];['_streamableContentView'];['_toolbarView'];['_miniToolbarView'];['_loaderView'];['_disclaimerView'];['_focusTracker'];['_keystrokes'];['_dialogContent'];['_focusables'];['_scrollManager'];['_navigationPreviousButton'];['_navigationNextButton'];['_navigationTryAgainButton'];['_navigationCounter'];constructor(_0x2f1612,_0x44f5db){super(_0x2f1612),this['set']('isBusy',!0x1),this['set']('isTrackChangesOn',!0x1),this['set']('_isLoading',!0x1),this['set']('_hasError',!0x1),this['_config']=_0x44f5db,this['_focusTracker']=new _t(),this['_keystrokes']=new At(),this['_focusables']=this['createCollection'](),this['focusCycler']=new Mt({'focusables':this['_focusables'],'focusTracker':this['_focusTracker'],'keystrokeHandler':this['_keystrokes'],'actions':{'focusPrevious':'shift\x20+\x20tab','focusNext':'tab'}}),this['_dialogContent']=new _0x553410(),this['_addContentWrapper'](_0x44f5db),this['_addDisclaimerView'](),this['_addToolbar'](_0x44f5db),this['_focusables']['clear'](),this['_focusables']['addMany']([this['_toolbarView']]),this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-actions-balloon-main']},'children':this['_dialogContent']}),this['on']('change:isTrackChangesOn',()=>{this['_toggleToolbarButtonsVisibility'](_0x44f5db);});}['render'](){super['render']();for(const _0x42aadc of this['_focusables'])this['_focusTracker']['add'](_0x42aadc['element']);this['_keystrokes']['listenTo'](this['element']),this['_initializeScrollManager']();}['destroy'](){super['destroy'](),this['_scrollManager']&&this['_scrollManager']['destroy']();}['focus'](_0x31ca4b){-0x1===_0x31ca4b?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}['setIsLoading'](_0x5db8f9){this['_isLoading']=_0x5db8f9;}['setErrorState'](){this['_hasError']=!0x0,this['_miniToolbarView']['toggleShowChangesEnabled'](!0x1);}['clearErrorState'](){this['_hasError']=!0x1,this['_miniToolbarView']['toggleShowChangesEnabled'](!0x0);}['showError'](_0xab8293){super['showError'](_0xab8293),this['_dialogContent']['has'](this['_errorView'])||this['_dialogContent']['add'](this['_errorView'],0x0);}['hideError'](){super['hideError'](),this['clearErrorState']();}['showBlockingError'](_0x1761fd){super['showBlockingError'](_0x1761fd),this['setErrorState']();}['addMiniToolbarItem'](_0x4596f1){this['_miniToolbarView']['items']['has'](_0x4596f1)||this['_miniToolbarView']['items']['add'](_0x4596f1);}['removeMiniToolbarItem'](_0x3d4479){this['_miniToolbarView']['items']['has'](_0x3d4479)&&this['_miniToolbarView']['items']['remove'](_0x3d4479);}['showLoader'](){this['_loaderView']&&(this['_isLoading']=!0x0);}['hideLoader'](){this['_loaderView']&&(this['_isLoading']=!0x1);}['_toggleToolbarButtonsVisibility']({showApplyButton:_0x505332,showSuggestButton:_0x4a7dbb}){_0x505332=_0x505332&&!this['isTrackChangesOn']&&this['_config']['availableActions']['includes']('applySuggestion'),_0x4a7dbb=_0x4a7dbb&&this['_config']['availableActions']['includes']('insertSuggestion'),this['_toolbarView']['setButtonsVisibility']({'showApplyButton':_0x505332,'showSuggestButton':_0x4a7dbb});}async['updateContent'](_0x442a3a){await this['_streamableContentView']['update'](_0x442a3a);}['clearContent'](){this['_streamableContentView']['clear']();}['_addContentWrapper'](_0x16bc20){this['_contentWrapper']=new Nt(this['locale']),this['_contentWrapper']['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-actions-balloon-content']},'children':[{'tag':'div','attributes':{'class':['ck-ai-actions-balloon-content-wrapper']},'children':[this['_createLoaderView'](),this['_createStreamableContentView']()]},this['_createMiniToolbar'](_0x16bc20['miniToolbarConfig'])]}),this['_dialogContent']['add'](this['_contentWrapper']);}['_addDisclaimerView'](){this['_disclaimerView']=new Ka(this['locale']),this['_dialogContent']['add'](this['_disclaimerView']);}['_addToolbar']({showApplyButton:_0x2ff815,showSuggestButton:_0x7f76c1}){this['_toolbarView']=new Fa(this['locale'],_0x2ff815,_0x7f76c1),this['_toolbarView']['applyButton']?.['on']('execute',()=>{this['fire']('applySuggestion');}),this['_toolbarView']['suggestButton']?.['on']('execute',()=>{this['fire']('insertSuggestion');}),this['_toolbarView']['bind']('isEnabled')['to'](this,'isBusy',this,'_isLoading',this,'_hasError',(_0x1f04e4,_0x46d258,_0xc88cf6)=>!(_0x1f04e4||_0x46d258||_0xc88cf6)),this['_toggleToolbarButtonsVisibility']({'showApplyButton':_0x2ff815,'showSuggestButton':_0x7f76c1}),this['_dialogContent']['add'](this['_toolbarView']);}['_createMiniToolbar'](_0x3af77c){return this['_miniToolbarView']=new Ca(this['locale'],_0x3af77c),this['_miniToolbarView']['delegate'](...Qs)['to'](this),this['_miniToolbarView']['on']('toggleShowChanges',()=>{this['_miniToolbarView']['isShowChangesOn']=!this['_miniToolbarView']['isShowChangesOn'],this['fire']('toggleSuggestionDisplayMode',{'showDiff':this['_miniToolbarView']['isShowChangesOn']});}),this['_miniToolbarView']['bind']('isEnabled')['to'](this,'isBusy',this,'_isLoading',(_0x56d89b,_0x483d35)=>!(_0x56d89b||_0x483d35)),this['_miniToolbarView'];}['_createLoaderView'](){return this['_loaderView']=new Wa(this['locale']),this['_loaderView']['bind']('isVisible')['to'](this,'_isLoading'),this['_loaderView'];}['_createStreamableContentView'](){return this['_streamableContentView']=new un(this['locale']),this['_streamableContentView'];}['_setupMiniToolbarButtons'](){const _0x1d7f72=new kt(this['locale']),_0x50de86=new kt(this['locale']),_0x9af0c5=new $a(this['locale']),_0x142e02=new kt(this['locale']);_0x1d7f72['set']({'icon':tt,'label':as(this['locale'],'AI_ACTIONS_TRY_AGAIN'),'tooltip':!0x0,'class':'ck-ai-custom-action-button\x20'+cs}),_0x50de86['set']({'icon':_0x4b5cbc,'tooltip':as(this['locale'],'AI_ACTIONS_PREVIOUS_INTERACTION'),'class':'ck-ai-navigation-button\x20ck-ai-previous-button\x20'+cs}),_0x142e02['set']({'icon':et,'tooltip':as(this['locale'],'AI_ACTIONS_NEXT_INTERACTION'),'class':'ck-ai-navigation-button\x20ck-ai-next-button\x20'+cs}),_0x1d7f72['bind']('isEnabled')['to'](this,'isBusy',_0x3f3b99=>!_0x3f3b99),_0x1d7f72['on']('execute',()=>{this['fire']('tryAgain');}),_0x50de86['bind']('isEnabled')['to'](this,'isBusy',_0x4da3d1=>!_0x4da3d1),_0x50de86['on']('execute',()=>{this['fire']('showPrevious');}),_0x142e02['bind']('isEnabled')['to'](this,'isBusy',_0x295c31=>!_0x295c31),_0x142e02['on']('execute',()=>{this['fire']('showNext');}),this['_navigationPreviousButton']=_0x50de86,this['_navigationCounter']=_0x9af0c5,this['_navigationNextButton']=_0x142e02,this['_navigationTryAgainButton']=_0x1d7f72;}['updateMiniToolbarButtons'](_0x5ed9c2,_0x3ea989){this['_navigationPreviousButton']||this['_setupMiniToolbarButtons']();const _0x31fa02=_0x5ed9c2>0x1;if(this['addMiniToolbarItem'](this['_navigationTryAgainButton']),_0x31fa02){this['addMiniToolbarItem'](this['_navigationPreviousButton']),this['addMiniToolbarItem'](this['_navigationCounter']),this['addMiniToolbarItem'](this['_navigationNextButton']);const _0x41c9bd=_0x5ed9c2-_0x3ea989;this['_navigationCounter']['setInteractionCount'](_0x41c9bd+'/'+_0x5ed9c2),this['_navigationPreviousButton']['isEnabled']=_0x3ea989<_0x5ed9c2-0x1,this['_navigationNextButton']['isEnabled']=_0x3ea989>0x0;}else this['removeMiniToolbarItem'](this['_navigationPreviousButton']),this['removeMiniToolbarItem'](this['_navigationCounter']),this['removeMiniToolbarItem'](this['_navigationNextButton']);}['disableMiniToolbarButtons'](){this['_navigationTryAgainButton']['isEnabled']=!0x1,this['_navigationPreviousButton']['isEnabled']=!0x1,this['_navigationNextButton']['isEnabled']=!0x1;}['startAutoScroll'](){this['_initializeScrollManager'](),this['_scrollManager']&&this['_scrollManager']['start']();}['stopAutoScroll'](){this['_scrollManager']&&this['_scrollManager']['stop']();}['toggleIsLoading'](_0xa6c2d3){this['_isLoading']=_0xa6c2d3;}['resetShowChangesButton'](){this['_miniToolbarView']['isShowChangesOn']=!0x1;}['_initializeScrollManager'](){const _0x199058=this['_getScrollableElement']();_0x199058&&!this['_scrollManager']&&(this['_scrollManager']=new Xn(_0x199058));}['_getScrollableElement'](){return this['_streamableContentView']['element'];}}class $a extends Nt{constructor(_0x55cf78){super(_0x55cf78);const _0x2fcc3e=this['bindTemplate'];this['set']('interactionCount','1/1'),this['setTemplate']({'tag':'span','attributes':{'class':['ck-ai-interaction-counter']},'children':[{'text':_0x2fcc3e['to']('interactionCount')}]});}['setInteractionCount'](_0x34b21b){this['set']('interactionCount',_0x34b21b);}}class qa extends _0x369cb6{static get['requires'](){return[rs,Vt,qs,ma,_0x1b3b63];}static get['pluginName'](){return'AIActions';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['_aiConnector'];['_interactions']=[];['_currentInteractionIndex']=0x0;['_interactionParams'];['_balloonShowDiff']=!0x1;['_promiseQueue'];['_bodyCollection'];get['_interaction'](){return this['_interactions'][this['_interactions']['length']-0x1];}['_actionsBalloonView'];constructor(_0xd1a74a){super(_0xd1a74a),this['_bodyCollection']=new qt(this['editor']['locale']),this['_bodyCollection']['attachToDom'](),this['_aiConnector']=this['editor']['plugins']['get']('AIConnector'),this['set']('isBusy',!0x1),this['_promiseQueue']=new _n();}['stopInteraction'](){this['_stopInteraction']();}async['executeAction'](_0x1e64f8,_0x27661e,_0x43cf1c){if(this['_stopInteraction'](),this['editor']['plugins']['has']('TableSelection')){if(this['editor']['plugins']['get']('TableSelection')['getSelectedTableCells']()){const {modelFragment:_0x2ba34c,anchorData:_0x3c3c14}=this['_getExecuteDataInTable']();return this['_executeAction'](_0x1e64f8,_0x2ba34c,_0x3c3c14,_0x27661e,_0x43cf1c);}}const {modelFragment:_0x65b655,anchorData:_0x59f570}=this['_getExecuteDataRegular']();return this['_executeAction'](_0x1e64f8,_0x65b655,_0x59f570,_0x27661e,_0x43cf1c);}async['destroy'](){return this['_stopInteraction'](),this['_bodyCollection']['detachFromDom'](),super['destroy']();}['_createActionsBalloonView'](){const _0x1e4378=this['editor']['plugins']['has']('TrackChanges');let _0xb1c3c4=this['editor']['config']['get']('ai.availableReplyActions')||[...gn];_0x1e4378||(_0xb1c3c4=_0xb1c3c4['filter'](_0x199cfa=>'insertSuggestion'!=_0x199cfa));const _0x5b6b08=this['editor']['commands']['get']('trackChanges'),_0x42677e=new Ya(this['editor']['locale'],{'showApplyButton':!0x0,'showSuggestButton':_0x1e4378,'miniToolbarConfig':{'showChanges':'icon'},'availableActions':_0xb1c3c4});return _0x42677e['bind']('isBusy')['to'](this),_0x5b6b08&&_0x42677e['bind']('isTrackChangesOn')['to'](_0x5b6b08,'value'),_0x42677e['on']('tryAgain',()=>{this['_refreshInteraction']();}),_0x42677e['on']('showPrevious',()=>{this['_navigateToPrevious']();}),_0x42677e['on']('showNext',()=>{this['_navigateToNext']();}),_0x42677e;}['_getExecuteDataRegular'](){const _0x39461e=this['editor']['model']['document']['selection'];if(_0x39461e['isCollapsed']){const _0x30138d=gt(_0x39461e['getSelectedBlocks']())||this['editor']['model']['schema']['getLimitElement'](_0x39461e);this['editor']['model']['change'](_0x3afea2=>{_0x3afea2['setSelection'](_0x30138d,'in');});}const _0x28ee83=_0x39461e['getFirstRange'](),_0x2b3273=this['_wrapWithCommonAncestors'](this['editor']['model']['getSelectedContent'](_0x39461e),_0x28ee83['start'],_0x28ee83['end']);this['_copyMarkersToFragment'](_0x2b3273,_0x39461e,{'isTableSelection':!0x1});const _0x8705d6=_0x39461e['getFirstRange']()['start'],_0x249141=new Map();let _0x268f9b=_0x2b3273;for(let _0x336749=0x0;_0x336749<_0x8705d6['path']['length'];_0x336749++)_0x249141['set'](_0x268f9b,_0x8705d6['path'][_0x336749]),_0x268f9b=_0x268f9b['getChild'](0x0);return{'modelFragment':_0x2b3273,'anchorData':_0x249141};}['_getExecuteDataInTable'](){const _0x143799=this['editor']['model']['document']['selection'],_0x842c3b=this['editor']['plugins']['get']('TableSelection')['getSelectionAsFragment'](),_0x93ae14=_0x143799['getFirstRange']()['start']['parent']['parent'],_0x23be05=this['editor']['model']['createRange'](this['editor']['model']['createPositionBefore'](_0x93ae14),this['editor']['model']['createPositionAfter'](_0x93ae14)),_0x426e5f=this['_wrapWithCommonAncestors'](_0x842c3b,_0x23be05['start'],_0x23be05['end']);this['_copyMarkersToFragment'](_0x426e5f,_0x143799,{'isTableSelection':!0x0});const _0x1198e1=_0x143799['getFirstRange']()['start'],_0x4bde06=new Map();let _0x106df4=_0x426e5f;for(let _0x42730d=0x0;_0x42730d<_0x1198e1['path']['length'];_0x42730d++)if(_0x4bde06['set'](_0x106df4,_0x1198e1['path'][_0x42730d]),_0x42730d<_0x1198e1['path']['length']-0x1)_0x106df4=_0x106df4['getChild'](0x0);else{let _0x50b1d1=_0x106df4['nextSibling'];for(;_0x50b1d1;)_0x4bde06['set'](_0x50b1d1,_0x1198e1['path'][_0x42730d]),_0x50b1d1=_0x50b1d1['nextSibling'];}return{'modelFragment':_0x426e5f,'anchorData':_0x4bde06};}async['_executeAction'](_0x3aebdd,_0x16f627,_0x3eef67,_0x12c0a2,_0x419f4d){const _0x34298c=this['editor']['plugins']['get'](qs),_0x1b2cc5=this['editor']['plugins']['get'](ma),_0x23016f=this['editor']['model']['document']['selection'],_0x21b88f=await _0x34298c['modelToDataWithIds'](_0x16f627),_0x794667=this['editor']['model']['document']['version'],_0x4a8f5a=[..._0x23016f['getRanges']()];return this['_actionsBalloonView']||(this['_actionsBalloonView']=this['_createActionsBalloonView']()),this['_clearInteractionHistory'](),this['_clearErrorState'](),this['_balloonShowDiff']=!0x1,this['_actionsBalloonView']['resetShowChangesButton'](),this['_actionsBalloonView']['clearContent'](),_0x1b2cc5['open']({'index':0x3e8*Math['random']()%0x3e8,'title':_0x12c0a2,'icon':_0x419f4d||_0x5b1111,'mainView':this['_actionsBalloonView'],'class':'ck-ai-actions-balloon','ranges':_0x4a8f5a,'id':'aiActionsBalloon'}),this['_setLoadingState'](),this['stopListening'](this['_actionsBalloonView']),this['stopListening'](_0x1b2cc5),this['_interactionParams']={'action':_0x3aebdd,'content':_0x21b88f,'version':_0x794667,'aiBalloon':_0x1b2cc5,'modelFragment':_0x16f627,'anchorData':_0x3eef67},this['_setupApplyListeners'](),this['listenTo'](_0x1b2cc5,'selectionRemoved',()=>{this['_stopInteraction'](),this['_actionsBalloonView']['disableMiniToolbarButtons']();}),this['listenTo'](_0x1b2cc5,'dialogClosed',(_0x446ba4,{id:_0x2d6bae})=>{if('aiActionsBalloon'===_0x2d6bae){for(const _0x58dbb0 of this['_interactions']){if(0x0===_0x58dbb0['replies']['length']||_0x58dbb0['stoppedExplicitly'])continue;const _0xbfef07=_0x58dbb0['replies'][_0x58dbb0['replies']['length']-0x1],_0xb30dff=_0xbfef07['changeGroups'][0x0];_0xb30dff&&'pending'===_0xb30dff['state']&&_0xbfef07['setChangeGroupState'](0x0,'rejected');}this['_stopInteraction'](),this['_clearInteractionHistory'](),this['stopListening'](this['_actionsBalloonView']),this['stopListening'](_0x1b2cc5);}}),this['_createInteraction'](_0x21b88f,_0x794667,_0x1b2cc5,_0x3aebdd);}['_setupApplyListeners'](){if(!this['_interactionParams'])return;const {modelFragment:_0x577076,anchorData:_0x2356e4}=this['_interactionParams'];this['listenTo'](this['_actionsBalloonView'],'applySuggestion',()=>{this['_applyChanges'](_0x577076,_0x2356e4,!0x1);}),this['listenTo'](this['_actionsBalloonView'],'insertSuggestion',()=>{this['_applyChanges'](_0x577076,_0x2356e4,!0x0);});}['_wrapWithCommonAncestors'](_0x38f3f9,_0x5e885a,_0x3af9e5){const _0xa8490a=this['editor']['model']['createRange'](_0x5e885a,_0x3af9e5)['getCommonAncestor'](),_0x42a003=_0xa8490a['is']('documentFragment')?[]:_0xa8490a['getAncestors']({'includeSelf':!0x0})['slice'](0x1);if(_0x42a003['length']){const _0x3f2c1f=_0x42a003['map'](_0x2bf8fa=>_0x2bf8fa['_clone'](!0x1));for(let _0xabe8d9=0x1;_0xabe8d9<_0x3f2c1f['length'];_0xabe8d9++)_0x3f2c1f[_0xabe8d9-0x1]['_appendChild'](_0x3f2c1f[_0xabe8d9]);return _0x3f2c1f[_0x3f2c1f['length']-0x1]['_appendChild'](_0x38f3f9),new _0x4aa4eb(_0x3f2c1f[0x0]);}return _0x38f3f9;}['_copyMarkersToFragment'](_0x1855d7,_0x189e44,_0x11e1ff={'isTableSelection':!0x1}){const _0xf46f9b=this['editor']['model'],_0x15daf8=Array['from'](_0x189e44['getRanges']()),_0x35afd1=_0x189e44['getFirstRange']()['start'];for(const _0x2e7f9 of _0xf46f9b['markers']){if(_0x2e7f9['name']['startsWith']($s)||!_0x2e7f9['affectsData'])continue;const _0x2b9a85=_0x2e7f9['getRange']();if(!_0x15daf8['some'](_0x1aa0ca=>_0x1aa0ca['containsRange'](_0x2b9a85,!0x0)))continue;const _0x572e0f=this['_regularCalculateMarkerPath'](_0x2b9a85['start'],_0x35afd1,_0x11e1ff['isTableSelection']),_0xb3bee3=this['_regularCalculateMarkerPath'](_0x2b9a85['end'],_0x35afd1,_0x11e1ff['isTableSelection']),_0x3a2908=_0xf46f9b['createPositionFromPath'](_0x1855d7,_0x572e0f),_0x35ecf7=_0xf46f9b['createPositionFromPath'](_0x1855d7,_0xb3bee3);if(!_0x3a2908['isEqual'](_0x35ecf7)){const _0x56994d=_0xf46f9b['createRange'](_0x3a2908,_0x35ecf7);_0x1855d7['markers']['set'](_0x2e7f9['name'],_0x56994d);}}}['_regularCalculateMarkerPath'](_0x292562,_0x433d19,_0x149f0f=!0x1){const _0x44b72c=[..._0x292562['path']['slice']()];for(let _0x5616bb=0x0;_0x5616bb<Math['max'](_0x433d19['path']['length'],_0x292562['path']['length']);_0x5616bb++){const _0x34c0c5=_0x433d19['path'][_0x5616bb]||0x0,_0x23cfed=(_0x292562['path'][_0x5616bb]||0x0)-_0x34c0c5;if(_0x44b72c[_0x5616bb]=_0x23cfed,0x0!==_0x23cfed&&!_0x149f0f)break;}return _0x44b72c;}async['_createInteraction'](_0x44ea66,_0x4bf0d6,_0x2e9c42,_0x36f6a8){const _0x290f27=this['editor'];this['_interactionParams']||(this['_interactionParams']={'action':_0x36f6a8,'content':_0x44ea66,'version':_0x4bf0d6,'aiBalloon':_0x2e9c42,'modelFragment':this['editor']['model']['getSelectedContent'](this['editor']['model']['document']['selection']),'anchorData':new Map()});const _0x328bfb=new Ga({'connector':this['_aiConnector'],'editor':_0x290f27,'content':_0x44ea66,'version':_0x4bf0d6,..._0x36f6a8});this['_interactions']['push'](_0x328bfb);const _0x305e87=(_0x3e2e58,_0x25c769=!0x1,_0x346103='streaming')=>this['_promiseQueue']['enqueue'](async _0x174edb=>{try{const _0xd0233=Ss({'editor':_0x290f27,'changeGroups':_0x3e2e58['changeGroups'],'documentContextContent':_0x3e2e58['documentContextContent'],'showDiff':_0x25c769,'trimUnchanged':!0x1});_0xd0233['length']&&await this['_actionsBalloonView']['updateContent']({'part':_0xd0233[0x0],'renderingStrategy':_0x346103,'abortSignal':_0x174edb});}catch(_0x9f2fde){if(this['_isAbortError'](_0x9f2fde))return;throw _0x9f2fde;}});_0x328bfb['on']('replyCreated',(_0x382628,_0x201c60)=>{this['_actionsBalloonView']['hideLoader'](),this['_actionsBalloonView']['startAutoScroll'](),_0x305e87(_0x201c60)['catch'](_0x19682d=>{this['_isAbortError'](_0x19682d)||(console['error']('Error\x20updating\x20content\x20in\x20replyCreated:',_0x19682d),this['_setErrorState'](_0x328bfb));});}),_0x328bfb['on']('replyContentUpdated',(_0x350df6,_0x5c861f)=>{_0x305e87(_0x5c861f)['catch'](_0x34f235=>{this['_isAbortError'](_0x34f235)||(console['error']('Error\x20updating\x20content\x20in\x20replyContentUpdated:',_0x34f235),this['_setErrorState'](_0x328bfb));});}),_0x328bfb['on']('interactionFinished',async()=>{try{await this['_clearLoadingState'](),this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']),await this['_promiseQueue']['queueEmptyPromise'];}catch(_0x4ed038){this['_isAbortError'](_0x4ed038)||(console['error']('Error\x20clearing\x20loading\x20state\x20in\x20interactionFinished:',_0x4ed038),this['_setErrorState'](_0x328bfb));}finally{this['_actionsBalloonView']['stopAutoScroll']();}}),this['listenTo'](this['_actionsBalloonView'],'toggleSuggestionDisplayMode',async(_0x2c9128,{showDiff:_0x3dcc92})=>{try{this['_balloonShowDiff']=_0x3dcc92;const _0x18a2bb=this['_interaction']['replies'][this['_interaction']['replies']['length']-0x1];_0x18a2bb&&await _0x305e87(_0x18a2bb,_0x3dcc92,'static');}catch(_0x18dcaf){this['_isAbortError'](_0x18dcaf)||(console['error']('Error\x20updating\x20content\x20in\x20toggleSuggestionDisplayMode:',_0x18dcaf),this['_setErrorState'](_0x328bfb));}}),_0x328bfb['on']('replyChangeGroupStateUpdated',()=>{const _0x19600e={'positiveCount':_0x328bfb['replies']['reduce']((_0x20dce6,_0x5f1ff3)=>_0x20dce6+_0x5f1ff3['changeGroups']['filter'](_0x520f5e=>'accepted'===_0x520f5e['state'])['length'],0x0),'totalCount':_0x328bfb['replies']['reduce']((_0x54d51e,_0x1d9b22)=>_0x54d51e+_0x1d9b22['changeGroups']['length'],0x0)},_0x3c2568=_0x328bfb['actionCallId'],_0x5d430a=_0x328bfb['actionName'];_0x5d430a?this['_aiConnector']['upsertAIActionRating'](_0x5d430a,_0x3c2568,_0x19600e):this['_aiConnector']['upsertCustomAIActionRating'](_0x3c2568,_0x19600e);}),this['_setLoadingState']();try{const _0x3387aa=await _0x328bfb['start']();return this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']),_0x3387aa;}catch(_0x4c11a5){if(this['_isAbortError'](_0x4c11a5))return;this['_actionsBalloonView']['hideLoader'](),this['_setErrorState'](_0x328bfb);}}['_applyChanges'](_0x402dc1,_0x66a516,_0x159907){const _0x37a1a9=this['editor'];if(_0x159907&&!_0x37a1a9['plugins']['has']('TrackChanges'))throw new ot('ai-no-track-changes',null);const _0x5b255b=this['editor']['plugins']['get'](_0x1b3b63),_0x4d6978=this['_interactions'][this['_interactions']['length']-0x1-this['_currentInteractionIndex']];if(!_0x4d6978||!_0x4d6978['replies']['length'])return;const _0x491414=_0x4d6978['replies'][_0x4d6978['replies']['length']-0x1],_0x35705e=_0x491414['changeGroups'];_0x491414['setChangeGroupState'](0x0,'accepted');let _0x5c92cc=Ks({'editor':_0x37a1a9,'reply':_0x491414,'interaction':_0x4d6978,'groups':_0x35705e,'transform':!0x1,'documentCompare':_0x5b255b,'documentCompareOptions':{'anchor':_0x37a1a9['model']['createPositionAt'](_0x402dc1,0x0),'markDeletions':_0x159907}});_0x5c92cc=this['_filterOperationsOutsideRange'](_0x5c92cc,_0x66a516);for(const _0x226ddd of _0x5c92cc)this['_anchorOperation'](_0x66a516,_0x226ddd,_0x37a1a9['model']['document']['getRoot']());const _0x3c6105=_0x4d6978['getDocumentContext']()['version'],_0x2c898f=_0x37a1a9['model']['document']['history']['getOperations'](_0x3c6105),_0x282da3={'document':_0x37a1a9['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1},_0x2b317f=_0x3d9713(_0x5c92cc,_0x2c898f,_0x282da3)['operationsA'];_0x37a1a9['model']['change'](_0x304521=>{if(_0x304521['setSelection'](_0x37a1a9['model']['document']['selection']['focus']),_0x159907)_0x37a1a9['plugins']['get']('TrackChangesEditing')['_applyOperationsAsSuggestions'](_0x2b317f);else{for(const _0x40b3d7 of _0x2b317f)_0x40b3d7['baseVersion']=_0x37a1a9['model']['document']['version'],Ws(_0x37a1a9,_0x40b3d7),_0x304521['batch']['addOperation'](_0x40b3d7),_0x37a1a9['model']['applyOperation'](_0x40b3d7);}}),this['editor']['plugins']['get']('AIBalloon')['close']();}['_filterOperationsOutsideRange'](_0x190bd0,_0x5b3206){return _0x190bd0['filter'](_0x3c602d=>{if('rename'==_0x3c602d['type']){const _0x1b9a75=_0x3c602d['position']['nodeAfter'];return!_0x5b3206['has'](_0x1b9a75);}if(_0x3c602d['type']['indexOf']('Attribute')>-0x1){const _0x4201de=_0x3c602d['range']['start']['nodeAfter'];return!_0x5b3206['has'](_0x4201de);}return!0x0;});}['_anchorOperation'](_0x4f93b7,_0x133410,_0x5bf150){const _0x3bdd15=_0x133410['clone']();for(const _0x45be24 in _0x133410){const _0x5c4daf=_0x133410[_0x45be24];_0x5c4daf instanceof _0x2861aa?_0x133410[_0x45be24]=new _0x2861aa(_0x299d58(_0x5c4daf['start']),_0x299d58(_0x5c4daf['end'])):_0x5c4daf instanceof _0x99b885&&(_0x133410[_0x45be24]=_0x299d58(_0x5c4daf));}if(['insert','move','remove','reinsert','split','merge']['includes'](_0x3bdd15['type'])){if(_0x3bdd15['isDocumentOperation']=!0x1,_0x3bdd15['baseVersion']=null,'remove'==_0x3bdd15['type']){const _0x138b3b=_0x3bdd15['sourcePosition'],_0x848a39=_0x3bdd15['howMany'];new _0x15c955(_0x138b3b,_0x848a39)['_execute']();}else _0x3bdd15['_execute']();}function _0x299d58(_0x52f354){if('$graveyard'==_0x52f354['root']['rootName'])return _0x52f354;const _0x5dd36b=[];let _0x47635b=_0x52f354['root'];for(let _0x4db589=0x0;_0x4db589<_0x52f354['path']['length'];_0x4db589++){const _0x8ab92c=_0x4f93b7['get'](_0x47635b)||0x0;_0x5dd36b[_0x4db589]=_0x52f354['path'][_0x4db589]+_0x8ab92c,_0x47635b=_0x47635b['getChildAtOffset'](_0x52f354['path'][_0x4db589]);}return new _0x99b885(_0x5bf150,_0x5dd36b,_0x52f354['stickiness']);}}['_refreshInteraction'](){if(!this['_interactionParams'])return;this['_interactions']['length']>0x0&&this['_stopInteraction'](),this['_currentInteractionIndex']=0x0,this['_balloonShowDiff']=!0x1;const {action:_0x27fdf3,content:_0x3e889c,version:_0x32a026,aiBalloon:_0x56576f}=this['_interactionParams'];this['_clearErrorState'](),this['_actionsBalloonView']['clearContent'](),this['_actionsBalloonView']['showLoader'](),this['_actionsBalloonView']['resetShowChangesButton'](),this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']),this['stopListening'](this['_actionsBalloonView']),this['_setupApplyListeners'](),this['_createInteraction'](_0x3e889c,_0x32a026,_0x56576f,_0x27fdf3)['catch'](_0x32b1b1=>{this['_isAbortError'](_0x32b1b1)||console['error']('Error\x20refreshing\x20interaction:',_0x32b1b1);});}['_isAbortError'](_0x2ed97f){return!!_0x2ed97f['message']&&_0x2ed97f['message']['startsWith']('ai-request-aborted');}['_clearInteractionHistory'](){this['_interactions']=[],this['_interactionParams']=void 0x0,this['_currentInteractionIndex']=0x0,this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']);}['_stopInteraction'](){this['_interaction']&&this['_interaction']['stop'](),this['_promiseQueue']['abort'](),this['isBusy']=!0x1,this['_interactionParams']&&this['_actionsBalloonView']['stopAutoScroll']();}['_navigateToPrevious'](){const _0x30eef9=this['_interactions']['length'];this['_currentInteractionIndex']<_0x30eef9-0x1&&this['_displayInteractionAtIndex'](this['_currentInteractionIndex']+0x1);}['_navigateToNext'](){this['_currentInteractionIndex']>0x0&&this['_displayInteractionAtIndex'](this['_currentInteractionIndex']-0x1);}async['_displayInteractionAtIndex'](_0x29f367){if(!this['_interactionParams'])return;this['_currentInteractionIndex']=_0x29f367;const _0x5a3f0e=this['_interactions'][this['_interactions']['length']-0x1-this['_currentInteractionIndex']];if(!_0x5a3f0e)return;if(_0x5a3f0e['hasError'])return this['_setErrorState'](_0x5a3f0e),void this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']);if(!_0x5a3f0e['replies']['length'])return;this['_actionsBalloonView']['hideError'](),this['_interactionParams']&&this['_clearErrorState']();const _0x2c6ac5=_0x5a3f0e['replies'][_0x5a3f0e['replies']['length']-0x1];if(_0x2c6ac5){const _0x44d3bc=this['editor'];try{const _0x20ffc1=Ss({'editor':_0x44d3bc,'changeGroups':_0x2c6ac5['changeGroups'],'documentContextContent':_0x2c6ac5['documentContextContent'],'showDiff':this['_balloonShowDiff'],'trimUnchanged':!0x1});await new Promise(_0x4ece85=>setTimeout(_0x4ece85,0x32)),await this['_actionsBalloonView']['updateContent']({'part':_0x20ffc1[0x0],'renderingStrategy':'static','abortSignal':new AbortController()['signal']});}catch(_0x429c8b){this['_isAbortError'](_0x429c8b)||console['error']('Error\x20updating\x20content\x20during\x20navigation:',_0x429c8b);}}this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']);}['_setLoadingState'](){this['_actionsBalloonView']['setIsLoading'](!0x0),this['isBusy']=!0x0;}async['_setErrorState'](_0x317ea3){const _0x2144de=as(this['editor']['locale'],'AI_ACTIONS_GENERIC_ERROR');this['_actionsBalloonView']['showError'](_0x2144de),_0x317ea3['hasError']=!0x0,await this['_promiseQueue']['queueEmptyPromise'],this['_actionsBalloonView']['setErrorState'](),this['_actionsBalloonView']['toggleIsLoading'](!0x0);}['_clearErrorState'](){this['_actionsBalloonView']['hideError'](),this['_actionsBalloonView']['toggleIsLoading'](!0x1);}async['_clearLoadingState'](){await this['_promiseQueue']['queueEmptyPromise'],this['isBusy']=!0x1,this['_actionsBalloonView']['setIsLoading'](!0x1);}}class Qa extends _0x369cb6{static get['requires'](){return[Ma,Va,qa];}static get['pluginName'](){return'AIQuickActions';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x41adc2){super(_0x41adc2),_0x41adc2['config']['define']('ai.quickActions',{'extraCommands':[],'removeCommands':[],'isSearchEnabled':!0x0});}}class Xa extends Nt{['resultResponseView'];['acceptButtonView'];['dismissButtonView'];['infoButtonView'];['outdatedButtonView'];constructor(_0x244b5e,_0x4d6022){super(_0x244b5e),this['id']=_0x4d6022,this['set']('status','pending'),this['set']('changeId',_0x4d6022),this['resultResponseView']=this['_createResultResponseView'](),this['acceptButtonView']=this['_createAcceptButtonView'](),this['dismissButtonView']=this['_createDismissButtonView'](),this['infoButtonView']=this['_createInfoButtonView'](),this['outdatedButtonView']=this['_createOutdatedButtonView'](),this['set']('isInfoToggleOn',!0x1),this['set']('isActive',!0x1),this['set']('showDiff',!0x0),this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-result',this['bindTemplate']['if']('isActive','ck-ai_review__check-run-result_active')]},'on':{'click':this['bindTemplate']['to']('click'),'mouseover':this['bindTemplate']['to']('mouseover'),'mouseout':this['bindTemplate']['to']('mouseout')},'children':[this['resultResponseView'],{'tag':'div','attributes':{'class':['ck-ai_review__check-run-result-footer']},'children':[{'tag':'div','attributes':{'class':['ck-ai_review__check-run-result-action-buttons']},'children':[this['acceptButtonView'],this['dismissButtonView'],this['outdatedButtonView']]},this['infoButtonView']]}]}),this['on']('click',(_0x39526c,_0x111596)=>{_0x111596&&_0x111596['target']&&'A'===_0x111596['target']['tagName']&&_0x111596['preventDefault'](),this['fire']('activateChange',{'id':_0x4d6022,'source':this,'uiInteraction':'click'});}),this['on']('mouseover',()=>{this['fire']('activateChange',{'id':_0x4d6022,'source':this,'uiInteraction':'hover'});}),this['on']('mouseout',()=>{this['fire']('deactivateChange',{'origin':'panel','id':_0x4d6022,'source':this});});}['setItemAsActive'](){this['isActive']=!0x0;}['setItemAsInactive'](){this['isActive']=!0x1;}['_createResultResponseView'](){const _0x4b2da0=new Nt(this['locale']);return _0x4b2da0['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content','ck-reset_all-excluded','ck-ai_review__check-run-result-response',this['bindTemplate']['if']('showDiff','ck-hidden',_0x4351c8=>!_0x4351c8)]}}),_0x4b2da0;}['_createAcceptButtonView'](){const _0x27a7c0=new kt(this['locale']);return _0x27a7c0['set']({'label':as(this['locale'],'AI_REVIEW_MODE_ACCEPT_CHANGE'),'withText':!0x0}),_0x27a7c0['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x329298=>{this['fire']('acceptChange',{'id':this['changeId']}),_0x329298['stopPropagation']();})},'attributes':{'class':[this['bindTemplate']['if']('status','ck-hidden',_0x3675f8=>'pending'!==_0x3675f8&&'accepted'!==_0x3675f8),this['bindTemplate']['if']('status',hs,_0x53e841=>'pending'===_0x53e841),this['bindTemplate']['if']('status',cs,_0x581263=>'pending'!==_0x581263),this['bindTemplate']['if']('status','ck-ai_review__check-run-result-status-button',_0x37cb6c=>'accepted'===_0x37cb6c)]}}),this['on']('change:status',(_0xe01715,_0x2630e9,_0x451fe5)=>{_0x27a7c0['isEnabled']='pending'===_0x451fe5,'accepted'===_0x451fe5&&(_0x27a7c0['label']=as(this['locale'],'AI_REVIEW_MODE_CHECK_STATUS_ACCEPTED'),_0x27a7c0['icon']=_0x4c3d0d);}),_0x27a7c0;}['_createDismissButtonView'](){const _0x355d4e=new kt(this['locale']);return _0x355d4e['set']({'label':as(this['locale'],'AI_REVIEW_MODE_DISMISS_CHANGE'),'withText':!0x0}),_0x355d4e['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x528499=>{this['fire']('dismissChange',{'id':this['changeId']}),_0x528499['stopPropagation']();})},'attributes':{'class':[cs,this['bindTemplate']['if']('status','ck-hidden',_0x17f88b=>'pending'!==_0x17f88b&&'rejected'!==_0x17f88b),this['bindTemplate']['if']('status','ck-ai_review__check-run-result-dismiss-button',_0x4fc3e1=>'pending'===_0x4fc3e1),this['bindTemplate']['if']('status','ck-ai_review__check-run-result-status-button',_0x5b035d=>'rejected'===_0x5b035d)]}}),this['on']('change:status',(_0x25aee9,_0x19d4fc,_0x4948b4)=>{_0x355d4e['isEnabled']='pending'===_0x4948b4,'rejected'===_0x4948b4&&(_0x355d4e['label']=as(this['locale'],'AI_REVIEW_MODE_CHECK_STATUS_REJECTED'),_0x355d4e['icon']=_0x52715b);}),_0x355d4e;}['_createInfoButtonView'](){const _0x358b6f=new kt(this['locale']);return _0x358b6f['set']({'label':as(this['locale'],'AI_REVIEW_MODE_LEARN_MORE'),'icon':_0x1ccb12,'tooltip':!0x0,'isToggleable':!0x0,'role':'menuitemcheckbox','class':cs+'\x20ck-ai_review__check-run-result-info-button\x20ck-hidden'}),_0x358b6f['bind']('isOn')['to'](this,'isInfoToggleOn',_0x5e4408=>_0x5e4408),_0x358b6f['on']('execute',()=>{this['isInfoToggleOn']=!this['isInfoToggleOn'];}),_0x358b6f;}['_createOutdatedButtonView'](){const _0x1b26ec=new kt(this['locale']);return _0x1b26ec['set']({'label':as(this['locale'],'AI_REVIEW_MODE_CHECK_STATUS_OUTDATED'),'icon':it,'withText':!0x0,'isEnabled':!0x1}),_0x1b26ec['extendTemplate']({'attributes':{'class':[cs,'ck-ai_review__check-run-result-status-button',this['bindTemplate']['if']('status','ck-hidden',_0x19d9a0=>'outdated'!==_0x19d9a0)],'disabled':'disabled'}}),_0x1b26ec;}}class za extends Qt{['resultItemView'];['_pinnedRectIndex']=void 0x0;['_pinnedTargetElement']=void 0x0;['_pinnedTargetChangeId']=void 0x0;constructor(_0x397a31,_0x5f191b){super(_0x397a31),this['set']({'isVisible':!0x1,'position':'arrow_se','class':null,'top':0x0,'left':0x0}),this['extendTemplate']({'tag':'div','attributes':{'class':['ck-reset'],'tabindex':'-1'}}),this['set']('isDiffActive',!0x1),this['content']['add'](this['_createContentView']()),_0x5f191b['add'](this);}['render'](){super['render'](),this['_setupClickOutsideHandler']();}['updateContent'](_0x78d645){this['resultItemView']['changeId']=_0x78d645['id'],this['resultItemView']['resultResponseView']['element']['innerHTML']=_0x78d645['contentDiffed'];}['showBalloon'](_0x48a105,_0x419580,_0x36dc25,_0x52423f,_0x1e6804,_0x3f6eb4){const _0x45e2b2=_0x419580();if(!_0x45e2b2)return;this['updateContent'](_0x48a105),this['show']();const _0xe31cbb=Array['from'](_0x45e2b2['getClientRects']())['reverse'](),_0x37fac7=this['_getPointedRectIndexFromEvent'](_0x36dc25,_0xe31cbb),_0x4b065f=_0xe31cbb[_0x37fac7??0x0];'click'===_0x52423f?(this['isDiffActive']=!0x0,this['pin']({'target':()=>this['_getBestRectPositionOnClick'](_0x419580(),_0x37fac7,_0x48a105['id'],_0x1e6804,_0x3f6eb4)||_0x4b065f})):'hover'===_0x52423f&&(this['isDiffActive']=!0x1,this['pin']({'target':()=>this['_getBestRectPositionOnHover'](_0x419580(),_0x37fac7,_0x48a105['id'])||_0x4b065f}));}['hideBalloon'](){this['hide'](),this['unpin'](),this['_pinnedRectIndex']=void 0x0,this['_pinnedTargetElement']=void 0x0,this['_pinnedTargetChangeId']=void 0x0;}['hideDiffInBalloon'](){this['resultItemView']['showDiff']=!0x1;}['showDiffInBalloon'](){this['resultItemView']['showDiff']=!0x0;}['deactivateChange'](){this['fire']('deactivateChange',{'origin':'balloon'});}['_setupClickOutsideHandler'](){Xt({'emitter':this,'activator':()=>this['isVisible'],'contextElements':()=>{const _0x4c7e00=[this['element']];return this['_pinnedTargetElement']&&_0x4c7e00['push'](this['_pinnedTargetElement']),_0x4c7e00;},'callback':()=>{this['hide'](),this['unpin'](),this['deactivateChange'](),this['_pinnedTargetElement']=void 0x0,this['_pinnedRectIndex']=void 0x0,this['_pinnedTargetChangeId']=void 0x0;}});}['_createContentView'](){const _0x13b31e=new Nt();return this['resultItemView']=new Xa(this['locale'],''),this['resultItemView']['resultResponseView']['extendTemplate']({'attributes':{'class':['ck-content']}}),this['resultItemView']['delegate']('acceptChange','dismissChange')['to'](this),_0x13b31e['setTemplate']({'tag':'div','attributes':{'class':['ck-reset','ck-ai_review-balloon-panel-suggestion',this['bindTemplate']['if']('isDiffActive','ck-ai_review-balloon-panel-suggestion_diff-active')]},'children':[{'tag':'p','attributes':{'class':['ck-ai_review__suggestion-text']},'children':[this['resultItemView']]}]}),_0x13b31e;}['_getBestRectPositionOnClick'](_0x38dbec,_0x398e6a,_0xa32cdf,_0x3dd4fa,_0x4229b1){if(!_0x38dbec)return null;const _0x5ae16e=this['position']['replace']('arrow_',''),_0xb0589=Array['from'](_0x38dbec['getClientRects']());let _0x2ccfd5,_0xb88ae0=_0xb0589['reverse']();return void 0x0!==_0x398e6a&&this['_isPinnedRectVisible'](_0xb88ae0[_0x398e6a],_0x3dd4fa,_0x4229b1)?(_0x2ccfd5=_0xb88ae0[_0x398e6a],this['_pinnedRectIndex']=_0x398e6a):this['_isPinnedRectVisible'](_0xb88ae0[0x0],_0x3dd4fa,_0x4229b1)&&void 0x0===_0x398e6a?_0x2ccfd5=_0xb88ae0[0x0]:(_0xb88ae0='s'==_0x5ae16e[0x0]?[..._0xb0589]['reverse']():_0xb0589,_0xb88ae0['forEach'](_0x591c23=>{this['_isPinnedRectVisible'](_0x591c23,_0x3dd4fa,_0x4229b1)&&(_0x2ccfd5=_0x591c23);})),this['_pinnedTargetChangeId']=_0xa32cdf,this['_pinnedTargetElement']=_0x38dbec,_0x2ccfd5||_0x38dbec['getBoundingClientRect']();}['_getBestRectPositionOnHover'](_0x3aa097,_0x57e579,_0x2f096c){if(!_0x3aa097)return null;const _0x292e6f=Array['from'](_0x3aa097['getClientRects']())['reverse']();if(void 0x0===this['_pinnedRectIndex']&&void 0x0!==_0x57e579&&this['_pinnedTargetChangeId']!==_0x2f096c)return this['_pinnedRectIndex']=_0x57e579,this['_pinnedTargetElement']=_0x3aa097,this['_pinnedTargetChangeId']=_0x2f096c,_0x292e6f[_0x57e579];if(void 0x0!==this['_pinnedRectIndex']&&this['_pinnedTargetChangeId']===_0x2f096c){if(_0x3aa097!==this['_pinnedTargetElement'])return Array['from'](this['_pinnedTargetElement']['getClientRects']())['reverse']()[this['_pinnedRectIndex']];return _0x292e6f[this['_pinnedRectIndex']];}return void 0x0!==_0x57e579&&this['_pinnedTargetChangeId']!==_0x2f096c?(this['_pinnedRectIndex']=_0x57e579,this['_pinnedTargetElement']=_0x3aa097,this['_pinnedTargetChangeId']=_0x2f096c,_0x292e6f[_0x57e579]):_0x3aa097['getBoundingClientRect']();}['_getPointedRectIndexFromEvent'](_0x5f9d7d,_0x28c83f){if(_0x5f9d7d)for(let _0x1da987=0x0;_0x1da987<_0x28c83f['length'];_0x1da987++){const _0x164e26=_0x28c83f[_0x1da987];if(_0x5f9d7d['clientX']>=_0x164e26['left']-0x3&&_0x5f9d7d['clientX']<=_0x164e26['right']+0x3&&_0x5f9d7d['clientY']>=_0x164e26['top']-0x3&&_0x5f9d7d['clientY']<=_0x164e26['bottom']+0x3)return _0x1da987;}}['_isPinnedRectVisible'](_0x49695a,_0x15f3f8,_0x4e93e0){const _0x479e96=new ut(_0x49695a),_0x3d7e35=_0x15f3f8||document['documentElement'],_0x5c1c55=_0x479e96['getIntersection'](bt(_0x4e93e0)),_0x28d15b=new ut(_0x3d7e35)['getIntersection'](_0x479e96);return!!(_0x5c1c55&&_0x28d15b&&_0x479e96['width']>0x0);}}const ja=['getReviewCheckList','runReviewCheck','abortReviewStream','toggleDiff','acceptAllChanges','leaveReviewCoreResultList','activateChange','deactivateChange','acceptChange','dismissChange','learnMore','finishReview','retryReview'];class Ja extends _0x1f4c78{['_mainView'];['_balloonSuggestionView'];['_bodyCollection'];static get['requires'](){return[ns];}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x119222){super(_0x119222),this['_bodyCollection']=new qt(this['context']['locale']),this['_bodyCollection']['attachToDom'](),this['_mainView']=this['createMainView'](),this['_mainView']['delegate'](...ja)['to'](this),this['_balloonSuggestionView']=new za(this['context']['locale'],this['_bodyCollection']),this['_balloonSuggestionView']['delegate']('acceptChange','dismissChange','deactivateChange')['to'](this);}['init'](){const _0x38daac=this['context']['plugins']['get']('AITabs');this['registerTab'](_0x38daac);}['destroy'](){this['_bodyCollection']['detachFromDom'](),super['destroy']();}['setAvailableChecks'](_0x5b21cb){if(!this['_mainView']['reviewCheckListView']['hasChecks']()){const _0x50d1e8=!this['context']['config']['get']('ai.models.showModelSelector');this['_mainView']['reviewCheckListView']['setChecks'](_0x5b21cb,_0x50d1e8);}this['_mainView']['showReviewCheckListView']();}['showReviewCheckList'](){this['fire']('getReviewCheckList');}['showCheckRunResults'](_0x19dae8){_0x19dae8&&('error-general'!==_0x19dae8['status']?'error-chunk'!==_0x19dae8['status']?this['_mainView']['showReviewCheckResultsView']():this['showChunkErrorView']():this['showGeneralResultsErrorView']());}['showCheckRunResult'](_0x4ac621){this['_mainView']['addCheckRunResult'](_0x4ac621);}['showGeneralResultsErrorView'](){this['_mainView']['showGeneralResultsErrorView']();}['showGeneralReviewCoreErrorView'](_0x29277f){this['_mainView']['showGeneralReviewCoreErrorView'](_0x29277f??as(this['context']['locale'],'AI_REVIEW_INITIALIZATION_ERROR_MESSAGE'));}['showChunkErrorView'](){this['_mainView']['showChunkErrorView']();}['setCheckResultTitle'](_0x1a8556,_0xb0dcb8){this['_mainView']['reviewCheckResultsView']['setTitle'](_0x1a8556,_0xb0dcb8);}['setActiveStateInResults'](_0x3eb09c){this['_mainView']['reviewCheckResultsView']['getResults']()['forEach'](_0x452877=>{_0x452877['id']===_0x3eb09c&&_0x452877['setItemAsActive']();});}['resetActiveStateInResults'](){this['_mainView']['reviewCheckResultsView']['getResults']()['forEach'](_0x16d01a=>_0x16d01a['setItemAsInactive']());}['updateChangeState'](_0x4d7e46,_0x4cc9b1){'accepted'===_0x4cc9b1||'rejected'===_0x4cc9b1||'outdated'===_0x4cc9b1?this['_mainView']['reviewCheckResultsView']['hideResult'](_0x4d7e46,_0x4cc9b1):this['_mainView']['reviewCheckResultsView']['showResult'](_0x4d7e46,_0x4cc9b1);}['showReviewCompletedView'](){this['_mainView']['showReviewCompletedView']();}['showActionsWhenResultIsReady'](){this['_mainView']['showActionsWhenResultIsReady']();}['showNoChangesView'](){this['_mainView']['showNoChangesView']();}['hideActionsWhenResultIsReady'](){this['_mainView']['hideActionsWhenResultIsReady']();}['showChangeBalloon'](_0x2d11f9,_0x17b38d,_0x43bf0a,_0x363500,_0x2e76eb,_0x5ea520){this['_balloonSuggestionView']['showBalloon'](_0x2d11f9,_0x17b38d,_0x43bf0a,_0x363500,_0x2e76eb,_0x5ea520);}['hideChangeBalloon'](){this['_balloonSuggestionView']['hideBalloon']();}['hideDiffInBalloon'](){this['_balloonSuggestionView']['hideDiffInBalloon']();}['showDiffInBalloon'](){this['_balloonSuggestionView']['showDiffInBalloon']();}['getChangeElement'](_0x8dc412){const _0x36a103=this['_mainView']['reviewCheckResultsView']['getResults']()['find'](_0x438720=>_0x438720['id']===_0x8dc412);return _0x36a103?_0x36a103['element']:null;}['deactivateChange'](){this['_balloonSuggestionView']['deactivateChange']();}}class Za extends Nt{constructor(_0x14adee){super(_0x14adee),this['set']('isVisible',!0x1),this['set']('errorMessage','');const _0x4ca3ee=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai_review__general-error-container',_0x4ca3ee['if']('isVisible','ck-hidden',_0x24c4da=>!_0x24c4da)]},'children':[{'tag':'p','attributes':{'class':'ck\x20ck-ai-notification\x20ck-ai-notification_error'},'children':[{'text':_0x4ca3ee['to']('errorMessage')}]}]});}}class to extends Nt{['reviewCoreHeader'];['generalErrorView'];['reviewCheckListView'];['reviewCheckResultsView'];['reviewCompletedView'];constructor(_0x470b14,_0x2740f9){super(_0x470b14),this['reviewCoreHeader']=_0x2740f9['header'],this['generalErrorView']=new Za(_0x470b14),this['reviewCheckListView']=_0x2740f9['list'],this['reviewCheckListView']['delegate'](...ja)['to'](this),this['reviewCheckResultsView']=_0x2740f9['results'],this['reviewCheckResultsView']['delegate'](...ja)['to'](this),this['reviewCompletedView']=_0x2740f9['completed'],this['reviewCompletedView']['delegate']('finishReview')['to'](this),this['reviewCheckListView']['set']('isVisible',!0x1),this['reviewCheckResultsView']['set']('isVisible',!0x1),this['reviewCheckResultsView']['set']('isLoading',!0x1),this['reviewCheckResultsView']['set']('isResultReady',!0x1),this['reviewCompletedView']['set']('isVisible',!0x1),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-ai-review','ck-rounded-corners'],'dir':'ltr'},'children':[this['reviewCoreHeader'],this['generalErrorView'],this['reviewCheckListView'],this['reviewCheckResultsView'],this['reviewCompletedView']]});}['showReviewCheckListView'](){this['reviewCheckListView']['resetAllParameterizedChecks'](),this['reviewCheckListView']['set']('isVisible',!0x0),this['reviewCheckResultsView']['set']('isVisible',!0x1),this['reviewCompletedView']['set']('isVisible',!0x1);}['showReviewCheckResultsView'](){this['hideActionsWhenResultIsReady'](),this['reviewCheckResultsView']['resetErrorState'](),this['reviewCheckListView']['set']('isVisible',!0x1),this['reviewCheckResultsView']['set']('isVisible',!0x0),this['reviewCheckResultsView']['clearResults'](),this['reviewCheckResultsView']['set']('isLoading',!0x0),this['reviewCheckResultsView']['set']('isCompleted',!0x1);}['addCheckRunResult'](_0x3e23c7){this['reviewCheckResultsView']['addResult'](_0x3e23c7),this['reviewCheckResultsView']['set']('isLoading',!0x1);}['showReviewCompletedView'](){this['reviewCheckResultsView']['set']('isVisible',!0x0),this['reviewCompletedView']['set']('isVisible',!0x1),this['reviewCheckResultsView']['set']('isCompleted',!0x0),this['reviewCheckListView']['set']('isVisible',!0x1);}['showActionsWhenResultIsReady'](){this['reviewCheckResultsView']['isResultReady']?(this['reviewCheckListView']['set']('isVisible',!0x1),this['reviewCheckResultsView']['set']('isVisible',!0x0),this['reviewCompletedView']['set']('isVisible',!0x1)):this['reviewCheckResultsView']['isResultReady']=!0x0;}['showNoChangesView'](){this['reviewCheckListView']['set']('isVisible',!0x1),this['reviewCheckResultsView']['set']('isVisible',!0x1),this['reviewCompletedView']['set']('isVisible',!0x0);}['hideActionsWhenResultIsReady'](){this['reviewCheckResultsView']['isResultReady']=!0x1;}['showGeneralReviewCoreErrorView'](_0x375ff2){this['generalErrorView']['set']('isVisible',!0x0),this['generalErrorView']['errorMessage']=_0x375ff2;}['showGeneralResultsErrorView'](){this['reviewCheckResultsView']['set']('isLoading',!0x1),this['showActionsWhenResultIsReady'](),this['reviewCheckResultsView']['showGeneralErrorMessage']();}['showChunkErrorView'](){this['reviewCheckResultsView']['set']('isLoading',!0x1),this['showActionsWhenResultIsReady'](),this['reviewCheckResultsView']['showChunkErrorMessage']();}}class eo extends kt{constructor(_0x2d7347,_0x3f7ccc){super(_0x3f7ccc),this['set']({'label':_0x2d7347,'withText':!0x0,'class':os}),this['on']('execute',()=>{this['fire']('finishReview');});}}class io extends Pt{['_resultViews'];['_resultsHeader'];['reviewDisclaimer'];['_cancelButtonView'];['_acceptAllButtonView'];['_exitReviewButtonView'];['_toggleDiffButtonView'];['_errorMessageView'];['_finishReviewButtonView'];['_contents'];constructor(_0x1d58f6,_0x2f3a14){super(_0x1d58f6),this['_contents']=_0x2f3a14,this['_resultViews']=new _0x553410(),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 jr(_0x1d58f6),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 _0x149159=this['_createCombinedSkeletonLoader'](),_0x4f7137=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run',_0x4f7137['if']('isLoading','ck-ai_review__check-run_loading',_0x6a8872=>_0x6a8872),_0x4f7137['if']('isResultReady','ck-ai_review__check-run_ready',_0x38c6ff=>_0x38c6ff),_0x4f7137['if']('isVisible','ck-hidden',_0x449179=>!_0x449179)]},'children':[this['_resultsHeader'],{'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-wrapper']},'children':[this['_errorMessageView'],{'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-container','ck-reset_all-excluded',this['bindTemplate']['if']('isLoading','ck-hidden',_0x4011d1=>_0x4011d1)]},'children':this['_resultViews']},_0x149159]},this['reviewDisclaimer']]});}['clearResults'](){this['_resultViews']['clear']();}['getResults'](){return this['_resultViews'];}['addResult'](_0x2de87a){const _0x12863a=new Xa(this['locale'],_0x2de87a['id']);_0x12863a['delegate']('acceptChange','dismissChange','activateChange','deactivateChange')['to'](this),this['_resultViews']['add'](_0x12863a),_0x12863a['resultResponseView']['element']['innerHTML']=_0x2de87a['contentDiffed'];}['hideResult'](_0x3c7885,_0x21c5f0){if('pending'===_0x21c5f0)return;const _0x242ffe=this['_resultViews']['find'](_0x203287=>_0x203287['id']===_0x3c7885);_0x242ffe&&(_0x242ffe['status']=_0x21c5f0,_0x242ffe['element']?.['classList']['add']('ck-ai_review__check-run-result_grayout'));}['showResult'](_0xf40c90,_0x47b6d3){if('pending'!==_0x47b6d3)return;const _0x25dde3=this['_resultViews']['find'](_0x520dca=>_0x520dca['id']===_0xf40c90);_0x25dde3&&(_0x25dde3['status']=_0x47b6d3,_0x25dde3['element']?.['classList']['remove']('ck-ai_review__check-run-result_grayout'));}['setTitle'](_0x4427d8,_0x16632a){this['headerTitle']=_0x4427d8,this['headerSubtitle']=_0x16632a||'';}['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 zn(this['locale'],jn['aiReviewChecks']);}['_createCombinedSkeletonLoader'](){const _0x4e92ca=new Nt(this['locale']),_0x22396d=[];for(let _0xbd7e84=0x0;_0xbd7e84<0x10;_0xbd7e84++){const _0x39d53c=this['_createSkeletonLoader']();_0x39d53c['extendTemplate']({'attributes':{'class':['ck-ai_review__check-run-skeleton-item']}}),_0x22396d['push'](_0x39d53c);}return _0x4e92ca['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-skeleton-container',this['bindTemplate']['if']('isLoading','ck-hidden',_0x587196=>!_0x587196)]},'children':_0x22396d}),_0x4e92ca;}['_createErrorView'](){const _0x2431ca=new Nt(this['locale']),_0x3090f2=new kt(this['locale']),t=this['locale']['t'];return _0x2431ca['delegate']('retryReview')['to'](this),_0x3090f2['set']({'label':t('Try\x20again'),'withText':!0x0,'class':hs+'\x20ck-ai_review__check-run-error-retry-button'}),_0x3090f2['on']('execute',()=>{this['fire']('retryReview');}),_0x2431ca['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-error-container',this['bindTemplate']['if']('showErrorMessage','ck-hidden',_0x271643=>!_0x271643),this['bindTemplate']['if']('errorType','ck-ai_review__check-run-error-container_border-bottom',_0x46374a=>'chunk'===_0x46374a)]},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-notification','ck-ai-notification_error','ck-ai-notification__full-width','ck-ai_review__check-run-error-message',this['bindTemplate']['if']('errorType','ck-ai-notification_warning',_0x3fcb63=>'chunk'===_0x3fcb63)]},'children':[{'tag':'p','attributes':{'class':['ck-ai-notification__content',this['bindTemplate']['if']('errorType','ck-hidden',_0x47f826=>'general'!==_0x47f826)]},'children':[{'text':this['_contents']['generalErrorText']}]},{'tag':'p','attributes':{'class':['ck-ai-notification__content',this['bindTemplate']['if']('errorType','ck-hidden',_0x18b42e=>'chunk'!==_0x18b42e)]},'children':[{'text':as(this['locale'],'AI_REVIEW_MODE_CHUNK_ERROR_MESSAGE')}]}]},_0x3090f2]}),_0x2431ca;}['_createCancelButtonView'](){const _0x458374=new kt(this['locale']);return _0x458374['set']({'label':as(this['locale'],'AI_REVIEW_MODE_STOP_GENERATING'),'withText':!0x0,'class':[hs+'\x20ck-ai-button-stop-generating'],'icon':_0x48b0d7}),_0x458374['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isResultReady','ck-hidden',_0x7783e5=>_0x7783e5),this['bindTemplate']['if']('isCompleted','ck-hidden',_0xfcf60=>_0xfcf60)]}}),_0x458374['on']('execute',()=>{this['fire']('abortReviewStream');}),_0x458374;}['_createToggleDiffButtonView'](){const _0x4d5886=new kt(this['locale']);_0x4d5886['set']({'tooltip':!0x0,'isToggleable':!0x0,'role':'menuitemcheckbox'}),_0x4d5886['bind']('isEnabled')['to'](this,'isError',_0x146b91=>!_0x146b91),_0x4d5886['extendTemplate']({'attributes':{'class':[hs,'ck-ai_review__check-run-toggle-diff-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0x2bc741=>!_0x2bc741),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x1c3b33=>_0x1c3b33)]}});const _0x219e3c=as(this['locale'],'AI_REVIEW_MODE_HIDE_CHANGES'),_0x3f4bea=as(this['locale'],'AI_REVIEW_MODE_SHOW_CHANGES');return _0x4d5886['bind']('isOn')['to'](this,'isToggleDiffOn',_0x474a11=>_0x474a11),_0x4d5886['bind']('icon')['to'](this,'isToggleDiffOn',_0x6725ad=>_0x6725ad?st:nt),_0x4d5886['bind']('label')['to'](this,'isToggleDiffOn',_0x1b4c57=>_0x1b4c57?_0x219e3c:_0x3f4bea),_0x4d5886['on']('execute',()=>{this['isToggleDiffOn']=!this['isToggleDiffOn'],this['fire']('toggleDiff',{'on':this['isToggleDiffOn']});}),_0x4d5886;}['_createAcceptAllButtonView'](){const _0x439da7=new kt(this['locale']);return _0x439da7['set']({'label':as(this['locale'],'AI_REVIEW_MODE_ACCEPT_ALL'),'withText':!0x0}),_0x439da7['bind']('isEnabled')['to'](this,'isError',_0x2d3e3c=>!_0x2d3e3c),_0x439da7['extendTemplate']({'attributes':{'class':[os,'ck-ai_review__check-run-accept-all-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0x121840=>!_0x121840),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x3cb07f=>_0x3cb07f)]}}),_0x439da7['on']('execute',()=>{this['fire']('acceptAllChanges');}),_0x439da7;}['_createExitReviewButtonView'](){const _0x171867=new kt(this['locale']);return _0x171867['set']({'label':as(this['locale'],'AI_REVIEW_MODE_EXIT_REVIEW'),'withText':!0x0}),_0x171867['extendTemplate']({'attributes':{'class':[cs,'ck-ai_review__check-run-exit-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0x1cd491=>!_0x1cd491),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x1e780f=>_0x1e780f)]}}),_0x171867['on']('execute',()=>{this['fire']('leaveReviewCoreResultList');}),_0x171867;}['_createResultHeaderView'](){const _0x110696=new Nt(this['locale']),_0x5f0126=this['_createTitleView']();return _0x110696['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-header',this['bindTemplate']['if']('isCompleted','ck-ai_review__review-completed-header',_0x20935d=>_0x20935d)]},'children':[_0x5f0126,{'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-header-buttons']},'children':[this['_cancelButtonView'],this['_acceptAllButtonView'],this['_exitReviewButtonView'],this['_toggleDiffButtonView'],this['_finishReviewButtonView']]}]}),_0x110696;}['_createTitleView'](){const _0x457322=new Nt(this['locale']),_0x57e1c5=new fn();return _0x57e1c5['bind']('isVisible')['to'](this,'isResultReady',_0x2a8347=>!_0x2a8347),_0x457322['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-header-title-wrapper']},'children':[_0x57e1c5,{'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-header-title-content',this['bindTemplate']['if']('isCompleted','ck-hidden',_0x5a6d37=>_0x5a6d37)]},'children':[{'tag':'span','attributes':{'class':['ck-ai_review__check-run-results-header-title']},'children':[{'text':this['bindTemplate']['to']('headerTitle')}]},{'tag':'span','attributes':{'class':['ck-ai_review__check-run-results-header-subtitle']},'children':[{'text':this['bindTemplate']['to']('headerSubtitle')}]}]},{'tag':'span','attributes':{'class':['ck-ai_review__review-completed-header-title',this['bindTemplate']['if']('isCompleted','ck-hidden',_0x3abb2f=>!_0x3abb2f)]},'children':[{'text':as(this['locale'],'AI_REVIEW_MODE_FINISH_REVIEW_HEADER_TITLE')}]}]}),_0x457322;}['_createFinishReviewButtonView'](){const _0x3a9b2c=new eo(as(this['locale'],'AI_REVIEW_MODE_FINISH_REVIEW_BUTTON_LABEL'),this['locale']);return _0x3a9b2c['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isCompleted','ck-hidden',_0x1269a1=>!_0x1269a1)]}}),_0x3a9b2c['delegate']('finishReview')['to'](this),_0x3a9b2c;}}class so extends Pt{['_resultsHeader'];['_finishReviewButtonView'];constructor(_0x357985,_0x6d80f2){super(_0x357985),this['_finishReviewButtonView']=this['_createFinishReviewButtonView'](_0x6d80f2['buttonText']),this['_resultsHeader']=this['_createResultHeaderView'](_0x6d80f2['headerText']);const _0x372458=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__review-completed',_0x372458['if']('isVisible','ck-hidden',_0x27db4a=>!_0x27db4a)]},'children':[this['_resultsHeader'],{'tag':'div','attributes':{'class':['ck-ai_review__review-completed-content']},'children':[{'tag':'span','attributes':{'class':['ck-ai_review__review-completed-content-icon']},'children':[{'text':'👍'}]},{'tag':'p','attributes':{'class':['ck-ai_review__review-completed-content-text']},'children':[{'text':_0x6d80f2['emptyResultsText']}]}]}]});}['_createFinishReviewButtonView'](_0x323f1d){const _0x39c812=new eo(_0x323f1d,this['locale']);return _0x39c812['delegate']('finishReview')['to'](this),_0x39c812;}['_createResultHeaderView'](_0x25300b){const _0x296857=new Nt(this['locale']);return _0x296857['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__review-completed-header']},'children':[{'tag':'span','attributes':{'class':['ck-ai_review__review-completed-header-title']},'children':[{'text':_0x25300b}]},{'tag':'div','attributes':{'class':['ck-ai_review__review-completed-header-buttons']},'children':[this['_finishReviewButtonView']]}]}),_0x296857;}}class no extends Nt{['_dropdownView'];['_defaultValue'];['_defaultLabel'];constructor(_0x2d7307,_0x5c35a8){super(_0x2d7307),this['_defaultValue']=_0x5c35a8['default']||(_0x5c35a8['data']['length']>0x0?_0x5c35a8['data'][0x0]['id']:''),this['_defaultLabel']=_0x5c35a8['data']['find'](_0x441f40=>_0x441f40['id']===this['_defaultValue'])?.['label']||'',this['set']('formValue',''),this['_dropdownView']=Bt(this['locale']);const _0x3facf7=this['_prepareListOptions'](_0x5c35a8['data']);zt(this['_dropdownView'],_0x3facf7,{'role':'menu','ariaLabel':_0x5c35a8['label']}),this['_dropdownView']['buttonView']['set']({'label':this['_defaultLabel'],'withText':!0x0}),this['_dropdownView']['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x5ad003=>{_0x5ad003['stopPropagation']();})}}),this['listenTo'](this['_dropdownView'],'execute',_0x2a29c2=>{this['formValue']=_0x2a29c2['source']['model']['id'],this['_dropdownView']['buttonView']['label']=_0x2a29c2['source']['model']['label'];}),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-ai_review__check-list-item-parameterized-form-element','ck-ai_review__check-list-item-parameterized-form-element_dropdown']},'children':[this['_dropdownView']]});}['resetToDefault'](){this['formValue']=this['_defaultValue'],this['_dropdownView']['buttonView']['label']=this['_defaultLabel'];}['_prepareListOptions'](_0x285981=[]){const _0x4b66a6=new dt();this['resetToDefault']();for(const _0xad2f15 of _0x285981){const _0x1f4a7b=new jt({'label':_0xad2f15['label'],'withText':!0x0,'role':'menuitemradio','id':_0xad2f15['id'],'model':_0xad2f15});_0x1f4a7b['bind']('isOn')['to'](this,'formValue',_0x538ef8=>_0x538ef8===_0x1f4a7b['id']);const _0x3c04c9={'type':'button','model':_0x1f4a7b};_0x4b66a6['add'](_0x3c04c9);}return _0x4b66a6;}}class ro extends Pt{['_formItem']=null;constructor(_0x43b062,_0x580610,_0x1aa17d){super(_0x43b062),this['argsKey']=_0x580610?.['argsKey'];if('dropdown'===_0x580610['formType'])this['_formItem']=new no(this['locale'],_0x580610);this['set']('value',''),this['bind']('value')['to'](this['_formItem'],'formValue');const _0x2937d2=new _0x1325bb(this['locale'],{'children':[this['_formItem']],'class':[_0x1aa17d?'ck-form__row_with-submit':'']});_0x1aa17d&&_0x2937d2['children']['add'](_0x1aa17d),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai_review__form-item','ck-reset_all']},'children':[_0x2937d2]});}['resetToDefault'](){this['_formItem']['resetToDefault']();}}class ao extends _0x4dcc48{['keystrokes'];static ['MIN_ROWS']=0x1;static ['MAX_ROWS']=0xc;constructor(_0x4b292b){super(_0x4b292b),this['set']('isEmpty',!0x0),this['keystrokes']=new At(),this['minRows']=ao['MIN_ROWS'],this['maxRows']=ao['MAX_ROWS'],this['extendTemplate']({'attributes':{'id':'ai-review-prompt-input','class':['ck','ck-review__prompt-input']}});}['render'](){super['render'](),this['on']('update',()=>{this['isEmpty']=''===this['element']['value']?.['trim']();}),this['keystrokes']['listenTo'](this['element']);}}class oo extends Nt{['focusTracker']=new _t();['keystrokes']=new At();['focusCycler'];['_focusables']=new _0x553410();['submitButtonView'];['cancelButtonView'];['promptInputView'];['actionsFooterView'];['_modelSelectionDropdown'];['_modelNameView'];['_modelSelectionDropdownItems'];['_check'];['_defaultValue'];['_defaultLabel'];constructor(_0x5004fd,_0x2ccef7,_0x3be644=!0x1){super(_0x5004fd),this['_check']=_0x2ccef7,this['set']('prompt',''),this['set']('modelId',''),this['set']('modelDisplayMode','selector'),this['set']('activeModelName',null),this['_defaultValue']=_0x2ccef7['defaultModel']?_0x2ccef7['defaultModel']['id']:'',this['_defaultLabel']=_0x2ccef7['defaultModel']?_0x2ccef7['defaultModel']['name']:'',this['submitButtonView']=this['_createSubmitButtonView'](),this['cancelButtonView']=this['_createCancelButtonView'](),(this['promptInputView']=new Zt(this['locale'],()=>new ao(_0x5004fd)),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 dt(),this['_modelNameView']=this['_createModelNameView'](),this['_setModelList'](_0x3be644),zt(this['_modelSelectionDropdown'],this['_modelSelectionDropdownItems']),this['actionsFooterView']=this['_createActionsFooterView'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-custom-actions']},'children':[new _0x1325bb(this['locale'],{'children':[this['promptInputView']]}),new _0x1325bb(this['locale'],{'children':[this['actionsFooterView']]})]}),this['promptInputView']['fieldView']['keystrokes']['set']('Enter',(_0x5e25e6,_0x4e01a5)=>{this['_isValid']()?(this['fire']('runReviewCheck',{'id':'custom','args':{'prompt':this['prompt'],'model':this['modelId']},'isCustom':!0x0}),_0x4e01a5()):_0x4e01a5();}),this['focusCycler']=new Mt({'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'](_0xccaee5=>{this['_focusables']['add'](_0xccaee5),this['focusTracker']['add'](_0xccaee5['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 _0x5ed766 of this['_getFormValidators']()){const _0x26199b=_0x5ed766();if(_0x26199b)return this['promptInputView']['errorText']=_0x26199b,!0x1;}return!0x0;}['_getFormValidators'](){return[()=>{if(0x0===this['promptInputView']['fieldView']['value']?.['trim']()['length'])return as(this['locale'],'AI_REVIEW_MODE_PROMPT_EMPTY_ERROR');}];}['_createSubmitButtonView'](){const _0x2030c8=new kt(this['locale']),t=this['locale']['t'];return _0x2030c8['set']({'label':t('Submit'),'withText':!0x0,'class':os}),_0x2030c8['on']('execute',()=>{this['_isValid']()&&this['fire']('runReviewCheck',{'id':'custom','args':{'prompt':this['prompt'],'model':this['modelId']},'isCustom':!0x0});}),_0x2030c8;}['_createCancelButtonView'](){const _0x4edfe0=new kt(this['locale']),t=this['locale']['t'];return _0x4edfe0['set']({'label':t('Cancel'),'withText':!0x0,'class':cs}),_0x4edfe0['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x350aa9=>{_0x350aa9['stopPropagation']();})}}),_0x4edfe0['on']('execute',()=>{this['resetToDefault'](),this['fire']('closeCustomCheck');}),_0x4edfe0;}['_setModelList'](_0x2e5296){this['_modelSelectionDropdownItems']['clear']();const _0x1c9c1b=this['_check']['models'];if(_0x2e5296)this['set']('modelDisplayMode','hidden');else{const _0xa089f4=0x1===_0x1c9c1b['length'];this['set']('modelDisplayMode',_0xa089f4?'name':'selector');}if(this['resetToDefault'](),_0x1c9c1b?.['length']){0x1===_0x1c9c1b['length']&&this['set']('activeModelName',_0x1c9c1b[0x0]['name']||_0x1c9c1b[0x0]['id']);for(const _0x2fa477 of _0x1c9c1b){const _0xa8e46c=new jt({'label':_0x2fa477['name'],'withText':!0x0,'role':'menuitemradio','id':_0x2fa477['id'],'model':_0x2fa477});_0xa8e46c['bind']('isOn')['to'](this,'modelId',_0x2251f7=>_0x2251f7===_0x2fa477['id']),this['_modelSelectionDropdownItems']['add']({'type':'button','model':_0xa8e46c,'labelView':new co(this['locale'],_0x2fa477)});}}}['_createModelSelectionDropdown'](){const _0x1a2893=Bt(this['locale']);return _0x1a2893['set']({'panelPosition':'se','class':'ck-ai_review__check-list-item-model-dropdown'}),_0x1a2893['buttonView']['set']({'label':this['_defaultLabel'],'withText':!0x0,'tooltip':!0x0,'class':cs}),_0x1a2893['buttonView']['bind']('isVisible')['to'](this,'modelDisplayMode',_0x3cd3a5=>'selector'===_0x3cd3a5),this['listenTo'](_0x1a2893,'execute',_0x13a728=>{this['modelId']=_0x13a728['source']['model']['id'],_0x1a2893['buttonView']['label']=_0x13a728['source']['label'];}),_0x1a2893;}['_createModelNameView'](){const _0x436a88=new ho(this['locale']);return _0x436a88['bind']('text')['to'](this,'activeModelName',_0x4f5a61=>_0x4f5a61??''),_0x436a88['bind']('isVisible')['to'](this,'modelDisplayMode',_0x5023f5=>'name'===_0x5023f5),_0x436a88;}['_createActionsFooterView'](){const _0x6d7889=new Nt(this['locale']);return _0x6d7889['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-custom-actions-footer']},'children':[this['_modelSelectionDropdown'],this['_modelNameView'],{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-parameterized-custom-actions-buttons']},'children':[this['cancelButtonView'],this['submitButtonView']]}]}),_0x6d7889;}}class ho extends Nt{constructor(_0x1186bd){super(_0x1186bd),this['set']('text',void 0x0),this['set']('isVisible',!0x0);const _0x514bc7=this['bindTemplate'];this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai_review__check-list-item-model-name',_0x514bc7['if']('isVisible','ck-hidden',_0x3cf054=>!_0x3cf054)]},'children':[{'text':_0x514bc7['to']('text')}]});}}class co extends Ht{constructor(_0x455154,_0x2389c5){super();const _0x57e0a5=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-button__label'],'style':_0x57e0a5['to']('style'),'id':_0x57e0a5['to']('id')},'children':[{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-model-dropdown-name']},'children':[{'tag':'span','children':[{'text':_0x57e0a5['to']('text')}]}]},{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-model-dropdown-description']},'children':[{'tag':'span','children':[_0x2389c5['description']||'']}]}]});}}class lo extends Pt{['_formItemsCollection']=new _0x553410();['_customCheckView']=null;['_hideModels']=!0x1;constructor(_0x38b5fe,_0x857e1,_0x2a7ea3,_0xd712e7=!0x1){super(_0x38b5fe),this['_hideModels']=_0xd712e7,this['set']('isParametrizedViewOpen',!0x1),this['set']('isListItemRendered',!0x1),this['set']('isItemParametrized',_0x857e1['isParameterized']);const _0x3e9f7c=this['_createIconView']();this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list-item',this['bindTemplate']['if']('isParametrizedViewOpen','ck-ai_review__check-list-item_selected',_0x3e3280=>_0x3e3280),this['bindTemplate']['if']('isListItemRendered','ck-ai_review__check-list-item_rendered',_0xe6c031=>_0xe6c031)],'style':{'--ck-ai-review-check-list-item-index':_0x2a7ea3}},'on':{'click':this['bindTemplate']['to']('click')},'children':[{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-content']},'children':[{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-main-content']},'children':[{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-title']},'children':[{'tag':'span','attributes':{'class':['ck-ai_review__check-list-item-title-text']},'children':[{'text':_0x857e1['title']}]},_0x3e9f7c]},{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-description']},'children':_0x857e1['description']?[{'text':_0x857e1['description']}]:[]}]}]},..._0x857e1['isParameterized']?[this['_createParameterizedView'](_0x857e1)]:[],...'custom'===_0x857e1['id']?[this['_createCustomView'](_0x857e1,this['_hideModels'])]:[]]}),this['on']('click',()=>{_0x857e1['isParameterized']?this['isParametrizedViewOpen']=!0x0:this['fire']('runReviewCheck',{'id':_0x857e1['id'],'args':_0x857e1['useArgs']?_0x857e1['args']:void 0x0});}),requestAnimationFrame(()=>{this['isListItemRendered']=!0x0;});}['render'](){super['render'](),this['isItemParametrized']&&Xt({'emitter':this,'activator':()=>!0x0===this['isParametrizedViewOpen'],'contextElements':[this['element']],'callback':()=>{this['isParametrizedViewOpen']=!0x1;}});}['resetToDefault'](){this['isParametrizedViewOpen']=!0x1,this['_formItemsCollection']['forEach'](_0x31d164=>{_0x31d164['resetToDefault']();}),this['_customCheckView']&&this['_customCheckView']['resetToDefault']();}['_createIconView'](){const _0x43509c=new yt();return _0x43509c['content']=rt,_0x43509c['extendTemplate']({'attributes':{'class':['ck-ai_review__check-list-item-title-icon']}}),_0x43509c;}['_createParameterizedView'](_0x44d7f0){const _0xa57cda=new Nt(),_0x217065=this['_createFormView'](_0x44d7f0);return _0xa57cda['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-parameterized',this['bindTemplate']['if']('isParametrizedViewOpen','ck-hidden',_0x24153c=>!_0x24153c)]},'children':[_0x217065]}),_0xa57cda;}['_createFormView'](_0x17bb03){const _0x2448be=new Nt(),_0x4baac5=Array['isArray'](_0x17bb03['options'])?_0x17bb03['options']:[],_0x25e1aa=new kt(this['locale']),t=this['locale']['t'];_0x25e1aa['set']({'label':t('Submit'),'withText':!0x0,'class':os}),_0x25e1aa['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x2b6bd3=>{_0x2b6bd3['stopPropagation']();})}}),_0x25e1aa['on']('execute',()=>{const _0x5f168c=[],_0x173ca1={};this['_formItemsCollection']['forEach'](_0x5a149b=>{_0x5f168c['push'](_0x5a149b['value']),_0x17bb03['useArgs']&&_0x17bb03['options']&&(_0x173ca1[_0x5a149b['argsKey']]=_0x5a149b['value']);}),this['fire']('runReviewCheck',{'id':_0x17bb03['id'],'params':_0x5f168c['length']?_0x5f168c:void 0x0,'args':Object['keys'](_0x173ca1)['length']?_0x173ca1:void 0x0});});const _0x454b73=_0x4baac5['length'];return _0x4baac5['forEach']((_0x28489f,_0x2e719b)=>{const _0x41f7e4=_0x2e719b===_0x454b73-0x1;this['_formItemsCollection']['add'](new ro(this['locale'],_0x28489f,_0x41f7e4?_0x25e1aa:null));}),_0x2448be['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-parameterized-form']},'children':this['_formItemsCollection']}),_0x2448be;}['_createCustomView'](_0x52ce1b,_0xd44228=!0x1){return this['_customCheckView']=new oo(this['locale'],_0x52ce1b,_0xd44228),this['_customCheckView']['extendTemplate']({'attributes':{'class':['ck-ai_review__check-list-item-parameterized','ck-ai_review__check-list-item-parameterized_custom',this['bindTemplate']['if']('isParametrizedViewOpen','ck-hidden',_0x109f06=>!_0x109f06)]}}),this['_customCheckView']['delegate']('runReviewCheck')['to'](this),this['listenTo'](this['_customCheckView'],'closeCustomCheck',()=>{this['isParametrizedViewOpen']=!0x1;}),this['on']('change:isParametrizedViewOpen',(_0x63d6ac,_0x50f849,_0x9c906c)=>{_0x9c906c||this['_customCheckView']['resetFormValidationStatus']();}),this['_customCheckView'];}}class uo extends Pt{['_checkViews'];constructor(_0x169d7e){super(_0x169d7e),this['_checkViews']=new _0x553410(),this['_setupTemplate']();}['setChecks'](_0x3b5181,_0x4e8a19=!0x1){this['_checkViews']['clear']();for(const [_0x19a04e,_0x445fe5]of _0x3b5181['entries']()){const _0x102838=new lo(this['locale'],_0x445fe5,_0x19a04e,_0x4e8a19);_0x102838['delegate']('runReviewCheck')['to'](this),this['_checkViews']['add'](_0x102838);}}['hasChecks'](){return this['_checkViews']['length']>0x0;}['resetAllParameterizedChecks'](){for(const _0x2129cc of this['_checkViews'])_0x2129cc instanceof lo&&_0x2129cc['resetToDefault']();}['_setupTemplate'](){const _0x2e06ee=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list',_0x2e06ee['if']('isVisible','ck-hidden',_0x4a2957=>!_0x4a2957)]},'children':this['_checkViews']});}}class _o extends Ja{static get['pluginName'](){return'AIReviewModeUI';}['createMainView'](){const _0x5a7c2e=this['context']['locale'],_0x4ce433=new _0x2229a9(_0x5a7c2e,{'label':as(_0x5a7c2e,'AI_REVIEW_MODE'),'icon':_0x458073,'class':'ck-ai-header\x20ck-ai-header_review'});return new to(this['context']['locale'],{'header':_0x4ce433,'list':new uo(_0x5a7c2e),'results':new io(_0x5a7c2e,{'generalErrorText':as(_0x5a7c2e,'AI_REVIEW_MODE_GENERAL_ERROR_MESSAGE')}),'completed':new so(_0x5a7c2e,{'headerText':as(_0x5a7c2e,'AI_REVIEW_MODE_FINISH_REVIEW_HEADER_TITLE'),'emptyResultsText':as(_0x5a7c2e,'AI_REVIEW_MODE_EMPTY_RESULTS_TEXT'),'buttonText':as(_0x5a7c2e,'AI_REVIEW_MODE_FINISH_REVIEW_BUTTON_LABEL')})});}['registerTab'](){const _0x2ef73f=this['context']['plugins']['get']('AITabs');_0x2ef73f['view']['on']('activateTab',(_0x2c6bf4,_0xe0bf0c)=>{'reviewMode'===_0xe0bf0c?this['fire']('getReviewCheckList'):this['fire']('leaveReview');}),_0x2ef73f['view']['addTab']({'id':'reviewMode','buttonLabel':as(this['context']['locale'],'AI_REVIEW_MODE'),'buttonIcon':_0x458073,'order':0x0,'content':this['_mainView']});}}const Ao='review-';class go extends _0x1f4c78{static get['requires'](){return[_0x1b3b63,qs];}static get['pluginName'](){return'AIReviewCoreEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['_markers']=new Map();['_activeMarkers']=new Set();['_domEmitter'];['_eventEmitter'];constructor(_0x919444){super(_0x919444),this['_domEmitter']=new(Rt())(),this['_eventEmitter']=new(pt())();}get['emitter'](){return this['_eventEmitter'];}['afterInit'](){const _0x3335b7=Fs(this['context']);_0x3335b7['conversion']['for']('editingDowncast')['markerToElement']({'model':Ao+'insert','view':(_0x2c019d,{writer:_0x4630c9})=>{const _0x5d98c0=this['_markers']['get'](_0x2c019d['markerName']),_0x3f9480={'class':'ck-ai_review-marker_add'+(this['_activeMarkers']['has'](_0x5d98c0?.['id']||'')?'\x20ck-ai_review__change_active':''),'data-marker-id':_0x2c019d['markerName']};return _0x4630c9['createUIElement']('span',_0x3f9480,function(_0x30a0c5){const _0x5584cf=this['toDomElement'](_0x30a0c5);return _0x5584cf['innerHTML']=_0x5d98c0?.['content']?.['asString']||'',_0x5584cf;});}}),_0x3335b7['conversion']['for']('editingDowncast')['markerToHighlight']({'model':Ao+'remove-only','view':_0x9a2084=>{const _0x385deb=this['_markers']['get'](_0x9a2084['markerName']),_0x4a6208=['ck-ai_review-marker_strikethrough'];return this['_activeMarkers']['has'](_0x385deb?.['id']||'')&&_0x4a6208['push']('ck-ai_review__change_active'),{'classes':_0x4a6208,'attributes':{'data-marker-id':_0x9a2084['markerName']}};}}),_0x3335b7['conversion']['for']('editingDowncast')['markerToHighlight']({'model':Ao+'remove-context','view':_0x5b8f82=>{const _0x10714e=this['_markers']['get'](_0x5b8f82['markerName']),_0x481c98=['ck-ai_review-marker_underline'];return this['_activeMarkers']['has'](_0x10714e?.['id']||'')&&_0x481c98['push']('ck-ai_review__change_active'),{'classes':_0x481c98,'attributes':{'data-marker-id':_0x5b8f82['markerName']}};}}),_0x3335b7['conversion']['for']('editingDowncast')['markerToHighlight']({'model':Ao+'remove-text','view':_0x68ef1c=>{const _0xdf4b9f=this['_markers']['get'](_0x68ef1c['markerName']),_0x25a2fd=['ck-ai_review-marker_hide'];return this['_activeMarkers']['has'](_0xdf4b9f?.['id']||'')&&_0x25a2fd['push']('ck-ai_review__change_active'),{'classes':_0x25a2fd,'attributes':{'data-marker-id':_0x68ef1c['markerName']}};}}),_0x3335b7['conversion']['for']('dataDowncast')['markerToElement']({'model':Ao+'suggestion-context','view':(_0x2b4c1c,{writer:_0x5ea726})=>_0x5ea726['createRawElement']('span',{'class':'ck-ai_review-marker_context-'+(_0x2b4c1c['isOpening']?'start':'end')})}),_0x3335b7['conversion']['for']('downcast')['attributeToAttribute']({'model':_0x4068db,'view':_0xc0441c});const _0x34ddfe=_0x3335b7['ui']['getEditableElement']()||document['body'];this['_domEmitter']['listenTo'](_0x34ddfe,'mouseup',(_0x3f6300,_0xf7d17e)=>{const _0x4b5bf3=_0xf7d17e['target'],_0x3f8dc9=this['_findMarkerElement'](_0x4b5bf3);if(!_0x3f8dc9)return;const _0x307498=_0x3f8dc9['getAttribute']('data-marker-id'),_0x260739=_0x307498['split'](':')['pop']()?.['split']('_')[0x0];this['_eventEmitter']['fire']('changeMarkerClicked',{'markerId':_0x307498,'changeId':_0x260739,'markerElement':()=>this['_findMarkerElementById'](_0x307498),'domEvent':_0xf7d17e});},{'usePassive':!0x0,'priority':'highest'}),this['_domEmitter']['listenTo'](_0x34ddfe,'mouseover',(_0xf0a467,_0xc75da8)=>{const _0x40c410=_0xc75da8['target'],_0x27eb9a=_0xc75da8['relatedTarget'];let _0x6d4e8d=this['_findMarkerElement'](_0x40c410);if(!_0x6d4e8d&&_0x27eb9a&&(_0x6d4e8d=this['_findMarkerElement'](_0x27eb9a)),!_0x6d4e8d)return;const _0x13f7f3=_0x6d4e8d['getAttribute']('data-marker-id'),_0x18d937=_0x13f7f3['split'](':')['pop']()?.['split']('_')[0x0];this['_eventEmitter']['fire']('changeMarkerHovered',{'changeId':_0x18d937,'markerElement':()=>this['_findMarkerElementById'](_0x13f7f3),'domEvent':_0xc75da8});}),this['_domEmitter']['listenTo'](document,'mouseover',_0x136cad((_0x52ca84,_0x22b9dc)=>{const _0x49bebf=_0x22b9dc['target'];if(this['_findMarkerElement'](_0x49bebf))return;_0x49bebf['closest']('.ck-reset.ck-ai_review-balloon-panel-suggestion')||this['_eventEmitter']['fire']('changeMarkerBlurred');},0xc8)),_0x3335b7['model']['document']['registerPostFixer'](_0x8b302=>this['_validateMarkers'](_0x3335b7,_0x8b302)),_0x3335b7['model']['document']['on']('change',()=>this['_handleMarkerChanges'](_0x3335b7));}['getDocumentData'](){const _0x1e6a7b=this['context']['plugins']['get']('AIEditing'),_0x15f7d7=Fs(this['context']),_0x17b83d=_0x15f7d7['model'],_0x780119=new _0x4aa4eb();for(const _0xe0d829 of _0x17b83d['document']['getRoot']()['getChildren']()){const _0x4bb7f1=_0xe0d829['_clone'](!0x0);_0x780119['_appendChild'](_0x4bb7f1);}for(const _0x47867e of _0x17b83d['markers'])_0x780119['markers']['set'](_0x47867e['name'],this['_changeRangeOwnerDocument'](_0x47867e['getRange']()['clone'](),_0x780119));const _0x1f45ac=new _0x1d2c08({'ignoreElementEnd':!0x0,'startPosition':_0x17b83d['createPositionAt'](_0x780119,0x0)}),_0x15744c=new Set(),_0x402e76=new Map();for(const {item:_0x4dc26e}of _0x1f45ac){if(!_0x4dc26e['is']('$textProxy'))continue;const _0x2a63bb=_0x4dc26e['parent'];if(_0x2a63bb&&_0x2a63bb['is']('element')){const _0x367589=this['_upsertDataId'](_0x2a63bb,()=>_0x1e6a7b['_nextDataId'](_0x15744c));_0x15744c['add'](_0x367589);for(const _0x33e0cf of _0x2a63bb['getChildren']())_0x33e0cf['is']('element')&&_0x15744c['add'](this['_upsertDataId'](_0x33e0cf,()=>_0x1e6a7b['_nextDataId'](_0x15744c)));let _0x3c90ad=_0x2a63bb;for(;_0x3c90ad['parent']&&!_0x3c90ad['parent']['is']('documentFragment');)_0x3c90ad=_0x3c90ad['parent'],_0x3c90ad['hasAttribute'](_0x4068db)&&_0x3c90ad['_removeAttribute'](_0x4068db);_0x402e76['set'](_0x367589,{'path':_0x2a63bb['getPath'](),'getContent':this['_createGetContentUsingDataIdFn'](_0x3c90ad['_clone'](!0x0),_0x367589,_0x15f7d7['data'])}),_0x1f45ac['jumpTo'](_0x17b83d['createPositionAfter'](_0x2a63bb));}}return{'content':_0x15f7d7['data']['processor']['toData'](_0x15f7d7['data']['toView'](_0x780119)),'version':_0x15f7d7['model']['document']['version'],'elements':_0x402e76};}['diffContent'](_0x49b61f,_0x4f3f73,_0x5214ae=!0x1){const _0x341d4d=[],_0x12cb5c=Fs(this['context']),_0x2c7023=_0x12cb5c['data']['parse'](_0x4f3f73,'$documentFragment'),_0x759502=_0x12cb5c['data']['parse'](_0x49b61f,'$documentFragment'),_0x6b5237=_0x12cb5c['model']['createPositionAt'](_0x759502,0x0);if(this['_haveSingleTopLevelElement'](_0x2c7023)){if(!this['_hasSameTopLevelElement'](_0x759502,_0x2c7023))return _0x341d4d;}else{const _0x558e78=_0x12cb5c['model']['schema'];if(!this['_haveOnlyInlineContent'](_0x759502,_0x558e78)||!this['_haveOnlyInlineContent'](_0x2c7023,_0x558e78))return _0x341d4d;}const _0x44dcbc=this['context']['plugins']['get']('DocumentCompare')['getDiff'](_0x49b61f,_0x4f3f73,{'anchor':_0x6b5237,'markDeletions':!0x0})['getOperations']()['filter'](_0x317e33=>'insert'===_0x317e33['type']||'marker'===_0x317e33['type']&&_0x317e33['name']['startsWith']('$markedRemove')),_0x2806af=this['_groupAdjacentOperations'](_0x44dcbc),_0x573e31=[];if(_0x5214ae){if(_0x2806af['length']){const _0x338dfc=_0x2806af[0x0]['operations'][0x0],_0x4f70cd='insert'===_0x338dfc['type']?_0x338dfc['position']:_0x338dfc['newRange']['start'],_0x567c79=this['_getPositionLimitingRange'](_0x4f70cd,_0x12cb5c,'inside'),_0x3f3061=_0x567c79?_0x2c7023['getChild'](0x0)['getChildren']():_0x2c7023['getChildren'](),_0x181cae=_0x567c79||_0x12cb5c['model']['createRangeIn'](_0x759502),_0x2b3ebf=[new _0x3f80c1('$markedRemove:synthetic'+at(),null,_0x181cae,_0x12cb5c['model']['document']['model']['markers'],!0x0,_0x12cb5c['model']['document']['version']+0x1),new _0x554a3d(_0x181cae['end'],_0x3f3061,_0x12cb5c['model']['document']['version']+0x2)];_0x573e31['push']({'operations':_0x2b3ebf,'operationsIsolated':_0x2b3ebf,'groupOffset':0x0});}}else _0x573e31['push'](..._0x2806af);let _0x3a7124=0x0;return _0x12cb5c['model']['change'](_0x3db29b=>{for(let _0x1a31cb=0x0;_0x1a31cb<_0x573e31['length'];_0x1a31cb++){const _0x1bec77=_0x573e31[_0x1a31cb],_0x106a59=_0x3db29b['createDocumentFragment']();for(const _0x4c1831 of _0x759502['getChildren']())_0x3db29b['append'](_0x4c1831['_clone'](!0x0),_0x106a59);for(const _0x3c014e of _0x1bec77['operationsIsolated'])if('insert'===_0x3c014e['type']){const _0x17dc98=_0x3c014e;_0x17dc98['baseVersion']=null,_0x17dc98['isDocumentOperation']=!0x1,this['_changeOperationOwnerDocument'](_0x17dc98,_0x106a59),_0x3db29b['batch']['addOperation'](_0x3c014e),_0x12cb5c['model']['applyOperation'](_0x3c014e);const _0x108f17='suggestion:insertion:id:authorId:'+_0x3a7124++,_0x4ed200=_0x12cb5c['model']['createRange'](_0x17dc98['position'],_0x17dc98['position']['getShiftedBy'](_0x17dc98['howMany']));_0x106a59['markers']['set'](_0x108f17,_0x4ed200);}else{if('marker'===_0x3c014e['type']&&_0x3c014e['name']['startsWith']('$markedRemove')){const _0x542a3b=_0x3c014e,_0x3aa9cb='suggestion:deletion:id:authorId:'+_0x3a7124++;this['_changeOperationOwnerDocument'](_0x542a3b,_0x106a59),_0x106a59['markers']['set'](_0x3aa9cb,_0x542a3b['newRange']);}}if(_0x5214ae)_0x341d4d['push']({..._0x1bec77,'context':this['_createGetContentFn'](_0x759502,_0x12cb5c['data']),'content':this['_createGetContentFn'](_0x759502,_0x12cb5c['data'])});else{const _0x5479f1=this['_getChangeContext'](this['_changePositionOwnerDocument'](this['_getOperationStart'](_0x1bec77['operationsIsolated'][0x0]),_0x106a59),this['_changePositionOwnerDocument'](this['_getOperationEnd'](_0x1bec77['operationsIsolated'][_0x1bec77['operationsIsolated']['length']-0x1]),_0x106a59));_0x106a59['markers']['set'](Ao+'suggestion-context',new _0x2861aa(_0x5479f1['start'],_0x5479f1['end'])),_0x341d4d['push']({..._0x1bec77,'context':this['_createGetContextFn'](_0x106a59,_0x12cb5c['data'],{'ellipsisBefore':_0x5479f1['hasContentBefore'],'ellipsisAfter':_0x5479f1['hasContentAfter']}),'content':this['_createGetContentFn'](_0x106a59,_0x12cb5c['data'])});}}}),_0x341d4d;}['markChangePositionInEditorContent'](_0x3cf57d,_0x37be81){if(!_0x3cf57d['length'])return;const _0x1ae542=_0x3cf57d[0x0]['parent']['id'],_0x402b35=_0x37be81['elements']['get'](_0x1ae542);if(!_0x402b35)return void console['warn']('No\x20element\x20found\x20for\x20ID:\x20'+_0x1ae542);const _0x1e0d3d=_0x402b35['path'],_0x43eae3=Fs(this['context']),_0x19ce04=_0x43eae3['model']['document']['history']['getOperations'](_0x37be81['version']),_0x401030=[];for(const _0x1bc75a of _0x3cf57d){const _0x1d5392=_0x1bc75a['operationsIsolated']['map'](_0x5c6078=>this['_translateOperationToEditorContent'](_0x5c6078,_0x1e0d3d,_0x43eae3['model']['document']['getRoots']()[0x0]));if(!_0x1d5392||!_0x1d5392['length'])continue;const _0x295adb=_0x1d5392['every'](_0x5f22d2=>'marker'===_0x5f22d2['type']&&_0x5f22d2['name']['startsWith']('$markedRemove')),_0x254ae7={'document':_0x43eae3['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1},_0x240362=_0x3d9713(_0x1d5392,_0x19ce04,_0x254ae7)['operationsA'];for(const _0x2e3953 of _0x240362)if('insert'===_0x2e3953['type']){const _0x402185=_0x2e3953,_0x372ed6=_0x402185['nodes'];_0x43eae3['model']['change'](_0x178029=>{const _0x58d2dd=_0x178029['createDocumentFragment']();for(const _0x5c0236 of _0x372ed6)_0x178029['append'](_0x5c0236['_clone'](!0x0),_0x58d2dd);_0x401030['push']({'start':_0x402185['position'],'end':_0x402185['position'],'type':'insert','groupId':_0x1bc75a['id'],'content':{'asString':this['_createGetContentFn'](_0x58d2dd,_0x43eae3['data'])(),'asFragment':_0x58d2dd}});});}else{if('marker'===_0x2e3953['type']&&_0x2e3953['name']['startsWith']('$markedRemove')){const _0x50b883=_0x2e3953;let _0x2c7150='remove-text';if(_0x295adb){const _0x3aca21=this['_findAdjacentContextDistance'](_0x50b883['newRange']['start'],'backward',_0x43eae3['model']['schema']),_0x5db669=this['_findAdjacentContextDistance'](_0x50b883['newRange']['end'],'forward',_0x43eae3['model']['schema']);if(_0x3aca21||_0x5db669){const _0x36e6a1=_0x50b883['newRange']['start']['getShiftedBy'](-_0x3aca21),_0xf51ac1=_0x50b883['newRange']['end']['getShiftedBy'](_0x5db669);_0x401030['push']({'start':_0x36e6a1,'end':_0xf51ac1,'groupId':_0x1bc75a['id'],'type':'remove-context'});}else _0x2c7150='remove-only';}_0x401030['push']({'start':_0x50b883['newRange']['start'],'end':_0x50b883['newRange']['end'],'groupId':_0x1bc75a['id'],'type':_0x2c7150});}}}this['_insertMarkers'](_0x401030);}['clearAllMarkers'](){const _0x1ef099=Fs(this['context']);_0x1ef099['model']['change'](_0x2d468a=>{for(const _0x293ffb of this['_markers']['keys']())_0x1ef099['model']['markers']['get'](_0x293ffb)&&_0x2d468a['removeMarker'](_0x293ffb);}),this['_markers']['clear'](),this['_activeMarkers']['clear']();}['switchToReadOnly'](){Fs(this['context'])['enableReadOnlyMode']('ai-review');}['switchToEdit'](){Fs(this['context'])['disableReadOnlyMode']('ai-review');}['applyChange'](_0x806a6d){const _0x2d33df=Fs(this['context']),_0x1882f=_0x2d33df['model'],_0x5b0623=_0x806a6d['map'](_0x2db1cd=>this['_getMarkersDataForGroup'](_0x2db1cd))['flat']();_0x1882f['change'](_0x50898a=>{for(const _0x461184 of _0x5b0623){const _0x437794=_0x2d33df['model']['markers']['get'](_0x461184['id']);if(_0x437794){if('insert'===_0x461184['type']){if(!_0x461184['content'])continue;_0x1882f['insertContent'](_0x461184['content']['asFragment']||null,_0x437794['getRange']()['start']);}else'remove-text'!==_0x461184['type']&&'remove-only'!==_0x461184['type']||_0x1882f['deleteContent'](_0x1882f['createSelection'](_0x437794['getRange']()));_0x50898a['removeMarker'](_0x461184['id']),this['_markers']['delete'](_0x461184['id']);}}});}['rejectChange'](_0x3e7874){const _0x3aebdb=Fs(this['context']),_0x295c68=this['_getMarkersDataForGroup'](_0x3e7874);_0x3aebdb['model']['change'](_0x4477d8=>{for(const _0x3e46dc of _0x295c68)_0x4477d8['removeMarker'](_0x3e46dc['id']),this['_markers']['delete'](_0x3e46dc['id']);});}['getEditor'](){return Fs(this['context']);}['getMarkerElementForChange'](_0x1dbe81){const _0x2c6fa9=Array['from'](this['_markers']['values']())['filter'](_0x44a11a=>_0x44a11a['groupId']===_0x1dbe81);if(!_0x2c6fa9['length'])return null;const _0x2f5538=0x1===_0x2c6fa9['length']?_0x2c6fa9[0x0]:this['_sortMarkers'](_0x2c6fa9)[0x0],_0x688ec1=Fs(this['context'])['model']['markers']['get'](_0x2f5538['id']);if(!_0x688ec1)return null;return{'modelRange':_0x688ec1['getRange'](),'getElement':()=>this['_findMarkerElementById'](_0x2f5538['id'])};}['getContentElementForChange'](_0x3a3d42){const _0x11bcab=Array['from'](this['_markers']['values']())['filter'](_0x28fa09=>_0x28fa09['groupId']===_0x3a3d42);if(!_0x11bcab['length'])return null;const _0x229228=0x1===_0x11bcab['length']?_0x11bcab[0x0]:this['_sortMarkers'](_0x11bcab)[0x0],_0x548b50=Fs(this['context']),_0x3bc7d0=_0x548b50['model']['markers']['get'](_0x229228['id']);if(!_0x3bc7d0)return null;const _0x4bfa9d=_0x3bc7d0['getRange'](),_0x104549=_0x548b50['editing']['view']['getDomRoot']();if(!_0x104549||!_0x4bfa9d)return null;let _0x3aff72=_0x4bfa9d['start']['parent'];for(;_0x3aff72['parent']&&'$root'!==_0x3aff72['parent']['name'];)_0x3aff72=_0x3aff72['parent'];if(!_0x3aff72||!_0x3aff72['name'])return null;const _0x29a65e=_0x104549['querySelector']('[data-marker-id=\x22'+_0x229228['id']+'\x22]');if(!_0x29a65e)return null;let _0x2076dc=null;_0x548b50['model']['change'](_0x13ae7a=>{_0x2076dc=_0x13ae7a['createDocumentFragment'](),_0x13ae7a['append'](_0x3aff72['_clone'](!0x0),_0x2076dc);});const _0x1acb62=_0x548b50['data']['toView'](_0x2076dc)['getChild'](0x0);return _0x29a65e['closest'](_0x1acb62['name']);}['reactivateMarkers'](_0x29496e){const _0x3e3bf4=this['_getMarkersDataForGroup'](_0x29496e);if(!_0x3e3bf4['length'])return;const _0x43acc4=Array['from'](this['_activeMarkers'])['sort'](),_0x4063f6=Array['from'](new Set(_0x3e3bf4['map'](_0x4c07bb=>_0x4c07bb['id'])))['sort']();_0x43acc4['join']('|')!==_0x4063f6['join']('|')&&(this['setAllMarkersAsInactive'](),this['setMarkersInElementAsActive'](_0x29496e));}['setMarkersInElementAsActive'](_0x5b51e4){const _0x3f1795=this['_getMarkersDataForGroup'](_0x5b51e4);if(!_0x3f1795['length'])return;const _0x4117c6=Fs(this['context']),_0x345969=new Set(_0x3f1795['map'](_0x54ff09=>_0x54ff09['id'])),_0x15118e=Array['from'](_0x345969['values']())['map'](_0x2ca641=>_0x4117c6['model']['markers']['get'](_0x2ca641))['filter'](_0x52a2c6=>!!_0x52a2c6);_0x345969['forEach'](_0x226ce3=>{this['_activeMarkers']['add'](_0x226ce3);}),_0x4117c6['model']['change'](()=>{_0x15118e['forEach'](_0x26abd3=>{_0x4117c6['editing']['reconvertMarker'](_0x26abd3);});});}['setAllMarkersAsInactive'](){const _0x4719db=Array['from'](this['_activeMarkers']);if(!_0x4719db['length'])return;this['_activeMarkers']['clear']();const _0x2cb690=Fs(this['context']),_0x2f88de=_0x4719db['map'](_0x1c4f63=>_0x2cb690['model']['markers']['get'](_0x1c4f63))['filter'](_0x5cc2ca=>!!_0x5cc2ca);_0x2cb690['model']['change'](()=>{_0x2f88de['forEach'](_0x515cac=>{_0x2cb690['editing']['reconvertMarker'](_0x515cac);});});}['_getPositionLimitingRange'](_0xe7156b,_0x1d7688,_0x4781e4='outside'){if(!_0xe7156b)return null;let _0x17d056=_0xe7156b['parent'];for(;_0x17d056&&_0x17d056['parent']&&'$root'!==_0x17d056['parent']['name']&&!_0x1d7688['model']['schema']['isLimit'](_0x17d056)&&!_0x1d7688['model']['schema']['isBlock'](_0x17d056);)_0x17d056=_0x17d056['parent'];if(!_0x17d056||!_0x17d056['name']||'$root'===_0x17d056['name'])return null;let _0x3ce6fe=null;return _0x1d7688['model']['change'](_0x293705=>{_0x3ce6fe='inside'===_0x4781e4?_0x293705['createRangeIn'](_0x17d056):_0x293705['createRangeOn'](_0x17d056);}),_0x3ce6fe;}['_validateMarkers'](_0x559dce,_0x4c1616){const _0x5dc2ab=Array['from'](this['_markers']['keys']()),_0x44214b=new Map();for(const _0x5b485c of _0x5dc2ab){const _0x3cb531=_0x559dce['model']['markers']['get'](_0x5b485c);if(!_0x3cb531)continue;const _0x3db972=_0x3cb531['getStart']()['path'][0x0];_0x44214b['has'](_0x3db972)||_0x44214b['set'](_0x3db972,[]),_0x44214b['get'](_0x3db972)['push'](_0x3cb531);}const _0x3c0948=new Set();for(const _0x495b9c of _0x559dce['model']['document']['differ']['getChanges']()){let _0x1c3419=-0x1,_0x2c216b=null;if('insert'===_0x495b9c['type'])_0x2c216b=new _0x2861aa(_0x495b9c['position'],_0x495b9c['position']['getShiftedBy'](_0x495b9c['length'])),_0x1c3419=_0x495b9c['position']['path'][0x0];else{if('remove'!==_0x495b9c['type'])continue;_0x2c216b=new _0x2861aa(_0x495b9c['position']),_0x1c3419=_0x495b9c['position']['path'][0x0];}const _0x39258f=_0x44214b['get'](_0x1c3419)||[];if(_0x39258f['length']){for(const _0xc53ce6 of _0x39258f)if(_0x2c216b['root']['rootName']===_0xc53ce6['getRange']()['root']['rootName']&&('insert'!==_0x495b9c['type']||!_0x2c216b['containsRange'](_0xc53ce6['getRange']()))&&(_0x2c216b['isIntersecting'](_0xc53ce6['getRange']())||_0x2c216b['start']['isTouching'](_0xc53ce6['getRange']()['end'])||_0x2c216b['end']['isTouching'](_0xc53ce6['getRange']()['start']))){const _0x19da62=this['_parseMarkerName'](_0xc53ce6['name']);Array['from'](this['_markers']['values']())['filter'](_0x5a1ecf=>_0x5a1ecf['groupId']===_0x19da62['groupId'])['forEach'](_0x1520e7=>_0x3c0948['add'](_0x1520e7['id']));}}}if(_0x3c0948['size']){for(const _0x5dc881 of _0x3c0948)_0x4c1616['removeMarker'](_0x5dc881);return!0x0;}return!0x1;}['_handleMarkerChanges'](_0xbed635){for(const {name:_0x310696,data:_0x37d701}of _0xbed635['model']['document']['differ']['getChangedMarkers']()){if(!_0x310696['startsWith'](Ao))continue;const _0x3e2761=_0x37d701['oldRange'],_0x1ef77b=_0x37d701['newRange'],_0x405c63=_0x3e2761&&'$graveyard'===_0x3e2761['root']['rootName'],_0x2e8e46=_0x1ef77b&&'$graveyard'===_0x1ef77b['root']['rootName'];if(_0x405c63&&_0x2e8e46)continue;const _0xe84c10=this['_parseMarkerName'](_0x310696);this['_markers']['get'](_0x310696)&&(_0x2e8e46||!_0x1ef77b?this['_eventEmitter']['fire']('changeMarkerRemoved',{'markerId':_0x310696,'changeId':_0xe84c10['groupId']}):_0x405c63&&_0x1ef77b&&this['_eventEmitter']['fire']('changeMarkerRestored',{'markerId':_0x310696,'changeId':_0xe84c10['groupId']}));}}['_parseMarkerName'](_0x57ed19){const _0x1c3f33=_0x57ed19['split'](':'),_0x2ede83=(_0x1c3f33[0x1]||'')['split']('_');return{'prefix':_0x1c3f33[0x0],'groupId':_0x2ede83[0x0],'suffix':_0x2ede83[0x1]};}['_translateOperationToEditorContent'](_0x2c7061,_0x5edf4d,_0xbb796a){if('insert'===_0x2c7061['type']){const _0x1c6192=_0x2c7061;return new _0x554a3d(this['_changePosition'](_0x5edf4d['concat'](_0x1c6192['position']['offset']),_0xbb796a),_0x1c6192['nodes'],_0x1c6192['baseVersion']);}if('marker'===_0x2c7061['type']&&_0x2c7061['name']['startsWith']('$markedRemove')){const _0x4068=_0x2c7061;return new _0x3f80c1(_0x4068['name'],_0x4068['oldRange'],this['_changeRange'](_0x4068['newRange'],_0x5edf4d['concat'](_0x4068['newRange']['start']['offset']),_0x5edf4d['concat'](_0x4068['newRange']['end']['offset']),_0xbb796a),_0x4068['_markers'],_0x4068['affectsData'],_0x4068['baseVersion']);}return _0x2c7061;}['_groupAdjacentOperations'](_0x5762ef){if(!_0x5762ef['length'])return[];const _0x58b87a=[];let _0x4d7d4c=0x0,_0x408ca0=0x0,_0x1f1ebf=[];for(let _0x2f646a=0x0;_0x2f646a<=_0x5762ef['length'];_0x2f646a++){const _0x4fca1b=_0x5762ef[_0x2f646a],_0x22b0fa=_0x5762ef[_0x2f646a-0x1];!_0x4fca1b||_0x22b0fa&&!this['_getOperationEnd'](_0x22b0fa)['isTouching'](this['_getOperationStart'](_0x4fca1b))?(_0x58b87a['push']({'operations':_0x1f1ebf,'operationsIsolated':_0x1f1ebf['map'](_0x222bce=>this['_shiftOperation'](_0x222bce['clone'](),-_0x408ca0)),'groupOffset':_0x4d7d4c}),_0x1f1ebf=_0x4fca1b?[_0x4fca1b]:[],_0x408ca0+=_0x4d7d4c,_0x4d7d4c=0x0):_0x1f1ebf['push'](_0x4fca1b),_0x4fca1b&&'insert'===_0x4fca1b['type']&&(_0x4d7d4c+=_0x4fca1b['howMany']);}return _0x58b87a;}['_findAdjacentContextDistance'](_0x35b6d5,_0x4eed7b,_0x584517,_0x57529b=0x1){const _0x170961=new _0x1d2c08({'startPosition':_0x35b6d5,'direction':_0x4eed7b});let _0xfc5574=0x0;for(let _0x576d81=0x0;_0x576d81<_0x57529b;_0x576d81++){let _0x2e6eb5=0x0,_0x4e7945=!0x1,_0x179f69='forward'===_0x4eed7b?/^\W*\w+/:/\w+\W*$/;for(const {item:_0x3b71a7}of _0x170961)if(_0x3b71a7['is']('$textProxy')){const _0x1f84fb=_0x179f69['exec'](_0x3b71a7['data']);if(_0x1f84fb&&_0x1f84fb['length']){if(_0x2e6eb5+='forward'===_0x4eed7b?_0x1f84fb['index']+_0x1f84fb[0x0]['length']:_0x3b71a7['data']['length']-_0x1f84fb['index'],_0x1f84fb[0x0]['length']!==_0x3b71a7['data']['length'])break;_0x4e7945=!0x0,_0x179f69='forward'===_0x4eed7b?/^\w+/:/\w+$/;}else{if(_0x4e7945)break;_0x2e6eb5+=_0x3b71a7['offsetSize'];}}else{if(_0x3b71a7['is']('element')){_0x584517['isInline'](_0x3b71a7)&&!_0x4e7945&&(_0x2e6eb5+=0x1);break;}}_0xfc5574+=_0x2e6eb5,_0x170961['jumpTo'](_0x35b6d5['getShiftedBy']('forward'===_0x4eed7b?_0xfc5574:-_0xfc5574));}return _0xfc5574;}['_getChangeContext'](_0x4c59d1,_0x359554){const _0x14d94f=Fs(this['context'])['model']['schema'],_0x20e633=this['_findAdjacentContextDistance'](_0x4c59d1,'backward',_0x14d94f,0x6),_0x4a0763=this['_findAdjacentContextDistance'](_0x359554,'forward',_0x14d94f,0x6),_0x1c4094=_0x4c59d1['getShiftedBy'](-_0x20e633),_0x1dbaba=_0x359554['getShiftedBy'](_0x4a0763);return{'start':_0x1c4094,'end':_0x1dbaba,'hasContentBefore':!_0x1c4094['isAtStart'],'hasContentAfter':!_0x1dbaba['isAtEnd']};}['_insertMarkers'](_0xae6d3f){const _0x5bbb88=this['context']['plugins']['get']('AIEditing'),_0x3e099c=new Set();Fs(this['context'])['model']['change'](_0x1fd1d7=>{for(const _0x5ab6df of _0xae6d3f){const _0x416838=''+Ao+_0x5ab6df['type']+':'+_0x5ab6df['groupId']+'_'+_0x5bbb88['_nextDataId'](_0x3e099c);this['_markers']['set'](_0x416838,{'id':_0x416838,'groupId':_0x5ab6df['groupId'],'type':_0x5ab6df['type'],'content':_0x5ab6df['content']}),_0x1fd1d7['addMarker'](_0x416838,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x1fd1d7['createRange'](_0x5ab6df['start'],_0x5ab6df['end'])});}});}['_createGetContextFn'](_0x1d8823,_0x4b5127,_0x14abf8){let _0x1fed9f='';return()=>{if(!_0x1fed9f){const _0x5dec9f=_0x4b5127['toView'](_0x1d8823,{'showSuggestionHighlights':!0x0});let _0x1c2b9f=_0x5dec9f['getChild'](0x0);if(_0x1c2b9f['is']('containerElement')||(_0x1c2b9f=_0x5dec9f),!_0x1c2b9f)return'';let _0x2a70f8=!0x1;const _0x32a95f=[];for(const _0x26c663 of _0x1c2b9f['getChildren']())_0x26c663['is']('element','span')&&_0x26c663['hasClass']('ck-ai_review-marker_context-end')&&(_0x2a70f8=!0x1),_0x2a70f8&&_0x32a95f['push'](_0x26c663),_0x26c663['is']('element','span')&&_0x26c663['hasClass']('ck-ai_review-marker_context-start')&&(_0x2a70f8=!0x0);_0x1c2b9f['_removeChildren'](0x0,_0x1c2b9f['childCount']),_0x14abf8?.['ellipsisBefore']&&_0x1c2b9f['_appendChild']('…'),_0x1c2b9f['_appendChild'](_0x32a95f),_0x14abf8?.['ellipsisAfter']&&_0x1c2b9f['_appendChild']('…');const _0x227e54=_0x4b5127['htmlProcessor']['domConverter']['viewToDom'](_0x5dec9f),_0x5db5df=_0x4b5127['htmlProcessor']['htmlWriter']['getHtml'](_0x227e54);_0x1fed9f=_0x5db5df;}return _0x1fed9f;};}['_createGetContentFn'](_0x138ff9,_0x1cb443){let _0x3a9ece='';return()=>(_0x3a9ece||(_0x3a9ece=_0x1cb443['stringify'](_0x138ff9,{'showSuggestionHighlights':!0x0})),_0x3a9ece);}['_createGetContentUsingDataIdFn'](_0x5b3b84,_0x4212ab,_0x456fe2){let _0x34f4ac='';return()=>{if(!_0x34f4ac){const _0x5ad28d=_0x456fe2['toView'](new _0x4aa4eb(_0x5b3b84)),_0xca21fe=_0x456fe2['htmlProcessor']['domConverter']['viewToDom'](_0x5ad28d)['querySelector']('[data-id=\x22'+_0x4212ab+'\x22]');_0x34f4ac=_0xca21fe?.['outerHTML']||'';}return _0x34f4ac;};}['_findMarkerElement'](_0x5f1b82,_0xab828f=0x5){let _0x11f977=_0x5f1b82,_0x220dfc=null;for(let _0x1acc0c=0x0;_0x1acc0c<_0xab828f&&_0x11f977;_0x1acc0c++){if(!_0x11f977['className']){_0x11f977=_0x11f977['parentElement'];continue;}if(!(''+_0x11f977['className'])['includes']('ck-ai_review-marker_')){_0x11f977=_0x11f977['parentElement'];continue;}if(!_0x11f977['getAttribute']('data-marker-id'))break;_0x220dfc=_0x11f977;break;}return _0x220dfc;}['_findMarkerElementById'](_0x2ec864){const _0x2a5091=Fs(this['context']),_0x1a0524=_0x2a5091['model']['markers']['get'](_0x2ec864);return _0x1a0524?_0x537667(_0x2a5091['editing'],_0x1a0524):null;}['_getMarkersDataForGroup'](_0xbe2d91){return Array['from'](this['_markers']['values']())['filter'](_0x434952=>_0x434952['groupId']===_0xbe2d91);}['_getOperationStart'](_0x5209c4){return'insert'===_0x5209c4['type']?_0x5209c4['position']:_0x5209c4['newRange']['start'];}['_getOperationEnd'](_0x426d3d,_0x46cda1=!0x1){return'insert'===_0x426d3d['type']?_0x46cda1?_0x426d3d['position']:_0x426d3d['position']['getShiftedBy'](_0x426d3d['howMany']):_0x426d3d['newRange']['end'];}['_shiftOperation'](_0x20f07d,_0x3a6474){return'insert'===_0x20f07d['type']?_0x20f07d['position']=_0x20f07d['position']['getShiftedBy'](_0x3a6474):'marker'===_0x20f07d['type']&&_0x20f07d['newRange']&&(_0x20f07d['newRange']=new _0x2861aa(_0x20f07d['newRange']['start']['getShiftedBy'](_0x3a6474),_0x20f07d['newRange']['end']['getShiftedBy'](_0x3a6474))),_0x20f07d;}['_changeOperationOwnerDocument'](_0x52fef7,_0x2021b9){'insert'===_0x52fef7['type']?_0x52fef7['position']=this['_changePositionOwnerDocument'](_0x52fef7['position'],_0x2021b9):'marker'===_0x52fef7['type']&&_0x52fef7['newRange']&&(_0x52fef7['newRange']=this['_changeRangeOwnerDocument'](_0x52fef7['newRange'],_0x2021b9));}['_changePositionOwnerDocument'](_0xb24123,_0x3d8842){return new _0x99b885(_0x3d8842,_0xb24123['path']);}['_changeRangeOwnerDocument'](_0x2daa87,_0x1fd879){return new _0x2861aa(this['_changePositionOwnerDocument'](_0x2daa87['start'],_0x1fd879),this['_changePositionOwnerDocument'](_0x2daa87['end'],_0x1fd879));}['_changePosition'](_0x25b4c5,_0x48112a){return new _0x99b885(_0x48112a,[..._0x25b4c5]);}['_changeRange'](_0x43e006,_0x1049b0,_0x3d1984,_0x2e84de){return new _0x2861aa(this['_changePosition'](_0x1049b0,_0x2e84de),this['_changePosition'](_0x3d1984,_0x2e84de));}['_sortMarkers'](_0x2fe17f){const _0x2c21c4=_0x171766=>{switch(_0x171766){case'insert':return 0x0;case'remove-context':return 0x1;case'remove-only':return 0x2;case'remove-text':return 0x3;}};return _0x2fe17f['sort']((_0x1fd9bf,_0x36d00c)=>_0x2c21c4(_0x1fd9bf['type'])-_0x2c21c4(_0x36d00c['type']));}['_hasSameTopLevelElement'](_0x4a3333,_0x57bbe2){const _0x3c6026=_0x4a3333['getChild'](0x0),_0xf8fc87=_0x57bbe2['getChild'](0x0);return!(!_0x3c6026||!_0xf8fc87)&&((!_0x3c6026['is']('element')||!_0xf8fc87['is']('element')||_0x3c6026['name']===_0xf8fc87['name'])&&!(_0x3c6026['is']('element')&&!_0xf8fc87['is']('element')||!_0x3c6026['is']('element')&&_0xf8fc87['is']('element')));}['_haveSingleTopLevelElement'](_0x2a52b0){return 0x1===_0x2a52b0['childCount'];}['_haveOnlyInlineContent'](_0x23c383,_0x633b18){for(const _0x9ecd44 of _0x23c383['getChildren']())if(_0x9ecd44['is']('element')&&!_0x633b18['isInline'](_0x9ecd44))return!0x1;return!0x0;}['_upsertDataId'](_0xbba6ce,_0x457d6d){let _0x1c6ce2=_0xbba6ce['getAttribute'](_0x4068db);return _0x1c6ce2||(_0x1c6ce2=_0x457d6d(),_0xbba6ce['_setAttribute'](_0x4068db,_0x1c6ce2)),_0x1c6ce2;}}class Io extends pt(){['id'];['contentNew'];['contentInitial'];['documentVersion'];constructor({id:_0x518fbf,contentNew:_0x1f8871,contentInitial:_0x5f1892,documentVersion:_0xb2d0bb}){super(),this['id']=_0x518fbf,this['contentNew']=_0x1f8871,this['contentInitial']=_0x5f1892,this['documentVersion']=_0xb2d0bb;}}class Eo extends ht(){['id'];['parent'];['_data'];['_editorOperations']=[];constructor(_0x224783,_0x5cd2dc,_0x1c5ad5){super(),this['id']=_0x224783,this['parent']=_0x1c5ad5,this['_data']=_0x5cd2dc,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 To extends ht(){['id']=at();['callId'];['_results']=new Map();['_changes']=[];['_sourceCheck'];['_documentData'];['_aiConnector'];['_reviewParams'];['_reviewArgs'];['_activeRequest']=null;['_currentError'];['_wasAborted']=!0x1;constructor(_0x5067dc,_0x5edd1a,_0x3cf8ca,_0x48d371,_0x25bb56){super(),this['_sourceCheck']=_0x5edd1a,this['_documentData']=_0x5067dc,this['_aiConnector']=_0x3cf8ca,this['_reviewParams']=_0x48d371,this['_reviewArgs']=_0x25bb56,this['on']('change:status',(_0x310f9b,_0x34f771,_0x41ebb0)=>{'aborted'==_0x41ebb0&&(this['_wasAborted']=!0x0),this['fire']('reviewCheckRunUpdated',{'status':_0x41ebb0,'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'](_0x155d69=>'pending'===_0x155d69['status']);}get['currentError'](){return this['_currentError'];}['updateDocumentData'](_0x6797c0){this['_documentData']=_0x6797c0;}async['start'](){this['status']='loading',this['_currentError']=void 0x0;try{this['_activeRequest']=this['_createApiRequest']();const _0x1dc37c=await this['_activeRequest']['getStream']();this['status']='data';for await(const _0x4b62e5 of _0x1dc37c)'unmodified'!==_0x4b62e5['data']['operation']&&('error'!==_0x4b62e5['data']['operation']?'review-metadata'!==_0x4b62e5['event']?this['_addReviewCheckResult'](_0x4b62e5['data']['dataId'],_0x4b62e5['data']['textDelta']):this['callId']=_0x4b62e5['data']['callId']:this['status']='error-chunk');'error-chunk'!==this['status']&&(0x0===this['_results']['size']||0x0===this['_changes']['length']?this['status']='unmodified':this['status']='ready');}catch(_0x253f95){this['_currentError']=_0x253f95,_0x253f95 instanceof Error&&_0x253f95['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'](_0x3dbe95,_0x13672a){const _0x3a4e2d=this['_results']['get'](_0x3dbe95);if(!_0x3a4e2d)return;if(0x0===_0x13672a['length'])return;const _0x246fbf=[];_0x13672a['forEach']((_0x3d65d2,_0x4efc5d)=>{const _0x47e413=new Eo(_0x3a4e2d['id']+'-'+_0x4efc5d,_0x3d65d2,_0x3a4e2d);_0x47e413['on']('change:status',()=>{this['fire']('reviewCheckResultChangeStatusUpdated',{'change':_0x47e413,'status':_0x47e413['status']});}),_0x47e413['on']('change:isActivated',()=>{_0x47e413['isActivated']?this['fire']('reviewCheckResultActivated',{'change':_0x47e413}):this['fire']('reviewCheckResultDeactivated',{'change':_0x47e413});}),this['_changes']['push'](_0x47e413),_0x246fbf['push'](_0x47e413);}),this['fire']('reviewCheckResultReady',{'changes':_0x246fbf,'result':_0x3a4e2d,'source':this});}['abort'](){this['_activeRequest']&&(this['_activeRequest']['abortController']['abort'](),this['_activeRequest']=null,this['status']='aborted');}['isChangeActive'](_0xefeb46){const _0x131dee=this['_changes']['find'](_0x5201bf=>_0x5201bf['id']===_0xefeb46);return!(!_0x131dee||'pending'!==_0x131dee['status']);}['isAnyChangeActivated'](){return this['_changes']['some'](_0x5ab7a0=>!0x0===_0x5ab7a0['isActivated']);}['getActiveChanges'](){return this['_changes']['filter'](_0x23059a=>'pending'===_0x23059a['status']);}['getChangeById'](_0x20f1e8){return this['_changes']['find'](_0x1766ac=>_0x1766ac['id']===_0x20f1e8);}['markAllChangesAsAccepted'](){for(const _0x7684af of this['_changes'])'pending'===_0x7684af['status']&&(_0x7684af['status']='accepted');this['_checkIfFinished']();}['markChangeAsAccepted'](_0x4e8b32){const _0x260e3a=this['_changes']['find'](_0x58694f=>_0x58694f['id']===_0x4e8b32);_0x260e3a&&'pending'===_0x260e3a['status']&&(_0x260e3a['status']='accepted'),this['_checkIfFinished']();}['markChangeAsRejected'](_0x3d5b6a){const _0x1682c2=this['_changes']['find'](_0x112be7=>_0x112be7['id']===_0x3d5b6a);_0x1682c2&&'pending'===_0x1682c2['status']&&(_0x1682c2['status']='rejected'),this['_checkIfFinished']();}['markChangeAsOutdated'](_0x4a71c2){const _0x4ee718=this['_changes']['find'](_0x2b81d9=>_0x2b81d9['id']===_0x4a71c2);_0x4ee718&&'pending'===_0x4ee718['status']&&(_0x4ee718['status']='outdated'),this['_checkIfFinished']();}['markChangeAsPending'](_0x22fe02){const _0x2f31e2=this['_changes']['find'](_0x9424d4=>_0x9424d4['id']===_0x22fe02);_0x2f31e2&&'outdated'===_0x2f31e2['status']&&(_0x2f31e2['status']='pending'),this['_checkIfFinished']();}['activateChange'](_0x2531c5){this['_changes']['filter'](_0x3f6dd6=>_0x3f6dd6['isActivated']&&_0x3f6dd6['id']!==_0x2531c5)['forEach'](_0x161ed8=>{_0x161ed8['isActivated']=!0x1;});const _0x56cd64=this['_changes']['find'](_0x3e46f0=>_0x3e46f0['id']===_0x2531c5);_0x56cd64&&'pending'===_0x56cd64['status']&&(_0x56cd64['isActivated']=!0x0);}['deactivateChange'](){this['_changes']['filter'](_0x1fcf48=>_0x1fcf48['isActivated'])['forEach'](_0x22c3fa=>{_0x22c3fa['isActivated']=!0x1;});}['forceReadyState'](){this['status']='ready';}async['sendRating'](_0x2f6a49){if('initialized'===this['status']||'loading'===this['status']||'data'===this['status']||this['_wasAborted'])return;if(!this['callId']||0x0===this['_changes']['length'])return;let _0xef5b2b;if(_0x2f6a49){const _0x443f5d=this['_changes']['find'](_0x1e6453=>_0x1e6453['id']===_0x2f6a49);if(_0x443f5d&&_0x443f5d['isRated'])return;_0x443f5d&&(_0xef5b2b=_0x443f5d['parent']['id'],_0x443f5d['isRated']=!0x0);}const _0x468d85={'positiveCount':this['_changes']['filter'](_0x2745d8=>'accepted'===_0x2745d8['status'])['length'],'totalCount':this['_changes']['length']};this['_sendRatingRequest'](_0x468d85,this['callId'],_0xef5b2b);}['_addReviewCheckResult'](_0xc4c01b,_0x277b21){const _0xf038e6=this['_documentData']['elements']['get'](_0xc4c01b);if(!_0xf038e6)return;const _0x52c02a=_0xf038e6['getContent']();if(_0x52c02a===_0x277b21)return;const _0x58768c=new Io({'id':_0xc4c01b,'contentInitial':_0x52c02a,'contentNew':_0x277b21,'documentVersion':this['_documentData']['version']});this['_results']['set'](_0x58768c['id'],_0x58768c),this['fire']('reviewCheckResultAdded',{'result':_0x58768c,'source':this});}['_checkIfFinished'](){'finished'===this['status']&&(this['_changes']['filter'](_0x455685=>'pending'===_0x455685['status'])['length']>0x0&&(this['status']='ready')),'ready'===this['status']&&(0x0===this['_changes']['filter'](_0x3831df=>'pending'===_0x3831df['status'])['length']&&(this['status']='finished'));}}class po extends To{get['subTitle'](){if(!this['_reviewParams']||0x0===this['_reviewParams']['length'])return'';const _0x5a1a73=[];if(this['_reviewParams']['length']>0x0&&this['_sourceCheck']['options'])for(let _0x238ccb=0x0;_0x238ccb<this['_reviewParams']['length'];_0x238ccb++){if(!this['_reviewParams'][_0x238ccb]||!this['_sourceCheck']['options'][_0x238ccb])continue;const _0xadc24f=this['_sourceCheck']['options'][_0x238ccb],_0x2b96d3=_0xadc24f['data']?.['find'](_0x21451e=>_0x21451e['id']===this['_reviewParams'][_0x238ccb]);_0x2b96d3&&_0x5a1a73['push'](_0x2b96d3['label']);}return _0x5a1a73['join'](',\x20');}get['reviewName'](){return this['_composeReviewName']();}['_createApiRequest'](){return this['_aiConnector']['callSystemReview']({'reviewName':this['_composeReviewName'](),'content':this['_documentData']['content'],'args':this['_reviewArgs']});}['_sendRatingRequest'](_0x574508,_0xc3fd1b,_0x3059be){return this['_aiConnector']['upsertAIReviewRating'](this['reviewName'],_0xc3fd1b,_0x574508,_0x3059be);}['_composeReviewName'](){return!this['_reviewParams']||0x0===this['_reviewParams']['length']||this['_sourceCheck']['useArgs']?this['_sourceCheck']['apiId']:[this['_sourceCheck']['apiId'],...this['_reviewParams']]['join']('-');}}class mo extends _0x1f4c78{['_aiConnector'];['_aiReviewCoreUi'];['_aiReviewCoreEditing'];['_aiReviewCheckList'];['_currentReviewCheckRun'];['_changeActivationSource']=null;static get['requires'](){return[rs];}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}async['init'](){this['_initRequiredPlugins'](),this['_aiReviewCheckList']=await this['_getChecksList'](),this['listenTo'](this['_aiReviewCoreUi'],'getReviewCheckList',()=>{this['_aiReviewCoreUi']['setAvailableChecks'](this['_aiReviewCheckList']['checks']);}),this['listenTo'](this['_aiReviewCoreUi'],'runReviewCheck',async(_0x345af3,_0x4bb186)=>{const _0x4397ef=this['_aiReviewCheckList']['getCheckById'](_0x4bb186['id']);if(_0x4397ef){this['_onReviewCheckRun'](_0x4bb186),this['_aiReviewCoreEditing']['switchToReadOnly'](),this['_currentReviewCheckRun']=this['_createReviewCheckRun'](_0x4bb186,_0x4397ef),this['_aiReviewCoreUi']['setCheckResultTitle'](this['_currentReviewCheckRun']['title'],this['_currentReviewCheckRun']['subTitle']),this['_currentReviewCheckRun']['on']('reviewCheckRunUpdated',(_0x2bbb96,_0x4e719b)=>{switch(_0x4e719b['status']){case'data':case'loading':this['_aiReviewCoreUi']['showCheckRunResults'](_0x4e719b);break;case'finished':this['_onCheckRunFinished']();break;case'ready':this['_aiReviewCoreUi']['showActionsWhenResultIsReady']();break;case'unmodified':this['_aiReviewCoreUi']['showNoChangesView']();break;case'error-general':this['_aiReviewCoreUi']['showGeneralResultsErrorView'](),this['_logError'](new ot('ai-review-mode-check-run-general-error',this,void 0x0,this['_currentReviewCheckRun']?.['currentError']));break;case'error-chunk':this['_aiReviewCoreUi']['showChunkErrorView'](),this['_logError'](new ot('ai-review-mode-check-run-chunk-error',this,void 0x0,this['_currentReviewCheckRun']?.['currentError']));break;case'aborted':this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['processedResultsCount']>0x0?setTimeout(()=>{this['_currentReviewCheckRun']?.['forceReadyState']();},0x0):this['_onReviewRunLeave'](!0x0);}'ready'!==_0x4e719b['status']&&'error-chunk'!==_0x4e719b['status']&&'error-general'!==_0x4e719b['status']||this['_currentReviewCheckRun']?.['sendRating']();}),this['_currentReviewCheckRun']['on']('reviewCheckResultAdded',(_0x1a3a04,_0x2a53ce)=>{if(!this['_currentReviewCheckRun'])throw new ot('ai-review-mode-no-current-check-run',this);const _0x3e664f=this['_diffContent'](_0x2a53ce['result']['contentInitial'],_0x2a53ce['result']['contentNew']);_0x2a53ce['source']['addResultChanges'](_0x2a53ce['result']['id'],_0x3e664f);}),this['_currentReviewCheckRun']['on']('reviewCheckResultReady',(_0x11fd38,_0x3ae070)=>{for(const _0x35b6fd of _0x3ae070['changes'])this['_aiReviewCoreUi']['showCheckRunResult'](_0x35b6fd);this['_markChangePositionInEditorContent'](_0x3ae070['changes'],_0x3ae070['source']['documentData']);}),this['_currentReviewCheckRun']['on']('reviewCheckResultChangeStatusUpdated',(_0x153cf0,_0x5ee8a2)=>{this['_aiReviewCoreUi']['updateChangeState'](_0x5ee8a2['change']['id'],_0x5ee8a2['status']);}),this['_currentReviewCheckRun']['on']('reviewCheckResultActivated',(_0x39f6fd,_0x3b9996)=>{this['_onReviewCheckResultActivated'](_0x3b9996);}),this['_currentReviewCheckRun']['on']('reviewCheckResultDeactivated',()=>{this['_onReviewCheckResultDeactivated']();});try{await this['_currentReviewCheckRun']['start']();}catch(_0xff98e0){_0xff98e0 instanceof Error&&_0xff98e0['message']['includes']('ai-request-aborted')||(_0xff98e0 instanceof ot?this['_logError'](_0xff98e0):this['_logError'](new ot('ai-review-mode-check-run-failed',this,void 0x0,_0xff98e0)));}}else this['_logError'](new ot('ai-review-mode-source-check-not-found',this,{'checkId':_0x4bb186['id']}));}),this['listenTo'](this['_aiReviewCoreUi'],'leaveReview',()=>{this['_onReviewRunLeave']();}),this['listenTo'](this['_aiReviewCoreUi'],'leaveReviewCoreResultList',()=>{this['_onReviewRunLeave'](!0x0);}),this['listenTo'](this['_aiReviewCoreUi'],'abortReviewStream',()=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['abort']();}),this['listenTo'](this['_aiReviewCoreUi'],'finishReview',()=>{this['_onReviewRunLeave'](!0x0);}),this['listenTo'](this['_aiReviewCoreUi'],'acceptAllChanges',()=>{if(!this['_currentReviewCheckRun'])return;const _0x24e327=this['_currentReviewCheckRun']['getActiveChanges']();if(!_0x24e327['length'])return;this['_aiReviewCoreEditing']['applyChange'](_0x24e327['map'](_0x1bd485=>_0x1bd485['id']));const _0x5694d7=this['_currentReviewCheckRun'];_0x5694d7['markAllChangesAsAccepted'](),_0x5694d7['sendRating']();}),this['listenTo'](this['_aiReviewCoreUi'],'acceptChange',(_0x25df56,_0x5b1922)=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['isChangeActive'](_0x5b1922['id'])&&(this['_aiReviewCoreEditing']['applyChange']([_0x5b1922['id']]),this['_currentReviewCheckRun']['markChangeAsAccepted'](_0x5b1922['id']),this['_aiReviewCoreUi']['hideChangeBalloon'](),this['_currentReviewCheckRun']['sendRating'](_0x5b1922['id']));}),this['listenTo'](this['_aiReviewCoreUi'],'dismissChange',(_0x35455e,_0x10ad14)=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['isChangeActive'](_0x10ad14['id'])&&(this['_aiReviewCoreEditing']['rejectChange'](_0x10ad14['id']),this['_currentReviewCheckRun']['markChangeAsRejected'](_0x10ad14['id']),this['_aiReviewCoreUi']['hideChangeBalloon'](),this['_currentReviewCheckRun']['sendRating'](_0x10ad14['id']));}),this['listenTo'](this['_aiReviewCoreUi'],'retryReview',async()=>{this['_currentReviewCheckRun']&&(this['_aiReviewCoreEditing']['clearAllMarkers'](),this['_currentReviewCheckRun']['updateDocumentData'](this['_aiReviewCoreEditing']['getDocumentData']()),await this['_currentReviewCheckRun']['restart']());}),this['listenTo'](this['_aiReviewCoreUi'],'activateChange',(_0x34f1af,_0x2d9f4f)=>{this['_onActivateChange'](_0x2d9f4f);}),this['listenTo'](this['_aiReviewCoreUi'],'deactivateChange',(_0x3acadf,_0x21311c)=>{this['_onDeactivateChange'](_0x21311c);}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerClicked',(_0x40156f,_0xe8ccf7)=>{this['_onChangeMarkerClicked'](_0x40156f,_0xe8ccf7);}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerHovered',(_0x431550,_0x8b03ff)=>{this['_onChangeMarkerHovered'](_0x431550,_0x8b03ff);}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerBlurred',()=>{this['_onChangeMarkerBlurred']();}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerRemoved',(_0x11f9a7,_0x26f98f)=>{this['_onChangeMarkerRemoved'](_0x11f9a7,_0x26f98f);}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerRestored',(_0x223407,_0x1c3f7e)=>{this['_onChangeMarkerRestored'](_0x223407,_0x1c3f7e);});}['_createReviewCheckRun'](_0x56b3d3,_0x2f5210){return new po(this['_aiReviewCoreEditing']['getDocumentData'](),_0x2f5210,this['_aiConnector'],_0x56b3d3['params'],_0x56b3d3['args']);}['_onChangeMarkerRemoved'](_0x170b45,_0x515fef){this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['markChangeAsOutdated'](_0x515fef['changeId']);}['_onChangeMarkerRestored'](_0x59baa9,_0x56bc36){this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['markChangeAsPending'](_0x56bc36['changeId']);}['_onCheckRunFinished'](){this['_aiReviewCoreUi']['showReviewCompletedView']();}['_initRequiredPlugins'](){this['_aiConnector']=this['context']['plugins']['get']('AIConnector');}['_onReviewRunLeave'](_0x3b14c8=!0x1){this['_currentReviewCheckRun']&&(this['_currentReviewCheckRun']['hasModifications']||this['_currentReviewCheckRun']['sendRating'](),this['_currentReviewCheckRun']['stopListening'](),this['_currentReviewCheckRun']['abort'](),this['_currentReviewCheckRun']=void 0x0),_0x3b14c8&&this['_aiReviewCoreUi']['showReviewCheckList'](),this['_aiReviewCoreEditing']['clearAllMarkers'](),this['_aiReviewCoreEditing']['switchToEdit'](),this['_changeActivationSource']=null;const _0xc655ce=this['_aiReviewCoreEditing']['getEditor']();_0xc655ce&&_0xc655ce['editing']['view']['change'](_0x56a449=>{const _0x584fbe=_0xc655ce['editing']['view']['document']['getRoot']();_0x56a449['removeClass']('ck-ai_review-diff',_0x584fbe),_0x56a449['removeClass']('ck-ai_review-highlights',_0x584fbe),_0x56a449['removeClass']('ck-ai-translate-mode-content',_0x584fbe);});}['_getTranslationWithDefault'](_0x52842f,_0x1a678b){const _0x309483=as(this['context']['locale'],_0x52842f);return _0x309483===_0x52842f?_0x1a678b:_0x309483;}['_logError'](_0x360950,_0x548024=!0x1){Et(_0x360950['message']),_0x548024||(_0x360950['message']['startsWith']('ai-review-mode-models-unable-to-retrieve')?this['_aiReviewCoreUi']['showGeneralReviewCoreErrorView']():this['_aiReviewCoreUi']['showGeneralResultsErrorView']());}['_scrollToChange'](_0x27934c){if('content'===this['_changeActivationSource']){const _0x1f48c6=this['_aiReviewCoreUi']['getChangeElement'](_0x27934c);_0x1f48c6&&wt(_0x1f48c6['closest']('.ck-ai_review__check-run-result')||_0x1f48c6);}else{if('panel'===this['_changeActivationSource']){const _0x2f4af3=this['_getChangeContentElement'](_0x27934c);if(!_0x2f4af3)return;mt({'target':_0x2f4af3,'viewportOffset':{'top':0x55,'left':0x0,'bottom':0x0,'right':0x0},'ancestorOffset':0x14,'alignToTop':!0x0});}}}}const Co=[{'id':'custom','commandId':'custom','title':'Custom\x20command','description':'Type\x20a\x20custom\x20command\x20to\x20review\x20the\x20content\x20exactly\x20as\x20you\x20need.','isParameterized':!0x0},{'id':'correctness','commandId':'correctness','title':'Correctness','description':'Ensure\x20the\x20text\x20is\x20factually\x20accurate\x20and\x20free\x20of\x20errors.','isParameterized':!0x1},{'id':'clarity','commandId':'clarity','title':'Clarity','description':'Improve\x20the\x20clarity\x20and\x20readability\x20of\x20the\x20text.','isParameterized':!0x1},{'id':'readability','commandId':'readability','title':'Readability','description':'Enhance\x20the\x20overall\x20readability\x20of\x20the\x20text.','isParameterized':!0x1},{'id':'length','commandId':'make','title':'Adjust\x20length','description':'Refine\x20text\x20length\x20to\x20match\x20your\x20needs.','isParameterized':!0x0,'options':[{'formType':'dropdown','label':'Adjust\x20length','default':'longer','data':[{'label':'Longer','id':'longer'},{'label':'Shorter','id':'shorter'}]}]},{'id':'tone','commandId':'make-tone','title':'Adjust\x20tone\x20and\x20style','description':'Choose\x20tone\x20and\x20style\x20to\x20change\x20content\x20as\x20you\x20need.','isParameterized':!0x0,'options':[{'formType':'dropdown','label':'Adjust\x20tone\x20and\x20style','default':'casual','data':[{'label':'Casual','id':'casual'},{'label':'Direct','id':'direct'},{'label':'Friendly','id':'friendly'},{'label':'Confident','id':'confident'},{'label':'Professional','id':'professional'}]}]}];class wo{['id'];['commandId'];['title'];['description'];['isParameterized'];['useArgs'];['options'];['args'];get['apiId'](){return this['commandId'];}constructor(_0x92962c){this['id']=_0x92962c['id'],this['commandId']=_0x92962c['commandId'],this['title']=_0x92962c['title'],this['description']=_0x92962c['description'],this['isParameterized']=_0x92962c['isParameterized'],this['useArgs']=_0x92962c['useArgs'],this['options']=_0x92962c['options'],this['args']=_0x92962c['args'];}}class fo extends ht(){['_checks']=[];['setupChecks'](_0x2178cc){this['_checks']=_0x2178cc['map'](_0x4406d7=>new wo(_0x4406d7));}get['checks'](){return this['_checks'];}['getCheckById'](_0x201b04){return this['checks']['find'](_0x2fc40c=>_0x2fc40c['id']===_0x201b04);}['removeCheckById'](_0x162ac2){this['_checks']=this['_checks']['filter'](_0x2d3f12=>_0x2d3f12['id']!==_0x162ac2);}}class So extends wo{['_models']=[];['_defaultModel']=null;constructor(_0x1c2400,_0x14ba9a,_0x4bd366){super(_0x1c2400),this['_models']=_0x14ba9a,this['_defaultModel']=_0x4bd366;}get['models'](){return this['_models'];}get['defaultModel'](){return this['_defaultModel'];}}class bo extends wo{['isExtra']=!0x0;['prompt'];['model'];['_defaultModel']=null;constructor(_0x391ddf,_0x2315bd,_0x3687d8){super(_0x391ddf),this['prompt']=_0x391ddf['prompt'],this['model']=_0x391ddf['model'],this['model']?this['_defaultModel']=_0x2315bd['find'](_0x1db78a=>_0x1db78a['id']===this['model'])||null:this['_defaultModel']=_0x3687d8;}get['defaultModel'](){return this['_defaultModel'];}}class Ro extends fo{['_allModels']=[];['_recommendedModels']=[];['_defaultModel']=null;constructor(_0x388f30,_0x30619a,_0x278698){super(),this['_allModels']=_0x388f30,this['_recommendedModels']=_0x30619a,this['_defaultModel']=_0x278698;}['setupChecks'](_0x50230f){this['_checks']=_0x50230f['map'](_0x420750=>!0x0===_0x420750['isExtra']?new bo(_0x420750,this['_allModels'],this['_defaultModel']):'custom'===_0x420750['id']?new So(_0x420750,this['_recommendedModels'],this['_defaultModel']):new wo(_0x420750));}}class Oo extends To{['_prompt'];['_model'];constructor(_0x3a953f,_0x57a6c6,_0xec35e4,_0x1b14c1,_0x4ab3bc){super(_0xec35e4,_0x1b14c1,_0x4ab3bc),this['_prompt']=_0x3a953f,this['_model']=_0x57a6c6;}get['subTitle'](){return this['_prompt'];}['_createApiRequest'](){return this['_aiConnector']['callCustomReview']({'content':this['_documentData']['content'],'prompt':this['_prompt'],'model':this['_model']});}['_sendRatingRequest'](_0x5184c2,_0xa075d5,_0x2b59c3){return this['_aiConnector']['upsertCustomAIReviewRating'](_0xa075d5,_0x5184c2,_0x2b59c3);}}class ko extends Oo{get['subTitle'](){return'';}set['prompt'](_0x2a7af){this['_prompt']=_0x2a7af;}set['model'](_0x9b192b){this['_model']=_0x9b192b;}}class No extends mo{static get['pluginName'](){return'AIReviewModeController';}['_isDiffOn']=!0x1;['_hasDefaultAvailableCommands']=!0x1;constructor(_0x8e6275){super(_0x8e6275),this['_hasDefaultAvailableCommands']=!this['context']['config']['get']('ai.review.availableCommands'),this['context']['config']['define']('ai.review.availableCommands',Co['map'](_0x5ed368=>_0x5ed368['id'])),this['context']['config']['define']('ai.review.extraCommands',[]);}async['init'](){await super['init'](),this['listenTo'](this['_aiReviewCoreUi'],'toggleDiff',(_0x3817e4,_0x2d4eb7)=>{this['_isDiffOn']=_0x2d4eb7['on'],this['_onDiffChange'](this['_isDiffOn']);});}['_initRequiredPlugins'](){super['_initRequiredPlugins'](),this['_aiReviewCoreUi']=this['context']['plugins']['get']('AIReviewModeUI'),this['_aiReviewCoreEditing']=this['context']['plugins']['get']('AIReviewCoreEditing');}['_createReviewCheckRun'](_0x24c3ed,_0x2f4a75){return _0x24c3ed['isCustom']?new Oo(_0x24c3ed['args']['prompt'],_0x24c3ed['args']['model'],this['_aiReviewCoreEditing']['getDocumentData'](),_0x2f4a75,this['_aiConnector']):_0x2f4a75['isExtra']?new ko(_0x2f4a75['prompt'],_0x2f4a75['defaultModel']['id'],this['_aiReviewCoreEditing']['getDocumentData'](),_0x2f4a75,this['_aiConnector']):new po(this['_aiReviewCoreEditing']['getDocumentData'](),_0x2f4a75,this['_aiConnector'],_0x24c3ed['params'],_0x24c3ed['args']);}['_onReviewCheckResultActivated'](_0x195b27){this['_aiReviewCoreUi']['setActiveStateInResults'](_0x195b27['change']['id']),this['_scrollToChange'](_0x195b27['change']['id']);const _0x50d98a=this['_aiReviewCoreEditing']['getMarkerElementForChange'](_0x195b27['change']['id']);if(!_0x50d98a)return;const _0xe61f4f=this['_aiReviewCoreEditing']['getEditor']();this['_aiReviewCoreUi']['showChangeBalloon'](_0x195b27['change'],()=>_0x50d98a['getElement'](),void 0x0,'click',_0xe61f4f?.['editing']?.['view']?.['getDomRoot'](),_0xe61f4f?.['ui']?.['viewportOffset']),this['_aiReviewCoreEditing']['setMarkersInElementAsActive'](_0x195b27['change']['id']);}['_onReviewCheckResultDeactivated'](){this['_aiReviewCoreUi']['resetActiveStateInResults'](),this['_aiReviewCoreUi']['hideChangeBalloon'](),this['_aiReviewCoreEditing']['setAllMarkersAsInactive']();}['_onActivateChange'](_0x53eec1){this['_currentReviewCheckRun']&&'click'===_0x53eec1['uiInteraction']&&(this['_changeActivationSource']='panel',this['_currentReviewCheckRun']['activateChange'](_0x53eec1['id']));}['_onDeactivateChange'](_0x26e4d2){this['_currentReviewCheckRun']&&'balloon'===_0x26e4d2['origin']&&this['_currentReviewCheckRun']['deactivateChange']();}['_onChangeMarkerClicked'](_0x12cba3,_0x2e24ed){if(!this['_currentReviewCheckRun'])return;this['_changeActivationSource']='content',this['_currentReviewCheckRun']['activateChange'](_0x2e24ed['changeId']);const _0x2f5719=this['_currentReviewCheckRun']['getChangeById'](_0x2e24ed['changeId']);if(!_0x2f5719)return;const _0x30c841=this['_aiReviewCoreEditing']['getEditor']();this['_aiReviewCoreUi']['showChangeBalloon'](_0x2f5719,_0x2e24ed['markerElement'],_0x2e24ed['domEvent'],'click',_0x30c841?.['editing']?.['view']?.['getDomRoot'](),_0x30c841?.['ui']?.['viewportOffset']);}['_onChangeMarkerHovered'](_0x47d1f5,_0x1b178d){if(!this['_currentReviewCheckRun'])return;if(this['_currentReviewCheckRun']['isAnyChangeActivated']())return;const _0x4a3879=this['_currentReviewCheckRun']['getChangeById'](_0x1b178d['changeId']);if(!_0x4a3879)return;const _0x411876=this['_aiReviewCoreEditing']['getEditor']();this['_aiReviewCoreUi']['showChangeBalloon'](_0x4a3879,_0x1b178d['markerElement'],_0x1b178d['domEvent'],'hover',_0x411876?.['editing']?.['view']?.['getDomRoot'](),_0x411876?.['ui']?.['viewportOffset']);}['_onChangeMarkerBlurred'](){if(!this['_currentReviewCheckRun'])return;this['_currentReviewCheckRun']['isAnyChangeActivated']()||this['_aiReviewCoreUi']['hideChangeBalloon']();}['_getChangeContentElement'](_0x228efd){const _0x2d00d9=this['_aiReviewCoreEditing']['getMarkerElementForChange'](_0x228efd);return _0x2d00d9?_0x2d00d9['getElement']():null;}['_markChangePositionInEditorContent'](_0x21d97e,_0x5ba608){this['_aiReviewCoreEditing']['markChangePositionInEditorContent'](_0x21d97e,_0x5ba608);}['_diffContent'](_0x1dd3b6,_0x52394f){return this['_aiReviewCoreEditing']['diffContent'](_0x1dd3b6,_0x52394f);}['_onReviewCheckRun'](){this['_onDiffChange'](this['_isDiffOn']);}['_onDiffChange'](_0x32a54f){const _0x30557c=this['_aiReviewCoreEditing']['getEditor']();_0x32a54f?this['_aiReviewCoreUi']['hideDiffInBalloon']():this['_aiReviewCoreUi']['showDiffInBalloon'](),_0x30557c&&_0x30557c['editing']['view']['change'](_0x5cec2b=>{const _0x5c22aa=_0x30557c['editing']['view']['document']['getRoot']();for(const _0xf6ab83 of _0x5c22aa['getClassNames']())_0xf6ab83['startsWith']('ck-ai_review-')&&_0x5cec2b['removeClass'](_0xf6ab83,_0x5c22aa);_0x5cec2b['addClass'](_0x32a54f?'ck-ai_review-diff':'ck-ai_review-highlights',_0x5c22aa);});}async['_getChecksList'](){const _0x48ee1e=[...Co,...this['_getExtraChecks']()],_0x3d075c=this['context']['config']['get']('ai.review.availableCommands')||[];this['_logErrorForNonExistentChecks'](_0x3d075c,_0x48ee1e);let _0x44f0ae=_0x48ee1e;this['_hasDefaultAvailableCommands']||(_0x44f0ae=_0x3d075c['map'](_0x24595c=>_0x48ee1e['find'](_0x21cb79=>_0x21cb79['id']===_0x24595c))['filter'](_0x2c08c6=>!!_0x2c08c6)),_0x44f0ae=_0x44f0ae['map'](_0x1eed1a=>_0x1eed1a['isExtra']?_0x1eed1a:this['_translateReviewCheck'](_0x1eed1a));const _0x11b3f8=_0x44f0ae['some'](_0x106e43=>_0x106e43['isExtra']||'custom'===_0x106e43['id']);let _0x5c7157=[],_0x353029=[],_0x57633c=null;if(_0x11b3f8){const _0x5ea38b=await this['_getModels']();_0x5c7157=_0x5ea38b['all'],_0x353029=_0x5ea38b['recommended'],_0x57633c=_0x5ea38b['default'];}const _0x4aa161=new Ro(_0x5c7157,_0x353029,_0x57633c);return _0x4aa161['setupChecks'](_0x44f0ae),_0x11b3f8&&this['_filterChecksWithMissingModel'](_0x4aa161),_0x4aa161;}['_getExtraChecks'](){return(this['context']['config']['get']('ai.review.extraCommands')||[])['map'](_0x51605e=>({'id':_0x51605e['id'],'commandId':_0x51605e['id'],'title':_0x51605e['label'],'description':_0x51605e['description'],'isParameterized':!0x1,'isExtra':!0x0,'prompt':_0x51605e['prompt'],'model':_0x51605e['model']}));}['_logErrorForNonExistentChecks'](_0x15bc81,_0x36513d){const _0x414532=_0x15bc81['filter'](_0xfd840a=>!_0x36513d['some'](_0x56127a=>_0x56127a['id']===_0xfd840a));_0x414532['length']&&this['_logError'](new ot('ai-review-mode-non-existent-commands-used',this,{'commandIds':_0x414532['join'](',\x20')}),!0x0);}async['_getModels'](){try{const _0x29a33b=new Bs({'connector':this['_aiConnector'],'config':this['context']['config']['get']('ai.models'),'locale':this['context']['locale']});return{'all':await _0x29a33b['getAll'](),'recommended':await _0x29a33b['getAvailableModels'](),'default':await _0x29a33b['getDefault']()};}catch(_0x442c4e){return this['_logError'](new ot('ai-review-mode-models-unable-to-retrieve',this,void 0x0,_0x442c4e)),{'all':[],'recommended':[],'default':null};}}['_translateReviewCheck'](_0x32ed6c){const _0x2069ef='AI_REVIEW_CHECK_'+_0x32ed6c['id']['toUpperCase']()['replaceAll']('-','_'),_0x355b85={..._0x32ed6c,'title':this['_getTranslationWithDefault'](_0x2069ef+'_TITLE',_0x32ed6c['title']),'description':this['_getTranslationWithDefault'](_0x2069ef+'_DESCRIPTION',_0x32ed6c['description'])};return _0x32ed6c['options']&&(_0x355b85['options']=_0x32ed6c['options']['map'](_0x5d2b2d=>({..._0x5d2b2d,'label':this['_getTranslationWithDefault'](_0x2069ef+'_OPTIONS_LABEL',_0x5d2b2d['label']||''),'data':_0x5d2b2d['data']?_0x5d2b2d['data']['map'](_0x5d7772=>({..._0x5d7772,'label':this['_getTranslationWithDefault'](_0x2069ef+'_OPTIONS_DATA_'+_0x5d7772['id']['toUpperCase'](),_0x5d7772['label'])})):void 0x0}))),_0x355b85;}['_filterChecksWithMissingModel'](_0x2f20ae){const _0x92fdf7=[];_0x2f20ae['checks']['forEach'](_0x5352f1=>{(_0x5352f1 instanceof bo&&!_0x5352f1['defaultModel']||_0x5352f1 instanceof So&&!_0x5352f1['models']['length'])&&_0x92fdf7['push'](_0x5352f1['id']);}),_0x92fdf7['length']&&_0x92fdf7['forEach'](_0x4d7ece=>{_0x2f20ae['removeCheckById'](_0x4d7ece),this['_logError'](new ot('ai-review-mode-command-unavailable-due-to-missing-model',this,{'commandId':_0x4d7ece}),!0x0);});}}class vo extends _0x1f4c78{static get['requires'](){return[No,_o,go];}static get['pluginName'](){return'AIReviewMode';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class yo extends wo{get['apiId'](){return'translate';}}class xo extends fo{['setupChecks'](_0x6cc8c7){this['_checks']=_0x6cc8c7['map'](_0x152338=>new yo(_0x152338));}}class Lo extends po{['_title'];constructor(_0x4547b0,_0x56e66c,_0x3dbb91,_0x397006,_0x21ddc8,_0x1e64a1){super(_0x4547b0,_0x56e66c,_0x3dbb91,_0x21ddc8,_0x1e64a1),this['_title']=_0x397006;}get['title'](){return this['_title'];}get['subTitle'](){return this['_sourceCheck']['title'];}}class Do extends mo{static get['pluginName'](){return'AITranslateController';}constructor(_0x50517c){super(_0x50517c),this['context']['config']['define']('ai.translate.languages',[{'label':'English','id':'english'},{'label':'Spanish','id':'spanish'},{'label':'French','id':'french'},{'label':'German','id':'german'},{'label':'Chinese\x20(Simplified)','id':'chinese'},{'label':'Japanese','id':'japanese'},{'label':'Russian','id':'russian'},{'label':'Portuguese','id':'portuguese'},{'label':'Korean','id':'korean'},{'label':'Italian','id':'italian'}]);}['_onCheckRunFinished'](){this['_onReviewRunLeave'](!0x0);}['_initRequiredPlugins'](){super['_initRequiredPlugins'](),this['_aiReviewCoreUi']=this['context']['plugins']['get']('AITranslateUI'),this['_aiReviewCoreEditing']=this['context']['plugins']['get']('AIReviewCoreEditing');}['_createReviewCheckRun'](_0x13b916,_0xd32ba4){return new Lo(this['_aiReviewCoreEditing']['getDocumentData'](),_0xd32ba4,this['_aiConnector'],as(this['context']['locale'],'AI_REVIEW_CHECK_TRANSLATE_TITLE'),_0x13b916['params'],_0x13b916['args']);}['_onReviewCheckResultActivated'](_0x3a8749){this['_aiReviewCoreUi']['setActiveStateInResults'](_0x3a8749['change']['id']),this['_aiReviewCoreEditing']['setMarkersInElementAsActive'](_0x3a8749['change']['id']);}['_onReviewCheckResultDeactivated'](){this['_aiReviewCoreEditing']['setAllMarkersAsInactive'](),this['_aiReviewCoreUi']['resetActiveStateInResults']();}['_onActivateChange'](_0x3bb6e8){this['_currentReviewCheckRun']&&('hover'===_0x3bb6e8['uiInteraction']&&(this['_changeActivationSource']='panel',this['_currentReviewCheckRun']['activateChange'](_0x3bb6e8['id'])),'click'===_0x3bb6e8['uiInteraction']&&this['_scrollToChange'](_0x3bb6e8['id']));}['_onDeactivateChange'](_0x2a22a9){this['_currentReviewCheckRun']&&'panel'===_0x2a22a9['origin']&&this['_currentReviewCheckRun']['deactivateChange']();}['_onChangeMarkerClicked'](_0x188aa9,_0x435c26){this['_currentReviewCheckRun']&&(this['_changeActivationSource']='content',this['_currentReviewCheckRun']['activateChange'](_0x435c26['changeId']),this['_scrollToChange'](_0x435c26['changeId']));}['_onChangeMarkerHovered'](_0x171ce9,_0xc7d6a8){this['_currentReviewCheckRun']&&(this['_changeActivationSource']='content',this['_currentReviewCheckRun']['activateChange'](_0xc7d6a8['changeId']),this['_aiReviewCoreEditing']['reactivateMarkers'](_0xc7d6a8['changeId']));}['_onChangeMarkerBlurred'](){this['_currentReviewCheckRun']&&'content'===this['_changeActivationSource']&&(this['_currentReviewCheckRun']['deactivateChange'](),this['_aiReviewCoreEditing']['setAllMarkersAsInactive']());}['_getChangeContentElement'](_0x260a51){return this['_aiReviewCoreEditing']['getContentElementForChange'](_0x260a51);}['_markChangePositionInEditorContent'](_0x48c49a,_0x2af557){this['_aiReviewCoreEditing']['markChangePositionInEditorContent'](_0x48c49a,_0x2af557);}['_diffContent'](_0x2c37ab,_0x434351){return this['_aiReviewCoreEditing']['diffContent'](_0x2c37ab,_0x434351,!0x0);}['_onReviewCheckRun'](){const _0x2f7fbd=this['_aiReviewCoreEditing']['getEditor']();_0x2f7fbd&&_0x2f7fbd['editing']['view']['change'](_0x575e0a=>{const _0x51436c=_0x2f7fbd['editing']['view']['document']['getRoot']();for(const _0x10e340 of _0x51436c['getClassNames']())(_0x10e340['startsWith']('ck-ai-review-')||'ck-ai-translate-'===_0x10e340)&&_0x575e0a['removeClass'](_0x10e340,_0x51436c);_0x575e0a['addClass']('ck-ai-translate-mode-content',_0x51436c);});}async['_getChecksList'](){const _0x434c0d=[],_0x3638fa=this['context']['config']['get']('ai.translate.languages')||[];for(const _0x10a1e3 of _0x3638fa)_0x434c0d['push']({'title':_0x10a1e3['label'],'id':_0x10a1e3['id'],'commandId':_0x10a1e3['id'],'description':'','isParameterized':!0x1,'useArgs':!0x0,'args':{'language':_0x10a1e3['id']}});const _0x37dac5=new xo();return _0x37dac5['setupChecks'](this['_translateChecks'](_0x434c0d)),_0x37dac5;}['_translateChecks'](_0x2cb8ab){return _0x2cb8ab['map'](_0x4a3a52=>{const _0x1a724e='AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_'+_0x4a3a52['title']['toUpperCase']()['replaceAll']('-','_');return{..._0x4a3a52,'title':this['_getTranslationWithDefault'](_0x1a724e,_0x4a3a52['title'])};});}}class Po extends io{constructor(_0x246d0b,_0x5a9e1d){super(_0x246d0b,_0x5a9e1d),this['on']('set:isLoading',(_0x30c4bb,_0x307401,_0x52281f)=>{_0x52281f&&(this['headerTitle']=as(this['locale'],'AI_TRANSLATE_CHECK_RESULTS_LOADING_TITLE'));}),this['on']('set:isResultReady',(_0x3c8756,_0x5755dd,_0x6aac68)=>{_0x6aac68&&(this['headerTitle']=as(this['locale'],'AI_TRANSLATE_CHECK_RESULTS_READY_TITLE'));});}['_createAcceptAllButtonView'](){const _0x30060a=super['_createAcceptAllButtonView']();return _0x30060a['set']('label',as(this['locale'],'AI_TRANSLATE_ACCEPT_ALL')),_0x30060a;}['_createExitReviewButtonView'](){const _0x212df9=super['_createExitReviewButtonView']();return _0x212df9['set']('label',as(this['locale'],'AI_CHAT_HISTORY_CANCEL')),_0x212df9;}}class Ho extends uo{['_setupTemplate'](){const _0x5b40ee=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-translate__check-list-wrapper',_0x5b40ee['if']('isVisible','ck-hidden',_0x3a121f=>!_0x3a121f)]},'children':[{'tag':'div','attributes':{'class':['ck-ai-translate__check-list-header']},'children':[{'tag':'h2','children':[{'text':as(this['locale'],'AI_TRANSLATE_CHECK_LIST_HEADER_TITLE')}]},{'tag':'p','children':[{'text':as(this['locale'],'AI_TRANSLATE_CHECK_LIST_HEADER_DESCRIPTION')}]}]},{'tag':'div','attributes':{'class':['ck-ai_review__check-list',_0x5b40ee['if']('isVisible','ck-hidden',_0x26964e=>!_0x26964e)]},'children':this['_checkViews']}]});}}class Mo extends Ja{static get['pluginName'](){return'AITranslateUI';}['createMainView'](){const _0x2a2eb9=this['context']['locale'],_0x63e702=new _0x2229a9(_0x2a2eb9,{'label':as(_0x2a2eb9,'AI_REVIEW_CHECK_TRANSLATE_TITLE'),'icon':_0x5d111c,'class':'ck-ai-header\x20ck-ai-header_review-translate'}),_0x4955e6=new to(_0x2a2eb9,{'header':_0x63e702,'list':new Ho(_0x2a2eb9),'results':new Po(_0x2a2eb9,{'generalErrorText':as(_0x2a2eb9,'AI_TRANSLATE_GENERAL_ERROR_MESSAGE')}),'completed':new so(_0x2a2eb9,{'headerText':as(_0x2a2eb9,'AI_TRANSLATE_FINISH_HEADER_TITLE'),'emptyResultsText':as(_0x2a2eb9,'AI_TRANSLATE_EMPTY_RESULTS_TEXT'),'buttonText':as(_0x2a2eb9,'AI_TRANSLATE_FINISH_BUTTON_LABEL')})});return _0x4955e6['extendTemplate']({'attributes':{'class':'ck-ai-translate-mode'}}),_0x4955e6;}['registerTab'](){const _0x25cada=this['context']['plugins']['get']('AITabs');_0x25cada['view']['on']('activateTab',(_0x4b2770,_0x26b3fe)=>{'translate'===_0x26b3fe?this['fire']('getReviewCheckList'):this['fire']('leaveReview');}),_0x25cada['view']['addTab']({'id':'translate','buttonLabel':as(this['context']['locale'],'AI_REVIEW_CHECK_TRANSLATE_TITLE'),'buttonIcon':_0x5d111c,'order':0x0,'content':this['_mainView']});}}class Uo extends _0x1f4c78{static get['requires'](){return[Do,Mo,go];}static get['pluginName'](){return'AITranslate';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}export{qa as AIActions,Si as AIAdapter,qi as AIAssistant,Wi as AIAssistantUI,ma as AIBalloon,la as AIChat,Ys as AIChatController,ca as AIChatHistory,ha as AIChatHistoryController,ra as AIChatHistoryUI,Aa as AIChatShortcuts,Zr as AIChatUI,rs as AIConnector,qs as AIEditing,ba as AIEditorIntegration,Qa as AIQuickActions,Ma as AIQuickActionsUI,bi as AIRequestError,wo as AIReviewCheck,Io as AIReviewCheckResult,To as AIReviewCheckRun,vo as AIReviewMode,mo as AIReviewModeController,go as AIReviewModeEditing,_o as AIReviewModeUI,ns as AITabs,Xi as AITextAdapter,Ia as AIToggleButtonUI,Uo as AITranslate,Do as AITranslateController,Mo as AITranslateUI,ji as AWSTextAdapter,zi as OpenAITextAdapter,Oi as ShowAIAssistantCommand,ga as ToggleAICommand,ls as createResizeButton,Qi as getDefaultAICommands};
23
+ import{Plugin as _0x36293e,Command as _0x1afbde,ContextPlugin as _0x314798,Editor as _0x596f47}from'@ckeditor/ckeditor5-core/dist/index.js';import{IconCopy as _0x5f2d2d,IconCheck as _0xdfeb3f,IconError as _0x205cfd,IconSubmit as _0x5b6899,IconAIHistory as _0x3b8b71,IconMagicWand as _0x4a4492,IconRobotPencil as _0x4a2227,IconMaximize as _0x5aca3e,IconMinimize as _0x44541d,IconShowChangesOn as _0x253243,IconShowChangesOff as _0x3f4cae,IconDocument as _0x5a4ac5,IconBoxWithCross as _0x64c712,IconBoxWithCheck as _0xe59c0a,IconBoxWithMarker as _0x814cf2,IconInfo as _0x4de7b1,IconWeb as _0x1a441e,IconCancel as _0x340c21,IconSelection as _0x2635ff,IconFileUpload as _0x50506b,IconLink as _0x8b24ef,IconBulb as _0x521f8d,IconAI as _0x430e8c,IconPreviousArrow as _0x2d78f7,IconDocumentOutline as _0x52ac02,IconLoupe as _0x1cd5f4,IconPaperClip as _0xf9d5dc,IconBrowseFiles as _0x54f84d,IconDropdownArrow as _0x25d1ac,IconStop as _0x22b394,IconAIChat as _0x4666f3,IconPlus as _0x5a6582,IconPin as _0x39e8db,IconThreeHorizontalDots as _0x4c14d3,IconAIReview as _0x21205e,IconAITranslate as _0x1b974b,IconAIAskAI as _0x2d6639,IconThumbUp as _0x10e04a,IconThumbDown as _0x915dd2,IconChevronDown as _0x3a6014,IconChevronUp as _0x4a4bb0,IconAIQuickActions as _0x1712b4,IconAIChatCommands as _0x290034,IconAIImproveWriting as _0x406d33,IconAIContinueWriting as _0xa98ff3,IconAIGrammarCheck as _0x5694cf,IconAIAdjustLength as _0x20a93c,IconAIChangeTone as _0x282695,IconAIOther as _0x4e8d08,IconRefresh as tt,IconNextArrow as et,IconOutdated as it,IconEye as st,IconEyeCrossedOut as nt,IconChevronRight as rt}from'@ckeditor/ckeditor5-icons/dist/index.js';import{uid as at,CKEditorError as ot,ObservableMixin as ht,global as ct,isVisible as lt,Rect as ut,Collection as dt,FocusTracker as _t,KeystrokeHandler as At,first as gt,logWarning as It,logError as Et,toArray as Tt,EmitterMixin as pt,scrollViewportToShowTarget as mt,insertToPriorityArray as Ct,scrollAncestorsToShowTarget as wt,ResizeObserver as ft,_isMotionReduced as St,getConstrainedViewportRect as bt,DomEmitterMixin as Rt}from'@ckeditor/ckeditor5-utils/dist/index.js';import{ToolbarView as Ot,ButtonView as kt,View as Nt,SpinnerView as vt,IconView as yt,AutocompleteView as xt,ListView as Lt,ListItemGroupView as Dt,ListItemView as Pt,ButtonLabelView as Ht,FocusCycler as Mt,createLabeledTextarea as Ut,Dialog as Vt,createDropdown as Bt,addMenuToDropdown as Gt,MenuBarMenuView as Ft,MenuBarMenuListItemButtonView as Kt,DialogViewPosition as Wt,MenuBarMenuListView as Yt,MenuBarMenuListItemView as $t,BodyCollection as qt,BalloonPanelView as Qt,clickOutsideHandler as Xt,addListToDropdown as zt,UIModel as jt,submitHandler as Jt,LabeledFieldView as Zt,createLabeledInputText as te,FormHeaderView as _0x327048,HighlightedTextView as _0x3526fb,ViewCollection as _0xfc7125,FileDialogButtonView as _0xb44213,InputTextView as _0x4bb053,SearchTextView as _0x363e78,ListItemButtonView as _0xe4a6dc,ButtonLabelWithHighlightView as _0x38f719,DropdownMenuPanelPositioningFunctions as _0x1fb8f6,BalloonToolbar as _0x35185f,FormRowView as _0x439381,TextareaView as _0x270107}from'@ckeditor/ckeditor5-ui/dist/index.js';import{ClipboardPipeline as _0x16edc5,ClipboardMarkersUtils as _0x57a317}from'@ckeditor/ckeditor5-clipboard/dist/index.js';import{ViewDocumentDomEventData as _0x5b6bc6,ViewDataTransfer as _0x275f16,ViewUpcastWriter as _0x37690f,Matcher as _0x3f3632,_DetachOperation as _0x3bae80,_insertIntoModelNodeList as _0x203d47,_removeFromModelNodeList as _0x1a3440,ModelRange as _0x1f3f5a,transformOperationSets as _0x2a4131,ViewDowncastWriter as _0x1fddc9,ModelDocumentFragment as _0x2af830,ModelPosition as _0x57a0b7,ModelTreeWalker as _0x4ae3de,MarkerOperation as _0x56d08f,InsertOperation as _0x1edf03}from'@ckeditor/ckeditor5-engine/dist/index.js';import{unescape as _0x252a29,escape as _0x215ed3,cloneDeep as _0x39542d,escapeRegExp as _0x2459a9,debounce as _0x332bdc}from'es-toolkit/compat';import{createParser as _0x29a215}from'eventsource-parser';import{CloudServices as _0x42a34e}from'@ckeditor/ckeditor5-cloud-services/dist/index.js';import{parseDocument as _0x377a34}from'htmlparser2';import{isTag as _0x373786,findOne as _0x47e0e5,getParent as _0x1192ba,findAll as _0x2ffee2,removeElement as _0x487133,replaceElement as _0x4587bc,prepend as _0x59927b,prependChild as _0x594f4f,appendChild as _0x2767d3,append as _0x447d6a,find as _0x277bff,isComment as _0x66eaac,getChildren as _0x56e17a,textContent as _0x30c743}from'domutils';import _0x1f30d8 from'dom-serializer';import{Document as _0x11b267,Element as ti,Text as _0x45ed29,cloneNode as _0x556121,isDocument as _0x5255ae,isText as _0x1fc8a1,NodeWithChildren as _0x5c9887}from'domhandler';import{MarkdownGfmMdToHtmlDefaultPlugins as _0x527de2,MarkdownGfmMdToHtml as _0x10b843}from'@ckeditor/ckeditor5-markdown-gfm/dist/index.js';import _0x501167 from'rehype-sanitize';import{fixElementSuggestionRange as _0xec531,DocumentCompare as _0x2e7618,DATA_ID_MODEL_ATTRIBUTE as _0x1eb54e,ConfirmMixin as _0x3040aa,getAllMarkersDomElementsSorted as _0xff567f,SuggestionsConversion as _0x403717,DATA_ID_VIEW_ATTRIBUTE as _0xc678c1,getMarkerDomElement as _0x378fe6}from'@ckeditor/ckeditor5-collaboration-core/dist/index.js';import _0x1748b6 from'morphdom';import{diffArrays as _0x27f968}from'diff';const pi='_ungrouppedCommands';function mi(_0x16ebaf,_0x34dfe7){const _0x302d7c=(0x0,_0x34dfe7['t'])('Other');return _0x16ebaf['length']?'groupId'in _0x16ebaf[0x0]?_0x16ebaf:[{'groupId':pi,'groupLabel':_0x302d7c,'order':0x1/0x0,'commands':_0x16ebaf}]:[{'groupId':pi,'groupLabel':_0x302d7c,'order':0x1/0x0,'commands':[]}];}const Ci=globalThis['DataTransfer'],wi='ai-ui';class fi extends _0x36293e{static get['pluginName'](){return'AIAssistantEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const {editor:_0x203b11}=this,_0x154b6b=['ck-fake-ai-selection'];_0x203b11['config']['get']('ai.assistant.useTheme')&&_0x154b6b['push']('ck-ai-assistant-ui_theme'),_0x203b11['conversion']['for']('editingDowncast')['markerToHighlight']({'model':wi,'view':{'classes':_0x154b6b,'priority':0xc}}),_0x203b11['conversion']['for']('editingDowncast')['markerToElement']({'model':wi,'view':(_0x268bcc,{writer:_0x4983ea})=>{if(!_0x268bcc['markerRange']['isCollapsed'])return null;const _0x291d25=_0x4983ea['createUIElement']('span');return _0x4983ea['addClass'](['ck-fake-ai-selection','ck-fake-ai-selection_collapsed'],_0x291d25),_0x291d25;}});}['afterInit'](){!async function(_0x2b2c8b){const _0x5b396d=_0x3b96b5([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]),_0xc0fb26=0x3dffc4e1,_0x17e548=0x3df84301^_0xc0fb26,_0x5ef555=window[_0x3b96b5([0x44,0x61,0x74,0x65])][_0x3b96b5([0x6e,0x6f,0x77])](),_0x48e73f=_0x2b2c8b[_0x3b96b5([0x65,0x64,0x69,0x74,0x6f,0x72])],_0x422bea=new window[(_0x3b96b5([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x1fd137=>{_0x48e73f[_0x3b96b5([0x6f,0x6e,0x63,0x65])](_0x3b96b5([0x72,0x65,0x61,0x64,0x79]),_0x1fd137);}),_0x49fd87={[_0x3b96b5([0x6b,0x74,0x79])]:_0x3b96b5([0x45,0x43]),[_0x3b96b5([0x75,0x73,0x65])]:_0x3b96b5([0x73,0x69,0x67]),[_0x3b96b5([0x63,0x72,0x76])]:_0x3b96b5([0x50,0x2d,0x32,0x35,0x36]),[_0x3b96b5([0x78])]:_0x3b96b5([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]),[_0x3b96b5([0x79])]:_0x3b96b5([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]),[_0x3b96b5([0x61,0x6c,0x67])]:_0x3b96b5([0x45,0x53,0x32,0x35,0x36])},_0x235e56=_0x48e73f[_0x3b96b5([0x63,0x6f,0x6e,0x66,0x69,0x67])][_0x3b96b5([0x67,0x65,0x74])](_0x3b96b5([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79]));async function _0x329512(){let _0x39f829,_0x14ce92=null,_0x480e24=null;try{if(_0x235e56==_0x3b96b5([0x47,0x50,0x4c]))return _0x3b96b5([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]);if(_0x39f829=_0x2bfe46(),!_0x39f829)return _0x3b96b5([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);return _0x39f829[_0x3b96b5([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])]&&(_0x480e24=_0x557c05(_0x39f829[_0x3b96b5([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])],_0x39f829[_0x3b96b5([0x6a,0x74,0x69])])),await _0x1b4c82()?_0x1b49e6()?_0x24d87a()?_0x3b96b5([0x45,0x78,0x70,0x69,0x72,0x65,0x64]):_0x1c688f()?(_0x39f829[_0x3b96b5([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x3b96b5([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e])&&(_0x14ce92=_0x555167(_0x3b96b5([0x45,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e,0x4c,0x69,0x6d,0x69,0x74]))),await _0x1443e1()):_0x3b96b5([0x44,0x6f,0x6d,0x61,0x69,0x6e,0x4c,0x69,0x6d,0x69,0x74]):_0x3b96b5([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]):_0x3b96b5([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}catch{return _0x3b96b5([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}function _0x24d87a(){const _0x278679=[_0x3b96b5([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e]),_0x3b96b5([0x74,0x72,0x69,0x61,0x6c])][_0x3b96b5([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x39f829[_0x3b96b5([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])])?_0x5ef555/0x3e8:0xe10*_0x17e548;return _0x39f829[_0x3b96b5([0x65,0x78,0x70])]<_0x278679;}function _0x1b49e6(){const _0x43cb84=_0x39f829[_0x3b96b5([0x66,0x65,0x61,0x74,0x75,0x72,0x65,0x73])];return!!_0x43cb84&&(!!_0x43cb84[_0x3b96b5([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x3b96b5([0x2a]))||!!_0x43cb84[_0x3b96b5([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x3b96b5([0x41,0x49])));}function _0x1c688f(){const _0x490a83=_0x39f829[_0x3b96b5([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x64,0x48,0x6f,0x73,0x74,0x73])];if(!_0x490a83||0x0==_0x490a83[_0x3b96b5([0x6c,0x65,0x6e,0x67,0x74,0x68])])return!0x0;const {hostname:_0x36a124}=new URL(window[_0x3b96b5([0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e])]['href']);if(_0x490a83[_0x3b96b5([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x36a124))return!0x0;const _0x449938=_0x36a124[_0x3b96b5([0x73,0x70,0x6c,0x69,0x74])](_0x3b96b5([0x2e]));return _0x490a83[_0x3b96b5([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x462059=>_0x462059[_0x3b96b5([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x3b96b5([0x2a])))[_0x3b96b5([0x6d,0x61,0x70])](_0x25ddb8=>_0x25ddb8[_0x3b96b5([0x73,0x70,0x6c,0x69,0x74])](_0x3b96b5([0x2e])))[_0x3b96b5([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x263420=>_0x263420[_0x3b96b5([0x6c,0x65,0x6e,0x67,0x74,0x68])]<=_0x449938[_0x3b96b5([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0x3b96b5([0x6d,0x61,0x70])](_0x2a6132=>Array(_0x449938[_0x3b96b5([0x6c,0x65,0x6e,0x67,0x74,0x68])]-_0x2a6132[_0x3b96b5([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0x3b96b5([0x66,0x69,0x6c,0x6c])](_0x2a6132[0x0]===_0x3b96b5([0x2a])?_0x3b96b5([0x2a]):'')[_0x3b96b5([0x63,0x6f,0x6e,0x63,0x61,0x74])](_0x2a6132))[_0x3b96b5([0x73,0x6f,0x6d,0x65])](_0x4c35d3=>_0x449938[_0x3b96b5([0x65,0x76,0x65,0x72,0x79])]((_0x512d20,_0x24df31)=>_0x4c35d3[_0x24df31]===_0x512d20||_0x4c35d3[_0x24df31]===_0x3b96b5([0x2a])));}function _0x1443e1(){return _0x14ce92&&_0x480e24?new window[(_0x3b96b5([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x3e008b,_0x449ba3)=>{_0x14ce92[_0x3b96b5([0x74,0x68,0x65,0x6e])](_0x3e008b,_0x449ba3),_0x480e24[_0x3b96b5([0x74,0x68,0x65,0x6e])](_0x5c1ee3=>{_0x5c1ee3!=_0x3b96b5([0x56,0x61,0x6c,0x69,0x64])&&_0x3e008b(_0x5c1ee3);},_0x449ba3);}):_0x14ce92||_0x480e24||_0x3b96b5([0x56,0x61,0x6c,0x69,0x64]);}}function _0x557c05(_0x14e88f,_0x101479){return new window[(_0x3b96b5([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x536120=>{if(_0x3ce81a())return _0x536120(_0x3b96b5([0x56,0x61,0x6c,0x69,0x64]));_0x4615c0(),_0x48e73f[_0x3b96b5([0x64,0x65,0x63,0x6f,0x72,0x61,0x74,0x65])](_0x3b96b5([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]));let _0x4cca22=!0x1;const _0x479653=at();function _0x351a92(_0x23964e){return!!_0x23964e&&(typeof _0x23964e===_0x3b96b5([0x6f,0x62,0x6a,0x65,0x63,0x74])||typeof _0x23964e===_0x3b96b5([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]))&&typeof _0x23964e[_0x3b96b5([0x74,0x68,0x65,0x6e])]===_0x3b96b5([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e])&&typeof _0x23964e[_0x3b96b5([0x63,0x61,0x74,0x63,0x68])]===_0x3b96b5([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]);}function _0x238163(_0x555170){_0x2f8b51(_0x555170)[_0x3b96b5([0x74,0x68,0x65,0x6e])](_0xfc7d80=>{if(!_0xfc7d80||_0xfc7d80[_0x3b96b5([0x73,0x74,0x61,0x74,0x75,0x73])]!=_0x3b96b5([0x6f,0x6b]))return _0x3b96b5([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]);return _0x3a4ce6(_0x25b7aa(_0x479653+_0x101479))!=_0xfc7d80[_0x3b96b5([0x76,0x65,0x72,0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6f,0x6e])]?_0x3b96b5([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]):_0x3b96b5([0x56,0x61,0x6c,0x69,0x64]);})[_0x3b96b5([0x74,0x68,0x65,0x6e])](_0x25153a=>(_0x22829c(),_0x25153a),()=>{const _0x53a1d9=_0x98c56a();return null==_0x53a1d9?(_0x22829c(),_0x3b96b5([0x56,0x61,0x6c,0x69,0x64])):_0x3b96b5(_0x5ef555-_0x53a1d9>(0x19f340e1^_0xc0fb26)?[0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]:[0x56,0x61,0x6c,0x69,0x64]);})[_0x3b96b5([0x74,0x68,0x65,0x6e])](_0x536120)[_0x3b96b5([0x63,0x61,0x74,0x63,0x68])](()=>{_0x536120(_0x3b96b5([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});const _0x43dc72=0x3dc92a61^_0xc0fb26;function _0x22829c(){const _0x2e95fd=_0x3b96b5([0x6c,0x6c,0x63,0x74,0x2d])+_0x3a4ce6(_0x25b7aa(_0x14e88f)),_0x2c9f28=_0x1bdea(_0x3a4ce6(window[_0x3b96b5([0x4d,0x61,0x74,0x68])][_0x3b96b5([0x63,0x65,0x69,0x6c])](_0x5ef555/_0x43dc72)));window[_0x3b96b5([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x3b96b5([0x73,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x2e95fd,_0x2c9f28);}function _0x98c56a(){const _0x3f42ef=_0x3b96b5([0x6c,0x6c,0x63,0x74,0x2d])+_0x3a4ce6(_0x25b7aa(_0x14e88f)),_0x5ce7f4=window[_0x3b96b5([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x3b96b5([0x67,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x3f42ef);return _0x5ce7f4?window[_0x3b96b5([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x1bdea(_0x5ce7f4),0x10)*_0x43dc72:null;}function _0x2f8b51(_0x335495){return new window[(_0x3b96b5([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x45690d,_0x1ac16b)=>{_0x335495[_0x3b96b5([0x74,0x68,0x65,0x6e])](_0x45690d,_0x1ac16b),window[_0x3b96b5([0x73,0x65,0x74,0x54,0x69,0x6d,0x65,0x6f,0x75,0x74])](_0x1ac16b,0x3dfe1021^_0xc0fb26);});}}_0x48e73f[_0x3b96b5([0x6f,0x6e])](_0x3b96b5([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),(_0x2c1b95,_0xf1be7c)=>{if(_0xf1be7c[0x0]!=_0x14e88f)return _0x536120(_0x3b96b5([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));_0xf1be7c[0x1]={..._0xf1be7c[0x1],[_0x3b96b5([0x72,0x65,0x71,0x75,0x65,0x73,0x74,0x49,0x64])]:_0x479653};},{[_0x3b96b5([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x3b96b5([0x68,0x69,0x67,0x68])}),_0x48e73f[_0x3b96b5([0x6f,0x6e])](_0x3b96b5([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),_0x24d79e=>{_0x351a92(_0x24d79e[_0x3b96b5([0x72,0x65,0x74,0x75,0x72,0x6e])])&&(_0x4cca22=!0x0,_0x238163(_0x24d79e[_0x3b96b5([0x72,0x65,0x74,0x75,0x72,0x6e])]));},{[_0x3b96b5([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x3b96b5([0x6c,0x6f,0x77])}),_0x422bea[_0x3b96b5([0x74,0x68,0x65,0x6e])](()=>{_0x4cca22||_0x536120(_0x3b96b5([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});});function _0x3ce81a(){return _0x48e73f[_0x3b96b5([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x3b96b5([0x76,0x69,0x65,0x77])][_0x3b96b5([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]==_0x3b96b5([0x61,0x75,0x74,0x6f]);}function _0x4615c0(){_0x48e73f[_0x3b96b5([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x3b96b5([0x76,0x69,0x65,0x77])][_0x3b96b5([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]=_0x3b96b5([0x61,0x75,0x74,0x6f]);}}function _0x555167(_0x56123d){const _0x533000=[new window[(_0x3b96b5([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x529df4=>setTimeout(_0x529df4,0x3df6fa2d^_0xc0fb26)),_0x422bea[_0x3b96b5([0x74,0x68,0x65,0x6e])](()=>new window[(_0x3b96b5([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x23b9a1=>{let _0x2618fc=0x0;_0x48e73f[_0x3b96b5([0x6d,0x6f,0x64,0x65,0x6c])][_0x3b96b5([0x6f,0x6e])](_0x3b96b5([0x61,0x70,0x70,0x6c,0x79,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e]),(_0x495c12,_0x191dcb)=>{_0x191dcb[0x0][_0x3b96b5([0x69,0x73,0x44,0x6f,0x63,0x75,0x6d,0x65,0x6e,0x74,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e])]&&_0x2618fc++,_0x2618fc==(0x3dffc109^_0xc0fb26)&&(_0x23b9a1(),_0x495c12[_0x3b96b5([0x6f,0x66,0x66])]());});}))];return window[_0x3b96b5([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65])][_0x3b96b5([0x72,0x61,0x63,0x65])](_0x533000)[_0x3b96b5([0x74,0x68,0x65,0x6e])](()=>_0x56123d);}async function _0x4faa2f(){await _0x422bea,_0x48e73f[_0x3b96b5([0x6d,0x6f,0x64,0x65,0x6c])][_0x3b96b5([0x63,0x68,0x61,0x6e,0x67,0x65])]=_0x244c31,_0x48e73f[_0x3b96b5([0x6d,0x6f,0x64,0x65,0x6c])][_0x3b96b5([0x65,0x6e,0x71,0x75,0x65,0x75,0x65,0x43,0x68,0x61,0x6e,0x67,0x65])]=_0x244c31,_0x48e73f[_0x3b96b5([0x65,0x6e,0x61,0x62,0x6c,0x65,0x52,0x65,0x61,0x64,0x4f,0x6e,0x6c,0x79,0x4d,0x6f,0x64,0x65])](_0x3b96b5([0x6d,0x6f,0x64,0x65,0x6c]));}function _0x23bef6(_0x1c2c2a){const _0x57da0b=_0x54ee08();_0x48e73f[_0x57da0b]=_0x3b96b5([0x61,0x69,0x4c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79])+_0x1c2c2a,_0x1c2c2a!=_0x3b96b5([0x56,0x61,0x6c,0x69,0x64])&&_0x4faa2f();}function _0x54ee08(){const _0x38584f=window[_0x3b96b5([0x53,0x74,0x72,0x69,0x6e,0x67])](window[_0x3b96b5([0x70,0x65,0x72,0x66,0x6f,0x72,0x6d,0x61,0x6e,0x63,0x65])][_0x3b96b5([0x6e,0x6f,0x77])]())[_0x3b96b5([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](_0x3b96b5([0x2e]),'');let _0x4f5392=_0x3b96b5([0x6e]);for(let _0x19a3a7=0x0;_0x19a3a7<_0x38584f[_0x3b96b5([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x19a3a7+=0x2){let _0x7579d1=window[_0x3b96b5([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x38584f[_0x3b96b5([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x19a3a7,_0x19a3a7+0x2));_0x7579d1>=_0x5b396d[_0x3b96b5([0x6c,0x65,0x6e,0x67,0x74,0x68])]&&(_0x7579d1-=_0x5b396d[_0x3b96b5([0x6c,0x65,0x6e,0x67,0x74,0x68])]),_0x4f5392+=_0x5b396d[_0x7579d1];}return _0x4f5392;}function _0x2bfe46(){const _0x1a4701=_0x235e56[_0x3b96b5([0x73,0x70,0x6c,0x69,0x74])](_0x3b96b5([0x2e]));if(0x3!=_0x1a4701[_0x3b96b5([0x6c,0x65,0x6e,0x67,0x74,0x68])])return null;return _0x4d6f2b(_0x1a4701[0x1]);function _0x4d6f2b(_0xc6dca8){const _0x5a1856=_0x23aab0(_0xc6dca8);return _0x5a1856&&_0xb849dd()?_0x5a1856:null;function _0xb849dd(){const _0x4c1afe=_0x5a1856[_0x3b96b5([0x6a,0x74,0x69])],_0x19d5b0=window[_0x3b96b5([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x4c1afe[_0x3b96b5([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x4c1afe[_0x3b96b5([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8),0x10),_0xdf4467={..._0x5a1856,[_0x3b96b5([0x6a,0x74,0x69])]:_0x4c1afe[_0x3b96b5([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](0x0,_0x4c1afe[_0x3b96b5([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8)};return delete _0xdf4467[_0x3b96b5([0x76,0x63])],_0x25b7aa(_0xdf4467)==_0x19d5b0;}}}async function _0x1b4c82(){let _0x5de06a=!0x0;try{const _0x2a7ed8=_0x235e56[_0x3b96b5([0x73,0x70,0x6c,0x69,0x74])](_0x3b96b5([0x2e])),[_0x163cd6,_0x17829d,_0x1013ed]=_0x2a7ed8;return _0x36cbd2(_0x163cd6),await _0xe889b3(_0x163cd6,_0x17829d,_0x1013ed),_0x5de06a;}catch{return!0x1;}function _0x36cbd2(_0x2e01ef){const _0x236e10=_0x23aab0(_0x2e01ef);_0x236e10&&_0x236e10[_0x3b96b5([0x61,0x6c,0x67])]==_0x3b96b5([0x45,0x53,0x32,0x35,0x36])||(_0x5de06a=!0x1);}async function _0xe889b3(_0xa37bb7,_0x1d2a4b,_0x12cc77){const _0x42bf65=window[_0x3b96b5([0x55,0x69,0x6e,0x74,0x38,0x41,0x72,0x72,0x61,0x79])][_0x3b96b5([0x66,0x72,0x6f,0x6d])](_0x2cc72e(_0x12cc77),_0x135cc0=>_0x135cc0[_0x3b96b5([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](0x0)),_0x73e54e=new window[(_0x3b96b5([0x54,0x65,0x78,0x74,0x45,0x6e,0x63,0x6f,0x64,0x65,0x72]))]()[_0x3b96b5([0x65,0x6e,0x63,0x6f,0x64,0x65])](_0xa37bb7+_0x3b96b5([0x2e])+_0x1d2a4b),_0xfd1ae5=window[_0x3b96b5([0x63,0x72,0x79,0x70,0x74,0x6f])][_0x3b96b5([0x73,0x75,0x62,0x74,0x6c,0x65])];if(!_0xfd1ae5)return;const _0x1c50d0=await _0xfd1ae5[_0x3b96b5([0x69,0x6d,0x70,0x6f,0x72,0x74,0x4b,0x65,0x79])](_0x3b96b5([0x6a,0x77,0x6b]),_0x49fd87,{[_0x3b96b5([0x6e,0x61,0x6d,0x65])]:_0x3b96b5([0x45,0x43,0x44,0x53,0x41]),[_0x3b96b5([0x6e,0x61,0x6d,0x65,0x64,0x43,0x75,0x72,0x76,0x65])]:_0x3b96b5([0x50,0x2d,0x32,0x35,0x36])},!0x1,[_0x3b96b5([0x76,0x65,0x72,0x69,0x66,0x79])]);await _0xfd1ae5[_0x3b96b5([0x76,0x65,0x72,0x69,0x66,0x79])]({[_0x3b96b5([0x6e,0x61,0x6d,0x65])]:_0x3b96b5([0x45,0x43,0x44,0x53,0x41]),[_0x3b96b5([0x68,0x61,0x73,0x68])]:{[_0x3b96b5([0x6e,0x61,0x6d,0x65])]:_0x3b96b5([0x53,0x48,0x41,0x2d,0x32,0x35,0x36])}},_0x1c50d0,_0x42bf65,_0x73e54e)||(_0x5de06a=!0x1);}}function _0x23aab0(_0x4b79dd){return _0x4b79dd[_0x3b96b5([0x73,0x74,0x61,0x72,0x74,0x73,0x57,0x69,0x74,0x68])](_0x3b96b5([0x65,0x79]))?JSON[_0x3b96b5([0x70,0x61,0x72,0x73,0x65])](_0x2cc72e(_0x4b79dd)):null;}function _0x2cc72e(_0x5c7ecd){return window[_0x3b96b5([0x61,0x74,0x6f,0x62])](_0x5c7ecd[_0x3b96b5([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/-/g,_0x3b96b5([0x2b]))[_0x3b96b5([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/_/g,_0x3b96b5([0x2f])));}function _0x25b7aa(_0x581733){let _0xd416d5=0x1505;function _0x9d3e5e(_0x2f5849){for(let _0x358f1b=0x0;_0x358f1b<_0x2f5849[_0x3b96b5([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x358f1b++){const _0xb71577=_0x2f5849[_0x3b96b5([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](_0x358f1b);_0xd416d5=(_0xd416d5<<0x5)+_0xd416d5+_0xb71577,_0xd416d5&=_0xd416d5;}}function _0x514f87(_0x3e9886){Array[_0x3b96b5([0x69,0x73,0x41,0x72,0x72,0x61,0x79])](_0x3e9886)?_0x3e9886[_0x3b96b5([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](_0x514f87):_0x3e9886&&typeof _0x3e9886==_0x3b96b5([0x6f,0x62,0x6a,0x65,0x63,0x74])?Object[_0x3b96b5([0x65,0x6e,0x74,0x72,0x69,0x65,0x73])](_0x3e9886)[_0x3b96b5([0x73,0x6f,0x72,0x74])]()[_0x3b96b5([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](([_0x474a28,_0x1e220b])=>{_0x9d3e5e(_0x474a28),_0x514f87(_0x1e220b);}):_0x9d3e5e(window[_0x3b96b5([0x53,0x74,0x72,0x69,0x6e,0x67])](_0x3e9886));}return _0x514f87(_0x581733),_0xd416d5>>>0x0;}function _0x3a4ce6(_0x49afc6){return _0x49afc6[_0x3b96b5([0x74,0x6f,0x53,0x74,0x72,0x69,0x6e,0x67])](0x10)[_0x3b96b5([0x70,0x61,0x64,0x53,0x74,0x61,0x72,0x74])](0x8,_0x3b96b5([0x30]));}function _0x1bdea(_0x1980ea){return _0x1980ea[_0x3b96b5([0x73,0x70,0x6c,0x69,0x74])]('')[_0x3b96b5([0x72,0x65,0x76,0x65,0x72,0x73,0x65])]()[_0x3b96b5([0x6a,0x6f,0x69,0x6e])]('');}function _0x244c31(){}function _0x3b96b5(_0x4e6227){return _0x4e6227['map'](_0x26962d=>String['fromCharCode'](_0x26962d))['join']('');}_0x23bef6(await _0x329512());}(this);}['showFakeVisualSelection'](){const _0x571fdb=this['editor']['model'];_0x571fdb['change'](_0x50ce53=>{const _0x2ba096=_0x571fdb['document']['selection']['getRanges']();let _0x2726a8=0x0;for(const _0x4f1de0 of _0x2ba096){const _0x2304bf=wi+':'+_0x2726a8;if(_0x571fdb['markers']['has'](_0x2304bf))_0x50ce53['updateMarker'](_0x2304bf,{'range':_0x4f1de0});else{if(_0x4f1de0['start']['isAtEnd']){const _0x4e3ab6=_0x4f1de0['start']['getLastMatchingPosition'](({item:_0x1b0e63})=>!_0x571fdb['schema']['isContent'](_0x1b0e63),{'boundaries':_0x4f1de0});_0x50ce53['addMarker'](_0x2304bf,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x50ce53['createRange'](_0x4e3ab6,_0x4f1de0['end'])});}else _0x50ce53['addMarker'](_0x2304bf,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x4f1de0});}_0x2726a8++;}});}['hideFakeVisualSelection'](){const _0x5b7899=this['editor']['model'],_0xf1883=Array['from'](this['editor']['model']['markers']['getMarkersGroup'](wi));_0xf1883['length']&&_0x5b7899['change'](_0x1e9cce=>{_0xf1883['forEach'](_0x4fb68e=>{_0x1e9cce['removeMarker'](_0x4fb68e);});});}['insertContent'](_0x649c2c,_0xbdc632){const _0xe6fa8b=this['_getAISelection'](),_0xb9a73e=_0xbdc632||_0xe6fa8b['getFirstRange']();this['editor']['model']['canEditAt'](_0xb9a73e)&&this['editor']['model']['change'](_0x4055e3=>{this['hideFakeVisualSelection'](),_0xbdc632||this['_resetContentOfSelectedTableCells'](_0x4055e3,_0xe6fa8b),this['_pasteHTMLUsingClipboard']({'insertAt':_0xb9a73e,'writer':_0x4055e3,'html':_0x649c2c});});}['insertContentBelow'](_0x12f442){const {model:_0xd29423}=this['editor'],_0x289b67=this['_getAISelection']();_0xd29423['change'](()=>{const _0xd449d7=this['_prepareTableInsertBelowPosition'](_0x12f442,_0x289b67)||this['_getDefaultInsertBelowPosition'](_0x289b67);this['insertContent'](_0x12f442,_0xd449d7);});}['_getAISelection'](){const _0x3ff5f5=this['editor']['model'],_0x33d505=Array['from'](_0x3ff5f5['markers']['getMarkersGroup'](wi))['map'](_0x302255=>_0x302255['getRange']());return _0x3ff5f5['createSelection'](_0x33d505);}['_pasteHTMLUsingClipboard']({writer:_0x4cd28d,html:_0x1fb519,insertAt:_0x1ebf38}){const {view:_0x363778}=this['editor']['editing'],_0x4bae81=this['editor']['plugins']['get'](_0x16edc5),_0x6f84c4=new Ci();_0x6f84c4['setData']('text/html',_0x1fb519);const _0x25e8c1=new ClipboardEvent('paste',{'clipboardData':_0x6f84c4}),_0x390561=new _0x5b6bc6(_0x363778,_0x25e8c1,{'dataTransfer':new _0x275f16(_0x6f84c4)});_0x4cd28d['setSelection'](_0x1ebf38);const _0x2eabc4=(_0x4780f7,_0x3fcc38)=>{_0x3fcc38['resultRange']&&_0x4cd28d['setSelection'](_0x3fcc38['resultRange']);};_0x4bae81['once']('contentInsertion',_0x2eabc4,{'priority':'lowest'}),_0x363778['document']['fire']('paste',_0x390561),_0x4bae81['off']('contentInsertion',_0x2eabc4);}['_getDefaultInsertBelowPosition'](_0x4d09f3){const {model:_0x4349d7}=this['editor'],_0x1bd6dd=Array['from'](_0x4d09f3['getSelectedBlocks']());return _0x1bd6dd['length']?_0x4349d7['createPositionAfter'](_0x1bd6dd['pop']()):_0x4d09f3['getLastPosition']();}['_prepareTableInsertBelowPosition'](_0x50af61,_0x5dda95){const {model:_0x18cad3,plugins:_0x8e007c}=this['editor'];if(_0x8e007c['has']('TableUtils')){const _0x3da6af=_0x8e007c['get']('TableUtils')['getSelectedTableCells'](_0x5dda95);if(_0x3da6af['length']){const _0xe6efa4=this['_getTableRowCountFromContent'](_0x50af61),_0x131746=this['_createEmptyTableRows'](_0x3da6af,_0xe6efa4);return _0x18cad3['createPositionAt'](_0x131746,0x0);}}return null;}['_getTableRowCountFromContent'](_0x1a1456){const _0x1a1c54=this['editor']['plugins']['get']('TableUtils'),_0x571e30=this['editor']['data']['parse'](_0x1a1456),_0x47e8c5=Array['from'](_0x571e30['getChildren']())['filter'](_0x508b76=>_0x508b76['is']('element','table'));let _0x18d8ae=0x0;return _0x47e8c5['forEach'](_0x28d0cb=>{_0x18d8ae+=_0x1a1c54['getRows'](_0x28d0cb);}),_0x18d8ae;}['_createEmptyTableRows'](_0x29deb1,_0x2ae390){const _0x493741=this['editor']['plugins']['get']('TableUtils'),_0x5238e5=_0x493741['getRowIndexes'](_0x29deb1),_0x1a72ac=_0x493741['getColumnIndexes'](_0x29deb1),_0xa152ca=_0x5238e5['last']+0x1,_0xea42c7=_0x1a72ac['first'],_0x5a0b9e=_0x29deb1[0x0]['findAncestor']('table');for(let _0x58207f=0x0;_0x58207f<_0x2ae390;_0x58207f++)_0x493741['insertRows'](_0x5a0b9e,{'at':_0xa152ca});return _0x5a0b9e['getChild'](_0xa152ca)['getChild'](_0xea42c7);}['_resetContentOfSelectedTableCells'](_0xeca99e,_0x66220f){const {plugins:_0x3b2793}=this['editor'],{model:_0x3ab939}=_0xeca99e;if(!_0x3b2793['has']('TableUtils'))return;_0x3b2793['get']('TableUtils')['getSelectedTableCells'](_0x66220f)['length']&&_0x3ab939['deleteContent'](_0x66220f);}}class Si extends _0x36293e{static get['pluginName'](){return'AIAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['afterInit'](){if(!this['textAdapter'])throw new ot('aiadapter-text-adapter-not-set',null);}}class bi extends Error{constructor(_0x4f960f){super(_0x4f960f),this['name']='AIRequestError';}}function Ri(_0x540074,_0x58d125,_0x104c72){const t=_0x540074['t'];switch(_0x58d125){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',_0x104c72);case'Error\x20during\x20AI\x20content\x20generation:\x20%0':return t('Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x104c72);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'},_0x104c72);case'AI_ERROR_CONTEXT_LENGTH':return t({'id':'AI_ERROR_CONTEXT_LENGTH','string':'Selected\x20content\x20is\x20too\x20long'});case'AI_ERROR_MODERATION':return t({'id':'AI_ERROR_MODERATION','string':'Requested\x20query\x20does\x20not\x20pass\x20moderation\x20rules'});case'AI_ERROR_AWS_NOT_SUPPORTED':return t({'id':'AI_ERROR_AWS_NOT_SUPPORTED','string':'The\x20AWS\x20integration\x20is\x20no\x20longer\x20supported.\x20Please\x20contact\x20the\x20support.'});case'AI_ERROR_FAILED':return t({'id':'AI_ERROR_FAILED','string':'Failed\x20to\x20communicate\x20with\x20the\x20AI\x20service'});default:return _0x58d125;}}class Oi extends _0x1afbde{['_commandDefinitions'];constructor(_0x2a153f,_0x4f828f){super(_0x2a153f),this['_commandDefinitions']=_0x4f828f,this['set']('enabledCommandsIds',[]),this['on']('change:_hasContext',(_0x344f0,_0x3e49d1,_0x555418)=>{this['isEnabled']&&(this['enabledCommandsIds']=ki(this['_commandDefinitions'],_0x555418));}),this['set']('_hasContext',!0x1),this['on']('change:isEnabled',(_0x2fc83d,_0x228a35,_0x1d03f0)=>{this['enabledCommandsIds']=_0x1d03f0?ki(this['_commandDefinitions'],this['_hasContext']):[];});}['refresh'](){const _0x3c656e=this['editor']['model'];this['_hasContext']=function(_0x18faae){const _0x469234=_0x18faae['document']['selection'];return _0x469234['isCollapsed']?0x0!==[..._0x469234['getSelectedBlocks']()]['length']&&![..._0x469234['getSelectedBlocks']()][0x0]['isEmpty']:!!_0x18faae['hasContent'](_0x469234['getFirstRange']());}(_0x3c656e);const _0x182461=_0x3c656e['document']['selection'],_0x10f7a3=this['editor']['config']['get']('ai.assistant.disabledElements');for(const _0x1b96a3 of _0x182461['getRanges']())for(const _0x2105c8 of _0x1b96a3['getItems']())if(_0x2105c8['is']('element')&&_0x10f7a3['includes'](_0x2105c8['name']))return void(this['isEnabled']=!0x1);this['isEnabled']=!0x0;}['execute'](_0x2bc8fd='',_0x6d9afc='',_0x1f977f='custom'){this['editor']['plugins']['get'](Wi)['showUI'](_0x2bc8fd,_0x6d9afc,_0x1f977f);}}function ki(_0x24c017,_0x258dfb){const _0x38aad6=new Set();for(const _0x30864b of _0x24c017['values']())(_0x258dfb||!0x1===_0x30864b['requiresContent'])&&_0x38aad6['add'](_0x30864b['id']);return Array['from'](_0x38aad6);}const Ni=new RegExp(/^(.*?)<[a-zA-Z][a-zA-Z0-9_\-.]*[ >]/,'is');class vi extends/* #__PURE__ -- @preserve */
24
+ ht(){['editor'];['textAdapter'];['view'];['_sanitizationContainer'];['_domParser'];['_xmlSerializer'];constructor(_0x22b18b,_0x4857ac,_0x471081){super(),this['editor']=_0x22b18b,this['textAdapter']=_0x4857ac,this['_sanitizationContainer']=document['createElement']('div'),this['_domParser']=new DOMParser(),this['_xmlSerializer']=new XMLSerializer(),this['view']=_0x471081,this['set']({'initialContext':'','currentContext':'','currentResponse':'','previousContext':void 0x0,'previousQuery':void 0x0,'previousLabel':void 0x0,'isProcessing':!0x1}),this['on']('set:currentContext',(_0x4d359f,_0x4b086e,_0x3fbfe8)=>{this['view']['value']=this['_sanitizeHTML'](_0x3fbfe8);}),this['listenTo'](this['view'],'submitPrompt',(_0xa130d8,_0x4da806)=>{const _0x53931a=this['currentContext']||this['initialContext'];this['_handleQuery'](_0x4da806,_0x53931a,'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:_0x128b58,query:_0x436b3e,htmlContent:_0x8916f9,label:_0x474f30,mainActionLabel:_0xfa1c61}){this['view']['prompt']=_0x474f30,this['view']['mainAction']=_0xfa1c61,this['initialContext']=_0x8916f9,_0x436b3e&&(this['view']['isRendered']?this['_handleQuery'](_0x436b3e,_0x8916f9,_0x128b58,_0x474f30):this['view']['once']('render',()=>{this['_handleQuery'](_0x436b3e,_0x8916f9,_0x128b58,_0x474f30);}));}['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'](_0x15de86,_0x147de1,_0x5a7c69,_0xd9bda9){return this['isProcessing']=!0x0,this['view']['startProcessing'](),this['previousContext']=_0x147de1,this['previousQuery']=_0x15de86,this['previousLabel']=_0xd9bda9||_0x15de86,this['previousActionId']=_0x5a7c69,new Promise(_0x3e7d4c=>{this['textAdapter']['makeRequest']({'query':_0x15de86,'context':_0x147de1,'onData':_0x453a2d=>{this['currentResponse']=_0x453a2d,this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse']);},'actionId':_0x5a7c69})['then'](()=>{!this['currentContext']&&this['currentResponse']&&(this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse'],!0x0));})['catch'](_0x514dfb=>{_0x514dfb instanceof bi?this['view']['handleError'](_0x514dfb['message']):this['view']['handleError'](),_0x3e7d4c();})['finally'](()=>{this['stopProcessing'](),_0x3e7d4c();});});}['_parseAndNormalizeContent'](_0x4e3575,_0x46ba9c=!0x1){const _0x3bfc11=Ni['exec'](_0x4e3575);_0x4e3575=_0x3bfc11?_0x4e3575['substring'](_0x3bfc11[0x1]['length']):_0x4e3575['length']<0x64&&!_0x46ba9c?'':this['_stripMarkdownSyntax'](_0x4e3575);const _0x31b9f3=this['_domParser']['parseFromString'](_0x4e3575,'text/html');if(_0x3bfc11){const _0x4d7e7a=Array['from'](_0x31b9f3['body']['childNodes']);_0x4d7e7a['reverse']();for(const _0x12eebc of _0x4d7e7a){if(_0x12eebc['nodeType']==Node['ELEMENT_NODE'])break;_0x12eebc['remove']();}}const _0x3a8c33=this['editor']['data']['processor']['toView'](this['_xmlSerializer']['serializeToString'](_0x31b9f3['body']));this['_isH1TagSupportEnabled']()||this['_normalizeResponseHeadings'](_0x3a8c33);const _0x230ccc=this['editor']['config']['get']('ai.assistant.preserveComments'),_0x29b6ad=this['editor']['data']['toModel'](_0x3a8c33);return _0x230ccc||_0x29b6ad['markers']['clear'](),this['editor']['data']['stringify'](_0x29b6ad);}['_normalizeResponseHeadings'](_0x29616c){const _0x1879c9=new _0x37690f(this['editor']['editing']['view']['document']),_0x599e06=new _0x3f3632({'name':/^h[1-5]$/}),_0xdeeeb0=[];let _0x3ff6a6=!0x1;for(const _0x4b734a of _0x29616c)_0x4b734a['is']('element')&&_0x599e06['match'](_0x4b734a)&&(_0xdeeeb0['push'](_0x4b734a),'h1'==_0x4b734a['name']&&(_0x3ff6a6=!0x0));if(_0x3ff6a6){for(const _0x48ef37 of _0xdeeeb0)_0x1879c9['rename']('h'+(parseInt(_0x48ef37['name'][0x1])+0x1),_0x48ef37);}}['_isH1TagSupportEnabled'](){const {data:_0x1fdb37,editing:_0x1db9fc}=this['editor'],_0x586519=_0x1fdb37['htmlProcessor']['toView']('<h1></h1>'),_0xbbb43f=_0x1fdb37['toView'](_0x1fdb37['toModel'](_0x586519));return!!_0x1db9fc['view']['domConverter']['viewToDom'](_0xbbb43f)['querySelector']('h1');}['_sanitizeHTML'](_0x3a905e){return this['editor']['editing']['view']['domConverter']['setContentOf'](this['_sanitizationContainer'],_0x3a905e),this['_sanitizationContainer']['innerHTML'];}['_stripMarkdownSyntax'](_0x2f6ec6){const _0x448df7=_0x2f6ec6['trim']();return _0x448df7['startsWith']('```html')?_0x448df7['endsWith']('```')?_0x448df7['substring'](0x7,_0x448df7['length']-0x3):_0x448df7['substring'](0x7):_0x2f6ec6;}}const yi={'REPLACE':'replace','INSERT':'insert'};class xi extends Ot{constructor(_0x16d50f){super(_0x16d50f),this['set']('isVisible',!0x1),this['set']('mainAction',yi['REPLACE']),this['replaceButton']=this['_createButton']('','ck-button-action'),this['replaceButton']['bind']('label')['to'](this,'mainAction',_0x2fa2d6=>Ri(_0x16d50f,'AI_'+_0x2fa2d6['toUpperCase']()+'_CONTENT')),this['insertButton']=this['_createButton'](Ri(_0x16d50f,'Insert\x20below')),this['tryAgainButton']=this['_createButton'](Ri(_0x16d50f,'Try\x20again')),this['stopButton']=this['_createButton'](Ri(_0x16d50f,'Stop'));const _0xa8251a=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-form__toolbar',_0xa8251a['if']('isVisible','ck-hidden',_0x525c04=>!_0x525c04)]}}),this['items']['addMany']([this['replaceButton'],this['insertButton'],this['tryAgainButton'],this['stopButton']]);}['_createButton'](_0x5bdda7,_0x43b0fe){const _0x436b3b=new kt(this['locale']);return _0x436b3b['set']({'label':_0x5bdda7,'class':_0x43b0fe||'','isVisible':!0x0,'withText':!0x0}),_0x436b3b;}}class Li extends Nt{['contentFieldView'];['copyButtonView'];constructor(_0xa12f32,_0x2126d5=''){super(_0xa12f32),this['set']({'value':null,'isVisible':!0x1,'isProcessing':!0x1});const _0x1f9454=this['bindTemplate'];this['contentFieldView']=new Di(_0xa12f32,_0x2126d5),this['copyButtonView']=this['_createCopyButton'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area-wrapper',_0x1f9454['if']('isVisible','ck-hidden',_0x4b44a3=>!_0x4b44a3)],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area',_0x1f9454['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 _0x32c347=!0x1;this['on']('change:value',(_0x56ef59,_0x10a30f,_0xdb29c)=>{const _0xd8df66=!this['contentFieldView']['element']['querySelector']('.ck-ai-form__loader');this['contentFieldView']['setContent'](_0xdb29c),this['isProcessing']&&_0xd8df66&&!_0x32c347&&this['element']['scrollTo']({'top':this['element']['scrollHeight'],'behavior':'smooth'});}),this['on']('change:isProcessing',(_0x13adda,_0x24562f,_0x78b524)=>{_0x32c347=!0x1,_0x78b524?(this['value']=null,this['contentFieldView']['appendLoader']()):this['value']||this['contentFieldView']['setContent']('');}),this['listenTo'](this['element'],'wheel',()=>{_0x32c347=!0x0;}),this['listenTo'](this['element'],'mousedown',()=>{_0x32c347=!0x0;});}['focus'](){this['element']['focus']();}['_createCopyButton'](){const _0x10bbb3=this['locale'],_0x5e49c6=new kt(this['locale']),_0x1754ba='ck-ai-form__copy-button';return _0x5e49c6['set']({'label':Ri(_0x10bbb3,'Copy'),'icon':_0x5f2d2d,'class':_0x1754ba,'tooltip':!0x0}),_0x5e49c6['bind']('isVisible')['to'](this,'value',_0x31604c=>!!_0x31604c),_0x5e49c6['bind']('isEnabled')['to'](this,'isProcessing',_0x58f631=>!_0x58f631),_0x5e49c6['on']('execute',()=>{this['_copyHTMLToClipboard'](this['contentFieldView']['element']),_0x5e49c6['icon']=_0xdfeb3f,_0x5e49c6['class']=_0x1754ba+'\x20ck-ai-form__copy-button--copied',this['focus'](),setTimeout(()=>{_0x5e49c6['icon']=_0x5f2d2d,_0x5e49c6['class']=_0x1754ba;},0x3e8);}),_0x5e49c6;}['_copyHTMLToClipboard'](_0x5bb299){const {window:_0x3c24dd,document:_0x656d2b}=ct;if(_0x3c24dd['ClipboardItem']){const {Blob:_0x1f1069,ClipboardItem:_0x5c0b74}=_0x3c24dd,_0x2465b2=[new _0x5c0b74({'text/html':new _0x1f1069([_0x5bb299['innerHTML']],{'type':'text/html'}),'text/plain':new _0x1f1069([_0x5bb299['textContent']||''],{'type':'text/plain'})})];navigator['clipboard']['write'](_0x2465b2);}else{const _0x362021=_0x656d2b['createElement']('div');_0x362021['style']['position']='absolute',_0x362021['style']['left']='-9999px',_0x362021['innerHTML']='<span>[</span>'+_0x5bb299['innerHTML']+'<span>]</span>',_0x656d2b['body']['appendChild'](_0x362021);const _0x59481b=_0x656d2b['createRange']();_0x59481b['setStartAfter'](_0x362021['firstElementChild']),_0x59481b['setEndBefore'](_0x362021['lastElementChild']);const _0x350f73=_0x3c24dd['getSelection']();_0x350f73['removeAllRanges'](),_0x350f73['addRange'](_0x59481b),_0x656d2b['execCommand']('copy'),_0x362021['remove']();}}}class Di extends Nt{constructor(_0x359fde,_0xa13905=''){super(_0x359fde),this['loaderView']=this['_createLoader'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content',_0xa13905,'ck-reset_all-excluded','ck-ai-form__content-field']}});}['setContent'](_0xbb1d9e){this['element']['innerHTML']=_0xbb1d9e;}['appendLoader'](){this['element']['appendChild'](this['loaderView']['element']);}['_createLoader'](){const _0x284c95=new Nt(),_0x3e0fa6=this['locale'],_0x5839b1=new vt();return _0x5839b1['isVisible']=!0x0,_0x284c95['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__loader']},'children':[_0x5839b1,{'text':Ri(_0x3e0fa6,'AI\x20is\x20writing...')}]}),_0x284c95['render'](),_0x284c95;}}class Pi extends Nt{constructor(_0x112500,_0x11224d=''){super(_0x112500);const _0x3fec59=new yt(),_0x5c1d3=this['bindTemplate'];this['set']('text',_0x11224d),_0x3fec59['content']=_0x205cfd,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__error']},'children':[_0x3fec59,{'text':_0x5c1d3['to']('text')}]});}}class Hi extends xt{['submitButtonView'];['showHistoryButtonView'];constructor(_0xbd0068,_0x4345fa){super(_0xbd0068,_0x4345fa),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',(_0x1f4acc,_0x2d64b4)=>{_0x1f4acc['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0x2d64b4());});}['_createSubmitButton'](){const _0x4ebce2=new kt(this['locale']),_0x587f6e=this['locale'];return _0x4ebce2['set']({'icon':_0x5b6899,'label':Ri(_0x587f6e,'Submit'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-form__submit'}),_0x4ebce2['on']('execute',()=>{this['submit']();}),_0x4ebce2['bind']('isEnabled')['to'](this['queryView']['fieldView'],'isEmpty',this,'isEnabled',(_0x4924fb,_0x48cd5d)=>!_0x4924fb&&_0x48cd5d),_0x4ebce2;}['_createShowHistoryButton'](){const _0x233117=new kt(this['locale']),_0x58860b=this['resultsView'],_0x237320=this['locale'];_0x233117['set']({'label':Ri(_0x237320,'History'),'withText':!0x1,'icon':_0x3b8b71,'tooltip':!0x0,'tooltipPosition':'sw','class':'ck-ai-form__toggle-history'}),_0x233117['bind']('isOn')['to'](_0x58860b,'isVisible'),_0x233117['bind']('isEnabled')['to'](this,'isEnabled'),_0x233117['on']('execute',()=>{_0x58860b['isVisible']=!_0x58860b['isVisible'],_0x58860b['isVisible']?this['filteredView']['focus']():this['focus']();});const _0x34c572=()=>{ct['window']['requestAnimationFrame'](()=>{if(lt(this['element'])){const _0x5204c1=new ut(this['queryView']['fieldView']['element']),_0x205366=_0x5204c1['width'],_0x10b6c9='rtl'===_0x237320['uiLanguageDirection']?'left':'right';_0x5204c1['excludeScrollbarsAndBorders'](),_0x233117['element']['style'][_0x10b6c9]=_0x205366-_0x5204c1['width']+0x1+'px';}});};return this['queryView']['fieldView']['on']('update',_0x34c572),this['on']('render',_0x34c572),_0x233117;}['submit'](){const _0x4d18c6=this['queryView']['fieldView']['element']['value'];this['fire']('submit',_0x4d18c6);}['focus'](_0x12a173){-0x1===_0x12a173?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}}class Mi extends Lt{['historyGroupView'];['clearHistoryButton'];constructor(_0x21a67c){super(_0x21a67c),this['clearHistoryButton']=this['_createClearHistoryButton'](),this['historyGroupView']=new Dt(),this['historyGroupView']['children']['add'](this['clearHistoryButton'],0x1),this['historyGroupView']['label']=Ri(_0x21a67c,'Prompt\x20history'),this['historyGroupView']['items']['delegate']('execute')['to'](this),this['items']['add'](this['historyGroupView']);}['filter'](){let _0x34c8d1=0x0;for(const _0x5a3694 of this['items'])_0x34c8d1+=_0x5a3694['items']['length'];return{'resultsCount':_0x34c8d1,'totalItemsCount':_0x34c8d1};}['_createClearHistoryButton'](){const _0x42b687=this['locale'],_0xde43c8=new kt(this['locale']);return _0xde43c8['set']({'label':'('+Ri(_0x42b687,'Clear')+')','withText':!0x0}),_0xde43c8['on']('execute',()=>this['fire']('clearHistory')),_0xde43c8;}}class Ui extends Pt{constructor(_0x4b4ecf){super();const _0xb8be19=new Ht(),_0x549fba=new kt(this['locale'],_0xb8be19);this['children']['add'](_0x549fba),_0x549fba['set']({'label':_0x4b4ecf['prompt'],'withText':!0x0}),_0x549fba['on']('execute',()=>{this['fire']('execute',{'value':_0x252a29(_0x4b4ecf['prompt'])});});}}const Vi='CKEditor/AIFormView/PromptHistory';class Bi extends dt{constructor(){super(),this['_loadFromSessionStorage'](),this['on']('add',(_0x524844,_0x580436)=>{const _0x493835=Gi(_0x580436['prompt']);for(const _0x1ed466 of this)if(_0x1ed466!=_0x580436&&Gi(_0x1ed466['prompt'])===_0x493835){this['remove'](_0x1ed466);break;}this['length']>0x14&&this['remove'](this['last']),this['_saveToSessionStorage']();}),this['on']('remove',()=>{this['_saveToSessionStorage']();});}['_loadFromSessionStorage'](){const _0xed86d1=sessionStorage['getItem'](Vi)||'[]';this['addMany'](JSON['parse'](_0xed86d1));}['_saveToSessionStorage'](){sessionStorage['setItem'](Vi,JSON['stringify'](this['map'](_0x4e5f19=>_0x4e5f19)));}}function Gi(_0x40fbc9){return _0x40fbc9['toLowerCase']()['trim']();}class Fi extends Nt{['focusTracker'];['keystrokes'];['contentArea'];['toolbar'];['promptView'];['errorView'];['_focusables'];['focusCycler'];['_promptHistory'];constructor(_0x9a467e,_0xa38ee8,_0x30dd11=''){super(_0x9a467e),this['set']('isEnabled',!0x0),this['set']('isProcessing',!0x1),this['set']('prompt',''),this['set']('value',''),this['set']('isError',!0x1),this['set']('mainAction',yi['REPLACE']),this['_promptHistory']=new Bi(),this['errorView']=new Pi(_0x9a467e),this['contentArea']=new Li(_0x9a467e,_0x30dd11),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 _t(),this['keystrokes']=new At(),this['_focusables']=this['createCollection']([this['contentArea'],this['contentArea']['copyButtonView'],this['toolbar'],this['promptView']]),this['focusCycler']=new Mt({'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 _0x4b097f=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form',_0xa38ee8],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form-content']},'children':[{'tag':'div','attributes':{'class':[_0x4b097f['if']('isError','ck-hidden',_0x179e1e=>!_0x179e1e)]},'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'](_0x110bb7=0x1){-0x1===_0x110bb7?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 _0x7c6c59=this['locale'],_0x16b33e=new Hi(_0x7c6c59,{'queryView':{'label':Ri(_0x7c6c59,'Ask\x20AI\x20to\x20edit\x20or\x20generate'),'creator':Ut,'showIcon':!0x1,'showResetButton':!0x1},'infoView':{'text':{'noSearchableItems':{'primary':Ri(_0x7c6c59,'Empty\x20history'),'secondary':Ri(_0x7c6c59,'Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.')}}},'filteredView':this['_createHistoryView'](),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1});return _0x16b33e['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x503c49,_0x749e13)=>_0x503c49&&!_0x749e13),this['listenTo'](_0x16b33e,'submit',(_0x8fb043,_0x2b7432)=>{this['prompt']=_0x2b7432;const _0x4ae3f5=_0x215ed3(_0x2b7432);this['fire']('submitPrompt',_0x4ae3f5),_0x2b7432['trim']()&&this['_promptHistory']['add']({'prompt':_0x4ae3f5},0x0);},{'priority':'high'}),_0x16b33e;}['_createHistoryView'](){const _0x4403dc=new Mi(this['locale']);return _0x4403dc['historyGroupView']['items']['bindTo'](this['_promptHistory'])['as'](Ui),_0x4403dc['on']('clearHistory',()=>{this['_promptHistory']['clear'](),this['promptView']['search'](''),this['promptView']['focus']();}),_0x4403dc;}['_createToolbar'](){const _0x5b51d6=new xi(this['locale']);return _0x5b51d6['replaceButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x598799,_0x43bee5,_0x1c7332)=>_0x598799&&!_0x43bee5&&!!_0x1c7332),_0x5b51d6['replaceButton']['delegate']('execute')['to'](this,'replaceContent'),_0x5b51d6['insertButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x706666,_0x230bdd,_0x9641fa)=>_0x706666&&!_0x230bdd&&!!_0x9641fa),_0x5b51d6['insertButton']['delegate']('execute')['to'](this,'insertContentBelow'),_0x5b51d6['tryAgainButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x326624,_0x1746f6)=>_0x326624&&!_0x1746f6),_0x5b51d6['tryAgainButton']['delegate']('execute')['to'](this,'tryAgainEvent'),_0x5b51d6['stopButton']['bind']('isEnabled')['to'](this,'isProcessing'),_0x5b51d6['stopButton']['delegate']('execute')['to'](this,'stopProcessing'),_0x5b51d6;}['startProcessing'](){this['value']='',this['isError']=!0x1,this['isProcessing']=!0x0,this['contentArea']['isVisible']=!0x0,this['toolbar']['isVisible']=!0x0,this['contentArea']['focus']();}['finishProcessing'](){const _0xf0ca19=this['locale'];this['isProcessing']=!0x1,this['prompt']='',this['promptView']['reset'](),this['value']&&(this['promptView']['queryView']['label']=Ri(_0xf0ca19,'Ask\x20AI\x20to\x20improve\x20generated\x20text'));}['handleError'](_0x57241f){const _0x3800a0=this['locale'];this['finishProcessing'](),this['isError']=!0x0,this['errorView']['text']=_0x57241f||Ri(_0x3800a0,'AI_ERROR_FAILED'),this['value']||(this['contentArea']['isVisible']=!0x1);}}const Ki=globalThis['DataTransfer'];class Wi extends _0x36293e{['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[_0x57a317,fi,Si,Vt];}constructor(_0x4dbd21){super(_0x4dbd21),_0x4dbd21['config']['define']('ai.assistant.disabledElements',['media','rawHtml','tableOfContents']),_0x4dbd21['config']['define']('ai.assistant.contentAreaCssClass',''),_0x4dbd21['config']['define']('ai.assistant.useTheme',!0x0),this['_uiCssClasses']='ck-ai-assistant-ui'+(_0x4dbd21['config']['get']('ai.assistant.useTheme')?'\x20ck-ai-assistant-ui_theme':'');}['init'](){const {editor:_0x547150}=this;this['_aiAdapter']=_0x547150['plugins']['get'](Si),this['_dialog']=_0x547150['plugins']['get'](Vt),this['_formView']=null,this['_commandDefinitions']=this['_getResolvedCommandsDefinitions']();const _0x33c588=new Oi(_0x547150,Array['from'](this['_commandDefinitions']['values']()));_0x547150['commands']['add']('showAIAssistant',_0x33c588),_0x547150['ui']['componentFactory']['add']('aiCommands',_0xa8f988=>{const _0x227cc0=Bt(_0xa8f988);return _0x227cc0['set']({'class':'ck-ai-commands-dropdown\x20'+this['_uiCssClasses']}),_0x227cc0['buttonView']['set']({'label':Ri(_0xa8f988,'AI\x20Commands'),'icon':_0x4a4492,'tooltip':!0x0}),_0x227cc0['on']('execute',_0x556b90=>this['_onExecute'](_0x556b90['source']['id'])),Gt(_0x227cc0,_0x547150['ui']['view']['body'],function(_0x55d00b){const _0x4fa800=mi(_0x55d00b['config']['get']('ai.assistant.commands'),_0x55d00b['locale']),_0x5d34f4=$i(_0x55d00b,_0x4fa800)['filter'](_0x991dec=>_0x991dec['commands']['length']);if(0x1===_0x5d34f4['length'])return $i(_0x55d00b,_0x5d34f4[0x0]['commands'])['map'](_0x1f967d=>({'id':_0x1f967d['id'],'label':_0x1f967d['label']}));return _0x5d34f4['map'](_0x5d2377=>{const {groupId:_0x460cf1,groupLabel:_0x2382cd,commands:_0x3b359b}=_0x5d2377,_0x2f06e1=$i(_0x55d00b,_0x3b359b)['map'](_0x1e4942=>({'id':_0x1e4942['id'],'label':_0x1e4942['label']}));return{'id':_0x460cf1,'menu':_0x2382cd||_0x460cf1,'children':_0x2f06e1};});}(_0x547150),{'ariaLabel':Ri(_0xa8f988,'AI\x20Commands')}),_0x227cc0['menuView']['menuPanelClass']='ck-ai-commands-dropdown\x20'+this['_uiCssClasses'],_0x33c588['on']('change:enabledCommandsIds',_0x29cad4),_0x227cc0['menuView']['once']('render',_0x29cad4),_0x227cc0;function _0x29cad4(){_0x227cc0['isEnabled']=_0x33c588['enabledCommandsIds']['length']>0x0;for(const _0x5f2e14 of _0x227cc0['menuView']['buttons'])_0x5f2e14['isEnabled']=_0x33c588['enabledCommandsIds']['includes'](_0x5f2e14['id']);}}),_0x547150['ui']['componentFactory']['add']('menuBar:aiCommands',_0x2916cf=>{const _0x17129f=new Ft(_0x2916cf);_0x17129f['buttonView']['set']({'label':Ri(_0x2916cf,'AI\x20Commands'),'icon':_0x4a4492}),_0x17129f['bind']('isEnabled')['to'](_0x33c588,'enabledCommandsIds',_0x358854=>_0x358854['length']>0x0);const _0x4cba8d=mi(_0x547150['config']['get']('ai.assistant.commands'),_0x2916cf);return this['_populateMenuBarMenu'](_0x33c588,_0x17129f,_0x4cba8d,_0x3535fd=>this['_onExecute'](_0x3535fd)),_0x17129f;}),_0x547150['ui']['componentFactory']['add']('aiAssistant',()=>{const _0x1f1a71=this['_createAIAssistantUIButton'](kt);return _0x1f1a71['set']({'tooltip':!0x0,'class':'ck-ai-assistant-button\x20'+this['_uiCssClasses']}),_0x1f1a71;}),_0x547150['ui']['componentFactory']['add']('menuBar:aiAssistant',()=>{const _0x13704b=this['_createAIAssistantUIButton'](Kt);return _0x13704b['set']({'role':'menuitemcheckbox'}),_0x13704b;}),this['licenseKey']=this['editor']['config']['get']('licenseKey');const _0x114c42=this['editor'];this['_licenseKeyCheckInterval']=setInterval(()=>{let _0x1193dc;for(const _0x73f9f in _0x114c42){const _0x1e82d6=_0x73f9f,_0x1816e3=_0x114c42[_0x1e82d6];if('aiLicenseKeyValid'==_0x1816e3||'aiLicenseKeyInvalid'==_0x1816e3||'aiLicenseKeyExpired'==_0x1816e3||'aiLicenseKeyDomainLimit'==_0x1816e3||'aiLicenseKeyNotAllowed'==_0x1816e3||'aiLicenseKeyEvaluationLimit'==_0x1816e3||'aiLicenseKeyUsageLimit'==_0x1816e3){delete _0x114c42[_0x1e82d6],_0x1193dc=_0x1816e3,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'aiLicenseKeyInvalid'==_0x1193dc&&_0x114c42['_showLicenseError']('invalid'),'aiLicenseKeyExpired'==_0x1193dc&&_0x114c42['_showLicenseError']('expired'),'aiLicenseKeyDomainLimit'==_0x1193dc&&_0x114c42['_showLicenseError']('domainLimit'),'aiLicenseKeyNotAllowed'==_0x1193dc&&_0x114c42['_showLicenseError']('featureNotAllowed','AIAssistant'),'aiLicenseKeyEvaluationLimit'==_0x1193dc&&_0x114c42['_showLicenseError']('evaluationLimit'),'aiLicenseKeyUsageLimit'==_0x1193dc&&_0x114c42['_showLicenseError']('usageLimit');},0x3e8);}['destroy'](){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}['showUI'](_0x53814b='',_0x4fb201='',_0x5c0e00='custom'){const _0x5df817=this['editor'],_0x2a6db9=_0x5df817['editing']['view'],_0x3edd33=_0x5df817['plugins']['get'](fi),_0x1ff71b=_0x5df817['plugins']['get'](_0x57a317);_0x3edd33['showFakeVisualSelection']();const _0x4e454e=new Ki(),_0x1658a2=new ClipboardEvent('copy',{'clipboardData':_0x4e454e}),_0x79ee6a=new _0x275f16(_0x4e454e),_0xe57d9d=new _0x5b6bc6(_0x2a6db9,_0x1658a2,{'dataTransfer':_0x79ee6a});_0x1ff71b['_forceMarkersCopy']('comment',()=>{_0x2a6db9['document']['fire']('copy',_0xe57d9d);}),this['_formView']||(this['_initView'](),this['_aiAssistantController']=new vi(_0x5df817,this['_aiAdapter']['textAdapter'],this['_formView']));let _0x4c7a7e=_0x79ee6a['getData']('text/html');const _0x35da10=_0x5df817['model']['document']['selection'],_0x571875=Array['from'](_0x35da10['getRanges']());0x1===_0x571875['length']&&_0x571875[0x0]['isFlat']&&!_0x35da10['getSelectedElement']()&&''!==_0x4c7a7e['replace'](/&nbsp;/g,'')['trim']()&&(_0x4c7a7e='<p>'+_0x4c7a7e+'</p>'),this['_aiAssistantController']['updateView']({'actionId':_0x5c0e00,'query':_0x53814b,'htmlContent':_0x4c7a7e,'label':_0x4fb201,'mainActionLabel':yi[_0x5df817['model']['document']['selection']['isCollapsed']?'INSERT':'REPLACE']}),'aiAssistant'!==this['_dialog']['id']?this['_dialog']['show']({'id':'aiAssistant','icon':_0x4a2227,'title':Ri(this['editor']['locale'],'AI\x20Assistant'),'content':this['_formView'],'position':Wt['EDITOR_TOP_SIDE'],'onShow':()=>{this['_formView']['focus']();},'onHide':()=>{this['_aiAssistantController']['reset'](),_0x3edd33['hideFakeVisualSelection']();}}):this['_dialog']['view']['wasMoved']||this['_dialog']['view']['updatePosition']();}['hideUI'](){this['_dialog']['hide']();}['_getResolvedCommandsDefinitions'](){const _0x3f46a1=new Map(),_0x2472a8=mi(this['editor']['config']['get']('ai.assistant.commands'),this['editor']['locale']);for(const _0x28dc6d of _0x2472a8)for(const _0x4798a0 of _0x28dc6d['commands'])_0x3f46a1['set'](_0x4798a0['id'],{..._0x4798a0,'groupId':_0x28dc6d['groupId'],'groupLabel':_0x28dc6d['groupLabel']||_0x28dc6d['groupId']});return _0x3f46a1;}['_createAIAssistantUIButton'](_0x2169b1){const _0x2e8ec1=this['editor'],_0x35874d=_0x2e8ec1['commands']['get']('showAIAssistant'),_0x5f5925=new _0x2169b1(_0x2e8ec1['locale']);return _0x5f5925['set']({'label':Ri(_0x2e8ec1['locale'],'AI\x20Assistant'),'icon':_0x4a2227,'isToggleable':!0x0}),_0x5f5925['bind']('isEnabled')['to'](_0x35874d),_0x5f5925['bind']('isOn')['to'](this['_dialog'],'id',_0x529e99=>'aiAssistant'===_0x529e99),this['listenTo'](_0x5f5925,'execute',()=>{_0x5f5925['isOn']?this['hideUI']():_0x35874d['execute']();}),_0x5f5925;}['_initView'](){const _0x5afa9b=this['editor']['plugins']['get'](fi);this['_formView']=new Fi(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',()=>{_0x5afa9b['insertContent'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['listenTo'](this['_formView'],'insertContentBelow',()=>{_0x5afa9b['insertContentBelow'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['_initAriaAiStatusChangeAnnouncements']();}['_initAriaAiStatusChangeAnnouncements'](){const {locale:_0x4e715c,ui:{ariaLiveAnnouncer:_0x27cb9f}}=this['editor'];this['_formView']['contentArea']['on']('change:isProcessing',(_0x505381,_0x231f75,_0x1f4f50)=>{const _0x57c641=this['_aiAssistantController']['currentContext'];_0x1f4f50?_0x27cb9f['announce'](Ri(_0x4e715c,'AI\x20is\x20writing')):_0x57c641&&_0x27cb9f['announce'](Ri(_0x4e715c,'Generated\x20content:\x20%0',_0x57c641),{'politeness':'polite','isUnsafeHTML':!0x0});}),this['_formView']['on']('change:isError',(_0x255725,_0x39fa26,_0x18ef41)=>{if(_0x18ef41){const _0x566037=this['_formView']['errorView']['text'];_0x27cb9f['announce'](Ri(_0x4e715c,'Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x566037));}});}['_onExecute'](_0x544672){const _0x1a13b0=this['_commandDefinitions']['get'](_0x544672),_0x54a2a7=this['editor'],_0x4d2b40=_0x54a2a7['model']['document']['selection'],_0x456923=_0x54a2a7['commands']['get']('showAIAssistant'),_0xcc8136=_0x54a2a7['plugins']['get'](fi),_0x428e32=''+(_0x1a13b0['groupId']!==pi?_0x1a13b0['groupLabel']+':\x20':'')+_0x1a13b0['label'];if(!0x1!==_0x1a13b0['requiresContent']&&_0x4d2b40['isCollapsed']){const _0xaebf40=gt(_0x4d2b40['getSelectedBlocks']())||_0x54a2a7['model']['schema']['getLimitElement'](_0x4d2b40);_0x54a2a7['model']['change'](_0x2eed0f=>{_0x2eed0f['setSelection'](_0xaebf40,'in');});}_0xcc8136['showFakeVisualSelection'](),_0x456923['execute'](_0x1a13b0['prompt'],_0x428e32,'command:'+_0x544672);}['_populateMenuBarMenu'](_0x447204,_0x3b7bab,_0x379765,_0x27452f){const _0x216196=this['editor'],_0x3aef05=_0x216196['locale'],_0x4d1f22=new Yt(_0x3aef05),_0xf9024c=$i(_0x216196,_0x379765)['filter'](_0x39c092=>_0x39c092['commands']['length']);0x1===_0xf9024c['length']?this['_getMenuBarGroupButtons']({'command':_0x447204,'commands':_0xf9024c[0x0]['commands'],'parentMenuView':_0x3b7bab,'onExecute':_0x27452f})['forEach'](_0x122f88=>_0x4d1f22['items']['add'](_0x122f88)):_0xf9024c['forEach'](({groupId:_0x508aae,groupLabel:_0x4051e6,commands:_0xc6e1e9})=>{const _0x34a7ab=new $t(_0x3aef05,_0x3b7bab),_0xb5caed=new Ft(_0x3aef05),_0x470138=new Yt(_0x3aef05),_0x4ab99d=this['_getMenuBarGroupButtons']({'command':_0x447204,'commands':_0xc6e1e9,'parentMenuView':_0xb5caed,'onExecute':_0x27452f});_0xb5caed['buttonView']['set']({'label':_0x4051e6||_0x508aae}),_0xb5caed['delegate']('execute')['to'](_0x3b7bab),_0x470138['items']['addMany'](_0x4ab99d),_0xb5caed['panelView']['children']['add'](_0x470138),_0x34a7ab['children']['add'](_0xb5caed),_0x4d1f22['items']['add'](_0x34a7ab);}),_0x3b7bab['panelView']['children']['add'](_0x4d1f22);}['_getMenuBarGroupButtons']({command:_0x38e5c8,commands:_0x3188bc,parentMenuView:_0x1e5b56,onExecute:_0x4946cc}){const _0x356e00=this['editor'],_0xf8b519=_0x356e00['locale'];return $i(_0x356e00,_0x3188bc)['map'](_0x1ddcad=>{const _0xc79ae9=new $t(_0xf8b519,_0x1e5b56),_0x3bba10=new Kt(_0xf8b519);return _0x3bba10['set']({'label':_0x1ddcad['label']}),_0x3bba10['delegate']('execute')['to'](_0x1e5b56),_0x3bba10['on']('execute',()=>_0x4946cc(_0x1ddcad['id'])),_0x3bba10['bind']('isEnabled')['to'](_0x38e5c8,'enabledCommandsIds',_0x7dc7fd=>_0x7dc7fd['includes'](_0x1ddcad['id'])),_0xc79ae9['children']['add'](_0x3bba10),_0xc79ae9;});}}function Yi(_0x11813d,_0x15c134){return void 0x0!==_0x11813d['order']&&void 0x0===_0x15c134['order']?0x1:void 0x0===_0x11813d['order']&&void 0x0!==_0x15c134['order']?-0x1:void 0x0!==_0x11813d['order']&&void 0x0!==_0x15c134['order']?_0x11813d['order']-_0x15c134['order']:0x0;}function $i(_0x45d330,_0x2c9861){_0x2c9861['sort'](Yi);const _0x233a02={},_0x4d38db=[];for(const _0x95f08 of _0x2c9861)if(void 0x0!==_0x95f08['order']){if(_0x95f08['order']in _0x233a02)throw new ot('ai-commands-config-order-collision',_0x45d330,{'conflictingDefinitions':[_0x95f08,_0x233a02[_0x95f08['order']]]});_0x233a02[_0x95f08['order']]=_0x95f08,_0x4d38db['splice'](_0x95f08['order'],0x0,_0x95f08);}else _0x4d38db['push'](_0x95f08);return _0x4d38db;}class qi extends _0x36293e{static get['requires'](){return[Wi,fi];}static get['pluginName'](){return'AIAssistant';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0xead6c0){super(_0xead6c0);const _0x4f00f6=_0xead6c0['config'],_0x1c9be3=_0xead6c0['locale'];_0x4f00f6['define']('ai.assistant.preserveComments',!0x0),_0x4f00f6['define']('ai.assistant.commands',Qi(_0x1c9be3)),_0x4f00f6['define']('ai.assistant.extraCommandGroups',[]),_0x4f00f6['define']('ai.assistant.removeCommands',[]);let _0x54980c=mi(_0x4f00f6['get']('ai.assistant.commands'),_0x1c9be3);const _0x22cacd=_0x4f00f6['get']('ai.assistant.extraCommandGroups'),_0x4af254=_0x4f00f6['get']('ai.assistant.removeCommands');_0x22cacd['forEach'](_0x50700e=>{const _0x4d3456=_0x54980c['find'](_0x167e07=>_0x167e07['groupId']===_0x50700e['groupId']);_0x4d3456?_0x4d3456['commands']=_0x4d3456['commands']['concat'](_0x50700e['commands']):_0x54980c['push'](_0x50700e);}),_0x54980c=_0x54980c['filter'](_0xf4840f=>!_0x4af254['includes'](_0xf4840f['groupId'])),_0x54980c['forEach'](_0x340c64=>{_0x340c64['commands']=_0x340c64['commands']['filter'](_0x4d1c1d=>!_0x4af254['includes'](_0x4d1c1d['id']));}),_0x4f00f6['set']('ai.assistant.commands',_0x54980c);}}function Qi(_0x499e91){return[{'groupId':'editOrReview','groupLabel':Ri(_0x499e91,'Edit\x20or\x20review'),'commands':[{'id':'improveWriting','label':Ri(_0x499e91,'Improve\x20writing'),'prompt':'Fix\x20spelling\x20mistakes,\x20use\x20proper\x20grammar\x20and\x20apply\x20good\x20writing\x20practices.\x20Do\x20not\x20lose\x20the\x20original\x20meaning.'},{'id':'makeShorter','label':Ri(_0x499e91,'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':Ri(_0x499e91,'Make\x20longer'),'prompt':'Improve\x20this\x20content\x20by\x20using\x20descriptive\x20language\x20and\x20inserting\x20more\x20information\x20and\x20more\x20detailed\x20explanations.'},{'id':'simplifyLanguage','label':Ri(_0x499e91,'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':Ri(_0x499e91,'Generate\x20from\x20selection'),'commands':[{'id':'summarize','label':Ri(_0x499e91,'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':Ri(_0x499e91,'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':Ri(_0x499e91,'Change\x20tone'),'commands':[{'id':'professional','label':Ri(_0x499e91,'Professional'),'prompt':'Improve\x20using\x20polished,\x20formal,\x20and\x20respectful\x20language\x20to\x20convey\x20professional\x20expertise\x20and\x20competence.'},{'id':'casual','label':Ri(_0x499e91,'Casual'),'prompt':'Improve\x20using\x20casual,\x20informal\x20language\x20to\x20convey\x20a\x20casual\x20conversation\x20with\x20a\x20real\x20person.'},{'id':'direct','label':Ri(_0x499e91,'Direct'),'prompt':'Improve\x20using\x20direct\x20language,\x20using\x20only\x20the\x20essential\x20information.'},{'id':'confident','label':Ri(_0x499e91,'Confident'),'prompt':'Improve\x20using\x20compelling,\x20optimistic\x20language\x20to\x20convey\x20confidence\x20in\x20the\x20writing.'},{'id':'friendly','label':Ri(_0x499e91,'Friendly'),'prompt':'Improve\x20using\x20friendly,\x20comforting\x20language,\x20to\x20convey\x20understanding\x20and\x20empathy.'}]},{'groupId':'changeStyle','groupLabel':Ri(_0x499e91,'Change\x20style'),'commands':[{'id':'business','label':Ri(_0x499e91,'Business'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20business\x20professional\x20with\x20formal\x20language.'},{'id':'legal','label':Ri(_0x499e91,'Legal'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20legal\x20professional\x20using\x20valid\x20legal\x20terminology.'},{'id':'journalism','label':Ri(_0x499e91,'Journalism'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20journalist\x20using\x20engaging\x20language\x20to\x20convey\x20the\x20importance\x20of\x20the\x20information.'},{'id':'poetic','label':Ri(_0x499e91,'Poetic'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20poem\x20using\x20poetic\x20techniques\x20without\x20losing\x20the\x20original\x20meaning.'}]},{'groupId':'translate','groupLabel':Ri(_0x499e91,'Translate'),'commands':[{'id':'translateEnglish','label':Ri(_0x499e91,'English'),'prompt':'Translate\x20the\x20content\x20to\x20English\x20language.'},{'id':'translateSpanish','label':Ri(_0x499e91,'Spanish'),'prompt':'Translate\x20the\x20content\x20to\x20Spanish\x20language.'},{'id':'translatePortuguese','label':Ri(_0x499e91,'Portuguese'),'prompt':'Translate\x20the\x20content\x20to\x20Portuguese\x20language.'},{'id':'translateGerman','label':Ri(_0x499e91,'German'),'prompt':'Translate\x20the\x20content\x20to\x20German\x20language.'},{'id':'translateFrench','label':Ri(_0x499e91,'French'),'prompt':'Translate\x20the\x20content\x20to\x20French\x20language.'},{'id':'translateChinese','label':Ri(_0x499e91,'Simplified\x20Chinese'),'prompt':'Translate\x20the\x20content\x20to\x20Simplified\x20Chinese\x20language.'},{'id':'translateHindi','label':Ri(_0x499e91,'Hindi'),'prompt':'Translate\x20the\x20content\x20to\x20Hindi\x20language.'},{'id':'translateArabic','label':Ri(_0x499e91,'Arabic'),'prompt':'Translate\x20the\x20content\x20to\x20Arabic\x20language.'}]}];}class Xi extends _0x36293e{['abortController'];static get['requires'](){return[Si];}constructor(_0x50aab9){super(_0x50aab9),this['abortController']=new AbortController();}['init'](){this['editor']['plugins']['get'](Si)['textAdapter']=this;}['abort'](){this['abortController']['signal']['aborted']||(this['abortController']['abort'](),this['abortController']=new AbortController());}async['makeRequest'](_0x49bda5){return this['sendRequest'](_0x49bda5)['catch'](_0x2fe896=>{if(_0x2fe896 instanceof bi)return Promise['reject'](_0x2fe896);if('AbortError'==_0x2fe896['name'])return Promise['resolve']();throw console['error'](_0x2fe896),new ot('aitextadapter-send-request-failed',null);});}async['_prepareRequestHeaders'](_0x531998,_0x3a2db1){const _0x5200b4=this['editor']['locale'],_0x19339b={'Content-Type':'application/json'};if('object'==typeof _0x531998)Object['assign'](_0x19339b,_0x531998);else{if(_0x531998)try{const _0x57146e=await _0x531998(_0x3a2db1);Object['assign'](_0x19339b,_0x57146e);}catch{return Promise['reject'](new bi(Ri(_0x5200b4,'AI_ERROR_GET_HEADERS')));}}return _0x19339b;}async['_prepareRequestParameters'](_0x4cd814,_0x57353f){const _0x54dcf1=this['editor']['locale'];if('object'==typeof _0x4cd814)return _0x4cd814;try{return await _0x4cd814(_0x57353f);}catch{return Promise['reject'](new bi(Ri(_0x54dcf1,'AI_ERROR_GET_PARAMETERS')));}}}class zi extends Xi{['_apiUrl'];['_requestHeaders'];['_requestParameters'];static get['pluginName'](){return'OpenAITextAdapter';}constructor(_0x3ad44f){super(_0x3ad44f),_0x3ad44f['config']['define']('ai.assistant.adapter.openAI.apiUrl','https://api.openai.com/v1/chat/completions'),_0x3ad44f['config']['get']('ai.assistant.adapter.openAI.requestParameters')||_0x3ad44f['config']['define']('ai.assistant.adapter.openAI.requestParameters',{'model':'gpt-4o','temperature':0x1,'top_p':0x1,'stream':!0x0}),this['_apiUrl']=_0x3ad44f['config']['get']('ai.assistant.adapter.openAI.apiUrl'),this['_requestHeaders']=_0x3ad44f['config']['get']('ai.assistant.adapter.openAI.requestHeaders')||{},this['_requestParameters']=_0x3ad44f['config']['get']('ai.assistant.adapter.openAI.requestParameters');}async['sendRequest']({query:_0x528271,context:_0x18ac56,onData:_0x2edf66,actionId:_0x1ca543}){const _0x19a8bb=this['editor']['locale'],_0x34924b=await this['prepareMessages'](_0x528271,_0x18ac56,_0x1ca543),_0x18e255=await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x1ca543),_0x3abcad=await this['_prepareRequestParameters'](this['_requestParameters'],_0x1ca543),_0x3b4db5={'messages':_0x34924b,..._0x3abcad},_0x5a9137={'method':'POST','headers':_0x18e255,'body':JSON['stringify'](_0x3b4db5),'signal':this['abortController']['signal']},_0x457927=await fetch(this['_apiUrl'],_0x5a9137);if(_0x457927['ok'])return _0x3abcad['stream']?await this['_readStreamableResponse'](_0x457927,_0x2edf66):await this['_readStaticResponse'](_0x457927,_0x2edf66),Promise['resolve']();{const _0x34f389=await _0x457927['text']();return _0x34f389['includes']('context_length_exceeded')?Promise['reject'](new bi(Ri(_0x19a8bb,'AI_ERROR_CONTEXT_LENGTH'))):_0x34f389['includes']('Moderation')?Promise['reject'](new bi(Ri(_0x19a8bb,'AI_ERROR_MODERATION'))):Promise['reject'](new Error(_0x34f389));}}async['prepareMessages'](_0x4bddc8,_0x3b79f9,_0x252e90){let _0x23e650,_0x2f757f;return _0x3b79f9?(_0x23e650='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.',_0x2f757f='Instruction:\x0a'+_0x4bddc8+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x3b79f9):(_0x23e650='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.',_0x2f757f=_0x4bddc8),[{'role':'system','content':_0x23e650},{'role':'user','content':_0x2f757f}];}async['_readStreamableResponse'](_0x33ca33,_0x1a5dec){const _0x19720c=_0x33ca33['body']['getReader'](),_0x4ac4aa=new TextDecoder();let _0x276b01='',_0x408ec4='',_0x2c5d46='',_0xe7f9ed=!0x1;for(;!_0xe7f9ed;){const {done:_0x6c2a6d,value:_0x51b6af}=await _0x19720c['read'](),_0x3934ec=_0x276b01+_0x4ac4aa['decode'](_0x51b6af);let _0x56138a='';_0xe7f9ed=_0x6c2a6d;try{_0x56138a=this['_cleanUpData'](_0x3934ec),_0x276b01='';}catch{_0x276b01=_0x3934ec;continue;}_0x408ec4+=_0x56138a,!_0xe7f9ed&&this['_isBufferIncomplete'](_0x408ec4)||_0x408ec4&&(_0x2c5d46+=_0x408ec4,_0x408ec4='',_0x1a5dec(_0x2c5d46));}return Promise['resolve']();}async['_readStaticResponse'](_0x1105f4,_0x44df89){return _0x44df89((await _0x1105f4['json']())['choices'][0x0]['message']['content']),Promise['resolve']();}['_isBufferIncomplete'](_0x3f7b6b){const _0x3f16dc=_0x3f7b6b['split']('<')['length']!==_0x3f7b6b['split']('>')['length'],_0x5bc1bf=_0x3f7b6b['length']<0x1e;return _0x3f16dc&&_0x5bc1bf;}['_cleanUpData'](_0x5a0d6f){return _0x5a0d6f['split'](/\n(?![^{]*\})/g)['map'](_0x345115=>_0x345115['replace']('data:\x20',''))['filter'](_0x457fd2=>_0x457fd2&&_0x457fd2['length']>0x0&&'[DONE]'!==_0x457fd2)['map'](_0x235569=>{const {choices:_0x5cdcf9}=JSON['parse'](_0x235569);if(_0x5cdcf9[0x0]?.['delta']?.['content'])return _0x5cdcf9[0x0]['delta']['content'];})['filter'](_0xe7f979=>_0xe7f979)['join']('');}}class ji extends Xi{static get['pluginName'](){return'AWSTextAdapter';}['init'](){super['init'](),It('ai-aws-adapter-not-supported');}async['sendRequest'](_0x52e721){throw Et('ai-aws-adapter-not-supported'),new bi(Ri(this['editor']['locale'],'AI_ERROR_AWS_NOT_SUPPORTED'));}}class Ji extends kt{constructor(_0x1778d2,_0x40b9a7={}){super(_0x1778d2),this['isToggleable']=!0x0,this['set']('side',_0x40b9a7['side']||'top');const _0x1f0406=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-tab-button',...Tt(_0x40b9a7['class']||[]),_0x1f0406['to']('side',_0x4eeb33=>'ck-tab-button_'+_0x4eeb33),_0x1f0406['to']('class')]}});}['show'](){this['set']('isVisible',!0x0);}['hide'](){this['set']('isVisible',!0x1);}}class Zi extends Nt{['children'];constructor(_0x243fdc,_0x35c23b={}){super(_0x243fdc);const _0x2cf115=this['bindTemplate'];this['set']('isVisible',!0x1),this['set']('class',''),this['children']=this['createCollection'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck-tab-panel',...Tt(_0x35c23b['class']||[]),_0x2cf115['to']('class'),_0x2cf115['if']('isVisible','ck-hidden',_0x13be5a=>!_0x13be5a)]},'children':this['children']});}['show'](){this['set']('isVisible',!0x0);}['hide'](){this['set']('isVisible',!0x1);}}class ts extends Nt{['buttonViews']=this['createCollection']();['panelViews']=this['createCollection']();['_tabs']=new Map();constructor(_0x1d462f,_0x388996={}){super(_0x1d462f),this['set']('class',void 0x0),this['set']('activeTab',null),this['set']('side',_0x388996['side']||'top'),this['set']('isMaximized',!0x1);const _0x4b83d4=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset','ck-tabs',...Tt(_0x388996['class']||[]),_0x4b83d4['to']('side',_0x3210c5=>'ck-tabs_'+_0x3210c5),_0x4b83d4['to']('class'),_0x4b83d4['to']('isMaximized',_0x2996a4=>_0x2996a4?'ck-ai-tabs_maximized':'')],'tabindex':'0'},'children':[{'tag':'div','attributes':{'class':['ck','ck-tabs__buttons-container',_0x4b83d4['to']('side',_0x3b88f9=>'ck-tabs__buttons-container_'+_0x3b88f9)]},'children':this['buttonViews']},{'tag':'div','attributes':{'class':['ck','ck-tabs__panels-container',_0x4b83d4['to']('side',_0x3efd2a=>'ck-tabs__panels-container_'+_0x3efd2a)]},'children':this['panelViews']},...Tt(_0x388996['children']||[])]});}['getTabIds'](){return[...this['_tabs']['keys']()];}['getTab'](_0x4cafdf){const _0x756048=this['_tabs']['get'](_0x4cafdf);return _0x756048||null;}['addTab'](_0xb768f7){const _0x30eb37=this['_setupButton']({'id':_0xb768f7['id'],'label':_0xb768f7['buttonLabel'],'icon':_0xb768f7['buttonIcon'],'order':_0xb768f7['order']}),_0x2db1b0=new Zi(this['locale']);return _0x2db1b0['render'](),_0xb768f7['content']&&_0x2db1b0['children']['add'](_0xb768f7['content']),this['panelViews']['add'](_0x2db1b0),this['_tabs']['set'](_0xb768f7['id'],{'button':_0x30eb37,'panel':_0x2db1b0,'order':void 0x0!==_0xb768f7['order']?_0xb768f7['order']:null}),this['fire']('addTab:'+_0xb768f7['id'],{'id':_0xb768f7['id'],'button':_0x30eb37,'panel':_0x2db1b0}),null===this['activeTab']?this['activateTab'](_0xb768f7['id']):this['_hidePanel'](_0xb768f7['id']),{'button':_0x30eb37,'panel':_0x2db1b0};}['activateTab'](_0x35f41c){if(null!==_0x35f41c&&!this['getTab'](_0x35f41c))throw new ot('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0x35f41c});this['activeTab']!==_0x35f41c&&(this['activeTab']&&this['_hidePanel'](this['activeTab']),this['activeTab']=_0x35f41c,_0x35f41c&&this['_showPanel'](_0x35f41c),this['fire']('activateTab:'+_0x35f41c,_0x35f41c));}['showTab'](_0x485900){if(!this['getTab'](_0x485900))throw new ot('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0x485900});this['_showPanel'](_0x485900),this['_showButton'](_0x485900),this['fire']('show:'+_0x485900,_0x485900);}['hideTab'](_0x27d688){if(!this['getTab'](_0x27d688))throw new ot('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0x27d688});const _0xdc0662=this['activeTab'];this['_hidePanel'](_0x27d688),this['_hideButton'](_0x27d688);const _0x2b785f=this['getTabIds']();_0xdc0662===_0x27d688&&_0x2b785f['length']>0x1&&this['activateTab'](_0x2b785f['find'](_0x4b892f=>_0x4b892f!==_0x27d688)),this['fire']('hide:'+_0x27d688,_0x27d688);}['_getPanel'](_0x20ea93){const _0x5e3793=this['_tabs']['get'](_0x20ea93);return _0x5e3793?_0x5e3793['panel']:null;}['_showPanel'](_0x13f56a){null!==this['activeTab']&&this['activeTab']!==_0x13f56a||this['_getPanel'](_0x13f56a)['show']();}['_hidePanel'](_0x3c0adc){const _0x86c183=this['_getPanel'](_0x3c0adc);_0x86c183['isVisible']&&(this['activeTab']===_0x3c0adc&&(this['activeTab']=null),_0x86c183['hide']());}['_getButton'](_0x519b9c){const _0x3dc432=this['_tabs']['get'](_0x519b9c);return _0x3dc432?_0x3dc432['button']:null;}['_showButton'](_0xbe971a){this['_getButton'](_0xbe971a)['show']();}['_hideButton'](_0x46ab98){this['_getButton'](_0x46ab98)['hide']();}['_setupButton'](_0x5c40ff){const _0x622b6c=new Ji(this['locale'],{'side':this['side']}),_0x2cb714=this['buttonViews'];if(_0x622b6c['set']({'label':_0x5c40ff['label'],'icon':_0x5c40ff['icon'],'tooltip':!0x0,'withText':!0x0}),_0x622b6c['bind']('isOn')['to'](this,'activeTab',_0x255913=>_0x255913===_0x5c40ff['id']),_0x622b6c['bind']('side')['to'](this,'side'),_0x5c40ff['order']){const _0x599ff8=[...this['_tabs']]['reduce']((_0x16a552,_0x1068fb)=>{const _0x1574c9=_0x1068fb[0x0],{order:_0x272eb1}=_0x1068fb[0x1];return!_0x272eb1||_0x272eb1>_0x5c40ff['order']?_0x16a552:_0x272eb1>=_0x16a552['order']?{'id':_0x1574c9,'order':_0x272eb1}:_0x16a552;},{'id':'','order':0x0}),_0x554839=_0x2cb714['getIndex'](this['_getButton'](_0x599ff8['id']));_0x2cb714['add'](_0x622b6c,_0x554839+0x1);}else _0x2cb714['add'](_0x622b6c);return _0x622b6c['on']('execute',()=>{this['activateTab'](_0x5c40ff['id']);}),_0x622b6c;}}const es=['overlay','sidebar','custom'],is=['left','right'];class ss extends ts{constructor(_0x5af126,_0x27dd0c={}){super(_0x5af126,_0x27dd0c),this['set']('type',_0x27dd0c['type']||'sidebar'),this['set']('side',_0x27dd0c['side']||'right'),this['set']('isVisible',_0x27dd0c['visibleByDefault']??!0x0);const _0x582075=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-tabs',_0x582075['if']('type','ck-ai-tabs__overlay',_0x48dd5d=>'overlay'===_0x48dd5d),_0x582075['if']('type','ck-ai-tabs__sidebar',_0x2ff01c=>'sidebar'===_0x2ff01c),_0x582075['if']('isVisible','ck-hidden',_0x29ac05=>!_0x29ac05)]}}),this['buttonViews']['on']('add',(_0x571209,_0x3fa516)=>{_0x3fa516['set']('withText',!0x1);});}}class ns extends _0x314798{['view'];['container']=null;['showResizeButton']=!0x0;static get['pluginName'](){return'AITabs';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x37c71e){super(_0x37c71e);const _0x3cf576=this['context']['config']['get']('ai.container');if(this['set']('side','right'),!_0x3cf576)throw new ot('ai-tabs-configuration-not-found');if(void 0x0!==_0x3cf576['showResizeButton']&&(this['showResizeButton']=_0x3cf576['showResizeButton']),'sidebar'!==_0x3cf576['type']&&'overlay'!==_0x3cf576['type']||_0x3cf576['side']&&(this['side']=_0x3cf576['side']),'sidebar'===_0x3cf576['type']){if(this['container']=_0x3cf576['element'],this['set']('type','sidebar'),!this['container'])throw new ot('ai-tabs-sidebar-container-element-not-found');}else'overlay'===_0x3cf576['type']?(this['container']=document['body'],this['set']('type','overlay')):(this['container']=null,this['set']('type','custom'));this['view']=new ss(this['context']['locale'],{'side':this['side'],'type':this['type'],'visibleByDefault':void 0x0===_0x3cf576['visibleByDefault']||_0x3cf576['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 _0x596f47&&this['context']['ui']['focusTracker']['add'](this['view']['element']);}['switchType'](_0xfca9b0){if(_0xfca9b0&&this['type']!==_0xfca9b0){if(!es['includes'](_0xfca9b0))throw new ot('ai-tabs-unsupported-ui-type');this['type']=_0xfca9b0;}}['switchSide'](_0x5d9061){if(_0x5d9061&&this['side']!==_0x5d9061){if(!is['includes'](_0x5d9061))throw new ot('ai-tabs-unsupported-ui-side');this['side']=_0x5d9061;}}['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 rs extends _0x314798{['_apiUrl'];['_token'];['_decoder'];['_responseCache'];static get['requires'](){return[_0x42a34e];}static get['pluginName'](){return'AIConnector';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x1c5740){super(_0x1c5740),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(),this['_responseCache']=new Map();}['init'](){const _0x6d7d9=this['context']['plugins']['get'](_0x42a34e);if(!_0x6d7d9['token'])throw new ot('ai-missing-token',this);this['_token']=_0x6d7d9['token'];}['startConversation'](_0x32f217,_0x1e5eaf){const _0x470c10=this['_sendApiRequest']('/conversations','POST',{'id':_0x32f217,'group':_0x1e5eaf});return{'getConversation':async()=>(await _0x470c10['request'])['json'](),'abortController':_0x470c10['abortController']};}['queryAssistant']({message:_0x331401,conversationId:_0x35299c,parts:_0x48ba61,capabilities:_0x3ea9d6,model:_0x5af8e6,attributes:_0x4cade4}){const _0x5f350c={'prompt':_0x331401,'content':_0x48ba61,'model':_0x5af8e6,..._0x3ea9d6&&{'capabilities':_0x3ea9d6},..._0x4cade4&&{'attributes':_0x4cade4}},_0x17dece=this['_sendApiRequest']('/conversations/'+_0x35299c+'/messages','POST',_0x5f350c);return{'getStream':async()=>{const _0x34d39b=(await _0x17dece['request'])['body'];return this['_getStreamReader'](_0x34d39b);},'abortController':_0x17dece['abortController']};}['executeCustomAction']({content:_0x21b991,message:_0x5bf241,model:_0x90cf6a,outputFormat:_0x38d548}){const _0x4ae107={'content':[{'type':'text','content':_0x21b991}],'prompt':_0x5bf241,'model':_0x90cf6a,'outputFormat':_0x38d548},_0x28de89=this['_sendApiRequest']('/actions/custom/calls','POST',_0x4ae107);return{'getStream':async()=>{const _0x1fea01=(await _0x28de89['request'])['body'];return this['_getStreamReader'](_0x1fea01);},'abortController':_0x28de89['abortController']};}['executeAction']({actionName:_0x151a72,content:_0x3fab40,args:_0x25feb6}){const _0x3f2056={'content':[{'type':'text','content':_0x3fab40}],'args':_0x25feb6},_0x1646ad=this['_sendApiRequest']('/actions/system/'+_0x151a72+'/calls','POST',_0x3f2056);return{'getStream':async()=>{const _0x166bf8=(await _0x1646ad['request'])['body'];return this['_getStreamReader'](_0x166bf8);},'abortController':_0x1646ad['abortController']};}['uploadFile'](_0x549829,_0x355805,_0x335ece){const _0x10c109=new FormData();_0x10c109['append']('file',_0x355805,_0x355805['name']),_0x335ece&&_0x10c109['append']('attributes',JSON['stringify'](_0x335ece));const _0x5179d0=this['_sendApiRequest']('/conversations/'+_0x549829+'/files','POST',_0x10c109);return{'getId':async()=>(await _0x5179d0['request'])['json'](),'abortController':_0x5179d0['abortController']};}['fetchDocument'](_0x34dd26,_0x12ed37){const _0xee24e0=this['_sendApiRequest']('/conversations/'+_0x34dd26+'/documents/'+_0x12ed37,'GET');return{'getDocument':async()=>(await _0xee24e0['request'])['json'](),'abortController':_0xee24e0['abortController']};}['uploadDocument'](_0x54a79c,_0x44ccab,_0x50c5dd){const _0x31b0e4={'content':_0x44ccab};_0x50c5dd&&(_0x31b0e4['attributes']=_0x50c5dd);const _0x4f9c21=this['_sendApiRequest']('/conversations/'+_0x54a79c+'/documents','POST',_0x31b0e4);return{'getId':async()=>(await _0x4f9c21['request'])['json'](),'abortController':_0x4f9c21['abortController']};}['fetchConversations'](_0x1730bc,_0x1fab17={}){const _0x1cd599=new URLSearchParams();_0x1cd599['append']('group',_0x1730bc),_0x1cd599['append']('excludeEmpty',!0x1!==_0x1fab17['excludeEmpty']?'true':'false'),_0x1cd599['append']('limit',_0x1fab17['limit']?_0x1fab17['limit']['toString']():'100'),_0x1cd599['append']('sortBy',_0x1fab17['sortBy']?_0x1fab17['sortBy']:'createdAt'),_0x1cd599['append']('order',_0x1fab17['order']?_0x1fab17['order']:'desc');const _0x3a0ad2=this['_sendApiRequest']('/conversations?'+_0x1cd599['toString'](),'GET');return{'getConversations':async()=>{const _0x4593ac=await _0x3a0ad2['request'];return(await _0x4593ac['json']())['items'];},'abortController':_0x3a0ad2['abortController']};}['deleteConversation'](_0x4fd60f){const _0x17eb37=this['_sendApiRequest']('/conversations/'+_0x4fd60f,'DELETE');return{'execute':async()=>{await _0x17eb37['request'];},'abortController':_0x17eb37['abortController']};}['updateConversation'](_0x2a4e32,_0x496131){const _0x1b304b=this['_sendApiRequest']('/conversations/'+_0x2a4e32,'PATCH',_0x496131);return{'getResult':async()=>(await _0x1b304b['request'],_0x496131),'abortController':_0x1b304b['abortController']};}['fetchConversation'](_0x43c931){const _0x2d9da2=this['_sendApiRequest']('/conversations/'+_0x43c931,'GET');return{'getConversation':async()=>(await _0x2d9da2['request'])['json'](),'abortController':_0x2d9da2['abortController']};}['fetchConversationMessages'](_0x5a4150){const _0x43c263=this['_sendApiRequest']('/conversations/'+_0x5a4150+'/messages','GET');return{'getMessages':async()=>{const _0x408bc6=await _0x43c263['request'];return(await _0x408bc6['json']())['items'];},'abortController':_0x43c263['abortController']};}['uploadUrl'](_0x10014c,_0x3f3074,_0x380b67){const _0x44f471=this['_sendApiRequest']('/conversations/'+_0x10014c+'/web-resources','POST',{'url':_0x3f3074,'attributes':_0x380b67});return{'getId':async()=>(await _0x44f471['request'])['json'](),'abortController':_0x44f471['abortController']};}['getModels'](_0xbb798d='en'){const _0x4c6c16=new URLSearchParams();_0x4c6c16['append']('language',_0xbb798d);const _0x12f1af='/models/1?'+_0x4c6c16['toString'](),_0x4d0049=this['_sendApiRequest'](_0x12f1af,'GET',void 0x0,!0x0);return{'list':async()=>await(await _0x4d0049['request'])['json'](),'abortController':_0x4d0049['abortController']};}['deleteFile'](_0x2f2008,_0x328175){const _0x1518a8=this['_sendApiRequest']('/conversations/'+_0x2f2008+'/files/'+_0x328175,'DELETE');return{'execute':async()=>{await _0x1518a8['request'];},'abortController':_0x1518a8['abortController']};}['deleteDocument'](_0x38512a,_0x1eeb5b){const _0x33f17b=this['_sendApiRequest']('/conversations/'+_0x38512a+'/documents/'+_0x1eeb5b,'DELETE');return{'execute':async()=>{await _0x33f17b['request'];},'abortController':_0x33f17b['abortController']};}['deleteWebResource'](_0x5b2ce6,_0x41d69e){const _0x4492a8=this['_sendApiRequest']('/conversations/'+_0x5b2ce6+'/web-resources/'+_0x41d69e,'DELETE');return{'execute':async()=>{await _0x4492a8['request'];},'abortController':_0x4492a8['abortController']};}['callSystemReview']({reviewName:_0xa5be2,content:_0x44b6b1,args:_0x152c84}){const _0x50914e=this['_sendApiRequest']('/reviews/system/'+_0xa5be2+'/calls','POST',{'content':[{'type':'text','content':_0x44b6b1}],'args':_0x152c84});return{'getStream':async()=>{const _0x2124a0=(await _0x50914e['request'])['body'];return this['_getStreamReader'](_0x2124a0);},'abortController':_0x50914e['abortController']};}['callCustomReview']({content:_0x591661,prompt:_0x30b3b8,model:_0x32ab15}){const _0x48b58c=this['_sendApiRequest']('/reviews/custom/calls','POST',{'content':[{'type':'text','content':_0x591661}],'prompt':_0x30b3b8,'model':_0x32ab15});return{'getStream':async()=>{const _0x2efd36=(await _0x48b58c['request'])['body'];return this['_getStreamReader'](_0x2efd36);},'abortController':_0x48b58c['abortController']};}['upsertAIChatRating'](_0x24e50b,_0x40d84b,_0x5ae6e3){const _0x6479d9=this['_sendApiRequest']('/conversations/'+_0x24e50b+'/messages/'+_0x40d84b+'/ratings','PUT',{'positiveCount':_0x5ae6e3['positiveCount'],'totalCount':_0x5ae6e3['totalCount'],'modificationId':_0x5ae6e3['modificationId']});return{'execute':async()=>{await _0x6479d9['request'];},'abortController':_0x6479d9['abortController']};}['upsertAIActionRating'](_0x4ea77f,_0x1d6a7f,_0x4e6d1f){const _0x1bb01c=this['_sendApiRequest']('/actions/system/'+_0x4ea77f+'/calls/'+_0x1d6a7f+'/ratings','PUT',{'positiveCount':_0x4e6d1f['positiveCount'],'totalCount':_0x4e6d1f['totalCount']});return{'execute':async()=>{await _0x1bb01c['request'];},'abortController':_0x1bb01c['abortController']};}['upsertCustomAIActionRating'](_0x5c616b,_0x36c837){const _0x1b69b8=this['_sendApiRequest']('/actions/custom/calls/'+_0x5c616b+'/ratings','PUT',{'positiveCount':_0x36c837['positiveCount'],'totalCount':_0x36c837['totalCount']});return{'execute':async()=>{await _0x1b69b8['request'];},'abortController':_0x1b69b8['abortController']};}['upsertAIReviewRating'](_0x1fef46,_0x5059ee,_0x3200eb,_0x4af89b){const _0x631228=this['_sendApiRequest']('/reviews/system/'+_0x1fef46+'/calls/'+_0x5059ee+'/ratings','PUT',{'positiveCount':_0x3200eb['positiveCount'],'totalCount':_0x3200eb['totalCount'],'dataId':_0x4af89b});return{'execute':async()=>{await _0x631228['request'];},'abortController':_0x631228['abortController']};}['upsertCustomAIReviewRating'](_0x356460,_0x4fe479,_0x4858fd){const _0x1c2096=this['_sendApiRequest']('/reviews/custom/calls/'+_0x356460+'/ratings','PUT',{'positiveCount':_0x4fe479['positiveCount'],'totalCount':_0x4fe479['totalCount'],'dataId':_0x4858fd});return{'execute':async()=>{await _0x1c2096['request'];},'abortController':_0x1c2096['abortController']};}['_sendApiRequest'](_0x5b294d,_0x41dca6,_0x47d8f2,_0xa91d1c=!0x1){const _0x1486cd=new AbortController(),_0x44f273=_0xa91d1c?_0x41dca6+':'+_0x5b294d:null;if(_0x44f273){const _0x555b84=this['_responseCache']['get'](_0x44f273);if(_0x555b84)return{'request':_0x555b84['then'](_0x35cedc=>_0x35cedc['clone']()),'abortController':_0x1486cd};}const _0x3949d1=_0x47d8f2 instanceof FormData,_0x403293={'Authorization':'Bearer\x20'+this['_token']?.['value']};_0x47d8f2&&!_0x3949d1&&(_0x403293['Content-Type']='application/json');const _0x51fec5={'method':_0x41dca6,'headers':_0x403293,'signal':_0x1486cd['signal']};_0x47d8f2&&(_0x51fec5['body']=_0x3949d1?_0x47d8f2:JSON['stringify'](_0x47d8f2));const _0x436304=fetch(''+this['_apiUrl']+_0x5b294d,_0x51fec5)['catch'](_0x464776=>{_0x44f273&&this['_responseCache']['delete'](_0x44f273),this['_handleError'](_0x464776);})['then'](_0x10e64b=>_0x10e64b['ok']?_0x10e64b:_0x10e64b['json']()['then'](_0x1275df=>{throw _0x44f273&&this['_responseCache']['delete'](_0x44f273),{'url':this['_apiUrl'],'path':_0x5b294d,'method':_0x41dca6,'body':_0x47d8f2,'status':(_0x10e64b||{})['status'],'statusText':(_0x10e64b||{})['statusText'],'code':_0x1275df['code'],'message':_0x1275df['message'],'traceId':_0x1275df['traceId']};}));return _0x44f273&&this['_responseCache']['set'](_0x44f273,_0x436304['then'](_0xc8b8d1=>_0xc8b8d1['clone']())),{'request':_0x436304,'abortController':_0x1486cd};}async*['_getStreamReader'](_0x4ce813){const _0x50b857=[],_0xeb375b=_0x4ce813['getReader'](),_0x2e4ef7=_0x29a215({'onError':_0x292791=>{this['_handleError'](_0x292791);},'onEvent':_0x91e92b=>{_0x91e92b['data']=JSON['parse'](_0x91e92b['data']),_0x50b857['push'](_0x91e92b);}});try{let _0x509e89=!0x1;for(;!_0x509e89;){const {done:_0x134371,value:_0x52ddc3}=await _0xeb375b['read']();_0x134371&&(_0x509e89=!0x0),_0x2e4ef7['feed'](this['_decoder']['decode'](_0x52ddc3,{'stream':!0x0})),yield*_0x50b857,_0x50b857['length']=0x0;}}catch(_0x166d03){this['_handleError'](_0x166d03);}finally{_0xeb375b['releaseLock'](),_0x2e4ef7['reset']();}}['_handleError'](_0x23e69a){if(_0x23e69a instanceof ot)throw _0x23e69a;if(_0x23e69a instanceof Error&&'AbortError'===_0x23e69a['name'])throw new ot('ai-request-aborted',this,{'originalError':_0x23e69a});throw new ot('ai-request-failed',this,{'originalError':_0x23e69a});}}function as(_0x3b2138,_0x30007c,_0x49ddd8){const t=_0x3b2138['t'];switch(_0x30007c){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'},_0x49ddd8);case'AI_SUGGESTION_CONTENT_PART_REJECTED':return t({'id':'AI_SUGGESTION_CONTENT_PART_REJECTED','string':'Change\x20was\x20rejected'});case'AI_SUGGESTION_CONTENT_PART_OUTDATED':return t({'id':'AI_SUGGESTION_CONTENT_PART_OUTDATED','string':'Change\x20is\x20outdated'});case'AI_SUGGESTION_CONTENT_PART_ALREADY_APPLIED':return t({'id':'AI_SUGGESTION_CONTENT_PART_ALREADY_APPLIED','string':'Change\x20is\x20already\x20applied'});case'AI_SUGGESTION_CONTENT_PART_APPLY':return t({'id':'AI_SUGGESTION_CONTENT_PART_APPLY','string':'Apply\x20change'});case'AI_SUGGESTION_CONTENT_PART_ADD_SUGGESTION':return t({'id':'AI_SUGGESTION_CONTENT_PART_ADD_SUGGESTION','string':'Add\x20as\x20suggestion'});case'AI_SUGGESTION_CONTENT_PART_REJECT':return t({'id':'AI_SUGGESTION_CONTENT_PART_REJECT','string':'Reject\x20change'});case'AI_SUGGESTION_CONTENT_PART_REMOVED':return t({'id':'AI_SUGGESTION_CONTENT_PART_REMOVED','string':'Removed\x20content.\x20Use\x20\x22Show\x20details\x22\x20to\x20learn\x20more.'});case'AI_SUGGESTION_CONTENT_PART_STATE_ACCEPTED':return t({'id':'AI_SUGGESTION_CONTENT_PART_STATE_ACCEPTED','string':'Approved'});case'AI_SUGGESTION_CONTENT_PART_STATE_REJECTED':return t({'id':'AI_SUGGESTION_CONTENT_PART_STATE_REJECTED','string':'Rejected'});case'AI_SUGGESTION_CONTENT_PART_STATE_OUTDATED':return t({'id':'AI_SUGGESTION_CONTENT_PART_STATE_OUTDATED','string':'Outdated'});case'AI_DISCLAIMER_TEXT':return t({'id':'AI_DISCLAIMER_TEXT','string':'AI\x20can\x20make\x20mistakes.\x20Please\x20double-check\x20responses.'});case'AI_TABS_LABEL_MAXIMIZE':return t({'id':'AI_TABS_LABEL_MAXIMIZE','string':'Maximize'});case'AI_TABS_LABEL_MINIMIZE':return t({'id':'AI_TABS_LABEL_MINIMIZE','string':'Minimize'});case'AI_CHAT_HEADING':return t({'id':'AI_CHAT_HEADING','string':'Chat'});case'AI_CHAT_SOURCES_HEADER':return t({'id':'AI_CHAT_SOURCES_HEADER','string':'Sources'});case'AI_CHAT_UNTITLED_CONVERSATION':return t({'id':'AI_CHAT_UNTITLED_CONVERSATION','string':'Untitled\x20conversation'});case'AI_CHAT_LABEL_NEW_CHAT':return t({'id':'AI_CHAT_LABEL_NEW_CHAT','string':'New\x20chat'});case'AI_CHAT_STOP_GENERATING':return t({'id':'AI_CHAT_STOP_GENERATING','string':'Stop\x20generating'});case'AI_CHAT_IS_WRITING':return t({'id':'AI_CHAT_IS_WRITING','string':'AI\x20is\x20writing...'});case'AI_CHAT_PROMPT_EMPTY_ERROR':return t({'id':'AI_CHAT_PROMPT_EMPTY_ERROR','string':'This\x20field\x20cannot\x20be\x20empty.'});case'AI_CHAT_LABEL_SUBMIT':return t({'id':'AI_CHAT_LABEL_SUBMIT','string':'Submit'});case'AI_CHAT_WELCOME_MESSAGE':return t({'id':'AI_CHAT_WELCOME_MESSAGE','string':'Hi!\x20I\x20can\x20help\x20you\x20draft,\x20rewrite,\x20and\x20improve\x20your\x20text,\x20explore\x20ideas,\x20research\x20topics,\x20and\x20solve\x20problems.\x20How\x20can\x20I\x20help\x20right\x20now?'});case'AI_CHAT_ABORTED_MESSAGE':return t({'id':'AI_CHAT_ABORTED_MESSAGE','string':'The\x20request\x20was\x20aborted.'});case'AI_CHAT_GENERIC_ERROR':return t({'id':'AI_CHAT_GENERIC_ERROR','string':'Something\x20went\x20wrong\x20while\x20processing\x20your\x20request.\x20Please\x20try\x20again.'});case'AI_CHAT_UNABLE_TO_START_CONVERSATION':return t({'id':'AI_CHAT_UNABLE_TO_START_CONVERSATION','string':'Unable\x20to\x20start\x20conversation.\x20Please\x20make\x20sure\x20you\x20are\x20online\x20and\x20try\x20again.'});case'AI_CHAT_UNABLE_TO_LOAD_CONVERSATION':return t({'id':'AI_CHAT_UNABLE_TO_LOAD_CONVERSATION','string':'Unable\x20to\x20load\x20chosen\x20conversation.\x20Please\x20make\x20sure\x20you\x20are\x20online\x20and\x20try\x20again.'});case'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_FILE':return t({'id':'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_FILE','string':'Failed\x20to\x20upload\x20files:\x20%0.\x20Please\x20try\x20again.'},_0x49ddd8);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.'},_0x49ddd8);case'AI_CHAT_RESOURCE_LOAD_FAILED':return t({'id':'AI_CHAT_RESOURCE_LOAD_FAILED','string':'Failed\x20to\x20load\x20resource.\x20Please\x20try\x20again.'});case'AI_CHAT_CONTEXT_CURRENT_DOCUMENT':return t({'id':'AI_CHAT_CONTEXT_CURRENT_DOCUMENT','string':'Current\x20document'});case'AI_CHAT_CONTEXT_REMOVE_FROM_CONTEXT':return t({'id':'AI_CHAT_CONTEXT_REMOVE_FROM_CONTEXT','string':'Remove\x20from\x20context'});case'AI_CHAT_CONTEXT_ADD_CONTEXT':return t({'id':'AI_CHAT_CONTEXT_ADD_CONTEXT','string':'Add\x20context'});case'AI_CHAT_CONTEXT_URL_LABEL':return t({'id':'AI_CHAT_CONTEXT_URL_LABEL','string':'URL'});case'AI_CHAT_CONTEXT_FILE_LABEL':return t({'id':'AI_CHAT_CONTEXT_FILE_LABEL','string':'File'});case'AI_CHAT_CONTEXT_CURRENT_CONTEXT_LABEL':return t({'id':'AI_CHAT_CONTEXT_CURRENT_CONTEXT_LABEL','string':'Current\x20context'});case'AI_CHAT_CONTEXT_DOCUMENT_SELECTION_LABEL':return t({'id':'AI_CHAT_CONTEXT_DOCUMENT_SELECTION_LABEL','string':'Selected\x20content'});case'AI_CHAT_SEARCH_WEB':return t({'id':'AI_CHAT_SEARCH_WEB','string':'Web\x20search'});case'AI_CHAT_ENABLE_WEB_SEARCH':return t({'id':'AI_CHAT_ENABLE_WEB_SEARCH','string':'Enable\x20web\x20search'});case'AI_CHAT_DISABLE_WEB_SEARCH':return t({'id':'AI_CHAT_DISABLE_WEB_SEARCH','string':'Disable\x20web\x20search'});case'AI_CHAT_REASONING':return t({'id':'AI_CHAT_REASONING','string':'Reasoning'});case'AI_CHAT_ENABLE_REASONING':return t({'id':'AI_CHAT_ENABLE_REASONING','string':'Enable\x20reasoning'});case'AI_CHAT_DISABLE_REASONING':return t({'id':'AI_CHAT_DISABLE_REASONING','string':'Disable\x20reasoning'});case'AI_CHAT_COMMANDS':return t({'id':'AI_CHAT_COMMANDS','string':'Commands'});case'AI_CHAT_SEARCH_RESOURCES':return t({'id':'AI_CHAT_SEARCH_RESOURCES','string':'Search\x20resources'});case'AI_CHAT_CONTEXT_URL_BACK_TO_CONTEXT':return t({'id':'AI_CHAT_CONTEXT_URL_BACK_TO_CONTEXT','string':'Back\x20to\x20context\x20options'});case'AI_CHAT_CONTEXT_URL_ADD_URL':return t({'id':'AI_CHAT_CONTEXT_URL_ADD_URL','string':'Add\x20URL'});case'AI_CHAT_CONTEXT_URL_PLACEHOLDER':return t({'id':'AI_CHAT_CONTEXT_URL_PLACEHOLDER','string':'Add\x20URL...'});case'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_URL':return t({'id':'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_URL','string':'Failed\x20to\x20upload\x20URL:\x20%0.\x20Please\x20try\x20again.'},_0x49ddd8);case'AI_CHAT_CONTEXT_INVALID_DATA':return t({'id':'AI_CHAT_CONTEXT_INVALID_DATA','string':'Invalid\x20context\x20data\x20type\x20for\x20the\x20selected\x20resource.'});case'AI_CHAT_CONTEXT_UNSUPPORTED_TYPE':return t({'id':'AI_CHAT_CONTEXT_UNSUPPORTED_TYPE','string':'Unsupported\x20resource\x20type.\x20Only\x20files\x20and\x20URLs\x20are\x20supported.'});case'AI_CHAT_CONTEXT_URL_EMPTY_ERROR':return t({'id':'AI_CHAT_CONTEXT_URL_EMPTY_ERROR','string':'URL\x20cannot\x20be\x20empty.'});case'AI_CHAT_CONTEXT_URL_INVALID_ERROR':return t({'id':'AI_CHAT_CONTEXT_URL_INVALID_ERROR','string':'Please\x20enter\x20a\x20valid\x20URL.'});case'AI_CHAT_INVALID_REQUEST':return t({'id':'AI_CHAT_INVALID_REQUEST','string':'Something\x20went\x20wrong\x20while\x20processing\x20your\x20request.\x20Please\x20try\x20again.'});case'AI_CHAT_CONTEXT_UNSUPPORTED_FILE_TYPE':return t({'id':'AI_CHAT_CONTEXT_UNSUPPORTED_FILE_TYPE','string':'The\x20file\x20type\x20is\x20not\x20supported.\x20Please\x20upload\x20a\x20different\x20file.'});case'AI_CHAT_CONTEXT_FILE_TOO_LARGE':return t({'id':'AI_CHAT_CONTEXT_FILE_TOO_LARGE','string':'The\x20file\x20is\x20too\x20large.\x20Please\x20upload\x20a\x20smaller\x20file.'});case'AI_CHAT_CONTEXT_FILE_TOO_MANY_PAGES':return t({'id':'AI_CHAT_CONTEXT_FILE_TOO_MANY_PAGES','string':'The\x20file\x20has\x20too\x20many\x20pages.\x20Please\x20upload\x20a\x20file\x20with\x20fewer\x20pages.'});case'AI_CHAT_CONTEXT_FORM_DATA_SIZE_LIMITS_EXCEEDED':return t({'id':'AI_CHAT_CONTEXT_FORM_DATA_SIZE_LIMITS_EXCEEDED','string':'The\x20form\x20data\x20size\x20limits\x20are\x20exceeded.\x20Please\x20upload\x20a\x20smaller\x20file.'});case'AI_CHAT_FEED_LOADING_MESSAGE_REGULAR':return t({'id':'AI_CHAT_FEED_LOADING_MESSAGE_REGULAR','string':'AI\x20is\x20preparing\x20a\x20response...'});case'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH':return t({'id':'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH','string':'AI\x20is\x20searching\x20the\x20web\x20to\x20provide\x20the\x20most\x20accurate\x20answer...'});case'AI_CHAT_FEED_LOADING_MESSAGE_REASONING':return t({'id':'AI_CHAT_FEED_LOADING_MESSAGE_REASONING','string':'AI\x20is\x20using\x20reasoning\x20to\x20provide\x20the\x20most\x20accurate\x20answer...'});case'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH_REASONING':return t({'id':'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH_REASONING','string':'AI\x20is\x20using\x20reasoning\x20and\x20searching\x20the\x20web\x20to\x20provide\x20the\x20most\x20accurate\x20answer...'});case'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH':return t({'id':'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH','string':'Scanned\x20the\x20internet\x20for\x20insights'});case'AI_CHAT_FEED_REPLY_ITEM_USED_REASONING':return t({'id':'AI_CHAT_FEED_REPLY_ITEM_USED_REASONING','string':'AI\x20used\x20reasoning\x20to\x20improve\x20the\x20response'});case'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH_REASONING':return t({'id':'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH_REASONING','string':'AI\x20used\x20search\x20and\x20reasoning\x20to\x20improve\x20the\x20response'});case'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REGULAR':return t({'id':'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REGULAR','string':'Ask\x20AI\x20anything...'});case'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH':return t({'id':'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH','string':'Ask\x20AI\x20anything\x20(web\x20search\x20enabled)...'});case'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REASONING':return t({'id':'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REASONING','string':'Ask\x20AI\x20anything\x20(reasoning\x20enabled)...'});case'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH_REASONING':return t({'id':'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH_REASONING','string':'Ask\x20AI\x20anything\x20(web\x20search\x20and\x20reasoning\x20enabled)...'});case'AI_CHAT_SUGGESTION_ACTION_SUGGEST_ALL':return t({'id':'AI_CHAT_SUGGESTION_ACTION_SUGGEST_ALL','string':'Suggest\x20all'},_0x49ddd8);case'AI_CHAT_SUGGESTION_ACTION_SUGGEST':return t({'id':'AI_CHAT_SUGGESTION_ACTION_SUGGEST','string':'Suggest'},_0x49ddd8);case'AI_CHAT_SUGGESTION_ACTION_APPLY_ALL':return t({'id':'AI_CHAT_SUGGESTION_ACTION_APPLY_ALL','string':'Apply\x20all'});case'AI_CHAT_SUGGESTION_ACTION_APPLY':return t({'id':'AI_CHAT_SUGGESTION_ACTION_APPLY','string':'Apply'});case'AI_CHAT_SUGGESTION_MORE_OPTIONS_TOOLTIP':return t({'id':'AI_CHAT_SUGGESTION_MORE_OPTIONS_TOOLTIP','string':'More\x20options'},_0x49ddd8);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.'},_0x49ddd8);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.'},_0x49ddd8);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.'},_0x49ddd8);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.'},_0x49ddd8);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'},_0x49ddd8);case'AI_BALLOON_APPLY_BUTTON':return t({'id':'AI_BALLOON_APPLY_BUTTON','string':'Apply'});case'AI_BALLOON_SUGGEST_BUTTON':return t({'id':'AI_BALLOON_SUGGEST_BUTTON','string':'Suggest'});case'AI_BALLOON_NEXT_LABEL':return t({'id':'AI_BALLOON_NEXT_LABEL','string':'Next'});case'AI_BALLOON_PREVIOUS_LABEL':return t({'id':'AI_BALLOON_PREVIOUS_LABEL','string':'Previous'});case'AI_SUGGESTION_NO_PARTS_WARNING':return t({'id':'AI_SUGGESTION_NO_PARTS_WARNING','string':'This\x20change\x20is\x20not\x20supported\x20by\x20the\x20editor\x20and\x20can\x27t\x20be\x20previewed\x20or\x20applied.'});case'AI_SUGGESTION_EMPTY_PART_WARNING':return t({'id':'AI_SUGGESTION_EMPTY_PART_WARNING','string':'Some\x20of\x20the\x20changes\x20are\x20not\x20supported\x20by\x20the\x20editor\x20and\x20can\x27t\x20be\x20previewed\x20or\x20applied.'});case'AI_ACTIONS_TRY_AGAIN':return t({'id':'AI_ACTIONS_TRY_AGAIN','string':'Retry'});case'AI_ACTIONS_PREVIOUS_INTERACTION':return t({'id':'AI_ACTIONS_PREVIOUS_INTERACTION','string':'Previous'});case'AI_ACTIONS_NEXT_INTERACTION':return t({'id':'AI_ACTIONS_NEXT_INTERACTION','string':'Next'});case'AI_MODEL_NAME_AUTO':return t({'id':'AI_MODEL_NAME_AUTO','string':'Auto'});case'AI_QUICK_ACTIONS_HEADING':return t({'id':'AI_QUICK_ACTIONS_HEADING','string':'AI\x20Quick\x20Actions'});case'AI_QUICK_ACTIONS_SEARCH':return t({'id':'AI_QUICK_ACTIONS_SEARCH','string':'Search\x20AI\x20commands'});case'AI_QUICK_ACTIONS_SEARCH_NOT_FOUND':return t({'id':'AI_QUICK_ACTIONS_SEARCH_NOT_FOUND','string':'No\x20AI\x20commands\x20found'});case'AI_QUICK_ACTIONS_ASK_AI':return t({'id':'AI_QUICK_ACTIONS_ASK_AI','string':'Ask\x20AI'});case'AI_QUICK_ACTIONS_CHAT_COMMANDS':return t({'id':'AI_QUICK_ACTIONS_CHAT_COMMANDS','string':'Chat\x20commands'});case'AI_QUICK_ACTIONS_IMPROVE_WRITING':return t({'id':'AI_QUICK_ACTIONS_IMPROVE_WRITING','string':'Improve\x20writing'});case'AI_QUICK_ACTIONS_CONTINUE_WRITING':return t({'id':'AI_QUICK_ACTIONS_CONTINUE_WRITING','string':'Continue\x20writing'});case'AI_QUICK_ACTIONS_FIX_GRAMMAR_SPELLING':return t({'id':'AI_QUICK_ACTIONS_FIX_GRAMMAR_SPELLING','string':'Fix\x20grammar\x20&\x20spelling'});case'AI_QUICK_ACTIONS_ADJUST_LENGTH':return t({'id':'AI_QUICK_ACTIONS_ADJUST_LENGTH','string':'Adjust\x20length'});case'AI_QUICK_ACTIONS_CHANGE_TONE':return t({'id':'AI_QUICK_ACTIONS_CHANGE_TONE','string':'Change\x20tone'});case'AI_QUICK_ACTIONS_TRANSLATE':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE','string':'Translate'});case'AI_QUICK_ACTIONS_EXPLAIN':return t({'id':'AI_QUICK_ACTIONS_EXPLAIN','string':'Explain'});case'AI_QUICK_ACTIONS_SUMMARIZE':return t({'id':'AI_QUICK_ACTIONS_SUMMARIZE','string':'Summarize'});case'AI_QUICK_ACTIONS_HIGHLIGHT_KEY_POINTS':return t({'id':'AI_QUICK_ACTIONS_HIGHLIGHT_KEY_POINTS','string':'Highlight\x20key\x20points'});case'AI_QUICK_ACTIONS_MAKE_SHORTER':return t({'id':'AI_QUICK_ACTIONS_MAKE_SHORTER','string':'Make\x20shorter'});case'AI_QUICK_ACTIONS_MAKE_LONGER':return t({'id':'AI_QUICK_ACTIONS_MAKE_LONGER','string':'Make\x20longer'});case'AI_QUICK_ACTIONS_MORE_CASUAL':return t({'id':'AI_QUICK_ACTIONS_MORE_CASUAL','string':'More\x20casual'});case'AI_QUICK_ACTIONS_MORE_DIRECT':return t({'id':'AI_QUICK_ACTIONS_MORE_DIRECT','string':'More\x20direct'});case'AI_QUICK_ACTIONS_MORE_FRIENDLY':return t({'id':'AI_QUICK_ACTIONS_MORE_FRIENDLY','string':'More\x20friendly'});case'AI_QUICK_ACTIONS_MORE_CONFIDENT':return t({'id':'AI_QUICK_ACTIONS_MORE_CONFIDENT','string':'More\x20confident'});case'AI_QUICK_ACTIONS_MORE_PROFESSIONAL':return t({'id':'AI_QUICK_ACTIONS_MORE_PROFESSIONAL','string':'More\x20professional'});case'AI_QUICK_ACTIONS_ADJUST_BASED_ON_DOCUMENT':return t({'id':'AI_QUICK_ACTIONS_ADJUST_BASED_ON_DOCUMENT','string':'Adjust\x20based\x20on\x20the\x20rest\x20of\x20the\x20document'});case'AI_QUICK_ACTIONS_TRANSLATE_ENGLISH':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_ENGLISH','string':'English'});case'AI_QUICK_ACTIONS_TRANSLATE_CHINESE':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_CHINESE','string':'Chinese\x20(Simplified)'});case'AI_QUICK_ACTIONS_TRANSLATE_FRENCH':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_FRENCH','string':'French'});case'AI_QUICK_ACTIONS_TRANSLATE_JAPANESE':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_JAPANESE','string':'Japanese'});case'AI_QUICK_ACTIONS_TRANSLATE_PORTUGUESE':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_PORTUGUESE','string':'Portuguese'});case'AI_QUICK_ACTIONS_TRANSLATE_KOREAN':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_KOREAN','string':'Korean'});case'AI_QUICK_ACTIONS_TRANSLATE_ITALIAN':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_ITALIAN','string':'Italian'});case'AI_QUICK_ACTIONS_TRANSLATE_RUSSIAN':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_RUSSIAN','string':'Russian'});case'AI_QUICK_ACTIONS_TRANSLATE_SPANISH':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_SPANISH','string':'Spanish'});case'AI_QUICK_ACTIONS_TRANSLATE_GERMAN':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_GERMAN','string':'German'});case'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND':return t({'id':'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND','string':'%0\x20plugin\x20is\x20required\x20but\x20not\x20found.'},_0x49ddd8);case'AI_QUICK_ACTIONS_OTHER':return t({'id':'AI_QUICK_ACTIONS_OTHER','string':'Other'});case'AI_ACTIONS_GENERIC_ERROR':return t({'id':'AI_ACTIONS_GENERIC_ERROR','string':'Sorry,\x20we\x20couldn\x27t\x20generate\x20the\x20response.\x20Please\x20try\x20again\x20in\x20a\x20moment.'});case'AI_BALLOON_SELECTION_REMOVED_ERROR':return t({'id':'AI_BALLOON_SELECTION_REMOVED_ERROR','string':'Changes\x20cannot\x20be\x20applied.\x20The\x20original\x20content\x20no\x20longer\x20exists.'});case'AI_REVIEW_MODE_STOP_GENERATING':return t({'id':'AI_REVIEW_MODE_STOP_GENERATING','string':'Stop\x20generating'});case'AI_REVIEW_MODE_HIDE_CHANGES':return t({'id':'AI_REVIEW_MODE_HIDE_CHANGES','string':'Hide\x20changes'});case'AI_REVIEW_MODE_SHOW_CHANGES':return t({'id':'AI_REVIEW_MODE_SHOW_CHANGES','string':'Show\x20changes'});case'AI_REVIEW_MODE_ACCEPT_ALL':return t({'id':'AI_REVIEW_MODE_ACCEPT_ALL','string':'Accept\x20all'});case'AI_REVIEW_MODE_EXIT_REVIEW':return t({'id':'AI_REVIEW_MODE_EXIT_REVIEW','string':'Exit\x20review'});case'AI_REVIEW_MODE_ACCEPT_CHANGE':return t({'id':'AI_REVIEW_MODE_ACCEPT_CHANGE','string':'Accept'});case'AI_REVIEW_MODE_DISMISS_CHANGE':return t({'id':'AI_REVIEW_MODE_DISMISS_CHANGE','string':'Dismiss'});case'AI_REVIEW_MODE_LEARN_MORE':return t({'id':'AI_REVIEW_MODE_LEARN_MORE','string':'Learn\x20more'});case'AI_REVIEW_MODE_COMPLETED_TEXT':return t({'id':'AI_REVIEW_MODE_COMPLETED_TEXT','string':'There\x27s\x20nothing\x20left\x20to\x20review.'});case'AI_REVIEW_MODE_EMPTY_RESULTS_TEXT':return t({'id':'AI_REVIEW_MODE_EMPTY_RESULTS_TEXT','string':'There\x20are\x20no\x20changes\x20to\x20suggest.'});case'AI_REVIEW_MODE_FINISH_REVIEW_BUTTON_LABEL':return t({'id':'AI_REVIEW_MODE_FINISH_REVIEW_BUTTON_LABEL','string':'Finish\x20Review'});case'AI_REVIEW_MODE_FINISH_REVIEW_HEADER_TITLE':return t({'id':'AI_REVIEW_MODE_FINISH_REVIEW_HEADER_TITLE','string':'Review\x20complete.\x20Finish\x20when\x20ready.'});case'AI_REVIEW_INITIALIZATION_ERROR_MESSAGE':return t({'id':'AI_REVIEW_INITIALIZATION_ERROR_MESSAGE','string':'AI\x20Review\x20initialized\x20with\x20errors.\x20Some\x20features\x20may\x20not\x20be\x20available\x20or\x20work\x20properly.'});case'AI_REVIEW_MODE_GENERAL_ERROR_MESSAGE':return t({'id':'AI_REVIEW_MODE_GENERAL_ERROR_MESSAGE','string':'Sorry,\x20we\x20couldn\x27t\x20generate\x20the\x20whole\x20review\x20properly.\x20Please\x20try\x20again\x20in\x20a\x20moment.'});case'AI_REVIEW_MODE_CHUNK_ERROR_MESSAGE':return t({'id':'AI_REVIEW_MODE_CHUNK_ERROR_MESSAGE','string':'Not\x20everything\x20went\x20through,\x20but\x20the\x20completed\x20items\x20are\x20listed\x20below.'});case'AI_REVIEW_MODE':return t({'id':'AI_REVIEW_MODE','string':'Review'});case'AI_REVIEW_MODE_PROMPT_EMPTY_ERROR':return t({'id':'AI_REVIEW_MODE_PROMPT_EMPTY_ERROR','string':'Prompt\x20must\x20not\x20be\x20empty'});case'AI_REVIEW_CHECK_CUSTOM_TITLE':return t({'id':'AI_REVIEW_CHECK_CUSTOM_TITLE','string':'Custom\x20command'});case'AI_REVIEW_CHECK_CUSTOM_DESCRIPTION':return t({'id':'AI_REVIEW_CHECK_CUSTOM_DESCRIPTION','string':'Enter\x20a\x20custom\x20command\x20for\x20a\x20specific\x20review.'});case'AI_REVIEW_CHECK_CORRECTNESS_TITLE':return t({'id':'AI_REVIEW_CHECK_CORRECTNESS_TITLE','string':'Proofread'});case'AI_REVIEW_CHECK_CORRECTNESS_DESCRIPTION':return t({'id':'AI_REVIEW_CHECK_CORRECTNESS_DESCRIPTION','string':'Check\x20the\x20text\x20for\x20errors\x20in\x20grammar,\x20spelling,\x20and\x20punctuation.'});case'AI_REVIEW_CHECK_CLARITY_TITLE':return t({'id':'AI_REVIEW_CHECK_CLARITY_TITLE','string':'Improve\x20clarity'});case'AI_REVIEW_CHECK_CLARITY_DESCRIPTION':return t({'id':'AI_REVIEW_CHECK_CLARITY_DESCRIPTION','string':'Improve\x20the\x20logical\x20structure\x20and\x20precision\x20for\x20clearer\x20message.'});case'AI_REVIEW_CHECK_READABILITY_TITLE':return t({'id':'AI_REVIEW_CHECK_READABILITY_TITLE','string':'Improve\x20readability'});case'AI_REVIEW_CHECK_READABILITY_DESCRIPTION':return t({'id':'AI_REVIEW_CHECK_READABILITY_DESCRIPTION','string':'Adjust\x20sentence\x20structure\x20and\x20word\x20choice\x20for\x20an\x20easier\x20read.'});case'AI_REVIEW_CHECK_MAKE_TITLE':return t({'id':'AI_REVIEW_CHECK_MAKE_TITLE','string':'Adjust\x20length'});case'AI_REVIEW_CHECK_MAKE_DESCRIPTION':return t({'id':'AI_REVIEW_CHECK_MAKE_DESCRIPTION','string':'Shorten\x20or\x20lengthen\x20the\x20text\x20as\x20needed.'});case'AI_REVIEW_CHECK_MAKE_OPTIONS_LABEL':return t({'id':'AI_REVIEW_CHECK_MAKE_OPTIONS_LABEL','string':'Adjust\x20length'});case'AI_REVIEW_CHECK_MAKE_OPTIONS_DATA_LONGER':return t({'id':'AI_REVIEW_CHECK_MAKE_OPTIONS_DATA_LONGER','string':'Longer'});case'AI_REVIEW_CHECK_MAKE_OPTIONS_DATA_SHORTER':return t({'id':'AI_REVIEW_CHECK_MAKE_OPTIONS_DATA_SHORTER','string':'Shorter'});case'AI_REVIEW_CHECK_MAKE_TONE_TITLE':return t({'id':'AI_REVIEW_CHECK_MAKE_TONE_TITLE','string':'Adjust\x20tone\x20and\x20style'});case'AI_REVIEW_CHECK_MAKE_TONE_DESCRIPTION':return t({'id':'AI_REVIEW_CHECK_MAKE_TONE_DESCRIPTION','string':'Modify\x20the\x20text\x20to\x20a\x20desired\x20tone\x20and\x20style.'});case'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_LABEL':return t({'id':'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_LABEL','string':'Adjust\x20tone\x20and\x20style'});case'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_CASUAL':return t({'id':'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_CASUAL','string':'Casual'});case'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_DIRECT':return t({'id':'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_DIRECT','string':'Direct'});case'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_FRIENDLY':return t({'id':'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_FRIENDLY','string':'Friendly'});case'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_CONFIDENT':return t({'id':'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_CONFIDENT','string':'Confident'});case'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_PROFESSIONAL':return t({'id':'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_PROFESSIONAL','string':'Professional'});case'AI_REVIEW_CHECK_TRANSLATE_TITLE':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_TITLE','string':'Translate'});case'AI_REVIEW_CHECK_TRANSLATE_DESCRIPTION':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_DESCRIPTION','string':'Translate\x20the\x20text\x20into\x20another\x20language.'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_LABEL':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_LABEL','string':'Select\x20language'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_ENGLISH':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_ENGLISH','string':'English'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_SPANISH':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_SPANISH','string':'Spanish'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_FRENCH':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_FRENCH','string':'French'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_GERMAN':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_GERMAN','string':'German'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_CHINESE':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_CHINESE','string':'Chinese\x20(Simplified)'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_JAPANESE':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_JAPANESE','string':'Japanese'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_RUSSIAN':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_RUSSIAN','string':'Russian'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_PORTUGUESE':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_PORTUGUESE','string':'Portuguese'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_KOREAN':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_KOREAN','string':'Korean'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_ITALIAN':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_ITALIAN','string':'Italian'});case'AI_REVIEW_MODE_CHECK_STATUS_ACCEPTED':return t({'id':'AI_REVIEW_MODE_CHECK_STATUS_ACCEPTED','string':'Accepted'});case'AI_REVIEW_MODE_CHECK_STATUS_REJECTED':return t({'id':'AI_REVIEW_MODE_CHECK_STATUS_REJECTED','string':'Dismissed'});case'AI_REVIEW_MODE_CHECK_STATUS_OUTDATED':return t({'id':'AI_REVIEW_MODE_CHECK_STATUS_OUTDATED','string':'Outdated'});case'AI_TOGGLE_BUTTON_LABEL':return t({'id':'AI_TOGGLE_BUTTON_LABEL','string':'AI'});case'AI_TRANSLATE_ACCEPT_ALL':return t({'id':'AI_TRANSLATE_ACCEPT_ALL','string':'Accept\x20translation'});case'AI_TRANSLATE_FINISH_HEADER_TITLE':return t({'id':'AI_TRANSLATE_FINISH_HEADER_TITLE','string':'Translation\x20complete.\x20Finish\x20when\x20ready.'});case'AI_TRANSLATE_EMPTY_RESULTS_TEXT':return t({'id':'AI_TRANSLATE_EMPTY_RESULTS_TEXT','string':'There\x20are\x20no\x20translations\x20to\x20review.'});case'AI_TRANSLATE_FINISH_BUTTON_LABEL':return t({'id':'AI_TRANSLATE_FINISH_BUTTON_LABEL','string':'Finish\x20Translation'});case'AI_TRANSLATE_CHECK_LIST_HEADER_TITLE':return t({'id':'AI_TRANSLATE_CHECK_LIST_HEADER_TITLE','string':'Content\x20Translation'});case'AI_TRANSLATE_CHECK_LIST_HEADER_DESCRIPTION':return t({'id':'AI_TRANSLATE_CHECK_LIST_HEADER_DESCRIPTION','string':'A\x20dedicated\x20mode\x20for\x20translating\x20the\x20entire\x20text.'});case'AI_TRANSLATE_CHECK_RESULTS_LOADING_TITLE':return t({'id':'AI_TRANSLATE_CHECK_RESULTS_LOADING_TITLE','string':'Translating\x20to'});case'AI_TRANSLATE_CHECK_RESULTS_READY_TITLE':return t({'id':'AI_TRANSLATE_CHECK_RESULTS_READY_TITLE','string':'Translated\x20to'});case'AI_TRANSLATE_GENERAL_ERROR_MESSAGE':return t({'id':'AI_TRANSLATE_GENERAL_ERROR_MESSAGE','string':'Sorry,\x20we\x20couldn\x27t\x20generate\x20translations\x20properly.\x20Please\x20try\x20again\x20in\x20a\x20moment.'});case'AI_SUGGESTION_DISABLED_TOOLTIP_MESSAGE':return t({'id':'AI_SUGGESTION_DISABLED_TOOLTIP_MESSAGE','string':'This\x20conversation\x20is\x20loaded\x20from\x20chat\x20history\x20from\x20a\x20previous\x20session,\x20so\x20you\x20can’t\x20apply,\x20reject,\x20or\x20suggest\x20changes.'});case'AI_SUGGESTION_DISABLED_FEED_MESSAGE':return t({'id':'AI_SUGGESTION_DISABLED_FEED_MESSAGE','string':'Actions\x20aren’t\x20available\x20for\x20changes\x20from\x20a\x20previous\x20session.'});default:return _0x30007c;}}const os='ck-ai-button-primary',hs='ck-ai-button-secondary',cs='ck-ai-button-tertiary';function ls(_0x593e92,_0x1f9560){const _0x3fcaa4=new kt(_0x593e92),_0x408a0e=as(_0x593e92,'AI_TABS_LABEL_MINIMIZE'),_0x3a5310=as(_0x593e92,'AI_TABS_LABEL_MAXIMIZE');return _0x3fcaa4['set']({'withText':!0x1,'icon':_0x5aca3e,'tooltip':!0x0,'class':'ck-ai-tabs__resize\x20'+cs}),_0x3fcaa4['bind']('label')['to'](_0x1f9560,'isMaximized',_0xcec473=>_0xcec473?_0x408a0e:_0x3a5310),_0x3fcaa4['bind']('icon')['to'](_0x1f9560,'isMaximized',_0x10ca08=>_0x10ca08?_0x44541d:_0x5aca3e),_0x3fcaa4['bind']('isOn')['to'](_0x1f9560,'isMaximized'),_0x3fcaa4['on']('execute',()=>{_0x1f9560['fire']('resizeTabs');}),_0x3fcaa4;}function us(_0x2d66f4){return _0x377a34(_0x2d66f4);}function ds(_0x181a0b){return _0x1f30d8(_0x181a0b);}function _s(_0x209d35,_0x27f060,_0x491afa){const _0x30cb18=null!==_0x27f060?_0x1becb2=>_0x1becb2['attribs'][_0x209d35]===_0x27f060:_0x1a2d06=>Boolean(_0x1a2d06['attribs'][_0x209d35]);return _0x47e0e5(_0x148df3=>_0x373786(_0x148df3)&&_0x30cb18(_0x148df3),_0x491afa);}function As(_0x13fc15,_0x227fb7,_0x575b16){const _0x15ae57=null!==_0x227fb7?_0x2034ca=>_0x2034ca['attribs'][_0x13fc15]===_0x227fb7:_0x46b7c6=>Boolean(_0x46b7c6['attribs'][_0x13fc15]);return _0x2ffee2(_0xf185e9=>_0x373786(_0xf185e9)&&_0x15ae57(_0xf185e9),_0x575b16);}function gs(_0x3a5212,_0x18ce47){return _0x3a5212&&_0x373786(_0x3a5212)?_0x3a5212['attribs'][_0x18ce47]:null;}function Is(_0x5d185e,_0x36d5c1,_0x2b8eaf){_0x373786(_0x5d185e)&&(null===_0x2b8eaf?delete _0x5d185e['attribs'][_0x36d5c1]:_0x5d185e['attribs'][_0x36d5c1]=_0x2b8eaf);}function Es(_0x3f8f3c,_0x4e03e0,_0x25db6a){const _0x47176b=_0x4e03e0['cloneNode'](!0x0);'beforebegin'===_0x25db6a?_0x59927b(_0x3f8f3c,_0x47176b):'afterbegin'===_0x25db6a?_0x594f4f(_0x3f8f3c,_0x47176b):'beforeend'===_0x25db6a?_0x2767d3(_0x3f8f3c,_0x47176b):'afterend'===_0x25db6a&&_0x447d6a(_0x3f8f3c,_0x47176b);}function Ts(_0x5daef4){const _0x1bab12=[];let _0x89ee5c=_0x5daef4;for(;_0x89ee5c;)_0x89ee5c=_0x1192ba(_0x89ee5c),_0x89ee5c&&_0x1bab12['push'](_0x89ee5c);return _0x1bab12;}function ps(_0x505477){return _0x505477['replace'](/^\s+/gm,'')['replace'](/\s+$/gm,'')['replace'](/\n*/g,'')['replace'](/\s+/g,'\x20')['replace'](/>\s*</g,'><');}function ms(_0x15437b){let _0x2a824a=0x0;for(;_0x15437b['parentNode'];)_0x15437b=_0x15437b['parentNode'],_0x2a824a++;return _0x2a824a;}function Cs(_0x4b2dd5){const _0x5e31a3=[];let _0x2adcd7=_0x4b2dd5['nextSibling'];for(;_0x2adcd7;)_0x5e31a3['push'](_0x2adcd7),_0x2adcd7=_0x2adcd7['nextSibling'];_0x5e31a3['forEach'](_0x424158=>{_0x487133(_0x424158);});}class ws extends/* #__PURE__ -- @preserve */
25
+ ht(){['_m2html'];constructor(){super();const _0x924f0a=Object['entries'](_0x527de2),_0xabdd02=_0x924f0a['findIndex'](([_0x45ec4a])=>'rehypeDomRaw'===_0x45ec4a);if(-0x1===_0xabdd02)throw new ot('ai-response-parser-unable-to-set-up-parser');_0x924f0a['splice'](_0xabdd02+0x1,0x0,['rehypeSanitize',_0x501167]),this['_m2html']=new _0x10b843({'plugins':Object['fromEntries'](_0x924f0a)});}['convertMarkdownToHTML'](_0x13a7c2){const _0x392cc2=this['_m2html']['parse'](_0x13a7c2);return this['parseAndNormalizeHTML'](_0x392cc2);}['parseAndNormalizeHTML'](_0x32b97){return this['_parseHTML'](_0x32b97);}['_parseHTML'](_0x44fb0b){const _0x3d55c6=us('<dummy>'+_0x44fb0b['replace'](/^\t+/gm,'\x20')['replace'](/\n*/g,'')['replace'](/\s+/g,'\x20')['replace'](/<[^>]*?$/g,'')+'</dummy>');return _0x3d55c6['children']=_0x3d55c6['children'][0x0]['children'],_0x3d55c6;}}class fs extends/* #__PURE__ -- @preserve */
26
+ ht(){['_generateUid'];['_touchedNodesState']={'newIds':[],'modifiedIds':[],'removedIds':[],'invalidIds':[],'lastTouchedId':null};['_existingDataIds']=new Set();constructor(_0x318c3d){super(),this['_generateUid']=_0x318c3d||at;}['merge'](_0x5d81ac,_0x440538,_0x1c688b){const _0x428adb=_0x5d81ac['cloneNode'](!0x0);if(0x0===_0x440538['childNodes']['length']){const _0x2b8f1f=[];return As('data-id','new-element',_0x428adb)['forEach'](_0x15116a=>{const _0x4f66b4=this['_generateUid']();Is(_0x15116a,'data-id',_0x4f66b4),_0x2b8f1f['push'](_0x4f66b4);}),this['_removeSpecialComments'](_0x428adb),{'parsedContent':_0x428adb,'newNodeIds':_0x2b8f1f,'modifiedNodeIds':[],'removedNodeIds':[]};}_0x1c688b&&_0x1c688b['markUnstableElements']&&this['_markLastTagElementUnstable'](_0x428adb),this['_touchedNodesState']['newIds']=[],this['_touchedNodesState']['modifiedIds']=[],this['_touchedNodesState']['removedIds']=[],this['_touchedNodesState']['invalidIds']=[],this['_touchedNodesState']['lastTouchedId']=null,this['_existingDataIds']=new Set(As('data-id',null,_0x440538)['map'](_0x33245a=>gs(_0x33245a,'data-id'))['filter'](_0x358c70=>!!_0x358c70));let _0x1adc90=-0x1,_0x30885e=!0x1;const _0x524bc9=_0x428adb['childNodes'],_0x1a596a=Array['from'](_0x524bc9)['filter'](_0x4d00d4=>!(0x3===_0x4d00d4['nodeType']&&''===ds(_0x4d00d4)['trim']())),_0x1c7ebb=_0x1a596a['length'];for(let _0x4778ef=0x0;_0x4778ef<_0x1c7ebb;_0x4778ef++){const _0x4f8a8f=_0x1a596a[_0x4778ef],_0x5d564e=_0x1a596a[_0x4778ef+0x1];if(this['_isNewNode'](_0x4f8a8f)){if(-0x1===_0x1adc90&&(_0x1adc90=_0x4778ef),this['_markWrappedElements'](_0x4f8a8f),!this['_isNewNode'](_0x5d564e)){const [_0x2aaf9a,_0x519765]=this['_findReferenceNode'](_0x4f8a8f,_0x30885e,_0x440538);if(_0x2aaf9a){const _0x3683ec=Array['from'](_0x1a596a)['slice'](_0x1adc90,_0x4778ef+0x1);this['_insertNodes'](_0x2aaf9a,_0x3683ec,_0x519765),_0x1adc90=-0x1;}}}else{if(this['_isExistingContentComment'](_0x4f8a8f))_0x30885e=!0x0;else{if(this['_isExistingNode'](_0x4f8a8f)){const _0x4f8bb9=gs(_0x4f8a8f,'data-id');if(_0x4f8bb9&&this['_existingDataIds']['has'](_0x4f8bb9)){const _0x13ef84=_s('data-id',_0x4f8bb9,_0x440538);this['_replaceNode'](_0x13ef84,_0x4f8a8f);}if(this['_touchedNodesState']['removedIds']['includes'](_0x4f8bb9)){const _0x2ae9e5=this['_touchedNodesState']['removedIds']['indexOf'](_0x4f8bb9);this['_touchedNodesState']['removedIds']['splice'](_0x2ae9e5,0x1);}}else{if(this['_isDelNode'](_0x4f8a8f)){const _0x1c70a6=gs(_0x4f8a8f,'data-id');this['_touchedNodesState']['modifiedIds']['includes'](_0x1c70a6)||this['_storeDeletedElementIds'](_0x4f8a8f);}}}}}for(const _0xba41a of this['_touchedNodesState']['removedIds']){const _0x39b317=_s('data-id',_0xba41a,_0x440538);if(_0x39b317){if(_0x1c688b&&_0x1c688b['replaceRemovedWith']){this['_touchedNodesState']['lastTouchedId']=_0xba41a;const _0x4d2023=_0x1c688b['replaceRemovedWith']['cloneNode'](!0x0);Is(_0x4d2023,'data-id',_0xba41a),Is(_0x4d2023,'data-removed','true'),_0x4587bc(_0x39b317,_0x4d2023);}else _0x487133(_0x39b317);}}if(As('data-wrapped-id',null,_0x440538)['forEach'](_0x209a0b=>{const _0x57982a=_s('data-id',gs(_0x209a0b,'data-wrapped-id'),_0x440538);var _0x1f8558,_0x387734;_0x57982a&&(_0x387734=_0x209a0b,_0x487133(_0x1f8558=_0x57982a),_0x4587bc(_0x387734,_0x1f8558));}),As('data-id','new-element',_0x440538)['forEach'](_0x2110c3=>{const _0x4465fd=this['_getUid'](_0x2110c3);Is(_0x2110c3,'data-id',_0x4465fd),this['_touchedNodesState']['newIds']['push'](_0x4465fd);}),this['_removeSpecialComments'](_0x440538),_0x1c688b&&_0x1c688b['markUnstableElements']&&this['_markUnstableElements'](_0x440538,_0x1c688b['markUnstableElementsDepth']||0x0),_0x1c688b&&_0x1c688b['cutAfterLastChange']&&this['_touchedNodesState']['lastTouchedId']){let _0x3c1cec=_s('data-id',this['_touchedNodesState']['lastTouchedId'],_0x440538);for(;_0x3c1cec;)Cs(_0x3c1cec),_0x3c1cec=_0x3c1cec['parentNode'];}return{'parsedContent':_0x440538,'newNodeIds':this['_touchedNodesState']['newIds'],'modifiedNodeIds':this['_touchedNodesState']['modifiedIds'],'removedNodeIds':this['_touchedNodesState']['removedIds']};}['_insertNodes'](_0x47b7a2,_0xd29a26,_0x552667){for(const _0x38e1fb of _0xd29a26){const _0x570332=this['_getUid'](_0x38e1fb);Is(_0x38e1fb,'data-id',_0x570332),this['_touchedNodesState']['newIds']['push'](_0x570332),this['_touchedNodesState']['lastTouchedId']=_0x570332;}const _0x446572='afterbegin'===_0x552667||'afterend'===_0x552667?_0xd29a26['reverse']():_0xd29a26;for(const _0x5e3ded of _0x446572)Es(_0x47b7a2,_0x5e3ded,_0x552667);}['_replaceNode'](_0x558671,_0xa26cc1){if(!_0x558671)return;if(_0x379654=_0xa26cc1,ps(ds(_0x558671))===ps(ds(_0x379654)))return;var _0x379654;const _0x2d9bb0=this['_getUid'](_0x558671);Is(_0xa26cc1,'data-id',_0x2d9bb0),this['_touchedNodesState']['modifiedIds']['push'](_0x2d9bb0),this['_touchedNodesState']['lastTouchedId']=_0x2d9bb0,_0x4587bc(_0x558671,_0xa26cc1['cloneNode'](!0x0));}['_findReferenceNode'](_0x57d9f3,_0x102b7e,_0x2bb59a){const _0x974ed3=this['_findPrevElementWithDataId'](_0x57d9f3,!0x1);if(_0x974ed3){const _0x53d982=this['_getNodeDataId'](_0x974ed3),_0xbe457e=_s('data-id',_0x53d982,_0x2bb59a);if(_0xbe457e)return[_0xbe457e,'afterend'];this['_touchedNodesState']['invalidIds']['push'](_0x53d982);}const _0x83cae=this['_findNextElementWithDataId'](_0x57d9f3,!0x1);if(_0x83cae){const _0x4024b2=this['_getNodeDataId'](_0x83cae),_0x54a7f9=_s('data-id',_0x4024b2,_0x2bb59a);if(_0x54a7f9)return[_0x54a7f9,'beforebegin'];this['_touchedNodesState']['invalidIds']['push'](_0x4024b2);}return _0x102b7e?_0x57d9f3['nextSibling']?this['_findFallbackReferenceNode'](_0x57d9f3,_0x2bb59a):[_0x2bb59a['childNodes'][_0x2bb59a['childNodes']['length']-0x1],'afterend']:[_0x2bb59a['childNodes'][0x0],'beforebegin'];}['_findFallbackReferenceNode'](_0x5087ff,_0x4df5d5){const _0x598899=[],_0x376660=this['_findPrevElementWithDataId'](_0x5087ff,!0x0);if(_0x376660){const _0x48eb85=_s('data-id',this['_getNodeDataId'](_0x376660),_0x4df5d5);_0x48eb85&&_0x598899['push']([_0x48eb85,'afterend']);}const _0x383efd=this['_findNextElementWithDataId'](_0x5087ff,!0x0);if(_0x383efd){const _0xe163c5=_s('data-id',this['_getNodeDataId'](_0x383efd),_0x4df5d5);_0xe163c5&&_0x598899['push']([_0xe163c5,'beforebegin']);}if(_0x598899['length']>0x1)return ms(_0x598899[0x0][0x0])<=ms(_0x598899[0x1][0x0])?_0x598899[0x0]:_0x598899[0x1];return 0x1===_0x598899['length']?_0x598899[0x0]:[_0x4df5d5['lastChild'],'afterend'];}['_findNextElementWithDataId'](_0x32f4ca,_0x3b663f){let _0x2683d8=_0x32f4ca['nextSibling'],_0x3d800a=null,_0x233d3a=!0x1;for(;_0x2683d8;){if(_0x66eaac(_0x2683d8)){if(this['_isDelNode'](_0x2683d8)&&(_0x3d800a=_0x2683d8),this['_isExistingContentComment'](_0x2683d8)&&_0x3b663f&&!_0x233d3a){_0x233d3a=!0x0,_0x2683d8=_0x2683d8['nextSibling'];continue;}break;}const _0x30672a=gs(_0x2683d8,'data-id');if(_0x30672a&&'new-element'!==_0x30672a&&this['_existingDataIds']['has'](_0x30672a)){_0x3d800a=_0x2683d8;break;}_0x2683d8=_0x2683d8['nextSibling'];}return _0x3d800a;}['_findPrevElementWithDataId'](_0x2bd006,_0x5a29d5){let _0x18abe8=_0x2bd006['previousSibling'],_0x409847=null,_0x15ae7f=!0x1;for(;_0x18abe8;){if(_0x66eaac(_0x18abe8)){if(this['_isDelNode'](_0x18abe8)&&(_0x409847=_0x18abe8),this['_isExistingContentComment'](_0x18abe8)&&_0x5a29d5&&!_0x15ae7f){_0x15ae7f=!0x0,_0x18abe8=_0x18abe8['previousSibling'];continue;}break;}const _0x1063a8=gs(_0x18abe8,'data-id');if(_0x1063a8&&'new-element'!==_0x1063a8&&this['_existingDataIds']['has'](_0x1063a8)){_0x409847=_0x18abe8;break;}_0x18abe8=_0x18abe8['previousSibling'];}return _0x409847;}['_markWrappedElements'](_0x11e775){_0x373786(_0x11e775)&&As('data-id',null,_0x11e775)['forEach'](_0x481250=>{this['_isExistingNode'](_0x481250)&&!this['_hasWrappedParent'](_0x481250)&&(Is(_0x481250,'data-wrapped-id',gs(_0x481250,'data-id')),Is(_0x481250,'data-id',null));});}['_getNodeDataId'](_0x35ff36){if(!_0x35ff36)return null;if(_0x373786(_0x35ff36))return gs(_0x35ff36,'data-id');if(_0x66eaac(_0x35ff36)){const _0x3ee758=ds(_0x35ff36)['match'](/removed[\s*-]data-id="([^"]+)"/);if(_0x3ee758&&_0x3ee758[0x1])return _0x3ee758[0x1];}return null;}['_storeDeletedElementIds'](_0x49b69d){if(_0x66eaac(_0x49b69d)){const _0x1c0698=ds(_0x49b69d)['match'](/removed[\s*-]data-id="([^"]+)"/);_0x1c0698&&_0x1c0698[0x1]&&this['_touchedNodesState']['removedIds']['push'](_0x1c0698[0x1]);}}['_getUid'](_0x1276cc){return this['_isExistingNode'](_0x1276cc)?gs(_0x1276cc,'data-id'):this['_generateUid']();}['_removeSpecialComments'](_0x5b40c5){(function(_0x38bf35){return _0x277bff(_0x3d3bb3=>_0x66eaac(_0x3d3bb3),_0x38bf35,!0x0,0x1/0x0);}(_0x5b40c5)['filter'](_0x5c4eed=>this['_isDelNode'](_0x5c4eed)||this['_isExistingContentComment'](_0x5c4eed))['forEach'](_0x1a1909=>{_0x487133(_0x1a1909);}));}['_markLastTagElementUnstable'](_0x2a3332){const _0x1df998=_0x2a3332['childNodes'],_0x300c1e=_0x1df998[_0x1df998['length']-0x1];_0x300c1e&&_0x373786(_0x300c1e)&&Is(_0x300c1e,'data-unstable','true');}['_markUnstableElements'](_0x241e86,_0x343dae){const _0x3cf40c=_s('data-unstable','true',_0x241e86);if(!_0x3cf40c)return;const _0xc80045=Ts(_0x3cf40c)['slice'](0x0,-0x1),_0x58ca09=_0xc80045['length'];let _0x2d08c0=_0x3cf40c;if(_0x58ca09>_0x343dae){let _0x4ca5f4=_0x58ca09,_0x362e5a=null;for(;_0x4ca5f4>_0x343dae&&_0x4ca5f4>=0x0;)_0x4ca5f4--,_0x362e5a=_0xc80045[_0x4ca5f4];_0x362e5a&&(_0x2d08c0=_0x362e5a,Is(_0x3cf40c,'data-unstable',null),Is(_0x362e5a,'data-unstable','true'));}else{if(_0x58ca09<_0x343dae){let _0x516a6b=_0x58ca09,_0x2c09e7=_0x3cf40c;for(;_0x516a6b<_0x343dae;){const _0x4ba8f9=_0x2c09e7['childNodes']['filter'](_0x16a487=>_0x373786(_0x16a487));if(0x0===_0x4ba8f9['length'])break;_0x516a6b++,_0x2c09e7=_0x4ba8f9[_0x4ba8f9['length']-0x1];}_0x2c09e7&&(_0x2d08c0=_0x2c09e7,Is(_0x3cf40c,'data-unstable',null),Is(_0x2c09e7,'data-unstable','true'));}}let _0x25b69a=_0x2d08c0;for(;_0x25b69a;){for(;_0x25b69a['nextSibling'];)_0x25b69a=_0x25b69a['nextSibling'],_0x373786(_0x25b69a)&&Is(_0x25b69a,'data-unstable','true');_0x25b69a=_0x25b69a['parentNode'];}}['_isNewNode'](_0x462091){return Boolean('new-element'===gs(_0x462091,'data-id'));}['_isExistingNode'](_0x5cb17b){return Boolean((gs(_0x5cb17b,'data-id')||'')['length']>0x0&&'new-element'!==gs(_0x5cb17b,'data-id'));}['_isDelNode'](_0x347e77){return!!_0x347e77&&Boolean(_0x66eaac(_0x347e77)&&ds(_0x347e77)['match'](/removed[\s*-]data-id="[^"]+"/));}['_hasWrappedParent'](_0x29a3d5){let _0x3c002b=_0x29a3d5['parentNode'];for(;_0x3c002b;){if(gs(_0x3c002b,'data-wrapped-id'))return!0x0;_0x3c002b=_0x3c002b['parentNode'];}return!0x1;}['_isExistingContentComment'](_0x20db4e){return Boolean(_0x66eaac(_0x20db4e)&&ds(_0x20db4e)['match'](/\s*existing[\s*-](content|document)\s*/g));}}function Ss({editor:_0x287a38,changeGroups:_0x4eecfc,documentContextContent:_0x25d2e5,showDiff:_0x195ec1,trimUnchanged:_0x2f4bb0=!0x0}){return _0x4eecfc['map'](_0x954dc7=>{const _0x32dc80=new _0x11b267([]),_0x433f75=new _0x11b267([]);for(const _0x3019c3 of _0x954dc7['changes'])if(_0x195ec1&&'removed'==_0x3019c3['type']||_0x433f75['children']['push'](_0x3019c3['node']['cloneNode'](!0x0)),'new'!=_0x3019c3['type']&&(_0x195ec1||'removed'!=_0x3019c3['type'])){const _0x3fe2b1=_0x47e0e5(_0x38c7b9=>gs(_0x38c7b9,'data-id')==_0x3019c3['id'],_0x25d2e5,!0x0);_0x3fe2b1&&_0x32dc80['children']['push'](_0x3fe2b1['cloneNode'](!0x0));}const {content:_0x1b5bd2,hasChanges:_0x5c3a5e}=function(_0x3ae4a4,_0x5a9be5,_0x589b0f,_0x1d9bd4,_0x20abac=!0x0){const _0x119530=_0x3ae4a4['plugins']['get']('DocumentCompare'),_0x542b93=ds(_0x5a9be5),_0x5e59ca=ds(_0x589b0f),_0x2318ed=_0x3ae4a4['data']['parse'](_0x542b93,'$root'),_0x485cef=_0x3ae4a4['model']['createPositionAt'](_0x2318ed,0x0),_0x4e898b=_0x119530['getDiff'](_0x542b93,_0x5e59ca,{'anchor':_0x485cef,'markDeletions':_0x1d9bd4}),_0x598a6c=_0x4e898b['getOperations']();if(0x0==_0x598a6c['length'])return{'content':_0x5a9be5['cloneNode'](!0x0),'hasChanges':!0x1};_0x1d9bd4?function(_0x4936f9,_0x4a3ccb,_0x4fe2c0){if(0x0==_0x4936f9['length'])return;const _0x47dc98=_0x4fe2c0['plugins']['get']('DocumentCompare'),_0x3fa57c=_0x4fe2c0['plugins']['get']('SuggestionsConversion');_0x4fe2c0['model']['change'](_0x47630c=>{const _0x4b80a5=new Set();for(let _0xd3c299=0x0;_0xd3c299<_0x4936f9['length'];_0xd3c299++){const _0xc3e760=_0x4936f9[_0xd3c299];if(_0xc3e760['baseVersion']=null,_0xc3e760['isDocumentOperation']=!0x1,_0x47dc98['isMarkedRemoveOperation'](_0xc3e760)){const _0x467717=_0xec531(_0xc3e760['newRange'],_0x4fe2c0['model']),_0x257a8d='suggestion:deletion:'+at()+':$aiSuggestion';_0x4a3ccb['markers']['set'](_0x257a8d,_0x467717);}else switch(_0xc3e760['type']){case'rename':{if(_0xc3e760['oldName']==_0xc3e760['newName'])break;_0x47630c['batch']['addOperation'](_0xc3e760),_0x4fe2c0['model']['applyOperation'](_0xc3e760);const _0x384e5a='$elementName',_0x35f388=_0xc3e760['position'],_0x1dc5f5=_0x4fe2c0['model']['createRange'](_0x35f388,_0x4fe2c0['model']['createPositionAt'](_0x35f388['nodeAfter'],'end')),_0x34db3c='suggestion:attribute:'+_0x384e5a+':'+at()+':$aiSuggestion';_0x4a3ccb['markers']['set'](_0x34db3c,_0x1dc5f5);break;}case'addAttribute':case'removeAttribute':case'changeAttribute':{if(_0xc3e760['oldValue']==_0xc3e760['newValue'])break;_0x47630c['batch']['addOperation'](_0xc3e760),_0x4fe2c0['model']['applyOperation'](_0xc3e760);const _0x225cf8=_0xc3e760['key'];if(!_0x3fa57c['isRegisteredAttribute'](_0x225cf8))break;const _0x2ae76d=_0xec531(_0xc3e760['range'],_0x4fe2c0['model']),_0x2c396d='suggestion:attribute:'+_0x225cf8+':'+at()+':$aiSuggestion';_0x4a3ccb['markers']['set'](_0x2c396d,_0x2ae76d);break;}case'insert':{_0x47630c['batch']['addOperation'](_0xc3e760),_0x4fe2c0['model']['applyOperation'](_0xc3e760);if(_0x4936f9[_0xd3c299+0x1]&&'move'==_0x4936f9[_0xd3c299+0x1]['type']){bs(_0x4a3ccb,_0xc3e760);break;}const _0x3f136d=_0xc3e760['position'],_0x11d650=_0xc3e760['howMany'],_0x4b2a84=_0xec531(_0x4fe2c0['model']['createRange'](_0x3f136d,_0x3f136d['getShiftedBy'](_0x11d650)),_0x4fe2c0['model']),_0x1a089b='suggestion:insertion:'+at()+':$aiSuggestion';_0x4a3ccb['markers']['set'](_0x1a089b,_0x4b2a84);break;}case'split':{_0x47630c['batch']['addOperation'](_0xc3e760),_0x4fe2c0['model']['applyOperation'](_0xc3e760);const _0x3273ed=_0xc3e760['splitPosition'],_0xf31a96=_0xc3e760['moveTargetPosition'],_0x420636=_0x4fe2c0['model']['createRange'](_0x3273ed,_0xf31a96),_0x1f1139='suggestion:insertion:'+at()+':$aiSuggestion';_0x4a3ccb['markers']['set'](_0x1f1139,_0x420636);break;}case'move':{_0x47630c['batch']['addOperation'](_0xc3e760),_0x4fe2c0['model']['applyOperation'](_0xc3e760),_0x4936f9[_0xd3c299-0x1]&&'insert'==_0x4936f9[_0xd3c299-0x1]['type']&&bs(_0x4a3ccb,_0xc3e760);const _0x428e17=_0xc3e760['getMovedRangeStart'](),_0x43f281=_0xc3e760['howMany'];for(let _0x1d6b9e=0x0;_0x1d6b9e<_0x43f281;_0x1d6b9e++){const _0x3d3f37=_0x428e17['getShiftedBy'](_0x1d6b9e)['nodeAfter'];_0x4b80a5['add'](_0x3d3f37);}break;}case'remove':{const _0xe9bd15=_0xc3e760['sourcePosition'],_0x29ab43=_0xc3e760['howMany'],_0x1230ff=new _0x3bae80(_0xe9bd15,_0x29ab43);_0x47630c['batch']['addOperation'](_0x1230ff),_0x4fe2c0['model']['applyOperation'](_0x1230ff);break;}}}for(const _0x143904 of _0x4b80a5){const _0x20910a=_0x4fe2c0['model']['createRangeOn'](_0x143904),_0x5854c2='suggestion:formatBlock:$fakeWrap:'+at()+':$aiSuggestion';_0x4a3ccb['markers']['set'](_0x5854c2,_0xec531(_0x20910a,_0x4fe2c0['model']));}});}(_0x598a6c,_0x2318ed,_0x3ae4a4):_0x3ae4a4['model']['change'](_0x45d687=>{for(const _0x161c14 of _0x598a6c)if('remove'==_0x161c14['type']){const _0x1a2244=_0x161c14['sourcePosition'],_0x4f51ba=_0x161c14['howMany'],_0x383d0a=new _0x3bae80(_0x1a2244,_0x4f51ba);_0x45d687['batch']['addOperation'](_0x383d0a),_0x3ae4a4['model']['applyOperation'](_0x383d0a);}else{if('marker'==_0x161c14['type']){const _0x1aa281=_0x161c14['name'],_0x24da2c=_0x161c14['newRange'];null!==_0x24da2c?_0x2318ed['markers']['set'](_0x1aa281,_0x24da2c):_0x2318ed['markers']['delete'](_0x1aa281);}else _0x161c14['baseVersion']=null,_0x161c14['isDocumentOperation']=!0x1,_0x45d687['batch']['addOperation'](_0x161c14),_0x3ae4a4['model']['applyOperation'](_0x161c14);}});if(_0x20abac){const _0x38cc19=Rs(_0x3ae4a4,_0x598a6c,_0x2318ed);Os(_0x3ae4a4['model'],_0x38cc19),function(_0x773e0c,_0x3e381e){const _0x363e06=_0x3e381e['getFirstRange']()['start'];let _0x51cebe=_0x3e381e['getFirstRange']()['end'];const _0x896970=_0x363e06['root'];(_0x51cebe['textNode']||_0x51cebe['nodeAfter']&&_0x51cebe['nodeAfter']['is']('$text'))&&(_0x203d47(_0x51cebe,'...'),_0x51cebe=_0x51cebe['getShiftedBy'](0x3)),(_0x363e06['textNode']||_0x363e06['nodeBefore']&&_0x363e06['nodeBefore']['is']('$text'))&&(_0x203d47(_0x363e06,'...'),function(_0x49629f,_0x224b6a,_0x23bc2c){for(let [_0x5b1957,_0x1db149]of _0x49629f['markers']){const _0x387357=_0x1db149['_getTransformedByInsertion'](_0x224b6a,_0x23bc2c,!0x1);_0x1db149=_0x387357[0x0],_0x49629f['markers']['set'](_0x5b1957,_0x1db149);}}(_0x896970,_0x363e06,0x3),_0x363e06['parent']==_0x51cebe['parent']&&(_0x51cebe=_0x51cebe['getShiftedBy'](0x3)));const _0x2aa5e9=_0x773e0c['createRange'](_0x773e0c['createPositionAt'](_0x896970,0x0),_0x363e06),_0x406b67=_0x773e0c['createRange'](_0x51cebe,_0x773e0c['createPositionAt'](_0x896970,'end')),_0x32fb97=[..._0x2aa5e9['getMinimalFlatRanges'](),..._0x406b67['getMinimalFlatRanges']()];_0x32fb97['reverse']();for(const _0x4320b7 of _0x32fb97)_0x1a3440(_0x4320b7),Ns(_0x896970,_0x4320b7);}(_0x3ae4a4['model'],_0x38cc19);}const _0x21bc15=_0x3ae4a4['data']['stringify'](_0x2318ed,{'showSuggestionHighlights':!0x0});return{'content':us(_0x21bc15),'hasChanges':!0x0};}(_0x287a38,_0x32dc80,_0x433f75,_0x195ec1,_0x2f4bb0);return{'type':_0x954dc7['changes'][0x0]['type'],'index':_0x954dc7['index'],'content':_0x1b5bd2,'hasChanges':_0x5c3a5e};});}function bs(_0x4beb46,_0x3606e9){for(const [_0x3bfd63,_0xf4147e]of _0x4beb46['markers']){const _0x2b5a21=_0x1f3f5a['_createFromRanges'](_0xf4147e['getTransformedByOperation'](_0x3606e9));_0x4beb46['markers']['set'](_0x3bfd63,_0x2b5a21);}}function Rs(_0x5aa47d,_0x19c533,_0x33e4ab){const _0x2a6d44=_0x5aa47d['plugins']['get']('DocumentCompare');let _0x1b14ba=_0x5aa47d['model']['createPositionAt'](_0x33e4ab,Number['POSITIVE_INFINITY']),_0x150e35=_0x5aa47d['model']['createPositionAt'](_0x33e4ab,0x0);for(const _0x21ceef of _0x19c533){let _0x80d7fb,_0x850e8e;if(_0x2a6d44['isMarkedRemoveOperation'](_0x21ceef))_0x80d7fb=_0x21ceef['newRange']['start'],_0x850e8e=_0x21ceef['newRange']['end'];else switch(_0x1b14ba=_0x1b14ba['getTransformedByOperation'](_0x21ceef),_0x150e35=_0x150e35['getTransformedByOperation'](_0x21ceef),_0x21ceef['type']){case'rename':_0x80d7fb=_0x21ceef['position'],_0x850e8e=_0x80d7fb['getShiftedBy'](0x1);break;case'addAttribute':case'removeAttribute':case'changeAttribute':_0x80d7fb=_0x21ceef['range']['start'],_0x850e8e=_0x21ceef['range']['end'];break;case'insert':_0x80d7fb=_0x21ceef['position'],_0x850e8e=_0x80d7fb['getShiftedBy'](_0x21ceef['howMany']);break;case'split':_0x80d7fb=_0x21ceef['splitPosition'],_0x850e8e=_0x21ceef['moveTargetPosition'];break;case'merge':{const _0x4b4a44=_0x21ceef['targetPosition']['path']['slice'](0x0,-0x1);_0x80d7fb=_0x5aa47d['model']['createPositionFromPath'](_0x33e4ab,_0x4b4a44),_0x850e8e=_0x80d7fb['getShiftedBy'](0x1);break;}case'remove':{const _0x3bd8ef=_0x21ceef['howMany'],_0x389f56=_0x21ceef['sourcePosition']['_getTransformedByInsertion'](_0x21ceef['targetPosition'],_0x3bd8ef),_0x360e47=_0x21ceef['getMovedRangeStart']();'remove'==_0x21ceef['type']?(_0x80d7fb=_0x389f56,_0x850e8e=_0x389f56):(_0x80d7fb=_0x360e47,_0x850e8e=_0x360e47['getShiftedBy'](_0x3bd8ef));break;}}_0x80d7fb&&_0x80d7fb['isBefore'](_0x1b14ba)&&(_0x1b14ba=_0x80d7fb['clone'](),_0x1b14ba['stickiness']='toNone'),_0x850e8e&&_0x850e8e['isAfter'](_0x150e35)&&(_0x150e35=_0x850e8e['clone'](),_0x150e35['stickiness']='toNone');}return _0x5aa47d['model']['createSelection'](_0x5aa47d['model']['createRange'](_0x1b14ba,_0x150e35));}function Os(_0xaeb26f,_0x282869){ks(_0xaeb26f,_0x282869,'forward');const _0x753aa3=_0x282869['getFirstRange']();_0x282869['setTo']([]),_0x282869['setTo'](_0x753aa3,{'backward':!0x0}),ks(_0xaeb26f,_0x282869,'backward');}function ks(_0x71f050,_0x297588,_0x495273){let _0xe0300=0x14;for(;_0xe0300;){_0x71f050['modifySelection'](_0x297588,{'unit':'word','direction':_0x495273}),_0xe0300--;const _0x24ba30=_0x297588['focus']['forward'==_0x495273?'nodeBefore':'nodeAfter'];if(_0x24ba30&&_0x24ba30['is']('element')&&_0x71f050['schema']['isBlock'](_0x24ba30)&&_0x71f050['schema']['isObject'](_0x24ba30))break;}}function Ns(_0x36f1fb,_0x57c843){for(const [_0xd93254,_0x5c6b3d]of _0x36f1fb['markers']){const _0x2e218=_0x5c6b3d['_getTransformedByDeletion'](_0x57c843['start'],_0x57c843['end']['offset']-_0x57c843['start']['offset']);null!=_0x2e218?_0x36f1fb['markers']['set'](_0xd93254,_0x2e218):_0x36f1fb['markers']['delete'](_0xd93254);}}class vs extends ht(){['id'];['interactionId'];['type'];['sources']=[];['parsedContent']=new _0x11b267([]);['parsedMergedContent']=new _0x11b267([]);['changeGroups']=[];['areActionsDisabled']=!0x1;['documentContextContent'];['aiResponseParser'];['aiResponseApplier'];['editor'];['cachedSuggestionContentParts']={'withDiff':[],'withoutDiff':[]};constructor({type:_0x3faaee,content:_0x172ba1='',isDone:_0xabe5ba=!0x1,interactionId:_0x3f1120,areActionsDisabled:_0xaed070,documentContextContent:_0x341c21,editor:_0x213a48,id:_0x277738}){super(),this['id']=_0x277738||at(),this['interactionId']=_0x3f1120,this['type']=_0x3faaee,this['areActionsDisabled']=!!_0xaed070,this['editor']=_0x213a48,this['aiResponseParser']=new ws(),this['aiResponseApplier']=new fs(),this['documentContextContent']=us(_0x341c21||''),this['set']('isDone',_0xabe5ba),this['on']('change:content',()=>{this['onContentChange']();}),this['set']('content',_0x172ba1);}['appendContent'](_0x4d1321){this['set']('content',this['content']+_0x4d1321);}['done'](){this['isDone']||(this['set']('isDone',!0x0),this['onContentChange']());}['destroy'](){this['stopListening']();}['setChangeGroupState'](_0x3fc7d1,_0x5d8f54){this['changeGroups'][_0x3fc7d1]['state']=_0x5d8f54,this['fire']('replyChangeGroupStateUpdated',{'reply':this,'index':_0x3fc7d1,'state':_0x5d8f54});}['getContentParts']({showDiff:_0x33328f,groupIndex:_0x26b386}){if(!this['editor'])throw new ot('ai-get-editor-from-context-no-editor',null,{'aiReply':this});const _0x32e3cd=this['_getCachedContentParts'](_0x33328f,_0x26b386);if(_0x32e3cd)return _0x32e3cd;let _0x250ccc=[];if(void 0x0===_0x26b386)_0x250ccc=this['changeGroups'];else{const _0x563cde=this['changeGroups']['find'](({index:_0x21e773})=>_0x21e773===_0x26b386);if(!_0x563cde)throw new ot('ai-reply-get-content-parts-group-not-found',null,{'aiReply':this,'groupIndex':_0x26b386});_0x250ccc=[_0x563cde];}const _0x121b45=Ss({'editor':this['editor'],'showDiff':_0x33328f,'changeGroups':_0x250ccc,'documentContextContent':this['documentContextContent']});return this['_setCachedContentParts'](_0x33328f,_0x121b45),_0x121b45;}['_getCachedContentParts'](_0x42ea63,_0x8f0953){const _0x28bffa=_0x42ea63?'withDiff':'withoutDiff';if(!this['cachedSuggestionContentParts'][_0x28bffa]['length'])return null;const _0x2a747b=this['cachedSuggestionContentParts'][_0x28bffa];if(void 0x0===_0x8f0953)return _0x2a747b['length']>0x0&&_0x2a747b['length']!==this['changeGroups']['length']?(this['_setCachedContentParts'](_0x42ea63,null),null):_0x39542d(_0x2a747b);{const _0x34db55=_0x2a747b['find'](({index:_0x60a0f2})=>_0x60a0f2===_0x8f0953);if(_0x34db55)return[_0x39542d(_0x34db55)];}return null;}['_setCachedContentParts'](_0x426e06,_0x2beb34){const _0x4a40d4=_0x426e06?'withDiff':'withoutDiff';_0x2beb34?_0x2beb34['forEach'](_0x5d4397=>{const _0x51569c=this['cachedSuggestionContentParts'][_0x4a40d4],_0x5670ff=_0x51569c['find'](({index:_0x55c5b5})=>_0x55c5b5===_0x5d4397['index']);if(_0x5670ff){const _0x1e6e79=_0x51569c['indexOf'](_0x5670ff);_0x51569c['splice'](_0x1e6e79,0x1,_0x5d4397);}else _0x51569c['push'](_0x5d4397);}):this['cachedSuggestionContentParts'][_0x4a40d4]['length']=0x0;}['onContentChange'](){if('modification'===this['type']){this['parsedContent']=this['aiResponseParser']['parseAndNormalizeHTML'](this['content']);const _0x2db71f=this['changeGroups'];this['updateChangeGroups']();const _0x5e3bab=this['_getDifferentChangeGroups'](_0x2db71f,this['changeGroups']);(_0x5e3bab['length']||this['isDone'])&&(this['fire']('replyContentUpdated',this,_0x5e3bab),this['cachedSuggestionContentParts']['withDiff']['length']=this['cachedSuggestionContentParts']['withoutDiff']['length']=0x0);}else this['parsedContent']=this['aiResponseParser']['convertMarkdownToHTML'](this['content']),this['fire']('replyContentUpdated',this);}['_getDifferentChangeGroups'](_0x388b45,_0x4d5193){const _0x329f94=[];for(const _0x50d87a of _0x4d5193){const _0x57bb61=_0x388b45[_0x50d87a['index']];_0x57bb61?_0x57bb61['changes']['length']!==_0x50d87a['changes']['length']?_0x329f94['push'](_0x50d87a):_0x57bb61['changes']['forEach']((_0x28a59f,_0x29ed05)=>{const _0x531406=_0x50d87a['changes'][_0x29ed05];_0x28a59f['id']!==_0x531406['id']&&_0x329f94['push'](_0x50d87a);}):_0x329f94['push'](_0x50d87a);}return _0x329f94;}['updateChangeGroups'](){const _0x1ca39=new ti('p',{},[new ti('span',{'style':'color:\x20#808080;\x20font-style:\x20italic'},[new _0x45ed29(as(this['editor']['locale'],'AI_SUGGESTION_CONTENT_PART_REMOVED'))])]),_0x2a211f=this['aiResponseApplier']['merge'](this['parsedContent'],this['documentContextContent']['cloneNode'](!0x0),{'markUnstableElements':!this['isDone'],'replaceRemovedWith':_0x1ca39,'cutAfterLastChange':!this['isDone']});if(!_0x2a211f['modifiedNodeIds']['length']&&!this['isDone'])return;this['parsedMergedContent']=_0x2a211f['parsedContent'];let _0x5b8146=[];if(_0x2ffee2(_0x397c39=>{const _0x34e72f=gs(_0x397c39,'data-id');if(!_0x34e72f||!_0x577f14(_0x34e72f))return!0x1;const _0x6100bb=[_0x397c39,...Ts(_0x397c39)]['at'](-0x2);if(_0x397c39!=_0x6100bb){const _0x5514d1=gs(_0x6100bb,'data-id');_0x577f14(_0x5514d1)||(_0x5b8146['push']({'node':_0x6100bb,'id':_0x5514d1,'type':'modified'}),_0x2a211f['modifiedNodeIds']['push'](_0x5514d1));}else _0x2a211f['modifiedNodeIds']['includes'](_0x34e72f)?_0x5b8146['push']({'node':_0x397c39,'type':'modified','id':_0x34e72f}):_0x2a211f['newNodeIds']['includes'](_0x34e72f)?_0x5b8146['push']({'node':_0x397c39,'type':'new','id':_0x34e72f,'anchorId':gs(_0x397c39['previousSibling'],'data-id')}):_0x5b8146['push']({'node':_0x397c39,'type':'removed','id':_0x34e72f});return!0x0;},this['parsedMergedContent']),_0x5b8146=_0x5b8146['filter'](({node:_0x367f48})=>[...Ts(_0x367f48),_0x367f48]['every'](_0xba83c1=>!gs(_0xba83c1,'data-unstable'))),0x0==_0x5b8146['length'])return;const _0x16784b=[[_0x5b8146[0x0]]];for(let _0x24d381=0x1;_0x24d381<_0x5b8146['length'];_0x24d381++){const _0x1bc98c=_0x16784b[_0x16784b['length']-0x1],_0x52a143=_0x1bc98c[_0x1bc98c['length']-0x1];_0x5b8146[_0x24d381]['node']['previousSibling']==_0x52a143['node']&&'modified'!=_0x5b8146[_0x24d381]['type']&&'modified'!=_0x52a143['type']?_0x1bc98c['push'](_0x5b8146[_0x24d381]):_0x16784b['push']([_0x5b8146[_0x24d381]]);}for(const _0x198d73 of _0x16784b){const _0x56fad1=_0x198d73[0x0],_0x4a7d3e=_0x198d73[_0x198d73['length']-0x1],_0x363468=_0x7656ea(_0x56fad1['node']['previousSibling']);_0x363468&&_0x198d73['unshift'](_0x363468);const _0x19f82b=_0x7656ea(_0x4a7d3e['node']['nextSibling']);_0x19f82b&&_0x198d73['push'](_0x19f82b);}function _0x577f14(_0x506b19){return _0x2a211f['modifiedNodeIds']['includes'](_0x506b19)||_0x2a211f['newNodeIds']['includes'](_0x506b19)||_0x2a211f['removedNodeIds']['includes'](_0x506b19);}function _0x7656ea(_0x425e92){if(_0x425e92&&gs(_0x425e92,'data-id')&&!gs(_0x425e92,'data-unstable')){const _0x3f774c=gs(_0x425e92,'data-id');if(!_0x577f14(_0x3f774c))return{'node':_0x425e92,'type':'context','id':_0x3f774c};}return null;}this['changeGroups']=_0x16784b['map']((_0x676aa0,_0x8f1d28)=>({'changes':_0x676aa0,'state':'pending','index':_0x8f1d28}));}}const ys=['interactionCreated','interactionStarted','interactionStopped','interactionFinished','interactionDestroyed','replyCreated','replyContentUpdated','replyChangeGroupStateUpdated','setConversationTitle','webSearchStarted','webSearchFinished','reasoningStarted','reasoningFinished','toolDataReceived','error'];class xs extends pt(){['id'];['replies']=[];['currentReply'];['messageId'];['actionCallId'];['currentRequest'];['connector'];['isStopped']=!0x1;['isDestroyed']=!0x1;['editor'];['_isReasoning']=!0x1;['_isWebSearching']=!0x1;constructor({connector:_0x5b7676,editor:_0x3051d9}){super(),this['id']=at(),this['connector']=_0x5b7676,this['isStopped']=!0x0,this['editor']=_0x3051d9;}async['start'](){const _0x33f4ca=[];let _0x1d183a,_0x3b8964,_0x44e9eb;this['isStopped']=!0x1;try{this['currentRequest']=await this['sendRequest'](),this['fire']('interactionStarted',this);const _0x260491=await this['currentRequest']['getStream']();for await(const _0x22a16b of _0x260491){if(this['isStopped'])return;if('error'==_0x22a16b['event'])return void this['fire']('error',{'error':new ot('ai-chat-interaction-error',this)});switch(_0x22a16b['event']){case'message-metadata':this['messageId']=_0x22a16b['data']['messageId'];break;case'action-metadata':this['actionCallId']=_0x22a16b['data']['callId'];break;case'conversation-title':this['setConversationTitle'](_0x22a16b['data']['conversationTitle'],!0x0);break;case'source':_0x33f4ca['push'](_0x22a16b['data']['source']);break;case'web-search':this['_isWebSearching']||(this['_isWebSearching']=!0x0,this['fire']('webSearchStarted',this));break;case'reasoning':this['_isReasoning']||(this['_isReasoning']=!0x0,this['fire']('reasoningStarted',this));break;case'modification-delta':case'text-delta':this['resetReasoningState'](),this['resetWebSearchState'](),_0x1d183a='modification-delta'==_0x22a16b['event']?'modification':'text',_0x3b8964='modification-delta'==_0x22a16b['event']?_0x22a16b['data']['id']:void 0x0,this['currentReply']&&this['currentReply']['type']!=_0x1d183a&&(this['currentReply']['done'](),this['currentReply']=void 0x0),this['currentReply']||(this['currentReply']=this['createReply']({'type':_0x1d183a,'interactionId':this['id'],'id':_0x3b8964}),'modification'==_0x1d183a&&(this['currentReply']['sources']=_0x33f4ca['splice'](0x0))),this['currentReply']['appendContent'](_0x22a16b['data']['textDelta']);break;case'mcp-tool-result':_0x44e9eb=JSON['parse'](_0x22a16b['data']['result']),this['_handleToolResultData']({'toolName':_0x22a16b['data']['toolName'],'data':_0x44e9eb['data'],'attributes':_0x44e9eb['attributes']});break;case'mcp-tool-notification':this['_handleToolNotificationData']({'toolName':_0x22a16b['data']['toolName'],'data':_0x22a16b['data']['data']});}}}finally{this['isStopped']||(this['currentReply']&&_0x33f4ca['length']>0x0&&(this['currentReply']['sources']=_0x33f4ca['splice'](0x0)),this['_finalizeInteraction'](),this['fire']('interactionFinished',this));}}['stop'](){this['isStopped']||(this['_finalizeInteraction'](),this['fire']('interactionStopped',this));}['getReply'](_0x4f401c){return this['replies']['find'](_0x17c69a=>_0x17c69a['id']===_0x4f401c);}['destroy'](){this['isDestroyed']||(this['stop'](),this['replies']['forEach'](_0x29cc88=>_0x29cc88['destroy']()),this['replies']=[],this['isDestroyed']=!0x0,this['fire']('interactionDestroyed',this),this['stopListening']());}['createReply'](_0x23e8a7){const _0xda64a=new vs({'editor':this['editor'],'documentContextContent':this['getDocumentContext']()?.['content'],..._0x23e8a7});return this['replies']['push'](_0xda64a),_0xda64a['delegate'](...ys)['to'](this),this['fire']('replyCreated',_0xda64a),_0xda64a;}['setConversationTitle'](_0x828b0c,_0x582cea=!0x1){this['fire']('setConversationTitle',_0x828b0c,_0x582cea);}['resetWebSearchState'](){this['_isWebSearching']&&(this['_isWebSearching']=!0x1,this['fire']('webSearchFinished',this));}['resetReasoningState'](){this['_isReasoning']&&(this['_isReasoning']=!0x1,this['fire']('reasoningFinished',this));}['_handleToolResultData'](_0x1a18ab){this['fire']('toolDataReceived',{'type':'result','toolName':_0x1a18ab['toolName'],'data':structuredClone(_0x1a18ab['data']||{}),'attributes':structuredClone(_0x1a18ab['attributes']||{})},this);}['_handleToolNotificationData'](_0x5c2b00){this['fire']('toolDataReceived',{'type':'notification','toolName':_0x5c2b00['toolName'],'data':structuredClone(_0x5c2b00['data'])},this);}['_finalizeInteraction'](){this['isStopped']=!0x0,this['currentRequest']&&this['currentRequest']['abortController']['abort'](),this['currentReply']&&this['currentReply']['done'](),this['currentRequest']=this['currentReply']=void 0x0;}}const Ls=new Map([['usage-limits-exceeded','ai-usage-limits-exceeded'],['rate-limits-exceeded','ai-rate-limits-exceeded'],['invalid-content-type','ai-invalid-content-type'],['invalid-request-data','ai-chat-invalid-request'],['model-already-set','ai-chat-model-already-set'],['model-not-found','ai-chat-model-not-found'],['unsafe-content-detected','ai-chat-unsafe-content-detected'],['unsupported-content-type','ai-chat-unsupported-content-type'],['content-too-large','ai-chat-content-too-large'],['unsupported-file-type','ai-chat-context-unsupported-file-type'],['file-too-large','ai-chat-context-file-too-large'],['file-too-many-pages','ai-chat-context-file-too-many-pages'],['form-data-size-limits-exceeded','ai-chat-context-form-data-size-limits-exceeded']]),Ds=['contextItemAdded','contextItemRemoved','contextItemLoadingEnded','contextSent','error','addContextOptionsChanged','sourceResourcesLoaded','resourceStateChanged','uploadProgressChanged'];class Ps extends ht(){['_connector'];['_config'];['_ownerId'];constructor({connector:_0x2b5623,config:_0x5d3385,ownerId:_0x4b616d}){super(),this['_connector']=_0x2b5623,this['_config']=_0x5d3385,this['_ownerId']=_0x4b616d;}['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'](_0x668beb){const _0x4556c4=await this['_createContextItemFromContent'](_0x668beb);return this['_addToConversationContextItem'](_0x4556c4),'current-document'===_0x4556c4['uiId']&&this['_toggleAddCurrentDocumentOptionVisibility'](),_0x4556c4;}async['_createContextItemFromContent'](_0x4611ff){if('document'===_0x4611ff['type']){const _0xc2f488=await this['_connector']['fetchDocument'](this['_ownerId'],_0x4611ff['id'])['getDocument']();return{'id':'current-document','uiId':'current-document','label':'Current\x20document','type':_0x4611ff['type'],'content':_0xc2f488['content'],'hidden':this['_conversationContextItems']['has']('current-document'),'version':_0xc2f488['attributes']?.['version'],'sessionId':_0xc2f488['attributes']?.['sessionId']};}if('mcp-tool-context'===_0x4611ff['type'])return{'id':_0x4611ff['id'],'uiId':_0x4611ff['id'],'label':_0x4611ff['data']?.['label']||_0x4611ff['id'],'type':'mcp-tool-context','mcpServerName':_0x4611ff['mcpServerName'],'toolName':_0x4611ff['toolName'],'data':_0x4611ff['data']||{}};return{'id':_0x4611ff['id'],'uiId':_0x4611ff['id'],'label':_0x4611ff['attributes']?.['label']||_0x4611ff['name']||_0x4611ff['url']||_0x4611ff['id'],'type':_0x4611ff['type'],..._0x4611ff?.['attributes']?.['resourceId']?{'resourceId':_0x4611ff['attributes']?.['resourceId']}:{}};}['getSentContextItems'](){return new Map(this['_conversationContextItems']);}['removeFromContext'](_0x30b01b){const _0x4c1dfc=this['_pendingContextItems']['get'](_0x30b01b);_0x4c1dfc?.['isReadOnly']||this['_removeContextItem'](_0x30b01b);}['clearPendingContextItems'](){if(0x0===this['_pendingContextItems']['size'])return;for(const _0x569bcb of this['_pendingContextItems']['values']())this['_removeContextItem'](_0x569bcb['uiId']);const _0xc4daed=this['_conversationContextItems']['get']('current-document')||this['_pendingContextItems']['get']('current-document');_0xc4daed&&this['_addContextItem']({..._0xc4daed,'isReadOnly':!0x0,'hidden':!0x0});}['addToConversationContext'](_0x44e930){for(const _0x438260 of _0x44e930['values']())this['_addToConversationContextItem'](_0x438260);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'](_0x22cf4a){return Array['from'](_0x22cf4a['values']())['map'](_0x3bce4b=>this['_mapContextItemToRequestData'](_0x3bce4b))['filter'](_0x214c7e=>null!==_0x214c7e);}async['addFilesToContext'](_0x3ca769,_0x1362d6,_0x4e7ba3='file'){const _0x255eea='files-'+at();this['_startUploadOperation'](_0x255eea);try{await Promise['all'](_0x3ca769['map'](async _0x2ce9ba=>{const _0x39f0d2='file-'+at(),_0x44fff5=_0x215ed3(_0x2ce9ba['name']);try{this['_addContextItem']({'type':_0x4e7ba3,'label':_0x1362d6?.['label']||_0x44fff5,'uiId':_0x39f0d2,'resourceId':_0x1362d6?.['resourceId']},!0x0);const _0x1844de=this['_connector']['uploadFile'](this['_ownerId'],_0x2ce9ba,_0x1362d6);this['_ongoingUploads']['set'](_0x39f0d2,_0x1844de['abortController']);const {id:_0xb0dd04}=await _0x1844de['getId']();this['_ongoingUploads']['delete'](_0x39f0d2),this['_finishContextItemLoading']({'type':_0x4e7ba3,'id':_0xb0dd04,'label':_0x1362d6?.['label']||_0x44fff5,'uiId':_0x39f0d2,'resourceId':_0x1362d6?.['resourceId']},!0x1);}catch(_0x1ba67f){this['_ongoingUploads']['delete'](_0x39f0d2);if(!(_0x1ba67f instanceof ot&&_0x1ba67f['message']['startsWith']('ai-request-aborted'))){const _0x3b643b=Ls['get'](_0x1ba67f['code'])||'ai-chat-file-upload-failed',_0x54d713=new ot(_0x3b643b,null,{'fileName':_0x44fff5,..._0x1ba67f});_0x54d713['stack']=_0x1ba67f['stack'],this['fire']('error',{'error':_0x54d713});}this['_removeContextItem'](_0x39f0d2);}}));}finally{this['_finishUploadOperation'](_0x255eea);}}['addCurrentDocumentToContext'](_0xd7c0c5){if(this['isCurrentDocumentInContext']()||!this['_addContextOptionsState']['document']['enabled'])return;const _0x27cfc7={'type':'document','uiId':'current-document','label':_0xd7c0c5,'isReadOnly':this['_conversationContextItems']['has']('current-document'),'hidden':this['_conversationContextItems']['has']('current-document')};this['_addContextItem'](_0x27cfc7);}async['updateCurrentDocument'](_0x4b7bc5,_0xbb22f3,_0x4502dc,_0x23bcc8){const _0x555a9b=this['_pendingContextItems']['get']('current-document');if(_0x555a9b&&_0x4b7bc5){_0x555a9b['selection']=_0x23bcc8?_0x23bcc8['map'](_0x59cef7=>({'start':_0x59cef7['start'],'end':_0x59cef7['end']})):[];try{if(_0x555a9b['version']===_0xbb22f3)return;const {id:_0x297a24}=await this['_connector']['uploadDocument'](this['_ownerId'],_0x4b7bc5,{'version':_0xbb22f3,'sessionId':_0x4502dc})['getId']();_0x555a9b['id']=_0x297a24,_0x555a9b['content']=_0x4b7bc5,_0x555a9b['version']=_0xbb22f3,_0x555a9b['sessionId']=_0x4502dc;}catch(_0x456bf7){const _0x1ef1df=new ot('ai-chat-document-upload-failed',null);_0x1ef1df['stack']=_0x456bf7['stack'],this['fire']('error',{'error':_0x1ef1df});}}}['addSelectionToContext'](_0x1e58c5){this['_addContextItem']({'type':'selection','label':_0x1e58c5,'uiId':'selection','content':_0x1e58c5});}['removeSelectionFromContext'](){this['_removeContextItem']('selection');}async['addUrlToContext'](_0x45b38e,_0x375924){const _0x5e2fd2='url-'+at();this['_startUploadOperation'](_0x5e2fd2);const _0x208574='url-'+at();try{this['_addContextItem']({'type':'web-resource','label':_0x375924?.['label']||_0x45b38e,'uiId':_0x208574,'resourceId':_0x375924?.['resourceId']},!0x0);const _0xb86924=this['_connector']['uploadUrl'](this['_ownerId'],_0x45b38e,_0x375924);this['_ongoingUploads']['set'](_0x208574,_0xb86924['abortController']);const {id:_0x447518}=await _0xb86924['getId']();this['_ongoingUploads']['delete'](_0x208574),this['_finishContextItemLoading']({'type':'web-resource','id':_0x447518,'label':_0x375924?.['label']||_0x45b38e,'uiId':_0x208574,'resourceId':_0x375924?.['resourceId']},!0x1);}catch(_0x399520){this['_ongoingUploads']['delete'](_0x208574),(_0x399520['message']['startsWith']('ai-request-aborted')||this['fire']('error',{'error':new ot('ai-chat-url-upload-failed',this,{'url':_0x45b38e,'originalError':_0x399520}),'url':_0x45b38e}),this['_removeContextItem'](_0x208574));}finally{this['_finishUploadOperation'](_0x5e2fd2);}}['addToolItemToContext'](_0x25c879){_0x25c879['id']=_0x25c879['id']??at()['substring'](0x0,0x15),this['_pendingContextItems']['set'](_0x25c879['uiId'],_0x25c879),this['fire']('contextItemAdded',{'contextItem':_0x25c879,'isLoading':!0x1});}async['loadSourceResources'](_0x3c9282,_0x2fb83f,_0x2331e6){const _0x12b367=this['_addContextOptionsState']['sources']['find'](_0x5da5e5=>_0x5da5e5['id']===_0x3c9282);if(!_0x12b367)return this['fire']('error',{'error':new ot('ai-chat-source-not-found',this,{'sourceId':_0x3c9282}),'sourceId':_0x3c9282}),[];try{const _0x3425a0=(await _0x12b367['getResources'](_0x2fb83f))['map'](_0x5407c4=>{const _0x32e36a=this['_isResourceInContext'](_0x5407c4['id']);return{..._0x5407c4,'isInContext':_0x32e36a};});return _0x12b367['resources']=_0x3425a0,this['fire']('sourceResourcesLoaded',{'sourceId':_0x3c9282,'source':_0x12b367,'resources':_0x3425a0,'uid':_0x2331e6}),_0x3425a0;}catch(_0x11aafc){return this['fire']('error',{'error':new ot('ai-chat-source-resources-load-failed',this,{'sourceId':_0x3c9282,'originalError':_0x11aafc}),'sourceId':_0x3c9282,'sourceLabel':_0x12b367['label']}),[];}}async['addResourceToContext'](_0x12403c,_0x21047c){if(this['_isResourceInContext'](_0x21047c['id']))return;let _0x10df55=_0x21047c['data'];if(!_0x10df55&&_0x12403c['getData'])try{_0x10df55=await _0x12403c['getData'](_0x21047c['id']);}catch(_0x5829c1){return void this['fire']('error',{'error':new ot('ai-chat-resource-load-failed',this,{'resourceId':_0x21047c['id'],'sourceId':_0x12403c['id'],'originalError':_0x5829c1}),'resourceId':_0x21047c['id'],'sourceId':_0x12403c['id']});}if(_0x10df55)switch(_0x21047c['type']){case'web-resource':if('string'!=typeof _0x10df55)return void this['fire']('error',{'error':new ot('ai-chat-context-invalid-data',this,{'resourceId':_0x21047c['id'],'sourceId':_0x12403c['id'],'expectedType':'string','actualType':typeof _0x10df55}),'resourceId':_0x21047c['id'],'sourceId':_0x12403c['id']});await this['addUrlToContext'](_0x10df55,{'label':_0x21047c['label'],'resourceId':_0x21047c['id']});break;case'file':if(!(_0x10df55 instanceof File))return void this['fire']('error',{'error':new ot('ai-chat-context-invalid-data',this,{'resourceId':_0x21047c['id'],'sourceId':_0x12403c['id'],'expectedType':'File','actualType':typeof _0x10df55}),'resourceId':_0x21047c['id'],'sourceId':_0x12403c['id']});await this['addFilesToContext']([_0x10df55],{'label':_0x21047c['label'],'resourceId':_0x21047c['id']});break;case'text':if('object'!=typeof _0x10df55||!('content'in _0x10df55)||!('type'in _0x10df55))return void this['fire']('error',{'error':new ot('ai-chat-context-invalid-data',this,{'resourceId':_0x21047c['id'],'sourceId':_0x12403c['id'],'expectedType':'object\x20with\x20content\x20and\x20type\x20properties','actualType':typeof _0x10df55}),'resourceId':_0x21047c['id'],'sourceId':_0x12403c['id']});_0x10df55=Ps['_convertTextResourceToFile'](_0x10df55,_0x21047c['label']),await this['addFilesToContext']([_0x10df55],{'label':_0x21047c['label'],'resourceId':_0x21047c['id']},'text');break;case'mcp-tool-context':break;default:this['fire']('error',{'error':new ot('ai-chat-context-unsupported-type',this,{'resourceId':_0x21047c['id'],'sourceId':_0x12403c['id'],'resourceType':_0x21047c['type']}),'resourceId':_0x21047c['id'],'sourceId':_0x12403c['id']});}else this['fire']('error',{'error':new ot('ai-chat-resource-no-data',this,{'resourceId':_0x21047c['id'],'sourceId':_0x12403c['id']}),'resourceId':_0x21047c['id'],'sourceId':_0x12403c['id']});}static['_convertTextResourceToFile'](_0x13416b,_0x10c541){switch(_0x13416b['type']){case'markdown':return new File([_0x13416b['content']],_0x10c541,{'type':'text/markdown'});case'html':return new File([_0x13416b['content']],_0x10c541,{'type':'text/html'});default:return new File([_0x13416b['content']],_0x10c541,{'type':'text/plain'});}}static['_mapContextItemToRequestData'](_0x7db4d4){switch(_0x7db4d4['type']){case'file':case'text':return{'type':'file','id':_0x7db4d4['id']};case'web-resource':return{'type':'web-resource','id':_0x7db4d4['id']};case'document':return{'type':'document','id':_0x7db4d4['id'],..._0x7db4d4['selection']?.['length']&&{'selection':_0x7db4d4['selection']}};case'mcp-tool-context':{const _0x3034c0=_0x7db4d4;return{'type':'mcp-tool-context','mcpServerName':_0x3034c0['mcpServerName'],'toolName':_0x3034c0['toolName'],'data':_0x3034c0['data'],'id':_0x3034c0['id']};}default:return null;}}['_addContextItem'](_0x493329,_0xe143a1=!0x1){if(this['_pendingContextItems']['set'](_0x493329['uiId'],_0x493329),_0x493329['hidden']||this['fire']('contextItemAdded',{'contextItem':_0x493329,'isLoading':_0xe143a1}),'current-document'===_0x493329['uiId']&&this['_toggleAddCurrentDocumentOptionVisibility'](),_0x493329['resourceId']){const _0x2c07c8=this['_findSourceIdsByResourceId'](_0x493329['resourceId']);_0x2c07c8&&_0x2c07c8['forEach'](_0x4ba28a=>{this['_updateResourceInContextState'](_0x4ba28a,_0x493329['resourceId'],!0x0);});}}['_removeContextItem'](_0xa7432){const _0x567577=this['_pendingContextItems']['get'](_0xa7432),_0x5689df=this['_ongoingUploads']['get'](_0xa7432);if(_0x5689df&&(_0x5689df['abort'](),this['_ongoingUploads']['delete'](_0xa7432)),_0x567577?.['resourceId']){const _0x482946=this['_findSourceIdsByResourceId'](_0x567577['resourceId']);_0x482946&&_0x482946['forEach'](_0x34716f=>{this['_updateResourceInContextState'](_0x34716f,_0x567577['resourceId'],!0x1);});}this['_pendingContextItems']['delete'](_0xa7432),this['fire']('contextItemRemoved',{'uiId':_0xa7432,'type':_0x567577?.['type']}),'current-document'===_0xa7432&&this['_toggleAddCurrentDocumentOptionVisibility']();}['_finishContextItemLoading'](_0x57809f,_0x34cd42){if(this['_pendingContextItems']['has'](_0x57809f['uiId'])&&(this['_pendingContextItems']['set'](_0x57809f['uiId'],_0x57809f),this['fire']('contextItemLoadingEnded',{'contextItem':_0x57809f,'isLoading':_0x34cd42}),_0x57809f['resourceId'])){const _0x4e2c08=this['_findSourceIdsByResourceId'](_0x57809f['resourceId']);_0x4e2c08&&_0x4e2c08['forEach'](_0x5ce94b=>{this['_updateResourceInContextState'](_0x5ce94b,_0x57809f['resourceId'],!0x0);});}}['_addToConversationContextItem'](_0x5a6cab){this['_conversationContextItems']['set'](_0x5a6cab['uiId'],_0x5a6cab);}['_setAddContextOptionsDefaultState'](){this['_addContextOptionsState']={'document':{'enabled':!0x1!==this['_config']?.['document']?.['enabled'],'isHidden':!0x1},'urls':{'enabled':!0x1!==this['_config']?.['urls']?.['enabled']},'files':{'enabled':!0x1!==this['_config']?.['files']?.['enabled']},'sources':this['_getCustomSourcesInitialState'](),'customItems':this['_config']?.['customItems']?.['map'](_0x4fbb3f=>({..._0x4fbb3f,'enabled':!0x0}))??[]},this['fire']('addContextOptionsChanged',{'options':this['_addContextOptionsState']});}['_getCustomSourcesInitialState'](){return this['_config']?.['sources']?.['map'](_0x450d55=>({..._0x450d55,'resources':[]}))??[];}['_toggleAddCurrentDocumentOptionVisibility'](){const _0x1225c9=this['isCurrentDocumentInContext']()||this['isCurrentDocumentInConversation']();this['_addContextOptionsState']['document']['isHidden']=_0x1225c9,this['fire']('addContextOptionsChanged',{'options':this['_addContextOptionsState']});}['_isResourceInContext'](_0x285b83){for(const _0x104458 of this['_pendingContextItems']['values']())if(_0x104458['resourceId']===_0x285b83)return!0x0;for(const _0x587091 of this['_conversationContextItems']['values']())if(_0x587091['resourceId']===_0x285b83)return!0x0;return!0x1;}['_findSourceIdsByResourceId'](_0x43da14){const _0x51814c=[];for(const _0x2ec2ac of this['_addContextOptionsState']['sources']){_0x2ec2ac['resources']['find'](_0x219912=>_0x219912['id']===_0x43da14)&&_0x51814c['push'](_0x2ec2ac['id']);}return 0x0===_0x51814c['length']?null:_0x51814c;}['_updateResourceInContextState'](_0x571b77,_0x5580fb,_0x2cbcab){const _0x20c6f1=this['_addContextOptionsState']['sources']['find'](_0x24d027=>_0x24d027['id']===_0x571b77);if(!_0x20c6f1)return;const _0x532c57=_0x20c6f1['resources']['find'](_0x55685a=>_0x55685a['id']===_0x5580fb);_0x532c57&&(_0x532c57['isInContext']=_0x2cbcab,this['fire']('resourceStateChanged',{'sourceId':_0x571b77,'resourceId':_0x5580fb,'isInContext':_0x2cbcab}));}['_startUploadOperation'](_0x1469bd){this['_ongoingUploadOperations']['set'](_0x1469bd,!0x0),this['_ongoingUploadOperations']['size']&&this['fire']('uploadProgressChanged',{'isUploadInProgress':!0x0});}['_finishUploadOperation'](_0x2db5af){this['_ongoingUploadOperations']['delete'](_0x2db5af),0x0===this['_ongoingUploadOperations']['size']&&this['fire']('uploadProgressChanged',{'isUploadInProgress':!0x1});}}const Hs=['capabilitiesUpdated'];class Ms extends pt(){['_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'](_0x394973){const _0x59cf7a={};return _0x394973&&_0x394973['isWebSearchEnabled']&&(_0x59cf7a['webSearch']={}),_0x394973&&_0x394973['isReasoningEnabled']&&(_0x59cf7a['reasoning']={}),_0x59cf7a;}['toggleWebSearch'](){this['setWebSearch'](!this['_isWebSearchEnabled']);}['toggleReasoning'](){this['setReasoning'](!this['_isReasoningEnabled']);}['setWebSearch'](_0x544a40){_0x544a40!==this['_isWebSearchEnabled']&&(this['_isWebSearchEnabled']=_0x544a40,this['fire']('capabilitiesUpdated',this['getCapabilitiesConfig']()));}['setReasoning'](_0x35eafc){_0x35eafc!==this['_isReasoningEnabled']&&(this['_isReasoningEnabled']=_0x35eafc,this['fire']('capabilitiesUpdated',this['getCapabilitiesConfig']()));}}class Us extends xs{['userMessage'];['conversationId'];['contextItems']=new Map();['capabilities'];['model'];['attributes'];constructor(_0x18749f){super(_0x18749f),this['conversationId']=_0x18749f['conversationId'],this['contextItems']=_0x18749f['contextItems'],this['capabilities']=_0x18749f['capabilities'],this['userMessage']=_0x18749f['userMessage'],this['model']=_0x18749f['model'],this['attributes']=_0x18749f['attributes'];}async['sendRequest'](){return this['connector']['queryAssistant']({'message':this['userMessage'],'conversationId':this['conversationId'],'parts':Ps['mapContextItemsToRequestData'](this['contextItems']),'capabilities':Ms['getCapabilitiesRequestData'](this['capabilities']),'model':this['model'],'attributes':this['attributes']});}['getDocumentContext'](){return this['contextItems']['get']('current-document');}}class Vs extends pt(){['id'];['isStarted']=!0x1;['isFromHistory'];['interactions']=[];['currentInteraction'];['selectedModel'];['connector'];['options'];constructor(_0x38f020){super(),this['options']=_0x38f020,this['connector']=_0x38f020['connector'],this['chatModels']=_0x38f020['chatModels'],this['id']=_0x38f020['conversationId'],this['isFromHistory']=_0x38f020['isFromHistory'];}async['init'](_0x257cd3){try{this['chatContext']=new Ps({'connector':this['connector'],'config':_0x257cd3,'ownerId':this['id']}),this['chatContext']['delegate'](...Ds)['to'](this),this['chatContext']['init'](),this['chatCapabilities']=new Ms(),this['chatCapabilities']['delegate'](...Hs)['to'](this),this['chatCapabilities']['init']();const _0x3ba8eb=await this['chatModels']['getAvailableModels']();this['fire']('conversationInitialized',{'availableModels':_0x3ba8eb});const _0x193aca=await this['chatModels']['getModel'](this['options']['selectedModelId']);_0x193aca&&await this['setModel'](_0x193aca);}catch(_0x45987d){const _0x21cbf5=new ot('ai-chat-conversation-init-failed',null,{'message':_0x45987d['message']||_0x45987d});_0x21cbf5['stack']=_0x45987d['stack'],this['fire']('error',{'error':_0x21cbf5});}}async['start'](){if(this['isStarted'])throw new ot('ai-chat-conversation-already-started',null,{'conversation':this});if(!this['selectedModel'])throw new ot('ai-chat-conversation-start-no-model-selected',null,{'conversation':this});try{const {id:_0x170e68}=await this['connector']['startConversation'](this['id'],this['options']['group'])['getConversation']();this['id']=_0x170e68,this['isStarted']=!0x0,this['fire']('conversationStarted',{'conversationId':this['id'],'selectedModel':this['selectedModel']});}catch(_0x3aa850){const _0x1d9c22=new ot('ai-chat-conversation-start-failed',null,{'message':_0x3aa850['message'],'conversationId':this['id']});throw _0x1d9c22['stack']=_0x3aa850['stack'],this['fire']('error',{'error':_0x1d9c22}),_0x1d9c22;}}async['load'](_0xf792db,_0x4b441c){try{const _0x929760=await this['connector']['fetchConversation'](_0xf792db)['getConversation'](),_0xfe405b=await this['connector']['fetchConversationMessages'](_0xf792db)['getMessages'](),_0x1d18ba=_0xfe405b[0x0]['model'];this['isStarted']=!0x0,this['id']=_0x929760['id'],'title'in _0x929760?this['fire']('setConversationTitle',_0x929760['title'],!0x0):this['fire']('setConversationTitle','',!0x0);const _0x3007e1=(await this['chatModels']['getAll']())['find'](_0x12c48a=>_0x12c48a['id']['toLowerCase']()===_0x1d18ba['toLowerCase']());return this['selectedModel']=_0x3007e1,this['fire']('modelSelected',{'selectedModel':_0x3007e1,'isDisabled':!0x0}),await this['_processMessagesToInteractions'](_0xfe405b,_0x4b441c,_0x1d18ba),this['currentInteraction']=void 0x0,this;}catch(_0x14d733){const _0x245c8c=new ot('ai-chat-conversation-init-from-id-failed',null,{'message':_0x14d733['message'],'conversationId':_0xf792db});throw _0x245c8c['stack']=_0x14d733['stack'],this['fire']('error',{'error':_0x245c8c}),_0x245c8c;}}async['_processMessagesToInteractions'](_0x174504,_0x25836b,_0x434708){let _0xbf8053;for(const _0xd1b960 of _0x174504)if('user'===_0xd1b960['role']){const _0x12116c=await this['_extractContextItems'](_0xd1b960),_0x597f8e={'isReasoningEnabled':Object['hasOwn'](_0xd1b960['capabilities'],'reasoning'),'isWebSearchEnabled':Object['hasOwn'](_0xd1b960['capabilities'],'webSearch')};_0xbf8053=this['createInteraction']({'userMessage':_0xd1b960['prompt'],'contextItems':_0x12116c,'capabilities':_0x597f8e,'modelId':_0x434708,'attributes':_0xd1b960['attributes']}),this['currentInteraction']=_0xbf8053,this['chatContext']['addToConversationContext'](this['currentInteraction']['contextItems']);}else{if('assistant'===_0xd1b960['role']&&_0xbf8053){const _0xf64e4a=[];for(const _0x91894 of _0xd1b960['content'])switch(_0x91894['type']){case'text':case'modification':{const _0x33eb62=_0xbf8053['getDocumentContext']()?.['sessionId']!==_0x25836b;_0xbf8053['currentReply']=_0xbf8053['createReply']({'type':_0x91894['type'],'isDone':!0x0,'interactionId':_0xbf8053['id'],'areActionsDisabled':_0x33eb62}),_0xbf8053['currentReply']['appendContent'](_0x91894['content']),_0xf64e4a['length']>0x0&&(_0xbf8053['currentReply']['sources']=_0xf64e4a['splice'](0x0));break;}case'url':_0xf64e4a['push'](_0x91894);break;case'mcp-tool-result':{const {data:_0x3cff68,attributes:_0x219e7d}=JSON['parse'](_0x91894['content']);_0xbf8053['_handleToolResultData']({'toolName':_0x91894['toolName'],'data':_0x3cff68,'attributes':_0x219e7d});break;}}}}}async['_extractContextItems'](_0x3d7b9b){const _0x28f3dd=new Map();if(!_0x3d7b9b['content'])return _0x28f3dd;for(const _0x3776dd of _0x3d7b9b['content']){const _0x22795b=await this['chatContext']['populateFromMessage'](_0x3776dd);_0x22795b&&_0x28f3dd['set'](_0x22795b['id'],_0x22795b);}return _0x28f3dd;}async['handleUserInteraction']({userMessage:_0x5633be,attributes:_0x3bc6bb}){if(!this['isStarted'])throw new ot('ai-chat-handle-user-conversation-not-initialized',null,{'conversation':this});if(this['currentInteraction'])throw new ot('ai-chat-handle-user-interaction-already-in-progress',null,{'conversation':this});try{const _0x502371=this['chatContext']['getPendingContextItems'](),_0x5046f1=this['chatCapabilities']['getCapabilitiesConfig'](),_0x4582ae=this['selectedModel']['id'];this['currentInteraction']=this['createInteraction']({'userMessage':_0x5633be,'contextItems':_0x502371,'capabilities':_0x5046f1,'modelId':_0x4582ae,'attributes':_0x3bc6bb}),await this['currentInteraction']['start'](),this['chatContext']['addToConversationContext'](this['currentInteraction']['contextItems']);}catch(_0x17566a){if(_0x17566a instanceof ot)this['fire']('error',{'interactionId':this['currentInteraction']?this['currentInteraction']['id']:void 0x0,'error':_0x17566a});else{const _0x3f4ca8=Ls['get'](_0x17566a['code'])||'ai-chat-handle-user-interaction-start-failed';this['fire']('error',{'interactionId':this['currentInteraction']?this['currentInteraction']['id']:void 0x0,'error':new ot(_0x3f4ca8,null,{'error':_0x17566a})});}}finally{this['currentInteraction']?.['stop'](),this['currentInteraction']=void 0x0;}}['createInteraction']({userMessage:_0x4f06c3,contextItems:_0xfc5cfd,capabilities:_0x32cd0d,modelId:_0xc4f8da,attributes:_0x2ccc5c}){const _0x723ef5=new Us({'userMessage':_0x4f06c3,'contextItems':_0xfc5cfd,'capabilities':_0x32cd0d,'conversationId':this['id'],'connector':this['connector'],'editor':this['options']['getEditor']&&this['options']['getEditor'](),'model':_0xc4f8da,'attributes':_0x2ccc5c});return _0x723ef5['delegate'](...ys)['to'](this),this['interactions']['push'](_0x723ef5),this['fire']('interactionCreated',_0x723ef5),_0x723ef5;}['getInteraction'](_0x961d6c){return this['interactions']['find'](_0x477d7d=>_0x477d7d['id']===_0x961d6c);}['removeInteraction'](_0x2c7873){const _0x4107ca=this['getInteraction'](_0x2c7873);_0x4107ca&&(_0x4107ca['destroy'](),this['interactions']['splice'](this['interactions']['indexOf'](_0x4107ca),0x1));}get['lastInteraction'](){return this['interactions'][this['interactions']['length']-0x1];}['addCurrentDocumentToContext'](_0x527636){this['chatContext']['addCurrentDocumentToContext'](_0x527636);}async['updateCurrentDocumentInContext']({content:_0x15dbe3,version:_0x52af31,sessionId:_0x46b6ad,selections:_0x53ca49}){await this['chatContext']['updateCurrentDocument'](_0x15dbe3,_0x52af31,_0x46b6ad,_0x53ca49);}['getCurrentDocumentContext'](){return this['currentInteraction']?.['getDocumentContext']()?.['content']||'';}['addSelectionToContext'](_0x41667a){this['chatContext']['addSelectionToContext'](_0x41667a);}['removeSelectionFromContext'](){this['chatContext']['removeSelectionFromContext']();}['addFilesToContext'](_0x51bacb){this['chatContext']['addFilesToContext'](_0x51bacb);}['addUrlToContext'](_0x1b9f28){this['chatContext']['addUrlToContext'](_0x1b9f28);}['addToolItemToContext'](_0x9bd86c){this['chatContext']['addToolItemToContext'](_0x9bd86c);}['addResourceToContext'](_0x91d364,_0xceee19){this['chatContext']['addResourceToContext'](_0x91d364,_0xceee19);}['loadSourceResources'](_0x1ae01e,_0x4ec767,_0x2bc9cc){return this['chatContext']['loadSourceResources'](_0x1ae01e,_0x4ec767,_0x2bc9cc);}['removeFromContext'](_0x12b549){this['chatContext']['removeFromContext'](_0x12b549);}['setWebSearch'](_0x197e09){this['chatCapabilities']['setWebSearch'](_0x197e09);}['toggleWebSearch'](){this['chatCapabilities']['toggleWebSearch']();}['setReasoning'](_0x15721c){this['chatCapabilities']['setReasoning'](_0x15721c);}['toggleReasoning'](){this['chatCapabilities']['toggleReasoning']();}['isCurrentDocumentInContext'](){return this['chatContext']['isCurrentDocumentInContext']();}['isCurrentDocumentInConversation'](){return this['chatContext']['isCurrentDocumentInConversation']();}['isSelectionInContext'](){return this['chatContext']['isSelectionInContext']();}async['setModel'](_0x5a7071){_0x5a7071?!0x1===await this['chatModels']['isAvailable'](_0x5a7071)&&(It('ai-chat-conversation-set-model-not-available',{'conversation':this,'model':_0x5a7071}),_0x5a7071=(await this['chatModels']['getAvailableModels']())[0x0]):(It('ai-chat-conversation-set-model-null',{'conversation':this}),_0x5a7071=(await this['chatModels']['getAvailableModels']())[0x0]),_0x5a7071['id']!==this['selectedModel']?.['id']&&(this['selectedModel']=_0x5a7071,this['chatCapabilities']['reset'](),this['fire']('modelSelected',{'selectedModel':_0x5a7071}));}}class Bs extends pt(){['_connector'];['_config'];['_locale'];['_modelList']=[];['_modelsRequest']=null;constructor({connector:_0x29f480,config:_0x42edc9,locale:_0x3fb2b0}){super(),this['_connector']=_0x29f480,this['_config']=_0x42edc9,this['_locale']=_0x3fb2b0;}get['_availableModels'](){return this['_config']?.['displayedModels'];}get['_defaultModelId'](){return this['_config']?.['defaultModelId'];}async['getAll'](){return this['_modelsRequest']||(this['_modelsRequest']=this['_retrieveModels']()),this['_modelsRequest'];}async['getAvailableModels'](){const _0x38655c=await this['getAll']();let _0x216cda;return _0x216cda=this['_availableModels']?this['_filterModels'](_0x38655c,this['_availableModels']):_0x38655c['filter'](_0x31af0b=>_0x31af0b['recommended']),_0x216cda;}async['getModel'](_0x369aee){const _0x35109b=await this['getAll']();if(!_0x35109b['length'])return null;if(_0x369aee){const _0x4f8403=this['_getModelById'](_0x35109b,_0x369aee);if(_0x4f8403)return _0x4f8403;It('ai-chat-model-id-unrecognized',{'modelId':_0x369aee,'fallBackModelId':this['_defaultModelId']});}return this['getDefault']();}async['getDefault'](){const _0x221c44=await this['getAvailableModels']();if(!_0x221c44['length'])return null;if(this['_defaultModelId']){const _0x5161d4=this['_getModelById'](_0x221c44,this['_defaultModelId']);if(_0x5161d4)return _0x5161d4;It('ai-chat-default-model-id-unrecognized',{'defaultModelId':this['_defaultModelId'],'fallBackModelId':_0x221c44[0x0]['id']});}return _0x221c44[0x0];}async['isAvailable'](_0x30a658){return(await this['getAvailableModels']())['some'](_0x5d53ec=>_0x5d53ec['name']===_0x30a658['name']&&_0x5d53ec['provider']===_0x30a658['provider']);}async['_retrieveModels'](){if(!this['_modelList']['length'])try{const _0x35d932=this['_locale']['uiLanguage']||'en',_0x36f534=this['_connector']['getModels'](_0x35d932),_0x506bb6=await _0x36f534['list']();this['_modelList']=_0x506bb6['items']['map'](_0x465372=>Gs(_0x465372)?{..._0x465372,'name':as(this['_locale'],'AI_MODEL_NAME_AUTO')}:_0x465372);}catch(_0x4280bc){throw Et('ai-models-unable-to-retrieve',{'error':_0x4280bc}),_0x4280bc;}return[...this['_modelList']];}['_filterModels'](_0x2daddc,_0x16589e){let _0x534349;if(_0x16589e){_0x534349=[];const _0x51429e=new Set(),_0x2bc4c8='string'==typeof _0x16589e?[_0x16589e['toLocaleLowerCase']()]:_0x16589e['map'](_0x2dbed5=>_0x2dbed5['toLocaleLowerCase']());for(const _0x4aa466 of _0x2bc4c8)for(const _0x26b699 of _0x2daddc)!_0x51429e['has'](_0x26b699['id'])&&this['_isMatchingFilter'](_0x26b699,_0x4aa466)&&(_0x534349['push'](_0x26b699),_0x51429e['add'](_0x26b699['id']));}else _0x534349=_0x2daddc;return _0x534349;}['_isMatchingFilter'](_0x2e16d3,_0x1a22fa){const _0xd5d464=_0x2e16d3['id']['toLocaleLowerCase'](),_0x56d96c=_0x2e16d3['name']['toLocaleLowerCase'](),_0x51e1c8=_0x2e16d3['provider']['toLocaleLowerCase']();return _0xd5d464===_0x1a22fa||_0x56d96c===_0x1a22fa||Gs(_0x2e16d3)&&'auto'===_0x1a22fa||_0x51e1c8===_0x1a22fa||_0xd5d464['startsWith'](_0x1a22fa);}['_getModelById'](_0x3fc3cc,_0x1402cb){return _0x3fc3cc['find'](_0x332d45=>Gs(_0x332d45)&&'auto'===_0x1402cb?_0x332d45:_0x332d45['id']===_0x1402cb)||null;}}function Gs(_0x2ba5de){return _0x2ba5de['id']['startsWith']('agent');}function Fs(_0x43190d){if(_0x43190d instanceof _0x596f47)return _0x43190d;if(_0x43190d?.['editors']&&_0x43190d['editors']['get'](0x0))return _0x43190d['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.'),_0x43190d['editors']['get'](0x0);throw new ot('ai-get-editor-from-context-no-editor');}function Ks({editor:_0x5aff53,interaction:_0x2aa863,reply:_0x25b5f7,groups:_0x242e8b,transform:_0x327555,documentCompare:_0x1f2d21,documentCompareOptions:_0x3e9759}){const _0x1da577=_0x2aa863['getDocumentContext']();if(!_0x1da577)return[];const _0x528cde=_0x1da577['content'],_0x252007=_0x1da577['version'],_0x54c8ee=_0x25b5f7['documentContextContent']['cloneNode'](!0x0);for(const {changes:_0x3ec5c0}of _0x242e8b){const _0x210641=_0x3ec5c0['filter'](_0x5bfe3c=>'new'!=_0x5bfe3c['type'])['map'](_0x1c6deb=>_s('data-id',_0x1c6deb['id'],_0x54c8ee)),_0xeb3b8f=_0x3ec5c0['filter'](_0x1b76fa=>'removed'!=_0x1b76fa['type'])['map'](_0x52f921=>_0x52f921['node']['cloneNode'](!0x0));let _0x5a7155=null;if(_0x210641['length']){_0x5a7155=_0x210641[0x0]['previousSibling'];for(let _0x4b271b=0x0;_0x4b271b<_0x210641['length'];_0x4b271b++)_0x487133(_0x210641[_0x4b271b]);}if(_0xeb3b8f['length']){_0x5a7155||(_0x3ec5c0[0x0]['anchorId']?_0x5a7155=_s('data-id',_0x3ec5c0[0x0]['anchorId'],_0x54c8ee):(_0x5a7155=_0xeb3b8f['shift'](),_0x594f4f(_0x54c8ee,_0x5a7155)));for(let _0x4418e8=0x0;_0x4418e8<_0xeb3b8f['length'];_0x4418e8++)_0x447d6a(_0x5a7155,_0xeb3b8f[_0x4418e8]),_0x5a7155=_0xeb3b8f[_0x4418e8];}}const _0xe6b430=ds(_0x54c8ee),_0x1081e5=_0x1f2d21['getDiff'](_0x528cde,_0xe6b430,_0x3e9759)['getOperations']();if(_0x327555){const _0x421f9b=_0x5aff53['model']['document']['history']['getOperations'](_0x252007),_0x55da84={'document':_0x5aff53['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1};return _0x2a4131(_0x1081e5,_0x421f9b,_0x55da84)['operationsA'];}return _0x1081e5;}function Ws(_0x42e0d1,_0x242a09){if('marker'!=_0x242a09['type'])return;const _0x3c9475=_0x42e0d1['model']['markers']['get'](_0x242a09['name']);_0x3c9475&&(_0x242a09['oldRange']=_0x3c9475['getRange']());}class Ys extends _0x314798{['activeConversation'];['_aiEditing'];['_aiConnector'];['_aiChatUi'];['_aiChatModels'];['_aiChatBalloon'];['_batchToChanges']=new Map();['_currentPreviewedChangeGroup']=null;['_bodyCollection'];static get['requires'](){return[rs,_0x2e7618];}static get['pluginName'](){return'AIChatController';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){this['_bodyCollection']=new qt(this['context']['locale']),this['_bodyCollection']['attachToDom'](),this['_aiConnector']=this['context']['plugins']['get']('AIConnector'),this['_aiChatUi']=this['context']['plugins']['get']('AIChatUI'),this['_aiEditing']=this['context']['plugins']['get']('AIEditing'),this['_aiChatModels']=new Bs({'connector':this['_aiConnector'],'config':this['context']['config']['get']('ai.models'),'locale':this['context']['locale']});const _0x12afd8=this['context']['plugins']['get']('AITabs');this['listenTo'](this['_aiChatUi'],'startConversation',()=>{this['_startConversationSafely']();}),this['listenTo'](this['_aiChatUi'],'sendUserMessage',(_0x40ef4c,_0x3502d7)=>{this['_handleUIUserMessage']({'message':_0x3502d7});}),this['listenTo'](_0x12afd8,'resizedTabs',(_0x4a8b72,_0x3997df)=>{this['_setIsMaximized'](_0x3997df);}),this['listenTo'](this['_aiChatUi'],'resizeTabs',()=>{_0x12afd8['resize']();}),this['listenTo'](_0x12afd8['view'],'change:activeTab',(_0x54f753,_0x2981b9,_0x90885e)=>{'chat'!==_0x90885e&&this['removeSelectionFromChatContext']();}),this['listenTo'](this['_aiChatUi'],'abortPromptStream',async()=>{await this['_stopLastInteraction'](),await this['_flushLastInteractionUI'](),this['removeSelectionFromChatContext']();}),this['listenTo'](this['_aiChatUi'],'addDocumentToContext',()=>{this['addCurrentDocumentToChatContext']();}),this['listenTo'](this['_aiChatUi'],'addFileToContext',(_0x2b6414,_0x421415)=>{this['activeConversation']?.['addFilesToContext'](Array['from'](_0x421415));}),this['listenTo'](this['_aiChatUi'],'addUrlToContext',(_0x293f60,_0x5cff6c)=>{this['activeConversation']?.['addUrlToContext'](_0x5cff6c);}),this['listenTo'](this['_aiChatUi'],'executeCustomItemCallback',(_0x32bf6c,_0x59565a)=>{_0x59565a['callback'](this['context']);}),this['listenTo'](this['_aiChatUi'],'addResourceToContext',(_0x130e4b,_0x1859e3)=>{this['activeConversation']?.['addResourceToContext'](_0x1859e3['source'],_0x1859e3['resource']);}),this['listenTo'](this['_aiChatUi'],'removeContextItem',(_0x2c2fbb,_0x31bba5)=>{this['_removeFromContext'](_0x31bba5);}),this['listenTo'](this['_aiChatUi'],'loadSourceResources',(_0x1bae13,_0x18716a)=>{this['activeConversation']?.['loadSourceResources'](_0x18716a['sourceId'],_0x18716a['query'],_0x18716a['uid']);}),this['listenTo'](this['_aiChatUi'],'toggleWebSearch',()=>{this['_toggleWebSearch']();}),this['listenTo'](this['_aiChatUi'],'toggleReasoning',()=>{this['_toggleReasoning']();}),this['listenTo'](this['_aiChatUi'],'selectModel',(_0x2ef006,_0x418f91)=>{this['activeConversation']?.['setModel'](_0x418f91);}),this['listenTo'](this['_aiChatUi'],'like',(_0x185ba1,{replyId:_0x428d4c})=>{console['log']('Liked\x20response',_0x428d4c);}),this['listenTo'](this['_aiChatUi'],'dislike',(_0x33595a,{replyId:_0x6b1fcb})=>{console['log']('Disliked\x20response',_0x6b1fcb);}),this['listenTo'](this['_aiChatUi'],'insertSuggestion',(_0x41232f,_0x4fe3f5)=>{this['_insertSuggestion'](_0x4fe3f5);}),this['listenTo'](this['_aiChatUi'],'showChangeInText',(_0x31f5f7,{replyId:_0x4331ae,partIndex:_0x40fdb5})=>{this['_aiChatBalloonShowDiff']=this['_aiChatUi']['showDiff'],this['_openBalloonFor'](_0x4331ae,_0x40fdb5);}),this['listenTo'](this['_aiChatUi'],'mouseOverSuggestion',(_0x46a801,{replyId:_0x2d3079,partIndex:_0x197527})=>{const _0x1ea750=this['_getDocumentRangeForReplyChanges'](_0x2d3079,_0x197527);_0x1ea750&&'$graveyard'!=_0x1ea750['range']['root']['rootName']&&this['_aiEditing']['showFakeVisualSelection']({'ranges':[_0x1ea750['range']],'id':'change-area','priority':0xa});}),this['listenTo'](this['_aiChatUi'],'mouseLeaveSuggestion',()=>{this['_aiEditing']['hideFakeVisualSelection']('change-area');}),this['listenTo'](this['_aiChatUi'],'applySuggestion',(_0x5901f4,_0x44974c)=>{this['_aiEditing']['hideFakeVisualSelection']('change-area'),this['_applySuggestion'](_0x44974c);}),this['listenTo'](this['_aiChatUi'],'toggleSuggestionDisplayMode',async(_0x4fee09,{replyId:_0x21605e,showDiff:_0x37e880})=>{const {reply:_0x5c7105}=this['getInteractionAndReplyById'](_0x21605e),_0x24203a=_0x5c7105['getContentParts']({'showDiff':_0x37e880});await this['_aiChatUi']['updateFeedItemAIReplySuggestionContent']({'id':_0x5c7105['id'],'parts':_0x24203a,'renderingStrategy':'static'});}),this['listenTo'](this['_aiChatUi'],'rejectSuggestion',(_0x4e5782,{replyId:_0x48b360,partIndex:_0x5a992a})=>{this['_rejectSuggestion']({'replyId':_0x48b360,'partIndex':_0x5a992a}),this['_aiEditing']['hideFakeVisualSelection']('change-area');}),this['context']['plugins']['has']('AIChatBalloon')&&(this['_aiChatBalloon']=this['context']['plugins']['get']('AIChatBalloon'),this['set']('_aiChatBalloonShowDiff',!0x1),this['_aiChatBalloon']['bind']('showDiff')['to'](this,'_aiChatBalloonShowDiff'),this['listenTo'](this['_aiChatBalloon'],'toggleSuggestionDisplayMode',()=>{const {replyId:_0x15ddab,partIndex:_0x34cc44}=this['_currentPreviewedChangeGroup'];this['_aiChatBalloonShowDiff']=!this['_aiChatBalloonShowDiff'];const {reply:_0x428eb4}=this['getInteractionAndReplyById'](_0x15ddab),_0x3dae04=_0x428eb4['getContentParts']({'showDiff':this['_aiChatBalloonShowDiff'],'groupIndex':_0x34cc44});this['_aiChatBalloon']['updateContent']({'part':_0x3dae04[0x0],'renderingStrategy':'static','keepErrors':!0x0});}),this['listenTo'](this['_aiChatBalloon'],'applySuggestion',()=>{const {replyId:_0xca62f7,partIndex:_0x2da473}=this['_currentPreviewedChangeGroup'];this['_applySuggestion']({'replyId':_0xca62f7,'partIndex':_0x2da473}),this['_aiChatBalloon']['setState']('accepted');}),this['listenTo'](this['_aiChatBalloon'],'insertSuggestion',()=>{const {replyId:_0x3d35d,partIndex:_0x2f2bec}=this['_currentPreviewedChangeGroup'];this['_insertSuggestion']({'replyId':_0x3d35d,'partIndex':_0x2f2bec}),this['_aiChatBalloon']['setState']('accepted');}),this['listenTo'](this['_aiChatBalloon'],'rejectSuggestion',()=>{const {replyId:_0x1c922c,partIndex:_0x484a4c}=this['_currentPreviewedChangeGroup'];this['_rejectSuggestion']({'replyId':_0x1c922c,'partIndex':_0x484a4c}),this['_aiChatBalloon']['setState']('rejected');}),this['listenTo'](this['_aiChatBalloon'],'showNext',()=>{const {replyId:_0x2336e2,partIndex:_0xa46494}=this['_currentPreviewedChangeGroup'],_0x271f47=this['_getPresentableSiblingContentPartIndex'](_0x2336e2,_0xa46494,'next');null!==_0x271f47&&this['_openBalloonFor'](_0x2336e2,_0x271f47);}),this['listenTo'](this['_aiChatBalloon'],'showPrevious',()=>{const {replyId:_0x148ed6,partIndex:_0x2c7370}=this['_currentPreviewedChangeGroup'],_0x3cd772=this['_getPresentableSiblingContentPartIndex'](_0x148ed6,_0x2c7370,'previous');null!==_0x3cd772&&this['_openBalloonFor'](_0x148ed6,_0x3cd772);}),this['listenTo'](this['_aiChatBalloon'],'dialogClosed',(_0x53efeb,{id:_0x509f60})=>{if('aiChatBalloon'!==_0x509f60)return;const {replyId:_0xc08f1a,partIndex:_0x5bf4b1}=this['_currentPreviewedChangeGroup'];this['_currentPreviewedChangeGroup']=null,this['_aiChatUi']['setFeedItemAIReplySuggestionPartActive']({'id':_0xc08f1a,'index':_0x5bf4b1,'isActive':!0x1});})),this['on']('interactionCreated',(_0x300d99,_0x8a7b48)=>{this['_aiChatUi']['addFeedItemUserMessage'](_0x8a7b48);}),this['on']('replyCreated',(_0x1954d6,_0x207820)=>{this['_addFeedItemReply'](_0x207820);});}async['afterInit'](){this['context']instanceof _0x596f47?this['_integrateEditor'](this['context']):this['listenTo'](this['context']['editors'],'add',(_0x305e8d,_0x5f3211)=>{_0x5f3211['on']('ready',()=>{this['_integrateEditor'](_0x5f3211);});});const _0x295bde=this['context']['config']['get']('ai.chat.initialConversation');let _0x224a5f=_0x295bde;if('lastCreated'!=_0x295bde||(_0x224a5f=await this['_getLastCreatedConversationId'](),_0x224a5f))return'new'==_0x224a5f?this['_startConversationSafely']():this['loadConversation'](_0x224a5f);}async['destroy'](){return await this['_stopLastInteraction'](),this['_bodyCollection']['detachFromDom'](),super['destroy']();}async['loadConversation'](_0x1770f5){this['context']['plugins']['has']('AIChatBalloon')&&this['context']['plugins']['get']('AIChatBalloon')['close'](),(this['context']['plugins']['get'](ns)['view']['activateTab']('chat'),this['_aiChatUi']['setFeedItemRenderingStrategy']('static'),this['_aiChatUi']['toggleLoadingSkeleton'](!0x0),await this['_stopLastInteraction']());try{await this['_aiConnector']['fetchConversation'](_0x1770f5)['getConversation'](),await this['_startConversationSafely'](_0x1770f5),this['_updateConversationTitle']('\x20'),await this['activeConversation']['load'](_0x1770f5,this['_aiEditing']['sessionId']),this['activeConversation']['isCurrentDocumentInConversation']()&&this['addCurrentDocumentToChatContext']();}catch(_0x13c795){this['_aiChatUi']['addFeedItemError']({'errorMessage':as(this['context']['locale'],'AI_CHAT_UNABLE_TO_LOAD_CONVERSATION'),'id':_0x1770f5}),this['_logError'](new ot('ai-chat-conversation-not-found',this,{'error':_0x13c795}));}finally{this['_aiChatUi']['startAutoScroll'](),this['_aiChatUi']['setFeedItemRenderingStrategy']('streaming'),this['_aiChatUi']['toggleLoadingSkeleton'](!0x1);}}['registerToolDataCallback'](_0x4e027e){let _0x14fce0=null,_0x4e83ef=null;this['on']('toolDataReceived',(_0x3cd518,_0x15f029,_0x3ce05e)=>{_0x3ce05e['id']!==_0x14fce0&&(_0x14fce0=_0x3ce05e['id'],_0x4e83ef=this['_getAIChatFeedAPI'](_0x3ce05e)),_0x4e027e(_0x15f029,_0x4e83ef);});}['addCurrentDocumentToChatContext'](){this['activeConversation']?.['addCurrentDocumentToContext'](as(this['context']['locale'],'AI_CHAT_CONTEXT_CURRENT_DOCUMENT'));}async['addSelectionToChatContext'](){const _0x3b8e81=this['_aiEditing']['getSelectionText']();this['activeConversation']?.['addSelectionToContext'](_0x3b8e81),this['addCurrentDocumentToChatContext']();}['removeSelectionFromChatContext'](){this['activeConversation']?.['removeSelectionFromContext']();}['focusPromptInput'](){this['_aiChatUi']['focusPromptInput']();}async['startConversation'](){await this['_startConversationSafely']();}async['sendMessage'](_0x557e1b){await this['_handleUIUserMessage'](_0x557e1b);}['getGroupId'](){const _0x52781f=this['context']['config']['get']('collaboration.channelId');if(!_0x52781f)throw new ot('ai-chat-missing-channel-id',this);return _0x52781f;}['_handleRemovedConversation'](_0x16c19f){this['activeConversation']['id']===_0x16c19f&&this['_startConversationSafely']();}['_insertSuggestion'](_0x12ee8a){const _0x5cac69=Fs(this['context']);if(!_0x5cac69['plugins']['has']('TrackChanges'))throw new ot('ai-no-track-changes',null);const _0x4598a1=this['context']['plugins']['get']('DocumentCompare'),{reply:_0xcf65ce,interaction:_0x35d660}=this['getInteractionAndReplyById'](_0x12ee8a['replyId']),_0x15a01c=this['_getDocumentRangeForReplyChanges'](_0x12ee8a['replyId'],_0x12ee8a['partIndex']),_0x42c4bb=void 0x0!==_0x12ee8a['partIndex']?[_0xcf65ce['changeGroups'][_0x12ee8a['partIndex']]]:_0xcf65ce['changeGroups']['filter'](_0x3b1e1c=>'pending'==_0x3b1e1c['state']),_0x5dbb9d=_0x42c4bb['map'](_0x10f389=>_0xcf65ce['changeGroups']['indexOf'](_0x10f389));if(!_0x15a01c||'$graveyard'==_0x15a01c['range']['root']['rootName'])return void _0x5dbb9d['forEach'](_0x327923=>_0xcf65ce['setChangeGroupState'](_0x327923,'outdated'));_0x5dbb9d['forEach'](_0x10d4f3=>_0xcf65ce['setChangeGroupState'](_0x10d4f3,'accepted'));const _0x530d11=Ks({'editor':_0x5cac69,'reply':_0xcf65ce,'interaction':_0x35d660,'groups':_0x42c4bb,'transform':!0x0,'documentCompare':_0x4598a1,'documentCompareOptions':{'anchor':'main','markDeletions':!0x0}});let _0x14a897;_0x15a01c&&this['_scrollToSuggestionRange'](_0x15a01c['range']),_0x5cac69['model']['change'](_0x43487a=>{_0x14a897=_0x43487a['batch'],_0x5cac69['plugins']['get']('TrackChangesEditing')['_applyOperationsAsSuggestions'](_0x530d11),this['_aiEditing']['hideFakeVisualSelection']('change-area');}),this['_batchToChanges']['set'](_0x14a897,{'interactionId':_0x35d660['id'],'replyId':_0xcf65ce['id'],'indexes':_0x5dbb9d['slice']()}),this['_updateRatings'](_0xcf65ce);}['_applySuggestion'](_0x5d2b30){const _0x3ed839=Fs(this['context']),_0xd1c0c6=this['context']['plugins']['get'](_0x2e7618),{reply:_0x20623b,interaction:_0x3e4a79}=this['getInteractionAndReplyById'](_0x5d2b30['replyId']),_0x5d03eb=this['_getDocumentRangeForReplyChanges'](_0x5d2b30['replyId'],_0x5d2b30['partIndex']),_0x58aaad=void 0x0!==_0x5d2b30['partIndex']?[_0x20623b['changeGroups'][_0x5d2b30['partIndex']]]:_0x20623b['changeGroups']['filter'](_0x26c974=>'pending'==_0x26c974['state']),_0x12652b=_0x58aaad['map'](_0x328ce7=>_0x20623b['changeGroups']['indexOf'](_0x328ce7));if(!_0x5d03eb||'$graveyard'==_0x5d03eb['range']['root']['rootName'])return void _0x12652b['forEach'](_0x506164=>_0x20623b['setChangeGroupState'](_0x506164,'outdated'));_0x12652b['forEach'](_0x1c297b=>_0x20623b['setChangeGroupState'](_0x1c297b,'accepted'));const _0x554bc9=Ks({'editor':_0x3ed839,'reply':_0x20623b,'interaction':_0x3e4a79,'groups':_0x58aaad,'transform':!0x0,'documentCompare':_0xd1c0c6,'documentCompareOptions':{'anchor':'main','markDeletions':!0x1}});let _0x599c47;_0x5d03eb&&this['_scrollToSuggestionRange'](_0x5d03eb['range']),_0x3ed839['model']['change'](_0x403eae=>{_0x599c47=_0x403eae['batch'];for(const _0x63128d of _0x554bc9)_0x63128d['baseVersion']=_0x3ed839['model']['document']['version'],Ws(_0x3ed839,_0x63128d),_0x403eae['batch']['addOperation'](_0x63128d),_0x3ed839['model']['applyOperation'](_0x63128d);}),this['_batchToChanges']['set'](_0x599c47,{'interactionId':_0x3e4a79['id'],'replyId':_0x20623b['id'],'indexes':_0x12652b['slice']()}),this['_updateRatings'](_0x20623b);}['_rejectSuggestion'](_0x2fb0ff){const {reply:_0x2ac164}=this['getInteractionAndReplyById'](_0x2fb0ff['replyId']);_0x2ac164['setChangeGroupState'](_0x2fb0ff['partIndex'],'rejected');}['_openBalloonFor'](_0xbe6399,_0x27d638){if(!this['_aiChatBalloon'])return;const {reply:_0x29e203}=this['getInteractionAndReplyById'](_0xbe6399),_0x5d647e=_0x29e203['getContentParts']({'showDiff':this['_aiChatBalloonShowDiff']});let _0x4fcf0f,_0x35b7ab;if(void 0x0!==_0x27d638?(_0x35b7ab=_0x5d647e['find'](_0x879460=>_0x879460['index']==_0x27d638),_0x4fcf0f=_0x35b7ab?.['index']):(_0x35b7ab=_0x5d647e[0x0],_0x4fcf0f=_0x35b7ab['index']),this['_currentPreviewedChangeGroup']?.['replyId']==_0xbe6399&&this['_currentPreviewedChangeGroup']?.['partIndex']==_0x4fcf0f)return;const _0x4e9ba5=this['_getUserPresentableContentPartDocumentRange'](_0xbe6399,_0x29e203,_0x35b7ab);if(!_0x4e9ba5)return void this['_aiChatBalloon']['close']();this['_currentPreviewedChangeGroup']={'replyId':_0xbe6399,'partIndex':_0x4fcf0f},this['_scrollToSuggestionRange'](_0x4e9ba5,!0x0);const _0x4402c5=this['_getPresentableSiblingContentPartIndex'](_0xbe6399,_0x4fcf0f,'next');this['_aiChatBalloon']['updateContent']({'part':_0x35b7ab,'renderingStrategy':'static'}),this['_aiChatBalloon']['open']({'index':_0x4fcf0f,'title':as(this['context']['locale'],'AI_BALLOON_HEADER_TITLE',(_0x4fcf0f+0x1)['toString']()),'showRotator':null!==_0x4402c5,'ranges':[_0x4e9ba5],'areActionsDisabled':_0x29e203['areActionsDisabled']}),this['_aiChatBalloon']['setState']('pending'),this['_aiChatUi']['scrollFeedToSuggestion'](_0xbe6399,_0x4fcf0f),this['_aiChatUi']['setFeedItemAIReplySuggestionPartActive']({'id':_0xbe6399,'index':_0x4fcf0f,'isActive':!0x0});}['_getPresentableSiblingContentPartIndex'](_0x2cd05,_0x41635d,_0x228049){const {reply:_0xd5236b}=this['getInteractionAndReplyById'](_0x2cd05),_0x3d47ea=_0xd5236b['getContentParts']({'showDiff':this['_aiChatBalloonShowDiff']});if(0x1==_0x3d47ea['length'])return null;const _0x5b24ce=_0x3d47ea['findIndex'](_0x14ec66=>_0x14ec66['index']==_0x41635d),_0x18c7c4='next'==_0x228049?0x1:-0x1;let _0x326cef=_0x3d47ea['at']((_0x5b24ce+_0x18c7c4)%_0x3d47ea['length'])['index'],_0x29d11b=_0x3d47ea[_0x326cef];for(;!this['_getUserPresentableContentPartDocumentRange'](_0x2cd05,_0xd5236b,_0x29d11b);){if(_0x326cef=_0x3d47ea['at']((_0x326cef+_0x18c7c4)%_0x3d47ea['length'])['index'],_0x326cef===_0x5b24ce)return null;_0x29d11b=_0x3d47ea[_0x326cef];}return _0x326cef;}['_getUserPresentableContentPartDocumentRange'](_0x9472d5,_0x5ccbdc,_0x469a18){const _0x3b219b=_0x5ccbdc['changeGroups'];if(!_0x469a18['hasChanges'])return null;const _0x24e985=_0x3b219b['find'](_0x1dec8e=>_0x1dec8e['index']==_0x469a18['index']);if('pending'!==_0x24e985?.['state'])return null;const _0x15fc99=this['_getDocumentRangeForReplyChanges'](_0x9472d5,_0x469a18['index']);if(!_0x15fc99)return null;const {range:_0x3f2d1e,currentIndex:_0x1db066}=_0x15fc99;return'$graveyard'==_0x3f2d1e['root']['rootName']?(_0x5ccbdc['setChangeGroupState'](_0x1db066,'outdated'),null):_0x15fc99['range'];}['_getDocumentRangeForReplyChanges'](_0x30aa18,_0x40c5f9){const _0x2fd81a=Fs(this['context']),{reply:_0xf92d90,interaction:_0x334cf1}=this['getInteractionAndReplyById'](_0x30aa18),_0x46d1ff=_0xf92d90['changeGroups']['filter'](_0x4e2dd6=>'pending'==_0x4e2dd6['state']),_0x531e00=_0x46d1ff['map'](_0x2de9dc=>_0xf92d90['changeGroups']['indexOf'](_0x2de9dc));void 0x0===_0x40c5f9&&(_0x40c5f9=_0x531e00[0x0]);const _0x4f8a4d=_0x531e00['indexOf'](_0x40c5f9);if(-0x1==_0x4f8a4d)return null;const _0x3492bd=_0x46d1ff[_0x4f8a4d],_0x409254=new _0x11b267([]),_0x48d33f=new _0x11b267([]);for(const _0x1b13d7 of _0x3492bd['changes'])if('removed'!=_0x1b13d7['type']&&_0x48d33f['children']['push'](_0x1b13d7['node']['cloneNode'](!0x0)),'new'!=_0x1b13d7['type']){const _0x2addf0=_0x47e0e5(_0x4d6158=>gs(_0x4d6158,'data-id')==_0x1b13d7['id'],_0xf92d90['documentContextContent'],!0x0);_0x409254['children']['push'](_0x2addf0['cloneNode'](!0x0));}if(0x0==_0x409254['children']['length']){if(_0x3492bd['changes'][0x0]['anchorId']){const _0x5ae6f8=_s('data-id',_0x3492bd['changes'][0x0]['anchorId'],_0xf92d90['documentContextContent']);_0x409254['children']['unshift'](_0x5ae6f8['cloneNode'](!0x0)),_0x48d33f['children']['unshift'](_0x5ae6f8['cloneNode'](!0x0)),_0x5ae6f8['nextSibling']&&(_0x409254['children']['push'](_0x5ae6f8['nextSibling']['cloneNode'](!0x0)),_0x48d33f['children']['push'](_0x5ae6f8['nextSibling']['cloneNode'](!0x0)));}else{const _0x3c9d6d=_0xf92d90['documentContextContent']['children'][0x0];if(!_0x3c9d6d)return null;_0x409254['children']['push'](_0x3c9d6d['cloneNode'](!0x0)),_0x48d33f['children']['push'](_0x3c9d6d['cloneNode'](!0x0));}}const _0x3295db=_0x334cf1['getDocumentContext'](),_0x315ec9=_0x2fd81a['data']['parse'](_0x3295db['content']),_0x2fe973=ds(_0x409254),_0x4b18be=_0x2fd81a['data']['parse'](_0x2fe973),_0xcda13c=_0x2fd81a['data']['parse'](_0x2fe973),_0x1732c2=_0x2fd81a['model']['createPositionAt'](_0x4b18be,0x0),_0x2c3dab=ds(_0x48d33f),_0x132d80={'anchor':_0x1732c2,'markDeletions':!0x1},_0x50c51d=_0x2fd81a['plugins']['get'](_0x2e7618)['getDiff'](_0x2fe973,_0x2c3dab,_0x132d80)['getOperations']();if(!_0x50c51d['length'])return null;_0x2fd81a['model']['change'](_0x4e6669=>{for(const _0x2de742 of _0x50c51d)if('remove'==_0x2de742['type']){const _0xc1200d=_0x2de742['sourcePosition'],_0xb194c1=_0x2de742['howMany'],_0x1dac27=new _0x3bae80(_0xc1200d,_0xb194c1);_0x4e6669['batch']['addOperation'](_0x1dac27),_0x2fd81a['model']['applyOperation'](_0x1dac27);}else'marker'!==_0x2de742['type']&&(_0x2de742['baseVersion']=null,_0x2de742['isDocumentOperation']=!0x1,_0x4e6669['batch']['addOperation'](_0x2de742),_0x2fd81a['model']['applyOperation'](_0x2de742));});const _0x4c3c0b=Rs(_0x2fd81a,_0x50c51d,_0x4b18be);Os(_0x2fd81a['model'],_0x4c3c0b);const _0x29a94b=_0x4c3c0b['getFirstRange']()['start']['path']['slice'](),_0x394330=_0x4c3c0b['getFirstRange']()['end']['path']['slice'](),_0x196aa9=[];let _0x36d9cc=_0x4b18be,_0x177f4c=_0xcda13c;for(let _0x45c3be=0x0;_0x45c3be<_0x394330['length'];_0x45c3be++){const _0x174da9=_0x36d9cc['maxOffset']-_0x394330[_0x45c3be];_0x196aa9[_0x45c3be]=_0x177f4c['maxOffset']-_0x174da9,_0x36d9cc=_0x36d9cc['getChildAtOffset'](_0x394330[_0x45c3be]),_0x177f4c=_0x177f4c['getChildAtOffset'](_0x196aa9[_0x45c3be]);}const _0x49838e=_0x2fd81a['model']['createRange'](_0x2fd81a['model']['createPositionFromPath'](_0xcda13c,_0x29a94b),_0x2fd81a['model']['createPositionFromPath'](_0xcda13c,_0x196aa9)),_0x1b9746=_0xcda13c['getChild'](0x0)['getAttribute'](_0x1eb54e),_0x118ad9=Array['from'](_0x315ec9['getChildren']())['find'](_0x130475=>_0x130475['getAttribute'](_0x1eb54e)==_0x1b9746)['getPath'](),_0x3f5106=_0x49838e['start']['path']['slice'](),_0x5451e2=_0x49838e['end']['path']['slice']();_0x3f5106[0x0]=_0x118ad9[0x0]+_0x3f5106[0x0],_0x5451e2[0x0]=_0x118ad9[0x0]+_0x5451e2[0x0];let _0x32a31b=_0x2fd81a['model']['createRange'](_0x2fd81a['model']['createPositionFromPath'](_0x2fd81a['model']['document']['getRoot'](),_0x3f5106),_0x2fd81a['model']['createPositionFromPath'](_0x2fd81a['model']['document']['getRoot'](),_0x5451e2));const _0x2f5707=_0x2fd81a['model']['document']['history']['getOperations'](_0x3295db['version']);for(const _0x5eda72 of _0x2f5707)_0x32a31b=_0x1f3f5a['_createFromRanges'](_0x32a31b['getTransformedByOperation'](_0x5eda72));return{'range':_0x32a31b,'currentIndex':_0x40c5f9};}['_integrateEditor'](_0x254b46){if(_0x254b46['plugins']['has']('Undo')){const _0x164300=_0x254b46['commands']['get']('undo'),_0x1342ed=_0x254b46['commands']['get']('redo');this['listenTo'](_0x164300,'revert',(_0x174613,_0x52f409,_0x4ee4cf)=>{const _0x3dd30f=this['_batchToChanges']['get'](_0x52f409);if(!_0x3dd30f)return;const _0x3a4fee=this['activeConversation']['getInteraction'](_0x3dd30f['interactionId'])['getReply'](_0x3dd30f['replyId']);_0x3dd30f['indexes']['forEach'](_0x21c7f1=>_0x3a4fee['setChangeGroupState'](_0x21c7f1,'pending')),this['_batchToChanges']['delete'](_0x52f409),this['_batchToChanges']['set'](_0x4ee4cf,_0x3dd30f);}),this['listenTo'](_0x1342ed,'revert',(_0x222910,_0x422285,_0x441bdb)=>{const _0x43801b=this['_batchToChanges']['get'](_0x422285);if(!_0x43801b)return;const _0x284de5=this['activeConversation']['getInteraction'](_0x43801b['interactionId'])['getReply'](_0x43801b['replyId']);_0x43801b['indexes']['forEach'](_0x5b99aa=>_0x284de5['setChangeGroupState'](_0x5b99aa,'accepted')),this['_batchToChanges']['delete'](_0x422285),this['_batchToChanges']['set'](_0x441bdb,_0x43801b);});}const _0x3a35d2=_0x254b46['config']['get']('ai.chat.context');_0x3a35d2['alwaysAddSelection']&&_0x3a35d2['document']['enabled']&&this['listenTo'](_0x254b46['model']['document']['selection'],'change:range',(_0x3d656c,_0x213707)=>{if(!_0x213707['directChange'])return;'chat'===_0x254b46['plugins']['get']('AITabs')['view']['activeTab']&&(_0x254b46['model']['hasContent'](_0x254b46['model']['document']['selection'])?this['addSelectionToChatContext']():this['removeSelectionFromChatContext']());});}async['_getLastCreatedConversationId'](){const _0x28d69b=this['_aiConnector']['fetchConversations'](this['getGroupId'](),{'limit':0x1,'sortBy':'createdAt'});try{const _0x361e22=await _0x28d69b['getConversations']();return _0x361e22['length']?_0x361e22[0x0]['id']:'new';}catch(_0x33c9e9){return this['_aiChatUi']['addFeedItemError']({'errorMessage':as(this['context']['locale'],'AI_CHAT_UNABLE_TO_LOAD_CONVERSATION'),'id':at()}),this['_logError'](new ot('ai-chat-conversation-init-failed',this,{'error':_0x33c9e9})),this['_aiChatUi']['toggleLoadingSkeleton'](!0x1),this['_aiChatUi']['disableControls'](),null;}}async['_startConversationSafely'](_0x3cfbb7){try{this['_aiChatUi']['enableControls'](),await this['_handleStartConversation'](_0x3cfbb7);}catch(_0x5ac681){this['_aiChatUi']['addFeedItemError']({'errorMessage':as(this['context']['locale'],'AI_CHAT_UNABLE_TO_START_CONVERSATION'),'id':_0x3cfbb7||at()}),console['error'](_0x5ac681),this['activeConversation']=void 0x0,this['_aiChatUi']['disableControls']();}}async['_handleStartConversation'](_0x29a0f0){let _0x532cbb;this['context']['plugins']['has']('AIChatBalloon')&&this['context']['plugins']['get']('AIChatBalloon')['close'](),_0x29a0f0||!this['activeConversation']?_0x532cbb=this['context']['config']['get']('ai.models.defaultModelId'):this['_aiChatUi']['isModelAvailable']&&(_0x532cbb=this['activeConversation']['selectedModel']['id']),await this['_stopLastInteraction']();const _0x4b6db6=this['getGroupId'](),_0x41c668=_0x29a0f0||at();this['activeConversation']=new Vs({'connector':this['_aiConnector'],'chatModels':this['_aiChatModels'],'selectedModelId':_0x532cbb,'conversationId':_0x41c668,'group':_0x4b6db6,'getEditor':()=>Fs(this['context']),'isFromHistory':!!_0x29a0f0}),this['activeConversation']['delegate']('toolDataReceived','interactionCreated','interactionStarted','replyCreated')['to'](this),this['activeConversation']['on']('conversationInitialized',(_0x6f51ac,_0x511774)=>{this['_aiChatUi']['createConversation'](_0x511774),this['_aiChatUi']['resetMessageInput'](),this['_aiChatUi']['clearPendingContextUI'](),this['_aiChatUi']['clearConversationContextUI'](),_0x29a0f0||(this['_aiChatUi']['resetConversationTitle'](),this['addCurrentDocumentToChatContext']());}),this['activeConversation']['on']('uploadProgressChanged',(_0x3a5c96,_0x41c0aa)=>{this['_aiChatUi']['setIsUploadInProgress'](_0x41c0aa['isUploadInProgress']);}),this['activeConversation']['on']('webSearchStarted',()=>{const _0x15c49e=this['_aiChatUi']['prepareLoadingMessage']({'isWebSearchEnabled':!0x0,'isReasoningEnabled':!0x1});this['_aiChatUi']['setLoadingMessage'](_0x15c49e);}),this['activeConversation']['on']('reasoningStarted',()=>{const _0x2cbcb6=this['_aiChatUi']['prepareLoadingMessage']({'isWebSearchEnabled':!0x1,'isReasoningEnabled':!0x0});this['_aiChatUi']['setLoadingMessage'](_0x2cbcb6);}),this['activeConversation']['on']('webSearchFinished',(_0x3eb9a5,_0x33335a)=>{this['_aiChatUi']['addFeedInteractionHeader'](_0x33335a,{'isWebSearchEnabled':!0x0,'isReasoningEnabled':!0x1});}),this['activeConversation']['on']('reasoningFinished',(_0x2528cf,_0x3535b9)=>{this['_aiChatUi']['addFeedInteractionHeader'](_0x3535b9,{'isWebSearchEnabled':!0x1,'isReasoningEnabled':!0x0});}),this['activeConversation']['on']('interactionStarted',()=>{this['_aiChatUi']['startInteraction']();}),this['activeConversation']['on']('interactionFinished',async()=>{await this['_aiChatUi']['finishInteraction']();}),this['activeConversation']['on']('interactionDestroyed',(_0x1fc851,_0x202de8)=>{this['_aiChatUi']['removeFeedInteraction'](_0x202de8['id']);}),this['activeConversation']['on']('setConversationTitle',(_0xfd3a5,_0x38afae,_0x1de032)=>{this['_updateConversationTitle'](_0x38afae,_0x1de032);}),this['activeConversation']['on']('replyContentUpdated',async(_0x28744e,_0x3faea2)=>{await this['_updateReplyContent']({'reply':_0x3faea2});}),this['activeConversation']['on']('replyChangeGroupStateUpdated',(_0x5e8faa,{reply:_0x392006,index:_0x7278d0,state:_0x26833f})=>{this['_aiChatUi']['updateFeedItemAIReplySuggestionPartState']({'id':_0x392006['id'],'index':_0x7278d0,'state':_0x26833f}),this['_currentPreviewedChangeGroup']?.['replyId']['includes'](_0x392006['id'])&&this['_currentPreviewedChangeGroup']?.['partIndex']==_0x7278d0&&this['_aiChatBalloon']?.['setState'](_0x26833f);}),this['activeConversation']['on']('contextItemAdded',(_0x170bff,_0x1c7442)=>{if(this['_aiChatUi']['addContextItem'](_0x1c7442['contextItem'],_0x1c7442['isLoading']),'selection'===_0x1c7442['contextItem']['type']){const _0x47c210=[...Fs(this['context'])['model']['document']['selection']['getRanges']()];this['_aiEditing']['showFakeVisualSelection']({'ranges':_0x47c210,'id':'context','priority':0x1});}}),this['activeConversation']['on']('contextItemRemoved',(_0x11e9de,_0x7e246f)=>{this['_aiChatUi']['removeContextItem'](_0x7e246f['uiId']),'current-document'==_0x7e246f['uiId']&&this['removeSelectionFromChatContext'](),'selection'===_0x7e246f['type']&&this['_aiEditing']['hideFakeVisualSelection']('context');}),this['activeConversation']['on']('contextItemLoadingEnded',(_0xa3b251,_0xbfac1)=>{this['_aiChatUi']['setContextItemLoading'](_0xbfac1['contextItem']['uiId'],_0xbfac1['isLoading']);}),this['activeConversation']['on']('contextSent',(_0x2527b2,_0x1a4946)=>{this['_aiChatUi']['setConversationContext'](_0x1a4946['contextItems']);}),this['activeConversation']['on']('addContextOptionsChanged',(_0x52d0e8,_0x37e188)=>{this['_aiChatUi']['setAddContextOptions'](_0x37e188['options']);}),this['activeConversation']['on']('sourceResourcesLoaded',(_0xbe775f,_0x148d93)=>{this['_aiChatUi']['populateSourceResourceBalloon'](_0x148d93['sourceId'],_0x148d93['source'],_0x148d93['resources'],_0x148d93['uid']);}),this['activeConversation']['on']('resourceStateChanged',(_0x42ce08,_0x58650c)=>{this['_aiChatUi']['updateResourceState'](_0x58650c['sourceId'],_0x58650c['resourceId'],_0x58650c['isInContext']);}),this['activeConversation']['on']('capabilitiesUpdated',(_0x190363,_0x5d3534)=>{this['_aiChatUi']['updateCapabilities'](_0x5d3534);}),this['activeConversation']['on']('modelSelected',async(_0x1358d4,_0xd22038)=>{const _0x5a99a8=(await this['_aiChatModels']['getAll']())['find'](_0xd63db4=>_0xd63db4['id']===_0xd22038['selectedModel']?.['id'])||null;this['_aiChatUi']['setSelectedModel'](_0x5a99a8,_0xd22038['isDisabled']);}),this['activeConversation']['on']('error',(_0x95f593,{error:_0x920fd,interactionId:_0x285b2c,fileName:_0x36ff8e,url:_0x3ee7a4,sourceId:_0x1b4dab,sourceLabel:_0x166be7})=>{const _0x409661=_0x285b2c?_0x285b2c+':'+at():at();_0x920fd['message']['startsWith']('ai-request-aborted')?this['_aiChatUi']['addFeedItemStaticMessage']({'staticMessage':as(this['context']['locale'],'AI_CHAT_ABORTED_MESSAGE'),'id':_0x409661}):_0x920fd['message']['startsWith']('ai-chat-conversation-init-failed')||_0x920fd['message']['startsWith']('ai-chat-conversation-start-failed')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':as(this['context']['locale'],'AI_CHAT_UNABLE_TO_START_CONVERSATION'),'id':_0x409661}),this['_logError'](_0x920fd)):_0x920fd['message']['startsWith']('ai-chat-file-upload-failed')?this['_aiChatUi']['addFeedItemError']({'errorMessage':as(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_FILE',_0x36ff8e),'id':_0x409661}):_0x920fd['message']['startsWith']('ai-chat-url-upload-failed')?this['_aiChatUi']['addFeedItemError']({'errorMessage':as(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_URL',_0x3ee7a4),'id':_0x409661}):_0x920fd['message']['startsWith']('ai-chat-context-invalid-data')?this['_aiChatUi']['addFeedItemError']({'errorMessage':as(this['context']['locale'],'AI_CHAT_CONTEXT_INVALID_DATA'),'id':_0x409661}):_0x920fd['message']['startsWith']('ai-chat-context-unsupported-type')?this['_aiChatUi']['addFeedItemError']({'errorMessage':as(this['context']['locale'],'AI_CHAT_CONTEXT_UNSUPPORTED_TYPE'),'id':_0x409661}):_0x920fd['message']['startsWith']('ai-chat-source-resources-load-failed')?(_0x1b4dab&&this['_aiChatUi']['closeSourceResourceBalloon'](_0x1b4dab),this['_aiChatUi']['addFeedItemError']({'errorMessage':as(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_LOAD_RESOURCES',_0x166be7||'source'),'id':_0x409661}),this['_logError'](_0x920fd)):_0x920fd['message']['startsWith']('ai-chat-resource-load-failed')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':as(this['context']['locale'],'AI_CHAT_RESOURCE_LOAD_FAILED'),'id':_0x409661}),this['_logError'](_0x920fd)):_0x920fd['message']['startsWith']('ai-chat-invalid-request')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':as(this['context']['locale'],'AI_CHAT_INVALID_REQUEST'),'id':_0x409661}),this['_logError'](_0x920fd)):_0x920fd['message']['startsWith']('ai-chat-context-unsupported-file-type')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':as(this['context']['locale'],'AI_CHAT_CONTEXT_UNSUPPORTED_FILE_TYPE'),'id':_0x409661}),this['_logError'](_0x920fd)):_0x920fd['message']['startsWith']('ai-chat-context-file-too-large')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':as(this['context']['locale'],'AI_CHAT_CONTEXT_FILE_TOO_LARGE'),'id':_0x409661}),this['_logError'](_0x920fd)):_0x920fd['message']['startsWith']('ai-chat-context-file-too-many-pages')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':as(this['context']['locale'],'AI_CHAT_CONTEXT_FILE_TOO_MANY_PAGES'),'id':_0x409661}),this['_logError'](_0x920fd)):_0x920fd['message']['startsWith']('ai-chat-context-form-data-size-limits-exceeded')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':as(this['context']['locale'],'AI_CHAT_CONTEXT_FORM_DATA_SIZE_LIMITS_EXCEEDED'),'id':_0x409661}),this['_logError'](_0x920fd)):(this['_aiChatUi']['addFeedItemError']({'errorMessage':as(this['context']['locale'],'AI_CHAT_GENERIC_ERROR'),'id':_0x409661}),this['_logError'](_0x920fd));}),await this['activeConversation']['init'](this['context']['config']['get']('ai.chat.context')),_0x29a0f0||await this['activeConversation']['start']();}async['_handleUIUserMessage']({message:_0x5d328a,attributes:_0x11d0c9}){if(!this['activeConversation'])throw new ot('ai-chat-controller-no-active-conversation');if(this['activeConversation']['isCurrentDocumentInContext']()){const _0x469919=await this['_aiEditing']['getDocumentData']();await this['activeConversation']['updateCurrentDocumentInContext'](_0x469919);}this['activeConversation']['id']&&this['activeConversation']['isStarted']&&await this['activeConversation']['handleUserInteraction']({'userMessage':_0x5d328a,'attributes':_0x11d0c9});}['_setIsMaximized'](_0x1b852c){this['_aiChatUi']['setIsMaximized'](_0x1b852c);}['_logError'](_0x303d76){Et(_0x303d76['message']);}['_removeFromContext'](_0x50b074){this['activeConversation']?.['removeFromContext'](_0x50b074);}['_toggleWebSearch'](){this['activeConversation']?.['toggleWebSearch']();}['_toggleReasoning'](){this['activeConversation']?.['toggleReasoning']();}['getInteractionAndReplyById'](_0x3a25f4){const [_0x5885d8,_0x204c4d]=_0x3a25f4['split'](':'),_0x4f9042=this['activeConversation']['getInteraction'](_0x5885d8),_0x1b0e65=_0x4f9042['getReply'](_0x204c4d);return{'interaction':_0x4f9042,'reply':_0x1b0e65};}['_scrollToSuggestionRange'](_0x2f0e3c,_0x178aee=!0x1){const _0x16d5e4=Fs(this['context']),_0x59d65b={'target':_0x16d5e4['editing']['view']['domConverter']['viewRangeToDom'](_0x16d5e4['editing']['mapper']['toViewRange'](_0x2f0e3c)),'viewportOffset':{'top':0x96,'left':0x0,'bottom':0x32,'right':0x0},'ancestorOffset':0x14,'alignToTop':_0x178aee};_0x178aee&&(_0x59d65b['alignToTop']=!0x0),mt(_0x59d65b);}['_updateConversationTitle'](_0x386e27,_0x5a11ae=!0x1){this['_aiChatUi']['setConversationTitle'](_0x386e27||as(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION'),_0x5a11ae);}['_addFeedItemReply'](_0x3c8046){'text'===_0x3c8046['type']?this['_aiChatUi']['addFeedItemAIReply'](_0x3c8046):this['_aiChatUi']['addFeedItemAISuggestion'](_0x3c8046);}async['_updateReplyContent']({reply:_0x33a71a,renderingStrategy:_0x1198d4}){const {id:_0x2b96a7,interactionId:_0x39ca25,isDone:_0x5d8b01,type:_0x133305,parsedContent:_0x2d0593}=_0x33a71a,_0x34fd1e=_0x39ca25+':'+_0x2b96a7;if('modification'===_0x133305){const _0x1a3632=_0x33a71a['getContentParts']({'showDiff':this['_aiChatUi']['showDiff']});await this['_aiChatUi']['updateFeedItemAIReplySuggestionContent']({'id':_0x34fd1e,'parts':_0x1a3632,'renderingStrategy':_0x1198d4,'isDone':_0x5d8b01});}else'text'===_0x133305&&await this['_aiChatUi']['updateFeedItemAIReplyContent']({'id':_0x34fd1e,'parsedContent':_0x2d0593,'renderingStrategy':_0x1198d4,'isDone':_0x5d8b01});_0x5d8b01&&_0x33a71a['sources']['length']>0x0&&this['_aiChatUi']['updateFeedItemAIReplySources'](_0x34fd1e,_0x33a71a['sources']);}async['_stopLastInteraction'](){const _0x123bda=this['activeConversation']?.['lastInteraction'];_0x123bda&&(_0x123bda['stop'](),this['_aiChatUi']['stopInteraction'](_0x123bda));}async['_flushLastInteractionUI'](){const _0x3d4b80=this['activeConversation']?.['lastInteraction'];if(_0x3d4b80){for await(const _0x549f20 of _0x3d4b80['replies'])this['_aiChatUi']['hasFeedItem'](_0x549f20['id'])||this['_addFeedItemReply'](_0x549f20),await this['_updateReplyContent']({'reply':_0x549f20,'renderingStrategy':'static'});}}['_updateRatings'](_0x16b614){const _0xd29803={'positiveCount':_0x16b614['changeGroups']['filter'](_0x189a93=>'accepted'===_0x189a93['state'])['length'],'totalCount':_0x16b614['changeGroups']['length'],'modificationId':_0x16b614['id']},_0x17af82=this['activeConversation']['getInteraction'](_0x16b614['interactionId'])['messageId'];_0x17af82&&this['_aiConnector']['upsertAIChatRating'](this['activeConversation']['id'],_0x17af82,_0xd29803);}['_getAIChatFeedAPI'](_0x1dda5e){const _0x2dfaa6=this['_aiChatUi'],_0x20c8cc=()=>{_0x1dda5e['resetWebSearchState'](),_0x1dda5e['resetReasoningState'](),_0x2dfaa6['clearLoadingMessage']();},_0x11d6f3=()=>{_0x1dda5e['currentReply']&&(_0x1dda5e['currentReply']['done'](),_0x1dda5e['currentReply']=void 0x0);};return{'insertTextReply':(_0x1f031b,_0x52321f)=>{_0x11d6f3(),_0x20c8cc();const _0x2de904=_0x1dda5e['currentReply']=_0x1dda5e['createReply']({'type':'text','interactionId':_0x1dda5e['id'],'content':_0x1f031b,'id':_0x52321f||at()});return _0x11d6f3(),_0x2de904;},'insertCustomElement':async(_0x3f82bf,_0x30453e)=>(_0x11d6f3(),_0x20c8cc(),_0x2dfaa6['addFeedItemCustomElement'](_0x3f82bf,_0x30453e||at())),'setLoadingMessage':_0x5c9616=>{_0x2dfaa6['setLoadingMessage'](_0x5c9616);},'clearLoadingMessage':()=>{_0x2dfaa6['clearLoadingMessage']();}};}}const $s='ai-selection';class qs extends _0x314798{constructor(_0x154a93){super(_0x154a93),this['context']['config']['define']('ai.models.showModelSelector',!0x0);}['_outputDataProcessor'];['_fakeSelections']=[];['_sessionId'];static get['pluginName'](){return'AIEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}get['sessionId'](){if(!this['_sessionId']){const _0x3f4a6a=Fs(this['context']),_0xf0b88e=_0x3f4a6a['plugins']['has']('RealTimeCollaborationClient')&&_0x3f4a6a['plugins']['get']('RealTimeCollaborationClient')['sessionId'];this['_sessionId']=_0xf0b88e||at();}return this['_sessionId'];}async['getDocumentData'](){const _0x2e7784=Fs(this['context']),_0x553be7=_0x2e7784['model'],_0x444ef1=_0x2e7784['data']['toView'](_0x553be7['document']['getRoot'](),{'convertAiChatSelectionMarker':!0x0}),_0xff175f=new _0x1fddc9(_0x2e7784['editing']['view']['document']);this['_setDataIdsOnChildren'](_0x444ef1,_0xff175f);let _0x55e59a=await this['_getDocumentDataStringFromView'](_0x444ef1);const _0x559383=this['_getMarkersInDocumentOrder'](),_0x232497=[];for(const _0x45fce5 of _0x559383){const _0x24097e='<'+_0x45fce5['name']+':start></'+_0x45fce5['name']+':start>',_0x3bd8d6=_0x55e59a['indexOf'](_0x24097e);_0x55e59a=_0x55e59a['substring'](0x0,_0x3bd8d6)+_0x55e59a['substring'](_0x3bd8d6+_0x24097e['length']);const _0x1e2187='<'+_0x45fce5['name']+':end></'+_0x45fce5['name']+':end>',_0xa46835=_0x55e59a['indexOf'](_0x1e2187);_0x55e59a=_0x55e59a['substring'](0x0,_0xa46835)+_0x55e59a['substring'](_0xa46835+_0x1e2187['length']),_0x232497['push']({'markerName':_0x45fce5['name'],'start':_0x3bd8d6,'end':_0xa46835,'htmlFragment':_0x55e59a['substring'](_0x3bd8d6,_0xa46835)});}return{'content':_0x55e59a,'version':_0x2e7784['model']['document']['version'],'sessionId':this['sessionId'],'selections':_0x232497};}async['afterInit'](){this['context']instanceof _0x596f47?this['_integrateEditor'](this['context']):this['listenTo'](this['context']['editors'],'add',(_0x48d83b,_0x103b8c)=>{_0x103b8c['on']('ready',()=>{this['_integrateEditor'](_0x103b8c);});});}['_setOutputDataProcessor'](_0x97f875){this['_outputDataProcessor']=_0x97f875;}async['_getDocumentDataStringFromView'](_0x155924){let _0x2ab3e3;const _0x49e69a=Fs(this['context']);if(this['_outputDataProcessor']){const _0x59d784=_0x49e69a['data']['processor']['domConverter']['viewToDom'](_0x155924),_0x16dee2=await this['_outputDataProcessor'](_0x59d784);_0x2ab3e3=_0x49e69a['data']['processor']['htmlWriter']['getHtml'](_0x16dee2);}else _0x2ab3e3=_0x49e69a['data']['processor']['toData'](_0x155924);return _0x2ab3e3;}['_integrateEditor'](_0xa1910d){_0xa1910d['conversion']['for']('editingDowncast')['markerToHighlight']({'model':$s,'view':({markerName:_0x5a00a0})=>({'classes':['ck-ai-assistant-ui_theme','ck-fake-ai-selection','ck-fake-ai-selection-'+_0x5a00a0['split'](':')[0x1]],'priority':0xc})}),_0xa1910d['conversion']['for']('dataDowncast')['markerToElement']({'model':$s,'view':(_0x418878,{writer:_0x44aaa3,options:_0x57d9b1})=>_0x57d9b1['convertAiChatSelectionMarker']?_0x44aaa3['createUIElement'](_0x418878['markerName']+':'+(_0x418878['isOpening']?'start':'end')):null});}['showFakeVisualSelection'](_0x4941dd){const _0x44e414=this['_fakeSelections'][0x0]||null;this['_addFakeSelection'](_0x4941dd);const _0x12556f=this['_fakeSelections'][0x0]||null;this['_refreshFakeSelection'](_0x44e414,_0x12556f);}['hideFakeVisualSelection'](_0x2c11fb){const _0xd2bc13=this['_fakeSelections'][0x0]||null;this['_removeFakeSelectionById'](_0x2c11fb);const _0x3b22b1=this['_fakeSelections'][0x0]||null;this['_refreshFakeSelection'](_0xd2bc13,_0x3b22b1);}async['modelToDataWithIds'](_0x14a4b6){const _0xe99c41=Fs(this['context']),_0x1986e9=_0xe99c41['data']['toView'](_0x14a4b6),_0x3da2f0=new _0x1fddc9(_0xe99c41['editing']['view']['document']);return this['_setDataIdsOnChildren'](_0x1986e9,_0x3da2f0),this['_getDocumentDataStringFromView'](_0x1986e9);}['_setDataIdsOnChildren'](_0x30b5ab,_0x46866e){let _0xff0369=!0x1;const _0x533e39=new Set();for(const _0x57ddb9 of _0x30b5ab['getChildren']()){if(!_0x57ddb9['is']('view:element'))continue;const _0x18b98b=_0x57ddb9['is']('view:containerElement'),_0x3e7b29=_0x57ddb9['is']('view:emptyElement'),_0x14f32c=this['_setDataIdsOnChildren'](_0x57ddb9,_0x46866e);if(_0x57ddb9['hasAttribute']('data-id')){_0xff0369=!0x0,_0x533e39['add'](_0x57ddb9['getAttribute']('data-id'));continue;}(_0x18b98b||_0x3e7b29||_0x14f32c)&&(_0x46866e['setAttribute']('data-id',this['_nextDataId'](_0x533e39),_0x57ddb9),_0xff0369=!0x0);}return _0xff0369;}['_nextDataId'](_0x52661b){let _0xc16ac5;do{_0xc16ac5='';for(let _0x5a04b3=0x0;_0x5a04b3<0x4;_0x5a04b3++)_0xc16ac5+=String['fromCharCode'](0x61+Math['floor'](0x1a*Math['random']()));}while(_0x52661b['has'](_0xc16ac5));return _0x52661b['add'](_0xc16ac5),_0xc16ac5;}['getSelectionText'](){const {model:_0x183890}=Fs(this['context']),_0x3ec0f2=_0x183890['document']['selection'],_0x30c455=[],_0x22e8dd=Array['from'](_0x3ec0f2['getRanges']());_0x22e8dd['sort']((_0x514a6c,_0x6a9572)=>_0x514a6c['start']['isBefore'](_0x6a9572['start'])?-0x1:0x1);for(const _0x4e9311 of _0x22e8dd)for(const _0x51d02e of _0x4e9311['getItems']())_0x51d02e['is']('$textProxy')?_0x30c455['push'](_0x51d02e['data']):_0x51d02e['is']('element')&&_0x30c455['length']>0x0&&'\x20'!==_0x30c455[_0x30c455['length']-0x1]&&_0x30c455['push']('\x20');return _0x30c455['length']?'\x22'+_0x30c455['join']('')['trim']()+'\x22':as(this['context']['locale'],'AI_CHAT_CONTEXT_DOCUMENT_SELECTION_LABEL');}['_removeFakeSelectionById'](_0x32e145){for(let _0x5a8df3=0x0;_0x5a8df3<this['_fakeSelections']['length'];_0x5a8df3++)if(this['_fakeSelections'][_0x5a8df3]['id']==_0x32e145)return void this['_fakeSelections']['splice'](_0x5a8df3,0x1);}['_addFakeSelection'](_0x13050a){this['_removeFakeSelectionById'](_0x13050a['id']),Ct(this['_fakeSelections'],_0x13050a);}['_refreshFakeSelection'](_0x385a6e,_0x5c34e3){if(_0x385a6e==_0x5c34e3)return;const _0x278f1b=Fs(this['context']),_0x4ac04a=_0x278f1b['model'];_0x4ac04a['change'](_0x532787=>{if(_0x385a6e){const _0x150d76=_0x278f1b['model']['markers']['getMarkersGroup']($s);for(const _0x1f8258 of _0x150d76)_0x532787['removeMarker'](_0x1f8258);}if(_0x5c34e3)for(let _0x47192b=0x0;_0x47192b<_0x5c34e3['ranges']['length'];_0x47192b++){let _0x5df2cf=_0x5c34e3['ranges'][_0x47192b];const _0x1bc95e=$s+':'+_0x5c34e3['id']+':'+_0x47192b;if(_0x5df2cf['start']['isAtEnd']){const _0x2ffcf9=_0x5df2cf['start']['getLastMatchingPosition'](({item:_0x68e67f})=>!_0x4ac04a['schema']['isContent'](_0x68e67f),{'boundaries':_0x5df2cf});_0x5df2cf=_0x532787['createRange'](_0x2ffcf9,_0x5df2cf['end']);}_0x532787['addMarker'](_0x1bc95e,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x5df2cf});}});}['_getMarkersInDocumentOrder'](){const _0x33606c=Fs(this['context'])['model'];return Array['from'](_0x33606c['markers']['getMarkersGroup']($s))['sort']((_0x517f35,_0x1d9cea)=>_0x517f35['getStart']()['isBefore'](_0x1d9cea['getStart']())?-0x1:_0x517f35['getStart']()['isAfter'](_0x1d9cea['getStart']())?0x1:0x0);}}const Qs=['showChangeInText','insertSuggestion','applySuggestion','rejectSuggestion','mouseOverSuggestion','mouseLeaveSuggestion','toggleSuggestionDisplayMode','like','dislike'],Xs=[...Qs,'startConversation','resizeTabs','sendUserMessage','abortPromptStream','addDocumentToContext','addFileToContext','addUrlToContext','executeCustomItemCallback','addResourceToContext','removeContextItem','loadSourceResources','toggleWebSearch','toggleReasoning','selectModel'];class zs{['options'];['isStreaming']=!0x1;['document']=null;['nodesList']=[];['currentIndex']=0x0;['timeoutAbortController']=null;['lastUpdateTime']=0x0;constructor(_0x5e9504){this['options']={'delay':_0x5e9504['delay']??0x14,'textNodeStyle':_0x5e9504['textNodeStyle'],'onStreamUpdate':_0x5e9504['onStreamUpdate']||(()=>{})};}async['stream']({document:_0x242fae,targetElement:_0x7bb9a6,abortSignal:_0x3711ee}){this['isStreaming']&&this['stop'](),_0x3711ee?.['addEventListener']('abort',this['stop']['bind'](this)),this['document']=_0x556121(_0x242fae,!0x0),this['nodesList']=this['getParsedDocumentNodeList'](),this['isStreaming']=!0x0,this['currentIndex']>this['nodesList']['length']&&(this['currentIndex']=this['nodesList']['length']);for(let _0x518a6e=0x0;_0x518a6e<this['currentIndex'];_0x518a6e++)this['nodesList'][_0x518a6e]['shouldBeStreamed']=!0x0;do{const _0x3fc8ce=Date['now'](),_0x2fe645=this['nodesList'][this['currentIndex']],_0x3de9ea=_0x3fc8ce-this['lastUpdateTime'];if(_0x2fe645){_0x2fe645['shouldBeStreamed']=!0x0;let _0x47f3d9=_0x2fe645['parent'];for(;_0x47f3d9;)_0x47f3d9['shouldBeStreamed']=!0x0,_0x47f3d9=_0x47f3d9['parent'];}if(_0x3de9ea<this['options']['delay'])try{const {promise:_0x4b2f14,abortController:_0x1f8592}=tn(this['options']['delay']-_0x3de9ea);this['timeoutAbortController']=_0x1f8592,await _0x4b2f14;}catch(_0x1c633a){return;}_0x1748b6(_0x7bb9a6,'<'+_0x7bb9a6['tagName']+'>'+this['renderNode'](this['document'])+'</'+_0x7bb9a6['tagName']+'>',{'childrenOnly':!0x0}),this['options']['onStreamUpdate']&&this['options']['onStreamUpdate'](),this['currentIndex']++,this['lastUpdateTime']=Date['now']();}while(this['currentIndex']<this['nodesList']['length']);this['currentIndex']=this['nodesList']['length'],this['isStreaming']=!0x1;}['reset'](){this['isStreaming']=!0x1,this['document']=null,this['nodesList']=[],this['currentIndex']=0x0,this['timeoutAbortController']=null;}['cleanUpAnimations']({targetElement:_0x286a71}){Array['from'](_0x286a71['querySelectorAll']('span[data-ck-html-streamer-word-chunk]'))['reverse']()['forEach'](_0x5bc4e7=>{_0x5bc4e7['replaceWith'](_0x5bc4e7['childNodes'][0x0]);});}['stop'](){this['isStreaming']=!0x1,this['timeoutAbortController']&&(this['timeoutAbortController']['abort'](),this['timeoutAbortController']=null);}['renderNode'](_0x1310b3){let _0x4e4512='';if(function(_0x1a76d4){return _0x5255ae(_0x1a76d4);}(_0x1310b3)){for(const _0x304455 of _0x1310b3['children'])_0x4e4512+=this['renderNode'](_0x304455);}else{if(Zs(_0x1310b3)){if(!_0x1310b3['shouldBeStreamed'])return'';const _0x20bfcd=_0x1310b3,_0x825509=Object['entries'](_0x20bfcd['attribs'])['map'](([_0x421bb4,_0x50c0a2])=>_0x421bb4+'=\x22'+_0x50c0a2+'\x22')['join']('\x20');_0x4e4512+='<'+_0x20bfcd['tagName']+(_0x825509?'\x20'+_0x825509:'')+'>';for(const _0xdc84d4 of _0x56e17a(_0x20bfcd))_0x4e4512+=this['renderNode'](_0xdc84d4);_0x4e4512+='</'+_0x20bfcd['tagName']+'>';}else{if(!Js(_0x1310b3))return'';if(!_0x1310b3['shouldBeStreamed'])return'';!function(_0x942dd4){if(!_0x942dd4['parent']||!Zs(_0x942dd4['parent']))return!0x1;if(!js['includes'](_0x942dd4['parent']['tagName']))return!0x1;return!_0x30c743(_0x942dd4)['match'](/^\s*[<>]\s*$/);}(_0x1310b3)?_0x4e4512+=_0x1f30d8(_0x1310b3):_0x4e4512+=_0x1f30d8(new ti('span',{'data-ck-html-streamer-word-chunk':'','style':this['options']['textNodeStyle']},[_0x1310b3]));}}return _0x4e4512;}['getParsedDocumentNodeList'](){const _0x57e5c2=[];return function(_0x7d309e,_0x36ebf6){const _0x528bbb=_0x19cdb3=>{if(_0x36ebf6(_0x19cdb3),_0x19cdb3 instanceof _0x5c9887)for(let _0xf2a32f=0x0;_0xf2a32f<_0x19cdb3['children']['length'];_0xf2a32f++){const _0x3d4663=_0x19cdb3['children'][_0xf2a32f];_0x528bbb(_0x3d4663);}};for(let _0x1740ff=0x0;_0x1740ff<_0x7d309e['children']['length'];_0x1740ff++)_0x528bbb(_0x7d309e['children'][_0x1740ff]);}(this['document'],_0x2ee601=>{if(Js(_0x2ee601)){const _0xf36a00=this['splitTextNodeIntoWordNodes'](_0x2ee601);_0xf36a00['length']&&_0x57e5c2['push'](..._0xf36a00);}_0x2ee601['isWordSplitSource']||_0x2ee601['isWordSplitResult']||_0x57e5c2['push'](_0x2ee601);}),_0x57e5c2;}['splitTextNodeIntoWordNodes'](_0xc7ac3c){if(_0xc7ac3c['isWordSplitSource']||_0xc7ac3c['isWordSplitResult'])return[];const _0x2a9d39=_0x30c743(_0xc7ac3c)['match'](/(?:\s*\S+\s*)/g),_0x4513f4=[];if(_0x2a9d39&&_0x2a9d39['length']>0x1){for(const _0x7dcbde of _0x2a9d39){const _0x517e97=new _0x45ed29(_0x7dcbde);_0x517e97['isWordSplitResult']=!0x0,_0x59927b(_0xc7ac3c,_0x517e97),_0x4513f4['push'](_0x517e97);}_0xc7ac3c['isWordSplitSource']=!0x0,_0x487133(_0xc7ac3c);}return _0x4513f4;}}const js=['p','li','td','th','span','h1','h2','h3','h4','h5','h6','b','strong','i','em','mark','del','ins','sup','sub','a','code','div'];function Js(_0x140666){return _0x1fc8a1(_0x140666);}function Zs(_0x130d39){return _0x373786(_0x130d39);}function tn(_0x4da95b){const _0x22c847=new AbortController();return{'promise':new Promise((_0x133681,_0x28c623)=>{const _0x38db78=setTimeout(_0x133681,_0x4da95b);_0x22c847['signal']['addEventListener']('abort',()=>{clearTimeout(_0x38db78),_0x28c623();});}),'abortController':_0x22c847};}class en extends Nt{['options'];['content']='';['htmlStreamer'];['children'];constructor(_0x4cd881){super();const _0x3d7f75=this['bindTemplate'];this['set']('isDone',!0x1),this['set']('isVisible',!0x0),this['htmlStreamer']=new zs({'textNodeStyle':'animation:\x20ck-html-streamer-fade-in\x20.5s','delay':0x14}),this['options']=_0x4cd881,this['children']=this['createCollection'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__item',_0x3d7f75['if']('isDone','ck-ai-chat__feed__item_done'),_0x3d7f75['if']('isVisible','ck-hidden',_0x1f37b0=>!_0x1f37b0),'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'](_0x4557b3=>{_0x4557b3['removeAttribute']('data-id');}),this['isDone']=!0x0;}async['streamIntoElement'](_0xd8937a,_0x344e1a,_0x279423){await this['htmlStreamer']['stream']({'document':_0xd8937a,'targetElement':_0x344e1a,'abortSignal':_0x279423});}}class sn extends Nt{['showChangesToggleView'];constructor(_0x117643,_0x19fafb){super(_0x117643),this['set']('isShowChangesToggleVisible',!0x0),this['showChangesToggleView']=new nn(_0x117643),this['showChangesToggleView']['set']({'class':'ck-ai-suggestion__header__show-changes-toggle\x20ck-ai-chat-controls-button\x20'+cs,'label':as(_0x117643,'AI_SUGGESTION_BUTTON_SHOW_CHANGES'),'withText':!0x0}),this['showChangesToggleView']['isOn']=_0x19fafb['showDiff'],this['showChangesToggleView']['bind']('isVisible')['to'](this,'isShowChangesToggleVisible'),this['showChangesToggleView']['bind']('icon')['to'](this['showChangesToggleView'],'isOn',_0x3726aa=>_0x3726aa?_0x253243:_0x3f4cae),this['showChangesToggleView']['on']('execute',()=>{this['showChangesToggleView']['isOn']=!this['showChangesToggleView']['isOn'],this['fire']('toggleShowChanges',{'isOn':this['showChangesToggleView']['isOn']});});const _0x2cfb4b=new yt();_0x2cfb4b['content']=_0x5a4ac5,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__header',!0x1===_0x19fafb['showHeader']?'ck-hidden':null]['filter'](Boolean)},'children':[_0x2cfb4b,{'tag':'span','children':[as(_0x117643,'AI_SUGGESTION_HEADER_TITLE')]},this['showChangesToggleView']]});}}class nn extends kt{['render'](){super['render'](),this['children']['remove'](this['iconView']),this['children']['add'](this['iconView']);}}const rn={'accepted':_0xe59c0a,'rejected':_0x64c712,'outdated':_0x64c712};class an extends Nt{['stateIconView'];constructor(_0xab24d){super(_0xab24d);const _0x416834=this['bindTemplate'];this['set']('state','accepted'),this['set']('isVisible',!0x0),this['stateIconView']=new on(),this['stateIconView']['bind']('state')['to'](this),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__content-part-state',_0x416834['to']('state',_0x4be259=>'ck-ai-suggestion__content-part-state_'+_0x4be259),_0x416834['if']('isVisible','ck-hidden',_0x23506b=>!_0x23506b)]},'children':[{'tag':'span','attributes':{'class':['ck-ai-suggestion__content-part-state__label']},'children':[{'text':_0x416834['to']('state',_0x152994=>{switch(_0x152994){case'accepted':return as(_0xab24d,'AI_SUGGESTION_CONTENT_PART_STATE_ACCEPTED');case'rejected':return as(_0xab24d,'AI_SUGGESTION_CONTENT_PART_STATE_REJECTED');case'outdated':return as(_0xab24d,'AI_SUGGESTION_CONTENT_PART_STATE_OUTDATED');}})}]},this['stateIconView']]});}['setState'](_0x148feb){this['state']=_0x148feb;}}class on extends yt{constructor(){super(),this['set']('state','accepted'),this['content']=rn[this['state']],this['on']('change:state',()=>{this['content']=rn[this['state']];});}}class hn extends Ot{['_applyButton'];['_suggestButton'];constructor(_0x3be314,_0x124102,_0x438603){super(_0x3be314);const _0x38190f=Boolean(_0x438603);this['set']('isEnabled',!_0x38190f),this['set']('isVisible',!0x0),this['class']='ck-ai-suggestion-content-part-toolbar';const _0x388caa=[];if(_0x38190f){const _0x33e009=new kt(_0x3be314);_0x33e009['set']({'label':as(_0x3be314,'AI_SUGGESTION_DISABLED_TOOLTIP_MESSAGE'),'tooltip':!0x0,'withText':!0x1,'icon':_0x4de7b1}),_0x33e009['extendTemplate']({'attributes':{'data-cke-tooltip-class':'ck-ai-suggestion-content-part-disabled-actions-tooltip'}}),_0x388caa['push'](_0x33e009);}else{_0x124102['includes']('applySuggestion')&&(this['_applyButton']=new kt(_0x3be314),this['_applyButton']['set']({'label':as(_0x3be314,'AI_SUGGESTION_CONTENT_PART_APPLY'),'tooltip':!0x0,'tooltipPosition':'n','withText':!0x1,'icon':_0xe59c0a}),this['_applyButton']['bind']('isEnabled')['to'](this),this['_applyButton']['on']('execute',()=>{this['fire']('applySuggestion');}),_0x388caa['push'](this['_applyButton'])),_0x124102['includes']('insertSuggestion')&&(this['_suggestButton']=new kt(_0x3be314),this['_suggestButton']['set']({'label':as(_0x3be314,'AI_SUGGESTION_CONTENT_PART_ADD_SUGGESTION'),'tooltip':!0x0,'tooltipPosition':'n','withText':!0x1,'icon':_0x814cf2}),this['_suggestButton']['bind']('isEnabled')['to'](this),this['_suggestButton']['on']('execute',()=>{this['fire']('insertSuggestion');}),_0x388caa['push'](this['_suggestButton']));const _0x37da45=new kt(_0x3be314);_0x37da45['set']({'label':as(_0x3be314,'AI_SUGGESTION_CONTENT_PART_REJECT'),'tooltip':!0x0,'tooltipPosition':'n','withText':!0x1,'icon':_0x64c712}),_0x37da45['bind']('isEnabled')['to'](this),_0x37da45['on']('execute',()=>{this['fire']('rejectSuggestion');}),_0x388caa['push'](_0x37da45);}this['items']['addMany'](_0x388caa);const _0x1fae48=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':[_0x1fae48['if']('isVisible','ck-hidden',_0x5ed9e3=>!_0x5ed9e3)]}});}['setButtonsVisibility']({showApplyButton:_0x27a216,showSuggestButton:_0x1a6b88}){this['_applyButton']&&(this['_applyButton']['isVisible']=_0x27a216),this['_suggestButton']&&(this['_suggestButton']['isVisible']=_0x1a6b88);}}class cn extends Nt{['toolbarView'];['stateView'];['titleLabelView'];['children'];constructor(_0x2bc633,{part:_0x34c91d,uiIndex:_0x376783,availableActions:_0x424c3a,areActionsDisabled:_0x55efee}){super(_0x2bc633),this['set']('isEnabled',!0x0),this['set']('state','pending'),this['toolbarView']=new hn(_0x2bc633,_0x424c3a,_0x55efee),this['toolbarView']['on']('rejectSuggestion',()=>{this['fire']('rejectSuggestion',{'index':_0x34c91d['index']});}),this['toolbarView']['on']('insertSuggestion',()=>{this['fire']('insertSuggestion',{'index':_0x34c91d['index']});}),this['toolbarView']['on']('applySuggestion',()=>{this['fire']('applySuggestion',{'index':_0x34c91d['index']});}),this['toolbarView']['bind']('isEnabled')['to'](this),this['stateView']=new an(_0x2bc633),this['titleLabelView']=new ln(_0x2bc633,_0x376783),this['children']=this['createCollection'](),this['children']['addMany']([this['titleLabelView'],this['toolbarView']]),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all-excluded','ck-ai-suggestion__body__content-part__title']},'children':this['children']}),this['on']('change:state',(_0x4d3bd8,_0x551cfc,_0x241466,_0x226335)=>{'pending'===_0x226335?this['children']['remove'](this['toolbarView']):this['children']['remove'](this['stateView']),'pending'===_0x241466?this['children']['add'](this['toolbarView']):(this['stateView']['setState'](_0x241466),this['children']['add'](this['stateView']));});}}class ln extends Nt{constructor(_0x5b406e,_0x36f3c4){super(_0x5b406e),this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-suggestion__body__content-part__title__label']},'children':[as(_0x5b406e,'AI_SUGGESTION_CONTENT_PART_TITLE',_0x36f3c4['toString']())]});}}class un extends Nt{['htmlStreamer'];constructor(_0x2f51a7){super(_0x2f51a7),this['htmlStreamer']=new zs({'textNodeStyle':'animation:\x20ck-html-streamer-fade-in\x20.5s','delay':0x14}),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content','ck-reset_all-excluded','ck-ai-suggestion-streamable-content']}});}async['update']({part:_0x516c67,renderingStrategy:_0x241b62,abortSignal:_0x4413d3}){'streaming'===_0x241b62?await this['htmlStreamer']['stream']({'document':_0x516c67['content'],'targetElement':this['element'],'abortSignal':_0x4413d3}):this['element']['innerHTML']=ds(_0x516c67['content']);}['clear'](){this['htmlStreamer']['reset'](),this['element']['innerHTML']='';}}class dn extends Nt{['_children'];['_headerView'];['_streamableContentView'];constructor(_0x484b26,{part:_0x5f43c4,uiIndex:_0x410400,areActionsDisabled:_0x118fe2,availableActions:_0x3285ff}){super(_0x484b26);const _0x2f9337=this['bindTemplate'];this['set']('state','pending'),this['set']('isDone',!0x1),this['set']('isVisible',!0x1),this['set']('isActive',!0x1),this['set']('isEnabled',!0x1);const _0x4636f1=()=>{this['isEnabled']=this['isDone']&&'pending'==this['state']&&!_0x118fe2;};this['on']('change:state',_0x4636f1),this['on']('change:isDone',_0x4636f1),_0x4636f1(),this['_children']=this['createCollection'](),this['_headerView']=new cn(_0x484b26,{'part':_0x5f43c4,'uiIndex':_0x410400,'availableActions':_0x3285ff,'areActionsDisabled':_0x118fe2}),this['_headerView']['bind']('isEnabled','state')['to'](this),this['_headerView']['delegate'](...Qs)['to'](this),this['_streamableContentView']=new un(_0x484b26),this['_children']['addMany']([this['_headerView'],this['_streamableContentView']]),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__body__content-part',_0x2f9337['to']('state',_0x229e8c=>'ck-ai-suggestion__body__content-part_'+_0x229e8c),_0x2f9337['if']('isEnabled','ck-ai-suggestion__body__content-part_enabled'),_0x2f9337['if']('isActive','ck-ai-suggestion__body__content-part_active'),_0x2f9337['if']('isVisible','ck-hidden',_0x1708ce=>!_0x1708ce)]},'children':this['_children'],'on':{'mouseenter':_0x2f9337['to'](()=>{this['isEnabled']&&this['fire']('mouseOverSuggestion',{'index':_0x5f43c4['index']});}),'mouseleave':_0x2f9337['to'](()=>{this['isEnabled']&&this['fire']('mouseLeaveSuggestion',{'index':_0x5f43c4['index']});}),'click':_0x2f9337['to'](_0x6954c6=>{const _0xea8bfd=_0x6954c6['target'];this['isEnabled']&&!this['_headerView']['toolbarView']['element']['contains'](_0xea8bfd)&&this['fire']('showChangeInText',{'index':_0x5f43c4['index']});})}});}async['updateContent']({part:_0x1de2e0,renderingStrategy:_0x1325ff,showUnchangedParts:_0x3533e5=!0x1,abortSignal:_0x465af2}){this['partDefinition']=_0x1de2e0,this['isVisible']=this['partDefinition']['hasChanges']||_0x3533e5,this['isVisible']&&await this['_streamableContentView']['update']({'part':_0x1de2e0,'renderingStrategy':_0x1325ff,'abortSignal':_0x465af2});}['markAsDone'](){this['isDone']=!0x0;}}class _n extends pt(){['queue']=[];['isProcessing']=!0x1;['_abortController'];async['enqueue'](_0x52060a){const _0x41b2e1=this['createTask'](_0x52060a);return this['queue']['push'](_0x41b2e1),this['_processQueue'](),_0x41b2e1['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(_0x56dd15=>{this['once']('_queueEmpty',()=>{_0x56dd15();});}):Promise['resolve']();}async['_processQueue'](){if(!this['isProcessing']){this['_abortController']=new AbortController(),this['isProcessing']=!0x0;try{for(;this['queue']['length']&&this['isProcessing'];){const _0x59d26b=this['queue']['shift']();try{await _0x59d26b['callback'](this['_abortController']['signal']),_0x59d26b['resolve']();}catch(_0x508ac2){_0x59d26b['reject'](_0x508ac2);}}}finally{this['isProcessing']=!0x1,this['_abortController']=void 0x0;}this['fire']('_queueEmpty');}}['createTask'](_0x567eb3){let _0x42f5ad,_0x52feb6;const _0x124dff=new Promise((_0x5aa12e,_0xd245e)=>{_0x42f5ad=_0x5aa12e,_0x52feb6=_0xd245e;});return{'callback':_0x567eb3,'resolve':_0x42f5ad,'reject':_0x52feb6,'completePromise':_0x124dff};}}class An extends en{constructor(_0x484e4c){super(_0x484e4c),this['extendTemplate']({'attributes':{'class':['ck-ai-notification','warning'===_0x484e4c['level']?'ck-ai-notification_warning':'ck-ai-notification_error']}});}['render'](){super['render'](),this['setContent'](this['options']['initialContent']),this['markAsDone']();}['setContent'](_0x4efc8a){this['element']['innerHTML']=_0x4efc8a;}}const gn=['applySuggestion','insertSuggestion'];class In extends Nt{['_applyChangesButton'];['_insertSuggestionsButton'];['children'];constructor(_0x4b8b68,_0x46095d=[...gn],_0x371e38){super(_0x4b8b68);const _0x4b2207=this['bindTemplate'],_0x403ac6=Boolean(_0x371e38);if(this['set']('isEnabled',!_0x403ac6),this['set']('isVisible',!0x1),this['set']('isTrackChangesOn',!0x1),this['children']=this['createCollection'](),_0x403ac6){const _0x5eebc9=new kt(_0x4b8b68);_0x5eebc9['set']({'label':as(_0x4b8b68,'AI_SUGGESTION_DISABLED_TOOLTIP_MESSAGE'),'tooltip':!0x0,'withText':!0x1,'icon':_0x4de7b1}),_0x5eebc9['extendTemplate']({'attributes':{'data-cke-tooltip-class':'ck-ai-suggestion-content-part-disabled-actions-tooltip'}});const _0x2fa6e1=new Nt(_0x4b8b68);_0x2fa6e1['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-chat__feed__suggestion__actions__info'},'children':[{'tag':'p','children':[as(_0x4b8b68,'AI_SUGGESTION_DISABLED_FEED_MESSAGE'),_0x5eebc9]}]}),this['children']['add'](_0x2fa6e1);}else this['_applyChangesButton']=new kt(_0x4b8b68),this['_applyChangesButton']['set']({'label':as(_0x4b8b68,'AI_CHAT_SUGGESTION_ACTION_APPLY_ALL'),'withText':!0x0,'type':'button','isVisible':_0x46095d['includes']('applySuggestion'),'class':os}),this['_insertSuggestionsButton']=new kt(_0x4b8b68),this['_insertSuggestionsButton']['set']({'label':as(_0x4b8b68,'AI_CHAT_SUGGESTION_ACTION_SUGGEST_ALL'),'withText':!0x0,'type':'button','isVisible':_0x46095d['includes']('insertSuggestion'),'class':hs}),this['_insertSuggestionsButton']['on']('execute',()=>{this['fire']('insertSuggestion');}),this['_applyChangesButton']['on']('execute',()=>{this['fire']('applySuggestion');}),[this['_applyChangesButton'],this['_insertSuggestionsButton']]['forEach'](_0x69cbf2=>{_0x69cbf2['bind']('isEnabled')['to'](this);}),this['children']['addMany']([this['_applyChangesButton'],this['_insertSuggestionsButton']]);this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__ai-suggestion__actions',_0x4b2207['if']('isVisible','ck-hidden',_0x23c5ed=>!_0x23c5ed)]},'children':this['children']}),this['on']('change:isTrackChangesOn',()=>{this['_applyChangesButton']&&(this['_applyChangesButton']['isVisible']=!this['isTrackChangesOn']);});}['updateVisibility'](_0x1a978a){this['isVisible']=_0x1a978a;}['_switchButtonLabelsPlurality'](_0x9656c0){this['_applyChangesButton']&&this['_insertSuggestionsButton']&&(_0x9656c0?(this['_applyChangesButton']['label']=as(this['locale'],'AI_CHAT_SUGGESTION_ACTION_APPLY_ALL'),this['_insertSuggestionsButton']['label']=as(this['locale'],'AI_CHAT_SUGGESTION_ACTION_SUGGEST_ALL')):(this['_applyChangesButton']['label']=as(this['locale'],'AI_CHAT_SUGGESTION_ACTION_APPLY'),this['_insertSuggestionsButton']['label']=as(this['locale'],'AI_CHAT_SUGGESTION_ACTION_SUGGEST')));}}class En extends Nt{['children'];['balloonPanelView'];['bodyCollection'];constructor(_0x595598,_0xb9c258){super(_0x595598),this['bodyCollection']=_0xb9c258,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',_0x2207cf=>!_0x2207cf)]},'children':this['children']});const _0x26af85=new Nt(this['locale']),_0x528c71=new yt();_0x528c71['content']=_0x1a441e,_0x26af85['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-web-sources__header']},'children':[_0x528c71,{'tag':'span','children':[{'text':as(this['locale'],'AI_CHAT_SOURCES_HEADER')}]}]}),this['children']['add'](_0x26af85),this['_setupBalloonPanel'](_0x595598);}['addSource'](_0x1c5e4c){this['children']['add'](new Tn(this['locale'],_0x1c5e4c,this['balloonPanelView']));}['_setupBalloonPanel'](_0x4b8d30){this['balloonPanelView']=new Qt(_0x4b8d30),this['balloonPanelView']['extendTemplate']({'attributes':{'class':['ck-ai-web-source__tooltip-balloon']}}),this['bodyCollection']['add'](this['balloonPanelView']);}}class Tn extends kt{['balloonPanelView'];['source'];constructor(_0xd46111,_0x59f0b4,_0x1b13b7){super(_0xd46111),this['source']=_0x59f0b4,this['balloonPanelView']=_0x1b13b7,this['set']({'label':_0x59f0b4['title'],'class':['ck\x20ck-ai-web-source'],'withText':!0x0});const _0x4af399=this['bindTemplate'];if(this['extendTemplate']({'on':{'click':_0x4af399['to'](()=>{window['open'](_0x59f0b4['url'],'_blank');}),'mouseenter':_0x4af399['to'](()=>{this['_showTooltip']();}),'mouseleave':_0x4af399['to'](()=>{this['_hideTooltip']();})}}),_0x59f0b4['favicon']){const _0x289211=new Nt(_0xd46111);_0x289211['setTemplate']({'tag':'img','attributes':{'src':_0x59f0b4['favicon']||_0x1a441e,'alt':_0x59f0b4['title'],'class':['ck-ai-web-source__image']}}),this['children']['add'](_0x289211);}else this['set']('icon',_0x1a441e);}['_createTooltipContentView'](_0x3fa63e,_0x1049df){const _0x4ad267=new Nt(_0x3fa63e),_0x525a42=[];let _0x1482b0;_0x1049df?.['favicon']?(_0x1482b0=new Nt(_0x3fa63e),_0x1482b0['setTemplate']({'tag':'img','attributes':{'src':_0x1049df['favicon'],'alt':_0x1049df['title'],'class':['ck-ai-web-source__tooltip-image']}})):(_0x1482b0=new yt(),_0x1482b0['content']=_0x1a441e,_0x1482b0['extendTemplate']({'attributes':{'alt':_0x1049df['title'],'class':['ck-ai-web-source__tooltip-image']}})),_0x525a42['push'](_0x1482b0);const _0x43448b=new Nt(_0x3fa63e);_0x43448b['setTemplate']({'tag':'a','attributes':{'class':['ck-ai-web-source__tooltip-url'],'href':_0x1049df['url']},'children':[{'text':new URL(_0x1049df['url'])?.['hostname']}]}),_0x525a42['push'](_0x43448b);const _0x2fed75=new Nt(_0x3fa63e);_0x2fed75['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-web-source__tooltip-row']},'children':_0x525a42});const _0x5eebad=new Nt(_0x3fa63e);return _0x5eebad['setTemplate']({'tag':'span','attributes':{'class':['ck-ai-web-source__tooltip-row','ck-ai-web-source__tooltip-title']},'children':[{'text':_0x1049df['title']['length']>0x190?_0x1049df['title']['substring'](0x0,0x190)+'...':_0x1049df['title']}]}),_0x4ad267['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-web-source__tooltip']},'children':[_0x2fed75,_0x5eebad]}),_0x4ad267;}['_showTooltip'](){this['_updateTooltipContent'](),this['balloonPanelView']['pin']({'target':this['element'],'positions':[Qt['defaultPositions']['northArrowSouth'],Qt['defaultPositions']['northArrowSouthWest'],Qt['defaultPositions']['northArrowSouthEast']],'limiter':document['querySelector']('.ck-ai-chat')}),this['balloonPanelView']['show']();}['_hideTooltip'](){this['balloonPanelView']['hide']();}['_updateTooltipContent'](){this['balloonPanelView']['content']['get'](0x0)?.['destroy'](),this['balloonPanelView']['content']['clear']();const _0x368047=this['_createTooltipContentView'](this['locale'],this['source']);this['balloonPanelView']['content']['add'](_0x368047);}}class pn extends Nt{['_actionsView'];['_sourcesView'];['_children'];['_areActionsDisabled'];['_showUnchangedParts'];['_updateContentPartsPromiseQueue'];['_emptyPartsWarningView'];['_availableActions'];['_cachedContentParts']=[];constructor(_0x3c9a94,_0x2ff203){super(_0x3c9a94);const {areActionsDisabled:_0x9a88d8,showUnchangedParts:_0x4ced50,availableActions:_0x2f4bd7}=_0x2ff203;this['_areActionsDisabled']=_0x9a88d8,this['_showUnchangedParts']=_0x4ced50,this['_availableActions']=_0x2f4bd7,this['set']('hasPendingParts',!0x1),this['set']('isTrackChangesOn',!0x1),this['_children']=this['createCollection'](),this['_updateContentPartsPromiseQueue']=new _n(),this['_emptyPartsWarningView']=new An({'id':'empty-parts-warning','initialContent':as(_0x3c9a94,'AI_SUGGESTION_EMPTY_PART_WARNING'),'level':'warning'}),this['_emptyPartsWarningView']['isVisible']=!0x1,this['_actionsView']=new In(_0x3c9a94,_0x2ff203['availableActions'],this['_areActionsDisabled']),this['_actionsView']['bind']('isTrackChangesOn')['to'](this),this['_sourcesView']=new En(this['locale'],_0x2ff203['bodyCollection']),_0x2ff203['areActionsDisabled']?this['_actionsView']['isEnabled']=!0x1:this['_actionsView']['bind']('isEnabled')['to'](this,'hasPendingParts'),this['_actionsView']['delegate'](...Qs)['to'](this),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__body']},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__body__content-parts']},'children':this['_children']},this['_emptyPartsWarningView'],this['_actionsView'],this['_sourcesView']]});}get['partsCount'](){return this['_children']['length'];}async['updateContentParts']({parts:_0x3ae797,renderingStrategy:_0x4a83a8,abortSignal:_0x8006a5}){this['_children']['length']?_0x3ae797['forEach'](_0x32c0ce=>{const _0x18e15e=this['_cachedContentParts']['findIndex'](_0x1a4c01=>_0x1a4c01['index']==_0x32c0ce['index']);-0x1===_0x18e15e?this['_cachedContentParts']['push'](_0x32c0ce):this['_cachedContentParts'][_0x18e15e]=_0x32c0ce;}):this['_cachedContentParts']=_0x3ae797;const _0x568518=this['_showUnchangedParts']?_0x3ae797:_0x3ae797['filter'](_0x9c68db=>_0x9c68db['hasChanges']);this['_actionsView']['_switchButtonLabelsPlurality'](_0x568518['length']>0x1);for(const _0x815d69 of _0x568518)this['_updateContentPartsPromiseQueue']['enqueue'](async _0x10689c=>{let _0x2e1f03=this['getPartView'](_0x815d69['index']);_0x2e1f03||(_0x2e1f03=new dn(this['locale'],{'part':_0x815d69,'uiIndex':this['_children']['length']+0x1,'areActionsDisabled':this['_areActionsDisabled'],'availableActions':this['_availableActions']}),_0x2e1f03['delegate'](...Qs)['to'](this),this['_children']['add'](_0x2e1f03),this['hasPendingParts']=!0x0),await _0x2e1f03['updateContent']({'part':_0x815d69,'renderingStrategy':_0x4a83a8,'showUnchangedParts':this['_showUnchangedParts'],'abortSignal':_0x10689c}),_0x2e1f03['markAsDone']();});return _0x8006a5?.['addEventListener']('abort',()=>{this['_updateContentPartsPromiseQueue']['abort']();}),this['_updateContentPartsPromiseQueue']['queueEmptyPromise'];}['updatePartState'](_0x168393,_0x204724){const _0x5eebdd=this['getPartView'](_0x168393);_0x5eebdd&&(_0x5eebdd['state']=_0x204724),this['hasPendingParts']='pending'==_0x204724||Array['from'](this['_children'])['some'](_0x5a5489=>'pending'==_0x5a5489['state']);}['setPartActive'](_0x57481e,_0x3a36d0){if(!0x1===_0x57481e){for(const _0x1d10d5 of this['_children'])_0x1d10d5['isActive']=!0x1;}else{const _0x49ef99=this['getPartView'](_0x57481e);_0x49ef99&&(_0x49ef99['isActive']=_0x3a36d0);}}['updateSources'](_0x50dd44){_0x50dd44['forEach'](_0x1f5a57=>this['_sourcesView']['addSource'](_0x1f5a57)),this['_sourcesView']['isVisible']=!0x0;}['getPartView'](_0x5e9209){return this['_children']['find'](_0x504a2d=>_0x504a2d['partDefinition']['index']==_0x5e9209)??null;}['markAsDone'](){if(!this['_showUnchangedParts']){const _0x1accea=!this['_cachedContentParts']['find'](({hasChanges:_0x4cc082})=>_0x4cc082),_0x465b2a=!!this['_cachedContentParts']['find'](({hasChanges:_0x40bd33})=>!_0x40bd33);this['_emptyPartsWarningView']['isVisible']=0x0==this['_children']['length']||_0x465b2a,_0x1accea?this['_emptyPartsWarningView']['setContent'](as(this['locale'],'AI_SUGGESTION_NO_PARTS_WARNING')):this['_emptyPartsWarningView']['setContent'](as(this['locale'],'AI_SUGGESTION_EMPTY_PART_WARNING'));}this['_children']['forEach'](_0x31e2c8=>_0x31e2c8['markAsDone']()),this['_actionsView']['updateVisibility'](this['hasNonEmptyParts']);}get['hasNonEmptyParts'](){return this['_children']['filter'](_0x131242=>_0x131242['partDefinition']['hasChanges'])['length']>0x0;}}class mn extends Nt{['bodyView'];['children'];['headerView'];constructor(_0x1ffb34,_0x4f629a,_0x25e8bb){super(_0x1ffb34);const {showDiff:_0x281b48,areActionsDisabled:_0x969936,showUnchangedParts:_0x387462,availableActions:_0x3bdca1}=_0x4f629a;this['set']('isTrackChangesOn',!0x1),this['set']('areChangesVisible',!0x1),this['children']=this['createCollection'](),this['headerView']=new sn(_0x1ffb34,{'showDiff':_0x281b48}),this['headerView']['on']('toggleShowChanges',(_0x527740,_0x2d95ec)=>{this['areChangesVisible']=_0x2d95ec['isOn'],this['fire']('toggleSuggestionDisplayMode',{'showDiff':_0x2d95ec['isOn']});}),this['children']['add'](this['headerView']),this['bodyView']=new pn(_0x1ffb34,{'areActionsDisabled':_0x969936,'showUnchangedParts':!!_0x387462,'availableActions':_0x3bdca1,'bodyCollection':_0x25e8bb}),this['bodyView']['delegate'](...Qs)['to'](this),this['bodyView']['bind']('isTrackChangesOn')['to'](this),this['children']['add'](this['bodyView']),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__container','ck-rounded-corners']},'children':this['children']});}async['updateContent'](_0x39ead4){await this['bodyView']['updateContentParts'](_0x39ead4);}['updateSources'](_0x5eb2f9){this['bodyView']['updateSources'](_0x5eb2f9);}['markAsDone'](){this['bodyView']['markAsDone'](),this['headerView']&&(this['headerView']['isShowChangesToggleVisible']=this['bodyView']['hasNonEmptyParts']);}}class Cn extends en{['containerView'];constructor(_0x3285f7,_0x1e7775,_0x4200c7){super(_0x1e7775),this['set']('isTrackChangesOn',!0x1),this['containerView']=new mn(_0x3285f7,{'showDiff':_0x1e7775['showDiff'],'areActionsDisabled':_0x1e7775['areActionsDisabled'],'availableActions':_0x1e7775['availableActions']},_0x4200c7),this['containerView']['on']('toggleSuggestionDisplayMode',(_0x5928e7,_0x39d574)=>{this['fire']('toggleSuggestionDisplayMode',{'replyId':this['options']['id'],'showDiff':_0x39d574['showDiff']});}),this['containerView']['bind']('isTrackChangesOn')['to'](this),this['containerView']['on']('like',()=>{this['fire']('like',{'replyId':this['options']['id']});}),this['containerView']['on']('dislike',()=>{this['fire']('dislike',{'replyId':this['options']['id']});}),this['containerView']['on']('showChangeInText',(_0x304c82,{index:_0x3bfa9a})=>{this['fire']('showChangeInText',{'replyId':this['options']['id'],'partIndex':_0x3bfa9a});}),this['containerView']['on']('applySuggestion',(_0x384e98,{index:_0xa618b2}={})=>{this['fire']('applySuggestion',{'replyId':this['options']['id'],'partIndex':_0xa618b2});}),this['containerView']['on']('insertSuggestion',(_0x2d7dc4,{index:_0x28888b}={})=>{this['fire']('insertSuggestion',{'replyId':this['options']['id'],'partIndex':_0x28888b});}),this['containerView']['on']('rejectSuggestion',(_0x12f61a,{index:_0x219a94})=>{this['fire']('rejectSuggestion',{'replyId':this['options']['id'],'partIndex':_0x219a94});}),this['containerView']['on']('mouseOverSuggestion',(_0xf65c37,{index:_0x206e36})=>{this['fire']('mouseOverSuggestion',{'replyId':this['options']['id'],'partIndex':_0x206e36});}),this['containerView']['on']('mouseLeaveSuggestion',(_0x2134f5,{index:_0x4e81cd})=>{this['fire']('mouseLeaveSuggestion',{'replyId':this['options']['id'],'partIndex':_0x4e81cd});}),this['children']['addMany']([this['containerView']]),this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__ai-suggestion']}});}async['updateContent'](_0x3a5e3f){await this['containerView']['updateContent'](_0x3a5e3f);}['updatePartState'](_0x33f3ad,_0x58c827){this['containerView']['bodyView']['updatePartState'](_0x33f3ad,_0x58c827);}['setPartActive'](_0x3423a5,_0x53b33b){!0x1===_0x3423a5?this['containerView']['bodyView']['setPartActive'](!0x1):this['containerView']['bodyView']['setPartActive'](_0x3423a5,_0x53b33b);}['updateSources'](_0x1e315c){this['containerView']['updateSources'](_0x1e315c);}['getPartView'](_0xbd504e){return this['containerView']['bodyView']['getPartView'](_0xbd504e);}['markAsDone'](){super['markAsDone'](),this['containerView']['markAsDone']();}}class wn extends en{['replyContainer'];['_bodyCollection'];constructor(_0x5945db,_0x24af46,_0x291141){super(_0x24af46),this['_bodyCollection']=_0x291141,this['locale']=_0x5945db,this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__ai-reply']}}),this['replyContainer']=new Nt(),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':us(this['options']['initialContent']),'renderingStrategy':'static'}),this['markAsDone']());}async['updateContent']({parsedContent:_0x1f4147,renderingStrategy:_0x435cf8,abortSignal:_0x385d39}){'streaming'===_0x435cf8?await this['streamIntoElement'](_0x1f4147,this['replyContainer']['element'],_0x385d39):this['replyContainer']['element']['innerHTML']=_0x1f30d8(_0x1f4147);}['updateSources'](_0x5c6f78){const _0x43faac=new En(this['locale'],this['_bodyCollection']);_0x43faac['children']['addMany'](_0x5c6f78['map'](_0x5f53a4=>new Tn(this['locale'],_0x5f53a4,_0x43faac['balloonPanelView']))),_0x43faac['isVisible']=!0x0,this['children']['add'](_0x43faac);}}class fn extends vt{constructor(_0x5390fc=void 0x0){super();const _0x5c955e=_0x5390fc?'ck-ai-spinner_'+_0x5390fc:'';this['extendTemplate']({'tag':'span','attributes':{'class':['ck-ai-spinner',_0x5c955e]}});}}const Sn={'file':_0x50506b,'document':_0x5a4ac5,'web-resource':_0x8b24ef,'text':_0x50506b,'selection':_0x2635ff,'mcp-tool-context':_0x5a4ac5},bn='ck-ai-chat-context-chip',Rn='ck-ai-chat-context-chip_wide',On='ck-ai-chat-context-chip_document',kn='ck-ai-chat-context-chip__label',Nn='ck-ai-chat-context-chip__type-icon',vn='ck-ai-chat-context-controls__chip-tooltip',yn='n';class xn extends kt{constructor(_0x59ff43,_0x5079a4,_0x3e133a,_0x3a3a05,_0x338fc7=!0x1){super(_0x59ff43),this['_isAnimationOnEnterEnabled']=_0x3a3a05,this['_initializeProperties'](_0x5079a4,_0x3e133a,_0x338fc7),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'](_0x106df7,_0x79b4aa,_0x10694a){this['set']('label',_0x106df7['label']),this['set']('tooltip',!0x0),this['set']('itemType',_0x106df7['type']),this['set']('id',_0x106df7['uiId']),this['set']('readonly',_0x79b4aa),this['set']('isLoading',_0x10694a);}['_setupTemplate'](){const _0x5e874b=this['_createIconView'](),_0x570424=this['_createRemoveButton'](),_0x597938=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':this['_createTemplateAttributes'](_0x597938),'children':this['_createTemplateChildren'](_0x5e874b,_0x570424,_0x597938)});}['_createTemplateAttributes'](_0x35e0e2){return{'class':[bn,_0x35e0e2['if']('itemType',On,_0x2b54f0=>'document'==_0x2b54f0),_0x35e0e2['if']('itemType',Rn,_0x18feb7=>'selection'==_0x18feb7)],'data-cke-tooltip-text':_0x35e0e2['to']('label',Ln),'data-cke-tooltip-position':yn,'data-cke-tooltip-class':vn};}['_createTemplateChildren'](_0x5f0894,_0x1485ac,_0x560394){const _0x197de8=this['_createLabelElement'](_0x560394),_0x4ff509=this['_createLoaderIcon']();return this['readonly']?[_0x5f0894,_0x197de8]:[_0x5f0894,_0x4ff509,_0x197de8,_0x1485ac];}['_createLabelElement'](_0x42488a){return{'tag':'span','attributes':{'class':kn},'children':[{'text':_0x42488a['to']('label')}]};}['_createRemoveButton'](){const _0x496a9a=new kt(this['locale']);return _0x496a9a['set']({'label':as(this['locale'],'AI_CHAT_CONTEXT_REMOVE_FROM_CONTEXT'),'icon':_0x340c21}),this['_setupRemoveButtonEvent'](_0x496a9a),_0x496a9a;}['_setupRemoveButtonEvent'](_0x5b8e78){_0x5b8e78['on']('execute',()=>{this['fire']('removeContextItemChip',this['id']);});}['_createIconView'](){const _0x43e1f2=this['bindTemplate'],_0x177744=new yt();return _0x177744['content']=Sn[this['itemType']],_0x177744['extendTemplate']({'attributes':{'class':[Nn,_0x43e1f2['if']('isLoading','ck-hidden',_0x3159e3=>_0x3159e3)]}}),_0x177744;}['_handleAnimationEndOnce'](_0x464d25,_0xa97686){if(!_0x464d25)return;const _0x4a71fd=()=>{_0xa97686(),_0x464d25['removeEventListener']('animationend',_0x4a71fd),_0x464d25['removeEventListener']('webkitAnimationEnd',_0x4a71fd);};_0x464d25['addEventListener']('animationend',_0x4a71fd),_0x464d25['addEventListener']('webkitAnimationEnd',_0x4a71fd);}['_createLoaderIcon'](){const _0x1441f6=new fn('small');return _0x1441f6['bind']('isVisible')['to'](this,'isLoading',_0x4d27d8=>_0x4d27d8),_0x1441f6;}}function Ln(_0x34c5ee){if(!_0x34c5ee)return _0x34c5ee;if(_0x34c5ee['length']<=0x78)return _0x34c5ee;const _0x544df5=_0x34c5ee['slice'](0x0,0x78),_0x4a3715=_0x544df5['lastIndexOf']('\x20');return(_0x4a3715>0x0?_0x544df5['slice'](0x0,_0x4a3715):_0x544df5)+'…';}const Dn={'maxVisibleRows':0x2,'rowDetectionTolerance':0x5,'showMoreLabelPrefix':'+\x20','viewportOffset':{'top':0x64,'bottom':0xa}},Pn='300px';class Hn{['_locale'];['_config'];['_visibleChips'];['_overflowChips'];['_showMoreButtonView']=null;['_showMoreBalloonPanelView']=null;['_containerElement']=null;['_bodyCollection'];['_parentView']=null;['_intersectionObserver']=null;['_pendingCalculation']=!0x1;constructor(_0x26548b,_0xd32a31,_0x39643d,_0x3264bd,_0x46fa3c){this['_locale']=_0x26548b,this['_visibleChips']=_0xd32a31,this['_config']={...Dn,..._0x39643d,'cssClasses':{'controlsButton':'','calculationContainer':'ck-calculation-container',..._0x39643d['cssClasses']}},this['_overflowChips']=new dt(),this['_bodyCollection']=_0x3264bd,this['_parentView']=_0x46fa3c||null;}['setContainerElement'](_0x4a28e2){this['_intersectionObserver']&&(this['_intersectionObserver']['disconnect'](),this['_intersectionObserver']=null),this['_containerElement']=_0x4a28e2,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 _0x3a6538=[...this['_visibleChips'],...this['_overflowChips']],_0x4395a6=this['_createCalculationContainer'](),_0x383cdf=this['_calculateOverflowInContainer'](_0x4395a6,_0x3a6538),_0x4ab726=_0x4395a6['_ancestorsToRestore'];_0x4ab726&&this['_restoreAncestorVisibility'](_0x4ab726),_0x4395a6['remove'](),this['_applyOverflowResults'](_0x3a6538,_0x383cdf);}['_createShowMoreButton'](){this['_showMoreButtonView']=this['_createShowMoreButtonView'](),this['_showMoreBalloonPanelView']=this['_createShowMoreBalloonPanelView'](),this['_showMoreButtonView']['render'](),this['_containerElement']['appendChild'](this['_showMoreButtonView']['element']),this['_showMoreButtonView']['on']('execute',()=>{this['_handleShowMoreButtonClick']();}),Xt({'emitter':this['_showMoreBalloonPanelView'],'contextElements':[this['_showMoreBalloonPanelView']['element'],this['_showMoreButtonView']['element']],'callback':()=>this['hideBalloonPanel'](),'activator':()=>this['_showMoreButtonView']['isOn']});}['_createShowMoreButtonView'](){const _0x19108a=new kt(this['_locale']);_0x19108a['set']({'label':'','withText':!0x0,'isToggleable':!0x0});const _0x5a085b=[this['_config']['cssClasses']['showMoreButton']];return this['_config']['cssClasses']['controlsButton']&&_0x5a085b['push'](this['_config']['cssClasses']['controlsButton']),_0x19108a['extendTemplate']({'attributes':{'class':_0x5a085b}}),_0x19108a;}['_createShowMoreBalloonPanelView'](){const _0x216d86=new Qt(this['_locale']);return _0x216d86['extendTemplate']({'attributes':{'class':this['_config']['cssClasses']['showMoreBalloon']}}),this['_bodyCollection']['add'](_0x216d86),_0x216d86;}['_updateBalloonContent'](){if(this['_showMoreBalloonPanelView']&&(this['_showMoreBalloonPanelView']['content']['clear'](),this['_overflowChips']['length']>0x0)){this['_overflowChips']['forEach'](_0x5e83c9=>{_0x5e83c9['disableAnimationOnEnter']();});const _0x15e6ed=new Nt(this['_locale']);_0x15e6ed['setTemplate']({'tag':'div','attributes':{'class':this['_config']['cssClasses']['overflowContainer']},'children':this['_overflowChips']}),this['_showMoreBalloonPanelView']['content']['add'](_0x15e6ed);}}['_handleShowMoreButtonClick'](){this['_showMoreButtonView']['isOn']?this['hideBalloonPanel']():this['showBalloonPanel']();}['_updateShowMoreButtonVisibility'](){const _0xeefa40=this['_overflowChips']['length']>0x0;this['_showMoreButtonView']?.['element']&&(this['_showMoreButtonView']['element']['style']['display']=_0xeefa40?'':'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'](_0x2aba4c){const _0x383885=this['_containerElement']?.['tagName']['toLowerCase']()||'div',_0x431617=this['_containerElement']?.['classList'];if(_0x431617){const _0x42193a=_0x431617[0x0]||'',_0x1daa24=_0x2aba4c['querySelector']('.'+_0x42193a),_0x389778=_0x2aba4c['querySelector'](_0x383885);return _0x1daa24||_0x389778||_0x2aba4c;}return _0x2aba4c['querySelector'](_0x383885)||_0x2aba4c;}['_calculateContainerWidth'](){const _0x55ff7c=this['_parentView']?.['element']||this['_containerElement'];if(!_0x55ff7c)return Pn;const _0xb4780d=window['getComputedStyle'](_0x55ff7c)['width'];if('auto'===_0xb4780d||'0px'===_0xb4780d||!_0xb4780d){const _0x140c9=_0x55ff7c['parentElement'];if(_0x140c9){const _0x15514f=window['getComputedStyle'](_0x140c9);return'auto'!==_0x15514f['width']?_0x15514f['width']:Pn;}return Pn;}return _0xb4780d;}['_applyCalculationStyles'](_0x41e1dc,_0x2ab366){this['_config']['cssClasses']['calculationContainer']&&_0x41e1dc['classList']['add'](this['_config']['cssClasses']['calculationContainer']),_0x41e1dc['style']['width']=_0x2ab366,_0x41e1dc['style']['position']='absolute',_0x41e1dc['style']['top']='-9999px',_0x41e1dc['style']['left']='-9999px',_0x41e1dc['style']['opacity']='0',_0x41e1dc['style']['pointerEvents']='none',_0x41e1dc['style']['zIndex']='-1',_0x41e1dc['style']['visibility']='visible\x20!important',_0x41e1dc['style']['display']='block\x20!important',_0x41e1dc['style']['boxSizing']='border-box';}['_restoreAncestorVisibility'](_0x23b0fc){_0x23b0fc['forEach'](({element:_0x1061fe,originalDisplay:_0x10eea1,originalVisibility:_0x57cf7b})=>{_0x1061fe['style']['display']=_0x10eea1,_0x1061fe['style']['visibility']=_0x57cf7b;});}['_makeAncestorsVisible'](_0x3a3d1c){const _0x36979c=[];let _0x24f573=_0x3a3d1c;for(;_0x24f573&&_0x24f573!==document['body'];){const _0x419872=window['getComputedStyle'](_0x24f573);'none'!==_0x419872['display']&&'hidden'!==_0x419872['visibility']||(_0x36979c['push']({'element':_0x24f573,'originalDisplay':_0x24f573['style']['display'],'originalVisibility':_0x24f573['style']['visibility']}),_0x24f573['style']['display']='block',_0x24f573['style']['visibility']='visible'),_0x24f573=_0x24f573['parentElement'];}return _0x36979c;}['_createContainerElements'](){let _0x555a7c,_0x7e9b72;return this['_parentView']?.['element']?(_0x555a7c=this['_parentView']['element']['cloneNode'](!0x0),_0x7e9b72=this['_findTargetContainer'](_0x555a7c)):(_0x555a7c=document['createElement']('div'),_0x7e9b72=_0x555a7c),{'calculationContainer':_0x555a7c,'targetContainer':_0x7e9b72};}['_createCalculationContainer'](){const {calculationContainer:_0x217a81,targetContainer:_0x14521c}=this['_createContainerElements'](),_0x549f7f=this['_calculateContainerWidth']();this['_applyCalculationStyles'](_0x217a81,_0x549f7f);const _0x1a28b7=this['_parentView']?.['element']||this['_containerElement'],_0xe4315d=_0x1a28b7?.['parentElement'];_0xe4315d?_0xe4315d['appendChild'](_0x217a81):document['body']['appendChild'](_0x217a81),_0x217a81['_targetContainer']=_0x14521c;const _0x20e1b8=this['_makeAncestorsVisible'](_0xe4315d||null);return _0x217a81['offsetWidth'],_0x217a81['_ancestorsToRestore']=_0x20e1b8,_0x217a81;}['_calculateOverflowInContainer'](_0x56330e,_0x5adbde){const _0xba2154=_0x56330e['_targetContainer']||_0x56330e,_0x59ed9c=[],{rowCount:_0x36cf5e}=this['_renderChipsAndCountRows'](_0xba2154,_0x5adbde);if(_0x36cf5e<=this['_config']['maxVisibleRows'])return _0x59ed9c;const _0x4fedeb=_0x5adbde['slice']();for(;_0x4fedeb['length']>0x0;){if(this['_testButtonFit'](_0x56330e,_0xba2154,_0x4fedeb)){const _0x10e1cd=_0x5adbde['filter'](_0x1c8711=>!_0x4fedeb['includes'](_0x1c8711));_0x59ed9c['push'](..._0x10e1cd);break;}if(!_0x4fedeb['pop']())break;}return _0x59ed9c;}['_renderChipsAndCountRows'](_0x4e69c7,_0x223374){_0x4e69c7['innerHTML']='',_0x223374['forEach'](_0x5805ce=>{if(_0x5805ce['element']){const _0x32b41f=_0x5805ce['element']['cloneNode'](!0x0);_0x4e69c7['appendChild'](_0x32b41f);}}),_0x4e69c7['offsetWidth'];const _0x4f9cdf=_0x4e69c7['children'],_0x222db0=[];return Array['from'](_0x4f9cdf)['forEach'](_0x55a090=>{const _0x5cfd4b=_0x55a090['getBoundingClientRect']()['top'];_0x222db0['some'](_0x2c5b4d=>Math['abs'](_0x2c5b4d-_0x5cfd4b)<this['_config']['rowDetectionTolerance'])||_0x222db0['push'](_0x5cfd4b);}),{'rowCount':_0x222db0['length']};}['_createMockButton'](){const _0x4106b6=document['createElement']('button');return _0x4106b6['className']=this['_config']['cssClasses']['showMoreButton'],this['_config']['cssClasses']['controlsButton']&&_0x4106b6['classList']['add'](this['_config']['cssClasses']['controlsButton']),_0x4106b6['textContent']='+\x201',_0x4106b6;}['_testButtonFit'](_0x4fb823,_0x2443a6,_0x2b7a49){this['_renderChipsAndCountRows'](_0x2443a6,_0x2b7a49);const _0x2452f1=this['_createMockButton']();_0x4fb823['appendChild'](_0x2452f1),_0x4fb823['offsetWidth'];const _0x54165a=[..._0x2443a6['children'],_0x2452f1],_0x526010=[];_0x54165a['forEach'](_0x135424=>{const _0x347bba=_0x135424['getBoundingClientRect']()['top'];_0x526010['some'](_0x59d358=>Math['abs'](_0x59d358-_0x347bba)<this['_config']['rowDetectionTolerance'])||_0x526010['push'](_0x347bba);});const _0x25edb9=_0x526010['length'];return _0x2452f1['remove'](),_0x25edb9<=this['_config']['maxVisibleRows'];}['_distributeChips'](_0x40a74b,_0x26c5e2){this['_visibleChips']['clear'](),this['_overflowChips']['clear'](),_0x40a74b['forEach'](_0x202c1a=>{_0x26c5e2['includes'](_0x202c1a)?this['_overflowChips']['add'](_0x202c1a):this['_visibleChips']['add'](_0x202c1a);});}['_updateOverflowUI'](_0x203e5a){if(_0x203e5a>0x0&&!this['_showMoreButtonView']&&this['_createShowMoreButton'](),_0x203e5a>0x0&&this['_showMoreButtonView']){const _0x4420f0=''+this['_config']['showMoreLabelPrefix']+(_0x203e5a<0x63?_0x203e5a:'99');this['_showMoreButtonView']['label']=_0x4420f0;}this['_updateBalloonContent'](),this['_updateShowMoreButtonVisibility'](),this['_repinBalloonPanel']();}['_applyOverflowResults'](_0x1fbf02,_0x55b3f6){this['_distributeChips'](_0x1fbf02,_0x55b3f6),this['_updateOverflowUI'](_0x55b3f6['length']);}['_setupVisibilityObserver'](){this['_containerElement']&&'undefined'!=typeof IntersectionObserver&&(this['_intersectionObserver']=new IntersectionObserver(_0x8ea051=>{_0x8ea051[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 _0x2a3453=this['_containerElement']['getBoundingClientRect']();if(0x0===_0x2a3453['width']||0x0===_0x2a3453['height'])return!0x1;const _0x334483=window['innerHeight']||document['documentElement']['clientHeight'],_0x26a4c5=window['innerWidth']||document['documentElement']['clientWidth'],_0x99dec0=0xc8;return _0x2a3453['bottom']>=-0xc8&&_0x2a3453['top']<=_0x334483+_0x99dec0&&_0x2a3453['right']>=-0xc8&&_0x2a3453['left']<=_0x26a4c5+_0x99dec0;}}const Mn='ck-ai-chat__feed__context-chips',Un='ck-ai-chat-context-chips-wrapper',Vn='ck-ai-chat-context-chips-wrapper-balloon',Bn='ck-ai-chat-controls-button',Gn='ck-ai-chat-controls_context_show-more-button',Fn='ck-ai-chat-context-controls__show-more-balloon-panel';class Kn extends Nt{['_contextChips']=this['createCollection']();['_overflowManager'];['_bodyCollection'];constructor(_0x5b0d98,_0x307308,_0x3525d6){super(_0x5b0d98),this['_bodyCollection']=_0x3525d6,this['_createContextChips'](_0x307308);const _0xf83e51={'cssClasses':{'showMoreButton':Gn+'\x20'+cs,'showMoreBalloon':Fn,'overflowContainer':Vn,'controlsButton':Bn}};this['_overflowManager']=new Hn(_0x5b0d98,this['_contextChips'],_0xf83e51,this['_bodyCollection'],this),this['setTemplate']({'tag':'div','attributes':{'class':[Mn,'ck','ck-reset_all']},'children':[{'tag':'div','attributes':{'class':Un},'children':this['_contextChips']}]});}['render'](){super['render']();const _0xe3cbc8=this['element']['querySelector']('.'+Un);_0xe3cbc8&&(this['_overflowManager']['setContainerElement'](_0xe3cbc8),this['_overflowManager']['reorganizeChips']());}['destroy'](){super['destroy'](),this['_overflowManager']['destroy']();}['_createContextChips'](_0xe4d673){for(const _0x19c30c of _0xe4d673){const _0x1f4e85=new xn(this['locale'],_0x19c30c,!0x0,!0x1);this['_contextChips']['add'](_0x1f4e85);}}}class Wn extends en{['_contextChipsView']=null;['_locale'];['_bodyCollection'];['_messageContentView'];constructor(_0x1ae28e,_0x58f6de,_0x411a5c){super(_0x58f6de),this['_locale']=_0x1ae28e,this['_bodyCollection']=_0x411a5c,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 Kn(this['_locale'],this['options']['contextItems']['filter'](_0x2ec7c5=>!_0x2ec7c5['hidden']),this['_bodyCollection']),this['_contextChipsView']['extendTemplate']({'attributes':{'class':'ck-ai-chat__feed__context-chips'}}),this['children']['add'](this['_contextChipsView']));}['_createMessageContentView'](){this['_messageContentView']=new Nt(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 Yn extends en{['capabilities'];constructor(_0x17349f,_0xa11c4){super(_0xa11c4);const {isWebSearchEnabled:_0x52262d,isReasoningEnabled:_0x3cb3db}=_0xa11c4['capabilities'],_0xb09f6c=[];let _0xcf30de='';_0x52262d&&_0x3cb3db?(_0xcf30de=as(_0x17349f,'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH_REASONING'),_0xb09f6c['push']($n(_0x1a441e)),_0xb09f6c['push']($n(_0x521f8d))):_0x52262d?(_0xcf30de=as(_0x17349f,'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH'),_0xb09f6c['push']($n(_0x1a441e))):_0x3cb3db&&(_0xcf30de=as(_0x17349f,'AI_CHAT_FEED_REPLY_ITEM_USED_REASONING'),_0xb09f6c['push']($n(_0x521f8d))),this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__interaction-header',_0xcf30de?'':'ck-hidden']}});const _0x370b35=new Nt();_0x370b35['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__interaction-header__capabilities']},'children':[..._0xb09f6c,{'tag':'span','attributes':{'class':['ck-ai-chat__feed__interaction-header__capabilities__text']},'children':[_0xcf30de]}]}),this['children']['add'](_0x370b35),this['capabilities']=_0xa11c4['capabilities'];}}function $n(_0x39a1fb){const _0x460d67=new yt();return _0x460d67['content']=_0x39a1fb,_0x460d67;}const qn=['wheel','touchstart','pointerdown','keydown'],Qn=['ArrowUp','ArrowDown','PageUp','PageDown','Home','End','\x20'];class Xn{['element'];['animationFrameId'];['isRunning'];['abortController'];['isUserPaused'];constructor(_0x354d85){this['element']=_0x354d85,this['animationFrameId']=null,this['isRunning']=!0x1,this['abortController']=new AbortController(),this['isUserPaused']=!0x1;for(const _0xb28888 of qn){const _0xee95ec='keydown'!==_0xb28888;this['element']['addEventListener'](_0xb28888,this['_onUserEvent']['bind'](this),{'passive':_0xee95ec,'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'](_0x69dbeb){if(this['isRunning']){if('keydown'===_0x69dbeb['type']){const _0x3aeede=_0x69dbeb['key'];if(!Qn['includes'](_0x3aeede))return;}_0x69dbeb instanceof WheelEvent?_0x69dbeb['deltaY']<0x0?this['isUserPaused']=!0x0:this['isUserPaused']=!this['_isAtBottom']():this['isUserPaused']=!0x0;}}['_isAtBottom'](){const {scrollTop:_0xc536de,scrollHeight:_0x353ed0,clientHeight:_0x159649}=this['element'];return _0x353ed0-_0xc536de-_0x159649<=0x5;}['_rafUpdate'](){this['isRunning']&&(this['isUserPaused']||this['element']['scrollTo']({'top':this['element']['scrollHeight'],'behavior':'auto'}),this['animationFrameId']=requestAnimationFrame(this['_rafUpdate']['bind'](this)));}}class zn extends Nt{constructor(_0xf61b26,_0x1dbfbe){super(_0xf61b26),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-skeleton']},'children':this['_createSkeletonItems'](_0x1dbfbe)});}['_createSkeletonItems'](_0x30fd47){const _0x3fa4a1=['ck','ck-ai-skeleton__item'];return _0x30fd47['map'](_0x512a1f=>{let _0x4641c6='';switch(_0x512a1f['attributes']['align']){case'right':_0x4641c6='margin-left:\x20auto;\x20margin-right:\x200;\x20text-align:\x20right;';break;case'center':_0x4641c6='margin-left:\x20auto;\x20margin-right:\x20auto;\x20text-align:\x20center;';break;case'left':_0x4641c6='margin-left:\x200;\x20margin-right:\x20auto;\x20text-align:\x20left;';}return{'tag':_0x512a1f['tag'],'attributes':{'class':[..._0x3fa4a1,_0x512a1f['attributes']['class']?_0x512a1f['attributes']['class']:''],'style':'width:\x20'+_0x512a1f['attributes']['width']+';\x20height:\x20'+_0x512a1f['attributes']['height']+';'+_0x4641c6}};});}}const jn={'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':Jn(0x5,'100%','44px','right'),'aiChatResources':Jn(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 Jn(_0x58cd64,_0x1acf47,_0x36635c,_0xcb0210){return new Array(_0x58cd64)['fill'](null)['map'](()=>({'tag':'div','attributes':{'width':_0x1acf47,'height':_0x36635c,'align':_0xcb0210}}));}class Zn extends en{constructor(_0x4773fe){super(_0x4773fe),this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__custom-element']}});}async['render'](){super['render'](),'string'==typeof this['options']['content']?this['element']['innerHTML']=this['options']['content']:this['element']['appendChild'](this['options']['content']);}}class tr extends Nt{['children'];['scrollManager'];['_bodyCollection'];constructor(_0x46292,_0x344cdb){super(_0x46292),this['_bodyCollection']=_0x344cdb,this['set']('isPending',!0x1),this['set']('loadingMessage',''),this['set']('isLoadingSkeletonVisible',!0x1),this['set']('isTrackChangesOn',!0x1),this['children']=this['createCollection'](),this['children']['delegate'](...Xs)['to'](this),this['_setupTemplate']();}['render'](){super['render'](),this['scrollManager']=new Xn(this['element']);}['destroy'](){super['destroy'](),this['scrollManager']['destroy']();}['clear'](){this['children']['clear']();}['addItem'](_0x51363c,_0x44892f){let _0x1fb339;return'ai-reply'===_0x51363c?_0x1fb339=new wn(this['locale'],_0x44892f,this['_bodyCollection']):'ai-suggestion-reply'===_0x51363c?(_0x1fb339=new Cn(this['locale'],_0x44892f,this['_bodyCollection']),_0x1fb339['bind']('isTrackChangesOn')['to'](this)):_0x1fb339='user-message'===_0x51363c?new Wn(this['locale'],_0x44892f,this['_bodyCollection']):'interaction-header'===_0x51363c?new Yn(this['locale'],_0x44892f):'custom-element'===_0x51363c?new Zn(_0x44892f):new An(_0x44892f),this['children']['add'](_0x1fb339),_0x1fb339;}async['updateReplyItem']({id:_0x4fbee3,parsedContent:_0x2fc334,renderingStrategy:_0x241371,abortSignal:_0x87076c}){const _0x7d5ff9=this['getItemById'](_0x4fbee3);if(!(_0x7d5ff9 instanceof wn))throw new ot('ai-chat-feed-view-item-not-a-reply-item',null,{'itemView':_0x7d5ff9,'id':_0x4fbee3,'parsedContent':_0x2fc334});await _0x7d5ff9['updateContent']({'parsedContent':_0x2fc334,'renderingStrategy':_0x241371,'abortSignal':_0x87076c});}async['updateWebSources'](_0x539f94,_0x4d73ab){const _0x28b65e=this['getItemById'](_0x539f94);if(_0x28b65e instanceof Cn)_0x28b65e['updateSources'](_0x4d73ab);else{if(!(_0x28b65e instanceof wn))throw new ot('ai-chat-feed-view-item-not-a-suggestion-or-reply-item',null,{'itemView':_0x28b65e,'id':_0x539f94,'sources':_0x4d73ab});_0x28b65e['updateSources'](_0x4d73ab);}}async['updateSuggestionItem']({id:_0x33d94c,parts:_0x289a4d,renderingStrategy:_0x5ba1a9,abortSignal:_0x555221}){const _0xdf9467=this['getItemById'](_0x33d94c);if(!(_0xdf9467 instanceof Cn))throw new ot('ai-chat-feed-view-item-not-a-suggestion-item',null,{'itemView':_0xdf9467,'id':_0x33d94c,'parts':_0x289a4d});await _0xdf9467['updateContent']({'parts':_0x289a4d,'renderingStrategy':_0x5ba1a9,'abortSignal':_0x555221});}['updateSuggestionPartState']({id:_0xe43d06,index:_0x798ac8,state:_0x2d068b}){const _0x8f3577=this['getItemById'](_0xe43d06);if(!(_0x8f3577 instanceof Cn))throw new ot('ai-chat-feed-view-item-not-a-suggestion-item',this,{'id':_0xe43d06});_0x8f3577['updatePartState'](_0x798ac8,_0x2d068b);}['setSuggestionPartActive']({id:_0x9ce8ad,index:_0x54a636,isActive:_0x1e119e}){const _0x1399bf=this['getItemById'](_0x9ce8ad);if(!(_0x1399bf instanceof Cn))throw new ot('ai-chat-feed-view-item-not-a-suggestion-item',this,{'id':_0x9ce8ad});this['children']['filter'](_0x157f43=>_0x157f43 instanceof Cn)['forEach'](_0x2b0676=>{_0x2b0676['setPartActive'](!0x1);}),_0x1399bf['setPartActive'](_0x54a636,_0x1e119e);}['markItemAsDone'](_0x38398c){this['getItemById'](_0x38398c)['markAsDone']();}['getItemIds'](){return this['children']['map'](_0xd030d2=>_0xd030d2['options']['id']);}['removeItem'](_0x5a6865){this['children']['remove'](this['getItemById'](_0x5a6865));}['hasItem'](_0x21d59d){return!!this['children']['find'](_0x18feb9=>_0x18feb9['options']['id']['includes'](_0x21d59d));}['scrollToSuggestion'](_0x4b3366,_0xc189dc){const _0x58f12f=this['getItemById'](_0x4b3366);if(!(_0x58f12f instanceof Cn))return void It('ck-ai-chat-feed-view-scroll-to-suggestion-invalid-item',{'replyId':_0x4b3366,'partIndex':_0xc189dc});const _0x3c37c6=_0x58f12f['getPartView'](_0xc189dc);_0x3c37c6?wt(_0x3c37c6['element'],0x14,this['element']['parentElement'],!0x0,!0x0):It('ck-ai-chat-feed-view-scroll-to-suggestion-part-view-not-found',{'replyId':_0x4b3366,'partIndex':_0xc189dc});}['_setupTemplate'](){this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed']},'children':this['_createTemplateChildren']()});}['_createTemplateChildren'](){const _0x197b72=this['_createSkeletonLoader']();return[this['_createFeedItems'](),_0x197b72,this['_createFeedLoader']()];}['_createSkeletonLoader'](){const _0x1b11ec=new zn(this['locale'],jn['aiFeed']);return _0x1b11ec['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isLoadingSkeletonVisible','ck-hidden',_0x2c698f=>!_0x2c698f)]}}),_0x1b11ec;}['_createFeedItems'](){const _0x19b397=new Nt(this['locale']);return _0x19b397['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__items',this['bindTemplate']['if']('isLoadingSkeletonVisible','ck-hidden')]},'children':this['children']}),_0x19b397;}['_createFeedLoader'](){const _0xf5de55=new Nt(this['locale']);return _0xf5de55['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__loader',this['bindTemplate']['if']('isPending','ck-hidden',_0x47e87c=>!_0x47e87c)]},'children':this['_createLoaderChildren']()}),_0xf5de55;}['_createLoaderChildren'](){const _0x1d12a5=new fn();return _0x1d12a5['isVisible']=!0x0,[_0x1d12a5,{'tag':'span','attributes':{'class':['ck','ck-ai-chat__loader-text']},'children':[{'text':this['bindTemplate']['to']('loadingMessage')}]}];}['getItemById'](_0x35c5aa){const _0x3a8538=this['children']['find'](_0x5d66b9=>_0x5d66b9['options']['id']['includes'](_0x35c5aa));if(!_0x3a8538)throw new ot('ai-chat-feed-view-item-not-found',this,{'id':_0x35c5aa});return _0x3a8538;}['setLoadingMessage'](_0x47e39d){this['set']('loadingMessage',_0x47e39d);}['toggleLoadingSkeleton'](_0x5b2e42){this['set']('isLoadingSkeletonVisible',_0x5b2e42);}['startAutoScroll'](){this['scrollManager']['start']();}['stopAutoScroll'](){this['scrollManager']['stop']();}}class er extends Lt{['filter'](){let _0x182222=0x0;for(const _0x35ff85 of this['items'])_0x182222+=_0x35ff85['items']['length'];return{'resultsCount':_0x182222,'totalItemsCount':_0x182222};}}const ir='ck-ai-chat__prompt-input_highlighted';class sr extends xt{['submitButtonView'];static ['MIN_ROWS']=0x1;static ['MAX_ROWS']=0xc;['_addContextButtonView'];['_queryViewResizeObserver'];constructor(_0x11f9b5,_0x41b482){super(_0x11f9b5,{'queryView':{'label':'','creator':Ut,'showIcon':!0x1,'showResetButton':!0x1},'filteredView':new er(_0x11f9b5),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1}),this['set']('isEmpty',!0x0),this['set']('isUploadInProgress',!0x1),this['_addContextButtonView']=_0x41b482,this['_queryViewResizeObserver']=null,this['queryView']['fieldView']['minRows']=sr['MIN_ROWS'],this['queryView']['fieldView']['maxRows']=sr['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',(_0x2824d9,_0x1b40cf)=>!_0x2824d9&&!_0x1b40cf),this['focusableChildren']['add'](this['submitButtonView']);}['render'](){super['render'](),this['queryView']['fieldWrapperChildren']['add'](this['submitButtonView']),this['keystrokes']['set']('enter',(_0x533032,_0x1ceee2)=>{this['isUploadInProgress']||this['isEmpty']||_0x533032['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0x1ceee2());}),this['queryView']['fieldView']['on']('update',()=>{this['isEmpty']=''===this['queryView']['fieldView']['element']['value']?.['trim']();});}['destroy'](){super['destroy'](),this['_queryViewResizeObserver']&&this['_queryViewResizeObserver']['destroy']();}['submit'](){const _0x48e34f=this['queryView']['fieldView']['element']['value']?.['trim']();if(!_0x48e34f)return this['queryView']['errorText']=as(this['locale'],'AI_CHAT_PROMPT_EMPTY_ERROR'),void(this['queryView']['fieldView']['hasError']=!0x0);this['queryView']['fieldView']['hasError']=!0x1;const _0x53cca7=_0x215ed3(_0x48e34f);this['fire']('sendUserMessage',_0x53cca7),this['queryView']['fieldView']['reset']();}['setPlaceholderText'](_0x30e831){this['queryView']['fieldView']['set']('placeholder',_0x30e831);}['focus'](_0xc2ca6e=!0x1){super['focus'](),_0xc2ca6e&&(this['element']['classList']['contains'](ir)||(this['element']['classList']['add'](ir),setTimeout(()=>{this['element']['classList']['remove'](ir);},0x320)));}['_createSubmitButton'](){const _0x78eb39=new kt(this['locale']);return _0x78eb39['set']({'icon':_0x5b6899,'label':as(this['locale'],'AI_CHAT_LABEL_SUBMIT'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-chat__prompt-submit-button\x20'+os,'isEnabled':!0x1}),_0x78eb39['on']('execute',()=>{this['submit']();}),_0x78eb39;}['setIsUploadInProgress'](_0x49ab2a){this['isUploadInProgress']=_0x49ab2a;}['_setUpAddContextButtonPositioning'](){const _0x44135d=this['locale'],_0x127c38=()=>{ct['window']['requestAnimationFrame'](()=>{if(lt(this['element'])){const _0x1e6a50=new ut(this['queryView']['fieldView']['element']),_0x467a9e=new ut(this['_addContextButtonView']['element']),_0x5ee5ce=_0x1e6a50['width'],_0x1debb6='rtl'===_0x44135d['uiLanguageDirection']?'right':'left';_0x1e6a50['excludeScrollbarsAndBorders']();const _0x3fb668=_0x5ee5ce-_0x1e6a50['width']+0x1;this['_addContextButtonView']['element']['style'][_0x1debb6]='calc('+(_0x5ee5ce-_0x467a9e['width']-_0x3fb668)+'px\x20-\x20var(--ck-spacing-tiny))';}});};this['queryView']['fieldView']['on']('update',_0x127c38),this['on']('render',()=>{_0x127c38(),this['_queryViewResizeObserver']=new ft(this['queryView']['fieldView']['element'],()=>{_0x127c38();});});}}const nr='ck-ai-chat__prompt-capabilities',rr='ck-ai-chat-controls-button',ar='ck-ai-chat-controls-button--commands',or='ck-ai-chat-controls__model-selection',hr='ck-ai-chat-controls__model-selection__item-name',cr='ck-ai-chat-controls__model-selection__item-description',lr='ck-ai-chat-controls__model-selection__item-capabilities',ur='n';class dr extends Nt{['_webSearchButton'];['_reasoningButton'];['_commandsButton'];['_modelSelectionDropdown'];['_modelSelectionDropdownItems'];['_modelNameView'];constructor(_0x42f232){super(_0x42f232),this['set']('webSearchActive',!0x1),this['set']('reasoningActive',!0x1),this['set']('modelDisplayMode','selector'),this['set']('modelSelectorEnabled',!0x0),this['set']('activeModelId',null),this['set']('activeModelName',null),this['_modelSelectionDropdown']=this['_createModelSelectionDropdown'](),this['_modelNameView']=this['_createModelNameView'](),this['_webSearchButton']=this['_createWebSearchButton'](),this['_reasoningButton']=this['_createReasoningButton'](),this['_commandsButton']=this['_createCommandsButton'](),this['_modelSelectionDropdown']['buttonView']['bind']('isVisible')['to'](this,'modelDisplayMode',_0x446745=>'selector'===_0x446745),this['_modelSelectionDropdown']['buttonView']['bind']('tooltip')['to'](this,'modelSelectorEnabled',_0x4d8c44=>_0x4d8c44?this['_modelSelectionDropdown']['buttonView']['label']:as(this['locale'],'AI_CHAT_MODEL_SELECTOR_DISABLED_TOOLTIP')),this['_modelSelectionDropdown']['bind']('isEnabled')['to'](this,'modelSelectorEnabled',_0x55e9df=>_0x55e9df),this['_webSearchButton']['bind']('isOn')['to'](this,'webSearchActive',_0x21e59e=>_0x21e59e),this['_webSearchButton']['bind']('tooltip')['to'](this,'webSearchActive',_0x544798=>as(this['locale'],_0x544798?'AI_CHAT_DISABLE_WEB_SEARCH':'AI_CHAT_ENABLE_WEB_SEARCH')),this['_reasoningButton']['bind']('isOn')['to'](this,'reasoningActive',_0xd656b9=>_0xd656b9),this['_reasoningButton']['bind']('tooltip')['to'](this,'reasoningActive',_0x1100a4=>as(this['locale'],_0x1100a4?'AI_CHAT_DISABLE_REASONING':'AI_CHAT_ENABLE_REASONING')),this['setTemplate']({'tag':'div','attributes':{'class':[nr]},'children':[this['_modelSelectionDropdown'],this['_modelNameView'],this['_webSearchButton'],this['_reasoningButton'],this['_commandsButton']]}),this['_modelSelectionDropdownItems']=new dt(),zt(this['_modelSelectionDropdown'],this['_modelSelectionDropdownItems']);}['setModelList'](_0x380127,_0x180b59){if(_0x180b59)this['set']('modelDisplayMode','hidden');else{const _0x19a877=0x1===_0x380127['length'];this['set']('modelDisplayMode',_0x19a877?'name':'selector');}if(this['_modelSelectionDropdownItems']['clear'](),_0x380127?.['length'])for(const _0x2eaebe of _0x380127){const _0xd4affe=new jt({'label':_0x2eaebe['name'],'withText':!0x0,'role':'menuitemradio','id':_0x2eaebe['id'],'model':_0x2eaebe});_0xd4affe['bind']('isOn')['to'](this,'activeModelId',_0x593c3d=>_0x593c3d===_0x2eaebe['id']),this['_modelSelectionDropdownItems']['add']({'type':'button','model':_0xd4affe,'labelView':new _r(this['locale'],_0x2eaebe)});}}['setWebSearch'](_0x3dcada){this['set']('webSearchActive',_0x3dcada);}['setReasoning'](_0x7d4531){this['set']('reasoningActive',_0x7d4531);}['setModel'](_0x1fb673){if(!_0x1fb673)return;this['activeModelId']=_0x1fb673['id'],this['activeModelName']=_0x1fb673['name']||_0x1fb673['id'],this['_modelSelectionDropdown']['buttonView']['set']('label',_0x1fb673['name']),this['_modelSelectionDropdown']['buttonView']['set']('tooltip',_0x1fb673['name']);const _0x155f79=_0x1fb673['capabilities']['webSearch']?.['enabled']??!0x1;this['set']('webSearchActive',!0x1),this['_webSearchButton']['set']('isOn',!0x1),this['_webSearchButton']['set']('isEnabled',_0x155f79),this['_webSearchButton']['set']('isVisible',_0x155f79);const _0x43b7e0=_0x1fb673['capabilities']['reasoning']?.['enabled']??!0x1;this['set']('reasoningActive',!0x1),this['_reasoningButton']['set']('isOn',!0x1),this['_reasoningButton']['set']('isEnabled',_0x43b7e0),this['_reasoningButton']['set']('isVisible',_0x43b7e0);}['enableModelSelector'](){this['set']('modelSelectorEnabled',!0x0);}['disableModelSelector'](_0x4f75bf){this['set']('modelSelectorEnabled',!0x1),_0x4f75bf&&this['set']('modelDisplayMode','hidden');}['_createWebSearchButton'](){const _0x265163=new kt();return _0x265163['set']({'label':as(this['locale'],'AI_CHAT_SEARCH_WEB'),'icon':_0x1a441e,'class':rr+'\x20'+cs,'isToggleable':!0x0,'tooltipPosition':ur}),_0x265163['on']('execute',()=>{this['fire']('toggleWebSearch');}),_0x265163;}['_createReasoningButton'](){const _0x58cd61=new kt();return _0x58cd61['set']({'label':as(this['locale'],'AI_CHAT_REASONING'),'icon':_0x521f8d,'class':rr+'\x20'+cs,'isToggleable':!0x0,'tooltipPosition':ur}),_0x58cd61['on']('execute',()=>{this['fire']('toggleReasoning');}),_0x58cd61;}['_createCommandsButton'](){const _0x127a6e=new kt();return _0x127a6e['set']({'label':as(this['locale'],'AI_CHAT_COMMANDS'),'icon':_0x430e8c,'withText':!0x0,'class':rr+'\x20'+cs,'isToggleable':!0x0,'tooltip':as(this['locale'],'AI_CHAT_COMMANDS'),'tooltipPosition':ur}),_0x127a6e['extendTemplate']({'attributes':{'class':[ar]}}),_0x127a6e['on']('execute',()=>{console['log']('Commands\x20are\x20not\x20implemented\x20yet.'),alert('Commands\x20are\x20not\x20implemented\x20yet.');}),_0x127a6e;}['_createModelSelectionDropdown'](){const _0x4203c8=Bt(this['locale']);return _0x4203c8['set']({'panelPosition':'ne','class':[or]}),_0x4203c8['buttonView']['set']({'label':as(this['locale'],'AI_CHAT_MODEL_SELECTOR_ENABLED_TOOLTIP'),'withText':!0x0,'tooltip':!0x0,'tooltipPosition':ur,'class':cs}),this['listenTo'](_0x4203c8,'execute',_0x43a89d=>{this['fire']('selectModel',_0x43a89d['source']['model']);}),_0x4203c8;}['_createModelNameView'](){const _0x39c19e=new Ar(this['locale']);return _0x39c19e['bind']('text')['to'](this,'activeModelName',_0x5e456b=>_0x5e456b??''),_0x39c19e['bind']('isVisible')['to'](this,'modelDisplayMode',_0x1f5ef4=>'name'===_0x1f5ef4),_0x39c19e;}}let _r=class extends Ht{constructor(_0x7a4ce5,_0x4ace7e){super();const _0x1d1d2c=this['bindTemplate'],_0x24a36b=this['createCollection']();this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-button__label'],'style':_0x1d1d2c['to']('style'),'id':_0x1d1d2c['to']('id')},'children':[{'tag':'div','attributes':{'class':[hr]},'children':[{'text':_0x1d1d2c['to']('text')}]},{'tag':'div','attributes':{'class':[cr]},'children':[{'tag':'span','children':[{'text':_0x4ace7e['description']}]}]},{'tag':'div','attributes':{'class':[lr]},'children':_0x24a36b}]}),_0x24a36b['addMany'](this['_getCapabilityParts'](_0x7a4ce5,_0x1a441e,'AI_CHAT_SEARCH_WEB',_0x4ace7e['capabilities']['webSearch']?.['enabled']??!0x1)),_0x24a36b['addMany'](this['_getCapabilityParts'](_0x7a4ce5,_0x521f8d,'AI_CHAT_REASONING',_0x4ace7e['capabilities']['reasoning']?.['enabled']??!0x1));}['_getCapabilityParts'](_0x56b2ff,_0x1d4a67,_0x3b1dd8,_0x1e749e){const _0x4e2136=new yt();_0x4e2136['content']=_0x1d4a67;const _0x233daf=new Nt(_0x56b2ff);_0x233daf['setTemplate']({'tag':'span','children':[{'text':as(_0x56b2ff,_0x3b1dd8)+':\x20'}]});const _0x2209ae=new Nt(_0x56b2ff);return _0x2209ae['setTemplate']({'tag':'span','children':[{'text':as(_0x56b2ff,_0x1e749e?'AI_CHAT_CAPABILITIES_YES':'AI_CHAT_CAPABILITIES_NO')}]}),[_0x4e2136,_0x233daf,_0x2209ae];}},Ar=class extends Nt{constructor(_0x1e8657){super(_0x1e8657),this['set']('text',void 0x0),this['set']('isVisible',!0x0);const _0x5553c0=this['bindTemplate'];this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-chat-controls__model-name',_0x5553c0['if']('isVisible','ck-hidden',_0x588992=>!_0x588992)]},'children':[{'text':_0x5553c0['to']('text')}]});}};const gr='ck-ai-chat-context-controls__url-form',Ir='ck-ai-chat-context-controls__url-input-section';class Er extends Nt{['focusTracker'];['keystrokes'];['_focusables'];['focusCycler'];['urlInputField'];['backButton'];['confirmButton'];constructor(_0x2b3155){super(_0x2b3155),this['focusTracker']=new _t(),this['keystrokes']=new At(),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 Mt({'focusables':this['_focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes'],'actions':{'focusPrevious':'shift+tab','focusNext':'tab'}}),this['set']('withBackButton',!0x0),this['_setupTemplate'](),this['_setupEventHandlers'](),this['_setupKeystrokes']();}['render'](){super['render'](),this['_focusables']['forEach'](_0x1e7b2e=>{this['focusTracker']['add'](_0x1e7b2e['element']),this['keystrokes']['listenTo'](_0x1e7b2e['element']);}),Jt({'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'](_0x4836dd){this['urlInputField']['errorText']=_0x4836dd,this['_updateConfirmButtonState'](),this['fire']('refreshBalloon');}['clearError'](){this['urlInputField']['errorText']=null,this['_updateConfirmButtonState']();}['_createBackButton'](){const _0x23c110=new kt(this['locale']);return _0x23c110['set']({'icon':_0x2d78f7,'tooltip':as(this['locale'],'AI_CHAT_CONTEXT_URL_BACK_TO_CONTEXT'),'tooltipPosition':'n','class':['ck-button-icon\x20ck-button-back']}),this['on']('change:withBackButton',(_0x4e9c1f,_0x5a265c,_0x52b566)=>{_0x23c110['set']({'class':['ck-button-icon\x20ck-button-back'+(_0x52b566?'':'\x20ck-hidden')]});}),_0x23c110;}['_createUrlInputField'](){const _0x4d2b80=new Zt(this['locale'],te);return _0x4d2b80['set']({'label':as(this['locale'],'AI_CHAT_CONTEXT_URL_LABEL'),'class':'ck-labeled-field-view_empty'}),_0x4d2b80['fieldView']['set']({'placeholder':as(this['locale'],'AI_CHAT_CONTEXT_URL_PLACEHOLDER')}),_0x4d2b80;}['_createConfirmButton'](){const _0x262b54=new kt(this['locale']);return _0x262b54['set']({'icon':_0xdfeb3f,'tooltip':as(this['locale'],'AI_CHAT_CONTEXT_URL_ADD_URL'),'tooltipPosition':'n','class':'ck-button-icon','type':'submit','isEnabled':!0x1}),_0x262b54;}['_setupTemplate'](){const _0xe756e3=new _0x327048(this['locale'],{'label':as(this['locale'],'AI_CHAT_CONTEXT_URL_ADD_URL'),'class':'ck-ai-header\x20ck-ai-header_small\x20ck-ai-header_context-url'});_0xe756e3['children']['add'](this['backButton'],0x0),this['setTemplate']({'tag':'form','attributes':{'class':gr,'tabindex':'-1'},'children':[_0xe756e3,{'tag':'div','attributes':{'class':Ir},'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',_0x5afbbd=>{_0x5afbbd['stop'](),this['_handleSubmit']();});}['_setupKeystrokes'](){this['keystrokes']['set']('esc',(_0x1370ce,_0x61dba4)=>{this['clear'](),this['fire']('cancel'),_0x61dba4();});}['_handleSubmit'](){const _0x343a64=this['getValue']()['trim']();_0x343a64?this['_isValidUrl'](_0x343a64)?(this['clearError'](),this['fire']('submitUrl',_0x343a64)):this['setError'](as(this['locale'],'AI_CHAT_CONTEXT_URL_INVALID_ERROR')):this['setError'](as(this['locale'],'AI_CHAT_CONTEXT_URL_EMPTY_ERROR'));}['_updateConfirmButtonState'](){const _0x344a95=this['getValue']()['trim'](),_0x47f5e0=!!this['urlInputField']['errorText'];this['confirmButton']['isEnabled']=_0x344a95['length']>0x0&&!_0x47f5e0;}['_isValidUrl'](_0x5a634c){try{return!!new URL(_0x5a634c);}catch{return!0x1;}}}const Tr='ck-ai-chat-resources__item',pr='ck-ai-chat-resources__item--in-context',mr='ck-ai-chat-resources__item-title',Cr='ck-ai-chat-resources__item__icon';class wr extends Pt{['resource'];['_titleView'];['_iconView'];constructor(_0x2fabb9,_0x4597a5){super(_0x2fabb9),this['resource']=_0x4597a5,this['set']('isInContext',!!_0x4597a5['isInContext']),this['_titleView']=this['_createTitleView'](),this['_iconView']=this['_createIconView'](),this['_setupTemplate']();}['render'](){super['render']();}['getResourceIcon'](_0xa226db){if(_0xa226db['isInContext'])return _0xdfeb3f;switch(_0xa226db['type']){case'document':return _0x5a4ac5;case'web-resource':return _0x8b24ef;case'file':case'text':return _0x50506b;default:return _0x52ac02;}}['highlightText'](_0x4be339){if(!_0x4be339||''===_0x4be339['trim']())return void this['_titleView']['highlightText'](null);const _0x59c681=new RegExp(_0x2459a9(_0x4be339),'gi');this['_titleView']['highlightText'](_0x59c681);}['updateResourceState'](_0x4787ce){this['resource']['isInContext']=_0x4787ce,this['isInContext']=_0x4787ce,this['_updateIcon']();}['_createTitleView'](){const _0x1f977c=new _0x3526fb();return _0x1f977c['text']=this['resource']['label'],_0x1f977c['extendTemplate']({'tag':'span','attributes':{'class':[mr]}}),_0x1f977c;}['_createIconView'](){const _0xac8cdc=new yt();return _0xac8cdc['content']=this['getResourceIcon'](this['resource']),_0xac8cdc;}['_setupTemplate'](){const _0xab498f=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':[Tr,_0xab498f['if']('isVisible','ck-hidden',_0x2850ce=>!_0x2850ce),_0xab498f['if']('isInContext',pr)]},'children':[{'tag':'div','attributes':{'class':[Cr]},'children':[this['_iconView']]},this['_titleView']],'on':{'click':_0xab498f['to']('execute')}});}['_updateIcon'](){this['_iconView']['content']=this['getResourceIcon'](this['resource']);}}const fr='ck-ai-chat-resources__list';class Sr extends Lt{['_source'];constructor(_0x2a24f2,_0x48ccc0){super(_0x2a24f2),this['_source']=_0x48ccc0,this['extendTemplate']({'attributes':{'class':[fr]}});}['setResources'](_0x1c9948,_0x8a4712){this['items']['clear']();let _0x24a384=_0x1c9948;if(this['_source']['useDefaultFiltering']&&_0x8a4712&&''!==_0x8a4712['trim']()){const _0x3b0999=new RegExp(_0x8a4712['replace'](/[.*+?^${}()|[\]\\]/g,'\x5c$&'),'gi');_0x24a384=_0x1c9948['filter'](_0x787a4c=>_0x3b0999['test'](_0x787a4c['label']));}for(const _0x345ccc of _0x24a384){const _0x1d3468=new wr(this['locale'],_0x345ccc);_0x1d3468['on']('execute',()=>{this['_handleResourceSelection'](this['_source'],_0x345ccc);}),this['items']['add'](_0x1d3468);}this['_source']['useDefaultFiltering']&&this['highlightText'](_0x8a4712);}['highlightText'](_0xed256b){this['_source']['useDefaultFiltering']&&this['items']['forEach'](_0x3b7387=>{_0x3b7387['highlightText'](_0xed256b);});}['updateResourceState'](_0x121990,_0x33cab8){for(const _0x8aacfe of this['items']){const _0x2241fe=_0x8aacfe;_0x2241fe['resource']['id']===_0x121990&&_0x2241fe['updateResourceState'](_0x33cab8);}}['_handleResourceSelection'](_0x50564f,_0x5a1898){this['fire']('addResourceToContext',{'source':_0x50564f,'resource':_0x5a1898});}}class br extends Zt{['iconView'];['resetButtonView'];['_viewConfig'];constructor(_0xd4a1ca){const t=_0xd4a1ca['t'],_0x579c94={'showResetButton':!0x0,'showIcon':!0x0,'creator':te,'label':as(_0xd4a1ca,'AI_CHAT_SEARCH_RESOURCES')};super(_0xd4a1ca,_0x579c94['creator']),this['label']=_0x579c94['label'],this['_viewConfig']=_0x579c94,this['_viewConfig']['showIcon']&&this['_setupSearchIcon'](),this['_viewConfig']['showResetButton']&&this['_setupResetButton'](_0xd4a1ca,t),this['_setupEventListeners']();}['reset'](){this['fieldView']['reset'](),this['_viewConfig']['showResetButton']&&this['resetButtonView']&&(this['resetButtonView']['isVisible']=!0x1),this['search']('');}['search'](_0x595b49){this['fire']('search',_0x595b49);}['getQuery'](){return this['fieldView']['element']?.['value']||'';}['_setupSearchIcon'](){this['iconView']=new yt(),this['iconView']['content']=_0x1cd5f4,this['fieldWrapperChildren']['add'](this['iconView'],0x0),this['extendTemplate']({'attributes':{'class':'ck-search__query_with-icon'}});}['_setupResetButton'](_0x47e83c,t){this['resetButtonView']=new kt(_0x47e83c),this['resetButtonView']['set']({'label':t('Clear'),'icon':_0x340c21,'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',_0x1424cb=>!_0x1424cb),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 Rr extends Nt{['_searchView'];['_searchSection'];['_searchInputVisibleFrom'];['_resourcesListView'];['_skeletonLoader'];['_source'];['children'];['_latestLoadResourcesUid']=null;constructor(_0x20f40c,_0x3d0d21){super(_0x20f40c),this['_source']=_0x3d0d21['source'],this['_searchInputVisibleFrom']=_0x3d0d21['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 _0xfc7125([this['_skeletonLoader'],this['_resourcesListView']]),this['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-chat-resources'},'children':this['children']});}['_createSearchView'](){return new br(this['locale']);}['_createSearchSection'](){const _0x5a0892=new Nt(this['locale']);return _0x5a0892['setTemplate']({'tag':'div','attributes':{'class':'ck\x20ck-search'},'children':[this['_searchView']]}),this['_searchView']['on']('search',(_0x5071a8,_0x37b6be)=>{this['loadResources'](_0x37b6be),this['_source']['useDefaultFiltering']&&this['_resourcesListView']['highlightText'](_0x37b6be);}),_0x5a0892;}['_createResourcesListView'](){const _0x417791=new Sr(this['locale'],this['_source']);return _0x417791['delegate']('addResourceToContext')['to'](this),_0x417791['extendTemplate']({'attributes':{'class':this['bindTemplate']['if']('isLoading','ck-hidden')}}),_0x417791;}['_createSkeletonView'](){const _0x435f9b=new zn(this['locale'],jn['aiChatResources']);return _0x435f9b['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isLoading','ck-hidden',_0x26a6c4=>!_0x26a6c4)]}}),_0x435f9b;}['render'](){super['render'](),this['loadResources']('');}['loadResources'](_0x4d7031){const _0x4a9529=at();this['_latestLoadResourcesUid']=_0x4a9529,this['fire']('loadSourceResources',{'sourceId':this['_source']['id'],'query':_0x4d7031,'uid':_0x4a9529}),this['isLoading']=!0x0;}['setResources'](_0x1a1014,_0x211c11){if(_0x211c11&&_0x211c11!==this['_latestLoadResourcesUid'])return;const _0x51e90a=this['_source']['useDefaultFiltering']?this['_searchView']['getQuery']():'';this['_resourcesListView']['setResources'](_0x1a1014,_0x51e90a),_0x1a1014['length']>=this['_searchInputVisibleFrom']&&!this['children']['has'](this['_searchSection'])&&this['children']['add'](this['_searchSection'],0x0),requestAnimationFrame(()=>{this['isLoading']=!0x1;});}['updateResourceState'](_0x56e788,_0x369c62){this['_resourcesListView']['updateResourceState'](_0x56e788,_0x369c62);}}const Or='ck-ai-chat-context-controls__source-balloon-panel',kr='ck-button-icon\x20ck-button-back',Nr='ck-ai-header\x20ck-ai-header_small\x20ck-ai-header_source';class vr{['_sourceResourceBalloons']=new Map();['_bodyCollection'];['_locale'];['_config'];constructor(_0x1e0573,_0x1f5930,_0x290f01){this['_locale']=_0x1e0573,this['_bodyCollection']=_0x1f5930,this['_config']=_0x290f01;}['showSourceResourcesBalloon']({source:_0x55dad1,withBackButton:_0x4f70fd}){let _0x397be7=this['_sourceResourceBalloons']['get'](_0x55dad1['id']);_0x397be7||(_0x397be7=this['_createSourceResourceBalloonPanel'](),this['_sourceResourceBalloons']['set'](_0x55dad1['id'],_0x397be7),this['_setupSingleResourceBalloonClickOutsideHandler'](_0x397be7)),this['_addSourceResourceContent']({'balloonPanel':_0x397be7,'source':_0x55dad1,'withBackButton':_0x4f70fd}),_0x397be7['show']();const _0x33b2a8=this['_config']['getTargetElement']();_0x33b2a8&&_0x397be7['pin']({'target':_0x33b2a8,'limiter':this['_config']['getLimiterElement']()});}['populateSourceResourceBalloon'](_0x4ab8b5,_0x493f09,_0x43420c){const _0x14747f=this['_sourceResourceBalloons']['get'](_0x4ab8b5);if(!_0x14747f)return;const _0x277e4a=this['_getResourcesViewFromBalloon'](_0x14747f);_0x277e4a&&(_0x277e4a['setResources'](_0x493f09,_0x43420c),_0x277e4a['once']('change:isLoading',()=>{_0x14747f['pin']({'target':this['_config']['getTargetElement'](),'limiter':this['_config']['getLimiterElement']()});}));}['closeSourceResourceBalloon'](_0x586723){const _0x241280=this['_sourceResourceBalloons']['get'](_0x586723);_0x241280&&requestAnimationFrame(()=>{_0x241280['hide'](),this['_sourceResourceBalloons']['delete'](_0x586723),this['_config']['onBalloonClosed']();});}['isAnyResourceBalloonVisible'](){for(const _0x532cef of this['_sourceResourceBalloons']['values']())if(_0x532cef['isVisible'])return!0x0;return!0x1;}['updateResourceState'](_0x67b4ac,_0x3b4a48,_0x2a486b){const _0xe6f34b=this['_sourceResourceBalloons']['get'](_0x67b4ac);if(!_0xe6f34b||!_0xe6f34b['isVisible'])return;const _0x5f1bb5=this['_config']['getTargetElement']();if(!_0x5f1bb5)return;_0xe6f34b['pin']({'target':_0x5f1bb5,'limiter':this['_config']['getLimiterElement']()});const _0x3c641c=this['_getResourcesViewFromBalloon'](_0xe6f34b);_0x3c641c&&_0x3c641c['updateResourceState'](_0x3b4a48,_0x2a486b);}['destroy'](){for(const _0x1fa9ee of this['_sourceResourceBalloons']['values']())_0x1fa9ee['destroy']();this['_sourceResourceBalloons']['clear']();}['_createSourceResourceBalloonPanel'](){const _0x1938f8=new Qt(this['_locale']);return _0x1938f8['extendTemplate']({'attributes':{'class':Or}}),this['_bodyCollection']['add'](_0x1938f8),_0x1938f8;}['_addSourceResourceContent']({balloonPanel:_0x4e36ad,source:_0x26f06a,withBackButton:_0x421fa3}){_0x4e36ad['content']['clear']();const _0x14a18e=this['_createBalloonHeader']({'balloonPanel':_0x4e36ad,'source':_0x26f06a,'withBackButton':_0x421fa3});_0x4e36ad['content']['add'](_0x14a18e);const _0x8153b1=this['_createBalloonResourcesView'](_0x26f06a);_0x4e36ad['content']['add'](_0x8153b1);}['_createBalloonHeader']({balloonPanel:_0x285c19,source:_0x3b7fd6,withBackButton:_0x2602c4}){const _0x385ae9=new _0x327048(this['_locale'],{'label':_0x3b7fd6['label'],'class':Nr});return _0x2602c4&&_0x385ae9['children']['add'](this['_createBackButton'](_0x285c19),0x0),_0x385ae9;}['_createBackButton'](_0x4fe146){const _0x51d07e=new kt(this['_locale']);return _0x51d07e['set']({'icon':_0x2d78f7,'tooltip':as(this['_locale'],'AI_CHAT_CONTEXT_URL_BACK_TO_CONTEXT'),'tooltipPosition':'n','class':kr}),_0x51d07e['on']('execute',()=>{_0x4fe146['hide'](),this['_config']['onBackToContext']();}),_0x51d07e;}['_createBalloonResourcesView'](_0x34e0b4){const _0x4f902f=new Rr(this['_locale'],{'source':_0x34e0b4,'searchInputVisibleFrom':this['_config']['searchInputVisibleFrom']});return _0x4f902f['on']('loadSourceResources',(_0x1b2f6e,_0x45f05a)=>{this['_config']['onLoadSourceResources'](_0x45f05a);}),_0x4f902f['on']('addResourceToContext',(_0x311efb,_0x4f24e0)=>{this['_config']['onResourceSelected'](_0x4f24e0['source'],_0x4f24e0['resource']),this['closeSourceResourceBalloon'](_0x34e0b4['id']);}),_0x4f902f;}['_getResourcesViewFromBalloon'](_0x158426){const _0x56e4fe=_0x158426['content']['get'](0x1);return _0x56e4fe instanceof Rr?_0x56e4fe:null;}['_setupSingleResourceBalloonClickOutsideHandler'](_0x5e4cfd){Xt({'emitter':_0x5e4cfd,'contextElements':[_0x5e4cfd['element']],'callback':()=>{_0x5e4cfd['hide'](),this['_config']['onBalloonClosed']();},'activator':()=>_0x5e4cfd['isVisible']});}}const yr=['addDocumentToContext','addFileToContext','addUrlToContext','addResourceToContext','removeContextItem','loadSourceResources','executeCustomItemCallback'],xr='ck-ai-chat-context-controls',Lr='ck-ai-chat-context-controls__pending-contexts',Dr='ck-ai-chat-context-controls__add-context-balloon-panel',Pr='ck-ai-chat-context-controls__add-context-button',Hr='ck-ai-chat-context-controls__url-balloon-panel',Mr='ck-ai-chat-context-controls__balloon-button',Ur='ck-ai-chat-context-controls__balloon-button-source',Vr='ck-ai-chat-controls-button',Br='ck-ai-chat-context-chips-wrapper-balloon',Gr='ck-ai-chat-controls_context_show-more-button',Fr='ck-ai-chat-context-controls__show-more-balloon-panel',Kr='ck-ai-chat',Wr=[Qt['defaultPositions']['northArrowSouthWest'],Qt['defaultPositions']['northArrowSouth'],Qt['defaultPositions']['northArrowSouthEast'],Qt['defaultPositions']['southArrowNorthWest'],Qt['defaultPositions']['southArrowNorth'],Qt['defaultPositions']['southArrowNorthEast']];class Yr extends Nt{['addContextButtonView'];['_currentContextsChips']=this['createCollection']();['_conversationContextsChips']=this['createCollection']();['_overflowManager'];['_addContextBalloonPanelView'];['_urlBalloonPanelView'];['_urlInputView'];['_resourcesBalloonView'];['_addContextBalloonConfig'];['_hasExactlyOneSource']=!0x1;['bodyCollection'];constructor(_0x1be3f1,_0x2665d7){super(_0x1be3f1),this['bodyCollection']=_0x2665d7['bodyCollection'],this['_currentContextsChips']=this['createCollection'](),this['_conversationContextsChips']=this['createCollection'](),this['addContextButtonView']=this['_createAddContextButtonView'](_0x1be3f1),this['_addContextBalloonPanelView']=this['_createAddContextBalloonPanelView'](_0x1be3f1),this['_urlBalloonPanelView']=this['_createUrlBalloonPanelView'](_0x1be3f1),this['_resourcesBalloonView']=this['_createResourcesBalloonView'](_0x1be3f1,_0x2665d7);const _0x4cf9e7={'cssClasses':{'showMoreButton':Gr+'\x20'+cs,'showMoreBalloon':Fr,'overflowContainer':Br,'controlsButton':Vr}};this['_overflowManager']=new Hn(_0x1be3f1,this['_currentContextsChips'],_0x4cf9e7,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'](_0x2d2cdc,_0x3bd488){const _0x49d699=this['_createContextButton'](_0x2d2cdc,'current',!0x0,_0x3bd488);this['_addContextToCollection'](_0x49d699,this['_currentContextsChips']),this['_overflowManager']['reorganizeChips']();}['removeContextItem'](_0x1870e2){this['_removeContextFromCollection'](_0x1870e2,this['_currentContextsChips']),this['_removeContextFromCollection'](_0x1870e2,this['_overflowManager']['overflowChips']),this['_overflowManager']['reorganizeChips']();}['setContextItemLoading'](_0x3e9911,_0x33b3e0){let _0x297032=this['_currentContextsChips']['find'](_0x221b30=>_0x221b30['id']===_0x3e9911);_0x297032||(_0x297032=this['_overflowManager']['overflowChips']['find'](_0x150767=>_0x150767['id']===_0x3e9911)),_0x297032&&(_0x297032['isLoading']=_0x33b3e0);}['setConversationContext'](_0x55e044){this['_conversationContextsChips']['clear']();for(const _0x50519f of _0x55e044){const _0x1c558f=this['_createContextButton'](_0x50519f,'conversation',!0x1,!0x1);this['_addContextToCollection'](_0x1c558f,this['_conversationContextsChips']);}}['clearCurrentContextItems'](){this['_currentContextsChips']['clear'](),this['_overflowManager']['clear']();}['clearConversationContextItems'](){this['_conversationContextsChips']['clear']();}['updateResourceState'](_0x20dc87,_0x58346a,_0x9fe97){this['_resourcesBalloonView']['updateResourceState'](_0x20dc87,_0x58346a,_0x9fe97);}['hideAddContextBalloonPanel'](){this['_toggleAddContextBalloon'](!0x1);}['showAddContextBalloonPanel'](){this['_toggleAddContextBalloon'](!0x0);}['hideUrlBalloonPanel'](){this['_urlBalloonPanelView']['hide'](),this['addContextButtonView']['isOn']=!0x1,this['_urlInputView']&&this['_urlInputView']['clear']();}['showUrlBalloonPanel'](){this['_urlBalloonPanelView']['show'](),this['addContextButtonView']['isOn']=!0x0;}['_showSourceResourcesBalloon']({source:_0xba294f,withBackButton:_0xbb10d5}){this['_resourcesBalloonView']['showSourceResourcesBalloon']({'source':_0xba294f,'withBackButton':_0xbb10d5}),this['addContextButtonView']['isOn']=!0x0;}['populateSourceResourceBalloon'](_0x5b9eee,_0x1836ef,_0x38ae2a,_0x58dffb){this['_resourcesBalloonView']['populateSourceResourceBalloon'](_0x5b9eee,_0x38ae2a,_0x58dffb);}['closeSourceResourceBalloon'](_0x48c2bf){this['_resourcesBalloonView']['closeSourceResourceBalloon'](_0x48c2bf),this['addContextButtonView']['isOn']=!0x1;}['setAddContextOptions'](_0xbe6f74){this['_setBalloonPanelContent'](this['_addContextBalloonPanelView'],this['locale'],_0xbe6f74),this['_setAddContextButtonEnabled'](_0xbe6f74);}['_setAddContextButtonEnabled'](_0x1a6a30){const _0x21cab3=!_0x1a6a30['document']['isHidden']&&_0x1a6a30['document']['enabled'],_0x12c204=_0x1a6a30['urls']['enabled'],_0x5cdee3=_0x1a6a30['files']['enabled'],_0x2bb71a=_0x1a6a30['sources']['length']>0x0,_0x515b48=_0x1a6a30['customItems']&&_0x1a6a30['customItems']['length']>0x0;this['addContextButtonView']['isEnabled']=_0x21cab3||_0x12c204||_0x5cdee3||_0x2bb71a||_0x515b48;}['_setupTemplate'](){this['setTemplate']({'tag':'div','attributes':{'class':[xr,'ck-reset_all-excluded']},'children':[{'tag':'div','attributes':{'class':Lr},'children':this['_currentContextsChips']}]});}['_bindEventHandlers'](){this['addContextButtonView']['on']('execute',()=>{this['_handleAddContextButtonClick']();});}['_createAddContextButtonView'](_0x367071){const _0x2355d3=new kt(_0x367071);return _0x2355d3['set']({'label':as(_0x367071,'AI_CHAT_CONTEXT_ADD_CONTEXT'),'class':Vr+'\x20'+Pr+'\x20'+cs,'icon':_0xf9d5dc,'isToggleable':!0x0,'tooltip':!0x0,'tooltipPosition':'sw'}),_0x2355d3;}['_createAddContextBalloonPanelView'](_0x18ab12){return this['_createBaseBalloonPanel'](_0x18ab12,Dr);}['_createUrlBalloonPanelView'](_0x1a07d8){const _0x2c9fd1=this['_createBaseBalloonPanel'](_0x1a07d8,Hr);return this['_addUrlContent'](_0x2c9fd1,_0x1a07d8),_0x2c9fd1;}['_createResourcesBalloonView'](_0x533483,_0x40387f){const _0x3c7761={'searchInputVisibleFrom':_0x40387f['searchInputVisibleFrom'],'onBackToContext':()=>{this['showAddContextBalloonPanel'](),this['_addContextBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':Wr});},'onResourceSelected':(_0x3d382e,_0x219967)=>{this['fire']('addResourceToContext',{'source':_0x3d382e,'resource':_0x219967});},'onLoadSourceResources':_0x164ab8=>{this['fire']('loadSourceResources',_0x164ab8);},'onBalloonClosed':()=>{this['addContextButtonView']['isOn']=!0x1;},'getLimiterElement':()=>this['_getLimiterElement'](),'getTargetElement':()=>this['addContextButtonView']['element']};return new vr(_0x533483,_0x40387f['bodyCollection'],_0x3c7761);}['_getLimiterElement'](){return this['element']?.['closest']('.'+Kr)||document['body'];}['_createBaseBalloonPanel'](_0x4937fb,_0x3f2517){const _0x30e2b1=new Qt(_0x4937fb);return _0x30e2b1['extendTemplate']({'attributes':{'class':_0x3f2517}}),this['bodyCollection']['add'](_0x30e2b1),_0x30e2b1;}['_setBalloonPanelContent'](_0x1035da,_0x1c4b5a,_0x2f6496){if(_0x1035da['content']['clear'](),!_0x2f6496['document']['isHidden']&&_0x2f6496['document']['enabled']){const _0x1a0682=this['_createBalloonButton'](_0x1c4b5a,{'label':as(_0x1c4b5a,'AI_CHAT_CONTEXT_CURRENT_DOCUMENT'),'icon':_0x5a4ac5});_0x1a0682['on']('execute',()=>{this['fire']('addDocumentToContext'),this['hideAddContextBalloonPanel']();}),_0x1035da['content']['add'](_0x1a0682);}if(_0x2f6496['urls']['enabled']){const _0x2309af=this['_createBalloonButton'](_0x1c4b5a,{'label':as(_0x1c4b5a,'AI_CHAT_CONTEXT_URL_LABEL'),'icon':_0x8b24ef});_0x2309af['on']('execute',()=>{this['hideAddContextBalloonPanel'](),this['showUrlBalloonPanel'](),this['_urlBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':Wr}),this['_urlInputView']['focus']();}),_0x1035da['content']['add'](_0x2309af);}if(_0x2f6496['files']['enabled']){const _0x3c6bb5=new _0xb44213(_0x1c4b5a);_0x3c6bb5['set']({'label':as(_0x1c4b5a,'AI_CHAT_CONTEXT_FILE_LABEL'),'icon':_0x54f84d,'withText':!0x0,'tooltip':!0x0,'class':Mr,'allowMultipleFiles':!0x0}),_0x3c6bb5['on']('execute',()=>{this['hideAddContextBalloonPanel']();}),_0x3c6bb5['on']('done',(_0x4a59a1,_0x40a676)=>{this['fire']('addFileToContext',_0x40a676);}),_0x3c6bb5['tooltip']=!0x0,_0x1035da['content']['add'](_0x3c6bb5);}for(const _0x324e2f of _0x2f6496['sources']){const _0x5e0026=this['_createBalloonButton'](_0x1c4b5a,{'label':_0x324e2f['label'],'icon':_0x324e2f['icon']||_0x52ac02,'type':'source'});_0x1035da['content']['add'](_0x5e0026),_0x5e0026['on']('execute',()=>{this['hideAddContextBalloonPanel'](),this['_showSourceResourcesBalloon']({'source':_0x324e2f,'withBackButton':!this['_hasExactlyOneSource']});});}for(const _0x4569e6 of _0x2f6496['customItems']||[]){const _0x7c2669=this['_createBalloonButton'](_0x1c4b5a,{'label':_0x4569e6['label'],'icon':_0x4569e6['icon']||_0x52ac02,'type':'customItem'});_0x1035da['content']['add'](_0x7c2669),_0x7c2669['on']('execute',()=>{this['hideAddContextBalloonPanel'](),this['fire']('executeCustomItemCallback',_0x4569e6);});}this['_hasExactlyOneSource']=0x1===_0x1035da['content']['length'],this['_urlInputView']['withBackButton']=!this['_hasExactlyOneSource'];}['_addUrlContent'](_0x4b2709,_0x44d766){this['_urlInputView']=new Er(_0x44d766),this['_urlInputView']['on']('submitUrl',(_0x5f56ea,_0x393daf)=>{this['_handleUrlSubmit'](_0x393daf);}),this['_urlInputView']['on']('cancel',()=>{this['hideUrlBalloonPanel'](),this['_hasExactlyOneSource']||(this['showAddContextBalloonPanel'](),this['_addContextBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':Wr}));}),this['_urlInputView']['on']('refreshBalloon',()=>{this['_urlBalloonPanelView']['isVisible']&&this['_urlBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':Wr});}),_0x4b2709['content']['add'](this['_urlInputView']);}['_createBalloonButton'](_0x45d72d,_0x4b7ab0){const _0x1255d9='source'===_0x4b7ab0['type']?new $r(_0x45d72d):new kt(_0x45d72d);return _0x1255d9['set']({'label':_0x4b7ab0['label'],'icon':_0x4b7ab0['icon'],'withText':!0x0,'tooltip':!0x0,'tooltipPosition':'sw','class':Mr}),_0x1255d9;}['_setupAllBalloonClickOutsideHandlers'](){this['_setupAddContextBalloonClickOutsideHandler'](),this['_setupUrlBalloonClickOutsideHandler']();}['_setupUrlBalloonClickOutsideHandler'](){Xt({'emitter':this['_urlBalloonPanelView'],'contextElements':[this['_urlBalloonPanelView']['element']],'callback':()=>{this['hideUrlBalloonPanel']();},'activator':()=>this['_urlBalloonPanelView']['isVisible']});}['_toggleAddContextBalloon'](_0x56b918){const _0x42feee=this['_addContextBalloonConfig'];_0x42feee['buttonView']['isOn']=_0x56b918,_0x56b918?_0x42feee['balloonView']['show']():_0x42feee['balloonView']['hide']();}['_setupAddContextBalloonClickOutsideHandler'](){const {balloonView:_0x20d072,buttonView:_0x46948a,hideMethod:_0x40eb3b}=this['_addContextBalloonConfig'];Xt({'emitter':_0x20d072,'contextElements':[_0x20d072['element'],_0x46948a['element']],'callback':()=>{_0x40eb3b();},'activator':()=>_0x46948a['isOn']&&!this['_urlBalloonPanelView']['isVisible']&&!this['_resourcesBalloonView']['isAnyResourceBalloonVisible']()});}['_createContextButton'](_0x5d7d18,_0xef2eb6,_0x59a4ec=!0x1,_0x3a4872=!0x1){const _0x4e6fc3='conversation'===_0xef2eb6||!0x0===_0x5d7d18['isReadOnly'],_0x40110f=new xn(this['locale'],_0x5d7d18,_0x4e6fc3,_0x59a4ec,_0x3a4872);return _0x4e6fc3||_0x40110f['on']('removeContextItemChip',()=>{this['fire']('removeContextItem',_0x40110f['id']);}),_0x40110f;}['_addContextToCollection'](_0x13761f,_0x23b688){_0x23b688['add'](_0x13761f,0x0);}['_removeContextFromCollection'](_0x21460d,_0x47c38e){const _0x11d7a7=_0x47c38e['find'](_0x1b3726=>_0x1b3726['id']===_0x21460d);_0x11d7a7&&_0x47c38e['remove'](_0x11d7a7);}['_handleAddContextButtonClick'](){this['addContextButtonView']['isOn']?this['hideAddContextBalloonPanel']():(this['showAddContextBalloonPanel'](),this['_addContextBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':Wr}),this['_hasExactlyOneSource']&&this['_addContextBalloonPanelView']['content']['get'](0x0)?.['fire']('execute'));}['_handleUrlSubmit'](_0x29a8fd){this['_urlInputView']['clear'](),this['hideUrlBalloonPanel'](),this['fire']('addUrlToContext',_0x29a8fd);}}class $r extends kt{['arrowView'];constructor(_0xdb8f70){super(_0xdb8f70),this['set']({'withText':!0x0,'role':'menuitem'}),this['arrowView']=this['_createArrowView'](),this['extendTemplate']({'attributes':{'class':[Ur]}});}['render'](){super['render'](),this['children']['add'](this['arrowView']);}['_createArrowView'](){const _0x395d64=new yt();return _0x395d64['content']=_0x25d1ac,_0x395d64['extendTemplate']({'attributes':{'class':Ur+'__arrow'}}),_0x395d64;}}class qr extends Nt{['_cancelButtonView'];['_loaderView'];constructor(_0x1d8eb9){super(_0x1d8eb9),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 _0x2d7adb=new kt(this['locale']);return _0x2d7adb['set']({'label':as(this['locale'],'AI_CHAT_STOP_GENERATING'),'withText':!0x0,'class':hs+'\x20ck-ai-button-stop-generating','icon':_0x22b394}),_0x2d7adb['on']('execute',()=>{this['fire']('abortPromptStream');}),_0x2d7adb;}['_createLoaderView'](){const _0x1536c6=new Nt(this['locale']);return _0x1536c6['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':as(this['locale'],'AI_CHAT_IS_WRITING')}]}),_0x1536c6;}}class Qr extends Nt{['_contextPanelView'];['_promptInputView'];['_promptCapabilitiesView'];['_loaderView'];['_modelUnavailableMessageView'];['_shouldRestorePromptInputFocus'];constructor(_0x36b568,_0xc5dd9d){super(_0x36b568),this['_contextPanelView']=this['_createContextPanelView'](_0x36b568,{'bodyCollection':_0xc5dd9d['bodyCollection'],'searchInputVisibleFrom':_0xc5dd9d['contextResourcesSearchInputVisibleFrom']}),this['_promptInputView']=this['_createPromptInputView'](_0x36b568),this['_promptCapabilitiesView']=this['_createPromptCapabilitiesView'](_0x36b568),this['_loaderView']=this['_createLoaderView'](_0x36b568),this['_modelUnavailableMessageView']=this['_createModelUnavailableMessageView'](_0x36b568),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'](...yr)['to'](this),this['set']('isModelAvailable',!0x0),this['set']('isDisabled',!0x1);const _0x51737d=this['bindTemplate'];this['setTemplate']({'tag':'form','attributes':{'class':['ck','ck-ai-chat-controls',_0x51737d['if']('isDisabled','ck-ai-chat-controls-disabled')]},'children':[{'tag':'div','attributes':{'class':[_0x51737d['if']('isLoading','ck-hidden',_0x54f398=>_0x54f398||!this['isModelAvailable']),_0x51737d['if']('isModelAvailable','ck-hidden',_0x2db93a=>!_0x2db93a||this['isLoading'])]},'children':[this['_contextPanelView'],this['_promptInputView'],this['_promptCapabilitiesView']]},{'tag':'div','attributes':{'class':[_0x51737d['if']('isLoading','ck-hidden',_0xaa8884=>!_0xaa8884)]},'children':[this['_loaderView']]},{'tag':'div','attributes':{'class':[_0x51737d['if']('isModelAvailable','ck-hidden',_0x122f7c=>_0x122f7c)]},'children':[this['_modelUnavailableMessageView']]}]}),Xt({'emitter':this['_promptInputView'],'activator':()=>this['isLoading'],'contextElements':()=>[this['element']],'callback':()=>{this['_shouldRestorePromptInputFocus']=!0x1;}}),this['on']('change:isLoading',this['_handlePromptInputFocus'],{'priority':'low'});}['_createContextPanelView'](_0x5c49f7,_0x2e639b){return new Yr(_0x5c49f7,_0x2e639b);}['_createPromptInputView'](_0x476406){return new sr(_0x476406,this['_contextPanelView']['addContextButtonView']);}['_createPromptCapabilitiesView'](_0x21a9fe){return new dr(_0x21a9fe);}['_createLoaderView'](_0x3777bb){return new qr(_0x3777bb);}['_createModelUnavailableMessageView'](_0x527e13){const _0x559a38=new Xr(_0x527e13);return _0x559a38['delegate']('startConversation')['to'](this),_0x559a38;}['_handlePromptInputFocus'](_0x3fcbc8,_0x772f74,_0x1b0bf7){_0x1b0bf7?this['_shouldRestorePromptInputFocus']=!0x0:this['_shouldRestorePromptInputFocus']&&this['_promptInputView']['focus']();}['addContextItem'](_0x47d569,_0x56fd86){this['_contextPanelView']['addContextItem'](_0x47d569,_0x56fd86);}['removeContextItem'](_0x2f9ad2){this['_contextPanelView']['removeContextItem'](_0x2f9ad2);}['setContextItemLoading'](_0x3d60e5,_0x1c75e8){this['_contextPanelView']['setContextItemLoading'](_0x3d60e5,_0x1c75e8);}['setIsUploadInProgress'](_0x23b312){this['_promptInputView']['setIsUploadInProgress'](_0x23b312);}['setConversationContext'](_0x488752){this['_contextPanelView']['setConversationContext'](_0x488752);}['clearPendingContextUI'](){this['_contextPanelView']['clearCurrentContextItems']();}['clearConversationContextUI'](){this['_contextPanelView']['clearConversationContextItems']();}['updateResourceState'](_0x21eab1,_0x2a0259,_0x33333c){this['_contextPanelView']['updateResourceState'](_0x21eab1,_0x2a0259,_0x33333c);}['setWebSearch'](_0x1923fb){this['_promptCapabilitiesView']['setWebSearch'](_0x1923fb);}['setReasoning'](_0x56922d){this['_promptCapabilitiesView']['setReasoning'](_0x56922d);}['resetMessageInput'](){this['_promptInputView']['reset']();}['setAddContextOptions'](_0x526ec2){this['_contextPanelView']['setAddContextOptions'](_0x526ec2);}['setInputPlaceholder'](_0x51ead7){this['_promptInputView']['setPlaceholderText'](_0x51ead7);}['setModelList'](_0x589652,_0x38c2e2){this['_promptCapabilitiesView']['setModelList'](_0x589652,_0x38c2e2);}['setModel'](_0x3212ec){_0x3212ec?(this['isModelAvailable']=!0x0,this['_promptCapabilitiesView']['setModel'](_0x3212ec)):this['isModelAvailable']=!0x1;}['enableModelSelector'](){this['_promptCapabilitiesView']['enableModelSelector']();}['disableModelSelector'](_0x3c6274){this['_promptCapabilitiesView']['disableModelSelector'](_0x3c6274);}['populateSourceResourceBalloon'](_0x234bdd,_0x29524d,_0x4f3126,_0x3fb034){this['_contextPanelView']['populateSourceResourceBalloon'](_0x234bdd,_0x29524d,_0x4f3126,_0x3fb034);}['closeSourceResourceBalloon'](_0x23a02e){this['_contextPanelView']['closeSourceResourceBalloon'](_0x23a02e);}['focusPromptInput'](_0x2308f2=!0x1){this['_promptInputView']['focus'](_0x2308f2);}['setPromptInputValue'](_0xcb8020){this['_promptInputView']['queryView']['fieldView']['reset'](),this['_promptInputView']['queryView']['fieldView']['value']=_0xcb8020;}}class Xr extends Nt{constructor(_0x7daa33){super(_0x7daa33);const _0x232f05=new kt(_0x7daa33);_0x232f05['set']({'label':as(this['locale'],'AI_CHAT_MODEL_UNAVAILABLE_MESSAGE_BUTTON'),'withText':!0x0,'class':['ck-ai-chat-controls__start-new-chat-button'],'tooltip':''}),_0x232f05['delegate']('execute')['to'](this,'startConversation'),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat-controls-model-unavailable-message']},'children':[{'tag':'p','children':[{'text':as(this['locale'],'AI_CHAT_MODEL_UNAVAILABLE_MESSAGE_TEXT')+'\x20'},_0x232f05]}]});}}class zr extends _0x327048{['conversationStartButton'];['resizeButton'];constructor(_0x49be03,_0x2be34){super(_0x49be03,{'label':as(_0x49be03,'AI_CHAT_HEADING'),'class':'ck-ai-header\x20ck-ai-header_chat','icon':_0x4666f3}),this['set']('isMaximized',!0x1),this['conversationStartButton']=this['_createStartConversationButton'](_0x49be03),this['children']['add'](this['conversationStartButton']),_0x2be34&&(this['resizeButton']=ls(_0x49be03,this),this['children']['add'](this['resizeButton']));}['_createStartConversationButton'](_0x26153b){const _0x1beae1=new kt(_0x26153b);return _0x1beae1['set']({'label':as(this['locale'],'AI_CHAT_LABEL_NEW_CHAT'),'withText':!0x0,'icon':_0x5a6582,'class':'ck-ai-chat__start-conversation\x20'+hs}),_0x1beae1['on']('execute',()=>{this['fire']('startConversation');}),_0x1beae1;}}class jr extends Nt{constructor(_0x5d1a81){super(_0x5d1a81),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-disclaimer']},'children':[{'tag':'p','attributes':{'class':['ck','ck-ai-disclaimer__content']},'children':[{'text':as(_0x5d1a81,'AI_DISCLAIMER_TEXT')}]}]});}}class Jr extends Nt{['chatHeader'];['chatFeed'];['chatControls'];['chatDisclaimer'];['_bodyCollection'];constructor(_0x3594b7,_0x23d17d){super(_0x3594b7),this['_bodyCollection']=new qt(_0x3594b7),this['_bodyCollection']['attachToDom'](),this['chatHeader']=new zr(_0x3594b7,_0x23d17d['showResizeButton']),this['chatHeader']['delegate'](...Xs)['to'](this),this['chatFeed']=new tr(_0x3594b7,this['_bodyCollection']),this['chatFeed']['delegate'](...Xs)['to'](this),this['chatControls']=new Qr(_0x3594b7,{'bodyCollection':this['_bodyCollection'],'contextResourcesSearchInputVisibleFrom':_0x23d17d['contextResourcesSearchInputVisibleFrom']}),this['chatControls']['delegate'](...Xs)['to'](this),this['chatDisclaimer']=new jr(_0x3594b7),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-ai-chat','ck-rounded-corners'],'dir':_0x3594b7['uiLanguageDirection']},'children':[this['chatHeader'],this['chatFeed'],this['chatControls'],this['chatDisclaimer']]});}['populateSourceResourceBalloon'](_0x4f230,_0x2a00b8,_0x47185c,_0x5246a1){this['chatControls']['populateSourceResourceBalloon'](_0x4f230,_0x2a00b8,_0x47185c,_0x5246a1);}['closeSourceResourceBalloon'](_0x54b7c1){this['chatControls']['closeSourceResourceBalloon'](_0x54b7c1);}['destroy'](){this['_bodyCollection']['detachFromDom'](),super['destroy']();}}class Zr extends _0x314798{static get['requires'](){return[ns];}['_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(_0x15b9b1){super(_0x15b9b1);const _0x30909c=this['context']['plugins']['get']('AITabs');this['set']('isBusy',!0x1),this['_promiseQueue']=new _n(),this['_view']=new Jr(this['context']['locale'],{'showResizeButton':_0x30909c['showResizeButton'],'contextResourcesSearchInputVisibleFrom':this['context']['config']['get']('ai.chat.context.searchInputVisibleFrom')}),this['_view']['delegate'](...Xs)['to'](this),this['_view']['on']('toggleSuggestionDisplayMode',(_0xb50dc2,{showDiff:_0x146cb2})=>{this['showDiff']=_0x146cb2;}),_0x30909c['view']['addTab']({'id':'chat','buttonLabel':as(this['context']['locale'],'AI_CHAT_HEADING'),'buttonIcon':_0x4666f3,'order':0x0,'content':this['_view']}),this['_view']['chatControls']['bind']('isLoading')['to'](this,'isBusy',_0x40dea6=>_0x40dea6),this['_view']['chatFeed']['bind']('isPending')['to'](this,'isBusy',_0x21e62a=>_0x21e62a),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder']()),this['bind']('isModelAvailable')['to'](this['_view']['chatControls'],'isModelAvailable');}['destroy'](){super['destroy'](),this['_titleAnimationInterval']&&clearInterval(this['_titleAnimationInterval']);}['createConversation'](_0x37bb67){const _0x68e95f=this['context']['config']['get']('ai.chat.welcomeMessage')??as(this['context']['locale'],'AI_CHAT_WELCOME_MESSAGE');this['_view']['chatFeed']['clear'](),this['_view']['chatControls']['enableModelSelector'](),this['_view']['chatControls']['setModelList'](_0x37bb67['availableModels'],!this['context']['config']['get']('ai.models.showModelSelector')),this['addFeedItemStaticMessage']({'id':'conversation-start','staticMessage':_0x68e95f}),this['fire']('conversationCreated');}async['addFeedItemStaticMessage']({id:_0x23a32b,staticMessage:_0x4b6cbe}){return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('ai-reply',{'id':_0x23a32b,'initialContent':'<p>'+_0x4b6cbe+'</p>'});});}async['addFeedItemUserMessage'](_0x4c042e){const _0x560b08=_0x4c042e['attributes']?.['displayedPrompt']||_0x4c042e['userMessage'];return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('user-message',{'contextItems':Array['from'](_0x4c042e['contextItems']['values']()),'initialContent':'<p>'+_0x560b08+'</p>','id':_0x4c042e['id']});});}async['addFeedItemError']({errorMessage:_0x25e6d8,id:_0x45c072}){return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('error-message',{'initialContent':'<p>'+_0x25e6d8+'</p>','id':_0x45c072});});}async['addFeedItemAIReply'](_0x13a430){return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('ai-reply',{'id':_0x13a430['interactionId']+':'+_0x13a430['id']}),this['clearLoadingMessage']();});}async['addFeedItemAISuggestion'](_0x818320){const _0x3e63c9=Fs(this['context']);let _0x5b51d3=_0x3e63c9['config']['get']('ai.availableReplyActions')||[...gn];if(_0x3e63c9['plugins']['has']('TrackChanges')){if(!this['_isTrackChangesCommandValueBound']){this['_isTrackChangesCommandValueBound']=!0x0;const _0x1631f0=_0x3e63c9['commands']['get']('trackChanges');this['_view']['chatFeed']['bind']('isTrackChangesOn')['to'](_0x1631f0,'value');}}else _0x5b51d3=_0x5b51d3['filter'](_0x136a39=>'insertSuggestion'!=_0x136a39);return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('ai-suggestion-reply',{'id':_0x818320['interactionId']+':'+_0x818320['id'],'areActionsDisabled':_0x818320['areActionsDisabled'],'showDiff':this['showDiff'],'availableActions':_0x5b51d3}),this['clearLoadingMessage']();});}async['addFeedInteractionHeader'](_0x1abe12,_0x43fe3d){return this['_promiseQueue']['enqueue'](async()=>{const _0x174eb3=this['_view']['chatFeed']['children']['last'];if(_0x174eb3 instanceof Yn)return this['_view']['chatFeed']['children']['remove'](_0x174eb3),void this['_view']['chatFeed']['addItem']('interaction-header',{'id':_0x1abe12['id'],'capabilities':{'isWebSearchEnabled':_0x174eb3['capabilities']['isWebSearchEnabled']||_0x43fe3d['isWebSearchEnabled'],'isReasoningEnabled':_0x174eb3['capabilities']['isReasoningEnabled']||_0x43fe3d['isReasoningEnabled']}});this['_view']['chatFeed']['addItem']('interaction-header',{'id':_0x1abe12['id'],'capabilities':_0x43fe3d});});}async['addFeedItemCustomElement'](_0x2fa8d3,_0xc48e08){let _0x184061;return await this['_promiseQueue']['enqueue'](async()=>{_0x184061=this['_view']['chatFeed']['addItem']('custom-element',{'content':_0x2fa8d3,'id':_0xc48e08});}),_0x184061;}['removeFeedItem'](_0x5995a7){this['_view']['chatFeed']['removeItem'](_0x5995a7);}['hasFeedItem'](_0x279b50){return this['_view']['chatFeed']['hasItem'](_0x279b50);}['updateFeedInteractionHeader'](_0x11a4af){const _0x17fa18=this['_view']['chatFeed']['children']['find'](_0x147bbe=>_0x147bbe['options']['id']==_0x11a4af['id']&&_0x147bbe instanceof Yn);_0x17fa18&&_0x17fa18['set']('isVisible',_0x11a4af['isVisible']);}async['updateFeedItemAIReplyContent'](_0x4dbedb){const _0x3f132d=_0x4dbedb['renderingStrategy']||this['feedItemRenderingStrategy'];return this['_promiseQueue']['enqueue'](async _0x35d8e=>{await this['_view']['chatFeed']['updateReplyItem']({..._0x4dbedb,'abortSignal':_0x35d8e,'renderingStrategy':_0x3f132d}),_0x4dbedb['isDone']&&this['markFeedItemAsDone'](_0x4dbedb['id']);});}['updateFeedItemAIReplySources'](_0x2a27e9,_0x22162c){this['_view']['chatFeed']['updateWebSources'](_0x2a27e9,_0x22162c);}async['updateFeedItemAIReplySuggestionContent'](_0x2a5911){const _0x391c7b=_0x2a5911['renderingStrategy']||this['feedItemRenderingStrategy'];return this['_promiseQueue']['enqueue'](async _0x59b9d9=>{await this['_view']['chatFeed']['updateSuggestionItem']({..._0x2a5911,'abortSignal':_0x59b9d9,'renderingStrategy':_0x391c7b}),_0x2a5911['isDone']&&this['markFeedItemAsDone'](_0x2a5911['id']);});}['updateFeedItemAIReplySuggestionPartState'](_0x3791c0){this['_view']['chatFeed']['updateSuggestionPartState'](_0x3791c0);}['setFeedItemAIReplySuggestionPartActive'](_0x45dbe0){this['_view']['chatFeed']['setSuggestionPartActive'](_0x45dbe0);}['markFeedItemAsDone'](_0x4886d1){this['_view']['chatFeed']['markItemAsDone'](_0x4886d1);}['removeFeedInteraction'](_0x3b2127){this['_view']['chatFeed']['getItemIds']()['filter'](_0x3f4854=>_0x3f4854['startsWith'](_0x3b2127))['forEach'](_0x356b49=>this['_view']['chatFeed']['removeItem'](_0x356b49));}['startInteraction'](){const _0x4ee46a=this['prepareLoadingMessage']({'isWebSearchEnabled':!0x1,'isReasoningEnabled':!0x1});this['setLoadingMessage'](_0x4ee46a),this['_view']['chatControls']['disableModelSelector'](!this['context']['config']['get']('ai.models.showModelSelector')),this['isBusy']=!0x0,this['_view']['chatFeed']['startAutoScroll']();}['stopInteraction'](_0x1cc7e8){this['_promiseQueue']['abort'](),this['_view']['chatFeed']['getItemIds']()['filter'](_0x54b709=>_0x54b709['startsWith'](_0x1cc7e8['id']))['forEach'](_0x54e50c=>this['markFeedItemAsDone'](_0x54e50c)),this['isBusy']=!0x1,this['_view']['chatFeed']['stopAutoScroll']();}async['finishInteraction'](){return this['_promiseQueue']['queueEmptyPromise']['then'](()=>{this['isBusy']=!0x1,this['_view']['chatFeed']['stopAutoScroll']();});}['addContextItem'](_0x4a2dab,_0x3e0a3e){this['_view']['chatControls']['addContextItem'](_0x4a2dab,_0x3e0a3e);}['removeContextItem'](_0x45560c){this['_view']['chatControls']['removeContextItem'](_0x45560c);}['setContextItemLoading'](_0x5ace3f,_0x2438ae){this['_view']['chatControls']['setContextItemLoading'](_0x5ace3f,_0x2438ae);}['setIsUploadInProgress'](_0x37a448){this['_view']['chatControls']['setIsUploadInProgress'](_0x37a448);}['setConversationContext'](_0x579831){this['_view']['chatControls']['setConversationContext'](_0x579831);}['clearPendingContextUI'](){this['_view']['chatControls']['clearPendingContextUI']();}['clearConversationContextUI'](){this['_view']['chatControls']['clearConversationContextUI']();}['updateResourceState'](_0x5c0cf4,_0x440747,_0x5c2389){this['_view']['chatControls']['updateResourceState'](_0x5c0cf4,_0x440747,_0x5c2389);}['resetMessageInput'](){this['_view']['chatControls']['resetMessageInput'](),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder']());}['setAddContextOptions'](_0xad66f9){this['_view']['chatControls']['setAddContextOptions'](_0xad66f9);}['updateCapabilities'](_0x215440){this['_view']['chatControls']['setWebSearch'](_0x215440['isWebSearchEnabled']),this['_view']['chatControls']['setReasoning'](_0x215440['isReasoningEnabled']),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder'](_0x215440));}['setSelectedModel'](_0x2d5f11,_0x32d413){this['_view']['chatControls']['setModel'](_0x2d5f11),_0x32d413&&this['_view']['chatControls']['disableModelSelector'](!0x1);}['setFeedItemRenderingStrategy'](_0x225af7){this['feedItemRenderingStrategy']=_0x225af7;}['toggleLoadingSkeleton'](_0x2d54f3){this['_view']['chatFeed']['toggleLoadingSkeleton'](_0x2d54f3);}['resetConversationTitle'](){this['setConversationTitle'](as(this['context']['locale'],'AI_CHAT_HEADING'));}['setConversationTitle'](_0x237f73,_0x58152a=!0x1){if(_0x58152a&&!St()&&_0x237f73['length'])return this['_view']['chatHeader']['label']='',void this['_animateConversationTitle'](_0x237f73);this['_view']['chatHeader']['label']=_0x237f73;}['setLoadingMessage'](_0x563945){this['_view']['chatFeed']['setLoadingMessage'](_0x563945);}['clearLoadingMessage'](){this['_view']['chatFeed']['setLoadingMessage']('');}['_animateConversationTitle'](_0x4272c1){let _0x52a280=0x0;clearInterval(this['_titleAnimationInterval']),this['_titleAnimationInterval']=setInterval(()=>{this['_view']['chatHeader']['label']=this['_view']['chatHeader']['label']+_0x4272c1[_0x52a280],_0x52a280++,_0x52a280===_0x4272c1['length']&&clearInterval(this['_titleAnimationInterval']);},0x1e);}['setIsMaximized'](_0x350ddc){this['_view']['chatHeader']['isMaximized']=_0x350ddc;}['prepareLoadingMessage'](_0x3883d4){return _0x3883d4['isWebSearchEnabled']&&_0x3883d4['isReasoningEnabled']?as(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH_REASONING'):_0x3883d4['isWebSearchEnabled']?as(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH'):_0x3883d4['isReasoningEnabled']?as(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_REASONING'):as(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_REGULAR');}['_getInputPlaceholder'](_0x4ef7c1){return _0x4ef7c1?_0x4ef7c1['isWebSearchEnabled']&&_0x4ef7c1['isReasoningEnabled']?as(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH_REASONING'):_0x4ef7c1['isWebSearchEnabled']?as(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH'):_0x4ef7c1['isReasoningEnabled']?as(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REASONING'):as(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REGULAR'):as(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REGULAR');}['populateSourceResourceBalloon'](_0x394e8b,_0x20357e,_0x27fe42,_0x56e0da){this['_view']['populateSourceResourceBalloon'](_0x394e8b,_0x20357e,_0x27fe42,_0x56e0da);}['closeSourceResourceBalloon'](_0x64ac6){this['_view']['closeSourceResourceBalloon'](_0x64ac6);}['setPromptInputValue'](_0x4ac62c){this['_view']['chatControls']['setPromptInputValue'](_0x4ac62c);}['focusPromptInput'](_0x205355=!0x1){this['_view']['chatControls']['focusPromptInput'](_0x205355);}['scrollFeedToSuggestion'](_0x1358f8,_0x41467f){this['_view']['chatFeed']['scrollToSuggestion'](_0x1358f8,_0x41467f);}['startAutoScroll'](){this['_view']['chatFeed']['startAutoScroll']();}['disableControls'](){this['_view']['chatControls']['isDisabled']=!0x0;}['enableControls'](){this['_view']['chatControls']['isDisabled']=!0x1;}}class ta extends Lt{['sections'];constructor(_0x2dd79b,_0x324a35){super(_0x2dd79b),this['sections']=_0x324a35,this['items']['addMany'](this['sections']),this['extendTemplate']({'attributes':{'class':['ck-ai-chat-history__sections']}});}['filter'](_0x35fd45){let _0xca0bb3=0x0,_0x5a3772=0x0;for(const _0x50bc2d of this['sections']){const {resultsCount:_0x1ff341,totalItemsCount:_0x1201af}=_0x50bc2d['filter'](_0x35fd45);_0xca0bb3+=_0x1ff341,_0x5a3772+=_0x1201af;}return{'resultsCount':_0xca0bb3,'totalItemsCount':_0x5a3772};}}class ea extends Pt{['title'];['itemsViews'];['_itemsListView'];constructor(_0x5500ae,{title:_0x4a216a,items:_0x5bc03d}){super(_0x5500ae);const _0x13f99e=this['bindTemplate'];this['set']('isVisible',!0x0),this['title']=_0x4a216a,this['itemsViews']=_0x5bc03d;const _0x434d33=new Nt(_0x5500ae);_0x434d33['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-history__section-title']},'children':[this['title']]}),this['_itemsListView']=new Lt(_0x5500ae),this['_itemsListView']['items']['addMany'](this['itemsViews']),this['setTemplate']({'tag':'li','attributes':{'class':['ck-ai-chat-history__section',_0x13f99e['if']('isVisible','ck-hidden',_0x278a8c=>!_0x278a8c)]},'children':[_0x434d33,this['_itemsListView']]});}['filter'](_0xc21a2d){const _0x5acbcb=this['itemsViews']['length'];let _0xfc0256=0x0;for(const _0x186773 of this['itemsViews']){if(_0xc21a2d){const _0x379956=_0x186773['isMatching'](_0xc21a2d);_0x186773['isVisible']=!!_0x379956,_0x186773['highlightText'](_0xc21a2d);}else _0x186773['isVisible']=!0x0,_0x186773['highlightText'](null);_0x186773['isVisible']&&_0xfc0256++;}return this['isVisible']=_0xfc0256>0x0,{'resultsCount':_0xfc0256,'totalItemsCount':_0x5acbcb};}['getItem'](_0x2242d8){return this['itemsViews']['find'](_0x176179=>_0x176179['id']===_0x2242d8);}['removeItem'](_0x3f2ff6){const _0xb96321=this['itemsViews']['indexOf'](_0x3f2ff6);-0x1!==_0xb96321&&(this['itemsViews']['splice'](_0xb96321,0x1),this['_itemsListView']['items']['remove'](_0x3f2ff6));}}class ia extends/* #__PURE__ -- @preserve */
27
+ _0x3040aa(Pt){['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(_0x5c332c,_0x2362a4){super(_0x5c332c);const _0x23f935=this['bindTemplate'];this['set']('isEdit',!0x1),this['set']('isVisible',!0x0),this['set']('pinned',!!_0x2362a4['pinned']),this['set']('loadingState',null),this['id']=_0x2362a4['id'];const {title:_0x45ff31,createdAt:_0x3cae42,active:_0x33969c=!0x1}=_0x2362a4;this['_titleView']=new _0x3526fb(),this['_titleView']['text']=_0x45ff31,this['_titleView']['extendTemplate']({'attributes':{'class':['ck-ai-chat-history__item-title']}});const _0x451320=this['_createCheckView'](),_0x1968e9=this['_createPinButtonView'](_0x5c332c),_0x475fd3=this['_createMenuDropdownView'](),_0x2e02ff=this['_createEditInputView'](_0x5c332c,_0x45ff31),_0x9360c5=this['_createAcceptEditButtonView'](_0x5c332c,_0x2e02ff),_0x4452ab=this['_createCancelEditButtonView'](_0x5c332c,_0x2e02ff);this['actions']=this['createCollection'](),this['mainContent']=this['createCollection'](),this['mainContent']['add'](this['_titleView']),this['actions']['add'](_0x1968e9),this['actions']['add'](_0x475fd3),this['on']('change:isEdit',(_0x33b25a,_0x56078f,_0x69cf71)=>{this['actions']['clear'](),this['mainContent']['clear'](),_0x69cf71?(this['actions']['add'](_0x9360c5),this['actions']['add'](_0x4452ab),this['mainContent']['add'](_0x2e02ff),_0x2e02ff['element']['focus']()):(this['actions']['add'](_0x1968e9),this['actions']['add'](_0x475fd3),this['mainContent']['add'](this['_titleView']));}),this['setTemplate']({'tag':'li','attributes':{'class':['ck-ai-chat-history__item',_0x33969c?'ck-ai-chat-history__item--active':'',_0x23f935['if']('isVisible','ck-hidden',_0x499530=>!_0x499530),_0x23f935['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',_0x23f935['if']('loadingState','ck-hidden',_0x559a83=>!!_0x559a83)]},'children':_0x33969c?[_0x451320]:[]},{'tag':'div','attributes':{'class':['ck-ai-loader',_0x23f935['if']('loadingState','ck-hidden',_0x42634b=>!_0x42634b)]},'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',_0x23f935['if']('loadingState','ck-hidden',_0x8f2315=>!!_0x8f2315)]},'children':this['mainContent']},{'tag':'div','attributes':{'class':['ck-ai-loader__text',_0x23f935['if']('loadingState','ck-hidden',_0x2d4c11=>!_0x2d4c11)]},'children':[{'text':_0x23f935['to']('loadingState',_0x497153=>_0x497153?as(this['locale'],ia['LOADING_LABELS'][_0x497153]):'')}]}]},{'tag':'span','attributes':{'class':['ck-ai-chat-history__item-date']},'children':[_0x3cae42]}]},{'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'](_0x577b22){this['_titleView']['text']=_0x215ed3(_0x577b22);}['updateLoadingState'](_0x5bfdd5,_0x1dfe12){this['set']('loadingState',_0x1dfe12?_0x5bfdd5:null);}['_createCheckView'](){const _0x3b71dd=new yt();return _0x3b71dd['set']({'content':_0xdfeb3f}),_0x3b71dd;}['_createPinButtonView'](_0x3c853d){const _0x379729=new kt(_0x3c853d);return _0x379729['set']({'label':as(_0x3c853d,'AI_CHAT_HISTORY_PIN_BUTTON'),'icon':_0x39e8db,'withText':!0x1,'tooltip':!0x0}),_0x379729['bind']('isOn')['to'](this,'pinned'),_0x379729['on']('execute',()=>{const _0x1ada87=!this['pinned'];this['fire']('setConversationPinned',{'id':this['id'],'pinned':_0x1ada87});}),_0x379729;}['_createMenuDropdownView'](){const _0xdbd48=Bt(this['locale']),_0x515d44=_0xdbd48['panelView']['children'];_0xdbd48['buttonView']['set']({'label':as(this['locale'],'AI_CHAT_HISTORY_SHOW_MORE_ITEMS'),'icon':_0x4c14d3}),_0xdbd48['panelPosition']='sw';const _0x44af6c=new kt(this['locale']);_0x44af6c['label']=as(this['locale'],'AI_CHAT_HISTORY_EDIT_NAME'),_0x44af6c['withText']=!0x0,_0x44af6c['on']('execute',()=>{this['isEdit']=!0x0;});const _0x2d243=new kt(this['locale']);_0x2d243['label']=as(this['locale'],'AI_CHAT_HISTORY_REMOVE'),_0x2d243['withText']=!0x0,_0x2d243['on']('execute',()=>{this['showConfirm'](as(this['locale'],'AI_CHAT_HISTORY_REMOVE_CONFIRM'),this['element'])['then'](()=>{this['fire']('removeConversation',{'id':this['id']});});});const _0x36deed=new Lt(this['locale']),_0x49e509=new Pt(this['locale']);_0x49e509['children']['add'](_0x44af6c);const _0x1cc16c=new Pt(this['locale']);return _0x1cc16c['children']['add'](_0x2d243),_0x36deed['items']['addMany']([_0x49e509,_0x1cc16c]),_0x515d44['add'](_0x36deed),_0xdbd48;}['_createEditInputView'](_0x4cfb92,_0x4bfb3c){const _0x334b18=new _0x4bb053(_0x4cfb92),_0x31a3de=_0x334b18['bindTemplate'];return _0x334b18['value']=_0x4bfb3c,_0x334b18['extendTemplate']({'on':{'keydown':_0x31a3de['to'](_0x10d8cb=>{'Enter'==_0x10d8cb['key']&&this['_commitEditInputValue'](_0x334b18);})}}),_0x334b18;}['_createAcceptEditButtonView'](_0x451734,_0x3e2b1){const _0x155701=new kt(_0x451734);return _0x155701['set']({'icon':_0xdfeb3f,'withText':!0x1,'tooltip':as(_0x451734,'AI_CHAT_HISTORY_ACCEPT')}),_0x155701['extendTemplate']({'attributes':{'class':['ck-confirm-view-submit']}}),_0x155701['on']('execute',()=>{this['_commitEditInputValue'](_0x3e2b1);}),_0x155701;}['_commitEditInputValue'](_0xcbbb07){const _0x3f4482=_0xcbbb07['element']['value']||'';this['_titleView']['text']=_0x3f4482,this['isEdit']=!0x1,this['fire']('editConversationTitle',{'id':this['id'],'title':_0x3f4482});}['_createCancelEditButtonView'](_0x4805e4,_0x4d989b){const _0x29a7d9=new kt(_0x4805e4);return _0x29a7d9['set']({'icon':_0x340c21,'withText':!0x1,'tooltip':as(_0x4805e4,'AI_CHAT_HISTORY_CANCEL')}),_0x29a7d9['extendTemplate']({'attributes':{'class':['ck-confirm-view-cancel']}}),_0x29a7d9['on']('execute',()=>{this['isEdit']=!0x1,_0x4d989b['value']=this['_titleView']['text']||'',this['fire']('edit:cancel');}),_0x29a7d9;}['_createSpinnerView'](){const _0x543510=new fn('tiny');return _0x543510['isVisible']=!0x0,_0x543510;}['isMatching'](_0xc59441){return this['_titleView']&&'string'==typeof this['_titleView']['text']&&this['_titleView']['text']['match'](_0xc59441)?{'title':!0x0}:null;}['highlightText'](_0x5221c1){this['_titleView']['highlightText'](_0x5221c1);}}class sa extends Nt{['searchView'];['mainErrorView'];['skeletonView'];['emptyView'];['sectionsView'];['resizeButton'];constructor(_0x4147fc,_0x158c28){super(_0x4147fc),this['set']('hasItems',!0x1),this['set']('isLoading',!0x0),this['set']('errorMessage',''),this['set']('isMaximized',!0x1),this['set']('isSearchViewVisible',!0x1),this['set']('isEmptyViewVisible',!0x1),this['set']('isMainErrorViewVisible',!0x1);const _0x50011b=new _0x327048(_0x4147fc,{'label':as(_0x4147fc,'AI_CHAT_HISTORY_HEADING'),'icon':_0x3b8b71,'class':'ck-ai-header\x20ck-ai-header_history'});_0x158c28&&(this['resizeButton']=ls(_0x4147fc,this),_0x50011b['children']['add'](this['resizeButton'])),this['sectionsView']=new ta(_0x4147fc,[]),this['sectionsView']['delegate'](...na)['to'](this),this['mainErrorView']=this['_createErrorView'](),this['skeletonView']=this['_createSkeletonView'](),this['emptyView']=this['_createEmptyStateView'](),this['searchView']=this['_createSearchView'](),this['mainErrorView']['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isMainErrorViewVisible','ck-hidden',_0x48315d=>!_0x48315d)]}}),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':[_0x50011b,{'tag':'div','attributes':{'class':['ck-ai-chat-history__content']},'children':[this['skeletonView'],this['mainErrorView'],this['emptyView'],this['searchView']]}]});}['_updateViewVisibility'](){this['isSearchViewVisible']=!this['isLoading']&&this['hasItems'],this['isEmptyViewVisible']=!this['isLoading']&&!this['hasItems']&&!this['errorMessage'],this['isMainErrorViewVisible']=!this['isSearchViewVisible']&&!!this['errorMessage'];}['_createSearchView'](){const _0x4322e1=new _0x363e78(this['locale'],{'filteredView':this['sectionsView'],'queryView':{'label':as(this['locale'],'AI_CHAT_HISTORY_SEARCH_LABEL')},'infoView':{'text':{'notFound':{'primary':_0x5490f3=>as(this['locale'],'AI_CHAT_HISTORY_SEARCH_NOT_FOUND_PRIMARY',_0x5490f3),'secondary':as(this['locale'],'AI_CHAT_HISTORY_SEARCH_NOT_FOUND_SECONDARY')}}}}),_0x19bd10=this['_createErrorView']();return _0x19bd10['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('errorMessage','ck-hidden',_0x5a93d9=>!_0x5a93d9)]}}),_0x4322e1['on']('render',()=>{_0x4322e1['children']['add'](_0x19bd10,0x1);}),_0x4322e1['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isSearchViewVisible','ck-hidden',_0x3dc501=>!_0x3dc501)]}}),_0x4322e1;}['_createSkeletonView'](){const _0x490f03=new zn(this['locale'],jn['aiHistory']);return _0x490f03['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isLoading','ck-hidden',_0x227f65=>!_0x227f65)]}}),_0x490f03;}['_createErrorView'](){const _0x331889=new Nt(this['locale']),_0x5cc586=new kt(this['locale']);_0x5cc586['set']({'withText':!0x1,'icon':_0x340c21,'class':'ck-ai-notification_error__dismiss-button'}),_0x5cc586['bind']('isVisible')['to'](this,'hasItems',_0x1885e9=>!!_0x1885e9),_0x5cc586['on']('execute',()=>{this['errorMessage']='';});const _0x15b178=this['bindTemplate'];return _0x331889['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-notification','ck-ai-notification_error']},'children':[{'tag':'p','children':[{'text':_0x15b178['to']('errorMessage')}]},_0x5cc586]}),_0x331889;}['_createEmptyStateView'](){const _0x19b231=new kt(this['locale']);_0x19b231['set']({'label':as(this['locale'],'AI_CHAT_LABEL_NEW_CHAT'),'withText':!0x0,'icon':_0x5a6582,'class':'ck-ai-chat__start-conversation\x20'+hs}),_0x19b231['on']('execute',()=>{this['fire']('openChat');});const _0xf18d8d=new Nt(this['locale']);return _0xf18d8d['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-history__empty',this['bindTemplate']['if']('isEmptyViewVisible','ck-hidden',_0x1a1624=>!_0x1a1624)]},'children':[{'tag':'p','attributes':{'class':['ck-ai-chat-history__empty-message']},'children':[as(this['locale'],'AI_CHAT_HISTORY_EMPTY_MESSAGE')]},_0x19b231]}),_0xf18d8d;}['_createListItemViews'](_0x47a717,_0xa2c18b){const _0x23212a=[];for(const _0x258088 of _0x47a717){const _0x38d230=new ia(_0xa2c18b,_0x258088);_0x38d230['delegate'](...na)['to'](this),_0x23212a['push'](_0x38d230);}return _0x23212a;}['updateHistoryItemsWithCategories'](_0x42f2e6){const _0xd890fe=this['locale']||'en',_0x53ca32=[];for(const _0x1923e9 of _0x42f2e6){const _0xeb148c=this['_createListItemViews'](_0x1923e9['items'],_0xd890fe);_0x53ca32['push'](new ea(_0xd890fe,{'title':_0x1923e9['title'],'items':_0xeb148c}));}this['sectionsView']['sections']=_0x53ca32,this['sectionsView']['items']['clear'](),this['sectionsView']['items']['addMany'](_0x53ca32),this['hasItems']=_0x42f2e6['some'](_0x4d2385=>_0x4d2385['items']['length']>0x0),this['_refreshSearch']();}['removeHistoryItem'](_0x5b3f94){for(const _0x3e4316 of this['sectionsView']['sections']){const _0x23d333=_0x3e4316['getItem'](_0x5b3f94);if(_0x23d333){if(_0x3e4316['removeItem'](_0x23d333),0x0===_0x3e4316['itemsViews']['length']){const _0x49cafd=this['sectionsView']['sections']['indexOf'](_0x3e4316);-0x1!==_0x49cafd&&(this['sectionsView']['sections']['splice'](_0x49cafd,0x1),this['sectionsView']['items']['remove'](_0x3e4316));}this['hasItems']=this['sectionsView']['sections']['length']>0x0,this['_refreshSearch']();break;}}}['updateItemTitle'](_0x3c5b2a,_0x484968){for(const _0x4beda5 of this['sectionsView']['sections']){const _0x18748b=_0x4beda5['getItem'](_0x3c5b2a);if(_0x18748b){_0x18748b['updateTitle'](_0x484968);break;}}}['updateItemLoadingState'](_0x22b7d5,_0x1d2e95,_0x3c006d){for(const _0x5f1d51 of this['sectionsView']['sections']){const _0x2d8965=_0x5f1d51['getItem'](_0x22b7d5);if(_0x2d8965){_0x2d8965['updateLoadingState'](_0x1d2e95,_0x3c006d);break;}}}['_refreshSearch'](){if(this['hasItems']){const _0x18a5b1=this['searchView']['queryView']['fieldView']?.['element']?.['value']||'';this['searchView']['search'](_0x18a5b1);}}}const na=['showConversationHistory','removeConversation','editConversationTitle','setConversationPinned','selectConversation','openChat','resizeTabs'];class ra extends _0x314798{static get['requires'](){return[ns];}['_historyView'];static get['pluginName'](){return'AIChatHistoryUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x72dd9e){super(_0x72dd9e);const _0x1f89a8=this['context']['plugins']['get']('AITabs');this['_historyView']=new sa(this['context']['locale'],_0x1f89a8['showResizeButton']),this['_historyView']['delegate'](...na)['to'](this),_0x1f89a8['view']['addTab']({'id':'history','buttonLabel':as(this['context']['locale'],'AI_CHAT_HISTORY_HEADING'),'buttonIcon':_0x3b8b71,'order':0x0,'content':this['_historyView']});}['removeHistoryItem'](_0x5b34d2){this['_historyView']['removeHistoryItem'](_0x5b34d2);}['updateItems'](_0x223bd1){this['_historyView']['updateHistoryItemsWithCategories'](_0x223bd1);}['updateItemTitle'](_0x3437f4,_0x4e1722){this['_historyView']['updateItemTitle'](_0x3437f4,_0x4e1722);}['updateItemLoadingState'](_0x460666,_0x4dd8a1,_0x1ffc2d){this['_historyView']['updateItemLoadingState'](_0x460666,_0x4dd8a1,_0x1ffc2d);}['setLoadingSkeleton'](_0x400925){this['_historyView']['isLoading']=_0x400925;}['showError'](_0x55f761){this['_historyView']['errorMessage']=_0x55f761;}['hideError'](){this['_historyView']['errorMessage']='';}['setIsMaximized'](_0x5d1f7f){this['_historyView']['isMaximized']=_0x5d1f7f;}}class aa extends ht(){['id'];['createdAt'];constructor({id:_0x16356a,title:_0x19f937,createdAt:_0xe2e58d,updatedAt:_0x556277,pinned:_0x80df3f}){super(),this['id']=_0x16356a,this['createdAt']=new Date(_0xe2e58d),this['set']('title',_0x19f937),this['set']('updatedAt',_0x556277?new Date(_0x556277):null),this['set']('pinned',_0x80df3f||!0x1);}['updateTitle'](_0x33a7f7){this['set']('title',_0x215ed3(_0x33a7f7)),this['updatedAt']=new Date();}['updatePinned'](_0x53fa17){this['set']('pinned',_0x53fa17),this['updatedAt']=new Date();}}class oa extends pt(){['items']=[];['connector'];['group'];constructor({connector:_0x498c9d,group:_0x55bbc9}){super(),this['connector']=_0x498c9d,this['group']=_0x55bbc9;}async['init'](){try{const _0x42b2d2=this['connector']['fetchConversations'](this['group']),_0x10bb9f=await _0x42b2d2['getConversations']();this['loadItems'](_0x10bb9f);}catch(_0x44ff24){this['fire']('error',{'error':_0x44ff24,'operation':'init'});}}['addItem'](_0x2ce293){this['items']['push'](_0x2ce293);}async['removeItem'](_0x526729){const _0x504ee9=this['items']['findIndex'](_0x1cb6d8=>_0x1cb6d8['id']===_0x526729);if(-0x1===_0x504ee9)return!0x1;try{return await this['connector']['deleteConversation'](_0x526729)['execute'](),this['items']['splice'](_0x504ee9,0x1),this['fire']('itemRemoved',{'itemId':_0x526729}),!0x0;}catch(_0x97b514){return this['fire']('error',{'error':_0x97b514,'operation':'removeItem','itemId':_0x526729}),!0x1;}}['getItem'](_0x205077){return this['items']['find'](_0x1ec047=>_0x1ec047['id']===_0x205077);}async['updateItemTitle'](_0x47c855,_0x5552fa){const _0x940190=this['getItem'](_0x47c855);if(!_0x940190)return!0x1;try{return await this['connector']['updateConversation'](_0x47c855,{'title':_0x5552fa})['getResult'](),_0x940190['updateTitle'](_0x5552fa),this['fire']('itemUpdated',{'itemId':_0x47c855,'updates':{'title':_0x5552fa}}),!0x0;}catch(_0x2c1929){return this['fire']('error',{'error':_0x2c1929,'operation':'updateItemTitle','itemId':_0x47c855}),!0x1;}}async['updateItemPinned'](_0x413224,_0x3a0a08){const _0x605c9b=this['getItem'](_0x413224);if(!_0x605c9b)return!0x1;try{return await this['connector']['updateConversation'](_0x413224,{'pinned':_0x3a0a08})['getResult'](),_0x605c9b['updatePinned'](_0x3a0a08),this['fire']('itemUpdated',{'itemId':_0x413224,'updates':{'pinned':_0x3a0a08}}),!0x0;}catch(_0x347935){return this['fire']('error',{'error':_0x347935,'operation':'updateItemPinned','itemId':_0x413224}),!0x1;}}['loadItems'](_0x4deed2){try{this['items']=[],_0x4deed2['map'](_0x9ebfea=>{this['addItem'](new aa(_0x9ebfea));}),this['fire']('itemsLoaded',{'items':[...this['items']]});}catch(_0x3082a2){this['fire']('error',{'error':_0x3082a2,'operation':'loadItems'});}}['getItems'](_0x1c7067={}){const _0x5222d1=void 0x0!==_0x1c7067['pinned']&&_0x1c7067['pinned'],_0x294937=_0x1c7067['from']?new Date(_0x1c7067['from']['getFullYear'](),_0x1c7067['from']['getMonth'](),_0x1c7067['from']['getDate']()):null,_0x6a515c=_0x1c7067['to']?new Date(_0x1c7067['to']['getFullYear'](),_0x1c7067['to']['getMonth'](),_0x1c7067['to']['getDate']()):null;return this['items']['filter'](_0x29267b=>{if(_0x29267b['pinned']!==_0x5222d1)return!0x1;if(_0x6a515c){const _0x47c3b1=new Date(_0x29267b['createdAt']['getFullYear'](),_0x29267b['createdAt']['getMonth'](),_0x29267b['createdAt']['getDate']());return _0x294937?_0x294937['getTime']()===_0x6a515c['getTime']()?_0x47c3b1['getTime']()===_0x294937['getTime']():_0x47c3b1<_0x6a515c&&_0x47c3b1>=_0x294937:_0x47c3b1<_0x6a515c;}return!0x0;});}}class ha extends _0x314798{['_aiConnector'];['_aiChatHistoryUi'];['_aiChatController'];static get['requires'](){return[rs,Ys,ra,ns];}static get['pluginName'](){return'AIChatHistoryController';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){this['_aiConnector']=this['context']['plugins']['get'](rs),this['_aiChatHistoryUi']=this['context']['plugins']['get'](ra),this['_aiChatController']=this['context']['plugins']['get'](Ys);const _0x490cdb=this['context']['plugins']['get'](ns);try{const _0x41cdab=this['_aiChatController']['getGroupId']();this['history']=new oa({'connector':this['_aiConnector'],'group':_0x41cdab}),this['listenTo'](this['_aiChatHistoryUi'],'removeConversation',(_0x1b474a,_0x50de28)=>{this['_setItemLoading'](_0x50de28['id'],'remove'),this['_handleRemove'](_0x50de28['id']);}),this['listenTo'](this['_aiChatHistoryUi'],'editConversationTitle',(_0x4a7809,_0x3d6806)=>{this['_setItemLoading'](_0x3d6806['id'],'rename'),this['_handleEditTitle'](_0x3d6806['id'],_0x3d6806['title']);}),this['listenTo'](this['history'],'itemUpdated',(_0x28f0a7,_0xec8ce)=>{void 0x0!==_0xec8ce['updates']['title']&&this['_aiChatHistoryUi']['updateItemTitle'](_0xec8ce['itemId'],_0xec8ce['updates']['title']),void 0x0!==_0xec8ce['updates']['pinned']&&this['_updateHistoryItemsUI'](),this['_clearItemLoading'](_0xec8ce['itemId']);}),this['listenTo'](this['history'],'itemRemoved',(_0x52f615,_0x58e848)=>{this['_aiChatController']['_handleRemovedConversation'](_0x58e848['itemId']),this['_aiChatHistoryUi']['removeHistoryItem'](_0x58e848['itemId']),this['_clearItemLoading'](_0x58e848['itemId']);}),this['listenTo'](this['history'],'itemsLoaded',()=>{this['_updateHistoryItemsUI']();}),this['listenTo'](this['history'],'error',(_0x5d7bed,_0x3c266d)=>{this['_handleHistoryErrorUI'](_0x3c266d['error'],_0x3c266d['operation'],_0x3c266d['itemId']);}),this['listenTo'](this['_aiChatHistoryUi'],'selectConversation',(_0x48d314,_0x43ca18)=>{this['_handleSelectConversation'](_0x43ca18['id']);}),this['listenTo'](this['_aiChatHistoryUi'],'setConversationPinned',(_0x2c4eba,_0x10b044)=>{const _0x48da33=_0x10b044['pinned']?'pin':'unpin';this['_setItemLoading'](_0x10b044['id'],_0x48da33),this['_handleTogglePin'](_0x10b044['id'],_0x10b044['pinned']);}),this['listenTo'](this['_aiChatHistoryUi'],'openChat',()=>{_0x490cdb['view']['activateTab']('chat');}),this['listenTo'](this['_aiChatController'],'change:activeConversation',()=>{this['_updateHistoryItemsUI']();}),_0x490cdb['view']['on']('activateTab:history',()=>{this['_showConversationHistory']();}),this['listenTo'](_0x490cdb,'resizedTabs',(_0x279467,_0x9fe57c)=>{this['_setIsMaximized'](_0x9fe57c);}),this['listenTo'](this['_aiChatHistoryUi'],'resizeTabs',()=>{_0x490cdb['resize']();});}catch(_0x269367){this['_handleHistoryErrorUI'](_0x269367,'init');}}async['_handleEditTitle'](_0x38d93f,_0xcfdb38){await this['history']['updateItemTitle'](_0x38d93f,_0xcfdb38);}async['_handleTogglePin'](_0x3e05c9,_0x497a49){await this['history']['updateItemPinned'](_0x3e05c9,_0x497a49);}async['_handleRemove'](_0x72bad8){await this['history']['removeItem'](_0x72bad8);}async['_handleSelectConversation'](_0x5c20e0){await this['_aiChatController']['loadConversation'](_0x5c20e0);}async['_showConversationHistory'](){this['_aiChatHistoryUi']['showError'](''),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x0),await this['history']['init'](),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x1);}['_updateHistoryItemsUI'](){const _0x2a090f=this['_aiChatController']['activeConversation']?.['id'],_0x32b415=this['_getCategorizedItems']()['map'](_0x598b65=>({'title':_0x598b65['title'],'items':_0x598b65['items']['map'](_0x49638a=>({'id':_0x49638a['id'],'title':_0x49638a['title']||as(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION'),'createdAt':new Date(_0x49638a['createdAt'])['toLocaleDateString'](),'active':_0x49638a['id']===_0x2a090f,'pinned':_0x49638a['pinned']}))}));this['_aiChatHistoryUi']['updateItems'](_0x32b415);}['_setItemLoading'](_0x1718f4,_0x2764f4){this['_aiChatHistoryUi']['updateItemLoadingState'](_0x1718f4,_0x2764f4,!0x0);}['_clearItemLoading'](_0x873ad1){this['_aiChatHistoryUi']['updateItemLoadingState'](_0x873ad1,null,!0x1);}['_handleHistoryErrorUI'](_0x415d1c,_0x4a0eff,_0x1629ca){const _0xb7d0e6=this['_generateErrorMessage'](_0x4a0eff,_0x1629ca);this['_aiChatHistoryUi']['showError'](_0xb7d0e6),_0x1629ca&&this['_clearItemLoading'](_0x1629ca),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x1);}['_generateErrorMessage'](_0x3a0ae7,_0x1ed89e){const _0xc40df2=_0x1ed89e?this['history']['getItem'](_0x1ed89e):null,_0x49368a=_0xc40df2?.['title']||as(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION');switch(_0x3a0ae7){case'updateItemTitle':return as(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_UPDATE_TITLE',_0x49368a);case'updateItemPinned':{const _0x416dd3=as(this['context']['locale'],_0xc40df2?.['pinned']?'AI_CHAT_HISTORY_UNPIN_ACTION':'AI_CHAT_HISTORY_PIN_ACTION');return as(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_UPDATE_PINNED',[_0x416dd3,_0x49368a]);}case'removeItem':return as(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_REMOVE_ITEM',_0x49368a);case'init':case'loadItems':return as(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_LOAD_ITEMS');default:return as(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_GENERIC');}}['_getCategorizedItems'](){const _0x25e519=new Date(),_0x2a75f6=new Date(_0x25e519['getFullYear'](),_0x25e519['getMonth'](),_0x25e519['getDate']()),_0x44eecb=new Date(_0x2a75f6);_0x44eecb['setDate'](_0x44eecb['getDate']()-0x1);const _0x2f043d=new Date(_0x2a75f6);_0x2f043d['setDate'](_0x2f043d['getDate']()-0xe);const _0x362e4b=this['history']['getItems']({'pinned':!0x0}),_0xc65d91=this['history']['getItems']({'from':_0x2a75f6,'to':_0x2a75f6}),_0x35b6a5=this['history']['getItems']({'from':_0x44eecb,'to':_0x44eecb}),_0x424a5c=this['history']['getItems']({'from':_0x2f043d,'to':_0x44eecb}),_0xc770d2=this['history']['getItems']({'to':_0x2f043d}),_0x126cdf=[];return _0x362e4b['length']>0x0&&_0x126cdf['push']({'title':as(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_PINNED'),'items':_0x362e4b}),_0xc65d91['length']>0x0&&_0x126cdf['push']({'title':as(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_TODAY'),'items':_0xc65d91}),_0x35b6a5['length']>0x0&&_0x126cdf['push']({'title':as(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_YESTERDAY'),'items':_0x35b6a5}),_0x424a5c['length']>0x0&&_0x126cdf['push']({'title':as(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_LAST_14_DAYS'),'items':_0x424a5c}),_0xc770d2['length']>0x0&&_0x126cdf['push']({'title':as(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_LATER'),'items':_0xc770d2}),_0x126cdf;}['_setIsMaximized'](_0x50c889){this['_aiChatHistoryUi']['setIsMaximized'](_0x50c889);}}class ca extends _0x314798{static get['requires'](){return[ha,ra];}static get['pluginName'](){return'AIChatHistory';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class la extends _0x314798{static get['requires'](){return[Ys,qs,Zr,ca];}static get['pluginName'](){return'AIChat';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x2e4b73){super(_0x2e4b73),this['context']['config']['define']('ai.chat.context',{'document':{'enabled':!0x0},'urls':{'enabled':!0x0},'files':{'enabled':!0x0},'sources':[],'alwaysAddSelection':!0x1}),this['context']['config']['define']('ai.chat.initialConversation','new');}}class ua extends kt{['id'];constructor(_0x5a9b57,_0x4990fe){super(_0x5a9b57);const {id:_0x3d3a6b,type:_0x140ef7,icon:_0x5c8c02}=_0x4990fe;this['id']=_0x3d3a6b,this['set']({'label':_0x4990fe['label'],'withText':!0x0,'class':'ck-ai-chat-shortcut'}),this['extendTemplate']({'attributes':{'data-cke-ai-shortcut-id':_0x4990fe['id']}}),_0x5c8c02?this['icon']=_0x5c8c02:'chat'===_0x140ef7?this['icon']=_0x4666f3:'review'===_0x140ef7?this['icon']=_0x21205e:'translate'===_0x140ef7&&(this['icon']=_0x1b974b);}}class da extends Nt{['listView'];constructor(_0x3ba585,_0x131060){super(_0x3ba585);const _0x396cf7=_0x131060['map'](_0x22a6d0=>{const _0x4878e8=new Pt(this['locale']),_0x28f04f=new ua(this['locale'],_0x22a6d0);return _0x4878e8['children']['add'](_0x28f04f),_0x28f04f['delegate']('execute')['to'](this),_0x4878e8;});this['listView']=new Lt(this['locale']),this['listView']['items']['addMany'](_0x396cf7),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat-shortcuts']},'children':[this['listView']]});}}const _a='chat-shortcuts';class Aa extends _0x314798{['_shortcuts'];['_shortcutsView'];['_aiChatUI'];static get['requires'](){return[Zr];}static get['pluginName'](){return'AIChatShortcuts';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){this['_aiChatUI']=this['context']['plugins']['get'](Zr),this['_shortcuts']=this['context']['config']['get']('ai.chat.shortcuts')??[];const _0x447f80=this['context']['plugins']['get']('AIChatController');this['_shortcuts']['length']&&(this['_validateShortcuts'](),this['_aiChatUI']['on']('conversationCreated',()=>{_0x447f80['activeConversation']['isFromHistory']||this['_injectShortcuts']();}),this['listenTo'](_0x447f80,'interactionStarted',()=>{this['_removeShortcuts']();}));}['_validateShortcuts'](){const _0x25ec54=['chat','review','translate'];this['_shortcuts']['forEach'](_0x2dc223=>{let _0x1e47cb=!0x0;if(_0x2dc223['id']&&_0x2dc223['label']&&_0x25ec54['includes'](_0x2dc223['type'])?'chat'===_0x2dc223['type']&&(_0x1e47cb='string'==typeof _0x2dc223['prompt']):_0x1e47cb=!0x1,!_0x1e47cb)throw new ot('ai-chat-shortcuts-invalid-config',this['context'],{'shortcut':_0x2dc223});});}['_injectShortcuts'](){const _0x3e6081=this['context']['plugins']['get'](Zr);this['_shortcutsView']=new da(this['context']['locale'],this['_shortcuts']),this['_shortcutsView']['render'](),_0x3e6081['addFeedItemCustomElement'](this['_shortcutsView']['element'],_a),this['_shortcutsView']['on']('execute',_0x225523=>{const _0x24b740=_0x225523['source']['id'];this['_executeShortcut'](_0x24b740);});}['_removeShortcuts'](){const _0x1fc4bb=this['context']['plugins']['get'](Zr);_0x1fc4bb['hasFeedItem'](_a)&&_0x1fc4bb['removeFeedItem'](_a),this['_shortcutsView']?.['destroy']();}['_executeShortcut'](_0x3c0356){const _0x4dba0e=this['_shortcuts']['find'](_0x24e82f=>_0x24e82f['id']===_0x3c0356),_0x5c0317=_0x4dba0e['type'];'chat'===_0x5c0317?this['_runChatShortcut'](_0x4dba0e):'review'===_0x5c0317?_0x4dba0e['commandId']?this['_runReviewShortcut'](_0x4dba0e):this['_switchTab']('reviewMode'):'translate'===_0x5c0317&&(_0x4dba0e['language']?this['_runTranslateShortcut'](_0x4dba0e):this['_switchTab']('translate'));}['_switchTab'](_0x56513f){if(!this['context']['plugins']['has']('AITabs'))throw new ot('ai-chat-shortcuts-ai-tabs-not-found',this['context'],{'tabName':_0x56513f});this['context']['plugins']['get']('AITabs')['view']['activateTab'](_0x56513f);}async['_runChatShortcut']({prompt:_0x2e7112,draftMode:_0x24ff29,useWebSearch:_0x3de603=!0x1,useReasoning:_0x2d95ad=!0x1,model:_0x2844b4}){const _0x7eae7=this['context']['plugins']['get']('AIChatController'),_0x1f18e3=_0x7eae7['activeConversation'];let _0x2a104f;_0x2a104f=_0x2844b4?await _0x1f18e3['chatModels']['getModel'](_0x2844b4):await _0x1f18e3['chatModels']['getDefault'](),_0x2a104f&&await _0x1f18e3['setModel'](_0x2a104f),_0x1f18e3['setWebSearch'](_0x3de603),_0x1f18e3['setReasoning'](_0x2d95ad),_0x7eae7['addCurrentDocumentToChatContext'](),_0x24ff29?(this['_aiChatUI']['setPromptInputValue'](_0x2e7112),this['_aiChatUI']['focusPromptInput'](!0x0)):_0x7eae7['sendMessage']({'message':_0x2e7112});}['_runReviewShortcut']({commandId:_0x2dfc19,model:_0x3c4383,prompt:_0x2b14cd,params:_0x158b85}){if(!this['context']['plugins']['has']('AIReviewModeUI'))throw new ot('ai-chat-shortcuts-review-mode-not-found',this['context']);this['_switchTab']('reviewMode');const _0xf1dcb={'id':_0x2dfc19,'isCustom':'custom'===_0x2dfc19};_0x3c4383&&_0x2b14cd&&(_0xf1dcb['args']={'model':_0x3c4383,'prompt':_0x2b14cd}),_0x158b85&&(_0xf1dcb['params']=_0x158b85),this['context']['plugins']['get']('AIReviewModeUI')['fire']('runReviewCheck',_0xf1dcb);}['_runTranslateShortcut']({language:_0x361a78}){if(!this['context']['plugins']['has']('AITranslateUI'))throw new ot('ai-chat-shortcuts-translate-not-found',this['context']);this['_switchTab']('translate'),this['context']['plugins']['get']('AITranslateUI')['fire']('runReviewCheck',{'id':_0x361a78,'args':{'language':_0x361a78}});}}class ga extends _0x1afbde{constructor(_0x160e1d){super(_0x160e1d);const _0x21966d=_0x160e1d['plugins']['get']('AITabs')['view'];this['bind']('value')['to'](_0x21966d,'isVisible'),this['isEnabled']=!0x0;}['execute'](){const _0x569207=this['editor']['plugins']['get']('AITabs')['view'];_0x569207['isVisible']=!_0x569207['isVisible'];}}class Ia extends _0x36293e{static get['requires'](){return[ns];}static get['pluginName'](){return'AIToggleButtonUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x4432fb=this['editor'];_0x4432fb['commands']['add']('toggleAi',new ga(_0x4432fb)),_0x4432fb['ui']['componentFactory']['add']('toggleAi',()=>{const _0x41623c=this['_createAIUIButton'](kt);return _0x41623c['set']({'tooltip':!0x0,'class':'ck-ai-toggle-button'}),_0x41623c;}),_0x4432fb['ui']['componentFactory']['add']('menuBar:toggleAi',()=>{const _0x507f36=this['_createAIUIButton'](Kt);return _0x507f36['set']({'role':'menuitemcheckbox'}),_0x507f36;});}['_createAIUIButton'](_0x38eb9c){const _0x478662=this['editor'],_0x477bc5=_0x478662['commands']['get']('toggleAi'),_0x179143=new _0x38eb9c(_0x478662['locale']);return _0x179143['set']({'label':as(_0x478662['locale'],'AI_TOGGLE_BUTTON_LABEL'),'icon':_0x2d6639,'isToggleable':!0x0}),_0x179143['bind']('isEnabled')['to'](_0x477bc5),_0x179143['bind']('isOn')['to'](_0x477bc5,'value',_0x4ca385=>!!_0x4ca385),this['listenTo'](_0x179143,'execute',()=>{_0x477bc5['execute']();}),_0x179143;}}const Ea=['applySuggestion','insertSuggestion','showNext','showPrevious'];class Ta extends Nt{['_errorView'];constructor(_0x16b3cc){super(_0x16b3cc),this['set']('_errorMessage',''),this['set']('_isErrorVisible',!0x1);}['showBlockingError'](_0x5b864d){this['showError'](_0x5b864d);}['showError'](_0x5d6425){this['_errorView']||(this['_errorView']=this['_createErrorView']()),this['_errorMessage']=_0x5d6425,this['_isErrorVisible']=!0x0;}['hideError'](){this['_isErrorVisible']=!0x1;}['_createErrorView'](){const _0x465d00=new Nt(this['locale']),_0x307c51=new Nt(this['locale']);return _0x307c51['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-suggestion__error-text']},'children':[{'text':this['bindTemplate']['to']('_errorMessage')}]}),_0x465d00['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__error','ck-ai-balloon-error',this['bindTemplate']['if']('_isErrorVisible','ck-hidden',_0x55fa7f=>!_0x55fa7f)]},'children':[_0x307c51]}),_0x465d00;}}const pa=0xa;class ma extends _0x314798{static get['requires'](){return[qs];}static get['pluginName'](){return'AIBalloon';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['isOpen']=!0x1;['_currentConfig'];['_isUpdatingMarkers']=!0x1;['open'](_0x289c09){const {id:_0x3b2da4}=this['_currentConfig']??{};this['_currentConfig']=_0x289c09;const {id:_0x2b43fd}=this['_currentConfig'];this['isOpen']&&_0x3b2da4===_0x2b43fd?this['_updateDialog']():this['_showDialog']();}['close'](){const _0x5ee07b=Fs(this['context'])['plugins']['get']('Dialog');_0x5ee07b['isOpen']&&this['_currentConfig']&&_0x5ee07b['id']===this['_currentConfig']['id']&&_0x5ee07b['hide']();}['_updateDialog'](){const _0x16355e=Fs(this['context'])['plugins']['get']('Dialog'),{icon:_0xbf66cd,title:_0x29b7a4}=this['_currentConfig'];_0x16355e['view']?.['headerView']&&(_0x16355e['view']['headerView']['label']=_0x29b7a4,_0x16355e['view']['headerView']['iconView']&&_0xbf66cd&&(_0x16355e['view']['headerView']['iconView']['content']=_0xbf66cd)),this['_isUpdatingMarkers']=!0x0,this['_showFakeVisualSelection'](),this['_isUpdatingMarkers']=!0x1,_0x16355e['view']?.['updatePosition']();}['_showFakeVisualSelection'](){this['context']['plugins']['get'](qs)['showFakeVisualSelection']({'ranges':this['_currentConfig']['ranges'],'id':'balloon','priority':0x64}),window['getSelection']()?.['removeAllRanges']();}['_hideFakeVisualSelection'](){this['context']['plugins']['get'](qs)['hideFakeVisualSelection']('balloon');}['_showDialog'](){const _0x2e0875=Fs(this['context'])['plugins']['get']('Dialog'),{id:_0x22cb2d,title:_0x42055f,icon:_0x34c6d5,class:_0x4ffec5,mainView:_0x42abac}=this['_currentConfig'];_0x42abac['delegate'](...Ea)['to'](this),_0x2e0875['show']({'title':_0x42055f,'icon':_0x34c6d5,'hasCloseButton':!0x0,'id':_0x22cb2d,'position':this['_calculateDialogPosition']['bind'](this),'className':'ck-ai-balloon\x20'+(_0x4ffec5||''),'content':_0x42abac,'onShow':_0x20cca2=>{this['_showFakeVisualSelection'](),this['_setupFakeVisualSelectionMarkerRemovalListener']();const _0x42379f=this['_getSelectionElements']();_0x42379f&&_0x42379f[0x0]&&mt({'target':_0x42379f[0x0],'ancestorOffset':0x14,'alignToTop':!0x0,'viewportOffset':{'top':0x14,'bottom':0x14,'left':0x0,'right':0x0}}),this['isOpen']=!0x0,_0x20cca2['once']('hide',()=>{this['fire']('beforeDialogClosed',{'id':_0x22cb2d});},{'priority':'high'});},'onHide':()=>{this['_hideFakeVisualSelection'](),this['_cleanupFakeVisualSelectionMarkerRemovalListener'](),this['fire']('dialogClosed',{'id':_0x22cb2d}),this['isOpen']=!0x1;}});}['_calculateDialogPosition'](_0x3c6ab6,_0x25af39){if(!_0x25af39)return null;const _0x15e94f=this['_getSelectionElements']();if(!_0x15e94f||0x0===_0x15e94f['length'])return{'left':Math['round'](_0x25af39['left']+_0x25af39['width']/0x2-_0x3c6ab6['width']/0x2),'top':Math['round'](_0x25af39['top']+_0x25af39['height']/0x2-_0x3c6ab6['height']/0x2)};const _0x421de7=Math['round'](_0x25af39['left']+_0x25af39['width']/0x2-_0x3c6ab6['width']/0x2),_0x376d0a=_0x15e94f['map'](_0x33d543=>new ut(_0x33d543)),_0x21cfeb=_0x3c6ab6['height'];return{'left':_0x421de7,'top':this['_calculateOptimalTopPosition'](_0x376d0a,_0x21cfeb,_0x25af39)};}['_calculateOptimalTopPosition'](_0x3c91e4,_0x3a9f39,_0x434cba){const _0x161339=new ut(ct['window']),_0x231af9=_0x3c91e4['map'](_0x452e05=>_0x452e05['getVisible']())['filter'](_0x102ca7=>_0x102ca7),_0x108480=ut['getBoundingRect'](_0x231af9);if(!_0x108480)return Math['round'](_0x434cba['top']+_0x434cba['height']/0x2);const _0x5c8872=_0x161339['getIntersection'](_0x108480);if(!_0x5c8872)return Math['round'](_0x434cba['top']+_0x434cba['height']/0x2);const _0x46d398=_0x434cba['getVisible'](),_0x4815f3=_0x46d398&&_0x108480['height']>_0x46d398['height'],_0x365f84=_0x5c8872['top'],_0x5c7932=_0x5c8872['bottom'];if(_0x4815f3){const _0x34cdee=(_0x46d398||_0x161339)['height']/0x2-_0x3a9f39/0x2,_0x2d817c=_0x365f84-pa-_0x434cba['top'],_0x407c17=_0x434cba['bottom']-_0x5c7932-pa;return _0x2d817c>=_0x3a9f39?Math['max'](pa,_0x365f84-_0x3a9f39-pa):_0x407c17>=_0x3a9f39?_0x5c7932+pa:Math['max'](pa,_0x34cdee);}const _0x1111bd=_0x365f84-_0x3a9f39,_0x300b8b=_0x434cba['bottom']-_0x5c7932-pa,_0x3e208e=_0x365f84-pa-_0x434cba['top'];let _0x513c7a;if(_0x300b8b>=_0x3a9f39)_0x513c7a=_0x5c7932+pa;else{if(_0x3e208e>=_0x3a9f39)_0x513c7a=_0x1111bd-pa;else _0x513c7a=_0x365f84+_0x108480['height']/0x2-_0x3a9f39/0x2;}return _0x513c7a;}['_setupFakeVisualSelectionMarkerRemovalListener'](){const _0x53ac07=Fs(this['context']);this['listenTo'](_0x53ac07['model']['document'],'change',()=>{if(!this['_isUpdatingMarkers']){for(const {name:_0x5bf5bd,data:{newRange:_0x1cb80a}}of _0x53ac07['model']['document']['differ']['getChangedMarkers']())if(_0x5bf5bd['startsWith']($s+':')&&(_0x1cb80a&&(_0x1cb80a['start']['isEqual'](_0x1cb80a['end'])||'$graveyard'==_0x1cb80a['root']['rootName'])||null==_0x1cb80a)){const _0x5a6ae0=as(this['context']['locale'],'AI_BALLOON_SELECTION_REMOVED_ERROR');this['_currentConfig']['mainView']['showBlockingError'](_0x5a6ae0),this['fire']('selectionRemoved');}}});}['_cleanupFakeVisualSelectionMarkerRemovalListener'](){const _0x17549a=Fs(this['context']);this['_currentConfig']['mainView']['hideError'](),this['stopListening'](_0x17549a['model']['document']);}['_getSelectionElements'](){const _0x53d2cf=Fs(this['context']);return _0xff567f(_0x53d2cf['editing'],[..._0x53d2cf['model']['markers']['getMarkersGroup']('ai-selection'),..._0x53d2cf['model']['markers']['getMarkersGroup']('ai-balloon-selection')]);}}class Ca extends Ot{['copyButton'];['likeButton'];['dislikeButton'];['showChangesButton'];['_config'];constructor(_0x4f598c,_0xe45933={}){super(_0x4f598c),this['set']('isEnabled',!0x0),this['set']('isShowChangesOn',!0x1),this['_config']={'showCopy':!0x1,'showLike':!0x1,'showDislike':!0x1,..._0xe45933};const _0x3fe2c1=!(this['_config']['showCopy']||this['_config']['showChanges']||this['_config']['showLike']||this['_config']['showDislike']||this['_config']['customView']?.['length']);this['class']=_0x3fe2c1?'ck-ai-mini-toolbar\x20ck-hidden':'ck-ai-mini-toolbar',this['_config']['showCopy']&&(this['_setupCopyButton'](),this['items']['add'](this['copyButton'])),this['_config']['showChanges']&&(this['_setupShowChangesButton'](),this['items']['add'](this['showChangesButton'])),this['_setupRatingButtons'](),this['_config']['showLike']&&this['items']['add'](this['likeButton']),this['_config']['showDislike']&&this['items']['add'](this['dislikeButton']),this['_config']['customView']&&this['items']['addMany'](this['_config']['customView']);}['toggleShowChangesEnabled'](_0x3e2e0f){this['showChangesButton']['isEnabled']=_0x3e2e0f;}['_setupRatingButtons'](){this['likeButton']=new kt(this['locale']),this['likeButton']['set']({'icon':_0x10e04a,'label':as(this['locale'],'AI_MINI_TOOLBAR_LIKE'),'class':cs,'tooltip':!0x0}),this['likeButton']['bind']('isEnabled')['to'](this),this['likeButton']['on']('execute',()=>{this['fire']('like');}),this['dislikeButton']=new kt(this['locale']),this['dislikeButton']['set']({'icon':_0x915dd2,'label':as(this['locale'],'AI_MINI_TOOLBAR_DISLIKE'),'class':cs,'tooltip':!0x0}),this['dislikeButton']['bind']('isEnabled')['to'](this),this['dislikeButton']['on']('execute',()=>{this['fire']('dislike');});}['_setupCopyButton'](){this['copyButton']=new kt(this['locale']),this['copyButton']['set']({'icon':_0x5f2d2d,'label':as(this['locale'],'AI_MINI_TOOLBAR_COPY'),'class':'ck-ai-mini-toolbar-copy-button\x20'+cs,'tooltip':!0x0}),this['copyButton']['bind']('isEnabled')['to'](this);const _0x23d7e7=new yt();_0x23d7e7['set']({'content':_0xdfeb3f}),_0x23d7e7['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\x20'+cs,setTimeout(()=>{this['copyButton']['class']='ck-ai-mini-toolbar-copy-button\x20'+cs;},0x7d0);}),this['copyButton']['children']['add'](_0x23d7e7);}['_setupShowChangesButton'](){this['showChangesButton']=new kt(this['locale']),this['showChangesButton']['set']({'icon':_0x3f4cae,'label':as(this['locale'],'AI_SUGGESTION_BUTTON_SHOW_CHANGES'),'withText':'full'==this['_config']['showChanges'],'tooltip':'full'!=this['_config']['showChanges'],'class':cs}),this['showChangesButton']['bind']('isOn')['to'](this,'isShowChangesOn'),this['showChangesButton']['bind']('isEnabled')['to'](this),this['showChangesButton']['bind']('icon')['to'](this,'isShowChangesOn',_0x4d9038=>_0x4d9038?_0x253243:_0x3f4cae),this['showChangesButton']['on']('execute',()=>{this['fire']('toggleShowChanges');});}}class wa extends Ta{['children'];['nextButtonView'];['previousButtonView'];['focusCycler'];['_focusables'];['_focusTracker'];['_keystrokes'];['_config'];['_streamableContentView'];['_toolbarContainerView'];['_partToolbarView'];['_stateView'];['_miniToolbarView'];constructor(_0x547154,_0xc96614){super(_0x547154);const _0x1ed2cb=this['bindTemplate'];this['set']('showDiff',!0x1),this['set']('_state','pending'),this['_focusTracker']=new _t(),this['_keystrokes']=new At(),this['_focusables']=this['createCollection'](),this['focusCycler']=new Mt({'focusables':this['_focusables'],'focusTracker':this['_focusTracker'],'keystrokeHandler':this['_keystrokes'],'actions':{'focusPrevious':'shift\x20+\x20tab','focusNext':'tab'}}),this['_config']=_0xc96614,this['nextButtonView']=this['_createNextButtonView'](),this['previousButtonView']=this['_createPreviousButtonView'](),this['_streamableContentView']=new un(_0x547154),this['_partToolbarView']=new hn(_0x547154,_0xc96614['availableActions']),this['_partToolbarView']['delegate']('applySuggestion','insertSuggestion','rejectSuggestion')['to'](this),this['_togglePartToolbarButtonsVisibility'](_0xc96614),this['_stateView']=new an(_0x547154),this['_stateView']['isVisible']=!0x1,this['_miniToolbarView']=new Ca(_0x547154,{'showChanges':'full'}),this['_miniToolbarView']['bind']('isShowChangesOn')['to'](this,'showDiff'),this['_miniToolbarView']['on']('toggleShowChanges',()=>{this['fire']('toggleSuggestionDisplayMode');}),this['_toolbarContainerView']=new fa(_0x547154,[this['_partToolbarView'],this['_stateView'],this['_miniToolbarView']]),this['children']=this['createCollection']([this['_streamableContentView'],this['_toolbarContainerView']]),this['on']('change:_state',(_0x3017b0,_0x5078bc,_0x56cdd3,_0x4de2f9)=>{let _0x3c24cb,_0xb6f147;'pending'===_0x4de2f9?(_0x3c24cb=this['_partToolbarView'],_0xb6f147=this['_stateView']):(_0x3c24cb=this['_stateView'],_0xb6f147=this['_partToolbarView']),this['_stateView']['setState'](_0x56cdd3),_0x3c24cb['isVisible']=!0x1,_0xb6f147['isVisible']=!0x0;}),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat-balloon-main',_0x1ed2cb['to']('_state',_0x58ae07=>'ck-ai-chat-balloon-main_state_'+_0x58ae07)]},'children':this['children']}),this['on']('change:isTrackChangesOn',()=>{this['_togglePartToolbarButtonsVisibility'](_0xc96614);});}['render'](){super['render'](),this['nextButtonView']['render'](),this['previousButtonView']['render'](),this['_focusTracker']['add'](this['element']),this['_focusTracker']['add'](this['nextButtonView']),this['_focusTracker']['add'](this['previousButtonView']),this['_focusTracker']['add'](this['_miniToolbarView']),this['_focusTracker']['add'](this['_partToolbarView']),this['_keystrokes']['listenTo'](this['element']),this['_keystrokes']['listenTo'](this['nextButtonView']['element']),this['_keystrokes']['listenTo'](this['previousButtonView']['element']),this['_focusables']['addMany']([this['nextButtonView'],this['previousButtonView'],this['_partToolbarView'],this['_miniToolbarView']]);}['destroy'](){super['destroy'](),this['previousButtonView']['destroy'](),this['nextButtonView']['destroy']();}['focus'](){this['focusCycler']['focusFirst']();}['focusLast'](){this['focusCycler']['focusLast']();}async['updateContent'](_0x453b31){_0x453b31?.['keepErrors']||this['hideError'](),await this['_streamableContentView']['update'](_0x453b31);}['setState'](_0x471007){this['_state']=_0x471007;}['showError'](_0x9adc7f){super['showError'](_0x9adc7f),this['children']['has'](this['_errorView'])||this['children']['add'](this['_errorView'],0x0);}['hideError'](){this['_isErrorVisible']&&(super['hideError'](),this['togglePartToolbarEnabled'](!0x0));}['showBlockingError'](_0x179f5e){super['showBlockingError'](_0x179f5e),this['togglePartToolbarEnabled'](!0x1);}['toggleRotatorButtonsVisibility'](_0x134355){this['nextButtonView']['isVisible']=this['previousButtonView']['isVisible']=_0x134355;}['togglePartToolbarEnabled'](_0x51844d){this['_partToolbarView']['isEnabled']=_0x51844d;}['_togglePartToolbarButtonsVisibility']({showApplyButton:_0x17b3b8,showSuggestButton:_0x5105f2}){_0x17b3b8=_0x17b3b8&&!this['isTrackChangesOn']&&this['_config']['availableActions']['includes']('applySuggestion'),_0x5105f2=_0x5105f2&&this['_config']['availableActions']['includes']('insertSuggestion'),this['_partToolbarView']['setButtonsVisibility']({'showApplyButton':_0x17b3b8,'showSuggestButton':_0x5105f2});}['_createNextButtonView'](){const _0xafd6e6=new kt(this['locale']);return _0xafd6e6['set']({'icon':_0x3a6014,'label':as(this['locale'],'AI_BALLOON_NEXT_LABEL'),'isVisible':!0x0}),_0xafd6e6['on']('execute',()=>{this['fire']('showNext');}),_0xafd6e6;}['_createPreviousButtonView'](){const _0x346cff=new kt(this['locale']);return _0x346cff['set']({'icon':_0x4a4bb0,'label':as(this['locale'],'AI_BALLOON_PREVIOUS_LABEL'),'isVisible':!0x0}),_0x346cff['on']('execute',()=>{this['fire']('showPrevious');}),_0x346cff;}}class fa extends Nt{constructor(_0x37e75b,_0x58c443){super(_0x37e75b),this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-balloon__toolbar-container']},'children':_0x58c443});}}class Sa extends _0x36293e{static get['requires'](){return[Vt,ma];}static get['pluginName'](){return'AIChatBalloon';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['_chatBalloonView'];constructor(_0x503cb7){super(_0x503cb7),this['set']('showDiff',!0x1);}['open'](_0x9240a7){const _0x2d60e2=this['editor'];this['_chatBalloonView']||(this['_chatBalloonView']=this['_createChatBalloonView']()),_0x2d60e2['plugins']['get']('AIBalloon')['open']({..._0x9240a7,'id':'aiChatBalloon','class':'ck-ai-chat-balloon','mainView':this['_chatBalloonView']}),this['_toggleRotatorButtonsInDialogHeader'](_0x9240a7['showRotator']),this['_chatBalloonView']['togglePartToolbarEnabled'](!_0x9240a7['areActionsDisabled']),this['_restoreDefaultViewFocus']();}['close'](){this['editor']['plugins']['get']('AIBalloon')['close']();}['updateContent'](_0x3ebb50){return this['_chatBalloonView']||(this['_chatBalloonView']=this['_createChatBalloonView']()),this['_chatBalloonView']['updateContent'](_0x3ebb50);}['setState'](_0x141574){this['_chatBalloonView']&&this['_chatBalloonView']['setState'](_0x141574);}['_createChatBalloonView'](){const _0x49283b=this['editor'],_0x5e595b=_0x49283b['plugins']['get']('AIBalloon'),_0x555f21=_0x49283b['commands']['get']('trackChanges');let _0x29846a=_0x49283b['config']['get']('ai.availableReplyActions')||[...gn];_0x49283b['plugins']['has']('TrackChanges')||(_0x29846a=_0x29846a['filter'](_0xdcc693=>'insertSuggestion'!=_0xdcc693));const _0x2fc7e4=new wa(_0x49283b['locale'],{'availableActions':_0x29846a,'showApplyButton':!0x0,'showSuggestButton':!!_0x555f21});return _0x2fc7e4['bind']('showDiff')['to'](this),_0x2fc7e4['delegate'](...Qs)['to'](this),_0x2fc7e4['delegate']('showPrevious','showNext')['to'](this),_0x5e595b['delegate']('dialogClosed')['to'](this),_0x2fc7e4['on']('applySuggestion',this['_restoreDefaultViewFocus']['bind'](this)),_0x2fc7e4['on']('insertSuggestion',this['_restoreDefaultViewFocus']['bind'](this)),_0x2fc7e4['on']('rejectSuggestion',this['_restoreDefaultViewFocus']['bind'](this)),_0x555f21&&_0x2fc7e4['bind']('isTrackChangesOn')['to'](_0x555f21,'value'),_0x2fc7e4['render'](),_0x2fc7e4;}['_toggleRotatorButtonsInDialogHeader'](_0x140565){const _0x38f7da=this['editor'],_0x1ba6ea=_0x38f7da['plugins']['get']('Dialog')['view']['headerView']['children'];this['_chatBalloonView']['toggleRotatorButtonsVisibility'](_0x140565),_0x1ba6ea['has'](this['_chatBalloonView']['previousButtonView'])||(_0x1ba6ea['addMany']([this['_chatBalloonView']['previousButtonView'],this['_chatBalloonView']['nextButtonView']],0x0),_0x38f7da['plugins']['get']('AIBalloon')['once']('beforeDialogClosed',()=>{_0x1ba6ea['remove'](this['_chatBalloonView']['previousButtonView']),_0x1ba6ea['remove'](this['_chatBalloonView']['nextButtonView']);}));}['_restoreDefaultViewFocus'](){this['_chatBalloonView']['focus']();}}class ba extends _0x36293e{static get['requires'](){return[Ia,Sa,_0x403717];}static get['pluginName'](){return'AIEditorIntegration';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}function Ra(_0x9449e0){const {editor:_0x10a456,action:_0xbcdf35,withText:_0x608f38=!0x1,withIcon:_0x58e1aa=!0x0,isInDropdown:_0x4fc4c1=!0x0,shouldPreventFocus:_0x582695=!0x1}=_0x9449e0;return()=>{const _0x1435dc=_0x10a456['locale'],_0x2b0751=new kt(_0x1435dc),_0xdeff37=_0x2b0751['bindTemplate'];_0x4fc4c1&&_0x2b0751['extendTemplate']({'on':{'mouseenter':_0xdeff37['to'](()=>{_0x582695&&_0x582695()||_0x2b0751['focus']();})}});const _0x189636=_0xbcdf35['icon']??_0xbcdf35['parent']?.['icon'];return _0x2b0751['set']({'label':_0xbcdf35['label'],'withText':_0x608f38,'role':'menuitem','icon':_0x58e1aa?_0x189636??_0x1712b4:void 0x0,'tooltip':!_0x608f38,'class':'ck-ai-quick-actions-button','isEnabled':_0xbcdf35['isEnabled']}),_0x2b0751['on']('execute',()=>{_0x10a456['editing']['view']['focus'](),_0x10a456['commands']['execute']('aiQuickAction',_0xbcdf35);}),_0x2b0751;};}class Oa extends _0xe4a6dc{['arrowView'];constructor(_0x3359ea,_0x57e8e7){super(_0x3359ea,_0x57e8e7);const _0x244561=this['bindTemplate'];this['set']({'withText':!0x0,'role':'menuitem'}),this['arrowView']=this['_createArrowView'](),this['extendTemplate']({'attributes':{'class':['ck-dropdown-menu-list__nested-menu__button'],'aria-haspopup':!0x0,'aria-expanded':this['bindTemplate']['to']('isOn',_0x45ed51=>String(_0x45ed51)),'data-cke-tooltip-disabled':_0x244561['to']('isOn')},'on':{'mouseenter':_0x244561['to']('mouseenter')}});}['render'](){super['render'](),this['children']['add'](this['arrowView']);}['_createArrowView'](){const _0x4e602c=new yt();return _0x4e602c['content']=_0x25d1ac,_0x4e602c['extendTemplate']({'attributes':{'class':'ck-dropdown-menu-list__nested-menu__button__arrow'}}),_0x4e602c;}}class ka extends Lt{['_allListItems'];['_allSearchableItems'];constructor(_0x15964d,_0x58896a,_0x115712){super(_0x15964d),this['_allListItems']=_0x58896a,this['_allSearchableItems']=_0x115712;}['filter'](_0x563f00){if(!_0x563f00)return this['items']['clear'](),this['items']['addMany'](this['_allListItems']),this['_clearHighlight'](),{'resultsCount':this['_allListItems']['length'],'totalItemsCount':this['_allListItems']['length']};const _0x341a32=_0x563f00['source']['toLowerCase']()['trim'](),_0x28753b=this['_allSearchableItems']['filter'](_0x41c477=>(_0x41c477['groupLabel']?_0x41c477['label']+'\x20('+_0x41c477['groupLabel']+')':_0x41c477['label'])['toLowerCase']()['includes'](_0x341a32));return this['items']['clear'](),this['items']['addMany'](_0x28753b['sort']((_0x3ced18,_0x2a2fa7)=>{const _0x83f6a1=_0x3ced18['groupLabel'],_0x2ded5b=_0x2a2fa7['groupLabel'];return _0x83f6a1||_0x2ded5b?_0x83f6a1?0x1:-0x1:0x0;})['map'](_0x446e7f=>_0x446e7f['item'])),this['_highlightQuery'](_0x341a32,_0x28753b),{'resultsCount':_0x28753b['length'],'totalItemsCount':this['_allSearchableItems']['length']};}['_highlightQuery'](_0x4aebbc,_0x52377e){if(!_0x4aebbc)return;const _0x2e08af=new RegExp(_0x2459a9(_0x4aebbc),'gi');_0x52377e['forEach'](_0x5a8cbe=>{_0x5a8cbe['highlightViews']&&_0x5a8cbe['highlightViews']['forEach'](_0x1a075a=>{'function'==typeof _0x1a075a['highlightText']&&_0x1a075a['highlightText'](_0x2e08af);});});}['_clearHighlight'](){this['_allSearchableItems']['forEach'](_0x122c5c=>{_0x122c5c['highlightViews']&&_0x122c5c['highlightViews']['forEach'](_0x4bd7b5=>{'function'==typeof _0x4bd7b5['highlightText']&&_0x4bd7b5['highlightText'](null);});});}}const Na='menu',va='menuitem';class ya extends Nt{['_bodyCollection'];['optionsListView'];['_searchTextView']=null;['_allSearchableItems']=[];['children'];['focusTracker'];['keystrokes'];['_focusables'];['focusCycler'];['_openNestedPanels']=new Set();['_hasSearch'];constructor(_0x1d50a4,_0x2e4094,_0x1d9113,_0xabb52f,_0x546901=!0x1){const _0x17f4e7=_0x1d50a4['locale'];super(_0x17f4e7),this['_bodyCollection']=_0xabb52f,this['_hasSearch']=_0x546901;const _0x267dbb=this['_createListItems'](_0x1d50a4,_0x2e4094,_0x1d9113);this['optionsListView']=new ka(_0x17f4e7,_0x267dbb,this['_allSearchableItems']),this['optionsListView']['role']=Na,this['optionsListView']['items']['addMany'](_0x267dbb),this['focusTracker']=new _t(),this['keystrokes']=new At(),_0x546901&&(this['_searchTextView']=this['_createSearchTextView']()),this['_focusables']=_0x267dbb,this['focusCycler']=new Mt({'focusables':this['_focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes']}),_0x546901&&this['_searchTextView']&&this['focusCycler']['chain'](this['_searchTextView']['focusCycler']);const _0x2b2ac1=_0x546901&&this['_searchTextView']?[this['_searchTextView']]:[this['optionsListView']];this['children']=new _0xfc7125(_0x2b2ac1),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-ai-quick-actions','ck-rounded-corners'],'dir':_0x17f4e7['uiLanguageDirection']},'children':this['children']});}['_createSearchTextView'](){return new _0x363e78(this['locale'],{'filteredView':this['optionsListView'],'queryView':{'label':as(this['locale'],'AI_QUICK_ACTIONS_SEARCH')},'class':'ck-ai-quick-actions-search','infoView':{'text':{'notFound':{'primary':as(this['locale'],'AI_QUICK_ACTIONS_SEARCH_NOT_FOUND')}}}});}['_isSearchFocused'](){if(!this['_hasSearch']||!this['_searchTextView']||!this['_searchTextView']['queryView']['fieldView']['element'])return!0x1;const _0x33c9a5=this['_searchTextView']['queryView']['fieldView']['element']['ownerDocument']?.['activeElement'];return this['_searchTextView']['queryView']['fieldView']['element']['contains'](_0x33c9a5);}['_createListItems'](_0x522b2c,_0x5d87c4,_0x584c3b){const _0x1f0820=new _0xfc7125();return _0x5d87c4['forEach'](_0x355c9a=>{if('actions'in _0x355c9a){const {listItem:_0x3597d3}=this['_createActionGroupButton'](_0x522b2c,_0x355c9a,_0x584c3b);_0x1f0820['add'](_0x3597d3),_0x355c9a['actions']['forEach'](_0x860c3d=>{this['_createActionButton'](_0x522b2c,_0x860c3d,_0x355c9a['label'],_0x355c9a['icon']);const {listItem:_0x42433a,highlightViews:_0x13193c}=this['_createSearchResultActionButton'](_0x522b2c,_0x860c3d,_0x355c9a['label'],_0x355c9a['icon']);this['_allSearchableItems']['push']({'item':_0x42433a,'label':_0x860c3d['label'],'groupLabel':_0x355c9a['label'],'highlightViews':_0x13193c});});}else{const {listItem:_0x14211b}=this['_createActionButton'](_0x522b2c,_0x355c9a);_0x1f0820['add'](_0x14211b);const _0x2adb6d=_0x14211b['children']['first'];if(_0x2adb6d){const {listItem:_0x4ee150,highlightViews:_0x5cd80c}=this['_createSearchResultActionButton'](_0x522b2c,_0x355c9a);this['_allSearchableItems']['push']({'item':_0x4ee150,'label':_0x2adb6d['label']||'','highlightViews':_0x5cd80c});}}}),_0x1f0820;}['_createActionButton'](_0x5df44f,_0x26f4cc,_0x7fb075,_0x263f0d){const _0x25a679=new Pt(this['locale']);if(_0x7fb075&&_0x263f0d){const _0x4ce860=new kt(this['locale']),_0x47b72d=_0x4ce860['bindTemplate'],_0x5941f5=new _0x3526fb();_0x5941f5['text']=_0x26f4cc['label'];const _0x5ad5a1=new _0x3526fb();_0x5ad5a1['text']=_0x7fb075;const _0x1346c0=new yt();_0x1346c0['content']=_0x263f0d,_0x1346c0['extendTemplate']({'attributes':{'class':'ck-ai-quick-actions-button__group-icon'}});const _0x1629b4=new Nt(this['locale']);_0x1629b4['setTemplate']({'tag':'span','attributes':{'class':'ck-ai-quick-actions-button_with-group__open-paren'},'children':[{'text':'\x20('}]});const _0x57f617=new Nt(this['locale']);return _0x57f617['setTemplate']({'tag':'span','attributes':{'class':'ck-ai-quick-actions-button_with-group__close-paren'},'children':[{'text':')'}]}),_0x4ce860['set']({'label':_0x26f4cc['label']+'\x20('+_0x7fb075+')','withText':!0x0,'role':'menuitem','class':'ck-ai-quick-actions-button\x20ck-ai-quick-actions-button_with-group','tooltip':!0x1}),_0x4ce860['setTemplate']({'tag':'button','attributes':{'class':['ck','ck-button','ck-button_with-text','ck-ai-quick-actions-button','ck-ai-quick-actions-button_with-group'],'type':'button','role':'menuitem','tabindex':'-1'},'children':[_0x5941f5,_0x1629b4,_0x1346c0,_0x5ad5a1,_0x57f617],'on':{'mouseenter':_0x47b72d['to'](()=>{this['_isSearchFocused']()||_0x4ce860['focus']();}),'click':_0x47b72d['to'](()=>{_0x4ce860['fire']('execute');})}}),_0x4ce860['on']('execute',()=>{_0x5df44f['editing']['view']['focus'](),_0x5df44f['commands']['execute']('aiQuickAction',_0x26f4cc);}),_0x25a679['children']['add'](_0x4ce860),{'listItem':_0x25a679,'highlightViews':[_0x5941f5,_0x5ad5a1]};}{const _0x140327=new _0x38f719(),_0x41b7c7=new kt(this['locale'],_0x140327),_0x44621c=_0x41b7c7['bindTemplate'],_0xa31e05=_0x26f4cc['icon']??_0x26f4cc['parent']?.['icon'],_0x2a3aac=void 0x0!==_0x26f4cc['icon'];return _0x41b7c7['set']({'label':_0x26f4cc['label'],'withText':!0x0,'role':'menuitem','icon':_0x2a3aac?_0xa31e05??_0x1712b4:void 0x0,'tooltip':!0x1,'class':'ck-ai-quick-actions-button'}),_0x41b7c7['extendTemplate']({'on':{'mouseenter':_0x44621c['to'](()=>{this['_isSearchFocused']()||_0x41b7c7['focus']();})}}),_0x41b7c7['on']('execute',()=>{_0x5df44f['editing']['view']['focus'](),_0x5df44f['commands']['execute']('aiQuickAction',_0x26f4cc);}),_0x25a679['children']['add'](_0x41b7c7),{'listItem':_0x25a679,'highlightViews':[_0x140327]};}}['_createSearchResultActionButton'](_0x4fcba3,_0x5557c1,_0x394813,_0x4b1840){return _0x394813&&_0x4b1840?this['_createSearchResultGroupedActionButton'](_0x4fcba3,_0x5557c1,_0x394813,_0x4b1840):this['_createSearchResultIndividualActionButton'](_0x4fcba3,_0x5557c1);}['_createSearchResultGroupedActionButton'](_0x8e228b,_0x3b000d,_0x1ab0de,_0x5112de){const _0x10026e=new Pt(this['locale']),_0xce4b47=new kt(this['locale']),_0x553fe5=_0xce4b47['bindTemplate'],{view:_0x314449,highlightView:_0x2aafa6}=this['_createSearchResultGroupRow'](_0x1ab0de,_0x5112de),{view:_0x3f678c,highlightView:_0x28849b}=this['_createSearchResultActionRow'](_0x3b000d['label']),_0x4692b0=this['_createSearchResultContentView'](_0x314449,_0x3f678c);return _0xce4b47['set']({'label':_0x3b000d['label'],'withText':!0x0,'role':'menuitem','class':'ck-ai-quick-actions-button\x20ck-ai-quick-actions-search-result-button\x20ck-ai-quick-actions-search-result-button_with-group','tooltip':!0x1}),_0xce4b47['setTemplate']({'tag':'button','attributes':{'class':['ck','ck-button','ck-button_with-text','ck-ai-quick-actions-button','ck-ai-quick-actions-search-result-button','ck-ai-quick-actions-search-result-button_with-group'],'type':'button','role':'menuitem','tabindex':'-1'},'children':[_0x4692b0],'on':{'mouseenter':_0x553fe5['to'](()=>{this['_isSearchFocused']()||_0xce4b47['focus']();}),'click':_0x553fe5['to'](()=>{this['_handleSearchResultButtonClick'](_0xce4b47);})}}),this['_setupActionButtonExecution'](_0xce4b47,_0x8e228b,_0x3b000d),_0x10026e['children']['add'](_0xce4b47),{'listItem':_0x10026e,'highlightViews':[_0x2aafa6,_0x28849b]};}['_createSearchResultIndividualActionButton'](_0x42dfa8,_0x8763a6){const _0x1ec16e=new Pt(this['locale']),_0x43e30a=new _0x38f719(),_0x43463e=new kt(this['locale'],_0x43e30a),_0x193fe7=_0x43463e['bindTemplate'];return _0x43463e['set']({'label':_0x8763a6['label'],'withText':!0x0,'role':'menuitem','icon':void 0x0,'tooltip':!0x1,'class':'ck-ai-quick-actions-button\x20ck-ai-quick-actions-search-result-button'}),_0x43463e['extendTemplate']({'on':{'mouseenter':_0x193fe7['to'](()=>{this['_isSearchFocused']()||_0x43463e['focus']();})}}),this['_setupActionButtonExecution'](_0x43463e,_0x42dfa8,_0x8763a6),_0x1ec16e['children']['add'](_0x43463e),{'listItem':_0x1ec16e,'highlightViews':[_0x43e30a]};}['_createSearchResultGroupRow'](_0x4d524d,_0x228906){const _0x3070ba=new Nt(this['locale']),_0x2e326b=new yt();_0x2e326b['content']=_0x228906,_0x2e326b['extendTemplate']({'attributes':{'class':'ck-ai-quick-actions-button__group-icon'}});const _0x16a4ec=new _0x3526fb();return _0x16a4ec['text']=_0x4d524d,_0x3070ba['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-quick-actions-search-result__group-row'},'children':[_0x2e326b,_0x16a4ec]}),{'view':_0x3070ba,'highlightView':_0x16a4ec};}['_createSearchResultActionRow'](_0x25d8e2){const _0xd4e85b=new Nt(this['locale']),_0x5a4fc4=new _0x3526fb();return _0x5a4fc4['text']=_0x25d8e2,_0xd4e85b['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-quick-actions-search-result__action-row'},'children':[_0x5a4fc4]}),{'view':_0xd4e85b,'highlightView':_0x5a4fc4};}['_createSearchResultContentView'](_0x38c387,_0x4f142d){const _0xfa124=new Nt(this['locale']);return _0xfa124['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-quick-actions-search-result__content'},'children':[_0x38c387,_0x4f142d]}),_0xfa124;}['_setupActionButtonExecution'](_0x56150e,_0x549e4f,_0x9f62a3){_0x56150e['on']('execute',()=>{_0x549e4f['editing']['view']['focus'](),_0x549e4f['commands']['execute']('aiQuickAction',_0x9f62a3);});}['_createActionGroupButton'](_0x5ada05,_0x3260fa,_0x6ac87e){const _0x409432=new Pt(this['locale']),_0x1e9fc4=new _0x38f719(),_0x35171e=new Oa(this['locale'],_0x1e9fc4),_0x399d5f=_0x35171e['bindTemplate'],_0x1f7ebd=this['_getPanelKeystroke'](_0x6ac87e),_0x12c84b=this['_createGroupActionsList'](_0x5ada05,_0x3260fa['actions'],_0x6ac87e);_0x35171e['set']({'label':_0x3260fa['label'],'withText':!0x0,'role':va,'icon':_0x3260fa['icon']??_0x1712b4,'isEnabled':_0x3260fa['actions']['some'](_0x3f6352=>_0x3f6352['isEnabled'])}),_0x35171e['extendTemplate']({'on':{'mouseenter':_0x399d5f['to'](()=>{this['_isSearchFocused']()||_0x35171e['focus']();})}});const _0x150720=new Qt(this['locale']);return _0x150720['extendTemplate']({'attributes':{'class':['ck','ck-reset_all','ck-ai-quick-actions-group-panel','ck-dropdown-menu__nested-menu__panel']},'on':{'keydown':_0x399d5f['to'](_0x3ad2a2=>{this['_handlePanelKeydown'](_0x3ad2a2,_0x1f7ebd,_0x35171e,_0x150720);})}}),_0x35171e['bind']('isOn')['to'](_0x150720,'isVisible'),this['_bodyCollection']['add'](_0x150720),_0x150720['content']['add'](_0x12c84b),this['_setupGroupMenuBehavior'](_0x35171e,_0x150720),_0x409432['children']['add'](_0x35171e),{'listItem':_0x409432,'highlightView':_0x1e9fc4};}['_createGroupActionsList'](_0x5a56ac,_0x354f5c,_0x532c4b){const _0x7e0bb6=new Lt(this['locale']);return _0x7e0bb6['extendTemplate']({'attributes':{'class':['ck','ck-reset_all','ck-ai-quick-actions-group-list','ck-dropdown-menu-list']}}),_0x354f5c['forEach'](_0x1ff3e5=>{const _0x490931=new Pt(this['locale']),_0x12dd70=Ra({'editor':_0x5a56ac,'action':_0x1ff3e5,'withText':!0x0,'withIcon':!0x1,'isInDropdown':!0x0,'shouldPreventFocus':()=>this['_isSearchFocused']()})();_0x490931['children']['add'](_0x12dd70),_0x532c4b['focusTracker']['add'](_0x12dd70),_0x7e0bb6['items']['add'](_0x490931);}),_0x7e0bb6;}['_setupGroupMenuBehavior'](_0x37cf93,_0x425e3a){const _0x416945=_0x37cf93['bindTemplate'],_0x4431ba=this['_getButtonKeystroke'](_0x37cf93);_0x37cf93['extendTemplate']({'attributes':{'class':['ck-ai-quick-actions-group-button']},'on':{'mouseenter':_0x416945['to'](()=>{this['_showNestedPanel'](_0x425e3a,_0x37cf93);}),'mouseleave':_0x416945['to'](_0x31d2d7=>{const _0x1b1ab5=_0x31d2d7['relatedTarget'];this['_isMovingToNestedMenu'](_0x1b1ab5,_0x425e3a)||this['_hideNestedPanel'](_0x425e3a);}),'keydown':_0x416945['to'](_0x3b709b=>{_0x3b709b['key']==_0x4431ba&&(this['_showNestedPanel'](_0x425e3a,_0x37cf93),_0x425e3a['content']['get'](0x0)['focus']());})}}),_0x425e3a['on']('render',()=>{_0x425e3a['element']?.['addEventListener']('mouseleave',_0x1608d9=>{const _0x5d1f42=_0x1608d9['relatedTarget'];_0x37cf93['element']?.['contains'](_0x5d1f42)||this['_isMovingToNestedMenu'](_0x5d1f42,_0x425e3a)||this['_hideNestedPanel'](_0x425e3a);});});}['_showNestedPanel'](_0x3fec6c,_0x275eb5){this['_openNestedPanels']['forEach'](_0x372cd6=>{_0x372cd6!==_0x3fec6c&&_0x372cd6['isVisible']&&_0x372cd6['hide']();}),_0x3fec6c['show'](),_0x3fec6c['pin']({'positions':[_0x1fb8f6['eastSouth']],'target':_0x275eb5['element'],'fitInViewport':!0x0}),this['_openNestedPanels']['add'](_0x3fec6c);}['_hideNestedPanel'](_0x1e8034){_0x1e8034['hide'](),this['_openNestedPanels']['delete'](_0x1e8034);}['_hideAllNestedPanels'](){this['_openNestedPanels']['forEach'](_0x42dc21=>_0x42dc21['hide']()),this['_openNestedPanels']['clear']();}['_isMovingToNestedMenu'](_0x31f21e,_0x352998){if(!_0x31f21e)return!0x1;if(_0x352998['element']?.['contains'](_0x31f21e))return!0x0;const _0x30e755=_0x31f21e;return _0x30e755['closest']&&(null!==_0x30e755['closest']('.ck-ai-quick-actions-group-panel')||null!==_0x30e755['closest']('.ck-ai-quick-actions-group-list')||null!==_0x30e755['closest']('.ck-ai-quick-actions-group-button'));}['resetSearch'](){this['_searchTextView']&&this['_searchTextView']['reset']();}['destroy'](){this['_hideAllNestedPanels'](),this['_bodyCollection']['detachFromDom'](),super['destroy']();}['focus'](){this['_searchTextView']?this['_searchTextView']['focus']():this['optionsListView']['focus']();}['_getPanelKeystroke'](_0x54c004){return'rtl'===_0x54c004['locale']['uiLanguageDirection']?'ArrowRight':'ArrowLeft';}['_getButtonKeystroke'](_0x2fa4fd){return'rtl'===_0x2fa4fd['locale']['uiLanguageDirection']?'ArrowLeft':'ArrowRight';}['_handlePanelKeydown'](_0x4da8ed,_0x12da3e,_0x39caed,_0x41d28f){_0x4da8ed['key']==_0x12da3e&&(_0x39caed['focus'](),this['_hideNestedPanel'](_0x41d28f));}['_handleSearchResultButtonClick'](_0x41e659){_0x41e659['fire']('execute');}}function xa(_0x5c9f3f){const {editor:_0x3186c5,content:_0x41dcce,buttonDefinition:_0x33c152,bodyCollection:_0x7c22d,hasSearch:_0x5826d5=!0x1}=_0x5c9f3f;return()=>{const _0x22f1cb=_0x3186c5['locale'],_0x5ca518=Bt(_0x22f1cb);_0x5ca518['buttonView']['set']({'icon':_0x33c152['icon']??_0x1712b4,'label':_0x33c152['label'],'tooltip':!0x0}),_0x5ca518['set']({'class':'ck-ai-quick-actions-dropdown'});const _0x5b039b=new ya(_0x3186c5,_0x41dcce,_0x5ca518,_0x7c22d,_0x5826d5);return _0x5ca518['panelView']['children']['add'](_0x5b039b),_0x5826d5&&_0x5ca518['on']('change:isOpen',(_0x444abd,_0x1d87cc,_0x48fa9a)=>{if(_0x48fa9a){if(_0x3186c5['plugins']['has']('AIEditing')){const _0x260f62=_0x3186c5['plugins']['get'](qs),_0x379ace=_0x3186c5['model']['document']['selection'],_0x2ba688=Array['from'](_0x379ace['getRanges']());_0x2ba688['length']>0x0&&_0x260f62['showFakeVisualSelection']({'ranges':_0x2ba688,'id':'quick-action','priority':0x14});}}else _0x3186c5['plugins']['has']('AIEditing')&&_0x3186c5['plugins']['get'](qs)['hideFakeVisualSelection']('quick-action'),_0x5b039b['resetSearch']();}),_0x5ca518;};}const La='<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>',Da='<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>',Pa='<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>',Ha=/* #__PURE__ -- @preserve */
28
+ ((()=>({'chat':'AIChat','action':'AIActions'}))());class Ma extends _0x36293e{static get['requires'](){return[_0x35185f,rs];}static get['pluginName'](){return'AIQuickActionsUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}async['init'](){const _0xcbc1c8=await this['_getDefaultAndCustomActions']();this['_prepareQuickActionsDefinition'](_0xcbc1c8),this['_initializeQuickActionsComponentsAndCommands']();}static['getDefaultQuickActions'](_0x1ec371){return function(_0x4c188){const _0x47e13a=new Intl['DisplayNames'](['en'],{'type':'language'})['of'](_0x4c188['uiLanguage']),_0xefa681=_0x47e13a||'English',_0x44862c=[{'id':'ask-ai','label':as(_0x4c188,'AI_QUICK_ACTIONS_ASK_AI'),'type':'chat','icon':_0x290034},{'id':'chat-commands','label':as(_0x4c188,'AI_QUICK_ACTIONS_CHAT_COMMANDS'),'icon':_0x290034,'actions':[{'id':'explain','label':as(_0x4c188,'AI_QUICK_ACTIONS_EXPLAIN'),'displayedPrompt':as(_0x4c188,'AI_QUICK_ACTIONS_EXPLAIN'),'prompt':La['replace']('%0',_0xefa681),'type':'chat'},{'id':'summarize','label':as(_0x4c188,'AI_QUICK_ACTIONS_SUMMARIZE'),'displayedPrompt':as(_0x4c188,'AI_QUICK_ACTIONS_SUMMARIZE'),'prompt':Da['replace']('%0',_0xefa681),'type':'chat'},{'id':'highlight-key-points','label':as(_0x4c188,'AI_QUICK_ACTIONS_HIGHLIGHT_KEY_POINTS'),'displayedPrompt':as(_0x4c188,'AI_QUICK_ACTIONS_HIGHLIGHT_KEY_POINTS'),'prompt':Pa['replace']('%0',_0xefa681),'type':'chat'}]},{'id':'improve-writing','label':as(_0x4c188,'AI_QUICK_ACTIONS_IMPROVE_WRITING'),'type':'action','icon':_0x406d33},{'id':'continue','label':as(_0x4c188,'AI_QUICK_ACTIONS_CONTINUE_WRITING'),'type':'action','icon':_0xa98ff3},{'id':'fix-grammar','label':as(_0x4c188,'AI_QUICK_ACTIONS_FIX_GRAMMAR_SPELLING'),'type':'action','icon':_0x5694cf},{'id':'adjust-length','label':as(_0x4c188,'AI_QUICK_ACTIONS_ADJUST_LENGTH'),'icon':_0x20a93c,'actions':[{'id':'make-shorter','label':as(_0x4c188,'AI_QUICK_ACTIONS_MAKE_SHORTER'),'type':'action'},{'id':'make-longer','label':as(_0x4c188,'AI_QUICK_ACTIONS_MAKE_LONGER'),'type':'action'}]},{'id':'change-tone','label':as(_0x4c188,'AI_QUICK_ACTIONS_CHANGE_TONE'),'icon':_0x282695,'actions':[{'id':'make-tone-casual','label':as(_0x4c188,'AI_QUICK_ACTIONS_MORE_CASUAL'),'type':'action'},{'id':'make-tone-direct','label':as(_0x4c188,'AI_QUICK_ACTIONS_MORE_DIRECT'),'type':'action'},{'id':'make-tone-friendly','label':as(_0x4c188,'AI_QUICK_ACTIONS_MORE_FRIENDLY'),'type':'action'},{'id':'make-tone-confident','label':as(_0x4c188,'AI_QUICK_ACTIONS_MORE_CONFIDENT'),'type':'action'},{'id':'make-tone-professional','label':as(_0x4c188,'AI_QUICK_ACTIONS_MORE_PROFESSIONAL'),'type':'action'}]},{'id':'translate','label':as(_0x4c188,'AI_QUICK_ACTIONS_TRANSLATE'),'icon':_0x1b974b,'actions':[{'id':'translate-to-english','label':as(_0x4c188,'AI_QUICK_ACTIONS_TRANSLATE_ENGLISH'),'type':'action','actionName':'translate','args':{'language':'english'}},{'id':'translate-to-chinese','label':as(_0x4c188,'AI_QUICK_ACTIONS_TRANSLATE_CHINESE'),'type':'action','actionName':'translate','args':{'language':'chinese'}},{'id':'translate-to-spanish','label':as(_0x4c188,'AI_QUICK_ACTIONS_TRANSLATE_SPANISH'),'type':'action','actionName':'translate','args':{'language':'spanish'}},{'id':'translate-to-german','label':as(_0x4c188,'AI_QUICK_ACTIONS_TRANSLATE_GERMAN'),'type':'action','actionName':'translate','args':{'language':'german'}},{'id':'translate-to-french','label':as(_0x4c188,'AI_QUICK_ACTIONS_TRANSLATE_FRENCH'),'type':'action','actionName':'translate','args':{'language':'french'}},{'id':'translate-to-japanese','label':as(_0x4c188,'AI_QUICK_ACTIONS_TRANSLATE_JAPANESE'),'type':'action','actionName':'translate','args':{'language':'japanese'}},{'id':'translate-to-portuguese','label':as(_0x4c188,'AI_QUICK_ACTIONS_TRANSLATE_PORTUGUESE'),'type':'action','actionName':'translate','args':{'language':'portuguese'}},{'id':'translate-to-korean','label':as(_0x4c188,'AI_QUICK_ACTIONS_TRANSLATE_KOREAN'),'type':'action','actionName':'translate','args':{'language':'korean'}},{'id':'translate-to-italian','label':as(_0x4c188,'AI_QUICK_ACTIONS_TRANSLATE_ITALIAN'),'type':'action','actionName':'translate','args':{'language':'italian'}},{'id':'translate-to-russian','label':as(_0x4c188,'AI_QUICK_ACTIONS_TRANSLATE_RUSSIAN'),'type':'action','actionName':'translate','args':{'language':'russian'}}]},{'id':'other','label':as(_0x4c188,'AI_QUICK_ACTIONS_OTHER'),'icon':_0x4e8d08,'actions':[]}];return _0x44862c;}(_0x1ec371);}async['_getDefaultAndCustomActions'](){const _0x821e17=Ma['getDefaultQuickActions'](this['editor']['locale']),_0x16eabe=this['editor']['config']['get']('ai.quickActions.extraCommands')||[];let _0x26a779=[];try{_0x26a779=await new Bs({'connector':this['editor']['plugins']['get']('AIConnector'),'locale':this['editor']['locale']})['getAll']();}catch(_0x4fca00){const _0x1de197=new ot('ai-quick-actions-models-unable-to-retrieve',this,{'error':_0x4fca00});Et(_0x1de197['message']);}finally{const _0x1099d2=_0x16eabe['map'](_0x3403e6=>({..._0x3403e6,'type':'chat'===_0x3403e6['type']?'chat':'action','icon':void 0x0}));_0x821e17['find'](_0x4a4779=>'other'===_0x4a4779['id'])['actions']['push'](..._0x1099d2),_0x821e17['forEach'](_0x465403=>{if('actions'in _0x465403)_0x465403['actions']['forEach'](_0x1542ea=>{if(_0x1542ea['isEnabled']=!!_0x26a779['find'](_0x205a5d=>_0x205a5d['id']===_0x1542ea['model'])||void 0x0===_0x1542ea['model'],!_0x1542ea['isEnabled']){const _0x3fe9d9=new ot('ai-quick-actions-unavailable-model',this,{'actionId':_0x1542ea['id'],'modelId':_0x1542ea['model']});Et(_0x3fe9d9['message']);}});else{if(_0x465403['isEnabled']=!!_0x26a779['find'](_0x4987d6=>_0x4987d6['id']===_0x465403['model'])||void 0x0===_0x465403['model'],!_0x465403['isEnabled']){const _0x4f01cc=new ot('ai-quick-actions-unavailable-model',this,{'actionId':_0x465403['id'],'modelId':_0x465403['model']});Et(_0x4f01cc['message']);}}});}return _0x821e17;}['_initializeQuickActionsComponentsAndCommands'](){const _0x5c1ef0=new qt(this['editor']['locale']);_0x5c1ef0['attachToDom'](),this['_initializeQuickActionsDropdown'](_0x5c1ef0),this['_initializeQuickActionsMenuBar'](),this['_initializeQuickActionsComponents'](_0x5c1ef0);}['_initializeQuickActionsDropdown'](_0x52fd5d){const _0x1f2146=this['editor']['config']['get']('ai.quickActions.isSearchEnabled')??!0x0;this['editor']['ui']['componentFactory']['add']('aiQuickActions',xa({'editor':this['editor'],'content':this['_quickActionsDefinition'],'buttonDefinition':{'icon':_0x1712b4,'label':as(this['editor']['locale'],'AI_QUICK_ACTIONS_HEADING')},'bodyCollection':_0x52fd5d,'hasSearch':_0x1f2146}));}['_prepareQuickActionsDefinition'](_0x35ec98){this['_quickActionsDefinition']=_0x35ec98['map'](_0x4bb2de=>{if('actions'in _0x4bb2de){const _0x323b3a=_0x4bb2de;return{..._0x323b3a,'actions':_0x323b3a['actions']['map'](_0x48d8c6=>{const {actions:_0xd35db2,..._0x2e5c7d}=_0x323b3a;return{..._0x48d8c6,'parent':_0x2e5c7d};})['filter'](_0x50b6c1=>this['_shouldIncludeAction'](_0x50b6c1))};}return _0x4bb2de;})['filter'](_0x5b32a9=>'actions'in _0x5b32a9?_0x5b32a9['actions']['length']>0x0:this['_shouldIncludeAction'](_0x5b32a9));}['_shouldIncludeAction'](_0x42f44a){const _0x15543b=this['editor']['config']['get']('ai.quickActions.removeCommands')||[];return this['editor']['plugins']['has'](Ha[_0x42f44a['type']])&&!_0x15543b['includes'](_0x42f44a['id'])&&!('chat'===_0x42f44a['type']&&!0x1===this['editor']['config']['get']('ai.chat.context.document.enabled'));}['_initializeQuickActionsComponents'](_0x2c6bb1){this['_quickActionsDefinition']['forEach'](_0x4d6030=>{if('actions'in _0x4d6030){const _0x1fb5a5=xa({'editor':this['editor'],'content':_0x4d6030['actions'],'buttonDefinition':_0x4d6030,'bodyCollection':_0x2c6bb1});this['editor']['ui']['componentFactory']['add'](_0x4d6030['id'],_0x1fb5a5),_0x4d6030['actions']['forEach'](_0x22dc5d=>{const _0x431ad1=Ra({'editor':this['editor'],'action':_0x22dc5d});this['editor']['ui']['componentFactory']['add'](_0x22dc5d['id'],_0x431ad1);});}else{const _0x24a8d4=Ra({'editor':this['editor'],'action':_0x4d6030,'withText':!0x1,'withIcon':!0x0,'isInDropdown':!0x1});this['editor']['ui']['componentFactory']['add'](_0x4d6030['id'],_0x24a8d4);}});}['_initializeQuickActionsMenuBar'](){this['editor']['ui']['componentFactory']['add']('menuBar:aiQuickActions',_0x5b52ba=>{const _0x5126a9=new Ft(_0x5b52ba),_0x555939=as(_0x5b52ba,'AI_QUICK_ACTIONS_HEADING');_0x5126a9['buttonView']['set']({'label':_0x555939,'icon':_0x1712b4});const _0xd21d9e=new Yt(_0x5b52ba);_0xd21d9e['set']({'ariaLabel':_0x555939,'role':'menu'}),this['_quickActionsDefinition']['forEach'](_0x37b0b7=>{if('actions'in _0x37b0b7){const _0x15418d=_0x37b0b7,_0x2e4905=new $t(_0x5b52ba,_0x5126a9),_0xe86c65=new Ft(_0x5b52ba),_0x53236c=new Yt(_0x5b52ba);_0xe86c65['buttonView']['set']({'label':_0x15418d['label'],'icon':_0x15418d['icon']}),_0x15418d['actions']['forEach'](_0xfb7091=>{const _0x10ddd1=new $t(_0x5b52ba,_0xe86c65),_0x2bfacf=new Kt(_0x5b52ba);_0x2bfacf['set']({'label':_0xfb7091['label'],'icon':_0xfb7091['icon'],'role':'menuitem','isEnabled':_0xfb7091['isEnabled']}),_0x2bfacf['on']('execute',()=>{this['_executeQuickAction'](_0xfb7091);}),_0x2bfacf['delegate']('execute')['to'](_0xe86c65),_0x10ddd1['children']['add'](_0x2bfacf),_0x53236c['items']['add'](_0x10ddd1);}),_0xe86c65['panelView']['children']['add'](_0x53236c),_0x2e4905['children']['add'](_0xe86c65),_0xd21d9e['items']['add'](_0x2e4905);}else{const _0x30bcbf=_0x37b0b7,_0x1750a8=new $t(_0x5b52ba,_0x5126a9),_0x176757=new Kt(_0x5b52ba);_0x176757['set']({'label':_0x30bcbf['label'],'icon':_0x30bcbf['icon'],'role':'menuitem','isEnabled':_0x30bcbf['isEnabled']}),_0x176757['on']('execute',()=>{this['_executeQuickAction'](_0x30bcbf);}),_0x176757['delegate']('execute')['to'](_0x5126a9),_0x1750a8['children']['add'](_0x176757),_0xd21d9e['items']['add'](_0x1750a8);}});const _0x408f48=Object['values'](Ha)['some'](_0xdc87f9=>this['editor']['plugins']['has'](_0xdc87f9));return _0x5126a9['set']({'isEnabled':_0x408f48}),_0x5126a9['panelView']['children']['add'](_0xd21d9e),_0x5126a9;});}['_executeQuickAction'](_0x3c65cf){const _0x372c3a=this['editor'];_0x372c3a['editing']['view']['focus'](),_0x372c3a['commands']['execute']('aiQuickAction',_0x3c65cf);const _0x549da8=_0x372c3a['ui']['view']['menuBarView'];_0x549da8&&_0x549da8['close']&&_0x549da8['close']();}}class Ua extends _0x1afbde{['execute'](_0x52304e){switch(this['_expandSelectionIfCollapsed'](),_0x52304e['type']){case'chat':if(!this['editor']['plugins']['has']('AIChat')){const _0x246afd=as(this['editor']['locale'],'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND','AIChat');throw new ot('ai-quick-actions-plugin-not-found',this['editor'],{'errorMessage':_0x246afd});}this['_handleAIChatAction'](_0x52304e);break;case'action':if(!this['editor']['plugins']['has']('AIActions')){const _0x27ae5c=as(this['editor']['locale'],'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND','AIActions');throw new ot('ai-quick-actions-plugin-not-found',this['editor'],{'errorMessage':_0x27ae5c});}this['_handleAIActionsAction'](_0x52304e);}}async['_handleAIChatAction'](_0x3abb7f){const _0x703b66=this['editor']['plugins']['get']('AIChatController'),_0x27b2b6=this['editor']['plugins']['get']('AITabs')['view'];if(_0x27b2b6['isVisible']||(_0x27b2b6['isVisible']=!0x0),'chat'!==_0x27b2b6['activeTab']&&_0x27b2b6['activateTab']('chat'),'ask-ai'===_0x3abb7f['id'])_0x703b66['removeSelectionFromChatContext'](),_0x703b66['addSelectionToChatContext'](),_0x703b66['focusPromptInput']();else await _0x703b66['startConversation'](),_0x703b66['removeSelectionFromChatContext'](),_0x703b66['addSelectionToChatContext'](),_0x703b66['focusPromptInput'](),await _0x703b66['sendMessage']({'message':_0x3abb7f['prompt']||_0x3abb7f['displayedPrompt']||_0x3abb7f['label'],'attributes':{'quickActionData':{'id':_0x3abb7f['id']},'displayedPrompt':_0x3abb7f['displayedPrompt']}});}['_expandSelectionIfCollapsed'](){const _0x587d98=this['editor'],_0x2a68db=_0x587d98['model']['document']['selection'];if(!_0x2a68db['isCollapsed'])return;const _0x24c371=gt(_0x2a68db['getSelectedBlocks']())||_0x587d98['model']['schema']['getLimitElement'](_0x2a68db);_0x587d98['model']['change'](_0x2ff388=>{_0x2ff388['setSelection'](_0x24c371,'in');});}['_handleAIActionsActionLabel'](_0x3643df){return _0x3643df['parent']?.['label']&&'other'!==_0x3643df['parent']?.['id']?_0x3643df['parent']['label']+':\x20'+_0x3643df['label']:_0x3643df['label'];}async['_handleAIActionsAction'](_0x4671bc){const _0x20d858=this['editor']['plugins']['get']('AIActions'),_0x212d83=_0x4671bc['prompt']?{'userMessage':_0x4671bc['prompt'],'model':_0x4671bc['model']}:{'actionName':_0x4671bc['actionName']||_0x4671bc['id'],'args':_0x4671bc['args']},_0x3b0744=this['_handleAIActionsActionLabel'](_0x4671bc);await _0x20d858['executeAction'](_0x212d83,_0x3b0744,_0x4671bc['icon']);}}class Va extends _0x36293e{static get['pluginName'](){return'AIQuickActionsEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x2f69a5=this['editor'],_0xd1b4b5=new Ua(this['editor']);if(_0x2f69a5['commands']['add']('aiQuickAction',_0xd1b4b5),_0x2f69a5['plugins']['has']('AIChat')){const _0x331d76=this['editor']['plugins']['get']('AIChatController');_0x2f69a5['model']['document']['selection']['on']('change:range',(_0x14cb75,_0x506d52)=>{_0x506d52['directChange']&&_0x331d76['removeSelectionFromChatContext']();});}}}class Ba extends vs{['updateChangeGroups'](){if(this['parsedMergedContent']=this['parsedContent']['cloneNode'](!0x0),0x0==this['parsedMergedContent']['childNodes']['length'])return void(this['changeGroups']=[]);const _0x54a69b=this['documentContextContent']['children']['map'](_0x3153c=>({'node':_0x3153c,'id':gs(_0x3153c,'data-id')})),_0x20654b=this['parsedMergedContent']['children']['map'](_0xac9545=>({'node':_0xac9545,'id':gs(_0xac9545,'data-id')||at()})),_0x4eb7e2=_0x27f968(_0x54a69b,_0x20654b,{'comparator':(_0x1e9fd1,_0x53db75)=>_0x1e9fd1['id']==_0x53db75['id'],'oneChangePerToken':!0x0});if(!this['isDone']){for(;_0x4eb7e2['length']&&_0x4eb7e2[_0x4eb7e2['length']-0x1]['removed'];)_0x4eb7e2['pop']();}const _0x1874eb=_0x4eb7e2['map'](_0x42f0e1=>{const _0x26e1b0=_0x42f0e1['added']?'new':_0x42f0e1['removed']?'removed':'modified';return{'node':_0x42f0e1['value'][0x0]['node'],'type':_0x26e1b0,'id':_0x42f0e1['value'][0x0]['id']};});this['changeGroups']=[{'changes':_0x1874eb,'state':'pending','index':0x0}];}['_getDifferentChangeGroups'](_0x2446e7,_0x3088b7){return _0x3088b7;}}class Ga extends xs{['content'];['version'];['actionName'];['args'];['userMessage'];['model'];['hasError']=!0x1;['stoppedExplicitly']=!0x1;constructor(_0x1d6e23){super(_0x1d6e23),this['content']=_0x1d6e23['content'],this['version']=_0x1d6e23['version'],this['actionName']=_0x1d6e23['actionName'],this['args']=_0x1d6e23['args'],this['userMessage']=_0x1d6e23['userMessage'],this['model']=_0x1d6e23['model'],this['on']('interactionStopped',()=>{this['stoppedExplicitly']=!0x0;});}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':'text','content':this['content'],'version':this['version'],'label':'Current\x20document','uiId':'current-document'};}['createReply'](_0x1a08a1){const _0x3bec60=new Ba({'editor':this['editor'],'documentContextContent':this['content'],..._0x1a08a1});return this['replies']['push'](_0x3bec60),_0x3bec60['delegate'](...ys)['to'](this),this['fire']('replyCreated',_0x3bec60),_0x3bec60;}}class Fa extends Ot{constructor(_0x1ad7d3,_0x93102f=!0x0,_0x160ab0=!0x0){super(_0x1ad7d3),this['set']('isEnabled',!0x1),_0x93102f&&(this['applyButton']=this['_createButton'](as(_0x1ad7d3,'AI_BALLOON_APPLY_BUTTON'),os),this['applyButton']['bind']('isEnabled')['to'](this),this['items']['add'](this['applyButton'])),_0x160ab0&&(this['suggestButton']=this['_createButton'](as(_0x1ad7d3,'AI_BALLOON_SUGGEST_BUTTON'),_0x93102f?hs:os),this['suggestButton']['bind']('isEnabled')['to'](this),this['items']['add'](this['suggestButton'])),this['setButtonsVisibility']({'showApplyButton':_0x93102f,'showSuggestButton':_0x160ab0}),this['extendTemplate']({'attributes':{'class':['ck-ai-balloon__toolbar']}});}['setButtonsVisibility']({showApplyButton:_0x347332,showSuggestButton:_0x5c6635}){this['applyButton']&&(this['applyButton']['isVisible']=_0x347332),this['suggestButton']&&(this['suggestButton']['isVisible']=_0x5c6635);}['_createButton'](_0x2a2fc1,_0x42c826){const _0x13befc=new kt(this['locale']);return _0x13befc['set']({'label':_0x2a2fc1,'class':_0x42c826,'isVisible':!0x0,'withText':!0x0}),_0x13befc;}}class Ka extends Nt{constructor(_0x9f75e1){super(_0x9f75e1),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-balloon__disclaimer']},'children':[{'tag':'p','attributes':{'class':['ck','ck-ai-balloon__disclaimer-content']},'children':[{'text':as(_0x9f75e1,'AI_DISCLAIMER_TEXT')}]}]});}}class Wa extends Nt{constructor(_0x4d4875){super(_0x4d4875),this['set']('isVisible',!0x0);const _0x5afc34=new fn('small');_0x5afc34['isVisible']=!0x0;const _0x1f78d0=new Nt(this['locale']);_0x1f78d0['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-suggestion__loader-text']},'children':[as(this['locale'],'AI_CHAT_IS_WRITING')]}),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__loader',this['bindTemplate']['if']('isVisible','ck-hidden',_0x3e6d2d=>!_0x3e6d2d)]},'children':[_0x5afc34,_0x1f78d0]});}}class Ya extends Ta{['focusCycler'];['_config'];['_contentWrapper'];['_streamableContentView'];['_toolbarView'];['_miniToolbarView'];['_loaderView'];['_disclaimerView'];['_focusTracker'];['_keystrokes'];['_dialogContent'];['_focusables'];['_scrollManager'];['_navigationPreviousButton'];['_navigationNextButton'];['_navigationTryAgainButton'];['_navigationCounter'];constructor(_0x4d4e67,_0x23a72c){super(_0x4d4e67),this['set']('isBusy',!0x1),this['set']('isTrackChangesOn',!0x1),this['set']('_isLoading',!0x1),this['set']('_hasError',!0x1),this['_config']=_0x23a72c,this['_focusTracker']=new _t(),this['_keystrokes']=new At(),this['_focusables']=this['createCollection'](),this['focusCycler']=new Mt({'focusables':this['_focusables'],'focusTracker':this['_focusTracker'],'keystrokeHandler':this['_keystrokes'],'actions':{'focusPrevious':'shift\x20+\x20tab','focusNext':'tab'}}),this['_dialogContent']=new _0xfc7125(),this['_addContentWrapper'](_0x23a72c),this['_addDisclaimerView'](),this['_addToolbar'](_0x23a72c),this['_focusables']['clear'](),this['_focusables']['addMany']([this['_toolbarView']]),this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-actions-balloon-main']},'children':this['_dialogContent']}),this['on']('change:isTrackChangesOn',()=>{this['_toggleToolbarButtonsVisibility'](_0x23a72c);});}['render'](){super['render']();for(const _0x52e2b4 of this['_focusables'])this['_focusTracker']['add'](_0x52e2b4['element']);this['_keystrokes']['listenTo'](this['element']),this['_initializeScrollManager']();}['destroy'](){super['destroy'](),this['_scrollManager']&&this['_scrollManager']['destroy']();}['focus'](_0x5c76ab){-0x1===_0x5c76ab?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}['setIsLoading'](_0x1c4fe3){this['_isLoading']=_0x1c4fe3;}['setErrorState'](){this['_hasError']=!0x0,this['_miniToolbarView']['toggleShowChangesEnabled'](!0x1);}['clearErrorState'](){this['_hasError']=!0x1,this['_miniToolbarView']['toggleShowChangesEnabled'](!0x0);}['showError'](_0x52a5a0){super['showError'](_0x52a5a0),this['_dialogContent']['has'](this['_errorView'])||this['_dialogContent']['add'](this['_errorView'],0x0);}['hideError'](){super['hideError'](),this['clearErrorState']();}['showBlockingError'](_0x49955b){super['showBlockingError'](_0x49955b),this['setErrorState']();}['addMiniToolbarItem'](_0x7e23fc){this['_miniToolbarView']['items']['has'](_0x7e23fc)||this['_miniToolbarView']['items']['add'](_0x7e23fc);}['removeMiniToolbarItem'](_0x4e475d){this['_miniToolbarView']['items']['has'](_0x4e475d)&&this['_miniToolbarView']['items']['remove'](_0x4e475d);}['showLoader'](){this['_loaderView']&&(this['_isLoading']=!0x0);}['hideLoader'](){this['_loaderView']&&(this['_isLoading']=!0x1);}['_toggleToolbarButtonsVisibility']({showApplyButton:_0x363a46,showSuggestButton:_0x8ec59a}){_0x363a46=_0x363a46&&!this['isTrackChangesOn']&&this['_config']['availableActions']['includes']('applySuggestion'),_0x8ec59a=_0x8ec59a&&this['_config']['availableActions']['includes']('insertSuggestion'),this['_toolbarView']['setButtonsVisibility']({'showApplyButton':_0x363a46,'showSuggestButton':_0x8ec59a});}async['updateContent'](_0x2ae241){await this['_streamableContentView']['update'](_0x2ae241);}['clearContent'](){this['_streamableContentView']['clear']();}['_addContentWrapper'](_0x31348a){this['_contentWrapper']=new Nt(this['locale']),this['_contentWrapper']['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-actions-balloon-content']},'children':[{'tag':'div','attributes':{'class':['ck-ai-actions-balloon-content-wrapper']},'children':[this['_createLoaderView'](),this['_createStreamableContentView']()]},this['_createMiniToolbar'](_0x31348a['miniToolbarConfig'])]}),this['_dialogContent']['add'](this['_contentWrapper']);}['_addDisclaimerView'](){this['_disclaimerView']=new Ka(this['locale']),this['_dialogContent']['add'](this['_disclaimerView']);}['_addToolbar']({showApplyButton:_0x78b499,showSuggestButton:_0x427da9}){this['_toolbarView']=new Fa(this['locale'],_0x78b499,_0x427da9),this['_toolbarView']['applyButton']?.['on']('execute',()=>{this['fire']('applySuggestion');}),this['_toolbarView']['suggestButton']?.['on']('execute',()=>{this['fire']('insertSuggestion');}),this['_toolbarView']['bind']('isEnabled')['to'](this,'isBusy',this,'_isLoading',this,'_hasError',(_0x1c8d36,_0x6b3375,_0x149aca)=>!(_0x1c8d36||_0x6b3375||_0x149aca)),this['_toggleToolbarButtonsVisibility']({'showApplyButton':_0x78b499,'showSuggestButton':_0x427da9}),this['_dialogContent']['add'](this['_toolbarView']);}['_createMiniToolbar'](_0x13f23d){return this['_miniToolbarView']=new Ca(this['locale'],_0x13f23d),this['_miniToolbarView']['delegate'](...Qs)['to'](this),this['_miniToolbarView']['on']('toggleShowChanges',()=>{this['_miniToolbarView']['isShowChangesOn']=!this['_miniToolbarView']['isShowChangesOn'],this['fire']('toggleSuggestionDisplayMode',{'showDiff':this['_miniToolbarView']['isShowChangesOn']});}),this['_miniToolbarView']['bind']('isEnabled')['to'](this,'isBusy',this,'_isLoading',(_0x5a4c3e,_0x52b9b7)=>!(_0x5a4c3e||_0x52b9b7)),this['_miniToolbarView'];}['_createLoaderView'](){return this['_loaderView']=new Wa(this['locale']),this['_loaderView']['bind']('isVisible')['to'](this,'_isLoading'),this['_loaderView'];}['_createStreamableContentView'](){return this['_streamableContentView']=new un(this['locale']),this['_streamableContentView'];}['_setupMiniToolbarButtons'](){const _0x19332b=new kt(this['locale']),_0x114b53=new kt(this['locale']),_0xa89dfb=new $a(this['locale']),_0x1ff7ff=new kt(this['locale']);_0x19332b['set']({'icon':tt,'label':as(this['locale'],'AI_ACTIONS_TRY_AGAIN'),'tooltip':!0x0,'class':'ck-ai-custom-action-button\x20'+cs}),_0x114b53['set']({'icon':_0x2d78f7,'tooltip':as(this['locale'],'AI_ACTIONS_PREVIOUS_INTERACTION'),'class':'ck-ai-navigation-button\x20ck-ai-previous-button\x20'+cs}),_0x1ff7ff['set']({'icon':et,'tooltip':as(this['locale'],'AI_ACTIONS_NEXT_INTERACTION'),'class':'ck-ai-navigation-button\x20ck-ai-next-button\x20'+cs}),_0x19332b['bind']('isEnabled')['to'](this,'isBusy',_0x3e2135=>!_0x3e2135),_0x19332b['on']('execute',()=>{this['fire']('tryAgain');}),_0x114b53['bind']('isEnabled')['to'](this,'isBusy',_0x109a96=>!_0x109a96),_0x114b53['on']('execute',()=>{this['fire']('showPrevious');}),_0x1ff7ff['bind']('isEnabled')['to'](this,'isBusy',_0x5910d7=>!_0x5910d7),_0x1ff7ff['on']('execute',()=>{this['fire']('showNext');}),this['_navigationPreviousButton']=_0x114b53,this['_navigationCounter']=_0xa89dfb,this['_navigationNextButton']=_0x1ff7ff,this['_navigationTryAgainButton']=_0x19332b;}['updateMiniToolbarButtons'](_0x3bdf5c,_0x1ba288){this['_navigationPreviousButton']||this['_setupMiniToolbarButtons']();const _0x1a3d54=_0x3bdf5c>0x1;if(this['addMiniToolbarItem'](this['_navigationTryAgainButton']),_0x1a3d54){this['addMiniToolbarItem'](this['_navigationPreviousButton']),this['addMiniToolbarItem'](this['_navigationCounter']),this['addMiniToolbarItem'](this['_navigationNextButton']);const _0x9852f6=_0x3bdf5c-_0x1ba288;this['_navigationCounter']['setInteractionCount'](_0x9852f6+'/'+_0x3bdf5c),this['_navigationPreviousButton']['isEnabled']=_0x1ba288<_0x3bdf5c-0x1,this['_navigationNextButton']['isEnabled']=_0x1ba288>0x0;}else this['removeMiniToolbarItem'](this['_navigationPreviousButton']),this['removeMiniToolbarItem'](this['_navigationCounter']),this['removeMiniToolbarItem'](this['_navigationNextButton']);}['disableMiniToolbarButtons'](){this['_navigationTryAgainButton']['isEnabled']=!0x1,this['_navigationPreviousButton']['isEnabled']=!0x1,this['_navigationNextButton']['isEnabled']=!0x1;}['startAutoScroll'](){this['_initializeScrollManager'](),this['_scrollManager']&&this['_scrollManager']['start']();}['stopAutoScroll'](){this['_scrollManager']&&this['_scrollManager']['stop']();}['toggleIsLoading'](_0x866773){this['_isLoading']=_0x866773;}['resetShowChangesButton'](){this['_miniToolbarView']['isShowChangesOn']=!0x1;}['_initializeScrollManager'](){const _0x373d59=this['_getScrollableElement']();_0x373d59&&!this['_scrollManager']&&(this['_scrollManager']=new Xn(_0x373d59));}['_getScrollableElement'](){return this['_streamableContentView']['element'];}}class $a extends Nt{constructor(_0x2efed2){super(_0x2efed2);const _0x4aae10=this['bindTemplate'];this['set']('interactionCount','1/1'),this['setTemplate']({'tag':'span','attributes':{'class':['ck-ai-interaction-counter']},'children':[{'text':_0x4aae10['to']('interactionCount')}]});}['setInteractionCount'](_0x258b44){this['set']('interactionCount',_0x258b44);}}class qa extends _0x36293e{static get['requires'](){return[rs,Vt,qs,ma,_0x2e7618];}static get['pluginName'](){return'AIActions';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['_aiConnector'];['_interactions']=[];['_currentInteractionIndex']=0x0;['_interactionParams'];['_balloonShowDiff']=!0x1;['_promiseQueue'];['_bodyCollection'];get['_interaction'](){return this['_interactions'][this['_interactions']['length']-0x1];}['_actionsBalloonView'];constructor(_0x57a7a5){super(_0x57a7a5),this['_bodyCollection']=new qt(this['editor']['locale']),this['_bodyCollection']['attachToDom'](),this['_aiConnector']=this['editor']['plugins']['get']('AIConnector'),this['set']('isBusy',!0x1),this['_promiseQueue']=new _n();}['stopInteraction'](){this['_stopInteraction']();}async['executeAction'](_0x2728dd,_0x3cb1da,_0x560f91){if(this['_stopInteraction'](),this['editor']['plugins']['has']('TableSelection')){if(this['editor']['plugins']['get']('TableSelection')['getSelectedTableCells']()){const {modelFragment:_0x2c377c,anchorData:_0x7a2001}=this['_getExecuteDataInTable']();return this['_executeAction'](_0x2728dd,_0x2c377c,_0x7a2001,_0x3cb1da,_0x560f91);}}const {modelFragment:_0x471c04,anchorData:_0x56777d}=this['_getExecuteDataRegular']();return this['_executeAction'](_0x2728dd,_0x471c04,_0x56777d,_0x3cb1da,_0x560f91);}async['destroy'](){return this['_stopInteraction'](),this['_bodyCollection']['detachFromDom'](),super['destroy']();}['_createActionsBalloonView'](){const _0x370f0f=this['editor']['plugins']['has']('TrackChanges');let _0xb53f3=this['editor']['config']['get']('ai.availableReplyActions')||[...gn];_0x370f0f||(_0xb53f3=_0xb53f3['filter'](_0x52ce69=>'insertSuggestion'!=_0x52ce69));const _0x46e857=this['editor']['commands']['get']('trackChanges'),_0x5128ed=new Ya(this['editor']['locale'],{'showApplyButton':!0x0,'showSuggestButton':_0x370f0f,'miniToolbarConfig':{'showChanges':'icon'},'availableActions':_0xb53f3});return _0x5128ed['bind']('isBusy')['to'](this),_0x46e857&&_0x5128ed['bind']('isTrackChangesOn')['to'](_0x46e857,'value'),_0x5128ed['on']('tryAgain',()=>{this['_refreshInteraction']();}),_0x5128ed['on']('showPrevious',()=>{this['_navigateToPrevious']();}),_0x5128ed['on']('showNext',()=>{this['_navigateToNext']();}),_0x5128ed;}['_getExecuteDataRegular'](){const _0x11253e=this['editor']['model']['document']['selection'];if(_0x11253e['isCollapsed']){const _0x4b9859=gt(_0x11253e['getSelectedBlocks']())||this['editor']['model']['schema']['getLimitElement'](_0x11253e);this['editor']['model']['change'](_0x467030=>{_0x467030['setSelection'](_0x4b9859,'in');});}const _0x49824a=_0x11253e['getFirstRange'](),_0x40bfca=this['_wrapWithCommonAncestors'](this['editor']['model']['getSelectedContent'](_0x11253e),_0x49824a['start'],_0x49824a['end']);this['_copyMarkersToFragment'](_0x40bfca,_0x11253e,{'isTableSelection':!0x1});const _0xd7808e=_0x11253e['getFirstRange']()['start'],_0x1372ff=new Map();let _0x10ba0f=_0x40bfca;for(let _0x572e27=0x0;_0x572e27<_0xd7808e['path']['length'];_0x572e27++)_0x1372ff['set'](_0x10ba0f,_0xd7808e['path'][_0x572e27]),_0x10ba0f=_0x10ba0f['getChild'](0x0);return{'modelFragment':_0x40bfca,'anchorData':_0x1372ff};}['_getExecuteDataInTable'](){const _0x5404b6=this['editor']['model']['document']['selection'],_0x3c7982=this['editor']['plugins']['get']('TableSelection')['getSelectionAsFragment'](),_0x33eae6=_0x5404b6['getFirstRange']()['start']['parent']['parent'],_0x95a59f=this['editor']['model']['createRange'](this['editor']['model']['createPositionBefore'](_0x33eae6),this['editor']['model']['createPositionAfter'](_0x33eae6)),_0x5e29bb=this['_wrapWithCommonAncestors'](_0x3c7982,_0x95a59f['start'],_0x95a59f['end']);this['_copyMarkersToFragment'](_0x5e29bb,_0x5404b6,{'isTableSelection':!0x0});const _0xf69bb9=_0x5404b6['getFirstRange']()['start'],_0x72a8d7=new Map();let _0x41287b=_0x5e29bb;for(let _0x33e57a=0x0;_0x33e57a<_0xf69bb9['path']['length'];_0x33e57a++)if(_0x72a8d7['set'](_0x41287b,_0xf69bb9['path'][_0x33e57a]),_0x33e57a<_0xf69bb9['path']['length']-0x1)_0x41287b=_0x41287b['getChild'](0x0);else{let _0x6f52e1=_0x41287b['nextSibling'];for(;_0x6f52e1;)_0x72a8d7['set'](_0x6f52e1,_0xf69bb9['path'][_0x33e57a]),_0x6f52e1=_0x6f52e1['nextSibling'];}return{'modelFragment':_0x5e29bb,'anchorData':_0x72a8d7};}async['_executeAction'](_0x411eb1,_0x3baabd,_0x3578a4,_0x3c154b,_0x2bc0b1){const _0x10f4a8=this['editor']['plugins']['get'](qs),_0x1bbb7d=this['editor']['plugins']['get'](ma),_0x596163=this['editor']['model']['document']['selection'],_0x5639d4=await _0x10f4a8['modelToDataWithIds'](_0x3baabd),_0x16c23e=this['editor']['model']['document']['version'],_0x299527=[..._0x596163['getRanges']()];return this['_actionsBalloonView']||(this['_actionsBalloonView']=this['_createActionsBalloonView']()),this['_clearInteractionHistory'](),this['_clearErrorState'](),this['_balloonShowDiff']=!0x1,this['_actionsBalloonView']['resetShowChangesButton'](),this['_actionsBalloonView']['clearContent'](),_0x1bbb7d['open']({'index':0x3e8*Math['random']()%0x3e8,'title':_0x3c154b,'icon':_0x2bc0b1||_0x1712b4,'mainView':this['_actionsBalloonView'],'class':'ck-ai-actions-balloon','ranges':_0x299527,'id':'aiActionsBalloon'}),this['_setLoadingState'](),this['stopListening'](this['_actionsBalloonView']),this['stopListening'](_0x1bbb7d),this['_interactionParams']={'action':_0x411eb1,'content':_0x5639d4,'version':_0x16c23e,'aiBalloon':_0x1bbb7d,'modelFragment':_0x3baabd,'anchorData':_0x3578a4},this['_setupApplyListeners'](),this['listenTo'](_0x1bbb7d,'selectionRemoved',()=>{this['_stopInteraction'](),this['_actionsBalloonView']['disableMiniToolbarButtons']();}),this['listenTo'](_0x1bbb7d,'dialogClosed',(_0x39eaa9,{id:_0x304fa6})=>{if('aiActionsBalloon'===_0x304fa6){for(const _0xe32d8e of this['_interactions']){if(0x0===_0xe32d8e['replies']['length']||_0xe32d8e['stoppedExplicitly'])continue;const _0x30b03f=_0xe32d8e['replies'][_0xe32d8e['replies']['length']-0x1],_0x57cdbd=_0x30b03f['changeGroups'][0x0];_0x57cdbd&&'pending'===_0x57cdbd['state']&&_0x30b03f['setChangeGroupState'](0x0,'rejected');}this['_stopInteraction'](),this['_clearInteractionHistory'](),this['stopListening'](this['_actionsBalloonView']),this['stopListening'](_0x1bbb7d);}}),this['_createInteraction'](_0x5639d4,_0x16c23e,_0x1bbb7d,_0x411eb1);}['_setupApplyListeners'](){if(!this['_interactionParams'])return;const {modelFragment:_0x4c3273,anchorData:_0x25b168}=this['_interactionParams'];this['listenTo'](this['_actionsBalloonView'],'applySuggestion',()=>{this['_applyChanges'](_0x4c3273,_0x25b168,!0x1);}),this['listenTo'](this['_actionsBalloonView'],'insertSuggestion',()=>{this['_applyChanges'](_0x4c3273,_0x25b168,!0x0);});}['_wrapWithCommonAncestors'](_0x559c1c,_0x2d2e66,_0x5649d9){const _0x445b4f=this['editor']['model']['createRange'](_0x2d2e66,_0x5649d9)['getCommonAncestor'](),_0x28386c=_0x445b4f['is']('documentFragment')?[]:_0x445b4f['getAncestors']({'includeSelf':!0x0})['slice'](0x1);if(_0x28386c['length']){const _0xcb137=_0x28386c['map'](_0x53ba8d=>_0x53ba8d['_clone'](!0x1));for(let _0x3d3fb4=0x1;_0x3d3fb4<_0xcb137['length'];_0x3d3fb4++)_0xcb137[_0x3d3fb4-0x1]['_appendChild'](_0xcb137[_0x3d3fb4]);return _0xcb137[_0xcb137['length']-0x1]['_appendChild'](_0x559c1c),new _0x2af830(_0xcb137[0x0]);}return _0x559c1c;}['_copyMarkersToFragment'](_0x10d777,_0x43341d,_0x26551e={'isTableSelection':!0x1}){const _0x3366bb=this['editor']['model'],_0x56ed14=Array['from'](_0x43341d['getRanges']()),_0x2a801e=_0x43341d['getFirstRange']()['start'];for(const _0x2e3018 of _0x3366bb['markers']){if(_0x2e3018['name']['startsWith']($s)||!_0x2e3018['affectsData'])continue;const _0x5b77b1=_0x2e3018['getRange']();if(!_0x56ed14['some'](_0x50bd3a=>_0x50bd3a['containsRange'](_0x5b77b1,!0x0)))continue;const _0x348f9a=this['_regularCalculateMarkerPath'](_0x5b77b1['start'],_0x2a801e,_0x26551e['isTableSelection']),_0x2d3dad=this['_regularCalculateMarkerPath'](_0x5b77b1['end'],_0x2a801e,_0x26551e['isTableSelection']),_0x5b89f0=_0x3366bb['createPositionFromPath'](_0x10d777,_0x348f9a),_0x1d334e=_0x3366bb['createPositionFromPath'](_0x10d777,_0x2d3dad);if(!_0x5b89f0['isEqual'](_0x1d334e)){const _0x59f789=_0x3366bb['createRange'](_0x5b89f0,_0x1d334e);_0x10d777['markers']['set'](_0x2e3018['name'],_0x59f789);}}}['_regularCalculateMarkerPath'](_0x1c8303,_0x275538,_0x319867=!0x1){const _0x55c7dc=[..._0x1c8303['path']['slice']()];for(let _0x188e3f=0x0;_0x188e3f<Math['max'](_0x275538['path']['length'],_0x1c8303['path']['length']);_0x188e3f++){const _0x45dcc7=_0x275538['path'][_0x188e3f]||0x0,_0x12bc9a=(_0x1c8303['path'][_0x188e3f]||0x0)-_0x45dcc7;if(_0x55c7dc[_0x188e3f]=_0x12bc9a,0x0!==_0x12bc9a&&!_0x319867)break;}return _0x55c7dc;}async['_createInteraction'](_0x40978f,_0x5263a1,_0x47b20,_0x14aa0e){const _0xac0ebf=this['editor'];this['_interactionParams']||(this['_interactionParams']={'action':_0x14aa0e,'content':_0x40978f,'version':_0x5263a1,'aiBalloon':_0x47b20,'modelFragment':this['editor']['model']['getSelectedContent'](this['editor']['model']['document']['selection']),'anchorData':new Map()});const _0x5e2f34=new Ga({'connector':this['_aiConnector'],'editor':_0xac0ebf,'content':_0x40978f,'version':_0x5263a1,..._0x14aa0e});this['_interactions']['push'](_0x5e2f34);const _0x34c163=(_0x508404,_0x3ffa0b=!0x1,_0x1f44ca='streaming')=>this['_promiseQueue']['enqueue'](async _0x42139a=>{try{const _0x2db6a2=Ss({'editor':_0xac0ebf,'changeGroups':_0x508404['changeGroups'],'documentContextContent':_0x508404['documentContextContent'],'showDiff':_0x3ffa0b,'trimUnchanged':!0x1});_0x2db6a2['length']&&await this['_actionsBalloonView']['updateContent']({'part':_0x2db6a2[0x0],'renderingStrategy':_0x1f44ca,'abortSignal':_0x42139a});}catch(_0x10db9c){if(this['_isAbortError'](_0x10db9c))return;throw _0x10db9c;}});_0x5e2f34['on']('replyCreated',(_0x311e26,_0x943e60)=>{this['_actionsBalloonView']['hideLoader'](),this['_actionsBalloonView']['startAutoScroll'](),_0x34c163(_0x943e60)['catch'](_0x3a1c03=>{this['_isAbortError'](_0x3a1c03)||(console['error']('Error\x20updating\x20content\x20in\x20replyCreated:',_0x3a1c03),this['_setErrorState'](_0x5e2f34));});}),_0x5e2f34['on']('replyContentUpdated',(_0x5a14f9,_0x5cd033)=>{_0x34c163(_0x5cd033)['catch'](_0x1ea73f=>{this['_isAbortError'](_0x1ea73f)||(console['error']('Error\x20updating\x20content\x20in\x20replyContentUpdated:',_0x1ea73f),this['_setErrorState'](_0x5e2f34));});}),_0x5e2f34['on']('interactionFinished',async()=>{try{await this['_clearLoadingState'](),this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']),await this['_promiseQueue']['queueEmptyPromise'];}catch(_0xcd214f){this['_isAbortError'](_0xcd214f)||(console['error']('Error\x20clearing\x20loading\x20state\x20in\x20interactionFinished:',_0xcd214f),this['_setErrorState'](_0x5e2f34));}finally{this['_actionsBalloonView']['stopAutoScroll']();}}),this['listenTo'](this['_actionsBalloonView'],'toggleSuggestionDisplayMode',async(_0x1c57bd,{showDiff:_0x32975a})=>{try{this['_balloonShowDiff']=_0x32975a;const _0x520b32=this['_interaction']['replies'][this['_interaction']['replies']['length']-0x1];_0x520b32&&await _0x34c163(_0x520b32,_0x32975a,'static');}catch(_0x25845f){this['_isAbortError'](_0x25845f)||(console['error']('Error\x20updating\x20content\x20in\x20toggleSuggestionDisplayMode:',_0x25845f),this['_setErrorState'](_0x5e2f34));}}),_0x5e2f34['on']('replyChangeGroupStateUpdated',()=>{const _0x1e0049={'positiveCount':_0x5e2f34['replies']['reduce']((_0x20269d,_0x23e910)=>_0x20269d+_0x23e910['changeGroups']['filter'](_0x520001=>'accepted'===_0x520001['state'])['length'],0x0),'totalCount':_0x5e2f34['replies']['reduce']((_0x1edd77,_0x4e0bbe)=>_0x1edd77+_0x4e0bbe['changeGroups']['length'],0x0)},_0xff0f9a=_0x5e2f34['actionCallId'],_0x2779dd=_0x5e2f34['actionName'];_0x2779dd?this['_aiConnector']['upsertAIActionRating'](_0x2779dd,_0xff0f9a,_0x1e0049):this['_aiConnector']['upsertCustomAIActionRating'](_0xff0f9a,_0x1e0049);}),this['_setLoadingState']();try{const _0x4694c6=await _0x5e2f34['start']();return this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']),_0x4694c6;}catch(_0x39350a){if(this['_isAbortError'](_0x39350a))return;this['_actionsBalloonView']['hideLoader'](),this['_setErrorState'](_0x5e2f34);}}['_applyChanges'](_0xa9ed2d,_0x1bf9b2,_0x295393){const _0x3e6ed0=this['editor'];if(_0x295393&&!_0x3e6ed0['plugins']['has']('TrackChanges'))throw new ot('ai-no-track-changes',null);const _0x467bdc=this['editor']['plugins']['get'](_0x2e7618),_0x5d50f9=this['_interactions'][this['_interactions']['length']-0x1-this['_currentInteractionIndex']];if(!_0x5d50f9||!_0x5d50f9['replies']['length'])return;const _0x40e90b=_0x5d50f9['replies'][_0x5d50f9['replies']['length']-0x1],_0x3558d1=_0x40e90b['changeGroups'];_0x40e90b['setChangeGroupState'](0x0,'accepted');let _0x52206b=Ks({'editor':_0x3e6ed0,'reply':_0x40e90b,'interaction':_0x5d50f9,'groups':_0x3558d1,'transform':!0x1,'documentCompare':_0x467bdc,'documentCompareOptions':{'anchor':_0x3e6ed0['model']['createPositionAt'](_0xa9ed2d,0x0),'markDeletions':_0x295393}});_0x52206b=this['_filterOperationsOutsideRange'](_0x52206b,_0x1bf9b2);for(const _0x48a6a1 of _0x52206b)this['_anchorOperation'](_0x1bf9b2,_0x48a6a1,_0x3e6ed0['model']['document']['getRoot']());const _0x2760c8=_0x5d50f9['getDocumentContext']()['version'],_0x5a6173=_0x3e6ed0['model']['document']['history']['getOperations'](_0x2760c8),_0x427c58={'document':_0x3e6ed0['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1},_0x3da8b3=_0x2a4131(_0x52206b,_0x5a6173,_0x427c58)['operationsA'];_0x3e6ed0['model']['change'](_0x205a9d=>{if(_0x205a9d['setSelection'](_0x3e6ed0['model']['document']['selection']['focus']),_0x295393)_0x3e6ed0['plugins']['get']('TrackChangesEditing')['_applyOperationsAsSuggestions'](_0x3da8b3);else{for(const _0x1cfa1a of _0x3da8b3)_0x1cfa1a['baseVersion']=_0x3e6ed0['model']['document']['version'],Ws(_0x3e6ed0,_0x1cfa1a),_0x205a9d['batch']['addOperation'](_0x1cfa1a),_0x3e6ed0['model']['applyOperation'](_0x1cfa1a);}}),this['editor']['plugins']['get']('AIBalloon')['close']();}['_filterOperationsOutsideRange'](_0x48404b,_0x5177ca){return _0x48404b['filter'](_0x53b078=>{if('rename'==_0x53b078['type']){const _0x1097db=_0x53b078['position']['nodeAfter'];return!_0x5177ca['has'](_0x1097db);}if(_0x53b078['type']['indexOf']('Attribute')>-0x1){const _0x26fe5e=_0x53b078['range']['start']['nodeAfter'];return!_0x5177ca['has'](_0x26fe5e);}return!0x0;});}['_anchorOperation'](_0x8cd73,_0x163dd1,_0xccff37){const _0x5e9184=_0x163dd1['clone']();for(const _0x3075fa in _0x163dd1){const _0xb4efc5=_0x163dd1[_0x3075fa];_0xb4efc5 instanceof _0x1f3f5a?_0x163dd1[_0x3075fa]=new _0x1f3f5a(_0x13f412(_0xb4efc5['start']),_0x13f412(_0xb4efc5['end'])):_0xb4efc5 instanceof _0x57a0b7&&(_0x163dd1[_0x3075fa]=_0x13f412(_0xb4efc5));}if(['insert','move','remove','reinsert','split','merge']['includes'](_0x5e9184['type'])){if(_0x5e9184['isDocumentOperation']=!0x1,_0x5e9184['baseVersion']=null,'remove'==_0x5e9184['type']){const _0xb9c685=_0x5e9184['sourcePosition'],_0x50c441=_0x5e9184['howMany'];new _0x3bae80(_0xb9c685,_0x50c441)['_execute']();}else _0x5e9184['_execute']();}function _0x13f412(_0x55aed1){if('$graveyard'==_0x55aed1['root']['rootName'])return _0x55aed1;const _0x4134fe=[];let _0x284914=_0x55aed1['root'];for(let _0x3ae446=0x0;_0x3ae446<_0x55aed1['path']['length'];_0x3ae446++){const _0x4bddeb=_0x8cd73['get'](_0x284914)||0x0;_0x4134fe[_0x3ae446]=_0x55aed1['path'][_0x3ae446]+_0x4bddeb,_0x284914=_0x284914['getChildAtOffset'](_0x55aed1['path'][_0x3ae446]);}return new _0x57a0b7(_0xccff37,_0x4134fe,_0x55aed1['stickiness']);}}['_refreshInteraction'](){if(!this['_interactionParams'])return;this['_interactions']['length']>0x0&&this['_stopInteraction'](),this['_currentInteractionIndex']=0x0,this['_balloonShowDiff']=!0x1;const {action:_0x1fa8e5,content:_0x50db4d,version:_0x12ae58,aiBalloon:_0x22ef88}=this['_interactionParams'];this['_clearErrorState'](),this['_actionsBalloonView']['clearContent'](),this['_actionsBalloonView']['showLoader'](),this['_actionsBalloonView']['resetShowChangesButton'](),this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']),this['stopListening'](this['_actionsBalloonView']),this['_setupApplyListeners'](),this['_createInteraction'](_0x50db4d,_0x12ae58,_0x22ef88,_0x1fa8e5)['catch'](_0x3f5454=>{this['_isAbortError'](_0x3f5454)||console['error']('Error\x20refreshing\x20interaction:',_0x3f5454);});}['_isAbortError'](_0x907188){return!!_0x907188['message']&&_0x907188['message']['startsWith']('ai-request-aborted');}['_clearInteractionHistory'](){this['_interactions']=[],this['_interactionParams']=void 0x0,this['_currentInteractionIndex']=0x0,this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']);}['_stopInteraction'](){this['_interaction']&&this['_interaction']['stop'](),this['_promiseQueue']['abort'](),this['isBusy']=!0x1,this['_interactionParams']&&this['_actionsBalloonView']['stopAutoScroll']();}['_navigateToPrevious'](){const _0x8626a4=this['_interactions']['length'];this['_currentInteractionIndex']<_0x8626a4-0x1&&this['_displayInteractionAtIndex'](this['_currentInteractionIndex']+0x1);}['_navigateToNext'](){this['_currentInteractionIndex']>0x0&&this['_displayInteractionAtIndex'](this['_currentInteractionIndex']-0x1);}async['_displayInteractionAtIndex'](_0x2a6bff){if(!this['_interactionParams'])return;this['_currentInteractionIndex']=_0x2a6bff;const _0x3ac1a5=this['_interactions'][this['_interactions']['length']-0x1-this['_currentInteractionIndex']];if(!_0x3ac1a5)return;if(_0x3ac1a5['hasError'])return this['_setErrorState'](_0x3ac1a5),void this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']);if(!_0x3ac1a5['replies']['length'])return;this['_actionsBalloonView']['hideError'](),this['_interactionParams']&&this['_clearErrorState']();const _0x420b0f=_0x3ac1a5['replies'][_0x3ac1a5['replies']['length']-0x1];if(_0x420b0f){const _0x5051f5=this['editor'];try{const _0x451a7d=Ss({'editor':_0x5051f5,'changeGroups':_0x420b0f['changeGroups'],'documentContextContent':_0x420b0f['documentContextContent'],'showDiff':this['_balloonShowDiff'],'trimUnchanged':!0x1});await new Promise(_0x36d317=>setTimeout(_0x36d317,0x32)),await this['_actionsBalloonView']['updateContent']({'part':_0x451a7d[0x0],'renderingStrategy':'static','abortSignal':new AbortController()['signal']});}catch(_0x242d48){this['_isAbortError'](_0x242d48)||console['error']('Error\x20updating\x20content\x20during\x20navigation:',_0x242d48);}}this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']);}['_setLoadingState'](){this['_actionsBalloonView']['setIsLoading'](!0x0),this['isBusy']=!0x0;}async['_setErrorState'](_0x1243d1){const _0x31eea0=as(this['editor']['locale'],'AI_ACTIONS_GENERIC_ERROR');this['_actionsBalloonView']['showError'](_0x31eea0),_0x1243d1['hasError']=!0x0,await this['_promiseQueue']['queueEmptyPromise'],this['_actionsBalloonView']['setErrorState'](),this['_actionsBalloonView']['toggleIsLoading'](!0x0);}['_clearErrorState'](){this['_actionsBalloonView']['hideError'](),this['_actionsBalloonView']['toggleIsLoading'](!0x1);}async['_clearLoadingState'](){await this['_promiseQueue']['queueEmptyPromise'],this['isBusy']=!0x1,this['_actionsBalloonView']['setIsLoading'](!0x1);}}class Qa extends _0x36293e{static get['requires'](){return[Ma,Va,qa];}static get['pluginName'](){return'AIQuickActions';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x2d5495){super(_0x2d5495),_0x2d5495['config']['define']('ai.quickActions',{'extraCommands':[],'removeCommands':[],'isSearchEnabled':!0x0});}}class Xa extends Nt{['resultResponseView'];['acceptButtonView'];['dismissButtonView'];['infoButtonView'];['outdatedButtonView'];constructor(_0x48a828,_0x1b0e2f){super(_0x48a828),this['id']=_0x1b0e2f,this['set']('status','pending'),this['set']('changeId',_0x1b0e2f),this['resultResponseView']=this['_createResultResponseView'](),this['acceptButtonView']=this['_createAcceptButtonView'](),this['dismissButtonView']=this['_createDismissButtonView'](),this['infoButtonView']=this['_createInfoButtonView'](),this['outdatedButtonView']=this['_createOutdatedButtonView'](),this['set']('isInfoToggleOn',!0x1),this['set']('isActive',!0x1),this['set']('showDiff',!0x0),this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-result',this['bindTemplate']['if']('isActive','ck-ai_review__check-run-result_active')]},'on':{'click':this['bindTemplate']['to']('click'),'mouseover':this['bindTemplate']['to']('mouseover'),'mouseout':this['bindTemplate']['to']('mouseout')},'children':[this['resultResponseView'],{'tag':'div','attributes':{'class':['ck-ai_review__check-run-result-footer']},'children':[{'tag':'div','attributes':{'class':['ck-ai_review__check-run-result-action-buttons']},'children':[this['acceptButtonView'],this['dismissButtonView'],this['outdatedButtonView']]},this['infoButtonView']]}]}),this['on']('click',(_0x42dda5,_0xc0b5e)=>{_0xc0b5e&&_0xc0b5e['target']&&'A'===_0xc0b5e['target']['tagName']&&_0xc0b5e['preventDefault'](),this['fire']('activateChange',{'id':_0x1b0e2f,'source':this,'uiInteraction':'click'});}),this['on']('mouseover',()=>{this['fire']('activateChange',{'id':_0x1b0e2f,'source':this,'uiInteraction':'hover'});}),this['on']('mouseout',()=>{this['fire']('deactivateChange',{'origin':'panel','id':_0x1b0e2f,'source':this});});}['setItemAsActive'](){this['isActive']=!0x0;}['setItemAsInactive'](){this['isActive']=!0x1;}['_createResultResponseView'](){const _0x2924dd=new Nt(this['locale']);return _0x2924dd['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content','ck-reset_all-excluded','ck-ai_review__check-run-result-response',this['bindTemplate']['if']('showDiff','ck-hidden',_0xe38753=>!_0xe38753)]}}),_0x2924dd;}['_createAcceptButtonView'](){const _0x4506d0=new kt(this['locale']);return _0x4506d0['set']({'label':as(this['locale'],'AI_REVIEW_MODE_ACCEPT_CHANGE'),'withText':!0x0}),_0x4506d0['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x427ae8=>{this['fire']('acceptChange',{'id':this['changeId']}),_0x427ae8['stopPropagation']();})},'attributes':{'class':[this['bindTemplate']['if']('status','ck-hidden',_0x27047c=>'pending'!==_0x27047c&&'accepted'!==_0x27047c),this['bindTemplate']['if']('status',hs,_0x33f9ac=>'pending'===_0x33f9ac),this['bindTemplate']['if']('status',cs,_0x34c298=>'pending'!==_0x34c298),this['bindTemplate']['if']('status','ck-ai_review__check-run-result-status-button',_0x3af712=>'accepted'===_0x3af712)]}}),this['on']('change:status',(_0x22a1ff,_0xdc01bf,_0x2c05a4)=>{_0x4506d0['isEnabled']='pending'===_0x2c05a4,'accepted'===_0x2c05a4&&(_0x4506d0['label']=as(this['locale'],'AI_REVIEW_MODE_CHECK_STATUS_ACCEPTED'),_0x4506d0['icon']=_0xdfeb3f);}),_0x4506d0;}['_createDismissButtonView'](){const _0x37759b=new kt(this['locale']);return _0x37759b['set']({'label':as(this['locale'],'AI_REVIEW_MODE_DISMISS_CHANGE'),'withText':!0x0}),_0x37759b['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x35d4f3=>{this['fire']('dismissChange',{'id':this['changeId']}),_0x35d4f3['stopPropagation']();})},'attributes':{'class':[cs,this['bindTemplate']['if']('status','ck-hidden',_0x20dc22=>'pending'!==_0x20dc22&&'rejected'!==_0x20dc22),this['bindTemplate']['if']('status','ck-ai_review__check-run-result-dismiss-button',_0x10f5a0=>'pending'===_0x10f5a0),this['bindTemplate']['if']('status','ck-ai_review__check-run-result-status-button',_0x89b11b=>'rejected'===_0x89b11b)]}}),this['on']('change:status',(_0x5e6ae7,_0x214cb6,_0x3ecb17)=>{_0x37759b['isEnabled']='pending'===_0x3ecb17,'rejected'===_0x3ecb17&&(_0x37759b['label']=as(this['locale'],'AI_REVIEW_MODE_CHECK_STATUS_REJECTED'),_0x37759b['icon']=_0x340c21);}),_0x37759b;}['_createInfoButtonView'](){const _0x4c065b=new kt(this['locale']);return _0x4c065b['set']({'label':as(this['locale'],'AI_REVIEW_MODE_LEARN_MORE'),'icon':_0x4de7b1,'tooltip':!0x0,'isToggleable':!0x0,'role':'menuitemcheckbox','class':cs+'\x20ck-ai_review__check-run-result-info-button\x20ck-hidden'}),_0x4c065b['bind']('isOn')['to'](this,'isInfoToggleOn',_0x177f6a=>_0x177f6a),_0x4c065b['on']('execute',()=>{this['isInfoToggleOn']=!this['isInfoToggleOn'];}),_0x4c065b;}['_createOutdatedButtonView'](){const _0x40e9b5=new kt(this['locale']);return _0x40e9b5['set']({'label':as(this['locale'],'AI_REVIEW_MODE_CHECK_STATUS_OUTDATED'),'icon':it,'withText':!0x0,'isEnabled':!0x1}),_0x40e9b5['extendTemplate']({'attributes':{'class':[cs,'ck-ai_review__check-run-result-status-button',this['bindTemplate']['if']('status','ck-hidden',_0x1f22b4=>'outdated'!==_0x1f22b4)],'disabled':'disabled'}}),_0x40e9b5;}}class za extends Qt{['resultItemView'];['_pinnedRectIndex']=void 0x0;['_pinnedTargetElement']=void 0x0;['_pinnedTargetChangeId']=void 0x0;constructor(_0x2f1df7,_0x23cfca){super(_0x2f1df7),this['set']({'isVisible':!0x1,'position':'arrow_se','class':null,'top':0x0,'left':0x0}),this['extendTemplate']({'tag':'div','attributes':{'class':['ck-reset'],'tabindex':'-1'}}),this['set']('isDiffActive',!0x1),this['content']['add'](this['_createContentView']()),_0x23cfca['add'](this);}['render'](){super['render'](),this['_setupClickOutsideHandler']();}['updateContent'](_0x42d633){this['resultItemView']['changeId']=_0x42d633['id'],this['resultItemView']['resultResponseView']['element']['innerHTML']=_0x42d633['contentDiffed'];}['showBalloon'](_0x2b054c,_0x585b09,_0x262e67,_0x1d592c,_0xee0439,_0x3fbead){const _0x1b4dca=_0x585b09();if(!_0x1b4dca)return;this['updateContent'](_0x2b054c),this['show']();const _0x3af9ef=Array['from'](_0x1b4dca['getClientRects']())['reverse'](),_0xabf8ed=this['_getPointedRectIndexFromEvent'](_0x262e67,_0x3af9ef),_0x2f5cb1=_0x3af9ef[_0xabf8ed??0x0];'click'===_0x1d592c?(this['isDiffActive']=!0x0,this['pin']({'target':()=>this['_getBestRectPositionOnClick'](_0x585b09(),_0xabf8ed,_0x2b054c['id'],_0xee0439,_0x3fbead)||_0x2f5cb1})):'hover'===_0x1d592c&&(this['isDiffActive']=!0x1,this['pin']({'target':()=>this['_getBestRectPositionOnHover'](_0x585b09(),_0xabf8ed,_0x2b054c['id'])||_0x2f5cb1}));}['hideBalloon'](){this['hide'](),this['unpin'](),this['_pinnedRectIndex']=void 0x0,this['_pinnedTargetElement']=void 0x0,this['_pinnedTargetChangeId']=void 0x0;}['hideDiffInBalloon'](){this['resultItemView']['showDiff']=!0x1;}['showDiffInBalloon'](){this['resultItemView']['showDiff']=!0x0;}['deactivateChange'](){this['fire']('deactivateChange',{'origin':'balloon'});}['_setupClickOutsideHandler'](){Xt({'emitter':this,'activator':()=>this['isVisible'],'contextElements':()=>{const _0x596cdc=[this['element']];return this['_pinnedTargetElement']&&_0x596cdc['push'](this['_pinnedTargetElement']),_0x596cdc;},'callback':()=>{this['hide'](),this['unpin'](),this['deactivateChange'](),this['_pinnedTargetElement']=void 0x0,this['_pinnedRectIndex']=void 0x0,this['_pinnedTargetChangeId']=void 0x0;}});}['_createContentView'](){const _0x48b4c1=new Nt();return this['resultItemView']=new Xa(this['locale'],''),this['resultItemView']['resultResponseView']['extendTemplate']({'attributes':{'class':['ck-content']}}),this['resultItemView']['delegate']('acceptChange','dismissChange')['to'](this),_0x48b4c1['setTemplate']({'tag':'div','attributes':{'class':['ck-reset','ck-ai_review-balloon-panel-suggestion',this['bindTemplate']['if']('isDiffActive','ck-ai_review-balloon-panel-suggestion_diff-active')]},'children':[{'tag':'p','attributes':{'class':['ck-ai_review__suggestion-text']},'children':[this['resultItemView']]}]}),_0x48b4c1;}['_getBestRectPositionOnClick'](_0x2acf02,_0xc19a08,_0x3d5e17,_0x2b0973,_0x367a7c){if(!_0x2acf02)return null;const _0x24d30=this['position']['replace']('arrow_',''),_0x5d86a8=Array['from'](_0x2acf02['getClientRects']());let _0x145de0,_0x5898b3=_0x5d86a8['reverse']();return void 0x0!==_0xc19a08&&this['_isPinnedRectVisible'](_0x5898b3[_0xc19a08],_0x2b0973,_0x367a7c)?(_0x145de0=_0x5898b3[_0xc19a08],this['_pinnedRectIndex']=_0xc19a08):this['_isPinnedRectVisible'](_0x5898b3[0x0],_0x2b0973,_0x367a7c)&&void 0x0===_0xc19a08?_0x145de0=_0x5898b3[0x0]:(_0x5898b3='s'==_0x24d30[0x0]?[..._0x5d86a8]['reverse']():_0x5d86a8,_0x5898b3['forEach'](_0x43a05f=>{this['_isPinnedRectVisible'](_0x43a05f,_0x2b0973,_0x367a7c)&&(_0x145de0=_0x43a05f);})),this['_pinnedTargetChangeId']=_0x3d5e17,this['_pinnedTargetElement']=_0x2acf02,_0x145de0||_0x2acf02['getBoundingClientRect']();}['_getBestRectPositionOnHover'](_0x5aa03f,_0x410c60,_0x2dbd97){if(!_0x5aa03f)return null;const _0x3c7b21=Array['from'](_0x5aa03f['getClientRects']())['reverse']();if(void 0x0===this['_pinnedRectIndex']&&void 0x0!==_0x410c60&&this['_pinnedTargetChangeId']!==_0x2dbd97)return this['_pinnedRectIndex']=_0x410c60,this['_pinnedTargetElement']=_0x5aa03f,this['_pinnedTargetChangeId']=_0x2dbd97,_0x3c7b21[_0x410c60];if(void 0x0!==this['_pinnedRectIndex']&&this['_pinnedTargetChangeId']===_0x2dbd97){if(_0x5aa03f!==this['_pinnedTargetElement'])return Array['from'](this['_pinnedTargetElement']['getClientRects']())['reverse']()[this['_pinnedRectIndex']];return _0x3c7b21[this['_pinnedRectIndex']];}return void 0x0!==_0x410c60&&this['_pinnedTargetChangeId']!==_0x2dbd97?(this['_pinnedRectIndex']=_0x410c60,this['_pinnedTargetElement']=_0x5aa03f,this['_pinnedTargetChangeId']=_0x2dbd97,_0x3c7b21[_0x410c60]):_0x5aa03f['getBoundingClientRect']();}['_getPointedRectIndexFromEvent'](_0x2913b3,_0x2d11ec){if(_0x2913b3)for(let _0x3a21e9=0x0;_0x3a21e9<_0x2d11ec['length'];_0x3a21e9++){const _0x4da656=_0x2d11ec[_0x3a21e9];if(_0x2913b3['clientX']>=_0x4da656['left']-0x3&&_0x2913b3['clientX']<=_0x4da656['right']+0x3&&_0x2913b3['clientY']>=_0x4da656['top']-0x3&&_0x2913b3['clientY']<=_0x4da656['bottom']+0x3)return _0x3a21e9;}}['_isPinnedRectVisible'](_0x58c2d0,_0x43c2b3,_0x4e78cb){const _0x48ac0b=new ut(_0x58c2d0),_0x385de4=_0x43c2b3||document['documentElement'],_0x137050=_0x48ac0b['getIntersection'](bt(_0x4e78cb)),_0x3ef8fe=new ut(_0x385de4)['getIntersection'](_0x48ac0b);return!!(_0x137050&&_0x3ef8fe&&_0x48ac0b['width']>0x0);}}const ja=['getReviewCheckList','runReviewCheck','abortReviewStream','toggleDiff','acceptAllChanges','leaveReviewCoreResultList','activateChange','deactivateChange','acceptChange','dismissChange','learnMore','finishReview','retryReview'];class Ja extends _0x314798{['_mainView'];['_balloonSuggestionView'];['_bodyCollection'];static get['requires'](){return[ns];}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x230526){super(_0x230526),this['_bodyCollection']=new qt(this['context']['locale']),this['_bodyCollection']['attachToDom'](),this['_mainView']=this['createMainView'](),this['_mainView']['delegate'](...ja)['to'](this),this['_balloonSuggestionView']=new za(this['context']['locale'],this['_bodyCollection']),this['_balloonSuggestionView']['delegate']('acceptChange','dismissChange','deactivateChange')['to'](this);}['init'](){const _0x4a3611=this['context']['plugins']['get']('AITabs');this['registerTab'](_0x4a3611);}['destroy'](){this['_bodyCollection']['detachFromDom'](),super['destroy']();}['setAvailableChecks'](_0x420a23){if(!this['_mainView']['reviewCheckListView']['hasChecks']()){const _0x14e981=!this['context']['config']['get']('ai.models.showModelSelector');this['_mainView']['reviewCheckListView']['setChecks'](_0x420a23,_0x14e981);}this['_mainView']['showReviewCheckListView']();}['showReviewCheckList'](){this['fire']('getReviewCheckList');}['showCheckRunResults'](_0x4665c2){_0x4665c2&&('error-general'!==_0x4665c2['status']?'error-chunk'!==_0x4665c2['status']?this['_mainView']['showReviewCheckResultsView']():this['showChunkErrorView']():this['showGeneralResultsErrorView']());}['showCheckRunResult'](_0x46f979){this['_mainView']['addCheckRunResult'](_0x46f979);}['showGeneralResultsErrorView'](){this['_mainView']['showGeneralResultsErrorView']();}['showGeneralReviewCoreErrorView'](_0xaf692b){this['_mainView']['showGeneralReviewCoreErrorView'](_0xaf692b??as(this['context']['locale'],'AI_REVIEW_INITIALIZATION_ERROR_MESSAGE'));}['showChunkErrorView'](){this['_mainView']['showChunkErrorView']();}['setCheckResultTitle'](_0x2ff915,_0x4e4091){this['_mainView']['reviewCheckResultsView']['setTitle'](_0x2ff915,_0x4e4091);}['setActiveStateInResults'](_0x50c98a){this['_mainView']['reviewCheckResultsView']['getResults']()['forEach'](_0xfe23a8=>{_0xfe23a8['id']===_0x50c98a&&_0xfe23a8['setItemAsActive']();});}['resetActiveStateInResults'](){this['_mainView']['reviewCheckResultsView']['getResults']()['forEach'](_0x4a28a5=>_0x4a28a5['setItemAsInactive']());}['updateChangeState'](_0x2c8d59,_0x2cd985){'accepted'===_0x2cd985||'rejected'===_0x2cd985||'outdated'===_0x2cd985?this['_mainView']['reviewCheckResultsView']['hideResult'](_0x2c8d59,_0x2cd985):this['_mainView']['reviewCheckResultsView']['showResult'](_0x2c8d59,_0x2cd985);}['showReviewCompletedView'](){this['_mainView']['showReviewCompletedView']();}['showActionsWhenResultIsReady'](){this['_mainView']['showActionsWhenResultIsReady']();}['showNoChangesView'](){this['_mainView']['showNoChangesView']();}['hideActionsWhenResultIsReady'](){this['_mainView']['hideActionsWhenResultIsReady']();}['showChangeBalloon'](_0x5ed4cf,_0xf554f7,_0x580d26,_0x565dd9,_0x48dae8,_0x5030b1){this['_balloonSuggestionView']['showBalloon'](_0x5ed4cf,_0xf554f7,_0x580d26,_0x565dd9,_0x48dae8,_0x5030b1);}['hideChangeBalloon'](){this['_balloonSuggestionView']['hideBalloon']();}['hideDiffInBalloon'](){this['_balloonSuggestionView']['hideDiffInBalloon']();}['showDiffInBalloon'](){this['_balloonSuggestionView']['showDiffInBalloon']();}['getChangeElement'](_0x3d065f){const _0x47cafb=this['_mainView']['reviewCheckResultsView']['getResults']()['find'](_0x2dd7c5=>_0x2dd7c5['id']===_0x3d065f);return _0x47cafb?_0x47cafb['element']:null;}['deactivateChange'](){this['_balloonSuggestionView']['deactivateChange']();}}class Za extends Nt{constructor(_0x597bd4){super(_0x597bd4),this['set']('isVisible',!0x1),this['set']('errorMessage','');const _0x1ad5f9=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai_review__general-error-container',_0x1ad5f9['if']('isVisible','ck-hidden',_0x336ad0=>!_0x336ad0)]},'children':[{'tag':'p','attributes':{'class':'ck\x20ck-ai-notification\x20ck-ai-notification_error'},'children':[{'text':_0x1ad5f9['to']('errorMessage')}]}]});}}class to extends Nt{['reviewCoreHeader'];['generalErrorView'];['reviewCheckListView'];['reviewCheckResultsView'];['reviewCompletedView'];constructor(_0x9ea14c,_0x44955d){super(_0x9ea14c),this['reviewCoreHeader']=_0x44955d['header'],this['generalErrorView']=new Za(_0x9ea14c),this['reviewCheckListView']=_0x44955d['list'],this['reviewCheckListView']['delegate'](...ja)['to'](this),this['reviewCheckResultsView']=_0x44955d['results'],this['reviewCheckResultsView']['delegate'](...ja)['to'](this),this['reviewCompletedView']=_0x44955d['completed'],this['reviewCompletedView']['delegate']('finishReview')['to'](this),this['reviewCheckListView']['set']('isVisible',!0x1),this['reviewCheckResultsView']['set']('isVisible',!0x1),this['reviewCheckResultsView']['set']('isLoading',!0x1),this['reviewCheckResultsView']['set']('isResultReady',!0x1),this['reviewCompletedView']['set']('isVisible',!0x1),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-ai-review','ck-rounded-corners'],'dir':'ltr'},'children':[this['reviewCoreHeader'],this['generalErrorView'],this['reviewCheckListView'],this['reviewCheckResultsView'],this['reviewCompletedView']]});}['showReviewCheckListView'](){this['reviewCheckListView']['resetAllParameterizedChecks'](),this['reviewCheckListView']['set']('isVisible',!0x0),this['reviewCheckResultsView']['set']('isVisible',!0x1),this['reviewCompletedView']['set']('isVisible',!0x1);}['showReviewCheckResultsView'](){this['hideActionsWhenResultIsReady'](),this['reviewCheckResultsView']['resetErrorState'](),this['reviewCheckListView']['set']('isVisible',!0x1),this['reviewCheckResultsView']['set']('isVisible',!0x0),this['reviewCheckResultsView']['clearResults'](),this['reviewCheckResultsView']['set']('isLoading',!0x0),this['reviewCheckResultsView']['set']('isCompleted',!0x1);}['addCheckRunResult'](_0x5c51a3){this['reviewCheckResultsView']['addResult'](_0x5c51a3),this['reviewCheckResultsView']['set']('isLoading',!0x1);}['showReviewCompletedView'](){this['reviewCheckResultsView']['set']('isVisible',!0x0),this['reviewCompletedView']['set']('isVisible',!0x1),this['reviewCheckResultsView']['set']('isCompleted',!0x0),this['reviewCheckListView']['set']('isVisible',!0x1);}['showActionsWhenResultIsReady'](){this['reviewCheckResultsView']['isResultReady']?(this['reviewCheckListView']['set']('isVisible',!0x1),this['reviewCheckResultsView']['set']('isVisible',!0x0),this['reviewCompletedView']['set']('isVisible',!0x1)):this['reviewCheckResultsView']['isResultReady']=!0x0;}['showNoChangesView'](){this['reviewCheckListView']['set']('isVisible',!0x1),this['reviewCheckResultsView']['set']('isVisible',!0x1),this['reviewCompletedView']['set']('isVisible',!0x0);}['hideActionsWhenResultIsReady'](){this['reviewCheckResultsView']['isResultReady']=!0x1;}['showGeneralReviewCoreErrorView'](_0x35587e){this['generalErrorView']['set']('isVisible',!0x0),this['generalErrorView']['errorMessage']=_0x35587e;}['showGeneralResultsErrorView'](){this['reviewCheckResultsView']['set']('isLoading',!0x1),this['showActionsWhenResultIsReady'](),this['reviewCheckResultsView']['showGeneralErrorMessage']();}['showChunkErrorView'](){this['reviewCheckResultsView']['set']('isLoading',!0x1),this['showActionsWhenResultIsReady'](),this['reviewCheckResultsView']['showChunkErrorMessage']();}}class eo extends kt{constructor(_0x4c9d65,_0x358b93){super(_0x358b93),this['set']({'label':_0x4c9d65,'withText':!0x0,'class':os}),this['on']('execute',()=>{this['fire']('finishReview');});}}class io extends Pt{['_resultViews'];['_resultsHeader'];['reviewDisclaimer'];['_cancelButtonView'];['_acceptAllButtonView'];['_exitReviewButtonView'];['_toggleDiffButtonView'];['_errorMessageView'];['_finishReviewButtonView'];['_contents'];constructor(_0x1d9dda,_0x54c022){super(_0x1d9dda),this['_contents']=_0x54c022,this['_resultViews']=new _0xfc7125(),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 jr(_0x1d9dda),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 _0x2d81e6=this['_createCombinedSkeletonLoader'](),_0x221d38=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run',_0x221d38['if']('isLoading','ck-ai_review__check-run_loading',_0x5ae295=>_0x5ae295),_0x221d38['if']('isResultReady','ck-ai_review__check-run_ready',_0x43c24d=>_0x43c24d),_0x221d38['if']('isVisible','ck-hidden',_0x4e37e8=>!_0x4e37e8)]},'children':[this['_resultsHeader'],{'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-wrapper']},'children':[this['_errorMessageView'],{'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-container','ck-reset_all-excluded',this['bindTemplate']['if']('isLoading','ck-hidden',_0x26f625=>_0x26f625)]},'children':this['_resultViews']},_0x2d81e6]},this['reviewDisclaimer']]});}['clearResults'](){this['_resultViews']['clear']();}['getResults'](){return this['_resultViews'];}['addResult'](_0x299488){const _0x5f3f42=new Xa(this['locale'],_0x299488['id']);_0x5f3f42['delegate']('acceptChange','dismissChange','activateChange','deactivateChange')['to'](this),this['_resultViews']['add'](_0x5f3f42),_0x5f3f42['resultResponseView']['element']['innerHTML']=_0x299488['contentDiffed'];}['hideResult'](_0x20bec2,_0x33406e){if('pending'===_0x33406e)return;const _0x164ae6=this['_resultViews']['find'](_0x335fe2=>_0x335fe2['id']===_0x20bec2);_0x164ae6&&(_0x164ae6['status']=_0x33406e,_0x164ae6['element']?.['classList']['add']('ck-ai_review__check-run-result_grayout'));}['showResult'](_0x274784,_0x68b871){if('pending'!==_0x68b871)return;const _0x823d06=this['_resultViews']['find'](_0x16e832=>_0x16e832['id']===_0x274784);_0x823d06&&(_0x823d06['status']=_0x68b871,_0x823d06['element']?.['classList']['remove']('ck-ai_review__check-run-result_grayout'));}['setTitle'](_0x299dc4,_0x131c7c){this['headerTitle']=_0x299dc4,this['headerSubtitle']=_0x131c7c||'';}['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 zn(this['locale'],jn['aiReviewChecks']);}['_createCombinedSkeletonLoader'](){const _0x4e1b4f=new Nt(this['locale']),_0x5c9868=[];for(let _0x4122fe=0x0;_0x4122fe<0x10;_0x4122fe++){const _0x330453=this['_createSkeletonLoader']();_0x330453['extendTemplate']({'attributes':{'class':['ck-ai_review__check-run-skeleton-item']}}),_0x5c9868['push'](_0x330453);}return _0x4e1b4f['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-skeleton-container',this['bindTemplate']['if']('isLoading','ck-hidden',_0x370540=>!_0x370540)]},'children':_0x5c9868}),_0x4e1b4f;}['_createErrorView'](){const _0xd2f0c3=new Nt(this['locale']),_0x2e1323=new kt(this['locale']),t=this['locale']['t'];return _0xd2f0c3['delegate']('retryReview')['to'](this),_0x2e1323['set']({'label':t('Try\x20again'),'withText':!0x0,'class':hs+'\x20ck-ai_review__check-run-error-retry-button'}),_0x2e1323['on']('execute',()=>{this['fire']('retryReview');}),_0xd2f0c3['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-error-container',this['bindTemplate']['if']('showErrorMessage','ck-hidden',_0x25a456=>!_0x25a456),this['bindTemplate']['if']('errorType','ck-ai_review__check-run-error-container_border-bottom',_0xbaccb5=>'chunk'===_0xbaccb5)]},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-notification','ck-ai-notification_error','ck-ai-notification__full-width','ck-ai_review__check-run-error-message',this['bindTemplate']['if']('errorType','ck-ai-notification_warning',_0x133b37=>'chunk'===_0x133b37)]},'children':[{'tag':'p','attributes':{'class':['ck-ai-notification__content',this['bindTemplate']['if']('errorType','ck-hidden',_0x5aa34e=>'general'!==_0x5aa34e)]},'children':[{'text':this['_contents']['generalErrorText']}]},{'tag':'p','attributes':{'class':['ck-ai-notification__content',this['bindTemplate']['if']('errorType','ck-hidden',_0x45fe44=>'chunk'!==_0x45fe44)]},'children':[{'text':as(this['locale'],'AI_REVIEW_MODE_CHUNK_ERROR_MESSAGE')}]}]},_0x2e1323]}),_0xd2f0c3;}['_createCancelButtonView'](){const _0x2d7305=new kt(this['locale']);return _0x2d7305['set']({'label':as(this['locale'],'AI_REVIEW_MODE_STOP_GENERATING'),'withText':!0x0,'class':[hs+'\x20ck-ai-button-stop-generating'],'icon':_0x22b394}),_0x2d7305['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isResultReady','ck-hidden',_0x2362ba=>_0x2362ba),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x2856a5=>_0x2856a5)]}}),_0x2d7305['on']('execute',()=>{this['fire']('abortReviewStream');}),_0x2d7305;}['_createToggleDiffButtonView'](){const _0x195325=new kt(this['locale']);_0x195325['set']({'tooltip':!0x0,'isToggleable':!0x0,'role':'menuitemcheckbox'}),_0x195325['bind']('isEnabled')['to'](this,'isError',_0x199827=>!_0x199827),_0x195325['extendTemplate']({'attributes':{'class':[hs,'ck-ai_review__check-run-toggle-diff-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0x187bef=>!_0x187bef),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x335c2b=>_0x335c2b)]}});const _0xf24874=as(this['locale'],'AI_REVIEW_MODE_HIDE_CHANGES'),_0x551bb9=as(this['locale'],'AI_REVIEW_MODE_SHOW_CHANGES');return _0x195325['bind']('isOn')['to'](this,'isToggleDiffOn',_0x16b37e=>_0x16b37e),_0x195325['bind']('icon')['to'](this,'isToggleDiffOn',_0x2a321e=>_0x2a321e?st:nt),_0x195325['bind']('label')['to'](this,'isToggleDiffOn',_0x155e56=>_0x155e56?_0xf24874:_0x551bb9),_0x195325['on']('execute',()=>{this['isToggleDiffOn']=!this['isToggleDiffOn'],this['fire']('toggleDiff',{'on':this['isToggleDiffOn']});}),_0x195325;}['_createAcceptAllButtonView'](){const _0x5c7762=new kt(this['locale']);return _0x5c7762['set']({'label':as(this['locale'],'AI_REVIEW_MODE_ACCEPT_ALL'),'withText':!0x0}),_0x5c7762['bind']('isEnabled')['to'](this,'isError',_0x5acf2b=>!_0x5acf2b),_0x5c7762['extendTemplate']({'attributes':{'class':[os,'ck-ai_review__check-run-accept-all-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0x192e5f=>!_0x192e5f),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x1358c9=>_0x1358c9)]}}),_0x5c7762['on']('execute',()=>{this['fire']('acceptAllChanges');}),_0x5c7762;}['_createExitReviewButtonView'](){const _0x55c3cb=new kt(this['locale']);return _0x55c3cb['set']({'label':as(this['locale'],'AI_REVIEW_MODE_EXIT_REVIEW'),'withText':!0x0}),_0x55c3cb['extendTemplate']({'attributes':{'class':[cs,'ck-ai_review__check-run-exit-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0x4ee780=>!_0x4ee780),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x4716ff=>_0x4716ff)]}}),_0x55c3cb['on']('execute',()=>{this['fire']('leaveReviewCoreResultList');}),_0x55c3cb;}['_createResultHeaderView'](){const _0x4778e5=new Nt(this['locale']),_0x333445=this['_createTitleView']();return _0x4778e5['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-header',this['bindTemplate']['if']('isCompleted','ck-ai_review__review-completed-header',_0x342735=>_0x342735)]},'children':[_0x333445,{'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-header-buttons']},'children':[this['_cancelButtonView'],this['_acceptAllButtonView'],this['_exitReviewButtonView'],this['_toggleDiffButtonView'],this['_finishReviewButtonView']]}]}),_0x4778e5;}['_createTitleView'](){const _0x392d61=new Nt(this['locale']),_0x5d55de=new fn();return _0x5d55de['bind']('isVisible')['to'](this,'isResultReady',_0x227d32=>!_0x227d32),_0x392d61['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-header-title-wrapper']},'children':[_0x5d55de,{'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-header-title-content',this['bindTemplate']['if']('isCompleted','ck-hidden',_0xc1e72a=>_0xc1e72a)]},'children':[{'tag':'span','attributes':{'class':['ck-ai_review__check-run-results-header-title']},'children':[{'text':this['bindTemplate']['to']('headerTitle')}]},{'tag':'span','attributes':{'class':['ck-ai_review__check-run-results-header-subtitle']},'children':[{'text':this['bindTemplate']['to']('headerSubtitle')}]}]},{'tag':'span','attributes':{'class':['ck-ai_review__review-completed-header-title',this['bindTemplate']['if']('isCompleted','ck-hidden',_0x4a3dbe=>!_0x4a3dbe)]},'children':[{'text':as(this['locale'],'AI_REVIEW_MODE_FINISH_REVIEW_HEADER_TITLE')}]}]}),_0x392d61;}['_createFinishReviewButtonView'](){const _0x32ca62=new eo(as(this['locale'],'AI_REVIEW_MODE_FINISH_REVIEW_BUTTON_LABEL'),this['locale']);return _0x32ca62['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isCompleted','ck-hidden',_0x5df99b=>!_0x5df99b)]}}),_0x32ca62['delegate']('finishReview')['to'](this),_0x32ca62;}}class so extends Pt{['_resultsHeader'];['_finishReviewButtonView'];constructor(_0x288d82,_0x1ceb27){super(_0x288d82),this['_finishReviewButtonView']=this['_createFinishReviewButtonView'](_0x1ceb27['buttonText']),this['_resultsHeader']=this['_createResultHeaderView'](_0x1ceb27['headerText']);const _0x1cac21=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__review-completed',_0x1cac21['if']('isVisible','ck-hidden',_0xcd07e8=>!_0xcd07e8)]},'children':[this['_resultsHeader'],{'tag':'div','attributes':{'class':['ck-ai_review__review-completed-content']},'children':[{'tag':'span','attributes':{'class':['ck-ai_review__review-completed-content-icon']},'children':[{'text':'👍'}]},{'tag':'p','attributes':{'class':['ck-ai_review__review-completed-content-text']},'children':[{'text':_0x1ceb27['emptyResultsText']}]}]}]});}['_createFinishReviewButtonView'](_0x210d6a){const _0x23d485=new eo(_0x210d6a,this['locale']);return _0x23d485['delegate']('finishReview')['to'](this),_0x23d485;}['_createResultHeaderView'](_0x3f689a){const _0x377bb5=new Nt(this['locale']);return _0x377bb5['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__review-completed-header']},'children':[{'tag':'span','attributes':{'class':['ck-ai_review__review-completed-header-title']},'children':[{'text':_0x3f689a}]},{'tag':'div','attributes':{'class':['ck-ai_review__review-completed-header-buttons']},'children':[this['_finishReviewButtonView']]}]}),_0x377bb5;}}class no extends Nt{['_dropdownView'];['_defaultValue'];['_defaultLabel'];constructor(_0x59934d,_0x3e0018){super(_0x59934d),this['_defaultValue']=_0x3e0018['default']||(_0x3e0018['data']['length']>0x0?_0x3e0018['data'][0x0]['id']:''),this['_defaultLabel']=_0x3e0018['data']['find'](_0x45e1fe=>_0x45e1fe['id']===this['_defaultValue'])?.['label']||'',this['set']('formValue',''),this['_dropdownView']=Bt(this['locale']);const _0xf6e921=this['_prepareListOptions'](_0x3e0018['data']);zt(this['_dropdownView'],_0xf6e921,{'role':'menu','ariaLabel':_0x3e0018['label']}),this['_dropdownView']['buttonView']['set']({'label':this['_defaultLabel'],'withText':!0x0}),this['_dropdownView']['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0xcbf289=>{_0xcbf289['stopPropagation']();})}}),this['listenTo'](this['_dropdownView'],'execute',_0x56d375=>{this['formValue']=_0x56d375['source']['model']['id'],this['_dropdownView']['buttonView']['label']=_0x56d375['source']['model']['label'];}),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-ai_review__check-list-item-parameterized-form-element','ck-ai_review__check-list-item-parameterized-form-element_dropdown']},'children':[this['_dropdownView']]});}['resetToDefault'](){this['formValue']=this['_defaultValue'],this['_dropdownView']['buttonView']['label']=this['_defaultLabel'];}['_prepareListOptions'](_0x20ff5d=[]){const _0x34c150=new dt();this['resetToDefault']();for(const _0x58d8c4 of _0x20ff5d){const _0x42073f=new jt({'label':_0x58d8c4['label'],'withText':!0x0,'role':'menuitemradio','id':_0x58d8c4['id'],'model':_0x58d8c4});_0x42073f['bind']('isOn')['to'](this,'formValue',_0x8f90fb=>_0x8f90fb===_0x42073f['id']);const _0x588563={'type':'button','model':_0x42073f};_0x34c150['add'](_0x588563);}return _0x34c150;}}class ro extends Pt{['_formItem']=null;constructor(_0xaac03c,_0x184e6d,_0x42c562){super(_0xaac03c),this['argsKey']=_0x184e6d?.['argsKey'];if('dropdown'===_0x184e6d['formType'])this['_formItem']=new no(this['locale'],_0x184e6d);this['set']('value',''),this['bind']('value')['to'](this['_formItem'],'formValue');const _0x515e1e=new _0x439381(this['locale'],{'children':[this['_formItem']],'class':[_0x42c562?'ck-form__row_with-submit':'']});_0x42c562&&_0x515e1e['children']['add'](_0x42c562),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai_review__form-item','ck-reset_all']},'children':[_0x515e1e]});}['resetToDefault'](){this['_formItem']['resetToDefault']();}}class ao extends _0x270107{['keystrokes'];static ['MIN_ROWS']=0x1;static ['MAX_ROWS']=0xc;constructor(_0x49dcb1){super(_0x49dcb1),this['set']('isEmpty',!0x0),this['keystrokes']=new At(),this['minRows']=ao['MIN_ROWS'],this['maxRows']=ao['MAX_ROWS'],this['extendTemplate']({'attributes':{'id':'ai-review-prompt-input','class':['ck','ck-review__prompt-input']}});}['render'](){super['render'](),this['on']('update',()=>{this['isEmpty']=''===this['element']['value']?.['trim']();}),this['keystrokes']['listenTo'](this['element']);}}class oo extends Nt{['focusTracker']=new _t();['keystrokes']=new At();['focusCycler'];['_focusables']=new _0xfc7125();['submitButtonView'];['cancelButtonView'];['promptInputView'];['actionsFooterView'];['_modelSelectionDropdown'];['_modelNameView'];['_modelSelectionDropdownItems'];['_check'];['_defaultValue'];['_defaultLabel'];constructor(_0x38ce26,_0x68d15f,_0xbc07ea=!0x1){super(_0x38ce26),this['_check']=_0x68d15f,this['set']('prompt',''),this['set']('modelId',''),this['set']('modelDisplayMode','selector'),this['set']('activeModelName',null),this['_defaultValue']=_0x68d15f['defaultModel']?_0x68d15f['defaultModel']['id']:'',this['_defaultLabel']=_0x68d15f['defaultModel']?_0x68d15f['defaultModel']['name']:'',this['submitButtonView']=this['_createSubmitButtonView'](),this['cancelButtonView']=this['_createCancelButtonView'](),(this['promptInputView']=new Zt(this['locale'],()=>new ao(_0x38ce26)),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 dt(),this['_modelNameView']=this['_createModelNameView'](),this['_setModelList'](_0xbc07ea),zt(this['_modelSelectionDropdown'],this['_modelSelectionDropdownItems']),this['actionsFooterView']=this['_createActionsFooterView'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-custom-actions']},'children':[new _0x439381(this['locale'],{'children':[this['promptInputView']]}),new _0x439381(this['locale'],{'children':[this['actionsFooterView']]})]}),this['promptInputView']['fieldView']['keystrokes']['set']('Enter',(_0x9961eb,_0x2d6cd2)=>{this['_isValid']()?(this['fire']('runReviewCheck',{'id':'custom','args':{'prompt':this['prompt'],'model':this['modelId']},'isCustom':!0x0}),_0x2d6cd2()):_0x2d6cd2();}),this['focusCycler']=new Mt({'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'](_0x1c0836=>{this['_focusables']['add'](_0x1c0836),this['focusTracker']['add'](_0x1c0836['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 _0x25067f of this['_getFormValidators']()){const _0x30b333=_0x25067f();if(_0x30b333)return this['promptInputView']['errorText']=_0x30b333,!0x1;}return!0x0;}['_getFormValidators'](){return[()=>{if(0x0===this['promptInputView']['fieldView']['value']?.['trim']()['length'])return as(this['locale'],'AI_REVIEW_MODE_PROMPT_EMPTY_ERROR');}];}['_createSubmitButtonView'](){const _0x13edbf=new kt(this['locale']),t=this['locale']['t'];return _0x13edbf['set']({'label':t('Submit'),'withText':!0x0,'class':os}),_0x13edbf['on']('execute',()=>{this['_isValid']()&&this['fire']('runReviewCheck',{'id':'custom','args':{'prompt':this['prompt'],'model':this['modelId']},'isCustom':!0x0});}),_0x13edbf;}['_createCancelButtonView'](){const _0x192256=new kt(this['locale']),t=this['locale']['t'];return _0x192256['set']({'label':t('Cancel'),'withText':!0x0,'class':cs}),_0x192256['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0xaa688a=>{_0xaa688a['stopPropagation']();})}}),_0x192256['on']('execute',()=>{this['resetToDefault'](),this['fire']('closeCustomCheck');}),_0x192256;}['_setModelList'](_0x9b4394){this['_modelSelectionDropdownItems']['clear']();const _0x31f84f=this['_check']['models'];if(_0x9b4394)this['set']('modelDisplayMode','hidden');else{const _0x2d7000=0x1===_0x31f84f['length'];this['set']('modelDisplayMode',_0x2d7000?'name':'selector');}if(this['resetToDefault'](),_0x31f84f?.['length']){0x1===_0x31f84f['length']&&this['set']('activeModelName',_0x31f84f[0x0]['name']||_0x31f84f[0x0]['id']);for(const _0x4dbce5 of _0x31f84f){const _0xf4a932=new jt({'label':_0x4dbce5['name'],'withText':!0x0,'role':'menuitemradio','id':_0x4dbce5['id'],'model':_0x4dbce5});_0xf4a932['bind']('isOn')['to'](this,'modelId',_0x1ff292=>_0x1ff292===_0x4dbce5['id']),this['_modelSelectionDropdownItems']['add']({'type':'button','model':_0xf4a932,'labelView':new co(this['locale'],_0x4dbce5)});}}}['_createModelSelectionDropdown'](){const _0x5220df=Bt(this['locale']);return _0x5220df['set']({'panelPosition':'se','class':'ck-ai_review__check-list-item-model-dropdown'}),_0x5220df['buttonView']['set']({'label':this['_defaultLabel'],'withText':!0x0,'tooltip':!0x0,'class':cs}),_0x5220df['buttonView']['bind']('isVisible')['to'](this,'modelDisplayMode',_0xa8eb01=>'selector'===_0xa8eb01),this['listenTo'](_0x5220df,'execute',_0x40acfb=>{this['modelId']=_0x40acfb['source']['model']['id'],_0x5220df['buttonView']['label']=_0x40acfb['source']['label'];}),_0x5220df;}['_createModelNameView'](){const _0x474f50=new ho(this['locale']);return _0x474f50['bind']('text')['to'](this,'activeModelName',_0x361092=>_0x361092??''),_0x474f50['bind']('isVisible')['to'](this,'modelDisplayMode',_0x552247=>'name'===_0x552247),_0x474f50;}['_createActionsFooterView'](){const _0x299a4f=new Nt(this['locale']);return _0x299a4f['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-custom-actions-footer']},'children':[this['_modelSelectionDropdown'],this['_modelNameView'],{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-parameterized-custom-actions-buttons']},'children':[this['cancelButtonView'],this['submitButtonView']]}]}),_0x299a4f;}}class ho extends Nt{constructor(_0x2523e1){super(_0x2523e1),this['set']('text',void 0x0),this['set']('isVisible',!0x0);const _0x1b7c6a=this['bindTemplate'];this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai_review__check-list-item-model-name',_0x1b7c6a['if']('isVisible','ck-hidden',_0x18a276=>!_0x18a276)]},'children':[{'text':_0x1b7c6a['to']('text')}]});}}class co extends Ht{constructor(_0x474a23,_0x59f37d){super();const _0x5e6ae0=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-button__label'],'style':_0x5e6ae0['to']('style'),'id':_0x5e6ae0['to']('id')},'children':[{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-model-dropdown-name']},'children':[{'tag':'span','children':[{'text':_0x5e6ae0['to']('text')}]}]},{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-model-dropdown-description']},'children':[{'tag':'span','children':[_0x59f37d['description']||'']}]}]});}}class lo extends Pt{['_formItemsCollection']=new _0xfc7125();['_customCheckView']=null;['_hideModels']=!0x1;constructor(_0x218c1f,_0x55f1b9,_0x2e8dcb,_0x52f068=!0x1){super(_0x218c1f),this['_hideModels']=_0x52f068,this['set']('isParametrizedViewOpen',!0x1),this['set']('isListItemRendered',!0x1),this['set']('isItemParametrized',_0x55f1b9['isParameterized']);const _0x14756b=this['_createIconView']();this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list-item',this['bindTemplate']['if']('isParametrizedViewOpen','ck-ai_review__check-list-item_selected',_0x2ecd82=>_0x2ecd82),this['bindTemplate']['if']('isListItemRendered','ck-ai_review__check-list-item_rendered',_0x3a42fd=>_0x3a42fd)],'style':{'--ck-ai-review-check-list-item-index':_0x2e8dcb}},'on':{'click':this['bindTemplate']['to']('click')},'children':[{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-content']},'children':[{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-main-content']},'children':[{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-title']},'children':[{'tag':'span','attributes':{'class':['ck-ai_review__check-list-item-title-text']},'children':[{'text':_0x55f1b9['title']}]},_0x14756b]},{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-description']},'children':_0x55f1b9['description']?[{'text':_0x55f1b9['description']}]:[]}]}]},..._0x55f1b9['isParameterized']?[this['_createParameterizedView'](_0x55f1b9)]:[],...'custom'===_0x55f1b9['id']?[this['_createCustomView'](_0x55f1b9,this['_hideModels'])]:[]]}),this['on']('click',()=>{_0x55f1b9['isParameterized']?this['isParametrizedViewOpen']=!0x0:this['fire']('runReviewCheck',{'id':_0x55f1b9['id'],'args':_0x55f1b9['useArgs']?_0x55f1b9['args']:void 0x0});}),requestAnimationFrame(()=>{this['isListItemRendered']=!0x0;});}['render'](){super['render'](),this['isItemParametrized']&&Xt({'emitter':this,'activator':()=>!0x0===this['isParametrizedViewOpen'],'contextElements':[this['element']],'callback':()=>{this['isParametrizedViewOpen']=!0x1;}});}['resetToDefault'](){this['isParametrizedViewOpen']=!0x1,this['_formItemsCollection']['forEach'](_0x54562f=>{_0x54562f['resetToDefault']();}),this['_customCheckView']&&this['_customCheckView']['resetToDefault']();}['_createIconView'](){const _0x2f0990=new yt();return _0x2f0990['content']=rt,_0x2f0990['extendTemplate']({'attributes':{'class':['ck-ai_review__check-list-item-title-icon']}}),_0x2f0990;}['_createParameterizedView'](_0x5a16e7){const _0x20d17e=new Nt(),_0x4fdd28=this['_createFormView'](_0x5a16e7);return _0x20d17e['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-parameterized',this['bindTemplate']['if']('isParametrizedViewOpen','ck-hidden',_0x1caae2=>!_0x1caae2)]},'children':[_0x4fdd28]}),_0x20d17e;}['_createFormView'](_0x39950a){const _0x5a215c=new Nt(),_0x208666=Array['isArray'](_0x39950a['options'])?_0x39950a['options']:[],_0x99d801=new kt(this['locale']),t=this['locale']['t'];_0x99d801['set']({'label':t('Submit'),'withText':!0x0,'class':os}),_0x99d801['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0xb22c4f=>{_0xb22c4f['stopPropagation']();})}}),_0x99d801['on']('execute',()=>{const _0xb5e5f2=[],_0x287c15={};this['_formItemsCollection']['forEach'](_0x136ec0=>{_0xb5e5f2['push'](_0x136ec0['value']),_0x39950a['useArgs']&&_0x39950a['options']&&(_0x287c15[_0x136ec0['argsKey']]=_0x136ec0['value']);}),this['fire']('runReviewCheck',{'id':_0x39950a['id'],'params':_0xb5e5f2['length']?_0xb5e5f2:void 0x0,'args':Object['keys'](_0x287c15)['length']?_0x287c15:void 0x0});});const _0x3140b1=_0x208666['length'];return _0x208666['forEach']((_0x262b76,_0x7265a)=>{const _0x54d9a6=_0x7265a===_0x3140b1-0x1;this['_formItemsCollection']['add'](new ro(this['locale'],_0x262b76,_0x54d9a6?_0x99d801:null));}),_0x5a215c['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-parameterized-form']},'children':this['_formItemsCollection']}),_0x5a215c;}['_createCustomView'](_0x39e66d,_0x4ab918=!0x1){return this['_customCheckView']=new oo(this['locale'],_0x39e66d,_0x4ab918),this['_customCheckView']['extendTemplate']({'attributes':{'class':['ck-ai_review__check-list-item-parameterized','ck-ai_review__check-list-item-parameterized_custom',this['bindTemplate']['if']('isParametrizedViewOpen','ck-hidden',_0x51a33f=>!_0x51a33f)]}}),this['_customCheckView']['delegate']('runReviewCheck')['to'](this),this['listenTo'](this['_customCheckView'],'closeCustomCheck',()=>{this['isParametrizedViewOpen']=!0x1;}),this['on']('change:isParametrizedViewOpen',(_0x4bcc34,_0x6b784f,_0x4db6c8)=>{_0x4db6c8||this['_customCheckView']['resetFormValidationStatus']();}),this['_customCheckView'];}}class uo extends Pt{['_checkViews'];constructor(_0x41992e){super(_0x41992e),this['_checkViews']=new _0xfc7125(),this['_setupTemplate']();}['setChecks'](_0x37e055,_0x1b5895=!0x1){this['_checkViews']['clear']();for(const [_0x15e1b9,_0x3e78b3]of _0x37e055['entries']()){const _0x4752bb=new lo(this['locale'],_0x3e78b3,_0x15e1b9,_0x1b5895);_0x4752bb['delegate']('runReviewCheck')['to'](this),this['_checkViews']['add'](_0x4752bb);}}['hasChecks'](){return this['_checkViews']['length']>0x0;}['resetAllParameterizedChecks'](){for(const _0x132560 of this['_checkViews'])_0x132560 instanceof lo&&_0x132560['resetToDefault']();}['_setupTemplate'](){const _0x412cae=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list',_0x412cae['if']('isVisible','ck-hidden',_0x4ea12f=>!_0x4ea12f)]},'children':this['_checkViews']});}}class _o extends Ja{static get['pluginName'](){return'AIReviewModeUI';}['createMainView'](){const _0x54b175=this['context']['locale'],_0x71f40=new _0x327048(_0x54b175,{'label':as(_0x54b175,'AI_REVIEW_MODE'),'icon':_0x21205e,'class':'ck-ai-header\x20ck-ai-header_review'});return new to(this['context']['locale'],{'header':_0x71f40,'list':new uo(_0x54b175),'results':new io(_0x54b175,{'generalErrorText':as(_0x54b175,'AI_REVIEW_MODE_GENERAL_ERROR_MESSAGE')}),'completed':new so(_0x54b175,{'headerText':as(_0x54b175,'AI_REVIEW_MODE_FINISH_REVIEW_HEADER_TITLE'),'emptyResultsText':as(_0x54b175,'AI_REVIEW_MODE_EMPTY_RESULTS_TEXT'),'buttonText':as(_0x54b175,'AI_REVIEW_MODE_FINISH_REVIEW_BUTTON_LABEL')})});}['registerTab'](){const _0x48ed8c=this['context']['plugins']['get']('AITabs');_0x48ed8c['view']['on']('activateTab',(_0x1e7849,_0xf0e322)=>{'reviewMode'===_0xf0e322?this['fire']('getReviewCheckList'):this['fire']('leaveReview');}),_0x48ed8c['view']['addTab']({'id':'reviewMode','buttonLabel':as(this['context']['locale'],'AI_REVIEW_MODE'),'buttonIcon':_0x21205e,'order':0x0,'content':this['_mainView']});}}const Ao='review-';class go extends _0x314798{static get['requires'](){return[_0x2e7618,qs];}static get['pluginName'](){return'AIReviewCoreEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['_markers']=new Map();['_activeMarkers']=new Set();['_domEmitter'];['_eventEmitter'];constructor(_0x1c8fdc){super(_0x1c8fdc),this['_domEmitter']=new(Rt())(),this['_eventEmitter']=new(pt())();}get['emitter'](){return this['_eventEmitter'];}['afterInit'](){const _0x55efea=Fs(this['context']);_0x55efea['conversion']['for']('editingDowncast')['markerToElement']({'model':Ao+'insert','view':(_0x335335,{writer:_0x3677dd})=>{const _0x45465d=this['_markers']['get'](_0x335335['markerName']),_0x4b10bf={'class':'ck-ai_review-marker_add'+(this['_activeMarkers']['has'](_0x45465d?.['id']||'')?'\x20ck-ai_review__change_active':''),'data-marker-id':_0x335335['markerName']};return _0x3677dd['createUIElement']('span',_0x4b10bf,function(_0x1efc59){const _0x829177=this['toDomElement'](_0x1efc59);return _0x829177['innerHTML']=_0x45465d?.['content']?.['asString']||'',_0x829177;});}}),_0x55efea['conversion']['for']('editingDowncast')['markerToHighlight']({'model':Ao+'remove-only','view':_0x260472=>{const _0x25b8ec=this['_markers']['get'](_0x260472['markerName']),_0x50a008=['ck-ai_review-marker_strikethrough'];return this['_activeMarkers']['has'](_0x25b8ec?.['id']||'')&&_0x50a008['push']('ck-ai_review__change_active'),{'classes':_0x50a008,'attributes':{'data-marker-id':_0x260472['markerName']}};}}),_0x55efea['conversion']['for']('editingDowncast')['markerToHighlight']({'model':Ao+'remove-context','view':_0x22ce76=>{const _0xc3e5f8=this['_markers']['get'](_0x22ce76['markerName']),_0x1cdf75=['ck-ai_review-marker_underline'];return this['_activeMarkers']['has'](_0xc3e5f8?.['id']||'')&&_0x1cdf75['push']('ck-ai_review__change_active'),{'classes':_0x1cdf75,'attributes':{'data-marker-id':_0x22ce76['markerName']}};}}),_0x55efea['conversion']['for']('editingDowncast')['markerToHighlight']({'model':Ao+'remove-text','view':_0x171917=>{const _0x1bd063=this['_markers']['get'](_0x171917['markerName']),_0x4f7f04=['ck-ai_review-marker_hide'];return this['_activeMarkers']['has'](_0x1bd063?.['id']||'')&&_0x4f7f04['push']('ck-ai_review__change_active'),{'classes':_0x4f7f04,'attributes':{'data-marker-id':_0x171917['markerName']}};}}),_0x55efea['conversion']['for']('dataDowncast')['markerToElement']({'model':Ao+'suggestion-context','view':(_0x7e71c7,{writer:_0x2139df})=>_0x2139df['createRawElement']('span',{'class':'ck-ai_review-marker_context-'+(_0x7e71c7['isOpening']?'start':'end')})}),_0x55efea['conversion']['for']('downcast')['attributeToAttribute']({'model':_0x1eb54e,'view':_0xc678c1});const _0x3d142e=_0x55efea['ui']['getEditableElement']()||document['body'];this['_domEmitter']['listenTo'](_0x3d142e,'mouseup',(_0x4aa3db,_0x2ff1a8)=>{const _0x5f37dd=_0x2ff1a8['target'],_0x3ab2ad=this['_findMarkerElement'](_0x5f37dd);if(!_0x3ab2ad)return;const _0x1c6734=_0x3ab2ad['getAttribute']('data-marker-id'),_0x1690db=_0x1c6734['split'](':')['pop']()?.['split']('_')[0x0];this['_eventEmitter']['fire']('changeMarkerClicked',{'markerId':_0x1c6734,'changeId':_0x1690db,'markerElement':()=>this['_findMarkerElementById'](_0x1c6734),'domEvent':_0x2ff1a8});},{'usePassive':!0x0,'priority':'highest'}),this['_domEmitter']['listenTo'](_0x3d142e,'mouseover',(_0x1422ff,_0x5e8103)=>{const _0x479861=_0x5e8103['target'],_0x2ee962=_0x5e8103['relatedTarget'];let _0x1480d5=this['_findMarkerElement'](_0x479861);if(!_0x1480d5&&_0x2ee962&&(_0x1480d5=this['_findMarkerElement'](_0x2ee962)),!_0x1480d5)return;const _0x4c1389=_0x1480d5['getAttribute']('data-marker-id'),_0x31a08a=_0x4c1389['split'](':')['pop']()?.['split']('_')[0x0];this['_eventEmitter']['fire']('changeMarkerHovered',{'changeId':_0x31a08a,'markerElement':()=>this['_findMarkerElementById'](_0x4c1389),'domEvent':_0x5e8103});}),this['_domEmitter']['listenTo'](document,'mouseover',_0x332bdc((_0x461613,_0x324bc5)=>{const _0x521158=_0x324bc5['target'];if(this['_findMarkerElement'](_0x521158))return;_0x521158['closest']('.ck-reset.ck-ai_review-balloon-panel-suggestion')||this['_eventEmitter']['fire']('changeMarkerBlurred');},0xc8)),_0x55efea['model']['document']['registerPostFixer'](_0x11eda2=>this['_validateMarkers'](_0x55efea,_0x11eda2)),_0x55efea['model']['document']['on']('change',()=>this['_handleMarkerChanges'](_0x55efea));}['getDocumentData'](){const _0x34031f=this['context']['plugins']['get']('AIEditing'),_0x5f3ef3=Fs(this['context']),_0x3d27ff=_0x5f3ef3['model'],_0x293341=new _0x2af830();for(const _0x4cd7a6 of _0x3d27ff['document']['getRoot']()['getChildren']()){const _0x572393=_0x4cd7a6['_clone'](!0x0);_0x293341['_appendChild'](_0x572393);}for(const _0x3d43a5 of _0x3d27ff['markers'])_0x293341['markers']['set'](_0x3d43a5['name'],this['_changeRangeOwnerDocument'](_0x3d43a5['getRange']()['clone'](),_0x293341));const _0x5af5b5=new _0x4ae3de({'ignoreElementEnd':!0x0,'startPosition':_0x3d27ff['createPositionAt'](_0x293341,0x0)}),_0x32a52b=new Set(),_0x4a542b=new Map();for(const {item:_0x2bc235}of _0x5af5b5){if(!_0x2bc235['is']('$textProxy'))continue;const _0x53cba3=_0x2bc235['parent'];if(_0x53cba3&&_0x53cba3['is']('element')){const _0x2a71f2=this['_upsertDataId'](_0x53cba3,()=>_0x34031f['_nextDataId'](_0x32a52b));_0x32a52b['add'](_0x2a71f2);for(const _0x1f0882 of _0x53cba3['getChildren']())_0x1f0882['is']('element')&&_0x32a52b['add'](this['_upsertDataId'](_0x1f0882,()=>_0x34031f['_nextDataId'](_0x32a52b)));let _0xe9f918=_0x53cba3;for(;_0xe9f918['parent']&&!_0xe9f918['parent']['is']('documentFragment');)_0xe9f918=_0xe9f918['parent'],_0xe9f918['hasAttribute'](_0x1eb54e)&&_0xe9f918['_removeAttribute'](_0x1eb54e);_0x4a542b['set'](_0x2a71f2,{'path':_0x53cba3['getPath'](),'getContent':this['_createGetContentUsingDataIdFn'](_0xe9f918['_clone'](!0x0),_0x2a71f2,_0x5f3ef3['data'])}),_0x5af5b5['jumpTo'](_0x3d27ff['createPositionAfter'](_0x53cba3));}}return{'content':_0x5f3ef3['data']['processor']['toData'](_0x5f3ef3['data']['toView'](_0x293341)),'version':_0x5f3ef3['model']['document']['version'],'elements':_0x4a542b};}['diffContent'](_0xe61dd7,_0x236b5b,_0x115136=!0x1){const _0x2332e4=[],_0x241bed=Fs(this['context']),_0x58b106=_0x241bed['data']['parse'](_0x236b5b,'$documentFragment'),_0x319b1=_0x241bed['data']['parse'](_0xe61dd7,'$documentFragment'),_0x16d14a=_0x241bed['model']['createPositionAt'](_0x319b1,0x0);if(this['_haveSingleTopLevelElement'](_0x58b106)){if(!this['_hasSameTopLevelElement'](_0x319b1,_0x58b106))return _0x2332e4;}else{const _0x11b0b2=_0x241bed['model']['schema'];if(!this['_haveOnlyInlineContent'](_0x319b1,_0x11b0b2)||!this['_haveOnlyInlineContent'](_0x58b106,_0x11b0b2))return _0x2332e4;}const _0x5ede61=this['context']['plugins']['get']('DocumentCompare')['getDiff'](_0xe61dd7,_0x236b5b,{'anchor':_0x16d14a,'markDeletions':!0x0})['getOperations']()['filter'](_0x5f5a92=>'insert'===_0x5f5a92['type']||'marker'===_0x5f5a92['type']&&_0x5f5a92['name']['startsWith']('$markedRemove')),_0x14c317=this['_groupAdjacentOperations'](_0x5ede61),_0x41bd8e=[];if(_0x115136){if(_0x14c317['length']){const _0x488b88=_0x14c317[0x0]['operations'][0x0],_0x5c5b09='insert'===_0x488b88['type']?_0x488b88['position']:_0x488b88['newRange']['start'],_0x51f550=this['_getPositionLimitingRange'](_0x5c5b09,_0x241bed,'inside'),_0x4cf3a2=_0x51f550?_0x58b106['getChild'](0x0)['getChildren']():_0x58b106['getChildren'](),_0x6dc705=_0x51f550||_0x241bed['model']['createRangeIn'](_0x319b1),_0x3816e9=[new _0x56d08f('$markedRemove:synthetic'+at(),null,_0x6dc705,_0x241bed['model']['document']['model']['markers'],!0x0,_0x241bed['model']['document']['version']+0x1),new _0x1edf03(_0x6dc705['end'],_0x4cf3a2,_0x241bed['model']['document']['version']+0x2)];_0x41bd8e['push']({'operations':_0x3816e9,'operationsIsolated':_0x3816e9,'groupOffset':0x0});}}else _0x41bd8e['push'](..._0x14c317);let _0x1e3e96=0x0;return _0x241bed['model']['change'](_0x2732c4=>{for(let _0x3e21a5=0x0;_0x3e21a5<_0x41bd8e['length'];_0x3e21a5++){const _0x20612f=_0x41bd8e[_0x3e21a5],_0x5a65d5=_0x2732c4['createDocumentFragment']();for(const _0x1828cb of _0x319b1['getChildren']())_0x2732c4['append'](_0x1828cb['_clone'](!0x0),_0x5a65d5);for(const _0x307236 of _0x20612f['operationsIsolated'])if('insert'===_0x307236['type']){const _0x34b25a=_0x307236;_0x34b25a['baseVersion']=null,_0x34b25a['isDocumentOperation']=!0x1,this['_changeOperationOwnerDocument'](_0x34b25a,_0x5a65d5),_0x2732c4['batch']['addOperation'](_0x307236),_0x241bed['model']['applyOperation'](_0x307236);const _0x231484='suggestion:insertion:id:authorId:'+_0x1e3e96++,_0x3067f5=_0x241bed['model']['createRange'](_0x34b25a['position'],_0x34b25a['position']['getShiftedBy'](_0x34b25a['howMany']));_0x5a65d5['markers']['set'](_0x231484,_0x3067f5);}else{if('marker'===_0x307236['type']&&_0x307236['name']['startsWith']('$markedRemove')){const _0x21a41c=_0x307236,_0x37f109='suggestion:deletion:id:authorId:'+_0x1e3e96++;this['_changeOperationOwnerDocument'](_0x21a41c,_0x5a65d5),_0x5a65d5['markers']['set'](_0x37f109,_0x21a41c['newRange']);}}if(_0x115136)_0x2332e4['push']({..._0x20612f,'context':this['_createGetContentFn'](_0x319b1,_0x241bed['data']),'content':this['_createGetContentFn'](_0x319b1,_0x241bed['data'])});else{const _0x100187=this['_getChangeContext'](this['_changePositionOwnerDocument'](this['_getOperationStart'](_0x20612f['operationsIsolated'][0x0]),_0x5a65d5),this['_changePositionOwnerDocument'](this['_getOperationEnd'](_0x20612f['operationsIsolated'][_0x20612f['operationsIsolated']['length']-0x1]),_0x5a65d5));_0x5a65d5['markers']['set'](Ao+'suggestion-context',new _0x1f3f5a(_0x100187['start'],_0x100187['end'])),_0x2332e4['push']({..._0x20612f,'context':this['_createGetContextFn'](_0x5a65d5,_0x241bed['data'],{'ellipsisBefore':_0x100187['hasContentBefore'],'ellipsisAfter':_0x100187['hasContentAfter']}),'content':this['_createGetContentFn'](_0x5a65d5,_0x241bed['data'])});}}}),_0x2332e4;}['markChangePositionInEditorContent'](_0x113b74,_0x323081){if(!_0x113b74['length'])return;const _0x2c8964=_0x113b74[0x0]['parent']['id'],_0x4f184c=_0x323081['elements']['get'](_0x2c8964);if(!_0x4f184c)return void console['warn']('No\x20element\x20found\x20for\x20ID:\x20'+_0x2c8964);const _0x3a6443=_0x4f184c['path'],_0x12e534=Fs(this['context']),_0x34a513=_0x12e534['model']['document']['history']['getOperations'](_0x323081['version']),_0x376add=[];for(const _0x5949b0 of _0x113b74){const _0x5e29b4=_0x5949b0['operationsIsolated']['map'](_0x5af31f=>this['_translateOperationToEditorContent'](_0x5af31f,_0x3a6443,_0x12e534['model']['document']['getRoots']()[0x0]));if(!_0x5e29b4||!_0x5e29b4['length'])continue;const _0x72a52=_0x5e29b4['every'](_0x3f9b27=>'marker'===_0x3f9b27['type']&&_0x3f9b27['name']['startsWith']('$markedRemove')),_0x193446={'document':_0x12e534['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1},_0x4a399b=_0x2a4131(_0x5e29b4,_0x34a513,_0x193446)['operationsA'];for(const _0x5a2339 of _0x4a399b)if('insert'===_0x5a2339['type']){const _0x5216fe=_0x5a2339,_0x582404=_0x5216fe['nodes'];_0x12e534['model']['change'](_0x4af3cc=>{const _0x219a23=_0x4af3cc['createDocumentFragment']();for(const _0x1b2fb1 of _0x582404)_0x4af3cc['append'](_0x1b2fb1['_clone'](!0x0),_0x219a23);_0x376add['push']({'start':_0x5216fe['position'],'end':_0x5216fe['position'],'type':'insert','groupId':_0x5949b0['id'],'content':{'asString':this['_createGetContentFn'](_0x219a23,_0x12e534['data'])(),'asFragment':_0x219a23}});});}else{if('marker'===_0x5a2339['type']&&_0x5a2339['name']['startsWith']('$markedRemove')){const _0x3334d5=_0x5a2339;let _0x2fd9cd='remove-text';if(_0x72a52){const _0x382dba=this['_findAdjacentContextDistance'](_0x3334d5['newRange']['start'],'backward',_0x12e534['model']['schema']),_0x559650=this['_findAdjacentContextDistance'](_0x3334d5['newRange']['end'],'forward',_0x12e534['model']['schema']);if(_0x382dba||_0x559650){const _0x28622c=_0x3334d5['newRange']['start']['getShiftedBy'](-_0x382dba),_0x38439a=_0x3334d5['newRange']['end']['getShiftedBy'](_0x559650);_0x376add['push']({'start':_0x28622c,'end':_0x38439a,'groupId':_0x5949b0['id'],'type':'remove-context'});}else _0x2fd9cd='remove-only';}_0x376add['push']({'start':_0x3334d5['newRange']['start'],'end':_0x3334d5['newRange']['end'],'groupId':_0x5949b0['id'],'type':_0x2fd9cd});}}}this['_insertMarkers'](_0x376add);}['clearAllMarkers'](){const _0x15c7dd=Fs(this['context']);_0x15c7dd['model']['change'](_0x2f4401=>{for(const _0x4bd80b of this['_markers']['keys']())_0x15c7dd['model']['markers']['get'](_0x4bd80b)&&_0x2f4401['removeMarker'](_0x4bd80b);}),this['_markers']['clear'](),this['_activeMarkers']['clear']();}['switchToReadOnly'](){Fs(this['context'])['enableReadOnlyMode']('ai-review');}['switchToEdit'](){Fs(this['context'])['disableReadOnlyMode']('ai-review');}['applyChange'](_0x5deeda){const _0x1de920=Fs(this['context']),_0x53ec2e=_0x1de920['model'],_0xca6be0=_0x5deeda['map'](_0x448509=>this['_getMarkersDataForGroup'](_0x448509))['flat']();_0x53ec2e['change'](_0x401485=>{for(const _0xe4940a of _0xca6be0){const _0x393d85=_0x1de920['model']['markers']['get'](_0xe4940a['id']);if(_0x393d85){if('insert'===_0xe4940a['type']){if(!_0xe4940a['content'])continue;_0x53ec2e['insertContent'](_0xe4940a['content']['asFragment']||null,_0x393d85['getRange']()['start']);}else'remove-text'!==_0xe4940a['type']&&'remove-only'!==_0xe4940a['type']||_0x53ec2e['deleteContent'](_0x53ec2e['createSelection'](_0x393d85['getRange']()));_0x401485['removeMarker'](_0xe4940a['id']),this['_markers']['delete'](_0xe4940a['id']);}}});}['rejectChange'](_0x2816f6){const _0x5380d8=Fs(this['context']),_0x3916f9=this['_getMarkersDataForGroup'](_0x2816f6);_0x5380d8['model']['change'](_0xecd760=>{for(const _0x100164 of _0x3916f9)_0xecd760['removeMarker'](_0x100164['id']),this['_markers']['delete'](_0x100164['id']);});}['getEditor'](){return Fs(this['context']);}['getMarkerElementForChange'](_0x5abfd5){const _0x2034a5=Array['from'](this['_markers']['values']())['filter'](_0x2734b3=>_0x2734b3['groupId']===_0x5abfd5);if(!_0x2034a5['length'])return null;const _0xdeb78e=0x1===_0x2034a5['length']?_0x2034a5[0x0]:this['_sortMarkers'](_0x2034a5)[0x0],_0x124e2e=Fs(this['context'])['model']['markers']['get'](_0xdeb78e['id']);if(!_0x124e2e)return null;return{'modelRange':_0x124e2e['getRange'](),'getElement':()=>this['_findMarkerElementById'](_0xdeb78e['id'])};}['getContentElementForChange'](_0x5bd44d){const _0x1f24bb=Array['from'](this['_markers']['values']())['filter'](_0x18db8d=>_0x18db8d['groupId']===_0x5bd44d);if(!_0x1f24bb['length'])return null;const _0x5e9e8d=0x1===_0x1f24bb['length']?_0x1f24bb[0x0]:this['_sortMarkers'](_0x1f24bb)[0x0],_0x53f6e5=Fs(this['context']),_0x568203=_0x53f6e5['model']['markers']['get'](_0x5e9e8d['id']);if(!_0x568203)return null;const _0x2a0e22=_0x568203['getRange'](),_0x524476=_0x53f6e5['editing']['view']['getDomRoot']();if(!_0x524476||!_0x2a0e22)return null;let _0x49806f=_0x2a0e22['start']['parent'];for(;_0x49806f['parent']&&'$root'!==_0x49806f['parent']['name'];)_0x49806f=_0x49806f['parent'];if(!_0x49806f||!_0x49806f['name'])return null;const _0x1943e7=_0x524476['querySelector']('[data-marker-id=\x22'+_0x5e9e8d['id']+'\x22]');if(!_0x1943e7)return null;let _0x287e95=null;_0x53f6e5['model']['change'](_0x54486f=>{_0x287e95=_0x54486f['createDocumentFragment'](),_0x54486f['append'](_0x49806f['_clone'](!0x0),_0x287e95);});const _0x5cd9ea=_0x53f6e5['data']['toView'](_0x287e95)['getChild'](0x0);return _0x1943e7['closest'](_0x5cd9ea['name']);}['reactivateMarkers'](_0x1d06aa){const _0x5825f7=this['_getMarkersDataForGroup'](_0x1d06aa);if(!_0x5825f7['length'])return;const _0x58eff5=Array['from'](this['_activeMarkers'])['sort'](),_0x39c3d6=Array['from'](new Set(_0x5825f7['map'](_0x3232ba=>_0x3232ba['id'])))['sort']();_0x58eff5['join']('|')!==_0x39c3d6['join']('|')&&(this['setAllMarkersAsInactive'](),this['setMarkersInElementAsActive'](_0x1d06aa));}['setMarkersInElementAsActive'](_0x3aa964){const _0xed203e=this['_getMarkersDataForGroup'](_0x3aa964);if(!_0xed203e['length'])return;const _0x25eaff=Fs(this['context']),_0x514d4e=new Set(_0xed203e['map'](_0x7e755b=>_0x7e755b['id'])),_0x459241=Array['from'](_0x514d4e['values']())['map'](_0xddeee=>_0x25eaff['model']['markers']['get'](_0xddeee))['filter'](_0x484b25=>!!_0x484b25);_0x514d4e['forEach'](_0x2c4f76=>{this['_activeMarkers']['add'](_0x2c4f76);}),_0x25eaff['model']['change'](()=>{_0x459241['forEach'](_0x1f436c=>{_0x25eaff['editing']['reconvertMarker'](_0x1f436c);});});}['setAllMarkersAsInactive'](){const _0x418ce0=Array['from'](this['_activeMarkers']);if(!_0x418ce0['length'])return;this['_activeMarkers']['clear']();const _0x4cf86b=Fs(this['context']),_0x5c2f84=_0x418ce0['map'](_0x66a94c=>_0x4cf86b['model']['markers']['get'](_0x66a94c))['filter'](_0x100ae0=>!!_0x100ae0);_0x4cf86b['model']['change'](()=>{_0x5c2f84['forEach'](_0x1d9139=>{_0x4cf86b['editing']['reconvertMarker'](_0x1d9139);});});}['_getPositionLimitingRange'](_0x2562ea,_0x4881d7,_0x511080='outside'){if(!_0x2562ea)return null;let _0x40cf30=_0x2562ea['parent'];for(;_0x40cf30&&_0x40cf30['parent']&&'$root'!==_0x40cf30['parent']['name']&&!_0x4881d7['model']['schema']['isLimit'](_0x40cf30)&&!_0x4881d7['model']['schema']['isBlock'](_0x40cf30);)_0x40cf30=_0x40cf30['parent'];if(!_0x40cf30||!_0x40cf30['name']||'$root'===_0x40cf30['name'])return null;let _0x6b7473=null;return _0x4881d7['model']['change'](_0x523a07=>{_0x6b7473='inside'===_0x511080?_0x523a07['createRangeIn'](_0x40cf30):_0x523a07['createRangeOn'](_0x40cf30);}),_0x6b7473;}['_validateMarkers'](_0x312c31,_0x216a28){const _0x2c02e0=Array['from'](this['_markers']['keys']()),_0x4bbf02=new Map();for(const _0x3e07d0 of _0x2c02e0){const _0x11269b=_0x312c31['model']['markers']['get'](_0x3e07d0);if(!_0x11269b)continue;const _0x41611c=_0x11269b['getStart']()['path'][0x0];_0x4bbf02['has'](_0x41611c)||_0x4bbf02['set'](_0x41611c,[]),_0x4bbf02['get'](_0x41611c)['push'](_0x11269b);}const _0x442dc2=new Set();for(const _0x3d16fb of _0x312c31['model']['document']['differ']['getChanges']()){let _0x43a77a=-0x1,_0x3b7f13=null;if('insert'===_0x3d16fb['type'])_0x3b7f13=new _0x1f3f5a(_0x3d16fb['position'],_0x3d16fb['position']['getShiftedBy'](_0x3d16fb['length'])),_0x43a77a=_0x3d16fb['position']['path'][0x0];else{if('remove'!==_0x3d16fb['type'])continue;_0x3b7f13=new _0x1f3f5a(_0x3d16fb['position']),_0x43a77a=_0x3d16fb['position']['path'][0x0];}const _0x3f4e88=_0x4bbf02['get'](_0x43a77a)||[];if(_0x3f4e88['length']){for(const _0x5d8835 of _0x3f4e88)if(_0x3b7f13['root']['rootName']===_0x5d8835['getRange']()['root']['rootName']&&('insert'!==_0x3d16fb['type']||!_0x3b7f13['containsRange'](_0x5d8835['getRange']()))&&(_0x3b7f13['isIntersecting'](_0x5d8835['getRange']())||_0x3b7f13['start']['isTouching'](_0x5d8835['getRange']()['end'])||_0x3b7f13['end']['isTouching'](_0x5d8835['getRange']()['start']))){const _0x40beeb=this['_parseMarkerName'](_0x5d8835['name']);Array['from'](this['_markers']['values']())['filter'](_0x195bbc=>_0x195bbc['groupId']===_0x40beeb['groupId'])['forEach'](_0xfec0b4=>_0x442dc2['add'](_0xfec0b4['id']));}}}if(_0x442dc2['size']){for(const _0x276d04 of _0x442dc2)_0x216a28['removeMarker'](_0x276d04);return!0x0;}return!0x1;}['_handleMarkerChanges'](_0x177028){for(const {name:_0x4edb05,data:_0x196774}of _0x177028['model']['document']['differ']['getChangedMarkers']()){if(!_0x4edb05['startsWith'](Ao))continue;const _0x155be4=_0x196774['oldRange'],_0x32c5f2=_0x196774['newRange'],_0x531d48=_0x155be4&&'$graveyard'===_0x155be4['root']['rootName'],_0x4781e8=_0x32c5f2&&'$graveyard'===_0x32c5f2['root']['rootName'];if(_0x531d48&&_0x4781e8)continue;const _0x3f4c18=this['_parseMarkerName'](_0x4edb05);this['_markers']['get'](_0x4edb05)&&(_0x4781e8||!_0x32c5f2?this['_eventEmitter']['fire']('changeMarkerRemoved',{'markerId':_0x4edb05,'changeId':_0x3f4c18['groupId']}):_0x531d48&&_0x32c5f2&&this['_eventEmitter']['fire']('changeMarkerRestored',{'markerId':_0x4edb05,'changeId':_0x3f4c18['groupId']}));}}['_parseMarkerName'](_0x21130d){const _0x112e14=_0x21130d['split'](':'),_0x307bc7=(_0x112e14[0x1]||'')['split']('_');return{'prefix':_0x112e14[0x0],'groupId':_0x307bc7[0x0],'suffix':_0x307bc7[0x1]};}['_translateOperationToEditorContent'](_0x432f27,_0x188a23,_0x592b13){if('insert'===_0x432f27['type']){const _0x4cd607=_0x432f27;return new _0x1edf03(this['_changePosition'](_0x188a23['concat'](_0x4cd607['position']['offset']),_0x592b13),_0x4cd607['nodes'],_0x4cd607['baseVersion']);}if('marker'===_0x432f27['type']&&_0x432f27['name']['startsWith']('$markedRemove')){const _0x17795e=_0x432f27;return new _0x56d08f(_0x17795e['name'],_0x17795e['oldRange'],this['_changeRange'](_0x17795e['newRange'],_0x188a23['concat'](_0x17795e['newRange']['start']['offset']),_0x188a23['concat'](_0x17795e['newRange']['end']['offset']),_0x592b13),_0x17795e['_markers'],_0x17795e['affectsData'],_0x17795e['baseVersion']);}return _0x432f27;}['_groupAdjacentOperations'](_0x234ecc){if(!_0x234ecc['length'])return[];const _0x16a1e3=[];let _0xef8038=0x0,_0x71e41c=0x0,_0x5dd6bf=[];for(let _0x3c16cd=0x0;_0x3c16cd<=_0x234ecc['length'];_0x3c16cd++){const _0x3ba24e=_0x234ecc[_0x3c16cd],_0x15d4da=_0x234ecc[_0x3c16cd-0x1];!_0x3ba24e||_0x15d4da&&!this['_getOperationEnd'](_0x15d4da)['isTouching'](this['_getOperationStart'](_0x3ba24e))?(_0x16a1e3['push']({'operations':_0x5dd6bf,'operationsIsolated':_0x5dd6bf['map'](_0x180761=>this['_shiftOperation'](_0x180761['clone'](),-_0x71e41c)),'groupOffset':_0xef8038}),_0x5dd6bf=_0x3ba24e?[_0x3ba24e]:[],_0x71e41c+=_0xef8038,_0xef8038=0x0):_0x5dd6bf['push'](_0x3ba24e),_0x3ba24e&&'insert'===_0x3ba24e['type']&&(_0xef8038+=_0x3ba24e['howMany']);}return _0x16a1e3;}['_findAdjacentContextDistance'](_0x4389f3,_0x31d1de,_0x219e20,_0x28e734=0x1){const _0x5e7e4e=new _0x4ae3de({'startPosition':_0x4389f3,'direction':_0x31d1de});let _0x481f71=0x0;for(let _0x484296=0x0;_0x484296<_0x28e734;_0x484296++){let _0x1a1a8e=0x0,_0x2ef5de=!0x1,_0x37093e='forward'===_0x31d1de?/^\W*\w+/:/\w+\W*$/;for(const {item:_0x3dba12}of _0x5e7e4e)if(_0x3dba12['is']('$textProxy')){const _0x5eca73=_0x37093e['exec'](_0x3dba12['data']);if(_0x5eca73&&_0x5eca73['length']){if(_0x1a1a8e+='forward'===_0x31d1de?_0x5eca73['index']+_0x5eca73[0x0]['length']:_0x3dba12['data']['length']-_0x5eca73['index'],_0x5eca73[0x0]['length']!==_0x3dba12['data']['length'])break;_0x2ef5de=!0x0,_0x37093e='forward'===_0x31d1de?/^\w+/:/\w+$/;}else{if(_0x2ef5de)break;_0x1a1a8e+=_0x3dba12['offsetSize'];}}else{if(_0x3dba12['is']('element')){_0x219e20['isInline'](_0x3dba12)&&!_0x2ef5de&&(_0x1a1a8e+=0x1);break;}}_0x481f71+=_0x1a1a8e,_0x5e7e4e['jumpTo'](_0x4389f3['getShiftedBy']('forward'===_0x31d1de?_0x481f71:-_0x481f71));}return _0x481f71;}['_getChangeContext'](_0x965999,_0x512f9f){const _0x131522=Fs(this['context'])['model']['schema'],_0x33a330=this['_findAdjacentContextDistance'](_0x965999,'backward',_0x131522,0x6),_0x4e5a01=this['_findAdjacentContextDistance'](_0x512f9f,'forward',_0x131522,0x6),_0x4f9270=_0x965999['getShiftedBy'](-_0x33a330),_0x12b798=_0x512f9f['getShiftedBy'](_0x4e5a01);return{'start':_0x4f9270,'end':_0x12b798,'hasContentBefore':!_0x4f9270['isAtStart'],'hasContentAfter':!_0x12b798['isAtEnd']};}['_insertMarkers'](_0x210fd5){const _0x2d3429=this['context']['plugins']['get']('AIEditing'),_0x5814aa=new Set();Fs(this['context'])['model']['change'](_0x213c5f=>{for(const _0x28b5b8 of _0x210fd5){const _0x140e22=''+Ao+_0x28b5b8['type']+':'+_0x28b5b8['groupId']+'_'+_0x2d3429['_nextDataId'](_0x5814aa);this['_markers']['set'](_0x140e22,{'id':_0x140e22,'groupId':_0x28b5b8['groupId'],'type':_0x28b5b8['type'],'content':_0x28b5b8['content']}),_0x213c5f['addMarker'](_0x140e22,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x213c5f['createRange'](_0x28b5b8['start'],_0x28b5b8['end'])});}});}['_createGetContextFn'](_0x4c81d0,_0x3802a3,_0x9c9cf2){let _0x17e957='';return()=>{if(!_0x17e957){const _0xda4b0a=_0x3802a3['toView'](_0x4c81d0,{'showSuggestionHighlights':!0x0});let _0x2f74bd=_0xda4b0a['getChild'](0x0);if(_0x2f74bd['is']('containerElement')||(_0x2f74bd=_0xda4b0a),!_0x2f74bd)return'';let _0x57156c=!0x1;const _0x3b02bf=[];for(const _0x2d3f51 of _0x2f74bd['getChildren']())_0x2d3f51['is']('element','span')&&_0x2d3f51['hasClass']('ck-ai_review-marker_context-end')&&(_0x57156c=!0x1),_0x57156c&&_0x3b02bf['push'](_0x2d3f51),_0x2d3f51['is']('element','span')&&_0x2d3f51['hasClass']('ck-ai_review-marker_context-start')&&(_0x57156c=!0x0);_0x2f74bd['_removeChildren'](0x0,_0x2f74bd['childCount']),_0x9c9cf2?.['ellipsisBefore']&&_0x2f74bd['_appendChild']('…'),_0x2f74bd['_appendChild'](_0x3b02bf),_0x9c9cf2?.['ellipsisAfter']&&_0x2f74bd['_appendChild']('…');const _0x5d5aa7=_0x3802a3['htmlProcessor']['domConverter']['viewToDom'](_0xda4b0a),_0x2964fd=_0x3802a3['htmlProcessor']['htmlWriter']['getHtml'](_0x5d5aa7);_0x17e957=_0x2964fd;}return _0x17e957;};}['_createGetContentFn'](_0x4365a2,_0x3bfb82){let _0x3146ac='';return()=>(_0x3146ac||(_0x3146ac=_0x3bfb82['stringify'](_0x4365a2,{'showSuggestionHighlights':!0x0})),_0x3146ac);}['_createGetContentUsingDataIdFn'](_0x5b8107,_0x2f0004,_0xc25f5){let _0xa19c7e='';return()=>{if(!_0xa19c7e){const _0x3113b7=_0xc25f5['toView'](new _0x2af830(_0x5b8107)),_0x4b7d28=_0xc25f5['htmlProcessor']['domConverter']['viewToDom'](_0x3113b7)['querySelector']('[data-id=\x22'+_0x2f0004+'\x22]');_0xa19c7e=_0x4b7d28?.['outerHTML']||'';}return _0xa19c7e;};}['_findMarkerElement'](_0x22cc3e,_0x48c092=0x5){let _0x55d61c=_0x22cc3e,_0x5866ae=null;for(let _0x451aae=0x0;_0x451aae<_0x48c092&&_0x55d61c;_0x451aae++){if(!_0x55d61c['className']){_0x55d61c=_0x55d61c['parentElement'];continue;}if(!(''+_0x55d61c['className'])['includes']('ck-ai_review-marker_')){_0x55d61c=_0x55d61c['parentElement'];continue;}if(!_0x55d61c['getAttribute']('data-marker-id'))break;_0x5866ae=_0x55d61c;break;}return _0x5866ae;}['_findMarkerElementById'](_0x543532){const _0x3882b7=Fs(this['context']),_0x1da3e2=_0x3882b7['model']['markers']['get'](_0x543532);return _0x1da3e2?_0x378fe6(_0x3882b7['editing'],_0x1da3e2):null;}['_getMarkersDataForGroup'](_0x2abd81){return Array['from'](this['_markers']['values']())['filter'](_0x553423=>_0x553423['groupId']===_0x2abd81);}['_getOperationStart'](_0x568084){return'insert'===_0x568084['type']?_0x568084['position']:_0x568084['newRange']['start'];}['_getOperationEnd'](_0x526756,_0xc03217=!0x1){return'insert'===_0x526756['type']?_0xc03217?_0x526756['position']:_0x526756['position']['getShiftedBy'](_0x526756['howMany']):_0x526756['newRange']['end'];}['_shiftOperation'](_0x2e6e22,_0x181890){return'insert'===_0x2e6e22['type']?_0x2e6e22['position']=_0x2e6e22['position']['getShiftedBy'](_0x181890):'marker'===_0x2e6e22['type']&&_0x2e6e22['newRange']&&(_0x2e6e22['newRange']=new _0x1f3f5a(_0x2e6e22['newRange']['start']['getShiftedBy'](_0x181890),_0x2e6e22['newRange']['end']['getShiftedBy'](_0x181890))),_0x2e6e22;}['_changeOperationOwnerDocument'](_0x158c6c,_0x527b6c){'insert'===_0x158c6c['type']?_0x158c6c['position']=this['_changePositionOwnerDocument'](_0x158c6c['position'],_0x527b6c):'marker'===_0x158c6c['type']&&_0x158c6c['newRange']&&(_0x158c6c['newRange']=this['_changeRangeOwnerDocument'](_0x158c6c['newRange'],_0x527b6c));}['_changePositionOwnerDocument'](_0x263f5e,_0x22866f){return new _0x57a0b7(_0x22866f,_0x263f5e['path']);}['_changeRangeOwnerDocument'](_0x7bc878,_0x29d2fd){return new _0x1f3f5a(this['_changePositionOwnerDocument'](_0x7bc878['start'],_0x29d2fd),this['_changePositionOwnerDocument'](_0x7bc878['end'],_0x29d2fd));}['_changePosition'](_0x5c7f99,_0x31b34e){return new _0x57a0b7(_0x31b34e,[..._0x5c7f99]);}['_changeRange'](_0x41773e,_0x519c8d,_0x2f7d95,_0x19e6fb){return new _0x1f3f5a(this['_changePosition'](_0x519c8d,_0x19e6fb),this['_changePosition'](_0x2f7d95,_0x19e6fb));}['_sortMarkers'](_0x920b4b){const _0x1cf4e8=_0x185231=>{switch(_0x185231){case'insert':return 0x0;case'remove-context':return 0x1;case'remove-only':return 0x2;case'remove-text':return 0x3;}};return _0x920b4b['sort']((_0x255288,_0x1a504f)=>_0x1cf4e8(_0x255288['type'])-_0x1cf4e8(_0x1a504f['type']));}['_hasSameTopLevelElement'](_0x2414ae,_0x283b2d){const _0x10d7b3=_0x2414ae['getChild'](0x0),_0x2f9d28=_0x283b2d['getChild'](0x0);return!(!_0x10d7b3||!_0x2f9d28)&&((!_0x10d7b3['is']('element')||!_0x2f9d28['is']('element')||_0x10d7b3['name']===_0x2f9d28['name'])&&!(_0x10d7b3['is']('element')&&!_0x2f9d28['is']('element')||!_0x10d7b3['is']('element')&&_0x2f9d28['is']('element')));}['_haveSingleTopLevelElement'](_0x25ff70){return 0x1===_0x25ff70['childCount'];}['_haveOnlyInlineContent'](_0x31b4a3,_0x2d572c){for(const _0x4964cd of _0x31b4a3['getChildren']())if(_0x4964cd['is']('element')&&!_0x2d572c['isInline'](_0x4964cd))return!0x1;return!0x0;}['_upsertDataId'](_0x385371,_0x5aa07e){let _0x21e785=_0x385371['getAttribute'](_0x1eb54e);return _0x21e785||(_0x21e785=_0x5aa07e(),_0x385371['_setAttribute'](_0x1eb54e,_0x21e785)),_0x21e785;}}class Io extends pt(){['id'];['contentNew'];['contentInitial'];['documentVersion'];constructor({id:_0x3d30d3,contentNew:_0x11a6ec,contentInitial:_0x266d77,documentVersion:_0x4dd147}){super(),this['id']=_0x3d30d3,this['contentNew']=_0x11a6ec,this['contentInitial']=_0x266d77,this['documentVersion']=_0x4dd147;}}class Eo extends ht(){['id'];['parent'];['_data'];['_editorOperations']=[];constructor(_0x1230ea,_0x3f703d,_0x51e082){super(),this['id']=_0x1230ea,this['parent']=_0x51e082,this['_data']=_0x3f703d,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 To extends ht(){['id']=at();['callId'];['_results']=new Map();['_changes']=[];['_sourceCheck'];['_documentData'];['_aiConnector'];['_reviewParams'];['_reviewArgs'];['_activeRequest']=null;['_currentError'];['_wasAborted']=!0x1;constructor(_0x42cef9,_0x16daf6,_0x2d447b,_0x134a5c,_0x3a5859){super(),this['_sourceCheck']=_0x16daf6,this['_documentData']=_0x42cef9,this['_aiConnector']=_0x2d447b,this['_reviewParams']=_0x134a5c,this['_reviewArgs']=_0x3a5859,this['on']('change:status',(_0x1cb5fc,_0x30fb2b,_0x3c4751)=>{'aborted'==_0x3c4751&&(this['_wasAborted']=!0x0),this['fire']('reviewCheckRunUpdated',{'status':_0x3c4751,'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'](_0x2ee003=>'pending'===_0x2ee003['status']);}get['currentError'](){return this['_currentError'];}['updateDocumentData'](_0x5d6ed3){this['_documentData']=_0x5d6ed3;}async['start'](){this['status']='loading',this['_currentError']=void 0x0;try{this['_activeRequest']=this['_createApiRequest']();const _0x4e0d43=await this['_activeRequest']['getStream']();this['status']='data';for await(const _0x29d21e of _0x4e0d43)'unmodified'!==_0x29d21e['data']['operation']&&('error'!==_0x29d21e['data']['operation']?'review-metadata'!==_0x29d21e['event']?this['_addReviewCheckResult'](_0x29d21e['data']['dataId'],_0x29d21e['data']['textDelta']):this['callId']=_0x29d21e['data']['callId']:this['status']='error-chunk');'error-chunk'!==this['status']&&(0x0===this['_results']['size']||0x0===this['_changes']['length']?this['status']='unmodified':this['status']='ready');}catch(_0x31f42a){this['_currentError']=_0x31f42a,_0x31f42a instanceof Error&&_0x31f42a['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'](_0x468284,_0x4ce34e){const _0x1b3c26=this['_results']['get'](_0x468284);if(!_0x1b3c26)return;if(0x0===_0x4ce34e['length'])return;const _0x4f7c3e=[];_0x4ce34e['forEach']((_0x589ff4,_0x4bfaab)=>{const _0x1aac29=new Eo(_0x1b3c26['id']+'-'+_0x4bfaab,_0x589ff4,_0x1b3c26);_0x1aac29['on']('change:status',()=>{this['fire']('reviewCheckResultChangeStatusUpdated',{'change':_0x1aac29,'status':_0x1aac29['status']});}),_0x1aac29['on']('change:isActivated',()=>{_0x1aac29['isActivated']?this['fire']('reviewCheckResultActivated',{'change':_0x1aac29}):this['fire']('reviewCheckResultDeactivated',{'change':_0x1aac29});}),this['_changes']['push'](_0x1aac29),_0x4f7c3e['push'](_0x1aac29);}),this['fire']('reviewCheckResultReady',{'changes':_0x4f7c3e,'result':_0x1b3c26,'source':this});}['abort'](){this['_activeRequest']&&(this['_activeRequest']['abortController']['abort'](),this['_activeRequest']=null,this['status']='aborted');}['isChangeActive'](_0x130341){const _0x16e32e=this['_changes']['find'](_0x1a1337=>_0x1a1337['id']===_0x130341);return!(!_0x16e32e||'pending'!==_0x16e32e['status']);}['isAnyChangeActivated'](){return this['_changes']['some'](_0x5acfa2=>!0x0===_0x5acfa2['isActivated']);}['getActiveChanges'](){return this['_changes']['filter'](_0x1df6ef=>'pending'===_0x1df6ef['status']);}['getChangeById'](_0x18b6d8){return this['_changes']['find'](_0x432e72=>_0x432e72['id']===_0x18b6d8);}['markAllChangesAsAccepted'](){for(const _0x54e3e4 of this['_changes'])'pending'===_0x54e3e4['status']&&(_0x54e3e4['status']='accepted');this['_checkIfFinished']();}['markChangeAsAccepted'](_0x3ea04f){const _0x12fe97=this['_changes']['find'](_0x105032=>_0x105032['id']===_0x3ea04f);_0x12fe97&&'pending'===_0x12fe97['status']&&(_0x12fe97['status']='accepted'),this['_checkIfFinished']();}['markChangeAsRejected'](_0x745b2c){const _0x3d6153=this['_changes']['find'](_0x24c385=>_0x24c385['id']===_0x745b2c);_0x3d6153&&'pending'===_0x3d6153['status']&&(_0x3d6153['status']='rejected'),this['_checkIfFinished']();}['markChangeAsOutdated'](_0x2b4333){const _0x3ffdab=this['_changes']['find'](_0x14ba2a=>_0x14ba2a['id']===_0x2b4333);_0x3ffdab&&'pending'===_0x3ffdab['status']&&(_0x3ffdab['status']='outdated'),this['_checkIfFinished']();}['markChangeAsPending'](_0x536281){const _0x3da1e0=this['_changes']['find'](_0x52a086=>_0x52a086['id']===_0x536281);_0x3da1e0&&'outdated'===_0x3da1e0['status']&&(_0x3da1e0['status']='pending'),this['_checkIfFinished']();}['activateChange'](_0x48a3c3){this['_changes']['filter'](_0x604041=>_0x604041['isActivated']&&_0x604041['id']!==_0x48a3c3)['forEach'](_0x5e3645=>{_0x5e3645['isActivated']=!0x1;});const _0x2a2933=this['_changes']['find'](_0x252ce5=>_0x252ce5['id']===_0x48a3c3);_0x2a2933&&'pending'===_0x2a2933['status']&&(_0x2a2933['isActivated']=!0x0);}['deactivateChange'](){this['_changes']['filter'](_0x910bb5=>_0x910bb5['isActivated'])['forEach'](_0x5b86d3=>{_0x5b86d3['isActivated']=!0x1;});}['forceReadyState'](){this['status']='ready';}async['sendRating'](_0x1355b8){if('initialized'===this['status']||'loading'===this['status']||'data'===this['status']||this['_wasAborted'])return;if(!this['callId']||0x0===this['_changes']['length'])return;let _0x3d990b;if(_0x1355b8){const _0xd38bd8=this['_changes']['find'](_0x48a360=>_0x48a360['id']===_0x1355b8);if(_0xd38bd8&&_0xd38bd8['isRated'])return;_0xd38bd8&&(_0x3d990b=_0xd38bd8['parent']['id'],_0xd38bd8['isRated']=!0x0);}const _0x14258c={'positiveCount':this['_changes']['filter'](_0x2b1f10=>'accepted'===_0x2b1f10['status'])['length'],'totalCount':this['_changes']['length']};this['_sendRatingRequest'](_0x14258c,this['callId'],_0x3d990b);}['_addReviewCheckResult'](_0x3d54d9,_0x2413d9){const _0x59ccdb=this['_documentData']['elements']['get'](_0x3d54d9);if(!_0x59ccdb)return;const _0x2f6f65=_0x59ccdb['getContent']();if(_0x2f6f65===_0x2413d9)return;const _0x1e02b0=new Io({'id':_0x3d54d9,'contentInitial':_0x2f6f65,'contentNew':_0x2413d9,'documentVersion':this['_documentData']['version']});this['_results']['set'](_0x1e02b0['id'],_0x1e02b0),this['fire']('reviewCheckResultAdded',{'result':_0x1e02b0,'source':this});}['_checkIfFinished'](){'finished'===this['status']&&(this['_changes']['filter'](_0x5624a0=>'pending'===_0x5624a0['status'])['length']>0x0&&(this['status']='ready')),'ready'===this['status']&&(0x0===this['_changes']['filter'](_0x19fdc3=>'pending'===_0x19fdc3['status'])['length']&&(this['status']='finished'));}}class po extends To{get['subTitle'](){if(!this['_reviewParams']||0x0===this['_reviewParams']['length'])return'';const _0x884376=[];if(this['_reviewParams']['length']>0x0&&this['_sourceCheck']['options'])for(let _0x57a661=0x0;_0x57a661<this['_reviewParams']['length'];_0x57a661++){if(!this['_reviewParams'][_0x57a661]||!this['_sourceCheck']['options'][_0x57a661])continue;const _0x514f3c=this['_sourceCheck']['options'][_0x57a661],_0x4056ed=_0x514f3c['data']?.['find'](_0x1b4a5a=>_0x1b4a5a['id']===this['_reviewParams'][_0x57a661]);_0x4056ed&&_0x884376['push'](_0x4056ed['label']);}return _0x884376['join'](',\x20');}get['reviewName'](){return this['_composeReviewName']();}['_createApiRequest'](){return this['_aiConnector']['callSystemReview']({'reviewName':this['_composeReviewName'](),'content':this['_documentData']['content'],'args':this['_reviewArgs']});}['_sendRatingRequest'](_0x1c9ab7,_0x409149,_0x336ed1){return this['_aiConnector']['upsertAIReviewRating'](this['reviewName'],_0x409149,_0x1c9ab7,_0x336ed1);}['_composeReviewName'](){return!this['_reviewParams']||0x0===this['_reviewParams']['length']||this['_sourceCheck']['useArgs']?this['_sourceCheck']['apiId']:[this['_sourceCheck']['apiId'],...this['_reviewParams']]['join']('-');}}class mo extends _0x314798{['_aiConnector'];['_aiReviewCoreUi'];['_aiReviewCoreEditing'];['_aiReviewCheckList'];['_currentReviewCheckRun'];['_changeActivationSource']=null;static get['requires'](){return[rs];}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}async['init'](){this['_initRequiredPlugins'](),this['_aiReviewCheckList']=await this['_getChecksList'](),this['listenTo'](this['_aiReviewCoreUi'],'getReviewCheckList',()=>{this['_aiReviewCoreUi']['setAvailableChecks'](this['_aiReviewCheckList']['checks']);}),this['listenTo'](this['_aiReviewCoreUi'],'runReviewCheck',async(_0x41ac6c,_0x5a92cb)=>{const _0x1e69a0=this['_aiReviewCheckList']['getCheckById'](_0x5a92cb['id']);if(_0x1e69a0){this['_onReviewCheckRun'](_0x5a92cb),this['_aiReviewCoreEditing']['switchToReadOnly'](),this['_currentReviewCheckRun']=this['_createReviewCheckRun'](_0x5a92cb,_0x1e69a0),this['_aiReviewCoreUi']['setCheckResultTitle'](this['_currentReviewCheckRun']['title'],this['_currentReviewCheckRun']['subTitle']),this['_currentReviewCheckRun']['on']('reviewCheckRunUpdated',(_0x25436e,_0x3d6187)=>{switch(_0x3d6187['status']){case'data':case'loading':this['_aiReviewCoreUi']['showCheckRunResults'](_0x3d6187);break;case'finished':this['_onCheckRunFinished']();break;case'ready':this['_aiReviewCoreUi']['showActionsWhenResultIsReady']();break;case'unmodified':this['_aiReviewCoreUi']['showNoChangesView']();break;case'error-general':this['_aiReviewCoreUi']['showGeneralResultsErrorView'](),this['_logError'](new ot('ai-review-mode-check-run-general-error',this,void 0x0,this['_currentReviewCheckRun']?.['currentError']));break;case'error-chunk':this['_aiReviewCoreUi']['showChunkErrorView'](),this['_logError'](new ot('ai-review-mode-check-run-chunk-error',this,void 0x0,this['_currentReviewCheckRun']?.['currentError']));break;case'aborted':this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['processedResultsCount']>0x0?setTimeout(()=>{this['_currentReviewCheckRun']?.['forceReadyState']();},0x0):this['_onReviewRunLeave'](!0x0);}'ready'!==_0x3d6187['status']&&'error-chunk'!==_0x3d6187['status']&&'error-general'!==_0x3d6187['status']||this['_currentReviewCheckRun']?.['sendRating']();}),this['_currentReviewCheckRun']['on']('reviewCheckResultAdded',(_0x28de88,_0xf979e5)=>{if(!this['_currentReviewCheckRun'])throw new ot('ai-review-mode-no-current-check-run',this);const _0x2882c1=this['_diffContent'](_0xf979e5['result']['contentInitial'],_0xf979e5['result']['contentNew']);_0xf979e5['source']['addResultChanges'](_0xf979e5['result']['id'],_0x2882c1);}),this['_currentReviewCheckRun']['on']('reviewCheckResultReady',(_0x467b82,_0x14ffeb)=>{for(const _0x4de8aa of _0x14ffeb['changes'])this['_aiReviewCoreUi']['showCheckRunResult'](_0x4de8aa);this['_markChangePositionInEditorContent'](_0x14ffeb['changes'],_0x14ffeb['source']['documentData']);}),this['_currentReviewCheckRun']['on']('reviewCheckResultChangeStatusUpdated',(_0x19de71,_0x17df97)=>{this['_aiReviewCoreUi']['updateChangeState'](_0x17df97['change']['id'],_0x17df97['status']);}),this['_currentReviewCheckRun']['on']('reviewCheckResultActivated',(_0x3881dd,_0x28f622)=>{this['_onReviewCheckResultActivated'](_0x28f622);}),this['_currentReviewCheckRun']['on']('reviewCheckResultDeactivated',()=>{this['_onReviewCheckResultDeactivated']();});try{await this['_currentReviewCheckRun']['start']();}catch(_0x6b6be9){_0x6b6be9 instanceof Error&&_0x6b6be9['message']['includes']('ai-request-aborted')||(_0x6b6be9 instanceof ot?this['_logError'](_0x6b6be9):this['_logError'](new ot('ai-review-mode-check-run-failed',this,void 0x0,_0x6b6be9)));}}else this['_logError'](new ot('ai-review-mode-source-check-not-found',this,{'checkId':_0x5a92cb['id']}));}),this['listenTo'](this['_aiReviewCoreUi'],'leaveReview',()=>{this['_onReviewRunLeave']();}),this['listenTo'](this['_aiReviewCoreUi'],'leaveReviewCoreResultList',()=>{this['_onReviewRunLeave'](!0x0);}),this['listenTo'](this['_aiReviewCoreUi'],'abortReviewStream',()=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['abort']();}),this['listenTo'](this['_aiReviewCoreUi'],'finishReview',()=>{this['_onReviewRunLeave'](!0x0);}),this['listenTo'](this['_aiReviewCoreUi'],'acceptAllChanges',()=>{if(!this['_currentReviewCheckRun'])return;const _0x2bd4e4=this['_currentReviewCheckRun']['getActiveChanges']();if(!_0x2bd4e4['length'])return;this['_aiReviewCoreEditing']['applyChange'](_0x2bd4e4['map'](_0x33298d=>_0x33298d['id']));const _0x2af030=this['_currentReviewCheckRun'];_0x2af030['markAllChangesAsAccepted'](),_0x2af030['sendRating']();}),this['listenTo'](this['_aiReviewCoreUi'],'acceptChange',(_0x26fcbc,_0x483562)=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['isChangeActive'](_0x483562['id'])&&(this['_aiReviewCoreEditing']['applyChange']([_0x483562['id']]),this['_currentReviewCheckRun']['markChangeAsAccepted'](_0x483562['id']),this['_aiReviewCoreUi']['hideChangeBalloon'](),this['_currentReviewCheckRun']['sendRating'](_0x483562['id']));}),this['listenTo'](this['_aiReviewCoreUi'],'dismissChange',(_0x35f649,_0x21e71c)=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['isChangeActive'](_0x21e71c['id'])&&(this['_aiReviewCoreEditing']['rejectChange'](_0x21e71c['id']),this['_currentReviewCheckRun']['markChangeAsRejected'](_0x21e71c['id']),this['_aiReviewCoreUi']['hideChangeBalloon'](),this['_currentReviewCheckRun']['sendRating'](_0x21e71c['id']));}),this['listenTo'](this['_aiReviewCoreUi'],'retryReview',async()=>{this['_currentReviewCheckRun']&&(this['_aiReviewCoreEditing']['clearAllMarkers'](),this['_currentReviewCheckRun']['updateDocumentData'](this['_aiReviewCoreEditing']['getDocumentData']()),await this['_currentReviewCheckRun']['restart']());}),this['listenTo'](this['_aiReviewCoreUi'],'activateChange',(_0x2aa5a3,_0x1438a6)=>{this['_onActivateChange'](_0x1438a6);}),this['listenTo'](this['_aiReviewCoreUi'],'deactivateChange',(_0x348fe6,_0x392c30)=>{this['_onDeactivateChange'](_0x392c30);}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerClicked',(_0xedde15,_0x494fa9)=>{this['_onChangeMarkerClicked'](_0xedde15,_0x494fa9);}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerHovered',(_0x32de92,_0x3b5628)=>{this['_onChangeMarkerHovered'](_0x32de92,_0x3b5628);}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerBlurred',()=>{this['_onChangeMarkerBlurred']();}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerRemoved',(_0x14d84d,_0x258e7c)=>{this['_onChangeMarkerRemoved'](_0x14d84d,_0x258e7c);}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerRestored',(_0x5941e8,_0x39a7a)=>{this['_onChangeMarkerRestored'](_0x5941e8,_0x39a7a);});}['_createReviewCheckRun'](_0x5abeb6,_0x22111f){return new po(this['_aiReviewCoreEditing']['getDocumentData'](),_0x22111f,this['_aiConnector'],_0x5abeb6['params'],_0x5abeb6['args']);}['_onChangeMarkerRemoved'](_0x17076a,_0x283a28){this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['markChangeAsOutdated'](_0x283a28['changeId']);}['_onChangeMarkerRestored'](_0x3c1034,_0x4834be){this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['markChangeAsPending'](_0x4834be['changeId']);}['_onCheckRunFinished'](){this['_aiReviewCoreUi']['showReviewCompletedView']();}['_initRequiredPlugins'](){this['_aiConnector']=this['context']['plugins']['get']('AIConnector');}['_onReviewRunLeave'](_0xd9bded=!0x1){this['_currentReviewCheckRun']&&(this['_currentReviewCheckRun']['hasModifications']||this['_currentReviewCheckRun']['sendRating'](),this['_currentReviewCheckRun']['stopListening'](),this['_currentReviewCheckRun']['abort'](),this['_currentReviewCheckRun']=void 0x0),_0xd9bded&&this['_aiReviewCoreUi']['showReviewCheckList'](),this['_aiReviewCoreEditing']['clearAllMarkers'](),this['_aiReviewCoreEditing']['switchToEdit'](),this['_changeActivationSource']=null;const _0x5bb766=this['_aiReviewCoreEditing']['getEditor']();_0x5bb766&&_0x5bb766['editing']['view']['change'](_0x51124a=>{const _0x53bc54=_0x5bb766['editing']['view']['document']['getRoot']();_0x51124a['removeClass']('ck-ai_review-diff',_0x53bc54),_0x51124a['removeClass']('ck-ai_review-highlights',_0x53bc54),_0x51124a['removeClass']('ck-ai-translate-mode-content',_0x53bc54);});}['_getTranslationWithDefault'](_0x996ddf,_0x2c6cbd){const _0x4893c5=as(this['context']['locale'],_0x996ddf);return _0x4893c5===_0x996ddf?_0x2c6cbd:_0x4893c5;}['_logError'](_0x18c08c,_0x1ff4c6=!0x1){Et(_0x18c08c['message']),_0x1ff4c6||(_0x18c08c['message']['startsWith']('ai-review-mode-models-unable-to-retrieve')?this['_aiReviewCoreUi']['showGeneralReviewCoreErrorView']():this['_aiReviewCoreUi']['showGeneralResultsErrorView']());}['_scrollToChange'](_0x45ee0e){if('content'===this['_changeActivationSource']){const _0x45fbc4=this['_aiReviewCoreUi']['getChangeElement'](_0x45ee0e);_0x45fbc4&&wt(_0x45fbc4['closest']('.ck-ai_review__check-run-result')||_0x45fbc4);}else{if('panel'===this['_changeActivationSource']){const _0x2b8b4c=this['_getChangeContentElement'](_0x45ee0e);if(!_0x2b8b4c)return;mt({'target':_0x2b8b4c,'viewportOffset':{'top':0x55,'left':0x0,'bottom':0x0,'right':0x0},'ancestorOffset':0x14,'alignToTop':!0x0});}}}}const Co=[{'id':'custom','commandId':'custom','title':'Custom\x20command','description':'Type\x20a\x20custom\x20command\x20to\x20review\x20the\x20content\x20exactly\x20as\x20you\x20need.','isParameterized':!0x0},{'id':'correctness','commandId':'correctness','title':'Correctness','description':'Ensure\x20the\x20text\x20is\x20factually\x20accurate\x20and\x20free\x20of\x20errors.','isParameterized':!0x1},{'id':'clarity','commandId':'clarity','title':'Clarity','description':'Improve\x20the\x20clarity\x20and\x20readability\x20of\x20the\x20text.','isParameterized':!0x1},{'id':'readability','commandId':'readability','title':'Readability','description':'Enhance\x20the\x20overall\x20readability\x20of\x20the\x20text.','isParameterized':!0x1},{'id':'length','commandId':'make','title':'Adjust\x20length','description':'Refine\x20text\x20length\x20to\x20match\x20your\x20needs.','isParameterized':!0x0,'options':[{'formType':'dropdown','label':'Adjust\x20length','default':'longer','data':[{'label':'Longer','id':'longer'},{'label':'Shorter','id':'shorter'}]}]},{'id':'tone','commandId':'make-tone','title':'Adjust\x20tone\x20and\x20style','description':'Choose\x20tone\x20and\x20style\x20to\x20change\x20content\x20as\x20you\x20need.','isParameterized':!0x0,'options':[{'formType':'dropdown','label':'Adjust\x20tone\x20and\x20style','default':'casual','data':[{'label':'Casual','id':'casual'},{'label':'Direct','id':'direct'},{'label':'Friendly','id':'friendly'},{'label':'Confident','id':'confident'},{'label':'Professional','id':'professional'}]}]}];class wo{['id'];['commandId'];['title'];['description'];['isParameterized'];['useArgs'];['options'];['args'];get['apiId'](){return this['commandId'];}constructor(_0xe21b0c){this['id']=_0xe21b0c['id'],this['commandId']=_0xe21b0c['commandId'],this['title']=_0xe21b0c['title'],this['description']=_0xe21b0c['description'],this['isParameterized']=_0xe21b0c['isParameterized'],this['useArgs']=_0xe21b0c['useArgs'],this['options']=_0xe21b0c['options'],this['args']=_0xe21b0c['args'];}}class fo extends ht(){['_checks']=[];['setupChecks'](_0x471aa8){this['_checks']=_0x471aa8['map'](_0x356600=>new wo(_0x356600));}get['checks'](){return this['_checks'];}['getCheckById'](_0x153e6a){return this['checks']['find'](_0x5aefce=>_0x5aefce['id']===_0x153e6a);}['removeCheckById'](_0x16803d){this['_checks']=this['_checks']['filter'](_0x3a6bf6=>_0x3a6bf6['id']!==_0x16803d);}}class So extends wo{['_models']=[];['_defaultModel']=null;constructor(_0x1e54f6,_0x41e535,_0x39cb1b){super(_0x1e54f6),this['_models']=_0x41e535,this['_defaultModel']=_0x39cb1b;}get['models'](){return this['_models'];}get['defaultModel'](){return this['_defaultModel'];}}class bo extends wo{['isExtra']=!0x0;['prompt'];['model'];['_defaultModel']=null;constructor(_0xcfe6b8,_0x1c4db7,_0x3f6173){super(_0xcfe6b8),this['prompt']=_0xcfe6b8['prompt'],this['model']=_0xcfe6b8['model'],this['model']?this['_defaultModel']=_0x1c4db7['find'](_0x153ea3=>_0x153ea3['id']===this['model'])||null:this['_defaultModel']=_0x3f6173;}get['defaultModel'](){return this['_defaultModel'];}}class Ro extends fo{['_allModels']=[];['_recommendedModels']=[];['_defaultModel']=null;constructor(_0x485a0b,_0x5031c1,_0x3b9bb3){super(),this['_allModels']=_0x485a0b,this['_recommendedModels']=_0x5031c1,this['_defaultModel']=_0x3b9bb3;}['setupChecks'](_0x385ec0){this['_checks']=_0x385ec0['map'](_0x51b893=>!0x0===_0x51b893['isExtra']?new bo(_0x51b893,this['_allModels'],this['_defaultModel']):'custom'===_0x51b893['id']?new So(_0x51b893,this['_recommendedModels'],this['_defaultModel']):new wo(_0x51b893));}}class Oo extends To{['_prompt'];['_model'];constructor(_0x51530c,_0x28f741,_0x2d091e,_0x9794e7,_0x1badaf){super(_0x2d091e,_0x9794e7,_0x1badaf),this['_prompt']=_0x51530c,this['_model']=_0x28f741;}get['subTitle'](){return this['_prompt'];}['_createApiRequest'](){return this['_aiConnector']['callCustomReview']({'content':this['_documentData']['content'],'prompt':this['_prompt'],'model':this['_model']});}['_sendRatingRequest'](_0x4c6594,_0x27af93,_0x44609b){return this['_aiConnector']['upsertCustomAIReviewRating'](_0x27af93,_0x4c6594,_0x44609b);}}class ko extends Oo{get['subTitle'](){return'';}set['prompt'](_0x1d7f38){this['_prompt']=_0x1d7f38;}set['model'](_0x365369){this['_model']=_0x365369;}}class No extends mo{static get['pluginName'](){return'AIReviewModeController';}['_isDiffOn']=!0x1;['_hasDefaultAvailableCommands']=!0x1;constructor(_0x467a31){super(_0x467a31),this['_hasDefaultAvailableCommands']=!this['context']['config']['get']('ai.review.availableCommands'),this['context']['config']['define']('ai.review.availableCommands',Co['map'](_0x275f1a=>_0x275f1a['id'])),this['context']['config']['define']('ai.review.extraCommands',[]);}async['init'](){await super['init'](),this['listenTo'](this['_aiReviewCoreUi'],'toggleDiff',(_0x48ab9e,_0x372bf6)=>{this['_isDiffOn']=_0x372bf6['on'],this['_onDiffChange'](this['_isDiffOn']);});}['_initRequiredPlugins'](){super['_initRequiredPlugins'](),this['_aiReviewCoreUi']=this['context']['plugins']['get']('AIReviewModeUI'),this['_aiReviewCoreEditing']=this['context']['plugins']['get']('AIReviewCoreEditing');}['_createReviewCheckRun'](_0x52c740,_0x5355d6){return _0x52c740['isCustom']?new Oo(_0x52c740['args']['prompt'],_0x52c740['args']['model'],this['_aiReviewCoreEditing']['getDocumentData'](),_0x5355d6,this['_aiConnector']):_0x5355d6['isExtra']?new ko(_0x5355d6['prompt'],_0x5355d6['defaultModel']['id'],this['_aiReviewCoreEditing']['getDocumentData'](),_0x5355d6,this['_aiConnector']):new po(this['_aiReviewCoreEditing']['getDocumentData'](),_0x5355d6,this['_aiConnector'],_0x52c740['params'],_0x52c740['args']);}['_onReviewCheckResultActivated'](_0x1061f6){this['_aiReviewCoreUi']['setActiveStateInResults'](_0x1061f6['change']['id']),this['_scrollToChange'](_0x1061f6['change']['id']);const _0x320093=this['_aiReviewCoreEditing']['getMarkerElementForChange'](_0x1061f6['change']['id']);if(!_0x320093)return;const _0x2aa676=this['_aiReviewCoreEditing']['getEditor']();this['_aiReviewCoreUi']['showChangeBalloon'](_0x1061f6['change'],()=>_0x320093['getElement'](),void 0x0,'click',_0x2aa676?.['editing']?.['view']?.['getDomRoot'](),_0x2aa676?.['ui']?.['viewportOffset']),this['_aiReviewCoreEditing']['setMarkersInElementAsActive'](_0x1061f6['change']['id']);}['_onReviewCheckResultDeactivated'](){this['_aiReviewCoreUi']['resetActiveStateInResults'](),this['_aiReviewCoreUi']['hideChangeBalloon'](),this['_aiReviewCoreEditing']['setAllMarkersAsInactive']();}['_onActivateChange'](_0x28cda5){this['_currentReviewCheckRun']&&'click'===_0x28cda5['uiInteraction']&&(this['_changeActivationSource']='panel',this['_currentReviewCheckRun']['activateChange'](_0x28cda5['id']));}['_onDeactivateChange'](_0x504cc1){this['_currentReviewCheckRun']&&'balloon'===_0x504cc1['origin']&&this['_currentReviewCheckRun']['deactivateChange']();}['_onChangeMarkerClicked'](_0x12cbf9,_0x532e18){if(!this['_currentReviewCheckRun'])return;this['_changeActivationSource']='content',this['_currentReviewCheckRun']['activateChange'](_0x532e18['changeId']);const _0x363bc6=this['_currentReviewCheckRun']['getChangeById'](_0x532e18['changeId']);if(!_0x363bc6)return;const _0x2bfbfb=this['_aiReviewCoreEditing']['getEditor']();this['_aiReviewCoreUi']['showChangeBalloon'](_0x363bc6,_0x532e18['markerElement'],_0x532e18['domEvent'],'click',_0x2bfbfb?.['editing']?.['view']?.['getDomRoot'](),_0x2bfbfb?.['ui']?.['viewportOffset']);}['_onChangeMarkerHovered'](_0x3a2be8,_0x358a9e){if(!this['_currentReviewCheckRun'])return;if(this['_currentReviewCheckRun']['isAnyChangeActivated']())return;const _0x2eeeb7=this['_currentReviewCheckRun']['getChangeById'](_0x358a9e['changeId']);if(!_0x2eeeb7)return;const _0x1e7e4f=this['_aiReviewCoreEditing']['getEditor']();this['_aiReviewCoreUi']['showChangeBalloon'](_0x2eeeb7,_0x358a9e['markerElement'],_0x358a9e['domEvent'],'hover',_0x1e7e4f?.['editing']?.['view']?.['getDomRoot'](),_0x1e7e4f?.['ui']?.['viewportOffset']);}['_onChangeMarkerBlurred'](){if(!this['_currentReviewCheckRun'])return;this['_currentReviewCheckRun']['isAnyChangeActivated']()||this['_aiReviewCoreUi']['hideChangeBalloon']();}['_getChangeContentElement'](_0x4edd59){const _0xfb5854=this['_aiReviewCoreEditing']['getMarkerElementForChange'](_0x4edd59);return _0xfb5854?_0xfb5854['getElement']():null;}['_markChangePositionInEditorContent'](_0x15c4d9,_0x1073ff){this['_aiReviewCoreEditing']['markChangePositionInEditorContent'](_0x15c4d9,_0x1073ff);}['_diffContent'](_0x452138,_0x3f6bda){return this['_aiReviewCoreEditing']['diffContent'](_0x452138,_0x3f6bda);}['_onReviewCheckRun'](){this['_onDiffChange'](this['_isDiffOn']);}['_onDiffChange'](_0x4dd7d9){const _0x190fa8=this['_aiReviewCoreEditing']['getEditor']();_0x4dd7d9?this['_aiReviewCoreUi']['hideDiffInBalloon']():this['_aiReviewCoreUi']['showDiffInBalloon'](),_0x190fa8&&_0x190fa8['editing']['view']['change'](_0x3bf08d=>{const _0x4c881a=_0x190fa8['editing']['view']['document']['getRoot']();for(const _0x366a7e of _0x4c881a['getClassNames']())_0x366a7e['startsWith']('ck-ai_review-')&&_0x3bf08d['removeClass'](_0x366a7e,_0x4c881a);_0x3bf08d['addClass'](_0x4dd7d9?'ck-ai_review-diff':'ck-ai_review-highlights',_0x4c881a);});}async['_getChecksList'](){const _0x247a3b=[...Co,...this['_getExtraChecks']()],_0xeefaf=this['context']['config']['get']('ai.review.availableCommands')||[];this['_logErrorForNonExistentChecks'](_0xeefaf,_0x247a3b);let _0x21fc2c=_0x247a3b;this['_hasDefaultAvailableCommands']||(_0x21fc2c=_0xeefaf['map'](_0x45635f=>_0x247a3b['find'](_0x180add=>_0x180add['id']===_0x45635f))['filter'](_0x3213be=>!!_0x3213be)),_0x21fc2c=_0x21fc2c['map'](_0x54b3d3=>_0x54b3d3['isExtra']?_0x54b3d3:this['_translateReviewCheck'](_0x54b3d3));const _0x5769c8=_0x21fc2c['some'](_0x115133=>_0x115133['isExtra']||'custom'===_0x115133['id']);let _0xebd4dd=[],_0x184af4=[],_0x230292=null;if(_0x5769c8){const _0x16fc89=await this['_getModels']();_0xebd4dd=_0x16fc89['all'],_0x184af4=_0x16fc89['recommended'],_0x230292=_0x16fc89['default'];}const _0x581218=new Ro(_0xebd4dd,_0x184af4,_0x230292);return _0x581218['setupChecks'](_0x21fc2c),_0x5769c8&&this['_filterChecksWithMissingModel'](_0x581218),_0x581218;}['_getExtraChecks'](){return(this['context']['config']['get']('ai.review.extraCommands')||[])['map'](_0x4711b2=>({'id':_0x4711b2['id'],'commandId':_0x4711b2['id'],'title':_0x4711b2['label'],'description':_0x4711b2['description'],'isParameterized':!0x1,'isExtra':!0x0,'prompt':_0x4711b2['prompt'],'model':_0x4711b2['model']}));}['_logErrorForNonExistentChecks'](_0x20cf5e,_0x469962){const _0x20a667=_0x20cf5e['filter'](_0x47b532=>!_0x469962['some'](_0x4b8798=>_0x4b8798['id']===_0x47b532));_0x20a667['length']&&this['_logError'](new ot('ai-review-mode-non-existent-commands-used',this,{'commandIds':_0x20a667['join'](',\x20')}),!0x0);}async['_getModels'](){try{const _0x4e4c0a=new Bs({'connector':this['_aiConnector'],'config':this['context']['config']['get']('ai.models'),'locale':this['context']['locale']});return{'all':await _0x4e4c0a['getAll'](),'recommended':await _0x4e4c0a['getAvailableModels'](),'default':await _0x4e4c0a['getDefault']()};}catch(_0x53ffd7){return this['_logError'](new ot('ai-review-mode-models-unable-to-retrieve',this,void 0x0,_0x53ffd7)),{'all':[],'recommended':[],'default':null};}}['_translateReviewCheck'](_0xe0b80d){const _0x8b60ec='AI_REVIEW_CHECK_'+_0xe0b80d['id']['toUpperCase']()['replaceAll']('-','_'),_0xcfef90={..._0xe0b80d,'title':this['_getTranslationWithDefault'](_0x8b60ec+'_TITLE',_0xe0b80d['title']),'description':this['_getTranslationWithDefault'](_0x8b60ec+'_DESCRIPTION',_0xe0b80d['description'])};return _0xe0b80d['options']&&(_0xcfef90['options']=_0xe0b80d['options']['map'](_0x5068ef=>({..._0x5068ef,'label':this['_getTranslationWithDefault'](_0x8b60ec+'_OPTIONS_LABEL',_0x5068ef['label']||''),'data':_0x5068ef['data']?_0x5068ef['data']['map'](_0x2e5496=>({..._0x2e5496,'label':this['_getTranslationWithDefault'](_0x8b60ec+'_OPTIONS_DATA_'+_0x2e5496['id']['toUpperCase'](),_0x2e5496['label'])})):void 0x0}))),_0xcfef90;}['_filterChecksWithMissingModel'](_0x47b0c4){const _0x534857=[];_0x47b0c4['checks']['forEach'](_0x427bb6=>{(_0x427bb6 instanceof bo&&!_0x427bb6['defaultModel']||_0x427bb6 instanceof So&&!_0x427bb6['models']['length'])&&_0x534857['push'](_0x427bb6['id']);}),_0x534857['length']&&_0x534857['forEach'](_0x59bc4b=>{_0x47b0c4['removeCheckById'](_0x59bc4b),this['_logError'](new ot('ai-review-mode-command-unavailable-due-to-missing-model',this,{'commandId':_0x59bc4b}),!0x0);});}}class vo extends _0x314798{static get['requires'](){return[No,_o,go];}static get['pluginName'](){return'AIReviewMode';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class yo extends wo{get['apiId'](){return'translate';}}class xo extends fo{['setupChecks'](_0x443324){this['_checks']=_0x443324['map'](_0x11cccf=>new yo(_0x11cccf));}}class Lo extends po{['_title'];constructor(_0x394982,_0x3ed033,_0x5acfaa,_0x1c3b69,_0x7e8097,_0x397bc2){super(_0x394982,_0x3ed033,_0x5acfaa,_0x7e8097,_0x397bc2),this['_title']=_0x1c3b69;}get['title'](){return this['_title'];}get['subTitle'](){return this['_sourceCheck']['title'];}}class Do extends mo{static get['pluginName'](){return'AITranslateController';}constructor(_0x308429){super(_0x308429),this['context']['config']['define']('ai.translate.languages',[{'label':'English','id':'english'},{'label':'Spanish','id':'spanish'},{'label':'French','id':'french'},{'label':'German','id':'german'},{'label':'Chinese\x20(Simplified)','id':'chinese'},{'label':'Japanese','id':'japanese'},{'label':'Russian','id':'russian'},{'label':'Portuguese','id':'portuguese'},{'label':'Korean','id':'korean'},{'label':'Italian','id':'italian'}]);}['_onCheckRunFinished'](){this['_onReviewRunLeave'](!0x0);}['_initRequiredPlugins'](){super['_initRequiredPlugins'](),this['_aiReviewCoreUi']=this['context']['plugins']['get']('AITranslateUI'),this['_aiReviewCoreEditing']=this['context']['plugins']['get']('AIReviewCoreEditing');}['_createReviewCheckRun'](_0x35118c,_0x19ab83){return new Lo(this['_aiReviewCoreEditing']['getDocumentData'](),_0x19ab83,this['_aiConnector'],as(this['context']['locale'],'AI_REVIEW_CHECK_TRANSLATE_TITLE'),_0x35118c['params'],_0x35118c['args']);}['_onReviewCheckResultActivated'](_0x26a2cc){this['_aiReviewCoreUi']['setActiveStateInResults'](_0x26a2cc['change']['id']),this['_aiReviewCoreEditing']['setMarkersInElementAsActive'](_0x26a2cc['change']['id']);}['_onReviewCheckResultDeactivated'](){this['_aiReviewCoreEditing']['setAllMarkersAsInactive'](),this['_aiReviewCoreUi']['resetActiveStateInResults']();}['_onActivateChange'](_0x50fd79){this['_currentReviewCheckRun']&&('hover'===_0x50fd79['uiInteraction']&&(this['_changeActivationSource']='panel',this['_currentReviewCheckRun']['activateChange'](_0x50fd79['id'])),'click'===_0x50fd79['uiInteraction']&&this['_scrollToChange'](_0x50fd79['id']));}['_onDeactivateChange'](_0x20bfab){this['_currentReviewCheckRun']&&'panel'===_0x20bfab['origin']&&this['_currentReviewCheckRun']['deactivateChange']();}['_onChangeMarkerClicked'](_0x1e8692,_0x42efff){this['_currentReviewCheckRun']&&(this['_changeActivationSource']='content',this['_currentReviewCheckRun']['activateChange'](_0x42efff['changeId']),this['_scrollToChange'](_0x42efff['changeId']));}['_onChangeMarkerHovered'](_0x11719c,_0x10dbae){this['_currentReviewCheckRun']&&(this['_changeActivationSource']='content',this['_currentReviewCheckRun']['activateChange'](_0x10dbae['changeId']),this['_aiReviewCoreEditing']['reactivateMarkers'](_0x10dbae['changeId']));}['_onChangeMarkerBlurred'](){this['_currentReviewCheckRun']&&'content'===this['_changeActivationSource']&&(this['_currentReviewCheckRun']['deactivateChange'](),this['_aiReviewCoreEditing']['setAllMarkersAsInactive']());}['_getChangeContentElement'](_0x43dad9){return this['_aiReviewCoreEditing']['getContentElementForChange'](_0x43dad9);}['_markChangePositionInEditorContent'](_0x224e36,_0x4c2af3){this['_aiReviewCoreEditing']['markChangePositionInEditorContent'](_0x224e36,_0x4c2af3);}['_diffContent'](_0x359be8,_0x6be768){return this['_aiReviewCoreEditing']['diffContent'](_0x359be8,_0x6be768,!0x0);}['_onReviewCheckRun'](){const _0x4589ab=this['_aiReviewCoreEditing']['getEditor']();_0x4589ab&&_0x4589ab['editing']['view']['change'](_0x23f032=>{const _0x2762d1=_0x4589ab['editing']['view']['document']['getRoot']();for(const _0x5bd405 of _0x2762d1['getClassNames']())(_0x5bd405['startsWith']('ck-ai-review-')||'ck-ai-translate-'===_0x5bd405)&&_0x23f032['removeClass'](_0x5bd405,_0x2762d1);_0x23f032['addClass']('ck-ai-translate-mode-content',_0x2762d1);});}async['_getChecksList'](){const _0x4e89c3=[],_0x346282=this['context']['config']['get']('ai.translate.languages')||[];for(const _0x907b5b of _0x346282)_0x4e89c3['push']({'title':_0x907b5b['label'],'id':_0x907b5b['id'],'commandId':_0x907b5b['id'],'description':'','isParameterized':!0x1,'useArgs':!0x0,'args':{'language':_0x907b5b['id']}});const _0x4e571b=new xo();return _0x4e571b['setupChecks'](this['_translateChecks'](_0x4e89c3)),_0x4e571b;}['_translateChecks'](_0x1aad4f){return _0x1aad4f['map'](_0x17e9e9=>{const _0x5f5657='AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_'+_0x17e9e9['title']['toUpperCase']()['replaceAll']('-','_');return{..._0x17e9e9,'title':this['_getTranslationWithDefault'](_0x5f5657,_0x17e9e9['title'])};});}}class Po extends io{constructor(_0xbc99a3,_0x14cee5){super(_0xbc99a3,_0x14cee5),this['on']('set:isLoading',(_0x39d5b5,_0x4cb6bd,_0x18321d)=>{_0x18321d&&(this['headerTitle']=as(this['locale'],'AI_TRANSLATE_CHECK_RESULTS_LOADING_TITLE'));}),this['on']('set:isResultReady',(_0x209d3d,_0x44ed88,_0x21f4ae)=>{_0x21f4ae&&(this['headerTitle']=as(this['locale'],'AI_TRANSLATE_CHECK_RESULTS_READY_TITLE'));});}['_createAcceptAllButtonView'](){const _0xd00f82=super['_createAcceptAllButtonView']();return _0xd00f82['set']('label',as(this['locale'],'AI_TRANSLATE_ACCEPT_ALL')),_0xd00f82;}['_createExitReviewButtonView'](){const _0x349e2f=super['_createExitReviewButtonView']();return _0x349e2f['set']('label',as(this['locale'],'AI_CHAT_HISTORY_CANCEL')),_0x349e2f;}}class Ho extends uo{['_setupTemplate'](){const _0x57c163=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-translate__check-list-wrapper',_0x57c163['if']('isVisible','ck-hidden',_0x8aaaa0=>!_0x8aaaa0)]},'children':[{'tag':'div','attributes':{'class':['ck-ai-translate__check-list-header']},'children':[{'tag':'h2','children':[{'text':as(this['locale'],'AI_TRANSLATE_CHECK_LIST_HEADER_TITLE')}]},{'tag':'p','children':[{'text':as(this['locale'],'AI_TRANSLATE_CHECK_LIST_HEADER_DESCRIPTION')}]}]},{'tag':'div','attributes':{'class':['ck-ai_review__check-list',_0x57c163['if']('isVisible','ck-hidden',_0x31dc78=>!_0x31dc78)]},'children':this['_checkViews']}]});}}class Mo extends Ja{static get['pluginName'](){return'AITranslateUI';}['createMainView'](){const _0x530074=this['context']['locale'],_0x126d30=new _0x327048(_0x530074,{'label':as(_0x530074,'AI_REVIEW_CHECK_TRANSLATE_TITLE'),'icon':_0x1b974b,'class':'ck-ai-header\x20ck-ai-header_review-translate'}),_0x4383a1=new to(_0x530074,{'header':_0x126d30,'list':new Ho(_0x530074),'results':new Po(_0x530074,{'generalErrorText':as(_0x530074,'AI_TRANSLATE_GENERAL_ERROR_MESSAGE')}),'completed':new so(_0x530074,{'headerText':as(_0x530074,'AI_TRANSLATE_FINISH_HEADER_TITLE'),'emptyResultsText':as(_0x530074,'AI_TRANSLATE_EMPTY_RESULTS_TEXT'),'buttonText':as(_0x530074,'AI_TRANSLATE_FINISH_BUTTON_LABEL')})});return _0x4383a1['extendTemplate']({'attributes':{'class':'ck-ai-translate-mode'}}),_0x4383a1;}['registerTab'](){const _0x2d7873=this['context']['plugins']['get']('AITabs');_0x2d7873['view']['on']('activateTab',(_0x1eb052,_0x100e4f)=>{'translate'===_0x100e4f?this['fire']('getReviewCheckList'):this['fire']('leaveReview');}),_0x2d7873['view']['addTab']({'id':'translate','buttonLabel':as(this['context']['locale'],'AI_REVIEW_CHECK_TRANSLATE_TITLE'),'buttonIcon':_0x1b974b,'order':0x0,'content':this['_mainView']});}}class Uo extends _0x314798{static get['requires'](){return[Do,Mo,go];}static get['pluginName'](){return'AITranslate';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}export{qa as AIActions,Si as AIAdapter,qi as AIAssistant,Wi as AIAssistantUI,ma as AIBalloon,la as AIChat,Ys as AIChatController,ca as AIChatHistory,ha as AIChatHistoryController,ra as AIChatHistoryUI,Aa as AIChatShortcuts,Zr as AIChatUI,rs as AIConnector,qs as AIEditing,ba as AIEditorIntegration,Qa as AIQuickActions,Ma as AIQuickActionsUI,bi as AIRequestError,wo as AIReviewCheck,Io as AIReviewCheckResult,To as AIReviewCheckRun,vo as AIReviewMode,mo as AIReviewModeController,go as AIReviewModeEditing,_o as AIReviewModeUI,ns as AITabs,Xi as AITextAdapter,Ia as AIToggleButtonUI,Uo as AITranslate,Do as AITranslateController,Mo as AITranslateUI,ji as AWSTextAdapter,zi as OpenAITextAdapter,Oi as ShowAIAssistantCommand,ga as ToggleAICommand,ls as createResizeButton,Qi as getDefaultAICommands};