@ckeditor/ckeditor5-ai 48.0.0-alpha.7 → 48.0.0-alpha.8

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 _0x432272,Command as _0x13d0ac,ContextPlugin as _0x5d2433,Editor as _0x53a714}from'@ckeditor/ckeditor5-core/dist/index.js';import{IconCopy as _0x3a9886,IconCheck as _0x790d5c,IconError as _0x53a56f,IconSubmit as _0x5ac320,IconAIHistory as _0x52ae8e,IconMagicWand as _0x4f897d,IconRobotPencil as _0x58fae1,IconMaximize as _0x56c346,IconMinimize as _0x3c1bcb,IconShowChangesOn as _0x44006e,IconShowChangesOff as _0x5089e3,IconDocument as _0x26cdeb,IconBoxWithCross as _0x24b8c1,IconBoxWithCheck as _0x1893c2,IconBoxWithMarker as _0x39936f,IconInfo as _0x32ed68,IconWeb as _0x189481,IconCancel as _0xbe3949,IconSelection as _0xfafe06,IconFileUpload as _0x3a9ee9,IconLink as _0x2f0db7,IconBulb as _0x9432d4,IconAI as _0x2e61b1,IconPreviousArrow as _0x1b2d41,IconDocumentOutline as _0x3e2b4f,IconLoupe as _0x274dff,IconPaperClip as _0x444508,IconBrowseFiles as _0x33ff2b,IconDropdownArrow as _0x3a3268,IconStop as _0x1455a5,IconAIChat as _0x7de98b,IconPlus as _0x49763d,IconPin as _0x4fc5d8,IconThreeHorizontalDots as _0x3d6dbb,IconAIReview as _0x34b9c0,IconAITranslate as _0x29e343,IconAIAskAI as _0x2adf0d,IconThumbUp as _0x148817,IconThumbDown as _0x4a7763,IconChevronDown as _0x204f4c,IconChevronUp as _0x39bc87,IconAIQuickActions as _0x3210e9,IconAIChatCommands as _0xf58806,IconAIImproveWriting as _0x1eda05,IconAIContinueWriting as _0x110c1c,IconAIGrammarCheck as _0xdd640b,IconAIAdjustLength as _0x3a9dde,IconAIChangeTone as _0x4389c6,IconAIOther as _0x41e602,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,toArray as It,EmitterMixin as Et,logWarning as pt,logError as Tt,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 _0x27cd18,HighlightedTextView as _0x472014,ViewCollection as _0x25ec1a,FileDialogButtonView as _0x107960,InputTextView as _0x5bcb59,SearchTextView as _0x1a8288,ListItemButtonView as _0x4ba054,ButtonLabelWithHighlightView as _0x5973a1,DropdownMenuPanelPositioningFunctions as _0x11dd22,BalloonToolbar as _0x487bca,FormRowView as _0x52413c,TextareaView as _0x1c74d1}from'@ckeditor/ckeditor5-ui/dist/index.js';import{ClipboardPipeline as _0x6bec55,ClipboardMarkersUtils as _0x2f4545}from'@ckeditor/ckeditor5-clipboard/dist/index.js';import{ViewDocumentDomEventData as _0xac4489,ViewDataTransfer as _0xe611ac,ViewUpcastWriter as _0x29084b,Matcher as _0x226567,_DetachOperation as _0x338816,_insertIntoModelNodeList as _0x4a2f4a,_removeFromModelNodeList as _0x31bf2a,ModelRange as _0x42ff50,transformOperationSets as _0x580dcc,ViewDowncastWriter as _0x44b0c2,ModelDocumentFragment as _0xdf7d9d,ModelPosition as _0x493592,ModelTreeWalker as _0x2d0568,MarkerOperation as _0x2a2cd9,InsertOperation as _0x572aac}from'@ckeditor/ckeditor5-engine/dist/index.js';import{unescape as _0x242824,escape as _0x40b9c9,cloneDeep as _0xe10b43,escapeRegExp as _0x1565e1,debounce as _0x183bfa}from'es-toolkit/compat';import{BedrockRuntimeClient as _0x3eb2d3,InvokeModelWithResponseStreamCommand as _0x4dd108,InvokeModelCommand as _0x32d894}from'@aws-sdk/client-bedrock-runtime';import{createParser as _0x2ed944}from'eventsource-parser';import{CloudServices as _0x4a1833}from'@ckeditor/ckeditor5-cloud-services/dist/index.js';import{parseDocument as _0x23ddd4}from'htmlparser2';import{isTag as _0x5c66ff,findOne as _0x5133a0,getParent as _0x271f3a,findAll as _0x1a6a3d,removeElement as _0xb6b4fd,replaceElement as _0x563d0d,prepend as _0x59bf1a,prependChild as _0x289acd,appendChild as _0xebd7a6,append as _0x1c657a,find as _0x2c84c3,isComment as _0x4ed53a,getChildren as _0x29ecc2,textContent as ti}from'domutils';import _0x173a3d from'dom-serializer';import{Document as _0x10a8a7,Element as _0x170b36,Text as _0x5cf540,cloneNode as _0x1be4b7,isDocument as _0x2aabdb,isText as _0x4cfcea,NodeWithChildren as _0x165f76}from'domhandler';import{MarkdownGfmMdToHtmlDefaultPlugins as _0x13e112,MarkdownGfmMdToHtml as _0x5ac1fc}from'@ckeditor/ckeditor5-markdown-gfm/dist/index.js';import _0x277de2 from'rehype-sanitize';import{fixElementSuggestionRange as _0x151a98,DocumentCompare as _0x39f273,DATA_ID_MODEL_ATTRIBUTE as _0x4aa46b,ConfirmMixin as _0x38a348,getAllMarkersDomElementsSorted as _0x5661ac,SuggestionsConversion as _0x4a2830,DATA_ID_VIEW_ATTRIBUTE as _0xb7ba,getMarkerDomElement as _0x441680}from'@ckeditor/ckeditor5-collaboration-core/dist/index.js';import _0x5569bd from'morphdom';import{diffArrays as _0xac7233}from'diff';const wi='_ungrouppedCommands';function fi(_0x1ed1b3,_0x4a590c){const _0x1d0af4=(0x0,_0x4a590c['t'])('Other');return _0x1ed1b3['length']?'groupId'in _0x1ed1b3[0x0]?_0x1ed1b3:[{'groupId':wi,'groupLabel':_0x1d0af4,'order':0x1/0x0,'commands':_0x1ed1b3}]:[{'groupId':wi,'groupLabel':_0x1d0af4,'order':0x1/0x0,'commands':[]}];}const Si=globalThis['DataTransfer'],bi='ai-ui';class Ri extends _0x432272{static get['pluginName'](){return'AIAssistantEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const {editor:_0x5ad64c}=this,_0x1f0b00=['ck-fake-ai-selection'];_0x5ad64c['config']['get']('ai.assistant.useTheme')&&_0x1f0b00['push']('ck-ai-assistant-ui_theme'),_0x5ad64c['conversion']['for']('editingDowncast')['markerToHighlight']({'model':bi,'view':{'classes':_0x1f0b00,'priority':0xc}}),_0x5ad64c['conversion']['for']('editingDowncast')['markerToElement']({'model':bi,'view':(_0x49692a,{writer:_0x1d972f})=>{if(!_0x49692a['markerRange']['isCollapsed'])return null;const _0x354649=_0x1d972f['createUIElement']('span');return _0x1d972f['addClass'](['ck-fake-ai-selection','ck-fake-ai-selection_collapsed'],_0x354649),_0x354649;}});}['afterInit'](){!async function(_0x445df9){const _0x478ae4=_0x38b11c([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]),_0xda134e=0x3dffc4e1,_0x141939=0x3df84191^_0xda134e,_0x96c8dd=window[_0x38b11c([0x44,0x61,0x74,0x65])][_0x38b11c([0x6e,0x6f,0x77])](),_0x408c50=_0x445df9[_0x38b11c([0x65,0x64,0x69,0x74,0x6f,0x72])],_0x338266=new window[(_0x38b11c([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x58bc66=>{_0x408c50[_0x38b11c([0x6f,0x6e,0x63,0x65])](_0x38b11c([0x72,0x65,0x61,0x64,0x79]),_0x58bc66);}),_0x313256={[_0x38b11c([0x6b,0x74,0x79])]:_0x38b11c([0x45,0x43]),[_0x38b11c([0x75,0x73,0x65])]:_0x38b11c([0x73,0x69,0x67]),[_0x38b11c([0x63,0x72,0x76])]:_0x38b11c([0x50,0x2d,0x32,0x35,0x36]),[_0x38b11c([0x78])]:_0x38b11c([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]),[_0x38b11c([0x79])]:_0x38b11c([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]),[_0x38b11c([0x61,0x6c,0x67])]:_0x38b11c([0x45,0x53,0x32,0x35,0x36])},_0x4a25cd=_0x408c50[_0x38b11c([0x63,0x6f,0x6e,0x66,0x69,0x67])][_0x38b11c([0x67,0x65,0x74])](_0x38b11c([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79]));async function _0x700ee1(){let _0x36dcc0,_0x2e1aa0=null,_0xe5e2d0=null;try{if(_0x4a25cd==_0x38b11c([0x47,0x50,0x4c]))return _0x38b11c([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]);if(_0x36dcc0=_0x451da5(),!_0x36dcc0)return _0x38b11c([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);return _0x36dcc0[_0x38b11c([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])]&&(_0xe5e2d0=_0x8dc62(_0x36dcc0[_0x38b11c([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])],_0x36dcc0[_0x38b11c([0x6a,0x74,0x69])])),await _0xf63ea6()?_0x439fde()?_0x7d084b()?_0x38b11c([0x45,0x78,0x70,0x69,0x72,0x65,0x64]):_0x4b2a6b()?(_0x36dcc0[_0x38b11c([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x38b11c([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e])&&(_0x2e1aa0=_0x2d2ffc(_0x38b11c([0x45,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e,0x4c,0x69,0x6d,0x69,0x74]))),await _0x53547a()):_0x38b11c([0x44,0x6f,0x6d,0x61,0x69,0x6e,0x4c,0x69,0x6d,0x69,0x74]):_0x38b11c([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]):_0x38b11c([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}catch{return _0x38b11c([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}function _0x7d084b(){const _0xff2432=[_0x38b11c([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e]),_0x38b11c([0x74,0x72,0x69,0x61,0x6c])][_0x38b11c([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x36dcc0[_0x38b11c([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])])?_0x96c8dd/0x3e8:0xe10*_0x141939;return _0x36dcc0[_0x38b11c([0x65,0x78,0x70])]<_0xff2432;}function _0x439fde(){const _0x194a9d=_0x36dcc0[_0x38b11c([0x66,0x65,0x61,0x74,0x75,0x72,0x65,0x73])];return!!_0x194a9d&&(!!_0x194a9d[_0x38b11c([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x38b11c([0x2a]))||!!_0x194a9d[_0x38b11c([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x38b11c([0x41,0x49])));}function _0x4b2a6b(){const _0x56fa3f=_0x36dcc0[_0x38b11c([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x64,0x48,0x6f,0x73,0x74,0x73])];if(!_0x56fa3f||0x0==_0x56fa3f[_0x38b11c([0x6c,0x65,0x6e,0x67,0x74,0x68])])return!0x0;const {hostname:_0x214be6}=new URL(window[_0x38b11c([0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e])]['href']);if(_0x56fa3f[_0x38b11c([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x214be6))return!0x0;const _0x44f29c=_0x214be6[_0x38b11c([0x73,0x70,0x6c,0x69,0x74])](_0x38b11c([0x2e]));return _0x56fa3f[_0x38b11c([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x29852d=>_0x29852d[_0x38b11c([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x38b11c([0x2a])))[_0x38b11c([0x6d,0x61,0x70])](_0x1aa6e4=>_0x1aa6e4[_0x38b11c([0x73,0x70,0x6c,0x69,0x74])](_0x38b11c([0x2e])))[_0x38b11c([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x1743dc=>_0x1743dc[_0x38b11c([0x6c,0x65,0x6e,0x67,0x74,0x68])]<=_0x44f29c[_0x38b11c([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0x38b11c([0x6d,0x61,0x70])](_0x231f1e=>Array(_0x44f29c[_0x38b11c([0x6c,0x65,0x6e,0x67,0x74,0x68])]-_0x231f1e[_0x38b11c([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0x38b11c([0x66,0x69,0x6c,0x6c])](_0x231f1e[0x0]===_0x38b11c([0x2a])?_0x38b11c([0x2a]):'')[_0x38b11c([0x63,0x6f,0x6e,0x63,0x61,0x74])](_0x231f1e))[_0x38b11c([0x73,0x6f,0x6d,0x65])](_0xe66918=>_0x44f29c[_0x38b11c([0x65,0x76,0x65,0x72,0x79])]((_0x57d5a8,_0x3f99a2)=>_0xe66918[_0x3f99a2]===_0x57d5a8||_0xe66918[_0x3f99a2]===_0x38b11c([0x2a])));}function _0x53547a(){return _0x2e1aa0&&_0xe5e2d0?new window[(_0x38b11c([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x581249,_0x274776)=>{_0x2e1aa0[_0x38b11c([0x74,0x68,0x65,0x6e])](_0x581249,_0x274776),_0xe5e2d0[_0x38b11c([0x74,0x68,0x65,0x6e])](_0x5e51e2=>{_0x5e51e2!=_0x38b11c([0x56,0x61,0x6c,0x69,0x64])&&_0x581249(_0x5e51e2);},_0x274776);}):_0x2e1aa0||_0xe5e2d0||_0x38b11c([0x56,0x61,0x6c,0x69,0x64]);}}function _0x8dc62(_0x120ce8,_0x480be3){return new window[(_0x38b11c([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x45512e=>{if(_0x513ccf())return _0x45512e(_0x38b11c([0x56,0x61,0x6c,0x69,0x64]));_0x1b1f63(),_0x408c50[_0x38b11c([0x64,0x65,0x63,0x6f,0x72,0x61,0x74,0x65])](_0x38b11c([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]));let _0x58ffb2=!0x1;const _0x4c5dbf=at();function _0x47b450(_0x5dc475){return!!_0x5dc475&&(typeof _0x5dc475===_0x38b11c([0x6f,0x62,0x6a,0x65,0x63,0x74])||typeof _0x5dc475===_0x38b11c([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]))&&typeof _0x5dc475[_0x38b11c([0x74,0x68,0x65,0x6e])]===_0x38b11c([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e])&&typeof _0x5dc475[_0x38b11c([0x63,0x61,0x74,0x63,0x68])]===_0x38b11c([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]);}function _0x44cb53(_0x27ae7c){_0x120998(_0x27ae7c)[_0x38b11c([0x74,0x68,0x65,0x6e])](_0x13d2c2=>{if(!_0x13d2c2||_0x13d2c2[_0x38b11c([0x73,0x74,0x61,0x74,0x75,0x73])]!=_0x38b11c([0x6f,0x6b]))return _0x38b11c([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]);return _0x5c7bb9(_0x2689b2(_0x4c5dbf+_0x480be3))!=_0x13d2c2[_0x38b11c([0x76,0x65,0x72,0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6f,0x6e])]?_0x38b11c([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]):_0x38b11c([0x56,0x61,0x6c,0x69,0x64]);})[_0x38b11c([0x74,0x68,0x65,0x6e])](_0xf4343e=>(_0x3cc474(),_0xf4343e),()=>{const _0x129764=_0x565148();return null==_0x129764?(_0x3cc474(),_0x38b11c([0x56,0x61,0x6c,0x69,0x64])):_0x38b11c(_0x96c8dd-_0x129764>(0x19f340e1^_0xda134e)?[0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]:[0x56,0x61,0x6c,0x69,0x64]);})[_0x38b11c([0x74,0x68,0x65,0x6e])](_0x45512e)[_0x38b11c([0x63,0x61,0x74,0x63,0x68])](()=>{_0x45512e(_0x38b11c([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});const _0x4f219b=0x3dc92a61^_0xda134e;function _0x3cc474(){const _0x6bcbe3=_0x38b11c([0x6c,0x6c,0x63,0x74,0x2d])+_0x5c7bb9(_0x2689b2(_0x120ce8)),_0x5e61cf=_0x545eb5(_0x5c7bb9(window[_0x38b11c([0x4d,0x61,0x74,0x68])][_0x38b11c([0x63,0x65,0x69,0x6c])](_0x96c8dd/_0x4f219b)));window[_0x38b11c([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x38b11c([0x73,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x6bcbe3,_0x5e61cf);}function _0x565148(){const _0x9ea2f0=_0x38b11c([0x6c,0x6c,0x63,0x74,0x2d])+_0x5c7bb9(_0x2689b2(_0x120ce8)),_0x8ed3b1=window[_0x38b11c([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x38b11c([0x67,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x9ea2f0);return _0x8ed3b1?window[_0x38b11c([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x545eb5(_0x8ed3b1),0x10)*_0x4f219b:null;}function _0x120998(_0x30925a){return new window[(_0x38b11c([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x33dc3f,_0x30c714)=>{_0x30925a[_0x38b11c([0x74,0x68,0x65,0x6e])](_0x33dc3f,_0x30c714),window[_0x38b11c([0x73,0x65,0x74,0x54,0x69,0x6d,0x65,0x6f,0x75,0x74])](_0x30c714,0x3dfe1021^_0xda134e);});}}_0x408c50[_0x38b11c([0x6f,0x6e])](_0x38b11c([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),(_0x1d0e0e,_0x56764d)=>{if(_0x56764d[0x0]!=_0x120ce8)return _0x45512e(_0x38b11c([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));_0x56764d[0x1]={..._0x56764d[0x1],[_0x38b11c([0x72,0x65,0x71,0x75,0x65,0x73,0x74,0x49,0x64])]:_0x4c5dbf};},{[_0x38b11c([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x38b11c([0x68,0x69,0x67,0x68])}),_0x408c50[_0x38b11c([0x6f,0x6e])](_0x38b11c([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),_0x290c26=>{_0x47b450(_0x290c26[_0x38b11c([0x72,0x65,0x74,0x75,0x72,0x6e])])&&(_0x58ffb2=!0x0,_0x44cb53(_0x290c26[_0x38b11c([0x72,0x65,0x74,0x75,0x72,0x6e])]));},{[_0x38b11c([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x38b11c([0x6c,0x6f,0x77])}),_0x338266[_0x38b11c([0x74,0x68,0x65,0x6e])](()=>{_0x58ffb2||_0x45512e(_0x38b11c([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});});function _0x513ccf(){return _0x408c50[_0x38b11c([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x38b11c([0x76,0x69,0x65,0x77])][_0x38b11c([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]==_0x38b11c([0x61,0x75,0x74,0x6f]);}function _0x1b1f63(){_0x408c50[_0x38b11c([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x38b11c([0x76,0x69,0x65,0x77])][_0x38b11c([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]=_0x38b11c([0x61,0x75,0x74,0x6f]);}}function _0x2d2ffc(_0x26a386){const _0x313388=[new window[(_0x38b11c([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x5b8623=>setTimeout(_0x5b8623,0x3df6fa2d^_0xda134e)),_0x338266[_0x38b11c([0x74,0x68,0x65,0x6e])](()=>new window[(_0x38b11c([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x4d5cc5=>{let _0xd4fd9a=0x0;_0x408c50[_0x38b11c([0x6d,0x6f,0x64,0x65,0x6c])][_0x38b11c([0x6f,0x6e])](_0x38b11c([0x61,0x70,0x70,0x6c,0x79,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e]),(_0x1e86ed,_0x55d406)=>{_0x55d406[0x0][_0x38b11c([0x69,0x73,0x44,0x6f,0x63,0x75,0x6d,0x65,0x6e,0x74,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e])]&&_0xd4fd9a++,_0xd4fd9a==(0x3dffc109^_0xda134e)&&(_0x4d5cc5(),_0x1e86ed[_0x38b11c([0x6f,0x66,0x66])]());});}))];return window[_0x38b11c([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65])][_0x38b11c([0x72,0x61,0x63,0x65])](_0x313388)[_0x38b11c([0x74,0x68,0x65,0x6e])](()=>_0x26a386);}async function _0x3e31af(){await _0x338266,_0x408c50[_0x38b11c([0x6d,0x6f,0x64,0x65,0x6c])][_0x38b11c([0x63,0x68,0x61,0x6e,0x67,0x65])]=_0x205db0,_0x408c50[_0x38b11c([0x6d,0x6f,0x64,0x65,0x6c])][_0x38b11c([0x65,0x6e,0x71,0x75,0x65,0x75,0x65,0x43,0x68,0x61,0x6e,0x67,0x65])]=_0x205db0,_0x408c50[_0x38b11c([0x65,0x6e,0x61,0x62,0x6c,0x65,0x52,0x65,0x61,0x64,0x4f,0x6e,0x6c,0x79,0x4d,0x6f,0x64,0x65])](_0x38b11c([0x6d,0x6f,0x64,0x65,0x6c]));}function _0x33a58b(_0xc64f10){const _0x18bf25=_0x3c30b1();_0x408c50[_0x18bf25]=_0x38b11c([0x61,0x69,0x4c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79])+_0xc64f10,_0xc64f10!=_0x38b11c([0x56,0x61,0x6c,0x69,0x64])&&_0x3e31af();}function _0x3c30b1(){const _0x1a6f64=window[_0x38b11c([0x53,0x74,0x72,0x69,0x6e,0x67])](window[_0x38b11c([0x70,0x65,0x72,0x66,0x6f,0x72,0x6d,0x61,0x6e,0x63,0x65])][_0x38b11c([0x6e,0x6f,0x77])]())[_0x38b11c([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](_0x38b11c([0x2e]),'');let _0x3106e4=_0x38b11c([0x6e]);for(let _0x430b9f=0x0;_0x430b9f<_0x1a6f64[_0x38b11c([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x430b9f+=0x2){let _0x5437ee=window[_0x38b11c([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x1a6f64[_0x38b11c([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x430b9f,_0x430b9f+0x2));_0x5437ee>=_0x478ae4[_0x38b11c([0x6c,0x65,0x6e,0x67,0x74,0x68])]&&(_0x5437ee-=_0x478ae4[_0x38b11c([0x6c,0x65,0x6e,0x67,0x74,0x68])]),_0x3106e4+=_0x478ae4[_0x5437ee];}return _0x3106e4;}function _0x451da5(){const _0x316407=_0x4a25cd[_0x38b11c([0x73,0x70,0x6c,0x69,0x74])](_0x38b11c([0x2e]));if(0x3!=_0x316407[_0x38b11c([0x6c,0x65,0x6e,0x67,0x74,0x68])])return null;return _0x3a2ebb(_0x316407[0x1]);function _0x3a2ebb(_0x53b5b2){const _0x2371a0=_0x21bf82(_0x53b5b2);return _0x2371a0&&_0x398c60()?_0x2371a0:null;function _0x398c60(){const _0x4ee650=_0x2371a0[_0x38b11c([0x6a,0x74,0x69])],_0x10d767=window[_0x38b11c([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x4ee650[_0x38b11c([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x4ee650[_0x38b11c([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8),0x10),_0x55fd4e={..._0x2371a0,[_0x38b11c([0x6a,0x74,0x69])]:_0x4ee650[_0x38b11c([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](0x0,_0x4ee650[_0x38b11c([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8)};return delete _0x55fd4e[_0x38b11c([0x76,0x63])],_0x2689b2(_0x55fd4e)==_0x10d767;}}}async function _0xf63ea6(){let _0x411070=!0x0;try{const _0x20cfee=_0x4a25cd[_0x38b11c([0x73,0x70,0x6c,0x69,0x74])](_0x38b11c([0x2e])),[_0x572296,_0x48612e,_0x263ecc]=_0x20cfee;return _0x4b3a46(_0x572296),await _0x1e6d14(_0x572296,_0x48612e,_0x263ecc),_0x411070;}catch{return!0x1;}function _0x4b3a46(_0x4e1a18){const _0x117f2f=_0x21bf82(_0x4e1a18);_0x117f2f&&_0x117f2f[_0x38b11c([0x61,0x6c,0x67])]==_0x38b11c([0x45,0x53,0x32,0x35,0x36])||(_0x411070=!0x1);}async function _0x1e6d14(_0x5d5117,_0x85887c,_0x3992f4){const _0x2dea3b=window[_0x38b11c([0x55,0x69,0x6e,0x74,0x38,0x41,0x72,0x72,0x61,0x79])][_0x38b11c([0x66,0x72,0x6f,0x6d])](_0x2f58b5(_0x3992f4),_0x392f9d=>_0x392f9d[_0x38b11c([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](0x0)),_0x3e344a=new window[(_0x38b11c([0x54,0x65,0x78,0x74,0x45,0x6e,0x63,0x6f,0x64,0x65,0x72]))]()[_0x38b11c([0x65,0x6e,0x63,0x6f,0x64,0x65])](_0x5d5117+_0x38b11c([0x2e])+_0x85887c),_0x45497a=window[_0x38b11c([0x63,0x72,0x79,0x70,0x74,0x6f])][_0x38b11c([0x73,0x75,0x62,0x74,0x6c,0x65])];if(!_0x45497a)return;const _0x44288f=await _0x45497a[_0x38b11c([0x69,0x6d,0x70,0x6f,0x72,0x74,0x4b,0x65,0x79])](_0x38b11c([0x6a,0x77,0x6b]),_0x313256,{[_0x38b11c([0x6e,0x61,0x6d,0x65])]:_0x38b11c([0x45,0x43,0x44,0x53,0x41]),[_0x38b11c([0x6e,0x61,0x6d,0x65,0x64,0x43,0x75,0x72,0x76,0x65])]:_0x38b11c([0x50,0x2d,0x32,0x35,0x36])},!0x1,[_0x38b11c([0x76,0x65,0x72,0x69,0x66,0x79])]);await _0x45497a[_0x38b11c([0x76,0x65,0x72,0x69,0x66,0x79])]({[_0x38b11c([0x6e,0x61,0x6d,0x65])]:_0x38b11c([0x45,0x43,0x44,0x53,0x41]),[_0x38b11c([0x68,0x61,0x73,0x68])]:{[_0x38b11c([0x6e,0x61,0x6d,0x65])]:_0x38b11c([0x53,0x48,0x41,0x2d,0x32,0x35,0x36])}},_0x44288f,_0x2dea3b,_0x3e344a)||(_0x411070=!0x1);}}function _0x21bf82(_0x2c5646){return _0x2c5646[_0x38b11c([0x73,0x74,0x61,0x72,0x74,0x73,0x57,0x69,0x74,0x68])](_0x38b11c([0x65,0x79]))?JSON[_0x38b11c([0x70,0x61,0x72,0x73,0x65])](_0x2f58b5(_0x2c5646)):null;}function _0x2f58b5(_0x36193e){return window[_0x38b11c([0x61,0x74,0x6f,0x62])](_0x36193e[_0x38b11c([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/-/g,_0x38b11c([0x2b]))[_0x38b11c([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/_/g,_0x38b11c([0x2f])));}function _0x2689b2(_0x5baf08){let _0x3db74d=0x1505;function _0x2c0b93(_0x37576d){for(let _0x20e85f=0x0;_0x20e85f<_0x37576d[_0x38b11c([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x20e85f++){const _0x5b43ed=_0x37576d[_0x38b11c([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](_0x20e85f);_0x3db74d=(_0x3db74d<<0x5)+_0x3db74d+_0x5b43ed,_0x3db74d&=_0x3db74d;}}function _0x420478(_0x5c53a4){Array[_0x38b11c([0x69,0x73,0x41,0x72,0x72,0x61,0x79])](_0x5c53a4)?_0x5c53a4[_0x38b11c([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](_0x420478):_0x5c53a4&&typeof _0x5c53a4==_0x38b11c([0x6f,0x62,0x6a,0x65,0x63,0x74])?Object[_0x38b11c([0x65,0x6e,0x74,0x72,0x69,0x65,0x73])](_0x5c53a4)[_0x38b11c([0x73,0x6f,0x72,0x74])]()[_0x38b11c([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](([_0x582c57,_0x2f3d50])=>{_0x2c0b93(_0x582c57),_0x420478(_0x2f3d50);}):_0x2c0b93(window[_0x38b11c([0x53,0x74,0x72,0x69,0x6e,0x67])](_0x5c53a4));}return _0x420478(_0x5baf08),_0x3db74d>>>0x0;}function _0x5c7bb9(_0x141f38){return _0x141f38[_0x38b11c([0x74,0x6f,0x53,0x74,0x72,0x69,0x6e,0x67])](0x10)[_0x38b11c([0x70,0x61,0x64,0x53,0x74,0x61,0x72,0x74])](0x8,_0x38b11c([0x30]));}function _0x545eb5(_0x4e28d5){return _0x4e28d5[_0x38b11c([0x73,0x70,0x6c,0x69,0x74])]('')[_0x38b11c([0x72,0x65,0x76,0x65,0x72,0x73,0x65])]()[_0x38b11c([0x6a,0x6f,0x69,0x6e])]('');}function _0x205db0(){}function _0x38b11c(_0xbba6e1){return _0xbba6e1['map'](_0x4d52a3=>String['fromCharCode'](_0x4d52a3))['join']('');}_0x33a58b(await _0x700ee1());}(this);}['showFakeVisualSelection'](){const _0x56a400=this['editor']['model'];_0x56a400['change'](_0x5d51be=>{const _0x1bafce=_0x56a400['document']['selection']['getRanges']();let _0x2ec75b=0x0;for(const _0x3fff50 of _0x1bafce){const _0x57a2ab=bi+':'+_0x2ec75b;if(_0x56a400['markers']['has'](_0x57a2ab))_0x5d51be['updateMarker'](_0x57a2ab,{'range':_0x3fff50});else{if(_0x3fff50['start']['isAtEnd']){const _0x578797=_0x3fff50['start']['getLastMatchingPosition'](({item:_0x2faae4})=>!_0x56a400['schema']['isContent'](_0x2faae4),{'boundaries':_0x3fff50});_0x5d51be['addMarker'](_0x57a2ab,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x5d51be['createRange'](_0x578797,_0x3fff50['end'])});}else _0x5d51be['addMarker'](_0x57a2ab,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x3fff50});}_0x2ec75b++;}});}['hideFakeVisualSelection'](){const _0x2a9a34=this['editor']['model'],_0x349f8c=Array['from'](this['editor']['model']['markers']['getMarkersGroup'](bi));_0x349f8c['length']&&_0x2a9a34['change'](_0x57507f=>{_0x349f8c['forEach'](_0x45683e=>{_0x57507f['removeMarker'](_0x45683e);});});}['insertContent'](_0x1648ed,_0x522194){const _0x1a7ac1=this['_getAISelection'](),_0x382f15=_0x522194||_0x1a7ac1['getFirstRange']();this['editor']['model']['canEditAt'](_0x382f15)&&this['editor']['model']['change'](_0x2e9e1d=>{this['hideFakeVisualSelection'](),_0x522194||this['_resetContentOfSelectedTableCells'](_0x2e9e1d,_0x1a7ac1),this['_pasteHTMLUsingClipboard']({'insertAt':_0x382f15,'writer':_0x2e9e1d,'html':_0x1648ed});});}['insertContentBelow'](_0x28b4b5){const {model:_0x431ab7}=this['editor'],_0x1a8d85=this['_getAISelection']();_0x431ab7['change'](()=>{const _0x5ec13e=this['_prepareTableInsertBelowPosition'](_0x28b4b5,_0x1a8d85)||this['_getDefaultInsertBelowPosition'](_0x1a8d85);this['insertContent'](_0x28b4b5,_0x5ec13e);});}['_getAISelection'](){const _0x5021dc=this['editor']['model'],_0x1b3ca7=Array['from'](_0x5021dc['markers']['getMarkersGroup'](bi))['map'](_0x5b35ea=>_0x5b35ea['getRange']());return _0x5021dc['createSelection'](_0x1b3ca7);}['_pasteHTMLUsingClipboard']({writer:_0x3155f1,html:_0x40f850,insertAt:_0x4c4f9a}){const {view:_0x1df00a}=this['editor']['editing'],_0x4dcbc9=this['editor']['plugins']['get'](_0x6bec55),_0x3af7ea=new Si();_0x3af7ea['setData']('text/html',_0x40f850);const _0x3c43e9=new ClipboardEvent('paste',{'clipboardData':_0x3af7ea}),_0x1f6e61=new _0xac4489(_0x1df00a,_0x3c43e9,{'dataTransfer':new _0xe611ac(_0x3af7ea)});_0x3155f1['setSelection'](_0x4c4f9a);const _0x5ef4b5=(_0x21d14f,_0x3b9ab1)=>{_0x3b9ab1['resultRange']&&_0x3155f1['setSelection'](_0x3b9ab1['resultRange']);};_0x4dcbc9['once']('contentInsertion',_0x5ef4b5,{'priority':'lowest'}),_0x1df00a['document']['fire']('paste',_0x1f6e61),_0x4dcbc9['off']('contentInsertion',_0x5ef4b5);}['_getDefaultInsertBelowPosition'](_0x15adf7){const {model:_0x455161}=this['editor'],_0x199885=Array['from'](_0x15adf7['getSelectedBlocks']());return _0x199885['length']?_0x455161['createPositionAfter'](_0x199885['pop']()):_0x15adf7['getLastPosition']();}['_prepareTableInsertBelowPosition'](_0x5e4fbc,_0x1151d7){const {model:_0x33a0f0,plugins:_0x5c5794}=this['editor'];if(_0x5c5794['has']('TableUtils')){const _0x35a34c=_0x5c5794['get']('TableUtils')['getSelectedTableCells'](_0x1151d7);if(_0x35a34c['length']){const _0x1f1f1b=this['_getTableRowCountFromContent'](_0x5e4fbc),_0x4f3737=this['_createEmptyTableRows'](_0x35a34c,_0x1f1f1b);return _0x33a0f0['createPositionAt'](_0x4f3737,0x0);}}return null;}['_getTableRowCountFromContent'](_0x27bd83){const _0x1c4683=this['editor']['plugins']['get']('TableUtils'),_0x2812c8=this['editor']['data']['parse'](_0x27bd83),_0x5113ac=Array['from'](_0x2812c8['getChildren']())['filter'](_0x394912=>_0x394912['is']('element','table'));let _0x299372=0x0;return _0x5113ac['forEach'](_0xce1752=>{_0x299372+=_0x1c4683['getRows'](_0xce1752);}),_0x299372;}['_createEmptyTableRows'](_0x31f37b,_0x28faa7){const _0x98608b=this['editor']['plugins']['get']('TableUtils'),_0x242bbc=_0x98608b['getRowIndexes'](_0x31f37b),_0x2af65b=_0x98608b['getColumnIndexes'](_0x31f37b),_0x48246a=_0x242bbc['last']+0x1,_0x4a75db=_0x2af65b['first'],_0x1b6e03=_0x31f37b[0x0]['findAncestor']('table');for(let _0x47f13c=0x0;_0x47f13c<_0x28faa7;_0x47f13c++)_0x98608b['insertRows'](_0x1b6e03,{'at':_0x48246a});return _0x1b6e03['getChild'](_0x48246a)['getChild'](_0x4a75db);}['_resetContentOfSelectedTableCells'](_0x1866eb,_0x5e6fc5){const {plugins:_0x4191e2}=this['editor'],{model:_0x2a02f5}=_0x1866eb;if(!_0x4191e2['has']('TableUtils'))return;_0x4191e2['get']('TableUtils')['getSelectedTableCells'](_0x5e6fc5)['length']&&_0x2a02f5['deleteContent'](_0x5e6fc5);}}class Oi extends _0x432272{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 ki extends Error{constructor(_0xb34375){super(_0xb34375),this['name']='AIRequestError';}}function Ni(_0x335938,_0x5c440a,_0x1fbcbe){const t=_0x335938['t'];switch(_0x5c440a){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',_0x1fbcbe);case'Error\x20during\x20AI\x20content\x20generation:\x20%0':return t('Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x1fbcbe);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'},_0x1fbcbe);case'AI_ERROR_CONTEXT_LENGTH':return t({'id':'AI_ERROR_CONTEXT_LENGTH','string':'Selected\x20content\x20is\x20too\x20long'});case'AI_ERROR_MODERATION':return t({'id':'AI_ERROR_MODERATION','string':'Requested\x20query\x20does\x20not\x20pass\x20moderation\x20rules'});case'AI_ERROR_FAILED':return t({'id':'AI_ERROR_FAILED','string':'Failed\x20to\x20communicate\x20with\x20the\x20AI\x20service'});default:return _0x5c440a;}}class vi extends _0x13d0ac{['_commandDefinitions'];constructor(_0x104f0f,_0x33c26c){super(_0x104f0f),this['_commandDefinitions']=_0x33c26c,this['set']('enabledCommandsIds',[]),this['on']('change:_hasContext',(_0x1b7689,_0x330d4e,_0x746950)=>{this['isEnabled']&&(this['enabledCommandsIds']=yi(this['_commandDefinitions'],_0x746950));}),this['set']('_hasContext',!0x1),this['on']('change:isEnabled',(_0x1a016c,_0xfa9a0c,_0x11c38a)=>{this['enabledCommandsIds']=_0x11c38a?yi(this['_commandDefinitions'],this['_hasContext']):[];});}['refresh'](){const _0x3e8fac=this['editor']['model'];this['_hasContext']=function(_0x224186){const _0xf8170c=_0x224186['document']['selection'];return _0xf8170c['isCollapsed']?0x0!==[..._0xf8170c['getSelectedBlocks']()]['length']&&![..._0xf8170c['getSelectedBlocks']()][0x0]['isEmpty']:!!_0x224186['hasContent'](_0xf8170c['getFirstRange']());}(_0x3e8fac);const _0x4c0135=_0x3e8fac['document']['selection'],_0x1642a2=this['editor']['config']['get']('ai.assistant.disabledElements');for(const _0x13b68d of _0x4c0135['getRanges']())for(const _0x139b56 of _0x13b68d['getItems']())if(_0x139b56['is']('element')&&_0x1642a2['includes'](_0x139b56['name']))return void(this['isEnabled']=!0x1);this['isEnabled']=!0x0;}['execute'](_0x1961d0='',_0x305548='',_0x581ed7='custom'){this['editor']['plugins']['get'](qi)['showUI'](_0x1961d0,_0x305548,_0x581ed7);}}function yi(_0x337eff,_0x1bed71){const _0x516664=new Set();for(const _0x1f5bae of _0x337eff['values']())(_0x1bed71||!0x1===_0x1f5bae['requiresContent'])&&_0x516664['add'](_0x1f5bae['id']);return Array['from'](_0x516664);}const xi=new RegExp(/^(.*?)<[a-zA-Z][a-zA-Z0-9_\-.]*[ >]/,'is');class Li extends/* #__PURE__ -- @preserve */
24
- ht(){['editor'];['textAdapter'];['view'];['_sanitizationContainer'];['_domParser'];['_xmlSerializer'];constructor(_0x146f1d,_0x475a00,_0x410786){super(),this['editor']=_0x146f1d,this['textAdapter']=_0x475a00,this['_sanitizationContainer']=document['createElement']('div'),this['_domParser']=new DOMParser(),this['_xmlSerializer']=new XMLSerializer(),this['view']=_0x410786,this['set']({'initialContext':'','currentContext':'','currentResponse':'','previousContext':void 0x0,'previousQuery':void 0x0,'previousLabel':void 0x0,'isProcessing':!0x1}),this['on']('set:currentContext',(_0x53e065,_0x386547,_0x4944b2)=>{this['view']['value']=this['_sanitizeHTML'](_0x4944b2);}),this['listenTo'](this['view'],'submitPrompt',(_0x25d16d,_0x24bd55)=>{const _0x23ad95=this['currentContext']||this['initialContext'];this['_handleQuery'](_0x24bd55,_0x23ad95,'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:_0x4b6409,query:_0x278d6e,htmlContent:_0x691b1,label:_0x4eb3e1,mainActionLabel:_0x9c9341}){this['view']['prompt']=_0x4eb3e1,this['view']['mainAction']=_0x9c9341,this['initialContext']=_0x691b1,_0x278d6e&&(this['view']['isRendered']?this['_handleQuery'](_0x278d6e,_0x691b1,_0x4b6409,_0x4eb3e1):this['view']['once']('render',()=>{this['_handleQuery'](_0x278d6e,_0x691b1,_0x4b6409,_0x4eb3e1);}));}['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'](_0x201aac,_0x4a057f,_0x553715,_0x2341c0){return this['isProcessing']=!0x0,this['view']['startProcessing'](),this['previousContext']=_0x4a057f,this['previousQuery']=_0x201aac,this['previousLabel']=_0x2341c0||_0x201aac,this['previousActionId']=_0x553715,new Promise(_0x5dd6ec=>{this['textAdapter']['makeRequest']({'query':_0x201aac,'context':_0x4a057f,'onData':_0xff6ac1=>{this['currentResponse']=_0xff6ac1,this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse']);},'actionId':_0x553715})['then'](()=>{!this['currentContext']&&this['currentResponse']&&(this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse'],!0x0));})['catch'](_0x5a8754=>{_0x5a8754 instanceof ki?this['view']['handleError'](_0x5a8754['message']):this['view']['handleError'](),_0x5dd6ec();})['finally'](()=>{this['stopProcessing'](),_0x5dd6ec();});});}['_parseAndNormalizeContent'](_0xc1b478,_0x42bafa=!0x1){const _0x489050=xi['exec'](_0xc1b478);_0xc1b478=_0x489050?_0xc1b478['substring'](_0x489050[0x1]['length']):_0xc1b478['length']<0x64&&!_0x42bafa?'':this['_stripMarkdownSyntax'](_0xc1b478);const _0x4802ad=this['_domParser']['parseFromString'](_0xc1b478,'text/html');if(_0x489050){const _0x1a8dc4=Array['from'](_0x4802ad['body']['childNodes']);_0x1a8dc4['reverse']();for(const _0x1d47e3 of _0x1a8dc4){if(_0x1d47e3['nodeType']==Node['ELEMENT_NODE'])break;_0x1d47e3['remove']();}}const _0x102630=this['editor']['data']['processor']['toView'](this['_xmlSerializer']['serializeToString'](_0x4802ad['body']));this['_isH1TagSupportEnabled']()||this['_normalizeResponseHeadings'](_0x102630);const _0x4979a3=this['editor']['config']['get']('ai.assistant.preserveComments'),_0x5a5953=this['editor']['data']['toModel'](_0x102630);return _0x4979a3||_0x5a5953['markers']['clear'](),this['editor']['data']['stringify'](_0x5a5953);}['_normalizeResponseHeadings'](_0x521b12){const _0xfebe75=new _0x29084b(this['editor']['editing']['view']['document']),_0x2a7392=new _0x226567({'name':/^h[1-5]$/}),_0x228db0=[];let _0x228a0b=!0x1;for(const _0x3d77b9 of _0x521b12)_0x3d77b9['is']('element')&&_0x2a7392['match'](_0x3d77b9)&&(_0x228db0['push'](_0x3d77b9),'h1'==_0x3d77b9['name']&&(_0x228a0b=!0x0));if(_0x228a0b){for(const _0x3940a9 of _0x228db0)_0xfebe75['rename']('h'+(parseInt(_0x3940a9['name'][0x1])+0x1),_0x3940a9);}}['_isH1TagSupportEnabled'](){const {data:_0x12fca6,editing:_0x3696f5}=this['editor'],_0x53c975=_0x12fca6['htmlProcessor']['toView']('<h1></h1>'),_0x1d2f13=_0x12fca6['toView'](_0x12fca6['toModel'](_0x53c975));return!!_0x3696f5['view']['domConverter']['viewToDom'](_0x1d2f13)['querySelector']('h1');}['_sanitizeHTML'](_0x10bff0){return this['editor']['editing']['view']['domConverter']['setContentOf'](this['_sanitizationContainer'],_0x10bff0),this['_sanitizationContainer']['innerHTML'];}['_stripMarkdownSyntax'](_0x58d64b){const _0x5576a0=_0x58d64b['trim']();return _0x5576a0['startsWith']('```html')?_0x5576a0['endsWith']('```')?_0x5576a0['substring'](0x7,_0x5576a0['length']-0x3):_0x5576a0['substring'](0x7):_0x58d64b;}}const Di={'REPLACE':'replace','INSERT':'insert'};class Pi extends Ot{constructor(_0x14e251){super(_0x14e251),this['set']('isVisible',!0x1),this['set']('mainAction',Di['REPLACE']),this['replaceButton']=this['_createButton']('','ck-button-action'),this['replaceButton']['bind']('label')['to'](this,'mainAction',_0x3d5192=>Ni(_0x14e251,'AI_'+_0x3d5192['toUpperCase']()+'_CONTENT')),this['insertButton']=this['_createButton'](Ni(_0x14e251,'Insert\x20below')),this['tryAgainButton']=this['_createButton'](Ni(_0x14e251,'Try\x20again')),this['stopButton']=this['_createButton'](Ni(_0x14e251,'Stop'));const _0x10465a=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-form__toolbar',_0x10465a['if']('isVisible','ck-hidden',_0x349186=>!_0x349186)]}}),this['items']['addMany']([this['replaceButton'],this['insertButton'],this['tryAgainButton'],this['stopButton']]);}['_createButton'](_0xbe9380,_0x19c3a5){const _0x55e511=new kt(this['locale']);return _0x55e511['set']({'label':_0xbe9380,'class':_0x19c3a5||'','isVisible':!0x0,'withText':!0x0}),_0x55e511;}}class Hi extends Nt{['contentFieldView'];['copyButtonView'];constructor(_0x2512f7,_0x468160=''){super(_0x2512f7),this['set']({'value':null,'isVisible':!0x1,'isProcessing':!0x1});const _0x2a0301=this['bindTemplate'];this['contentFieldView']=new Mi(_0x2512f7,_0x468160),this['copyButtonView']=this['_createCopyButton'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area-wrapper',_0x2a0301['if']('isVisible','ck-hidden',_0x1e3dc6=>!_0x1e3dc6)],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area',_0x2a0301['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 _0x82ac75=!0x1;this['on']('change:value',(_0x586a64,_0xf315fe,_0x13e401)=>{const _0x2d1bd6=!this['contentFieldView']['element']['querySelector']('.ck-ai-form__loader');this['contentFieldView']['setContent'](_0x13e401),this['isProcessing']&&_0x2d1bd6&&!_0x82ac75&&this['element']['scrollTo']({'top':this['element']['scrollHeight'],'behavior':'smooth'});}),this['on']('change:isProcessing',(_0x260224,_0x5cf7bc,_0x24b43c)=>{_0x82ac75=!0x1,_0x24b43c?(this['value']=null,this['contentFieldView']['appendLoader']()):this['value']||this['contentFieldView']['setContent']('');}),this['listenTo'](this['element'],'wheel',()=>{_0x82ac75=!0x0;}),this['listenTo'](this['element'],'mousedown',()=>{_0x82ac75=!0x0;});}['focus'](){this['element']['focus']();}['_createCopyButton'](){const _0x2fdf0e=this['locale'],_0x1a17dc=new kt(this['locale']),_0x1913c0='ck-ai-form__copy-button';return _0x1a17dc['set']({'label':Ni(_0x2fdf0e,'Copy'),'icon':_0x3a9886,'class':_0x1913c0,'tooltip':!0x0}),_0x1a17dc['bind']('isVisible')['to'](this,'value',_0x4b48c0=>!!_0x4b48c0),_0x1a17dc['bind']('isEnabled')['to'](this,'isProcessing',_0x2b1631=>!_0x2b1631),_0x1a17dc['on']('execute',()=>{this['_copyHTMLToClipboard'](this['contentFieldView']['element']),_0x1a17dc['icon']=_0x790d5c,_0x1a17dc['class']=_0x1913c0+'\x20ck-ai-form__copy-button--copied',this['focus'](),setTimeout(()=>{_0x1a17dc['icon']=_0x3a9886,_0x1a17dc['class']=_0x1913c0;},0x3e8);}),_0x1a17dc;}['_copyHTMLToClipboard'](_0x597707){const {window:_0x2580fc,document:_0x3f46f8}=ct;if(_0x2580fc['ClipboardItem']){const {Blob:_0x425779,ClipboardItem:_0x507267}=_0x2580fc,_0x3b4f0b=[new _0x507267({'text/html':new _0x425779([_0x597707['innerHTML']],{'type':'text/html'}),'text/plain':new _0x425779([_0x597707['textContent']||''],{'type':'text/plain'})})];navigator['clipboard']['write'](_0x3b4f0b);}else{const _0x4185dd=_0x3f46f8['createElement']('div');_0x4185dd['style']['position']='absolute',_0x4185dd['style']['left']='-9999px',_0x4185dd['innerHTML']='<span>[</span>'+_0x597707['innerHTML']+'<span>]</span>',_0x3f46f8['body']['appendChild'](_0x4185dd);const _0x5cc195=_0x3f46f8['createRange']();_0x5cc195['setStartAfter'](_0x4185dd['firstElementChild']),_0x5cc195['setEndBefore'](_0x4185dd['lastElementChild']);const _0x58b020=_0x2580fc['getSelection']();_0x58b020['removeAllRanges'](),_0x58b020['addRange'](_0x5cc195),_0x3f46f8['execCommand']('copy'),_0x4185dd['remove']();}}}class Mi extends Nt{constructor(_0x5d1a05,_0x4d9375=''){super(_0x5d1a05),this['loaderView']=this['_createLoader'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content',_0x4d9375,'ck-reset_all-excluded','ck-ai-form__content-field']}});}['setContent'](_0x1d7d3c){this['element']['innerHTML']=_0x1d7d3c;}['appendLoader'](){this['element']['appendChild'](this['loaderView']['element']);}['_createLoader'](){const _0x2a44f6=new Nt(),_0x5cf4dd=this['locale'],_0x34e3bd=new vt();return _0x34e3bd['isVisible']=!0x0,_0x2a44f6['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__loader']},'children':[_0x34e3bd,{'text':Ni(_0x5cf4dd,'AI\x20is\x20writing...')}]}),_0x2a44f6['render'](),_0x2a44f6;}}class Ui extends Nt{constructor(_0x3ad912,_0x1e9621=''){super(_0x3ad912);const _0x42bab7=new yt(),_0x5ee081=this['bindTemplate'];this['set']('text',_0x1e9621),_0x42bab7['content']=_0x53a56f,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__error']},'children':[_0x42bab7,{'text':_0x5ee081['to']('text')}]});}}class Vi extends xt{['submitButtonView'];['showHistoryButtonView'];constructor(_0x28b432,_0x3a513a){super(_0x28b432,_0x3a513a),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',(_0x2cfd60,_0x126f80)=>{_0x2cfd60['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0x126f80());});}['_createSubmitButton'](){const _0x7426aa=new kt(this['locale']),_0x245cbc=this['locale'];return _0x7426aa['set']({'icon':_0x5ac320,'label':Ni(_0x245cbc,'Submit'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-form__submit'}),_0x7426aa['on']('execute',()=>{this['submit']();}),_0x7426aa['bind']('isEnabled')['to'](this['queryView']['fieldView'],'isEmpty',this,'isEnabled',(_0x204a85,_0x1d51bd)=>!_0x204a85&&_0x1d51bd),_0x7426aa;}['_createShowHistoryButton'](){const _0x23a1cb=new kt(this['locale']),_0x5710f5=this['resultsView'],_0x4f3ee7=this['locale'];_0x23a1cb['set']({'label':Ni(_0x4f3ee7,'History'),'withText':!0x1,'icon':_0x52ae8e,'tooltip':!0x0,'tooltipPosition':'sw','class':'ck-ai-form__toggle-history'}),_0x23a1cb['bind']('isOn')['to'](_0x5710f5,'isVisible'),_0x23a1cb['bind']('isEnabled')['to'](this,'isEnabled'),_0x23a1cb['on']('execute',()=>{_0x5710f5['isVisible']=!_0x5710f5['isVisible'],_0x5710f5['isVisible']?this['filteredView']['focus']():this['focus']();});const _0x269351=()=>{ct['window']['requestAnimationFrame'](()=>{if(lt(this['element'])){const _0x474086=new ut(this['queryView']['fieldView']['element']),_0x5636ac=_0x474086['width'],_0x244ce4='rtl'===_0x4f3ee7['uiLanguageDirection']?'left':'right';_0x474086['excludeScrollbarsAndBorders'](),_0x23a1cb['element']['style'][_0x244ce4]=_0x5636ac-_0x474086['width']+0x1+'px';}});};return this['queryView']['fieldView']['on']('update',_0x269351),this['on']('render',_0x269351),_0x23a1cb;}['submit'](){const _0x2fd187=this['queryView']['fieldView']['element']['value'];this['fire']('submit',_0x2fd187);}['focus'](_0x381212){-0x1===_0x381212?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}}class Bi extends Lt{['historyGroupView'];['clearHistoryButton'];constructor(_0x343a60){super(_0x343a60),this['clearHistoryButton']=this['_createClearHistoryButton'](),this['historyGroupView']=new Dt(),this['historyGroupView']['children']['add'](this['clearHistoryButton'],0x1),this['historyGroupView']['label']=Ni(_0x343a60,'Prompt\x20history'),this['historyGroupView']['items']['delegate']('execute')['to'](this),this['items']['add'](this['historyGroupView']);}['filter'](){let _0x47c017=0x0;for(const _0x5e771f of this['items'])_0x47c017+=_0x5e771f['items']['length'];return{'resultsCount':_0x47c017,'totalItemsCount':_0x47c017};}['_createClearHistoryButton'](){const _0xb64b6c=this['locale'],_0x3b0019=new kt(this['locale']);return _0x3b0019['set']({'label':'('+Ni(_0xb64b6c,'Clear')+')','withText':!0x0}),_0x3b0019['on']('execute',()=>this['fire']('clearHistory')),_0x3b0019;}}class Gi extends Pt{constructor(_0x18ecb9){super();const _0x7adc98=new Ht(),_0x520df1=new kt(this['locale'],_0x7adc98);this['children']['add'](_0x520df1),_0x520df1['set']({'label':_0x18ecb9['prompt'],'withText':!0x0}),_0x520df1['on']('execute',()=>{this['fire']('execute',{'value':_0x242824(_0x18ecb9['prompt'])});});}}const Fi='CKEditor/AIFormView/PromptHistory';class Ki extends dt{constructor(){super(),this['_loadFromSessionStorage'](),this['on']('add',(_0x375691,_0x4caebb)=>{const _0x1099a2=Wi(_0x4caebb['prompt']);for(const _0x3eacae of this)if(_0x3eacae!=_0x4caebb&&Wi(_0x3eacae['prompt'])===_0x1099a2){this['remove'](_0x3eacae);break;}this['length']>0x14&&this['remove'](this['last']),this['_saveToSessionStorage']();}),this['on']('remove',()=>{this['_saveToSessionStorage']();});}['_loadFromSessionStorage'](){const _0x3401cc=sessionStorage['getItem'](Fi)||'[]';this['addMany'](JSON['parse'](_0x3401cc));}['_saveToSessionStorage'](){sessionStorage['setItem'](Fi,JSON['stringify'](this['map'](_0x8b9684=>_0x8b9684)));}}function Wi(_0x1570d6){return _0x1570d6['toLowerCase']()['trim']();}class Yi extends Nt{['focusTracker'];['keystrokes'];['contentArea'];['toolbar'];['promptView'];['errorView'];['_focusables'];['focusCycler'];['_promptHistory'];constructor(_0x7075b3,_0x368985,_0x7a29b1=''){super(_0x7075b3),this['set']('isEnabled',!0x0),this['set']('isProcessing',!0x1),this['set']('prompt',''),this['set']('value',''),this['set']('isError',!0x1),this['set']('mainAction',Di['REPLACE']),this['_promptHistory']=new Ki(),this['errorView']=new Ui(_0x7075b3),this['contentArea']=new Hi(_0x7075b3,_0x7a29b1),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 _0x14f542=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form',_0x368985],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form-content']},'children':[{'tag':'div','attributes':{'class':[_0x14f542['if']('isError','ck-hidden',_0x8e9f54=>!_0x8e9f54)]},'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'](_0x30e566=0x1){-0x1===_0x30e566?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 _0x260877=this['locale'],_0x54ba77=new Vi(_0x260877,{'queryView':{'label':Ni(_0x260877,'Ask\x20AI\x20to\x20edit\x20or\x20generate'),'creator':Ut,'showIcon':!0x1,'showResetButton':!0x1},'infoView':{'text':{'noSearchableItems':{'primary':Ni(_0x260877,'Empty\x20history'),'secondary':Ni(_0x260877,'Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.')}}},'filteredView':this['_createHistoryView'](),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1});return _0x54ba77['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x80b86a,_0x2fdb92)=>_0x80b86a&&!_0x2fdb92),this['listenTo'](_0x54ba77,'submit',(_0x2c0225,_0x3968c1)=>{this['prompt']=_0x3968c1;const _0x48da1d=_0x40b9c9(_0x3968c1);this['fire']('submitPrompt',_0x48da1d),_0x3968c1['trim']()&&this['_promptHistory']['add']({'prompt':_0x48da1d},0x0);},{'priority':'high'}),_0x54ba77;}['_createHistoryView'](){const _0x3f75c1=new Bi(this['locale']);return _0x3f75c1['historyGroupView']['items']['bindTo'](this['_promptHistory'])['as'](Gi),_0x3f75c1['on']('clearHistory',()=>{this['_promptHistory']['clear'](),this['promptView']['search'](''),this['promptView']['focus']();}),_0x3f75c1;}['_createToolbar'](){const _0x29a8ae=new Pi(this['locale']);return _0x29a8ae['replaceButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x1f7015,_0x5ced6f,_0x50c4b0)=>_0x1f7015&&!_0x5ced6f&&!!_0x50c4b0),_0x29a8ae['replaceButton']['delegate']('execute')['to'](this,'replaceContent'),_0x29a8ae['insertButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0xc2e7f9,_0x4f7ef6,_0x44b14f)=>_0xc2e7f9&&!_0x4f7ef6&&!!_0x44b14f),_0x29a8ae['insertButton']['delegate']('execute')['to'](this,'insertContentBelow'),_0x29a8ae['tryAgainButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x2bd215,_0x2e3a6a)=>_0x2bd215&&!_0x2e3a6a),_0x29a8ae['tryAgainButton']['delegate']('execute')['to'](this,'tryAgainEvent'),_0x29a8ae['stopButton']['bind']('isEnabled')['to'](this,'isProcessing'),_0x29a8ae['stopButton']['delegate']('execute')['to'](this,'stopProcessing'),_0x29a8ae;}['startProcessing'](){this['value']='',this['isError']=!0x1,this['isProcessing']=!0x0,this['contentArea']['isVisible']=!0x0,this['toolbar']['isVisible']=!0x0,this['contentArea']['focus']();}['finishProcessing'](){const _0x3dab55=this['locale'];this['isProcessing']=!0x1,this['prompt']='',this['promptView']['reset'](),this['value']&&(this['promptView']['queryView']['label']=Ni(_0x3dab55,'Ask\x20AI\x20to\x20improve\x20generated\x20text'));}['handleError'](_0x47ceeb){const _0x288289=this['locale'];this['finishProcessing'](),this['isError']=!0x0,this['errorView']['text']=_0x47ceeb||Ni(_0x288289,'AI_ERROR_FAILED'),this['value']||(this['contentArea']['isVisible']=!0x1);}}const $i=globalThis['DataTransfer'];class qi extends _0x432272{['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[_0x2f4545,Ri,Oi,Vt];}constructor(_0x22239c){super(_0x22239c),_0x22239c['config']['define']('ai.assistant.disabledElements',['media','rawHtml','tableOfContents']),_0x22239c['config']['define']('ai.assistant.contentAreaCssClass',''),_0x22239c['config']['define']('ai.assistant.useTheme',!0x0),this['_uiCssClasses']='ck-ai-assistant-ui'+(_0x22239c['config']['get']('ai.assistant.useTheme')?'\x20ck-ai-assistant-ui_theme':'');}['init'](){const {editor:_0xd4d20a}=this;this['_aiAdapter']=_0xd4d20a['plugins']['get'](Oi),this['_dialog']=_0xd4d20a['plugins']['get'](Vt),this['_formView']=null,this['_commandDefinitions']=this['_getResolvedCommandsDefinitions']();const _0x206990=new vi(_0xd4d20a,Array['from'](this['_commandDefinitions']['values']()));_0xd4d20a['commands']['add']('showAIAssistant',_0x206990),_0xd4d20a['ui']['componentFactory']['add']('aiCommands',_0x1b53b9=>{const _0x5d2fdc=Bt(_0x1b53b9);return _0x5d2fdc['set']({'class':'ck-ai-commands-dropdown\x20'+this['_uiCssClasses']}),_0x5d2fdc['buttonView']['set']({'label':Ni(_0x1b53b9,'AI\x20Commands'),'icon':_0x4f897d,'tooltip':!0x0}),_0x5d2fdc['on']('execute',_0x338a24=>this['_onExecute'](_0x338a24['source']['id'])),Gt(_0x5d2fdc,_0xd4d20a['ui']['view']['body'],function(_0x47ddc7){const _0x4b88b0=fi(_0x47ddc7['config']['get']('ai.assistant.commands'),_0x47ddc7['locale']),_0x58488c=Xi(_0x47ddc7,_0x4b88b0)['filter'](_0x5aa7c8=>_0x5aa7c8['commands']['length']);if(0x1===_0x58488c['length'])return Xi(_0x47ddc7,_0x58488c[0x0]['commands'])['map'](_0x23ddf5=>({'id':_0x23ddf5['id'],'label':_0x23ddf5['label']}));return _0x58488c['map'](_0x39e564=>{const {groupId:_0x3c5882,groupLabel:_0xd23356,commands:_0x457819}=_0x39e564,_0x6a596b=Xi(_0x47ddc7,_0x457819)['map'](_0x29fd09=>({'id':_0x29fd09['id'],'label':_0x29fd09['label']}));return{'id':_0x3c5882,'menu':_0xd23356||_0x3c5882,'children':_0x6a596b};});}(_0xd4d20a),{'ariaLabel':Ni(_0x1b53b9,'AI\x20Commands')}),_0x5d2fdc['menuView']['menuPanelClass']='ck-ai-commands-dropdown\x20'+this['_uiCssClasses'],_0x206990['on']('change:enabledCommandsIds',_0x4111e5),_0x5d2fdc['menuView']['once']('render',_0x4111e5),_0x5d2fdc;function _0x4111e5(){_0x5d2fdc['isEnabled']=_0x206990['enabledCommandsIds']['length']>0x0;for(const _0x49cd69 of _0x5d2fdc['menuView']['buttons'])_0x49cd69['isEnabled']=_0x206990['enabledCommandsIds']['includes'](_0x49cd69['id']);}}),_0xd4d20a['ui']['componentFactory']['add']('menuBar:aiCommands',_0x25f7ff=>{const _0x18b94e=new Ft(_0x25f7ff);_0x18b94e['buttonView']['set']({'label':Ni(_0x25f7ff,'AI\x20Commands'),'icon':_0x4f897d}),_0x18b94e['bind']('isEnabled')['to'](_0x206990,'enabledCommandsIds',_0x418bc9=>_0x418bc9['length']>0x0);const _0x2bdc27=fi(_0xd4d20a['config']['get']('ai.assistant.commands'),_0x25f7ff);return this['_populateMenuBarMenu'](_0x206990,_0x18b94e,_0x2bdc27,_0x67d707=>this['_onExecute'](_0x67d707)),_0x18b94e;}),_0xd4d20a['ui']['componentFactory']['add']('aiAssistant',()=>{const _0x1731e3=this['_createAIAssistantUIButton'](kt);return _0x1731e3['set']({'tooltip':!0x0,'class':'ck-ai-assistant-button\x20'+this['_uiCssClasses']}),_0x1731e3;}),_0xd4d20a['ui']['componentFactory']['add']('menuBar:aiAssistant',()=>{const _0x3c5c1b=this['_createAIAssistantUIButton'](Kt);return _0x3c5c1b['set']({'role':'menuitemcheckbox'}),_0x3c5c1b;}),this['licenseKey']=this['editor']['config']['get']('licenseKey');const _0x26b345=this['editor'];this['_licenseKeyCheckInterval']=setInterval(()=>{let _0x22dd3c;for(const _0x9b9cab in _0x26b345){const _0x104159=_0x9b9cab,_0xf24dc2=_0x26b345[_0x104159];if('aiLicenseKeyValid'==_0xf24dc2||'aiLicenseKeyInvalid'==_0xf24dc2||'aiLicenseKeyExpired'==_0xf24dc2||'aiLicenseKeyDomainLimit'==_0xf24dc2||'aiLicenseKeyNotAllowed'==_0xf24dc2||'aiLicenseKeyEvaluationLimit'==_0xf24dc2||'aiLicenseKeyUsageLimit'==_0xf24dc2){delete _0x26b345[_0x104159],_0x22dd3c=_0xf24dc2,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'aiLicenseKeyInvalid'==_0x22dd3c&&_0x26b345['_showLicenseError']('invalid'),'aiLicenseKeyExpired'==_0x22dd3c&&_0x26b345['_showLicenseError']('expired'),'aiLicenseKeyDomainLimit'==_0x22dd3c&&_0x26b345['_showLicenseError']('domainLimit'),'aiLicenseKeyNotAllowed'==_0x22dd3c&&_0x26b345['_showLicenseError']('featureNotAllowed','AIAssistant'),'aiLicenseKeyEvaluationLimit'==_0x22dd3c&&_0x26b345['_showLicenseError']('evaluationLimit'),'aiLicenseKeyUsageLimit'==_0x22dd3c&&_0x26b345['_showLicenseError']('usageLimit');},0x3e8);}['destroy'](){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}['showUI'](_0x5d5231='',_0x33e24b='',_0xae1780='custom'){const _0x246347=this['editor'],_0x55e691=_0x246347['editing']['view'],_0x5ce628=_0x246347['plugins']['get'](Ri),_0x51b288=_0x246347['plugins']['get'](_0x2f4545);_0x5ce628['showFakeVisualSelection']();const _0x5aeab5=new $i(),_0xaf74b3=new ClipboardEvent('copy',{'clipboardData':_0x5aeab5}),_0x916f91=new _0xe611ac(_0x5aeab5),_0x5355a9=new _0xac4489(_0x55e691,_0xaf74b3,{'dataTransfer':_0x916f91});_0x51b288['_forceMarkersCopy']('comment',()=>{_0x55e691['document']['fire']('copy',_0x5355a9);}),this['_formView']||(this['_initView'](),this['_aiAssistantController']=new Li(_0x246347,this['_aiAdapter']['textAdapter'],this['_formView']));let _0x16dbdf=_0x916f91['getData']('text/html');const _0x11bf54=_0x246347['model']['document']['selection'],_0x55f6b5=Array['from'](_0x11bf54['getRanges']());0x1===_0x55f6b5['length']&&_0x55f6b5[0x0]['isFlat']&&!_0x11bf54['getSelectedElement']()&&''!==_0x16dbdf['replace'](/&nbsp;/g,'')['trim']()&&(_0x16dbdf='<p>'+_0x16dbdf+'</p>'),this['_aiAssistantController']['updateView']({'actionId':_0xae1780,'query':_0x5d5231,'htmlContent':_0x16dbdf,'label':_0x33e24b,'mainActionLabel':Di[_0x246347['model']['document']['selection']['isCollapsed']?'INSERT':'REPLACE']}),'aiAssistant'!==this['_dialog']['id']?this['_dialog']['show']({'id':'aiAssistant','icon':_0x58fae1,'title':Ni(this['editor']['locale'],'AI\x20Assistant'),'content':this['_formView'],'position':Wt['EDITOR_TOP_SIDE'],'onShow':()=>{this['_formView']['focus']();},'onHide':()=>{this['_aiAssistantController']['reset'](),_0x5ce628['hideFakeVisualSelection']();}}):this['_dialog']['view']['wasMoved']||this['_dialog']['view']['updatePosition']();}['hideUI'](){this['_dialog']['hide']();}['_getResolvedCommandsDefinitions'](){const _0x2c6b96=new Map(),_0x5c70c7=fi(this['editor']['config']['get']('ai.assistant.commands'),this['editor']['locale']);for(const _0x2d0079 of _0x5c70c7)for(const _0x4ab765 of _0x2d0079['commands'])_0x2c6b96['set'](_0x4ab765['id'],{..._0x4ab765,'groupId':_0x2d0079['groupId'],'groupLabel':_0x2d0079['groupLabel']||_0x2d0079['groupId']});return _0x2c6b96;}['_createAIAssistantUIButton'](_0x362dd6){const _0x3ebf49=this['editor'],_0x61b72c=_0x3ebf49['commands']['get']('showAIAssistant'),_0x30a7cf=new _0x362dd6(_0x3ebf49['locale']);return _0x30a7cf['set']({'label':Ni(_0x3ebf49['locale'],'AI\x20Assistant'),'icon':_0x58fae1,'isToggleable':!0x0}),_0x30a7cf['bind']('isEnabled')['to'](_0x61b72c),_0x30a7cf['bind']('isOn')['to'](this['_dialog'],'id',_0x30cc30=>'aiAssistant'===_0x30cc30),this['listenTo'](_0x30a7cf,'execute',()=>{_0x30a7cf['isOn']?this['hideUI']():_0x61b72c['execute']();}),_0x30a7cf;}['_initView'](){const _0x4fe0e4=this['editor']['plugins']['get'](Ri);this['_formView']=new Yi(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',()=>{_0x4fe0e4['insertContent'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['listenTo'](this['_formView'],'insertContentBelow',()=>{_0x4fe0e4['insertContentBelow'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['_initAriaAiStatusChangeAnnouncements']();}['_initAriaAiStatusChangeAnnouncements'](){const {locale:_0x4a45b0,ui:{ariaLiveAnnouncer:_0x5eb0c4}}=this['editor'];this['_formView']['contentArea']['on']('change:isProcessing',(_0x1e7263,_0xbcfc2e,_0x346e2b)=>{const _0x2fa57c=this['_aiAssistantController']['currentContext'];_0x346e2b?_0x5eb0c4['announce'](Ni(_0x4a45b0,'AI\x20is\x20writing')):_0x2fa57c&&_0x5eb0c4['announce'](Ni(_0x4a45b0,'Generated\x20content:\x20%0',_0x2fa57c),{'politeness':'polite','isUnsafeHTML':!0x0});}),this['_formView']['on']('change:isError',(_0x5f2804,_0x395efc,_0x23a33f)=>{if(_0x23a33f){const _0x4657b7=this['_formView']['errorView']['text'];_0x5eb0c4['announce'](Ni(_0x4a45b0,'Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x4657b7));}});}['_onExecute'](_0x11c57f){const _0x10ce5e=this['_commandDefinitions']['get'](_0x11c57f),_0x1b1a5f=this['editor'],_0x17a8ac=_0x1b1a5f['model']['document']['selection'],_0x1506f0=_0x1b1a5f['commands']['get']('showAIAssistant'),_0x1e75c0=_0x1b1a5f['plugins']['get'](Ri),_0x264830=''+(_0x10ce5e['groupId']!==wi?_0x10ce5e['groupLabel']+':\x20':'')+_0x10ce5e['label'];if(!0x1!==_0x10ce5e['requiresContent']&&_0x17a8ac['isCollapsed']){const _0x4c615a=gt(_0x17a8ac['getSelectedBlocks']())||_0x1b1a5f['model']['schema']['getLimitElement'](_0x17a8ac);_0x1b1a5f['model']['change'](_0x5aa308=>{_0x5aa308['setSelection'](_0x4c615a,'in');});}_0x1e75c0['showFakeVisualSelection'](),_0x1506f0['execute'](_0x10ce5e['prompt'],_0x264830,'command:'+_0x11c57f);}['_populateMenuBarMenu'](_0x5b11e7,_0x5ce9ec,_0x501ca1,_0x3898bf){const _0x529990=this['editor'],_0x4c5641=_0x529990['locale'],_0x69d910=new Yt(_0x4c5641),_0x168107=Xi(_0x529990,_0x501ca1)['filter'](_0x34bc55=>_0x34bc55['commands']['length']);0x1===_0x168107['length']?this['_getMenuBarGroupButtons']({'command':_0x5b11e7,'commands':_0x168107[0x0]['commands'],'parentMenuView':_0x5ce9ec,'onExecute':_0x3898bf})['forEach'](_0x3319bb=>_0x69d910['items']['add'](_0x3319bb)):_0x168107['forEach'](({groupId:_0x51830c,groupLabel:_0x806776,commands:_0x57300a})=>{const _0x3b63ad=new $t(_0x4c5641,_0x5ce9ec),_0x4828d3=new Ft(_0x4c5641),_0x3819c6=new Yt(_0x4c5641),_0x580497=this['_getMenuBarGroupButtons']({'command':_0x5b11e7,'commands':_0x57300a,'parentMenuView':_0x4828d3,'onExecute':_0x3898bf});_0x4828d3['buttonView']['set']({'label':_0x806776||_0x51830c}),_0x4828d3['delegate']('execute')['to'](_0x5ce9ec),_0x3819c6['items']['addMany'](_0x580497),_0x4828d3['panelView']['children']['add'](_0x3819c6),_0x3b63ad['children']['add'](_0x4828d3),_0x69d910['items']['add'](_0x3b63ad);}),_0x5ce9ec['panelView']['children']['add'](_0x69d910);}['_getMenuBarGroupButtons']({command:_0x2a5a1b,commands:_0x138d43,parentMenuView:_0x51d301,onExecute:_0x110710}){const _0x4f001a=this['editor'],_0xf0f204=_0x4f001a['locale'];return Xi(_0x4f001a,_0x138d43)['map'](_0x1edc48=>{const _0x336673=new $t(_0xf0f204,_0x51d301),_0x1cad66=new Kt(_0xf0f204);return _0x1cad66['set']({'label':_0x1edc48['label']}),_0x1cad66['delegate']('execute')['to'](_0x51d301),_0x1cad66['on']('execute',()=>_0x110710(_0x1edc48['id'])),_0x1cad66['bind']('isEnabled')['to'](_0x2a5a1b,'enabledCommandsIds',_0x13b8e0=>_0x13b8e0['includes'](_0x1edc48['id'])),_0x336673['children']['add'](_0x1cad66),_0x336673;});}}function Qi(_0x4bef9d,_0x1e1bce){return void 0x0!==_0x4bef9d['order']&&void 0x0===_0x1e1bce['order']?0x1:void 0x0===_0x4bef9d['order']&&void 0x0!==_0x1e1bce['order']?-0x1:void 0x0!==_0x4bef9d['order']&&void 0x0!==_0x1e1bce['order']?_0x4bef9d['order']-_0x1e1bce['order']:0x0;}function Xi(_0x9892ab,_0x336a1){_0x336a1['sort'](Qi);const _0x689455={},_0xc47c8e=[];for(const _0x336c08 of _0x336a1)if(void 0x0!==_0x336c08['order']){if(_0x336c08['order']in _0x689455)throw new ot('ai-commands-config-order-collision',_0x9892ab,{'conflictingDefinitions':[_0x336c08,_0x689455[_0x336c08['order']]]});_0x689455[_0x336c08['order']]=_0x336c08,_0xc47c8e['splice'](_0x336c08['order'],0x0,_0x336c08);}else _0xc47c8e['push'](_0x336c08);return _0xc47c8e;}class zi extends _0x432272{static get['requires'](){return[qi,Ri];}static get['pluginName'](){return'AIAssistant';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x1913fc){super(_0x1913fc);const _0x2d23ef=_0x1913fc['config'],_0x48b785=_0x1913fc['locale'];_0x2d23ef['define']('ai.assistant.preserveComments',!0x0),_0x2d23ef['define']('ai.assistant.commands',ji(_0x48b785)),_0x2d23ef['define']('ai.assistant.extraCommandGroups',[]),_0x2d23ef['define']('ai.assistant.removeCommands',[]);let _0x2f3807=fi(_0x2d23ef['get']('ai.assistant.commands'),_0x48b785);const _0x40aeec=_0x2d23ef['get']('ai.assistant.extraCommandGroups'),_0x292815=_0x2d23ef['get']('ai.assistant.removeCommands');_0x40aeec['forEach'](_0x2cc084=>{const _0x436adc=_0x2f3807['find'](_0x248de7=>_0x248de7['groupId']===_0x2cc084['groupId']);_0x436adc?_0x436adc['commands']=_0x436adc['commands']['concat'](_0x2cc084['commands']):_0x2f3807['push'](_0x2cc084);}),_0x2f3807=_0x2f3807['filter'](_0x40764e=>!_0x292815['includes'](_0x40764e['groupId'])),_0x2f3807['forEach'](_0x2a50db=>{_0x2a50db['commands']=_0x2a50db['commands']['filter'](_0x1d69af=>!_0x292815['includes'](_0x1d69af['id']));}),_0x2d23ef['set']('ai.assistant.commands',_0x2f3807);}}function ji(_0x4b030f){return[{'groupId':'editOrReview','groupLabel':Ni(_0x4b030f,'Edit\x20or\x20review'),'commands':[{'id':'improveWriting','label':Ni(_0x4b030f,'Improve\x20writing'),'prompt':'Fix\x20spelling\x20mistakes,\x20use\x20proper\x20grammar\x20and\x20apply\x20good\x20writing\x20practices.\x20Do\x20not\x20lose\x20the\x20original\x20meaning.'},{'id':'makeShorter','label':Ni(_0x4b030f,'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':Ni(_0x4b030f,'Make\x20longer'),'prompt':'Improve\x20this\x20content\x20by\x20using\x20descriptive\x20language\x20and\x20inserting\x20more\x20information\x20and\x20more\x20detailed\x20explanations.'},{'id':'simplifyLanguage','label':Ni(_0x4b030f,'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':Ni(_0x4b030f,'Generate\x20from\x20selection'),'commands':[{'id':'summarize','label':Ni(_0x4b030f,'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':Ni(_0x4b030f,'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':Ni(_0x4b030f,'Change\x20tone'),'commands':[{'id':'professional','label':Ni(_0x4b030f,'Professional'),'prompt':'Improve\x20using\x20polished,\x20formal,\x20and\x20respectful\x20language\x20to\x20convey\x20professional\x20expertise\x20and\x20competence.'},{'id':'casual','label':Ni(_0x4b030f,'Casual'),'prompt':'Improve\x20using\x20casual,\x20informal\x20language\x20to\x20convey\x20a\x20casual\x20conversation\x20with\x20a\x20real\x20person.'},{'id':'direct','label':Ni(_0x4b030f,'Direct'),'prompt':'Improve\x20using\x20direct\x20language,\x20using\x20only\x20the\x20essential\x20information.'},{'id':'confident','label':Ni(_0x4b030f,'Confident'),'prompt':'Improve\x20using\x20compelling,\x20optimistic\x20language\x20to\x20convey\x20confidence\x20in\x20the\x20writing.'},{'id':'friendly','label':Ni(_0x4b030f,'Friendly'),'prompt':'Improve\x20using\x20friendly,\x20comforting\x20language,\x20to\x20convey\x20understanding\x20and\x20empathy.'}]},{'groupId':'changeStyle','groupLabel':Ni(_0x4b030f,'Change\x20style'),'commands':[{'id':'business','label':Ni(_0x4b030f,'Business'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20business\x20professional\x20with\x20formal\x20language.'},{'id':'legal','label':Ni(_0x4b030f,'Legal'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20legal\x20professional\x20using\x20valid\x20legal\x20terminology.'},{'id':'journalism','label':Ni(_0x4b030f,'Journalism'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20journalist\x20using\x20engaging\x20language\x20to\x20convey\x20the\x20importance\x20of\x20the\x20information.'},{'id':'poetic','label':Ni(_0x4b030f,'Poetic'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20poem\x20using\x20poetic\x20techniques\x20without\x20losing\x20the\x20original\x20meaning.'}]},{'groupId':'translate','groupLabel':Ni(_0x4b030f,'Translate'),'commands':[{'id':'translateEnglish','label':Ni(_0x4b030f,'English'),'prompt':'Translate\x20the\x20content\x20to\x20English\x20language.'},{'id':'translateSpanish','label':Ni(_0x4b030f,'Spanish'),'prompt':'Translate\x20the\x20content\x20to\x20Spanish\x20language.'},{'id':'translatePortuguese','label':Ni(_0x4b030f,'Portuguese'),'prompt':'Translate\x20the\x20content\x20to\x20Portuguese\x20language.'},{'id':'translateGerman','label':Ni(_0x4b030f,'German'),'prompt':'Translate\x20the\x20content\x20to\x20German\x20language.'},{'id':'translateFrench','label':Ni(_0x4b030f,'French'),'prompt':'Translate\x20the\x20content\x20to\x20French\x20language.'},{'id':'translateChinese','label':Ni(_0x4b030f,'Simplified\x20Chinese'),'prompt':'Translate\x20the\x20content\x20to\x20Simplified\x20Chinese\x20language.'},{'id':'translateHindi','label':Ni(_0x4b030f,'Hindi'),'prompt':'Translate\x20the\x20content\x20to\x20Hindi\x20language.'},{'id':'translateArabic','label':Ni(_0x4b030f,'Arabic'),'prompt':'Translate\x20the\x20content\x20to\x20Arabic\x20language.'}]}];}class Ji extends _0x432272{['abortController'];static get['requires'](){return[Oi];}constructor(_0x10bf96){super(_0x10bf96),this['abortController']=new AbortController();}['init'](){this['editor']['plugins']['get'](Oi)['textAdapter']=this;}['abort'](){this['abortController']['signal']['aborted']||(this['abortController']['abort'](),this['abortController']=new AbortController());}async['makeRequest'](_0x34172){return this['sendRequest'](_0x34172)['catch'](_0x5711a5=>{if(_0x5711a5 instanceof ki)return Promise['reject'](_0x5711a5);if('AbortError'==_0x5711a5['name'])return Promise['resolve']();throw console['error'](_0x5711a5),new ot('aitextadapter-send-request-failed',null);});}async['_prepareRequestHeaders'](_0x301f70,_0x3279de){const _0x2162de=this['editor']['locale'],_0x186682={'Content-Type':'application/json'};if('object'==typeof _0x301f70)Object['assign'](_0x186682,_0x301f70);else{if(_0x301f70)try{const _0x12527a=await _0x301f70(_0x3279de);Object['assign'](_0x186682,_0x12527a);}catch{return Promise['reject'](new ki(Ni(_0x2162de,'AI_ERROR_GET_HEADERS')));}}return _0x186682;}async['_prepareRequestParameters'](_0x3c4791,_0x1abbbb){const _0x4e5dfe=this['editor']['locale'];if('object'==typeof _0x3c4791)return _0x3c4791;try{return await _0x3c4791(_0x1abbbb);}catch{return Promise['reject'](new ki(Ni(_0x4e5dfe,'AI_ERROR_GET_PARAMETERS')));}}}class Zi extends Ji{['_apiUrl'];['_requestHeaders'];['_requestParameters'];static get['pluginName'](){return'OpenAITextAdapter';}constructor(_0x585ef1){super(_0x585ef1),_0x585ef1['config']['define']('ai.assistant.adapter.openAI.apiUrl','https://api.openai.com/v1/chat/completions'),_0x585ef1['config']['get']('ai.assistant.adapter.openAI.requestParameters')||_0x585ef1['config']['define']('ai.assistant.adapter.openAI.requestParameters',{'model':'gpt-4o','temperature':0x1,'top_p':0x1,'stream':!0x0}),this['_apiUrl']=_0x585ef1['config']['get']('ai.assistant.adapter.openAI.apiUrl'),this['_requestHeaders']=_0x585ef1['config']['get']('ai.assistant.adapter.openAI.requestHeaders')||{},this['_requestParameters']=_0x585ef1['config']['get']('ai.assistant.adapter.openAI.requestParameters');}async['sendRequest']({query:_0x34ba00,context:_0x17abb3,onData:_0x235b65,actionId:_0x484509}){const _0x17558a=this['editor']['locale'],_0x33767c=await this['prepareMessages'](_0x34ba00,_0x17abb3,_0x484509),_0x531163=await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x484509),_0x531a1d=await this['_prepareRequestParameters'](this['_requestParameters'],_0x484509),_0xd1c676={'messages':_0x33767c,..._0x531a1d},_0x49416c={'method':'POST','headers':_0x531163,'body':JSON['stringify'](_0xd1c676),'signal':this['abortController']['signal']},_0x31657a=await fetch(this['_apiUrl'],_0x49416c);if(_0x31657a['ok'])return _0x531a1d['stream']?await this['_readStreamableResponse'](_0x31657a,_0x235b65):await this['_readStaticResponse'](_0x31657a,_0x235b65),Promise['resolve']();{const _0x813e9d=await _0x31657a['text']();return _0x813e9d['includes']('context_length_exceeded')?Promise['reject'](new ki(Ni(_0x17558a,'AI_ERROR_CONTEXT_LENGTH'))):_0x813e9d['includes']('Moderation')?Promise['reject'](new ki(Ni(_0x17558a,'AI_ERROR_MODERATION'))):Promise['reject'](new Error(_0x813e9d));}}async['prepareMessages'](_0x14935d,_0x1d6a7f,_0xcd264c){let _0x34fe99,_0x59ec58;return _0x1d6a7f?(_0x34fe99='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.',_0x59ec58='Instruction:\x0a'+_0x14935d+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x1d6a7f):(_0x34fe99='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.',_0x59ec58=_0x14935d),[{'role':'system','content':_0x34fe99},{'role':'user','content':_0x59ec58}];}async['_readStreamableResponse'](_0x3ccd2b,_0x2d18ce){const _0x40b604=_0x3ccd2b['body']['getReader'](),_0x3a7951=new TextDecoder();let _0x363a60='',_0x2b3e96='',_0x57f2cf='',_0x576b99=!0x1;for(;!_0x576b99;){const {done:_0xa58387,value:_0x5f528f}=await _0x40b604['read'](),_0xee4c37=_0x363a60+_0x3a7951['decode'](_0x5f528f);let _0x3b1571='';_0x576b99=_0xa58387;try{_0x3b1571=this['_cleanUpData'](_0xee4c37),_0x363a60='';}catch{_0x363a60=_0xee4c37;continue;}_0x2b3e96+=_0x3b1571,!_0x576b99&&this['_isBufferIncomplete'](_0x2b3e96)||_0x2b3e96&&(_0x57f2cf+=_0x2b3e96,_0x2b3e96='',_0x2d18ce(_0x57f2cf));}return Promise['resolve']();}async['_readStaticResponse'](_0x3e8d36,_0x56f5c1){return _0x56f5c1((await _0x3e8d36['json']())['choices'][0x0]['message']['content']),Promise['resolve']();}['_isBufferIncomplete'](_0x4a25e6){const _0x347ca2=_0x4a25e6['split']('<')['length']!==_0x4a25e6['split']('>')['length'],_0x17e06c=_0x4a25e6['length']<0x1e;return _0x347ca2&&_0x17e06c;}['_cleanUpData'](_0x27fac3){return _0x27fac3['split'](/\n(?![^{]*\})/g)['map'](_0x3404dd=>_0x3404dd['replace']('data:\x20',''))['filter'](_0x58a447=>_0x58a447&&_0x58a447['length']>0x0&&'[DONE]'!==_0x58a447)['map'](_0x515936=>{const {choices:_0x46d0b6}=JSON['parse'](_0x515936);if(_0x46d0b6[0x0]?.['delta']?.['content'])return _0x46d0b6[0x0]['delta']['content'];})['filter'](_0x29700b=>_0x29700b)['join']('');}}class ts extends Ji{['_apiUrl'];['_requestHeaders'];['_bedrockClientConfig'];['_requestParameters'];static get['pluginName'](){return'AWSTextAdapter';}constructor(_0x48377a){super(_0x48377a),_0x48377a['config']['get']('ai.assistant.adapter.aws.requestParameters')||_0x48377a['config']['define']('ai.assistant.adapter.aws.requestParameters',{'model':'anthropic.claude-v2','max_tokens_to_sample':0x7d0,'temperature':0x1,'top_p':0x1,'top_k':0xfa,'anthropic_version':'bedrock-2023-05-31','stream':!0x0}),this['_apiUrl']=_0x48377a['config']['get']('ai.assistant.adapter.aws.apiUrl'),this['_bedrockClientConfig']=_0x48377a['config']['get']('ai.assistant.adapter.aws.bedrockClientConfig'),this['_requestHeaders']=_0x48377a['config']['get']('ai.assistant.adapter.aws.requestHeaders'),this['_requestParameters']=_0x48377a['config']['get']('ai.assistant.adapter.aws.requestParameters');}async['sendRequest']({query:_0x306242,context:_0x11ed5d,onData:_0x59cdb1,actionId:_0x1fbcdf}){const {model:_0x4f43de,stream:_0x1cbce7,..._0x5716dc}=await this['_prepareRequestParameters'](this['_requestParameters'],_0x1fbcdf),_0x513b92={'prompt':await this['preparePrompt'](_0x306242,_0x11ed5d,_0x4f43de,_0x1fbcdf),..._0x5716dc};this['_apiUrl']?await this['_processProxyRequest'](_0x513b92,_0x4f43de,_0x1cbce7,_0x59cdb1,_0x1fbcdf):await this['_processAWSRequest'](_0x513b92,_0x4f43de,_0x1cbce7,_0x59cdb1);}async['preparePrompt'](_0x42b537,_0x35f3a4,_0x2a3dc8,_0x2cc04f){let _0x385e11,_0x37d1bf;return _0x35f3a4?(_0x385e11='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.',_0x37d1bf='Instruction:\x0a'+_0x42b537+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x35f3a4):(_0x385e11='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.',_0x37d1bf=_0x42b537),'meta.llama'==this['getModelFamily'](_0x2a3dc8)?'<<SYS>>\x0a'+_0x385e11+'\x0a<</SYS>>\x0a[INST]\x0a'+_0x37d1bf+'\x0a[/INST]':'Human:\x0a'+_0x385e11+'\x0a'+_0x37d1bf+'\x0a\x0aAssistant:';}['getModelFamily'](_0x174efd){if(/^anthropic\.claude/['test'](_0x174efd))return'anthropic.claude';if(/^ai21\.j2/['test'](_0x174efd))return'ai21.j2';if(/^cohere\.command/['test'](_0x174efd))return'cohere.command';if(/^meta\.llama/['test'](_0x174efd))return'meta.llama';throw new ki(Ni(this['editor']['locale'],'AI_ERROR_UNSUPPORTED_MODEL',_0x174efd));}async['_processProxyRequest'](_0x2b1b9b,_0x44d0dc,_0x4f8a7c,_0x4cc9b2,_0x3acbd7){const _0x5d5292={'method':'POST','headers':await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x3acbd7),'body':JSON['stringify']({..._0x2b1b9b,'model':_0x44d0dc,'stream':_0x4f8a7c}),'signal':this['abortController']['signal']},_0x2042fe=await fetch(this['_apiUrl'],_0x5d5292);_0x4f8a7c?await this['_readStreamableResponse'](_0x2042fe,_0x44d0dc,_0x4cc9b2):await this['_readStaticResponse'](_0x2042fe,_0x44d0dc,_0x4cc9b2);}async['_processAWSRequest'](_0x1351ec,_0x143b75,_0x2cf16d,_0x1c3eb0){const _0x321cab=new _0x3eb2d3(this['_bedrockClientConfig']),_0x5ca4ba={'body':JSON['stringify'](_0x1351ec),'contentType':'application/json','accept':'application/json','modelId':_0x143b75};let _0x116a68;if(_0x2cf16d){const _0x5a843f=new _0x4dd108(_0x5ca4ba);_0x116a68=await _0x321cab['send'](_0x5a843f,{'abortSignal':this['abortController']['signal']}),await this['_readAsyncIterableResponse'](_0x116a68,_0x143b75,_0x1c3eb0);}else{const _0x152374=new _0x32d894(_0x5ca4ba);_0x116a68=await _0x321cab['send'](_0x152374,{'abortSignal':this['abortController']['signal']}),await this['_readStaticResponse'](_0x116a68,_0x143b75,_0x1c3eb0);}}async['_readAsyncIterableResponse'](_0x26ae18,_0x22a3eb,_0x29a992){const _0x39616a=_0x26ae18['body'],_0x34181c=new TextDecoder('utf-8');let _0x14dd57='';for await(const _0x18067d of _0x39616a)if(_0x18067d['chunk']){const _0x3263fa=_0x34181c['decode'](_0x18067d['chunk']['bytes']),_0x45734c=JSON['parse'](_0x3263fa);_0x14dd57+=this['_getGeneratedText'](_0x45734c,_0x22a3eb),_0x29a992(_0x14dd57);}return Promise['resolve']();}async['_readStreamableResponse'](_0x57435b,_0x2e16ae,_0x1c1b5c){const _0x475b52=_0x57435b['body'],_0xefa3d0=new TextDecoder('utf-8'),_0xd86745=_0x475b52['getReader']();let _0x492f9f='',_0x40fd3b='',_0x4ad24d=!0x1;for(;!_0x4ad24d;){const {done:_0x10df01,value:_0x25a0b7}=await _0xd86745['read']();if(_0x4ad24d=_0x10df01,_0x4ad24d)break;const _0x550c99=(_0x492f9f+_0xefa3d0['decode'](_0x25a0b7))['split']('\x0a')['map'](_0x5dd33a=>{try{return _0x492f9f='',JSON['parse'](_0x5dd33a);}catch{return _0x492f9f=_0x5dd33a,null;}})['filter'](_0x139f88=>null!==_0x139f88);_0x550c99['length']&&(_0x40fd3b+=_0x550c99['map'](_0x522402=>this['_getGeneratedText'](_0x522402,_0x2e16ae))['join'](''),_0x1c1b5c(_0x40fd3b));}return Promise['resolve']();}async['_readStaticResponse'](_0xb81e5d,_0x38908f,_0x52e4f0){let _0x12533a;return _0x12533a=_0xb81e5d instanceof Response?await _0xb81e5d['json']():JSON['parse'](new TextDecoder('utf-8')['decode'](_0xb81e5d['body'])),(_0x52e4f0(this['_getGeneratedText'](_0x12533a,_0x38908f)),Promise['resolve']());}['_getGeneratedText'](_0x5a9a0e,_0x5736ed){switch(this['getModelFamily'](_0x5736ed)){case'anthropic.claude':return _0x5a9a0e['completion'];case'ai21.j2':return _0x5a9a0e['completions'][0x0]['data']['text'];case'cohere.command':return _0x5a9a0e['generations'][0x0]['text'];case'meta.llama':return _0x5a9a0e['generation'];}}}class es extends kt{constructor(_0x815b80,_0x2d7222={}){super(_0x815b80),this['isToggleable']=!0x0,this['set']('side',_0x2d7222['side']||'top');const _0x98de93=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-tab-button',...It(_0x2d7222['class']||[]),_0x98de93['to']('side',_0x534a5b=>'ck-tab-button_'+_0x534a5b),_0x98de93['to']('class')]}});}['show'](){this['set']('isVisible',!0x0);}['hide'](){this['set']('isVisible',!0x1);}}class is extends Nt{['children'];constructor(_0x5c1052,_0x387afe={}){super(_0x5c1052);const _0x442742=this['bindTemplate'];this['set']('isVisible',!0x1),this['set']('class',''),this['children']=this['createCollection'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck-tab-panel',...It(_0x387afe['class']||[]),_0x442742['to']('class'),_0x442742['if']('isVisible','ck-hidden',_0x37a946=>!_0x37a946)]},'children':this['children']});}['show'](){this['set']('isVisible',!0x0);}['hide'](){this['set']('isVisible',!0x1);}}class ss extends Nt{['buttonViews']=this['createCollection']();['panelViews']=this['createCollection']();['_tabs']=new Map();constructor(_0x252194,_0x303ac3={}){super(_0x252194),this['set']('class',void 0x0),this['set']('activeTab',null),this['set']('side',_0x303ac3['side']||'top'),this['set']('isMaximized',!0x1);const _0x157e29=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset','ck-tabs',...It(_0x303ac3['class']||[]),_0x157e29['to']('side',_0x4dbbb5=>'ck-tabs_'+_0x4dbbb5),_0x157e29['to']('class'),_0x157e29['to']('isMaximized',_0x246830=>_0x246830?'ck-ai-tabs_maximized':'')],'tabindex':'0'},'children':[{'tag':'div','attributes':{'class':['ck','ck-tabs__buttons-container',_0x157e29['to']('side',_0x413b84=>'ck-tabs__buttons-container_'+_0x413b84)]},'children':this['buttonViews']},{'tag':'div','attributes':{'class':['ck','ck-tabs__panels-container',_0x157e29['to']('side',_0x826209=>'ck-tabs__panels-container_'+_0x826209)]},'children':this['panelViews']},...It(_0x303ac3['children']||[])]});}['getTabIds'](){return[...this['_tabs']['keys']()];}['getTab'](_0x270627){const _0x48e4f3=this['_tabs']['get'](_0x270627);return _0x48e4f3||null;}['addTab'](_0x2668ed){const _0x18eedf=this['_setupButton']({'id':_0x2668ed['id'],'label':_0x2668ed['buttonLabel'],'icon':_0x2668ed['buttonIcon'],'order':_0x2668ed['order']}),_0x17b940=new is(this['locale']);return _0x17b940['render'](),_0x2668ed['content']&&_0x17b940['children']['add'](_0x2668ed['content']),this['panelViews']['add'](_0x17b940),this['_tabs']['set'](_0x2668ed['id'],{'button':_0x18eedf,'panel':_0x17b940,'order':void 0x0!==_0x2668ed['order']?_0x2668ed['order']:null}),this['fire']('addTab:'+_0x2668ed['id'],{'id':_0x2668ed['id'],'button':_0x18eedf,'panel':_0x17b940}),null===this['activeTab']?this['activateTab'](_0x2668ed['id']):this['_hidePanel'](_0x2668ed['id']),{'button':_0x18eedf,'panel':_0x17b940};}['activateTab'](_0x2929d1){if(null!==_0x2929d1&&!this['getTab'](_0x2929d1))throw new ot('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0x2929d1});this['activeTab']!==_0x2929d1&&(this['activeTab']&&this['_hidePanel'](this['activeTab']),this['activeTab']=_0x2929d1,_0x2929d1&&this['_showPanel'](_0x2929d1),this['fire']('activateTab:'+_0x2929d1,_0x2929d1));}['showTab'](_0x2ce938){if(!this['getTab'](_0x2ce938))throw new ot('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0x2ce938});this['_showPanel'](_0x2ce938),this['_showButton'](_0x2ce938),this['fire']('show:'+_0x2ce938,_0x2ce938);}['hideTab'](_0x16b819){if(!this['getTab'](_0x16b819))throw new ot('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0x16b819});const _0x44c750=this['activeTab'];this['_hidePanel'](_0x16b819),this['_hideButton'](_0x16b819);const _0x4251f0=this['getTabIds']();_0x44c750===_0x16b819&&_0x4251f0['length']>0x1&&this['activateTab'](_0x4251f0['find'](_0x1c4cb4=>_0x1c4cb4!==_0x16b819)),this['fire']('hide:'+_0x16b819,_0x16b819);}['_getPanel'](_0x39a8fe){const _0x1284e3=this['_tabs']['get'](_0x39a8fe);return _0x1284e3?_0x1284e3['panel']:null;}['_showPanel'](_0x1e9d2d){null!==this['activeTab']&&this['activeTab']!==_0x1e9d2d||this['_getPanel'](_0x1e9d2d)['show']();}['_hidePanel'](_0x42edcd){const _0x104553=this['_getPanel'](_0x42edcd);_0x104553['isVisible']&&(this['activeTab']===_0x42edcd&&(this['activeTab']=null),_0x104553['hide']());}['_getButton'](_0x46d781){const _0x571adb=this['_tabs']['get'](_0x46d781);return _0x571adb?_0x571adb['button']:null;}['_showButton'](_0x5c047a){this['_getButton'](_0x5c047a)['show']();}['_hideButton'](_0x16dbaa){this['_getButton'](_0x16dbaa)['hide']();}['_setupButton'](_0x2259e7){const _0x43012a=new es(this['locale'],{'side':this['side']}),_0x14be47=this['buttonViews'];if(_0x43012a['set']({'label':_0x2259e7['label'],'icon':_0x2259e7['icon'],'tooltip':!0x0,'withText':!0x0}),_0x43012a['bind']('isOn')['to'](this,'activeTab',_0x5245e6=>_0x5245e6===_0x2259e7['id']),_0x43012a['bind']('side')['to'](this,'side'),_0x2259e7['order']){const _0x41d4e6=[...this['_tabs']]['reduce']((_0x5cef67,_0x5223a7)=>{const _0x47deea=_0x5223a7[0x0],{order:_0x4d2259}=_0x5223a7[0x1];return!_0x4d2259||_0x4d2259>_0x2259e7['order']?_0x5cef67:_0x4d2259>=_0x5cef67['order']?{'id':_0x47deea,'order':_0x4d2259}:_0x5cef67;},{'id':'','order':0x0}),_0x1ba8a5=_0x14be47['getIndex'](this['_getButton'](_0x41d4e6['id']));_0x14be47['add'](_0x43012a,_0x1ba8a5+0x1);}else _0x14be47['add'](_0x43012a);return _0x43012a['on']('execute',()=>{this['activateTab'](_0x2259e7['id']);}),_0x43012a;}}const ns=['overlay','sidebar','custom'],rs=['left','right'];class as extends ss{constructor(_0x5a2e46,_0x30c618={}){super(_0x5a2e46,_0x30c618),this['set']('type',_0x30c618['type']||'sidebar'),this['set']('side',_0x30c618['side']||'right'),this['set']('isVisible',_0x30c618['visibleByDefault']??!0x0);const _0x5298de=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-tabs',_0x5298de['if']('type','ck-ai-tabs__overlay',_0x17ee68=>'overlay'===_0x17ee68),_0x5298de['if']('type','ck-ai-tabs__sidebar',_0x321483=>'sidebar'===_0x321483),_0x5298de['if']('isVisible','ck-hidden',_0x3c208d=>!_0x3c208d)]}}),this['buttonViews']['on']('add',(_0x221e5e,_0x12d8b8)=>{_0x12d8b8['set']('withText',!0x1);});}}class os extends _0x5d2433{['view'];['container']=null;['showResizeButton']=!0x0;static get['pluginName'](){return'AITabs';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x5aca0d){super(_0x5aca0d);const _0x5dc85a=this['context']['config']['get']('ai.container');if(this['set']('side','right'),!_0x5dc85a)throw new ot('ai-tabs-configuration-not-found');if(void 0x0!==_0x5dc85a['showResizeButton']&&(this['showResizeButton']=_0x5dc85a['showResizeButton']),'sidebar'!==_0x5dc85a['type']&&'overlay'!==_0x5dc85a['type']||_0x5dc85a['side']&&(this['side']=_0x5dc85a['side']),'sidebar'===_0x5dc85a['type']){if(this['container']=_0x5dc85a['element'],this['set']('type','sidebar'),!this['container'])throw new ot('ai-tabs-sidebar-container-element-not-found');}else'overlay'===_0x5dc85a['type']?(this['container']=document['body'],this['set']('type','overlay')):(this['container']=null,this['set']('type','custom'));this['view']=new as(this['context']['locale'],{'side':this['side'],'type':this['type'],'visibleByDefault':void 0x0===_0x5dc85a['visibleByDefault']||_0x5dc85a['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 _0x53a714&&this['context']['ui']['focusTracker']['add'](this['view']['element']);}['switchType'](_0x92770e){if(_0x92770e&&this['type']!==_0x92770e){if(!ns['includes'](_0x92770e))throw new ot('ai-tabs-unsupported-ui-type');this['type']=_0x92770e;}}['switchSide'](_0x5a7c3f){if(_0x5a7c3f&&this['side']!==_0x5a7c3f){if(!rs['includes'](_0x5a7c3f))throw new ot('ai-tabs-unsupported-ui-side');this['side']=_0x5a7c3f;}}['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 hs extends _0x5d2433{['_apiUrl'];['_token'];['_decoder'];['_responseCache'];static get['requires'](){return[_0x4a1833];}static get['pluginName'](){return'AIConnector';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x1c9650){super(_0x1c9650),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 _0x10400e=this['context']['plugins']['get'](_0x4a1833);if(!_0x10400e['token'])throw new ot('ai-missing-token',this);this['_token']=_0x10400e['token'];}['startConversation'](_0x17e1d2,_0x386ced){const _0x33b39d=this['_sendApiRequest']('/conversations','POST',{'id':_0x17e1d2,'group':_0x386ced});return{'getConversation':async()=>(await _0x33b39d['request'])['json'](),'abortController':_0x33b39d['abortController']};}['queryAssistant']({message:_0x44091d,conversationId:_0x45e7eb,parts:_0x424839,capabilities:_0x45603d,model:_0x43f0be,attributes:_0x5b5171}){const _0x5a0997={'prompt':_0x44091d,'content':_0x424839,'model':_0x43f0be,..._0x45603d&&{'capabilities':_0x45603d},..._0x5b5171&&{'attributes':_0x5b5171}},_0x124052=this['_sendApiRequest']('/conversations/'+_0x45e7eb+'/messages','POST',_0x5a0997);return{'getStream':async()=>{const _0x4ff090=(await _0x124052['request'])['body'];return this['_getStreamReader'](_0x4ff090);},'abortController':_0x124052['abortController']};}['executeCustomAction']({content:_0x386998,message:_0x2a136b,model:_0x5c8a07,outputFormat:_0x466317}){const _0x171825={'content':[{'type':'text','content':_0x386998}],'prompt':_0x2a136b,'model':_0x5c8a07,'outputFormat':_0x466317},_0x20f2e7=this['_sendApiRequest']('/actions/custom/calls','POST',_0x171825);return{'getStream':async()=>{const _0x417660=(await _0x20f2e7['request'])['body'];return this['_getStreamReader'](_0x417660);},'abortController':_0x20f2e7['abortController']};}['executeAction']({actionName:_0x530993,content:_0x31b0ed,args:_0x2eacb1}){const _0xb71b83={'content':[{'type':'text','content':_0x31b0ed}],'args':_0x2eacb1},_0x480f3a=this['_sendApiRequest']('/actions/system/'+_0x530993+'/calls','POST',_0xb71b83);return{'getStream':async()=>{const _0xef0a07=(await _0x480f3a['request'])['body'];return this['_getStreamReader'](_0xef0a07);},'abortController':_0x480f3a['abortController']};}['uploadFile'](_0x593810,_0x20e794,_0x10e92c){const _0x531981=new FormData();_0x531981['append']('file',_0x20e794,_0x20e794['name']),_0x10e92c&&_0x531981['append']('attributes',JSON['stringify'](_0x10e92c));const _0xd37a80=this['_sendApiRequest']('/conversations/'+_0x593810+'/files','POST',_0x531981);return{'getId':async()=>(await _0xd37a80['request'])['json'](),'abortController':_0xd37a80['abortController']};}['fetchDocument'](_0x213247,_0x33c72e){const _0x441c09=this['_sendApiRequest']('/conversations/'+_0x213247+'/documents/'+_0x33c72e,'GET');return{'getDocument':async()=>(await _0x441c09['request'])['json'](),'abortController':_0x441c09['abortController']};}['uploadDocument'](_0x4b9a47,_0x52d35c,_0x418336){const _0x587397={'content':_0x52d35c};_0x418336&&(_0x587397['attributes']=_0x418336);const _0x39fd9e=this['_sendApiRequest']('/conversations/'+_0x4b9a47+'/documents','POST',_0x587397);return{'getId':async()=>(await _0x39fd9e['request'])['json'](),'abortController':_0x39fd9e['abortController']};}['fetchConversations'](_0x37e651,_0x1dd285={}){const _0x9028b7=new URLSearchParams();_0x9028b7['append']('group',_0x37e651),_0x9028b7['append']('excludeEmpty',!0x1!==_0x1dd285['excludeEmpty']?'true':'false'),_0x9028b7['append']('limit',_0x1dd285['limit']?_0x1dd285['limit']['toString']():'100'),_0x9028b7['append']('sortBy',_0x1dd285['sortBy']?_0x1dd285['sortBy']:'createdAt'),_0x9028b7['append']('order',_0x1dd285['order']?_0x1dd285['order']:'desc');const _0x2398e8=this['_sendApiRequest']('/conversations?'+_0x9028b7['toString'](),'GET');return{'getConversations':async()=>{const _0x4f19d3=await _0x2398e8['request'];return(await _0x4f19d3['json']())['items'];},'abortController':_0x2398e8['abortController']};}['deleteConversation'](_0x23dd90){const _0x2e74d2=this['_sendApiRequest']('/conversations/'+_0x23dd90,'DELETE');return{'execute':async()=>{await _0x2e74d2['request'];},'abortController':_0x2e74d2['abortController']};}['updateConversation'](_0xf68276,_0x8d4d67){const _0x49b5f2=this['_sendApiRequest']('/conversations/'+_0xf68276,'PATCH',_0x8d4d67);return{'getResult':async()=>(await _0x49b5f2['request'],_0x8d4d67),'abortController':_0x49b5f2['abortController']};}['fetchConversation'](_0x468d0c){const _0x3e365d=this['_sendApiRequest']('/conversations/'+_0x468d0c,'GET');return{'getConversation':async()=>(await _0x3e365d['request'])['json'](),'abortController':_0x3e365d['abortController']};}['fetchConversationMessages'](_0x10e557){const _0x2ab00a=this['_sendApiRequest']('/conversations/'+_0x10e557+'/messages','GET');return{'getMessages':async()=>{const _0x285428=await _0x2ab00a['request'];return(await _0x285428['json']())['items'];},'abortController':_0x2ab00a['abortController']};}['uploadUrl'](_0x179a33,_0x76a758,_0x18e69e){const _0x1a9dff=this['_sendApiRequest']('/conversations/'+_0x179a33+'/web-resources','POST',{'url':_0x76a758,'attributes':_0x18e69e});return{'getId':async()=>(await _0x1a9dff['request'])['json'](),'abortController':_0x1a9dff['abortController']};}['getModels'](_0x5ecc86='en'){const _0x435895=new URLSearchParams();_0x435895['append']('language',_0x5ecc86);const _0x5c1484='/models/1?'+_0x435895['toString'](),_0xa6f3ec=this['_sendApiRequest'](_0x5c1484,'GET',void 0x0,!0x0);return{'list':async()=>await(await _0xa6f3ec['request'])['json'](),'abortController':_0xa6f3ec['abortController']};}['deleteFile'](_0x76b4ba,_0x2ef1f1){const _0x285655=this['_sendApiRequest']('/conversations/'+_0x76b4ba+'/files/'+_0x2ef1f1,'DELETE');return{'execute':async()=>{await _0x285655['request'];},'abortController':_0x285655['abortController']};}['deleteDocument'](_0x162a7e,_0x29de6b){const _0x16dc2d=this['_sendApiRequest']('/conversations/'+_0x162a7e+'/documents/'+_0x29de6b,'DELETE');return{'execute':async()=>{await _0x16dc2d['request'];},'abortController':_0x16dc2d['abortController']};}['deleteWebResource'](_0x1fb888,_0x295b24){const _0x50cc15=this['_sendApiRequest']('/conversations/'+_0x1fb888+'/web-resources/'+_0x295b24,'DELETE');return{'execute':async()=>{await _0x50cc15['request'];},'abortController':_0x50cc15['abortController']};}['callSystemReview']({reviewName:_0x134974,content:_0x1d5c9c,args:_0x30df0a}){const _0x483183=this['_sendApiRequest']('/reviews/system/'+_0x134974+'/calls','POST',{'content':[{'type':'text','content':_0x1d5c9c}],'args':_0x30df0a});return{'getStream':async()=>{const _0x17751e=(await _0x483183['request'])['body'];return this['_getStreamReader'](_0x17751e);},'abortController':_0x483183['abortController']};}['callCustomReview']({content:_0x2e38ad,prompt:_0x306c87,model:_0x25e022}){const _0x4cf0c2=this['_sendApiRequest']('/reviews/custom/calls','POST',{'content':[{'type':'text','content':_0x2e38ad}],'prompt':_0x306c87,'model':_0x25e022});return{'getStream':async()=>{const _0x5e1b09=(await _0x4cf0c2['request'])['body'];return this['_getStreamReader'](_0x5e1b09);},'abortController':_0x4cf0c2['abortController']};}['upsertAIChatRating'](_0xbdb1c8,_0x2c3fc2,_0xf4eb64){const _0x1501fb=this['_sendApiRequest']('/conversations/'+_0xbdb1c8+'/messages/'+_0x2c3fc2+'/ratings','PUT',{'positiveCount':_0xf4eb64['positiveCount'],'totalCount':_0xf4eb64['totalCount'],'modificationId':_0xf4eb64['modificationId']});return{'execute':async()=>{await _0x1501fb['request'];},'abortController':_0x1501fb['abortController']};}['upsertAIActionRating'](_0x2979d7,_0x15d916,_0x4da3e6){const _0x2ee604=this['_sendApiRequest']('/actions/system/'+_0x2979d7+'/calls/'+_0x15d916+'/ratings','PUT',{'positiveCount':_0x4da3e6['positiveCount'],'totalCount':_0x4da3e6['totalCount']});return{'execute':async()=>{await _0x2ee604['request'];},'abortController':_0x2ee604['abortController']};}['upsertCustomAIActionRating'](_0x51a68c,_0x38d83d){const _0x254391=this['_sendApiRequest']('/actions/custom/calls/'+_0x51a68c+'/ratings','PUT',{'positiveCount':_0x38d83d['positiveCount'],'totalCount':_0x38d83d['totalCount']});return{'execute':async()=>{await _0x254391['request'];},'abortController':_0x254391['abortController']};}['upsertAIReviewRating'](_0x18d7fb,_0xaf6d72,_0x1f9343,_0x4f638a){const _0x58dd8e=this['_sendApiRequest']('/reviews/system/'+_0x18d7fb+'/calls/'+_0xaf6d72+'/ratings','PUT',{'positiveCount':_0x1f9343['positiveCount'],'totalCount':_0x1f9343['totalCount'],'dataId':_0x4f638a});return{'execute':async()=>{await _0x58dd8e['request'];},'abortController':_0x58dd8e['abortController']};}['upsertCustomAIReviewRating'](_0x5c989b,_0x2bb192,_0x2c9335){const _0x51bbe8=this['_sendApiRequest']('/reviews/custom/calls/'+_0x5c989b+'/ratings','PUT',{'positiveCount':_0x2bb192['positiveCount'],'totalCount':_0x2bb192['totalCount'],'dataId':_0x2c9335});return{'execute':async()=>{await _0x51bbe8['request'];},'abortController':_0x51bbe8['abortController']};}['_sendApiRequest'](_0x45e97b,_0x30d141,_0x2f47fa,_0x351944=!0x1){const _0x97c2a5=new AbortController(),_0x1da608=_0x351944?_0x30d141+':'+_0x45e97b:null;if(_0x1da608){const _0xc0acd7=this['_responseCache']['get'](_0x1da608);if(_0xc0acd7)return{'request':_0xc0acd7['then'](_0x41fd72=>_0x41fd72['clone']()),'abortController':_0x97c2a5};}const _0x26bcd3=_0x2f47fa instanceof FormData,_0x26780b={'Authorization':'Bearer\x20'+this['_token']?.['value']};_0x2f47fa&&!_0x26bcd3&&(_0x26780b['Content-Type']='application/json');const _0x7db248={'method':_0x30d141,'headers':_0x26780b,'signal':_0x97c2a5['signal']};_0x2f47fa&&(_0x7db248['body']=_0x26bcd3?_0x2f47fa:JSON['stringify'](_0x2f47fa));const _0x4efcca=fetch(''+this['_apiUrl']+_0x45e97b,_0x7db248)['catch'](_0x121a23=>{_0x1da608&&this['_responseCache']['delete'](_0x1da608),this['_handleError'](_0x121a23);})['then'](_0x4d6779=>_0x4d6779['ok']?_0x4d6779:_0x4d6779['json']()['then'](_0xc82870=>{throw _0x1da608&&this['_responseCache']['delete'](_0x1da608),{'url':this['_apiUrl'],'path':_0x45e97b,'method':_0x30d141,'body':_0x2f47fa,'status':(_0x4d6779||{})['status'],'statusText':(_0x4d6779||{})['statusText'],'code':_0xc82870['code'],'message':_0xc82870['message'],'traceId':_0xc82870['traceId']};}));return _0x1da608&&this['_responseCache']['set'](_0x1da608,_0x4efcca['then'](_0x45b383=>_0x45b383['clone']())),{'request':_0x4efcca,'abortController':_0x97c2a5};}async*['_getStreamReader'](_0x280176){const _0x2f814d=[],_0x1b3b2e=_0x280176['getReader'](),_0x4eabae=_0x2ed944({'onError':_0x58957f=>{this['_handleError'](_0x58957f);},'onEvent':_0x10aeba=>{_0x10aeba['data']=JSON['parse'](_0x10aeba['data']),_0x2f814d['push'](_0x10aeba);}});try{let _0x463cbd=!0x1;for(;!_0x463cbd;){const {done:_0x3476ff,value:_0x5e7bef}=await _0x1b3b2e['read']();_0x3476ff&&(_0x463cbd=!0x0),_0x4eabae['feed'](this['_decoder']['decode'](_0x5e7bef,{'stream':!0x0})),yield*_0x2f814d,_0x2f814d['length']=0x0;}}catch(_0x5ebebb){this['_handleError'](_0x5ebebb);}finally{_0x1b3b2e['releaseLock'](),_0x4eabae['reset']();}}['_handleError'](_0x2e7eb6){if(_0x2e7eb6 instanceof ot)throw _0x2e7eb6;if(_0x2e7eb6 instanceof Error&&'AbortError'===_0x2e7eb6['name'])throw new ot('ai-request-aborted',this,{'originalError':_0x2e7eb6});throw new ot('ai-request-failed',this,{'originalError':_0x2e7eb6});}}function cs(_0x5064af,_0x4ddacd,_0x4bd9ab){const t=_0x5064af['t'];switch(_0x4ddacd){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'},_0x4bd9ab);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.'},_0x4bd9ab);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.'},_0x4bd9ab);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.'},_0x4bd9ab);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'},_0x4bd9ab);case'AI_CHAT_SUGGESTION_ACTION_SUGGEST':return t({'id':'AI_CHAT_SUGGESTION_ACTION_SUGGEST','string':'Suggest'},_0x4bd9ab);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'},_0x4bd9ab);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.'},_0x4bd9ab);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.'},_0x4bd9ab);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.'},_0x4bd9ab);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.'},_0x4bd9ab);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'},_0x4bd9ab);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.'},_0x4bd9ab);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 _0x4ddacd;}}const ls='ck-ai-button-primary',us='ck-ai-button-secondary',ds='ck-ai-button-tertiary';function _s(_0x1a7b49,_0x4a70e3){const _0x4919bb=new kt(_0x1a7b49),_0x53b995=cs(_0x1a7b49,'AI_TABS_LABEL_MINIMIZE'),_0x3c28e0=cs(_0x1a7b49,'AI_TABS_LABEL_MAXIMIZE');return _0x4919bb['set']({'withText':!0x1,'icon':_0x56c346,'tooltip':!0x0,'class':'ck-ai-tabs__resize\x20'+ds}),_0x4919bb['bind']('label')['to'](_0x4a70e3,'isMaximized',_0x2abd29=>_0x2abd29?_0x53b995:_0x3c28e0),_0x4919bb['bind']('icon')['to'](_0x4a70e3,'isMaximized',_0x51a136=>_0x51a136?_0x3c1bcb:_0x56c346),_0x4919bb['bind']('isOn')['to'](_0x4a70e3,'isMaximized'),_0x4919bb['on']('execute',()=>{_0x4a70e3['fire']('resizeTabs');}),_0x4919bb;}function As(_0x5bc1d7){return _0x23ddd4(_0x5bc1d7);}function gs(_0x286c39){return _0x173a3d(_0x286c39);}function Is(_0x7ddcac,_0x276871,_0x48043a){const _0x68c821=null!==_0x276871?_0xb17cec=>_0xb17cec['attribs'][_0x7ddcac]===_0x276871:_0x7894ea=>Boolean(_0x7894ea['attribs'][_0x7ddcac]);return _0x5133a0(_0x2228b0=>_0x5c66ff(_0x2228b0)&&_0x68c821(_0x2228b0),_0x48043a);}function Es(_0x546ecb,_0xee3831,_0x418a8a){const _0x1c4d4d=null!==_0xee3831?_0x207857=>_0x207857['attribs'][_0x546ecb]===_0xee3831:_0x1f9dab=>Boolean(_0x1f9dab['attribs'][_0x546ecb]);return _0x1a6a3d(_0x583c69=>_0x5c66ff(_0x583c69)&&_0x1c4d4d(_0x583c69),_0x418a8a);}function ps(_0x322cbd,_0x1517a2){return _0x322cbd&&_0x5c66ff(_0x322cbd)?_0x322cbd['attribs'][_0x1517a2]:null;}function Ts(_0x1f7692,_0x409bed,_0x931b2b){_0x5c66ff(_0x1f7692)&&(null===_0x931b2b?delete _0x1f7692['attribs'][_0x409bed]:_0x1f7692['attribs'][_0x409bed]=_0x931b2b);}function ms(_0x1eaadf,_0x3ee59f,_0x2ae6b3){const _0x372fe0=_0x3ee59f['cloneNode'](!0x0);'beforebegin'===_0x2ae6b3?_0x59bf1a(_0x1eaadf,_0x372fe0):'afterbegin'===_0x2ae6b3?_0x289acd(_0x1eaadf,_0x372fe0):'beforeend'===_0x2ae6b3?_0xebd7a6(_0x1eaadf,_0x372fe0):'afterend'===_0x2ae6b3&&_0x1c657a(_0x1eaadf,_0x372fe0);}function Cs(_0x3a1bda){const _0x4b5d1b=[];let _0x5d7464=_0x3a1bda;for(;_0x5d7464;)_0x5d7464=_0x271f3a(_0x5d7464),_0x5d7464&&_0x4b5d1b['push'](_0x5d7464);return _0x4b5d1b;}function ws(_0x2f9626){return _0x2f9626['replace'](/^\s+/gm,'')['replace'](/\s+$/gm,'')['replace'](/\n*/g,'')['replace'](/\s+/g,'\x20')['replace'](/>\s*</g,'><');}function fs(_0x40bcd4){let _0x498621=0x0;for(;_0x40bcd4['parentNode'];)_0x40bcd4=_0x40bcd4['parentNode'],_0x498621++;return _0x498621;}function Ss(_0x55f602){const _0x187bad=[];let _0x5ca2bb=_0x55f602['nextSibling'];for(;_0x5ca2bb;)_0x187bad['push'](_0x5ca2bb),_0x5ca2bb=_0x5ca2bb['nextSibling'];_0x187bad['forEach'](_0x871079=>{_0xb6b4fd(_0x871079);});}class bs extends/* #__PURE__ -- @preserve */
25
- ht(){['_m2html'];constructor(){super();const _0x11d969=Object['entries'](_0x13e112),_0x16a71e=_0x11d969['findIndex'](([_0x1a8aa3])=>'rehypeDomRaw'===_0x1a8aa3);if(-0x1===_0x16a71e)throw new ot('ai-response-parser-unable-to-set-up-parser');_0x11d969['splice'](_0x16a71e+0x1,0x0,['rehypeSanitize',_0x277de2]),this['_m2html']=new _0x5ac1fc({'plugins':Object['fromEntries'](_0x11d969)});}['convertMarkdownToHTML'](_0x3df2fa){const _0x4fa968=this['_m2html']['parse'](_0x3df2fa);return this['parseAndNormalizeHTML'](_0x4fa968);}['parseAndNormalizeHTML'](_0x36efc1){return this['_parseHTML'](_0x36efc1);}['_parseHTML'](_0x37da7b){const _0x884562=As('<dummy>'+_0x37da7b['replace'](/^\t+/gm,'\x20')['replace'](/\n*/g,'')['replace'](/\s+/g,'\x20')['replace'](/<[^>]*?$/g,'')+'</dummy>');return _0x884562['children']=_0x884562['children'][0x0]['children'],_0x884562;}}class Rs extends/* #__PURE__ -- @preserve */
26
- ht(){['_generateUid'];['_touchedNodesState']={'newIds':[],'modifiedIds':[],'removedIds':[],'invalidIds':[],'lastTouchedId':null};['_existingDataIds']=new Set();constructor(_0x36d7d4){super(),this['_generateUid']=_0x36d7d4||at;}['merge'](_0x228b12,_0x3ee3ed,_0x351447){const _0x277b5e=_0x228b12['cloneNode'](!0x0);if(0x0===_0x3ee3ed['childNodes']['length']){const _0x2c9dcf=[];return Es('data-id','new-element',_0x277b5e)['forEach'](_0x10cf76=>{const _0x1d1df4=this['_generateUid']();Ts(_0x10cf76,'data-id',_0x1d1df4),_0x2c9dcf['push'](_0x1d1df4);}),this['_removeSpecialComments'](_0x277b5e),{'parsedContent':_0x277b5e,'newNodeIds':_0x2c9dcf,'modifiedNodeIds':[],'removedNodeIds':[]};}_0x351447&&_0x351447['markUnstableElements']&&this['_markLastTagElementUnstable'](_0x277b5e),this['_touchedNodesState']['newIds']=[],this['_touchedNodesState']['modifiedIds']=[],this['_touchedNodesState']['removedIds']=[],this['_touchedNodesState']['invalidIds']=[],this['_touchedNodesState']['lastTouchedId']=null,this['_existingDataIds']=new Set(Es('data-id',null,_0x3ee3ed)['map'](_0x1c1ca5=>ps(_0x1c1ca5,'data-id'))['filter'](_0x13f501=>!!_0x13f501));let _0x593d64=-0x1,_0x79037a=!0x1;const _0x2b37e6=_0x277b5e['childNodes'],_0x7a8f37=Array['from'](_0x2b37e6)['filter'](_0x1389ed=>!(0x3===_0x1389ed['nodeType']&&''===gs(_0x1389ed)['trim']())),_0x33e2bc=_0x7a8f37['length'];for(let _0x130fda=0x0;_0x130fda<_0x33e2bc;_0x130fda++){const _0xf8b848=_0x7a8f37[_0x130fda],_0x274b59=_0x7a8f37[_0x130fda+0x1];if(this['_isNewNode'](_0xf8b848)){if(-0x1===_0x593d64&&(_0x593d64=_0x130fda),this['_markWrappedElements'](_0xf8b848),!this['_isNewNode'](_0x274b59)){const [_0x3002f3,_0x5d0c3e]=this['_findReferenceNode'](_0xf8b848,_0x79037a,_0x3ee3ed);if(_0x3002f3){const _0x27f465=Array['from'](_0x7a8f37)['slice'](_0x593d64,_0x130fda+0x1);this['_insertNodes'](_0x3002f3,_0x27f465,_0x5d0c3e),_0x593d64=-0x1;}}}else{if(this['_isExistingContentComment'](_0xf8b848))_0x79037a=!0x0;else{if(this['_isExistingNode'](_0xf8b848)){const _0xa16e32=ps(_0xf8b848,'data-id');if(_0xa16e32&&this['_existingDataIds']['has'](_0xa16e32)){const _0x26feb9=Is('data-id',_0xa16e32,_0x3ee3ed);this['_replaceNode'](_0x26feb9,_0xf8b848);}if(this['_touchedNodesState']['removedIds']['includes'](_0xa16e32)){const _0x29b982=this['_touchedNodesState']['removedIds']['indexOf'](_0xa16e32);this['_touchedNodesState']['removedIds']['splice'](_0x29b982,0x1);}}else{if(this['_isDelNode'](_0xf8b848)){const _0x584c77=ps(_0xf8b848,'data-id');this['_touchedNodesState']['modifiedIds']['includes'](_0x584c77)||this['_storeDeletedElementIds'](_0xf8b848);}}}}}for(const _0xb83ba3 of this['_touchedNodesState']['removedIds']){const _0x241410=Is('data-id',_0xb83ba3,_0x3ee3ed);if(_0x241410){if(_0x351447&&_0x351447['replaceRemovedWith']){this['_touchedNodesState']['lastTouchedId']=_0xb83ba3;const _0x3ab595=_0x351447['replaceRemovedWith']['cloneNode'](!0x0);Ts(_0x3ab595,'data-id',_0xb83ba3),Ts(_0x3ab595,'data-removed','true'),_0x563d0d(_0x241410,_0x3ab595);}else _0xb6b4fd(_0x241410);}}if(Es('data-wrapped-id',null,_0x3ee3ed)['forEach'](_0x1c0f2b=>{const _0x1258e0=Is('data-id',ps(_0x1c0f2b,'data-wrapped-id'),_0x3ee3ed);var _0x556de6,_0x594a31;_0x1258e0&&(_0x594a31=_0x1c0f2b,_0xb6b4fd(_0x556de6=_0x1258e0),_0x563d0d(_0x594a31,_0x556de6));}),Es('data-id','new-element',_0x3ee3ed)['forEach'](_0x33395e=>{const _0x431a3f=this['_getUid'](_0x33395e);Ts(_0x33395e,'data-id',_0x431a3f),this['_touchedNodesState']['newIds']['push'](_0x431a3f);}),this['_removeSpecialComments'](_0x3ee3ed),_0x351447&&_0x351447['markUnstableElements']&&this['_markUnstableElements'](_0x3ee3ed,_0x351447['markUnstableElementsDepth']||0x0),_0x351447&&_0x351447['cutAfterLastChange']&&this['_touchedNodesState']['lastTouchedId']){let _0x4f34d9=Is('data-id',this['_touchedNodesState']['lastTouchedId'],_0x3ee3ed);for(;_0x4f34d9;)Ss(_0x4f34d9),_0x4f34d9=_0x4f34d9['parentNode'];}return{'parsedContent':_0x3ee3ed,'newNodeIds':this['_touchedNodesState']['newIds'],'modifiedNodeIds':this['_touchedNodesState']['modifiedIds'],'removedNodeIds':this['_touchedNodesState']['removedIds']};}['_insertNodes'](_0xff425c,_0x1da5ca,_0x57f650){for(const _0x433f42 of _0x1da5ca){const _0x354f25=this['_getUid'](_0x433f42);Ts(_0x433f42,'data-id',_0x354f25),this['_touchedNodesState']['newIds']['push'](_0x354f25),this['_touchedNodesState']['lastTouchedId']=_0x354f25;}const _0x564207='afterbegin'===_0x57f650||'afterend'===_0x57f650?_0x1da5ca['reverse']():_0x1da5ca;for(const _0x50a9c1 of _0x564207)ms(_0xff425c,_0x50a9c1,_0x57f650);}['_replaceNode'](_0x2e2b61,_0x508fd6){if(!_0x2e2b61)return;if(_0x1945b5=_0x508fd6,ws(gs(_0x2e2b61))===ws(gs(_0x1945b5)))return;var _0x1945b5;const _0x5d623e=this['_getUid'](_0x2e2b61);Ts(_0x508fd6,'data-id',_0x5d623e),this['_touchedNodesState']['modifiedIds']['push'](_0x5d623e),this['_touchedNodesState']['lastTouchedId']=_0x5d623e,_0x563d0d(_0x2e2b61,_0x508fd6['cloneNode'](!0x0));}['_findReferenceNode'](_0x304498,_0x5c91e0,_0x2b58f6){const _0x2fa08b=this['_findPrevElementWithDataId'](_0x304498,!0x1);if(_0x2fa08b){const _0x8e6d99=this['_getNodeDataId'](_0x2fa08b),_0x26bab5=Is('data-id',_0x8e6d99,_0x2b58f6);if(_0x26bab5)return[_0x26bab5,'afterend'];this['_touchedNodesState']['invalidIds']['push'](_0x8e6d99);}const _0x4da9d0=this['_findNextElementWithDataId'](_0x304498,!0x1);if(_0x4da9d0){const _0x316dcf=this['_getNodeDataId'](_0x4da9d0),_0x3a0b81=Is('data-id',_0x316dcf,_0x2b58f6);if(_0x3a0b81)return[_0x3a0b81,'beforebegin'];this['_touchedNodesState']['invalidIds']['push'](_0x316dcf);}return _0x5c91e0?_0x304498['nextSibling']?this['_findFallbackReferenceNode'](_0x304498,_0x2b58f6):[_0x2b58f6['childNodes'][_0x2b58f6['childNodes']['length']-0x1],'afterend']:[_0x2b58f6['childNodes'][0x0],'beforebegin'];}['_findFallbackReferenceNode'](_0x597c56,_0x2212ac){const _0x2942d3=[],_0x2fafac=this['_findPrevElementWithDataId'](_0x597c56,!0x0);if(_0x2fafac){const _0x29931a=Is('data-id',this['_getNodeDataId'](_0x2fafac),_0x2212ac);_0x29931a&&_0x2942d3['push']([_0x29931a,'afterend']);}const _0x472648=this['_findNextElementWithDataId'](_0x597c56,!0x0);if(_0x472648){const _0x298830=Is('data-id',this['_getNodeDataId'](_0x472648),_0x2212ac);_0x298830&&_0x2942d3['push']([_0x298830,'beforebegin']);}if(_0x2942d3['length']>0x1)return fs(_0x2942d3[0x0][0x0])<=fs(_0x2942d3[0x1][0x0])?_0x2942d3[0x0]:_0x2942d3[0x1];return 0x1===_0x2942d3['length']?_0x2942d3[0x0]:[_0x2212ac['lastChild'],'afterend'];}['_findNextElementWithDataId'](_0x45167f,_0x356d82){let _0x1c4213=_0x45167f['nextSibling'],_0x4d8408=null,_0x31ce4e=!0x1;for(;_0x1c4213;){if(_0x4ed53a(_0x1c4213)){if(this['_isDelNode'](_0x1c4213)&&(_0x4d8408=_0x1c4213),this['_isExistingContentComment'](_0x1c4213)&&_0x356d82&&!_0x31ce4e){_0x31ce4e=!0x0,_0x1c4213=_0x1c4213['nextSibling'];continue;}break;}const _0x16be88=ps(_0x1c4213,'data-id');if(_0x16be88&&'new-element'!==_0x16be88&&this['_existingDataIds']['has'](_0x16be88)){_0x4d8408=_0x1c4213;break;}_0x1c4213=_0x1c4213['nextSibling'];}return _0x4d8408;}['_findPrevElementWithDataId'](_0x46a21f,_0x2d5e28){let _0xf214fa=_0x46a21f['previousSibling'],_0x2892fc=null,_0x1c1901=!0x1;for(;_0xf214fa;){if(_0x4ed53a(_0xf214fa)){if(this['_isDelNode'](_0xf214fa)&&(_0x2892fc=_0xf214fa),this['_isExistingContentComment'](_0xf214fa)&&_0x2d5e28&&!_0x1c1901){_0x1c1901=!0x0,_0xf214fa=_0xf214fa['previousSibling'];continue;}break;}const _0x55899c=ps(_0xf214fa,'data-id');if(_0x55899c&&'new-element'!==_0x55899c&&this['_existingDataIds']['has'](_0x55899c)){_0x2892fc=_0xf214fa;break;}_0xf214fa=_0xf214fa['previousSibling'];}return _0x2892fc;}['_markWrappedElements'](_0x493e4e){_0x5c66ff(_0x493e4e)&&Es('data-id',null,_0x493e4e)['forEach'](_0x356a61=>{this['_isExistingNode'](_0x356a61)&&!this['_hasWrappedParent'](_0x356a61)&&(Ts(_0x356a61,'data-wrapped-id',ps(_0x356a61,'data-id')),Ts(_0x356a61,'data-id',null));});}['_getNodeDataId'](_0x438697){if(!_0x438697)return null;if(_0x5c66ff(_0x438697))return ps(_0x438697,'data-id');if(_0x4ed53a(_0x438697)){const _0x4f70c0=gs(_0x438697)['match'](/removed[\s*-]data-id="([^"]+)"/);if(_0x4f70c0&&_0x4f70c0[0x1])return _0x4f70c0[0x1];}return null;}['_storeDeletedElementIds'](_0x42a359){if(_0x4ed53a(_0x42a359)){const _0x10252c=gs(_0x42a359)['match'](/removed[\s*-]data-id="([^"]+)"/);_0x10252c&&_0x10252c[0x1]&&this['_touchedNodesState']['removedIds']['push'](_0x10252c[0x1]);}}['_getUid'](_0x15ea92){return this['_isExistingNode'](_0x15ea92)?ps(_0x15ea92,'data-id'):this['_generateUid']();}['_removeSpecialComments'](_0xf8d540){(function(_0x2b34cb){return _0x2c84c3(_0x5bb256=>_0x4ed53a(_0x5bb256),_0x2b34cb,!0x0,0x1/0x0);}(_0xf8d540)['filter'](_0x59475a=>this['_isDelNode'](_0x59475a)||this['_isExistingContentComment'](_0x59475a))['forEach'](_0x228101=>{_0xb6b4fd(_0x228101);}));}['_markLastTagElementUnstable'](_0x297478){const _0x3e3d3e=_0x297478['childNodes'],_0x41146b=_0x3e3d3e[_0x3e3d3e['length']-0x1];_0x41146b&&_0x5c66ff(_0x41146b)&&Ts(_0x41146b,'data-unstable','true');}['_markUnstableElements'](_0x336c43,_0x16a412){const _0x47aa1c=Is('data-unstable','true',_0x336c43);if(!_0x47aa1c)return;const _0x2ddf5a=Cs(_0x47aa1c)['slice'](0x0,-0x1),_0x362103=_0x2ddf5a['length'];let _0x2d5081=_0x47aa1c;if(_0x362103>_0x16a412){let _0x49df7d=_0x362103,_0x495d60=null;for(;_0x49df7d>_0x16a412&&_0x49df7d>=0x0;)_0x49df7d--,_0x495d60=_0x2ddf5a[_0x49df7d];_0x495d60&&(_0x2d5081=_0x495d60,Ts(_0x47aa1c,'data-unstable',null),Ts(_0x495d60,'data-unstable','true'));}else{if(_0x362103<_0x16a412){let _0x59bfee=_0x362103,_0x1fbbf4=_0x47aa1c;for(;_0x59bfee<_0x16a412;){const _0x3afe16=_0x1fbbf4['childNodes']['filter'](_0x49fe4c=>_0x5c66ff(_0x49fe4c));if(0x0===_0x3afe16['length'])break;_0x59bfee++,_0x1fbbf4=_0x3afe16[_0x3afe16['length']-0x1];}_0x1fbbf4&&(_0x2d5081=_0x1fbbf4,Ts(_0x47aa1c,'data-unstable',null),Ts(_0x1fbbf4,'data-unstable','true'));}}let _0x17150e=_0x2d5081;for(;_0x17150e;){for(;_0x17150e['nextSibling'];)_0x17150e=_0x17150e['nextSibling'],_0x5c66ff(_0x17150e)&&Ts(_0x17150e,'data-unstable','true');_0x17150e=_0x17150e['parentNode'];}}['_isNewNode'](_0x27cce0){return Boolean('new-element'===ps(_0x27cce0,'data-id'));}['_isExistingNode'](_0x1b30f7){return Boolean((ps(_0x1b30f7,'data-id')||'')['length']>0x0&&'new-element'!==ps(_0x1b30f7,'data-id'));}['_isDelNode'](_0xc861c4){return!!_0xc861c4&&Boolean(_0x4ed53a(_0xc861c4)&&gs(_0xc861c4)['match'](/removed[\s*-]data-id="[^"]+"/));}['_hasWrappedParent'](_0x92f93c){let _0x4fc56f=_0x92f93c['parentNode'];for(;_0x4fc56f;){if(ps(_0x4fc56f,'data-wrapped-id'))return!0x0;_0x4fc56f=_0x4fc56f['parentNode'];}return!0x1;}['_isExistingContentComment'](_0x4033a1){return Boolean(_0x4ed53a(_0x4033a1)&&gs(_0x4033a1)['match'](/\s*existing[\s*-](content|document)\s*/g));}}function Os({editor:_0x551616,changeGroups:_0x1372f7,documentContextContent:_0x7fdaf2,showDiff:_0x1d8950,trimUnchanged:_0x5c8589=!0x0}){return _0x1372f7['map'](_0x48f772=>{const _0x5a34b3=new _0x10a8a7([]),_0x58a2cd=new _0x10a8a7([]);for(const _0x201cb2 of _0x48f772['changes'])if(_0x1d8950&&'removed'==_0x201cb2['type']||_0x58a2cd['children']['push'](_0x201cb2['node']['cloneNode'](!0x0)),'new'!=_0x201cb2['type']&&(_0x1d8950||'removed'!=_0x201cb2['type'])){const _0x5e7745=_0x5133a0(_0xcec114=>ps(_0xcec114,'data-id')==_0x201cb2['id'],_0x7fdaf2,!0x0);_0x5e7745&&_0x5a34b3['children']['push'](_0x5e7745['cloneNode'](!0x0));}const {content:_0x53539f,hasChanges:_0x4ddded}=function(_0x42ed54,_0x2c82fd,_0x4f9afa,_0x5c0cf6,_0x288c90=!0x0){const _0xae7f64=_0x42ed54['plugins']['get']('DocumentCompare'),_0x13031c=gs(_0x2c82fd),_0x4c2d17=gs(_0x4f9afa),_0x159808=_0x42ed54['data']['parse'](_0x13031c,'$root'),_0x59734f=_0x42ed54['model']['createPositionAt'](_0x159808,0x0),_0x4514c6=_0xae7f64['getDiff'](_0x13031c,_0x4c2d17,{'anchor':_0x59734f,'markDeletions':_0x5c0cf6}),_0x1ad3b3=_0x4514c6['getOperations']();if(0x0==_0x1ad3b3['length'])return{'content':_0x2c82fd['cloneNode'](!0x0),'hasChanges':!0x1};_0x5c0cf6?function(_0x52cd23,_0x4bf544,_0x3d7efc){if(0x0==_0x52cd23['length'])return;const _0x750309=_0x3d7efc['plugins']['get']('DocumentCompare'),_0x341514=_0x3d7efc['plugins']['get']('SuggestionsConversion');_0x3d7efc['model']['change'](_0x29d648=>{const _0x3ee117=new Set();for(let _0x1f63b5=0x0;_0x1f63b5<_0x52cd23['length'];_0x1f63b5++){const _0x47809c=_0x52cd23[_0x1f63b5];if(_0x47809c['baseVersion']=null,_0x47809c['isDocumentOperation']=!0x1,_0x750309['isMarkedRemoveOperation'](_0x47809c)){const _0x229bcf=_0x151a98(_0x47809c['newRange'],_0x3d7efc['model']),_0x23463c='suggestion:deletion:'+at()+':$aiSuggestion';_0x4bf544['markers']['set'](_0x23463c,_0x229bcf);}else switch(_0x47809c['type']){case'rename':{if(_0x47809c['oldName']==_0x47809c['newName'])break;_0x29d648['batch']['addOperation'](_0x47809c),_0x3d7efc['model']['applyOperation'](_0x47809c);const _0x575a90='$elementName',_0x3e32dd=_0x47809c['position'],_0x23a55c=_0x3d7efc['model']['createRange'](_0x3e32dd,_0x3d7efc['model']['createPositionAt'](_0x3e32dd['nodeAfter'],'end')),_0x40cfa9='suggestion:attribute:'+_0x575a90+':'+at()+':$aiSuggestion';_0x4bf544['markers']['set'](_0x40cfa9,_0x23a55c);break;}case'addAttribute':case'removeAttribute':case'changeAttribute':{if(_0x47809c['oldValue']==_0x47809c['newValue'])break;_0x29d648['batch']['addOperation'](_0x47809c),_0x3d7efc['model']['applyOperation'](_0x47809c);const _0x3aeb83=_0x47809c['key'];if(!_0x341514['isRegisteredAttribute'](_0x3aeb83))break;const _0x4c1681=_0x151a98(_0x47809c['range'],_0x3d7efc['model']),_0xe365db='suggestion:attribute:'+_0x3aeb83+':'+at()+':$aiSuggestion';_0x4bf544['markers']['set'](_0xe365db,_0x4c1681);break;}case'insert':{_0x29d648['batch']['addOperation'](_0x47809c),_0x3d7efc['model']['applyOperation'](_0x47809c);if(_0x52cd23[_0x1f63b5+0x1]&&'move'==_0x52cd23[_0x1f63b5+0x1]['type']){ks(_0x4bf544,_0x47809c);break;}const _0x4f9c73=_0x47809c['position'],_0x43d16d=_0x47809c['howMany'],_0x2835d0=_0x151a98(_0x3d7efc['model']['createRange'](_0x4f9c73,_0x4f9c73['getShiftedBy'](_0x43d16d)),_0x3d7efc['model']),_0x56599a='suggestion:insertion:'+at()+':$aiSuggestion';_0x4bf544['markers']['set'](_0x56599a,_0x2835d0);break;}case'split':{_0x29d648['batch']['addOperation'](_0x47809c),_0x3d7efc['model']['applyOperation'](_0x47809c);const _0xf7324f=_0x47809c['splitPosition'],_0x21af22=_0x47809c['moveTargetPosition'],_0x1a4465=_0x3d7efc['model']['createRange'](_0xf7324f,_0x21af22),_0x52445f='suggestion:insertion:'+at()+':$aiSuggestion';_0x4bf544['markers']['set'](_0x52445f,_0x1a4465);break;}case'move':{_0x29d648['batch']['addOperation'](_0x47809c),_0x3d7efc['model']['applyOperation'](_0x47809c),_0x52cd23[_0x1f63b5-0x1]&&'insert'==_0x52cd23[_0x1f63b5-0x1]['type']&&ks(_0x4bf544,_0x47809c);const _0x592937=_0x47809c['getMovedRangeStart'](),_0x46f29d=_0x47809c['howMany'];for(let _0x313c82=0x0;_0x313c82<_0x46f29d;_0x313c82++){const _0x2fba02=_0x592937['getShiftedBy'](_0x313c82)['nodeAfter'];_0x3ee117['add'](_0x2fba02);}break;}case'remove':{const _0x36abf1=_0x47809c['sourcePosition'],_0x46bb87=_0x47809c['howMany'],_0x3fbe4e=new _0x338816(_0x36abf1,_0x46bb87);_0x29d648['batch']['addOperation'](_0x3fbe4e),_0x3d7efc['model']['applyOperation'](_0x3fbe4e);break;}}}for(const _0x2ae8cc of _0x3ee117){const _0x52f643=_0x3d7efc['model']['createRangeOn'](_0x2ae8cc),_0x481dc2='suggestion:formatBlock:$fakeWrap:'+at()+':$aiSuggestion';_0x4bf544['markers']['set'](_0x481dc2,_0x151a98(_0x52f643,_0x3d7efc['model']));}});}(_0x1ad3b3,_0x159808,_0x42ed54):_0x42ed54['model']['change'](_0x4a3340=>{for(const _0x1e6ead of _0x1ad3b3)if('remove'==_0x1e6ead['type']){const _0x584011=_0x1e6ead['sourcePosition'],_0xad2575=_0x1e6ead['howMany'],_0x14855c=new _0x338816(_0x584011,_0xad2575);_0x4a3340['batch']['addOperation'](_0x14855c),_0x42ed54['model']['applyOperation'](_0x14855c);}else{if('marker'==_0x1e6ead['type']){const _0x3bf8c2=_0x1e6ead['name'],_0x2f5315=_0x1e6ead['newRange'];null!==_0x2f5315?_0x159808['markers']['set'](_0x3bf8c2,_0x2f5315):_0x159808['markers']['delete'](_0x3bf8c2);}else _0x1e6ead['baseVersion']=null,_0x1e6ead['isDocumentOperation']=!0x1,_0x4a3340['batch']['addOperation'](_0x1e6ead),_0x42ed54['model']['applyOperation'](_0x1e6ead);}});if(_0x288c90){const _0x583ca6=Ns(_0x42ed54,_0x1ad3b3,_0x159808);vs(_0x42ed54['model'],_0x583ca6),function(_0x349b6e,_0x5e1a00){const _0x406db2=_0x5e1a00['getFirstRange']()['start'];let _0x802ce2=_0x5e1a00['getFirstRange']()['end'];const _0xb55767=_0x406db2['root'];(_0x802ce2['textNode']||_0x802ce2['nodeAfter']&&_0x802ce2['nodeAfter']['is']('$text'))&&(_0x4a2f4a(_0x802ce2,'...'),_0x802ce2=_0x802ce2['getShiftedBy'](0x3)),(_0x406db2['textNode']||_0x406db2['nodeBefore']&&_0x406db2['nodeBefore']['is']('$text'))&&(_0x4a2f4a(_0x406db2,'...'),function(_0x11ff57,_0x5d60a4,_0x230715){for(let [_0x2b567c,_0x2ff333]of _0x11ff57['markers']){const _0x16ba03=_0x2ff333['_getTransformedByInsertion'](_0x5d60a4,_0x230715,!0x1);_0x2ff333=_0x16ba03[0x0],_0x11ff57['markers']['set'](_0x2b567c,_0x2ff333);}}(_0xb55767,_0x406db2,0x3),_0x406db2['parent']==_0x802ce2['parent']&&(_0x802ce2=_0x802ce2['getShiftedBy'](0x3)));const _0x15e6e6=_0x349b6e['createRange'](_0x349b6e['createPositionAt'](_0xb55767,0x0),_0x406db2),_0x913eb=_0x349b6e['createRange'](_0x802ce2,_0x349b6e['createPositionAt'](_0xb55767,'end')),_0x2be05c=[..._0x15e6e6['getMinimalFlatRanges'](),..._0x913eb['getMinimalFlatRanges']()];_0x2be05c['reverse']();for(const _0x3a03b5 of _0x2be05c)_0x31bf2a(_0x3a03b5),xs(_0xb55767,_0x3a03b5);}(_0x42ed54['model'],_0x583ca6);}const _0x30631c=_0x42ed54['data']['stringify'](_0x159808,{'showSuggestionHighlights':!0x0});return{'content':As(_0x30631c),'hasChanges':!0x0};}(_0x551616,_0x5a34b3,_0x58a2cd,_0x1d8950,_0x5c8589);return{'type':_0x48f772['changes'][0x0]['type'],'index':_0x48f772['index'],'content':_0x53539f,'hasChanges':_0x4ddded};});}function ks(_0x5e8ee6,_0x34ce85){for(const [_0x1fc0e5,_0x278dc3]of _0x5e8ee6['markers']){const _0x15cf3d=_0x42ff50['_createFromRanges'](_0x278dc3['getTransformedByOperation'](_0x34ce85));_0x5e8ee6['markers']['set'](_0x1fc0e5,_0x15cf3d);}}function Ns(_0xc1856d,_0x33640c,_0x2b0714){const _0x316e6d=_0xc1856d['plugins']['get']('DocumentCompare');let _0x41ff2e=_0xc1856d['model']['createPositionAt'](_0x2b0714,Number['POSITIVE_INFINITY']),_0x3e297b=_0xc1856d['model']['createPositionAt'](_0x2b0714,0x0);for(const _0x36cd36 of _0x33640c){let _0x8ae744,_0x26b99d;if(_0x316e6d['isMarkedRemoveOperation'](_0x36cd36))_0x8ae744=_0x36cd36['newRange']['start'],_0x26b99d=_0x36cd36['newRange']['end'];else switch(_0x41ff2e=_0x41ff2e['getTransformedByOperation'](_0x36cd36),_0x3e297b=_0x3e297b['getTransformedByOperation'](_0x36cd36),_0x36cd36['type']){case'rename':_0x8ae744=_0x36cd36['position'],_0x26b99d=_0x8ae744['getShiftedBy'](0x1);break;case'addAttribute':case'removeAttribute':case'changeAttribute':_0x8ae744=_0x36cd36['range']['start'],_0x26b99d=_0x36cd36['range']['end'];break;case'insert':_0x8ae744=_0x36cd36['position'],_0x26b99d=_0x8ae744['getShiftedBy'](_0x36cd36['howMany']);break;case'split':_0x8ae744=_0x36cd36['splitPosition'],_0x26b99d=_0x36cd36['moveTargetPosition'];break;case'merge':{const _0x4a92c6=_0x36cd36['targetPosition']['path']['slice'](0x0,-0x1);_0x8ae744=_0xc1856d['model']['createPositionFromPath'](_0x2b0714,_0x4a92c6),_0x26b99d=_0x8ae744['getShiftedBy'](0x1);break;}case'remove':{const _0x5b4eea=_0x36cd36['howMany'],_0x2b9687=_0x36cd36['sourcePosition']['_getTransformedByInsertion'](_0x36cd36['targetPosition'],_0x5b4eea),_0x50f768=_0x36cd36['getMovedRangeStart']();'remove'==_0x36cd36['type']?(_0x8ae744=_0x2b9687,_0x26b99d=_0x2b9687):(_0x8ae744=_0x50f768,_0x26b99d=_0x50f768['getShiftedBy'](_0x5b4eea));break;}}_0x8ae744&&_0x8ae744['isBefore'](_0x41ff2e)&&(_0x41ff2e=_0x8ae744['clone'](),_0x41ff2e['stickiness']='toNone'),_0x26b99d&&_0x26b99d['isAfter'](_0x3e297b)&&(_0x3e297b=_0x26b99d['clone'](),_0x3e297b['stickiness']='toNone');}return _0xc1856d['model']['createSelection'](_0xc1856d['model']['createRange'](_0x41ff2e,_0x3e297b));}function vs(_0x537613,_0x2fd9a6){ys(_0x537613,_0x2fd9a6,'forward');const _0x1ef452=_0x2fd9a6['getFirstRange']();_0x2fd9a6['setTo']([]),_0x2fd9a6['setTo'](_0x1ef452,{'backward':!0x0}),ys(_0x537613,_0x2fd9a6,'backward');}function ys(_0x1e0144,_0x5d607a,_0xb02d44){let _0x6afa44=0x14;for(;_0x6afa44;){_0x1e0144['modifySelection'](_0x5d607a,{'unit':'word','direction':_0xb02d44}),_0x6afa44--;const _0x3e6fff=_0x5d607a['focus']['forward'==_0xb02d44?'nodeBefore':'nodeAfter'];if(_0x3e6fff&&_0x3e6fff['is']('element')&&_0x1e0144['schema']['isBlock'](_0x3e6fff)&&_0x1e0144['schema']['isObject'](_0x3e6fff))break;}}function xs(_0x4ebdb2,_0x3cb0bc){for(const [_0x1fd668,_0x50d736]of _0x4ebdb2['markers']){const _0x4aafee=_0x50d736['_getTransformedByDeletion'](_0x3cb0bc['start'],_0x3cb0bc['end']['offset']-_0x3cb0bc['start']['offset']);null!=_0x4aafee?_0x4ebdb2['markers']['set'](_0x1fd668,_0x4aafee):_0x4ebdb2['markers']['delete'](_0x1fd668);}}class Ls extends ht(){['id'];['interactionId'];['type'];['sources']=[];['parsedContent']=new _0x10a8a7([]);['parsedMergedContent']=new _0x10a8a7([]);['changeGroups']=[];['areActionsDisabled']=!0x1;['documentContextContent'];['aiResponseParser'];['aiResponseApplier'];['editor'];['cachedSuggestionContentParts']={'withDiff':[],'withoutDiff':[]};constructor({type:_0x18f3f5,content:_0x2c4e6f='',isDone:_0x453601=!0x1,interactionId:_0x180ea7,areActionsDisabled:_0x2f777e,documentContextContent:_0x322d9f,editor:_0x10b9b4,id:_0x52e4b9}){super(),this['id']=_0x52e4b9||at(),this['interactionId']=_0x180ea7,this['type']=_0x18f3f5,this['areActionsDisabled']=!!_0x2f777e,this['editor']=_0x10b9b4,this['aiResponseParser']=new bs(),this['aiResponseApplier']=new Rs(),this['documentContextContent']=As(_0x322d9f||''),this['set']('isDone',_0x453601),this['on']('change:content',()=>{this['onContentChange']();}),this['set']('content',_0x2c4e6f);}['appendContent'](_0xb3c912){this['set']('content',this['content']+_0xb3c912);}['done'](){this['isDone']||(this['set']('isDone',!0x0),this['onContentChange']());}['destroy'](){this['stopListening']();}['setChangeGroupState'](_0x3a2d4e,_0x3e6881){this['changeGroups'][_0x3a2d4e]['state']=_0x3e6881,this['fire']('replyChangeGroupStateUpdated',{'reply':this,'index':_0x3a2d4e,'state':_0x3e6881});}['getContentParts']({showDiff:_0x289d75,groupIndex:_0x4d789b}){if(!this['editor'])throw new ot('ai-get-editor-from-context-no-editor',null,{'aiReply':this});const _0x3e0b87=this['_getCachedContentParts'](_0x289d75,_0x4d789b);if(_0x3e0b87)return _0x3e0b87;let _0x343331=[];if(void 0x0===_0x4d789b)_0x343331=this['changeGroups'];else{const _0x3862a3=this['changeGroups']['find'](({index:_0x486c55})=>_0x486c55===_0x4d789b);if(!_0x3862a3)throw new ot('ai-reply-get-content-parts-group-not-found',null,{'aiReply':this,'groupIndex':_0x4d789b});_0x343331=[_0x3862a3];}const _0x66e090=Os({'editor':this['editor'],'showDiff':_0x289d75,'changeGroups':_0x343331,'documentContextContent':this['documentContextContent']});return this['_setCachedContentParts'](_0x289d75,_0x66e090),_0x66e090;}['_getCachedContentParts'](_0x164028,_0x15c2eb){const _0x34d1c9=_0x164028?'withDiff':'withoutDiff';if(!this['cachedSuggestionContentParts'][_0x34d1c9]['length'])return null;const _0x54680c=this['cachedSuggestionContentParts'][_0x34d1c9];if(void 0x0===_0x15c2eb)return _0x54680c['length']>0x0&&_0x54680c['length']!==this['changeGroups']['length']?(this['_setCachedContentParts'](_0x164028,null),null):_0xe10b43(_0x54680c);{const _0xe0b56c=_0x54680c['find'](({index:_0x33578d})=>_0x33578d===_0x15c2eb);if(_0xe0b56c)return[_0xe10b43(_0xe0b56c)];}return null;}['_setCachedContentParts'](_0xd788e8,_0x152cbf){const _0x1b705=_0xd788e8?'withDiff':'withoutDiff';_0x152cbf?_0x152cbf['forEach'](_0x3b7bf8=>{const _0x57534d=this['cachedSuggestionContentParts'][_0x1b705],_0x5308c8=_0x57534d['find'](({index:_0x51293e})=>_0x51293e===_0x3b7bf8['index']);if(_0x5308c8){const _0x1009da=_0x57534d['indexOf'](_0x5308c8);_0x57534d['splice'](_0x1009da,0x1,_0x3b7bf8);}else _0x57534d['push'](_0x3b7bf8);}):this['cachedSuggestionContentParts'][_0x1b705]['length']=0x0;}['onContentChange'](){if('modification'===this['type']){this['parsedContent']=this['aiResponseParser']['parseAndNormalizeHTML'](this['content']);const _0x1adeb3=this['changeGroups'];this['updateChangeGroups']();const _0x26bfce=this['_getDifferentChangeGroups'](_0x1adeb3,this['changeGroups']);(_0x26bfce['length']||this['isDone'])&&(this['fire']('replyContentUpdated',this,_0x26bfce),this['cachedSuggestionContentParts']['withDiff']['length']=this['cachedSuggestionContentParts']['withoutDiff']['length']=0x0);}else this['parsedContent']=this['aiResponseParser']['convertMarkdownToHTML'](this['content']),this['fire']('replyContentUpdated',this);}['_getDifferentChangeGroups'](_0x555d27,_0x2c7b07){const _0x3bb830=[];for(const _0x45da54 of _0x2c7b07){const _0x2ab49d=_0x555d27[_0x45da54['index']];_0x2ab49d?_0x2ab49d['changes']['length']!==_0x45da54['changes']['length']?_0x3bb830['push'](_0x45da54):_0x2ab49d['changes']['forEach']((_0x2ace5c,_0xd6b360)=>{const _0x520701=_0x45da54['changes'][_0xd6b360];_0x2ace5c['id']!==_0x520701['id']&&_0x3bb830['push'](_0x45da54);}):_0x3bb830['push'](_0x45da54);}return _0x3bb830;}['updateChangeGroups'](){const _0x3e40e1=new _0x170b36('p',{},[new _0x170b36('span',{'style':'color:\x20#808080;\x20font-style:\x20italic'},[new _0x5cf540(cs(this['editor']['locale'],'AI_SUGGESTION_CONTENT_PART_REMOVED'))])]),_0x2c98c4=this['aiResponseApplier']['merge'](this['parsedContent'],this['documentContextContent']['cloneNode'](!0x0),{'markUnstableElements':!this['isDone'],'replaceRemovedWith':_0x3e40e1,'cutAfterLastChange':!this['isDone']});if(!_0x2c98c4['modifiedNodeIds']['length']&&!this['isDone'])return;this['parsedMergedContent']=_0x2c98c4['parsedContent'];let _0x2ec490=[];if(_0x1a6a3d(_0x375c02=>{const _0x4192a7=ps(_0x375c02,'data-id');if(!_0x4192a7||!_0x43de1d(_0x4192a7))return!0x1;const _0x205777=[_0x375c02,...Cs(_0x375c02)]['at'](-0x2);if(_0x375c02!=_0x205777){const _0x50b72c=ps(_0x205777,'data-id');_0x43de1d(_0x50b72c)||(_0x2ec490['push']({'node':_0x205777,'id':_0x50b72c,'type':'modified'}),_0x2c98c4['modifiedNodeIds']['push'](_0x50b72c));}else _0x2c98c4['modifiedNodeIds']['includes'](_0x4192a7)?_0x2ec490['push']({'node':_0x375c02,'type':'modified','id':_0x4192a7}):_0x2c98c4['newNodeIds']['includes'](_0x4192a7)?_0x2ec490['push']({'node':_0x375c02,'type':'new','id':_0x4192a7,'anchorId':ps(_0x375c02['previousSibling'],'data-id')}):_0x2ec490['push']({'node':_0x375c02,'type':'removed','id':_0x4192a7});return!0x0;},this['parsedMergedContent']),_0x2ec490=_0x2ec490['filter'](({node:_0x339f0c})=>[...Cs(_0x339f0c),_0x339f0c]['every'](_0x3aa960=>!ps(_0x3aa960,'data-unstable'))),0x0==_0x2ec490['length'])return;const _0x57e79f=[[_0x2ec490[0x0]]];for(let _0x3e187b=0x1;_0x3e187b<_0x2ec490['length'];_0x3e187b++){const _0x417fd6=_0x57e79f[_0x57e79f['length']-0x1],_0x4b41e6=_0x417fd6[_0x417fd6['length']-0x1];_0x2ec490[_0x3e187b]['node']['previousSibling']==_0x4b41e6['node']&&'modified'!=_0x2ec490[_0x3e187b]['type']&&'modified'!=_0x4b41e6['type']?_0x417fd6['push'](_0x2ec490[_0x3e187b]):_0x57e79f['push']([_0x2ec490[_0x3e187b]]);}for(const _0xd572a5 of _0x57e79f){const _0x5aee2b=_0xd572a5[0x0],_0x3c5210=_0xd572a5[_0xd572a5['length']-0x1],_0x24cd7a=_0xa22a8c(_0x5aee2b['node']['previousSibling']);_0x24cd7a&&_0xd572a5['unshift'](_0x24cd7a);const _0x5c5a92=_0xa22a8c(_0x3c5210['node']['nextSibling']);_0x5c5a92&&_0xd572a5['push'](_0x5c5a92);}function _0x43de1d(_0x28ab3f){return _0x2c98c4['modifiedNodeIds']['includes'](_0x28ab3f)||_0x2c98c4['newNodeIds']['includes'](_0x28ab3f)||_0x2c98c4['removedNodeIds']['includes'](_0x28ab3f);}function _0xa22a8c(_0x11ba5b){if(_0x11ba5b&&ps(_0x11ba5b,'data-id')&&!ps(_0x11ba5b,'data-unstable')){const _0x1a1e5f=ps(_0x11ba5b,'data-id');if(!_0x43de1d(_0x1a1e5f))return{'node':_0x11ba5b,'type':'context','id':_0x1a1e5f};}return null;}this['changeGroups']=_0x57e79f['map']((_0x5c1597,_0x57fabb)=>({'changes':_0x5c1597,'state':'pending','index':_0x57fabb}));}}const Ds=['interactionCreated','interactionStarted','interactionStopped','interactionFinished','interactionDestroyed','replyCreated','replyContentUpdated','replyChangeGroupStateUpdated','setConversationTitle','webSearchStarted','webSearchFinished','reasoningStarted','reasoningFinished','toolDataReceived','error'];class Ps extends Et(){['id'];['replies']=[];['currentReply'];['messageId'];['actionCallId'];['currentRequest'];['connector'];['isStopped']=!0x1;['isDestroyed']=!0x1;['editor'];['_isReasoning']=!0x1;['_isWebSearching']=!0x1;constructor({connector:_0x510d35,editor:_0x5f270d}){super(),this['id']=at(),this['connector']=_0x510d35,this['isStopped']=!0x0,this['editor']=_0x5f270d;}async['start'](){const _0x380f16=[];let _0x5627ba,_0x9fa4b1,_0x4ca098;this['isStopped']=!0x1;try{this['currentRequest']=await this['sendRequest'](),this['fire']('interactionStarted',this);const _0x2c7673=await this['currentRequest']['getStream']();for await(const _0x1adef6 of _0x2c7673){if(this['isStopped'])return;if('error'==_0x1adef6['event'])return void this['fire']('error',{'error':new ot('ai-chat-interaction-error',this)});switch(_0x1adef6['event']){case'message-metadata':this['messageId']=_0x1adef6['data']['messageId'];break;case'action-metadata':this['actionCallId']=_0x1adef6['data']['callId'];break;case'conversation-title':this['setConversationTitle'](_0x1adef6['data']['conversationTitle'],!0x0);break;case'source':_0x380f16['push'](_0x1adef6['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'](),_0x5627ba='modification-delta'==_0x1adef6['event']?'modification':'text',_0x9fa4b1='modification-delta'==_0x1adef6['event']?_0x1adef6['data']['id']:void 0x0,this['currentReply']&&this['currentReply']['type']!=_0x5627ba&&(this['currentReply']['done'](),this['currentReply']=void 0x0),this['currentReply']||(this['currentReply']=this['createReply']({'type':_0x5627ba,'interactionId':this['id'],'id':_0x9fa4b1}),'modification'==_0x5627ba&&(this['currentReply']['sources']=_0x380f16['splice'](0x0))),this['currentReply']['appendContent'](_0x1adef6['data']['textDelta']);break;case'mcp-tool-result':_0x4ca098=JSON['parse'](_0x1adef6['data']['result']),this['_handleToolResultData']({'toolName':_0x1adef6['data']['toolName'],'data':_0x4ca098['data'],'attributes':_0x4ca098['attributes']});break;case'mcp-tool-notification':this['_handleToolNotificationData']({'toolName':_0x1adef6['data']['toolName'],'data':_0x1adef6['data']['data']});}}}finally{this['isStopped']||(this['currentReply']&&_0x380f16['length']>0x0&&(this['currentReply']['sources']=_0x380f16['splice'](0x0)),this['_finalizeInteraction'](),this['fire']('interactionFinished',this));}}['stop'](){this['isStopped']||(this['_finalizeInteraction'](),this['fire']('interactionStopped',this));}['getReply'](_0x26b960){return this['replies']['find'](_0x3eee1c=>_0x3eee1c['id']===_0x26b960);}['destroy'](){this['isDestroyed']||(this['stop'](),this['replies']['forEach'](_0xd13718=>_0xd13718['destroy']()),this['replies']=[],this['isDestroyed']=!0x0,this['fire']('interactionDestroyed',this),this['stopListening']());}['createReply'](_0x48f3bc){const _0x5905cb=new Ls({'editor':this['editor'],'documentContextContent':this['getDocumentContext']()?.['content'],..._0x48f3bc});return this['replies']['push'](_0x5905cb),_0x5905cb['delegate'](...Ds)['to'](this),this['fire']('replyCreated',_0x5905cb),_0x5905cb;}['setConversationTitle'](_0x372c0b,_0x3929a7=!0x1){this['fire']('setConversationTitle',_0x372c0b,_0x3929a7);}['resetWebSearchState'](){this['_isWebSearching']&&(this['_isWebSearching']=!0x1,this['fire']('webSearchFinished',this));}['resetReasoningState'](){this['_isReasoning']&&(this['_isReasoning']=!0x1,this['fire']('reasoningFinished',this));}['_handleToolResultData'](_0x2a04d8){this['fire']('toolDataReceived',{'type':'result','toolName':_0x2a04d8['toolName'],'data':structuredClone(_0x2a04d8['data']||{}),'attributes':structuredClone(_0x2a04d8['attributes']||{})},this);}['_handleToolNotificationData'](_0x4f69bd){this['fire']('toolDataReceived',{'type':'notification','toolName':_0x4f69bd['toolName'],'data':structuredClone(_0x4f69bd['data'])},this);}['_finalizeInteraction'](){this['isStopped']=!0x0,this['currentRequest']&&this['currentRequest']['abortController']['abort'](),this['currentReply']&&this['currentReply']['done'](),this['currentRequest']=this['currentReply']=void 0x0;}}const Hs=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']]),Ms=['contextItemAdded','contextItemRemoved','contextItemLoadingEnded','contextSent','error','addContextOptionsChanged','sourceResourcesLoaded','resourceStateChanged','uploadProgressChanged'];class Us extends ht(){['_connector'];['_config'];['_ownerId'];constructor({connector:_0x3decd8,config:_0x5b4336,ownerId:_0x3fdb80}){super(),this['_connector']=_0x3decd8,this['_config']=_0x5b4336,this['_ownerId']=_0x3fdb80;}['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'](_0x5b3596){const _0x5c55f3=await this['_createContextItemFromContent'](_0x5b3596);return this['_addToConversationContextItem'](_0x5c55f3),'current-document'===_0x5c55f3['uiId']&&this['_toggleAddCurrentDocumentOptionVisibility'](),_0x5c55f3;}async['_createContextItemFromContent'](_0x202aad){if('document'===_0x202aad['type']){const _0x186f30=await this['_connector']['fetchDocument'](this['_ownerId'],_0x202aad['id'])['getDocument']();return{'id':'current-document','uiId':'current-document','label':'Current\x20document','type':_0x202aad['type'],'content':_0x186f30['content'],'hidden':this['_conversationContextItems']['has']('current-document'),'version':_0x186f30['attributes']?.['version'],'sessionId':_0x186f30['attributes']?.['sessionId']};}if('mcp-tool-context'===_0x202aad['type'])return{'id':_0x202aad['id'],'uiId':_0x202aad['id'],'label':_0x202aad['data']?.['label']||_0x202aad['id'],'type':'mcp-tool-context','mcpServerName':_0x202aad['mcpServerName'],'toolName':_0x202aad['toolName'],'data':_0x202aad['data']||{}};return{'id':_0x202aad['id'],'uiId':_0x202aad['id'],'label':_0x202aad['attributes']?.['label']||_0x202aad['name']||_0x202aad['url']||_0x202aad['id'],'type':_0x202aad['type'],..._0x202aad?.['attributes']?.['resourceId']?{'resourceId':_0x202aad['attributes']?.['resourceId']}:{}};}['getSentContextItems'](){return new Map(this['_conversationContextItems']);}['removeFromContext'](_0x325437){const _0x39bcdf=this['_pendingContextItems']['get'](_0x325437);_0x39bcdf?.['isReadOnly']||this['_removeContextItem'](_0x325437);}['clearPendingContextItems'](){if(0x0===this['_pendingContextItems']['size'])return;for(const _0x37860f of this['_pendingContextItems']['values']())this['_removeContextItem'](_0x37860f['uiId']);const _0x46e1db=this['_conversationContextItems']['get']('current-document')||this['_pendingContextItems']['get']('current-document');_0x46e1db&&this['_addContextItem']({..._0x46e1db,'isReadOnly':!0x0,'hidden':!0x0});}['addToConversationContext'](_0x126448){for(const _0x1bbe52 of _0x126448['values']())this['_addToConversationContextItem'](_0x1bbe52);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'](_0x14cc15){return Array['from'](_0x14cc15['values']())['map'](_0xf2c537=>this['_mapContextItemToRequestData'](_0xf2c537))['filter'](_0x39b187=>null!==_0x39b187);}async['addFilesToContext'](_0x370db1,_0x1b58ca,_0x4d4317='file'){const _0x3576f9='files-'+at();this['_startUploadOperation'](_0x3576f9);try{await Promise['all'](_0x370db1['map'](async _0x82d0ca=>{const _0x1a0bed='file-'+at(),_0x5cb2e5=_0x40b9c9(_0x82d0ca['name']);try{this['_addContextItem']({'type':_0x4d4317,'label':_0x1b58ca?.['label']||_0x5cb2e5,'uiId':_0x1a0bed,'resourceId':_0x1b58ca?.['resourceId']},!0x0);const _0x587fdf=this['_connector']['uploadFile'](this['_ownerId'],_0x82d0ca,_0x1b58ca);this['_ongoingUploads']['set'](_0x1a0bed,_0x587fdf['abortController']);const {id:_0x4b20da}=await _0x587fdf['getId']();this['_ongoingUploads']['delete'](_0x1a0bed),this['_finishContextItemLoading']({'type':_0x4d4317,'id':_0x4b20da,'label':_0x1b58ca?.['label']||_0x5cb2e5,'uiId':_0x1a0bed,'resourceId':_0x1b58ca?.['resourceId']},!0x1);}catch(_0x599bea){this['_ongoingUploads']['delete'](_0x1a0bed);if(!(_0x599bea instanceof ot&&_0x599bea['message']['startsWith']('ai-request-aborted'))){const _0x23aa1a=Hs['get'](_0x599bea['code'])||'ai-chat-file-upload-failed',_0x2828b0=new ot(_0x23aa1a,null,{'fileName':_0x5cb2e5,..._0x599bea});_0x2828b0['stack']=_0x599bea['stack'],this['fire']('error',{'error':_0x2828b0});}this['_removeContextItem'](_0x1a0bed);}}));}finally{this['_finishUploadOperation'](_0x3576f9);}}['addCurrentDocumentToContext'](_0x41bd89){if(this['isCurrentDocumentInContext']()||!this['_addContextOptionsState']['document']['enabled'])return;const _0x31db00={'type':'document','uiId':'current-document','label':_0x41bd89,'isReadOnly':this['_conversationContextItems']['has']('current-document'),'hidden':this['_conversationContextItems']['has']('current-document')};this['_addContextItem'](_0x31db00);}async['updateCurrentDocument'](_0x613ef8,_0xa89491,_0x3a6a57,_0x25148a){const _0x284e0c=this['_pendingContextItems']['get']('current-document');if(_0x284e0c&&_0x613ef8){_0x284e0c['selection']=_0x25148a?_0x25148a['map'](_0x2dc675=>({'start':_0x2dc675['start'],'end':_0x2dc675['end']})):[];try{if(_0x284e0c['version']===_0xa89491)return;const {id:_0x262ca6}=await this['_connector']['uploadDocument'](this['_ownerId'],_0x613ef8,{'version':_0xa89491,'sessionId':_0x3a6a57})['getId']();_0x284e0c['id']=_0x262ca6,_0x284e0c['content']=_0x613ef8,_0x284e0c['version']=_0xa89491,_0x284e0c['sessionId']=_0x3a6a57;}catch(_0x2a2406){const _0x5dbd25=new ot('ai-chat-document-upload-failed',null);_0x5dbd25['stack']=_0x2a2406['stack'],this['fire']('error',{'error':_0x5dbd25});}}}['addSelectionToContext'](_0x5233e7){this['_addContextItem']({'type':'selection','label':_0x5233e7,'uiId':'selection','content':_0x5233e7});}['removeSelectionFromContext'](){this['_removeContextItem']('selection');}async['addUrlToContext'](_0x1070e0,_0x4e14a4){const _0x27e251='url-'+at();this['_startUploadOperation'](_0x27e251);const _0xcf843f='url-'+at();try{this['_addContextItem']({'type':'web-resource','label':_0x4e14a4?.['label']||_0x1070e0,'uiId':_0xcf843f,'resourceId':_0x4e14a4?.['resourceId']},!0x0);const _0x3eedb6=this['_connector']['uploadUrl'](this['_ownerId'],_0x1070e0,_0x4e14a4);this['_ongoingUploads']['set'](_0xcf843f,_0x3eedb6['abortController']);const {id:_0x1b83a4}=await _0x3eedb6['getId']();this['_ongoingUploads']['delete'](_0xcf843f),this['_finishContextItemLoading']({'type':'web-resource','id':_0x1b83a4,'label':_0x4e14a4?.['label']||_0x1070e0,'uiId':_0xcf843f,'resourceId':_0x4e14a4?.['resourceId']},!0x1);}catch(_0x3fd187){this['_ongoingUploads']['delete'](_0xcf843f),(_0x3fd187['message']['startsWith']('ai-request-aborted')||this['fire']('error',{'error':new ot('ai-chat-url-upload-failed',this,{'url':_0x1070e0,'originalError':_0x3fd187}),'url':_0x1070e0}),this['_removeContextItem'](_0xcf843f));}finally{this['_finishUploadOperation'](_0x27e251);}}['addToolItemToContext'](_0x47d7cd){_0x47d7cd['id']=_0x47d7cd['id']??at()['substring'](0x0,0x15),this['_pendingContextItems']['set'](_0x47d7cd['uiId'],_0x47d7cd),this['fire']('contextItemAdded',{'contextItem':_0x47d7cd,'isLoading':!0x1});}async['loadSourceResources'](_0x11ed38,_0x5cbed6,_0x5cda39){const _0x51a865=this['_addContextOptionsState']['sources']['find'](_0x5be9f0=>_0x5be9f0['id']===_0x11ed38);if(!_0x51a865)return this['fire']('error',{'error':new ot('ai-chat-source-not-found',this,{'sourceId':_0x11ed38}),'sourceId':_0x11ed38}),[];try{const _0x2b0c0f=(await _0x51a865['getResources'](_0x5cbed6))['map'](_0x4ec0e1=>{const _0x1c2571=this['_isResourceInContext'](_0x4ec0e1['id']);return{..._0x4ec0e1,'isInContext':_0x1c2571};});return _0x51a865['resources']=_0x2b0c0f,this['fire']('sourceResourcesLoaded',{'sourceId':_0x11ed38,'source':_0x51a865,'resources':_0x2b0c0f,'uid':_0x5cda39}),_0x2b0c0f;}catch(_0x4dfc0d){return this['fire']('error',{'error':new ot('ai-chat-source-resources-load-failed',this,{'sourceId':_0x11ed38,'originalError':_0x4dfc0d}),'sourceId':_0x11ed38,'sourceLabel':_0x51a865['label']}),[];}}async['addResourceToContext'](_0x5d7912,_0x2fd94d){if(this['_isResourceInContext'](_0x2fd94d['id']))return;let _0x439a15=_0x2fd94d['data'];if(!_0x439a15&&_0x5d7912['getData'])try{_0x439a15=await _0x5d7912['getData'](_0x2fd94d['id']);}catch(_0x3a6680){return void this['fire']('error',{'error':new ot('ai-chat-resource-load-failed',this,{'resourceId':_0x2fd94d['id'],'sourceId':_0x5d7912['id'],'originalError':_0x3a6680}),'resourceId':_0x2fd94d['id'],'sourceId':_0x5d7912['id']});}if(_0x439a15)switch(_0x2fd94d['type']){case'web-resource':if('string'!=typeof _0x439a15)return void this['fire']('error',{'error':new ot('ai-chat-context-invalid-data',this,{'resourceId':_0x2fd94d['id'],'sourceId':_0x5d7912['id'],'expectedType':'string','actualType':typeof _0x439a15}),'resourceId':_0x2fd94d['id'],'sourceId':_0x5d7912['id']});await this['addUrlToContext'](_0x439a15,{'label':_0x2fd94d['label'],'resourceId':_0x2fd94d['id']});break;case'file':if(!(_0x439a15 instanceof File))return void this['fire']('error',{'error':new ot('ai-chat-context-invalid-data',this,{'resourceId':_0x2fd94d['id'],'sourceId':_0x5d7912['id'],'expectedType':'File','actualType':typeof _0x439a15}),'resourceId':_0x2fd94d['id'],'sourceId':_0x5d7912['id']});await this['addFilesToContext']([_0x439a15],{'label':_0x2fd94d['label'],'resourceId':_0x2fd94d['id']});break;case'text':if('object'!=typeof _0x439a15||!('content'in _0x439a15)||!('type'in _0x439a15))return void this['fire']('error',{'error':new ot('ai-chat-context-invalid-data',this,{'resourceId':_0x2fd94d['id'],'sourceId':_0x5d7912['id'],'expectedType':'object\x20with\x20content\x20and\x20type\x20properties','actualType':typeof _0x439a15}),'resourceId':_0x2fd94d['id'],'sourceId':_0x5d7912['id']});_0x439a15=Us['_convertTextResourceToFile'](_0x439a15,_0x2fd94d['label']),await this['addFilesToContext']([_0x439a15],{'label':_0x2fd94d['label'],'resourceId':_0x2fd94d['id']},'text');break;case'mcp-tool-context':break;default:this['fire']('error',{'error':new ot('ai-chat-context-unsupported-type',this,{'resourceId':_0x2fd94d['id'],'sourceId':_0x5d7912['id'],'resourceType':_0x2fd94d['type']}),'resourceId':_0x2fd94d['id'],'sourceId':_0x5d7912['id']});}else this['fire']('error',{'error':new ot('ai-chat-resource-no-data',this,{'resourceId':_0x2fd94d['id'],'sourceId':_0x5d7912['id']}),'resourceId':_0x2fd94d['id'],'sourceId':_0x5d7912['id']});}static['_convertTextResourceToFile'](_0x26d38a,_0xb8746f){switch(_0x26d38a['type']){case'markdown':return new File([_0x26d38a['content']],_0xb8746f,{'type':'text/markdown'});case'html':return new File([_0x26d38a['content']],_0xb8746f,{'type':'text/html'});default:return new File([_0x26d38a['content']],_0xb8746f,{'type':'text/plain'});}}static['_mapContextItemToRequestData'](_0x3934f7){switch(_0x3934f7['type']){case'file':case'text':return{'type':'file','id':_0x3934f7['id']};case'web-resource':return{'type':'web-resource','id':_0x3934f7['id']};case'document':return{'type':'document','id':_0x3934f7['id'],..._0x3934f7['selection']?.['length']&&{'selection':_0x3934f7['selection']}};case'mcp-tool-context':{const _0xf169c4=_0x3934f7;return{'type':'mcp-tool-context','mcpServerName':_0xf169c4['mcpServerName'],'toolName':_0xf169c4['toolName'],'data':_0xf169c4['data'],'id':_0xf169c4['id']};}default:return null;}}['_addContextItem'](_0x45daee,_0x244a5c=!0x1){if(this['_pendingContextItems']['set'](_0x45daee['uiId'],_0x45daee),_0x45daee['hidden']||this['fire']('contextItemAdded',{'contextItem':_0x45daee,'isLoading':_0x244a5c}),'current-document'===_0x45daee['uiId']&&this['_toggleAddCurrentDocumentOptionVisibility'](),_0x45daee['resourceId']){const _0x4c49ec=this['_findSourceIdsByResourceId'](_0x45daee['resourceId']);_0x4c49ec&&_0x4c49ec['forEach'](_0x472561=>{this['_updateResourceInContextState'](_0x472561,_0x45daee['resourceId'],!0x0);});}}['_removeContextItem'](_0x9bf425){const _0x4e45a4=this['_pendingContextItems']['get'](_0x9bf425),_0x2082b8=this['_ongoingUploads']['get'](_0x9bf425);if(_0x2082b8&&(_0x2082b8['abort'](),this['_ongoingUploads']['delete'](_0x9bf425)),_0x4e45a4?.['resourceId']){const _0x20c06b=this['_findSourceIdsByResourceId'](_0x4e45a4['resourceId']);_0x20c06b&&_0x20c06b['forEach'](_0x142b76=>{this['_updateResourceInContextState'](_0x142b76,_0x4e45a4['resourceId'],!0x1);});}this['_pendingContextItems']['delete'](_0x9bf425),this['fire']('contextItemRemoved',{'uiId':_0x9bf425,'type':_0x4e45a4?.['type']}),'current-document'===_0x9bf425&&this['_toggleAddCurrentDocumentOptionVisibility']();}['_finishContextItemLoading'](_0x336a4c,_0x8c8f36){if(this['_pendingContextItems']['has'](_0x336a4c['uiId'])&&(this['_pendingContextItems']['set'](_0x336a4c['uiId'],_0x336a4c),this['fire']('contextItemLoadingEnded',{'contextItem':_0x336a4c,'isLoading':_0x8c8f36}),_0x336a4c['resourceId'])){const _0xca8046=this['_findSourceIdsByResourceId'](_0x336a4c['resourceId']);_0xca8046&&_0xca8046['forEach'](_0x456acb=>{this['_updateResourceInContextState'](_0x456acb,_0x336a4c['resourceId'],!0x0);});}}['_addToConversationContextItem'](_0x865e03){this['_conversationContextItems']['set'](_0x865e03['uiId'],_0x865e03);}['_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'](_0x856902=>({..._0x856902,'enabled':!0x0}))??[]},this['fire']('addContextOptionsChanged',{'options':this['_addContextOptionsState']});}['_getCustomSourcesInitialState'](){return this['_config']?.['sources']?.['map'](_0x2ccdb0=>({..._0x2ccdb0,'resources':[]}))??[];}['_toggleAddCurrentDocumentOptionVisibility'](){const _0x24c17e=this['isCurrentDocumentInContext']()||this['isCurrentDocumentInConversation']();this['_addContextOptionsState']['document']['isHidden']=_0x24c17e,this['fire']('addContextOptionsChanged',{'options':this['_addContextOptionsState']});}['_isResourceInContext'](_0x3f9e0c){for(const _0x4c7d6b of this['_pendingContextItems']['values']())if(_0x4c7d6b['resourceId']===_0x3f9e0c)return!0x0;for(const _0x560988 of this['_conversationContextItems']['values']())if(_0x560988['resourceId']===_0x3f9e0c)return!0x0;return!0x1;}['_findSourceIdsByResourceId'](_0x1133db){const _0xf78ddd=[];for(const _0x3ac75c of this['_addContextOptionsState']['sources']){_0x3ac75c['resources']['find'](_0x56d1ea=>_0x56d1ea['id']===_0x1133db)&&_0xf78ddd['push'](_0x3ac75c['id']);}return 0x0===_0xf78ddd['length']?null:_0xf78ddd;}['_updateResourceInContextState'](_0x59f679,_0x98c61a,_0x45e507){const _0x233517=this['_addContextOptionsState']['sources']['find'](_0x45e16b=>_0x45e16b['id']===_0x59f679);if(!_0x233517)return;const _0x252c2b=_0x233517['resources']['find'](_0x47a9b3=>_0x47a9b3['id']===_0x98c61a);_0x252c2b&&(_0x252c2b['isInContext']=_0x45e507,this['fire']('resourceStateChanged',{'sourceId':_0x59f679,'resourceId':_0x98c61a,'isInContext':_0x45e507}));}['_startUploadOperation'](_0x4ab76d){this['_ongoingUploadOperations']['set'](_0x4ab76d,!0x0),this['_ongoingUploadOperations']['size']&&this['fire']('uploadProgressChanged',{'isUploadInProgress':!0x0});}['_finishUploadOperation'](_0x5d9091){this['_ongoingUploadOperations']['delete'](_0x5d9091),0x0===this['_ongoingUploadOperations']['size']&&this['fire']('uploadProgressChanged',{'isUploadInProgress':!0x1});}}const Vs=['capabilitiesUpdated'];class Bs extends Et(){['_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'](_0xb71045){const _0x4979b8={};return _0xb71045&&_0xb71045['isWebSearchEnabled']&&(_0x4979b8['webSearch']={}),_0xb71045&&_0xb71045['isReasoningEnabled']&&(_0x4979b8['reasoning']={}),_0x4979b8;}['toggleWebSearch'](){this['setWebSearch'](!this['_isWebSearchEnabled']);}['toggleReasoning'](){this['setReasoning'](!this['_isReasoningEnabled']);}['setWebSearch'](_0x1826b3){_0x1826b3!==this['_isWebSearchEnabled']&&(this['_isWebSearchEnabled']=_0x1826b3,this['fire']('capabilitiesUpdated',this['getCapabilitiesConfig']()));}['setReasoning'](_0x5394e7){_0x5394e7!==this['_isReasoningEnabled']&&(this['_isReasoningEnabled']=_0x5394e7,this['fire']('capabilitiesUpdated',this['getCapabilitiesConfig']()));}}class Gs extends Ps{['userMessage'];['conversationId'];['contextItems']=new Map();['capabilities'];['model'];['attributes'];constructor(_0x3ace90){super(_0x3ace90),this['conversationId']=_0x3ace90['conversationId'],this['contextItems']=_0x3ace90['contextItems'],this['capabilities']=_0x3ace90['capabilities'],this['userMessage']=_0x3ace90['userMessage'],this['model']=_0x3ace90['model'],this['attributes']=_0x3ace90['attributes'];}async['sendRequest'](){return this['connector']['queryAssistant']({'message':this['userMessage'],'conversationId':this['conversationId'],'parts':Us['mapContextItemsToRequestData'](this['contextItems']),'capabilities':Bs['getCapabilitiesRequestData'](this['capabilities']),'model':this['model'],'attributes':this['attributes']});}['getDocumentContext'](){return this['contextItems']['get']('current-document');}}class Fs extends Et(){['id'];['isStarted']=!0x1;['isFromHistory'];['interactions']=[];['currentInteraction'];['selectedModel'];['connector'];['options'];constructor(_0x1cdaa6){super(),this['options']=_0x1cdaa6,this['connector']=_0x1cdaa6['connector'],this['chatModels']=_0x1cdaa6['chatModels'],this['id']=_0x1cdaa6['conversationId'],this['isFromHistory']=_0x1cdaa6['isFromHistory'];}async['init'](_0x41d57e){try{this['chatContext']=new Us({'connector':this['connector'],'config':_0x41d57e,'ownerId':this['id']}),this['chatContext']['delegate'](...Ms)['to'](this),this['chatContext']['init'](),this['chatCapabilities']=new Bs(),this['chatCapabilities']['delegate'](...Vs)['to'](this),this['chatCapabilities']['init']();const _0x43c098=await this['chatModels']['getAvailableModels']();this['fire']('conversationInitialized',{'availableModels':_0x43c098});const _0x161c8c=await this['chatModels']['getModel'](this['options']['selectedModelId']);_0x161c8c&&await this['setModel'](_0x161c8c);}catch(_0x23b365){const _0x33638f=new ot('ai-chat-conversation-init-failed',null,{'message':_0x23b365['message']||_0x23b365});_0x33638f['stack']=_0x23b365['stack'],this['fire']('error',{'error':_0x33638f});}}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:_0x2bd863}=await this['connector']['startConversation'](this['id'],this['options']['group'])['getConversation']();this['id']=_0x2bd863,this['isStarted']=!0x0,this['fire']('conversationStarted',{'conversationId':this['id'],'selectedModel':this['selectedModel']});}catch(_0x589c3d){const _0x628454=new ot('ai-chat-conversation-start-failed',null,{'message':_0x589c3d['message'],'conversationId':this['id']});throw _0x628454['stack']=_0x589c3d['stack'],this['fire']('error',{'error':_0x628454}),_0x628454;}}async['load'](_0x871b20,_0xef70d5){try{const _0x9564b6=await this['connector']['fetchConversation'](_0x871b20)['getConversation'](),_0x5bef02=await this['connector']['fetchConversationMessages'](_0x871b20)['getMessages'](),_0x3bccc6=_0x5bef02[0x0]['model'];this['isStarted']=!0x0,this['id']=_0x9564b6['id'],'title'in _0x9564b6?this['fire']('setConversationTitle',_0x9564b6['title'],!0x0):this['fire']('setConversationTitle','',!0x0);const _0x3f7e92=(await this['chatModels']['getAll']())['find'](_0x1d07f1=>_0x1d07f1['id']['toLowerCase']()===_0x3bccc6['toLowerCase']());return this['selectedModel']=_0x3f7e92,this['fire']('modelSelected',{'selectedModel':_0x3f7e92,'isDisabled':!0x0}),await this['_processMessagesToInteractions'](_0x5bef02,_0xef70d5,_0x3bccc6),this['currentInteraction']=void 0x0,this;}catch(_0x521015){const _0x40e0ff=new ot('ai-chat-conversation-init-from-id-failed',null,{'message':_0x521015['message'],'conversationId':_0x871b20});throw _0x40e0ff['stack']=_0x521015['stack'],this['fire']('error',{'error':_0x40e0ff}),_0x40e0ff;}}async['_processMessagesToInteractions'](_0x5bf6c1,_0x21776a,_0x467f05){let _0x169cdc;for(const _0x2ed17c of _0x5bf6c1)if('user'===_0x2ed17c['role']){const _0x4bc11f=await this['_extractContextItems'](_0x2ed17c),_0x26d182={'isReasoningEnabled':Object['hasOwn'](_0x2ed17c['capabilities'],'reasoning'),'isWebSearchEnabled':Object['hasOwn'](_0x2ed17c['capabilities'],'webSearch')};_0x169cdc=this['createInteraction']({'userMessage':_0x2ed17c['prompt'],'contextItems':_0x4bc11f,'capabilities':_0x26d182,'modelId':_0x467f05,'attributes':_0x2ed17c['attributes']}),this['currentInteraction']=_0x169cdc,this['chatContext']['addToConversationContext'](this['currentInteraction']['contextItems']);}else{if('assistant'===_0x2ed17c['role']&&_0x169cdc){const _0x50bf82=[];for(const _0x23fe81 of _0x2ed17c['content'])switch(_0x23fe81['type']){case'text':case'modification':{const _0x57786d=_0x169cdc['getDocumentContext']()?.['sessionId']!==_0x21776a;_0x169cdc['currentReply']=_0x169cdc['createReply']({'type':_0x23fe81['type'],'isDone':!0x0,'interactionId':_0x169cdc['id'],'areActionsDisabled':_0x57786d}),_0x169cdc['currentReply']['appendContent'](_0x23fe81['content']),_0x50bf82['length']>0x0&&(_0x169cdc['currentReply']['sources']=_0x50bf82['splice'](0x0));break;}case'url':_0x50bf82['push'](_0x23fe81);break;case'mcp-tool-result':{const {data:_0x3f1a29,attributes:_0x13e628}=JSON['parse'](_0x23fe81['content']);_0x169cdc['_handleToolResultData']({'toolName':_0x23fe81['toolName'],'data':_0x3f1a29,'attributes':_0x13e628});break;}}}}}async['_extractContextItems'](_0x49530f){const _0x58768a=new Map();if(!_0x49530f['content'])return _0x58768a;for(const _0x42bfe2 of _0x49530f['content']){const _0x280117=await this['chatContext']['populateFromMessage'](_0x42bfe2);_0x280117&&_0x58768a['set'](_0x280117['id'],_0x280117);}return _0x58768a;}async['handleUserInteraction']({userMessage:_0x5e734a,attributes:_0x4be8a6}){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 _0xe98d99=this['chatContext']['getPendingContextItems'](),_0x2ae2a9=this['chatCapabilities']['getCapabilitiesConfig'](),_0x3fd839=this['selectedModel']['id'];this['currentInteraction']=this['createInteraction']({'userMessage':_0x5e734a,'contextItems':_0xe98d99,'capabilities':_0x2ae2a9,'modelId':_0x3fd839,'attributes':_0x4be8a6}),await this['currentInteraction']['start'](),this['chatContext']['addToConversationContext'](this['currentInteraction']['contextItems']);}catch(_0x46041b){if(_0x46041b instanceof ot)this['fire']('error',{'interactionId':this['currentInteraction']?this['currentInteraction']['id']:void 0x0,'error':_0x46041b});else{const _0x50373c=Hs['get'](_0x46041b['code'])||'ai-chat-handle-user-interaction-start-failed';this['fire']('error',{'interactionId':this['currentInteraction']?this['currentInteraction']['id']:void 0x0,'error':new ot(_0x50373c,null,{'error':_0x46041b})});}}finally{this['currentInteraction']?.['stop'](),this['currentInteraction']=void 0x0;}}['createInteraction']({userMessage:_0x51cc77,contextItems:_0x461ca0,capabilities:_0x4b2528,modelId:_0x3c85b5,attributes:_0x7d8491}){const _0x48d43f=new Gs({'userMessage':_0x51cc77,'contextItems':_0x461ca0,'capabilities':_0x4b2528,'conversationId':this['id'],'connector':this['connector'],'editor':this['options']['getEditor']&&this['options']['getEditor'](),'model':_0x3c85b5,'attributes':_0x7d8491});return _0x48d43f['delegate'](...Ds)['to'](this),this['interactions']['push'](_0x48d43f),this['fire']('interactionCreated',_0x48d43f),_0x48d43f;}['getInteraction'](_0x2ff8f1){return this['interactions']['find'](_0x24dc08=>_0x24dc08['id']===_0x2ff8f1);}['removeInteraction'](_0x6f20c4){const _0x5dedbb=this['getInteraction'](_0x6f20c4);_0x5dedbb&&(_0x5dedbb['destroy'](),this['interactions']['splice'](this['interactions']['indexOf'](_0x5dedbb),0x1));}get['lastInteraction'](){return this['interactions'][this['interactions']['length']-0x1];}['addCurrentDocumentToContext'](_0xea3909){this['chatContext']['addCurrentDocumentToContext'](_0xea3909);}async['updateCurrentDocumentInContext']({content:_0x198f8e,version:_0x2d97ca,sessionId:_0x5793ef,selections:_0x5cb7c5}){await this['chatContext']['updateCurrentDocument'](_0x198f8e,_0x2d97ca,_0x5793ef,_0x5cb7c5);}['getCurrentDocumentContext'](){return this['currentInteraction']?.['getDocumentContext']()?.['content']||'';}['addSelectionToContext'](_0x2225c1){this['chatContext']['addSelectionToContext'](_0x2225c1);}['removeSelectionFromContext'](){this['chatContext']['removeSelectionFromContext']();}['addFilesToContext'](_0x1f0d58){this['chatContext']['addFilesToContext'](_0x1f0d58);}['addUrlToContext'](_0x540cad){this['chatContext']['addUrlToContext'](_0x540cad);}['addToolItemToContext'](_0x26f38b){this['chatContext']['addToolItemToContext'](_0x26f38b);}['addResourceToContext'](_0x59dba7,_0x494297){this['chatContext']['addResourceToContext'](_0x59dba7,_0x494297);}['loadSourceResources'](_0x242f5,_0x37a9c1,_0x318779){return this['chatContext']['loadSourceResources'](_0x242f5,_0x37a9c1,_0x318779);}['removeFromContext'](_0x2e361b){this['chatContext']['removeFromContext'](_0x2e361b);}['setWebSearch'](_0x4b3e10){this['chatCapabilities']['setWebSearch'](_0x4b3e10);}['toggleWebSearch'](){this['chatCapabilities']['toggleWebSearch']();}['setReasoning'](_0x24bdf7){this['chatCapabilities']['setReasoning'](_0x24bdf7);}['toggleReasoning'](){this['chatCapabilities']['toggleReasoning']();}['isCurrentDocumentInContext'](){return this['chatContext']['isCurrentDocumentInContext']();}['isCurrentDocumentInConversation'](){return this['chatContext']['isCurrentDocumentInConversation']();}['isSelectionInContext'](){return this['chatContext']['isSelectionInContext']();}async['setModel'](_0x2c93e6){_0x2c93e6?!0x1===await this['chatModels']['isAvailable'](_0x2c93e6)&&(pt('ai-chat-conversation-set-model-not-available',{'conversation':this,'model':_0x2c93e6}),_0x2c93e6=(await this['chatModels']['getAvailableModels']())[0x0]):(pt('ai-chat-conversation-set-model-null',{'conversation':this}),_0x2c93e6=(await this['chatModels']['getAvailableModels']())[0x0]),_0x2c93e6['id']!==this['selectedModel']?.['id']&&(this['selectedModel']=_0x2c93e6,this['chatCapabilities']['reset'](),this['fire']('modelSelected',{'selectedModel':_0x2c93e6}));}}class Ks extends Et(){['_connector'];['_config'];['_locale'];['_modelList']=[];['_modelsRequest']=null;constructor({connector:_0x1867ca,config:_0x530960,locale:_0x37826c}){super(),this['_connector']=_0x1867ca,this['_config']=_0x530960,this['_locale']=_0x37826c;}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 _0x259ac2=await this['getAll']();let _0x20cbe3;return _0x20cbe3=this['_availableModels']?this['_filterModels'](_0x259ac2,this['_availableModels']):_0x259ac2['filter'](_0x36d3d2=>_0x36d3d2['recommended']),_0x20cbe3;}async['getModel'](_0x28154f){const _0x2b31f3=await this['getAll']();if(!_0x2b31f3['length'])return null;if(_0x28154f){const _0x13d5b8=this['_getModelById'](_0x2b31f3,_0x28154f);if(_0x13d5b8)return _0x13d5b8;pt('ai-chat-model-id-unrecognized',{'modelId':_0x28154f,'fallBackModelId':this['_defaultModelId']});}return this['getDefault']();}async['getDefault'](){const _0x28d1fc=await this['getAvailableModels']();if(!_0x28d1fc['length'])return null;if(this['_defaultModelId']){const _0x502662=this['_getModelById'](_0x28d1fc,this['_defaultModelId']);if(_0x502662)return _0x502662;pt('ai-chat-default-model-id-unrecognized',{'defaultModelId':this['_defaultModelId'],'fallBackModelId':_0x28d1fc[0x0]['id']});}return _0x28d1fc[0x0];}async['isAvailable'](_0x2ebd61){return(await this['getAvailableModels']())['some'](_0x5660a6=>_0x5660a6['name']===_0x2ebd61['name']&&_0x5660a6['provider']===_0x2ebd61['provider']);}async['_retrieveModels'](){if(!this['_modelList']['length'])try{const _0xe32da9=this['_locale']['uiLanguage']||'en',_0x2f63f7=this['_connector']['getModels'](_0xe32da9),_0x3b062b=await _0x2f63f7['list']();this['_modelList']=_0x3b062b['items']['map'](_0x592b86=>Ws(_0x592b86)?{..._0x592b86,'name':cs(this['_locale'],'AI_MODEL_NAME_AUTO')}:_0x592b86);}catch(_0x286549){throw Tt('ai-models-unable-to-retrieve',{'error':_0x286549}),_0x286549;}return[...this['_modelList']];}['_filterModels'](_0x3e6271,_0x2f82ec){let _0x3b2564;if(_0x2f82ec){_0x3b2564=[];const _0x358dd5=new Set(),_0x14ff07='string'==typeof _0x2f82ec?[_0x2f82ec['toLocaleLowerCase']()]:_0x2f82ec['map'](_0x3570ff=>_0x3570ff['toLocaleLowerCase']());for(const _0x4566da of _0x14ff07)for(const _0x23fccf of _0x3e6271)!_0x358dd5['has'](_0x23fccf['id'])&&this['_isMatchingFilter'](_0x23fccf,_0x4566da)&&(_0x3b2564['push'](_0x23fccf),_0x358dd5['add'](_0x23fccf['id']));}else _0x3b2564=_0x3e6271;return _0x3b2564;}['_isMatchingFilter'](_0x46e68c,_0x46f652){const _0x28f663=_0x46e68c['id']['toLocaleLowerCase'](),_0x179546=_0x46e68c['name']['toLocaleLowerCase'](),_0xe8527c=_0x46e68c['provider']['toLocaleLowerCase']();return _0x28f663===_0x46f652||_0x179546===_0x46f652||Ws(_0x46e68c)&&'auto'===_0x46f652||_0xe8527c===_0x46f652||_0x28f663['startsWith'](_0x46f652);}['_getModelById'](_0x29478e,_0x49802c){return _0x29478e['find'](_0x2706e3=>Ws(_0x2706e3)&&'auto'===_0x49802c?_0x2706e3:_0x2706e3['id']===_0x49802c)||null;}}function Ws(_0x598c37){return _0x598c37['id']['startsWith']('agent');}function Ys(_0x3d5181){if(_0x3d5181 instanceof _0x53a714)return _0x3d5181;if(_0x3d5181?.['editors']&&_0x3d5181['editors']['get'](0x0))return _0x3d5181['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.'),_0x3d5181['editors']['get'](0x0);throw new ot('ai-get-editor-from-context-no-editor');}function $s({editor:_0x171789,interaction:_0x3126dc,reply:_0x2aca8e,groups:_0x240cd8,transform:_0x420c58,documentCompare:_0x58caef,documentCompareOptions:_0x594ef6}){const _0x45cadd=_0x3126dc['getDocumentContext']();if(!_0x45cadd)return[];const _0x50a984=_0x45cadd['content'],_0x3c7158=_0x45cadd['version'],_0x1b8abe=_0x2aca8e['documentContextContent']['cloneNode'](!0x0);for(const {changes:_0x6940e6}of _0x240cd8){const _0x448f14=_0x6940e6['filter'](_0x26b927=>'new'!=_0x26b927['type'])['map'](_0x652cc8=>Is('data-id',_0x652cc8['id'],_0x1b8abe)),_0x5c137f=_0x6940e6['filter'](_0x2ba031=>'removed'!=_0x2ba031['type'])['map'](_0x3e90d4=>_0x3e90d4['node']['cloneNode'](!0x0));let _0x14da9a=null;if(_0x448f14['length']){_0x14da9a=_0x448f14[0x0]['previousSibling'];for(let _0x5d4ddf=0x0;_0x5d4ddf<_0x448f14['length'];_0x5d4ddf++)_0xb6b4fd(_0x448f14[_0x5d4ddf]);}if(_0x5c137f['length']){_0x14da9a||(_0x6940e6[0x0]['anchorId']?_0x14da9a=Is('data-id',_0x6940e6[0x0]['anchorId'],_0x1b8abe):(_0x14da9a=_0x5c137f['shift'](),_0x289acd(_0x1b8abe,_0x14da9a)));for(let _0x5c3a0d=0x0;_0x5c3a0d<_0x5c137f['length'];_0x5c3a0d++)_0x1c657a(_0x14da9a,_0x5c137f[_0x5c3a0d]),_0x14da9a=_0x5c137f[_0x5c3a0d];}}const _0x44f436=gs(_0x1b8abe),_0x373f7f=_0x58caef['getDiff'](_0x50a984,_0x44f436,_0x594ef6)['getOperations']();if(_0x420c58){const _0x3c786d=_0x171789['model']['document']['history']['getOperations'](_0x3c7158),_0x3f6306={'document':_0x171789['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1};return _0x580dcc(_0x373f7f,_0x3c786d,_0x3f6306)['operationsA'];}return _0x373f7f;}function qs(_0x925b69,_0x3cac18){if('marker'!=_0x3cac18['type'])return;const _0x50d206=_0x925b69['model']['markers']['get'](_0x3cac18['name']);_0x50d206&&(_0x3cac18['oldRange']=_0x50d206['getRange']());}class Qs extends _0x5d2433{['activeConversation'];['_aiEditing'];['_aiConnector'];['_aiChatUi'];['_aiChatModels'];['_aiChatBalloon'];['_batchToChanges']=new Map();['_currentPreviewedChangeGroup']=null;['_bodyCollection'];static get['requires'](){return[hs,_0x39f273];}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 Ks({'connector':this['_aiConnector'],'config':this['context']['config']['get']('ai.models'),'locale':this['context']['locale']});const _0x916da6=this['context']['plugins']['get']('AITabs');this['listenTo'](this['_aiChatUi'],'startConversation',()=>{this['_startConversationSafely']();}),this['listenTo'](this['_aiChatUi'],'sendUserMessage',(_0x1e4193,_0xe4acfd)=>{this['_handleUIUserMessage']({'message':_0xe4acfd});}),this['listenTo'](_0x916da6,'resizedTabs',(_0x3eed1b,_0x7c6aea)=>{this['_setIsMaximized'](_0x7c6aea);}),this['listenTo'](this['_aiChatUi'],'resizeTabs',()=>{_0x916da6['resize']();}),this['listenTo'](_0x916da6['view'],'change:activeTab',(_0x8c8d86,_0x3dba67,_0x1163aa)=>{'chat'!==_0x1163aa&&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',(_0x130823,_0x9eee1a)=>{this['activeConversation']?.['addFilesToContext'](Array['from'](_0x9eee1a));}),this['listenTo'](this['_aiChatUi'],'addUrlToContext',(_0x21dbe5,_0x3fe6d3)=>{this['activeConversation']?.['addUrlToContext'](_0x3fe6d3);}),this['listenTo'](this['_aiChatUi'],'executeCustomItemCallback',(_0x38e7ec,_0x462ac7)=>{_0x462ac7['callback'](this['context']);}),this['listenTo'](this['_aiChatUi'],'addResourceToContext',(_0x491ee1,_0x2f1581)=>{this['activeConversation']?.['addResourceToContext'](_0x2f1581['source'],_0x2f1581['resource']);}),this['listenTo'](this['_aiChatUi'],'removeContextItem',(_0x1e7ed6,_0x5342fe)=>{this['_removeFromContext'](_0x5342fe);}),this['listenTo'](this['_aiChatUi'],'loadSourceResources',(_0x47afac,_0x4bd576)=>{this['activeConversation']?.['loadSourceResources'](_0x4bd576['sourceId'],_0x4bd576['query'],_0x4bd576['uid']);}),this['listenTo'](this['_aiChatUi'],'toggleWebSearch',()=>{this['_toggleWebSearch']();}),this['listenTo'](this['_aiChatUi'],'toggleReasoning',()=>{this['_toggleReasoning']();}),this['listenTo'](this['_aiChatUi'],'selectModel',(_0x45bcf4,_0x5ac3c4)=>{this['activeConversation']?.['setModel'](_0x5ac3c4);}),this['listenTo'](this['_aiChatUi'],'like',(_0x2b3c9b,{replyId:_0x31f7b4})=>{console['log']('Liked\x20response',_0x31f7b4);}),this['listenTo'](this['_aiChatUi'],'dislike',(_0x27fc1c,{replyId:_0x38d497})=>{console['log']('Disliked\x20response',_0x38d497);}),this['listenTo'](this['_aiChatUi'],'insertSuggestion',(_0x5e33cd,_0x2c46be)=>{this['_insertSuggestion'](_0x2c46be);}),this['listenTo'](this['_aiChatUi'],'showChangeInText',(_0x125cd7,{replyId:_0x1e399f,partIndex:_0x592f92})=>{this['_aiChatBalloonShowDiff']=this['_aiChatUi']['showDiff'],this['_openBalloonFor'](_0x1e399f,_0x592f92);}),this['listenTo'](this['_aiChatUi'],'mouseOverSuggestion',(_0x59839e,{replyId:_0x4ef3aa,partIndex:_0x270d8e})=>{const _0x33bdcf=this['_getDocumentRangeForReplyChanges'](_0x4ef3aa,_0x270d8e);_0x33bdcf&&'$graveyard'!=_0x33bdcf['range']['root']['rootName']&&this['_aiEditing']['showFakeVisualSelection']({'ranges':[_0x33bdcf['range']],'id':'change-area','priority':0xa});}),this['listenTo'](this['_aiChatUi'],'mouseLeaveSuggestion',()=>{this['_aiEditing']['hideFakeVisualSelection']('change-area');}),this['listenTo'](this['_aiChatUi'],'applySuggestion',(_0x3ffd28,_0x55a5df)=>{this['_aiEditing']['hideFakeVisualSelection']('change-area'),this['_applySuggestion'](_0x55a5df);}),this['listenTo'](this['_aiChatUi'],'toggleSuggestionDisplayMode',async(_0x49f39d,{replyId:_0x322161,showDiff:_0x10f49d})=>{const {reply:_0x204b06}=this['getInteractionAndReplyById'](_0x322161),_0x64b68e=_0x204b06['getContentParts']({'showDiff':_0x10f49d});await this['_aiChatUi']['updateFeedItemAIReplySuggestionContent']({'id':_0x204b06['id'],'parts':_0x64b68e,'renderingStrategy':'static'});}),this['listenTo'](this['_aiChatUi'],'rejectSuggestion',(_0x161b6e,{replyId:_0x1e4675,partIndex:_0x258dc2})=>{this['_rejectSuggestion']({'replyId':_0x1e4675,'partIndex':_0x258dc2}),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:_0x36544e,partIndex:_0xa27a72}=this['_currentPreviewedChangeGroup'];this['_aiChatBalloonShowDiff']=!this['_aiChatBalloonShowDiff'];const {reply:_0x3ee5a6}=this['getInteractionAndReplyById'](_0x36544e),_0x3ed5b3=_0x3ee5a6['getContentParts']({'showDiff':this['_aiChatBalloonShowDiff'],'groupIndex':_0xa27a72});this['_aiChatBalloon']['updateContent']({'part':_0x3ed5b3[0x0],'renderingStrategy':'static','keepErrors':!0x0});}),this['listenTo'](this['_aiChatBalloon'],'applySuggestion',()=>{const {replyId:_0x13db24,partIndex:_0x4758f7}=this['_currentPreviewedChangeGroup'];this['_applySuggestion']({'replyId':_0x13db24,'partIndex':_0x4758f7}),this['_aiChatBalloon']['setState']('accepted');}),this['listenTo'](this['_aiChatBalloon'],'insertSuggestion',()=>{const {replyId:_0x3f89b9,partIndex:_0xff03f5}=this['_currentPreviewedChangeGroup'];this['_insertSuggestion']({'replyId':_0x3f89b9,'partIndex':_0xff03f5}),this['_aiChatBalloon']['setState']('accepted');}),this['listenTo'](this['_aiChatBalloon'],'rejectSuggestion',()=>{const {replyId:_0x4dd1a9,partIndex:_0x21c2f1}=this['_currentPreviewedChangeGroup'];this['_rejectSuggestion']({'replyId':_0x4dd1a9,'partIndex':_0x21c2f1}),this['_aiChatBalloon']['setState']('rejected');}),this['listenTo'](this['_aiChatBalloon'],'showNext',()=>{const {replyId:_0x130b15,partIndex:_0x36c229}=this['_currentPreviewedChangeGroup'],_0xa72ed=this['_getPresentableSiblingContentPartIndex'](_0x130b15,_0x36c229,'next');null!==_0xa72ed&&this['_openBalloonFor'](_0x130b15,_0xa72ed);}),this['listenTo'](this['_aiChatBalloon'],'showPrevious',()=>{const {replyId:_0x11903b,partIndex:_0x4cb319}=this['_currentPreviewedChangeGroup'],_0x3f3219=this['_getPresentableSiblingContentPartIndex'](_0x11903b,_0x4cb319,'previous');null!==_0x3f3219&&this['_openBalloonFor'](_0x11903b,_0x3f3219);}),this['listenTo'](this['_aiChatBalloon'],'dialogClosed',(_0x22e859,{id:_0x32d188})=>{if('aiChatBalloon'!==_0x32d188)return;const {replyId:_0x49ec9e,partIndex:_0x1c470a}=this['_currentPreviewedChangeGroup'];this['_currentPreviewedChangeGroup']=null,this['_aiChatUi']['setFeedItemAIReplySuggestionPartActive']({'id':_0x49ec9e,'index':_0x1c470a,'isActive':!0x1});})),this['on']('interactionCreated',(_0xe831b8,_0x3fda7b)=>{this['_aiChatUi']['addFeedItemUserMessage'](_0x3fda7b);}),this['on']('replyCreated',(_0x166d44,_0x273f0c)=>{this['_addFeedItemReply'](_0x273f0c);});}async['afterInit'](){this['context']instanceof _0x53a714?this['_integrateEditor'](this['context']):this['listenTo'](this['context']['editors'],'add',(_0x574f89,_0x1fcdaa)=>{_0x1fcdaa['on']('ready',()=>{this['_integrateEditor'](_0x1fcdaa);});});const _0x57a198=this['context']['config']['get']('ai.chat.initialConversation');let _0x386f55=_0x57a198;if('lastCreated'!=_0x57a198||(_0x386f55=await this['_getLastCreatedConversationId'](),_0x386f55))return'new'==_0x386f55?this['_startConversationSafely']():this['loadConversation'](_0x386f55);}async['destroy'](){return await this['_stopLastInteraction'](),this['_bodyCollection']['detachFromDom'](),super['destroy']();}async['loadConversation'](_0x2e5de8){this['context']['plugins']['has']('AIChatBalloon')&&this['context']['plugins']['get']('AIChatBalloon')['close'](),(this['context']['plugins']['get'](os)['view']['activateTab']('chat'),this['_aiChatUi']['setFeedItemRenderingStrategy']('static'),this['_aiChatUi']['toggleLoadingSkeleton'](!0x0),await this['_stopLastInteraction']());try{await this['_aiConnector']['fetchConversation'](_0x2e5de8)['getConversation'](),await this['_startConversationSafely'](_0x2e5de8),this['_updateConversationTitle']('\x20'),await this['activeConversation']['load'](_0x2e5de8,this['_aiEditing']['sessionId']),this['activeConversation']['isCurrentDocumentInConversation']()&&this['addCurrentDocumentToChatContext']();}catch(_0x4d63dd){this['_aiChatUi']['addFeedItemError']({'errorMessage':cs(this['context']['locale'],'AI_CHAT_UNABLE_TO_LOAD_CONVERSATION'),'id':_0x2e5de8}),this['_logError'](new ot('ai-chat-conversation-not-found',this,{'error':_0x4d63dd}));}finally{this['_aiChatUi']['startAutoScroll'](),this['_aiChatUi']['setFeedItemRenderingStrategy']('streaming'),this['_aiChatUi']['toggleLoadingSkeleton'](!0x1);}}['registerToolDataCallback'](_0xcc9554){let _0x42bc6a=null,_0x40d648=null;this['on']('toolDataReceived',(_0x56263d,_0x401640,_0x27260e)=>{_0x27260e['id']!==_0x42bc6a&&(_0x42bc6a=_0x27260e['id'],_0x40d648=this['_getAIChatFeedAPI'](_0x27260e)),_0xcc9554(_0x401640,_0x40d648);});}['addCurrentDocumentToChatContext'](){this['activeConversation']?.['addCurrentDocumentToContext'](cs(this['context']['locale'],'AI_CHAT_CONTEXT_CURRENT_DOCUMENT'));}async['addSelectionToChatContext'](){const _0x3ef099=this['_aiEditing']['getSelectionText']();this['activeConversation']?.['addSelectionToContext'](_0x3ef099),this['addCurrentDocumentToChatContext']();}['removeSelectionFromChatContext'](){this['activeConversation']?.['removeSelectionFromContext']();}['focusPromptInput'](){this['_aiChatUi']['focusPromptInput']();}async['startConversation'](){await this['_startConversationSafely']();}async['sendMessage'](_0x46a62b){await this['_handleUIUserMessage'](_0x46a62b);}['getGroupId'](){const _0x22e617=this['context']['config']['get']('collaboration.channelId');if(!_0x22e617)throw new ot('ai-chat-missing-channel-id',this);return _0x22e617;}['_handleRemovedConversation'](_0x4255e3){this['activeConversation']['id']===_0x4255e3&&this['_startConversationSafely']();}['_insertSuggestion'](_0x897cd){const _0x4a1ff6=Ys(this['context']);if(!_0x4a1ff6['plugins']['has']('TrackChanges'))throw new ot('ai-no-track-changes',null);const _0x394325=this['context']['plugins']['get']('DocumentCompare'),{reply:_0x3498a2,interaction:_0x32008b}=this['getInteractionAndReplyById'](_0x897cd['replyId']),_0x4dea31=this['_getDocumentRangeForReplyChanges'](_0x897cd['replyId'],_0x897cd['partIndex']),_0x5a2d7c=void 0x0!==_0x897cd['partIndex']?[_0x3498a2['changeGroups'][_0x897cd['partIndex']]]:_0x3498a2['changeGroups']['filter'](_0x24b6b5=>'pending'==_0x24b6b5['state']),_0xb88a7=_0x5a2d7c['map'](_0x4c8b9d=>_0x3498a2['changeGroups']['indexOf'](_0x4c8b9d));if(!_0x4dea31||'$graveyard'==_0x4dea31['range']['root']['rootName'])return void _0xb88a7['forEach'](_0x5c70bf=>_0x3498a2['setChangeGroupState'](_0x5c70bf,'outdated'));_0xb88a7['forEach'](_0x209c96=>_0x3498a2['setChangeGroupState'](_0x209c96,'accepted'));const _0x2a4424=$s({'editor':_0x4a1ff6,'reply':_0x3498a2,'interaction':_0x32008b,'groups':_0x5a2d7c,'transform':!0x0,'documentCompare':_0x394325,'documentCompareOptions':{'anchor':'main','markDeletions':!0x0}});let _0x1788c6;_0x4dea31&&this['_scrollToSuggestionRange'](_0x4dea31['range']),_0x4a1ff6['model']['change'](_0x3759a2=>{_0x1788c6=_0x3759a2['batch'],_0x4a1ff6['plugins']['get']('TrackChangesEditing')['_applyOperationsAsSuggestions'](_0x2a4424),this['_aiEditing']['hideFakeVisualSelection']('change-area');}),this['_batchToChanges']['set'](_0x1788c6,{'interactionId':_0x32008b['id'],'replyId':_0x3498a2['id'],'indexes':_0xb88a7['slice']()}),this['_updateRatings'](_0x3498a2);}['_applySuggestion'](_0x26418a){const _0x321746=Ys(this['context']),_0x2d8e00=this['context']['plugins']['get'](_0x39f273),{reply:_0x2cb29f,interaction:_0x4067e2}=this['getInteractionAndReplyById'](_0x26418a['replyId']),_0xfa0ff5=this['_getDocumentRangeForReplyChanges'](_0x26418a['replyId'],_0x26418a['partIndex']),_0x275eca=void 0x0!==_0x26418a['partIndex']?[_0x2cb29f['changeGroups'][_0x26418a['partIndex']]]:_0x2cb29f['changeGroups']['filter'](_0x5c8a89=>'pending'==_0x5c8a89['state']),_0x3c082e=_0x275eca['map'](_0x4ac5b9=>_0x2cb29f['changeGroups']['indexOf'](_0x4ac5b9));if(!_0xfa0ff5||'$graveyard'==_0xfa0ff5['range']['root']['rootName'])return void _0x3c082e['forEach'](_0x4a6e62=>_0x2cb29f['setChangeGroupState'](_0x4a6e62,'outdated'));_0x3c082e['forEach'](_0x5ef08e=>_0x2cb29f['setChangeGroupState'](_0x5ef08e,'accepted'));const _0x33480c=$s({'editor':_0x321746,'reply':_0x2cb29f,'interaction':_0x4067e2,'groups':_0x275eca,'transform':!0x0,'documentCompare':_0x2d8e00,'documentCompareOptions':{'anchor':'main','markDeletions':!0x1}});let _0x43bd32;_0xfa0ff5&&this['_scrollToSuggestionRange'](_0xfa0ff5['range']),_0x321746['model']['change'](_0x2c35d4=>{_0x43bd32=_0x2c35d4['batch'];for(const _0x5e92bc of _0x33480c)_0x5e92bc['baseVersion']=_0x321746['model']['document']['version'],qs(_0x321746,_0x5e92bc),_0x2c35d4['batch']['addOperation'](_0x5e92bc),_0x321746['model']['applyOperation'](_0x5e92bc);}),this['_batchToChanges']['set'](_0x43bd32,{'interactionId':_0x4067e2['id'],'replyId':_0x2cb29f['id'],'indexes':_0x3c082e['slice']()}),this['_updateRatings'](_0x2cb29f);}['_rejectSuggestion'](_0x2e0e7e){const {reply:_0x471275}=this['getInteractionAndReplyById'](_0x2e0e7e['replyId']);_0x471275['setChangeGroupState'](_0x2e0e7e['partIndex'],'rejected');}['_openBalloonFor'](_0x5c197e,_0x405b60){if(!this['_aiChatBalloon'])return;const {reply:_0x5e8e11}=this['getInteractionAndReplyById'](_0x5c197e),_0x218ab7=_0x5e8e11['getContentParts']({'showDiff':this['_aiChatBalloonShowDiff']});let _0x489e6d,_0x433ff;if(void 0x0!==_0x405b60?(_0x433ff=_0x218ab7['find'](_0x2e257e=>_0x2e257e['index']==_0x405b60),_0x489e6d=_0x433ff?.['index']):(_0x433ff=_0x218ab7[0x0],_0x489e6d=_0x433ff['index']),this['_currentPreviewedChangeGroup']?.['replyId']==_0x5c197e&&this['_currentPreviewedChangeGroup']?.['partIndex']==_0x489e6d)return;const _0x4a163a=this['_getUserPresentableContentPartDocumentRange'](_0x5c197e,_0x5e8e11,_0x433ff);if(!_0x4a163a)return void this['_aiChatBalloon']['close']();this['_currentPreviewedChangeGroup']={'replyId':_0x5c197e,'partIndex':_0x489e6d},this['_scrollToSuggestionRange'](_0x4a163a,!0x0);const _0x427444=this['_getPresentableSiblingContentPartIndex'](_0x5c197e,_0x489e6d,'next');this['_aiChatBalloon']['updateContent']({'part':_0x433ff,'renderingStrategy':'static'}),this['_aiChatBalloon']['open']({'index':_0x489e6d,'title':cs(this['context']['locale'],'AI_BALLOON_HEADER_TITLE',(_0x489e6d+0x1)['toString']()),'showRotator':null!==_0x427444,'ranges':[_0x4a163a],'areActionsDisabled':_0x5e8e11['areActionsDisabled']}),this['_aiChatBalloon']['setState']('pending'),this['_aiChatUi']['scrollFeedToSuggestion'](_0x5c197e,_0x489e6d),this['_aiChatUi']['setFeedItemAIReplySuggestionPartActive']({'id':_0x5c197e,'index':_0x489e6d,'isActive':!0x0});}['_getPresentableSiblingContentPartIndex'](_0x1cee89,_0x35551c,_0x1a06b2){const {reply:_0x484c7a}=this['getInteractionAndReplyById'](_0x1cee89),_0xfdb1f1=_0x484c7a['getContentParts']({'showDiff':this['_aiChatBalloonShowDiff']});if(0x1==_0xfdb1f1['length'])return null;const _0x32b289=_0xfdb1f1['findIndex'](_0x14de59=>_0x14de59['index']==_0x35551c),_0x5ac94f='next'==_0x1a06b2?0x1:-0x1;let _0x5ddcbe=_0xfdb1f1['at']((_0x32b289+_0x5ac94f)%_0xfdb1f1['length'])['index'],_0x20e470=_0xfdb1f1[_0x5ddcbe];for(;!this['_getUserPresentableContentPartDocumentRange'](_0x1cee89,_0x484c7a,_0x20e470);){if(_0x5ddcbe=_0xfdb1f1['at']((_0x5ddcbe+_0x5ac94f)%_0xfdb1f1['length'])['index'],_0x5ddcbe===_0x32b289)return null;_0x20e470=_0xfdb1f1[_0x5ddcbe];}return _0x5ddcbe;}['_getUserPresentableContentPartDocumentRange'](_0x4cc54e,_0x5035d9,_0x5995ac){const _0x6f5171=_0x5035d9['changeGroups'];if(!_0x5995ac['hasChanges'])return null;const _0x104d28=_0x6f5171['find'](_0xd08a3c=>_0xd08a3c['index']==_0x5995ac['index']);if('pending'!==_0x104d28?.['state'])return null;const _0x2c8357=this['_getDocumentRangeForReplyChanges'](_0x4cc54e,_0x5995ac['index']);if(!_0x2c8357)return null;const {range:_0x56703e,currentIndex:_0x1d5938}=_0x2c8357;return'$graveyard'==_0x56703e['root']['rootName']?(_0x5035d9['setChangeGroupState'](_0x1d5938,'outdated'),null):_0x2c8357['range'];}['_getDocumentRangeForReplyChanges'](_0x519f84,_0x1facce){const _0x5208cf=Ys(this['context']),{reply:_0x8af7c7,interaction:_0x164adc}=this['getInteractionAndReplyById'](_0x519f84),_0x3ebf62=_0x8af7c7['changeGroups']['filter'](_0x1a0cf7=>'pending'==_0x1a0cf7['state']),_0x2ff41c=_0x3ebf62['map'](_0x1a9f7d=>_0x8af7c7['changeGroups']['indexOf'](_0x1a9f7d));void 0x0===_0x1facce&&(_0x1facce=_0x2ff41c[0x0]);const _0x1fe394=_0x2ff41c['indexOf'](_0x1facce);if(-0x1==_0x1fe394)return null;const _0x3e84f1=_0x3ebf62[_0x1fe394],_0x408045=new _0x10a8a7([]),_0x5645be=new _0x10a8a7([]);for(const _0xea41b3 of _0x3e84f1['changes'])if('removed'!=_0xea41b3['type']&&_0x5645be['children']['push'](_0xea41b3['node']['cloneNode'](!0x0)),'new'!=_0xea41b3['type']){const _0x4dc575=_0x5133a0(_0x83ed54=>ps(_0x83ed54,'data-id')==_0xea41b3['id'],_0x8af7c7['documentContextContent'],!0x0);_0x408045['children']['push'](_0x4dc575['cloneNode'](!0x0));}if(0x0==_0x408045['children']['length']){if(_0x3e84f1['changes'][0x0]['anchorId']){const _0x279c9d=Is('data-id',_0x3e84f1['changes'][0x0]['anchorId'],_0x8af7c7['documentContextContent']);_0x408045['children']['unshift'](_0x279c9d['cloneNode'](!0x0)),_0x5645be['children']['unshift'](_0x279c9d['cloneNode'](!0x0)),_0x279c9d['nextSibling']&&(_0x408045['children']['push'](_0x279c9d['nextSibling']['cloneNode'](!0x0)),_0x5645be['children']['push'](_0x279c9d['nextSibling']['cloneNode'](!0x0)));}else{const _0x471246=_0x8af7c7['documentContextContent']['children'][0x0];if(!_0x471246)return null;_0x408045['children']['push'](_0x471246['cloneNode'](!0x0)),_0x5645be['children']['push'](_0x471246['cloneNode'](!0x0));}}const _0x2bd3c3=_0x164adc['getDocumentContext'](),_0x39d822=_0x5208cf['data']['parse'](_0x2bd3c3['content']),_0xbb3c49=gs(_0x408045),_0x3b70bb=_0x5208cf['data']['parse'](_0xbb3c49),_0x137ce9=_0x5208cf['data']['parse'](_0xbb3c49),_0x1a2ed6=_0x5208cf['model']['createPositionAt'](_0x3b70bb,0x0),_0x505705=gs(_0x5645be),_0xb8d5ae={'anchor':_0x1a2ed6,'markDeletions':!0x1},_0x2aa60a=_0x5208cf['plugins']['get'](_0x39f273)['getDiff'](_0xbb3c49,_0x505705,_0xb8d5ae)['getOperations']();if(!_0x2aa60a['length'])return null;_0x5208cf['model']['change'](_0x86e72b=>{for(const _0x5dc5a6 of _0x2aa60a)if('remove'==_0x5dc5a6['type']){const _0x43924d=_0x5dc5a6['sourcePosition'],_0x5399ad=_0x5dc5a6['howMany'],_0x3292b2=new _0x338816(_0x43924d,_0x5399ad);_0x86e72b['batch']['addOperation'](_0x3292b2),_0x5208cf['model']['applyOperation'](_0x3292b2);}else'marker'!==_0x5dc5a6['type']&&(_0x5dc5a6['baseVersion']=null,_0x5dc5a6['isDocumentOperation']=!0x1,_0x86e72b['batch']['addOperation'](_0x5dc5a6),_0x5208cf['model']['applyOperation'](_0x5dc5a6));});const _0x3b1495=Ns(_0x5208cf,_0x2aa60a,_0x3b70bb);vs(_0x5208cf['model'],_0x3b1495);const _0x4b6cbc=_0x3b1495['getFirstRange']()['start']['path']['slice'](),_0xe31d73=_0x3b1495['getFirstRange']()['end']['path']['slice'](),_0x5b893a=[];let _0x1696d4=_0x3b70bb,_0x3f4842=_0x137ce9;for(let _0x49ea5a=0x0;_0x49ea5a<_0xe31d73['length'];_0x49ea5a++){const _0x2fb99=_0x1696d4['maxOffset']-_0xe31d73[_0x49ea5a];_0x5b893a[_0x49ea5a]=_0x3f4842['maxOffset']-_0x2fb99,_0x1696d4=_0x1696d4['getChildAtOffset'](_0xe31d73[_0x49ea5a]),_0x3f4842=_0x3f4842['getChildAtOffset'](_0x5b893a[_0x49ea5a]);}const _0x29b99e=_0x5208cf['model']['createRange'](_0x5208cf['model']['createPositionFromPath'](_0x137ce9,_0x4b6cbc),_0x5208cf['model']['createPositionFromPath'](_0x137ce9,_0x5b893a)),_0x55bd4e=_0x137ce9['getChild'](0x0)['getAttribute'](_0x4aa46b),_0x46ff62=Array['from'](_0x39d822['getChildren']())['find'](_0x44c69d=>_0x44c69d['getAttribute'](_0x4aa46b)==_0x55bd4e)['getPath'](),_0x5740b1=_0x29b99e['start']['path']['slice'](),_0x256211=_0x29b99e['end']['path']['slice']();_0x5740b1[0x0]=_0x46ff62[0x0]+_0x5740b1[0x0],_0x256211[0x0]=_0x46ff62[0x0]+_0x256211[0x0];let _0x4399e7=_0x5208cf['model']['createRange'](_0x5208cf['model']['createPositionFromPath'](_0x5208cf['model']['document']['getRoot'](),_0x5740b1),_0x5208cf['model']['createPositionFromPath'](_0x5208cf['model']['document']['getRoot'](),_0x256211));const _0x172d54=_0x5208cf['model']['document']['history']['getOperations'](_0x2bd3c3['version']);for(const _0x5e52fb of _0x172d54)_0x4399e7=_0x42ff50['_createFromRanges'](_0x4399e7['getTransformedByOperation'](_0x5e52fb));return{'range':_0x4399e7,'currentIndex':_0x1facce};}['_integrateEditor'](_0xadabec){if(_0xadabec['plugins']['has']('Undo')){const _0x4296ad=_0xadabec['commands']['get']('undo'),_0x5b441a=_0xadabec['commands']['get']('redo');this['listenTo'](_0x4296ad,'revert',(_0xf301cd,_0x48b15e,_0x471a6d)=>{const _0x52a07e=this['_batchToChanges']['get'](_0x48b15e);if(!_0x52a07e)return;const _0x2b1357=this['activeConversation']['getInteraction'](_0x52a07e['interactionId'])['getReply'](_0x52a07e['replyId']);_0x52a07e['indexes']['forEach'](_0x528f21=>_0x2b1357['setChangeGroupState'](_0x528f21,'pending')),this['_batchToChanges']['delete'](_0x48b15e),this['_batchToChanges']['set'](_0x471a6d,_0x52a07e);}),this['listenTo'](_0x5b441a,'revert',(_0x46269c,_0x5ab63b,_0x3098)=>{const _0x3404f1=this['_batchToChanges']['get'](_0x5ab63b);if(!_0x3404f1)return;const _0x82086a=this['activeConversation']['getInteraction'](_0x3404f1['interactionId'])['getReply'](_0x3404f1['replyId']);_0x3404f1['indexes']['forEach'](_0x48112d=>_0x82086a['setChangeGroupState'](_0x48112d,'accepted')),this['_batchToChanges']['delete'](_0x5ab63b),this['_batchToChanges']['set'](_0x3098,_0x3404f1);});}const _0x363293=_0xadabec['config']['get']('ai.chat.context');_0x363293['alwaysAddSelection']&&_0x363293['document']['enabled']&&this['listenTo'](_0xadabec['model']['document']['selection'],'change:range',(_0x5978c0,_0x29ccba)=>{if(!_0x29ccba['directChange'])return;'chat'===_0xadabec['plugins']['get']('AITabs')['view']['activeTab']&&(_0xadabec['model']['hasContent'](_0xadabec['model']['document']['selection'])?this['addSelectionToChatContext']():this['removeSelectionFromChatContext']());});}async['_getLastCreatedConversationId'](){const _0x23dd29=this['_aiConnector']['fetchConversations'](this['getGroupId'](),{'limit':0x1,'sortBy':'createdAt'});try{const _0x53b13f=await _0x23dd29['getConversations']();return _0x53b13f['length']?_0x53b13f[0x0]['id']:'new';}catch(_0x1f5890){return this['_aiChatUi']['addFeedItemError']({'errorMessage':cs(this['context']['locale'],'AI_CHAT_UNABLE_TO_LOAD_CONVERSATION'),'id':at()}),this['_logError'](new ot('ai-chat-conversation-init-failed',this,{'error':_0x1f5890})),this['_aiChatUi']['toggleLoadingSkeleton'](!0x1),this['_aiChatUi']['disableControls'](),null;}}async['_startConversationSafely'](_0x426d1f){try{this['_aiChatUi']['enableControls'](),await this['_handleStartConversation'](_0x426d1f);}catch(_0x54185d){this['_aiChatUi']['addFeedItemError']({'errorMessage':cs(this['context']['locale'],'AI_CHAT_UNABLE_TO_START_CONVERSATION'),'id':_0x426d1f||at()}),console['error'](_0x54185d),this['activeConversation']=void 0x0,this['_aiChatUi']['disableControls']();}}async['_handleStartConversation'](_0x35f539){let _0x4b3167;this['context']['plugins']['has']('AIChatBalloon')&&this['context']['plugins']['get']('AIChatBalloon')['close'](),_0x35f539||!this['activeConversation']?_0x4b3167=this['context']['config']['get']('ai.models.defaultModelId'):this['_aiChatUi']['isModelAvailable']&&(_0x4b3167=this['activeConversation']['selectedModel']['id']),await this['_stopLastInteraction']();const _0x57247f=this['getGroupId'](),_0x3c6989=_0x35f539||at();this['activeConversation']=new Fs({'connector':this['_aiConnector'],'chatModels':this['_aiChatModels'],'selectedModelId':_0x4b3167,'conversationId':_0x3c6989,'group':_0x57247f,'getEditor':()=>Ys(this['context']),'isFromHistory':!!_0x35f539}),this['activeConversation']['delegate']('toolDataReceived','interactionCreated','interactionStarted','replyCreated')['to'](this),this['activeConversation']['on']('conversationInitialized',(_0x401b19,_0x361ef5)=>{this['_aiChatUi']['createConversation'](_0x361ef5),this['_aiChatUi']['resetMessageInput'](),this['_aiChatUi']['clearPendingContextUI'](),this['_aiChatUi']['clearConversationContextUI'](),_0x35f539||(this['_aiChatUi']['resetConversationTitle'](),this['addCurrentDocumentToChatContext']());}),this['activeConversation']['on']('uploadProgressChanged',(_0x5d11ac,_0x2b5a97)=>{this['_aiChatUi']['setIsUploadInProgress'](_0x2b5a97['isUploadInProgress']);}),this['activeConversation']['on']('webSearchStarted',()=>{const _0x2a4648=this['_aiChatUi']['prepareLoadingMessage']({'isWebSearchEnabled':!0x0,'isReasoningEnabled':!0x1});this['_aiChatUi']['setLoadingMessage'](_0x2a4648);}),this['activeConversation']['on']('reasoningStarted',()=>{const _0x329c66=this['_aiChatUi']['prepareLoadingMessage']({'isWebSearchEnabled':!0x1,'isReasoningEnabled':!0x0});this['_aiChatUi']['setLoadingMessage'](_0x329c66);}),this['activeConversation']['on']('webSearchFinished',(_0x28641e,_0x3ca065)=>{this['_aiChatUi']['addFeedInteractionHeader'](_0x3ca065,{'isWebSearchEnabled':!0x0,'isReasoningEnabled':!0x1});}),this['activeConversation']['on']('reasoningFinished',(_0x454ca1,_0x389f83)=>{this['_aiChatUi']['addFeedInteractionHeader'](_0x389f83,{'isWebSearchEnabled':!0x1,'isReasoningEnabled':!0x0});}),this['activeConversation']['on']('interactionStarted',()=>{this['_aiChatUi']['startInteraction']();}),this['activeConversation']['on']('interactionFinished',async()=>{await this['_aiChatUi']['finishInteraction']();}),this['activeConversation']['on']('interactionDestroyed',(_0x1d9714,_0x87af1a)=>{this['_aiChatUi']['removeFeedInteraction'](_0x87af1a['id']);}),this['activeConversation']['on']('setConversationTitle',(_0x2335a0,_0x28c5a0,_0x36c017)=>{this['_updateConversationTitle'](_0x28c5a0,_0x36c017);}),this['activeConversation']['on']('replyContentUpdated',async(_0x4ce0ef,_0x3827f0)=>{await this['_updateReplyContent']({'reply':_0x3827f0});}),this['activeConversation']['on']('replyChangeGroupStateUpdated',(_0x1195db,{reply:_0x5849cb,index:_0x3478c2,state:_0x3e0829})=>{this['_aiChatUi']['updateFeedItemAIReplySuggestionPartState']({'id':_0x5849cb['id'],'index':_0x3478c2,'state':_0x3e0829}),this['_currentPreviewedChangeGroup']?.['replyId']['includes'](_0x5849cb['id'])&&this['_currentPreviewedChangeGroup']?.['partIndex']==_0x3478c2&&this['_aiChatBalloon']?.['setState'](_0x3e0829);}),this['activeConversation']['on']('contextItemAdded',(_0x39e809,_0x1303a5)=>{if(this['_aiChatUi']['addContextItem'](_0x1303a5['contextItem'],_0x1303a5['isLoading']),'selection'===_0x1303a5['contextItem']['type']){const _0x72fcae=[...Ys(this['context'])['model']['document']['selection']['getRanges']()];this['_aiEditing']['showFakeVisualSelection']({'ranges':_0x72fcae,'id':'context','priority':0x1});}}),this['activeConversation']['on']('contextItemRemoved',(_0x5d601e,_0x8fdf53)=>{this['_aiChatUi']['removeContextItem'](_0x8fdf53['uiId']),'current-document'==_0x8fdf53['uiId']&&this['removeSelectionFromChatContext'](),'selection'===_0x8fdf53['type']&&this['_aiEditing']['hideFakeVisualSelection']('context');}),this['activeConversation']['on']('contextItemLoadingEnded',(_0x271099,_0x1fead9)=>{this['_aiChatUi']['setContextItemLoading'](_0x1fead9['contextItem']['uiId'],_0x1fead9['isLoading']);}),this['activeConversation']['on']('contextSent',(_0xc4ee39,_0x20b661)=>{this['_aiChatUi']['setConversationContext'](_0x20b661['contextItems']);}),this['activeConversation']['on']('addContextOptionsChanged',(_0x231d8d,_0x4a5034)=>{this['_aiChatUi']['setAddContextOptions'](_0x4a5034['options']);}),this['activeConversation']['on']('sourceResourcesLoaded',(_0x1aa2e2,_0x38a1a4)=>{this['_aiChatUi']['populateSourceResourceBalloon'](_0x38a1a4['sourceId'],_0x38a1a4['source'],_0x38a1a4['resources'],_0x38a1a4['uid']);}),this['activeConversation']['on']('resourceStateChanged',(_0xc3e64,_0x34788b)=>{this['_aiChatUi']['updateResourceState'](_0x34788b['sourceId'],_0x34788b['resourceId'],_0x34788b['isInContext']);}),this['activeConversation']['on']('capabilitiesUpdated',(_0xe9ef27,_0x1951aa)=>{this['_aiChatUi']['updateCapabilities'](_0x1951aa);}),this['activeConversation']['on']('modelSelected',async(_0x6c10b2,_0x190ee4)=>{const _0x1603b6=(await this['_aiChatModels']['getAll']())['find'](_0x581455=>_0x581455['id']===_0x190ee4['selectedModel']?.['id'])||null;this['_aiChatUi']['setSelectedModel'](_0x1603b6,_0x190ee4['isDisabled']);}),this['activeConversation']['on']('error',(_0xe581e0,{error:_0x4a2792,interactionId:_0x1b692f,fileName:_0x280bfa,url:_0x2a9542,sourceId:_0x2e06e2,sourceLabel:_0x18a695})=>{const _0x45c56a=_0x1b692f?_0x1b692f+':'+at():at();_0x4a2792['message']['startsWith']('ai-request-aborted')?this['_aiChatUi']['addFeedItemStaticMessage']({'staticMessage':cs(this['context']['locale'],'AI_CHAT_ABORTED_MESSAGE'),'id':_0x45c56a}):_0x4a2792['message']['startsWith']('ai-chat-conversation-init-failed')||_0x4a2792['message']['startsWith']('ai-chat-conversation-start-failed')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':cs(this['context']['locale'],'AI_CHAT_UNABLE_TO_START_CONVERSATION'),'id':_0x45c56a}),this['_logError'](_0x4a2792)):_0x4a2792['message']['startsWith']('ai-chat-file-upload-failed')?this['_aiChatUi']['addFeedItemError']({'errorMessage':cs(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_FILE',_0x280bfa),'id':_0x45c56a}):_0x4a2792['message']['startsWith']('ai-chat-url-upload-failed')?this['_aiChatUi']['addFeedItemError']({'errorMessage':cs(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_URL',_0x2a9542),'id':_0x45c56a}):_0x4a2792['message']['startsWith']('ai-chat-context-invalid-data')?this['_aiChatUi']['addFeedItemError']({'errorMessage':cs(this['context']['locale'],'AI_CHAT_CONTEXT_INVALID_DATA'),'id':_0x45c56a}):_0x4a2792['message']['startsWith']('ai-chat-context-unsupported-type')?this['_aiChatUi']['addFeedItemError']({'errorMessage':cs(this['context']['locale'],'AI_CHAT_CONTEXT_UNSUPPORTED_TYPE'),'id':_0x45c56a}):_0x4a2792['message']['startsWith']('ai-chat-source-resources-load-failed')?(_0x2e06e2&&this['_aiChatUi']['closeSourceResourceBalloon'](_0x2e06e2),this['_aiChatUi']['addFeedItemError']({'errorMessage':cs(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_LOAD_RESOURCES',_0x18a695||'source'),'id':_0x45c56a}),this['_logError'](_0x4a2792)):_0x4a2792['message']['startsWith']('ai-chat-resource-load-failed')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':cs(this['context']['locale'],'AI_CHAT_RESOURCE_LOAD_FAILED'),'id':_0x45c56a}),this['_logError'](_0x4a2792)):_0x4a2792['message']['startsWith']('ai-chat-invalid-request')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':cs(this['context']['locale'],'AI_CHAT_INVALID_REQUEST'),'id':_0x45c56a}),this['_logError'](_0x4a2792)):_0x4a2792['message']['startsWith']('ai-chat-context-unsupported-file-type')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':cs(this['context']['locale'],'AI_CHAT_CONTEXT_UNSUPPORTED_FILE_TYPE'),'id':_0x45c56a}),this['_logError'](_0x4a2792)):_0x4a2792['message']['startsWith']('ai-chat-context-file-too-large')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':cs(this['context']['locale'],'AI_CHAT_CONTEXT_FILE_TOO_LARGE'),'id':_0x45c56a}),this['_logError'](_0x4a2792)):_0x4a2792['message']['startsWith']('ai-chat-context-file-too-many-pages')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':cs(this['context']['locale'],'AI_CHAT_CONTEXT_FILE_TOO_MANY_PAGES'),'id':_0x45c56a}),this['_logError'](_0x4a2792)):_0x4a2792['message']['startsWith']('ai-chat-context-form-data-size-limits-exceeded')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':cs(this['context']['locale'],'AI_CHAT_CONTEXT_FORM_DATA_SIZE_LIMITS_EXCEEDED'),'id':_0x45c56a}),this['_logError'](_0x4a2792)):(this['_aiChatUi']['addFeedItemError']({'errorMessage':cs(this['context']['locale'],'AI_CHAT_GENERIC_ERROR'),'id':_0x45c56a}),this['_logError'](_0x4a2792));}),await this['activeConversation']['init'](this['context']['config']['get']('ai.chat.context')),_0x35f539||await this['activeConversation']['start']();}async['_handleUIUserMessage']({message:_0xd21b11,attributes:_0x127846}){if(!this['activeConversation'])throw new ot('ai-chat-controller-no-active-conversation');if(this['activeConversation']['isCurrentDocumentInContext']()){const _0x2684e2=await this['_aiEditing']['getDocumentData']();await this['activeConversation']['updateCurrentDocumentInContext'](_0x2684e2);}this['activeConversation']['id']&&this['activeConversation']['isStarted']&&await this['activeConversation']['handleUserInteraction']({'userMessage':_0xd21b11,'attributes':_0x127846});}['_setIsMaximized'](_0x3f7fbb){this['_aiChatUi']['setIsMaximized'](_0x3f7fbb);}['_logError'](_0x153122){Tt(_0x153122['message']);}['_removeFromContext'](_0x26fe91){this['activeConversation']?.['removeFromContext'](_0x26fe91);}['_toggleWebSearch'](){this['activeConversation']?.['toggleWebSearch']();}['_toggleReasoning'](){this['activeConversation']?.['toggleReasoning']();}['getInteractionAndReplyById'](_0x406016){const [_0xaee02b,_0x569f12]=_0x406016['split'](':'),_0x5c3b22=this['activeConversation']['getInteraction'](_0xaee02b),_0x286736=_0x5c3b22['getReply'](_0x569f12);return{'interaction':_0x5c3b22,'reply':_0x286736};}['_scrollToSuggestionRange'](_0x38e743,_0x3307bf=!0x1){const _0x572fcf=Ys(this['context']),_0x22b03b={'target':_0x572fcf['editing']['view']['domConverter']['viewRangeToDom'](_0x572fcf['editing']['mapper']['toViewRange'](_0x38e743)),'viewportOffset':{'top':0x96,'left':0x0,'bottom':0x32,'right':0x0},'ancestorOffset':0x14,'alignToTop':_0x3307bf};_0x3307bf&&(_0x22b03b['alignToTop']=!0x0),mt(_0x22b03b);}['_updateConversationTitle'](_0x5c11c9,_0x5678c5=!0x1){this['_aiChatUi']['setConversationTitle'](_0x5c11c9||cs(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION'),_0x5678c5);}['_addFeedItemReply'](_0x55c8fe){'text'===_0x55c8fe['type']?this['_aiChatUi']['addFeedItemAIReply'](_0x55c8fe):this['_aiChatUi']['addFeedItemAISuggestion'](_0x55c8fe);}async['_updateReplyContent']({reply:_0x58e17b,renderingStrategy:_0xe98d19}){const {id:_0x1173dc,interactionId:_0x3136c0,isDone:_0x3030b1,type:_0x171fed,parsedContent:_0x396029}=_0x58e17b,_0x1ed0e7=_0x3136c0+':'+_0x1173dc;if('modification'===_0x171fed){const _0x34ab33=_0x58e17b['getContentParts']({'showDiff':this['_aiChatUi']['showDiff']});await this['_aiChatUi']['updateFeedItemAIReplySuggestionContent']({'id':_0x1ed0e7,'parts':_0x34ab33,'renderingStrategy':_0xe98d19,'isDone':_0x3030b1});}else'text'===_0x171fed&&await this['_aiChatUi']['updateFeedItemAIReplyContent']({'id':_0x1ed0e7,'parsedContent':_0x396029,'renderingStrategy':_0xe98d19,'isDone':_0x3030b1});_0x3030b1&&_0x58e17b['sources']['length']>0x0&&this['_aiChatUi']['updateFeedItemAIReplySources'](_0x1ed0e7,_0x58e17b['sources']);}async['_stopLastInteraction'](){const _0x5e8ded=this['activeConversation']?.['lastInteraction'];_0x5e8ded&&(_0x5e8ded['stop'](),this['_aiChatUi']['stopInteraction'](_0x5e8ded));}async['_flushLastInteractionUI'](){const _0x1cb9c8=this['activeConversation']?.['lastInteraction'];if(_0x1cb9c8){for await(const _0xee2e6d of _0x1cb9c8['replies'])this['_aiChatUi']['hasFeedItem'](_0xee2e6d['id'])||this['_addFeedItemReply'](_0xee2e6d),await this['_updateReplyContent']({'reply':_0xee2e6d,'renderingStrategy':'static'});}}['_updateRatings'](_0x46dfa6){const _0x416f5f={'positiveCount':_0x46dfa6['changeGroups']['filter'](_0x2f8ba1=>'accepted'===_0x2f8ba1['state'])['length'],'totalCount':_0x46dfa6['changeGroups']['length'],'modificationId':_0x46dfa6['id']},_0x171e99=this['activeConversation']['getInteraction'](_0x46dfa6['interactionId'])['messageId'];_0x171e99&&this['_aiConnector']['upsertAIChatRating'](this['activeConversation']['id'],_0x171e99,_0x416f5f);}['_getAIChatFeedAPI'](_0x505b4e){const _0x11ea1e=this['_aiChatUi'],_0x43ca18=()=>{_0x505b4e['resetWebSearchState'](),_0x505b4e['resetReasoningState'](),_0x11ea1e['clearLoadingMessage']();},_0x44bb5c=()=>{_0x505b4e['currentReply']&&(_0x505b4e['currentReply']['done'](),_0x505b4e['currentReply']=void 0x0);};return{'insertTextReply':(_0xf2355d,_0x3dd1bf)=>{_0x44bb5c(),_0x43ca18();const _0x2a7a1f=_0x505b4e['currentReply']=_0x505b4e['createReply']({'type':'text','interactionId':_0x505b4e['id'],'content':_0xf2355d,'id':_0x3dd1bf||at()});return _0x44bb5c(),_0x2a7a1f;},'insertCustomElement':async(_0x1bc9d1,_0x4b2c10)=>(_0x44bb5c(),_0x43ca18(),_0x11ea1e['addFeedItemCustomElement'](_0x1bc9d1,_0x4b2c10||at())),'setLoadingMessage':_0x58f690=>{_0x11ea1e['setLoadingMessage'](_0x58f690);},'clearLoadingMessage':()=>{_0x11ea1e['clearLoadingMessage']();}};}}const Xs='ai-selection';class zs extends _0x5d2433{constructor(_0x964eee){super(_0x964eee),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 _0x2572a6=Ys(this['context']),_0xf31ef9=_0x2572a6['plugins']['has']('RealTimeCollaborationClient')&&_0x2572a6['plugins']['get']('RealTimeCollaborationClient')['sessionId'];this['_sessionId']=_0xf31ef9||at();}return this['_sessionId'];}async['getDocumentData'](){const _0x5cc0f3=Ys(this['context']),_0x4e6e35=_0x5cc0f3['model'],_0x8b816=_0x5cc0f3['data']['toView'](_0x4e6e35['document']['getRoot'](),{'convertAiChatSelectionMarker':!0x0}),_0x345070=new _0x44b0c2(_0x5cc0f3['editing']['view']['document']);this['_setDataIdsOnChildren'](_0x8b816,_0x345070);let _0x419d69=await this['_getDocumentDataStringFromView'](_0x8b816);const _0x419e75=this['_getMarkersInDocumentOrder'](),_0x19c30b=[];for(const _0x5ee71f of _0x419e75){const _0x2cb7d8='<'+_0x5ee71f['name']+':start></'+_0x5ee71f['name']+':start>',_0x244848=_0x419d69['indexOf'](_0x2cb7d8);_0x419d69=_0x419d69['substring'](0x0,_0x244848)+_0x419d69['substring'](_0x244848+_0x2cb7d8['length']);const _0x1f81e3='<'+_0x5ee71f['name']+':end></'+_0x5ee71f['name']+':end>',_0x115f85=_0x419d69['indexOf'](_0x1f81e3);_0x419d69=_0x419d69['substring'](0x0,_0x115f85)+_0x419d69['substring'](_0x115f85+_0x1f81e3['length']),_0x19c30b['push']({'markerName':_0x5ee71f['name'],'start':_0x244848,'end':_0x115f85,'htmlFragment':_0x419d69['substring'](_0x244848,_0x115f85)});}return{'content':_0x419d69,'version':_0x5cc0f3['model']['document']['version'],'sessionId':this['sessionId'],'selections':_0x19c30b};}async['afterInit'](){this['context']instanceof _0x53a714?this['_integrateEditor'](this['context']):this['listenTo'](this['context']['editors'],'add',(_0x2c1801,_0x30863c)=>{_0x30863c['on']('ready',()=>{this['_integrateEditor'](_0x30863c);});});}['_setOutputDataProcessor'](_0x500c6b){this['_outputDataProcessor']=_0x500c6b;}async['_getDocumentDataStringFromView'](_0x4386a8){let _0x181de3;const _0x291ec0=Ys(this['context']);if(this['_outputDataProcessor']){const _0x2f3d5f=_0x291ec0['data']['processor']['domConverter']['viewToDom'](_0x4386a8),_0x2d29f9=await this['_outputDataProcessor'](_0x2f3d5f);_0x181de3=_0x291ec0['data']['processor']['htmlWriter']['getHtml'](_0x2d29f9);}else _0x181de3=_0x291ec0['data']['processor']['toData'](_0x4386a8);return _0x181de3;}['_integrateEditor'](_0x2bfa9a){_0x2bfa9a['conversion']['for']('editingDowncast')['markerToHighlight']({'model':Xs,'view':({markerName:_0x20a5ff})=>({'classes':['ck-ai-assistant-ui_theme','ck-fake-ai-selection','ck-fake-ai-selection-'+_0x20a5ff['split'](':')[0x1]],'priority':0xc})}),_0x2bfa9a['conversion']['for']('dataDowncast')['markerToElement']({'model':Xs,'view':(_0x1c8e3b,{writer:_0x4e5fa8,options:_0x2bbfea})=>_0x2bbfea['convertAiChatSelectionMarker']?_0x4e5fa8['createUIElement'](_0x1c8e3b['markerName']+':'+(_0x1c8e3b['isOpening']?'start':'end')):null});}['showFakeVisualSelection'](_0x559e7d){const _0x2f442a=this['_fakeSelections'][0x0]||null;this['_addFakeSelection'](_0x559e7d);const _0x593b66=this['_fakeSelections'][0x0]||null;this['_refreshFakeSelection'](_0x2f442a,_0x593b66);}['hideFakeVisualSelection'](_0x584645){const _0x334fb6=this['_fakeSelections'][0x0]||null;this['_removeFakeSelectionById'](_0x584645);const _0x22f00=this['_fakeSelections'][0x0]||null;this['_refreshFakeSelection'](_0x334fb6,_0x22f00);}async['modelToDataWithIds'](_0x312b90){const _0xaf828a=Ys(this['context']),_0x1c80c3=_0xaf828a['data']['toView'](_0x312b90),_0x497208=new _0x44b0c2(_0xaf828a['editing']['view']['document']);return this['_setDataIdsOnChildren'](_0x1c80c3,_0x497208),this['_getDocumentDataStringFromView'](_0x1c80c3);}['_setDataIdsOnChildren'](_0x306f1d,_0x3b2581){let _0x168ecb=!0x1;const _0x3f0d3c=new Set();for(const _0x544567 of _0x306f1d['getChildren']()){if(!_0x544567['is']('view:element'))continue;const _0x565c7f=_0x544567['is']('view:containerElement'),_0xd1b5b2=_0x544567['is']('view:emptyElement'),_0x574ccc=this['_setDataIdsOnChildren'](_0x544567,_0x3b2581);if(_0x544567['hasAttribute']('data-id')){_0x168ecb=!0x0,_0x3f0d3c['add'](_0x544567['getAttribute']('data-id'));continue;}(_0x565c7f||_0xd1b5b2||_0x574ccc)&&(_0x3b2581['setAttribute']('data-id',this['_nextDataId'](_0x3f0d3c),_0x544567),_0x168ecb=!0x0);}return _0x168ecb;}['_nextDataId'](_0x568c12){let _0x4d3cba;do{_0x4d3cba='';for(let _0xd77324=0x0;_0xd77324<0x4;_0xd77324++)_0x4d3cba+=String['fromCharCode'](0x61+Math['floor'](0x1a*Math['random']()));}while(_0x568c12['has'](_0x4d3cba));return _0x568c12['add'](_0x4d3cba),_0x4d3cba;}['getSelectionText'](){const {model:_0x73446e}=Ys(this['context']),_0x1b3df9=_0x73446e['document']['selection'],_0x239c33=[],_0x55ba4a=Array['from'](_0x1b3df9['getRanges']());_0x55ba4a['sort']((_0x28ca10,_0x5c93d7)=>_0x28ca10['start']['isBefore'](_0x5c93d7['start'])?-0x1:0x1);for(const _0x53478d of _0x55ba4a)for(const _0x2eecd9 of _0x53478d['getItems']())_0x2eecd9['is']('$textProxy')?_0x239c33['push'](_0x2eecd9['data']):_0x2eecd9['is']('element')&&_0x239c33['length']>0x0&&'\x20'!==_0x239c33[_0x239c33['length']-0x1]&&_0x239c33['push']('\x20');return _0x239c33['length']?'\x22'+_0x239c33['join']('')['trim']()+'\x22':cs(this['context']['locale'],'AI_CHAT_CONTEXT_DOCUMENT_SELECTION_LABEL');}['_removeFakeSelectionById'](_0x4db415){for(let _0x20faa6=0x0;_0x20faa6<this['_fakeSelections']['length'];_0x20faa6++)if(this['_fakeSelections'][_0x20faa6]['id']==_0x4db415)return void this['_fakeSelections']['splice'](_0x20faa6,0x1);}['_addFakeSelection'](_0x398dcb){this['_removeFakeSelectionById'](_0x398dcb['id']),Ct(this['_fakeSelections'],_0x398dcb);}['_refreshFakeSelection'](_0x2f29ac,_0x3f13fe){if(_0x2f29ac==_0x3f13fe)return;const _0x4789d5=Ys(this['context']),_0x36d50c=_0x4789d5['model'];_0x36d50c['change'](_0x52260b=>{if(_0x2f29ac){const _0x8331d9=_0x4789d5['model']['markers']['getMarkersGroup'](Xs);for(const _0x41139f of _0x8331d9)_0x52260b['removeMarker'](_0x41139f);}if(_0x3f13fe)for(let _0x5567f5=0x0;_0x5567f5<_0x3f13fe['ranges']['length'];_0x5567f5++){let _0x26d7f8=_0x3f13fe['ranges'][_0x5567f5];const _0xaa3e0d=Xs+':'+_0x3f13fe['id']+':'+_0x5567f5;if(_0x26d7f8['start']['isAtEnd']){const _0xa03e1c=_0x26d7f8['start']['getLastMatchingPosition'](({item:_0x368e72})=>!_0x36d50c['schema']['isContent'](_0x368e72),{'boundaries':_0x26d7f8});_0x26d7f8=_0x52260b['createRange'](_0xa03e1c,_0x26d7f8['end']);}_0x52260b['addMarker'](_0xaa3e0d,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x26d7f8});}});}['_getMarkersInDocumentOrder'](){const _0x259539=Ys(this['context'])['model'];return Array['from'](_0x259539['markers']['getMarkersGroup'](Xs))['sort']((_0x34ba31,_0x4da36d)=>_0x34ba31['getStart']()['isBefore'](_0x4da36d['getStart']())?-0x1:_0x34ba31['getStart']()['isAfter'](_0x4da36d['getStart']())?0x1:0x0);}}const js=['showChangeInText','insertSuggestion','applySuggestion','rejectSuggestion','mouseOverSuggestion','mouseLeaveSuggestion','toggleSuggestionDisplayMode','like','dislike'],Js=[...js,'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(_0x3112e4){this['options']={'delay':_0x3112e4['delay']??0x14,'textNodeStyle':_0x3112e4['textNodeStyle'],'onStreamUpdate':_0x3112e4['onStreamUpdate']||(()=>{})};}async['stream']({document:_0x4f0607,targetElement:_0x4366ef,abortSignal:_0x3ef0f4}){this['isStreaming']&&this['stop'](),_0x3ef0f4?.['addEventListener']('abort',this['stop']['bind'](this)),this['document']=_0x1be4b7(_0x4f0607,!0x0),this['nodesList']=this['getParsedDocumentNodeList'](),this['isStreaming']=!0x0,this['currentIndex']>this['nodesList']['length']&&(this['currentIndex']=this['nodesList']['length']);for(let _0x3eb704=0x0;_0x3eb704<this['currentIndex'];_0x3eb704++)this['nodesList'][_0x3eb704]['shouldBeStreamed']=!0x0;do{const _0x45c070=Date['now'](),_0x430b13=this['nodesList'][this['currentIndex']],_0x10cda5=_0x45c070-this['lastUpdateTime'];if(_0x430b13){_0x430b13['shouldBeStreamed']=!0x0;let _0x22a1d8=_0x430b13['parent'];for(;_0x22a1d8;)_0x22a1d8['shouldBeStreamed']=!0x0,_0x22a1d8=_0x22a1d8['parent'];}if(_0x10cda5<this['options']['delay'])try{const {promise:_0x280a9a,abortController:_0x1ab348}=nn(this['options']['delay']-_0x10cda5);this['timeoutAbortController']=_0x1ab348,await _0x280a9a;}catch(_0x23b4d4){return;}_0x5569bd(_0x4366ef,'<'+_0x4366ef['tagName']+'>'+this['renderNode'](this['document'])+'</'+_0x4366ef['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:_0x4f0832}){Array['from'](_0x4f0832['querySelectorAll']('span[data-ck-html-streamer-word-chunk]'))['reverse']()['forEach'](_0x28bba9=>{_0x28bba9['replaceWith'](_0x28bba9['childNodes'][0x0]);});}['stop'](){this['isStreaming']=!0x1,this['timeoutAbortController']&&(this['timeoutAbortController']['abort'](),this['timeoutAbortController']=null);}['renderNode'](_0x136a99){let _0x5e6158='';if(function(_0x5e2362){return _0x2aabdb(_0x5e2362);}(_0x136a99)){for(const _0x305f68 of _0x136a99['children'])_0x5e6158+=this['renderNode'](_0x305f68);}else{if(sn(_0x136a99)){if(!_0x136a99['shouldBeStreamed'])return'';const _0x1dbe72=_0x136a99,_0x3b8442=Object['entries'](_0x1dbe72['attribs'])['map'](([_0x4b2926,_0x4a38a5])=>_0x4b2926+'=\x22'+_0x4a38a5+'\x22')['join']('\x20');_0x5e6158+='<'+_0x1dbe72['tagName']+(_0x3b8442?'\x20'+_0x3b8442:'')+'>';for(const _0x22df42 of _0x29ecc2(_0x1dbe72))_0x5e6158+=this['renderNode'](_0x22df42);_0x5e6158+='</'+_0x1dbe72['tagName']+'>';}else{if(!en(_0x136a99))return'';if(!_0x136a99['shouldBeStreamed'])return'';!function(_0xeb34bf){if(!_0xeb34bf['parent']||!sn(_0xeb34bf['parent']))return!0x1;if(!tn['includes'](_0xeb34bf['parent']['tagName']))return!0x1;return!ti(_0xeb34bf)['match'](/^\s*[<>]\s*$/);}(_0x136a99)?_0x5e6158+=_0x173a3d(_0x136a99):_0x5e6158+=_0x173a3d(new _0x170b36('span',{'data-ck-html-streamer-word-chunk':'','style':this['options']['textNodeStyle']},[_0x136a99]));}}return _0x5e6158;}['getParsedDocumentNodeList'](){const _0x22ec40=[];return function(_0x31a3a8,_0x24a46a){const _0x1cc413=_0x2748b5=>{if(_0x24a46a(_0x2748b5),_0x2748b5 instanceof _0x165f76)for(let _0x2d6b82=0x0;_0x2d6b82<_0x2748b5['children']['length'];_0x2d6b82++){const _0x1c739e=_0x2748b5['children'][_0x2d6b82];_0x1cc413(_0x1c739e);}};for(let _0x868df8=0x0;_0x868df8<_0x31a3a8['children']['length'];_0x868df8++)_0x1cc413(_0x31a3a8['children'][_0x868df8]);}(this['document'],_0x4f3533=>{if(en(_0x4f3533)){const _0x80b4c3=this['splitTextNodeIntoWordNodes'](_0x4f3533);_0x80b4c3['length']&&_0x22ec40['push'](..._0x80b4c3);}_0x4f3533['isWordSplitSource']||_0x4f3533['isWordSplitResult']||_0x22ec40['push'](_0x4f3533);}),_0x22ec40;}['splitTextNodeIntoWordNodes'](_0x3122c1){if(_0x3122c1['isWordSplitSource']||_0x3122c1['isWordSplitResult'])return[];const _0x2669ce=ti(_0x3122c1)['match'](/(?:\s*\S+\s*)/g),_0x3476e4=[];if(_0x2669ce&&_0x2669ce['length']>0x1){for(const _0x2cb6fb of _0x2669ce){const _0x49fd1d=new _0x5cf540(_0x2cb6fb);_0x49fd1d['isWordSplitResult']=!0x0,_0x59bf1a(_0x3122c1,_0x49fd1d),_0x3476e4['push'](_0x49fd1d);}_0x3122c1['isWordSplitSource']=!0x0,_0xb6b4fd(_0x3122c1);}return _0x3476e4;}}const tn=['p','li','td','th','span','h1','h2','h3','h4','h5','h6','b','strong','i','em','mark','del','ins','sup','sub','a','code','div'];function en(_0x4cbeaf){return _0x4cfcea(_0x4cbeaf);}function sn(_0xc3de31){return _0x5c66ff(_0xc3de31);}function nn(_0x37232b){const _0x40cf4c=new AbortController();return{'promise':new Promise((_0x5273c6,_0x235ad9)=>{const _0x31281b=setTimeout(_0x5273c6,_0x37232b);_0x40cf4c['signal']['addEventListener']('abort',()=>{clearTimeout(_0x31281b),_0x235ad9();});}),'abortController':_0x40cf4c};}class rn extends Nt{['options'];['content']='';['htmlStreamer'];['children'];constructor(_0x5a4ce7){super();const _0x5082bb=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']=_0x5a4ce7,this['children']=this['createCollection'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__item',_0x5082bb['if']('isDone','ck-ai-chat__feed__item_done'),_0x5082bb['if']('isVisible','ck-hidden',_0x1e2861=>!_0x1e2861),'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'](_0x4303ec=>{_0x4303ec['removeAttribute']('data-id');}),this['isDone']=!0x0;}async['streamIntoElement'](_0x3d6b18,_0x183c10,_0x1fada6){await this['htmlStreamer']['stream']({'document':_0x3d6b18,'targetElement':_0x183c10,'abortSignal':_0x1fada6});}}class an extends Nt{['showChangesToggleView'];constructor(_0x204a2c,_0x57a174){super(_0x204a2c),this['set']('isShowChangesToggleVisible',!0x0),this['showChangesToggleView']=new on(_0x204a2c),this['showChangesToggleView']['set']({'class':'ck-ai-suggestion__header__show-changes-toggle\x20ck-ai-chat-controls-button\x20'+ds,'label':cs(_0x204a2c,'AI_SUGGESTION_BUTTON_SHOW_CHANGES'),'withText':!0x0}),this['showChangesToggleView']['isOn']=_0x57a174['showDiff'],this['showChangesToggleView']['bind']('isVisible')['to'](this,'isShowChangesToggleVisible'),this['showChangesToggleView']['bind']('icon')['to'](this['showChangesToggleView'],'isOn',_0x4ac566=>_0x4ac566?_0x44006e:_0x5089e3),this['showChangesToggleView']['on']('execute',()=>{this['showChangesToggleView']['isOn']=!this['showChangesToggleView']['isOn'],this['fire']('toggleShowChanges',{'isOn':this['showChangesToggleView']['isOn']});});const _0x3d1aab=new yt();_0x3d1aab['content']=_0x26cdeb,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__header',!0x1===_0x57a174['showHeader']?'ck-hidden':null]['filter'](Boolean)},'children':[_0x3d1aab,{'tag':'span','children':[cs(_0x204a2c,'AI_SUGGESTION_HEADER_TITLE')]},this['showChangesToggleView']]});}}class on extends kt{['render'](){super['render'](),this['children']['remove'](this['iconView']),this['children']['add'](this['iconView']);}}const hn={'accepted':_0x1893c2,'rejected':_0x24b8c1,'outdated':_0x24b8c1};class cn extends Nt{['stateIconView'];constructor(_0x44cb89){super(_0x44cb89);const _0x244f81=this['bindTemplate'];this['set']('state','accepted'),this['set']('isVisible',!0x0),this['stateIconView']=new ln(),this['stateIconView']['bind']('state')['to'](this),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__content-part-state',_0x244f81['to']('state',_0xb145db=>'ck-ai-suggestion__content-part-state_'+_0xb145db),_0x244f81['if']('isVisible','ck-hidden',_0x39ebd7=>!_0x39ebd7)]},'children':[{'tag':'span','attributes':{'class':['ck-ai-suggestion__content-part-state__label']},'children':[{'text':_0x244f81['to']('state',_0xa6efeb=>{switch(_0xa6efeb){case'accepted':return cs(_0x44cb89,'AI_SUGGESTION_CONTENT_PART_STATE_ACCEPTED');case'rejected':return cs(_0x44cb89,'AI_SUGGESTION_CONTENT_PART_STATE_REJECTED');case'outdated':return cs(_0x44cb89,'AI_SUGGESTION_CONTENT_PART_STATE_OUTDATED');}})}]},this['stateIconView']]});}['setState'](_0x4cd856){this['state']=_0x4cd856;}}class ln extends yt{constructor(){super(),this['set']('state','accepted'),this['content']=hn[this['state']],this['on']('change:state',()=>{this['content']=hn[this['state']];});}}class un extends Ot{['_applyButton'];['_suggestButton'];constructor(_0x6a2e7d,_0x380137,_0x2561f8){super(_0x6a2e7d);const _0x8be680=Boolean(_0x2561f8);this['set']('isEnabled',!_0x8be680),this['set']('isVisible',!0x0),this['class']='ck-ai-suggestion-content-part-toolbar';const _0x385502=[];if(_0x8be680){const _0x120eee=new kt(_0x6a2e7d);_0x120eee['set']({'label':cs(_0x6a2e7d,'AI_SUGGESTION_DISABLED_TOOLTIP_MESSAGE'),'tooltip':!0x0,'withText':!0x1,'icon':_0x32ed68}),_0x120eee['extendTemplate']({'attributes':{'data-cke-tooltip-class':'ck-ai-suggestion-content-part-disabled-actions-tooltip'}}),_0x385502['push'](_0x120eee);}else{_0x380137['includes']('applySuggestion')&&(this['_applyButton']=new kt(_0x6a2e7d),this['_applyButton']['set']({'label':cs(_0x6a2e7d,'AI_SUGGESTION_CONTENT_PART_APPLY'),'tooltip':!0x0,'tooltipPosition':'n','withText':!0x1,'icon':_0x1893c2}),this['_applyButton']['bind']('isEnabled')['to'](this),this['_applyButton']['on']('execute',()=>{this['fire']('applySuggestion');}),_0x385502['push'](this['_applyButton'])),_0x380137['includes']('insertSuggestion')&&(this['_suggestButton']=new kt(_0x6a2e7d),this['_suggestButton']['set']({'label':cs(_0x6a2e7d,'AI_SUGGESTION_CONTENT_PART_ADD_SUGGESTION'),'tooltip':!0x0,'tooltipPosition':'n','withText':!0x1,'icon':_0x39936f}),this['_suggestButton']['bind']('isEnabled')['to'](this),this['_suggestButton']['on']('execute',()=>{this['fire']('insertSuggestion');}),_0x385502['push'](this['_suggestButton']));const _0x206b77=new kt(_0x6a2e7d);_0x206b77['set']({'label':cs(_0x6a2e7d,'AI_SUGGESTION_CONTENT_PART_REJECT'),'tooltip':!0x0,'tooltipPosition':'n','withText':!0x1,'icon':_0x24b8c1}),_0x206b77['bind']('isEnabled')['to'](this),_0x206b77['on']('execute',()=>{this['fire']('rejectSuggestion');}),_0x385502['push'](_0x206b77);}this['items']['addMany'](_0x385502);const _0x2a67bc=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':[_0x2a67bc['if']('isVisible','ck-hidden',_0x3a72be=>!_0x3a72be)]}});}['setButtonsVisibility']({showApplyButton:_0x9d4d3b,showSuggestButton:_0x5b52cc}){this['_applyButton']&&(this['_applyButton']['isVisible']=_0x9d4d3b),this['_suggestButton']&&(this['_suggestButton']['isVisible']=_0x5b52cc);}}class dn extends Nt{['toolbarView'];['stateView'];['titleLabelView'];['children'];constructor(_0x1aa5fb,{part:_0x1ad61a,uiIndex:_0x260d8e,availableActions:_0x215c85,areActionsDisabled:_0x2f768d}){super(_0x1aa5fb),this['set']('isEnabled',!0x0),this['set']('state','pending'),this['toolbarView']=new un(_0x1aa5fb,_0x215c85,_0x2f768d),this['toolbarView']['on']('rejectSuggestion',()=>{this['fire']('rejectSuggestion',{'index':_0x1ad61a['index']});}),this['toolbarView']['on']('insertSuggestion',()=>{this['fire']('insertSuggestion',{'index':_0x1ad61a['index']});}),this['toolbarView']['on']('applySuggestion',()=>{this['fire']('applySuggestion',{'index':_0x1ad61a['index']});}),this['toolbarView']['bind']('isEnabled')['to'](this),this['stateView']=new cn(_0x1aa5fb),this['titleLabelView']=new _n(_0x1aa5fb,_0x260d8e),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',(_0x497c38,_0x9eb715,_0xa5a1d8,_0x518154)=>{'pending'===_0x518154?this['children']['remove'](this['toolbarView']):this['children']['remove'](this['stateView']),'pending'===_0xa5a1d8?this['children']['add'](this['toolbarView']):(this['stateView']['setState'](_0xa5a1d8),this['children']['add'](this['stateView']));});}}class _n extends Nt{constructor(_0x59c432,_0x35836b){super(_0x59c432),this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-suggestion__body__content-part__title__label']},'children':[cs(_0x59c432,'AI_SUGGESTION_CONTENT_PART_TITLE',_0x35836b['toString']())]});}}class An extends Nt{['htmlStreamer'];constructor(_0xb46168){super(_0xb46168),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:_0x934543,renderingStrategy:_0x569bec,abortSignal:_0x474992}){'streaming'===_0x569bec?await this['htmlStreamer']['stream']({'document':_0x934543['content'],'targetElement':this['element'],'abortSignal':_0x474992}):this['element']['innerHTML']=gs(_0x934543['content']);}['clear'](){this['htmlStreamer']['reset'](),this['element']['innerHTML']='';}}class gn extends Nt{['_children'];['_headerView'];['_streamableContentView'];constructor(_0x309308,{part:_0xda7243,uiIndex:_0x4737f6,areActionsDisabled:_0x5a164a,availableActions:_0x2ad986}){super(_0x309308);const _0x3c4ad5=this['bindTemplate'];this['set']('state','pending'),this['set']('isDone',!0x1),this['set']('isVisible',!0x1),this['set']('isActive',!0x1),this['set']('isEnabled',!0x1);const _0x3e876e=()=>{this['isEnabled']=this['isDone']&&'pending'==this['state']&&!_0x5a164a;};this['on']('change:state',_0x3e876e),this['on']('change:isDone',_0x3e876e),_0x3e876e(),this['_children']=this['createCollection'](),this['_headerView']=new dn(_0x309308,{'part':_0xda7243,'uiIndex':_0x4737f6,'availableActions':_0x2ad986,'areActionsDisabled':_0x5a164a}),this['_headerView']['bind']('isEnabled','state')['to'](this),this['_headerView']['delegate'](...js)['to'](this),this['_streamableContentView']=new An(_0x309308),this['_children']['addMany']([this['_headerView'],this['_streamableContentView']]),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__body__content-part',_0x3c4ad5['to']('state',_0x44f323=>'ck-ai-suggestion__body__content-part_'+_0x44f323),_0x3c4ad5['if']('isEnabled','ck-ai-suggestion__body__content-part_enabled'),_0x3c4ad5['if']('isActive','ck-ai-suggestion__body__content-part_active'),_0x3c4ad5['if']('isVisible','ck-hidden',_0x47a8d4=>!_0x47a8d4)]},'children':this['_children'],'on':{'mouseenter':_0x3c4ad5['to'](()=>{this['isEnabled']&&this['fire']('mouseOverSuggestion',{'index':_0xda7243['index']});}),'mouseleave':_0x3c4ad5['to'](()=>{this['isEnabled']&&this['fire']('mouseLeaveSuggestion',{'index':_0xda7243['index']});}),'click':_0x3c4ad5['to'](_0x2cb3c6=>{const _0x27329b=_0x2cb3c6['target'];this['isEnabled']&&!this['_headerView']['toolbarView']['element']['contains'](_0x27329b)&&this['fire']('showChangeInText',{'index':_0xda7243['index']});})}});}async['updateContent']({part:_0x1aeccc,renderingStrategy:_0xe2164f,showUnchangedParts:_0x479cd9=!0x1,abortSignal:_0x27af1d}){this['partDefinition']=_0x1aeccc,this['isVisible']=this['partDefinition']['hasChanges']||_0x479cd9,this['isVisible']&&await this['_streamableContentView']['update']({'part':_0x1aeccc,'renderingStrategy':_0xe2164f,'abortSignal':_0x27af1d});}['markAsDone'](){this['isDone']=!0x0;}}class In extends Et(){['queue']=[];['isProcessing']=!0x1;['_abortController'];async['enqueue'](_0x16a0da){const _0xb03bf0=this['createTask'](_0x16a0da);return this['queue']['push'](_0xb03bf0),this['_processQueue'](),_0xb03bf0['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(_0x553bf8=>{this['once']('_queueEmpty',()=>{_0x553bf8();});}):Promise['resolve']();}async['_processQueue'](){if(!this['isProcessing']){this['_abortController']=new AbortController(),this['isProcessing']=!0x0;try{for(;this['queue']['length']&&this['isProcessing'];){const _0x589623=this['queue']['shift']();try{await _0x589623['callback'](this['_abortController']['signal']),_0x589623['resolve']();}catch(_0xea3ca){_0x589623['reject'](_0xea3ca);}}}finally{this['isProcessing']=!0x1,this['_abortController']=void 0x0;}this['fire']('_queueEmpty');}}['createTask'](_0x1cff34){let _0x2a89b1,_0x3b32dd;const _0x2b34cd=new Promise((_0xcd9156,_0x3330cd)=>{_0x2a89b1=_0xcd9156,_0x3b32dd=_0x3330cd;});return{'callback':_0x1cff34,'resolve':_0x2a89b1,'reject':_0x3b32dd,'completePromise':_0x2b34cd};}}class En extends rn{constructor(_0x31079c){super(_0x31079c),this['extendTemplate']({'attributes':{'class':['ck-ai-notification','warning'===_0x31079c['level']?'ck-ai-notification_warning':'ck-ai-notification_error']}});}['render'](){super['render'](),this['setContent'](this['options']['initialContent']),this['markAsDone']();}['setContent'](_0x4348c9){this['element']['innerHTML']=_0x4348c9;}}const pn=['applySuggestion','insertSuggestion'];class Tn extends Nt{['_applyChangesButton'];['_insertSuggestionsButton'];['children'];constructor(_0x4bd869,_0x1eb03e=[...pn],_0x4d73ae){super(_0x4bd869);const _0x244efc=this['bindTemplate'],_0x3effac=Boolean(_0x4d73ae);if(this['set']('isEnabled',!_0x3effac),this['set']('isVisible',!0x1),this['set']('isTrackChangesOn',!0x1),this['children']=this['createCollection'](),_0x3effac){const _0x1a4f15=new kt(_0x4bd869);_0x1a4f15['set']({'label':cs(_0x4bd869,'AI_SUGGESTION_DISABLED_TOOLTIP_MESSAGE'),'tooltip':!0x0,'withText':!0x1,'icon':_0x32ed68}),_0x1a4f15['extendTemplate']({'attributes':{'data-cke-tooltip-class':'ck-ai-suggestion-content-part-disabled-actions-tooltip'}});const _0x4f4627=new Nt(_0x4bd869);_0x4f4627['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-chat__feed__suggestion__actions__info'},'children':[{'tag':'p','children':[cs(_0x4bd869,'AI_SUGGESTION_DISABLED_FEED_MESSAGE'),_0x1a4f15]}]}),this['children']['add'](_0x4f4627);}else this['_applyChangesButton']=new kt(_0x4bd869),this['_applyChangesButton']['set']({'label':cs(_0x4bd869,'AI_CHAT_SUGGESTION_ACTION_APPLY_ALL'),'withText':!0x0,'type':'button','isVisible':_0x1eb03e['includes']('applySuggestion'),'class':ls}),this['_insertSuggestionsButton']=new kt(_0x4bd869),this['_insertSuggestionsButton']['set']({'label':cs(_0x4bd869,'AI_CHAT_SUGGESTION_ACTION_SUGGEST_ALL'),'withText':!0x0,'type':'button','isVisible':_0x1eb03e['includes']('insertSuggestion'),'class':us}),this['_insertSuggestionsButton']['on']('execute',()=>{this['fire']('insertSuggestion');}),this['_applyChangesButton']['on']('execute',()=>{this['fire']('applySuggestion');}),[this['_applyChangesButton'],this['_insertSuggestionsButton']]['forEach'](_0x4894e1=>{_0x4894e1['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',_0x244efc['if']('isVisible','ck-hidden',_0x406f7a=>!_0x406f7a)]},'children':this['children']}),this['on']('change:isTrackChangesOn',()=>{this['_applyChangesButton']&&(this['_applyChangesButton']['isVisible']=!this['isTrackChangesOn']);});}['updateVisibility'](_0x18cd34){this['isVisible']=_0x18cd34;}['_switchButtonLabelsPlurality'](_0x255bbb){this['_applyChangesButton']&&this['_insertSuggestionsButton']&&(_0x255bbb?(this['_applyChangesButton']['label']=cs(this['locale'],'AI_CHAT_SUGGESTION_ACTION_APPLY_ALL'),this['_insertSuggestionsButton']['label']=cs(this['locale'],'AI_CHAT_SUGGESTION_ACTION_SUGGEST_ALL')):(this['_applyChangesButton']['label']=cs(this['locale'],'AI_CHAT_SUGGESTION_ACTION_APPLY'),this['_insertSuggestionsButton']['label']=cs(this['locale'],'AI_CHAT_SUGGESTION_ACTION_SUGGEST')));}}class mn extends Nt{['children'];['balloonPanelView'];['bodyCollection'];constructor(_0x5b7baf,_0xba1156){super(_0x5b7baf),this['bodyCollection']=_0xba1156,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',_0x49a299=>!_0x49a299)]},'children':this['children']});const _0x2ccfbb=new Nt(this['locale']),_0x599088=new yt();_0x599088['content']=_0x189481,_0x2ccfbb['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-web-sources__header']},'children':[_0x599088,{'tag':'span','children':[{'text':cs(this['locale'],'AI_CHAT_SOURCES_HEADER')}]}]}),this['children']['add'](_0x2ccfbb),this['_setupBalloonPanel'](_0x5b7baf);}['addSource'](_0x1c140a){this['children']['add'](new Cn(this['locale'],_0x1c140a,this['balloonPanelView']));}['_setupBalloonPanel'](_0x11a0c4){this['balloonPanelView']=new Qt(_0x11a0c4),this['balloonPanelView']['extendTemplate']({'attributes':{'class':['ck-ai-web-source__tooltip-balloon']}}),this['bodyCollection']['add'](this['balloonPanelView']);}}class Cn extends kt{['balloonPanelView'];['source'];constructor(_0x52d1ff,_0x298f25,_0x2f3d64){super(_0x52d1ff),this['source']=_0x298f25,this['balloonPanelView']=_0x2f3d64,this['set']({'label':_0x298f25['title'],'class':['ck\x20ck-ai-web-source'],'withText':!0x0});const _0x474ecb=this['bindTemplate'];if(this['extendTemplate']({'on':{'click':_0x474ecb['to'](()=>{window['open'](_0x298f25['url'],'_blank');}),'mouseenter':_0x474ecb['to'](()=>{this['_showTooltip']();}),'mouseleave':_0x474ecb['to'](()=>{this['_hideTooltip']();})}}),_0x298f25['favicon']){const _0x329f84=new Nt(_0x52d1ff);_0x329f84['setTemplate']({'tag':'img','attributes':{'src':_0x298f25['favicon']||_0x189481,'alt':_0x298f25['title'],'class':['ck-ai-web-source__image']}}),this['children']['add'](_0x329f84);}else this['set']('icon',_0x189481);}['_createTooltipContentView'](_0x5a0f49,_0x26893b){const _0x11be2a=new Nt(_0x5a0f49),_0x3f0ddc=[];let _0x54f7d5;_0x26893b?.['favicon']?(_0x54f7d5=new Nt(_0x5a0f49),_0x54f7d5['setTemplate']({'tag':'img','attributes':{'src':_0x26893b['favicon'],'alt':_0x26893b['title'],'class':['ck-ai-web-source__tooltip-image']}})):(_0x54f7d5=new yt(),_0x54f7d5['content']=_0x189481,_0x54f7d5['extendTemplate']({'attributes':{'alt':_0x26893b['title'],'class':['ck-ai-web-source__tooltip-image']}})),_0x3f0ddc['push'](_0x54f7d5);const _0xaf8f6f=new Nt(_0x5a0f49);_0xaf8f6f['setTemplate']({'tag':'a','attributes':{'class':['ck-ai-web-source__tooltip-url'],'href':_0x26893b['url']},'children':[{'text':new URL(_0x26893b['url'])?.['hostname']}]}),_0x3f0ddc['push'](_0xaf8f6f);const _0x564c7a=new Nt(_0x5a0f49);_0x564c7a['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-web-source__tooltip-row']},'children':_0x3f0ddc});const _0x5831b9=new Nt(_0x5a0f49);return _0x5831b9['setTemplate']({'tag':'span','attributes':{'class':['ck-ai-web-source__tooltip-row','ck-ai-web-source__tooltip-title']},'children':[{'text':_0x26893b['title']['length']>0x190?_0x26893b['title']['substring'](0x0,0x190)+'...':_0x26893b['title']}]}),_0x11be2a['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-web-source__tooltip']},'children':[_0x564c7a,_0x5831b9]}),_0x11be2a;}['_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 _0x597fae=this['_createTooltipContentView'](this['locale'],this['source']);this['balloonPanelView']['content']['add'](_0x597fae);}}class wn extends Nt{['_actionsView'];['_sourcesView'];['_children'];['_areActionsDisabled'];['_showUnchangedParts'];['_updateContentPartsPromiseQueue'];['_emptyPartsWarningView'];['_availableActions'];['_cachedContentParts']=[];constructor(_0x464571,_0x40d0d5){super(_0x464571);const {areActionsDisabled:_0x13e50b,showUnchangedParts:_0x6497cb,availableActions:_0x3fa799}=_0x40d0d5;this['_areActionsDisabled']=_0x13e50b,this['_showUnchangedParts']=_0x6497cb,this['_availableActions']=_0x3fa799,this['set']('hasPendingParts',!0x1),this['set']('isTrackChangesOn',!0x1),this['_children']=this['createCollection'](),this['_updateContentPartsPromiseQueue']=new In(),this['_emptyPartsWarningView']=new En({'id':'empty-parts-warning','initialContent':cs(_0x464571,'AI_SUGGESTION_EMPTY_PART_WARNING'),'level':'warning'}),this['_emptyPartsWarningView']['isVisible']=!0x1,this['_actionsView']=new Tn(_0x464571,_0x40d0d5['availableActions'],this['_areActionsDisabled']),this['_actionsView']['bind']('isTrackChangesOn')['to'](this),this['_sourcesView']=new mn(this['locale'],_0x40d0d5['bodyCollection']),_0x40d0d5['areActionsDisabled']?this['_actionsView']['isEnabled']=!0x1:this['_actionsView']['bind']('isEnabled')['to'](this,'hasPendingParts'),this['_actionsView']['delegate'](...js)['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:_0xe177f0,renderingStrategy:_0x2b7187,abortSignal:_0x10776e}){this['_children']['length']?_0xe177f0['forEach'](_0x4071c1=>{const _0xbe2b0b=this['_cachedContentParts']['findIndex'](_0x2b6457=>_0x2b6457['index']==_0x4071c1['index']);-0x1===_0xbe2b0b?this['_cachedContentParts']['push'](_0x4071c1):this['_cachedContentParts'][_0xbe2b0b]=_0x4071c1;}):this['_cachedContentParts']=_0xe177f0;const _0x4a3eee=this['_showUnchangedParts']?_0xe177f0:_0xe177f0['filter'](_0x155c0f=>_0x155c0f['hasChanges']);this['_actionsView']['_switchButtonLabelsPlurality'](_0x4a3eee['length']>0x1);for(const _0x15b024 of _0x4a3eee)this['_updateContentPartsPromiseQueue']['enqueue'](async _0x32e348=>{let _0x3327b9=this['getPartView'](_0x15b024['index']);_0x3327b9||(_0x3327b9=new gn(this['locale'],{'part':_0x15b024,'uiIndex':this['_children']['length']+0x1,'areActionsDisabled':this['_areActionsDisabled'],'availableActions':this['_availableActions']}),_0x3327b9['delegate'](...js)['to'](this),this['_children']['add'](_0x3327b9),this['hasPendingParts']=!0x0),await _0x3327b9['updateContent']({'part':_0x15b024,'renderingStrategy':_0x2b7187,'showUnchangedParts':this['_showUnchangedParts'],'abortSignal':_0x32e348}),_0x3327b9['markAsDone']();});return _0x10776e?.['addEventListener']('abort',()=>{this['_updateContentPartsPromiseQueue']['abort']();}),this['_updateContentPartsPromiseQueue']['queueEmptyPromise'];}['updatePartState'](_0x40662c,_0x310ab0){const _0x5d0d54=this['getPartView'](_0x40662c);_0x5d0d54&&(_0x5d0d54['state']=_0x310ab0),this['hasPendingParts']='pending'==_0x310ab0||Array['from'](this['_children'])['some'](_0x86d895=>'pending'==_0x86d895['state']);}['setPartActive'](_0x315c1a,_0x1f149d){if(!0x1===_0x315c1a){for(const _0x446878 of this['_children'])_0x446878['isActive']=!0x1;}else{const _0x39f424=this['getPartView'](_0x315c1a);_0x39f424&&(_0x39f424['isActive']=_0x1f149d);}}['updateSources'](_0x2004de){_0x2004de['forEach'](_0x342994=>this['_sourcesView']['addSource'](_0x342994)),this['_sourcesView']['isVisible']=!0x0;}['getPartView'](_0x4f2dbb){return this['_children']['find'](_0x5ad13d=>_0x5ad13d['partDefinition']['index']==_0x4f2dbb)??null;}['markAsDone'](){if(!this['_showUnchangedParts']){const _0x5903e7=!this['_cachedContentParts']['find'](({hasChanges:_0x1427c7})=>_0x1427c7),_0x3d77c4=!!this['_cachedContentParts']['find'](({hasChanges:_0x45fc1e})=>!_0x45fc1e);this['_emptyPartsWarningView']['isVisible']=0x0==this['_children']['length']||_0x3d77c4,_0x5903e7?this['_emptyPartsWarningView']['setContent'](cs(this['locale'],'AI_SUGGESTION_NO_PARTS_WARNING')):this['_emptyPartsWarningView']['setContent'](cs(this['locale'],'AI_SUGGESTION_EMPTY_PART_WARNING'));}this['_children']['forEach'](_0x3a257d=>_0x3a257d['markAsDone']()),this['_actionsView']['updateVisibility'](this['hasNonEmptyParts']);}get['hasNonEmptyParts'](){return this['_children']['filter'](_0x582b37=>_0x582b37['partDefinition']['hasChanges'])['length']>0x0;}}class fn extends Nt{['bodyView'];['children'];['headerView'];constructor(_0x509e9a,_0x10d56e,_0x5cd5ad){super(_0x509e9a);const {showDiff:_0x609727,areActionsDisabled:_0x46db34,showUnchangedParts:_0x501ebb,availableActions:_0xf6ee58}=_0x10d56e;this['set']('isTrackChangesOn',!0x1),this['set']('areChangesVisible',!0x1),this['children']=this['createCollection'](),this['headerView']=new an(_0x509e9a,{'showDiff':_0x609727}),this['headerView']['on']('toggleShowChanges',(_0x3e4bc5,_0x1e9793)=>{this['areChangesVisible']=_0x1e9793['isOn'],this['fire']('toggleSuggestionDisplayMode',{'showDiff':_0x1e9793['isOn']});}),this['children']['add'](this['headerView']),this['bodyView']=new wn(_0x509e9a,{'areActionsDisabled':_0x46db34,'showUnchangedParts':!!_0x501ebb,'availableActions':_0xf6ee58,'bodyCollection':_0x5cd5ad}),this['bodyView']['delegate'](...js)['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'](_0x4bc4ed){await this['bodyView']['updateContentParts'](_0x4bc4ed);}['updateSources'](_0x8a0675){this['bodyView']['updateSources'](_0x8a0675);}['markAsDone'](){this['bodyView']['markAsDone'](),this['headerView']&&(this['headerView']['isShowChangesToggleVisible']=this['bodyView']['hasNonEmptyParts']);}}class Sn extends rn{['containerView'];constructor(_0x386825,_0x2743e3,_0x4a772a){super(_0x2743e3),this['set']('isTrackChangesOn',!0x1),this['containerView']=new fn(_0x386825,{'showDiff':_0x2743e3['showDiff'],'areActionsDisabled':_0x2743e3['areActionsDisabled'],'availableActions':_0x2743e3['availableActions']},_0x4a772a),this['containerView']['on']('toggleSuggestionDisplayMode',(_0x24ce06,_0x51f98d)=>{this['fire']('toggleSuggestionDisplayMode',{'replyId':this['options']['id'],'showDiff':_0x51f98d['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',(_0x3768b4,{index:_0x1ec822})=>{this['fire']('showChangeInText',{'replyId':this['options']['id'],'partIndex':_0x1ec822});}),this['containerView']['on']('applySuggestion',(_0x4b3378,{index:_0x189642}={})=>{this['fire']('applySuggestion',{'replyId':this['options']['id'],'partIndex':_0x189642});}),this['containerView']['on']('insertSuggestion',(_0x508c77,{index:_0x453e87}={})=>{this['fire']('insertSuggestion',{'replyId':this['options']['id'],'partIndex':_0x453e87});}),this['containerView']['on']('rejectSuggestion',(_0x136590,{index:_0x6c083b})=>{this['fire']('rejectSuggestion',{'replyId':this['options']['id'],'partIndex':_0x6c083b});}),this['containerView']['on']('mouseOverSuggestion',(_0x6e04aa,{index:_0x79419})=>{this['fire']('mouseOverSuggestion',{'replyId':this['options']['id'],'partIndex':_0x79419});}),this['containerView']['on']('mouseLeaveSuggestion',(_0x5609eb,{index:_0x585d17})=>{this['fire']('mouseLeaveSuggestion',{'replyId':this['options']['id'],'partIndex':_0x585d17});}),this['children']['addMany']([this['containerView']]),this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__ai-suggestion']}});}async['updateContent'](_0x270a44){await this['containerView']['updateContent'](_0x270a44);}['updatePartState'](_0x38eb39,_0x5ed12b){this['containerView']['bodyView']['updatePartState'](_0x38eb39,_0x5ed12b);}['setPartActive'](_0x578862,_0x2f748d){!0x1===_0x578862?this['containerView']['bodyView']['setPartActive'](!0x1):this['containerView']['bodyView']['setPartActive'](_0x578862,_0x2f748d);}['updateSources'](_0xd2c003){this['containerView']['updateSources'](_0xd2c003);}['getPartView'](_0x419ef){return this['containerView']['bodyView']['getPartView'](_0x419ef);}['markAsDone'](){super['markAsDone'](),this['containerView']['markAsDone']();}}class bn extends rn{['replyContainer'];['_bodyCollection'];constructor(_0x52338,_0x2884fe,_0x2b4034){super(_0x2884fe),this['_bodyCollection']=_0x2b4034,this['locale']=_0x52338,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':As(this['options']['initialContent']),'renderingStrategy':'static'}),this['markAsDone']());}async['updateContent']({parsedContent:_0x4b7f59,renderingStrategy:_0x19f7ea,abortSignal:_0x27b837}){'streaming'===_0x19f7ea?await this['streamIntoElement'](_0x4b7f59,this['replyContainer']['element'],_0x27b837):this['replyContainer']['element']['innerHTML']=_0x173a3d(_0x4b7f59);}['updateSources'](_0x582f86){const _0x76fee2=new mn(this['locale'],this['_bodyCollection']);_0x76fee2['children']['addMany'](_0x582f86['map'](_0x7e9727=>new Cn(this['locale'],_0x7e9727,_0x76fee2['balloonPanelView']))),_0x76fee2['isVisible']=!0x0,this['children']['add'](_0x76fee2);}}class Rn extends vt{constructor(_0x2ce9f2=void 0x0){super();const _0xe8eb59=_0x2ce9f2?'ck-ai-spinner_'+_0x2ce9f2:'';this['extendTemplate']({'tag':'span','attributes':{'class':['ck-ai-spinner',_0xe8eb59]}});}}const On={'file':_0x3a9ee9,'document':_0x26cdeb,'web-resource':_0x2f0db7,'text':_0x3a9ee9,'selection':_0xfafe06,'mcp-tool-context':_0x26cdeb},kn='ck-ai-chat-context-chip',Nn='ck-ai-chat-context-chip_wide',vn='ck-ai-chat-context-chip_document',yn='ck-ai-chat-context-chip__label',xn='ck-ai-chat-context-chip__type-icon',Ln='ck-ai-chat-context-controls__chip-tooltip',Dn='n';class Pn extends kt{constructor(_0x263591,_0x21a407,_0x259d3a,_0x483c3e,_0xfa7277=!0x1){super(_0x263591),this['_isAnimationOnEnterEnabled']=_0x483c3e,this['_initializeProperties'](_0x21a407,_0x259d3a,_0xfa7277),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'](_0x5e1a7b,_0x28af82,_0x4206f5){this['set']('label',_0x5e1a7b['label']),this['set']('tooltip',!0x0),this['set']('itemType',_0x5e1a7b['type']),this['set']('id',_0x5e1a7b['uiId']),this['set']('readonly',_0x28af82),this['set']('isLoading',_0x4206f5);}['_setupTemplate'](){const _0x4dc454=this['_createIconView'](),_0x48e2dc=this['_createRemoveButton'](),_0x28fbd5=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':this['_createTemplateAttributes'](_0x28fbd5),'children':this['_createTemplateChildren'](_0x4dc454,_0x48e2dc,_0x28fbd5)});}['_createTemplateAttributes'](_0x2658e0){return{'class':[kn,_0x2658e0['if']('itemType',vn,_0x1f6d95=>'document'==_0x1f6d95),_0x2658e0['if']('itemType',Nn,_0x5778bc=>'selection'==_0x5778bc)],'data-cke-tooltip-text':_0x2658e0['to']('label',Hn),'data-cke-tooltip-position':Dn,'data-cke-tooltip-class':Ln};}['_createTemplateChildren'](_0x4ee033,_0x23ccb3,_0x52cd77){const _0x3a934c=this['_createLabelElement'](_0x52cd77),_0x54ca5f=this['_createLoaderIcon']();return this['readonly']?[_0x4ee033,_0x3a934c]:[_0x4ee033,_0x54ca5f,_0x3a934c,_0x23ccb3];}['_createLabelElement'](_0x2dedd2){return{'tag':'span','attributes':{'class':yn},'children':[{'text':_0x2dedd2['to']('label')}]};}['_createRemoveButton'](){const _0x47fd47=new kt(this['locale']);return _0x47fd47['set']({'label':cs(this['locale'],'AI_CHAT_CONTEXT_REMOVE_FROM_CONTEXT'),'icon':_0xbe3949}),this['_setupRemoveButtonEvent'](_0x47fd47),_0x47fd47;}['_setupRemoveButtonEvent'](_0x9f2652){_0x9f2652['on']('execute',()=>{this['fire']('removeContextItemChip',this['id']);});}['_createIconView'](){const _0x4b7cdd=this['bindTemplate'],_0x4ce70e=new yt();return _0x4ce70e['content']=On[this['itemType']],_0x4ce70e['extendTemplate']({'attributes':{'class':[xn,_0x4b7cdd['if']('isLoading','ck-hidden',_0x36a516=>_0x36a516)]}}),_0x4ce70e;}['_handleAnimationEndOnce'](_0xb30cc5,_0x484639){if(!_0xb30cc5)return;const _0x398b36=()=>{_0x484639(),_0xb30cc5['removeEventListener']('animationend',_0x398b36),_0xb30cc5['removeEventListener']('webkitAnimationEnd',_0x398b36);};_0xb30cc5['addEventListener']('animationend',_0x398b36),_0xb30cc5['addEventListener']('webkitAnimationEnd',_0x398b36);}['_createLoaderIcon'](){const _0x1b0d5a=new Rn('small');return _0x1b0d5a['bind']('isVisible')['to'](this,'isLoading',_0x3f464e=>_0x3f464e),_0x1b0d5a;}}function Hn(_0xc36cc){if(!_0xc36cc)return _0xc36cc;if(_0xc36cc['length']<=0x78)return _0xc36cc;const _0x198342=_0xc36cc['slice'](0x0,0x78),_0x1e0749=_0x198342['lastIndexOf']('\x20');return(_0x1e0749>0x0?_0x198342['slice'](0x0,_0x1e0749):_0x198342)+'…';}const Mn={'maxVisibleRows':0x2,'rowDetectionTolerance':0x5,'showMoreLabelPrefix':'+\x20','viewportOffset':{'top':0x64,'bottom':0xa}},Un='300px';class Vn{['_locale'];['_config'];['_visibleChips'];['_overflowChips'];['_showMoreButtonView']=null;['_showMoreBalloonPanelView']=null;['_containerElement']=null;['_bodyCollection'];['_parentView']=null;['_intersectionObserver']=null;['_pendingCalculation']=!0x1;constructor(_0x398d1a,_0x418817,_0x306124,_0xcae7b0,_0x2a9a3e){this['_locale']=_0x398d1a,this['_visibleChips']=_0x418817,this['_config']={...Mn,..._0x306124,'cssClasses':{'controlsButton':'','calculationContainer':'ck-calculation-container',..._0x306124['cssClasses']}},this['_overflowChips']=new dt(),this['_bodyCollection']=_0xcae7b0,this['_parentView']=_0x2a9a3e||null;}['setContainerElement'](_0x34457f){this['_intersectionObserver']&&(this['_intersectionObserver']['disconnect'](),this['_intersectionObserver']=null),this['_containerElement']=_0x34457f,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 _0x48337f=[...this['_visibleChips'],...this['_overflowChips']],_0x4fbc50=this['_createCalculationContainer'](),_0x3ebe33=this['_calculateOverflowInContainer'](_0x4fbc50,_0x48337f),_0x3c0f48=_0x4fbc50['_ancestorsToRestore'];_0x3c0f48&&this['_restoreAncestorVisibility'](_0x3c0f48),_0x4fbc50['remove'](),this['_applyOverflowResults'](_0x48337f,_0x3ebe33);}['_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 _0x1ff674=new kt(this['_locale']);_0x1ff674['set']({'label':'','withText':!0x0,'isToggleable':!0x0});const _0x35acb7=[this['_config']['cssClasses']['showMoreButton']];return this['_config']['cssClasses']['controlsButton']&&_0x35acb7['push'](this['_config']['cssClasses']['controlsButton']),_0x1ff674['extendTemplate']({'attributes':{'class':_0x35acb7}}),_0x1ff674;}['_createShowMoreBalloonPanelView'](){const _0x21cb76=new Qt(this['_locale']);return _0x21cb76['extendTemplate']({'attributes':{'class':this['_config']['cssClasses']['showMoreBalloon']}}),this['_bodyCollection']['add'](_0x21cb76),_0x21cb76;}['_updateBalloonContent'](){if(this['_showMoreBalloonPanelView']&&(this['_showMoreBalloonPanelView']['content']['clear'](),this['_overflowChips']['length']>0x0)){this['_overflowChips']['forEach'](_0x309d73=>{_0x309d73['disableAnimationOnEnter']();});const _0x2ca3fd=new Nt(this['_locale']);_0x2ca3fd['setTemplate']({'tag':'div','attributes':{'class':this['_config']['cssClasses']['overflowContainer']},'children':this['_overflowChips']}),this['_showMoreBalloonPanelView']['content']['add'](_0x2ca3fd);}}['_handleShowMoreButtonClick'](){this['_showMoreButtonView']['isOn']?this['hideBalloonPanel']():this['showBalloonPanel']();}['_updateShowMoreButtonVisibility'](){const _0x3582e2=this['_overflowChips']['length']>0x0;this['_showMoreButtonView']?.['element']&&(this['_showMoreButtonView']['element']['style']['display']=_0x3582e2?'':'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'](_0x160cc8){const _0x2ace9a=this['_containerElement']?.['tagName']['toLowerCase']()||'div',_0x27090a=this['_containerElement']?.['classList'];if(_0x27090a){const _0x20fe6b=_0x27090a[0x0]||'',_0x15e696=_0x160cc8['querySelector']('.'+_0x20fe6b),_0x4cca82=_0x160cc8['querySelector'](_0x2ace9a);return _0x15e696||_0x4cca82||_0x160cc8;}return _0x160cc8['querySelector'](_0x2ace9a)||_0x160cc8;}['_calculateContainerWidth'](){const _0x2257d9=this['_parentView']?.['element']||this['_containerElement'];if(!_0x2257d9)return Un;const _0x70d283=window['getComputedStyle'](_0x2257d9)['width'];if('auto'===_0x70d283||'0px'===_0x70d283||!_0x70d283){const _0x4eed12=_0x2257d9['parentElement'];if(_0x4eed12){const _0x324286=window['getComputedStyle'](_0x4eed12);return'auto'!==_0x324286['width']?_0x324286['width']:Un;}return Un;}return _0x70d283;}['_applyCalculationStyles'](_0x326ee0,_0x5a7f8e){this['_config']['cssClasses']['calculationContainer']&&_0x326ee0['classList']['add'](this['_config']['cssClasses']['calculationContainer']),_0x326ee0['style']['width']=_0x5a7f8e,_0x326ee0['style']['position']='absolute',_0x326ee0['style']['top']='-9999px',_0x326ee0['style']['left']='-9999px',_0x326ee0['style']['opacity']='0',_0x326ee0['style']['pointerEvents']='none',_0x326ee0['style']['zIndex']='-1',_0x326ee0['style']['visibility']='visible\x20!important',_0x326ee0['style']['display']='block\x20!important',_0x326ee0['style']['boxSizing']='border-box';}['_restoreAncestorVisibility'](_0x1df7d5){_0x1df7d5['forEach'](({element:_0x1ab8d9,originalDisplay:_0x150f8b,originalVisibility:_0x3c0e0f})=>{_0x1ab8d9['style']['display']=_0x150f8b,_0x1ab8d9['style']['visibility']=_0x3c0e0f;});}['_makeAncestorsVisible'](_0x5cca70){const _0x4d5620=[];let _0x35c1c8=_0x5cca70;for(;_0x35c1c8&&_0x35c1c8!==document['body'];){const _0x148354=window['getComputedStyle'](_0x35c1c8);'none'!==_0x148354['display']&&'hidden'!==_0x148354['visibility']||(_0x4d5620['push']({'element':_0x35c1c8,'originalDisplay':_0x35c1c8['style']['display'],'originalVisibility':_0x35c1c8['style']['visibility']}),_0x35c1c8['style']['display']='block',_0x35c1c8['style']['visibility']='visible'),_0x35c1c8=_0x35c1c8['parentElement'];}return _0x4d5620;}['_createContainerElements'](){let _0x5f5c3d,_0x14d1d7;return this['_parentView']?.['element']?(_0x5f5c3d=this['_parentView']['element']['cloneNode'](!0x0),_0x14d1d7=this['_findTargetContainer'](_0x5f5c3d)):(_0x5f5c3d=document['createElement']('div'),_0x14d1d7=_0x5f5c3d),{'calculationContainer':_0x5f5c3d,'targetContainer':_0x14d1d7};}['_createCalculationContainer'](){const {calculationContainer:_0x15897e,targetContainer:_0xa81d75}=this['_createContainerElements'](),_0x279d94=this['_calculateContainerWidth']();this['_applyCalculationStyles'](_0x15897e,_0x279d94);const _0x81724a=this['_parentView']?.['element']||this['_containerElement'],_0xd11593=_0x81724a?.['parentElement'];_0xd11593?_0xd11593['appendChild'](_0x15897e):document['body']['appendChild'](_0x15897e),_0x15897e['_targetContainer']=_0xa81d75;const _0x293092=this['_makeAncestorsVisible'](_0xd11593||null);return _0x15897e['offsetWidth'],_0x15897e['_ancestorsToRestore']=_0x293092,_0x15897e;}['_calculateOverflowInContainer'](_0x101488,_0x3c80ff){const _0x2d4edb=_0x101488['_targetContainer']||_0x101488,_0x824be7=[],{rowCount:_0x2bb13c}=this['_renderChipsAndCountRows'](_0x2d4edb,_0x3c80ff);if(_0x2bb13c<=this['_config']['maxVisibleRows'])return _0x824be7;const _0x3db6a0=_0x3c80ff['slice']();for(;_0x3db6a0['length']>0x0;){if(this['_testButtonFit'](_0x101488,_0x2d4edb,_0x3db6a0)){const _0x1da330=_0x3c80ff['filter'](_0x51dc7b=>!_0x3db6a0['includes'](_0x51dc7b));_0x824be7['push'](..._0x1da330);break;}if(!_0x3db6a0['pop']())break;}return _0x824be7;}['_renderChipsAndCountRows'](_0x3171b6,_0x3ce842){_0x3171b6['innerHTML']='',_0x3ce842['forEach'](_0x44675b=>{if(_0x44675b['element']){const _0x474aa6=_0x44675b['element']['cloneNode'](!0x0);_0x3171b6['appendChild'](_0x474aa6);}}),_0x3171b6['offsetWidth'];const _0xe3513c=_0x3171b6['children'],_0x327762=[];return Array['from'](_0xe3513c)['forEach'](_0x5bd350=>{const _0x489bdd=_0x5bd350['getBoundingClientRect']()['top'];_0x327762['some'](_0x31064c=>Math['abs'](_0x31064c-_0x489bdd)<this['_config']['rowDetectionTolerance'])||_0x327762['push'](_0x489bdd);}),{'rowCount':_0x327762['length']};}['_createMockButton'](){const _0x53fd18=document['createElement']('button');return _0x53fd18['className']=this['_config']['cssClasses']['showMoreButton'],this['_config']['cssClasses']['controlsButton']&&_0x53fd18['classList']['add'](this['_config']['cssClasses']['controlsButton']),_0x53fd18['textContent']='+\x201',_0x53fd18;}['_testButtonFit'](_0x462d72,_0xd167f8,_0x576645){this['_renderChipsAndCountRows'](_0xd167f8,_0x576645);const _0x2e20f1=this['_createMockButton']();_0x462d72['appendChild'](_0x2e20f1),_0x462d72['offsetWidth'];const _0x2f17a6=[..._0xd167f8['children'],_0x2e20f1],_0x18c24c=[];_0x2f17a6['forEach'](_0x53b957=>{const _0x3aea07=_0x53b957['getBoundingClientRect']()['top'];_0x18c24c['some'](_0x41bfbb=>Math['abs'](_0x41bfbb-_0x3aea07)<this['_config']['rowDetectionTolerance'])||_0x18c24c['push'](_0x3aea07);});const _0xccca5b=_0x18c24c['length'];return _0x2e20f1['remove'](),_0xccca5b<=this['_config']['maxVisibleRows'];}['_distributeChips'](_0x2bfa4b,_0x297ed3){this['_visibleChips']['clear'](),this['_overflowChips']['clear'](),_0x2bfa4b['forEach'](_0x1891de=>{_0x297ed3['includes'](_0x1891de)?this['_overflowChips']['add'](_0x1891de):this['_visibleChips']['add'](_0x1891de);});}['_updateOverflowUI'](_0x1c6aa1){if(_0x1c6aa1>0x0&&!this['_showMoreButtonView']&&this['_createShowMoreButton'](),_0x1c6aa1>0x0&&this['_showMoreButtonView']){const _0x584e33=''+this['_config']['showMoreLabelPrefix']+(_0x1c6aa1<0x63?_0x1c6aa1:'99');this['_showMoreButtonView']['label']=_0x584e33;}this['_updateBalloonContent'](),this['_updateShowMoreButtonVisibility'](),this['_repinBalloonPanel']();}['_applyOverflowResults'](_0x5b7a11,_0x414186){this['_distributeChips'](_0x5b7a11,_0x414186),this['_updateOverflowUI'](_0x414186['length']);}['_setupVisibilityObserver'](){this['_containerElement']&&'undefined'!=typeof IntersectionObserver&&(this['_intersectionObserver']=new IntersectionObserver(_0x12f896=>{_0x12f896[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 _0x247207=this['_containerElement']['getBoundingClientRect']();if(0x0===_0x247207['width']||0x0===_0x247207['height'])return!0x1;const _0x3019f7=window['innerHeight']||document['documentElement']['clientHeight'],_0x51622c=window['innerWidth']||document['documentElement']['clientWidth'],_0x4cd34d=0xc8;return _0x247207['bottom']>=-0xc8&&_0x247207['top']<=_0x3019f7+_0x4cd34d&&_0x247207['right']>=-0xc8&&_0x247207['left']<=_0x51622c+_0x4cd34d;}}const Bn='ck-ai-chat__feed__context-chips',Gn='ck-ai-chat-context-chips-wrapper',Fn='ck-ai-chat-context-chips-wrapper-balloon',Kn='ck-ai-chat-controls-button',Wn='ck-ai-chat-controls_context_show-more-button',Yn='ck-ai-chat-context-controls__show-more-balloon-panel';class $n extends Nt{['_contextChips']=this['createCollection']();['_overflowManager'];['_bodyCollection'];constructor(_0x13ed86,_0xbc5c52,_0x5c73b0){super(_0x13ed86),this['_bodyCollection']=_0x5c73b0,this['_createContextChips'](_0xbc5c52);const _0x3d3971={'cssClasses':{'showMoreButton':Wn+'\x20'+ds,'showMoreBalloon':Yn,'overflowContainer':Fn,'controlsButton':Kn}};this['_overflowManager']=new Vn(_0x13ed86,this['_contextChips'],_0x3d3971,this['_bodyCollection'],this),this['setTemplate']({'tag':'div','attributes':{'class':[Bn,'ck','ck-reset_all']},'children':[{'tag':'div','attributes':{'class':Gn},'children':this['_contextChips']}]});}['render'](){super['render']();const _0x3f1f46=this['element']['querySelector']('.'+Gn);_0x3f1f46&&(this['_overflowManager']['setContainerElement'](_0x3f1f46),this['_overflowManager']['reorganizeChips']());}['destroy'](){super['destroy'](),this['_overflowManager']['destroy']();}['_createContextChips'](_0x32f065){for(const _0x492a5b of _0x32f065){const _0x40fb79=new Pn(this['locale'],_0x492a5b,!0x0,!0x1);this['_contextChips']['add'](_0x40fb79);}}}class qn extends rn{['_contextChipsView']=null;['_locale'];['_bodyCollection'];['_messageContentView'];constructor(_0x5e2378,_0x3c9ae5,_0x44c525){super(_0x3c9ae5),this['_locale']=_0x5e2378,this['_bodyCollection']=_0x44c525,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 $n(this['_locale'],this['options']['contextItems']['filter'](_0x3798f2=>!_0x3798f2['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 Qn extends rn{['capabilities'];constructor(_0x24861e,_0x456a32){super(_0x456a32);const {isWebSearchEnabled:_0x39b2c8,isReasoningEnabled:_0x965aa9}=_0x456a32['capabilities'],_0x443d0b=[];let _0x9e47ab='';_0x39b2c8&&_0x965aa9?(_0x9e47ab=cs(_0x24861e,'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH_REASONING'),_0x443d0b['push'](Xn(_0x189481)),_0x443d0b['push'](Xn(_0x9432d4))):_0x39b2c8?(_0x9e47ab=cs(_0x24861e,'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH'),_0x443d0b['push'](Xn(_0x189481))):_0x965aa9&&(_0x9e47ab=cs(_0x24861e,'AI_CHAT_FEED_REPLY_ITEM_USED_REASONING'),_0x443d0b['push'](Xn(_0x9432d4))),this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__interaction-header',_0x9e47ab?'':'ck-hidden']}});const _0xac65df=new Nt();_0xac65df['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__interaction-header__capabilities']},'children':[..._0x443d0b,{'tag':'span','attributes':{'class':['ck-ai-chat__feed__interaction-header__capabilities__text']},'children':[_0x9e47ab]}]}),this['children']['add'](_0xac65df),this['capabilities']=_0x456a32['capabilities'];}}function Xn(_0x16134c){const _0x4b90c8=new yt();return _0x4b90c8['content']=_0x16134c,_0x4b90c8;}const zn=['wheel','touchstart','pointerdown','keydown'],jn=['ArrowUp','ArrowDown','PageUp','PageDown','Home','End','\x20'];class Jn{['element'];['animationFrameId'];['isRunning'];['abortController'];['isUserPaused'];constructor(_0x8da1e7){this['element']=_0x8da1e7,this['animationFrameId']=null,this['isRunning']=!0x1,this['abortController']=new AbortController(),this['isUserPaused']=!0x1;for(const _0x300349 of zn){const _0x206429='keydown'!==_0x300349;this['element']['addEventListener'](_0x300349,this['_onUserEvent']['bind'](this),{'passive':_0x206429,'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'](_0x15092c){if(this['isRunning']){if('keydown'===_0x15092c['type']){const _0x29f138=_0x15092c['key'];if(!jn['includes'](_0x29f138))return;}_0x15092c instanceof WheelEvent?_0x15092c['deltaY']<0x0?this['isUserPaused']=!0x0:this['isUserPaused']=!this['_isAtBottom']():this['isUserPaused']=!0x0;}}['_isAtBottom'](){const {scrollTop:_0x5a4901,scrollHeight:_0x2d4566,clientHeight:_0x3de5d6}=this['element'];return _0x2d4566-_0x5a4901-_0x3de5d6<=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(_0x2cf9b0,_0x41d204){super(_0x2cf9b0),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-skeleton']},'children':this['_createSkeletonItems'](_0x41d204)});}['_createSkeletonItems'](_0x535cd7){const _0x3a56e3=['ck','ck-ai-skeleton__item'];return _0x535cd7['map'](_0x454d7f=>{let _0x568868='';switch(_0x454d7f['attributes']['align']){case'right':_0x568868='margin-left:\x20auto;\x20margin-right:\x200;\x20text-align:\x20right;';break;case'center':_0x568868='margin-left:\x20auto;\x20margin-right:\x20auto;\x20text-align:\x20center;';break;case'left':_0x568868='margin-left:\x200;\x20margin-right:\x20auto;\x20text-align:\x20left;';}return{'tag':_0x454d7f['tag'],'attributes':{'class':[..._0x3a56e3,_0x454d7f['attributes']['class']?_0x454d7f['attributes']['class']:''],'style':'width:\x20'+_0x454d7f['attributes']['width']+';\x20height:\x20'+_0x454d7f['attributes']['height']+';'+_0x568868}};});}}const tr={'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':er(0x5,'100%','44px','right'),'aiChatResources':er(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 er(_0x3733ad,_0x581d63,_0x40e597,_0x33577d){return new Array(_0x3733ad)['fill'](null)['map'](()=>({'tag':'div','attributes':{'width':_0x581d63,'height':_0x40e597,'align':_0x33577d}}));}class ir extends rn{constructor(_0x48c509){super(_0x48c509),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 sr extends Nt{['children'];['scrollManager'];['_bodyCollection'];constructor(_0x9c5b08,_0x56ac68){super(_0x9c5b08),this['_bodyCollection']=_0x56ac68,this['set']('isPending',!0x1),this['set']('loadingMessage',''),this['set']('isLoadingSkeletonVisible',!0x1),this['set']('isTrackChangesOn',!0x1),this['children']=this['createCollection'](),this['children']['delegate'](...Js)['to'](this),this['_setupTemplate']();}['render'](){super['render'](),this['scrollManager']=new Jn(this['element']);}['destroy'](){super['destroy'](),this['scrollManager']['destroy']();}['clear'](){this['children']['clear']();}['addItem'](_0x3c6181,_0x4f7e23){let _0x3caf1f;return'ai-reply'===_0x3c6181?_0x3caf1f=new bn(this['locale'],_0x4f7e23,this['_bodyCollection']):'ai-suggestion-reply'===_0x3c6181?(_0x3caf1f=new Sn(this['locale'],_0x4f7e23,this['_bodyCollection']),_0x3caf1f['bind']('isTrackChangesOn')['to'](this)):_0x3caf1f='user-message'===_0x3c6181?new qn(this['locale'],_0x4f7e23,this['_bodyCollection']):'interaction-header'===_0x3c6181?new Qn(this['locale'],_0x4f7e23):'custom-element'===_0x3c6181?new ir(_0x4f7e23):new En(_0x4f7e23),this['children']['add'](_0x3caf1f),_0x3caf1f;}async['updateReplyItem']({id:_0x5b1baf,parsedContent:_0xc6eed5,renderingStrategy:_0x527c87,abortSignal:_0x8bcbcf}){const _0x3681b9=this['getItemById'](_0x5b1baf);if(!(_0x3681b9 instanceof bn))throw new ot('ai-chat-feed-view-item-not-a-reply-item',null,{'itemView':_0x3681b9,'id':_0x5b1baf,'parsedContent':_0xc6eed5});await _0x3681b9['updateContent']({'parsedContent':_0xc6eed5,'renderingStrategy':_0x527c87,'abortSignal':_0x8bcbcf});}async['updateWebSources'](_0x1bc433,_0x2d3e09){const _0x2e57c5=this['getItemById'](_0x1bc433);if(_0x2e57c5 instanceof Sn)_0x2e57c5['updateSources'](_0x2d3e09);else{if(!(_0x2e57c5 instanceof bn))throw new ot('ai-chat-feed-view-item-not-a-suggestion-or-reply-item',null,{'itemView':_0x2e57c5,'id':_0x1bc433,'sources':_0x2d3e09});_0x2e57c5['updateSources'](_0x2d3e09);}}async['updateSuggestionItem']({id:_0x1f56b3,parts:_0x57244a,renderingStrategy:_0x20663d,abortSignal:_0x42df36}){const _0x44b9d9=this['getItemById'](_0x1f56b3);if(!(_0x44b9d9 instanceof Sn))throw new ot('ai-chat-feed-view-item-not-a-suggestion-item',null,{'itemView':_0x44b9d9,'id':_0x1f56b3,'parts':_0x57244a});await _0x44b9d9['updateContent']({'parts':_0x57244a,'renderingStrategy':_0x20663d,'abortSignal':_0x42df36});}['updateSuggestionPartState']({id:_0x303dfc,index:_0x4a86b2,state:_0x5146d9}){const _0x1020be=this['getItemById'](_0x303dfc);if(!(_0x1020be instanceof Sn))throw new ot('ai-chat-feed-view-item-not-a-suggestion-item',this,{'id':_0x303dfc});_0x1020be['updatePartState'](_0x4a86b2,_0x5146d9);}['setSuggestionPartActive']({id:_0x21a82b,index:_0x3e4328,isActive:_0x1a76b6}){const _0x5cb428=this['getItemById'](_0x21a82b);if(!(_0x5cb428 instanceof Sn))throw new ot('ai-chat-feed-view-item-not-a-suggestion-item',this,{'id':_0x21a82b});this['children']['filter'](_0x382936=>_0x382936 instanceof Sn)['forEach'](_0x19f3a3=>{_0x19f3a3['setPartActive'](!0x1);}),_0x5cb428['setPartActive'](_0x3e4328,_0x1a76b6);}['markItemAsDone'](_0x327a38){this['getItemById'](_0x327a38)['markAsDone']();}['getItemIds'](){return this['children']['map'](_0x4b75d4=>_0x4b75d4['options']['id']);}['removeItem'](_0x4059d6){this['children']['remove'](this['getItemById'](_0x4059d6));}['hasItem'](_0x11172b){return!!this['children']['find'](_0x4c397a=>_0x4c397a['options']['id']['includes'](_0x11172b));}['scrollToSuggestion'](_0x38cebe,_0x541626){const _0x15b6bd=this['getItemById'](_0x38cebe);if(!(_0x15b6bd instanceof Sn))return void pt('ck-ai-chat-feed-view-scroll-to-suggestion-invalid-item',{'replyId':_0x38cebe,'partIndex':_0x541626});const _0x769600=_0x15b6bd['getPartView'](_0x541626);_0x769600?wt(_0x769600['element'],0x14,this['element']['parentElement'],!0x0,!0x0):pt('ck-ai-chat-feed-view-scroll-to-suggestion-part-view-not-found',{'replyId':_0x38cebe,'partIndex':_0x541626});}['_setupTemplate'](){this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed']},'children':this['_createTemplateChildren']()});}['_createTemplateChildren'](){const _0x41be2d=this['_createSkeletonLoader']();return[this['_createFeedItems'](),_0x41be2d,this['_createFeedLoader']()];}['_createSkeletonLoader'](){const _0x5a9810=new Zn(this['locale'],tr['aiFeed']);return _0x5a9810['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isLoadingSkeletonVisible','ck-hidden',_0x4d12ac=>!_0x4d12ac)]}}),_0x5a9810;}['_createFeedItems'](){const _0x3dd74a=new Nt(this['locale']);return _0x3dd74a['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__items',this['bindTemplate']['if']('isLoadingSkeletonVisible','ck-hidden')]},'children':this['children']}),_0x3dd74a;}['_createFeedLoader'](){const _0x3b8475=new Nt(this['locale']);return _0x3b8475['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__loader',this['bindTemplate']['if']('isPending','ck-hidden',_0x3eca0d=>!_0x3eca0d)]},'children':this['_createLoaderChildren']()}),_0x3b8475;}['_createLoaderChildren'](){const _0x1d6a52=new Rn();return _0x1d6a52['isVisible']=!0x0,[_0x1d6a52,{'tag':'span','attributes':{'class':['ck','ck-ai-chat__loader-text']},'children':[{'text':this['bindTemplate']['to']('loadingMessage')}]}];}['getItemById'](_0x5f349b){const _0x4fb9c3=this['children']['find'](_0x581a6f=>_0x581a6f['options']['id']['includes'](_0x5f349b));if(!_0x4fb9c3)throw new ot('ai-chat-feed-view-item-not-found',this,{'id':_0x5f349b});return _0x4fb9c3;}['setLoadingMessage'](_0x4282df){this['set']('loadingMessage',_0x4282df);}['toggleLoadingSkeleton'](_0x7fcf2){this['set']('isLoadingSkeletonVisible',_0x7fcf2);}['startAutoScroll'](){this['scrollManager']['start']();}['stopAutoScroll'](){this['scrollManager']['stop']();}}class nr extends Lt{['filter'](){let _0x401499=0x0;for(const _0x56739a of this['items'])_0x401499+=_0x56739a['items']['length'];return{'resultsCount':_0x401499,'totalItemsCount':_0x401499};}}const rr='ck-ai-chat__prompt-input_highlighted';class ar extends xt{['submitButtonView'];static ['MIN_ROWS']=0x1;static ['MAX_ROWS']=0xc;['_addContextButtonView'];['_queryViewResizeObserver'];constructor(_0xff4e95,_0x23b04d){super(_0xff4e95,{'queryView':{'label':'','creator':Ut,'showIcon':!0x1,'showResetButton':!0x1},'filteredView':new nr(_0xff4e95),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1}),this['set']('isEmpty',!0x0),this['set']('isUploadInProgress',!0x1),this['_addContextButtonView']=_0x23b04d,this['_queryViewResizeObserver']=null,this['queryView']['fieldView']['minRows']=ar['MIN_ROWS'],this['queryView']['fieldView']['maxRows']=ar['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',(_0x50eba6,_0x4dcd6c)=>!_0x50eba6&&!_0x4dcd6c),this['focusableChildren']['add'](this['submitButtonView']);}['render'](){super['render'](),this['queryView']['fieldWrapperChildren']['add'](this['submitButtonView']),this['keystrokes']['set']('enter',(_0x2ec527,_0x51dfbf)=>{this['isUploadInProgress']||this['isEmpty']||_0x2ec527['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0x51dfbf());}),this['queryView']['fieldView']['on']('update',()=>{this['isEmpty']=''===this['queryView']['fieldView']['element']['value']?.['trim']();});}['destroy'](){super['destroy'](),this['_queryViewResizeObserver']&&this['_queryViewResizeObserver']['destroy']();}['submit'](){const _0x5b8ad2=this['queryView']['fieldView']['element']['value']?.['trim']();if(!_0x5b8ad2)return this['queryView']['errorText']=cs(this['locale'],'AI_CHAT_PROMPT_EMPTY_ERROR'),void(this['queryView']['fieldView']['hasError']=!0x0);this['queryView']['fieldView']['hasError']=!0x1;const _0x57985f=_0x40b9c9(_0x5b8ad2);this['fire']('sendUserMessage',_0x57985f),this['queryView']['fieldView']['reset']();}['setPlaceholderText'](_0x194d89){this['queryView']['fieldView']['set']('placeholder',_0x194d89);}['focus'](_0x100e44=!0x1){super['focus'](),_0x100e44&&(this['element']['classList']['contains'](rr)||(this['element']['classList']['add'](rr),setTimeout(()=>{this['element']['classList']['remove'](rr);},0x320)));}['_createSubmitButton'](){const _0x285c1c=new kt(this['locale']);return _0x285c1c['set']({'icon':_0x5ac320,'label':cs(this['locale'],'AI_CHAT_LABEL_SUBMIT'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-chat__prompt-submit-button\x20'+ls,'isEnabled':!0x1}),_0x285c1c['on']('execute',()=>{this['submit']();}),_0x285c1c;}['setIsUploadInProgress'](_0x281340){this['isUploadInProgress']=_0x281340;}['_setUpAddContextButtonPositioning'](){const _0x2da0c5=this['locale'],_0x334ceb=()=>{ct['window']['requestAnimationFrame'](()=>{if(lt(this['element'])){const _0x3a717e=new ut(this['queryView']['fieldView']['element']),_0x27a635=new ut(this['_addContextButtonView']['element']),_0x3be138=_0x3a717e['width'],_0x509c3c='rtl'===_0x2da0c5['uiLanguageDirection']?'right':'left';_0x3a717e['excludeScrollbarsAndBorders']();const _0x4919ca=_0x3be138-_0x3a717e['width']+0x1;this['_addContextButtonView']['element']['style'][_0x509c3c]='calc('+(_0x3be138-_0x27a635['width']-_0x4919ca)+'px\x20-\x20var(--ck-spacing-tiny))';}});};this['queryView']['fieldView']['on']('update',_0x334ceb),this['on']('render',()=>{_0x334ceb(),this['_queryViewResizeObserver']=new ft(this['queryView']['fieldView']['element'],()=>{_0x334ceb();});});}}const or='ck-ai-chat__prompt-capabilities',hr='ck-ai-chat-controls-button',cr='ck-ai-chat-controls-button--commands',lr='ck-ai-chat-controls__model-selection',ur='ck-ai-chat-controls__model-selection__item-name',dr='ck-ai-chat-controls__model-selection__item-description',_r='ck-ai-chat-controls__model-selection__item-capabilities',Ar='n';class gr extends Nt{['_webSearchButton'];['_reasoningButton'];['_commandsButton'];['_modelSelectionDropdown'];['_modelSelectionDropdownItems'];['_modelNameView'];constructor(_0x120d6e){super(_0x120d6e),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',_0x44c117=>'selector'===_0x44c117),this['_modelSelectionDropdown']['buttonView']['bind']('tooltip')['to'](this,'modelSelectorEnabled',_0x3d0306=>_0x3d0306?this['_modelSelectionDropdown']['buttonView']['label']:cs(this['locale'],'AI_CHAT_MODEL_SELECTOR_DISABLED_TOOLTIP')),this['_modelSelectionDropdown']['bind']('isEnabled')['to'](this,'modelSelectorEnabled',_0x4e62ee=>_0x4e62ee),this['_webSearchButton']['bind']('isOn')['to'](this,'webSearchActive',_0x4d0f2a=>_0x4d0f2a),this['_webSearchButton']['bind']('tooltip')['to'](this,'webSearchActive',_0x4a8a8e=>cs(this['locale'],_0x4a8a8e?'AI_CHAT_DISABLE_WEB_SEARCH':'AI_CHAT_ENABLE_WEB_SEARCH')),this['_reasoningButton']['bind']('isOn')['to'](this,'reasoningActive',_0x3ee084=>_0x3ee084),this['_reasoningButton']['bind']('tooltip')['to'](this,'reasoningActive',_0x4fa4d3=>cs(this['locale'],_0x4fa4d3?'AI_CHAT_DISABLE_REASONING':'AI_CHAT_ENABLE_REASONING')),this['setTemplate']({'tag':'div','attributes':{'class':[or]},'children':[this['_modelSelectionDropdown'],this['_modelNameView'],this['_webSearchButton'],this['_reasoningButton'],this['_commandsButton']]}),this['_modelSelectionDropdownItems']=new dt(),zt(this['_modelSelectionDropdown'],this['_modelSelectionDropdownItems']);}['setModelList'](_0x50ce26,_0x3ee15a){if(_0x3ee15a)this['set']('modelDisplayMode','hidden');else{const _0x1bf3e2=0x1===_0x50ce26['length'];this['set']('modelDisplayMode',_0x1bf3e2?'name':'selector');}if(this['_modelSelectionDropdownItems']['clear'](),_0x50ce26?.['length'])for(const _0x55e31e of _0x50ce26){const _0x18b668=new jt({'label':_0x55e31e['name'],'withText':!0x0,'role':'menuitemradio','id':_0x55e31e['id'],'model':_0x55e31e});_0x18b668['bind']('isOn')['to'](this,'activeModelId',_0x4478d2=>_0x4478d2===_0x55e31e['id']),this['_modelSelectionDropdownItems']['add']({'type':'button','model':_0x18b668,'labelView':new Ir(this['locale'],_0x55e31e)});}}['setWebSearch'](_0x2a70f4){this['set']('webSearchActive',_0x2a70f4);}['setReasoning'](_0x5afef0){this['set']('reasoningActive',_0x5afef0);}['setModel'](_0x3b620c){if(!_0x3b620c)return;this['activeModelId']=_0x3b620c['id'],this['activeModelName']=_0x3b620c['name']||_0x3b620c['id'],this['_modelSelectionDropdown']['buttonView']['set']('label',_0x3b620c['name']),this['_modelSelectionDropdown']['buttonView']['set']('tooltip',_0x3b620c['name']);const _0x5083bc=_0x3b620c['capabilities']['webSearch']?.['enabled']??!0x1;this['set']('webSearchActive',!0x1),this['_webSearchButton']['set']('isOn',!0x1),this['_webSearchButton']['set']('isEnabled',_0x5083bc),this['_webSearchButton']['set']('isVisible',_0x5083bc);const _0x51f6a9=_0x3b620c['capabilities']['reasoning']?.['enabled']??!0x1;this['set']('reasoningActive',!0x1),this['_reasoningButton']['set']('isOn',!0x1),this['_reasoningButton']['set']('isEnabled',_0x51f6a9),this['_reasoningButton']['set']('isVisible',_0x51f6a9);}['enableModelSelector'](){this['set']('modelSelectorEnabled',!0x0);}['disableModelSelector'](_0x18f423){this['set']('modelSelectorEnabled',!0x1),_0x18f423&&this['set']('modelDisplayMode','hidden');}['_createWebSearchButton'](){const _0x3c844e=new kt();return _0x3c844e['set']({'label':cs(this['locale'],'AI_CHAT_SEARCH_WEB'),'icon':_0x189481,'class':hr+'\x20'+ds,'isToggleable':!0x0,'tooltipPosition':Ar}),_0x3c844e['on']('execute',()=>{this['fire']('toggleWebSearch');}),_0x3c844e;}['_createReasoningButton'](){const _0x4d7d41=new kt();return _0x4d7d41['set']({'label':cs(this['locale'],'AI_CHAT_REASONING'),'icon':_0x9432d4,'class':hr+'\x20'+ds,'isToggleable':!0x0,'tooltipPosition':Ar}),_0x4d7d41['on']('execute',()=>{this['fire']('toggleReasoning');}),_0x4d7d41;}['_createCommandsButton'](){const _0x4a875d=new kt();return _0x4a875d['set']({'label':cs(this['locale'],'AI_CHAT_COMMANDS'),'icon':_0x2e61b1,'withText':!0x0,'class':hr+'\x20'+ds,'isToggleable':!0x0,'tooltip':cs(this['locale'],'AI_CHAT_COMMANDS'),'tooltipPosition':Ar}),_0x4a875d['extendTemplate']({'attributes':{'class':[cr]}}),_0x4a875d['on']('execute',()=>{console['log']('Commands\x20are\x20not\x20implemented\x20yet.'),alert('Commands\x20are\x20not\x20implemented\x20yet.');}),_0x4a875d;}['_createModelSelectionDropdown'](){const _0x266882=Bt(this['locale']);return _0x266882['set']({'panelPosition':'ne','class':[lr]}),_0x266882['buttonView']['set']({'label':cs(this['locale'],'AI_CHAT_MODEL_SELECTOR_ENABLED_TOOLTIP'),'withText':!0x0,'tooltip':!0x0,'tooltipPosition':Ar,'class':ds}),this['listenTo'](_0x266882,'execute',_0x1b7da4=>{this['fire']('selectModel',_0x1b7da4['source']['model']);}),_0x266882;}['_createModelNameView'](){const _0x582ead=new Er(this['locale']);return _0x582ead['bind']('text')['to'](this,'activeModelName',_0x391ac5=>_0x391ac5??''),_0x582ead['bind']('isVisible')['to'](this,'modelDisplayMode',_0x47d1cf=>'name'===_0x47d1cf),_0x582ead;}}let Ir=class extends Ht{constructor(_0x122ba4,_0x14eca2){super();const _0x397baf=this['bindTemplate'],_0x2ea79b=this['createCollection']();this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-button__label'],'style':_0x397baf['to']('style'),'id':_0x397baf['to']('id')},'children':[{'tag':'div','attributes':{'class':[ur]},'children':[{'text':_0x397baf['to']('text')}]},{'tag':'div','attributes':{'class':[dr]},'children':[{'tag':'span','children':[{'text':_0x14eca2['description']}]}]},{'tag':'div','attributes':{'class':[_r]},'children':_0x2ea79b}]}),_0x2ea79b['addMany'](this['_getCapabilityParts'](_0x122ba4,_0x189481,'AI_CHAT_SEARCH_WEB',_0x14eca2['capabilities']['webSearch']?.['enabled']??!0x1)),_0x2ea79b['addMany'](this['_getCapabilityParts'](_0x122ba4,_0x9432d4,'AI_CHAT_REASONING',_0x14eca2['capabilities']['reasoning']?.['enabled']??!0x1));}['_getCapabilityParts'](_0x5a00ee,_0xd831ae,_0x494f3e,_0x4a3f00){const _0x17f800=new yt();_0x17f800['content']=_0xd831ae;const _0x575c29=new Nt(_0x5a00ee);_0x575c29['setTemplate']({'tag':'span','children':[{'text':cs(_0x5a00ee,_0x494f3e)+':\x20'}]});const _0x296fd6=new Nt(_0x5a00ee);return _0x296fd6['setTemplate']({'tag':'span','children':[{'text':cs(_0x5a00ee,_0x4a3f00?'AI_CHAT_CAPABILITIES_YES':'AI_CHAT_CAPABILITIES_NO')}]}),[_0x17f800,_0x575c29,_0x296fd6];}},Er=class extends Nt{constructor(_0x51b0c2){super(_0x51b0c2),this['set']('text',void 0x0),this['set']('isVisible',!0x0);const _0x1bff5b=this['bindTemplate'];this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-chat-controls__model-name',_0x1bff5b['if']('isVisible','ck-hidden',_0x4ed1a2=>!_0x4ed1a2)]},'children':[{'text':_0x1bff5b['to']('text')}]});}};const pr='ck-ai-chat-context-controls__url-form',Tr='ck-ai-chat-context-controls__url-input-section';class mr extends Nt{['focusTracker'];['keystrokes'];['_focusables'];['focusCycler'];['urlInputField'];['backButton'];['confirmButton'];constructor(_0x36c44a){super(_0x36c44a),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'](_0x2aed8e=>{this['focusTracker']['add'](_0x2aed8e['element']),this['keystrokes']['listenTo'](_0x2aed8e['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'](_0x54c161){this['urlInputField']['errorText']=_0x54c161,this['_updateConfirmButtonState'](),this['fire']('refreshBalloon');}['clearError'](){this['urlInputField']['errorText']=null,this['_updateConfirmButtonState']();}['_createBackButton'](){const _0x2f7f6c=new kt(this['locale']);return _0x2f7f6c['set']({'icon':_0x1b2d41,'tooltip':cs(this['locale'],'AI_CHAT_CONTEXT_URL_BACK_TO_CONTEXT'),'tooltipPosition':'n','class':['ck-button-icon\x20ck-button-back']}),this['on']('change:withBackButton',(_0x158ada,_0x5376cd,_0x107100)=>{_0x2f7f6c['set']({'class':['ck-button-icon\x20ck-button-back'+(_0x107100?'':'\x20ck-hidden')]});}),_0x2f7f6c;}['_createUrlInputField'](){const _0x4147af=new Zt(this['locale'],te);return _0x4147af['set']({'label':cs(this['locale'],'AI_CHAT_CONTEXT_URL_LABEL'),'class':'ck-labeled-field-view_empty'}),_0x4147af['fieldView']['set']({'placeholder':cs(this['locale'],'AI_CHAT_CONTEXT_URL_PLACEHOLDER')}),_0x4147af;}['_createConfirmButton'](){const _0x5eccc8=new kt(this['locale']);return _0x5eccc8['set']({'icon':_0x790d5c,'tooltip':cs(this['locale'],'AI_CHAT_CONTEXT_URL_ADD_URL'),'tooltipPosition':'n','class':'ck-button-icon','type':'submit','isEnabled':!0x1}),_0x5eccc8;}['_setupTemplate'](){const _0x1f0b69=new _0x27cd18(this['locale'],{'label':cs(this['locale'],'AI_CHAT_CONTEXT_URL_ADD_URL'),'class':'ck-ai-header\x20ck-ai-header_small\x20ck-ai-header_context-url'});_0x1f0b69['children']['add'](this['backButton'],0x0),this['setTemplate']({'tag':'form','attributes':{'class':pr,'tabindex':'-1'},'children':[_0x1f0b69,{'tag':'div','attributes':{'class':Tr},'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',_0x5b4f17=>{_0x5b4f17['stop'](),this['_handleSubmit']();});}['_setupKeystrokes'](){this['keystrokes']['set']('esc',(_0x4c83fd,_0x271303)=>{this['clear'](),this['fire']('cancel'),_0x271303();});}['_handleSubmit'](){const _0x20777d=this['getValue']()['trim']();_0x20777d?this['_isValidUrl'](_0x20777d)?(this['clearError'](),this['fire']('submitUrl',_0x20777d)):this['setError'](cs(this['locale'],'AI_CHAT_CONTEXT_URL_INVALID_ERROR')):this['setError'](cs(this['locale'],'AI_CHAT_CONTEXT_URL_EMPTY_ERROR'));}['_updateConfirmButtonState'](){const _0x2b8937=this['getValue']()['trim'](),_0x565ca3=!!this['urlInputField']['errorText'];this['confirmButton']['isEnabled']=_0x2b8937['length']>0x0&&!_0x565ca3;}['_isValidUrl'](_0x268dd1){try{return!!new URL(_0x268dd1);}catch{return!0x1;}}}const Cr='ck-ai-chat-resources__item',wr='ck-ai-chat-resources__item--in-context',fr='ck-ai-chat-resources__item-title',Sr='ck-ai-chat-resources__item__icon';class br extends Pt{['resource'];['_titleView'];['_iconView'];constructor(_0x283912,_0x42c482){super(_0x283912),this['resource']=_0x42c482,this['set']('isInContext',!!_0x42c482['isInContext']),this['_titleView']=this['_createTitleView'](),this['_iconView']=this['_createIconView'](),this['_setupTemplate']();}['render'](){super['render']();}['getResourceIcon'](_0x2d3a41){if(_0x2d3a41['isInContext'])return _0x790d5c;switch(_0x2d3a41['type']){case'document':return _0x26cdeb;case'web-resource':return _0x2f0db7;case'file':case'text':return _0x3a9ee9;default:return _0x3e2b4f;}}['highlightText'](_0x2ab236){if(!_0x2ab236||''===_0x2ab236['trim']())return void this['_titleView']['highlightText'](null);const _0x5ce2b7=new RegExp(_0x1565e1(_0x2ab236),'gi');this['_titleView']['highlightText'](_0x5ce2b7);}['updateResourceState'](_0x5c8d40){this['resource']['isInContext']=_0x5c8d40,this['isInContext']=_0x5c8d40,this['_updateIcon']();}['_createTitleView'](){const _0x275f9b=new _0x472014();return _0x275f9b['text']=this['resource']['label'],_0x275f9b['extendTemplate']({'tag':'span','attributes':{'class':[fr]}}),_0x275f9b;}['_createIconView'](){const _0x57706e=new yt();return _0x57706e['content']=this['getResourceIcon'](this['resource']),_0x57706e;}['_setupTemplate'](){const _0x49bd6e=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':[Cr,_0x49bd6e['if']('isVisible','ck-hidden',_0x3d39c2=>!_0x3d39c2),_0x49bd6e['if']('isInContext',wr)]},'children':[{'tag':'div','attributes':{'class':[Sr]},'children':[this['_iconView']]},this['_titleView']],'on':{'click':_0x49bd6e['to']('execute')}});}['_updateIcon'](){this['_iconView']['content']=this['getResourceIcon'](this['resource']);}}const Rr='ck-ai-chat-resources__list';class Or extends Lt{['_source'];constructor(_0xec1f3d,_0x4dfe38){super(_0xec1f3d),this['_source']=_0x4dfe38,this['extendTemplate']({'attributes':{'class':[Rr]}});}['setResources'](_0x13f474,_0x5c810e){this['items']['clear']();let _0xf8cac8=_0x13f474;if(this['_source']['useDefaultFiltering']&&_0x5c810e&&''!==_0x5c810e['trim']()){const _0xa30e40=new RegExp(_0x5c810e['replace'](/[.*+?^${}()|[\]\\]/g,'\x5c$&'),'gi');_0xf8cac8=_0x13f474['filter'](_0x61588=>_0xa30e40['test'](_0x61588['label']));}for(const _0x531fe4 of _0xf8cac8){const _0x1a1700=new br(this['locale'],_0x531fe4);_0x1a1700['on']('execute',()=>{this['_handleResourceSelection'](this['_source'],_0x531fe4);}),this['items']['add'](_0x1a1700);}this['_source']['useDefaultFiltering']&&this['highlightText'](_0x5c810e);}['highlightText'](_0x13e16b){this['_source']['useDefaultFiltering']&&this['items']['forEach'](_0x29d8dc=>{_0x29d8dc['highlightText'](_0x13e16b);});}['updateResourceState'](_0x11391a,_0x4a7a56){for(const _0xd38f87 of this['items']){const _0x523bbe=_0xd38f87;_0x523bbe['resource']['id']===_0x11391a&&_0x523bbe['updateResourceState'](_0x4a7a56);}}['_handleResourceSelection'](_0x159479,_0xa7405a){this['fire']('addResourceToContext',{'source':_0x159479,'resource':_0xa7405a});}}class kr extends Zt{['iconView'];['resetButtonView'];['_viewConfig'];constructor(_0x4d7074){const t=_0x4d7074['t'],_0x592b04={'showResetButton':!0x0,'showIcon':!0x0,'creator':te,'label':cs(_0x4d7074,'AI_CHAT_SEARCH_RESOURCES')};super(_0x4d7074,_0x592b04['creator']),this['label']=_0x592b04['label'],this['_viewConfig']=_0x592b04,this['_viewConfig']['showIcon']&&this['_setupSearchIcon'](),this['_viewConfig']['showResetButton']&&this['_setupResetButton'](_0x4d7074,t),this['_setupEventListeners']();}['reset'](){this['fieldView']['reset'](),this['_viewConfig']['showResetButton']&&this['resetButtonView']&&(this['resetButtonView']['isVisible']=!0x1),this['search']('');}['search'](_0x4a7b1f){this['fire']('search',_0x4a7b1f);}['getQuery'](){return this['fieldView']['element']?.['value']||'';}['_setupSearchIcon'](){this['iconView']=new yt(),this['iconView']['content']=_0x274dff,this['fieldWrapperChildren']['add'](this['iconView'],0x0),this['extendTemplate']({'attributes':{'class':'ck-search__query_with-icon'}});}['_setupResetButton'](_0x175252,t){this['resetButtonView']=new kt(_0x175252),this['resetButtonView']['set']({'label':t('Clear'),'icon':_0xbe3949,'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',_0x278e16=>!_0x278e16),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 Nr extends Nt{['_searchView'];['_searchSection'];['_searchInputVisibleFrom'];['_resourcesListView'];['_skeletonLoader'];['_source'];['children'];['_latestLoadResourcesUid']=null;constructor(_0x9501b1,_0x54b629){super(_0x9501b1),this['_source']=_0x54b629['source'],this['_searchInputVisibleFrom']=_0x54b629['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 _0x25ec1a([this['_skeletonLoader'],this['_resourcesListView']]),this['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-chat-resources'},'children':this['children']});}['_createSearchView'](){return new kr(this['locale']);}['_createSearchSection'](){const _0xf41a3c=new Nt(this['locale']);return _0xf41a3c['setTemplate']({'tag':'div','attributes':{'class':'ck\x20ck-search'},'children':[this['_searchView']]}),this['_searchView']['on']('search',(_0x245459,_0x3091d9)=>{this['loadResources'](_0x3091d9),this['_source']['useDefaultFiltering']&&this['_resourcesListView']['highlightText'](_0x3091d9);}),_0xf41a3c;}['_createResourcesListView'](){const _0x5989f4=new Or(this['locale'],this['_source']);return _0x5989f4['delegate']('addResourceToContext')['to'](this),_0x5989f4['extendTemplate']({'attributes':{'class':this['bindTemplate']['if']('isLoading','ck-hidden')}}),_0x5989f4;}['_createSkeletonView'](){const _0x5e54ea=new Zn(this['locale'],tr['aiChatResources']);return _0x5e54ea['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isLoading','ck-hidden',_0x5afefc=>!_0x5afefc)]}}),_0x5e54ea;}['render'](){super['render'](),this['loadResources']('');}['loadResources'](_0x44cde8){const _0x4e408d=at();this['_latestLoadResourcesUid']=_0x4e408d,this['fire']('loadSourceResources',{'sourceId':this['_source']['id'],'query':_0x44cde8,'uid':_0x4e408d}),this['isLoading']=!0x0;}['setResources'](_0x468bc0,_0x1552df){if(_0x1552df&&_0x1552df!==this['_latestLoadResourcesUid'])return;const _0x197d5b=this['_source']['useDefaultFiltering']?this['_searchView']['getQuery']():'';this['_resourcesListView']['setResources'](_0x468bc0,_0x197d5b),_0x468bc0['length']>=this['_searchInputVisibleFrom']&&!this['children']['has'](this['_searchSection'])&&this['children']['add'](this['_searchSection'],0x0),requestAnimationFrame(()=>{this['isLoading']=!0x1;});}['updateResourceState'](_0x1511ae,_0x1ac317){this['_resourcesListView']['updateResourceState'](_0x1511ae,_0x1ac317);}}const vr='ck-ai-chat-context-controls__source-balloon-panel',yr='ck-button-icon\x20ck-button-back',xr='ck-ai-header\x20ck-ai-header_small\x20ck-ai-header_source';class Lr{['_sourceResourceBalloons']=new Map();['_bodyCollection'];['_locale'];['_config'];constructor(_0x4ee382,_0x4712e3,_0x207c46){this['_locale']=_0x4ee382,this['_bodyCollection']=_0x4712e3,this['_config']=_0x207c46;}['showSourceResourcesBalloon']({source:_0x53aaee,withBackButton:_0x2dba3a}){let _0xfad9c=this['_sourceResourceBalloons']['get'](_0x53aaee['id']);_0xfad9c||(_0xfad9c=this['_createSourceResourceBalloonPanel'](),this['_sourceResourceBalloons']['set'](_0x53aaee['id'],_0xfad9c),this['_setupSingleResourceBalloonClickOutsideHandler'](_0xfad9c)),this['_addSourceResourceContent']({'balloonPanel':_0xfad9c,'source':_0x53aaee,'withBackButton':_0x2dba3a}),_0xfad9c['show']();const _0x50483c=this['_config']['getTargetElement']();_0x50483c&&_0xfad9c['pin']({'target':_0x50483c,'limiter':this['_config']['getLimiterElement']()});}['populateSourceResourceBalloon'](_0x3bf2ea,_0x20dd78,_0x262efb){const _0x43b745=this['_sourceResourceBalloons']['get'](_0x3bf2ea);if(!_0x43b745)return;const _0x41197e=this['_getResourcesViewFromBalloon'](_0x43b745);_0x41197e&&(_0x41197e['setResources'](_0x20dd78,_0x262efb),_0x41197e['once']('change:isLoading',()=>{_0x43b745['pin']({'target':this['_config']['getTargetElement'](),'limiter':this['_config']['getLimiterElement']()});}));}['closeSourceResourceBalloon'](_0x31bcc7){const _0x12db3b=this['_sourceResourceBalloons']['get'](_0x31bcc7);_0x12db3b&&requestAnimationFrame(()=>{_0x12db3b['hide'](),this['_sourceResourceBalloons']['delete'](_0x31bcc7),this['_config']['onBalloonClosed']();});}['isAnyResourceBalloonVisible'](){for(const _0x39b865 of this['_sourceResourceBalloons']['values']())if(_0x39b865['isVisible'])return!0x0;return!0x1;}['updateResourceState'](_0x37ad92,_0x1853be,_0x493c1b){const _0x287a70=this['_sourceResourceBalloons']['get'](_0x37ad92);if(!_0x287a70||!_0x287a70['isVisible'])return;const _0x59b8ed=this['_config']['getTargetElement']();if(!_0x59b8ed)return;_0x287a70['pin']({'target':_0x59b8ed,'limiter':this['_config']['getLimiterElement']()});const _0x20c05b=this['_getResourcesViewFromBalloon'](_0x287a70);_0x20c05b&&_0x20c05b['updateResourceState'](_0x1853be,_0x493c1b);}['destroy'](){for(const _0x14f21e of this['_sourceResourceBalloons']['values']())_0x14f21e['destroy']();this['_sourceResourceBalloons']['clear']();}['_createSourceResourceBalloonPanel'](){const _0x5b8eb4=new Qt(this['_locale']);return _0x5b8eb4['extendTemplate']({'attributes':{'class':vr}}),this['_bodyCollection']['add'](_0x5b8eb4),_0x5b8eb4;}['_addSourceResourceContent']({balloonPanel:_0x3f202a,source:_0x235c27,withBackButton:_0x58a7ad}){_0x3f202a['content']['clear']();const _0x5dcb2c=this['_createBalloonHeader']({'balloonPanel':_0x3f202a,'source':_0x235c27,'withBackButton':_0x58a7ad});_0x3f202a['content']['add'](_0x5dcb2c);const _0x26a108=this['_createBalloonResourcesView'](_0x235c27);_0x3f202a['content']['add'](_0x26a108);}['_createBalloonHeader']({balloonPanel:_0x30deba,source:_0x40234d,withBackButton:_0x9f879c}){const _0xab9692=new _0x27cd18(this['_locale'],{'label':_0x40234d['label'],'class':xr});return _0x9f879c&&_0xab9692['children']['add'](this['_createBackButton'](_0x30deba),0x0),_0xab9692;}['_createBackButton'](_0x37dfd7){const _0x19a582=new kt(this['_locale']);return _0x19a582['set']({'icon':_0x1b2d41,'tooltip':cs(this['_locale'],'AI_CHAT_CONTEXT_URL_BACK_TO_CONTEXT'),'tooltipPosition':'n','class':yr}),_0x19a582['on']('execute',()=>{_0x37dfd7['hide'](),this['_config']['onBackToContext']();}),_0x19a582;}['_createBalloonResourcesView'](_0x5e4a8c){const _0x497c37=new Nr(this['_locale'],{'source':_0x5e4a8c,'searchInputVisibleFrom':this['_config']['searchInputVisibleFrom']});return _0x497c37['on']('loadSourceResources',(_0x418ba5,_0x10eafd)=>{this['_config']['onLoadSourceResources'](_0x10eafd);}),_0x497c37['on']('addResourceToContext',(_0x5ede5a,_0x347314)=>{this['_config']['onResourceSelected'](_0x347314['source'],_0x347314['resource']),this['closeSourceResourceBalloon'](_0x5e4a8c['id']);}),_0x497c37;}['_getResourcesViewFromBalloon'](_0x26c1ae){const _0x3cec47=_0x26c1ae['content']['get'](0x1);return _0x3cec47 instanceof Nr?_0x3cec47:null;}['_setupSingleResourceBalloonClickOutsideHandler'](_0x330976){Xt({'emitter':_0x330976,'contextElements':[_0x330976['element']],'callback':()=>{_0x330976['hide'](),this['_config']['onBalloonClosed']();},'activator':()=>_0x330976['isVisible']});}}const Dr=['addDocumentToContext','addFileToContext','addUrlToContext','addResourceToContext','removeContextItem','loadSourceResources','executeCustomItemCallback'],Pr='ck-ai-chat-context-controls',Hr='ck-ai-chat-context-controls__pending-contexts',Mr='ck-ai-chat-context-controls__add-context-balloon-panel',Ur='ck-ai-chat-context-controls__add-context-button',Vr='ck-ai-chat-context-controls__url-balloon-panel',Br='ck-ai-chat-context-controls__balloon-button',Gr='ck-ai-chat-context-controls__balloon-button-source',Fr='ck-ai-chat-controls-button',Kr='ck-ai-chat-context-chips-wrapper-balloon',Wr='ck-ai-chat-controls_context_show-more-button',Yr='ck-ai-chat-context-controls__show-more-balloon-panel',$r='ck-ai-chat',qr=[Qt['defaultPositions']['northArrowSouthWest'],Qt['defaultPositions']['northArrowSouth'],Qt['defaultPositions']['northArrowSouthEast'],Qt['defaultPositions']['southArrowNorthWest'],Qt['defaultPositions']['southArrowNorth'],Qt['defaultPositions']['southArrowNorthEast']];class Qr extends Nt{['addContextButtonView'];['_currentContextsChips']=this['createCollection']();['_conversationContextsChips']=this['createCollection']();['_overflowManager'];['_addContextBalloonPanelView'];['_urlBalloonPanelView'];['_urlInputView'];['_resourcesBalloonView'];['_addContextBalloonConfig'];['_hasExactlyOneSource']=!0x1;['bodyCollection'];constructor(_0x289ba4,_0x174231){super(_0x289ba4),this['bodyCollection']=_0x174231['bodyCollection'],this['_currentContextsChips']=this['createCollection'](),this['_conversationContextsChips']=this['createCollection'](),this['addContextButtonView']=this['_createAddContextButtonView'](_0x289ba4),this['_addContextBalloonPanelView']=this['_createAddContextBalloonPanelView'](_0x289ba4),this['_urlBalloonPanelView']=this['_createUrlBalloonPanelView'](_0x289ba4),this['_resourcesBalloonView']=this['_createResourcesBalloonView'](_0x289ba4,_0x174231);const _0x8c3f58={'cssClasses':{'showMoreButton':Wr+'\x20'+ds,'showMoreBalloon':Yr,'overflowContainer':Kr,'controlsButton':Fr}};this['_overflowManager']=new Vn(_0x289ba4,this['_currentContextsChips'],_0x8c3f58,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'](_0x3647d9,_0x960724){const _0x1b3279=this['_createContextButton'](_0x3647d9,'current',!0x0,_0x960724);this['_addContextToCollection'](_0x1b3279,this['_currentContextsChips']),this['_overflowManager']['reorganizeChips']();}['removeContextItem'](_0x26397f){this['_removeContextFromCollection'](_0x26397f,this['_currentContextsChips']),this['_removeContextFromCollection'](_0x26397f,this['_overflowManager']['overflowChips']),this['_overflowManager']['reorganizeChips']();}['setContextItemLoading'](_0x4af231,_0x4c3331){let _0x583e16=this['_currentContextsChips']['find'](_0x3b67f1=>_0x3b67f1['id']===_0x4af231);_0x583e16||(_0x583e16=this['_overflowManager']['overflowChips']['find'](_0x3b7712=>_0x3b7712['id']===_0x4af231)),_0x583e16&&(_0x583e16['isLoading']=_0x4c3331);}['setConversationContext'](_0x5c036f){this['_conversationContextsChips']['clear']();for(const _0xff071d of _0x5c036f){const _0x205c49=this['_createContextButton'](_0xff071d,'conversation',!0x1,!0x1);this['_addContextToCollection'](_0x205c49,this['_conversationContextsChips']);}}['clearCurrentContextItems'](){this['_currentContextsChips']['clear'](),this['_overflowManager']['clear']();}['clearConversationContextItems'](){this['_conversationContextsChips']['clear']();}['updateResourceState'](_0x15abee,_0x87c9e6,_0x6d309b){this['_resourcesBalloonView']['updateResourceState'](_0x15abee,_0x87c9e6,_0x6d309b);}['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:_0x104cc1,withBackButton:_0x4ca1f7}){this['_resourcesBalloonView']['showSourceResourcesBalloon']({'source':_0x104cc1,'withBackButton':_0x4ca1f7}),this['addContextButtonView']['isOn']=!0x0;}['populateSourceResourceBalloon'](_0x2ed14c,_0x306e8b,_0x1add28,_0x274d8e){this['_resourcesBalloonView']['populateSourceResourceBalloon'](_0x2ed14c,_0x1add28,_0x274d8e);}['closeSourceResourceBalloon'](_0x58100e){this['_resourcesBalloonView']['closeSourceResourceBalloon'](_0x58100e),this['addContextButtonView']['isOn']=!0x1;}['setAddContextOptions'](_0x32028a){this['_setBalloonPanelContent'](this['_addContextBalloonPanelView'],this['locale'],_0x32028a),this['_setAddContextButtonEnabled'](_0x32028a);}['_setAddContextButtonEnabled'](_0x3e7619){const _0x2fa6c4=!_0x3e7619['document']['isHidden']&&_0x3e7619['document']['enabled'],_0x42ee5a=_0x3e7619['urls']['enabled'],_0x158228=_0x3e7619['files']['enabled'],_0x522498=_0x3e7619['sources']['length']>0x0,_0x3b64dd=_0x3e7619['customItems']&&_0x3e7619['customItems']['length']>0x0;this['addContextButtonView']['isEnabled']=_0x2fa6c4||_0x42ee5a||_0x158228||_0x522498||_0x3b64dd;}['_setupTemplate'](){this['setTemplate']({'tag':'div','attributes':{'class':[Pr,'ck-reset_all-excluded']},'children':[{'tag':'div','attributes':{'class':Hr},'children':this['_currentContextsChips']}]});}['_bindEventHandlers'](){this['addContextButtonView']['on']('execute',()=>{this['_handleAddContextButtonClick']();});}['_createAddContextButtonView'](_0x24432e){const _0x52cc58=new kt(_0x24432e);return _0x52cc58['set']({'label':cs(_0x24432e,'AI_CHAT_CONTEXT_ADD_CONTEXT'),'class':Fr+'\x20'+Ur+'\x20'+ds,'icon':_0x444508,'isToggleable':!0x0,'tooltip':!0x0,'tooltipPosition':'sw'}),_0x52cc58;}['_createAddContextBalloonPanelView'](_0x4532be){return this['_createBaseBalloonPanel'](_0x4532be,Mr);}['_createUrlBalloonPanelView'](_0x183b96){const _0x176732=this['_createBaseBalloonPanel'](_0x183b96,Vr);return this['_addUrlContent'](_0x176732,_0x183b96),_0x176732;}['_createResourcesBalloonView'](_0x316aa8,_0x23e790){const _0x2eae26={'searchInputVisibleFrom':_0x23e790['searchInputVisibleFrom'],'onBackToContext':()=>{this['showAddContextBalloonPanel'](),this['_addContextBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':qr});},'onResourceSelected':(_0x1b0407,_0x56a109)=>{this['fire']('addResourceToContext',{'source':_0x1b0407,'resource':_0x56a109});},'onLoadSourceResources':_0x391bc1=>{this['fire']('loadSourceResources',_0x391bc1);},'onBalloonClosed':()=>{this['addContextButtonView']['isOn']=!0x1;},'getLimiterElement':()=>this['_getLimiterElement'](),'getTargetElement':()=>this['addContextButtonView']['element']};return new Lr(_0x316aa8,_0x23e790['bodyCollection'],_0x2eae26);}['_getLimiterElement'](){return this['element']?.['closest']('.'+$r)||document['body'];}['_createBaseBalloonPanel'](_0x30415b,_0x38b0ce){const _0x4e4829=new Qt(_0x30415b);return _0x4e4829['extendTemplate']({'attributes':{'class':_0x38b0ce}}),this['bodyCollection']['add'](_0x4e4829),_0x4e4829;}['_setBalloonPanelContent'](_0x2f6f04,_0x4e8c3e,_0x15c00a){if(_0x2f6f04['content']['clear'](),!_0x15c00a['document']['isHidden']&&_0x15c00a['document']['enabled']){const _0x5f14fd=this['_createBalloonButton'](_0x4e8c3e,{'label':cs(_0x4e8c3e,'AI_CHAT_CONTEXT_CURRENT_DOCUMENT'),'icon':_0x26cdeb});_0x5f14fd['on']('execute',()=>{this['fire']('addDocumentToContext'),this['hideAddContextBalloonPanel']();}),_0x2f6f04['content']['add'](_0x5f14fd);}if(_0x15c00a['urls']['enabled']){const _0x3efa8b=this['_createBalloonButton'](_0x4e8c3e,{'label':cs(_0x4e8c3e,'AI_CHAT_CONTEXT_URL_LABEL'),'icon':_0x2f0db7});_0x3efa8b['on']('execute',()=>{this['hideAddContextBalloonPanel'](),this['showUrlBalloonPanel'](),this['_urlBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':qr}),this['_urlInputView']['focus']();}),_0x2f6f04['content']['add'](_0x3efa8b);}if(_0x15c00a['files']['enabled']){const _0x1480b4=new _0x107960(_0x4e8c3e);_0x1480b4['set']({'label':cs(_0x4e8c3e,'AI_CHAT_CONTEXT_FILE_LABEL'),'icon':_0x33ff2b,'withText':!0x0,'tooltip':!0x0,'class':Br,'allowMultipleFiles':!0x0}),_0x1480b4['on']('execute',()=>{this['hideAddContextBalloonPanel']();}),_0x1480b4['on']('done',(_0x177d1d,_0x3a915c)=>{this['fire']('addFileToContext',_0x3a915c);}),_0x1480b4['tooltip']=!0x0,_0x2f6f04['content']['add'](_0x1480b4);}for(const _0x1a510c of _0x15c00a['sources']){const _0x447cb6=this['_createBalloonButton'](_0x4e8c3e,{'label':_0x1a510c['label'],'icon':_0x1a510c['icon']||_0x3e2b4f,'type':'source'});_0x2f6f04['content']['add'](_0x447cb6),_0x447cb6['on']('execute',()=>{this['hideAddContextBalloonPanel'](),this['_showSourceResourcesBalloon']({'source':_0x1a510c,'withBackButton':!this['_hasExactlyOneSource']});});}for(const _0x71dab6 of _0x15c00a['customItems']||[]){const _0x1ce7a3=this['_createBalloonButton'](_0x4e8c3e,{'label':_0x71dab6['label'],'icon':_0x71dab6['icon']||_0x3e2b4f,'type':'customItem'});_0x2f6f04['content']['add'](_0x1ce7a3),_0x1ce7a3['on']('execute',()=>{this['hideAddContextBalloonPanel'](),this['fire']('executeCustomItemCallback',_0x71dab6);});}this['_hasExactlyOneSource']=0x1===_0x2f6f04['content']['length'],this['_urlInputView']['withBackButton']=!this['_hasExactlyOneSource'];}['_addUrlContent'](_0x13f504,_0x8dc513){this['_urlInputView']=new mr(_0x8dc513),this['_urlInputView']['on']('submitUrl',(_0x2df367,_0x52e93b)=>{this['_handleUrlSubmit'](_0x52e93b);}),this['_urlInputView']['on']('cancel',()=>{this['hideUrlBalloonPanel'](),this['_hasExactlyOneSource']||(this['showAddContextBalloonPanel'](),this['_addContextBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':qr}));}),this['_urlInputView']['on']('refreshBalloon',()=>{this['_urlBalloonPanelView']['isVisible']&&this['_urlBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':qr});}),_0x13f504['content']['add'](this['_urlInputView']);}['_createBalloonButton'](_0x5c290d,_0x3cafc0){const _0x5aef81='source'===_0x3cafc0['type']?new Xr(_0x5c290d):new kt(_0x5c290d);return _0x5aef81['set']({'label':_0x3cafc0['label'],'icon':_0x3cafc0['icon'],'withText':!0x0,'tooltip':!0x0,'tooltipPosition':'sw','class':Br}),_0x5aef81;}['_setupAllBalloonClickOutsideHandlers'](){this['_setupAddContextBalloonClickOutsideHandler'](),this['_setupUrlBalloonClickOutsideHandler']();}['_setupUrlBalloonClickOutsideHandler'](){Xt({'emitter':this['_urlBalloonPanelView'],'contextElements':[this['_urlBalloonPanelView']['element']],'callback':()=>{this['hideUrlBalloonPanel']();},'activator':()=>this['_urlBalloonPanelView']['isVisible']});}['_toggleAddContextBalloon'](_0x5ab51f){const _0x5b964a=this['_addContextBalloonConfig'];_0x5b964a['buttonView']['isOn']=_0x5ab51f,_0x5ab51f?_0x5b964a['balloonView']['show']():_0x5b964a['balloonView']['hide']();}['_setupAddContextBalloonClickOutsideHandler'](){const {balloonView:_0x541ba6,buttonView:_0x2c5d17,hideMethod:_0x1f5ba8}=this['_addContextBalloonConfig'];Xt({'emitter':_0x541ba6,'contextElements':[_0x541ba6['element'],_0x2c5d17['element']],'callback':()=>{_0x1f5ba8();},'activator':()=>_0x2c5d17['isOn']&&!this['_urlBalloonPanelView']['isVisible']&&!this['_resourcesBalloonView']['isAnyResourceBalloonVisible']()});}['_createContextButton'](_0x1ad6cd,_0x5c285c,_0x1ec980=!0x1,_0x4fd751=!0x1){const _0x4c9119='conversation'===_0x5c285c||!0x0===_0x1ad6cd['isReadOnly'],_0x28c975=new Pn(this['locale'],_0x1ad6cd,_0x4c9119,_0x1ec980,_0x4fd751);return _0x4c9119||_0x28c975['on']('removeContextItemChip',()=>{this['fire']('removeContextItem',_0x28c975['id']);}),_0x28c975;}['_addContextToCollection'](_0x31b9c3,_0x302cc6){_0x302cc6['add'](_0x31b9c3,0x0);}['_removeContextFromCollection'](_0x1b2d4d,_0x5825cb){const _0x8894ac=_0x5825cb['find'](_0x2734f2=>_0x2734f2['id']===_0x1b2d4d);_0x8894ac&&_0x5825cb['remove'](_0x8894ac);}['_handleAddContextButtonClick'](){this['addContextButtonView']['isOn']?this['hideAddContextBalloonPanel']():(this['showAddContextBalloonPanel'](),this['_addContextBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':qr}),this['_hasExactlyOneSource']&&this['_addContextBalloonPanelView']['content']['get'](0x0)?.['fire']('execute'));}['_handleUrlSubmit'](_0x4bd4c1){this['_urlInputView']['clear'](),this['hideUrlBalloonPanel'](),this['fire']('addUrlToContext',_0x4bd4c1);}}class Xr extends kt{['arrowView'];constructor(_0x2e17ae){super(_0x2e17ae),this['set']({'withText':!0x0,'role':'menuitem'}),this['arrowView']=this['_createArrowView'](),this['extendTemplate']({'attributes':{'class':[Gr]}});}['render'](){super['render'](),this['children']['add'](this['arrowView']);}['_createArrowView'](){const _0x3b5387=new yt();return _0x3b5387['content']=_0x3a3268,_0x3b5387['extendTemplate']({'attributes':{'class':Gr+'__arrow'}}),_0x3b5387;}}class zr extends Nt{['_cancelButtonView'];['_loaderView'];constructor(_0x38325d){super(_0x38325d),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 _0x1b7c72=new kt(this['locale']);return _0x1b7c72['set']({'label':cs(this['locale'],'AI_CHAT_STOP_GENERATING'),'withText':!0x0,'class':us+'\x20ck-ai-button-stop-generating','icon':_0x1455a5}),_0x1b7c72['on']('execute',()=>{this['fire']('abortPromptStream');}),_0x1b7c72;}['_createLoaderView'](){const _0x52ab35=new Nt(this['locale']);return _0x52ab35['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':cs(this['locale'],'AI_CHAT_IS_WRITING')}]}),_0x52ab35;}}class jr extends Nt{['_contextPanelView'];['_promptInputView'];['_promptCapabilitiesView'];['_loaderView'];['_modelUnavailableMessageView'];['_shouldRestorePromptInputFocus'];constructor(_0xf9c860,_0x1cba0a){super(_0xf9c860),this['_contextPanelView']=this['_createContextPanelView'](_0xf9c860,{'bodyCollection':_0x1cba0a['bodyCollection'],'searchInputVisibleFrom':_0x1cba0a['contextResourcesSearchInputVisibleFrom']}),this['_promptInputView']=this['_createPromptInputView'](_0xf9c860),this['_promptCapabilitiesView']=this['_createPromptCapabilitiesView'](_0xf9c860),this['_loaderView']=this['_createLoaderView'](_0xf9c860),this['_modelUnavailableMessageView']=this['_createModelUnavailableMessageView'](_0xf9c860),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'](...Dr)['to'](this),this['set']('isModelAvailable',!0x0),this['set']('isDisabled',!0x1);const _0x58fbf7=this['bindTemplate'];this['setTemplate']({'tag':'form','attributes':{'class':['ck','ck-ai-chat-controls',_0x58fbf7['if']('isDisabled','ck-ai-chat-controls-disabled')]},'children':[{'tag':'div','attributes':{'class':[_0x58fbf7['if']('isLoading','ck-hidden',_0x33b97=>_0x33b97||!this['isModelAvailable']),_0x58fbf7['if']('isModelAvailable','ck-hidden',_0x35ec26=>!_0x35ec26||this['isLoading'])]},'children':[this['_contextPanelView'],this['_promptInputView'],this['_promptCapabilitiesView']]},{'tag':'div','attributes':{'class':[_0x58fbf7['if']('isLoading','ck-hidden',_0x4abc3b=>!_0x4abc3b)]},'children':[this['_loaderView']]},{'tag':'div','attributes':{'class':[_0x58fbf7['if']('isModelAvailable','ck-hidden',_0x186c86=>_0x186c86)]},'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'](_0x33a8ad,_0x5f91a7){return new Qr(_0x33a8ad,_0x5f91a7);}['_createPromptInputView'](_0x371e5f){return new ar(_0x371e5f,this['_contextPanelView']['addContextButtonView']);}['_createPromptCapabilitiesView'](_0x36e945){return new gr(_0x36e945);}['_createLoaderView'](_0x514a02){return new zr(_0x514a02);}['_createModelUnavailableMessageView'](_0x29ba06){const _0x42ae09=new Jr(_0x29ba06);return _0x42ae09['delegate']('startConversation')['to'](this),_0x42ae09;}['_handlePromptInputFocus'](_0x5bc04c,_0x1437dc,_0x529902){_0x529902?this['_shouldRestorePromptInputFocus']=!0x0:this['_shouldRestorePromptInputFocus']&&this['_promptInputView']['focus']();}['addContextItem'](_0x4956af,_0x23b4ef){this['_contextPanelView']['addContextItem'](_0x4956af,_0x23b4ef);}['removeContextItem'](_0x3bbd0d){this['_contextPanelView']['removeContextItem'](_0x3bbd0d);}['setContextItemLoading'](_0x5ca290,_0x3a8dcc){this['_contextPanelView']['setContextItemLoading'](_0x5ca290,_0x3a8dcc);}['setIsUploadInProgress'](_0x110313){this['_promptInputView']['setIsUploadInProgress'](_0x110313);}['setConversationContext'](_0x3963f9){this['_contextPanelView']['setConversationContext'](_0x3963f9);}['clearPendingContextUI'](){this['_contextPanelView']['clearCurrentContextItems']();}['clearConversationContextUI'](){this['_contextPanelView']['clearConversationContextItems']();}['updateResourceState'](_0x5d8683,_0x3b2790,_0x1d311a){this['_contextPanelView']['updateResourceState'](_0x5d8683,_0x3b2790,_0x1d311a);}['setWebSearch'](_0x4db9c7){this['_promptCapabilitiesView']['setWebSearch'](_0x4db9c7);}['setReasoning'](_0x136ce5){this['_promptCapabilitiesView']['setReasoning'](_0x136ce5);}['resetMessageInput'](){this['_promptInputView']['reset']();}['setAddContextOptions'](_0x19cf0f){this['_contextPanelView']['setAddContextOptions'](_0x19cf0f);}['setInputPlaceholder'](_0x18ff88){this['_promptInputView']['setPlaceholderText'](_0x18ff88);}['setModelList'](_0x2bdf4e,_0xe2be99){this['_promptCapabilitiesView']['setModelList'](_0x2bdf4e,_0xe2be99);}['setModel'](_0x27646f){_0x27646f?(this['isModelAvailable']=!0x0,this['_promptCapabilitiesView']['setModel'](_0x27646f)):this['isModelAvailable']=!0x1;}['enableModelSelector'](){this['_promptCapabilitiesView']['enableModelSelector']();}['disableModelSelector'](_0x45f6be){this['_promptCapabilitiesView']['disableModelSelector'](_0x45f6be);}['populateSourceResourceBalloon'](_0x58dabe,_0x249dad,_0xa81193,_0x502bbb){this['_contextPanelView']['populateSourceResourceBalloon'](_0x58dabe,_0x249dad,_0xa81193,_0x502bbb);}['closeSourceResourceBalloon'](_0x278639){this['_contextPanelView']['closeSourceResourceBalloon'](_0x278639);}['focusPromptInput'](_0x139faf=!0x1){this['_promptInputView']['focus'](_0x139faf);}['setPromptInputValue'](_0x2a34af){this['_promptInputView']['queryView']['fieldView']['reset'](),this['_promptInputView']['queryView']['fieldView']['value']=_0x2a34af;}}class Jr extends Nt{constructor(_0xb3a065){super(_0xb3a065);const _0x663cbb=new kt(_0xb3a065);_0x663cbb['set']({'label':cs(this['locale'],'AI_CHAT_MODEL_UNAVAILABLE_MESSAGE_BUTTON'),'withText':!0x0,'class':['ck-ai-chat-controls__start-new-chat-button'],'tooltip':''}),_0x663cbb['delegate']('execute')['to'](this,'startConversation'),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat-controls-model-unavailable-message']},'children':[{'tag':'p','children':[{'text':cs(this['locale'],'AI_CHAT_MODEL_UNAVAILABLE_MESSAGE_TEXT')+'\x20'},_0x663cbb]}]});}}class Zr extends _0x27cd18{['conversationStartButton'];['resizeButton'];constructor(_0x3b3426,_0x1b966c){super(_0x3b3426,{'label':cs(_0x3b3426,'AI_CHAT_HEADING'),'class':'ck-ai-header\x20ck-ai-header_chat','icon':_0x7de98b}),this['set']('isMaximized',!0x1),this['conversationStartButton']=this['_createStartConversationButton'](_0x3b3426),this['children']['add'](this['conversationStartButton']),_0x1b966c&&(this['resizeButton']=_s(_0x3b3426,this),this['children']['add'](this['resizeButton']));}['_createStartConversationButton'](_0x1afa0a){const _0xa5450d=new kt(_0x1afa0a);return _0xa5450d['set']({'label':cs(this['locale'],'AI_CHAT_LABEL_NEW_CHAT'),'withText':!0x0,'icon':_0x49763d,'class':'ck-ai-chat__start-conversation\x20'+us}),_0xa5450d['on']('execute',()=>{this['fire']('startConversation');}),_0xa5450d;}}class ta extends Nt{constructor(_0x4a7651){super(_0x4a7651),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-disclaimer']},'children':[{'tag':'p','attributes':{'class':['ck','ck-ai-disclaimer__content']},'children':[{'text':cs(_0x4a7651,'AI_DISCLAIMER_TEXT')}]}]});}}class ea extends Nt{['chatHeader'];['chatFeed'];['chatControls'];['chatDisclaimer'];['_bodyCollection'];constructor(_0x396fae,_0x5e351d){super(_0x396fae),this['_bodyCollection']=new qt(_0x396fae),this['_bodyCollection']['attachToDom'](),this['chatHeader']=new Zr(_0x396fae,_0x5e351d['showResizeButton']),this['chatHeader']['delegate'](...Js)['to'](this),this['chatFeed']=new sr(_0x396fae,this['_bodyCollection']),this['chatFeed']['delegate'](...Js)['to'](this),this['chatControls']=new jr(_0x396fae,{'bodyCollection':this['_bodyCollection'],'contextResourcesSearchInputVisibleFrom':_0x5e351d['contextResourcesSearchInputVisibleFrom']}),this['chatControls']['delegate'](...Js)['to'](this),this['chatDisclaimer']=new ta(_0x396fae),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-ai-chat','ck-rounded-corners'],'dir':_0x396fae['uiLanguageDirection']},'children':[this['chatHeader'],this['chatFeed'],this['chatControls'],this['chatDisclaimer']]});}['populateSourceResourceBalloon'](_0x4447f8,_0x5d562a,_0x568517,_0x5c231b){this['chatControls']['populateSourceResourceBalloon'](_0x4447f8,_0x5d562a,_0x568517,_0x5c231b);}['closeSourceResourceBalloon'](_0x3588c5){this['chatControls']['closeSourceResourceBalloon'](_0x3588c5);}['destroy'](){this['_bodyCollection']['detachFromDom'](),super['destroy']();}}class ia extends _0x5d2433{static get['requires'](){return[os];}['_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(_0x3a445c){super(_0x3a445c);const _0x4510cc=this['context']['plugins']['get']('AITabs');this['set']('isBusy',!0x1),this['_promiseQueue']=new In(),this['_view']=new ea(this['context']['locale'],{'showResizeButton':_0x4510cc['showResizeButton'],'contextResourcesSearchInputVisibleFrom':this['context']['config']['get']('ai.chat.context.searchInputVisibleFrom')}),this['_view']['delegate'](...Js)['to'](this),this['_view']['on']('toggleSuggestionDisplayMode',(_0x1d5af3,{showDiff:_0x3c9b70})=>{this['showDiff']=_0x3c9b70;}),_0x4510cc['view']['addTab']({'id':'chat','buttonLabel':cs(this['context']['locale'],'AI_CHAT_HEADING'),'buttonIcon':_0x7de98b,'order':0x0,'content':this['_view']}),this['_view']['chatControls']['bind']('isLoading')['to'](this,'isBusy',_0x2c8935=>_0x2c8935),this['_view']['chatFeed']['bind']('isPending')['to'](this,'isBusy',_0x45d53e=>_0x45d53e),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder']()),this['bind']('isModelAvailable')['to'](this['_view']['chatControls'],'isModelAvailable');}['destroy'](){super['destroy'](),this['_titleAnimationInterval']&&clearInterval(this['_titleAnimationInterval']);}['createConversation'](_0x59fae7){const _0x5e27da=this['context']['config']['get']('ai.chat.welcomeMessage')??cs(this['context']['locale'],'AI_CHAT_WELCOME_MESSAGE');this['_view']['chatFeed']['clear'](),this['_view']['chatControls']['enableModelSelector'](),this['_view']['chatControls']['setModelList'](_0x59fae7['availableModels'],!this['context']['config']['get']('ai.models.showModelSelector')),this['addFeedItemStaticMessage']({'id':'conversation-start','staticMessage':_0x5e27da}),this['fire']('conversationCreated');}async['addFeedItemStaticMessage']({id:_0x129569,staticMessage:_0x30178d}){return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('ai-reply',{'id':_0x129569,'initialContent':'<p>'+_0x30178d+'</p>'});});}async['addFeedItemUserMessage'](_0x241e18){const _0x425339=_0x241e18['attributes']?.['displayedPrompt']||_0x241e18['userMessage'];return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('user-message',{'contextItems':Array['from'](_0x241e18['contextItems']['values']()),'initialContent':'<p>'+_0x425339+'</p>','id':_0x241e18['id']});});}async['addFeedItemError']({errorMessage:_0x384b6f,id:_0x56ead4}){return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('error-message',{'initialContent':'<p>'+_0x384b6f+'</p>','id':_0x56ead4});});}async['addFeedItemAIReply'](_0x501f59){return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('ai-reply',{'id':_0x501f59['interactionId']+':'+_0x501f59['id']}),this['clearLoadingMessage']();});}async['addFeedItemAISuggestion'](_0x49587f){const _0x3aa0fc=Ys(this['context']);let _0x17cb00=_0x3aa0fc['config']['get']('ai.availableReplyActions')||[...pn];if(_0x3aa0fc['plugins']['has']('TrackChanges')){if(!this['_isTrackChangesCommandValueBound']){this['_isTrackChangesCommandValueBound']=!0x0;const _0x1c4fc1=_0x3aa0fc['commands']['get']('trackChanges');this['_view']['chatFeed']['bind']('isTrackChangesOn')['to'](_0x1c4fc1,'value');}}else _0x17cb00=_0x17cb00['filter'](_0x3870a8=>'insertSuggestion'!=_0x3870a8);return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('ai-suggestion-reply',{'id':_0x49587f['interactionId']+':'+_0x49587f['id'],'areActionsDisabled':_0x49587f['areActionsDisabled'],'showDiff':this['showDiff'],'availableActions':_0x17cb00}),this['clearLoadingMessage']();});}async['addFeedInteractionHeader'](_0x5ba1e6,_0x2f4d62){return this['_promiseQueue']['enqueue'](async()=>{const _0x46e76c=this['_view']['chatFeed']['children']['last'];if(_0x46e76c instanceof Qn)return this['_view']['chatFeed']['children']['remove'](_0x46e76c),void this['_view']['chatFeed']['addItem']('interaction-header',{'id':_0x5ba1e6['id'],'capabilities':{'isWebSearchEnabled':_0x46e76c['capabilities']['isWebSearchEnabled']||_0x2f4d62['isWebSearchEnabled'],'isReasoningEnabled':_0x46e76c['capabilities']['isReasoningEnabled']||_0x2f4d62['isReasoningEnabled']}});this['_view']['chatFeed']['addItem']('interaction-header',{'id':_0x5ba1e6['id'],'capabilities':_0x2f4d62});});}async['addFeedItemCustomElement'](_0x4335fd,_0x1d4e6c){let _0x512e40;return await this['_promiseQueue']['enqueue'](async()=>{_0x512e40=this['_view']['chatFeed']['addItem']('custom-element',{'content':_0x4335fd,'id':_0x1d4e6c});}),_0x512e40;}['removeFeedItem'](_0x2e1460){this['_view']['chatFeed']['removeItem'](_0x2e1460);}['hasFeedItem'](_0x4ff6c4){return this['_view']['chatFeed']['hasItem'](_0x4ff6c4);}['updateFeedInteractionHeader'](_0x82107a){const _0x351517=this['_view']['chatFeed']['children']['find'](_0x2b0eb6=>_0x2b0eb6['options']['id']==_0x82107a['id']&&_0x2b0eb6 instanceof Qn);_0x351517&&_0x351517['set']('isVisible',_0x82107a['isVisible']);}async['updateFeedItemAIReplyContent'](_0x1d36de){const _0x37756c=_0x1d36de['renderingStrategy']||this['feedItemRenderingStrategy'];return this['_promiseQueue']['enqueue'](async _0x49878f=>{await this['_view']['chatFeed']['updateReplyItem']({..._0x1d36de,'abortSignal':_0x49878f,'renderingStrategy':_0x37756c}),_0x1d36de['isDone']&&this['markFeedItemAsDone'](_0x1d36de['id']);});}['updateFeedItemAIReplySources'](_0x3cf48d,_0x2a5cce){this['_view']['chatFeed']['updateWebSources'](_0x3cf48d,_0x2a5cce);}async['updateFeedItemAIReplySuggestionContent'](_0x41bf77){const _0x3efa70=_0x41bf77['renderingStrategy']||this['feedItemRenderingStrategy'];return this['_promiseQueue']['enqueue'](async _0x224240=>{await this['_view']['chatFeed']['updateSuggestionItem']({..._0x41bf77,'abortSignal':_0x224240,'renderingStrategy':_0x3efa70}),_0x41bf77['isDone']&&this['markFeedItemAsDone'](_0x41bf77['id']);});}['updateFeedItemAIReplySuggestionPartState'](_0x4972cd){this['_view']['chatFeed']['updateSuggestionPartState'](_0x4972cd);}['setFeedItemAIReplySuggestionPartActive'](_0x3ff1f7){this['_view']['chatFeed']['setSuggestionPartActive'](_0x3ff1f7);}['markFeedItemAsDone'](_0x5a80ea){this['_view']['chatFeed']['markItemAsDone'](_0x5a80ea);}['removeFeedInteraction'](_0x2065ac){this['_view']['chatFeed']['getItemIds']()['filter'](_0x150772=>_0x150772['startsWith'](_0x2065ac))['forEach'](_0x5b545a=>this['_view']['chatFeed']['removeItem'](_0x5b545a));}['startInteraction'](){const _0x271ed1=this['prepareLoadingMessage']({'isWebSearchEnabled':!0x1,'isReasoningEnabled':!0x1});this['setLoadingMessage'](_0x271ed1),this['_view']['chatControls']['disableModelSelector'](!this['context']['config']['get']('ai.models.showModelSelector')),this['isBusy']=!0x0,this['_view']['chatFeed']['startAutoScroll']();}['stopInteraction'](_0x112b2a){this['_promiseQueue']['abort'](),this['_view']['chatFeed']['getItemIds']()['filter'](_0x17a0ce=>_0x17a0ce['startsWith'](_0x112b2a['id']))['forEach'](_0x37a00b=>this['markFeedItemAsDone'](_0x37a00b)),this['isBusy']=!0x1,this['_view']['chatFeed']['stopAutoScroll']();}async['finishInteraction'](){return this['_promiseQueue']['queueEmptyPromise']['then'](()=>{this['isBusy']=!0x1,this['_view']['chatFeed']['stopAutoScroll']();});}['addContextItem'](_0x5d5a48,_0x5af61e){this['_view']['chatControls']['addContextItem'](_0x5d5a48,_0x5af61e);}['removeContextItem'](_0x1581f6){this['_view']['chatControls']['removeContextItem'](_0x1581f6);}['setContextItemLoading'](_0x277c64,_0x483a66){this['_view']['chatControls']['setContextItemLoading'](_0x277c64,_0x483a66);}['setIsUploadInProgress'](_0x4ef0a9){this['_view']['chatControls']['setIsUploadInProgress'](_0x4ef0a9);}['setConversationContext'](_0x37a740){this['_view']['chatControls']['setConversationContext'](_0x37a740);}['clearPendingContextUI'](){this['_view']['chatControls']['clearPendingContextUI']();}['clearConversationContextUI'](){this['_view']['chatControls']['clearConversationContextUI']();}['updateResourceState'](_0x8a67e9,_0x2a4e7c,_0x120c67){this['_view']['chatControls']['updateResourceState'](_0x8a67e9,_0x2a4e7c,_0x120c67);}['resetMessageInput'](){this['_view']['chatControls']['resetMessageInput'](),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder']());}['setAddContextOptions'](_0x3ab152){this['_view']['chatControls']['setAddContextOptions'](_0x3ab152);}['updateCapabilities'](_0x26e852){this['_view']['chatControls']['setWebSearch'](_0x26e852['isWebSearchEnabled']),this['_view']['chatControls']['setReasoning'](_0x26e852['isReasoningEnabled']),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder'](_0x26e852));}['setSelectedModel'](_0x38405c,_0x2def1d){this['_view']['chatControls']['setModel'](_0x38405c),_0x2def1d&&this['_view']['chatControls']['disableModelSelector'](!0x1);}['setFeedItemRenderingStrategy'](_0xd22e0e){this['feedItemRenderingStrategy']=_0xd22e0e;}['toggleLoadingSkeleton'](_0x519891){this['_view']['chatFeed']['toggleLoadingSkeleton'](_0x519891);}['resetConversationTitle'](){this['setConversationTitle'](cs(this['context']['locale'],'AI_CHAT_HEADING'));}['setConversationTitle'](_0x252300,_0x5e106c=!0x1){if(_0x5e106c&&!St()&&_0x252300['length'])return this['_view']['chatHeader']['label']='',void this['_animateConversationTitle'](_0x252300);this['_view']['chatHeader']['label']=_0x252300;}['setLoadingMessage'](_0x1ad5b7){this['_view']['chatFeed']['setLoadingMessage'](_0x1ad5b7);}['clearLoadingMessage'](){this['_view']['chatFeed']['setLoadingMessage']('');}['_animateConversationTitle'](_0x6fe80){let _0x4ced3f=0x0;clearInterval(this['_titleAnimationInterval']),this['_titleAnimationInterval']=setInterval(()=>{this['_view']['chatHeader']['label']=this['_view']['chatHeader']['label']+_0x6fe80[_0x4ced3f],_0x4ced3f++,_0x4ced3f===_0x6fe80['length']&&clearInterval(this['_titleAnimationInterval']);},0x1e);}['setIsMaximized'](_0x42978f){this['_view']['chatHeader']['isMaximized']=_0x42978f;}['prepareLoadingMessage'](_0x31b72f){return _0x31b72f['isWebSearchEnabled']&&_0x31b72f['isReasoningEnabled']?cs(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH_REASONING'):_0x31b72f['isWebSearchEnabled']?cs(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH'):_0x31b72f['isReasoningEnabled']?cs(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_REASONING'):cs(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_REGULAR');}['_getInputPlaceholder'](_0x24c151){return _0x24c151?_0x24c151['isWebSearchEnabled']&&_0x24c151['isReasoningEnabled']?cs(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH_REASONING'):_0x24c151['isWebSearchEnabled']?cs(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH'):_0x24c151['isReasoningEnabled']?cs(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REASONING'):cs(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REGULAR'):cs(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REGULAR');}['populateSourceResourceBalloon'](_0x37eef9,_0x338bc2,_0x3b25c8,_0x2404b5){this['_view']['populateSourceResourceBalloon'](_0x37eef9,_0x338bc2,_0x3b25c8,_0x2404b5);}['closeSourceResourceBalloon'](_0x82f938){this['_view']['closeSourceResourceBalloon'](_0x82f938);}['setPromptInputValue'](_0x27966c){this['_view']['chatControls']['setPromptInputValue'](_0x27966c);}['focusPromptInput'](_0x43f4ab=!0x1){this['_view']['chatControls']['focusPromptInput'](_0x43f4ab);}['scrollFeedToSuggestion'](_0x328787,_0x35f42c){this['_view']['chatFeed']['scrollToSuggestion'](_0x328787,_0x35f42c);}['startAutoScroll'](){this['_view']['chatFeed']['startAutoScroll']();}['disableControls'](){this['_view']['chatControls']['isDisabled']=!0x0;}['enableControls'](){this['_view']['chatControls']['isDisabled']=!0x1;}}class sa extends Lt{['sections'];constructor(_0x7f133,_0x5a3af0){super(_0x7f133),this['sections']=_0x5a3af0,this['items']['addMany'](this['sections']),this['extendTemplate']({'attributes':{'class':['ck-ai-chat-history__sections']}});}['filter'](_0x4c2116){let _0x209afc=0x0,_0x431c08=0x0;for(const _0x2b8fc7 of this['sections']){const {resultsCount:_0x59e03d,totalItemsCount:_0x47f36a}=_0x2b8fc7['filter'](_0x4c2116);_0x209afc+=_0x59e03d,_0x431c08+=_0x47f36a;}return{'resultsCount':_0x209afc,'totalItemsCount':_0x431c08};}}class na extends Pt{['title'];['itemsViews'];['_itemsListView'];constructor(_0x3ee0f8,{title:_0x209d52,items:_0x11f2a7}){super(_0x3ee0f8);const _0x50158f=this['bindTemplate'];this['set']('isVisible',!0x0),this['title']=_0x209d52,this['itemsViews']=_0x11f2a7;const _0x1561dd=new Nt(_0x3ee0f8);_0x1561dd['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-history__section-title']},'children':[this['title']]}),this['_itemsListView']=new Lt(_0x3ee0f8),this['_itemsListView']['items']['addMany'](this['itemsViews']),this['setTemplate']({'tag':'li','attributes':{'class':['ck-ai-chat-history__section',_0x50158f['if']('isVisible','ck-hidden',_0x35e83a=>!_0x35e83a)]},'children':[_0x1561dd,this['_itemsListView']]});}['filter'](_0x3db1a8){const _0x15f72c=this['itemsViews']['length'];let _0x5ccc99=0x0;for(const _0x30a7e3 of this['itemsViews']){if(_0x3db1a8){const _0x4bdb83=_0x30a7e3['isMatching'](_0x3db1a8);_0x30a7e3['isVisible']=!!_0x4bdb83,_0x30a7e3['highlightText'](_0x3db1a8);}else _0x30a7e3['isVisible']=!0x0,_0x30a7e3['highlightText'](null);_0x30a7e3['isVisible']&&_0x5ccc99++;}return this['isVisible']=_0x5ccc99>0x0,{'resultsCount':_0x5ccc99,'totalItemsCount':_0x15f72c};}['getItem'](_0x51ef9e){return this['itemsViews']['find'](_0xa46e88=>_0xa46e88['id']===_0x51ef9e);}['removeItem'](_0x4d6cd9){const _0xe71a76=this['itemsViews']['indexOf'](_0x4d6cd9);-0x1!==_0xe71a76&&(this['itemsViews']['splice'](_0xe71a76,0x1),this['_itemsListView']['items']['remove'](_0x4d6cd9));}}class ra extends/* #__PURE__ -- @preserve */
27
- _0x38a348(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(_0x4d5b48,_0x4084d9){super(_0x4d5b48);const _0x33c387=this['bindTemplate'];this['set']('isEdit',!0x1),this['set']('isVisible',!0x0),this['set']('pinned',!!_0x4084d9['pinned']),this['set']('loadingState',null),this['id']=_0x4084d9['id'];const {title:_0x279652,createdAt:_0x52f592,active:_0x44a598=!0x1}=_0x4084d9;this['_titleView']=new _0x472014(),this['_titleView']['text']=_0x279652,this['_titleView']['extendTemplate']({'attributes':{'class':['ck-ai-chat-history__item-title']}});const _0x1edfb7=this['_createCheckView'](),_0x483536=this['_createPinButtonView'](_0x4d5b48),_0x16c03e=this['_createMenuDropdownView'](),_0x47f9b3=this['_createEditInputView'](_0x4d5b48,_0x279652),_0x19ce6e=this['_createAcceptEditButtonView'](_0x4d5b48,_0x47f9b3),_0x1477ea=this['_createCancelEditButtonView'](_0x4d5b48,_0x47f9b3);this['actions']=this['createCollection'](),this['mainContent']=this['createCollection'](),this['mainContent']['add'](this['_titleView']),this['actions']['add'](_0x483536),this['actions']['add'](_0x16c03e),this['on']('change:isEdit',(_0x3e1b94,_0x2123a9,_0x4855a2)=>{this['actions']['clear'](),this['mainContent']['clear'](),_0x4855a2?(this['actions']['add'](_0x19ce6e),this['actions']['add'](_0x1477ea),this['mainContent']['add'](_0x47f9b3),_0x47f9b3['element']['focus']()):(this['actions']['add'](_0x483536),this['actions']['add'](_0x16c03e),this['mainContent']['add'](this['_titleView']));}),this['setTemplate']({'tag':'li','attributes':{'class':['ck-ai-chat-history__item',_0x44a598?'ck-ai-chat-history__item--active':'',_0x33c387['if']('isVisible','ck-hidden',_0x220c85=>!_0x220c85),_0x33c387['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',_0x33c387['if']('loadingState','ck-hidden',_0x5b8761=>!!_0x5b8761)]},'children':_0x44a598?[_0x1edfb7]:[]},{'tag':'div','attributes':{'class':['ck-ai-loader',_0x33c387['if']('loadingState','ck-hidden',_0x2dc60b=>!_0x2dc60b)]},'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',_0x33c387['if']('loadingState','ck-hidden',_0x370c63=>!!_0x370c63)]},'children':this['mainContent']},{'tag':'div','attributes':{'class':['ck-ai-loader__text',_0x33c387['if']('loadingState','ck-hidden',_0x552e6f=>!_0x552e6f)]},'children':[{'text':_0x33c387['to']('loadingState',_0x4e74d2=>_0x4e74d2?cs(this['locale'],ra['LOADING_LABELS'][_0x4e74d2]):'')}]}]},{'tag':'span','attributes':{'class':['ck-ai-chat-history__item-date']},'children':[_0x52f592]}]},{'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'](_0x531165){this['_titleView']['text']=_0x40b9c9(_0x531165);}['updateLoadingState'](_0x1c1409,_0x3784e3){this['set']('loadingState',_0x3784e3?_0x1c1409:null);}['_createCheckView'](){const _0x147e25=new yt();return _0x147e25['set']({'content':_0x790d5c}),_0x147e25;}['_createPinButtonView'](_0x57ac66){const _0x1f9d94=new kt(_0x57ac66);return _0x1f9d94['set']({'label':cs(_0x57ac66,'AI_CHAT_HISTORY_PIN_BUTTON'),'icon':_0x4fc5d8,'withText':!0x1,'tooltip':!0x0}),_0x1f9d94['bind']('isOn')['to'](this,'pinned'),_0x1f9d94['on']('execute',()=>{const _0x14a57b=!this['pinned'];this['fire']('setConversationPinned',{'id':this['id'],'pinned':_0x14a57b});}),_0x1f9d94;}['_createMenuDropdownView'](){const _0x36058e=Bt(this['locale']),_0x1da11d=_0x36058e['panelView']['children'];_0x36058e['buttonView']['set']({'label':cs(this['locale'],'AI_CHAT_HISTORY_SHOW_MORE_ITEMS'),'icon':_0x3d6dbb}),_0x36058e['panelPosition']='sw';const _0x1e5505=new kt(this['locale']);_0x1e5505['label']=cs(this['locale'],'AI_CHAT_HISTORY_EDIT_NAME'),_0x1e5505['withText']=!0x0,_0x1e5505['on']('execute',()=>{this['isEdit']=!0x0;});const _0x3911d1=new kt(this['locale']);_0x3911d1['label']=cs(this['locale'],'AI_CHAT_HISTORY_REMOVE'),_0x3911d1['withText']=!0x0,_0x3911d1['on']('execute',()=>{this['showConfirm'](cs(this['locale'],'AI_CHAT_HISTORY_REMOVE_CONFIRM'),this['element'])['then'](()=>{this['fire']('removeConversation',{'id':this['id']});});});const _0x50c3f3=new Lt(this['locale']),_0x3b8aa6=new Pt(this['locale']);_0x3b8aa6['children']['add'](_0x1e5505);const _0x3c778d=new Pt(this['locale']);return _0x3c778d['children']['add'](_0x3911d1),_0x50c3f3['items']['addMany']([_0x3b8aa6,_0x3c778d]),_0x1da11d['add'](_0x50c3f3),_0x36058e;}['_createEditInputView'](_0xfcb62b,_0x5bc033){const _0x373d4d=new _0x5bcb59(_0xfcb62b),_0x3a2cc3=_0x373d4d['bindTemplate'];return _0x373d4d['value']=_0x5bc033,_0x373d4d['extendTemplate']({'on':{'keydown':_0x3a2cc3['to'](_0x379aa3=>{'Enter'==_0x379aa3['key']&&this['_commitEditInputValue'](_0x373d4d);})}}),_0x373d4d;}['_createAcceptEditButtonView'](_0x31276d,_0x4450cb){const _0x4b5d00=new kt(_0x31276d);return _0x4b5d00['set']({'icon':_0x790d5c,'withText':!0x1,'tooltip':cs(_0x31276d,'AI_CHAT_HISTORY_ACCEPT')}),_0x4b5d00['extendTemplate']({'attributes':{'class':['ck-confirm-view-submit']}}),_0x4b5d00['on']('execute',()=>{this['_commitEditInputValue'](_0x4450cb);}),_0x4b5d00;}['_commitEditInputValue'](_0x3928ef){const _0x5ac118=_0x3928ef['element']['value']||'';this['_titleView']['text']=_0x5ac118,this['isEdit']=!0x1,this['fire']('editConversationTitle',{'id':this['id'],'title':_0x5ac118});}['_createCancelEditButtonView'](_0x7d93d5,_0x1e00c8){const _0x46ac9c=new kt(_0x7d93d5);return _0x46ac9c['set']({'icon':_0xbe3949,'withText':!0x1,'tooltip':cs(_0x7d93d5,'AI_CHAT_HISTORY_CANCEL')}),_0x46ac9c['extendTemplate']({'attributes':{'class':['ck-confirm-view-cancel']}}),_0x46ac9c['on']('execute',()=>{this['isEdit']=!0x1,_0x1e00c8['value']=this['_titleView']['text']||'',this['fire']('edit:cancel');}),_0x46ac9c;}['_createSpinnerView'](){const _0xe14c83=new Rn('tiny');return _0xe14c83['isVisible']=!0x0,_0xe14c83;}['isMatching'](_0x5de28a){return this['_titleView']&&'string'==typeof this['_titleView']['text']&&this['_titleView']['text']['match'](_0x5de28a)?{'title':!0x0}:null;}['highlightText'](_0x830c05){this['_titleView']['highlightText'](_0x830c05);}}class aa extends Nt{['searchView'];['mainErrorView'];['skeletonView'];['emptyView'];['sectionsView'];['resizeButton'];constructor(_0x8603bc,_0x5c6938){super(_0x8603bc),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 _0x359566=new _0x27cd18(_0x8603bc,{'label':cs(_0x8603bc,'AI_CHAT_HISTORY_HEADING'),'icon':_0x52ae8e,'class':'ck-ai-header\x20ck-ai-header_history'});_0x5c6938&&(this['resizeButton']=_s(_0x8603bc,this),_0x359566['children']['add'](this['resizeButton'])),this['sectionsView']=new sa(_0x8603bc,[]),this['sectionsView']['delegate'](...oa)['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',_0x52f323=>!_0x52f323)]}}),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':[_0x359566,{'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 _0x22579a=new _0x1a8288(this['locale'],{'filteredView':this['sectionsView'],'queryView':{'label':cs(this['locale'],'AI_CHAT_HISTORY_SEARCH_LABEL')},'infoView':{'text':{'notFound':{'primary':_0xb9c475=>cs(this['locale'],'AI_CHAT_HISTORY_SEARCH_NOT_FOUND_PRIMARY',_0xb9c475),'secondary':cs(this['locale'],'AI_CHAT_HISTORY_SEARCH_NOT_FOUND_SECONDARY')}}}}),_0x1c8915=this['_createErrorView']();return _0x1c8915['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('errorMessage','ck-hidden',_0x28b892=>!_0x28b892)]}}),_0x22579a['on']('render',()=>{_0x22579a['children']['add'](_0x1c8915,0x1);}),_0x22579a['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isSearchViewVisible','ck-hidden',_0x4daad1=>!_0x4daad1)]}}),_0x22579a;}['_createSkeletonView'](){const _0x2fcb08=new Zn(this['locale'],tr['aiHistory']);return _0x2fcb08['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isLoading','ck-hidden',_0x28f2ad=>!_0x28f2ad)]}}),_0x2fcb08;}['_createErrorView'](){const _0x3e65af=new Nt(this['locale']),_0x51d0b5=new kt(this['locale']);_0x51d0b5['set']({'withText':!0x1,'icon':_0xbe3949,'class':'ck-ai-notification_error__dismiss-button'}),_0x51d0b5['bind']('isVisible')['to'](this,'hasItems',_0x3c3481=>!!_0x3c3481),_0x51d0b5['on']('execute',()=>{this['errorMessage']='';});const _0x31b993=this['bindTemplate'];return _0x3e65af['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-notification','ck-ai-notification_error']},'children':[{'tag':'p','children':[{'text':_0x31b993['to']('errorMessage')}]},_0x51d0b5]}),_0x3e65af;}['_createEmptyStateView'](){const _0x162974=new kt(this['locale']);_0x162974['set']({'label':cs(this['locale'],'AI_CHAT_LABEL_NEW_CHAT'),'withText':!0x0,'icon':_0x49763d,'class':'ck-ai-chat__start-conversation\x20'+us}),_0x162974['on']('execute',()=>{this['fire']('openChat');});const _0x2ac1d2=new Nt(this['locale']);return _0x2ac1d2['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-history__empty',this['bindTemplate']['if']('isEmptyViewVisible','ck-hidden',_0x3beff3=>!_0x3beff3)]},'children':[{'tag':'p','attributes':{'class':['ck-ai-chat-history__empty-message']},'children':[cs(this['locale'],'AI_CHAT_HISTORY_EMPTY_MESSAGE')]},_0x162974]}),_0x2ac1d2;}['_createListItemViews'](_0x3775ad,_0x2fa50e){const _0x5e47eb=[];for(const _0x47ab32 of _0x3775ad){const _0x213782=new ra(_0x2fa50e,_0x47ab32);_0x213782['delegate'](...oa)['to'](this),_0x5e47eb['push'](_0x213782);}return _0x5e47eb;}['updateHistoryItemsWithCategories'](_0x5f05e4){const _0x329d9c=this['locale']||'en',_0x2cfb27=[];for(const _0x2950e2 of _0x5f05e4){const _0xa28b2=this['_createListItemViews'](_0x2950e2['items'],_0x329d9c);_0x2cfb27['push'](new na(_0x329d9c,{'title':_0x2950e2['title'],'items':_0xa28b2}));}this['sectionsView']['sections']=_0x2cfb27,this['sectionsView']['items']['clear'](),this['sectionsView']['items']['addMany'](_0x2cfb27),this['hasItems']=_0x5f05e4['some'](_0x397338=>_0x397338['items']['length']>0x0),this['_refreshSearch']();}['removeHistoryItem'](_0x3e7418){for(const _0x1e877f of this['sectionsView']['sections']){const _0x5659ff=_0x1e877f['getItem'](_0x3e7418);if(_0x5659ff){if(_0x1e877f['removeItem'](_0x5659ff),0x0===_0x1e877f['itemsViews']['length']){const _0x45278d=this['sectionsView']['sections']['indexOf'](_0x1e877f);-0x1!==_0x45278d&&(this['sectionsView']['sections']['splice'](_0x45278d,0x1),this['sectionsView']['items']['remove'](_0x1e877f));}this['hasItems']=this['sectionsView']['sections']['length']>0x0,this['_refreshSearch']();break;}}}['updateItemTitle'](_0x806526,_0x3caee4){for(const _0x2cb86d of this['sectionsView']['sections']){const _0x41b877=_0x2cb86d['getItem'](_0x806526);if(_0x41b877){_0x41b877['updateTitle'](_0x3caee4);break;}}}['updateItemLoadingState'](_0x384084,_0x157bee,_0x45111b){for(const _0x4548e6 of this['sectionsView']['sections']){const _0x95cf09=_0x4548e6['getItem'](_0x384084);if(_0x95cf09){_0x95cf09['updateLoadingState'](_0x157bee,_0x45111b);break;}}}['_refreshSearch'](){if(this['hasItems']){const _0x30a80d=this['searchView']['queryView']['fieldView']?.['element']?.['value']||'';this['searchView']['search'](_0x30a80d);}}}const oa=['showConversationHistory','removeConversation','editConversationTitle','setConversationPinned','selectConversation','openChat','resizeTabs'];class ha extends _0x5d2433{static get['requires'](){return[os];}['_historyView'];static get['pluginName'](){return'AIChatHistoryUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x43e10d){super(_0x43e10d);const _0x29b55b=this['context']['plugins']['get']('AITabs');this['_historyView']=new aa(this['context']['locale'],_0x29b55b['showResizeButton']),this['_historyView']['delegate'](...oa)['to'](this),_0x29b55b['view']['addTab']({'id':'history','buttonLabel':cs(this['context']['locale'],'AI_CHAT_HISTORY_HEADING'),'buttonIcon':_0x52ae8e,'order':0x0,'content':this['_historyView']});}['removeHistoryItem'](_0x1c98fd){this['_historyView']['removeHistoryItem'](_0x1c98fd);}['updateItems'](_0x42fe6a){this['_historyView']['updateHistoryItemsWithCategories'](_0x42fe6a);}['updateItemTitle'](_0x48d116,_0x5c32ef){this['_historyView']['updateItemTitle'](_0x48d116,_0x5c32ef);}['updateItemLoadingState'](_0x5148d0,_0x1fdd50,_0x42c4c3){this['_historyView']['updateItemLoadingState'](_0x5148d0,_0x1fdd50,_0x42c4c3);}['setLoadingSkeleton'](_0x38d65f){this['_historyView']['isLoading']=_0x38d65f;}['showError'](_0x20dadf){this['_historyView']['errorMessage']=_0x20dadf;}['hideError'](){this['_historyView']['errorMessage']='';}['setIsMaximized'](_0x5d0142){this['_historyView']['isMaximized']=_0x5d0142;}}class ca extends ht(){['id'];['createdAt'];constructor({id:_0x1da6f7,title:_0x45b3ad,createdAt:_0x2a2a54,updatedAt:_0x4b510e,pinned:_0x99a79b}){super(),this['id']=_0x1da6f7,this['createdAt']=new Date(_0x2a2a54),this['set']('title',_0x45b3ad),this['set']('updatedAt',_0x4b510e?new Date(_0x4b510e):null),this['set']('pinned',_0x99a79b||!0x1);}['updateTitle'](_0xe4a397){this['set']('title',_0x40b9c9(_0xe4a397)),this['updatedAt']=new Date();}['updatePinned'](_0x20e41e){this['set']('pinned',_0x20e41e),this['updatedAt']=new Date();}}class la extends Et(){['items']=[];['connector'];['group'];constructor({connector:_0x1e4599,group:_0x3c7fc6}){super(),this['connector']=_0x1e4599,this['group']=_0x3c7fc6;}async['init'](){try{const _0x2b93e9=this['connector']['fetchConversations'](this['group']),_0x24cb84=await _0x2b93e9['getConversations']();this['loadItems'](_0x24cb84);}catch(_0x10dac7){this['fire']('error',{'error':_0x10dac7,'operation':'init'});}}['addItem'](_0x4554c4){this['items']['push'](_0x4554c4);}async['removeItem'](_0x5ed27c){const _0x3954af=this['items']['findIndex'](_0x3214de=>_0x3214de['id']===_0x5ed27c);if(-0x1===_0x3954af)return!0x1;try{return await this['connector']['deleteConversation'](_0x5ed27c)['execute'](),this['items']['splice'](_0x3954af,0x1),this['fire']('itemRemoved',{'itemId':_0x5ed27c}),!0x0;}catch(_0x1bd5bd){return this['fire']('error',{'error':_0x1bd5bd,'operation':'removeItem','itemId':_0x5ed27c}),!0x1;}}['getItem'](_0x35776d){return this['items']['find'](_0x139572=>_0x139572['id']===_0x35776d);}async['updateItemTitle'](_0x37b09e,_0x543d48){const _0x199d5a=this['getItem'](_0x37b09e);if(!_0x199d5a)return!0x1;try{return await this['connector']['updateConversation'](_0x37b09e,{'title':_0x543d48})['getResult'](),_0x199d5a['updateTitle'](_0x543d48),this['fire']('itemUpdated',{'itemId':_0x37b09e,'updates':{'title':_0x543d48}}),!0x0;}catch(_0x1113ca){return this['fire']('error',{'error':_0x1113ca,'operation':'updateItemTitle','itemId':_0x37b09e}),!0x1;}}async['updateItemPinned'](_0x1904d3,_0x4babd1){const _0x20cc23=this['getItem'](_0x1904d3);if(!_0x20cc23)return!0x1;try{return await this['connector']['updateConversation'](_0x1904d3,{'pinned':_0x4babd1})['getResult'](),_0x20cc23['updatePinned'](_0x4babd1),this['fire']('itemUpdated',{'itemId':_0x1904d3,'updates':{'pinned':_0x4babd1}}),!0x0;}catch(_0x26573c){return this['fire']('error',{'error':_0x26573c,'operation':'updateItemPinned','itemId':_0x1904d3}),!0x1;}}['loadItems'](_0x40c552){try{this['items']=[],_0x40c552['map'](_0x518ece=>{this['addItem'](new ca(_0x518ece));}),this['fire']('itemsLoaded',{'items':[...this['items']]});}catch(_0x56e33c){this['fire']('error',{'error':_0x56e33c,'operation':'loadItems'});}}['getItems'](_0x2fa241={}){const _0x14a1f1=void 0x0!==_0x2fa241['pinned']&&_0x2fa241['pinned'],_0x4b1f2b=_0x2fa241['from']?new Date(_0x2fa241['from']['getFullYear'](),_0x2fa241['from']['getMonth'](),_0x2fa241['from']['getDate']()):null,_0x48208b=_0x2fa241['to']?new Date(_0x2fa241['to']['getFullYear'](),_0x2fa241['to']['getMonth'](),_0x2fa241['to']['getDate']()):null;return this['items']['filter'](_0x475395=>{if(_0x475395['pinned']!==_0x14a1f1)return!0x1;if(_0x48208b){const _0x2210ea=new Date(_0x475395['createdAt']['getFullYear'](),_0x475395['createdAt']['getMonth'](),_0x475395['createdAt']['getDate']());return _0x4b1f2b?_0x4b1f2b['getTime']()===_0x48208b['getTime']()?_0x2210ea['getTime']()===_0x4b1f2b['getTime']():_0x2210ea<_0x48208b&&_0x2210ea>=_0x4b1f2b:_0x2210ea<_0x48208b;}return!0x0;});}}class ua extends _0x5d2433{['_aiConnector'];['_aiChatHistoryUi'];['_aiChatController'];static get['requires'](){return[hs,Qs,ha,os];}static get['pluginName'](){return'AIChatHistoryController';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){this['_aiConnector']=this['context']['plugins']['get'](hs),this['_aiChatHistoryUi']=this['context']['plugins']['get'](ha),this['_aiChatController']=this['context']['plugins']['get'](Qs);const _0x1f4b2c=this['context']['plugins']['get'](os);try{const _0x2c0a38=this['_aiChatController']['getGroupId']();this['history']=new la({'connector':this['_aiConnector'],'group':_0x2c0a38}),this['listenTo'](this['_aiChatHistoryUi'],'removeConversation',(_0x4eb222,_0x398b0e)=>{this['_setItemLoading'](_0x398b0e['id'],'remove'),this['_handleRemove'](_0x398b0e['id']);}),this['listenTo'](this['_aiChatHistoryUi'],'editConversationTitle',(_0xd29916,_0x1384e8)=>{this['_setItemLoading'](_0x1384e8['id'],'rename'),this['_handleEditTitle'](_0x1384e8['id'],_0x1384e8['title']);}),this['listenTo'](this['history'],'itemUpdated',(_0x2c1f48,_0x53c466)=>{void 0x0!==_0x53c466['updates']['title']&&this['_aiChatHistoryUi']['updateItemTitle'](_0x53c466['itemId'],_0x53c466['updates']['title']),void 0x0!==_0x53c466['updates']['pinned']&&this['_updateHistoryItemsUI'](),this['_clearItemLoading'](_0x53c466['itemId']);}),this['listenTo'](this['history'],'itemRemoved',(_0x1f5c79,_0x188ef5)=>{this['_aiChatController']['_handleRemovedConversation'](_0x188ef5['itemId']),this['_aiChatHistoryUi']['removeHistoryItem'](_0x188ef5['itemId']),this['_clearItemLoading'](_0x188ef5['itemId']);}),this['listenTo'](this['history'],'itemsLoaded',()=>{this['_updateHistoryItemsUI']();}),this['listenTo'](this['history'],'error',(_0x49e735,_0x5e1f29)=>{this['_handleHistoryErrorUI'](_0x5e1f29['error'],_0x5e1f29['operation'],_0x5e1f29['itemId']);}),this['listenTo'](this['_aiChatHistoryUi'],'selectConversation',(_0x464142,_0x553f93)=>{this['_handleSelectConversation'](_0x553f93['id']);}),this['listenTo'](this['_aiChatHistoryUi'],'setConversationPinned',(_0x28fdc7,_0x44bec6)=>{const _0x1d43e9=_0x44bec6['pinned']?'pin':'unpin';this['_setItemLoading'](_0x44bec6['id'],_0x1d43e9),this['_handleTogglePin'](_0x44bec6['id'],_0x44bec6['pinned']);}),this['listenTo'](this['_aiChatHistoryUi'],'openChat',()=>{_0x1f4b2c['view']['activateTab']('chat');}),this['listenTo'](this['_aiChatController'],'change:activeConversation',()=>{this['_updateHistoryItemsUI']();}),_0x1f4b2c['view']['on']('activateTab:history',()=>{this['_showConversationHistory']();}),this['listenTo'](_0x1f4b2c,'resizedTabs',(_0x3cdd8e,_0xcfadc6)=>{this['_setIsMaximized'](_0xcfadc6);}),this['listenTo'](this['_aiChatHistoryUi'],'resizeTabs',()=>{_0x1f4b2c['resize']();});}catch(_0x23d74a){this['_handleHistoryErrorUI'](_0x23d74a,'init');}}async['_handleEditTitle'](_0x16bef1,_0x4ac98f){await this['history']['updateItemTitle'](_0x16bef1,_0x4ac98f);}async['_handleTogglePin'](_0x321366,_0x3cb46f){await this['history']['updateItemPinned'](_0x321366,_0x3cb46f);}async['_handleRemove'](_0x47b53e){await this['history']['removeItem'](_0x47b53e);}async['_handleSelectConversation'](_0x18c6af){await this['_aiChatController']['loadConversation'](_0x18c6af);}async['_showConversationHistory'](){this['_aiChatHistoryUi']['showError'](''),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x0),await this['history']['init'](),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x1);}['_updateHistoryItemsUI'](){const _0x256a77=this['_aiChatController']['activeConversation']?.['id'],_0x50939f=this['_getCategorizedItems']()['map'](_0x3a479a=>({'title':_0x3a479a['title'],'items':_0x3a479a['items']['map'](_0x416d34=>({'id':_0x416d34['id'],'title':_0x416d34['title']||cs(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION'),'createdAt':new Date(_0x416d34['createdAt'])['toLocaleDateString'](),'active':_0x416d34['id']===_0x256a77,'pinned':_0x416d34['pinned']}))}));this['_aiChatHistoryUi']['updateItems'](_0x50939f);}['_setItemLoading'](_0x23fcfd,_0x53fdc8){this['_aiChatHistoryUi']['updateItemLoadingState'](_0x23fcfd,_0x53fdc8,!0x0);}['_clearItemLoading'](_0x46c085){this['_aiChatHistoryUi']['updateItemLoadingState'](_0x46c085,null,!0x1);}['_handleHistoryErrorUI'](_0x21106e,_0x5aae7b,_0xdd72cc){const _0x3796f3=this['_generateErrorMessage'](_0x5aae7b,_0xdd72cc);this['_aiChatHistoryUi']['showError'](_0x3796f3),_0xdd72cc&&this['_clearItemLoading'](_0xdd72cc),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x1);}['_generateErrorMessage'](_0x4efd6e,_0x1126a8){const _0x270991=_0x1126a8?this['history']['getItem'](_0x1126a8):null,_0x3eb3bf=_0x270991?.['title']||cs(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION');switch(_0x4efd6e){case'updateItemTitle':return cs(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_UPDATE_TITLE',_0x3eb3bf);case'updateItemPinned':{const _0x5b49ee=cs(this['context']['locale'],_0x270991?.['pinned']?'AI_CHAT_HISTORY_UNPIN_ACTION':'AI_CHAT_HISTORY_PIN_ACTION');return cs(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_UPDATE_PINNED',[_0x5b49ee,_0x3eb3bf]);}case'removeItem':return cs(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_REMOVE_ITEM',_0x3eb3bf);case'init':case'loadItems':return cs(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_LOAD_ITEMS');default:return cs(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_GENERIC');}}['_getCategorizedItems'](){const _0x14e987=new Date(),_0x36b71c=new Date(_0x14e987['getFullYear'](),_0x14e987['getMonth'](),_0x14e987['getDate']()),_0x2ca567=new Date(_0x36b71c);_0x2ca567['setDate'](_0x2ca567['getDate']()-0x1);const _0x340428=new Date(_0x36b71c);_0x340428['setDate'](_0x340428['getDate']()-0xe);const _0x2985fc=this['history']['getItems']({'pinned':!0x0}),_0x193211=this['history']['getItems']({'from':_0x36b71c,'to':_0x36b71c}),_0x27a2cc=this['history']['getItems']({'from':_0x2ca567,'to':_0x2ca567}),_0xc84760=this['history']['getItems']({'from':_0x340428,'to':_0x2ca567}),_0x3e13b3=this['history']['getItems']({'to':_0x340428}),_0x15d9f7=[];return _0x2985fc['length']>0x0&&_0x15d9f7['push']({'title':cs(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_PINNED'),'items':_0x2985fc}),_0x193211['length']>0x0&&_0x15d9f7['push']({'title':cs(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_TODAY'),'items':_0x193211}),_0x27a2cc['length']>0x0&&_0x15d9f7['push']({'title':cs(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_YESTERDAY'),'items':_0x27a2cc}),_0xc84760['length']>0x0&&_0x15d9f7['push']({'title':cs(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_LAST_14_DAYS'),'items':_0xc84760}),_0x3e13b3['length']>0x0&&_0x15d9f7['push']({'title':cs(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_LATER'),'items':_0x3e13b3}),_0x15d9f7;}['_setIsMaximized'](_0x4d9730){this['_aiChatHistoryUi']['setIsMaximized'](_0x4d9730);}}class da extends _0x5d2433{static get['requires'](){return[ua,ha];}static get['pluginName'](){return'AIChatHistory';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class _a extends _0x5d2433{static get['requires'](){return[Qs,zs,ia,da];}static get['pluginName'](){return'AIChat';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x4703dc){super(_0x4703dc),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 Aa extends kt{['id'];constructor(_0x2c05fe,_0x5171ab){super(_0x2c05fe);const {id:_0x55de72,type:_0x3bdbaa,icon:_0x163380}=_0x5171ab;this['id']=_0x55de72,this['set']({'label':_0x5171ab['label'],'withText':!0x0,'class':'ck-ai-chat-shortcut'}),this['extendTemplate']({'attributes':{'data-cke-ai-shortcut-id':_0x5171ab['id']}}),_0x163380?this['icon']=_0x163380:'chat'===_0x3bdbaa?this['icon']=_0x7de98b:'review'===_0x3bdbaa?this['icon']=_0x34b9c0:'translate'===_0x3bdbaa&&(this['icon']=_0x29e343);}}class ga extends Nt{['listView'];constructor(_0x569195,_0x4f180c){super(_0x569195);const _0xc2d50e=_0x4f180c['map'](_0x1683c6=>{const _0x4d2465=new Pt(this['locale']),_0x4f8d5b=new Aa(this['locale'],_0x1683c6);return _0x4d2465['children']['add'](_0x4f8d5b),_0x4f8d5b['delegate']('execute')['to'](this),_0x4d2465;});this['listView']=new Lt(this['locale']),this['listView']['items']['addMany'](_0xc2d50e),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat-shortcuts']},'children':[this['listView']]});}}const Ia='chat-shortcuts';class Ea extends _0x5d2433{['_shortcuts'];['_shortcutsView'];['_aiChatUI'];static get['requires'](){return[ia];}static get['pluginName'](){return'AIChatShortcuts';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){this['_aiChatUI']=this['context']['plugins']['get'](ia),this['_shortcuts']=this['context']['config']['get']('ai.chat.shortcuts')??[];const _0x12a14b=this['context']['plugins']['get']('AIChatController');this['_shortcuts']['length']&&(this['_validateShortcuts'](),this['_aiChatUI']['on']('conversationCreated',()=>{_0x12a14b['activeConversation']['isFromHistory']||this['_injectShortcuts']();}),this['listenTo'](_0x12a14b,'interactionStarted',()=>{this['_removeShortcuts']();}));}['_validateShortcuts'](){const _0x37d5fe=['chat','review','translate'];this['_shortcuts']['forEach'](_0x40dfc9=>{let _0x571a9c=!0x0;if(_0x40dfc9['id']&&_0x40dfc9['label']&&_0x37d5fe['includes'](_0x40dfc9['type'])?'chat'===_0x40dfc9['type']&&(_0x571a9c='string'==typeof _0x40dfc9['prompt']):_0x571a9c=!0x1,!_0x571a9c)throw new ot('ai-chat-shortcuts-invalid-config',this['context'],{'shortcut':_0x40dfc9});});}['_injectShortcuts'](){const _0x151372=this['context']['plugins']['get'](ia);this['_shortcutsView']=new ga(this['context']['locale'],this['_shortcuts']),this['_shortcutsView']['render'](),_0x151372['addFeedItemCustomElement'](this['_shortcutsView']['element'],Ia),this['_shortcutsView']['on']('execute',_0x16f4be=>{const _0x3bb951=_0x16f4be['source']['id'];this['_executeShortcut'](_0x3bb951);});}['_removeShortcuts'](){const _0x194701=this['context']['plugins']['get'](ia);_0x194701['hasFeedItem'](Ia)&&_0x194701['removeFeedItem'](Ia),this['_shortcutsView']?.['destroy']();}['_executeShortcut'](_0x4ce6b2){const _0x165a2b=this['_shortcuts']['find'](_0x3e0186=>_0x3e0186['id']===_0x4ce6b2),_0x470dbe=_0x165a2b['type'];'chat'===_0x470dbe?this['_runChatShortcut'](_0x165a2b):'review'===_0x470dbe?_0x165a2b['commandId']?this['_runReviewShortcut'](_0x165a2b):this['_switchTab']('reviewMode'):'translate'===_0x470dbe&&(_0x165a2b['language']?this['_runTranslateShortcut'](_0x165a2b):this['_switchTab']('translate'));}['_switchTab'](_0x3ba6f6){if(!this['context']['plugins']['has']('AITabs'))throw new ot('ai-chat-shortcuts-ai-tabs-not-found',this['context'],{'tabName':_0x3ba6f6});this['context']['plugins']['get']('AITabs')['view']['activateTab'](_0x3ba6f6);}async['_runChatShortcut']({prompt:_0x4d4e55,draftMode:_0x3f2ae6,useWebSearch:_0xcf373c=!0x1,useReasoning:_0x51d37d=!0x1,model:_0x308787}){const _0x2e230c=this['context']['plugins']['get']('AIChatController'),_0x500dec=_0x2e230c['activeConversation'];let _0x353475;_0x353475=_0x308787?await _0x500dec['chatModels']['getModel'](_0x308787):await _0x500dec['chatModels']['getDefault'](),_0x353475&&await _0x500dec['setModel'](_0x353475),_0x500dec['setWebSearch'](_0xcf373c),_0x500dec['setReasoning'](_0x51d37d),_0x2e230c['addCurrentDocumentToChatContext'](),_0x3f2ae6?(this['_aiChatUI']['setPromptInputValue'](_0x4d4e55),this['_aiChatUI']['focusPromptInput'](!0x0)):_0x2e230c['sendMessage']({'message':_0x4d4e55});}['_runReviewShortcut']({commandId:_0x2ee598,model:_0x52afd2,prompt:_0x29d4f3,params:_0x5b12f1}){if(!this['context']['plugins']['has']('AIReviewModeUI'))throw new ot('ai-chat-shortcuts-review-mode-not-found',this['context']);this['_switchTab']('reviewMode');const _0x57c80d={'id':_0x2ee598,'isCustom':'custom'===_0x2ee598};_0x52afd2&&_0x29d4f3&&(_0x57c80d['args']={'model':_0x52afd2,'prompt':_0x29d4f3}),_0x5b12f1&&(_0x57c80d['params']=_0x5b12f1),this['context']['plugins']['get']('AIReviewModeUI')['fire']('runReviewCheck',_0x57c80d);}['_runTranslateShortcut']({language:_0x250712}){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':_0x250712,'args':{'language':_0x250712}});}}class pa extends _0x13d0ac{constructor(_0x4f4364){super(_0x4f4364);const _0x25e923=_0x4f4364['plugins']['get']('AITabs')['view'];this['bind']('value')['to'](_0x25e923,'isVisible'),this['isEnabled']=!0x0;}['execute'](){const _0x275899=this['editor']['plugins']['get']('AITabs')['view'];_0x275899['isVisible']=!_0x275899['isVisible'];}}class Ta extends _0x432272{static get['requires'](){return[os];}static get['pluginName'](){return'AIToggleButtonUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x1ce4e1=this['editor'];_0x1ce4e1['commands']['add']('toggleAi',new pa(_0x1ce4e1)),_0x1ce4e1['ui']['componentFactory']['add']('toggleAi',()=>{const _0x22e3e5=this['_createAIUIButton'](kt);return _0x22e3e5['set']({'tooltip':!0x0,'class':'ck-ai-toggle-button'}),_0x22e3e5;}),_0x1ce4e1['ui']['componentFactory']['add']('menuBar:toggleAi',()=>{const _0x5d0f54=this['_createAIUIButton'](Kt);return _0x5d0f54['set']({'role':'menuitemcheckbox'}),_0x5d0f54;});}['_createAIUIButton'](_0x1f78f9){const _0x49c487=this['editor'],_0x39d4aa=_0x49c487['commands']['get']('toggleAi'),_0xa24270=new _0x1f78f9(_0x49c487['locale']);return _0xa24270['set']({'label':cs(_0x49c487['locale'],'AI_TOGGLE_BUTTON_LABEL'),'icon':_0x2adf0d,'isToggleable':!0x0}),_0xa24270['bind']('isEnabled')['to'](_0x39d4aa),_0xa24270['bind']('isOn')['to'](_0x39d4aa,'value',_0x4e925a=>!!_0x4e925a),this['listenTo'](_0xa24270,'execute',()=>{_0x39d4aa['execute']();}),_0xa24270;}}const ma=['applySuggestion','insertSuggestion','showNext','showPrevious'];class Ca extends Nt{['_errorView'];constructor(_0x5553d3){super(_0x5553d3),this['set']('_errorMessage',''),this['set']('_isErrorVisible',!0x1);}['showBlockingError'](_0x5cf2d0){this['showError'](_0x5cf2d0);}['showError'](_0x942dfc){this['_errorView']||(this['_errorView']=this['_createErrorView']()),this['_errorMessage']=_0x942dfc,this['_isErrorVisible']=!0x0;}['hideError'](){this['_isErrorVisible']=!0x1;}['_createErrorView'](){const _0x524443=new Nt(this['locale']),_0x452733=new Nt(this['locale']);return _0x452733['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-suggestion__error-text']},'children':[{'text':this['bindTemplate']['to']('_errorMessage')}]}),_0x524443['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__error','ck-ai-balloon-error',this['bindTemplate']['if']('_isErrorVisible','ck-hidden',_0x5d3455=>!_0x5d3455)]},'children':[_0x452733]}),_0x524443;}}const wa=0xa;class fa extends _0x5d2433{static get['requires'](){return[zs];}static get['pluginName'](){return'AIBalloon';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['isOpen']=!0x1;['_currentConfig'];['_isUpdatingMarkers']=!0x1;['open'](_0x2290f0){const {id:_0x5366f7}=this['_currentConfig']??{};this['_currentConfig']=_0x2290f0;const {id:_0x516488}=this['_currentConfig'];this['isOpen']&&_0x5366f7===_0x516488?this['_updateDialog']():this['_showDialog']();}['close'](){const _0x37dc15=Ys(this['context'])['plugins']['get']('Dialog');_0x37dc15['isOpen']&&this['_currentConfig']&&_0x37dc15['id']===this['_currentConfig']['id']&&_0x37dc15['hide']();}['_updateDialog'](){const _0x142a0f=Ys(this['context'])['plugins']['get']('Dialog'),{icon:_0x293ed1,title:_0x456503}=this['_currentConfig'];_0x142a0f['view']?.['headerView']&&(_0x142a0f['view']['headerView']['label']=_0x456503,_0x142a0f['view']['headerView']['iconView']&&_0x293ed1&&(_0x142a0f['view']['headerView']['iconView']['content']=_0x293ed1)),this['_isUpdatingMarkers']=!0x0,this['_showFakeVisualSelection'](),this['_isUpdatingMarkers']=!0x1,_0x142a0f['view']?.['updatePosition']();}['_showFakeVisualSelection'](){this['context']['plugins']['get'](zs)['showFakeVisualSelection']({'ranges':this['_currentConfig']['ranges'],'id':'balloon','priority':0x64}),window['getSelection']()?.['removeAllRanges']();}['_hideFakeVisualSelection'](){this['context']['plugins']['get'](zs)['hideFakeVisualSelection']('balloon');}['_showDialog'](){const _0x57ea77=Ys(this['context'])['plugins']['get']('Dialog'),{id:_0x5bf0a1,title:_0x27b3d7,icon:_0x365634,class:_0x39adf9,mainView:_0x474151}=this['_currentConfig'];_0x474151['delegate'](...ma)['to'](this),_0x57ea77['show']({'title':_0x27b3d7,'icon':_0x365634,'hasCloseButton':!0x0,'id':_0x5bf0a1,'position':this['_calculateDialogPosition']['bind'](this),'className':'ck-ai-balloon\x20'+(_0x39adf9||''),'content':_0x474151,'onShow':_0x3a3bd9=>{this['_showFakeVisualSelection'](),this['_setupFakeVisualSelectionMarkerRemovalListener']();const _0x1c31d2=this['_getSelectionElements']();_0x1c31d2&&_0x1c31d2[0x0]&&mt({'target':_0x1c31d2[0x0],'ancestorOffset':0x14,'alignToTop':!0x0,'viewportOffset':{'top':0x14,'bottom':0x14,'left':0x0,'right':0x0}}),this['isOpen']=!0x0,_0x3a3bd9['once']('hide',()=>{this['fire']('beforeDialogClosed',{'id':_0x5bf0a1});},{'priority':'high'});},'onHide':()=>{this['_hideFakeVisualSelection'](),this['_cleanupFakeVisualSelectionMarkerRemovalListener'](),this['fire']('dialogClosed',{'id':_0x5bf0a1}),this['isOpen']=!0x1;}});}['_calculateDialogPosition'](_0x5248da,_0x187506){if(!_0x187506)return null;const _0x17a4fc=this['_getSelectionElements']();if(!_0x17a4fc||0x0===_0x17a4fc['length'])return{'left':Math['round'](_0x187506['left']+_0x187506['width']/0x2-_0x5248da['width']/0x2),'top':Math['round'](_0x187506['top']+_0x187506['height']/0x2-_0x5248da['height']/0x2)};const _0x7268b7=Math['round'](_0x187506['left']+_0x187506['width']/0x2-_0x5248da['width']/0x2),_0x4fb2b0=_0x17a4fc['map'](_0xa35fcc=>new ut(_0xa35fcc)),_0x57a857=_0x5248da['height'];return{'left':_0x7268b7,'top':this['_calculateOptimalTopPosition'](_0x4fb2b0,_0x57a857,_0x187506)};}['_calculateOptimalTopPosition'](_0x1d9bcf,_0xa82960,_0x3fb460){const _0xcb963e=new ut(ct['window']),_0x381c5e=_0x1d9bcf['map'](_0x2aec9b=>_0x2aec9b['getVisible']())['filter'](_0x486922=>_0x486922),_0x40ef0c=ut['getBoundingRect'](_0x381c5e);if(!_0x40ef0c)return Math['round'](_0x3fb460['top']+_0x3fb460['height']/0x2);const _0x47ba7f=_0xcb963e['getIntersection'](_0x40ef0c);if(!_0x47ba7f)return Math['round'](_0x3fb460['top']+_0x3fb460['height']/0x2);const _0x4641de=_0x3fb460['getVisible'](),_0xce15a=_0x4641de&&_0x40ef0c['height']>_0x4641de['height'],_0x3b7aee=_0x47ba7f['top'],_0x195a7d=_0x47ba7f['bottom'];if(_0xce15a){const _0x5ade5e=(_0x4641de||_0xcb963e)['height']/0x2-_0xa82960/0x2,_0x117329=_0x3b7aee-wa-_0x3fb460['top'],_0x29fd78=_0x3fb460['bottom']-_0x195a7d-wa;return _0x117329>=_0xa82960?Math['max'](wa,_0x3b7aee-_0xa82960-wa):_0x29fd78>=_0xa82960?_0x195a7d+wa:Math['max'](wa,_0x5ade5e);}const _0x35a47e=_0x3b7aee-_0xa82960,_0x337010=_0x3fb460['bottom']-_0x195a7d-wa,_0x58f36a=_0x3b7aee-wa-_0x3fb460['top'];let _0x5ef865;if(_0x337010>=_0xa82960)_0x5ef865=_0x195a7d+wa;else{if(_0x58f36a>=_0xa82960)_0x5ef865=_0x35a47e-wa;else _0x5ef865=_0x3b7aee+_0x40ef0c['height']/0x2-_0xa82960/0x2;}return _0x5ef865;}['_setupFakeVisualSelectionMarkerRemovalListener'](){const _0x2e21c7=Ys(this['context']);this['listenTo'](_0x2e21c7['model']['document'],'change',()=>{if(!this['_isUpdatingMarkers']){for(const {name:_0x381ea0,data:{newRange:_0x52e228}}of _0x2e21c7['model']['document']['differ']['getChangedMarkers']())if(_0x381ea0['startsWith'](Xs+':')&&(_0x52e228&&(_0x52e228['start']['isEqual'](_0x52e228['end'])||'$graveyard'==_0x52e228['root']['rootName'])||null==_0x52e228)){const _0x399190=cs(this['context']['locale'],'AI_BALLOON_SELECTION_REMOVED_ERROR');this['_currentConfig']['mainView']['showBlockingError'](_0x399190),this['fire']('selectionRemoved');}}});}['_cleanupFakeVisualSelectionMarkerRemovalListener'](){const _0x3348a1=Ys(this['context']);this['_currentConfig']['mainView']['hideError'](),this['stopListening'](_0x3348a1['model']['document']);}['_getSelectionElements'](){const _0x90f30e=Ys(this['context']);return _0x5661ac(_0x90f30e['editing'],[..._0x90f30e['model']['markers']['getMarkersGroup']('ai-selection'),..._0x90f30e['model']['markers']['getMarkersGroup']('ai-balloon-selection')]);}}class Sa extends Ot{['copyButton'];['likeButton'];['dislikeButton'];['showChangesButton'];['_config'];constructor(_0xc37b32,_0x82abda={}){super(_0xc37b32),this['set']('isEnabled',!0x0),this['set']('isShowChangesOn',!0x1),this['_config']={'showCopy':!0x1,'showLike':!0x1,'showDislike':!0x1,..._0x82abda};const _0x300568=!(this['_config']['showCopy']||this['_config']['showChanges']||this['_config']['showLike']||this['_config']['showDislike']||this['_config']['customView']?.['length']);this['class']=_0x300568?'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'](_0x491284){this['showChangesButton']['isEnabled']=_0x491284;}['_setupRatingButtons'](){this['likeButton']=new kt(this['locale']),this['likeButton']['set']({'icon':_0x148817,'label':cs(this['locale'],'AI_MINI_TOOLBAR_LIKE'),'class':ds,'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':_0x4a7763,'label':cs(this['locale'],'AI_MINI_TOOLBAR_DISLIKE'),'class':ds,'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':_0x3a9886,'label':cs(this['locale'],'AI_MINI_TOOLBAR_COPY'),'class':'ck-ai-mini-toolbar-copy-button\x20'+ds,'tooltip':!0x0}),this['copyButton']['bind']('isEnabled')['to'](this);const _0x5c51ab=new yt();_0x5c51ab['set']({'content':_0x790d5c}),_0x5c51ab['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'+ds,setTimeout(()=>{this['copyButton']['class']='ck-ai-mini-toolbar-copy-button\x20'+ds;},0x7d0);}),this['copyButton']['children']['add'](_0x5c51ab);}['_setupShowChangesButton'](){this['showChangesButton']=new kt(this['locale']),this['showChangesButton']['set']({'icon':_0x5089e3,'label':cs(this['locale'],'AI_SUGGESTION_BUTTON_SHOW_CHANGES'),'withText':'full'==this['_config']['showChanges'],'tooltip':'full'!=this['_config']['showChanges'],'class':ds}),this['showChangesButton']['bind']('isOn')['to'](this,'isShowChangesOn'),this['showChangesButton']['bind']('isEnabled')['to'](this),this['showChangesButton']['bind']('icon')['to'](this,'isShowChangesOn',_0xe30761=>_0xe30761?_0x44006e:_0x5089e3),this['showChangesButton']['on']('execute',()=>{this['fire']('toggleShowChanges');});}}class ba extends Ca{['children'];['nextButtonView'];['previousButtonView'];['focusCycler'];['_focusables'];['_focusTracker'];['_keystrokes'];['_config'];['_streamableContentView'];['_toolbarContainerView'];['_partToolbarView'];['_stateView'];['_miniToolbarView'];constructor(_0x25c4ca,_0x1fece2){super(_0x25c4ca);const _0x142c21=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']=_0x1fece2,this['nextButtonView']=this['_createNextButtonView'](),this['previousButtonView']=this['_createPreviousButtonView'](),this['_streamableContentView']=new An(_0x25c4ca),this['_partToolbarView']=new un(_0x25c4ca,_0x1fece2['availableActions']),this['_partToolbarView']['delegate']('applySuggestion','insertSuggestion','rejectSuggestion')['to'](this),this['_togglePartToolbarButtonsVisibility'](_0x1fece2),this['_stateView']=new cn(_0x25c4ca),this['_stateView']['isVisible']=!0x1,this['_miniToolbarView']=new Sa(_0x25c4ca,{'showChanges':'full'}),this['_miniToolbarView']['bind']('isShowChangesOn')['to'](this,'showDiff'),this['_miniToolbarView']['on']('toggleShowChanges',()=>{this['fire']('toggleSuggestionDisplayMode');}),this['_toolbarContainerView']=new Ra(_0x25c4ca,[this['_partToolbarView'],this['_stateView'],this['_miniToolbarView']]),this['children']=this['createCollection']([this['_streamableContentView'],this['_toolbarContainerView']]),this['on']('change:_state',(_0x267748,_0x5b5bd1,_0x21c102,_0x652ed2)=>{let _0x3b7580,_0x4555b8;'pending'===_0x652ed2?(_0x3b7580=this['_partToolbarView'],_0x4555b8=this['_stateView']):(_0x3b7580=this['_stateView'],_0x4555b8=this['_partToolbarView']),this['_stateView']['setState'](_0x21c102),_0x3b7580['isVisible']=!0x1,_0x4555b8['isVisible']=!0x0;}),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat-balloon-main',_0x142c21['to']('_state',_0x141c89=>'ck-ai-chat-balloon-main_state_'+_0x141c89)]},'children':this['children']}),this['on']('change:isTrackChangesOn',()=>{this['_togglePartToolbarButtonsVisibility'](_0x1fece2);});}['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'](_0x53e7a8){_0x53e7a8?.['keepErrors']||this['hideError'](),await this['_streamableContentView']['update'](_0x53e7a8);}['setState'](_0x387d80){this['_state']=_0x387d80;}['showError'](_0x5608f4){super['showError'](_0x5608f4),this['children']['has'](this['_errorView'])||this['children']['add'](this['_errorView'],0x0);}['hideError'](){this['_isErrorVisible']&&(super['hideError'](),this['togglePartToolbarEnabled'](!0x0));}['showBlockingError'](_0x2ee39d){super['showBlockingError'](_0x2ee39d),this['togglePartToolbarEnabled'](!0x1);}['toggleRotatorButtonsVisibility'](_0x380dba){this['nextButtonView']['isVisible']=this['previousButtonView']['isVisible']=_0x380dba;}['togglePartToolbarEnabled'](_0x4d5c0b){this['_partToolbarView']['isEnabled']=_0x4d5c0b;}['_togglePartToolbarButtonsVisibility']({showApplyButton:_0x1b4154,showSuggestButton:_0x1f1e6b}){_0x1b4154=_0x1b4154&&!this['isTrackChangesOn']&&this['_config']['availableActions']['includes']('applySuggestion'),_0x1f1e6b=_0x1f1e6b&&this['_config']['availableActions']['includes']('insertSuggestion'),this['_partToolbarView']['setButtonsVisibility']({'showApplyButton':_0x1b4154,'showSuggestButton':_0x1f1e6b});}['_createNextButtonView'](){const _0xdf780c=new kt(this['locale']);return _0xdf780c['set']({'icon':_0x204f4c,'label':cs(this['locale'],'AI_BALLOON_NEXT_LABEL'),'isVisible':!0x0}),_0xdf780c['on']('execute',()=>{this['fire']('showNext');}),_0xdf780c;}['_createPreviousButtonView'](){const _0x448a04=new kt(this['locale']);return _0x448a04['set']({'icon':_0x39bc87,'label':cs(this['locale'],'AI_BALLOON_PREVIOUS_LABEL'),'isVisible':!0x0}),_0x448a04['on']('execute',()=>{this['fire']('showPrevious');}),_0x448a04;}}class Ra extends Nt{constructor(_0x1730fb,_0x1b9a6f){super(_0x1730fb),this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-balloon__toolbar-container']},'children':_0x1b9a6f});}}class Oa extends _0x432272{static get['requires'](){return[Vt,fa];}static get['pluginName'](){return'AIChatBalloon';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['_chatBalloonView'];constructor(_0x42e297){super(_0x42e297),this['set']('showDiff',!0x1);}['open'](_0x51edc9){const _0x23a99a=this['editor'];this['_chatBalloonView']||(this['_chatBalloonView']=this['_createChatBalloonView']()),_0x23a99a['plugins']['get']('AIBalloon')['open']({..._0x51edc9,'id':'aiChatBalloon','class':'ck-ai-chat-balloon','mainView':this['_chatBalloonView']}),this['_toggleRotatorButtonsInDialogHeader'](_0x51edc9['showRotator']),this['_chatBalloonView']['togglePartToolbarEnabled'](!_0x51edc9['areActionsDisabled']),this['_restoreDefaultViewFocus']();}['close'](){this['editor']['plugins']['get']('AIBalloon')['close']();}['updateContent'](_0x20f370){return this['_chatBalloonView']||(this['_chatBalloonView']=this['_createChatBalloonView']()),this['_chatBalloonView']['updateContent'](_0x20f370);}['setState'](_0x2a0481){this['_chatBalloonView']&&this['_chatBalloonView']['setState'](_0x2a0481);}['_createChatBalloonView'](){const _0xaaf8a3=this['editor'],_0x4dba2a=_0xaaf8a3['plugins']['get']('AIBalloon'),_0xbff3a1=_0xaaf8a3['commands']['get']('trackChanges');let _0x445a19=_0xaaf8a3['config']['get']('ai.availableReplyActions')||[...pn];_0xaaf8a3['plugins']['has']('TrackChanges')||(_0x445a19=_0x445a19['filter'](_0x1cb74c=>'insertSuggestion'!=_0x1cb74c));const _0x40f219=new ba(_0xaaf8a3['locale'],{'availableActions':_0x445a19,'showApplyButton':!0x0,'showSuggestButton':!!_0xbff3a1});return _0x40f219['bind']('showDiff')['to'](this),_0x40f219['delegate'](...js)['to'](this),_0x40f219['delegate']('showPrevious','showNext')['to'](this),_0x4dba2a['delegate']('dialogClosed')['to'](this),_0x40f219['on']('applySuggestion',this['_restoreDefaultViewFocus']['bind'](this)),_0x40f219['on']('insertSuggestion',this['_restoreDefaultViewFocus']['bind'](this)),_0x40f219['on']('rejectSuggestion',this['_restoreDefaultViewFocus']['bind'](this)),_0xbff3a1&&_0x40f219['bind']('isTrackChangesOn')['to'](_0xbff3a1,'value'),_0x40f219['render'](),_0x40f219;}['_toggleRotatorButtonsInDialogHeader'](_0x79d4ac){const _0x19708b=this['editor'],_0x1ba411=_0x19708b['plugins']['get']('Dialog')['view']['headerView']['children'];this['_chatBalloonView']['toggleRotatorButtonsVisibility'](_0x79d4ac),_0x1ba411['has'](this['_chatBalloonView']['previousButtonView'])||(_0x1ba411['addMany']([this['_chatBalloonView']['previousButtonView'],this['_chatBalloonView']['nextButtonView']],0x0),_0x19708b['plugins']['get']('AIBalloon')['once']('beforeDialogClosed',()=>{_0x1ba411['remove'](this['_chatBalloonView']['previousButtonView']),_0x1ba411['remove'](this['_chatBalloonView']['nextButtonView']);}));}['_restoreDefaultViewFocus'](){this['_chatBalloonView']['focus']();}}class ka extends _0x432272{static get['requires'](){return[Ta,Oa,_0x4a2830];}static get['pluginName'](){return'AIEditorIntegration';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}function Na(_0x316153){const {editor:_0x450a83,action:_0x43791a,withText:_0x4fc244=!0x1,withIcon:_0x52b0f1=!0x0,isInDropdown:_0x469007=!0x0,shouldPreventFocus:_0x4ce958=!0x1}=_0x316153;return()=>{const _0x8b19e1=_0x450a83['locale'],_0x3630e5=new kt(_0x8b19e1),_0x9548e0=_0x3630e5['bindTemplate'];_0x469007&&_0x3630e5['extendTemplate']({'on':{'mouseenter':_0x9548e0['to'](()=>{_0x4ce958&&_0x4ce958()||_0x3630e5['focus']();})}});const _0x1cfd36=_0x43791a['icon']??_0x43791a['parent']?.['icon'];return _0x3630e5['set']({'label':_0x43791a['label'],'withText':_0x4fc244,'role':'menuitem','icon':_0x52b0f1?_0x1cfd36??_0x3210e9:void 0x0,'tooltip':!_0x4fc244,'class':'ck-ai-quick-actions-button','isEnabled':_0x43791a['isEnabled']}),_0x3630e5['on']('execute',()=>{_0x450a83['editing']['view']['focus'](),_0x450a83['commands']['execute']('aiQuickAction',_0x43791a);}),_0x3630e5;};}class va extends _0x4ba054{['arrowView'];constructor(_0x111f38,_0x56985f){super(_0x111f38,_0x56985f);const _0x546d77=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',_0x454902=>String(_0x454902)),'data-cke-tooltip-disabled':_0x546d77['to']('isOn')},'on':{'mouseenter':_0x546d77['to']('mouseenter')}});}['render'](){super['render'](),this['children']['add'](this['arrowView']);}['_createArrowView'](){const _0x5eca03=new yt();return _0x5eca03['content']=_0x3a3268,_0x5eca03['extendTemplate']({'attributes':{'class':'ck-dropdown-menu-list__nested-menu__button__arrow'}}),_0x5eca03;}}class ya extends Lt{['_allListItems'];['_allSearchableItems'];constructor(_0x1957fb,_0xbadc41,_0x11ad6e){super(_0x1957fb),this['_allListItems']=_0xbadc41,this['_allSearchableItems']=_0x11ad6e;}['filter'](_0x5a3ad0){if(!_0x5a3ad0)return this['items']['clear'](),this['items']['addMany'](this['_allListItems']),this['_clearHighlight'](),{'resultsCount':this['_allListItems']['length'],'totalItemsCount':this['_allListItems']['length']};const _0x374041=_0x5a3ad0['source']['toLowerCase']()['trim'](),_0x1ec3fe=this['_allSearchableItems']['filter'](_0x3f6c41=>(_0x3f6c41['groupLabel']?_0x3f6c41['label']+'\x20('+_0x3f6c41['groupLabel']+')':_0x3f6c41['label'])['toLowerCase']()['includes'](_0x374041));return this['items']['clear'](),this['items']['addMany'](_0x1ec3fe['sort']((_0x577814,_0x8b5d8f)=>{const _0x132b2b=_0x577814['groupLabel'],_0x54fe42=_0x8b5d8f['groupLabel'];return _0x132b2b||_0x54fe42?_0x132b2b?0x1:-0x1:0x0;})['map'](_0x135b68=>_0x135b68['item'])),this['_highlightQuery'](_0x374041,_0x1ec3fe),{'resultsCount':_0x1ec3fe['length'],'totalItemsCount':this['_allSearchableItems']['length']};}['_highlightQuery'](_0x4cece6,_0x3e3493){if(!_0x4cece6)return;const _0x40ef3e=new RegExp(_0x1565e1(_0x4cece6),'gi');_0x3e3493['forEach'](_0x2583c0=>{_0x2583c0['highlightViews']&&_0x2583c0['highlightViews']['forEach'](_0x49ab7b=>{'function'==typeof _0x49ab7b['highlightText']&&_0x49ab7b['highlightText'](_0x40ef3e);});});}['_clearHighlight'](){this['_allSearchableItems']['forEach'](_0x3a7efd=>{_0x3a7efd['highlightViews']&&_0x3a7efd['highlightViews']['forEach'](_0x6cd91a=>{'function'==typeof _0x6cd91a['highlightText']&&_0x6cd91a['highlightText'](null);});});}}const xa='menu',La='menuitem';class Da extends Nt{['_bodyCollection'];['optionsListView'];['_searchTextView']=null;['_allSearchableItems']=[];['children'];['focusTracker'];['keystrokes'];['_focusables'];['focusCycler'];['_openNestedPanels']=new Set();['_hasSearch'];constructor(_0x335890,_0x35ae6e,_0x20fd3f,_0x5e343b,_0x1cd8df=!0x1){const _0x2fa64d=_0x335890['locale'];super(_0x2fa64d),this['_bodyCollection']=_0x5e343b,this['_hasSearch']=_0x1cd8df;const _0x38c7eb=this['_createListItems'](_0x335890,_0x35ae6e,_0x20fd3f);this['optionsListView']=new ya(_0x2fa64d,_0x38c7eb,this['_allSearchableItems']),this['optionsListView']['role']=xa,this['optionsListView']['items']['addMany'](_0x38c7eb),this['focusTracker']=new _t(),this['keystrokes']=new At(),_0x1cd8df&&(this['_searchTextView']=this['_createSearchTextView']()),this['_focusables']=_0x38c7eb,this['focusCycler']=new Mt({'focusables':this['_focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes']}),_0x1cd8df&&this['_searchTextView']&&this['focusCycler']['chain'](this['_searchTextView']['focusCycler']);const _0x45a4a2=_0x1cd8df&&this['_searchTextView']?[this['_searchTextView']]:[this['optionsListView']];this['children']=new _0x25ec1a(_0x45a4a2),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-ai-quick-actions','ck-rounded-corners'],'dir':_0x2fa64d['uiLanguageDirection']},'children':this['children']});}['_createSearchTextView'](){return new _0x1a8288(this['locale'],{'filteredView':this['optionsListView'],'queryView':{'label':cs(this['locale'],'AI_QUICK_ACTIONS_SEARCH')},'class':'ck-ai-quick-actions-search','infoView':{'text':{'notFound':{'primary':cs(this['locale'],'AI_QUICK_ACTIONS_SEARCH_NOT_FOUND')}}}});}['_isSearchFocused'](){if(!this['_hasSearch']||!this['_searchTextView']||!this['_searchTextView']['queryView']['fieldView']['element'])return!0x1;const _0x3adabf=this['_searchTextView']['queryView']['fieldView']['element']['ownerDocument']?.['activeElement'];return this['_searchTextView']['queryView']['fieldView']['element']['contains'](_0x3adabf);}['_createListItems'](_0x4a469d,_0x3f7a5b,_0x5a2c31){const _0x3e5396=new _0x25ec1a();return _0x3f7a5b['forEach'](_0x1c5af0=>{if('actions'in _0x1c5af0){const {listItem:_0x904990}=this['_createActionGroupButton'](_0x4a469d,_0x1c5af0,_0x5a2c31);_0x3e5396['add'](_0x904990),_0x1c5af0['actions']['forEach'](_0x32786d=>{this['_createActionButton'](_0x4a469d,_0x32786d,_0x1c5af0['label'],_0x1c5af0['icon']);const {listItem:_0x309bab,highlightViews:_0xeba044}=this['_createSearchResultActionButton'](_0x4a469d,_0x32786d,_0x1c5af0['label'],_0x1c5af0['icon']);this['_allSearchableItems']['push']({'item':_0x309bab,'label':_0x32786d['label'],'groupLabel':_0x1c5af0['label'],'highlightViews':_0xeba044});});}else{const {listItem:_0x40526a}=this['_createActionButton'](_0x4a469d,_0x1c5af0);_0x3e5396['add'](_0x40526a);const _0x4d45c8=_0x40526a['children']['first'];if(_0x4d45c8){const {listItem:_0x3896dd,highlightViews:_0x57cd30}=this['_createSearchResultActionButton'](_0x4a469d,_0x1c5af0);this['_allSearchableItems']['push']({'item':_0x3896dd,'label':_0x4d45c8['label']||'','highlightViews':_0x57cd30});}}}),_0x3e5396;}['_createActionButton'](_0x546a8f,_0x3026b8,_0x19e83d,_0x5e1c73){const _0x2c1ddd=new Pt(this['locale']);if(_0x19e83d&&_0x5e1c73){const _0x40dcc8=new kt(this['locale']),_0x308060=_0x40dcc8['bindTemplate'],_0x276f31=new _0x472014();_0x276f31['text']=_0x3026b8['label'];const _0x4c4c3d=new _0x472014();_0x4c4c3d['text']=_0x19e83d;const _0x6031a4=new yt();_0x6031a4['content']=_0x5e1c73,_0x6031a4['extendTemplate']({'attributes':{'class':'ck-ai-quick-actions-button__group-icon'}});const _0x3b9ca8=new Nt(this['locale']);_0x3b9ca8['setTemplate']({'tag':'span','attributes':{'class':'ck-ai-quick-actions-button_with-group__open-paren'},'children':[{'text':'\x20('}]});const _0xe5fd39=new Nt(this['locale']);return _0xe5fd39['setTemplate']({'tag':'span','attributes':{'class':'ck-ai-quick-actions-button_with-group__close-paren'},'children':[{'text':')'}]}),_0x40dcc8['set']({'label':_0x3026b8['label']+'\x20('+_0x19e83d+')','withText':!0x0,'role':'menuitem','class':'ck-ai-quick-actions-button\x20ck-ai-quick-actions-button_with-group','tooltip':!0x1}),_0x40dcc8['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':[_0x276f31,_0x3b9ca8,_0x6031a4,_0x4c4c3d,_0xe5fd39],'on':{'mouseenter':_0x308060['to'](()=>{this['_isSearchFocused']()||_0x40dcc8['focus']();}),'click':_0x308060['to'](()=>{_0x40dcc8['fire']('execute');})}}),_0x40dcc8['on']('execute',()=>{_0x546a8f['editing']['view']['focus'](),_0x546a8f['commands']['execute']('aiQuickAction',_0x3026b8);}),_0x2c1ddd['children']['add'](_0x40dcc8),{'listItem':_0x2c1ddd,'highlightViews':[_0x276f31,_0x4c4c3d]};}{const _0x20070e=new _0x5973a1(),_0x464d04=new kt(this['locale'],_0x20070e),_0x39841a=_0x464d04['bindTemplate'],_0x1ed2bd=_0x3026b8['icon']??_0x3026b8['parent']?.['icon'],_0x112ee3=void 0x0!==_0x3026b8['icon'];return _0x464d04['set']({'label':_0x3026b8['label'],'withText':!0x0,'role':'menuitem','icon':_0x112ee3?_0x1ed2bd??_0x3210e9:void 0x0,'tooltip':!0x1,'class':'ck-ai-quick-actions-button'}),_0x464d04['extendTemplate']({'on':{'mouseenter':_0x39841a['to'](()=>{this['_isSearchFocused']()||_0x464d04['focus']();})}}),_0x464d04['on']('execute',()=>{_0x546a8f['editing']['view']['focus'](),_0x546a8f['commands']['execute']('aiQuickAction',_0x3026b8);}),_0x2c1ddd['children']['add'](_0x464d04),{'listItem':_0x2c1ddd,'highlightViews':[_0x20070e]};}}['_createSearchResultActionButton'](_0x5b5586,_0x1a5c0f,_0x281666,_0x1690be){return _0x281666&&_0x1690be?this['_createSearchResultGroupedActionButton'](_0x5b5586,_0x1a5c0f,_0x281666,_0x1690be):this['_createSearchResultIndividualActionButton'](_0x5b5586,_0x1a5c0f);}['_createSearchResultGroupedActionButton'](_0x5e44ba,_0xdf2386,_0x3e94c4,_0x183149){const _0x1b0200=new Pt(this['locale']),_0x445097=new kt(this['locale']),_0x6ba08c=_0x445097['bindTemplate'],{view:_0x34bd4d,highlightView:_0x559a63}=this['_createSearchResultGroupRow'](_0x3e94c4,_0x183149),{view:_0x2f7c6c,highlightView:_0x5d50bf}=this['_createSearchResultActionRow'](_0xdf2386['label']),_0x5a395e=this['_createSearchResultContentView'](_0x34bd4d,_0x2f7c6c);return _0x445097['set']({'label':_0xdf2386['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}),_0x445097['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':[_0x5a395e],'on':{'mouseenter':_0x6ba08c['to'](()=>{this['_isSearchFocused']()||_0x445097['focus']();}),'click':_0x6ba08c['to'](()=>{this['_handleSearchResultButtonClick'](_0x445097);})}}),this['_setupActionButtonExecution'](_0x445097,_0x5e44ba,_0xdf2386),_0x1b0200['children']['add'](_0x445097),{'listItem':_0x1b0200,'highlightViews':[_0x559a63,_0x5d50bf]};}['_createSearchResultIndividualActionButton'](_0x210c8d,_0x3fd692){const _0x1d543a=new Pt(this['locale']),_0x329fad=new _0x5973a1(),_0x5c5b2d=new kt(this['locale'],_0x329fad),_0x26a00e=_0x5c5b2d['bindTemplate'];return _0x5c5b2d['set']({'label':_0x3fd692['label'],'withText':!0x0,'role':'menuitem','icon':void 0x0,'tooltip':!0x1,'class':'ck-ai-quick-actions-button\x20ck-ai-quick-actions-search-result-button'}),_0x5c5b2d['extendTemplate']({'on':{'mouseenter':_0x26a00e['to'](()=>{this['_isSearchFocused']()||_0x5c5b2d['focus']();})}}),this['_setupActionButtonExecution'](_0x5c5b2d,_0x210c8d,_0x3fd692),_0x1d543a['children']['add'](_0x5c5b2d),{'listItem':_0x1d543a,'highlightViews':[_0x329fad]};}['_createSearchResultGroupRow'](_0x2f9856,_0x37dd46){const _0x167574=new Nt(this['locale']),_0x3ef360=new yt();_0x3ef360['content']=_0x37dd46,_0x3ef360['extendTemplate']({'attributes':{'class':'ck-ai-quick-actions-button__group-icon'}});const _0x134b71=new _0x472014();return _0x134b71['text']=_0x2f9856,_0x167574['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-quick-actions-search-result__group-row'},'children':[_0x3ef360,_0x134b71]}),{'view':_0x167574,'highlightView':_0x134b71};}['_createSearchResultActionRow'](_0x6b7434){const _0x2a3959=new Nt(this['locale']),_0x961673=new _0x472014();return _0x961673['text']=_0x6b7434,_0x2a3959['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-quick-actions-search-result__action-row'},'children':[_0x961673]}),{'view':_0x2a3959,'highlightView':_0x961673};}['_createSearchResultContentView'](_0x58d004,_0x357c1e){const _0x215f9f=new Nt(this['locale']);return _0x215f9f['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-quick-actions-search-result__content'},'children':[_0x58d004,_0x357c1e]}),_0x215f9f;}['_setupActionButtonExecution'](_0xb2555c,_0x543a59,_0xa59756){_0xb2555c['on']('execute',()=>{_0x543a59['editing']['view']['focus'](),_0x543a59['commands']['execute']('aiQuickAction',_0xa59756);});}['_createActionGroupButton'](_0x403fca,_0x54b4ef,_0x2509e7){const _0x517575=new Pt(this['locale']),_0x1ed04b=new _0x5973a1(),_0x488d7e=new va(this['locale'],_0x1ed04b),_0x112786=_0x488d7e['bindTemplate'],_0x28bdb5=this['_getPanelKeystroke'](_0x2509e7),_0x7ad23c=this['_createGroupActionsList'](_0x403fca,_0x54b4ef['actions'],_0x2509e7);_0x488d7e['set']({'label':_0x54b4ef['label'],'withText':!0x0,'role':La,'icon':_0x54b4ef['icon']??_0x3210e9,'isEnabled':_0x54b4ef['actions']['some'](_0x1d0c7e=>_0x1d0c7e['isEnabled'])}),_0x488d7e['extendTemplate']({'on':{'mouseenter':_0x112786['to'](()=>{this['_isSearchFocused']()||_0x488d7e['focus']();})}});const _0x664eea=new Qt(this['locale']);return _0x664eea['extendTemplate']({'attributes':{'class':['ck','ck-reset_all','ck-ai-quick-actions-group-panel','ck-dropdown-menu__nested-menu__panel']},'on':{'keydown':_0x112786['to'](_0x4b6759=>{this['_handlePanelKeydown'](_0x4b6759,_0x28bdb5,_0x488d7e,_0x664eea);})}}),_0x488d7e['bind']('isOn')['to'](_0x664eea,'isVisible'),this['_bodyCollection']['add'](_0x664eea),_0x664eea['content']['add'](_0x7ad23c),this['_setupGroupMenuBehavior'](_0x488d7e,_0x664eea),_0x517575['children']['add'](_0x488d7e),{'listItem':_0x517575,'highlightView':_0x1ed04b};}['_createGroupActionsList'](_0x569d55,_0x67e520,_0x48a0ce){const _0x53b8fa=new Lt(this['locale']);return _0x53b8fa['extendTemplate']({'attributes':{'class':['ck','ck-reset_all','ck-ai-quick-actions-group-list','ck-dropdown-menu-list']}}),_0x67e520['forEach'](_0xd85904=>{const _0x1de5fe=new Pt(this['locale']),_0x602ab9=Na({'editor':_0x569d55,'action':_0xd85904,'withText':!0x0,'withIcon':!0x1,'isInDropdown':!0x0,'shouldPreventFocus':()=>this['_isSearchFocused']()})();_0x1de5fe['children']['add'](_0x602ab9),_0x48a0ce['focusTracker']['add'](_0x602ab9),_0x53b8fa['items']['add'](_0x1de5fe);}),_0x53b8fa;}['_setupGroupMenuBehavior'](_0x33b11b,_0x35ee88){const _0x17ddfb=_0x33b11b['bindTemplate'],_0x359921=this['_getButtonKeystroke'](_0x33b11b);_0x33b11b['extendTemplate']({'attributes':{'class':['ck-ai-quick-actions-group-button']},'on':{'mouseenter':_0x17ddfb['to'](()=>{this['_showNestedPanel'](_0x35ee88,_0x33b11b);}),'mouseleave':_0x17ddfb['to'](_0x420528=>{const _0x124242=_0x420528['relatedTarget'];this['_isMovingToNestedMenu'](_0x124242,_0x35ee88)||this['_hideNestedPanel'](_0x35ee88);}),'keydown':_0x17ddfb['to'](_0x84d20c=>{_0x84d20c['key']==_0x359921&&(this['_showNestedPanel'](_0x35ee88,_0x33b11b),_0x35ee88['content']['get'](0x0)['focus']());})}}),_0x35ee88['on']('render',()=>{_0x35ee88['element']?.['addEventListener']('mouseleave',_0x13853b=>{const _0x324515=_0x13853b['relatedTarget'];_0x33b11b['element']?.['contains'](_0x324515)||this['_isMovingToNestedMenu'](_0x324515,_0x35ee88)||this['_hideNestedPanel'](_0x35ee88);});});}['_showNestedPanel'](_0x2df8ca,_0x4ded57){this['_openNestedPanels']['forEach'](_0xe9377=>{_0xe9377!==_0x2df8ca&&_0xe9377['isVisible']&&_0xe9377['hide']();}),_0x2df8ca['show'](),_0x2df8ca['pin']({'positions':[_0x11dd22['eastSouth']],'target':_0x4ded57['element'],'fitInViewport':!0x0}),this['_openNestedPanels']['add'](_0x2df8ca);}['_hideNestedPanel'](_0x20e6a8){_0x20e6a8['hide'](),this['_openNestedPanels']['delete'](_0x20e6a8);}['_hideAllNestedPanels'](){this['_openNestedPanels']['forEach'](_0x438786=>_0x438786['hide']()),this['_openNestedPanels']['clear']();}['_isMovingToNestedMenu'](_0x50dd55,_0xf17083){if(!_0x50dd55)return!0x1;if(_0xf17083['element']?.['contains'](_0x50dd55))return!0x0;const _0x34614a=_0x50dd55;return _0x34614a['closest']&&(null!==_0x34614a['closest']('.ck-ai-quick-actions-group-panel')||null!==_0x34614a['closest']('.ck-ai-quick-actions-group-list')||null!==_0x34614a['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'](_0x41f8b0){return'rtl'===_0x41f8b0['locale']['uiLanguageDirection']?'ArrowRight':'ArrowLeft';}['_getButtonKeystroke'](_0x17927d){return'rtl'===_0x17927d['locale']['uiLanguageDirection']?'ArrowLeft':'ArrowRight';}['_handlePanelKeydown'](_0x2de3e8,_0x261808,_0x13a809,_0x54cc3e){_0x2de3e8['key']==_0x261808&&(_0x13a809['focus'](),this['_hideNestedPanel'](_0x54cc3e));}['_handleSearchResultButtonClick'](_0x12910b){_0x12910b['fire']('execute');}}function Pa(_0x51dc01){const {editor:_0x58a3e0,content:_0x56d54b,buttonDefinition:_0x10be26,bodyCollection:_0x4ca322,hasSearch:_0x58dce3=!0x1}=_0x51dc01;return()=>{const _0xe3b120=_0x58a3e0['locale'],_0x4e9f93=Bt(_0xe3b120);_0x4e9f93['buttonView']['set']({'icon':_0x10be26['icon']??_0x3210e9,'label':_0x10be26['label'],'tooltip':!0x0}),_0x4e9f93['set']({'class':'ck-ai-quick-actions-dropdown'});const _0x55c214=new Da(_0x58a3e0,_0x56d54b,_0x4e9f93,_0x4ca322,_0x58dce3);return _0x4e9f93['panelView']['children']['add'](_0x55c214),_0x58dce3&&_0x4e9f93['on']('change:isOpen',(_0x6ecec9,_0xe7dac1,_0x8384be)=>{if(_0x8384be){if(_0x58a3e0['plugins']['has']('AIEditing')){const _0x244a1e=_0x58a3e0['plugins']['get'](zs),_0x3e816e=_0x58a3e0['model']['document']['selection'],_0x3b8a10=Array['from'](_0x3e816e['getRanges']());_0x3b8a10['length']>0x0&&_0x244a1e['showFakeVisualSelection']({'ranges':_0x3b8a10,'id':'quick-action','priority':0x14});}}else _0x58a3e0['plugins']['has']('AIEditing')&&_0x58a3e0['plugins']['get'](zs)['hideFakeVisualSelection']('quick-action'),_0x55c214['resetSearch']();}),_0x4e9f93;};}const Ha='<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>',Ma='<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>',Ua='<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>',Va=/* #__PURE__ -- @preserve */
28
- ((()=>({'chat':'AIChat','action':'AIActions'}))());class Ba extends _0x432272{static get['requires'](){return[_0x487bca,hs];}static get['pluginName'](){return'AIQuickActionsUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}async['init'](){const _0x200ab1=await this['_getDefaultAndCustomActions']();this['_prepareQuickActionsDefinition'](_0x200ab1),this['_initializeQuickActionsComponentsAndCommands']();}static['getDefaultQuickActions'](_0xea3e52){return function(_0x1bcfa2){const _0x231331=new Intl['DisplayNames'](['en'],{'type':'language'})['of'](_0x1bcfa2['uiLanguage']),_0x136efc=_0x231331||'English',_0x5597c8=[{'id':'ask-ai','label':cs(_0x1bcfa2,'AI_QUICK_ACTIONS_ASK_AI'),'type':'chat','icon':_0xf58806},{'id':'chat-commands','label':cs(_0x1bcfa2,'AI_QUICK_ACTIONS_CHAT_COMMANDS'),'icon':_0xf58806,'actions':[{'id':'explain','label':cs(_0x1bcfa2,'AI_QUICK_ACTIONS_EXPLAIN'),'displayedPrompt':cs(_0x1bcfa2,'AI_QUICK_ACTIONS_EXPLAIN'),'prompt':Ha['replace']('%0',_0x136efc),'type':'chat'},{'id':'summarize','label':cs(_0x1bcfa2,'AI_QUICK_ACTIONS_SUMMARIZE'),'displayedPrompt':cs(_0x1bcfa2,'AI_QUICK_ACTIONS_SUMMARIZE'),'prompt':Ma['replace']('%0',_0x136efc),'type':'chat'},{'id':'highlight-key-points','label':cs(_0x1bcfa2,'AI_QUICK_ACTIONS_HIGHLIGHT_KEY_POINTS'),'displayedPrompt':cs(_0x1bcfa2,'AI_QUICK_ACTIONS_HIGHLIGHT_KEY_POINTS'),'prompt':Ua['replace']('%0',_0x136efc),'type':'chat'}]},{'id':'improve-writing','label':cs(_0x1bcfa2,'AI_QUICK_ACTIONS_IMPROVE_WRITING'),'type':'action','icon':_0x1eda05},{'id':'continue','label':cs(_0x1bcfa2,'AI_QUICK_ACTIONS_CONTINUE_WRITING'),'type':'action','icon':_0x110c1c},{'id':'fix-grammar','label':cs(_0x1bcfa2,'AI_QUICK_ACTIONS_FIX_GRAMMAR_SPELLING'),'type':'action','icon':_0xdd640b},{'id':'adjust-length','label':cs(_0x1bcfa2,'AI_QUICK_ACTIONS_ADJUST_LENGTH'),'icon':_0x3a9dde,'actions':[{'id':'make-shorter','label':cs(_0x1bcfa2,'AI_QUICK_ACTIONS_MAKE_SHORTER'),'type':'action'},{'id':'make-longer','label':cs(_0x1bcfa2,'AI_QUICK_ACTIONS_MAKE_LONGER'),'type':'action'}]},{'id':'change-tone','label':cs(_0x1bcfa2,'AI_QUICK_ACTIONS_CHANGE_TONE'),'icon':_0x4389c6,'actions':[{'id':'make-tone-casual','label':cs(_0x1bcfa2,'AI_QUICK_ACTIONS_MORE_CASUAL'),'type':'action'},{'id':'make-tone-direct','label':cs(_0x1bcfa2,'AI_QUICK_ACTIONS_MORE_DIRECT'),'type':'action'},{'id':'make-tone-friendly','label':cs(_0x1bcfa2,'AI_QUICK_ACTIONS_MORE_FRIENDLY'),'type':'action'},{'id':'make-tone-confident','label':cs(_0x1bcfa2,'AI_QUICK_ACTIONS_MORE_CONFIDENT'),'type':'action'},{'id':'make-tone-professional','label':cs(_0x1bcfa2,'AI_QUICK_ACTIONS_MORE_PROFESSIONAL'),'type':'action'}]},{'id':'translate','label':cs(_0x1bcfa2,'AI_QUICK_ACTIONS_TRANSLATE'),'icon':_0x29e343,'actions':[{'id':'translate-to-english','label':cs(_0x1bcfa2,'AI_QUICK_ACTIONS_TRANSLATE_ENGLISH'),'type':'action','actionName':'translate','args':{'language':'english'}},{'id':'translate-to-chinese','label':cs(_0x1bcfa2,'AI_QUICK_ACTIONS_TRANSLATE_CHINESE'),'type':'action','actionName':'translate','args':{'language':'chinese'}},{'id':'translate-to-spanish','label':cs(_0x1bcfa2,'AI_QUICK_ACTIONS_TRANSLATE_SPANISH'),'type':'action','actionName':'translate','args':{'language':'spanish'}},{'id':'translate-to-german','label':cs(_0x1bcfa2,'AI_QUICK_ACTIONS_TRANSLATE_GERMAN'),'type':'action','actionName':'translate','args':{'language':'german'}},{'id':'translate-to-french','label':cs(_0x1bcfa2,'AI_QUICK_ACTIONS_TRANSLATE_FRENCH'),'type':'action','actionName':'translate','args':{'language':'french'}},{'id':'translate-to-japanese','label':cs(_0x1bcfa2,'AI_QUICK_ACTIONS_TRANSLATE_JAPANESE'),'type':'action','actionName':'translate','args':{'language':'japanese'}},{'id':'translate-to-portuguese','label':cs(_0x1bcfa2,'AI_QUICK_ACTIONS_TRANSLATE_PORTUGUESE'),'type':'action','actionName':'translate','args':{'language':'portuguese'}},{'id':'translate-to-korean','label':cs(_0x1bcfa2,'AI_QUICK_ACTIONS_TRANSLATE_KOREAN'),'type':'action','actionName':'translate','args':{'language':'korean'}},{'id':'translate-to-italian','label':cs(_0x1bcfa2,'AI_QUICK_ACTIONS_TRANSLATE_ITALIAN'),'type':'action','actionName':'translate','args':{'language':'italian'}},{'id':'translate-to-russian','label':cs(_0x1bcfa2,'AI_QUICK_ACTIONS_TRANSLATE_RUSSIAN'),'type':'action','actionName':'translate','args':{'language':'russian'}}]},{'id':'other','label':cs(_0x1bcfa2,'AI_QUICK_ACTIONS_OTHER'),'icon':_0x41e602,'actions':[]}];return _0x5597c8;}(_0xea3e52);}async['_getDefaultAndCustomActions'](){const _0x32852b=Ba['getDefaultQuickActions'](this['editor']['locale']),_0x38a3db=this['editor']['config']['get']('ai.quickActions.extraCommands')||[];let _0x13bfcb=[];try{_0x13bfcb=await new Ks({'connector':this['editor']['plugins']['get']('AIConnector'),'locale':this['editor']['locale']})['getAll']();}catch(_0x507967){const _0x12ed96=new ot('ai-quick-actions-models-unable-to-retrieve',this,{'error':_0x507967});Tt(_0x12ed96['message']);}finally{const _0x2d34b8=_0x38a3db['map'](_0x40cf4b=>({..._0x40cf4b,'type':'chat'===_0x40cf4b['type']?'chat':'action','icon':void 0x0}));_0x32852b['find'](_0x262f35=>'other'===_0x262f35['id'])['actions']['push'](..._0x2d34b8),_0x32852b['forEach'](_0x20844d=>{if('actions'in _0x20844d)_0x20844d['actions']['forEach'](_0x5a2639=>{if(_0x5a2639['isEnabled']=!!_0x13bfcb['find'](_0x1ebd5b=>_0x1ebd5b['id']===_0x5a2639['model'])||void 0x0===_0x5a2639['model'],!_0x5a2639['isEnabled']){const _0x168c5b=new ot('ai-quick-actions-unavailable-model',this,{'actionId':_0x5a2639['id'],'modelId':_0x5a2639['model']});Tt(_0x168c5b['message']);}});else{if(_0x20844d['isEnabled']=!!_0x13bfcb['find'](_0x264f32=>_0x264f32['id']===_0x20844d['model'])||void 0x0===_0x20844d['model'],!_0x20844d['isEnabled']){const _0x38bdf6=new ot('ai-quick-actions-unavailable-model',this,{'actionId':_0x20844d['id'],'modelId':_0x20844d['model']});Tt(_0x38bdf6['message']);}}});}return _0x32852b;}['_initializeQuickActionsComponentsAndCommands'](){const _0x240cf2=new qt(this['editor']['locale']);_0x240cf2['attachToDom'](),this['_initializeQuickActionsDropdown'](_0x240cf2),this['_initializeQuickActionsMenuBar'](),this['_initializeQuickActionsComponents'](_0x240cf2);}['_initializeQuickActionsDropdown'](_0x1f5031){const _0x3f3d80=this['editor']['config']['get']('ai.quickActions.isSearchEnabled')??!0x0;this['editor']['ui']['componentFactory']['add']('aiQuickActions',Pa({'editor':this['editor'],'content':this['_quickActionsDefinition'],'buttonDefinition':{'icon':_0x3210e9,'label':cs(this['editor']['locale'],'AI_QUICK_ACTIONS_HEADING')},'bodyCollection':_0x1f5031,'hasSearch':_0x3f3d80}));}['_prepareQuickActionsDefinition'](_0x411c8c){this['_quickActionsDefinition']=_0x411c8c['map'](_0x54ea54=>{if('actions'in _0x54ea54){const _0x21c23f=_0x54ea54;return{..._0x21c23f,'actions':_0x21c23f['actions']['map'](_0x54f8d9=>{const {actions:_0xc0eab0,..._0x4e8085}=_0x21c23f;return{..._0x54f8d9,'parent':_0x4e8085};})['filter'](_0x44f10c=>this['_shouldIncludeAction'](_0x44f10c))};}return _0x54ea54;})['filter'](_0x50c377=>'actions'in _0x50c377?_0x50c377['actions']['length']>0x0:this['_shouldIncludeAction'](_0x50c377));}['_shouldIncludeAction'](_0x2ca9d1){const _0x3684a5=this['editor']['config']['get']('ai.quickActions.removeCommands')||[];return this['editor']['plugins']['has'](Va[_0x2ca9d1['type']])&&!_0x3684a5['includes'](_0x2ca9d1['id'])&&!('chat'===_0x2ca9d1['type']&&!0x1===this['editor']['config']['get']('ai.chat.context.document.enabled'));}['_initializeQuickActionsComponents'](_0x36a54b){this['_quickActionsDefinition']['forEach'](_0x593a58=>{if('actions'in _0x593a58){const _0x3b622f=Pa({'editor':this['editor'],'content':_0x593a58['actions'],'buttonDefinition':_0x593a58,'bodyCollection':_0x36a54b});this['editor']['ui']['componentFactory']['add'](_0x593a58['id'],_0x3b622f),_0x593a58['actions']['forEach'](_0x4412f1=>{const _0x4f05be=Na({'editor':this['editor'],'action':_0x4412f1});this['editor']['ui']['componentFactory']['add'](_0x4412f1['id'],_0x4f05be);});}else{const _0x54c3ec=Na({'editor':this['editor'],'action':_0x593a58,'withText':!0x1,'withIcon':!0x0,'isInDropdown':!0x1});this['editor']['ui']['componentFactory']['add'](_0x593a58['id'],_0x54c3ec);}});}['_initializeQuickActionsMenuBar'](){this['editor']['ui']['componentFactory']['add']('menuBar:aiQuickActions',_0x4a1904=>{const _0x299ec0=new Ft(_0x4a1904),_0xedaee9=cs(_0x4a1904,'AI_QUICK_ACTIONS_HEADING');_0x299ec0['buttonView']['set']({'label':_0xedaee9,'icon':_0x3210e9});const _0x4844d4=new Yt(_0x4a1904);_0x4844d4['set']({'ariaLabel':_0xedaee9,'role':'menu'}),this['_quickActionsDefinition']['forEach'](_0x5bd986=>{if('actions'in _0x5bd986){const _0x149f79=_0x5bd986,_0x3d8403=new $t(_0x4a1904,_0x299ec0),_0x58db56=new Ft(_0x4a1904),_0x55a818=new Yt(_0x4a1904);_0x58db56['buttonView']['set']({'label':_0x149f79['label'],'icon':_0x149f79['icon']}),_0x149f79['actions']['forEach'](_0x2984d9=>{const _0x268903=new $t(_0x4a1904,_0x58db56),_0x541948=new Kt(_0x4a1904);_0x541948['set']({'label':_0x2984d9['label'],'icon':_0x2984d9['icon'],'role':'menuitem','isEnabled':_0x2984d9['isEnabled']}),_0x541948['on']('execute',()=>{this['_executeQuickAction'](_0x2984d9);}),_0x541948['delegate']('execute')['to'](_0x58db56),_0x268903['children']['add'](_0x541948),_0x55a818['items']['add'](_0x268903);}),_0x58db56['panelView']['children']['add'](_0x55a818),_0x3d8403['children']['add'](_0x58db56),_0x4844d4['items']['add'](_0x3d8403);}else{const _0x2d5055=_0x5bd986,_0x1f1472=new $t(_0x4a1904,_0x299ec0),_0x4d585f=new Kt(_0x4a1904);_0x4d585f['set']({'label':_0x2d5055['label'],'icon':_0x2d5055['icon'],'role':'menuitem','isEnabled':_0x2d5055['isEnabled']}),_0x4d585f['on']('execute',()=>{this['_executeQuickAction'](_0x2d5055);}),_0x4d585f['delegate']('execute')['to'](_0x299ec0),_0x1f1472['children']['add'](_0x4d585f),_0x4844d4['items']['add'](_0x1f1472);}});const _0x259d05=Object['values'](Va)['some'](_0x4ab453=>this['editor']['plugins']['has'](_0x4ab453));return _0x299ec0['set']({'isEnabled':_0x259d05}),_0x299ec0['panelView']['children']['add'](_0x4844d4),_0x299ec0;});}['_executeQuickAction'](_0x5d2f1b){const _0x237eec=this['editor'];_0x237eec['editing']['view']['focus'](),_0x237eec['commands']['execute']('aiQuickAction',_0x5d2f1b);const _0x2857e3=_0x237eec['ui']['view']['menuBarView'];_0x2857e3&&_0x2857e3['close']&&_0x2857e3['close']();}}class Ga extends _0x13d0ac{['execute'](_0x5b06b2){switch(this['_expandSelectionIfCollapsed'](),_0x5b06b2['type']){case'chat':if(!this['editor']['plugins']['has']('AIChat')){const _0x1ac866=cs(this['editor']['locale'],'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND','AIChat');throw new ot('ai-quick-actions-plugin-not-found',this['editor'],{'errorMessage':_0x1ac866});}this['_handleAIChatAction'](_0x5b06b2);break;case'action':if(!this['editor']['plugins']['has']('AIActions')){const _0x181007=cs(this['editor']['locale'],'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND','AIActions');throw new ot('ai-quick-actions-plugin-not-found',this['editor'],{'errorMessage':_0x181007});}this['_handleAIActionsAction'](_0x5b06b2);}}async['_handleAIChatAction'](_0x24e17f){const _0x2ef42a=this['editor']['plugins']['get']('AIChatController'),_0x5ba200=this['editor']['plugins']['get']('AITabs')['view'];if(_0x5ba200['isVisible']||(_0x5ba200['isVisible']=!0x0),'chat'!==_0x5ba200['activeTab']&&_0x5ba200['activateTab']('chat'),'ask-ai'===_0x24e17f['id'])_0x2ef42a['removeSelectionFromChatContext'](),_0x2ef42a['addSelectionToChatContext'](),_0x2ef42a['focusPromptInput']();else await _0x2ef42a['startConversation'](),_0x2ef42a['removeSelectionFromChatContext'](),_0x2ef42a['addSelectionToChatContext'](),_0x2ef42a['focusPromptInput'](),await _0x2ef42a['sendMessage']({'message':_0x24e17f['prompt']||_0x24e17f['displayedPrompt']||_0x24e17f['label'],'attributes':{'quickActionData':{'id':_0x24e17f['id']},'displayedPrompt':_0x24e17f['displayedPrompt']}});}['_expandSelectionIfCollapsed'](){const _0x503d22=this['editor'],_0x43c262=_0x503d22['model']['document']['selection'];if(!_0x43c262['isCollapsed'])return;const _0x346773=gt(_0x43c262['getSelectedBlocks']())||_0x503d22['model']['schema']['getLimitElement'](_0x43c262);_0x503d22['model']['change'](_0x505ec1=>{_0x505ec1['setSelection'](_0x346773,'in');});}['_handleAIActionsActionLabel'](_0x49ba1b){return _0x49ba1b['parent']?.['label']&&'other'!==_0x49ba1b['parent']?.['id']?_0x49ba1b['parent']['label']+':\x20'+_0x49ba1b['label']:_0x49ba1b['label'];}async['_handleAIActionsAction'](_0x4032a4){const _0x479fbf=this['editor']['plugins']['get']('AIActions'),_0x4e3ee5=_0x4032a4['prompt']?{'userMessage':_0x4032a4['prompt'],'model':_0x4032a4['model']}:{'actionName':_0x4032a4['actionName']||_0x4032a4['id'],'args':_0x4032a4['args']},_0x533c7b=this['_handleAIActionsActionLabel'](_0x4032a4);await _0x479fbf['executeAction'](_0x4e3ee5,_0x533c7b,_0x4032a4['icon']);}}class Fa extends _0x432272{static get['pluginName'](){return'AIQuickActionsEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x363a0e=this['editor'],_0x473d74=new Ga(this['editor']);if(_0x363a0e['commands']['add']('aiQuickAction',_0x473d74),_0x363a0e['plugins']['has']('AIChat')){const _0x296d01=this['editor']['plugins']['get']('AIChatController');_0x363a0e['model']['document']['selection']['on']('change:range',(_0x51e41e,_0x12780c)=>{_0x12780c['directChange']&&_0x296d01['removeSelectionFromChatContext']();});}}}class Ka extends Ls{['updateChangeGroups'](){if(this['parsedMergedContent']=this['parsedContent']['cloneNode'](!0x0),0x0==this['parsedMergedContent']['childNodes']['length'])return void(this['changeGroups']=[]);const _0x156fbf=this['documentContextContent']['children']['map'](_0x5863e5=>({'node':_0x5863e5,'id':ps(_0x5863e5,'data-id')})),_0x87b4d9=this['parsedMergedContent']['children']['map'](_0x2a0b55=>({'node':_0x2a0b55,'id':ps(_0x2a0b55,'data-id')||at()})),_0x522e27=_0xac7233(_0x156fbf,_0x87b4d9,{'comparator':(_0x146c63,_0x1ad532)=>_0x146c63['id']==_0x1ad532['id'],'oneChangePerToken':!0x0});if(!this['isDone']){for(;_0x522e27['length']&&_0x522e27[_0x522e27['length']-0x1]['removed'];)_0x522e27['pop']();}const _0x370678=_0x522e27['map'](_0x1a8563=>{const _0x159a17=_0x1a8563['added']?'new':_0x1a8563['removed']?'removed':'modified';return{'node':_0x1a8563['value'][0x0]['node'],'type':_0x159a17,'id':_0x1a8563['value'][0x0]['id']};});this['changeGroups']=[{'changes':_0x370678,'state':'pending','index':0x0}];}['_getDifferentChangeGroups'](_0x3b6275,_0x2332bd){return _0x2332bd;}}class Wa extends Ps{['content'];['version'];['actionName'];['args'];['userMessage'];['model'];['hasError']=!0x1;constructor(_0xc0a0b3){super(_0xc0a0b3),this['content']=_0xc0a0b3['content'],this['version']=_0xc0a0b3['version'],this['actionName']=_0xc0a0b3['actionName'],this['args']=_0xc0a0b3['args'],this['userMessage']=_0xc0a0b3['userMessage'],this['model']=_0xc0a0b3['model'];}async['sendRequest'](){return this['actionName']?this['connector']['executeAction']({'content':this['content'],'actionName':this['actionName'],'args':this['args']}):this['connector']['executeCustomAction']({'content':this['content'],'message':this['userMessage'],'model':this['model'],'outputFormat':'html'});}['getDocumentContext'](){return{'type':'text','content':this['content'],'version':this['version'],'label':'Current\x20document','uiId':'current-document'};}['createReply'](_0x48d08b){const _0x3b4ba4=new Ka({'editor':this['editor'],'documentContextContent':this['content'],..._0x48d08b});return this['replies']['push'](_0x3b4ba4),_0x3b4ba4['delegate'](...Ds)['to'](this),this['fire']('replyCreated',_0x3b4ba4),_0x3b4ba4;}}class Ya extends Ot{constructor(_0x31a7e1,_0x5c78c6=!0x0,_0x215153=!0x0){super(_0x31a7e1),this['set']('isEnabled',!0x1),_0x5c78c6&&(this['applyButton']=this['_createButton'](cs(_0x31a7e1,'AI_BALLOON_APPLY_BUTTON'),ls),this['applyButton']['bind']('isEnabled')['to'](this),this['items']['add'](this['applyButton'])),_0x215153&&(this['suggestButton']=this['_createButton'](cs(_0x31a7e1,'AI_BALLOON_SUGGEST_BUTTON'),_0x5c78c6?us:ls),this['suggestButton']['bind']('isEnabled')['to'](this),this['items']['add'](this['suggestButton'])),this['setButtonsVisibility']({'showApplyButton':_0x5c78c6,'showSuggestButton':_0x215153}),this['extendTemplate']({'attributes':{'class':['ck-ai-balloon__toolbar']}});}['setButtonsVisibility']({showApplyButton:_0x1863d0,showSuggestButton:_0x221fc2}){this['applyButton']&&(this['applyButton']['isVisible']=_0x1863d0),this['suggestButton']&&(this['suggestButton']['isVisible']=_0x221fc2);}['_createButton'](_0x5bf6e2,_0x73767d){const _0x365f7a=new kt(this['locale']);return _0x365f7a['set']({'label':_0x5bf6e2,'class':_0x73767d,'isVisible':!0x0,'withText':!0x0}),_0x365f7a;}}class $a extends Nt{constructor(_0x10c0ac){super(_0x10c0ac),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-balloon__disclaimer']},'children':[{'tag':'p','attributes':{'class':['ck','ck-ai-balloon__disclaimer-content']},'children':[{'text':cs(_0x10c0ac,'AI_DISCLAIMER_TEXT')}]}]});}}class qa extends Nt{constructor(_0x50c7bd){super(_0x50c7bd),this['set']('isVisible',!0x0);const _0x45b36e=new Rn('small');_0x45b36e['isVisible']=!0x0;const _0x393519=new Nt(this['locale']);_0x393519['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-suggestion__loader-text']},'children':[cs(this['locale'],'AI_CHAT_IS_WRITING')]}),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__loader',this['bindTemplate']['if']('isVisible','ck-hidden',_0x7e47e3=>!_0x7e47e3)]},'children':[_0x45b36e,_0x393519]});}}class Qa extends Ca{['focusCycler'];['_config'];['_contentWrapper'];['_streamableContentView'];['_toolbarView'];['_miniToolbarView'];['_loaderView'];['_disclaimerView'];['_focusTracker'];['_keystrokes'];['_dialogContent'];['_focusables'];['_scrollManager'];['_navigationPreviousButton'];['_navigationNextButton'];['_navigationTryAgainButton'];['_navigationCounter'];constructor(_0x34de38,_0x33d488){super(_0x34de38),this['set']('isBusy',!0x1),this['set']('isTrackChangesOn',!0x1),this['set']('_isLoading',!0x1),this['set']('_hasError',!0x1),this['_config']=_0x33d488,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 _0x25ec1a(),this['_addContentWrapper'](_0x33d488),this['_addDisclaimerView'](),this['_addToolbar'](_0x33d488),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'](_0x33d488);});}['render'](){super['render']();for(const _0x3374d1 of this['_focusables'])this['_focusTracker']['add'](_0x3374d1['element']);this['_keystrokes']['listenTo'](this['element']),this['_initializeScrollManager']();}['destroy'](){super['destroy'](),this['_scrollManager']&&this['_scrollManager']['destroy']();}['focus'](_0xba1af0){-0x1===_0xba1af0?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}['setIsLoading'](_0x476cc2){this['_isLoading']=_0x476cc2;}['setErrorState'](){this['_hasError']=!0x0,this['_miniToolbarView']['toggleShowChangesEnabled'](!0x1);}['clearErrorState'](){this['_hasError']=!0x1,this['_miniToolbarView']['toggleShowChangesEnabled'](!0x0);}['showError'](_0x1b04bf){super['showError'](_0x1b04bf),this['_dialogContent']['has'](this['_errorView'])||this['_dialogContent']['add'](this['_errorView'],0x0);}['hideError'](){super['hideError'](),this['clearErrorState']();}['showBlockingError'](_0x15bbd9){super['showBlockingError'](_0x15bbd9),this['setErrorState']();}['addMiniToolbarItem'](_0x399771){this['_miniToolbarView']['items']['has'](_0x399771)||this['_miniToolbarView']['items']['add'](_0x399771);}['removeMiniToolbarItem'](_0x524a5a){this['_miniToolbarView']['items']['has'](_0x524a5a)&&this['_miniToolbarView']['items']['remove'](_0x524a5a);}['showLoader'](){this['_loaderView']&&(this['_isLoading']=!0x0);}['hideLoader'](){this['_loaderView']&&(this['_isLoading']=!0x1);}['_toggleToolbarButtonsVisibility']({showApplyButton:_0x208cd9,showSuggestButton:_0x1f67d0}){_0x208cd9=_0x208cd9&&!this['isTrackChangesOn']&&this['_config']['availableActions']['includes']('applySuggestion'),_0x1f67d0=_0x1f67d0&&this['_config']['availableActions']['includes']('insertSuggestion'),this['_toolbarView']['setButtonsVisibility']({'showApplyButton':_0x208cd9,'showSuggestButton':_0x1f67d0});}async['updateContent'](_0x55b0b3){await this['_streamableContentView']['update'](_0x55b0b3);}['clearContent'](){this['_streamableContentView']['clear']();}['_addContentWrapper'](_0x503042){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'](_0x503042['miniToolbarConfig'])]}),this['_dialogContent']['add'](this['_contentWrapper']);}['_addDisclaimerView'](){this['_disclaimerView']=new $a(this['locale']),this['_dialogContent']['add'](this['_disclaimerView']);}['_addToolbar']({showApplyButton:_0x3c241b,showSuggestButton:_0x113cb5}){this['_toolbarView']=new Ya(this['locale'],_0x3c241b,_0x113cb5),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',(_0x5a3ee3,_0x2894e5,_0x185020)=>!(_0x5a3ee3||_0x2894e5||_0x185020)),this['_toggleToolbarButtonsVisibility']({'showApplyButton':_0x3c241b,'showSuggestButton':_0x113cb5}),this['_dialogContent']['add'](this['_toolbarView']);}['_createMiniToolbar'](_0x30b7cb){return this['_miniToolbarView']=new Sa(this['locale'],_0x30b7cb),this['_miniToolbarView']['delegate'](...js)['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',(_0x5ae081,_0x19e7bd)=>!(_0x5ae081||_0x19e7bd)),this['_miniToolbarView'];}['_createLoaderView'](){return this['_loaderView']=new qa(this['locale']),this['_loaderView']['bind']('isVisible')['to'](this,'_isLoading'),this['_loaderView'];}['_createStreamableContentView'](){return this['_streamableContentView']=new An(this['locale']),this['_streamableContentView'];}['_setupMiniToolbarButtons'](){const _0x155dde=new kt(this['locale']),_0x200f50=new kt(this['locale']),_0x6e9645=new Xa(this['locale']),_0x33bb0c=new kt(this['locale']);_0x155dde['set']({'icon':tt,'label':cs(this['locale'],'AI_ACTIONS_TRY_AGAIN'),'tooltip':!0x0,'class':'ck-ai-custom-action-button\x20'+ds}),_0x200f50['set']({'icon':_0x1b2d41,'tooltip':cs(this['locale'],'AI_ACTIONS_PREVIOUS_INTERACTION'),'class':'ck-ai-navigation-button\x20ck-ai-previous-button\x20'+ds}),_0x33bb0c['set']({'icon':et,'tooltip':cs(this['locale'],'AI_ACTIONS_NEXT_INTERACTION'),'class':'ck-ai-navigation-button\x20ck-ai-next-button\x20'+ds}),_0x155dde['bind']('isEnabled')['to'](this,'isBusy',_0x544c13=>!_0x544c13),_0x155dde['on']('execute',()=>{this['fire']('tryAgain');}),_0x200f50['bind']('isEnabled')['to'](this,'isBusy',_0x42ecda=>!_0x42ecda),_0x200f50['on']('execute',()=>{this['fire']('showPrevious');}),_0x33bb0c['bind']('isEnabled')['to'](this,'isBusy',_0x1d35c4=>!_0x1d35c4),_0x33bb0c['on']('execute',()=>{this['fire']('showNext');}),this['_navigationPreviousButton']=_0x200f50,this['_navigationCounter']=_0x6e9645,this['_navigationNextButton']=_0x33bb0c,this['_navigationTryAgainButton']=_0x155dde;}['updateMiniToolbarButtons'](_0xd69461,_0x2fbbf1){this['_navigationPreviousButton']||this['_setupMiniToolbarButtons']();const _0x4ff74f=_0xd69461>0x1;if(this['addMiniToolbarItem'](this['_navigationTryAgainButton']),_0x4ff74f){this['addMiniToolbarItem'](this['_navigationPreviousButton']),this['addMiniToolbarItem'](this['_navigationCounter']),this['addMiniToolbarItem'](this['_navigationNextButton']);const _0x5d77eb=_0xd69461-_0x2fbbf1;this['_navigationCounter']['setInteractionCount'](_0x5d77eb+'/'+_0xd69461),this['_navigationPreviousButton']['isEnabled']=_0x2fbbf1<_0xd69461-0x1,this['_navigationNextButton']['isEnabled']=_0x2fbbf1>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'](_0x3f77b9){this['_isLoading']=_0x3f77b9;}['resetShowChangesButton'](){this['_miniToolbarView']['isShowChangesOn']=!0x1;}['_initializeScrollManager'](){const _0x2931cf=this['_getScrollableElement']();_0x2931cf&&!this['_scrollManager']&&(this['_scrollManager']=new Jn(_0x2931cf));}['_getScrollableElement'](){return this['_streamableContentView']['element'];}}class Xa extends Nt{constructor(_0x4ec0c6){super(_0x4ec0c6);const _0xbd1112=this['bindTemplate'];this['set']('interactionCount','1/1'),this['setTemplate']({'tag':'span','attributes':{'class':['ck-ai-interaction-counter']},'children':[{'text':_0xbd1112['to']('interactionCount')}]});}['setInteractionCount'](_0x16f9af){this['set']('interactionCount',_0x16f9af);}}class za extends _0x432272{static get['requires'](){return[hs,Vt,zs,fa,_0x39f273];}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(_0xb2339d){super(_0xb2339d),this['_bodyCollection']=new qt(this['editor']['locale']),this['_bodyCollection']['attachToDom'](),this['_aiConnector']=this['editor']['plugins']['get']('AIConnector'),this['set']('isBusy',!0x1),this['_promiseQueue']=new In();}['stopInteraction'](){this['_stopInteraction']();}async['executeAction'](_0x3507bc,_0x125d61,_0x4cc88e){if(this['_stopInteraction'](),this['editor']['plugins']['has']('TableSelection')){if(this['editor']['plugins']['get']('TableSelection')['getSelectedTableCells']()){const {modelFragment:_0x539a61,anchorData:_0x2083b4}=this['_getExecuteDataInTable']();return this['_executeAction'](_0x3507bc,_0x539a61,_0x2083b4,_0x125d61,_0x4cc88e);}}const {modelFragment:_0x3e9587,anchorData:_0x30f6ad}=this['_getExecuteDataRegular']();return this['_executeAction'](_0x3507bc,_0x3e9587,_0x30f6ad,_0x125d61,_0x4cc88e);}async['destroy'](){return this['_stopInteraction'](),this['_bodyCollection']['detachFromDom'](),super['destroy']();}['_createActionsBalloonView'](){const _0xf91784=this['editor']['plugins']['has']('TrackChanges');let _0x301248=this['editor']['config']['get']('ai.availableReplyActions')||[...pn];_0xf91784||(_0x301248=_0x301248['filter'](_0x1803e0=>'insertSuggestion'!=_0x1803e0));const _0x3c16a9=this['editor']['commands']['get']('trackChanges'),_0x4ad4d2=new Qa(this['editor']['locale'],{'showApplyButton':!0x0,'showSuggestButton':_0xf91784,'miniToolbarConfig':{'showChanges':'icon'},'availableActions':_0x301248});return _0x4ad4d2['bind']('isBusy')['to'](this),_0x3c16a9&&_0x4ad4d2['bind']('isTrackChangesOn')['to'](_0x3c16a9,'value'),_0x4ad4d2['on']('tryAgain',()=>{this['_refreshInteraction']();}),_0x4ad4d2['on']('showPrevious',()=>{this['_navigateToPrevious']();}),_0x4ad4d2['on']('showNext',()=>{this['_navigateToNext']();}),_0x4ad4d2;}['_getExecuteDataRegular'](){const _0x36c885=this['editor']['model']['document']['selection'];if(_0x36c885['isCollapsed']){const _0x4e792d=gt(_0x36c885['getSelectedBlocks']())||this['editor']['model']['schema']['getLimitElement'](_0x36c885);this['editor']['model']['change'](_0x336d34=>{_0x336d34['setSelection'](_0x4e792d,'in');});}const _0x5d2bda=_0x36c885['getFirstRange'](),_0xd69314=this['_wrapWithCommonAncestors'](this['editor']['model']['getSelectedContent'](_0x36c885),_0x5d2bda['start'],_0x5d2bda['end']);this['_copyMarkersToFragment'](_0xd69314,_0x36c885,{'isTableSelection':!0x1});const _0x441c9d=_0x36c885['getFirstRange']()['start'],_0x427b7d=new Map();let _0x46489a=_0xd69314;for(let _0x3dd883=0x0;_0x3dd883<_0x441c9d['path']['length'];_0x3dd883++)_0x427b7d['set'](_0x46489a,_0x441c9d['path'][_0x3dd883]),_0x46489a=_0x46489a['getChild'](0x0);return{'modelFragment':_0xd69314,'anchorData':_0x427b7d};}['_getExecuteDataInTable'](){const _0x4bf441=this['editor']['model']['document']['selection'],_0x108e51=this['editor']['plugins']['get']('TableSelection')['getSelectionAsFragment'](),_0x5ab2e1=_0x4bf441['getFirstRange']()['start']['parent']['parent'],_0x367e02=this['editor']['model']['createRange'](this['editor']['model']['createPositionBefore'](_0x5ab2e1),this['editor']['model']['createPositionAfter'](_0x5ab2e1)),_0x388bd0=this['_wrapWithCommonAncestors'](_0x108e51,_0x367e02['start'],_0x367e02['end']);this['_copyMarkersToFragment'](_0x388bd0,_0x4bf441,{'isTableSelection':!0x0});const _0x2486e4=_0x4bf441['getFirstRange']()['start'],_0xb2e65a=new Map();let _0x2ab6f9=_0x388bd0;for(let _0x1a5594=0x0;_0x1a5594<_0x2486e4['path']['length'];_0x1a5594++)if(_0xb2e65a['set'](_0x2ab6f9,_0x2486e4['path'][_0x1a5594]),_0x1a5594<_0x2486e4['path']['length']-0x1)_0x2ab6f9=_0x2ab6f9['getChild'](0x0);else{let _0x3dfad8=_0x2ab6f9['nextSibling'];for(;_0x3dfad8;)_0xb2e65a['set'](_0x3dfad8,_0x2486e4['path'][_0x1a5594]),_0x3dfad8=_0x3dfad8['nextSibling'];}return{'modelFragment':_0x388bd0,'anchorData':_0xb2e65a};}async['_executeAction'](_0x57e87c,_0x4439d7,_0x1b6de5,_0x31b5a4,_0xae04e9){const _0x37dba0=this['editor']['plugins']['get'](zs),_0x5530a7=this['editor']['plugins']['get'](fa),_0x195837=this['editor']['model']['document']['selection'],_0x418fe0=await _0x37dba0['modelToDataWithIds'](_0x4439d7),_0x5959af=this['editor']['model']['document']['version'],_0x319048=[..._0x195837['getRanges']()];return this['_actionsBalloonView']||(this['_actionsBalloonView']=this['_createActionsBalloonView']()),this['_clearInteractionHistory'](),this['_clearErrorState'](),this['_balloonShowDiff']=!0x1,this['_actionsBalloonView']['resetShowChangesButton'](),this['_actionsBalloonView']['clearContent'](),_0x5530a7['open']({'index':0x3e8*Math['random']()%0x3e8,'title':_0x31b5a4,'icon':_0xae04e9||_0x3210e9,'mainView':this['_actionsBalloonView'],'class':'ck-ai-actions-balloon','ranges':_0x319048,'id':'aiActionsBalloon'}),this['_setLoadingState'](),this['stopListening'](this['_actionsBalloonView']),this['stopListening'](_0x5530a7),this['_interactionParams']={'action':_0x57e87c,'content':_0x418fe0,'version':_0x5959af,'aiBalloon':_0x5530a7,'modelFragment':_0x4439d7,'anchorData':_0x1b6de5},this['_setupApplyListeners'](),this['listenTo'](_0x5530a7,'selectionRemoved',()=>{this['_stopInteraction'](),this['_actionsBalloonView']['disableMiniToolbarButtons']();}),this['listenTo'](_0x5530a7,'dialogClosed',(_0x2cb1e3,{id:_0x3f4f48})=>{if('aiActionsBalloon'===_0x3f4f48){if(this['_interaction']&&this['_interaction']['replies']['length']>0x0){const _0x38f5d0=this['_interaction']['replies'][this['_interaction']['replies']['length']-0x1],_0x21ebd0=_0x38f5d0['changeGroups'][0x0];_0x21ebd0&&'pending'===_0x21ebd0['state']&&_0x38f5d0['setChangeGroupState'](0x0,'rejected');}this['_stopInteraction'](),this['_clearInteractionHistory'](),this['stopListening'](this['_actionsBalloonView']),this['stopListening'](_0x5530a7);}}),this['_createInteraction'](_0x418fe0,_0x5959af,_0x5530a7,_0x57e87c);}['_setupApplyListeners'](){if(!this['_interactionParams'])return;const {modelFragment:_0x3e6a0d,anchorData:_0x51b49a}=this['_interactionParams'];this['listenTo'](this['_actionsBalloonView'],'applySuggestion',()=>{this['_applyChanges'](_0x3e6a0d,_0x51b49a,!0x1);}),this['listenTo'](this['_actionsBalloonView'],'insertSuggestion',()=>{this['_applyChanges'](_0x3e6a0d,_0x51b49a,!0x0);});}['_wrapWithCommonAncestors'](_0x216725,_0x491862,_0xbc9c88){const _0x248b1b=this['editor']['model']['createRange'](_0x491862,_0xbc9c88)['getCommonAncestor'](),_0x978a5c=_0x248b1b['is']('documentFragment')?[]:_0x248b1b['getAncestors']({'includeSelf':!0x0})['slice'](0x1);if(_0x978a5c['length']){const _0x50ffb9=_0x978a5c['map'](_0x177b21=>_0x177b21['_clone'](!0x1));for(let _0x32aeda=0x1;_0x32aeda<_0x50ffb9['length'];_0x32aeda++)_0x50ffb9[_0x32aeda-0x1]['_appendChild'](_0x50ffb9[_0x32aeda]);return _0x50ffb9[_0x50ffb9['length']-0x1]['_appendChild'](_0x216725),new _0xdf7d9d(_0x50ffb9[0x0]);}return _0x216725;}['_copyMarkersToFragment'](_0x84c141,_0x531ec9,_0x27ae61={'isTableSelection':!0x1}){const _0x211b06=this['editor']['model'],_0x2ffe6f=Array['from'](_0x531ec9['getRanges']()),_0x4509ff=_0x531ec9['getFirstRange']()['start'];for(const _0x380ecc of _0x211b06['markers']){if(_0x380ecc['name']['startsWith'](Xs)||!_0x380ecc['affectsData'])continue;const _0x5bbff9=_0x380ecc['getRange']();if(!_0x2ffe6f['some'](_0x4b96f9=>_0x4b96f9['containsRange'](_0x5bbff9,!0x0)))continue;const _0x3b8b22=this['_regularCalculateMarkerPath'](_0x5bbff9['start'],_0x4509ff,_0x27ae61['isTableSelection']),_0x2faf13=this['_regularCalculateMarkerPath'](_0x5bbff9['end'],_0x4509ff,_0x27ae61['isTableSelection']),_0x2e9571=_0x211b06['createPositionFromPath'](_0x84c141,_0x3b8b22),_0x557fd9=_0x211b06['createPositionFromPath'](_0x84c141,_0x2faf13);if(!_0x2e9571['isEqual'](_0x557fd9)){const _0x47b141=_0x211b06['createRange'](_0x2e9571,_0x557fd9);_0x84c141['markers']['set'](_0x380ecc['name'],_0x47b141);}}}['_regularCalculateMarkerPath'](_0x5ed513,_0xf4fceb,_0x5ac42b=!0x1){const _0x46d9be=[..._0x5ed513['path']['slice']()];for(let _0x113012=0x0;_0x113012<Math['max'](_0xf4fceb['path']['length'],_0x5ed513['path']['length']);_0x113012++){const _0x10cd58=_0xf4fceb['path'][_0x113012]||0x0,_0x590dd3=(_0x5ed513['path'][_0x113012]||0x0)-_0x10cd58;if(_0x46d9be[_0x113012]=_0x590dd3,0x0!==_0x590dd3&&!_0x5ac42b)break;}return _0x46d9be;}async['_createInteraction'](_0x5a369a,_0x1f725c,_0x263b73,_0x30d871){const _0x127662=this['editor'];this['_interactionParams']||(this['_interactionParams']={'action':_0x30d871,'content':_0x5a369a,'version':_0x1f725c,'aiBalloon':_0x263b73,'modelFragment':this['editor']['model']['getSelectedContent'](this['editor']['model']['document']['selection']),'anchorData':new Map()});const _0x355361=new Wa({'connector':this['_aiConnector'],'editor':_0x127662,'content':_0x5a369a,'version':_0x1f725c,..._0x30d871});this['_interactions']['push'](_0x355361);const _0x98c128=(_0x36db11,_0x310d13=!0x1,_0x503d95='streaming')=>this['_promiseQueue']['enqueue'](async _0x1c7ec0=>{try{const _0x559c52=Os({'editor':_0x127662,'changeGroups':_0x36db11['changeGroups'],'documentContextContent':_0x36db11['documentContextContent'],'showDiff':_0x310d13,'trimUnchanged':!0x1});_0x559c52['length']&&await this['_actionsBalloonView']['updateContent']({'part':_0x559c52[0x0],'renderingStrategy':_0x503d95,'abortSignal':_0x1c7ec0});}catch(_0x4a397d){if(this['_isAbortError'](_0x4a397d))return;throw _0x4a397d;}});this['_interaction']['on']('replyCreated',(_0x20f7af,_0x364963)=>{this['_actionsBalloonView']['hideLoader'](),this['_actionsBalloonView']['startAutoScroll'](),_0x98c128(_0x364963)['catch'](_0x9253fa=>{this['_isAbortError'](_0x9253fa)||(console['error']('Error\x20updating\x20content\x20in\x20replyCreated:',_0x9253fa),this['_setErrorState'](_0x355361));});}),this['_interaction']['on']('replyContentUpdated',(_0x5c621b,_0x4e6583)=>{_0x98c128(_0x4e6583)['catch'](_0xe45652=>{this['_isAbortError'](_0xe45652)||(console['error']('Error\x20updating\x20content\x20in\x20replyContentUpdated:',_0xe45652),this['_setErrorState'](_0x355361));});}),this['_interaction']['on']('interactionFinished',async()=>{try{await this['_clearLoadingState'](),this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']),await this['_promiseQueue']['queueEmptyPromise'];}catch(_0x72bcb1){this['_isAbortError'](_0x72bcb1)||(console['error']('Error\x20clearing\x20loading\x20state\x20in\x20interactionFinished:',_0x72bcb1),this['_setErrorState'](_0x355361));}finally{this['_actionsBalloonView']['stopAutoScroll']();}}),this['listenTo'](this['_actionsBalloonView'],'toggleSuggestionDisplayMode',async(_0x1349e6,{showDiff:_0x3e0263})=>{try{this['_balloonShowDiff']=_0x3e0263;const _0x54668e=this['_interaction']['replies'][this['_interaction']['replies']['length']-0x1];_0x54668e&&await _0x98c128(_0x54668e,_0x3e0263,'static');}catch(_0x157980){this['_isAbortError'](_0x157980)||(console['error']('Error\x20updating\x20content\x20in\x20toggleSuggestionDisplayMode:',_0x157980),this['_setErrorState'](_0x355361));}}),this['_interaction']['on']('replyChangeGroupStateUpdated',(_0x5869b0,{reply:_0x576650})=>{const _0x43078d={'positiveCount':_0x576650['changeGroups']['filter'](_0x52fa35=>'accepted'===_0x52fa35['state'])['length'],'totalCount':_0x576650['changeGroups']['length']},_0x1b6438=this['_interaction']['actionCallId'],_0x2d55af=this['_interaction']['actionName'];_0x2d55af?this['_aiConnector']['upsertAIActionRating'](_0x2d55af,_0x1b6438,_0x43078d):this['_aiConnector']['upsertCustomAIActionRating'](_0x1b6438,_0x43078d);}),this['_setLoadingState']();try{const _0x4aac2d=await this['_interaction']['start']();return this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']),_0x4aac2d;}catch(_0x348e61){if(this['_isAbortError'](_0x348e61))return;this['_actionsBalloonView']['hideLoader'](),this['_setErrorState'](_0x355361);}}['_applyChanges'](_0x14fdac,_0x223104,_0x16b637){const _0x7590ea=this['editor'];if(_0x16b637&&!_0x7590ea['plugins']['has']('TrackChanges'))throw new ot('ai-no-track-changes',null);const _0x4566f2=this['editor']['plugins']['get'](_0x39f273),_0x5b83dc=this['_interactions'][this['_interactions']['length']-0x1-this['_currentInteractionIndex']];if(!_0x5b83dc||!_0x5b83dc['replies']['length'])return;const _0x12e89b=_0x5b83dc['replies'][_0x5b83dc['replies']['length']-0x1],_0x4b60f5=_0x12e89b['changeGroups'];_0x12e89b['setChangeGroupState'](0x0,'accepted');let _0x1d2447=$s({'editor':_0x7590ea,'reply':_0x12e89b,'interaction':_0x5b83dc,'groups':_0x4b60f5,'transform':!0x1,'documentCompare':_0x4566f2,'documentCompareOptions':{'anchor':_0x7590ea['model']['createPositionAt'](_0x14fdac,0x0),'markDeletions':_0x16b637}});_0x1d2447=this['_filterOperationsOutsideRange'](_0x1d2447,_0x223104);for(const _0xcc648a of _0x1d2447)this['_anchorOperation'](_0x223104,_0xcc648a,_0x7590ea['model']['document']['getRoot']());const _0x43bfd6=_0x5b83dc['getDocumentContext']()['version'],_0x2edd54=_0x7590ea['model']['document']['history']['getOperations'](_0x43bfd6),_0x4ae872={'document':_0x7590ea['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1},_0x52d6dd=_0x580dcc(_0x1d2447,_0x2edd54,_0x4ae872)['operationsA'];_0x7590ea['model']['change'](_0x529ebd=>{if(_0x529ebd['setSelection'](_0x7590ea['model']['document']['selection']['focus']),_0x16b637)_0x7590ea['plugins']['get']('TrackChangesEditing')['_applyOperationsAsSuggestions'](_0x52d6dd);else{for(const _0x685650 of _0x52d6dd)_0x685650['baseVersion']=_0x7590ea['model']['document']['version'],qs(_0x7590ea,_0x685650),_0x529ebd['batch']['addOperation'](_0x685650),_0x7590ea['model']['applyOperation'](_0x685650);}}),this['editor']['plugins']['get']('AIBalloon')['close']();}['_filterOperationsOutsideRange'](_0x385943,_0x5684c6){return _0x385943['filter'](_0x4c1530=>{if('rename'==_0x4c1530['type']){const _0x1ea012=_0x4c1530['position']['nodeAfter'];return!_0x5684c6['has'](_0x1ea012);}if(_0x4c1530['type']['indexOf']('Attribute')>-0x1){const _0xc3a9d5=_0x4c1530['range']['start']['nodeAfter'];return!_0x5684c6['has'](_0xc3a9d5);}return!0x0;});}['_anchorOperation'](_0x1a1964,_0x341c65,_0x52b82d){const _0x525ad6=_0x341c65['clone']();for(const _0x595781 in _0x341c65){const _0x59c8b8=_0x341c65[_0x595781];_0x59c8b8 instanceof _0x42ff50?_0x341c65[_0x595781]=new _0x42ff50(_0x51272d(_0x59c8b8['start']),_0x51272d(_0x59c8b8['end'])):_0x59c8b8 instanceof _0x493592&&(_0x341c65[_0x595781]=_0x51272d(_0x59c8b8));}if(['insert','move','remove','reinsert','split','merge']['includes'](_0x525ad6['type'])){if(_0x525ad6['isDocumentOperation']=!0x1,_0x525ad6['baseVersion']=null,'remove'==_0x525ad6['type']){const _0x52e26c=_0x525ad6['sourcePosition'],_0x101493=_0x525ad6['howMany'];new _0x338816(_0x52e26c,_0x101493)['_execute']();}else _0x525ad6['_execute']();}function _0x51272d(_0x47767d){if('$graveyard'==_0x47767d['root']['rootName'])return _0x47767d;const _0x3a40e4=[];let _0x2322fc=_0x47767d['root'];for(let _0x38c3d3=0x0;_0x38c3d3<_0x47767d['path']['length'];_0x38c3d3++){const _0x1f938b=_0x1a1964['get'](_0x2322fc)||0x0;_0x3a40e4[_0x38c3d3]=_0x47767d['path'][_0x38c3d3]+_0x1f938b,_0x2322fc=_0x2322fc['getChildAtOffset'](_0x47767d['path'][_0x38c3d3]);}return new _0x493592(_0x52b82d,_0x3a40e4,_0x47767d['stickiness']);}}['_refreshInteraction'](){if(!this['_interactionParams'])return;this['_interactions']['length']>0x0&&this['_stopInteraction'](),this['_currentInteractionIndex']=0x0,this['_balloonShowDiff']=!0x1;const {action:_0x246e2d,content:_0x21de41,version:_0x29b3d6,aiBalloon:_0x3468b3}=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'](_0x21de41,_0x29b3d6,_0x3468b3,_0x246e2d)['catch'](_0xbda181=>{this['_isAbortError'](_0xbda181)||console['error']('Error\x20refreshing\x20interaction:',_0xbda181);});}['_isAbortError'](_0x1750f3){return!!_0x1750f3['message']&&_0x1750f3['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 _0x428b3b=this['_interactions']['length'];this['_currentInteractionIndex']<_0x428b3b-0x1&&this['_displayInteractionAtIndex'](this['_currentInteractionIndex']+0x1);}['_navigateToNext'](){this['_currentInteractionIndex']>0x0&&this['_displayInteractionAtIndex'](this['_currentInteractionIndex']-0x1);}async['_displayInteractionAtIndex'](_0x23f2a0){if(!this['_interactionParams'])return;this['_currentInteractionIndex']=_0x23f2a0;const _0x4ba7c6=this['_interactions'][this['_interactions']['length']-0x1-this['_currentInteractionIndex']];if(!_0x4ba7c6)return;if(_0x4ba7c6['hasError'])return this['_setErrorState'](_0x4ba7c6),void this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']);if(!_0x4ba7c6['replies']['length'])return;this['_actionsBalloonView']['hideError'](),this['_interactionParams']&&this['_clearErrorState']();const _0x8420dd=_0x4ba7c6['replies'][_0x4ba7c6['replies']['length']-0x1];if(_0x8420dd){const _0x2ce724=this['editor'];try{const _0x2f85d3=Os({'editor':_0x2ce724,'changeGroups':_0x8420dd['changeGroups'],'documentContextContent':_0x8420dd['documentContextContent'],'showDiff':this['_balloonShowDiff'],'trimUnchanged':!0x1});await new Promise(_0x180258=>setTimeout(_0x180258,0x32)),await this['_actionsBalloonView']['updateContent']({'part':_0x2f85d3[0x0],'renderingStrategy':'static','abortSignal':new AbortController()['signal']});}catch(_0x10d77a){this['_isAbortError'](_0x10d77a)||console['error']('Error\x20updating\x20content\x20during\x20navigation:',_0x10d77a);}}this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']);}['_setLoadingState'](){this['_actionsBalloonView']['setIsLoading'](!0x0),this['isBusy']=!0x0;}async['_setErrorState'](_0x4e3aa5){const _0x5838af=cs(this['editor']['locale'],'AI_ACTIONS_GENERIC_ERROR');this['_actionsBalloonView']['showError'](_0x5838af),_0x4e3aa5['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 ja extends _0x432272{static get['requires'](){return[Ba,Fa,za];}static get['pluginName'](){return'AIQuickActions';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x14cd57){super(_0x14cd57),_0x14cd57['config']['define']('ai.quickActions',{'extraCommands':[],'removeCommands':[],'isSearchEnabled':!0x0});}}class Ja extends Nt{['resultResponseView'];['acceptButtonView'];['dismissButtonView'];['infoButtonView'];['outdatedButtonView'];constructor(_0x479102,_0x2fae4c){super(_0x479102),this['id']=_0x2fae4c,this['set']('status','pending'),this['set']('changeId',_0x2fae4c),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',(_0x562a43,_0x5628e6)=>{_0x5628e6&&_0x5628e6['target']&&'A'===_0x5628e6['target']['tagName']&&_0x5628e6['preventDefault'](),this['fire']('activateChange',{'id':_0x2fae4c,'source':this,'uiInteraction':'click'});}),this['on']('mouseover',()=>{this['fire']('activateChange',{'id':_0x2fae4c,'source':this,'uiInteraction':'hover'});}),this['on']('mouseout',()=>{this['fire']('deactivateChange',{'origin':'panel','id':_0x2fae4c,'source':this});});}['setItemAsActive'](){this['isActive']=!0x0;}['setItemAsInactive'](){this['isActive']=!0x1;}['_createResultResponseView'](){const _0x34f597=new Nt(this['locale']);return _0x34f597['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',_0xad0c52=>!_0xad0c52)]}}),_0x34f597;}['_createAcceptButtonView'](){const _0x5024e1=new kt(this['locale']);return _0x5024e1['set']({'label':cs(this['locale'],'AI_REVIEW_MODE_ACCEPT_CHANGE'),'withText':!0x0}),_0x5024e1['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x2a7d99=>{this['fire']('acceptChange',{'id':this['changeId']}),_0x2a7d99['stopPropagation']();})},'attributes':{'class':[this['bindTemplate']['if']('status','ck-hidden',_0x3943a9=>'pending'!==_0x3943a9&&'accepted'!==_0x3943a9),this['bindTemplate']['if']('status',us,_0x44b9c2=>'pending'===_0x44b9c2),this['bindTemplate']['if']('status',ds,_0x1e0c7e=>'pending'!==_0x1e0c7e),this['bindTemplate']['if']('status','ck-ai_review__check-run-result-status-button',_0x4e3e01=>'accepted'===_0x4e3e01)]}}),this['on']('change:status',(_0x127b9d,_0xe2d272,_0x57a1b1)=>{_0x5024e1['isEnabled']='pending'===_0x57a1b1,'accepted'===_0x57a1b1&&(_0x5024e1['label']=cs(this['locale'],'AI_REVIEW_MODE_CHECK_STATUS_ACCEPTED'),_0x5024e1['icon']=_0x790d5c);}),_0x5024e1;}['_createDismissButtonView'](){const _0x3f9784=new kt(this['locale']);return _0x3f9784['set']({'label':cs(this['locale'],'AI_REVIEW_MODE_DISMISS_CHANGE'),'withText':!0x0}),_0x3f9784['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x2d693d=>{this['fire']('dismissChange',{'id':this['changeId']}),_0x2d693d['stopPropagation']();})},'attributes':{'class':[ds,this['bindTemplate']['if']('status','ck-hidden',_0x496bec=>'pending'!==_0x496bec&&'rejected'!==_0x496bec),this['bindTemplate']['if']('status','ck-ai_review__check-run-result-dismiss-button',_0x2364f2=>'pending'===_0x2364f2),this['bindTemplate']['if']('status','ck-ai_review__check-run-result-status-button',_0x40192f=>'rejected'===_0x40192f)]}}),this['on']('change:status',(_0x538b70,_0x34e1a9,_0x1c2ae4)=>{_0x3f9784['isEnabled']='pending'===_0x1c2ae4,'rejected'===_0x1c2ae4&&(_0x3f9784['label']=cs(this['locale'],'AI_REVIEW_MODE_CHECK_STATUS_REJECTED'),_0x3f9784['icon']=_0xbe3949);}),_0x3f9784;}['_createInfoButtonView'](){const _0x71cbf7=new kt(this['locale']);return _0x71cbf7['set']({'label':cs(this['locale'],'AI_REVIEW_MODE_LEARN_MORE'),'icon':_0x32ed68,'tooltip':!0x0,'isToggleable':!0x0,'role':'menuitemcheckbox','class':ds+'\x20ck-ai_review__check-run-result-info-button\x20ck-hidden'}),_0x71cbf7['bind']('isOn')['to'](this,'isInfoToggleOn',_0x1de3e2=>_0x1de3e2),_0x71cbf7['on']('execute',()=>{this['isInfoToggleOn']=!this['isInfoToggleOn'];}),_0x71cbf7;}['_createOutdatedButtonView'](){const _0x30f377=new kt(this['locale']);return _0x30f377['set']({'label':cs(this['locale'],'AI_REVIEW_MODE_CHECK_STATUS_OUTDATED'),'icon':it,'withText':!0x0,'isEnabled':!0x1}),_0x30f377['extendTemplate']({'attributes':{'class':[ds,'ck-ai_review__check-run-result-status-button',this['bindTemplate']['if']('status','ck-hidden',_0x4ba194=>'outdated'!==_0x4ba194)],'disabled':'disabled'}}),_0x30f377;}}class Za extends Qt{['resultItemView'];['_pinnedRectIndex']=void 0x0;['_pinnedTargetElement']=void 0x0;['_pinnedTargetChangeId']=void 0x0;constructor(_0x41b6d9,_0x12f73c){super(_0x41b6d9),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']()),_0x12f73c['add'](this);}['render'](){super['render'](),this['_setupClickOutsideHandler']();}['updateContent'](_0x54b704){this['resultItemView']['changeId']=_0x54b704['id'],this['resultItemView']['resultResponseView']['element']['innerHTML']=_0x54b704['contentDiffed'];}['showBalloon'](_0x20177e,_0x32a996,_0x371d49,_0x1c7148,_0x4cc9c5,_0x1e373e){const _0x476555=_0x32a996();if(!_0x476555)return;this['updateContent'](_0x20177e),this['show']();const _0x2c81a4=Array['from'](_0x476555['getClientRects']())['reverse'](),_0x2016ac=this['_getPointedRectIndexFromEvent'](_0x371d49,_0x2c81a4),_0x3f1226=_0x2c81a4[_0x2016ac??0x0];'click'===_0x1c7148?(this['isDiffActive']=!0x0,this['pin']({'target':()=>this['_getBestRectPositionOnClick'](_0x32a996(),_0x2016ac,_0x20177e['id'],_0x4cc9c5,_0x1e373e)||_0x3f1226})):'hover'===_0x1c7148&&(this['isDiffActive']=!0x1,this['pin']({'target':()=>this['_getBestRectPositionOnHover'](_0x32a996(),_0x2016ac,_0x20177e['id'])||_0x3f1226}));}['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 _0xa7271b=[this['element']];return this['_pinnedTargetElement']&&_0xa7271b['push'](this['_pinnedTargetElement']),_0xa7271b;},'callback':()=>{this['hide'](),this['unpin'](),this['deactivateChange'](),this['_pinnedTargetElement']=void 0x0,this['_pinnedRectIndex']=void 0x0,this['_pinnedTargetChangeId']=void 0x0;}});}['_createContentView'](){const _0x47ac78=new Nt();return this['resultItemView']=new Ja(this['locale'],''),this['resultItemView']['resultResponseView']['extendTemplate']({'attributes':{'class':['ck-content']}}),this['resultItemView']['delegate']('acceptChange','dismissChange')['to'](this),_0x47ac78['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']]}]}),_0x47ac78;}['_getBestRectPositionOnClick'](_0x8912b8,_0x47622b,_0x352da1,_0x5d3da2,_0x43f25c){if(!_0x8912b8)return null;const _0x2722c5=this['position']['replace']('arrow_',''),_0x583d49=Array['from'](_0x8912b8['getClientRects']());let _0x4f1d52,_0x1b878c=_0x583d49['reverse']();return void 0x0!==_0x47622b&&this['_isPinnedRectVisible'](_0x1b878c[_0x47622b],_0x5d3da2,_0x43f25c)?(_0x4f1d52=_0x1b878c[_0x47622b],this['_pinnedRectIndex']=_0x47622b):this['_isPinnedRectVisible'](_0x1b878c[0x0],_0x5d3da2,_0x43f25c)&&void 0x0===_0x47622b?_0x4f1d52=_0x1b878c[0x0]:(_0x1b878c='s'==_0x2722c5[0x0]?[..._0x583d49]['reverse']():_0x583d49,_0x1b878c['forEach'](_0x37d10f=>{this['_isPinnedRectVisible'](_0x37d10f,_0x5d3da2,_0x43f25c)&&(_0x4f1d52=_0x37d10f);})),this['_pinnedTargetChangeId']=_0x352da1,this['_pinnedTargetElement']=_0x8912b8,_0x4f1d52||_0x8912b8['getBoundingClientRect']();}['_getBestRectPositionOnHover'](_0x4039f9,_0x5ef736,_0x1805b0){if(!_0x4039f9)return null;const _0x35c7ca=Array['from'](_0x4039f9['getClientRects']())['reverse']();if(void 0x0===this['_pinnedRectIndex']&&void 0x0!==_0x5ef736&&this['_pinnedTargetChangeId']!==_0x1805b0)return this['_pinnedRectIndex']=_0x5ef736,this['_pinnedTargetElement']=_0x4039f9,this['_pinnedTargetChangeId']=_0x1805b0,_0x35c7ca[_0x5ef736];if(void 0x0!==this['_pinnedRectIndex']&&this['_pinnedTargetChangeId']===_0x1805b0){if(_0x4039f9!==this['_pinnedTargetElement'])return Array['from'](this['_pinnedTargetElement']['getClientRects']())['reverse']()[this['_pinnedRectIndex']];return _0x35c7ca[this['_pinnedRectIndex']];}return void 0x0!==_0x5ef736&&this['_pinnedTargetChangeId']!==_0x1805b0?(this['_pinnedRectIndex']=_0x5ef736,this['_pinnedTargetElement']=_0x4039f9,this['_pinnedTargetChangeId']=_0x1805b0,_0x35c7ca[_0x5ef736]):_0x4039f9['getBoundingClientRect']();}['_getPointedRectIndexFromEvent'](_0x58583d,_0x114d77){if(_0x58583d)for(let _0xa19729=0x0;_0xa19729<_0x114d77['length'];_0xa19729++){const _0xb67dcb=_0x114d77[_0xa19729];if(_0x58583d['clientX']>=_0xb67dcb['left']-0x3&&_0x58583d['clientX']<=_0xb67dcb['right']+0x3&&_0x58583d['clientY']>=_0xb67dcb['top']-0x3&&_0x58583d['clientY']<=_0xb67dcb['bottom']+0x3)return _0xa19729;}}['_isPinnedRectVisible'](_0x2dbc7d,_0x5ef31d,_0x2316f6){const _0xeea506=new ut(_0x2dbc7d),_0x42cd07=_0x5ef31d||document['documentElement'],_0x911cac=_0xeea506['getIntersection'](bt(_0x2316f6)),_0x251da4=new ut(_0x42cd07)['getIntersection'](_0xeea506);return!!(_0x911cac&&_0x251da4&&_0xeea506['width']>0x0);}}const to=['getReviewCheckList','runReviewCheck','abortReviewStream','toggleDiff','acceptAllChanges','leaveReviewCoreResultList','activateChange','deactivateChange','acceptChange','dismissChange','learnMore','finishReview','retryReview'];class eo extends _0x5d2433{['_mainView'];['_balloonSuggestionView'];['_bodyCollection'];static get['requires'](){return[os];}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x3234d5){super(_0x3234d5),this['_bodyCollection']=new qt(this['context']['locale']),this['_bodyCollection']['attachToDom'](),this['_mainView']=this['createMainView'](),this['_mainView']['delegate'](...to)['to'](this),this['_balloonSuggestionView']=new Za(this['context']['locale'],this['_bodyCollection']),this['_balloonSuggestionView']['delegate']('acceptChange','dismissChange','deactivateChange')['to'](this);}['init'](){const _0x31b2fd=this['context']['plugins']['get']('AITabs');this['registerTab'](_0x31b2fd);}['destroy'](){this['_bodyCollection']['detachFromDom'](),super['destroy']();}['setAvailableChecks'](_0x557e9b){if(!this['_mainView']['reviewCheckListView']['hasChecks']()){const _0x2013ab=!this['context']['config']['get']('ai.models.showModelSelector');this['_mainView']['reviewCheckListView']['setChecks'](_0x557e9b,_0x2013ab);}this['_mainView']['showReviewCheckListView']();}['showReviewCheckList'](){this['fire']('getReviewCheckList');}['showCheckRunResults'](_0x469cb7){_0x469cb7&&('error-general'!==_0x469cb7['status']?'error-chunk'!==_0x469cb7['status']?this['_mainView']['showReviewCheckResultsView']():this['showChunkErrorView']():this['showGeneralResultsErrorView']());}['showCheckRunResult'](_0xd559df){this['_mainView']['addCheckRunResult'](_0xd559df);}['showGeneralResultsErrorView'](){this['_mainView']['showGeneralResultsErrorView']();}['showGeneralReviewCoreErrorView'](_0x57b9f2){this['_mainView']['showGeneralReviewCoreErrorView'](_0x57b9f2??cs(this['context']['locale'],'AI_REVIEW_INITIALIZATION_ERROR_MESSAGE'));}['showChunkErrorView'](){this['_mainView']['showChunkErrorView']();}['setCheckResultTitle'](_0x325873,_0x59bcc5){this['_mainView']['reviewCheckResultsView']['setTitle'](_0x325873,_0x59bcc5);}['setActiveStateInResults'](_0x2805fe){this['_mainView']['reviewCheckResultsView']['getResults']()['forEach'](_0x25d7ac=>{_0x25d7ac['id']===_0x2805fe&&_0x25d7ac['setItemAsActive']();});}['resetActiveStateInResults'](){this['_mainView']['reviewCheckResultsView']['getResults']()['forEach'](_0x40132b=>_0x40132b['setItemAsInactive']());}['updateChangeState'](_0xc54aa5,_0x405b0d){'accepted'===_0x405b0d||'rejected'===_0x405b0d||'outdated'===_0x405b0d?this['_mainView']['reviewCheckResultsView']['hideResult'](_0xc54aa5,_0x405b0d):this['_mainView']['reviewCheckResultsView']['showResult'](_0xc54aa5,_0x405b0d);}['showReviewCompletedView'](){this['_mainView']['showReviewCompletedView']();}['showActionsWhenResultIsReady'](){this['_mainView']['showActionsWhenResultIsReady']();}['showNoChangesView'](){this['_mainView']['showNoChangesView']();}['hideActionsWhenResultIsReady'](){this['_mainView']['hideActionsWhenResultIsReady']();}['showChangeBalloon'](_0x2122a1,_0x3dfba0,_0x53411a,_0x418611,_0x4e322d,_0x4797c2){this['_balloonSuggestionView']['showBalloon'](_0x2122a1,_0x3dfba0,_0x53411a,_0x418611,_0x4e322d,_0x4797c2);}['hideChangeBalloon'](){this['_balloonSuggestionView']['hideBalloon']();}['hideDiffInBalloon'](){this['_balloonSuggestionView']['hideDiffInBalloon']();}['showDiffInBalloon'](){this['_balloonSuggestionView']['showDiffInBalloon']();}['getChangeElement'](_0x288099){const _0x5e4d31=this['_mainView']['reviewCheckResultsView']['getResults']()['find'](_0x1e40e5=>_0x1e40e5['id']===_0x288099);return _0x5e4d31?_0x5e4d31['element']:null;}['deactivateChange'](){this['_balloonSuggestionView']['deactivateChange']();}}class io extends Nt{constructor(_0xe26e0d){super(_0xe26e0d),this['set']('isVisible',!0x1),this['set']('errorMessage','');const _0x561462=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai_review__general-error-container',_0x561462['if']('isVisible','ck-hidden',_0x16019d=>!_0x16019d)]},'children':[{'tag':'p','attributes':{'class':'ck\x20ck-ai-notification\x20ck-ai-notification_error'},'children':[{'text':_0x561462['to']('errorMessage')}]}]});}}class so extends Nt{['reviewCoreHeader'];['generalErrorView'];['reviewCheckListView'];['reviewCheckResultsView'];['reviewCompletedView'];constructor(_0x4f1e18,_0x4531cf){super(_0x4f1e18),this['reviewCoreHeader']=_0x4531cf['header'],this['generalErrorView']=new io(_0x4f1e18),this['reviewCheckListView']=_0x4531cf['list'],this['reviewCheckListView']['delegate'](...to)['to'](this),this['reviewCheckResultsView']=_0x4531cf['results'],this['reviewCheckResultsView']['delegate'](...to)['to'](this),this['reviewCompletedView']=_0x4531cf['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'](_0x386d65){this['reviewCheckResultsView']['addResult'](_0x386d65),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'](_0x1095d1){this['generalErrorView']['set']('isVisible',!0x0),this['generalErrorView']['errorMessage']=_0x1095d1;}['showGeneralResultsErrorView'](){this['reviewCheckResultsView']['set']('isLoading',!0x1),this['showActionsWhenResultIsReady'](),this['reviewCheckResultsView']['showGeneralErrorMessage']();}['showChunkErrorView'](){this['reviewCheckResultsView']['set']('isLoading',!0x1),this['showActionsWhenResultIsReady'](),this['reviewCheckResultsView']['showChunkErrorMessage']();}}class no extends kt{constructor(_0xded046,_0x2ee58c){super(_0x2ee58c),this['set']({'label':_0xded046,'withText':!0x0,'class':ls}),this['on']('execute',()=>{this['fire']('finishReview');});}}class ro extends Pt{['_resultViews'];['_resultsHeader'];['reviewDisclaimer'];['_cancelButtonView'];['_acceptAllButtonView'];['_exitReviewButtonView'];['_toggleDiffButtonView'];['_errorMessageView'];['_finishReviewButtonView'];['_contents'];constructor(_0x4368c1,_0x2a657e){super(_0x4368c1),this['_contents']=_0x2a657e,this['_resultViews']=new _0x25ec1a(),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 ta(_0x4368c1),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 _0x54e3bb=this['_createCombinedSkeletonLoader'](),_0x10f11a=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run',_0x10f11a['if']('isLoading','ck-ai_review__check-run_loading',_0x14b479=>_0x14b479),_0x10f11a['if']('isResultReady','ck-ai_review__check-run_ready',_0x5ca912=>_0x5ca912),_0x10f11a['if']('isVisible','ck-hidden',_0x48fddc=>!_0x48fddc)]},'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',_0x546a9d=>_0x546a9d)]},'children':this['_resultViews']},_0x54e3bb]},this['reviewDisclaimer']]});}['clearResults'](){this['_resultViews']['clear']();}['getResults'](){return this['_resultViews'];}['addResult'](_0x3b1cac){const _0x559252=new Ja(this['locale'],_0x3b1cac['id']);_0x559252['delegate']('acceptChange','dismissChange','activateChange','deactivateChange')['to'](this),this['_resultViews']['add'](_0x559252),_0x559252['resultResponseView']['element']['innerHTML']=_0x3b1cac['contentDiffed'];}['hideResult'](_0x1c8a35,_0x202f24){if('pending'===_0x202f24)return;const _0x1b47ed=this['_resultViews']['find'](_0x3c6633=>_0x3c6633['id']===_0x1c8a35);_0x1b47ed&&(_0x1b47ed['status']=_0x202f24,_0x1b47ed['element']?.['classList']['add']('ck-ai_review__check-run-result_grayout'));}['showResult'](_0x5ebe39,_0x1d1093){if('pending'!==_0x1d1093)return;const _0x18412c=this['_resultViews']['find'](_0x3fec4c=>_0x3fec4c['id']===_0x5ebe39);_0x18412c&&(_0x18412c['status']=_0x1d1093,_0x18412c['element']?.['classList']['remove']('ck-ai_review__check-run-result_grayout'));}['setTitle'](_0x88467d,_0x461642){this['headerTitle']=_0x88467d,this['headerSubtitle']=_0x461642||'';}['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'],tr['aiReviewChecks']);}['_createCombinedSkeletonLoader'](){const _0x35b61d=new Nt(this['locale']),_0x2a9be3=[];for(let _0x2f46de=0x0;_0x2f46de<0x10;_0x2f46de++){const _0x143361=this['_createSkeletonLoader']();_0x143361['extendTemplate']({'attributes':{'class':['ck-ai_review__check-run-skeleton-item']}}),_0x2a9be3['push'](_0x143361);}return _0x35b61d['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-skeleton-container',this['bindTemplate']['if']('isLoading','ck-hidden',_0x5689c5=>!_0x5689c5)]},'children':_0x2a9be3}),_0x35b61d;}['_createErrorView'](){const _0x58b493=new Nt(this['locale']),_0x55afb4=new kt(this['locale']),t=this['locale']['t'];return _0x58b493['delegate']('retryReview')['to'](this),_0x55afb4['set']({'label':t('Try\x20again'),'withText':!0x0,'class':us+'\x20ck-ai_review__check-run-error-retry-button'}),_0x55afb4['on']('execute',()=>{this['fire']('retryReview');}),_0x58b493['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-error-container',this['bindTemplate']['if']('showErrorMessage','ck-hidden',_0x4cd02b=>!_0x4cd02b),this['bindTemplate']['if']('errorType','ck-ai_review__check-run-error-container_border-bottom',_0x53f909=>'chunk'===_0x53f909)]},'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',_0x5abd6c=>'chunk'===_0x5abd6c)]},'children':[{'tag':'p','attributes':{'class':['ck-ai-notification__content',this['bindTemplate']['if']('errorType','ck-hidden',_0x72537c=>'general'!==_0x72537c)]},'children':[{'text':this['_contents']['generalErrorText']}]},{'tag':'p','attributes':{'class':['ck-ai-notification__content',this['bindTemplate']['if']('errorType','ck-hidden',_0x4bb842=>'chunk'!==_0x4bb842)]},'children':[{'text':cs(this['locale'],'AI_REVIEW_MODE_CHUNK_ERROR_MESSAGE')}]}]},_0x55afb4]}),_0x58b493;}['_createCancelButtonView'](){const _0x3aa8ac=new kt(this['locale']);return _0x3aa8ac['set']({'label':cs(this['locale'],'AI_REVIEW_MODE_STOP_GENERATING'),'withText':!0x0,'class':[us+'\x20ck-ai-button-stop-generating'],'icon':_0x1455a5}),_0x3aa8ac['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isResultReady','ck-hidden',_0x31b602=>_0x31b602),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x1f9839=>_0x1f9839)]}}),_0x3aa8ac['on']('execute',()=>{this['fire']('abortReviewStream');}),_0x3aa8ac;}['_createToggleDiffButtonView'](){const _0x1313ff=new kt(this['locale']);_0x1313ff['set']({'tooltip':!0x0,'isToggleable':!0x0,'role':'menuitemcheckbox'}),_0x1313ff['bind']('isEnabled')['to'](this,'isError',_0x20a1d1=>!_0x20a1d1),_0x1313ff['extendTemplate']({'attributes':{'class':[us,'ck-ai_review__check-run-toggle-diff-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0x5f1819=>!_0x5f1819),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x5de7af=>_0x5de7af)]}});const _0x45e892=cs(this['locale'],'AI_REVIEW_MODE_HIDE_CHANGES'),_0x32a8c7=cs(this['locale'],'AI_REVIEW_MODE_SHOW_CHANGES');return _0x1313ff['bind']('isOn')['to'](this,'isToggleDiffOn',_0x2b944d=>_0x2b944d),_0x1313ff['bind']('icon')['to'](this,'isToggleDiffOn',_0x2f8e1d=>_0x2f8e1d?st:nt),_0x1313ff['bind']('label')['to'](this,'isToggleDiffOn',_0x1d834a=>_0x1d834a?_0x45e892:_0x32a8c7),_0x1313ff['on']('execute',()=>{this['isToggleDiffOn']=!this['isToggleDiffOn'],this['fire']('toggleDiff',{'on':this['isToggleDiffOn']});}),_0x1313ff;}['_createAcceptAllButtonView'](){const _0x3b1b48=new kt(this['locale']);return _0x3b1b48['set']({'label':cs(this['locale'],'AI_REVIEW_MODE_ACCEPT_ALL'),'withText':!0x0}),_0x3b1b48['bind']('isEnabled')['to'](this,'isError',_0x40f5b2=>!_0x40f5b2),_0x3b1b48['extendTemplate']({'attributes':{'class':[ls,'ck-ai_review__check-run-accept-all-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0x5980d6=>!_0x5980d6),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x56ea7c=>_0x56ea7c)]}}),_0x3b1b48['on']('execute',()=>{this['fire']('acceptAllChanges');}),_0x3b1b48;}['_createExitReviewButtonView'](){const _0x25e01b=new kt(this['locale']);return _0x25e01b['set']({'label':cs(this['locale'],'AI_REVIEW_MODE_EXIT_REVIEW'),'withText':!0x0}),_0x25e01b['extendTemplate']({'attributes':{'class':[ds,'ck-ai_review__check-run-exit-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0x3f4f6c=>!_0x3f4f6c),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x5772b4=>_0x5772b4)]}}),_0x25e01b['on']('execute',()=>{this['fire']('leaveReviewCoreResultList');}),_0x25e01b;}['_createResultHeaderView'](){const _0x39c511=new Nt(this['locale']),_0xf4a914=this['_createTitleView']();return _0x39c511['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-header',this['bindTemplate']['if']('isCompleted','ck-ai_review__review-completed-header',_0x281ef2=>_0x281ef2)]},'children':[_0xf4a914,{'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-header-buttons']},'children':[this['_cancelButtonView'],this['_acceptAllButtonView'],this['_exitReviewButtonView'],this['_toggleDiffButtonView'],this['_finishReviewButtonView']]}]}),_0x39c511;}['_createTitleView'](){const _0xf0ae2c=new Nt(this['locale']),_0x174c56=new Rn();return _0x174c56['bind']('isVisible')['to'](this,'isResultReady',_0xe0f130=>!_0xe0f130),_0xf0ae2c['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-header-title-wrapper']},'children':[_0x174c56,{'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-header-title-content',this['bindTemplate']['if']('isCompleted','ck-hidden',_0x1f9e05=>_0x1f9e05)]},'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',_0x4dca1b=>!_0x4dca1b)]},'children':[{'text':cs(this['locale'],'AI_REVIEW_MODE_FINISH_REVIEW_HEADER_TITLE')}]}]}),_0xf0ae2c;}['_createFinishReviewButtonView'](){const _0x3caa7d=new no(cs(this['locale'],'AI_REVIEW_MODE_FINISH_REVIEW_BUTTON_LABEL'),this['locale']);return _0x3caa7d['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isCompleted','ck-hidden',_0x44d0b7=>!_0x44d0b7)]}}),_0x3caa7d['delegate']('finishReview')['to'](this),_0x3caa7d;}}class ao extends Pt{['_resultsHeader'];['_finishReviewButtonView'];constructor(_0xd44cc4,_0x392650){super(_0xd44cc4),this['_finishReviewButtonView']=this['_createFinishReviewButtonView'](_0x392650['buttonText']),this['_resultsHeader']=this['_createResultHeaderView'](_0x392650['headerText']);const _0x7bdc0a=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__review-completed',_0x7bdc0a['if']('isVisible','ck-hidden',_0x325231=>!_0x325231)]},'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':_0x392650['emptyResultsText']}]}]}]});}['_createFinishReviewButtonView'](_0x13f6d9){const _0x22f71e=new no(_0x13f6d9,this['locale']);return _0x22f71e['delegate']('finishReview')['to'](this),_0x22f71e;}['_createResultHeaderView'](_0xf5ed49){const _0x394bc7=new Nt(this['locale']);return _0x394bc7['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':_0xf5ed49}]},{'tag':'div','attributes':{'class':['ck-ai_review__review-completed-header-buttons']},'children':[this['_finishReviewButtonView']]}]}),_0x394bc7;}}class oo extends Nt{['_dropdownView'];['_defaultValue'];['_defaultLabel'];constructor(_0x2700d4,_0x4112be){super(_0x2700d4),this['_defaultValue']=_0x4112be['default']||(_0x4112be['data']['length']>0x0?_0x4112be['data'][0x0]['id']:''),this['_defaultLabel']=_0x4112be['data']['find'](_0x7396ca=>_0x7396ca['id']===this['_defaultValue'])?.['label']||'',this['set']('formValue',''),this['_dropdownView']=Bt(this['locale']);const _0x160dac=this['_prepareListOptions'](_0x4112be['data']);zt(this['_dropdownView'],_0x160dac,{'role':'menu','ariaLabel':_0x4112be['label']}),this['_dropdownView']['buttonView']['set']({'label':this['_defaultLabel'],'withText':!0x0}),this['_dropdownView']['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x35601f=>{_0x35601f['stopPropagation']();})}}),this['listenTo'](this['_dropdownView'],'execute',_0x23da66=>{this['formValue']=_0x23da66['source']['model']['id'],this['_dropdownView']['buttonView']['label']=_0x23da66['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'](_0x5e073c=[]){const _0x44857f=new dt();this['resetToDefault']();for(const _0xfb06ab of _0x5e073c){const _0xcef7b3=new jt({'label':_0xfb06ab['label'],'withText':!0x0,'role':'menuitemradio','id':_0xfb06ab['id'],'model':_0xfb06ab});_0xcef7b3['bind']('isOn')['to'](this,'formValue',_0x2def34=>_0x2def34===_0xcef7b3['id']);const _0x5cf612={'type':'button','model':_0xcef7b3};_0x44857f['add'](_0x5cf612);}return _0x44857f;}}class ho extends Pt{['_formItem']=null;constructor(_0x328b3e,_0x5e3317,_0x463072){super(_0x328b3e),this['argsKey']=_0x5e3317?.['argsKey'];if('dropdown'===_0x5e3317['formType'])this['_formItem']=new oo(this['locale'],_0x5e3317);this['set']('value',''),this['bind']('value')['to'](this['_formItem'],'formValue');const _0x299126=new _0x52413c(this['locale'],{'children':[this['_formItem']],'class':[_0x463072?'ck-form__row_with-submit':'']});_0x463072&&_0x299126['children']['add'](_0x463072),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai_review__form-item','ck-reset_all']},'children':[_0x299126]});}['resetToDefault'](){this['_formItem']['resetToDefault']();}}class co extends _0x1c74d1{['keystrokes'];static ['MIN_ROWS']=0x1;static ['MAX_ROWS']=0xc;constructor(_0x222ffd){super(_0x222ffd),this['set']('isEmpty',!0x0),this['keystrokes']=new At(),this['minRows']=co['MIN_ROWS'],this['maxRows']=co['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 lo extends Nt{['focusTracker']=new _t();['keystrokes']=new At();['focusCycler'];['_focusables']=new _0x25ec1a();['submitButtonView'];['cancelButtonView'];['promptInputView'];['actionsFooterView'];['_modelSelectionDropdown'];['_modelNameView'];['_modelSelectionDropdownItems'];['_check'];['_defaultValue'];['_defaultLabel'];constructor(_0x58a295,_0x47dccf,_0x4c8af9=!0x1){super(_0x58a295),this['_check']=_0x47dccf,this['set']('prompt',''),this['set']('modelId',''),this['set']('modelDisplayMode','selector'),this['set']('activeModelName',null),this['_defaultValue']=_0x47dccf['defaultModel']?_0x47dccf['defaultModel']['id']:'',this['_defaultLabel']=_0x47dccf['defaultModel']?_0x47dccf['defaultModel']['name']:'',this['submitButtonView']=this['_createSubmitButtonView'](),this['cancelButtonView']=this['_createCancelButtonView'](),(this['promptInputView']=new Zt(this['locale'],()=>new co(_0x58a295)),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'](_0x4c8af9),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 _0x52413c(this['locale'],{'children':[this['promptInputView']]}),new _0x52413c(this['locale'],{'children':[this['actionsFooterView']]})]}),this['promptInputView']['fieldView']['keystrokes']['set']('Enter',(_0x565468,_0x487e3c)=>{this['_isValid']()?(this['fire']('runReviewCheck',{'id':'custom','args':{'prompt':this['prompt'],'model':this['modelId']},'isCustom':!0x0}),_0x487e3c()):_0x487e3c();}),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'](_0x5bdcee=>{this['_focusables']['add'](_0x5bdcee),this['focusTracker']['add'](_0x5bdcee['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 _0x4eb134 of this['_getFormValidators']()){const _0x2353fa=_0x4eb134();if(_0x2353fa)return this['promptInputView']['errorText']=_0x2353fa,!0x1;}return!0x0;}['_getFormValidators'](){return[()=>{if(0x0===this['promptInputView']['fieldView']['value']?.['trim']()['length'])return cs(this['locale'],'AI_REVIEW_MODE_PROMPT_EMPTY_ERROR');}];}['_createSubmitButtonView'](){const _0x5c0e78=new kt(this['locale']),t=this['locale']['t'];return _0x5c0e78['set']({'label':t('Submit'),'withText':!0x0,'class':ls}),_0x5c0e78['on']('execute',()=>{this['_isValid']()&&this['fire']('runReviewCheck',{'id':'custom','args':{'prompt':this['prompt'],'model':this['modelId']},'isCustom':!0x0});}),_0x5c0e78;}['_createCancelButtonView'](){const _0x1f0707=new kt(this['locale']),t=this['locale']['t'];return _0x1f0707['set']({'label':t('Cancel'),'withText':!0x0,'class':ds}),_0x1f0707['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x1cd383=>{_0x1cd383['stopPropagation']();})}}),_0x1f0707['on']('execute',()=>{this['resetToDefault'](),this['fire']('closeCustomCheck');}),_0x1f0707;}['_setModelList'](_0x5c9dbb){this['_modelSelectionDropdownItems']['clear']();const _0x266ccb=this['_check']['models'];if(_0x5c9dbb)this['set']('modelDisplayMode','hidden');else{const _0x62454=0x1===_0x266ccb['length'];this['set']('modelDisplayMode',_0x62454?'name':'selector');}if(this['resetToDefault'](),_0x266ccb?.['length']){0x1===_0x266ccb['length']&&this['set']('activeModelName',_0x266ccb[0x0]['name']||_0x266ccb[0x0]['id']);for(const _0x4ebda1 of _0x266ccb){const _0x49e61b=new jt({'label':_0x4ebda1['name'],'withText':!0x0,'role':'menuitemradio','id':_0x4ebda1['id'],'model':_0x4ebda1});_0x49e61b['bind']('isOn')['to'](this,'modelId',_0x17f417=>_0x17f417===_0x4ebda1['id']),this['_modelSelectionDropdownItems']['add']({'type':'button','model':_0x49e61b,'labelView':new _o(this['locale'],_0x4ebda1)});}}}['_createModelSelectionDropdown'](){const _0x3a08d0=Bt(this['locale']);return _0x3a08d0['set']({'panelPosition':'se','class':'ck-ai_review__check-list-item-model-dropdown'}),_0x3a08d0['buttonView']['set']({'label':this['_defaultLabel'],'withText':!0x0,'tooltip':!0x0,'class':ds}),_0x3a08d0['buttonView']['bind']('isVisible')['to'](this,'modelDisplayMode',_0x5c264b=>'selector'===_0x5c264b),this['listenTo'](_0x3a08d0,'execute',_0x523efe=>{this['modelId']=_0x523efe['source']['model']['id'],_0x3a08d0['buttonView']['label']=_0x523efe['source']['label'];}),_0x3a08d0;}['_createModelNameView'](){const _0x59765d=new uo(this['locale']);return _0x59765d['bind']('text')['to'](this,'activeModelName',_0x5070a8=>_0x5070a8??''),_0x59765d['bind']('isVisible')['to'](this,'modelDisplayMode',_0xff44f6=>'name'===_0xff44f6),_0x59765d;}['_createActionsFooterView'](){const _0x1a1425=new Nt(this['locale']);return _0x1a1425['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']]}]}),_0x1a1425;}}class uo extends Nt{constructor(_0x39221c){super(_0x39221c),this['set']('text',void 0x0),this['set']('isVisible',!0x0);const _0x2c338c=this['bindTemplate'];this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai_review__check-list-item-model-name',_0x2c338c['if']('isVisible','ck-hidden',_0x57043c=>!_0x57043c)]},'children':[{'text':_0x2c338c['to']('text')}]});}}class _o extends Ht{constructor(_0x277f44,_0x35952b){super();const _0x29fed2=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-button__label'],'style':_0x29fed2['to']('style'),'id':_0x29fed2['to']('id')},'children':[{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-model-dropdown-name']},'children':[{'tag':'span','children':[{'text':_0x29fed2['to']('text')}]}]},{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-model-dropdown-description']},'children':[{'tag':'span','children':[_0x35952b['description']||'']}]}]});}}class Ao extends Pt{['_formItemsCollection']=new _0x25ec1a();['_customCheckView']=null;['_hideModels']=!0x1;constructor(_0x3299b1,_0x466de1,_0x343d90,_0x44e5aa=!0x1){super(_0x3299b1),this['_hideModels']=_0x44e5aa,this['set']('isParametrizedViewOpen',!0x1),this['set']('isListItemRendered',!0x1),this['set']('isItemParametrized',_0x466de1['isParameterized']);const _0x46c3b0=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',_0x30012f=>_0x30012f),this['bindTemplate']['if']('isListItemRendered','ck-ai_review__check-list-item_rendered',_0xfe36c4=>_0xfe36c4)],'style':{'--ck-ai-review-check-list-item-index':_0x343d90}},'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':_0x466de1['title']}]},_0x46c3b0]},{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-description']},'children':_0x466de1['description']?[{'text':_0x466de1['description']}]:[]}]}]},..._0x466de1['isParameterized']?[this['_createParameterizedView'](_0x466de1)]:[],...'custom'===_0x466de1['id']?[this['_createCustomView'](_0x466de1,this['_hideModels'])]:[]]}),this['on']('click',()=>{_0x466de1['isParameterized']?this['isParametrizedViewOpen']=!0x0:this['fire']('runReviewCheck',{'id':_0x466de1['id'],'args':_0x466de1['useArgs']?_0x466de1['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'](_0x2e79a4=>{_0x2e79a4['resetToDefault']();}),this['_customCheckView']&&this['_customCheckView']['resetToDefault']();}['_createIconView'](){const _0x4e1e3e=new yt();return _0x4e1e3e['content']=rt,_0x4e1e3e['extendTemplate']({'attributes':{'class':['ck-ai_review__check-list-item-title-icon']}}),_0x4e1e3e;}['_createParameterizedView'](_0x3771d1){const _0x246bb9=new Nt(),_0x2d9458=this['_createFormView'](_0x3771d1);return _0x246bb9['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-parameterized',this['bindTemplate']['if']('isParametrizedViewOpen','ck-hidden',_0x322413=>!_0x322413)]},'children':[_0x2d9458]}),_0x246bb9;}['_createFormView'](_0x3e3812){const _0xcd5f57=new Nt(),_0x495be9=Array['isArray'](_0x3e3812['options'])?_0x3e3812['options']:[],_0x2b004e=new kt(this['locale']),t=this['locale']['t'];_0x2b004e['set']({'label':t('Submit'),'withText':!0x0,'class':ls}),_0x2b004e['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x1ac682=>{_0x1ac682['stopPropagation']();})}}),_0x2b004e['on']('execute',()=>{const _0x59f0b6=[],_0x29e238={};this['_formItemsCollection']['forEach'](_0x18b570=>{_0x59f0b6['push'](_0x18b570['value']),_0x3e3812['useArgs']&&_0x3e3812['options']&&(_0x29e238[_0x18b570['argsKey']]=_0x18b570['value']);}),this['fire']('runReviewCheck',{'id':_0x3e3812['id'],'params':_0x59f0b6['length']?_0x59f0b6:void 0x0,'args':Object['keys'](_0x29e238)['length']?_0x29e238:void 0x0});});const _0x3fe1be=_0x495be9['length'];return _0x495be9['forEach']((_0xcbbc27,_0x1bb32b)=>{const _0x388085=_0x1bb32b===_0x3fe1be-0x1;this['_formItemsCollection']['add'](new ho(this['locale'],_0xcbbc27,_0x388085?_0x2b004e:null));}),_0xcd5f57['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-parameterized-form']},'children':this['_formItemsCollection']}),_0xcd5f57;}['_createCustomView'](_0xaddd0,_0x978b84=!0x1){return this['_customCheckView']=new lo(this['locale'],_0xaddd0,_0x978b84),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',_0x373a96=>!_0x373a96)]}}),this['_customCheckView']['delegate']('runReviewCheck')['to'](this),this['listenTo'](this['_customCheckView'],'closeCustomCheck',()=>{this['isParametrizedViewOpen']=!0x1;}),this['on']('change:isParametrizedViewOpen',(_0x54d9c1,_0x228a73,_0x13d3c4)=>{_0x13d3c4||this['_customCheckView']['resetFormValidationStatus']();}),this['_customCheckView'];}}class go extends Pt{['_checkViews'];constructor(_0x515065){super(_0x515065),this['_checkViews']=new _0x25ec1a(),this['_setupTemplate']();}['setChecks'](_0x241047,_0x18a755=!0x1){this['_checkViews']['clear']();for(const [_0x5e5faf,_0x26ae91]of _0x241047['entries']()){const _0x40c183=new Ao(this['locale'],_0x26ae91,_0x5e5faf,_0x18a755);_0x40c183['delegate']('runReviewCheck')['to'](this),this['_checkViews']['add'](_0x40c183);}}['hasChecks'](){return this['_checkViews']['length']>0x0;}['resetAllParameterizedChecks'](){for(const _0x1c2b18 of this['_checkViews'])_0x1c2b18 instanceof Ao&&_0x1c2b18['resetToDefault']();}['_setupTemplate'](){const _0x2a1b9e=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list',_0x2a1b9e['if']('isVisible','ck-hidden',_0x2df65d=>!_0x2df65d)]},'children':this['_checkViews']});}}class Io extends eo{static get['pluginName'](){return'AIReviewModeUI';}['createMainView'](){const _0x6a003e=this['context']['locale'],_0x267726=new _0x27cd18(_0x6a003e,{'label':cs(_0x6a003e,'AI_REVIEW_MODE'),'icon':_0x34b9c0,'class':'ck-ai-header\x20ck-ai-header_review'});return new so(this['context']['locale'],{'header':_0x267726,'list':new go(_0x6a003e),'results':new ro(_0x6a003e,{'generalErrorText':cs(_0x6a003e,'AI_REVIEW_MODE_GENERAL_ERROR_MESSAGE')}),'completed':new ao(_0x6a003e,{'headerText':cs(_0x6a003e,'AI_REVIEW_MODE_FINISH_REVIEW_HEADER_TITLE'),'emptyResultsText':cs(_0x6a003e,'AI_REVIEW_MODE_EMPTY_RESULTS_TEXT'),'buttonText':cs(_0x6a003e,'AI_REVIEW_MODE_FINISH_REVIEW_BUTTON_LABEL')})});}['registerTab'](){const _0x586e4d=this['context']['plugins']['get']('AITabs');_0x586e4d['view']['on']('activateTab',(_0x1730ad,_0x971f7a)=>{'reviewMode'===_0x971f7a?this['fire']('getReviewCheckList'):this['fire']('leaveReview');}),_0x586e4d['view']['addTab']({'id':'reviewMode','buttonLabel':cs(this['context']['locale'],'AI_REVIEW_MODE'),'buttonIcon':_0x34b9c0,'order':0x0,'content':this['_mainView']});}}const Eo='review-';class po extends _0x5d2433{static get['requires'](){return[_0x39f273,zs];}static get['pluginName'](){return'AIReviewCoreEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['_markers']=new Map();['_activeMarkers']=new Set();['_domEmitter'];['_eventEmitter'];constructor(_0x4ffe5f){super(_0x4ffe5f),this['_domEmitter']=new(Rt())(),this['_eventEmitter']=new(Et())();}get['emitter'](){return this['_eventEmitter'];}['afterInit'](){const _0x3ed491=Ys(this['context']);_0x3ed491['conversion']['for']('editingDowncast')['markerToElement']({'model':Eo+'insert','view':(_0x27dc92,{writer:_0x54bf0b})=>{const _0x147e08=this['_markers']['get'](_0x27dc92['markerName']),_0x790bad={'class':'ck-ai_review-marker_add'+(this['_activeMarkers']['has'](_0x147e08?.['id']||'')?'\x20ck-ai_review__change_active':''),'data-marker-id':_0x27dc92['markerName']};return _0x54bf0b['createUIElement']('span',_0x790bad,function(_0x3f09dc){const _0x51d8f6=this['toDomElement'](_0x3f09dc);return _0x51d8f6['innerHTML']=_0x147e08?.['content']?.['asString']||'',_0x51d8f6;});}}),_0x3ed491['conversion']['for']('editingDowncast')['markerToHighlight']({'model':Eo+'remove-only','view':_0x2cf8cf=>{const _0x161aaa=this['_markers']['get'](_0x2cf8cf['markerName']),_0x38d293=['ck-ai_review-marker_strikethrough'];return this['_activeMarkers']['has'](_0x161aaa?.['id']||'')&&_0x38d293['push']('ck-ai_review__change_active'),{'classes':_0x38d293,'attributes':{'data-marker-id':_0x2cf8cf['markerName']}};}}),_0x3ed491['conversion']['for']('editingDowncast')['markerToHighlight']({'model':Eo+'remove-context','view':_0x515bfb=>{const _0x3bf342=this['_markers']['get'](_0x515bfb['markerName']),_0x229ed8=['ck-ai_review-marker_underline'];return this['_activeMarkers']['has'](_0x3bf342?.['id']||'')&&_0x229ed8['push']('ck-ai_review__change_active'),{'classes':_0x229ed8,'attributes':{'data-marker-id':_0x515bfb['markerName']}};}}),_0x3ed491['conversion']['for']('editingDowncast')['markerToHighlight']({'model':Eo+'remove-text','view':_0xe7febb=>{const _0x45c0bb=this['_markers']['get'](_0xe7febb['markerName']),_0x2b4594=['ck-ai_review-marker_hide'];return this['_activeMarkers']['has'](_0x45c0bb?.['id']||'')&&_0x2b4594['push']('ck-ai_review__change_active'),{'classes':_0x2b4594,'attributes':{'data-marker-id':_0xe7febb['markerName']}};}}),_0x3ed491['conversion']['for']('dataDowncast')['markerToElement']({'model':Eo+'suggestion-context','view':(_0x59f7df,{writer:_0x4b835b})=>_0x4b835b['createRawElement']('span',{'class':'ck-ai_review-marker_context-'+(_0x59f7df['isOpening']?'start':'end')})}),_0x3ed491['conversion']['for']('downcast')['attributeToAttribute']({'model':_0x4aa46b,'view':_0xb7ba});const _0x228cfc=_0x3ed491['ui']['getEditableElement']()||document['body'];this['_domEmitter']['listenTo'](_0x228cfc,'mouseup',(_0x3568b2,_0x2ccbd6)=>{const _0x18cd55=_0x2ccbd6['target'],_0x39bc3b=this['_findMarkerElement'](_0x18cd55);if(!_0x39bc3b)return;const _0x25ed7b=_0x39bc3b['getAttribute']('data-marker-id'),_0x95f0d0=_0x25ed7b['split'](':')['pop']()?.['split']('_')[0x0];this['_eventEmitter']['fire']('changeMarkerClicked',{'markerId':_0x25ed7b,'changeId':_0x95f0d0,'markerElement':()=>this['_findMarkerElementById'](_0x25ed7b),'domEvent':_0x2ccbd6});},{'usePassive':!0x0,'priority':'highest'}),this['_domEmitter']['listenTo'](_0x228cfc,'mouseover',(_0x49b674,_0x156bb4)=>{const _0x5b0ed6=_0x156bb4['target'],_0x424432=_0x156bb4['relatedTarget'];let _0x3b6e58=this['_findMarkerElement'](_0x5b0ed6);if(!_0x3b6e58&&_0x424432&&(_0x3b6e58=this['_findMarkerElement'](_0x424432)),!_0x3b6e58)return;const _0x2e0d49=_0x3b6e58['getAttribute']('data-marker-id'),_0x5d1ac6=_0x2e0d49['split'](':')['pop']()?.['split']('_')[0x0];this['_eventEmitter']['fire']('changeMarkerHovered',{'changeId':_0x5d1ac6,'markerElement':()=>this['_findMarkerElementById'](_0x2e0d49),'domEvent':_0x156bb4});}),this['_domEmitter']['listenTo'](document,'mouseover',_0x183bfa((_0x35a3f0,_0x1fe264)=>{const _0x1aea22=_0x1fe264['target'];if(this['_findMarkerElement'](_0x1aea22))return;_0x1aea22['closest']('.ck-reset.ck-ai_review-balloon-panel-suggestion')||this['_eventEmitter']['fire']('changeMarkerBlurred');},0xc8)),_0x3ed491['model']['document']['registerPostFixer'](_0x2944ff=>this['_validateMarkers'](_0x3ed491,_0x2944ff)),_0x3ed491['model']['document']['on']('change',()=>this['_handleMarkerChanges'](_0x3ed491));}['getDocumentData'](){const _0x11508e=this['context']['plugins']['get']('AIEditing'),_0x56c3be=Ys(this['context']),_0x261c17=_0x56c3be['model'],_0x18075e=new _0xdf7d9d();for(const _0xf3a67e of _0x261c17['document']['getRoot']()['getChildren']()){const _0x274f6f=_0xf3a67e['_clone'](!0x0);_0x18075e['_appendChild'](_0x274f6f);}for(const _0x4cf18a of _0x261c17['markers'])_0x18075e['markers']['set'](_0x4cf18a['name'],this['_changeRangeOwnerDocument'](_0x4cf18a['getRange']()['clone'](),_0x18075e));const _0x4cc20a=new _0x2d0568({'ignoreElementEnd':!0x0,'startPosition':_0x261c17['createPositionAt'](_0x18075e,0x0)}),_0x2b1bd3=new Set(),_0xc6bb24=new Map();for(const {item:_0x4d3831}of _0x4cc20a){if(!_0x4d3831['is']('$textProxy'))continue;const _0xb24598=_0x4d3831['parent'];if(_0xb24598&&_0xb24598['is']('element')){const _0x4c8a9a=this['_upsertDataId'](_0xb24598,()=>_0x11508e['_nextDataId'](_0x2b1bd3));_0x2b1bd3['add'](_0x4c8a9a);for(const _0x1277d1 of _0xb24598['getChildren']())_0x1277d1['is']('element')&&_0x2b1bd3['add'](this['_upsertDataId'](_0x1277d1,()=>_0x11508e['_nextDataId'](_0x2b1bd3)));let _0x1bf853=_0xb24598;for(;_0x1bf853['parent']&&!_0x1bf853['parent']['is']('documentFragment');)_0x1bf853=_0x1bf853['parent'],_0x1bf853['hasAttribute'](_0x4aa46b)&&_0x1bf853['_removeAttribute'](_0x4aa46b);_0xc6bb24['set'](_0x4c8a9a,{'path':_0xb24598['getPath'](),'getContent':this['_createGetContentUsingDataIdFn'](_0x1bf853['_clone'](!0x0),_0x4c8a9a,_0x56c3be['data'])}),_0x4cc20a['jumpTo'](_0x261c17['createPositionAfter'](_0xb24598));}}return{'content':_0x56c3be['data']['processor']['toData'](_0x56c3be['data']['toView'](_0x18075e)),'version':_0x56c3be['model']['document']['version'],'elements':_0xc6bb24};}['diffContent'](_0x4ea1cd,_0x186229,_0x32c3ff=!0x1){const _0x59dc16=[],_0x2a47e1=Ys(this['context']),_0x331ebb=_0x2a47e1['data']['parse'](_0x186229,'$documentFragment'),_0x23a970=_0x2a47e1['data']['parse'](_0x4ea1cd,'$documentFragment'),_0x3b0734=_0x2a47e1['model']['createPositionAt'](_0x23a970,0x0);if(this['_haveSingleTopLevelElement'](_0x331ebb)){if(!this['_hasSameTopLevelElement'](_0x23a970,_0x331ebb))return _0x59dc16;}else{const _0x560c81=_0x2a47e1['model']['schema'];if(!this['_haveOnlyInlineContent'](_0x23a970,_0x560c81)||!this['_haveOnlyInlineContent'](_0x331ebb,_0x560c81))return _0x59dc16;}const _0x3c7194=this['context']['plugins']['get']('DocumentCompare')['getDiff'](_0x4ea1cd,_0x186229,{'anchor':_0x3b0734,'markDeletions':!0x0})['getOperations']()['filter'](_0x19eb1a=>'insert'===_0x19eb1a['type']||'marker'===_0x19eb1a['type']&&_0x19eb1a['name']['startsWith']('$markedRemove')),_0x41d8ed=this['_groupAdjacentOperations'](_0x3c7194),_0x4b9793=[];if(_0x32c3ff){if(_0x41d8ed['length']){const _0x31cb64=_0x41d8ed[0x0]['operations'][0x0],_0x4069d0='insert'===_0x31cb64['type']?_0x31cb64['position']:_0x31cb64['newRange']['start'],_0x39b4bd=this['_getPositionLimitingRange'](_0x4069d0,_0x2a47e1,'inside'),_0x5b73ed=_0x39b4bd?_0x331ebb['getChild'](0x0)['getChildren']():_0x331ebb['getChildren'](),_0x1a3f6c=_0x39b4bd||_0x2a47e1['model']['createRangeIn'](_0x23a970),_0x280b95=[new _0x2a2cd9('$markedRemove:synthetic'+at(),null,_0x1a3f6c,_0x2a47e1['model']['document']['model']['markers'],!0x0,_0x2a47e1['model']['document']['version']+0x1),new _0x572aac(_0x1a3f6c['end'],_0x5b73ed,_0x2a47e1['model']['document']['version']+0x2)];_0x4b9793['push']({'operations':_0x280b95,'operationsIsolated':_0x280b95,'groupOffset':0x0});}}else _0x4b9793['push'](..._0x41d8ed);let _0x311a48=0x0;return _0x2a47e1['model']['change'](_0x4cb3b9=>{for(let _0x1e5d1b=0x0;_0x1e5d1b<_0x4b9793['length'];_0x1e5d1b++){const _0x1d899e=_0x4b9793[_0x1e5d1b],_0x426264=_0x4cb3b9['createDocumentFragment']();for(const _0x471a6c of _0x23a970['getChildren']())_0x4cb3b9['append'](_0x471a6c['_clone'](!0x0),_0x426264);for(const _0x55c96b of _0x1d899e['operationsIsolated'])if('insert'===_0x55c96b['type']){const _0xf9c6ba=_0x55c96b;_0xf9c6ba['baseVersion']=null,_0xf9c6ba['isDocumentOperation']=!0x1,this['_changeOperationOwnerDocument'](_0xf9c6ba,_0x426264),_0x4cb3b9['batch']['addOperation'](_0x55c96b),_0x2a47e1['model']['applyOperation'](_0x55c96b);const _0x55131a='suggestion:insertion:id:authorId:'+_0x311a48++,_0x337d3d=_0x2a47e1['model']['createRange'](_0xf9c6ba['position'],_0xf9c6ba['position']['getShiftedBy'](_0xf9c6ba['howMany']));_0x426264['markers']['set'](_0x55131a,_0x337d3d);}else{if('marker'===_0x55c96b['type']&&_0x55c96b['name']['startsWith']('$markedRemove')){const _0x529356=_0x55c96b,_0x2b7325='suggestion:deletion:id:authorId:'+_0x311a48++;this['_changeOperationOwnerDocument'](_0x529356,_0x426264),_0x426264['markers']['set'](_0x2b7325,_0x529356['newRange']);}}if(_0x32c3ff)_0x59dc16['push']({..._0x1d899e,'context':this['_createGetContentFn'](_0x23a970,_0x2a47e1['data']),'content':this['_createGetContentFn'](_0x23a970,_0x2a47e1['data'])});else{const _0x51dfa8=this['_getChangeContext'](this['_changePositionOwnerDocument'](this['_getOperationStart'](_0x1d899e['operationsIsolated'][0x0]),_0x426264),this['_changePositionOwnerDocument'](this['_getOperationEnd'](_0x1d899e['operationsIsolated'][_0x1d899e['operationsIsolated']['length']-0x1]),_0x426264));_0x426264['markers']['set'](Eo+'suggestion-context',new _0x42ff50(_0x51dfa8['start'],_0x51dfa8['end'])),_0x59dc16['push']({..._0x1d899e,'context':this['_createGetContextFn'](_0x426264,_0x2a47e1['data'],{'ellipsisBefore':_0x51dfa8['hasContentBefore'],'ellipsisAfter':_0x51dfa8['hasContentAfter']}),'content':this['_createGetContentFn'](_0x426264,_0x2a47e1['data'])});}}}),_0x59dc16;}['markChangePositionInEditorContent'](_0x18ff2e,_0x411206){if(!_0x18ff2e['length'])return;const _0x164abd=_0x18ff2e[0x0]['parent']['id'],_0xe1a519=_0x411206['elements']['get'](_0x164abd);if(!_0xe1a519)return void console['warn']('No\x20element\x20found\x20for\x20ID:\x20'+_0x164abd);const _0x2c7090=_0xe1a519['path'],_0x5dba40=Ys(this['context']),_0x2fab01=_0x5dba40['model']['document']['history']['getOperations'](_0x411206['version']),_0x43b2db=[];for(const _0x463360 of _0x18ff2e){const _0x53fc4a=_0x463360['operationsIsolated']['map'](_0x113c5c=>this['_translateOperationToEditorContent'](_0x113c5c,_0x2c7090,_0x5dba40['model']['document']['getRoots']()[0x0]));if(!_0x53fc4a||!_0x53fc4a['length'])continue;const _0x11b0b9=_0x53fc4a['every'](_0x13da53=>'marker'===_0x13da53['type']&&_0x13da53['name']['startsWith']('$markedRemove')),_0x8dde2={'document':_0x5dba40['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1},_0x1ed0fc=_0x580dcc(_0x53fc4a,_0x2fab01,_0x8dde2)['operationsA'];for(const _0x56c228 of _0x1ed0fc)if('insert'===_0x56c228['type']){const _0x1fbe38=_0x56c228,_0x107a98=_0x1fbe38['nodes'];_0x5dba40['model']['change'](_0x2c2868=>{const _0x4aa5f6=_0x2c2868['createDocumentFragment']();for(const _0x31e5ea of _0x107a98)_0x2c2868['append'](_0x31e5ea['_clone'](!0x0),_0x4aa5f6);_0x43b2db['push']({'start':_0x1fbe38['position'],'end':_0x1fbe38['position'],'type':'insert','groupId':_0x463360['id'],'content':{'asString':this['_createGetContentFn'](_0x4aa5f6,_0x5dba40['data'])(),'asFragment':_0x4aa5f6}});});}else{if('marker'===_0x56c228['type']&&_0x56c228['name']['startsWith']('$markedRemove')){const _0x2b6aec=_0x56c228;let _0x29060a='remove-text';if(_0x11b0b9){const _0x578d72=this['_findAdjacentContextDistance'](_0x2b6aec['newRange']['start'],'backward',_0x5dba40['model']['schema']),_0x2d0f02=this['_findAdjacentContextDistance'](_0x2b6aec['newRange']['end'],'forward',_0x5dba40['model']['schema']);if(_0x578d72||_0x2d0f02){const _0x183058=_0x2b6aec['newRange']['start']['getShiftedBy'](-_0x578d72),_0x524d88=_0x2b6aec['newRange']['end']['getShiftedBy'](_0x2d0f02);_0x43b2db['push']({'start':_0x183058,'end':_0x524d88,'groupId':_0x463360['id'],'type':'remove-context'});}else _0x29060a='remove-only';}_0x43b2db['push']({'start':_0x2b6aec['newRange']['start'],'end':_0x2b6aec['newRange']['end'],'groupId':_0x463360['id'],'type':_0x29060a});}}}this['_insertMarkers'](_0x43b2db);}['clearAllMarkers'](){const _0xd20ce4=Ys(this['context']);_0xd20ce4['model']['change'](_0x28b8f0=>{for(const _0x1c25b0 of this['_markers']['keys']())_0xd20ce4['model']['markers']['get'](_0x1c25b0)&&_0x28b8f0['removeMarker'](_0x1c25b0);}),this['_markers']['clear'](),this['_activeMarkers']['clear']();}['switchToReadOnly'](){Ys(this['context'])['enableReadOnlyMode']('ai-review');}['switchToEdit'](){Ys(this['context'])['disableReadOnlyMode']('ai-review');}['applyChange'](_0x10ce5d){const _0x54fa65=Ys(this['context']),_0xadc16d=_0x54fa65['model'],_0xa6b8a0=_0x10ce5d['map'](_0x22aaf7=>this['_getMarkersDataForGroup'](_0x22aaf7))['flat']();_0xadc16d['change'](_0x9c67ba=>{for(const _0x1f8a76 of _0xa6b8a0){const _0x1a3aaa=_0x54fa65['model']['markers']['get'](_0x1f8a76['id']);if(_0x1a3aaa){if('insert'===_0x1f8a76['type']){if(!_0x1f8a76['content'])continue;_0xadc16d['insertContent'](_0x1f8a76['content']['asFragment']||null,_0x1a3aaa['getRange']()['start']);}else'remove-text'!==_0x1f8a76['type']&&'remove-only'!==_0x1f8a76['type']||_0xadc16d['deleteContent'](_0xadc16d['createSelection'](_0x1a3aaa['getRange']()));_0x9c67ba['removeMarker'](_0x1f8a76['id']),this['_markers']['delete'](_0x1f8a76['id']);}}});}['rejectChange'](_0x1a28fb){const _0x26be15=Ys(this['context']),_0x33146b=this['_getMarkersDataForGroup'](_0x1a28fb);_0x26be15['model']['change'](_0x530aa1=>{for(const _0x4d007b of _0x33146b)_0x530aa1['removeMarker'](_0x4d007b['id']),this['_markers']['delete'](_0x4d007b['id']);});}['getEditor'](){return Ys(this['context']);}['getMarkerElementForChange'](_0x45970d){const _0x675924=Array['from'](this['_markers']['values']())['filter'](_0x5cb377=>_0x5cb377['groupId']===_0x45970d);if(!_0x675924['length'])return null;const _0x27b8d9=0x1===_0x675924['length']?_0x675924[0x0]:this['_sortMarkers'](_0x675924)[0x0],_0x7b4218=Ys(this['context'])['model']['markers']['get'](_0x27b8d9['id']);if(!_0x7b4218)return null;return{'modelRange':_0x7b4218['getRange'](),'getElement':()=>this['_findMarkerElementById'](_0x27b8d9['id'])};}['getContentElementForChange'](_0x303f13){const _0x151115=Array['from'](this['_markers']['values']())['filter'](_0x553620=>_0x553620['groupId']===_0x303f13);if(!_0x151115['length'])return null;const _0x57f3ff=0x1===_0x151115['length']?_0x151115[0x0]:this['_sortMarkers'](_0x151115)[0x0],_0x227242=Ys(this['context']),_0x3d386d=_0x227242['model']['markers']['get'](_0x57f3ff['id']);if(!_0x3d386d)return null;const _0x72d14c=_0x3d386d['getRange'](),_0x1e25db=_0x227242['editing']['view']['getDomRoot']();if(!_0x1e25db||!_0x72d14c)return null;let _0x3aef41=_0x72d14c['start']['parent'];for(;_0x3aef41['parent']&&'$root'!==_0x3aef41['parent']['name'];)_0x3aef41=_0x3aef41['parent'];if(!_0x3aef41||!_0x3aef41['name'])return null;const _0x37f2b1=_0x1e25db['querySelector']('[data-marker-id=\x22'+_0x57f3ff['id']+'\x22]');if(!_0x37f2b1)return null;let _0x571e20=null;_0x227242['model']['change'](_0x7e8ef2=>{_0x571e20=_0x7e8ef2['createDocumentFragment'](),_0x7e8ef2['append'](_0x3aef41['_clone'](!0x0),_0x571e20);});const _0x5aa3b7=_0x227242['data']['toView'](_0x571e20)['getChild'](0x0);return _0x37f2b1['closest'](_0x5aa3b7['name']);}['reactivateMarkers'](_0x44b90d){const _0x12803b=this['_getMarkersDataForGroup'](_0x44b90d);if(!_0x12803b['length'])return;const _0x53d3c2=Array['from'](this['_activeMarkers'])['sort'](),_0x59cf0c=Array['from'](new Set(_0x12803b['map'](_0x4a41b6=>_0x4a41b6['id'])))['sort']();_0x53d3c2['join']('|')!==_0x59cf0c['join']('|')&&(this['setAllMarkersAsInactive'](),this['setMarkersInElementAsActive'](_0x44b90d));}['setMarkersInElementAsActive'](_0xc69baa){const _0x946ad5=this['_getMarkersDataForGroup'](_0xc69baa);if(!_0x946ad5['length'])return;const _0x48d724=Ys(this['context']),_0x535121=new Set(_0x946ad5['map'](_0x3cfb39=>_0x3cfb39['id'])),_0x39864d=Array['from'](_0x535121['values']())['map'](_0x3cd755=>_0x48d724['model']['markers']['get'](_0x3cd755))['filter'](_0x54bc4e=>!!_0x54bc4e);_0x535121['forEach'](_0x58b8c7=>{this['_activeMarkers']['add'](_0x58b8c7);}),_0x48d724['model']['change'](()=>{_0x39864d['forEach'](_0x2a04e5=>{_0x48d724['editing']['reconvertMarker'](_0x2a04e5);});});}['setAllMarkersAsInactive'](){const _0x504422=Array['from'](this['_activeMarkers']);if(!_0x504422['length'])return;this['_activeMarkers']['clear']();const _0x5902ac=Ys(this['context']),_0x433e79=_0x504422['map'](_0x45ced7=>_0x5902ac['model']['markers']['get'](_0x45ced7))['filter'](_0x57a6b4=>!!_0x57a6b4);_0x5902ac['model']['change'](()=>{_0x433e79['forEach'](_0x517242=>{_0x5902ac['editing']['reconvertMarker'](_0x517242);});});}['_getPositionLimitingRange'](_0xa9d6bd,_0x159b61,_0xdee2a='outside'){if(!_0xa9d6bd)return null;let _0x1fbac4=_0xa9d6bd['parent'];for(;_0x1fbac4&&_0x1fbac4['parent']&&'$root'!==_0x1fbac4['parent']['name']&&!_0x159b61['model']['schema']['isLimit'](_0x1fbac4)&&!_0x159b61['model']['schema']['isBlock'](_0x1fbac4);)_0x1fbac4=_0x1fbac4['parent'];if(!_0x1fbac4||!_0x1fbac4['name']||'$root'===_0x1fbac4['name'])return null;let _0x19b20d=null;return _0x159b61['model']['change'](_0x3c9366=>{_0x19b20d='inside'===_0xdee2a?_0x3c9366['createRangeIn'](_0x1fbac4):_0x3c9366['createRangeOn'](_0x1fbac4);}),_0x19b20d;}['_validateMarkers'](_0x443322,_0x354f00){const _0x3e73cc=Array['from'](this['_markers']['keys']()),_0x56e05d=new Map();for(const _0x30c923 of _0x3e73cc){const _0x3c35e5=_0x443322['model']['markers']['get'](_0x30c923);if(!_0x3c35e5)continue;const _0xba4dc=_0x3c35e5['getStart']()['path'][0x0];_0x56e05d['has'](_0xba4dc)||_0x56e05d['set'](_0xba4dc,[]),_0x56e05d['get'](_0xba4dc)['push'](_0x3c35e5);}const _0x53b084=new Set();for(const _0x533a75 of _0x443322['model']['document']['differ']['getChanges']()){let _0xdbd19b=-0x1,_0x1193c5=null;if('insert'===_0x533a75['type'])_0x1193c5=new _0x42ff50(_0x533a75['position'],_0x533a75['position']['getShiftedBy'](_0x533a75['length'])),_0xdbd19b=_0x533a75['position']['path'][0x0];else{if('remove'!==_0x533a75['type'])continue;_0x1193c5=new _0x42ff50(_0x533a75['position']),_0xdbd19b=_0x533a75['position']['path'][0x0];}const _0x5c2084=_0x56e05d['get'](_0xdbd19b)||[];if(_0x5c2084['length']){for(const _0x5e7471 of _0x5c2084)if(_0x1193c5['root']['rootName']===_0x5e7471['getRange']()['root']['rootName']&&('insert'!==_0x533a75['type']||!_0x1193c5['containsRange'](_0x5e7471['getRange']()))&&(_0x1193c5['isIntersecting'](_0x5e7471['getRange']())||_0x1193c5['start']['isTouching'](_0x5e7471['getRange']()['end'])||_0x1193c5['end']['isTouching'](_0x5e7471['getRange']()['start']))){const _0x43ea50=this['_parseMarkerName'](_0x5e7471['name']);Array['from'](this['_markers']['values']())['filter'](_0x3b777f=>_0x3b777f['groupId']===_0x43ea50['groupId'])['forEach'](_0x5be2cb=>_0x53b084['add'](_0x5be2cb['id']));}}}if(_0x53b084['size']){for(const _0x321592 of _0x53b084)_0x354f00['removeMarker'](_0x321592);return!0x0;}return!0x1;}['_handleMarkerChanges'](_0x1e47b2){for(const {name:_0x4ff495,data:_0x339d2d}of _0x1e47b2['model']['document']['differ']['getChangedMarkers']()){if(!_0x4ff495['startsWith'](Eo))continue;const _0x530f4b=_0x339d2d['oldRange'],_0x4bc6cb=_0x339d2d['newRange'],_0x221c36=_0x530f4b&&'$graveyard'===_0x530f4b['root']['rootName'],_0x48a56b=_0x4bc6cb&&'$graveyard'===_0x4bc6cb['root']['rootName'];if(_0x221c36&&_0x48a56b)continue;const _0x2cd687=this['_parseMarkerName'](_0x4ff495);this['_markers']['get'](_0x4ff495)&&(_0x48a56b||!_0x4bc6cb?this['_eventEmitter']['fire']('changeMarkerRemoved',{'markerId':_0x4ff495,'changeId':_0x2cd687['groupId']}):_0x221c36&&_0x4bc6cb&&this['_eventEmitter']['fire']('changeMarkerRestored',{'markerId':_0x4ff495,'changeId':_0x2cd687['groupId']}));}}['_parseMarkerName'](_0x1f65cc){const _0xc2e6af=_0x1f65cc['split'](':'),_0xceee72=(_0xc2e6af[0x1]||'')['split']('_');return{'prefix':_0xc2e6af[0x0],'groupId':_0xceee72[0x0],'suffix':_0xceee72[0x1]};}['_translateOperationToEditorContent'](_0x52b0ca,_0x58c8e5,_0x19debb){if('insert'===_0x52b0ca['type']){const _0x5f59c3=_0x52b0ca;return new _0x572aac(this['_changePosition'](_0x58c8e5['concat'](_0x5f59c3['position']['offset']),_0x19debb),_0x5f59c3['nodes'],_0x5f59c3['baseVersion']);}if('marker'===_0x52b0ca['type']&&_0x52b0ca['name']['startsWith']('$markedRemove')){const _0x52204c=_0x52b0ca;return new _0x2a2cd9(_0x52204c['name'],_0x52204c['oldRange'],this['_changeRange'](_0x52204c['newRange'],_0x58c8e5['concat'](_0x52204c['newRange']['start']['offset']),_0x58c8e5['concat'](_0x52204c['newRange']['end']['offset']),_0x19debb),_0x52204c['_markers'],_0x52204c['affectsData'],_0x52204c['baseVersion']);}return _0x52b0ca;}['_groupAdjacentOperations'](_0x2da4a9){if(!_0x2da4a9['length'])return[];const _0x1dcf5b=[];let _0x4aa69b=0x0,_0x361f6d=0x0,_0x152d73=[];for(let _0x557ec2=0x0;_0x557ec2<=_0x2da4a9['length'];_0x557ec2++){const _0x567073=_0x2da4a9[_0x557ec2],_0xee1273=_0x2da4a9[_0x557ec2-0x1];!_0x567073||_0xee1273&&!this['_getOperationEnd'](_0xee1273)['isTouching'](this['_getOperationStart'](_0x567073))?(_0x1dcf5b['push']({'operations':_0x152d73,'operationsIsolated':_0x152d73['map'](_0x1294d2=>this['_shiftOperation'](_0x1294d2['clone'](),-_0x361f6d)),'groupOffset':_0x4aa69b}),_0x152d73=_0x567073?[_0x567073]:[],_0x361f6d+=_0x4aa69b,_0x4aa69b=0x0):_0x152d73['push'](_0x567073),_0x567073&&'insert'===_0x567073['type']&&(_0x4aa69b+=_0x567073['howMany']);}return _0x1dcf5b;}['_findAdjacentContextDistance'](_0x55c6a5,_0x5e2cd4,_0x1be243,_0xe4c947=0x1){const _0x37d905=new _0x2d0568({'startPosition':_0x55c6a5,'direction':_0x5e2cd4});let _0x5477ef=0x0;for(let _0x27e6b3=0x0;_0x27e6b3<_0xe4c947;_0x27e6b3++){let _0x5ba6c5=0x0,_0x371984=!0x1,_0x451f0a='forward'===_0x5e2cd4?/^\W*\w+/:/\w+\W*$/;for(const {item:_0x2a26d1}of _0x37d905)if(_0x2a26d1['is']('$textProxy')){const _0x199a45=_0x451f0a['exec'](_0x2a26d1['data']);if(_0x199a45&&_0x199a45['length']){if(_0x5ba6c5+='forward'===_0x5e2cd4?_0x199a45['index']+_0x199a45[0x0]['length']:_0x2a26d1['data']['length']-_0x199a45['index'],_0x199a45[0x0]['length']!==_0x2a26d1['data']['length'])break;_0x371984=!0x0,_0x451f0a='forward'===_0x5e2cd4?/^\w+/:/\w+$/;}else{if(_0x371984)break;_0x5ba6c5+=_0x2a26d1['offsetSize'];}}else{if(_0x2a26d1['is']('element')){_0x1be243['isInline'](_0x2a26d1)&&!_0x371984&&(_0x5ba6c5+=0x1);break;}}_0x5477ef+=_0x5ba6c5,_0x37d905['jumpTo'](_0x55c6a5['getShiftedBy']('forward'===_0x5e2cd4?_0x5477ef:-_0x5477ef));}return _0x5477ef;}['_getChangeContext'](_0xb818b0,_0x5d4efc){const _0x51017c=Ys(this['context'])['model']['schema'],_0x10a74c=this['_findAdjacentContextDistance'](_0xb818b0,'backward',_0x51017c,0x6),_0x2b0aa8=this['_findAdjacentContextDistance'](_0x5d4efc,'forward',_0x51017c,0x6),_0x6d94af=_0xb818b0['getShiftedBy'](-_0x10a74c),_0x5aae69=_0x5d4efc['getShiftedBy'](_0x2b0aa8);return{'start':_0x6d94af,'end':_0x5aae69,'hasContentBefore':!_0x6d94af['isAtStart'],'hasContentAfter':!_0x5aae69['isAtEnd']};}['_insertMarkers'](_0xec657b){const _0x550486=this['context']['plugins']['get']('AIEditing'),_0x18e110=new Set();Ys(this['context'])['model']['change'](_0x5cf83e=>{for(const _0xb6495d of _0xec657b){const _0x4a5a78=''+Eo+_0xb6495d['type']+':'+_0xb6495d['groupId']+'_'+_0x550486['_nextDataId'](_0x18e110);this['_markers']['set'](_0x4a5a78,{'id':_0x4a5a78,'groupId':_0xb6495d['groupId'],'type':_0xb6495d['type'],'content':_0xb6495d['content']}),_0x5cf83e['addMarker'](_0x4a5a78,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x5cf83e['createRange'](_0xb6495d['start'],_0xb6495d['end'])});}});}['_createGetContextFn'](_0x365b29,_0x19e710,_0x591475){let _0x38324='';return()=>{if(!_0x38324){const _0x3052ae=_0x19e710['toView'](_0x365b29,{'showSuggestionHighlights':!0x0});let _0xccfdc2=_0x3052ae['getChild'](0x0);if(_0xccfdc2['is']('containerElement')||(_0xccfdc2=_0x3052ae),!_0xccfdc2)return'';let _0x4e77ed=!0x1;const _0x416ea2=[];for(const _0x5afcd7 of _0xccfdc2['getChildren']())_0x5afcd7['is']('element','span')&&_0x5afcd7['hasClass']('ck-ai_review-marker_context-end')&&(_0x4e77ed=!0x1),_0x4e77ed&&_0x416ea2['push'](_0x5afcd7),_0x5afcd7['is']('element','span')&&_0x5afcd7['hasClass']('ck-ai_review-marker_context-start')&&(_0x4e77ed=!0x0);_0xccfdc2['_removeChildren'](0x0,_0xccfdc2['childCount']),_0x591475?.['ellipsisBefore']&&_0xccfdc2['_appendChild']('…'),_0xccfdc2['_appendChild'](_0x416ea2),_0x591475?.['ellipsisAfter']&&_0xccfdc2['_appendChild']('…');const _0x344726=_0x19e710['htmlProcessor']['domConverter']['viewToDom'](_0x3052ae),_0x2cfede=_0x19e710['htmlProcessor']['htmlWriter']['getHtml'](_0x344726);_0x38324=_0x2cfede;}return _0x38324;};}['_createGetContentFn'](_0xc8390c,_0x236169){let _0x512a7d='';return()=>(_0x512a7d||(_0x512a7d=_0x236169['stringify'](_0xc8390c,{'showSuggestionHighlights':!0x0})),_0x512a7d);}['_createGetContentUsingDataIdFn'](_0x4e5a4a,_0xa7858a,_0x2d981a){let _0x872fc9='';return()=>{if(!_0x872fc9){const _0x59cf46=_0x2d981a['toView'](new _0xdf7d9d(_0x4e5a4a)),_0xd3c4ba=_0x2d981a['htmlProcessor']['domConverter']['viewToDom'](_0x59cf46)['querySelector']('[data-id=\x22'+_0xa7858a+'\x22]');_0x872fc9=_0xd3c4ba?.['outerHTML']||'';}return _0x872fc9;};}['_findMarkerElement'](_0x145f0f,_0x18c0ba=0x5){let _0x52cd52=_0x145f0f,_0x325e74=null;for(let _0x4b7d25=0x0;_0x4b7d25<_0x18c0ba&&_0x52cd52;_0x4b7d25++){if(!_0x52cd52['className']){_0x52cd52=_0x52cd52['parentElement'];continue;}if(!(''+_0x52cd52['className'])['includes']('ck-ai_review-marker_')){_0x52cd52=_0x52cd52['parentElement'];continue;}if(!_0x52cd52['getAttribute']('data-marker-id'))break;_0x325e74=_0x52cd52;break;}return _0x325e74;}['_findMarkerElementById'](_0x2a48ff){const _0x53d436=Ys(this['context']),_0x25117f=_0x53d436['model']['markers']['get'](_0x2a48ff);return _0x25117f?_0x441680(_0x53d436['editing'],_0x25117f):null;}['_getMarkersDataForGroup'](_0xc3a8b0){return Array['from'](this['_markers']['values']())['filter'](_0x594981=>_0x594981['groupId']===_0xc3a8b0);}['_getOperationStart'](_0xe8b1fb){return'insert'===_0xe8b1fb['type']?_0xe8b1fb['position']:_0xe8b1fb['newRange']['start'];}['_getOperationEnd'](_0x5970e4,_0x2fe741=!0x1){return'insert'===_0x5970e4['type']?_0x2fe741?_0x5970e4['position']:_0x5970e4['position']['getShiftedBy'](_0x5970e4['howMany']):_0x5970e4['newRange']['end'];}['_shiftOperation'](_0x482448,_0x4844f9){return'insert'===_0x482448['type']?_0x482448['position']=_0x482448['position']['getShiftedBy'](_0x4844f9):'marker'===_0x482448['type']&&_0x482448['newRange']&&(_0x482448['newRange']=new _0x42ff50(_0x482448['newRange']['start']['getShiftedBy'](_0x4844f9),_0x482448['newRange']['end']['getShiftedBy'](_0x4844f9))),_0x482448;}['_changeOperationOwnerDocument'](_0x2582cd,_0xa6cef){'insert'===_0x2582cd['type']?_0x2582cd['position']=this['_changePositionOwnerDocument'](_0x2582cd['position'],_0xa6cef):'marker'===_0x2582cd['type']&&_0x2582cd['newRange']&&(_0x2582cd['newRange']=this['_changeRangeOwnerDocument'](_0x2582cd['newRange'],_0xa6cef));}['_changePositionOwnerDocument'](_0x529f57,_0x460126){return new _0x493592(_0x460126,_0x529f57['path']);}['_changeRangeOwnerDocument'](_0x5913d1,_0x44d914){return new _0x42ff50(this['_changePositionOwnerDocument'](_0x5913d1['start'],_0x44d914),this['_changePositionOwnerDocument'](_0x5913d1['end'],_0x44d914));}['_changePosition'](_0x292de4,_0x1153f2){return new _0x493592(_0x1153f2,[..._0x292de4]);}['_changeRange'](_0x24e479,_0x310253,_0x1f2316,_0x4cea41){return new _0x42ff50(this['_changePosition'](_0x310253,_0x4cea41),this['_changePosition'](_0x1f2316,_0x4cea41));}['_sortMarkers'](_0x565ac3){const _0x487ddd=_0x43efd1=>{switch(_0x43efd1){case'insert':return 0x0;case'remove-context':return 0x1;case'remove-only':return 0x2;case'remove-text':return 0x3;}};return _0x565ac3['sort']((_0x2ceef5,_0xeb89e2)=>_0x487ddd(_0x2ceef5['type'])-_0x487ddd(_0xeb89e2['type']));}['_hasSameTopLevelElement'](_0x56099a,_0x457595){const _0x380262=_0x56099a['getChild'](0x0),_0xf5e89d=_0x457595['getChild'](0x0);return!(!_0x380262||!_0xf5e89d)&&((!_0x380262['is']('element')||!_0xf5e89d['is']('element')||_0x380262['name']===_0xf5e89d['name'])&&!(_0x380262['is']('element')&&!_0xf5e89d['is']('element')||!_0x380262['is']('element')&&_0xf5e89d['is']('element')));}['_haveSingleTopLevelElement'](_0x2e3130){return 0x1===_0x2e3130['childCount'];}['_haveOnlyInlineContent'](_0x4b5463,_0x147d42){for(const _0x1aa6b9 of _0x4b5463['getChildren']())if(_0x1aa6b9['is']('element')&&!_0x147d42['isInline'](_0x1aa6b9))return!0x1;return!0x0;}['_upsertDataId'](_0x10c967,_0x3525a0){let _0x207dfc=_0x10c967['getAttribute'](_0x4aa46b);return _0x207dfc||(_0x207dfc=_0x3525a0(),_0x10c967['_setAttribute'](_0x4aa46b,_0x207dfc)),_0x207dfc;}}class To extends Et(){['id'];['contentNew'];['contentInitial'];['documentVersion'];constructor({id:_0x2a67f9,contentNew:_0x384d0b,contentInitial:_0x2f6c6d,documentVersion:_0x497279}){super(),this['id']=_0x2a67f9,this['contentNew']=_0x384d0b,this['contentInitial']=_0x2f6c6d,this['documentVersion']=_0x497279;}}class mo extends ht(){['id'];['parent'];['_data'];['_editorOperations']=[];constructor(_0x420d7f,_0x339d92,_0x49acd8){super(),this['id']=_0x420d7f,this['parent']=_0x49acd8,this['_data']=_0x339d92,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 Co extends ht(){['id']=at();['callId'];['_results']=new Map();['_changes']=[];['_sourceCheck'];['_documentData'];['_aiConnector'];['_reviewParams'];['_reviewArgs'];['_activeRequest']=null;['_currentError'];['_wasAborted']=!0x1;constructor(_0x961366,_0x27fd00,_0x382297,_0x479bee,_0x446e72){super(),this['_sourceCheck']=_0x27fd00,this['_documentData']=_0x961366,this['_aiConnector']=_0x382297,this['_reviewParams']=_0x479bee,this['_reviewArgs']=_0x446e72,this['on']('change:status',(_0x201fe9,_0x161705,_0x3d086b)=>{'aborted'==_0x3d086b&&(this['_wasAborted']=!0x0),this['fire']('reviewCheckRunUpdated',{'status':_0x3d086b,'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'](_0x41802d=>'pending'===_0x41802d['status']);}get['currentError'](){return this['_currentError'];}['updateDocumentData'](_0x2d7670){this['_documentData']=_0x2d7670;}async['start'](){this['status']='loading',this['_currentError']=void 0x0;try{this['_activeRequest']=this['_createApiRequest']();const _0x1dd7d0=await this['_activeRequest']['getStream']();this['status']='data';for await(const _0x592145 of _0x1dd7d0)'unmodified'!==_0x592145['data']['operation']&&('error'!==_0x592145['data']['operation']?'review-metadata'!==_0x592145['event']?this['_addReviewCheckResult'](_0x592145['data']['dataId'],_0x592145['data']['textDelta']):this['callId']=_0x592145['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(_0x146030){this['_currentError']=_0x146030,_0x146030 instanceof Error&&_0x146030['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'](_0x55895e,_0x58c840){const _0x172e47=this['_results']['get'](_0x55895e);if(!_0x172e47)return;if(0x0===_0x58c840['length'])return;const _0x1fb481=[];_0x58c840['forEach']((_0x4c7b81,_0x36b415)=>{const _0x564a0d=new mo(_0x172e47['id']+'-'+_0x36b415,_0x4c7b81,_0x172e47);_0x564a0d['on']('change:status',()=>{this['fire']('reviewCheckResultChangeStatusUpdated',{'change':_0x564a0d,'status':_0x564a0d['status']});}),_0x564a0d['on']('change:isActivated',()=>{_0x564a0d['isActivated']?this['fire']('reviewCheckResultActivated',{'change':_0x564a0d}):this['fire']('reviewCheckResultDeactivated',{'change':_0x564a0d});}),this['_changes']['push'](_0x564a0d),_0x1fb481['push'](_0x564a0d);}),this['fire']('reviewCheckResultReady',{'changes':_0x1fb481,'result':_0x172e47,'source':this});}['abort'](){this['_activeRequest']&&(this['_activeRequest']['abortController']['abort'](),this['_activeRequest']=null,this['status']='aborted');}['isChangeActive'](_0x1872ba){const _0x5c84ae=this['_changes']['find'](_0x158323=>_0x158323['id']===_0x1872ba);return!(!_0x5c84ae||'pending'!==_0x5c84ae['status']);}['isAnyChangeActivated'](){return this['_changes']['some'](_0x516254=>!0x0===_0x516254['isActivated']);}['getActiveChanges'](){return this['_changes']['filter'](_0x8555e4=>'pending'===_0x8555e4['status']);}['getChangeById'](_0x5dcb50){return this['_changes']['find'](_0x4dcdda=>_0x4dcdda['id']===_0x5dcb50);}['markAllChangesAsAccepted'](){for(const _0x19708d of this['_changes'])'pending'===_0x19708d['status']&&(_0x19708d['status']='accepted');this['_checkIfFinished']();}['markChangeAsAccepted'](_0x31747e){const _0x4ac63d=this['_changes']['find'](_0x15a1d1=>_0x15a1d1['id']===_0x31747e);_0x4ac63d&&'pending'===_0x4ac63d['status']&&(_0x4ac63d['status']='accepted'),this['_checkIfFinished']();}['markChangeAsRejected'](_0x4a35d4){const _0x35f007=this['_changes']['find'](_0x17b3c4=>_0x17b3c4['id']===_0x4a35d4);_0x35f007&&'pending'===_0x35f007['status']&&(_0x35f007['status']='rejected'),this['_checkIfFinished']();}['markChangeAsOutdated'](_0x28e666){const _0x2d75e4=this['_changes']['find'](_0xe52879=>_0xe52879['id']===_0x28e666);_0x2d75e4&&'pending'===_0x2d75e4['status']&&(_0x2d75e4['status']='outdated'),this['_checkIfFinished']();}['markChangeAsPending'](_0x10a3ef){const _0x374570=this['_changes']['find'](_0xc2f364=>_0xc2f364['id']===_0x10a3ef);_0x374570&&'outdated'===_0x374570['status']&&(_0x374570['status']='pending'),this['_checkIfFinished']();}['activateChange'](_0x5074c4){this['_changes']['filter'](_0x53e741=>_0x53e741['isActivated']&&_0x53e741['id']!==_0x5074c4)['forEach'](_0x4940a1=>{_0x4940a1['isActivated']=!0x1;});const _0x566fc6=this['_changes']['find'](_0x3ddecd=>_0x3ddecd['id']===_0x5074c4);_0x566fc6&&'pending'===_0x566fc6['status']&&(_0x566fc6['isActivated']=!0x0);}['deactivateChange'](){this['_changes']['filter'](_0x146a89=>_0x146a89['isActivated'])['forEach'](_0x45cc7f=>{_0x45cc7f['isActivated']=!0x1;});}['forceReadyState'](){this['status']='ready';}async['sendRating'](_0x14f0b4){if('initialized'===this['status']||'loading'===this['status']||'data'===this['status']||this['_wasAborted'])return;if(!this['callId']||0x0===this['_changes']['length'])return;let _0x4921ac;if(_0x14f0b4){const _0x1ed164=this['_changes']['find'](_0x35450c=>_0x35450c['id']===_0x14f0b4);if(_0x1ed164&&_0x1ed164['isRated'])return;_0x1ed164&&(_0x4921ac=_0x1ed164['parent']['id'],_0x1ed164['isRated']=!0x0);}const _0xe3d7d4={'positiveCount':this['_changes']['filter'](_0x25c822=>'accepted'===_0x25c822['status'])['length'],'totalCount':this['_changes']['length']};this['_sendRatingRequest'](_0xe3d7d4,this['callId'],_0x4921ac);}['_addReviewCheckResult'](_0x5110ca,_0x1f74a0){const _0x9bd789=this['_documentData']['elements']['get'](_0x5110ca);if(!_0x9bd789)return;const _0xa1346d=_0x9bd789['getContent']();if(_0xa1346d===_0x1f74a0)return;const _0x4fc7da=new To({'id':_0x5110ca,'contentInitial':_0xa1346d,'contentNew':_0x1f74a0,'documentVersion':this['_documentData']['version']});this['_results']['set'](_0x4fc7da['id'],_0x4fc7da),this['fire']('reviewCheckResultAdded',{'result':_0x4fc7da,'source':this});}['_checkIfFinished'](){'finished'===this['status']&&(this['_changes']['filter'](_0x1c12aa=>'pending'===_0x1c12aa['status'])['length']>0x0&&(this['status']='ready')),'ready'===this['status']&&(0x0===this['_changes']['filter'](_0x3b8564=>'pending'===_0x3b8564['status'])['length']&&(this['status']='finished'));}}class wo extends Co{get['subTitle'](){if(!this['_reviewParams']||0x0===this['_reviewParams']['length'])return'';const _0x20581b=[];if(this['_reviewParams']['length']>0x0&&this['_sourceCheck']['options'])for(let _0x5c2846=0x0;_0x5c2846<this['_reviewParams']['length'];_0x5c2846++){if(!this['_reviewParams'][_0x5c2846]||!this['_sourceCheck']['options'][_0x5c2846])continue;const _0x4c16c2=this['_sourceCheck']['options'][_0x5c2846],_0x5ecd08=_0x4c16c2['data']?.['find'](_0x326ac3=>_0x326ac3['id']===this['_reviewParams'][_0x5c2846]);_0x5ecd08&&_0x20581b['push'](_0x5ecd08['label']);}return _0x20581b['join'](',\x20');}get['reviewName'](){return this['_composeReviewName']();}['_createApiRequest'](){return this['_aiConnector']['callSystemReview']({'reviewName':this['_composeReviewName'](),'content':this['_documentData']['content'],'args':this['_reviewArgs']});}['_sendRatingRequest'](_0x8cd5a7,_0x2050cc,_0x5d301f){return this['_aiConnector']['upsertAIReviewRating'](this['reviewName'],_0x2050cc,_0x8cd5a7,_0x5d301f);}['_composeReviewName'](){return!this['_reviewParams']||0x0===this['_reviewParams']['length']||this['_sourceCheck']['useArgs']?this['_sourceCheck']['apiId']:[this['_sourceCheck']['apiId'],...this['_reviewParams']]['join']('-');}}class fo extends _0x5d2433{['_aiConnector'];['_aiReviewCoreUi'];['_aiReviewCoreEditing'];['_aiReviewCheckList'];['_currentReviewCheckRun'];['_changeActivationSource']=null;static get['requires'](){return[hs];}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(_0x40cd32,_0x560590)=>{const _0x342282=this['_aiReviewCheckList']['getCheckById'](_0x560590['id']);if(_0x342282){this['_onReviewCheckRun'](_0x560590),this['_aiReviewCoreEditing']['switchToReadOnly'](),this['_currentReviewCheckRun']=this['_createReviewCheckRun'](_0x560590,_0x342282),this['_aiReviewCoreUi']['setCheckResultTitle'](this['_currentReviewCheckRun']['title'],this['_currentReviewCheckRun']['subTitle']),this['_currentReviewCheckRun']['on']('reviewCheckRunUpdated',(_0x583281,_0x369263)=>{switch(_0x369263['status']){case'data':case'loading':this['_aiReviewCoreUi']['showCheckRunResults'](_0x369263);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'!==_0x369263['status']&&'error-chunk'!==_0x369263['status']&&'error-general'!==_0x369263['status']||this['_currentReviewCheckRun']?.['sendRating']();}),this['_currentReviewCheckRun']['on']('reviewCheckResultAdded',(_0x4c15af,_0x2a55ff)=>{if(!this['_currentReviewCheckRun'])throw new ot('ai-review-mode-no-current-check-run',this);const _0x362d13=this['_diffContent'](_0x2a55ff['result']['contentInitial'],_0x2a55ff['result']['contentNew']);_0x2a55ff['source']['addResultChanges'](_0x2a55ff['result']['id'],_0x362d13);}),this['_currentReviewCheckRun']['on']('reviewCheckResultReady',(_0x2594c9,_0x5e7632)=>{for(const _0xf24399 of _0x5e7632['changes'])this['_aiReviewCoreUi']['showCheckRunResult'](_0xf24399);this['_markChangePositionInEditorContent'](_0x5e7632['changes'],_0x5e7632['source']['documentData']);}),this['_currentReviewCheckRun']['on']('reviewCheckResultChangeStatusUpdated',(_0x952730,_0x28419f)=>{this['_aiReviewCoreUi']['updateChangeState'](_0x28419f['change']['id'],_0x28419f['status']);}),this['_currentReviewCheckRun']['on']('reviewCheckResultActivated',(_0x1caa4d,_0x4c440e)=>{this['_onReviewCheckResultActivated'](_0x4c440e);}),this['_currentReviewCheckRun']['on']('reviewCheckResultDeactivated',()=>{this['_onReviewCheckResultDeactivated']();});try{await this['_currentReviewCheckRun']['start']();}catch(_0x432143){_0x432143 instanceof Error&&_0x432143['message']['includes']('ai-request-aborted')||(_0x432143 instanceof ot?this['_logError'](_0x432143):this['_logError'](new ot('ai-review-mode-check-run-failed',this,void 0x0,_0x432143)));}}else this['_logError'](new ot('ai-review-mode-source-check-not-found',this,{'checkId':_0x560590['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 _0x11c9b4=this['_currentReviewCheckRun']['getActiveChanges']();if(!_0x11c9b4['length'])return;this['_aiReviewCoreEditing']['applyChange'](_0x11c9b4['map'](_0x8ad76f=>_0x8ad76f['id']));const _0x32bb87=this['_currentReviewCheckRun'];_0x32bb87['markAllChangesAsAccepted'](),_0x32bb87['sendRating']();}),this['listenTo'](this['_aiReviewCoreUi'],'acceptChange',(_0x1992a1,_0x25d7a6)=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['isChangeActive'](_0x25d7a6['id'])&&(this['_aiReviewCoreEditing']['applyChange']([_0x25d7a6['id']]),this['_currentReviewCheckRun']['markChangeAsAccepted'](_0x25d7a6['id']),this['_aiReviewCoreUi']['hideChangeBalloon'](),this['_currentReviewCheckRun']['sendRating'](_0x25d7a6['id']));}),this['listenTo'](this['_aiReviewCoreUi'],'dismissChange',(_0x1b96da,_0x552967)=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['isChangeActive'](_0x552967['id'])&&(this['_aiReviewCoreEditing']['rejectChange'](_0x552967['id']),this['_currentReviewCheckRun']['markChangeAsRejected'](_0x552967['id']),this['_aiReviewCoreUi']['hideChangeBalloon'](),this['_currentReviewCheckRun']['sendRating'](_0x552967['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',(_0x4da102,_0x11983f)=>{this['_onActivateChange'](_0x11983f);}),this['listenTo'](this['_aiReviewCoreUi'],'deactivateChange',(_0x2b612c,_0x5480db)=>{this['_onDeactivateChange'](_0x5480db);}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerClicked',(_0x5181d2,_0x564e5a)=>{this['_onChangeMarkerClicked'](_0x5181d2,_0x564e5a);}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerHovered',(_0x237096,_0xbe01a)=>{this['_onChangeMarkerHovered'](_0x237096,_0xbe01a);}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerBlurred',()=>{this['_onChangeMarkerBlurred']();}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerRemoved',(_0x131681,_0x1c9a7b)=>{this['_onChangeMarkerRemoved'](_0x131681,_0x1c9a7b);}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerRestored',(_0x1435fa,_0x4bdb1f)=>{this['_onChangeMarkerRestored'](_0x1435fa,_0x4bdb1f);});}['_createReviewCheckRun'](_0x2ee278,_0x1d3891){return new wo(this['_aiReviewCoreEditing']['getDocumentData'](),_0x1d3891,this['_aiConnector'],_0x2ee278['params'],_0x2ee278['args']);}['_onChangeMarkerRemoved'](_0x2e2b85,_0x58c540){this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['markChangeAsOutdated'](_0x58c540['changeId']);}['_onChangeMarkerRestored'](_0x4d4263,_0x29132a){this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['markChangeAsPending'](_0x29132a['changeId']);}['_onCheckRunFinished'](){this['_aiReviewCoreUi']['showReviewCompletedView']();}['_initRequiredPlugins'](){this['_aiConnector']=this['context']['plugins']['get']('AIConnector');}['_onReviewRunLeave'](_0x451012=!0x1){this['_currentReviewCheckRun']&&(this['_currentReviewCheckRun']['hasModifications']||this['_currentReviewCheckRun']['sendRating'](),this['_currentReviewCheckRun']['stopListening'](),this['_currentReviewCheckRun']['abort'](),this['_currentReviewCheckRun']=void 0x0),_0x451012&&this['_aiReviewCoreUi']['showReviewCheckList'](),this['_aiReviewCoreEditing']['clearAllMarkers'](),this['_aiReviewCoreEditing']['switchToEdit'](),this['_changeActivationSource']=null;const _0x39f864=this['_aiReviewCoreEditing']['getEditor']();_0x39f864&&_0x39f864['editing']['view']['change'](_0x4513d1=>{const _0x10b7e0=_0x39f864['editing']['view']['document']['getRoot']();_0x4513d1['removeClass']('ck-ai_review-diff',_0x10b7e0),_0x4513d1['removeClass']('ck-ai_review-highlights',_0x10b7e0),_0x4513d1['removeClass']('ck-ai-translate-mode-content',_0x10b7e0);});}['_getTranslationWithDefault'](_0x3fc08f,_0x2a8818){const _0x5427ad=cs(this['context']['locale'],_0x3fc08f);return _0x5427ad===_0x3fc08f?_0x2a8818:_0x5427ad;}['_logError'](_0x3b817b,_0x2fdee4=!0x1){Tt(_0x3b817b['message']),_0x2fdee4||(_0x3b817b['message']['startsWith']('ai-review-mode-models-unable-to-retrieve')?this['_aiReviewCoreUi']['showGeneralReviewCoreErrorView']():this['_aiReviewCoreUi']['showGeneralResultsErrorView']());}['_scrollToChange'](_0x4363ac){if('content'===this['_changeActivationSource']){const _0x284018=this['_aiReviewCoreUi']['getChangeElement'](_0x4363ac);_0x284018&&wt(_0x284018['closest']('.ck-ai_review__check-run-result')||_0x284018);}else{if('panel'===this['_changeActivationSource']){const _0x1da286=this['_getChangeContentElement'](_0x4363ac);if(!_0x1da286)return;mt({'target':_0x1da286,'viewportOffset':{'top':0x55,'left':0x0,'bottom':0x0,'right':0x0},'ancestorOffset':0x14,'alignToTop':!0x0});}}}}const So=[{'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 bo{['id'];['commandId'];['title'];['description'];['isParameterized'];['useArgs'];['options'];['args'];get['apiId'](){return this['commandId'];}constructor(_0x498db8){this['id']=_0x498db8['id'],this['commandId']=_0x498db8['commandId'],this['title']=_0x498db8['title'],this['description']=_0x498db8['description'],this['isParameterized']=_0x498db8['isParameterized'],this['useArgs']=_0x498db8['useArgs'],this['options']=_0x498db8['options'],this['args']=_0x498db8['args'];}}class Ro extends ht(){['_checks']=[];['setupChecks'](_0x5de214){this['_checks']=_0x5de214['map'](_0xd28367=>new bo(_0xd28367));}get['checks'](){return this['_checks'];}['getCheckById'](_0x1abeeb){return this['checks']['find'](_0x5ea023=>_0x5ea023['id']===_0x1abeeb);}['removeCheckById'](_0x599335){this['_checks']=this['_checks']['filter'](_0x448d83=>_0x448d83['id']!==_0x599335);}}class Oo extends bo{['_models']=[];['_defaultModel']=null;constructor(_0x31c180,_0x28b931,_0x4b9f00){super(_0x31c180),this['_models']=_0x28b931,this['_defaultModel']=_0x4b9f00;}get['models'](){return this['_models'];}get['defaultModel'](){return this['_defaultModel'];}}class ko extends bo{['isExtra']=!0x0;['prompt'];['model'];['_defaultModel']=null;constructor(_0x4bb97e,_0x48fd55,_0x3abed6){super(_0x4bb97e),this['prompt']=_0x4bb97e['prompt'],this['model']=_0x4bb97e['model'],this['model']?this['_defaultModel']=_0x48fd55['find'](_0x17e580=>_0x17e580['id']===this['model'])||null:this['_defaultModel']=_0x3abed6;}get['defaultModel'](){return this['_defaultModel'];}}class No extends Ro{['_allModels']=[];['_recommendedModels']=[];['_defaultModel']=null;constructor(_0x218cc3,_0x140c59,_0x5c87aa){super(),this['_allModels']=_0x218cc3,this['_recommendedModels']=_0x140c59,this['_defaultModel']=_0x5c87aa;}['setupChecks'](_0x32d48f){this['_checks']=_0x32d48f['map'](_0x41a054=>!0x0===_0x41a054['isExtra']?new ko(_0x41a054,this['_allModels'],this['_defaultModel']):'custom'===_0x41a054['id']?new Oo(_0x41a054,this['_recommendedModels'],this['_defaultModel']):new bo(_0x41a054));}}class vo extends Co{['_prompt'];['_model'];constructor(_0x3ca1a5,_0x31a28e,_0x5cb346,_0x29d621,_0x5bd46d){super(_0x5cb346,_0x29d621,_0x5bd46d),this['_prompt']=_0x3ca1a5,this['_model']=_0x31a28e;}get['subTitle'](){return this['_prompt'];}['_createApiRequest'](){return this['_aiConnector']['callCustomReview']({'content':this['_documentData']['content'],'prompt':this['_prompt'],'model':this['_model']});}['_sendRatingRequest'](_0x4fac7c,_0x2738d7,_0x5f286c){return this['_aiConnector']['upsertCustomAIReviewRating'](_0x2738d7,_0x4fac7c,_0x5f286c);}}class yo extends vo{get['subTitle'](){return'';}set['prompt'](_0x3b7a66){this['_prompt']=_0x3b7a66;}set['model'](_0x123e48){this['_model']=_0x123e48;}}class xo extends fo{static get['pluginName'](){return'AIReviewModeController';}['_isDiffOn']=!0x1;['_hasDefaultAvailableCommands']=!0x1;constructor(_0xa839d1){super(_0xa839d1),this['_hasDefaultAvailableCommands']=!this['context']['config']['get']('ai.review.availableCommands'),this['context']['config']['define']('ai.review.availableCommands',So['map'](_0x4c0616=>_0x4c0616['id'])),this['context']['config']['define']('ai.review.extraCommands',[]);}async['init'](){await super['init'](),this['listenTo'](this['_aiReviewCoreUi'],'toggleDiff',(_0x22b7f1,_0x102d6e)=>{this['_isDiffOn']=_0x102d6e['on'],this['_onDiffChange'](this['_isDiffOn']);});}['_initRequiredPlugins'](){super['_initRequiredPlugins'](),this['_aiReviewCoreUi']=this['context']['plugins']['get']('AIReviewModeUI'),this['_aiReviewCoreEditing']=this['context']['plugins']['get']('AIReviewCoreEditing');}['_createReviewCheckRun'](_0x459176,_0x36e527){return _0x459176['isCustom']?new vo(_0x459176['args']['prompt'],_0x459176['args']['model'],this['_aiReviewCoreEditing']['getDocumentData'](),_0x36e527,this['_aiConnector']):_0x36e527['isExtra']?new yo(_0x36e527['prompt'],_0x36e527['defaultModel']['id'],this['_aiReviewCoreEditing']['getDocumentData'](),_0x36e527,this['_aiConnector']):new wo(this['_aiReviewCoreEditing']['getDocumentData'](),_0x36e527,this['_aiConnector'],_0x459176['params'],_0x459176['args']);}['_onReviewCheckResultActivated'](_0x5cc518){this['_aiReviewCoreUi']['setActiveStateInResults'](_0x5cc518['change']['id']),this['_scrollToChange'](_0x5cc518['change']['id']);const _0xf3465a=this['_aiReviewCoreEditing']['getMarkerElementForChange'](_0x5cc518['change']['id']);if(!_0xf3465a)return;const _0x29e360=this['_aiReviewCoreEditing']['getEditor']();this['_aiReviewCoreUi']['showChangeBalloon'](_0x5cc518['change'],()=>_0xf3465a['getElement'](),void 0x0,'click',_0x29e360?.['editing']?.['view']?.['getDomRoot'](),_0x29e360?.['ui']?.['viewportOffset']),this['_aiReviewCoreEditing']['setMarkersInElementAsActive'](_0x5cc518['change']['id']);}['_onReviewCheckResultDeactivated'](){this['_aiReviewCoreUi']['resetActiveStateInResults'](),this['_aiReviewCoreUi']['hideChangeBalloon'](),this['_aiReviewCoreEditing']['setAllMarkersAsInactive']();}['_onActivateChange'](_0x10f6df){this['_currentReviewCheckRun']&&'click'===_0x10f6df['uiInteraction']&&(this['_changeActivationSource']='panel',this['_currentReviewCheckRun']['activateChange'](_0x10f6df['id']));}['_onDeactivateChange'](_0x445eaa){this['_currentReviewCheckRun']&&'balloon'===_0x445eaa['origin']&&this['_currentReviewCheckRun']['deactivateChange']();}['_onChangeMarkerClicked'](_0x4b425d,_0x483daa){if(!this['_currentReviewCheckRun'])return;this['_changeActivationSource']='content',this['_currentReviewCheckRun']['activateChange'](_0x483daa['changeId']);const _0x300fc2=this['_currentReviewCheckRun']['getChangeById'](_0x483daa['changeId']);if(!_0x300fc2)return;const _0x2dba20=this['_aiReviewCoreEditing']['getEditor']();this['_aiReviewCoreUi']['showChangeBalloon'](_0x300fc2,_0x483daa['markerElement'],_0x483daa['domEvent'],'click',_0x2dba20?.['editing']?.['view']?.['getDomRoot'](),_0x2dba20?.['ui']?.['viewportOffset']);}['_onChangeMarkerHovered'](_0x1fb2fe,_0x1bb994){if(!this['_currentReviewCheckRun'])return;if(this['_currentReviewCheckRun']['isAnyChangeActivated']())return;const _0xb7b081=this['_currentReviewCheckRun']['getChangeById'](_0x1bb994['changeId']);if(!_0xb7b081)return;const _0x358871=this['_aiReviewCoreEditing']['getEditor']();this['_aiReviewCoreUi']['showChangeBalloon'](_0xb7b081,_0x1bb994['markerElement'],_0x1bb994['domEvent'],'hover',_0x358871?.['editing']?.['view']?.['getDomRoot'](),_0x358871?.['ui']?.['viewportOffset']);}['_onChangeMarkerBlurred'](){if(!this['_currentReviewCheckRun'])return;this['_currentReviewCheckRun']['isAnyChangeActivated']()||this['_aiReviewCoreUi']['hideChangeBalloon']();}['_getChangeContentElement'](_0x172c1e){const _0x59e40d=this['_aiReviewCoreEditing']['getMarkerElementForChange'](_0x172c1e);return _0x59e40d?_0x59e40d['getElement']():null;}['_markChangePositionInEditorContent'](_0x267dc6,_0x5800c0){this['_aiReviewCoreEditing']['markChangePositionInEditorContent'](_0x267dc6,_0x5800c0);}['_diffContent'](_0x448ef7,_0x34e88f){return this['_aiReviewCoreEditing']['diffContent'](_0x448ef7,_0x34e88f);}['_onReviewCheckRun'](){this['_onDiffChange'](this['_isDiffOn']);}['_onDiffChange'](_0x17891f){const _0x234657=this['_aiReviewCoreEditing']['getEditor']();_0x17891f?this['_aiReviewCoreUi']['hideDiffInBalloon']():this['_aiReviewCoreUi']['showDiffInBalloon'](),_0x234657&&_0x234657['editing']['view']['change'](_0x9af0a1=>{const _0x5ddc91=_0x234657['editing']['view']['document']['getRoot']();for(const _0x241ccb of _0x5ddc91['getClassNames']())_0x241ccb['startsWith']('ck-ai_review-')&&_0x9af0a1['removeClass'](_0x241ccb,_0x5ddc91);_0x9af0a1['addClass'](_0x17891f?'ck-ai_review-diff':'ck-ai_review-highlights',_0x5ddc91);});}async['_getChecksList'](){const _0x60fcfd=[...So,...this['_getExtraChecks']()],_0x3b484d=this['context']['config']['get']('ai.review.availableCommands')||[];this['_logErrorForNonExistentChecks'](_0x3b484d,_0x60fcfd);let _0x4fc88b=_0x60fcfd;this['_hasDefaultAvailableCommands']||(_0x4fc88b=_0x3b484d['map'](_0x3d3724=>_0x60fcfd['find'](_0xc47ece=>_0xc47ece['id']===_0x3d3724))['filter'](_0x5c3cd1=>!!_0x5c3cd1)),_0x4fc88b=_0x4fc88b['map'](_0x2c84f8=>_0x2c84f8['isExtra']?_0x2c84f8:this['_translateReviewCheck'](_0x2c84f8));const _0x546c97=_0x4fc88b['some'](_0x3137de=>_0x3137de['isExtra']||'custom'===_0x3137de['id']);let _0xf07821=[],_0x164ca6=[],_0xc59877=null;if(_0x546c97){const _0x2f1c0a=await this['_getModels']();_0xf07821=_0x2f1c0a['all'],_0x164ca6=_0x2f1c0a['recommended'],_0xc59877=_0x2f1c0a['default'];}const _0x37cab0=new No(_0xf07821,_0x164ca6,_0xc59877);return _0x37cab0['setupChecks'](_0x4fc88b),_0x546c97&&this['_filterChecksWithMissingModel'](_0x37cab0),_0x37cab0;}['_getExtraChecks'](){return(this['context']['config']['get']('ai.review.extraCommands')||[])['map'](_0x51020e=>({'id':_0x51020e['id'],'commandId':_0x51020e['id'],'title':_0x51020e['label'],'description':_0x51020e['description'],'isParameterized':!0x1,'isExtra':!0x0,'prompt':_0x51020e['prompt'],'model':_0x51020e['model']}));}['_logErrorForNonExistentChecks'](_0xb95a5e,_0x4e6b33){const _0x1ea6b9=_0xb95a5e['filter'](_0xff4263=>!_0x4e6b33['some'](_0x4669b2=>_0x4669b2['id']===_0xff4263));_0x1ea6b9['length']&&this['_logError'](new ot('ai-review-mode-non-existent-commands-used',this,{'commandIds':_0x1ea6b9['join'](',\x20')}),!0x0);}async['_getModels'](){try{const _0x5bdbc6=new Ks({'connector':this['_aiConnector'],'config':this['context']['config']['get']('ai.models'),'locale':this['context']['locale']});return{'all':await _0x5bdbc6['getAll'](),'recommended':await _0x5bdbc6['getAvailableModels'](),'default':await _0x5bdbc6['getDefault']()};}catch(_0x328f96){return this['_logError'](new ot('ai-review-mode-models-unable-to-retrieve',this,void 0x0,_0x328f96)),{'all':[],'recommended':[],'default':null};}}['_translateReviewCheck'](_0x15e39f){const _0x3b3723='AI_REVIEW_CHECK_'+_0x15e39f['id']['toUpperCase']()['replaceAll']('-','_'),_0x5e9735={..._0x15e39f,'title':this['_getTranslationWithDefault'](_0x3b3723+'_TITLE',_0x15e39f['title']),'description':this['_getTranslationWithDefault'](_0x3b3723+'_DESCRIPTION',_0x15e39f['description'])};return _0x15e39f['options']&&(_0x5e9735['options']=_0x15e39f['options']['map'](_0x1417af=>({..._0x1417af,'label':this['_getTranslationWithDefault'](_0x3b3723+'_OPTIONS_LABEL',_0x1417af['label']||''),'data':_0x1417af['data']?_0x1417af['data']['map'](_0x4f6f69=>({..._0x4f6f69,'label':this['_getTranslationWithDefault'](_0x3b3723+'_OPTIONS_DATA_'+_0x4f6f69['id']['toUpperCase'](),_0x4f6f69['label'])})):void 0x0}))),_0x5e9735;}['_filterChecksWithMissingModel'](_0x26f2fd){const _0x59ac09=[];_0x26f2fd['checks']['forEach'](_0x1022a3=>{(_0x1022a3 instanceof ko&&!_0x1022a3['defaultModel']||_0x1022a3 instanceof Oo&&!_0x1022a3['models']['length'])&&_0x59ac09['push'](_0x1022a3['id']);}),_0x59ac09['length']&&_0x59ac09['forEach'](_0x615780=>{_0x26f2fd['removeCheckById'](_0x615780),this['_logError'](new ot('ai-review-mode-command-unavailable-due-to-missing-model',this,{'commandId':_0x615780}),!0x0);});}}class Lo extends _0x5d2433{static get['requires'](){return[xo,Io,po];}static get['pluginName'](){return'AIReviewMode';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class Do extends bo{get['apiId'](){return'translate';}}class Po extends Ro{['setupChecks'](_0x16ffe2){this['_checks']=_0x16ffe2['map'](_0xef8c3e=>new Do(_0xef8c3e));}}class Ho extends wo{['_title'];constructor(_0x199b8d,_0x4e4c64,_0x2a1abf,_0x16938d,_0x4bd519,_0x34797f){super(_0x199b8d,_0x4e4c64,_0x2a1abf,_0x4bd519,_0x34797f),this['_title']=_0x16938d;}get['title'](){return this['_title'];}get['subTitle'](){return this['_sourceCheck']['title'];}}class Mo extends fo{static get['pluginName'](){return'AITranslateController';}constructor(_0x4f0eac){super(_0x4f0eac),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'](_0x3ca091,_0x447399){return new Ho(this['_aiReviewCoreEditing']['getDocumentData'](),_0x447399,this['_aiConnector'],cs(this['context']['locale'],'AI_REVIEW_CHECK_TRANSLATE_TITLE'),_0x3ca091['params'],_0x3ca091['args']);}['_onReviewCheckResultActivated'](_0x2fff68){this['_aiReviewCoreUi']['setActiveStateInResults'](_0x2fff68['change']['id']),this['_aiReviewCoreEditing']['setMarkersInElementAsActive'](_0x2fff68['change']['id']);}['_onReviewCheckResultDeactivated'](){this['_aiReviewCoreEditing']['setAllMarkersAsInactive'](),this['_aiReviewCoreUi']['resetActiveStateInResults']();}['_onActivateChange'](_0x12a911){this['_currentReviewCheckRun']&&('hover'===_0x12a911['uiInteraction']&&(this['_changeActivationSource']='panel',this['_currentReviewCheckRun']['activateChange'](_0x12a911['id'])),'click'===_0x12a911['uiInteraction']&&this['_scrollToChange'](_0x12a911['id']));}['_onDeactivateChange'](_0x3cf430){this['_currentReviewCheckRun']&&'panel'===_0x3cf430['origin']&&this['_currentReviewCheckRun']['deactivateChange']();}['_onChangeMarkerClicked'](_0xf85ce4,_0x12a41b){this['_currentReviewCheckRun']&&(this['_changeActivationSource']='content',this['_currentReviewCheckRun']['activateChange'](_0x12a41b['changeId']),this['_scrollToChange'](_0x12a41b['changeId']));}['_onChangeMarkerHovered'](_0x238e5c,_0x2b97fe){this['_currentReviewCheckRun']&&(this['_changeActivationSource']='content',this['_currentReviewCheckRun']['activateChange'](_0x2b97fe['changeId']),this['_aiReviewCoreEditing']['reactivateMarkers'](_0x2b97fe['changeId']));}['_onChangeMarkerBlurred'](){this['_currentReviewCheckRun']&&'content'===this['_changeActivationSource']&&(this['_currentReviewCheckRun']['deactivateChange'](),this['_aiReviewCoreEditing']['setAllMarkersAsInactive']());}['_getChangeContentElement'](_0x54a03a){return this['_aiReviewCoreEditing']['getContentElementForChange'](_0x54a03a);}['_markChangePositionInEditorContent'](_0x56624f,_0x31262d){this['_aiReviewCoreEditing']['markChangePositionInEditorContent'](_0x56624f,_0x31262d);}['_diffContent'](_0xc53174,_0x53140e){return this['_aiReviewCoreEditing']['diffContent'](_0xc53174,_0x53140e,!0x0);}['_onReviewCheckRun'](){const _0x121ae4=this['_aiReviewCoreEditing']['getEditor']();_0x121ae4&&_0x121ae4['editing']['view']['change'](_0x36b9a1=>{const _0x45878c=_0x121ae4['editing']['view']['document']['getRoot']();for(const _0x292c3d of _0x45878c['getClassNames']())(_0x292c3d['startsWith']('ck-ai-review-')||'ck-ai-translate-'===_0x292c3d)&&_0x36b9a1['removeClass'](_0x292c3d,_0x45878c);_0x36b9a1['addClass']('ck-ai-translate-mode-content',_0x45878c);});}async['_getChecksList'](){const _0x40a71d=[],_0x42a726=this['context']['config']['get']('ai.translate.languages')||[];for(const _0x17a607 of _0x42a726)_0x40a71d['push']({'title':_0x17a607['label'],'id':_0x17a607['id'],'commandId':_0x17a607['id'],'description':'','isParameterized':!0x1,'useArgs':!0x0,'args':{'language':_0x17a607['id']}});const _0x587d4f=new Po();return _0x587d4f['setupChecks'](this['_translateChecks'](_0x40a71d)),_0x587d4f;}['_translateChecks'](_0x575884){return _0x575884['map'](_0x2341f8=>{const _0x4564dc='AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_'+_0x2341f8['title']['toUpperCase']()['replaceAll']('-','_');return{..._0x2341f8,'title':this['_getTranslationWithDefault'](_0x4564dc,_0x2341f8['title'])};});}}class Uo extends ro{constructor(_0x4cf6a1,_0x3250e1){super(_0x4cf6a1,_0x3250e1),this['on']('set:isLoading',(_0x167dfb,_0xd556ca,_0x35ad3c)=>{_0x35ad3c&&(this['headerTitle']=cs(this['locale'],'AI_TRANSLATE_CHECK_RESULTS_LOADING_TITLE'));}),this['on']('set:isResultReady',(_0x272cec,_0xdcf160,_0x547334)=>{_0x547334&&(this['headerTitle']=cs(this['locale'],'AI_TRANSLATE_CHECK_RESULTS_READY_TITLE'));});}['_createAcceptAllButtonView'](){const _0x1a5d71=super['_createAcceptAllButtonView']();return _0x1a5d71['set']('label',cs(this['locale'],'AI_TRANSLATE_ACCEPT_ALL')),_0x1a5d71;}['_createExitReviewButtonView'](){const _0x2732f4=super['_createExitReviewButtonView']();return _0x2732f4['set']('label',cs(this['locale'],'AI_CHAT_HISTORY_CANCEL')),_0x2732f4;}}class Vo extends go{['_setupTemplate'](){const _0x304132=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-translate__check-list-wrapper',_0x304132['if']('isVisible','ck-hidden',_0x11ba02=>!_0x11ba02)]},'children':[{'tag':'div','attributes':{'class':['ck-ai-translate__check-list-header']},'children':[{'tag':'h2','children':[{'text':cs(this['locale'],'AI_TRANSLATE_CHECK_LIST_HEADER_TITLE')}]},{'tag':'p','children':[{'text':cs(this['locale'],'AI_TRANSLATE_CHECK_LIST_HEADER_DESCRIPTION')}]}]},{'tag':'div','attributes':{'class':['ck-ai_review__check-list',_0x304132['if']('isVisible','ck-hidden',_0x4feb10=>!_0x4feb10)]},'children':this['_checkViews']}]});}}class Bo extends eo{static get['pluginName'](){return'AITranslateUI';}['createMainView'](){const _0x30cda8=this['context']['locale'],_0xae7359=new _0x27cd18(_0x30cda8,{'label':cs(_0x30cda8,'AI_REVIEW_CHECK_TRANSLATE_TITLE'),'icon':_0x29e343,'class':'ck-ai-header\x20ck-ai-header_review-translate'}),_0x45ec2b=new so(_0x30cda8,{'header':_0xae7359,'list':new Vo(_0x30cda8),'results':new Uo(_0x30cda8,{'generalErrorText':cs(_0x30cda8,'AI_TRANSLATE_GENERAL_ERROR_MESSAGE')}),'completed':new ao(_0x30cda8,{'headerText':cs(_0x30cda8,'AI_TRANSLATE_FINISH_HEADER_TITLE'),'emptyResultsText':cs(_0x30cda8,'AI_TRANSLATE_EMPTY_RESULTS_TEXT'),'buttonText':cs(_0x30cda8,'AI_TRANSLATE_FINISH_BUTTON_LABEL')})});return _0x45ec2b['extendTemplate']({'attributes':{'class':'ck-ai-translate-mode'}}),_0x45ec2b;}['registerTab'](){const _0x17e1e8=this['context']['plugins']['get']('AITabs');_0x17e1e8['view']['on']('activateTab',(_0x56650d,_0x194299)=>{'translate'===_0x194299?this['fire']('getReviewCheckList'):this['fire']('leaveReview');}),_0x17e1e8['view']['addTab']({'id':'translate','buttonLabel':cs(this['context']['locale'],'AI_REVIEW_CHECK_TRANSLATE_TITLE'),'buttonIcon':_0x29e343,'order':0x0,'content':this['_mainView']});}}class Go extends _0x5d2433{static get['requires'](){return[Mo,Bo,po];}static get['pluginName'](){return'AITranslate';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}export{za as AIActions,Oi as AIAdapter,zi as AIAssistant,qi as AIAssistantUI,fa as AIBalloon,_a as AIChat,Qs as AIChatController,da as AIChatHistory,ua as AIChatHistoryController,ha as AIChatHistoryUI,Ea as AIChatShortcuts,ia as AIChatUI,hs as AIConnector,zs as AIEditing,ka as AIEditorIntegration,ja as AIQuickActions,Ba as AIQuickActionsUI,ki as AIRequestError,bo as AIReviewCheck,To as AIReviewCheckResult,Co as AIReviewCheckRun,Lo as AIReviewMode,fo as AIReviewModeController,po as AIReviewModeEditing,Io as AIReviewModeUI,os as AITabs,Ji as AITextAdapter,Ta as AIToggleButtonUI,Go as AITranslate,Mo as AITranslateController,Bo as AITranslateUI,ts as AWSTextAdapter,Zi as OpenAITextAdapter,vi as ShowAIAssistantCommand,pa as ToggleAICommand,_s as createResizeButton,ji as getDefaultAICommands};
23
+ import{Plugin as _0x44ca98,Command as _0x1f824d,ContextPlugin as _0x474324,Editor as _0x867bd7}from'@ckeditor/ckeditor5-core/dist/index.js';import{IconCopy as _0x47de82,IconCheck as _0x1d53d5,IconError as _0x40881a,IconSubmit as _0x5b23cb,IconAIHistory as _0x25afa9,IconMagicWand as _0x25ca03,IconRobotPencil as _0x8cd104,IconMaximize as _0x5e2027,IconMinimize as _0x78d435,IconShowChangesOn as _0x3f61e6,IconShowChangesOff as _0x5b5c9e,IconDocument as _0x50a35b,IconBoxWithCross as _0x4a0b81,IconBoxWithCheck as _0x25a285,IconBoxWithMarker as _0xd0fde5,IconInfo as _0x2d51f0,IconWeb as _0x182219,IconCancel as _0x2a335e,IconSelection as _0x48df06,IconFileUpload as _0x3748e7,IconLink as _0x4b5c8c,IconBulb as _0x499404,IconAI as _0x4a4be2,IconPreviousArrow as _0x11b6ce,IconDocumentOutline as _0x224477,IconLoupe as _0xfad3e1,IconPaperClip as _0x5bf39d,IconBrowseFiles as _0x26c4ef,IconDropdownArrow as _0x28906d,IconStop as _0x57d95b,IconAIChat as _0x352240,IconPlus as _0x488048,IconPin as _0x8ef1cb,IconThreeHorizontalDots as _0xcca7fb,IconAIReview as _0x220492,IconAITranslate as _0x2a0a11,IconAIAskAI as _0x4d8f34,IconThumbUp as _0x58f916,IconThumbDown as _0x4943a3,IconChevronDown as _0x4b489c,IconChevronUp as _0x457a91,IconAIQuickActions as _0x52c012,IconAIChatCommands as _0x1122f9,IconAIImproveWriting as _0x5119d5,IconAIContinueWriting as _0xbbbe39,IconAIGrammarCheck as _0x318753,IconAIAdjustLength as _0x5cc689,IconAIChangeTone as _0x542ac8,IconAIOther as _0x2ced03,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,toArray as It,EmitterMixin as Et,logWarning as pt,logError as Tt,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 _0x17eb16,HighlightedTextView as _0x3d1ec8,ViewCollection as _0x534e2b,FileDialogButtonView as _0x20d2f6,InputTextView as _0x23359c,SearchTextView as _0x1776e0,ListItemButtonView as _0x1758b4,ButtonLabelWithHighlightView as _0x191714,DropdownMenuPanelPositioningFunctions as _0x1270c6,BalloonToolbar as _0xc99ac8,FormRowView as _0x5be496,TextareaView as _0x370151}from'@ckeditor/ckeditor5-ui/dist/index.js';import{ClipboardPipeline as _0x3585c4,ClipboardMarkersUtils as _0x532889}from'@ckeditor/ckeditor5-clipboard/dist/index.js';import{ViewDocumentDomEventData as _0x1326a1,ViewDataTransfer as _0x31e237,ViewUpcastWriter as _0xdd338e,Matcher as _0x5181ab,_DetachOperation as _0x423138,_insertIntoModelNodeList as _0x2b661c,_removeFromModelNodeList as _0x2372d2,ModelRange as _0x40a8b3,transformOperationSets as _0x1b1979,ViewDowncastWriter as _0x49c9be,ModelDocumentFragment as _0x270bfa,ModelPosition as _0xf89124,ModelTreeWalker as _0xf38d26,MarkerOperation as _0x2b7839,InsertOperation as _0x557237}from'@ckeditor/ckeditor5-engine/dist/index.js';import{unescape as _0x57e376,escape as _0x316a01,cloneDeep as _0x4fc2fe,escapeRegExp as _0x8cd30a,debounce as _0x1259e4}from'es-toolkit/compat';import{BedrockRuntimeClient as _0x452ea5,InvokeModelWithResponseStreamCommand as _0x4d1608,InvokeModelCommand as _0x51865a}from'@aws-sdk/client-bedrock-runtime';import{createParser as _0x30da2c}from'eventsource-parser';import{CloudServices as _0x439a11}from'@ckeditor/ckeditor5-cloud-services/dist/index.js';import{parseDocument as _0x34e772}from'htmlparser2';import{isTag as _0x1b7c52,findOne as _0x57d34f,getParent as _0x517ce8,findAll as _0x368e40,removeElement as _0x35c3c7,replaceElement as _0x171cde,prepend as _0x26965d,prependChild as _0x16b61c,appendChild as _0x698e34,append as _0x6779d3,find as _0x55c8ed,isComment as _0x5702a0,getChildren as _0x2b3b2c,textContent as ti}from'domutils';import _0x3fc46a from'dom-serializer';import{Document as _0x39de98,Element as _0x58105d,Text as _0x106606,cloneNode as _0x467547,isDocument as _0x55bd11,isText as _0x23c989,NodeWithChildren as _0x426907}from'domhandler';import{MarkdownGfmMdToHtmlDefaultPlugins as _0x5b36d7,MarkdownGfmMdToHtml as _0x23e7e8}from'@ckeditor/ckeditor5-markdown-gfm/dist/index.js';import _0x48fdd8 from'rehype-sanitize';import{fixElementSuggestionRange as _0x1b2a38,DocumentCompare as _0x53366e,DATA_ID_MODEL_ATTRIBUTE as _0x33b43a,ConfirmMixin as _0x234900,getAllMarkersDomElementsSorted as _0x56b4d1,SuggestionsConversion as _0x21b190,DATA_ID_VIEW_ATTRIBUTE as _0x2a5868,getMarkerDomElement as _0x374d0e}from'@ckeditor/ckeditor5-collaboration-core/dist/index.js';import _0x5bfbdc from'morphdom';import{diffArrays as _0x4dc144}from'diff';const wi='_ungrouppedCommands';function fi(_0x38de40,_0x3e1296){const _0x1bee31=(0x0,_0x3e1296['t'])('Other');return _0x38de40['length']?'groupId'in _0x38de40[0x0]?_0x38de40:[{'groupId':wi,'groupLabel':_0x1bee31,'order':0x1/0x0,'commands':_0x38de40}]:[{'groupId':wi,'groupLabel':_0x1bee31,'order':0x1/0x0,'commands':[]}];}const Si=globalThis['DataTransfer'],bi='ai-ui';class Ri extends _0x44ca98{static get['pluginName'](){return'AIAssistantEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const {editor:_0xa389ef}=this,_0x22a86a=['ck-fake-ai-selection'];_0xa389ef['config']['get']('ai.assistant.useTheme')&&_0x22a86a['push']('ck-ai-assistant-ui_theme'),_0xa389ef['conversion']['for']('editingDowncast')['markerToHighlight']({'model':bi,'view':{'classes':_0x22a86a,'priority':0xc}}),_0xa389ef['conversion']['for']('editingDowncast')['markerToElement']({'model':bi,'view':(_0x5b70ad,{writer:_0x595722})=>{if(!_0x5b70ad['markerRange']['isCollapsed'])return null;const _0x48e3dc=_0x595722['createUIElement']('span');return _0x595722['addClass'](['ck-fake-ai-selection','ck-fake-ai-selection_collapsed'],_0x48e3dc),_0x48e3dc;}});}['afterInit'](){!async function(_0x189c27){const _0x4b1830=_0x542217([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]),_0x54a6af=0x3dffc4e1,_0x318b5a=0x3df84169^_0x54a6af,_0x308aee=window[_0x542217([0x44,0x61,0x74,0x65])][_0x542217([0x6e,0x6f,0x77])](),_0x343a94=_0x189c27[_0x542217([0x65,0x64,0x69,0x74,0x6f,0x72])],_0x1b9812=new window[(_0x542217([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x16b72c=>{_0x343a94[_0x542217([0x6f,0x6e,0x63,0x65])](_0x542217([0x72,0x65,0x61,0x64,0x79]),_0x16b72c);}),_0x2a5a54={[_0x542217([0x6b,0x74,0x79])]:_0x542217([0x45,0x43]),[_0x542217([0x75,0x73,0x65])]:_0x542217([0x73,0x69,0x67]),[_0x542217([0x63,0x72,0x76])]:_0x542217([0x50,0x2d,0x32,0x35,0x36]),[_0x542217([0x78])]:_0x542217([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]),[_0x542217([0x79])]:_0x542217([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]),[_0x542217([0x61,0x6c,0x67])]:_0x542217([0x45,0x53,0x32,0x35,0x36])},_0x5daf30=_0x343a94[_0x542217([0x63,0x6f,0x6e,0x66,0x69,0x67])][_0x542217([0x67,0x65,0x74])](_0x542217([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79]));async function _0x49f550(){let _0x37d8c6,_0xd9c246=null,_0x6a0d43=null;try{if(_0x5daf30==_0x542217([0x47,0x50,0x4c]))return _0x542217([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]);if(_0x37d8c6=_0x21ed2f(),!_0x37d8c6)return _0x542217([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);return _0x37d8c6[_0x542217([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])]&&(_0x6a0d43=_0x13707e(_0x37d8c6[_0x542217([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])],_0x37d8c6[_0x542217([0x6a,0x74,0x69])])),await _0x42304d()?_0x5a4a2a()?_0x2ccab6()?_0x542217([0x45,0x78,0x70,0x69,0x72,0x65,0x64]):_0x2a56b9()?(_0x37d8c6[_0x542217([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x542217([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e])&&(_0xd9c246=_0x125487(_0x542217([0x45,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e,0x4c,0x69,0x6d,0x69,0x74]))),await _0x133829()):_0x542217([0x44,0x6f,0x6d,0x61,0x69,0x6e,0x4c,0x69,0x6d,0x69,0x74]):_0x542217([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]):_0x542217([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}catch{return _0x542217([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}function _0x2ccab6(){const _0xfffdd7=[_0x542217([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e]),_0x542217([0x74,0x72,0x69,0x61,0x6c])][_0x542217([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x37d8c6[_0x542217([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])])?_0x308aee/0x3e8:0xe10*_0x318b5a;return _0x37d8c6[_0x542217([0x65,0x78,0x70])]<_0xfffdd7;}function _0x5a4a2a(){const _0x1083cf=_0x37d8c6[_0x542217([0x66,0x65,0x61,0x74,0x75,0x72,0x65,0x73])];return!!_0x1083cf&&(!!_0x1083cf[_0x542217([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x542217([0x2a]))||!!_0x1083cf[_0x542217([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x542217([0x41,0x49])));}function _0x2a56b9(){const _0x4cf868=_0x37d8c6[_0x542217([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x64,0x48,0x6f,0x73,0x74,0x73])];if(!_0x4cf868||0x0==_0x4cf868[_0x542217([0x6c,0x65,0x6e,0x67,0x74,0x68])])return!0x0;const {hostname:_0x121937}=new URL(window[_0x542217([0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e])]['href']);if(_0x4cf868[_0x542217([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x121937))return!0x0;const _0x34b726=_0x121937[_0x542217([0x73,0x70,0x6c,0x69,0x74])](_0x542217([0x2e]));return _0x4cf868[_0x542217([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x5e62d8=>_0x5e62d8[_0x542217([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x542217([0x2a])))[_0x542217([0x6d,0x61,0x70])](_0x37e973=>_0x37e973[_0x542217([0x73,0x70,0x6c,0x69,0x74])](_0x542217([0x2e])))[_0x542217([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x7ce5f9=>_0x7ce5f9[_0x542217([0x6c,0x65,0x6e,0x67,0x74,0x68])]<=_0x34b726[_0x542217([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0x542217([0x6d,0x61,0x70])](_0x23ffd4=>Array(_0x34b726[_0x542217([0x6c,0x65,0x6e,0x67,0x74,0x68])]-_0x23ffd4[_0x542217([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0x542217([0x66,0x69,0x6c,0x6c])](_0x23ffd4[0x0]===_0x542217([0x2a])?_0x542217([0x2a]):'')[_0x542217([0x63,0x6f,0x6e,0x63,0x61,0x74])](_0x23ffd4))[_0x542217([0x73,0x6f,0x6d,0x65])](_0x1b2da0=>_0x34b726[_0x542217([0x65,0x76,0x65,0x72,0x79])]((_0x332815,_0x3e1ba3)=>_0x1b2da0[_0x3e1ba3]===_0x332815||_0x1b2da0[_0x3e1ba3]===_0x542217([0x2a])));}function _0x133829(){return _0xd9c246&&_0x6a0d43?new window[(_0x542217([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x47071c,_0x367847)=>{_0xd9c246[_0x542217([0x74,0x68,0x65,0x6e])](_0x47071c,_0x367847),_0x6a0d43[_0x542217([0x74,0x68,0x65,0x6e])](_0x3f42ab=>{_0x3f42ab!=_0x542217([0x56,0x61,0x6c,0x69,0x64])&&_0x47071c(_0x3f42ab);},_0x367847);}):_0xd9c246||_0x6a0d43||_0x542217([0x56,0x61,0x6c,0x69,0x64]);}}function _0x13707e(_0x3b412f,_0x186b66){return new window[(_0x542217([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x2cf6a4=>{if(_0x960985())return _0x2cf6a4(_0x542217([0x56,0x61,0x6c,0x69,0x64]));_0x5a32a0(),_0x343a94[_0x542217([0x64,0x65,0x63,0x6f,0x72,0x61,0x74,0x65])](_0x542217([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]));let _0x26fa95=!0x1;const _0x180a13=at();function _0xc0a9bd(_0x2c01da){return!!_0x2c01da&&(typeof _0x2c01da===_0x542217([0x6f,0x62,0x6a,0x65,0x63,0x74])||typeof _0x2c01da===_0x542217([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]))&&typeof _0x2c01da[_0x542217([0x74,0x68,0x65,0x6e])]===_0x542217([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e])&&typeof _0x2c01da[_0x542217([0x63,0x61,0x74,0x63,0x68])]===_0x542217([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]);}function _0x47383d(_0x4e26b1){_0x51ec4b(_0x4e26b1)[_0x542217([0x74,0x68,0x65,0x6e])](_0x40b8c4=>{if(!_0x40b8c4||_0x40b8c4[_0x542217([0x73,0x74,0x61,0x74,0x75,0x73])]!=_0x542217([0x6f,0x6b]))return _0x542217([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]);return _0x4c9cc7(_0x1319e5(_0x180a13+_0x186b66))!=_0x40b8c4[_0x542217([0x76,0x65,0x72,0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6f,0x6e])]?_0x542217([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]):_0x542217([0x56,0x61,0x6c,0x69,0x64]);})[_0x542217([0x74,0x68,0x65,0x6e])](_0x44277e=>(_0x257dd1(),_0x44277e),()=>{const _0x59dec6=_0x38a826();return null==_0x59dec6?(_0x257dd1(),_0x542217([0x56,0x61,0x6c,0x69,0x64])):_0x542217(_0x308aee-_0x59dec6>(0x19f340e1^_0x54a6af)?[0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]:[0x56,0x61,0x6c,0x69,0x64]);})[_0x542217([0x74,0x68,0x65,0x6e])](_0x2cf6a4)[_0x542217([0x63,0x61,0x74,0x63,0x68])](()=>{_0x2cf6a4(_0x542217([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});const _0x40c22f=0x3dc92a61^_0x54a6af;function _0x257dd1(){const _0x5c7288=_0x542217([0x6c,0x6c,0x63,0x74,0x2d])+_0x4c9cc7(_0x1319e5(_0x3b412f)),_0x42ed44=_0x2f5bbd(_0x4c9cc7(window[_0x542217([0x4d,0x61,0x74,0x68])][_0x542217([0x63,0x65,0x69,0x6c])](_0x308aee/_0x40c22f)));window[_0x542217([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x542217([0x73,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x5c7288,_0x42ed44);}function _0x38a826(){const _0x1ec890=_0x542217([0x6c,0x6c,0x63,0x74,0x2d])+_0x4c9cc7(_0x1319e5(_0x3b412f)),_0x4ab92d=window[_0x542217([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x542217([0x67,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x1ec890);return _0x4ab92d?window[_0x542217([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x2f5bbd(_0x4ab92d),0x10)*_0x40c22f:null;}function _0x51ec4b(_0x49db1b){return new window[(_0x542217([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x251336,_0x222726)=>{_0x49db1b[_0x542217([0x74,0x68,0x65,0x6e])](_0x251336,_0x222726),window[_0x542217([0x73,0x65,0x74,0x54,0x69,0x6d,0x65,0x6f,0x75,0x74])](_0x222726,0x3dfe1021^_0x54a6af);});}}_0x343a94[_0x542217([0x6f,0x6e])](_0x542217([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),(_0x2f3a0b,_0x420078)=>{if(_0x420078[0x0]!=_0x3b412f)return _0x2cf6a4(_0x542217([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));_0x420078[0x1]={..._0x420078[0x1],[_0x542217([0x72,0x65,0x71,0x75,0x65,0x73,0x74,0x49,0x64])]:_0x180a13};},{[_0x542217([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x542217([0x68,0x69,0x67,0x68])}),_0x343a94[_0x542217([0x6f,0x6e])](_0x542217([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),_0x5b78a9=>{_0xc0a9bd(_0x5b78a9[_0x542217([0x72,0x65,0x74,0x75,0x72,0x6e])])&&(_0x26fa95=!0x0,_0x47383d(_0x5b78a9[_0x542217([0x72,0x65,0x74,0x75,0x72,0x6e])]));},{[_0x542217([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x542217([0x6c,0x6f,0x77])}),_0x1b9812[_0x542217([0x74,0x68,0x65,0x6e])](()=>{_0x26fa95||_0x2cf6a4(_0x542217([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});});function _0x960985(){return _0x343a94[_0x542217([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x542217([0x76,0x69,0x65,0x77])][_0x542217([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]==_0x542217([0x61,0x75,0x74,0x6f]);}function _0x5a32a0(){_0x343a94[_0x542217([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x542217([0x76,0x69,0x65,0x77])][_0x542217([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]=_0x542217([0x61,0x75,0x74,0x6f]);}}function _0x125487(_0x3047a2){const _0x38e132=[new window[(_0x542217([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x27626d=>setTimeout(_0x27626d,0x3df6fa2d^_0x54a6af)),_0x1b9812[_0x542217([0x74,0x68,0x65,0x6e])](()=>new window[(_0x542217([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x5b3cbc=>{let _0x3cbd32=0x0;_0x343a94[_0x542217([0x6d,0x6f,0x64,0x65,0x6c])][_0x542217([0x6f,0x6e])](_0x542217([0x61,0x70,0x70,0x6c,0x79,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e]),(_0xfed7dc,_0x246f2d)=>{_0x246f2d[0x0][_0x542217([0x69,0x73,0x44,0x6f,0x63,0x75,0x6d,0x65,0x6e,0x74,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e])]&&_0x3cbd32++,_0x3cbd32==(0x3dffc109^_0x54a6af)&&(_0x5b3cbc(),_0xfed7dc[_0x542217([0x6f,0x66,0x66])]());});}))];return window[_0x542217([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65])][_0x542217([0x72,0x61,0x63,0x65])](_0x38e132)[_0x542217([0x74,0x68,0x65,0x6e])](()=>_0x3047a2);}async function _0x11c0f7(){await _0x1b9812,_0x343a94[_0x542217([0x6d,0x6f,0x64,0x65,0x6c])][_0x542217([0x63,0x68,0x61,0x6e,0x67,0x65])]=_0x364d06,_0x343a94[_0x542217([0x6d,0x6f,0x64,0x65,0x6c])][_0x542217([0x65,0x6e,0x71,0x75,0x65,0x75,0x65,0x43,0x68,0x61,0x6e,0x67,0x65])]=_0x364d06,_0x343a94[_0x542217([0x65,0x6e,0x61,0x62,0x6c,0x65,0x52,0x65,0x61,0x64,0x4f,0x6e,0x6c,0x79,0x4d,0x6f,0x64,0x65])](_0x542217([0x6d,0x6f,0x64,0x65,0x6c]));}function _0x5eb00d(_0x51cffe){const _0x46feff=_0x1f326a();_0x343a94[_0x46feff]=_0x542217([0x61,0x69,0x4c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79])+_0x51cffe,_0x51cffe!=_0x542217([0x56,0x61,0x6c,0x69,0x64])&&_0x11c0f7();}function _0x1f326a(){const _0x55f69e=window[_0x542217([0x53,0x74,0x72,0x69,0x6e,0x67])](window[_0x542217([0x70,0x65,0x72,0x66,0x6f,0x72,0x6d,0x61,0x6e,0x63,0x65])][_0x542217([0x6e,0x6f,0x77])]())[_0x542217([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](_0x542217([0x2e]),'');let _0x1b80a1=_0x542217([0x6e]);for(let _0x30736d=0x0;_0x30736d<_0x55f69e[_0x542217([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x30736d+=0x2){let _0xcba1fb=window[_0x542217([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x55f69e[_0x542217([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x30736d,_0x30736d+0x2));_0xcba1fb>=_0x4b1830[_0x542217([0x6c,0x65,0x6e,0x67,0x74,0x68])]&&(_0xcba1fb-=_0x4b1830[_0x542217([0x6c,0x65,0x6e,0x67,0x74,0x68])]),_0x1b80a1+=_0x4b1830[_0xcba1fb];}return _0x1b80a1;}function _0x21ed2f(){const _0x3f163f=_0x5daf30[_0x542217([0x73,0x70,0x6c,0x69,0x74])](_0x542217([0x2e]));if(0x3!=_0x3f163f[_0x542217([0x6c,0x65,0x6e,0x67,0x74,0x68])])return null;return _0x4e2076(_0x3f163f[0x1]);function _0x4e2076(_0x564132){const _0x561cb6=_0x8703e8(_0x564132);return _0x561cb6&&_0x588258()?_0x561cb6:null;function _0x588258(){const _0x195e33=_0x561cb6[_0x542217([0x6a,0x74,0x69])],_0x4d170b=window[_0x542217([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x195e33[_0x542217([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x195e33[_0x542217([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8),0x10),_0x1774fe={..._0x561cb6,[_0x542217([0x6a,0x74,0x69])]:_0x195e33[_0x542217([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](0x0,_0x195e33[_0x542217([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8)};return delete _0x1774fe[_0x542217([0x76,0x63])],_0x1319e5(_0x1774fe)==_0x4d170b;}}}async function _0x42304d(){let _0xdf4b64=!0x0;try{const _0x4d2095=_0x5daf30[_0x542217([0x73,0x70,0x6c,0x69,0x74])](_0x542217([0x2e])),[_0x35fb90,_0x20a24b,_0x24eab2]=_0x4d2095;return _0x192d73(_0x35fb90),await _0x1bf7d2(_0x35fb90,_0x20a24b,_0x24eab2),_0xdf4b64;}catch{return!0x1;}function _0x192d73(_0x33ef37){const _0x4f976b=_0x8703e8(_0x33ef37);_0x4f976b&&_0x4f976b[_0x542217([0x61,0x6c,0x67])]==_0x542217([0x45,0x53,0x32,0x35,0x36])||(_0xdf4b64=!0x1);}async function _0x1bf7d2(_0x3fe109,_0x4239eb,_0xc4cbfd){const _0x49bf35=window[_0x542217([0x55,0x69,0x6e,0x74,0x38,0x41,0x72,0x72,0x61,0x79])][_0x542217([0x66,0x72,0x6f,0x6d])](_0x9340d9(_0xc4cbfd),_0x54df23=>_0x54df23[_0x542217([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](0x0)),_0x2d5f54=new window[(_0x542217([0x54,0x65,0x78,0x74,0x45,0x6e,0x63,0x6f,0x64,0x65,0x72]))]()[_0x542217([0x65,0x6e,0x63,0x6f,0x64,0x65])](_0x3fe109+_0x542217([0x2e])+_0x4239eb),_0x294324=window[_0x542217([0x63,0x72,0x79,0x70,0x74,0x6f])][_0x542217([0x73,0x75,0x62,0x74,0x6c,0x65])];if(!_0x294324)return;const _0x9d470c=await _0x294324[_0x542217([0x69,0x6d,0x70,0x6f,0x72,0x74,0x4b,0x65,0x79])](_0x542217([0x6a,0x77,0x6b]),_0x2a5a54,{[_0x542217([0x6e,0x61,0x6d,0x65])]:_0x542217([0x45,0x43,0x44,0x53,0x41]),[_0x542217([0x6e,0x61,0x6d,0x65,0x64,0x43,0x75,0x72,0x76,0x65])]:_0x542217([0x50,0x2d,0x32,0x35,0x36])},!0x1,[_0x542217([0x76,0x65,0x72,0x69,0x66,0x79])]);await _0x294324[_0x542217([0x76,0x65,0x72,0x69,0x66,0x79])]({[_0x542217([0x6e,0x61,0x6d,0x65])]:_0x542217([0x45,0x43,0x44,0x53,0x41]),[_0x542217([0x68,0x61,0x73,0x68])]:{[_0x542217([0x6e,0x61,0x6d,0x65])]:_0x542217([0x53,0x48,0x41,0x2d,0x32,0x35,0x36])}},_0x9d470c,_0x49bf35,_0x2d5f54)||(_0xdf4b64=!0x1);}}function _0x8703e8(_0x485b1b){return _0x485b1b[_0x542217([0x73,0x74,0x61,0x72,0x74,0x73,0x57,0x69,0x74,0x68])](_0x542217([0x65,0x79]))?JSON[_0x542217([0x70,0x61,0x72,0x73,0x65])](_0x9340d9(_0x485b1b)):null;}function _0x9340d9(_0xf63c94){return window[_0x542217([0x61,0x74,0x6f,0x62])](_0xf63c94[_0x542217([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/-/g,_0x542217([0x2b]))[_0x542217([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/_/g,_0x542217([0x2f])));}function _0x1319e5(_0x2709cf){let _0x4bf3c0=0x1505;function _0x58c5d3(_0x26ea01){for(let _0x193f9b=0x0;_0x193f9b<_0x26ea01[_0x542217([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x193f9b++){const _0x322f00=_0x26ea01[_0x542217([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](_0x193f9b);_0x4bf3c0=(_0x4bf3c0<<0x5)+_0x4bf3c0+_0x322f00,_0x4bf3c0&=_0x4bf3c0;}}function _0x3f3be7(_0x4e956f){Array[_0x542217([0x69,0x73,0x41,0x72,0x72,0x61,0x79])](_0x4e956f)?_0x4e956f[_0x542217([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](_0x3f3be7):_0x4e956f&&typeof _0x4e956f==_0x542217([0x6f,0x62,0x6a,0x65,0x63,0x74])?Object[_0x542217([0x65,0x6e,0x74,0x72,0x69,0x65,0x73])](_0x4e956f)[_0x542217([0x73,0x6f,0x72,0x74])]()[_0x542217([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](([_0x1e50db,_0x338fc9])=>{_0x58c5d3(_0x1e50db),_0x3f3be7(_0x338fc9);}):_0x58c5d3(window[_0x542217([0x53,0x74,0x72,0x69,0x6e,0x67])](_0x4e956f));}return _0x3f3be7(_0x2709cf),_0x4bf3c0>>>0x0;}function _0x4c9cc7(_0x57f245){return _0x57f245[_0x542217([0x74,0x6f,0x53,0x74,0x72,0x69,0x6e,0x67])](0x10)[_0x542217([0x70,0x61,0x64,0x53,0x74,0x61,0x72,0x74])](0x8,_0x542217([0x30]));}function _0x2f5bbd(_0x19c200){return _0x19c200[_0x542217([0x73,0x70,0x6c,0x69,0x74])]('')[_0x542217([0x72,0x65,0x76,0x65,0x72,0x73,0x65])]()[_0x542217([0x6a,0x6f,0x69,0x6e])]('');}function _0x364d06(){}function _0x542217(_0x5911d0){return _0x5911d0['map'](_0x457315=>String['fromCharCode'](_0x457315))['join']('');}_0x5eb00d(await _0x49f550());}(this);}['showFakeVisualSelection'](){const _0x2d7fb7=this['editor']['model'];_0x2d7fb7['change'](_0x22fdea=>{const _0x59a25a=_0x2d7fb7['document']['selection']['getRanges']();let _0x3757e9=0x0;for(const _0xabebb4 of _0x59a25a){const _0x27c835=bi+':'+_0x3757e9;if(_0x2d7fb7['markers']['has'](_0x27c835))_0x22fdea['updateMarker'](_0x27c835,{'range':_0xabebb4});else{if(_0xabebb4['start']['isAtEnd']){const _0x1a18d5=_0xabebb4['start']['getLastMatchingPosition'](({item:_0x58b1b9})=>!_0x2d7fb7['schema']['isContent'](_0x58b1b9),{'boundaries':_0xabebb4});_0x22fdea['addMarker'](_0x27c835,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x22fdea['createRange'](_0x1a18d5,_0xabebb4['end'])});}else _0x22fdea['addMarker'](_0x27c835,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0xabebb4});}_0x3757e9++;}});}['hideFakeVisualSelection'](){const _0x1b7316=this['editor']['model'],_0x5ec998=Array['from'](this['editor']['model']['markers']['getMarkersGroup'](bi));_0x5ec998['length']&&_0x1b7316['change'](_0x3c2726=>{_0x5ec998['forEach'](_0x354404=>{_0x3c2726['removeMarker'](_0x354404);});});}['insertContent'](_0x41745e,_0x2073f3){const _0x481625=this['_getAISelection'](),_0x34c230=_0x2073f3||_0x481625['getFirstRange']();this['editor']['model']['canEditAt'](_0x34c230)&&this['editor']['model']['change'](_0x591998=>{this['hideFakeVisualSelection'](),_0x2073f3||this['_resetContentOfSelectedTableCells'](_0x591998,_0x481625),this['_pasteHTMLUsingClipboard']({'insertAt':_0x34c230,'writer':_0x591998,'html':_0x41745e});});}['insertContentBelow'](_0x56f106){const {model:_0x345bfb}=this['editor'],_0xed837d=this['_getAISelection']();_0x345bfb['change'](()=>{const _0x5bdaf6=this['_prepareTableInsertBelowPosition'](_0x56f106,_0xed837d)||this['_getDefaultInsertBelowPosition'](_0xed837d);this['insertContent'](_0x56f106,_0x5bdaf6);});}['_getAISelection'](){const _0xc9cbe0=this['editor']['model'],_0x465790=Array['from'](_0xc9cbe0['markers']['getMarkersGroup'](bi))['map'](_0x23c535=>_0x23c535['getRange']());return _0xc9cbe0['createSelection'](_0x465790);}['_pasteHTMLUsingClipboard']({writer:_0x59b8e8,html:_0x543d55,insertAt:_0x1569ca}){const {view:_0x576558}=this['editor']['editing'],_0x829580=this['editor']['plugins']['get'](_0x3585c4),_0xe4008c=new Si();_0xe4008c['setData']('text/html',_0x543d55);const _0x52815f=new ClipboardEvent('paste',{'clipboardData':_0xe4008c}),_0x329650=new _0x1326a1(_0x576558,_0x52815f,{'dataTransfer':new _0x31e237(_0xe4008c)});_0x59b8e8['setSelection'](_0x1569ca);const _0x4128e2=(_0xd3c7db,_0x207e1f)=>{_0x207e1f['resultRange']&&_0x59b8e8['setSelection'](_0x207e1f['resultRange']);};_0x829580['once']('contentInsertion',_0x4128e2,{'priority':'lowest'}),_0x576558['document']['fire']('paste',_0x329650),_0x829580['off']('contentInsertion',_0x4128e2);}['_getDefaultInsertBelowPosition'](_0xc3a796){const {model:_0x4d9a4c}=this['editor'],_0x34b15=Array['from'](_0xc3a796['getSelectedBlocks']());return _0x34b15['length']?_0x4d9a4c['createPositionAfter'](_0x34b15['pop']()):_0xc3a796['getLastPosition']();}['_prepareTableInsertBelowPosition'](_0xc6dd6a,_0x5be89c){const {model:_0x2be353,plugins:_0xbfaabd}=this['editor'];if(_0xbfaabd['has']('TableUtils')){const _0x4d139d=_0xbfaabd['get']('TableUtils')['getSelectedTableCells'](_0x5be89c);if(_0x4d139d['length']){const _0x3ae10f=this['_getTableRowCountFromContent'](_0xc6dd6a),_0x335661=this['_createEmptyTableRows'](_0x4d139d,_0x3ae10f);return _0x2be353['createPositionAt'](_0x335661,0x0);}}return null;}['_getTableRowCountFromContent'](_0x111aca){const _0x4943c2=this['editor']['plugins']['get']('TableUtils'),_0x5a576c=this['editor']['data']['parse'](_0x111aca),_0x19ac06=Array['from'](_0x5a576c['getChildren']())['filter'](_0x1f4bf2=>_0x1f4bf2['is']('element','table'));let _0xd8faa1=0x0;return _0x19ac06['forEach'](_0x57ab27=>{_0xd8faa1+=_0x4943c2['getRows'](_0x57ab27);}),_0xd8faa1;}['_createEmptyTableRows'](_0x158e21,_0x41d969){const _0x1f8cc4=this['editor']['plugins']['get']('TableUtils'),_0x3298b2=_0x1f8cc4['getRowIndexes'](_0x158e21),_0x4ef164=_0x1f8cc4['getColumnIndexes'](_0x158e21),_0x2ce9ea=_0x3298b2['last']+0x1,_0x2dbf62=_0x4ef164['first'],_0x428586=_0x158e21[0x0]['findAncestor']('table');for(let _0x1e40c3=0x0;_0x1e40c3<_0x41d969;_0x1e40c3++)_0x1f8cc4['insertRows'](_0x428586,{'at':_0x2ce9ea});return _0x428586['getChild'](_0x2ce9ea)['getChild'](_0x2dbf62);}['_resetContentOfSelectedTableCells'](_0x1643ad,_0x5e603d){const {plugins:_0x101a28}=this['editor'],{model:_0x5368ca}=_0x1643ad;if(!_0x101a28['has']('TableUtils'))return;_0x101a28['get']('TableUtils')['getSelectedTableCells'](_0x5e603d)['length']&&_0x5368ca['deleteContent'](_0x5e603d);}}class Oi extends _0x44ca98{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 ki extends Error{constructor(_0x3f5c5b){super(_0x3f5c5b),this['name']='AIRequestError';}}function Ni(_0x30ed9c,_0x46274d,_0x265040){const t=_0x30ed9c['t'];switch(_0x46274d){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',_0x265040);case'Error\x20during\x20AI\x20content\x20generation:\x20%0':return t('Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x265040);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'},_0x265040);case'AI_ERROR_CONTEXT_LENGTH':return t({'id':'AI_ERROR_CONTEXT_LENGTH','string':'Selected\x20content\x20is\x20too\x20long'});case'AI_ERROR_MODERATION':return t({'id':'AI_ERROR_MODERATION','string':'Requested\x20query\x20does\x20not\x20pass\x20moderation\x20rules'});case'AI_ERROR_FAILED':return t({'id':'AI_ERROR_FAILED','string':'Failed\x20to\x20communicate\x20with\x20the\x20AI\x20service'});default:return _0x46274d;}}class vi extends _0x1f824d{['_commandDefinitions'];constructor(_0x1511a3,_0x27ba0d){super(_0x1511a3),this['_commandDefinitions']=_0x27ba0d,this['set']('enabledCommandsIds',[]),this['on']('change:_hasContext',(_0x239c5e,_0x425ccf,_0x335769)=>{this['isEnabled']&&(this['enabledCommandsIds']=yi(this['_commandDefinitions'],_0x335769));}),this['set']('_hasContext',!0x1),this['on']('change:isEnabled',(_0x108ac6,_0x123ca4,_0xff1772)=>{this['enabledCommandsIds']=_0xff1772?yi(this['_commandDefinitions'],this['_hasContext']):[];});}['refresh'](){const _0x18382c=this['editor']['model'];this['_hasContext']=function(_0x133bdf){const _0x337053=_0x133bdf['document']['selection'];return _0x337053['isCollapsed']?0x0!==[..._0x337053['getSelectedBlocks']()]['length']&&![..._0x337053['getSelectedBlocks']()][0x0]['isEmpty']:!!_0x133bdf['hasContent'](_0x337053['getFirstRange']());}(_0x18382c);const _0x377be6=_0x18382c['document']['selection'],_0x2840d3=this['editor']['config']['get']('ai.assistant.disabledElements');for(const _0x2c3cf5 of _0x377be6['getRanges']())for(const _0x1be1c2 of _0x2c3cf5['getItems']())if(_0x1be1c2['is']('element')&&_0x2840d3['includes'](_0x1be1c2['name']))return void(this['isEnabled']=!0x1);this['isEnabled']=!0x0;}['execute'](_0x5d759d='',_0x1c257c='',_0x378e14='custom'){this['editor']['plugins']['get'](qi)['showUI'](_0x5d759d,_0x1c257c,_0x378e14);}}function yi(_0x84e2ca,_0xc30be4){const _0x2a94a8=new Set();for(const _0x7d36e6 of _0x84e2ca['values']())(_0xc30be4||!0x1===_0x7d36e6['requiresContent'])&&_0x2a94a8['add'](_0x7d36e6['id']);return Array['from'](_0x2a94a8);}const xi=new RegExp(/^(.*?)<[a-zA-Z][a-zA-Z0-9_\-.]*[ >]/,'is');class Li extends/* #__PURE__ -- @preserve */
24
+ ht(){['editor'];['textAdapter'];['view'];['_sanitizationContainer'];['_domParser'];['_xmlSerializer'];constructor(_0x8e5730,_0x7a8af9,_0x2e1291){super(),this['editor']=_0x8e5730,this['textAdapter']=_0x7a8af9,this['_sanitizationContainer']=document['createElement']('div'),this['_domParser']=new DOMParser(),this['_xmlSerializer']=new XMLSerializer(),this['view']=_0x2e1291,this['set']({'initialContext':'','currentContext':'','currentResponse':'','previousContext':void 0x0,'previousQuery':void 0x0,'previousLabel':void 0x0,'isProcessing':!0x1}),this['on']('set:currentContext',(_0x42b0fa,_0x33be46,_0xfccd88)=>{this['view']['value']=this['_sanitizeHTML'](_0xfccd88);}),this['listenTo'](this['view'],'submitPrompt',(_0x4b9b29,_0x998f8c)=>{const _0x40f5b8=this['currentContext']||this['initialContext'];this['_handleQuery'](_0x998f8c,_0x40f5b8,'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:_0xb95017,query:_0x55a58e,htmlContent:_0x4ab32d,label:_0x9e2bc8,mainActionLabel:_0x90e8cf}){this['view']['prompt']=_0x9e2bc8,this['view']['mainAction']=_0x90e8cf,this['initialContext']=_0x4ab32d,_0x55a58e&&(this['view']['isRendered']?this['_handleQuery'](_0x55a58e,_0x4ab32d,_0xb95017,_0x9e2bc8):this['view']['once']('render',()=>{this['_handleQuery'](_0x55a58e,_0x4ab32d,_0xb95017,_0x9e2bc8);}));}['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'](_0x4adc99,_0x2d07f4,_0x2f5a2b,_0x56d416){return this['isProcessing']=!0x0,this['view']['startProcessing'](),this['previousContext']=_0x2d07f4,this['previousQuery']=_0x4adc99,this['previousLabel']=_0x56d416||_0x4adc99,this['previousActionId']=_0x2f5a2b,new Promise(_0x5c3600=>{this['textAdapter']['makeRequest']({'query':_0x4adc99,'context':_0x2d07f4,'onData':_0x31aa6c=>{this['currentResponse']=_0x31aa6c,this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse']);},'actionId':_0x2f5a2b})['then'](()=>{!this['currentContext']&&this['currentResponse']&&(this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse'],!0x0));})['catch'](_0x7158c7=>{_0x7158c7 instanceof ki?this['view']['handleError'](_0x7158c7['message']):this['view']['handleError'](),_0x5c3600();})['finally'](()=>{this['stopProcessing'](),_0x5c3600();});});}['_parseAndNormalizeContent'](_0x357200,_0x5872f7=!0x1){const _0x21edfa=xi['exec'](_0x357200);_0x357200=_0x21edfa?_0x357200['substring'](_0x21edfa[0x1]['length']):_0x357200['length']<0x64&&!_0x5872f7?'':this['_stripMarkdownSyntax'](_0x357200);const _0x1dcd10=this['_domParser']['parseFromString'](_0x357200,'text/html');if(_0x21edfa){const _0x34eb3a=Array['from'](_0x1dcd10['body']['childNodes']);_0x34eb3a['reverse']();for(const _0x3597db of _0x34eb3a){if(_0x3597db['nodeType']==Node['ELEMENT_NODE'])break;_0x3597db['remove']();}}const _0x496b81=this['editor']['data']['processor']['toView'](this['_xmlSerializer']['serializeToString'](_0x1dcd10['body']));this['_isH1TagSupportEnabled']()||this['_normalizeResponseHeadings'](_0x496b81);const _0x36cc6b=this['editor']['config']['get']('ai.assistant.preserveComments'),_0x3ff7fa=this['editor']['data']['toModel'](_0x496b81);return _0x36cc6b||_0x3ff7fa['markers']['clear'](),this['editor']['data']['stringify'](_0x3ff7fa);}['_normalizeResponseHeadings'](_0x4c690a){const _0xfcef16=new _0xdd338e(this['editor']['editing']['view']['document']),_0x105ceb=new _0x5181ab({'name':/^h[1-5]$/}),_0x1ef479=[];let _0x5b3a68=!0x1;for(const _0x34f134 of _0x4c690a)_0x34f134['is']('element')&&_0x105ceb['match'](_0x34f134)&&(_0x1ef479['push'](_0x34f134),'h1'==_0x34f134['name']&&(_0x5b3a68=!0x0));if(_0x5b3a68){for(const _0x5ced4d of _0x1ef479)_0xfcef16['rename']('h'+(parseInt(_0x5ced4d['name'][0x1])+0x1),_0x5ced4d);}}['_isH1TagSupportEnabled'](){const {data:_0x3b802b,editing:_0x20283f}=this['editor'],_0x102430=_0x3b802b['htmlProcessor']['toView']('<h1></h1>'),_0x528031=_0x3b802b['toView'](_0x3b802b['toModel'](_0x102430));return!!_0x20283f['view']['domConverter']['viewToDom'](_0x528031)['querySelector']('h1');}['_sanitizeHTML'](_0x2e8135){return this['editor']['editing']['view']['domConverter']['setContentOf'](this['_sanitizationContainer'],_0x2e8135),this['_sanitizationContainer']['innerHTML'];}['_stripMarkdownSyntax'](_0x3f93ec){const _0xf4b421=_0x3f93ec['trim']();return _0xf4b421['startsWith']('```html')?_0xf4b421['endsWith']('```')?_0xf4b421['substring'](0x7,_0xf4b421['length']-0x3):_0xf4b421['substring'](0x7):_0x3f93ec;}}const Di={'REPLACE':'replace','INSERT':'insert'};class Pi extends Ot{constructor(_0x4573c9){super(_0x4573c9),this['set']('isVisible',!0x1),this['set']('mainAction',Di['REPLACE']),this['replaceButton']=this['_createButton']('','ck-button-action'),this['replaceButton']['bind']('label')['to'](this,'mainAction',_0x54b31e=>Ni(_0x4573c9,'AI_'+_0x54b31e['toUpperCase']()+'_CONTENT')),this['insertButton']=this['_createButton'](Ni(_0x4573c9,'Insert\x20below')),this['tryAgainButton']=this['_createButton'](Ni(_0x4573c9,'Try\x20again')),this['stopButton']=this['_createButton'](Ni(_0x4573c9,'Stop'));const _0x3e8b2c=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-form__toolbar',_0x3e8b2c['if']('isVisible','ck-hidden',_0x316569=>!_0x316569)]}}),this['items']['addMany']([this['replaceButton'],this['insertButton'],this['tryAgainButton'],this['stopButton']]);}['_createButton'](_0x32d69d,_0x4d74f5){const _0x3fea82=new kt(this['locale']);return _0x3fea82['set']({'label':_0x32d69d,'class':_0x4d74f5||'','isVisible':!0x0,'withText':!0x0}),_0x3fea82;}}class Hi extends Nt{['contentFieldView'];['copyButtonView'];constructor(_0x31173a,_0x30e74d=''){super(_0x31173a),this['set']({'value':null,'isVisible':!0x1,'isProcessing':!0x1});const _0xc9c7b2=this['bindTemplate'];this['contentFieldView']=new Mi(_0x31173a,_0x30e74d),this['copyButtonView']=this['_createCopyButton'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area-wrapper',_0xc9c7b2['if']('isVisible','ck-hidden',_0x31bbcc=>!_0x31bbcc)],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area',_0xc9c7b2['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 _0x353cc5=!0x1;this['on']('change:value',(_0x58888b,_0x32417d,_0x1d746d)=>{const _0xeb0efe=!this['contentFieldView']['element']['querySelector']('.ck-ai-form__loader');this['contentFieldView']['setContent'](_0x1d746d),this['isProcessing']&&_0xeb0efe&&!_0x353cc5&&this['element']['scrollTo']({'top':this['element']['scrollHeight'],'behavior':'smooth'});}),this['on']('change:isProcessing',(_0x3b9e7d,_0x4185e5,_0x1d2eb3)=>{_0x353cc5=!0x1,_0x1d2eb3?(this['value']=null,this['contentFieldView']['appendLoader']()):this['value']||this['contentFieldView']['setContent']('');}),this['listenTo'](this['element'],'wheel',()=>{_0x353cc5=!0x0;}),this['listenTo'](this['element'],'mousedown',()=>{_0x353cc5=!0x0;});}['focus'](){this['element']['focus']();}['_createCopyButton'](){const _0x4ad7c5=this['locale'],_0xc8e446=new kt(this['locale']),_0x233db2='ck-ai-form__copy-button';return _0xc8e446['set']({'label':Ni(_0x4ad7c5,'Copy'),'icon':_0x47de82,'class':_0x233db2,'tooltip':!0x0}),_0xc8e446['bind']('isVisible')['to'](this,'value',_0x524882=>!!_0x524882),_0xc8e446['bind']('isEnabled')['to'](this,'isProcessing',_0x5e1b9f=>!_0x5e1b9f),_0xc8e446['on']('execute',()=>{this['_copyHTMLToClipboard'](this['contentFieldView']['element']),_0xc8e446['icon']=_0x1d53d5,_0xc8e446['class']=_0x233db2+'\x20ck-ai-form__copy-button--copied',this['focus'](),setTimeout(()=>{_0xc8e446['icon']=_0x47de82,_0xc8e446['class']=_0x233db2;},0x3e8);}),_0xc8e446;}['_copyHTMLToClipboard'](_0x5a45ac){const {window:_0x5884a8,document:_0x2e9c8e}=ct;if(_0x5884a8['ClipboardItem']){const {Blob:_0x59ca44,ClipboardItem:_0x176923}=_0x5884a8,_0x1b76af=[new _0x176923({'text/html':new _0x59ca44([_0x5a45ac['innerHTML']],{'type':'text/html'}),'text/plain':new _0x59ca44([_0x5a45ac['textContent']||''],{'type':'text/plain'})})];navigator['clipboard']['write'](_0x1b76af);}else{const _0x26fbcd=_0x2e9c8e['createElement']('div');_0x26fbcd['style']['position']='absolute',_0x26fbcd['style']['left']='-9999px',_0x26fbcd['innerHTML']='<span>[</span>'+_0x5a45ac['innerHTML']+'<span>]</span>',_0x2e9c8e['body']['appendChild'](_0x26fbcd);const _0x189f19=_0x2e9c8e['createRange']();_0x189f19['setStartAfter'](_0x26fbcd['firstElementChild']),_0x189f19['setEndBefore'](_0x26fbcd['lastElementChild']);const _0x349be5=_0x5884a8['getSelection']();_0x349be5['removeAllRanges'](),_0x349be5['addRange'](_0x189f19),_0x2e9c8e['execCommand']('copy'),_0x26fbcd['remove']();}}}class Mi extends Nt{constructor(_0x281064,_0x51daed=''){super(_0x281064),this['loaderView']=this['_createLoader'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content',_0x51daed,'ck-reset_all-excluded','ck-ai-form__content-field']}});}['setContent'](_0x96d54){this['element']['innerHTML']=_0x96d54;}['appendLoader'](){this['element']['appendChild'](this['loaderView']['element']);}['_createLoader'](){const _0xc7d16=new Nt(),_0x47468d=this['locale'],_0x29e932=new vt();return _0x29e932['isVisible']=!0x0,_0xc7d16['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__loader']},'children':[_0x29e932,{'text':Ni(_0x47468d,'AI\x20is\x20writing...')}]}),_0xc7d16['render'](),_0xc7d16;}}class Ui extends Nt{constructor(_0x37f08f,_0x99b284=''){super(_0x37f08f);const _0x29db31=new yt(),_0x352f80=this['bindTemplate'];this['set']('text',_0x99b284),_0x29db31['content']=_0x40881a,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__error']},'children':[_0x29db31,{'text':_0x352f80['to']('text')}]});}}class Vi extends xt{['submitButtonView'];['showHistoryButtonView'];constructor(_0x51b664,_0x1f5f83){super(_0x51b664,_0x1f5f83),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',(_0x27c08e,_0x338a5c)=>{_0x27c08e['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0x338a5c());});}['_createSubmitButton'](){const _0x442bf2=new kt(this['locale']),_0x2d40ac=this['locale'];return _0x442bf2['set']({'icon':_0x5b23cb,'label':Ni(_0x2d40ac,'Submit'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-form__submit'}),_0x442bf2['on']('execute',()=>{this['submit']();}),_0x442bf2['bind']('isEnabled')['to'](this['queryView']['fieldView'],'isEmpty',this,'isEnabled',(_0x4420bb,_0x8cb300)=>!_0x4420bb&&_0x8cb300),_0x442bf2;}['_createShowHistoryButton'](){const _0x4dd29d=new kt(this['locale']),_0x1cee68=this['resultsView'],_0x2fc3eb=this['locale'];_0x4dd29d['set']({'label':Ni(_0x2fc3eb,'History'),'withText':!0x1,'icon':_0x25afa9,'tooltip':!0x0,'tooltipPosition':'sw','class':'ck-ai-form__toggle-history'}),_0x4dd29d['bind']('isOn')['to'](_0x1cee68,'isVisible'),_0x4dd29d['bind']('isEnabled')['to'](this,'isEnabled'),_0x4dd29d['on']('execute',()=>{_0x1cee68['isVisible']=!_0x1cee68['isVisible'],_0x1cee68['isVisible']?this['filteredView']['focus']():this['focus']();});const _0x366fba=()=>{ct['window']['requestAnimationFrame'](()=>{if(lt(this['element'])){const _0x3055fa=new ut(this['queryView']['fieldView']['element']),_0x2793fb=_0x3055fa['width'],_0x4b0113='rtl'===_0x2fc3eb['uiLanguageDirection']?'left':'right';_0x3055fa['excludeScrollbarsAndBorders'](),_0x4dd29d['element']['style'][_0x4b0113]=_0x2793fb-_0x3055fa['width']+0x1+'px';}});};return this['queryView']['fieldView']['on']('update',_0x366fba),this['on']('render',_0x366fba),_0x4dd29d;}['submit'](){const _0x3d5fa6=this['queryView']['fieldView']['element']['value'];this['fire']('submit',_0x3d5fa6);}['focus'](_0x351054){-0x1===_0x351054?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}}class Bi extends Lt{['historyGroupView'];['clearHistoryButton'];constructor(_0x410ed0){super(_0x410ed0),this['clearHistoryButton']=this['_createClearHistoryButton'](),this['historyGroupView']=new Dt(),this['historyGroupView']['children']['add'](this['clearHistoryButton'],0x1),this['historyGroupView']['label']=Ni(_0x410ed0,'Prompt\x20history'),this['historyGroupView']['items']['delegate']('execute')['to'](this),this['items']['add'](this['historyGroupView']);}['filter'](){let _0x1436fb=0x0;for(const _0x5a8e31 of this['items'])_0x1436fb+=_0x5a8e31['items']['length'];return{'resultsCount':_0x1436fb,'totalItemsCount':_0x1436fb};}['_createClearHistoryButton'](){const _0x5c7a3c=this['locale'],_0x2d8d65=new kt(this['locale']);return _0x2d8d65['set']({'label':'('+Ni(_0x5c7a3c,'Clear')+')','withText':!0x0}),_0x2d8d65['on']('execute',()=>this['fire']('clearHistory')),_0x2d8d65;}}class Gi extends Pt{constructor(_0x100d85){super();const _0x6116cd=new Ht(),_0x254620=new kt(this['locale'],_0x6116cd);this['children']['add'](_0x254620),_0x254620['set']({'label':_0x100d85['prompt'],'withText':!0x0}),_0x254620['on']('execute',()=>{this['fire']('execute',{'value':_0x57e376(_0x100d85['prompt'])});});}}const Fi='CKEditor/AIFormView/PromptHistory';class Ki extends dt{constructor(){super(),this['_loadFromSessionStorage'](),this['on']('add',(_0x2c0fa7,_0x1ce806)=>{const _0x5c68bd=Wi(_0x1ce806['prompt']);for(const _0x480516 of this)if(_0x480516!=_0x1ce806&&Wi(_0x480516['prompt'])===_0x5c68bd){this['remove'](_0x480516);break;}this['length']>0x14&&this['remove'](this['last']),this['_saveToSessionStorage']();}),this['on']('remove',()=>{this['_saveToSessionStorage']();});}['_loadFromSessionStorage'](){const _0x491c17=sessionStorage['getItem'](Fi)||'[]';this['addMany'](JSON['parse'](_0x491c17));}['_saveToSessionStorage'](){sessionStorage['setItem'](Fi,JSON['stringify'](this['map'](_0x8fc02e=>_0x8fc02e)));}}function Wi(_0xb785b){return _0xb785b['toLowerCase']()['trim']();}class Yi extends Nt{['focusTracker'];['keystrokes'];['contentArea'];['toolbar'];['promptView'];['errorView'];['_focusables'];['focusCycler'];['_promptHistory'];constructor(_0x5f0fe5,_0x306894,_0x52359c=''){super(_0x5f0fe5),this['set']('isEnabled',!0x0),this['set']('isProcessing',!0x1),this['set']('prompt',''),this['set']('value',''),this['set']('isError',!0x1),this['set']('mainAction',Di['REPLACE']),this['_promptHistory']=new Ki(),this['errorView']=new Ui(_0x5f0fe5),this['contentArea']=new Hi(_0x5f0fe5,_0x52359c),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 _0x312019=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form',_0x306894],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form-content']},'children':[{'tag':'div','attributes':{'class':[_0x312019['if']('isError','ck-hidden',_0x55534f=>!_0x55534f)]},'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'](_0x52cee1=0x1){-0x1===_0x52cee1?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 _0xdef71c=this['locale'],_0x3f0ca7=new Vi(_0xdef71c,{'queryView':{'label':Ni(_0xdef71c,'Ask\x20AI\x20to\x20edit\x20or\x20generate'),'creator':Ut,'showIcon':!0x1,'showResetButton':!0x1},'infoView':{'text':{'noSearchableItems':{'primary':Ni(_0xdef71c,'Empty\x20history'),'secondary':Ni(_0xdef71c,'Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.')}}},'filteredView':this['_createHistoryView'](),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1});return _0x3f0ca7['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x5c5fa1,_0x54bbcf)=>_0x5c5fa1&&!_0x54bbcf),this['listenTo'](_0x3f0ca7,'submit',(_0x4b675f,_0x53dda9)=>{this['prompt']=_0x53dda9;const _0x491b62=_0x316a01(_0x53dda9);this['fire']('submitPrompt',_0x491b62),_0x53dda9['trim']()&&this['_promptHistory']['add']({'prompt':_0x491b62},0x0);},{'priority':'high'}),_0x3f0ca7;}['_createHistoryView'](){const _0x258add=new Bi(this['locale']);return _0x258add['historyGroupView']['items']['bindTo'](this['_promptHistory'])['as'](Gi),_0x258add['on']('clearHistory',()=>{this['_promptHistory']['clear'](),this['promptView']['search'](''),this['promptView']['focus']();}),_0x258add;}['_createToolbar'](){const _0x2d0ef9=new Pi(this['locale']);return _0x2d0ef9['replaceButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x20ab7a,_0x5eb8db,_0x23e317)=>_0x20ab7a&&!_0x5eb8db&&!!_0x23e317),_0x2d0ef9['replaceButton']['delegate']('execute')['to'](this,'replaceContent'),_0x2d0ef9['insertButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x40b223,_0x2f7775,_0x200535)=>_0x40b223&&!_0x2f7775&&!!_0x200535),_0x2d0ef9['insertButton']['delegate']('execute')['to'](this,'insertContentBelow'),_0x2d0ef9['tryAgainButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x8c470e,_0x490d27)=>_0x8c470e&&!_0x490d27),_0x2d0ef9['tryAgainButton']['delegate']('execute')['to'](this,'tryAgainEvent'),_0x2d0ef9['stopButton']['bind']('isEnabled')['to'](this,'isProcessing'),_0x2d0ef9['stopButton']['delegate']('execute')['to'](this,'stopProcessing'),_0x2d0ef9;}['startProcessing'](){this['value']='',this['isError']=!0x1,this['isProcessing']=!0x0,this['contentArea']['isVisible']=!0x0,this['toolbar']['isVisible']=!0x0,this['contentArea']['focus']();}['finishProcessing'](){const _0x829d77=this['locale'];this['isProcessing']=!0x1,this['prompt']='',this['promptView']['reset'](),this['value']&&(this['promptView']['queryView']['label']=Ni(_0x829d77,'Ask\x20AI\x20to\x20improve\x20generated\x20text'));}['handleError'](_0x2e9671){const _0x5be1bd=this['locale'];this['finishProcessing'](),this['isError']=!0x0,this['errorView']['text']=_0x2e9671||Ni(_0x5be1bd,'AI_ERROR_FAILED'),this['value']||(this['contentArea']['isVisible']=!0x1);}}const $i=globalThis['DataTransfer'];class qi extends _0x44ca98{['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[_0x532889,Ri,Oi,Vt];}constructor(_0x4cf72e){super(_0x4cf72e),_0x4cf72e['config']['define']('ai.assistant.disabledElements',['media','rawHtml','tableOfContents']),_0x4cf72e['config']['define']('ai.assistant.contentAreaCssClass',''),_0x4cf72e['config']['define']('ai.assistant.useTheme',!0x0),this['_uiCssClasses']='ck-ai-assistant-ui'+(_0x4cf72e['config']['get']('ai.assistant.useTheme')?'\x20ck-ai-assistant-ui_theme':'');}['init'](){const {editor:_0x3db507}=this;this['_aiAdapter']=_0x3db507['plugins']['get'](Oi),this['_dialog']=_0x3db507['plugins']['get'](Vt),this['_formView']=null,this['_commandDefinitions']=this['_getResolvedCommandsDefinitions']();const _0x24a8bb=new vi(_0x3db507,Array['from'](this['_commandDefinitions']['values']()));_0x3db507['commands']['add']('showAIAssistant',_0x24a8bb),_0x3db507['ui']['componentFactory']['add']('aiCommands',_0x132b40=>{const _0x4cf9aa=Bt(_0x132b40);return _0x4cf9aa['set']({'class':'ck-ai-commands-dropdown\x20'+this['_uiCssClasses']}),_0x4cf9aa['buttonView']['set']({'label':Ni(_0x132b40,'AI\x20Commands'),'icon':_0x25ca03,'tooltip':!0x0}),_0x4cf9aa['on']('execute',_0x3497df=>this['_onExecute'](_0x3497df['source']['id'])),Gt(_0x4cf9aa,_0x3db507['ui']['view']['body'],function(_0x5e67c2){const _0x218e21=fi(_0x5e67c2['config']['get']('ai.assistant.commands'),_0x5e67c2['locale']),_0x35981b=Xi(_0x5e67c2,_0x218e21)['filter'](_0x3c27af=>_0x3c27af['commands']['length']);if(0x1===_0x35981b['length'])return Xi(_0x5e67c2,_0x35981b[0x0]['commands'])['map'](_0x450915=>({'id':_0x450915['id'],'label':_0x450915['label']}));return _0x35981b['map'](_0x28c249=>{const {groupId:_0x170a47,groupLabel:_0x14d36f,commands:_0x8adf0f}=_0x28c249,_0x135280=Xi(_0x5e67c2,_0x8adf0f)['map'](_0x425490=>({'id':_0x425490['id'],'label':_0x425490['label']}));return{'id':_0x170a47,'menu':_0x14d36f||_0x170a47,'children':_0x135280};});}(_0x3db507),{'ariaLabel':Ni(_0x132b40,'AI\x20Commands')}),_0x4cf9aa['menuView']['menuPanelClass']='ck-ai-commands-dropdown\x20'+this['_uiCssClasses'],_0x24a8bb['on']('change:enabledCommandsIds',_0x1a2e79),_0x4cf9aa['menuView']['once']('render',_0x1a2e79),_0x4cf9aa;function _0x1a2e79(){_0x4cf9aa['isEnabled']=_0x24a8bb['enabledCommandsIds']['length']>0x0;for(const _0x24d436 of _0x4cf9aa['menuView']['buttons'])_0x24d436['isEnabled']=_0x24a8bb['enabledCommandsIds']['includes'](_0x24d436['id']);}}),_0x3db507['ui']['componentFactory']['add']('menuBar:aiCommands',_0x409109=>{const _0x4db43a=new Ft(_0x409109);_0x4db43a['buttonView']['set']({'label':Ni(_0x409109,'AI\x20Commands'),'icon':_0x25ca03}),_0x4db43a['bind']('isEnabled')['to'](_0x24a8bb,'enabledCommandsIds',_0x5188b2=>_0x5188b2['length']>0x0);const _0x51c113=fi(_0x3db507['config']['get']('ai.assistant.commands'),_0x409109);return this['_populateMenuBarMenu'](_0x24a8bb,_0x4db43a,_0x51c113,_0x3fac4c=>this['_onExecute'](_0x3fac4c)),_0x4db43a;}),_0x3db507['ui']['componentFactory']['add']('aiAssistant',()=>{const _0x1f5dbe=this['_createAIAssistantUIButton'](kt);return _0x1f5dbe['set']({'tooltip':!0x0,'class':'ck-ai-assistant-button\x20'+this['_uiCssClasses']}),_0x1f5dbe;}),_0x3db507['ui']['componentFactory']['add']('menuBar:aiAssistant',()=>{const _0xa71fde=this['_createAIAssistantUIButton'](Kt);return _0xa71fde['set']({'role':'menuitemcheckbox'}),_0xa71fde;}),this['licenseKey']=this['editor']['config']['get']('licenseKey');const _0x1925c4=this['editor'];this['_licenseKeyCheckInterval']=setInterval(()=>{let _0x2c9392;for(const _0x4567e2 in _0x1925c4){const _0x43ec42=_0x4567e2,_0x21ca15=_0x1925c4[_0x43ec42];if('aiLicenseKeyValid'==_0x21ca15||'aiLicenseKeyInvalid'==_0x21ca15||'aiLicenseKeyExpired'==_0x21ca15||'aiLicenseKeyDomainLimit'==_0x21ca15||'aiLicenseKeyNotAllowed'==_0x21ca15||'aiLicenseKeyEvaluationLimit'==_0x21ca15||'aiLicenseKeyUsageLimit'==_0x21ca15){delete _0x1925c4[_0x43ec42],_0x2c9392=_0x21ca15,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'aiLicenseKeyInvalid'==_0x2c9392&&_0x1925c4['_showLicenseError']('invalid'),'aiLicenseKeyExpired'==_0x2c9392&&_0x1925c4['_showLicenseError']('expired'),'aiLicenseKeyDomainLimit'==_0x2c9392&&_0x1925c4['_showLicenseError']('domainLimit'),'aiLicenseKeyNotAllowed'==_0x2c9392&&_0x1925c4['_showLicenseError']('featureNotAllowed','AIAssistant'),'aiLicenseKeyEvaluationLimit'==_0x2c9392&&_0x1925c4['_showLicenseError']('evaluationLimit'),'aiLicenseKeyUsageLimit'==_0x2c9392&&_0x1925c4['_showLicenseError']('usageLimit');},0x3e8);}['destroy'](){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}['showUI'](_0x3904d3='',_0x400e83='',_0x1faa39='custom'){const _0x2436d2=this['editor'],_0xa3e427=_0x2436d2['editing']['view'],_0x24e43c=_0x2436d2['plugins']['get'](Ri),_0x20cf94=_0x2436d2['plugins']['get'](_0x532889);_0x24e43c['showFakeVisualSelection']();const _0x28a091=new $i(),_0x19d468=new ClipboardEvent('copy',{'clipboardData':_0x28a091}),_0x140526=new _0x31e237(_0x28a091),_0x3a9187=new _0x1326a1(_0xa3e427,_0x19d468,{'dataTransfer':_0x140526});_0x20cf94['_forceMarkersCopy']('comment',()=>{_0xa3e427['document']['fire']('copy',_0x3a9187);}),this['_formView']||(this['_initView'](),this['_aiAssistantController']=new Li(_0x2436d2,this['_aiAdapter']['textAdapter'],this['_formView']));let _0x987364=_0x140526['getData']('text/html');const _0x5849fa=_0x2436d2['model']['document']['selection'],_0x5b1020=Array['from'](_0x5849fa['getRanges']());0x1===_0x5b1020['length']&&_0x5b1020[0x0]['isFlat']&&!_0x5849fa['getSelectedElement']()&&''!==_0x987364['replace'](/&nbsp;/g,'')['trim']()&&(_0x987364='<p>'+_0x987364+'</p>'),this['_aiAssistantController']['updateView']({'actionId':_0x1faa39,'query':_0x3904d3,'htmlContent':_0x987364,'label':_0x400e83,'mainActionLabel':Di[_0x2436d2['model']['document']['selection']['isCollapsed']?'INSERT':'REPLACE']}),'aiAssistant'!==this['_dialog']['id']?this['_dialog']['show']({'id':'aiAssistant','icon':_0x8cd104,'title':Ni(this['editor']['locale'],'AI\x20Assistant'),'content':this['_formView'],'position':Wt['EDITOR_TOP_SIDE'],'onShow':()=>{this['_formView']['focus']();},'onHide':()=>{this['_aiAssistantController']['reset'](),_0x24e43c['hideFakeVisualSelection']();}}):this['_dialog']['view']['wasMoved']||this['_dialog']['view']['updatePosition']();}['hideUI'](){this['_dialog']['hide']();}['_getResolvedCommandsDefinitions'](){const _0x451d10=new Map(),_0x28d548=fi(this['editor']['config']['get']('ai.assistant.commands'),this['editor']['locale']);for(const _0xac15c of _0x28d548)for(const _0x39e9ff of _0xac15c['commands'])_0x451d10['set'](_0x39e9ff['id'],{..._0x39e9ff,'groupId':_0xac15c['groupId'],'groupLabel':_0xac15c['groupLabel']||_0xac15c['groupId']});return _0x451d10;}['_createAIAssistantUIButton'](_0x1ee1f6){const _0x4eded5=this['editor'],_0x41b76e=_0x4eded5['commands']['get']('showAIAssistant'),_0x3630f0=new _0x1ee1f6(_0x4eded5['locale']);return _0x3630f0['set']({'label':Ni(_0x4eded5['locale'],'AI\x20Assistant'),'icon':_0x8cd104,'isToggleable':!0x0}),_0x3630f0['bind']('isEnabled')['to'](_0x41b76e),_0x3630f0['bind']('isOn')['to'](this['_dialog'],'id',_0x4a0fff=>'aiAssistant'===_0x4a0fff),this['listenTo'](_0x3630f0,'execute',()=>{_0x3630f0['isOn']?this['hideUI']():_0x41b76e['execute']();}),_0x3630f0;}['_initView'](){const _0x233d65=this['editor']['plugins']['get'](Ri);this['_formView']=new Yi(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',()=>{_0x233d65['insertContent'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['listenTo'](this['_formView'],'insertContentBelow',()=>{_0x233d65['insertContentBelow'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['_initAriaAiStatusChangeAnnouncements']();}['_initAriaAiStatusChangeAnnouncements'](){const {locale:_0x5f4446,ui:{ariaLiveAnnouncer:_0x2cab56}}=this['editor'];this['_formView']['contentArea']['on']('change:isProcessing',(_0x37983d,_0x3821ba,_0x2a7368)=>{const _0x18fac5=this['_aiAssistantController']['currentContext'];_0x2a7368?_0x2cab56['announce'](Ni(_0x5f4446,'AI\x20is\x20writing')):_0x18fac5&&_0x2cab56['announce'](Ni(_0x5f4446,'Generated\x20content:\x20%0',_0x18fac5),{'politeness':'polite','isUnsafeHTML':!0x0});}),this['_formView']['on']('change:isError',(_0x37b35c,_0xe6f23c,_0x5d3858)=>{if(_0x5d3858){const _0x5eff2a=this['_formView']['errorView']['text'];_0x2cab56['announce'](Ni(_0x5f4446,'Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x5eff2a));}});}['_onExecute'](_0x23ccaa){const _0x2aaefe=this['_commandDefinitions']['get'](_0x23ccaa),_0x511f97=this['editor'],_0x861d91=_0x511f97['model']['document']['selection'],_0x1a615b=_0x511f97['commands']['get']('showAIAssistant'),_0x4c838b=_0x511f97['plugins']['get'](Ri),_0x2d6d0f=''+(_0x2aaefe['groupId']!==wi?_0x2aaefe['groupLabel']+':\x20':'')+_0x2aaefe['label'];if(!0x1!==_0x2aaefe['requiresContent']&&_0x861d91['isCollapsed']){const _0x338558=gt(_0x861d91['getSelectedBlocks']())||_0x511f97['model']['schema']['getLimitElement'](_0x861d91);_0x511f97['model']['change'](_0x2036e7=>{_0x2036e7['setSelection'](_0x338558,'in');});}_0x4c838b['showFakeVisualSelection'](),_0x1a615b['execute'](_0x2aaefe['prompt'],_0x2d6d0f,'command:'+_0x23ccaa);}['_populateMenuBarMenu'](_0x12b9c7,_0xcdfb16,_0x59ea31,_0x573708){const _0x39e5ee=this['editor'],_0x16308d=_0x39e5ee['locale'],_0x1fe134=new Yt(_0x16308d),_0x2bc888=Xi(_0x39e5ee,_0x59ea31)['filter'](_0xb6d5b6=>_0xb6d5b6['commands']['length']);0x1===_0x2bc888['length']?this['_getMenuBarGroupButtons']({'command':_0x12b9c7,'commands':_0x2bc888[0x0]['commands'],'parentMenuView':_0xcdfb16,'onExecute':_0x573708})['forEach'](_0x439602=>_0x1fe134['items']['add'](_0x439602)):_0x2bc888['forEach'](({groupId:_0x232754,groupLabel:_0x53a300,commands:_0x3ae338})=>{const _0x5ed915=new $t(_0x16308d,_0xcdfb16),_0x42871c=new Ft(_0x16308d),_0x152b1a=new Yt(_0x16308d),_0x2888bb=this['_getMenuBarGroupButtons']({'command':_0x12b9c7,'commands':_0x3ae338,'parentMenuView':_0x42871c,'onExecute':_0x573708});_0x42871c['buttonView']['set']({'label':_0x53a300||_0x232754}),_0x42871c['delegate']('execute')['to'](_0xcdfb16),_0x152b1a['items']['addMany'](_0x2888bb),_0x42871c['panelView']['children']['add'](_0x152b1a),_0x5ed915['children']['add'](_0x42871c),_0x1fe134['items']['add'](_0x5ed915);}),_0xcdfb16['panelView']['children']['add'](_0x1fe134);}['_getMenuBarGroupButtons']({command:_0x2a0fa0,commands:_0x48ada2,parentMenuView:_0x14d563,onExecute:_0xd2b610}){const _0x38766e=this['editor'],_0x1685e2=_0x38766e['locale'];return Xi(_0x38766e,_0x48ada2)['map'](_0x53d122=>{const _0x9e42f8=new $t(_0x1685e2,_0x14d563),_0x1e6d26=new Kt(_0x1685e2);return _0x1e6d26['set']({'label':_0x53d122['label']}),_0x1e6d26['delegate']('execute')['to'](_0x14d563),_0x1e6d26['on']('execute',()=>_0xd2b610(_0x53d122['id'])),_0x1e6d26['bind']('isEnabled')['to'](_0x2a0fa0,'enabledCommandsIds',_0x3d6b6a=>_0x3d6b6a['includes'](_0x53d122['id'])),_0x9e42f8['children']['add'](_0x1e6d26),_0x9e42f8;});}}function Qi(_0xfc5072,_0x1c2ad0){return void 0x0!==_0xfc5072['order']&&void 0x0===_0x1c2ad0['order']?0x1:void 0x0===_0xfc5072['order']&&void 0x0!==_0x1c2ad0['order']?-0x1:void 0x0!==_0xfc5072['order']&&void 0x0!==_0x1c2ad0['order']?_0xfc5072['order']-_0x1c2ad0['order']:0x0;}function Xi(_0x253efa,_0x53016f){_0x53016f['sort'](Qi);const _0x2cd86b={},_0x2cb57d=[];for(const _0x882d10 of _0x53016f)if(void 0x0!==_0x882d10['order']){if(_0x882d10['order']in _0x2cd86b)throw new ot('ai-commands-config-order-collision',_0x253efa,{'conflictingDefinitions':[_0x882d10,_0x2cd86b[_0x882d10['order']]]});_0x2cd86b[_0x882d10['order']]=_0x882d10,_0x2cb57d['splice'](_0x882d10['order'],0x0,_0x882d10);}else _0x2cb57d['push'](_0x882d10);return _0x2cb57d;}class zi extends _0x44ca98{static get['requires'](){return[qi,Ri];}static get['pluginName'](){return'AIAssistant';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x16d286){super(_0x16d286);const _0x3388f8=_0x16d286['config'],_0x33b9e3=_0x16d286['locale'];_0x3388f8['define']('ai.assistant.preserveComments',!0x0),_0x3388f8['define']('ai.assistant.commands',ji(_0x33b9e3)),_0x3388f8['define']('ai.assistant.extraCommandGroups',[]),_0x3388f8['define']('ai.assistant.removeCommands',[]);let _0x22eb30=fi(_0x3388f8['get']('ai.assistant.commands'),_0x33b9e3);const _0x311918=_0x3388f8['get']('ai.assistant.extraCommandGroups'),_0x59a79d=_0x3388f8['get']('ai.assistant.removeCommands');_0x311918['forEach'](_0xf96ced=>{const _0x506667=_0x22eb30['find'](_0x4a6f87=>_0x4a6f87['groupId']===_0xf96ced['groupId']);_0x506667?_0x506667['commands']=_0x506667['commands']['concat'](_0xf96ced['commands']):_0x22eb30['push'](_0xf96ced);}),_0x22eb30=_0x22eb30['filter'](_0x3604ac=>!_0x59a79d['includes'](_0x3604ac['groupId'])),_0x22eb30['forEach'](_0x34a8f5=>{_0x34a8f5['commands']=_0x34a8f5['commands']['filter'](_0x3c036d=>!_0x59a79d['includes'](_0x3c036d['id']));}),_0x3388f8['set']('ai.assistant.commands',_0x22eb30);}}function ji(_0x4a87e6){return[{'groupId':'editOrReview','groupLabel':Ni(_0x4a87e6,'Edit\x20or\x20review'),'commands':[{'id':'improveWriting','label':Ni(_0x4a87e6,'Improve\x20writing'),'prompt':'Fix\x20spelling\x20mistakes,\x20use\x20proper\x20grammar\x20and\x20apply\x20good\x20writing\x20practices.\x20Do\x20not\x20lose\x20the\x20original\x20meaning.'},{'id':'makeShorter','label':Ni(_0x4a87e6,'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':Ni(_0x4a87e6,'Make\x20longer'),'prompt':'Improve\x20this\x20content\x20by\x20using\x20descriptive\x20language\x20and\x20inserting\x20more\x20information\x20and\x20more\x20detailed\x20explanations.'},{'id':'simplifyLanguage','label':Ni(_0x4a87e6,'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':Ni(_0x4a87e6,'Generate\x20from\x20selection'),'commands':[{'id':'summarize','label':Ni(_0x4a87e6,'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':Ni(_0x4a87e6,'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':Ni(_0x4a87e6,'Change\x20tone'),'commands':[{'id':'professional','label':Ni(_0x4a87e6,'Professional'),'prompt':'Improve\x20using\x20polished,\x20formal,\x20and\x20respectful\x20language\x20to\x20convey\x20professional\x20expertise\x20and\x20competence.'},{'id':'casual','label':Ni(_0x4a87e6,'Casual'),'prompt':'Improve\x20using\x20casual,\x20informal\x20language\x20to\x20convey\x20a\x20casual\x20conversation\x20with\x20a\x20real\x20person.'},{'id':'direct','label':Ni(_0x4a87e6,'Direct'),'prompt':'Improve\x20using\x20direct\x20language,\x20using\x20only\x20the\x20essential\x20information.'},{'id':'confident','label':Ni(_0x4a87e6,'Confident'),'prompt':'Improve\x20using\x20compelling,\x20optimistic\x20language\x20to\x20convey\x20confidence\x20in\x20the\x20writing.'},{'id':'friendly','label':Ni(_0x4a87e6,'Friendly'),'prompt':'Improve\x20using\x20friendly,\x20comforting\x20language,\x20to\x20convey\x20understanding\x20and\x20empathy.'}]},{'groupId':'changeStyle','groupLabel':Ni(_0x4a87e6,'Change\x20style'),'commands':[{'id':'business','label':Ni(_0x4a87e6,'Business'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20business\x20professional\x20with\x20formal\x20language.'},{'id':'legal','label':Ni(_0x4a87e6,'Legal'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20legal\x20professional\x20using\x20valid\x20legal\x20terminology.'},{'id':'journalism','label':Ni(_0x4a87e6,'Journalism'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20journalist\x20using\x20engaging\x20language\x20to\x20convey\x20the\x20importance\x20of\x20the\x20information.'},{'id':'poetic','label':Ni(_0x4a87e6,'Poetic'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20poem\x20using\x20poetic\x20techniques\x20without\x20losing\x20the\x20original\x20meaning.'}]},{'groupId':'translate','groupLabel':Ni(_0x4a87e6,'Translate'),'commands':[{'id':'translateEnglish','label':Ni(_0x4a87e6,'English'),'prompt':'Translate\x20the\x20content\x20to\x20English\x20language.'},{'id':'translateSpanish','label':Ni(_0x4a87e6,'Spanish'),'prompt':'Translate\x20the\x20content\x20to\x20Spanish\x20language.'},{'id':'translatePortuguese','label':Ni(_0x4a87e6,'Portuguese'),'prompt':'Translate\x20the\x20content\x20to\x20Portuguese\x20language.'},{'id':'translateGerman','label':Ni(_0x4a87e6,'German'),'prompt':'Translate\x20the\x20content\x20to\x20German\x20language.'},{'id':'translateFrench','label':Ni(_0x4a87e6,'French'),'prompt':'Translate\x20the\x20content\x20to\x20French\x20language.'},{'id':'translateChinese','label':Ni(_0x4a87e6,'Simplified\x20Chinese'),'prompt':'Translate\x20the\x20content\x20to\x20Simplified\x20Chinese\x20language.'},{'id':'translateHindi','label':Ni(_0x4a87e6,'Hindi'),'prompt':'Translate\x20the\x20content\x20to\x20Hindi\x20language.'},{'id':'translateArabic','label':Ni(_0x4a87e6,'Arabic'),'prompt':'Translate\x20the\x20content\x20to\x20Arabic\x20language.'}]}];}class Ji extends _0x44ca98{['abortController'];static get['requires'](){return[Oi];}constructor(_0x444c5f){super(_0x444c5f),this['abortController']=new AbortController();}['init'](){this['editor']['plugins']['get'](Oi)['textAdapter']=this;}['abort'](){this['abortController']['signal']['aborted']||(this['abortController']['abort'](),this['abortController']=new AbortController());}async['makeRequest'](_0xf60475){return this['sendRequest'](_0xf60475)['catch'](_0x1b4256=>{if(_0x1b4256 instanceof ki)return Promise['reject'](_0x1b4256);if('AbortError'==_0x1b4256['name'])return Promise['resolve']();throw console['error'](_0x1b4256),new ot('aitextadapter-send-request-failed',null);});}async['_prepareRequestHeaders'](_0x465f92,_0x3415bd){const _0x4ef69b=this['editor']['locale'],_0x1009ff={'Content-Type':'application/json'};if('object'==typeof _0x465f92)Object['assign'](_0x1009ff,_0x465f92);else{if(_0x465f92)try{const _0x2f3c74=await _0x465f92(_0x3415bd);Object['assign'](_0x1009ff,_0x2f3c74);}catch{return Promise['reject'](new ki(Ni(_0x4ef69b,'AI_ERROR_GET_HEADERS')));}}return _0x1009ff;}async['_prepareRequestParameters'](_0x4ef65f,_0x299ceb){const _0x290726=this['editor']['locale'];if('object'==typeof _0x4ef65f)return _0x4ef65f;try{return await _0x4ef65f(_0x299ceb);}catch{return Promise['reject'](new ki(Ni(_0x290726,'AI_ERROR_GET_PARAMETERS')));}}}class Zi extends Ji{['_apiUrl'];['_requestHeaders'];['_requestParameters'];static get['pluginName'](){return'OpenAITextAdapter';}constructor(_0x605ecd){super(_0x605ecd),_0x605ecd['config']['define']('ai.assistant.adapter.openAI.apiUrl','https://api.openai.com/v1/chat/completions'),_0x605ecd['config']['get']('ai.assistant.adapter.openAI.requestParameters')||_0x605ecd['config']['define']('ai.assistant.adapter.openAI.requestParameters',{'model':'gpt-4o','temperature':0x1,'top_p':0x1,'stream':!0x0}),this['_apiUrl']=_0x605ecd['config']['get']('ai.assistant.adapter.openAI.apiUrl'),this['_requestHeaders']=_0x605ecd['config']['get']('ai.assistant.adapter.openAI.requestHeaders')||{},this['_requestParameters']=_0x605ecd['config']['get']('ai.assistant.adapter.openAI.requestParameters');}async['sendRequest']({query:_0x458b11,context:_0x28b1fd,onData:_0x56f34f,actionId:_0x363ed0}){const _0x52b674=this['editor']['locale'],_0x18220f=await this['prepareMessages'](_0x458b11,_0x28b1fd,_0x363ed0),_0x4a3fd3=await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x363ed0),_0x21043c=await this['_prepareRequestParameters'](this['_requestParameters'],_0x363ed0),_0x28b3ed={'messages':_0x18220f,..._0x21043c},_0x5aa0bf={'method':'POST','headers':_0x4a3fd3,'body':JSON['stringify'](_0x28b3ed),'signal':this['abortController']['signal']},_0x3009b1=await fetch(this['_apiUrl'],_0x5aa0bf);if(_0x3009b1['ok'])return _0x21043c['stream']?await this['_readStreamableResponse'](_0x3009b1,_0x56f34f):await this['_readStaticResponse'](_0x3009b1,_0x56f34f),Promise['resolve']();{const _0x32183a=await _0x3009b1['text']();return _0x32183a['includes']('context_length_exceeded')?Promise['reject'](new ki(Ni(_0x52b674,'AI_ERROR_CONTEXT_LENGTH'))):_0x32183a['includes']('Moderation')?Promise['reject'](new ki(Ni(_0x52b674,'AI_ERROR_MODERATION'))):Promise['reject'](new Error(_0x32183a));}}async['prepareMessages'](_0x3432c2,_0x16dc95,_0x7ff87b){let _0x4fd56f,_0x5c5b79;return _0x16dc95?(_0x4fd56f='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.',_0x5c5b79='Instruction:\x0a'+_0x3432c2+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x16dc95):(_0x4fd56f='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.',_0x5c5b79=_0x3432c2),[{'role':'system','content':_0x4fd56f},{'role':'user','content':_0x5c5b79}];}async['_readStreamableResponse'](_0x553999,_0x4e1499){const _0x2fbac2=_0x553999['body']['getReader'](),_0x34af5e=new TextDecoder();let _0x25008c='',_0xb14029='',_0x50b212='',_0x1755bc=!0x1;for(;!_0x1755bc;){const {done:_0x5351ea,value:_0x4c865b}=await _0x2fbac2['read'](),_0x379cba=_0x25008c+_0x34af5e['decode'](_0x4c865b);let _0x373c1f='';_0x1755bc=_0x5351ea;try{_0x373c1f=this['_cleanUpData'](_0x379cba),_0x25008c='';}catch{_0x25008c=_0x379cba;continue;}_0xb14029+=_0x373c1f,!_0x1755bc&&this['_isBufferIncomplete'](_0xb14029)||_0xb14029&&(_0x50b212+=_0xb14029,_0xb14029='',_0x4e1499(_0x50b212));}return Promise['resolve']();}async['_readStaticResponse'](_0xc4197a,_0x30fb13){return _0x30fb13((await _0xc4197a['json']())['choices'][0x0]['message']['content']),Promise['resolve']();}['_isBufferIncomplete'](_0x439ebc){const _0xc969a2=_0x439ebc['split']('<')['length']!==_0x439ebc['split']('>')['length'],_0x41dac9=_0x439ebc['length']<0x1e;return _0xc969a2&&_0x41dac9;}['_cleanUpData'](_0x2394a3){return _0x2394a3['split'](/\n(?![^{]*\})/g)['map'](_0x176ccb=>_0x176ccb['replace']('data:\x20',''))['filter'](_0x1f2832=>_0x1f2832&&_0x1f2832['length']>0x0&&'[DONE]'!==_0x1f2832)['map'](_0x18fa57=>{const {choices:_0x4acc0b}=JSON['parse'](_0x18fa57);if(_0x4acc0b[0x0]?.['delta']?.['content'])return _0x4acc0b[0x0]['delta']['content'];})['filter'](_0xfdcac8=>_0xfdcac8)['join']('');}}class ts extends Ji{['_apiUrl'];['_requestHeaders'];['_bedrockClientConfig'];['_requestParameters'];static get['pluginName'](){return'AWSTextAdapter';}constructor(_0x504c81){super(_0x504c81),_0x504c81['config']['get']('ai.assistant.adapter.aws.requestParameters')||_0x504c81['config']['define']('ai.assistant.adapter.aws.requestParameters',{'model':'anthropic.claude-v2','max_tokens_to_sample':0x7d0,'temperature':0x1,'top_p':0x1,'top_k':0xfa,'anthropic_version':'bedrock-2023-05-31','stream':!0x0}),this['_apiUrl']=_0x504c81['config']['get']('ai.assistant.adapter.aws.apiUrl'),this['_bedrockClientConfig']=_0x504c81['config']['get']('ai.assistant.adapter.aws.bedrockClientConfig'),this['_requestHeaders']=_0x504c81['config']['get']('ai.assistant.adapter.aws.requestHeaders'),this['_requestParameters']=_0x504c81['config']['get']('ai.assistant.adapter.aws.requestParameters');}async['sendRequest']({query:_0x3acadd,context:_0xccf08e,onData:_0x14eecf,actionId:_0x3955e2}){const {model:_0x413144,stream:_0x21a471,..._0xd7857b}=await this['_prepareRequestParameters'](this['_requestParameters'],_0x3955e2),_0x2dd512={'prompt':await this['preparePrompt'](_0x3acadd,_0xccf08e,_0x413144,_0x3955e2),..._0xd7857b};this['_apiUrl']?await this['_processProxyRequest'](_0x2dd512,_0x413144,_0x21a471,_0x14eecf,_0x3955e2):await this['_processAWSRequest'](_0x2dd512,_0x413144,_0x21a471,_0x14eecf);}async['preparePrompt'](_0x528274,_0x13dad5,_0x4de57a,_0x1dbf4e){let _0x303f75,_0x247b71;return _0x13dad5?(_0x303f75='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.',_0x247b71='Instruction:\x0a'+_0x528274+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x13dad5):(_0x303f75='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.',_0x247b71=_0x528274),'meta.llama'==this['getModelFamily'](_0x4de57a)?'<<SYS>>\x0a'+_0x303f75+'\x0a<</SYS>>\x0a[INST]\x0a'+_0x247b71+'\x0a[/INST]':'Human:\x0a'+_0x303f75+'\x0a'+_0x247b71+'\x0a\x0aAssistant:';}['getModelFamily'](_0x41f1c4){if(/^anthropic\.claude/['test'](_0x41f1c4))return'anthropic.claude';if(/^ai21\.j2/['test'](_0x41f1c4))return'ai21.j2';if(/^cohere\.command/['test'](_0x41f1c4))return'cohere.command';if(/^meta\.llama/['test'](_0x41f1c4))return'meta.llama';throw new ki(Ni(this['editor']['locale'],'AI_ERROR_UNSUPPORTED_MODEL',_0x41f1c4));}async['_processProxyRequest'](_0x1deb51,_0x4d3447,_0x31f043,_0x45c168,_0x2b00cd){const _0x56335c={'method':'POST','headers':await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x2b00cd),'body':JSON['stringify']({..._0x1deb51,'model':_0x4d3447,'stream':_0x31f043}),'signal':this['abortController']['signal']},_0x147a9e=await fetch(this['_apiUrl'],_0x56335c);_0x31f043?await this['_readStreamableResponse'](_0x147a9e,_0x4d3447,_0x45c168):await this['_readStaticResponse'](_0x147a9e,_0x4d3447,_0x45c168);}async['_processAWSRequest'](_0x4309fb,_0x58b87c,_0x472551,_0x25e516){const _0x1df020=new _0x452ea5(this['_bedrockClientConfig']),_0x2d27bf={'body':JSON['stringify'](_0x4309fb),'contentType':'application/json','accept':'application/json','modelId':_0x58b87c};let _0x41391b;if(_0x472551){const _0x470e5d=new _0x4d1608(_0x2d27bf);_0x41391b=await _0x1df020['send'](_0x470e5d,{'abortSignal':this['abortController']['signal']}),await this['_readAsyncIterableResponse'](_0x41391b,_0x58b87c,_0x25e516);}else{const _0x5c9252=new _0x51865a(_0x2d27bf);_0x41391b=await _0x1df020['send'](_0x5c9252,{'abortSignal':this['abortController']['signal']}),await this['_readStaticResponse'](_0x41391b,_0x58b87c,_0x25e516);}}async['_readAsyncIterableResponse'](_0x11248f,_0x54778f,_0x4e7d86){const _0x4ff3df=_0x11248f['body'],_0x3739ac=new TextDecoder('utf-8');let _0x60e42c='';for await(const _0x24c649 of _0x4ff3df)if(_0x24c649['chunk']){const _0x42652e=_0x3739ac['decode'](_0x24c649['chunk']['bytes']),_0x45cd46=JSON['parse'](_0x42652e);_0x60e42c+=this['_getGeneratedText'](_0x45cd46,_0x54778f),_0x4e7d86(_0x60e42c);}return Promise['resolve']();}async['_readStreamableResponse'](_0x54c20d,_0x405b69,_0xd488f8){const _0x4a823b=_0x54c20d['body'],_0x4c69eb=new TextDecoder('utf-8'),_0x4da176=_0x4a823b['getReader']();let _0xcab28d='',_0x6be525='',_0x305519=!0x1;for(;!_0x305519;){const {done:_0x47ad3d,value:_0x56b32b}=await _0x4da176['read']();if(_0x305519=_0x47ad3d,_0x305519)break;const _0x4530df=(_0xcab28d+_0x4c69eb['decode'](_0x56b32b))['split']('\x0a')['map'](_0x57d8c5=>{try{return _0xcab28d='',JSON['parse'](_0x57d8c5);}catch{return _0xcab28d=_0x57d8c5,null;}})['filter'](_0x483cd9=>null!==_0x483cd9);_0x4530df['length']&&(_0x6be525+=_0x4530df['map'](_0x1b79e9=>this['_getGeneratedText'](_0x1b79e9,_0x405b69))['join'](''),_0xd488f8(_0x6be525));}return Promise['resolve']();}async['_readStaticResponse'](_0x217fcc,_0x294272,_0x1a3929){let _0x47b550;return _0x47b550=_0x217fcc instanceof Response?await _0x217fcc['json']():JSON['parse'](new TextDecoder('utf-8')['decode'](_0x217fcc['body'])),(_0x1a3929(this['_getGeneratedText'](_0x47b550,_0x294272)),Promise['resolve']());}['_getGeneratedText'](_0x177829,_0x46f8d9){switch(this['getModelFamily'](_0x46f8d9)){case'anthropic.claude':return _0x177829['completion'];case'ai21.j2':return _0x177829['completions'][0x0]['data']['text'];case'cohere.command':return _0x177829['generations'][0x0]['text'];case'meta.llama':return _0x177829['generation'];}}}class es extends kt{constructor(_0x35c431,_0x4894d8={}){super(_0x35c431),this['isToggleable']=!0x0,this['set']('side',_0x4894d8['side']||'top');const _0x414014=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-tab-button',...It(_0x4894d8['class']||[]),_0x414014['to']('side',_0x471455=>'ck-tab-button_'+_0x471455),_0x414014['to']('class')]}});}['show'](){this['set']('isVisible',!0x0);}['hide'](){this['set']('isVisible',!0x1);}}class is extends Nt{['children'];constructor(_0x12cfcf,_0x2c64c0={}){super(_0x12cfcf);const _0x3e2999=this['bindTemplate'];this['set']('isVisible',!0x1),this['set']('class',''),this['children']=this['createCollection'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck-tab-panel',...It(_0x2c64c0['class']||[]),_0x3e2999['to']('class'),_0x3e2999['if']('isVisible','ck-hidden',_0x9a7d57=>!_0x9a7d57)]},'children':this['children']});}['show'](){this['set']('isVisible',!0x0);}['hide'](){this['set']('isVisible',!0x1);}}class ss extends Nt{['buttonViews']=this['createCollection']();['panelViews']=this['createCollection']();['_tabs']=new Map();constructor(_0x5660f2,_0x59bf7a={}){super(_0x5660f2),this['set']('class',void 0x0),this['set']('activeTab',null),this['set']('side',_0x59bf7a['side']||'top'),this['set']('isMaximized',!0x1);const _0x65f672=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset','ck-tabs',...It(_0x59bf7a['class']||[]),_0x65f672['to']('side',_0x9a5971=>'ck-tabs_'+_0x9a5971),_0x65f672['to']('class'),_0x65f672['to']('isMaximized',_0x3961ae=>_0x3961ae?'ck-ai-tabs_maximized':'')],'tabindex':'0'},'children':[{'tag':'div','attributes':{'class':['ck','ck-tabs__buttons-container',_0x65f672['to']('side',_0x4df7fe=>'ck-tabs__buttons-container_'+_0x4df7fe)]},'children':this['buttonViews']},{'tag':'div','attributes':{'class':['ck','ck-tabs__panels-container',_0x65f672['to']('side',_0x140ae1=>'ck-tabs__panels-container_'+_0x140ae1)]},'children':this['panelViews']},...It(_0x59bf7a['children']||[])]});}['getTabIds'](){return[...this['_tabs']['keys']()];}['getTab'](_0x4cb570){const _0x2194c6=this['_tabs']['get'](_0x4cb570);return _0x2194c6||null;}['addTab'](_0x23c99b){const _0xb8ef8d=this['_setupButton']({'id':_0x23c99b['id'],'label':_0x23c99b['buttonLabel'],'icon':_0x23c99b['buttonIcon'],'order':_0x23c99b['order']}),_0x1c7e75=new is(this['locale']);return _0x1c7e75['render'](),_0x23c99b['content']&&_0x1c7e75['children']['add'](_0x23c99b['content']),this['panelViews']['add'](_0x1c7e75),this['_tabs']['set'](_0x23c99b['id'],{'button':_0xb8ef8d,'panel':_0x1c7e75,'order':void 0x0!==_0x23c99b['order']?_0x23c99b['order']:null}),this['fire']('addTab:'+_0x23c99b['id'],{'id':_0x23c99b['id'],'button':_0xb8ef8d,'panel':_0x1c7e75}),null===this['activeTab']?this['activateTab'](_0x23c99b['id']):this['_hidePanel'](_0x23c99b['id']),{'button':_0xb8ef8d,'panel':_0x1c7e75};}['activateTab'](_0x4abd2b){if(null!==_0x4abd2b&&!this['getTab'](_0x4abd2b))throw new ot('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0x4abd2b});this['activeTab']!==_0x4abd2b&&(this['activeTab']&&this['_hidePanel'](this['activeTab']),this['activeTab']=_0x4abd2b,_0x4abd2b&&this['_showPanel'](_0x4abd2b),this['fire']('activateTab:'+_0x4abd2b,_0x4abd2b));}['showTab'](_0x4038fc){if(!this['getTab'](_0x4038fc))throw new ot('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0x4038fc});this['_showPanel'](_0x4038fc),this['_showButton'](_0x4038fc),this['fire']('show:'+_0x4038fc,_0x4038fc);}['hideTab'](_0x470183){if(!this['getTab'](_0x470183))throw new ot('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0x470183});const _0xaa5773=this['activeTab'];this['_hidePanel'](_0x470183),this['_hideButton'](_0x470183);const _0x387a23=this['getTabIds']();_0xaa5773===_0x470183&&_0x387a23['length']>0x1&&this['activateTab'](_0x387a23['find'](_0xc4bd20=>_0xc4bd20!==_0x470183)),this['fire']('hide:'+_0x470183,_0x470183);}['_getPanel'](_0x39e4d2){const _0xae87b0=this['_tabs']['get'](_0x39e4d2);return _0xae87b0?_0xae87b0['panel']:null;}['_showPanel'](_0x3c90e1){null!==this['activeTab']&&this['activeTab']!==_0x3c90e1||this['_getPanel'](_0x3c90e1)['show']();}['_hidePanel'](_0x5154e0){const _0x18b166=this['_getPanel'](_0x5154e0);_0x18b166['isVisible']&&(this['activeTab']===_0x5154e0&&(this['activeTab']=null),_0x18b166['hide']());}['_getButton'](_0x23b9d9){const _0x1db79d=this['_tabs']['get'](_0x23b9d9);return _0x1db79d?_0x1db79d['button']:null;}['_showButton'](_0x36b783){this['_getButton'](_0x36b783)['show']();}['_hideButton'](_0xe05ea6){this['_getButton'](_0xe05ea6)['hide']();}['_setupButton'](_0x4c86e2){const _0x2af8e2=new es(this['locale'],{'side':this['side']}),_0x1a463b=this['buttonViews'];if(_0x2af8e2['set']({'label':_0x4c86e2['label'],'icon':_0x4c86e2['icon'],'tooltip':!0x0,'withText':!0x0}),_0x2af8e2['bind']('isOn')['to'](this,'activeTab',_0x179f6d=>_0x179f6d===_0x4c86e2['id']),_0x2af8e2['bind']('side')['to'](this,'side'),_0x4c86e2['order']){const _0x4ce63e=[...this['_tabs']]['reduce']((_0x442d49,_0x8cc4f)=>{const _0xdf6cc8=_0x8cc4f[0x0],{order:_0x5e69c9}=_0x8cc4f[0x1];return!_0x5e69c9||_0x5e69c9>_0x4c86e2['order']?_0x442d49:_0x5e69c9>=_0x442d49['order']?{'id':_0xdf6cc8,'order':_0x5e69c9}:_0x442d49;},{'id':'','order':0x0}),_0x2465bf=_0x1a463b['getIndex'](this['_getButton'](_0x4ce63e['id']));_0x1a463b['add'](_0x2af8e2,_0x2465bf+0x1);}else _0x1a463b['add'](_0x2af8e2);return _0x2af8e2['on']('execute',()=>{this['activateTab'](_0x4c86e2['id']);}),_0x2af8e2;}}const ns=['overlay','sidebar','custom'],rs=['left','right'];class as extends ss{constructor(_0x159692,_0x17e9c8={}){super(_0x159692,_0x17e9c8),this['set']('type',_0x17e9c8['type']||'sidebar'),this['set']('side',_0x17e9c8['side']||'right'),this['set']('isVisible',_0x17e9c8['visibleByDefault']??!0x0);const _0x38121d=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-tabs',_0x38121d['if']('type','ck-ai-tabs__overlay',_0x2c94d1=>'overlay'===_0x2c94d1),_0x38121d['if']('type','ck-ai-tabs__sidebar',_0xd75b62=>'sidebar'===_0xd75b62),_0x38121d['if']('isVisible','ck-hidden',_0x2a080a=>!_0x2a080a)]}}),this['buttonViews']['on']('add',(_0x3bc3fa,_0x6b2a45)=>{_0x6b2a45['set']('withText',!0x1);});}}class os extends _0x474324{['view'];['container']=null;['showResizeButton']=!0x0;static get['pluginName'](){return'AITabs';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x5785ec){super(_0x5785ec);const _0x274eb8=this['context']['config']['get']('ai.container');if(this['set']('side','right'),!_0x274eb8)throw new ot('ai-tabs-configuration-not-found');if(void 0x0!==_0x274eb8['showResizeButton']&&(this['showResizeButton']=_0x274eb8['showResizeButton']),'sidebar'!==_0x274eb8['type']&&'overlay'!==_0x274eb8['type']||_0x274eb8['side']&&(this['side']=_0x274eb8['side']),'sidebar'===_0x274eb8['type']){if(this['container']=_0x274eb8['element'],this['set']('type','sidebar'),!this['container'])throw new ot('ai-tabs-sidebar-container-element-not-found');}else'overlay'===_0x274eb8['type']?(this['container']=document['body'],this['set']('type','overlay')):(this['container']=null,this['set']('type','custom'));this['view']=new as(this['context']['locale'],{'side':this['side'],'type':this['type'],'visibleByDefault':void 0x0===_0x274eb8['visibleByDefault']||_0x274eb8['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 _0x867bd7&&this['context']['ui']['focusTracker']['add'](this['view']['element']);}['switchType'](_0x805315){if(_0x805315&&this['type']!==_0x805315){if(!ns['includes'](_0x805315))throw new ot('ai-tabs-unsupported-ui-type');this['type']=_0x805315;}}['switchSide'](_0x1a317d){if(_0x1a317d&&this['side']!==_0x1a317d){if(!rs['includes'](_0x1a317d))throw new ot('ai-tabs-unsupported-ui-side');this['side']=_0x1a317d;}}['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 hs extends _0x474324{['_apiUrl'];['_token'];['_decoder'];['_responseCache'];static get['requires'](){return[_0x439a11];}static get['pluginName'](){return'AIConnector';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x251b1e){super(_0x251b1e),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 _0x5b70fa=this['context']['plugins']['get'](_0x439a11);if(!_0x5b70fa['token'])throw new ot('ai-missing-token',this);this['_token']=_0x5b70fa['token'];}['startConversation'](_0x125a19,_0x5da0b4){const _0x4e9907=this['_sendApiRequest']('/conversations','POST',{'id':_0x125a19,'group':_0x5da0b4});return{'getConversation':async()=>(await _0x4e9907['request'])['json'](),'abortController':_0x4e9907['abortController']};}['queryAssistant']({message:_0x300145,conversationId:_0x44646d,parts:_0x1bb217,capabilities:_0x1237d6,model:_0x679ed1,attributes:_0x19193c}){const _0x478b17={'prompt':_0x300145,'content':_0x1bb217,'model':_0x679ed1,..._0x1237d6&&{'capabilities':_0x1237d6},..._0x19193c&&{'attributes':_0x19193c}},_0x268bf3=this['_sendApiRequest']('/conversations/'+_0x44646d+'/messages','POST',_0x478b17);return{'getStream':async()=>{const _0x12f601=(await _0x268bf3['request'])['body'];return this['_getStreamReader'](_0x12f601);},'abortController':_0x268bf3['abortController']};}['executeCustomAction']({content:_0x55c0f0,message:_0x2702e3,model:_0x4b87e4,outputFormat:_0x97046a}){const _0x1d8b65={'content':[{'type':'text','content':_0x55c0f0}],'prompt':_0x2702e3,'model':_0x4b87e4,'outputFormat':_0x97046a},_0x534488=this['_sendApiRequest']('/actions/custom/calls','POST',_0x1d8b65);return{'getStream':async()=>{const _0x350482=(await _0x534488['request'])['body'];return this['_getStreamReader'](_0x350482);},'abortController':_0x534488['abortController']};}['executeAction']({actionName:_0x43b197,content:_0x21af58,args:_0xa21d6a}){const _0x4a6205={'content':[{'type':'text','content':_0x21af58}],'args':_0xa21d6a},_0x3cecd5=this['_sendApiRequest']('/actions/system/'+_0x43b197+'/calls','POST',_0x4a6205);return{'getStream':async()=>{const _0x163faa=(await _0x3cecd5['request'])['body'];return this['_getStreamReader'](_0x163faa);},'abortController':_0x3cecd5['abortController']};}['uploadFile'](_0x33a3ec,_0x39a350,_0x13b378){const _0x2c0cee=new FormData();_0x2c0cee['append']('file',_0x39a350,_0x39a350['name']),_0x13b378&&_0x2c0cee['append']('attributes',JSON['stringify'](_0x13b378));const _0x530854=this['_sendApiRequest']('/conversations/'+_0x33a3ec+'/files','POST',_0x2c0cee);return{'getId':async()=>(await _0x530854['request'])['json'](),'abortController':_0x530854['abortController']};}['fetchDocument'](_0x5ec52f,_0x457ea4){const _0x5f43ab=this['_sendApiRequest']('/conversations/'+_0x5ec52f+'/documents/'+_0x457ea4,'GET');return{'getDocument':async()=>(await _0x5f43ab['request'])['json'](),'abortController':_0x5f43ab['abortController']};}['uploadDocument'](_0x30c899,_0x1e0658,_0x5b4769){const _0x1b6550={'content':_0x1e0658};_0x5b4769&&(_0x1b6550['attributes']=_0x5b4769);const _0x539dd2=this['_sendApiRequest']('/conversations/'+_0x30c899+'/documents','POST',_0x1b6550);return{'getId':async()=>(await _0x539dd2['request'])['json'](),'abortController':_0x539dd2['abortController']};}['fetchConversations'](_0x1bdb0b,_0x4ee550={}){const _0x17d31e=new URLSearchParams();_0x17d31e['append']('group',_0x1bdb0b),_0x17d31e['append']('excludeEmpty',!0x1!==_0x4ee550['excludeEmpty']?'true':'false'),_0x17d31e['append']('limit',_0x4ee550['limit']?_0x4ee550['limit']['toString']():'100'),_0x17d31e['append']('sortBy',_0x4ee550['sortBy']?_0x4ee550['sortBy']:'createdAt'),_0x17d31e['append']('order',_0x4ee550['order']?_0x4ee550['order']:'desc');const _0x4d3722=this['_sendApiRequest']('/conversations?'+_0x17d31e['toString'](),'GET');return{'getConversations':async()=>{const _0x1189e5=await _0x4d3722['request'];return(await _0x1189e5['json']())['items'];},'abortController':_0x4d3722['abortController']};}['deleteConversation'](_0x69cccc){const _0x52bf73=this['_sendApiRequest']('/conversations/'+_0x69cccc,'DELETE');return{'execute':async()=>{await _0x52bf73['request'];},'abortController':_0x52bf73['abortController']};}['updateConversation'](_0x57f380,_0x38f239){const _0x4e4b4a=this['_sendApiRequest']('/conversations/'+_0x57f380,'PATCH',_0x38f239);return{'getResult':async()=>(await _0x4e4b4a['request'],_0x38f239),'abortController':_0x4e4b4a['abortController']};}['fetchConversation'](_0x10c474){const _0x4b2a7c=this['_sendApiRequest']('/conversations/'+_0x10c474,'GET');return{'getConversation':async()=>(await _0x4b2a7c['request'])['json'](),'abortController':_0x4b2a7c['abortController']};}['fetchConversationMessages'](_0x4f1160){const _0x51e291=this['_sendApiRequest']('/conversations/'+_0x4f1160+'/messages','GET');return{'getMessages':async()=>{const _0x468508=await _0x51e291['request'];return(await _0x468508['json']())['items'];},'abortController':_0x51e291['abortController']};}['uploadUrl'](_0x354380,_0x23e89a,_0x518df6){const _0x185e8e=this['_sendApiRequest']('/conversations/'+_0x354380+'/web-resources','POST',{'url':_0x23e89a,'attributes':_0x518df6});return{'getId':async()=>(await _0x185e8e['request'])['json'](),'abortController':_0x185e8e['abortController']};}['getModels'](_0x4a6262='en'){const _0x4ef526=new URLSearchParams();_0x4ef526['append']('language',_0x4a6262);const _0x18b310='/models/1?'+_0x4ef526['toString'](),_0x2f61e7=this['_sendApiRequest'](_0x18b310,'GET',void 0x0,!0x0);return{'list':async()=>await(await _0x2f61e7['request'])['json'](),'abortController':_0x2f61e7['abortController']};}['deleteFile'](_0x146652,_0x720478){const _0x5c009b=this['_sendApiRequest']('/conversations/'+_0x146652+'/files/'+_0x720478,'DELETE');return{'execute':async()=>{await _0x5c009b['request'];},'abortController':_0x5c009b['abortController']};}['deleteDocument'](_0x19bb54,_0x4cfd9d){const _0x50e264=this['_sendApiRequest']('/conversations/'+_0x19bb54+'/documents/'+_0x4cfd9d,'DELETE');return{'execute':async()=>{await _0x50e264['request'];},'abortController':_0x50e264['abortController']};}['deleteWebResource'](_0x1d4665,_0x7d704){const _0x3884de=this['_sendApiRequest']('/conversations/'+_0x1d4665+'/web-resources/'+_0x7d704,'DELETE');return{'execute':async()=>{await _0x3884de['request'];},'abortController':_0x3884de['abortController']};}['callSystemReview']({reviewName:_0x176c10,content:_0xc79128,args:_0x52a9bd}){const _0x369549=this['_sendApiRequest']('/reviews/system/'+_0x176c10+'/calls','POST',{'content':[{'type':'text','content':_0xc79128}],'args':_0x52a9bd});return{'getStream':async()=>{const _0xa5f364=(await _0x369549['request'])['body'];return this['_getStreamReader'](_0xa5f364);},'abortController':_0x369549['abortController']};}['callCustomReview']({content:_0x1c6888,prompt:_0x13aa92,model:_0x266ca3}){const _0x199ba9=this['_sendApiRequest']('/reviews/custom/calls','POST',{'content':[{'type':'text','content':_0x1c6888}],'prompt':_0x13aa92,'model':_0x266ca3});return{'getStream':async()=>{const _0x161473=(await _0x199ba9['request'])['body'];return this['_getStreamReader'](_0x161473);},'abortController':_0x199ba9['abortController']};}['upsertAIChatRating'](_0x183525,_0x3a1012,_0x140946){const _0x47b6d4=this['_sendApiRequest']('/conversations/'+_0x183525+'/messages/'+_0x3a1012+'/ratings','PUT',{'positiveCount':_0x140946['positiveCount'],'totalCount':_0x140946['totalCount'],'modificationId':_0x140946['modificationId']});return{'execute':async()=>{await _0x47b6d4['request'];},'abortController':_0x47b6d4['abortController']};}['upsertAIActionRating'](_0x13a24f,_0xdd8b1b,_0xad981f){const _0x42cbef=this['_sendApiRequest']('/actions/system/'+_0x13a24f+'/calls/'+_0xdd8b1b+'/ratings','PUT',{'positiveCount':_0xad981f['positiveCount'],'totalCount':_0xad981f['totalCount']});return{'execute':async()=>{await _0x42cbef['request'];},'abortController':_0x42cbef['abortController']};}['upsertCustomAIActionRating'](_0x35fcbe,_0x4e8b2c){const _0x3d1751=this['_sendApiRequest']('/actions/custom/calls/'+_0x35fcbe+'/ratings','PUT',{'positiveCount':_0x4e8b2c['positiveCount'],'totalCount':_0x4e8b2c['totalCount']});return{'execute':async()=>{await _0x3d1751['request'];},'abortController':_0x3d1751['abortController']};}['upsertAIReviewRating'](_0xc04efa,_0x29e986,_0xa38365,_0x355539){const _0x19b76d=this['_sendApiRequest']('/reviews/system/'+_0xc04efa+'/calls/'+_0x29e986+'/ratings','PUT',{'positiveCount':_0xa38365['positiveCount'],'totalCount':_0xa38365['totalCount'],'dataId':_0x355539});return{'execute':async()=>{await _0x19b76d['request'];},'abortController':_0x19b76d['abortController']};}['upsertCustomAIReviewRating'](_0x1822a8,_0x26fb86,_0x5a1c53){const _0x57858d=this['_sendApiRequest']('/reviews/custom/calls/'+_0x1822a8+'/ratings','PUT',{'positiveCount':_0x26fb86['positiveCount'],'totalCount':_0x26fb86['totalCount'],'dataId':_0x5a1c53});return{'execute':async()=>{await _0x57858d['request'];},'abortController':_0x57858d['abortController']};}['_sendApiRequest'](_0x25b4bb,_0x21e946,_0x5ed152,_0x53cd28=!0x1){const _0x252fc0=new AbortController(),_0x35f9be=_0x53cd28?_0x21e946+':'+_0x25b4bb:null;if(_0x35f9be){const _0x4a4a7d=this['_responseCache']['get'](_0x35f9be);if(_0x4a4a7d)return{'request':_0x4a4a7d['then'](_0x38e631=>_0x38e631['clone']()),'abortController':_0x252fc0};}const _0x1f80ce=_0x5ed152 instanceof FormData,_0x1cb47e={'Authorization':'Bearer\x20'+this['_token']?.['value']};_0x5ed152&&!_0x1f80ce&&(_0x1cb47e['Content-Type']='application/json');const _0x1010d6={'method':_0x21e946,'headers':_0x1cb47e,'signal':_0x252fc0['signal']};_0x5ed152&&(_0x1010d6['body']=_0x1f80ce?_0x5ed152:JSON['stringify'](_0x5ed152));const _0x22c5b2=fetch(''+this['_apiUrl']+_0x25b4bb,_0x1010d6)['catch'](_0x3d3a4c=>{_0x35f9be&&this['_responseCache']['delete'](_0x35f9be),this['_handleError'](_0x3d3a4c);})['then'](_0x413344=>_0x413344['ok']?_0x413344:_0x413344['json']()['then'](_0x33d46d=>{throw _0x35f9be&&this['_responseCache']['delete'](_0x35f9be),{'url':this['_apiUrl'],'path':_0x25b4bb,'method':_0x21e946,'body':_0x5ed152,'status':(_0x413344||{})['status'],'statusText':(_0x413344||{})['statusText'],'code':_0x33d46d['code'],'message':_0x33d46d['message'],'traceId':_0x33d46d['traceId']};}));return _0x35f9be&&this['_responseCache']['set'](_0x35f9be,_0x22c5b2['then'](_0x4e56d6=>_0x4e56d6['clone']())),{'request':_0x22c5b2,'abortController':_0x252fc0};}async*['_getStreamReader'](_0x281e09){const _0x41ed39=[],_0x5d301f=_0x281e09['getReader'](),_0x26f74f=_0x30da2c({'onError':_0x1a0eb8=>{this['_handleError'](_0x1a0eb8);},'onEvent':_0x473d59=>{_0x473d59['data']=JSON['parse'](_0x473d59['data']),_0x41ed39['push'](_0x473d59);}});try{let _0x89e721=!0x1;for(;!_0x89e721;){const {done:_0xbf22ee,value:_0x3d4abb}=await _0x5d301f['read']();_0xbf22ee&&(_0x89e721=!0x0),_0x26f74f['feed'](this['_decoder']['decode'](_0x3d4abb,{'stream':!0x0})),yield*_0x41ed39,_0x41ed39['length']=0x0;}}catch(_0x2d339e){this['_handleError'](_0x2d339e);}finally{_0x5d301f['releaseLock'](),_0x26f74f['reset']();}}['_handleError'](_0x516b72){if(_0x516b72 instanceof ot)throw _0x516b72;if(_0x516b72 instanceof Error&&'AbortError'===_0x516b72['name'])throw new ot('ai-request-aborted',this,{'originalError':_0x516b72});throw new ot('ai-request-failed',this,{'originalError':_0x516b72});}}function cs(_0x2920b8,_0x3cf506,_0x2c85cf){const t=_0x2920b8['t'];switch(_0x3cf506){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'},_0x2c85cf);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.'},_0x2c85cf);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.'},_0x2c85cf);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.'},_0x2c85cf);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'},_0x2c85cf);case'AI_CHAT_SUGGESTION_ACTION_SUGGEST':return t({'id':'AI_CHAT_SUGGESTION_ACTION_SUGGEST','string':'Suggest'},_0x2c85cf);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'},_0x2c85cf);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.'},_0x2c85cf);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.'},_0x2c85cf);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.'},_0x2c85cf);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.'},_0x2c85cf);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'},_0x2c85cf);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.'},_0x2c85cf);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 _0x3cf506;}}const ls='ck-ai-button-primary',us='ck-ai-button-secondary',ds='ck-ai-button-tertiary';function _s(_0x12b9ce,_0x51f204){const _0x51826e=new kt(_0x12b9ce),_0x2a23f4=cs(_0x12b9ce,'AI_TABS_LABEL_MINIMIZE'),_0x267565=cs(_0x12b9ce,'AI_TABS_LABEL_MAXIMIZE');return _0x51826e['set']({'withText':!0x1,'icon':_0x5e2027,'tooltip':!0x0,'class':'ck-ai-tabs__resize\x20'+ds}),_0x51826e['bind']('label')['to'](_0x51f204,'isMaximized',_0x286140=>_0x286140?_0x2a23f4:_0x267565),_0x51826e['bind']('icon')['to'](_0x51f204,'isMaximized',_0x1cf53f=>_0x1cf53f?_0x78d435:_0x5e2027),_0x51826e['bind']('isOn')['to'](_0x51f204,'isMaximized'),_0x51826e['on']('execute',()=>{_0x51f204['fire']('resizeTabs');}),_0x51826e;}function As(_0x497ed6){return _0x34e772(_0x497ed6);}function gs(_0x72583d){return _0x3fc46a(_0x72583d);}function Is(_0x599407,_0x4e6e5f,_0x116839){const _0x306dac=null!==_0x4e6e5f?_0x234911=>_0x234911['attribs'][_0x599407]===_0x4e6e5f:_0x2f0389=>Boolean(_0x2f0389['attribs'][_0x599407]);return _0x57d34f(_0x4c7b0b=>_0x1b7c52(_0x4c7b0b)&&_0x306dac(_0x4c7b0b),_0x116839);}function Es(_0x47de0d,_0x562d7b,_0x20c670){const _0xa6cc0d=null!==_0x562d7b?_0x856aed=>_0x856aed['attribs'][_0x47de0d]===_0x562d7b:_0x358755=>Boolean(_0x358755['attribs'][_0x47de0d]);return _0x368e40(_0x12c281=>_0x1b7c52(_0x12c281)&&_0xa6cc0d(_0x12c281),_0x20c670);}function ps(_0x64f64a,_0x289bdb){return _0x64f64a&&_0x1b7c52(_0x64f64a)?_0x64f64a['attribs'][_0x289bdb]:null;}function Ts(_0x36174b,_0x3bbe94,_0x59deb1){_0x1b7c52(_0x36174b)&&(null===_0x59deb1?delete _0x36174b['attribs'][_0x3bbe94]:_0x36174b['attribs'][_0x3bbe94]=_0x59deb1);}function ms(_0x2e35ff,_0x5605aa,_0x4fb12f){const _0x3460bf=_0x5605aa['cloneNode'](!0x0);'beforebegin'===_0x4fb12f?_0x26965d(_0x2e35ff,_0x3460bf):'afterbegin'===_0x4fb12f?_0x16b61c(_0x2e35ff,_0x3460bf):'beforeend'===_0x4fb12f?_0x698e34(_0x2e35ff,_0x3460bf):'afterend'===_0x4fb12f&&_0x6779d3(_0x2e35ff,_0x3460bf);}function Cs(_0x3236b9){const _0x1a89c8=[];let _0x1d5299=_0x3236b9;for(;_0x1d5299;)_0x1d5299=_0x517ce8(_0x1d5299),_0x1d5299&&_0x1a89c8['push'](_0x1d5299);return _0x1a89c8;}function ws(_0x101df4){return _0x101df4['replace'](/^\s+/gm,'')['replace'](/\s+$/gm,'')['replace'](/\n*/g,'')['replace'](/\s+/g,'\x20')['replace'](/>\s*</g,'><');}function fs(_0x2fa235){let _0x39cced=0x0;for(;_0x2fa235['parentNode'];)_0x2fa235=_0x2fa235['parentNode'],_0x39cced++;return _0x39cced;}function Ss(_0x4900f9){const _0x578697=[];let _0x305893=_0x4900f9['nextSibling'];for(;_0x305893;)_0x578697['push'](_0x305893),_0x305893=_0x305893['nextSibling'];_0x578697['forEach'](_0x236bad=>{_0x35c3c7(_0x236bad);});}class bs extends/* #__PURE__ -- @preserve */
25
+ ht(){['_m2html'];constructor(){super();const _0x5cadd2=Object['entries'](_0x5b36d7),_0x3cb2f0=_0x5cadd2['findIndex'](([_0x14f143])=>'rehypeDomRaw'===_0x14f143);if(-0x1===_0x3cb2f0)throw new ot('ai-response-parser-unable-to-set-up-parser');_0x5cadd2['splice'](_0x3cb2f0+0x1,0x0,['rehypeSanitize',_0x48fdd8]),this['_m2html']=new _0x23e7e8({'plugins':Object['fromEntries'](_0x5cadd2)});}['convertMarkdownToHTML'](_0x3297e5){const _0x3838fc=this['_m2html']['parse'](_0x3297e5);return this['parseAndNormalizeHTML'](_0x3838fc);}['parseAndNormalizeHTML'](_0x109ebb){return this['_parseHTML'](_0x109ebb);}['_parseHTML'](_0x1eca12){const _0x5a0a0c=As('<dummy>'+_0x1eca12['replace'](/^\t+/gm,'\x20')['replace'](/\n*/g,'')['replace'](/\s+/g,'\x20')['replace'](/<[^>]*?$/g,'')+'</dummy>');return _0x5a0a0c['children']=_0x5a0a0c['children'][0x0]['children'],_0x5a0a0c;}}class Rs extends/* #__PURE__ -- @preserve */
26
+ ht(){['_generateUid'];['_touchedNodesState']={'newIds':[],'modifiedIds':[],'removedIds':[],'invalidIds':[],'lastTouchedId':null};['_existingDataIds']=new Set();constructor(_0x27e5ba){super(),this['_generateUid']=_0x27e5ba||at;}['merge'](_0x2ceb36,_0x745131,_0x15215f){const _0x5e1fca=_0x2ceb36['cloneNode'](!0x0);if(0x0===_0x745131['childNodes']['length']){const _0xb70bb2=[];return Es('data-id','new-element',_0x5e1fca)['forEach'](_0x3d7fd1=>{const _0x89e3c1=this['_generateUid']();Ts(_0x3d7fd1,'data-id',_0x89e3c1),_0xb70bb2['push'](_0x89e3c1);}),this['_removeSpecialComments'](_0x5e1fca),{'parsedContent':_0x5e1fca,'newNodeIds':_0xb70bb2,'modifiedNodeIds':[],'removedNodeIds':[]};}_0x15215f&&_0x15215f['markUnstableElements']&&this['_markLastTagElementUnstable'](_0x5e1fca),this['_touchedNodesState']['newIds']=[],this['_touchedNodesState']['modifiedIds']=[],this['_touchedNodesState']['removedIds']=[],this['_touchedNodesState']['invalidIds']=[],this['_touchedNodesState']['lastTouchedId']=null,this['_existingDataIds']=new Set(Es('data-id',null,_0x745131)['map'](_0x2e25d2=>ps(_0x2e25d2,'data-id'))['filter'](_0x384be6=>!!_0x384be6));let _0x17a265=-0x1,_0x5eb07e=!0x1;const _0x27d0ee=_0x5e1fca['childNodes'],_0x24734a=Array['from'](_0x27d0ee)['filter'](_0x42ddcc=>!(0x3===_0x42ddcc['nodeType']&&''===gs(_0x42ddcc)['trim']())),_0x420ce8=_0x24734a['length'];for(let _0x3e4a8a=0x0;_0x3e4a8a<_0x420ce8;_0x3e4a8a++){const _0x2adef2=_0x24734a[_0x3e4a8a],_0x2a9899=_0x24734a[_0x3e4a8a+0x1];if(this['_isNewNode'](_0x2adef2)){if(-0x1===_0x17a265&&(_0x17a265=_0x3e4a8a),this['_markWrappedElements'](_0x2adef2),!this['_isNewNode'](_0x2a9899)){const [_0x21f458,_0x4c28e1]=this['_findReferenceNode'](_0x2adef2,_0x5eb07e,_0x745131);if(_0x21f458){const _0x4a8687=Array['from'](_0x24734a)['slice'](_0x17a265,_0x3e4a8a+0x1);this['_insertNodes'](_0x21f458,_0x4a8687,_0x4c28e1),_0x17a265=-0x1;}}}else{if(this['_isExistingContentComment'](_0x2adef2))_0x5eb07e=!0x0;else{if(this['_isExistingNode'](_0x2adef2)){const _0x46c288=ps(_0x2adef2,'data-id');if(_0x46c288&&this['_existingDataIds']['has'](_0x46c288)){const _0x84f7db=Is('data-id',_0x46c288,_0x745131);this['_replaceNode'](_0x84f7db,_0x2adef2);}if(this['_touchedNodesState']['removedIds']['includes'](_0x46c288)){const _0x59dc35=this['_touchedNodesState']['removedIds']['indexOf'](_0x46c288);this['_touchedNodesState']['removedIds']['splice'](_0x59dc35,0x1);}}else{if(this['_isDelNode'](_0x2adef2)){const _0x10d925=ps(_0x2adef2,'data-id');this['_touchedNodesState']['modifiedIds']['includes'](_0x10d925)||this['_storeDeletedElementIds'](_0x2adef2);}}}}}for(const _0x474410 of this['_touchedNodesState']['removedIds']){const _0x249bc1=Is('data-id',_0x474410,_0x745131);if(_0x249bc1){if(_0x15215f&&_0x15215f['replaceRemovedWith']){this['_touchedNodesState']['lastTouchedId']=_0x474410;const _0x3c46be=_0x15215f['replaceRemovedWith']['cloneNode'](!0x0);Ts(_0x3c46be,'data-id',_0x474410),Ts(_0x3c46be,'data-removed','true'),_0x171cde(_0x249bc1,_0x3c46be);}else _0x35c3c7(_0x249bc1);}}if(Es('data-wrapped-id',null,_0x745131)['forEach'](_0x96cfaf=>{const _0x562ad4=Is('data-id',ps(_0x96cfaf,'data-wrapped-id'),_0x745131);var _0x5716f8,_0x557138;_0x562ad4&&(_0x557138=_0x96cfaf,_0x35c3c7(_0x5716f8=_0x562ad4),_0x171cde(_0x557138,_0x5716f8));}),Es('data-id','new-element',_0x745131)['forEach'](_0x2c5c44=>{const _0x35e0f7=this['_getUid'](_0x2c5c44);Ts(_0x2c5c44,'data-id',_0x35e0f7),this['_touchedNodesState']['newIds']['push'](_0x35e0f7);}),this['_removeSpecialComments'](_0x745131),_0x15215f&&_0x15215f['markUnstableElements']&&this['_markUnstableElements'](_0x745131,_0x15215f['markUnstableElementsDepth']||0x0),_0x15215f&&_0x15215f['cutAfterLastChange']&&this['_touchedNodesState']['lastTouchedId']){let _0xfcd6e3=Is('data-id',this['_touchedNodesState']['lastTouchedId'],_0x745131);for(;_0xfcd6e3;)Ss(_0xfcd6e3),_0xfcd6e3=_0xfcd6e3['parentNode'];}return{'parsedContent':_0x745131,'newNodeIds':this['_touchedNodesState']['newIds'],'modifiedNodeIds':this['_touchedNodesState']['modifiedIds'],'removedNodeIds':this['_touchedNodesState']['removedIds']};}['_insertNodes'](_0x2c41fb,_0x15c4d9,_0x2aefa8){for(const _0x100ec9 of _0x15c4d9){const _0x452144=this['_getUid'](_0x100ec9);Ts(_0x100ec9,'data-id',_0x452144),this['_touchedNodesState']['newIds']['push'](_0x452144),this['_touchedNodesState']['lastTouchedId']=_0x452144;}const _0x567ddb='afterbegin'===_0x2aefa8||'afterend'===_0x2aefa8?_0x15c4d9['reverse']():_0x15c4d9;for(const _0x50cea6 of _0x567ddb)ms(_0x2c41fb,_0x50cea6,_0x2aefa8);}['_replaceNode'](_0x2fe7d5,_0x46c023){if(!_0x2fe7d5)return;if(_0x51cada=_0x46c023,ws(gs(_0x2fe7d5))===ws(gs(_0x51cada)))return;var _0x51cada;const _0x157aa0=this['_getUid'](_0x2fe7d5);Ts(_0x46c023,'data-id',_0x157aa0),this['_touchedNodesState']['modifiedIds']['push'](_0x157aa0),this['_touchedNodesState']['lastTouchedId']=_0x157aa0,_0x171cde(_0x2fe7d5,_0x46c023['cloneNode'](!0x0));}['_findReferenceNode'](_0x4235ca,_0x31c136,_0x46f052){const _0x356348=this['_findPrevElementWithDataId'](_0x4235ca,!0x1);if(_0x356348){const _0x257e9d=this['_getNodeDataId'](_0x356348),_0x408e81=Is('data-id',_0x257e9d,_0x46f052);if(_0x408e81)return[_0x408e81,'afterend'];this['_touchedNodesState']['invalidIds']['push'](_0x257e9d);}const _0x38f63e=this['_findNextElementWithDataId'](_0x4235ca,!0x1);if(_0x38f63e){const _0x1cf417=this['_getNodeDataId'](_0x38f63e),_0x1e8211=Is('data-id',_0x1cf417,_0x46f052);if(_0x1e8211)return[_0x1e8211,'beforebegin'];this['_touchedNodesState']['invalidIds']['push'](_0x1cf417);}return _0x31c136?_0x4235ca['nextSibling']?this['_findFallbackReferenceNode'](_0x4235ca,_0x46f052):[_0x46f052['childNodes'][_0x46f052['childNodes']['length']-0x1],'afterend']:[_0x46f052['childNodes'][0x0],'beforebegin'];}['_findFallbackReferenceNode'](_0x62aaa5,_0x4d78b5){const _0x1802c1=[],_0x4b4977=this['_findPrevElementWithDataId'](_0x62aaa5,!0x0);if(_0x4b4977){const _0x1cbfb9=Is('data-id',this['_getNodeDataId'](_0x4b4977),_0x4d78b5);_0x1cbfb9&&_0x1802c1['push']([_0x1cbfb9,'afterend']);}const _0x4e4565=this['_findNextElementWithDataId'](_0x62aaa5,!0x0);if(_0x4e4565){const _0x32e567=Is('data-id',this['_getNodeDataId'](_0x4e4565),_0x4d78b5);_0x32e567&&_0x1802c1['push']([_0x32e567,'beforebegin']);}if(_0x1802c1['length']>0x1)return fs(_0x1802c1[0x0][0x0])<=fs(_0x1802c1[0x1][0x0])?_0x1802c1[0x0]:_0x1802c1[0x1];return 0x1===_0x1802c1['length']?_0x1802c1[0x0]:[_0x4d78b5['lastChild'],'afterend'];}['_findNextElementWithDataId'](_0x3ac393,_0x45f06d){let _0x1be722=_0x3ac393['nextSibling'],_0x56cb5e=null,_0x44e1f2=!0x1;for(;_0x1be722;){if(_0x5702a0(_0x1be722)){if(this['_isDelNode'](_0x1be722)&&(_0x56cb5e=_0x1be722),this['_isExistingContentComment'](_0x1be722)&&_0x45f06d&&!_0x44e1f2){_0x44e1f2=!0x0,_0x1be722=_0x1be722['nextSibling'];continue;}break;}const _0x4114cc=ps(_0x1be722,'data-id');if(_0x4114cc&&'new-element'!==_0x4114cc&&this['_existingDataIds']['has'](_0x4114cc)){_0x56cb5e=_0x1be722;break;}_0x1be722=_0x1be722['nextSibling'];}return _0x56cb5e;}['_findPrevElementWithDataId'](_0x416609,_0x77c9dd){let _0x237607=_0x416609['previousSibling'],_0x3512b9=null,_0x53a901=!0x1;for(;_0x237607;){if(_0x5702a0(_0x237607)){if(this['_isDelNode'](_0x237607)&&(_0x3512b9=_0x237607),this['_isExistingContentComment'](_0x237607)&&_0x77c9dd&&!_0x53a901){_0x53a901=!0x0,_0x237607=_0x237607['previousSibling'];continue;}break;}const _0x167cc5=ps(_0x237607,'data-id');if(_0x167cc5&&'new-element'!==_0x167cc5&&this['_existingDataIds']['has'](_0x167cc5)){_0x3512b9=_0x237607;break;}_0x237607=_0x237607['previousSibling'];}return _0x3512b9;}['_markWrappedElements'](_0x21a238){_0x1b7c52(_0x21a238)&&Es('data-id',null,_0x21a238)['forEach'](_0x2cb08f=>{this['_isExistingNode'](_0x2cb08f)&&!this['_hasWrappedParent'](_0x2cb08f)&&(Ts(_0x2cb08f,'data-wrapped-id',ps(_0x2cb08f,'data-id')),Ts(_0x2cb08f,'data-id',null));});}['_getNodeDataId'](_0xad2799){if(!_0xad2799)return null;if(_0x1b7c52(_0xad2799))return ps(_0xad2799,'data-id');if(_0x5702a0(_0xad2799)){const _0x293de6=gs(_0xad2799)['match'](/removed[\s*-]data-id="([^"]+)"/);if(_0x293de6&&_0x293de6[0x1])return _0x293de6[0x1];}return null;}['_storeDeletedElementIds'](_0x2b913a){if(_0x5702a0(_0x2b913a)){const _0x172c95=gs(_0x2b913a)['match'](/removed[\s*-]data-id="([^"]+)"/);_0x172c95&&_0x172c95[0x1]&&this['_touchedNodesState']['removedIds']['push'](_0x172c95[0x1]);}}['_getUid'](_0xce504d){return this['_isExistingNode'](_0xce504d)?ps(_0xce504d,'data-id'):this['_generateUid']();}['_removeSpecialComments'](_0x2bdcd3){(function(_0x3cd7ba){return _0x55c8ed(_0x515369=>_0x5702a0(_0x515369),_0x3cd7ba,!0x0,0x1/0x0);}(_0x2bdcd3)['filter'](_0x57c1c3=>this['_isDelNode'](_0x57c1c3)||this['_isExistingContentComment'](_0x57c1c3))['forEach'](_0x4f29f3=>{_0x35c3c7(_0x4f29f3);}));}['_markLastTagElementUnstable'](_0x2872dc){const _0x1e2d29=_0x2872dc['childNodes'],_0x3577b9=_0x1e2d29[_0x1e2d29['length']-0x1];_0x3577b9&&_0x1b7c52(_0x3577b9)&&Ts(_0x3577b9,'data-unstable','true');}['_markUnstableElements'](_0x1a0343,_0x4b3d8f){const _0xb153c=Is('data-unstable','true',_0x1a0343);if(!_0xb153c)return;const _0x5779aa=Cs(_0xb153c)['slice'](0x0,-0x1),_0x2b0213=_0x5779aa['length'];let _0x37b52b=_0xb153c;if(_0x2b0213>_0x4b3d8f){let _0xfa7b3b=_0x2b0213,_0x4cd40c=null;for(;_0xfa7b3b>_0x4b3d8f&&_0xfa7b3b>=0x0;)_0xfa7b3b--,_0x4cd40c=_0x5779aa[_0xfa7b3b];_0x4cd40c&&(_0x37b52b=_0x4cd40c,Ts(_0xb153c,'data-unstable',null),Ts(_0x4cd40c,'data-unstable','true'));}else{if(_0x2b0213<_0x4b3d8f){let _0x17f6ac=_0x2b0213,_0x3728e1=_0xb153c;for(;_0x17f6ac<_0x4b3d8f;){const _0x2fda64=_0x3728e1['childNodes']['filter'](_0x1816cf=>_0x1b7c52(_0x1816cf));if(0x0===_0x2fda64['length'])break;_0x17f6ac++,_0x3728e1=_0x2fda64[_0x2fda64['length']-0x1];}_0x3728e1&&(_0x37b52b=_0x3728e1,Ts(_0xb153c,'data-unstable',null),Ts(_0x3728e1,'data-unstable','true'));}}let _0x17746b=_0x37b52b;for(;_0x17746b;){for(;_0x17746b['nextSibling'];)_0x17746b=_0x17746b['nextSibling'],_0x1b7c52(_0x17746b)&&Ts(_0x17746b,'data-unstable','true');_0x17746b=_0x17746b['parentNode'];}}['_isNewNode'](_0x31d070){return Boolean('new-element'===ps(_0x31d070,'data-id'));}['_isExistingNode'](_0x3e08fd){return Boolean((ps(_0x3e08fd,'data-id')||'')['length']>0x0&&'new-element'!==ps(_0x3e08fd,'data-id'));}['_isDelNode'](_0x12dce3){return!!_0x12dce3&&Boolean(_0x5702a0(_0x12dce3)&&gs(_0x12dce3)['match'](/removed[\s*-]data-id="[^"]+"/));}['_hasWrappedParent'](_0x4e8638){let _0x5705a3=_0x4e8638['parentNode'];for(;_0x5705a3;){if(ps(_0x5705a3,'data-wrapped-id'))return!0x0;_0x5705a3=_0x5705a3['parentNode'];}return!0x1;}['_isExistingContentComment'](_0x51daf9){return Boolean(_0x5702a0(_0x51daf9)&&gs(_0x51daf9)['match'](/\s*existing[\s*-](content|document)\s*/g));}}function Os({editor:_0x5f32ab,changeGroups:_0x1583cf,documentContextContent:_0x370055,showDiff:_0x1670fd,trimUnchanged:_0x1b0ef1=!0x0}){return _0x1583cf['map'](_0x503d32=>{const _0x4d4ed5=new _0x39de98([]),_0x43cf92=new _0x39de98([]);for(const _0x4026b0 of _0x503d32['changes'])if(_0x1670fd&&'removed'==_0x4026b0['type']||_0x43cf92['children']['push'](_0x4026b0['node']['cloneNode'](!0x0)),'new'!=_0x4026b0['type']&&(_0x1670fd||'removed'!=_0x4026b0['type'])){const _0x2cf83c=_0x57d34f(_0x1f1571=>ps(_0x1f1571,'data-id')==_0x4026b0['id'],_0x370055,!0x0);_0x2cf83c&&_0x4d4ed5['children']['push'](_0x2cf83c['cloneNode'](!0x0));}const {content:_0x2cce2b,hasChanges:_0x23824b}=function(_0x1ef5d2,_0xc7ffa9,_0x1c3f98,_0x412ad8,_0x335941=!0x0){const _0x2c3f6f=_0x1ef5d2['plugins']['get']('DocumentCompare'),_0xab5385=gs(_0xc7ffa9),_0x53da45=gs(_0x1c3f98),_0x4086fc=_0x1ef5d2['data']['parse'](_0xab5385,'$root'),_0x3febe5=_0x1ef5d2['model']['createPositionAt'](_0x4086fc,0x0),_0x4d9246=_0x2c3f6f['getDiff'](_0xab5385,_0x53da45,{'anchor':_0x3febe5,'markDeletions':_0x412ad8}),_0x53ddfe=_0x4d9246['getOperations']();if(0x0==_0x53ddfe['length'])return{'content':_0xc7ffa9['cloneNode'](!0x0),'hasChanges':!0x1};_0x412ad8?function(_0x715e09,_0x59348a,_0x1df445){if(0x0==_0x715e09['length'])return;const _0x109208=_0x1df445['plugins']['get']('DocumentCompare'),_0x1d761c=_0x1df445['plugins']['get']('SuggestionsConversion');_0x1df445['model']['change'](_0x293db3=>{const _0x363254=new Set();for(let _0x2dffb2=0x0;_0x2dffb2<_0x715e09['length'];_0x2dffb2++){const _0x2fc09c=_0x715e09[_0x2dffb2];if(_0x2fc09c['baseVersion']=null,_0x2fc09c['isDocumentOperation']=!0x1,_0x109208['isMarkedRemoveOperation'](_0x2fc09c)){const _0x151ee1=_0x1b2a38(_0x2fc09c['newRange'],_0x1df445['model']),_0x3e2e77='suggestion:deletion:'+at()+':$aiSuggestion';_0x59348a['markers']['set'](_0x3e2e77,_0x151ee1);}else switch(_0x2fc09c['type']){case'rename':{if(_0x2fc09c['oldName']==_0x2fc09c['newName'])break;_0x293db3['batch']['addOperation'](_0x2fc09c),_0x1df445['model']['applyOperation'](_0x2fc09c);const _0x46bbd8='$elementName',_0x2be20f=_0x2fc09c['position'],_0x41698a=_0x1df445['model']['createRange'](_0x2be20f,_0x1df445['model']['createPositionAt'](_0x2be20f['nodeAfter'],'end')),_0x3faa36='suggestion:attribute:'+_0x46bbd8+':'+at()+':$aiSuggestion';_0x59348a['markers']['set'](_0x3faa36,_0x41698a);break;}case'addAttribute':case'removeAttribute':case'changeAttribute':{if(_0x2fc09c['oldValue']==_0x2fc09c['newValue'])break;_0x293db3['batch']['addOperation'](_0x2fc09c),_0x1df445['model']['applyOperation'](_0x2fc09c);const _0x51857b=_0x2fc09c['key'];if(!_0x1d761c['isRegisteredAttribute'](_0x51857b))break;const _0x573f21=_0x1b2a38(_0x2fc09c['range'],_0x1df445['model']),_0x38e1be='suggestion:attribute:'+_0x51857b+':'+at()+':$aiSuggestion';_0x59348a['markers']['set'](_0x38e1be,_0x573f21);break;}case'insert':{_0x293db3['batch']['addOperation'](_0x2fc09c),_0x1df445['model']['applyOperation'](_0x2fc09c);if(_0x715e09[_0x2dffb2+0x1]&&'move'==_0x715e09[_0x2dffb2+0x1]['type']){ks(_0x59348a,_0x2fc09c);break;}const _0x260947=_0x2fc09c['position'],_0x5d13a1=_0x2fc09c['howMany'],_0x5c51fc=_0x1b2a38(_0x1df445['model']['createRange'](_0x260947,_0x260947['getShiftedBy'](_0x5d13a1)),_0x1df445['model']),_0x4e7ba6='suggestion:insertion:'+at()+':$aiSuggestion';_0x59348a['markers']['set'](_0x4e7ba6,_0x5c51fc);break;}case'split':{_0x293db3['batch']['addOperation'](_0x2fc09c),_0x1df445['model']['applyOperation'](_0x2fc09c);const _0x2df1c6=_0x2fc09c['splitPosition'],_0x54d95b=_0x2fc09c['moveTargetPosition'],_0x291194=_0x1df445['model']['createRange'](_0x2df1c6,_0x54d95b),_0x3f6a7f='suggestion:insertion:'+at()+':$aiSuggestion';_0x59348a['markers']['set'](_0x3f6a7f,_0x291194);break;}case'move':{_0x293db3['batch']['addOperation'](_0x2fc09c),_0x1df445['model']['applyOperation'](_0x2fc09c),_0x715e09[_0x2dffb2-0x1]&&'insert'==_0x715e09[_0x2dffb2-0x1]['type']&&ks(_0x59348a,_0x2fc09c);const _0x4531d1=_0x2fc09c['getMovedRangeStart'](),_0x4b846c=_0x2fc09c['howMany'];for(let _0x3b6900=0x0;_0x3b6900<_0x4b846c;_0x3b6900++){const _0x395768=_0x4531d1['getShiftedBy'](_0x3b6900)['nodeAfter'];_0x363254['add'](_0x395768);}break;}case'remove':{const _0x17223d=_0x2fc09c['sourcePosition'],_0x2b1e12=_0x2fc09c['howMany'],_0x277978=new _0x423138(_0x17223d,_0x2b1e12);_0x293db3['batch']['addOperation'](_0x277978),_0x1df445['model']['applyOperation'](_0x277978);break;}}}for(const _0x5cfa37 of _0x363254){const _0x1bdf85=_0x1df445['model']['createRangeOn'](_0x5cfa37),_0x1c035e='suggestion:formatBlock:$fakeWrap:'+at()+':$aiSuggestion';_0x59348a['markers']['set'](_0x1c035e,_0x1b2a38(_0x1bdf85,_0x1df445['model']));}});}(_0x53ddfe,_0x4086fc,_0x1ef5d2):_0x1ef5d2['model']['change'](_0x3ffa37=>{for(const _0x3fa81f of _0x53ddfe)if('remove'==_0x3fa81f['type']){const _0x79df20=_0x3fa81f['sourcePosition'],_0x136274=_0x3fa81f['howMany'],_0xf953bf=new _0x423138(_0x79df20,_0x136274);_0x3ffa37['batch']['addOperation'](_0xf953bf),_0x1ef5d2['model']['applyOperation'](_0xf953bf);}else{if('marker'==_0x3fa81f['type']){const _0x1ca64f=_0x3fa81f['name'],_0x578911=_0x3fa81f['newRange'];null!==_0x578911?_0x4086fc['markers']['set'](_0x1ca64f,_0x578911):_0x4086fc['markers']['delete'](_0x1ca64f);}else _0x3fa81f['baseVersion']=null,_0x3fa81f['isDocumentOperation']=!0x1,_0x3ffa37['batch']['addOperation'](_0x3fa81f),_0x1ef5d2['model']['applyOperation'](_0x3fa81f);}});if(_0x335941){const _0x2a2d36=Ns(_0x1ef5d2,_0x53ddfe,_0x4086fc);vs(_0x1ef5d2['model'],_0x2a2d36),function(_0x3dda76,_0x2db7eb){const _0x5d5dfe=_0x2db7eb['getFirstRange']()['start'];let _0x25b509=_0x2db7eb['getFirstRange']()['end'];const _0x15d404=_0x5d5dfe['root'];(_0x25b509['textNode']||_0x25b509['nodeAfter']&&_0x25b509['nodeAfter']['is']('$text'))&&(_0x2b661c(_0x25b509,'...'),_0x25b509=_0x25b509['getShiftedBy'](0x3)),(_0x5d5dfe['textNode']||_0x5d5dfe['nodeBefore']&&_0x5d5dfe['nodeBefore']['is']('$text'))&&(_0x2b661c(_0x5d5dfe,'...'),function(_0x4bae54,_0x2820b5,_0x2168bd){for(let [_0x5e5d76,_0x535700]of _0x4bae54['markers']){const _0x5c36ab=_0x535700['_getTransformedByInsertion'](_0x2820b5,_0x2168bd,!0x1);_0x535700=_0x5c36ab[0x0],_0x4bae54['markers']['set'](_0x5e5d76,_0x535700);}}(_0x15d404,_0x5d5dfe,0x3),_0x5d5dfe['parent']==_0x25b509['parent']&&(_0x25b509=_0x25b509['getShiftedBy'](0x3)));const _0x3bd274=_0x3dda76['createRange'](_0x3dda76['createPositionAt'](_0x15d404,0x0),_0x5d5dfe),_0x604499=_0x3dda76['createRange'](_0x25b509,_0x3dda76['createPositionAt'](_0x15d404,'end')),_0x22eada=[..._0x3bd274['getMinimalFlatRanges'](),..._0x604499['getMinimalFlatRanges']()];_0x22eada['reverse']();for(const _0x248d75 of _0x22eada)_0x2372d2(_0x248d75),xs(_0x15d404,_0x248d75);}(_0x1ef5d2['model'],_0x2a2d36);}const _0x246f3a=_0x1ef5d2['data']['stringify'](_0x4086fc,{'showSuggestionHighlights':!0x0});return{'content':As(_0x246f3a),'hasChanges':!0x0};}(_0x5f32ab,_0x4d4ed5,_0x43cf92,_0x1670fd,_0x1b0ef1);return{'type':_0x503d32['changes'][0x0]['type'],'index':_0x503d32['index'],'content':_0x2cce2b,'hasChanges':_0x23824b};});}function ks(_0xf9027c,_0x654c93){for(const [_0x54e99f,_0x2dc9d6]of _0xf9027c['markers']){const _0x25bb38=_0x40a8b3['_createFromRanges'](_0x2dc9d6['getTransformedByOperation'](_0x654c93));_0xf9027c['markers']['set'](_0x54e99f,_0x25bb38);}}function Ns(_0x3fa4e6,_0x1feda0,_0x24b4c9){const _0x1ab971=_0x3fa4e6['plugins']['get']('DocumentCompare');let _0x71fc4f=_0x3fa4e6['model']['createPositionAt'](_0x24b4c9,Number['POSITIVE_INFINITY']),_0x3b8fe4=_0x3fa4e6['model']['createPositionAt'](_0x24b4c9,0x0);for(const _0x496d01 of _0x1feda0){let _0x46a166,_0x2b78e2;if(_0x1ab971['isMarkedRemoveOperation'](_0x496d01))_0x46a166=_0x496d01['newRange']['start'],_0x2b78e2=_0x496d01['newRange']['end'];else switch(_0x71fc4f=_0x71fc4f['getTransformedByOperation'](_0x496d01),_0x3b8fe4=_0x3b8fe4['getTransformedByOperation'](_0x496d01),_0x496d01['type']){case'rename':_0x46a166=_0x496d01['position'],_0x2b78e2=_0x46a166['getShiftedBy'](0x1);break;case'addAttribute':case'removeAttribute':case'changeAttribute':_0x46a166=_0x496d01['range']['start'],_0x2b78e2=_0x496d01['range']['end'];break;case'insert':_0x46a166=_0x496d01['position'],_0x2b78e2=_0x46a166['getShiftedBy'](_0x496d01['howMany']);break;case'split':_0x46a166=_0x496d01['splitPosition'],_0x2b78e2=_0x496d01['moveTargetPosition'];break;case'merge':{const _0x1531ad=_0x496d01['targetPosition']['path']['slice'](0x0,-0x1);_0x46a166=_0x3fa4e6['model']['createPositionFromPath'](_0x24b4c9,_0x1531ad),_0x2b78e2=_0x46a166['getShiftedBy'](0x1);break;}case'remove':{const _0x503cbb=_0x496d01['howMany'],_0x463dcd=_0x496d01['sourcePosition']['_getTransformedByInsertion'](_0x496d01['targetPosition'],_0x503cbb),_0x1c1050=_0x496d01['getMovedRangeStart']();'remove'==_0x496d01['type']?(_0x46a166=_0x463dcd,_0x2b78e2=_0x463dcd):(_0x46a166=_0x1c1050,_0x2b78e2=_0x1c1050['getShiftedBy'](_0x503cbb));break;}}_0x46a166&&_0x46a166['isBefore'](_0x71fc4f)&&(_0x71fc4f=_0x46a166['clone'](),_0x71fc4f['stickiness']='toNone'),_0x2b78e2&&_0x2b78e2['isAfter'](_0x3b8fe4)&&(_0x3b8fe4=_0x2b78e2['clone'](),_0x3b8fe4['stickiness']='toNone');}return _0x3fa4e6['model']['createSelection'](_0x3fa4e6['model']['createRange'](_0x71fc4f,_0x3b8fe4));}function vs(_0x377423,_0x19f19a){ys(_0x377423,_0x19f19a,'forward');const _0x4ab20b=_0x19f19a['getFirstRange']();_0x19f19a['setTo']([]),_0x19f19a['setTo'](_0x4ab20b,{'backward':!0x0}),ys(_0x377423,_0x19f19a,'backward');}function ys(_0x2713f1,_0xb29858,_0x5e8e3e){let _0x153c21=0x14;for(;_0x153c21;){_0x2713f1['modifySelection'](_0xb29858,{'unit':'word','direction':_0x5e8e3e}),_0x153c21--;const _0x5c4b19=_0xb29858['focus']['forward'==_0x5e8e3e?'nodeBefore':'nodeAfter'];if(_0x5c4b19&&_0x5c4b19['is']('element')&&_0x2713f1['schema']['isBlock'](_0x5c4b19)&&_0x2713f1['schema']['isObject'](_0x5c4b19))break;}}function xs(_0x3310de,_0x4fc8a5){for(const [_0x2a0a88,_0x59acbb]of _0x3310de['markers']){const _0x6eb1e7=_0x59acbb['_getTransformedByDeletion'](_0x4fc8a5['start'],_0x4fc8a5['end']['offset']-_0x4fc8a5['start']['offset']);null!=_0x6eb1e7?_0x3310de['markers']['set'](_0x2a0a88,_0x6eb1e7):_0x3310de['markers']['delete'](_0x2a0a88);}}class Ls extends ht(){['id'];['interactionId'];['type'];['sources']=[];['parsedContent']=new _0x39de98([]);['parsedMergedContent']=new _0x39de98([]);['changeGroups']=[];['areActionsDisabled']=!0x1;['documentContextContent'];['aiResponseParser'];['aiResponseApplier'];['editor'];['cachedSuggestionContentParts']={'withDiff':[],'withoutDiff':[]};constructor({type:_0x22de5a,content:_0x239ea7='',isDone:_0x241d88=!0x1,interactionId:_0x242183,areActionsDisabled:_0xcf1b7c,documentContextContent:_0x2610ea,editor:_0x463838,id:_0x48f003}){super(),this['id']=_0x48f003||at(),this['interactionId']=_0x242183,this['type']=_0x22de5a,this['areActionsDisabled']=!!_0xcf1b7c,this['editor']=_0x463838,this['aiResponseParser']=new bs(),this['aiResponseApplier']=new Rs(),this['documentContextContent']=As(_0x2610ea||''),this['set']('isDone',_0x241d88),this['on']('change:content',()=>{this['onContentChange']();}),this['set']('content',_0x239ea7);}['appendContent'](_0x327d02){this['set']('content',this['content']+_0x327d02);}['done'](){this['isDone']||(this['set']('isDone',!0x0),this['onContentChange']());}['destroy'](){this['stopListening']();}['setChangeGroupState'](_0x582985,_0x24fc71){this['changeGroups'][_0x582985]['state']=_0x24fc71,this['fire']('replyChangeGroupStateUpdated',{'reply':this,'index':_0x582985,'state':_0x24fc71});}['getContentParts']({showDiff:_0x2927ac,groupIndex:_0x399454}){if(!this['editor'])throw new ot('ai-get-editor-from-context-no-editor',null,{'aiReply':this});const _0x13976e=this['_getCachedContentParts'](_0x2927ac,_0x399454);if(_0x13976e)return _0x13976e;let _0xac4829=[];if(void 0x0===_0x399454)_0xac4829=this['changeGroups'];else{const _0x578228=this['changeGroups']['find'](({index:_0x2fca42})=>_0x2fca42===_0x399454);if(!_0x578228)throw new ot('ai-reply-get-content-parts-group-not-found',null,{'aiReply':this,'groupIndex':_0x399454});_0xac4829=[_0x578228];}const _0x3f17d2=Os({'editor':this['editor'],'showDiff':_0x2927ac,'changeGroups':_0xac4829,'documentContextContent':this['documentContextContent']});return this['_setCachedContentParts'](_0x2927ac,_0x3f17d2),_0x3f17d2;}['_getCachedContentParts'](_0x37b4e1,_0x4ab9d2){const _0x43effe=_0x37b4e1?'withDiff':'withoutDiff';if(!this['cachedSuggestionContentParts'][_0x43effe]['length'])return null;const _0x343944=this['cachedSuggestionContentParts'][_0x43effe];if(void 0x0===_0x4ab9d2)return _0x343944['length']>0x0&&_0x343944['length']!==this['changeGroups']['length']?(this['_setCachedContentParts'](_0x37b4e1,null),null):_0x4fc2fe(_0x343944);{const _0x579aea=_0x343944['find'](({index:_0x56cfa1})=>_0x56cfa1===_0x4ab9d2);if(_0x579aea)return[_0x4fc2fe(_0x579aea)];}return null;}['_setCachedContentParts'](_0x512026,_0x205581){const _0x117c24=_0x512026?'withDiff':'withoutDiff';_0x205581?_0x205581['forEach'](_0x2dbb2b=>{const _0x54412b=this['cachedSuggestionContentParts'][_0x117c24],_0x3b13c2=_0x54412b['find'](({index:_0x249204})=>_0x249204===_0x2dbb2b['index']);if(_0x3b13c2){const _0x10154d=_0x54412b['indexOf'](_0x3b13c2);_0x54412b['splice'](_0x10154d,0x1,_0x2dbb2b);}else _0x54412b['push'](_0x2dbb2b);}):this['cachedSuggestionContentParts'][_0x117c24]['length']=0x0;}['onContentChange'](){if('modification'===this['type']){this['parsedContent']=this['aiResponseParser']['parseAndNormalizeHTML'](this['content']);const _0x379d29=this['changeGroups'];this['updateChangeGroups']();const _0x250bd5=this['_getDifferentChangeGroups'](_0x379d29,this['changeGroups']);(_0x250bd5['length']||this['isDone'])&&(this['fire']('replyContentUpdated',this,_0x250bd5),this['cachedSuggestionContentParts']['withDiff']['length']=this['cachedSuggestionContentParts']['withoutDiff']['length']=0x0);}else this['parsedContent']=this['aiResponseParser']['convertMarkdownToHTML'](this['content']),this['fire']('replyContentUpdated',this);}['_getDifferentChangeGroups'](_0x5cff2d,_0x2634eb){const _0x210089=[];for(const _0x31b070 of _0x2634eb){const _0x15d30a=_0x5cff2d[_0x31b070['index']];_0x15d30a?_0x15d30a['changes']['length']!==_0x31b070['changes']['length']?_0x210089['push'](_0x31b070):_0x15d30a['changes']['forEach']((_0xb5a915,_0x39d777)=>{const _0x3a10e0=_0x31b070['changes'][_0x39d777];_0xb5a915['id']!==_0x3a10e0['id']&&_0x210089['push'](_0x31b070);}):_0x210089['push'](_0x31b070);}return _0x210089;}['updateChangeGroups'](){const _0x1f9c56=new _0x58105d('p',{},[new _0x58105d('span',{'style':'color:\x20#808080;\x20font-style:\x20italic'},[new _0x106606(cs(this['editor']['locale'],'AI_SUGGESTION_CONTENT_PART_REMOVED'))])]),_0x1bafb2=this['aiResponseApplier']['merge'](this['parsedContent'],this['documentContextContent']['cloneNode'](!0x0),{'markUnstableElements':!this['isDone'],'replaceRemovedWith':_0x1f9c56,'cutAfterLastChange':!this['isDone']});if(!_0x1bafb2['modifiedNodeIds']['length']&&!this['isDone'])return;this['parsedMergedContent']=_0x1bafb2['parsedContent'];let _0x435c07=[];if(_0x368e40(_0x4511b1=>{const _0x35e623=ps(_0x4511b1,'data-id');if(!_0x35e623||!_0x1aa8b3(_0x35e623))return!0x1;const _0x473040=[_0x4511b1,...Cs(_0x4511b1)]['at'](-0x2);if(_0x4511b1!=_0x473040){const _0x8d6168=ps(_0x473040,'data-id');_0x1aa8b3(_0x8d6168)||(_0x435c07['push']({'node':_0x473040,'id':_0x8d6168,'type':'modified'}),_0x1bafb2['modifiedNodeIds']['push'](_0x8d6168));}else _0x1bafb2['modifiedNodeIds']['includes'](_0x35e623)?_0x435c07['push']({'node':_0x4511b1,'type':'modified','id':_0x35e623}):_0x1bafb2['newNodeIds']['includes'](_0x35e623)?_0x435c07['push']({'node':_0x4511b1,'type':'new','id':_0x35e623,'anchorId':ps(_0x4511b1['previousSibling'],'data-id')}):_0x435c07['push']({'node':_0x4511b1,'type':'removed','id':_0x35e623});return!0x0;},this['parsedMergedContent']),_0x435c07=_0x435c07['filter'](({node:_0x15d984})=>[...Cs(_0x15d984),_0x15d984]['every'](_0x377916=>!ps(_0x377916,'data-unstable'))),0x0==_0x435c07['length'])return;const _0x20ff68=[[_0x435c07[0x0]]];for(let _0x2dcb77=0x1;_0x2dcb77<_0x435c07['length'];_0x2dcb77++){const _0x8f6e76=_0x20ff68[_0x20ff68['length']-0x1],_0x1a169b=_0x8f6e76[_0x8f6e76['length']-0x1];_0x435c07[_0x2dcb77]['node']['previousSibling']==_0x1a169b['node']&&'modified'!=_0x435c07[_0x2dcb77]['type']&&'modified'!=_0x1a169b['type']?_0x8f6e76['push'](_0x435c07[_0x2dcb77]):_0x20ff68['push']([_0x435c07[_0x2dcb77]]);}for(const _0x130bc3 of _0x20ff68){const _0x432265=_0x130bc3[0x0],_0x41cf6c=_0x130bc3[_0x130bc3['length']-0x1],_0x201798=_0x15f853(_0x432265['node']['previousSibling']);_0x201798&&_0x130bc3['unshift'](_0x201798);const _0x574144=_0x15f853(_0x41cf6c['node']['nextSibling']);_0x574144&&_0x130bc3['push'](_0x574144);}function _0x1aa8b3(_0x197070){return _0x1bafb2['modifiedNodeIds']['includes'](_0x197070)||_0x1bafb2['newNodeIds']['includes'](_0x197070)||_0x1bafb2['removedNodeIds']['includes'](_0x197070);}function _0x15f853(_0x1633b9){if(_0x1633b9&&ps(_0x1633b9,'data-id')&&!ps(_0x1633b9,'data-unstable')){const _0x19fd05=ps(_0x1633b9,'data-id');if(!_0x1aa8b3(_0x19fd05))return{'node':_0x1633b9,'type':'context','id':_0x19fd05};}return null;}this['changeGroups']=_0x20ff68['map']((_0x52a5d4,_0x4d56a2)=>({'changes':_0x52a5d4,'state':'pending','index':_0x4d56a2}));}}const Ds=['interactionCreated','interactionStarted','interactionStopped','interactionFinished','interactionDestroyed','replyCreated','replyContentUpdated','replyChangeGroupStateUpdated','setConversationTitle','webSearchStarted','webSearchFinished','reasoningStarted','reasoningFinished','toolDataReceived','error'];class Ps extends Et(){['id'];['replies']=[];['currentReply'];['messageId'];['actionCallId'];['currentRequest'];['connector'];['isStopped']=!0x1;['isDestroyed']=!0x1;['editor'];['_isReasoning']=!0x1;['_isWebSearching']=!0x1;constructor({connector:_0x195e1b,editor:_0x53bf44}){super(),this['id']=at(),this['connector']=_0x195e1b,this['isStopped']=!0x0,this['editor']=_0x53bf44;}async['start'](){const _0x408493=[];let _0x19e30e,_0x4e259b,_0xf2e366;this['isStopped']=!0x1;try{this['currentRequest']=await this['sendRequest'](),this['fire']('interactionStarted',this);const _0x4342b8=await this['currentRequest']['getStream']();for await(const _0x30a963 of _0x4342b8){if(this['isStopped'])return;if('error'==_0x30a963['event'])return void this['fire']('error',{'error':new ot('ai-chat-interaction-error',this)});switch(_0x30a963['event']){case'message-metadata':this['messageId']=_0x30a963['data']['messageId'];break;case'action-metadata':this['actionCallId']=_0x30a963['data']['callId'];break;case'conversation-title':this['setConversationTitle'](_0x30a963['data']['conversationTitle'],!0x0);break;case'source':_0x408493['push'](_0x30a963['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'](),_0x19e30e='modification-delta'==_0x30a963['event']?'modification':'text',_0x4e259b='modification-delta'==_0x30a963['event']?_0x30a963['data']['id']:void 0x0,this['currentReply']&&this['currentReply']['type']!=_0x19e30e&&(this['currentReply']['done'](),this['currentReply']=void 0x0),this['currentReply']||(this['currentReply']=this['createReply']({'type':_0x19e30e,'interactionId':this['id'],'id':_0x4e259b}),'modification'==_0x19e30e&&(this['currentReply']['sources']=_0x408493['splice'](0x0))),this['currentReply']['appendContent'](_0x30a963['data']['textDelta']);break;case'mcp-tool-result':_0xf2e366=JSON['parse'](_0x30a963['data']['result']),this['_handleToolResultData']({'toolName':_0x30a963['data']['toolName'],'data':_0xf2e366['data'],'attributes':_0xf2e366['attributes']});break;case'mcp-tool-notification':this['_handleToolNotificationData']({'toolName':_0x30a963['data']['toolName'],'data':_0x30a963['data']['data']});}}}finally{this['isStopped']||(this['currentReply']&&_0x408493['length']>0x0&&(this['currentReply']['sources']=_0x408493['splice'](0x0)),this['_finalizeInteraction'](),this['fire']('interactionFinished',this));}}['stop'](){this['isStopped']||(this['_finalizeInteraction'](),this['fire']('interactionStopped',this));}['getReply'](_0x59f2aa){return this['replies']['find'](_0x566217=>_0x566217['id']===_0x59f2aa);}['destroy'](){this['isDestroyed']||(this['stop'](),this['replies']['forEach'](_0x3f75f4=>_0x3f75f4['destroy']()),this['replies']=[],this['isDestroyed']=!0x0,this['fire']('interactionDestroyed',this),this['stopListening']());}['createReply'](_0x41941e){const _0x3f2715=new Ls({'editor':this['editor'],'documentContextContent':this['getDocumentContext']()?.['content'],..._0x41941e});return this['replies']['push'](_0x3f2715),_0x3f2715['delegate'](...Ds)['to'](this),this['fire']('replyCreated',_0x3f2715),_0x3f2715;}['setConversationTitle'](_0x1b460b,_0x35cd47=!0x1){this['fire']('setConversationTitle',_0x1b460b,_0x35cd47);}['resetWebSearchState'](){this['_isWebSearching']&&(this['_isWebSearching']=!0x1,this['fire']('webSearchFinished',this));}['resetReasoningState'](){this['_isReasoning']&&(this['_isReasoning']=!0x1,this['fire']('reasoningFinished',this));}['_handleToolResultData'](_0x3c6cfe){this['fire']('toolDataReceived',{'type':'result','toolName':_0x3c6cfe['toolName'],'data':structuredClone(_0x3c6cfe['data']||{}),'attributes':structuredClone(_0x3c6cfe['attributes']||{})},this);}['_handleToolNotificationData'](_0x5b8120){this['fire']('toolDataReceived',{'type':'notification','toolName':_0x5b8120['toolName'],'data':structuredClone(_0x5b8120['data'])},this);}['_finalizeInteraction'](){this['isStopped']=!0x0,this['currentRequest']&&this['currentRequest']['abortController']['abort'](),this['currentReply']&&this['currentReply']['done'](),this['currentRequest']=this['currentReply']=void 0x0;}}const Hs=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']]),Ms=['contextItemAdded','contextItemRemoved','contextItemLoadingEnded','contextSent','error','addContextOptionsChanged','sourceResourcesLoaded','resourceStateChanged','uploadProgressChanged'];class Us extends ht(){['_connector'];['_config'];['_ownerId'];constructor({connector:_0x2261ed,config:_0x1b8c4d,ownerId:_0x34fc15}){super(),this['_connector']=_0x2261ed,this['_config']=_0x1b8c4d,this['_ownerId']=_0x34fc15;}['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'](_0x41bbc2){const _0x8d5648=await this['_createContextItemFromContent'](_0x41bbc2);return this['_addToConversationContextItem'](_0x8d5648),'current-document'===_0x8d5648['uiId']&&this['_toggleAddCurrentDocumentOptionVisibility'](),_0x8d5648;}async['_createContextItemFromContent'](_0x3da663){if('document'===_0x3da663['type']){const _0x3d5f0e=await this['_connector']['fetchDocument'](this['_ownerId'],_0x3da663['id'])['getDocument']();return{'id':'current-document','uiId':'current-document','label':'Current\x20document','type':_0x3da663['type'],'content':_0x3d5f0e['content'],'hidden':this['_conversationContextItems']['has']('current-document'),'version':_0x3d5f0e['attributes']?.['version'],'sessionId':_0x3d5f0e['attributes']?.['sessionId']};}if('mcp-tool-context'===_0x3da663['type'])return{'id':_0x3da663['id'],'uiId':_0x3da663['id'],'label':_0x3da663['data']?.['label']||_0x3da663['id'],'type':'mcp-tool-context','mcpServerName':_0x3da663['mcpServerName'],'toolName':_0x3da663['toolName'],'data':_0x3da663['data']||{}};return{'id':_0x3da663['id'],'uiId':_0x3da663['id'],'label':_0x3da663['attributes']?.['label']||_0x3da663['name']||_0x3da663['url']||_0x3da663['id'],'type':_0x3da663['type'],..._0x3da663?.['attributes']?.['resourceId']?{'resourceId':_0x3da663['attributes']?.['resourceId']}:{}};}['getSentContextItems'](){return new Map(this['_conversationContextItems']);}['removeFromContext'](_0x5a7050){const _0xa69e35=this['_pendingContextItems']['get'](_0x5a7050);_0xa69e35?.['isReadOnly']||this['_removeContextItem'](_0x5a7050);}['clearPendingContextItems'](){if(0x0===this['_pendingContextItems']['size'])return;for(const _0x4bcca1 of this['_pendingContextItems']['values']())this['_removeContextItem'](_0x4bcca1['uiId']);const _0x545b1e=this['_conversationContextItems']['get']('current-document')||this['_pendingContextItems']['get']('current-document');_0x545b1e&&this['_addContextItem']({..._0x545b1e,'isReadOnly':!0x0,'hidden':!0x0});}['addToConversationContext'](_0x42f76a){for(const _0x17944d of _0x42f76a['values']())this['_addToConversationContextItem'](_0x17944d);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'](_0x471ec8){return Array['from'](_0x471ec8['values']())['map'](_0xaf8ed0=>this['_mapContextItemToRequestData'](_0xaf8ed0))['filter'](_0xda65e=>null!==_0xda65e);}async['addFilesToContext'](_0x4602bd,_0x51c37f,_0x4dc7b7='file'){const _0x1b23f7='files-'+at();this['_startUploadOperation'](_0x1b23f7);try{await Promise['all'](_0x4602bd['map'](async _0x1e6645=>{const _0x24d3c0='file-'+at(),_0x19992d=_0x316a01(_0x1e6645['name']);try{this['_addContextItem']({'type':_0x4dc7b7,'label':_0x51c37f?.['label']||_0x19992d,'uiId':_0x24d3c0,'resourceId':_0x51c37f?.['resourceId']},!0x0);const _0x2746d9=this['_connector']['uploadFile'](this['_ownerId'],_0x1e6645,_0x51c37f);this['_ongoingUploads']['set'](_0x24d3c0,_0x2746d9['abortController']);const {id:_0x524bf7}=await _0x2746d9['getId']();this['_ongoingUploads']['delete'](_0x24d3c0),this['_finishContextItemLoading']({'type':_0x4dc7b7,'id':_0x524bf7,'label':_0x51c37f?.['label']||_0x19992d,'uiId':_0x24d3c0,'resourceId':_0x51c37f?.['resourceId']},!0x1);}catch(_0x1d2266){this['_ongoingUploads']['delete'](_0x24d3c0);if(!(_0x1d2266 instanceof ot&&_0x1d2266['message']['startsWith']('ai-request-aborted'))){const _0x5bbe7d=Hs['get'](_0x1d2266['code'])||'ai-chat-file-upload-failed',_0x2cda6b=new ot(_0x5bbe7d,null,{'fileName':_0x19992d,..._0x1d2266});_0x2cda6b['stack']=_0x1d2266['stack'],this['fire']('error',{'error':_0x2cda6b});}this['_removeContextItem'](_0x24d3c0);}}));}finally{this['_finishUploadOperation'](_0x1b23f7);}}['addCurrentDocumentToContext'](_0x447334){if(this['isCurrentDocumentInContext']()||!this['_addContextOptionsState']['document']['enabled'])return;const _0x4e63f7={'type':'document','uiId':'current-document','label':_0x447334,'isReadOnly':this['_conversationContextItems']['has']('current-document'),'hidden':this['_conversationContextItems']['has']('current-document')};this['_addContextItem'](_0x4e63f7);}async['updateCurrentDocument'](_0x2bef38,_0x2b3cc0,_0x21b244,_0x38b87a){const _0x3dd087=this['_pendingContextItems']['get']('current-document');if(_0x3dd087&&_0x2bef38){_0x3dd087['selection']=_0x38b87a?_0x38b87a['map'](_0x177194=>({'start':_0x177194['start'],'end':_0x177194['end']})):[];try{if(_0x3dd087['version']===_0x2b3cc0)return;const {id:_0x390ed0}=await this['_connector']['uploadDocument'](this['_ownerId'],_0x2bef38,{'version':_0x2b3cc0,'sessionId':_0x21b244})['getId']();_0x3dd087['id']=_0x390ed0,_0x3dd087['content']=_0x2bef38,_0x3dd087['version']=_0x2b3cc0,_0x3dd087['sessionId']=_0x21b244;}catch(_0x31794a){const _0x23fa0e=new ot('ai-chat-document-upload-failed',null);_0x23fa0e['stack']=_0x31794a['stack'],this['fire']('error',{'error':_0x23fa0e});}}}['addSelectionToContext'](_0x36151b){this['_addContextItem']({'type':'selection','label':_0x36151b,'uiId':'selection','content':_0x36151b});}['removeSelectionFromContext'](){this['_removeContextItem']('selection');}async['addUrlToContext'](_0x37f486,_0x1179be){const _0x5d2ef3='url-'+at();this['_startUploadOperation'](_0x5d2ef3);const _0x29ab91='url-'+at();try{this['_addContextItem']({'type':'web-resource','label':_0x1179be?.['label']||_0x37f486,'uiId':_0x29ab91,'resourceId':_0x1179be?.['resourceId']},!0x0);const _0x2a3f20=this['_connector']['uploadUrl'](this['_ownerId'],_0x37f486,_0x1179be);this['_ongoingUploads']['set'](_0x29ab91,_0x2a3f20['abortController']);const {id:_0x34524d}=await _0x2a3f20['getId']();this['_ongoingUploads']['delete'](_0x29ab91),this['_finishContextItemLoading']({'type':'web-resource','id':_0x34524d,'label':_0x1179be?.['label']||_0x37f486,'uiId':_0x29ab91,'resourceId':_0x1179be?.['resourceId']},!0x1);}catch(_0x3d7a30){this['_ongoingUploads']['delete'](_0x29ab91),(_0x3d7a30['message']['startsWith']('ai-request-aborted')||this['fire']('error',{'error':new ot('ai-chat-url-upload-failed',this,{'url':_0x37f486,'originalError':_0x3d7a30}),'url':_0x37f486}),this['_removeContextItem'](_0x29ab91));}finally{this['_finishUploadOperation'](_0x5d2ef3);}}['addToolItemToContext'](_0x25bb1a){_0x25bb1a['id']=_0x25bb1a['id']??at()['substring'](0x0,0x15),this['_pendingContextItems']['set'](_0x25bb1a['uiId'],_0x25bb1a),this['fire']('contextItemAdded',{'contextItem':_0x25bb1a,'isLoading':!0x1});}async['loadSourceResources'](_0xd8096f,_0x37f759,_0x4bbce4){const _0x2cec0a=this['_addContextOptionsState']['sources']['find'](_0x1db614=>_0x1db614['id']===_0xd8096f);if(!_0x2cec0a)return this['fire']('error',{'error':new ot('ai-chat-source-not-found',this,{'sourceId':_0xd8096f}),'sourceId':_0xd8096f}),[];try{const _0x34c9f0=(await _0x2cec0a['getResources'](_0x37f759))['map'](_0x33d282=>{const _0x3b7d8e=this['_isResourceInContext'](_0x33d282['id']);return{..._0x33d282,'isInContext':_0x3b7d8e};});return _0x2cec0a['resources']=_0x34c9f0,this['fire']('sourceResourcesLoaded',{'sourceId':_0xd8096f,'source':_0x2cec0a,'resources':_0x34c9f0,'uid':_0x4bbce4}),_0x34c9f0;}catch(_0x2ee973){return this['fire']('error',{'error':new ot('ai-chat-source-resources-load-failed',this,{'sourceId':_0xd8096f,'originalError':_0x2ee973}),'sourceId':_0xd8096f,'sourceLabel':_0x2cec0a['label']}),[];}}async['addResourceToContext'](_0x5158b3,_0x5369dd){if(this['_isResourceInContext'](_0x5369dd['id']))return;let _0x256234=_0x5369dd['data'];if(!_0x256234&&_0x5158b3['getData'])try{_0x256234=await _0x5158b3['getData'](_0x5369dd['id']);}catch(_0x56ed45){return void this['fire']('error',{'error':new ot('ai-chat-resource-load-failed',this,{'resourceId':_0x5369dd['id'],'sourceId':_0x5158b3['id'],'originalError':_0x56ed45}),'resourceId':_0x5369dd['id'],'sourceId':_0x5158b3['id']});}if(_0x256234)switch(_0x5369dd['type']){case'web-resource':if('string'!=typeof _0x256234)return void this['fire']('error',{'error':new ot('ai-chat-context-invalid-data',this,{'resourceId':_0x5369dd['id'],'sourceId':_0x5158b3['id'],'expectedType':'string','actualType':typeof _0x256234}),'resourceId':_0x5369dd['id'],'sourceId':_0x5158b3['id']});await this['addUrlToContext'](_0x256234,{'label':_0x5369dd['label'],'resourceId':_0x5369dd['id']});break;case'file':if(!(_0x256234 instanceof File))return void this['fire']('error',{'error':new ot('ai-chat-context-invalid-data',this,{'resourceId':_0x5369dd['id'],'sourceId':_0x5158b3['id'],'expectedType':'File','actualType':typeof _0x256234}),'resourceId':_0x5369dd['id'],'sourceId':_0x5158b3['id']});await this['addFilesToContext']([_0x256234],{'label':_0x5369dd['label'],'resourceId':_0x5369dd['id']});break;case'text':if('object'!=typeof _0x256234||!('content'in _0x256234)||!('type'in _0x256234))return void this['fire']('error',{'error':new ot('ai-chat-context-invalid-data',this,{'resourceId':_0x5369dd['id'],'sourceId':_0x5158b3['id'],'expectedType':'object\x20with\x20content\x20and\x20type\x20properties','actualType':typeof _0x256234}),'resourceId':_0x5369dd['id'],'sourceId':_0x5158b3['id']});_0x256234=Us['_convertTextResourceToFile'](_0x256234,_0x5369dd['label']),await this['addFilesToContext']([_0x256234],{'label':_0x5369dd['label'],'resourceId':_0x5369dd['id']},'text');break;case'mcp-tool-context':break;default:this['fire']('error',{'error':new ot('ai-chat-context-unsupported-type',this,{'resourceId':_0x5369dd['id'],'sourceId':_0x5158b3['id'],'resourceType':_0x5369dd['type']}),'resourceId':_0x5369dd['id'],'sourceId':_0x5158b3['id']});}else this['fire']('error',{'error':new ot('ai-chat-resource-no-data',this,{'resourceId':_0x5369dd['id'],'sourceId':_0x5158b3['id']}),'resourceId':_0x5369dd['id'],'sourceId':_0x5158b3['id']});}static['_convertTextResourceToFile'](_0x309183,_0x5f23fe){switch(_0x309183['type']){case'markdown':return new File([_0x309183['content']],_0x5f23fe,{'type':'text/markdown'});case'html':return new File([_0x309183['content']],_0x5f23fe,{'type':'text/html'});default:return new File([_0x309183['content']],_0x5f23fe,{'type':'text/plain'});}}static['_mapContextItemToRequestData'](_0x230f46){switch(_0x230f46['type']){case'file':case'text':return{'type':'file','id':_0x230f46['id']};case'web-resource':return{'type':'web-resource','id':_0x230f46['id']};case'document':return{'type':'document','id':_0x230f46['id'],..._0x230f46['selection']?.['length']&&{'selection':_0x230f46['selection']}};case'mcp-tool-context':{const _0x1189c3=_0x230f46;return{'type':'mcp-tool-context','mcpServerName':_0x1189c3['mcpServerName'],'toolName':_0x1189c3['toolName'],'data':_0x1189c3['data'],'id':_0x1189c3['id']};}default:return null;}}['_addContextItem'](_0x183f7d,_0x305d36=!0x1){if(this['_pendingContextItems']['set'](_0x183f7d['uiId'],_0x183f7d),_0x183f7d['hidden']||this['fire']('contextItemAdded',{'contextItem':_0x183f7d,'isLoading':_0x305d36}),'current-document'===_0x183f7d['uiId']&&this['_toggleAddCurrentDocumentOptionVisibility'](),_0x183f7d['resourceId']){const _0x45fc7c=this['_findSourceIdsByResourceId'](_0x183f7d['resourceId']);_0x45fc7c&&_0x45fc7c['forEach'](_0xdf1e66=>{this['_updateResourceInContextState'](_0xdf1e66,_0x183f7d['resourceId'],!0x0);});}}['_removeContextItem'](_0x347cac){const _0x1a6a21=this['_pendingContextItems']['get'](_0x347cac),_0x3daff6=this['_ongoingUploads']['get'](_0x347cac);if(_0x3daff6&&(_0x3daff6['abort'](),this['_ongoingUploads']['delete'](_0x347cac)),_0x1a6a21?.['resourceId']){const _0x46aab8=this['_findSourceIdsByResourceId'](_0x1a6a21['resourceId']);_0x46aab8&&_0x46aab8['forEach'](_0x1807dd=>{this['_updateResourceInContextState'](_0x1807dd,_0x1a6a21['resourceId'],!0x1);});}this['_pendingContextItems']['delete'](_0x347cac),this['fire']('contextItemRemoved',{'uiId':_0x347cac,'type':_0x1a6a21?.['type']}),'current-document'===_0x347cac&&this['_toggleAddCurrentDocumentOptionVisibility']();}['_finishContextItemLoading'](_0x401864,_0x3c949f){if(this['_pendingContextItems']['has'](_0x401864['uiId'])&&(this['_pendingContextItems']['set'](_0x401864['uiId'],_0x401864),this['fire']('contextItemLoadingEnded',{'contextItem':_0x401864,'isLoading':_0x3c949f}),_0x401864['resourceId'])){const _0x3cccb2=this['_findSourceIdsByResourceId'](_0x401864['resourceId']);_0x3cccb2&&_0x3cccb2['forEach'](_0x238a71=>{this['_updateResourceInContextState'](_0x238a71,_0x401864['resourceId'],!0x0);});}}['_addToConversationContextItem'](_0x443eb3){this['_conversationContextItems']['set'](_0x443eb3['uiId'],_0x443eb3);}['_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'](_0xdd9036=>({..._0xdd9036,'enabled':!0x0}))??[]},this['fire']('addContextOptionsChanged',{'options':this['_addContextOptionsState']});}['_getCustomSourcesInitialState'](){return this['_config']?.['sources']?.['map'](_0x5c8f80=>({..._0x5c8f80,'resources':[]}))??[];}['_toggleAddCurrentDocumentOptionVisibility'](){const _0x351b95=this['isCurrentDocumentInContext']()||this['isCurrentDocumentInConversation']();this['_addContextOptionsState']['document']['isHidden']=_0x351b95,this['fire']('addContextOptionsChanged',{'options':this['_addContextOptionsState']});}['_isResourceInContext'](_0x31c54c){for(const _0x51153f of this['_pendingContextItems']['values']())if(_0x51153f['resourceId']===_0x31c54c)return!0x0;for(const _0x13efe8 of this['_conversationContextItems']['values']())if(_0x13efe8['resourceId']===_0x31c54c)return!0x0;return!0x1;}['_findSourceIdsByResourceId'](_0x4183f7){const _0x278b2d=[];for(const _0x3546f7 of this['_addContextOptionsState']['sources']){_0x3546f7['resources']['find'](_0x555a6c=>_0x555a6c['id']===_0x4183f7)&&_0x278b2d['push'](_0x3546f7['id']);}return 0x0===_0x278b2d['length']?null:_0x278b2d;}['_updateResourceInContextState'](_0x32fd2e,_0x2dd2aa,_0x49eb49){const _0x30caa8=this['_addContextOptionsState']['sources']['find'](_0x154604=>_0x154604['id']===_0x32fd2e);if(!_0x30caa8)return;const _0x25a830=_0x30caa8['resources']['find'](_0x101a59=>_0x101a59['id']===_0x2dd2aa);_0x25a830&&(_0x25a830['isInContext']=_0x49eb49,this['fire']('resourceStateChanged',{'sourceId':_0x32fd2e,'resourceId':_0x2dd2aa,'isInContext':_0x49eb49}));}['_startUploadOperation'](_0x2ccd8c){this['_ongoingUploadOperations']['set'](_0x2ccd8c,!0x0),this['_ongoingUploadOperations']['size']&&this['fire']('uploadProgressChanged',{'isUploadInProgress':!0x0});}['_finishUploadOperation'](_0x2cf57c){this['_ongoingUploadOperations']['delete'](_0x2cf57c),0x0===this['_ongoingUploadOperations']['size']&&this['fire']('uploadProgressChanged',{'isUploadInProgress':!0x1});}}const Vs=['capabilitiesUpdated'];class Bs extends Et(){['_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'](_0x4ffc60){const _0x835b5={};return _0x4ffc60&&_0x4ffc60['isWebSearchEnabled']&&(_0x835b5['webSearch']={}),_0x4ffc60&&_0x4ffc60['isReasoningEnabled']&&(_0x835b5['reasoning']={}),_0x835b5;}['toggleWebSearch'](){this['setWebSearch'](!this['_isWebSearchEnabled']);}['toggleReasoning'](){this['setReasoning'](!this['_isReasoningEnabled']);}['setWebSearch'](_0x580cde){_0x580cde!==this['_isWebSearchEnabled']&&(this['_isWebSearchEnabled']=_0x580cde,this['fire']('capabilitiesUpdated',this['getCapabilitiesConfig']()));}['setReasoning'](_0x2c54cc){_0x2c54cc!==this['_isReasoningEnabled']&&(this['_isReasoningEnabled']=_0x2c54cc,this['fire']('capabilitiesUpdated',this['getCapabilitiesConfig']()));}}class Gs extends Ps{['userMessage'];['conversationId'];['contextItems']=new Map();['capabilities'];['model'];['attributes'];constructor(_0xcb902a){super(_0xcb902a),this['conversationId']=_0xcb902a['conversationId'],this['contextItems']=_0xcb902a['contextItems'],this['capabilities']=_0xcb902a['capabilities'],this['userMessage']=_0xcb902a['userMessage'],this['model']=_0xcb902a['model'],this['attributes']=_0xcb902a['attributes'];}async['sendRequest'](){return this['connector']['queryAssistant']({'message':this['userMessage'],'conversationId':this['conversationId'],'parts':Us['mapContextItemsToRequestData'](this['contextItems']),'capabilities':Bs['getCapabilitiesRequestData'](this['capabilities']),'model':this['model'],'attributes':this['attributes']});}['getDocumentContext'](){return this['contextItems']['get']('current-document');}}class Fs extends Et(){['id'];['isStarted']=!0x1;['isFromHistory'];['interactions']=[];['currentInteraction'];['selectedModel'];['connector'];['options'];constructor(_0x2ce22f){super(),this['options']=_0x2ce22f,this['connector']=_0x2ce22f['connector'],this['chatModels']=_0x2ce22f['chatModels'],this['id']=_0x2ce22f['conversationId'],this['isFromHistory']=_0x2ce22f['isFromHistory'];}async['init'](_0x353e92){try{this['chatContext']=new Us({'connector':this['connector'],'config':_0x353e92,'ownerId':this['id']}),this['chatContext']['delegate'](...Ms)['to'](this),this['chatContext']['init'](),this['chatCapabilities']=new Bs(),this['chatCapabilities']['delegate'](...Vs)['to'](this),this['chatCapabilities']['init']();const _0x29c26a=await this['chatModels']['getAvailableModels']();this['fire']('conversationInitialized',{'availableModels':_0x29c26a});const _0x497727=await this['chatModels']['getModel'](this['options']['selectedModelId']);_0x497727&&await this['setModel'](_0x497727);}catch(_0x55b623){const _0x1fe970=new ot('ai-chat-conversation-init-failed',null,{'message':_0x55b623['message']||_0x55b623});_0x1fe970['stack']=_0x55b623['stack'],this['fire']('error',{'error':_0x1fe970});}}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:_0xaf8005}=await this['connector']['startConversation'](this['id'],this['options']['group'])['getConversation']();this['id']=_0xaf8005,this['isStarted']=!0x0,this['fire']('conversationStarted',{'conversationId':this['id'],'selectedModel':this['selectedModel']});}catch(_0x3783f2){const _0x36eca1=new ot('ai-chat-conversation-start-failed',null,{'message':_0x3783f2['message'],'conversationId':this['id']});throw _0x36eca1['stack']=_0x3783f2['stack'],this['fire']('error',{'error':_0x36eca1}),_0x36eca1;}}async['load'](_0x4c6471,_0x414d78){try{const _0xd1514f=await this['connector']['fetchConversation'](_0x4c6471)['getConversation'](),_0x45deb7=await this['connector']['fetchConversationMessages'](_0x4c6471)['getMessages'](),_0x168439=_0x45deb7[0x0]['model'];this['isStarted']=!0x0,this['id']=_0xd1514f['id'],'title'in _0xd1514f?this['fire']('setConversationTitle',_0xd1514f['title'],!0x0):this['fire']('setConversationTitle','',!0x0);const _0xb1fb6e=(await this['chatModels']['getAll']())['find'](_0x2abce9=>_0x2abce9['id']['toLowerCase']()===_0x168439['toLowerCase']());return this['selectedModel']=_0xb1fb6e,this['fire']('modelSelected',{'selectedModel':_0xb1fb6e,'isDisabled':!0x0}),await this['_processMessagesToInteractions'](_0x45deb7,_0x414d78,_0x168439),this['currentInteraction']=void 0x0,this;}catch(_0xc9f702){const _0x36c898=new ot('ai-chat-conversation-init-from-id-failed',null,{'message':_0xc9f702['message'],'conversationId':_0x4c6471});throw _0x36c898['stack']=_0xc9f702['stack'],this['fire']('error',{'error':_0x36c898}),_0x36c898;}}async['_processMessagesToInteractions'](_0x543fb7,_0x4909e1,_0x11cbd9){let _0x37142b;for(const _0x57cf57 of _0x543fb7)if('user'===_0x57cf57['role']){const _0x1f536e=await this['_extractContextItems'](_0x57cf57),_0x2422eb={'isReasoningEnabled':Object['hasOwn'](_0x57cf57['capabilities'],'reasoning'),'isWebSearchEnabled':Object['hasOwn'](_0x57cf57['capabilities'],'webSearch')};_0x37142b=this['createInteraction']({'userMessage':_0x57cf57['prompt'],'contextItems':_0x1f536e,'capabilities':_0x2422eb,'modelId':_0x11cbd9,'attributes':_0x57cf57['attributes']}),this['currentInteraction']=_0x37142b,this['chatContext']['addToConversationContext'](this['currentInteraction']['contextItems']);}else{if('assistant'===_0x57cf57['role']&&_0x37142b){const _0x48cb9a=[];for(const _0x6e356b of _0x57cf57['content'])switch(_0x6e356b['type']){case'text':case'modification':{const _0x3e5767=_0x37142b['getDocumentContext']()?.['sessionId']!==_0x4909e1;_0x37142b['currentReply']=_0x37142b['createReply']({'type':_0x6e356b['type'],'isDone':!0x0,'interactionId':_0x37142b['id'],'areActionsDisabled':_0x3e5767}),_0x37142b['currentReply']['appendContent'](_0x6e356b['content']),_0x48cb9a['length']>0x0&&(_0x37142b['currentReply']['sources']=_0x48cb9a['splice'](0x0));break;}case'url':_0x48cb9a['push'](_0x6e356b);break;case'mcp-tool-result':{const {data:_0x503900,attributes:_0x1a13ff}=JSON['parse'](_0x6e356b['content']);_0x37142b['_handleToolResultData']({'toolName':_0x6e356b['toolName'],'data':_0x503900,'attributes':_0x1a13ff});break;}}}}}async['_extractContextItems'](_0x42304c){const _0x2f8a25=new Map();if(!_0x42304c['content'])return _0x2f8a25;for(const _0x2e739c of _0x42304c['content']){const _0x118252=await this['chatContext']['populateFromMessage'](_0x2e739c);_0x118252&&_0x2f8a25['set'](_0x118252['id'],_0x118252);}return _0x2f8a25;}async['handleUserInteraction']({userMessage:_0xb3e3d5,attributes:_0x39ce8d}){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 _0x6c505b=this['chatContext']['getPendingContextItems'](),_0x3a10f2=this['chatCapabilities']['getCapabilitiesConfig'](),_0x1b8018=this['selectedModel']['id'];this['currentInteraction']=this['createInteraction']({'userMessage':_0xb3e3d5,'contextItems':_0x6c505b,'capabilities':_0x3a10f2,'modelId':_0x1b8018,'attributes':_0x39ce8d}),await this['currentInteraction']['start'](),this['chatContext']['addToConversationContext'](this['currentInteraction']['contextItems']);}catch(_0x403045){if(_0x403045 instanceof ot)this['fire']('error',{'interactionId':this['currentInteraction']?this['currentInteraction']['id']:void 0x0,'error':_0x403045});else{const _0x18f9cf=Hs['get'](_0x403045['code'])||'ai-chat-handle-user-interaction-start-failed';this['fire']('error',{'interactionId':this['currentInteraction']?this['currentInteraction']['id']:void 0x0,'error':new ot(_0x18f9cf,null,{'error':_0x403045})});}}finally{this['currentInteraction']?.['stop'](),this['currentInteraction']=void 0x0;}}['createInteraction']({userMessage:_0x44da06,contextItems:_0x1a0ab5,capabilities:_0x236c4a,modelId:_0x14cf8f,attributes:_0x3d9929}){const _0x3f906e=new Gs({'userMessage':_0x44da06,'contextItems':_0x1a0ab5,'capabilities':_0x236c4a,'conversationId':this['id'],'connector':this['connector'],'editor':this['options']['getEditor']&&this['options']['getEditor'](),'model':_0x14cf8f,'attributes':_0x3d9929});return _0x3f906e['delegate'](...Ds)['to'](this),this['interactions']['push'](_0x3f906e),this['fire']('interactionCreated',_0x3f906e),_0x3f906e;}['getInteraction'](_0x2b82cc){return this['interactions']['find'](_0x4fdf96=>_0x4fdf96['id']===_0x2b82cc);}['removeInteraction'](_0x307a3a){const _0x12ae68=this['getInteraction'](_0x307a3a);_0x12ae68&&(_0x12ae68['destroy'](),this['interactions']['splice'](this['interactions']['indexOf'](_0x12ae68),0x1));}get['lastInteraction'](){return this['interactions'][this['interactions']['length']-0x1];}['addCurrentDocumentToContext'](_0x1513dc){this['chatContext']['addCurrentDocumentToContext'](_0x1513dc);}async['updateCurrentDocumentInContext']({content:_0x3024d1,version:_0x1ab422,sessionId:_0x3c0b94,selections:_0x14a5ad}){await this['chatContext']['updateCurrentDocument'](_0x3024d1,_0x1ab422,_0x3c0b94,_0x14a5ad);}['getCurrentDocumentContext'](){return this['currentInteraction']?.['getDocumentContext']()?.['content']||'';}['addSelectionToContext'](_0x3db3e7){this['chatContext']['addSelectionToContext'](_0x3db3e7);}['removeSelectionFromContext'](){this['chatContext']['removeSelectionFromContext']();}['addFilesToContext'](_0x540de0){this['chatContext']['addFilesToContext'](_0x540de0);}['addUrlToContext'](_0x1b32da){this['chatContext']['addUrlToContext'](_0x1b32da);}['addToolItemToContext'](_0x3e4448){this['chatContext']['addToolItemToContext'](_0x3e4448);}['addResourceToContext'](_0xd330ee,_0x270f9e){this['chatContext']['addResourceToContext'](_0xd330ee,_0x270f9e);}['loadSourceResources'](_0xf26451,_0x338555,_0x373cad){return this['chatContext']['loadSourceResources'](_0xf26451,_0x338555,_0x373cad);}['removeFromContext'](_0x4074e6){this['chatContext']['removeFromContext'](_0x4074e6);}['setWebSearch'](_0x4351b3){this['chatCapabilities']['setWebSearch'](_0x4351b3);}['toggleWebSearch'](){this['chatCapabilities']['toggleWebSearch']();}['setReasoning'](_0x20cc97){this['chatCapabilities']['setReasoning'](_0x20cc97);}['toggleReasoning'](){this['chatCapabilities']['toggleReasoning']();}['isCurrentDocumentInContext'](){return this['chatContext']['isCurrentDocumentInContext']();}['isCurrentDocumentInConversation'](){return this['chatContext']['isCurrentDocumentInConversation']();}['isSelectionInContext'](){return this['chatContext']['isSelectionInContext']();}async['setModel'](_0x346d27){_0x346d27?!0x1===await this['chatModels']['isAvailable'](_0x346d27)&&(pt('ai-chat-conversation-set-model-not-available',{'conversation':this,'model':_0x346d27}),_0x346d27=(await this['chatModels']['getAvailableModels']())[0x0]):(pt('ai-chat-conversation-set-model-null',{'conversation':this}),_0x346d27=(await this['chatModels']['getAvailableModels']())[0x0]),_0x346d27['id']!==this['selectedModel']?.['id']&&(this['selectedModel']=_0x346d27,this['chatCapabilities']['reset'](),this['fire']('modelSelected',{'selectedModel':_0x346d27}));}}class Ks extends Et(){['_connector'];['_config'];['_locale'];['_modelList']=[];['_modelsRequest']=null;constructor({connector:_0x3c2a8a,config:_0x1467f1,locale:_0x2f160a}){super(),this['_connector']=_0x3c2a8a,this['_config']=_0x1467f1,this['_locale']=_0x2f160a;}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 _0x281b9a=await this['getAll']();let _0x53042b;return _0x53042b=this['_availableModels']?this['_filterModels'](_0x281b9a,this['_availableModels']):_0x281b9a['filter'](_0x283b30=>_0x283b30['recommended']),_0x53042b;}async['getModel'](_0x47879d){const _0x3072d1=await this['getAll']();if(!_0x3072d1['length'])return null;if(_0x47879d){const _0x3f104c=this['_getModelById'](_0x3072d1,_0x47879d);if(_0x3f104c)return _0x3f104c;pt('ai-chat-model-id-unrecognized',{'modelId':_0x47879d,'fallBackModelId':this['_defaultModelId']});}return this['getDefault']();}async['getDefault'](){const _0x5c0adc=await this['getAvailableModels']();if(!_0x5c0adc['length'])return null;if(this['_defaultModelId']){const _0x212bcb=this['_getModelById'](_0x5c0adc,this['_defaultModelId']);if(_0x212bcb)return _0x212bcb;pt('ai-chat-default-model-id-unrecognized',{'defaultModelId':this['_defaultModelId'],'fallBackModelId':_0x5c0adc[0x0]['id']});}return _0x5c0adc[0x0];}async['isAvailable'](_0x153355){return(await this['getAvailableModels']())['some'](_0x4d38ef=>_0x4d38ef['name']===_0x153355['name']&&_0x4d38ef['provider']===_0x153355['provider']);}async['_retrieveModels'](){if(!this['_modelList']['length'])try{const _0x428b8a=this['_locale']['uiLanguage']||'en',_0x3eceef=this['_connector']['getModels'](_0x428b8a),_0x2fdef5=await _0x3eceef['list']();this['_modelList']=_0x2fdef5['items']['map'](_0x19de7e=>Ws(_0x19de7e)?{..._0x19de7e,'name':cs(this['_locale'],'AI_MODEL_NAME_AUTO')}:_0x19de7e);}catch(_0x2cefd2){throw Tt('ai-models-unable-to-retrieve',{'error':_0x2cefd2}),_0x2cefd2;}return[...this['_modelList']];}['_filterModels'](_0x3add17,_0x3cdd84){let _0x524bb1;if(_0x3cdd84){_0x524bb1=[];const _0x588b3d=new Set(),_0x2b5d6a='string'==typeof _0x3cdd84?[_0x3cdd84['toLocaleLowerCase']()]:_0x3cdd84['map'](_0x175776=>_0x175776['toLocaleLowerCase']());for(const _0x47d885 of _0x2b5d6a)for(const _0x5ab9c6 of _0x3add17)!_0x588b3d['has'](_0x5ab9c6['id'])&&this['_isMatchingFilter'](_0x5ab9c6,_0x47d885)&&(_0x524bb1['push'](_0x5ab9c6),_0x588b3d['add'](_0x5ab9c6['id']));}else _0x524bb1=_0x3add17;return _0x524bb1;}['_isMatchingFilter'](_0x42084d,_0x54aa83){const _0x308f16=_0x42084d['id']['toLocaleLowerCase'](),_0x174789=_0x42084d['name']['toLocaleLowerCase'](),_0x35ab55=_0x42084d['provider']['toLocaleLowerCase']();return _0x308f16===_0x54aa83||_0x174789===_0x54aa83||Ws(_0x42084d)&&'auto'===_0x54aa83||_0x35ab55===_0x54aa83||_0x308f16['startsWith'](_0x54aa83);}['_getModelById'](_0x3db123,_0x170499){return _0x3db123['find'](_0x4687f6=>Ws(_0x4687f6)&&'auto'===_0x170499?_0x4687f6:_0x4687f6['id']===_0x170499)||null;}}function Ws(_0x1aec2f){return _0x1aec2f['id']['startsWith']('agent');}function Ys(_0x2293a6){if(_0x2293a6 instanceof _0x867bd7)return _0x2293a6;if(_0x2293a6?.['editors']&&_0x2293a6['editors']['get'](0x0))return _0x2293a6['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.'),_0x2293a6['editors']['get'](0x0);throw new ot('ai-get-editor-from-context-no-editor');}function $s({editor:_0x52051f,interaction:_0x168924,reply:_0x4bbdea,groups:_0x52d34d,transform:_0x57b6e9,documentCompare:_0x3beec1,documentCompareOptions:_0x197a60}){const _0x450c41=_0x168924['getDocumentContext']();if(!_0x450c41)return[];const _0x5bb865=_0x450c41['content'],_0x34239f=_0x450c41['version'],_0x3d3b35=_0x4bbdea['documentContextContent']['cloneNode'](!0x0);for(const {changes:_0x2be59e}of _0x52d34d){const _0x49f2f1=_0x2be59e['filter'](_0x52a550=>'new'!=_0x52a550['type'])['map'](_0x5fd699=>Is('data-id',_0x5fd699['id'],_0x3d3b35)),_0x341ce2=_0x2be59e['filter'](_0x2890b6=>'removed'!=_0x2890b6['type'])['map'](_0xe2b8b=>_0xe2b8b['node']['cloneNode'](!0x0));let _0x191cb3=null;if(_0x49f2f1['length']){_0x191cb3=_0x49f2f1[0x0]['previousSibling'];for(let _0x5f3a3e=0x0;_0x5f3a3e<_0x49f2f1['length'];_0x5f3a3e++)_0x35c3c7(_0x49f2f1[_0x5f3a3e]);}if(_0x341ce2['length']){_0x191cb3||(_0x2be59e[0x0]['anchorId']?_0x191cb3=Is('data-id',_0x2be59e[0x0]['anchorId'],_0x3d3b35):(_0x191cb3=_0x341ce2['shift'](),_0x16b61c(_0x3d3b35,_0x191cb3)));for(let _0x2fecc1=0x0;_0x2fecc1<_0x341ce2['length'];_0x2fecc1++)_0x6779d3(_0x191cb3,_0x341ce2[_0x2fecc1]),_0x191cb3=_0x341ce2[_0x2fecc1];}}const _0x44af93=gs(_0x3d3b35),_0x1c4f41=_0x3beec1['getDiff'](_0x5bb865,_0x44af93,_0x197a60)['getOperations']();if(_0x57b6e9){const _0x160a46=_0x52051f['model']['document']['history']['getOperations'](_0x34239f),_0x2977c4={'document':_0x52051f['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1};return _0x1b1979(_0x1c4f41,_0x160a46,_0x2977c4)['operationsA'];}return _0x1c4f41;}function qs(_0x46fa8b,_0x4bfbd1){if('marker'!=_0x4bfbd1['type'])return;const _0x11df1d=_0x46fa8b['model']['markers']['get'](_0x4bfbd1['name']);_0x11df1d&&(_0x4bfbd1['oldRange']=_0x11df1d['getRange']());}class Qs extends _0x474324{['activeConversation'];['_aiEditing'];['_aiConnector'];['_aiChatUi'];['_aiChatModels'];['_aiChatBalloon'];['_batchToChanges']=new Map();['_currentPreviewedChangeGroup']=null;['_bodyCollection'];static get['requires'](){return[hs,_0x53366e];}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 Ks({'connector':this['_aiConnector'],'config':this['context']['config']['get']('ai.models'),'locale':this['context']['locale']});const _0x1d5a55=this['context']['plugins']['get']('AITabs');this['listenTo'](this['_aiChatUi'],'startConversation',()=>{this['_startConversationSafely']();}),this['listenTo'](this['_aiChatUi'],'sendUserMessage',(_0xe3a441,_0x41c916)=>{this['_handleUIUserMessage']({'message':_0x41c916});}),this['listenTo'](_0x1d5a55,'resizedTabs',(_0x3194b8,_0x49c673)=>{this['_setIsMaximized'](_0x49c673);}),this['listenTo'](this['_aiChatUi'],'resizeTabs',()=>{_0x1d5a55['resize']();}),this['listenTo'](_0x1d5a55['view'],'change:activeTab',(_0x58ef93,_0x129fd3,_0x378062)=>{'chat'!==_0x378062&&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',(_0x4e15ff,_0xaf0e81)=>{this['activeConversation']?.['addFilesToContext'](Array['from'](_0xaf0e81));}),this['listenTo'](this['_aiChatUi'],'addUrlToContext',(_0x1e25ea,_0x2ee844)=>{this['activeConversation']?.['addUrlToContext'](_0x2ee844);}),this['listenTo'](this['_aiChatUi'],'executeCustomItemCallback',(_0xc9a1a3,_0x299c51)=>{_0x299c51['callback'](this['context']);}),this['listenTo'](this['_aiChatUi'],'addResourceToContext',(_0x5e19ec,_0x3188ac)=>{this['activeConversation']?.['addResourceToContext'](_0x3188ac['source'],_0x3188ac['resource']);}),this['listenTo'](this['_aiChatUi'],'removeContextItem',(_0x42d2d5,_0x290b25)=>{this['_removeFromContext'](_0x290b25);}),this['listenTo'](this['_aiChatUi'],'loadSourceResources',(_0x52836e,_0x261652)=>{this['activeConversation']?.['loadSourceResources'](_0x261652['sourceId'],_0x261652['query'],_0x261652['uid']);}),this['listenTo'](this['_aiChatUi'],'toggleWebSearch',()=>{this['_toggleWebSearch']();}),this['listenTo'](this['_aiChatUi'],'toggleReasoning',()=>{this['_toggleReasoning']();}),this['listenTo'](this['_aiChatUi'],'selectModel',(_0x4ace0c,_0xbbd381)=>{this['activeConversation']?.['setModel'](_0xbbd381);}),this['listenTo'](this['_aiChatUi'],'like',(_0x3f007b,{replyId:_0x69e5a2})=>{console['log']('Liked\x20response',_0x69e5a2);}),this['listenTo'](this['_aiChatUi'],'dislike',(_0x3d4e29,{replyId:_0x188d08})=>{console['log']('Disliked\x20response',_0x188d08);}),this['listenTo'](this['_aiChatUi'],'insertSuggestion',(_0x7c2f82,_0x518e8e)=>{this['_insertSuggestion'](_0x518e8e);}),this['listenTo'](this['_aiChatUi'],'showChangeInText',(_0x1f5242,{replyId:_0x2e7d70,partIndex:_0x22bf08})=>{this['_aiChatBalloonShowDiff']=this['_aiChatUi']['showDiff'],this['_openBalloonFor'](_0x2e7d70,_0x22bf08);}),this['listenTo'](this['_aiChatUi'],'mouseOverSuggestion',(_0x27f34a,{replyId:_0x48f731,partIndex:_0x5b2b98})=>{const _0x67a7cf=this['_getDocumentRangeForReplyChanges'](_0x48f731,_0x5b2b98);_0x67a7cf&&'$graveyard'!=_0x67a7cf['range']['root']['rootName']&&this['_aiEditing']['showFakeVisualSelection']({'ranges':[_0x67a7cf['range']],'id':'change-area','priority':0xa});}),this['listenTo'](this['_aiChatUi'],'mouseLeaveSuggestion',()=>{this['_aiEditing']['hideFakeVisualSelection']('change-area');}),this['listenTo'](this['_aiChatUi'],'applySuggestion',(_0x51dcf1,_0x457f72)=>{this['_aiEditing']['hideFakeVisualSelection']('change-area'),this['_applySuggestion'](_0x457f72);}),this['listenTo'](this['_aiChatUi'],'toggleSuggestionDisplayMode',async(_0x5eb3f3,{replyId:_0x446a49,showDiff:_0x3ca59a})=>{const {reply:_0x37afea}=this['getInteractionAndReplyById'](_0x446a49),_0x33f2a2=_0x37afea['getContentParts']({'showDiff':_0x3ca59a});await this['_aiChatUi']['updateFeedItemAIReplySuggestionContent']({'id':_0x37afea['id'],'parts':_0x33f2a2,'renderingStrategy':'static'});}),this['listenTo'](this['_aiChatUi'],'rejectSuggestion',(_0x354bec,{replyId:_0x316baa,partIndex:_0x5f07ea})=>{this['_rejectSuggestion']({'replyId':_0x316baa,'partIndex':_0x5f07ea}),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:_0x5369cb,partIndex:_0x56cc97}=this['_currentPreviewedChangeGroup'];this['_aiChatBalloonShowDiff']=!this['_aiChatBalloonShowDiff'];const {reply:_0x3a2948}=this['getInteractionAndReplyById'](_0x5369cb),_0x13d68e=_0x3a2948['getContentParts']({'showDiff':this['_aiChatBalloonShowDiff'],'groupIndex':_0x56cc97});this['_aiChatBalloon']['updateContent']({'part':_0x13d68e[0x0],'renderingStrategy':'static','keepErrors':!0x0});}),this['listenTo'](this['_aiChatBalloon'],'applySuggestion',()=>{const {replyId:_0x51159a,partIndex:_0x536598}=this['_currentPreviewedChangeGroup'];this['_applySuggestion']({'replyId':_0x51159a,'partIndex':_0x536598}),this['_aiChatBalloon']['setState']('accepted');}),this['listenTo'](this['_aiChatBalloon'],'insertSuggestion',()=>{const {replyId:_0x24b526,partIndex:_0x1076ff}=this['_currentPreviewedChangeGroup'];this['_insertSuggestion']({'replyId':_0x24b526,'partIndex':_0x1076ff}),this['_aiChatBalloon']['setState']('accepted');}),this['listenTo'](this['_aiChatBalloon'],'rejectSuggestion',()=>{const {replyId:_0x2eb2c6,partIndex:_0x2a17e0}=this['_currentPreviewedChangeGroup'];this['_rejectSuggestion']({'replyId':_0x2eb2c6,'partIndex':_0x2a17e0}),this['_aiChatBalloon']['setState']('rejected');}),this['listenTo'](this['_aiChatBalloon'],'showNext',()=>{const {replyId:_0x4c737b,partIndex:_0x4de90c}=this['_currentPreviewedChangeGroup'],_0x45832e=this['_getPresentableSiblingContentPartIndex'](_0x4c737b,_0x4de90c,'next');null!==_0x45832e&&this['_openBalloonFor'](_0x4c737b,_0x45832e);}),this['listenTo'](this['_aiChatBalloon'],'showPrevious',()=>{const {replyId:_0x1fdd0b,partIndex:_0x4241ff}=this['_currentPreviewedChangeGroup'],_0xa94aa6=this['_getPresentableSiblingContentPartIndex'](_0x1fdd0b,_0x4241ff,'previous');null!==_0xa94aa6&&this['_openBalloonFor'](_0x1fdd0b,_0xa94aa6);}),this['listenTo'](this['_aiChatBalloon'],'dialogClosed',(_0x394f58,{id:_0x4fd7d7})=>{if('aiChatBalloon'!==_0x4fd7d7)return;const {replyId:_0x4f1019,partIndex:_0x347bb4}=this['_currentPreviewedChangeGroup'];this['_currentPreviewedChangeGroup']=null,this['_aiChatUi']['setFeedItemAIReplySuggestionPartActive']({'id':_0x4f1019,'index':_0x347bb4,'isActive':!0x1});})),this['on']('interactionCreated',(_0x15ce06,_0x43aa4f)=>{this['_aiChatUi']['addFeedItemUserMessage'](_0x43aa4f);}),this['on']('replyCreated',(_0x580581,_0x1a1b49)=>{this['_addFeedItemReply'](_0x1a1b49);});}async['afterInit'](){this['context']instanceof _0x867bd7?this['_integrateEditor'](this['context']):this['listenTo'](this['context']['editors'],'add',(_0x414c38,_0x2a4ae2)=>{_0x2a4ae2['on']('ready',()=>{this['_integrateEditor'](_0x2a4ae2);});});const _0x16ab84=this['context']['config']['get']('ai.chat.initialConversation');let _0x3c3382=_0x16ab84;if('lastCreated'!=_0x16ab84||(_0x3c3382=await this['_getLastCreatedConversationId'](),_0x3c3382))return'new'==_0x3c3382?this['_startConversationSafely']():this['loadConversation'](_0x3c3382);}async['destroy'](){return await this['_stopLastInteraction'](),this['_bodyCollection']['detachFromDom'](),super['destroy']();}async['loadConversation'](_0x1b487c){this['context']['plugins']['has']('AIChatBalloon')&&this['context']['plugins']['get']('AIChatBalloon')['close'](),(this['context']['plugins']['get'](os)['view']['activateTab']('chat'),this['_aiChatUi']['setFeedItemRenderingStrategy']('static'),this['_aiChatUi']['toggleLoadingSkeleton'](!0x0),await this['_stopLastInteraction']());try{await this['_aiConnector']['fetchConversation'](_0x1b487c)['getConversation'](),await this['_startConversationSafely'](_0x1b487c),this['_updateConversationTitle']('\x20'),await this['activeConversation']['load'](_0x1b487c,this['_aiEditing']['sessionId']),this['activeConversation']['isCurrentDocumentInConversation']()&&this['addCurrentDocumentToChatContext']();}catch(_0x3dc0d0){this['_aiChatUi']['addFeedItemError']({'errorMessage':cs(this['context']['locale'],'AI_CHAT_UNABLE_TO_LOAD_CONVERSATION'),'id':_0x1b487c}),this['_logError'](new ot('ai-chat-conversation-not-found',this,{'error':_0x3dc0d0}));}finally{this['_aiChatUi']['startAutoScroll'](),this['_aiChatUi']['setFeedItemRenderingStrategy']('streaming'),this['_aiChatUi']['toggleLoadingSkeleton'](!0x1);}}['registerToolDataCallback'](_0x1a55a6){let _0x394eaf=null,_0xceb023=null;this['on']('toolDataReceived',(_0x5d9d84,_0x19b7d0,_0x26f50e)=>{_0x26f50e['id']!==_0x394eaf&&(_0x394eaf=_0x26f50e['id'],_0xceb023=this['_getAIChatFeedAPI'](_0x26f50e)),_0x1a55a6(_0x19b7d0,_0xceb023);});}['addCurrentDocumentToChatContext'](){this['activeConversation']?.['addCurrentDocumentToContext'](cs(this['context']['locale'],'AI_CHAT_CONTEXT_CURRENT_DOCUMENT'));}async['addSelectionToChatContext'](){const _0x514c8e=this['_aiEditing']['getSelectionText']();this['activeConversation']?.['addSelectionToContext'](_0x514c8e),this['addCurrentDocumentToChatContext']();}['removeSelectionFromChatContext'](){this['activeConversation']?.['removeSelectionFromContext']();}['focusPromptInput'](){this['_aiChatUi']['focusPromptInput']();}async['startConversation'](){await this['_startConversationSafely']();}async['sendMessage'](_0x240ef9){await this['_handleUIUserMessage'](_0x240ef9);}['getGroupId'](){const _0x1424bd=this['context']['config']['get']('collaboration.channelId');if(!_0x1424bd)throw new ot('ai-chat-missing-channel-id',this);return _0x1424bd;}['_handleRemovedConversation'](_0xde4845){this['activeConversation']['id']===_0xde4845&&this['_startConversationSafely']();}['_insertSuggestion'](_0x46227c){const _0x1d66dc=Ys(this['context']);if(!_0x1d66dc['plugins']['has']('TrackChanges'))throw new ot('ai-no-track-changes',null);const _0x387e67=this['context']['plugins']['get']('DocumentCompare'),{reply:_0x5269a6,interaction:_0x2ef8eb}=this['getInteractionAndReplyById'](_0x46227c['replyId']),_0x5db9aa=this['_getDocumentRangeForReplyChanges'](_0x46227c['replyId'],_0x46227c['partIndex']),_0x5e13fb=void 0x0!==_0x46227c['partIndex']?[_0x5269a6['changeGroups'][_0x46227c['partIndex']]]:_0x5269a6['changeGroups']['filter'](_0x2c0582=>'pending'==_0x2c0582['state']),_0x33447d=_0x5e13fb['map'](_0x5d9171=>_0x5269a6['changeGroups']['indexOf'](_0x5d9171));if(!_0x5db9aa||'$graveyard'==_0x5db9aa['range']['root']['rootName'])return void _0x33447d['forEach'](_0xc10110=>_0x5269a6['setChangeGroupState'](_0xc10110,'outdated'));_0x33447d['forEach'](_0x1c9ce1=>_0x5269a6['setChangeGroupState'](_0x1c9ce1,'accepted'));const _0x1289b3=$s({'editor':_0x1d66dc,'reply':_0x5269a6,'interaction':_0x2ef8eb,'groups':_0x5e13fb,'transform':!0x0,'documentCompare':_0x387e67,'documentCompareOptions':{'anchor':'main','markDeletions':!0x0}});let _0x12f8cd;_0x5db9aa&&this['_scrollToSuggestionRange'](_0x5db9aa['range']),_0x1d66dc['model']['change'](_0xa1cd86=>{_0x12f8cd=_0xa1cd86['batch'],_0x1d66dc['plugins']['get']('TrackChangesEditing')['_applyOperationsAsSuggestions'](_0x1289b3),this['_aiEditing']['hideFakeVisualSelection']('change-area');}),this['_batchToChanges']['set'](_0x12f8cd,{'interactionId':_0x2ef8eb['id'],'replyId':_0x5269a6['id'],'indexes':_0x33447d['slice']()}),this['_updateRatings'](_0x5269a6);}['_applySuggestion'](_0x502f95){const _0x2d1581=Ys(this['context']),_0x381fe9=this['context']['plugins']['get'](_0x53366e),{reply:_0x1fedf4,interaction:_0x5af17c}=this['getInteractionAndReplyById'](_0x502f95['replyId']),_0x4d34ee=this['_getDocumentRangeForReplyChanges'](_0x502f95['replyId'],_0x502f95['partIndex']),_0x2ed83d=void 0x0!==_0x502f95['partIndex']?[_0x1fedf4['changeGroups'][_0x502f95['partIndex']]]:_0x1fedf4['changeGroups']['filter'](_0x1750eb=>'pending'==_0x1750eb['state']),_0xd55632=_0x2ed83d['map'](_0x350098=>_0x1fedf4['changeGroups']['indexOf'](_0x350098));if(!_0x4d34ee||'$graveyard'==_0x4d34ee['range']['root']['rootName'])return void _0xd55632['forEach'](_0x1db9c2=>_0x1fedf4['setChangeGroupState'](_0x1db9c2,'outdated'));_0xd55632['forEach'](_0x51aa75=>_0x1fedf4['setChangeGroupState'](_0x51aa75,'accepted'));const _0x41772b=$s({'editor':_0x2d1581,'reply':_0x1fedf4,'interaction':_0x5af17c,'groups':_0x2ed83d,'transform':!0x0,'documentCompare':_0x381fe9,'documentCompareOptions':{'anchor':'main','markDeletions':!0x1}});let _0x98b87d;_0x4d34ee&&this['_scrollToSuggestionRange'](_0x4d34ee['range']),_0x2d1581['model']['change'](_0x28ee5e=>{_0x98b87d=_0x28ee5e['batch'];for(const _0x431c05 of _0x41772b)_0x431c05['baseVersion']=_0x2d1581['model']['document']['version'],qs(_0x2d1581,_0x431c05),_0x28ee5e['batch']['addOperation'](_0x431c05),_0x2d1581['model']['applyOperation'](_0x431c05);}),this['_batchToChanges']['set'](_0x98b87d,{'interactionId':_0x5af17c['id'],'replyId':_0x1fedf4['id'],'indexes':_0xd55632['slice']()}),this['_updateRatings'](_0x1fedf4);}['_rejectSuggestion'](_0x2f3917){const {reply:_0x416d0c}=this['getInteractionAndReplyById'](_0x2f3917['replyId']);_0x416d0c['setChangeGroupState'](_0x2f3917['partIndex'],'rejected');}['_openBalloonFor'](_0x280247,_0x3be2dc){if(!this['_aiChatBalloon'])return;const {reply:_0x22066c}=this['getInteractionAndReplyById'](_0x280247),_0x5c9e84=_0x22066c['getContentParts']({'showDiff':this['_aiChatBalloonShowDiff']});let _0x154db6,_0x1197ba;if(void 0x0!==_0x3be2dc?(_0x1197ba=_0x5c9e84['find'](_0x496ef4=>_0x496ef4['index']==_0x3be2dc),_0x154db6=_0x1197ba?.['index']):(_0x1197ba=_0x5c9e84[0x0],_0x154db6=_0x1197ba['index']),this['_currentPreviewedChangeGroup']?.['replyId']==_0x280247&&this['_currentPreviewedChangeGroup']?.['partIndex']==_0x154db6)return;const _0x258a9e=this['_getUserPresentableContentPartDocumentRange'](_0x280247,_0x22066c,_0x1197ba);if(!_0x258a9e)return void this['_aiChatBalloon']['close']();this['_currentPreviewedChangeGroup']={'replyId':_0x280247,'partIndex':_0x154db6},this['_scrollToSuggestionRange'](_0x258a9e,!0x0);const _0x27783e=this['_getPresentableSiblingContentPartIndex'](_0x280247,_0x154db6,'next');this['_aiChatBalloon']['updateContent']({'part':_0x1197ba,'renderingStrategy':'static'}),this['_aiChatBalloon']['open']({'index':_0x154db6,'title':cs(this['context']['locale'],'AI_BALLOON_HEADER_TITLE',(_0x154db6+0x1)['toString']()),'showRotator':null!==_0x27783e,'ranges':[_0x258a9e],'areActionsDisabled':_0x22066c['areActionsDisabled']}),this['_aiChatBalloon']['setState']('pending'),this['_aiChatUi']['scrollFeedToSuggestion'](_0x280247,_0x154db6),this['_aiChatUi']['setFeedItemAIReplySuggestionPartActive']({'id':_0x280247,'index':_0x154db6,'isActive':!0x0});}['_getPresentableSiblingContentPartIndex'](_0x43c07a,_0x251670,_0x2f4cb1){const {reply:_0x22957d}=this['getInteractionAndReplyById'](_0x43c07a),_0x21adb0=_0x22957d['getContentParts']({'showDiff':this['_aiChatBalloonShowDiff']});if(0x1==_0x21adb0['length'])return null;const _0x55ca17=_0x21adb0['findIndex'](_0x3572ea=>_0x3572ea['index']==_0x251670),_0x2e856f='next'==_0x2f4cb1?0x1:-0x1;let _0x367463=_0x21adb0['at']((_0x55ca17+_0x2e856f)%_0x21adb0['length'])['index'],_0x5a7666=_0x21adb0[_0x367463];for(;!this['_getUserPresentableContentPartDocumentRange'](_0x43c07a,_0x22957d,_0x5a7666);){if(_0x367463=_0x21adb0['at']((_0x367463+_0x2e856f)%_0x21adb0['length'])['index'],_0x367463===_0x55ca17)return null;_0x5a7666=_0x21adb0[_0x367463];}return _0x367463;}['_getUserPresentableContentPartDocumentRange'](_0x40fcfb,_0x4d1a56,_0xd4004d){const _0x3fd710=_0x4d1a56['changeGroups'];if(!_0xd4004d['hasChanges'])return null;const _0x4afc1c=_0x3fd710['find'](_0x6d34c3=>_0x6d34c3['index']==_0xd4004d['index']);if('pending'!==_0x4afc1c?.['state'])return null;const _0x3a81b1=this['_getDocumentRangeForReplyChanges'](_0x40fcfb,_0xd4004d['index']);if(!_0x3a81b1)return null;const {range:_0x47276f,currentIndex:_0x44aa81}=_0x3a81b1;return'$graveyard'==_0x47276f['root']['rootName']?(_0x4d1a56['setChangeGroupState'](_0x44aa81,'outdated'),null):_0x3a81b1['range'];}['_getDocumentRangeForReplyChanges'](_0x5d29c1,_0x54b39e){const _0x47ca61=Ys(this['context']),{reply:_0x595f7a,interaction:_0x2b225f}=this['getInteractionAndReplyById'](_0x5d29c1),_0x42da98=_0x595f7a['changeGroups']['filter'](_0x1af84e=>'pending'==_0x1af84e['state']),_0x335f2e=_0x42da98['map'](_0x4a7a58=>_0x595f7a['changeGroups']['indexOf'](_0x4a7a58));void 0x0===_0x54b39e&&(_0x54b39e=_0x335f2e[0x0]);const _0x184225=_0x335f2e['indexOf'](_0x54b39e);if(-0x1==_0x184225)return null;const _0x5aba6a=_0x42da98[_0x184225],_0x5b0907=new _0x39de98([]),_0x32675a=new _0x39de98([]);for(const _0x41544d of _0x5aba6a['changes'])if('removed'!=_0x41544d['type']&&_0x32675a['children']['push'](_0x41544d['node']['cloneNode'](!0x0)),'new'!=_0x41544d['type']){const _0x7c101c=_0x57d34f(_0x5e7a5c=>ps(_0x5e7a5c,'data-id')==_0x41544d['id'],_0x595f7a['documentContextContent'],!0x0);_0x5b0907['children']['push'](_0x7c101c['cloneNode'](!0x0));}if(0x0==_0x5b0907['children']['length']){if(_0x5aba6a['changes'][0x0]['anchorId']){const _0x1038bf=Is('data-id',_0x5aba6a['changes'][0x0]['anchorId'],_0x595f7a['documentContextContent']);_0x5b0907['children']['unshift'](_0x1038bf['cloneNode'](!0x0)),_0x32675a['children']['unshift'](_0x1038bf['cloneNode'](!0x0)),_0x1038bf['nextSibling']&&(_0x5b0907['children']['push'](_0x1038bf['nextSibling']['cloneNode'](!0x0)),_0x32675a['children']['push'](_0x1038bf['nextSibling']['cloneNode'](!0x0)));}else{const _0x262c29=_0x595f7a['documentContextContent']['children'][0x0];if(!_0x262c29)return null;_0x5b0907['children']['push'](_0x262c29['cloneNode'](!0x0)),_0x32675a['children']['push'](_0x262c29['cloneNode'](!0x0));}}const _0x38f0fb=_0x2b225f['getDocumentContext'](),_0x4b42f0=_0x47ca61['data']['parse'](_0x38f0fb['content']),_0x59cf33=gs(_0x5b0907),_0x4b760f=_0x47ca61['data']['parse'](_0x59cf33),_0x57fe4a=_0x47ca61['data']['parse'](_0x59cf33),_0x47ab5e=_0x47ca61['model']['createPositionAt'](_0x4b760f,0x0),_0x189309=gs(_0x32675a),_0x2bdc2f={'anchor':_0x47ab5e,'markDeletions':!0x1},_0x2f22ae=_0x47ca61['plugins']['get'](_0x53366e)['getDiff'](_0x59cf33,_0x189309,_0x2bdc2f)['getOperations']();if(!_0x2f22ae['length'])return null;_0x47ca61['model']['change'](_0x1bcba0=>{for(const _0x1bc7c6 of _0x2f22ae)if('remove'==_0x1bc7c6['type']){const _0x455fdf=_0x1bc7c6['sourcePosition'],_0x3f8f03=_0x1bc7c6['howMany'],_0x2f02b5=new _0x423138(_0x455fdf,_0x3f8f03);_0x1bcba0['batch']['addOperation'](_0x2f02b5),_0x47ca61['model']['applyOperation'](_0x2f02b5);}else'marker'!==_0x1bc7c6['type']&&(_0x1bc7c6['baseVersion']=null,_0x1bc7c6['isDocumentOperation']=!0x1,_0x1bcba0['batch']['addOperation'](_0x1bc7c6),_0x47ca61['model']['applyOperation'](_0x1bc7c6));});const _0x3a8099=Ns(_0x47ca61,_0x2f22ae,_0x4b760f);vs(_0x47ca61['model'],_0x3a8099);const _0x517ee0=_0x3a8099['getFirstRange']()['start']['path']['slice'](),_0x3dbc4e=_0x3a8099['getFirstRange']()['end']['path']['slice'](),_0x3d664d=[];let _0x45d812=_0x4b760f,_0xf13f89=_0x57fe4a;for(let _0x4a345e=0x0;_0x4a345e<_0x3dbc4e['length'];_0x4a345e++){const _0x1762f8=_0x45d812['maxOffset']-_0x3dbc4e[_0x4a345e];_0x3d664d[_0x4a345e]=_0xf13f89['maxOffset']-_0x1762f8,_0x45d812=_0x45d812['getChildAtOffset'](_0x3dbc4e[_0x4a345e]),_0xf13f89=_0xf13f89['getChildAtOffset'](_0x3d664d[_0x4a345e]);}const _0x3059b8=_0x47ca61['model']['createRange'](_0x47ca61['model']['createPositionFromPath'](_0x57fe4a,_0x517ee0),_0x47ca61['model']['createPositionFromPath'](_0x57fe4a,_0x3d664d)),_0x5c3982=_0x57fe4a['getChild'](0x0)['getAttribute'](_0x33b43a),_0x3e2dfe=Array['from'](_0x4b42f0['getChildren']())['find'](_0x508b03=>_0x508b03['getAttribute'](_0x33b43a)==_0x5c3982)['getPath'](),_0x39ab50=_0x3059b8['start']['path']['slice'](),_0x59a26a=_0x3059b8['end']['path']['slice']();_0x39ab50[0x0]=_0x3e2dfe[0x0]+_0x39ab50[0x0],_0x59a26a[0x0]=_0x3e2dfe[0x0]+_0x59a26a[0x0];let _0x2436f6=_0x47ca61['model']['createRange'](_0x47ca61['model']['createPositionFromPath'](_0x47ca61['model']['document']['getRoot'](),_0x39ab50),_0x47ca61['model']['createPositionFromPath'](_0x47ca61['model']['document']['getRoot'](),_0x59a26a));const _0x42fb57=_0x47ca61['model']['document']['history']['getOperations'](_0x38f0fb['version']);for(const _0x526df8 of _0x42fb57)_0x2436f6=_0x40a8b3['_createFromRanges'](_0x2436f6['getTransformedByOperation'](_0x526df8));return{'range':_0x2436f6,'currentIndex':_0x54b39e};}['_integrateEditor'](_0x3f4745){if(_0x3f4745['plugins']['has']('Undo')){const _0x50c85e=_0x3f4745['commands']['get']('undo'),_0xf10a48=_0x3f4745['commands']['get']('redo');this['listenTo'](_0x50c85e,'revert',(_0x1602a2,_0x274dd2,_0x340e23)=>{const _0x15d575=this['_batchToChanges']['get'](_0x274dd2);if(!_0x15d575)return;const _0x2a7679=this['activeConversation']['getInteraction'](_0x15d575['interactionId'])['getReply'](_0x15d575['replyId']);_0x15d575['indexes']['forEach'](_0x34c457=>_0x2a7679['setChangeGroupState'](_0x34c457,'pending')),this['_batchToChanges']['delete'](_0x274dd2),this['_batchToChanges']['set'](_0x340e23,_0x15d575);}),this['listenTo'](_0xf10a48,'revert',(_0x52ceb1,_0x1a3156,_0x40d3e0)=>{const _0x3fed5f=this['_batchToChanges']['get'](_0x1a3156);if(!_0x3fed5f)return;const _0x18cff0=this['activeConversation']['getInteraction'](_0x3fed5f['interactionId'])['getReply'](_0x3fed5f['replyId']);_0x3fed5f['indexes']['forEach'](_0x3b1096=>_0x18cff0['setChangeGroupState'](_0x3b1096,'accepted')),this['_batchToChanges']['delete'](_0x1a3156),this['_batchToChanges']['set'](_0x40d3e0,_0x3fed5f);});}const _0x25f216=_0x3f4745['config']['get']('ai.chat.context');_0x25f216['alwaysAddSelection']&&_0x25f216['document']['enabled']&&this['listenTo'](_0x3f4745['model']['document']['selection'],'change:range',(_0x950c36,_0x62dc70)=>{if(!_0x62dc70['directChange'])return;'chat'===_0x3f4745['plugins']['get']('AITabs')['view']['activeTab']&&(_0x3f4745['model']['hasContent'](_0x3f4745['model']['document']['selection'])?this['addSelectionToChatContext']():this['removeSelectionFromChatContext']());});}async['_getLastCreatedConversationId'](){const _0x34a84d=this['_aiConnector']['fetchConversations'](this['getGroupId'](),{'limit':0x1,'sortBy':'createdAt'});try{const _0x41dbb4=await _0x34a84d['getConversations']();return _0x41dbb4['length']?_0x41dbb4[0x0]['id']:'new';}catch(_0x279657){return this['_aiChatUi']['addFeedItemError']({'errorMessage':cs(this['context']['locale'],'AI_CHAT_UNABLE_TO_LOAD_CONVERSATION'),'id':at()}),this['_logError'](new ot('ai-chat-conversation-init-failed',this,{'error':_0x279657})),this['_aiChatUi']['toggleLoadingSkeleton'](!0x1),this['_aiChatUi']['disableControls'](),null;}}async['_startConversationSafely'](_0x33006e){try{this['_aiChatUi']['enableControls'](),await this['_handleStartConversation'](_0x33006e);}catch(_0x3d13c3){this['_aiChatUi']['addFeedItemError']({'errorMessage':cs(this['context']['locale'],'AI_CHAT_UNABLE_TO_START_CONVERSATION'),'id':_0x33006e||at()}),console['error'](_0x3d13c3),this['activeConversation']=void 0x0,this['_aiChatUi']['disableControls']();}}async['_handleStartConversation'](_0xf1444a){let _0x21ac52;this['context']['plugins']['has']('AIChatBalloon')&&this['context']['plugins']['get']('AIChatBalloon')['close'](),_0xf1444a||!this['activeConversation']?_0x21ac52=this['context']['config']['get']('ai.models.defaultModelId'):this['_aiChatUi']['isModelAvailable']&&(_0x21ac52=this['activeConversation']['selectedModel']['id']),await this['_stopLastInteraction']();const _0x3135e1=this['getGroupId'](),_0x49b6ab=_0xf1444a||at();this['activeConversation']=new Fs({'connector':this['_aiConnector'],'chatModels':this['_aiChatModels'],'selectedModelId':_0x21ac52,'conversationId':_0x49b6ab,'group':_0x3135e1,'getEditor':()=>Ys(this['context']),'isFromHistory':!!_0xf1444a}),this['activeConversation']['delegate']('toolDataReceived','interactionCreated','interactionStarted','replyCreated')['to'](this),this['activeConversation']['on']('conversationInitialized',(_0x1360e1,_0x630eff)=>{this['_aiChatUi']['createConversation'](_0x630eff),this['_aiChatUi']['resetMessageInput'](),this['_aiChatUi']['clearPendingContextUI'](),this['_aiChatUi']['clearConversationContextUI'](),_0xf1444a||(this['_aiChatUi']['resetConversationTitle'](),this['addCurrentDocumentToChatContext']());}),this['activeConversation']['on']('uploadProgressChanged',(_0x302551,_0xe5bab)=>{this['_aiChatUi']['setIsUploadInProgress'](_0xe5bab['isUploadInProgress']);}),this['activeConversation']['on']('webSearchStarted',()=>{const _0xd10ab8=this['_aiChatUi']['prepareLoadingMessage']({'isWebSearchEnabled':!0x0,'isReasoningEnabled':!0x1});this['_aiChatUi']['setLoadingMessage'](_0xd10ab8);}),this['activeConversation']['on']('reasoningStarted',()=>{const _0x444eea=this['_aiChatUi']['prepareLoadingMessage']({'isWebSearchEnabled':!0x1,'isReasoningEnabled':!0x0});this['_aiChatUi']['setLoadingMessage'](_0x444eea);}),this['activeConversation']['on']('webSearchFinished',(_0x8f1311,_0x59b9e6)=>{this['_aiChatUi']['addFeedInteractionHeader'](_0x59b9e6,{'isWebSearchEnabled':!0x0,'isReasoningEnabled':!0x1});}),this['activeConversation']['on']('reasoningFinished',(_0x281589,_0x1d822b)=>{this['_aiChatUi']['addFeedInteractionHeader'](_0x1d822b,{'isWebSearchEnabled':!0x1,'isReasoningEnabled':!0x0});}),this['activeConversation']['on']('interactionStarted',()=>{this['_aiChatUi']['startInteraction']();}),this['activeConversation']['on']('interactionFinished',async()=>{await this['_aiChatUi']['finishInteraction']();}),this['activeConversation']['on']('interactionDestroyed',(_0x53fc28,_0x5b3b85)=>{this['_aiChatUi']['removeFeedInteraction'](_0x5b3b85['id']);}),this['activeConversation']['on']('setConversationTitle',(_0x3e7cc9,_0x5ef8cf,_0x1a2f44)=>{this['_updateConversationTitle'](_0x5ef8cf,_0x1a2f44);}),this['activeConversation']['on']('replyContentUpdated',async(_0x1c10fe,_0x358b36)=>{await this['_updateReplyContent']({'reply':_0x358b36});}),this['activeConversation']['on']('replyChangeGroupStateUpdated',(_0x242455,{reply:_0xa0cb6f,index:_0x283a73,state:_0x4b8750})=>{this['_aiChatUi']['updateFeedItemAIReplySuggestionPartState']({'id':_0xa0cb6f['id'],'index':_0x283a73,'state':_0x4b8750}),this['_currentPreviewedChangeGroup']?.['replyId']['includes'](_0xa0cb6f['id'])&&this['_currentPreviewedChangeGroup']?.['partIndex']==_0x283a73&&this['_aiChatBalloon']?.['setState'](_0x4b8750);}),this['activeConversation']['on']('contextItemAdded',(_0xdeeb8e,_0x40388f)=>{if(this['_aiChatUi']['addContextItem'](_0x40388f['contextItem'],_0x40388f['isLoading']),'selection'===_0x40388f['contextItem']['type']){const _0x288487=[...Ys(this['context'])['model']['document']['selection']['getRanges']()];this['_aiEditing']['showFakeVisualSelection']({'ranges':_0x288487,'id':'context','priority':0x1});}}),this['activeConversation']['on']('contextItemRemoved',(_0x130e0b,_0x2b867a)=>{this['_aiChatUi']['removeContextItem'](_0x2b867a['uiId']),'current-document'==_0x2b867a['uiId']&&this['removeSelectionFromChatContext'](),'selection'===_0x2b867a['type']&&this['_aiEditing']['hideFakeVisualSelection']('context');}),this['activeConversation']['on']('contextItemLoadingEnded',(_0x30b6d3,_0x5ac3c5)=>{this['_aiChatUi']['setContextItemLoading'](_0x5ac3c5['contextItem']['uiId'],_0x5ac3c5['isLoading']);}),this['activeConversation']['on']('contextSent',(_0x5c8837,_0x48ebaa)=>{this['_aiChatUi']['setConversationContext'](_0x48ebaa['contextItems']);}),this['activeConversation']['on']('addContextOptionsChanged',(_0x5a4ff5,_0x30f900)=>{this['_aiChatUi']['setAddContextOptions'](_0x30f900['options']);}),this['activeConversation']['on']('sourceResourcesLoaded',(_0x440cb3,_0x18c449)=>{this['_aiChatUi']['populateSourceResourceBalloon'](_0x18c449['sourceId'],_0x18c449['source'],_0x18c449['resources'],_0x18c449['uid']);}),this['activeConversation']['on']('resourceStateChanged',(_0x17eb4e,_0x3fc935)=>{this['_aiChatUi']['updateResourceState'](_0x3fc935['sourceId'],_0x3fc935['resourceId'],_0x3fc935['isInContext']);}),this['activeConversation']['on']('capabilitiesUpdated',(_0x2cf36d,_0x4ea644)=>{this['_aiChatUi']['updateCapabilities'](_0x4ea644);}),this['activeConversation']['on']('modelSelected',async(_0x24723c,_0x5691bc)=>{const _0x23d52b=(await this['_aiChatModels']['getAll']())['find'](_0x211fe3=>_0x211fe3['id']===_0x5691bc['selectedModel']?.['id'])||null;this['_aiChatUi']['setSelectedModel'](_0x23d52b,_0x5691bc['isDisabled']);}),this['activeConversation']['on']('error',(_0x359365,{error:_0x3ec6e8,interactionId:_0x1c8d46,fileName:_0x45ccad,url:_0x28a0e1,sourceId:_0x24d257,sourceLabel:_0x512be0})=>{const _0x336d54=_0x1c8d46?_0x1c8d46+':'+at():at();_0x3ec6e8['message']['startsWith']('ai-request-aborted')?this['_aiChatUi']['addFeedItemStaticMessage']({'staticMessage':cs(this['context']['locale'],'AI_CHAT_ABORTED_MESSAGE'),'id':_0x336d54}):_0x3ec6e8['message']['startsWith']('ai-chat-conversation-init-failed')||_0x3ec6e8['message']['startsWith']('ai-chat-conversation-start-failed')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':cs(this['context']['locale'],'AI_CHAT_UNABLE_TO_START_CONVERSATION'),'id':_0x336d54}),this['_logError'](_0x3ec6e8)):_0x3ec6e8['message']['startsWith']('ai-chat-file-upload-failed')?this['_aiChatUi']['addFeedItemError']({'errorMessage':cs(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_FILE',_0x45ccad),'id':_0x336d54}):_0x3ec6e8['message']['startsWith']('ai-chat-url-upload-failed')?this['_aiChatUi']['addFeedItemError']({'errorMessage':cs(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_URL',_0x28a0e1),'id':_0x336d54}):_0x3ec6e8['message']['startsWith']('ai-chat-context-invalid-data')?this['_aiChatUi']['addFeedItemError']({'errorMessage':cs(this['context']['locale'],'AI_CHAT_CONTEXT_INVALID_DATA'),'id':_0x336d54}):_0x3ec6e8['message']['startsWith']('ai-chat-context-unsupported-type')?this['_aiChatUi']['addFeedItemError']({'errorMessage':cs(this['context']['locale'],'AI_CHAT_CONTEXT_UNSUPPORTED_TYPE'),'id':_0x336d54}):_0x3ec6e8['message']['startsWith']('ai-chat-source-resources-load-failed')?(_0x24d257&&this['_aiChatUi']['closeSourceResourceBalloon'](_0x24d257),this['_aiChatUi']['addFeedItemError']({'errorMessage':cs(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_LOAD_RESOURCES',_0x512be0||'source'),'id':_0x336d54}),this['_logError'](_0x3ec6e8)):_0x3ec6e8['message']['startsWith']('ai-chat-resource-load-failed')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':cs(this['context']['locale'],'AI_CHAT_RESOURCE_LOAD_FAILED'),'id':_0x336d54}),this['_logError'](_0x3ec6e8)):_0x3ec6e8['message']['startsWith']('ai-chat-invalid-request')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':cs(this['context']['locale'],'AI_CHAT_INVALID_REQUEST'),'id':_0x336d54}),this['_logError'](_0x3ec6e8)):_0x3ec6e8['message']['startsWith']('ai-chat-context-unsupported-file-type')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':cs(this['context']['locale'],'AI_CHAT_CONTEXT_UNSUPPORTED_FILE_TYPE'),'id':_0x336d54}),this['_logError'](_0x3ec6e8)):_0x3ec6e8['message']['startsWith']('ai-chat-context-file-too-large')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':cs(this['context']['locale'],'AI_CHAT_CONTEXT_FILE_TOO_LARGE'),'id':_0x336d54}),this['_logError'](_0x3ec6e8)):_0x3ec6e8['message']['startsWith']('ai-chat-context-file-too-many-pages')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':cs(this['context']['locale'],'AI_CHAT_CONTEXT_FILE_TOO_MANY_PAGES'),'id':_0x336d54}),this['_logError'](_0x3ec6e8)):_0x3ec6e8['message']['startsWith']('ai-chat-context-form-data-size-limits-exceeded')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':cs(this['context']['locale'],'AI_CHAT_CONTEXT_FORM_DATA_SIZE_LIMITS_EXCEEDED'),'id':_0x336d54}),this['_logError'](_0x3ec6e8)):(this['_aiChatUi']['addFeedItemError']({'errorMessage':cs(this['context']['locale'],'AI_CHAT_GENERIC_ERROR'),'id':_0x336d54}),this['_logError'](_0x3ec6e8));}),await this['activeConversation']['init'](this['context']['config']['get']('ai.chat.context')),_0xf1444a||await this['activeConversation']['start']();}async['_handleUIUserMessage']({message:_0x1c61f8,attributes:_0x562392}){if(!this['activeConversation'])throw new ot('ai-chat-controller-no-active-conversation');if(this['activeConversation']['isCurrentDocumentInContext']()){const _0x18fdf5=await this['_aiEditing']['getDocumentData']();await this['activeConversation']['updateCurrentDocumentInContext'](_0x18fdf5);}this['activeConversation']['id']&&this['activeConversation']['isStarted']&&await this['activeConversation']['handleUserInteraction']({'userMessage':_0x1c61f8,'attributes':_0x562392});}['_setIsMaximized'](_0x32d5c4){this['_aiChatUi']['setIsMaximized'](_0x32d5c4);}['_logError'](_0x51d54a){Tt(_0x51d54a['message']);}['_removeFromContext'](_0x2d8310){this['activeConversation']?.['removeFromContext'](_0x2d8310);}['_toggleWebSearch'](){this['activeConversation']?.['toggleWebSearch']();}['_toggleReasoning'](){this['activeConversation']?.['toggleReasoning']();}['getInteractionAndReplyById'](_0x4be96b){const [_0x2e7450,_0x22f28a]=_0x4be96b['split'](':'),_0x39a2cd=this['activeConversation']['getInteraction'](_0x2e7450),_0x290e9a=_0x39a2cd['getReply'](_0x22f28a);return{'interaction':_0x39a2cd,'reply':_0x290e9a};}['_scrollToSuggestionRange'](_0x3d1515,_0x4bcc4b=!0x1){const _0x5a4306=Ys(this['context']),_0x542399={'target':_0x5a4306['editing']['view']['domConverter']['viewRangeToDom'](_0x5a4306['editing']['mapper']['toViewRange'](_0x3d1515)),'viewportOffset':{'top':0x96,'left':0x0,'bottom':0x32,'right':0x0},'ancestorOffset':0x14,'alignToTop':_0x4bcc4b};_0x4bcc4b&&(_0x542399['alignToTop']=!0x0),mt(_0x542399);}['_updateConversationTitle'](_0x227c1b,_0x2f583a=!0x1){this['_aiChatUi']['setConversationTitle'](_0x227c1b||cs(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION'),_0x2f583a);}['_addFeedItemReply'](_0xa301bd){'text'===_0xa301bd['type']?this['_aiChatUi']['addFeedItemAIReply'](_0xa301bd):this['_aiChatUi']['addFeedItemAISuggestion'](_0xa301bd);}async['_updateReplyContent']({reply:_0x13de58,renderingStrategy:_0x5dcec4}){const {id:_0xc6a8a6,interactionId:_0x4af405,isDone:_0x4a710b,type:_0x16bed9,parsedContent:_0x5d1c2d}=_0x13de58,_0x34c214=_0x4af405+':'+_0xc6a8a6;if('modification'===_0x16bed9){const _0x2fc77e=_0x13de58['getContentParts']({'showDiff':this['_aiChatUi']['showDiff']});await this['_aiChatUi']['updateFeedItemAIReplySuggestionContent']({'id':_0x34c214,'parts':_0x2fc77e,'renderingStrategy':_0x5dcec4,'isDone':_0x4a710b});}else'text'===_0x16bed9&&await this['_aiChatUi']['updateFeedItemAIReplyContent']({'id':_0x34c214,'parsedContent':_0x5d1c2d,'renderingStrategy':_0x5dcec4,'isDone':_0x4a710b});_0x4a710b&&_0x13de58['sources']['length']>0x0&&this['_aiChatUi']['updateFeedItemAIReplySources'](_0x34c214,_0x13de58['sources']);}async['_stopLastInteraction'](){const _0x53f413=this['activeConversation']?.['lastInteraction'];_0x53f413&&(_0x53f413['stop'](),this['_aiChatUi']['stopInteraction'](_0x53f413));}async['_flushLastInteractionUI'](){const _0x6fe1c9=this['activeConversation']?.['lastInteraction'];if(_0x6fe1c9){for await(const _0x4baae2 of _0x6fe1c9['replies'])this['_aiChatUi']['hasFeedItem'](_0x4baae2['id'])||this['_addFeedItemReply'](_0x4baae2),await this['_updateReplyContent']({'reply':_0x4baae2,'renderingStrategy':'static'});}}['_updateRatings'](_0x169328){const _0x51d6c6={'positiveCount':_0x169328['changeGroups']['filter'](_0x2cbaad=>'accepted'===_0x2cbaad['state'])['length'],'totalCount':_0x169328['changeGroups']['length'],'modificationId':_0x169328['id']},_0x1fc6a1=this['activeConversation']['getInteraction'](_0x169328['interactionId'])['messageId'];_0x1fc6a1&&this['_aiConnector']['upsertAIChatRating'](this['activeConversation']['id'],_0x1fc6a1,_0x51d6c6);}['_getAIChatFeedAPI'](_0xd1379){const _0x150ec7=this['_aiChatUi'],_0x45106c=()=>{_0xd1379['resetWebSearchState'](),_0xd1379['resetReasoningState'](),_0x150ec7['clearLoadingMessage']();},_0x5a5982=()=>{_0xd1379['currentReply']&&(_0xd1379['currentReply']['done'](),_0xd1379['currentReply']=void 0x0);};return{'insertTextReply':(_0x25a721,_0x4edfe3)=>{_0x5a5982(),_0x45106c();const _0x7a387b=_0xd1379['currentReply']=_0xd1379['createReply']({'type':'text','interactionId':_0xd1379['id'],'content':_0x25a721,'id':_0x4edfe3||at()});return _0x5a5982(),_0x7a387b;},'insertCustomElement':async(_0xe35ffa,_0xc68c61)=>(_0x5a5982(),_0x45106c(),_0x150ec7['addFeedItemCustomElement'](_0xe35ffa,_0xc68c61||at())),'setLoadingMessage':_0xe3786d=>{_0x150ec7['setLoadingMessage'](_0xe3786d);},'clearLoadingMessage':()=>{_0x150ec7['clearLoadingMessage']();}};}}const Xs='ai-selection';class zs extends _0x474324{constructor(_0x3c39e1){super(_0x3c39e1),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 _0x567f71=Ys(this['context']),_0x2dd61d=_0x567f71['plugins']['has']('RealTimeCollaborationClient')&&_0x567f71['plugins']['get']('RealTimeCollaborationClient')['sessionId'];this['_sessionId']=_0x2dd61d||at();}return this['_sessionId'];}async['getDocumentData'](){const _0x51e4c5=Ys(this['context']),_0x55579b=_0x51e4c5['model'],_0x4faa33=_0x51e4c5['data']['toView'](_0x55579b['document']['getRoot'](),{'convertAiChatSelectionMarker':!0x0}),_0x45bc09=new _0x49c9be(_0x51e4c5['editing']['view']['document']);this['_setDataIdsOnChildren'](_0x4faa33,_0x45bc09);let _0x5db744=await this['_getDocumentDataStringFromView'](_0x4faa33);const _0x550e2b=this['_getMarkersInDocumentOrder'](),_0x5b574c=[];for(const _0x53a47c of _0x550e2b){const _0x16b7b6='<'+_0x53a47c['name']+':start></'+_0x53a47c['name']+':start>',_0x3c254d=_0x5db744['indexOf'](_0x16b7b6);_0x5db744=_0x5db744['substring'](0x0,_0x3c254d)+_0x5db744['substring'](_0x3c254d+_0x16b7b6['length']);const _0x1be60c='<'+_0x53a47c['name']+':end></'+_0x53a47c['name']+':end>',_0x14765c=_0x5db744['indexOf'](_0x1be60c);_0x5db744=_0x5db744['substring'](0x0,_0x14765c)+_0x5db744['substring'](_0x14765c+_0x1be60c['length']),_0x5b574c['push']({'markerName':_0x53a47c['name'],'start':_0x3c254d,'end':_0x14765c,'htmlFragment':_0x5db744['substring'](_0x3c254d,_0x14765c)});}return{'content':_0x5db744,'version':_0x51e4c5['model']['document']['version'],'sessionId':this['sessionId'],'selections':_0x5b574c};}async['afterInit'](){this['context']instanceof _0x867bd7?this['_integrateEditor'](this['context']):this['listenTo'](this['context']['editors'],'add',(_0x3eede8,_0x17ddcf)=>{_0x17ddcf['on']('ready',()=>{this['_integrateEditor'](_0x17ddcf);});});}['_setOutputDataProcessor'](_0x1c80c0){this['_outputDataProcessor']=_0x1c80c0;}async['_getDocumentDataStringFromView'](_0xa1d38f){let _0x5f529f;const _0x1cb924=Ys(this['context']);if(this['_outputDataProcessor']){const _0x533c68=_0x1cb924['data']['processor']['domConverter']['viewToDom'](_0xa1d38f),_0x4f01c6=await this['_outputDataProcessor'](_0x533c68);_0x5f529f=_0x1cb924['data']['processor']['htmlWriter']['getHtml'](_0x4f01c6);}else _0x5f529f=_0x1cb924['data']['processor']['toData'](_0xa1d38f);return _0x5f529f;}['_integrateEditor'](_0x53befc){_0x53befc['conversion']['for']('editingDowncast')['markerToHighlight']({'model':Xs,'view':({markerName:_0x3ff40b})=>({'classes':['ck-ai-assistant-ui_theme','ck-fake-ai-selection','ck-fake-ai-selection-'+_0x3ff40b['split'](':')[0x1]],'priority':0xc})}),_0x53befc['conversion']['for']('dataDowncast')['markerToElement']({'model':Xs,'view':(_0x1b6aac,{writer:_0x482c0c,options:_0x14fee1})=>_0x14fee1['convertAiChatSelectionMarker']?_0x482c0c['createUIElement'](_0x1b6aac['markerName']+':'+(_0x1b6aac['isOpening']?'start':'end')):null});}['showFakeVisualSelection'](_0x1ec957){const _0x348335=this['_fakeSelections'][0x0]||null;this['_addFakeSelection'](_0x1ec957);const _0x14b5d8=this['_fakeSelections'][0x0]||null;this['_refreshFakeSelection'](_0x348335,_0x14b5d8);}['hideFakeVisualSelection'](_0x3af860){const _0x307356=this['_fakeSelections'][0x0]||null;this['_removeFakeSelectionById'](_0x3af860);const _0x207a9f=this['_fakeSelections'][0x0]||null;this['_refreshFakeSelection'](_0x307356,_0x207a9f);}async['modelToDataWithIds'](_0x2d199a){const _0x67679b=Ys(this['context']),_0x3615e7=_0x67679b['data']['toView'](_0x2d199a),_0x4f4c5d=new _0x49c9be(_0x67679b['editing']['view']['document']);return this['_setDataIdsOnChildren'](_0x3615e7,_0x4f4c5d),this['_getDocumentDataStringFromView'](_0x3615e7);}['_setDataIdsOnChildren'](_0x450409,_0x42d7be){let _0x4a2cb3=!0x1;const _0x268c33=new Set();for(const _0x2b2732 of _0x450409['getChildren']()){if(!_0x2b2732['is']('view:element'))continue;const _0x406142=_0x2b2732['is']('view:containerElement'),_0x27355b=_0x2b2732['is']('view:emptyElement'),_0x5b5cbb=this['_setDataIdsOnChildren'](_0x2b2732,_0x42d7be);if(_0x2b2732['hasAttribute']('data-id')){_0x4a2cb3=!0x0,_0x268c33['add'](_0x2b2732['getAttribute']('data-id'));continue;}(_0x406142||_0x27355b||_0x5b5cbb)&&(_0x42d7be['setAttribute']('data-id',this['_nextDataId'](_0x268c33),_0x2b2732),_0x4a2cb3=!0x0);}return _0x4a2cb3;}['_nextDataId'](_0x4d3943){let _0x5883f6;do{_0x5883f6='';for(let _0x529488=0x0;_0x529488<0x4;_0x529488++)_0x5883f6+=String['fromCharCode'](0x61+Math['floor'](0x1a*Math['random']()));}while(_0x4d3943['has'](_0x5883f6));return _0x4d3943['add'](_0x5883f6),_0x5883f6;}['getSelectionText'](){const {model:_0x250620}=Ys(this['context']),_0x111131=_0x250620['document']['selection'],_0x13c1f1=[],_0x574636=Array['from'](_0x111131['getRanges']());_0x574636['sort']((_0xb895f8,_0x2862ef)=>_0xb895f8['start']['isBefore'](_0x2862ef['start'])?-0x1:0x1);for(const _0x51e374 of _0x574636)for(const _0x350408 of _0x51e374['getItems']())_0x350408['is']('$textProxy')?_0x13c1f1['push'](_0x350408['data']):_0x350408['is']('element')&&_0x13c1f1['length']>0x0&&'\x20'!==_0x13c1f1[_0x13c1f1['length']-0x1]&&_0x13c1f1['push']('\x20');return _0x13c1f1['length']?'\x22'+_0x13c1f1['join']('')['trim']()+'\x22':cs(this['context']['locale'],'AI_CHAT_CONTEXT_DOCUMENT_SELECTION_LABEL');}['_removeFakeSelectionById'](_0xb135d1){for(let _0x299362=0x0;_0x299362<this['_fakeSelections']['length'];_0x299362++)if(this['_fakeSelections'][_0x299362]['id']==_0xb135d1)return void this['_fakeSelections']['splice'](_0x299362,0x1);}['_addFakeSelection'](_0x5c447e){this['_removeFakeSelectionById'](_0x5c447e['id']),Ct(this['_fakeSelections'],_0x5c447e);}['_refreshFakeSelection'](_0x1ca778,_0x514cb7){if(_0x1ca778==_0x514cb7)return;const _0xf5f19b=Ys(this['context']),_0x2335bc=_0xf5f19b['model'];_0x2335bc['change'](_0x452d8f=>{if(_0x1ca778){const _0x1c30d0=_0xf5f19b['model']['markers']['getMarkersGroup'](Xs);for(const _0x4415b2 of _0x1c30d0)_0x452d8f['removeMarker'](_0x4415b2);}if(_0x514cb7)for(let _0x45ded8=0x0;_0x45ded8<_0x514cb7['ranges']['length'];_0x45ded8++){let _0x30295f=_0x514cb7['ranges'][_0x45ded8];const _0x4e5853=Xs+':'+_0x514cb7['id']+':'+_0x45ded8;if(_0x30295f['start']['isAtEnd']){const _0x18c3b0=_0x30295f['start']['getLastMatchingPosition'](({item:_0x1b5a5e})=>!_0x2335bc['schema']['isContent'](_0x1b5a5e),{'boundaries':_0x30295f});_0x30295f=_0x452d8f['createRange'](_0x18c3b0,_0x30295f['end']);}_0x452d8f['addMarker'](_0x4e5853,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x30295f});}});}['_getMarkersInDocumentOrder'](){const _0x317372=Ys(this['context'])['model'];return Array['from'](_0x317372['markers']['getMarkersGroup'](Xs))['sort']((_0x5ed1d5,_0x33a5fc)=>_0x5ed1d5['getStart']()['isBefore'](_0x33a5fc['getStart']())?-0x1:_0x5ed1d5['getStart']()['isAfter'](_0x33a5fc['getStart']())?0x1:0x0);}}const js=['showChangeInText','insertSuggestion','applySuggestion','rejectSuggestion','mouseOverSuggestion','mouseLeaveSuggestion','toggleSuggestionDisplayMode','like','dislike'],Js=[...js,'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(_0x2dc984){this['options']={'delay':_0x2dc984['delay']??0x14,'textNodeStyle':_0x2dc984['textNodeStyle'],'onStreamUpdate':_0x2dc984['onStreamUpdate']||(()=>{})};}async['stream']({document:_0xf39640,targetElement:_0x241a44,abortSignal:_0x2740c2}){this['isStreaming']&&this['stop'](),_0x2740c2?.['addEventListener']('abort',this['stop']['bind'](this)),this['document']=_0x467547(_0xf39640,!0x0),this['nodesList']=this['getParsedDocumentNodeList'](),this['isStreaming']=!0x0,this['currentIndex']>this['nodesList']['length']&&(this['currentIndex']=this['nodesList']['length']);for(let _0x2d94f2=0x0;_0x2d94f2<this['currentIndex'];_0x2d94f2++)this['nodesList'][_0x2d94f2]['shouldBeStreamed']=!0x0;do{const _0x172331=Date['now'](),_0x4a0c61=this['nodesList'][this['currentIndex']],_0x40e270=_0x172331-this['lastUpdateTime'];if(_0x4a0c61){_0x4a0c61['shouldBeStreamed']=!0x0;let _0x471925=_0x4a0c61['parent'];for(;_0x471925;)_0x471925['shouldBeStreamed']=!0x0,_0x471925=_0x471925['parent'];}if(_0x40e270<this['options']['delay'])try{const {promise:_0x5b5214,abortController:_0x5e5ea6}=nn(this['options']['delay']-_0x40e270);this['timeoutAbortController']=_0x5e5ea6,await _0x5b5214;}catch(_0x4f35ed){return;}_0x5bfbdc(_0x241a44,'<'+_0x241a44['tagName']+'>'+this['renderNode'](this['document'])+'</'+_0x241a44['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:_0xfc5d15}){Array['from'](_0xfc5d15['querySelectorAll']('span[data-ck-html-streamer-word-chunk]'))['reverse']()['forEach'](_0x42d7de=>{_0x42d7de['replaceWith'](_0x42d7de['childNodes'][0x0]);});}['stop'](){this['isStreaming']=!0x1,this['timeoutAbortController']&&(this['timeoutAbortController']['abort'](),this['timeoutAbortController']=null);}['renderNode'](_0x18fa84){let _0x2c8671='';if(function(_0x44b986){return _0x55bd11(_0x44b986);}(_0x18fa84)){for(const _0x1667b3 of _0x18fa84['children'])_0x2c8671+=this['renderNode'](_0x1667b3);}else{if(sn(_0x18fa84)){if(!_0x18fa84['shouldBeStreamed'])return'';const _0x3b6440=_0x18fa84,_0x13b7b2=Object['entries'](_0x3b6440['attribs'])['map'](([_0x3f9eb4,_0xe0b1c0])=>_0x3f9eb4+'=\x22'+_0xe0b1c0+'\x22')['join']('\x20');_0x2c8671+='<'+_0x3b6440['tagName']+(_0x13b7b2?'\x20'+_0x13b7b2:'')+'>';for(const _0x5720fa of _0x2b3b2c(_0x3b6440))_0x2c8671+=this['renderNode'](_0x5720fa);_0x2c8671+='</'+_0x3b6440['tagName']+'>';}else{if(!en(_0x18fa84))return'';if(!_0x18fa84['shouldBeStreamed'])return'';!function(_0x3b74d5){if(!_0x3b74d5['parent']||!sn(_0x3b74d5['parent']))return!0x1;if(!tn['includes'](_0x3b74d5['parent']['tagName']))return!0x1;return!ti(_0x3b74d5)['match'](/^\s*[<>]\s*$/);}(_0x18fa84)?_0x2c8671+=_0x3fc46a(_0x18fa84):_0x2c8671+=_0x3fc46a(new _0x58105d('span',{'data-ck-html-streamer-word-chunk':'','style':this['options']['textNodeStyle']},[_0x18fa84]));}}return _0x2c8671;}['getParsedDocumentNodeList'](){const _0xc61b58=[];return function(_0x36f14a,_0x3a880d){const _0x37f79c=_0xc0cb4d=>{if(_0x3a880d(_0xc0cb4d),_0xc0cb4d instanceof _0x426907)for(let _0x31eb49=0x0;_0x31eb49<_0xc0cb4d['children']['length'];_0x31eb49++){const _0x237a50=_0xc0cb4d['children'][_0x31eb49];_0x37f79c(_0x237a50);}};for(let _0x5ba7f4=0x0;_0x5ba7f4<_0x36f14a['children']['length'];_0x5ba7f4++)_0x37f79c(_0x36f14a['children'][_0x5ba7f4]);}(this['document'],_0x75b863=>{if(en(_0x75b863)){const _0x250c5c=this['splitTextNodeIntoWordNodes'](_0x75b863);_0x250c5c['length']&&_0xc61b58['push'](..._0x250c5c);}_0x75b863['isWordSplitSource']||_0x75b863['isWordSplitResult']||_0xc61b58['push'](_0x75b863);}),_0xc61b58;}['splitTextNodeIntoWordNodes'](_0x279195){if(_0x279195['isWordSplitSource']||_0x279195['isWordSplitResult'])return[];const _0x498a04=ti(_0x279195)['match'](/(?:\s*\S+\s*)/g),_0x279db2=[];if(_0x498a04&&_0x498a04['length']>0x1){for(const _0x5a182e of _0x498a04){const _0x2643bf=new _0x106606(_0x5a182e);_0x2643bf['isWordSplitResult']=!0x0,_0x26965d(_0x279195,_0x2643bf),_0x279db2['push'](_0x2643bf);}_0x279195['isWordSplitSource']=!0x0,_0x35c3c7(_0x279195);}return _0x279db2;}}const tn=['p','li','td','th','span','h1','h2','h3','h4','h5','h6','b','strong','i','em','mark','del','ins','sup','sub','a','code','div'];function en(_0x5175e3){return _0x23c989(_0x5175e3);}function sn(_0x589baa){return _0x1b7c52(_0x589baa);}function nn(_0x4b6cae){const _0x7ef816=new AbortController();return{'promise':new Promise((_0x4646f0,_0x39968f)=>{const _0x5cdbb4=setTimeout(_0x4646f0,_0x4b6cae);_0x7ef816['signal']['addEventListener']('abort',()=>{clearTimeout(_0x5cdbb4),_0x39968f();});}),'abortController':_0x7ef816};}class rn extends Nt{['options'];['content']='';['htmlStreamer'];['children'];constructor(_0x20f4e9){super();const _0x10703d=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']=_0x20f4e9,this['children']=this['createCollection'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__item',_0x10703d['if']('isDone','ck-ai-chat__feed__item_done'),_0x10703d['if']('isVisible','ck-hidden',_0x18e3d9=>!_0x18e3d9),'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'](_0x5c99f4=>{_0x5c99f4['removeAttribute']('data-id');}),this['isDone']=!0x0;}async['streamIntoElement'](_0x10d333,_0x32462c,_0x2c22d6){await this['htmlStreamer']['stream']({'document':_0x10d333,'targetElement':_0x32462c,'abortSignal':_0x2c22d6});}}class an extends Nt{['showChangesToggleView'];constructor(_0x1eda69,_0x372d24){super(_0x1eda69),this['set']('isShowChangesToggleVisible',!0x0),this['showChangesToggleView']=new on(_0x1eda69),this['showChangesToggleView']['set']({'class':'ck-ai-suggestion__header__show-changes-toggle\x20ck-ai-chat-controls-button\x20'+ds,'label':cs(_0x1eda69,'AI_SUGGESTION_BUTTON_SHOW_CHANGES'),'withText':!0x0}),this['showChangesToggleView']['isOn']=_0x372d24['showDiff'],this['showChangesToggleView']['bind']('isVisible')['to'](this,'isShowChangesToggleVisible'),this['showChangesToggleView']['bind']('icon')['to'](this['showChangesToggleView'],'isOn',_0x3202a9=>_0x3202a9?_0x3f61e6:_0x5b5c9e),this['showChangesToggleView']['on']('execute',()=>{this['showChangesToggleView']['isOn']=!this['showChangesToggleView']['isOn'],this['fire']('toggleShowChanges',{'isOn':this['showChangesToggleView']['isOn']});});const _0x72b62e=new yt();_0x72b62e['content']=_0x50a35b,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__header',!0x1===_0x372d24['showHeader']?'ck-hidden':null]['filter'](Boolean)},'children':[_0x72b62e,{'tag':'span','children':[cs(_0x1eda69,'AI_SUGGESTION_HEADER_TITLE')]},this['showChangesToggleView']]});}}class on extends kt{['render'](){super['render'](),this['children']['remove'](this['iconView']),this['children']['add'](this['iconView']);}}const hn={'accepted':_0x25a285,'rejected':_0x4a0b81,'outdated':_0x4a0b81};class cn extends Nt{['stateIconView'];constructor(_0x217b06){super(_0x217b06);const _0x53c2a1=this['bindTemplate'];this['set']('state','accepted'),this['set']('isVisible',!0x0),this['stateIconView']=new ln(),this['stateIconView']['bind']('state')['to'](this),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__content-part-state',_0x53c2a1['to']('state',_0x1cfcbe=>'ck-ai-suggestion__content-part-state_'+_0x1cfcbe),_0x53c2a1['if']('isVisible','ck-hidden',_0x22be3f=>!_0x22be3f)]},'children':[{'tag':'span','attributes':{'class':['ck-ai-suggestion__content-part-state__label']},'children':[{'text':_0x53c2a1['to']('state',_0x5d2726=>{switch(_0x5d2726){case'accepted':return cs(_0x217b06,'AI_SUGGESTION_CONTENT_PART_STATE_ACCEPTED');case'rejected':return cs(_0x217b06,'AI_SUGGESTION_CONTENT_PART_STATE_REJECTED');case'outdated':return cs(_0x217b06,'AI_SUGGESTION_CONTENT_PART_STATE_OUTDATED');}})}]},this['stateIconView']]});}['setState'](_0x1b00ef){this['state']=_0x1b00ef;}}class ln extends yt{constructor(){super(),this['set']('state','accepted'),this['content']=hn[this['state']],this['on']('change:state',()=>{this['content']=hn[this['state']];});}}class un extends Ot{['_applyButton'];['_suggestButton'];constructor(_0x105e75,_0x4fea33,_0x2aeeca){super(_0x105e75);const _0x637b23=Boolean(_0x2aeeca);this['set']('isEnabled',!_0x637b23),this['set']('isVisible',!0x0),this['class']='ck-ai-suggestion-content-part-toolbar';const _0x263203=[];if(_0x637b23){const _0x5133a1=new kt(_0x105e75);_0x5133a1['set']({'label':cs(_0x105e75,'AI_SUGGESTION_DISABLED_TOOLTIP_MESSAGE'),'tooltip':!0x0,'withText':!0x1,'icon':_0x2d51f0}),_0x5133a1['extendTemplate']({'attributes':{'data-cke-tooltip-class':'ck-ai-suggestion-content-part-disabled-actions-tooltip'}}),_0x263203['push'](_0x5133a1);}else{_0x4fea33['includes']('applySuggestion')&&(this['_applyButton']=new kt(_0x105e75),this['_applyButton']['set']({'label':cs(_0x105e75,'AI_SUGGESTION_CONTENT_PART_APPLY'),'tooltip':!0x0,'tooltipPosition':'n','withText':!0x1,'icon':_0x25a285}),this['_applyButton']['bind']('isEnabled')['to'](this),this['_applyButton']['on']('execute',()=>{this['fire']('applySuggestion');}),_0x263203['push'](this['_applyButton'])),_0x4fea33['includes']('insertSuggestion')&&(this['_suggestButton']=new kt(_0x105e75),this['_suggestButton']['set']({'label':cs(_0x105e75,'AI_SUGGESTION_CONTENT_PART_ADD_SUGGESTION'),'tooltip':!0x0,'tooltipPosition':'n','withText':!0x1,'icon':_0xd0fde5}),this['_suggestButton']['bind']('isEnabled')['to'](this),this['_suggestButton']['on']('execute',()=>{this['fire']('insertSuggestion');}),_0x263203['push'](this['_suggestButton']));const _0x7a7c5=new kt(_0x105e75);_0x7a7c5['set']({'label':cs(_0x105e75,'AI_SUGGESTION_CONTENT_PART_REJECT'),'tooltip':!0x0,'tooltipPosition':'n','withText':!0x1,'icon':_0x4a0b81}),_0x7a7c5['bind']('isEnabled')['to'](this),_0x7a7c5['on']('execute',()=>{this['fire']('rejectSuggestion');}),_0x263203['push'](_0x7a7c5);}this['items']['addMany'](_0x263203);const _0x13a89a=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':[_0x13a89a['if']('isVisible','ck-hidden',_0x49eff4=>!_0x49eff4)]}});}['setButtonsVisibility']({showApplyButton:_0x1480a2,showSuggestButton:_0x171234}){this['_applyButton']&&(this['_applyButton']['isVisible']=_0x1480a2),this['_suggestButton']&&(this['_suggestButton']['isVisible']=_0x171234);}}class dn extends Nt{['toolbarView'];['stateView'];['titleLabelView'];['children'];constructor(_0x58ee5a,{part:_0x4b5e3b,uiIndex:_0x493660,availableActions:_0x2decee,areActionsDisabled:_0x400a25}){super(_0x58ee5a),this['set']('isEnabled',!0x0),this['set']('state','pending'),this['toolbarView']=new un(_0x58ee5a,_0x2decee,_0x400a25),this['toolbarView']['on']('rejectSuggestion',()=>{this['fire']('rejectSuggestion',{'index':_0x4b5e3b['index']});}),this['toolbarView']['on']('insertSuggestion',()=>{this['fire']('insertSuggestion',{'index':_0x4b5e3b['index']});}),this['toolbarView']['on']('applySuggestion',()=>{this['fire']('applySuggestion',{'index':_0x4b5e3b['index']});}),this['toolbarView']['bind']('isEnabled')['to'](this),this['stateView']=new cn(_0x58ee5a),this['titleLabelView']=new _n(_0x58ee5a,_0x493660),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',(_0x555cb7,_0x52d5aa,_0x587904,_0x1d1f20)=>{'pending'===_0x1d1f20?this['children']['remove'](this['toolbarView']):this['children']['remove'](this['stateView']),'pending'===_0x587904?this['children']['add'](this['toolbarView']):(this['stateView']['setState'](_0x587904),this['children']['add'](this['stateView']));});}}class _n extends Nt{constructor(_0x48b7d1,_0x3d54ee){super(_0x48b7d1),this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-suggestion__body__content-part__title__label']},'children':[cs(_0x48b7d1,'AI_SUGGESTION_CONTENT_PART_TITLE',_0x3d54ee['toString']())]});}}class An extends Nt{['htmlStreamer'];constructor(_0x5961e0){super(_0x5961e0),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:_0x2672da,renderingStrategy:_0x189179,abortSignal:_0x48b7ee}){'streaming'===_0x189179?await this['htmlStreamer']['stream']({'document':_0x2672da['content'],'targetElement':this['element'],'abortSignal':_0x48b7ee}):this['element']['innerHTML']=gs(_0x2672da['content']);}['clear'](){this['htmlStreamer']['reset'](),this['element']['innerHTML']='';}}class gn extends Nt{['_children'];['_headerView'];['_streamableContentView'];constructor(_0x4bef8c,{part:_0x4fe8a1,uiIndex:_0x3088bc,areActionsDisabled:_0x45f617,availableActions:_0x2ecb7a}){super(_0x4bef8c);const _0x394454=this['bindTemplate'];this['set']('state','pending'),this['set']('isDone',!0x1),this['set']('isVisible',!0x1),this['set']('isActive',!0x1),this['set']('isEnabled',!0x1);const _0x28e5b6=()=>{this['isEnabled']=this['isDone']&&'pending'==this['state']&&!_0x45f617;};this['on']('change:state',_0x28e5b6),this['on']('change:isDone',_0x28e5b6),_0x28e5b6(),this['_children']=this['createCollection'](),this['_headerView']=new dn(_0x4bef8c,{'part':_0x4fe8a1,'uiIndex':_0x3088bc,'availableActions':_0x2ecb7a,'areActionsDisabled':_0x45f617}),this['_headerView']['bind']('isEnabled','state')['to'](this),this['_headerView']['delegate'](...js)['to'](this),this['_streamableContentView']=new An(_0x4bef8c),this['_children']['addMany']([this['_headerView'],this['_streamableContentView']]),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__body__content-part',_0x394454['to']('state',_0x1099c8=>'ck-ai-suggestion__body__content-part_'+_0x1099c8),_0x394454['if']('isEnabled','ck-ai-suggestion__body__content-part_enabled'),_0x394454['if']('isActive','ck-ai-suggestion__body__content-part_active'),_0x394454['if']('isVisible','ck-hidden',_0x71cd02=>!_0x71cd02)]},'children':this['_children'],'on':{'mouseenter':_0x394454['to'](()=>{this['isEnabled']&&this['fire']('mouseOverSuggestion',{'index':_0x4fe8a1['index']});}),'mouseleave':_0x394454['to'](()=>{this['isEnabled']&&this['fire']('mouseLeaveSuggestion',{'index':_0x4fe8a1['index']});}),'click':_0x394454['to'](_0x3babde=>{const _0x2573bf=_0x3babde['target'];this['isEnabled']&&!this['_headerView']['toolbarView']['element']['contains'](_0x2573bf)&&this['fire']('showChangeInText',{'index':_0x4fe8a1['index']});})}});}async['updateContent']({part:_0x328c41,renderingStrategy:_0x3629cf,showUnchangedParts:_0x230e5e=!0x1,abortSignal:_0x235d28}){this['partDefinition']=_0x328c41,this['isVisible']=this['partDefinition']['hasChanges']||_0x230e5e,this['isVisible']&&await this['_streamableContentView']['update']({'part':_0x328c41,'renderingStrategy':_0x3629cf,'abortSignal':_0x235d28});}['markAsDone'](){this['isDone']=!0x0;}}class In extends Et(){['queue']=[];['isProcessing']=!0x1;['_abortController'];async['enqueue'](_0x3bfa57){const _0x1cd146=this['createTask'](_0x3bfa57);return this['queue']['push'](_0x1cd146),this['_processQueue'](),_0x1cd146['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(_0x172212=>{this['once']('_queueEmpty',()=>{_0x172212();});}):Promise['resolve']();}async['_processQueue'](){if(!this['isProcessing']){this['_abortController']=new AbortController(),this['isProcessing']=!0x0;try{for(;this['queue']['length']&&this['isProcessing'];){const _0x1201c0=this['queue']['shift']();try{await _0x1201c0['callback'](this['_abortController']['signal']),_0x1201c0['resolve']();}catch(_0x282e83){_0x1201c0['reject'](_0x282e83);}}}finally{this['isProcessing']=!0x1,this['_abortController']=void 0x0;}this['fire']('_queueEmpty');}}['createTask'](_0x2d5c5f){let _0x3fecda,_0x21181d;const _0x1d6f77=new Promise((_0x2771f9,_0x18a3c0)=>{_0x3fecda=_0x2771f9,_0x21181d=_0x18a3c0;});return{'callback':_0x2d5c5f,'resolve':_0x3fecda,'reject':_0x21181d,'completePromise':_0x1d6f77};}}class En extends rn{constructor(_0x2be240){super(_0x2be240),this['extendTemplate']({'attributes':{'class':['ck-ai-notification','warning'===_0x2be240['level']?'ck-ai-notification_warning':'ck-ai-notification_error']}});}['render'](){super['render'](),this['setContent'](this['options']['initialContent']),this['markAsDone']();}['setContent'](_0x57f7ff){this['element']['innerHTML']=_0x57f7ff;}}const pn=['applySuggestion','insertSuggestion'];class Tn extends Nt{['_applyChangesButton'];['_insertSuggestionsButton'];['children'];constructor(_0x849676,_0x3f2202=[...pn],_0xd63662){super(_0x849676);const _0x345b11=this['bindTemplate'],_0x59e712=Boolean(_0xd63662);if(this['set']('isEnabled',!_0x59e712),this['set']('isVisible',!0x1),this['set']('isTrackChangesOn',!0x1),this['children']=this['createCollection'](),_0x59e712){const _0x3cc5b3=new kt(_0x849676);_0x3cc5b3['set']({'label':cs(_0x849676,'AI_SUGGESTION_DISABLED_TOOLTIP_MESSAGE'),'tooltip':!0x0,'withText':!0x1,'icon':_0x2d51f0}),_0x3cc5b3['extendTemplate']({'attributes':{'data-cke-tooltip-class':'ck-ai-suggestion-content-part-disabled-actions-tooltip'}});const _0x50fccb=new Nt(_0x849676);_0x50fccb['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-chat__feed__suggestion__actions__info'},'children':[{'tag':'p','children':[cs(_0x849676,'AI_SUGGESTION_DISABLED_FEED_MESSAGE'),_0x3cc5b3]}]}),this['children']['add'](_0x50fccb);}else this['_applyChangesButton']=new kt(_0x849676),this['_applyChangesButton']['set']({'label':cs(_0x849676,'AI_CHAT_SUGGESTION_ACTION_APPLY_ALL'),'withText':!0x0,'type':'button','isVisible':_0x3f2202['includes']('applySuggestion'),'class':ls}),this['_insertSuggestionsButton']=new kt(_0x849676),this['_insertSuggestionsButton']['set']({'label':cs(_0x849676,'AI_CHAT_SUGGESTION_ACTION_SUGGEST_ALL'),'withText':!0x0,'type':'button','isVisible':_0x3f2202['includes']('insertSuggestion'),'class':us}),this['_insertSuggestionsButton']['on']('execute',()=>{this['fire']('insertSuggestion');}),this['_applyChangesButton']['on']('execute',()=>{this['fire']('applySuggestion');}),[this['_applyChangesButton'],this['_insertSuggestionsButton']]['forEach'](_0x1d6721=>{_0x1d6721['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',_0x345b11['if']('isVisible','ck-hidden',_0x5972dd=>!_0x5972dd)]},'children':this['children']}),this['on']('change:isTrackChangesOn',()=>{this['_applyChangesButton']&&(this['_applyChangesButton']['isVisible']=!this['isTrackChangesOn']);});}['updateVisibility'](_0x5b094e){this['isVisible']=_0x5b094e;}['_switchButtonLabelsPlurality'](_0x975840){this['_applyChangesButton']&&this['_insertSuggestionsButton']&&(_0x975840?(this['_applyChangesButton']['label']=cs(this['locale'],'AI_CHAT_SUGGESTION_ACTION_APPLY_ALL'),this['_insertSuggestionsButton']['label']=cs(this['locale'],'AI_CHAT_SUGGESTION_ACTION_SUGGEST_ALL')):(this['_applyChangesButton']['label']=cs(this['locale'],'AI_CHAT_SUGGESTION_ACTION_APPLY'),this['_insertSuggestionsButton']['label']=cs(this['locale'],'AI_CHAT_SUGGESTION_ACTION_SUGGEST')));}}class mn extends Nt{['children'];['balloonPanelView'];['bodyCollection'];constructor(_0x62dc58,_0x5a325e){super(_0x62dc58),this['bodyCollection']=_0x5a325e,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',_0x34e2dc=>!_0x34e2dc)]},'children':this['children']});const _0x30656c=new Nt(this['locale']),_0x28dd1f=new yt();_0x28dd1f['content']=_0x182219,_0x30656c['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-web-sources__header']},'children':[_0x28dd1f,{'tag':'span','children':[{'text':cs(this['locale'],'AI_CHAT_SOURCES_HEADER')}]}]}),this['children']['add'](_0x30656c),this['_setupBalloonPanel'](_0x62dc58);}['addSource'](_0x3420cc){this['children']['add'](new Cn(this['locale'],_0x3420cc,this['balloonPanelView']));}['_setupBalloonPanel'](_0x2b493f){this['balloonPanelView']=new Qt(_0x2b493f),this['balloonPanelView']['extendTemplate']({'attributes':{'class':['ck-ai-web-source__tooltip-balloon']}}),this['bodyCollection']['add'](this['balloonPanelView']);}}class Cn extends kt{['balloonPanelView'];['source'];constructor(_0x151a0c,_0x361c6f,_0x4d038a){super(_0x151a0c),this['source']=_0x361c6f,this['balloonPanelView']=_0x4d038a,this['set']({'label':_0x361c6f['title'],'class':['ck\x20ck-ai-web-source'],'withText':!0x0});const _0x27c2b8=this['bindTemplate'];if(this['extendTemplate']({'on':{'click':_0x27c2b8['to'](()=>{window['open'](_0x361c6f['url'],'_blank');}),'mouseenter':_0x27c2b8['to'](()=>{this['_showTooltip']();}),'mouseleave':_0x27c2b8['to'](()=>{this['_hideTooltip']();})}}),_0x361c6f['favicon']){const _0x41ba51=new Nt(_0x151a0c);_0x41ba51['setTemplate']({'tag':'img','attributes':{'src':_0x361c6f['favicon']||_0x182219,'alt':_0x361c6f['title'],'class':['ck-ai-web-source__image']}}),this['children']['add'](_0x41ba51);}else this['set']('icon',_0x182219);}['_createTooltipContentView'](_0x36fd4a,_0x1bce32){const _0x3693be=new Nt(_0x36fd4a),_0x3cba7c=[];let _0x441560;_0x1bce32?.['favicon']?(_0x441560=new Nt(_0x36fd4a),_0x441560['setTemplate']({'tag':'img','attributes':{'src':_0x1bce32['favicon'],'alt':_0x1bce32['title'],'class':['ck-ai-web-source__tooltip-image']}})):(_0x441560=new yt(),_0x441560['content']=_0x182219,_0x441560['extendTemplate']({'attributes':{'alt':_0x1bce32['title'],'class':['ck-ai-web-source__tooltip-image']}})),_0x3cba7c['push'](_0x441560);const _0x485b59=new Nt(_0x36fd4a);_0x485b59['setTemplate']({'tag':'a','attributes':{'class':['ck-ai-web-source__tooltip-url'],'href':_0x1bce32['url']},'children':[{'text':new URL(_0x1bce32['url'])?.['hostname']}]}),_0x3cba7c['push'](_0x485b59);const _0xdb7cc1=new Nt(_0x36fd4a);_0xdb7cc1['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-web-source__tooltip-row']},'children':_0x3cba7c});const _0x540318=new Nt(_0x36fd4a);return _0x540318['setTemplate']({'tag':'span','attributes':{'class':['ck-ai-web-source__tooltip-row','ck-ai-web-source__tooltip-title']},'children':[{'text':_0x1bce32['title']['length']>0x190?_0x1bce32['title']['substring'](0x0,0x190)+'...':_0x1bce32['title']}]}),_0x3693be['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-web-source__tooltip']},'children':[_0xdb7cc1,_0x540318]}),_0x3693be;}['_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 _0x3a1517=this['_createTooltipContentView'](this['locale'],this['source']);this['balloonPanelView']['content']['add'](_0x3a1517);}}class wn extends Nt{['_actionsView'];['_sourcesView'];['_children'];['_areActionsDisabled'];['_showUnchangedParts'];['_updateContentPartsPromiseQueue'];['_emptyPartsWarningView'];['_availableActions'];['_cachedContentParts']=[];constructor(_0x23fb12,_0xbd1370){super(_0x23fb12);const {areActionsDisabled:_0x3588ed,showUnchangedParts:_0x1ee71f,availableActions:_0x1b6f4a}=_0xbd1370;this['_areActionsDisabled']=_0x3588ed,this['_showUnchangedParts']=_0x1ee71f,this['_availableActions']=_0x1b6f4a,this['set']('hasPendingParts',!0x1),this['set']('isTrackChangesOn',!0x1),this['_children']=this['createCollection'](),this['_updateContentPartsPromiseQueue']=new In(),this['_emptyPartsWarningView']=new En({'id':'empty-parts-warning','initialContent':cs(_0x23fb12,'AI_SUGGESTION_EMPTY_PART_WARNING'),'level':'warning'}),this['_emptyPartsWarningView']['isVisible']=!0x1,this['_actionsView']=new Tn(_0x23fb12,_0xbd1370['availableActions'],this['_areActionsDisabled']),this['_actionsView']['bind']('isTrackChangesOn')['to'](this),this['_sourcesView']=new mn(this['locale'],_0xbd1370['bodyCollection']),_0xbd1370['areActionsDisabled']?this['_actionsView']['isEnabled']=!0x1:this['_actionsView']['bind']('isEnabled')['to'](this,'hasPendingParts'),this['_actionsView']['delegate'](...js)['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:_0x46ad4b,renderingStrategy:_0x1f1253,abortSignal:_0x5e0744}){this['_children']['length']?_0x46ad4b['forEach'](_0x328464=>{const _0x36d75d=this['_cachedContentParts']['findIndex'](_0x537042=>_0x537042['index']==_0x328464['index']);-0x1===_0x36d75d?this['_cachedContentParts']['push'](_0x328464):this['_cachedContentParts'][_0x36d75d]=_0x328464;}):this['_cachedContentParts']=_0x46ad4b;const _0x539d74=this['_showUnchangedParts']?_0x46ad4b:_0x46ad4b['filter'](_0x48741e=>_0x48741e['hasChanges']);this['_actionsView']['_switchButtonLabelsPlurality'](_0x539d74['length']>0x1);for(const _0x5a1b91 of _0x539d74)this['_updateContentPartsPromiseQueue']['enqueue'](async _0x1471be=>{let _0x3e07ff=this['getPartView'](_0x5a1b91['index']);_0x3e07ff||(_0x3e07ff=new gn(this['locale'],{'part':_0x5a1b91,'uiIndex':this['_children']['length']+0x1,'areActionsDisabled':this['_areActionsDisabled'],'availableActions':this['_availableActions']}),_0x3e07ff['delegate'](...js)['to'](this),this['_children']['add'](_0x3e07ff),this['hasPendingParts']=!0x0),await _0x3e07ff['updateContent']({'part':_0x5a1b91,'renderingStrategy':_0x1f1253,'showUnchangedParts':this['_showUnchangedParts'],'abortSignal':_0x1471be}),_0x3e07ff['markAsDone']();});return _0x5e0744?.['addEventListener']('abort',()=>{this['_updateContentPartsPromiseQueue']['abort']();}),this['_updateContentPartsPromiseQueue']['queueEmptyPromise'];}['updatePartState'](_0x1f068,_0x5ccea6){const _0x3d1a95=this['getPartView'](_0x1f068);_0x3d1a95&&(_0x3d1a95['state']=_0x5ccea6),this['hasPendingParts']='pending'==_0x5ccea6||Array['from'](this['_children'])['some'](_0x201983=>'pending'==_0x201983['state']);}['setPartActive'](_0x38146d,_0x2ea41d){if(!0x1===_0x38146d){for(const _0x43f2a9 of this['_children'])_0x43f2a9['isActive']=!0x1;}else{const _0x3b87b7=this['getPartView'](_0x38146d);_0x3b87b7&&(_0x3b87b7['isActive']=_0x2ea41d);}}['updateSources'](_0x246e1d){_0x246e1d['forEach'](_0x2dcc74=>this['_sourcesView']['addSource'](_0x2dcc74)),this['_sourcesView']['isVisible']=!0x0;}['getPartView'](_0x3a3e14){return this['_children']['find'](_0x59bc53=>_0x59bc53['partDefinition']['index']==_0x3a3e14)??null;}['markAsDone'](){if(!this['_showUnchangedParts']){const _0x5bccbc=!this['_cachedContentParts']['find'](({hasChanges:_0x573cd7})=>_0x573cd7),_0x3c7f69=!!this['_cachedContentParts']['find'](({hasChanges:_0x5bd5eb})=>!_0x5bd5eb);this['_emptyPartsWarningView']['isVisible']=0x0==this['_children']['length']||_0x3c7f69,_0x5bccbc?this['_emptyPartsWarningView']['setContent'](cs(this['locale'],'AI_SUGGESTION_NO_PARTS_WARNING')):this['_emptyPartsWarningView']['setContent'](cs(this['locale'],'AI_SUGGESTION_EMPTY_PART_WARNING'));}this['_children']['forEach'](_0x1c6e8d=>_0x1c6e8d['markAsDone']()),this['_actionsView']['updateVisibility'](this['hasNonEmptyParts']);}get['hasNonEmptyParts'](){return this['_children']['filter'](_0x3e98e7=>_0x3e98e7['partDefinition']['hasChanges'])['length']>0x0;}}class fn extends Nt{['bodyView'];['children'];['headerView'];constructor(_0x2f3ed2,_0x3eecd1,_0x132481){super(_0x2f3ed2);const {showDiff:_0x1bb0e7,areActionsDisabled:_0x1d7eb1,showUnchangedParts:_0x2fc292,availableActions:_0x3632a0}=_0x3eecd1;this['set']('isTrackChangesOn',!0x1),this['set']('areChangesVisible',!0x1),this['children']=this['createCollection'](),this['headerView']=new an(_0x2f3ed2,{'showDiff':_0x1bb0e7}),this['headerView']['on']('toggleShowChanges',(_0x2ab999,_0x328274)=>{this['areChangesVisible']=_0x328274['isOn'],this['fire']('toggleSuggestionDisplayMode',{'showDiff':_0x328274['isOn']});}),this['children']['add'](this['headerView']),this['bodyView']=new wn(_0x2f3ed2,{'areActionsDisabled':_0x1d7eb1,'showUnchangedParts':!!_0x2fc292,'availableActions':_0x3632a0,'bodyCollection':_0x132481}),this['bodyView']['delegate'](...js)['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'](_0x12b096){await this['bodyView']['updateContentParts'](_0x12b096);}['updateSources'](_0x53e77c){this['bodyView']['updateSources'](_0x53e77c);}['markAsDone'](){this['bodyView']['markAsDone'](),this['headerView']&&(this['headerView']['isShowChangesToggleVisible']=this['bodyView']['hasNonEmptyParts']);}}class Sn extends rn{['containerView'];constructor(_0x1c3d72,_0x3ffb18,_0x26dd95){super(_0x3ffb18),this['set']('isTrackChangesOn',!0x1),this['containerView']=new fn(_0x1c3d72,{'showDiff':_0x3ffb18['showDiff'],'areActionsDisabled':_0x3ffb18['areActionsDisabled'],'availableActions':_0x3ffb18['availableActions']},_0x26dd95),this['containerView']['on']('toggleSuggestionDisplayMode',(_0x5e1afe,_0x35ac2a)=>{this['fire']('toggleSuggestionDisplayMode',{'replyId':this['options']['id'],'showDiff':_0x35ac2a['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',(_0x24a97e,{index:_0x170077})=>{this['fire']('showChangeInText',{'replyId':this['options']['id'],'partIndex':_0x170077});}),this['containerView']['on']('applySuggestion',(_0x5d025d,{index:_0x2d43fa}={})=>{this['fire']('applySuggestion',{'replyId':this['options']['id'],'partIndex':_0x2d43fa});}),this['containerView']['on']('insertSuggestion',(_0x513610,{index:_0x1ef79d}={})=>{this['fire']('insertSuggestion',{'replyId':this['options']['id'],'partIndex':_0x1ef79d});}),this['containerView']['on']('rejectSuggestion',(_0x29690f,{index:_0x21372a})=>{this['fire']('rejectSuggestion',{'replyId':this['options']['id'],'partIndex':_0x21372a});}),this['containerView']['on']('mouseOverSuggestion',(_0x540073,{index:_0x4b6c9e})=>{this['fire']('mouseOverSuggestion',{'replyId':this['options']['id'],'partIndex':_0x4b6c9e});}),this['containerView']['on']('mouseLeaveSuggestion',(_0x409a96,{index:_0x4bd296})=>{this['fire']('mouseLeaveSuggestion',{'replyId':this['options']['id'],'partIndex':_0x4bd296});}),this['children']['addMany']([this['containerView']]),this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__ai-suggestion']}});}async['updateContent'](_0x314145){await this['containerView']['updateContent'](_0x314145);}['updatePartState'](_0x40b8ec,_0x1c10d3){this['containerView']['bodyView']['updatePartState'](_0x40b8ec,_0x1c10d3);}['setPartActive'](_0x1d8eea,_0x278e33){!0x1===_0x1d8eea?this['containerView']['bodyView']['setPartActive'](!0x1):this['containerView']['bodyView']['setPartActive'](_0x1d8eea,_0x278e33);}['updateSources'](_0x427fca){this['containerView']['updateSources'](_0x427fca);}['getPartView'](_0x23669f){return this['containerView']['bodyView']['getPartView'](_0x23669f);}['markAsDone'](){super['markAsDone'](),this['containerView']['markAsDone']();}}class bn extends rn{['replyContainer'];['_bodyCollection'];constructor(_0x3bb039,_0x54cef2,_0x36c63f){super(_0x54cef2),this['_bodyCollection']=_0x36c63f,this['locale']=_0x3bb039,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':As(this['options']['initialContent']),'renderingStrategy':'static'}),this['markAsDone']());}async['updateContent']({parsedContent:_0x297dcc,renderingStrategy:_0x394ff7,abortSignal:_0x32b978}){'streaming'===_0x394ff7?await this['streamIntoElement'](_0x297dcc,this['replyContainer']['element'],_0x32b978):this['replyContainer']['element']['innerHTML']=_0x3fc46a(_0x297dcc);}['updateSources'](_0x1be1cd){const _0x5c088c=new mn(this['locale'],this['_bodyCollection']);_0x5c088c['children']['addMany'](_0x1be1cd['map'](_0x42e851=>new Cn(this['locale'],_0x42e851,_0x5c088c['balloonPanelView']))),_0x5c088c['isVisible']=!0x0,this['children']['add'](_0x5c088c);}}class Rn extends vt{constructor(_0x4ea28d=void 0x0){super();const _0x2bd87d=_0x4ea28d?'ck-ai-spinner_'+_0x4ea28d:'';this['extendTemplate']({'tag':'span','attributes':{'class':['ck-ai-spinner',_0x2bd87d]}});}}const On={'file':_0x3748e7,'document':_0x50a35b,'web-resource':_0x4b5c8c,'text':_0x3748e7,'selection':_0x48df06,'mcp-tool-context':_0x50a35b},kn='ck-ai-chat-context-chip',Nn='ck-ai-chat-context-chip_wide',vn='ck-ai-chat-context-chip_document',yn='ck-ai-chat-context-chip__label',xn='ck-ai-chat-context-chip__type-icon',Ln='ck-ai-chat-context-controls__chip-tooltip',Dn='n';class Pn extends kt{constructor(_0x395d9f,_0x2c6479,_0x2fedcf,_0x427114,_0x137681=!0x1){super(_0x395d9f),this['_isAnimationOnEnterEnabled']=_0x427114,this['_initializeProperties'](_0x2c6479,_0x2fedcf,_0x137681),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'](_0x1e1473,_0x37ab98,_0x7d3a70){this['set']('label',_0x1e1473['label']),this['set']('tooltip',!0x0),this['set']('itemType',_0x1e1473['type']),this['set']('id',_0x1e1473['uiId']),this['set']('readonly',_0x37ab98),this['set']('isLoading',_0x7d3a70);}['_setupTemplate'](){const _0x438b96=this['_createIconView'](),_0x160a57=this['_createRemoveButton'](),_0x518bf1=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':this['_createTemplateAttributes'](_0x518bf1),'children':this['_createTemplateChildren'](_0x438b96,_0x160a57,_0x518bf1)});}['_createTemplateAttributes'](_0x301b1f){return{'class':[kn,_0x301b1f['if']('itemType',vn,_0x486f09=>'document'==_0x486f09),_0x301b1f['if']('itemType',Nn,_0x27843c=>'selection'==_0x27843c)],'data-cke-tooltip-text':_0x301b1f['to']('label',Hn),'data-cke-tooltip-position':Dn,'data-cke-tooltip-class':Ln};}['_createTemplateChildren'](_0x1d4ec7,_0x41aec0,_0x2fd704){const _0x86b9a1=this['_createLabelElement'](_0x2fd704),_0x514ba6=this['_createLoaderIcon']();return this['readonly']?[_0x1d4ec7,_0x86b9a1]:[_0x1d4ec7,_0x514ba6,_0x86b9a1,_0x41aec0];}['_createLabelElement'](_0x31b152){return{'tag':'span','attributes':{'class':yn},'children':[{'text':_0x31b152['to']('label')}]};}['_createRemoveButton'](){const _0x497740=new kt(this['locale']);return _0x497740['set']({'label':cs(this['locale'],'AI_CHAT_CONTEXT_REMOVE_FROM_CONTEXT'),'icon':_0x2a335e}),this['_setupRemoveButtonEvent'](_0x497740),_0x497740;}['_setupRemoveButtonEvent'](_0x314d84){_0x314d84['on']('execute',()=>{this['fire']('removeContextItemChip',this['id']);});}['_createIconView'](){const _0x57bdb4=this['bindTemplate'],_0x38f29d=new yt();return _0x38f29d['content']=On[this['itemType']],_0x38f29d['extendTemplate']({'attributes':{'class':[xn,_0x57bdb4['if']('isLoading','ck-hidden',_0x3babf1=>_0x3babf1)]}}),_0x38f29d;}['_handleAnimationEndOnce'](_0x19f94,_0x300673){if(!_0x19f94)return;const _0x1f08bf=()=>{_0x300673(),_0x19f94['removeEventListener']('animationend',_0x1f08bf),_0x19f94['removeEventListener']('webkitAnimationEnd',_0x1f08bf);};_0x19f94['addEventListener']('animationend',_0x1f08bf),_0x19f94['addEventListener']('webkitAnimationEnd',_0x1f08bf);}['_createLoaderIcon'](){const _0xc3b3c0=new Rn('small');return _0xc3b3c0['bind']('isVisible')['to'](this,'isLoading',_0x2a60dc=>_0x2a60dc),_0xc3b3c0;}}function Hn(_0x152f43){if(!_0x152f43)return _0x152f43;if(_0x152f43['length']<=0x78)return _0x152f43;const _0x3825df=_0x152f43['slice'](0x0,0x78),_0x5f00e3=_0x3825df['lastIndexOf']('\x20');return(_0x5f00e3>0x0?_0x3825df['slice'](0x0,_0x5f00e3):_0x3825df)+'…';}const Mn={'maxVisibleRows':0x2,'rowDetectionTolerance':0x5,'showMoreLabelPrefix':'+\x20','viewportOffset':{'top':0x64,'bottom':0xa}},Un='300px';class Vn{['_locale'];['_config'];['_visibleChips'];['_overflowChips'];['_showMoreButtonView']=null;['_showMoreBalloonPanelView']=null;['_containerElement']=null;['_bodyCollection'];['_parentView']=null;['_intersectionObserver']=null;['_pendingCalculation']=!0x1;constructor(_0x4c5aa7,_0x12d9ba,_0x29fea4,_0x15fe9d,_0x2fc73f){this['_locale']=_0x4c5aa7,this['_visibleChips']=_0x12d9ba,this['_config']={...Mn,..._0x29fea4,'cssClasses':{'controlsButton':'','calculationContainer':'ck-calculation-container',..._0x29fea4['cssClasses']}},this['_overflowChips']=new dt(),this['_bodyCollection']=_0x15fe9d,this['_parentView']=_0x2fc73f||null;}['setContainerElement'](_0x151e0f){this['_intersectionObserver']&&(this['_intersectionObserver']['disconnect'](),this['_intersectionObserver']=null),this['_containerElement']=_0x151e0f,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 _0x484f13=[...this['_visibleChips'],...this['_overflowChips']],_0xd71d67=this['_createCalculationContainer'](),_0x510953=this['_calculateOverflowInContainer'](_0xd71d67,_0x484f13),_0x3438e5=_0xd71d67['_ancestorsToRestore'];_0x3438e5&&this['_restoreAncestorVisibility'](_0x3438e5),_0xd71d67['remove'](),this['_applyOverflowResults'](_0x484f13,_0x510953);}['_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 _0x213593=new kt(this['_locale']);_0x213593['set']({'label':'','withText':!0x0,'isToggleable':!0x0});const _0x4d2e47=[this['_config']['cssClasses']['showMoreButton']];return this['_config']['cssClasses']['controlsButton']&&_0x4d2e47['push'](this['_config']['cssClasses']['controlsButton']),_0x213593['extendTemplate']({'attributes':{'class':_0x4d2e47}}),_0x213593;}['_createShowMoreBalloonPanelView'](){const _0x412b1d=new Qt(this['_locale']);return _0x412b1d['extendTemplate']({'attributes':{'class':this['_config']['cssClasses']['showMoreBalloon']}}),this['_bodyCollection']['add'](_0x412b1d),_0x412b1d;}['_updateBalloonContent'](){if(this['_showMoreBalloonPanelView']&&(this['_showMoreBalloonPanelView']['content']['clear'](),this['_overflowChips']['length']>0x0)){this['_overflowChips']['forEach'](_0x16fe83=>{_0x16fe83['disableAnimationOnEnter']();});const _0x373bc3=new Nt(this['_locale']);_0x373bc3['setTemplate']({'tag':'div','attributes':{'class':this['_config']['cssClasses']['overflowContainer']},'children':this['_overflowChips']}),this['_showMoreBalloonPanelView']['content']['add'](_0x373bc3);}}['_handleShowMoreButtonClick'](){this['_showMoreButtonView']['isOn']?this['hideBalloonPanel']():this['showBalloonPanel']();}['_updateShowMoreButtonVisibility'](){const _0x8f27df=this['_overflowChips']['length']>0x0;this['_showMoreButtonView']?.['element']&&(this['_showMoreButtonView']['element']['style']['display']=_0x8f27df?'':'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'](_0x3fc65c){const _0x33f28b=this['_containerElement']?.['tagName']['toLowerCase']()||'div',_0x144231=this['_containerElement']?.['classList'];if(_0x144231){const _0x8e7343=_0x144231[0x0]||'',_0x55fde2=_0x3fc65c['querySelector']('.'+_0x8e7343),_0x379804=_0x3fc65c['querySelector'](_0x33f28b);return _0x55fde2||_0x379804||_0x3fc65c;}return _0x3fc65c['querySelector'](_0x33f28b)||_0x3fc65c;}['_calculateContainerWidth'](){const _0x4d30fe=this['_parentView']?.['element']||this['_containerElement'];if(!_0x4d30fe)return Un;const _0x4a39a2=window['getComputedStyle'](_0x4d30fe)['width'];if('auto'===_0x4a39a2||'0px'===_0x4a39a2||!_0x4a39a2){const _0x4220b4=_0x4d30fe['parentElement'];if(_0x4220b4){const _0x552519=window['getComputedStyle'](_0x4220b4);return'auto'!==_0x552519['width']?_0x552519['width']:Un;}return Un;}return _0x4a39a2;}['_applyCalculationStyles'](_0x5b68ff,_0x47298e){this['_config']['cssClasses']['calculationContainer']&&_0x5b68ff['classList']['add'](this['_config']['cssClasses']['calculationContainer']),_0x5b68ff['style']['width']=_0x47298e,_0x5b68ff['style']['position']='absolute',_0x5b68ff['style']['top']='-9999px',_0x5b68ff['style']['left']='-9999px',_0x5b68ff['style']['opacity']='0',_0x5b68ff['style']['pointerEvents']='none',_0x5b68ff['style']['zIndex']='-1',_0x5b68ff['style']['visibility']='visible\x20!important',_0x5b68ff['style']['display']='block\x20!important',_0x5b68ff['style']['boxSizing']='border-box';}['_restoreAncestorVisibility'](_0x69c545){_0x69c545['forEach'](({element:_0x32de8b,originalDisplay:_0xd2d947,originalVisibility:_0x39bd7d})=>{_0x32de8b['style']['display']=_0xd2d947,_0x32de8b['style']['visibility']=_0x39bd7d;});}['_makeAncestorsVisible'](_0x561eb4){const _0x4be3b5=[];let _0x1f7aff=_0x561eb4;for(;_0x1f7aff&&_0x1f7aff!==document['body'];){const _0x326d76=window['getComputedStyle'](_0x1f7aff);'none'!==_0x326d76['display']&&'hidden'!==_0x326d76['visibility']||(_0x4be3b5['push']({'element':_0x1f7aff,'originalDisplay':_0x1f7aff['style']['display'],'originalVisibility':_0x1f7aff['style']['visibility']}),_0x1f7aff['style']['display']='block',_0x1f7aff['style']['visibility']='visible'),_0x1f7aff=_0x1f7aff['parentElement'];}return _0x4be3b5;}['_createContainerElements'](){let _0xf9ac24,_0x2e05aa;return this['_parentView']?.['element']?(_0xf9ac24=this['_parentView']['element']['cloneNode'](!0x0),_0x2e05aa=this['_findTargetContainer'](_0xf9ac24)):(_0xf9ac24=document['createElement']('div'),_0x2e05aa=_0xf9ac24),{'calculationContainer':_0xf9ac24,'targetContainer':_0x2e05aa};}['_createCalculationContainer'](){const {calculationContainer:_0x573363,targetContainer:_0x3b2ef4}=this['_createContainerElements'](),_0x229144=this['_calculateContainerWidth']();this['_applyCalculationStyles'](_0x573363,_0x229144);const _0x3b2290=this['_parentView']?.['element']||this['_containerElement'],_0x51f5c7=_0x3b2290?.['parentElement'];_0x51f5c7?_0x51f5c7['appendChild'](_0x573363):document['body']['appendChild'](_0x573363),_0x573363['_targetContainer']=_0x3b2ef4;const _0x2c5710=this['_makeAncestorsVisible'](_0x51f5c7||null);return _0x573363['offsetWidth'],_0x573363['_ancestorsToRestore']=_0x2c5710,_0x573363;}['_calculateOverflowInContainer'](_0x32cec1,_0x5e4741){const _0x1198d7=_0x32cec1['_targetContainer']||_0x32cec1,_0x5defba=[],{rowCount:_0x1183cc}=this['_renderChipsAndCountRows'](_0x1198d7,_0x5e4741);if(_0x1183cc<=this['_config']['maxVisibleRows'])return _0x5defba;const _0x4112dd=_0x5e4741['slice']();for(;_0x4112dd['length']>0x0;){if(this['_testButtonFit'](_0x32cec1,_0x1198d7,_0x4112dd)){const _0x32bfff=_0x5e4741['filter'](_0x208445=>!_0x4112dd['includes'](_0x208445));_0x5defba['push'](..._0x32bfff);break;}if(!_0x4112dd['pop']())break;}return _0x5defba;}['_renderChipsAndCountRows'](_0x37ef67,_0x15ba38){_0x37ef67['innerHTML']='',_0x15ba38['forEach'](_0x42b1d8=>{if(_0x42b1d8['element']){const _0x51d957=_0x42b1d8['element']['cloneNode'](!0x0);_0x37ef67['appendChild'](_0x51d957);}}),_0x37ef67['offsetWidth'];const _0x44aedb=_0x37ef67['children'],_0x2855c1=[];return Array['from'](_0x44aedb)['forEach'](_0x33723d=>{const _0x5237c6=_0x33723d['getBoundingClientRect']()['top'];_0x2855c1['some'](_0x3b1a18=>Math['abs'](_0x3b1a18-_0x5237c6)<this['_config']['rowDetectionTolerance'])||_0x2855c1['push'](_0x5237c6);}),{'rowCount':_0x2855c1['length']};}['_createMockButton'](){const _0x2e4504=document['createElement']('button');return _0x2e4504['className']=this['_config']['cssClasses']['showMoreButton'],this['_config']['cssClasses']['controlsButton']&&_0x2e4504['classList']['add'](this['_config']['cssClasses']['controlsButton']),_0x2e4504['textContent']='+\x201',_0x2e4504;}['_testButtonFit'](_0x5ba907,_0x3e2abd,_0xbc6ae5){this['_renderChipsAndCountRows'](_0x3e2abd,_0xbc6ae5);const _0x135370=this['_createMockButton']();_0x5ba907['appendChild'](_0x135370),_0x5ba907['offsetWidth'];const _0x2ba4e0=[..._0x3e2abd['children'],_0x135370],_0x465535=[];_0x2ba4e0['forEach'](_0x1ed299=>{const _0x1125f0=_0x1ed299['getBoundingClientRect']()['top'];_0x465535['some'](_0x37b0e9=>Math['abs'](_0x37b0e9-_0x1125f0)<this['_config']['rowDetectionTolerance'])||_0x465535['push'](_0x1125f0);});const _0x402915=_0x465535['length'];return _0x135370['remove'](),_0x402915<=this['_config']['maxVisibleRows'];}['_distributeChips'](_0x49209d,_0x5b39cf){this['_visibleChips']['clear'](),this['_overflowChips']['clear'](),_0x49209d['forEach'](_0x4d99e6=>{_0x5b39cf['includes'](_0x4d99e6)?this['_overflowChips']['add'](_0x4d99e6):this['_visibleChips']['add'](_0x4d99e6);});}['_updateOverflowUI'](_0x107948){if(_0x107948>0x0&&!this['_showMoreButtonView']&&this['_createShowMoreButton'](),_0x107948>0x0&&this['_showMoreButtonView']){const _0x1ab795=''+this['_config']['showMoreLabelPrefix']+(_0x107948<0x63?_0x107948:'99');this['_showMoreButtonView']['label']=_0x1ab795;}this['_updateBalloonContent'](),this['_updateShowMoreButtonVisibility'](),this['_repinBalloonPanel']();}['_applyOverflowResults'](_0x5f340d,_0x2e095f){this['_distributeChips'](_0x5f340d,_0x2e095f),this['_updateOverflowUI'](_0x2e095f['length']);}['_setupVisibilityObserver'](){this['_containerElement']&&'undefined'!=typeof IntersectionObserver&&(this['_intersectionObserver']=new IntersectionObserver(_0x4fc810=>{_0x4fc810[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 _0x363710=this['_containerElement']['getBoundingClientRect']();if(0x0===_0x363710['width']||0x0===_0x363710['height'])return!0x1;const _0xf5ee93=window['innerHeight']||document['documentElement']['clientHeight'],_0x1fbb61=window['innerWidth']||document['documentElement']['clientWidth'],_0x453803=0xc8;return _0x363710['bottom']>=-0xc8&&_0x363710['top']<=_0xf5ee93+_0x453803&&_0x363710['right']>=-0xc8&&_0x363710['left']<=_0x1fbb61+_0x453803;}}const Bn='ck-ai-chat__feed__context-chips',Gn='ck-ai-chat-context-chips-wrapper',Fn='ck-ai-chat-context-chips-wrapper-balloon',Kn='ck-ai-chat-controls-button',Wn='ck-ai-chat-controls_context_show-more-button',Yn='ck-ai-chat-context-controls__show-more-balloon-panel';class $n extends Nt{['_contextChips']=this['createCollection']();['_overflowManager'];['_bodyCollection'];constructor(_0x13fcd5,_0x3676d7,_0xe61c67){super(_0x13fcd5),this['_bodyCollection']=_0xe61c67,this['_createContextChips'](_0x3676d7);const _0x327419={'cssClasses':{'showMoreButton':Wn+'\x20'+ds,'showMoreBalloon':Yn,'overflowContainer':Fn,'controlsButton':Kn}};this['_overflowManager']=new Vn(_0x13fcd5,this['_contextChips'],_0x327419,this['_bodyCollection'],this),this['setTemplate']({'tag':'div','attributes':{'class':[Bn,'ck','ck-reset_all']},'children':[{'tag':'div','attributes':{'class':Gn},'children':this['_contextChips']}]});}['render'](){super['render']();const _0x2bf08a=this['element']['querySelector']('.'+Gn);_0x2bf08a&&(this['_overflowManager']['setContainerElement'](_0x2bf08a),this['_overflowManager']['reorganizeChips']());}['destroy'](){super['destroy'](),this['_overflowManager']['destroy']();}['_createContextChips'](_0x5ed476){for(const _0x19dab7 of _0x5ed476){const _0x5050a0=new Pn(this['locale'],_0x19dab7,!0x0,!0x1);this['_contextChips']['add'](_0x5050a0);}}}class qn extends rn{['_contextChipsView']=null;['_locale'];['_bodyCollection'];['_messageContentView'];constructor(_0x40f762,_0x56f95a,_0xb76c2d){super(_0x56f95a),this['_locale']=_0x40f762,this['_bodyCollection']=_0xb76c2d,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 $n(this['_locale'],this['options']['contextItems']['filter'](_0x221eac=>!_0x221eac['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 Qn extends rn{['capabilities'];constructor(_0x1f9ccb,_0x9c1314){super(_0x9c1314);const {isWebSearchEnabled:_0x1c4e11,isReasoningEnabled:_0x34a030}=_0x9c1314['capabilities'],_0x282e57=[];let _0x2763c6='';_0x1c4e11&&_0x34a030?(_0x2763c6=cs(_0x1f9ccb,'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH_REASONING'),_0x282e57['push'](Xn(_0x182219)),_0x282e57['push'](Xn(_0x499404))):_0x1c4e11?(_0x2763c6=cs(_0x1f9ccb,'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH'),_0x282e57['push'](Xn(_0x182219))):_0x34a030&&(_0x2763c6=cs(_0x1f9ccb,'AI_CHAT_FEED_REPLY_ITEM_USED_REASONING'),_0x282e57['push'](Xn(_0x499404))),this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__interaction-header',_0x2763c6?'':'ck-hidden']}});const _0x13e672=new Nt();_0x13e672['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__interaction-header__capabilities']},'children':[..._0x282e57,{'tag':'span','attributes':{'class':['ck-ai-chat__feed__interaction-header__capabilities__text']},'children':[_0x2763c6]}]}),this['children']['add'](_0x13e672),this['capabilities']=_0x9c1314['capabilities'];}}function Xn(_0x673f9f){const _0x41d823=new yt();return _0x41d823['content']=_0x673f9f,_0x41d823;}const zn=['wheel','touchstart','pointerdown','keydown'],jn=['ArrowUp','ArrowDown','PageUp','PageDown','Home','End','\x20'];class Jn{['element'];['animationFrameId'];['isRunning'];['abortController'];['isUserPaused'];constructor(_0x27b8e7){this['element']=_0x27b8e7,this['animationFrameId']=null,this['isRunning']=!0x1,this['abortController']=new AbortController(),this['isUserPaused']=!0x1;for(const _0x48960d of zn){const _0x376e6c='keydown'!==_0x48960d;this['element']['addEventListener'](_0x48960d,this['_onUserEvent']['bind'](this),{'passive':_0x376e6c,'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'](_0x4c0a2a){if(this['isRunning']){if('keydown'===_0x4c0a2a['type']){const _0x3f318f=_0x4c0a2a['key'];if(!jn['includes'](_0x3f318f))return;}_0x4c0a2a instanceof WheelEvent?_0x4c0a2a['deltaY']<0x0?this['isUserPaused']=!0x0:this['isUserPaused']=!this['_isAtBottom']():this['isUserPaused']=!0x0;}}['_isAtBottom'](){const {scrollTop:_0x1b4a32,scrollHeight:_0x38238f,clientHeight:_0x1b273e}=this['element'];return _0x38238f-_0x1b4a32-_0x1b273e<=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(_0x19915f,_0x111c58){super(_0x19915f),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-skeleton']},'children':this['_createSkeletonItems'](_0x111c58)});}['_createSkeletonItems'](_0x154bf2){const _0x110797=['ck','ck-ai-skeleton__item'];return _0x154bf2['map'](_0x117069=>{let _0x155dad='';switch(_0x117069['attributes']['align']){case'right':_0x155dad='margin-left:\x20auto;\x20margin-right:\x200;\x20text-align:\x20right;';break;case'center':_0x155dad='margin-left:\x20auto;\x20margin-right:\x20auto;\x20text-align:\x20center;';break;case'left':_0x155dad='margin-left:\x200;\x20margin-right:\x20auto;\x20text-align:\x20left;';}return{'tag':_0x117069['tag'],'attributes':{'class':[..._0x110797,_0x117069['attributes']['class']?_0x117069['attributes']['class']:''],'style':'width:\x20'+_0x117069['attributes']['width']+';\x20height:\x20'+_0x117069['attributes']['height']+';'+_0x155dad}};});}}const tr={'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':er(0x5,'100%','44px','right'),'aiChatResources':er(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 er(_0x8797a4,_0x51feaf,_0x19cf2d,_0x3fa65c){return new Array(_0x8797a4)['fill'](null)['map'](()=>({'tag':'div','attributes':{'width':_0x51feaf,'height':_0x19cf2d,'align':_0x3fa65c}}));}class ir extends rn{constructor(_0x1a8cad){super(_0x1a8cad),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 sr extends Nt{['children'];['scrollManager'];['_bodyCollection'];constructor(_0x24ca24,_0x4c9ef2){super(_0x24ca24),this['_bodyCollection']=_0x4c9ef2,this['set']('isPending',!0x1),this['set']('loadingMessage',''),this['set']('isLoadingSkeletonVisible',!0x1),this['set']('isTrackChangesOn',!0x1),this['children']=this['createCollection'](),this['children']['delegate'](...Js)['to'](this),this['_setupTemplate']();}['render'](){super['render'](),this['scrollManager']=new Jn(this['element']);}['destroy'](){super['destroy'](),this['scrollManager']['destroy']();}['clear'](){this['children']['clear']();}['addItem'](_0x19dbce,_0x2de213){let _0x139073;return'ai-reply'===_0x19dbce?_0x139073=new bn(this['locale'],_0x2de213,this['_bodyCollection']):'ai-suggestion-reply'===_0x19dbce?(_0x139073=new Sn(this['locale'],_0x2de213,this['_bodyCollection']),_0x139073['bind']('isTrackChangesOn')['to'](this)):_0x139073='user-message'===_0x19dbce?new qn(this['locale'],_0x2de213,this['_bodyCollection']):'interaction-header'===_0x19dbce?new Qn(this['locale'],_0x2de213):'custom-element'===_0x19dbce?new ir(_0x2de213):new En(_0x2de213),this['children']['add'](_0x139073),_0x139073;}async['updateReplyItem']({id:_0x3570df,parsedContent:_0x296a48,renderingStrategy:_0x2f61a6,abortSignal:_0x26a756}){const _0x357707=this['getItemById'](_0x3570df);if(!(_0x357707 instanceof bn))throw new ot('ai-chat-feed-view-item-not-a-reply-item',null,{'itemView':_0x357707,'id':_0x3570df,'parsedContent':_0x296a48});await _0x357707['updateContent']({'parsedContent':_0x296a48,'renderingStrategy':_0x2f61a6,'abortSignal':_0x26a756});}async['updateWebSources'](_0x40002e,_0x47dde7){const _0x3c60eb=this['getItemById'](_0x40002e);if(_0x3c60eb instanceof Sn)_0x3c60eb['updateSources'](_0x47dde7);else{if(!(_0x3c60eb instanceof bn))throw new ot('ai-chat-feed-view-item-not-a-suggestion-or-reply-item',null,{'itemView':_0x3c60eb,'id':_0x40002e,'sources':_0x47dde7});_0x3c60eb['updateSources'](_0x47dde7);}}async['updateSuggestionItem']({id:_0x1a78a0,parts:_0x632f78,renderingStrategy:_0x25f3f6,abortSignal:_0x1a5d34}){const _0x260983=this['getItemById'](_0x1a78a0);if(!(_0x260983 instanceof Sn))throw new ot('ai-chat-feed-view-item-not-a-suggestion-item',null,{'itemView':_0x260983,'id':_0x1a78a0,'parts':_0x632f78});await _0x260983['updateContent']({'parts':_0x632f78,'renderingStrategy':_0x25f3f6,'abortSignal':_0x1a5d34});}['updateSuggestionPartState']({id:_0x2f7707,index:_0x37a0e9,state:_0x2dc02e}){const _0x4db091=this['getItemById'](_0x2f7707);if(!(_0x4db091 instanceof Sn))throw new ot('ai-chat-feed-view-item-not-a-suggestion-item',this,{'id':_0x2f7707});_0x4db091['updatePartState'](_0x37a0e9,_0x2dc02e);}['setSuggestionPartActive']({id:_0x25fffe,index:_0xeb8b86,isActive:_0x12cf52}){const _0x237951=this['getItemById'](_0x25fffe);if(!(_0x237951 instanceof Sn))throw new ot('ai-chat-feed-view-item-not-a-suggestion-item',this,{'id':_0x25fffe});this['children']['filter'](_0x24195e=>_0x24195e instanceof Sn)['forEach'](_0x1c8167=>{_0x1c8167['setPartActive'](!0x1);}),_0x237951['setPartActive'](_0xeb8b86,_0x12cf52);}['markItemAsDone'](_0x220be7){this['getItemById'](_0x220be7)['markAsDone']();}['getItemIds'](){return this['children']['map'](_0x584eba=>_0x584eba['options']['id']);}['removeItem'](_0x28e9b9){this['children']['remove'](this['getItemById'](_0x28e9b9));}['hasItem'](_0x401ab6){return!!this['children']['find'](_0x12fa8f=>_0x12fa8f['options']['id']['includes'](_0x401ab6));}['scrollToSuggestion'](_0x46dc1f,_0x3dd25c){const _0x6d9c4a=this['getItemById'](_0x46dc1f);if(!(_0x6d9c4a instanceof Sn))return void pt('ck-ai-chat-feed-view-scroll-to-suggestion-invalid-item',{'replyId':_0x46dc1f,'partIndex':_0x3dd25c});const _0x29ea91=_0x6d9c4a['getPartView'](_0x3dd25c);_0x29ea91?wt(_0x29ea91['element'],0x14,this['element']['parentElement'],!0x0,!0x0):pt('ck-ai-chat-feed-view-scroll-to-suggestion-part-view-not-found',{'replyId':_0x46dc1f,'partIndex':_0x3dd25c});}['_setupTemplate'](){this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed']},'children':this['_createTemplateChildren']()});}['_createTemplateChildren'](){const _0x3479cc=this['_createSkeletonLoader']();return[this['_createFeedItems'](),_0x3479cc,this['_createFeedLoader']()];}['_createSkeletonLoader'](){const _0x4f49c2=new Zn(this['locale'],tr['aiFeed']);return _0x4f49c2['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isLoadingSkeletonVisible','ck-hidden',_0xcfc6c0=>!_0xcfc6c0)]}}),_0x4f49c2;}['_createFeedItems'](){const _0x19ef0a=new Nt(this['locale']);return _0x19ef0a['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__items',this['bindTemplate']['if']('isLoadingSkeletonVisible','ck-hidden')]},'children':this['children']}),_0x19ef0a;}['_createFeedLoader'](){const _0x1d37d4=new Nt(this['locale']);return _0x1d37d4['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__loader',this['bindTemplate']['if']('isPending','ck-hidden',_0x2170ef=>!_0x2170ef)]},'children':this['_createLoaderChildren']()}),_0x1d37d4;}['_createLoaderChildren'](){const _0x5156dd=new Rn();return _0x5156dd['isVisible']=!0x0,[_0x5156dd,{'tag':'span','attributes':{'class':['ck','ck-ai-chat__loader-text']},'children':[{'text':this['bindTemplate']['to']('loadingMessage')}]}];}['getItemById'](_0x3cc740){const _0x16eff2=this['children']['find'](_0x2ea7f1=>_0x2ea7f1['options']['id']['includes'](_0x3cc740));if(!_0x16eff2)throw new ot('ai-chat-feed-view-item-not-found',this,{'id':_0x3cc740});return _0x16eff2;}['setLoadingMessage'](_0x26aa5a){this['set']('loadingMessage',_0x26aa5a);}['toggleLoadingSkeleton'](_0x294a91){this['set']('isLoadingSkeletonVisible',_0x294a91);}['startAutoScroll'](){this['scrollManager']['start']();}['stopAutoScroll'](){this['scrollManager']['stop']();}}class nr extends Lt{['filter'](){let _0x31274d=0x0;for(const _0x429c0d of this['items'])_0x31274d+=_0x429c0d['items']['length'];return{'resultsCount':_0x31274d,'totalItemsCount':_0x31274d};}}const rr='ck-ai-chat__prompt-input_highlighted';class ar extends xt{['submitButtonView'];static ['MIN_ROWS']=0x1;static ['MAX_ROWS']=0xc;['_addContextButtonView'];['_queryViewResizeObserver'];constructor(_0x3a2c11,_0x58d67c){super(_0x3a2c11,{'queryView':{'label':'','creator':Ut,'showIcon':!0x1,'showResetButton':!0x1},'filteredView':new nr(_0x3a2c11),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1}),this['set']('isEmpty',!0x0),this['set']('isUploadInProgress',!0x1),this['_addContextButtonView']=_0x58d67c,this['_queryViewResizeObserver']=null,this['queryView']['fieldView']['minRows']=ar['MIN_ROWS'],this['queryView']['fieldView']['maxRows']=ar['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',(_0x5793e0,_0x16d44c)=>!_0x5793e0&&!_0x16d44c),this['focusableChildren']['add'](this['submitButtonView']);}['render'](){super['render'](),this['queryView']['fieldWrapperChildren']['add'](this['submitButtonView']),this['keystrokes']['set']('enter',(_0x169b1,_0xe743a3)=>{this['isUploadInProgress']||this['isEmpty']||_0x169b1['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0xe743a3());}),this['queryView']['fieldView']['on']('update',()=>{this['isEmpty']=''===this['queryView']['fieldView']['element']['value']?.['trim']();});}['destroy'](){super['destroy'](),this['_queryViewResizeObserver']&&this['_queryViewResizeObserver']['destroy']();}['submit'](){const _0x1858a9=this['queryView']['fieldView']['element']['value']?.['trim']();if(!_0x1858a9)return this['queryView']['errorText']=cs(this['locale'],'AI_CHAT_PROMPT_EMPTY_ERROR'),void(this['queryView']['fieldView']['hasError']=!0x0);this['queryView']['fieldView']['hasError']=!0x1;const _0x1b5001=_0x316a01(_0x1858a9);this['fire']('sendUserMessage',_0x1b5001),this['queryView']['fieldView']['reset']();}['setPlaceholderText'](_0x54c281){this['queryView']['fieldView']['set']('placeholder',_0x54c281);}['focus'](_0x2d202c=!0x1){super['focus'](),_0x2d202c&&(this['element']['classList']['contains'](rr)||(this['element']['classList']['add'](rr),setTimeout(()=>{this['element']['classList']['remove'](rr);},0x320)));}['_createSubmitButton'](){const _0x565ac1=new kt(this['locale']);return _0x565ac1['set']({'icon':_0x5b23cb,'label':cs(this['locale'],'AI_CHAT_LABEL_SUBMIT'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-chat__prompt-submit-button\x20'+ls,'isEnabled':!0x1}),_0x565ac1['on']('execute',()=>{this['submit']();}),_0x565ac1;}['setIsUploadInProgress'](_0x27bf83){this['isUploadInProgress']=_0x27bf83;}['_setUpAddContextButtonPositioning'](){const _0x3af588=this['locale'],_0x58b327=()=>{ct['window']['requestAnimationFrame'](()=>{if(lt(this['element'])){const _0x2b4d31=new ut(this['queryView']['fieldView']['element']),_0x139214=new ut(this['_addContextButtonView']['element']),_0x28fc57=_0x2b4d31['width'],_0x582ea0='rtl'===_0x3af588['uiLanguageDirection']?'right':'left';_0x2b4d31['excludeScrollbarsAndBorders']();const _0x1f3b8f=_0x28fc57-_0x2b4d31['width']+0x1;this['_addContextButtonView']['element']['style'][_0x582ea0]='calc('+(_0x28fc57-_0x139214['width']-_0x1f3b8f)+'px\x20-\x20var(--ck-spacing-tiny))';}});};this['queryView']['fieldView']['on']('update',_0x58b327),this['on']('render',()=>{_0x58b327(),this['_queryViewResizeObserver']=new ft(this['queryView']['fieldView']['element'],()=>{_0x58b327();});});}}const or='ck-ai-chat__prompt-capabilities',hr='ck-ai-chat-controls-button',cr='ck-ai-chat-controls-button--commands',lr='ck-ai-chat-controls__model-selection',ur='ck-ai-chat-controls__model-selection__item-name',dr='ck-ai-chat-controls__model-selection__item-description',_r='ck-ai-chat-controls__model-selection__item-capabilities',Ar='n';class gr extends Nt{['_webSearchButton'];['_reasoningButton'];['_commandsButton'];['_modelSelectionDropdown'];['_modelSelectionDropdownItems'];['_modelNameView'];constructor(_0x361c2e){super(_0x361c2e),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',_0x1e948c=>'selector'===_0x1e948c),this['_modelSelectionDropdown']['buttonView']['bind']('tooltip')['to'](this,'modelSelectorEnabled',_0x423202=>_0x423202?this['_modelSelectionDropdown']['buttonView']['label']:cs(this['locale'],'AI_CHAT_MODEL_SELECTOR_DISABLED_TOOLTIP')),this['_modelSelectionDropdown']['bind']('isEnabled')['to'](this,'modelSelectorEnabled',_0x4cb60b=>_0x4cb60b),this['_webSearchButton']['bind']('isOn')['to'](this,'webSearchActive',_0x406fe7=>_0x406fe7),this['_webSearchButton']['bind']('tooltip')['to'](this,'webSearchActive',_0x59e468=>cs(this['locale'],_0x59e468?'AI_CHAT_DISABLE_WEB_SEARCH':'AI_CHAT_ENABLE_WEB_SEARCH')),this['_reasoningButton']['bind']('isOn')['to'](this,'reasoningActive',_0x16f4c0=>_0x16f4c0),this['_reasoningButton']['bind']('tooltip')['to'](this,'reasoningActive',_0x28c9b3=>cs(this['locale'],_0x28c9b3?'AI_CHAT_DISABLE_REASONING':'AI_CHAT_ENABLE_REASONING')),this['setTemplate']({'tag':'div','attributes':{'class':[or]},'children':[this['_modelSelectionDropdown'],this['_modelNameView'],this['_webSearchButton'],this['_reasoningButton'],this['_commandsButton']]}),this['_modelSelectionDropdownItems']=new dt(),zt(this['_modelSelectionDropdown'],this['_modelSelectionDropdownItems']);}['setModelList'](_0x41a030,_0xf2e3dc){if(_0xf2e3dc)this['set']('modelDisplayMode','hidden');else{const _0x5613ad=0x1===_0x41a030['length'];this['set']('modelDisplayMode',_0x5613ad?'name':'selector');}if(this['_modelSelectionDropdownItems']['clear'](),_0x41a030?.['length'])for(const _0x36e4b0 of _0x41a030){const _0x31401e=new jt({'label':_0x36e4b0['name'],'withText':!0x0,'role':'menuitemradio','id':_0x36e4b0['id'],'model':_0x36e4b0});_0x31401e['bind']('isOn')['to'](this,'activeModelId',_0x1cd8be=>_0x1cd8be===_0x36e4b0['id']),this['_modelSelectionDropdownItems']['add']({'type':'button','model':_0x31401e,'labelView':new Ir(this['locale'],_0x36e4b0)});}}['setWebSearch'](_0x57b95c){this['set']('webSearchActive',_0x57b95c);}['setReasoning'](_0x1daa74){this['set']('reasoningActive',_0x1daa74);}['setModel'](_0x217cf9){if(!_0x217cf9)return;this['activeModelId']=_0x217cf9['id'],this['activeModelName']=_0x217cf9['name']||_0x217cf9['id'],this['_modelSelectionDropdown']['buttonView']['set']('label',_0x217cf9['name']),this['_modelSelectionDropdown']['buttonView']['set']('tooltip',_0x217cf9['name']);const _0x2e5d48=_0x217cf9['capabilities']['webSearch']?.['enabled']??!0x1;this['set']('webSearchActive',!0x1),this['_webSearchButton']['set']('isOn',!0x1),this['_webSearchButton']['set']('isEnabled',_0x2e5d48),this['_webSearchButton']['set']('isVisible',_0x2e5d48);const _0x454204=_0x217cf9['capabilities']['reasoning']?.['enabled']??!0x1;this['set']('reasoningActive',!0x1),this['_reasoningButton']['set']('isOn',!0x1),this['_reasoningButton']['set']('isEnabled',_0x454204),this['_reasoningButton']['set']('isVisible',_0x454204);}['enableModelSelector'](){this['set']('modelSelectorEnabled',!0x0);}['disableModelSelector'](_0x2e12f2){this['set']('modelSelectorEnabled',!0x1),_0x2e12f2&&this['set']('modelDisplayMode','hidden');}['_createWebSearchButton'](){const _0x1e263a=new kt();return _0x1e263a['set']({'label':cs(this['locale'],'AI_CHAT_SEARCH_WEB'),'icon':_0x182219,'class':hr+'\x20'+ds,'isToggleable':!0x0,'tooltipPosition':Ar}),_0x1e263a['on']('execute',()=>{this['fire']('toggleWebSearch');}),_0x1e263a;}['_createReasoningButton'](){const _0x29d8d3=new kt();return _0x29d8d3['set']({'label':cs(this['locale'],'AI_CHAT_REASONING'),'icon':_0x499404,'class':hr+'\x20'+ds,'isToggleable':!0x0,'tooltipPosition':Ar}),_0x29d8d3['on']('execute',()=>{this['fire']('toggleReasoning');}),_0x29d8d3;}['_createCommandsButton'](){const _0x4eb348=new kt();return _0x4eb348['set']({'label':cs(this['locale'],'AI_CHAT_COMMANDS'),'icon':_0x4a4be2,'withText':!0x0,'class':hr+'\x20'+ds,'isToggleable':!0x0,'tooltip':cs(this['locale'],'AI_CHAT_COMMANDS'),'tooltipPosition':Ar}),_0x4eb348['extendTemplate']({'attributes':{'class':[cr]}}),_0x4eb348['on']('execute',()=>{console['log']('Commands\x20are\x20not\x20implemented\x20yet.'),alert('Commands\x20are\x20not\x20implemented\x20yet.');}),_0x4eb348;}['_createModelSelectionDropdown'](){const _0x44580e=Bt(this['locale']);return _0x44580e['set']({'panelPosition':'ne','class':[lr]}),_0x44580e['buttonView']['set']({'label':cs(this['locale'],'AI_CHAT_MODEL_SELECTOR_ENABLED_TOOLTIP'),'withText':!0x0,'tooltip':!0x0,'tooltipPosition':Ar,'class':ds}),this['listenTo'](_0x44580e,'execute',_0x1da68f=>{this['fire']('selectModel',_0x1da68f['source']['model']);}),_0x44580e;}['_createModelNameView'](){const _0x5b8e3b=new Er(this['locale']);return _0x5b8e3b['bind']('text')['to'](this,'activeModelName',_0x1e92de=>_0x1e92de??''),_0x5b8e3b['bind']('isVisible')['to'](this,'modelDisplayMode',_0x3e3fcc=>'name'===_0x3e3fcc),_0x5b8e3b;}}let Ir=class extends Ht{constructor(_0xa388e4,_0x7b115f){super();const _0x220f62=this['bindTemplate'],_0x4aeafd=this['createCollection']();this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-button__label'],'style':_0x220f62['to']('style'),'id':_0x220f62['to']('id')},'children':[{'tag':'div','attributes':{'class':[ur]},'children':[{'text':_0x220f62['to']('text')}]},{'tag':'div','attributes':{'class':[dr]},'children':[{'tag':'span','children':[{'text':_0x7b115f['description']}]}]},{'tag':'div','attributes':{'class':[_r]},'children':_0x4aeafd}]}),_0x4aeafd['addMany'](this['_getCapabilityParts'](_0xa388e4,_0x182219,'AI_CHAT_SEARCH_WEB',_0x7b115f['capabilities']['webSearch']?.['enabled']??!0x1)),_0x4aeafd['addMany'](this['_getCapabilityParts'](_0xa388e4,_0x499404,'AI_CHAT_REASONING',_0x7b115f['capabilities']['reasoning']?.['enabled']??!0x1));}['_getCapabilityParts'](_0x411f18,_0x6d9263,_0x40a37d,_0x5dac83){const _0x1c12a2=new yt();_0x1c12a2['content']=_0x6d9263;const _0x385231=new Nt(_0x411f18);_0x385231['setTemplate']({'tag':'span','children':[{'text':cs(_0x411f18,_0x40a37d)+':\x20'}]});const _0x3d4fca=new Nt(_0x411f18);return _0x3d4fca['setTemplate']({'tag':'span','children':[{'text':cs(_0x411f18,_0x5dac83?'AI_CHAT_CAPABILITIES_YES':'AI_CHAT_CAPABILITIES_NO')}]}),[_0x1c12a2,_0x385231,_0x3d4fca];}},Er=class extends Nt{constructor(_0x61312f){super(_0x61312f),this['set']('text',void 0x0),this['set']('isVisible',!0x0);const _0x3cb2bc=this['bindTemplate'];this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-chat-controls__model-name',_0x3cb2bc['if']('isVisible','ck-hidden',_0x587a70=>!_0x587a70)]},'children':[{'text':_0x3cb2bc['to']('text')}]});}};const pr='ck-ai-chat-context-controls__url-form',Tr='ck-ai-chat-context-controls__url-input-section';class mr extends Nt{['focusTracker'];['keystrokes'];['_focusables'];['focusCycler'];['urlInputField'];['backButton'];['confirmButton'];constructor(_0x487ffe){super(_0x487ffe),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'](_0x14ac3e=>{this['focusTracker']['add'](_0x14ac3e['element']),this['keystrokes']['listenTo'](_0x14ac3e['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'](_0x295c50){this['urlInputField']['errorText']=_0x295c50,this['_updateConfirmButtonState'](),this['fire']('refreshBalloon');}['clearError'](){this['urlInputField']['errorText']=null,this['_updateConfirmButtonState']();}['_createBackButton'](){const _0x5d0620=new kt(this['locale']);return _0x5d0620['set']({'icon':_0x11b6ce,'tooltip':cs(this['locale'],'AI_CHAT_CONTEXT_URL_BACK_TO_CONTEXT'),'tooltipPosition':'n','class':['ck-button-icon\x20ck-button-back']}),this['on']('change:withBackButton',(_0x1c0a7d,_0x1c0e2b,_0x55cd6c)=>{_0x5d0620['set']({'class':['ck-button-icon\x20ck-button-back'+(_0x55cd6c?'':'\x20ck-hidden')]});}),_0x5d0620;}['_createUrlInputField'](){const _0x5453de=new Zt(this['locale'],te);return _0x5453de['set']({'label':cs(this['locale'],'AI_CHAT_CONTEXT_URL_LABEL'),'class':'ck-labeled-field-view_empty'}),_0x5453de['fieldView']['set']({'placeholder':cs(this['locale'],'AI_CHAT_CONTEXT_URL_PLACEHOLDER')}),_0x5453de;}['_createConfirmButton'](){const _0x56809b=new kt(this['locale']);return _0x56809b['set']({'icon':_0x1d53d5,'tooltip':cs(this['locale'],'AI_CHAT_CONTEXT_URL_ADD_URL'),'tooltipPosition':'n','class':'ck-button-icon','type':'submit','isEnabled':!0x1}),_0x56809b;}['_setupTemplate'](){const _0x5b042e=new _0x17eb16(this['locale'],{'label':cs(this['locale'],'AI_CHAT_CONTEXT_URL_ADD_URL'),'class':'ck-ai-header\x20ck-ai-header_small\x20ck-ai-header_context-url'});_0x5b042e['children']['add'](this['backButton'],0x0),this['setTemplate']({'tag':'form','attributes':{'class':pr,'tabindex':'-1'},'children':[_0x5b042e,{'tag':'div','attributes':{'class':Tr},'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',_0x6070af=>{_0x6070af['stop'](),this['_handleSubmit']();});}['_setupKeystrokes'](){this['keystrokes']['set']('esc',(_0x538ce6,_0x50d2bd)=>{this['clear'](),this['fire']('cancel'),_0x50d2bd();});}['_handleSubmit'](){const _0x282587=this['getValue']()['trim']();_0x282587?this['_isValidUrl'](_0x282587)?(this['clearError'](),this['fire']('submitUrl',_0x282587)):this['setError'](cs(this['locale'],'AI_CHAT_CONTEXT_URL_INVALID_ERROR')):this['setError'](cs(this['locale'],'AI_CHAT_CONTEXT_URL_EMPTY_ERROR'));}['_updateConfirmButtonState'](){const _0xd4fba1=this['getValue']()['trim'](),_0x5a8fd5=!!this['urlInputField']['errorText'];this['confirmButton']['isEnabled']=_0xd4fba1['length']>0x0&&!_0x5a8fd5;}['_isValidUrl'](_0x282344){try{return!!new URL(_0x282344);}catch{return!0x1;}}}const Cr='ck-ai-chat-resources__item',wr='ck-ai-chat-resources__item--in-context',fr='ck-ai-chat-resources__item-title',Sr='ck-ai-chat-resources__item__icon';class br extends Pt{['resource'];['_titleView'];['_iconView'];constructor(_0x174c3e,_0x3cc355){super(_0x174c3e),this['resource']=_0x3cc355,this['set']('isInContext',!!_0x3cc355['isInContext']),this['_titleView']=this['_createTitleView'](),this['_iconView']=this['_createIconView'](),this['_setupTemplate']();}['render'](){super['render']();}['getResourceIcon'](_0xce1c00){if(_0xce1c00['isInContext'])return _0x1d53d5;switch(_0xce1c00['type']){case'document':return _0x50a35b;case'web-resource':return _0x4b5c8c;case'file':case'text':return _0x3748e7;default:return _0x224477;}}['highlightText'](_0x3a0720){if(!_0x3a0720||''===_0x3a0720['trim']())return void this['_titleView']['highlightText'](null);const _0xeb7d72=new RegExp(_0x8cd30a(_0x3a0720),'gi');this['_titleView']['highlightText'](_0xeb7d72);}['updateResourceState'](_0x43cc64){this['resource']['isInContext']=_0x43cc64,this['isInContext']=_0x43cc64,this['_updateIcon']();}['_createTitleView'](){const _0x376431=new _0x3d1ec8();return _0x376431['text']=this['resource']['label'],_0x376431['extendTemplate']({'tag':'span','attributes':{'class':[fr]}}),_0x376431;}['_createIconView'](){const _0x14ff98=new yt();return _0x14ff98['content']=this['getResourceIcon'](this['resource']),_0x14ff98;}['_setupTemplate'](){const _0x3cfa28=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':[Cr,_0x3cfa28['if']('isVisible','ck-hidden',_0x3b15cf=>!_0x3b15cf),_0x3cfa28['if']('isInContext',wr)]},'children':[{'tag':'div','attributes':{'class':[Sr]},'children':[this['_iconView']]},this['_titleView']],'on':{'click':_0x3cfa28['to']('execute')}});}['_updateIcon'](){this['_iconView']['content']=this['getResourceIcon'](this['resource']);}}const Rr='ck-ai-chat-resources__list';class Or extends Lt{['_source'];constructor(_0x3b1ff8,_0x4169cd){super(_0x3b1ff8),this['_source']=_0x4169cd,this['extendTemplate']({'attributes':{'class':[Rr]}});}['setResources'](_0x5795de,_0x59c329){this['items']['clear']();let _0x15c09f=_0x5795de;if(this['_source']['useDefaultFiltering']&&_0x59c329&&''!==_0x59c329['trim']()){const _0x12e9fc=new RegExp(_0x59c329['replace'](/[.*+?^${}()|[\]\\]/g,'\x5c$&'),'gi');_0x15c09f=_0x5795de['filter'](_0x4ca873=>_0x12e9fc['test'](_0x4ca873['label']));}for(const _0x4fca0d of _0x15c09f){const _0xef8833=new br(this['locale'],_0x4fca0d);_0xef8833['on']('execute',()=>{this['_handleResourceSelection'](this['_source'],_0x4fca0d);}),this['items']['add'](_0xef8833);}this['_source']['useDefaultFiltering']&&this['highlightText'](_0x59c329);}['highlightText'](_0x503567){this['_source']['useDefaultFiltering']&&this['items']['forEach'](_0x2f44f8=>{_0x2f44f8['highlightText'](_0x503567);});}['updateResourceState'](_0x2fc6ee,_0x5f6505){for(const _0x1f0aed of this['items']){const _0x13b1c1=_0x1f0aed;_0x13b1c1['resource']['id']===_0x2fc6ee&&_0x13b1c1['updateResourceState'](_0x5f6505);}}['_handleResourceSelection'](_0x5879e2,_0x1c1b40){this['fire']('addResourceToContext',{'source':_0x5879e2,'resource':_0x1c1b40});}}class kr extends Zt{['iconView'];['resetButtonView'];['_viewConfig'];constructor(_0x172744){const t=_0x172744['t'],_0x3b0bde={'showResetButton':!0x0,'showIcon':!0x0,'creator':te,'label':cs(_0x172744,'AI_CHAT_SEARCH_RESOURCES')};super(_0x172744,_0x3b0bde['creator']),this['label']=_0x3b0bde['label'],this['_viewConfig']=_0x3b0bde,this['_viewConfig']['showIcon']&&this['_setupSearchIcon'](),this['_viewConfig']['showResetButton']&&this['_setupResetButton'](_0x172744,t),this['_setupEventListeners']();}['reset'](){this['fieldView']['reset'](),this['_viewConfig']['showResetButton']&&this['resetButtonView']&&(this['resetButtonView']['isVisible']=!0x1),this['search']('');}['search'](_0x809683){this['fire']('search',_0x809683);}['getQuery'](){return this['fieldView']['element']?.['value']||'';}['_setupSearchIcon'](){this['iconView']=new yt(),this['iconView']['content']=_0xfad3e1,this['fieldWrapperChildren']['add'](this['iconView'],0x0),this['extendTemplate']({'attributes':{'class':'ck-search__query_with-icon'}});}['_setupResetButton'](_0xe30e6f,t){this['resetButtonView']=new kt(_0xe30e6f),this['resetButtonView']['set']({'label':t('Clear'),'icon':_0x2a335e,'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',_0x581e0c=>!_0x581e0c),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 Nr extends Nt{['_searchView'];['_searchSection'];['_searchInputVisibleFrom'];['_resourcesListView'];['_skeletonLoader'];['_source'];['children'];['_latestLoadResourcesUid']=null;constructor(_0x5118ad,_0x24df50){super(_0x5118ad),this['_source']=_0x24df50['source'],this['_searchInputVisibleFrom']=_0x24df50['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 _0x534e2b([this['_skeletonLoader'],this['_resourcesListView']]),this['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-chat-resources'},'children':this['children']});}['_createSearchView'](){return new kr(this['locale']);}['_createSearchSection'](){const _0x3d8154=new Nt(this['locale']);return _0x3d8154['setTemplate']({'tag':'div','attributes':{'class':'ck\x20ck-search'},'children':[this['_searchView']]}),this['_searchView']['on']('search',(_0x55e798,_0xa4df69)=>{this['loadResources'](_0xa4df69),this['_source']['useDefaultFiltering']&&this['_resourcesListView']['highlightText'](_0xa4df69);}),_0x3d8154;}['_createResourcesListView'](){const _0x289a2f=new Or(this['locale'],this['_source']);return _0x289a2f['delegate']('addResourceToContext')['to'](this),_0x289a2f['extendTemplate']({'attributes':{'class':this['bindTemplate']['if']('isLoading','ck-hidden')}}),_0x289a2f;}['_createSkeletonView'](){const _0x469b5a=new Zn(this['locale'],tr['aiChatResources']);return _0x469b5a['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isLoading','ck-hidden',_0x2bcb76=>!_0x2bcb76)]}}),_0x469b5a;}['render'](){super['render'](),this['loadResources']('');}['loadResources'](_0x960040){const _0x17398c=at();this['_latestLoadResourcesUid']=_0x17398c,this['fire']('loadSourceResources',{'sourceId':this['_source']['id'],'query':_0x960040,'uid':_0x17398c}),this['isLoading']=!0x0;}['setResources'](_0x56a3bd,_0x26cb7d){if(_0x26cb7d&&_0x26cb7d!==this['_latestLoadResourcesUid'])return;const _0x48535f=this['_source']['useDefaultFiltering']?this['_searchView']['getQuery']():'';this['_resourcesListView']['setResources'](_0x56a3bd,_0x48535f),_0x56a3bd['length']>=this['_searchInputVisibleFrom']&&!this['children']['has'](this['_searchSection'])&&this['children']['add'](this['_searchSection'],0x0),requestAnimationFrame(()=>{this['isLoading']=!0x1;});}['updateResourceState'](_0x275693,_0x49d254){this['_resourcesListView']['updateResourceState'](_0x275693,_0x49d254);}}const vr='ck-ai-chat-context-controls__source-balloon-panel',yr='ck-button-icon\x20ck-button-back',xr='ck-ai-header\x20ck-ai-header_small\x20ck-ai-header_source';class Lr{['_sourceResourceBalloons']=new Map();['_bodyCollection'];['_locale'];['_config'];constructor(_0x596e85,_0x2deaa0,_0xb1efa3){this['_locale']=_0x596e85,this['_bodyCollection']=_0x2deaa0,this['_config']=_0xb1efa3;}['showSourceResourcesBalloon']({source:_0x55cd5a,withBackButton:_0x27f5b9}){let _0x596a53=this['_sourceResourceBalloons']['get'](_0x55cd5a['id']);_0x596a53||(_0x596a53=this['_createSourceResourceBalloonPanel'](),this['_sourceResourceBalloons']['set'](_0x55cd5a['id'],_0x596a53),this['_setupSingleResourceBalloonClickOutsideHandler'](_0x596a53)),this['_addSourceResourceContent']({'balloonPanel':_0x596a53,'source':_0x55cd5a,'withBackButton':_0x27f5b9}),_0x596a53['show']();const _0x2c10c8=this['_config']['getTargetElement']();_0x2c10c8&&_0x596a53['pin']({'target':_0x2c10c8,'limiter':this['_config']['getLimiterElement']()});}['populateSourceResourceBalloon'](_0x459f0f,_0x8fea2b,_0x182905){const _0x2c5984=this['_sourceResourceBalloons']['get'](_0x459f0f);if(!_0x2c5984)return;const _0x5ae2aa=this['_getResourcesViewFromBalloon'](_0x2c5984);_0x5ae2aa&&(_0x5ae2aa['setResources'](_0x8fea2b,_0x182905),_0x5ae2aa['once']('change:isLoading',()=>{_0x2c5984['pin']({'target':this['_config']['getTargetElement'](),'limiter':this['_config']['getLimiterElement']()});}));}['closeSourceResourceBalloon'](_0x546a19){const _0x1fa779=this['_sourceResourceBalloons']['get'](_0x546a19);_0x1fa779&&requestAnimationFrame(()=>{_0x1fa779['hide'](),this['_sourceResourceBalloons']['delete'](_0x546a19),this['_config']['onBalloonClosed']();});}['isAnyResourceBalloonVisible'](){for(const _0xdce6f7 of this['_sourceResourceBalloons']['values']())if(_0xdce6f7['isVisible'])return!0x0;return!0x1;}['updateResourceState'](_0x43d3cf,_0x5ede96,_0x3c5e00){const _0x34ff7f=this['_sourceResourceBalloons']['get'](_0x43d3cf);if(!_0x34ff7f||!_0x34ff7f['isVisible'])return;const _0x5e63a7=this['_config']['getTargetElement']();if(!_0x5e63a7)return;_0x34ff7f['pin']({'target':_0x5e63a7,'limiter':this['_config']['getLimiterElement']()});const _0x269a73=this['_getResourcesViewFromBalloon'](_0x34ff7f);_0x269a73&&_0x269a73['updateResourceState'](_0x5ede96,_0x3c5e00);}['destroy'](){for(const _0x3ab566 of this['_sourceResourceBalloons']['values']())_0x3ab566['destroy']();this['_sourceResourceBalloons']['clear']();}['_createSourceResourceBalloonPanel'](){const _0x2b4829=new Qt(this['_locale']);return _0x2b4829['extendTemplate']({'attributes':{'class':vr}}),this['_bodyCollection']['add'](_0x2b4829),_0x2b4829;}['_addSourceResourceContent']({balloonPanel:_0x28af7f,source:_0x35952e,withBackButton:_0x2b615f}){_0x28af7f['content']['clear']();const _0x14f3e1=this['_createBalloonHeader']({'balloonPanel':_0x28af7f,'source':_0x35952e,'withBackButton':_0x2b615f});_0x28af7f['content']['add'](_0x14f3e1);const _0x31fee2=this['_createBalloonResourcesView'](_0x35952e);_0x28af7f['content']['add'](_0x31fee2);}['_createBalloonHeader']({balloonPanel:_0x2b4140,source:_0x4e4147,withBackButton:_0x41def7}){const _0x3f8976=new _0x17eb16(this['_locale'],{'label':_0x4e4147['label'],'class':xr});return _0x41def7&&_0x3f8976['children']['add'](this['_createBackButton'](_0x2b4140),0x0),_0x3f8976;}['_createBackButton'](_0x181e47){const _0x48843d=new kt(this['_locale']);return _0x48843d['set']({'icon':_0x11b6ce,'tooltip':cs(this['_locale'],'AI_CHAT_CONTEXT_URL_BACK_TO_CONTEXT'),'tooltipPosition':'n','class':yr}),_0x48843d['on']('execute',()=>{_0x181e47['hide'](),this['_config']['onBackToContext']();}),_0x48843d;}['_createBalloonResourcesView'](_0xfee2ea){const _0x1c72c5=new Nr(this['_locale'],{'source':_0xfee2ea,'searchInputVisibleFrom':this['_config']['searchInputVisibleFrom']});return _0x1c72c5['on']('loadSourceResources',(_0x2f311d,_0x51593a)=>{this['_config']['onLoadSourceResources'](_0x51593a);}),_0x1c72c5['on']('addResourceToContext',(_0xc2e136,_0x528138)=>{this['_config']['onResourceSelected'](_0x528138['source'],_0x528138['resource']),this['closeSourceResourceBalloon'](_0xfee2ea['id']);}),_0x1c72c5;}['_getResourcesViewFromBalloon'](_0x2dc7c4){const _0x51e508=_0x2dc7c4['content']['get'](0x1);return _0x51e508 instanceof Nr?_0x51e508:null;}['_setupSingleResourceBalloonClickOutsideHandler'](_0x435be2){Xt({'emitter':_0x435be2,'contextElements':[_0x435be2['element']],'callback':()=>{_0x435be2['hide'](),this['_config']['onBalloonClosed']();},'activator':()=>_0x435be2['isVisible']});}}const Dr=['addDocumentToContext','addFileToContext','addUrlToContext','addResourceToContext','removeContextItem','loadSourceResources','executeCustomItemCallback'],Pr='ck-ai-chat-context-controls',Hr='ck-ai-chat-context-controls__pending-contexts',Mr='ck-ai-chat-context-controls__add-context-balloon-panel',Ur='ck-ai-chat-context-controls__add-context-button',Vr='ck-ai-chat-context-controls__url-balloon-panel',Br='ck-ai-chat-context-controls__balloon-button',Gr='ck-ai-chat-context-controls__balloon-button-source',Fr='ck-ai-chat-controls-button',Kr='ck-ai-chat-context-chips-wrapper-balloon',Wr='ck-ai-chat-controls_context_show-more-button',Yr='ck-ai-chat-context-controls__show-more-balloon-panel',$r='ck-ai-chat',qr=[Qt['defaultPositions']['northArrowSouthWest'],Qt['defaultPositions']['northArrowSouth'],Qt['defaultPositions']['northArrowSouthEast'],Qt['defaultPositions']['southArrowNorthWest'],Qt['defaultPositions']['southArrowNorth'],Qt['defaultPositions']['southArrowNorthEast']];class Qr extends Nt{['addContextButtonView'];['_currentContextsChips']=this['createCollection']();['_conversationContextsChips']=this['createCollection']();['_overflowManager'];['_addContextBalloonPanelView'];['_urlBalloonPanelView'];['_urlInputView'];['_resourcesBalloonView'];['_addContextBalloonConfig'];['_hasExactlyOneSource']=!0x1;['bodyCollection'];constructor(_0x508024,_0x174888){super(_0x508024),this['bodyCollection']=_0x174888['bodyCollection'],this['_currentContextsChips']=this['createCollection'](),this['_conversationContextsChips']=this['createCollection'](),this['addContextButtonView']=this['_createAddContextButtonView'](_0x508024),this['_addContextBalloonPanelView']=this['_createAddContextBalloonPanelView'](_0x508024),this['_urlBalloonPanelView']=this['_createUrlBalloonPanelView'](_0x508024),this['_resourcesBalloonView']=this['_createResourcesBalloonView'](_0x508024,_0x174888);const _0x374c9f={'cssClasses':{'showMoreButton':Wr+'\x20'+ds,'showMoreBalloon':Yr,'overflowContainer':Kr,'controlsButton':Fr}};this['_overflowManager']=new Vn(_0x508024,this['_currentContextsChips'],_0x374c9f,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'](_0x1990b2,_0x1199d2){const _0x32df42=this['_createContextButton'](_0x1990b2,'current',!0x0,_0x1199d2);this['_addContextToCollection'](_0x32df42,this['_currentContextsChips']),this['_overflowManager']['reorganizeChips']();}['removeContextItem'](_0x3da5ef){this['_removeContextFromCollection'](_0x3da5ef,this['_currentContextsChips']),this['_removeContextFromCollection'](_0x3da5ef,this['_overflowManager']['overflowChips']),this['_overflowManager']['reorganizeChips']();}['setContextItemLoading'](_0x126028,_0x43dbf0){let _0x5732f9=this['_currentContextsChips']['find'](_0x4bcfdf=>_0x4bcfdf['id']===_0x126028);_0x5732f9||(_0x5732f9=this['_overflowManager']['overflowChips']['find'](_0x28c0b6=>_0x28c0b6['id']===_0x126028)),_0x5732f9&&(_0x5732f9['isLoading']=_0x43dbf0);}['setConversationContext'](_0x9df72c){this['_conversationContextsChips']['clear']();for(const _0xf7d285 of _0x9df72c){const _0x6e71a9=this['_createContextButton'](_0xf7d285,'conversation',!0x1,!0x1);this['_addContextToCollection'](_0x6e71a9,this['_conversationContextsChips']);}}['clearCurrentContextItems'](){this['_currentContextsChips']['clear'](),this['_overflowManager']['clear']();}['clearConversationContextItems'](){this['_conversationContextsChips']['clear']();}['updateResourceState'](_0x5b710b,_0x5d2b41,_0x2fd1b2){this['_resourcesBalloonView']['updateResourceState'](_0x5b710b,_0x5d2b41,_0x2fd1b2);}['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:_0x4f0bc3,withBackButton:_0x10c834}){this['_resourcesBalloonView']['showSourceResourcesBalloon']({'source':_0x4f0bc3,'withBackButton':_0x10c834}),this['addContextButtonView']['isOn']=!0x0;}['populateSourceResourceBalloon'](_0x5a7a2f,_0x25f908,_0x1be0e5,_0x5915ce){this['_resourcesBalloonView']['populateSourceResourceBalloon'](_0x5a7a2f,_0x1be0e5,_0x5915ce);}['closeSourceResourceBalloon'](_0x1f05e2){this['_resourcesBalloonView']['closeSourceResourceBalloon'](_0x1f05e2),this['addContextButtonView']['isOn']=!0x1;}['setAddContextOptions'](_0x2dfb16){this['_setBalloonPanelContent'](this['_addContextBalloonPanelView'],this['locale'],_0x2dfb16),this['_setAddContextButtonEnabled'](_0x2dfb16);}['_setAddContextButtonEnabled'](_0x583185){const _0xc8c4a6=!_0x583185['document']['isHidden']&&_0x583185['document']['enabled'],_0x1f9b66=_0x583185['urls']['enabled'],_0x1445e7=_0x583185['files']['enabled'],_0x4460ac=_0x583185['sources']['length']>0x0,_0x369667=_0x583185['customItems']&&_0x583185['customItems']['length']>0x0;this['addContextButtonView']['isEnabled']=_0xc8c4a6||_0x1f9b66||_0x1445e7||_0x4460ac||_0x369667;}['_setupTemplate'](){this['setTemplate']({'tag':'div','attributes':{'class':[Pr,'ck-reset_all-excluded']},'children':[{'tag':'div','attributes':{'class':Hr},'children':this['_currentContextsChips']}]});}['_bindEventHandlers'](){this['addContextButtonView']['on']('execute',()=>{this['_handleAddContextButtonClick']();});}['_createAddContextButtonView'](_0x3754e0){const _0xd7454d=new kt(_0x3754e0);return _0xd7454d['set']({'label':cs(_0x3754e0,'AI_CHAT_CONTEXT_ADD_CONTEXT'),'class':Fr+'\x20'+Ur+'\x20'+ds,'icon':_0x5bf39d,'isToggleable':!0x0,'tooltip':!0x0,'tooltipPosition':'sw'}),_0xd7454d;}['_createAddContextBalloonPanelView'](_0xc93504){return this['_createBaseBalloonPanel'](_0xc93504,Mr);}['_createUrlBalloonPanelView'](_0x3c5a0f){const _0x559044=this['_createBaseBalloonPanel'](_0x3c5a0f,Vr);return this['_addUrlContent'](_0x559044,_0x3c5a0f),_0x559044;}['_createResourcesBalloonView'](_0x47a4e5,_0x3051cd){const _0x4a24c3={'searchInputVisibleFrom':_0x3051cd['searchInputVisibleFrom'],'onBackToContext':()=>{this['showAddContextBalloonPanel'](),this['_addContextBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':qr});},'onResourceSelected':(_0x1fa37c,_0x5be9a1)=>{this['fire']('addResourceToContext',{'source':_0x1fa37c,'resource':_0x5be9a1});},'onLoadSourceResources':_0x4c52ab=>{this['fire']('loadSourceResources',_0x4c52ab);},'onBalloonClosed':()=>{this['addContextButtonView']['isOn']=!0x1;},'getLimiterElement':()=>this['_getLimiterElement'](),'getTargetElement':()=>this['addContextButtonView']['element']};return new Lr(_0x47a4e5,_0x3051cd['bodyCollection'],_0x4a24c3);}['_getLimiterElement'](){return this['element']?.['closest']('.'+$r)||document['body'];}['_createBaseBalloonPanel'](_0x14e45a,_0x2700ee){const _0x17bbf6=new Qt(_0x14e45a);return _0x17bbf6['extendTemplate']({'attributes':{'class':_0x2700ee}}),this['bodyCollection']['add'](_0x17bbf6),_0x17bbf6;}['_setBalloonPanelContent'](_0x563f31,_0x78c917,_0x3ef200){if(_0x563f31['content']['clear'](),!_0x3ef200['document']['isHidden']&&_0x3ef200['document']['enabled']){const _0x897d32=this['_createBalloonButton'](_0x78c917,{'label':cs(_0x78c917,'AI_CHAT_CONTEXT_CURRENT_DOCUMENT'),'icon':_0x50a35b});_0x897d32['on']('execute',()=>{this['fire']('addDocumentToContext'),this['hideAddContextBalloonPanel']();}),_0x563f31['content']['add'](_0x897d32);}if(_0x3ef200['urls']['enabled']){const _0x16cc91=this['_createBalloonButton'](_0x78c917,{'label':cs(_0x78c917,'AI_CHAT_CONTEXT_URL_LABEL'),'icon':_0x4b5c8c});_0x16cc91['on']('execute',()=>{this['hideAddContextBalloonPanel'](),this['showUrlBalloonPanel'](),this['_urlBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':qr}),this['_urlInputView']['focus']();}),_0x563f31['content']['add'](_0x16cc91);}if(_0x3ef200['files']['enabled']){const _0x3eae24=new _0x20d2f6(_0x78c917);_0x3eae24['set']({'label':cs(_0x78c917,'AI_CHAT_CONTEXT_FILE_LABEL'),'icon':_0x26c4ef,'withText':!0x0,'tooltip':!0x0,'class':Br,'allowMultipleFiles':!0x0}),_0x3eae24['on']('execute',()=>{this['hideAddContextBalloonPanel']();}),_0x3eae24['on']('done',(_0x36923e,_0x2cdc72)=>{this['fire']('addFileToContext',_0x2cdc72);}),_0x3eae24['tooltip']=!0x0,_0x563f31['content']['add'](_0x3eae24);}for(const _0x30016b of _0x3ef200['sources']){const _0x12bf39=this['_createBalloonButton'](_0x78c917,{'label':_0x30016b['label'],'icon':_0x30016b['icon']||_0x224477,'type':'source'});_0x563f31['content']['add'](_0x12bf39),_0x12bf39['on']('execute',()=>{this['hideAddContextBalloonPanel'](),this['_showSourceResourcesBalloon']({'source':_0x30016b,'withBackButton':!this['_hasExactlyOneSource']});});}for(const _0x380aa3 of _0x3ef200['customItems']||[]){const _0x53b90f=this['_createBalloonButton'](_0x78c917,{'label':_0x380aa3['label'],'icon':_0x380aa3['icon']||_0x224477,'type':'customItem'});_0x563f31['content']['add'](_0x53b90f),_0x53b90f['on']('execute',()=>{this['hideAddContextBalloonPanel'](),this['fire']('executeCustomItemCallback',_0x380aa3);});}this['_hasExactlyOneSource']=0x1===_0x563f31['content']['length'],this['_urlInputView']['withBackButton']=!this['_hasExactlyOneSource'];}['_addUrlContent'](_0x221e95,_0x38d43e){this['_urlInputView']=new mr(_0x38d43e),this['_urlInputView']['on']('submitUrl',(_0x172df3,_0x4075b8)=>{this['_handleUrlSubmit'](_0x4075b8);}),this['_urlInputView']['on']('cancel',()=>{this['hideUrlBalloonPanel'](),this['_hasExactlyOneSource']||(this['showAddContextBalloonPanel'](),this['_addContextBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':qr}));}),this['_urlInputView']['on']('refreshBalloon',()=>{this['_urlBalloonPanelView']['isVisible']&&this['_urlBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':qr});}),_0x221e95['content']['add'](this['_urlInputView']);}['_createBalloonButton'](_0x361088,_0x2912e4){const _0x3b78b6='source'===_0x2912e4['type']?new Xr(_0x361088):new kt(_0x361088);return _0x3b78b6['set']({'label':_0x2912e4['label'],'icon':_0x2912e4['icon'],'withText':!0x0,'tooltip':!0x0,'tooltipPosition':'sw','class':Br}),_0x3b78b6;}['_setupAllBalloonClickOutsideHandlers'](){this['_setupAddContextBalloonClickOutsideHandler'](),this['_setupUrlBalloonClickOutsideHandler']();}['_setupUrlBalloonClickOutsideHandler'](){Xt({'emitter':this['_urlBalloonPanelView'],'contextElements':[this['_urlBalloonPanelView']['element']],'callback':()=>{this['hideUrlBalloonPanel']();},'activator':()=>this['_urlBalloonPanelView']['isVisible']});}['_toggleAddContextBalloon'](_0x139410){const _0xabca77=this['_addContextBalloonConfig'];_0xabca77['buttonView']['isOn']=_0x139410,_0x139410?_0xabca77['balloonView']['show']():_0xabca77['balloonView']['hide']();}['_setupAddContextBalloonClickOutsideHandler'](){const {balloonView:_0x3bd30a,buttonView:_0x31fa86,hideMethod:_0x4ee9d3}=this['_addContextBalloonConfig'];Xt({'emitter':_0x3bd30a,'contextElements':[_0x3bd30a['element'],_0x31fa86['element']],'callback':()=>{_0x4ee9d3();},'activator':()=>_0x31fa86['isOn']&&!this['_urlBalloonPanelView']['isVisible']&&!this['_resourcesBalloonView']['isAnyResourceBalloonVisible']()});}['_createContextButton'](_0x5ba1fe,_0x4b9d27,_0x1261e8=!0x1,_0x3559e0=!0x1){const _0x32dce4='conversation'===_0x4b9d27||!0x0===_0x5ba1fe['isReadOnly'],_0x8b7022=new Pn(this['locale'],_0x5ba1fe,_0x32dce4,_0x1261e8,_0x3559e0);return _0x32dce4||_0x8b7022['on']('removeContextItemChip',()=>{this['fire']('removeContextItem',_0x8b7022['id']);}),_0x8b7022;}['_addContextToCollection'](_0x30145b,_0x4eb73b){_0x4eb73b['add'](_0x30145b,0x0);}['_removeContextFromCollection'](_0x4b9796,_0x4aae4e){const _0x16f933=_0x4aae4e['find'](_0x190534=>_0x190534['id']===_0x4b9796);_0x16f933&&_0x4aae4e['remove'](_0x16f933);}['_handleAddContextButtonClick'](){this['addContextButtonView']['isOn']?this['hideAddContextBalloonPanel']():(this['showAddContextBalloonPanel'](),this['_addContextBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':qr}),this['_hasExactlyOneSource']&&this['_addContextBalloonPanelView']['content']['get'](0x0)?.['fire']('execute'));}['_handleUrlSubmit'](_0x39f4cf){this['_urlInputView']['clear'](),this['hideUrlBalloonPanel'](),this['fire']('addUrlToContext',_0x39f4cf);}}class Xr extends kt{['arrowView'];constructor(_0x46bfe3){super(_0x46bfe3),this['set']({'withText':!0x0,'role':'menuitem'}),this['arrowView']=this['_createArrowView'](),this['extendTemplate']({'attributes':{'class':[Gr]}});}['render'](){super['render'](),this['children']['add'](this['arrowView']);}['_createArrowView'](){const _0xef3440=new yt();return _0xef3440['content']=_0x28906d,_0xef3440['extendTemplate']({'attributes':{'class':Gr+'__arrow'}}),_0xef3440;}}class zr extends Nt{['_cancelButtonView'];['_loaderView'];constructor(_0x4177c7){super(_0x4177c7),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 _0x2bee85=new kt(this['locale']);return _0x2bee85['set']({'label':cs(this['locale'],'AI_CHAT_STOP_GENERATING'),'withText':!0x0,'class':us+'\x20ck-ai-button-stop-generating','icon':_0x57d95b}),_0x2bee85['on']('execute',()=>{this['fire']('abortPromptStream');}),_0x2bee85;}['_createLoaderView'](){const _0x1efb85=new Nt(this['locale']);return _0x1efb85['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':cs(this['locale'],'AI_CHAT_IS_WRITING')}]}),_0x1efb85;}}class jr extends Nt{['_contextPanelView'];['_promptInputView'];['_promptCapabilitiesView'];['_loaderView'];['_modelUnavailableMessageView'];['_shouldRestorePromptInputFocus'];constructor(_0x4f4e21,_0x2fa238){super(_0x4f4e21),this['_contextPanelView']=this['_createContextPanelView'](_0x4f4e21,{'bodyCollection':_0x2fa238['bodyCollection'],'searchInputVisibleFrom':_0x2fa238['contextResourcesSearchInputVisibleFrom']}),this['_promptInputView']=this['_createPromptInputView'](_0x4f4e21),this['_promptCapabilitiesView']=this['_createPromptCapabilitiesView'](_0x4f4e21),this['_loaderView']=this['_createLoaderView'](_0x4f4e21),this['_modelUnavailableMessageView']=this['_createModelUnavailableMessageView'](_0x4f4e21),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'](...Dr)['to'](this),this['set']('isModelAvailable',!0x0),this['set']('isDisabled',!0x1);const _0x53c560=this['bindTemplate'];this['setTemplate']({'tag':'form','attributes':{'class':['ck','ck-ai-chat-controls',_0x53c560['if']('isDisabled','ck-ai-chat-controls-disabled')]},'children':[{'tag':'div','attributes':{'class':[_0x53c560['if']('isLoading','ck-hidden',_0x31cfbb=>_0x31cfbb||!this['isModelAvailable']),_0x53c560['if']('isModelAvailable','ck-hidden',_0x1150d2=>!_0x1150d2||this['isLoading'])]},'children':[this['_contextPanelView'],this['_promptInputView'],this['_promptCapabilitiesView']]},{'tag':'div','attributes':{'class':[_0x53c560['if']('isLoading','ck-hidden',_0x36bff0=>!_0x36bff0)]},'children':[this['_loaderView']]},{'tag':'div','attributes':{'class':[_0x53c560['if']('isModelAvailable','ck-hidden',_0x6ee07f=>_0x6ee07f)]},'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'](_0x216a2e,_0x2679a8){return new Qr(_0x216a2e,_0x2679a8);}['_createPromptInputView'](_0x4d7a7a){return new ar(_0x4d7a7a,this['_contextPanelView']['addContextButtonView']);}['_createPromptCapabilitiesView'](_0x43c4b9){return new gr(_0x43c4b9);}['_createLoaderView'](_0x4193b5){return new zr(_0x4193b5);}['_createModelUnavailableMessageView'](_0x2d7b94){const _0x3b96f2=new Jr(_0x2d7b94);return _0x3b96f2['delegate']('startConversation')['to'](this),_0x3b96f2;}['_handlePromptInputFocus'](_0x47d9a0,_0x11849b,_0x220555){_0x220555?this['_shouldRestorePromptInputFocus']=!0x0:this['_shouldRestorePromptInputFocus']&&this['_promptInputView']['focus']();}['addContextItem'](_0xeba1ca,_0x1b3d25){this['_contextPanelView']['addContextItem'](_0xeba1ca,_0x1b3d25);}['removeContextItem'](_0x16fea8){this['_contextPanelView']['removeContextItem'](_0x16fea8);}['setContextItemLoading'](_0x1a4e43,_0x249452){this['_contextPanelView']['setContextItemLoading'](_0x1a4e43,_0x249452);}['setIsUploadInProgress'](_0x18d6a9){this['_promptInputView']['setIsUploadInProgress'](_0x18d6a9);}['setConversationContext'](_0x4dd7e3){this['_contextPanelView']['setConversationContext'](_0x4dd7e3);}['clearPendingContextUI'](){this['_contextPanelView']['clearCurrentContextItems']();}['clearConversationContextUI'](){this['_contextPanelView']['clearConversationContextItems']();}['updateResourceState'](_0x1343c3,_0x523f52,_0x8bad04){this['_contextPanelView']['updateResourceState'](_0x1343c3,_0x523f52,_0x8bad04);}['setWebSearch'](_0x3b88c0){this['_promptCapabilitiesView']['setWebSearch'](_0x3b88c0);}['setReasoning'](_0x5b19c0){this['_promptCapabilitiesView']['setReasoning'](_0x5b19c0);}['resetMessageInput'](){this['_promptInputView']['reset']();}['setAddContextOptions'](_0x363c00){this['_contextPanelView']['setAddContextOptions'](_0x363c00);}['setInputPlaceholder'](_0x153611){this['_promptInputView']['setPlaceholderText'](_0x153611);}['setModelList'](_0x2464af,_0x2954b7){this['_promptCapabilitiesView']['setModelList'](_0x2464af,_0x2954b7);}['setModel'](_0x4ee7d8){_0x4ee7d8?(this['isModelAvailable']=!0x0,this['_promptCapabilitiesView']['setModel'](_0x4ee7d8)):this['isModelAvailable']=!0x1;}['enableModelSelector'](){this['_promptCapabilitiesView']['enableModelSelector']();}['disableModelSelector'](_0x13387a){this['_promptCapabilitiesView']['disableModelSelector'](_0x13387a);}['populateSourceResourceBalloon'](_0x2bfe12,_0x5e791f,_0x5d2a07,_0x25015a){this['_contextPanelView']['populateSourceResourceBalloon'](_0x2bfe12,_0x5e791f,_0x5d2a07,_0x25015a);}['closeSourceResourceBalloon'](_0x4d554a){this['_contextPanelView']['closeSourceResourceBalloon'](_0x4d554a);}['focusPromptInput'](_0x5b920e=!0x1){this['_promptInputView']['focus'](_0x5b920e);}['setPromptInputValue'](_0x230548){this['_promptInputView']['queryView']['fieldView']['reset'](),this['_promptInputView']['queryView']['fieldView']['value']=_0x230548;}}class Jr extends Nt{constructor(_0x30b381){super(_0x30b381);const _0x2938e9=new kt(_0x30b381);_0x2938e9['set']({'label':cs(this['locale'],'AI_CHAT_MODEL_UNAVAILABLE_MESSAGE_BUTTON'),'withText':!0x0,'class':['ck-ai-chat-controls__start-new-chat-button'],'tooltip':''}),_0x2938e9['delegate']('execute')['to'](this,'startConversation'),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat-controls-model-unavailable-message']},'children':[{'tag':'p','children':[{'text':cs(this['locale'],'AI_CHAT_MODEL_UNAVAILABLE_MESSAGE_TEXT')+'\x20'},_0x2938e9]}]});}}class Zr extends _0x17eb16{['conversationStartButton'];['resizeButton'];constructor(_0x431a9b,_0x2a37d2){super(_0x431a9b,{'label':cs(_0x431a9b,'AI_CHAT_HEADING'),'class':'ck-ai-header\x20ck-ai-header_chat','icon':_0x352240}),this['set']('isMaximized',!0x1),this['conversationStartButton']=this['_createStartConversationButton'](_0x431a9b),this['children']['add'](this['conversationStartButton']),_0x2a37d2&&(this['resizeButton']=_s(_0x431a9b,this),this['children']['add'](this['resizeButton']));}['_createStartConversationButton'](_0x41e3f4){const _0x199a90=new kt(_0x41e3f4);return _0x199a90['set']({'label':cs(this['locale'],'AI_CHAT_LABEL_NEW_CHAT'),'withText':!0x0,'icon':_0x488048,'class':'ck-ai-chat__start-conversation\x20'+us}),_0x199a90['on']('execute',()=>{this['fire']('startConversation');}),_0x199a90;}}class ta extends Nt{constructor(_0x2fd5c9){super(_0x2fd5c9),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-disclaimer']},'children':[{'tag':'p','attributes':{'class':['ck','ck-ai-disclaimer__content']},'children':[{'text':cs(_0x2fd5c9,'AI_DISCLAIMER_TEXT')}]}]});}}class ea extends Nt{['chatHeader'];['chatFeed'];['chatControls'];['chatDisclaimer'];['_bodyCollection'];constructor(_0x5428ee,_0x36409e){super(_0x5428ee),this['_bodyCollection']=new qt(_0x5428ee),this['_bodyCollection']['attachToDom'](),this['chatHeader']=new Zr(_0x5428ee,_0x36409e['showResizeButton']),this['chatHeader']['delegate'](...Js)['to'](this),this['chatFeed']=new sr(_0x5428ee,this['_bodyCollection']),this['chatFeed']['delegate'](...Js)['to'](this),this['chatControls']=new jr(_0x5428ee,{'bodyCollection':this['_bodyCollection'],'contextResourcesSearchInputVisibleFrom':_0x36409e['contextResourcesSearchInputVisibleFrom']}),this['chatControls']['delegate'](...Js)['to'](this),this['chatDisclaimer']=new ta(_0x5428ee),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-ai-chat','ck-rounded-corners'],'dir':_0x5428ee['uiLanguageDirection']},'children':[this['chatHeader'],this['chatFeed'],this['chatControls'],this['chatDisclaimer']]});}['populateSourceResourceBalloon'](_0x2cd666,_0x5f27ee,_0x3a6c8c,_0x256baf){this['chatControls']['populateSourceResourceBalloon'](_0x2cd666,_0x5f27ee,_0x3a6c8c,_0x256baf);}['closeSourceResourceBalloon'](_0x2fd6a9){this['chatControls']['closeSourceResourceBalloon'](_0x2fd6a9);}['destroy'](){this['_bodyCollection']['detachFromDom'](),super['destroy']();}}class ia extends _0x474324{static get['requires'](){return[os];}['_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(_0x25e755){super(_0x25e755);const _0x11ef52=this['context']['plugins']['get']('AITabs');this['set']('isBusy',!0x1),this['_promiseQueue']=new In(),this['_view']=new ea(this['context']['locale'],{'showResizeButton':_0x11ef52['showResizeButton'],'contextResourcesSearchInputVisibleFrom':this['context']['config']['get']('ai.chat.context.searchInputVisibleFrom')}),this['_view']['delegate'](...Js)['to'](this),this['_view']['on']('toggleSuggestionDisplayMode',(_0x34d435,{showDiff:_0x387a8b})=>{this['showDiff']=_0x387a8b;}),_0x11ef52['view']['addTab']({'id':'chat','buttonLabel':cs(this['context']['locale'],'AI_CHAT_HEADING'),'buttonIcon':_0x352240,'order':0x0,'content':this['_view']}),this['_view']['chatControls']['bind']('isLoading')['to'](this,'isBusy',_0x18ec9c=>_0x18ec9c),this['_view']['chatFeed']['bind']('isPending')['to'](this,'isBusy',_0x5a9276=>_0x5a9276),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder']()),this['bind']('isModelAvailable')['to'](this['_view']['chatControls'],'isModelAvailable');}['destroy'](){super['destroy'](),this['_titleAnimationInterval']&&clearInterval(this['_titleAnimationInterval']);}['createConversation'](_0x18eee4){const _0x44372f=this['context']['config']['get']('ai.chat.welcomeMessage')??cs(this['context']['locale'],'AI_CHAT_WELCOME_MESSAGE');this['_view']['chatFeed']['clear'](),this['_view']['chatControls']['enableModelSelector'](),this['_view']['chatControls']['setModelList'](_0x18eee4['availableModels'],!this['context']['config']['get']('ai.models.showModelSelector')),this['addFeedItemStaticMessage']({'id':'conversation-start','staticMessage':_0x44372f}),this['fire']('conversationCreated');}async['addFeedItemStaticMessage']({id:_0x567e9e,staticMessage:_0x423294}){return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('ai-reply',{'id':_0x567e9e,'initialContent':'<p>'+_0x423294+'</p>'});});}async['addFeedItemUserMessage'](_0x14f63c){const _0x844437=_0x14f63c['attributes']?.['displayedPrompt']||_0x14f63c['userMessage'];return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('user-message',{'contextItems':Array['from'](_0x14f63c['contextItems']['values']()),'initialContent':'<p>'+_0x844437+'</p>','id':_0x14f63c['id']});});}async['addFeedItemError']({errorMessage:_0x2172fc,id:_0x355d45}){return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('error-message',{'initialContent':'<p>'+_0x2172fc+'</p>','id':_0x355d45});});}async['addFeedItemAIReply'](_0x36dda7){return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('ai-reply',{'id':_0x36dda7['interactionId']+':'+_0x36dda7['id']}),this['clearLoadingMessage']();});}async['addFeedItemAISuggestion'](_0x389992){const _0x3f8652=Ys(this['context']);let _0x33e650=_0x3f8652['config']['get']('ai.availableReplyActions')||[...pn];if(_0x3f8652['plugins']['has']('TrackChanges')){if(!this['_isTrackChangesCommandValueBound']){this['_isTrackChangesCommandValueBound']=!0x0;const _0x9023ea=_0x3f8652['commands']['get']('trackChanges');this['_view']['chatFeed']['bind']('isTrackChangesOn')['to'](_0x9023ea,'value');}}else _0x33e650=_0x33e650['filter'](_0x26a514=>'insertSuggestion'!=_0x26a514);return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('ai-suggestion-reply',{'id':_0x389992['interactionId']+':'+_0x389992['id'],'areActionsDisabled':_0x389992['areActionsDisabled'],'showDiff':this['showDiff'],'availableActions':_0x33e650}),this['clearLoadingMessage']();});}async['addFeedInteractionHeader'](_0x139407,_0x37273c){return this['_promiseQueue']['enqueue'](async()=>{const _0xff205e=this['_view']['chatFeed']['children']['last'];if(_0xff205e instanceof Qn)return this['_view']['chatFeed']['children']['remove'](_0xff205e),void this['_view']['chatFeed']['addItem']('interaction-header',{'id':_0x139407['id'],'capabilities':{'isWebSearchEnabled':_0xff205e['capabilities']['isWebSearchEnabled']||_0x37273c['isWebSearchEnabled'],'isReasoningEnabled':_0xff205e['capabilities']['isReasoningEnabled']||_0x37273c['isReasoningEnabled']}});this['_view']['chatFeed']['addItem']('interaction-header',{'id':_0x139407['id'],'capabilities':_0x37273c});});}async['addFeedItemCustomElement'](_0x170890,_0x2639e9){let _0x3bc3e8;return await this['_promiseQueue']['enqueue'](async()=>{_0x3bc3e8=this['_view']['chatFeed']['addItem']('custom-element',{'content':_0x170890,'id':_0x2639e9});}),_0x3bc3e8;}['removeFeedItem'](_0x36451e){this['_view']['chatFeed']['removeItem'](_0x36451e);}['hasFeedItem'](_0x39501a){return this['_view']['chatFeed']['hasItem'](_0x39501a);}['updateFeedInteractionHeader'](_0x4c7b78){const _0x1d5828=this['_view']['chatFeed']['children']['find'](_0xb52349=>_0xb52349['options']['id']==_0x4c7b78['id']&&_0xb52349 instanceof Qn);_0x1d5828&&_0x1d5828['set']('isVisible',_0x4c7b78['isVisible']);}async['updateFeedItemAIReplyContent'](_0x12f70e){const _0x3aaf7d=_0x12f70e['renderingStrategy']||this['feedItemRenderingStrategy'];return this['_promiseQueue']['enqueue'](async _0xc97ca=>{await this['_view']['chatFeed']['updateReplyItem']({..._0x12f70e,'abortSignal':_0xc97ca,'renderingStrategy':_0x3aaf7d}),_0x12f70e['isDone']&&this['markFeedItemAsDone'](_0x12f70e['id']);});}['updateFeedItemAIReplySources'](_0x3b2295,_0x3cf254){this['_view']['chatFeed']['updateWebSources'](_0x3b2295,_0x3cf254);}async['updateFeedItemAIReplySuggestionContent'](_0x196001){const _0x11c14f=_0x196001['renderingStrategy']||this['feedItemRenderingStrategy'];return this['_promiseQueue']['enqueue'](async _0x4027d3=>{await this['_view']['chatFeed']['updateSuggestionItem']({..._0x196001,'abortSignal':_0x4027d3,'renderingStrategy':_0x11c14f}),_0x196001['isDone']&&this['markFeedItemAsDone'](_0x196001['id']);});}['updateFeedItemAIReplySuggestionPartState'](_0x45dd03){this['_view']['chatFeed']['updateSuggestionPartState'](_0x45dd03);}['setFeedItemAIReplySuggestionPartActive'](_0x5002f9){this['_view']['chatFeed']['setSuggestionPartActive'](_0x5002f9);}['markFeedItemAsDone'](_0x2e4a09){this['_view']['chatFeed']['markItemAsDone'](_0x2e4a09);}['removeFeedInteraction'](_0x3bcb6f){this['_view']['chatFeed']['getItemIds']()['filter'](_0x492887=>_0x492887['startsWith'](_0x3bcb6f))['forEach'](_0x37575e=>this['_view']['chatFeed']['removeItem'](_0x37575e));}['startInteraction'](){const _0x4bba4c=this['prepareLoadingMessage']({'isWebSearchEnabled':!0x1,'isReasoningEnabled':!0x1});this['setLoadingMessage'](_0x4bba4c),this['_view']['chatControls']['disableModelSelector'](!this['context']['config']['get']('ai.models.showModelSelector')),this['isBusy']=!0x0,this['_view']['chatFeed']['startAutoScroll']();}['stopInteraction'](_0x31466f){this['_promiseQueue']['abort'](),this['_view']['chatFeed']['getItemIds']()['filter'](_0x487435=>_0x487435['startsWith'](_0x31466f['id']))['forEach'](_0x3d92c5=>this['markFeedItemAsDone'](_0x3d92c5)),this['isBusy']=!0x1,this['_view']['chatFeed']['stopAutoScroll']();}async['finishInteraction'](){return this['_promiseQueue']['queueEmptyPromise']['then'](()=>{this['isBusy']=!0x1,this['_view']['chatFeed']['stopAutoScroll']();});}['addContextItem'](_0x5d5a2c,_0x4d70b9){this['_view']['chatControls']['addContextItem'](_0x5d5a2c,_0x4d70b9);}['removeContextItem'](_0x59460a){this['_view']['chatControls']['removeContextItem'](_0x59460a);}['setContextItemLoading'](_0x5bc715,_0x2e3b57){this['_view']['chatControls']['setContextItemLoading'](_0x5bc715,_0x2e3b57);}['setIsUploadInProgress'](_0x54a8f7){this['_view']['chatControls']['setIsUploadInProgress'](_0x54a8f7);}['setConversationContext'](_0x59f1d8){this['_view']['chatControls']['setConversationContext'](_0x59f1d8);}['clearPendingContextUI'](){this['_view']['chatControls']['clearPendingContextUI']();}['clearConversationContextUI'](){this['_view']['chatControls']['clearConversationContextUI']();}['updateResourceState'](_0x514e1e,_0x2e68f6,_0x33b3f4){this['_view']['chatControls']['updateResourceState'](_0x514e1e,_0x2e68f6,_0x33b3f4);}['resetMessageInput'](){this['_view']['chatControls']['resetMessageInput'](),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder']());}['setAddContextOptions'](_0x36ae8f){this['_view']['chatControls']['setAddContextOptions'](_0x36ae8f);}['updateCapabilities'](_0x25a1d6){this['_view']['chatControls']['setWebSearch'](_0x25a1d6['isWebSearchEnabled']),this['_view']['chatControls']['setReasoning'](_0x25a1d6['isReasoningEnabled']),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder'](_0x25a1d6));}['setSelectedModel'](_0x33945e,_0x700f4b){this['_view']['chatControls']['setModel'](_0x33945e),_0x700f4b&&this['_view']['chatControls']['disableModelSelector'](!0x1);}['setFeedItemRenderingStrategy'](_0x4b3454){this['feedItemRenderingStrategy']=_0x4b3454;}['toggleLoadingSkeleton'](_0x4c2121){this['_view']['chatFeed']['toggleLoadingSkeleton'](_0x4c2121);}['resetConversationTitle'](){this['setConversationTitle'](cs(this['context']['locale'],'AI_CHAT_HEADING'));}['setConversationTitle'](_0x332431,_0x56f1af=!0x1){if(_0x56f1af&&!St()&&_0x332431['length'])return this['_view']['chatHeader']['label']='',void this['_animateConversationTitle'](_0x332431);this['_view']['chatHeader']['label']=_0x332431;}['setLoadingMessage'](_0xa4d7b5){this['_view']['chatFeed']['setLoadingMessage'](_0xa4d7b5);}['clearLoadingMessage'](){this['_view']['chatFeed']['setLoadingMessage']('');}['_animateConversationTitle'](_0x1b2d3e){let _0x2f8ef3=0x0;clearInterval(this['_titleAnimationInterval']),this['_titleAnimationInterval']=setInterval(()=>{this['_view']['chatHeader']['label']=this['_view']['chatHeader']['label']+_0x1b2d3e[_0x2f8ef3],_0x2f8ef3++,_0x2f8ef3===_0x1b2d3e['length']&&clearInterval(this['_titleAnimationInterval']);},0x1e);}['setIsMaximized'](_0x59f83d){this['_view']['chatHeader']['isMaximized']=_0x59f83d;}['prepareLoadingMessage'](_0x2629bf){return _0x2629bf['isWebSearchEnabled']&&_0x2629bf['isReasoningEnabled']?cs(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH_REASONING'):_0x2629bf['isWebSearchEnabled']?cs(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH'):_0x2629bf['isReasoningEnabled']?cs(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_REASONING'):cs(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_REGULAR');}['_getInputPlaceholder'](_0x8d503d){return _0x8d503d?_0x8d503d['isWebSearchEnabled']&&_0x8d503d['isReasoningEnabled']?cs(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH_REASONING'):_0x8d503d['isWebSearchEnabled']?cs(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH'):_0x8d503d['isReasoningEnabled']?cs(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REASONING'):cs(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REGULAR'):cs(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REGULAR');}['populateSourceResourceBalloon'](_0x2a7148,_0x54eedb,_0x490afa,_0x14725a){this['_view']['populateSourceResourceBalloon'](_0x2a7148,_0x54eedb,_0x490afa,_0x14725a);}['closeSourceResourceBalloon'](_0x3feb9d){this['_view']['closeSourceResourceBalloon'](_0x3feb9d);}['setPromptInputValue'](_0x32d84b){this['_view']['chatControls']['setPromptInputValue'](_0x32d84b);}['focusPromptInput'](_0x19f04e=!0x1){this['_view']['chatControls']['focusPromptInput'](_0x19f04e);}['scrollFeedToSuggestion'](_0x5d6c5e,_0x3b629d){this['_view']['chatFeed']['scrollToSuggestion'](_0x5d6c5e,_0x3b629d);}['startAutoScroll'](){this['_view']['chatFeed']['startAutoScroll']();}['disableControls'](){this['_view']['chatControls']['isDisabled']=!0x0;}['enableControls'](){this['_view']['chatControls']['isDisabled']=!0x1;}}class sa extends Lt{['sections'];constructor(_0x370c61,_0xfcadec){super(_0x370c61),this['sections']=_0xfcadec,this['items']['addMany'](this['sections']),this['extendTemplate']({'attributes':{'class':['ck-ai-chat-history__sections']}});}['filter'](_0x3379d4){let _0x3849a4=0x0,_0x36975d=0x0;for(const _0x3e2c34 of this['sections']){const {resultsCount:_0x44a4bc,totalItemsCount:_0x5504d4}=_0x3e2c34['filter'](_0x3379d4);_0x3849a4+=_0x44a4bc,_0x36975d+=_0x5504d4;}return{'resultsCount':_0x3849a4,'totalItemsCount':_0x36975d};}}class na extends Pt{['title'];['itemsViews'];['_itemsListView'];constructor(_0x551de5,{title:_0x21b2c6,items:_0x199c67}){super(_0x551de5);const _0x14cbc4=this['bindTemplate'];this['set']('isVisible',!0x0),this['title']=_0x21b2c6,this['itemsViews']=_0x199c67;const _0x2a69f4=new Nt(_0x551de5);_0x2a69f4['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-history__section-title']},'children':[this['title']]}),this['_itemsListView']=new Lt(_0x551de5),this['_itemsListView']['items']['addMany'](this['itemsViews']),this['setTemplate']({'tag':'li','attributes':{'class':['ck-ai-chat-history__section',_0x14cbc4['if']('isVisible','ck-hidden',_0x49e36b=>!_0x49e36b)]},'children':[_0x2a69f4,this['_itemsListView']]});}['filter'](_0x50be35){const _0x443a84=this['itemsViews']['length'];let _0x2fc319=0x0;for(const _0x5ab807 of this['itemsViews']){if(_0x50be35){const _0x4ca758=_0x5ab807['isMatching'](_0x50be35);_0x5ab807['isVisible']=!!_0x4ca758,_0x5ab807['highlightText'](_0x50be35);}else _0x5ab807['isVisible']=!0x0,_0x5ab807['highlightText'](null);_0x5ab807['isVisible']&&_0x2fc319++;}return this['isVisible']=_0x2fc319>0x0,{'resultsCount':_0x2fc319,'totalItemsCount':_0x443a84};}['getItem'](_0x3ba28a){return this['itemsViews']['find'](_0x57c101=>_0x57c101['id']===_0x3ba28a);}['removeItem'](_0x51874e){const _0x15c006=this['itemsViews']['indexOf'](_0x51874e);-0x1!==_0x15c006&&(this['itemsViews']['splice'](_0x15c006,0x1),this['_itemsListView']['items']['remove'](_0x51874e));}}class ra extends/* #__PURE__ -- @preserve */
27
+ _0x234900(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(_0x25d153,_0x1615a0){super(_0x25d153);const _0x4376b5=this['bindTemplate'];this['set']('isEdit',!0x1),this['set']('isVisible',!0x0),this['set']('pinned',!!_0x1615a0['pinned']),this['set']('loadingState',null),this['id']=_0x1615a0['id'];const {title:_0x2cc7e5,createdAt:_0x2edf94,active:_0x5773c6=!0x1}=_0x1615a0;this['_titleView']=new _0x3d1ec8(),this['_titleView']['text']=_0x2cc7e5,this['_titleView']['extendTemplate']({'attributes':{'class':['ck-ai-chat-history__item-title']}});const _0x576583=this['_createCheckView'](),_0x5eb8f5=this['_createPinButtonView'](_0x25d153),_0x5dfd93=this['_createMenuDropdownView'](),_0x4abf91=this['_createEditInputView'](_0x25d153,_0x2cc7e5),_0x4b206d=this['_createAcceptEditButtonView'](_0x25d153,_0x4abf91),_0xa17934=this['_createCancelEditButtonView'](_0x25d153,_0x4abf91);this['actions']=this['createCollection'](),this['mainContent']=this['createCollection'](),this['mainContent']['add'](this['_titleView']),this['actions']['add'](_0x5eb8f5),this['actions']['add'](_0x5dfd93),this['on']('change:isEdit',(_0x4c026a,_0x579ea9,_0x3a8b62)=>{this['actions']['clear'](),this['mainContent']['clear'](),_0x3a8b62?(this['actions']['add'](_0x4b206d),this['actions']['add'](_0xa17934),this['mainContent']['add'](_0x4abf91),_0x4abf91['element']['focus']()):(this['actions']['add'](_0x5eb8f5),this['actions']['add'](_0x5dfd93),this['mainContent']['add'](this['_titleView']));}),this['setTemplate']({'tag':'li','attributes':{'class':['ck-ai-chat-history__item',_0x5773c6?'ck-ai-chat-history__item--active':'',_0x4376b5['if']('isVisible','ck-hidden',_0x2b3dc9=>!_0x2b3dc9),_0x4376b5['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',_0x4376b5['if']('loadingState','ck-hidden',_0x1337ab=>!!_0x1337ab)]},'children':_0x5773c6?[_0x576583]:[]},{'tag':'div','attributes':{'class':['ck-ai-loader',_0x4376b5['if']('loadingState','ck-hidden',_0x199bb4=>!_0x199bb4)]},'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',_0x4376b5['if']('loadingState','ck-hidden',_0x509510=>!!_0x509510)]},'children':this['mainContent']},{'tag':'div','attributes':{'class':['ck-ai-loader__text',_0x4376b5['if']('loadingState','ck-hidden',_0x3f549a=>!_0x3f549a)]},'children':[{'text':_0x4376b5['to']('loadingState',_0x4c8c8c=>_0x4c8c8c?cs(this['locale'],ra['LOADING_LABELS'][_0x4c8c8c]):'')}]}]},{'tag':'span','attributes':{'class':['ck-ai-chat-history__item-date']},'children':[_0x2edf94]}]},{'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'](_0x50f059){this['_titleView']['text']=_0x316a01(_0x50f059);}['updateLoadingState'](_0x14fdbb,_0x1f5472){this['set']('loadingState',_0x1f5472?_0x14fdbb:null);}['_createCheckView'](){const _0x1bdab8=new yt();return _0x1bdab8['set']({'content':_0x1d53d5}),_0x1bdab8;}['_createPinButtonView'](_0x28e166){const _0x49d5ea=new kt(_0x28e166);return _0x49d5ea['set']({'label':cs(_0x28e166,'AI_CHAT_HISTORY_PIN_BUTTON'),'icon':_0x8ef1cb,'withText':!0x1,'tooltip':!0x0}),_0x49d5ea['bind']('isOn')['to'](this,'pinned'),_0x49d5ea['on']('execute',()=>{const _0x43b2c2=!this['pinned'];this['fire']('setConversationPinned',{'id':this['id'],'pinned':_0x43b2c2});}),_0x49d5ea;}['_createMenuDropdownView'](){const _0x57540f=Bt(this['locale']),_0x575805=_0x57540f['panelView']['children'];_0x57540f['buttonView']['set']({'label':cs(this['locale'],'AI_CHAT_HISTORY_SHOW_MORE_ITEMS'),'icon':_0xcca7fb}),_0x57540f['panelPosition']='sw';const _0x1bced6=new kt(this['locale']);_0x1bced6['label']=cs(this['locale'],'AI_CHAT_HISTORY_EDIT_NAME'),_0x1bced6['withText']=!0x0,_0x1bced6['on']('execute',()=>{this['isEdit']=!0x0;});const _0x28b921=new kt(this['locale']);_0x28b921['label']=cs(this['locale'],'AI_CHAT_HISTORY_REMOVE'),_0x28b921['withText']=!0x0,_0x28b921['on']('execute',()=>{this['showConfirm'](cs(this['locale'],'AI_CHAT_HISTORY_REMOVE_CONFIRM'),this['element'])['then'](()=>{this['fire']('removeConversation',{'id':this['id']});});});const _0x286219=new Lt(this['locale']),_0x442e83=new Pt(this['locale']);_0x442e83['children']['add'](_0x1bced6);const _0x54bd4e=new Pt(this['locale']);return _0x54bd4e['children']['add'](_0x28b921),_0x286219['items']['addMany']([_0x442e83,_0x54bd4e]),_0x575805['add'](_0x286219),_0x57540f;}['_createEditInputView'](_0x2e5654,_0x442fce){const _0x5bbe27=new _0x23359c(_0x2e5654),_0x38ea1e=_0x5bbe27['bindTemplate'];return _0x5bbe27['value']=_0x442fce,_0x5bbe27['extendTemplate']({'on':{'keydown':_0x38ea1e['to'](_0x3c7a3e=>{'Enter'==_0x3c7a3e['key']&&this['_commitEditInputValue'](_0x5bbe27);})}}),_0x5bbe27;}['_createAcceptEditButtonView'](_0x15eea2,_0x4f0cfb){const _0x2da03a=new kt(_0x15eea2);return _0x2da03a['set']({'icon':_0x1d53d5,'withText':!0x1,'tooltip':cs(_0x15eea2,'AI_CHAT_HISTORY_ACCEPT')}),_0x2da03a['extendTemplate']({'attributes':{'class':['ck-confirm-view-submit']}}),_0x2da03a['on']('execute',()=>{this['_commitEditInputValue'](_0x4f0cfb);}),_0x2da03a;}['_commitEditInputValue'](_0x15e6b0){const _0x466050=_0x15e6b0['element']['value']||'';this['_titleView']['text']=_0x466050,this['isEdit']=!0x1,this['fire']('editConversationTitle',{'id':this['id'],'title':_0x466050});}['_createCancelEditButtonView'](_0x597aed,_0x29ba56){const _0x55db4d=new kt(_0x597aed);return _0x55db4d['set']({'icon':_0x2a335e,'withText':!0x1,'tooltip':cs(_0x597aed,'AI_CHAT_HISTORY_CANCEL')}),_0x55db4d['extendTemplate']({'attributes':{'class':['ck-confirm-view-cancel']}}),_0x55db4d['on']('execute',()=>{this['isEdit']=!0x1,_0x29ba56['value']=this['_titleView']['text']||'',this['fire']('edit:cancel');}),_0x55db4d;}['_createSpinnerView'](){const _0x3c8916=new Rn('tiny');return _0x3c8916['isVisible']=!0x0,_0x3c8916;}['isMatching'](_0x401d4b){return this['_titleView']&&'string'==typeof this['_titleView']['text']&&this['_titleView']['text']['match'](_0x401d4b)?{'title':!0x0}:null;}['highlightText'](_0xd00151){this['_titleView']['highlightText'](_0xd00151);}}class aa extends Nt{['searchView'];['mainErrorView'];['skeletonView'];['emptyView'];['sectionsView'];['resizeButton'];constructor(_0x268bbe,_0x32e8d8){super(_0x268bbe),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 _0x454853=new _0x17eb16(_0x268bbe,{'label':cs(_0x268bbe,'AI_CHAT_HISTORY_HEADING'),'icon':_0x25afa9,'class':'ck-ai-header\x20ck-ai-header_history'});_0x32e8d8&&(this['resizeButton']=_s(_0x268bbe,this),_0x454853['children']['add'](this['resizeButton'])),this['sectionsView']=new sa(_0x268bbe,[]),this['sectionsView']['delegate'](...oa)['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',_0x41f4ae=>!_0x41f4ae)]}}),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':[_0x454853,{'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 _0x35290b=new _0x1776e0(this['locale'],{'filteredView':this['sectionsView'],'queryView':{'label':cs(this['locale'],'AI_CHAT_HISTORY_SEARCH_LABEL')},'infoView':{'text':{'notFound':{'primary':_0x3cc209=>cs(this['locale'],'AI_CHAT_HISTORY_SEARCH_NOT_FOUND_PRIMARY',_0x3cc209),'secondary':cs(this['locale'],'AI_CHAT_HISTORY_SEARCH_NOT_FOUND_SECONDARY')}}}}),_0x230929=this['_createErrorView']();return _0x230929['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('errorMessage','ck-hidden',_0x225367=>!_0x225367)]}}),_0x35290b['on']('render',()=>{_0x35290b['children']['add'](_0x230929,0x1);}),_0x35290b['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isSearchViewVisible','ck-hidden',_0x30bc99=>!_0x30bc99)]}}),_0x35290b;}['_createSkeletonView'](){const _0x5a3051=new Zn(this['locale'],tr['aiHistory']);return _0x5a3051['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isLoading','ck-hidden',_0x397452=>!_0x397452)]}}),_0x5a3051;}['_createErrorView'](){const _0x560627=new Nt(this['locale']),_0x573b2d=new kt(this['locale']);_0x573b2d['set']({'withText':!0x1,'icon':_0x2a335e,'class':'ck-ai-notification_error__dismiss-button'}),_0x573b2d['bind']('isVisible')['to'](this,'hasItems',_0x22baae=>!!_0x22baae),_0x573b2d['on']('execute',()=>{this['errorMessage']='';});const _0x5370dd=this['bindTemplate'];return _0x560627['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-notification','ck-ai-notification_error']},'children':[{'tag':'p','children':[{'text':_0x5370dd['to']('errorMessage')}]},_0x573b2d]}),_0x560627;}['_createEmptyStateView'](){const _0x8ceef4=new kt(this['locale']);_0x8ceef4['set']({'label':cs(this['locale'],'AI_CHAT_LABEL_NEW_CHAT'),'withText':!0x0,'icon':_0x488048,'class':'ck-ai-chat__start-conversation\x20'+us}),_0x8ceef4['on']('execute',()=>{this['fire']('openChat');});const _0x5499dd=new Nt(this['locale']);return _0x5499dd['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-history__empty',this['bindTemplate']['if']('isEmptyViewVisible','ck-hidden',_0x4be5ec=>!_0x4be5ec)]},'children':[{'tag':'p','attributes':{'class':['ck-ai-chat-history__empty-message']},'children':[cs(this['locale'],'AI_CHAT_HISTORY_EMPTY_MESSAGE')]},_0x8ceef4]}),_0x5499dd;}['_createListItemViews'](_0x311eda,_0x444c83){const _0x4040b0=[];for(const _0x46de45 of _0x311eda){const _0x20951f=new ra(_0x444c83,_0x46de45);_0x20951f['delegate'](...oa)['to'](this),_0x4040b0['push'](_0x20951f);}return _0x4040b0;}['updateHistoryItemsWithCategories'](_0x3fff54){const _0x2e0217=this['locale']||'en',_0x27b502=[];for(const _0x37f8c8 of _0x3fff54){const _0x57f9de=this['_createListItemViews'](_0x37f8c8['items'],_0x2e0217);_0x27b502['push'](new na(_0x2e0217,{'title':_0x37f8c8['title'],'items':_0x57f9de}));}this['sectionsView']['sections']=_0x27b502,this['sectionsView']['items']['clear'](),this['sectionsView']['items']['addMany'](_0x27b502),this['hasItems']=_0x3fff54['some'](_0x1e1034=>_0x1e1034['items']['length']>0x0),this['_refreshSearch']();}['removeHistoryItem'](_0x312725){for(const _0x25c2b2 of this['sectionsView']['sections']){const _0x398b2b=_0x25c2b2['getItem'](_0x312725);if(_0x398b2b){if(_0x25c2b2['removeItem'](_0x398b2b),0x0===_0x25c2b2['itemsViews']['length']){const _0x3b3b27=this['sectionsView']['sections']['indexOf'](_0x25c2b2);-0x1!==_0x3b3b27&&(this['sectionsView']['sections']['splice'](_0x3b3b27,0x1),this['sectionsView']['items']['remove'](_0x25c2b2));}this['hasItems']=this['sectionsView']['sections']['length']>0x0,this['_refreshSearch']();break;}}}['updateItemTitle'](_0x2911d5,_0x45e571){for(const _0xa7a94a of this['sectionsView']['sections']){const _0x2c1a1e=_0xa7a94a['getItem'](_0x2911d5);if(_0x2c1a1e){_0x2c1a1e['updateTitle'](_0x45e571);break;}}}['updateItemLoadingState'](_0x99be8a,_0xc9b629,_0x504a25){for(const _0x45eb35 of this['sectionsView']['sections']){const _0x1791ff=_0x45eb35['getItem'](_0x99be8a);if(_0x1791ff){_0x1791ff['updateLoadingState'](_0xc9b629,_0x504a25);break;}}}['_refreshSearch'](){if(this['hasItems']){const _0x5d0688=this['searchView']['queryView']['fieldView']?.['element']?.['value']||'';this['searchView']['search'](_0x5d0688);}}}const oa=['showConversationHistory','removeConversation','editConversationTitle','setConversationPinned','selectConversation','openChat','resizeTabs'];class ha extends _0x474324{static get['requires'](){return[os];}['_historyView'];static get['pluginName'](){return'AIChatHistoryUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x10d28a){super(_0x10d28a);const _0x4505c3=this['context']['plugins']['get']('AITabs');this['_historyView']=new aa(this['context']['locale'],_0x4505c3['showResizeButton']),this['_historyView']['delegate'](...oa)['to'](this),_0x4505c3['view']['addTab']({'id':'history','buttonLabel':cs(this['context']['locale'],'AI_CHAT_HISTORY_HEADING'),'buttonIcon':_0x25afa9,'order':0x0,'content':this['_historyView']});}['removeHistoryItem'](_0x24127e){this['_historyView']['removeHistoryItem'](_0x24127e);}['updateItems'](_0x20a66e){this['_historyView']['updateHistoryItemsWithCategories'](_0x20a66e);}['updateItemTitle'](_0x198bad,_0x2a904f){this['_historyView']['updateItemTitle'](_0x198bad,_0x2a904f);}['updateItemLoadingState'](_0x194515,_0x15e252,_0x1045f8){this['_historyView']['updateItemLoadingState'](_0x194515,_0x15e252,_0x1045f8);}['setLoadingSkeleton'](_0x387003){this['_historyView']['isLoading']=_0x387003;}['showError'](_0x8bf581){this['_historyView']['errorMessage']=_0x8bf581;}['hideError'](){this['_historyView']['errorMessage']='';}['setIsMaximized'](_0x5d0562){this['_historyView']['isMaximized']=_0x5d0562;}}class ca extends ht(){['id'];['createdAt'];constructor({id:_0x34c317,title:_0x4d46ba,createdAt:_0x554174,updatedAt:_0x10f638,pinned:_0x239648}){super(),this['id']=_0x34c317,this['createdAt']=new Date(_0x554174),this['set']('title',_0x4d46ba),this['set']('updatedAt',_0x10f638?new Date(_0x10f638):null),this['set']('pinned',_0x239648||!0x1);}['updateTitle'](_0xbec554){this['set']('title',_0x316a01(_0xbec554)),this['updatedAt']=new Date();}['updatePinned'](_0x31d003){this['set']('pinned',_0x31d003),this['updatedAt']=new Date();}}class la extends Et(){['items']=[];['connector'];['group'];constructor({connector:_0x1a1f47,group:_0x23f76c}){super(),this['connector']=_0x1a1f47,this['group']=_0x23f76c;}async['init'](){try{const _0xa0d048=this['connector']['fetchConversations'](this['group']),_0x57bd87=await _0xa0d048['getConversations']();this['loadItems'](_0x57bd87);}catch(_0x24f8a5){this['fire']('error',{'error':_0x24f8a5,'operation':'init'});}}['addItem'](_0x4e6f4e){this['items']['push'](_0x4e6f4e);}async['removeItem'](_0x51bedf){const _0x9a52bd=this['items']['findIndex'](_0x482e53=>_0x482e53['id']===_0x51bedf);if(-0x1===_0x9a52bd)return!0x1;try{return await this['connector']['deleteConversation'](_0x51bedf)['execute'](),this['items']['splice'](_0x9a52bd,0x1),this['fire']('itemRemoved',{'itemId':_0x51bedf}),!0x0;}catch(_0x80d5eb){return this['fire']('error',{'error':_0x80d5eb,'operation':'removeItem','itemId':_0x51bedf}),!0x1;}}['getItem'](_0x2b2632){return this['items']['find'](_0x4e37a1=>_0x4e37a1['id']===_0x2b2632);}async['updateItemTitle'](_0x34eeee,_0x3dd642){const _0x3ced31=this['getItem'](_0x34eeee);if(!_0x3ced31)return!0x1;try{return await this['connector']['updateConversation'](_0x34eeee,{'title':_0x3dd642})['getResult'](),_0x3ced31['updateTitle'](_0x3dd642),this['fire']('itemUpdated',{'itemId':_0x34eeee,'updates':{'title':_0x3dd642}}),!0x0;}catch(_0x2087a2){return this['fire']('error',{'error':_0x2087a2,'operation':'updateItemTitle','itemId':_0x34eeee}),!0x1;}}async['updateItemPinned'](_0x55d0a2,_0x137656){const _0x2de253=this['getItem'](_0x55d0a2);if(!_0x2de253)return!0x1;try{return await this['connector']['updateConversation'](_0x55d0a2,{'pinned':_0x137656})['getResult'](),_0x2de253['updatePinned'](_0x137656),this['fire']('itemUpdated',{'itemId':_0x55d0a2,'updates':{'pinned':_0x137656}}),!0x0;}catch(_0x45b197){return this['fire']('error',{'error':_0x45b197,'operation':'updateItemPinned','itemId':_0x55d0a2}),!0x1;}}['loadItems'](_0x3c3060){try{this['items']=[],_0x3c3060['map'](_0x4d5b19=>{this['addItem'](new ca(_0x4d5b19));}),this['fire']('itemsLoaded',{'items':[...this['items']]});}catch(_0x4801b7){this['fire']('error',{'error':_0x4801b7,'operation':'loadItems'});}}['getItems'](_0x1fbbfe={}){const _0x145b8a=void 0x0!==_0x1fbbfe['pinned']&&_0x1fbbfe['pinned'],_0x5e4c1a=_0x1fbbfe['from']?new Date(_0x1fbbfe['from']['getFullYear'](),_0x1fbbfe['from']['getMonth'](),_0x1fbbfe['from']['getDate']()):null,_0x27257e=_0x1fbbfe['to']?new Date(_0x1fbbfe['to']['getFullYear'](),_0x1fbbfe['to']['getMonth'](),_0x1fbbfe['to']['getDate']()):null;return this['items']['filter'](_0x317172=>{if(_0x317172['pinned']!==_0x145b8a)return!0x1;if(_0x27257e){const _0x15fb22=new Date(_0x317172['createdAt']['getFullYear'](),_0x317172['createdAt']['getMonth'](),_0x317172['createdAt']['getDate']());return _0x5e4c1a?_0x5e4c1a['getTime']()===_0x27257e['getTime']()?_0x15fb22['getTime']()===_0x5e4c1a['getTime']():_0x15fb22<_0x27257e&&_0x15fb22>=_0x5e4c1a:_0x15fb22<_0x27257e;}return!0x0;});}}class ua extends _0x474324{['_aiConnector'];['_aiChatHistoryUi'];['_aiChatController'];static get['requires'](){return[hs,Qs,ha,os];}static get['pluginName'](){return'AIChatHistoryController';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){this['_aiConnector']=this['context']['plugins']['get'](hs),this['_aiChatHistoryUi']=this['context']['plugins']['get'](ha),this['_aiChatController']=this['context']['plugins']['get'](Qs);const _0x5e2c7a=this['context']['plugins']['get'](os);try{const _0x1e79ce=this['_aiChatController']['getGroupId']();this['history']=new la({'connector':this['_aiConnector'],'group':_0x1e79ce}),this['listenTo'](this['_aiChatHistoryUi'],'removeConversation',(_0x4ba26a,_0xa87166)=>{this['_setItemLoading'](_0xa87166['id'],'remove'),this['_handleRemove'](_0xa87166['id']);}),this['listenTo'](this['_aiChatHistoryUi'],'editConversationTitle',(_0x87ab06,_0x485da7)=>{this['_setItemLoading'](_0x485da7['id'],'rename'),this['_handleEditTitle'](_0x485da7['id'],_0x485da7['title']);}),this['listenTo'](this['history'],'itemUpdated',(_0x485e3d,_0x256291)=>{void 0x0!==_0x256291['updates']['title']&&this['_aiChatHistoryUi']['updateItemTitle'](_0x256291['itemId'],_0x256291['updates']['title']),void 0x0!==_0x256291['updates']['pinned']&&this['_updateHistoryItemsUI'](),this['_clearItemLoading'](_0x256291['itemId']);}),this['listenTo'](this['history'],'itemRemoved',(_0xd321df,_0x7fccb4)=>{this['_aiChatController']['_handleRemovedConversation'](_0x7fccb4['itemId']),this['_aiChatHistoryUi']['removeHistoryItem'](_0x7fccb4['itemId']),this['_clearItemLoading'](_0x7fccb4['itemId']);}),this['listenTo'](this['history'],'itemsLoaded',()=>{this['_updateHistoryItemsUI']();}),this['listenTo'](this['history'],'error',(_0x54a4ac,_0x2e8d31)=>{this['_handleHistoryErrorUI'](_0x2e8d31['error'],_0x2e8d31['operation'],_0x2e8d31['itemId']);}),this['listenTo'](this['_aiChatHistoryUi'],'selectConversation',(_0x5d89f4,_0x1ac92f)=>{this['_handleSelectConversation'](_0x1ac92f['id']);}),this['listenTo'](this['_aiChatHistoryUi'],'setConversationPinned',(_0x54d738,_0x4a8b81)=>{const _0x379ec1=_0x4a8b81['pinned']?'pin':'unpin';this['_setItemLoading'](_0x4a8b81['id'],_0x379ec1),this['_handleTogglePin'](_0x4a8b81['id'],_0x4a8b81['pinned']);}),this['listenTo'](this['_aiChatHistoryUi'],'openChat',()=>{_0x5e2c7a['view']['activateTab']('chat');}),this['listenTo'](this['_aiChatController'],'change:activeConversation',()=>{this['_updateHistoryItemsUI']();}),_0x5e2c7a['view']['on']('activateTab:history',()=>{this['_showConversationHistory']();}),this['listenTo'](_0x5e2c7a,'resizedTabs',(_0x554902,_0x55a2ae)=>{this['_setIsMaximized'](_0x55a2ae);}),this['listenTo'](this['_aiChatHistoryUi'],'resizeTabs',()=>{_0x5e2c7a['resize']();});}catch(_0xcbbd7d){this['_handleHistoryErrorUI'](_0xcbbd7d,'init');}}async['_handleEditTitle'](_0x51c63f,_0x2273c5){await this['history']['updateItemTitle'](_0x51c63f,_0x2273c5);}async['_handleTogglePin'](_0x3fa45f,_0x20e85c){await this['history']['updateItemPinned'](_0x3fa45f,_0x20e85c);}async['_handleRemove'](_0xac3424){await this['history']['removeItem'](_0xac3424);}async['_handleSelectConversation'](_0x4a78de){await this['_aiChatController']['loadConversation'](_0x4a78de);}async['_showConversationHistory'](){this['_aiChatHistoryUi']['showError'](''),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x0),await this['history']['init'](),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x1);}['_updateHistoryItemsUI'](){const _0x538bb7=this['_aiChatController']['activeConversation']?.['id'],_0x33f803=this['_getCategorizedItems']()['map'](_0x928630=>({'title':_0x928630['title'],'items':_0x928630['items']['map'](_0x4ca8b5=>({'id':_0x4ca8b5['id'],'title':_0x4ca8b5['title']||cs(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION'),'createdAt':new Date(_0x4ca8b5['createdAt'])['toLocaleDateString'](),'active':_0x4ca8b5['id']===_0x538bb7,'pinned':_0x4ca8b5['pinned']}))}));this['_aiChatHistoryUi']['updateItems'](_0x33f803);}['_setItemLoading'](_0x5c7cfa,_0x17af21){this['_aiChatHistoryUi']['updateItemLoadingState'](_0x5c7cfa,_0x17af21,!0x0);}['_clearItemLoading'](_0x243f62){this['_aiChatHistoryUi']['updateItemLoadingState'](_0x243f62,null,!0x1);}['_handleHistoryErrorUI'](_0xe1f54a,_0x28b2a8,_0x4c9981){const _0x23a859=this['_generateErrorMessage'](_0x28b2a8,_0x4c9981);this['_aiChatHistoryUi']['showError'](_0x23a859),_0x4c9981&&this['_clearItemLoading'](_0x4c9981),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x1);}['_generateErrorMessage'](_0xefa16,_0x2b56fb){const _0x41a167=_0x2b56fb?this['history']['getItem'](_0x2b56fb):null,_0x16962f=_0x41a167?.['title']||cs(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION');switch(_0xefa16){case'updateItemTitle':return cs(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_UPDATE_TITLE',_0x16962f);case'updateItemPinned':{const _0x9b1831=cs(this['context']['locale'],_0x41a167?.['pinned']?'AI_CHAT_HISTORY_UNPIN_ACTION':'AI_CHAT_HISTORY_PIN_ACTION');return cs(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_UPDATE_PINNED',[_0x9b1831,_0x16962f]);}case'removeItem':return cs(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_REMOVE_ITEM',_0x16962f);case'init':case'loadItems':return cs(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_LOAD_ITEMS');default:return cs(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_GENERIC');}}['_getCategorizedItems'](){const _0x4895ae=new Date(),_0x15f64a=new Date(_0x4895ae['getFullYear'](),_0x4895ae['getMonth'](),_0x4895ae['getDate']()),_0x214f97=new Date(_0x15f64a);_0x214f97['setDate'](_0x214f97['getDate']()-0x1);const _0x3a3ed1=new Date(_0x15f64a);_0x3a3ed1['setDate'](_0x3a3ed1['getDate']()-0xe);const _0x56d724=this['history']['getItems']({'pinned':!0x0}),_0x24639d=this['history']['getItems']({'from':_0x15f64a,'to':_0x15f64a}),_0x58be2e=this['history']['getItems']({'from':_0x214f97,'to':_0x214f97}),_0x31e8f9=this['history']['getItems']({'from':_0x3a3ed1,'to':_0x214f97}),_0x146209=this['history']['getItems']({'to':_0x3a3ed1}),_0x57ab4f=[];return _0x56d724['length']>0x0&&_0x57ab4f['push']({'title':cs(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_PINNED'),'items':_0x56d724}),_0x24639d['length']>0x0&&_0x57ab4f['push']({'title':cs(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_TODAY'),'items':_0x24639d}),_0x58be2e['length']>0x0&&_0x57ab4f['push']({'title':cs(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_YESTERDAY'),'items':_0x58be2e}),_0x31e8f9['length']>0x0&&_0x57ab4f['push']({'title':cs(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_LAST_14_DAYS'),'items':_0x31e8f9}),_0x146209['length']>0x0&&_0x57ab4f['push']({'title':cs(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_LATER'),'items':_0x146209}),_0x57ab4f;}['_setIsMaximized'](_0x20a50e){this['_aiChatHistoryUi']['setIsMaximized'](_0x20a50e);}}class da extends _0x474324{static get['requires'](){return[ua,ha];}static get['pluginName'](){return'AIChatHistory';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class _a extends _0x474324{static get['requires'](){return[Qs,zs,ia,da];}static get['pluginName'](){return'AIChat';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x38b3cd){super(_0x38b3cd),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 Aa extends kt{['id'];constructor(_0x2b894b,_0x45e8c6){super(_0x2b894b);const {id:_0x2750ff,type:_0x47415b,icon:_0x2e66cc}=_0x45e8c6;this['id']=_0x2750ff,this['set']({'label':_0x45e8c6['label'],'withText':!0x0,'class':'ck-ai-chat-shortcut'}),this['extendTemplate']({'attributes':{'data-cke-ai-shortcut-id':_0x45e8c6['id']}}),_0x2e66cc?this['icon']=_0x2e66cc:'chat'===_0x47415b?this['icon']=_0x352240:'review'===_0x47415b?this['icon']=_0x220492:'translate'===_0x47415b&&(this['icon']=_0x2a0a11);}}class ga extends Nt{['listView'];constructor(_0x563c28,_0x34d130){super(_0x563c28);const _0x410338=_0x34d130['map'](_0x408cf3=>{const _0x307022=new Pt(this['locale']),_0x76b7bc=new Aa(this['locale'],_0x408cf3);return _0x307022['children']['add'](_0x76b7bc),_0x76b7bc['delegate']('execute')['to'](this),_0x307022;});this['listView']=new Lt(this['locale']),this['listView']['items']['addMany'](_0x410338),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat-shortcuts']},'children':[this['listView']]});}}const Ia='chat-shortcuts';class Ea extends _0x474324{['_shortcuts'];['_shortcutsView'];['_aiChatUI'];static get['requires'](){return[ia];}static get['pluginName'](){return'AIChatShortcuts';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){this['_aiChatUI']=this['context']['plugins']['get'](ia),this['_shortcuts']=this['context']['config']['get']('ai.chat.shortcuts')??[];const _0x3f252c=this['context']['plugins']['get']('AIChatController');this['_shortcuts']['length']&&(this['_validateShortcuts'](),this['_aiChatUI']['on']('conversationCreated',()=>{_0x3f252c['activeConversation']['isFromHistory']||this['_injectShortcuts']();}),this['listenTo'](_0x3f252c,'interactionStarted',()=>{this['_removeShortcuts']();}));}['_validateShortcuts'](){const _0x2cc7e3=['chat','review','translate'];this['_shortcuts']['forEach'](_0x1301a7=>{let _0x2bd570=!0x0;if(_0x1301a7['id']&&_0x1301a7['label']&&_0x2cc7e3['includes'](_0x1301a7['type'])?'chat'===_0x1301a7['type']&&(_0x2bd570='string'==typeof _0x1301a7['prompt']):_0x2bd570=!0x1,!_0x2bd570)throw new ot('ai-chat-shortcuts-invalid-config',this['context'],{'shortcut':_0x1301a7});});}['_injectShortcuts'](){const _0x2b17ad=this['context']['plugins']['get'](ia);this['_shortcutsView']=new ga(this['context']['locale'],this['_shortcuts']),this['_shortcutsView']['render'](),_0x2b17ad['addFeedItemCustomElement'](this['_shortcutsView']['element'],Ia),this['_shortcutsView']['on']('execute',_0x1208ed=>{const _0x5b0efd=_0x1208ed['source']['id'];this['_executeShortcut'](_0x5b0efd);});}['_removeShortcuts'](){const _0x415518=this['context']['plugins']['get'](ia);_0x415518['hasFeedItem'](Ia)&&_0x415518['removeFeedItem'](Ia),this['_shortcutsView']?.['destroy']();}['_executeShortcut'](_0x1fbfba){const _0x494bda=this['_shortcuts']['find'](_0x3f8e26=>_0x3f8e26['id']===_0x1fbfba),_0x27d9cb=_0x494bda['type'];'chat'===_0x27d9cb?this['_runChatShortcut'](_0x494bda):'review'===_0x27d9cb?_0x494bda['commandId']?this['_runReviewShortcut'](_0x494bda):this['_switchTab']('reviewMode'):'translate'===_0x27d9cb&&(_0x494bda['language']?this['_runTranslateShortcut'](_0x494bda):this['_switchTab']('translate'));}['_switchTab'](_0x3dd50e){if(!this['context']['plugins']['has']('AITabs'))throw new ot('ai-chat-shortcuts-ai-tabs-not-found',this['context'],{'tabName':_0x3dd50e});this['context']['plugins']['get']('AITabs')['view']['activateTab'](_0x3dd50e);}async['_runChatShortcut']({prompt:_0x1e1da7,draftMode:_0x547e8a,useWebSearch:_0x1a6739=!0x1,useReasoning:_0x4edb18=!0x1,model:_0x325234}){const _0x19ea17=this['context']['plugins']['get']('AIChatController'),_0x40379f=_0x19ea17['activeConversation'];let _0x1566e7;_0x1566e7=_0x325234?await _0x40379f['chatModels']['getModel'](_0x325234):await _0x40379f['chatModels']['getDefault'](),_0x1566e7&&await _0x40379f['setModel'](_0x1566e7),_0x40379f['setWebSearch'](_0x1a6739),_0x40379f['setReasoning'](_0x4edb18),_0x19ea17['addCurrentDocumentToChatContext'](),_0x547e8a?(this['_aiChatUI']['setPromptInputValue'](_0x1e1da7),this['_aiChatUI']['focusPromptInput'](!0x0)):_0x19ea17['sendMessage']({'message':_0x1e1da7});}['_runReviewShortcut']({commandId:_0x389549,model:_0x40f32b,prompt:_0x170dc6,params:_0x4384bc}){if(!this['context']['plugins']['has']('AIReviewModeUI'))throw new ot('ai-chat-shortcuts-review-mode-not-found',this['context']);this['_switchTab']('reviewMode');const _0x482456={'id':_0x389549,'isCustom':'custom'===_0x389549};_0x40f32b&&_0x170dc6&&(_0x482456['args']={'model':_0x40f32b,'prompt':_0x170dc6}),_0x4384bc&&(_0x482456['params']=_0x4384bc),this['context']['plugins']['get']('AIReviewModeUI')['fire']('runReviewCheck',_0x482456);}['_runTranslateShortcut']({language:_0x55c7c4}){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':_0x55c7c4,'args':{'language':_0x55c7c4}});}}class pa extends _0x1f824d{constructor(_0x647d74){super(_0x647d74);const _0x1902f0=_0x647d74['plugins']['get']('AITabs')['view'];this['bind']('value')['to'](_0x1902f0,'isVisible'),this['isEnabled']=!0x0;}['execute'](){const _0x3ffdea=this['editor']['plugins']['get']('AITabs')['view'];_0x3ffdea['isVisible']=!_0x3ffdea['isVisible'];}}class Ta extends _0x44ca98{static get['requires'](){return[os];}static get['pluginName'](){return'AIToggleButtonUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x41212a=this['editor'];_0x41212a['commands']['add']('toggleAi',new pa(_0x41212a)),_0x41212a['ui']['componentFactory']['add']('toggleAi',()=>{const _0x3256ab=this['_createAIUIButton'](kt);return _0x3256ab['set']({'tooltip':!0x0,'class':'ck-ai-toggle-button'}),_0x3256ab;}),_0x41212a['ui']['componentFactory']['add']('menuBar:toggleAi',()=>{const _0x23d79e=this['_createAIUIButton'](Kt);return _0x23d79e['set']({'role':'menuitemcheckbox'}),_0x23d79e;});}['_createAIUIButton'](_0x3f81ff){const _0x19b8e0=this['editor'],_0x49dadc=_0x19b8e0['commands']['get']('toggleAi'),_0x356e11=new _0x3f81ff(_0x19b8e0['locale']);return _0x356e11['set']({'label':cs(_0x19b8e0['locale'],'AI_TOGGLE_BUTTON_LABEL'),'icon':_0x4d8f34,'isToggleable':!0x0}),_0x356e11['bind']('isEnabled')['to'](_0x49dadc),_0x356e11['bind']('isOn')['to'](_0x49dadc,'value',_0x4887ec=>!!_0x4887ec),this['listenTo'](_0x356e11,'execute',()=>{_0x49dadc['execute']();}),_0x356e11;}}const ma=['applySuggestion','insertSuggestion','showNext','showPrevious'];class Ca extends Nt{['_errorView'];constructor(_0x2fa55f){super(_0x2fa55f),this['set']('_errorMessage',''),this['set']('_isErrorVisible',!0x1);}['showBlockingError'](_0x240ee2){this['showError'](_0x240ee2);}['showError'](_0x57d518){this['_errorView']||(this['_errorView']=this['_createErrorView']()),this['_errorMessage']=_0x57d518,this['_isErrorVisible']=!0x0;}['hideError'](){this['_isErrorVisible']=!0x1;}['_createErrorView'](){const _0x2df07a=new Nt(this['locale']),_0x567def=new Nt(this['locale']);return _0x567def['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-suggestion__error-text']},'children':[{'text':this['bindTemplate']['to']('_errorMessage')}]}),_0x2df07a['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__error','ck-ai-balloon-error',this['bindTemplate']['if']('_isErrorVisible','ck-hidden',_0x497ea3=>!_0x497ea3)]},'children':[_0x567def]}),_0x2df07a;}}const wa=0xa;class fa extends _0x474324{static get['requires'](){return[zs];}static get['pluginName'](){return'AIBalloon';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['isOpen']=!0x1;['_currentConfig'];['_isUpdatingMarkers']=!0x1;['open'](_0x17ad90){const {id:_0x24974f}=this['_currentConfig']??{};this['_currentConfig']=_0x17ad90;const {id:_0x2b87d3}=this['_currentConfig'];this['isOpen']&&_0x24974f===_0x2b87d3?this['_updateDialog']():this['_showDialog']();}['close'](){const _0x4bb51c=Ys(this['context'])['plugins']['get']('Dialog');_0x4bb51c['isOpen']&&this['_currentConfig']&&_0x4bb51c['id']===this['_currentConfig']['id']&&_0x4bb51c['hide']();}['_updateDialog'](){const _0x44464b=Ys(this['context'])['plugins']['get']('Dialog'),{icon:_0x37884f,title:_0x24178c}=this['_currentConfig'];_0x44464b['view']?.['headerView']&&(_0x44464b['view']['headerView']['label']=_0x24178c,_0x44464b['view']['headerView']['iconView']&&_0x37884f&&(_0x44464b['view']['headerView']['iconView']['content']=_0x37884f)),this['_isUpdatingMarkers']=!0x0,this['_showFakeVisualSelection'](),this['_isUpdatingMarkers']=!0x1,_0x44464b['view']?.['updatePosition']();}['_showFakeVisualSelection'](){this['context']['plugins']['get'](zs)['showFakeVisualSelection']({'ranges':this['_currentConfig']['ranges'],'id':'balloon','priority':0x64}),window['getSelection']()?.['removeAllRanges']();}['_hideFakeVisualSelection'](){this['context']['plugins']['get'](zs)['hideFakeVisualSelection']('balloon');}['_showDialog'](){const _0x4cb02b=Ys(this['context'])['plugins']['get']('Dialog'),{id:_0x1ce9e5,title:_0x45edf7,icon:_0x58ce7a,class:_0x1aef5f,mainView:_0x1c51b6}=this['_currentConfig'];_0x1c51b6['delegate'](...ma)['to'](this),_0x4cb02b['show']({'title':_0x45edf7,'icon':_0x58ce7a,'hasCloseButton':!0x0,'id':_0x1ce9e5,'position':this['_calculateDialogPosition']['bind'](this),'className':'ck-ai-balloon\x20'+(_0x1aef5f||''),'content':_0x1c51b6,'onShow':_0xa75e60=>{this['_showFakeVisualSelection'](),this['_setupFakeVisualSelectionMarkerRemovalListener']();const _0x93c58=this['_getSelectionElements']();_0x93c58&&_0x93c58[0x0]&&mt({'target':_0x93c58[0x0],'ancestorOffset':0x14,'alignToTop':!0x0,'viewportOffset':{'top':0x14,'bottom':0x14,'left':0x0,'right':0x0}}),this['isOpen']=!0x0,_0xa75e60['once']('hide',()=>{this['fire']('beforeDialogClosed',{'id':_0x1ce9e5});},{'priority':'high'});},'onHide':()=>{this['_hideFakeVisualSelection'](),this['_cleanupFakeVisualSelectionMarkerRemovalListener'](),this['fire']('dialogClosed',{'id':_0x1ce9e5}),this['isOpen']=!0x1;}});}['_calculateDialogPosition'](_0x5d7c52,_0x2230e3){if(!_0x2230e3)return null;const _0x469a88=this['_getSelectionElements']();if(!_0x469a88||0x0===_0x469a88['length'])return{'left':Math['round'](_0x2230e3['left']+_0x2230e3['width']/0x2-_0x5d7c52['width']/0x2),'top':Math['round'](_0x2230e3['top']+_0x2230e3['height']/0x2-_0x5d7c52['height']/0x2)};const _0x778e2d=Math['round'](_0x2230e3['left']+_0x2230e3['width']/0x2-_0x5d7c52['width']/0x2),_0x51d9b7=_0x469a88['map'](_0xfa88d1=>new ut(_0xfa88d1)),_0x6e4bfb=_0x5d7c52['height'];return{'left':_0x778e2d,'top':this['_calculateOptimalTopPosition'](_0x51d9b7,_0x6e4bfb,_0x2230e3)};}['_calculateOptimalTopPosition'](_0x186979,_0x46aa4f,_0x2b6fae){const _0x39b033=new ut(ct['window']),_0x735b8a=_0x186979['map'](_0x19a8e9=>_0x19a8e9['getVisible']())['filter'](_0x4fdf9f=>_0x4fdf9f),_0x599e9e=ut['getBoundingRect'](_0x735b8a);if(!_0x599e9e)return Math['round'](_0x2b6fae['top']+_0x2b6fae['height']/0x2);const _0x7978de=_0x39b033['getIntersection'](_0x599e9e);if(!_0x7978de)return Math['round'](_0x2b6fae['top']+_0x2b6fae['height']/0x2);const _0x2053eb=_0x2b6fae['getVisible'](),_0x4e2852=_0x2053eb&&_0x599e9e['height']>_0x2053eb['height'],_0x4231d1=_0x7978de['top'],_0x456d5b=_0x7978de['bottom'];if(_0x4e2852){const _0x297050=(_0x2053eb||_0x39b033)['height']/0x2-_0x46aa4f/0x2,_0x158579=_0x4231d1-wa-_0x2b6fae['top'],_0x51df30=_0x2b6fae['bottom']-_0x456d5b-wa;return _0x158579>=_0x46aa4f?Math['max'](wa,_0x4231d1-_0x46aa4f-wa):_0x51df30>=_0x46aa4f?_0x456d5b+wa:Math['max'](wa,_0x297050);}const _0x3c62f9=_0x4231d1-_0x46aa4f,_0x493e8d=_0x2b6fae['bottom']-_0x456d5b-wa,_0x24eb32=_0x4231d1-wa-_0x2b6fae['top'];let _0x2197da;if(_0x493e8d>=_0x46aa4f)_0x2197da=_0x456d5b+wa;else{if(_0x24eb32>=_0x46aa4f)_0x2197da=_0x3c62f9-wa;else _0x2197da=_0x4231d1+_0x599e9e['height']/0x2-_0x46aa4f/0x2;}return _0x2197da;}['_setupFakeVisualSelectionMarkerRemovalListener'](){const _0x5a746a=Ys(this['context']);this['listenTo'](_0x5a746a['model']['document'],'change',()=>{if(!this['_isUpdatingMarkers']){for(const {name:_0x508329,data:{newRange:_0x42d27f}}of _0x5a746a['model']['document']['differ']['getChangedMarkers']())if(_0x508329['startsWith'](Xs+':')&&(_0x42d27f&&(_0x42d27f['start']['isEqual'](_0x42d27f['end'])||'$graveyard'==_0x42d27f['root']['rootName'])||null==_0x42d27f)){const _0x3cddaf=cs(this['context']['locale'],'AI_BALLOON_SELECTION_REMOVED_ERROR');this['_currentConfig']['mainView']['showBlockingError'](_0x3cddaf),this['fire']('selectionRemoved');}}});}['_cleanupFakeVisualSelectionMarkerRemovalListener'](){const _0x4a73ea=Ys(this['context']);this['_currentConfig']['mainView']['hideError'](),this['stopListening'](_0x4a73ea['model']['document']);}['_getSelectionElements'](){const _0x569730=Ys(this['context']);return _0x56b4d1(_0x569730['editing'],[..._0x569730['model']['markers']['getMarkersGroup']('ai-selection'),..._0x569730['model']['markers']['getMarkersGroup']('ai-balloon-selection')]);}}class Sa extends Ot{['copyButton'];['likeButton'];['dislikeButton'];['showChangesButton'];['_config'];constructor(_0x29b76d,_0x1a0ba6={}){super(_0x29b76d),this['set']('isEnabled',!0x0),this['set']('isShowChangesOn',!0x1),this['_config']={'showCopy':!0x1,'showLike':!0x1,'showDislike':!0x1,..._0x1a0ba6};const _0x2d2730=!(this['_config']['showCopy']||this['_config']['showChanges']||this['_config']['showLike']||this['_config']['showDislike']||this['_config']['customView']?.['length']);this['class']=_0x2d2730?'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'](_0x5ddc97){this['showChangesButton']['isEnabled']=_0x5ddc97;}['_setupRatingButtons'](){this['likeButton']=new kt(this['locale']),this['likeButton']['set']({'icon':_0x58f916,'label':cs(this['locale'],'AI_MINI_TOOLBAR_LIKE'),'class':ds,'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':_0x4943a3,'label':cs(this['locale'],'AI_MINI_TOOLBAR_DISLIKE'),'class':ds,'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':_0x47de82,'label':cs(this['locale'],'AI_MINI_TOOLBAR_COPY'),'class':'ck-ai-mini-toolbar-copy-button\x20'+ds,'tooltip':!0x0}),this['copyButton']['bind']('isEnabled')['to'](this);const _0x17cd35=new yt();_0x17cd35['set']({'content':_0x1d53d5}),_0x17cd35['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'+ds,setTimeout(()=>{this['copyButton']['class']='ck-ai-mini-toolbar-copy-button\x20'+ds;},0x7d0);}),this['copyButton']['children']['add'](_0x17cd35);}['_setupShowChangesButton'](){this['showChangesButton']=new kt(this['locale']),this['showChangesButton']['set']({'icon':_0x5b5c9e,'label':cs(this['locale'],'AI_SUGGESTION_BUTTON_SHOW_CHANGES'),'withText':'full'==this['_config']['showChanges'],'tooltip':'full'!=this['_config']['showChanges'],'class':ds}),this['showChangesButton']['bind']('isOn')['to'](this,'isShowChangesOn'),this['showChangesButton']['bind']('isEnabled')['to'](this),this['showChangesButton']['bind']('icon')['to'](this,'isShowChangesOn',_0x477ae4=>_0x477ae4?_0x3f61e6:_0x5b5c9e),this['showChangesButton']['on']('execute',()=>{this['fire']('toggleShowChanges');});}}class ba extends Ca{['children'];['nextButtonView'];['previousButtonView'];['focusCycler'];['_focusables'];['_focusTracker'];['_keystrokes'];['_config'];['_streamableContentView'];['_toolbarContainerView'];['_partToolbarView'];['_stateView'];['_miniToolbarView'];constructor(_0x1e86f0,_0x2d8da1){super(_0x1e86f0);const _0x5e7345=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']=_0x2d8da1,this['nextButtonView']=this['_createNextButtonView'](),this['previousButtonView']=this['_createPreviousButtonView'](),this['_streamableContentView']=new An(_0x1e86f0),this['_partToolbarView']=new un(_0x1e86f0,_0x2d8da1['availableActions']),this['_partToolbarView']['delegate']('applySuggestion','insertSuggestion','rejectSuggestion')['to'](this),this['_togglePartToolbarButtonsVisibility'](_0x2d8da1),this['_stateView']=new cn(_0x1e86f0),this['_stateView']['isVisible']=!0x1,this['_miniToolbarView']=new Sa(_0x1e86f0,{'showChanges':'full'}),this['_miniToolbarView']['bind']('isShowChangesOn')['to'](this,'showDiff'),this['_miniToolbarView']['on']('toggleShowChanges',()=>{this['fire']('toggleSuggestionDisplayMode');}),this['_toolbarContainerView']=new Ra(_0x1e86f0,[this['_partToolbarView'],this['_stateView'],this['_miniToolbarView']]),this['children']=this['createCollection']([this['_streamableContentView'],this['_toolbarContainerView']]),this['on']('change:_state',(_0xda2c6c,_0x1e84e4,_0x2b4b59,_0x35d117)=>{let _0x908843,_0x13fbb1;'pending'===_0x35d117?(_0x908843=this['_partToolbarView'],_0x13fbb1=this['_stateView']):(_0x908843=this['_stateView'],_0x13fbb1=this['_partToolbarView']),this['_stateView']['setState'](_0x2b4b59),_0x908843['isVisible']=!0x1,_0x13fbb1['isVisible']=!0x0;}),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat-balloon-main',_0x5e7345['to']('_state',_0x5768fd=>'ck-ai-chat-balloon-main_state_'+_0x5768fd)]},'children':this['children']}),this['on']('change:isTrackChangesOn',()=>{this['_togglePartToolbarButtonsVisibility'](_0x2d8da1);});}['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'](_0x300d34){_0x300d34?.['keepErrors']||this['hideError'](),await this['_streamableContentView']['update'](_0x300d34);}['setState'](_0x2330e6){this['_state']=_0x2330e6;}['showError'](_0x5c580d){super['showError'](_0x5c580d),this['children']['has'](this['_errorView'])||this['children']['add'](this['_errorView'],0x0);}['hideError'](){this['_isErrorVisible']&&(super['hideError'](),this['togglePartToolbarEnabled'](!0x0));}['showBlockingError'](_0x2c58c4){super['showBlockingError'](_0x2c58c4),this['togglePartToolbarEnabled'](!0x1);}['toggleRotatorButtonsVisibility'](_0x556292){this['nextButtonView']['isVisible']=this['previousButtonView']['isVisible']=_0x556292;}['togglePartToolbarEnabled'](_0x17f864){this['_partToolbarView']['isEnabled']=_0x17f864;}['_togglePartToolbarButtonsVisibility']({showApplyButton:_0x4fcc0a,showSuggestButton:_0x114438}){_0x4fcc0a=_0x4fcc0a&&!this['isTrackChangesOn']&&this['_config']['availableActions']['includes']('applySuggestion'),_0x114438=_0x114438&&this['_config']['availableActions']['includes']('insertSuggestion'),this['_partToolbarView']['setButtonsVisibility']({'showApplyButton':_0x4fcc0a,'showSuggestButton':_0x114438});}['_createNextButtonView'](){const _0x1f1ff6=new kt(this['locale']);return _0x1f1ff6['set']({'icon':_0x4b489c,'label':cs(this['locale'],'AI_BALLOON_NEXT_LABEL'),'isVisible':!0x0}),_0x1f1ff6['on']('execute',()=>{this['fire']('showNext');}),_0x1f1ff6;}['_createPreviousButtonView'](){const _0x49b673=new kt(this['locale']);return _0x49b673['set']({'icon':_0x457a91,'label':cs(this['locale'],'AI_BALLOON_PREVIOUS_LABEL'),'isVisible':!0x0}),_0x49b673['on']('execute',()=>{this['fire']('showPrevious');}),_0x49b673;}}class Ra extends Nt{constructor(_0x147f68,_0x5841a3){super(_0x147f68),this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-balloon__toolbar-container']},'children':_0x5841a3});}}class Oa extends _0x44ca98{static get['requires'](){return[Vt,fa];}static get['pluginName'](){return'AIChatBalloon';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['_chatBalloonView'];constructor(_0x21a846){super(_0x21a846),this['set']('showDiff',!0x1);}['open'](_0x2e3a03){const _0x1f9f66=this['editor'];this['_chatBalloonView']||(this['_chatBalloonView']=this['_createChatBalloonView']()),_0x1f9f66['plugins']['get']('AIBalloon')['open']({..._0x2e3a03,'id':'aiChatBalloon','class':'ck-ai-chat-balloon','mainView':this['_chatBalloonView']}),this['_toggleRotatorButtonsInDialogHeader'](_0x2e3a03['showRotator']),this['_chatBalloonView']['togglePartToolbarEnabled'](!_0x2e3a03['areActionsDisabled']),this['_restoreDefaultViewFocus']();}['close'](){this['editor']['plugins']['get']('AIBalloon')['close']();}['updateContent'](_0x56f6d9){return this['_chatBalloonView']||(this['_chatBalloonView']=this['_createChatBalloonView']()),this['_chatBalloonView']['updateContent'](_0x56f6d9);}['setState'](_0x3773bc){this['_chatBalloonView']&&this['_chatBalloonView']['setState'](_0x3773bc);}['_createChatBalloonView'](){const _0x24a47c=this['editor'],_0x5b8205=_0x24a47c['plugins']['get']('AIBalloon'),_0x3c07d0=_0x24a47c['commands']['get']('trackChanges');let _0x22b33c=_0x24a47c['config']['get']('ai.availableReplyActions')||[...pn];_0x24a47c['plugins']['has']('TrackChanges')||(_0x22b33c=_0x22b33c['filter'](_0x5d4b51=>'insertSuggestion'!=_0x5d4b51));const _0x77a45b=new ba(_0x24a47c['locale'],{'availableActions':_0x22b33c,'showApplyButton':!0x0,'showSuggestButton':!!_0x3c07d0});return _0x77a45b['bind']('showDiff')['to'](this),_0x77a45b['delegate'](...js)['to'](this),_0x77a45b['delegate']('showPrevious','showNext')['to'](this),_0x5b8205['delegate']('dialogClosed')['to'](this),_0x77a45b['on']('applySuggestion',this['_restoreDefaultViewFocus']['bind'](this)),_0x77a45b['on']('insertSuggestion',this['_restoreDefaultViewFocus']['bind'](this)),_0x77a45b['on']('rejectSuggestion',this['_restoreDefaultViewFocus']['bind'](this)),_0x3c07d0&&_0x77a45b['bind']('isTrackChangesOn')['to'](_0x3c07d0,'value'),_0x77a45b['render'](),_0x77a45b;}['_toggleRotatorButtonsInDialogHeader'](_0x3ed373){const _0x5b6648=this['editor'],_0x3b14f9=_0x5b6648['plugins']['get']('Dialog')['view']['headerView']['children'];this['_chatBalloonView']['toggleRotatorButtonsVisibility'](_0x3ed373),_0x3b14f9['has'](this['_chatBalloonView']['previousButtonView'])||(_0x3b14f9['addMany']([this['_chatBalloonView']['previousButtonView'],this['_chatBalloonView']['nextButtonView']],0x0),_0x5b6648['plugins']['get']('AIBalloon')['once']('beforeDialogClosed',()=>{_0x3b14f9['remove'](this['_chatBalloonView']['previousButtonView']),_0x3b14f9['remove'](this['_chatBalloonView']['nextButtonView']);}));}['_restoreDefaultViewFocus'](){this['_chatBalloonView']['focus']();}}class ka extends _0x44ca98{static get['requires'](){return[Ta,Oa,_0x21b190];}static get['pluginName'](){return'AIEditorIntegration';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}function Na(_0x1e1ec7){const {editor:_0x56bc5e,action:_0x12fe23,withText:_0x458855=!0x1,withIcon:_0x192270=!0x0,isInDropdown:_0x4c0b2c=!0x0,shouldPreventFocus:_0x577580=!0x1}=_0x1e1ec7;return()=>{const _0x2490da=_0x56bc5e['locale'],_0x46b4f3=new kt(_0x2490da),_0x528709=_0x46b4f3['bindTemplate'];_0x4c0b2c&&_0x46b4f3['extendTemplate']({'on':{'mouseenter':_0x528709['to'](()=>{_0x577580&&_0x577580()||_0x46b4f3['focus']();})}});const _0xd1bf5b=_0x12fe23['icon']??_0x12fe23['parent']?.['icon'];return _0x46b4f3['set']({'label':_0x12fe23['label'],'withText':_0x458855,'role':'menuitem','icon':_0x192270?_0xd1bf5b??_0x52c012:void 0x0,'tooltip':!_0x458855,'class':'ck-ai-quick-actions-button','isEnabled':_0x12fe23['isEnabled']}),_0x46b4f3['on']('execute',()=>{_0x56bc5e['editing']['view']['focus'](),_0x56bc5e['commands']['execute']('aiQuickAction',_0x12fe23);}),_0x46b4f3;};}class va extends _0x1758b4{['arrowView'];constructor(_0x4b7ce0,_0x179cb3){super(_0x4b7ce0,_0x179cb3);const _0x4b4476=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',_0x3af796=>String(_0x3af796)),'data-cke-tooltip-disabled':_0x4b4476['to']('isOn')},'on':{'mouseenter':_0x4b4476['to']('mouseenter')}});}['render'](){super['render'](),this['children']['add'](this['arrowView']);}['_createArrowView'](){const _0x293dd4=new yt();return _0x293dd4['content']=_0x28906d,_0x293dd4['extendTemplate']({'attributes':{'class':'ck-dropdown-menu-list__nested-menu__button__arrow'}}),_0x293dd4;}}class ya extends Lt{['_allListItems'];['_allSearchableItems'];constructor(_0x1beaf7,_0x21927d,_0x53956d){super(_0x1beaf7),this['_allListItems']=_0x21927d,this['_allSearchableItems']=_0x53956d;}['filter'](_0xc3dbc1){if(!_0xc3dbc1)return this['items']['clear'](),this['items']['addMany'](this['_allListItems']),this['_clearHighlight'](),{'resultsCount':this['_allListItems']['length'],'totalItemsCount':this['_allListItems']['length']};const _0x20a711=_0xc3dbc1['source']['toLowerCase']()['trim'](),_0x5acddb=this['_allSearchableItems']['filter'](_0x203d25=>(_0x203d25['groupLabel']?_0x203d25['label']+'\x20('+_0x203d25['groupLabel']+')':_0x203d25['label'])['toLowerCase']()['includes'](_0x20a711));return this['items']['clear'](),this['items']['addMany'](_0x5acddb['sort']((_0x53e763,_0x4f1a00)=>{const _0xec5535=_0x53e763['groupLabel'],_0xcd3f32=_0x4f1a00['groupLabel'];return _0xec5535||_0xcd3f32?_0xec5535?0x1:-0x1:0x0;})['map'](_0x288316=>_0x288316['item'])),this['_highlightQuery'](_0x20a711,_0x5acddb),{'resultsCount':_0x5acddb['length'],'totalItemsCount':this['_allSearchableItems']['length']};}['_highlightQuery'](_0x4ad5c0,_0x40f323){if(!_0x4ad5c0)return;const _0x47c306=new RegExp(_0x8cd30a(_0x4ad5c0),'gi');_0x40f323['forEach'](_0x5cb95f=>{_0x5cb95f['highlightViews']&&_0x5cb95f['highlightViews']['forEach'](_0x5605d3=>{'function'==typeof _0x5605d3['highlightText']&&_0x5605d3['highlightText'](_0x47c306);});});}['_clearHighlight'](){this['_allSearchableItems']['forEach'](_0x4c3eb4=>{_0x4c3eb4['highlightViews']&&_0x4c3eb4['highlightViews']['forEach'](_0x13ec5f=>{'function'==typeof _0x13ec5f['highlightText']&&_0x13ec5f['highlightText'](null);});});}}const xa='menu',La='menuitem';class Da extends Nt{['_bodyCollection'];['optionsListView'];['_searchTextView']=null;['_allSearchableItems']=[];['children'];['focusTracker'];['keystrokes'];['_focusables'];['focusCycler'];['_openNestedPanels']=new Set();['_hasSearch'];constructor(_0x4623e4,_0x483fef,_0x125833,_0x197301,_0xa2e2b5=!0x1){const _0x18abe1=_0x4623e4['locale'];super(_0x18abe1),this['_bodyCollection']=_0x197301,this['_hasSearch']=_0xa2e2b5;const _0x2ab1b6=this['_createListItems'](_0x4623e4,_0x483fef,_0x125833);this['optionsListView']=new ya(_0x18abe1,_0x2ab1b6,this['_allSearchableItems']),this['optionsListView']['role']=xa,this['optionsListView']['items']['addMany'](_0x2ab1b6),this['focusTracker']=new _t(),this['keystrokes']=new At(),_0xa2e2b5&&(this['_searchTextView']=this['_createSearchTextView']()),this['_focusables']=_0x2ab1b6,this['focusCycler']=new Mt({'focusables':this['_focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes']}),_0xa2e2b5&&this['_searchTextView']&&this['focusCycler']['chain'](this['_searchTextView']['focusCycler']);const _0x5028a7=_0xa2e2b5&&this['_searchTextView']?[this['_searchTextView']]:[this['optionsListView']];this['children']=new _0x534e2b(_0x5028a7),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-ai-quick-actions','ck-rounded-corners'],'dir':_0x18abe1['uiLanguageDirection']},'children':this['children']});}['_createSearchTextView'](){return new _0x1776e0(this['locale'],{'filteredView':this['optionsListView'],'queryView':{'label':cs(this['locale'],'AI_QUICK_ACTIONS_SEARCH')},'class':'ck-ai-quick-actions-search','infoView':{'text':{'notFound':{'primary':cs(this['locale'],'AI_QUICK_ACTIONS_SEARCH_NOT_FOUND')}}}});}['_isSearchFocused'](){if(!this['_hasSearch']||!this['_searchTextView']||!this['_searchTextView']['queryView']['fieldView']['element'])return!0x1;const _0x2e7f61=this['_searchTextView']['queryView']['fieldView']['element']['ownerDocument']?.['activeElement'];return this['_searchTextView']['queryView']['fieldView']['element']['contains'](_0x2e7f61);}['_createListItems'](_0x5f4643,_0x3922a5,_0xd8c9d3){const _0x3c3b41=new _0x534e2b();return _0x3922a5['forEach'](_0x10b066=>{if('actions'in _0x10b066){const {listItem:_0x32e05c}=this['_createActionGroupButton'](_0x5f4643,_0x10b066,_0xd8c9d3);_0x3c3b41['add'](_0x32e05c),_0x10b066['actions']['forEach'](_0x113f17=>{this['_createActionButton'](_0x5f4643,_0x113f17,_0x10b066['label'],_0x10b066['icon']);const {listItem:_0x21a0a1,highlightViews:_0x5e0aa1}=this['_createSearchResultActionButton'](_0x5f4643,_0x113f17,_0x10b066['label'],_0x10b066['icon']);this['_allSearchableItems']['push']({'item':_0x21a0a1,'label':_0x113f17['label'],'groupLabel':_0x10b066['label'],'highlightViews':_0x5e0aa1});});}else{const {listItem:_0x5cc785}=this['_createActionButton'](_0x5f4643,_0x10b066);_0x3c3b41['add'](_0x5cc785);const _0x7e7505=_0x5cc785['children']['first'];if(_0x7e7505){const {listItem:_0x2ec2fa,highlightViews:_0x51ccfe}=this['_createSearchResultActionButton'](_0x5f4643,_0x10b066);this['_allSearchableItems']['push']({'item':_0x2ec2fa,'label':_0x7e7505['label']||'','highlightViews':_0x51ccfe});}}}),_0x3c3b41;}['_createActionButton'](_0x55ddf9,_0x5567cc,_0x4bc21a,_0x222f4f){const _0x51c429=new Pt(this['locale']);if(_0x4bc21a&&_0x222f4f){const _0x542e76=new kt(this['locale']),_0x1c0d00=_0x542e76['bindTemplate'],_0x397df7=new _0x3d1ec8();_0x397df7['text']=_0x5567cc['label'];const _0xabe320=new _0x3d1ec8();_0xabe320['text']=_0x4bc21a;const _0x423cb0=new yt();_0x423cb0['content']=_0x222f4f,_0x423cb0['extendTemplate']({'attributes':{'class':'ck-ai-quick-actions-button__group-icon'}});const _0x5c806f=new Nt(this['locale']);_0x5c806f['setTemplate']({'tag':'span','attributes':{'class':'ck-ai-quick-actions-button_with-group__open-paren'},'children':[{'text':'\x20('}]});const _0x44b83e=new Nt(this['locale']);return _0x44b83e['setTemplate']({'tag':'span','attributes':{'class':'ck-ai-quick-actions-button_with-group__close-paren'},'children':[{'text':')'}]}),_0x542e76['set']({'label':_0x5567cc['label']+'\x20('+_0x4bc21a+')','withText':!0x0,'role':'menuitem','class':'ck-ai-quick-actions-button\x20ck-ai-quick-actions-button_with-group','tooltip':!0x1}),_0x542e76['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':[_0x397df7,_0x5c806f,_0x423cb0,_0xabe320,_0x44b83e],'on':{'mouseenter':_0x1c0d00['to'](()=>{this['_isSearchFocused']()||_0x542e76['focus']();}),'click':_0x1c0d00['to'](()=>{_0x542e76['fire']('execute');})}}),_0x542e76['on']('execute',()=>{_0x55ddf9['editing']['view']['focus'](),_0x55ddf9['commands']['execute']('aiQuickAction',_0x5567cc);}),_0x51c429['children']['add'](_0x542e76),{'listItem':_0x51c429,'highlightViews':[_0x397df7,_0xabe320]};}{const _0x326d3a=new _0x191714(),_0x65614a=new kt(this['locale'],_0x326d3a),_0x332361=_0x65614a['bindTemplate'],_0x350622=_0x5567cc['icon']??_0x5567cc['parent']?.['icon'],_0x1e5cc4=void 0x0!==_0x5567cc['icon'];return _0x65614a['set']({'label':_0x5567cc['label'],'withText':!0x0,'role':'menuitem','icon':_0x1e5cc4?_0x350622??_0x52c012:void 0x0,'tooltip':!0x1,'class':'ck-ai-quick-actions-button'}),_0x65614a['extendTemplate']({'on':{'mouseenter':_0x332361['to'](()=>{this['_isSearchFocused']()||_0x65614a['focus']();})}}),_0x65614a['on']('execute',()=>{_0x55ddf9['editing']['view']['focus'](),_0x55ddf9['commands']['execute']('aiQuickAction',_0x5567cc);}),_0x51c429['children']['add'](_0x65614a),{'listItem':_0x51c429,'highlightViews':[_0x326d3a]};}}['_createSearchResultActionButton'](_0x2a033d,_0x3647e3,_0x4cc2a4,_0x14f56c){return _0x4cc2a4&&_0x14f56c?this['_createSearchResultGroupedActionButton'](_0x2a033d,_0x3647e3,_0x4cc2a4,_0x14f56c):this['_createSearchResultIndividualActionButton'](_0x2a033d,_0x3647e3);}['_createSearchResultGroupedActionButton'](_0x1e5096,_0x16c5ac,_0x548733,_0x2154f2){const _0x56de5a=new Pt(this['locale']),_0x253726=new kt(this['locale']),_0x39a0b4=_0x253726['bindTemplate'],{view:_0x290dc2,highlightView:_0x3b5aeb}=this['_createSearchResultGroupRow'](_0x548733,_0x2154f2),{view:_0x45cd43,highlightView:_0x2ed736}=this['_createSearchResultActionRow'](_0x16c5ac['label']),_0x495199=this['_createSearchResultContentView'](_0x290dc2,_0x45cd43);return _0x253726['set']({'label':_0x16c5ac['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}),_0x253726['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':[_0x495199],'on':{'mouseenter':_0x39a0b4['to'](()=>{this['_isSearchFocused']()||_0x253726['focus']();}),'click':_0x39a0b4['to'](()=>{this['_handleSearchResultButtonClick'](_0x253726);})}}),this['_setupActionButtonExecution'](_0x253726,_0x1e5096,_0x16c5ac),_0x56de5a['children']['add'](_0x253726),{'listItem':_0x56de5a,'highlightViews':[_0x3b5aeb,_0x2ed736]};}['_createSearchResultIndividualActionButton'](_0x15f0fb,_0x57dfbc){const _0x4414d1=new Pt(this['locale']),_0x3347ad=new _0x191714(),_0x7d6e59=new kt(this['locale'],_0x3347ad),_0x23ebbf=_0x7d6e59['bindTemplate'];return _0x7d6e59['set']({'label':_0x57dfbc['label'],'withText':!0x0,'role':'menuitem','icon':void 0x0,'tooltip':!0x1,'class':'ck-ai-quick-actions-button\x20ck-ai-quick-actions-search-result-button'}),_0x7d6e59['extendTemplate']({'on':{'mouseenter':_0x23ebbf['to'](()=>{this['_isSearchFocused']()||_0x7d6e59['focus']();})}}),this['_setupActionButtonExecution'](_0x7d6e59,_0x15f0fb,_0x57dfbc),_0x4414d1['children']['add'](_0x7d6e59),{'listItem':_0x4414d1,'highlightViews':[_0x3347ad]};}['_createSearchResultGroupRow'](_0x3f41a6,_0x25d18e){const _0x125d55=new Nt(this['locale']),_0x49b936=new yt();_0x49b936['content']=_0x25d18e,_0x49b936['extendTemplate']({'attributes':{'class':'ck-ai-quick-actions-button__group-icon'}});const _0x1752e3=new _0x3d1ec8();return _0x1752e3['text']=_0x3f41a6,_0x125d55['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-quick-actions-search-result__group-row'},'children':[_0x49b936,_0x1752e3]}),{'view':_0x125d55,'highlightView':_0x1752e3};}['_createSearchResultActionRow'](_0x2ce8ab){const _0x2f37a4=new Nt(this['locale']),_0x3e4818=new _0x3d1ec8();return _0x3e4818['text']=_0x2ce8ab,_0x2f37a4['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-quick-actions-search-result__action-row'},'children':[_0x3e4818]}),{'view':_0x2f37a4,'highlightView':_0x3e4818};}['_createSearchResultContentView'](_0xa5875d,_0x2debf8){const _0x203b3e=new Nt(this['locale']);return _0x203b3e['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-quick-actions-search-result__content'},'children':[_0xa5875d,_0x2debf8]}),_0x203b3e;}['_setupActionButtonExecution'](_0x571a18,_0x531045,_0x39ce6f){_0x571a18['on']('execute',()=>{_0x531045['editing']['view']['focus'](),_0x531045['commands']['execute']('aiQuickAction',_0x39ce6f);});}['_createActionGroupButton'](_0x59fcc7,_0x4c2474,_0xb5a2d0){const _0x43e64d=new Pt(this['locale']),_0x5cd401=new _0x191714(),_0x4fe7d3=new va(this['locale'],_0x5cd401),_0x57b449=_0x4fe7d3['bindTemplate'],_0x1abda8=this['_getPanelKeystroke'](_0xb5a2d0),_0x16b129=this['_createGroupActionsList'](_0x59fcc7,_0x4c2474['actions'],_0xb5a2d0);_0x4fe7d3['set']({'label':_0x4c2474['label'],'withText':!0x0,'role':La,'icon':_0x4c2474['icon']??_0x52c012,'isEnabled':_0x4c2474['actions']['some'](_0x37b0a3=>_0x37b0a3['isEnabled'])}),_0x4fe7d3['extendTemplate']({'on':{'mouseenter':_0x57b449['to'](()=>{this['_isSearchFocused']()||_0x4fe7d3['focus']();})}});const _0x4706d8=new Qt(this['locale']);return _0x4706d8['extendTemplate']({'attributes':{'class':['ck','ck-reset_all','ck-ai-quick-actions-group-panel','ck-dropdown-menu__nested-menu__panel']},'on':{'keydown':_0x57b449['to'](_0x24d215=>{this['_handlePanelKeydown'](_0x24d215,_0x1abda8,_0x4fe7d3,_0x4706d8);})}}),_0x4fe7d3['bind']('isOn')['to'](_0x4706d8,'isVisible'),this['_bodyCollection']['add'](_0x4706d8),_0x4706d8['content']['add'](_0x16b129),this['_setupGroupMenuBehavior'](_0x4fe7d3,_0x4706d8),_0x43e64d['children']['add'](_0x4fe7d3),{'listItem':_0x43e64d,'highlightView':_0x5cd401};}['_createGroupActionsList'](_0x3a8905,_0x496fdd,_0x5c4f5e){const _0x1a996d=new Lt(this['locale']);return _0x1a996d['extendTemplate']({'attributes':{'class':['ck','ck-reset_all','ck-ai-quick-actions-group-list','ck-dropdown-menu-list']}}),_0x496fdd['forEach'](_0x2a7cf6=>{const _0x1dbbb0=new Pt(this['locale']),_0x3cecce=Na({'editor':_0x3a8905,'action':_0x2a7cf6,'withText':!0x0,'withIcon':!0x1,'isInDropdown':!0x0,'shouldPreventFocus':()=>this['_isSearchFocused']()})();_0x1dbbb0['children']['add'](_0x3cecce),_0x5c4f5e['focusTracker']['add'](_0x3cecce),_0x1a996d['items']['add'](_0x1dbbb0);}),_0x1a996d;}['_setupGroupMenuBehavior'](_0x301102,_0x513a6a){const _0x472b76=_0x301102['bindTemplate'],_0x28a358=this['_getButtonKeystroke'](_0x301102);_0x301102['extendTemplate']({'attributes':{'class':['ck-ai-quick-actions-group-button']},'on':{'mouseenter':_0x472b76['to'](()=>{this['_showNestedPanel'](_0x513a6a,_0x301102);}),'mouseleave':_0x472b76['to'](_0x149389=>{const _0xa9823b=_0x149389['relatedTarget'];this['_isMovingToNestedMenu'](_0xa9823b,_0x513a6a)||this['_hideNestedPanel'](_0x513a6a);}),'keydown':_0x472b76['to'](_0x9a3ee9=>{_0x9a3ee9['key']==_0x28a358&&(this['_showNestedPanel'](_0x513a6a,_0x301102),_0x513a6a['content']['get'](0x0)['focus']());})}}),_0x513a6a['on']('render',()=>{_0x513a6a['element']?.['addEventListener']('mouseleave',_0x131b56=>{const _0x571335=_0x131b56['relatedTarget'];_0x301102['element']?.['contains'](_0x571335)||this['_isMovingToNestedMenu'](_0x571335,_0x513a6a)||this['_hideNestedPanel'](_0x513a6a);});});}['_showNestedPanel'](_0x2c44a3,_0x270c27){this['_openNestedPanels']['forEach'](_0x22f16f=>{_0x22f16f!==_0x2c44a3&&_0x22f16f['isVisible']&&_0x22f16f['hide']();}),_0x2c44a3['show'](),_0x2c44a3['pin']({'positions':[_0x1270c6['eastSouth']],'target':_0x270c27['element'],'fitInViewport':!0x0}),this['_openNestedPanels']['add'](_0x2c44a3);}['_hideNestedPanel'](_0x4692f8){_0x4692f8['hide'](),this['_openNestedPanels']['delete'](_0x4692f8);}['_hideAllNestedPanels'](){this['_openNestedPanels']['forEach'](_0x74ae9=>_0x74ae9['hide']()),this['_openNestedPanels']['clear']();}['_isMovingToNestedMenu'](_0x5a61c,_0x381bad){if(!_0x5a61c)return!0x1;if(_0x381bad['element']?.['contains'](_0x5a61c))return!0x0;const _0xf3c5e9=_0x5a61c;return _0xf3c5e9['closest']&&(null!==_0xf3c5e9['closest']('.ck-ai-quick-actions-group-panel')||null!==_0xf3c5e9['closest']('.ck-ai-quick-actions-group-list')||null!==_0xf3c5e9['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'](_0x4bffb4){return'rtl'===_0x4bffb4['locale']['uiLanguageDirection']?'ArrowRight':'ArrowLeft';}['_getButtonKeystroke'](_0x13b4f2){return'rtl'===_0x13b4f2['locale']['uiLanguageDirection']?'ArrowLeft':'ArrowRight';}['_handlePanelKeydown'](_0x1d37d9,_0x333eda,_0x269ba3,_0x46a618){_0x1d37d9['key']==_0x333eda&&(_0x269ba3['focus'](),this['_hideNestedPanel'](_0x46a618));}['_handleSearchResultButtonClick'](_0x5031fb){_0x5031fb['fire']('execute');}}function Pa(_0x5073a0){const {editor:_0xc6bdb3,content:_0x5e5ab6,buttonDefinition:_0x5e851f,bodyCollection:_0x589aa1,hasSearch:_0x47b462=!0x1}=_0x5073a0;return()=>{const _0x36802d=_0xc6bdb3['locale'],_0x51e81f=Bt(_0x36802d);_0x51e81f['buttonView']['set']({'icon':_0x5e851f['icon']??_0x52c012,'label':_0x5e851f['label'],'tooltip':!0x0}),_0x51e81f['set']({'class':'ck-ai-quick-actions-dropdown'});const _0x1d3bef=new Da(_0xc6bdb3,_0x5e5ab6,_0x51e81f,_0x589aa1,_0x47b462);return _0x51e81f['panelView']['children']['add'](_0x1d3bef),_0x47b462&&_0x51e81f['on']('change:isOpen',(_0x8943f7,_0x313b18,_0x189ad5)=>{if(_0x189ad5){if(_0xc6bdb3['plugins']['has']('AIEditing')){const _0x2369b1=_0xc6bdb3['plugins']['get'](zs),_0x15152b=_0xc6bdb3['model']['document']['selection'],_0x22aeda=Array['from'](_0x15152b['getRanges']());_0x22aeda['length']>0x0&&_0x2369b1['showFakeVisualSelection']({'ranges':_0x22aeda,'id':'quick-action','priority':0x14});}}else _0xc6bdb3['plugins']['has']('AIEditing')&&_0xc6bdb3['plugins']['get'](zs)['hideFakeVisualSelection']('quick-action'),_0x1d3bef['resetSearch']();}),_0x51e81f;};}const Ha='<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>',Ma='<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>',Ua='<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>',Va=/* #__PURE__ -- @preserve */
28
+ ((()=>({'chat':'AIChat','action':'AIActions'}))());class Ba extends _0x44ca98{static get['requires'](){return[_0xc99ac8,hs];}static get['pluginName'](){return'AIQuickActionsUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}async['init'](){const _0x33d7cd=await this['_getDefaultAndCustomActions']();this['_prepareQuickActionsDefinition'](_0x33d7cd),this['_initializeQuickActionsComponentsAndCommands']();}static['getDefaultQuickActions'](_0x167f21){return function(_0x1a4caf){const _0x36174a=new Intl['DisplayNames'](['en'],{'type':'language'})['of'](_0x1a4caf['uiLanguage']),_0x2521d7=_0x36174a||'English',_0xde5d8d=[{'id':'ask-ai','label':cs(_0x1a4caf,'AI_QUICK_ACTIONS_ASK_AI'),'type':'chat','icon':_0x1122f9},{'id':'chat-commands','label':cs(_0x1a4caf,'AI_QUICK_ACTIONS_CHAT_COMMANDS'),'icon':_0x1122f9,'actions':[{'id':'explain','label':cs(_0x1a4caf,'AI_QUICK_ACTIONS_EXPLAIN'),'displayedPrompt':cs(_0x1a4caf,'AI_QUICK_ACTIONS_EXPLAIN'),'prompt':Ha['replace']('%0',_0x2521d7),'type':'chat'},{'id':'summarize','label':cs(_0x1a4caf,'AI_QUICK_ACTIONS_SUMMARIZE'),'displayedPrompt':cs(_0x1a4caf,'AI_QUICK_ACTIONS_SUMMARIZE'),'prompt':Ma['replace']('%0',_0x2521d7),'type':'chat'},{'id':'highlight-key-points','label':cs(_0x1a4caf,'AI_QUICK_ACTIONS_HIGHLIGHT_KEY_POINTS'),'displayedPrompt':cs(_0x1a4caf,'AI_QUICK_ACTIONS_HIGHLIGHT_KEY_POINTS'),'prompt':Ua['replace']('%0',_0x2521d7),'type':'chat'}]},{'id':'improve-writing','label':cs(_0x1a4caf,'AI_QUICK_ACTIONS_IMPROVE_WRITING'),'type':'action','icon':_0x5119d5},{'id':'continue','label':cs(_0x1a4caf,'AI_QUICK_ACTIONS_CONTINUE_WRITING'),'type':'action','icon':_0xbbbe39},{'id':'fix-grammar','label':cs(_0x1a4caf,'AI_QUICK_ACTIONS_FIX_GRAMMAR_SPELLING'),'type':'action','icon':_0x318753},{'id':'adjust-length','label':cs(_0x1a4caf,'AI_QUICK_ACTIONS_ADJUST_LENGTH'),'icon':_0x5cc689,'actions':[{'id':'make-shorter','label':cs(_0x1a4caf,'AI_QUICK_ACTIONS_MAKE_SHORTER'),'type':'action'},{'id':'make-longer','label':cs(_0x1a4caf,'AI_QUICK_ACTIONS_MAKE_LONGER'),'type':'action'}]},{'id':'change-tone','label':cs(_0x1a4caf,'AI_QUICK_ACTIONS_CHANGE_TONE'),'icon':_0x542ac8,'actions':[{'id':'make-tone-casual','label':cs(_0x1a4caf,'AI_QUICK_ACTIONS_MORE_CASUAL'),'type':'action'},{'id':'make-tone-direct','label':cs(_0x1a4caf,'AI_QUICK_ACTIONS_MORE_DIRECT'),'type':'action'},{'id':'make-tone-friendly','label':cs(_0x1a4caf,'AI_QUICK_ACTIONS_MORE_FRIENDLY'),'type':'action'},{'id':'make-tone-confident','label':cs(_0x1a4caf,'AI_QUICK_ACTIONS_MORE_CONFIDENT'),'type':'action'},{'id':'make-tone-professional','label':cs(_0x1a4caf,'AI_QUICK_ACTIONS_MORE_PROFESSIONAL'),'type':'action'}]},{'id':'translate','label':cs(_0x1a4caf,'AI_QUICK_ACTIONS_TRANSLATE'),'icon':_0x2a0a11,'actions':[{'id':'translate-to-english','label':cs(_0x1a4caf,'AI_QUICK_ACTIONS_TRANSLATE_ENGLISH'),'type':'action','actionName':'translate','args':{'language':'english'}},{'id':'translate-to-chinese','label':cs(_0x1a4caf,'AI_QUICK_ACTIONS_TRANSLATE_CHINESE'),'type':'action','actionName':'translate','args':{'language':'chinese'}},{'id':'translate-to-spanish','label':cs(_0x1a4caf,'AI_QUICK_ACTIONS_TRANSLATE_SPANISH'),'type':'action','actionName':'translate','args':{'language':'spanish'}},{'id':'translate-to-german','label':cs(_0x1a4caf,'AI_QUICK_ACTIONS_TRANSLATE_GERMAN'),'type':'action','actionName':'translate','args':{'language':'german'}},{'id':'translate-to-french','label':cs(_0x1a4caf,'AI_QUICK_ACTIONS_TRANSLATE_FRENCH'),'type':'action','actionName':'translate','args':{'language':'french'}},{'id':'translate-to-japanese','label':cs(_0x1a4caf,'AI_QUICK_ACTIONS_TRANSLATE_JAPANESE'),'type':'action','actionName':'translate','args':{'language':'japanese'}},{'id':'translate-to-portuguese','label':cs(_0x1a4caf,'AI_QUICK_ACTIONS_TRANSLATE_PORTUGUESE'),'type':'action','actionName':'translate','args':{'language':'portuguese'}},{'id':'translate-to-korean','label':cs(_0x1a4caf,'AI_QUICK_ACTIONS_TRANSLATE_KOREAN'),'type':'action','actionName':'translate','args':{'language':'korean'}},{'id':'translate-to-italian','label':cs(_0x1a4caf,'AI_QUICK_ACTIONS_TRANSLATE_ITALIAN'),'type':'action','actionName':'translate','args':{'language':'italian'}},{'id':'translate-to-russian','label':cs(_0x1a4caf,'AI_QUICK_ACTIONS_TRANSLATE_RUSSIAN'),'type':'action','actionName':'translate','args':{'language':'russian'}}]},{'id':'other','label':cs(_0x1a4caf,'AI_QUICK_ACTIONS_OTHER'),'icon':_0x2ced03,'actions':[]}];return _0xde5d8d;}(_0x167f21);}async['_getDefaultAndCustomActions'](){const _0x38e465=Ba['getDefaultQuickActions'](this['editor']['locale']),_0x13f093=this['editor']['config']['get']('ai.quickActions.extraCommands')||[];let _0x1352e4=[];try{_0x1352e4=await new Ks({'connector':this['editor']['plugins']['get']('AIConnector'),'locale':this['editor']['locale']})['getAll']();}catch(_0x23496e){const _0x13f720=new ot('ai-quick-actions-models-unable-to-retrieve',this,{'error':_0x23496e});Tt(_0x13f720['message']);}finally{const _0x4d020a=_0x13f093['map'](_0x90847b=>({..._0x90847b,'type':'chat'===_0x90847b['type']?'chat':'action','icon':void 0x0}));_0x38e465['find'](_0x206aef=>'other'===_0x206aef['id'])['actions']['push'](..._0x4d020a),_0x38e465['forEach'](_0x3a209a=>{if('actions'in _0x3a209a)_0x3a209a['actions']['forEach'](_0x517af4=>{if(_0x517af4['isEnabled']=!!_0x1352e4['find'](_0x53d867=>_0x53d867['id']===_0x517af4['model'])||void 0x0===_0x517af4['model'],!_0x517af4['isEnabled']){const _0x18687d=new ot('ai-quick-actions-unavailable-model',this,{'actionId':_0x517af4['id'],'modelId':_0x517af4['model']});Tt(_0x18687d['message']);}});else{if(_0x3a209a['isEnabled']=!!_0x1352e4['find'](_0x520687=>_0x520687['id']===_0x3a209a['model'])||void 0x0===_0x3a209a['model'],!_0x3a209a['isEnabled']){const _0x4bbfcb=new ot('ai-quick-actions-unavailable-model',this,{'actionId':_0x3a209a['id'],'modelId':_0x3a209a['model']});Tt(_0x4bbfcb['message']);}}});}return _0x38e465;}['_initializeQuickActionsComponentsAndCommands'](){const _0x357d54=new qt(this['editor']['locale']);_0x357d54['attachToDom'](),this['_initializeQuickActionsDropdown'](_0x357d54),this['_initializeQuickActionsMenuBar'](),this['_initializeQuickActionsComponents'](_0x357d54);}['_initializeQuickActionsDropdown'](_0x33f773){const _0x477c5b=this['editor']['config']['get']('ai.quickActions.isSearchEnabled')??!0x0;this['editor']['ui']['componentFactory']['add']('aiQuickActions',Pa({'editor':this['editor'],'content':this['_quickActionsDefinition'],'buttonDefinition':{'icon':_0x52c012,'label':cs(this['editor']['locale'],'AI_QUICK_ACTIONS_HEADING')},'bodyCollection':_0x33f773,'hasSearch':_0x477c5b}));}['_prepareQuickActionsDefinition'](_0x4f130a){this['_quickActionsDefinition']=_0x4f130a['map'](_0x341a4c=>{if('actions'in _0x341a4c){const _0x31b557=_0x341a4c;return{..._0x31b557,'actions':_0x31b557['actions']['map'](_0x34f91c=>{const {actions:_0x222dd7,..._0x4b6703}=_0x31b557;return{..._0x34f91c,'parent':_0x4b6703};})['filter'](_0x3b1903=>this['_shouldIncludeAction'](_0x3b1903))};}return _0x341a4c;})['filter'](_0x3b97bb=>'actions'in _0x3b97bb?_0x3b97bb['actions']['length']>0x0:this['_shouldIncludeAction'](_0x3b97bb));}['_shouldIncludeAction'](_0x304ee5){const _0xf3212c=this['editor']['config']['get']('ai.quickActions.removeCommands')||[];return this['editor']['plugins']['has'](Va[_0x304ee5['type']])&&!_0xf3212c['includes'](_0x304ee5['id'])&&!('chat'===_0x304ee5['type']&&!0x1===this['editor']['config']['get']('ai.chat.context.document.enabled'));}['_initializeQuickActionsComponents'](_0x3d8e8a){this['_quickActionsDefinition']['forEach'](_0xc96d99=>{if('actions'in _0xc96d99){const _0x24ec3c=Pa({'editor':this['editor'],'content':_0xc96d99['actions'],'buttonDefinition':_0xc96d99,'bodyCollection':_0x3d8e8a});this['editor']['ui']['componentFactory']['add'](_0xc96d99['id'],_0x24ec3c),_0xc96d99['actions']['forEach'](_0x5cda4e=>{const _0x3b72a9=Na({'editor':this['editor'],'action':_0x5cda4e});this['editor']['ui']['componentFactory']['add'](_0x5cda4e['id'],_0x3b72a9);});}else{const _0x3a9f0d=Na({'editor':this['editor'],'action':_0xc96d99,'withText':!0x1,'withIcon':!0x0,'isInDropdown':!0x1});this['editor']['ui']['componentFactory']['add'](_0xc96d99['id'],_0x3a9f0d);}});}['_initializeQuickActionsMenuBar'](){this['editor']['ui']['componentFactory']['add']('menuBar:aiQuickActions',_0x2f9674=>{const _0x4030ea=new Ft(_0x2f9674),_0x533310=cs(_0x2f9674,'AI_QUICK_ACTIONS_HEADING');_0x4030ea['buttonView']['set']({'label':_0x533310,'icon':_0x52c012});const _0x62a104=new Yt(_0x2f9674);_0x62a104['set']({'ariaLabel':_0x533310,'role':'menu'}),this['_quickActionsDefinition']['forEach'](_0x53bf62=>{if('actions'in _0x53bf62){const _0x5f2315=_0x53bf62,_0x375f76=new $t(_0x2f9674,_0x4030ea),_0x2a4163=new Ft(_0x2f9674),_0x12ae9b=new Yt(_0x2f9674);_0x2a4163['buttonView']['set']({'label':_0x5f2315['label'],'icon':_0x5f2315['icon']}),_0x5f2315['actions']['forEach'](_0x5c646a=>{const _0x4ef398=new $t(_0x2f9674,_0x2a4163),_0x3188f1=new Kt(_0x2f9674);_0x3188f1['set']({'label':_0x5c646a['label'],'icon':_0x5c646a['icon'],'role':'menuitem','isEnabled':_0x5c646a['isEnabled']}),_0x3188f1['on']('execute',()=>{this['_executeQuickAction'](_0x5c646a);}),_0x3188f1['delegate']('execute')['to'](_0x2a4163),_0x4ef398['children']['add'](_0x3188f1),_0x12ae9b['items']['add'](_0x4ef398);}),_0x2a4163['panelView']['children']['add'](_0x12ae9b),_0x375f76['children']['add'](_0x2a4163),_0x62a104['items']['add'](_0x375f76);}else{const _0x326845=_0x53bf62,_0x229909=new $t(_0x2f9674,_0x4030ea),_0x93e64e=new Kt(_0x2f9674);_0x93e64e['set']({'label':_0x326845['label'],'icon':_0x326845['icon'],'role':'menuitem','isEnabled':_0x326845['isEnabled']}),_0x93e64e['on']('execute',()=>{this['_executeQuickAction'](_0x326845);}),_0x93e64e['delegate']('execute')['to'](_0x4030ea),_0x229909['children']['add'](_0x93e64e),_0x62a104['items']['add'](_0x229909);}});const _0x56ac34=Object['values'](Va)['some'](_0x2fd1b0=>this['editor']['plugins']['has'](_0x2fd1b0));return _0x4030ea['set']({'isEnabled':_0x56ac34}),_0x4030ea['panelView']['children']['add'](_0x62a104),_0x4030ea;});}['_executeQuickAction'](_0x2b8bbc){const _0x4ed464=this['editor'];_0x4ed464['editing']['view']['focus'](),_0x4ed464['commands']['execute']('aiQuickAction',_0x2b8bbc);const _0x22aab3=_0x4ed464['ui']['view']['menuBarView'];_0x22aab3&&_0x22aab3['close']&&_0x22aab3['close']();}}class Ga extends _0x1f824d{['execute'](_0x20ba55){switch(this['_expandSelectionIfCollapsed'](),_0x20ba55['type']){case'chat':if(!this['editor']['plugins']['has']('AIChat')){const _0x5c96c3=cs(this['editor']['locale'],'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND','AIChat');throw new ot('ai-quick-actions-plugin-not-found',this['editor'],{'errorMessage':_0x5c96c3});}this['_handleAIChatAction'](_0x20ba55);break;case'action':if(!this['editor']['plugins']['has']('AIActions')){const _0x54425b=cs(this['editor']['locale'],'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND','AIActions');throw new ot('ai-quick-actions-plugin-not-found',this['editor'],{'errorMessage':_0x54425b});}this['_handleAIActionsAction'](_0x20ba55);}}async['_handleAIChatAction'](_0x4ebb6f){const _0x238f8c=this['editor']['plugins']['get']('AIChatController'),_0x10f20e=this['editor']['plugins']['get']('AITabs')['view'];if(_0x10f20e['isVisible']||(_0x10f20e['isVisible']=!0x0),'chat'!==_0x10f20e['activeTab']&&_0x10f20e['activateTab']('chat'),'ask-ai'===_0x4ebb6f['id'])_0x238f8c['removeSelectionFromChatContext'](),_0x238f8c['addSelectionToChatContext'](),_0x238f8c['focusPromptInput']();else await _0x238f8c['startConversation'](),_0x238f8c['removeSelectionFromChatContext'](),_0x238f8c['addSelectionToChatContext'](),_0x238f8c['focusPromptInput'](),await _0x238f8c['sendMessage']({'message':_0x4ebb6f['prompt']||_0x4ebb6f['displayedPrompt']||_0x4ebb6f['label'],'attributes':{'quickActionData':{'id':_0x4ebb6f['id']},'displayedPrompt':_0x4ebb6f['displayedPrompt']}});}['_expandSelectionIfCollapsed'](){const _0x2cfa20=this['editor'],_0x1b2337=_0x2cfa20['model']['document']['selection'];if(!_0x1b2337['isCollapsed'])return;const _0x3eb6f7=gt(_0x1b2337['getSelectedBlocks']())||_0x2cfa20['model']['schema']['getLimitElement'](_0x1b2337);_0x2cfa20['model']['change'](_0x34c4d6=>{_0x34c4d6['setSelection'](_0x3eb6f7,'in');});}['_handleAIActionsActionLabel'](_0x4a4b00){return _0x4a4b00['parent']?.['label']&&'other'!==_0x4a4b00['parent']?.['id']?_0x4a4b00['parent']['label']+':\x20'+_0x4a4b00['label']:_0x4a4b00['label'];}async['_handleAIActionsAction'](_0x33a9f6){const _0x2ddce1=this['editor']['plugins']['get']('AIActions'),_0x547f46=_0x33a9f6['prompt']?{'userMessage':_0x33a9f6['prompt'],'model':_0x33a9f6['model']}:{'actionName':_0x33a9f6['actionName']||_0x33a9f6['id'],'args':_0x33a9f6['args']},_0x13c821=this['_handleAIActionsActionLabel'](_0x33a9f6);await _0x2ddce1['executeAction'](_0x547f46,_0x13c821,_0x33a9f6['icon']);}}class Fa extends _0x44ca98{static get['pluginName'](){return'AIQuickActionsEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x3836cd=this['editor'],_0x87216e=new Ga(this['editor']);if(_0x3836cd['commands']['add']('aiQuickAction',_0x87216e),_0x3836cd['plugins']['has']('AIChat')){const _0x4b180e=this['editor']['plugins']['get']('AIChatController');_0x3836cd['model']['document']['selection']['on']('change:range',(_0xb6c4e0,_0x563f68)=>{_0x563f68['directChange']&&_0x4b180e['removeSelectionFromChatContext']();});}}}class Ka extends Ls{['updateChangeGroups'](){if(this['parsedMergedContent']=this['parsedContent']['cloneNode'](!0x0),0x0==this['parsedMergedContent']['childNodes']['length'])return void(this['changeGroups']=[]);const _0x251d75=this['documentContextContent']['children']['map'](_0x4fcb96=>({'node':_0x4fcb96,'id':ps(_0x4fcb96,'data-id')})),_0xfbb065=this['parsedMergedContent']['children']['map'](_0x2723ee=>({'node':_0x2723ee,'id':ps(_0x2723ee,'data-id')||at()})),_0x52518c=_0x4dc144(_0x251d75,_0xfbb065,{'comparator':(_0x3811f5,_0x58f36d)=>_0x3811f5['id']==_0x58f36d['id'],'oneChangePerToken':!0x0});if(!this['isDone']){for(;_0x52518c['length']&&_0x52518c[_0x52518c['length']-0x1]['removed'];)_0x52518c['pop']();}const _0x556254=_0x52518c['map'](_0x28857b=>{const _0x632210=_0x28857b['added']?'new':_0x28857b['removed']?'removed':'modified';return{'node':_0x28857b['value'][0x0]['node'],'type':_0x632210,'id':_0x28857b['value'][0x0]['id']};});this['changeGroups']=[{'changes':_0x556254,'state':'pending','index':0x0}];}['_getDifferentChangeGroups'](_0x155b50,_0x39c169){return _0x39c169;}}class Wa extends Ps{['content'];['version'];['actionName'];['args'];['userMessage'];['model'];['hasError']=!0x1;constructor(_0x55a5ab){super(_0x55a5ab),this['content']=_0x55a5ab['content'],this['version']=_0x55a5ab['version'],this['actionName']=_0x55a5ab['actionName'],this['args']=_0x55a5ab['args'],this['userMessage']=_0x55a5ab['userMessage'],this['model']=_0x55a5ab['model'];}async['sendRequest'](){return this['actionName']?this['connector']['executeAction']({'content':this['content'],'actionName':this['actionName'],'args':this['args']}):this['connector']['executeCustomAction']({'content':this['content'],'message':this['userMessage'],'model':this['model'],'outputFormat':'html'});}['getDocumentContext'](){return{'type':'text','content':this['content'],'version':this['version'],'label':'Current\x20document','uiId':'current-document'};}['createReply'](_0xe75cf0){const _0x4c91b2=new Ka({'editor':this['editor'],'documentContextContent':this['content'],..._0xe75cf0});return this['replies']['push'](_0x4c91b2),_0x4c91b2['delegate'](...Ds)['to'](this),this['fire']('replyCreated',_0x4c91b2),_0x4c91b2;}}class Ya extends Ot{constructor(_0x4a75b2,_0x4b1067=!0x0,_0x5d6abc=!0x0){super(_0x4a75b2),this['set']('isEnabled',!0x1),_0x4b1067&&(this['applyButton']=this['_createButton'](cs(_0x4a75b2,'AI_BALLOON_APPLY_BUTTON'),ls),this['applyButton']['bind']('isEnabled')['to'](this),this['items']['add'](this['applyButton'])),_0x5d6abc&&(this['suggestButton']=this['_createButton'](cs(_0x4a75b2,'AI_BALLOON_SUGGEST_BUTTON'),_0x4b1067?us:ls),this['suggestButton']['bind']('isEnabled')['to'](this),this['items']['add'](this['suggestButton'])),this['setButtonsVisibility']({'showApplyButton':_0x4b1067,'showSuggestButton':_0x5d6abc}),this['extendTemplate']({'attributes':{'class':['ck-ai-balloon__toolbar']}});}['setButtonsVisibility']({showApplyButton:_0x183574,showSuggestButton:_0x4157c0}){this['applyButton']&&(this['applyButton']['isVisible']=_0x183574),this['suggestButton']&&(this['suggestButton']['isVisible']=_0x4157c0);}['_createButton'](_0x5ea2c4,_0x4f9686){const _0x6987f=new kt(this['locale']);return _0x6987f['set']({'label':_0x5ea2c4,'class':_0x4f9686,'isVisible':!0x0,'withText':!0x0}),_0x6987f;}}class $a extends Nt{constructor(_0x571d81){super(_0x571d81),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-balloon__disclaimer']},'children':[{'tag':'p','attributes':{'class':['ck','ck-ai-balloon__disclaimer-content']},'children':[{'text':cs(_0x571d81,'AI_DISCLAIMER_TEXT')}]}]});}}class qa extends Nt{constructor(_0x1ef5b7){super(_0x1ef5b7),this['set']('isVisible',!0x0);const _0x36e273=new Rn('small');_0x36e273['isVisible']=!0x0;const _0x49ad67=new Nt(this['locale']);_0x49ad67['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-suggestion__loader-text']},'children':[cs(this['locale'],'AI_CHAT_IS_WRITING')]}),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__loader',this['bindTemplate']['if']('isVisible','ck-hidden',_0x36b3a9=>!_0x36b3a9)]},'children':[_0x36e273,_0x49ad67]});}}class Qa extends Ca{['focusCycler'];['_config'];['_contentWrapper'];['_streamableContentView'];['_toolbarView'];['_miniToolbarView'];['_loaderView'];['_disclaimerView'];['_focusTracker'];['_keystrokes'];['_dialogContent'];['_focusables'];['_scrollManager'];['_navigationPreviousButton'];['_navigationNextButton'];['_navigationTryAgainButton'];['_navigationCounter'];constructor(_0x1ef706,_0x4b3525){super(_0x1ef706),this['set']('isBusy',!0x1),this['set']('isTrackChangesOn',!0x1),this['set']('_isLoading',!0x1),this['set']('_hasError',!0x1),this['_config']=_0x4b3525,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 _0x534e2b(),this['_addContentWrapper'](_0x4b3525),this['_addDisclaimerView'](),this['_addToolbar'](_0x4b3525),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'](_0x4b3525);});}['render'](){super['render']();for(const _0xf7ea69 of this['_focusables'])this['_focusTracker']['add'](_0xf7ea69['element']);this['_keystrokes']['listenTo'](this['element']),this['_initializeScrollManager']();}['destroy'](){super['destroy'](),this['_scrollManager']&&this['_scrollManager']['destroy']();}['focus'](_0x142a77){-0x1===_0x142a77?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}['setIsLoading'](_0x160f9e){this['_isLoading']=_0x160f9e;}['setErrorState'](){this['_hasError']=!0x0,this['_miniToolbarView']['toggleShowChangesEnabled'](!0x1);}['clearErrorState'](){this['_hasError']=!0x1,this['_miniToolbarView']['toggleShowChangesEnabled'](!0x0);}['showError'](_0x403bcc){super['showError'](_0x403bcc),this['_dialogContent']['has'](this['_errorView'])||this['_dialogContent']['add'](this['_errorView'],0x0);}['hideError'](){super['hideError'](),this['clearErrorState']();}['showBlockingError'](_0x4a24cb){super['showBlockingError'](_0x4a24cb),this['setErrorState']();}['addMiniToolbarItem'](_0x3c1648){this['_miniToolbarView']['items']['has'](_0x3c1648)||this['_miniToolbarView']['items']['add'](_0x3c1648);}['removeMiniToolbarItem'](_0x373ee2){this['_miniToolbarView']['items']['has'](_0x373ee2)&&this['_miniToolbarView']['items']['remove'](_0x373ee2);}['showLoader'](){this['_loaderView']&&(this['_isLoading']=!0x0);}['hideLoader'](){this['_loaderView']&&(this['_isLoading']=!0x1);}['_toggleToolbarButtonsVisibility']({showApplyButton:_0x47fbd4,showSuggestButton:_0xbe3c6c}){_0x47fbd4=_0x47fbd4&&!this['isTrackChangesOn']&&this['_config']['availableActions']['includes']('applySuggestion'),_0xbe3c6c=_0xbe3c6c&&this['_config']['availableActions']['includes']('insertSuggestion'),this['_toolbarView']['setButtonsVisibility']({'showApplyButton':_0x47fbd4,'showSuggestButton':_0xbe3c6c});}async['updateContent'](_0x3c0cb5){await this['_streamableContentView']['update'](_0x3c0cb5);}['clearContent'](){this['_streamableContentView']['clear']();}['_addContentWrapper'](_0x1e669f){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'](_0x1e669f['miniToolbarConfig'])]}),this['_dialogContent']['add'](this['_contentWrapper']);}['_addDisclaimerView'](){this['_disclaimerView']=new $a(this['locale']),this['_dialogContent']['add'](this['_disclaimerView']);}['_addToolbar']({showApplyButton:_0x240da4,showSuggestButton:_0x590843}){this['_toolbarView']=new Ya(this['locale'],_0x240da4,_0x590843),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',(_0x2c1e2d,_0x49f96b,_0x15557e)=>!(_0x2c1e2d||_0x49f96b||_0x15557e)),this['_toggleToolbarButtonsVisibility']({'showApplyButton':_0x240da4,'showSuggestButton':_0x590843}),this['_dialogContent']['add'](this['_toolbarView']);}['_createMiniToolbar'](_0x218888){return this['_miniToolbarView']=new Sa(this['locale'],_0x218888),this['_miniToolbarView']['delegate'](...js)['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',(_0x5bae0c,_0x488e1b)=>!(_0x5bae0c||_0x488e1b)),this['_miniToolbarView'];}['_createLoaderView'](){return this['_loaderView']=new qa(this['locale']),this['_loaderView']['bind']('isVisible')['to'](this,'_isLoading'),this['_loaderView'];}['_createStreamableContentView'](){return this['_streamableContentView']=new An(this['locale']),this['_streamableContentView'];}['_setupMiniToolbarButtons'](){const _0x2df0c0=new kt(this['locale']),_0x74e4e=new kt(this['locale']),_0x59bd4f=new Xa(this['locale']),_0x19becb=new kt(this['locale']);_0x2df0c0['set']({'icon':tt,'label':cs(this['locale'],'AI_ACTIONS_TRY_AGAIN'),'tooltip':!0x0,'class':'ck-ai-custom-action-button\x20'+ds}),_0x74e4e['set']({'icon':_0x11b6ce,'tooltip':cs(this['locale'],'AI_ACTIONS_PREVIOUS_INTERACTION'),'class':'ck-ai-navigation-button\x20ck-ai-previous-button\x20'+ds}),_0x19becb['set']({'icon':et,'tooltip':cs(this['locale'],'AI_ACTIONS_NEXT_INTERACTION'),'class':'ck-ai-navigation-button\x20ck-ai-next-button\x20'+ds}),_0x2df0c0['bind']('isEnabled')['to'](this,'isBusy',_0x2985ab=>!_0x2985ab),_0x2df0c0['on']('execute',()=>{this['fire']('tryAgain');}),_0x74e4e['bind']('isEnabled')['to'](this,'isBusy',_0x9c221a=>!_0x9c221a),_0x74e4e['on']('execute',()=>{this['fire']('showPrevious');}),_0x19becb['bind']('isEnabled')['to'](this,'isBusy',_0x5de9df=>!_0x5de9df),_0x19becb['on']('execute',()=>{this['fire']('showNext');}),this['_navigationPreviousButton']=_0x74e4e,this['_navigationCounter']=_0x59bd4f,this['_navigationNextButton']=_0x19becb,this['_navigationTryAgainButton']=_0x2df0c0;}['updateMiniToolbarButtons'](_0x52a31e,_0x21466c){this['_navigationPreviousButton']||this['_setupMiniToolbarButtons']();const _0x1613a4=_0x52a31e>0x1;if(this['addMiniToolbarItem'](this['_navigationTryAgainButton']),_0x1613a4){this['addMiniToolbarItem'](this['_navigationPreviousButton']),this['addMiniToolbarItem'](this['_navigationCounter']),this['addMiniToolbarItem'](this['_navigationNextButton']);const _0x5716a0=_0x52a31e-_0x21466c;this['_navigationCounter']['setInteractionCount'](_0x5716a0+'/'+_0x52a31e),this['_navigationPreviousButton']['isEnabled']=_0x21466c<_0x52a31e-0x1,this['_navigationNextButton']['isEnabled']=_0x21466c>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'](_0x4a8551){this['_isLoading']=_0x4a8551;}['resetShowChangesButton'](){this['_miniToolbarView']['isShowChangesOn']=!0x1;}['_initializeScrollManager'](){const _0x2db616=this['_getScrollableElement']();_0x2db616&&!this['_scrollManager']&&(this['_scrollManager']=new Jn(_0x2db616));}['_getScrollableElement'](){return this['_streamableContentView']['element'];}}class Xa extends Nt{constructor(_0x25ef04){super(_0x25ef04);const _0x44c0b7=this['bindTemplate'];this['set']('interactionCount','1/1'),this['setTemplate']({'tag':'span','attributes':{'class':['ck-ai-interaction-counter']},'children':[{'text':_0x44c0b7['to']('interactionCount')}]});}['setInteractionCount'](_0x4e3bc1){this['set']('interactionCount',_0x4e3bc1);}}class za extends _0x44ca98{static get['requires'](){return[hs,Vt,zs,fa,_0x53366e];}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(_0xe625c3){super(_0xe625c3),this['_bodyCollection']=new qt(this['editor']['locale']),this['_bodyCollection']['attachToDom'](),this['_aiConnector']=this['editor']['plugins']['get']('AIConnector'),this['set']('isBusy',!0x1),this['_promiseQueue']=new In();}['stopInteraction'](){this['_stopInteraction']();}async['executeAction'](_0x42d7cc,_0x472dcc,_0x189b18){if(this['_stopInteraction'](),this['editor']['plugins']['has']('TableSelection')){if(this['editor']['plugins']['get']('TableSelection')['getSelectedTableCells']()){const {modelFragment:_0x20c009,anchorData:_0x4f6bc4}=this['_getExecuteDataInTable']();return this['_executeAction'](_0x42d7cc,_0x20c009,_0x4f6bc4,_0x472dcc,_0x189b18);}}const {modelFragment:_0x374f7c,anchorData:_0x37441d}=this['_getExecuteDataRegular']();return this['_executeAction'](_0x42d7cc,_0x374f7c,_0x37441d,_0x472dcc,_0x189b18);}async['destroy'](){return this['_stopInteraction'](),this['_bodyCollection']['detachFromDom'](),super['destroy']();}['_createActionsBalloonView'](){const _0x32f063=this['editor']['plugins']['has']('TrackChanges');let _0x4a7e1a=this['editor']['config']['get']('ai.availableReplyActions')||[...pn];_0x32f063||(_0x4a7e1a=_0x4a7e1a['filter'](_0x4d2cfe=>'insertSuggestion'!=_0x4d2cfe));const _0x5e2c90=this['editor']['commands']['get']('trackChanges'),_0x18f053=new Qa(this['editor']['locale'],{'showApplyButton':!0x0,'showSuggestButton':_0x32f063,'miniToolbarConfig':{'showChanges':'icon'},'availableActions':_0x4a7e1a});return _0x18f053['bind']('isBusy')['to'](this),_0x5e2c90&&_0x18f053['bind']('isTrackChangesOn')['to'](_0x5e2c90,'value'),_0x18f053['on']('tryAgain',()=>{this['_refreshInteraction']();}),_0x18f053['on']('showPrevious',()=>{this['_navigateToPrevious']();}),_0x18f053['on']('showNext',()=>{this['_navigateToNext']();}),_0x18f053;}['_getExecuteDataRegular'](){const _0x44254c=this['editor']['model']['document']['selection'];if(_0x44254c['isCollapsed']){const _0x44d8a3=gt(_0x44254c['getSelectedBlocks']())||this['editor']['model']['schema']['getLimitElement'](_0x44254c);this['editor']['model']['change'](_0x552cb3=>{_0x552cb3['setSelection'](_0x44d8a3,'in');});}const _0x54bc3f=_0x44254c['getFirstRange'](),_0x2bc7a6=this['_wrapWithCommonAncestors'](this['editor']['model']['getSelectedContent'](_0x44254c),_0x54bc3f['start'],_0x54bc3f['end']);this['_copyMarkersToFragment'](_0x2bc7a6,_0x44254c,{'isTableSelection':!0x1});const _0x5d1feb=_0x44254c['getFirstRange']()['start'],_0x2e3e16=new Map();let _0x5826c5=_0x2bc7a6;for(let _0x31fb25=0x0;_0x31fb25<_0x5d1feb['path']['length'];_0x31fb25++)_0x2e3e16['set'](_0x5826c5,_0x5d1feb['path'][_0x31fb25]),_0x5826c5=_0x5826c5['getChild'](0x0);return{'modelFragment':_0x2bc7a6,'anchorData':_0x2e3e16};}['_getExecuteDataInTable'](){const _0x23ff86=this['editor']['model']['document']['selection'],_0x5c8e8a=this['editor']['plugins']['get']('TableSelection')['getSelectionAsFragment'](),_0x1e6e27=_0x23ff86['getFirstRange']()['start']['parent']['parent'],_0x3f8c68=this['editor']['model']['createRange'](this['editor']['model']['createPositionBefore'](_0x1e6e27),this['editor']['model']['createPositionAfter'](_0x1e6e27)),_0x209237=this['_wrapWithCommonAncestors'](_0x5c8e8a,_0x3f8c68['start'],_0x3f8c68['end']);this['_copyMarkersToFragment'](_0x209237,_0x23ff86,{'isTableSelection':!0x0});const _0x186e2e=_0x23ff86['getFirstRange']()['start'],_0x2bb2aa=new Map();let _0x208310=_0x209237;for(let _0x75d287=0x0;_0x75d287<_0x186e2e['path']['length'];_0x75d287++)if(_0x2bb2aa['set'](_0x208310,_0x186e2e['path'][_0x75d287]),_0x75d287<_0x186e2e['path']['length']-0x1)_0x208310=_0x208310['getChild'](0x0);else{let _0x12a0a2=_0x208310['nextSibling'];for(;_0x12a0a2;)_0x2bb2aa['set'](_0x12a0a2,_0x186e2e['path'][_0x75d287]),_0x12a0a2=_0x12a0a2['nextSibling'];}return{'modelFragment':_0x209237,'anchorData':_0x2bb2aa};}async['_executeAction'](_0x2a524f,_0x4f4727,_0x4f3cf8,_0x26db94,_0x4f2c9b){const _0x359b88=this['editor']['plugins']['get'](zs),_0x679326=this['editor']['plugins']['get'](fa),_0x3c7c91=this['editor']['model']['document']['selection'],_0x27595f=await _0x359b88['modelToDataWithIds'](_0x4f4727),_0x501219=this['editor']['model']['document']['version'],_0x6fc0c1=[..._0x3c7c91['getRanges']()];return this['_actionsBalloonView']||(this['_actionsBalloonView']=this['_createActionsBalloonView']()),this['_clearInteractionHistory'](),this['_clearErrorState'](),this['_balloonShowDiff']=!0x1,this['_actionsBalloonView']['resetShowChangesButton'](),this['_actionsBalloonView']['clearContent'](),_0x679326['open']({'index':0x3e8*Math['random']()%0x3e8,'title':_0x26db94,'icon':_0x4f2c9b||_0x52c012,'mainView':this['_actionsBalloonView'],'class':'ck-ai-actions-balloon','ranges':_0x6fc0c1,'id':'aiActionsBalloon'}),this['_setLoadingState'](),this['stopListening'](this['_actionsBalloonView']),this['stopListening'](_0x679326),this['_interactionParams']={'action':_0x2a524f,'content':_0x27595f,'version':_0x501219,'aiBalloon':_0x679326,'modelFragment':_0x4f4727,'anchorData':_0x4f3cf8},this['_setupApplyListeners'](),this['listenTo'](_0x679326,'selectionRemoved',()=>{this['_stopInteraction'](),this['_actionsBalloonView']['disableMiniToolbarButtons']();}),this['listenTo'](_0x679326,'dialogClosed',(_0x688de0,{id:_0x116573})=>{if('aiActionsBalloon'===_0x116573){if(this['_interaction']&&this['_interaction']['replies']['length']>0x0){const _0x55ebc1=this['_interaction']['replies'][this['_interaction']['replies']['length']-0x1],_0x3fe752=_0x55ebc1['changeGroups'][0x0];_0x3fe752&&'pending'===_0x3fe752['state']&&_0x55ebc1['setChangeGroupState'](0x0,'rejected');}this['_stopInteraction'](),this['_clearInteractionHistory'](),this['stopListening'](this['_actionsBalloonView']),this['stopListening'](_0x679326);}}),this['_createInteraction'](_0x27595f,_0x501219,_0x679326,_0x2a524f);}['_setupApplyListeners'](){if(!this['_interactionParams'])return;const {modelFragment:_0x1e25ee,anchorData:_0x6adcae}=this['_interactionParams'];this['listenTo'](this['_actionsBalloonView'],'applySuggestion',()=>{this['_applyChanges'](_0x1e25ee,_0x6adcae,!0x1);}),this['listenTo'](this['_actionsBalloonView'],'insertSuggestion',()=>{this['_applyChanges'](_0x1e25ee,_0x6adcae,!0x0);});}['_wrapWithCommonAncestors'](_0x397d9a,_0x47a2af,_0x23453e){const _0x6c99b5=this['editor']['model']['createRange'](_0x47a2af,_0x23453e)['getCommonAncestor'](),_0xa61acd=_0x6c99b5['is']('documentFragment')?[]:_0x6c99b5['getAncestors']({'includeSelf':!0x0})['slice'](0x1);if(_0xa61acd['length']){const _0x10773a=_0xa61acd['map'](_0x251a4a=>_0x251a4a['_clone'](!0x1));for(let _0x57a670=0x1;_0x57a670<_0x10773a['length'];_0x57a670++)_0x10773a[_0x57a670-0x1]['_appendChild'](_0x10773a[_0x57a670]);return _0x10773a[_0x10773a['length']-0x1]['_appendChild'](_0x397d9a),new _0x270bfa(_0x10773a[0x0]);}return _0x397d9a;}['_copyMarkersToFragment'](_0x333051,_0x52087d,_0x3351dd={'isTableSelection':!0x1}){const _0x1f881e=this['editor']['model'],_0x22ee24=Array['from'](_0x52087d['getRanges']()),_0x15fb1e=_0x52087d['getFirstRange']()['start'];for(const _0x5220e9 of _0x1f881e['markers']){if(_0x5220e9['name']['startsWith'](Xs)||!_0x5220e9['affectsData'])continue;const _0x490de7=_0x5220e9['getRange']();if(!_0x22ee24['some'](_0x2bc0a6=>_0x2bc0a6['containsRange'](_0x490de7,!0x0)))continue;const _0x5a2fe9=this['_regularCalculateMarkerPath'](_0x490de7['start'],_0x15fb1e,_0x3351dd['isTableSelection']),_0x5811f9=this['_regularCalculateMarkerPath'](_0x490de7['end'],_0x15fb1e,_0x3351dd['isTableSelection']),_0x6a310d=_0x1f881e['createPositionFromPath'](_0x333051,_0x5a2fe9),_0x5daba0=_0x1f881e['createPositionFromPath'](_0x333051,_0x5811f9);if(!_0x6a310d['isEqual'](_0x5daba0)){const _0x17574a=_0x1f881e['createRange'](_0x6a310d,_0x5daba0);_0x333051['markers']['set'](_0x5220e9['name'],_0x17574a);}}}['_regularCalculateMarkerPath'](_0x186fbe,_0x18f19c,_0x3aada9=!0x1){const _0x955be5=[..._0x186fbe['path']['slice']()];for(let _0x30d341=0x0;_0x30d341<Math['max'](_0x18f19c['path']['length'],_0x186fbe['path']['length']);_0x30d341++){const _0x5665b3=_0x18f19c['path'][_0x30d341]||0x0,_0x5a2859=(_0x186fbe['path'][_0x30d341]||0x0)-_0x5665b3;if(_0x955be5[_0x30d341]=_0x5a2859,0x0!==_0x5a2859&&!_0x3aada9)break;}return _0x955be5;}async['_createInteraction'](_0x4446a8,_0x5b5c26,_0x486d3a,_0x3fb77a){const _0x313d68=this['editor'];this['_interactionParams']||(this['_interactionParams']={'action':_0x3fb77a,'content':_0x4446a8,'version':_0x5b5c26,'aiBalloon':_0x486d3a,'modelFragment':this['editor']['model']['getSelectedContent'](this['editor']['model']['document']['selection']),'anchorData':new Map()});const _0x25f266=new Wa({'connector':this['_aiConnector'],'editor':_0x313d68,'content':_0x4446a8,'version':_0x5b5c26,..._0x3fb77a});this['_interactions']['push'](_0x25f266);const _0xff945c=(_0x3faa44,_0x145195=!0x1,_0x565c9c='streaming')=>this['_promiseQueue']['enqueue'](async _0x43d984=>{try{const _0x1e9646=Os({'editor':_0x313d68,'changeGroups':_0x3faa44['changeGroups'],'documentContextContent':_0x3faa44['documentContextContent'],'showDiff':_0x145195,'trimUnchanged':!0x1});_0x1e9646['length']&&await this['_actionsBalloonView']['updateContent']({'part':_0x1e9646[0x0],'renderingStrategy':_0x565c9c,'abortSignal':_0x43d984});}catch(_0x28d43c){if(this['_isAbortError'](_0x28d43c))return;throw _0x28d43c;}});this['_interaction']['on']('replyCreated',(_0x4be160,_0x1275c3)=>{this['_actionsBalloonView']['hideLoader'](),this['_actionsBalloonView']['startAutoScroll'](),_0xff945c(_0x1275c3)['catch'](_0x110ab2=>{this['_isAbortError'](_0x110ab2)||(console['error']('Error\x20updating\x20content\x20in\x20replyCreated:',_0x110ab2),this['_setErrorState'](_0x25f266));});}),this['_interaction']['on']('replyContentUpdated',(_0xa0e98e,_0x4f852c)=>{_0xff945c(_0x4f852c)['catch'](_0x33ad63=>{this['_isAbortError'](_0x33ad63)||(console['error']('Error\x20updating\x20content\x20in\x20replyContentUpdated:',_0x33ad63),this['_setErrorState'](_0x25f266));});}),this['_interaction']['on']('interactionFinished',async()=>{try{await this['_clearLoadingState'](),this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']),await this['_promiseQueue']['queueEmptyPromise'];}catch(_0x48b8ac){this['_isAbortError'](_0x48b8ac)||(console['error']('Error\x20clearing\x20loading\x20state\x20in\x20interactionFinished:',_0x48b8ac),this['_setErrorState'](_0x25f266));}finally{this['_actionsBalloonView']['stopAutoScroll']();}}),this['listenTo'](this['_actionsBalloonView'],'toggleSuggestionDisplayMode',async(_0x2d0cee,{showDiff:_0x1f6fc0})=>{try{this['_balloonShowDiff']=_0x1f6fc0;const _0x17f0c6=this['_interaction']['replies'][this['_interaction']['replies']['length']-0x1];_0x17f0c6&&await _0xff945c(_0x17f0c6,_0x1f6fc0,'static');}catch(_0x474ead){this['_isAbortError'](_0x474ead)||(console['error']('Error\x20updating\x20content\x20in\x20toggleSuggestionDisplayMode:',_0x474ead),this['_setErrorState'](_0x25f266));}}),this['_interaction']['on']('replyChangeGroupStateUpdated',(_0x5d9b55,{reply:_0x52f2b6})=>{const _0x296067={'positiveCount':_0x52f2b6['changeGroups']['filter'](_0x4fa797=>'accepted'===_0x4fa797['state'])['length'],'totalCount':_0x52f2b6['changeGroups']['length']},_0x6b812=this['_interaction']['actionCallId'],_0x1cf930=this['_interaction']['actionName'];_0x1cf930?this['_aiConnector']['upsertAIActionRating'](_0x1cf930,_0x6b812,_0x296067):this['_aiConnector']['upsertCustomAIActionRating'](_0x6b812,_0x296067);}),this['_setLoadingState']();try{const _0x408e2d=await this['_interaction']['start']();return this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']),_0x408e2d;}catch(_0x29d98e){if(this['_isAbortError'](_0x29d98e))return;this['_actionsBalloonView']['hideLoader'](),this['_setErrorState'](_0x25f266);}}['_applyChanges'](_0x309129,_0x32e8ab,_0x2d28b0){const _0x20cde7=this['editor'];if(_0x2d28b0&&!_0x20cde7['plugins']['has']('TrackChanges'))throw new ot('ai-no-track-changes',null);const _0x425170=this['editor']['plugins']['get'](_0x53366e),_0x47699b=this['_interactions'][this['_interactions']['length']-0x1-this['_currentInteractionIndex']];if(!_0x47699b||!_0x47699b['replies']['length'])return;const _0x20691d=_0x47699b['replies'][_0x47699b['replies']['length']-0x1],_0x3e573c=_0x20691d['changeGroups'];_0x20691d['setChangeGroupState'](0x0,'accepted');let _0x46358d=$s({'editor':_0x20cde7,'reply':_0x20691d,'interaction':_0x47699b,'groups':_0x3e573c,'transform':!0x1,'documentCompare':_0x425170,'documentCompareOptions':{'anchor':_0x20cde7['model']['createPositionAt'](_0x309129,0x0),'markDeletions':_0x2d28b0}});_0x46358d=this['_filterOperationsOutsideRange'](_0x46358d,_0x32e8ab);for(const _0x346bdd of _0x46358d)this['_anchorOperation'](_0x32e8ab,_0x346bdd,_0x20cde7['model']['document']['getRoot']());const _0x289d29=_0x47699b['getDocumentContext']()['version'],_0x4711be=_0x20cde7['model']['document']['history']['getOperations'](_0x289d29),_0x4d20b2={'document':_0x20cde7['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1},_0x68ece4=_0x1b1979(_0x46358d,_0x4711be,_0x4d20b2)['operationsA'];_0x20cde7['model']['change'](_0x49bd2f=>{if(_0x49bd2f['setSelection'](_0x20cde7['model']['document']['selection']['focus']),_0x2d28b0)_0x20cde7['plugins']['get']('TrackChangesEditing')['_applyOperationsAsSuggestions'](_0x68ece4);else{for(const _0x3baa09 of _0x68ece4)_0x3baa09['baseVersion']=_0x20cde7['model']['document']['version'],qs(_0x20cde7,_0x3baa09),_0x49bd2f['batch']['addOperation'](_0x3baa09),_0x20cde7['model']['applyOperation'](_0x3baa09);}}),this['editor']['plugins']['get']('AIBalloon')['close']();}['_filterOperationsOutsideRange'](_0x543b1a,_0x1205f8){return _0x543b1a['filter'](_0x3e9672=>{if('rename'==_0x3e9672['type']){const _0x394085=_0x3e9672['position']['nodeAfter'];return!_0x1205f8['has'](_0x394085);}if(_0x3e9672['type']['indexOf']('Attribute')>-0x1){const _0x4c4a95=_0x3e9672['range']['start']['nodeAfter'];return!_0x1205f8['has'](_0x4c4a95);}return!0x0;});}['_anchorOperation'](_0x8a465e,_0x4da4d5,_0x41696d){const _0x59e390=_0x4da4d5['clone']();for(const _0x49f013 in _0x4da4d5){const _0x13bbae=_0x4da4d5[_0x49f013];_0x13bbae instanceof _0x40a8b3?_0x4da4d5[_0x49f013]=new _0x40a8b3(_0x359c7b(_0x13bbae['start']),_0x359c7b(_0x13bbae['end'])):_0x13bbae instanceof _0xf89124&&(_0x4da4d5[_0x49f013]=_0x359c7b(_0x13bbae));}if(['insert','move','remove','reinsert','split','merge']['includes'](_0x59e390['type'])){if(_0x59e390['isDocumentOperation']=!0x1,_0x59e390['baseVersion']=null,'remove'==_0x59e390['type']){const _0x556de4=_0x59e390['sourcePosition'],_0x164f9e=_0x59e390['howMany'];new _0x423138(_0x556de4,_0x164f9e)['_execute']();}else _0x59e390['_execute']();}function _0x359c7b(_0x4546fd){if('$graveyard'==_0x4546fd['root']['rootName'])return _0x4546fd;const _0x50609b=[];let _0x4f29e9=_0x4546fd['root'];for(let _0xd07e28=0x0;_0xd07e28<_0x4546fd['path']['length'];_0xd07e28++){const _0x548a3d=_0x8a465e['get'](_0x4f29e9)||0x0;_0x50609b[_0xd07e28]=_0x4546fd['path'][_0xd07e28]+_0x548a3d,_0x4f29e9=_0x4f29e9['getChildAtOffset'](_0x4546fd['path'][_0xd07e28]);}return new _0xf89124(_0x41696d,_0x50609b,_0x4546fd['stickiness']);}}['_refreshInteraction'](){if(!this['_interactionParams'])return;this['_interactions']['length']>0x0&&this['_stopInteraction'](),this['_currentInteractionIndex']=0x0,this['_balloonShowDiff']=!0x1;const {action:_0x26e7ce,content:_0x5a1abf,version:_0x2a2a3f,aiBalloon:_0x2ccf3b}=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'](_0x5a1abf,_0x2a2a3f,_0x2ccf3b,_0x26e7ce)['catch'](_0x1f1a86=>{this['_isAbortError'](_0x1f1a86)||console['error']('Error\x20refreshing\x20interaction:',_0x1f1a86);});}['_isAbortError'](_0xcb06d2){return!!_0xcb06d2['message']&&_0xcb06d2['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 _0x51abd4=this['_interactions']['length'];this['_currentInteractionIndex']<_0x51abd4-0x1&&this['_displayInteractionAtIndex'](this['_currentInteractionIndex']+0x1);}['_navigateToNext'](){this['_currentInteractionIndex']>0x0&&this['_displayInteractionAtIndex'](this['_currentInteractionIndex']-0x1);}async['_displayInteractionAtIndex'](_0x40b13a){if(!this['_interactionParams'])return;this['_currentInteractionIndex']=_0x40b13a;const _0x4ae2ad=this['_interactions'][this['_interactions']['length']-0x1-this['_currentInteractionIndex']];if(!_0x4ae2ad)return;if(_0x4ae2ad['hasError'])return this['_setErrorState'](_0x4ae2ad),void this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']);if(!_0x4ae2ad['replies']['length'])return;this['_actionsBalloonView']['hideError'](),this['_interactionParams']&&this['_clearErrorState']();const _0x404e03=_0x4ae2ad['replies'][_0x4ae2ad['replies']['length']-0x1];if(_0x404e03){const _0x3fa34d=this['editor'];try{const _0x4163b3=Os({'editor':_0x3fa34d,'changeGroups':_0x404e03['changeGroups'],'documentContextContent':_0x404e03['documentContextContent'],'showDiff':this['_balloonShowDiff'],'trimUnchanged':!0x1});await new Promise(_0x753509=>setTimeout(_0x753509,0x32)),await this['_actionsBalloonView']['updateContent']({'part':_0x4163b3[0x0],'renderingStrategy':'static','abortSignal':new AbortController()['signal']});}catch(_0xa64cc0){this['_isAbortError'](_0xa64cc0)||console['error']('Error\x20updating\x20content\x20during\x20navigation:',_0xa64cc0);}}this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']);}['_setLoadingState'](){this['_actionsBalloonView']['setIsLoading'](!0x0),this['isBusy']=!0x0;}async['_setErrorState'](_0x247201){const _0x4f50da=cs(this['editor']['locale'],'AI_ACTIONS_GENERIC_ERROR');this['_actionsBalloonView']['showError'](_0x4f50da),_0x247201['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 ja extends _0x44ca98{static get['requires'](){return[Ba,Fa,za];}static get['pluginName'](){return'AIQuickActions';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x17c872){super(_0x17c872),_0x17c872['config']['define']('ai.quickActions',{'extraCommands':[],'removeCommands':[],'isSearchEnabled':!0x0});}}class Ja extends Nt{['resultResponseView'];['acceptButtonView'];['dismissButtonView'];['infoButtonView'];['outdatedButtonView'];constructor(_0x401431,_0x374f9f){super(_0x401431),this['id']=_0x374f9f,this['set']('status','pending'),this['set']('changeId',_0x374f9f),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',(_0x3b8659,_0x54b1e3)=>{_0x54b1e3&&_0x54b1e3['target']&&'A'===_0x54b1e3['target']['tagName']&&_0x54b1e3['preventDefault'](),this['fire']('activateChange',{'id':_0x374f9f,'source':this,'uiInteraction':'click'});}),this['on']('mouseover',()=>{this['fire']('activateChange',{'id':_0x374f9f,'source':this,'uiInteraction':'hover'});}),this['on']('mouseout',()=>{this['fire']('deactivateChange',{'origin':'panel','id':_0x374f9f,'source':this});});}['setItemAsActive'](){this['isActive']=!0x0;}['setItemAsInactive'](){this['isActive']=!0x1;}['_createResultResponseView'](){const _0x364efb=new Nt(this['locale']);return _0x364efb['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',_0x62d098=>!_0x62d098)]}}),_0x364efb;}['_createAcceptButtonView'](){const _0x243b67=new kt(this['locale']);return _0x243b67['set']({'label':cs(this['locale'],'AI_REVIEW_MODE_ACCEPT_CHANGE'),'withText':!0x0}),_0x243b67['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x433ef3=>{this['fire']('acceptChange',{'id':this['changeId']}),_0x433ef3['stopPropagation']();})},'attributes':{'class':[this['bindTemplate']['if']('status','ck-hidden',_0x595608=>'pending'!==_0x595608&&'accepted'!==_0x595608),this['bindTemplate']['if']('status',us,_0x1fe61f=>'pending'===_0x1fe61f),this['bindTemplate']['if']('status',ds,_0x45a8e9=>'pending'!==_0x45a8e9),this['bindTemplate']['if']('status','ck-ai_review__check-run-result-status-button',_0x3fd262=>'accepted'===_0x3fd262)]}}),this['on']('change:status',(_0x520f5b,_0x195fde,_0x5f1225)=>{_0x243b67['isEnabled']='pending'===_0x5f1225,'accepted'===_0x5f1225&&(_0x243b67['label']=cs(this['locale'],'AI_REVIEW_MODE_CHECK_STATUS_ACCEPTED'),_0x243b67['icon']=_0x1d53d5);}),_0x243b67;}['_createDismissButtonView'](){const _0x32352e=new kt(this['locale']);return _0x32352e['set']({'label':cs(this['locale'],'AI_REVIEW_MODE_DISMISS_CHANGE'),'withText':!0x0}),_0x32352e['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x1dc2be=>{this['fire']('dismissChange',{'id':this['changeId']}),_0x1dc2be['stopPropagation']();})},'attributes':{'class':[ds,this['bindTemplate']['if']('status','ck-hidden',_0x3eb07f=>'pending'!==_0x3eb07f&&'rejected'!==_0x3eb07f),this['bindTemplate']['if']('status','ck-ai_review__check-run-result-dismiss-button',_0x4894ec=>'pending'===_0x4894ec),this['bindTemplate']['if']('status','ck-ai_review__check-run-result-status-button',_0x59ba1f=>'rejected'===_0x59ba1f)]}}),this['on']('change:status',(_0x494a30,_0x2be41f,_0x44e558)=>{_0x32352e['isEnabled']='pending'===_0x44e558,'rejected'===_0x44e558&&(_0x32352e['label']=cs(this['locale'],'AI_REVIEW_MODE_CHECK_STATUS_REJECTED'),_0x32352e['icon']=_0x2a335e);}),_0x32352e;}['_createInfoButtonView'](){const _0x75ce76=new kt(this['locale']);return _0x75ce76['set']({'label':cs(this['locale'],'AI_REVIEW_MODE_LEARN_MORE'),'icon':_0x2d51f0,'tooltip':!0x0,'isToggleable':!0x0,'role':'menuitemcheckbox','class':ds+'\x20ck-ai_review__check-run-result-info-button\x20ck-hidden'}),_0x75ce76['bind']('isOn')['to'](this,'isInfoToggleOn',_0x4793c6=>_0x4793c6),_0x75ce76['on']('execute',()=>{this['isInfoToggleOn']=!this['isInfoToggleOn'];}),_0x75ce76;}['_createOutdatedButtonView'](){const _0x2f5a77=new kt(this['locale']);return _0x2f5a77['set']({'label':cs(this['locale'],'AI_REVIEW_MODE_CHECK_STATUS_OUTDATED'),'icon':it,'withText':!0x0,'isEnabled':!0x1}),_0x2f5a77['extendTemplate']({'attributes':{'class':[ds,'ck-ai_review__check-run-result-status-button',this['bindTemplate']['if']('status','ck-hidden',_0x536623=>'outdated'!==_0x536623)],'disabled':'disabled'}}),_0x2f5a77;}}class Za extends Qt{['resultItemView'];['_pinnedRectIndex']=void 0x0;['_pinnedTargetElement']=void 0x0;['_pinnedTargetChangeId']=void 0x0;constructor(_0x274621,_0x2ee309){super(_0x274621),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']()),_0x2ee309['add'](this);}['render'](){super['render'](),this['_setupClickOutsideHandler']();}['updateContent'](_0x5e8e2c){this['resultItemView']['changeId']=_0x5e8e2c['id'],this['resultItemView']['resultResponseView']['element']['innerHTML']=_0x5e8e2c['contentDiffed'];}['showBalloon'](_0x229888,_0x296b74,_0xde3434,_0x1c33a1,_0x2a6eea,_0x46a5fb){const _0x360221=_0x296b74();if(!_0x360221)return;this['updateContent'](_0x229888),this['show']();const _0x225952=Array['from'](_0x360221['getClientRects']())['reverse'](),_0x306b5d=this['_getPointedRectIndexFromEvent'](_0xde3434,_0x225952),_0x178d89=_0x225952[_0x306b5d??0x0];'click'===_0x1c33a1?(this['isDiffActive']=!0x0,this['pin']({'target':()=>this['_getBestRectPositionOnClick'](_0x296b74(),_0x306b5d,_0x229888['id'],_0x2a6eea,_0x46a5fb)||_0x178d89})):'hover'===_0x1c33a1&&(this['isDiffActive']=!0x1,this['pin']({'target':()=>this['_getBestRectPositionOnHover'](_0x296b74(),_0x306b5d,_0x229888['id'])||_0x178d89}));}['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 _0x43a433=[this['element']];return this['_pinnedTargetElement']&&_0x43a433['push'](this['_pinnedTargetElement']),_0x43a433;},'callback':()=>{this['hide'](),this['unpin'](),this['deactivateChange'](),this['_pinnedTargetElement']=void 0x0,this['_pinnedRectIndex']=void 0x0,this['_pinnedTargetChangeId']=void 0x0;}});}['_createContentView'](){const _0x3376b9=new Nt();return this['resultItemView']=new Ja(this['locale'],''),this['resultItemView']['resultResponseView']['extendTemplate']({'attributes':{'class':['ck-content']}}),this['resultItemView']['delegate']('acceptChange','dismissChange')['to'](this),_0x3376b9['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']]}]}),_0x3376b9;}['_getBestRectPositionOnClick'](_0x35df79,_0x50372c,_0x242740,_0x5e5560,_0x326a2d){if(!_0x35df79)return null;const _0x3e3d66=this['position']['replace']('arrow_',''),_0x4da372=Array['from'](_0x35df79['getClientRects']());let _0x1a3211,_0x471b11=_0x4da372['reverse']();return void 0x0!==_0x50372c&&this['_isPinnedRectVisible'](_0x471b11[_0x50372c],_0x5e5560,_0x326a2d)?(_0x1a3211=_0x471b11[_0x50372c],this['_pinnedRectIndex']=_0x50372c):this['_isPinnedRectVisible'](_0x471b11[0x0],_0x5e5560,_0x326a2d)&&void 0x0===_0x50372c?_0x1a3211=_0x471b11[0x0]:(_0x471b11='s'==_0x3e3d66[0x0]?[..._0x4da372]['reverse']():_0x4da372,_0x471b11['forEach'](_0x200d70=>{this['_isPinnedRectVisible'](_0x200d70,_0x5e5560,_0x326a2d)&&(_0x1a3211=_0x200d70);})),this['_pinnedTargetChangeId']=_0x242740,this['_pinnedTargetElement']=_0x35df79,_0x1a3211||_0x35df79['getBoundingClientRect']();}['_getBestRectPositionOnHover'](_0x35397e,_0x5e5c92,_0x28c97e){if(!_0x35397e)return null;const _0x22218c=Array['from'](_0x35397e['getClientRects']())['reverse']();if(void 0x0===this['_pinnedRectIndex']&&void 0x0!==_0x5e5c92&&this['_pinnedTargetChangeId']!==_0x28c97e)return this['_pinnedRectIndex']=_0x5e5c92,this['_pinnedTargetElement']=_0x35397e,this['_pinnedTargetChangeId']=_0x28c97e,_0x22218c[_0x5e5c92];if(void 0x0!==this['_pinnedRectIndex']&&this['_pinnedTargetChangeId']===_0x28c97e){if(_0x35397e!==this['_pinnedTargetElement'])return Array['from'](this['_pinnedTargetElement']['getClientRects']())['reverse']()[this['_pinnedRectIndex']];return _0x22218c[this['_pinnedRectIndex']];}return void 0x0!==_0x5e5c92&&this['_pinnedTargetChangeId']!==_0x28c97e?(this['_pinnedRectIndex']=_0x5e5c92,this['_pinnedTargetElement']=_0x35397e,this['_pinnedTargetChangeId']=_0x28c97e,_0x22218c[_0x5e5c92]):_0x35397e['getBoundingClientRect']();}['_getPointedRectIndexFromEvent'](_0x2c39ae,_0x29b1b4){if(_0x2c39ae)for(let _0x24de80=0x0;_0x24de80<_0x29b1b4['length'];_0x24de80++){const _0x22cf67=_0x29b1b4[_0x24de80];if(_0x2c39ae['clientX']>=_0x22cf67['left']-0x3&&_0x2c39ae['clientX']<=_0x22cf67['right']+0x3&&_0x2c39ae['clientY']>=_0x22cf67['top']-0x3&&_0x2c39ae['clientY']<=_0x22cf67['bottom']+0x3)return _0x24de80;}}['_isPinnedRectVisible'](_0x2567fa,_0x309f44,_0x429b8f){const _0x2162ec=new ut(_0x2567fa),_0x2cdab4=_0x309f44||document['documentElement'],_0x1992c1=_0x2162ec['getIntersection'](bt(_0x429b8f)),_0x11b737=new ut(_0x2cdab4)['getIntersection'](_0x2162ec);return!!(_0x1992c1&&_0x11b737&&_0x2162ec['width']>0x0);}}const to=['getReviewCheckList','runReviewCheck','abortReviewStream','toggleDiff','acceptAllChanges','leaveReviewCoreResultList','activateChange','deactivateChange','acceptChange','dismissChange','learnMore','finishReview','retryReview'];class eo extends _0x474324{['_mainView'];['_balloonSuggestionView'];['_bodyCollection'];static get['requires'](){return[os];}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x23a127){super(_0x23a127),this['_bodyCollection']=new qt(this['context']['locale']),this['_bodyCollection']['attachToDom'](),this['_mainView']=this['createMainView'](),this['_mainView']['delegate'](...to)['to'](this),this['_balloonSuggestionView']=new Za(this['context']['locale'],this['_bodyCollection']),this['_balloonSuggestionView']['delegate']('acceptChange','dismissChange','deactivateChange')['to'](this);}['init'](){const _0x184fce=this['context']['plugins']['get']('AITabs');this['registerTab'](_0x184fce);}['destroy'](){this['_bodyCollection']['detachFromDom'](),super['destroy']();}['setAvailableChecks'](_0x48fb93){if(!this['_mainView']['reviewCheckListView']['hasChecks']()){const _0xab50a2=!this['context']['config']['get']('ai.models.showModelSelector');this['_mainView']['reviewCheckListView']['setChecks'](_0x48fb93,_0xab50a2);}this['_mainView']['showReviewCheckListView']();}['showReviewCheckList'](){this['fire']('getReviewCheckList');}['showCheckRunResults'](_0x47d8f1){_0x47d8f1&&('error-general'!==_0x47d8f1['status']?'error-chunk'!==_0x47d8f1['status']?this['_mainView']['showReviewCheckResultsView']():this['showChunkErrorView']():this['showGeneralResultsErrorView']());}['showCheckRunResult'](_0x4f675b){this['_mainView']['addCheckRunResult'](_0x4f675b);}['showGeneralResultsErrorView'](){this['_mainView']['showGeneralResultsErrorView']();}['showGeneralReviewCoreErrorView'](_0x92093){this['_mainView']['showGeneralReviewCoreErrorView'](_0x92093??cs(this['context']['locale'],'AI_REVIEW_INITIALIZATION_ERROR_MESSAGE'));}['showChunkErrorView'](){this['_mainView']['showChunkErrorView']();}['setCheckResultTitle'](_0x1ee36d,_0x11030c){this['_mainView']['reviewCheckResultsView']['setTitle'](_0x1ee36d,_0x11030c);}['setActiveStateInResults'](_0x39d487){this['_mainView']['reviewCheckResultsView']['getResults']()['forEach'](_0x295f7e=>{_0x295f7e['id']===_0x39d487&&_0x295f7e['setItemAsActive']();});}['resetActiveStateInResults'](){this['_mainView']['reviewCheckResultsView']['getResults']()['forEach'](_0x19d373=>_0x19d373['setItemAsInactive']());}['updateChangeState'](_0x23c4b9,_0x50c221){'accepted'===_0x50c221||'rejected'===_0x50c221||'outdated'===_0x50c221?this['_mainView']['reviewCheckResultsView']['hideResult'](_0x23c4b9,_0x50c221):this['_mainView']['reviewCheckResultsView']['showResult'](_0x23c4b9,_0x50c221);}['showReviewCompletedView'](){this['_mainView']['showReviewCompletedView']();}['showActionsWhenResultIsReady'](){this['_mainView']['showActionsWhenResultIsReady']();}['showNoChangesView'](){this['_mainView']['showNoChangesView']();}['hideActionsWhenResultIsReady'](){this['_mainView']['hideActionsWhenResultIsReady']();}['showChangeBalloon'](_0x24619f,_0x23da4f,_0x45c89e,_0x52c9d0,_0x27b046,_0x134b37){this['_balloonSuggestionView']['showBalloon'](_0x24619f,_0x23da4f,_0x45c89e,_0x52c9d0,_0x27b046,_0x134b37);}['hideChangeBalloon'](){this['_balloonSuggestionView']['hideBalloon']();}['hideDiffInBalloon'](){this['_balloonSuggestionView']['hideDiffInBalloon']();}['showDiffInBalloon'](){this['_balloonSuggestionView']['showDiffInBalloon']();}['getChangeElement'](_0x2d42b8){const _0x48e808=this['_mainView']['reviewCheckResultsView']['getResults']()['find'](_0xd59287=>_0xd59287['id']===_0x2d42b8);return _0x48e808?_0x48e808['element']:null;}['deactivateChange'](){this['_balloonSuggestionView']['deactivateChange']();}}class io extends Nt{constructor(_0xcac8e8){super(_0xcac8e8),this['set']('isVisible',!0x1),this['set']('errorMessage','');const _0x599ab7=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai_review__general-error-container',_0x599ab7['if']('isVisible','ck-hidden',_0x49b3ee=>!_0x49b3ee)]},'children':[{'tag':'p','attributes':{'class':'ck\x20ck-ai-notification\x20ck-ai-notification_error'},'children':[{'text':_0x599ab7['to']('errorMessage')}]}]});}}class so extends Nt{['reviewCoreHeader'];['generalErrorView'];['reviewCheckListView'];['reviewCheckResultsView'];['reviewCompletedView'];constructor(_0x54247b,_0x3dcafb){super(_0x54247b),this['reviewCoreHeader']=_0x3dcafb['header'],this['generalErrorView']=new io(_0x54247b),this['reviewCheckListView']=_0x3dcafb['list'],this['reviewCheckListView']['delegate'](...to)['to'](this),this['reviewCheckResultsView']=_0x3dcafb['results'],this['reviewCheckResultsView']['delegate'](...to)['to'](this),this['reviewCompletedView']=_0x3dcafb['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'](_0x4279b0){this['reviewCheckResultsView']['addResult'](_0x4279b0),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'](_0x56025e){this['generalErrorView']['set']('isVisible',!0x0),this['generalErrorView']['errorMessage']=_0x56025e;}['showGeneralResultsErrorView'](){this['reviewCheckResultsView']['set']('isLoading',!0x1),this['showActionsWhenResultIsReady'](),this['reviewCheckResultsView']['showGeneralErrorMessage']();}['showChunkErrorView'](){this['reviewCheckResultsView']['set']('isLoading',!0x1),this['showActionsWhenResultIsReady'](),this['reviewCheckResultsView']['showChunkErrorMessage']();}}class no extends kt{constructor(_0x820c40,_0x4f5c09){super(_0x4f5c09),this['set']({'label':_0x820c40,'withText':!0x0,'class':ls}),this['on']('execute',()=>{this['fire']('finishReview');});}}class ro extends Pt{['_resultViews'];['_resultsHeader'];['reviewDisclaimer'];['_cancelButtonView'];['_acceptAllButtonView'];['_exitReviewButtonView'];['_toggleDiffButtonView'];['_errorMessageView'];['_finishReviewButtonView'];['_contents'];constructor(_0x4ecf3f,_0x163183){super(_0x4ecf3f),this['_contents']=_0x163183,this['_resultViews']=new _0x534e2b(),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 ta(_0x4ecf3f),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 _0x4127a2=this['_createCombinedSkeletonLoader'](),_0x49bdf8=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run',_0x49bdf8['if']('isLoading','ck-ai_review__check-run_loading',_0x5e0ea5=>_0x5e0ea5),_0x49bdf8['if']('isResultReady','ck-ai_review__check-run_ready',_0x2f3e02=>_0x2f3e02),_0x49bdf8['if']('isVisible','ck-hidden',_0x5d3a80=>!_0x5d3a80)]},'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',_0xbde819=>_0xbde819)]},'children':this['_resultViews']},_0x4127a2]},this['reviewDisclaimer']]});}['clearResults'](){this['_resultViews']['clear']();}['getResults'](){return this['_resultViews'];}['addResult'](_0x18650f){const _0x565727=new Ja(this['locale'],_0x18650f['id']);_0x565727['delegate']('acceptChange','dismissChange','activateChange','deactivateChange')['to'](this),this['_resultViews']['add'](_0x565727),_0x565727['resultResponseView']['element']['innerHTML']=_0x18650f['contentDiffed'];}['hideResult'](_0x1d134b,_0x59dd8d){if('pending'===_0x59dd8d)return;const _0x13b0f0=this['_resultViews']['find'](_0x4b0eaa=>_0x4b0eaa['id']===_0x1d134b);_0x13b0f0&&(_0x13b0f0['status']=_0x59dd8d,_0x13b0f0['element']?.['classList']['add']('ck-ai_review__check-run-result_grayout'));}['showResult'](_0x28264a,_0x49e392){if('pending'!==_0x49e392)return;const _0x490f78=this['_resultViews']['find'](_0x429f26=>_0x429f26['id']===_0x28264a);_0x490f78&&(_0x490f78['status']=_0x49e392,_0x490f78['element']?.['classList']['remove']('ck-ai_review__check-run-result_grayout'));}['setTitle'](_0x30bc49,_0x2be379){this['headerTitle']=_0x30bc49,this['headerSubtitle']=_0x2be379||'';}['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'],tr['aiReviewChecks']);}['_createCombinedSkeletonLoader'](){const _0x39318e=new Nt(this['locale']),_0x5167a9=[];for(let _0x1a0fb9=0x0;_0x1a0fb9<0x10;_0x1a0fb9++){const _0x1adc8f=this['_createSkeletonLoader']();_0x1adc8f['extendTemplate']({'attributes':{'class':['ck-ai_review__check-run-skeleton-item']}}),_0x5167a9['push'](_0x1adc8f);}return _0x39318e['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-skeleton-container',this['bindTemplate']['if']('isLoading','ck-hidden',_0x14379c=>!_0x14379c)]},'children':_0x5167a9}),_0x39318e;}['_createErrorView'](){const _0x53f800=new Nt(this['locale']),_0x2d358a=new kt(this['locale']),t=this['locale']['t'];return _0x53f800['delegate']('retryReview')['to'](this),_0x2d358a['set']({'label':t('Try\x20again'),'withText':!0x0,'class':us+'\x20ck-ai_review__check-run-error-retry-button'}),_0x2d358a['on']('execute',()=>{this['fire']('retryReview');}),_0x53f800['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-error-container',this['bindTemplate']['if']('showErrorMessage','ck-hidden',_0x55f9a5=>!_0x55f9a5),this['bindTemplate']['if']('errorType','ck-ai_review__check-run-error-container_border-bottom',_0x27361b=>'chunk'===_0x27361b)]},'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',_0x52fb45=>'chunk'===_0x52fb45)]},'children':[{'tag':'p','attributes':{'class':['ck-ai-notification__content',this['bindTemplate']['if']('errorType','ck-hidden',_0x1aa379=>'general'!==_0x1aa379)]},'children':[{'text':this['_contents']['generalErrorText']}]},{'tag':'p','attributes':{'class':['ck-ai-notification__content',this['bindTemplate']['if']('errorType','ck-hidden',_0x3af5a7=>'chunk'!==_0x3af5a7)]},'children':[{'text':cs(this['locale'],'AI_REVIEW_MODE_CHUNK_ERROR_MESSAGE')}]}]},_0x2d358a]}),_0x53f800;}['_createCancelButtonView'](){const _0x31457f=new kt(this['locale']);return _0x31457f['set']({'label':cs(this['locale'],'AI_REVIEW_MODE_STOP_GENERATING'),'withText':!0x0,'class':[us+'\x20ck-ai-button-stop-generating'],'icon':_0x57d95b}),_0x31457f['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isResultReady','ck-hidden',_0x11a0dd=>_0x11a0dd),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x321ed2=>_0x321ed2)]}}),_0x31457f['on']('execute',()=>{this['fire']('abortReviewStream');}),_0x31457f;}['_createToggleDiffButtonView'](){const _0x2be30a=new kt(this['locale']);_0x2be30a['set']({'tooltip':!0x0,'isToggleable':!0x0,'role':'menuitemcheckbox'}),_0x2be30a['bind']('isEnabled')['to'](this,'isError',_0x249bca=>!_0x249bca),_0x2be30a['extendTemplate']({'attributes':{'class':[us,'ck-ai_review__check-run-toggle-diff-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0x27a1ee=>!_0x27a1ee),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x2181da=>_0x2181da)]}});const _0x55ade0=cs(this['locale'],'AI_REVIEW_MODE_HIDE_CHANGES'),_0x426252=cs(this['locale'],'AI_REVIEW_MODE_SHOW_CHANGES');return _0x2be30a['bind']('isOn')['to'](this,'isToggleDiffOn',_0x1f8e6b=>_0x1f8e6b),_0x2be30a['bind']('icon')['to'](this,'isToggleDiffOn',_0x2fdd41=>_0x2fdd41?st:nt),_0x2be30a['bind']('label')['to'](this,'isToggleDiffOn',_0x221d1e=>_0x221d1e?_0x55ade0:_0x426252),_0x2be30a['on']('execute',()=>{this['isToggleDiffOn']=!this['isToggleDiffOn'],this['fire']('toggleDiff',{'on':this['isToggleDiffOn']});}),_0x2be30a;}['_createAcceptAllButtonView'](){const _0x1f2424=new kt(this['locale']);return _0x1f2424['set']({'label':cs(this['locale'],'AI_REVIEW_MODE_ACCEPT_ALL'),'withText':!0x0}),_0x1f2424['bind']('isEnabled')['to'](this,'isError',_0x3f5c9c=>!_0x3f5c9c),_0x1f2424['extendTemplate']({'attributes':{'class':[ls,'ck-ai_review__check-run-accept-all-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0x61159e=>!_0x61159e),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x3bfdaa=>_0x3bfdaa)]}}),_0x1f2424['on']('execute',()=>{this['fire']('acceptAllChanges');}),_0x1f2424;}['_createExitReviewButtonView'](){const _0x248fcc=new kt(this['locale']);return _0x248fcc['set']({'label':cs(this['locale'],'AI_REVIEW_MODE_EXIT_REVIEW'),'withText':!0x0}),_0x248fcc['extendTemplate']({'attributes':{'class':[ds,'ck-ai_review__check-run-exit-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0x252dda=>!_0x252dda),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x564754=>_0x564754)]}}),_0x248fcc['on']('execute',()=>{this['fire']('leaveReviewCoreResultList');}),_0x248fcc;}['_createResultHeaderView'](){const _0x4f59cd=new Nt(this['locale']),_0x1cf023=this['_createTitleView']();return _0x4f59cd['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-header',this['bindTemplate']['if']('isCompleted','ck-ai_review__review-completed-header',_0x207f4b=>_0x207f4b)]},'children':[_0x1cf023,{'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-header-buttons']},'children':[this['_cancelButtonView'],this['_acceptAllButtonView'],this['_exitReviewButtonView'],this['_toggleDiffButtonView'],this['_finishReviewButtonView']]}]}),_0x4f59cd;}['_createTitleView'](){const _0x599f70=new Nt(this['locale']),_0x29394f=new Rn();return _0x29394f['bind']('isVisible')['to'](this,'isResultReady',_0x854080=>!_0x854080),_0x599f70['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-header-title-wrapper']},'children':[_0x29394f,{'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-header-title-content',this['bindTemplate']['if']('isCompleted','ck-hidden',_0x2a3063=>_0x2a3063)]},'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',_0x39bef5=>!_0x39bef5)]},'children':[{'text':cs(this['locale'],'AI_REVIEW_MODE_FINISH_REVIEW_HEADER_TITLE')}]}]}),_0x599f70;}['_createFinishReviewButtonView'](){const _0x3c4bde=new no(cs(this['locale'],'AI_REVIEW_MODE_FINISH_REVIEW_BUTTON_LABEL'),this['locale']);return _0x3c4bde['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isCompleted','ck-hidden',_0x3f9723=>!_0x3f9723)]}}),_0x3c4bde['delegate']('finishReview')['to'](this),_0x3c4bde;}}class ao extends Pt{['_resultsHeader'];['_finishReviewButtonView'];constructor(_0xe0caa5,_0xd9a0ad){super(_0xe0caa5),this['_finishReviewButtonView']=this['_createFinishReviewButtonView'](_0xd9a0ad['buttonText']),this['_resultsHeader']=this['_createResultHeaderView'](_0xd9a0ad['headerText']);const _0x1d7fc1=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__review-completed',_0x1d7fc1['if']('isVisible','ck-hidden',_0x496379=>!_0x496379)]},'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':_0xd9a0ad['emptyResultsText']}]}]}]});}['_createFinishReviewButtonView'](_0xf6b63c){const _0x9a04cd=new no(_0xf6b63c,this['locale']);return _0x9a04cd['delegate']('finishReview')['to'](this),_0x9a04cd;}['_createResultHeaderView'](_0x363826){const _0x3996e2=new Nt(this['locale']);return _0x3996e2['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':_0x363826}]},{'tag':'div','attributes':{'class':['ck-ai_review__review-completed-header-buttons']},'children':[this['_finishReviewButtonView']]}]}),_0x3996e2;}}class oo extends Nt{['_dropdownView'];['_defaultValue'];['_defaultLabel'];constructor(_0x27d56d,_0x3ad4ef){super(_0x27d56d),this['_defaultValue']=_0x3ad4ef['default']||(_0x3ad4ef['data']['length']>0x0?_0x3ad4ef['data'][0x0]['id']:''),this['_defaultLabel']=_0x3ad4ef['data']['find'](_0x53aff8=>_0x53aff8['id']===this['_defaultValue'])?.['label']||'',this['set']('formValue',''),this['_dropdownView']=Bt(this['locale']);const _0x1da1cd=this['_prepareListOptions'](_0x3ad4ef['data']);zt(this['_dropdownView'],_0x1da1cd,{'role':'menu','ariaLabel':_0x3ad4ef['label']}),this['_dropdownView']['buttonView']['set']({'label':this['_defaultLabel'],'withText':!0x0}),this['_dropdownView']['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x34c60f=>{_0x34c60f['stopPropagation']();})}}),this['listenTo'](this['_dropdownView'],'execute',_0x17b500=>{this['formValue']=_0x17b500['source']['model']['id'],this['_dropdownView']['buttonView']['label']=_0x17b500['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'](_0x5ccc77=[]){const _0x162986=new dt();this['resetToDefault']();for(const _0x4f6ab8 of _0x5ccc77){const _0xaa5892=new jt({'label':_0x4f6ab8['label'],'withText':!0x0,'role':'menuitemradio','id':_0x4f6ab8['id'],'model':_0x4f6ab8});_0xaa5892['bind']('isOn')['to'](this,'formValue',_0x1a7636=>_0x1a7636===_0xaa5892['id']);const _0x456f7e={'type':'button','model':_0xaa5892};_0x162986['add'](_0x456f7e);}return _0x162986;}}class ho extends Pt{['_formItem']=null;constructor(_0x26c623,_0x593e3d,_0xa35fb5){super(_0x26c623),this['argsKey']=_0x593e3d?.['argsKey'];if('dropdown'===_0x593e3d['formType'])this['_formItem']=new oo(this['locale'],_0x593e3d);this['set']('value',''),this['bind']('value')['to'](this['_formItem'],'formValue');const _0x952b13=new _0x5be496(this['locale'],{'children':[this['_formItem']],'class':[_0xa35fb5?'ck-form__row_with-submit':'']});_0xa35fb5&&_0x952b13['children']['add'](_0xa35fb5),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai_review__form-item','ck-reset_all']},'children':[_0x952b13]});}['resetToDefault'](){this['_formItem']['resetToDefault']();}}class co extends _0x370151{['keystrokes'];static ['MIN_ROWS']=0x1;static ['MAX_ROWS']=0xc;constructor(_0x585056){super(_0x585056),this['set']('isEmpty',!0x0),this['keystrokes']=new At(),this['minRows']=co['MIN_ROWS'],this['maxRows']=co['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 lo extends Nt{['focusTracker']=new _t();['keystrokes']=new At();['focusCycler'];['_focusables']=new _0x534e2b();['submitButtonView'];['cancelButtonView'];['promptInputView'];['actionsFooterView'];['_modelSelectionDropdown'];['_modelNameView'];['_modelSelectionDropdownItems'];['_check'];['_defaultValue'];['_defaultLabel'];constructor(_0x424c21,_0x266416,_0xf73f78=!0x1){super(_0x424c21),this['_check']=_0x266416,this['set']('prompt',''),this['set']('modelId',''),this['set']('modelDisplayMode','selector'),this['set']('activeModelName',null),this['_defaultValue']=_0x266416['defaultModel']?_0x266416['defaultModel']['id']:'',this['_defaultLabel']=_0x266416['defaultModel']?_0x266416['defaultModel']['name']:'',this['submitButtonView']=this['_createSubmitButtonView'](),this['cancelButtonView']=this['_createCancelButtonView'](),(this['promptInputView']=new Zt(this['locale'],()=>new co(_0x424c21)),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'](_0xf73f78),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 _0x5be496(this['locale'],{'children':[this['promptInputView']]}),new _0x5be496(this['locale'],{'children':[this['actionsFooterView']]})]}),this['promptInputView']['fieldView']['keystrokes']['set']('Enter',(_0x37a878,_0x4e14fd)=>{this['_isValid']()?(this['fire']('runReviewCheck',{'id':'custom','args':{'prompt':this['prompt'],'model':this['modelId']},'isCustom':!0x0}),_0x4e14fd()):_0x4e14fd();}),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'](_0x2f0035=>{this['_focusables']['add'](_0x2f0035),this['focusTracker']['add'](_0x2f0035['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 _0x25957a of this['_getFormValidators']()){const _0x1a9b8a=_0x25957a();if(_0x1a9b8a)return this['promptInputView']['errorText']=_0x1a9b8a,!0x1;}return!0x0;}['_getFormValidators'](){return[()=>{if(0x0===this['promptInputView']['fieldView']['value']?.['trim']()['length'])return cs(this['locale'],'AI_REVIEW_MODE_PROMPT_EMPTY_ERROR');}];}['_createSubmitButtonView'](){const _0x5f2683=new kt(this['locale']),t=this['locale']['t'];return _0x5f2683['set']({'label':t('Submit'),'withText':!0x0,'class':ls}),_0x5f2683['on']('execute',()=>{this['_isValid']()&&this['fire']('runReviewCheck',{'id':'custom','args':{'prompt':this['prompt'],'model':this['modelId']},'isCustom':!0x0});}),_0x5f2683;}['_createCancelButtonView'](){const _0x4e237a=new kt(this['locale']),t=this['locale']['t'];return _0x4e237a['set']({'label':t('Cancel'),'withText':!0x0,'class':ds}),_0x4e237a['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x1618d5=>{_0x1618d5['stopPropagation']();})}}),_0x4e237a['on']('execute',()=>{this['resetToDefault'](),this['fire']('closeCustomCheck');}),_0x4e237a;}['_setModelList'](_0x5d7879){this['_modelSelectionDropdownItems']['clear']();const _0x50ea3b=this['_check']['models'];if(_0x5d7879)this['set']('modelDisplayMode','hidden');else{const _0x560252=0x1===_0x50ea3b['length'];this['set']('modelDisplayMode',_0x560252?'name':'selector');}if(this['resetToDefault'](),_0x50ea3b?.['length']){0x1===_0x50ea3b['length']&&this['set']('activeModelName',_0x50ea3b[0x0]['name']||_0x50ea3b[0x0]['id']);for(const _0x599f88 of _0x50ea3b){const _0xd1ea39=new jt({'label':_0x599f88['name'],'withText':!0x0,'role':'menuitemradio','id':_0x599f88['id'],'model':_0x599f88});_0xd1ea39['bind']('isOn')['to'](this,'modelId',_0x5bdc55=>_0x5bdc55===_0x599f88['id']),this['_modelSelectionDropdownItems']['add']({'type':'button','model':_0xd1ea39,'labelView':new _o(this['locale'],_0x599f88)});}}}['_createModelSelectionDropdown'](){const _0x1573ea=Bt(this['locale']);return _0x1573ea['set']({'panelPosition':'se','class':'ck-ai_review__check-list-item-model-dropdown'}),_0x1573ea['buttonView']['set']({'label':this['_defaultLabel'],'withText':!0x0,'tooltip':!0x0,'class':ds}),_0x1573ea['buttonView']['bind']('isVisible')['to'](this,'modelDisplayMode',_0x686b8e=>'selector'===_0x686b8e),this['listenTo'](_0x1573ea,'execute',_0x58b97d=>{this['modelId']=_0x58b97d['source']['model']['id'],_0x1573ea['buttonView']['label']=_0x58b97d['source']['label'];}),_0x1573ea;}['_createModelNameView'](){const _0x34e0cf=new uo(this['locale']);return _0x34e0cf['bind']('text')['to'](this,'activeModelName',_0x41109b=>_0x41109b??''),_0x34e0cf['bind']('isVisible')['to'](this,'modelDisplayMode',_0x152017=>'name'===_0x152017),_0x34e0cf;}['_createActionsFooterView'](){const _0xc7479c=new Nt(this['locale']);return _0xc7479c['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']]}]}),_0xc7479c;}}class uo extends Nt{constructor(_0x32bd34){super(_0x32bd34),this['set']('text',void 0x0),this['set']('isVisible',!0x0);const _0x3c088e=this['bindTemplate'];this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai_review__check-list-item-model-name',_0x3c088e['if']('isVisible','ck-hidden',_0x1dd965=>!_0x1dd965)]},'children':[{'text':_0x3c088e['to']('text')}]});}}class _o extends Ht{constructor(_0x492df3,_0x229742){super();const _0x251cf9=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-button__label'],'style':_0x251cf9['to']('style'),'id':_0x251cf9['to']('id')},'children':[{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-model-dropdown-name']},'children':[{'tag':'span','children':[{'text':_0x251cf9['to']('text')}]}]},{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-model-dropdown-description']},'children':[{'tag':'span','children':[_0x229742['description']||'']}]}]});}}class Ao extends Pt{['_formItemsCollection']=new _0x534e2b();['_customCheckView']=null;['_hideModels']=!0x1;constructor(_0x4811fb,_0x525384,_0x25dc69,_0x712686=!0x1){super(_0x4811fb),this['_hideModels']=_0x712686,this['set']('isParametrizedViewOpen',!0x1),this['set']('isListItemRendered',!0x1),this['set']('isItemParametrized',_0x525384['isParameterized']);const _0x6941fe=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',_0x507b10=>_0x507b10),this['bindTemplate']['if']('isListItemRendered','ck-ai_review__check-list-item_rendered',_0x462f28=>_0x462f28)],'style':{'--ck-ai-review-check-list-item-index':_0x25dc69}},'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':_0x525384['title']}]},_0x6941fe]},{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-description']},'children':_0x525384['description']?[{'text':_0x525384['description']}]:[]}]}]},..._0x525384['isParameterized']?[this['_createParameterizedView'](_0x525384)]:[],...'custom'===_0x525384['id']?[this['_createCustomView'](_0x525384,this['_hideModels'])]:[]]}),this['on']('click',()=>{_0x525384['isParameterized']?this['isParametrizedViewOpen']=!0x0:this['fire']('runReviewCheck',{'id':_0x525384['id'],'args':_0x525384['useArgs']?_0x525384['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'](_0x14c4e3=>{_0x14c4e3['resetToDefault']();}),this['_customCheckView']&&this['_customCheckView']['resetToDefault']();}['_createIconView'](){const _0xc3716b=new yt();return _0xc3716b['content']=rt,_0xc3716b['extendTemplate']({'attributes':{'class':['ck-ai_review__check-list-item-title-icon']}}),_0xc3716b;}['_createParameterizedView'](_0x37d5d2){const _0x206dc7=new Nt(),_0x56cb21=this['_createFormView'](_0x37d5d2);return _0x206dc7['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-parameterized',this['bindTemplate']['if']('isParametrizedViewOpen','ck-hidden',_0x3f4938=>!_0x3f4938)]},'children':[_0x56cb21]}),_0x206dc7;}['_createFormView'](_0x5a1ec0){const _0x4dd596=new Nt(),_0x38279c=Array['isArray'](_0x5a1ec0['options'])?_0x5a1ec0['options']:[],_0x328d8a=new kt(this['locale']),t=this['locale']['t'];_0x328d8a['set']({'label':t('Submit'),'withText':!0x0,'class':ls}),_0x328d8a['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x570ff2=>{_0x570ff2['stopPropagation']();})}}),_0x328d8a['on']('execute',()=>{const _0x72d3b=[],_0xde00f3={};this['_formItemsCollection']['forEach'](_0x25eca4=>{_0x72d3b['push'](_0x25eca4['value']),_0x5a1ec0['useArgs']&&_0x5a1ec0['options']&&(_0xde00f3[_0x25eca4['argsKey']]=_0x25eca4['value']);}),this['fire']('runReviewCheck',{'id':_0x5a1ec0['id'],'params':_0x72d3b['length']?_0x72d3b:void 0x0,'args':Object['keys'](_0xde00f3)['length']?_0xde00f3:void 0x0});});const _0x3ea7d2=_0x38279c['length'];return _0x38279c['forEach']((_0x4de700,_0x3ba127)=>{const _0x164ecb=_0x3ba127===_0x3ea7d2-0x1;this['_formItemsCollection']['add'](new ho(this['locale'],_0x4de700,_0x164ecb?_0x328d8a:null));}),_0x4dd596['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-parameterized-form']},'children':this['_formItemsCollection']}),_0x4dd596;}['_createCustomView'](_0x4d96f7,_0x3cb233=!0x1){return this['_customCheckView']=new lo(this['locale'],_0x4d96f7,_0x3cb233),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',_0x5c5d21=>!_0x5c5d21)]}}),this['_customCheckView']['delegate']('runReviewCheck')['to'](this),this['listenTo'](this['_customCheckView'],'closeCustomCheck',()=>{this['isParametrizedViewOpen']=!0x1;}),this['on']('change:isParametrizedViewOpen',(_0x5c9a39,_0x28f75b,_0xe03f4a)=>{_0xe03f4a||this['_customCheckView']['resetFormValidationStatus']();}),this['_customCheckView'];}}class go extends Pt{['_checkViews'];constructor(_0x568cf5){super(_0x568cf5),this['_checkViews']=new _0x534e2b(),this['_setupTemplate']();}['setChecks'](_0x76c259,_0x3a2d26=!0x1){this['_checkViews']['clear']();for(const [_0x38a47d,_0x57c4a4]of _0x76c259['entries']()){const _0x1ab492=new Ao(this['locale'],_0x57c4a4,_0x38a47d,_0x3a2d26);_0x1ab492['delegate']('runReviewCheck')['to'](this),this['_checkViews']['add'](_0x1ab492);}}['hasChecks'](){return this['_checkViews']['length']>0x0;}['resetAllParameterizedChecks'](){for(const _0x45db8b of this['_checkViews'])_0x45db8b instanceof Ao&&_0x45db8b['resetToDefault']();}['_setupTemplate'](){const _0x2f0f2f=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list',_0x2f0f2f['if']('isVisible','ck-hidden',_0x13e1d6=>!_0x13e1d6)]},'children':this['_checkViews']});}}class Io extends eo{static get['pluginName'](){return'AIReviewModeUI';}['createMainView'](){const _0x12ce2a=this['context']['locale'],_0x55b4f2=new _0x17eb16(_0x12ce2a,{'label':cs(_0x12ce2a,'AI_REVIEW_MODE'),'icon':_0x220492,'class':'ck-ai-header\x20ck-ai-header_review'});return new so(this['context']['locale'],{'header':_0x55b4f2,'list':new go(_0x12ce2a),'results':new ro(_0x12ce2a,{'generalErrorText':cs(_0x12ce2a,'AI_REVIEW_MODE_GENERAL_ERROR_MESSAGE')}),'completed':new ao(_0x12ce2a,{'headerText':cs(_0x12ce2a,'AI_REVIEW_MODE_FINISH_REVIEW_HEADER_TITLE'),'emptyResultsText':cs(_0x12ce2a,'AI_REVIEW_MODE_EMPTY_RESULTS_TEXT'),'buttonText':cs(_0x12ce2a,'AI_REVIEW_MODE_FINISH_REVIEW_BUTTON_LABEL')})});}['registerTab'](){const _0x46d051=this['context']['plugins']['get']('AITabs');_0x46d051['view']['on']('activateTab',(_0x4ab271,_0x28e063)=>{'reviewMode'===_0x28e063?this['fire']('getReviewCheckList'):this['fire']('leaveReview');}),_0x46d051['view']['addTab']({'id':'reviewMode','buttonLabel':cs(this['context']['locale'],'AI_REVIEW_MODE'),'buttonIcon':_0x220492,'order':0x0,'content':this['_mainView']});}}const Eo='review-';class po extends _0x474324{static get['requires'](){return[_0x53366e,zs];}static get['pluginName'](){return'AIReviewCoreEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['_markers']=new Map();['_activeMarkers']=new Set();['_domEmitter'];['_eventEmitter'];constructor(_0x2fa563){super(_0x2fa563),this['_domEmitter']=new(Rt())(),this['_eventEmitter']=new(Et())();}get['emitter'](){return this['_eventEmitter'];}['afterInit'](){const _0x587b93=Ys(this['context']);_0x587b93['conversion']['for']('editingDowncast')['markerToElement']({'model':Eo+'insert','view':(_0x18309f,{writer:_0x50fab9})=>{const _0x4e797e=this['_markers']['get'](_0x18309f['markerName']),_0x123dc5={'class':'ck-ai_review-marker_add'+(this['_activeMarkers']['has'](_0x4e797e?.['id']||'')?'\x20ck-ai_review__change_active':''),'data-marker-id':_0x18309f['markerName']};return _0x50fab9['createUIElement']('span',_0x123dc5,function(_0x180e85){const _0xbefa9c=this['toDomElement'](_0x180e85);return _0xbefa9c['innerHTML']=_0x4e797e?.['content']?.['asString']||'',_0xbefa9c;});}}),_0x587b93['conversion']['for']('editingDowncast')['markerToHighlight']({'model':Eo+'remove-only','view':_0x1adaaf=>{const _0x1407df=this['_markers']['get'](_0x1adaaf['markerName']),_0x428c52=['ck-ai_review-marker_strikethrough'];return this['_activeMarkers']['has'](_0x1407df?.['id']||'')&&_0x428c52['push']('ck-ai_review__change_active'),{'classes':_0x428c52,'attributes':{'data-marker-id':_0x1adaaf['markerName']}};}}),_0x587b93['conversion']['for']('editingDowncast')['markerToHighlight']({'model':Eo+'remove-context','view':_0x5958a6=>{const _0x33b347=this['_markers']['get'](_0x5958a6['markerName']),_0x2ab441=['ck-ai_review-marker_underline'];return this['_activeMarkers']['has'](_0x33b347?.['id']||'')&&_0x2ab441['push']('ck-ai_review__change_active'),{'classes':_0x2ab441,'attributes':{'data-marker-id':_0x5958a6['markerName']}};}}),_0x587b93['conversion']['for']('editingDowncast')['markerToHighlight']({'model':Eo+'remove-text','view':_0x37c0b1=>{const _0x41340d=this['_markers']['get'](_0x37c0b1['markerName']),_0x1371a5=['ck-ai_review-marker_hide'];return this['_activeMarkers']['has'](_0x41340d?.['id']||'')&&_0x1371a5['push']('ck-ai_review__change_active'),{'classes':_0x1371a5,'attributes':{'data-marker-id':_0x37c0b1['markerName']}};}}),_0x587b93['conversion']['for']('dataDowncast')['markerToElement']({'model':Eo+'suggestion-context','view':(_0x2bf231,{writer:_0x52b55a})=>_0x52b55a['createRawElement']('span',{'class':'ck-ai_review-marker_context-'+(_0x2bf231['isOpening']?'start':'end')})}),_0x587b93['conversion']['for']('downcast')['attributeToAttribute']({'model':_0x33b43a,'view':_0x2a5868});const _0x3ecdd0=_0x587b93['ui']['getEditableElement']()||document['body'];this['_domEmitter']['listenTo'](_0x3ecdd0,'mouseup',(_0x2107ca,_0x56591e)=>{const _0x5094a1=_0x56591e['target'],_0x39e0ca=this['_findMarkerElement'](_0x5094a1);if(!_0x39e0ca)return;const _0x11a5a1=_0x39e0ca['getAttribute']('data-marker-id'),_0x1d9155=_0x11a5a1['split'](':')['pop']()?.['split']('_')[0x0];this['_eventEmitter']['fire']('changeMarkerClicked',{'markerId':_0x11a5a1,'changeId':_0x1d9155,'markerElement':()=>this['_findMarkerElementById'](_0x11a5a1),'domEvent':_0x56591e});},{'usePassive':!0x0,'priority':'highest'}),this['_domEmitter']['listenTo'](_0x3ecdd0,'mouseover',(_0x227568,_0xb30f5d)=>{const _0x44c917=_0xb30f5d['target'],_0x40425e=_0xb30f5d['relatedTarget'];let _0x1c688d=this['_findMarkerElement'](_0x44c917);if(!_0x1c688d&&_0x40425e&&(_0x1c688d=this['_findMarkerElement'](_0x40425e)),!_0x1c688d)return;const _0x5772ac=_0x1c688d['getAttribute']('data-marker-id'),_0x2159cb=_0x5772ac['split'](':')['pop']()?.['split']('_')[0x0];this['_eventEmitter']['fire']('changeMarkerHovered',{'changeId':_0x2159cb,'markerElement':()=>this['_findMarkerElementById'](_0x5772ac),'domEvent':_0xb30f5d});}),this['_domEmitter']['listenTo'](document,'mouseover',_0x1259e4((_0x19392d,_0x3f3c88)=>{const _0x294af3=_0x3f3c88['target'];if(this['_findMarkerElement'](_0x294af3))return;_0x294af3['closest']('.ck-reset.ck-ai_review-balloon-panel-suggestion')||this['_eventEmitter']['fire']('changeMarkerBlurred');},0xc8)),_0x587b93['model']['document']['registerPostFixer'](_0x9cd4ec=>this['_validateMarkers'](_0x587b93,_0x9cd4ec)),_0x587b93['model']['document']['on']('change',()=>this['_handleMarkerChanges'](_0x587b93));}['getDocumentData'](){const _0x4d6b09=this['context']['plugins']['get']('AIEditing'),_0xd408eb=Ys(this['context']),_0x574b1f=_0xd408eb['model'],_0x2f83d6=new _0x270bfa();for(const _0x2f44cf of _0x574b1f['document']['getRoot']()['getChildren']()){const _0x2557c2=_0x2f44cf['_clone'](!0x0);_0x2f83d6['_appendChild'](_0x2557c2);}for(const _0xfe074 of _0x574b1f['markers'])_0x2f83d6['markers']['set'](_0xfe074['name'],this['_changeRangeOwnerDocument'](_0xfe074['getRange']()['clone'](),_0x2f83d6));const _0x458e78=new _0xf38d26({'ignoreElementEnd':!0x0,'startPosition':_0x574b1f['createPositionAt'](_0x2f83d6,0x0)}),_0x4e2110=new Set(),_0x4c33d1=new Map();for(const {item:_0x4bd4bf}of _0x458e78){if(!_0x4bd4bf['is']('$textProxy'))continue;const _0x4b285a=_0x4bd4bf['parent'];if(_0x4b285a&&_0x4b285a['is']('element')){const _0x5a3bf7=this['_upsertDataId'](_0x4b285a,()=>_0x4d6b09['_nextDataId'](_0x4e2110));_0x4e2110['add'](_0x5a3bf7);for(const _0x1d4c55 of _0x4b285a['getChildren']())_0x1d4c55['is']('element')&&_0x4e2110['add'](this['_upsertDataId'](_0x1d4c55,()=>_0x4d6b09['_nextDataId'](_0x4e2110)));let _0x444e1a=_0x4b285a;for(;_0x444e1a['parent']&&!_0x444e1a['parent']['is']('documentFragment');)_0x444e1a=_0x444e1a['parent'],_0x444e1a['hasAttribute'](_0x33b43a)&&_0x444e1a['_removeAttribute'](_0x33b43a);_0x4c33d1['set'](_0x5a3bf7,{'path':_0x4b285a['getPath'](),'getContent':this['_createGetContentUsingDataIdFn'](_0x444e1a['_clone'](!0x0),_0x5a3bf7,_0xd408eb['data'])}),_0x458e78['jumpTo'](_0x574b1f['createPositionAfter'](_0x4b285a));}}return{'content':_0xd408eb['data']['processor']['toData'](_0xd408eb['data']['toView'](_0x2f83d6)),'version':_0xd408eb['model']['document']['version'],'elements':_0x4c33d1};}['diffContent'](_0x1471e2,_0x2fd115,_0x3393d5=!0x1){const _0x3771e8=[],_0x4ade1f=Ys(this['context']),_0x417b82=_0x4ade1f['data']['parse'](_0x2fd115,'$documentFragment'),_0x2fe868=_0x4ade1f['data']['parse'](_0x1471e2,'$documentFragment'),_0x5a86de=_0x4ade1f['model']['createPositionAt'](_0x2fe868,0x0);if(this['_haveSingleTopLevelElement'](_0x417b82)){if(!this['_hasSameTopLevelElement'](_0x2fe868,_0x417b82))return _0x3771e8;}else{const _0x48d42f=_0x4ade1f['model']['schema'];if(!this['_haveOnlyInlineContent'](_0x2fe868,_0x48d42f)||!this['_haveOnlyInlineContent'](_0x417b82,_0x48d42f))return _0x3771e8;}const _0x2edf49=this['context']['plugins']['get']('DocumentCompare')['getDiff'](_0x1471e2,_0x2fd115,{'anchor':_0x5a86de,'markDeletions':!0x0})['getOperations']()['filter'](_0x30ed8a=>'insert'===_0x30ed8a['type']||'marker'===_0x30ed8a['type']&&_0x30ed8a['name']['startsWith']('$markedRemove')),_0x533049=this['_groupAdjacentOperations'](_0x2edf49),_0x34c476=[];if(_0x3393d5){if(_0x533049['length']){const _0x528f2a=_0x533049[0x0]['operations'][0x0],_0xa12107='insert'===_0x528f2a['type']?_0x528f2a['position']:_0x528f2a['newRange']['start'],_0x1be2c9=this['_getPositionLimitingRange'](_0xa12107,_0x4ade1f,'inside'),_0x2b8b35=_0x1be2c9?_0x417b82['getChild'](0x0)['getChildren']():_0x417b82['getChildren'](),_0x34bba7=_0x1be2c9||_0x4ade1f['model']['createRangeIn'](_0x2fe868),_0x11c44a=[new _0x2b7839('$markedRemove:synthetic'+at(),null,_0x34bba7,_0x4ade1f['model']['document']['model']['markers'],!0x0,_0x4ade1f['model']['document']['version']+0x1),new _0x557237(_0x34bba7['end'],_0x2b8b35,_0x4ade1f['model']['document']['version']+0x2)];_0x34c476['push']({'operations':_0x11c44a,'operationsIsolated':_0x11c44a,'groupOffset':0x0});}}else _0x34c476['push'](..._0x533049);let _0x103ea1=0x0;return _0x4ade1f['model']['change'](_0x476f8d=>{for(let _0x31b9d7=0x0;_0x31b9d7<_0x34c476['length'];_0x31b9d7++){const _0x588174=_0x34c476[_0x31b9d7],_0x3c4a4a=_0x476f8d['createDocumentFragment']();for(const _0x1d454e of _0x2fe868['getChildren']())_0x476f8d['append'](_0x1d454e['_clone'](!0x0),_0x3c4a4a);for(const _0x2961d2 of _0x588174['operationsIsolated'])if('insert'===_0x2961d2['type']){const _0x3fc4ea=_0x2961d2;_0x3fc4ea['baseVersion']=null,_0x3fc4ea['isDocumentOperation']=!0x1,this['_changeOperationOwnerDocument'](_0x3fc4ea,_0x3c4a4a),_0x476f8d['batch']['addOperation'](_0x2961d2),_0x4ade1f['model']['applyOperation'](_0x2961d2);const _0x74a96a='suggestion:insertion:id:authorId:'+_0x103ea1++,_0x17e828=_0x4ade1f['model']['createRange'](_0x3fc4ea['position'],_0x3fc4ea['position']['getShiftedBy'](_0x3fc4ea['howMany']));_0x3c4a4a['markers']['set'](_0x74a96a,_0x17e828);}else{if('marker'===_0x2961d2['type']&&_0x2961d2['name']['startsWith']('$markedRemove')){const _0xd096bb=_0x2961d2,_0x35886d='suggestion:deletion:id:authorId:'+_0x103ea1++;this['_changeOperationOwnerDocument'](_0xd096bb,_0x3c4a4a),_0x3c4a4a['markers']['set'](_0x35886d,_0xd096bb['newRange']);}}if(_0x3393d5)_0x3771e8['push']({..._0x588174,'context':this['_createGetContentFn'](_0x2fe868,_0x4ade1f['data']),'content':this['_createGetContentFn'](_0x2fe868,_0x4ade1f['data'])});else{const _0xfce8d8=this['_getChangeContext'](this['_changePositionOwnerDocument'](this['_getOperationStart'](_0x588174['operationsIsolated'][0x0]),_0x3c4a4a),this['_changePositionOwnerDocument'](this['_getOperationEnd'](_0x588174['operationsIsolated'][_0x588174['operationsIsolated']['length']-0x1]),_0x3c4a4a));_0x3c4a4a['markers']['set'](Eo+'suggestion-context',new _0x40a8b3(_0xfce8d8['start'],_0xfce8d8['end'])),_0x3771e8['push']({..._0x588174,'context':this['_createGetContextFn'](_0x3c4a4a,_0x4ade1f['data'],{'ellipsisBefore':_0xfce8d8['hasContentBefore'],'ellipsisAfter':_0xfce8d8['hasContentAfter']}),'content':this['_createGetContentFn'](_0x3c4a4a,_0x4ade1f['data'])});}}}),_0x3771e8;}['markChangePositionInEditorContent'](_0x5f34b8,_0xc05817){if(!_0x5f34b8['length'])return;const _0x566983=_0x5f34b8[0x0]['parent']['id'],_0x45c225=_0xc05817['elements']['get'](_0x566983);if(!_0x45c225)return void console['warn']('No\x20element\x20found\x20for\x20ID:\x20'+_0x566983);const _0x3b8375=_0x45c225['path'],_0x2bf909=Ys(this['context']),_0x4b5da6=_0x2bf909['model']['document']['history']['getOperations'](_0xc05817['version']),_0x420034=[];for(const _0xd566e8 of _0x5f34b8){const _0x320cef=_0xd566e8['operationsIsolated']['map'](_0xebf908=>this['_translateOperationToEditorContent'](_0xebf908,_0x3b8375,_0x2bf909['model']['document']['getRoots']()[0x0]));if(!_0x320cef||!_0x320cef['length'])continue;const _0x25f571=_0x320cef['every'](_0x5b3f50=>'marker'===_0x5b3f50['type']&&_0x5b3f50['name']['startsWith']('$markedRemove')),_0x21e7ec={'document':_0x2bf909['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1},_0x41f5ba=_0x1b1979(_0x320cef,_0x4b5da6,_0x21e7ec)['operationsA'];for(const _0x4a88d3 of _0x41f5ba)if('insert'===_0x4a88d3['type']){const _0x54f6f2=_0x4a88d3,_0x59683d=_0x54f6f2['nodes'];_0x2bf909['model']['change'](_0x3fe03f=>{const _0x9e0af2=_0x3fe03f['createDocumentFragment']();for(const _0xc2f4b of _0x59683d)_0x3fe03f['append'](_0xc2f4b['_clone'](!0x0),_0x9e0af2);_0x420034['push']({'start':_0x54f6f2['position'],'end':_0x54f6f2['position'],'type':'insert','groupId':_0xd566e8['id'],'content':{'asString':this['_createGetContentFn'](_0x9e0af2,_0x2bf909['data'])(),'asFragment':_0x9e0af2}});});}else{if('marker'===_0x4a88d3['type']&&_0x4a88d3['name']['startsWith']('$markedRemove')){const _0x28c0a2=_0x4a88d3;let _0x25f6bc='remove-text';if(_0x25f571){const _0x5822cf=this['_findAdjacentContextDistance'](_0x28c0a2['newRange']['start'],'backward',_0x2bf909['model']['schema']),_0x470a3d=this['_findAdjacentContextDistance'](_0x28c0a2['newRange']['end'],'forward',_0x2bf909['model']['schema']);if(_0x5822cf||_0x470a3d){const _0x544efe=_0x28c0a2['newRange']['start']['getShiftedBy'](-_0x5822cf),_0x21b7ba=_0x28c0a2['newRange']['end']['getShiftedBy'](_0x470a3d);_0x420034['push']({'start':_0x544efe,'end':_0x21b7ba,'groupId':_0xd566e8['id'],'type':'remove-context'});}else _0x25f6bc='remove-only';}_0x420034['push']({'start':_0x28c0a2['newRange']['start'],'end':_0x28c0a2['newRange']['end'],'groupId':_0xd566e8['id'],'type':_0x25f6bc});}}}this['_insertMarkers'](_0x420034);}['clearAllMarkers'](){const _0x72a233=Ys(this['context']);_0x72a233['model']['change'](_0x11e4c5=>{for(const _0x2e3ccd of this['_markers']['keys']())_0x72a233['model']['markers']['get'](_0x2e3ccd)&&_0x11e4c5['removeMarker'](_0x2e3ccd);}),this['_markers']['clear'](),this['_activeMarkers']['clear']();}['switchToReadOnly'](){Ys(this['context'])['enableReadOnlyMode']('ai-review');}['switchToEdit'](){Ys(this['context'])['disableReadOnlyMode']('ai-review');}['applyChange'](_0x56ff34){const _0x259e68=Ys(this['context']),_0x548390=_0x259e68['model'],_0x57abe5=_0x56ff34['map'](_0x5668ce=>this['_getMarkersDataForGroup'](_0x5668ce))['flat']();_0x548390['change'](_0x5bd6a3=>{for(const _0x5579de of _0x57abe5){const _0x1a944c=_0x259e68['model']['markers']['get'](_0x5579de['id']);if(_0x1a944c){if('insert'===_0x5579de['type']){if(!_0x5579de['content'])continue;_0x548390['insertContent'](_0x5579de['content']['asFragment']||null,_0x1a944c['getRange']()['start']);}else'remove-text'!==_0x5579de['type']&&'remove-only'!==_0x5579de['type']||_0x548390['deleteContent'](_0x548390['createSelection'](_0x1a944c['getRange']()));_0x5bd6a3['removeMarker'](_0x5579de['id']),this['_markers']['delete'](_0x5579de['id']);}}});}['rejectChange'](_0x530a32){const _0x259c91=Ys(this['context']),_0x379af0=this['_getMarkersDataForGroup'](_0x530a32);_0x259c91['model']['change'](_0x4ac122=>{for(const _0x51a9ea of _0x379af0)_0x4ac122['removeMarker'](_0x51a9ea['id']),this['_markers']['delete'](_0x51a9ea['id']);});}['getEditor'](){return Ys(this['context']);}['getMarkerElementForChange'](_0xc8ed04){const _0x4ecc77=Array['from'](this['_markers']['values']())['filter'](_0x2f3cc6=>_0x2f3cc6['groupId']===_0xc8ed04);if(!_0x4ecc77['length'])return null;const _0x2abb8f=0x1===_0x4ecc77['length']?_0x4ecc77[0x0]:this['_sortMarkers'](_0x4ecc77)[0x0],_0x8b4c3b=Ys(this['context'])['model']['markers']['get'](_0x2abb8f['id']);if(!_0x8b4c3b)return null;return{'modelRange':_0x8b4c3b['getRange'](),'getElement':()=>this['_findMarkerElementById'](_0x2abb8f['id'])};}['getContentElementForChange'](_0x706e33){const _0x154ee0=Array['from'](this['_markers']['values']())['filter'](_0x1bd1c8=>_0x1bd1c8['groupId']===_0x706e33);if(!_0x154ee0['length'])return null;const _0x9c7cf2=0x1===_0x154ee0['length']?_0x154ee0[0x0]:this['_sortMarkers'](_0x154ee0)[0x0],_0xc98fe5=Ys(this['context']),_0x2c87bb=_0xc98fe5['model']['markers']['get'](_0x9c7cf2['id']);if(!_0x2c87bb)return null;const _0x1592c5=_0x2c87bb['getRange'](),_0x23193c=_0xc98fe5['editing']['view']['getDomRoot']();if(!_0x23193c||!_0x1592c5)return null;let _0x536e70=_0x1592c5['start']['parent'];for(;_0x536e70['parent']&&'$root'!==_0x536e70['parent']['name'];)_0x536e70=_0x536e70['parent'];if(!_0x536e70||!_0x536e70['name'])return null;const _0x4f0e17=_0x23193c['querySelector']('[data-marker-id=\x22'+_0x9c7cf2['id']+'\x22]');if(!_0x4f0e17)return null;let _0x2fc169=null;_0xc98fe5['model']['change'](_0x54d3b5=>{_0x2fc169=_0x54d3b5['createDocumentFragment'](),_0x54d3b5['append'](_0x536e70['_clone'](!0x0),_0x2fc169);});const _0xa0cbb6=_0xc98fe5['data']['toView'](_0x2fc169)['getChild'](0x0);return _0x4f0e17['closest'](_0xa0cbb6['name']);}['reactivateMarkers'](_0x20f8d1){const _0x11d4b4=this['_getMarkersDataForGroup'](_0x20f8d1);if(!_0x11d4b4['length'])return;const _0x5d075c=Array['from'](this['_activeMarkers'])['sort'](),_0x5cdcfe=Array['from'](new Set(_0x11d4b4['map'](_0x55d457=>_0x55d457['id'])))['sort']();_0x5d075c['join']('|')!==_0x5cdcfe['join']('|')&&(this['setAllMarkersAsInactive'](),this['setMarkersInElementAsActive'](_0x20f8d1));}['setMarkersInElementAsActive'](_0x5ee4d4){const _0x22780d=this['_getMarkersDataForGroup'](_0x5ee4d4);if(!_0x22780d['length'])return;const _0x18bea9=Ys(this['context']),_0xdf3acc=new Set(_0x22780d['map'](_0x7c6487=>_0x7c6487['id'])),_0x3784de=Array['from'](_0xdf3acc['values']())['map'](_0xcbc1f5=>_0x18bea9['model']['markers']['get'](_0xcbc1f5))['filter'](_0x16c1db=>!!_0x16c1db);_0xdf3acc['forEach'](_0x1e1320=>{this['_activeMarkers']['add'](_0x1e1320);}),_0x18bea9['model']['change'](()=>{_0x3784de['forEach'](_0x447514=>{_0x18bea9['editing']['reconvertMarker'](_0x447514);});});}['setAllMarkersAsInactive'](){const _0x1046bf=Array['from'](this['_activeMarkers']);if(!_0x1046bf['length'])return;this['_activeMarkers']['clear']();const _0x734bc6=Ys(this['context']),_0x57c995=_0x1046bf['map'](_0x1b2f3b=>_0x734bc6['model']['markers']['get'](_0x1b2f3b))['filter'](_0x48d2ca=>!!_0x48d2ca);_0x734bc6['model']['change'](()=>{_0x57c995['forEach'](_0x111476=>{_0x734bc6['editing']['reconvertMarker'](_0x111476);});});}['_getPositionLimitingRange'](_0x2fd1c9,_0x452ea7,_0x4b15f6='outside'){if(!_0x2fd1c9)return null;let _0x2b6909=_0x2fd1c9['parent'];for(;_0x2b6909&&_0x2b6909['parent']&&'$root'!==_0x2b6909['parent']['name']&&!_0x452ea7['model']['schema']['isLimit'](_0x2b6909)&&!_0x452ea7['model']['schema']['isBlock'](_0x2b6909);)_0x2b6909=_0x2b6909['parent'];if(!_0x2b6909||!_0x2b6909['name']||'$root'===_0x2b6909['name'])return null;let _0x53d242=null;return _0x452ea7['model']['change'](_0x476542=>{_0x53d242='inside'===_0x4b15f6?_0x476542['createRangeIn'](_0x2b6909):_0x476542['createRangeOn'](_0x2b6909);}),_0x53d242;}['_validateMarkers'](_0x47509f,_0x10744c){const _0x25f8b3=Array['from'](this['_markers']['keys']()),_0x161f86=new Map();for(const _0x3ed8b1 of _0x25f8b3){const _0x139da3=_0x47509f['model']['markers']['get'](_0x3ed8b1);if(!_0x139da3)continue;const _0x2b611=_0x139da3['getStart']()['path'][0x0];_0x161f86['has'](_0x2b611)||_0x161f86['set'](_0x2b611,[]),_0x161f86['get'](_0x2b611)['push'](_0x139da3);}const _0xd8d65d=new Set();for(const _0x4d2cd2 of _0x47509f['model']['document']['differ']['getChanges']()){let _0x4dda44=-0x1,_0x11f302=null;if('insert'===_0x4d2cd2['type'])_0x11f302=new _0x40a8b3(_0x4d2cd2['position'],_0x4d2cd2['position']['getShiftedBy'](_0x4d2cd2['length'])),_0x4dda44=_0x4d2cd2['position']['path'][0x0];else{if('remove'!==_0x4d2cd2['type'])continue;_0x11f302=new _0x40a8b3(_0x4d2cd2['position']),_0x4dda44=_0x4d2cd2['position']['path'][0x0];}const _0x5a6bc9=_0x161f86['get'](_0x4dda44)||[];if(_0x5a6bc9['length']){for(const _0x10522e of _0x5a6bc9)if(_0x11f302['root']['rootName']===_0x10522e['getRange']()['root']['rootName']&&('insert'!==_0x4d2cd2['type']||!_0x11f302['containsRange'](_0x10522e['getRange']()))&&(_0x11f302['isIntersecting'](_0x10522e['getRange']())||_0x11f302['start']['isTouching'](_0x10522e['getRange']()['end'])||_0x11f302['end']['isTouching'](_0x10522e['getRange']()['start']))){const _0x38fbf5=this['_parseMarkerName'](_0x10522e['name']);Array['from'](this['_markers']['values']())['filter'](_0x3ff188=>_0x3ff188['groupId']===_0x38fbf5['groupId'])['forEach'](_0x150b95=>_0xd8d65d['add'](_0x150b95['id']));}}}if(_0xd8d65d['size']){for(const _0x183540 of _0xd8d65d)_0x10744c['removeMarker'](_0x183540);return!0x0;}return!0x1;}['_handleMarkerChanges'](_0xbc16e){for(const {name:_0x59deef,data:_0x8d8803}of _0xbc16e['model']['document']['differ']['getChangedMarkers']()){if(!_0x59deef['startsWith'](Eo))continue;const _0x2f690b=_0x8d8803['oldRange'],_0x47c4ba=_0x8d8803['newRange'],_0x25b510=_0x2f690b&&'$graveyard'===_0x2f690b['root']['rootName'],_0x586b33=_0x47c4ba&&'$graveyard'===_0x47c4ba['root']['rootName'];if(_0x25b510&&_0x586b33)continue;const _0x409ca0=this['_parseMarkerName'](_0x59deef);this['_markers']['get'](_0x59deef)&&(_0x586b33||!_0x47c4ba?this['_eventEmitter']['fire']('changeMarkerRemoved',{'markerId':_0x59deef,'changeId':_0x409ca0['groupId']}):_0x25b510&&_0x47c4ba&&this['_eventEmitter']['fire']('changeMarkerRestored',{'markerId':_0x59deef,'changeId':_0x409ca0['groupId']}));}}['_parseMarkerName'](_0x237ce2){const _0x5a74c3=_0x237ce2['split'](':'),_0xf7a98d=(_0x5a74c3[0x1]||'')['split']('_');return{'prefix':_0x5a74c3[0x0],'groupId':_0xf7a98d[0x0],'suffix':_0xf7a98d[0x1]};}['_translateOperationToEditorContent'](_0x4e7f76,_0x1e747b,_0x5874a9){if('insert'===_0x4e7f76['type']){const _0x716aff=_0x4e7f76;return new _0x557237(this['_changePosition'](_0x1e747b['concat'](_0x716aff['position']['offset']),_0x5874a9),_0x716aff['nodes'],_0x716aff['baseVersion']);}if('marker'===_0x4e7f76['type']&&_0x4e7f76['name']['startsWith']('$markedRemove')){const _0x2f3c12=_0x4e7f76;return new _0x2b7839(_0x2f3c12['name'],_0x2f3c12['oldRange'],this['_changeRange'](_0x2f3c12['newRange'],_0x1e747b['concat'](_0x2f3c12['newRange']['start']['offset']),_0x1e747b['concat'](_0x2f3c12['newRange']['end']['offset']),_0x5874a9),_0x2f3c12['_markers'],_0x2f3c12['affectsData'],_0x2f3c12['baseVersion']);}return _0x4e7f76;}['_groupAdjacentOperations'](_0x27c1a3){if(!_0x27c1a3['length'])return[];const _0xc37d74=[];let _0x258c93=0x0,_0x4d180f=0x0,_0x20af24=[];for(let _0x48a45a=0x0;_0x48a45a<=_0x27c1a3['length'];_0x48a45a++){const _0x252894=_0x27c1a3[_0x48a45a],_0x3cef5f=_0x27c1a3[_0x48a45a-0x1];!_0x252894||_0x3cef5f&&!this['_getOperationEnd'](_0x3cef5f)['isTouching'](this['_getOperationStart'](_0x252894))?(_0xc37d74['push']({'operations':_0x20af24,'operationsIsolated':_0x20af24['map'](_0x18d434=>this['_shiftOperation'](_0x18d434['clone'](),-_0x4d180f)),'groupOffset':_0x258c93}),_0x20af24=_0x252894?[_0x252894]:[],_0x4d180f+=_0x258c93,_0x258c93=0x0):_0x20af24['push'](_0x252894),_0x252894&&'insert'===_0x252894['type']&&(_0x258c93+=_0x252894['howMany']);}return _0xc37d74;}['_findAdjacentContextDistance'](_0x158f0a,_0x3b05c6,_0xdfb8be,_0x3c8067=0x1){const _0x4c5efb=new _0xf38d26({'startPosition':_0x158f0a,'direction':_0x3b05c6});let _0x3d37f5=0x0;for(let _0xdd5143=0x0;_0xdd5143<_0x3c8067;_0xdd5143++){let _0x529971=0x0,_0x29ecfd=!0x1,_0x4fcd47='forward'===_0x3b05c6?/^\W*\w+/:/\w+\W*$/;for(const {item:_0x191dd3}of _0x4c5efb)if(_0x191dd3['is']('$textProxy')){const _0x4a74b3=_0x4fcd47['exec'](_0x191dd3['data']);if(_0x4a74b3&&_0x4a74b3['length']){if(_0x529971+='forward'===_0x3b05c6?_0x4a74b3['index']+_0x4a74b3[0x0]['length']:_0x191dd3['data']['length']-_0x4a74b3['index'],_0x4a74b3[0x0]['length']!==_0x191dd3['data']['length'])break;_0x29ecfd=!0x0,_0x4fcd47='forward'===_0x3b05c6?/^\w+/:/\w+$/;}else{if(_0x29ecfd)break;_0x529971+=_0x191dd3['offsetSize'];}}else{if(_0x191dd3['is']('element')){_0xdfb8be['isInline'](_0x191dd3)&&!_0x29ecfd&&(_0x529971+=0x1);break;}}_0x3d37f5+=_0x529971,_0x4c5efb['jumpTo'](_0x158f0a['getShiftedBy']('forward'===_0x3b05c6?_0x3d37f5:-_0x3d37f5));}return _0x3d37f5;}['_getChangeContext'](_0x488373,_0x489612){const _0x2be1be=Ys(this['context'])['model']['schema'],_0x19b5de=this['_findAdjacentContextDistance'](_0x488373,'backward',_0x2be1be,0x6),_0x2fed10=this['_findAdjacentContextDistance'](_0x489612,'forward',_0x2be1be,0x6),_0x5d7527=_0x488373['getShiftedBy'](-_0x19b5de),_0x5bc226=_0x489612['getShiftedBy'](_0x2fed10);return{'start':_0x5d7527,'end':_0x5bc226,'hasContentBefore':!_0x5d7527['isAtStart'],'hasContentAfter':!_0x5bc226['isAtEnd']};}['_insertMarkers'](_0x4763b3){const _0x48f5c7=this['context']['plugins']['get']('AIEditing'),_0x3ec980=new Set();Ys(this['context'])['model']['change'](_0x455725=>{for(const _0x2236f4 of _0x4763b3){const _0x1cc84c=''+Eo+_0x2236f4['type']+':'+_0x2236f4['groupId']+'_'+_0x48f5c7['_nextDataId'](_0x3ec980);this['_markers']['set'](_0x1cc84c,{'id':_0x1cc84c,'groupId':_0x2236f4['groupId'],'type':_0x2236f4['type'],'content':_0x2236f4['content']}),_0x455725['addMarker'](_0x1cc84c,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x455725['createRange'](_0x2236f4['start'],_0x2236f4['end'])});}});}['_createGetContextFn'](_0x21f00e,_0x58caa1,_0x1e3287){let _0x2c6d57='';return()=>{if(!_0x2c6d57){const _0x133f3c=_0x58caa1['toView'](_0x21f00e,{'showSuggestionHighlights':!0x0});let _0x1a2007=_0x133f3c['getChild'](0x0);if(_0x1a2007['is']('containerElement')||(_0x1a2007=_0x133f3c),!_0x1a2007)return'';let _0x309b80=!0x1;const _0x1ed451=[];for(const _0x54897a of _0x1a2007['getChildren']())_0x54897a['is']('element','span')&&_0x54897a['hasClass']('ck-ai_review-marker_context-end')&&(_0x309b80=!0x1),_0x309b80&&_0x1ed451['push'](_0x54897a),_0x54897a['is']('element','span')&&_0x54897a['hasClass']('ck-ai_review-marker_context-start')&&(_0x309b80=!0x0);_0x1a2007['_removeChildren'](0x0,_0x1a2007['childCount']),_0x1e3287?.['ellipsisBefore']&&_0x1a2007['_appendChild']('…'),_0x1a2007['_appendChild'](_0x1ed451),_0x1e3287?.['ellipsisAfter']&&_0x1a2007['_appendChild']('…');const _0x56fd2d=_0x58caa1['htmlProcessor']['domConverter']['viewToDom'](_0x133f3c),_0x579cb5=_0x58caa1['htmlProcessor']['htmlWriter']['getHtml'](_0x56fd2d);_0x2c6d57=_0x579cb5;}return _0x2c6d57;};}['_createGetContentFn'](_0x6a9312,_0x395214){let _0x4fa099='';return()=>(_0x4fa099||(_0x4fa099=_0x395214['stringify'](_0x6a9312,{'showSuggestionHighlights':!0x0})),_0x4fa099);}['_createGetContentUsingDataIdFn'](_0x35d438,_0x6bed0f,_0x303d11){let _0x5d0edf='';return()=>{if(!_0x5d0edf){const _0x43790b=_0x303d11['toView'](new _0x270bfa(_0x35d438)),_0x3d1cda=_0x303d11['htmlProcessor']['domConverter']['viewToDom'](_0x43790b)['querySelector']('[data-id=\x22'+_0x6bed0f+'\x22]');_0x5d0edf=_0x3d1cda?.['outerHTML']||'';}return _0x5d0edf;};}['_findMarkerElement'](_0x24f878,_0x5a47b4=0x5){let _0x4b84c3=_0x24f878,_0x260cae=null;for(let _0x22d0cd=0x0;_0x22d0cd<_0x5a47b4&&_0x4b84c3;_0x22d0cd++){if(!_0x4b84c3['className']){_0x4b84c3=_0x4b84c3['parentElement'];continue;}if(!(''+_0x4b84c3['className'])['includes']('ck-ai_review-marker_')){_0x4b84c3=_0x4b84c3['parentElement'];continue;}if(!_0x4b84c3['getAttribute']('data-marker-id'))break;_0x260cae=_0x4b84c3;break;}return _0x260cae;}['_findMarkerElementById'](_0x2a01d4){const _0x559bb4=Ys(this['context']),_0x5e5188=_0x559bb4['model']['markers']['get'](_0x2a01d4);return _0x5e5188?_0x374d0e(_0x559bb4['editing'],_0x5e5188):null;}['_getMarkersDataForGroup'](_0x1e8dd0){return Array['from'](this['_markers']['values']())['filter'](_0x48c98f=>_0x48c98f['groupId']===_0x1e8dd0);}['_getOperationStart'](_0x302b46){return'insert'===_0x302b46['type']?_0x302b46['position']:_0x302b46['newRange']['start'];}['_getOperationEnd'](_0x4da16b,_0xf6a583=!0x1){return'insert'===_0x4da16b['type']?_0xf6a583?_0x4da16b['position']:_0x4da16b['position']['getShiftedBy'](_0x4da16b['howMany']):_0x4da16b['newRange']['end'];}['_shiftOperation'](_0x553699,_0x3ee4ec){return'insert'===_0x553699['type']?_0x553699['position']=_0x553699['position']['getShiftedBy'](_0x3ee4ec):'marker'===_0x553699['type']&&_0x553699['newRange']&&(_0x553699['newRange']=new _0x40a8b3(_0x553699['newRange']['start']['getShiftedBy'](_0x3ee4ec),_0x553699['newRange']['end']['getShiftedBy'](_0x3ee4ec))),_0x553699;}['_changeOperationOwnerDocument'](_0x2094b5,_0x311f6d){'insert'===_0x2094b5['type']?_0x2094b5['position']=this['_changePositionOwnerDocument'](_0x2094b5['position'],_0x311f6d):'marker'===_0x2094b5['type']&&_0x2094b5['newRange']&&(_0x2094b5['newRange']=this['_changeRangeOwnerDocument'](_0x2094b5['newRange'],_0x311f6d));}['_changePositionOwnerDocument'](_0x14e3b3,_0x2fca86){return new _0xf89124(_0x2fca86,_0x14e3b3['path']);}['_changeRangeOwnerDocument'](_0x584059,_0x16cb9c){return new _0x40a8b3(this['_changePositionOwnerDocument'](_0x584059['start'],_0x16cb9c),this['_changePositionOwnerDocument'](_0x584059['end'],_0x16cb9c));}['_changePosition'](_0xa3d3e8,_0x22ba97){return new _0xf89124(_0x22ba97,[..._0xa3d3e8]);}['_changeRange'](_0x48e9e9,_0x2490a0,_0x55eb61,_0x37cf51){return new _0x40a8b3(this['_changePosition'](_0x2490a0,_0x37cf51),this['_changePosition'](_0x55eb61,_0x37cf51));}['_sortMarkers'](_0x22bbb1){const _0xea3a4f=_0x11ea37=>{switch(_0x11ea37){case'insert':return 0x0;case'remove-context':return 0x1;case'remove-only':return 0x2;case'remove-text':return 0x3;}};return _0x22bbb1['sort']((_0xad8c7d,_0x820f5f)=>_0xea3a4f(_0xad8c7d['type'])-_0xea3a4f(_0x820f5f['type']));}['_hasSameTopLevelElement'](_0x58219d,_0x4c525a){const _0x3bc69e=_0x58219d['getChild'](0x0),_0x57cba0=_0x4c525a['getChild'](0x0);return!(!_0x3bc69e||!_0x57cba0)&&((!_0x3bc69e['is']('element')||!_0x57cba0['is']('element')||_0x3bc69e['name']===_0x57cba0['name'])&&!(_0x3bc69e['is']('element')&&!_0x57cba0['is']('element')||!_0x3bc69e['is']('element')&&_0x57cba0['is']('element')));}['_haveSingleTopLevelElement'](_0x1b15c2){return 0x1===_0x1b15c2['childCount'];}['_haveOnlyInlineContent'](_0x50d636,_0x1a36f9){for(const _0x4a9087 of _0x50d636['getChildren']())if(_0x4a9087['is']('element')&&!_0x1a36f9['isInline'](_0x4a9087))return!0x1;return!0x0;}['_upsertDataId'](_0x56eb89,_0xc23fb9){let _0x9e036e=_0x56eb89['getAttribute'](_0x33b43a);return _0x9e036e||(_0x9e036e=_0xc23fb9(),_0x56eb89['_setAttribute'](_0x33b43a,_0x9e036e)),_0x9e036e;}}class To extends Et(){['id'];['contentNew'];['contentInitial'];['documentVersion'];constructor({id:_0x2da611,contentNew:_0x395999,contentInitial:_0x5eb964,documentVersion:_0x373469}){super(),this['id']=_0x2da611,this['contentNew']=_0x395999,this['contentInitial']=_0x5eb964,this['documentVersion']=_0x373469;}}class mo extends ht(){['id'];['parent'];['_data'];['_editorOperations']=[];constructor(_0xbe1dee,_0x14f2ca,_0x5f406e){super(),this['id']=_0xbe1dee,this['parent']=_0x5f406e,this['_data']=_0x14f2ca,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 Co extends ht(){['id']=at();['callId'];['_results']=new Map();['_changes']=[];['_sourceCheck'];['_documentData'];['_aiConnector'];['_reviewParams'];['_reviewArgs'];['_activeRequest']=null;['_currentError'];['_wasAborted']=!0x1;constructor(_0x765aa9,_0x45702a,_0x2ee624,_0x5c1613,_0x34ae1b){super(),this['_sourceCheck']=_0x45702a,this['_documentData']=_0x765aa9,this['_aiConnector']=_0x2ee624,this['_reviewParams']=_0x5c1613,this['_reviewArgs']=_0x34ae1b,this['on']('change:status',(_0x49a9ce,_0x1d8a4d,_0x5db355)=>{'aborted'==_0x5db355&&(this['_wasAborted']=!0x0),this['fire']('reviewCheckRunUpdated',{'status':_0x5db355,'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'](_0x4ce0bb=>'pending'===_0x4ce0bb['status']);}get['currentError'](){return this['_currentError'];}['updateDocumentData'](_0x37ab1c){this['_documentData']=_0x37ab1c;}async['start'](){this['status']='loading',this['_currentError']=void 0x0;try{this['_activeRequest']=this['_createApiRequest']();const _0x56f1ec=await this['_activeRequest']['getStream']();this['status']='data';for await(const _0x215ee8 of _0x56f1ec)'unmodified'!==_0x215ee8['data']['operation']&&('error'!==_0x215ee8['data']['operation']?'review-metadata'!==_0x215ee8['event']?this['_addReviewCheckResult'](_0x215ee8['data']['dataId'],_0x215ee8['data']['textDelta']):this['callId']=_0x215ee8['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(_0x2fe0c3){this['_currentError']=_0x2fe0c3,_0x2fe0c3 instanceof Error&&_0x2fe0c3['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'](_0x4858d8,_0x1e4a8e){const _0x5ab115=this['_results']['get'](_0x4858d8);if(!_0x5ab115)return;if(0x0===_0x1e4a8e['length'])return;const _0x42dc5e=[];_0x1e4a8e['forEach']((_0x10b889,_0x50b9e5)=>{const _0x5dc430=new mo(_0x5ab115['id']+'-'+_0x50b9e5,_0x10b889,_0x5ab115);_0x5dc430['on']('change:status',()=>{this['fire']('reviewCheckResultChangeStatusUpdated',{'change':_0x5dc430,'status':_0x5dc430['status']});}),_0x5dc430['on']('change:isActivated',()=>{_0x5dc430['isActivated']?this['fire']('reviewCheckResultActivated',{'change':_0x5dc430}):this['fire']('reviewCheckResultDeactivated',{'change':_0x5dc430});}),this['_changes']['push'](_0x5dc430),_0x42dc5e['push'](_0x5dc430);}),this['fire']('reviewCheckResultReady',{'changes':_0x42dc5e,'result':_0x5ab115,'source':this});}['abort'](){this['_activeRequest']&&(this['_activeRequest']['abortController']['abort'](),this['_activeRequest']=null,this['status']='aborted');}['isChangeActive'](_0x21e691){const _0x421a87=this['_changes']['find'](_0xec2fde=>_0xec2fde['id']===_0x21e691);return!(!_0x421a87||'pending'!==_0x421a87['status']);}['isAnyChangeActivated'](){return this['_changes']['some'](_0x2ae65a=>!0x0===_0x2ae65a['isActivated']);}['getActiveChanges'](){return this['_changes']['filter'](_0x4dcccd=>'pending'===_0x4dcccd['status']);}['getChangeById'](_0x1ea1c4){return this['_changes']['find'](_0x4a8706=>_0x4a8706['id']===_0x1ea1c4);}['markAllChangesAsAccepted'](){for(const _0x99217d of this['_changes'])'pending'===_0x99217d['status']&&(_0x99217d['status']='accepted');this['_checkIfFinished']();}['markChangeAsAccepted'](_0x49495b){const _0x350ee7=this['_changes']['find'](_0x42b167=>_0x42b167['id']===_0x49495b);_0x350ee7&&'pending'===_0x350ee7['status']&&(_0x350ee7['status']='accepted'),this['_checkIfFinished']();}['markChangeAsRejected'](_0x4d284e){const _0x287745=this['_changes']['find'](_0x1931eb=>_0x1931eb['id']===_0x4d284e);_0x287745&&'pending'===_0x287745['status']&&(_0x287745['status']='rejected'),this['_checkIfFinished']();}['markChangeAsOutdated'](_0x2d283a){const _0x4821ef=this['_changes']['find'](_0x54ffde=>_0x54ffde['id']===_0x2d283a);_0x4821ef&&'pending'===_0x4821ef['status']&&(_0x4821ef['status']='outdated'),this['_checkIfFinished']();}['markChangeAsPending'](_0x550842){const _0x187792=this['_changes']['find'](_0x1a685c=>_0x1a685c['id']===_0x550842);_0x187792&&'outdated'===_0x187792['status']&&(_0x187792['status']='pending'),this['_checkIfFinished']();}['activateChange'](_0x1f57a1){this['_changes']['filter'](_0x481988=>_0x481988['isActivated']&&_0x481988['id']!==_0x1f57a1)['forEach'](_0x1d0c75=>{_0x1d0c75['isActivated']=!0x1;});const _0x4eef14=this['_changes']['find'](_0x226ecb=>_0x226ecb['id']===_0x1f57a1);_0x4eef14&&'pending'===_0x4eef14['status']&&(_0x4eef14['isActivated']=!0x0);}['deactivateChange'](){this['_changes']['filter'](_0x53a0ed=>_0x53a0ed['isActivated'])['forEach'](_0x483ba6=>{_0x483ba6['isActivated']=!0x1;});}['forceReadyState'](){this['status']='ready';}async['sendRating'](_0x11cc07){if('initialized'===this['status']||'loading'===this['status']||'data'===this['status']||this['_wasAborted'])return;if(!this['callId']||0x0===this['_changes']['length'])return;let _0x31c692;if(_0x11cc07){const _0x17c5c0=this['_changes']['find'](_0x14ecac=>_0x14ecac['id']===_0x11cc07);if(_0x17c5c0&&_0x17c5c0['isRated'])return;_0x17c5c0&&(_0x31c692=_0x17c5c0['parent']['id'],_0x17c5c0['isRated']=!0x0);}const _0x151290={'positiveCount':this['_changes']['filter'](_0x1e2448=>'accepted'===_0x1e2448['status'])['length'],'totalCount':this['_changes']['length']};this['_sendRatingRequest'](_0x151290,this['callId'],_0x31c692);}['_addReviewCheckResult'](_0x889b5b,_0x354668){const _0xa6522b=this['_documentData']['elements']['get'](_0x889b5b);if(!_0xa6522b)return;const _0x274a06=_0xa6522b['getContent']();if(_0x274a06===_0x354668)return;const _0x11b243=new To({'id':_0x889b5b,'contentInitial':_0x274a06,'contentNew':_0x354668,'documentVersion':this['_documentData']['version']});this['_results']['set'](_0x11b243['id'],_0x11b243),this['fire']('reviewCheckResultAdded',{'result':_0x11b243,'source':this});}['_checkIfFinished'](){'finished'===this['status']&&(this['_changes']['filter'](_0xb7ab3e=>'pending'===_0xb7ab3e['status'])['length']>0x0&&(this['status']='ready')),'ready'===this['status']&&(0x0===this['_changes']['filter'](_0x165d4a=>'pending'===_0x165d4a['status'])['length']&&(this['status']='finished'));}}class wo extends Co{get['subTitle'](){if(!this['_reviewParams']||0x0===this['_reviewParams']['length'])return'';const _0x124db7=[];if(this['_reviewParams']['length']>0x0&&this['_sourceCheck']['options'])for(let _0x226381=0x0;_0x226381<this['_reviewParams']['length'];_0x226381++){if(!this['_reviewParams'][_0x226381]||!this['_sourceCheck']['options'][_0x226381])continue;const _0x4d4098=this['_sourceCheck']['options'][_0x226381],_0x539325=_0x4d4098['data']?.['find'](_0x1dfe6e=>_0x1dfe6e['id']===this['_reviewParams'][_0x226381]);_0x539325&&_0x124db7['push'](_0x539325['label']);}return _0x124db7['join'](',\x20');}get['reviewName'](){return this['_composeReviewName']();}['_createApiRequest'](){return this['_aiConnector']['callSystemReview']({'reviewName':this['_composeReviewName'](),'content':this['_documentData']['content'],'args':this['_reviewArgs']});}['_sendRatingRequest'](_0x408be5,_0x1b7eb8,_0x3929a4){return this['_aiConnector']['upsertAIReviewRating'](this['reviewName'],_0x1b7eb8,_0x408be5,_0x3929a4);}['_composeReviewName'](){return!this['_reviewParams']||0x0===this['_reviewParams']['length']||this['_sourceCheck']['useArgs']?this['_sourceCheck']['apiId']:[this['_sourceCheck']['apiId'],...this['_reviewParams']]['join']('-');}}class fo extends _0x474324{['_aiConnector'];['_aiReviewCoreUi'];['_aiReviewCoreEditing'];['_aiReviewCheckList'];['_currentReviewCheckRun'];['_changeActivationSource']=null;static get['requires'](){return[hs];}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(_0x5ddf44,_0x50c163)=>{const _0x256b2d=this['_aiReviewCheckList']['getCheckById'](_0x50c163['id']);if(_0x256b2d){this['_onReviewCheckRun'](_0x50c163),this['_aiReviewCoreEditing']['switchToReadOnly'](),this['_currentReviewCheckRun']=this['_createReviewCheckRun'](_0x50c163,_0x256b2d),this['_aiReviewCoreUi']['setCheckResultTitle'](this['_currentReviewCheckRun']['title'],this['_currentReviewCheckRun']['subTitle']),this['_currentReviewCheckRun']['on']('reviewCheckRunUpdated',(_0xa32240,_0x1c9d69)=>{switch(_0x1c9d69['status']){case'data':case'loading':this['_aiReviewCoreUi']['showCheckRunResults'](_0x1c9d69);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'!==_0x1c9d69['status']&&'error-chunk'!==_0x1c9d69['status']&&'error-general'!==_0x1c9d69['status']||this['_currentReviewCheckRun']?.['sendRating']();}),this['_currentReviewCheckRun']['on']('reviewCheckResultAdded',(_0x180439,_0x3916b9)=>{if(!this['_currentReviewCheckRun'])throw new ot('ai-review-mode-no-current-check-run',this);const _0x296473=this['_diffContent'](_0x3916b9['result']['contentInitial'],_0x3916b9['result']['contentNew']);_0x3916b9['source']['addResultChanges'](_0x3916b9['result']['id'],_0x296473);}),this['_currentReviewCheckRun']['on']('reviewCheckResultReady',(_0x55d227,_0x908a6e)=>{for(const _0x1e1adf of _0x908a6e['changes'])this['_aiReviewCoreUi']['showCheckRunResult'](_0x1e1adf);this['_markChangePositionInEditorContent'](_0x908a6e['changes'],_0x908a6e['source']['documentData']);}),this['_currentReviewCheckRun']['on']('reviewCheckResultChangeStatusUpdated',(_0x53b1f6,_0x5a1be8)=>{this['_aiReviewCoreUi']['updateChangeState'](_0x5a1be8['change']['id'],_0x5a1be8['status']);}),this['_currentReviewCheckRun']['on']('reviewCheckResultActivated',(_0x196960,_0x2a1740)=>{this['_onReviewCheckResultActivated'](_0x2a1740);}),this['_currentReviewCheckRun']['on']('reviewCheckResultDeactivated',()=>{this['_onReviewCheckResultDeactivated']();});try{await this['_currentReviewCheckRun']['start']();}catch(_0x260ee0){_0x260ee0 instanceof Error&&_0x260ee0['message']['includes']('ai-request-aborted')||(_0x260ee0 instanceof ot?this['_logError'](_0x260ee0):this['_logError'](new ot('ai-review-mode-check-run-failed',this,void 0x0,_0x260ee0)));}}else this['_logError'](new ot('ai-review-mode-source-check-not-found',this,{'checkId':_0x50c163['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 _0x181cc7=this['_currentReviewCheckRun']['getActiveChanges']();if(!_0x181cc7['length'])return;this['_aiReviewCoreEditing']['applyChange'](_0x181cc7['map'](_0x1da521=>_0x1da521['id']));const _0x154302=this['_currentReviewCheckRun'];_0x154302['markAllChangesAsAccepted'](),_0x154302['sendRating']();}),this['listenTo'](this['_aiReviewCoreUi'],'acceptChange',(_0x24d51b,_0x4c94f7)=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['isChangeActive'](_0x4c94f7['id'])&&(this['_aiReviewCoreEditing']['applyChange']([_0x4c94f7['id']]),this['_currentReviewCheckRun']['markChangeAsAccepted'](_0x4c94f7['id']),this['_aiReviewCoreUi']['hideChangeBalloon'](),this['_currentReviewCheckRun']['sendRating'](_0x4c94f7['id']));}),this['listenTo'](this['_aiReviewCoreUi'],'dismissChange',(_0x359356,_0x3f18d1)=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['isChangeActive'](_0x3f18d1['id'])&&(this['_aiReviewCoreEditing']['rejectChange'](_0x3f18d1['id']),this['_currentReviewCheckRun']['markChangeAsRejected'](_0x3f18d1['id']),this['_aiReviewCoreUi']['hideChangeBalloon'](),this['_currentReviewCheckRun']['sendRating'](_0x3f18d1['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',(_0x38e52e,_0x18c3b7)=>{this['_onActivateChange'](_0x18c3b7);}),this['listenTo'](this['_aiReviewCoreUi'],'deactivateChange',(_0x3acf08,_0x27fa49)=>{this['_onDeactivateChange'](_0x27fa49);}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerClicked',(_0xb1ed70,_0x2885c2)=>{this['_onChangeMarkerClicked'](_0xb1ed70,_0x2885c2);}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerHovered',(_0x35bb92,_0x74f595)=>{this['_onChangeMarkerHovered'](_0x35bb92,_0x74f595);}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerBlurred',()=>{this['_onChangeMarkerBlurred']();}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerRemoved',(_0x36538d,_0x479f76)=>{this['_onChangeMarkerRemoved'](_0x36538d,_0x479f76);}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerRestored',(_0x66a0d9,_0x2ead54)=>{this['_onChangeMarkerRestored'](_0x66a0d9,_0x2ead54);});}['_createReviewCheckRun'](_0x3d5d09,_0x32d6db){return new wo(this['_aiReviewCoreEditing']['getDocumentData'](),_0x32d6db,this['_aiConnector'],_0x3d5d09['params'],_0x3d5d09['args']);}['_onChangeMarkerRemoved'](_0x5ec5ac,_0x578a40){this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['markChangeAsOutdated'](_0x578a40['changeId']);}['_onChangeMarkerRestored'](_0x41cfdc,_0x471437){this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['markChangeAsPending'](_0x471437['changeId']);}['_onCheckRunFinished'](){this['_aiReviewCoreUi']['showReviewCompletedView']();}['_initRequiredPlugins'](){this['_aiConnector']=this['context']['plugins']['get']('AIConnector');}['_onReviewRunLeave'](_0x12b089=!0x1){this['_currentReviewCheckRun']&&(this['_currentReviewCheckRun']['hasModifications']||this['_currentReviewCheckRun']['sendRating'](),this['_currentReviewCheckRun']['stopListening'](),this['_currentReviewCheckRun']['abort'](),this['_currentReviewCheckRun']=void 0x0),_0x12b089&&this['_aiReviewCoreUi']['showReviewCheckList'](),this['_aiReviewCoreEditing']['clearAllMarkers'](),this['_aiReviewCoreEditing']['switchToEdit'](),this['_changeActivationSource']=null;const _0x2417ff=this['_aiReviewCoreEditing']['getEditor']();_0x2417ff&&_0x2417ff['editing']['view']['change'](_0xe5eeb3=>{const _0xeb333f=_0x2417ff['editing']['view']['document']['getRoot']();_0xe5eeb3['removeClass']('ck-ai_review-diff',_0xeb333f),_0xe5eeb3['removeClass']('ck-ai_review-highlights',_0xeb333f),_0xe5eeb3['removeClass']('ck-ai-translate-mode-content',_0xeb333f);});}['_getTranslationWithDefault'](_0x1ef68f,_0x14df3e){const _0x5dda3f=cs(this['context']['locale'],_0x1ef68f);return _0x5dda3f===_0x1ef68f?_0x14df3e:_0x5dda3f;}['_logError'](_0x3a9a55,_0x5dccc0=!0x1){Tt(_0x3a9a55['message']),_0x5dccc0||(_0x3a9a55['message']['startsWith']('ai-review-mode-models-unable-to-retrieve')?this['_aiReviewCoreUi']['showGeneralReviewCoreErrorView']():this['_aiReviewCoreUi']['showGeneralResultsErrorView']());}['_scrollToChange'](_0x3ed4bd){if('content'===this['_changeActivationSource']){const _0x5bc00f=this['_aiReviewCoreUi']['getChangeElement'](_0x3ed4bd);_0x5bc00f&&wt(_0x5bc00f['closest']('.ck-ai_review__check-run-result')||_0x5bc00f);}else{if('panel'===this['_changeActivationSource']){const _0x14fba6=this['_getChangeContentElement'](_0x3ed4bd);if(!_0x14fba6)return;mt({'target':_0x14fba6,'viewportOffset':{'top':0x55,'left':0x0,'bottom':0x0,'right':0x0},'ancestorOffset':0x14,'alignToTop':!0x0});}}}}const So=[{'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 bo{['id'];['commandId'];['title'];['description'];['isParameterized'];['useArgs'];['options'];['args'];get['apiId'](){return this['commandId'];}constructor(_0x5f540b){this['id']=_0x5f540b['id'],this['commandId']=_0x5f540b['commandId'],this['title']=_0x5f540b['title'],this['description']=_0x5f540b['description'],this['isParameterized']=_0x5f540b['isParameterized'],this['useArgs']=_0x5f540b['useArgs'],this['options']=_0x5f540b['options'],this['args']=_0x5f540b['args'];}}class Ro extends ht(){['_checks']=[];['setupChecks'](_0x4d49ec){this['_checks']=_0x4d49ec['map'](_0x4766d9=>new bo(_0x4766d9));}get['checks'](){return this['_checks'];}['getCheckById'](_0xc5a513){return this['checks']['find'](_0x28eef5=>_0x28eef5['id']===_0xc5a513);}['removeCheckById'](_0x10cb8b){this['_checks']=this['_checks']['filter'](_0x83044c=>_0x83044c['id']!==_0x10cb8b);}}class Oo extends bo{['_models']=[];['_defaultModel']=null;constructor(_0x271c32,_0x330ca0,_0x366aaf){super(_0x271c32),this['_models']=_0x330ca0,this['_defaultModel']=_0x366aaf;}get['models'](){return this['_models'];}get['defaultModel'](){return this['_defaultModel'];}}class ko extends bo{['isExtra']=!0x0;['prompt'];['model'];['_defaultModel']=null;constructor(_0x1bc2c9,_0x8d38f2,_0x199efc){super(_0x1bc2c9),this['prompt']=_0x1bc2c9['prompt'],this['model']=_0x1bc2c9['model'],this['model']?this['_defaultModel']=_0x8d38f2['find'](_0xdf79cd=>_0xdf79cd['id']===this['model'])||null:this['_defaultModel']=_0x199efc;}get['defaultModel'](){return this['_defaultModel'];}}class No extends Ro{['_allModels']=[];['_recommendedModels']=[];['_defaultModel']=null;constructor(_0x292d11,_0x20bd6a,_0x5bd109){super(),this['_allModels']=_0x292d11,this['_recommendedModels']=_0x20bd6a,this['_defaultModel']=_0x5bd109;}['setupChecks'](_0x46a677){this['_checks']=_0x46a677['map'](_0x22f74c=>!0x0===_0x22f74c['isExtra']?new ko(_0x22f74c,this['_allModels'],this['_defaultModel']):'custom'===_0x22f74c['id']?new Oo(_0x22f74c,this['_recommendedModels'],this['_defaultModel']):new bo(_0x22f74c));}}class vo extends Co{['_prompt'];['_model'];constructor(_0x2c5215,_0x5eadcf,_0xc2b5f3,_0x4dca35,_0x446fe5){super(_0xc2b5f3,_0x4dca35,_0x446fe5),this['_prompt']=_0x2c5215,this['_model']=_0x5eadcf;}get['subTitle'](){return this['_prompt'];}['_createApiRequest'](){return this['_aiConnector']['callCustomReview']({'content':this['_documentData']['content'],'prompt':this['_prompt'],'model':this['_model']});}['_sendRatingRequest'](_0x4c0958,_0x586e1f,_0x20c71a){return this['_aiConnector']['upsertCustomAIReviewRating'](_0x586e1f,_0x4c0958,_0x20c71a);}}class yo extends vo{get['subTitle'](){return'';}set['prompt'](_0x15f9aa){this['_prompt']=_0x15f9aa;}set['model'](_0x2c9391){this['_model']=_0x2c9391;}}class xo extends fo{static get['pluginName'](){return'AIReviewModeController';}['_isDiffOn']=!0x1;['_hasDefaultAvailableCommands']=!0x1;constructor(_0x208424){super(_0x208424),this['_hasDefaultAvailableCommands']=!this['context']['config']['get']('ai.review.availableCommands'),this['context']['config']['define']('ai.review.availableCommands',So['map'](_0x2f689d=>_0x2f689d['id'])),this['context']['config']['define']('ai.review.extraCommands',[]);}async['init'](){await super['init'](),this['listenTo'](this['_aiReviewCoreUi'],'toggleDiff',(_0x259d23,_0x571bf6)=>{this['_isDiffOn']=_0x571bf6['on'],this['_onDiffChange'](this['_isDiffOn']);});}['_initRequiredPlugins'](){super['_initRequiredPlugins'](),this['_aiReviewCoreUi']=this['context']['plugins']['get']('AIReviewModeUI'),this['_aiReviewCoreEditing']=this['context']['plugins']['get']('AIReviewCoreEditing');}['_createReviewCheckRun'](_0x323419,_0x45b903){return _0x323419['isCustom']?new vo(_0x323419['args']['prompt'],_0x323419['args']['model'],this['_aiReviewCoreEditing']['getDocumentData'](),_0x45b903,this['_aiConnector']):_0x45b903['isExtra']?new yo(_0x45b903['prompt'],_0x45b903['defaultModel']['id'],this['_aiReviewCoreEditing']['getDocumentData'](),_0x45b903,this['_aiConnector']):new wo(this['_aiReviewCoreEditing']['getDocumentData'](),_0x45b903,this['_aiConnector'],_0x323419['params'],_0x323419['args']);}['_onReviewCheckResultActivated'](_0x417e3a){this['_aiReviewCoreUi']['setActiveStateInResults'](_0x417e3a['change']['id']),this['_scrollToChange'](_0x417e3a['change']['id']);const _0x5b33bf=this['_aiReviewCoreEditing']['getMarkerElementForChange'](_0x417e3a['change']['id']);if(!_0x5b33bf)return;const _0x133c18=this['_aiReviewCoreEditing']['getEditor']();this['_aiReviewCoreUi']['showChangeBalloon'](_0x417e3a['change'],()=>_0x5b33bf['getElement'](),void 0x0,'click',_0x133c18?.['editing']?.['view']?.['getDomRoot'](),_0x133c18?.['ui']?.['viewportOffset']),this['_aiReviewCoreEditing']['setMarkersInElementAsActive'](_0x417e3a['change']['id']);}['_onReviewCheckResultDeactivated'](){this['_aiReviewCoreUi']['resetActiveStateInResults'](),this['_aiReviewCoreUi']['hideChangeBalloon'](),this['_aiReviewCoreEditing']['setAllMarkersAsInactive']();}['_onActivateChange'](_0x1b3007){this['_currentReviewCheckRun']&&'click'===_0x1b3007['uiInteraction']&&(this['_changeActivationSource']='panel',this['_currentReviewCheckRun']['activateChange'](_0x1b3007['id']));}['_onDeactivateChange'](_0x4249fb){this['_currentReviewCheckRun']&&'balloon'===_0x4249fb['origin']&&this['_currentReviewCheckRun']['deactivateChange']();}['_onChangeMarkerClicked'](_0x512ee9,_0x3bbc6c){if(!this['_currentReviewCheckRun'])return;this['_changeActivationSource']='content',this['_currentReviewCheckRun']['activateChange'](_0x3bbc6c['changeId']);const _0x437b2f=this['_currentReviewCheckRun']['getChangeById'](_0x3bbc6c['changeId']);if(!_0x437b2f)return;const _0x2d7879=this['_aiReviewCoreEditing']['getEditor']();this['_aiReviewCoreUi']['showChangeBalloon'](_0x437b2f,_0x3bbc6c['markerElement'],_0x3bbc6c['domEvent'],'click',_0x2d7879?.['editing']?.['view']?.['getDomRoot'](),_0x2d7879?.['ui']?.['viewportOffset']);}['_onChangeMarkerHovered'](_0x4968b0,_0x59a9c5){if(!this['_currentReviewCheckRun'])return;if(this['_currentReviewCheckRun']['isAnyChangeActivated']())return;const _0x18ad65=this['_currentReviewCheckRun']['getChangeById'](_0x59a9c5['changeId']);if(!_0x18ad65)return;const _0x5a3cc0=this['_aiReviewCoreEditing']['getEditor']();this['_aiReviewCoreUi']['showChangeBalloon'](_0x18ad65,_0x59a9c5['markerElement'],_0x59a9c5['domEvent'],'hover',_0x5a3cc0?.['editing']?.['view']?.['getDomRoot'](),_0x5a3cc0?.['ui']?.['viewportOffset']);}['_onChangeMarkerBlurred'](){if(!this['_currentReviewCheckRun'])return;this['_currentReviewCheckRun']['isAnyChangeActivated']()||this['_aiReviewCoreUi']['hideChangeBalloon']();}['_getChangeContentElement'](_0x183422){const _0x73b6a4=this['_aiReviewCoreEditing']['getMarkerElementForChange'](_0x183422);return _0x73b6a4?_0x73b6a4['getElement']():null;}['_markChangePositionInEditorContent'](_0x1d136f,_0x39f016){this['_aiReviewCoreEditing']['markChangePositionInEditorContent'](_0x1d136f,_0x39f016);}['_diffContent'](_0x2b3210,_0x400af0){return this['_aiReviewCoreEditing']['diffContent'](_0x2b3210,_0x400af0);}['_onReviewCheckRun'](){this['_onDiffChange'](this['_isDiffOn']);}['_onDiffChange'](_0x4f3f65){const _0x5aab4a=this['_aiReviewCoreEditing']['getEditor']();_0x4f3f65?this['_aiReviewCoreUi']['hideDiffInBalloon']():this['_aiReviewCoreUi']['showDiffInBalloon'](),_0x5aab4a&&_0x5aab4a['editing']['view']['change'](_0x205d8b=>{const _0x5ed5e6=_0x5aab4a['editing']['view']['document']['getRoot']();for(const _0x1aeea7 of _0x5ed5e6['getClassNames']())_0x1aeea7['startsWith']('ck-ai_review-')&&_0x205d8b['removeClass'](_0x1aeea7,_0x5ed5e6);_0x205d8b['addClass'](_0x4f3f65?'ck-ai_review-diff':'ck-ai_review-highlights',_0x5ed5e6);});}async['_getChecksList'](){const _0x151a87=[...So,...this['_getExtraChecks']()],_0x3de162=this['context']['config']['get']('ai.review.availableCommands')||[];this['_logErrorForNonExistentChecks'](_0x3de162,_0x151a87);let _0x4161be=_0x151a87;this['_hasDefaultAvailableCommands']||(_0x4161be=_0x3de162['map'](_0x1b889d=>_0x151a87['find'](_0x448e1d=>_0x448e1d['id']===_0x1b889d))['filter'](_0x264ffe=>!!_0x264ffe)),_0x4161be=_0x4161be['map'](_0x3fa896=>_0x3fa896['isExtra']?_0x3fa896:this['_translateReviewCheck'](_0x3fa896));const _0x30d939=_0x4161be['some'](_0x57b374=>_0x57b374['isExtra']||'custom'===_0x57b374['id']);let _0x1c061d=[],_0x5a6170=[],_0x515172=null;if(_0x30d939){const _0x3a810f=await this['_getModels']();_0x1c061d=_0x3a810f['all'],_0x5a6170=_0x3a810f['recommended'],_0x515172=_0x3a810f['default'];}const _0xbefc66=new No(_0x1c061d,_0x5a6170,_0x515172);return _0xbefc66['setupChecks'](_0x4161be),_0x30d939&&this['_filterChecksWithMissingModel'](_0xbefc66),_0xbefc66;}['_getExtraChecks'](){return(this['context']['config']['get']('ai.review.extraCommands')||[])['map'](_0x27e879=>({'id':_0x27e879['id'],'commandId':_0x27e879['id'],'title':_0x27e879['label'],'description':_0x27e879['description'],'isParameterized':!0x1,'isExtra':!0x0,'prompt':_0x27e879['prompt'],'model':_0x27e879['model']}));}['_logErrorForNonExistentChecks'](_0x2390a0,_0x1bb870){const _0x10304a=_0x2390a0['filter'](_0x575ae4=>!_0x1bb870['some'](_0x3dcdf8=>_0x3dcdf8['id']===_0x575ae4));_0x10304a['length']&&this['_logError'](new ot('ai-review-mode-non-existent-commands-used',this,{'commandIds':_0x10304a['join'](',\x20')}),!0x0);}async['_getModels'](){try{const _0x11fbc5=new Ks({'connector':this['_aiConnector'],'config':this['context']['config']['get']('ai.models'),'locale':this['context']['locale']});return{'all':await _0x11fbc5['getAll'](),'recommended':await _0x11fbc5['getAvailableModels'](),'default':await _0x11fbc5['getDefault']()};}catch(_0x194faf){return this['_logError'](new ot('ai-review-mode-models-unable-to-retrieve',this,void 0x0,_0x194faf)),{'all':[],'recommended':[],'default':null};}}['_translateReviewCheck'](_0x1b2d78){const _0x375ffd='AI_REVIEW_CHECK_'+_0x1b2d78['id']['toUpperCase']()['replaceAll']('-','_'),_0x7ade1a={..._0x1b2d78,'title':this['_getTranslationWithDefault'](_0x375ffd+'_TITLE',_0x1b2d78['title']),'description':this['_getTranslationWithDefault'](_0x375ffd+'_DESCRIPTION',_0x1b2d78['description'])};return _0x1b2d78['options']&&(_0x7ade1a['options']=_0x1b2d78['options']['map'](_0xac06dd=>({..._0xac06dd,'label':this['_getTranslationWithDefault'](_0x375ffd+'_OPTIONS_LABEL',_0xac06dd['label']||''),'data':_0xac06dd['data']?_0xac06dd['data']['map'](_0x35d036=>({..._0x35d036,'label':this['_getTranslationWithDefault'](_0x375ffd+'_OPTIONS_DATA_'+_0x35d036['id']['toUpperCase'](),_0x35d036['label'])})):void 0x0}))),_0x7ade1a;}['_filterChecksWithMissingModel'](_0x2381a6){const _0x3c29a4=[];_0x2381a6['checks']['forEach'](_0xed57bb=>{(_0xed57bb instanceof ko&&!_0xed57bb['defaultModel']||_0xed57bb instanceof Oo&&!_0xed57bb['models']['length'])&&_0x3c29a4['push'](_0xed57bb['id']);}),_0x3c29a4['length']&&_0x3c29a4['forEach'](_0x39ead4=>{_0x2381a6['removeCheckById'](_0x39ead4),this['_logError'](new ot('ai-review-mode-command-unavailable-due-to-missing-model',this,{'commandId':_0x39ead4}),!0x0);});}}class Lo extends _0x474324{static get['requires'](){return[xo,Io,po];}static get['pluginName'](){return'AIReviewMode';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class Do extends bo{get['apiId'](){return'translate';}}class Po extends Ro{['setupChecks'](_0x4297af){this['_checks']=_0x4297af['map'](_0x522c83=>new Do(_0x522c83));}}class Ho extends wo{['_title'];constructor(_0x2bfb4e,_0x52acee,_0x9e68eb,_0x2b3ec6,_0x445de3,_0x3239e8){super(_0x2bfb4e,_0x52acee,_0x9e68eb,_0x445de3,_0x3239e8),this['_title']=_0x2b3ec6;}get['title'](){return this['_title'];}get['subTitle'](){return this['_sourceCheck']['title'];}}class Mo extends fo{static get['pluginName'](){return'AITranslateController';}constructor(_0x42dd18){super(_0x42dd18),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'](_0x2658af,_0x17f2a8){return new Ho(this['_aiReviewCoreEditing']['getDocumentData'](),_0x17f2a8,this['_aiConnector'],cs(this['context']['locale'],'AI_REVIEW_CHECK_TRANSLATE_TITLE'),_0x2658af['params'],_0x2658af['args']);}['_onReviewCheckResultActivated'](_0x34fcf3){this['_aiReviewCoreUi']['setActiveStateInResults'](_0x34fcf3['change']['id']),this['_aiReviewCoreEditing']['setMarkersInElementAsActive'](_0x34fcf3['change']['id']);}['_onReviewCheckResultDeactivated'](){this['_aiReviewCoreEditing']['setAllMarkersAsInactive'](),this['_aiReviewCoreUi']['resetActiveStateInResults']();}['_onActivateChange'](_0x5f58f8){this['_currentReviewCheckRun']&&('hover'===_0x5f58f8['uiInteraction']&&(this['_changeActivationSource']='panel',this['_currentReviewCheckRun']['activateChange'](_0x5f58f8['id'])),'click'===_0x5f58f8['uiInteraction']&&this['_scrollToChange'](_0x5f58f8['id']));}['_onDeactivateChange'](_0x1927c9){this['_currentReviewCheckRun']&&'panel'===_0x1927c9['origin']&&this['_currentReviewCheckRun']['deactivateChange']();}['_onChangeMarkerClicked'](_0x3b1259,_0x3435e0){this['_currentReviewCheckRun']&&(this['_changeActivationSource']='content',this['_currentReviewCheckRun']['activateChange'](_0x3435e0['changeId']),this['_scrollToChange'](_0x3435e0['changeId']));}['_onChangeMarkerHovered'](_0x33e615,_0xdcd847){this['_currentReviewCheckRun']&&(this['_changeActivationSource']='content',this['_currentReviewCheckRun']['activateChange'](_0xdcd847['changeId']),this['_aiReviewCoreEditing']['reactivateMarkers'](_0xdcd847['changeId']));}['_onChangeMarkerBlurred'](){this['_currentReviewCheckRun']&&'content'===this['_changeActivationSource']&&(this['_currentReviewCheckRun']['deactivateChange'](),this['_aiReviewCoreEditing']['setAllMarkersAsInactive']());}['_getChangeContentElement'](_0x5866a5){return this['_aiReviewCoreEditing']['getContentElementForChange'](_0x5866a5);}['_markChangePositionInEditorContent'](_0xd807d4,_0x4ffa71){this['_aiReviewCoreEditing']['markChangePositionInEditorContent'](_0xd807d4,_0x4ffa71);}['_diffContent'](_0x57daef,_0xef60f3){return this['_aiReviewCoreEditing']['diffContent'](_0x57daef,_0xef60f3,!0x0);}['_onReviewCheckRun'](){const _0x318ab6=this['_aiReviewCoreEditing']['getEditor']();_0x318ab6&&_0x318ab6['editing']['view']['change'](_0xd3c11b=>{const _0x24c4c3=_0x318ab6['editing']['view']['document']['getRoot']();for(const _0x4f87e4 of _0x24c4c3['getClassNames']())(_0x4f87e4['startsWith']('ck-ai-review-')||'ck-ai-translate-'===_0x4f87e4)&&_0xd3c11b['removeClass'](_0x4f87e4,_0x24c4c3);_0xd3c11b['addClass']('ck-ai-translate-mode-content',_0x24c4c3);});}async['_getChecksList'](){const _0xf7c020=[],_0x29864c=this['context']['config']['get']('ai.translate.languages')||[];for(const _0x7fba54 of _0x29864c)_0xf7c020['push']({'title':_0x7fba54['label'],'id':_0x7fba54['id'],'commandId':_0x7fba54['id'],'description':'','isParameterized':!0x1,'useArgs':!0x0,'args':{'language':_0x7fba54['id']}});const _0x4ed577=new Po();return _0x4ed577['setupChecks'](this['_translateChecks'](_0xf7c020)),_0x4ed577;}['_translateChecks'](_0x3519a9){return _0x3519a9['map'](_0xa4343=>{const _0xb54a12='AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_'+_0xa4343['title']['toUpperCase']()['replaceAll']('-','_');return{..._0xa4343,'title':this['_getTranslationWithDefault'](_0xb54a12,_0xa4343['title'])};});}}class Uo extends ro{constructor(_0x13396a,_0x1fefd4){super(_0x13396a,_0x1fefd4),this['on']('set:isLoading',(_0x11d83b,_0x5966d3,_0x369ffb)=>{_0x369ffb&&(this['headerTitle']=cs(this['locale'],'AI_TRANSLATE_CHECK_RESULTS_LOADING_TITLE'));}),this['on']('set:isResultReady',(_0x4b5d04,_0x561404,_0x45622b)=>{_0x45622b&&(this['headerTitle']=cs(this['locale'],'AI_TRANSLATE_CHECK_RESULTS_READY_TITLE'));});}['_createAcceptAllButtonView'](){const _0x1294f2=super['_createAcceptAllButtonView']();return _0x1294f2['set']('label',cs(this['locale'],'AI_TRANSLATE_ACCEPT_ALL')),_0x1294f2;}['_createExitReviewButtonView'](){const _0x3c1463=super['_createExitReviewButtonView']();return _0x3c1463['set']('label',cs(this['locale'],'AI_CHAT_HISTORY_CANCEL')),_0x3c1463;}}class Vo extends go{['_setupTemplate'](){const _0x151dea=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-translate__check-list-wrapper',_0x151dea['if']('isVisible','ck-hidden',_0x256ae8=>!_0x256ae8)]},'children':[{'tag':'div','attributes':{'class':['ck-ai-translate__check-list-header']},'children':[{'tag':'h2','children':[{'text':cs(this['locale'],'AI_TRANSLATE_CHECK_LIST_HEADER_TITLE')}]},{'tag':'p','children':[{'text':cs(this['locale'],'AI_TRANSLATE_CHECK_LIST_HEADER_DESCRIPTION')}]}]},{'tag':'div','attributes':{'class':['ck-ai_review__check-list',_0x151dea['if']('isVisible','ck-hidden',_0x54f157=>!_0x54f157)]},'children':this['_checkViews']}]});}}class Bo extends eo{static get['pluginName'](){return'AITranslateUI';}['createMainView'](){const _0x176fbf=this['context']['locale'],_0x22b6f0=new _0x17eb16(_0x176fbf,{'label':cs(_0x176fbf,'AI_REVIEW_CHECK_TRANSLATE_TITLE'),'icon':_0x2a0a11,'class':'ck-ai-header\x20ck-ai-header_review-translate'}),_0x301e39=new so(_0x176fbf,{'header':_0x22b6f0,'list':new Vo(_0x176fbf),'results':new Uo(_0x176fbf,{'generalErrorText':cs(_0x176fbf,'AI_TRANSLATE_GENERAL_ERROR_MESSAGE')}),'completed':new ao(_0x176fbf,{'headerText':cs(_0x176fbf,'AI_TRANSLATE_FINISH_HEADER_TITLE'),'emptyResultsText':cs(_0x176fbf,'AI_TRANSLATE_EMPTY_RESULTS_TEXT'),'buttonText':cs(_0x176fbf,'AI_TRANSLATE_FINISH_BUTTON_LABEL')})});return _0x301e39['extendTemplate']({'attributes':{'class':'ck-ai-translate-mode'}}),_0x301e39;}['registerTab'](){const _0xaca70d=this['context']['plugins']['get']('AITabs');_0xaca70d['view']['on']('activateTab',(_0x301066,_0x28da7b)=>{'translate'===_0x28da7b?this['fire']('getReviewCheckList'):this['fire']('leaveReview');}),_0xaca70d['view']['addTab']({'id':'translate','buttonLabel':cs(this['context']['locale'],'AI_REVIEW_CHECK_TRANSLATE_TITLE'),'buttonIcon':_0x2a0a11,'order':0x0,'content':this['_mainView']});}}class Go extends _0x474324{static get['requires'](){return[Mo,Bo,po];}static get['pluginName'](){return'AITranslate';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}export{za as AIActions,Oi as AIAdapter,zi as AIAssistant,qi as AIAssistantUI,fa as AIBalloon,_a as AIChat,Qs as AIChatController,da as AIChatHistory,ua as AIChatHistoryController,ha as AIChatHistoryUI,Ea as AIChatShortcuts,ia as AIChatUI,hs as AIConnector,zs as AIEditing,ka as AIEditorIntegration,ja as AIQuickActions,Ba as AIQuickActionsUI,ki as AIRequestError,bo as AIReviewCheck,To as AIReviewCheckResult,Co as AIReviewCheckRun,Lo as AIReviewMode,fo as AIReviewModeController,po as AIReviewModeEditing,Io as AIReviewModeUI,os as AITabs,Ji as AITextAdapter,Ta as AIToggleButtonUI,Go as AITranslate,Mo as AITranslateController,Bo as AITranslateUI,ts as AWSTextAdapter,Zi as OpenAITextAdapter,vi as ShowAIAssistantCommand,pa as ToggleAICommand,_s as createResizeButton,ji as getDefaultAICommands};