@ckeditor/ckeditor5-ai 48.0.0-alpha.3 → 48.0.0-alpha.5

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 +5 -5
  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,8 +20,8 @@
20
20
  *
21
21
  *
22
22
  */
23
- import{Plugin as _0x12af0a,Command as _0x521df8,ContextPlugin as _0x12c8be,Editor as _0x3c1522}from'@ckeditor/ckeditor5-core/dist/index.js';import{IconCopy as _0xea2377,IconCheck as _0xef6224,IconError as _0x2f4342,IconSubmit as _0xb85aa1,IconAIHistory as _0x390cb7,IconMagicWand as _0x378522,IconRobotPencil as _0x16f9ab,IconMaximize as _0x4d2a14,IconMinimize as _0xe77c4,IconShowChangesOn as _0x2e0ef1,IconShowChangesOff as _0x2fe257,IconDocument as _0x5b8c03,IconBoxWithCross as _0x5c20b5,IconBoxWithCheck as _0x455cca,IconBoxWithMarker as _0x41d834,IconInfo as _0x1e2df8,IconWeb as _0x80e6d9,IconClose as _0x23dbe7,IconSelection as _0x309d2b,IconFileUpload as _0x14627b,IconLink as _0x3bbf0a,IconBulb as _0x33b265,IconAI as _0x4ac43b,IconPreviousArrow as _0x2eda47,IconDocumentOutline as _0x2cbe6c,IconLoupe as _0x5a05dc,IconCancel as _0x2e72cd,IconPaperClip as _0x5002ef,IconBrowseFiles as _0x21b454,IconDropdownArrow as _0xb35716,IconStop as _0x46eb32,IconAIChat as _0x477fa4,IconPlus as _0x5dc052,IconPin as _0x34f613,IconThreeHorizontalDots as _0x211a01,IconAIReview as _0x4f1906,IconAITranslate as _0x275309,IconAIAskAI as _0x3d4af9,IconThumbUp as _0x36e225,IconThumbDown as _0x3961b1,IconChevronDown as _0x5af4b8,IconChevronUp as _0x22ff24,IconAIQuickActions as _0x5f32e3,IconAIChatCommands as _0x375821,IconAIImproveWriting as _0x4a3a7e,IconAIContinueWriting as _0x56babf,IconAIGrammarCheck as _0x40edc4,IconAIAdjustLength as _0x4b6dd4,IconAIChangeTone as _0x1b5b19,IconAIOther as tt,IconRefresh as et,IconNextArrow as it,IconOutdated as st,IconEye as nt,IconEyeCrossedOut as rt,IconChevronRight as at}from'@ckeditor/ckeditor5-icons/dist/index.js';import{uid as ot,CKEditorError as ht,ObservableMixin as ct,global as lt,isVisible as ut,Rect as dt,Collection as _t,FocusTracker as At,KeystrokeHandler as gt,first as It,toArray as Et,EmitterMixin as pt,logWarning as Tt,logError as mt,scrollViewportToShowTarget as Ct,insertToPriorityArray as wt,scrollAncestorsToShowTarget as ft,ResizeObserver as St,_isMotionReduced as bt,getConstrainedViewportRect as Rt,DomEmitterMixin as Ot}from'@ckeditor/ckeditor5-utils/dist/index.js';import{ToolbarView as kt,ButtonView as Nt,View as vt,SpinnerView as yt,IconView as xt,AutocompleteView as Lt,ListView as Dt,ListItemGroupView as Pt,ListItemView as Ht,ButtonLabelView as Mt,FocusCycler as Ut,createLabeledTextarea as Vt,Dialog as Bt,createDropdown as Gt,addMenuToDropdown as Ft,MenuBarMenuView as Kt,MenuBarMenuListItemButtonView as Wt,DialogViewPosition as Yt,MenuBarMenuListView as $t,MenuBarMenuListItemView as qt,BodyCollection as Qt,BalloonPanelView as Xt,clickOutsideHandler as zt,addListToDropdown as jt,UIModel as Jt,submitHandler as Zt,LabeledFieldView as te,createLabeledInputText as _0x25cf25,FormHeaderView as _0x1b248d,HighlightedTextView as _0x1b00b1,ViewCollection as _0x5df866,FileDialogButtonView as _0x56f40d,InputTextView as _0x5f42e2,SearchTextView as _0x5b72a7,ListItemButtonView as _0x2a97d0,ButtonLabelWithHighlightView as _0x3a98ec,DropdownMenuPanelPositioningFunctions as _0x33a79b,BalloonToolbar as _0x4506df,FormRowView as _0x4c4951,TextareaView as _0x117148}from'@ckeditor/ckeditor5-ui/dist/index.js';import{ClipboardPipeline as _0x1523d6,ClipboardMarkersUtils as _0x510cca}from'@ckeditor/ckeditor5-clipboard/dist/index.js';import{ViewDocumentDomEventData as _0x3cb0bc,ViewDataTransfer as _0x1979be,ViewUpcastWriter as _0x49cc34,Matcher as _0x2bcde7,_DetachOperation as _0x538ce3,_insertIntoModelNodeList as _0x360f30,_removeFromModelNodeList as _0x43c115,ModelRange as _0x1569aa,transformOperationSets as _0x5ad7d5,ViewDowncastWriter as _0x2efc44,ModelDocumentFragment as _0x370ccf,ModelPosition as _0x2cfd1c,ModelTreeWalker as _0x180029,MarkerOperation as _0x46d88d,InsertOperation as _0x9b41a6}from'@ckeditor/ckeditor5-engine/dist/index.js';import{unescape as _0x40837c,escape as _0x2d90f2,cloneDeep as _0x252e77,escapeRegExp as _0x3eb90e,debounce as _0x4608ab}from'es-toolkit/compat';import{BedrockRuntimeClient as _0x20598d,InvokeModelWithResponseStreamCommand as _0x1d18b5,InvokeModelCommand as _0x27ea22}from'@aws-sdk/client-bedrock-runtime';import{createParser as _0x317e30}from'eventsource-parser';import{CloudServices as _0x418e32}from'@ckeditor/ckeditor5-cloud-services/dist/index.js';import{parseDocument as _0x9d1741}from'htmlparser2';import{isTag as _0x3e068a,findOne as _0x33d270,getParent as _0xde3c03,findAll as _0x61616a,removeElement as _0x322bd0,replaceElement as _0x55bac4,prepend as _0x16821e,prependChild as _0x285d06,appendChild as _0x2d5d55,append as _0x508d22,find as _0x29a81b,isComment as _0x16809c,getChildren as ti,textContent as _0x3c8937}from'domutils';import _0x3b485b from'dom-serializer';import{Document as _0x24a4fb,Element as _0x385c4b,Text as _0xf06b4d,cloneNode as _0xb0e23f,isDocument as _0xe66385,isText as _0x5d39ce,NodeWithChildren as _0x455342}from'domhandler';import{MarkdownGfmMdToHtmlDefaultPlugins as _0x4b80de,MarkdownGfmMdToHtml as _0x456ceb}from'@ckeditor/ckeditor5-markdown-gfm/dist/index.js';import _0x15af38 from'rehype-sanitize';import{fixElementSuggestionRange as _0x9bb926,DocumentCompare as _0x27dffc,DATA_ID_MODEL_ATTRIBUTE as _0x2772d6,ConfirmMixin as _0x15ff31,LateFocusDropdownButtonView as _0x56bbba,getAllMarkersDomElementsSorted as _0x2c09c9,SuggestionsConversion as _0x58c656,DATA_ID_VIEW_ATTRIBUTE as _0x361437,getMarkerDomElement as _0x572caa}from'@ckeditor/ckeditor5-collaboration-core/dist/index.js';import _0x460892 from'morphdom';import{diffArrays as _0xc4e7e2}from'diff';const Si='_ungrouppedCommands';function bi(_0x213337,_0x596f5a){const _0x215225=(0x0,_0x596f5a['t'])('Other');return _0x213337['length']?'groupId'in _0x213337[0x0]?_0x213337:[{'groupId':Si,'groupLabel':_0x215225,'order':0x1/0x0,'commands':_0x213337}]:[{'groupId':Si,'groupLabel':_0x215225,'order':0x1/0x0,'commands':[]}];}const Ri=globalThis['DataTransfer'],Oi='ai-ui';class ki extends _0x12af0a{static get['pluginName'](){return'AIAssistantEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const {editor:_0x22fce9}=this,_0x1e6b06=['ck-fake-ai-selection'];_0x22fce9['config']['get']('ai.assistant.useTheme')&&_0x1e6b06['push']('ck-ai-assistant-ui_theme'),_0x22fce9['conversion']['for']('editingDowncast')['markerToHighlight']({'model':Oi,'view':{'classes':_0x1e6b06,'priority':0xc}}),_0x22fce9['conversion']['for']('editingDowncast')['markerToElement']({'model':Oi,'view':(_0x4642bb,{writer:_0x32ae9a})=>{if(!_0x4642bb['markerRange']['isCollapsed'])return null;const _0x34ccde=_0x32ae9a['createUIElement']('span');return _0x32ae9a['addClass'](['ck-fake-ai-selection','ck-fake-ai-selection_collapsed'],_0x34ccde),_0x34ccde;}});}['afterInit'](){!async function(_0x220492){const _0x34edcd=_0x12ce7f([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]),_0x52db7c=0x3dffc4e1,_0x1bf299=0x3df841f1^_0x52db7c,_0x30b3d7=window[_0x12ce7f([0x44,0x61,0x74,0x65])][_0x12ce7f([0x6e,0x6f,0x77])](),_0x2c251b=_0x220492[_0x12ce7f([0x65,0x64,0x69,0x74,0x6f,0x72])],_0x459392=new window[(_0x12ce7f([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x3c8663=>{_0x2c251b[_0x12ce7f([0x6f,0x6e,0x63,0x65])](_0x12ce7f([0x72,0x65,0x61,0x64,0x79]),_0x3c8663);}),_0x480836={[_0x12ce7f([0x6b,0x74,0x79])]:_0x12ce7f([0x45,0x43]),[_0x12ce7f([0x75,0x73,0x65])]:_0x12ce7f([0x73,0x69,0x67]),[_0x12ce7f([0x63,0x72,0x76])]:_0x12ce7f([0x50,0x2d,0x32,0x35,0x36]),[_0x12ce7f([0x78])]:_0x12ce7f([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]),[_0x12ce7f([0x79])]:_0x12ce7f([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]),[_0x12ce7f([0x61,0x6c,0x67])]:_0x12ce7f([0x45,0x53,0x32,0x35,0x36])},_0x426e9e=_0x2c251b[_0x12ce7f([0x63,0x6f,0x6e,0x66,0x69,0x67])][_0x12ce7f([0x67,0x65,0x74])](_0x12ce7f([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79]));async function _0x592e48(){let _0x2a9db1,_0x127147=null,_0x2dde8b=null;try{if(_0x426e9e==_0x12ce7f([0x47,0x50,0x4c]))return _0x12ce7f([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]);if(_0x2a9db1=_0x56cab2(),!_0x2a9db1)return _0x12ce7f([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);return _0x2a9db1[_0x12ce7f([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])]&&(_0x2dde8b=_0x29aed0(_0x2a9db1[_0x12ce7f([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])],_0x2a9db1[_0x12ce7f([0x6a,0x74,0x69])])),await _0x1f831b()?_0x2af4e2()?_0x45526b()?_0x12ce7f([0x45,0x78,0x70,0x69,0x72,0x65,0x64]):_0x5b8bfb()?(_0x2a9db1[_0x12ce7f([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x12ce7f([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e])&&(_0x127147=_0x242c69(_0x12ce7f([0x45,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e,0x4c,0x69,0x6d,0x69,0x74]))),await _0x3cdb7c()):_0x12ce7f([0x44,0x6f,0x6d,0x61,0x69,0x6e,0x4c,0x69,0x6d,0x69,0x74]):_0x12ce7f([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]):_0x12ce7f([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}catch{return _0x12ce7f([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}function _0x45526b(){const _0x34ac32=[_0x12ce7f([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e]),_0x12ce7f([0x74,0x72,0x69,0x61,0x6c])][_0x12ce7f([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x2a9db1[_0x12ce7f([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])])?_0x30b3d7/0x3e8:0xe10*_0x1bf299;return _0x2a9db1[_0x12ce7f([0x65,0x78,0x70])]<_0x34ac32;}function _0x2af4e2(){const _0x4b7e50=_0x2a9db1[_0x12ce7f([0x66,0x65,0x61,0x74,0x75,0x72,0x65,0x73])];return!!_0x4b7e50&&(!!_0x4b7e50[_0x12ce7f([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x12ce7f([0x2a]))||!!_0x4b7e50[_0x12ce7f([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x12ce7f([0x41,0x49])));}function _0x5b8bfb(){const _0xd17cb1=_0x2a9db1[_0x12ce7f([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x64,0x48,0x6f,0x73,0x74,0x73])];if(!_0xd17cb1||0x0==_0xd17cb1[_0x12ce7f([0x6c,0x65,0x6e,0x67,0x74,0x68])])return!0x0;const {hostname:_0x498fb9}=new URL(window[_0x12ce7f([0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e])]['href']);if(_0xd17cb1[_0x12ce7f([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x498fb9))return!0x0;const _0x4c0d71=_0x498fb9[_0x12ce7f([0x73,0x70,0x6c,0x69,0x74])](_0x12ce7f([0x2e]));return _0xd17cb1[_0x12ce7f([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x328f6f=>_0x328f6f[_0x12ce7f([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x12ce7f([0x2a])))[_0x12ce7f([0x6d,0x61,0x70])](_0x5d05f4=>_0x5d05f4[_0x12ce7f([0x73,0x70,0x6c,0x69,0x74])](_0x12ce7f([0x2e])))[_0x12ce7f([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x489803=>_0x489803[_0x12ce7f([0x6c,0x65,0x6e,0x67,0x74,0x68])]<=_0x4c0d71[_0x12ce7f([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0x12ce7f([0x6d,0x61,0x70])](_0x59b361=>Array(_0x4c0d71[_0x12ce7f([0x6c,0x65,0x6e,0x67,0x74,0x68])]-_0x59b361[_0x12ce7f([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0x12ce7f([0x66,0x69,0x6c,0x6c])](_0x59b361[0x0]===_0x12ce7f([0x2a])?_0x12ce7f([0x2a]):'')[_0x12ce7f([0x63,0x6f,0x6e,0x63,0x61,0x74])](_0x59b361))[_0x12ce7f([0x73,0x6f,0x6d,0x65])](_0x6eee46=>_0x4c0d71[_0x12ce7f([0x65,0x76,0x65,0x72,0x79])]((_0x32bf65,_0x422da8)=>_0x6eee46[_0x422da8]===_0x32bf65||_0x6eee46[_0x422da8]===_0x12ce7f([0x2a])));}function _0x3cdb7c(){return _0x127147&&_0x2dde8b?new window[(_0x12ce7f([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x327bee,_0x1f46a1)=>{_0x127147[_0x12ce7f([0x74,0x68,0x65,0x6e])](_0x327bee,_0x1f46a1),_0x2dde8b[_0x12ce7f([0x74,0x68,0x65,0x6e])](_0x222607=>{_0x222607!=_0x12ce7f([0x56,0x61,0x6c,0x69,0x64])&&_0x327bee(_0x222607);},_0x1f46a1);}):_0x127147||_0x2dde8b||_0x12ce7f([0x56,0x61,0x6c,0x69,0x64]);}}function _0x29aed0(_0x573755,_0x13260f){return new window[(_0x12ce7f([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x3ccafc=>{if(_0x4faad2())return _0x3ccafc(_0x12ce7f([0x56,0x61,0x6c,0x69,0x64]));_0x209e4e(),_0x2c251b[_0x12ce7f([0x64,0x65,0x63,0x6f,0x72,0x61,0x74,0x65])](_0x12ce7f([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]));let _0x5eee93=!0x1;const _0x35f262=ot();function _0x53f016(_0x4cba6a){return!!_0x4cba6a&&(typeof _0x4cba6a===_0x12ce7f([0x6f,0x62,0x6a,0x65,0x63,0x74])||typeof _0x4cba6a===_0x12ce7f([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]))&&typeof _0x4cba6a[_0x12ce7f([0x74,0x68,0x65,0x6e])]===_0x12ce7f([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e])&&typeof _0x4cba6a[_0x12ce7f([0x63,0x61,0x74,0x63,0x68])]===_0x12ce7f([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]);}function _0x2542d5(_0x4bc108){_0x225a7e(_0x4bc108)[_0x12ce7f([0x74,0x68,0x65,0x6e])](_0x55d75a=>{if(!_0x55d75a||_0x55d75a[_0x12ce7f([0x73,0x74,0x61,0x74,0x75,0x73])]!=_0x12ce7f([0x6f,0x6b]))return _0x12ce7f([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]);return _0x28231f(_0x594f64(_0x35f262+_0x13260f))!=_0x55d75a[_0x12ce7f([0x76,0x65,0x72,0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6f,0x6e])]?_0x12ce7f([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]):_0x12ce7f([0x56,0x61,0x6c,0x69,0x64]);})[_0x12ce7f([0x74,0x68,0x65,0x6e])](_0x479d99=>(_0x11b976(),_0x479d99),()=>{const _0xa0e470=_0x3fb6bf();return null==_0xa0e470?(_0x11b976(),_0x12ce7f([0x56,0x61,0x6c,0x69,0x64])):_0x12ce7f(_0x30b3d7-_0xa0e470>(0x19f340e1^_0x52db7c)?[0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]:[0x56,0x61,0x6c,0x69,0x64]);})[_0x12ce7f([0x74,0x68,0x65,0x6e])](_0x3ccafc)[_0x12ce7f([0x63,0x61,0x74,0x63,0x68])](()=>{_0x3ccafc(_0x12ce7f([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});const _0x5a9951=0x3dc92a61^_0x52db7c;function _0x11b976(){const _0x346ff4=_0x12ce7f([0x6c,0x6c,0x63,0x74,0x2d])+_0x28231f(_0x594f64(_0x573755)),_0x396972=_0xc82fd2(_0x28231f(window[_0x12ce7f([0x4d,0x61,0x74,0x68])][_0x12ce7f([0x63,0x65,0x69,0x6c])](_0x30b3d7/_0x5a9951)));window[_0x12ce7f([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x12ce7f([0x73,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x346ff4,_0x396972);}function _0x3fb6bf(){const _0x132205=_0x12ce7f([0x6c,0x6c,0x63,0x74,0x2d])+_0x28231f(_0x594f64(_0x573755)),_0x16bcd9=window[_0x12ce7f([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x12ce7f([0x67,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x132205);return _0x16bcd9?window[_0x12ce7f([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0xc82fd2(_0x16bcd9),0x10)*_0x5a9951:null;}function _0x225a7e(_0xdefb81){return new window[(_0x12ce7f([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x38399f,_0x55a55e)=>{_0xdefb81[_0x12ce7f([0x74,0x68,0x65,0x6e])](_0x38399f,_0x55a55e),window[_0x12ce7f([0x73,0x65,0x74,0x54,0x69,0x6d,0x65,0x6f,0x75,0x74])](_0x55a55e,0x3dfe1021^_0x52db7c);});}}_0x2c251b[_0x12ce7f([0x6f,0x6e])](_0x12ce7f([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),(_0x17d935,_0x3513ad)=>{if(_0x3513ad[0x0]!=_0x573755)return _0x3ccafc(_0x12ce7f([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));_0x3513ad[0x1]={..._0x3513ad[0x1],[_0x12ce7f([0x72,0x65,0x71,0x75,0x65,0x73,0x74,0x49,0x64])]:_0x35f262};},{[_0x12ce7f([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x12ce7f([0x68,0x69,0x67,0x68])}),_0x2c251b[_0x12ce7f([0x6f,0x6e])](_0x12ce7f([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),_0x548929=>{_0x53f016(_0x548929[_0x12ce7f([0x72,0x65,0x74,0x75,0x72,0x6e])])&&(_0x5eee93=!0x0,_0x2542d5(_0x548929[_0x12ce7f([0x72,0x65,0x74,0x75,0x72,0x6e])]));},{[_0x12ce7f([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x12ce7f([0x6c,0x6f,0x77])}),_0x459392[_0x12ce7f([0x74,0x68,0x65,0x6e])](()=>{_0x5eee93||_0x3ccafc(_0x12ce7f([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});});function _0x4faad2(){return _0x2c251b[_0x12ce7f([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x12ce7f([0x76,0x69,0x65,0x77])][_0x12ce7f([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]==_0x12ce7f([0x61,0x75,0x74,0x6f]);}function _0x209e4e(){_0x2c251b[_0x12ce7f([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x12ce7f([0x76,0x69,0x65,0x77])][_0x12ce7f([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]=_0x12ce7f([0x61,0x75,0x74,0x6f]);}}function _0x242c69(_0x4ae314){const _0x32f1dc=[new window[(_0x12ce7f([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x5792b6=>setTimeout(_0x5792b6,0x3df6fa2d^_0x52db7c)),_0x459392[_0x12ce7f([0x74,0x68,0x65,0x6e])](()=>new window[(_0x12ce7f([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x5e33a1=>{let _0x3e0768=0x0;_0x2c251b[_0x12ce7f([0x6d,0x6f,0x64,0x65,0x6c])][_0x12ce7f([0x6f,0x6e])](_0x12ce7f([0x61,0x70,0x70,0x6c,0x79,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e]),(_0x4d52a6,_0x17fe9e)=>{_0x17fe9e[0x0][_0x12ce7f([0x69,0x73,0x44,0x6f,0x63,0x75,0x6d,0x65,0x6e,0x74,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e])]&&_0x3e0768++,_0x3e0768==(0x3dffc109^_0x52db7c)&&(_0x5e33a1(),_0x4d52a6[_0x12ce7f([0x6f,0x66,0x66])]());});}))];return window[_0x12ce7f([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65])][_0x12ce7f([0x72,0x61,0x63,0x65])](_0x32f1dc)[_0x12ce7f([0x74,0x68,0x65,0x6e])](()=>_0x4ae314);}async function _0x2f72fc(){await _0x459392,_0x2c251b[_0x12ce7f([0x6d,0x6f,0x64,0x65,0x6c])][_0x12ce7f([0x63,0x68,0x61,0x6e,0x67,0x65])]=_0x1d482f,_0x2c251b[_0x12ce7f([0x6d,0x6f,0x64,0x65,0x6c])][_0x12ce7f([0x65,0x6e,0x71,0x75,0x65,0x75,0x65,0x43,0x68,0x61,0x6e,0x67,0x65])]=_0x1d482f,_0x2c251b[_0x12ce7f([0x65,0x6e,0x61,0x62,0x6c,0x65,0x52,0x65,0x61,0x64,0x4f,0x6e,0x6c,0x79,0x4d,0x6f,0x64,0x65])](_0x12ce7f([0x6d,0x6f,0x64,0x65,0x6c]));}function _0x5a83b6(_0x433d9c){const _0x3b9545=_0x4ab89a();_0x2c251b[_0x3b9545]=_0x12ce7f([0x61,0x69,0x4c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79])+_0x433d9c,_0x433d9c!=_0x12ce7f([0x56,0x61,0x6c,0x69,0x64])&&_0x2f72fc();}function _0x4ab89a(){const _0x1f32d4=window[_0x12ce7f([0x53,0x74,0x72,0x69,0x6e,0x67])](window[_0x12ce7f([0x70,0x65,0x72,0x66,0x6f,0x72,0x6d,0x61,0x6e,0x63,0x65])][_0x12ce7f([0x6e,0x6f,0x77])]())[_0x12ce7f([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](_0x12ce7f([0x2e]),'');let _0x12627e=_0x12ce7f([0x6e]);for(let _0x2157ea=0x0;_0x2157ea<_0x1f32d4[_0x12ce7f([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x2157ea+=0x2){let _0x53628d=window[_0x12ce7f([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x1f32d4[_0x12ce7f([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x2157ea,_0x2157ea+0x2));_0x53628d>=_0x34edcd[_0x12ce7f([0x6c,0x65,0x6e,0x67,0x74,0x68])]&&(_0x53628d-=_0x34edcd[_0x12ce7f([0x6c,0x65,0x6e,0x67,0x74,0x68])]),_0x12627e+=_0x34edcd[_0x53628d];}return _0x12627e;}function _0x56cab2(){const _0x3a4771=_0x426e9e[_0x12ce7f([0x73,0x70,0x6c,0x69,0x74])](_0x12ce7f([0x2e]));if(0x3!=_0x3a4771[_0x12ce7f([0x6c,0x65,0x6e,0x67,0x74,0x68])])return null;return _0x382f44(_0x3a4771[0x1]);function _0x382f44(_0x2a1d8d){const _0x1c5b41=_0x3856b7(_0x2a1d8d);return _0x1c5b41&&_0x4cac8a()?_0x1c5b41:null;function _0x4cac8a(){const _0x49f33e=_0x1c5b41[_0x12ce7f([0x6a,0x74,0x69])],_0x34a6b9=window[_0x12ce7f([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x49f33e[_0x12ce7f([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x49f33e[_0x12ce7f([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8),0x10),_0x3508f7={..._0x1c5b41,[_0x12ce7f([0x6a,0x74,0x69])]:_0x49f33e[_0x12ce7f([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](0x0,_0x49f33e[_0x12ce7f([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8)};return delete _0x3508f7[_0x12ce7f([0x76,0x63])],_0x594f64(_0x3508f7)==_0x34a6b9;}}}async function _0x1f831b(){let _0x5952c1=!0x0;try{const _0x2455ce=_0x426e9e[_0x12ce7f([0x73,0x70,0x6c,0x69,0x74])](_0x12ce7f([0x2e])),[_0x180b4a,_0x5671c0,_0x2d4c55]=_0x2455ce;return _0x3a79e7(_0x180b4a),await _0xe1f86a(_0x180b4a,_0x5671c0,_0x2d4c55),_0x5952c1;}catch{return!0x1;}function _0x3a79e7(_0x43495c){const _0xefbfbf=_0x3856b7(_0x43495c);_0xefbfbf&&_0xefbfbf[_0x12ce7f([0x61,0x6c,0x67])]==_0x12ce7f([0x45,0x53,0x32,0x35,0x36])||(_0x5952c1=!0x1);}async function _0xe1f86a(_0x467ee4,_0x3f7e71,_0x519b6e){const _0x5f10d9=window[_0x12ce7f([0x55,0x69,0x6e,0x74,0x38,0x41,0x72,0x72,0x61,0x79])][_0x12ce7f([0x66,0x72,0x6f,0x6d])](_0x35c7a6(_0x519b6e),_0xfcedbc=>_0xfcedbc[_0x12ce7f([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](0x0)),_0x4868ba=new window[(_0x12ce7f([0x54,0x65,0x78,0x74,0x45,0x6e,0x63,0x6f,0x64,0x65,0x72]))]()[_0x12ce7f([0x65,0x6e,0x63,0x6f,0x64,0x65])](_0x467ee4+_0x12ce7f([0x2e])+_0x3f7e71),_0x10aaf2=window[_0x12ce7f([0x63,0x72,0x79,0x70,0x74,0x6f])][_0x12ce7f([0x73,0x75,0x62,0x74,0x6c,0x65])];if(!_0x10aaf2)return;const _0x161ab8=await _0x10aaf2[_0x12ce7f([0x69,0x6d,0x70,0x6f,0x72,0x74,0x4b,0x65,0x79])](_0x12ce7f([0x6a,0x77,0x6b]),_0x480836,{[_0x12ce7f([0x6e,0x61,0x6d,0x65])]:_0x12ce7f([0x45,0x43,0x44,0x53,0x41]),[_0x12ce7f([0x6e,0x61,0x6d,0x65,0x64,0x43,0x75,0x72,0x76,0x65])]:_0x12ce7f([0x50,0x2d,0x32,0x35,0x36])},!0x1,[_0x12ce7f([0x76,0x65,0x72,0x69,0x66,0x79])]);await _0x10aaf2[_0x12ce7f([0x76,0x65,0x72,0x69,0x66,0x79])]({[_0x12ce7f([0x6e,0x61,0x6d,0x65])]:_0x12ce7f([0x45,0x43,0x44,0x53,0x41]),[_0x12ce7f([0x68,0x61,0x73,0x68])]:{[_0x12ce7f([0x6e,0x61,0x6d,0x65])]:_0x12ce7f([0x53,0x48,0x41,0x2d,0x32,0x35,0x36])}},_0x161ab8,_0x5f10d9,_0x4868ba)||(_0x5952c1=!0x1);}}function _0x3856b7(_0x464f9c){return _0x464f9c[_0x12ce7f([0x73,0x74,0x61,0x72,0x74,0x73,0x57,0x69,0x74,0x68])](_0x12ce7f([0x65,0x79]))?JSON[_0x12ce7f([0x70,0x61,0x72,0x73,0x65])](_0x35c7a6(_0x464f9c)):null;}function _0x35c7a6(_0x262ca5){return window[_0x12ce7f([0x61,0x74,0x6f,0x62])](_0x262ca5[_0x12ce7f([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/-/g,_0x12ce7f([0x2b]))[_0x12ce7f([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/_/g,_0x12ce7f([0x2f])));}function _0x594f64(_0x347098){let _0x56c30a=0x1505;function _0x3412b9(_0x59a4e5){for(let _0x1a2faa=0x0;_0x1a2faa<_0x59a4e5[_0x12ce7f([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x1a2faa++){const _0x1f63c5=_0x59a4e5[_0x12ce7f([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](_0x1a2faa);_0x56c30a=(_0x56c30a<<0x5)+_0x56c30a+_0x1f63c5,_0x56c30a&=_0x56c30a;}}function _0xb5bad2(_0x5456e8){Array[_0x12ce7f([0x69,0x73,0x41,0x72,0x72,0x61,0x79])](_0x5456e8)?_0x5456e8[_0x12ce7f([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](_0xb5bad2):_0x5456e8&&typeof _0x5456e8==_0x12ce7f([0x6f,0x62,0x6a,0x65,0x63,0x74])?Object[_0x12ce7f([0x65,0x6e,0x74,0x72,0x69,0x65,0x73])](_0x5456e8)[_0x12ce7f([0x73,0x6f,0x72,0x74])]()[_0x12ce7f([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](([_0x296d5f,_0x10ce95])=>{_0x3412b9(_0x296d5f),_0xb5bad2(_0x10ce95);}):_0x3412b9(window[_0x12ce7f([0x53,0x74,0x72,0x69,0x6e,0x67])](_0x5456e8));}return _0xb5bad2(_0x347098),_0x56c30a>>>0x0;}function _0x28231f(_0x578b8e){return _0x578b8e[_0x12ce7f([0x74,0x6f,0x53,0x74,0x72,0x69,0x6e,0x67])](0x10)[_0x12ce7f([0x70,0x61,0x64,0x53,0x74,0x61,0x72,0x74])](0x8,_0x12ce7f([0x30]));}function _0xc82fd2(_0x592cd2){return _0x592cd2[_0x12ce7f([0x73,0x70,0x6c,0x69,0x74])]('')[_0x12ce7f([0x72,0x65,0x76,0x65,0x72,0x73,0x65])]()[_0x12ce7f([0x6a,0x6f,0x69,0x6e])]('');}function _0x1d482f(){}function _0x12ce7f(_0x4faecc){return _0x4faecc['map'](_0x544d8f=>String['fromCharCode'](_0x544d8f))['join']('');}_0x5a83b6(await _0x592e48());}(this);}['showFakeVisualSelection'](){const _0x55a483=this['editor']['model'];_0x55a483['change'](_0x2250ea=>{const _0x27316e=_0x55a483['document']['selection']['getRanges']();let _0x1bc961=0x0;for(const _0x4ea050 of _0x27316e){const _0xd4a2b9=Oi+':'+_0x1bc961;if(_0x55a483['markers']['has'](_0xd4a2b9))_0x2250ea['updateMarker'](_0xd4a2b9,{'range':_0x4ea050});else{if(_0x4ea050['start']['isAtEnd']){const _0x12402d=_0x4ea050['start']['getLastMatchingPosition'](({item:_0x36ac24})=>!_0x55a483['schema']['isContent'](_0x36ac24),{'boundaries':_0x4ea050});_0x2250ea['addMarker'](_0xd4a2b9,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x2250ea['createRange'](_0x12402d,_0x4ea050['end'])});}else _0x2250ea['addMarker'](_0xd4a2b9,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x4ea050});}_0x1bc961++;}});}['hideFakeVisualSelection'](){const _0x4119f7=this['editor']['model'],_0x339cd6=Array['from'](this['editor']['model']['markers']['getMarkersGroup'](Oi));_0x339cd6['length']&&_0x4119f7['change'](_0x193d63=>{_0x339cd6['forEach'](_0x347d06=>{_0x193d63['removeMarker'](_0x347d06);});});}['insertContent'](_0x65cdab,_0xa22cd9){const _0xf4d038=this['_getAISelection'](),_0x1358e2=_0xa22cd9||_0xf4d038['getFirstRange']();this['editor']['model']['canEditAt'](_0x1358e2)&&this['editor']['model']['change'](_0xf35628=>{this['hideFakeVisualSelection'](),_0xa22cd9||this['_resetContentOfSelectedTableCells'](_0xf35628,_0xf4d038),this['_pasteHTMLUsingClipboard']({'insertAt':_0x1358e2,'writer':_0xf35628,'html':_0x65cdab});});}['insertContentBelow'](_0x1eebbd){const {model:_0x52c660}=this['editor'],_0x5156b8=this['_getAISelection']();_0x52c660['change'](()=>{const _0x4c018e=this['_prepareTableInsertBelowPosition'](_0x1eebbd,_0x5156b8)||this['_getDefaultInsertBelowPosition'](_0x5156b8);this['insertContent'](_0x1eebbd,_0x4c018e);});}['_getAISelection'](){const _0x4108e0=this['editor']['model'],_0x2339c6=Array['from'](_0x4108e0['markers']['getMarkersGroup'](Oi))['map'](_0x16c585=>_0x16c585['getRange']());return _0x4108e0['createSelection'](_0x2339c6);}['_pasteHTMLUsingClipboard']({writer:_0x502204,html:_0x137de8,insertAt:_0x565829}){const {view:_0x496e52}=this['editor']['editing'],_0x4c9627=this['editor']['plugins']['get'](_0x1523d6),_0x4197dd=new Ri();_0x4197dd['setData']('text/html',_0x137de8);const _0x43cfcd=new ClipboardEvent('paste',{'clipboardData':_0x4197dd}),_0x3e7ee5=new _0x3cb0bc(_0x496e52,_0x43cfcd,{'dataTransfer':new _0x1979be(_0x4197dd)});_0x502204['setSelection'](_0x565829);const _0x37f107=(_0x5285b,_0x52a61d)=>{_0x52a61d['resultRange']&&_0x502204['setSelection'](_0x52a61d['resultRange']);};_0x4c9627['once']('contentInsertion',_0x37f107,{'priority':'lowest'}),_0x496e52['document']['fire']('paste',_0x3e7ee5),_0x4c9627['off']('contentInsertion',_0x37f107);}['_getDefaultInsertBelowPosition'](_0x1da23c){const {model:_0x23cf32}=this['editor'],_0x5dbea6=Array['from'](_0x1da23c['getSelectedBlocks']());return _0x5dbea6['length']?_0x23cf32['createPositionAfter'](_0x5dbea6['pop']()):_0x1da23c['getLastPosition']();}['_prepareTableInsertBelowPosition'](_0x5c4abc,_0x9e338a){const {model:_0x1fe519,plugins:_0x95f366}=this['editor'];if(_0x95f366['has']('TableUtils')){const _0x3053a0=_0x95f366['get']('TableUtils')['getSelectedTableCells'](_0x9e338a);if(_0x3053a0['length']){const _0x4368e3=this['_getTableRowCountFromContent'](_0x5c4abc),_0x5c64eb=this['_createEmptyTableRows'](_0x3053a0,_0x4368e3);return _0x1fe519['createPositionAt'](_0x5c64eb,0x0);}}return null;}['_getTableRowCountFromContent'](_0x2ac370){const _0x5786a8=this['editor']['plugins']['get']('TableUtils'),_0x538a5d=this['editor']['data']['parse'](_0x2ac370),_0x3451a2=Array['from'](_0x538a5d['getChildren']())['filter'](_0x5ba40b=>_0x5ba40b['is']('element','table'));let _0xe0aa3a=0x0;return _0x3451a2['forEach'](_0x1ffacc=>{_0xe0aa3a+=_0x5786a8['getRows'](_0x1ffacc);}),_0xe0aa3a;}['_createEmptyTableRows'](_0x5ca1f5,_0x8ff3b1){const _0xf6691a=this['editor']['plugins']['get']('TableUtils'),_0x2439b7=_0xf6691a['getRowIndexes'](_0x5ca1f5),_0x36831a=_0xf6691a['getColumnIndexes'](_0x5ca1f5),_0x30de18=_0x2439b7['last']+0x1,_0x5da8ef=_0x36831a['first'],_0x2ed411=_0x5ca1f5[0x0]['findAncestor']('table');for(let _0x3950f1=0x0;_0x3950f1<_0x8ff3b1;_0x3950f1++)_0xf6691a['insertRows'](_0x2ed411,{'at':_0x30de18});return _0x2ed411['getChild'](_0x30de18)['getChild'](_0x5da8ef);}['_resetContentOfSelectedTableCells'](_0x7791a2,_0x3d7cbb){const {plugins:_0x5d06a4}=this['editor'],{model:_0x4297cb}=_0x7791a2;if(!_0x5d06a4['has']('TableUtils'))return;_0x5d06a4['get']('TableUtils')['getSelectedTableCells'](_0x3d7cbb)['length']&&_0x4297cb['deleteContent'](_0x3d7cbb);}}class Ni extends _0x12af0a{static get['pluginName'](){return'AIAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['afterInit'](){if(!this['textAdapter'])throw new ht('aiadapter-text-adapter-not-set',null);}}class vi extends Error{constructor(_0x4a9f99){super(_0x4a9f99),this['name']='AIRequestError';}}function yi(_0x50617f,_0x19ec00,_0x17f5a1){const t=_0x50617f['t'];switch(_0x19ec00){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',_0x17f5a1);case'Error\x20during\x20AI\x20content\x20generation:\x20%0':return t('Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x17f5a1);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'},_0x17f5a1);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 _0x19ec00;}}class xi extends _0x521df8{['_commandDefinitions'];constructor(_0x3c0c74,_0xf05d2f){super(_0x3c0c74),this['_commandDefinitions']=_0xf05d2f,this['set']('enabledCommandsIds',[]),this['on']('change:_hasContext',(_0x3a8785,_0xeec597,_0x1f2b33)=>{this['isEnabled']&&(this['enabledCommandsIds']=Li(this['_commandDefinitions'],_0x1f2b33));}),this['set']('_hasContext',!0x1),this['on']('change:isEnabled',(_0x2e4782,_0x39801c,_0x541c41)=>{this['enabledCommandsIds']=_0x541c41?Li(this['_commandDefinitions'],this['_hasContext']):[];});}['refresh'](){const _0x37c577=this['editor']['model'];this['_hasContext']=function(_0x21c121){const _0x322cac=_0x21c121['document']['selection'];return _0x322cac['isCollapsed']?0x0!==[..._0x322cac['getSelectedBlocks']()]['length']&&![..._0x322cac['getSelectedBlocks']()][0x0]['isEmpty']:!!_0x21c121['hasContent'](_0x322cac['getFirstRange']());}(_0x37c577);const _0x46d50c=_0x37c577['document']['selection'],_0xc526fc=this['editor']['config']['get']('ai.assistant.disabledElements');for(const _0x2f845c of _0x46d50c['getRanges']())for(const _0x113633 of _0x2f845c['getItems']())if(_0x113633['is']('element')&&_0xc526fc['includes'](_0x113633['name']))return void(this['isEnabled']=!0x1);this['isEnabled']=!0x0;}['execute'](_0x2c4e14='',_0x2e9269='',_0x55aae6='custom'){this['editor']['plugins']['get'](Xi)['showUI'](_0x2c4e14,_0x2e9269,_0x55aae6);}}function Li(_0x2baf5e,_0x2d8cb9){const _0x44405f=new Set();for(const _0x3944eb of _0x2baf5e['values']())(_0x2d8cb9||!0x1===_0x3944eb['requiresContent'])&&_0x44405f['add'](_0x3944eb['id']);return Array['from'](_0x44405f);}const Di=new RegExp(/^(.*?)<[a-zA-Z][a-zA-Z0-9_\-.]*[ >]/,'is');class Pi extends/* #__PURE__ -- @preserve */
24
- ct(){['editor'];['textAdapter'];['view'];['_sanitizationContainer'];['_domParser'];['_xmlSerializer'];constructor(_0xd7182d,_0x227076,_0x1cce70){super(),this['editor']=_0xd7182d,this['textAdapter']=_0x227076,this['_sanitizationContainer']=document['createElement']('div'),this['_domParser']=new DOMParser(),this['_xmlSerializer']=new XMLSerializer(),this['view']=_0x1cce70,this['set']({'initialContext':'','currentContext':'','currentResponse':'','previousContext':void 0x0,'previousQuery':void 0x0,'previousLabel':void 0x0,'isProcessing':!0x1}),this['on']('set:currentContext',(_0x5c393c,_0x1679ac,_0x2ff644)=>{this['view']['value']=this['_sanitizeHTML'](_0x2ff644);}),this['listenTo'](this['view'],'submitPrompt',(_0x2be4fc,_0x514bf7)=>{const _0x4d4670=this['currentContext']||this['initialContext'];this['_handleQuery'](_0x514bf7,_0x4d4670,'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:_0x224780,query:_0x160896,htmlContent:_0xb6642,label:_0x469663,mainActionLabel:_0x18a63e}){this['view']['prompt']=_0x469663,this['view']['mainAction']=_0x18a63e,this['initialContext']=_0xb6642,_0x160896&&(this['view']['isRendered']?this['_handleQuery'](_0x160896,_0xb6642,_0x224780,_0x469663):this['view']['once']('render',()=>{this['_handleQuery'](_0x160896,_0xb6642,_0x224780,_0x469663);}));}['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'](_0x1626f3,_0x3a1ffb,_0x3437f3,_0x297d56){return this['isProcessing']=!0x0,this['view']['startProcessing'](),this['previousContext']=_0x3a1ffb,this['previousQuery']=_0x1626f3,this['previousLabel']=_0x297d56||_0x1626f3,this['previousActionId']=_0x3437f3,new Promise(_0x5c091d=>{this['textAdapter']['makeRequest']({'query':_0x1626f3,'context':_0x3a1ffb,'onData':_0x19da0c=>{this['currentResponse']=_0x19da0c,this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse']);},'actionId':_0x3437f3})['then'](()=>{!this['currentContext']&&this['currentResponse']&&(this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse'],!0x0));})['catch'](_0x1516d9=>{_0x1516d9 instanceof vi?this['view']['handleError'](_0x1516d9['message']):this['view']['handleError'](),_0x5c091d();})['finally'](()=>{this['stopProcessing'](),_0x5c091d();});});}['_parseAndNormalizeContent'](_0x15bbf6,_0x599630=!0x1){const _0x5569be=Di['exec'](_0x15bbf6);_0x15bbf6=_0x5569be?_0x15bbf6['substring'](_0x5569be[0x1]['length']):_0x15bbf6['length']<0x64&&!_0x599630?'':this['_stripMarkdownSyntax'](_0x15bbf6);const _0x209b9b=this['_domParser']['parseFromString'](_0x15bbf6,'text/html');if(_0x5569be){const _0x571364=Array['from'](_0x209b9b['body']['childNodes']);_0x571364['reverse']();for(const _0x101eac of _0x571364){if(_0x101eac['nodeType']==Node['ELEMENT_NODE'])break;_0x101eac['remove']();}}const _0x107635=this['editor']['data']['processor']['toView'](this['_xmlSerializer']['serializeToString'](_0x209b9b['body']));this['_isH1TagSupportEnabled']()||this['_normalizeResponseHeadings'](_0x107635);const _0x3aea6d=this['editor']['config']['get']('ai.assistant.preserveComments'),_0x597cec=this['editor']['data']['toModel'](_0x107635);return _0x3aea6d||_0x597cec['markers']['clear'](),this['editor']['data']['stringify'](_0x597cec);}['_normalizeResponseHeadings'](_0x31a2df){const _0x1a4e19=new _0x49cc34(this['editor']['editing']['view']['document']),_0xd97b3b=new _0x2bcde7({'name':/^h[1-5]$/}),_0x46f7c9=[];let _0x7ac903=!0x1;for(const _0x1a93c9 of _0x31a2df)_0x1a93c9['is']('element')&&_0xd97b3b['match'](_0x1a93c9)&&(_0x46f7c9['push'](_0x1a93c9),'h1'==_0x1a93c9['name']&&(_0x7ac903=!0x0));if(_0x7ac903){for(const _0x4760ff of _0x46f7c9)_0x1a4e19['rename']('h'+(parseInt(_0x4760ff['name'][0x1])+0x1),_0x4760ff);}}['_isH1TagSupportEnabled'](){const {data:_0x108fe9,editing:_0x549a86}=this['editor'],_0x1fc04d=_0x108fe9['htmlProcessor']['toView']('<h1></h1>'),_0x1e529b=_0x108fe9['toView'](_0x108fe9['toModel'](_0x1fc04d));return!!_0x549a86['view']['domConverter']['viewToDom'](_0x1e529b)['querySelector']('h1');}['_sanitizeHTML'](_0x5461f6){return this['editor']['editing']['view']['domConverter']['setContentOf'](this['_sanitizationContainer'],_0x5461f6),this['_sanitizationContainer']['innerHTML'];}['_stripMarkdownSyntax'](_0xb775cd){const _0x1db91b=_0xb775cd['trim']();return _0x1db91b['startsWith']('```html')?_0x1db91b['endsWith']('```')?_0x1db91b['substring'](0x7,_0x1db91b['length']-0x3):_0x1db91b['substring'](0x7):_0xb775cd;}}const Hi={'REPLACE':'replace','INSERT':'insert'};class Mi extends kt{constructor(_0x2dec84){super(_0x2dec84),this['set']('isVisible',!0x1),this['set']('mainAction',Hi['REPLACE']),this['replaceButton']=this['_createButton']('','ck-button-action'),this['replaceButton']['bind']('label')['to'](this,'mainAction',_0xb27710=>yi(_0x2dec84,'AI_'+_0xb27710['toUpperCase']()+'_CONTENT')),this['insertButton']=this['_createButton'](yi(_0x2dec84,'Insert\x20below')),this['tryAgainButton']=this['_createButton'](yi(_0x2dec84,'Try\x20again')),this['stopButton']=this['_createButton'](yi(_0x2dec84,'Stop'));const _0x12e874=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-form__toolbar',_0x12e874['if']('isVisible','ck-hidden',_0x2fde29=>!_0x2fde29)]}}),this['items']['addMany']([this['replaceButton'],this['insertButton'],this['tryAgainButton'],this['stopButton']]);}['_createButton'](_0x5e1965,_0x4bd254){const _0x134165=new Nt(this['locale']);return _0x134165['set']({'label':_0x5e1965,'class':_0x4bd254||'','isVisible':!0x0,'withText':!0x0}),_0x134165;}}class Ui extends vt{['contentFieldView'];['copyButtonView'];constructor(_0x259793,_0x5844c0=''){super(_0x259793),this['set']({'value':null,'isVisible':!0x1,'isProcessing':!0x1});const _0x571aa4=this['bindTemplate'];this['contentFieldView']=new Vi(_0x259793,_0x5844c0),this['copyButtonView']=this['_createCopyButton'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area-wrapper',_0x571aa4['if']('isVisible','ck-hidden',_0xf30ed5=>!_0xf30ed5)],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area',_0x571aa4['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 _0x335492=!0x1;this['on']('change:value',(_0x10fe73,_0x365be2,_0x4db948)=>{const _0xb57170=!this['contentFieldView']['element']['querySelector']('.ck-ai-form__loader');this['contentFieldView']['setContent'](_0x4db948),this['isProcessing']&&_0xb57170&&!_0x335492&&this['element']['scrollTo']({'top':this['element']['scrollHeight'],'behavior':'smooth'});}),this['on']('change:isProcessing',(_0x34c137,_0x95ca73,_0x21f940)=>{_0x335492=!0x1,_0x21f940?(this['value']=null,this['contentFieldView']['appendLoader']()):this['value']||this['contentFieldView']['setContent']('');}),this['listenTo'](this['element'],'wheel',()=>{_0x335492=!0x0;}),this['listenTo'](this['element'],'mousedown',()=>{_0x335492=!0x0;});}['focus'](){this['element']['focus']();}['_createCopyButton'](){const _0x2aab61=this['locale'],_0x404b07=new Nt(this['locale']),_0x50dff8='ck-ai-form__copy-button';return _0x404b07['set']({'label':yi(_0x2aab61,'Copy'),'icon':_0xea2377,'class':_0x50dff8,'tooltip':!0x0}),_0x404b07['bind']('isVisible')['to'](this,'value',_0x6ae1d=>!!_0x6ae1d),_0x404b07['bind']('isEnabled')['to'](this,'isProcessing',_0x506381=>!_0x506381),_0x404b07['on']('execute',()=>{this['_copyHTMLToClipboard'](this['contentFieldView']['element']),_0x404b07['icon']=_0xef6224,_0x404b07['class']=_0x50dff8+'\x20ck-ai-form__copy-button--copied',this['focus'](),setTimeout(()=>{_0x404b07['icon']=_0xea2377,_0x404b07['class']=_0x50dff8;},0x3e8);}),_0x404b07;}['_copyHTMLToClipboard'](_0x574ff5){const {window:_0x59ee50,document:_0x4d533a}=lt;if(_0x59ee50['ClipboardItem']){const {Blob:_0x3706b6,ClipboardItem:_0x203b9b}=_0x59ee50,_0x49cd24=[new _0x203b9b({'text/html':new _0x3706b6([_0x574ff5['innerHTML']],{'type':'text/html'}),'text/plain':new _0x3706b6([_0x574ff5['textContent']||''],{'type':'text/plain'})})];navigator['clipboard']['write'](_0x49cd24);}else{const _0xa88804=_0x4d533a['createElement']('div');_0xa88804['style']['position']='absolute',_0xa88804['style']['left']='-9999px',_0xa88804['innerHTML']='<span>[</span>'+_0x574ff5['innerHTML']+'<span>]</span>',_0x4d533a['body']['appendChild'](_0xa88804);const _0x2d72b6=_0x4d533a['createRange']();_0x2d72b6['setStartAfter'](_0xa88804['firstElementChild']),_0x2d72b6['setEndBefore'](_0xa88804['lastElementChild']);const _0xa26704=_0x59ee50['getSelection']();_0xa26704['removeAllRanges'](),_0xa26704['addRange'](_0x2d72b6),_0x4d533a['execCommand']('copy'),_0xa88804['remove']();}}}class Vi extends vt{constructor(_0x391b24,_0x4ec31e=''){super(_0x391b24),this['loaderView']=this['_createLoader'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content',_0x4ec31e,'ck-reset_all-excluded','ck-ai-form__content-field']}});}['setContent'](_0x431a40){this['element']['innerHTML']=_0x431a40;}['appendLoader'](){this['element']['appendChild'](this['loaderView']['element']);}['_createLoader'](){const _0x1f77fb=new vt(),_0x2980c4=this['locale'],_0x2f00a2=new yt();return _0x2f00a2['isVisible']=!0x0,_0x1f77fb['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__loader']},'children':[_0x2f00a2,{'text':yi(_0x2980c4,'AI\x20is\x20writing...')}]}),_0x1f77fb['render'](),_0x1f77fb;}}class Bi extends vt{constructor(_0x5cca36,_0x21d94c=''){super(_0x5cca36);const _0xaf4274=new xt(),_0x1ba420=this['bindTemplate'];this['set']('text',_0x21d94c),_0xaf4274['content']=_0x2f4342,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__error']},'children':[_0xaf4274,{'text':_0x1ba420['to']('text')}]});}}class Gi extends Lt{['submitButtonView'];['showHistoryButtonView'];constructor(_0x1137a2,_0x4d0c54){super(_0x1137a2,_0x4d0c54),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',(_0x198aaa,_0x4b4a71)=>{_0x198aaa['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0x4b4a71());});}['_createSubmitButton'](){const _0x219e91=new Nt(this['locale']),_0x436949=this['locale'];return _0x219e91['set']({'icon':_0xb85aa1,'label':yi(_0x436949,'Submit'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-form__submit'}),_0x219e91['on']('execute',()=>{this['submit']();}),_0x219e91['bind']('isEnabled')['to'](this['queryView']['fieldView'],'isEmpty',this,'isEnabled',(_0x3a7a1e,_0x781ef0)=>!_0x3a7a1e&&_0x781ef0),_0x219e91;}['_createShowHistoryButton'](){const _0xacb1f3=new Nt(this['locale']),_0x427212=this['resultsView'],_0x1f9bb3=this['locale'];_0xacb1f3['set']({'label':yi(_0x1f9bb3,'History'),'withText':!0x1,'icon':_0x390cb7,'tooltip':!0x0,'tooltipPosition':'sw','class':'ck-ai-form__toggle-history'}),_0xacb1f3['bind']('isOn')['to'](_0x427212,'isVisible'),_0xacb1f3['bind']('isEnabled')['to'](this,'isEnabled'),_0xacb1f3['on']('execute',()=>{_0x427212['isVisible']=!_0x427212['isVisible'],_0x427212['isVisible']?this['filteredView']['focus']():this['focus']();});const _0x3d7c5a=()=>{lt['window']['requestAnimationFrame'](()=>{if(ut(this['element'])){const _0x37799a=new dt(this['queryView']['fieldView']['element']),_0x599fda=_0x37799a['width'],_0x4a13f8='rtl'===_0x1f9bb3['uiLanguageDirection']?'left':'right';_0x37799a['excludeScrollbarsAndBorders'](),_0xacb1f3['element']['style'][_0x4a13f8]=_0x599fda-_0x37799a['width']+0x1+'px';}});};return this['queryView']['fieldView']['on']('update',_0x3d7c5a),this['on']('render',_0x3d7c5a),_0xacb1f3;}['submit'](){const _0x26c2db=this['queryView']['fieldView']['element']['value'];this['fire']('submit',_0x26c2db);}['focus'](_0x967b3d){-0x1===_0x967b3d?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}}class Fi extends Dt{['historyGroupView'];['clearHistoryButton'];constructor(_0x98571b){super(_0x98571b),this['clearHistoryButton']=this['_createClearHistoryButton'](),this['historyGroupView']=new Pt(),this['historyGroupView']['children']['add'](this['clearHistoryButton'],0x1),this['historyGroupView']['label']=yi(_0x98571b,'Prompt\x20history'),this['historyGroupView']['items']['delegate']('execute')['to'](this),this['items']['add'](this['historyGroupView']);}['filter'](){let _0x3eb5fc=0x0;for(const _0x5946cb of this['items'])_0x3eb5fc+=_0x5946cb['items']['length'];return{'resultsCount':_0x3eb5fc,'totalItemsCount':_0x3eb5fc};}['_createClearHistoryButton'](){const _0x987c0=this['locale'],_0x4a5970=new Nt(this['locale']);return _0x4a5970['set']({'label':'('+yi(_0x987c0,'Clear')+')','withText':!0x0}),_0x4a5970['on']('execute',()=>this['fire']('clearHistory')),_0x4a5970;}}class Ki extends Ht{constructor(_0x4e78f9){super();const _0x2c5ecb=new Mt(),_0x33ba1b=new Nt(this['locale'],_0x2c5ecb);this['children']['add'](_0x33ba1b),_0x33ba1b['set']({'label':_0x4e78f9['prompt'],'withText':!0x0}),_0x33ba1b['on']('execute',()=>{this['fire']('execute',{'value':_0x40837c(_0x4e78f9['prompt'])});});}}const Wi='CKEditor/AIFormView/PromptHistory';class Yi extends _t{constructor(){super(),this['_loadFromSessionStorage'](),this['on']('add',(_0x138543,_0x1fadd8)=>{const _0x2c8a2a=$i(_0x1fadd8['prompt']);for(const _0x5ec44e of this)if(_0x5ec44e!=_0x1fadd8&&$i(_0x5ec44e['prompt'])===_0x2c8a2a){this['remove'](_0x5ec44e);break;}this['length']>0x14&&this['remove'](this['last']),this['_saveToSessionStorage']();}),this['on']('remove',()=>{this['_saveToSessionStorage']();});}['_loadFromSessionStorage'](){const _0x3f440d=sessionStorage['getItem'](Wi)||'[]';this['addMany'](JSON['parse'](_0x3f440d));}['_saveToSessionStorage'](){sessionStorage['setItem'](Wi,JSON['stringify'](this['map'](_0x54175f=>_0x54175f)));}}function $i(_0x4221ea){return _0x4221ea['toLowerCase']()['trim']();}class qi extends vt{['focusTracker'];['keystrokes'];['contentArea'];['toolbar'];['promptView'];['errorView'];['_focusables'];['focusCycler'];['_promptHistory'];constructor(_0x2cecd2,_0x42c5ab,_0x28e14a=''){super(_0x2cecd2),this['set']('isEnabled',!0x0),this['set']('isProcessing',!0x1),this['set']('prompt',''),this['set']('value',''),this['set']('isError',!0x1),this['set']('mainAction',Hi['REPLACE']),this['_promptHistory']=new Yi(),this['errorView']=new Bi(_0x2cecd2),this['contentArea']=new Ui(_0x2cecd2,_0x28e14a),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 At(),this['keystrokes']=new gt(),this['_focusables']=this['createCollection']([this['contentArea'],this['contentArea']['copyButtonView'],this['toolbar'],this['promptView']]),this['focusCycler']=new Ut({'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 _0x1c9b6c=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form',_0x42c5ab],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form-content']},'children':[{'tag':'div','attributes':{'class':[_0x1c9b6c['if']('isError','ck-hidden',_0x432db3=>!_0x432db3)]},'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'](_0x144d06=0x1){-0x1===_0x144d06?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 _0x4b2481=this['locale'],_0x4b0141=new Gi(_0x4b2481,{'queryView':{'label':yi(_0x4b2481,'Ask\x20AI\x20to\x20edit\x20or\x20generate'),'creator':Vt,'showIcon':!0x1,'showResetButton':!0x1},'infoView':{'text':{'noSearchableItems':{'primary':yi(_0x4b2481,'Empty\x20history'),'secondary':yi(_0x4b2481,'Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.')}}},'filteredView':this['_createHistoryView'](),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1});return _0x4b0141['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x3e887c,_0x12618f)=>_0x3e887c&&!_0x12618f),this['listenTo'](_0x4b0141,'submit',(_0x31e6ce,_0x18621e)=>{this['prompt']=_0x18621e;const _0x3f1b03=_0x2d90f2(_0x18621e);this['fire']('submitPrompt',_0x3f1b03),_0x18621e['trim']()&&this['_promptHistory']['add']({'prompt':_0x3f1b03},0x0);},{'priority':'high'}),_0x4b0141;}['_createHistoryView'](){const _0x207865=new Fi(this['locale']);return _0x207865['historyGroupView']['items']['bindTo'](this['_promptHistory'])['as'](Ki),_0x207865['on']('clearHistory',()=>{this['_promptHistory']['clear'](),this['promptView']['search'](''),this['promptView']['focus']();}),_0x207865;}['_createToolbar'](){const _0x5eef23=new Mi(this['locale']);return _0x5eef23['replaceButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x16f8f2,_0x5464e8,_0x392bb9)=>_0x16f8f2&&!_0x5464e8&&!!_0x392bb9),_0x5eef23['replaceButton']['delegate']('execute')['to'](this,'replaceContent'),_0x5eef23['insertButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x1588e4,_0x11d121,_0x52ea74)=>_0x1588e4&&!_0x11d121&&!!_0x52ea74),_0x5eef23['insertButton']['delegate']('execute')['to'](this,'insertContentBelow'),_0x5eef23['tryAgainButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x4de6b7,_0x2e5dd1)=>_0x4de6b7&&!_0x2e5dd1),_0x5eef23['tryAgainButton']['delegate']('execute')['to'](this,'tryAgainEvent'),_0x5eef23['stopButton']['bind']('isEnabled')['to'](this,'isProcessing'),_0x5eef23['stopButton']['delegate']('execute')['to'](this,'stopProcessing'),_0x5eef23;}['startProcessing'](){this['value']='',this['isError']=!0x1,this['isProcessing']=!0x0,this['contentArea']['isVisible']=!0x0,this['toolbar']['isVisible']=!0x0,this['contentArea']['focus']();}['finishProcessing'](){const _0x30f5a9=this['locale'];this['isProcessing']=!0x1,this['prompt']='',this['promptView']['reset'](),this['value']&&(this['promptView']['queryView']['label']=yi(_0x30f5a9,'Ask\x20AI\x20to\x20improve\x20generated\x20text'));}['handleError'](_0x56af4b){const _0x760a53=this['locale'];this['finishProcessing'](),this['isError']=!0x0,this['errorView']['text']=_0x56af4b||yi(_0x760a53,'AI_ERROR_FAILED'),this['value']||(this['contentArea']['isVisible']=!0x1);}}const Qi=globalThis['DataTransfer'];class Xi extends _0x12af0a{['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[_0x510cca,ki,Ni,Bt];}constructor(_0x1f56fb){super(_0x1f56fb),_0x1f56fb['config']['define']('ai.assistant.disabledElements',['media','rawHtml','tableOfContents']),_0x1f56fb['config']['define']('ai.assistant.contentAreaCssClass',''),_0x1f56fb['config']['define']('ai.assistant.useTheme',!0x0),this['_uiCssClasses']='ck-ai-assistant-ui'+(_0x1f56fb['config']['get']('ai.assistant.useTheme')?'\x20ck-ai-assistant-ui_theme':'');}['init'](){const {editor:_0x59ccf6}=this;this['_aiAdapter']=_0x59ccf6['plugins']['get'](Ni),this['_dialog']=_0x59ccf6['plugins']['get'](Bt),this['_formView']=null,this['_commandDefinitions']=this['_getResolvedCommandsDefinitions']();const _0x17c244=new xi(_0x59ccf6,Array['from'](this['_commandDefinitions']['values']()));_0x59ccf6['commands']['add']('showAIAssistant',_0x17c244),_0x59ccf6['ui']['componentFactory']['add']('aiCommands',_0x29cc57=>{const _0x429ce5=Gt(_0x29cc57);return _0x429ce5['set']({'class':'ck-ai-commands-dropdown\x20'+this['_uiCssClasses']}),_0x429ce5['buttonView']['set']({'label':yi(_0x29cc57,'AI\x20Commands'),'icon':_0x378522,'tooltip':!0x0}),_0x429ce5['on']('execute',_0xb6e3be=>this['_onExecute'](_0xb6e3be['source']['id'])),Ft(_0x429ce5,_0x59ccf6['ui']['view']['body'],function(_0x3578a7){const _0x30177a=bi(_0x3578a7['config']['get']('ai.assistant.commands'),_0x3578a7['locale']),_0x3e6efa=ji(_0x3578a7,_0x30177a)['filter'](_0x5b33e9=>_0x5b33e9['commands']['length']);if(0x1===_0x3e6efa['length'])return ji(_0x3578a7,_0x3e6efa[0x0]['commands'])['map'](_0x2e432d=>({'id':_0x2e432d['id'],'label':_0x2e432d['label']}));return _0x3e6efa['map'](_0x20655f=>{const {groupId:_0x5704f9,groupLabel:_0x89ea67,commands:_0x432b70}=_0x20655f,_0x4c6f64=ji(_0x3578a7,_0x432b70)['map'](_0x25a84=>({'id':_0x25a84['id'],'label':_0x25a84['label']}));return{'id':_0x5704f9,'menu':_0x89ea67||_0x5704f9,'children':_0x4c6f64};});}(_0x59ccf6),{'ariaLabel':yi(_0x29cc57,'AI\x20Commands')}),_0x429ce5['menuView']['menuPanelClass']='ck-ai-commands-dropdown\x20'+this['_uiCssClasses'],_0x17c244['on']('change:enabledCommandsIds',_0x1cd3a4),_0x429ce5['menuView']['once']('render',_0x1cd3a4),_0x429ce5;function _0x1cd3a4(){_0x429ce5['isEnabled']=_0x17c244['enabledCommandsIds']['length']>0x0;for(const _0x19c2e6 of _0x429ce5['menuView']['buttons'])_0x19c2e6['isEnabled']=_0x17c244['enabledCommandsIds']['includes'](_0x19c2e6['id']);}}),_0x59ccf6['ui']['componentFactory']['add']('menuBar:aiCommands',_0xc2ca30=>{const _0x43a8ff=new Kt(_0xc2ca30);_0x43a8ff['buttonView']['set']({'label':yi(_0xc2ca30,'AI\x20Commands'),'icon':_0x378522}),_0x43a8ff['bind']('isEnabled')['to'](_0x17c244,'enabledCommandsIds',_0x28a1e3=>_0x28a1e3['length']>0x0);const _0x32b76e=bi(_0x59ccf6['config']['get']('ai.assistant.commands'),_0xc2ca30);return this['_populateMenuBarMenu'](_0x17c244,_0x43a8ff,_0x32b76e,_0x200338=>this['_onExecute'](_0x200338)),_0x43a8ff;}),_0x59ccf6['ui']['componentFactory']['add']('aiAssistant',()=>{const _0x1a1208=this['_createAIAssistantUIButton'](Nt);return _0x1a1208['set']({'tooltip':!0x0,'class':'ck-ai-assistant-button\x20'+this['_uiCssClasses']}),_0x1a1208;}),_0x59ccf6['ui']['componentFactory']['add']('menuBar:aiAssistant',()=>{const _0xd18f83=this['_createAIAssistantUIButton'](Wt);return _0xd18f83['set']({'role':'menuitemcheckbox'}),_0xd18f83;}),this['licenseKey']=this['editor']['config']['get']('licenseKey');const _0x3f45d8=this['editor'];this['_licenseKeyCheckInterval']=setInterval(()=>{let _0x3da00b;for(const _0x5a4658 in _0x3f45d8){const _0x21f0fb=_0x5a4658,_0x5d468c=_0x3f45d8[_0x21f0fb];if('aiLicenseKeyValid'==_0x5d468c||'aiLicenseKeyInvalid'==_0x5d468c||'aiLicenseKeyExpired'==_0x5d468c||'aiLicenseKeyDomainLimit'==_0x5d468c||'aiLicenseKeyNotAllowed'==_0x5d468c||'aiLicenseKeyEvaluationLimit'==_0x5d468c||'aiLicenseKeyUsageLimit'==_0x5d468c){delete _0x3f45d8[_0x21f0fb],_0x3da00b=_0x5d468c,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'aiLicenseKeyInvalid'==_0x3da00b&&_0x3f45d8['_showLicenseError']('invalid'),'aiLicenseKeyExpired'==_0x3da00b&&_0x3f45d8['_showLicenseError']('expired'),'aiLicenseKeyDomainLimit'==_0x3da00b&&_0x3f45d8['_showLicenseError']('domainLimit'),'aiLicenseKeyNotAllowed'==_0x3da00b&&_0x3f45d8['_showLicenseError']('featureNotAllowed','AIAssistant'),'aiLicenseKeyEvaluationLimit'==_0x3da00b&&_0x3f45d8['_showLicenseError']('evaluationLimit'),'aiLicenseKeyUsageLimit'==_0x3da00b&&_0x3f45d8['_showLicenseError']('usageLimit');},0x3e8);}['destroy'](){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}['showUI'](_0x38fbcd='',_0x1aed8c='',_0x41858b='custom'){const _0x1ae303=this['editor'],_0x186021=_0x1ae303['editing']['view'],_0x5374e5=_0x1ae303['plugins']['get'](ki),_0x596fa8=_0x1ae303['plugins']['get'](_0x510cca);_0x5374e5['showFakeVisualSelection']();const _0x1115b9=new Qi(),_0x449cbf=new ClipboardEvent('copy',{'clipboardData':_0x1115b9}),_0x593033=new _0x1979be(_0x1115b9),_0x11d0f4=new _0x3cb0bc(_0x186021,_0x449cbf,{'dataTransfer':_0x593033});_0x596fa8['_forceMarkersCopy']('comment',()=>{_0x186021['document']['fire']('copy',_0x11d0f4);}),this['_formView']||(this['_initView'](),this['_aiAssistantController']=new Pi(_0x1ae303,this['_aiAdapter']['textAdapter'],this['_formView']));let _0x321a4c=_0x593033['getData']('text/html');const _0xcbd7f5=_0x1ae303['model']['document']['selection'],_0x368298=Array['from'](_0xcbd7f5['getRanges']());0x1===_0x368298['length']&&_0x368298[0x0]['isFlat']&&!_0xcbd7f5['getSelectedElement']()&&''!==_0x321a4c['replace'](/&nbsp;/g,'')['trim']()&&(_0x321a4c='<p>'+_0x321a4c+'</p>'),this['_aiAssistantController']['updateView']({'actionId':_0x41858b,'query':_0x38fbcd,'htmlContent':_0x321a4c,'label':_0x1aed8c,'mainActionLabel':Hi[_0x1ae303['model']['document']['selection']['isCollapsed']?'INSERT':'REPLACE']}),'aiAssistant'!==this['_dialog']['id']?this['_dialog']['show']({'id':'aiAssistant','icon':_0x16f9ab,'title':yi(this['editor']['locale'],'AI\x20Assistant'),'content':this['_formView'],'position':Yt['EDITOR_TOP_SIDE'],'onShow':()=>{this['_formView']['focus']();},'onHide':()=>{this['_aiAssistantController']['reset'](),_0x5374e5['hideFakeVisualSelection']();}}):this['_dialog']['view']['wasMoved']||this['_dialog']['view']['updatePosition']();}['hideUI'](){this['_dialog']['hide']();}['_getResolvedCommandsDefinitions'](){const _0x32e833=new Map(),_0x21846f=bi(this['editor']['config']['get']('ai.assistant.commands'),this['editor']['locale']);for(const _0x4fed02 of _0x21846f)for(const _0x5cba83 of _0x4fed02['commands'])_0x32e833['set'](_0x5cba83['id'],{..._0x5cba83,'groupId':_0x4fed02['groupId'],'groupLabel':_0x4fed02['groupLabel']||_0x4fed02['groupId']});return _0x32e833;}['_createAIAssistantUIButton'](_0x52b642){const _0xb73c62=this['editor'],_0xffec46=_0xb73c62['commands']['get']('showAIAssistant'),_0x26719d=new _0x52b642(_0xb73c62['locale']);return _0x26719d['set']({'label':yi(_0xb73c62['locale'],'AI\x20Assistant'),'icon':_0x16f9ab,'isToggleable':!0x0}),_0x26719d['bind']('isEnabled')['to'](_0xffec46),_0x26719d['bind']('isOn')['to'](this['_dialog'],'id',_0x1ebec1=>'aiAssistant'===_0x1ebec1),this['listenTo'](_0x26719d,'execute',()=>{_0x26719d['isOn']?this['hideUI']():_0xffec46['execute']();}),_0x26719d;}['_initView'](){const _0x4cc545=this['editor']['plugins']['get'](ki);this['_formView']=new qi(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',()=>{_0x4cc545['insertContent'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['listenTo'](this['_formView'],'insertContentBelow',()=>{_0x4cc545['insertContentBelow'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['_initAriaAiStatusChangeAnnouncements']();}['_initAriaAiStatusChangeAnnouncements'](){const {locale:_0x3d82c2,ui:{ariaLiveAnnouncer:_0x23ddc7}}=this['editor'];this['_formView']['contentArea']['on']('change:isProcessing',(_0x56a365,_0x29c7e9,_0x2e39ca)=>{const _0x81d0d=this['_aiAssistantController']['currentContext'];_0x2e39ca?_0x23ddc7['announce'](yi(_0x3d82c2,'AI\x20is\x20writing')):_0x81d0d&&_0x23ddc7['announce'](yi(_0x3d82c2,'Generated\x20content:\x20%0',_0x81d0d),{'politeness':'polite','isUnsafeHTML':!0x0});}),this['_formView']['on']('change:isError',(_0x332931,_0x15d292,_0x33274e)=>{if(_0x33274e){const _0x25da22=this['_formView']['errorView']['text'];_0x23ddc7['announce'](yi(_0x3d82c2,'Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x25da22));}});}['_onExecute'](_0x1a7330){const _0x3e2e9e=this['_commandDefinitions']['get'](_0x1a7330),_0x36684f=this['editor'],_0x2da165=_0x36684f['model']['document']['selection'],_0x3b42b3=_0x36684f['commands']['get']('showAIAssistant'),_0x2449b8=_0x36684f['plugins']['get'](ki),_0x30f89c=''+(_0x3e2e9e['groupId']!==Si?_0x3e2e9e['groupLabel']+':\x20':'')+_0x3e2e9e['label'];if(!0x1!==_0x3e2e9e['requiresContent']&&_0x2da165['isCollapsed']){const _0x58a356=It(_0x2da165['getSelectedBlocks']())||_0x36684f['model']['schema']['getLimitElement'](_0x2da165);_0x36684f['model']['change'](_0x4522b2=>{_0x4522b2['setSelection'](_0x58a356,'in');});}_0x2449b8['showFakeVisualSelection'](),_0x3b42b3['execute'](_0x3e2e9e['prompt'],_0x30f89c,'command:'+_0x1a7330);}['_populateMenuBarMenu'](_0x1409af,_0x9a43b7,_0xc64b1a,_0x15cc99){const _0x46c080=this['editor'],_0x3b1781=_0x46c080['locale'],_0x379a06=new $t(_0x3b1781),_0x25ba6f=ji(_0x46c080,_0xc64b1a)['filter'](_0x12a66b=>_0x12a66b['commands']['length']);0x1===_0x25ba6f['length']?this['_getMenuBarGroupButtons']({'command':_0x1409af,'commands':_0x25ba6f[0x0]['commands'],'parentMenuView':_0x9a43b7,'onExecute':_0x15cc99})['forEach'](_0x4af72a=>_0x379a06['items']['add'](_0x4af72a)):_0x25ba6f['forEach'](({groupId:_0xda7761,groupLabel:_0xb0b151,commands:_0x33e162})=>{const _0x47dd48=new qt(_0x3b1781,_0x9a43b7),_0x3201e9=new Kt(_0x3b1781),_0x1754ed=new $t(_0x3b1781),_0x16af47=this['_getMenuBarGroupButtons']({'command':_0x1409af,'commands':_0x33e162,'parentMenuView':_0x3201e9,'onExecute':_0x15cc99});_0x3201e9['buttonView']['set']({'label':_0xb0b151||_0xda7761}),_0x3201e9['delegate']('execute')['to'](_0x9a43b7),_0x1754ed['items']['addMany'](_0x16af47),_0x3201e9['panelView']['children']['add'](_0x1754ed),_0x47dd48['children']['add'](_0x3201e9),_0x379a06['items']['add'](_0x47dd48);}),_0x9a43b7['panelView']['children']['add'](_0x379a06);}['_getMenuBarGroupButtons']({command:_0x313f39,commands:_0x35fd03,parentMenuView:_0x5a6f9a,onExecute:_0x1c16fd}){const _0x11f4fa=this['editor'],_0x405010=_0x11f4fa['locale'];return ji(_0x11f4fa,_0x35fd03)['map'](_0x1cb42b=>{const _0x266a2d=new qt(_0x405010,_0x5a6f9a),_0x5ad517=new Wt(_0x405010);return _0x5ad517['set']({'label':_0x1cb42b['label']}),_0x5ad517['delegate']('execute')['to'](_0x5a6f9a),_0x5ad517['on']('execute',()=>_0x1c16fd(_0x1cb42b['id'])),_0x5ad517['bind']('isEnabled')['to'](_0x313f39,'enabledCommandsIds',_0xf2e8f7=>_0xf2e8f7['includes'](_0x1cb42b['id'])),_0x266a2d['children']['add'](_0x5ad517),_0x266a2d;});}}function zi(_0x28332f,_0x5204f4){return void 0x0!==_0x28332f['order']&&void 0x0===_0x5204f4['order']?0x1:void 0x0===_0x28332f['order']&&void 0x0!==_0x5204f4['order']?-0x1:void 0x0!==_0x28332f['order']&&void 0x0!==_0x5204f4['order']?_0x28332f['order']-_0x5204f4['order']:0x0;}function ji(_0x42a13d,_0x27bd9d){_0x27bd9d['sort'](zi);const _0x3cb3e7={},_0x14b552=[];for(const _0x1e1e87 of _0x27bd9d)if(void 0x0!==_0x1e1e87['order']){if(_0x1e1e87['order']in _0x3cb3e7)throw new ht('ai-commands-config-order-collision',_0x42a13d,{'conflictingDefinitions':[_0x1e1e87,_0x3cb3e7[_0x1e1e87['order']]]});_0x3cb3e7[_0x1e1e87['order']]=_0x1e1e87,_0x14b552['splice'](_0x1e1e87['order'],0x0,_0x1e1e87);}else _0x14b552['push'](_0x1e1e87);return _0x14b552;}class Ji extends _0x12af0a{static get['requires'](){return[Xi,ki];}static get['pluginName'](){return'AIAssistant';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x2dca16){super(_0x2dca16);const _0xfd7549=_0x2dca16['config'],_0x39fda1=_0x2dca16['locale'];_0xfd7549['define']('ai.assistant.preserveComments',!0x0),_0xfd7549['define']('ai.assistant.commands',Zi(_0x39fda1)),_0xfd7549['define']('ai.assistant.extraCommandGroups',[]),_0xfd7549['define']('ai.assistant.removeCommands',[]);let _0x2e76ef=bi(_0xfd7549['get']('ai.assistant.commands'),_0x39fda1);const _0x5b3ddc=_0xfd7549['get']('ai.assistant.extraCommandGroups'),_0x2dbbfe=_0xfd7549['get']('ai.assistant.removeCommands');_0x5b3ddc['forEach'](_0xa3be75=>{const _0x3f723b=_0x2e76ef['find'](_0x282d36=>_0x282d36['groupId']===_0xa3be75['groupId']);_0x3f723b?_0x3f723b['commands']=_0x3f723b['commands']['concat'](_0xa3be75['commands']):_0x2e76ef['push'](_0xa3be75);}),_0x2e76ef=_0x2e76ef['filter'](_0x53d117=>!_0x2dbbfe['includes'](_0x53d117['groupId'])),_0x2e76ef['forEach'](_0x41bfef=>{_0x41bfef['commands']=_0x41bfef['commands']['filter'](_0x31c425=>!_0x2dbbfe['includes'](_0x31c425['id']));}),_0xfd7549['set']('ai.assistant.commands',_0x2e76ef);}}function Zi(_0xc6a373){return[{'groupId':'editOrReview','groupLabel':yi(_0xc6a373,'Edit\x20or\x20review'),'commands':[{'id':'improveWriting','label':yi(_0xc6a373,'Improve\x20writing'),'prompt':'Fix\x20spelling\x20mistakes,\x20use\x20proper\x20grammar\x20and\x20apply\x20good\x20writing\x20practices.\x20Do\x20not\x20lose\x20the\x20original\x20meaning.'},{'id':'makeShorter','label':yi(_0xc6a373,'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':yi(_0xc6a373,'Make\x20longer'),'prompt':'Improve\x20this\x20content\x20by\x20using\x20descriptive\x20language\x20and\x20inserting\x20more\x20information\x20and\x20more\x20detailed\x20explanations.'},{'id':'simplifyLanguage','label':yi(_0xc6a373,'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':yi(_0xc6a373,'Generate\x20from\x20selection'),'commands':[{'id':'summarize','label':yi(_0xc6a373,'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':yi(_0xc6a373,'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':yi(_0xc6a373,'Change\x20tone'),'commands':[{'id':'professional','label':yi(_0xc6a373,'Professional'),'prompt':'Improve\x20using\x20polished,\x20formal,\x20and\x20respectful\x20language\x20to\x20convey\x20professional\x20expertise\x20and\x20competence.'},{'id':'casual','label':yi(_0xc6a373,'Casual'),'prompt':'Improve\x20using\x20casual,\x20informal\x20language\x20to\x20convey\x20a\x20casual\x20conversation\x20with\x20a\x20real\x20person.'},{'id':'direct','label':yi(_0xc6a373,'Direct'),'prompt':'Improve\x20using\x20direct\x20language,\x20using\x20only\x20the\x20essential\x20information.'},{'id':'confident','label':yi(_0xc6a373,'Confident'),'prompt':'Improve\x20using\x20compelling,\x20optimistic\x20language\x20to\x20convey\x20confidence\x20in\x20the\x20writing.'},{'id':'friendly','label':yi(_0xc6a373,'Friendly'),'prompt':'Improve\x20using\x20friendly,\x20comforting\x20language,\x20to\x20convey\x20understanding\x20and\x20empathy.'}]},{'groupId':'changeStyle','groupLabel':yi(_0xc6a373,'Change\x20style'),'commands':[{'id':'business','label':yi(_0xc6a373,'Business'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20business\x20professional\x20with\x20formal\x20language.'},{'id':'legal','label':yi(_0xc6a373,'Legal'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20legal\x20professional\x20using\x20valid\x20legal\x20terminology.'},{'id':'journalism','label':yi(_0xc6a373,'Journalism'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20journalist\x20using\x20engaging\x20language\x20to\x20convey\x20the\x20importance\x20of\x20the\x20information.'},{'id':'poetic','label':yi(_0xc6a373,'Poetic'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20poem\x20using\x20poetic\x20techniques\x20without\x20losing\x20the\x20original\x20meaning.'}]},{'groupId':'translate','groupLabel':yi(_0xc6a373,'Translate'),'commands':[{'id':'translateEnglish','label':yi(_0xc6a373,'English'),'prompt':'Translate\x20the\x20content\x20to\x20English\x20language.'},{'id':'translateSpanish','label':yi(_0xc6a373,'Spanish'),'prompt':'Translate\x20the\x20content\x20to\x20Spanish\x20language.'},{'id':'translatePortuguese','label':yi(_0xc6a373,'Portuguese'),'prompt':'Translate\x20the\x20content\x20to\x20Portuguese\x20language.'},{'id':'translateGerman','label':yi(_0xc6a373,'German'),'prompt':'Translate\x20the\x20content\x20to\x20German\x20language.'},{'id':'translateFrench','label':yi(_0xc6a373,'French'),'prompt':'Translate\x20the\x20content\x20to\x20French\x20language.'},{'id':'translateChinese','label':yi(_0xc6a373,'Simplified\x20Chinese'),'prompt':'Translate\x20the\x20content\x20to\x20Simplified\x20Chinese\x20language.'},{'id':'translateHindi','label':yi(_0xc6a373,'Hindi'),'prompt':'Translate\x20the\x20content\x20to\x20Hindi\x20language.'},{'id':'translateArabic','label':yi(_0xc6a373,'Arabic'),'prompt':'Translate\x20the\x20content\x20to\x20Arabic\x20language.'}]}];}class ts extends _0x12af0a{['abortController'];static get['requires'](){return[Ni];}constructor(_0x471449){super(_0x471449),this['abortController']=new AbortController();}['init'](){this['editor']['plugins']['get'](Ni)['textAdapter']=this;}['abort'](){this['abortController']['signal']['aborted']||(this['abortController']['abort'](),this['abortController']=new AbortController());}async['makeRequest'](_0x15b79e){return this['sendRequest'](_0x15b79e)['catch'](_0x4c265a=>{if(_0x4c265a instanceof vi)return Promise['reject'](_0x4c265a);if('AbortError'==_0x4c265a['name'])return Promise['resolve']();throw console['error'](_0x4c265a),new ht('aitextadapter-send-request-failed',null);});}async['_prepareRequestHeaders'](_0x2b44ba,_0x2c209a){const _0x3e432e=this['editor']['locale'],_0x4592a8={'Content-Type':'application/json'};if('object'==typeof _0x2b44ba)Object['assign'](_0x4592a8,_0x2b44ba);else{if(_0x2b44ba)try{const _0x38a827=await _0x2b44ba(_0x2c209a);Object['assign'](_0x4592a8,_0x38a827);}catch{return Promise['reject'](new vi(yi(_0x3e432e,'AI_ERROR_GET_HEADERS')));}}return _0x4592a8;}async['_prepareRequestParameters'](_0x15e264,_0x2f958d){const _0x425549=this['editor']['locale'];if('object'==typeof _0x15e264)return _0x15e264;try{return await _0x15e264(_0x2f958d);}catch{return Promise['reject'](new vi(yi(_0x425549,'AI_ERROR_GET_PARAMETERS')));}}}class es extends ts{['_apiUrl'];['_requestHeaders'];['_requestParameters'];static get['pluginName'](){return'OpenAITextAdapter';}constructor(_0x4ebbb9){super(_0x4ebbb9),_0x4ebbb9['config']['define']('ai.assistant.adapter.openAI.apiUrl','https://api.openai.com/v1/chat/completions'),_0x4ebbb9['config']['get']('ai.assistant.adapter.openAI.requestParameters')||_0x4ebbb9['config']['define']('ai.assistant.adapter.openAI.requestParameters',{'model':'gpt-4o','temperature':0x1,'top_p':0x1,'stream':!0x0}),this['_apiUrl']=_0x4ebbb9['config']['get']('ai.assistant.adapter.openAI.apiUrl'),this['_requestHeaders']=_0x4ebbb9['config']['get']('ai.assistant.adapter.openAI.requestHeaders')||{},this['_requestParameters']=_0x4ebbb9['config']['get']('ai.assistant.adapter.openAI.requestParameters');}async['sendRequest']({query:_0x349f14,context:_0x1a6dc4,onData:_0x20d1f2,actionId:_0x5577bd}){const _0x414a78=this['editor']['locale'],_0x215caa=await this['prepareMessages'](_0x349f14,_0x1a6dc4,_0x5577bd),_0x4f2118=await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x5577bd),_0x22ba1d=await this['_prepareRequestParameters'](this['_requestParameters'],_0x5577bd),_0xd3e2df={'messages':_0x215caa,..._0x22ba1d},_0xa702bf={'method':'POST','headers':_0x4f2118,'body':JSON['stringify'](_0xd3e2df),'signal':this['abortController']['signal']},_0x40e65d=await fetch(this['_apiUrl'],_0xa702bf);if(_0x40e65d['ok'])return _0x22ba1d['stream']?await this['_readStreamableResponse'](_0x40e65d,_0x20d1f2):await this['_readStaticResponse'](_0x40e65d,_0x20d1f2),Promise['resolve']();{const _0x3e408c=await _0x40e65d['text']();return _0x3e408c['includes']('context_length_exceeded')?Promise['reject'](new vi(yi(_0x414a78,'AI_ERROR_CONTEXT_LENGTH'))):_0x3e408c['includes']('Moderation')?Promise['reject'](new vi(yi(_0x414a78,'AI_ERROR_MODERATION'))):Promise['reject'](new Error(_0x3e408c));}}async['prepareMessages'](_0x41d9cf,_0x229122,_0x1a4368){let _0x563e6a,_0x134c02;return _0x229122?(_0x563e6a='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.',_0x134c02='Instruction:\x0a'+_0x41d9cf+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x229122):(_0x563e6a='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.',_0x134c02=_0x41d9cf),[{'role':'system','content':_0x563e6a},{'role':'user','content':_0x134c02}];}async['_readStreamableResponse'](_0x1fb166,_0x30304f){const _0x317f3=_0x1fb166['body']['getReader'](),_0x235275=new TextDecoder();let _0x39e171='',_0x2d6305='',_0x27134e='',_0x1d63fb=!0x1;for(;!_0x1d63fb;){const {done:_0x1f3487,value:_0x5005dc}=await _0x317f3['read'](),_0x13f48c=_0x39e171+_0x235275['decode'](_0x5005dc);let _0x12f6c8='';_0x1d63fb=_0x1f3487;try{_0x12f6c8=this['_cleanUpData'](_0x13f48c),_0x39e171='';}catch{_0x39e171=_0x13f48c;continue;}_0x2d6305+=_0x12f6c8,!_0x1d63fb&&this['_isBufferIncomplete'](_0x2d6305)||_0x2d6305&&(_0x27134e+=_0x2d6305,_0x2d6305='',_0x30304f(_0x27134e));}return Promise['resolve']();}async['_readStaticResponse'](_0x3963d3,_0x2469a6){return _0x2469a6((await _0x3963d3['json']())['choices'][0x0]['message']['content']),Promise['resolve']();}['_isBufferIncomplete'](_0x34d7dd){const _0x41c792=_0x34d7dd['split']('<')['length']!==_0x34d7dd['split']('>')['length'],_0x2a4164=_0x34d7dd['length']<0x1e;return _0x41c792&&_0x2a4164;}['_cleanUpData'](_0x2e51f6){return _0x2e51f6['split'](/\n(?![^{]*\})/g)['map'](_0x51858d=>_0x51858d['replace']('data:\x20',''))['filter'](_0x5c67fb=>_0x5c67fb&&_0x5c67fb['length']>0x0&&'[DONE]'!==_0x5c67fb)['map'](_0x2ec476=>{const {choices:_0x22251f}=JSON['parse'](_0x2ec476);if(_0x22251f[0x0]?.['delta']?.['content'])return _0x22251f[0x0]['delta']['content'];})['filter'](_0x2c2455=>_0x2c2455)['join']('');}}class is extends ts{['_apiUrl'];['_requestHeaders'];['_bedrockClientConfig'];['_requestParameters'];static get['pluginName'](){return'AWSTextAdapter';}constructor(_0x57e87b){super(_0x57e87b),_0x57e87b['config']['get']('ai.assistant.adapter.aws.requestParameters')||_0x57e87b['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']=_0x57e87b['config']['get']('ai.assistant.adapter.aws.apiUrl'),this['_bedrockClientConfig']=_0x57e87b['config']['get']('ai.assistant.adapter.aws.bedrockClientConfig'),this['_requestHeaders']=_0x57e87b['config']['get']('ai.assistant.adapter.aws.requestHeaders'),this['_requestParameters']=_0x57e87b['config']['get']('ai.assistant.adapter.aws.requestParameters');}async['sendRequest']({query:_0x2a64e4,context:_0x8f4ebe,onData:_0x162c7b,actionId:_0x1c4106}){const {model:_0x1e5231,stream:_0x593b57,..._0x44826d}=await this['_prepareRequestParameters'](this['_requestParameters'],_0x1c4106),_0x3a14ca={'prompt':await this['preparePrompt'](_0x2a64e4,_0x8f4ebe,_0x1e5231,_0x1c4106),..._0x44826d};this['_apiUrl']?await this['_processProxyRequest'](_0x3a14ca,_0x1e5231,_0x593b57,_0x162c7b,_0x1c4106):await this['_processAWSRequest'](_0x3a14ca,_0x1e5231,_0x593b57,_0x162c7b);}async['preparePrompt'](_0x2c466d,_0x331958,_0x24c2e2,_0x2f7a1e){let _0x2f7341,_0x426433;return _0x331958?(_0x2f7341='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.',_0x426433='Instruction:\x0a'+_0x2c466d+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x331958):(_0x2f7341='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.',_0x426433=_0x2c466d),'meta.llama'==this['getModelFamily'](_0x24c2e2)?'<<SYS>>\x0a'+_0x2f7341+'\x0a<</SYS>>\x0a[INST]\x0a'+_0x426433+'\x0a[/INST]':'Human:\x0a'+_0x2f7341+'\x0a'+_0x426433+'\x0a\x0aAssistant:';}['getModelFamily'](_0x27c713){if(/^anthropic\.claude/['test'](_0x27c713))return'anthropic.claude';if(/^ai21\.j2/['test'](_0x27c713))return'ai21.j2';if(/^cohere\.command/['test'](_0x27c713))return'cohere.command';if(/^meta\.llama/['test'](_0x27c713))return'meta.llama';throw new vi(yi(this['editor']['locale'],'AI_ERROR_UNSUPPORTED_MODEL',_0x27c713));}async['_processProxyRequest'](_0x47ef80,_0x3cdef6,_0x24749d,_0x241436,_0x59fa15){const _0x3c92da={'method':'POST','headers':await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x59fa15),'body':JSON['stringify']({..._0x47ef80,'model':_0x3cdef6,'stream':_0x24749d}),'signal':this['abortController']['signal']},_0x1e37e4=await fetch(this['_apiUrl'],_0x3c92da);_0x24749d?await this['_readStreamableResponse'](_0x1e37e4,_0x3cdef6,_0x241436):await this['_readStaticResponse'](_0x1e37e4,_0x3cdef6,_0x241436);}async['_processAWSRequest'](_0x1736f5,_0x54f19e,_0x510689,_0x219023){const _0x15ed9e=new _0x20598d(this['_bedrockClientConfig']),_0x26a27a={'body':JSON['stringify'](_0x1736f5),'contentType':'application/json','accept':'application/json','modelId':_0x54f19e};let _0x59e560;if(_0x510689){const _0xd7865f=new _0x1d18b5(_0x26a27a);_0x59e560=await _0x15ed9e['send'](_0xd7865f,{'abortSignal':this['abortController']['signal']}),await this['_readAsyncIterableResponse'](_0x59e560,_0x54f19e,_0x219023);}else{const _0x30433a=new _0x27ea22(_0x26a27a);_0x59e560=await _0x15ed9e['send'](_0x30433a,{'abortSignal':this['abortController']['signal']}),await this['_readStaticResponse'](_0x59e560,_0x54f19e,_0x219023);}}async['_readAsyncIterableResponse'](_0x3aa34,_0x56f847,_0x4778b1){const _0xcf37aa=_0x3aa34['body'],_0x325c28=new TextDecoder('utf-8');let _0x53589d='';for await(const _0x46b4b7 of _0xcf37aa)if(_0x46b4b7['chunk']){const _0x51b5f1=_0x325c28['decode'](_0x46b4b7['chunk']['bytes']),_0x433205=JSON['parse'](_0x51b5f1);_0x53589d+=this['_getGeneratedText'](_0x433205,_0x56f847),_0x4778b1(_0x53589d);}return Promise['resolve']();}async['_readStreamableResponse'](_0x492008,_0x60a898,_0x17cbae){const _0x51514d=_0x492008['body'],_0x15bb3d=new TextDecoder('utf-8'),_0x228d90=_0x51514d['getReader']();let _0x4599b2='',_0x5f5aab='',_0x4a2f97=!0x1;for(;!_0x4a2f97;){const {done:_0x267371,value:_0x5b1519}=await _0x228d90['read']();if(_0x4a2f97=_0x267371,_0x4a2f97)break;const _0x2cc62d=(_0x4599b2+_0x15bb3d['decode'](_0x5b1519))['split']('\x0a')['map'](_0x3dea4a=>{try{return _0x4599b2='',JSON['parse'](_0x3dea4a);}catch{return _0x4599b2=_0x3dea4a,null;}})['filter'](_0x57c085=>null!==_0x57c085);_0x2cc62d['length']&&(_0x5f5aab+=_0x2cc62d['map'](_0x12ee5f=>this['_getGeneratedText'](_0x12ee5f,_0x60a898))['join'](''),_0x17cbae(_0x5f5aab));}return Promise['resolve']();}async['_readStaticResponse'](_0xc5933,_0x379dc7,_0x1b8db6){let _0x4b32e7;return _0x4b32e7=_0xc5933 instanceof Response?await _0xc5933['json']():JSON['parse'](new TextDecoder('utf-8')['decode'](_0xc5933['body'])),(_0x1b8db6(this['_getGeneratedText'](_0x4b32e7,_0x379dc7)),Promise['resolve']());}['_getGeneratedText'](_0x18eccc,_0x15aaf7){switch(this['getModelFamily'](_0x15aaf7)){case'anthropic.claude':return _0x18eccc['completion'];case'ai21.j2':return _0x18eccc['completions'][0x0]['data']['text'];case'cohere.command':return _0x18eccc['generations'][0x0]['text'];case'meta.llama':return _0x18eccc['generation'];}}}class ss extends Nt{constructor(_0x4ad4aa,_0x5c56bc={}){super(_0x4ad4aa),this['isToggleable']=!0x0,this['set']('side',_0x5c56bc['side']||'top');const _0x564227=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-tab-button',...Et(_0x5c56bc['class']||[]),_0x564227['to']('side',_0x320627=>'ck-tab-button_'+_0x320627),_0x564227['to']('class')]}});}['show'](){this['set']('isVisible',!0x0);}['hide'](){this['set']('isVisible',!0x1);}}class ns extends vt{['children'];constructor(_0x5bd576,_0x5796f0={}){super(_0x5bd576);const _0x102f88=this['bindTemplate'];this['set']('isVisible',!0x1),this['set']('class',''),this['children']=this['createCollection'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck-tab-panel',...Et(_0x5796f0['class']||[]),_0x102f88['to']('class'),_0x102f88['if']('isVisible','ck-hidden',_0x24dc3d=>!_0x24dc3d)]},'children':this['children']});}['show'](){this['set']('isVisible',!0x0);}['hide'](){this['set']('isVisible',!0x1);}}class rs extends vt{['buttonViews']=this['createCollection']();['panelViews']=this['createCollection']();['_tabs']=new Map();constructor(_0x45aad8,_0x176228={}){super(_0x45aad8),this['set']('class',void 0x0),this['set']('activeTab',null),this['set']('side',_0x176228['side']||'top'),this['set']('isMaximized',!0x1);const _0x4fd3fa=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset','ck-tabs',...Et(_0x176228['class']||[]),_0x4fd3fa['to']('side',_0x4eb65e=>'ck-tabs_'+_0x4eb65e),_0x4fd3fa['to']('class'),_0x4fd3fa['to']('isMaximized',_0x27bc78=>_0x27bc78?'ck-ai-tabs_maximized':'')],'tabindex':'0'},'children':[{'tag':'div','attributes':{'class':['ck','ck-tabs__buttons-container',_0x4fd3fa['to']('side',_0x5608eb=>'ck-tabs__buttons-container_'+_0x5608eb)]},'children':this['buttonViews']},{'tag':'div','attributes':{'class':['ck','ck-tabs__panels-container',_0x4fd3fa['to']('side',_0x3d6249=>'ck-tabs__panels-container_'+_0x3d6249)]},'children':this['panelViews']},...Et(_0x176228['children']||[])]});}['getTabIds'](){return[...this['_tabs']['keys']()];}['getTab'](_0x2b3dc4){const _0x267103=this['_tabs']['get'](_0x2b3dc4);return _0x267103||null;}['addTab'](_0x21fcd3){const _0x8cf385=this['_setupButton']({'id':_0x21fcd3['id'],'label':_0x21fcd3['buttonLabel'],'icon':_0x21fcd3['buttonIcon'],'order':_0x21fcd3['order']}),_0x1a551b=new ns(this['locale']);return _0x1a551b['render'](),_0x21fcd3['content']&&_0x1a551b['children']['add'](_0x21fcd3['content']),this['panelViews']['add'](_0x1a551b),this['_tabs']['set'](_0x21fcd3['id'],{'button':_0x8cf385,'panel':_0x1a551b,'order':void 0x0!==_0x21fcd3['order']?_0x21fcd3['order']:null}),this['fire']('addTab:'+_0x21fcd3['id'],{'id':_0x21fcd3['id'],'button':_0x8cf385,'panel':_0x1a551b}),null===this['activeTab']?this['activateTab'](_0x21fcd3['id']):this['_hidePanel'](_0x21fcd3['id']),{'button':_0x8cf385,'panel':_0x1a551b};}['activateTab'](_0x2261d1){if(null!==_0x2261d1&&!this['getTab'](_0x2261d1))throw new ht('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0x2261d1});this['activeTab']!==_0x2261d1&&(this['activeTab']&&this['_hidePanel'](this['activeTab']),this['activeTab']=_0x2261d1,_0x2261d1&&this['_showPanel'](_0x2261d1),this['fire']('activateTab:'+_0x2261d1,_0x2261d1));}['showTab'](_0x386f31){if(!this['getTab'](_0x386f31))throw new ht('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0x386f31});this['_showPanel'](_0x386f31),this['_showButton'](_0x386f31),this['fire']('show:'+_0x386f31,_0x386f31);}['hideTab'](_0x2472b9){if(!this['getTab'](_0x2472b9))throw new ht('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0x2472b9});const _0x576343=this['activeTab'];this['_hidePanel'](_0x2472b9),this['_hideButton'](_0x2472b9);const _0x202d1c=this['getTabIds']();_0x576343===_0x2472b9&&_0x202d1c['length']>0x1&&this['activateTab'](_0x202d1c['find'](_0x54e467=>_0x54e467!==_0x2472b9)),this['fire']('hide:'+_0x2472b9,_0x2472b9);}['_getPanel'](_0x598ed9){const _0x19879e=this['_tabs']['get'](_0x598ed9);return _0x19879e?_0x19879e['panel']:null;}['_showPanel'](_0x42d7be){null!==this['activeTab']&&this['activeTab']!==_0x42d7be||this['_getPanel'](_0x42d7be)['show']();}['_hidePanel'](_0x2f50cd){const _0x2a3f1d=this['_getPanel'](_0x2f50cd);_0x2a3f1d['isVisible']&&(this['activeTab']===_0x2f50cd&&(this['activeTab']=null),_0x2a3f1d['hide']());}['_getButton'](_0x372581){const _0x856224=this['_tabs']['get'](_0x372581);return _0x856224?_0x856224['button']:null;}['_showButton'](_0x24db31){this['_getButton'](_0x24db31)['show']();}['_hideButton'](_0x22dd78){this['_getButton'](_0x22dd78)['hide']();}['_setupButton'](_0x5a7df7){const _0x6e4d3c=new ss(this['locale'],{'side':this['side']}),_0x2077eb=this['buttonViews'];if(_0x6e4d3c['set']({'label':_0x5a7df7['label'],'icon':_0x5a7df7['icon'],'tooltip':!0x0,'withText':!0x0}),_0x6e4d3c['bind']('isOn')['to'](this,'activeTab',_0x2dc4fb=>_0x2dc4fb===_0x5a7df7['id']),_0x6e4d3c['bind']('side')['to'](this,'side'),_0x5a7df7['order']){const _0x8c35bf=[...this['_tabs']]['reduce']((_0x4c5075,_0x3ab95f)=>{const _0x578a7b=_0x3ab95f[0x0],{order:_0x5229b7}=_0x3ab95f[0x1];return!_0x5229b7||_0x5229b7>_0x5a7df7['order']?_0x4c5075:_0x5229b7>=_0x4c5075['order']?{'id':_0x578a7b,'order':_0x5229b7}:_0x4c5075;},{'id':'','order':0x0}),_0x2f62df=_0x2077eb['getIndex'](this['_getButton'](_0x8c35bf['id']));_0x2077eb['add'](_0x6e4d3c,_0x2f62df+0x1);}else _0x2077eb['add'](_0x6e4d3c);return _0x6e4d3c['on']('execute',()=>{this['activateTab'](_0x5a7df7['id']);}),_0x6e4d3c;}}const as=['overlay','sidebar','custom'],os=['left','right'];class hs extends rs{constructor(_0x3c1cf9,_0x456b41={}){super(_0x3c1cf9,_0x456b41),this['set']('type',_0x456b41['type']||'sidebar'),this['set']('side',_0x456b41['side']||'right'),this['set']('isVisible',_0x456b41['visibleByDefault']??!0x0);const _0x38ce67=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-tabs',_0x38ce67['if']('type','ck-ai-tabs__overlay',_0x30602a=>'overlay'===_0x30602a),_0x38ce67['if']('type','ck-ai-tabs__sidebar',_0x58c400=>'sidebar'===_0x58c400),_0x38ce67['if']('isVisible','ck-hidden',_0x840d20=>!_0x840d20)]}}),this['buttonViews']['on']('add',(_0x2cd496,_0x1873de)=>{_0x1873de['set']('withText',!0x1);});}}class cs extends _0x12c8be{['view'];['container']=null;['showResizeButton']=!0x0;static get['pluginName'](){return'AITabs';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x1e90c8){super(_0x1e90c8);const _0x2fc84e=this['context']['config']['get']('ai.container');if(this['set']('side','right'),!_0x2fc84e)throw new ht('ai-tabs-configuration-not-found');if(void 0x0!==_0x2fc84e['showResizeButton']&&(this['showResizeButton']=_0x2fc84e['showResizeButton']),'sidebar'!==_0x2fc84e['type']&&'overlay'!==_0x2fc84e['type']||_0x2fc84e['side']&&(this['side']=_0x2fc84e['side']),'sidebar'===_0x2fc84e['type']){if(this['container']=_0x2fc84e['element'],this['set']('type','sidebar'),!this['container'])throw new ht('ai-tabs-sidebar-container-element-not-found');}else'overlay'===_0x2fc84e['type']?(this['container']=document['body'],this['set']('type','overlay')):(this['container']=null,this['set']('type','custom'));this['view']=new hs(this['context']['locale'],{'side':this['side'],'type':this['type'],'visibleByDefault':void 0x0===_0x2fc84e['visibleByDefault']||_0x2fc84e['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 _0x3c1522&&this['context']['ui']['focusTracker']['add'](this['view']['element']);}['switchType'](_0x3667bd){if(_0x3667bd&&this['type']!==_0x3667bd){if(!as['includes'](_0x3667bd))throw new ht('ai-tabs-unsupported-ui-type');this['type']=_0x3667bd;}}['switchSide'](_0x4441af){if(_0x4441af&&this['side']!==_0x4441af){if(!os['includes'](_0x4441af))throw new ht('ai-tabs-unsupported-ui-side');this['side']=_0x4441af;}}['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 ls extends _0x12c8be{['_apiUrl'];['_token'];['_decoder'];['_responseCache'];static get['requires'](){return[_0x418e32];}static get['pluginName'](){return'AIConnector';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x1e5c93){super(_0x1e5c93),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 _0x3651f4=this['context']['plugins']['get'](_0x418e32);if(!_0x3651f4['token'])throw new ht('ai-missing-token',this);this['_token']=_0x3651f4['token'];}['startConversation'](_0x4cda80,_0x35ceca){const _0x54fd13=this['_sendApiRequest']('/conversations','POST',{'id':_0x4cda80,'group':_0x35ceca});return{'getConversation':async()=>(await _0x54fd13['request'])['json'](),'abortController':_0x54fd13['abortController']};}['queryAssistant']({message:_0x4696d7,conversationId:_0x2ef96e,parts:_0x316b18,capabilities:_0x2fa8f9,model:_0x50c3e5,attributes:_0x4f494c}){const _0x1490a5={'prompt':_0x4696d7,'content':_0x316b18,'model':_0x50c3e5,..._0x2fa8f9&&{'capabilities':_0x2fa8f9},..._0x4f494c&&{'attributes':_0x4f494c}},_0xd8fd72=this['_sendApiRequest']('/conversations/'+_0x2ef96e+'/messages','POST',_0x1490a5);return{'getStream':async()=>{const _0x5c2398=(await _0xd8fd72['request'])['body'];return this['_getStreamReader'](_0x5c2398);},'abortController':_0xd8fd72['abortController']};}['executeCustomAction']({content:_0x4eb8ef,message:_0x512b33,model:_0x976d9b,outputFormat:_0x25bad7}){const _0x458cc8={'content':[{'type':'text','content':_0x4eb8ef}],'prompt':_0x512b33,'model':_0x976d9b,'outputFormat':_0x25bad7},_0x44b0f8=this['_sendApiRequest']('/actions/custom/calls','POST',_0x458cc8);return{'getStream':async()=>{const _0x369de3=(await _0x44b0f8['request'])['body'];return this['_getStreamReader'](_0x369de3);},'abortController':_0x44b0f8['abortController']};}['executeAction']({actionName:_0x55eeac,content:_0x3b404c,args:_0x2188c9}){const _0x50b36d={'content':[{'type':'text','content':_0x3b404c}],'args':_0x2188c9},_0x6556da=this['_sendApiRequest']('/actions/system/'+_0x55eeac+'/calls','POST',_0x50b36d);return{'getStream':async()=>{const _0x1ab5a4=(await _0x6556da['request'])['body'];return this['_getStreamReader'](_0x1ab5a4);},'abortController':_0x6556da['abortController']};}['uploadFile'](_0x997a1c,_0x256d2a,_0x571763){const _0x165241=new FormData();_0x165241['append']('file',_0x256d2a,_0x256d2a['name']),_0x571763&&_0x165241['append']('attributes',JSON['stringify'](_0x571763));const _0x5c7907=this['_sendApiRequest']('/conversations/'+_0x997a1c+'/files','POST',_0x165241);return{'getId':async()=>(await _0x5c7907['request'])['json'](),'abortController':_0x5c7907['abortController']};}['fetchDocument'](_0x5dd431,_0x8d7848){const _0x51acb5=this['_sendApiRequest']('/conversations/'+_0x5dd431+'/documents/'+_0x8d7848,'GET');return{'getDocument':async()=>(await _0x51acb5['request'])['json'](),'abortController':_0x51acb5['abortController']};}['uploadDocument'](_0x5b0ab7,_0x4e59e0,_0x147e9c){const _0x55e5f={'content':_0x4e59e0};_0x147e9c&&(_0x55e5f['attributes']=_0x147e9c);const _0x26f841=this['_sendApiRequest']('/conversations/'+_0x5b0ab7+'/documents','POST',_0x55e5f);return{'getId':async()=>(await _0x26f841['request'])['json'](),'abortController':_0x26f841['abortController']};}['fetchConversations'](_0x19bb42,_0x36d834={}){const _0x4f8e74=new URLSearchParams();_0x4f8e74['append']('group',_0x19bb42),_0x4f8e74['append']('excludeEmpty',!0x1!==_0x36d834['excludeEmpty']?'true':'false'),_0x4f8e74['append']('limit',_0x36d834['limit']?_0x36d834['limit']['toString']():'100'),_0x4f8e74['append']('sortBy',_0x36d834['sortBy']?_0x36d834['sortBy']:'createdAt'),_0x4f8e74['append']('order',_0x36d834['order']?_0x36d834['order']:'desc');const _0x15c5ac=this['_sendApiRequest']('/conversations?'+_0x4f8e74['toString'](),'GET');return{'getConversations':async()=>{const _0x128a7a=await _0x15c5ac['request'];return(await _0x128a7a['json']())['items'];},'abortController':_0x15c5ac['abortController']};}['deleteConversation'](_0x2978e0){const _0x2dbf0c=this['_sendApiRequest']('/conversations/'+_0x2978e0,'DELETE');return{'execute':async()=>{await _0x2dbf0c['request'];},'abortController':_0x2dbf0c['abortController']};}['updateConversation'](_0x38e2f6,_0x4fcf01){const _0x8d0c3f=this['_sendApiRequest']('/conversations/'+_0x38e2f6,'PATCH',_0x4fcf01);return{'getResult':async()=>(await _0x8d0c3f['request'],_0x4fcf01),'abortController':_0x8d0c3f['abortController']};}['fetchConversation'](_0x4d6365){const _0x382b76=this['_sendApiRequest']('/conversations/'+_0x4d6365,'GET');return{'getConversation':async()=>(await _0x382b76['request'])['json'](),'abortController':_0x382b76['abortController']};}['fetchConversationMessages'](_0x503051){const _0x46c569=this['_sendApiRequest']('/conversations/'+_0x503051+'/messages','GET');return{'getMessages':async()=>{const _0x12be93=await _0x46c569['request'];return(await _0x12be93['json']())['items'];},'abortController':_0x46c569['abortController']};}['uploadUrl'](_0x2292b6,_0x158bed,_0x153e5b){const _0x895881=this['_sendApiRequest']('/conversations/'+_0x2292b6+'/web-resources','POST',{'url':_0x158bed,'attributes':_0x153e5b});return{'getId':async()=>(await _0x895881['request'])['json'](),'abortController':_0x895881['abortController']};}['getModels'](_0xf91d68='en'){const _0x1992c7=new URLSearchParams();_0x1992c7['append']('language',_0xf91d68);const _0x4bd815='/models/1?'+_0x1992c7['toString'](),_0x2d7984=this['_sendApiRequest'](_0x4bd815,'GET',void 0x0,!0x0);return{'list':async()=>await(await _0x2d7984['request'])['json'](),'abortController':_0x2d7984['abortController']};}['deleteFile'](_0x540151,_0xa859f3){const _0x313217=this['_sendApiRequest']('/conversations/'+_0x540151+'/files/'+_0xa859f3,'DELETE');return{'execute':async()=>{await _0x313217['request'];},'abortController':_0x313217['abortController']};}['deleteDocument'](_0x3650dc,_0x544ce3){const _0x341a58=this['_sendApiRequest']('/conversations/'+_0x3650dc+'/documents/'+_0x544ce3,'DELETE');return{'execute':async()=>{await _0x341a58['request'];},'abortController':_0x341a58['abortController']};}['deleteWebResource'](_0x589766,_0x132ae7){const _0x4146f7=this['_sendApiRequest']('/conversations/'+_0x589766+'/web-resources/'+_0x132ae7,'DELETE');return{'execute':async()=>{await _0x4146f7['request'];},'abortController':_0x4146f7['abortController']};}['callSystemReview']({reviewName:_0x3b5cb4,content:_0x50248d,args:_0x2fd49a}){const _0x123563=this['_sendApiRequest']('/reviews/system/'+_0x3b5cb4+'/calls','POST',{'content':[{'type':'text','content':_0x50248d}],'args':_0x2fd49a});return{'getStream':async()=>{const _0x276724=(await _0x123563['request'])['body'];return this['_getStreamReader'](_0x276724);},'abortController':_0x123563['abortController']};}['callCustomReview']({content:_0x2bf860,prompt:_0x34be95,model:_0x122dad}){const _0x560397=this['_sendApiRequest']('/reviews/custom/calls','POST',{'content':[{'type':'text','content':_0x2bf860}],'prompt':_0x34be95,'model':_0x122dad});return{'getStream':async()=>{const _0x57dacb=(await _0x560397['request'])['body'];return this['_getStreamReader'](_0x57dacb);},'abortController':_0x560397['abortController']};}['upsertAIChatRating'](_0x3b473c,_0x224456,_0x2e09cf){const _0x1728cc=this['_sendApiRequest']('/conversations/'+_0x3b473c+'/messages/'+_0x224456+'/ratings','PUT',{'positiveCount':_0x2e09cf['positiveCount'],'totalCount':_0x2e09cf['totalCount'],'modificationId':_0x2e09cf['modificationId']});return{'execute':async()=>{await _0x1728cc['request'];},'abortController':_0x1728cc['abortController']};}['upsertAIActionRating'](_0x11dfdf,_0x1f54ed,_0x5e5be2){const _0xa8f6c4=this['_sendApiRequest']('/actions/system/'+_0x11dfdf+'/calls/'+_0x1f54ed+'/ratings','PUT',{'positiveCount':_0x5e5be2['positiveCount'],'totalCount':_0x5e5be2['totalCount']});return{'execute':async()=>{await _0xa8f6c4['request'];},'abortController':_0xa8f6c4['abortController']};}['upsertCustomAIActionRating'](_0x493eae,_0x15cc7e){const _0xfaaf07=this['_sendApiRequest']('/actions/custom/calls/'+_0x493eae+'/ratings','PUT',{'positiveCount':_0x15cc7e['positiveCount'],'totalCount':_0x15cc7e['totalCount']});return{'execute':async()=>{await _0xfaaf07['request'];},'abortController':_0xfaaf07['abortController']};}['upsertAIReviewRating'](_0x1f6de2,_0xc44bab,_0x415fcf,_0x43a027){const _0xb1bb5c=this['_sendApiRequest']('/reviews/system/'+_0x1f6de2+'/calls/'+_0xc44bab+'/ratings','PUT',{'positiveCount':_0x415fcf['positiveCount'],'totalCount':_0x415fcf['totalCount'],'dataId':_0x43a027});return{'execute':async()=>{await _0xb1bb5c['request'];},'abortController':_0xb1bb5c['abortController']};}['upsertCustomAIReviewRating'](_0x149e57,_0x48a922,_0x409da7){const _0x2718e1=this['_sendApiRequest']('/reviews/custom/calls/'+_0x149e57+'/ratings','PUT',{'positiveCount':_0x48a922['positiveCount'],'totalCount':_0x48a922['totalCount'],'dataId':_0x409da7});return{'execute':async()=>{await _0x2718e1['request'];},'abortController':_0x2718e1['abortController']};}['_sendApiRequest'](_0x5f4c47,_0x26d281,_0x304982,_0x35b280=!0x1){const _0x39d034=new AbortController(),_0x5562a4=_0x35b280?_0x26d281+':'+_0x5f4c47:null;if(_0x5562a4){const _0x1d34b2=this['_responseCache']['get'](_0x5562a4);if(_0x1d34b2)return{'request':_0x1d34b2['then'](_0x4973d0=>_0x4973d0['clone']()),'abortController':_0x39d034};}const _0x431239=_0x304982 instanceof FormData,_0x3541dd={'Authorization':'Bearer\x20'+this['_token']?.['value']};_0x304982&&!_0x431239&&(_0x3541dd['Content-Type']='application/json');const _0x6ed299={'method':_0x26d281,'headers':_0x3541dd,'signal':_0x39d034['signal']};_0x304982&&(_0x6ed299['body']=_0x431239?_0x304982:JSON['stringify'](_0x304982));const _0x3ac825=fetch(''+this['_apiUrl']+_0x5f4c47,_0x6ed299)['catch'](_0x17fdfb=>{_0x5562a4&&this['_responseCache']['delete'](_0x5562a4),this['_handleError'](_0x17fdfb);})['then'](_0x529e66=>_0x529e66['ok']?_0x529e66:_0x529e66['json']()['then'](_0x17385b=>{throw _0x5562a4&&this['_responseCache']['delete'](_0x5562a4),{'url':this['_apiUrl'],'path':_0x5f4c47,'method':_0x26d281,'body':_0x304982,'status':(_0x529e66||{})['status'],'statusText':(_0x529e66||{})['statusText'],'code':_0x17385b['code'],'message':_0x17385b['message'],'traceId':_0x17385b['traceId']};}));return _0x5562a4&&this['_responseCache']['set'](_0x5562a4,_0x3ac825['then'](_0x70f7ae=>_0x70f7ae['clone']())),{'request':_0x3ac825,'abortController':_0x39d034};}async*['_getStreamReader'](_0x1872a9){const _0x15419a=[],_0x2333a7=_0x1872a9['getReader'](),_0x6ee9f4=_0x317e30({'onError':_0x40f59a=>{this['_handleError'](_0x40f59a);},'onEvent':_0x4cf366=>{_0x4cf366['data']=JSON['parse'](_0x4cf366['data']),_0x15419a['push'](_0x4cf366);}});try{let _0x3312dc=!0x1;for(;!_0x3312dc;){const {done:_0x59e2d0,value:_0x54fecf}=await _0x2333a7['read']();_0x59e2d0&&(_0x3312dc=!0x0),_0x6ee9f4['feed'](this['_decoder']['decode'](_0x54fecf,{'stream':!0x0})),yield*_0x15419a,_0x15419a['length']=0x0;}}catch(_0x264a61){this['_handleError'](_0x264a61);}finally{_0x2333a7['releaseLock'](),_0x6ee9f4['reset']();}}['_handleError'](_0x1f8ec5){if(_0x1f8ec5 instanceof ht)throw _0x1f8ec5;if(_0x1f8ec5 instanceof Error&&'AbortError'===_0x1f8ec5['name'])throw new ht('ai-request-aborted',this,{'originalError':_0x1f8ec5});throw new ht('ai-request-failed',this,{'originalError':_0x1f8ec5});}}function us(_0x157764,_0x2da34b,_0x5d0632){const t=_0x157764['t'];switch(_0x2da34b){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'},_0x5d0632);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.'},_0x5d0632);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.'},_0x5d0632);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.'},_0x5d0632);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'},_0x5d0632);case'AI_CHAT_SUGGESTION_ACTION_SUGGEST':return t({'id':'AI_CHAT_SUGGESTION_ACTION_SUGGEST','string':'Suggest'},_0x5d0632);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'},_0x5d0632);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.'},_0x5d0632);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.'},_0x5d0632);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.'},_0x5d0632);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.'},_0x5d0632);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'},_0x5d0632);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.'},_0x5d0632);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 _0x2da34b;}}const ds='ck-ai-button-primary',_s='ck-ai-button-secondary',As='ck-ai-button-tertiary';function gs(_0x3b7a66,_0x1cce7c){const _0x40a3ab=new Nt(_0x3b7a66),_0x3f35f1=us(_0x3b7a66,'AI_TABS_LABEL_MINIMIZE'),_0x3b1e1b=us(_0x3b7a66,'AI_TABS_LABEL_MAXIMIZE');return _0x40a3ab['set']({'withText':!0x1,'icon':_0x4d2a14,'tooltip':!0x0,'class':'ck-ai-tabs__resize\x20'+As}),_0x40a3ab['bind']('label')['to'](_0x1cce7c,'isMaximized',_0x408c98=>_0x408c98?_0x3f35f1:_0x3b1e1b),_0x40a3ab['bind']('icon')['to'](_0x1cce7c,'isMaximized',_0x531e4e=>_0x531e4e?_0xe77c4:_0x4d2a14),_0x40a3ab['bind']('isOn')['to'](_0x1cce7c,'isMaximized'),_0x40a3ab['on']('execute',()=>{_0x1cce7c['fire']('resizeTabs');}),_0x40a3ab;}function Is(_0x230bad){return _0x9d1741(_0x230bad);}function Es(_0x42722f){return _0x3b485b(_0x42722f);}function ps(_0x2d3589,_0x14eaf8,_0x50af20){const _0x5c672c=null!==_0x14eaf8?_0x4bc2fa=>_0x4bc2fa['attribs'][_0x2d3589]===_0x14eaf8:_0x50d329=>Boolean(_0x50d329['attribs'][_0x2d3589]);return _0x33d270(_0x17d3fd=>_0x3e068a(_0x17d3fd)&&_0x5c672c(_0x17d3fd),_0x50af20);}function Ts(_0x17393b,_0x54ecb2,_0x1aec98){const _0x3397e=null!==_0x54ecb2?_0x149000=>_0x149000['attribs'][_0x17393b]===_0x54ecb2:_0x3c81d1=>Boolean(_0x3c81d1['attribs'][_0x17393b]);return _0x61616a(_0x525bd5=>_0x3e068a(_0x525bd5)&&_0x3397e(_0x525bd5),_0x1aec98);}function ms(_0x992f8,_0x253c0f){return _0x992f8&&_0x3e068a(_0x992f8)?_0x992f8['attribs'][_0x253c0f]:null;}function Cs(_0xc40215,_0x8aa06d,_0x290418){_0x3e068a(_0xc40215)&&(null===_0x290418?delete _0xc40215['attribs'][_0x8aa06d]:_0xc40215['attribs'][_0x8aa06d]=_0x290418);}function ws(_0x35e04f,_0x29d8cc,_0x1ac832){const _0x4c71c5=_0x29d8cc['cloneNode'](!0x0);'beforebegin'===_0x1ac832?_0x16821e(_0x35e04f,_0x4c71c5):'afterbegin'===_0x1ac832?_0x285d06(_0x35e04f,_0x4c71c5):'beforeend'===_0x1ac832?_0x2d5d55(_0x35e04f,_0x4c71c5):'afterend'===_0x1ac832&&_0x508d22(_0x35e04f,_0x4c71c5);}function fs(_0x4e8627){const _0x5c6db8=[];let _0x58f603=_0x4e8627;for(;_0x58f603;)_0x58f603=_0xde3c03(_0x58f603),_0x58f603&&_0x5c6db8['push'](_0x58f603);return _0x5c6db8;}function Ss(_0x1ce52c){return _0x1ce52c['replace'](/^\s+/gm,'')['replace'](/\s+$/gm,'')['replace'](/\n*/g,'')['replace'](/\s+/g,'\x20')['replace'](/>\s*</g,'><');}function bs(_0x3eae45){let _0x13a564=0x0;for(;_0x3eae45['parentNode'];)_0x3eae45=_0x3eae45['parentNode'],_0x13a564++;return _0x13a564;}function Rs(_0x32bddc){const _0x47f250=[];let _0x589a6b=_0x32bddc['nextSibling'];for(;_0x589a6b;)_0x47f250['push'](_0x589a6b),_0x589a6b=_0x589a6b['nextSibling'];_0x47f250['forEach'](_0x3982eb=>{_0x322bd0(_0x3982eb);});}class Os extends/* #__PURE__ -- @preserve */
25
- ct(){['_m2html'];constructor(){super();const _0x3e326f=Object['entries'](_0x4b80de),_0x3b3f60=_0x3e326f['findIndex'](([_0x3bd851])=>'rehypeDomRaw'===_0x3bd851);if(-0x1===_0x3b3f60)throw new ht('ai-response-parser-unable-to-set-up-parser');_0x3e326f['splice'](_0x3b3f60+0x1,0x0,['rehypeSanitize',_0x15af38]),this['_m2html']=new _0x456ceb({'plugins':Object['fromEntries'](_0x3e326f)});}['convertMarkdownToHTML'](_0x480ae2){const _0x5ee828=this['_m2html']['parse'](_0x480ae2);return this['parseAndNormalizeHTML'](_0x5ee828);}['parseAndNormalizeHTML'](_0x50d11b){return this['_parseHTML'](_0x50d11b);}['_parseHTML'](_0x1a5962){const _0x30b088=Is('<dummy>'+_0x1a5962['replace'](/^\t+/gm,'\x20')['replace'](/\n*/g,'')['replace'](/\s+/g,'\x20')['replace'](/<[^>]*?$/g,'')+'</dummy>');return _0x30b088['children']=_0x30b088['children'][0x0]['children'],_0x30b088;}}class ks extends/* #__PURE__ -- @preserve */
26
- ct(){['_generateUid'];['_touchedNodesState']={'newIds':[],'modifiedIds':[],'removedIds':[],'invalidIds':[],'lastTouchedId':null};['_existingDataIds']=new Set();constructor(_0x1b245b){super(),this['_generateUid']=_0x1b245b||ot;}['merge'](_0x3e731c,_0x1bc8d4,_0x2cc0b8){const _0x1cfc66=_0x3e731c['cloneNode'](!0x0);if(0x0===_0x1bc8d4['childNodes']['length']){const _0x3830c5=[];return Ts('data-id','new-element',_0x1cfc66)['forEach'](_0x132dfa=>{const _0x516026=this['_generateUid']();Cs(_0x132dfa,'data-id',_0x516026),_0x3830c5['push'](_0x516026);}),this['_removeSpecialComments'](_0x1cfc66),{'parsedContent':_0x1cfc66,'newNodeIds':_0x3830c5,'modifiedNodeIds':[],'removedNodeIds':[]};}_0x2cc0b8&&_0x2cc0b8['markUnstableElements']&&this['_markLastTagElementUnstable'](_0x1cfc66),this['_touchedNodesState']['newIds']=[],this['_touchedNodesState']['modifiedIds']=[],this['_touchedNodesState']['removedIds']=[],this['_touchedNodesState']['invalidIds']=[],this['_touchedNodesState']['lastTouchedId']=null,this['_existingDataIds']=new Set(Ts('data-id',null,_0x1bc8d4)['map'](_0x8161b2=>ms(_0x8161b2,'data-id'))['filter'](_0x44eddf=>!!_0x44eddf));let _0x54e644=-0x1,_0x3df5f6=!0x1;const _0x144efd=_0x1cfc66['childNodes'],_0x5ec900=Array['from'](_0x144efd)['filter'](_0x5ce2b2=>!(0x3===_0x5ce2b2['nodeType']&&''===Es(_0x5ce2b2)['trim']())),_0x33551f=_0x5ec900['length'];for(let _0x2bd691=0x0;_0x2bd691<_0x33551f;_0x2bd691++){const _0x39907a=_0x5ec900[_0x2bd691],_0x17a563=_0x5ec900[_0x2bd691+0x1];if(this['_isNewNode'](_0x39907a)){if(-0x1===_0x54e644&&(_0x54e644=_0x2bd691),this['_markWrappedElements'](_0x39907a),!this['_isNewNode'](_0x17a563)){const [_0x227738,_0x1c484c]=this['_findReferenceNode'](_0x39907a,_0x3df5f6,_0x1bc8d4);if(_0x227738){const _0x13ea4b=Array['from'](_0x5ec900)['slice'](_0x54e644,_0x2bd691+0x1);this['_insertNodes'](_0x227738,_0x13ea4b,_0x1c484c),_0x54e644=-0x1;}}}else{if(this['_isExistingContentComment'](_0x39907a))_0x3df5f6=!0x0;else{if(this['_isExistingNode'](_0x39907a)){const _0x54231c=ms(_0x39907a,'data-id');if(_0x54231c&&this['_existingDataIds']['has'](_0x54231c)){const _0x229ca0=ps('data-id',_0x54231c,_0x1bc8d4);this['_replaceNode'](_0x229ca0,_0x39907a);}if(this['_touchedNodesState']['removedIds']['includes'](_0x54231c)){const _0x404f7f=this['_touchedNodesState']['removedIds']['indexOf'](_0x54231c);this['_touchedNodesState']['removedIds']['splice'](_0x404f7f,0x1);}}else{if(this['_isDelNode'](_0x39907a)){const _0x385a79=ms(_0x39907a,'data-id');this['_touchedNodesState']['modifiedIds']['includes'](_0x385a79)||this['_storeDeletedElementIds'](_0x39907a);}}}}}for(const _0x1fd3f2 of this['_touchedNodesState']['removedIds']){const _0x46df87=ps('data-id',_0x1fd3f2,_0x1bc8d4);if(_0x46df87){if(_0x2cc0b8&&_0x2cc0b8['replaceRemovedWith']){this['_touchedNodesState']['lastTouchedId']=_0x1fd3f2;const _0x3e36cb=_0x2cc0b8['replaceRemovedWith']['cloneNode'](!0x0);Cs(_0x3e36cb,'data-id',_0x1fd3f2),Cs(_0x3e36cb,'data-removed','true'),_0x55bac4(_0x46df87,_0x3e36cb);}else _0x322bd0(_0x46df87);}}if(Ts('data-wrapped-id',null,_0x1bc8d4)['forEach'](_0x2c5b1a=>{const _0x204f86=ps('data-id',ms(_0x2c5b1a,'data-wrapped-id'),_0x1bc8d4);var _0x1344fd,_0x5dd4b6;_0x204f86&&(_0x5dd4b6=_0x2c5b1a,_0x322bd0(_0x1344fd=_0x204f86),_0x55bac4(_0x5dd4b6,_0x1344fd));}),Ts('data-id','new-element',_0x1bc8d4)['forEach'](_0xd4f734=>{const _0x477921=this['_getUid'](_0xd4f734);Cs(_0xd4f734,'data-id',_0x477921),this['_touchedNodesState']['newIds']['push'](_0x477921);}),this['_removeSpecialComments'](_0x1bc8d4),_0x2cc0b8&&_0x2cc0b8['markUnstableElements']&&this['_markUnstableElements'](_0x1bc8d4,_0x2cc0b8['markUnstableElementsDepth']||0x0),_0x2cc0b8&&_0x2cc0b8['cutAfterLastChange']&&this['_touchedNodesState']['lastTouchedId']){let _0x2b8d7c=ps('data-id',this['_touchedNodesState']['lastTouchedId'],_0x1bc8d4);for(;_0x2b8d7c;)Rs(_0x2b8d7c),_0x2b8d7c=_0x2b8d7c['parentNode'];}return{'parsedContent':_0x1bc8d4,'newNodeIds':this['_touchedNodesState']['newIds'],'modifiedNodeIds':this['_touchedNodesState']['modifiedIds'],'removedNodeIds':this['_touchedNodesState']['removedIds']};}['_insertNodes'](_0x21dd4f,_0xfe68a6,_0x227638){for(const _0xe3199 of _0xfe68a6){const _0x9a492a=this['_getUid'](_0xe3199);Cs(_0xe3199,'data-id',_0x9a492a),this['_touchedNodesState']['newIds']['push'](_0x9a492a),this['_touchedNodesState']['lastTouchedId']=_0x9a492a;}const _0x218f18='afterbegin'===_0x227638||'afterend'===_0x227638?_0xfe68a6['reverse']():_0xfe68a6;for(const _0x36b782 of _0x218f18)ws(_0x21dd4f,_0x36b782,_0x227638);}['_replaceNode'](_0x26d0fa,_0x428c46){if(!_0x26d0fa)return;if(_0x581448=_0x428c46,Ss(Es(_0x26d0fa))===Ss(Es(_0x581448)))return;var _0x581448;const _0x3d378f=this['_getUid'](_0x26d0fa);Cs(_0x428c46,'data-id',_0x3d378f),this['_touchedNodesState']['modifiedIds']['push'](_0x3d378f),this['_touchedNodesState']['lastTouchedId']=_0x3d378f,_0x55bac4(_0x26d0fa,_0x428c46['cloneNode'](!0x0));}['_findReferenceNode'](_0x3f2421,_0x3e3dfa,_0xb06422){const _0x5145c7=this['_findPrevElementWithDataId'](_0x3f2421,!0x1);if(_0x5145c7){const _0x5c70c3=this['_getNodeDataId'](_0x5145c7),_0x4fbbe3=ps('data-id',_0x5c70c3,_0xb06422);if(_0x4fbbe3)return[_0x4fbbe3,'afterend'];this['_touchedNodesState']['invalidIds']['push'](_0x5c70c3);}const _0x27caff=this['_findNextElementWithDataId'](_0x3f2421,!0x1);if(_0x27caff){const _0x4d6aef=this['_getNodeDataId'](_0x27caff),_0x2d6d6b=ps('data-id',_0x4d6aef,_0xb06422);if(_0x2d6d6b)return[_0x2d6d6b,'beforebegin'];this['_touchedNodesState']['invalidIds']['push'](_0x4d6aef);}return _0x3e3dfa?_0x3f2421['nextSibling']?this['_findFallbackReferenceNode'](_0x3f2421,_0xb06422):[_0xb06422['childNodes'][_0xb06422['childNodes']['length']-0x1],'afterend']:[_0xb06422['childNodes'][0x0],'beforebegin'];}['_findFallbackReferenceNode'](_0xa0ef09,_0x37424c){const _0x2b910b=[],_0x349dc1=this['_findPrevElementWithDataId'](_0xa0ef09,!0x0);if(_0x349dc1){const _0x7f8dc3=ps('data-id',this['_getNodeDataId'](_0x349dc1),_0x37424c);_0x7f8dc3&&_0x2b910b['push']([_0x7f8dc3,'afterend']);}const _0x4f5b05=this['_findNextElementWithDataId'](_0xa0ef09,!0x0);if(_0x4f5b05){const _0x4a4fdd=ps('data-id',this['_getNodeDataId'](_0x4f5b05),_0x37424c);_0x4a4fdd&&_0x2b910b['push']([_0x4a4fdd,'beforebegin']);}if(_0x2b910b['length']>0x1)return bs(_0x2b910b[0x0][0x0])<=bs(_0x2b910b[0x1][0x0])?_0x2b910b[0x0]:_0x2b910b[0x1];return 0x1===_0x2b910b['length']?_0x2b910b[0x0]:[_0x37424c['lastChild'],'afterend'];}['_findNextElementWithDataId'](_0x545109,_0x237e8f){let _0x3b7dad=_0x545109['nextSibling'],_0x28eb0b=null,_0x2e62dd=!0x1;for(;_0x3b7dad;){if(_0x16809c(_0x3b7dad)){if(this['_isDelNode'](_0x3b7dad)&&(_0x28eb0b=_0x3b7dad),this['_isExistingContentComment'](_0x3b7dad)&&_0x237e8f&&!_0x2e62dd){_0x2e62dd=!0x0,_0x3b7dad=_0x3b7dad['nextSibling'];continue;}break;}const _0x10478d=ms(_0x3b7dad,'data-id');if(_0x10478d&&'new-element'!==_0x10478d&&this['_existingDataIds']['has'](_0x10478d)){_0x28eb0b=_0x3b7dad;break;}_0x3b7dad=_0x3b7dad['nextSibling'];}return _0x28eb0b;}['_findPrevElementWithDataId'](_0x5e1d0d,_0x331918){let _0x30ce3c=_0x5e1d0d['previousSibling'],_0x3507ac=null,_0x26d6ba=!0x1;for(;_0x30ce3c;){if(_0x16809c(_0x30ce3c)){if(this['_isDelNode'](_0x30ce3c)&&(_0x3507ac=_0x30ce3c),this['_isExistingContentComment'](_0x30ce3c)&&_0x331918&&!_0x26d6ba){_0x26d6ba=!0x0,_0x30ce3c=_0x30ce3c['previousSibling'];continue;}break;}const _0x60deb=ms(_0x30ce3c,'data-id');if(_0x60deb&&'new-element'!==_0x60deb&&this['_existingDataIds']['has'](_0x60deb)){_0x3507ac=_0x30ce3c;break;}_0x30ce3c=_0x30ce3c['previousSibling'];}return _0x3507ac;}['_markWrappedElements'](_0x552212){_0x3e068a(_0x552212)&&Ts('data-id',null,_0x552212)['forEach'](_0x448684=>{this['_isExistingNode'](_0x448684)&&!this['_hasWrappedParent'](_0x448684)&&(Cs(_0x448684,'data-wrapped-id',ms(_0x448684,'data-id')),Cs(_0x448684,'data-id',null));});}['_getNodeDataId'](_0x458661){if(!_0x458661)return null;if(_0x3e068a(_0x458661))return ms(_0x458661,'data-id');if(_0x16809c(_0x458661)){const _0x5b7ac3=Es(_0x458661)['match'](/removed[\s*-]data-id="([^"]+)"/);if(_0x5b7ac3&&_0x5b7ac3[0x1])return _0x5b7ac3[0x1];}return null;}['_storeDeletedElementIds'](_0x410d55){if(_0x16809c(_0x410d55)){const _0x425cf5=Es(_0x410d55)['match'](/removed[\s*-]data-id="([^"]+)"/);_0x425cf5&&_0x425cf5[0x1]&&this['_touchedNodesState']['removedIds']['push'](_0x425cf5[0x1]);}}['_getUid'](_0x26d3f9){return this['_isExistingNode'](_0x26d3f9)?ms(_0x26d3f9,'data-id'):this['_generateUid']();}['_removeSpecialComments'](_0x493a09){(function(_0x2925fa){return _0x29a81b(_0x554fee=>_0x16809c(_0x554fee),_0x2925fa,!0x0,0x1/0x0);}(_0x493a09)['filter'](_0x5143af=>this['_isDelNode'](_0x5143af)||this['_isExistingContentComment'](_0x5143af))['forEach'](_0x36b67a=>{_0x322bd0(_0x36b67a);}));}['_markLastTagElementUnstable'](_0x3a7515){const _0x5aafe3=_0x3a7515['childNodes'],_0x1bffd9=_0x5aafe3[_0x5aafe3['length']-0x1];_0x1bffd9&&_0x3e068a(_0x1bffd9)&&Cs(_0x1bffd9,'data-unstable','true');}['_markUnstableElements'](_0x2d199b,_0x41a45f){const _0x46a689=ps('data-unstable','true',_0x2d199b);if(!_0x46a689)return;const _0x3078d8=fs(_0x46a689)['slice'](0x0,-0x1),_0x51c539=_0x3078d8['length'];let _0x430a7d=_0x46a689;if(_0x51c539>_0x41a45f){let _0x3f1ec8=_0x51c539,_0x2c170c=null;for(;_0x3f1ec8>_0x41a45f&&_0x3f1ec8>=0x0;)_0x3f1ec8--,_0x2c170c=_0x3078d8[_0x3f1ec8];_0x2c170c&&(_0x430a7d=_0x2c170c,Cs(_0x46a689,'data-unstable',null),Cs(_0x2c170c,'data-unstable','true'));}else{if(_0x51c539<_0x41a45f){let _0x41d8bd=_0x51c539,_0x1c6ea5=_0x46a689;for(;_0x41d8bd<_0x41a45f;){const _0x54c80a=_0x1c6ea5['childNodes']['filter'](_0xa766e8=>_0x3e068a(_0xa766e8));if(0x0===_0x54c80a['length'])break;_0x41d8bd++,_0x1c6ea5=_0x54c80a[_0x54c80a['length']-0x1];}_0x1c6ea5&&(_0x430a7d=_0x1c6ea5,Cs(_0x46a689,'data-unstable',null),Cs(_0x1c6ea5,'data-unstable','true'));}}let _0x2b0862=_0x430a7d;for(;_0x2b0862;){for(;_0x2b0862['nextSibling'];)_0x2b0862=_0x2b0862['nextSibling'],_0x3e068a(_0x2b0862)&&Cs(_0x2b0862,'data-unstable','true');_0x2b0862=_0x2b0862['parentNode'];}}['_isNewNode'](_0x5a3221){return Boolean('new-element'===ms(_0x5a3221,'data-id'));}['_isExistingNode'](_0x91896c){return Boolean((ms(_0x91896c,'data-id')||'')['length']>0x0&&'new-element'!==ms(_0x91896c,'data-id'));}['_isDelNode'](_0x48f20d){return!!_0x48f20d&&Boolean(_0x16809c(_0x48f20d)&&Es(_0x48f20d)['match'](/removed[\s*-]data-id="[^"]+"/));}['_hasWrappedParent'](_0x1ef13a){let _0x4cdb94=_0x1ef13a['parentNode'];for(;_0x4cdb94;){if(ms(_0x4cdb94,'data-wrapped-id'))return!0x0;_0x4cdb94=_0x4cdb94['parentNode'];}return!0x1;}['_isExistingContentComment'](_0x4f0c59){return Boolean(_0x16809c(_0x4f0c59)&&Es(_0x4f0c59)['match'](/\s*existing[\s*-](content|document)\s*/g));}}function Ns({editor:_0x18b864,changeGroups:_0x2bf081,documentContextContent:_0x201ae8,showDiff:_0x8525db,trimUnchanged:_0x2d6f80=!0x0}){return _0x2bf081['map'](_0x5ee65d=>{const _0x1f9bde=new _0x24a4fb([]),_0x5b8cb2=new _0x24a4fb([]);for(const _0x108f6e of _0x5ee65d['changes'])if(_0x8525db&&'removed'==_0x108f6e['type']||_0x5b8cb2['children']['push'](_0x108f6e['node']['cloneNode'](!0x0)),'new'!=_0x108f6e['type']&&(_0x8525db||'removed'!=_0x108f6e['type'])){const _0x2c3593=_0x33d270(_0x2b1ea0=>ms(_0x2b1ea0,'data-id')==_0x108f6e['id'],_0x201ae8,!0x0);_0x2c3593&&_0x1f9bde['children']['push'](_0x2c3593['cloneNode'](!0x0));}const {content:_0x329830,hasChanges:_0x3bad5c}=function(_0x2b4516,_0x1ffeea,_0x23e212,_0x50f4d4,_0xade4cb=!0x0){const _0x4f3c06=_0x2b4516['plugins']['get']('DocumentCompare'),_0xeb98cc=Es(_0x1ffeea),_0x56918c=Es(_0x23e212),_0x4153a5=_0x2b4516['data']['parse'](_0xeb98cc,'$root'),_0x12ace1=_0x2b4516['model']['createPositionAt'](_0x4153a5,0x0),_0x4e832e=_0x4f3c06['getDiff'](_0xeb98cc,_0x56918c,{'anchor':_0x12ace1,'markDeletions':_0x50f4d4}),_0x5a5bcc=_0x4e832e['getOperations']();if(0x0==_0x5a5bcc['length'])return{'content':_0x1ffeea['cloneNode'](!0x0),'hasChanges':!0x1};_0x50f4d4?function(_0x1092f9,_0x44d382,_0x44b166){if(0x0==_0x1092f9['length'])return;const _0x144a71=_0x44b166['plugins']['get']('DocumentCompare'),_0x44ad8e=_0x44b166['plugins']['get']('SuggestionsConversion');_0x44b166['model']['change'](_0x24ebe7=>{const _0x5c1e79=new Set();for(let _0x45b8b4=0x0;_0x45b8b4<_0x1092f9['length'];_0x45b8b4++){const _0x37dc84=_0x1092f9[_0x45b8b4];if(_0x37dc84['baseVersion']=null,_0x37dc84['isDocumentOperation']=!0x1,_0x144a71['isMarkedRemoveOperation'](_0x37dc84)){const _0x42f4ea=_0x9bb926(_0x37dc84['newRange'],_0x44b166['model']),_0x27dec7='suggestion:deletion:'+ot()+':$aiSuggestion';_0x44d382['markers']['set'](_0x27dec7,_0x42f4ea);}else switch(_0x37dc84['type']){case'rename':{if(_0x37dc84['oldName']==_0x37dc84['newName'])break;_0x24ebe7['batch']['addOperation'](_0x37dc84),_0x44b166['model']['applyOperation'](_0x37dc84);const _0x383266='$elementName',_0xbdccd7=_0x37dc84['position'],_0x2d646d=_0x44b166['model']['createRange'](_0xbdccd7,_0x44b166['model']['createPositionAt'](_0xbdccd7['nodeAfter'],'end')),_0xc1d8ab='suggestion:attribute:'+_0x383266+':'+ot()+':$aiSuggestion';_0x44d382['markers']['set'](_0xc1d8ab,_0x2d646d);break;}case'addAttribute':case'removeAttribute':case'changeAttribute':{if(_0x37dc84['oldValue']==_0x37dc84['newValue'])break;_0x24ebe7['batch']['addOperation'](_0x37dc84),_0x44b166['model']['applyOperation'](_0x37dc84);const _0x4b4464=_0x37dc84['key'];if(!_0x44ad8e['isRegisteredAttribute'](_0x4b4464))break;const _0x2734a5=_0x9bb926(_0x37dc84['range'],_0x44b166['model']),_0x357896='suggestion:attribute:'+_0x4b4464+':'+ot()+':$aiSuggestion';_0x44d382['markers']['set'](_0x357896,_0x2734a5);break;}case'insert':{_0x24ebe7['batch']['addOperation'](_0x37dc84),_0x44b166['model']['applyOperation'](_0x37dc84);if(_0x1092f9[_0x45b8b4+0x1]&&'move'==_0x1092f9[_0x45b8b4+0x1]['type']){vs(_0x44d382,_0x37dc84);break;}const _0x5a21a9=_0x37dc84['position'],_0x5aaaa3=_0x37dc84['howMany'],_0x151f2a=_0x9bb926(_0x44b166['model']['createRange'](_0x5a21a9,_0x5a21a9['getShiftedBy'](_0x5aaaa3)),_0x44b166['model']),_0x1423a4='suggestion:insertion:'+ot()+':$aiSuggestion';_0x44d382['markers']['set'](_0x1423a4,_0x151f2a);break;}case'split':{_0x24ebe7['batch']['addOperation'](_0x37dc84),_0x44b166['model']['applyOperation'](_0x37dc84);const _0x3ab3b2=_0x37dc84['splitPosition'],_0x302dfd=_0x37dc84['moveTargetPosition'],_0x32e87a=_0x44b166['model']['createRange'](_0x3ab3b2,_0x302dfd),_0xf6edb4='suggestion:insertion:'+ot()+':$aiSuggestion';_0x44d382['markers']['set'](_0xf6edb4,_0x32e87a);break;}case'move':{_0x24ebe7['batch']['addOperation'](_0x37dc84),_0x44b166['model']['applyOperation'](_0x37dc84),_0x1092f9[_0x45b8b4-0x1]&&'insert'==_0x1092f9[_0x45b8b4-0x1]['type']&&vs(_0x44d382,_0x37dc84);const _0x4bc5e4=_0x37dc84['getMovedRangeStart'](),_0x34ec53=_0x37dc84['howMany'];for(let _0x389e19=0x0;_0x389e19<_0x34ec53;_0x389e19++){const _0x24936f=_0x4bc5e4['getShiftedBy'](_0x389e19)['nodeAfter'];_0x5c1e79['add'](_0x24936f);}break;}case'remove':{const _0x1fc2fe=_0x37dc84['sourcePosition'],_0x3264e8=_0x37dc84['howMany'],_0x582d34=new _0x538ce3(_0x1fc2fe,_0x3264e8);_0x24ebe7['batch']['addOperation'](_0x582d34),_0x44b166['model']['applyOperation'](_0x582d34);break;}}}for(const _0x469baf of _0x5c1e79){const _0x55eb41=_0x44b166['model']['createRangeOn'](_0x469baf),_0x45c863='suggestion:formatBlock:$fakeWrap:'+ot()+':$aiSuggestion';_0x44d382['markers']['set'](_0x45c863,_0x9bb926(_0x55eb41,_0x44b166['model']));}});}(_0x5a5bcc,_0x4153a5,_0x2b4516):_0x2b4516['model']['change'](_0xd231bc=>{for(const _0x1bc3e7 of _0x5a5bcc)if('remove'==_0x1bc3e7['type']){const _0x686fb0=_0x1bc3e7['sourcePosition'],_0x2cfbe5=_0x1bc3e7['howMany'],_0x28cd00=new _0x538ce3(_0x686fb0,_0x2cfbe5);_0xd231bc['batch']['addOperation'](_0x28cd00),_0x2b4516['model']['applyOperation'](_0x28cd00);}else{if('marker'==_0x1bc3e7['type']){const _0x74e0fd=_0x1bc3e7['name'],_0x167f4d=_0x1bc3e7['newRange'];null!==_0x167f4d?_0x4153a5['markers']['set'](_0x74e0fd,_0x167f4d):_0x4153a5['markers']['delete'](_0x74e0fd);}else _0x1bc3e7['baseVersion']=null,_0x1bc3e7['isDocumentOperation']=!0x1,_0xd231bc['batch']['addOperation'](_0x1bc3e7),_0x2b4516['model']['applyOperation'](_0x1bc3e7);}});if(_0xade4cb){const _0x8f7cbb=ys(_0x2b4516,_0x5a5bcc,_0x4153a5);xs(_0x2b4516['model'],_0x8f7cbb),function(_0x4b63a7,_0x2aab14){const _0x5c6272=_0x2aab14['getFirstRange']()['start'];let _0x23b149=_0x2aab14['getFirstRange']()['end'];const _0x6026dd=_0x5c6272['root'];(_0x23b149['textNode']||_0x23b149['nodeAfter']&&_0x23b149['nodeAfter']['is']('$text'))&&(_0x360f30(_0x23b149,'...'),_0x23b149=_0x23b149['getShiftedBy'](0x3)),(_0x5c6272['textNode']||_0x5c6272['nodeBefore']&&_0x5c6272['nodeBefore']['is']('$text'))&&(_0x360f30(_0x5c6272,'...'),function(_0x4bcb0f,_0x2b7794,_0x4d03e0){for(let [_0x3e318,_0x1d9179]of _0x4bcb0f['markers']){const _0x4d9a3e=_0x1d9179['_getTransformedByInsertion'](_0x2b7794,_0x4d03e0,!0x1);_0x1d9179=_0x4d9a3e[0x0],_0x4bcb0f['markers']['set'](_0x3e318,_0x1d9179);}}(_0x6026dd,_0x5c6272,0x3),_0x5c6272['parent']==_0x23b149['parent']&&(_0x23b149=_0x23b149['getShiftedBy'](0x3)));const _0x13350d=_0x4b63a7['createRange'](_0x4b63a7['createPositionAt'](_0x6026dd,0x0),_0x5c6272),_0x5dfa32=_0x4b63a7['createRange'](_0x23b149,_0x4b63a7['createPositionAt'](_0x6026dd,'end')),_0x564e00=[..._0x13350d['getMinimalFlatRanges'](),..._0x5dfa32['getMinimalFlatRanges']()];_0x564e00['reverse']();for(const _0x5e1686 of _0x564e00)_0x43c115(_0x5e1686),Ds(_0x6026dd,_0x5e1686);}(_0x2b4516['model'],_0x8f7cbb);}const _0x2e2870=_0x2b4516['data']['stringify'](_0x4153a5,{'showSuggestionHighlights':!0x0});return{'content':Is(_0x2e2870),'hasChanges':!0x0};}(_0x18b864,_0x1f9bde,_0x5b8cb2,_0x8525db,_0x2d6f80);return{'type':_0x5ee65d['changes'][0x0]['type'],'index':_0x5ee65d['index'],'content':_0x329830,'hasChanges':_0x3bad5c};});}function vs(_0xe4e8af,_0x2ecb3c){for(const [_0x583cad,_0x9d69c1]of _0xe4e8af['markers']){const _0xc7eb20=_0x1569aa['_createFromRanges'](_0x9d69c1['getTransformedByOperation'](_0x2ecb3c));_0xe4e8af['markers']['set'](_0x583cad,_0xc7eb20);}}function ys(_0x471c0f,_0x3205f4,_0x25c01d){const _0x5d1704=_0x471c0f['plugins']['get']('DocumentCompare');let _0x250dcb=_0x471c0f['model']['createPositionAt'](_0x25c01d,Number['POSITIVE_INFINITY']),_0x195133=_0x471c0f['model']['createPositionAt'](_0x25c01d,0x0);for(const _0x272209 of _0x3205f4){let _0x134fe8,_0x454fef;if(_0x5d1704['isMarkedRemoveOperation'](_0x272209))_0x134fe8=_0x272209['newRange']['start'],_0x454fef=_0x272209['newRange']['end'];else switch(_0x250dcb=_0x250dcb['getTransformedByOperation'](_0x272209),_0x195133=_0x195133['getTransformedByOperation'](_0x272209),_0x272209['type']){case'rename':_0x134fe8=_0x272209['position'],_0x454fef=_0x134fe8['getShiftedBy'](0x1);break;case'addAttribute':case'removeAttribute':case'changeAttribute':_0x134fe8=_0x272209['range']['start'],_0x454fef=_0x272209['range']['end'];break;case'insert':_0x134fe8=_0x272209['position'],_0x454fef=_0x134fe8['getShiftedBy'](_0x272209['howMany']);break;case'split':_0x134fe8=_0x272209['splitPosition'],_0x454fef=_0x272209['moveTargetPosition'];break;case'merge':{const _0x5492fb=_0x272209['targetPosition']['path']['slice'](0x0,-0x1);_0x134fe8=_0x471c0f['model']['createPositionFromPath'](_0x25c01d,_0x5492fb),_0x454fef=_0x134fe8['getShiftedBy'](0x1);break;}case'remove':{const _0x9aad46=_0x272209['howMany'],_0x21120f=_0x272209['sourcePosition']['_getTransformedByInsertion'](_0x272209['targetPosition'],_0x9aad46),_0x1bb63c=_0x272209['getMovedRangeStart']();'remove'==_0x272209['type']?(_0x134fe8=_0x21120f,_0x454fef=_0x21120f):(_0x134fe8=_0x1bb63c,_0x454fef=_0x1bb63c['getShiftedBy'](_0x9aad46));break;}}_0x134fe8&&_0x134fe8['isBefore'](_0x250dcb)&&(_0x250dcb=_0x134fe8['clone'](),_0x250dcb['stickiness']='toNone'),_0x454fef&&_0x454fef['isAfter'](_0x195133)&&(_0x195133=_0x454fef['clone'](),_0x195133['stickiness']='toNone');}return _0x471c0f['model']['createSelection'](_0x471c0f['model']['createRange'](_0x250dcb,_0x195133));}function xs(_0x41aef0,_0x243f67){Ls(_0x41aef0,_0x243f67,'forward');const _0x16bb99=_0x243f67['getFirstRange']();_0x243f67['setTo']([]),_0x243f67['setTo'](_0x16bb99,{'backward':!0x0}),Ls(_0x41aef0,_0x243f67,'backward');}function Ls(_0x338995,_0x501735,_0x2f8fae){let _0xa38ea1=0x14;for(;_0xa38ea1;){_0x338995['modifySelection'](_0x501735,{'unit':'word','direction':_0x2f8fae}),_0xa38ea1--;const _0x28ea=_0x501735['focus']['forward'==_0x2f8fae?'nodeBefore':'nodeAfter'];if(_0x28ea&&_0x28ea['is']('element')&&_0x338995['schema']['isBlock'](_0x28ea)&&_0x338995['schema']['isObject'](_0x28ea))break;}}function Ds(_0x42f908,_0x5f0971){for(const [_0x5486da,_0x2d16fb]of _0x42f908['markers']){const _0x15648d=_0x2d16fb['_getTransformedByDeletion'](_0x5f0971['start'],_0x5f0971['end']['offset']-_0x5f0971['start']['offset']);null!=_0x15648d?_0x42f908['markers']['set'](_0x5486da,_0x15648d):_0x42f908['markers']['delete'](_0x5486da);}}class Ps extends ct(){['id'];['interactionId'];['type'];['sources']=[];['parsedContent']=new _0x24a4fb([]);['parsedMergedContent']=new _0x24a4fb([]);['changeGroups']=[];['areActionsDisabled']=!0x1;['documentContextContent'];['aiResponseParser'];['aiResponseApplier'];['editor'];['cachedSuggestionContentParts']={'withDiff':[],'withoutDiff':[]};constructor({type:_0x52adf7,content:_0x21ee8f='',isDone:_0x494e58=!0x1,interactionId:_0x248c6b,areActionsDisabled:_0x4cc71e,documentContextContent:_0x18aeb8,editor:_0xb6f102,id:_0x262e09}){super(),this['id']=_0x262e09||ot(),this['interactionId']=_0x248c6b,this['type']=_0x52adf7,this['areActionsDisabled']=!!_0x4cc71e,this['editor']=_0xb6f102,this['aiResponseParser']=new Os(),this['aiResponseApplier']=new ks(),this['documentContextContent']=Is(_0x18aeb8||''),this['set']('isDone',_0x494e58),this['on']('change:content',()=>{this['onContentChange']();}),this['set']('content',_0x21ee8f);}['appendContent'](_0x113f7f){this['set']('content',this['content']+_0x113f7f);}['done'](){this['isDone']||(this['set']('isDone',!0x0),this['onContentChange']());}['destroy'](){this['stopListening']();}['setChangeGroupState'](_0x490852,_0x1eed3d){this['changeGroups'][_0x490852]['state']=_0x1eed3d,this['fire']('replyChangeGroupStateUpdated',{'reply':this,'index':_0x490852,'state':_0x1eed3d});}['getContentParts']({showDiff:_0x11dc46,groupIndex:_0x3c1294}){if(!this['editor'])throw new ht('ai-get-editor-from-context-no-editor',null,{'aiReply':this});const _0x24184b=this['_getCachedContentParts'](_0x11dc46,_0x3c1294);if(_0x24184b)return _0x24184b;let _0x18d526=[];if(void 0x0===_0x3c1294)_0x18d526=this['changeGroups'];else{const _0x1ab720=this['changeGroups']['find'](({index:_0x262a40})=>_0x262a40===_0x3c1294);if(!_0x1ab720)throw new ht('ai-reply-get-content-parts-group-not-found',null,{'aiReply':this,'groupIndex':_0x3c1294});_0x18d526=[_0x1ab720];}const _0x1b7808=Ns({'editor':this['editor'],'showDiff':_0x11dc46,'changeGroups':_0x18d526,'documentContextContent':this['documentContextContent']});return this['_setCachedContentParts'](_0x11dc46,_0x1b7808),_0x1b7808;}['_getCachedContentParts'](_0x2621e0,_0x4a93f1){const _0x2da40b=_0x2621e0?'withDiff':'withoutDiff';if(!this['cachedSuggestionContentParts'][_0x2da40b]['length'])return null;const _0x168c87=this['cachedSuggestionContentParts'][_0x2da40b];if(void 0x0===_0x4a93f1)return _0x168c87['length']>0x0&&_0x168c87['length']!==this['changeGroups']['length']?(this['_setCachedContentParts'](_0x2621e0,null),null):_0x252e77(_0x168c87);{const _0x1b909b=_0x168c87['find'](({index:_0x440cea})=>_0x440cea===_0x4a93f1);if(_0x1b909b)return[_0x252e77(_0x1b909b)];}return null;}['_setCachedContentParts'](_0x2c87e2,_0x2f763d){const _0x252ba8=_0x2c87e2?'withDiff':'withoutDiff';_0x2f763d?_0x2f763d['forEach'](_0x55d31c=>{const _0x38857a=this['cachedSuggestionContentParts'][_0x252ba8],_0x456c1a=_0x38857a['find'](({index:_0x5d01df})=>_0x5d01df===_0x55d31c['index']);if(_0x456c1a){const _0x1b982a=_0x38857a['indexOf'](_0x456c1a);_0x38857a['splice'](_0x1b982a,0x1,_0x55d31c);}else _0x38857a['push'](_0x55d31c);}):this['cachedSuggestionContentParts'][_0x252ba8]['length']=0x0;}['onContentChange'](){if('modification'===this['type']){this['parsedContent']=this['aiResponseParser']['parseAndNormalizeHTML'](this['content']);const _0x12e894=this['changeGroups'];this['updateChangeGroups']();const _0x325cfd=this['_getDifferentChangeGroups'](_0x12e894,this['changeGroups']);(_0x325cfd['length']||this['isDone'])&&(this['fire']('replyContentUpdated',this,_0x325cfd),this['cachedSuggestionContentParts']['withDiff']['length']=this['cachedSuggestionContentParts']['withoutDiff']['length']=0x0);}else this['parsedContent']=this['aiResponseParser']['convertMarkdownToHTML'](this['content']),this['fire']('replyContentUpdated',this);}['_getDifferentChangeGroups'](_0x1364da,_0x53da39){const _0x1647f5=[];for(const _0x22cb68 of _0x53da39){const _0x180fbe=_0x1364da[_0x22cb68['index']];_0x180fbe?_0x180fbe['changes']['length']!==_0x22cb68['changes']['length']?_0x1647f5['push'](_0x22cb68):_0x180fbe['changes']['forEach']((_0x449bfb,_0x1cdcd5)=>{const _0x24c491=_0x22cb68['changes'][_0x1cdcd5];_0x449bfb['id']!==_0x24c491['id']&&_0x1647f5['push'](_0x22cb68);}):_0x1647f5['push'](_0x22cb68);}return _0x1647f5;}['updateChangeGroups'](){const _0x292832=new _0x385c4b('p',{},[new _0x385c4b('span',{'style':'color:\x20#808080;\x20font-style:\x20italic'},[new _0xf06b4d(us(this['editor']['locale'],'AI_SUGGESTION_CONTENT_PART_REMOVED'))])]),_0x342ced=this['aiResponseApplier']['merge'](this['parsedContent'],this['documentContextContent']['cloneNode'](!0x0),{'markUnstableElements':!this['isDone'],'replaceRemovedWith':_0x292832,'cutAfterLastChange':!this['isDone']});if(!_0x342ced['modifiedNodeIds']['length']&&!this['isDone'])return;this['parsedMergedContent']=_0x342ced['parsedContent'];let _0x1ac8ba=[];if(_0x61616a(_0x3e87fd=>{const _0x3c77d6=ms(_0x3e87fd,'data-id');if(!_0x3c77d6||!_0x407392(_0x3c77d6))return!0x1;const _0x54fa5d=[_0x3e87fd,...fs(_0x3e87fd)]['at'](-0x2);if(_0x3e87fd!=_0x54fa5d){const _0xc567c3=ms(_0x54fa5d,'data-id');_0x407392(_0xc567c3)||(_0x1ac8ba['push']({'node':_0x54fa5d,'id':_0xc567c3,'type':'modified'}),_0x342ced['modifiedNodeIds']['push'](_0xc567c3));}else _0x342ced['modifiedNodeIds']['includes'](_0x3c77d6)?_0x1ac8ba['push']({'node':_0x3e87fd,'type':'modified','id':_0x3c77d6}):_0x342ced['newNodeIds']['includes'](_0x3c77d6)?_0x1ac8ba['push']({'node':_0x3e87fd,'type':'new','id':_0x3c77d6,'anchorId':ms(_0x3e87fd['previousSibling'],'data-id')}):_0x1ac8ba['push']({'node':_0x3e87fd,'type':'removed','id':_0x3c77d6});return!0x0;},this['parsedMergedContent']),_0x1ac8ba=_0x1ac8ba['filter'](({node:_0x2b23bb})=>[...fs(_0x2b23bb),_0x2b23bb]['every'](_0x58c7c4=>!ms(_0x58c7c4,'data-unstable'))),0x0==_0x1ac8ba['length'])return;const _0x312bcb=[[_0x1ac8ba[0x0]]];for(let _0x504838=0x1;_0x504838<_0x1ac8ba['length'];_0x504838++){const _0x38f0e9=_0x312bcb[_0x312bcb['length']-0x1],_0x17f011=_0x38f0e9[_0x38f0e9['length']-0x1];_0x1ac8ba[_0x504838]['node']['previousSibling']==_0x17f011['node']&&'modified'!=_0x1ac8ba[_0x504838]['type']&&'modified'!=_0x17f011['type']?_0x38f0e9['push'](_0x1ac8ba[_0x504838]):_0x312bcb['push']([_0x1ac8ba[_0x504838]]);}for(const _0x243a67 of _0x312bcb){const _0x4a37c0=_0x243a67[0x0],_0xa24946=_0x243a67[_0x243a67['length']-0x1],_0x1bb3cb=_0x45d54f(_0x4a37c0['node']['previousSibling']);_0x1bb3cb&&_0x243a67['unshift'](_0x1bb3cb);const _0x5733f6=_0x45d54f(_0xa24946['node']['nextSibling']);_0x5733f6&&_0x243a67['push'](_0x5733f6);}function _0x407392(_0x597850){return _0x342ced['modifiedNodeIds']['includes'](_0x597850)||_0x342ced['newNodeIds']['includes'](_0x597850)||_0x342ced['removedNodeIds']['includes'](_0x597850);}function _0x45d54f(_0x4b9c43){if(_0x4b9c43&&ms(_0x4b9c43,'data-id')&&!ms(_0x4b9c43,'data-unstable')){const _0x4150ea=ms(_0x4b9c43,'data-id');if(!_0x407392(_0x4150ea))return{'node':_0x4b9c43,'type':'context','id':_0x4150ea};}return null;}this['changeGroups']=_0x312bcb['map']((_0x25afe5,_0x294b31)=>({'changes':_0x25afe5,'state':'pending','index':_0x294b31}));}}const Hs=['interactionCreated','interactionStarted','interactionStopped','interactionFinished','interactionDestroyed','replyCreated','replyContentUpdated','replyChangeGroupStateUpdated','setConversationTitle','webSearchStarted','webSearchFinished','reasoningStarted','reasoningFinished','toolDataReceived','error'];class Ms extends pt(){['id'];['replies']=[];['currentReply'];['messageId'];['actionCallId'];['currentRequest'];['connector'];['isStopped']=!0x1;['isDestroyed']=!0x1;['editor'];['_isReasoning']=!0x1;['_isWebSearching']=!0x1;constructor({connector:_0x5bd179,editor:_0x4d06a6}){super(),this['id']=ot(),this['connector']=_0x5bd179,this['isStopped']=!0x0,this['editor']=_0x4d06a6;}async['start'](){const _0xd3c7e4=[];let _0x35925e,_0x361b57,_0x4a7a20;this['isStopped']=!0x1;try{this['currentRequest']=await this['sendRequest'](),this['fire']('interactionStarted',this);const _0xe11a07=await this['currentRequest']['getStream']();for await(const _0x4d40ee of _0xe11a07){if(this['isStopped'])return;if('error'==_0x4d40ee['event'])return void this['fire']('error',{'error':new ht('ai-chat-interaction-error',this)});switch(_0x4d40ee['event']){case'message-metadata':this['messageId']=_0x4d40ee['data']['messageId'];break;case'action-metadata':this['actionCallId']=_0x4d40ee['data']['callId'];break;case'conversation-title':this['setConversationTitle'](_0x4d40ee['data']['conversationTitle'],!0x0);break;case'source':_0xd3c7e4['push'](_0x4d40ee['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'](),_0x35925e='modification-delta'==_0x4d40ee['event']?'modification':'text',_0x361b57='modification-delta'==_0x4d40ee['event']?_0x4d40ee['data']['id']:void 0x0,this['currentReply']&&this['currentReply']['type']!=_0x35925e&&(this['currentReply']['done'](),this['currentReply']=void 0x0),this['currentReply']||(this['currentReply']=this['createReply']({'type':_0x35925e,'interactionId':this['id'],'id':_0x361b57}),'modification'==_0x35925e&&(this['currentReply']['sources']=_0xd3c7e4['splice'](0x0))),this['currentReply']['appendContent'](_0x4d40ee['data']['textDelta']);break;case'mcp-tool-result':_0x4a7a20=JSON['parse'](_0x4d40ee['data']['result']),this['_handleToolResultData']({'toolName':_0x4d40ee['data']['toolName'],'data':_0x4a7a20['data'],'attributes':_0x4a7a20['attributes']});break;case'mcp-tool-notification':this['_handleToolNotificationData']({'toolName':_0x4d40ee['data']['toolName'],'data':_0x4d40ee['data']['data']});}}}finally{this['isStopped']||(this['currentReply']&&_0xd3c7e4['length']>0x0&&(this['currentReply']['sources']=_0xd3c7e4['splice'](0x0)),this['_finalizeInteraction'](),this['fire']('interactionFinished',this));}}['stop'](){this['isStopped']||(this['_finalizeInteraction'](),this['fire']('interactionStopped',this));}['getReply'](_0x2a10d7){return this['replies']['find'](_0x29746b=>_0x29746b['id']===_0x2a10d7);}['destroy'](){this['isDestroyed']||(this['stop'](),this['replies']['forEach'](_0x30e346=>_0x30e346['destroy']()),this['replies']=[],this['isDestroyed']=!0x0,this['fire']('interactionDestroyed',this),this['stopListening']());}['createReply'](_0x4e925f){const _0x2afac4=new Ps({'editor':this['editor'],'documentContextContent':this['getDocumentContext']()?.['content'],..._0x4e925f});return this['replies']['push'](_0x2afac4),_0x2afac4['delegate'](...Hs)['to'](this),this['fire']('replyCreated',_0x2afac4),_0x2afac4;}['setConversationTitle'](_0x217862,_0x23df0b=!0x1){this['fire']('setConversationTitle',_0x217862,_0x23df0b);}['resetWebSearchState'](){this['_isWebSearching']&&(this['_isWebSearching']=!0x1,this['fire']('webSearchFinished',this));}['resetReasoningState'](){this['_isReasoning']&&(this['_isReasoning']=!0x1,this['fire']('reasoningFinished',this));}['_handleToolResultData'](_0x2bf1fc){this['fire']('toolDataReceived',{'type':'result','toolName':_0x2bf1fc['toolName'],'data':structuredClone(_0x2bf1fc['data']||{}),'attributes':structuredClone(_0x2bf1fc['attributes']||{})},this);}['_handleToolNotificationData'](_0x31dca4){this['fire']('toolDataReceived',{'type':'notification','toolName':_0x31dca4['toolName'],'data':structuredClone(_0x31dca4['data'])},this);}['_finalizeInteraction'](){this['isStopped']=!0x0,this['currentRequest']&&this['currentRequest']['abortController']['abort'](),this['currentReply']&&this['currentReply']['done'](),this['currentRequest']=this['currentReply']=void 0x0;}}var Us=function(_0x2c8336){return _0x2c8336['TOOL']='mcp-tool-context',_0x2c8336['FILE']='file',_0x2c8336['DOCUMENT']='document',_0x2c8336['URL']='web-resource',_0x2c8336['TEXT']='text',_0x2c8336['SELECTION']='selection',_0x2c8336;}({}),Vs=function(_0x3b0dd3){return _0x3b0dd3['TEXT']='text',_0x3b0dd3['MARKDOWN']='markdown',_0x3b0dd3['HTML']='html',_0x3b0dd3;}({});const Bs=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']]),Gs=['contextItemAdded','contextItemRemoved','contextItemLoadingEnded','contextSent','error','addContextOptionsChanged','sourceResourcesLoaded','resourceStateChanged','uploadProgressChanged'];class Fs extends ct(){['_connector'];['_config'];['_ownerId'];constructor({connector:_0x17fcc7,config:_0x2fcd11,ownerId:_0x314191}){super(),this['_connector']=_0x17fcc7,this['_config']=_0x2fcd11,this['_ownerId']=_0x314191;}['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'](_0x36c2ce){const _0x83d681=await this['_createContextItemFromContent'](_0x36c2ce);return this['_addToConversationContextItem'](_0x83d681),'current-document'===_0x83d681['uiId']&&this['_toggleAddCurrentDocumentOptionVisibility'](),_0x83d681;}async['_createContextItemFromContent'](_0x300be0){if(_0x300be0['type']===Us['DOCUMENT']){const _0x535f79=await this['_connector']['fetchDocument'](this['_ownerId'],_0x300be0['id'])['getDocument']();return{'id':'current-document','uiId':'current-document','label':'Current\x20document','type':_0x300be0['type'],'content':_0x535f79['content'],'hidden':this['_conversationContextItems']['has']('current-document'),'version':_0x535f79['attributes']?.['version'],'sessionId':_0x535f79['attributes']?.['sessionId']};}if(_0x300be0['type']===Us['TOOL'])return{'id':_0x300be0['id'],'uiId':_0x300be0['id'],'label':_0x300be0['data']?.['label']||_0x300be0['id'],'type':Us['TOOL'],'mcpServerName':_0x300be0['mcpServerName'],'toolName':_0x300be0['toolName'],'data':_0x300be0['data']||{}};return{'id':_0x300be0['id'],'uiId':_0x300be0['id'],'label':_0x300be0['attributes']?.['label']||_0x300be0['name']||_0x300be0['url']||_0x300be0['id'],'type':_0x300be0['type'],..._0x300be0?.['attributes']?.['resourceId']?{'resourceId':_0x300be0['attributes']?.['resourceId']}:{}};}['getSentContextItems'](){return new Map(this['_conversationContextItems']);}['removeFromContext'](_0x46c22c){const _0x2cddf4=this['_pendingContextItems']['get'](_0x46c22c);_0x2cddf4?.['isReadOnly']||this['_removeContextItem'](_0x46c22c);}['clearPendingContextItems'](){if(0x0===this['_pendingContextItems']['size'])return;for(const _0x4efe62 of this['_pendingContextItems']['values']())this['_removeContextItem'](_0x4efe62['uiId']);const _0x14d4ae=this['_conversationContextItems']['get']('current-document')||this['_pendingContextItems']['get']('current-document');_0x14d4ae&&this['_addContextItem']({..._0x14d4ae,'isReadOnly':!0x0,'hidden':!0x0});}['addToConversationContext'](_0x4fc540){for(const _0x48b65c of _0x4fc540['values']())this['_addToConversationContextItem'](_0x48b65c);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'](_0x42eb4f){return Array['from'](_0x42eb4f['values']())['map'](_0x4761c1=>this['_mapContextItemToRequestData'](_0x4761c1))['filter'](_0x49227b=>null!==_0x49227b);}async['addFilesToContext'](_0x3c2312,_0x27974f,_0x41a2f6=Us['FILE']){const _0x34df70='files-'+ot();this['_startUploadOperation'](_0x34df70);try{await Promise['all'](_0x3c2312['map'](async _0x248200=>{const _0x33362c='file-'+ot(),_0x4e994e=_0x2d90f2(_0x248200['name']);try{this['_addContextItem']({'type':_0x41a2f6,'label':_0x27974f?.['label']||_0x4e994e,'uiId':_0x33362c,'resourceId':_0x27974f?.['resourceId']},!0x0);const _0x4d3e0c=this['_connector']['uploadFile'](this['_ownerId'],_0x248200,_0x27974f);this['_ongoingUploads']['set'](_0x33362c,_0x4d3e0c['abortController']);const {id:_0x2fe16e}=await _0x4d3e0c['getId']();this['_ongoingUploads']['delete'](_0x33362c),this['_finishContextItemLoading']({'type':_0x41a2f6,'id':_0x2fe16e,'label':_0x27974f?.['label']||_0x4e994e,'uiId':_0x33362c,'resourceId':_0x27974f?.['resourceId']},!0x1);}catch(_0x1559e6){this['_ongoingUploads']['delete'](_0x33362c);if(!(_0x1559e6 instanceof ht&&_0x1559e6['message']['startsWith']('ai-request-aborted'))){const _0x370d19=Bs['get'](_0x1559e6['code'])||'ai-chat-file-upload-failed',_0x2bb971=new ht(_0x370d19,null,{'fileName':_0x4e994e,..._0x1559e6});_0x2bb971['stack']=_0x1559e6['stack'],this['fire']('error',{'error':_0x2bb971});}this['_removeContextItem'](_0x33362c);}}));}finally{this['_finishUploadOperation'](_0x34df70);}}['addCurrentDocumentToContext'](_0x4adeb0){if(this['isCurrentDocumentInContext']()||!this['_addContextOptionsState']['document']['enabled'])return;const _0x2cbf22={'type':Us['DOCUMENT'],'uiId':'current-document','label':_0x4adeb0,'isReadOnly':this['_conversationContextItems']['has']('current-document'),'hidden':this['_conversationContextItems']['has']('current-document')};this['_addContextItem'](_0x2cbf22);}async['updateCurrentDocument'](_0x21c265,_0x490075,_0x44556c,_0x2558d8){const _0x3de2c5=this['_pendingContextItems']['get']('current-document');if(_0x3de2c5&&_0x21c265){_0x3de2c5['selection']=_0x2558d8?_0x2558d8['map'](_0x27d2a9=>({'start':_0x27d2a9['start'],'end':_0x27d2a9['end']})):[];try{if(_0x3de2c5['version']===_0x490075)return;const {id:_0x409633}=await this['_connector']['uploadDocument'](this['_ownerId'],_0x21c265,{'version':_0x490075,'sessionId':_0x44556c})['getId']();_0x3de2c5['id']=_0x409633,_0x3de2c5['content']=_0x21c265,_0x3de2c5['version']=_0x490075,_0x3de2c5['sessionId']=_0x44556c;}catch(_0x278f37){const _0x43a826=new ht('ai-chat-document-upload-failed',null);_0x43a826['stack']=_0x278f37['stack'],this['fire']('error',{'error':_0x43a826});}}}['addSelectionToContext'](_0xbed80c){this['_addContextItem']({'type':Us['SELECTION'],'label':_0xbed80c,'uiId':'selection','content':_0xbed80c});}['removeSelectionFromContext'](){this['_removeContextItem']('selection');}async['addUrlToContext'](_0x17df5e,_0xaf2671){const _0x458b35='url-'+ot();this['_startUploadOperation'](_0x458b35);const _0x43851d='url-'+ot();try{this['_addContextItem']({'type':Us['URL'],'label':_0xaf2671?.['label']||_0x17df5e,'uiId':_0x43851d,'resourceId':_0xaf2671?.['resourceId']},!0x0);const _0xe2825a=this['_connector']['uploadUrl'](this['_ownerId'],_0x17df5e,_0xaf2671);this['_ongoingUploads']['set'](_0x43851d,_0xe2825a['abortController']);const {id:_0x1c3fc4}=await _0xe2825a['getId']();this['_ongoingUploads']['delete'](_0x43851d),this['_finishContextItemLoading']({'type':Us['URL'],'id':_0x1c3fc4,'label':_0xaf2671?.['label']||_0x17df5e,'uiId':_0x43851d,'resourceId':_0xaf2671?.['resourceId']},!0x1);}catch(_0x31c0fb){this['_ongoingUploads']['delete'](_0x43851d),(_0x31c0fb['message']['startsWith']('ai-request-aborted')||this['fire']('error',{'error':new ht('ai-chat-url-upload-failed',this,{'url':_0x17df5e,'originalError':_0x31c0fb}),'url':_0x17df5e}),this['_removeContextItem'](_0x43851d));}finally{this['_finishUploadOperation'](_0x458b35);}}['addToolItemToContext'](_0x23b4d8){_0x23b4d8['id']=_0x23b4d8['id']??ot()['substring'](0x0,0x15),this['_pendingContextItems']['set'](_0x23b4d8['uiId'],_0x23b4d8),this['fire']('contextItemAdded',{'contextItem':_0x23b4d8,'isLoading':!0x1});}async['loadSourceResources'](_0x14b4c7,_0x11e4d8,_0xcbe6cc){const _0x3e2b60=this['_addContextOptionsState']['sources']['find'](_0x4f928a=>_0x4f928a['id']===_0x14b4c7);if(!_0x3e2b60)return this['fire']('error',{'error':new ht('ai-chat-source-not-found',this,{'sourceId':_0x14b4c7}),'sourceId':_0x14b4c7}),[];try{const _0x42c9aa=(await _0x3e2b60['getResources'](_0x11e4d8))['map'](_0x1b9491=>{const _0x758795=this['_isResourceInContext'](_0x1b9491['id']);return{..._0x1b9491,'isInContext':_0x758795};});return _0x3e2b60['resources']=_0x42c9aa,this['fire']('sourceResourcesLoaded',{'sourceId':_0x14b4c7,'source':_0x3e2b60,'resources':_0x42c9aa,'uid':_0xcbe6cc}),_0x42c9aa;}catch(_0x3f73ef){return this['fire']('error',{'error':new ht('ai-chat-source-resources-load-failed',this,{'sourceId':_0x14b4c7,'originalError':_0x3f73ef}),'sourceId':_0x14b4c7,'sourceLabel':_0x3e2b60['label']}),[];}}async['addResourceToContext'](_0x5d2c49,_0x29a0cf){if(this['_isResourceInContext'](_0x29a0cf['id']))return;let _0x336789=_0x29a0cf['data'];if(!_0x336789&&_0x5d2c49['getData'])try{_0x336789=await _0x5d2c49['getData'](_0x29a0cf['id']);}catch(_0x45dae8){return void this['fire']('error',{'error':new ht('ai-chat-resource-load-failed',this,{'resourceId':_0x29a0cf['id'],'sourceId':_0x5d2c49['id'],'originalError':_0x45dae8}),'resourceId':_0x29a0cf['id'],'sourceId':_0x5d2c49['id']});}if(_0x336789)switch(_0x29a0cf['type']){case Us['URL']:if('string'!=typeof _0x336789)return void this['fire']('error',{'error':new ht('ai-chat-context-invalid-data',this,{'resourceId':_0x29a0cf['id'],'sourceId':_0x5d2c49['id'],'expectedType':'string','actualType':typeof _0x336789}),'resourceId':_0x29a0cf['id'],'sourceId':_0x5d2c49['id']});await this['addUrlToContext'](_0x336789,{'label':_0x29a0cf['label'],'resourceId':_0x29a0cf['id']});break;case Us['FILE']:if(!(_0x336789 instanceof File))return void this['fire']('error',{'error':new ht('ai-chat-context-invalid-data',this,{'resourceId':_0x29a0cf['id'],'sourceId':_0x5d2c49['id'],'expectedType':'File','actualType':typeof _0x336789}),'resourceId':_0x29a0cf['id'],'sourceId':_0x5d2c49['id']});await this['addFilesToContext']([_0x336789],{'label':_0x29a0cf['label'],'resourceId':_0x29a0cf['id']});break;case Us['TEXT']:if('object'!=typeof _0x336789||!('content'in _0x336789)||!('type'in _0x336789))return void this['fire']('error',{'error':new ht('ai-chat-context-invalid-data',this,{'resourceId':_0x29a0cf['id'],'sourceId':_0x5d2c49['id'],'expectedType':'object\x20with\x20content\x20and\x20type\x20properties','actualType':typeof _0x336789}),'resourceId':_0x29a0cf['id'],'sourceId':_0x5d2c49['id']});_0x336789=Fs['_convertTextResourceToFile'](_0x336789,_0x29a0cf['label']),await this['addFilesToContext']([_0x336789],{'label':_0x29a0cf['label'],'resourceId':_0x29a0cf['id']},Us['TEXT']);break;case Us['TOOL']:break;default:this['fire']('error',{'error':new ht('ai-chat-context-unsupported-type',this,{'resourceId':_0x29a0cf['id'],'sourceId':_0x5d2c49['id'],'resourceType':_0x29a0cf['type']}),'resourceId':_0x29a0cf['id'],'sourceId':_0x5d2c49['id']});}else this['fire']('error',{'error':new ht('ai-chat-resource-no-data',this,{'resourceId':_0x29a0cf['id'],'sourceId':_0x5d2c49['id']}),'resourceId':_0x29a0cf['id'],'sourceId':_0x5d2c49['id']});}static['_convertTextResourceToFile'](_0x1fbe3d,_0x5e286a){switch(_0x1fbe3d['type']){case Vs['MARKDOWN']:return new File([_0x1fbe3d['content']],_0x5e286a,{'type':'text/markdown'});case Vs['HTML']:return new File([_0x1fbe3d['content']],_0x5e286a,{'type':'text/html'});default:return new File([_0x1fbe3d['content']],_0x5e286a,{'type':'text/plain'});}}static['_mapContextItemToRequestData'](_0x2a98ea){switch(_0x2a98ea['type']){case Us['FILE']:return{'type':Us['FILE'],'id':_0x2a98ea['id']};case Us['URL']:return{'type':Us['URL'],'id':_0x2a98ea['id']};case Us['DOCUMENT']:return{'type':Us['DOCUMENT'],'id':_0x2a98ea['id'],..._0x2a98ea['selection']?.['length']&&{'selection':_0x2a98ea['selection']}};case Us['TEXT']:return{'type':Us['FILE'],'id':_0x2a98ea['id']};case Us['TOOL']:{const _0x307599=_0x2a98ea;return{'type':Us['TOOL'],'mcpServerName':_0x307599['mcpServerName'],'toolName':_0x307599['toolName'],'data':_0x307599['data'],'id':_0x307599['id']};}default:return null;}}['_addContextItem'](_0x3695f9,_0x111fbd=!0x1){if(this['_pendingContextItems']['set'](_0x3695f9['uiId'],_0x3695f9),_0x3695f9['hidden']||this['fire']('contextItemAdded',{'contextItem':_0x3695f9,'isLoading':_0x111fbd}),'current-document'===_0x3695f9['uiId']&&this['_toggleAddCurrentDocumentOptionVisibility'](),_0x3695f9['resourceId']){const _0x3c59a1=this['_findSourceIdsByResourceId'](_0x3695f9['resourceId']);_0x3c59a1&&_0x3c59a1['forEach'](_0x2ca0df=>{this['_updateResourceInContextState'](_0x2ca0df,_0x3695f9['resourceId'],!0x0);});}}['_removeContextItem'](_0x250efa){const _0x4c07bb=this['_pendingContextItems']['get'](_0x250efa),_0x1f521a=this['_ongoingUploads']['get'](_0x250efa);if(_0x1f521a&&(_0x1f521a['abort'](),this['_ongoingUploads']['delete'](_0x250efa)),_0x4c07bb?.['resourceId']){const _0x26c6d4=this['_findSourceIdsByResourceId'](_0x4c07bb['resourceId']);_0x26c6d4&&_0x26c6d4['forEach'](_0x4fc8bd=>{this['_updateResourceInContextState'](_0x4fc8bd,_0x4c07bb['resourceId'],!0x1);});}this['_pendingContextItems']['delete'](_0x250efa),this['fire']('contextItemRemoved',{'uiId':_0x250efa,'type':_0x4c07bb?.['type']}),'current-document'===_0x250efa&&this['_toggleAddCurrentDocumentOptionVisibility']();}['_finishContextItemLoading'](_0x1ed9d2,_0x4868cb){if(this['_pendingContextItems']['has'](_0x1ed9d2['uiId'])&&(this['_pendingContextItems']['set'](_0x1ed9d2['uiId'],_0x1ed9d2),this['fire']('contextItemLoadingEnded',{'contextItem':_0x1ed9d2,'isLoading':_0x4868cb}),_0x1ed9d2['resourceId'])){const _0x58d4ab=this['_findSourceIdsByResourceId'](_0x1ed9d2['resourceId']);_0x58d4ab&&_0x58d4ab['forEach'](_0x42646c=>{this['_updateResourceInContextState'](_0x42646c,_0x1ed9d2['resourceId'],!0x0);});}}['_addToConversationContextItem'](_0x2ba985){this['_conversationContextItems']['set'](_0x2ba985['uiId'],_0x2ba985);}['_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'](_0x3f3b8f=>({..._0x3f3b8f,'enabled':!0x0}))??[]},this['fire']('addContextOptionsChanged',{'options':this['_addContextOptionsState']});}['_getCustomSourcesInitialState'](){return this['_config']?.['sources']?.['map'](_0x19f19f=>({..._0x19f19f,'resources':[]}))??[];}['_toggleAddCurrentDocumentOptionVisibility'](){const _0x5c473c=this['isCurrentDocumentInContext']()||this['isCurrentDocumentInConversation']();this['_addContextOptionsState']['document']['isHidden']=_0x5c473c,this['fire']('addContextOptionsChanged',{'options':this['_addContextOptionsState']});}['_isResourceInContext'](_0x23d16e){for(const _0x3c4bc1 of this['_pendingContextItems']['values']())if(_0x3c4bc1['resourceId']===_0x23d16e)return!0x0;for(const _0x9bdb96 of this['_conversationContextItems']['values']())if(_0x9bdb96['resourceId']===_0x23d16e)return!0x0;return!0x1;}['_findSourceIdsByResourceId'](_0x20cac3){const _0x4ef49f=[];for(const _0x3b7ba0 of this['_addContextOptionsState']['sources']){_0x3b7ba0['resources']['find'](_0x31e637=>_0x31e637['id']===_0x20cac3)&&_0x4ef49f['push'](_0x3b7ba0['id']);}return 0x0===_0x4ef49f['length']?null:_0x4ef49f;}['_updateResourceInContextState'](_0xf8b318,_0xefe168,_0xc13906){const _0x379d94=this['_addContextOptionsState']['sources']['find'](_0x5c88bf=>_0x5c88bf['id']===_0xf8b318);if(!_0x379d94)return;const _0x22f13a=_0x379d94['resources']['find'](_0x7f5f77=>_0x7f5f77['id']===_0xefe168);_0x22f13a&&(_0x22f13a['isInContext']=_0xc13906,this['fire']('resourceStateChanged',{'sourceId':_0xf8b318,'resourceId':_0xefe168,'isInContext':_0xc13906}));}['_startUploadOperation'](_0x224bb4){this['_ongoingUploadOperations']['set'](_0x224bb4,!0x0),this['_ongoingUploadOperations']['size']&&this['fire']('uploadProgressChanged',{'isUploadInProgress':!0x0});}['_finishUploadOperation'](_0x150e44){this['_ongoingUploadOperations']['delete'](_0x150e44),0x0===this['_ongoingUploadOperations']['size']&&this['fire']('uploadProgressChanged',{'isUploadInProgress':!0x1});}}const Ks=['capabilitiesUpdated'];class Ws extends pt(){['_isWebSearchEnabled'];['_isReasoningEnabled'];constructor(){super(),this['_isWebSearchEnabled']=!0x1,this['_isReasoningEnabled']=!0x1;}['init'](){this['reset']();}['reset'](){this['setWebSearch'](!0x1),this['setReasoning'](!0x1);}['getCapabilitiesConfig'](){return{'isWebSearchEnabled':this['_isWebSearchEnabled'],'isReasoningEnabled':this['_isReasoningEnabled']};}static['getCapabilitiesRequestData'](_0x3b63a8){const _0x536198={};return _0x3b63a8&&_0x3b63a8['isWebSearchEnabled']&&(_0x536198['webSearch']={}),_0x3b63a8&&_0x3b63a8['isReasoningEnabled']&&(_0x536198['reasoning']={}),_0x536198;}['toggleWebSearch'](){this['setWebSearch'](!this['_isWebSearchEnabled']);}['toggleReasoning'](){this['setReasoning'](!this['_isReasoningEnabled']);}['setWebSearch'](_0x505f1b){_0x505f1b!==this['_isWebSearchEnabled']&&(this['_isWebSearchEnabled']=_0x505f1b,this['fire']('capabilitiesUpdated',this['getCapabilitiesConfig']()));}['setReasoning'](_0x4c2d63){_0x4c2d63!==this['_isReasoningEnabled']&&(this['_isReasoningEnabled']=_0x4c2d63,this['fire']('capabilitiesUpdated',this['getCapabilitiesConfig']()));}}class Ys extends Ms{['userMessage'];['conversationId'];['contextItems']=new Map();['capabilities'];['model'];['attributes'];constructor(_0x4d1854){super(_0x4d1854),this['conversationId']=_0x4d1854['conversationId'],this['contextItems']=_0x4d1854['contextItems'],this['capabilities']=_0x4d1854['capabilities'],this['userMessage']=_0x4d1854['userMessage'],this['model']=_0x4d1854['model'],this['attributes']=_0x4d1854['attributes'];}async['sendRequest'](){return this['connector']['queryAssistant']({'message':this['userMessage'],'conversationId':this['conversationId'],'parts':Fs['mapContextItemsToRequestData'](this['contextItems']),'capabilities':Ws['getCapabilitiesRequestData'](this['capabilities']),'model':this['model'],'attributes':this['attributes']});}['getDocumentContext'](){return this['contextItems']['get']('current-document');}}class $s extends pt(){['id'];['isStarted']=!0x1;['isFromHistory'];['interactions']=[];['currentInteraction'];['selectedModel'];['connector'];['options'];constructor(_0xccc1a1){super(),this['options']=_0xccc1a1,this['connector']=_0xccc1a1['connector'],this['chatModels']=_0xccc1a1['chatModels'],this['id']=_0xccc1a1['conversationId'],this['isFromHistory']=_0xccc1a1['isFromHistory'];}async['init'](_0x3eb3d9){try{this['chatContext']=new Fs({'connector':this['connector'],'config':_0x3eb3d9,'ownerId':this['id']}),this['chatContext']['delegate'](...Gs)['to'](this),this['chatContext']['init'](),this['chatCapabilities']=new Ws(),this['chatCapabilities']['delegate'](...Ks)['to'](this),this['chatCapabilities']['init']();const _0x19e859=await this['chatModels']['getAvailableModels']();this['fire']('conversationInitialized',{'availableModels':_0x19e859});const _0x1c26df=await this['chatModels']['getModel'](this['options']['selectedModelId']);_0x1c26df&&await this['setModel'](_0x1c26df);}catch(_0x18745a){const _0x52f54d=new ht('ai-chat-conversation-init-failed',null,{'message':_0x18745a['message']||_0x18745a});_0x52f54d['stack']=_0x18745a['stack'],this['fire']('error',{'error':_0x52f54d});}}async['start'](){if(this['isStarted'])throw new ht('ai-chat-conversation-already-started',null,{'conversation':this});if(!this['selectedModel'])throw new ht('ai-chat-conversation-start-no-model-selected',null,{'conversation':this});try{const {id:_0x1d7153}=await this['connector']['startConversation'](this['id'],this['options']['group'])['getConversation']();this['id']=_0x1d7153,this['isStarted']=!0x0,this['fire']('conversationStarted',{'conversationId':this['id'],'selectedModel':this['selectedModel']});}catch(_0x592e62){const _0x16a1ea=new ht('ai-chat-conversation-start-failed',null,{'message':_0x592e62['message'],'conversationId':this['id']});throw _0x16a1ea['stack']=_0x592e62['stack'],this['fire']('error',{'error':_0x16a1ea}),_0x16a1ea;}}async['load'](_0x164d64,_0x1b6289){try{const _0x497591=await this['connector']['fetchConversation'](_0x164d64)['getConversation'](),_0x356f38=await this['connector']['fetchConversationMessages'](_0x164d64)['getMessages'](),_0x16c327=_0x356f38[0x0]['model'];this['isStarted']=!0x0,this['id']=_0x497591['id'],'title'in _0x497591?this['fire']('setConversationTitle',_0x497591['title'],!0x0):this['fire']('setConversationTitle','',!0x0);const _0x3c57bd=(await this['chatModels']['getAll']())['find'](_0x5ad79d=>_0x5ad79d['id']['toLowerCase']()===_0x16c327['toLowerCase']());return this['selectedModel']=_0x3c57bd,this['fire']('modelSelected',{'selectedModel':_0x3c57bd,'isDisabled':!0x0}),await this['_processMessagesToInteractions'](_0x356f38,_0x1b6289,_0x16c327),this['currentInteraction']=void 0x0,this;}catch(_0x2dc757){const _0x584140=new ht('ai-chat-conversation-init-from-id-failed',null,{'message':_0x2dc757['message'],'conversationId':_0x164d64});throw _0x584140['stack']=_0x2dc757['stack'],this['fire']('error',{'error':_0x584140}),_0x584140;}}async['_processMessagesToInteractions'](_0xc44ba3,_0x195879,_0x10ab9d){let _0x3716a6;for(const _0x2088b9 of _0xc44ba3)if('user'===_0x2088b9['role']){const _0xe27dd=await this['_extractContextItems'](_0x2088b9),_0x1a9750={'isReasoningEnabled':Object['hasOwn'](_0x2088b9['capabilities'],'reasoning'),'isWebSearchEnabled':Object['hasOwn'](_0x2088b9['capabilities'],'webSearch')};_0x3716a6=this['createInteraction']({'userMessage':_0x2088b9['prompt'],'contextItems':_0xe27dd,'capabilities':_0x1a9750,'modelId':_0x10ab9d,'attributes':_0x2088b9['attributes']}),this['currentInteraction']=_0x3716a6,this['chatContext']['addToConversationContext'](this['currentInteraction']['contextItems']);}else{if('assistant'===_0x2088b9['role']&&_0x3716a6){const _0x2bf686=[];for(const _0xe2ab1f of _0x2088b9['content'])switch(_0xe2ab1f['type']){case'text':case'modification':{const _0x3ae76d=_0x3716a6['getDocumentContext']()?.['sessionId']!==_0x195879;_0x3716a6['currentReply']=_0x3716a6['createReply']({'type':_0xe2ab1f['type'],'isDone':!0x0,'interactionId':_0x3716a6['id'],'areActionsDisabled':_0x3ae76d}),_0x3716a6['currentReply']['appendContent'](_0xe2ab1f['content']),_0x2bf686['length']>0x0&&(_0x3716a6['currentReply']['sources']=_0x2bf686['splice'](0x0));break;}case'url':_0x2bf686['push'](_0xe2ab1f);break;case'mcp-tool-result':{const {data:_0x25441b,attributes:_0x51b105}=JSON['parse'](_0xe2ab1f['content']);_0x3716a6['_handleToolResultData']({'toolName':_0xe2ab1f['toolName'],'data':_0x25441b,'attributes':_0x51b105});break;}}}}}async['_extractContextItems'](_0xdacb08){const _0x1cab00=new Map();if(!_0xdacb08['content'])return _0x1cab00;for(const _0x28663b of _0xdacb08['content']){const _0x40a2b7=await this['chatContext']['populateFromMessage'](_0x28663b);_0x40a2b7&&_0x1cab00['set'](_0x40a2b7['id'],_0x40a2b7);}return _0x1cab00;}async['handleUserInteraction']({userMessage:_0x500dbd,attributes:_0x42afde}){if(!this['isStarted'])throw new ht('ai-chat-handle-user-conversation-not-initialized',null,{'conversation':this});if(this['currentInteraction'])throw new ht('ai-chat-handle-user-interaction-already-in-progress',null,{'conversation':this});try{const _0x346db1=this['chatContext']['getPendingContextItems'](),_0x4c3fcb=this['chatCapabilities']['getCapabilitiesConfig'](),_0x4bab5e=this['selectedModel']['id'];this['currentInteraction']=this['createInteraction']({'userMessage':_0x500dbd,'contextItems':_0x346db1,'capabilities':_0x4c3fcb,'modelId':_0x4bab5e,'attributes':_0x42afde}),await this['currentInteraction']['start'](),this['chatContext']['addToConversationContext'](this['currentInteraction']['contextItems']);}catch(_0x27e9d3){if(_0x27e9d3 instanceof ht)this['fire']('error',{'interactionId':this['currentInteraction']?this['currentInteraction']['id']:void 0x0,'error':_0x27e9d3});else{const _0x17c969=Bs['get'](_0x27e9d3['code'])||'ai-chat-handle-user-interaction-start-failed';this['fire']('error',{'interactionId':this['currentInteraction']?this['currentInteraction']['id']:void 0x0,'error':new ht(_0x17c969,null,{'error':_0x27e9d3})});}}finally{this['currentInteraction']?.['stop'](),this['currentInteraction']=void 0x0;}}['createInteraction']({userMessage:_0x6b6d8,contextItems:_0x3c0963,capabilities:_0x10e1d4,modelId:_0x31473c,attributes:_0x1a632e}){const _0x525876=new Ys({'userMessage':_0x6b6d8,'contextItems':_0x3c0963,'capabilities':_0x10e1d4,'conversationId':this['id'],'connector':this['connector'],'editor':this['options']['getEditor']&&this['options']['getEditor'](),'model':_0x31473c,'attributes':_0x1a632e});return _0x525876['delegate'](...Hs)['to'](this),this['interactions']['push'](_0x525876),this['fire']('interactionCreated',_0x525876),_0x525876;}['getInteraction'](_0x340015){return this['interactions']['find'](_0x48a73d=>_0x48a73d['id']===_0x340015);}['removeInteraction'](_0x2b35cd){const _0x126e4e=this['getInteraction'](_0x2b35cd);_0x126e4e&&(_0x126e4e['destroy'](),this['interactions']['splice'](this['interactions']['indexOf'](_0x126e4e),0x1));}get['lastInteraction'](){return this['interactions'][this['interactions']['length']-0x1];}['addCurrentDocumentToContext'](_0x43344b){this['chatContext']['addCurrentDocumentToContext'](_0x43344b);}async['updateCurrentDocumentInContext']({content:_0x390d43,version:_0x16d5c1,sessionId:_0x4e4619,selections:_0x1042ce}){await this['chatContext']['updateCurrentDocument'](_0x390d43,_0x16d5c1,_0x4e4619,_0x1042ce);}['getCurrentDocumentContext'](){return this['currentInteraction']?.['getDocumentContext']()?.['content']||'';}['addSelectionToContext'](_0x55308a){this['chatContext']['addSelectionToContext'](_0x55308a);}['removeSelectionFromContext'](){this['chatContext']['removeSelectionFromContext']();}['addFilesToContext'](_0x5f0abc){this['chatContext']['addFilesToContext'](_0x5f0abc);}['addUrlToContext'](_0x1cc516){this['chatContext']['addUrlToContext'](_0x1cc516);}['addToolItemToContext'](_0x4f0d7f){this['chatContext']['addToolItemToContext'](_0x4f0d7f);}['addResourceToContext'](_0x4f2c90,_0x48d8a3){this['chatContext']['addResourceToContext'](_0x4f2c90,_0x48d8a3);}['loadSourceResources'](_0xdb4db5,_0x5ae03e,_0xf3eb4d){return this['chatContext']['loadSourceResources'](_0xdb4db5,_0x5ae03e,_0xf3eb4d);}['removeFromContext'](_0x2005c3){this['chatContext']['removeFromContext'](_0x2005c3);}['setWebSearch'](_0x1319a5){this['chatCapabilities']['setWebSearch'](_0x1319a5);}['toggleWebSearch'](){this['chatCapabilities']['toggleWebSearch']();}['setReasoning'](_0x509eb0){this['chatCapabilities']['setReasoning'](_0x509eb0);}['toggleReasoning'](){this['chatCapabilities']['toggleReasoning']();}['isCurrentDocumentInContext'](){return this['chatContext']['isCurrentDocumentInContext']();}['isCurrentDocumentInConversation'](){return this['chatContext']['isCurrentDocumentInConversation']();}['isSelectionInContext'](){return this['chatContext']['isSelectionInContext']();}async['setModel'](_0x478066){_0x478066?!0x1===await this['chatModels']['isAvailable'](_0x478066)&&(Tt('ai-chat-conversation-set-model-not-available',{'conversation':this,'model':_0x478066}),_0x478066=(await this['chatModels']['getAvailableModels']())[0x0]):(Tt('ai-chat-conversation-set-model-null',{'conversation':this}),_0x478066=(await this['chatModels']['getAvailableModels']())[0x0]),_0x478066['id']!==this['selectedModel']?.['id']&&(this['selectedModel']=_0x478066,this['chatCapabilities']['reset'](),this['fire']('modelSelected',{'selectedModel':_0x478066}));}}class qs extends pt(){['_connector'];['_config'];['_locale'];['_modelList']=[];['_modelsRequest']=null;constructor({connector:_0xbf0a94,config:_0x35fb24,locale:_0x597536}){super(),this['_connector']=_0xbf0a94,this['_config']=_0x35fb24,this['_locale']=_0x597536;}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 _0x1f59d6=await this['getAll']();let _0x4ebd80;return _0x4ebd80=this['_availableModels']?this['_filterModels'](_0x1f59d6,this['_availableModels']):_0x1f59d6['filter'](_0x33a502=>_0x33a502['recommended']),_0x4ebd80;}async['getModel'](_0x6550f6){const _0x23961e=await this['getAll']();if(!_0x23961e['length'])return null;if(_0x6550f6){const _0x4ddaec=this['_getModelById'](_0x23961e,_0x6550f6);if(_0x4ddaec)return _0x4ddaec;Tt('ai-chat-model-id-unrecognized',{'modelId':_0x6550f6,'fallBackModelId':this['_defaultModelId']});}return this['getDefault']();}async['getDefault'](){const _0x41b1b0=await this['getAvailableModels']();if(!_0x41b1b0['length'])return null;if(this['_defaultModelId']){const _0x49ffe3=this['_getModelById'](_0x41b1b0,this['_defaultModelId']);if(_0x49ffe3)return _0x49ffe3;Tt('ai-chat-default-model-id-unrecognized',{'defaultModelId':this['_defaultModelId'],'fallBackModelId':_0x41b1b0[0x0]['id']});}return _0x41b1b0[0x0];}async['isAvailable'](_0x1d8caa){return(await this['getAvailableModels']())['some'](_0x73a924=>_0x73a924['name']===_0x1d8caa['name']&&_0x73a924['provider']===_0x1d8caa['provider']);}async['_retrieveModels'](){if(!this['_modelList']['length'])try{const _0x4b35e8=this['_locale']['uiLanguage']||'en',_0xf736d2=this['_connector']['getModels'](_0x4b35e8),_0x59f113=await _0xf736d2['list']();this['_modelList']=_0x59f113['items']['map'](_0x3085a7=>Qs(_0x3085a7)?{..._0x3085a7,'name':us(this['_locale'],'AI_MODEL_NAME_AUTO')}:_0x3085a7);}catch(_0x35afcb){throw mt('ai-models-unable-to-retrieve',{'error':_0x35afcb}),_0x35afcb;}return[...this['_modelList']];}['_filterModels'](_0x21b51d,_0xd813af){let _0x13212b;if(_0xd813af){_0x13212b=[];const _0xfdafff=new Set(),_0x1fd105='string'==typeof _0xd813af?[_0xd813af['toLocaleLowerCase']()]:_0xd813af['map'](_0xceb52a=>_0xceb52a['toLocaleLowerCase']());for(const _0x4b3c2a of _0x1fd105)for(const _0xa3dfbe of _0x21b51d)!_0xfdafff['has'](_0xa3dfbe['id'])&&this['_isMatchingFilter'](_0xa3dfbe,_0x4b3c2a)&&(_0x13212b['push'](_0xa3dfbe),_0xfdafff['add'](_0xa3dfbe['id']));}else _0x13212b=_0x21b51d;return _0x13212b;}['_isMatchingFilter'](_0x1c7122,_0x2492ba){const _0x3698a9=_0x1c7122['id']['toLocaleLowerCase'](),_0x30555b=_0x1c7122['name']['toLocaleLowerCase'](),_0x2e1d46=_0x1c7122['provider']['toLocaleLowerCase']();return _0x3698a9===_0x2492ba||_0x30555b===_0x2492ba||Qs(_0x1c7122)&&'auto'===_0x2492ba||_0x2e1d46===_0x2492ba||_0x3698a9['startsWith'](_0x2492ba);}['_getModelById'](_0x573598,_0x374250){return _0x573598['find'](_0x349de0=>Qs(_0x349de0)&&'auto'===_0x374250?_0x349de0:_0x349de0['id']===_0x374250)||null;}}function Qs(_0x310eff){return _0x310eff['id']['startsWith']('agent');}function Xs(_0x397cfb){if(_0x397cfb instanceof _0x3c1522)return _0x397cfb;if(_0x397cfb?.['editors']&&_0x397cfb['editors']['get'](0x0))return _0x397cfb['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.'),_0x397cfb['editors']['get'](0x0);throw new ht('ai-get-editor-from-context-no-editor');}function zs({editor:_0xa28e68,interaction:_0x3a4202,reply:_0x244193,groups:_0x2c00c1,transform:_0x5c08ce,documentCompare:_0x2856aa,documentCompareOptions:_0x1163ec}){const _0x1680b8=_0x3a4202['getDocumentContext']();if(!_0x1680b8)return[];const _0x810ca3=_0x1680b8['content'],_0x550e5f=_0x1680b8['version'],_0x4e2a70=_0x244193['documentContextContent']['cloneNode'](!0x0);for(const {changes:_0x183184}of _0x2c00c1){const _0x22d8f8=_0x183184['filter'](_0x587e42=>'new'!=_0x587e42['type'])['map'](_0x30363d=>ps('data-id',_0x30363d['id'],_0x4e2a70)),_0x584910=_0x183184['filter'](_0x14a1fa=>'removed'!=_0x14a1fa['type'])['map'](_0x2d0b8b=>_0x2d0b8b['node']['cloneNode'](!0x0));let _0x3770ee=null;if(_0x22d8f8['length']){_0x3770ee=_0x22d8f8[0x0]['previousSibling'];for(let _0x283be5=0x0;_0x283be5<_0x22d8f8['length'];_0x283be5++)_0x322bd0(_0x22d8f8[_0x283be5]);}if(_0x584910['length']){_0x3770ee||(_0x183184[0x0]['anchorId']?_0x3770ee=ps('data-id',_0x183184[0x0]['anchorId'],_0x4e2a70):(_0x3770ee=_0x584910['shift'](),_0x285d06(_0x4e2a70,_0x3770ee)));for(let _0x3999a9=0x0;_0x3999a9<_0x584910['length'];_0x3999a9++)_0x508d22(_0x3770ee,_0x584910[_0x3999a9]),_0x3770ee=_0x584910[_0x3999a9];}}const _0x75e811=Es(_0x4e2a70),_0x26fc05=_0x2856aa['getDiff'](_0x810ca3,_0x75e811,_0x1163ec)['getOperations']();if(_0x5c08ce){const _0x45103d=_0xa28e68['model']['document']['history']['getOperations'](_0x550e5f),_0x459f00={'document':_0xa28e68['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1};return _0x5ad7d5(_0x26fc05,_0x45103d,_0x459f00)['operationsA'];}return _0x26fc05;}function js(_0x307dc5,_0x1916d3){if('marker'!=_0x1916d3['type'])return;const _0x1f0750=_0x307dc5['model']['markers']['get'](_0x1916d3['name']);_0x1f0750&&(_0x1916d3['oldRange']=_0x1f0750['getRange']());}class Js extends _0x12c8be{['activeConversation'];['_aiEditing'];['_aiConnector'];['_aiChatUi'];['_aiChatModels'];['_aiChatBalloon'];['_batchToChanges']=new Map();['_currentPreviewedChangeGroup']=null;['_bodyCollection'];static get['requires'](){return[ls,_0x27dffc];}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 qs({'connector':this['_aiConnector'],'config':this['context']['config']['get']('ai.models'),'locale':this['context']['locale']});const _0x213b05=this['context']['plugins']['get']('AITabs');this['listenTo'](this['_aiChatUi'],'startConversation',()=>{this['_startConversationSafely']();}),this['listenTo'](this['_aiChatUi'],'sendUserMessage',(_0x5d7d06,_0x136b25)=>{this['_handleUIUserMessage']({'message':_0x136b25});}),this['listenTo'](_0x213b05,'resizedTabs',(_0x35f752,_0x53d664)=>{this['_setIsMaximized'](_0x53d664);}),this['listenTo'](this['_aiChatUi'],'resizeTabs',()=>{_0x213b05['resize']();}),this['listenTo'](_0x213b05['view'],'change:activeTab',(_0x22471f,_0x497689,_0x592447)=>{'chat'!==_0x592447&&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',(_0x523d6a,_0x5f59e8)=>{this['activeConversation']?.['addFilesToContext'](Array['from'](_0x5f59e8));}),this['listenTo'](this['_aiChatUi'],'addUrlToContext',(_0x312722,_0x254d4a)=>{this['activeConversation']?.['addUrlToContext'](_0x254d4a);}),this['listenTo'](this['_aiChatUi'],'executeCustomItemCallback',(_0x33a5ec,_0x2dfe08)=>{_0x2dfe08['callback'](this['context']);}),this['listenTo'](this['_aiChatUi'],'addResourceToContext',(_0x1cd113,_0x127587)=>{this['activeConversation']?.['addResourceToContext'](_0x127587['source'],_0x127587['resource']);}),this['listenTo'](this['_aiChatUi'],'removeContextItem',(_0x315b09,_0x4e35d3)=>{this['_removeFromContext'](_0x4e35d3);}),this['listenTo'](this['_aiChatUi'],'loadSourceResources',(_0x56164e,_0x31ab25)=>{this['activeConversation']?.['loadSourceResources'](_0x31ab25['sourceId'],_0x31ab25['query'],_0x31ab25['uid']);}),this['listenTo'](this['_aiChatUi'],'toggleWebSearch',()=>{this['_toggleWebSearch']();}),this['listenTo'](this['_aiChatUi'],'toggleReasoning',()=>{this['_toggleReasoning']();}),this['listenTo'](this['_aiChatUi'],'selectModel',(_0x37f41a,_0x15e492)=>{this['activeConversation']?.['setModel'](_0x15e492);}),this['listenTo'](this['_aiChatUi'],'like',(_0x2b2807,{replyId:_0x2eabe7})=>{console['log']('Liked\x20response',_0x2eabe7);}),this['listenTo'](this['_aiChatUi'],'dislike',(_0x5a143d,{replyId:_0x303eec})=>{console['log']('Disliked\x20response',_0x303eec);}),this['listenTo'](this['_aiChatUi'],'insertSuggestion',(_0x26c795,_0x4960d7)=>{this['_insertSuggestion'](_0x4960d7);}),this['listenTo'](this['_aiChatUi'],'showChangeInText',(_0x18f5c2,{replyId:_0x527584,partIndex:_0x48a4df})=>{this['_aiChatBalloonShowDiff']=this['_aiChatUi']['showDiff'],this['_openBalloonFor'](_0x527584,_0x48a4df);}),this['listenTo'](this['_aiChatUi'],'mouseOverSuggestion',(_0x3642d2,{replyId:_0x5632db,partIndex:_0x3bb4e1})=>{const _0x2c4b52=this['_getDocumentRangeForReplyChanges'](_0x5632db,_0x3bb4e1);_0x2c4b52&&'$graveyard'!=_0x2c4b52['range']['root']['rootName']&&this['_aiEditing']['showFakeVisualSelection']({'ranges':[_0x2c4b52['range']],'id':'change-area','priority':0xa});}),this['listenTo'](this['_aiChatUi'],'mouseLeaveSuggestion',()=>{this['_aiEditing']['hideFakeVisualSelection']('change-area');}),this['listenTo'](this['_aiChatUi'],'applySuggestion',(_0x174f38,_0x28c632)=>{this['_aiEditing']['hideFakeVisualSelection']('change-area'),this['_applySuggestion'](_0x28c632);}),this['listenTo'](this['_aiChatUi'],'toggleSuggestionDisplayMode',async(_0x238f74,{replyId:_0x4bceb3,showDiff:_0x3f1212})=>{const {reply:_0x3c9897}=this['getInteractionAndReplyById'](_0x4bceb3),_0x2b0d95=_0x3c9897['getContentParts']({'showDiff':_0x3f1212});await this['_aiChatUi']['updateFeedItemAIReplySuggestionContent']({'id':_0x3c9897['id'],'parts':_0x2b0d95,'renderingStrategy':'static'});}),this['listenTo'](this['_aiChatUi'],'rejectSuggestion',(_0x2093ab,{replyId:_0x2984e2,partIndex:_0x8a504b})=>{this['_rejectSuggestion']({'replyId':_0x2984e2,'partIndex':_0x8a504b}),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:_0xcdc0ea,partIndex:_0x9dddbd}=this['_currentPreviewedChangeGroup'];this['_aiChatBalloonShowDiff']=!this['_aiChatBalloonShowDiff'];const {reply:_0x5178e4}=this['getInteractionAndReplyById'](_0xcdc0ea),_0x5051a4=_0x5178e4['getContentParts']({'showDiff':this['_aiChatBalloonShowDiff'],'groupIndex':_0x9dddbd});this['_aiChatBalloon']['updateContent']({'part':_0x5051a4[0x0],'renderingStrategy':'static','keepErrors':!0x0});}),this['listenTo'](this['_aiChatBalloon'],'applySuggestion',()=>{const {replyId:_0x2aec38,partIndex:_0x590e26}=this['_currentPreviewedChangeGroup'];this['_applySuggestion']({'replyId':_0x2aec38,'partIndex':_0x590e26}),this['_aiChatBalloon']['setState']('accepted');}),this['listenTo'](this['_aiChatBalloon'],'insertSuggestion',()=>{const {replyId:_0x569ac1,partIndex:_0xf1a0}=this['_currentPreviewedChangeGroup'];this['_insertSuggestion']({'replyId':_0x569ac1,'partIndex':_0xf1a0}),this['_aiChatBalloon']['setState']('accepted');}),this['listenTo'](this['_aiChatBalloon'],'rejectSuggestion',()=>{const {replyId:_0x55ea74,partIndex:_0x1994d8}=this['_currentPreviewedChangeGroup'];this['_rejectSuggestion']({'replyId':_0x55ea74,'partIndex':_0x1994d8}),this['_aiChatBalloon']['setState']('rejected');}),this['listenTo'](this['_aiChatBalloon'],'showNext',()=>{const {replyId:_0x4dad20,partIndex:_0x119c20}=this['_currentPreviewedChangeGroup'],_0x6c5594=this['_getPresentableSiblingContentPartIndex'](_0x4dad20,_0x119c20,'next');null!==_0x6c5594&&this['_openBalloonFor'](_0x4dad20,_0x6c5594);}),this['listenTo'](this['_aiChatBalloon'],'showPrevious',()=>{const {replyId:_0x2c0899,partIndex:_0xbd5247}=this['_currentPreviewedChangeGroup'],_0x2b886f=this['_getPresentableSiblingContentPartIndex'](_0x2c0899,_0xbd5247,'previous');null!==_0x2b886f&&this['_openBalloonFor'](_0x2c0899,_0x2b886f);}),this['listenTo'](this['_aiChatBalloon'],'dialogClosed',(_0x1a0594,{id:_0x57a4f7})=>{if('aiChatBalloon'!==_0x57a4f7)return;const {replyId:_0x214499,partIndex:_0x4da0e1}=this['_currentPreviewedChangeGroup'];this['_currentPreviewedChangeGroup']=null,this['_aiChatUi']['setFeedItemAIReplySuggestionPartActive']({'id':_0x214499,'index':_0x4da0e1,'isActive':!0x1});}));}async['afterInit'](){this['context']instanceof _0x3c1522?this['_integrateEditor'](this['context']):this['listenTo'](this['context']['editors'],'add',(_0x3d193e,_0x151598)=>{_0x151598['on']('ready',()=>{this['_integrateEditor'](_0x151598);});});const _0x5ce13c=this['context']['config']['get']('ai.chat.initialConversation');let _0x4cd8da=_0x5ce13c;if('lastCreated'!=_0x5ce13c||(_0x4cd8da=await this['_getLastCreatedConversationId'](),_0x4cd8da))return'new'==_0x4cd8da?this['_startConversationSafely']():this['loadConversation'](_0x4cd8da);}async['destroy'](){return await this['_stopLastInteraction'](),this['_bodyCollection']['detachFromDom'](),super['destroy']();}async['loadConversation'](_0xc835eb){this['context']['plugins']['has']('AIChatBalloon')&&this['context']['plugins']['get']('AIChatBalloon')['close'](),(this['context']['plugins']['get'](cs)['view']['activateTab']('chat'),this['_aiChatUi']['setFeedItemRenderingStrategy']('static'),this['_aiChatUi']['toggleLoadingSkeleton'](!0x0),await this['_stopLastInteraction']());try{await this['_aiConnector']['fetchConversation'](_0xc835eb)['getConversation'](),await this['_startConversationSafely'](_0xc835eb),this['_updateConversationTitle']('\x20'),await this['activeConversation']['load'](_0xc835eb,this['_aiEditing']['sessionId']),this['activeConversation']['isCurrentDocumentInConversation']()&&this['addCurrentDocumentToChatContext']();}catch(_0x27ae7d){this['_aiChatUi']['addFeedItemError']({'errorMessage':us(this['context']['locale'],'AI_CHAT_UNABLE_TO_LOAD_CONVERSATION'),'id':_0xc835eb}),this['_logError'](new ht('ai-chat-conversation-not-found',this,{'error':_0x27ae7d}));}finally{this['_aiChatUi']['startAutoScroll'](),this['_aiChatUi']['setFeedItemRenderingStrategy']('streaming'),this['_aiChatUi']['toggleLoadingSkeleton'](!0x1);}}['registerToolDataCallback'](_0x310429){let _0x3b515e=null,_0x35bb12=null;this['on']('toolDataReceived',(_0x3686cb,_0x344a5c,_0xa4e133)=>{_0xa4e133['id']!==_0x3b515e&&(_0x3b515e=_0xa4e133['id'],_0x35bb12=this['_getAIChatFeedAPI'](_0xa4e133)),_0x310429(_0x344a5c,_0x35bb12);});}['addCurrentDocumentToChatContext'](){this['activeConversation']?.['addCurrentDocumentToContext'](us(this['context']['locale'],'AI_CHAT_CONTEXT_CURRENT_DOCUMENT'));}async['addSelectionToChatContext'](){const _0x186625=this['_aiEditing']['getSelectionText']();this['activeConversation']?.['addSelectionToContext'](_0x186625),this['addCurrentDocumentToChatContext']();}['removeSelectionFromChatContext'](){this['activeConversation']?.['removeSelectionFromContext']();}['focusPromptInput'](){this['_aiChatUi']['focusPromptInput']();}async['startConversation'](){await this['_startConversationSafely']();}async['sendMessage'](_0x44798f){await this['_handleUIUserMessage'](_0x44798f);}['getGroupId'](){const _0x132ee8=this['context']['config']['get']('collaboration.channelId');if(!_0x132ee8)throw new ht('ai-chat-missing-channel-id',this);return _0x132ee8;}['_handleRemovedConversation'](_0x66ff15){this['activeConversation']['id']===_0x66ff15&&this['_startConversationSafely']();}['_insertSuggestion'](_0x337fdd){const _0x29cf25=Xs(this['context']);if(!_0x29cf25['plugins']['has']('TrackChanges'))throw new ht('ai-no-track-changes',null);const _0x41ac66=this['context']['plugins']['get']('DocumentCompare'),{reply:_0x15cf97,interaction:_0x19bc8f}=this['getInteractionAndReplyById'](_0x337fdd['replyId']),_0x34deb9=this['_getDocumentRangeForReplyChanges'](_0x337fdd['replyId'],_0x337fdd['partIndex']),_0x3478f4=void 0x0!==_0x337fdd['partIndex']?[_0x15cf97['changeGroups'][_0x337fdd['partIndex']]]:_0x15cf97['changeGroups']['filter'](_0x50bebb=>'pending'==_0x50bebb['state']),_0xfce92d=_0x3478f4['map'](_0x274a4a=>_0x15cf97['changeGroups']['indexOf'](_0x274a4a));if(!_0x34deb9||'$graveyard'==_0x34deb9['range']['root']['rootName'])return void _0xfce92d['forEach'](_0x293ec1=>_0x15cf97['setChangeGroupState'](_0x293ec1,'outdated'));_0xfce92d['forEach'](_0x4b88e3=>_0x15cf97['setChangeGroupState'](_0x4b88e3,'accepted'));const _0x408c92=zs({'editor':_0x29cf25,'reply':_0x15cf97,'interaction':_0x19bc8f,'groups':_0x3478f4,'transform':!0x0,'documentCompare':_0x41ac66,'documentCompareOptions':{'anchor':'main','markDeletions':!0x0}});let _0x211947;_0x34deb9&&this['_scrollToSuggestionRange'](_0x34deb9['range']),_0x29cf25['model']['change'](_0x2dcf8a=>{_0x211947=_0x2dcf8a['batch'],_0x29cf25['plugins']['get']('TrackChangesEditing')['_applyOperationsAsSuggestions'](_0x408c92),this['_aiEditing']['hideFakeVisualSelection']('change-area');}),this['_batchToChanges']['set'](_0x211947,{'interactionId':_0x19bc8f['id'],'replyId':_0x15cf97['id'],'indexes':_0xfce92d['slice']()}),this['_updateRatings'](_0x15cf97);}['_applySuggestion'](_0x13c3cd){const _0x2315c3=Xs(this['context']),_0x20b9f7=this['context']['plugins']['get'](_0x27dffc),{reply:_0x1be222,interaction:_0x16fc61}=this['getInteractionAndReplyById'](_0x13c3cd['replyId']),_0x1fa6a9=this['_getDocumentRangeForReplyChanges'](_0x13c3cd['replyId'],_0x13c3cd['partIndex']),_0x550a7c=void 0x0!==_0x13c3cd['partIndex']?[_0x1be222['changeGroups'][_0x13c3cd['partIndex']]]:_0x1be222['changeGroups']['filter'](_0xd8bd4=>'pending'==_0xd8bd4['state']),_0x1383cd=_0x550a7c['map'](_0x4fedf6=>_0x1be222['changeGroups']['indexOf'](_0x4fedf6));if(!_0x1fa6a9||'$graveyard'==_0x1fa6a9['range']['root']['rootName'])return void _0x1383cd['forEach'](_0xf01f61=>_0x1be222['setChangeGroupState'](_0xf01f61,'outdated'));_0x1383cd['forEach'](_0x1818c4=>_0x1be222['setChangeGroupState'](_0x1818c4,'accepted'));const _0x12e695=zs({'editor':_0x2315c3,'reply':_0x1be222,'interaction':_0x16fc61,'groups':_0x550a7c,'transform':!0x0,'documentCompare':_0x20b9f7,'documentCompareOptions':{'anchor':'main','markDeletions':!0x1}});let _0x2f8131;_0x1fa6a9&&this['_scrollToSuggestionRange'](_0x1fa6a9['range']),_0x2315c3['model']['change'](_0x582a04=>{_0x2f8131=_0x582a04['batch'];for(const _0x213ab3 of _0x12e695)_0x213ab3['baseVersion']=_0x2315c3['model']['document']['version'],js(_0x2315c3,_0x213ab3),_0x582a04['batch']['addOperation'](_0x213ab3),_0x2315c3['model']['applyOperation'](_0x213ab3);}),this['_batchToChanges']['set'](_0x2f8131,{'interactionId':_0x16fc61['id'],'replyId':_0x1be222['id'],'indexes':_0x1383cd['slice']()}),this['_updateRatings'](_0x1be222);}['_rejectSuggestion'](_0x174629){const {reply:_0x270371}=this['getInteractionAndReplyById'](_0x174629['replyId']);_0x270371['setChangeGroupState'](_0x174629['partIndex'],'rejected');}['_openBalloonFor'](_0x313822,_0x575abe){if(!this['_aiChatBalloon'])return;const {reply:_0x50a52d}=this['getInteractionAndReplyById'](_0x313822),_0x538f9a=_0x50a52d['getContentParts']({'showDiff':this['_aiChatBalloonShowDiff']});let _0x1b9ffd,_0x306853;if(void 0x0!==_0x575abe?(_0x306853=_0x538f9a['find'](_0x3b0bbe=>_0x3b0bbe['index']==_0x575abe),_0x1b9ffd=_0x306853?.['index']):(_0x306853=_0x538f9a[0x0],_0x1b9ffd=_0x306853['index']),this['_currentPreviewedChangeGroup']?.['replyId']==_0x313822&&this['_currentPreviewedChangeGroup']?.['partIndex']==_0x1b9ffd)return;const _0x49061a=this['_getUserPresentableContentPartDocumentRange'](_0x313822,_0x50a52d,_0x306853);if(!_0x49061a)return void this['_aiChatBalloon']['close']();this['_currentPreviewedChangeGroup']={'replyId':_0x313822,'partIndex':_0x1b9ffd},this['_scrollToSuggestionRange'](_0x49061a,!0x0);const _0x260da3=this['_getPresentableSiblingContentPartIndex'](_0x313822,_0x1b9ffd,'next');this['_aiChatBalloon']['updateContent']({'part':_0x306853,'renderingStrategy':'static'}),this['_aiChatBalloon']['open']({'index':_0x1b9ffd,'title':us(this['context']['locale'],'AI_BALLOON_HEADER_TITLE',(_0x1b9ffd+0x1)['toString']()),'showRotator':null!==_0x260da3,'ranges':[_0x49061a],'areActionsDisabled':_0x50a52d['areActionsDisabled']}),this['_aiChatBalloon']['setState']('pending'),this['_aiChatUi']['scrollFeedToSuggestion'](_0x313822,_0x1b9ffd),this['_aiChatUi']['setFeedItemAIReplySuggestionPartActive']({'id':_0x313822,'index':_0x1b9ffd,'isActive':!0x0});}['_getPresentableSiblingContentPartIndex'](_0x3f0287,_0x12a484,_0x5bc84c){const {reply:_0xe3806c}=this['getInteractionAndReplyById'](_0x3f0287),_0x575b66=_0xe3806c['getContentParts']({'showDiff':this['_aiChatBalloonShowDiff']});if(0x1==_0x575b66['length'])return null;const _0x3abc3d=_0x575b66['findIndex'](_0x17b797=>_0x17b797['index']==_0x12a484),_0x173e55='next'==_0x5bc84c?0x1:-0x1;let _0xb67719=_0x575b66['at']((_0x3abc3d+_0x173e55)%_0x575b66['length'])['index'],_0x145fb3=_0x575b66[_0xb67719];for(;!this['_getUserPresentableContentPartDocumentRange'](_0x3f0287,_0xe3806c,_0x145fb3);){if(_0xb67719=_0x575b66['at']((_0xb67719+_0x173e55)%_0x575b66['length'])['index'],_0xb67719===_0x3abc3d)return null;_0x145fb3=_0x575b66[_0xb67719];}return _0xb67719;}['_getUserPresentableContentPartDocumentRange'](_0x14ad8d,_0x539655,_0x5ae46d){const _0x4a2200=_0x539655['changeGroups'];if(!_0x5ae46d['hasChanges'])return null;const _0x3cc045=_0x4a2200['find'](_0x1beca0=>_0x1beca0['index']==_0x5ae46d['index']);if('pending'!==_0x3cc045?.['state'])return null;const _0x1a50eb=this['_getDocumentRangeForReplyChanges'](_0x14ad8d,_0x5ae46d['index']);if(!_0x1a50eb)return null;const {range:_0x8ce445,currentIndex:_0x7a0f02}=_0x1a50eb;return'$graveyard'==_0x8ce445['root']['rootName']?(_0x539655['setChangeGroupState'](_0x7a0f02,'outdated'),null):_0x1a50eb['range'];}['_getDocumentRangeForReplyChanges'](_0x18a76f,_0x19d1aa){const _0x2ba103=Xs(this['context']),{reply:_0x1c720,interaction:_0x313bb5}=this['getInteractionAndReplyById'](_0x18a76f),_0x3fd3b1=_0x1c720['changeGroups']['filter'](_0x59742c=>'pending'==_0x59742c['state']),_0x433f93=_0x3fd3b1['map'](_0x5abeb3=>_0x1c720['changeGroups']['indexOf'](_0x5abeb3));void 0x0===_0x19d1aa&&(_0x19d1aa=_0x433f93[0x0]);const _0x1b4476=_0x433f93['indexOf'](_0x19d1aa);if(-0x1==_0x1b4476)return null;const _0x3b3635=_0x3fd3b1[_0x1b4476],_0x40a602=new _0x24a4fb([]),_0x1566d4=new _0x24a4fb([]);for(const _0x36d983 of _0x3b3635['changes'])if('removed'!=_0x36d983['type']&&_0x1566d4['children']['push'](_0x36d983['node']['cloneNode'](!0x0)),'new'!=_0x36d983['type']){const _0x2032dd=_0x33d270(_0x4cf77a=>ms(_0x4cf77a,'data-id')==_0x36d983['id'],_0x1c720['documentContextContent'],!0x0);_0x40a602['children']['push'](_0x2032dd['cloneNode'](!0x0));}if(0x0==_0x40a602['children']['length']){if(_0x3b3635['changes'][0x0]['anchorId']){const _0x3606d5=ps('data-id',_0x3b3635['changes'][0x0]['anchorId'],_0x1c720['documentContextContent']);_0x40a602['children']['unshift'](_0x3606d5['cloneNode'](!0x0)),_0x1566d4['children']['unshift'](_0x3606d5['cloneNode'](!0x0)),_0x3606d5['nextSibling']&&(_0x40a602['children']['push'](_0x3606d5['nextSibling']['cloneNode'](!0x0)),_0x1566d4['children']['push'](_0x3606d5['nextSibling']['cloneNode'](!0x0)));}else{const _0x239d38=_0x1c720['documentContextContent']['children'][0x0];if(!_0x239d38)return null;_0x40a602['children']['push'](_0x239d38['cloneNode'](!0x0)),_0x1566d4['children']['push'](_0x239d38['cloneNode'](!0x0));}}const _0x123f79=_0x313bb5['getDocumentContext'](),_0x33e911=_0x2ba103['data']['parse'](_0x123f79['content']),_0x132248=Es(_0x40a602),_0x2dc65f=_0x2ba103['data']['parse'](_0x132248),_0x1e804e=_0x2ba103['data']['parse'](_0x132248),_0x56040e=_0x2ba103['model']['createPositionAt'](_0x2dc65f,0x0),_0x516724=Es(_0x1566d4),_0x24ecf5={'anchor':_0x56040e,'markDeletions':!0x1},_0x4d9276=_0x2ba103['plugins']['get'](_0x27dffc)['getDiff'](_0x132248,_0x516724,_0x24ecf5)['getOperations']();if(!_0x4d9276['length'])return null;_0x2ba103['model']['change'](_0x49d326=>{for(const _0x492778 of _0x4d9276)if('remove'==_0x492778['type']){const _0x3b6719=_0x492778['sourcePosition'],_0x1e512e=_0x492778['howMany'],_0x52cee5=new _0x538ce3(_0x3b6719,_0x1e512e);_0x49d326['batch']['addOperation'](_0x52cee5),_0x2ba103['model']['applyOperation'](_0x52cee5);}else'marker'!==_0x492778['type']&&(_0x492778['baseVersion']=null,_0x492778['isDocumentOperation']=!0x1,_0x49d326['batch']['addOperation'](_0x492778),_0x2ba103['model']['applyOperation'](_0x492778));});const _0x4e5746=ys(_0x2ba103,_0x4d9276,_0x2dc65f);xs(_0x2ba103['model'],_0x4e5746);const _0x2d3f35=_0x4e5746['getFirstRange']()['start']['path']['slice'](),_0x277e9c=_0x4e5746['getFirstRange']()['end']['path']['slice'](),_0x142d98=[];let _0x278151=_0x2dc65f,_0x1eea7f=_0x1e804e;for(let _0x58beab=0x0;_0x58beab<_0x277e9c['length'];_0x58beab++){const _0x25d10e=_0x278151['maxOffset']-_0x277e9c[_0x58beab];_0x142d98[_0x58beab]=_0x1eea7f['maxOffset']-_0x25d10e,_0x278151=_0x278151['getChildAtOffset'](_0x277e9c[_0x58beab]),_0x1eea7f=_0x1eea7f['getChildAtOffset'](_0x142d98[_0x58beab]);}const _0x559168=_0x2ba103['model']['createRange'](_0x2ba103['model']['createPositionFromPath'](_0x1e804e,_0x2d3f35),_0x2ba103['model']['createPositionFromPath'](_0x1e804e,_0x142d98)),_0x5b636e=_0x1e804e['getChild'](0x0)['getAttribute'](_0x2772d6),_0x540009=Array['from'](_0x33e911['getChildren']())['find'](_0x578fcf=>_0x578fcf['getAttribute'](_0x2772d6)==_0x5b636e)['getPath'](),_0x495f12=_0x559168['start']['path']['slice'](),_0x471a7d=_0x559168['end']['path']['slice']();_0x495f12[0x0]=_0x540009[0x0]+_0x495f12[0x0],_0x471a7d[0x0]=_0x540009[0x0]+_0x471a7d[0x0];let _0x3c7e97=_0x2ba103['model']['createRange'](_0x2ba103['model']['createPositionFromPath'](_0x2ba103['model']['document']['getRoot'](),_0x495f12),_0x2ba103['model']['createPositionFromPath'](_0x2ba103['model']['document']['getRoot'](),_0x471a7d));const _0x2c872d=_0x2ba103['model']['document']['history']['getOperations'](_0x123f79['version']);for(const _0x44d260 of _0x2c872d)_0x3c7e97=_0x1569aa['_createFromRanges'](_0x3c7e97['getTransformedByOperation'](_0x44d260));return{'range':_0x3c7e97,'currentIndex':_0x19d1aa};}['_integrateEditor'](_0x59293d){if(_0x59293d['plugins']['has']('Undo')){const _0x57c66b=_0x59293d['commands']['get']('undo'),_0x23a61e=_0x59293d['commands']['get']('redo');this['listenTo'](_0x57c66b,'revert',(_0xd75837,_0x371511,_0x1af957)=>{const _0x30eef4=this['_batchToChanges']['get'](_0x371511);if(!_0x30eef4)return;const _0x539338=this['activeConversation']['getInteraction'](_0x30eef4['interactionId'])['getReply'](_0x30eef4['replyId']);_0x30eef4['indexes']['forEach'](_0x4ca5eb=>_0x539338['setChangeGroupState'](_0x4ca5eb,'pending')),this['_batchToChanges']['delete'](_0x371511),this['_batchToChanges']['set'](_0x1af957,_0x30eef4);}),this['listenTo'](_0x23a61e,'revert',(_0x50ed2a,_0x3b321e,_0x37ab8d)=>{const _0x5691d9=this['_batchToChanges']['get'](_0x3b321e);if(!_0x5691d9)return;const _0x22d43c=this['activeConversation']['getInteraction'](_0x5691d9['interactionId'])['getReply'](_0x5691d9['replyId']);_0x5691d9['indexes']['forEach'](_0x3726a9=>_0x22d43c['setChangeGroupState'](_0x3726a9,'accepted')),this['_batchToChanges']['delete'](_0x3b321e),this['_batchToChanges']['set'](_0x37ab8d,_0x5691d9);});}const _0xe268f6=_0x59293d['config']['get']('ai.chat.context');_0xe268f6['alwaysAddSelection']&&_0xe268f6['document']['enabled']&&this['listenTo'](_0x59293d['model']['document']['selection'],'change:range',(_0x4fd9d4,_0x278870)=>{if(!_0x278870['directChange'])return;'chat'===_0x59293d['plugins']['get']('AITabs')['view']['activeTab']&&(_0x59293d['model']['hasContent'](_0x59293d['model']['document']['selection'])?this['addSelectionToChatContext']():this['removeSelectionFromChatContext']());});}async['_getLastCreatedConversationId'](){const _0xe34b46=this['_aiConnector']['fetchConversations'](this['getGroupId'](),{'limit':0x1,'sortBy':'createdAt'});try{const _0x471856=await _0xe34b46['getConversations']();return _0x471856['length']?_0x471856[0x0]['id']:'new';}catch(_0x1da227){return this['_aiChatUi']['addFeedItemError']({'errorMessage':us(this['context']['locale'],'AI_CHAT_UNABLE_TO_LOAD_CONVERSATION'),'id':ot()}),this['_logError'](new ht('ai-chat-conversation-init-failed',this,{'error':_0x1da227})),this['_aiChatUi']['toggleLoadingSkeleton'](!0x1),this['_aiChatUi']['disableControls'](),null;}}async['_startConversationSafely'](_0x5cb2e9){try{this['_aiChatUi']['enableControls'](),await this['_handleStartConversation'](_0x5cb2e9);}catch(_0x29f60){this['_aiChatUi']['addFeedItemError']({'errorMessage':us(this['context']['locale'],'AI_CHAT_UNABLE_TO_START_CONVERSATION'),'id':_0x5cb2e9||ot()}),console['error'](_0x29f60),this['activeConversation']=void 0x0,this['_aiChatUi']['disableControls']();}}async['_handleStartConversation'](_0x4bf51){let _0x1146f0;this['context']['plugins']['has']('AIChatBalloon')&&this['context']['plugins']['get']('AIChatBalloon')['close'](),_0x4bf51||!this['activeConversation']?_0x1146f0=this['context']['config']['get']('ai.models.defaultModelId'):this['_aiChatUi']['isModelAvailable']&&(_0x1146f0=this['activeConversation']['selectedModel']['id']),await this['_stopLastInteraction']();const _0x3317b4=this['getGroupId'](),_0x3042d6=_0x4bf51||ot();this['activeConversation']=new $s({'connector':this['_aiConnector'],'chatModels':this['_aiChatModels'],'selectedModelId':_0x1146f0,'conversationId':_0x3042d6,'group':_0x3317b4,'getEditor':()=>Xs(this['context']),'isFromHistory':!!_0x4bf51}),this['activeConversation']['delegate']('toolDataReceived','interactionStarted')['to'](this),this['activeConversation']['delegate']('toolDataReceived','interactionCreated','replyCreated')['to'](this),this['on']('interactionCreated',(_0x1d030c,_0xf8b672)=>{this['_aiChatUi']['addFeedItemUserMessage'](_0xf8b672);}),this['on']('replyCreated',(_0x3b6208,_0x549d0c)=>{this['_addFeedItemReply'](_0x549d0c);}),this['activeConversation']['on']('conversationInitialized',(_0x4a45bc,_0x1f6675)=>{this['_aiChatUi']['createConversation'](_0x1f6675),this['_aiChatUi']['resetMessageInput'](),this['_aiChatUi']['clearPendingContextUI'](),this['_aiChatUi']['clearConversationContextUI'](),_0x4bf51||(this['_aiChatUi']['resetConversationTitle'](),this['addCurrentDocumentToChatContext']());}),this['activeConversation']['on']('uploadProgressChanged',(_0x117164,_0x4d098c)=>{this['_aiChatUi']['setIsUploadInProgress'](_0x4d098c['isUploadInProgress']);}),this['activeConversation']['on']('webSearchStarted',()=>{const _0x8ac9d2=this['_aiChatUi']['prepareLoadingMessage']({'isWebSearchEnabled':!0x0,'isReasoningEnabled':!0x1});this['_aiChatUi']['setLoadingMessage'](_0x8ac9d2);}),this['activeConversation']['on']('reasoningStarted',()=>{const _0x75af3a=this['_aiChatUi']['prepareLoadingMessage']({'isWebSearchEnabled':!0x1,'isReasoningEnabled':!0x0});this['_aiChatUi']['setLoadingMessage'](_0x75af3a);}),this['activeConversation']['on']('webSearchFinished',(_0x310686,_0x5d6958)=>{this['_aiChatUi']['addFeedInteractionHeader'](_0x5d6958,{'isWebSearchEnabled':!0x0,'isReasoningEnabled':!0x1});}),this['activeConversation']['on']('reasoningFinished',(_0x3768c5,_0x255ae3)=>{this['_aiChatUi']['addFeedInteractionHeader'](_0x255ae3,{'isWebSearchEnabled':!0x1,'isReasoningEnabled':!0x0});}),this['activeConversation']['on']('interactionStarted',()=>{this['_aiChatUi']['startInteraction']();}),this['activeConversation']['on']('interactionFinished',async()=>{await this['_aiChatUi']['finishInteraction']();}),this['activeConversation']['on']('interactionDestroyed',(_0x28e1fb,_0x2a2fc3)=>{this['_aiChatUi']['removeFeedInteraction'](_0x2a2fc3['id']);}),this['activeConversation']['on']('setConversationTitle',(_0x25bb54,_0x5a2af4,_0x458b3b)=>{this['_updateConversationTitle'](_0x5a2af4,_0x458b3b);}),this['activeConversation']['on']('replyContentUpdated',async(_0x281de7,_0x19862a)=>{await this['_updateReplyContent']({'reply':_0x19862a});}),this['activeConversation']['on']('replyChangeGroupStateUpdated',(_0x474d33,{reply:_0x567d07,index:_0x451aa0,state:_0x17d797})=>{this['_aiChatUi']['updateFeedItemAIReplySuggestionPartState']({'id':_0x567d07['id'],'index':_0x451aa0,'state':_0x17d797}),this['_currentPreviewedChangeGroup']?.['replyId']['includes'](_0x567d07['id'])&&this['_currentPreviewedChangeGroup']?.['partIndex']==_0x451aa0&&this['_aiChatBalloon']?.['setState'](_0x17d797);}),this['activeConversation']['on']('contextItemAdded',(_0x5b968c,_0x544e38)=>{if(this['_aiChatUi']['addContextItem'](_0x544e38['contextItem'],_0x544e38['isLoading']),'selection'===_0x544e38['contextItem']['type']){const _0x47466f=[...Xs(this['context'])['model']['document']['selection']['getRanges']()];this['_aiEditing']['showFakeVisualSelection']({'ranges':_0x47466f,'id':'context','priority':0x1});}}),this['activeConversation']['on']('contextItemRemoved',(_0x175868,_0x3d40a1)=>{this['_aiChatUi']['removeContextItem'](_0x3d40a1['uiId']),'current-document'==_0x3d40a1['uiId']&&this['removeSelectionFromChatContext'](),'selection'===_0x3d40a1['type']&&this['_aiEditing']['hideFakeVisualSelection']('context');}),this['activeConversation']['on']('contextItemLoadingEnded',(_0x3e8a33,_0x5ee062)=>{this['_aiChatUi']['setContextItemLoading'](_0x5ee062['contextItem']['uiId'],_0x5ee062['isLoading']);}),this['activeConversation']['on']('contextSent',(_0x5c5903,_0x3866d3)=>{this['_aiChatUi']['setConversationContext'](_0x3866d3['contextItems']);}),this['activeConversation']['on']('addContextOptionsChanged',(_0x10c38c,_0x271a34)=>{this['_aiChatUi']['setAddContextOptions'](_0x271a34['options']);}),this['activeConversation']['on']('sourceResourcesLoaded',(_0x4634f7,_0x4bb6a9)=>{this['_aiChatUi']['populateSourceResourceBalloon'](_0x4bb6a9['sourceId'],_0x4bb6a9['source'],_0x4bb6a9['resources'],_0x4bb6a9['uid']);}),this['activeConversation']['on']('resourceStateChanged',(_0x339279,_0x13126b)=>{this['_aiChatUi']['updateResourceState'](_0x13126b['sourceId'],_0x13126b['resourceId'],_0x13126b['isInContext']);}),this['activeConversation']['on']('capabilitiesUpdated',(_0x5a34a3,_0x288b1b)=>{this['_aiChatUi']['updateCapabilities'](_0x288b1b);}),this['activeConversation']['on']('modelSelected',async(_0xf06213,_0x12bda9)=>{const _0x54106b=(await this['_aiChatModels']['getAll']())['find'](_0x1a58ee=>_0x1a58ee['id']===_0x12bda9['selectedModel']?.['id'])||null;this['_aiChatUi']['setSelectedModel'](_0x54106b,_0x12bda9['isDisabled']);}),this['activeConversation']['on']('error',(_0x36d738,{error:_0x3f4c8d,interactionId:_0x20d03c,fileName:_0x404140,url:_0x16b0ad,sourceId:_0x1df824,sourceLabel:_0x16ab74})=>{const _0x1fbb1f=_0x20d03c?_0x20d03c+':'+ot():ot();_0x3f4c8d['message']['startsWith']('ai-request-aborted')?this['_aiChatUi']['addFeedItemStaticMessage']({'staticMessage':us(this['context']['locale'],'AI_CHAT_ABORTED_MESSAGE'),'id':_0x1fbb1f}):_0x3f4c8d['message']['startsWith']('ai-chat-conversation-init-failed')||_0x3f4c8d['message']['startsWith']('ai-chat-conversation-start-failed')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':us(this['context']['locale'],'AI_CHAT_UNABLE_TO_START_CONVERSATION'),'id':_0x1fbb1f}),this['_logError'](_0x3f4c8d)):_0x3f4c8d['message']['startsWith']('ai-chat-file-upload-failed')?this['_aiChatUi']['addFeedItemError']({'errorMessage':us(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_FILE',_0x404140),'id':_0x1fbb1f}):_0x3f4c8d['message']['startsWith']('ai-chat-url-upload-failed')?this['_aiChatUi']['addFeedItemError']({'errorMessage':us(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_URL',_0x16b0ad),'id':_0x1fbb1f}):_0x3f4c8d['message']['startsWith']('ai-chat-context-invalid-data')?this['_aiChatUi']['addFeedItemError']({'errorMessage':us(this['context']['locale'],'AI_CHAT_CONTEXT_INVALID_DATA'),'id':_0x1fbb1f}):_0x3f4c8d['message']['startsWith']('ai-chat-context-unsupported-type')?this['_aiChatUi']['addFeedItemError']({'errorMessage':us(this['context']['locale'],'AI_CHAT_CONTEXT_UNSUPPORTED_TYPE'),'id':_0x1fbb1f}):_0x3f4c8d['message']['startsWith']('ai-chat-source-resources-load-failed')?(_0x1df824&&this['_aiChatUi']['closeSourceResourceBalloon'](_0x1df824),this['_aiChatUi']['addFeedItemError']({'errorMessage':us(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_LOAD_RESOURCES',_0x16ab74||'source'),'id':_0x1fbb1f}),this['_logError'](_0x3f4c8d)):_0x3f4c8d['message']['startsWith']('ai-chat-resource-load-failed')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':us(this['context']['locale'],'AI_CHAT_RESOURCE_LOAD_FAILED'),'id':_0x1fbb1f}),this['_logError'](_0x3f4c8d)):_0x3f4c8d['message']['startsWith']('ai-chat-invalid-request')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':us(this['context']['locale'],'AI_CHAT_INVALID_REQUEST'),'id':_0x1fbb1f}),this['_logError'](_0x3f4c8d)):_0x3f4c8d['message']['startsWith']('ai-chat-context-unsupported-file-type')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':us(this['context']['locale'],'AI_CHAT_CONTEXT_UNSUPPORTED_FILE_TYPE'),'id':_0x1fbb1f}),this['_logError'](_0x3f4c8d)):_0x3f4c8d['message']['startsWith']('ai-chat-context-file-too-large')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':us(this['context']['locale'],'AI_CHAT_CONTEXT_FILE_TOO_LARGE'),'id':_0x1fbb1f}),this['_logError'](_0x3f4c8d)):_0x3f4c8d['message']['startsWith']('ai-chat-context-file-too-many-pages')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':us(this['context']['locale'],'AI_CHAT_CONTEXT_FILE_TOO_MANY_PAGES'),'id':_0x1fbb1f}),this['_logError'](_0x3f4c8d)):_0x3f4c8d['message']['startsWith']('ai-chat-context-form-data-size-limits-exceeded')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':us(this['context']['locale'],'AI_CHAT_CONTEXT_FORM_DATA_SIZE_LIMITS_EXCEEDED'),'id':_0x1fbb1f}),this['_logError'](_0x3f4c8d)):(this['_aiChatUi']['addFeedItemError']({'errorMessage':us(this['context']['locale'],'AI_CHAT_GENERIC_ERROR'),'id':_0x1fbb1f}),this['_logError'](_0x3f4c8d));}),await this['activeConversation']['init'](this['context']['config']['get']('ai.chat.context')),_0x4bf51||await this['activeConversation']['start']();}async['_handleUIUserMessage']({message:_0x189ecf,attributes:_0x3a5f1d}){if(!this['activeConversation'])throw new ht('ai-chat-controller-no-active-conversation');if(this['activeConversation']['isCurrentDocumentInContext']()){const _0x514d38=await this['_aiEditing']['getDocumentData']();await this['activeConversation']['updateCurrentDocumentInContext'](_0x514d38);}this['activeConversation']['id']&&this['activeConversation']['isStarted']&&await this['activeConversation']['handleUserInteraction']({'userMessage':_0x189ecf,'attributes':_0x3a5f1d});}['_setIsMaximized'](_0xcc55ca){this['_aiChatUi']['setIsMaximized'](_0xcc55ca);}['_logError'](_0x60162e){mt(_0x60162e['message']);}['_removeFromContext'](_0x770598){this['activeConversation']?.['removeFromContext'](_0x770598);}['_toggleWebSearch'](){this['activeConversation']?.['toggleWebSearch']();}['_toggleReasoning'](){this['activeConversation']?.['toggleReasoning']();}['getInteractionAndReplyById'](_0x4ffecf){const [_0x436356,_0x4a6e02]=_0x4ffecf['split'](':'),_0x59efd2=this['activeConversation']['getInteraction'](_0x436356),_0x43fe9e=_0x59efd2['getReply'](_0x4a6e02);return{'interaction':_0x59efd2,'reply':_0x43fe9e};}['_scrollToSuggestionRange'](_0xef5a03,_0x57afaa=!0x1){const _0x308dfe=Xs(this['context']),_0x229369={'target':_0x308dfe['editing']['view']['domConverter']['viewRangeToDom'](_0x308dfe['editing']['mapper']['toViewRange'](_0xef5a03)),'viewportOffset':{'top':0x96,'left':0x0,'bottom':0x32,'right':0x0},'ancestorOffset':0x14,'alignToTop':_0x57afaa};_0x57afaa&&(_0x229369['alignToTop']=!0x0),Ct(_0x229369);}['_updateConversationTitle'](_0x43d096,_0x36dd4b=!0x1){this['_aiChatUi']['setConversationTitle'](_0x43d096||us(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION'),_0x36dd4b);}['_addFeedItemReply'](_0x2f1872){'text'===_0x2f1872['type']?this['_aiChatUi']['addFeedItemAIReply'](_0x2f1872):this['_aiChatUi']['addFeedItemAISuggestion'](_0x2f1872);}async['_updateReplyContent']({reply:_0x200307,renderingStrategy:_0x17c2f3}){const {id:_0x446e75,interactionId:_0x1ba9bd,isDone:_0x2c2697,type:_0xb70ffe,parsedContent:_0x5df038}=_0x200307,_0x58f6a1=_0x1ba9bd+':'+_0x446e75;if('modification'===_0xb70ffe){const _0x23603a=_0x200307['getContentParts']({'showDiff':this['_aiChatUi']['showDiff']});await this['_aiChatUi']['updateFeedItemAIReplySuggestionContent']({'id':_0x58f6a1,'parts':_0x23603a,'renderingStrategy':_0x17c2f3,'isDone':_0x2c2697});}else'text'===_0xb70ffe&&await this['_aiChatUi']['updateFeedItemAIReplyContent']({'id':_0x58f6a1,'parsedContent':_0x5df038,'renderingStrategy':_0x17c2f3,'isDone':_0x2c2697});_0x2c2697&&_0x200307['sources']['length']>0x0&&this['_aiChatUi']['updateFeedItemAIReplySources'](_0x58f6a1,_0x200307['sources']);}async['_stopLastInteraction'](){const _0x5a8b58=this['activeConversation']?.['lastInteraction'];_0x5a8b58&&(_0x5a8b58['stop'](),this['_aiChatUi']['stopInteraction'](_0x5a8b58));}async['_flushLastInteractionUI'](){const _0x444719=this['activeConversation']?.['lastInteraction'];if(_0x444719){for await(const _0x4e4ac4 of _0x444719['replies'])this['_aiChatUi']['hasFeedItem'](_0x4e4ac4['id'])||this['_addFeedItemReply'](_0x4e4ac4),await this['_updateReplyContent']({'reply':_0x4e4ac4,'renderingStrategy':'static'});}}['_updateRatings'](_0x23b624){const _0x46df07={'positiveCount':_0x23b624['changeGroups']['filter'](_0x74359a=>'accepted'===_0x74359a['state'])['length'],'totalCount':_0x23b624['changeGroups']['length'],'modificationId':_0x23b624['id']},_0x45894b=this['activeConversation']['getInteraction'](_0x23b624['interactionId'])['messageId'];_0x45894b&&this['_aiConnector']['upsertAIChatRating'](this['activeConversation']['id'],_0x45894b,_0x46df07);}['_getAIChatFeedAPI'](_0x140fb5){const _0x23f15d=this['_aiChatUi'],_0x52462d=()=>{_0x140fb5['resetWebSearchState'](),_0x140fb5['resetReasoningState'](),_0x23f15d['clearLoadingMessage']();},_0x930019=()=>{_0x140fb5['currentReply']&&(_0x140fb5['currentReply']['done'](),_0x140fb5['currentReply']=void 0x0);};return{'insertTextReply':(_0x1a513a,_0x4daa75)=>{_0x930019(),_0x52462d();const _0xdf7576=_0x140fb5['currentReply']=_0x140fb5['createReply']({'type':'text','interactionId':_0x140fb5['id'],'content':_0x1a513a,'id':_0x4daa75||ot()});return _0x930019(),_0xdf7576;},'insertCustomElement':async(_0xa8c1b7,_0x3c20fe)=>(_0x930019(),_0x52462d(),_0x23f15d['addFeedItemCustomElement'](_0xa8c1b7,_0x3c20fe||ot())),'setLoadingMessage':_0x38c2af=>{_0x23f15d['setLoadingMessage'](_0x38c2af);},'clearLoadingMessage':()=>{_0x23f15d['clearLoadingMessage']();}};}}const Zs='ai-selection';class tn extends _0x12c8be{constructor(_0x13f6a7){super(_0x13f6a7),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 _0x480cc8=Xs(this['context']),_0x42e343=_0x480cc8['plugins']['has']('RealTimeCollaborationClient')&&_0x480cc8['plugins']['get']('RealTimeCollaborationClient')['sessionId'];this['_sessionId']=_0x42e343||ot();}return this['_sessionId'];}async['getDocumentData'](){const _0x432c70=Xs(this['context']),_0x4be6c3=_0x432c70['model'],_0x5157a9=_0x432c70['data']['toView'](_0x4be6c3['document']['getRoot'](),{'convertAiChatSelectionMarker':!0x0}),_0xee9893=new _0x2efc44(_0x432c70['editing']['view']['document']);this['_setDataIdsOnChildren'](_0x5157a9,_0xee9893);let _0x4e51b0=await this['_getDocumentDataStringFromView'](_0x5157a9);const _0x39ec34=this['_getMarkersInDocumentOrder'](),_0x2c6846=[];for(const _0x27db97 of _0x39ec34){const _0x3c70ac='<'+_0x27db97['name']+':start></'+_0x27db97['name']+':start>',_0x1be640=_0x4e51b0['indexOf'](_0x3c70ac);_0x4e51b0=_0x4e51b0['substring'](0x0,_0x1be640)+_0x4e51b0['substring'](_0x1be640+_0x3c70ac['length']);const _0x1d5863='<'+_0x27db97['name']+':end></'+_0x27db97['name']+':end>',_0x10a4f4=_0x4e51b0['indexOf'](_0x1d5863);_0x4e51b0=_0x4e51b0['substring'](0x0,_0x10a4f4)+_0x4e51b0['substring'](_0x10a4f4+_0x1d5863['length']),_0x2c6846['push']({'markerName':_0x27db97['name'],'start':_0x1be640,'end':_0x10a4f4,'htmlFragment':_0x4e51b0['substring'](_0x1be640,_0x10a4f4)});}return{'content':_0x4e51b0,'version':_0x432c70['model']['document']['version'],'sessionId':this['sessionId'],'selections':_0x2c6846};}async['afterInit'](){this['context']instanceof _0x3c1522?this['_integrateEditor'](this['context']):this['listenTo'](this['context']['editors'],'add',(_0x3ce953,_0x2686a7)=>{_0x2686a7['on']('ready',()=>{this['_integrateEditor'](_0x2686a7);});});}['_setOutputDataProcessor'](_0x1b69cd){this['_outputDataProcessor']=_0x1b69cd;}async['_getDocumentDataStringFromView'](_0x390422){let _0x261669;const _0x47b8c2=Xs(this['context']);if(this['_outputDataProcessor']){const _0x2dbd9e=_0x47b8c2['data']['processor']['domConverter']['viewToDom'](_0x390422),_0x2a1bfa=await this['_outputDataProcessor'](_0x2dbd9e);_0x261669=_0x47b8c2['data']['processor']['htmlWriter']['getHtml'](_0x2a1bfa);}else _0x261669=_0x47b8c2['data']['processor']['toData'](_0x390422);return _0x261669;}['_integrateEditor'](_0x13b9f0){_0x13b9f0['conversion']['for']('editingDowncast')['markerToHighlight']({'model':Zs,'view':({markerName:_0x214da9})=>({'classes':['ck-ai-assistant-ui_theme','ck-fake-ai-selection','ck-fake-ai-selection-'+_0x214da9['split'](':')[0x1]],'priority':0xc})}),_0x13b9f0['conversion']['for']('dataDowncast')['markerToElement']({'model':Zs,'view':(_0x176283,{writer:_0xb16524,options:_0x5282fc})=>_0x5282fc['convertAiChatSelectionMarker']?_0xb16524['createUIElement'](_0x176283['markerName']+':'+(_0x176283['isOpening']?'start':'end')):null});}['showFakeVisualSelection'](_0xe7a855){const _0x2c4456=this['_fakeSelections'][0x0]||null;this['_addFakeSelection'](_0xe7a855);const _0x2e8059=this['_fakeSelections'][0x0]||null;this['_refreshFakeSelection'](_0x2c4456,_0x2e8059);}['hideFakeVisualSelection'](_0xa7e97a){const _0x1d3e1e=this['_fakeSelections'][0x0]||null;this['_removeFakeSelectionById'](_0xa7e97a);const _0x50465b=this['_fakeSelections'][0x0]||null;this['_refreshFakeSelection'](_0x1d3e1e,_0x50465b);}async['modelToDataWithIds'](_0x52b40b){const _0x39100c=Xs(this['context']),_0x4c58e1=_0x39100c['data']['toView'](_0x52b40b),_0x347ebf=new _0x2efc44(_0x39100c['editing']['view']['document']);return this['_setDataIdsOnChildren'](_0x4c58e1,_0x347ebf),this['_getDocumentDataStringFromView'](_0x4c58e1);}['_setDataIdsOnChildren'](_0x328d6e,_0x129314){let _0x43fc8c=!0x1;const _0x5974e8=new Set();for(const _0x3e4dd0 of _0x328d6e['getChildren']()){if(!_0x3e4dd0['is']('view:element'))continue;const _0x3cc0db=_0x3e4dd0['is']('view:containerElement'),_0x397139=_0x3e4dd0['is']('view:emptyElement'),_0x13b254=this['_setDataIdsOnChildren'](_0x3e4dd0,_0x129314);if(_0x3e4dd0['hasAttribute']('data-id')){_0x43fc8c=!0x0,_0x5974e8['add'](_0x3e4dd0['getAttribute']('data-id'));continue;}(_0x3cc0db||_0x397139||_0x13b254)&&(_0x129314['setAttribute']('data-id',this['_nextDataId'](_0x5974e8),_0x3e4dd0),_0x43fc8c=!0x0);}return _0x43fc8c;}['_nextDataId'](_0x3cd675){let _0x322d70;do{_0x322d70='';for(let _0x151fd8=0x0;_0x151fd8<0x4;_0x151fd8++)_0x322d70+=String['fromCharCode'](0x61+Math['floor'](0x1a*Math['random']()));}while(_0x3cd675['has'](_0x322d70));return _0x3cd675['add'](_0x322d70),_0x322d70;}['getSelectionText'](){const {model:_0x34a5ce}=Xs(this['context']),_0x4b9f5a=_0x34a5ce['document']['selection'],_0x4c83e8=[],_0x165035=Array['from'](_0x4b9f5a['getRanges']());_0x165035['sort']((_0x2c799f,_0x243d5b)=>_0x2c799f['start']['isBefore'](_0x243d5b['start'])?-0x1:0x1);for(const _0x13e2e7 of _0x165035)for(const _0x3a0cc4 of _0x13e2e7['getItems']())_0x3a0cc4['is']('$textProxy')?_0x4c83e8['push'](_0x3a0cc4['data']):_0x3a0cc4['is']('element')&&_0x4c83e8['length']>0x0&&'\x20'!==_0x4c83e8[_0x4c83e8['length']-0x1]&&_0x4c83e8['push']('\x20');return _0x4c83e8['length']?'\x22'+_0x4c83e8['join']('')['trim']()+'\x22':us(this['context']['locale'],'AI_CHAT_CONTEXT_DOCUMENT_SELECTION_LABEL');}['_removeFakeSelectionById'](_0x48d857){for(let _0x38677b=0x0;_0x38677b<this['_fakeSelections']['length'];_0x38677b++)if(this['_fakeSelections'][_0x38677b]['id']==_0x48d857)return void this['_fakeSelections']['splice'](_0x38677b,0x1);}['_addFakeSelection'](_0x2954e7){this['_removeFakeSelectionById'](_0x2954e7['id']),wt(this['_fakeSelections'],_0x2954e7);}['_refreshFakeSelection'](_0x51debf,_0x2545df){if(_0x51debf==_0x2545df)return;const _0x2f7514=Xs(this['context']),_0x574e27=_0x2f7514['model'];_0x574e27['change'](_0x2688bf=>{if(_0x51debf){const _0x164ab1=_0x2f7514['model']['markers']['getMarkersGroup'](Zs);for(const _0x1eb378 of _0x164ab1)_0x2688bf['removeMarker'](_0x1eb378);}if(_0x2545df)for(let _0xb8b3b=0x0;_0xb8b3b<_0x2545df['ranges']['length'];_0xb8b3b++){let _0x239973=_0x2545df['ranges'][_0xb8b3b];const _0x2f5743=Zs+':'+_0x2545df['id']+':'+_0xb8b3b;if(_0x239973['start']['isAtEnd']){const _0x387ec2=_0x239973['start']['getLastMatchingPosition'](({item:_0x282c3e})=>!_0x574e27['schema']['isContent'](_0x282c3e),{'boundaries':_0x239973});_0x239973=_0x2688bf['createRange'](_0x387ec2,_0x239973['end']);}_0x2688bf['addMarker'](_0x2f5743,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x239973});}});}['_getMarkersInDocumentOrder'](){const _0x38234e=Xs(this['context'])['model'];return Array['from'](_0x38234e['markers']['getMarkersGroup'](Zs))['sort']((_0x354b6f,_0xbaa189)=>_0x354b6f['getStart']()['isBefore'](_0xbaa189['getStart']())?-0x1:_0x354b6f['getStart']()['isAfter'](_0xbaa189['getStart']())?0x1:0x0);}}const en=['showChangeInText','insertSuggestion','applySuggestion','rejectSuggestion','mouseOverSuggestion','mouseLeaveSuggestion','toggleSuggestionDisplayMode','like','dislike'],sn=[...en,'startConversation','resizeTabs','sendUserMessage','abortPromptStream','addDocumentToContext','addFileToContext','addUrlToContext','executeCustomItemCallback','addResourceToContext','removeContextItem','loadSourceResources','toggleWebSearch','toggleReasoning','selectModel'];class nn{['options'];['isStreaming']=!0x1;['document']=null;['nodesList']=[];['currentIndex']=0x0;['timeoutAbortController']=null;['lastUpdateTime']=0x0;constructor(_0x2a56fc){this['options']={'delay':_0x2a56fc['delay']??0x14,'textNodeStyle':_0x2a56fc['textNodeStyle'],'onStreamUpdate':_0x2a56fc['onStreamUpdate']||(()=>{})};}async['stream']({document:_0xb9c8da,targetElement:_0x3d3302,abortSignal:_0x1a27d5}){this['isStreaming']&&this['stop'](),_0x1a27d5?.['addEventListener']('abort',this['stop']['bind'](this)),this['document']=_0xb0e23f(_0xb9c8da,!0x0),this['nodesList']=this['getParsedDocumentNodeList'](),this['isStreaming']=!0x0,this['currentIndex']>this['nodesList']['length']&&(this['currentIndex']=this['nodesList']['length']);for(let _0x19e0e5=0x0;_0x19e0e5<this['currentIndex'];_0x19e0e5++)this['nodesList'][_0x19e0e5]['shouldBeStreamed']=!0x0;do{const _0x3a0a11=Date['now'](),_0x295865=this['nodesList'][this['currentIndex']],_0x461eac=_0x3a0a11-this['lastUpdateTime'];if(_0x295865){_0x295865['shouldBeStreamed']=!0x0;let _0x40a20f=_0x295865['parent'];for(;_0x40a20f;)_0x40a20f['shouldBeStreamed']=!0x0,_0x40a20f=_0x40a20f['parent'];}if(_0x461eac<this['options']['delay'])try{const {promise:_0x4d3dcf,abortController:_0x56c8d1}=hn(this['options']['delay']-_0x461eac);this['timeoutAbortController']=_0x56c8d1,await _0x4d3dcf;}catch(_0x5904f3){return;}_0x460892(_0x3d3302,'<'+_0x3d3302['tagName']+'>'+this['renderNode'](this['document'])+'</'+_0x3d3302['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:_0x52c1d2}){Array['from'](_0x52c1d2['querySelectorAll']('span[data-ck-html-streamer-word-chunk]'))['reverse']()['forEach'](_0x4a2e43=>{_0x4a2e43['replaceWith'](_0x4a2e43['childNodes'][0x0]);});}['stop'](){this['isStreaming']=!0x1,this['timeoutAbortController']&&(this['timeoutAbortController']['abort'](),this['timeoutAbortController']=null);}['renderNode'](_0x1439f9){let _0x49938a='';if(function(_0x15c8c2){return _0xe66385(_0x15c8c2);}(_0x1439f9)){for(const _0x261d0a of _0x1439f9['children'])_0x49938a+=this['renderNode'](_0x261d0a);}else{if(on(_0x1439f9)){if(!_0x1439f9['shouldBeStreamed'])return'';const _0x365c8c=_0x1439f9,_0x3e9069=Object['entries'](_0x365c8c['attribs'])['map'](([_0x37a7a2,_0x26d10a])=>_0x37a7a2+'=\x22'+_0x26d10a+'\x22')['join']('\x20');_0x49938a+='<'+_0x365c8c['tagName']+(_0x3e9069?'\x20'+_0x3e9069:'')+'>';for(const _0xb047a0 of ti(_0x365c8c))_0x49938a+=this['renderNode'](_0xb047a0);_0x49938a+='</'+_0x365c8c['tagName']+'>';}else{if(!an(_0x1439f9))return'';if(!_0x1439f9['shouldBeStreamed'])return'';!function(_0x26456e){if(!_0x26456e['parent']||!on(_0x26456e['parent']))return!0x1;if(!rn['includes'](_0x26456e['parent']['tagName']))return!0x1;return!_0x3c8937(_0x26456e)['match'](/^\s*[<>]\s*$/);}(_0x1439f9)?_0x49938a+=_0x3b485b(_0x1439f9):_0x49938a+=_0x3b485b(new _0x385c4b('span',{'data-ck-html-streamer-word-chunk':'','style':this['options']['textNodeStyle']},[_0x1439f9]));}}return _0x49938a;}['getParsedDocumentNodeList'](){const _0x34bb30=[];return function(_0x54d016,_0x477aff){const _0x18ad15=_0xbc8b86=>{if(_0x477aff(_0xbc8b86),_0xbc8b86 instanceof _0x455342)for(let _0x2fdc1f=0x0;_0x2fdc1f<_0xbc8b86['children']['length'];_0x2fdc1f++){const _0x286fe4=_0xbc8b86['children'][_0x2fdc1f];_0x18ad15(_0x286fe4);}};for(let _0x4a5dc1=0x0;_0x4a5dc1<_0x54d016['children']['length'];_0x4a5dc1++)_0x18ad15(_0x54d016['children'][_0x4a5dc1]);}(this['document'],_0x1281ad=>{if(an(_0x1281ad)){const _0x2aa930=this['splitTextNodeIntoWordNodes'](_0x1281ad);_0x2aa930['length']&&_0x34bb30['push'](..._0x2aa930);}_0x1281ad['isWordSplitSource']||_0x1281ad['isWordSplitResult']||_0x34bb30['push'](_0x1281ad);}),_0x34bb30;}['splitTextNodeIntoWordNodes'](_0x2053d7){if(_0x2053d7['isWordSplitSource']||_0x2053d7['isWordSplitResult'])return[];const _0x517f8a=_0x3c8937(_0x2053d7)['match'](/(?:\s*\S+\s*)/g),_0x258484=[];if(_0x517f8a&&_0x517f8a['length']>0x1){for(const _0xcc2736 of _0x517f8a){const _0xba853f=new _0xf06b4d(_0xcc2736);_0xba853f['isWordSplitResult']=!0x0,_0x16821e(_0x2053d7,_0xba853f),_0x258484['push'](_0xba853f);}_0x2053d7['isWordSplitSource']=!0x0,_0x322bd0(_0x2053d7);}return _0x258484;}}const rn=['p','li','td','th','span','h1','h2','h3','h4','h5','h6','b','strong','i','em','mark','del','ins','sup','sub','a','code','div'];function an(_0x1b21fd){return _0x5d39ce(_0x1b21fd);}function on(_0x21b707){return _0x3e068a(_0x21b707);}function hn(_0x41db82){const _0x334fff=new AbortController();return{'promise':new Promise((_0x476280,_0x240bf7)=>{const _0x1ae316=setTimeout(_0x476280,_0x41db82);_0x334fff['signal']['addEventListener']('abort',()=>{clearTimeout(_0x1ae316),_0x240bf7();});}),'abortController':_0x334fff};}class cn extends vt{['options'];['content']='';['htmlStreamer'];['children'];constructor(_0xd63efa){super();const _0x3c9b4b=this['bindTemplate'];this['set']('isDone',!0x1),this['set']('isVisible',!0x0),this['htmlStreamer']=new nn({'textNodeStyle':'animation:\x20ck-html-streamer-fade-in\x20.5s','delay':0x14}),this['options']=_0xd63efa,this['children']=this['createCollection'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__item',_0x3c9b4b['if']('isDone','ck-ai-chat__feed__item_done'),_0x3c9b4b['if']('isVisible','ck-hidden',_0x11d531=>!_0x11d531),'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'](_0x5bceb6=>{_0x5bceb6['removeAttribute']('data-id');}),this['isDone']=!0x0;}async['streamIntoElement'](_0x4ae5b2,_0x474240,_0x560e43){await this['htmlStreamer']['stream']({'document':_0x4ae5b2,'targetElement':_0x474240,'abortSignal':_0x560e43});}}class ln extends vt{['showChangesToggleView'];constructor(_0x48b363,_0x35f041){super(_0x48b363),this['set']('isShowChangesToggleVisible',!0x0),this['showChangesToggleView']=new un(_0x48b363),this['showChangesToggleView']['set']({'class':'ck-ai-suggestion__header__show-changes-toggle\x20ck-ai-chat-controls-button\x20'+As,'label':us(_0x48b363,'AI_SUGGESTION_BUTTON_SHOW_CHANGES'),'withText':!0x0}),this['showChangesToggleView']['isOn']=_0x35f041['showDiff'],this['showChangesToggleView']['bind']('isVisible')['to'](this,'isShowChangesToggleVisible'),this['showChangesToggleView']['bind']('icon')['to'](this['showChangesToggleView'],'isOn',_0x388ff1=>_0x388ff1?_0x2e0ef1:_0x2fe257),this['showChangesToggleView']['on']('execute',()=>{this['showChangesToggleView']['isOn']=!this['showChangesToggleView']['isOn'],this['fire']('toggleShowChanges',{'isOn':this['showChangesToggleView']['isOn']});});const _0xb2c700=new xt();_0xb2c700['content']=_0x5b8c03,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__header',!0x1===_0x35f041['showHeader']?'ck-hidden':null]['filter'](Boolean)},'children':[_0xb2c700,{'tag':'span','children':[us(_0x48b363,'AI_SUGGESTION_HEADER_TITLE')]},this['showChangesToggleView']]});}}class un extends Nt{['render'](){super['render'](),this['children']['remove'](this['iconView']),this['children']['add'](this['iconView']);}}const dn={'accepted':_0x455cca,'rejected':_0x5c20b5,'outdated':_0x5c20b5};class _n extends vt{['stateIconView'];constructor(_0x1cbf2f){super(_0x1cbf2f);const _0x34318f=this['bindTemplate'];this['set']('state','accepted'),this['set']('isVisible',!0x0),this['stateIconView']=new An(),this['stateIconView']['bind']('state')['to'](this),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__content-part-state',_0x34318f['to']('state',_0x4cc508=>'ck-ai-suggestion__content-part-state_'+_0x4cc508),_0x34318f['if']('isVisible','ck-hidden',_0x547692=>!_0x547692)]},'children':[{'tag':'span','attributes':{'class':['ck-ai-suggestion__content-part-state__label']},'children':[{'text':_0x34318f['to']('state',_0x4f533a=>{switch(_0x4f533a){case'accepted':return us(_0x1cbf2f,'AI_SUGGESTION_CONTENT_PART_STATE_ACCEPTED');case'rejected':return us(_0x1cbf2f,'AI_SUGGESTION_CONTENT_PART_STATE_REJECTED');case'outdated':return us(_0x1cbf2f,'AI_SUGGESTION_CONTENT_PART_STATE_OUTDATED');}})}]},this['stateIconView']]});}['setState'](_0x885a5a){this['state']=_0x885a5a;}}class An extends xt{constructor(){super(),this['set']('state','accepted'),this['content']=dn[this['state']],this['on']('change:state',()=>{this['content']=dn[this['state']];});}}class gn extends kt{['_applyButton'];['_suggestButton'];constructor(_0xca0217,_0x1bd58d,_0x100812){super(_0xca0217);const _0x52da06=Boolean(_0x100812);this['set']('isEnabled',!_0x52da06),this['set']('isVisible',!0x0),this['class']='ck-ai-suggestion-content-part-toolbar';const _0x588102=[];if(_0x52da06){const _0x6172c5=new Nt(_0xca0217);_0x6172c5['set']({'label':us(_0xca0217,'AI_SUGGESTION_DISABLED_TOOLTIP_MESSAGE'),'tooltip':!0x0,'tooltipPosition':'n','withText':!0x1,'icon':_0x1e2df8}),_0x588102['push'](_0x6172c5);}else{_0x1bd58d['includes']('applySuggestion')&&(this['_applyButton']=new Nt(_0xca0217),this['_applyButton']['set']({'label':us(_0xca0217,'AI_SUGGESTION_CONTENT_PART_APPLY'),'tooltip':!0x0,'tooltipPosition':'n','withText':!0x1,'icon':_0x455cca}),this['_applyButton']['bind']('isEnabled')['to'](this),this['_applyButton']['on']('execute',()=>{this['fire']('applySuggestion');}),_0x588102['push'](this['_applyButton'])),_0x1bd58d['includes']('insertSuggestion')&&(this['_suggestButton']=new Nt(_0xca0217),this['_suggestButton']['set']({'label':us(_0xca0217,'AI_SUGGESTION_CONTENT_PART_ADD_SUGGESTION'),'tooltip':!0x0,'tooltipPosition':'n','withText':!0x1,'icon':_0x41d834}),this['_suggestButton']['bind']('isEnabled')['to'](this),this['_suggestButton']['on']('execute',()=>{this['fire']('insertSuggestion');}),_0x588102['push'](this['_suggestButton']));const _0x5cb288=new Nt(_0xca0217);_0x5cb288['set']({'label':us(_0xca0217,'AI_SUGGESTION_CONTENT_PART_REJECT'),'tooltip':!0x0,'tooltipPosition':'n','withText':!0x1,'icon':_0x5c20b5}),_0x5cb288['bind']('isEnabled')['to'](this),_0x5cb288['on']('execute',()=>{this['fire']('rejectSuggestion');}),_0x588102['push'](_0x5cb288);}this['items']['addMany'](_0x588102);const _0x2c6ab1=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':[_0x2c6ab1['if']('isVisible','ck-hidden',_0x1831b3=>!_0x1831b3)]}});}['setButtonsVisibility']({showApplyButton:_0x2dace7,showSuggestButton:_0x234540}){this['_applyButton']&&(this['_applyButton']['isVisible']=_0x2dace7),this['_suggestButton']&&(this['_suggestButton']['isVisible']=_0x234540);}}class In extends vt{['toolbarView'];['stateView'];['titleLabelView'];['children'];constructor(_0x2873fa,{part:_0x536ff3,uiIndex:_0x2e036c,availableActions:_0x505007,areActionsDisabled:_0x14585e}){super(_0x2873fa),this['set']('isEnabled',!0x0),this['set']('state','pending'),this['toolbarView']=new gn(_0x2873fa,_0x505007,_0x14585e),this['toolbarView']['on']('rejectSuggestion',()=>{this['fire']('rejectSuggestion',{'index':_0x536ff3['index']});}),this['toolbarView']['on']('insertSuggestion',()=>{this['fire']('insertSuggestion',{'index':_0x536ff3['index']});}),this['toolbarView']['on']('applySuggestion',()=>{this['fire']('applySuggestion',{'index':_0x536ff3['index']});}),this['toolbarView']['bind']('isEnabled')['to'](this),this['stateView']=new _n(_0x2873fa),this['titleLabelView']=new En(_0x2873fa,_0x2e036c),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',(_0x366f53,_0x423f16,_0x328c3d,_0x5e3e9f)=>{'pending'===_0x5e3e9f?this['children']['remove'](this['toolbarView']):this['children']['remove'](this['stateView']),'pending'===_0x328c3d?this['children']['add'](this['toolbarView']):(this['stateView']['setState'](_0x328c3d),this['children']['add'](this['stateView']));});}}class En extends vt{constructor(_0x35cb43,_0x515c85){super(_0x35cb43),this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-suggestion__body__content-part__title__label']},'children':[us(_0x35cb43,'AI_SUGGESTION_CONTENT_PART_TITLE',_0x515c85['toString']())]});}}class pn extends vt{['htmlStreamer'];constructor(_0x2c704f){super(_0x2c704f),this['htmlStreamer']=new nn({'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:_0x351f4a,renderingStrategy:_0x167bde,abortSignal:_0x58a194}){'streaming'===_0x167bde?await this['htmlStreamer']['stream']({'document':_0x351f4a['content'],'targetElement':this['element'],'abortSignal':_0x58a194}):this['element']['innerHTML']=Es(_0x351f4a['content']);}['clear'](){this['htmlStreamer']['reset'](),this['element']['innerHTML']='';}}class Tn extends vt{['_children'];['_headerView'];['_streamableContentView'];constructor(_0xe157b5,{part:_0x20ccba,uiIndex:_0x2e3135,areActionsDisabled:_0x11ef31,availableActions:_0x45da90}){super(_0xe157b5);const _0x2fa467=this['bindTemplate'];this['set']('state','pending'),this['set']('isDone',!0x1),this['set']('isVisible',!0x1),this['set']('isActive',!0x1),this['set']('isEnabled',!0x1);const _0x5b5af7=()=>{this['isEnabled']=this['isDone']&&'pending'==this['state']&&!_0x11ef31;};this['on']('change:state',_0x5b5af7),this['on']('change:isDone',_0x5b5af7),_0x5b5af7(),this['_children']=this['createCollection'](),this['_headerView']=new In(_0xe157b5,{'part':_0x20ccba,'uiIndex':_0x2e3135,'availableActions':_0x45da90,'areActionsDisabled':_0x11ef31}),this['_headerView']['bind']('isEnabled','state')['to'](this),this['_headerView']['delegate'](...en)['to'](this),this['_streamableContentView']=new pn(_0xe157b5),this['_children']['addMany']([this['_headerView'],this['_streamableContentView']]),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__body__content-part',_0x2fa467['to']('state',_0x91110c=>'ck-ai-suggestion__body__content-part_'+_0x91110c),_0x2fa467['if']('isEnabled','ck-ai-suggestion__body__content-part_enabled'),_0x2fa467['if']('isActive','ck-ai-suggestion__body__content-part_active'),_0x2fa467['if']('isVisible','ck-hidden',_0x311f26=>!_0x311f26)]},'children':this['_children'],'on':{'mouseenter':_0x2fa467['to'](()=>{this['isEnabled']&&this['fire']('mouseOverSuggestion',{'index':_0x20ccba['index']});}),'mouseleave':_0x2fa467['to'](()=>{this['isEnabled']&&this['fire']('mouseLeaveSuggestion',{'index':_0x20ccba['index']});}),'click':_0x2fa467['to'](_0x47a4a5=>{const _0x1762f4=_0x47a4a5['target'];this['isEnabled']&&!this['_headerView']['toolbarView']['element']['contains'](_0x1762f4)&&this['fire']('showChangeInText',{'index':_0x20ccba['index']});})}});}async['updateContent']({part:_0x31d613,renderingStrategy:_0x37ef56,showUnchangedParts:_0x5c15a8=!0x1,abortSignal:_0x504090}){this['partDefinition']=_0x31d613,this['isVisible']=this['partDefinition']['hasChanges']||_0x5c15a8,this['isVisible']&&await this['_streamableContentView']['update']({'part':_0x31d613,'renderingStrategy':_0x37ef56,'abortSignal':_0x504090});}['markAsDone'](){this['isDone']=!0x0;}}class mn extends pt(){['queue']=[];['isProcessing']=!0x1;['_abortController'];async['enqueue'](_0x326d29){const _0x2e0316=this['createTask'](_0x326d29);return this['queue']['push'](_0x2e0316),this['_processQueue'](),_0x2e0316['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(_0x1cd5b6=>{this['once']('_queueEmpty',()=>{_0x1cd5b6();});}):Promise['resolve']();}async['_processQueue'](){if(!this['isProcessing']){this['_abortController']=new AbortController(),this['isProcessing']=!0x0;try{for(;this['queue']['length']&&this['isProcessing'];){const _0x5c97e3=this['queue']['shift']();try{await _0x5c97e3['callback'](this['_abortController']['signal']),_0x5c97e3['resolve']();}catch(_0x2a9316){_0x5c97e3['reject'](_0x2a9316);}}}finally{this['isProcessing']=!0x1,this['_abortController']=void 0x0;}this['fire']('_queueEmpty');}}['createTask'](_0x24ba5c){let _0x59e430,_0x1d9ffb;const _0x45a9c0=new Promise((_0x3ef762,_0x1fe309)=>{_0x59e430=_0x3ef762,_0x1d9ffb=_0x1fe309;});return{'callback':_0x24ba5c,'resolve':_0x59e430,'reject':_0x1d9ffb,'completePromise':_0x45a9c0};}}class Cn extends cn{constructor(_0x4a3575){super(_0x4a3575),this['extendTemplate']({'attributes':{'class':['ck-ai-notification','warning'===_0x4a3575['level']?'ck-ai-notification_warning':'ck-ai-notification_error']}});}['render'](){super['render'](),this['setContent'](this['options']['initialContent']),this['markAsDone']();}['setContent'](_0x38aa73){this['element']['innerHTML']=_0x38aa73;}}const wn=['applySuggestion','insertSuggestion'];class fn extends vt{['_applyChangesButton'];['_insertSuggestionsButton'];['children'];constructor(_0x3c2df7,_0x143f70=[...wn],_0x379a5c){super(_0x3c2df7);const _0x1c6d29=this['bindTemplate'],_0x51723b=Boolean(_0x379a5c);if(this['set']('isEnabled',!_0x51723b),this['set']('isVisible',!0x1),this['set']('isTrackChangesOn',!0x1),this['children']=this['createCollection'](),_0x51723b){const _0x58e0b8=new Nt(_0x3c2df7);_0x58e0b8['set']({'label':us(_0x3c2df7,'AI_SUGGESTION_DISABLED_TOOLTIP_MESSAGE'),'tooltip':!0x0,'tooltipPosition':'n','withText':!0x1,'icon':_0x1e2df8});const _0x9b3ad3=new vt(_0x3c2df7);_0x9b3ad3['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-chat__feed__suggestion__actions__info'},'children':[{'tag':'p','children':[us(_0x3c2df7,'AI_SUGGESTION_DISABLED_FEED_MESSAGE'),_0x58e0b8]}]}),this['children']['add'](_0x9b3ad3);}else this['_applyChangesButton']=new Nt(_0x3c2df7),this['_applyChangesButton']['set']({'label':us(_0x3c2df7,'AI_CHAT_SUGGESTION_ACTION_APPLY_ALL'),'withText':!0x0,'type':'button','isVisible':_0x143f70['includes']('applySuggestion'),'class':ds}),this['_insertSuggestionsButton']=new Nt(_0x3c2df7),this['_insertSuggestionsButton']['set']({'label':us(_0x3c2df7,'AI_CHAT_SUGGESTION_ACTION_SUGGEST_ALL'),'withText':!0x0,'type':'button','isVisible':_0x143f70['includes']('insertSuggestion'),'class':_s}),this['_insertSuggestionsButton']['on']('execute',()=>{this['fire']('insertSuggestion');}),this['_applyChangesButton']['on']('execute',()=>{this['fire']('applySuggestion');}),[this['_applyChangesButton'],this['_insertSuggestionsButton']]['forEach'](_0x5c7c9a=>{_0x5c7c9a['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',_0x1c6d29['if']('isVisible','ck-hidden',_0x260e3c=>!_0x260e3c)]},'children':this['children']}),this['on']('change:isTrackChangesOn',()=>{this['_applyChangesButton']&&(this['_applyChangesButton']['isVisible']=!this['isTrackChangesOn']);});}['updateVisibility'](_0x521bad){this['isVisible']=_0x521bad;}['_switchButtonLabelsPlurality'](_0x564244){this['_applyChangesButton']&&this['_insertSuggestionsButton']&&(_0x564244?(this['_applyChangesButton']['label']=us(this['locale'],'AI_CHAT_SUGGESTION_ACTION_APPLY_ALL'),this['_insertSuggestionsButton']['label']=us(this['locale'],'AI_CHAT_SUGGESTION_ACTION_SUGGEST_ALL')):(this['_applyChangesButton']['label']=us(this['locale'],'AI_CHAT_SUGGESTION_ACTION_APPLY'),this['_insertSuggestionsButton']['label']=us(this['locale'],'AI_CHAT_SUGGESTION_ACTION_SUGGEST')));}}class Sn extends vt{['children'];['balloonPanelView'];['bodyCollection'];constructor(_0x3a3576,_0x4e4d7e){super(_0x3a3576),this['bodyCollection']=_0x4e4d7e,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',_0x58e05f=>!_0x58e05f)]},'children':this['children']});const _0x2b9667=new vt(this['locale']),_0x421e1d=new xt();_0x421e1d['content']=_0x80e6d9,_0x2b9667['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-web-sources__header']},'children':[_0x421e1d,{'tag':'span','children':[{'text':us(this['locale'],'AI_CHAT_SOURCES_HEADER')}]}]}),this['children']['add'](_0x2b9667),this['_setupBalloonPanel'](_0x3a3576);}['addSource'](_0x1bdbc1){this['children']['add'](new bn(this['locale'],_0x1bdbc1,this['balloonPanelView']));}['_setupBalloonPanel'](_0x776854){this['balloonPanelView']=new Xt(_0x776854),this['balloonPanelView']['extendTemplate']({'attributes':{'class':['ck-ai-web-source__tooltip-balloon']}}),this['bodyCollection']['add'](this['balloonPanelView']);}}class bn extends Nt{['balloonPanelView'];['source'];constructor(_0x47796d,_0x4b1db7,_0x15ca6a){super(_0x47796d),this['source']=_0x4b1db7,this['balloonPanelView']=_0x15ca6a,this['set']({'label':_0x4b1db7['title'],'class':['ck\x20ck-ai-web-source'],'withText':!0x0});const _0x27668b=this['bindTemplate'];if(this['extendTemplate']({'on':{'click':_0x27668b['to'](()=>{window['open'](_0x4b1db7['url'],'_blank');}),'mouseenter':_0x27668b['to'](()=>{this['_showTooltip']();}),'mouseleave':_0x27668b['to'](()=>{this['_hideTooltip']();})}}),_0x4b1db7['favicon']){const _0x375869=new vt(_0x47796d);_0x375869['setTemplate']({'tag':'img','attributes':{'src':_0x4b1db7['favicon']||_0x80e6d9,'alt':_0x4b1db7['title'],'class':['ck-ai-web-source__image']}}),this['children']['add'](_0x375869);}else this['set']('icon',_0x80e6d9);}['_createTooltipContentView'](_0x3bf375,_0x434174){const _0xd99563=new vt(_0x3bf375),_0x19198d=[];let _0x5cbb25;_0x434174?.['favicon']?(_0x5cbb25=new vt(_0x3bf375),_0x5cbb25['setTemplate']({'tag':'img','attributes':{'src':_0x434174['favicon'],'alt':_0x434174['title'],'class':['ck-ai-web-source__tooltip-image']}})):(_0x5cbb25=new xt(),_0x5cbb25['content']=_0x80e6d9,_0x5cbb25['extendTemplate']({'attributes':{'alt':_0x434174['title'],'class':['ck-ai-web-source__tooltip-image']}})),_0x19198d['push'](_0x5cbb25);const _0x51e56f=new vt(_0x3bf375);_0x51e56f['setTemplate']({'tag':'a','attributes':{'class':['ck-ai-web-source__tooltip-url'],'href':_0x434174['url']},'children':[{'text':new URL(_0x434174['url'])?.['hostname']}]}),_0x19198d['push'](_0x51e56f);const _0x1e3019=new vt(_0x3bf375);_0x1e3019['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-web-source__tooltip-row']},'children':_0x19198d});const _0x2bbbfc=new vt(_0x3bf375);return _0x2bbbfc['setTemplate']({'tag':'span','attributes':{'class':['ck-ai-web-source__tooltip-row','ck-ai-web-source__tooltip-title']},'children':[{'text':_0x434174['title']['length']>0x190?_0x434174['title']['substring'](0x0,0x190)+'...':_0x434174['title']}]}),_0xd99563['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-web-source__tooltip']},'children':[_0x1e3019,_0x2bbbfc]}),_0xd99563;}['_showTooltip'](){this['_updateTooltipContent'](),this['balloonPanelView']['pin']({'target':this['element'],'positions':[Xt['defaultPositions']['northArrowSouth'],Xt['defaultPositions']['northArrowSouthWest'],Xt['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 _0x9fe94a=this['_createTooltipContentView'](this['locale'],this['source']);this['balloonPanelView']['content']['add'](_0x9fe94a);}}class Rn extends vt{['_actionsView'];['_sourcesView'];['_children'];['_areActionsDisabled'];['_showUnchangedParts'];['_updateContentPartsPromiseQueue'];['_emptyPartsWarningView'];['_availableActions'];['_cachedContentParts']=[];constructor(_0x579055,_0x864368){super(_0x579055);const {areActionsDisabled:_0x4491e5,showUnchangedParts:_0x154111,availableActions:_0x264c9c}=_0x864368;this['_areActionsDisabled']=_0x4491e5,this['_showUnchangedParts']=_0x154111,this['_availableActions']=_0x264c9c,this['set']('hasPendingParts',!0x1),this['set']('isTrackChangesOn',!0x1),this['_children']=this['createCollection'](),this['_updateContentPartsPromiseQueue']=new mn(),this['_emptyPartsWarningView']=new Cn({'id':'empty-parts-warning','initialContent':us(_0x579055,'AI_SUGGESTION_EMPTY_PART_WARNING'),'level':'warning'}),this['_emptyPartsWarningView']['isVisible']=!0x1,this['_actionsView']=new fn(_0x579055,_0x864368['availableActions'],this['_areActionsDisabled']),this['_actionsView']['bind']('isTrackChangesOn')['to'](this),this['_sourcesView']=new Sn(this['locale'],_0x864368['bodyCollection']),_0x864368['areActionsDisabled']?this['_actionsView']['isEnabled']=!0x1:this['_actionsView']['bind']('isEnabled')['to'](this,'hasPendingParts'),this['_actionsView']['delegate'](...en)['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:_0x12fdc7,renderingStrategy:_0x45cf18,abortSignal:_0x23f225}){this['_children']['length']?_0x12fdc7['forEach'](_0x3713a6=>{const _0x2bd5ec=this['_cachedContentParts']['findIndex'](_0x2b273b=>_0x2b273b['index']==_0x3713a6['index']);-0x1===_0x2bd5ec?this['_cachedContentParts']['push'](_0x3713a6):this['_cachedContentParts'][_0x2bd5ec]=_0x3713a6;}):this['_cachedContentParts']=_0x12fdc7;const _0x3072b4=this['_showUnchangedParts']?_0x12fdc7:_0x12fdc7['filter'](_0x233a1c=>_0x233a1c['hasChanges']);this['_actionsView']['_switchButtonLabelsPlurality'](_0x3072b4['length']>0x1);for(const _0x2ecc72 of _0x3072b4)this['_updateContentPartsPromiseQueue']['enqueue'](async _0x50c86d=>{let _0x2dc13=this['getPartView'](_0x2ecc72['index']);_0x2dc13||(_0x2dc13=new Tn(this['locale'],{'part':_0x2ecc72,'uiIndex':this['_children']['length']+0x1,'areActionsDisabled':this['_areActionsDisabled'],'availableActions':this['_availableActions']}),_0x2dc13['delegate'](...en)['to'](this),this['_children']['add'](_0x2dc13),this['hasPendingParts']=!0x0),await _0x2dc13['updateContent']({'part':_0x2ecc72,'renderingStrategy':_0x45cf18,'showUnchangedParts':this['_showUnchangedParts'],'abortSignal':_0x50c86d}),_0x2dc13['markAsDone']();});return _0x23f225?.['addEventListener']('abort',()=>{this['_updateContentPartsPromiseQueue']['abort']();}),this['_updateContentPartsPromiseQueue']['queueEmptyPromise'];}['updatePartState'](_0xb1cec8,_0x3142a6){const _0x3fdb4c=this['getPartView'](_0xb1cec8);_0x3fdb4c&&(_0x3fdb4c['state']=_0x3142a6),this['hasPendingParts']='pending'==_0x3142a6||Array['from'](this['_children'])['some'](_0x36fb3e=>'pending'==_0x36fb3e['state']);}['setPartActive'](_0x45e455,_0x161691){if(!0x1===_0x45e455){for(const _0x23e155 of this['_children'])_0x23e155['isActive']=!0x1;}else{const _0x1c0194=this['getPartView'](_0x45e455);_0x1c0194&&(_0x1c0194['isActive']=_0x161691);}}['updateSources'](_0x1037dc){_0x1037dc['forEach'](_0x2bd5ef=>this['_sourcesView']['addSource'](_0x2bd5ef)),this['_sourcesView']['isVisible']=!0x0;}['getPartView'](_0xa4be35){return this['_children']['find'](_0x5f582e=>_0x5f582e['partDefinition']['index']==_0xa4be35)??null;}['markAsDone'](){if(!this['_showUnchangedParts']){const _0x438d06=!this['_cachedContentParts']['find'](({hasChanges:_0x184126})=>_0x184126),_0x35a91f=!!this['_cachedContentParts']['find'](({hasChanges:_0x28c5bf})=>!_0x28c5bf);this['_emptyPartsWarningView']['isVisible']=0x0==this['_children']['length']||_0x35a91f,_0x438d06?this['_emptyPartsWarningView']['setContent'](us(this['locale'],'AI_SUGGESTION_NO_PARTS_WARNING')):this['_emptyPartsWarningView']['setContent'](us(this['locale'],'AI_SUGGESTION_EMPTY_PART_WARNING'));}this['_children']['forEach'](_0x861860=>_0x861860['markAsDone']()),this['_actionsView']['updateVisibility'](this['hasNonEmptyParts']);}get['hasNonEmptyParts'](){return this['_children']['filter'](_0xd36131=>_0xd36131['partDefinition']['hasChanges'])['length']>0x0;}}class On extends vt{['bodyView'];['children'];['headerView'];constructor(_0xf8ffe9,_0x3ae385,_0x12d9d6){super(_0xf8ffe9);const {showDiff:_0x1772df,areActionsDisabled:_0x41c3fc,showUnchangedParts:_0x29d93f,availableActions:_0x4e79cd}=_0x3ae385;this['set']('isTrackChangesOn',!0x1),this['set']('areChangesVisible',!0x1),this['children']=this['createCollection'](),this['headerView']=new ln(_0xf8ffe9,{'showDiff':_0x1772df}),this['headerView']['on']('toggleShowChanges',(_0x29ea7b,_0x1e5bd3)=>{this['areChangesVisible']=_0x1e5bd3['isOn'],this['fire']('toggleSuggestionDisplayMode',{'showDiff':_0x1e5bd3['isOn']});}),this['children']['add'](this['headerView']),this['bodyView']=new Rn(_0xf8ffe9,{'areActionsDisabled':_0x41c3fc,'showUnchangedParts':!!_0x29d93f,'availableActions':_0x4e79cd,'bodyCollection':_0x12d9d6}),this['bodyView']['delegate'](...en)['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'](_0x2b676){await this['bodyView']['updateContentParts'](_0x2b676);}['updateSources'](_0x40d4b1){this['bodyView']['updateSources'](_0x40d4b1);}['markAsDone'](){this['bodyView']['markAsDone'](),this['headerView']&&(this['headerView']['isShowChangesToggleVisible']=this['bodyView']['hasNonEmptyParts']);}}class kn extends cn{['containerView'];constructor(_0x308697,_0x36afc8,_0x306409){super(_0x36afc8),this['set']('isTrackChangesOn',!0x1),this['containerView']=new On(_0x308697,{'showDiff':_0x36afc8['showDiff'],'areActionsDisabled':_0x36afc8['areActionsDisabled'],'availableActions':_0x36afc8['availableActions']},_0x306409),this['containerView']['on']('toggleSuggestionDisplayMode',(_0x3b2f49,_0x5177bf)=>{this['fire']('toggleSuggestionDisplayMode',{'replyId':this['options']['id'],'showDiff':_0x5177bf['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',(_0x453808,{index:_0xd08836})=>{this['fire']('showChangeInText',{'replyId':this['options']['id'],'partIndex':_0xd08836});}),this['containerView']['on']('applySuggestion',(_0x4ea7ff,{index:_0x51cd0c}={})=>{this['fire']('applySuggestion',{'replyId':this['options']['id'],'partIndex':_0x51cd0c});}),this['containerView']['on']('insertSuggestion',(_0xba0f53,{index:_0x5a7eb0}={})=>{this['fire']('insertSuggestion',{'replyId':this['options']['id'],'partIndex':_0x5a7eb0});}),this['containerView']['on']('rejectSuggestion',(_0x326dd7,{index:_0xa6741c})=>{this['fire']('rejectSuggestion',{'replyId':this['options']['id'],'partIndex':_0xa6741c});}),this['containerView']['on']('mouseOverSuggestion',(_0x28aba5,{index:_0x10fd5d})=>{this['fire']('mouseOverSuggestion',{'replyId':this['options']['id'],'partIndex':_0x10fd5d});}),this['containerView']['on']('mouseLeaveSuggestion',(_0x4988a9,{index:_0x536e32})=>{this['fire']('mouseLeaveSuggestion',{'replyId':this['options']['id'],'partIndex':_0x536e32});}),this['children']['addMany']([this['containerView']]),this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__ai-suggestion']}});}async['updateContent'](_0x2aa737){await this['containerView']['updateContent'](_0x2aa737);}['updatePartState'](_0x56d6d4,_0x101eae){this['containerView']['bodyView']['updatePartState'](_0x56d6d4,_0x101eae);}['setPartActive'](_0x47fb7a,_0x2ef444){!0x1===_0x47fb7a?this['containerView']['bodyView']['setPartActive'](!0x1):this['containerView']['bodyView']['setPartActive'](_0x47fb7a,_0x2ef444);}['updateSources'](_0x43d7be){this['containerView']['updateSources'](_0x43d7be);}['getPartView'](_0x30c144){return this['containerView']['bodyView']['getPartView'](_0x30c144);}['markAsDone'](){super['markAsDone'](),this['containerView']['markAsDone']();}}class Nn extends cn{['replyContainer'];['_bodyCollection'];constructor(_0x3fb3d8,_0x51a088,_0x13a6cc){super(_0x51a088),this['_bodyCollection']=_0x13a6cc,this['locale']=_0x3fb3d8,this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__ai-reply']}}),this['replyContainer']=new vt(),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':Is(this['options']['initialContent']),'renderingStrategy':'static'}),this['markAsDone']());}async['updateContent']({parsedContent:_0x3b0c44,renderingStrategy:_0x54eaa7,abortSignal:_0x4d7b36}){'streaming'===_0x54eaa7?await this['streamIntoElement'](_0x3b0c44,this['replyContainer']['element'],_0x4d7b36):this['replyContainer']['element']['innerHTML']=_0x3b485b(_0x3b0c44);}['updateSources'](_0x2cf86d){const _0x356090=new Sn(this['locale'],this['_bodyCollection']);_0x356090['children']['addMany'](_0x2cf86d['map'](_0x3d7afb=>new bn(this['locale'],_0x3d7afb,_0x356090['balloonPanelView']))),_0x356090['isVisible']=!0x0,this['children']['add'](_0x356090);}}class vn extends yt{constructor(_0x7c6ffe=void 0x0){super();const _0x202fd4=_0x7c6ffe?'ck-ai-spinner_'+_0x7c6ffe:'';this['extendTemplate']({'tag':'span','attributes':{'class':['ck-ai-spinner',_0x202fd4]}});}}const yn={'file':_0x14627b,'document':_0x5b8c03,'web-resource':_0x3bbf0a,'text':_0x14627b,'selection':_0x309d2b,'mcp-tool-context':_0x5b8c03},xn='ck-ai-chat-context-chip',Ln='ck-ai-chat-context-chip_wide',Dn='ck-ai-chat-context-chip_document',Pn='ck-ai-chat-context-chip__label',Hn='ck-ai-chat-context-chip__type-icon',Mn='ck-ai-chat-context-controls__chip-tooltip',Un='n';class Vn extends Nt{constructor(_0x3f1379,_0xa5a4a,_0x602e1c,_0x222040,_0x352c82=!0x1){super(_0x3f1379),this['_isAnimationOnEnterEnabled']=_0x222040,this['_initializeProperties'](_0xa5a4a,_0x602e1c,_0x352c82),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'](_0x5acdb3,_0x40e4c5,_0x34e09a){this['set']('label',_0x5acdb3['label']),this['set']('tooltip',!0x0),this['set']('itemType',_0x5acdb3['type']),this['set']('id',_0x5acdb3['uiId']),this['set']('readonly',_0x40e4c5),this['set']('isLoading',_0x34e09a);}['_setupTemplate'](){const _0x96fbc0=this['_createIconView'](),_0x3956e3=this['_createRemoveButton'](),_0xaf3d9c=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':this['_createTemplateAttributes'](_0xaf3d9c),'children':this['_createTemplateChildren'](_0x96fbc0,_0x3956e3,_0xaf3d9c)});}['_createTemplateAttributes'](_0x13e827){return{'class':[xn,_0x13e827['if']('itemType',Dn,_0x36eedf=>'document'==_0x36eedf),_0x13e827['if']('itemType',Ln,_0x47e877=>'selection'==_0x47e877)],'data-cke-tooltip-text':_0x13e827['to']('label',Bn),'data-cke-tooltip-position':Un,'data-cke-tooltip-class':Mn};}['_createTemplateChildren'](_0xc76eb2,_0x3f097b,_0x287e52){const _0x16345d=this['_createLabelElement'](_0x287e52),_0x50f904=this['_createLoaderIcon']();return this['readonly']?[_0xc76eb2,_0x16345d]:[_0xc76eb2,_0x50f904,_0x16345d,_0x3f097b];}['_createLabelElement'](_0x1ccbfd){return{'tag':'span','attributes':{'class':Pn},'children':[{'text':_0x1ccbfd['to']('label')}]};}['_createRemoveButton'](){const _0x1b5dc8=new Nt(this['locale']);return _0x1b5dc8['set']({'label':us(this['locale'],'AI_CHAT_CONTEXT_REMOVE_FROM_CONTEXT'),'icon':_0x23dbe7}),this['_setupRemoveButtonEvent'](_0x1b5dc8),_0x1b5dc8;}['_setupRemoveButtonEvent'](_0x3072b0){_0x3072b0['on']('execute',()=>{this['fire']('removeContextItemChip',this['id']);});}['_createIconView'](){const _0x1eca46=this['bindTemplate'],_0x2106c5=new xt();return _0x2106c5['content']=yn[this['itemType']],_0x2106c5['extendTemplate']({'attributes':{'class':[Hn,_0x1eca46['if']('isLoading','ck-hidden',_0x18cc11=>_0x18cc11)]}}),_0x2106c5;}['_handleAnimationEndOnce'](_0x2e0abb,_0x4fe84d){if(!_0x2e0abb)return;const _0x20bf57=()=>{_0x4fe84d(),_0x2e0abb['removeEventListener']('animationend',_0x20bf57),_0x2e0abb['removeEventListener']('webkitAnimationEnd',_0x20bf57);};_0x2e0abb['addEventListener']('animationend',_0x20bf57),_0x2e0abb['addEventListener']('webkitAnimationEnd',_0x20bf57);}['_createLoaderIcon'](){const _0x4a39d0=new vn('small');return _0x4a39d0['bind']('isVisible')['to'](this,'isLoading',_0x24f803=>_0x24f803),_0x4a39d0;}}function Bn(_0xb69fc4){if(!_0xb69fc4)return _0xb69fc4;if(_0xb69fc4['length']<=0x78)return _0xb69fc4;const _0x495be4=_0xb69fc4['slice'](0x0,0x78),_0x4c98a9=_0x495be4['lastIndexOf']('\x20');return(_0x4c98a9>0x0?_0x495be4['slice'](0x0,_0x4c98a9):_0x495be4)+'…';}const Gn={'maxVisibleRows':0x2,'rowDetectionTolerance':0x5,'showMoreLabelPrefix':'+\x20','viewportOffset':{'top':0x64,'bottom':0xa}},Fn='300px';class Kn{['_locale'];['_config'];['_visibleChips'];['_overflowChips'];['_showMoreButtonView']=null;['_showMoreBalloonPanelView']=null;['_containerElement']=null;['_bodyCollection'];['_parentView']=null;['_intersectionObserver']=null;['_pendingCalculation']=!0x1;constructor(_0x2f534b,_0x12bd66,_0x281ecb,_0x5d9308,_0x2cd8ea){this['_locale']=_0x2f534b,this['_visibleChips']=_0x12bd66,this['_config']={...Gn,..._0x281ecb,'cssClasses':{'controlsButton':'','calculationContainer':'ck-calculation-container',..._0x281ecb['cssClasses']}},this['_overflowChips']=new _t(),this['_bodyCollection']=_0x5d9308,this['_parentView']=_0x2cd8ea||null;}['setContainerElement'](_0x536321){this['_intersectionObserver']&&(this['_intersectionObserver']['disconnect'](),this['_intersectionObserver']=null),this['_containerElement']=_0x536321,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 _0x515474=[...this['_visibleChips'],...this['_overflowChips']],_0x4ef147=this['_createCalculationContainer'](),_0x1cbb24=this['_calculateOverflowInContainer'](_0x4ef147,_0x515474),_0x2d7f10=_0x4ef147['_ancestorsToRestore'];_0x2d7f10&&this['_restoreAncestorVisibility'](_0x2d7f10),_0x4ef147['remove'](),this['_applyOverflowResults'](_0x515474,_0x1cbb24);}['_createShowMoreButton'](){this['_showMoreButtonView']=this['_createShowMoreButtonView'](),this['_showMoreBalloonPanelView']=this['_createShowMoreBalloonPanelView'](),this['_showMoreButtonView']['render'](),this['_containerElement']['appendChild'](this['_showMoreButtonView']['element']),this['_showMoreButtonView']['on']('execute',()=>{this['_handleShowMoreButtonClick']();}),zt({'emitter':this['_showMoreBalloonPanelView'],'contextElements':[this['_showMoreBalloonPanelView']['element'],this['_showMoreButtonView']['element']],'callback':()=>this['hideBalloonPanel'](),'activator':()=>this['_showMoreButtonView']['isOn']});}['_createShowMoreButtonView'](){const _0x525c2d=new Nt(this['_locale']);_0x525c2d['set']({'label':'','withText':!0x0,'isToggleable':!0x0});const _0x3f0a56=[this['_config']['cssClasses']['showMoreButton']];return this['_config']['cssClasses']['controlsButton']&&_0x3f0a56['push'](this['_config']['cssClasses']['controlsButton']),_0x525c2d['extendTemplate']({'attributes':{'class':_0x3f0a56}}),_0x525c2d;}['_createShowMoreBalloonPanelView'](){const _0x5f33f3=new Xt(this['_locale']);return _0x5f33f3['extendTemplate']({'attributes':{'class':this['_config']['cssClasses']['showMoreBalloon']}}),this['_bodyCollection']['add'](_0x5f33f3),_0x5f33f3;}['_updateBalloonContent'](){if(this['_showMoreBalloonPanelView']&&(this['_showMoreBalloonPanelView']['content']['clear'](),this['_overflowChips']['length']>0x0)){this['_overflowChips']['forEach'](_0x54fdbb=>{_0x54fdbb['disableAnimationOnEnter']();});const _0x53bdbb=new vt(this['_locale']);_0x53bdbb['setTemplate']({'tag':'div','attributes':{'class':this['_config']['cssClasses']['overflowContainer']},'children':this['_overflowChips']}),this['_showMoreBalloonPanelView']['content']['add'](_0x53bdbb);}}['_handleShowMoreButtonClick'](){this['_showMoreButtonView']['isOn']?this['hideBalloonPanel']():this['showBalloonPanel']();}['_updateShowMoreButtonVisibility'](){const _0x5d1b47=this['_overflowChips']['length']>0x0;this['_showMoreButtonView']?.['element']&&(this['_showMoreButtonView']['element']['style']['display']=_0x5d1b47?'':'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'](_0x3733c1){const _0xe4eb4=this['_containerElement']?.['tagName']['toLowerCase']()||'div',_0x2cf9d0=this['_containerElement']?.['classList'];if(_0x2cf9d0){const _0x251195=_0x2cf9d0[0x0]||'',_0x843d=_0x3733c1['querySelector']('.'+_0x251195),_0x1d9a1e=_0x3733c1['querySelector'](_0xe4eb4);return _0x843d||_0x1d9a1e||_0x3733c1;}return _0x3733c1['querySelector'](_0xe4eb4)||_0x3733c1;}['_calculateContainerWidth'](){const _0x1445c5=this['_parentView']?.['element']||this['_containerElement'];if(!_0x1445c5)return Fn;const _0x349193=window['getComputedStyle'](_0x1445c5)['width'];if('auto'===_0x349193||'0px'===_0x349193||!_0x349193){const _0x4f4437=_0x1445c5['parentElement'];if(_0x4f4437){const _0xb10b8c=window['getComputedStyle'](_0x4f4437);return'auto'!==_0xb10b8c['width']?_0xb10b8c['width']:Fn;}return Fn;}return _0x349193;}['_applyCalculationStyles'](_0x4bd6bb,_0x36ef2e){this['_config']['cssClasses']['calculationContainer']&&_0x4bd6bb['classList']['add'](this['_config']['cssClasses']['calculationContainer']),_0x4bd6bb['style']['width']=_0x36ef2e,_0x4bd6bb['style']['position']='absolute',_0x4bd6bb['style']['top']='-9999px',_0x4bd6bb['style']['left']='-9999px',_0x4bd6bb['style']['opacity']='0',_0x4bd6bb['style']['pointerEvents']='none',_0x4bd6bb['style']['zIndex']='-1',_0x4bd6bb['style']['visibility']='visible\x20!important',_0x4bd6bb['style']['display']='block\x20!important',_0x4bd6bb['style']['boxSizing']='border-box';}['_restoreAncestorVisibility'](_0xb5e92c){_0xb5e92c['forEach'](({element:_0x582549,originalDisplay:_0x22540f,originalVisibility:_0x1c27ac})=>{_0x582549['style']['display']=_0x22540f,_0x582549['style']['visibility']=_0x1c27ac;});}['_makeAncestorsVisible'](_0x1c55e8){const _0xa8707=[];let _0xa28bfc=_0x1c55e8;for(;_0xa28bfc&&_0xa28bfc!==document['body'];){const _0x56d5ba=window['getComputedStyle'](_0xa28bfc);'none'!==_0x56d5ba['display']&&'hidden'!==_0x56d5ba['visibility']||(_0xa8707['push']({'element':_0xa28bfc,'originalDisplay':_0xa28bfc['style']['display'],'originalVisibility':_0xa28bfc['style']['visibility']}),_0xa28bfc['style']['display']='block',_0xa28bfc['style']['visibility']='visible'),_0xa28bfc=_0xa28bfc['parentElement'];}return _0xa8707;}['_createContainerElements'](){let _0xa35dbb,_0xd34f15;return this['_parentView']?.['element']?(_0xa35dbb=this['_parentView']['element']['cloneNode'](!0x0),_0xd34f15=this['_findTargetContainer'](_0xa35dbb)):(_0xa35dbb=document['createElement']('div'),_0xd34f15=_0xa35dbb),{'calculationContainer':_0xa35dbb,'targetContainer':_0xd34f15};}['_createCalculationContainer'](){const {calculationContainer:_0x355f67,targetContainer:_0x5e779b}=this['_createContainerElements'](),_0x45bb67=this['_calculateContainerWidth']();this['_applyCalculationStyles'](_0x355f67,_0x45bb67);const _0x4ec52b=this['_parentView']?.['element']||this['_containerElement'],_0x1e0bc9=_0x4ec52b?.['parentElement'];_0x1e0bc9?_0x1e0bc9['appendChild'](_0x355f67):document['body']['appendChild'](_0x355f67),_0x355f67['_targetContainer']=_0x5e779b;const _0x2ac010=this['_makeAncestorsVisible'](_0x1e0bc9||null);return _0x355f67['offsetWidth'],_0x355f67['_ancestorsToRestore']=_0x2ac010,_0x355f67;}['_calculateOverflowInContainer'](_0x3db553,_0xf537b){const _0x2e0c3e=_0x3db553['_targetContainer']||_0x3db553,_0x420e46=[],{rowCount:_0xa7168b}=this['_renderChipsAndCountRows'](_0x2e0c3e,_0xf537b);if(_0xa7168b<=this['_config']['maxVisibleRows'])return _0x420e46;const _0x15ff27=_0xf537b['slice']();for(;_0x15ff27['length']>0x0;){if(this['_testButtonFit'](_0x3db553,_0x2e0c3e,_0x15ff27)){const _0x275b10=_0xf537b['filter'](_0x554f11=>!_0x15ff27['includes'](_0x554f11));_0x420e46['push'](..._0x275b10);break;}if(!_0x15ff27['pop']())break;}return _0x420e46;}['_renderChipsAndCountRows'](_0x3d7f8f,_0x5f2f70){_0x3d7f8f['innerHTML']='',_0x5f2f70['forEach'](_0x2ae79b=>{if(_0x2ae79b['element']){const _0x5d650c=_0x2ae79b['element']['cloneNode'](!0x0);_0x3d7f8f['appendChild'](_0x5d650c);}}),_0x3d7f8f['offsetWidth'];const _0x522482=_0x3d7f8f['children'],_0x354274=[];return Array['from'](_0x522482)['forEach'](_0xaa0051=>{const _0x400b0a=_0xaa0051['getBoundingClientRect']()['top'];_0x354274['some'](_0x1a5833=>Math['abs'](_0x1a5833-_0x400b0a)<this['_config']['rowDetectionTolerance'])||_0x354274['push'](_0x400b0a);}),{'rowCount':_0x354274['length']};}['_createMockButton'](){const _0x2c7546=document['createElement']('button');return _0x2c7546['className']=this['_config']['cssClasses']['showMoreButton'],this['_config']['cssClasses']['controlsButton']&&_0x2c7546['classList']['add'](this['_config']['cssClasses']['controlsButton']),_0x2c7546['textContent']='+\x201',_0x2c7546;}['_testButtonFit'](_0x335d67,_0x14e4dd,_0xe54272){this['_renderChipsAndCountRows'](_0x14e4dd,_0xe54272);const _0x229344=this['_createMockButton']();_0x335d67['appendChild'](_0x229344),_0x335d67['offsetWidth'];const _0x5ea1ff=[..._0x14e4dd['children'],_0x229344],_0x2a9b1a=[];_0x5ea1ff['forEach'](_0x43eeee=>{const _0x464122=_0x43eeee['getBoundingClientRect']()['top'];_0x2a9b1a['some'](_0x2b4992=>Math['abs'](_0x2b4992-_0x464122)<this['_config']['rowDetectionTolerance'])||_0x2a9b1a['push'](_0x464122);});const _0x49a690=_0x2a9b1a['length'];return _0x229344['remove'](),_0x49a690<=this['_config']['maxVisibleRows'];}['_distributeChips'](_0x5e53a6,_0x3e9bf0){this['_visibleChips']['clear'](),this['_overflowChips']['clear'](),_0x5e53a6['forEach'](_0xf64436=>{_0x3e9bf0['includes'](_0xf64436)?this['_overflowChips']['add'](_0xf64436):this['_visibleChips']['add'](_0xf64436);});}['_updateOverflowUI'](_0x51f327){if(_0x51f327>0x0&&!this['_showMoreButtonView']&&this['_createShowMoreButton'](),_0x51f327>0x0&&this['_showMoreButtonView']){const _0x31f04a=''+this['_config']['showMoreLabelPrefix']+(_0x51f327<0x63?_0x51f327:'99');this['_showMoreButtonView']['label']=_0x31f04a;}this['_updateBalloonContent'](),this['_updateShowMoreButtonVisibility'](),this['_repinBalloonPanel']();}['_applyOverflowResults'](_0x17a930,_0xb7e19b){this['_distributeChips'](_0x17a930,_0xb7e19b),this['_updateOverflowUI'](_0xb7e19b['length']);}['_setupVisibilityObserver'](){this['_containerElement']&&'undefined'!=typeof IntersectionObserver&&(this['_intersectionObserver']=new IntersectionObserver(_0x5ee16c=>{_0x5ee16c[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 _0x3c60a0=this['_containerElement']['getBoundingClientRect']();if(0x0===_0x3c60a0['width']||0x0===_0x3c60a0['height'])return!0x1;const _0x3a59bc=window['innerHeight']||document['documentElement']['clientHeight'],_0xa38275=window['innerWidth']||document['documentElement']['clientWidth'],_0x215b34=0xc8;return _0x3c60a0['bottom']>=-0xc8&&_0x3c60a0['top']<=_0x3a59bc+_0x215b34&&_0x3c60a0['right']>=-0xc8&&_0x3c60a0['left']<=_0xa38275+_0x215b34;}}const Wn='ck-ai-chat__feed__context-chips',Yn='ck-ai-chat-context-chips-wrapper',$n='ck-ai-chat-context-chips-wrapper-balloon',qn='ck-ai-chat-controls-button',Qn='ck-ai-chat-controls_context_show-more-button',Xn='ck-ai-chat-context-controls__show-more-balloon-panel';class zn extends vt{['_contextChips']=this['createCollection']();['_overflowManager'];['_bodyCollection'];constructor(_0x48dfe0,_0x190d91,_0x4cbe68){super(_0x48dfe0),this['_bodyCollection']=_0x4cbe68,this['_createContextChips'](_0x190d91);const _0x411653={'cssClasses':{'showMoreButton':Qn+'\x20'+As,'showMoreBalloon':Xn,'overflowContainer':$n,'controlsButton':qn}};this['_overflowManager']=new Kn(_0x48dfe0,this['_contextChips'],_0x411653,this['_bodyCollection'],this),this['setTemplate']({'tag':'div','attributes':{'class':[Wn,'ck','ck-reset_all']},'children':[{'tag':'div','attributes':{'class':Yn},'children':this['_contextChips']}]});}['render'](){super['render']();const _0x6a15c=this['element']['querySelector']('.'+Yn);_0x6a15c&&(this['_overflowManager']['setContainerElement'](_0x6a15c),this['_overflowManager']['reorganizeChips']());}['destroy'](){super['destroy'](),this['_overflowManager']['destroy']();}['_createContextChips'](_0x28d3c0){for(const _0x5e6fd6 of _0x28d3c0){const _0x376dc9=new Vn(this['locale'],_0x5e6fd6,!0x0,!0x1);this['_contextChips']['add'](_0x376dc9);}}}class jn extends cn{['_contextChipsView']=null;['_locale'];['_bodyCollection'];['_messageContentView'];constructor(_0x580409,_0x46bcef,_0x484944){super(_0x46bcef),this['_locale']=_0x580409,this['_bodyCollection']=_0x484944,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 zn(this['_locale'],this['options']['contextItems']['filter'](_0x4a77d2=>!_0x4a77d2['hidden']),this['_bodyCollection']),this['_contextChipsView']['extendTemplate']({'attributes':{'class':'ck-ai-chat__feed__context-chips'}}),this['children']['add'](this['_contextChipsView']));}['_createMessageContentView'](){this['_messageContentView']=new vt(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 Jn extends cn{['capabilities'];constructor(_0xa642fd,_0x231a69){super(_0x231a69);const {isWebSearchEnabled:_0x428c68,isReasoningEnabled:_0x35fb0c}=_0x231a69['capabilities'],_0x2d6b75=[];let _0x54c0af='';_0x428c68&&_0x35fb0c?(_0x54c0af=us(_0xa642fd,'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH_REASONING'),_0x2d6b75['push'](Zn(_0x80e6d9)),_0x2d6b75['push'](Zn(_0x33b265))):_0x428c68?(_0x54c0af=us(_0xa642fd,'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH'),_0x2d6b75['push'](Zn(_0x80e6d9))):_0x35fb0c&&(_0x54c0af=us(_0xa642fd,'AI_CHAT_FEED_REPLY_ITEM_USED_REASONING'),_0x2d6b75['push'](Zn(_0x33b265))),this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__interaction-header',_0x54c0af?'':'ck-hidden']}});const _0x27fba9=new vt();_0x27fba9['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__interaction-header__capabilities']},'children':[..._0x2d6b75,{'tag':'span','attributes':{'class':['ck-ai-chat__feed__interaction-header__capabilities__text']},'children':[_0x54c0af]}]}),this['children']['add'](_0x27fba9),this['capabilities']=_0x231a69['capabilities'];}}function Zn(_0x463d36){const _0x378daf=new xt();return _0x378daf['content']=_0x463d36,_0x378daf;}const tr=['wheel','touchstart','pointerdown','keydown'],er=['ArrowUp','ArrowDown','PageUp','PageDown','Home','End','\x20'];class ir{['element'];['animationFrameId'];['isRunning'];['abortController'];['isUserPaused'];constructor(_0x35ad01){this['element']=_0x35ad01,this['animationFrameId']=null,this['isRunning']=!0x1,this['abortController']=new AbortController(),this['isUserPaused']=!0x1;for(const _0x46fa63 of tr){const _0x4132ba='keydown'!==_0x46fa63;this['element']['addEventListener'](_0x46fa63,this['_onUserEvent']['bind'](this),{'passive':_0x4132ba,'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'](_0x50aa2b){if(this['isRunning']){if('keydown'===_0x50aa2b['type']){const _0x710e83=_0x50aa2b['key'];if(!er['includes'](_0x710e83))return;}_0x50aa2b instanceof WheelEvent?_0x50aa2b['deltaY']<0x0?this['isUserPaused']=!0x0:this['isUserPaused']=!this['_isAtBottom']():this['isUserPaused']=!0x0;}}['_isAtBottom'](){const {scrollTop:_0x44d353,scrollHeight:_0xd1154,clientHeight:_0x1d485c}=this['element'];return _0xd1154-_0x44d353-_0x1d485c<=0x5;}['_rafUpdate'](){this['isRunning']&&(this['isUserPaused']||this['element']['scrollTo']({'top':this['element']['scrollHeight'],'behavior':'auto'}),this['animationFrameId']=requestAnimationFrame(this['_rafUpdate']['bind'](this)));}}class sr extends vt{constructor(_0x5818e4,_0x566788){super(_0x5818e4),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-skeleton']},'children':this['_createSkeletonItems'](_0x566788)});}['_createSkeletonItems'](_0xe0971a){const _0x3fe8a9=['ck','ck-ai-skeleton__item'];return _0xe0971a['map'](_0x129c4d=>{let _0x177d94='';switch(_0x129c4d['attributes']['align']){case'right':_0x177d94='margin-left:\x20auto;\x20margin-right:\x200;\x20text-align:\x20right;';break;case'center':_0x177d94='margin-left:\x20auto;\x20margin-right:\x20auto;\x20text-align:\x20center;';break;case'left':_0x177d94='margin-left:\x200;\x20margin-right:\x20auto;\x20text-align:\x20left;';}return{'tag':_0x129c4d['tag'],'attributes':{'class':[..._0x3fe8a9,_0x129c4d['attributes']['class']?_0x129c4d['attributes']['class']:''],'style':'width:\x20'+_0x129c4d['attributes']['width']+';\x20height:\x20'+_0x129c4d['attributes']['height']+';'+_0x177d94}};});}}const nr={'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':rr(0x5,'100%','44px','right'),'aiChatResources':rr(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 rr(_0x13e9bc,_0x2930e9,_0x2deb6b,_0x5efbc7){return new Array(_0x13e9bc)['fill'](null)['map'](()=>({'tag':'div','attributes':{'width':_0x2930e9,'height':_0x2deb6b,'align':_0x5efbc7}}));}class ar extends cn{constructor(_0x374052){super(_0x374052),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 or extends vt{['children'];['scrollManager'];['_bodyCollection'];constructor(_0x49cd76,_0x424667){super(_0x49cd76),this['_bodyCollection']=_0x424667,this['set']('isPending',!0x1),this['set']('loadingMessage',''),this['set']('isLoadingSkeletonVisible',!0x1),this['set']('isTrackChangesOn',!0x1),this['children']=this['createCollection'](),this['children']['delegate'](...sn)['to'](this),this['_setupTemplate']();}['render'](){super['render'](),this['scrollManager']=new ir(this['element']);}['destroy'](){super['destroy'](),this['scrollManager']['destroy']();}['clear'](){this['children']['clear']();}['addItem'](_0x271722,_0x8f4e99){let _0x1c27ba;return'ai-reply'===_0x271722?_0x1c27ba=new Nn(this['locale'],_0x8f4e99,this['_bodyCollection']):'ai-suggestion-reply'===_0x271722?(_0x1c27ba=new kn(this['locale'],_0x8f4e99,this['_bodyCollection']),_0x1c27ba['bind']('isTrackChangesOn')['to'](this)):_0x1c27ba='user-message'===_0x271722?new jn(this['locale'],_0x8f4e99,this['_bodyCollection']):'interaction-header'===_0x271722?new Jn(this['locale'],_0x8f4e99):'custom-element'===_0x271722?new ar(_0x8f4e99):new Cn(_0x8f4e99),this['children']['add'](_0x1c27ba),_0x1c27ba;}async['updateReplyItem']({id:_0x1b816d,parsedContent:_0x471eed,renderingStrategy:_0x13c78c,abortSignal:_0x30c628}){const _0x14a887=this['getItemById'](_0x1b816d);if(!(_0x14a887 instanceof Nn))throw new ht('ai-chat-feed-view-item-not-a-reply-item',null,{'itemView':_0x14a887,'id':_0x1b816d,'parsedContent':_0x471eed});await _0x14a887['updateContent']({'parsedContent':_0x471eed,'renderingStrategy':_0x13c78c,'abortSignal':_0x30c628});}async['updateWebSources'](_0x68eec9,_0x17f6c1){const _0x245b41=this['getItemById'](_0x68eec9);if(_0x245b41 instanceof kn)_0x245b41['updateSources'](_0x17f6c1);else{if(!(_0x245b41 instanceof Nn))throw new ht('ai-chat-feed-view-item-not-a-suggestion-or-reply-item',null,{'itemView':_0x245b41,'id':_0x68eec9,'sources':_0x17f6c1});_0x245b41['updateSources'](_0x17f6c1);}}async['updateSuggestionItem']({id:_0x50f0e2,parts:_0x285456,renderingStrategy:_0x2edfbb,abortSignal:_0x4a8a55}){const _0x241d6c=this['getItemById'](_0x50f0e2);if(!(_0x241d6c instanceof kn))throw new ht('ai-chat-feed-view-item-not-a-suggestion-item',null,{'itemView':_0x241d6c,'id':_0x50f0e2,'parts':_0x285456});await _0x241d6c['updateContent']({'parts':_0x285456,'renderingStrategy':_0x2edfbb,'abortSignal':_0x4a8a55});}['updateSuggestionPartState']({id:_0x52c1fc,index:_0xc7a1a1,state:_0x1237e7}){const _0x2a6014=this['getItemById'](_0x52c1fc);if(!(_0x2a6014 instanceof kn))throw new ht('ai-chat-feed-view-item-not-a-suggestion-item',this,{'id':_0x52c1fc});_0x2a6014['updatePartState'](_0xc7a1a1,_0x1237e7);}['setSuggestionPartActive']({id:_0x5579a2,index:_0x405e7f,isActive:_0x199b2}){const _0x1eeadf=this['getItemById'](_0x5579a2);if(!(_0x1eeadf instanceof kn))throw new ht('ai-chat-feed-view-item-not-a-suggestion-item',this,{'id':_0x5579a2});this['children']['filter'](_0x2c7453=>_0x2c7453 instanceof kn)['forEach'](_0x33be28=>{_0x33be28['setPartActive'](!0x1);}),_0x1eeadf['setPartActive'](_0x405e7f,_0x199b2);}['markItemAsDone'](_0x142dd4){this['getItemById'](_0x142dd4)['markAsDone']();}['getItemIds'](){return this['children']['map'](_0x268a87=>_0x268a87['options']['id']);}['removeItem'](_0x537d30){this['children']['remove'](this['getItemById'](_0x537d30));}['hasItem'](_0x331aad){return!!this['children']['find'](_0x3a5bd6=>_0x3a5bd6['options']['id']['includes'](_0x331aad));}['scrollToSuggestion'](_0x459a10,_0xf2aac2){const _0x142224=this['getItemById'](_0x459a10);if(!(_0x142224 instanceof kn))return void Tt('ck-ai-chat-feed-view-scroll-to-suggestion-invalid-item',{'replyId':_0x459a10,'partIndex':_0xf2aac2});const _0x427f3c=_0x142224['getPartView'](_0xf2aac2);_0x427f3c?ft(_0x427f3c['element'],0x14,this['element']['parentElement'],!0x0,!0x0):Tt('ck-ai-chat-feed-view-scroll-to-suggestion-part-view-not-found',{'replyId':_0x459a10,'partIndex':_0xf2aac2});}['_setupTemplate'](){this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed']},'children':this['_createTemplateChildren']()});}['_createTemplateChildren'](){const _0x2a9f63=this['_createSkeletonLoader']();return[this['_createFeedItems'](),_0x2a9f63,this['_createFeedLoader']()];}['_createSkeletonLoader'](){const _0x1a75d1=new sr(this['locale'],nr['aiFeed']);return _0x1a75d1['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isLoadingSkeletonVisible','ck-hidden',_0x4e51e5=>!_0x4e51e5)]}}),_0x1a75d1;}['_createFeedItems'](){const _0x41abf6=new vt(this['locale']);return _0x41abf6['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__items',this['bindTemplate']['if']('isLoadingSkeletonVisible','ck-hidden')]},'children':this['children']}),_0x41abf6;}['_createFeedLoader'](){const _0x37b8a7=new vt(this['locale']);return _0x37b8a7['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__loader',this['bindTemplate']['if']('isPending','ck-hidden',_0x463cd9=>!_0x463cd9)]},'children':this['_createLoaderChildren']()}),_0x37b8a7;}['_createLoaderChildren'](){const _0x1f8a09=new vn();return _0x1f8a09['isVisible']=!0x0,[_0x1f8a09,{'tag':'span','attributes':{'class':['ck','ck-ai-chat__loader-text']},'children':[{'text':this['bindTemplate']['to']('loadingMessage')}]}];}['getItemById'](_0x559499){const _0x4b8488=this['children']['find'](_0x3cdece=>_0x3cdece['options']['id']['includes'](_0x559499));if(!_0x4b8488)throw new ht('ai-chat-feed-view-item-not-found',this,{'id':_0x559499});return _0x4b8488;}['setLoadingMessage'](_0x490158){this['set']('loadingMessage',_0x490158);}['toggleLoadingSkeleton'](_0x1663e2){this['set']('isLoadingSkeletonVisible',_0x1663e2);}['startAutoScroll'](){this['scrollManager']['start']();}['stopAutoScroll'](){this['scrollManager']['stop']();}}class hr extends Dt{['filter'](){let _0x3cf3d9=0x0;for(const _0x5e9570 of this['items'])_0x3cf3d9+=_0x5e9570['items']['length'];return{'resultsCount':_0x3cf3d9,'totalItemsCount':_0x3cf3d9};}}const cr='ck-ai-chat__prompt-input_highlighted';class lr extends Lt{['submitButtonView'];static ['MIN_ROWS']=0x1;static ['MAX_ROWS']=0xc;['_addContextButtonView'];['_queryViewResizeObserver'];constructor(_0xc21eab,_0x1c6fc6){super(_0xc21eab,{'queryView':{'label':'','creator':Vt,'showIcon':!0x1,'showResetButton':!0x1},'filteredView':new hr(_0xc21eab),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1}),this['set']('isEmpty',!0x0),this['set']('isUploadInProgress',!0x1),this['_addContextButtonView']=_0x1c6fc6,this['_queryViewResizeObserver']=null,this['queryView']['fieldView']['minRows']=lr['MIN_ROWS'],this['queryView']['fieldView']['maxRows']=lr['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',(_0x1b994d,_0x53de68)=>!_0x1b994d&&!_0x53de68),this['focusableChildren']['add'](this['submitButtonView']);}['render'](){super['render'](),this['queryView']['fieldWrapperChildren']['add'](this['submitButtonView']),this['keystrokes']['set']('enter',(_0x34218c,_0x2c3131)=>{this['isUploadInProgress']||this['isEmpty']||_0x34218c['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0x2c3131());}),this['queryView']['fieldView']['on']('update',()=>{this['isEmpty']=''===this['queryView']['fieldView']['element']['value']?.['trim']();});}['destroy'](){super['destroy'](),this['_queryViewResizeObserver']&&this['_queryViewResizeObserver']['destroy']();}['submit'](){const _0x3eb90d=this['queryView']['fieldView']['element']['value']?.['trim']();if(!_0x3eb90d)return this['queryView']['errorText']=us(this['locale'],'AI_CHAT_PROMPT_EMPTY_ERROR'),void(this['queryView']['fieldView']['hasError']=!0x0);this['queryView']['fieldView']['hasError']=!0x1;const _0x521a31=_0x2d90f2(_0x3eb90d);this['fire']('sendUserMessage',_0x521a31),this['queryView']['fieldView']['reset']();}['setPlaceholderText'](_0x5ed1d6){this['queryView']['fieldView']['set']('placeholder',_0x5ed1d6);}['focus'](_0x4e5387=!0x1){super['focus'](),_0x4e5387&&(this['element']['classList']['contains'](cr)||(this['element']['classList']['add'](cr),setTimeout(()=>{this['element']['classList']['remove'](cr);},0x320)));}['_createSubmitButton'](){const _0x10829a=new Nt(this['locale']);return _0x10829a['set']({'icon':_0xb85aa1,'label':us(this['locale'],'AI_CHAT_LABEL_SUBMIT'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-chat__prompt-submit-button\x20'+ds,'isEnabled':!0x1}),_0x10829a['on']('execute',()=>{this['submit']();}),_0x10829a;}['setIsUploadInProgress'](_0xc912ea){this['isUploadInProgress']=_0xc912ea;}['_setUpAddContextButtonPositioning'](){const _0x483ff7=this['locale'],_0x40ad80=()=>{lt['window']['requestAnimationFrame'](()=>{if(ut(this['element'])){const _0x483d93=new dt(this['queryView']['fieldView']['element']),_0x53d239=new dt(this['_addContextButtonView']['element']),_0x8c7df1=_0x483d93['width'],_0x563cf6='rtl'===_0x483ff7['uiLanguageDirection']?'right':'left';_0x483d93['excludeScrollbarsAndBorders']();const _0x248a22=_0x8c7df1-_0x483d93['width']+0x1;this['_addContextButtonView']['element']['style'][_0x563cf6]='calc('+(_0x8c7df1-_0x53d239['width']-_0x248a22)+'px\x20-\x20var(--ck-spacing-tiny))';}});};this['queryView']['fieldView']['on']('update',_0x40ad80),this['on']('render',()=>{_0x40ad80(),this['_queryViewResizeObserver']=new St(this['queryView']['fieldView']['element'],()=>{_0x40ad80();});});}}const ur='ck-ai-chat__prompt-capabilities',dr='ck-ai-chat-controls-button',_r='ck-ai-chat-controls-button--commands',Ar='ck-ai-chat-controls__model-selection',gr='ck-ai-chat-controls__model-selection__item-name',Ir='ck-ai-chat-controls__model-selection__item-description',Er='ck-ai-chat-controls__model-selection__item-capabilities',pr='n';class Tr extends vt{['_webSearchButton'];['_reasoningButton'];['_commandsButton'];['_modelSelectionDropdown'];['_modelSelectionDropdownItems'];['_modelNameView'];constructor(_0x1a0b2e){super(_0x1a0b2e),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',_0x23e4a6=>'selector'===_0x23e4a6),this['_modelSelectionDropdown']['buttonView']['bind']('tooltip')['to'](this,'modelSelectorEnabled',_0x218668=>_0x218668?this['_modelSelectionDropdown']['buttonView']['label']:us(this['locale'],'AI_CHAT_MODEL_SELECTOR_DISABLED_TOOLTIP')),this['_modelSelectionDropdown']['bind']('isEnabled')['to'](this,'modelSelectorEnabled',_0x5f1124=>_0x5f1124),this['_webSearchButton']['bind']('isOn')['to'](this,'webSearchActive',_0x3276a3=>_0x3276a3),this['_webSearchButton']['bind']('tooltip')['to'](this,'webSearchActive',_0x457fd9=>us(this['locale'],_0x457fd9?'AI_CHAT_DISABLE_WEB_SEARCH':'AI_CHAT_ENABLE_WEB_SEARCH')),this['_reasoningButton']['bind']('isOn')['to'](this,'reasoningActive',_0x43d53c=>_0x43d53c),this['_reasoningButton']['bind']('tooltip')['to'](this,'reasoningActive',_0x2367ad=>us(this['locale'],_0x2367ad?'AI_CHAT_DISABLE_REASONING':'AI_CHAT_ENABLE_REASONING')),this['setTemplate']({'tag':'div','attributes':{'class':[ur]},'children':[this['_modelSelectionDropdown'],this['_modelNameView'],this['_webSearchButton'],this['_reasoningButton'],this['_commandsButton']]}),this['_modelSelectionDropdownItems']=new _t(),jt(this['_modelSelectionDropdown'],this['_modelSelectionDropdownItems']);}['setModelList'](_0x2f741c,_0x438fc2){if(_0x438fc2)this['set']('modelDisplayMode','hidden');else{const _0x445059=0x1===_0x2f741c['length'];this['set']('modelDisplayMode',_0x445059?'name':'selector');}if(this['_modelSelectionDropdownItems']['clear'](),_0x2f741c?.['length'])for(const _0x3c5f80 of _0x2f741c){const _0x5e4318=new Jt({'label':_0x3c5f80['name'],'withText':!0x0,'role':'menuitemradio','id':_0x3c5f80['id'],'model':_0x3c5f80});_0x5e4318['bind']('isOn')['to'](this,'activeModelId',_0x321349=>_0x321349===_0x3c5f80['id']),this['_modelSelectionDropdownItems']['add']({'type':'button','model':_0x5e4318,'labelView':new mr(this['locale'],_0x3c5f80)});}}['setWebSearch'](_0x9a073c){this['set']('webSearchActive',_0x9a073c);}['setReasoning'](_0x336c28){this['set']('reasoningActive',_0x336c28);}['setModel'](_0x130726){if(!_0x130726)return;this['activeModelId']=_0x130726['id'],this['activeModelName']=_0x130726['name']||_0x130726['id'],this['_modelSelectionDropdown']['buttonView']['set']('label',_0x130726['name']),this['_modelSelectionDropdown']['buttonView']['set']('tooltip',_0x130726['name']);const _0xc4ebdd=_0x130726['capabilities']['webSearch']?.['enabled']??!0x1;this['set']('webSearchActive',!0x1),this['_webSearchButton']['set']('isOn',!0x1),this['_webSearchButton']['set']('isEnabled',_0xc4ebdd),this['_webSearchButton']['set']('isVisible',_0xc4ebdd);const _0x536f86=_0x130726['capabilities']['reasoning']?.['enabled']??!0x1;this['set']('reasoningActive',!0x1),this['_reasoningButton']['set']('isOn',!0x1),this['_reasoningButton']['set']('isEnabled',_0x536f86),this['_reasoningButton']['set']('isVisible',_0x536f86);}['enableModelSelector'](){this['set']('modelSelectorEnabled',!0x0);}['disableModelSelector'](_0x130e3e){this['set']('modelSelectorEnabled',!0x1),_0x130e3e&&this['set']('modelDisplayMode','hidden');}['_createWebSearchButton'](){const _0x33a6e7=new Nt();return _0x33a6e7['set']({'label':us(this['locale'],'AI_CHAT_SEARCH_WEB'),'icon':_0x80e6d9,'class':dr+'\x20'+As,'isToggleable':!0x0,'tooltipPosition':pr}),_0x33a6e7['on']('execute',()=>{this['fire']('toggleWebSearch');}),_0x33a6e7;}['_createReasoningButton'](){const _0x2fbec8=new Nt();return _0x2fbec8['set']({'label':us(this['locale'],'AI_CHAT_REASONING'),'icon':_0x33b265,'class':dr+'\x20'+As,'isToggleable':!0x0,'tooltipPosition':pr}),_0x2fbec8['on']('execute',()=>{this['fire']('toggleReasoning');}),_0x2fbec8;}['_createCommandsButton'](){const _0x323afd=new Nt();return _0x323afd['set']({'label':us(this['locale'],'AI_CHAT_COMMANDS'),'icon':_0x4ac43b,'withText':!0x0,'class':dr+'\x20'+As,'isToggleable':!0x0,'tooltip':us(this['locale'],'AI_CHAT_COMMANDS'),'tooltipPosition':pr}),_0x323afd['extendTemplate']({'attributes':{'class':[_r]}}),_0x323afd['on']('execute',()=>{console['log']('Commands\x20are\x20not\x20implemented\x20yet.'),alert('Commands\x20are\x20not\x20implemented\x20yet.');}),_0x323afd;}['_createModelSelectionDropdown'](){const _0x59d91f=Gt(this['locale']);return _0x59d91f['set']({'panelPosition':'ne','class':[Ar]}),_0x59d91f['buttonView']['set']({'label':us(this['locale'],'AI_CHAT_MODEL_SELECTOR_ENABLED_TOOLTIP'),'withText':!0x0,'tooltip':!0x0,'tooltipPosition':pr,'class':As}),this['listenTo'](_0x59d91f,'execute',_0x36fd72=>{this['fire']('selectModel',_0x36fd72['source']['model']);}),_0x59d91f;}['_createModelNameView'](){const _0x39610d=new Cr(this['locale']);return _0x39610d['bind']('text')['to'](this,'activeModelName',_0x2af082=>_0x2af082??''),_0x39610d['bind']('isVisible')['to'](this,'modelDisplayMode',_0x2c6820=>'name'===_0x2c6820),_0x39610d;}}let mr=class extends Mt{constructor(_0x4bc4bb,_0x644f4d){super();const _0x2fcc28=this['bindTemplate'],_0x40fae7=this['createCollection']();this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-button__label'],'style':_0x2fcc28['to']('style'),'id':_0x2fcc28['to']('id')},'children':[{'tag':'div','attributes':{'class':[gr]},'children':[{'text':_0x2fcc28['to']('text')}]},{'tag':'div','attributes':{'class':[Ir]},'children':[{'tag':'span','children':[{'text':_0x644f4d['description']}]}]},{'tag':'div','attributes':{'class':[Er]},'children':_0x40fae7}]}),_0x40fae7['addMany'](this['_getCapabilityParts'](_0x4bc4bb,_0x80e6d9,'AI_CHAT_SEARCH_WEB',_0x644f4d['capabilities']['webSearch']?.['enabled']??!0x1)),_0x40fae7['addMany'](this['_getCapabilityParts'](_0x4bc4bb,_0x33b265,'AI_CHAT_REASONING',_0x644f4d['capabilities']['reasoning']?.['enabled']??!0x1));}['_getCapabilityParts'](_0x270e3b,_0xfb36e1,_0x4d660a,_0x69fcd2){const _0x3ab212=new xt();_0x3ab212['content']=_0xfb36e1;const _0x32e2b0=new vt(_0x270e3b);_0x32e2b0['setTemplate']({'tag':'span','children':[{'text':us(_0x270e3b,_0x4d660a)+':\x20'}]});const _0x10644c=new vt(_0x270e3b);return _0x10644c['setTemplate']({'tag':'span','children':[{'text':us(_0x270e3b,_0x69fcd2?'AI_CHAT_CAPABILITIES_YES':'AI_CHAT_CAPABILITIES_NO')}]}),[_0x3ab212,_0x32e2b0,_0x10644c];}},Cr=class extends vt{constructor(_0x1ad3b7){super(_0x1ad3b7),this['set']('text',void 0x0),this['set']('isVisible',!0x0);const _0x255e6d=this['bindTemplate'];this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-chat-controls__model-name',_0x255e6d['if']('isVisible','ck-hidden',_0xdc5c1f=>!_0xdc5c1f)]},'children':[{'text':_0x255e6d['to']('text')}]});}};const wr='ck-ai-chat-context-controls__url-form',fr='ck-ai-chat-context-controls__url-input-section';class Sr extends vt{['focusTracker'];['keystrokes'];['_focusables'];['focusCycler'];['urlInputField'];['backButton'];['confirmButton'];constructor(_0x21e9b7){super(_0x21e9b7),this['focusTracker']=new At(),this['keystrokes']=new gt(),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 Ut({'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'](_0x3e3833=>{this['focusTracker']['add'](_0x3e3833['element']),this['keystrokes']['listenTo'](_0x3e3833['element']);}),Zt({'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'](_0xb0d446){this['urlInputField']['errorText']=_0xb0d446,this['_updateConfirmButtonState'](),this['fire']('refreshBalloon');}['clearError'](){this['urlInputField']['errorText']=null,this['_updateConfirmButtonState']();}['_createBackButton'](){const _0xd060ee=new Nt(this['locale']);return _0xd060ee['set']({'icon':_0x2eda47,'tooltip':us(this['locale'],'AI_CHAT_CONTEXT_URL_BACK_TO_CONTEXT'),'tooltipPosition':'n','class':['ck-button-icon\x20ck-button-back']}),this['on']('change:withBackButton',(_0x39f7a7,_0xb7f8b9,_0x480474)=>{_0xd060ee['set']({'class':['ck-button-icon\x20ck-button-back'+(_0x480474?'':'\x20ck-hidden')]});}),_0xd060ee;}['_createUrlInputField'](){const _0x5dedcb=new te(this['locale'],_0x25cf25);return _0x5dedcb['set']({'label':us(this['locale'],'AI_CHAT_CONTEXT_URL_LABEL'),'class':'ck-labeled-field-view_empty'}),_0x5dedcb['fieldView']['set']({'placeholder':us(this['locale'],'AI_CHAT_CONTEXT_URL_PLACEHOLDER')}),_0x5dedcb;}['_createConfirmButton'](){const _0x54900e=new Nt(this['locale']);return _0x54900e['set']({'icon':_0xef6224,'tooltip':us(this['locale'],'AI_CHAT_CONTEXT_URL_ADD_URL'),'tooltipPosition':'n','class':'ck-button-icon','type':'submit','isEnabled':!0x1}),_0x54900e;}['_setupTemplate'](){const _0x29e290=new _0x1b248d(this['locale'],{'label':us(this['locale'],'AI_CHAT_CONTEXT_URL_ADD_URL'),'class':'ck-ai-header\x20ck-ai-header_small\x20ck-ai-header_context-url'});_0x29e290['children']['add'](this['backButton'],0x0),this['setTemplate']({'tag':'form','attributes':{'class':wr,'tabindex':'-1'},'children':[_0x29e290,{'tag':'div','attributes':{'class':fr},'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',_0x153045=>{_0x153045['stop'](),this['_handleSubmit']();});}['_setupKeystrokes'](){this['keystrokes']['set']('esc',(_0x4201c3,_0x664b27)=>{this['clear'](),this['fire']('cancel'),_0x664b27();});}['_handleSubmit'](){const _0x4ad1fb=this['getValue']()['trim']();_0x4ad1fb?this['_isValidUrl'](_0x4ad1fb)?(this['clearError'](),this['fire']('submitUrl',_0x4ad1fb)):this['setError'](us(this['locale'],'AI_CHAT_CONTEXT_URL_INVALID_ERROR')):this['setError'](us(this['locale'],'AI_CHAT_CONTEXT_URL_EMPTY_ERROR'));}['_updateConfirmButtonState'](){const _0x1e091a=this['getValue']()['trim'](),_0x406441=!!this['urlInputField']['errorText'];this['confirmButton']['isEnabled']=_0x1e091a['length']>0x0&&!_0x406441;}['_isValidUrl'](_0x447c27){try{return!!new URL(_0x447c27);}catch{return!0x1;}}}const br='ck-ai-chat-resources__item',Rr='ck-ai-chat-resources__item--in-context',Or='ck-ai-chat-resources__item-title',kr='ck-ai-chat-resources__item__icon';class Nr extends Ht{['resource'];['_titleView'];['_iconView'];constructor(_0x416b9a,_0x5d487b){super(_0x416b9a),this['resource']=_0x5d487b,this['set']('isInContext',!!_0x5d487b['isInContext']),this['_titleView']=this['_createTitleView'](),this['_iconView']=this['_createIconView'](),this['_setupTemplate']();}['render'](){super['render']();}['getResourceIcon'](_0x36b1bb){if(_0x36b1bb['isInContext'])return _0xef6224;switch(_0x36b1bb['type']){case Us['DOCUMENT']:return _0x5b8c03;case Us['URL']:return _0x3bbf0a;case Us['FILE']:case Us['TEXT']:return _0x14627b;default:return _0x2cbe6c;}}['highlightText'](_0x4c3df4){if(!_0x4c3df4||''===_0x4c3df4['trim']())return void this['_titleView']['highlightText'](null);const _0x1ed57c=new RegExp(_0x3eb90e(_0x4c3df4),'gi');this['_titleView']['highlightText'](_0x1ed57c);}['updateResourceState'](_0x21438e){this['resource']['isInContext']=_0x21438e,this['isInContext']=_0x21438e,this['_updateIcon']();}['_createTitleView'](){const _0x845787=new _0x1b00b1();return _0x845787['text']=this['resource']['label'],_0x845787['extendTemplate']({'tag':'span','attributes':{'class':[Or]}}),_0x845787;}['_createIconView'](){const _0x50780d=new xt();return _0x50780d['content']=this['getResourceIcon'](this['resource']),_0x50780d;}['_setupTemplate'](){const _0x3606ab=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':[br,_0x3606ab['if']('isVisible','ck-hidden',_0x258878=>!_0x258878),_0x3606ab['if']('isInContext',Rr)]},'children':[{'tag':'div','attributes':{'class':[kr]},'children':[this['_iconView']]},this['_titleView']],'on':{'click':_0x3606ab['to']('execute')}});}['_updateIcon'](){this['_iconView']['content']=this['getResourceIcon'](this['resource']);}}const vr='ck-ai-chat-resources__list';class yr extends Dt{['_source'];constructor(_0x1d9290,_0x18b878){super(_0x1d9290),this['_source']=_0x18b878,this['extendTemplate']({'attributes':{'class':[vr]}});}['setResources'](_0x509240,_0x1737c9){this['items']['clear']();let _0x133da7=_0x509240;if(this['_source']['useDefaultFiltering']&&_0x1737c9&&''!==_0x1737c9['trim']()){const _0x2ef85f=new RegExp(_0x1737c9['replace'](/[.*+?^${}()|[\]\\]/g,'\x5c$&'),'gi');_0x133da7=_0x509240['filter'](_0x46b9ca=>_0x2ef85f['test'](_0x46b9ca['label']));}for(const _0x1098b6 of _0x133da7){const _0x1234ca=new Nr(this['locale'],_0x1098b6);_0x1234ca['on']('execute',()=>{this['_handleResourceSelection'](this['_source'],_0x1098b6);}),this['items']['add'](_0x1234ca);}this['_source']['useDefaultFiltering']&&this['highlightText'](_0x1737c9);}['highlightText'](_0x3295ba){this['_source']['useDefaultFiltering']&&this['items']['forEach'](_0x200928=>{_0x200928['highlightText'](_0x3295ba);});}['updateResourceState'](_0x16e5ca,_0x2bb588){for(const _0x27d8ab of this['items']){const _0x5c6419=_0x27d8ab;_0x5c6419['resource']['id']===_0x16e5ca&&_0x5c6419['updateResourceState'](_0x2bb588);}}['_handleResourceSelection'](_0x93deb8,_0x5c1b42){this['fire']('addResourceToContext',{'source':_0x93deb8,'resource':_0x5c1b42});}}class xr extends te{['iconView'];['resetButtonView'];['_viewConfig'];constructor(_0x25b2f8){const t=_0x25b2f8['t'],_0x57dde7={'showResetButton':!0x0,'showIcon':!0x0,'creator':_0x25cf25,'label':us(_0x25b2f8,'AI_CHAT_SEARCH_RESOURCES')};super(_0x25b2f8,_0x57dde7['creator']),this['label']=_0x57dde7['label'],this['_viewConfig']=_0x57dde7,this['_viewConfig']['showIcon']&&this['_setupSearchIcon'](),this['_viewConfig']['showResetButton']&&this['_setupResetButton'](_0x25b2f8,t),this['_setupEventListeners']();}['reset'](){this['fieldView']['reset'](),this['_viewConfig']['showResetButton']&&this['resetButtonView']&&(this['resetButtonView']['isVisible']=!0x1),this['search']('');}['search'](_0x2888c8){this['fire']('search',_0x2888c8);}['getQuery'](){return this['fieldView']['element']?.['value']||'';}['_setupSearchIcon'](){this['iconView']=new xt(),this['iconView']['content']=_0x5a05dc,this['fieldWrapperChildren']['add'](this['iconView'],0x0),this['extendTemplate']({'attributes':{'class':'ck-search__query_with-icon'}});}['_setupResetButton'](_0x3950e8,t){this['resetButtonView']=new Nt(_0x3950e8),this['resetButtonView']['set']({'label':t('Clear'),'icon':_0x2e72cd,'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',_0x39a5ab=>!_0x39a5ab),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 Lr extends vt{['_searchView'];['_searchSection'];['_searchInputVisibleFrom'];['_resourcesListView'];['_skeletonLoader'];['_source'];['children'];['_latestLoadResourcesUid']=null;constructor(_0x177dfe,_0x20143c){super(_0x177dfe),this['_source']=_0x20143c['source'],this['_searchInputVisibleFrom']=_0x20143c['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 _0x5df866([this['_skeletonLoader'],this['_resourcesListView']]),this['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-chat-resources'},'children':this['children']});}['_createSearchView'](){return new xr(this['locale']);}['_createSearchSection'](){const _0x111daa=new vt(this['locale']);return _0x111daa['setTemplate']({'tag':'div','attributes':{'class':'ck\x20ck-search'},'children':[this['_searchView']]}),this['_searchView']['on']('search',(_0x559063,_0x4002d7)=>{this['loadResources'](_0x4002d7),this['_source']['useDefaultFiltering']&&this['_resourcesListView']['highlightText'](_0x4002d7);}),_0x111daa;}['_createResourcesListView'](){const _0x1ea637=new yr(this['locale'],this['_source']);return _0x1ea637['delegate']('addResourceToContext')['to'](this),_0x1ea637['extendTemplate']({'attributes':{'class':this['bindTemplate']['if']('isLoading','ck-hidden')}}),_0x1ea637;}['_createSkeletonView'](){const _0x119362=new sr(this['locale'],nr['aiChatResources']);return _0x119362['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isLoading','ck-hidden',_0x277dfc=>!_0x277dfc)]}}),_0x119362;}['render'](){super['render'](),this['loadResources']('');}['loadResources'](_0x51b0a8){const _0x366198=ot();this['_latestLoadResourcesUid']=_0x366198,this['fire']('loadSourceResources',{'sourceId':this['_source']['id'],'query':_0x51b0a8,'uid':_0x366198}),this['isLoading']=!0x0;}['setResources'](_0x57cf4a,_0x402ed1){if(_0x402ed1&&_0x402ed1!==this['_latestLoadResourcesUid'])return;const _0x5b5231=this['_source']['useDefaultFiltering']?this['_searchView']['getQuery']():'';this['_resourcesListView']['setResources'](_0x57cf4a,_0x5b5231),_0x57cf4a['length']>=this['_searchInputVisibleFrom']&&!this['children']['has'](this['_searchSection'])&&this['children']['add'](this['_searchSection'],0x0),requestAnimationFrame(()=>{this['isLoading']=!0x1;});}['updateResourceState'](_0x6bd93c,_0x3fd4f3){this['_resourcesListView']['updateResourceState'](_0x6bd93c,_0x3fd4f3);}}const Dr='ck-ai-chat-context-controls__source-balloon-panel',Pr='ck-button-icon\x20ck-button-back',Hr='ck-ai-header\x20ck-ai-header_small\x20ck-ai-header_source';class Mr{['_sourceResourceBalloons']=new Map();['_bodyCollection'];['_locale'];['_config'];constructor(_0x87d2a,_0x5560be,_0x4e1bc5){this['_locale']=_0x87d2a,this['_bodyCollection']=_0x5560be,this['_config']=_0x4e1bc5;}['showSourceResourcesBalloon']({source:_0x81543b,withBackButton:_0x2446d7}){let _0x43d9d2=this['_sourceResourceBalloons']['get'](_0x81543b['id']);_0x43d9d2||(_0x43d9d2=this['_createSourceResourceBalloonPanel'](),this['_sourceResourceBalloons']['set'](_0x81543b['id'],_0x43d9d2),this['_setupSingleResourceBalloonClickOutsideHandler'](_0x43d9d2)),this['_addSourceResourceContent']({'balloonPanel':_0x43d9d2,'source':_0x81543b,'withBackButton':_0x2446d7}),_0x43d9d2['show']();const _0x10553e=this['_config']['getTargetElement']();_0x10553e&&_0x43d9d2['pin']({'target':_0x10553e,'limiter':this['_config']['getLimiterElement']()});}['populateSourceResourceBalloon'](_0x4670bc,_0x36c998,_0x2aa14d){const _0x96b620=this['_sourceResourceBalloons']['get'](_0x4670bc);if(!_0x96b620)return;const _0x816a77=this['_getResourcesViewFromBalloon'](_0x96b620);_0x816a77&&(_0x816a77['setResources'](_0x36c998,_0x2aa14d),_0x816a77['once']('change:isLoading',()=>{_0x96b620['pin']({'target':this['_config']['getTargetElement'](),'limiter':this['_config']['getLimiterElement']()});}));}['closeSourceResourceBalloon'](_0xac9f64){const _0x3fe1a4=this['_sourceResourceBalloons']['get'](_0xac9f64);_0x3fe1a4&&requestAnimationFrame(()=>{_0x3fe1a4['hide'](),this['_sourceResourceBalloons']['delete'](_0xac9f64),this['_config']['onBalloonClosed']();});}['isAnyResourceBalloonVisible'](){for(const _0x20a5c9 of this['_sourceResourceBalloons']['values']())if(_0x20a5c9['isVisible'])return!0x0;return!0x1;}['updateResourceState'](_0x4ea403,_0x19ddc1,_0x196679){const _0x2a1806=this['_sourceResourceBalloons']['get'](_0x4ea403);if(!_0x2a1806||!_0x2a1806['isVisible'])return;const _0xb16e7=this['_config']['getTargetElement']();if(!_0xb16e7)return;_0x2a1806['pin']({'target':_0xb16e7,'limiter':this['_config']['getLimiterElement']()});const _0x42fccb=this['_getResourcesViewFromBalloon'](_0x2a1806);_0x42fccb&&_0x42fccb['updateResourceState'](_0x19ddc1,_0x196679);}['destroy'](){for(const _0x1332bd of this['_sourceResourceBalloons']['values']())_0x1332bd['destroy']();this['_sourceResourceBalloons']['clear']();}['_createSourceResourceBalloonPanel'](){const _0x3bdccd=new Xt(this['_locale']);return _0x3bdccd['extendTemplate']({'attributes':{'class':Dr}}),this['_bodyCollection']['add'](_0x3bdccd),_0x3bdccd;}['_addSourceResourceContent']({balloonPanel:_0xbf6424,source:_0x21a208,withBackButton:_0x3d42d8}){_0xbf6424['content']['clear']();const _0x28bd4e=this['_createBalloonHeader']({'balloonPanel':_0xbf6424,'source':_0x21a208,'withBackButton':_0x3d42d8});_0xbf6424['content']['add'](_0x28bd4e);const _0x4be3a0=this['_createBalloonResourcesView'](_0x21a208);_0xbf6424['content']['add'](_0x4be3a0);}['_createBalloonHeader']({balloonPanel:_0x4dedd3,source:_0x111ca9,withBackButton:_0x1d46cb}){const _0x3a6272=new _0x1b248d(this['_locale'],{'label':_0x111ca9['label'],'class':Hr});return _0x1d46cb&&_0x3a6272['children']['add'](this['_createBackButton'](_0x4dedd3),0x0),_0x3a6272;}['_createBackButton'](_0x2bd9eb){const _0x417db4=new Nt(this['_locale']);return _0x417db4['set']({'icon':_0x2eda47,'tooltip':us(this['_locale'],'AI_CHAT_CONTEXT_URL_BACK_TO_CONTEXT'),'tooltipPosition':'n','class':Pr}),_0x417db4['on']('execute',()=>{_0x2bd9eb['hide'](),this['_config']['onBackToContext']();}),_0x417db4;}['_createBalloonResourcesView'](_0x48bddd){const _0x3e5222=new Lr(this['_locale'],{'source':_0x48bddd,'searchInputVisibleFrom':this['_config']['searchInputVisibleFrom']});return _0x3e5222['on']('loadSourceResources',(_0x5260b4,_0x4dda46)=>{this['_config']['onLoadSourceResources'](_0x4dda46);}),_0x3e5222['on']('addResourceToContext',(_0x40c34e,_0x32e294)=>{this['_config']['onResourceSelected'](_0x32e294['source'],_0x32e294['resource']),this['closeSourceResourceBalloon'](_0x48bddd['id']);}),_0x3e5222;}['_getResourcesViewFromBalloon'](_0x10a6b5){const _0x726799=_0x10a6b5['content']['get'](0x1);return _0x726799 instanceof Lr?_0x726799:null;}['_setupSingleResourceBalloonClickOutsideHandler'](_0x1b7eed){zt({'emitter':_0x1b7eed,'contextElements':[_0x1b7eed['element']],'callback':()=>{_0x1b7eed['hide'](),this['_config']['onBalloonClosed']();},'activator':()=>_0x1b7eed['isVisible']});}}const Ur=['addDocumentToContext','addFileToContext','addUrlToContext','addResourceToContext','removeContextItem','loadSourceResources','executeCustomItemCallback'],Vr='ck-ai-chat-context-controls',Br='ck-ai-chat-context-controls__pending-contexts',Gr='ck-ai-chat-context-controls__add-context-balloon-panel',Fr='ck-ai-chat-context-controls__add-context-button',Kr='ck-ai-chat-context-controls__url-balloon-panel',Wr='ck-ai-chat-context-controls__balloon-button',Yr='ck-ai-chat-context-controls__balloon-button-source',$r='ck-ai-chat-controls-button',qr='ck-ai-chat-context-chips-wrapper-balloon',Qr='ck-ai-chat-controls_context_show-more-button',Xr='ck-ai-chat-context-controls__show-more-balloon-panel',zr='ck-ai-chat',jr=[Xt['defaultPositions']['northArrowSouthWest'],Xt['defaultPositions']['northArrowSouth'],Xt['defaultPositions']['northArrowSouthEast'],Xt['defaultPositions']['southArrowNorthWest'],Xt['defaultPositions']['southArrowNorth'],Xt['defaultPositions']['southArrowNorthEast']];class Jr extends vt{['addContextButtonView'];['_currentContextsChips']=this['createCollection']();['_conversationContextsChips']=this['createCollection']();['_overflowManager'];['_addContextBalloonPanelView'];['_urlBalloonPanelView'];['_urlInputView'];['_resourcesBalloonView'];['_addContextBalloonConfig'];['_hasExactlyOneSource']=!0x1;['bodyCollection'];constructor(_0x198a2d,_0x1fc73a){super(_0x198a2d),this['bodyCollection']=_0x1fc73a['bodyCollection'],this['_currentContextsChips']=this['createCollection'](),this['_conversationContextsChips']=this['createCollection'](),this['addContextButtonView']=this['_createAddContextButtonView'](_0x198a2d),this['_addContextBalloonPanelView']=this['_createAddContextBalloonPanelView'](_0x198a2d),this['_urlBalloonPanelView']=this['_createUrlBalloonPanelView'](_0x198a2d),this['_resourcesBalloonView']=this['_createResourcesBalloonView'](_0x198a2d,_0x1fc73a);const _0xa33234={'cssClasses':{'showMoreButton':Qr+'\x20'+As,'showMoreBalloon':Xr,'overflowContainer':qr,'controlsButton':$r}};this['_overflowManager']=new Kn(_0x198a2d,this['_currentContextsChips'],_0xa33234,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'](_0x3c2bd7,_0x364ad8){const _0x5218be=this['_createContextButton'](_0x3c2bd7,'current',!0x0,_0x364ad8);this['_addContextToCollection'](_0x5218be,this['_currentContextsChips']),this['_overflowManager']['reorganizeChips']();}['removeContextItem'](_0x1215c8){this['_removeContextFromCollection'](_0x1215c8,this['_currentContextsChips']),this['_removeContextFromCollection'](_0x1215c8,this['_overflowManager']['overflowChips']),this['_overflowManager']['reorganizeChips']();}['setContextItemLoading'](_0x28ae85,_0x215d71){let _0x24b565=this['_currentContextsChips']['find'](_0x44afaa=>_0x44afaa['id']===_0x28ae85);_0x24b565||(_0x24b565=this['_overflowManager']['overflowChips']['find'](_0x51b2fd=>_0x51b2fd['id']===_0x28ae85)),_0x24b565&&(_0x24b565['isLoading']=_0x215d71);}['setConversationContext'](_0x45704f){this['_conversationContextsChips']['clear']();for(const _0x2f2517 of _0x45704f){const _0x1e2269=this['_createContextButton'](_0x2f2517,'conversation',!0x1,!0x1);this['_addContextToCollection'](_0x1e2269,this['_conversationContextsChips']);}}['clearCurrentContextItems'](){this['_currentContextsChips']['clear'](),this['_overflowManager']['clear']();}['clearConversationContextItems'](){this['_conversationContextsChips']['clear']();}['updateResourceState'](_0x764e2a,_0x3d545f,_0x52ece9){this['_resourcesBalloonView']['updateResourceState'](_0x764e2a,_0x3d545f,_0x52ece9);}['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:_0x39e569,withBackButton:_0x5170db}){this['_resourcesBalloonView']['showSourceResourcesBalloon']({'source':_0x39e569,'withBackButton':_0x5170db}),this['addContextButtonView']['isOn']=!0x0;}['populateSourceResourceBalloon'](_0x5010e6,_0x24cbb0,_0x4bd5f8,_0x451b27){this['_resourcesBalloonView']['populateSourceResourceBalloon'](_0x5010e6,_0x4bd5f8,_0x451b27);}['closeSourceResourceBalloon'](_0x49eaea){this['_resourcesBalloonView']['closeSourceResourceBalloon'](_0x49eaea),this['addContextButtonView']['isOn']=!0x1;}['setAddContextOptions'](_0x59d075){this['_setBalloonPanelContent'](this['_addContextBalloonPanelView'],this['locale'],_0x59d075),this['_setAddContextButtonEnabled'](_0x59d075);}['_setAddContextButtonEnabled'](_0x466e1f){const _0x10896c=!_0x466e1f['document']['isHidden']&&_0x466e1f['document']['enabled'],_0x2acc89=_0x466e1f['urls']['enabled'],_0x521280=_0x466e1f['files']['enabled'],_0x56be59=_0x466e1f['sources']['length']>0x0,_0x3d0e61=_0x466e1f['customItems']&&_0x466e1f['customItems']['length']>0x0;this['addContextButtonView']['isEnabled']=_0x10896c||_0x2acc89||_0x521280||_0x56be59||_0x3d0e61;}['_setupTemplate'](){this['setTemplate']({'tag':'div','attributes':{'class':[Vr,'ck-reset_all-excluded']},'children':[{'tag':'div','attributes':{'class':Br},'children':this['_currentContextsChips']}]});}['_bindEventHandlers'](){this['addContextButtonView']['on']('execute',()=>{this['_handleAddContextButtonClick']();});}['_createAddContextButtonView'](_0x1fc5cf){const _0x56ecf8=new Nt(_0x1fc5cf);return _0x56ecf8['set']({'label':us(_0x1fc5cf,'AI_CHAT_CONTEXT_ADD_CONTEXT'),'class':$r+'\x20'+Fr+'\x20'+As,'icon':_0x5002ef,'isToggleable':!0x0,'tooltip':!0x0,'tooltipPosition':'sw'}),_0x56ecf8;}['_createAddContextBalloonPanelView'](_0x5b5949){return this['_createBaseBalloonPanel'](_0x5b5949,Gr);}['_createUrlBalloonPanelView'](_0x19f71e){const _0xdc80c5=this['_createBaseBalloonPanel'](_0x19f71e,Kr);return this['_addUrlContent'](_0xdc80c5,_0x19f71e),_0xdc80c5;}['_createResourcesBalloonView'](_0x5645de,_0x3e6ed9){const _0x232118={'searchInputVisibleFrom':_0x3e6ed9['searchInputVisibleFrom'],'onBackToContext':()=>{this['showAddContextBalloonPanel'](),this['_addContextBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':jr});},'onResourceSelected':(_0x4537e0,_0x3fc216)=>{this['fire']('addResourceToContext',{'source':_0x4537e0,'resource':_0x3fc216});},'onLoadSourceResources':_0x1f491a=>{this['fire']('loadSourceResources',_0x1f491a);},'onBalloonClosed':()=>{this['addContextButtonView']['isOn']=!0x1;},'getLimiterElement':()=>this['_getLimiterElement'](),'getTargetElement':()=>this['addContextButtonView']['element']};return new Mr(_0x5645de,_0x3e6ed9['bodyCollection'],_0x232118);}['_getLimiterElement'](){return this['element']?.['closest']('.'+zr)||document['body'];}['_createBaseBalloonPanel'](_0x3c0c21,_0x1a4823){const _0x41d07a=new Xt(_0x3c0c21);return _0x41d07a['extendTemplate']({'attributes':{'class':_0x1a4823}}),this['bodyCollection']['add'](_0x41d07a),_0x41d07a;}['_setBalloonPanelContent'](_0x3b0b57,_0x3371e2,_0x1d3197){if(_0x3b0b57['content']['clear'](),!_0x1d3197['document']['isHidden']&&_0x1d3197['document']['enabled']){const _0x1c0225=this['_createBalloonButton'](_0x3371e2,{'label':us(_0x3371e2,'AI_CHAT_CONTEXT_CURRENT_DOCUMENT'),'icon':_0x5b8c03});_0x1c0225['on']('execute',()=>{this['fire']('addDocumentToContext'),this['hideAddContextBalloonPanel']();}),_0x3b0b57['content']['add'](_0x1c0225);}if(_0x1d3197['urls']['enabled']){const _0x2cda2b=this['_createBalloonButton'](_0x3371e2,{'label':us(_0x3371e2,'AI_CHAT_CONTEXT_URL_LABEL'),'icon':_0x3bbf0a});_0x2cda2b['on']('execute',()=>{this['hideAddContextBalloonPanel'](),this['showUrlBalloonPanel'](),this['_urlBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':jr}),this['_urlInputView']['focus']();}),_0x3b0b57['content']['add'](_0x2cda2b);}if(_0x1d3197['files']['enabled']){const _0x3ed69b=new _0x56f40d(_0x3371e2);_0x3ed69b['set']({'label':us(_0x3371e2,'AI_CHAT_CONTEXT_FILE_LABEL'),'icon':_0x21b454,'withText':!0x0,'tooltip':!0x0,'class':Wr,'allowMultipleFiles':!0x0}),_0x3ed69b['on']('execute',()=>{this['hideAddContextBalloonPanel']();}),_0x3ed69b['on']('done',(_0x5004ff,_0x22c12c)=>{this['fire']('addFileToContext',_0x22c12c);}),_0x3ed69b['tooltip']=!0x0,_0x3b0b57['content']['add'](_0x3ed69b);}for(const _0x4534b2 of _0x1d3197['sources']){const _0x27d0b7=this['_createBalloonButton'](_0x3371e2,{'label':_0x4534b2['label'],'icon':_0x4534b2['icon']||_0x2cbe6c,'type':'source'});_0x3b0b57['content']['add'](_0x27d0b7),_0x27d0b7['on']('execute',()=>{this['hideAddContextBalloonPanel'](),this['_showSourceResourcesBalloon']({'source':_0x4534b2,'withBackButton':!this['_hasExactlyOneSource']});});}for(const _0x11332c of _0x1d3197['customItems']||[]){const _0x12cfe7=this['_createBalloonButton'](_0x3371e2,{'label':_0x11332c['label'],'icon':_0x11332c['icon']||_0x2cbe6c,'type':'customItem'});_0x3b0b57['content']['add'](_0x12cfe7),_0x12cfe7['on']('execute',()=>{this['hideAddContextBalloonPanel'](),this['fire']('executeCustomItemCallback',_0x11332c);});}this['_hasExactlyOneSource']=0x1===_0x3b0b57['content']['length'],this['_urlInputView']['withBackButton']=!this['_hasExactlyOneSource'];}['_addUrlContent'](_0x29d31f,_0x2408f2){this['_urlInputView']=new Sr(_0x2408f2),this['_urlInputView']['on']('submitUrl',(_0x13032c,_0x19340f)=>{this['_handleUrlSubmit'](_0x19340f);}),this['_urlInputView']['on']('cancel',()=>{this['hideUrlBalloonPanel'](),this['_hasExactlyOneSource']||(this['showAddContextBalloonPanel'](),this['_addContextBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':jr}));}),this['_urlInputView']['on']('refreshBalloon',()=>{this['_urlBalloonPanelView']['isVisible']&&this['_urlBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':jr});}),_0x29d31f['content']['add'](this['_urlInputView']);}['_createBalloonButton'](_0x31e4cf,_0x42bdc5){const _0x42fc12='source'===_0x42bdc5['type']?new Zr(_0x31e4cf):new Nt(_0x31e4cf);return _0x42fc12['set']({'label':_0x42bdc5['label'],'icon':_0x42bdc5['icon'],'withText':!0x0,'tooltip':!0x0,'tooltipPosition':'sw','class':Wr}),_0x42fc12;}['_setupAllBalloonClickOutsideHandlers'](){this['_setupAddContextBalloonClickOutsideHandler'](),this['_setupUrlBalloonClickOutsideHandler']();}['_setupUrlBalloonClickOutsideHandler'](){zt({'emitter':this['_urlBalloonPanelView'],'contextElements':[this['_urlBalloonPanelView']['element']],'callback':()=>{this['hideUrlBalloonPanel']();},'activator':()=>this['_urlBalloonPanelView']['isVisible']});}['_toggleAddContextBalloon'](_0x50b739){const _0x5bc607=this['_addContextBalloonConfig'];_0x5bc607['buttonView']['isOn']=_0x50b739,_0x50b739?_0x5bc607['balloonView']['show']():_0x5bc607['balloonView']['hide']();}['_setupAddContextBalloonClickOutsideHandler'](){const {balloonView:_0x4290f9,buttonView:_0x2ac207,hideMethod:_0x4328cb}=this['_addContextBalloonConfig'];zt({'emitter':_0x4290f9,'contextElements':[_0x4290f9['element'],_0x2ac207['element']],'callback':()=>{_0x4328cb();},'activator':()=>_0x2ac207['isOn']&&!this['_urlBalloonPanelView']['isVisible']&&!this['_resourcesBalloonView']['isAnyResourceBalloonVisible']()});}['_createContextButton'](_0x5203a3,_0x32a35b,_0xad6292=!0x1,_0x9ac50=!0x1){const _0x5ab311='conversation'===_0x32a35b||!0x0===_0x5203a3['isReadOnly'],_0x15722c=new Vn(this['locale'],_0x5203a3,_0x5ab311,_0xad6292,_0x9ac50);return _0x5ab311||_0x15722c['on']('removeContextItemChip',()=>{this['fire']('removeContextItem',_0x15722c['id']);}),_0x15722c;}['_addContextToCollection'](_0x5d8c29,_0x47ad44){_0x47ad44['add'](_0x5d8c29,0x0);}['_removeContextFromCollection'](_0x52792a,_0x1ed9c1){const _0x5efe8b=_0x1ed9c1['find'](_0x6711f0=>_0x6711f0['id']===_0x52792a);_0x5efe8b&&_0x1ed9c1['remove'](_0x5efe8b);}['_handleAddContextButtonClick'](){this['addContextButtonView']['isOn']?this['hideAddContextBalloonPanel']():(this['showAddContextBalloonPanel'](),this['_addContextBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':jr}),this['_hasExactlyOneSource']&&this['_addContextBalloonPanelView']['content']['get'](0x0)?.['fire']('execute'));}['_handleUrlSubmit'](_0x2cb1c4){this['_urlInputView']['clear'](),this['hideUrlBalloonPanel'](),this['fire']('addUrlToContext',_0x2cb1c4);}}class Zr extends Nt{['arrowView'];constructor(_0x4ae1c0){super(_0x4ae1c0),this['set']({'withText':!0x0,'role':'menuitem'}),this['arrowView']=this['_createArrowView'](),this['extendTemplate']({'attributes':{'class':[Yr]}});}['render'](){super['render'](),this['children']['add'](this['arrowView']);}['_createArrowView'](){const _0x5af374=new xt();return _0x5af374['content']=_0xb35716,_0x5af374['extendTemplate']({'attributes':{'class':Yr+'__arrow'}}),_0x5af374;}}class ta extends vt{['_cancelButtonView'];['_loaderView'];constructor(_0x45aded){super(_0x45aded),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 _0x5b7b34=new Nt(this['locale']);return _0x5b7b34['set']({'label':us(this['locale'],'AI_CHAT_STOP_GENERATING'),'withText':!0x0,'class':_s+'\x20ck-ai-button-stop-generating','icon':_0x46eb32}),_0x5b7b34['on']('execute',()=>{this['fire']('abortPromptStream');}),_0x5b7b34;}['_createLoaderView'](){const _0x18daaa=new vt(this['locale']);return _0x18daaa['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':us(this['locale'],'AI_CHAT_IS_WRITING')}]}),_0x18daaa;}}class ea extends vt{['_contextPanelView'];['_promptInputView'];['_promptCapabilitiesView'];['_loaderView'];['_modelUnavailableMessageView'];['_shouldRestorePromptInputFocus'];constructor(_0x5b5046,_0x312d65){super(_0x5b5046),this['_contextPanelView']=this['_createContextPanelView'](_0x5b5046,{'bodyCollection':_0x312d65['bodyCollection'],'searchInputVisibleFrom':_0x312d65['contextResourcesSearchInputVisibleFrom']}),this['_promptInputView']=this['_createPromptInputView'](_0x5b5046),this['_promptCapabilitiesView']=this['_createPromptCapabilitiesView'](_0x5b5046),this['_loaderView']=this['_createLoaderView'](_0x5b5046),this['_modelUnavailableMessageView']=this['_createModelUnavailableMessageView'](_0x5b5046),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'](...Ur)['to'](this),this['set']('isModelAvailable',!0x0),this['set']('isDisabled',!0x1);const _0x44c4b6=this['bindTemplate'];this['setTemplate']({'tag':'form','attributes':{'class':['ck','ck-ai-chat-controls',_0x44c4b6['if']('isDisabled','ck-ai-chat-controls-disabled')]},'children':[{'tag':'div','attributes':{'class':[_0x44c4b6['if']('isLoading','ck-hidden',_0x4fa8df=>_0x4fa8df||!this['isModelAvailable']),_0x44c4b6['if']('isModelAvailable','ck-hidden',_0x74b2c=>!_0x74b2c||this['isLoading'])]},'children':[this['_contextPanelView'],this['_promptInputView'],this['_promptCapabilitiesView']]},{'tag':'div','attributes':{'class':[_0x44c4b6['if']('isLoading','ck-hidden',_0x25a764=>!_0x25a764)]},'children':[this['_loaderView']]},{'tag':'div','attributes':{'class':[_0x44c4b6['if']('isModelAvailable','ck-hidden',_0x334378=>_0x334378)]},'children':[this['_modelUnavailableMessageView']]}]}),zt({'emitter':this['_promptInputView'],'activator':()=>this['isLoading'],'contextElements':()=>[this['element']],'callback':()=>{this['_shouldRestorePromptInputFocus']=!0x1;}}),this['on']('change:isLoading',this['_handlePromptInputFocus'],{'priority':'low'});}['_createContextPanelView'](_0x50ad1b,_0x27e0b8){return new Jr(_0x50ad1b,_0x27e0b8);}['_createPromptInputView'](_0x3adfe6){return new lr(_0x3adfe6,this['_contextPanelView']['addContextButtonView']);}['_createPromptCapabilitiesView'](_0x2c35d6){return new Tr(_0x2c35d6);}['_createLoaderView'](_0xcde0be){return new ta(_0xcde0be);}['_createModelUnavailableMessageView'](_0x4a6ba9){const _0x282710=new ia(_0x4a6ba9);return _0x282710['delegate']('startConversation')['to'](this),_0x282710;}['_handlePromptInputFocus'](_0x347df0,_0x4b754d,_0xce8b81){_0xce8b81?this['_shouldRestorePromptInputFocus']=!0x0:this['_shouldRestorePromptInputFocus']&&this['_promptInputView']['focus']();}['addContextItem'](_0x3755b3,_0x36bc40){this['_contextPanelView']['addContextItem'](_0x3755b3,_0x36bc40);}['removeContextItem'](_0x36ec38){this['_contextPanelView']['removeContextItem'](_0x36ec38);}['setContextItemLoading'](_0x4dec5e,_0x5d1e4b){this['_contextPanelView']['setContextItemLoading'](_0x4dec5e,_0x5d1e4b);}['setIsUploadInProgress'](_0x35d199){this['_promptInputView']['setIsUploadInProgress'](_0x35d199);}['setConversationContext'](_0x41648a){this['_contextPanelView']['setConversationContext'](_0x41648a);}['clearPendingContextUI'](){this['_contextPanelView']['clearCurrentContextItems']();}['clearConversationContextUI'](){this['_contextPanelView']['clearConversationContextItems']();}['updateResourceState'](_0x22b79f,_0x315ac0,_0x7f890e){this['_contextPanelView']['updateResourceState'](_0x22b79f,_0x315ac0,_0x7f890e);}['setWebSearch'](_0x2fcaa1){this['_promptCapabilitiesView']['setWebSearch'](_0x2fcaa1);}['setReasoning'](_0x579985){this['_promptCapabilitiesView']['setReasoning'](_0x579985);}['resetMessageInput'](){this['_promptInputView']['reset']();}['setAddContextOptions'](_0x51371c){this['_contextPanelView']['setAddContextOptions'](_0x51371c);}['setInputPlaceholder'](_0x196ef1){this['_promptInputView']['setPlaceholderText'](_0x196ef1);}['setModelList'](_0x5c0420,_0xf71445){this['_promptCapabilitiesView']['setModelList'](_0x5c0420,_0xf71445);}['setModel'](_0x1edfdf){_0x1edfdf?(this['isModelAvailable']=!0x0,this['_promptCapabilitiesView']['setModel'](_0x1edfdf)):this['isModelAvailable']=!0x1;}['enableModelSelector'](){this['_promptCapabilitiesView']['enableModelSelector']();}['disableModelSelector'](_0x4b8509){this['_promptCapabilitiesView']['disableModelSelector'](_0x4b8509);}['populateSourceResourceBalloon'](_0x2757a3,_0x5651d1,_0x144a51,_0x55ac1e){this['_contextPanelView']['populateSourceResourceBalloon'](_0x2757a3,_0x5651d1,_0x144a51,_0x55ac1e);}['closeSourceResourceBalloon'](_0x14206b){this['_contextPanelView']['closeSourceResourceBalloon'](_0x14206b);}['focusPromptInput'](_0x418d04=!0x1){this['_promptInputView']['focus'](_0x418d04);}['setPromptInputValue'](_0x44289a){this['_promptInputView']['queryView']['fieldView']['reset'](),this['_promptInputView']['queryView']['fieldView']['value']=_0x44289a;}}class ia extends vt{constructor(_0x24cd4b){super(_0x24cd4b);const _0x569e2e=new Nt(_0x24cd4b);_0x569e2e['set']({'label':us(this['locale'],'AI_CHAT_MODEL_UNAVAILABLE_MESSAGE_BUTTON'),'withText':!0x0,'class':['ck-ai-chat-controls__start-new-chat-button'],'tooltip':''}),_0x569e2e['delegate']('execute')['to'](this,'startConversation'),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat-controls-model-unavailable-message']},'children':[{'tag':'p','children':[{'text':us(this['locale'],'AI_CHAT_MODEL_UNAVAILABLE_MESSAGE_TEXT')+'\x20'},_0x569e2e]}]});}}class sa extends _0x1b248d{['conversationStartButton'];['resizeButton'];constructor(_0x1d59f4,_0x7dc624){super(_0x1d59f4,{'label':us(_0x1d59f4,'AI_CHAT_HEADING'),'class':'ck-ai-header\x20ck-ai-header_chat','icon':_0x477fa4}),this['set']('isMaximized',!0x1),this['conversationStartButton']=this['_createStartConversationButton'](_0x1d59f4),this['children']['add'](this['conversationStartButton']),_0x7dc624&&(this['resizeButton']=gs(_0x1d59f4,this),this['children']['add'](this['resizeButton']));}['_createStartConversationButton'](_0x12c193){const _0x920293=new Nt(_0x12c193);return _0x920293['set']({'label':us(this['locale'],'AI_CHAT_LABEL_NEW_CHAT'),'withText':!0x0,'icon':_0x5dc052,'class':'ck-ai-chat__start-conversation\x20'+_s}),_0x920293['on']('execute',()=>{this['fire']('startConversation');}),_0x920293;}}class na extends vt{constructor(_0x2dd329){super(_0x2dd329),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-disclaimer']},'children':[{'tag':'p','attributes':{'class':['ck','ck-ai-disclaimer__content']},'children':[{'text':us(_0x2dd329,'AI_DISCLAIMER_TEXT')}]}]});}}class ra extends vt{['chatHeader'];['chatFeed'];['chatControls'];['chatDisclaimer'];['_bodyCollection'];constructor(_0x285279,_0x21a64a){super(_0x285279),this['_bodyCollection']=new Qt(_0x285279),this['_bodyCollection']['attachToDom'](),this['chatHeader']=new sa(_0x285279,_0x21a64a['showResizeButton']),this['chatHeader']['delegate'](...sn)['to'](this),this['chatFeed']=new or(_0x285279,this['_bodyCollection']),this['chatFeed']['delegate'](...sn)['to'](this),this['chatControls']=new ea(_0x285279,{'bodyCollection':this['_bodyCollection'],'contextResourcesSearchInputVisibleFrom':_0x21a64a['contextResourcesSearchInputVisibleFrom']}),this['chatControls']['delegate'](...sn)['to'](this),this['chatDisclaimer']=new na(_0x285279),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-ai-chat','ck-rounded-corners'],'dir':_0x285279['uiLanguageDirection']},'children':[this['chatHeader'],this['chatFeed'],this['chatControls'],this['chatDisclaimer']]});}['populateSourceResourceBalloon'](_0x56b3bb,_0x59287d,_0x3640f7,_0x15cbc0){this['chatControls']['populateSourceResourceBalloon'](_0x56b3bb,_0x59287d,_0x3640f7,_0x15cbc0);}['closeSourceResourceBalloon'](_0x278162){this['chatControls']['closeSourceResourceBalloon'](_0x278162);}['destroy'](){this['_bodyCollection']['detachFromDom'](),super['destroy']();}}class aa extends _0x12c8be{static get['requires'](){return[cs];}['_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(_0x409fca){super(_0x409fca);const _0x37e5da=this['context']['plugins']['get']('AITabs');this['set']('isBusy',!0x1),this['_promiseQueue']=new mn(),this['_view']=new ra(this['context']['locale'],{'showResizeButton':_0x37e5da['showResizeButton'],'contextResourcesSearchInputVisibleFrom':this['context']['config']['get']('ai.chat.context.searchInputVisibleFrom')}),this['_view']['delegate'](...sn)['to'](this),this['_view']['on']('toggleSuggestionDisplayMode',(_0x1a22ed,{showDiff:_0x4feeea})=>{this['showDiff']=_0x4feeea;}),_0x37e5da['view']['addTab']({'id':'chat','buttonLabel':us(this['context']['locale'],'AI_CHAT_HEADING'),'buttonIcon':_0x477fa4,'order':0x0,'content':this['_view']}),this['_view']['chatControls']['bind']('isLoading')['to'](this,'isBusy',_0x56248d=>_0x56248d),this['_view']['chatFeed']['bind']('isPending')['to'](this,'isBusy',_0x5f5dcd=>_0x5f5dcd),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder']()),this['bind']('isModelAvailable')['to'](this['_view']['chatControls'],'isModelAvailable');}['destroy'](){super['destroy'](),this['_titleAnimationInterval']&&clearInterval(this['_titleAnimationInterval']);}['createConversation'](_0x4caf1b){const _0x54b700=this['context']['config']['get']('ai.chat.welcomeMessage')??us(this['context']['locale'],'AI_CHAT_WELCOME_MESSAGE');this['_view']['chatFeed']['clear'](),this['_view']['chatControls']['enableModelSelector'](),this['_view']['chatControls']['setModelList'](_0x4caf1b['availableModels'],!this['context']['config']['get']('ai.models.showModelSelector')),this['addFeedItemStaticMessage']({'id':'conversation-start','staticMessage':_0x54b700}),this['fire']('conversationCreated');}async['addFeedItemStaticMessage']({id:_0x433dc2,staticMessage:_0x5c1e5a}){return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('ai-reply',{'id':_0x433dc2,'initialContent':'<p>'+_0x5c1e5a+'</p>'});});}async['addFeedItemUserMessage'](_0x3591ac){const _0x126f2b=_0x3591ac['attributes']?.['displayedPrompt']||_0x3591ac['userMessage'];return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('user-message',{'contextItems':Array['from'](_0x3591ac['contextItems']['values']()),'initialContent':'<p>'+_0x126f2b+'</p>','id':_0x3591ac['id']});});}async['addFeedItemError']({errorMessage:_0x395419,id:_0x390b00}){return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('error-message',{'initialContent':'<p>'+_0x395419+'</p>','id':_0x390b00});});}async['addFeedItemAIReply'](_0x11f776){return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('ai-reply',{'id':_0x11f776['interactionId']+':'+_0x11f776['id']}),this['clearLoadingMessage']();});}async['addFeedItemAISuggestion'](_0x8a41f3){const _0x2227e9=Xs(this['context']);let _0xa59aae=_0x2227e9['config']['get']('ai.availableReplyActions')||[...wn];if(_0x2227e9['plugins']['has']('TrackChanges')){if(!this['_isTrackChangesCommandValueBound']){this['_isTrackChangesCommandValueBound']=!0x0;const _0x330e19=_0x2227e9['commands']['get']('trackChanges');this['_view']['chatFeed']['bind']('isTrackChangesOn')['to'](_0x330e19,'value');}}else _0xa59aae=_0xa59aae['filter'](_0x32f4c3=>'insertSuggestion'!=_0x32f4c3);return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('ai-suggestion-reply',{'id':_0x8a41f3['interactionId']+':'+_0x8a41f3['id'],'areActionsDisabled':_0x8a41f3['areActionsDisabled'],'showDiff':this['showDiff'],'availableActions':_0xa59aae}),this['clearLoadingMessage']();});}async['addFeedInteractionHeader'](_0xa39323,_0x7f700b){return this['_promiseQueue']['enqueue'](async()=>{const _0x19ecde=this['_view']['chatFeed']['children']['last'];if(_0x19ecde instanceof Jn)return this['_view']['chatFeed']['children']['remove'](_0x19ecde),void this['_view']['chatFeed']['addItem']('interaction-header',{'id':_0xa39323['id'],'capabilities':{'isWebSearchEnabled':_0x19ecde['capabilities']['isWebSearchEnabled']||_0x7f700b['isWebSearchEnabled'],'isReasoningEnabled':_0x19ecde['capabilities']['isReasoningEnabled']||_0x7f700b['isReasoningEnabled']}});this['_view']['chatFeed']['addItem']('interaction-header',{'id':_0xa39323['id'],'capabilities':_0x7f700b});});}async['addFeedItemCustomElement'](_0x2b7e32,_0x36d12c){let _0xb1d2ab;return await this['_promiseQueue']['enqueue'](async()=>{_0xb1d2ab=this['_view']['chatFeed']['addItem']('custom-element',{'content':_0x2b7e32,'id':_0x36d12c});}),_0xb1d2ab;}['removeFeedItem'](_0x30249c){this['_view']['chatFeed']['removeItem'](_0x30249c);}['hasFeedItem'](_0x4fa98b){return this['_view']['chatFeed']['hasItem'](_0x4fa98b);}['updateFeedInteractionHeader'](_0x3e18b1){const _0x42b80d=this['_view']['chatFeed']['children']['find'](_0x3fbf9e=>_0x3fbf9e['options']['id']==_0x3e18b1['id']&&_0x3fbf9e instanceof Jn);_0x42b80d&&_0x42b80d['set']('isVisible',_0x3e18b1['isVisible']);}async['updateFeedItemAIReplyContent'](_0x77d42f){const _0xa8b71=_0x77d42f['renderingStrategy']||this['feedItemRenderingStrategy'];return this['_promiseQueue']['enqueue'](async _0x195392=>{await this['_view']['chatFeed']['updateReplyItem']({..._0x77d42f,'abortSignal':_0x195392,'renderingStrategy':_0xa8b71}),_0x77d42f['isDone']&&this['markFeedItemAsDone'](_0x77d42f['id']);});}['updateFeedItemAIReplySources'](_0x549cb8,_0xe73b36){this['_view']['chatFeed']['updateWebSources'](_0x549cb8,_0xe73b36);}async['updateFeedItemAIReplySuggestionContent'](_0x4e4051){const _0x1702a3=_0x4e4051['renderingStrategy']||this['feedItemRenderingStrategy'];return this['_promiseQueue']['enqueue'](async _0x3f052f=>{await this['_view']['chatFeed']['updateSuggestionItem']({..._0x4e4051,'abortSignal':_0x3f052f,'renderingStrategy':_0x1702a3}),_0x4e4051['isDone']&&this['markFeedItemAsDone'](_0x4e4051['id']);});}['updateFeedItemAIReplySuggestionPartState'](_0xcb91ac){this['_view']['chatFeed']['updateSuggestionPartState'](_0xcb91ac);}['setFeedItemAIReplySuggestionPartActive'](_0xcf2597){this['_view']['chatFeed']['setSuggestionPartActive'](_0xcf2597);}['markFeedItemAsDone'](_0x2d6392){this['_view']['chatFeed']['markItemAsDone'](_0x2d6392);}['removeFeedInteraction'](_0x1a98ec){this['_view']['chatFeed']['getItemIds']()['filter'](_0x155d24=>_0x155d24['startsWith'](_0x1a98ec))['forEach'](_0x3db455=>this['_view']['chatFeed']['removeItem'](_0x3db455));}['startInteraction'](){const _0x428f8e=this['prepareLoadingMessage']({'isWebSearchEnabled':!0x1,'isReasoningEnabled':!0x1});this['setLoadingMessage'](_0x428f8e),this['_view']['chatControls']['disableModelSelector'](!this['context']['config']['get']('ai.models.showModelSelector')),this['isBusy']=!0x0,this['_view']['chatFeed']['startAutoScroll']();}['stopInteraction'](_0x54611a){this['_promiseQueue']['abort'](),this['_view']['chatFeed']['getItemIds']()['filter'](_0x223c22=>_0x223c22['startsWith'](_0x54611a['id']))['forEach'](_0x6682fe=>this['markFeedItemAsDone'](_0x6682fe)),this['isBusy']=!0x1,this['_view']['chatFeed']['stopAutoScroll']();}async['finishInteraction'](){return this['_promiseQueue']['queueEmptyPromise']['then'](()=>{this['isBusy']=!0x1,this['_view']['chatFeed']['stopAutoScroll']();});}['addContextItem'](_0x12d841,_0x59cb1c){this['_view']['chatControls']['addContextItem'](_0x12d841,_0x59cb1c);}['removeContextItem'](_0x5e8904){this['_view']['chatControls']['removeContextItem'](_0x5e8904);}['setContextItemLoading'](_0x39e839,_0x179edb){this['_view']['chatControls']['setContextItemLoading'](_0x39e839,_0x179edb);}['setIsUploadInProgress'](_0x58251a){this['_view']['chatControls']['setIsUploadInProgress'](_0x58251a);}['setConversationContext'](_0x2ddbb7){this['_view']['chatControls']['setConversationContext'](_0x2ddbb7);}['clearPendingContextUI'](){this['_view']['chatControls']['clearPendingContextUI']();}['clearConversationContextUI'](){this['_view']['chatControls']['clearConversationContextUI']();}['updateResourceState'](_0x10d4ce,_0x13af52,_0x1df4cf){this['_view']['chatControls']['updateResourceState'](_0x10d4ce,_0x13af52,_0x1df4cf);}['resetMessageInput'](){this['_view']['chatControls']['resetMessageInput'](),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder']());}['setAddContextOptions'](_0x1e5be3){this['_view']['chatControls']['setAddContextOptions'](_0x1e5be3);}['updateCapabilities'](_0x3ecfa5){this['_view']['chatControls']['setWebSearch'](_0x3ecfa5['isWebSearchEnabled']),this['_view']['chatControls']['setReasoning'](_0x3ecfa5['isReasoningEnabled']),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder'](_0x3ecfa5));}['setSelectedModel'](_0x350f4e,_0x18a0e8){this['_view']['chatControls']['setModel'](_0x350f4e),_0x18a0e8&&this['_view']['chatControls']['disableModelSelector'](!0x1);}['setFeedItemRenderingStrategy'](_0xb41e4e){this['feedItemRenderingStrategy']=_0xb41e4e;}['toggleLoadingSkeleton'](_0x293b70){this['_view']['chatFeed']['toggleLoadingSkeleton'](_0x293b70);}['resetConversationTitle'](){this['setConversationTitle'](us(this['context']['locale'],'AI_CHAT_HEADING'));}['setConversationTitle'](_0x1e0af6,_0x3edbe8=!0x1){if(_0x3edbe8&&!bt()&&_0x1e0af6['length'])return this['_view']['chatHeader']['label']='',void this['_animateConversationTitle'](_0x1e0af6);this['_view']['chatHeader']['label']=_0x1e0af6;}['setLoadingMessage'](_0x5202f7){this['_view']['chatFeed']['setLoadingMessage'](_0x5202f7);}['clearLoadingMessage'](){this['_view']['chatFeed']['setLoadingMessage']('');}['_animateConversationTitle'](_0x5e4868){let _0x95bdfc=0x0;clearInterval(this['_titleAnimationInterval']),this['_titleAnimationInterval']=setInterval(()=>{this['_view']['chatHeader']['label']=this['_view']['chatHeader']['label']+_0x5e4868[_0x95bdfc],_0x95bdfc++,_0x95bdfc===_0x5e4868['length']&&clearInterval(this['_titleAnimationInterval']);},0x1e);}['setIsMaximized'](_0x183414){this['_view']['chatHeader']['isMaximized']=_0x183414;}['prepareLoadingMessage'](_0x999b2d){return _0x999b2d['isWebSearchEnabled']&&_0x999b2d['isReasoningEnabled']?us(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH_REASONING'):_0x999b2d['isWebSearchEnabled']?us(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH'):_0x999b2d['isReasoningEnabled']?us(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_REASONING'):us(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_REGULAR');}['_getInputPlaceholder'](_0xc74272){return _0xc74272?_0xc74272['isWebSearchEnabled']&&_0xc74272['isReasoningEnabled']?us(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH_REASONING'):_0xc74272['isWebSearchEnabled']?us(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH'):_0xc74272['isReasoningEnabled']?us(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REASONING'):us(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REGULAR'):us(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REGULAR');}['populateSourceResourceBalloon'](_0x355e82,_0x496b03,_0x262376,_0x50ff38){this['_view']['populateSourceResourceBalloon'](_0x355e82,_0x496b03,_0x262376,_0x50ff38);}['closeSourceResourceBalloon'](_0x212c85){this['_view']['closeSourceResourceBalloon'](_0x212c85);}['setPromptInputValue'](_0x187816){this['_view']['chatControls']['setPromptInputValue'](_0x187816);}['focusPromptInput'](_0x147225=!0x1){this['_view']['chatControls']['focusPromptInput'](_0x147225);}['scrollFeedToSuggestion'](_0x179e28,_0x170c2c){this['_view']['chatFeed']['scrollToSuggestion'](_0x179e28,_0x170c2c);}['startAutoScroll'](){this['_view']['chatFeed']['startAutoScroll']();}['disableControls'](){this['_view']['chatControls']['isDisabled']=!0x0;}['enableControls'](){this['_view']['chatControls']['isDisabled']=!0x1;}}class oa extends Dt{['sections'];constructor(_0x40eb2c,_0x47614f){super(_0x40eb2c),this['sections']=_0x47614f,this['items']['addMany'](this['sections']),this['extendTemplate']({'attributes':{'class':['ck-ai-chat-history__sections']}});}['filter'](_0x4903a9){let _0x49cb4c=0x0,_0x23475c=0x0;for(const _0x3bd4b8 of this['sections']){const {resultsCount:_0x249150,totalItemsCount:_0x3e4ec2}=_0x3bd4b8['filter'](_0x4903a9);_0x49cb4c+=_0x249150,_0x23475c+=_0x3e4ec2;}return{'resultsCount':_0x49cb4c,'totalItemsCount':_0x23475c};}}class ha extends Ht{['title'];['itemsViews'];['_itemsListView'];constructor(_0x1aea65,{title:_0x430d3e,items:_0x2c09fb}){super(_0x1aea65);const _0x4dd8f0=this['bindTemplate'];this['set']('isVisible',!0x0),this['title']=_0x430d3e,this['itemsViews']=_0x2c09fb;const _0x50d3b2=new vt(_0x1aea65);_0x50d3b2['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-history__section-title']},'children':[this['title']]}),this['_itemsListView']=new Dt(_0x1aea65),this['_itemsListView']['items']['addMany'](this['itemsViews']),this['setTemplate']({'tag':'li','attributes':{'class':['ck-ai-chat-history__section',_0x4dd8f0['if']('isVisible','ck-hidden',_0x56f681=>!_0x56f681)]},'children':[_0x50d3b2,this['_itemsListView']]});}['filter'](_0x5d1795){const _0x57c6e9=this['itemsViews']['length'];let _0x85efe5=0x0;for(const _0x3d3d98 of this['itemsViews']){if(_0x5d1795){const _0x49a955=_0x3d3d98['isMatching'](_0x5d1795);_0x3d3d98['isVisible']=!!_0x49a955,_0x3d3d98['highlightText'](_0x5d1795);}else _0x3d3d98['isVisible']=!0x0,_0x3d3d98['highlightText'](null);_0x3d3d98['isVisible']&&_0x85efe5++;}return this['isVisible']=_0x85efe5>0x0,{'resultsCount':_0x85efe5,'totalItemsCount':_0x57c6e9};}['getItem'](_0x285b43){return this['itemsViews']['find'](_0x1012ab=>_0x1012ab['id']===_0x285b43);}['removeItem'](_0x269b36){const _0x5bea1a=this['itemsViews']['indexOf'](_0x269b36);-0x1!==_0x5bea1a&&(this['itemsViews']['splice'](_0x5bea1a,0x1),this['_itemsListView']['items']['remove'](_0x269b36));}}class ca extends/* #__PURE__ -- @preserve */
27
- _0x15ff31(Ht){['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(_0x55ef31,_0x3bf529){super(_0x55ef31);const _0x270931=this['bindTemplate'];this['set']('isEdit',!0x1),this['set']('isVisible',!0x0),this['set']('pinned',!!_0x3bf529['pinned']),this['set']('loadingState',null),this['id']=_0x3bf529['id'];const {title:_0x2fd7bf,createdAt:_0x426cba,active:_0x371fb4=!0x1}=_0x3bf529;this['_titleView']=new _0x1b00b1(),this['_titleView']['text']=_0x2fd7bf,this['_titleView']['extendTemplate']({'attributes':{'class':['ck-ai-chat-history__item-title']}});const _0x5ad24f=this['_createCheckView'](),_0x181a9c=this['_createPinButtonView'](_0x55ef31),_0x52554c=this['_createMenuDropdownView'](),_0x219bd9=this['_createEditInputView'](_0x55ef31,_0x2fd7bf),_0x372d02=this['_createAcceptEditButtonView'](_0x55ef31,_0x219bd9),_0x5466db=this['_createCancelEditButtonView'](_0x55ef31,_0x219bd9);this['actions']=this['createCollection'](),this['mainContent']=this['createCollection'](),this['mainContent']['add'](this['_titleView']),this['actions']['add'](_0x181a9c),this['actions']['add'](_0x52554c),this['on']('change:isEdit',(_0x270ce1,_0x2af185,_0x4ee74f)=>{this['actions']['clear'](),this['mainContent']['clear'](),_0x4ee74f?(this['actions']['add'](_0x372d02),this['actions']['add'](_0x5466db),this['mainContent']['add'](_0x219bd9),_0x219bd9['element']['focus']()):(this['actions']['add'](_0x181a9c),this['actions']['add'](_0x52554c),this['mainContent']['add'](this['_titleView']));}),this['setTemplate']({'tag':'li','attributes':{'class':['ck-ai-chat-history__item',_0x371fb4?'ck-ai-chat-history__item--active':'',_0x270931['if']('isVisible','ck-hidden',_0x5896ca=>!_0x5896ca),_0x270931['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',_0x270931['if']('loadingState','ck-hidden',_0x194ad7=>!!_0x194ad7)]},'children':_0x371fb4?[_0x5ad24f]:[]},{'tag':'div','attributes':{'class':['ck-ai-loader',_0x270931['if']('loadingState','ck-hidden',_0x464714=>!_0x464714)]},'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',_0x270931['if']('loadingState','ck-hidden',_0x174473=>!!_0x174473)]},'children':this['mainContent']},{'tag':'div','attributes':{'class':['ck-ai-loader__text',_0x270931['if']('loadingState','ck-hidden',_0x53d557=>!_0x53d557)]},'children':[{'text':_0x270931['to']('loadingState',_0x160695=>_0x160695?us(this['locale'],ca['LOADING_LABELS'][_0x160695]):'')}]}]},{'tag':'span','attributes':{'class':['ck-ai-chat-history__item-date']},'children':[_0x426cba]}]},{'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'](_0x9f2509){this['_titleView']['text']=_0x2d90f2(_0x9f2509);}['updateLoadingState'](_0x5d3fc4,_0x5bb245){this['set']('loadingState',_0x5bb245?_0x5d3fc4:null);}['_createCheckView'](){const _0x877e96=new xt();return _0x877e96['set']({'content':_0xef6224}),_0x877e96;}['_createPinButtonView'](_0x447466){const _0x5cf400=new Nt(_0x447466);return _0x5cf400['set']({'label':us(_0x447466,'AI_CHAT_HISTORY_PIN_BUTTON'),'icon':_0x34f613,'withText':!0x1,'tooltip':!0x0}),_0x5cf400['bind']('isOn')['to'](this,'pinned'),_0x5cf400['on']('execute',()=>{const _0x17ef63=!this['pinned'];this['fire']('setConversationPinned',{'id':this['id'],'pinned':_0x17ef63});}),_0x5cf400;}['_createMenuDropdownView'](){const _0x3eaf45=Gt(this['locale'],_0x56bbba),_0x4ce06c=_0x3eaf45['panelView']['children'];_0x3eaf45['buttonView']['set']({'label':us(this['locale'],'AI_CHAT_HISTORY_SHOW_MORE_ITEMS'),'icon':_0x211a01}),_0x3eaf45['panelPosition']='sw';const _0x1ac623=new Nt(this['locale']);_0x1ac623['label']=us(this['locale'],'AI_CHAT_HISTORY_EDIT_NAME'),_0x1ac623['withText']=!0x0,_0x1ac623['on']('execute',()=>{this['isEdit']=!0x0;});const _0x2c923c=new Nt(this['locale']);_0x2c923c['label']=us(this['locale'],'AI_CHAT_HISTORY_REMOVE'),_0x2c923c['withText']=!0x0,_0x2c923c['on']('execute',()=>{this['showConfirm'](us(this['locale'],'AI_CHAT_HISTORY_REMOVE_CONFIRM'),this['element'])['then'](()=>{this['fire']('removeConversation',{'id':this['id']});});});const _0x254e1e=new Dt(this['locale']),_0x5ad9c4=new Ht(this['locale']);_0x5ad9c4['children']['add'](_0x1ac623);const _0x3a043b=new Ht(this['locale']);return _0x3a043b['children']['add'](_0x2c923c),_0x254e1e['items']['addMany']([_0x5ad9c4,_0x3a043b]),_0x4ce06c['add'](_0x254e1e),_0x3eaf45;}['_createEditInputView'](_0x478651,_0x5af6b7){const _0x1e8628=new _0x5f42e2(_0x478651),_0x3b525b=_0x1e8628['bindTemplate'];return _0x1e8628['value']=_0x5af6b7,_0x1e8628['extendTemplate']({'on':{'keydown':_0x3b525b['to'](_0x35f6da=>{'Enter'==_0x35f6da['key']&&this['_commitEditInputValue'](_0x1e8628);})}}),_0x1e8628;}['_createAcceptEditButtonView'](_0x4ad2e4,_0x57aee6){const _0x16b245=new Nt(_0x4ad2e4);return _0x16b245['set']({'icon':_0xef6224,'withText':!0x1,'tooltip':us(_0x4ad2e4,'AI_CHAT_HISTORY_ACCEPT')}),_0x16b245['extendTemplate']({'attributes':{'class':['ck-confirm-view-submit']}}),_0x16b245['on']('execute',()=>{this['_commitEditInputValue'](_0x57aee6);}),_0x16b245;}['_commitEditInputValue'](_0xa5e503){const _0xf7ad47=_0xa5e503['element']['value']||'';this['_titleView']['text']=_0xf7ad47,this['isEdit']=!0x1,this['fire']('editConversationTitle',{'id':this['id'],'title':_0xf7ad47});}['_createCancelEditButtonView'](_0x5e305d,_0x3bccf0){const _0x3f910d=new Nt(_0x5e305d);return _0x3f910d['set']({'icon':_0x2e72cd,'withText':!0x1,'tooltip':us(_0x5e305d,'AI_CHAT_HISTORY_CANCEL')}),_0x3f910d['extendTemplate']({'attributes':{'class':['ck-confirm-view-cancel']}}),_0x3f910d['on']('execute',()=>{this['isEdit']=!0x1,_0x3bccf0['value']=this['_titleView']['text']||'',this['fire']('edit:cancel');}),_0x3f910d;}['_createSpinnerView'](){const _0x5182f5=new vn('tiny');return _0x5182f5['isVisible']=!0x0,_0x5182f5;}['isMatching'](_0x1845fb){return this['_titleView']&&'string'==typeof this['_titleView']['text']&&this['_titleView']['text']['match'](_0x1845fb)?{'title':!0x0}:null;}['highlightText'](_0x4f0d16){this['_titleView']['highlightText'](_0x4f0d16);}}class la extends vt{['searchView'];['mainErrorView'];['skeletonView'];['emptyView'];['sectionsView'];['resizeButton'];constructor(_0x31a190,_0x3dfc4b){super(_0x31a190),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 _0x13141e=new _0x1b248d(_0x31a190,{'label':us(_0x31a190,'AI_CHAT_HISTORY_HEADING'),'icon':_0x390cb7,'class':'ck-ai-header\x20ck-ai-header_history'});_0x3dfc4b&&(this['resizeButton']=gs(_0x31a190,this),_0x13141e['children']['add'](this['resizeButton'])),this['sectionsView']=new oa(_0x31a190,[]),this['sectionsView']['delegate'](...ua)['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',_0x181d55=>!_0x181d55)]}}),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':[_0x13141e,{'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 _0x58113e=new _0x5b72a7(this['locale'],{'filteredView':this['sectionsView'],'queryView':{'label':us(this['locale'],'AI_CHAT_HISTORY_SEARCH_LABEL')},'infoView':{'text':{'notFound':{'primary':_0x202a4f=>us(this['locale'],'AI_CHAT_HISTORY_SEARCH_NOT_FOUND_PRIMARY',_0x202a4f),'secondary':us(this['locale'],'AI_CHAT_HISTORY_SEARCH_NOT_FOUND_SECONDARY')}}}}),_0x15aebb=this['_createErrorView']();return _0x15aebb['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('errorMessage','ck-hidden',_0x77a89=>!_0x77a89)]}}),_0x58113e['on']('render',()=>{_0x58113e['children']['add'](_0x15aebb,0x1);}),_0x58113e['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isSearchViewVisible','ck-hidden',_0xf2adf0=>!_0xf2adf0)]}}),_0x58113e;}['_createSkeletonView'](){const _0x1ae8f4=new sr(this['locale'],nr['aiHistory']);return _0x1ae8f4['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isLoading','ck-hidden',_0x3099d3=>!_0x3099d3)]}}),_0x1ae8f4;}['_createErrorView'](){const _0x3909ee=new vt(this['locale']),_0x832de1=new Nt(this['locale']);_0x832de1['set']({'withText':!0x1,'icon':_0x2e72cd,'class':'ck-ai-notification_error__dismiss-button'}),_0x832de1['bind']('isVisible')['to'](this,'hasItems',_0x125b10=>!!_0x125b10),_0x832de1['on']('execute',()=>{this['errorMessage']='';});const _0x1831b0=this['bindTemplate'];return _0x3909ee['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-notification','ck-ai-notification_error']},'children':[{'tag':'p','children':[{'text':_0x1831b0['to']('errorMessage')}]},_0x832de1]}),_0x3909ee;}['_createEmptyStateView'](){const _0x4da70b=new Nt(this['locale']);_0x4da70b['set']({'label':us(this['locale'],'AI_CHAT_LABEL_NEW_CHAT'),'withText':!0x0,'icon':_0x5dc052,'class':'ck-ai-chat__start-conversation\x20'+_s}),_0x4da70b['on']('execute',()=>{this['fire']('openChat');});const _0x2d5356=new vt(this['locale']);return _0x2d5356['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-history__empty',this['bindTemplate']['if']('isEmptyViewVisible','ck-hidden',_0x442368=>!_0x442368)]},'children':[{'tag':'p','attributes':{'class':['ck-ai-chat-history__empty-message']},'children':[us(this['locale'],'AI_CHAT_HISTORY_EMPTY_MESSAGE')]},_0x4da70b]}),_0x2d5356;}['_createListItemViews'](_0x12c322,_0xbf5e99){const _0x757d65=[];for(const _0x1e235f of _0x12c322){const _0x9b14a2=new ca(_0xbf5e99,_0x1e235f);_0x9b14a2['delegate'](...ua)['to'](this),_0x757d65['push'](_0x9b14a2);}return _0x757d65;}['updateHistoryItemsWithCategories'](_0x3cae5b){const _0x3a7d9d=this['locale']||'en',_0x740075=[];for(const _0x3e3049 of _0x3cae5b){const _0x118335=this['_createListItemViews'](_0x3e3049['items'],_0x3a7d9d);_0x740075['push'](new ha(_0x3a7d9d,{'title':_0x3e3049['title'],'items':_0x118335}));}this['sectionsView']['sections']=_0x740075,this['sectionsView']['items']['clear'](),this['sectionsView']['items']['addMany'](_0x740075),this['hasItems']=_0x3cae5b['some'](_0x38056f=>_0x38056f['items']['length']>0x0),this['_refreshSearch']();}['removeHistoryItem'](_0x186731){for(const _0x1b1be8 of this['sectionsView']['sections']){const _0x592225=_0x1b1be8['getItem'](_0x186731);if(_0x592225){if(_0x1b1be8['removeItem'](_0x592225),0x0===_0x1b1be8['itemsViews']['length']){const _0xab2e3d=this['sectionsView']['sections']['indexOf'](_0x1b1be8);-0x1!==_0xab2e3d&&(this['sectionsView']['sections']['splice'](_0xab2e3d,0x1),this['sectionsView']['items']['remove'](_0x1b1be8));}this['hasItems']=this['sectionsView']['sections']['length']>0x0,this['_refreshSearch']();break;}}}['updateItemTitle'](_0x306609,_0x436f41){for(const _0x28fbbe of this['sectionsView']['sections']){const _0x47ca82=_0x28fbbe['getItem'](_0x306609);if(_0x47ca82){_0x47ca82['updateTitle'](_0x436f41);break;}}}['updateItemLoadingState'](_0x4045ce,_0xf95a69,_0x1d4f6d){for(const _0x31bfa6 of this['sectionsView']['sections']){const _0x319183=_0x31bfa6['getItem'](_0x4045ce);if(_0x319183){_0x319183['updateLoadingState'](_0xf95a69,_0x1d4f6d);break;}}}['_refreshSearch'](){if(this['hasItems']){const _0x28cb56=this['searchView']['queryView']['fieldView']?.['element']?.['value']||'';this['searchView']['search'](_0x28cb56);}}}const ua=['showConversationHistory','removeConversation','editConversationTitle','setConversationPinned','selectConversation','openChat','resizeTabs'];class da extends _0x12c8be{static get['requires'](){return[cs];}['_historyView'];static get['pluginName'](){return'AIChatHistoryUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x11be47){super(_0x11be47);const _0x4e4c5f=this['context']['plugins']['get']('AITabs');this['_historyView']=new la(this['context']['locale'],_0x4e4c5f['showResizeButton']),this['_historyView']['delegate'](...ua)['to'](this),_0x4e4c5f['view']['addTab']({'id':'history','buttonLabel':us(this['context']['locale'],'AI_CHAT_HISTORY_HEADING'),'buttonIcon':_0x390cb7,'order':0x0,'content':this['_historyView']});}['removeHistoryItem'](_0x5173a9){this['_historyView']['removeHistoryItem'](_0x5173a9);}['updateItems'](_0x456678){this['_historyView']['updateHistoryItemsWithCategories'](_0x456678);}['updateItemTitle'](_0x9b4ebc,_0x23dfe4){this['_historyView']['updateItemTitle'](_0x9b4ebc,_0x23dfe4);}['updateItemLoadingState'](_0x50036b,_0x1eaed2,_0x308636){this['_historyView']['updateItemLoadingState'](_0x50036b,_0x1eaed2,_0x308636);}['setLoadingSkeleton'](_0x5bf38a){this['_historyView']['isLoading']=_0x5bf38a;}['showError'](_0x30ddf7){this['_historyView']['errorMessage']=_0x30ddf7;}['hideError'](){this['_historyView']['errorMessage']='';}['setIsMaximized'](_0x4d7dca){this['_historyView']['isMaximized']=_0x4d7dca;}}class _a extends ct(){['id'];['createdAt'];constructor({id:_0xd46a13,title:_0x54db19,createdAt:_0x4b2c45,updatedAt:_0x1e5375,pinned:_0x1e8a31}){super(),this['id']=_0xd46a13,this['createdAt']=new Date(_0x4b2c45),this['set']('title',_0x54db19),this['set']('updatedAt',_0x1e5375?new Date(_0x1e5375):null),this['set']('pinned',_0x1e8a31||!0x1);}['updateTitle'](_0x450add){this['set']('title',_0x2d90f2(_0x450add)),this['updatedAt']=new Date();}['updatePinned'](_0x1bbdbc){this['set']('pinned',_0x1bbdbc),this['updatedAt']=new Date();}}class Aa extends pt(){['items']=[];['connector'];['group'];constructor({connector:_0x416523,group:_0x506607}){super(),this['connector']=_0x416523,this['group']=_0x506607;}async['init'](){try{const _0x579ad5=this['connector']['fetchConversations'](this['group']),_0x40b0ae=await _0x579ad5['getConversations']();this['loadItems'](_0x40b0ae);}catch(_0x135211){this['fire']('error',{'error':_0x135211,'operation':'init'});}}['addItem'](_0x12da90){this['items']['push'](_0x12da90);}async['removeItem'](_0x536e96){const _0x31a14c=this['items']['findIndex'](_0x524cc5=>_0x524cc5['id']===_0x536e96);if(-0x1===_0x31a14c)return!0x1;try{return await this['connector']['deleteConversation'](_0x536e96)['execute'](),this['items']['splice'](_0x31a14c,0x1),this['fire']('itemRemoved',{'itemId':_0x536e96}),!0x0;}catch(_0x35c866){return this['fire']('error',{'error':_0x35c866,'operation':'removeItem','itemId':_0x536e96}),!0x1;}}['getItem'](_0x41caac){return this['items']['find'](_0x33c370=>_0x33c370['id']===_0x41caac);}async['updateItemTitle'](_0x414f01,_0x2bf98c){const _0x1c89c9=this['getItem'](_0x414f01);if(!_0x1c89c9)return!0x1;try{return await this['connector']['updateConversation'](_0x414f01,{'title':_0x2bf98c})['getResult'](),_0x1c89c9['updateTitle'](_0x2bf98c),this['fire']('itemUpdated',{'itemId':_0x414f01,'updates':{'title':_0x2bf98c}}),!0x0;}catch(_0x5f57e4){return this['fire']('error',{'error':_0x5f57e4,'operation':'updateItemTitle','itemId':_0x414f01}),!0x1;}}async['updateItemPinned'](_0xbc411,_0xe6436){const _0x26774d=this['getItem'](_0xbc411);if(!_0x26774d)return!0x1;try{return await this['connector']['updateConversation'](_0xbc411,{'pinned':_0xe6436})['getResult'](),_0x26774d['updatePinned'](_0xe6436),this['fire']('itemUpdated',{'itemId':_0xbc411,'updates':{'pinned':_0xe6436}}),!0x0;}catch(_0x39c6dc){return this['fire']('error',{'error':_0x39c6dc,'operation':'updateItemPinned','itemId':_0xbc411}),!0x1;}}['loadItems'](_0xf10ae){try{this['items']=[],_0xf10ae['map'](_0x4bc3f1=>{this['addItem'](new _a(_0x4bc3f1));}),this['fire']('itemsLoaded',{'items':[...this['items']]});}catch(_0x4df7c7){this['fire']('error',{'error':_0x4df7c7,'operation':'loadItems'});}}['getItems'](_0x9b86d7={}){const _0x1b2e03=void 0x0!==_0x9b86d7['pinned']&&_0x9b86d7['pinned'],_0x17feb7=_0x9b86d7['from']?new Date(_0x9b86d7['from']['getFullYear'](),_0x9b86d7['from']['getMonth'](),_0x9b86d7['from']['getDate']()):null,_0x30fd12=_0x9b86d7['to']?new Date(_0x9b86d7['to']['getFullYear'](),_0x9b86d7['to']['getMonth'](),_0x9b86d7['to']['getDate']()):null;return this['items']['filter'](_0x5a4a1d=>{if(_0x5a4a1d['pinned']!==_0x1b2e03)return!0x1;if(_0x30fd12){const _0x355ebd=new Date(_0x5a4a1d['createdAt']['getFullYear'](),_0x5a4a1d['createdAt']['getMonth'](),_0x5a4a1d['createdAt']['getDate']());return _0x17feb7?_0x17feb7['getTime']()===_0x30fd12['getTime']()?_0x355ebd['getTime']()===_0x17feb7['getTime']():_0x355ebd<_0x30fd12&&_0x355ebd>=_0x17feb7:_0x355ebd<_0x30fd12;}return!0x0;});}}class ga extends _0x12c8be{['_aiConnector'];['_aiChatHistoryUi'];['_aiChatController'];static get['requires'](){return[ls,Js,da,cs];}static get['pluginName'](){return'AIChatHistoryController';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){this['_aiConnector']=this['context']['plugins']['get'](ls),this['_aiChatHistoryUi']=this['context']['plugins']['get'](da),this['_aiChatController']=this['context']['plugins']['get'](Js);const _0x2b2ff8=this['context']['plugins']['get'](cs);try{const _0x44f6d2=this['_aiChatController']['getGroupId']();this['history']=new Aa({'connector':this['_aiConnector'],'group':_0x44f6d2}),this['listenTo'](this['_aiChatHistoryUi'],'removeConversation',(_0x1a10e4,_0x392194)=>{this['_setItemLoading'](_0x392194['id'],'remove'),this['_handleRemove'](_0x392194['id']);}),this['listenTo'](this['_aiChatHistoryUi'],'editConversationTitle',(_0x276c4f,_0x2d2983)=>{this['_setItemLoading'](_0x2d2983['id'],'rename'),this['_handleEditTitle'](_0x2d2983['id'],_0x2d2983['title']);}),this['listenTo'](this['history'],'itemUpdated',(_0x1f59ba,_0x3abd09)=>{void 0x0!==_0x3abd09['updates']['title']&&this['_aiChatHistoryUi']['updateItemTitle'](_0x3abd09['itemId'],_0x3abd09['updates']['title']),void 0x0!==_0x3abd09['updates']['pinned']&&this['_updateHistoryItemsUI'](),this['_clearItemLoading'](_0x3abd09['itemId']);}),this['listenTo'](this['history'],'itemRemoved',(_0x2fbcbd,_0x1b1957)=>{this['_aiChatController']['_handleRemovedConversation'](_0x1b1957['itemId']),this['_aiChatHistoryUi']['removeHistoryItem'](_0x1b1957['itemId']),this['_clearItemLoading'](_0x1b1957['itemId']);}),this['listenTo'](this['history'],'itemsLoaded',()=>{this['_updateHistoryItemsUI']();}),this['listenTo'](this['history'],'error',(_0x28ad10,_0x47dc38)=>{this['_handleHistoryErrorUI'](_0x47dc38['error'],_0x47dc38['operation'],_0x47dc38['itemId']);}),this['listenTo'](this['_aiChatHistoryUi'],'selectConversation',(_0xbfcb8c,_0x2a4d0e)=>{this['_handleSelectConversation'](_0x2a4d0e['id']);}),this['listenTo'](this['_aiChatHistoryUi'],'setConversationPinned',(_0x4449fe,_0x4fd255)=>{const _0x2e3c45=_0x4fd255['pinned']?'pin':'unpin';this['_setItemLoading'](_0x4fd255['id'],_0x2e3c45),this['_handleTogglePin'](_0x4fd255['id'],_0x4fd255['pinned']);}),this['listenTo'](this['_aiChatHistoryUi'],'openChat',()=>{_0x2b2ff8['view']['activateTab']('chat');}),this['listenTo'](this['_aiChatController'],'change:activeConversation',()=>{this['_updateHistoryItemsUI']();}),_0x2b2ff8['view']['on']('activateTab:history',()=>{this['_showConversationHistory']();}),this['listenTo'](_0x2b2ff8,'resizedTabs',(_0xfa55b1,_0x20ffb9)=>{this['_setIsMaximized'](_0x20ffb9);}),this['listenTo'](this['_aiChatHistoryUi'],'resizeTabs',()=>{_0x2b2ff8['resize']();});}catch(_0x4337ae){this['_handleHistoryErrorUI'](_0x4337ae,'init');}}async['_handleEditTitle'](_0x2eb2fa,_0x5015ef){await this['history']['updateItemTitle'](_0x2eb2fa,_0x5015ef);}async['_handleTogglePin'](_0x195eb4,_0x3a74ba){await this['history']['updateItemPinned'](_0x195eb4,_0x3a74ba);}async['_handleRemove'](_0x430355){await this['history']['removeItem'](_0x430355);}async['_handleSelectConversation'](_0x118a9c){await this['_aiChatController']['loadConversation'](_0x118a9c);}async['_showConversationHistory'](){this['_aiChatHistoryUi']['showError'](''),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x0),await this['history']['init'](),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x1);}['_updateHistoryItemsUI'](){const _0x496c81=this['_aiChatController']['activeConversation']?.['id'],_0x53ceb8=this['_getCategorizedItems']()['map'](_0x4be013=>({'title':_0x4be013['title'],'items':_0x4be013['items']['map'](_0x17f249=>({'id':_0x17f249['id'],'title':_0x17f249['title']||us(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION'),'createdAt':new Date(_0x17f249['createdAt'])['toLocaleDateString'](),'active':_0x17f249['id']===_0x496c81,'pinned':_0x17f249['pinned']}))}));this['_aiChatHistoryUi']['updateItems'](_0x53ceb8);}['_setItemLoading'](_0x7c698a,_0x4357c4){this['_aiChatHistoryUi']['updateItemLoadingState'](_0x7c698a,_0x4357c4,!0x0);}['_clearItemLoading'](_0x2daff5){this['_aiChatHistoryUi']['updateItemLoadingState'](_0x2daff5,null,!0x1);}['_handleHistoryErrorUI'](_0x3958b7,_0x1ec174,_0x548fef){const _0x423d4b=this['_generateErrorMessage'](_0x1ec174,_0x548fef);this['_aiChatHistoryUi']['showError'](_0x423d4b),_0x548fef&&this['_clearItemLoading'](_0x548fef),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x1);}['_generateErrorMessage'](_0x49acf2,_0x3256ec){const _0x5dd962=_0x3256ec?this['history']['getItem'](_0x3256ec):null,_0x49f5e7=_0x5dd962?.['title']||us(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION');switch(_0x49acf2){case'updateItemTitle':return us(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_UPDATE_TITLE',_0x49f5e7);case'updateItemPinned':{const _0x21dae4=us(this['context']['locale'],_0x5dd962?.['pinned']?'AI_CHAT_HISTORY_UNPIN_ACTION':'AI_CHAT_HISTORY_PIN_ACTION');return us(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_UPDATE_PINNED',[_0x21dae4,_0x49f5e7]);}case'removeItem':return us(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_REMOVE_ITEM',_0x49f5e7);case'init':case'loadItems':return us(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_LOAD_ITEMS');default:return us(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_GENERIC');}}['_getCategorizedItems'](){const _0x43cf50=new Date(),_0x320b0d=new Date(_0x43cf50['getFullYear'](),_0x43cf50['getMonth'](),_0x43cf50['getDate']()),_0xecb7e=new Date(_0x320b0d);_0xecb7e['setDate'](_0xecb7e['getDate']()-0x1);const _0x234ffc=new Date(_0x320b0d);_0x234ffc['setDate'](_0x234ffc['getDate']()-0xe);const _0x335699=this['history']['getItems']({'pinned':!0x0}),_0x42b935=this['history']['getItems']({'from':_0x320b0d,'to':_0x320b0d}),_0x8c0daa=this['history']['getItems']({'from':_0xecb7e,'to':_0xecb7e}),_0x15ee3c=this['history']['getItems']({'from':_0x234ffc,'to':_0xecb7e}),_0x2967ad=this['history']['getItems']({'to':_0x234ffc}),_0xa80756=[];return _0x335699['length']>0x0&&_0xa80756['push']({'title':us(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_PINNED'),'items':_0x335699}),_0x42b935['length']>0x0&&_0xa80756['push']({'title':us(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_TODAY'),'items':_0x42b935}),_0x8c0daa['length']>0x0&&_0xa80756['push']({'title':us(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_YESTERDAY'),'items':_0x8c0daa}),_0x15ee3c['length']>0x0&&_0xa80756['push']({'title':us(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_LAST_14_DAYS'),'items':_0x15ee3c}),_0x2967ad['length']>0x0&&_0xa80756['push']({'title':us(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_LATER'),'items':_0x2967ad}),_0xa80756;}['_setIsMaximized'](_0x3cb4e0){this['_aiChatHistoryUi']['setIsMaximized'](_0x3cb4e0);}}class Ia extends _0x12c8be{static get['requires'](){return[ga,da];}static get['pluginName'](){return'AIChatHistory';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class Ea extends _0x12c8be{static get['requires'](){return[Js,tn,aa,Ia];}static get['pluginName'](){return'AIChat';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x5891b4){super(_0x5891b4),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 pa extends Nt{['id'];constructor(_0x18b223,_0x210c89){super(_0x18b223);const {id:_0x147313,type:_0x2efa04,icon:_0x521791}=_0x210c89;this['id']=_0x147313,this['set']({'label':_0x210c89['label'],'withText':!0x0,'class':'ck-ai-chat-shortcut'}),this['extendTemplate']({'attributes':{'data-cke-ai-shortcut-id':_0x210c89['id']}}),_0x521791?this['icon']=_0x521791:'chat'===_0x2efa04?this['icon']=_0x477fa4:'review'===_0x2efa04?this['icon']=_0x4f1906:'translate'===_0x2efa04&&(this['icon']=_0x275309);}}class Ta extends vt{['listView'];constructor(_0x2e8a16,_0x10e8f9){super(_0x2e8a16);const _0x3701bc=_0x10e8f9['map'](_0x37006d=>{const _0x4bef0d=new Ht(this['locale']),_0x1cd0c3=new pa(this['locale'],_0x37006d);return _0x4bef0d['children']['add'](_0x1cd0c3),_0x1cd0c3['delegate']('execute')['to'](this),_0x4bef0d;});this['listView']=new Dt(this['locale']),this['listView']['items']['addMany'](_0x3701bc),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat-shortcuts']},'children':[this['listView']]});}}const ma='chat-shortcuts';var Ca=function(_0x383be1){return _0x383be1['CHAT']='chat',_0x383be1['REVIEW']='review',_0x383be1['TRANSLATE']='translate',_0x383be1;}({});class wa extends _0x12c8be{['_shortcuts'];['_shortcutsView'];['_aiChatUI'];static get['requires'](){return[aa];}static get['pluginName'](){return'AIChatShortcuts';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){this['_aiChatUI']=this['context']['plugins']['get'](aa),this['_shortcuts']=this['context']['config']['get']('ai.chat.shortcuts')??[];const _0x1349b7=this['context']['plugins']['get']('AIChatController');this['_shortcuts']['length']&&(this['_validateShortcuts'](),this['_aiChatUI']['on']('conversationCreated',()=>{_0x1349b7['activeConversation']['isFromHistory']||this['_injectShortcuts']();}),this['listenTo'](_0x1349b7,'interactionStarted',()=>{this['_removeShortcuts']();}));}['_validateShortcuts'](){const _0xedc611=Object['values'](Ca);this['_shortcuts']['forEach'](_0x56c997=>{let _0x4edf9c=!0x0;if(_0x56c997['id']&&_0x56c997['label']&&_0xedc611['includes'](_0x56c997['type'])?'chat'===_0x56c997['type']&&(_0x4edf9c='string'==typeof _0x56c997['prompt']):_0x4edf9c=!0x1,!_0x4edf9c)throw new ht('ai-chat-shortcuts-invalid-config',this['context'],{'shortcut':_0x56c997});});}['_injectShortcuts'](){const _0x400b83=this['context']['plugins']['get'](aa);this['_shortcutsView']=new Ta(this['context']['locale'],this['_shortcuts']),this['_shortcutsView']['render'](),_0x400b83['addFeedItemCustomElement'](this['_shortcutsView']['element'],ma),this['_shortcutsView']['on']('execute',_0xf16874=>{const _0x3dae30=_0xf16874['source']['id'];this['_executeShortcut'](_0x3dae30);});}['_removeShortcuts'](){const _0x3a732c=this['context']['plugins']['get'](aa);_0x3a732c['hasFeedItem'](ma)&&_0x3a732c['removeFeedItem'](ma),this['_shortcutsView']?.['destroy']();}['_executeShortcut'](_0x3a80d2){const _0x411421=this['_shortcuts']['find'](_0x34ea11=>_0x34ea11['id']===_0x3a80d2),_0x2d371c=_0x411421['type'];'chat'===_0x2d371c?this['_runChatShortcut'](_0x411421):'review'===_0x2d371c?_0x411421['commandId']?this['_runReviewShortcut'](_0x411421):this['_switchTab']('reviewMode'):'translate'===_0x2d371c&&(_0x411421['language']?this['_runTranslateShortcut'](_0x411421):this['_switchTab']('translate'));}['_switchTab'](_0x502811){if(!this['context']['plugins']['has']('AITabs'))throw new ht('ai-chat-shortcuts-ai-tabs-not-found',this['context'],{'tabName':_0x502811});this['context']['plugins']['get']('AITabs')['view']['activateTab'](_0x502811);}async['_runChatShortcut']({prompt:_0x14fcbc,draftMode:_0x4e14ec,useWebSearch:_0x10973c=!0x1,useReasoning:_0x31995c=!0x1,model:_0x28c862}){const _0x12a340=this['context']['plugins']['get']('AIChatController'),_0x5312f7=_0x12a340['activeConversation'];let _0x3320ea;_0x3320ea=_0x28c862?await _0x5312f7['chatModels']['getModel'](_0x28c862):await _0x5312f7['chatModels']['getDefault'](),_0x3320ea&&await _0x5312f7['setModel'](_0x3320ea),_0x5312f7['setWebSearch'](_0x10973c),_0x5312f7['setReasoning'](_0x31995c),_0x12a340['addCurrentDocumentToChatContext'](),_0x4e14ec?(this['_aiChatUI']['setPromptInputValue'](_0x14fcbc),this['_aiChatUI']['focusPromptInput'](!0x0)):_0x12a340['sendMessage']({'message':_0x14fcbc});}['_runReviewShortcut']({commandId:_0x3c4061,model:_0x370008,prompt:_0xd46891,params:_0x4bab49}){if(!this['context']['plugins']['has']('AIReviewModeUI'))throw new ht('ai-chat-shortcuts-review-mode-not-found',this['context']);this['_switchTab']('reviewMode');const _0x4898fc={'id':_0x3c4061,'isCustom':'custom'===_0x3c4061};_0x370008&&_0xd46891&&(_0x4898fc['args']={'model':_0x370008,'prompt':_0xd46891}),_0x4bab49&&(_0x4898fc['params']=_0x4bab49),this['context']['plugins']['get']('AIReviewModeUI')['fire']('runReviewCheck',_0x4898fc);}['_runTranslateShortcut']({language:_0x480942}){if(!this['context']['plugins']['has']('AITranslateUI'))throw new ht('ai-chat-shortcuts-translate-not-found',this['context']);this['_switchTab']('translate'),this['context']['plugins']['get']('AITranslateUI')['fire']('runReviewCheck',{'id':_0x480942,'args':{'language':_0x480942}});}}class fa extends _0x521df8{constructor(_0x590b3a){super(_0x590b3a);const _0x4a0926=_0x590b3a['plugins']['get']('AITabs')['view'];this['bind']('value')['to'](_0x4a0926,'isVisible'),this['isEnabled']=!0x0;}['execute'](){const _0x342f00=this['editor']['plugins']['get']('AITabs')['view'];_0x342f00['isVisible']=!_0x342f00['isVisible'];}}class Sa extends _0x12af0a{static get['requires'](){return[cs];}static get['pluginName'](){return'AIToggleButtonUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x2d350d=this['editor'];_0x2d350d['commands']['add']('toggleAi',new fa(_0x2d350d)),_0x2d350d['ui']['componentFactory']['add']('toggleAi',()=>{const _0x4315e5=this['_createAIUIButton'](Nt);return _0x4315e5['set']({'tooltip':!0x0,'class':'ck-ai-toggle-button'}),_0x4315e5;}),_0x2d350d['ui']['componentFactory']['add']('menuBar:toggleAi',()=>{const _0x12ea91=this['_createAIUIButton'](Wt);return _0x12ea91['set']({'role':'menuitemcheckbox'}),_0x12ea91;});}['_createAIUIButton'](_0x59b22b){const _0x2d0760=this['editor'],_0x2c6337=_0x2d0760['commands']['get']('toggleAi'),_0x2193f2=new _0x59b22b(_0x2d0760['locale']);return _0x2193f2['set']({'label':us(_0x2d0760['locale'],'AI_TOGGLE_BUTTON_LABEL'),'icon':_0x3d4af9,'isToggleable':!0x0}),_0x2193f2['bind']('isEnabled')['to'](_0x2c6337),_0x2193f2['bind']('isOn')['to'](_0x2c6337,'value',_0xb76514=>!!_0xb76514),this['listenTo'](_0x2193f2,'execute',()=>{_0x2c6337['execute']();}),_0x2193f2;}}const ba=['applySuggestion','insertSuggestion','showNext','showPrevious'];class Ra extends vt{['_errorView'];constructor(_0x566523){super(_0x566523),this['set']('_errorMessage',''),this['set']('_isErrorVisible',!0x1);}['showBlockingError'](_0x520352){this['showError'](_0x520352);}['showError'](_0x29d857){this['_errorView']||(this['_errorView']=this['_createErrorView']()),this['_errorMessage']=_0x29d857,this['_isErrorVisible']=!0x0;}['hideError'](){this['_isErrorVisible']=!0x1;}['_createErrorView'](){const _0x3b88b2=new vt(this['locale']),_0x4c3557=new vt(this['locale']);return _0x4c3557['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-suggestion__error-text']},'children':[{'text':this['bindTemplate']['to']('_errorMessage')}]}),_0x3b88b2['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__error','ck-ai-balloon-error',this['bindTemplate']['if']('_isErrorVisible','ck-hidden',_0x197647=>!_0x197647)]},'children':[_0x4c3557]}),_0x3b88b2;}}const Oa=0xa;class ka extends _0x12c8be{static get['requires'](){return[tn];}static get['pluginName'](){return'AIBalloon';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['isOpen']=!0x1;['_currentConfig'];['_isUpdatingMarkers']=!0x1;['open'](_0x9a8ab7){const {id:_0x1e62f9}=this['_currentConfig']??{};this['_currentConfig']=_0x9a8ab7;const {id:_0x2412ad}=this['_currentConfig'];this['isOpen']&&_0x1e62f9===_0x2412ad?this['_updateDialog']():this['_showDialog']();}['close'](){const _0x1a706e=Xs(this['context'])['plugins']['get']('Dialog');_0x1a706e['isOpen']&&this['_currentConfig']&&_0x1a706e['id']===this['_currentConfig']['id']&&_0x1a706e['hide']();}['_updateDialog'](){const _0x54bfc1=Xs(this['context'])['plugins']['get']('Dialog'),{icon:_0x46349f,title:_0x2d9421}=this['_currentConfig'];_0x54bfc1['view']?.['headerView']&&(_0x54bfc1['view']['headerView']['label']=_0x2d9421,_0x54bfc1['view']['headerView']['iconView']&&_0x46349f&&(_0x54bfc1['view']['headerView']['iconView']['content']=_0x46349f)),this['_isUpdatingMarkers']=!0x0,this['_showFakeVisualSelection'](),this['_isUpdatingMarkers']=!0x1,_0x54bfc1['view']?.['updatePosition']();}['_showFakeVisualSelection'](){this['context']['plugins']['get'](tn)['showFakeVisualSelection']({'ranges':this['_currentConfig']['ranges'],'id':'balloon','priority':0x64}),window['getSelection']()?.['removeAllRanges']();}['_hideFakeVisualSelection'](){this['context']['plugins']['get'](tn)['hideFakeVisualSelection']('balloon');}['_showDialog'](){const _0x13bcc3=Xs(this['context'])['plugins']['get']('Dialog'),{id:_0x11e251,title:_0x2c679f,icon:_0x46e6b4,class:_0x3c1d75,mainView:_0x386077}=this['_currentConfig'];_0x386077['delegate'](...ba)['to'](this),_0x13bcc3['show']({'title':_0x2c679f,'icon':_0x46e6b4,'hasCloseButton':!0x0,'id':_0x11e251,'position':this['_calculateDialogPosition']['bind'](this),'className':'ck-ai-balloon\x20'+(_0x3c1d75||''),'content':_0x386077,'onShow':_0x1d0c9f=>{this['_showFakeVisualSelection'](),this['_setupFakeVisualSelectionMarkerRemovalListener']();const _0x14e18d=this['_getSelectionElements']();_0x14e18d&&_0x14e18d[0x0]&&Ct({'target':_0x14e18d[0x0],'ancestorOffset':0x14,'alignToTop':!0x0,'viewportOffset':{'top':0x14,'bottom':0x14,'left':0x0,'right':0x0}}),this['isOpen']=!0x0,_0x1d0c9f['once']('hide',()=>{this['fire']('beforeDialogClosed',{'id':_0x11e251});},{'priority':'high'});},'onHide':()=>{this['_hideFakeVisualSelection'](),this['_cleanupFakeVisualSelectionMarkerRemovalListener'](),this['fire']('dialogClosed',{'id':_0x11e251}),this['isOpen']=!0x1;}});}['_calculateDialogPosition'](_0xc0ca2e,_0x25727f){if(!_0x25727f)return null;const _0xfbd506=this['_getSelectionElements']();if(!_0xfbd506||0x0===_0xfbd506['length'])return{'left':Math['round'](_0x25727f['left']+_0x25727f['width']/0x2-_0xc0ca2e['width']/0x2),'top':Math['round'](_0x25727f['top']+_0x25727f['height']/0x2-_0xc0ca2e['height']/0x2)};const _0x4d9cb6=Math['round'](_0x25727f['left']+_0x25727f['width']/0x2-_0xc0ca2e['width']/0x2),_0x10909f=_0xfbd506['map'](_0xdf1ae9=>new dt(_0xdf1ae9)),_0x3298b2=_0xc0ca2e['height'];return{'left':_0x4d9cb6,'top':this['_calculateOptimalTopPosition'](_0x10909f,_0x3298b2,_0x25727f)};}['_calculateOptimalTopPosition'](_0x245547,_0x40d200,_0x5d40ee){const _0x555567=new dt(lt['window']),_0x3172d4=_0x245547['map'](_0xcb614e=>_0xcb614e['getVisible']())['filter'](_0x118cd1=>_0x118cd1),_0x542b7b=dt['getBoundingRect'](_0x3172d4);if(!_0x542b7b)return Math['round'](_0x5d40ee['top']+_0x5d40ee['height']/0x2);const _0x55418d=_0x555567['getIntersection'](_0x542b7b);if(!_0x55418d)return Math['round'](_0x5d40ee['top']+_0x5d40ee['height']/0x2);const _0x1841dc=_0x5d40ee['getVisible'](),_0x2eb284=_0x1841dc&&_0x542b7b['height']>_0x1841dc['height'],_0x3d549b=_0x55418d['top'],_0x16e611=_0x55418d['bottom'];if(_0x2eb284){const _0x2bbcb6=(_0x1841dc||_0x555567)['height']/0x2-_0x40d200/0x2,_0x5bf4e9=_0x3d549b-Oa-_0x5d40ee['top'],_0x5a0474=_0x5d40ee['bottom']-_0x16e611-Oa;return _0x5bf4e9>=_0x40d200?Math['max'](Oa,_0x3d549b-_0x40d200-Oa):_0x5a0474>=_0x40d200?_0x16e611+Oa:Math['max'](Oa,_0x2bbcb6);}const _0x178599=_0x3d549b-_0x40d200,_0x48a8d4=_0x5d40ee['bottom']-_0x16e611-Oa,_0x1b899c=_0x3d549b-Oa-_0x5d40ee['top'];let _0x279659;if(_0x48a8d4>=_0x40d200)_0x279659=_0x16e611+Oa;else{if(_0x1b899c>=_0x40d200)_0x279659=_0x178599-Oa;else _0x279659=_0x3d549b+_0x542b7b['height']/0x2-_0x40d200/0x2;}return _0x279659;}['_setupFakeVisualSelectionMarkerRemovalListener'](){const _0x4b02d2=Xs(this['context']);this['listenTo'](_0x4b02d2['model']['document'],'change',()=>{if(!this['_isUpdatingMarkers']){for(const {name:_0x31efd3,data:{newRange:_0x2508e0}}of _0x4b02d2['model']['document']['differ']['getChangedMarkers']())if(_0x31efd3['startsWith'](Zs+':')&&(_0x2508e0&&(_0x2508e0['start']['isEqual'](_0x2508e0['end'])||'$graveyard'==_0x2508e0['root']['rootName'])||null==_0x2508e0)){const _0x5957d0=us(this['context']['locale'],'AI_BALLOON_SELECTION_REMOVED_ERROR');this['_currentConfig']['mainView']['showBlockingError'](_0x5957d0),this['fire']('selectionRemoved');}}});}['_cleanupFakeVisualSelectionMarkerRemovalListener'](){const _0x37f821=Xs(this['context']);this['_currentConfig']['mainView']['hideError'](),this['stopListening'](_0x37f821['model']['document']);}['_getSelectionElements'](){const _0x2c7c63=Xs(this['context']);return _0x2c09c9(_0x2c7c63['editing'],[..._0x2c7c63['model']['markers']['getMarkersGroup']('ai-selection'),..._0x2c7c63['model']['markers']['getMarkersGroup']('ai-balloon-selection')]);}}class Na extends kt{['copyButton'];['likeButton'];['dislikeButton'];['showChangesButton'];['_config'];constructor(_0x4437ff,_0x13b43f={}){super(_0x4437ff),this['set']('isEnabled',!0x0),this['set']('isShowChangesOn',!0x1),this['_config']={'showCopy':!0x1,'showLike':!0x1,'showDislike':!0x1,..._0x13b43f};const _0x159486=!(this['_config']['showCopy']||this['_config']['showChanges']||this['_config']['showLike']||this['_config']['showDislike']||this['_config']['customView']?.['length']);this['class']=_0x159486?'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'](_0x6e3eb0){this['showChangesButton']['isEnabled']=_0x6e3eb0;}['_setupRatingButtons'](){this['likeButton']=new Nt(this['locale']),this['likeButton']['set']({'icon':_0x36e225,'label':us(this['locale'],'AI_MINI_TOOLBAR_LIKE'),'class':As,'tooltip':!0x0}),this['likeButton']['bind']('isEnabled')['to'](this),this['likeButton']['on']('execute',()=>{this['fire']('like');}),this['dislikeButton']=new Nt(this['locale']),this['dislikeButton']['set']({'icon':_0x3961b1,'label':us(this['locale'],'AI_MINI_TOOLBAR_DISLIKE'),'class':As,'tooltip':!0x0}),this['dislikeButton']['bind']('isEnabled')['to'](this),this['dislikeButton']['on']('execute',()=>{this['fire']('dislike');});}['_setupCopyButton'](){this['copyButton']=new Nt(this['locale']),this['copyButton']['set']({'icon':_0xea2377,'label':us(this['locale'],'AI_MINI_TOOLBAR_COPY'),'class':'ck-ai-mini-toolbar-copy-button\x20'+As,'tooltip':!0x0}),this['copyButton']['bind']('isEnabled')['to'](this);const _0x4a49c0=new xt();_0x4a49c0['set']({'content':_0xef6224}),_0x4a49c0['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'+As,setTimeout(()=>{this['copyButton']['class']='ck-ai-mini-toolbar-copy-button\x20'+As;},0x7d0);}),this['copyButton']['children']['add'](_0x4a49c0);}['_setupShowChangesButton'](){this['showChangesButton']=new Nt(this['locale']),this['showChangesButton']['set']({'icon':_0x2fe257,'label':us(this['locale'],'AI_SUGGESTION_BUTTON_SHOW_CHANGES'),'withText':'full'==this['_config']['showChanges'],'tooltip':'full'!=this['_config']['showChanges'],'class':As}),this['showChangesButton']['bind']('isOn')['to'](this,'isShowChangesOn'),this['showChangesButton']['bind']('isEnabled')['to'](this),this['showChangesButton']['bind']('icon')['to'](this,'isShowChangesOn',_0x12bf61=>_0x12bf61?_0x2e0ef1:_0x2fe257),this['showChangesButton']['on']('execute',()=>{this['fire']('toggleShowChanges');});}}class va extends Ra{['children'];['nextButtonView'];['previousButtonView'];['focusCycler'];['_focusables'];['_focusTracker'];['_keystrokes'];['_config'];['_streamableContentView'];['_toolbarContainerView'];['_partToolbarView'];['_stateView'];['_miniToolbarView'];constructor(_0x33652f,_0x29c534){super(_0x33652f);const _0x25a1ab=this['bindTemplate'];this['set']('showDiff',!0x1),this['set']('_state','pending'),this['_focusTracker']=new At(),this['_keystrokes']=new gt(),this['_focusables']=this['createCollection'](),this['focusCycler']=new Ut({'focusables':this['_focusables'],'focusTracker':this['_focusTracker'],'keystrokeHandler':this['_keystrokes'],'actions':{'focusPrevious':'shift\x20+\x20tab','focusNext':'tab'}}),this['_config']=_0x29c534,this['nextButtonView']=this['_createNextButtonView'](),this['previousButtonView']=this['_createPreviousButtonView'](),this['_streamableContentView']=new pn(_0x33652f),this['_partToolbarView']=new gn(_0x33652f,_0x29c534['availableActions']),this['_partToolbarView']['delegate']('applySuggestion','insertSuggestion','rejectSuggestion')['to'](this),this['_togglePartToolbarButtonsVisibility'](_0x29c534),this['_stateView']=new _n(_0x33652f),this['_stateView']['isVisible']=!0x1,this['_miniToolbarView']=new Na(_0x33652f,{'showChanges':'full'}),this['_miniToolbarView']['bind']('isShowChangesOn')['to'](this,'showDiff'),this['_miniToolbarView']['on']('toggleShowChanges',()=>{this['fire']('toggleSuggestionDisplayMode');}),this['_toolbarContainerView']=new ya(_0x33652f,[this['_partToolbarView'],this['_stateView'],this['_miniToolbarView']]),this['children']=this['createCollection']([this['_streamableContentView'],this['_toolbarContainerView']]),this['on']('change:_state',(_0x44b890,_0x160913,_0x2abc53,_0x5eef46)=>{let _0x1d91db,_0x50f952;'pending'===_0x5eef46?(_0x1d91db=this['_partToolbarView'],_0x50f952=this['_stateView']):(_0x1d91db=this['_stateView'],_0x50f952=this['_partToolbarView']),this['_stateView']['setState'](_0x2abc53),_0x1d91db['isVisible']=!0x1,_0x50f952['isVisible']=!0x0;}),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat-balloon-main',_0x25a1ab['to']('_state',_0x5f44d7=>'ck-ai-chat-balloon-main_state_'+_0x5f44d7)]},'children':this['children']}),this['on']('change:isTrackChangesOn',()=>{this['_togglePartToolbarButtonsVisibility'](_0x29c534);});}['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'](_0x6442ca){_0x6442ca?.['keepErrors']||this['hideError'](),await this['_streamableContentView']['update'](_0x6442ca);}['setState'](_0x2622cf){this['_state']=_0x2622cf;}['showError'](_0x136f95){super['showError'](_0x136f95),this['children']['has'](this['_errorView'])||this['children']['add'](this['_errorView'],0x0);}['hideError'](){this['_isErrorVisible']&&(super['hideError'](),this['togglePartToolbarEnabled'](!0x0));}['showBlockingError'](_0x4ad2a7){super['showBlockingError'](_0x4ad2a7),this['togglePartToolbarEnabled'](!0x1);}['toggleRotatorButtonsVisibility'](_0x53458a){this['nextButtonView']['isVisible']=this['previousButtonView']['isVisible']=_0x53458a;}['togglePartToolbarEnabled'](_0x5ebfa8){this['_partToolbarView']['isEnabled']=_0x5ebfa8;}['_togglePartToolbarButtonsVisibility']({showApplyButton:_0x431d39,showSuggestButton:_0x439eff}){_0x431d39=_0x431d39&&!this['isTrackChangesOn']&&this['_config']['availableActions']['includes']('applySuggestion'),_0x439eff=_0x439eff&&this['_config']['availableActions']['includes']('insertSuggestion'),this['_partToolbarView']['setButtonsVisibility']({'showApplyButton':_0x431d39,'showSuggestButton':_0x439eff});}['_createNextButtonView'](){const _0x510453=new Nt(this['locale']);return _0x510453['set']({'icon':_0x5af4b8,'label':us(this['locale'],'AI_BALLOON_NEXT_LABEL'),'isVisible':!0x0}),_0x510453['on']('execute',()=>{this['fire']('showNext');}),_0x510453;}['_createPreviousButtonView'](){const _0x478757=new Nt(this['locale']);return _0x478757['set']({'icon':_0x22ff24,'label':us(this['locale'],'AI_BALLOON_PREVIOUS_LABEL'),'isVisible':!0x0}),_0x478757['on']('execute',()=>{this['fire']('showPrevious');}),_0x478757;}}class ya extends vt{constructor(_0x47cb74,_0x1b8ec8){super(_0x47cb74),this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-balloon__toolbar-container']},'children':_0x1b8ec8});}}class xa extends _0x12af0a{static get['requires'](){return[Bt,ka];}static get['pluginName'](){return'AIChatBalloon';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['_chatBalloonView'];constructor(_0x134488){super(_0x134488),this['set']('showDiff',!0x1);}['open'](_0x18b4f5){const _0x501ae9=this['editor'];this['_chatBalloonView']||(this['_chatBalloonView']=this['_createChatBalloonView']()),_0x501ae9['plugins']['get']('AIBalloon')['open']({..._0x18b4f5,'id':'aiChatBalloon','class':'ck-ai-chat-balloon','mainView':this['_chatBalloonView']}),this['_toggleRotatorButtonsInDialogHeader'](_0x18b4f5['showRotator']),this['_chatBalloonView']['togglePartToolbarEnabled'](!_0x18b4f5['areActionsDisabled']),this['_restoreDefaultViewFocus']();}['close'](){this['editor']['plugins']['get']('AIBalloon')['close']();}['updateContent'](_0x4b507c){return this['_chatBalloonView']||(this['_chatBalloonView']=this['_createChatBalloonView']()),this['_chatBalloonView']['updateContent'](_0x4b507c);}['setState'](_0x2846bf){this['_chatBalloonView']&&this['_chatBalloonView']['setState'](_0x2846bf);}['_createChatBalloonView'](){const _0x29ffd8=this['editor'],_0x3223a5=_0x29ffd8['plugins']['get']('AIBalloon'),_0x2943aa=_0x29ffd8['commands']['get']('trackChanges');let _0x228dc5=_0x29ffd8['config']['get']('ai.availableReplyActions')||[...wn];_0x29ffd8['plugins']['has']('TrackChanges')||(_0x228dc5=_0x228dc5['filter'](_0x145c47=>'insertSuggestion'!=_0x145c47));const _0x4cde5b=new va(_0x29ffd8['locale'],{'availableActions':_0x228dc5,'showApplyButton':!0x0,'showSuggestButton':!!_0x2943aa});return _0x4cde5b['bind']('showDiff')['to'](this),_0x4cde5b['delegate'](...en)['to'](this),_0x4cde5b['delegate']('showPrevious','showNext')['to'](this),_0x3223a5['delegate']('dialogClosed')['to'](this),_0x4cde5b['on']('applySuggestion',this['_restoreDefaultViewFocus']['bind'](this)),_0x4cde5b['on']('insertSuggestion',this['_restoreDefaultViewFocus']['bind'](this)),_0x4cde5b['on']('rejectSuggestion',this['_restoreDefaultViewFocus']['bind'](this)),_0x2943aa&&_0x4cde5b['bind']('isTrackChangesOn')['to'](_0x2943aa,'value'),_0x4cde5b['render'](),_0x4cde5b;}['_toggleRotatorButtonsInDialogHeader'](_0x18b20e){const _0x2ac925=this['editor'],_0x45f188=_0x2ac925['plugins']['get']('Dialog')['view']['headerView']['children'];this['_chatBalloonView']['toggleRotatorButtonsVisibility'](_0x18b20e),_0x45f188['has'](this['_chatBalloonView']['previousButtonView'])||(_0x45f188['addMany']([this['_chatBalloonView']['previousButtonView'],this['_chatBalloonView']['nextButtonView']],0x0),_0x2ac925['plugins']['get']('AIBalloon')['once']('beforeDialogClosed',()=>{_0x45f188['remove'](this['_chatBalloonView']['previousButtonView']),_0x45f188['remove'](this['_chatBalloonView']['nextButtonView']);}));}['_restoreDefaultViewFocus'](){this['_chatBalloonView']['focus']();}}class La extends _0x12af0a{static get['requires'](){return[Sa,xa,_0x58c656];}static get['pluginName'](){return'AIEditorIntegration';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}function Da(_0x487370){const {editor:_0x37685a,action:_0x4cfbdd,withText:_0xf559ab=!0x1,withIcon:_0x3ef173=!0x0,isInDropdown:_0x59a308=!0x0,shouldPreventFocus:_0x6bb6d6=!0x1}=_0x487370;return()=>{const _0x41965f=_0x37685a['locale'],_0x2ab2c2=new Nt(_0x41965f),_0x16cc29=_0x2ab2c2['bindTemplate'];_0x59a308&&_0x2ab2c2['extendTemplate']({'on':{'mouseenter':_0x16cc29['to'](()=>{_0x6bb6d6&&_0x6bb6d6()||_0x2ab2c2['focus']();})}});const _0x35aefb=_0x4cfbdd['icon']??_0x4cfbdd['parent']?.['icon'];return _0x2ab2c2['set']({'label':_0x4cfbdd['label'],'withText':_0xf559ab,'role':'menuitem','icon':_0x3ef173?_0x35aefb??_0x5f32e3:void 0x0,'tooltip':!_0xf559ab,'class':'ck-ai-quick-actions-button','isEnabled':_0x4cfbdd['isEnabled']}),_0x2ab2c2['on']('execute',()=>{_0x37685a['editing']['view']['focus'](),_0x37685a['commands']['execute']('aiQuickAction',_0x4cfbdd);}),_0x2ab2c2;};}class Pa extends _0x2a97d0{['arrowView'];constructor(_0x2276f1,_0x2150b4){super(_0x2276f1,_0x2150b4);const _0x4ad9c7=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',_0x2af2bb=>String(_0x2af2bb)),'data-cke-tooltip-disabled':_0x4ad9c7['to']('isOn')},'on':{'mouseenter':_0x4ad9c7['to']('mouseenter')}});}['render'](){super['render'](),this['children']['add'](this['arrowView']);}['_createArrowView'](){const _0x3b3077=new xt();return _0x3b3077['content']=_0xb35716,_0x3b3077['extendTemplate']({'attributes':{'class':'ck-dropdown-menu-list__nested-menu__button__arrow'}}),_0x3b3077;}}class Ha extends Dt{['_allListItems'];['_allSearchableItems'];constructor(_0x593c2c,_0x3bd542,_0x5b6980){super(_0x593c2c),this['_allListItems']=_0x3bd542,this['_allSearchableItems']=_0x5b6980;}['filter'](_0x2561c8){if(!_0x2561c8)return this['items']['clear'](),this['items']['addMany'](this['_allListItems']),this['_clearHighlight'](),{'resultsCount':this['_allListItems']['length'],'totalItemsCount':this['_allListItems']['length']};const _0x1c72a4=_0x2561c8['source']['toLowerCase']()['trim'](),_0x2ee5f9=this['_allSearchableItems']['filter'](_0xda25f7=>(_0xda25f7['groupLabel']?_0xda25f7['label']+'\x20('+_0xda25f7['groupLabel']+')':_0xda25f7['label'])['toLowerCase']()['includes'](_0x1c72a4));return this['items']['clear'](),this['items']['addMany'](_0x2ee5f9['sort']((_0x5d47cf,_0x49f973)=>{const _0x42f905=_0x5d47cf['groupLabel'],_0x1b4fe5=_0x49f973['groupLabel'];return _0x42f905||_0x1b4fe5?_0x42f905?0x1:-0x1:0x0;})['map'](_0x25d1ab=>_0x25d1ab['item'])),this['_highlightQuery'](_0x1c72a4,_0x2ee5f9),{'resultsCount':_0x2ee5f9['length'],'totalItemsCount':this['_allSearchableItems']['length']};}['_highlightQuery'](_0x4062bd,_0x8ff7ae){if(!_0x4062bd)return;const _0x41b9ef=new RegExp(_0x3eb90e(_0x4062bd),'gi');_0x8ff7ae['forEach'](_0x1434b3=>{_0x1434b3['highlightViews']&&_0x1434b3['highlightViews']['forEach'](_0x27ce82=>{'function'==typeof _0x27ce82['highlightText']&&_0x27ce82['highlightText'](_0x41b9ef);});});}['_clearHighlight'](){this['_allSearchableItems']['forEach'](_0x127a7a=>{_0x127a7a['highlightViews']&&_0x127a7a['highlightViews']['forEach'](_0x35873b=>{'function'==typeof _0x35873b['highlightText']&&_0x35873b['highlightText'](null);});});}}const Ma='menu',Ua='menuitem';class Va extends vt{['_bodyCollection'];['optionsListView'];['_searchTextView']=null;['_allSearchableItems']=[];['children'];['focusTracker'];['keystrokes'];['_focusables'];['focusCycler'];['_openNestedPanels']=new Set();['_hasSearch'];constructor(_0x4453bd,_0x3e6381,_0x3e5c35,_0x2d9c0e,_0x4c110f=!0x1){const _0x595447=_0x4453bd['locale'];super(_0x595447),this['_bodyCollection']=_0x2d9c0e,this['_hasSearch']=_0x4c110f;const _0x430472=this['_createListItems'](_0x4453bd,_0x3e6381,_0x3e5c35);this['optionsListView']=new Ha(_0x595447,_0x430472,this['_allSearchableItems']),this['optionsListView']['role']=Ma,this['optionsListView']['items']['addMany'](_0x430472),this['focusTracker']=new At(),this['keystrokes']=new gt(),_0x4c110f&&(this['_searchTextView']=this['_createSearchTextView']()),this['_focusables']=_0x430472,this['focusCycler']=new Ut({'focusables':this['_focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes']}),_0x4c110f&&this['_searchTextView']&&this['focusCycler']['chain'](this['_searchTextView']['focusCycler']);const _0x578c01=_0x4c110f&&this['_searchTextView']?[this['_searchTextView']]:[this['optionsListView']];this['children']=new _0x5df866(_0x578c01),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-ai-quick-actions','ck-rounded-corners'],'dir':_0x595447['uiLanguageDirection']},'children':this['children']});}['_createSearchTextView'](){return new _0x5b72a7(this['locale'],{'filteredView':this['optionsListView'],'queryView':{'label':us(this['locale'],'AI_QUICK_ACTIONS_SEARCH')},'class':'ck-ai-quick-actions-search','infoView':{'text':{'notFound':{'primary':us(this['locale'],'AI_QUICK_ACTIONS_SEARCH_NOT_FOUND')}}}});}['_isSearchFocused'](){if(!this['_hasSearch']||!this['_searchTextView']||!this['_searchTextView']['queryView']['fieldView']['element'])return!0x1;const _0x3dac11=this['_searchTextView']['queryView']['fieldView']['element']['ownerDocument']?.['activeElement'];return this['_searchTextView']['queryView']['fieldView']['element']['contains'](_0x3dac11);}['_createListItems'](_0x5ccddb,_0x26b72b,_0x288565){const _0x4f13ee=new _0x5df866();return _0x26b72b['forEach'](_0xe30ab2=>{if('actions'in _0xe30ab2){const {listItem:_0x374af0}=this['_createActionGroupButton'](_0x5ccddb,_0xe30ab2,_0x288565);_0x4f13ee['add'](_0x374af0),_0xe30ab2['actions']['forEach'](_0x5467c6=>{this['_createActionButton'](_0x5ccddb,_0x5467c6,_0xe30ab2['label'],_0xe30ab2['icon']);const {listItem:_0x4d7fa0,highlightViews:_0x3e2535}=this['_createSearchResultActionButton'](_0x5ccddb,_0x5467c6,_0xe30ab2['label'],_0xe30ab2['icon']);this['_allSearchableItems']['push']({'item':_0x4d7fa0,'label':_0x5467c6['label'],'groupLabel':_0xe30ab2['label'],'highlightViews':_0x3e2535});});}else{const {listItem:_0x31c5f8}=this['_createActionButton'](_0x5ccddb,_0xe30ab2);_0x4f13ee['add'](_0x31c5f8);const _0x43f808=_0x31c5f8['children']['first'];if(_0x43f808){const {listItem:_0x4ecc67,highlightViews:_0x45e5d3}=this['_createSearchResultActionButton'](_0x5ccddb,_0xe30ab2);this['_allSearchableItems']['push']({'item':_0x4ecc67,'label':_0x43f808['label']||'','highlightViews':_0x45e5d3});}}}),_0x4f13ee;}['_createActionButton'](_0x38a562,_0x3388fb,_0x1d79d4,_0x3db458){const _0x1880c5=new Ht(this['locale']);if(_0x1d79d4&&_0x3db458){const _0x5232d8=new Nt(this['locale']),_0x3a39fa=_0x5232d8['bindTemplate'],_0x505161=new _0x1b00b1();_0x505161['text']=_0x3388fb['label'];const _0x172e78=new _0x1b00b1();_0x172e78['text']=_0x1d79d4;const _0x29592b=new xt();_0x29592b['content']=_0x3db458,_0x29592b['extendTemplate']({'attributes':{'class':'ck-ai-quick-actions-button__group-icon'}});const _0x1a9b4f=new vt(this['locale']);_0x1a9b4f['setTemplate']({'tag':'span','attributes':{'class':'ck-ai-quick-actions-button_with-group__open-paren'},'children':[{'text':'\x20('}]});const _0x229196=new vt(this['locale']);return _0x229196['setTemplate']({'tag':'span','attributes':{'class':'ck-ai-quick-actions-button_with-group__close-paren'},'children':[{'text':')'}]}),_0x5232d8['set']({'label':_0x3388fb['label']+'\x20('+_0x1d79d4+')','withText':!0x0,'role':'menuitem','class':'ck-ai-quick-actions-button\x20ck-ai-quick-actions-button_with-group','tooltip':!0x1}),_0x5232d8['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':[_0x505161,_0x1a9b4f,_0x29592b,_0x172e78,_0x229196],'on':{'mouseenter':_0x3a39fa['to'](()=>{this['_isSearchFocused']()||_0x5232d8['focus']();}),'click':_0x3a39fa['to'](()=>{_0x5232d8['fire']('execute');})}}),_0x5232d8['on']('execute',()=>{_0x38a562['editing']['view']['focus'](),_0x38a562['commands']['execute']('aiQuickAction',_0x3388fb);}),_0x1880c5['children']['add'](_0x5232d8),{'listItem':_0x1880c5,'highlightViews':[_0x505161,_0x172e78]};}{const _0x110f28=new _0x3a98ec(),_0x2f0103=new Nt(this['locale'],_0x110f28),_0x76a473=_0x2f0103['bindTemplate'],_0x5b0309=_0x3388fb['icon']??_0x3388fb['parent']?.['icon'],_0x1d5e32=void 0x0!==_0x3388fb['icon'];return _0x2f0103['set']({'label':_0x3388fb['label'],'withText':!0x0,'role':'menuitem','icon':_0x1d5e32?_0x5b0309??_0x5f32e3:void 0x0,'tooltip':!0x1,'class':'ck-ai-quick-actions-button'}),_0x2f0103['extendTemplate']({'on':{'mouseenter':_0x76a473['to'](()=>{this['_isSearchFocused']()||_0x2f0103['focus']();})}}),_0x2f0103['on']('execute',()=>{_0x38a562['editing']['view']['focus'](),_0x38a562['commands']['execute']('aiQuickAction',_0x3388fb);}),_0x1880c5['children']['add'](_0x2f0103),{'listItem':_0x1880c5,'highlightViews':[_0x110f28]};}}['_createSearchResultActionButton'](_0x4075b5,_0x32faed,_0x1fcf03,_0x57170c){return _0x1fcf03&&_0x57170c?this['_createSearchResultGroupedActionButton'](_0x4075b5,_0x32faed,_0x1fcf03,_0x57170c):this['_createSearchResultIndividualActionButton'](_0x4075b5,_0x32faed);}['_createSearchResultGroupedActionButton'](_0x1afd2e,_0x14d003,_0x575730,_0x175344){const _0x141017=new Ht(this['locale']),_0x594c12=new Nt(this['locale']),_0xb47fdb=_0x594c12['bindTemplate'],{view:_0x34340d,highlightView:_0x789d12}=this['_createSearchResultGroupRow'](_0x575730,_0x175344),{view:_0x959c51,highlightView:_0x4be02f}=this['_createSearchResultActionRow'](_0x14d003['label']),_0x286285=this['_createSearchResultContentView'](_0x34340d,_0x959c51);return _0x594c12['set']({'label':_0x14d003['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}),_0x594c12['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':[_0x286285],'on':{'mouseenter':_0xb47fdb['to'](()=>{this['_isSearchFocused']()||_0x594c12['focus']();}),'click':_0xb47fdb['to'](()=>{this['_handleSearchResultButtonClick'](_0x594c12);})}}),this['_setupActionButtonExecution'](_0x594c12,_0x1afd2e,_0x14d003),_0x141017['children']['add'](_0x594c12),{'listItem':_0x141017,'highlightViews':[_0x789d12,_0x4be02f]};}['_createSearchResultIndividualActionButton'](_0x22bf9d,_0x31f887){const _0x4449a6=new Ht(this['locale']),_0x29fd07=new _0x3a98ec(),_0x28141c=new Nt(this['locale'],_0x29fd07),_0x1dcfbd=_0x28141c['bindTemplate'];return _0x28141c['set']({'label':_0x31f887['label'],'withText':!0x0,'role':'menuitem','icon':void 0x0,'tooltip':!0x1,'class':'ck-ai-quick-actions-button\x20ck-ai-quick-actions-search-result-button'}),_0x28141c['extendTemplate']({'on':{'mouseenter':_0x1dcfbd['to'](()=>{this['_isSearchFocused']()||_0x28141c['focus']();})}}),this['_setupActionButtonExecution'](_0x28141c,_0x22bf9d,_0x31f887),_0x4449a6['children']['add'](_0x28141c),{'listItem':_0x4449a6,'highlightViews':[_0x29fd07]};}['_createSearchResultGroupRow'](_0x521d17,_0x44dc59){const _0x163b80=new vt(this['locale']),_0xa3b62b=new xt();_0xa3b62b['content']=_0x44dc59,_0xa3b62b['extendTemplate']({'attributes':{'class':'ck-ai-quick-actions-button__group-icon'}});const _0x25f23a=new _0x1b00b1();return _0x25f23a['text']=_0x521d17,_0x163b80['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-quick-actions-search-result__group-row'},'children':[_0xa3b62b,_0x25f23a]}),{'view':_0x163b80,'highlightView':_0x25f23a};}['_createSearchResultActionRow'](_0xf87b97){const _0x3e7bc3=new vt(this['locale']),_0x30888d=new _0x1b00b1();return _0x30888d['text']=_0xf87b97,_0x3e7bc3['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-quick-actions-search-result__action-row'},'children':[_0x30888d]}),{'view':_0x3e7bc3,'highlightView':_0x30888d};}['_createSearchResultContentView'](_0x4dfbff,_0x613f4e){const _0x100a70=new vt(this['locale']);return _0x100a70['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-quick-actions-search-result__content'},'children':[_0x4dfbff,_0x613f4e]}),_0x100a70;}['_setupActionButtonExecution'](_0x10622b,_0x243418,_0x375a83){_0x10622b['on']('execute',()=>{_0x243418['editing']['view']['focus'](),_0x243418['commands']['execute']('aiQuickAction',_0x375a83);});}['_createActionGroupButton'](_0x1e461e,_0x862844,_0x3b4152){const _0x26ace8=new Ht(this['locale']),_0x56843d=new _0x3a98ec(),_0x499daf=new Pa(this['locale'],_0x56843d),_0x56ee46=_0x499daf['bindTemplate'],_0x4d053f=this['_getPanelKeystroke'](_0x3b4152),_0x57efea=this['_createGroupActionsList'](_0x1e461e,_0x862844['actions'],_0x3b4152);_0x499daf['set']({'label':_0x862844['label'],'withText':!0x0,'role':Ua,'icon':_0x862844['icon']??_0x5f32e3,'isEnabled':_0x862844['actions']['some'](_0x43a5c6=>_0x43a5c6['isEnabled'])}),_0x499daf['extendTemplate']({'on':{'mouseenter':_0x56ee46['to'](()=>{this['_isSearchFocused']()||_0x499daf['focus']();})}});const _0x1ea10b=new Xt(this['locale']);return _0x1ea10b['extendTemplate']({'attributes':{'class':['ck','ck-reset_all','ck-ai-quick-actions-group-panel','ck-dropdown-menu__nested-menu__panel']},'on':{'keydown':_0x56ee46['to'](_0x4e3943=>{this['_handlePanelKeydown'](_0x4e3943,_0x4d053f,_0x499daf,_0x1ea10b);})}}),_0x499daf['bind']('isOn')['to'](_0x1ea10b,'isVisible'),this['_bodyCollection']['add'](_0x1ea10b),_0x1ea10b['content']['add'](_0x57efea),this['_setupGroupMenuBehavior'](_0x499daf,_0x1ea10b),_0x26ace8['children']['add'](_0x499daf),{'listItem':_0x26ace8,'highlightView':_0x56843d};}['_createGroupActionsList'](_0x848bfd,_0x205b5f,_0x177f62){const _0x88a308=new Dt(this['locale']);return _0x88a308['extendTemplate']({'attributes':{'class':['ck','ck-reset_all','ck-ai-quick-actions-group-list','ck-dropdown-menu-list']}}),_0x205b5f['forEach'](_0x548bfb=>{const _0x299a0f=new Ht(this['locale']),_0x2faf53=Da({'editor':_0x848bfd,'action':_0x548bfb,'withText':!0x0,'withIcon':!0x1,'isInDropdown':!0x0,'shouldPreventFocus':()=>this['_isSearchFocused']()})();_0x299a0f['children']['add'](_0x2faf53),_0x177f62['focusTracker']['add'](_0x2faf53),_0x88a308['items']['add'](_0x299a0f);}),_0x88a308;}['_setupGroupMenuBehavior'](_0xfe25bc,_0x4fb647){const _0x17cd1c=_0xfe25bc['bindTemplate'],_0x51de73=this['_getButtonKeystroke'](_0xfe25bc);_0xfe25bc['extendTemplate']({'attributes':{'class':['ck-ai-quick-actions-group-button']},'on':{'mouseenter':_0x17cd1c['to'](()=>{this['_showNestedPanel'](_0x4fb647,_0xfe25bc);}),'mouseleave':_0x17cd1c['to'](_0x2d0a06=>{const _0x217736=_0x2d0a06['relatedTarget'];this['_isMovingToNestedMenu'](_0x217736,_0x4fb647)||this['_hideNestedPanel'](_0x4fb647);}),'keydown':_0x17cd1c['to'](_0x2df2ac=>{_0x2df2ac['key']==_0x51de73&&(this['_showNestedPanel'](_0x4fb647,_0xfe25bc),_0x4fb647['content']['get'](0x0)['focus']());})}}),_0x4fb647['on']('render',()=>{_0x4fb647['element']?.['addEventListener']('mouseleave',_0x5ea897=>{const _0x4ef3b7=_0x5ea897['relatedTarget'];_0xfe25bc['element']?.['contains'](_0x4ef3b7)||this['_isMovingToNestedMenu'](_0x4ef3b7,_0x4fb647)||this['_hideNestedPanel'](_0x4fb647);});});}['_showNestedPanel'](_0x421d28,_0x247d1b){this['_openNestedPanels']['forEach'](_0xc3272b=>{_0xc3272b!==_0x421d28&&_0xc3272b['isVisible']&&_0xc3272b['hide']();}),_0x421d28['show'](),_0x421d28['pin']({'positions':[_0x33a79b['eastSouth']],'target':_0x247d1b['element'],'fitInViewport':!0x0}),this['_openNestedPanels']['add'](_0x421d28);}['_hideNestedPanel'](_0x2fd9d2){_0x2fd9d2['hide'](),this['_openNestedPanels']['delete'](_0x2fd9d2);}['_hideAllNestedPanels'](){this['_openNestedPanels']['forEach'](_0x31ce04=>_0x31ce04['hide']()),this['_openNestedPanels']['clear']();}['_isMovingToNestedMenu'](_0x8eb82f,_0x11979b){if(!_0x8eb82f)return!0x1;if(_0x11979b['element']?.['contains'](_0x8eb82f))return!0x0;const _0x4b7670=_0x8eb82f;return _0x4b7670['closest']&&(null!==_0x4b7670['closest']('.ck-ai-quick-actions-group-panel')||null!==_0x4b7670['closest']('.ck-ai-quick-actions-group-list')||null!==_0x4b7670['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'](_0x301f7d){return'rtl'===_0x301f7d['locale']['uiLanguageDirection']?'ArrowRight':'ArrowLeft';}['_getButtonKeystroke'](_0x58bad1){return'rtl'===_0x58bad1['locale']['uiLanguageDirection']?'ArrowLeft':'ArrowRight';}['_handlePanelKeydown'](_0x4447b5,_0x5d7d75,_0x522df4,_0x383db8){_0x4447b5['key']==_0x5d7d75&&(_0x522df4['focus'](),this['_hideNestedPanel'](_0x383db8));}['_handleSearchResultButtonClick'](_0x3d02f8){_0x3d02f8['fire']('execute');}}function Ba(_0x1b9067){const {editor:_0xef5942,content:_0x6751cd,buttonDefinition:_0x1cdd60,bodyCollection:_0x24bca1,hasSearch:_0x30e74c=!0x1}=_0x1b9067;return()=>{const _0x2b58a8=_0xef5942['locale'],_0x2ed9c6=Gt(_0x2b58a8);_0x2ed9c6['buttonView']['set']({'icon':_0x1cdd60['icon']??_0x5f32e3,'label':_0x1cdd60['label'],'tooltip':!0x0}),_0x2ed9c6['set']({'class':'ck-ai-quick-actions-dropdown'});const _0x380044=new Va(_0xef5942,_0x6751cd,_0x2ed9c6,_0x24bca1,_0x30e74c);return _0x2ed9c6['panelView']['children']['add'](_0x380044),_0x30e74c&&_0x2ed9c6['on']('change:isOpen',(_0x25e754,_0x4879ac,_0x3b8913)=>{if(_0x3b8913){if(_0xef5942['plugins']['has']('AIEditing')){const _0x4bce07=_0xef5942['plugins']['get'](tn),_0x79c02c=_0xef5942['model']['document']['selection'],_0x4b7626=Array['from'](_0x79c02c['getRanges']());_0x4b7626['length']>0x0&&_0x4bce07['showFakeVisualSelection']({'ranges':_0x4b7626,'id':'quick-action','priority':0x14});}}else _0xef5942['plugins']['has']('AIEditing')&&_0xef5942['plugins']['get'](tn)['hideFakeVisualSelection']('quick-action'),_0x380044['resetSearch']();}),_0x2ed9c6;};}const Ga='<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>',Fa='<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>',Ka='<task>For\x20the\x20given\x20selected\x20part\x20of\x20an\x20HTML\x20document\x20you\x20must\x20extract\x20and\x20present\x20the\x20key\x20points\x20from\x20its\x20content.</task><rules>1.\x20Present\x20the\x20output\x20as\x20a\x20clear,\x20structured\x20list\x20(bullets\x20or\x20numbered).-\x20Each\x20point\x20should\x20be\x20concise\x20(one\x20sentence\x20or\x20less).-\x20Do\x20not\x20merge\x20distinct\x20ideas\x20into\x20one\x20bullet.2.\x20Identify\x20what\x20type\x20of\x20text\x20it\x20is\x20and\x20adapt\x20the\x20extraction\x20style:-\x20If\x20it\x20is\x20descriptive\x20capture\x20the\x20main\x20attributes\x20or\x20features.-\x20If\x20it\x20is\x20argumentative\x20extract\x20the\x20main\x20claim\x20and\x20supporting\x20reasons\x20separately.-\x20If\x20it\x20is\x20narrative/story-like\x20extract\x20the\x20main\x20events\x20in\x20chronological\x20order.-\x20If\x20it\x20is\x20data-driven\x20(stats,\x20figures,\x20facts)\x20highlight\x20the\x20most\x20important\x20facts\x20or\x20numbers.-\x20If\x20it\x20is\x20instructional\x20list\x20the\x20steps\x20or\x20main\x20actions\x20in\x20simplified\x20form.-\x20If\x20it\x20provides\x20comparisons\x20extract\x20the\x20contrasted\x20items\x20and\x20their\x20differences/similarities.-\x20If\x20it\x20does\x20not\x20fit\x20any\x20category\x20above\x20extract\x20the\x20main\x20ideas\x20in\x20plain,\x20short\x20statements.3.\x20Keep\x20the\x20list\x20between\x203–7\x20items\x20where\x20possible.-\x20If\x20the\x20text\x20is\x20very\x20short,\x20fewer\x20items\x20are\x20fine.-\x20If\x20it\x20is\x20very\x20long,\x20focus\x20on\x20the\x20most\x20important\x20ideas\x20only.4.\x20Do\x20not\x20copy\x20long\x20text\x20fragments\x20—\x20restate\x20in\x20simple\x20words.5.\x20Do\x20not\x20add\x20interpretation,\x20evaluation,\x20or\x20commentary\x20beyond\x20the\x20text.6.\x20Ensure\x20the\x20list\x20can\x20stand\x20alone\x20without\x20requiring\x20the\x20reader\x20to\x20see\x20the\x20original\x20document.7.\x20Use\x20the\x20context\x20of\x20the\x20whole\x20document,\x20but\x20focus\x20on\x20the\x20selected\x20part\x20when\x20creating\x20your\x20key\x20points.8.\x20Your\x20key\x20points\x20should\x20be\x20written\x20in\x20%0\x20language.</rules><constraints>1.\x20You\x20MUST\x20NOT\x20perform\x20any\x20edits\x20or\x20modifications\x20on\x20the\x20provided\x20document.2.\x20You\x20MUST\x20NOT\x20include\x20document\x20modifications\x20in\x20your\x20response.3.\x20Your\x20message\x20should\x20only\x20include\x20the\x20extracted\x20key\x20points.\x20Do\x20not\x20add\x20any\x20additional\x20text,\x20flattery,\x20questions\x20or\x20followup\x20suggestions.</constraints>';var Wa=function(_0x4cede5){return _0x4cede5['chat']='AIChat',_0x4cede5['action']='AIActions',_0x4cede5;}({});class Ya extends _0x12af0a{static get['requires'](){return[_0x4506df,ls];}static get['pluginName'](){return'AIQuickActionsUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}async['init'](){const _0x4ba5e2=await this['_getDefaultAndCustomActions']();this['_prepareQuickActionsDefinition'](_0x4ba5e2),this['_initializeQuickActionsComponentsAndCommands']();}static['getDefaultQuickActions'](_0x2f8d72){return function(_0x95240a){const _0x3aff36=new Intl['DisplayNames'](['en'],{'type':'language'})['of'](_0x95240a['uiLanguage']),_0x3d2c30=_0x3aff36||'English',_0x5d9ec1=[{'id':'ask-ai','label':us(_0x95240a,'AI_QUICK_ACTIONS_ASK_AI'),'type':no['CHAT'],'icon':_0x375821},{'id':'chat-commands','label':us(_0x95240a,'AI_QUICK_ACTIONS_CHAT_COMMANDS'),'icon':_0x375821,'actions':[{'id':'explain','label':us(_0x95240a,'AI_QUICK_ACTIONS_EXPLAIN'),'displayedPrompt':us(_0x95240a,'AI_QUICK_ACTIONS_EXPLAIN'),'prompt':Ga['replace']('%0',_0x3d2c30),'type':no['CHAT']},{'id':'summarize','label':us(_0x95240a,'AI_QUICK_ACTIONS_SUMMARIZE'),'displayedPrompt':us(_0x95240a,'AI_QUICK_ACTIONS_SUMMARIZE'),'prompt':Fa['replace']('%0',_0x3d2c30),'type':no['CHAT']},{'id':'highlight-key-points','label':us(_0x95240a,'AI_QUICK_ACTIONS_HIGHLIGHT_KEY_POINTS'),'displayedPrompt':us(_0x95240a,'AI_QUICK_ACTIONS_HIGHLIGHT_KEY_POINTS'),'prompt':Ka['replace']('%0',_0x3d2c30),'type':no['CHAT']}]},{'id':'improve-writing','label':us(_0x95240a,'AI_QUICK_ACTIONS_IMPROVE_WRITING'),'type':no['ACTION'],'icon':_0x4a3a7e},{'id':'continue','label':us(_0x95240a,'AI_QUICK_ACTIONS_CONTINUE_WRITING'),'type':no['ACTION'],'icon':_0x56babf},{'id':'fix-grammar','label':us(_0x95240a,'AI_QUICK_ACTIONS_FIX_GRAMMAR_SPELLING'),'type':no['ACTION'],'icon':_0x40edc4},{'id':'adjust-length','label':us(_0x95240a,'AI_QUICK_ACTIONS_ADJUST_LENGTH'),'icon':_0x4b6dd4,'actions':[{'id':'make-shorter','label':us(_0x95240a,'AI_QUICK_ACTIONS_MAKE_SHORTER'),'type':no['ACTION']},{'id':'make-longer','label':us(_0x95240a,'AI_QUICK_ACTIONS_MAKE_LONGER'),'type':no['ACTION']}]},{'id':'change-tone','label':us(_0x95240a,'AI_QUICK_ACTIONS_CHANGE_TONE'),'icon':_0x1b5b19,'actions':[{'id':'make-tone-casual','label':us(_0x95240a,'AI_QUICK_ACTIONS_MORE_CASUAL'),'type':no['ACTION']},{'id':'make-tone-direct','label':us(_0x95240a,'AI_QUICK_ACTIONS_MORE_DIRECT'),'type':no['ACTION']},{'id':'make-tone-friendly','label':us(_0x95240a,'AI_QUICK_ACTIONS_MORE_FRIENDLY'),'type':no['ACTION']},{'id':'make-tone-confident','label':us(_0x95240a,'AI_QUICK_ACTIONS_MORE_CONFIDENT'),'type':no['ACTION']},{'id':'make-tone-professional','label':us(_0x95240a,'AI_QUICK_ACTIONS_MORE_PROFESSIONAL'),'type':no['ACTION']}]},{'id':'translate','label':us(_0x95240a,'AI_QUICK_ACTIONS_TRANSLATE'),'icon':_0x275309,'actions':[{'id':'translate-to-english','label':us(_0x95240a,'AI_QUICK_ACTIONS_TRANSLATE_ENGLISH'),'type':no['ACTION'],'actionName':'translate','args':{'language':'english'}},{'id':'translate-to-chinese','label':us(_0x95240a,'AI_QUICK_ACTIONS_TRANSLATE_CHINESE'),'type':no['ACTION'],'actionName':'translate','args':{'language':'chinese'}},{'id':'translate-to-spanish','label':us(_0x95240a,'AI_QUICK_ACTIONS_TRANSLATE_SPANISH'),'type':no['ACTION'],'actionName':'translate','args':{'language':'spanish'}},{'id':'translate-to-german','label':us(_0x95240a,'AI_QUICK_ACTIONS_TRANSLATE_GERMAN'),'type':no['ACTION'],'actionName':'translate','args':{'language':'german'}},{'id':'translate-to-french','label':us(_0x95240a,'AI_QUICK_ACTIONS_TRANSLATE_FRENCH'),'type':no['ACTION'],'actionName':'translate','args':{'language':'french'}},{'id':'translate-to-japanese','label':us(_0x95240a,'AI_QUICK_ACTIONS_TRANSLATE_JAPANESE'),'type':no['ACTION'],'actionName':'translate','args':{'language':'japanese'}},{'id':'translate-to-portuguese','label':us(_0x95240a,'AI_QUICK_ACTIONS_TRANSLATE_PORTUGUESE'),'type':no['ACTION'],'actionName':'translate','args':{'language':'portuguese'}},{'id':'translate-to-korean','label':us(_0x95240a,'AI_QUICK_ACTIONS_TRANSLATE_KOREAN'),'type':no['ACTION'],'actionName':'translate','args':{'language':'korean'}},{'id':'translate-to-italian','label':us(_0x95240a,'AI_QUICK_ACTIONS_TRANSLATE_ITALIAN'),'type':no['ACTION'],'actionName':'translate','args':{'language':'italian'}},{'id':'translate-to-russian','label':us(_0x95240a,'AI_QUICK_ACTIONS_TRANSLATE_RUSSIAN'),'type':no['ACTION'],'actionName':'translate','args':{'language':'russian'}}]},{'id':'other','label':us(_0x95240a,'AI_QUICK_ACTIONS_OTHER'),'icon':tt,'actions':[]}];return _0x5d9ec1;}(_0x2f8d72);}async['_getDefaultAndCustomActions'](){const _0x35605b=Ya['getDefaultQuickActions'](this['editor']['locale']),_0x210750=this['editor']['config']['get']('ai.quickActions.extraCommands')||[];let _0x47e18b=[];try{_0x47e18b=await new qs({'connector':this['editor']['plugins']['get']('AIConnector'),'locale':this['editor']['locale']})['getAll']();}catch(_0x27a02e){const _0x111a14=new ht('ai-quick-actions-models-unable-to-retrieve',this,{'error':_0x27a02e});mt(_0x111a14['message']);}finally{const _0x5963e1=_0x210750['map'](_0x19f88a=>({..._0x19f88a,'type':'chat'===_0x19f88a['type']?no['CHAT']:no['ACTION'],'icon':void 0x0}));_0x35605b['find'](_0x58867d=>'other'===_0x58867d['id'])['actions']['push'](..._0x5963e1),_0x35605b['forEach'](_0x3da395=>{if('actions'in _0x3da395)_0x3da395['actions']['forEach'](_0x4cb27b=>{if(_0x4cb27b['isEnabled']=!!_0x47e18b['find'](_0x39b8ad=>_0x39b8ad['id']===_0x4cb27b['model'])||void 0x0===_0x4cb27b['model'],!_0x4cb27b['isEnabled']){const _0x1dc6fa=new ht('ai-quick-actions-unavailable-model',this,{'actionId':_0x4cb27b['id'],'modelId':_0x4cb27b['model']});mt(_0x1dc6fa['message']);}});else{if(_0x3da395['isEnabled']=!!_0x47e18b['find'](_0x186c29=>_0x186c29['id']===_0x3da395['model'])||void 0x0===_0x3da395['model'],!_0x3da395['isEnabled']){const _0x1521de=new ht('ai-quick-actions-unavailable-model',this,{'actionId':_0x3da395['id'],'modelId':_0x3da395['model']});mt(_0x1521de['message']);}}});}return _0x35605b;}['_initializeQuickActionsComponentsAndCommands'](){const _0x3bb223=new Qt(this['editor']['locale']);_0x3bb223['attachToDom'](),this['_initializeQuickActionsDropdown'](_0x3bb223),this['_initializeQuickActionsMenuBar'](),this['_initializeQuickActionsComponents'](_0x3bb223);}['_initializeQuickActionsDropdown'](_0x504b4f){const _0x794bfd=this['editor']['config']['get']('ai.quickActions.isSearchEnabled')??!0x0;this['editor']['ui']['componentFactory']['add']('aiQuickActions',Ba({'editor':this['editor'],'content':this['_quickActionsDefinition'],'buttonDefinition':{'icon':_0x5f32e3,'label':us(this['editor']['locale'],'AI_QUICK_ACTIONS_HEADING')},'bodyCollection':_0x504b4f,'hasSearch':_0x794bfd}));}['_prepareQuickActionsDefinition'](_0x1f1646){this['_quickActionsDefinition']=_0x1f1646['map'](_0x2e3cdf=>{if('actions'in _0x2e3cdf){const _0x432721=_0x2e3cdf;return{..._0x432721,'actions':_0x432721['actions']['map'](_0x3b55b2=>{const {actions:_0x28a4bb,..._0x496320}=_0x432721;return{..._0x3b55b2,'parent':_0x496320};})['filter'](_0x60e004=>this['_shouldIncludeAction'](_0x60e004))};}return _0x2e3cdf;})['filter'](_0x24d551=>'actions'in _0x24d551?_0x24d551['actions']['length']>0x0:this['_shouldIncludeAction'](_0x24d551));}['_shouldIncludeAction'](_0x57e001){const _0x4342fb=this['editor']['config']['get']('ai.quickActions.removeCommands')||[];return this['editor']['plugins']['has'](Wa[_0x57e001['type']])&&!_0x4342fb['includes'](_0x57e001['id'])&&!(_0x57e001['type']===no['CHAT']&&!0x1===this['editor']['config']['get']('ai.chat.context.document.enabled'));}['_initializeQuickActionsComponents'](_0x3ab9b8){this['_quickActionsDefinition']['forEach'](_0x56e547=>{if('actions'in _0x56e547){const _0x1fc09c=Ba({'editor':this['editor'],'content':_0x56e547['actions'],'buttonDefinition':_0x56e547,'bodyCollection':_0x3ab9b8});this['editor']['ui']['componentFactory']['add'](_0x56e547['id'],_0x1fc09c),_0x56e547['actions']['forEach'](_0x3642db=>{const _0x59277f=Da({'editor':this['editor'],'action':_0x3642db});this['editor']['ui']['componentFactory']['add'](_0x3642db['id'],_0x59277f);});}else{const _0xcf54ef=Da({'editor':this['editor'],'action':_0x56e547,'withText':!0x1,'withIcon':!0x0,'isInDropdown':!0x1});this['editor']['ui']['componentFactory']['add'](_0x56e547['id'],_0xcf54ef);}});}['_initializeQuickActionsMenuBar'](){this['editor']['ui']['componentFactory']['add']('menuBar:aiQuickActions',_0x15979d=>{const _0x31dae9=new Kt(_0x15979d),_0x1de54e=us(_0x15979d,'AI_QUICK_ACTIONS_HEADING');_0x31dae9['buttonView']['set']({'label':_0x1de54e,'icon':_0x5f32e3});const _0x1c092f=new $t(_0x15979d);_0x1c092f['set']({'ariaLabel':_0x1de54e,'role':'menu'}),this['_quickActionsDefinition']['forEach'](_0x278a60=>{if('actions'in _0x278a60){const _0x266947=_0x278a60,_0x2b7bcc=new qt(_0x15979d,_0x31dae9),_0x1c0892=new Kt(_0x15979d),_0x12be63=new $t(_0x15979d);_0x1c0892['buttonView']['set']({'label':_0x266947['label'],'icon':_0x266947['icon']}),_0x266947['actions']['forEach'](_0x3f2b0e=>{const _0x532acd=new qt(_0x15979d,_0x1c0892),_0x26d3c4=new Wt(_0x15979d);_0x26d3c4['set']({'label':_0x3f2b0e['label'],'icon':_0x3f2b0e['icon'],'role':'menuitem','isEnabled':_0x3f2b0e['isEnabled']}),_0x26d3c4['on']('execute',()=>{this['_executeQuickAction'](_0x3f2b0e);}),_0x26d3c4['delegate']('execute')['to'](_0x1c0892),_0x532acd['children']['add'](_0x26d3c4),_0x12be63['items']['add'](_0x532acd);}),_0x1c0892['panelView']['children']['add'](_0x12be63),_0x2b7bcc['children']['add'](_0x1c0892),_0x1c092f['items']['add'](_0x2b7bcc);}else{const _0x36f494=_0x278a60,_0xb2b694=new qt(_0x15979d,_0x31dae9),_0xc5a4e5=new Wt(_0x15979d);_0xc5a4e5['set']({'label':_0x36f494['label'],'icon':_0x36f494['icon'],'role':'menuitem','isEnabled':_0x36f494['isEnabled']}),_0xc5a4e5['on']('execute',()=>{this['_executeQuickAction'](_0x36f494);}),_0xc5a4e5['delegate']('execute')['to'](_0x31dae9),_0xb2b694['children']['add'](_0xc5a4e5),_0x1c092f['items']['add'](_0xb2b694);}});const _0x4771a9=Object['values'](Wa)['some'](_0x180df1=>this['editor']['plugins']['has'](_0x180df1));return _0x31dae9['set']({'isEnabled':_0x4771a9}),_0x31dae9['panelView']['children']['add'](_0x1c092f),_0x31dae9;});}['_executeQuickAction'](_0x352969){const _0xf7d5f5=this['editor'];_0xf7d5f5['editing']['view']['focus'](),_0xf7d5f5['commands']['execute']('aiQuickAction',_0x352969);const _0x5df8f8=_0xf7d5f5['ui']['view']['menuBarView'];_0x5df8f8&&_0x5df8f8['close']&&_0x5df8f8['close']();}}class $a extends _0x521df8{['execute'](_0x5b8e8a){switch(this['_expandSelectionIfCollapsed'](),_0x5b8e8a['type']){case no['CHAT']:if(!this['editor']['plugins']['has']('AIChat')){const _0x2d78fe=us(this['editor']['locale'],'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND','AIChat');throw new ht('ai-quick-actions-plugin-not-found',this['editor'],{'errorMessage':_0x2d78fe});}this['_handleAIChatAction'](_0x5b8e8a);break;case no['ACTION']:if(!this['editor']['plugins']['has']('AIActions')){const _0x2b4ec7=us(this['editor']['locale'],'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND','AIActions');throw new ht('ai-quick-actions-plugin-not-found',this['editor'],{'errorMessage':_0x2b4ec7});}this['_handleAIActionsAction'](_0x5b8e8a);}}async['_handleAIChatAction'](_0x1acc8f){const _0x5c2ffd=this['editor']['plugins']['get']('AIChatController'),_0x4bfb21=this['editor']['plugins']['get']('AITabs')['view'];if(_0x4bfb21['isVisible']||(_0x4bfb21['isVisible']=!0x0),'chat'!==_0x4bfb21['activeTab']&&_0x4bfb21['activateTab']('chat'),'ask-ai'===_0x1acc8f['id'])_0x5c2ffd['removeSelectionFromChatContext'](),_0x5c2ffd['addSelectionToChatContext'](),_0x5c2ffd['focusPromptInput']();else await _0x5c2ffd['startConversation'](),_0x5c2ffd['removeSelectionFromChatContext'](),_0x5c2ffd['addSelectionToChatContext'](),_0x5c2ffd['focusPromptInput'](),await _0x5c2ffd['sendMessage']({'message':_0x1acc8f['prompt']||_0x1acc8f['displayedPrompt']||_0x1acc8f['label'],'attributes':{'quickActionData':{'id':_0x1acc8f['id']},'displayedPrompt':_0x1acc8f['displayedPrompt']}});}['_expandSelectionIfCollapsed'](){const _0x11b3a1=this['editor'],_0x3da5bb=_0x11b3a1['model']['document']['selection'];if(!_0x3da5bb['isCollapsed'])return;const _0x32665c=It(_0x3da5bb['getSelectedBlocks']())||_0x11b3a1['model']['schema']['getLimitElement'](_0x3da5bb);_0x11b3a1['model']['change'](_0x4edb3f=>{_0x4edb3f['setSelection'](_0x32665c,'in');});}['_handleAIActionsActionLabel'](_0x2bdaaf){return _0x2bdaaf['parent']?.['label']&&'other'!==_0x2bdaaf['parent']?.['id']?_0x2bdaaf['parent']['label']+':\x20'+_0x2bdaaf['label']:_0x2bdaaf['label'];}async['_handleAIActionsAction'](_0x212c12){const _0x3cfe9d=this['editor']['plugins']['get']('AIActions'),_0x1e4f83=_0x212c12['prompt']?{'userMessage':_0x212c12['prompt'],'model':_0x212c12['model']}:{'actionName':_0x212c12['actionName']||_0x212c12['id'],'args':_0x212c12['args']},_0x5aebc6=this['_handleAIActionsActionLabel'](_0x212c12);await _0x3cfe9d['executeAction'](_0x1e4f83,_0x5aebc6,_0x212c12['icon']);}}class qa extends _0x12af0a{static get['pluginName'](){return'AIQuickActionsEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x1e26a6=this['editor'],_0xcf7c1e=new $a(this['editor']);if(_0x1e26a6['commands']['add']('aiQuickAction',_0xcf7c1e),_0x1e26a6['plugins']['has']('AIChat')){const _0x469bc0=this['editor']['plugins']['get']('AIChatController');_0x1e26a6['model']['document']['selection']['on']('change:range',(_0x109285,_0x161834)=>{_0x161834['directChange']&&_0x469bc0['removeSelectionFromChatContext']();});}}}class Qa extends Ps{['updateChangeGroups'](){if(this['parsedMergedContent']=this['parsedContent']['cloneNode'](!0x0),0x0==this['parsedMergedContent']['childNodes']['length'])return void(this['changeGroups']=[]);const _0x240c17=this['documentContextContent']['children']['map'](_0x4c124c=>({'node':_0x4c124c,'id':ms(_0x4c124c,'data-id')})),_0x470d55=this['parsedMergedContent']['children']['map'](_0x5b2667=>({'node':_0x5b2667,'id':ms(_0x5b2667,'data-id')||ot()})),_0x30b52c=_0xc4e7e2(_0x240c17,_0x470d55,{'comparator':(_0x3c374e,_0x3ecfbe)=>_0x3c374e['id']==_0x3ecfbe['id'],'oneChangePerToken':!0x0});if(!this['isDone']){for(;_0x30b52c['length']&&_0x30b52c[_0x30b52c['length']-0x1]['removed'];)_0x30b52c['pop']();}const _0x566aba=_0x30b52c['map'](_0x49241=>{const _0x377243=_0x49241['added']?'new':_0x49241['removed']?'removed':'modified';return{'node':_0x49241['value'][0x0]['node'],'type':_0x377243,'id':_0x49241['value'][0x0]['id']};});this['changeGroups']=[{'changes':_0x566aba,'state':'pending','index':0x0}];}['_getDifferentChangeGroups'](_0x4a88d6,_0x4c3c54){return _0x4c3c54;}}class Xa extends Ms{['content'];['version'];['actionName'];['args'];['userMessage'];['model'];['hasError']=!0x1;constructor(_0x2c7297){super(_0x2c7297),this['content']=_0x2c7297['content'],this['version']=_0x2c7297['version'],this['actionName']=_0x2c7297['actionName'],this['args']=_0x2c7297['args'],this['userMessage']=_0x2c7297['userMessage'],this['model']=_0x2c7297['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':Us['TEXT'],'content':this['content'],'version':this['version'],'label':'Current\x20document','uiId':'current-document'};}['createReply'](_0x16bbfb){const _0x48e5d6=new Qa({'editor':this['editor'],'documentContextContent':this['content'],..._0x16bbfb});return this['replies']['push'](_0x48e5d6),_0x48e5d6['delegate'](...Hs)['to'](this),this['fire']('replyCreated',_0x48e5d6),_0x48e5d6;}}class za extends kt{constructor(_0x206030,_0x55b7ff=!0x0,_0xe1e77b=!0x0){super(_0x206030),this['set']('isEnabled',!0x1),_0x55b7ff&&(this['applyButton']=this['_createButton'](us(_0x206030,'AI_BALLOON_APPLY_BUTTON'),ds),this['applyButton']['bind']('isEnabled')['to'](this),this['items']['add'](this['applyButton'])),_0xe1e77b&&(this['suggestButton']=this['_createButton'](us(_0x206030,'AI_BALLOON_SUGGEST_BUTTON'),_0x55b7ff?_s:ds),this['suggestButton']['bind']('isEnabled')['to'](this),this['items']['add'](this['suggestButton'])),this['setButtonsVisibility']({'showApplyButton':_0x55b7ff,'showSuggestButton':_0xe1e77b}),this['extendTemplate']({'attributes':{'class':['ck-ai-balloon__toolbar']}});}['setButtonsVisibility']({showApplyButton:_0x500467,showSuggestButton:_0xeca9fc}){this['applyButton']&&(this['applyButton']['isVisible']=_0x500467),this['suggestButton']&&(this['suggestButton']['isVisible']=_0xeca9fc);}['_createButton'](_0x2be7a3,_0x58d950){const _0x25e023=new Nt(this['locale']);return _0x25e023['set']({'label':_0x2be7a3,'class':_0x58d950,'isVisible':!0x0,'withText':!0x0}),_0x25e023;}}class ja extends vt{constructor(_0x3d1457){super(_0x3d1457),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-balloon__disclaimer']},'children':[{'tag':'p','attributes':{'class':['ck','ck-ai-balloon__disclaimer-content']},'children':[{'text':us(_0x3d1457,'AI_DISCLAIMER_TEXT')}]}]});}}class Ja extends vt{constructor(_0x12b394){super(_0x12b394),this['set']('isVisible',!0x0);const _0x27ec09=new vn('small');_0x27ec09['isVisible']=!0x0;const _0x9e508b=new vt(this['locale']);_0x9e508b['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-suggestion__loader-text']},'children':[us(this['locale'],'AI_CHAT_IS_WRITING')]}),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__loader',this['bindTemplate']['if']('isVisible','ck-hidden',_0x16c2fd=>!_0x16c2fd)]},'children':[_0x27ec09,_0x9e508b]});}}class Za extends Ra{['focusCycler'];['_config'];['_contentWrapper'];['_streamableContentView'];['_toolbarView'];['_miniToolbarView'];['_loaderView'];['_disclaimerView'];['_focusTracker'];['_keystrokes'];['_dialogContent'];['_focusables'];['_scrollManager'];['_navigationPreviousButton'];['_navigationNextButton'];['_navigationTryAgainButton'];['_navigationCounter'];constructor(_0x22284a,_0x5df422){super(_0x22284a),this['set']('isBusy',!0x1),this['set']('isTrackChangesOn',!0x1),this['set']('_isLoading',!0x1),this['set']('_hasError',!0x1),this['_config']=_0x5df422,this['_focusTracker']=new At(),this['_keystrokes']=new gt(),this['_focusables']=this['createCollection'](),this['focusCycler']=new Ut({'focusables':this['_focusables'],'focusTracker':this['_focusTracker'],'keystrokeHandler':this['_keystrokes'],'actions':{'focusPrevious':'shift\x20+\x20tab','focusNext':'tab'}}),this['_dialogContent']=new _0x5df866(),this['_addContentWrapper'](_0x5df422),this['_addDisclaimerView'](),this['_addToolbar'](_0x5df422),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'](_0x5df422);});}['render'](){super['render']();for(const _0x325462 of this['_focusables'])this['_focusTracker']['add'](_0x325462['element']);this['_keystrokes']['listenTo'](this['element']),this['_initializeScrollManager']();}['destroy'](){super['destroy'](),this['_scrollManager']&&this['_scrollManager']['destroy']();}['focus'](_0x19cd25){-0x1===_0x19cd25?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}['setIsLoading'](_0x35f60b){this['_isLoading']=_0x35f60b;}['setErrorState'](){this['_hasError']=!0x0,this['_miniToolbarView']['toggleShowChangesEnabled'](!0x1);}['clearErrorState'](){this['_hasError']=!0x1,this['_miniToolbarView']['toggleShowChangesEnabled'](!0x0);}['showError'](_0x12e7c0){super['showError'](_0x12e7c0),this['_dialogContent']['has'](this['_errorView'])||this['_dialogContent']['add'](this['_errorView'],0x0);}['hideError'](){super['hideError'](),this['clearErrorState']();}['showBlockingError'](_0x558bd2){super['showBlockingError'](_0x558bd2),this['setErrorState']();}['addMiniToolbarItem'](_0x43ea76){this['_miniToolbarView']['items']['has'](_0x43ea76)||this['_miniToolbarView']['items']['add'](_0x43ea76);}['removeMiniToolbarItem'](_0x31074c){this['_miniToolbarView']['items']['has'](_0x31074c)&&this['_miniToolbarView']['items']['remove'](_0x31074c);}['showLoader'](){this['_loaderView']&&(this['_isLoading']=!0x0);}['hideLoader'](){this['_loaderView']&&(this['_isLoading']=!0x1);}['_toggleToolbarButtonsVisibility']({showApplyButton:_0x5321a8,showSuggestButton:_0x16f9a3}){_0x5321a8=_0x5321a8&&!this['isTrackChangesOn']&&this['_config']['availableActions']['includes']('applySuggestion'),_0x16f9a3=_0x16f9a3&&this['_config']['availableActions']['includes']('insertSuggestion'),this['_toolbarView']['setButtonsVisibility']({'showApplyButton':_0x5321a8,'showSuggestButton':_0x16f9a3});}async['updateContent'](_0x4ee40c){await this['_streamableContentView']['update'](_0x4ee40c);}['clearContent'](){this['_streamableContentView']['clear']();}['_addContentWrapper'](_0x1324b0){this['_contentWrapper']=new vt(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'](_0x1324b0['miniToolbarConfig'])]}),this['_dialogContent']['add'](this['_contentWrapper']);}['_addDisclaimerView'](){this['_disclaimerView']=new ja(this['locale']),this['_dialogContent']['add'](this['_disclaimerView']);}['_addToolbar']({showApplyButton:_0x2f8cda,showSuggestButton:_0x17238c}){this['_toolbarView']=new za(this['locale'],_0x2f8cda,_0x17238c),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',(_0x3903cc,_0x5839c3,_0x26d9d5)=>!(_0x3903cc||_0x5839c3||_0x26d9d5)),this['_toggleToolbarButtonsVisibility']({'showApplyButton':_0x2f8cda,'showSuggestButton':_0x17238c}),this['_dialogContent']['add'](this['_toolbarView']);}['_createMiniToolbar'](_0x8e3cb6){return this['_miniToolbarView']=new Na(this['locale'],_0x8e3cb6),this['_miniToolbarView']['delegate'](...en)['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',(_0x43e2e9,_0x10d694)=>!(_0x43e2e9||_0x10d694)),this['_miniToolbarView'];}['_createLoaderView'](){return this['_loaderView']=new Ja(this['locale']),this['_loaderView']['bind']('isVisible')['to'](this,'_isLoading'),this['_loaderView'];}['_createStreamableContentView'](){return this['_streamableContentView']=new pn(this['locale']),this['_streamableContentView'];}['_setupMiniToolbarButtons'](){const _0x4676c8=new Nt(this['locale']),_0x391d20=new Nt(this['locale']),_0x3285ec=new to(this['locale']),_0x52c56a=new Nt(this['locale']);_0x4676c8['set']({'icon':et,'label':us(this['locale'],'AI_ACTIONS_TRY_AGAIN'),'tooltip':!0x0,'class':'ck-ai-custom-action-button\x20'+As}),_0x391d20['set']({'icon':_0x2eda47,'tooltip':us(this['locale'],'AI_ACTIONS_PREVIOUS_INTERACTION'),'class':'ck-ai-navigation-button\x20ck-ai-previous-button\x20'+As}),_0x52c56a['set']({'icon':it,'tooltip':us(this['locale'],'AI_ACTIONS_NEXT_INTERACTION'),'class':'ck-ai-navigation-button\x20ck-ai-next-button\x20'+As}),_0x4676c8['bind']('isEnabled')['to'](this,'isBusy',_0x4d41ec=>!_0x4d41ec),_0x4676c8['on']('execute',()=>{this['fire']('tryAgain');}),_0x391d20['bind']('isEnabled')['to'](this,'isBusy',_0x2dfe3a=>!_0x2dfe3a),_0x391d20['on']('execute',()=>{this['fire']('showPrevious');}),_0x52c56a['bind']('isEnabled')['to'](this,'isBusy',_0x33066d=>!_0x33066d),_0x52c56a['on']('execute',()=>{this['fire']('showNext');}),this['_navigationPreviousButton']=_0x391d20,this['_navigationCounter']=_0x3285ec,this['_navigationNextButton']=_0x52c56a,this['_navigationTryAgainButton']=_0x4676c8;}['updateMiniToolbarButtons'](_0x16a466,_0x5cd3d9){this['_navigationPreviousButton']||this['_setupMiniToolbarButtons']();const _0x4b5678=_0x16a466>0x1;if(this['addMiniToolbarItem'](this['_navigationTryAgainButton']),_0x4b5678){this['addMiniToolbarItem'](this['_navigationPreviousButton']),this['addMiniToolbarItem'](this['_navigationCounter']),this['addMiniToolbarItem'](this['_navigationNextButton']);const _0x1a11bd=_0x16a466-_0x5cd3d9;this['_navigationCounter']['setInteractionCount'](_0x1a11bd+'/'+_0x16a466),this['_navigationPreviousButton']['isEnabled']=_0x5cd3d9<_0x16a466-0x1,this['_navigationNextButton']['isEnabled']=_0x5cd3d9>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'](_0x1a26c8){this['_isLoading']=_0x1a26c8;}['resetShowChangesButton'](){this['_miniToolbarView']['isShowChangesOn']=!0x1;}['_initializeScrollManager'](){const _0x47b267=this['_getScrollableElement']();_0x47b267&&!this['_scrollManager']&&(this['_scrollManager']=new ir(_0x47b267));}['_getScrollableElement'](){return this['_streamableContentView']['element'];}}class to extends vt{constructor(_0x2b0711){super(_0x2b0711);const _0x2f245f=this['bindTemplate'];this['set']('interactionCount','1/1'),this['setTemplate']({'tag':'span','attributes':{'class':['ck-ai-interaction-counter']},'children':[{'text':_0x2f245f['to']('interactionCount')}]});}['setInteractionCount'](_0x4c9f04){this['set']('interactionCount',_0x4c9f04);}}class eo extends _0x12af0a{static get['requires'](){return[ls,Bt,tn,ka,_0x27dffc];}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(_0x1b3e3e){super(_0x1b3e3e),this['_bodyCollection']=new Qt(this['editor']['locale']),this['_bodyCollection']['attachToDom'](),this['_aiConnector']=this['editor']['plugins']['get']('AIConnector'),this['set']('isBusy',!0x1),this['_promiseQueue']=new mn();}['stopInteraction'](){this['_stopInteraction']();}async['executeAction'](_0x78e1e,_0xa67ad4,_0x2bd479){if(this['_stopInteraction'](),this['editor']['plugins']['has']('TableSelection')){if(this['editor']['plugins']['get']('TableSelection')['getSelectedTableCells']()){const {modelFragment:_0x5d7745,anchorData:_0x576388}=this['_getExecuteDataInTable']();return this['_executeAction'](_0x78e1e,_0x5d7745,_0x576388,_0xa67ad4,_0x2bd479);}}const {modelFragment:_0xc3e98,anchorData:_0x213249}=this['_getExecuteDataRegular']();return this['_executeAction'](_0x78e1e,_0xc3e98,_0x213249,_0xa67ad4,_0x2bd479);}async['destroy'](){return this['_stopInteraction'](),this['_bodyCollection']['detachFromDom'](),super['destroy']();}['_createActionsBalloonView'](){const _0x452023=this['editor']['plugins']['has']('TrackChanges');let _0x3cc42f=this['editor']['config']['get']('ai.availableReplyActions')||[...wn];_0x452023||(_0x3cc42f=_0x3cc42f['filter'](_0x1e503c=>'insertSuggestion'!=_0x1e503c));const _0x18d7c9=this['editor']['commands']['get']('trackChanges'),_0x255ee3=new Za(this['editor']['locale'],{'showApplyButton':!0x0,'showSuggestButton':_0x452023,'miniToolbarConfig':{'showChanges':'icon'},'availableActions':_0x3cc42f});return _0x255ee3['bind']('isBusy')['to'](this),_0x18d7c9&&_0x255ee3['bind']('isTrackChangesOn')['to'](_0x18d7c9,'value'),_0x255ee3['on']('tryAgain',()=>{this['_refreshInteraction']();}),_0x255ee3['on']('showPrevious',()=>{this['_navigateToPrevious']();}),_0x255ee3['on']('showNext',()=>{this['_navigateToNext']();}),_0x255ee3;}['_getExecuteDataRegular'](){const _0x21f369=this['editor']['model']['document']['selection'];if(_0x21f369['isCollapsed']){const _0xca3246=It(_0x21f369['getSelectedBlocks']())||this['editor']['model']['schema']['getLimitElement'](_0x21f369);this['editor']['model']['change'](_0x49fbaf=>{_0x49fbaf['setSelection'](_0xca3246,'in');});}const _0x1b68e4=_0x21f369['getFirstRange'](),_0x25efe3=this['_wrapWithCommonAncestors'](this['editor']['model']['getSelectedContent'](_0x21f369),_0x1b68e4['start'],_0x1b68e4['end']);this['_copyMarkersToFragment'](_0x25efe3,_0x21f369,{'isTableSelection':!0x1});const _0x7796fc=_0x21f369['getFirstRange']()['start'],_0x2a0a43=new Map();let _0x180655=_0x25efe3;for(let _0x29606f=0x0;_0x29606f<_0x7796fc['path']['length'];_0x29606f++)_0x2a0a43['set'](_0x180655,_0x7796fc['path'][_0x29606f]),_0x180655=_0x180655['getChild'](0x0);return{'modelFragment':_0x25efe3,'anchorData':_0x2a0a43};}['_getExecuteDataInTable'](){const _0x1a8968=this['editor']['model']['document']['selection'],_0x5df3a8=this['editor']['plugins']['get']('TableSelection')['getSelectionAsFragment'](),_0x104926=_0x1a8968['getFirstRange']()['start']['parent']['parent'],_0x5106be=this['editor']['model']['createRange'](this['editor']['model']['createPositionBefore'](_0x104926),this['editor']['model']['createPositionAfter'](_0x104926)),_0x24f25e=this['_wrapWithCommonAncestors'](_0x5df3a8,_0x5106be['start'],_0x5106be['end']);this['_copyMarkersToFragment'](_0x24f25e,_0x1a8968,{'isTableSelection':!0x0});const _0x14a11c=_0x1a8968['getFirstRange']()['start'],_0x9fd512=new Map();let _0x149bb6=_0x24f25e;for(let _0x5e37bb=0x0;_0x5e37bb<_0x14a11c['path']['length'];_0x5e37bb++)if(_0x9fd512['set'](_0x149bb6,_0x14a11c['path'][_0x5e37bb]),_0x5e37bb<_0x14a11c['path']['length']-0x1)_0x149bb6=_0x149bb6['getChild'](0x0);else{let _0x132623=_0x149bb6['nextSibling'];for(;_0x132623;)_0x9fd512['set'](_0x132623,_0x14a11c['path'][_0x5e37bb]),_0x132623=_0x132623['nextSibling'];}return{'modelFragment':_0x24f25e,'anchorData':_0x9fd512};}async['_executeAction'](_0x2a242b,_0x542662,_0x31745a,_0x3288df,_0x42a3a5){const _0x28b8da=this['editor']['plugins']['get'](tn),_0x23c75e=this['editor']['plugins']['get'](ka),_0x4ad418=this['editor']['model']['document']['selection'],_0x2544b8=await _0x28b8da['modelToDataWithIds'](_0x542662),_0x295ff1=this['editor']['model']['document']['version'],_0x10becc=[..._0x4ad418['getRanges']()];return this['_actionsBalloonView']||(this['_actionsBalloonView']=this['_createActionsBalloonView']()),this['_clearInteractionHistory'](),this['_clearErrorState'](),this['_balloonShowDiff']=!0x1,this['_actionsBalloonView']['resetShowChangesButton'](),this['_actionsBalloonView']['clearContent'](),_0x23c75e['open']({'index':0x3e8*Math['random']()%0x3e8,'title':_0x3288df,'icon':_0x42a3a5||_0x5f32e3,'mainView':this['_actionsBalloonView'],'class':'ck-ai-actions-balloon','ranges':_0x10becc,'id':'aiActionsBalloon'}),this['_setLoadingState'](),this['stopListening'](this['_actionsBalloonView']),this['stopListening'](_0x23c75e),this['_interactionParams']={'action':_0x2a242b,'content':_0x2544b8,'version':_0x295ff1,'aiBalloon':_0x23c75e,'modelFragment':_0x542662,'anchorData':_0x31745a},this['_setupApplyListeners'](),this['listenTo'](_0x23c75e,'selectionRemoved',()=>{this['_stopInteraction'](),this['_actionsBalloonView']['disableMiniToolbarButtons']();}),this['listenTo'](_0x23c75e,'dialogClosed',(_0x4a7722,{id:_0x23a4d3})=>{if('aiActionsBalloon'===_0x23a4d3){if(this['_interaction']&&this['_interaction']['replies']['length']>0x0){const _0x14c0e6=this['_interaction']['replies'][this['_interaction']['replies']['length']-0x1],_0x4ea35f=_0x14c0e6['changeGroups'][0x0];_0x4ea35f&&'pending'===_0x4ea35f['state']&&_0x14c0e6['setChangeGroupState'](0x0,'rejected');}this['_stopInteraction'](),this['_clearInteractionHistory'](),this['stopListening'](this['_actionsBalloonView']),this['stopListening'](_0x23c75e);}}),this['_createInteraction'](_0x2544b8,_0x295ff1,_0x23c75e,_0x2a242b);}['_setupApplyListeners'](){if(!this['_interactionParams'])return;const {modelFragment:_0x429844,anchorData:_0x436672}=this['_interactionParams'];this['listenTo'](this['_actionsBalloonView'],'applySuggestion',()=>{this['_applyChanges'](_0x429844,_0x436672,!0x1);}),this['listenTo'](this['_actionsBalloonView'],'insertSuggestion',()=>{this['_applyChanges'](_0x429844,_0x436672,!0x0);});}['_wrapWithCommonAncestors'](_0x23d6ce,_0x3afb8e,_0x2b4621){const _0x149ddd=this['editor']['model']['createRange'](_0x3afb8e,_0x2b4621)['getCommonAncestor'](),_0x32f543=_0x149ddd['is']('documentFragment')?[]:_0x149ddd['getAncestors']({'includeSelf':!0x0})['slice'](0x1);if(_0x32f543['length']){const _0x4deab7=_0x32f543['map'](_0x1d0231=>_0x1d0231['_clone'](!0x1));for(let _0x689cb6=0x1;_0x689cb6<_0x4deab7['length'];_0x689cb6++)_0x4deab7[_0x689cb6-0x1]['_appendChild'](_0x4deab7[_0x689cb6]);return _0x4deab7[_0x4deab7['length']-0x1]['_appendChild'](_0x23d6ce),new _0x370ccf(_0x4deab7[0x0]);}return _0x23d6ce;}['_copyMarkersToFragment'](_0x102075,_0x425bbb,_0x4a1cea={'isTableSelection':!0x1}){const _0x5ca9c3=this['editor']['model'],_0x295cf0=Array['from'](_0x425bbb['getRanges']()),_0x3cdeb1=_0x425bbb['getFirstRange']()['start'];for(const _0x4d136a of _0x5ca9c3['markers']){if(_0x4d136a['name']['startsWith'](Zs)||!_0x4d136a['affectsData'])continue;const _0x26fbfe=_0x4d136a['getRange']();if(!_0x295cf0['some'](_0x145d3e=>_0x145d3e['containsRange'](_0x26fbfe,!0x0)))continue;const _0x44c247=this['_regularCalculateMarkerPath'](_0x26fbfe['start'],_0x3cdeb1,_0x4a1cea['isTableSelection']),_0x43508d=this['_regularCalculateMarkerPath'](_0x26fbfe['end'],_0x3cdeb1,_0x4a1cea['isTableSelection']),_0x2cdea4=_0x5ca9c3['createPositionFromPath'](_0x102075,_0x44c247),_0x417341=_0x5ca9c3['createPositionFromPath'](_0x102075,_0x43508d);if(!_0x2cdea4['isEqual'](_0x417341)){const _0x1b960b=_0x5ca9c3['createRange'](_0x2cdea4,_0x417341);_0x102075['markers']['set'](_0x4d136a['name'],_0x1b960b);}}}['_regularCalculateMarkerPath'](_0x419fd3,_0x560bef,_0x1e57f8=!0x1){const _0x431210=[..._0x419fd3['path']['slice']()];for(let _0x238bfe=0x0;_0x238bfe<Math['max'](_0x560bef['path']['length'],_0x419fd3['path']['length']);_0x238bfe++){const _0x27a2a0=_0x560bef['path'][_0x238bfe]||0x0,_0x11a301=(_0x419fd3['path'][_0x238bfe]||0x0)-_0x27a2a0;if(_0x431210[_0x238bfe]=_0x11a301,0x0!==_0x11a301&&!_0x1e57f8)break;}return _0x431210;}async['_createInteraction'](_0x252ae0,_0x2ff6d0,_0x521dce,_0x53bac8){const _0x192173=this['editor'];this['_interactionParams']||(this['_interactionParams']={'action':_0x53bac8,'content':_0x252ae0,'version':_0x2ff6d0,'aiBalloon':_0x521dce,'modelFragment':this['editor']['model']['getSelectedContent'](this['editor']['model']['document']['selection']),'anchorData':new Map()});const _0x37fa72=new Xa({'connector':this['_aiConnector'],'editor':_0x192173,'content':_0x252ae0,'version':_0x2ff6d0,..._0x53bac8});this['_interactions']['push'](_0x37fa72);const _0xc082de=(_0x425b84,_0x1390b8=!0x1,_0x334d81='streaming')=>this['_promiseQueue']['enqueue'](async _0x532765=>{try{const _0x4b6c07=Ns({'editor':_0x192173,'changeGroups':_0x425b84['changeGroups'],'documentContextContent':_0x425b84['documentContextContent'],'showDiff':_0x1390b8,'trimUnchanged':!0x1});_0x4b6c07['length']&&await this['_actionsBalloonView']['updateContent']({'part':_0x4b6c07[0x0],'renderingStrategy':_0x334d81,'abortSignal':_0x532765});}catch(_0x27b2c8){if(this['_isAbortError'](_0x27b2c8))return;throw _0x27b2c8;}});this['_interaction']['on']('replyCreated',(_0x9bc48c,_0x379b91)=>{this['_actionsBalloonView']['hideLoader'](),this['_actionsBalloonView']['startAutoScroll'](),_0xc082de(_0x379b91)['catch'](_0x509957=>{this['_isAbortError'](_0x509957)||(console['error']('Error\x20updating\x20content\x20in\x20replyCreated:',_0x509957),this['_setErrorState'](_0x37fa72));});}),this['_interaction']['on']('replyContentUpdated',(_0x59d530,_0x4fe08a)=>{_0xc082de(_0x4fe08a)['catch'](_0x4f2650=>{this['_isAbortError'](_0x4f2650)||(console['error']('Error\x20updating\x20content\x20in\x20replyContentUpdated:',_0x4f2650),this['_setErrorState'](_0x37fa72));});}),this['_interaction']['on']('interactionFinished',async()=>{try{await this['_clearLoadingState'](),this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']),await this['_promiseQueue']['queueEmptyPromise'];}catch(_0xf58200){this['_isAbortError'](_0xf58200)||(console['error']('Error\x20clearing\x20loading\x20state\x20in\x20interactionFinished:',_0xf58200),this['_setErrorState'](_0x37fa72));}finally{this['_actionsBalloonView']['stopAutoScroll']();}}),this['listenTo'](this['_actionsBalloonView'],'toggleSuggestionDisplayMode',async(_0x270110,{showDiff:_0x34c10a})=>{try{this['_balloonShowDiff']=_0x34c10a;const _0x21f1e4=this['_interaction']['replies'][this['_interaction']['replies']['length']-0x1];_0x21f1e4&&await _0xc082de(_0x21f1e4,_0x34c10a,'static');}catch(_0x26949a){this['_isAbortError'](_0x26949a)||(console['error']('Error\x20updating\x20content\x20in\x20toggleSuggestionDisplayMode:',_0x26949a),this['_setErrorState'](_0x37fa72));}}),this['_interaction']['on']('replyChangeGroupStateUpdated',(_0x17c4da,{reply:_0x294971})=>{const _0x404ffe={'positiveCount':_0x294971['changeGroups']['filter'](_0x5d4ca5=>'accepted'===_0x5d4ca5['state'])['length'],'totalCount':_0x294971['changeGroups']['length']},_0x23ae30=this['_interaction']['actionCallId'],_0x2857fc=this['_interaction']['actionName'];_0x2857fc?this['_aiConnector']['upsertAIActionRating'](_0x2857fc,_0x23ae30,_0x404ffe):this['_aiConnector']['upsertCustomAIActionRating'](_0x23ae30,_0x404ffe);}),this['_setLoadingState']();try{const _0x227a68=await this['_interaction']['start']();return this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']),_0x227a68;}catch(_0x40616e){if(this['_isAbortError'](_0x40616e))return;this['_actionsBalloonView']['hideLoader'](),this['_setErrorState'](_0x37fa72);}}['_applyChanges'](_0x3a4e9a,_0x431748,_0x132f63){const _0x2024a6=this['editor'];if(_0x132f63&&!_0x2024a6['plugins']['has']('TrackChanges'))throw new ht('ai-no-track-changes',null);const _0x5b364b=this['editor']['plugins']['get'](_0x27dffc),_0x12942b=this['_interactions'][this['_interactions']['length']-0x1-this['_currentInteractionIndex']];if(!_0x12942b||!_0x12942b['replies']['length'])return;const _0x13416e=_0x12942b['replies'][_0x12942b['replies']['length']-0x1],_0x3c31ba=_0x13416e['changeGroups'];_0x13416e['setChangeGroupState'](0x0,'accepted');let _0x3f0314=zs({'editor':_0x2024a6,'reply':_0x13416e,'interaction':_0x12942b,'groups':_0x3c31ba,'transform':!0x1,'documentCompare':_0x5b364b,'documentCompareOptions':{'anchor':_0x2024a6['model']['createPositionAt'](_0x3a4e9a,0x0),'markDeletions':_0x132f63}});_0x3f0314=this['_filterOperationsOutsideRange'](_0x3f0314,_0x431748);for(const _0x1c5fcb of _0x3f0314)this['_anchorOperation'](_0x431748,_0x1c5fcb,_0x2024a6['model']['document']['getRoot']());const _0x3f382b=_0x12942b['getDocumentContext']()['version'],_0x182812=_0x2024a6['model']['document']['history']['getOperations'](_0x3f382b),_0x5a8726={'document':_0x2024a6['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1},_0x231d62=_0x5ad7d5(_0x3f0314,_0x182812,_0x5a8726)['operationsA'];_0x2024a6['model']['change'](_0x4a8f48=>{if(_0x4a8f48['setSelection'](_0x2024a6['model']['document']['selection']['focus']),_0x132f63)_0x2024a6['plugins']['get']('TrackChangesEditing')['_applyOperationsAsSuggestions'](_0x231d62);else{for(const _0xe18470 of _0x231d62)_0xe18470['baseVersion']=_0x2024a6['model']['document']['version'],js(_0x2024a6,_0xe18470),_0x4a8f48['batch']['addOperation'](_0xe18470),_0x2024a6['model']['applyOperation'](_0xe18470);}}),this['editor']['plugins']['get']('AIBalloon')['close']();}['_filterOperationsOutsideRange'](_0x4800cb,_0x39e376){return _0x4800cb['filter'](_0x22cc30=>{if('rename'==_0x22cc30['type']){const _0x5d5e2e=_0x22cc30['position']['nodeAfter'];return!_0x39e376['has'](_0x5d5e2e);}if(_0x22cc30['type']['indexOf']('Attribute')>-0x1){const _0x72d056=_0x22cc30['range']['start']['nodeAfter'];return!_0x39e376['has'](_0x72d056);}return!0x0;});}['_anchorOperation'](_0x1b7429,_0x54c004,_0x439995){const _0x3f84ed=_0x54c004['clone']();for(const _0xb1ae62 in _0x54c004){const _0x337b45=_0x54c004[_0xb1ae62];_0x337b45 instanceof _0x1569aa?_0x54c004[_0xb1ae62]=new _0x1569aa(_0x359681(_0x337b45['start']),_0x359681(_0x337b45['end'])):_0x337b45 instanceof _0x2cfd1c&&(_0x54c004[_0xb1ae62]=_0x359681(_0x337b45));}if(['insert','move','remove','reinsert','split','merge']['includes'](_0x3f84ed['type'])){if(_0x3f84ed['isDocumentOperation']=!0x1,_0x3f84ed['baseVersion']=null,'remove'==_0x3f84ed['type']){const _0x5001ee=_0x3f84ed['sourcePosition'],_0xf9a963=_0x3f84ed['howMany'];new _0x538ce3(_0x5001ee,_0xf9a963)['_execute']();}else _0x3f84ed['_execute']();}function _0x359681(_0x51c371){if('$graveyard'==_0x51c371['root']['rootName'])return _0x51c371;const _0xcde1bd=[];let _0x3e8ac9=_0x51c371['root'];for(let _0x2b5538=0x0;_0x2b5538<_0x51c371['path']['length'];_0x2b5538++){const _0x4db9fd=_0x1b7429['get'](_0x3e8ac9)||0x0;_0xcde1bd[_0x2b5538]=_0x51c371['path'][_0x2b5538]+_0x4db9fd,_0x3e8ac9=_0x3e8ac9['getChildAtOffset'](_0x51c371['path'][_0x2b5538]);}return new _0x2cfd1c(_0x439995,_0xcde1bd,_0x51c371['stickiness']);}}['_refreshInteraction'](){if(!this['_interactionParams'])return;this['_interactions']['length']>0x0&&this['_stopInteraction'](),this['_currentInteractionIndex']=0x0,this['_balloonShowDiff']=!0x1;const {action:_0x660679,content:_0x40cc35,version:_0x33e030,aiBalloon:_0x1dfebd}=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'](_0x40cc35,_0x33e030,_0x1dfebd,_0x660679)['catch'](_0x4758e2=>{this['_isAbortError'](_0x4758e2)||console['error']('Error\x20refreshing\x20interaction:',_0x4758e2);});}['_isAbortError'](_0x140dca){return!!_0x140dca['message']&&_0x140dca['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 _0x243371=this['_interactions']['length'];this['_currentInteractionIndex']<_0x243371-0x1&&this['_displayInteractionAtIndex'](this['_currentInteractionIndex']+0x1);}['_navigateToNext'](){this['_currentInteractionIndex']>0x0&&this['_displayInteractionAtIndex'](this['_currentInteractionIndex']-0x1);}async['_displayInteractionAtIndex'](_0xa2a561){if(!this['_interactionParams'])return;this['_currentInteractionIndex']=_0xa2a561;const _0x1a0905=this['_interactions'][this['_interactions']['length']-0x1-this['_currentInteractionIndex']];if(!_0x1a0905)return;if(_0x1a0905['hasError'])return this['_setErrorState'](_0x1a0905),void this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']);if(!_0x1a0905['replies']['length'])return;this['_actionsBalloonView']['hideError'](),this['_interactionParams']&&this['_clearErrorState']();const _0x3811bd=_0x1a0905['replies'][_0x1a0905['replies']['length']-0x1];if(_0x3811bd){const _0x345897=this['editor'];try{const _0xae64a3=Ns({'editor':_0x345897,'changeGroups':_0x3811bd['changeGroups'],'documentContextContent':_0x3811bd['documentContextContent'],'showDiff':this['_balloonShowDiff'],'trimUnchanged':!0x1});await new Promise(_0x5a207d=>setTimeout(_0x5a207d,0x32)),await this['_actionsBalloonView']['updateContent']({'part':_0xae64a3[0x0],'renderingStrategy':'static','abortSignal':new AbortController()['signal']});}catch(_0x54365b){this['_isAbortError'](_0x54365b)||console['error']('Error\x20updating\x20content\x20during\x20navigation:',_0x54365b);}}this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']);}['_setLoadingState'](){this['_actionsBalloonView']['setIsLoading'](!0x0),this['isBusy']=!0x0;}async['_setErrorState'](_0x28c489){const _0x1eb7ba=us(this['editor']['locale'],'AI_ACTIONS_GENERIC_ERROR');this['_actionsBalloonView']['showError'](_0x1eb7ba),_0x28c489['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);}}var io=function(_0x5dc1db){return _0x5dc1db['CONTINUE']='continue',_0x5dc1db['FIX_GRAMMAR']='fix-grammar',_0x5dc1db['IMPROVE_WRITING']='improve-writing',_0x5dc1db['MAKE_LONGER']='make-longer',_0x5dc1db['MAKE_SHORTER']='make-shorter',_0x5dc1db['MAKE_TONE_CASUAL']='make-tone-casual',_0x5dc1db['MAKE_TONE_FORMAL']='make-tone-formal',_0x5dc1db['TRANSLATE']='translate',_0x5dc1db;}({});class so extends _0x12af0a{static get['requires'](){return[Ya,qa,eo];}static get['pluginName'](){return'AIQuickActions';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x30ffe6){super(_0x30ffe6),_0x30ffe6['config']['define']('ai.quickActions',{'extraCommands':[],'removeCommands':[],'isSearchEnabled':!0x0});}}var no=function(_0x39863a){return _0x39863a['CHAT']='chat',_0x39863a['ACTION']='action',_0x39863a;}({});class ro extends vt{['resultResponseView'];['acceptButtonView'];['dismissButtonView'];['infoButtonView'];['outdatedButtonView'];constructor(_0x208822,_0x198d6f){super(_0x208822),this['id']=_0x198d6f,this['set']('status','pending'),this['set']('changeId',_0x198d6f),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',(_0x3c54d3,_0xd0f6d1)=>{_0xd0f6d1&&_0xd0f6d1['target']&&'A'===_0xd0f6d1['target']['tagName']&&_0xd0f6d1['preventDefault'](),this['fire']('activateChange',{'id':_0x198d6f,'source':this,'uiInteraction':'click'});}),this['on']('mouseover',()=>{this['fire']('activateChange',{'id':_0x198d6f,'source':this,'uiInteraction':'hover'});}),this['on']('mouseout',()=>{this['fire']('deactivateChange',{'origin':'panel','id':_0x198d6f,'source':this});});}['setItemAsActive'](){this['isActive']=!0x0;}['setItemAsInactive'](){this['isActive']=!0x1;}['_createResultResponseView'](){const _0x13d754=new vt(this['locale']);return _0x13d754['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',_0x117ffb=>!_0x117ffb)]}}),_0x13d754;}['_createAcceptButtonView'](){const _0x493820=new Nt(this['locale']);return _0x493820['set']({'label':us(this['locale'],'AI_REVIEW_MODE_ACCEPT_CHANGE'),'withText':!0x0}),_0x493820['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0xacc7=>{this['fire']('acceptChange',{'id':this['changeId']}),_0xacc7['stopPropagation']();})},'attributes':{'class':[_s,'ck-ai_review__check-run-result-accept-button',this['bindTemplate']['if']('status','ck-hidden',_0x7e41bf=>'pending'!==_0x7e41bf&&'accepted'!==_0x7e41bf),this['bindTemplate']['if']('status','ck-ai_review__check-run-result-accept-button',_0x199912=>'pending'===_0x199912),this['bindTemplate']['if']('status','ck-ai_review__check-run-result-status-button',_0x26cf3e=>'accepted'===_0x26cf3e)]}}),this['on']('change:status',(_0x41eefe,_0x4c6e70,_0x23cbbc)=>{_0x493820['isEnabled']='pending'===_0x23cbbc,'accepted'===_0x23cbbc&&(_0x493820['label']=us(this['locale'],'AI_REVIEW_MODE_CHECK_STATUS_ACCEPTED'),_0x493820['icon']=_0xef6224);}),_0x493820;}['_createDismissButtonView'](){const _0xf91ee4=new Nt(this['locale']);return _0xf91ee4['set']({'label':us(this['locale'],'AI_REVIEW_MODE_DISMISS_CHANGE'),'withText':!0x0}),_0xf91ee4['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0xe08993=>{this['fire']('dismissChange',{'id':this['changeId']}),_0xe08993['stopPropagation']();})},'attributes':{'class':[As,this['bindTemplate']['if']('status','ck-hidden',_0x4f78ca=>'pending'!==_0x4f78ca&&'rejected'!==_0x4f78ca),this['bindTemplate']['if']('status','ck-ai_review__check-run-result-dismiss-button',_0x393557=>'pending'===_0x393557),this['bindTemplate']['if']('status','ck-ai_review__check-run-result-status-button',_0x12c7cd=>'rejected'===_0x12c7cd)]}}),this['on']('change:status',(_0xc072c2,_0x44bde8,_0x499642)=>{_0xf91ee4['isEnabled']='pending'===_0x499642,'rejected'===_0x499642&&(_0xf91ee4['label']=us(this['locale'],'AI_REVIEW_MODE_CHECK_STATUS_REJECTED'),_0xf91ee4['icon']=_0x2e72cd);}),_0xf91ee4;}['_createInfoButtonView'](){const _0x305df5=new Nt(this['locale']);return _0x305df5['set']({'label':us(this['locale'],'AI_REVIEW_MODE_LEARN_MORE'),'icon':_0x1e2df8,'tooltip':!0x0,'isToggleable':!0x0,'role':'menuitemcheckbox','class':As+'\x20ck-ai_review__check-run-result-info-button\x20ck-hidden'}),_0x305df5['bind']('isOn')['to'](this,'isInfoToggleOn',_0x4872b5=>_0x4872b5),_0x305df5['on']('execute',()=>{this['isInfoToggleOn']=!this['isInfoToggleOn'];}),_0x305df5;}['_createOutdatedButtonView'](){const _0x23e65a=new Nt(this['locale']);return _0x23e65a['set']({'label':us(this['locale'],'AI_REVIEW_MODE_CHECK_STATUS_OUTDATED'),'icon':st,'withText':!0x0,'isEnabled':!0x1}),_0x23e65a['extendTemplate']({'attributes':{'class':[As,'ck-ai_review__check-run-result-status-button',this['bindTemplate']['if']('status','ck-hidden',_0x2b7241=>'outdated'!==_0x2b7241)],'disabled':'disabled'}}),_0x23e65a;}}class ao extends Xt{['resultItemView'];['_pinnedRectIndex']=void 0x0;['_pinnedTargetElement']=void 0x0;['_pinnedTargetChangeId']=void 0x0;constructor(_0x428756,_0x3104a8){super(_0x428756),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']()),_0x3104a8['add'](this);}['render'](){super['render'](),this['_setupClickOutsideHandler']();}['updateContent'](_0x261005){this['resultItemView']['changeId']=_0x261005['id'],this['resultItemView']['resultResponseView']['element']['innerHTML']=_0x261005['contentDiffed'];}['showBalloon'](_0x25dc1e,_0x1865b9,_0x19d383,_0xe5b66d,_0x5ded8a,_0x32413d){const _0x128f13=_0x1865b9();if(!_0x128f13)return;this['updateContent'](_0x25dc1e),this['show']();const _0x493e1c=Array['from'](_0x128f13['getClientRects']())['reverse'](),_0x16e4a7=this['_getPointedRectIndexFromEvent'](_0x19d383,_0x493e1c),_0x338f00=_0x493e1c[_0x16e4a7??0x0];'click'===_0xe5b66d?(this['isDiffActive']=!0x0,this['pin']({'target':()=>this['_getBestRectPositionOnClick'](_0x1865b9(),_0x16e4a7,_0x25dc1e['id'],_0x5ded8a,_0x32413d)||_0x338f00})):'hover'===_0xe5b66d&&(this['isDiffActive']=!0x1,this['pin']({'target':()=>this['_getBestRectPositionOnHover'](_0x1865b9(),_0x16e4a7,_0x25dc1e['id'])||_0x338f00}));}['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'](){zt({'emitter':this,'activator':()=>this['isVisible'],'contextElements':()=>{const _0x138536=[this['element']];return this['_pinnedTargetElement']&&_0x138536['push'](this['_pinnedTargetElement']),_0x138536;},'callback':()=>{this['hide'](),this['unpin'](),this['deactivateChange'](),this['_pinnedTargetElement']=void 0x0,this['_pinnedRectIndex']=void 0x0,this['_pinnedTargetChangeId']=void 0x0;}});}['_createContentView'](){const _0x479830=new vt();return this['resultItemView']=new ro(this['locale'],''),this['resultItemView']['resultResponseView']['extendTemplate']({'attributes':{'class':['ck-content']}}),this['resultItemView']['delegate']('acceptChange','dismissChange')['to'](this),_0x479830['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']]}]}),_0x479830;}['_getBestRectPositionOnClick'](_0x201d88,_0x38227e,_0x2ca0ec,_0x282e04,_0x5c9abb){if(!_0x201d88)return null;const _0x59bac3=this['position']['replace']('arrow_',''),_0x413aac=Array['from'](_0x201d88['getClientRects']());let _0x1d61bb,_0x42e322=_0x413aac['reverse']();return void 0x0!==_0x38227e&&this['_isPinnedRectVisible'](_0x42e322[_0x38227e],_0x282e04,_0x5c9abb)?(_0x1d61bb=_0x42e322[_0x38227e],this['_pinnedRectIndex']=_0x38227e):this['_isPinnedRectVisible'](_0x42e322[0x0],_0x282e04,_0x5c9abb)&&void 0x0===_0x38227e?_0x1d61bb=_0x42e322[0x0]:(_0x42e322='s'==_0x59bac3[0x0]?[..._0x413aac]['reverse']():_0x413aac,_0x42e322['forEach'](_0x10d8ac=>{this['_isPinnedRectVisible'](_0x10d8ac,_0x282e04,_0x5c9abb)&&(_0x1d61bb=_0x10d8ac);})),this['_pinnedTargetChangeId']=_0x2ca0ec,this['_pinnedTargetElement']=_0x201d88,_0x1d61bb||_0x201d88['getBoundingClientRect']();}['_getBestRectPositionOnHover'](_0x4a7da5,_0x301f92,_0x4767c2){if(!_0x4a7da5)return null;const _0x25b797=Array['from'](_0x4a7da5['getClientRects']())['reverse']();if(void 0x0===this['_pinnedRectIndex']&&void 0x0!==_0x301f92&&this['_pinnedTargetChangeId']!==_0x4767c2)return this['_pinnedRectIndex']=_0x301f92,this['_pinnedTargetElement']=_0x4a7da5,this['_pinnedTargetChangeId']=_0x4767c2,_0x25b797[_0x301f92];if(void 0x0!==this['_pinnedRectIndex']&&this['_pinnedTargetChangeId']===_0x4767c2){if(_0x4a7da5!==this['_pinnedTargetElement'])return Array['from'](this['_pinnedTargetElement']['getClientRects']())['reverse']()[this['_pinnedRectIndex']];return _0x25b797[this['_pinnedRectIndex']];}return void 0x0!==_0x301f92&&this['_pinnedTargetChangeId']!==_0x4767c2?(this['_pinnedRectIndex']=_0x301f92,this['_pinnedTargetElement']=_0x4a7da5,this['_pinnedTargetChangeId']=_0x4767c2,_0x25b797[_0x301f92]):_0x4a7da5['getBoundingClientRect']();}['_getPointedRectIndexFromEvent'](_0x3adc84,_0x389192){if(_0x3adc84)for(let _0x3476a8=0x0;_0x3476a8<_0x389192['length'];_0x3476a8++){const _0x267b77=_0x389192[_0x3476a8];if(_0x3adc84['clientX']>=_0x267b77['left']-0x3&&_0x3adc84['clientX']<=_0x267b77['right']+0x3&&_0x3adc84['clientY']>=_0x267b77['top']-0x3&&_0x3adc84['clientY']<=_0x267b77['bottom']+0x3)return _0x3476a8;}}['_isPinnedRectVisible'](_0x1d2610,_0x40155b,_0x19b431){const _0x1941e8=new dt(_0x1d2610),_0x46d71c=_0x40155b||document['documentElement'],_0x2c4182=_0x1941e8['getIntersection'](Rt(_0x19b431)),_0x56511b=new dt(_0x46d71c)['getIntersection'](_0x1941e8);return!!(_0x2c4182&&_0x56511b&&_0x1941e8['width']>0x0);}}const oo=['getReviewCheckList','runReviewCheck','abortReviewStream','toggleDiff','acceptAllChanges','leaveReviewCoreResultList','activateChange','deactivateChange','acceptChange','dismissChange','learnMore','finishReview','retryReview'];class ho extends _0x12c8be{['_mainView'];['_balloonSuggestionView'];['_bodyCollection'];static get['requires'](){return[cs];}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x4702c9){super(_0x4702c9),this['_bodyCollection']=new Qt(this['context']['locale']),this['_bodyCollection']['attachToDom'](),this['_mainView']=this['createMainView'](),this['_mainView']['delegate'](...oo)['to'](this),this['_balloonSuggestionView']=new ao(this['context']['locale'],this['_bodyCollection']),this['_balloonSuggestionView']['delegate']('acceptChange','dismissChange','deactivateChange')['to'](this);}['init'](){const _0x39b797=this['context']['plugins']['get']('AITabs');this['registerTab'](_0x39b797);}['destroy'](){this['_bodyCollection']['detachFromDom'](),super['destroy']();}['setAvailableChecks'](_0x35ec13){if(!this['_mainView']['reviewCheckListView']['hasChecks']()){const _0x4b390e=!this['context']['config']['get']('ai.models.showModelSelector');this['_mainView']['reviewCheckListView']['setChecks'](_0x35ec13,_0x4b390e);}this['_mainView']['showReviewCheckListView']();}['showReviewCheckList'](){this['fire']('getReviewCheckList');}['showCheckRunResults'](_0x31d35a){_0x31d35a&&('error-general'!==_0x31d35a['status']?'error-chunk'!==_0x31d35a['status']?this['_mainView']['showReviewCheckResultsView']():this['showChunkErrorView']():this['showGeneralResultsErrorView']());}['showCheckRunResult'](_0x31dced){this['_mainView']['addCheckRunResult'](_0x31dced);}['showGeneralResultsErrorView'](){this['_mainView']['showGeneralResultsErrorView']();}['showGeneralReviewCoreErrorView'](_0x18e348){this['_mainView']['showGeneralReviewCoreErrorView'](_0x18e348??us(this['context']['locale'],'AI_REVIEW_INITIALIZATION_ERROR_MESSAGE'));}['showChunkErrorView'](){this['_mainView']['showChunkErrorView']();}['setCheckResultTitle'](_0xd9eeb9,_0x24d017){this['_mainView']['reviewCheckResultsView']['setTitle'](_0xd9eeb9,_0x24d017);}['setActiveStateInResults'](_0x2f78e1){this['_mainView']['reviewCheckResultsView']['getResults']()['forEach'](_0x391508=>{_0x391508['id']===_0x2f78e1&&_0x391508['setItemAsActive']();});}['resetActiveStateInResults'](){this['_mainView']['reviewCheckResultsView']['getResults']()['forEach'](_0xfca2f8=>_0xfca2f8['setItemAsInactive']());}['updateChangeState'](_0x2725ba,_0x3a0fb2){'accepted'===_0x3a0fb2||'rejected'===_0x3a0fb2||'outdated'===_0x3a0fb2?this['_mainView']['reviewCheckResultsView']['hideResult'](_0x2725ba,_0x3a0fb2):this['_mainView']['reviewCheckResultsView']['showResult'](_0x2725ba,_0x3a0fb2);}['showReviewCompletedView'](){this['_mainView']['showReviewCompletedView']();}['showActionsWhenResultIsReady'](){this['_mainView']['showActionsWhenResultIsReady']();}['showNoChangesView'](){this['_mainView']['showNoChangesView']();}['hideActionsWhenResultIsReady'](){this['_mainView']['hideActionsWhenResultIsReady']();}['showChangeBalloon'](_0x4601ab,_0x589998,_0x572d37,_0x5d0be7,_0x5339c2,_0x13c6ac){this['_balloonSuggestionView']['showBalloon'](_0x4601ab,_0x589998,_0x572d37,_0x5d0be7,_0x5339c2,_0x13c6ac);}['hideChangeBalloon'](){this['_balloonSuggestionView']['hideBalloon']();}['hideDiffInBalloon'](){this['_balloonSuggestionView']['hideDiffInBalloon']();}['showDiffInBalloon'](){this['_balloonSuggestionView']['showDiffInBalloon']();}['getChangeElement'](_0x2a591a){const _0x4e9093=this['_mainView']['reviewCheckResultsView']['getResults']()['find'](_0x471a4c=>_0x471a4c['id']===_0x2a591a);return _0x4e9093?_0x4e9093['element']:null;}['deactivateChange'](){this['_balloonSuggestionView']['deactivateChange']();}}class co extends vt{constructor(_0x21f6aa){super(_0x21f6aa),this['set']('isVisible',!0x1),this['set']('errorMessage','');const _0x5a1bbf=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai_review__general-error-container',_0x5a1bbf['if']('isVisible','ck-hidden',_0x1325e9=>!_0x1325e9)]},'children':[{'tag':'p','attributes':{'class':'ck\x20ck-ai-notification\x20ck-ai-notification_error'},'children':[{'text':_0x5a1bbf['to']('errorMessage')}]}]});}}class lo extends vt{['reviewCoreHeader'];['generalErrorView'];['reviewCheckListView'];['reviewCheckResultsView'];['reviewCompletedView'];constructor(_0x417b2b,_0x27915f){super(_0x417b2b),this['reviewCoreHeader']=_0x27915f['header'],this['generalErrorView']=new co(_0x417b2b),this['reviewCheckListView']=_0x27915f['list'],this['reviewCheckListView']['delegate'](...oo)['to'](this),this['reviewCheckResultsView']=_0x27915f['results'],this['reviewCheckResultsView']['delegate'](...oo)['to'](this),this['reviewCompletedView']=_0x27915f['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'](_0x16b9cb){this['reviewCheckResultsView']['addResult'](_0x16b9cb),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'](_0x4a7cff){this['generalErrorView']['set']('isVisible',!0x0),this['generalErrorView']['errorMessage']=_0x4a7cff;}['showGeneralResultsErrorView'](){this['reviewCheckResultsView']['set']('isLoading',!0x1),this['showActionsWhenResultIsReady'](),this['reviewCheckResultsView']['showGeneralErrorMessage']();}['showChunkErrorView'](){this['reviewCheckResultsView']['set']('isLoading',!0x1),this['showActionsWhenResultIsReady'](),this['reviewCheckResultsView']['showChunkErrorMessage']();}}class uo extends Nt{constructor(_0x2a168c,_0x39049a){super(_0x39049a),this['set']({'label':_0x2a168c,'withText':!0x0,'class':ds}),this['on']('execute',()=>{this['fire']('finishReview');});}}class _o extends Ht{['_resultViews'];['_resultsHeader'];['reviewDisclaimer'];['_cancelButtonView'];['_acceptAllButtonView'];['_exitReviewButtonView'];['_toggleDiffButtonView'];['_errorMessageView'];['_finishReviewButtonView'];['_contents'];constructor(_0x58da95,_0x116e24){super(_0x58da95),this['_contents']=_0x116e24,this['_resultViews']=new _0x5df866(),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 na(_0x58da95),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 _0x3968df=this['_createCombinedSkeletonLoader'](),_0x13356a=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run',_0x13356a['if']('isLoading','ck-ai_review__check-run_loading',_0x17adc9=>_0x17adc9),_0x13356a['if']('isResultReady','ck-ai_review__check-run_ready',_0x30f876=>_0x30f876),_0x13356a['if']('isVisible','ck-hidden',_0x17be98=>!_0x17be98)]},'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',_0x9cd63a=>_0x9cd63a)]},'children':this['_resultViews']},_0x3968df]},this['reviewDisclaimer']]});}['clearResults'](){this['_resultViews']['clear']();}['getResults'](){return this['_resultViews'];}['addResult'](_0x2d363a){const _0xd971f7=new ro(this['locale'],_0x2d363a['id']);_0xd971f7['delegate']('acceptChange','dismissChange','activateChange','deactivateChange')['to'](this),this['_resultViews']['add'](_0xd971f7),_0xd971f7['resultResponseView']['element']['innerHTML']=_0x2d363a['contentDiffed'];}['hideResult'](_0x335ec5,_0x413016){if('pending'===_0x413016)return;const _0x53e06b=this['_resultViews']['find'](_0x1192c9=>_0x1192c9['id']===_0x335ec5);_0x53e06b&&(_0x53e06b['status']=_0x413016,_0x53e06b['element']?.['classList']['add']('ck-ai_review__check-run-result_grayout'));}['showResult'](_0x56a806,_0x4f72f8){if('pending'!==_0x4f72f8)return;const _0x3fee60=this['_resultViews']['find'](_0x3b7601=>_0x3b7601['id']===_0x56a806);_0x3fee60&&(_0x3fee60['status']=_0x4f72f8,_0x3fee60['element']?.['classList']['remove']('ck-ai_review__check-run-result_grayout'));}['setTitle'](_0x2d4991,_0x23063a){this['headerTitle']=_0x2d4991,this['headerSubtitle']=_0x23063a||'';}['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 sr(this['locale'],nr['aiReviewChecks']);}['_createCombinedSkeletonLoader'](){const _0x5b159b=new vt(this['locale']),_0x518b08=[];for(let _0x3c5e19=0x0;_0x3c5e19<0x10;_0x3c5e19++){const _0xd6b3b=this['_createSkeletonLoader']();_0xd6b3b['extendTemplate']({'attributes':{'class':['ck-ai_review__check-run-skeleton-item']}}),_0x518b08['push'](_0xd6b3b);}return _0x5b159b['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-skeleton-container',this['bindTemplate']['if']('isLoading','ck-hidden',_0x2b4e68=>!_0x2b4e68)]},'children':_0x518b08}),_0x5b159b;}['_createErrorView'](){const _0x2cea5a=new vt(this['locale']),_0x16ee2d=new Nt(this['locale']),t=this['locale']['t'];return _0x2cea5a['delegate']('retryReview')['to'](this),_0x16ee2d['set']({'label':t('Try\x20again'),'withText':!0x0,'class':_s+'\x20ck-ai_review__check-run-error-retry-button'}),_0x16ee2d['on']('execute',()=>{this['fire']('retryReview');}),_0x2cea5a['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-error-container',this['bindTemplate']['if']('showErrorMessage','ck-hidden',_0x36f344=>!_0x36f344),this['bindTemplate']['if']('errorType','ck-ai_review__check-run-error-container_border-bottom',_0x19edac=>'chunk'===_0x19edac)]},'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',_0x3d84d8=>'chunk'===_0x3d84d8)]},'children':[{'tag':'p','attributes':{'class':['ck-ai-notification__content',this['bindTemplate']['if']('errorType','ck-hidden',_0x1dfcaf=>'general'!==_0x1dfcaf)]},'children':[{'text':this['_contents']['generalErrorText']}]},{'tag':'p','attributes':{'class':['ck-ai-notification__content',this['bindTemplate']['if']('errorType','ck-hidden',_0x2ce3c9=>'chunk'!==_0x2ce3c9)]},'children':[{'text':us(this['locale'],'AI_REVIEW_MODE_CHUNK_ERROR_MESSAGE')}]}]},_0x16ee2d]}),_0x2cea5a;}['_createCancelButtonView'](){const _0xdbcd04=new Nt(this['locale']);return _0xdbcd04['set']({'label':us(this['locale'],'AI_REVIEW_MODE_STOP_GENERATING'),'withText':!0x0,'class':[_s+'\x20ck-ai-button-stop-generating'],'icon':_0x46eb32}),_0xdbcd04['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isResultReady','ck-hidden',_0x38fdff=>_0x38fdff),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x410956=>_0x410956)]}}),_0xdbcd04['on']('execute',()=>{this['fire']('abortReviewStream');}),_0xdbcd04;}['_createToggleDiffButtonView'](){const _0x329c63=new Nt(this['locale']);_0x329c63['set']({'tooltip':!0x0,'isToggleable':!0x0,'role':'menuitemcheckbox'}),_0x329c63['bind']('isEnabled')['to'](this,'isError',_0x366fe4=>!_0x366fe4),_0x329c63['extendTemplate']({'attributes':{'class':[_s,'ck-ai_review__check-run-toggle-diff-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0x4aa607=>!_0x4aa607),this['bindTemplate']['if']('isCompleted','ck-hidden',_0xf3b961=>_0xf3b961)]}});const _0x127c5e=us(this['locale'],'AI_REVIEW_MODE_HIDE_CHANGES'),_0x482b4a=us(this['locale'],'AI_REVIEW_MODE_SHOW_CHANGES');return _0x329c63['bind']('isOn')['to'](this,'isToggleDiffOn',_0x3207aa=>_0x3207aa),_0x329c63['bind']('icon')['to'](this,'isToggleDiffOn',_0x449863=>_0x449863?nt:rt),_0x329c63['bind']('label')['to'](this,'isToggleDiffOn',_0x4d4aba=>_0x4d4aba?_0x127c5e:_0x482b4a),_0x329c63['on']('execute',()=>{this['isToggleDiffOn']=!this['isToggleDiffOn'],this['fire']('toggleDiff',{'on':this['isToggleDiffOn']});}),_0x329c63;}['_createAcceptAllButtonView'](){const _0x12a376=new Nt(this['locale']);return _0x12a376['set']({'label':us(this['locale'],'AI_REVIEW_MODE_ACCEPT_ALL'),'withText':!0x0}),_0x12a376['bind']('isEnabled')['to'](this,'isError',_0x1f9b29=>!_0x1f9b29),_0x12a376['extendTemplate']({'attributes':{'class':[ds,'ck-ai_review__check-run-accept-all-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0x22f378=>!_0x22f378),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x50a0e3=>_0x50a0e3)]}}),_0x12a376['on']('execute',()=>{this['fire']('acceptAllChanges');}),_0x12a376;}['_createExitReviewButtonView'](){const _0xc830ac=new Nt(this['locale']);return _0xc830ac['set']({'label':us(this['locale'],'AI_REVIEW_MODE_EXIT_REVIEW'),'withText':!0x0}),_0xc830ac['extendTemplate']({'attributes':{'class':[As,'ck-ai_review__check-run-exit-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0x5f28f9=>!_0x5f28f9),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x435c36=>_0x435c36)]}}),_0xc830ac['on']('execute',()=>{this['fire']('leaveReviewCoreResultList');}),_0xc830ac;}['_createResultHeaderView'](){const _0x1cd357=new vt(this['locale']),_0x39d020=this['_createTitleView']();return _0x1cd357['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-header',this['bindTemplate']['if']('isCompleted','ck-ai_review__review-completed-header',_0x4c1d20=>_0x4c1d20)]},'children':[_0x39d020,{'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-header-buttons']},'children':[this['_cancelButtonView'],this['_acceptAllButtonView'],this['_exitReviewButtonView'],this['_toggleDiffButtonView'],this['_finishReviewButtonView']]}]}),_0x1cd357;}['_createTitleView'](){const _0x15f756=new vt(this['locale']),_0x432c8b=new vn();return _0x432c8b['bind']('isVisible')['to'](this,'isResultReady',_0x496557=>!_0x496557),_0x15f756['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-header-title-wrapper']},'children':[_0x432c8b,{'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-header-title-content',this['bindTemplate']['if']('isCompleted','ck-hidden',_0x18a317=>_0x18a317)]},'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',_0x8d331c=>!_0x8d331c)]},'children':[{'text':us(this['locale'],'AI_REVIEW_MODE_FINISH_REVIEW_HEADER_TITLE')}]}]}),_0x15f756;}['_createFinishReviewButtonView'](){const _0x36da2a=new uo(us(this['locale'],'AI_REVIEW_MODE_FINISH_REVIEW_BUTTON_LABEL'),this['locale']);return _0x36da2a['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isCompleted','ck-hidden',_0xc538e4=>!_0xc538e4)]}}),_0x36da2a['delegate']('finishReview')['to'](this),_0x36da2a;}}class Ao extends Ht{['_resultsHeader'];['_finishReviewButtonView'];constructor(_0x5ad137,_0x1d6c9a){super(_0x5ad137),this['_finishReviewButtonView']=this['_createFinishReviewButtonView'](_0x1d6c9a['buttonText']),this['_resultsHeader']=this['_createResultHeaderView'](_0x1d6c9a['headerText']);const _0x10e488=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__review-completed',_0x10e488['if']('isVisible','ck-hidden',_0x53793f=>!_0x53793f)]},'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':_0x1d6c9a['emptyResultsText']}]}]}]});}['_createFinishReviewButtonView'](_0x2c8a70){const _0x2b2632=new uo(_0x2c8a70,this['locale']);return _0x2b2632['delegate']('finishReview')['to'](this),_0x2b2632;}['_createResultHeaderView'](_0x2ac2fd){const _0x2dd0ff=new vt(this['locale']);return _0x2dd0ff['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':_0x2ac2fd}]},{'tag':'div','attributes':{'class':['ck-ai_review__review-completed-header-buttons']},'children':[this['_finishReviewButtonView']]}]}),_0x2dd0ff;}}class go extends vt{['_dropdownView'];['_defaultValue'];['_defaultLabel'];constructor(_0x22b503,_0x5e88b9){super(_0x22b503),this['_defaultValue']=_0x5e88b9['default']||(_0x5e88b9['data']['length']>0x0?_0x5e88b9['data'][0x0]['id']:''),this['_defaultLabel']=_0x5e88b9['data']['find'](_0x4ee1f0=>_0x4ee1f0['id']===this['_defaultValue'])?.['label']||'',this['set']('formValue',''),this['_dropdownView']=Gt(this['locale']);const _0x39f096=this['_prepareListOptions'](_0x5e88b9['data']);jt(this['_dropdownView'],_0x39f096,{'role':'menu','ariaLabel':_0x5e88b9['label']}),this['_dropdownView']['buttonView']['set']({'label':this['_defaultLabel'],'withText':!0x0}),this['_dropdownView']['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0xc966e1=>{_0xc966e1['stopPropagation']();})}}),this['listenTo'](this['_dropdownView'],'execute',_0x2d1d21=>{this['formValue']=_0x2d1d21['source']['model']['id'],this['_dropdownView']['buttonView']['label']=_0x2d1d21['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'](_0x3f971b=[]){const _0xe475d8=new _t();this['resetToDefault']();for(const _0x2201e4 of _0x3f971b){const _0x133d95=new Jt({'label':_0x2201e4['label'],'withText':!0x0,'role':'menuitemradio','id':_0x2201e4['id'],'model':_0x2201e4});_0x133d95['bind']('isOn')['to'](this,'formValue',_0x140dd3=>_0x140dd3===_0x133d95['id']);const _0x24bd4e={'type':'button','model':_0x133d95};_0xe475d8['add'](_0x24bd4e);}return _0xe475d8;}}class Io extends Ht{['_formItem']=null;constructor(_0x303ad2,_0x2cf867,_0x4b70d8){super(_0x303ad2),this['argsKey']=_0x2cf867?.['argsKey'];if('dropdown'===_0x2cf867['formType'])this['_formItem']=new go(this['locale'],_0x2cf867);this['set']('value',''),this['bind']('value')['to'](this['_formItem'],'formValue');const _0x47f595=new _0x4c4951(this['locale'],{'children':[this['_formItem']],'class':[_0x4b70d8?'ck-form__row_with-submit':'']});_0x4b70d8&&_0x47f595['children']['add'](_0x4b70d8),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai_review__form-item','ck-reset_all']},'children':[_0x47f595]});}['resetToDefault'](){this['_formItem']['resetToDefault']();}}class Eo extends _0x117148{['keystrokes'];static ['MIN_ROWS']=0x1;static ['MAX_ROWS']=0xc;constructor(_0x316875){super(_0x316875),this['set']('isEmpty',!0x0),this['keystrokes']=new gt(),this['minRows']=Eo['MIN_ROWS'],this['maxRows']=Eo['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 po extends vt{['focusTracker']=new At();['keystrokes']=new gt();['focusCycler'];['_focusables']=new _0x5df866();['submitButtonView'];['cancelButtonView'];['promptInputView'];['actionsFooterView'];['_modelSelectionDropdown'];['_modelNameView'];['_modelSelectionDropdownItems'];['_check'];['_defaultValue'];['_defaultLabel'];constructor(_0x5df02a,_0x10d150,_0x37a7a1=!0x1){super(_0x5df02a),this['_check']=_0x10d150,this['set']('prompt',''),this['set']('modelId',''),this['set']('modelDisplayMode','selector'),this['set']('activeModelName',null),this['_defaultValue']=_0x10d150['defaultModel']?_0x10d150['defaultModel']['id']:'',this['_defaultLabel']=_0x10d150['defaultModel']?_0x10d150['defaultModel']['name']:'',this['submitButtonView']=this['_createSubmitButtonView'](),this['cancelButtonView']=this['_createCancelButtonView'](),(this['promptInputView']=new te(this['locale'],()=>new Eo(_0x5df02a)),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 _t(),this['_modelNameView']=this['_createModelNameView'](),this['_setModelList'](_0x37a7a1),jt(this['_modelSelectionDropdown'],this['_modelSelectionDropdownItems']),this['actionsFooterView']=this['_createActionsFooterView'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-custom-actions']},'children':[new _0x4c4951(this['locale'],{'children':[this['promptInputView']]}),new _0x4c4951(this['locale'],{'children':[this['actionsFooterView']]})]}),this['promptInputView']['fieldView']['keystrokes']['set']('Enter',(_0x3e8c7e,_0x4062a3)=>{this['_isValid']()?(this['fire']('runReviewCheck',{'id':'custom','args':{'prompt':this['prompt'],'model':this['modelId']},'isCustom':!0x0}),_0x4062a3()):_0x4062a3();}),this['focusCycler']=new Ut({'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'](_0x267b76=>{this['_focusables']['add'](_0x267b76),this['focusTracker']['add'](_0x267b76['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 _0x47e75a of this['_getFormValidators']()){const _0x131851=_0x47e75a();if(_0x131851)return this['promptInputView']['errorText']=_0x131851,!0x1;}return!0x0;}['_getFormValidators'](){return[()=>{if(0x0===this['promptInputView']['fieldView']['value']?.['trim']()['length'])return us(this['locale'],'AI_REVIEW_MODE_PROMPT_EMPTY_ERROR');}];}['_createSubmitButtonView'](){const _0x5013ad=new Nt(this['locale']),t=this['locale']['t'];return _0x5013ad['set']({'label':t('Submit'),'withText':!0x0,'class':ds}),_0x5013ad['on']('execute',()=>{this['_isValid']()&&this['fire']('runReviewCheck',{'id':'custom','args':{'prompt':this['prompt'],'model':this['modelId']},'isCustom':!0x0});}),_0x5013ad;}['_createCancelButtonView'](){const _0x32478f=new Nt(this['locale']),t=this['locale']['t'];return _0x32478f['set']({'label':t('Cancel'),'withText':!0x0,'class':As}),_0x32478f['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x589b6d=>{_0x589b6d['stopPropagation']();})}}),_0x32478f['on']('execute',()=>{this['resetToDefault'](),this['fire']('closeCustomCheck');}),_0x32478f;}['_setModelList'](_0x16213f){this['_modelSelectionDropdownItems']['clear']();const _0x2d9f32=this['_check']['models'];if(_0x16213f)this['set']('modelDisplayMode','hidden');else{const _0x3a04c1=0x1===_0x2d9f32['length'];this['set']('modelDisplayMode',_0x3a04c1?'name':'selector');}if(this['resetToDefault'](),_0x2d9f32?.['length']){0x1===_0x2d9f32['length']&&this['set']('activeModelName',_0x2d9f32[0x0]['name']||_0x2d9f32[0x0]['id']);for(const _0x40cc2f of _0x2d9f32){const _0x3ac072=new Jt({'label':_0x40cc2f['name'],'withText':!0x0,'role':'menuitemradio','id':_0x40cc2f['id'],'model':_0x40cc2f});_0x3ac072['bind']('isOn')['to'](this,'modelId',_0x2b6471=>_0x2b6471===_0x40cc2f['id']),this['_modelSelectionDropdownItems']['add']({'type':'button','model':_0x3ac072,'labelView':new mo(this['locale'],_0x40cc2f)});}}}['_createModelSelectionDropdown'](){const _0x532a93=Gt(this['locale']);return _0x532a93['set']({'panelPosition':'se','class':'ck-ai_review__check-list-item-model-dropdown'}),_0x532a93['buttonView']['set']({'label':this['_defaultLabel'],'withText':!0x0,'tooltip':!0x0,'class':As}),_0x532a93['buttonView']['bind']('isVisible')['to'](this,'modelDisplayMode',_0x4eb94e=>'selector'===_0x4eb94e),this['listenTo'](_0x532a93,'execute',_0x278752=>{this['modelId']=_0x278752['source']['model']['id'],_0x532a93['buttonView']['label']=_0x278752['source']['label'];}),_0x532a93;}['_createModelNameView'](){const _0x4b5441=new To(this['locale']);return _0x4b5441['bind']('text')['to'](this,'activeModelName',_0x5da75a=>_0x5da75a??''),_0x4b5441['bind']('isVisible')['to'](this,'modelDisplayMode',_0x7c5e9d=>'name'===_0x7c5e9d),_0x4b5441;}['_createActionsFooterView'](){const _0x29f9dd=new vt(this['locale']);return _0x29f9dd['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']]}]}),_0x29f9dd;}}class To extends vt{constructor(_0x24ea06){super(_0x24ea06),this['set']('text',void 0x0),this['set']('isVisible',!0x0);const _0x353b3e=this['bindTemplate'];this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai_review__check-list-item-model-name',_0x353b3e['if']('isVisible','ck-hidden',_0x5bdc0d=>!_0x5bdc0d)]},'children':[{'text':_0x353b3e['to']('text')}]});}}class mo extends Mt{constructor(_0x4cd9da,_0x5e21e7){super();const _0x329114=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-button__label'],'style':_0x329114['to']('style'),'id':_0x329114['to']('id')},'children':[{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-model-dropdown-name']},'children':[{'tag':'span','children':[{'text':_0x329114['to']('text')}]}]},{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-model-dropdown-description']},'children':[{'tag':'span','children':[_0x5e21e7['description']||'']}]}]});}}class Co extends Ht{['_formItemsCollection']=new _0x5df866();['_customCheckView']=null;['_hideModels']=!0x1;constructor(_0x9efce7,_0x1633b6,_0x1b1cd8,_0x30d2ab=!0x1){super(_0x9efce7),this['_hideModels']=_0x30d2ab,this['set']('isParametrizedViewOpen',!0x1),this['set']('isListItemRendered',!0x1),this['set']('isItemParametrized',_0x1633b6['isParameterized']);const _0x2d00a6=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',_0x1833d8=>_0x1833d8),this['bindTemplate']['if']('isListItemRendered','ck-ai_review__check-list-item_rendered',_0x4aa8fd=>_0x4aa8fd)],'style':{'--ck-ai-review-check-list-item-index':_0x1b1cd8}},'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':_0x1633b6['title']}]},_0x2d00a6]},{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-description']},'children':_0x1633b6['description']?[{'text':_0x1633b6['description']}]:[]}]}]},..._0x1633b6['isParameterized']?[this['_createParameterizedView'](_0x1633b6)]:[],...'custom'===_0x1633b6['id']?[this['_createCustomView'](_0x1633b6,this['_hideModels'])]:[]]}),this['on']('click',()=>{_0x1633b6['isParameterized']?this['isParametrizedViewOpen']=!0x0:this['fire']('runReviewCheck',{'id':_0x1633b6['id'],'args':_0x1633b6['useArgs']?_0x1633b6['args']:void 0x0});}),requestAnimationFrame(()=>{this['isListItemRendered']=!0x0;});}['render'](){super['render'](),this['isItemParametrized']&&zt({'emitter':this,'activator':()=>!0x0===this['isParametrizedViewOpen'],'contextElements':[this['element']],'callback':()=>{this['isParametrizedViewOpen']=!0x1;}});}['resetToDefault'](){this['isParametrizedViewOpen']=!0x1,this['_formItemsCollection']['forEach'](_0x130da7=>{_0x130da7['resetToDefault']();}),this['_customCheckView']&&this['_customCheckView']['resetToDefault']();}['_createIconView'](){const _0x392f59=new xt();return _0x392f59['content']=at,_0x392f59['extendTemplate']({'attributes':{'class':['ck-ai_review__check-list-item-title-icon']}}),_0x392f59;}['_createParameterizedView'](_0x29b954){const _0x2249fa=new vt(),_0x20ae44=this['_createFormView'](_0x29b954);return _0x2249fa['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-parameterized',this['bindTemplate']['if']('isParametrizedViewOpen','ck-hidden',_0x307bd7=>!_0x307bd7)]},'children':[_0x20ae44]}),_0x2249fa;}['_createFormView'](_0x1a5170){const _0x292a76=new vt(),_0x73e67e=Array['isArray'](_0x1a5170['options'])?_0x1a5170['options']:[],_0x380692=new Nt(this['locale']),t=this['locale']['t'];_0x380692['set']({'label':t('Submit'),'withText':!0x0,'class':ds}),_0x380692['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x5b1d58=>{_0x5b1d58['stopPropagation']();})}}),_0x380692['on']('execute',()=>{const _0x4cf82b=[],_0x4168ff={};this['_formItemsCollection']['forEach'](_0x2445f3=>{_0x4cf82b['push'](_0x2445f3['value']),_0x1a5170['useArgs']&&_0x1a5170['options']&&(_0x4168ff[_0x2445f3['argsKey']]=_0x2445f3['value']);}),this['fire']('runReviewCheck',{'id':_0x1a5170['id'],'params':_0x4cf82b['length']?_0x4cf82b:void 0x0,'args':Object['keys'](_0x4168ff)['length']?_0x4168ff:void 0x0});});const _0x1cd524=_0x73e67e['length'];return _0x73e67e['forEach']((_0x59051c,_0x599724)=>{const _0xcc2cf1=_0x599724===_0x1cd524-0x1;this['_formItemsCollection']['add'](new Io(this['locale'],_0x59051c,_0xcc2cf1?_0x380692:null));}),_0x292a76['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-parameterized-form']},'children':this['_formItemsCollection']}),_0x292a76;}['_createCustomView'](_0x16d2d1,_0x17a2d1=!0x1){return this['_customCheckView']=new po(this['locale'],_0x16d2d1,_0x17a2d1),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',_0x3bc33d=>!_0x3bc33d)]}}),this['_customCheckView']['delegate']('runReviewCheck')['to'](this),this['listenTo'](this['_customCheckView'],'closeCustomCheck',()=>{this['isParametrizedViewOpen']=!0x1;}),this['on']('change:isParametrizedViewOpen',(_0x5b0c99,_0x15a74b,_0x21bbcc)=>{_0x21bbcc||this['_customCheckView']['resetFormValidationStatus']();}),this['_customCheckView'];}}class wo extends Ht{['_checkViews'];constructor(_0x13f1bd){super(_0x13f1bd),this['_checkViews']=new _0x5df866(),this['_setupTemplate']();}['setChecks'](_0x2e864e,_0x44d33b=!0x1){this['_checkViews']['clear']();for(const [_0x1eeac5,_0x4b40bc]of _0x2e864e['entries']()){const _0x61a7a9=new Co(this['locale'],_0x4b40bc,_0x1eeac5,_0x44d33b);_0x61a7a9['delegate']('runReviewCheck')['to'](this),this['_checkViews']['add'](_0x61a7a9);}}['hasChecks'](){return this['_checkViews']['length']>0x0;}['resetAllParameterizedChecks'](){for(const _0x471a89 of this['_checkViews'])_0x471a89 instanceof Co&&_0x471a89['resetToDefault']();}['_setupTemplate'](){const _0x88ebb3=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list',_0x88ebb3['if']('isVisible','ck-hidden',_0xdccbc2=>!_0xdccbc2)]},'children':this['_checkViews']});}}class fo extends ho{static get['pluginName'](){return'AIReviewModeUI';}['createMainView'](){const _0x3dab86=this['context']['locale'],_0x3a458b=new _0x1b248d(_0x3dab86,{'label':us(_0x3dab86,'AI_REVIEW_MODE'),'icon':_0x4f1906,'class':'ck-ai-header\x20ck-ai-header_review'});return new lo(this['context']['locale'],{'header':_0x3a458b,'list':new wo(_0x3dab86),'results':new _o(_0x3dab86,{'generalErrorText':us(_0x3dab86,'AI_REVIEW_MODE_GENERAL_ERROR_MESSAGE')}),'completed':new Ao(_0x3dab86,{'headerText':us(_0x3dab86,'AI_REVIEW_MODE_FINISH_REVIEW_HEADER_TITLE'),'emptyResultsText':us(_0x3dab86,'AI_REVIEW_MODE_EMPTY_RESULTS_TEXT'),'buttonText':us(_0x3dab86,'AI_REVIEW_MODE_FINISH_REVIEW_BUTTON_LABEL')})});}['registerTab'](){const _0x201f82=this['context']['plugins']['get']('AITabs');_0x201f82['view']['on']('activateTab',(_0x311892,_0x917212)=>{'reviewMode'===_0x917212?this['fire']('getReviewCheckList'):this['fire']('leaveReview');}),_0x201f82['view']['addTab']({'id':'reviewMode','buttonLabel':us(this['context']['locale'],'AI_REVIEW_MODE'),'buttonIcon':_0x4f1906,'order':0x0,'content':this['_mainView']});}}const So='review-';class bo extends _0x12c8be{static get['requires'](){return[_0x27dffc,tn];}static get['pluginName'](){return'AIReviewCoreEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['_markers']=new Map();['_activeMarkers']=new Set();['_domEmitter'];['_eventEmitter'];constructor(_0x57ee53){super(_0x57ee53),this['_domEmitter']=new(Ot())(),this['_eventEmitter']=new(pt())();}get['emitter'](){return this['_eventEmitter'];}['afterInit'](){const _0xf71f71=Xs(this['context']);_0xf71f71['conversion']['for']('editingDowncast')['markerToElement']({'model':So+'insert','view':(_0x75e8e7,{writer:_0x338938})=>{const _0x387606=this['_markers']['get'](_0x75e8e7['markerName']),_0x166515={'class':'ck-ai_review-marker_add'+(this['_activeMarkers']['has'](_0x387606?.['id']||'')?'\x20ck-ai_review__change_active':''),'data-marker-id':_0x75e8e7['markerName']};return _0x338938['createUIElement']('span',_0x166515,function(_0x282569){const _0x201643=this['toDomElement'](_0x282569);return _0x201643['innerHTML']=_0x387606?.['content']?.['asString']||'',_0x201643;});}}),_0xf71f71['conversion']['for']('editingDowncast')['markerToHighlight']({'model':So+'remove-only','view':_0x3577ec=>{const _0x5bc8b6=this['_markers']['get'](_0x3577ec['markerName']),_0x3ab8fe=['ck-ai_review-marker_strikethrough'];return this['_activeMarkers']['has'](_0x5bc8b6?.['id']||'')&&_0x3ab8fe['push']('ck-ai_review__change_active'),{'classes':_0x3ab8fe,'attributes':{'data-marker-id':_0x3577ec['markerName']}};}}),_0xf71f71['conversion']['for']('editingDowncast')['markerToHighlight']({'model':So+'remove-context','view':_0x4bc4e0=>{const _0x264ef1=this['_markers']['get'](_0x4bc4e0['markerName']),_0x51e444=['ck-ai_review-marker_underline'];return this['_activeMarkers']['has'](_0x264ef1?.['id']||'')&&_0x51e444['push']('ck-ai_review__change_active'),{'classes':_0x51e444,'attributes':{'data-marker-id':_0x4bc4e0['markerName']}};}}),_0xf71f71['conversion']['for']('editingDowncast')['markerToHighlight']({'model':So+'remove-text','view':_0xad2e6e=>{const _0x5a8913=this['_markers']['get'](_0xad2e6e['markerName']),_0x90723a=['ck-ai_review-marker_hide'];return this['_activeMarkers']['has'](_0x5a8913?.['id']||'')&&_0x90723a['push']('ck-ai_review__change_active'),{'classes':_0x90723a,'attributes':{'data-marker-id':_0xad2e6e['markerName']}};}}),_0xf71f71['conversion']['for']('dataDowncast')['markerToElement']({'model':So+'suggestion-context','view':(_0x2fd26b,{writer:_0x3d3e21})=>_0x3d3e21['createRawElement']('span',{'class':'ck-ai_review-marker_context-'+(_0x2fd26b['isOpening']?'start':'end')})}),_0xf71f71['conversion']['for']('downcast')['attributeToAttribute']({'model':_0x2772d6,'view':_0x361437});const _0x53af74=_0xf71f71['ui']['getEditableElement']()||document['body'];this['_domEmitter']['listenTo'](_0x53af74,'mouseup',(_0x58c10b,_0x49097d)=>{const _0x3976fd=_0x49097d['target'],_0x4ed0d4=this['_findMarkerElement'](_0x3976fd);if(!_0x4ed0d4)return;const _0x164358=_0x4ed0d4['getAttribute']('data-marker-id'),_0x41a588=_0x164358['split'](':')['pop']()?.['split']('_')[0x0];this['_eventEmitter']['fire']('changeMarkerClicked',{'markerId':_0x164358,'changeId':_0x41a588,'markerElement':()=>this['_findMarkerElementById'](_0x164358),'domEvent':_0x49097d});},{'usePassive':!0x0,'priority':'highest'}),this['_domEmitter']['listenTo'](_0x53af74,'mouseover',(_0x2794b9,_0x44602c)=>{const _0x3053d9=_0x44602c['target'],_0xd7babf=_0x44602c['relatedTarget'];let _0x486fd5=this['_findMarkerElement'](_0x3053d9);if(!_0x486fd5&&_0xd7babf&&(_0x486fd5=this['_findMarkerElement'](_0xd7babf)),!_0x486fd5)return;const _0x10a4ae=_0x486fd5['getAttribute']('data-marker-id'),_0x18f3fe=_0x10a4ae['split'](':')['pop']()?.['split']('_')[0x0];this['_eventEmitter']['fire']('changeMarkerHovered',{'changeId':_0x18f3fe,'markerElement':()=>this['_findMarkerElementById'](_0x10a4ae),'domEvent':_0x44602c});}),this['_domEmitter']['listenTo'](document,'mouseover',_0x4608ab((_0x8f623a,_0x63fc1c)=>{const _0x524467=_0x63fc1c['target'];if(this['_findMarkerElement'](_0x524467))return;_0x524467['closest']('.ck-reset.ck-ai_review-balloon-panel-suggestion')||this['_eventEmitter']['fire']('changeMarkerBlurred');},0xc8)),_0xf71f71['model']['document']['registerPostFixer'](_0x585597=>this['_validateMarkers'](_0xf71f71,_0x585597)),_0xf71f71['model']['document']['on']('change',()=>this['_handleMarkerChanges'](_0xf71f71));}['getDocumentData'](){const _0x2c140e=this['context']['plugins']['get']('AIEditing'),_0x56abcb=Xs(this['context']),_0x3d7e86=_0x56abcb['model'],_0x2ab28d=new _0x370ccf();for(const _0x30b653 of _0x3d7e86['document']['getRoot']()['getChildren']()){const _0xb7ea69=_0x30b653['_clone'](!0x0);_0x2ab28d['_appendChild'](_0xb7ea69);}for(const _0x19d82d of _0x3d7e86['markers'])_0x2ab28d['markers']['set'](_0x19d82d['name'],this['_changeRangeOwnerDocument'](_0x19d82d['getRange']()['clone'](),_0x2ab28d));const _0x2835a7=new _0x180029({'ignoreElementEnd':!0x0,'startPosition':_0x3d7e86['createPositionAt'](_0x2ab28d,0x0)}),_0x8a9f5f=new Set(),_0x483dd3=new Map();for(const {item:_0x18dcfb}of _0x2835a7){if(!_0x18dcfb['is']('$textProxy'))continue;const _0x32bf97=_0x18dcfb['parent'];if(_0x32bf97&&_0x32bf97['is']('element')){const _0x136fd6=this['_upsertDataId'](_0x32bf97,()=>_0x2c140e['_nextDataId'](_0x8a9f5f));_0x8a9f5f['add'](_0x136fd6);for(const _0x3d502a of _0x32bf97['getChildren']())_0x3d502a['is']('element')&&_0x8a9f5f['add'](this['_upsertDataId'](_0x3d502a,()=>_0x2c140e['_nextDataId'](_0x8a9f5f)));let _0x5242cb=_0x32bf97;for(;_0x5242cb['parent']&&!_0x5242cb['parent']['is']('documentFragment');)_0x5242cb=_0x5242cb['parent'],_0x5242cb['hasAttribute'](_0x2772d6)&&_0x5242cb['_removeAttribute'](_0x2772d6);_0x483dd3['set'](_0x136fd6,{'path':_0x32bf97['getPath'](),'getContent':this['_createGetContentUsingDataIdFn'](_0x5242cb['_clone'](!0x0),_0x136fd6,_0x56abcb['data'])}),_0x2835a7['jumpTo'](_0x3d7e86['createPositionAfter'](_0x32bf97));}}return{'content':_0x56abcb['data']['processor']['toData'](_0x56abcb['data']['toView'](_0x2ab28d)),'version':_0x56abcb['model']['document']['version'],'elements':_0x483dd3};}['diffContent'](_0x3c4761,_0x11a1b0,_0x141d81=!0x1){const _0x3ee17c=[],_0xdeed07=Xs(this['context']),_0x5da807=_0xdeed07['data']['parse'](_0x11a1b0,'$documentFragment'),_0x36412e=_0xdeed07['data']['parse'](_0x3c4761,'$documentFragment'),_0x48cf5c=_0xdeed07['model']['createPositionAt'](_0x36412e,0x0);if(this['_haveSingleTopLevelElement'](_0x5da807)){if(!this['_hasSameTopLevelElement'](_0x36412e,_0x5da807))return _0x3ee17c;}else{const _0x39961d=_0xdeed07['model']['schema'];if(!this['_haveOnlyInlineContent'](_0x36412e,_0x39961d)||!this['_haveOnlyInlineContent'](_0x5da807,_0x39961d))return _0x3ee17c;}const _0x517416=this['context']['plugins']['get']('DocumentCompare')['getDiff'](_0x3c4761,_0x11a1b0,{'anchor':_0x48cf5c,'markDeletions':!0x0})['getOperations']()['filter'](_0x2b06df=>'insert'===_0x2b06df['type']||'marker'===_0x2b06df['type']&&_0x2b06df['name']['startsWith']('$markedRemove')),_0x32ccc7=this['_groupAdjacentOperations'](_0x517416),_0x41be66=[];if(_0x141d81){if(_0x32ccc7['length']){const _0x2996db=_0x32ccc7[0x0]['operations'][0x0],_0x3ad59c='insert'===_0x2996db['type']?_0x2996db['position']:_0x2996db['newRange']['start'],_0xa726f4=this['_getPositionLimitingRange'](_0x3ad59c,_0xdeed07,'inside'),_0x309df9=_0xa726f4?_0x5da807['getChild'](0x0)['getChildren']():_0x5da807['getChildren'](),_0x58c1fe=_0xa726f4||_0xdeed07['model']['createRangeIn'](_0x36412e),_0xa48d4=[new _0x46d88d('$markedRemove:synthetic'+ot(),null,_0x58c1fe,_0xdeed07['model']['document']['model']['markers'],!0x0,_0xdeed07['model']['document']['version']+0x1),new _0x9b41a6(_0x58c1fe['end'],_0x309df9,_0xdeed07['model']['document']['version']+0x2)];_0x41be66['push']({'operations':_0xa48d4,'operationsIsolated':_0xa48d4,'groupOffset':0x0});}}else _0x41be66['push'](..._0x32ccc7);let _0x4472c2=0x0;return _0xdeed07['model']['change'](_0x53673f=>{for(let _0x394e67=0x0;_0x394e67<_0x41be66['length'];_0x394e67++){const _0x5706dc=_0x41be66[_0x394e67],_0x1f3da6=_0x53673f['createDocumentFragment']();for(const _0x31393d of _0x36412e['getChildren']())_0x53673f['append'](_0x31393d['_clone'](!0x0),_0x1f3da6);for(const _0x107560 of _0x5706dc['operationsIsolated'])if('insert'===_0x107560['type']){const _0x51dba2=_0x107560;_0x51dba2['baseVersion']=null,_0x51dba2['isDocumentOperation']=!0x1,this['_changeOperationOwnerDocument'](_0x51dba2,_0x1f3da6),_0x53673f['batch']['addOperation'](_0x107560),_0xdeed07['model']['applyOperation'](_0x107560);const _0x4e243c='suggestion:insertion:id:authorId:'+_0x4472c2++,_0x4a69a7=_0xdeed07['model']['createRange'](_0x51dba2['position'],_0x51dba2['position']['getShiftedBy'](_0x51dba2['howMany']));_0x1f3da6['markers']['set'](_0x4e243c,_0x4a69a7);}else{if('marker'===_0x107560['type']&&_0x107560['name']['startsWith']('$markedRemove')){const _0x30d055=_0x107560,_0x2705dd='suggestion:deletion:id:authorId:'+_0x4472c2++;this['_changeOperationOwnerDocument'](_0x30d055,_0x1f3da6),_0x1f3da6['markers']['set'](_0x2705dd,_0x30d055['newRange']);}}if(_0x141d81)_0x3ee17c['push']({..._0x5706dc,'context':this['_createGetContentFn'](_0x36412e,_0xdeed07['data']),'content':this['_createGetContentFn'](_0x36412e,_0xdeed07['data'])});else{const _0x95df23=this['_getChangeContext'](this['_changePositionOwnerDocument'](this['_getOperationStart'](_0x5706dc['operationsIsolated'][0x0]),_0x1f3da6),this['_changePositionOwnerDocument'](this['_getOperationEnd'](_0x5706dc['operationsIsolated'][_0x5706dc['operationsIsolated']['length']-0x1]),_0x1f3da6));_0x1f3da6['markers']['set'](So+'suggestion-context',new _0x1569aa(_0x95df23['start'],_0x95df23['end'])),_0x3ee17c['push']({..._0x5706dc,'context':this['_createGetContextFn'](_0x1f3da6,_0xdeed07['data'],{'ellipsisBefore':_0x95df23['hasContentBefore'],'ellipsisAfter':_0x95df23['hasContentAfter']}),'content':this['_createGetContentFn'](_0x1f3da6,_0xdeed07['data'])});}}}),_0x3ee17c;}['markChangePositionInEditorContent'](_0x45d414,_0x4780f9){if(!_0x45d414['length'])return;const _0x11c641=_0x45d414[0x0]['parent']['id'],_0x3be8f4=_0x4780f9['elements']['get'](_0x11c641);if(!_0x3be8f4)return void console['warn']('No\x20element\x20found\x20for\x20ID:\x20'+_0x11c641);const _0x14ae46=_0x3be8f4['path'],_0x2c97a9=Xs(this['context']),_0x21472c=_0x2c97a9['model']['document']['history']['getOperations'](_0x4780f9['version']),_0x1f2f0b=[];for(const _0x256961 of _0x45d414){const _0x3916e7=_0x256961['operationsIsolated']['map'](_0x329f5a=>this['_translateOperationToEditorContent'](_0x329f5a,_0x14ae46,_0x2c97a9['model']['document']['getRoots']()[0x0]));if(!_0x3916e7||!_0x3916e7['length'])continue;const _0x2f0caf=_0x3916e7['every'](_0x5894f3=>'marker'===_0x5894f3['type']&&_0x5894f3['name']['startsWith']('$markedRemove')),_0x5a2e85={'document':_0x2c97a9['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1},_0x4874fc=_0x5ad7d5(_0x3916e7,_0x21472c,_0x5a2e85)['operationsA'];for(const _0x28ebf9 of _0x4874fc)if('insert'===_0x28ebf9['type']){const _0x55943a=_0x28ebf9,_0x2bb06b=_0x55943a['nodes'];_0x2c97a9['model']['change'](_0x387bd3=>{const _0x5e32b3=_0x387bd3['createDocumentFragment']();for(const _0x5c9bbc of _0x2bb06b)_0x387bd3['append'](_0x5c9bbc['_clone'](!0x0),_0x5e32b3);_0x1f2f0b['push']({'start':_0x55943a['position'],'end':_0x55943a['position'],'type':'insert','groupId':_0x256961['id'],'content':{'asString':this['_createGetContentFn'](_0x5e32b3,_0x2c97a9['data'])(),'asFragment':_0x5e32b3}});});}else{if('marker'===_0x28ebf9['type']&&_0x28ebf9['name']['startsWith']('$markedRemove')){const _0xd95a71=_0x28ebf9;let _0x34776d='remove-text';if(_0x2f0caf){const _0x47ba40=this['_findAdjacentContextDistance'](_0xd95a71['newRange']['start'],'backward',_0x2c97a9['model']['schema']),_0x30bf63=this['_findAdjacentContextDistance'](_0xd95a71['newRange']['end'],'forward',_0x2c97a9['model']['schema']);if(_0x47ba40||_0x30bf63){const _0x188f03=_0xd95a71['newRange']['start']['getShiftedBy'](-_0x47ba40),_0xecb608=_0xd95a71['newRange']['end']['getShiftedBy'](_0x30bf63);_0x1f2f0b['push']({'start':_0x188f03,'end':_0xecb608,'groupId':_0x256961['id'],'type':'remove-context'});}else _0x34776d='remove-only';}_0x1f2f0b['push']({'start':_0xd95a71['newRange']['start'],'end':_0xd95a71['newRange']['end'],'groupId':_0x256961['id'],'type':_0x34776d});}}}this['_insertMarkers'](_0x1f2f0b);}['clearAllMarkers'](){const _0x4b644f=Xs(this['context']);_0x4b644f['model']['change'](_0x23f196=>{for(const _0x39bceb of this['_markers']['keys']())_0x4b644f['model']['markers']['get'](_0x39bceb)&&_0x23f196['removeMarker'](_0x39bceb);}),this['_markers']['clear'](),this['_activeMarkers']['clear']();}['switchToReadOnly'](){Xs(this['context'])['enableReadOnlyMode']('ai-review');}['switchToEdit'](){Xs(this['context'])['disableReadOnlyMode']('ai-review');}['applyChange'](_0x82974f){const _0x3f95a6=Xs(this['context']),_0x2e7848=_0x3f95a6['model'],_0x26190d=_0x82974f['map'](_0x483895=>this['_getMarkersDataForGroup'](_0x483895))['flat']();_0x2e7848['change'](_0x441fa4=>{for(const _0x5bfafd of _0x26190d){const _0x5f2573=_0x3f95a6['model']['markers']['get'](_0x5bfafd['id']);if(_0x5f2573){if('insert'===_0x5bfafd['type']){if(!_0x5bfafd['content'])continue;_0x2e7848['insertContent'](_0x5bfafd['content']['asFragment']||null,_0x5f2573['getRange']()['start']);}else'remove-text'!==_0x5bfafd['type']&&'remove-only'!==_0x5bfafd['type']||_0x2e7848['deleteContent'](_0x2e7848['createSelection'](_0x5f2573['getRange']()));_0x441fa4['removeMarker'](_0x5bfafd['id']),this['_markers']['delete'](_0x5bfafd['id']);}}});}['rejectChange'](_0x220542){const _0x4a6cad=Xs(this['context']),_0x4f7454=this['_getMarkersDataForGroup'](_0x220542);_0x4a6cad['model']['change'](_0x53065e=>{for(const _0x1c008f of _0x4f7454)_0x53065e['removeMarker'](_0x1c008f['id']),this['_markers']['delete'](_0x1c008f['id']);});}['getEditor'](){return Xs(this['context']);}['getMarkerElementForChange'](_0x302787){const _0x4d3044=Array['from'](this['_markers']['values']())['filter'](_0x3f9a60=>_0x3f9a60['groupId']===_0x302787);if(!_0x4d3044['length'])return null;const _0x50dc09=0x1===_0x4d3044['length']?_0x4d3044[0x0]:this['_sortMarkers'](_0x4d3044)[0x0],_0x39c419=Xs(this['context'])['model']['markers']['get'](_0x50dc09['id']);if(!_0x39c419)return null;return{'modelRange':_0x39c419['getRange'](),'getElement':()=>this['_findMarkerElementById'](_0x50dc09['id'])};}['getContentElementForChange'](_0x188f54){const _0x55ce2b=Array['from'](this['_markers']['values']())['filter'](_0x290f88=>_0x290f88['groupId']===_0x188f54);if(!_0x55ce2b['length'])return null;const _0x15c564=0x1===_0x55ce2b['length']?_0x55ce2b[0x0]:this['_sortMarkers'](_0x55ce2b)[0x0],_0xc00544=Xs(this['context']),_0x383ea4=_0xc00544['model']['markers']['get'](_0x15c564['id']);if(!_0x383ea4)return null;const _0x396b18=_0x383ea4['getRange'](),_0x2b6102=_0xc00544['editing']['view']['getDomRoot']();if(!_0x2b6102||!_0x396b18)return null;let _0x236932=_0x396b18['start']['parent'];for(;_0x236932['parent']&&'$root'!==_0x236932['parent']['name'];)_0x236932=_0x236932['parent'];if(!_0x236932||!_0x236932['name'])return null;const _0x31bafc=_0x2b6102['querySelector']('[data-marker-id=\x22'+_0x15c564['id']+'\x22]');if(!_0x31bafc)return null;let _0x5968e2=null;_0xc00544['model']['change'](_0x2a811c=>{_0x5968e2=_0x2a811c['createDocumentFragment'](),_0x2a811c['append'](_0x236932['_clone'](!0x0),_0x5968e2);});const _0x401134=_0xc00544['data']['toView'](_0x5968e2)['getChild'](0x0);return _0x31bafc['closest'](_0x401134['name']);}['reactivateMarkers'](_0x27b511){const _0x1e406d=this['_getMarkersDataForGroup'](_0x27b511);if(!_0x1e406d['length'])return;const _0x4942dd=Array['from'](this['_activeMarkers'])['sort'](),_0x4198eb=Array['from'](new Set(_0x1e406d['map'](_0x563453=>_0x563453['id'])))['sort']();_0x4942dd['join']('|')!==_0x4198eb['join']('|')&&(this['setAllMarkersAsInactive'](),this['setMarkersInElementAsActive'](_0x27b511));}['setMarkersInElementAsActive'](_0x2818f3){const _0x560452=this['_getMarkersDataForGroup'](_0x2818f3);if(!_0x560452['length'])return;const _0x338cda=Xs(this['context']),_0x1a88de=new Set(_0x560452['map'](_0x16e19f=>_0x16e19f['id'])),_0x2af358=Array['from'](_0x1a88de['values']())['map'](_0x36feed=>_0x338cda['model']['markers']['get'](_0x36feed))['filter'](_0xa2cb04=>!!_0xa2cb04);_0x1a88de['forEach'](_0x1b0144=>{this['_activeMarkers']['add'](_0x1b0144);}),_0x338cda['model']['change'](()=>{_0x2af358['forEach'](_0x57da01=>{_0x338cda['editing']['reconvertMarker'](_0x57da01);});});}['setAllMarkersAsInactive'](){const _0x3ea338=Array['from'](this['_activeMarkers']);if(!_0x3ea338['length'])return;this['_activeMarkers']['clear']();const _0x1f06cc=Xs(this['context']),_0x2d84c3=_0x3ea338['map'](_0x9a4a7d=>_0x1f06cc['model']['markers']['get'](_0x9a4a7d))['filter'](_0x5111ff=>!!_0x5111ff);_0x1f06cc['model']['change'](()=>{_0x2d84c3['forEach'](_0x34f4d9=>{_0x1f06cc['editing']['reconvertMarker'](_0x34f4d9);});});}['_getPositionLimitingRange'](_0x4d4652,_0xac0d36,_0x3afc80='outside'){if(!_0x4d4652)return null;let _0x43911e=_0x4d4652['parent'];for(;_0x43911e&&_0x43911e['parent']&&'$root'!==_0x43911e['parent']['name']&&!_0xac0d36['model']['schema']['isLimit'](_0x43911e)&&!_0xac0d36['model']['schema']['isBlock'](_0x43911e);)_0x43911e=_0x43911e['parent'];if(!_0x43911e||!_0x43911e['name']||'$root'===_0x43911e['name'])return null;let _0x2a928a=null;return _0xac0d36['model']['change'](_0x5f5719=>{_0x2a928a='inside'===_0x3afc80?_0x5f5719['createRangeIn'](_0x43911e):_0x5f5719['createRangeOn'](_0x43911e);}),_0x2a928a;}['_validateMarkers'](_0xae1d8d,_0x358321){const _0x4b6377=Array['from'](this['_markers']['keys']()),_0x4a6f6b=new Map();for(const _0x5201bc of _0x4b6377){const _0x336dc9=_0xae1d8d['model']['markers']['get'](_0x5201bc);if(!_0x336dc9)continue;const _0x547c62=_0x336dc9['getStart']()['path'][0x0];_0x4a6f6b['has'](_0x547c62)||_0x4a6f6b['set'](_0x547c62,[]),_0x4a6f6b['get'](_0x547c62)['push'](_0x336dc9);}const _0x350e6b=new Set();for(const _0x4fcf04 of _0xae1d8d['model']['document']['differ']['getChanges']()){let _0x3c262b=-0x1,_0x4319b0=null;if('insert'===_0x4fcf04['type'])_0x4319b0=new _0x1569aa(_0x4fcf04['position'],_0x4fcf04['position']['getShiftedBy'](_0x4fcf04['length'])),_0x3c262b=_0x4fcf04['position']['path'][0x0];else{if('remove'!==_0x4fcf04['type'])continue;_0x4319b0=new _0x1569aa(_0x4fcf04['position']),_0x3c262b=_0x4fcf04['position']['path'][0x0];}const _0x4022e1=_0x4a6f6b['get'](_0x3c262b)||[];if(_0x4022e1['length']){for(const _0x4531e2 of _0x4022e1)if(_0x4319b0['root']['rootName']===_0x4531e2['getRange']()['root']['rootName']&&('insert'!==_0x4fcf04['type']||!_0x4319b0['containsRange'](_0x4531e2['getRange']()))&&(_0x4319b0['isIntersecting'](_0x4531e2['getRange']())||_0x4319b0['start']['isTouching'](_0x4531e2['getRange']()['end'])||_0x4319b0['end']['isTouching'](_0x4531e2['getRange']()['start']))){const _0x4e798e=this['_parseMarkerName'](_0x4531e2['name']);Array['from'](this['_markers']['values']())['filter'](_0x13fe7f=>_0x13fe7f['groupId']===_0x4e798e['groupId'])['forEach'](_0x2bddae=>_0x350e6b['add'](_0x2bddae['id']));}}}if(_0x350e6b['size']){for(const _0x5d8af1 of _0x350e6b)_0x358321['removeMarker'](_0x5d8af1);return!0x0;}return!0x1;}['_handleMarkerChanges'](_0x5647b5){for(const {name:_0x20e04c,data:_0x577603}of _0x5647b5['model']['document']['differ']['getChangedMarkers']()){if(!_0x20e04c['startsWith'](So))continue;const _0x5c03db=_0x577603['oldRange'],_0xf19f36=_0x577603['newRange'],_0x10815c=_0x5c03db&&'$graveyard'===_0x5c03db['root']['rootName'],_0x2423e4=_0xf19f36&&'$graveyard'===_0xf19f36['root']['rootName'];if(_0x10815c&&_0x2423e4)continue;const _0x21dd6f=this['_parseMarkerName'](_0x20e04c);this['_markers']['get'](_0x20e04c)&&(_0x2423e4||!_0xf19f36?this['_eventEmitter']['fire']('changeMarkerRemoved',{'markerId':_0x20e04c,'changeId':_0x21dd6f['groupId']}):_0x10815c&&_0xf19f36&&this['_eventEmitter']['fire']('changeMarkerRestored',{'markerId':_0x20e04c,'changeId':_0x21dd6f['groupId']}));}}['_parseMarkerName'](_0x2d228d){const _0x205dff=_0x2d228d['split'](':'),_0x432d59=(_0x205dff[0x1]||'')['split']('_');return{'prefix':_0x205dff[0x0],'groupId':_0x432d59[0x0],'suffix':_0x432d59[0x1]};}['_translateOperationToEditorContent'](_0x47eb7c,_0xd00537,_0x4bf36c){if('insert'===_0x47eb7c['type']){const _0x72b8c8=_0x47eb7c;return new _0x9b41a6(this['_changePosition'](_0xd00537['concat'](_0x72b8c8['position']['offset']),_0x4bf36c),_0x72b8c8['nodes'],_0x72b8c8['baseVersion']);}if('marker'===_0x47eb7c['type']&&_0x47eb7c['name']['startsWith']('$markedRemove')){const _0x1c5403=_0x47eb7c;return new _0x46d88d(_0x1c5403['name'],_0x1c5403['oldRange'],this['_changeRange'](_0x1c5403['newRange'],_0xd00537['concat'](_0x1c5403['newRange']['start']['offset']),_0xd00537['concat'](_0x1c5403['newRange']['end']['offset']),_0x4bf36c),_0x1c5403['_markers'],_0x1c5403['affectsData'],_0x1c5403['baseVersion']);}return _0x47eb7c;}['_groupAdjacentOperations'](_0x2412f7){if(!_0x2412f7['length'])return[];const _0x45d267=[];let _0x2d21ce=0x0,_0xfee987=0x0,_0x43eb26=[];for(let _0xb758c1=0x0;_0xb758c1<=_0x2412f7['length'];_0xb758c1++){const _0x57708f=_0x2412f7[_0xb758c1],_0x55ef43=_0x2412f7[_0xb758c1-0x1];!_0x57708f||_0x55ef43&&!this['_getOperationEnd'](_0x55ef43)['isTouching'](this['_getOperationStart'](_0x57708f))?(_0x45d267['push']({'operations':_0x43eb26,'operationsIsolated':_0x43eb26['map'](_0x54c7f4=>this['_shiftOperation'](_0x54c7f4['clone'](),-_0xfee987)),'groupOffset':_0x2d21ce}),_0x43eb26=_0x57708f?[_0x57708f]:[],_0xfee987+=_0x2d21ce,_0x2d21ce=0x0):_0x43eb26['push'](_0x57708f),_0x57708f&&'insert'===_0x57708f['type']&&(_0x2d21ce+=_0x57708f['howMany']);}return _0x45d267;}['_findAdjacentContextDistance'](_0x13cb87,_0x1622c7,_0x35744c,_0x4e8a9a=0x1){const _0x4c39b7=new _0x180029({'startPosition':_0x13cb87,'direction':_0x1622c7});let _0xcc6f2e=0x0;for(let _0x10577d=0x0;_0x10577d<_0x4e8a9a;_0x10577d++){let _0x4d9f5f=0x0,_0x3568c1=!0x1,_0x281d64='forward'===_0x1622c7?/^\W*\w+/:/\w+\W*$/;for(const {item:_0x1b5b92}of _0x4c39b7)if(_0x1b5b92['is']('$textProxy')){const _0x50fb77=_0x281d64['exec'](_0x1b5b92['data']);if(_0x50fb77&&_0x50fb77['length']){if(_0x4d9f5f+='forward'===_0x1622c7?_0x50fb77['index']+_0x50fb77[0x0]['length']:_0x1b5b92['data']['length']-_0x50fb77['index'],_0x50fb77[0x0]['length']!==_0x1b5b92['data']['length'])break;_0x3568c1=!0x0,_0x281d64='forward'===_0x1622c7?/^\w+/:/\w+$/;}else{if(_0x3568c1)break;_0x4d9f5f+=_0x1b5b92['offsetSize'];}}else{if(_0x1b5b92['is']('element')){_0x35744c['isInline'](_0x1b5b92)&&!_0x3568c1&&(_0x4d9f5f+=0x1);break;}}_0xcc6f2e+=_0x4d9f5f,_0x4c39b7['jumpTo'](_0x13cb87['getShiftedBy']('forward'===_0x1622c7?_0xcc6f2e:-_0xcc6f2e));}return _0xcc6f2e;}['_getChangeContext'](_0x499337,_0x39c825){const _0x3d169b=Xs(this['context'])['model']['schema'],_0x2fd56a=this['_findAdjacentContextDistance'](_0x499337,'backward',_0x3d169b,0x6),_0x813c01=this['_findAdjacentContextDistance'](_0x39c825,'forward',_0x3d169b,0x6),_0x64816a=_0x499337['getShiftedBy'](-_0x2fd56a),_0x27bf4c=_0x39c825['getShiftedBy'](_0x813c01);return{'start':_0x64816a,'end':_0x27bf4c,'hasContentBefore':!_0x64816a['isAtStart'],'hasContentAfter':!_0x27bf4c['isAtEnd']};}['_insertMarkers'](_0x32db49){const _0x269673=this['context']['plugins']['get']('AIEditing'),_0x568a55=new Set();Xs(this['context'])['model']['change'](_0x4849e0=>{for(const _0x300c0d of _0x32db49){const _0x2822d6=''+So+_0x300c0d['type']+':'+_0x300c0d['groupId']+'_'+_0x269673['_nextDataId'](_0x568a55);this['_markers']['set'](_0x2822d6,{'id':_0x2822d6,'groupId':_0x300c0d['groupId'],'type':_0x300c0d['type'],'content':_0x300c0d['content']}),_0x4849e0['addMarker'](_0x2822d6,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x4849e0['createRange'](_0x300c0d['start'],_0x300c0d['end'])});}});}['_createGetContextFn'](_0xd2586f,_0x142c31,_0x1d9181){let _0x50493d='';return()=>{if(!_0x50493d){const _0x2f9733=_0x142c31['toView'](_0xd2586f,{'showSuggestionHighlights':!0x0});let _0x422b08=_0x2f9733['getChild'](0x0);if(_0x422b08['is']('containerElement')||(_0x422b08=_0x2f9733),!_0x422b08)return'';let _0xe57de7=!0x1;const _0x572b5d=[];for(const _0x15b385 of _0x422b08['getChildren']())_0x15b385['is']('element','span')&&_0x15b385['hasClass']('ck-ai_review-marker_context-end')&&(_0xe57de7=!0x1),_0xe57de7&&_0x572b5d['push'](_0x15b385),_0x15b385['is']('element','span')&&_0x15b385['hasClass']('ck-ai_review-marker_context-start')&&(_0xe57de7=!0x0);_0x422b08['_removeChildren'](0x0,_0x422b08['childCount']),_0x1d9181?.['ellipsisBefore']&&_0x422b08['_appendChild']('…'),_0x422b08['_appendChild'](_0x572b5d),_0x1d9181?.['ellipsisAfter']&&_0x422b08['_appendChild']('…');const _0x30b737=_0x142c31['htmlProcessor']['domConverter']['viewToDom'](_0x2f9733),_0x5b7d5e=_0x142c31['htmlProcessor']['htmlWriter']['getHtml'](_0x30b737);_0x50493d=_0x5b7d5e;}return _0x50493d;};}['_createGetContentFn'](_0x500ec8,_0x3ec7ab){let _0x4ead9a='';return()=>(_0x4ead9a||(_0x4ead9a=_0x3ec7ab['stringify'](_0x500ec8,{'showSuggestionHighlights':!0x0})),_0x4ead9a);}['_createGetContentUsingDataIdFn'](_0x185830,_0x475e03,_0x4e40a3){let _0x196a6f='';return()=>{if(!_0x196a6f){const _0x2e3939=_0x4e40a3['toView'](new _0x370ccf(_0x185830)),_0x235e24=_0x4e40a3['htmlProcessor']['domConverter']['viewToDom'](_0x2e3939)['querySelector']('[data-id=\x22'+_0x475e03+'\x22]');_0x196a6f=_0x235e24?.['outerHTML']||'';}return _0x196a6f;};}['_findMarkerElement'](_0x1bce81,_0x24b34d=0x5){let _0x1aef7c=_0x1bce81,_0x36bffe=null;for(let _0x4e89ba=0x0;_0x4e89ba<_0x24b34d&&_0x1aef7c;_0x4e89ba++){if(!_0x1aef7c['className']){_0x1aef7c=_0x1aef7c['parentElement'];continue;}if(!(''+_0x1aef7c['className'])['includes']('ck-ai_review-marker_')){_0x1aef7c=_0x1aef7c['parentElement'];continue;}if(!_0x1aef7c['getAttribute']('data-marker-id'))break;_0x36bffe=_0x1aef7c;break;}return _0x36bffe;}['_findMarkerElementById'](_0x2ccc4b){const _0x48f876=Xs(this['context']),_0x451742=_0x48f876['model']['markers']['get'](_0x2ccc4b);return _0x451742?_0x572caa(_0x48f876['editing'],_0x451742):null;}['_getMarkersDataForGroup'](_0x3b16c7){return Array['from'](this['_markers']['values']())['filter'](_0x29fb82=>_0x29fb82['groupId']===_0x3b16c7);}['_getOperationStart'](_0x48cc26){return'insert'===_0x48cc26['type']?_0x48cc26['position']:_0x48cc26['newRange']['start'];}['_getOperationEnd'](_0x5c4411,_0x27592e=!0x1){return'insert'===_0x5c4411['type']?_0x27592e?_0x5c4411['position']:_0x5c4411['position']['getShiftedBy'](_0x5c4411['howMany']):_0x5c4411['newRange']['end'];}['_shiftOperation'](_0x4febec,_0x2fdbcd){return'insert'===_0x4febec['type']?_0x4febec['position']=_0x4febec['position']['getShiftedBy'](_0x2fdbcd):'marker'===_0x4febec['type']&&_0x4febec['newRange']&&(_0x4febec['newRange']=new _0x1569aa(_0x4febec['newRange']['start']['getShiftedBy'](_0x2fdbcd),_0x4febec['newRange']['end']['getShiftedBy'](_0x2fdbcd))),_0x4febec;}['_changeOperationOwnerDocument'](_0x5a8eee,_0x36556a){'insert'===_0x5a8eee['type']?_0x5a8eee['position']=this['_changePositionOwnerDocument'](_0x5a8eee['position'],_0x36556a):'marker'===_0x5a8eee['type']&&_0x5a8eee['newRange']&&(_0x5a8eee['newRange']=this['_changeRangeOwnerDocument'](_0x5a8eee['newRange'],_0x36556a));}['_changePositionOwnerDocument'](_0x4a2492,_0x54706b){return new _0x2cfd1c(_0x54706b,_0x4a2492['path']);}['_changeRangeOwnerDocument'](_0x16965a,_0x41de42){return new _0x1569aa(this['_changePositionOwnerDocument'](_0x16965a['start'],_0x41de42),this['_changePositionOwnerDocument'](_0x16965a['end'],_0x41de42));}['_changePosition'](_0x19ce76,_0xd2483c){return new _0x2cfd1c(_0xd2483c,[..._0x19ce76]);}['_changeRange'](_0x1254e3,_0x2a8c00,_0x21a34d,_0x4207bd){return new _0x1569aa(this['_changePosition'](_0x2a8c00,_0x4207bd),this['_changePosition'](_0x21a34d,_0x4207bd));}['_sortMarkers'](_0x5a0735){const _0x567a49=_0x4da286=>{switch(_0x4da286){case'insert':return 0x0;case'remove-context':return 0x1;case'remove-only':return 0x2;case'remove-text':return 0x3;}};return _0x5a0735['sort']((_0x443b15,_0x29d308)=>_0x567a49(_0x443b15['type'])-_0x567a49(_0x29d308['type']));}['_hasSameTopLevelElement'](_0x57fe7d,_0x361da3){const _0x5e870e=_0x57fe7d['getChild'](0x0),_0x16fd9b=_0x361da3['getChild'](0x0);return!(!_0x5e870e||!_0x16fd9b)&&((!_0x5e870e['is']('element')||!_0x16fd9b['is']('element')||_0x5e870e['name']===_0x16fd9b['name'])&&!(_0x5e870e['is']('element')&&!_0x16fd9b['is']('element')||!_0x5e870e['is']('element')&&_0x16fd9b['is']('element')));}['_haveSingleTopLevelElement'](_0x34dcdb){return 0x1===_0x34dcdb['childCount'];}['_haveOnlyInlineContent'](_0xe2c24e,_0x1cd960){for(const _0x4e5a63 of _0xe2c24e['getChildren']())if(_0x4e5a63['is']('element')&&!_0x1cd960['isInline'](_0x4e5a63))return!0x1;return!0x0;}['_upsertDataId'](_0x18e07a,_0x123f17){let _0x34f321=_0x18e07a['getAttribute'](_0x2772d6);return _0x34f321||(_0x34f321=_0x123f17(),_0x18e07a['_setAttribute'](_0x2772d6,_0x34f321)),_0x34f321;}}class Ro extends pt(){['id'];['contentNew'];['contentInitial'];['documentVersion'];constructor({id:_0x46f61,contentNew:_0x3686dd,contentInitial:_0x228e6d,documentVersion:_0x2a4cde}){super(),this['id']=_0x46f61,this['contentNew']=_0x3686dd,this['contentInitial']=_0x228e6d,this['documentVersion']=_0x2a4cde;}}class Oo extends ct(){['id'];['parent'];['_data'];['_editorOperations']=[];constructor(_0x17cfcd,_0x5225dc,_0x3d5778){super(),this['id']=_0x17cfcd,this['parent']=_0x3d5778,this['_data']=_0x5225dc,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 ko extends ct(){['id']=ot();['callId'];['_results']=new Map();['_changes']=[];['_sourceCheck'];['_documentData'];['_aiConnector'];['_reviewParams'];['_reviewArgs'];['_activeRequest']=null;['_currentError'];['_wasAborted']=!0x1;constructor(_0x41a444,_0x17aad1,_0x3addd4,_0x2eaf10,_0x1a89ef){super(),this['_sourceCheck']=_0x17aad1,this['_documentData']=_0x41a444,this['_aiConnector']=_0x3addd4,this['_reviewParams']=_0x2eaf10,this['_reviewArgs']=_0x1a89ef,this['on']('change:status',(_0x546ff8,_0x2a4b3b,_0x17439d)=>{'aborted'==_0x17439d&&(this['_wasAborted']=!0x0),this['fire']('reviewCheckRunUpdated',{'status':_0x17439d,'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'](_0x1a3432=>'pending'===_0x1a3432['status']);}get['currentError'](){return this['_currentError'];}['updateDocumentData'](_0x5d2707){this['_documentData']=_0x5d2707;}async['start'](){this['status']='loading',this['_currentError']=void 0x0;try{this['_activeRequest']=this['_createApiRequest']();const _0x353622=await this['_activeRequest']['getStream']();this['status']='data';for await(const _0x170890 of _0x353622)'unmodified'!==_0x170890['data']['operation']&&('error'!==_0x170890['data']['operation']?'review-metadata'!==_0x170890['event']?this['_addReviewCheckResult'](_0x170890['data']['dataId'],_0x170890['data']['textDelta']):this['callId']=_0x170890['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(_0x1d82fd){this['_currentError']=_0x1d82fd,_0x1d82fd instanceof Error&&_0x1d82fd['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'](_0x42f2fa,_0x1d9db0){const _0x4f8177=this['_results']['get'](_0x42f2fa);if(!_0x4f8177)return;if(0x0===_0x1d9db0['length'])return;const _0x304df9=[];_0x1d9db0['forEach']((_0x559469,_0x784804)=>{const _0x1de84b=new Oo(_0x4f8177['id']+'-'+_0x784804,_0x559469,_0x4f8177);_0x1de84b['on']('change:status',()=>{this['fire']('reviewCheckResultChangeStatusUpdated',{'change':_0x1de84b,'status':_0x1de84b['status']});}),_0x1de84b['on']('change:isActivated',()=>{_0x1de84b['isActivated']?this['fire']('reviewCheckResultActivated',{'change':_0x1de84b}):this['fire']('reviewCheckResultDeactivated',{'change':_0x1de84b});}),this['_changes']['push'](_0x1de84b),_0x304df9['push'](_0x1de84b);}),this['fire']('reviewCheckResultReady',{'changes':_0x304df9,'result':_0x4f8177,'source':this});}['abort'](){this['_activeRequest']&&(this['_activeRequest']['abortController']['abort'](),this['_activeRequest']=null,this['status']='aborted');}['isChangeActive'](_0x285362){const _0x286fdb=this['_changes']['find'](_0x14efb2=>_0x14efb2['id']===_0x285362);return!(!_0x286fdb||'pending'!==_0x286fdb['status']);}['isAnyChangeActivated'](){return this['_changes']['some'](_0x150f38=>!0x0===_0x150f38['isActivated']);}['getActiveChanges'](){return this['_changes']['filter'](_0x1bea8e=>'pending'===_0x1bea8e['status']);}['getChangeById'](_0x31a009){return this['_changes']['find'](_0x17e336=>_0x17e336['id']===_0x31a009);}['markAllChangesAsAccepted'](){for(const _0x403051 of this['_changes'])'pending'===_0x403051['status']&&(_0x403051['status']='accepted');this['_checkIfFinished']();}['markChangeAsAccepted'](_0x32e158){const _0x5ce7db=this['_changes']['find'](_0x4c54b8=>_0x4c54b8['id']===_0x32e158);_0x5ce7db&&'pending'===_0x5ce7db['status']&&(_0x5ce7db['status']='accepted'),this['_checkIfFinished']();}['markChangeAsRejected'](_0x15ee4c){const _0x4e8715=this['_changes']['find'](_0xb2a5b6=>_0xb2a5b6['id']===_0x15ee4c);_0x4e8715&&'pending'===_0x4e8715['status']&&(_0x4e8715['status']='rejected'),this['_checkIfFinished']();}['markChangeAsOutdated'](_0x209cc3){const _0x572f85=this['_changes']['find'](_0x82b366=>_0x82b366['id']===_0x209cc3);_0x572f85&&'pending'===_0x572f85['status']&&(_0x572f85['status']='outdated'),this['_checkIfFinished']();}['markChangeAsPending'](_0x3ff51a){const _0x3d6608=this['_changes']['find'](_0x56d9e8=>_0x56d9e8['id']===_0x3ff51a);_0x3d6608&&'outdated'===_0x3d6608['status']&&(_0x3d6608['status']='pending'),this['_checkIfFinished']();}['activateChange'](_0x316ecf){this['_changes']['filter'](_0xed9349=>_0xed9349['isActivated']&&_0xed9349['id']!==_0x316ecf)['forEach'](_0x2c745b=>{_0x2c745b['isActivated']=!0x1;});const _0x4236db=this['_changes']['find'](_0x42441f=>_0x42441f['id']===_0x316ecf);_0x4236db&&'pending'===_0x4236db['status']&&(_0x4236db['isActivated']=!0x0);}['deactivateChange'](){this['_changes']['filter'](_0x33dba3=>_0x33dba3['isActivated'])['forEach'](_0x4eb60d=>{_0x4eb60d['isActivated']=!0x1;});}['forceReadyState'](){this['status']='ready';}async['sendRating'](_0x17b6e2){if('initialized'===this['status']||'loading'===this['status']||'data'===this['status']||this['_wasAborted'])return;if(!this['callId']||0x0===this['_changes']['length'])return;let _0x212e5f;if(_0x17b6e2){const _0x4297ca=this['_changes']['find'](_0xf5e941=>_0xf5e941['id']===_0x17b6e2);if(_0x4297ca&&_0x4297ca['isRated'])return;_0x4297ca&&(_0x212e5f=_0x4297ca['parent']['id'],_0x4297ca['isRated']=!0x0);}const _0x382e52={'positiveCount':this['_changes']['filter'](_0x59d0e9=>'accepted'===_0x59d0e9['status'])['length'],'totalCount':this['_changes']['length']};this['_sendRatingRequest'](_0x382e52,this['callId'],_0x212e5f);}['_addReviewCheckResult'](_0x38b7c3,_0x5672fa){const _0x535e06=this['_documentData']['elements']['get'](_0x38b7c3);if(!_0x535e06)return;const _0x51111d=_0x535e06['getContent']();if(_0x51111d===_0x5672fa)return;const _0x3f0c79=new Ro({'id':_0x38b7c3,'contentInitial':_0x51111d,'contentNew':_0x5672fa,'documentVersion':this['_documentData']['version']});this['_results']['set'](_0x3f0c79['id'],_0x3f0c79),this['fire']('reviewCheckResultAdded',{'result':_0x3f0c79,'source':this});}['_checkIfFinished'](){'finished'===this['status']&&(this['_changes']['filter'](_0x316d60=>'pending'===_0x316d60['status'])['length']>0x0&&(this['status']='ready')),'ready'===this['status']&&(0x0===this['_changes']['filter'](_0x24c7e0=>'pending'===_0x24c7e0['status'])['length']&&(this['status']='finished'));}}class No extends ko{get['subTitle'](){if(!this['_reviewParams']||0x0===this['_reviewParams']['length'])return'';const _0xbbff52=[];if(this['_reviewParams']['length']>0x0&&this['_sourceCheck']['options'])for(let _0x2f4f49=0x0;_0x2f4f49<this['_reviewParams']['length'];_0x2f4f49++){if(!this['_reviewParams'][_0x2f4f49]||!this['_sourceCheck']['options'][_0x2f4f49])continue;const _0x517b7e=this['_sourceCheck']['options'][_0x2f4f49],_0x20657c=_0x517b7e['data']?.['find'](_0x48e44b=>_0x48e44b['id']===this['_reviewParams'][_0x2f4f49]);_0x20657c&&_0xbbff52['push'](_0x20657c['label']);}return _0xbbff52['join'](',\x20');}get['reviewName'](){return this['_composeReviewName']();}['_createApiRequest'](){return this['_aiConnector']['callSystemReview']({'reviewName':this['_composeReviewName'](),'content':this['_documentData']['content'],'args':this['_reviewArgs']});}['_sendRatingRequest'](_0xeb4663,_0x3400ae,_0x134e73){return this['_aiConnector']['upsertAIReviewRating'](this['reviewName'],_0x3400ae,_0xeb4663,_0x134e73);}['_composeReviewName'](){return!this['_reviewParams']||0x0===this['_reviewParams']['length']||this['_sourceCheck']['useArgs']?this['_sourceCheck']['apiId']:[this['_sourceCheck']['apiId'],...this['_reviewParams']]['join']('-');}}class vo extends _0x12c8be{['_aiConnector'];['_aiReviewCoreUi'];['_aiReviewCoreEditing'];['_aiReviewCheckList'];['_currentReviewCheckRun'];['_changeActivationSource']=null;static get['requires'](){return[ls];}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(_0x7a3b1e,_0x2ed932)=>{const _0x2cf33=this['_aiReviewCheckList']['getCheckById'](_0x2ed932['id']);if(_0x2cf33){this['_onReviewCheckRun'](_0x2ed932),this['_aiReviewCoreEditing']['switchToReadOnly'](),this['_currentReviewCheckRun']=this['_createReviewCheckRun'](_0x2ed932,_0x2cf33),this['_aiReviewCoreUi']['setCheckResultTitle'](this['_currentReviewCheckRun']['title'],this['_currentReviewCheckRun']['subTitle']),this['_currentReviewCheckRun']['on']('reviewCheckRunUpdated',(_0x1fe4ab,_0x11f859)=>{switch(_0x11f859['status']){case'data':case'loading':this['_aiReviewCoreUi']['showCheckRunResults'](_0x11f859);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 ht('ai-review-mode-check-run-general-error',this,void 0x0,this['_currentReviewCheckRun']?.['currentError']));break;case'error-chunk':this['_aiReviewCoreUi']['showChunkErrorView'](),this['_logError'](new ht('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'!==_0x11f859['status']&&'error-chunk'!==_0x11f859['status']&&'error-general'!==_0x11f859['status']||this['_currentReviewCheckRun']?.['sendRating']();}),this['_currentReviewCheckRun']['on']('reviewCheckResultAdded',(_0x64a9ef,_0xb0a0dc)=>{if(!this['_currentReviewCheckRun'])throw new ht('ai-review-mode-no-current-check-run',this);const _0x16372d=this['_diffContent'](_0xb0a0dc['result']['contentInitial'],_0xb0a0dc['result']['contentNew']);_0xb0a0dc['source']['addResultChanges'](_0xb0a0dc['result']['id'],_0x16372d);}),this['_currentReviewCheckRun']['on']('reviewCheckResultReady',(_0x4f3dfa,_0x16e514)=>{for(const _0x1b2940 of _0x16e514['changes'])this['_aiReviewCoreUi']['showCheckRunResult'](_0x1b2940);this['_markChangePositionInEditorContent'](_0x16e514['changes'],_0x16e514['source']['documentData']);}),this['_currentReviewCheckRun']['on']('reviewCheckResultChangeStatusUpdated',(_0x2e87a9,_0x681ea0)=>{this['_aiReviewCoreUi']['updateChangeState'](_0x681ea0['change']['id'],_0x681ea0['status']);}),this['_currentReviewCheckRun']['on']('reviewCheckResultActivated',(_0x23fe5d,_0x53ad83)=>{this['_onReviewCheckResultActivated'](_0x53ad83);}),this['_currentReviewCheckRun']['on']('reviewCheckResultDeactivated',()=>{this['_onReviewCheckResultDeactivated']();});try{await this['_currentReviewCheckRun']['start']();}catch(_0x3f0a35){_0x3f0a35 instanceof Error&&_0x3f0a35['message']['includes']('ai-request-aborted')||(_0x3f0a35 instanceof ht?this['_logError'](_0x3f0a35):this['_logError'](new ht('ai-review-mode-check-run-failed',this,void 0x0,_0x3f0a35)));}}else this['_logError'](new ht('ai-review-mode-source-check-not-found',this,{'checkId':_0x2ed932['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 _0x4556c5=this['_currentReviewCheckRun']['getActiveChanges']();if(!_0x4556c5['length'])return;this['_aiReviewCoreEditing']['applyChange'](_0x4556c5['map'](_0x50feb0=>_0x50feb0['id']));const _0x18aa2c=this['_currentReviewCheckRun'];_0x18aa2c['markAllChangesAsAccepted'](),_0x18aa2c['sendRating']();}),this['listenTo'](this['_aiReviewCoreUi'],'acceptChange',(_0x56322c,_0x17a553)=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['isChangeActive'](_0x17a553['id'])&&(this['_aiReviewCoreEditing']['applyChange']([_0x17a553['id']]),this['_currentReviewCheckRun']['markChangeAsAccepted'](_0x17a553['id']),this['_aiReviewCoreUi']['hideChangeBalloon'](),this['_currentReviewCheckRun']['sendRating'](_0x17a553['id']));}),this['listenTo'](this['_aiReviewCoreUi'],'dismissChange',(_0x227ddb,_0x5c2662)=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['isChangeActive'](_0x5c2662['id'])&&(this['_aiReviewCoreEditing']['rejectChange'](_0x5c2662['id']),this['_currentReviewCheckRun']['markChangeAsRejected'](_0x5c2662['id']),this['_aiReviewCoreUi']['hideChangeBalloon'](),this['_currentReviewCheckRun']['sendRating'](_0x5c2662['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',(_0x50fcc9,_0x153e29)=>{this['_onActivateChange'](_0x153e29);}),this['listenTo'](this['_aiReviewCoreUi'],'deactivateChange',(_0x2ea56b,_0x2cfc65)=>{this['_onDeactivateChange'](_0x2cfc65);}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerClicked',(_0x580f2b,_0x47383c)=>{this['_onChangeMarkerClicked'](_0x580f2b,_0x47383c);}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerHovered',(_0x214b36,_0x1f73c8)=>{this['_onChangeMarkerHovered'](_0x214b36,_0x1f73c8);}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerBlurred',()=>{this['_onChangeMarkerBlurred']();}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerRemoved',(_0x4aec0c,_0x1e3d17)=>{this['_onChangeMarkerRemoved'](_0x4aec0c,_0x1e3d17);}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerRestored',(_0x3ade9e,_0x75e44a)=>{this['_onChangeMarkerRestored'](_0x3ade9e,_0x75e44a);});}['_createReviewCheckRun'](_0x38804e,_0x2829b7){return new No(this['_aiReviewCoreEditing']['getDocumentData'](),_0x2829b7,this['_aiConnector'],_0x38804e['params'],_0x38804e['args']);}['_onChangeMarkerRemoved'](_0x22299d,_0x5871ea){this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['markChangeAsOutdated'](_0x5871ea['changeId']);}['_onChangeMarkerRestored'](_0x4081b0,_0x4ac83a){this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['markChangeAsPending'](_0x4ac83a['changeId']);}['_onCheckRunFinished'](){this['_aiReviewCoreUi']['showReviewCompletedView']();}['_initRequiredPlugins'](){this['_aiConnector']=this['context']['plugins']['get']('AIConnector');}['_onReviewRunLeave'](_0xda9243=!0x1){this['_currentReviewCheckRun']&&(this['_currentReviewCheckRun']['hasModifications']||this['_currentReviewCheckRun']['sendRating'](),this['_currentReviewCheckRun']['stopListening'](),this['_currentReviewCheckRun']['abort'](),this['_currentReviewCheckRun']=void 0x0),_0xda9243&&this['_aiReviewCoreUi']['showReviewCheckList'](),this['_aiReviewCoreEditing']['clearAllMarkers'](),this['_aiReviewCoreEditing']['switchToEdit'](),this['_changeActivationSource']=null;const _0x3cc2d2=this['_aiReviewCoreEditing']['getEditor']();_0x3cc2d2&&_0x3cc2d2['editing']['view']['change'](_0x479b0a=>{const _0x577f16=_0x3cc2d2['editing']['view']['document']['getRoot']();_0x479b0a['removeClass']('ck-ai_review-diff',_0x577f16),_0x479b0a['removeClass']('ck-ai_review-highlights',_0x577f16),_0x479b0a['removeClass']('ck-ai-translate-mode-content',_0x577f16);});}['_getTranslationWithDefault'](_0x3c41c5,_0xe50acb){const _0x4f796b=us(this['context']['locale'],_0x3c41c5);return _0x4f796b===_0x3c41c5?_0xe50acb:_0x4f796b;}['_logError'](_0x27ed10,_0x4bb3f2=!0x1){mt(_0x27ed10['message']),_0x4bb3f2||(_0x27ed10['message']['startsWith']('ai-review-mode-models-unable-to-retrieve')?this['_aiReviewCoreUi']['showGeneralReviewCoreErrorView']():this['_aiReviewCoreUi']['showGeneralResultsErrorView']());}['_scrollToChange'](_0x214af4){if('content'===this['_changeActivationSource']){const _0x10f879=this['_aiReviewCoreUi']['getChangeElement'](_0x214af4);_0x10f879&&ft(_0x10f879['closest']('.ck-ai_review__check-run-result')||_0x10f879);}else{if('panel'===this['_changeActivationSource']){const _0x5c190c=this['_getChangeContentElement'](_0x214af4);if(!_0x5c190c)return;Ct({'target':_0x5c190c,'viewportOffset':{'top':0x55,'left':0x0,'bottom':0x0,'right':0x0},'ancestorOffset':0x14,'alignToTop':!0x0});}}}}const yo=[{'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 xo{['id'];['commandId'];['title'];['description'];['isParameterized'];['useArgs'];['options'];['args'];get['apiId'](){return this['commandId'];}constructor(_0x495c10){this['id']=_0x495c10['id'],this['commandId']=_0x495c10['commandId'],this['title']=_0x495c10['title'],this['description']=_0x495c10['description'],this['isParameterized']=_0x495c10['isParameterized'],this['useArgs']=_0x495c10['useArgs'],this['options']=_0x495c10['options'],this['args']=_0x495c10['args'];}}class Lo extends ct(){['_checks']=[];['setupChecks'](_0x5c5e32){this['_checks']=_0x5c5e32['map'](_0x293105=>new xo(_0x293105));}get['checks'](){return this['_checks'];}['getCheckById'](_0x7d39c0){return this['checks']['find'](_0x575bfb=>_0x575bfb['id']===_0x7d39c0);}['removeCheckById'](_0x34d88f){this['_checks']=this['_checks']['filter'](_0x482e14=>_0x482e14['id']!==_0x34d88f);}}class Do extends xo{['_models']=[];['_defaultModel']=null;constructor(_0x1cb671,_0xf0843b,_0x10e8be){super(_0x1cb671),this['_models']=_0xf0843b,this['_defaultModel']=_0x10e8be;}get['models'](){return this['_models'];}get['defaultModel'](){return this['_defaultModel'];}}class Po extends xo{['isExtra']=!0x0;['prompt'];['model'];['_defaultModel']=null;constructor(_0x1e6ab9,_0x1660e4,_0x347433){super(_0x1e6ab9),this['prompt']=_0x1e6ab9['prompt'],this['model']=_0x1e6ab9['model'],this['model']?this['_defaultModel']=_0x1660e4['find'](_0x195aa2=>_0x195aa2['id']===this['model'])||null:this['_defaultModel']=_0x347433;}get['defaultModel'](){return this['_defaultModel'];}}class Ho extends Lo{['_allModels']=[];['_recommendedModels']=[];['_defaultModel']=null;constructor(_0x18f298,_0x24b46b,_0x2b2d04){super(),this['_allModels']=_0x18f298,this['_recommendedModels']=_0x24b46b,this['_defaultModel']=_0x2b2d04;}['setupChecks'](_0x4ad295){this['_checks']=_0x4ad295['map'](_0x2346c3=>!0x0===_0x2346c3['isExtra']?new Po(_0x2346c3,this['_allModels'],this['_defaultModel']):'custom'===_0x2346c3['id']?new Do(_0x2346c3,this['_recommendedModels'],this['_defaultModel']):new xo(_0x2346c3));}}class Mo extends ko{['_prompt'];['_model'];constructor(_0x211813,_0x22ade2,_0x41f56d,_0x264346,_0x23775f){super(_0x41f56d,_0x264346,_0x23775f),this['_prompt']=_0x211813,this['_model']=_0x22ade2;}get['subTitle'](){return this['_prompt'];}['_createApiRequest'](){return this['_aiConnector']['callCustomReview']({'content':this['_documentData']['content'],'prompt':this['_prompt'],'model':this['_model']});}['_sendRatingRequest'](_0x52a15f,_0x592b72,_0x3203f8){return this['_aiConnector']['upsertCustomAIReviewRating'](_0x592b72,_0x52a15f,_0x3203f8);}}class Uo extends Mo{get['subTitle'](){return'';}set['prompt'](_0xef8013){this['_prompt']=_0xef8013;}set['model'](_0x4f1d60){this['_model']=_0x4f1d60;}}class Vo extends vo{static get['pluginName'](){return'AIReviewModeController';}['_isDiffOn']=!0x1;['_hasDefaultAvailableCommands']=!0x1;constructor(_0x224b2c){super(_0x224b2c),this['_hasDefaultAvailableCommands']=!this['context']['config']['get']('ai.review.availableCommands'),this['context']['config']['define']('ai.review.availableCommands',yo['map'](_0x3a9aff=>_0x3a9aff['id'])),this['context']['config']['define']('ai.review.extraCommands',[]);}async['init'](){await super['init'](),this['listenTo'](this['_aiReviewCoreUi'],'toggleDiff',(_0x3296ef,_0x44c8e4)=>{this['_isDiffOn']=_0x44c8e4['on'],this['_onDiffChange'](this['_isDiffOn']);});}['_initRequiredPlugins'](){super['_initRequiredPlugins'](),this['_aiReviewCoreUi']=this['context']['plugins']['get']('AIReviewModeUI'),this['_aiReviewCoreEditing']=this['context']['plugins']['get']('AIReviewCoreEditing');}['_createReviewCheckRun'](_0x24c950,_0x4e0913){return _0x24c950['isCustom']?new Mo(_0x24c950['args']['prompt'],_0x24c950['args']['model'],this['_aiReviewCoreEditing']['getDocumentData'](),_0x4e0913,this['_aiConnector']):_0x4e0913['isExtra']?new Uo(_0x4e0913['prompt'],_0x4e0913['defaultModel']['id'],this['_aiReviewCoreEditing']['getDocumentData'](),_0x4e0913,this['_aiConnector']):new No(this['_aiReviewCoreEditing']['getDocumentData'](),_0x4e0913,this['_aiConnector'],_0x24c950['params'],_0x24c950['args']);}['_onReviewCheckResultActivated'](_0x409b00){this['_aiReviewCoreUi']['setActiveStateInResults'](_0x409b00['change']['id']),this['_scrollToChange'](_0x409b00['change']['id']);const _0x12e592=this['_aiReviewCoreEditing']['getMarkerElementForChange'](_0x409b00['change']['id']);if(!_0x12e592)return;const _0x3c2d2c=this['_aiReviewCoreEditing']['getEditor']();this['_aiReviewCoreUi']['showChangeBalloon'](_0x409b00['change'],()=>_0x12e592['getElement'](),void 0x0,'click',_0x3c2d2c?.['editing']?.['view']?.['getDomRoot'](),_0x3c2d2c?.['ui']?.['viewportOffset']),this['_aiReviewCoreEditing']['setMarkersInElementAsActive'](_0x409b00['change']['id']);}['_onReviewCheckResultDeactivated'](){this['_aiReviewCoreUi']['resetActiveStateInResults'](),this['_aiReviewCoreUi']['hideChangeBalloon'](),this['_aiReviewCoreEditing']['setAllMarkersAsInactive']();}['_onActivateChange'](_0x5533d0){this['_currentReviewCheckRun']&&'click'===_0x5533d0['uiInteraction']&&(this['_changeActivationSource']='panel',this['_currentReviewCheckRun']['activateChange'](_0x5533d0['id']));}['_onDeactivateChange'](_0x519312){this['_currentReviewCheckRun']&&'balloon'===_0x519312['origin']&&this['_currentReviewCheckRun']['deactivateChange']();}['_onChangeMarkerClicked'](_0x330b0e,_0x249f16){if(!this['_currentReviewCheckRun'])return;this['_changeActivationSource']='content',this['_currentReviewCheckRun']['activateChange'](_0x249f16['changeId']);const _0xcb71ab=this['_currentReviewCheckRun']['getChangeById'](_0x249f16['changeId']);if(!_0xcb71ab)return;const _0x3219ce=this['_aiReviewCoreEditing']['getEditor']();this['_aiReviewCoreUi']['showChangeBalloon'](_0xcb71ab,_0x249f16['markerElement'],_0x249f16['domEvent'],'click',_0x3219ce?.['editing']?.['view']?.['getDomRoot'](),_0x3219ce?.['ui']?.['viewportOffset']);}['_onChangeMarkerHovered'](_0xc8d367,_0x1dc25e){if(!this['_currentReviewCheckRun'])return;if(this['_currentReviewCheckRun']['isAnyChangeActivated']())return;const _0x2febd4=this['_currentReviewCheckRun']['getChangeById'](_0x1dc25e['changeId']);if(!_0x2febd4)return;const _0x589ce8=this['_aiReviewCoreEditing']['getEditor']();this['_aiReviewCoreUi']['showChangeBalloon'](_0x2febd4,_0x1dc25e['markerElement'],_0x1dc25e['domEvent'],'hover',_0x589ce8?.['editing']?.['view']?.['getDomRoot'](),_0x589ce8?.['ui']?.['viewportOffset']);}['_onChangeMarkerBlurred'](){if(!this['_currentReviewCheckRun'])return;this['_currentReviewCheckRun']['isAnyChangeActivated']()||this['_aiReviewCoreUi']['hideChangeBalloon']();}['_getChangeContentElement'](_0x23e726){const _0x3f54d0=this['_aiReviewCoreEditing']['getMarkerElementForChange'](_0x23e726);return _0x3f54d0?_0x3f54d0['getElement']():null;}['_markChangePositionInEditorContent'](_0x59906d,_0x55f701){this['_aiReviewCoreEditing']['markChangePositionInEditorContent'](_0x59906d,_0x55f701);}['_diffContent'](_0x31c562,_0x39ccec){return this['_aiReviewCoreEditing']['diffContent'](_0x31c562,_0x39ccec);}['_onReviewCheckRun'](){this['_onDiffChange'](this['_isDiffOn']);}['_onDiffChange'](_0x5a6032){const _0x16d40a=this['_aiReviewCoreEditing']['getEditor']();_0x5a6032?this['_aiReviewCoreUi']['hideDiffInBalloon']():this['_aiReviewCoreUi']['showDiffInBalloon'](),_0x16d40a&&_0x16d40a['editing']['view']['change'](_0x25667b=>{const _0x47454d=_0x16d40a['editing']['view']['document']['getRoot']();for(const _0x12df7e of _0x47454d['getClassNames']())_0x12df7e['startsWith']('ck-ai_review-')&&_0x25667b['removeClass'](_0x12df7e,_0x47454d);_0x25667b['addClass'](_0x5a6032?'ck-ai_review-diff':'ck-ai_review-highlights',_0x47454d);});}async['_getChecksList'](){const _0x1c8534=[...yo,...this['_getExtraChecks']()],_0x46e3ab=this['context']['config']['get']('ai.review.availableCommands')||[];this['_logErrorForNonExistentChecks'](_0x46e3ab,_0x1c8534);let _0x2d21ea=_0x1c8534;this['_hasDefaultAvailableCommands']||(_0x2d21ea=_0x46e3ab['map'](_0x4aafe2=>_0x1c8534['find'](_0x93bc53=>_0x93bc53['id']===_0x4aafe2))['filter'](_0x5e8fd9=>!!_0x5e8fd9)),_0x2d21ea=_0x2d21ea['map'](_0x528cc6=>_0x528cc6['isExtra']?_0x528cc6:this['_translateReviewCheck'](_0x528cc6));const _0x1db780=_0x2d21ea['some'](_0x36d1bc=>_0x36d1bc['isExtra']||'custom'===_0x36d1bc['id']);let _0x4b7eed=[],_0x10a437=[],_0x5e1575=null;if(_0x1db780){const _0x28c961=await this['_getModels']();_0x4b7eed=_0x28c961['all'],_0x10a437=_0x28c961['recommended'],_0x5e1575=_0x28c961['default'];}const _0x2f088c=new Ho(_0x4b7eed,_0x10a437,_0x5e1575);return _0x2f088c['setupChecks'](_0x2d21ea),_0x1db780&&this['_filterChecksWithMissingModel'](_0x2f088c),_0x2f088c;}['_getExtraChecks'](){return(this['context']['config']['get']('ai.review.extraCommands')||[])['map'](_0x692c6a=>({'id':_0x692c6a['id'],'commandId':_0x692c6a['id'],'title':_0x692c6a['label'],'description':_0x692c6a['description'],'isParameterized':!0x1,'isExtra':!0x0,'prompt':_0x692c6a['prompt'],'model':_0x692c6a['model']}));}['_logErrorForNonExistentChecks'](_0x241d40,_0x18fe97){const _0x302e0b=_0x241d40['filter'](_0x584eb7=>!_0x18fe97['some'](_0x26c6f3=>_0x26c6f3['id']===_0x584eb7));_0x302e0b['length']&&this['_logError'](new ht('ai-review-mode-non-existent-commands-used',this,{'commandIds':_0x302e0b['join'](',\x20')}),!0x0);}async['_getModels'](){try{const _0x2b6d5c=new qs({'connector':this['_aiConnector'],'config':this['context']['config']['get']('ai.models'),'locale':this['context']['locale']});return{'all':await _0x2b6d5c['getAll'](),'recommended':await _0x2b6d5c['getAvailableModels'](),'default':await _0x2b6d5c['getDefault']()};}catch(_0x2aba38){return this['_logError'](new ht('ai-review-mode-models-unable-to-retrieve',this,void 0x0,_0x2aba38)),{'all':[],'recommended':[],'default':null};}}['_translateReviewCheck'](_0x17f751){const _0x11740d='AI_REVIEW_CHECK_'+_0x17f751['id']['toUpperCase']()['replaceAll']('-','_'),_0x47761f={..._0x17f751,'title':this['_getTranslationWithDefault'](_0x11740d+'_TITLE',_0x17f751['title']),'description':this['_getTranslationWithDefault'](_0x11740d+'_DESCRIPTION',_0x17f751['description'])};return _0x17f751['options']&&(_0x47761f['options']=_0x17f751['options']['map'](_0x536f7b=>({..._0x536f7b,'label':this['_getTranslationWithDefault'](_0x11740d+'_OPTIONS_LABEL',_0x536f7b['label']||''),'data':_0x536f7b['data']?_0x536f7b['data']['map'](_0x16cc86=>({..._0x16cc86,'label':this['_getTranslationWithDefault'](_0x11740d+'_OPTIONS_DATA_'+_0x16cc86['id']['toUpperCase'](),_0x16cc86['label'])})):void 0x0}))),_0x47761f;}['_filterChecksWithMissingModel'](_0x4d85ff){const _0x3f74d6=[];_0x4d85ff['checks']['forEach'](_0x279b76=>{(_0x279b76 instanceof Po&&!_0x279b76['defaultModel']||_0x279b76 instanceof Do&&!_0x279b76['models']['length'])&&_0x3f74d6['push'](_0x279b76['id']);}),_0x3f74d6['length']&&_0x3f74d6['forEach'](_0x26e0ca=>{_0x4d85ff['removeCheckById'](_0x26e0ca),this['_logError'](new ht('ai-review-mode-command-unavailable-due-to-missing-model',this,{'commandId':_0x26e0ca}),!0x0);});}}class Bo extends _0x12c8be{static get['requires'](){return[Vo,fo,bo];}static get['pluginName'](){return'AIReviewMode';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class Go extends xo{get['apiId'](){return'translate';}}class Fo extends Lo{['setupChecks'](_0x4325fa){this['_checks']=_0x4325fa['map'](_0x5ed2c5=>new Go(_0x5ed2c5));}}class Ko extends No{['_title'];constructor(_0x4a457b,_0x1dfc4e,_0x2d03ff,_0x69007b,_0x668cb6,_0x5b2e13){super(_0x4a457b,_0x1dfc4e,_0x2d03ff,_0x668cb6,_0x5b2e13),this['_title']=_0x69007b;}get['title'](){return this['_title'];}get['subTitle'](){return this['_sourceCheck']['title'];}}class Wo extends vo{static get['pluginName'](){return'AITranslateController';}constructor(_0x1cf8bf){super(_0x1cf8bf),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'](_0xbd0428,_0x44e88e){return new Ko(this['_aiReviewCoreEditing']['getDocumentData'](),_0x44e88e,this['_aiConnector'],us(this['context']['locale'],'AI_REVIEW_CHECK_TRANSLATE_TITLE'),_0xbd0428['params'],_0xbd0428['args']);}['_onReviewCheckResultActivated'](_0x3758f2){this['_aiReviewCoreUi']['setActiveStateInResults'](_0x3758f2['change']['id']),this['_aiReviewCoreEditing']['setMarkersInElementAsActive'](_0x3758f2['change']['id']);}['_onReviewCheckResultDeactivated'](){this['_aiReviewCoreEditing']['setAllMarkersAsInactive'](),this['_aiReviewCoreUi']['resetActiveStateInResults']();}['_onActivateChange'](_0x3de2db){this['_currentReviewCheckRun']&&('hover'===_0x3de2db['uiInteraction']&&(this['_changeActivationSource']='panel',this['_currentReviewCheckRun']['activateChange'](_0x3de2db['id'])),'click'===_0x3de2db['uiInteraction']&&this['_scrollToChange'](_0x3de2db['id']));}['_onDeactivateChange'](_0x4645dd){this['_currentReviewCheckRun']&&'panel'===_0x4645dd['origin']&&this['_currentReviewCheckRun']['deactivateChange']();}['_onChangeMarkerClicked'](_0x57c97d,_0x23dc61){this['_currentReviewCheckRun']&&(this['_changeActivationSource']='content',this['_currentReviewCheckRun']['activateChange'](_0x23dc61['changeId']),this['_scrollToChange'](_0x23dc61['changeId']));}['_onChangeMarkerHovered'](_0x550941,_0x567303){this['_currentReviewCheckRun']&&(this['_changeActivationSource']='content',this['_currentReviewCheckRun']['activateChange'](_0x567303['changeId']),this['_aiReviewCoreEditing']['reactivateMarkers'](_0x567303['changeId']));}['_onChangeMarkerBlurred'](){this['_currentReviewCheckRun']&&'content'===this['_changeActivationSource']&&(this['_currentReviewCheckRun']['deactivateChange'](),this['_aiReviewCoreEditing']['setAllMarkersAsInactive']());}['_getChangeContentElement'](_0x330671){return this['_aiReviewCoreEditing']['getContentElementForChange'](_0x330671);}['_markChangePositionInEditorContent'](_0x3bb388,_0x587f6a){this['_aiReviewCoreEditing']['markChangePositionInEditorContent'](_0x3bb388,_0x587f6a);}['_diffContent'](_0x1e0990,_0x8eedeb){return this['_aiReviewCoreEditing']['diffContent'](_0x1e0990,_0x8eedeb,!0x0);}['_onReviewCheckRun'](){const _0x23d4a5=this['_aiReviewCoreEditing']['getEditor']();_0x23d4a5&&_0x23d4a5['editing']['view']['change'](_0x586c88=>{const _0x5e151c=_0x23d4a5['editing']['view']['document']['getRoot']();for(const _0x8b2ef5 of _0x5e151c['getClassNames']())(_0x8b2ef5['startsWith']('ck-ai-review-')||'ck-ai-translate-'===_0x8b2ef5)&&_0x586c88['removeClass'](_0x8b2ef5,_0x5e151c);_0x586c88['addClass']('ck-ai-translate-mode-content',_0x5e151c);});}async['_getChecksList'](){const _0x35619f=[],_0x276f72=this['context']['config']['get']('ai.translate.languages')||[];for(const _0x25645a of _0x276f72)_0x35619f['push']({'title':_0x25645a['label'],'id':_0x25645a['id'],'commandId':_0x25645a['id'],'description':'','isParameterized':!0x1,'useArgs':!0x0,'args':{'language':_0x25645a['id']}});const _0x50cb5f=new Fo();return _0x50cb5f['setupChecks'](this['_translateChecks'](_0x35619f)),_0x50cb5f;}['_translateChecks'](_0x506566){return _0x506566['map'](_0x4b04ad=>{const _0xbf7621='AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_'+_0x4b04ad['title']['toUpperCase']()['replaceAll']('-','_');return{..._0x4b04ad,'title':this['_getTranslationWithDefault'](_0xbf7621,_0x4b04ad['title'])};});}}class Yo extends _o{constructor(_0x456c30,_0x14b801){super(_0x456c30,_0x14b801),this['on']('set:isLoading',(_0x26d2da,_0x11c7b5,_0x381c95)=>{_0x381c95&&(this['headerTitle']=us(this['locale'],'AI_TRANSLATE_CHECK_RESULTS_LOADING_TITLE'));}),this['on']('set:isResultReady',(_0x2bacf8,_0x5258f4,_0x13cdd7)=>{_0x13cdd7&&(this['headerTitle']=us(this['locale'],'AI_TRANSLATE_CHECK_RESULTS_READY_TITLE'));});}['_createAcceptAllButtonView'](){const _0x1f71f0=super['_createAcceptAllButtonView']();return _0x1f71f0['set']('label',us(this['locale'],'AI_TRANSLATE_ACCEPT_ALL')),_0x1f71f0;}['_createExitReviewButtonView'](){const _0x1304e2=super['_createExitReviewButtonView']();return _0x1304e2['set']('label',us(this['locale'],'AI_CHAT_HISTORY_CANCEL')),_0x1304e2;}}class $o extends wo{['_setupTemplate'](){const _0x1d3a19=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-translate__check-list-wrapper',_0x1d3a19['if']('isVisible','ck-hidden',_0x1e4968=>!_0x1e4968)]},'children':[{'tag':'div','attributes':{'class':['ck-ai-translate__check-list-header']},'children':[{'tag':'h2','children':[{'text':us(this['locale'],'AI_TRANSLATE_CHECK_LIST_HEADER_TITLE')}]},{'tag':'p','children':[{'text':us(this['locale'],'AI_TRANSLATE_CHECK_LIST_HEADER_DESCRIPTION')}]}]},{'tag':'div','attributes':{'class':['ck-ai_review__check-list',_0x1d3a19['if']('isVisible','ck-hidden',_0xb69d88=>!_0xb69d88)]},'children':this['_checkViews']}]});}}class qo extends ho{static get['pluginName'](){return'AITranslateUI';}['createMainView'](){const _0x541c75=this['context']['locale'],_0x1c1dab=new _0x1b248d(_0x541c75,{'label':us(_0x541c75,'AI_REVIEW_CHECK_TRANSLATE_TITLE'),'icon':_0x275309,'class':'ck-ai-header\x20ck-ai-header_review-translate'}),_0x18971d=new lo(_0x541c75,{'header':_0x1c1dab,'list':new $o(_0x541c75),'results':new Yo(_0x541c75,{'generalErrorText':us(_0x541c75,'AI_TRANSLATE_GENERAL_ERROR_MESSAGE')}),'completed':new Ao(_0x541c75,{'headerText':us(_0x541c75,'AI_TRANSLATE_FINISH_HEADER_TITLE'),'emptyResultsText':us(_0x541c75,'AI_TRANSLATE_EMPTY_RESULTS_TEXT'),'buttonText':us(_0x541c75,'AI_TRANSLATE_FINISH_BUTTON_LABEL')})});return _0x18971d['extendTemplate']({'attributes':{'class':'ck-ai-translate-mode'}}),_0x18971d;}['registerTab'](){const _0x1b7275=this['context']['plugins']['get']('AITabs');_0x1b7275['view']['on']('activateTab',(_0x407b94,_0x53f41b)=>{'translate'===_0x53f41b?this['fire']('getReviewCheckList'):this['fire']('leaveReview');}),_0x1b7275['view']['addTab']({'id':'translate','buttonLabel':us(this['context']['locale'],'AI_REVIEW_CHECK_TRANSLATE_TITLE'),'buttonIcon':_0x275309,'order':0x0,'content':this['_mainView']});}}class Qo extends _0x12c8be{static get['requires'](){return[Wo,qo,bo];}static get['pluginName'](){return'AITranslate';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}export{eo as AIActions,io as AIActionsNames,Ni as AIAdapter,Ji as AIAssistant,Xi as AIAssistantUI,ka as AIBalloon,Ea as AIChat,Js as AIChatController,Ia as AIChatHistory,ga as AIChatHistoryController,da as AIChatHistoryUI,wa as AIChatShortcuts,aa as AIChatUI,ls as AIConnector,tn as AIEditing,La as AIEditorIntegration,no as AIQuickActionType,so as AIQuickActions,Ya as AIQuickActionsUI,vi as AIRequestError,xo as AIReviewCheck,Ro as AIReviewCheckResult,ko as AIReviewCheckRun,Bo as AIReviewMode,vo as AIReviewModeController,bo as AIReviewModeEditing,fo as AIReviewModeUI,cs as AITabs,ts as AITextAdapter,Sa as AIToggleButtonUI,Qo as AITranslate,Wo as AITranslateController,qo as AITranslateUI,is as AWSTextAdapter,es as OpenAITextAdapter,xi as ShowAIAssistantCommand,fa as ToggleAICommand,gs as createResizeButton,Zi as getDefaultAICommands};
23
+ import{Plugin as _0x58645c,Command as _0x26b415,ContextPlugin as _0x25e92e,Editor as _0x457883}from'@ckeditor/ckeditor5-core/dist/index.js';import{IconCopy as _0xae9e3f,IconCheck as _0xe4c6eb,IconError as _0x592f91,IconSubmit as _0x4509b9,IconAIHistory as _0xc604bb,IconMagicWand as _0xbaeee1,IconRobotPencil as _0x1c8122,IconMaximize as _0x1479f2,IconMinimize as _0x17f5ad,IconShowChangesOn as _0x4a5aa5,IconShowChangesOff as _0xfbc311,IconDocument as _0xa5e512,IconBoxWithCross as _0x1e153a,IconBoxWithCheck as _0x503b53,IconBoxWithMarker as _0x2009cd,IconInfo as _0x293cf9,IconWeb as _0x43b9e2,IconClose as _0x4310eb,IconSelection as _0x5f35af,IconFileUpload as _0x33be6f,IconLink as _0x1091b0,IconBulb as _0xdc1179,IconAI as _0x16b8d8,IconPreviousArrow as _0x5005b7,IconDocumentOutline as _0x42b884,IconLoupe as _0x5c1e6b,IconCancel as _0x45659b,IconPaperClip as _0x3e656c,IconBrowseFiles as _0x1a4e7f,IconDropdownArrow as _0x26638d,IconStop as _0x270a28,IconAIChat as _0x439de6,IconPlus as _0x4ec8b1,IconPin as _0xc8b8cf,IconThreeHorizontalDots as _0x1d2157,IconAIReview as _0x1d0da2,IconAITranslate as _0x4f4fba,IconAIAskAI as _0x1f8a65,IconThumbUp as _0x2257e0,IconThumbDown as _0x38052d,IconChevronDown as _0x57ee7e,IconChevronUp as _0x499377,IconAIQuickActions as _0x195043,IconAIChatCommands as _0x541b7d,IconAIImproveWriting as _0x3451ae,IconAIContinueWriting as _0x2eaf7f,IconAIGrammarCheck as _0x14ca44,IconAIAdjustLength as _0x1885aa,IconAIChangeTone as _0x5d5e5c,IconAIOther as tt,IconRefresh as et,IconNextArrow as it,IconOutdated as st,IconEye as nt,IconEyeCrossedOut as rt,IconChevronRight as at}from'@ckeditor/ckeditor5-icons/dist/index.js';import{uid as ot,CKEditorError as ht,ObservableMixin as ct,global as lt,isVisible as ut,Rect as dt,Collection as _t,FocusTracker as At,KeystrokeHandler as gt,first as It,toArray as Et,EmitterMixin as pt,logWarning as Tt,logError as mt,scrollViewportToShowTarget as Ct,insertToPriorityArray as wt,scrollAncestorsToShowTarget as ft,ResizeObserver as St,_isMotionReduced as bt,getConstrainedViewportRect as Rt,DomEmitterMixin as Ot}from'@ckeditor/ckeditor5-utils/dist/index.js';import{ToolbarView as kt,ButtonView as Nt,View as vt,SpinnerView as yt,IconView as xt,AutocompleteView as Lt,ListView as Dt,ListItemGroupView as Pt,ListItemView as Ht,ButtonLabelView as Mt,FocusCycler as Ut,createLabeledTextarea as Vt,Dialog as Bt,createDropdown as Gt,addMenuToDropdown as Ft,MenuBarMenuView as Kt,MenuBarMenuListItemButtonView as Wt,DialogViewPosition as Yt,MenuBarMenuListView as $t,MenuBarMenuListItemView as qt,BodyCollection as Qt,BalloonPanelView as Xt,clickOutsideHandler as zt,addListToDropdown as jt,UIModel as Jt,submitHandler as Zt,LabeledFieldView as te,createLabeledInputText as _0x426dd5,FormHeaderView as _0x16cf91,HighlightedTextView as _0x5baf8b,ViewCollection as _0x4539b4,FileDialogButtonView as _0x4a4e34,InputTextView as _0x4b5d97,SearchTextView as _0x214c15,ListItemButtonView as _0x4c2ae7,ButtonLabelWithHighlightView as _0xdf6870,DropdownMenuPanelPositioningFunctions as _0x450e74,BalloonToolbar as _0x1107e4,FormRowView as _0xe9ce1a,TextareaView as _0x4939e3}from'@ckeditor/ckeditor5-ui/dist/index.js';import{ClipboardPipeline as _0x21b716,ClipboardMarkersUtils as _0x44db63}from'@ckeditor/ckeditor5-clipboard/dist/index.js';import{ViewDocumentDomEventData as _0x5f08c8,ViewDataTransfer as _0x425595,ViewUpcastWriter as _0x41b10f,Matcher as _0x4bce65,_DetachOperation as _0x285dd6,_insertIntoModelNodeList as _0x358c66,_removeFromModelNodeList as _0x3acfdc,ModelRange as _0x3b0db7,transformOperationSets as _0x20fadc,ViewDowncastWriter as _0x5e3237,ModelDocumentFragment as _0x35cdec,ModelPosition as _0x54fe5a,ModelTreeWalker as _0x13e536,MarkerOperation as _0x25bdad,InsertOperation as _0x17ac9e}from'@ckeditor/ckeditor5-engine/dist/index.js';import{unescape as _0x4b02ea,escape as _0x24fbe9,cloneDeep as _0x13755d,escapeRegExp as _0x20b9f0,debounce as _0x5466d9}from'es-toolkit/compat';import{BedrockRuntimeClient as _0x103c47,InvokeModelWithResponseStreamCommand as _0x2a5aac,InvokeModelCommand as _0x49c1ec}from'@aws-sdk/client-bedrock-runtime';import{createParser as _0x1eaed0}from'eventsource-parser';import{CloudServices as _0x219338}from'@ckeditor/ckeditor5-cloud-services/dist/index.js';import{parseDocument as _0x12da97}from'htmlparser2';import{isTag as _0x158702,findOne as _0x5b0b3c,getParent as _0x4b4520,findAll as _0x5bcee3,removeElement as _0x4a6be4,replaceElement as _0x15065f,prepend as _0x5c4e1e,prependChild as _0x4128f7,appendChild as _0x35b472,append as _0x104e4c,find as _0x23ffc2,isComment as _0x6c1ccb,getChildren as ti,textContent as _0x19197f}from'domutils';import _0x208fec from'dom-serializer';import{Document as _0x3c6c04,Element as _0x359756,Text as _0x111ade,cloneNode as _0x857c03,isDocument as _0x35d982,isText as _0x4dc3eb,NodeWithChildren as _0x3d43de}from'domhandler';import{MarkdownGfmMdToHtmlDefaultPlugins as _0x13b68e,MarkdownGfmMdToHtml as _0x64e73e}from'@ckeditor/ckeditor5-markdown-gfm/dist/index.js';import _0x29d3ed from'rehype-sanitize';import{fixElementSuggestionRange as _0x1cd318,DocumentCompare as _0x32e5d7,DATA_ID_MODEL_ATTRIBUTE as _0x5e786f,ConfirmMixin as _0xb2e6c2,LateFocusDropdownButtonView as _0x440150,getAllMarkersDomElementsSorted as _0x342638,SuggestionsConversion as _0x3b3ef5,DATA_ID_VIEW_ATTRIBUTE as _0x1fa8e5,getMarkerDomElement as _0x3cee99}from'@ckeditor/ckeditor5-collaboration-core/dist/index.js';import _0x2f4117 from'morphdom';import{diffArrays as _0xfe775d}from'diff';const Si='_ungrouppedCommands';function bi(_0x50691b,_0x5b36a9){const _0x2039a9=(0x0,_0x5b36a9['t'])('Other');return _0x50691b['length']?'groupId'in _0x50691b[0x0]?_0x50691b:[{'groupId':Si,'groupLabel':_0x2039a9,'order':0x1/0x0,'commands':_0x50691b}]:[{'groupId':Si,'groupLabel':_0x2039a9,'order':0x1/0x0,'commands':[]}];}const Ri=globalThis['DataTransfer'],Oi='ai-ui';class ki extends _0x58645c{static get['pluginName'](){return'AIAssistantEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const {editor:_0x359ea7}=this,_0x1ef446=['ck-fake-ai-selection'];_0x359ea7['config']['get']('ai.assistant.useTheme')&&_0x1ef446['push']('ck-ai-assistant-ui_theme'),_0x359ea7['conversion']['for']('editingDowncast')['markerToHighlight']({'model':Oi,'view':{'classes':_0x1ef446,'priority':0xc}}),_0x359ea7['conversion']['for']('editingDowncast')['markerToElement']({'model':Oi,'view':(_0x4ad028,{writer:_0x2766ed})=>{if(!_0x4ad028['markerRange']['isCollapsed'])return null;const _0x488e4a=_0x2766ed['createUIElement']('span');return _0x2766ed['addClass'](['ck-fake-ai-selection','ck-fake-ai-selection_collapsed'],_0x488e4a),_0x488e4a;}});}['afterInit'](){!async function(_0x3540b0){const _0x3adf4e=_0x4b847f([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]),_0x5c9f45=0x3dffc4e1,_0x46f492=0x3df841a1^_0x5c9f45,_0x10b906=window[_0x4b847f([0x44,0x61,0x74,0x65])][_0x4b847f([0x6e,0x6f,0x77])](),_0x5bd5dd=_0x3540b0[_0x4b847f([0x65,0x64,0x69,0x74,0x6f,0x72])],_0x423f5c=new window[(_0x4b847f([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0xb689a2=>{_0x5bd5dd[_0x4b847f([0x6f,0x6e,0x63,0x65])](_0x4b847f([0x72,0x65,0x61,0x64,0x79]),_0xb689a2);}),_0x393e6d={[_0x4b847f([0x6b,0x74,0x79])]:_0x4b847f([0x45,0x43]),[_0x4b847f([0x75,0x73,0x65])]:_0x4b847f([0x73,0x69,0x67]),[_0x4b847f([0x63,0x72,0x76])]:_0x4b847f([0x50,0x2d,0x32,0x35,0x36]),[_0x4b847f([0x78])]:_0x4b847f([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]),[_0x4b847f([0x79])]:_0x4b847f([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]),[_0x4b847f([0x61,0x6c,0x67])]:_0x4b847f([0x45,0x53,0x32,0x35,0x36])},_0x3de149=_0x5bd5dd[_0x4b847f([0x63,0x6f,0x6e,0x66,0x69,0x67])][_0x4b847f([0x67,0x65,0x74])](_0x4b847f([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79]));async function _0x3b8ab0(){let _0x33a371,_0x442384=null,_0x303789=null;try{if(_0x3de149==_0x4b847f([0x47,0x50,0x4c]))return _0x4b847f([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]);if(_0x33a371=_0x3a18f6(),!_0x33a371)return _0x4b847f([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);return _0x33a371[_0x4b847f([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])]&&(_0x303789=_0x3e7d8d(_0x33a371[_0x4b847f([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])],_0x33a371[_0x4b847f([0x6a,0x74,0x69])])),await _0x106668()?_0x468f08()?_0xef7092()?_0x4b847f([0x45,0x78,0x70,0x69,0x72,0x65,0x64]):_0x42aa02()?(_0x33a371[_0x4b847f([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x4b847f([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e])&&(_0x442384=_0x460344(_0x4b847f([0x45,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e,0x4c,0x69,0x6d,0x69,0x74]))),await _0x2494a5()):_0x4b847f([0x44,0x6f,0x6d,0x61,0x69,0x6e,0x4c,0x69,0x6d,0x69,0x74]):_0x4b847f([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]):_0x4b847f([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}catch{return _0x4b847f([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}function _0xef7092(){const _0x3c07ac=[_0x4b847f([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e]),_0x4b847f([0x74,0x72,0x69,0x61,0x6c])][_0x4b847f([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x33a371[_0x4b847f([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])])?_0x10b906/0x3e8:0xe10*_0x46f492;return _0x33a371[_0x4b847f([0x65,0x78,0x70])]<_0x3c07ac;}function _0x468f08(){const _0x3175ff=_0x33a371[_0x4b847f([0x66,0x65,0x61,0x74,0x75,0x72,0x65,0x73])];return!!_0x3175ff&&(!!_0x3175ff[_0x4b847f([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x4b847f([0x2a]))||!!_0x3175ff[_0x4b847f([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x4b847f([0x41,0x49])));}function _0x42aa02(){const _0x5c4b5b=_0x33a371[_0x4b847f([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x64,0x48,0x6f,0x73,0x74,0x73])];if(!_0x5c4b5b||0x0==_0x5c4b5b[_0x4b847f([0x6c,0x65,0x6e,0x67,0x74,0x68])])return!0x0;const {hostname:_0xa7b0ae}=new URL(window[_0x4b847f([0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e])]['href']);if(_0x5c4b5b[_0x4b847f([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0xa7b0ae))return!0x0;const _0x197d1b=_0xa7b0ae[_0x4b847f([0x73,0x70,0x6c,0x69,0x74])](_0x4b847f([0x2e]));return _0x5c4b5b[_0x4b847f([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x154bbd=>_0x154bbd[_0x4b847f([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x4b847f([0x2a])))[_0x4b847f([0x6d,0x61,0x70])](_0x2b8c3b=>_0x2b8c3b[_0x4b847f([0x73,0x70,0x6c,0x69,0x74])](_0x4b847f([0x2e])))[_0x4b847f([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x4fe355=>_0x4fe355[_0x4b847f([0x6c,0x65,0x6e,0x67,0x74,0x68])]<=_0x197d1b[_0x4b847f([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0x4b847f([0x6d,0x61,0x70])](_0x45879f=>Array(_0x197d1b[_0x4b847f([0x6c,0x65,0x6e,0x67,0x74,0x68])]-_0x45879f[_0x4b847f([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0x4b847f([0x66,0x69,0x6c,0x6c])](_0x45879f[0x0]===_0x4b847f([0x2a])?_0x4b847f([0x2a]):'')[_0x4b847f([0x63,0x6f,0x6e,0x63,0x61,0x74])](_0x45879f))[_0x4b847f([0x73,0x6f,0x6d,0x65])](_0x46d637=>_0x197d1b[_0x4b847f([0x65,0x76,0x65,0x72,0x79])]((_0x21e75c,_0x4a44cd)=>_0x46d637[_0x4a44cd]===_0x21e75c||_0x46d637[_0x4a44cd]===_0x4b847f([0x2a])));}function _0x2494a5(){return _0x442384&&_0x303789?new window[(_0x4b847f([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x25b069,_0x164806)=>{_0x442384[_0x4b847f([0x74,0x68,0x65,0x6e])](_0x25b069,_0x164806),_0x303789[_0x4b847f([0x74,0x68,0x65,0x6e])](_0x5cb0af=>{_0x5cb0af!=_0x4b847f([0x56,0x61,0x6c,0x69,0x64])&&_0x25b069(_0x5cb0af);},_0x164806);}):_0x442384||_0x303789||_0x4b847f([0x56,0x61,0x6c,0x69,0x64]);}}function _0x3e7d8d(_0x2d576a,_0x28fc87){return new window[(_0x4b847f([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x43ce7a=>{if(_0x597b1c())return _0x43ce7a(_0x4b847f([0x56,0x61,0x6c,0x69,0x64]));_0x40bf1e(),_0x5bd5dd[_0x4b847f([0x64,0x65,0x63,0x6f,0x72,0x61,0x74,0x65])](_0x4b847f([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]));let _0xfe1b2c=!0x1;const _0x5e3c56=ot();function _0x6cf417(_0x367926){return!!_0x367926&&(typeof _0x367926===_0x4b847f([0x6f,0x62,0x6a,0x65,0x63,0x74])||typeof _0x367926===_0x4b847f([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]))&&typeof _0x367926[_0x4b847f([0x74,0x68,0x65,0x6e])]===_0x4b847f([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e])&&typeof _0x367926[_0x4b847f([0x63,0x61,0x74,0x63,0x68])]===_0x4b847f([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]);}function _0x2ae121(_0x28e16f){_0x1638f0(_0x28e16f)[_0x4b847f([0x74,0x68,0x65,0x6e])](_0x38ae5b=>{if(!_0x38ae5b||_0x38ae5b[_0x4b847f([0x73,0x74,0x61,0x74,0x75,0x73])]!=_0x4b847f([0x6f,0x6b]))return _0x4b847f([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]);return _0x1d9ac6(_0x378863(_0x5e3c56+_0x28fc87))!=_0x38ae5b[_0x4b847f([0x76,0x65,0x72,0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6f,0x6e])]?_0x4b847f([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]):_0x4b847f([0x56,0x61,0x6c,0x69,0x64]);})[_0x4b847f([0x74,0x68,0x65,0x6e])](_0x3a7e7a=>(_0x46dc3d(),_0x3a7e7a),()=>{const _0x6754c7=_0x4f9fb6();return null==_0x6754c7?(_0x46dc3d(),_0x4b847f([0x56,0x61,0x6c,0x69,0x64])):_0x4b847f(_0x10b906-_0x6754c7>(0x19f340e1^_0x5c9f45)?[0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]:[0x56,0x61,0x6c,0x69,0x64]);})[_0x4b847f([0x74,0x68,0x65,0x6e])](_0x43ce7a)[_0x4b847f([0x63,0x61,0x74,0x63,0x68])](()=>{_0x43ce7a(_0x4b847f([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});const _0x3dd828=0x3dc92a61^_0x5c9f45;function _0x46dc3d(){const _0x4086cb=_0x4b847f([0x6c,0x6c,0x63,0x74,0x2d])+_0x1d9ac6(_0x378863(_0x2d576a)),_0x585b93=_0x4ea7e7(_0x1d9ac6(window[_0x4b847f([0x4d,0x61,0x74,0x68])][_0x4b847f([0x63,0x65,0x69,0x6c])](_0x10b906/_0x3dd828)));window[_0x4b847f([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x4b847f([0x73,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x4086cb,_0x585b93);}function _0x4f9fb6(){const _0x259c41=_0x4b847f([0x6c,0x6c,0x63,0x74,0x2d])+_0x1d9ac6(_0x378863(_0x2d576a)),_0x4b5fdb=window[_0x4b847f([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x4b847f([0x67,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x259c41);return _0x4b5fdb?window[_0x4b847f([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x4ea7e7(_0x4b5fdb),0x10)*_0x3dd828:null;}function _0x1638f0(_0x315c48){return new window[(_0x4b847f([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x579afb,_0x544f57)=>{_0x315c48[_0x4b847f([0x74,0x68,0x65,0x6e])](_0x579afb,_0x544f57),window[_0x4b847f([0x73,0x65,0x74,0x54,0x69,0x6d,0x65,0x6f,0x75,0x74])](_0x544f57,0x3dfe1021^_0x5c9f45);});}}_0x5bd5dd[_0x4b847f([0x6f,0x6e])](_0x4b847f([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),(_0x37f68d,_0x55272e)=>{if(_0x55272e[0x0]!=_0x2d576a)return _0x43ce7a(_0x4b847f([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));_0x55272e[0x1]={..._0x55272e[0x1],[_0x4b847f([0x72,0x65,0x71,0x75,0x65,0x73,0x74,0x49,0x64])]:_0x5e3c56};},{[_0x4b847f([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x4b847f([0x68,0x69,0x67,0x68])}),_0x5bd5dd[_0x4b847f([0x6f,0x6e])](_0x4b847f([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),_0x46faeb=>{_0x6cf417(_0x46faeb[_0x4b847f([0x72,0x65,0x74,0x75,0x72,0x6e])])&&(_0xfe1b2c=!0x0,_0x2ae121(_0x46faeb[_0x4b847f([0x72,0x65,0x74,0x75,0x72,0x6e])]));},{[_0x4b847f([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x4b847f([0x6c,0x6f,0x77])}),_0x423f5c[_0x4b847f([0x74,0x68,0x65,0x6e])](()=>{_0xfe1b2c||_0x43ce7a(_0x4b847f([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});});function _0x597b1c(){return _0x5bd5dd[_0x4b847f([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x4b847f([0x76,0x69,0x65,0x77])][_0x4b847f([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]==_0x4b847f([0x61,0x75,0x74,0x6f]);}function _0x40bf1e(){_0x5bd5dd[_0x4b847f([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x4b847f([0x76,0x69,0x65,0x77])][_0x4b847f([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]=_0x4b847f([0x61,0x75,0x74,0x6f]);}}function _0x460344(_0x39c130){const _0x3aae68=[new window[(_0x4b847f([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x1f00b8=>setTimeout(_0x1f00b8,0x3df6fa2d^_0x5c9f45)),_0x423f5c[_0x4b847f([0x74,0x68,0x65,0x6e])](()=>new window[(_0x4b847f([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x20078c=>{let _0x5a2e99=0x0;_0x5bd5dd[_0x4b847f([0x6d,0x6f,0x64,0x65,0x6c])][_0x4b847f([0x6f,0x6e])](_0x4b847f([0x61,0x70,0x70,0x6c,0x79,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e]),(_0x401c5f,_0x5dc6f0)=>{_0x5dc6f0[0x0][_0x4b847f([0x69,0x73,0x44,0x6f,0x63,0x75,0x6d,0x65,0x6e,0x74,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e])]&&_0x5a2e99++,_0x5a2e99==(0x3dffc109^_0x5c9f45)&&(_0x20078c(),_0x401c5f[_0x4b847f([0x6f,0x66,0x66])]());});}))];return window[_0x4b847f([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65])][_0x4b847f([0x72,0x61,0x63,0x65])](_0x3aae68)[_0x4b847f([0x74,0x68,0x65,0x6e])](()=>_0x39c130);}async function _0x4e947c(){await _0x423f5c,_0x5bd5dd[_0x4b847f([0x6d,0x6f,0x64,0x65,0x6c])][_0x4b847f([0x63,0x68,0x61,0x6e,0x67,0x65])]=_0x45b2f6,_0x5bd5dd[_0x4b847f([0x6d,0x6f,0x64,0x65,0x6c])][_0x4b847f([0x65,0x6e,0x71,0x75,0x65,0x75,0x65,0x43,0x68,0x61,0x6e,0x67,0x65])]=_0x45b2f6,_0x5bd5dd[_0x4b847f([0x65,0x6e,0x61,0x62,0x6c,0x65,0x52,0x65,0x61,0x64,0x4f,0x6e,0x6c,0x79,0x4d,0x6f,0x64,0x65])](_0x4b847f([0x6d,0x6f,0x64,0x65,0x6c]));}function _0x59589f(_0x36f8d4){const _0x170b19=_0x5d585b();_0x5bd5dd[_0x170b19]=_0x4b847f([0x61,0x69,0x4c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79])+_0x36f8d4,_0x36f8d4!=_0x4b847f([0x56,0x61,0x6c,0x69,0x64])&&_0x4e947c();}function _0x5d585b(){const _0x2b583c=window[_0x4b847f([0x53,0x74,0x72,0x69,0x6e,0x67])](window[_0x4b847f([0x70,0x65,0x72,0x66,0x6f,0x72,0x6d,0x61,0x6e,0x63,0x65])][_0x4b847f([0x6e,0x6f,0x77])]())[_0x4b847f([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](_0x4b847f([0x2e]),'');let _0x1e5cb1=_0x4b847f([0x6e]);for(let _0x14ad96=0x0;_0x14ad96<_0x2b583c[_0x4b847f([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x14ad96+=0x2){let _0x199b64=window[_0x4b847f([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x2b583c[_0x4b847f([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x14ad96,_0x14ad96+0x2));_0x199b64>=_0x3adf4e[_0x4b847f([0x6c,0x65,0x6e,0x67,0x74,0x68])]&&(_0x199b64-=_0x3adf4e[_0x4b847f([0x6c,0x65,0x6e,0x67,0x74,0x68])]),_0x1e5cb1+=_0x3adf4e[_0x199b64];}return _0x1e5cb1;}function _0x3a18f6(){const _0x27c22e=_0x3de149[_0x4b847f([0x73,0x70,0x6c,0x69,0x74])](_0x4b847f([0x2e]));if(0x3!=_0x27c22e[_0x4b847f([0x6c,0x65,0x6e,0x67,0x74,0x68])])return null;return _0x42be08(_0x27c22e[0x1]);function _0x42be08(_0x2439a0){const _0x1ef84f=_0x4422f6(_0x2439a0);return _0x1ef84f&&_0x2444a4()?_0x1ef84f:null;function _0x2444a4(){const _0x3f39b0=_0x1ef84f[_0x4b847f([0x6a,0x74,0x69])],_0x3d44eb=window[_0x4b847f([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x3f39b0[_0x4b847f([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x3f39b0[_0x4b847f([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8),0x10),_0x51d046={..._0x1ef84f,[_0x4b847f([0x6a,0x74,0x69])]:_0x3f39b0[_0x4b847f([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](0x0,_0x3f39b0[_0x4b847f([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8)};return delete _0x51d046[_0x4b847f([0x76,0x63])],_0x378863(_0x51d046)==_0x3d44eb;}}}async function _0x106668(){let _0x3270b7=!0x0;try{const _0x176783=_0x3de149[_0x4b847f([0x73,0x70,0x6c,0x69,0x74])](_0x4b847f([0x2e])),[_0x2d115c,_0x5ae253,_0x51f70c]=_0x176783;return _0x3f6ff8(_0x2d115c),await _0xee24a1(_0x2d115c,_0x5ae253,_0x51f70c),_0x3270b7;}catch{return!0x1;}function _0x3f6ff8(_0x58fa32){const _0x33236a=_0x4422f6(_0x58fa32);_0x33236a&&_0x33236a[_0x4b847f([0x61,0x6c,0x67])]==_0x4b847f([0x45,0x53,0x32,0x35,0x36])||(_0x3270b7=!0x1);}async function _0xee24a1(_0x3e22d9,_0x208e36,_0x5a70f7){const _0x4141bc=window[_0x4b847f([0x55,0x69,0x6e,0x74,0x38,0x41,0x72,0x72,0x61,0x79])][_0x4b847f([0x66,0x72,0x6f,0x6d])](_0x8e90f8(_0x5a70f7),_0x669013=>_0x669013[_0x4b847f([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](0x0)),_0x3ed7f2=new window[(_0x4b847f([0x54,0x65,0x78,0x74,0x45,0x6e,0x63,0x6f,0x64,0x65,0x72]))]()[_0x4b847f([0x65,0x6e,0x63,0x6f,0x64,0x65])](_0x3e22d9+_0x4b847f([0x2e])+_0x208e36),_0x5dd42c=window[_0x4b847f([0x63,0x72,0x79,0x70,0x74,0x6f])][_0x4b847f([0x73,0x75,0x62,0x74,0x6c,0x65])];if(!_0x5dd42c)return;const _0x5794b0=await _0x5dd42c[_0x4b847f([0x69,0x6d,0x70,0x6f,0x72,0x74,0x4b,0x65,0x79])](_0x4b847f([0x6a,0x77,0x6b]),_0x393e6d,{[_0x4b847f([0x6e,0x61,0x6d,0x65])]:_0x4b847f([0x45,0x43,0x44,0x53,0x41]),[_0x4b847f([0x6e,0x61,0x6d,0x65,0x64,0x43,0x75,0x72,0x76,0x65])]:_0x4b847f([0x50,0x2d,0x32,0x35,0x36])},!0x1,[_0x4b847f([0x76,0x65,0x72,0x69,0x66,0x79])]);await _0x5dd42c[_0x4b847f([0x76,0x65,0x72,0x69,0x66,0x79])]({[_0x4b847f([0x6e,0x61,0x6d,0x65])]:_0x4b847f([0x45,0x43,0x44,0x53,0x41]),[_0x4b847f([0x68,0x61,0x73,0x68])]:{[_0x4b847f([0x6e,0x61,0x6d,0x65])]:_0x4b847f([0x53,0x48,0x41,0x2d,0x32,0x35,0x36])}},_0x5794b0,_0x4141bc,_0x3ed7f2)||(_0x3270b7=!0x1);}}function _0x4422f6(_0xff94db){return _0xff94db[_0x4b847f([0x73,0x74,0x61,0x72,0x74,0x73,0x57,0x69,0x74,0x68])](_0x4b847f([0x65,0x79]))?JSON[_0x4b847f([0x70,0x61,0x72,0x73,0x65])](_0x8e90f8(_0xff94db)):null;}function _0x8e90f8(_0x4967d2){return window[_0x4b847f([0x61,0x74,0x6f,0x62])](_0x4967d2[_0x4b847f([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/-/g,_0x4b847f([0x2b]))[_0x4b847f([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/_/g,_0x4b847f([0x2f])));}function _0x378863(_0x30017a){let _0x4494d3=0x1505;function _0x4d0e5b(_0x3e7422){for(let _0x2a8230=0x0;_0x2a8230<_0x3e7422[_0x4b847f([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x2a8230++){const _0x197137=_0x3e7422[_0x4b847f([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](_0x2a8230);_0x4494d3=(_0x4494d3<<0x5)+_0x4494d3+_0x197137,_0x4494d3&=_0x4494d3;}}function _0xf0d862(_0x4aa9d7){Array[_0x4b847f([0x69,0x73,0x41,0x72,0x72,0x61,0x79])](_0x4aa9d7)?_0x4aa9d7[_0x4b847f([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](_0xf0d862):_0x4aa9d7&&typeof _0x4aa9d7==_0x4b847f([0x6f,0x62,0x6a,0x65,0x63,0x74])?Object[_0x4b847f([0x65,0x6e,0x74,0x72,0x69,0x65,0x73])](_0x4aa9d7)[_0x4b847f([0x73,0x6f,0x72,0x74])]()[_0x4b847f([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](([_0x1a0b22,_0x53bb66])=>{_0x4d0e5b(_0x1a0b22),_0xf0d862(_0x53bb66);}):_0x4d0e5b(window[_0x4b847f([0x53,0x74,0x72,0x69,0x6e,0x67])](_0x4aa9d7));}return _0xf0d862(_0x30017a),_0x4494d3>>>0x0;}function _0x1d9ac6(_0x293d69){return _0x293d69[_0x4b847f([0x74,0x6f,0x53,0x74,0x72,0x69,0x6e,0x67])](0x10)[_0x4b847f([0x70,0x61,0x64,0x53,0x74,0x61,0x72,0x74])](0x8,_0x4b847f([0x30]));}function _0x4ea7e7(_0x3620a6){return _0x3620a6[_0x4b847f([0x73,0x70,0x6c,0x69,0x74])]('')[_0x4b847f([0x72,0x65,0x76,0x65,0x72,0x73,0x65])]()[_0x4b847f([0x6a,0x6f,0x69,0x6e])]('');}function _0x45b2f6(){}function _0x4b847f(_0x1ddc01){return _0x1ddc01['map'](_0xcdc66f=>String['fromCharCode'](_0xcdc66f))['join']('');}_0x59589f(await _0x3b8ab0());}(this);}['showFakeVisualSelection'](){const _0x3fa2ba=this['editor']['model'];_0x3fa2ba['change'](_0x2db4be=>{const _0x452500=_0x3fa2ba['document']['selection']['getRanges']();let _0x4085c5=0x0;for(const _0x5ccbd0 of _0x452500){const _0x110ccd=Oi+':'+_0x4085c5;if(_0x3fa2ba['markers']['has'](_0x110ccd))_0x2db4be['updateMarker'](_0x110ccd,{'range':_0x5ccbd0});else{if(_0x5ccbd0['start']['isAtEnd']){const _0xd31ca0=_0x5ccbd0['start']['getLastMatchingPosition'](({item:_0x333141})=>!_0x3fa2ba['schema']['isContent'](_0x333141),{'boundaries':_0x5ccbd0});_0x2db4be['addMarker'](_0x110ccd,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x2db4be['createRange'](_0xd31ca0,_0x5ccbd0['end'])});}else _0x2db4be['addMarker'](_0x110ccd,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x5ccbd0});}_0x4085c5++;}});}['hideFakeVisualSelection'](){const _0xeb43f8=this['editor']['model'],_0x4a8bc6=Array['from'](this['editor']['model']['markers']['getMarkersGroup'](Oi));_0x4a8bc6['length']&&_0xeb43f8['change'](_0x28e2c0=>{_0x4a8bc6['forEach'](_0x1779d6=>{_0x28e2c0['removeMarker'](_0x1779d6);});});}['insertContent'](_0x43020d,_0x386a89){const _0xe0f23d=this['_getAISelection'](),_0x4e6b78=_0x386a89||_0xe0f23d['getFirstRange']();this['editor']['model']['canEditAt'](_0x4e6b78)&&this['editor']['model']['change'](_0xedd058=>{this['hideFakeVisualSelection'](),_0x386a89||this['_resetContentOfSelectedTableCells'](_0xedd058,_0xe0f23d),this['_pasteHTMLUsingClipboard']({'insertAt':_0x4e6b78,'writer':_0xedd058,'html':_0x43020d});});}['insertContentBelow'](_0x561049){const {model:_0x29895b}=this['editor'],_0x4ac525=this['_getAISelection']();_0x29895b['change'](()=>{const _0x7ba282=this['_prepareTableInsertBelowPosition'](_0x561049,_0x4ac525)||this['_getDefaultInsertBelowPosition'](_0x4ac525);this['insertContent'](_0x561049,_0x7ba282);});}['_getAISelection'](){const _0x3e3979=this['editor']['model'],_0x1c0d3f=Array['from'](_0x3e3979['markers']['getMarkersGroup'](Oi))['map'](_0x455c78=>_0x455c78['getRange']());return _0x3e3979['createSelection'](_0x1c0d3f);}['_pasteHTMLUsingClipboard']({writer:_0x2a5c22,html:_0x393057,insertAt:_0x489719}){const {view:_0x18319f}=this['editor']['editing'],_0xc88ab3=this['editor']['plugins']['get'](_0x21b716),_0x17f7b1=new Ri();_0x17f7b1['setData']('text/html',_0x393057);const _0x26bd48=new ClipboardEvent('paste',{'clipboardData':_0x17f7b1}),_0x325a2e=new _0x5f08c8(_0x18319f,_0x26bd48,{'dataTransfer':new _0x425595(_0x17f7b1)});_0x2a5c22['setSelection'](_0x489719);const _0x436da4=(_0x4daaf9,_0x5e8c38)=>{_0x5e8c38['resultRange']&&_0x2a5c22['setSelection'](_0x5e8c38['resultRange']);};_0xc88ab3['once']('contentInsertion',_0x436da4,{'priority':'lowest'}),_0x18319f['document']['fire']('paste',_0x325a2e),_0xc88ab3['off']('contentInsertion',_0x436da4);}['_getDefaultInsertBelowPosition'](_0x4c5147){const {model:_0x5b1858}=this['editor'],_0x584fc5=Array['from'](_0x4c5147['getSelectedBlocks']());return _0x584fc5['length']?_0x5b1858['createPositionAfter'](_0x584fc5['pop']()):_0x4c5147['getLastPosition']();}['_prepareTableInsertBelowPosition'](_0x3a21a6,_0x912de1){const {model:_0x20d022,plugins:_0x14ddba}=this['editor'];if(_0x14ddba['has']('TableUtils')){const _0x3c5bc0=_0x14ddba['get']('TableUtils')['getSelectedTableCells'](_0x912de1);if(_0x3c5bc0['length']){const _0x3df8f0=this['_getTableRowCountFromContent'](_0x3a21a6),_0x521666=this['_createEmptyTableRows'](_0x3c5bc0,_0x3df8f0);return _0x20d022['createPositionAt'](_0x521666,0x0);}}return null;}['_getTableRowCountFromContent'](_0x5d3016){const _0x2d24ce=this['editor']['plugins']['get']('TableUtils'),_0x58eae4=this['editor']['data']['parse'](_0x5d3016),_0x16aaa0=Array['from'](_0x58eae4['getChildren']())['filter'](_0x41f99b=>_0x41f99b['is']('element','table'));let _0xca7c33=0x0;return _0x16aaa0['forEach'](_0x6865b9=>{_0xca7c33+=_0x2d24ce['getRows'](_0x6865b9);}),_0xca7c33;}['_createEmptyTableRows'](_0x13d370,_0x5af675){const _0x2743a6=this['editor']['plugins']['get']('TableUtils'),_0x44dd33=_0x2743a6['getRowIndexes'](_0x13d370),_0x1bf7ca=_0x2743a6['getColumnIndexes'](_0x13d370),_0x75995b=_0x44dd33['last']+0x1,_0x5bbed3=_0x1bf7ca['first'],_0x35d66d=_0x13d370[0x0]['findAncestor']('table');for(let _0x37bd70=0x0;_0x37bd70<_0x5af675;_0x37bd70++)_0x2743a6['insertRows'](_0x35d66d,{'at':_0x75995b});return _0x35d66d['getChild'](_0x75995b)['getChild'](_0x5bbed3);}['_resetContentOfSelectedTableCells'](_0x3ef834,_0x4982fb){const {plugins:_0x1c62e0}=this['editor'],{model:_0x38dff8}=_0x3ef834;if(!_0x1c62e0['has']('TableUtils'))return;_0x1c62e0['get']('TableUtils')['getSelectedTableCells'](_0x4982fb)['length']&&_0x38dff8['deleteContent'](_0x4982fb);}}class Ni extends _0x58645c{static get['pluginName'](){return'AIAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['afterInit'](){if(!this['textAdapter'])throw new ht('aiadapter-text-adapter-not-set',null);}}class vi extends Error{constructor(_0x12b8e3){super(_0x12b8e3),this['name']='AIRequestError';}}function yi(_0x398a2c,_0x375602,_0x2c73cc){const t=_0x398a2c['t'];switch(_0x375602){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',_0x2c73cc);case'Error\x20during\x20AI\x20content\x20generation:\x20%0':return t('Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x2c73cc);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'},_0x2c73cc);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 _0x375602;}}class xi extends _0x26b415{['_commandDefinitions'];constructor(_0x28c442,_0x393369){super(_0x28c442),this['_commandDefinitions']=_0x393369,this['set']('enabledCommandsIds',[]),this['on']('change:_hasContext',(_0x4ed637,_0x9538bf,_0xec144c)=>{this['isEnabled']&&(this['enabledCommandsIds']=Li(this['_commandDefinitions'],_0xec144c));}),this['set']('_hasContext',!0x1),this['on']('change:isEnabled',(_0xb09a79,_0x533307,_0x5f29f4)=>{this['enabledCommandsIds']=_0x5f29f4?Li(this['_commandDefinitions'],this['_hasContext']):[];});}['refresh'](){const _0x282370=this['editor']['model'];this['_hasContext']=function(_0x385dbd){const _0x3e215f=_0x385dbd['document']['selection'];return _0x3e215f['isCollapsed']?0x0!==[..._0x3e215f['getSelectedBlocks']()]['length']&&![..._0x3e215f['getSelectedBlocks']()][0x0]['isEmpty']:!!_0x385dbd['hasContent'](_0x3e215f['getFirstRange']());}(_0x282370);const _0x24e8d6=_0x282370['document']['selection'],_0x5a983c=this['editor']['config']['get']('ai.assistant.disabledElements');for(const _0x5091ca of _0x24e8d6['getRanges']())for(const _0x320082 of _0x5091ca['getItems']())if(_0x320082['is']('element')&&_0x5a983c['includes'](_0x320082['name']))return void(this['isEnabled']=!0x1);this['isEnabled']=!0x0;}['execute'](_0x3f42eb='',_0x224c61='',_0x27ca25='custom'){this['editor']['plugins']['get'](Xi)['showUI'](_0x3f42eb,_0x224c61,_0x27ca25);}}function Li(_0xf5aa31,_0x311874){const _0x13ea55=new Set();for(const _0x2f9288 of _0xf5aa31['values']())(_0x311874||!0x1===_0x2f9288['requiresContent'])&&_0x13ea55['add'](_0x2f9288['id']);return Array['from'](_0x13ea55);}const Di=new RegExp(/^(.*?)<[a-zA-Z][a-zA-Z0-9_\-.]*[ >]/,'is');class Pi extends/* #__PURE__ -- @preserve */
24
+ ct(){['editor'];['textAdapter'];['view'];['_sanitizationContainer'];['_domParser'];['_xmlSerializer'];constructor(_0x5a6ab5,_0x1ac009,_0x314ca3){super(),this['editor']=_0x5a6ab5,this['textAdapter']=_0x1ac009,this['_sanitizationContainer']=document['createElement']('div'),this['_domParser']=new DOMParser(),this['_xmlSerializer']=new XMLSerializer(),this['view']=_0x314ca3,this['set']({'initialContext':'','currentContext':'','currentResponse':'','previousContext':void 0x0,'previousQuery':void 0x0,'previousLabel':void 0x0,'isProcessing':!0x1}),this['on']('set:currentContext',(_0x3b9649,_0x4517b5,_0x12dab2)=>{this['view']['value']=this['_sanitizeHTML'](_0x12dab2);}),this['listenTo'](this['view'],'submitPrompt',(_0x2576a2,_0x4d49a9)=>{const _0x5ad44b=this['currentContext']||this['initialContext'];this['_handleQuery'](_0x4d49a9,_0x5ad44b,'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:_0x3002cf,query:_0x42bbb0,htmlContent:_0x5d7c20,label:_0x1533b9,mainActionLabel:_0x3e3485}){this['view']['prompt']=_0x1533b9,this['view']['mainAction']=_0x3e3485,this['initialContext']=_0x5d7c20,_0x42bbb0&&(this['view']['isRendered']?this['_handleQuery'](_0x42bbb0,_0x5d7c20,_0x3002cf,_0x1533b9):this['view']['once']('render',()=>{this['_handleQuery'](_0x42bbb0,_0x5d7c20,_0x3002cf,_0x1533b9);}));}['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'](_0x1618b6,_0x53a2fc,_0x4358a6,_0x4ebb71){return this['isProcessing']=!0x0,this['view']['startProcessing'](),this['previousContext']=_0x53a2fc,this['previousQuery']=_0x1618b6,this['previousLabel']=_0x4ebb71||_0x1618b6,this['previousActionId']=_0x4358a6,new Promise(_0x32a35e=>{this['textAdapter']['makeRequest']({'query':_0x1618b6,'context':_0x53a2fc,'onData':_0x30fe70=>{this['currentResponse']=_0x30fe70,this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse']);},'actionId':_0x4358a6})['then'](()=>{!this['currentContext']&&this['currentResponse']&&(this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse'],!0x0));})['catch'](_0x4599e0=>{_0x4599e0 instanceof vi?this['view']['handleError'](_0x4599e0['message']):this['view']['handleError'](),_0x32a35e();})['finally'](()=>{this['stopProcessing'](),_0x32a35e();});});}['_parseAndNormalizeContent'](_0x4147c0,_0x39cf24=!0x1){const _0x35008d=Di['exec'](_0x4147c0);_0x4147c0=_0x35008d?_0x4147c0['substring'](_0x35008d[0x1]['length']):_0x4147c0['length']<0x64&&!_0x39cf24?'':this['_stripMarkdownSyntax'](_0x4147c0);const _0x4e6226=this['_domParser']['parseFromString'](_0x4147c0,'text/html');if(_0x35008d){const _0x4001fc=Array['from'](_0x4e6226['body']['childNodes']);_0x4001fc['reverse']();for(const _0x150cc0 of _0x4001fc){if(_0x150cc0['nodeType']==Node['ELEMENT_NODE'])break;_0x150cc0['remove']();}}const _0x3dd64a=this['editor']['data']['processor']['toView'](this['_xmlSerializer']['serializeToString'](_0x4e6226['body']));this['_isH1TagSupportEnabled']()||this['_normalizeResponseHeadings'](_0x3dd64a);const _0x2bb936=this['editor']['config']['get']('ai.assistant.preserveComments'),_0x31475f=this['editor']['data']['toModel'](_0x3dd64a);return _0x2bb936||_0x31475f['markers']['clear'](),this['editor']['data']['stringify'](_0x31475f);}['_normalizeResponseHeadings'](_0x506ada){const _0x291f0d=new _0x41b10f(this['editor']['editing']['view']['document']),_0x22c78c=new _0x4bce65({'name':/^h[1-5]$/}),_0x4221c3=[];let _0x4f121d=!0x1;for(const _0x329c27 of _0x506ada)_0x329c27['is']('element')&&_0x22c78c['match'](_0x329c27)&&(_0x4221c3['push'](_0x329c27),'h1'==_0x329c27['name']&&(_0x4f121d=!0x0));if(_0x4f121d){for(const _0x4da899 of _0x4221c3)_0x291f0d['rename']('h'+(parseInt(_0x4da899['name'][0x1])+0x1),_0x4da899);}}['_isH1TagSupportEnabled'](){const {data:_0x2a7071,editing:_0x4ed3c1}=this['editor'],_0x403707=_0x2a7071['htmlProcessor']['toView']('<h1></h1>'),_0x1fe31d=_0x2a7071['toView'](_0x2a7071['toModel'](_0x403707));return!!_0x4ed3c1['view']['domConverter']['viewToDom'](_0x1fe31d)['querySelector']('h1');}['_sanitizeHTML'](_0x4cee5f){return this['editor']['editing']['view']['domConverter']['setContentOf'](this['_sanitizationContainer'],_0x4cee5f),this['_sanitizationContainer']['innerHTML'];}['_stripMarkdownSyntax'](_0x2abde8){const _0xc7fc91=_0x2abde8['trim']();return _0xc7fc91['startsWith']('```html')?_0xc7fc91['endsWith']('```')?_0xc7fc91['substring'](0x7,_0xc7fc91['length']-0x3):_0xc7fc91['substring'](0x7):_0x2abde8;}}const Hi={'REPLACE':'replace','INSERT':'insert'};class Mi extends kt{constructor(_0x5061d8){super(_0x5061d8),this['set']('isVisible',!0x1),this['set']('mainAction',Hi['REPLACE']),this['replaceButton']=this['_createButton']('','ck-button-action'),this['replaceButton']['bind']('label')['to'](this,'mainAction',_0x3f9b48=>yi(_0x5061d8,'AI_'+_0x3f9b48['toUpperCase']()+'_CONTENT')),this['insertButton']=this['_createButton'](yi(_0x5061d8,'Insert\x20below')),this['tryAgainButton']=this['_createButton'](yi(_0x5061d8,'Try\x20again')),this['stopButton']=this['_createButton'](yi(_0x5061d8,'Stop'));const _0x280441=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-form__toolbar',_0x280441['if']('isVisible','ck-hidden',_0x405ccb=>!_0x405ccb)]}}),this['items']['addMany']([this['replaceButton'],this['insertButton'],this['tryAgainButton'],this['stopButton']]);}['_createButton'](_0x317978,_0x2c4aa9){const _0x21d705=new Nt(this['locale']);return _0x21d705['set']({'label':_0x317978,'class':_0x2c4aa9||'','isVisible':!0x0,'withText':!0x0}),_0x21d705;}}class Ui extends vt{['contentFieldView'];['copyButtonView'];constructor(_0x261e3a,_0x5a10f9=''){super(_0x261e3a),this['set']({'value':null,'isVisible':!0x1,'isProcessing':!0x1});const _0x193b0c=this['bindTemplate'];this['contentFieldView']=new Vi(_0x261e3a,_0x5a10f9),this['copyButtonView']=this['_createCopyButton'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area-wrapper',_0x193b0c['if']('isVisible','ck-hidden',_0x311bf7=>!_0x311bf7)],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area',_0x193b0c['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 _0xaf1a6a=!0x1;this['on']('change:value',(_0x52e3cc,_0x461a09,_0x55747d)=>{const _0x85db16=!this['contentFieldView']['element']['querySelector']('.ck-ai-form__loader');this['contentFieldView']['setContent'](_0x55747d),this['isProcessing']&&_0x85db16&&!_0xaf1a6a&&this['element']['scrollTo']({'top':this['element']['scrollHeight'],'behavior':'smooth'});}),this['on']('change:isProcessing',(_0x2841bd,_0x595e41,_0x1ccb74)=>{_0xaf1a6a=!0x1,_0x1ccb74?(this['value']=null,this['contentFieldView']['appendLoader']()):this['value']||this['contentFieldView']['setContent']('');}),this['listenTo'](this['element'],'wheel',()=>{_0xaf1a6a=!0x0;}),this['listenTo'](this['element'],'mousedown',()=>{_0xaf1a6a=!0x0;});}['focus'](){this['element']['focus']();}['_createCopyButton'](){const _0x2ed73e=this['locale'],_0x282a69=new Nt(this['locale']),_0x505966='ck-ai-form__copy-button';return _0x282a69['set']({'label':yi(_0x2ed73e,'Copy'),'icon':_0xae9e3f,'class':_0x505966,'tooltip':!0x0}),_0x282a69['bind']('isVisible')['to'](this,'value',_0x1a1658=>!!_0x1a1658),_0x282a69['bind']('isEnabled')['to'](this,'isProcessing',_0x548bb8=>!_0x548bb8),_0x282a69['on']('execute',()=>{this['_copyHTMLToClipboard'](this['contentFieldView']['element']),_0x282a69['icon']=_0xe4c6eb,_0x282a69['class']=_0x505966+'\x20ck-ai-form__copy-button--copied',this['focus'](),setTimeout(()=>{_0x282a69['icon']=_0xae9e3f,_0x282a69['class']=_0x505966;},0x3e8);}),_0x282a69;}['_copyHTMLToClipboard'](_0x9e657a){const {window:_0x3eec1d,document:_0x4232d3}=lt;if(_0x3eec1d['ClipboardItem']){const {Blob:_0x3ac480,ClipboardItem:_0x26eff6}=_0x3eec1d,_0x48c99a=[new _0x26eff6({'text/html':new _0x3ac480([_0x9e657a['innerHTML']],{'type':'text/html'}),'text/plain':new _0x3ac480([_0x9e657a['textContent']||''],{'type':'text/plain'})})];navigator['clipboard']['write'](_0x48c99a);}else{const _0x162d11=_0x4232d3['createElement']('div');_0x162d11['style']['position']='absolute',_0x162d11['style']['left']='-9999px',_0x162d11['innerHTML']='<span>[</span>'+_0x9e657a['innerHTML']+'<span>]</span>',_0x4232d3['body']['appendChild'](_0x162d11);const _0x17c142=_0x4232d3['createRange']();_0x17c142['setStartAfter'](_0x162d11['firstElementChild']),_0x17c142['setEndBefore'](_0x162d11['lastElementChild']);const _0x292e24=_0x3eec1d['getSelection']();_0x292e24['removeAllRanges'](),_0x292e24['addRange'](_0x17c142),_0x4232d3['execCommand']('copy'),_0x162d11['remove']();}}}class Vi extends vt{constructor(_0x1c9d83,_0x463386=''){super(_0x1c9d83),this['loaderView']=this['_createLoader'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content',_0x463386,'ck-reset_all-excluded','ck-ai-form__content-field']}});}['setContent'](_0x5855c3){this['element']['innerHTML']=_0x5855c3;}['appendLoader'](){this['element']['appendChild'](this['loaderView']['element']);}['_createLoader'](){const _0x23e503=new vt(),_0x1ca214=this['locale'],_0x56cf33=new yt();return _0x56cf33['isVisible']=!0x0,_0x23e503['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__loader']},'children':[_0x56cf33,{'text':yi(_0x1ca214,'AI\x20is\x20writing...')}]}),_0x23e503['render'](),_0x23e503;}}class Bi extends vt{constructor(_0x5ea33c,_0x19c324=''){super(_0x5ea33c);const _0x5536c5=new xt(),_0x460997=this['bindTemplate'];this['set']('text',_0x19c324),_0x5536c5['content']=_0x592f91,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__error']},'children':[_0x5536c5,{'text':_0x460997['to']('text')}]});}}class Gi extends Lt{['submitButtonView'];['showHistoryButtonView'];constructor(_0x7074ee,_0x3f56c7){super(_0x7074ee,_0x3f56c7),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',(_0x157db3,_0x2730ec)=>{_0x157db3['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0x2730ec());});}['_createSubmitButton'](){const _0x18ee9d=new Nt(this['locale']),_0x37fb55=this['locale'];return _0x18ee9d['set']({'icon':_0x4509b9,'label':yi(_0x37fb55,'Submit'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-form__submit'}),_0x18ee9d['on']('execute',()=>{this['submit']();}),_0x18ee9d['bind']('isEnabled')['to'](this['queryView']['fieldView'],'isEmpty',this,'isEnabled',(_0x5679f3,_0x43e83f)=>!_0x5679f3&&_0x43e83f),_0x18ee9d;}['_createShowHistoryButton'](){const _0x4232c5=new Nt(this['locale']),_0x15d2a2=this['resultsView'],_0x1daac9=this['locale'];_0x4232c5['set']({'label':yi(_0x1daac9,'History'),'withText':!0x1,'icon':_0xc604bb,'tooltip':!0x0,'tooltipPosition':'sw','class':'ck-ai-form__toggle-history'}),_0x4232c5['bind']('isOn')['to'](_0x15d2a2,'isVisible'),_0x4232c5['bind']('isEnabled')['to'](this,'isEnabled'),_0x4232c5['on']('execute',()=>{_0x15d2a2['isVisible']=!_0x15d2a2['isVisible'],_0x15d2a2['isVisible']?this['filteredView']['focus']():this['focus']();});const _0x42282a=()=>{lt['window']['requestAnimationFrame'](()=>{if(ut(this['element'])){const _0x6b1ff7=new dt(this['queryView']['fieldView']['element']),_0x35301d=_0x6b1ff7['width'],_0x5590c4='rtl'===_0x1daac9['uiLanguageDirection']?'left':'right';_0x6b1ff7['excludeScrollbarsAndBorders'](),_0x4232c5['element']['style'][_0x5590c4]=_0x35301d-_0x6b1ff7['width']+0x1+'px';}});};return this['queryView']['fieldView']['on']('update',_0x42282a),this['on']('render',_0x42282a),_0x4232c5;}['submit'](){const _0x449a95=this['queryView']['fieldView']['element']['value'];this['fire']('submit',_0x449a95);}['focus'](_0x157ef9){-0x1===_0x157ef9?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}}class Fi extends Dt{['historyGroupView'];['clearHistoryButton'];constructor(_0x2fdb91){super(_0x2fdb91),this['clearHistoryButton']=this['_createClearHistoryButton'](),this['historyGroupView']=new Pt(),this['historyGroupView']['children']['add'](this['clearHistoryButton'],0x1),this['historyGroupView']['label']=yi(_0x2fdb91,'Prompt\x20history'),this['historyGroupView']['items']['delegate']('execute')['to'](this),this['items']['add'](this['historyGroupView']);}['filter'](){let _0x24c207=0x0;for(const _0x2b3cbf of this['items'])_0x24c207+=_0x2b3cbf['items']['length'];return{'resultsCount':_0x24c207,'totalItemsCount':_0x24c207};}['_createClearHistoryButton'](){const _0x566250=this['locale'],_0x2e0b65=new Nt(this['locale']);return _0x2e0b65['set']({'label':'('+yi(_0x566250,'Clear')+')','withText':!0x0}),_0x2e0b65['on']('execute',()=>this['fire']('clearHistory')),_0x2e0b65;}}class Ki extends Ht{constructor(_0x1f63da){super();const _0x4248b6=new Mt(),_0x3d7e24=new Nt(this['locale'],_0x4248b6);this['children']['add'](_0x3d7e24),_0x3d7e24['set']({'label':_0x1f63da['prompt'],'withText':!0x0}),_0x3d7e24['on']('execute',()=>{this['fire']('execute',{'value':_0x4b02ea(_0x1f63da['prompt'])});});}}const Wi='CKEditor/AIFormView/PromptHistory';class Yi extends _t{constructor(){super(),this['_loadFromSessionStorage'](),this['on']('add',(_0x809492,_0x37a9b0)=>{const _0x356194=$i(_0x37a9b0['prompt']);for(const _0x3266d0 of this)if(_0x3266d0!=_0x37a9b0&&$i(_0x3266d0['prompt'])===_0x356194){this['remove'](_0x3266d0);break;}this['length']>0x14&&this['remove'](this['last']),this['_saveToSessionStorage']();}),this['on']('remove',()=>{this['_saveToSessionStorage']();});}['_loadFromSessionStorage'](){const _0x59add3=sessionStorage['getItem'](Wi)||'[]';this['addMany'](JSON['parse'](_0x59add3));}['_saveToSessionStorage'](){sessionStorage['setItem'](Wi,JSON['stringify'](this['map'](_0x2a259b=>_0x2a259b)));}}function $i(_0x53866d){return _0x53866d['toLowerCase']()['trim']();}class qi extends vt{['focusTracker'];['keystrokes'];['contentArea'];['toolbar'];['promptView'];['errorView'];['_focusables'];['focusCycler'];['_promptHistory'];constructor(_0x4d267d,_0x29ed62,_0x7edc79=''){super(_0x4d267d),this['set']('isEnabled',!0x0),this['set']('isProcessing',!0x1),this['set']('prompt',''),this['set']('value',''),this['set']('isError',!0x1),this['set']('mainAction',Hi['REPLACE']),this['_promptHistory']=new Yi(),this['errorView']=new Bi(_0x4d267d),this['contentArea']=new Ui(_0x4d267d,_0x7edc79),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 At(),this['keystrokes']=new gt(),this['_focusables']=this['createCollection']([this['contentArea'],this['contentArea']['copyButtonView'],this['toolbar'],this['promptView']]),this['focusCycler']=new Ut({'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 _0x6b0cd3=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form',_0x29ed62],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form-content']},'children':[{'tag':'div','attributes':{'class':[_0x6b0cd3['if']('isError','ck-hidden',_0x2757b6=>!_0x2757b6)]},'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'](_0x4fd552=0x1){-0x1===_0x4fd552?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 _0x23b9cc=this['locale'],_0x162544=new Gi(_0x23b9cc,{'queryView':{'label':yi(_0x23b9cc,'Ask\x20AI\x20to\x20edit\x20or\x20generate'),'creator':Vt,'showIcon':!0x1,'showResetButton':!0x1},'infoView':{'text':{'noSearchableItems':{'primary':yi(_0x23b9cc,'Empty\x20history'),'secondary':yi(_0x23b9cc,'Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.')}}},'filteredView':this['_createHistoryView'](),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1});return _0x162544['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x330571,_0x4c9b55)=>_0x330571&&!_0x4c9b55),this['listenTo'](_0x162544,'submit',(_0x369b57,_0x58feb7)=>{this['prompt']=_0x58feb7;const _0x41a79b=_0x24fbe9(_0x58feb7);this['fire']('submitPrompt',_0x41a79b),_0x58feb7['trim']()&&this['_promptHistory']['add']({'prompt':_0x41a79b},0x0);},{'priority':'high'}),_0x162544;}['_createHistoryView'](){const _0x346985=new Fi(this['locale']);return _0x346985['historyGroupView']['items']['bindTo'](this['_promptHistory'])['as'](Ki),_0x346985['on']('clearHistory',()=>{this['_promptHistory']['clear'](),this['promptView']['search'](''),this['promptView']['focus']();}),_0x346985;}['_createToolbar'](){const _0x269ed8=new Mi(this['locale']);return _0x269ed8['replaceButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x49135d,_0x3cf7dc,_0x4bdb8c)=>_0x49135d&&!_0x3cf7dc&&!!_0x4bdb8c),_0x269ed8['replaceButton']['delegate']('execute')['to'](this,'replaceContent'),_0x269ed8['insertButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x8bb936,_0x3c921d,_0xa777d6)=>_0x8bb936&&!_0x3c921d&&!!_0xa777d6),_0x269ed8['insertButton']['delegate']('execute')['to'](this,'insertContentBelow'),_0x269ed8['tryAgainButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x36de91,_0x4f108b)=>_0x36de91&&!_0x4f108b),_0x269ed8['tryAgainButton']['delegate']('execute')['to'](this,'tryAgainEvent'),_0x269ed8['stopButton']['bind']('isEnabled')['to'](this,'isProcessing'),_0x269ed8['stopButton']['delegate']('execute')['to'](this,'stopProcessing'),_0x269ed8;}['startProcessing'](){this['value']='',this['isError']=!0x1,this['isProcessing']=!0x0,this['contentArea']['isVisible']=!0x0,this['toolbar']['isVisible']=!0x0,this['contentArea']['focus']();}['finishProcessing'](){const _0x85f189=this['locale'];this['isProcessing']=!0x1,this['prompt']='',this['promptView']['reset'](),this['value']&&(this['promptView']['queryView']['label']=yi(_0x85f189,'Ask\x20AI\x20to\x20improve\x20generated\x20text'));}['handleError'](_0x45a228){const _0x5161fd=this['locale'];this['finishProcessing'](),this['isError']=!0x0,this['errorView']['text']=_0x45a228||yi(_0x5161fd,'AI_ERROR_FAILED'),this['value']||(this['contentArea']['isVisible']=!0x1);}}const Qi=globalThis['DataTransfer'];class Xi extends _0x58645c{['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[_0x44db63,ki,Ni,Bt];}constructor(_0x1735c9){super(_0x1735c9),_0x1735c9['config']['define']('ai.assistant.disabledElements',['media','rawHtml','tableOfContents']),_0x1735c9['config']['define']('ai.assistant.contentAreaCssClass',''),_0x1735c9['config']['define']('ai.assistant.useTheme',!0x0),this['_uiCssClasses']='ck-ai-assistant-ui'+(_0x1735c9['config']['get']('ai.assistant.useTheme')?'\x20ck-ai-assistant-ui_theme':'');}['init'](){const {editor:_0x564b9a}=this;this['_aiAdapter']=_0x564b9a['plugins']['get'](Ni),this['_dialog']=_0x564b9a['plugins']['get'](Bt),this['_formView']=null,this['_commandDefinitions']=this['_getResolvedCommandsDefinitions']();const _0xbdeca8=new xi(_0x564b9a,Array['from'](this['_commandDefinitions']['values']()));_0x564b9a['commands']['add']('showAIAssistant',_0xbdeca8),_0x564b9a['ui']['componentFactory']['add']('aiCommands',_0x568bd3=>{const _0x502f40=Gt(_0x568bd3);return _0x502f40['set']({'class':'ck-ai-commands-dropdown\x20'+this['_uiCssClasses']}),_0x502f40['buttonView']['set']({'label':yi(_0x568bd3,'AI\x20Commands'),'icon':_0xbaeee1,'tooltip':!0x0}),_0x502f40['on']('execute',_0x181fe8=>this['_onExecute'](_0x181fe8['source']['id'])),Ft(_0x502f40,_0x564b9a['ui']['view']['body'],function(_0x53b936){const _0x44e204=bi(_0x53b936['config']['get']('ai.assistant.commands'),_0x53b936['locale']),_0x414326=ji(_0x53b936,_0x44e204)['filter'](_0xe279d5=>_0xe279d5['commands']['length']);if(0x1===_0x414326['length'])return ji(_0x53b936,_0x414326[0x0]['commands'])['map'](_0x56bb74=>({'id':_0x56bb74['id'],'label':_0x56bb74['label']}));return _0x414326['map'](_0x2e7f03=>{const {groupId:_0x349ad4,groupLabel:_0x32bd26,commands:_0x6c7128}=_0x2e7f03,_0xb4e524=ji(_0x53b936,_0x6c7128)['map'](_0x47bc46=>({'id':_0x47bc46['id'],'label':_0x47bc46['label']}));return{'id':_0x349ad4,'menu':_0x32bd26||_0x349ad4,'children':_0xb4e524};});}(_0x564b9a),{'ariaLabel':yi(_0x568bd3,'AI\x20Commands')}),_0x502f40['menuView']['menuPanelClass']='ck-ai-commands-dropdown\x20'+this['_uiCssClasses'],_0xbdeca8['on']('change:enabledCommandsIds',_0x1b0bdc),_0x502f40['menuView']['once']('render',_0x1b0bdc),_0x502f40;function _0x1b0bdc(){_0x502f40['isEnabled']=_0xbdeca8['enabledCommandsIds']['length']>0x0;for(const _0x509193 of _0x502f40['menuView']['buttons'])_0x509193['isEnabled']=_0xbdeca8['enabledCommandsIds']['includes'](_0x509193['id']);}}),_0x564b9a['ui']['componentFactory']['add']('menuBar:aiCommands',_0x21a453=>{const _0x28f127=new Kt(_0x21a453);_0x28f127['buttonView']['set']({'label':yi(_0x21a453,'AI\x20Commands'),'icon':_0xbaeee1}),_0x28f127['bind']('isEnabled')['to'](_0xbdeca8,'enabledCommandsIds',_0x4b0bff=>_0x4b0bff['length']>0x0);const _0x858b5f=bi(_0x564b9a['config']['get']('ai.assistant.commands'),_0x21a453);return this['_populateMenuBarMenu'](_0xbdeca8,_0x28f127,_0x858b5f,_0x51d021=>this['_onExecute'](_0x51d021)),_0x28f127;}),_0x564b9a['ui']['componentFactory']['add']('aiAssistant',()=>{const _0x4f03a6=this['_createAIAssistantUIButton'](Nt);return _0x4f03a6['set']({'tooltip':!0x0,'class':'ck-ai-assistant-button\x20'+this['_uiCssClasses']}),_0x4f03a6;}),_0x564b9a['ui']['componentFactory']['add']('menuBar:aiAssistant',()=>{const _0x371b7d=this['_createAIAssistantUIButton'](Wt);return _0x371b7d['set']({'role':'menuitemcheckbox'}),_0x371b7d;}),this['licenseKey']=this['editor']['config']['get']('licenseKey');const _0x973454=this['editor'];this['_licenseKeyCheckInterval']=setInterval(()=>{let _0x568d4c;for(const _0x4eea95 in _0x973454){const _0x5776fe=_0x4eea95,_0x3583b0=_0x973454[_0x5776fe];if('aiLicenseKeyValid'==_0x3583b0||'aiLicenseKeyInvalid'==_0x3583b0||'aiLicenseKeyExpired'==_0x3583b0||'aiLicenseKeyDomainLimit'==_0x3583b0||'aiLicenseKeyNotAllowed'==_0x3583b0||'aiLicenseKeyEvaluationLimit'==_0x3583b0||'aiLicenseKeyUsageLimit'==_0x3583b0){delete _0x973454[_0x5776fe],_0x568d4c=_0x3583b0,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'aiLicenseKeyInvalid'==_0x568d4c&&_0x973454['_showLicenseError']('invalid'),'aiLicenseKeyExpired'==_0x568d4c&&_0x973454['_showLicenseError']('expired'),'aiLicenseKeyDomainLimit'==_0x568d4c&&_0x973454['_showLicenseError']('domainLimit'),'aiLicenseKeyNotAllowed'==_0x568d4c&&_0x973454['_showLicenseError']('featureNotAllowed','AIAssistant'),'aiLicenseKeyEvaluationLimit'==_0x568d4c&&_0x973454['_showLicenseError']('evaluationLimit'),'aiLicenseKeyUsageLimit'==_0x568d4c&&_0x973454['_showLicenseError']('usageLimit');},0x3e8);}['destroy'](){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}['showUI'](_0x5b0d88='',_0x5b464c='',_0x2cfa35='custom'){const _0x1cf092=this['editor'],_0x3e80f8=_0x1cf092['editing']['view'],_0x23de59=_0x1cf092['plugins']['get'](ki),_0x1ca737=_0x1cf092['plugins']['get'](_0x44db63);_0x23de59['showFakeVisualSelection']();const _0x481090=new Qi(),_0x4c6e81=new ClipboardEvent('copy',{'clipboardData':_0x481090}),_0x32c9bc=new _0x425595(_0x481090),_0x1b4b94=new _0x5f08c8(_0x3e80f8,_0x4c6e81,{'dataTransfer':_0x32c9bc});_0x1ca737['_forceMarkersCopy']('comment',()=>{_0x3e80f8['document']['fire']('copy',_0x1b4b94);}),this['_formView']||(this['_initView'](),this['_aiAssistantController']=new Pi(_0x1cf092,this['_aiAdapter']['textAdapter'],this['_formView']));let _0x4248d9=_0x32c9bc['getData']('text/html');const _0x421656=_0x1cf092['model']['document']['selection'],_0x1ec6b1=Array['from'](_0x421656['getRanges']());0x1===_0x1ec6b1['length']&&_0x1ec6b1[0x0]['isFlat']&&!_0x421656['getSelectedElement']()&&''!==_0x4248d9['replace'](/&nbsp;/g,'')['trim']()&&(_0x4248d9='<p>'+_0x4248d9+'</p>'),this['_aiAssistantController']['updateView']({'actionId':_0x2cfa35,'query':_0x5b0d88,'htmlContent':_0x4248d9,'label':_0x5b464c,'mainActionLabel':Hi[_0x1cf092['model']['document']['selection']['isCollapsed']?'INSERT':'REPLACE']}),'aiAssistant'!==this['_dialog']['id']?this['_dialog']['show']({'id':'aiAssistant','icon':_0x1c8122,'title':yi(this['editor']['locale'],'AI\x20Assistant'),'content':this['_formView'],'position':Yt['EDITOR_TOP_SIDE'],'onShow':()=>{this['_formView']['focus']();},'onHide':()=>{this['_aiAssistantController']['reset'](),_0x23de59['hideFakeVisualSelection']();}}):this['_dialog']['view']['wasMoved']||this['_dialog']['view']['updatePosition']();}['hideUI'](){this['_dialog']['hide']();}['_getResolvedCommandsDefinitions'](){const _0x4dd857=new Map(),_0x306f62=bi(this['editor']['config']['get']('ai.assistant.commands'),this['editor']['locale']);for(const _0x4c8b30 of _0x306f62)for(const _0x25915e of _0x4c8b30['commands'])_0x4dd857['set'](_0x25915e['id'],{..._0x25915e,'groupId':_0x4c8b30['groupId'],'groupLabel':_0x4c8b30['groupLabel']||_0x4c8b30['groupId']});return _0x4dd857;}['_createAIAssistantUIButton'](_0x12b139){const _0x13c73b=this['editor'],_0x5f3ceb=_0x13c73b['commands']['get']('showAIAssistant'),_0x14cbba=new _0x12b139(_0x13c73b['locale']);return _0x14cbba['set']({'label':yi(_0x13c73b['locale'],'AI\x20Assistant'),'icon':_0x1c8122,'isToggleable':!0x0}),_0x14cbba['bind']('isEnabled')['to'](_0x5f3ceb),_0x14cbba['bind']('isOn')['to'](this['_dialog'],'id',_0x105e6b=>'aiAssistant'===_0x105e6b),this['listenTo'](_0x14cbba,'execute',()=>{_0x14cbba['isOn']?this['hideUI']():_0x5f3ceb['execute']();}),_0x14cbba;}['_initView'](){const _0x25ddfd=this['editor']['plugins']['get'](ki);this['_formView']=new qi(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',()=>{_0x25ddfd['insertContent'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['listenTo'](this['_formView'],'insertContentBelow',()=>{_0x25ddfd['insertContentBelow'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['_initAriaAiStatusChangeAnnouncements']();}['_initAriaAiStatusChangeAnnouncements'](){const {locale:_0xee3052,ui:{ariaLiveAnnouncer:_0x49d214}}=this['editor'];this['_formView']['contentArea']['on']('change:isProcessing',(_0x6b43de,_0x534ee2,_0x1d744a)=>{const _0xaa8efc=this['_aiAssistantController']['currentContext'];_0x1d744a?_0x49d214['announce'](yi(_0xee3052,'AI\x20is\x20writing')):_0xaa8efc&&_0x49d214['announce'](yi(_0xee3052,'Generated\x20content:\x20%0',_0xaa8efc),{'politeness':'polite','isUnsafeHTML':!0x0});}),this['_formView']['on']('change:isError',(_0x171eb2,_0x4a38fb,_0x56509f)=>{if(_0x56509f){const _0x127907=this['_formView']['errorView']['text'];_0x49d214['announce'](yi(_0xee3052,'Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x127907));}});}['_onExecute'](_0x2ee7c8){const _0x143114=this['_commandDefinitions']['get'](_0x2ee7c8),_0x5b76e6=this['editor'],_0x10afe9=_0x5b76e6['model']['document']['selection'],_0x1f6bb3=_0x5b76e6['commands']['get']('showAIAssistant'),_0x1a9301=_0x5b76e6['plugins']['get'](ki),_0x9ec771=''+(_0x143114['groupId']!==Si?_0x143114['groupLabel']+':\x20':'')+_0x143114['label'];if(!0x1!==_0x143114['requiresContent']&&_0x10afe9['isCollapsed']){const _0x1abfc4=It(_0x10afe9['getSelectedBlocks']())||_0x5b76e6['model']['schema']['getLimitElement'](_0x10afe9);_0x5b76e6['model']['change'](_0x404366=>{_0x404366['setSelection'](_0x1abfc4,'in');});}_0x1a9301['showFakeVisualSelection'](),_0x1f6bb3['execute'](_0x143114['prompt'],_0x9ec771,'command:'+_0x2ee7c8);}['_populateMenuBarMenu'](_0xa6992,_0x342716,_0x2af1ef,_0x1a2601){const _0x23e971=this['editor'],_0x538f44=_0x23e971['locale'],_0x47da6c=new $t(_0x538f44),_0x586f77=ji(_0x23e971,_0x2af1ef)['filter'](_0x1b3d18=>_0x1b3d18['commands']['length']);0x1===_0x586f77['length']?this['_getMenuBarGroupButtons']({'command':_0xa6992,'commands':_0x586f77[0x0]['commands'],'parentMenuView':_0x342716,'onExecute':_0x1a2601})['forEach'](_0x11d0ee=>_0x47da6c['items']['add'](_0x11d0ee)):_0x586f77['forEach'](({groupId:_0x465eb2,groupLabel:_0x453b15,commands:_0x34233d})=>{const _0x2e217b=new qt(_0x538f44,_0x342716),_0x2629ce=new Kt(_0x538f44),_0x379c44=new $t(_0x538f44),_0x36b21c=this['_getMenuBarGroupButtons']({'command':_0xa6992,'commands':_0x34233d,'parentMenuView':_0x2629ce,'onExecute':_0x1a2601});_0x2629ce['buttonView']['set']({'label':_0x453b15||_0x465eb2}),_0x2629ce['delegate']('execute')['to'](_0x342716),_0x379c44['items']['addMany'](_0x36b21c),_0x2629ce['panelView']['children']['add'](_0x379c44),_0x2e217b['children']['add'](_0x2629ce),_0x47da6c['items']['add'](_0x2e217b);}),_0x342716['panelView']['children']['add'](_0x47da6c);}['_getMenuBarGroupButtons']({command:_0x344c28,commands:_0x14c95a,parentMenuView:_0x517512,onExecute:_0x593eec}){const _0x345a23=this['editor'],_0x36e6d7=_0x345a23['locale'];return ji(_0x345a23,_0x14c95a)['map'](_0xa4b391=>{const _0x3205e6=new qt(_0x36e6d7,_0x517512),_0x550840=new Wt(_0x36e6d7);return _0x550840['set']({'label':_0xa4b391['label']}),_0x550840['delegate']('execute')['to'](_0x517512),_0x550840['on']('execute',()=>_0x593eec(_0xa4b391['id'])),_0x550840['bind']('isEnabled')['to'](_0x344c28,'enabledCommandsIds',_0x98f05c=>_0x98f05c['includes'](_0xa4b391['id'])),_0x3205e6['children']['add'](_0x550840),_0x3205e6;});}}function zi(_0x44ac78,_0x403270){return void 0x0!==_0x44ac78['order']&&void 0x0===_0x403270['order']?0x1:void 0x0===_0x44ac78['order']&&void 0x0!==_0x403270['order']?-0x1:void 0x0!==_0x44ac78['order']&&void 0x0!==_0x403270['order']?_0x44ac78['order']-_0x403270['order']:0x0;}function ji(_0x15ab98,_0x141937){_0x141937['sort'](zi);const _0x23ace4={},_0x1cc5a8=[];for(const _0x1559f0 of _0x141937)if(void 0x0!==_0x1559f0['order']){if(_0x1559f0['order']in _0x23ace4)throw new ht('ai-commands-config-order-collision',_0x15ab98,{'conflictingDefinitions':[_0x1559f0,_0x23ace4[_0x1559f0['order']]]});_0x23ace4[_0x1559f0['order']]=_0x1559f0,_0x1cc5a8['splice'](_0x1559f0['order'],0x0,_0x1559f0);}else _0x1cc5a8['push'](_0x1559f0);return _0x1cc5a8;}class Ji extends _0x58645c{static get['requires'](){return[Xi,ki];}static get['pluginName'](){return'AIAssistant';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x47715b){super(_0x47715b);const _0x57cdf0=_0x47715b['config'],_0x4954c8=_0x47715b['locale'];_0x57cdf0['define']('ai.assistant.preserveComments',!0x0),_0x57cdf0['define']('ai.assistant.commands',Zi(_0x4954c8)),_0x57cdf0['define']('ai.assistant.extraCommandGroups',[]),_0x57cdf0['define']('ai.assistant.removeCommands',[]);let _0x58e492=bi(_0x57cdf0['get']('ai.assistant.commands'),_0x4954c8);const _0xd9b4f3=_0x57cdf0['get']('ai.assistant.extraCommandGroups'),_0x31a443=_0x57cdf0['get']('ai.assistant.removeCommands');_0xd9b4f3['forEach'](_0xd50f5b=>{const _0x585304=_0x58e492['find'](_0x353060=>_0x353060['groupId']===_0xd50f5b['groupId']);_0x585304?_0x585304['commands']=_0x585304['commands']['concat'](_0xd50f5b['commands']):_0x58e492['push'](_0xd50f5b);}),_0x58e492=_0x58e492['filter'](_0x2e5c78=>!_0x31a443['includes'](_0x2e5c78['groupId'])),_0x58e492['forEach'](_0x3b41c3=>{_0x3b41c3['commands']=_0x3b41c3['commands']['filter'](_0x205c3d=>!_0x31a443['includes'](_0x205c3d['id']));}),_0x57cdf0['set']('ai.assistant.commands',_0x58e492);}}function Zi(_0x250513){return[{'groupId':'editOrReview','groupLabel':yi(_0x250513,'Edit\x20or\x20review'),'commands':[{'id':'improveWriting','label':yi(_0x250513,'Improve\x20writing'),'prompt':'Fix\x20spelling\x20mistakes,\x20use\x20proper\x20grammar\x20and\x20apply\x20good\x20writing\x20practices.\x20Do\x20not\x20lose\x20the\x20original\x20meaning.'},{'id':'makeShorter','label':yi(_0x250513,'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':yi(_0x250513,'Make\x20longer'),'prompt':'Improve\x20this\x20content\x20by\x20using\x20descriptive\x20language\x20and\x20inserting\x20more\x20information\x20and\x20more\x20detailed\x20explanations.'},{'id':'simplifyLanguage','label':yi(_0x250513,'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':yi(_0x250513,'Generate\x20from\x20selection'),'commands':[{'id':'summarize','label':yi(_0x250513,'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':yi(_0x250513,'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':yi(_0x250513,'Change\x20tone'),'commands':[{'id':'professional','label':yi(_0x250513,'Professional'),'prompt':'Improve\x20using\x20polished,\x20formal,\x20and\x20respectful\x20language\x20to\x20convey\x20professional\x20expertise\x20and\x20competence.'},{'id':'casual','label':yi(_0x250513,'Casual'),'prompt':'Improve\x20using\x20casual,\x20informal\x20language\x20to\x20convey\x20a\x20casual\x20conversation\x20with\x20a\x20real\x20person.'},{'id':'direct','label':yi(_0x250513,'Direct'),'prompt':'Improve\x20using\x20direct\x20language,\x20using\x20only\x20the\x20essential\x20information.'},{'id':'confident','label':yi(_0x250513,'Confident'),'prompt':'Improve\x20using\x20compelling,\x20optimistic\x20language\x20to\x20convey\x20confidence\x20in\x20the\x20writing.'},{'id':'friendly','label':yi(_0x250513,'Friendly'),'prompt':'Improve\x20using\x20friendly,\x20comforting\x20language,\x20to\x20convey\x20understanding\x20and\x20empathy.'}]},{'groupId':'changeStyle','groupLabel':yi(_0x250513,'Change\x20style'),'commands':[{'id':'business','label':yi(_0x250513,'Business'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20business\x20professional\x20with\x20formal\x20language.'},{'id':'legal','label':yi(_0x250513,'Legal'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20legal\x20professional\x20using\x20valid\x20legal\x20terminology.'},{'id':'journalism','label':yi(_0x250513,'Journalism'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20journalist\x20using\x20engaging\x20language\x20to\x20convey\x20the\x20importance\x20of\x20the\x20information.'},{'id':'poetic','label':yi(_0x250513,'Poetic'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20poem\x20using\x20poetic\x20techniques\x20without\x20losing\x20the\x20original\x20meaning.'}]},{'groupId':'translate','groupLabel':yi(_0x250513,'Translate'),'commands':[{'id':'translateEnglish','label':yi(_0x250513,'English'),'prompt':'Translate\x20the\x20content\x20to\x20English\x20language.'},{'id':'translateSpanish','label':yi(_0x250513,'Spanish'),'prompt':'Translate\x20the\x20content\x20to\x20Spanish\x20language.'},{'id':'translatePortuguese','label':yi(_0x250513,'Portuguese'),'prompt':'Translate\x20the\x20content\x20to\x20Portuguese\x20language.'},{'id':'translateGerman','label':yi(_0x250513,'German'),'prompt':'Translate\x20the\x20content\x20to\x20German\x20language.'},{'id':'translateFrench','label':yi(_0x250513,'French'),'prompt':'Translate\x20the\x20content\x20to\x20French\x20language.'},{'id':'translateChinese','label':yi(_0x250513,'Simplified\x20Chinese'),'prompt':'Translate\x20the\x20content\x20to\x20Simplified\x20Chinese\x20language.'},{'id':'translateHindi','label':yi(_0x250513,'Hindi'),'prompt':'Translate\x20the\x20content\x20to\x20Hindi\x20language.'},{'id':'translateArabic','label':yi(_0x250513,'Arabic'),'prompt':'Translate\x20the\x20content\x20to\x20Arabic\x20language.'}]}];}class ts extends _0x58645c{['abortController'];static get['requires'](){return[Ni];}constructor(_0x4e1f89){super(_0x4e1f89),this['abortController']=new AbortController();}['init'](){this['editor']['plugins']['get'](Ni)['textAdapter']=this;}['abort'](){this['abortController']['signal']['aborted']||(this['abortController']['abort'](),this['abortController']=new AbortController());}async['makeRequest'](_0x2937d5){return this['sendRequest'](_0x2937d5)['catch'](_0xd12ed=>{if(_0xd12ed instanceof vi)return Promise['reject'](_0xd12ed);if('AbortError'==_0xd12ed['name'])return Promise['resolve']();throw console['error'](_0xd12ed),new ht('aitextadapter-send-request-failed',null);});}async['_prepareRequestHeaders'](_0x28146e,_0x6e636a){const _0x2cca2b=this['editor']['locale'],_0x2ab8be={'Content-Type':'application/json'};if('object'==typeof _0x28146e)Object['assign'](_0x2ab8be,_0x28146e);else{if(_0x28146e)try{const _0x32bb13=await _0x28146e(_0x6e636a);Object['assign'](_0x2ab8be,_0x32bb13);}catch{return Promise['reject'](new vi(yi(_0x2cca2b,'AI_ERROR_GET_HEADERS')));}}return _0x2ab8be;}async['_prepareRequestParameters'](_0x183df0,_0xaac785){const _0x44e3de=this['editor']['locale'];if('object'==typeof _0x183df0)return _0x183df0;try{return await _0x183df0(_0xaac785);}catch{return Promise['reject'](new vi(yi(_0x44e3de,'AI_ERROR_GET_PARAMETERS')));}}}class es extends ts{['_apiUrl'];['_requestHeaders'];['_requestParameters'];static get['pluginName'](){return'OpenAITextAdapter';}constructor(_0x21b63c){super(_0x21b63c),_0x21b63c['config']['define']('ai.assistant.adapter.openAI.apiUrl','https://api.openai.com/v1/chat/completions'),_0x21b63c['config']['get']('ai.assistant.adapter.openAI.requestParameters')||_0x21b63c['config']['define']('ai.assistant.adapter.openAI.requestParameters',{'model':'gpt-4o','temperature':0x1,'top_p':0x1,'stream':!0x0}),this['_apiUrl']=_0x21b63c['config']['get']('ai.assistant.adapter.openAI.apiUrl'),this['_requestHeaders']=_0x21b63c['config']['get']('ai.assistant.adapter.openAI.requestHeaders')||{},this['_requestParameters']=_0x21b63c['config']['get']('ai.assistant.adapter.openAI.requestParameters');}async['sendRequest']({query:_0xb7b9c8,context:_0x204a07,onData:_0x5738f0,actionId:_0x5ed3b9}){const _0x2ebc45=this['editor']['locale'],_0x24af37=await this['prepareMessages'](_0xb7b9c8,_0x204a07,_0x5ed3b9),_0x32157d=await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x5ed3b9),_0x3c31a5=await this['_prepareRequestParameters'](this['_requestParameters'],_0x5ed3b9),_0x2bf879={'messages':_0x24af37,..._0x3c31a5},_0x5868af={'method':'POST','headers':_0x32157d,'body':JSON['stringify'](_0x2bf879),'signal':this['abortController']['signal']},_0xeeeb09=await fetch(this['_apiUrl'],_0x5868af);if(_0xeeeb09['ok'])return _0x3c31a5['stream']?await this['_readStreamableResponse'](_0xeeeb09,_0x5738f0):await this['_readStaticResponse'](_0xeeeb09,_0x5738f0),Promise['resolve']();{const _0x3b929d=await _0xeeeb09['text']();return _0x3b929d['includes']('context_length_exceeded')?Promise['reject'](new vi(yi(_0x2ebc45,'AI_ERROR_CONTEXT_LENGTH'))):_0x3b929d['includes']('Moderation')?Promise['reject'](new vi(yi(_0x2ebc45,'AI_ERROR_MODERATION'))):Promise['reject'](new Error(_0x3b929d));}}async['prepareMessages'](_0x504a71,_0x11c291,_0x325951){let _0x3f96ec,_0xdc2dd1;return _0x11c291?(_0x3f96ec='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.',_0xdc2dd1='Instruction:\x0a'+_0x504a71+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x11c291):(_0x3f96ec='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.',_0xdc2dd1=_0x504a71),[{'role':'system','content':_0x3f96ec},{'role':'user','content':_0xdc2dd1}];}async['_readStreamableResponse'](_0x5b1663,_0x153c31){const _0x2b8314=_0x5b1663['body']['getReader'](),_0x29fadf=new TextDecoder();let _0x55a407='',_0x69741c='',_0x22221c='',_0x175fb2=!0x1;for(;!_0x175fb2;){const {done:_0x4d8f57,value:_0x1f5d2b}=await _0x2b8314['read'](),_0x1ea295=_0x55a407+_0x29fadf['decode'](_0x1f5d2b);let _0xc64b88='';_0x175fb2=_0x4d8f57;try{_0xc64b88=this['_cleanUpData'](_0x1ea295),_0x55a407='';}catch{_0x55a407=_0x1ea295;continue;}_0x69741c+=_0xc64b88,!_0x175fb2&&this['_isBufferIncomplete'](_0x69741c)||_0x69741c&&(_0x22221c+=_0x69741c,_0x69741c='',_0x153c31(_0x22221c));}return Promise['resolve']();}async['_readStaticResponse'](_0x50219f,_0x35f88b){return _0x35f88b((await _0x50219f['json']())['choices'][0x0]['message']['content']),Promise['resolve']();}['_isBufferIncomplete'](_0x48ed8a){const _0xd37e75=_0x48ed8a['split']('<')['length']!==_0x48ed8a['split']('>')['length'],_0x388d6b=_0x48ed8a['length']<0x1e;return _0xd37e75&&_0x388d6b;}['_cleanUpData'](_0x59af63){return _0x59af63['split'](/\n(?![^{]*\})/g)['map'](_0x12d254=>_0x12d254['replace']('data:\x20',''))['filter'](_0x45e069=>_0x45e069&&_0x45e069['length']>0x0&&'[DONE]'!==_0x45e069)['map'](_0x45342f=>{const {choices:_0x74c6ee}=JSON['parse'](_0x45342f);if(_0x74c6ee[0x0]?.['delta']?.['content'])return _0x74c6ee[0x0]['delta']['content'];})['filter'](_0x1d762b=>_0x1d762b)['join']('');}}class is extends ts{['_apiUrl'];['_requestHeaders'];['_bedrockClientConfig'];['_requestParameters'];static get['pluginName'](){return'AWSTextAdapter';}constructor(_0x29c32f){super(_0x29c32f),_0x29c32f['config']['get']('ai.assistant.adapter.aws.requestParameters')||_0x29c32f['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']=_0x29c32f['config']['get']('ai.assistant.adapter.aws.apiUrl'),this['_bedrockClientConfig']=_0x29c32f['config']['get']('ai.assistant.adapter.aws.bedrockClientConfig'),this['_requestHeaders']=_0x29c32f['config']['get']('ai.assistant.adapter.aws.requestHeaders'),this['_requestParameters']=_0x29c32f['config']['get']('ai.assistant.adapter.aws.requestParameters');}async['sendRequest']({query:_0x2b20df,context:_0x3ad427,onData:_0x576e71,actionId:_0x42d80b}){const {model:_0x10f2cb,stream:_0x342a61,..._0x185a9f}=await this['_prepareRequestParameters'](this['_requestParameters'],_0x42d80b),_0x314c57={'prompt':await this['preparePrompt'](_0x2b20df,_0x3ad427,_0x10f2cb,_0x42d80b),..._0x185a9f};this['_apiUrl']?await this['_processProxyRequest'](_0x314c57,_0x10f2cb,_0x342a61,_0x576e71,_0x42d80b):await this['_processAWSRequest'](_0x314c57,_0x10f2cb,_0x342a61,_0x576e71);}async['preparePrompt'](_0x267f4a,_0x489003,_0x41f975,_0x57ee8c){let _0x138dda,_0x3920ff;return _0x489003?(_0x138dda='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.',_0x3920ff='Instruction:\x0a'+_0x267f4a+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x489003):(_0x138dda='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.',_0x3920ff=_0x267f4a),'meta.llama'==this['getModelFamily'](_0x41f975)?'<<SYS>>\x0a'+_0x138dda+'\x0a<</SYS>>\x0a[INST]\x0a'+_0x3920ff+'\x0a[/INST]':'Human:\x0a'+_0x138dda+'\x0a'+_0x3920ff+'\x0a\x0aAssistant:';}['getModelFamily'](_0x491542){if(/^anthropic\.claude/['test'](_0x491542))return'anthropic.claude';if(/^ai21\.j2/['test'](_0x491542))return'ai21.j2';if(/^cohere\.command/['test'](_0x491542))return'cohere.command';if(/^meta\.llama/['test'](_0x491542))return'meta.llama';throw new vi(yi(this['editor']['locale'],'AI_ERROR_UNSUPPORTED_MODEL',_0x491542));}async['_processProxyRequest'](_0x20aa2c,_0x3342f7,_0x5b3ffe,_0xe5ca96,_0x53b99a){const _0x390468={'method':'POST','headers':await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x53b99a),'body':JSON['stringify']({..._0x20aa2c,'model':_0x3342f7,'stream':_0x5b3ffe}),'signal':this['abortController']['signal']},_0x538234=await fetch(this['_apiUrl'],_0x390468);_0x5b3ffe?await this['_readStreamableResponse'](_0x538234,_0x3342f7,_0xe5ca96):await this['_readStaticResponse'](_0x538234,_0x3342f7,_0xe5ca96);}async['_processAWSRequest'](_0x39434c,_0x5ee811,_0x1407d9,_0x301070){const _0x126d59=new _0x103c47(this['_bedrockClientConfig']),_0x5e35bc={'body':JSON['stringify'](_0x39434c),'contentType':'application/json','accept':'application/json','modelId':_0x5ee811};let _0x346dda;if(_0x1407d9){const _0x316b89=new _0x2a5aac(_0x5e35bc);_0x346dda=await _0x126d59['send'](_0x316b89,{'abortSignal':this['abortController']['signal']}),await this['_readAsyncIterableResponse'](_0x346dda,_0x5ee811,_0x301070);}else{const _0x1f063b=new _0x49c1ec(_0x5e35bc);_0x346dda=await _0x126d59['send'](_0x1f063b,{'abortSignal':this['abortController']['signal']}),await this['_readStaticResponse'](_0x346dda,_0x5ee811,_0x301070);}}async['_readAsyncIterableResponse'](_0x59fc2e,_0x425810,_0xdc23ab){const _0x30bd0a=_0x59fc2e['body'],_0x1d4fa3=new TextDecoder('utf-8');let _0x1389e7='';for await(const _0x3f1627 of _0x30bd0a)if(_0x3f1627['chunk']){const _0xd18991=_0x1d4fa3['decode'](_0x3f1627['chunk']['bytes']),_0x43d791=JSON['parse'](_0xd18991);_0x1389e7+=this['_getGeneratedText'](_0x43d791,_0x425810),_0xdc23ab(_0x1389e7);}return Promise['resolve']();}async['_readStreamableResponse'](_0x4ff0b4,_0xe517ed,_0x1e5829){const _0x2a7945=_0x4ff0b4['body'],_0xcace3a=new TextDecoder('utf-8'),_0x16318d=_0x2a7945['getReader']();let _0x5ca26b='',_0x250c60='',_0x1a1656=!0x1;for(;!_0x1a1656;){const {done:_0x18861e,value:_0x16ddaf}=await _0x16318d['read']();if(_0x1a1656=_0x18861e,_0x1a1656)break;const _0x11d398=(_0x5ca26b+_0xcace3a['decode'](_0x16ddaf))['split']('\x0a')['map'](_0x3bd2b1=>{try{return _0x5ca26b='',JSON['parse'](_0x3bd2b1);}catch{return _0x5ca26b=_0x3bd2b1,null;}})['filter'](_0x24a68d=>null!==_0x24a68d);_0x11d398['length']&&(_0x250c60+=_0x11d398['map'](_0x1de4b9=>this['_getGeneratedText'](_0x1de4b9,_0xe517ed))['join'](''),_0x1e5829(_0x250c60));}return Promise['resolve']();}async['_readStaticResponse'](_0x5c9529,_0x518e6a,_0x30b477){let _0x4c945b;return _0x4c945b=_0x5c9529 instanceof Response?await _0x5c9529['json']():JSON['parse'](new TextDecoder('utf-8')['decode'](_0x5c9529['body'])),(_0x30b477(this['_getGeneratedText'](_0x4c945b,_0x518e6a)),Promise['resolve']());}['_getGeneratedText'](_0x8ad82d,_0x2d24d2){switch(this['getModelFamily'](_0x2d24d2)){case'anthropic.claude':return _0x8ad82d['completion'];case'ai21.j2':return _0x8ad82d['completions'][0x0]['data']['text'];case'cohere.command':return _0x8ad82d['generations'][0x0]['text'];case'meta.llama':return _0x8ad82d['generation'];}}}class ss extends Nt{constructor(_0x33942c,_0x1d1ee7={}){super(_0x33942c),this['isToggleable']=!0x0,this['set']('side',_0x1d1ee7['side']||'top');const _0x4e5714=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-tab-button',...Et(_0x1d1ee7['class']||[]),_0x4e5714['to']('side',_0x38fc3b=>'ck-tab-button_'+_0x38fc3b),_0x4e5714['to']('class')]}});}['show'](){this['set']('isVisible',!0x0);}['hide'](){this['set']('isVisible',!0x1);}}class ns extends vt{['children'];constructor(_0x19d86a,_0x29bb41={}){super(_0x19d86a);const _0x1afe13=this['bindTemplate'];this['set']('isVisible',!0x1),this['set']('class',''),this['children']=this['createCollection'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck-tab-panel',...Et(_0x29bb41['class']||[]),_0x1afe13['to']('class'),_0x1afe13['if']('isVisible','ck-hidden',_0x5b1c18=>!_0x5b1c18)]},'children':this['children']});}['show'](){this['set']('isVisible',!0x0);}['hide'](){this['set']('isVisible',!0x1);}}class rs extends vt{['buttonViews']=this['createCollection']();['panelViews']=this['createCollection']();['_tabs']=new Map();constructor(_0x590e89,_0x14ef22={}){super(_0x590e89),this['set']('class',void 0x0),this['set']('activeTab',null),this['set']('side',_0x14ef22['side']||'top'),this['set']('isMaximized',!0x1);const _0x5a0544=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset','ck-tabs',...Et(_0x14ef22['class']||[]),_0x5a0544['to']('side',_0x26aff4=>'ck-tabs_'+_0x26aff4),_0x5a0544['to']('class'),_0x5a0544['to']('isMaximized',_0x2075c7=>_0x2075c7?'ck-ai-tabs_maximized':'')],'tabindex':'0'},'children':[{'tag':'div','attributes':{'class':['ck','ck-tabs__buttons-container',_0x5a0544['to']('side',_0xc07b83=>'ck-tabs__buttons-container_'+_0xc07b83)]},'children':this['buttonViews']},{'tag':'div','attributes':{'class':['ck','ck-tabs__panels-container',_0x5a0544['to']('side',_0x4940b8=>'ck-tabs__panels-container_'+_0x4940b8)]},'children':this['panelViews']},...Et(_0x14ef22['children']||[])]});}['getTabIds'](){return[...this['_tabs']['keys']()];}['getTab'](_0x34f500){const _0x59a8d5=this['_tabs']['get'](_0x34f500);return _0x59a8d5||null;}['addTab'](_0x538a95){const _0x14c376=this['_setupButton']({'id':_0x538a95['id'],'label':_0x538a95['buttonLabel'],'icon':_0x538a95['buttonIcon'],'order':_0x538a95['order']}),_0x3f9c78=new ns(this['locale']);return _0x3f9c78['render'](),_0x538a95['content']&&_0x3f9c78['children']['add'](_0x538a95['content']),this['panelViews']['add'](_0x3f9c78),this['_tabs']['set'](_0x538a95['id'],{'button':_0x14c376,'panel':_0x3f9c78,'order':void 0x0!==_0x538a95['order']?_0x538a95['order']:null}),this['fire']('addTab:'+_0x538a95['id'],{'id':_0x538a95['id'],'button':_0x14c376,'panel':_0x3f9c78}),null===this['activeTab']?this['activateTab'](_0x538a95['id']):this['_hidePanel'](_0x538a95['id']),{'button':_0x14c376,'panel':_0x3f9c78};}['activateTab'](_0x485161){if(null!==_0x485161&&!this['getTab'](_0x485161))throw new ht('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0x485161});this['activeTab']!==_0x485161&&(this['activeTab']&&this['_hidePanel'](this['activeTab']),this['activeTab']=_0x485161,_0x485161&&this['_showPanel'](_0x485161),this['fire']('activateTab:'+_0x485161,_0x485161));}['showTab'](_0x4c2ad8){if(!this['getTab'](_0x4c2ad8))throw new ht('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0x4c2ad8});this['_showPanel'](_0x4c2ad8),this['_showButton'](_0x4c2ad8),this['fire']('show:'+_0x4c2ad8,_0x4c2ad8);}['hideTab'](_0x16865b){if(!this['getTab'](_0x16865b))throw new ht('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0x16865b});const _0x306373=this['activeTab'];this['_hidePanel'](_0x16865b),this['_hideButton'](_0x16865b);const _0x1398fb=this['getTabIds']();_0x306373===_0x16865b&&_0x1398fb['length']>0x1&&this['activateTab'](_0x1398fb['find'](_0x3d25a3=>_0x3d25a3!==_0x16865b)),this['fire']('hide:'+_0x16865b,_0x16865b);}['_getPanel'](_0x3f8129){const _0x632fcf=this['_tabs']['get'](_0x3f8129);return _0x632fcf?_0x632fcf['panel']:null;}['_showPanel'](_0x4f1152){null!==this['activeTab']&&this['activeTab']!==_0x4f1152||this['_getPanel'](_0x4f1152)['show']();}['_hidePanel'](_0x47da96){const _0x39c037=this['_getPanel'](_0x47da96);_0x39c037['isVisible']&&(this['activeTab']===_0x47da96&&(this['activeTab']=null),_0x39c037['hide']());}['_getButton'](_0x3e6b19){const _0xc2442c=this['_tabs']['get'](_0x3e6b19);return _0xc2442c?_0xc2442c['button']:null;}['_showButton'](_0x4d4a72){this['_getButton'](_0x4d4a72)['show']();}['_hideButton'](_0x411c79){this['_getButton'](_0x411c79)['hide']();}['_setupButton'](_0x35d262){const _0x3d7b83=new ss(this['locale'],{'side':this['side']}),_0x405b90=this['buttonViews'];if(_0x3d7b83['set']({'label':_0x35d262['label'],'icon':_0x35d262['icon'],'tooltip':!0x0,'withText':!0x0}),_0x3d7b83['bind']('isOn')['to'](this,'activeTab',_0x1003c0=>_0x1003c0===_0x35d262['id']),_0x3d7b83['bind']('side')['to'](this,'side'),_0x35d262['order']){const _0x5b021b=[...this['_tabs']]['reduce']((_0x8fe0ce,_0x149be3)=>{const _0x48e896=_0x149be3[0x0],{order:_0x400b4f}=_0x149be3[0x1];return!_0x400b4f||_0x400b4f>_0x35d262['order']?_0x8fe0ce:_0x400b4f>=_0x8fe0ce['order']?{'id':_0x48e896,'order':_0x400b4f}:_0x8fe0ce;},{'id':'','order':0x0}),_0x1ad3ab=_0x405b90['getIndex'](this['_getButton'](_0x5b021b['id']));_0x405b90['add'](_0x3d7b83,_0x1ad3ab+0x1);}else _0x405b90['add'](_0x3d7b83);return _0x3d7b83['on']('execute',()=>{this['activateTab'](_0x35d262['id']);}),_0x3d7b83;}}const as=['overlay','sidebar','custom'],os=['left','right'];class hs extends rs{constructor(_0x4d8652,_0xdc255={}){super(_0x4d8652,_0xdc255),this['set']('type',_0xdc255['type']||'sidebar'),this['set']('side',_0xdc255['side']||'right'),this['set']('isVisible',_0xdc255['visibleByDefault']??!0x0);const _0x5d8590=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-tabs',_0x5d8590['if']('type','ck-ai-tabs__overlay',_0x583d13=>'overlay'===_0x583d13),_0x5d8590['if']('type','ck-ai-tabs__sidebar',_0x59f846=>'sidebar'===_0x59f846),_0x5d8590['if']('isVisible','ck-hidden',_0x4c2f68=>!_0x4c2f68)]}}),this['buttonViews']['on']('add',(_0x1df156,_0x496329)=>{_0x496329['set']('withText',!0x1);});}}class cs extends _0x25e92e{['view'];['container']=null;['showResizeButton']=!0x0;static get['pluginName'](){return'AITabs';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x3d731f){super(_0x3d731f);const _0x4db6f2=this['context']['config']['get']('ai.container');if(this['set']('side','right'),!_0x4db6f2)throw new ht('ai-tabs-configuration-not-found');if(void 0x0!==_0x4db6f2['showResizeButton']&&(this['showResizeButton']=_0x4db6f2['showResizeButton']),'sidebar'!==_0x4db6f2['type']&&'overlay'!==_0x4db6f2['type']||_0x4db6f2['side']&&(this['side']=_0x4db6f2['side']),'sidebar'===_0x4db6f2['type']){if(this['container']=_0x4db6f2['element'],this['set']('type','sidebar'),!this['container'])throw new ht('ai-tabs-sidebar-container-element-not-found');}else'overlay'===_0x4db6f2['type']?(this['container']=document['body'],this['set']('type','overlay')):(this['container']=null,this['set']('type','custom'));this['view']=new hs(this['context']['locale'],{'side':this['side'],'type':this['type'],'visibleByDefault':void 0x0===_0x4db6f2['visibleByDefault']||_0x4db6f2['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 _0x457883&&this['context']['ui']['focusTracker']['add'](this['view']['element']);}['switchType'](_0x2d7a3e){if(_0x2d7a3e&&this['type']!==_0x2d7a3e){if(!as['includes'](_0x2d7a3e))throw new ht('ai-tabs-unsupported-ui-type');this['type']=_0x2d7a3e;}}['switchSide'](_0x14bc0b){if(_0x14bc0b&&this['side']!==_0x14bc0b){if(!os['includes'](_0x14bc0b))throw new ht('ai-tabs-unsupported-ui-side');this['side']=_0x14bc0b;}}['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 ls extends _0x25e92e{['_apiUrl'];['_token'];['_decoder'];['_responseCache'];static get['requires'](){return[_0x219338];}static get['pluginName'](){return'AIConnector';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x16467a){super(_0x16467a),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 _0x36bf66=this['context']['plugins']['get'](_0x219338);if(!_0x36bf66['token'])throw new ht('ai-missing-token',this);this['_token']=_0x36bf66['token'];}['startConversation'](_0x3a62ec,_0x4640d6){const _0x47d068=this['_sendApiRequest']('/conversations','POST',{'id':_0x3a62ec,'group':_0x4640d6});return{'getConversation':async()=>(await _0x47d068['request'])['json'](),'abortController':_0x47d068['abortController']};}['queryAssistant']({message:_0x3ba22f,conversationId:_0xd561d4,parts:_0xc50d24,capabilities:_0x3e07e7,model:_0x529393,attributes:_0x2c0144}){const _0x5c49dc={'prompt':_0x3ba22f,'content':_0xc50d24,'model':_0x529393,..._0x3e07e7&&{'capabilities':_0x3e07e7},..._0x2c0144&&{'attributes':_0x2c0144}},_0x5eac8d=this['_sendApiRequest']('/conversations/'+_0xd561d4+'/messages','POST',_0x5c49dc);return{'getStream':async()=>{const _0x154e03=(await _0x5eac8d['request'])['body'];return this['_getStreamReader'](_0x154e03);},'abortController':_0x5eac8d['abortController']};}['executeCustomAction']({content:_0x4a5acf,message:_0x195a1c,model:_0x1116ff,outputFormat:_0x5d3f1e}){const _0x5f3c7e={'content':[{'type':'text','content':_0x4a5acf}],'prompt':_0x195a1c,'model':_0x1116ff,'outputFormat':_0x5d3f1e},_0xbd18ca=this['_sendApiRequest']('/actions/custom/calls','POST',_0x5f3c7e);return{'getStream':async()=>{const _0x1f09ef=(await _0xbd18ca['request'])['body'];return this['_getStreamReader'](_0x1f09ef);},'abortController':_0xbd18ca['abortController']};}['executeAction']({actionName:_0x565705,content:_0x2a124b,args:_0x29a861}){const _0x1512f6={'content':[{'type':'text','content':_0x2a124b}],'args':_0x29a861},_0x23eab2=this['_sendApiRequest']('/actions/system/'+_0x565705+'/calls','POST',_0x1512f6);return{'getStream':async()=>{const _0x3c80dd=(await _0x23eab2['request'])['body'];return this['_getStreamReader'](_0x3c80dd);},'abortController':_0x23eab2['abortController']};}['uploadFile'](_0x36a711,_0x4df336,_0x27dba5){const _0x49f2c9=new FormData();_0x49f2c9['append']('file',_0x4df336,_0x4df336['name']),_0x27dba5&&_0x49f2c9['append']('attributes',JSON['stringify'](_0x27dba5));const _0x55993c=this['_sendApiRequest']('/conversations/'+_0x36a711+'/files','POST',_0x49f2c9);return{'getId':async()=>(await _0x55993c['request'])['json'](),'abortController':_0x55993c['abortController']};}['fetchDocument'](_0x3e5548,_0x4e647e){const _0x113d78=this['_sendApiRequest']('/conversations/'+_0x3e5548+'/documents/'+_0x4e647e,'GET');return{'getDocument':async()=>(await _0x113d78['request'])['json'](),'abortController':_0x113d78['abortController']};}['uploadDocument'](_0x3062d8,_0x43dc24,_0x1d5687){const _0x475e9d={'content':_0x43dc24};_0x1d5687&&(_0x475e9d['attributes']=_0x1d5687);const _0x59593f=this['_sendApiRequest']('/conversations/'+_0x3062d8+'/documents','POST',_0x475e9d);return{'getId':async()=>(await _0x59593f['request'])['json'](),'abortController':_0x59593f['abortController']};}['fetchConversations'](_0x24e841,_0x232581={}){const _0x481187=new URLSearchParams();_0x481187['append']('group',_0x24e841),_0x481187['append']('excludeEmpty',!0x1!==_0x232581['excludeEmpty']?'true':'false'),_0x481187['append']('limit',_0x232581['limit']?_0x232581['limit']['toString']():'100'),_0x481187['append']('sortBy',_0x232581['sortBy']?_0x232581['sortBy']:'createdAt'),_0x481187['append']('order',_0x232581['order']?_0x232581['order']:'desc');const _0x4d5a84=this['_sendApiRequest']('/conversations?'+_0x481187['toString'](),'GET');return{'getConversations':async()=>{const _0x1458e7=await _0x4d5a84['request'];return(await _0x1458e7['json']())['items'];},'abortController':_0x4d5a84['abortController']};}['deleteConversation'](_0x73de6){const _0x197084=this['_sendApiRequest']('/conversations/'+_0x73de6,'DELETE');return{'execute':async()=>{await _0x197084['request'];},'abortController':_0x197084['abortController']};}['updateConversation'](_0x2c0eee,_0x40b9f8){const _0x45e39a=this['_sendApiRequest']('/conversations/'+_0x2c0eee,'PATCH',_0x40b9f8);return{'getResult':async()=>(await _0x45e39a['request'],_0x40b9f8),'abortController':_0x45e39a['abortController']};}['fetchConversation'](_0x4cf6b7){const _0x50287c=this['_sendApiRequest']('/conversations/'+_0x4cf6b7,'GET');return{'getConversation':async()=>(await _0x50287c['request'])['json'](),'abortController':_0x50287c['abortController']};}['fetchConversationMessages'](_0x25f9a1){const _0x1255bc=this['_sendApiRequest']('/conversations/'+_0x25f9a1+'/messages','GET');return{'getMessages':async()=>{const _0x12f0f9=await _0x1255bc['request'];return(await _0x12f0f9['json']())['items'];},'abortController':_0x1255bc['abortController']};}['uploadUrl'](_0xe40313,_0x1f1b07,_0x1faea1){const _0x5c28fe=this['_sendApiRequest']('/conversations/'+_0xe40313+'/web-resources','POST',{'url':_0x1f1b07,'attributes':_0x1faea1});return{'getId':async()=>(await _0x5c28fe['request'])['json'](),'abortController':_0x5c28fe['abortController']};}['getModels'](_0x1cfe6b='en'){const _0x29e4db=new URLSearchParams();_0x29e4db['append']('language',_0x1cfe6b);const _0x1cdf43='/models/1?'+_0x29e4db['toString'](),_0x1ce8c0=this['_sendApiRequest'](_0x1cdf43,'GET',void 0x0,!0x0);return{'list':async()=>await(await _0x1ce8c0['request'])['json'](),'abortController':_0x1ce8c0['abortController']};}['deleteFile'](_0x20b349,_0x1ee072){const _0x19fd1c=this['_sendApiRequest']('/conversations/'+_0x20b349+'/files/'+_0x1ee072,'DELETE');return{'execute':async()=>{await _0x19fd1c['request'];},'abortController':_0x19fd1c['abortController']};}['deleteDocument'](_0x425a9e,_0x550789){const _0x45bace=this['_sendApiRequest']('/conversations/'+_0x425a9e+'/documents/'+_0x550789,'DELETE');return{'execute':async()=>{await _0x45bace['request'];},'abortController':_0x45bace['abortController']};}['deleteWebResource'](_0x2c017f,_0x382a9e){const _0x50a968=this['_sendApiRequest']('/conversations/'+_0x2c017f+'/web-resources/'+_0x382a9e,'DELETE');return{'execute':async()=>{await _0x50a968['request'];},'abortController':_0x50a968['abortController']};}['callSystemReview']({reviewName:_0xcfe1b7,content:_0x37ace3,args:_0x407e8f}){const _0x2dc1ea=this['_sendApiRequest']('/reviews/system/'+_0xcfe1b7+'/calls','POST',{'content':[{'type':'text','content':_0x37ace3}],'args':_0x407e8f});return{'getStream':async()=>{const _0x2d3fc0=(await _0x2dc1ea['request'])['body'];return this['_getStreamReader'](_0x2d3fc0);},'abortController':_0x2dc1ea['abortController']};}['callCustomReview']({content:_0x136acc,prompt:_0x74f55f,model:_0x5619bb}){const _0x31f3a3=this['_sendApiRequest']('/reviews/custom/calls','POST',{'content':[{'type':'text','content':_0x136acc}],'prompt':_0x74f55f,'model':_0x5619bb});return{'getStream':async()=>{const _0x28736a=(await _0x31f3a3['request'])['body'];return this['_getStreamReader'](_0x28736a);},'abortController':_0x31f3a3['abortController']};}['upsertAIChatRating'](_0x4a9360,_0x1d4111,_0x4a717a){const _0x4d54d9=this['_sendApiRequest']('/conversations/'+_0x4a9360+'/messages/'+_0x1d4111+'/ratings','PUT',{'positiveCount':_0x4a717a['positiveCount'],'totalCount':_0x4a717a['totalCount'],'modificationId':_0x4a717a['modificationId']});return{'execute':async()=>{await _0x4d54d9['request'];},'abortController':_0x4d54d9['abortController']};}['upsertAIActionRating'](_0x39cd80,_0x28d7c3,_0x127443){const _0x4ff606=this['_sendApiRequest']('/actions/system/'+_0x39cd80+'/calls/'+_0x28d7c3+'/ratings','PUT',{'positiveCount':_0x127443['positiveCount'],'totalCount':_0x127443['totalCount']});return{'execute':async()=>{await _0x4ff606['request'];},'abortController':_0x4ff606['abortController']};}['upsertCustomAIActionRating'](_0x1c6c65,_0x757b4b){const _0x4b532d=this['_sendApiRequest']('/actions/custom/calls/'+_0x1c6c65+'/ratings','PUT',{'positiveCount':_0x757b4b['positiveCount'],'totalCount':_0x757b4b['totalCount']});return{'execute':async()=>{await _0x4b532d['request'];},'abortController':_0x4b532d['abortController']};}['upsertAIReviewRating'](_0x38055b,_0x3253d1,_0x7afb8c,_0x54c55e){const _0x3f4562=this['_sendApiRequest']('/reviews/system/'+_0x38055b+'/calls/'+_0x3253d1+'/ratings','PUT',{'positiveCount':_0x7afb8c['positiveCount'],'totalCount':_0x7afb8c['totalCount'],'dataId':_0x54c55e});return{'execute':async()=>{await _0x3f4562['request'];},'abortController':_0x3f4562['abortController']};}['upsertCustomAIReviewRating'](_0x1c0912,_0x12aaa8,_0x493bec){const _0x539801=this['_sendApiRequest']('/reviews/custom/calls/'+_0x1c0912+'/ratings','PUT',{'positiveCount':_0x12aaa8['positiveCount'],'totalCount':_0x12aaa8['totalCount'],'dataId':_0x493bec});return{'execute':async()=>{await _0x539801['request'];},'abortController':_0x539801['abortController']};}['_sendApiRequest'](_0x47198d,_0x46e15a,_0x59c89f,_0x1c8d04=!0x1){const _0x2db38b=new AbortController(),_0x4253a6=_0x1c8d04?_0x46e15a+':'+_0x47198d:null;if(_0x4253a6){const _0x2198e5=this['_responseCache']['get'](_0x4253a6);if(_0x2198e5)return{'request':_0x2198e5['then'](_0x933436=>_0x933436['clone']()),'abortController':_0x2db38b};}const _0x525f59=_0x59c89f instanceof FormData,_0x385f4e={'Authorization':'Bearer\x20'+this['_token']?.['value']};_0x59c89f&&!_0x525f59&&(_0x385f4e['Content-Type']='application/json');const _0x2721d1={'method':_0x46e15a,'headers':_0x385f4e,'signal':_0x2db38b['signal']};_0x59c89f&&(_0x2721d1['body']=_0x525f59?_0x59c89f:JSON['stringify'](_0x59c89f));const _0x214165=fetch(''+this['_apiUrl']+_0x47198d,_0x2721d1)['catch'](_0x328f35=>{_0x4253a6&&this['_responseCache']['delete'](_0x4253a6),this['_handleError'](_0x328f35);})['then'](_0x4aea52=>_0x4aea52['ok']?_0x4aea52:_0x4aea52['json']()['then'](_0x3ad5da=>{throw _0x4253a6&&this['_responseCache']['delete'](_0x4253a6),{'url':this['_apiUrl'],'path':_0x47198d,'method':_0x46e15a,'body':_0x59c89f,'status':(_0x4aea52||{})['status'],'statusText':(_0x4aea52||{})['statusText'],'code':_0x3ad5da['code'],'message':_0x3ad5da['message'],'traceId':_0x3ad5da['traceId']};}));return _0x4253a6&&this['_responseCache']['set'](_0x4253a6,_0x214165['then'](_0x268344=>_0x268344['clone']())),{'request':_0x214165,'abortController':_0x2db38b};}async*['_getStreamReader'](_0x4f51cc){const _0x455ea3=[],_0x4ffbc4=_0x4f51cc['getReader'](),_0x1ead70=_0x1eaed0({'onError':_0x389f31=>{this['_handleError'](_0x389f31);},'onEvent':_0x56bb6f=>{_0x56bb6f['data']=JSON['parse'](_0x56bb6f['data']),_0x455ea3['push'](_0x56bb6f);}});try{let _0x132518=!0x1;for(;!_0x132518;){const {done:_0x3f3cac,value:_0x41a404}=await _0x4ffbc4['read']();_0x3f3cac&&(_0x132518=!0x0),_0x1ead70['feed'](this['_decoder']['decode'](_0x41a404,{'stream':!0x0})),yield*_0x455ea3,_0x455ea3['length']=0x0;}}catch(_0x9f2b7){this['_handleError'](_0x9f2b7);}finally{_0x4ffbc4['releaseLock'](),_0x1ead70['reset']();}}['_handleError'](_0x1ec05b){if(_0x1ec05b instanceof ht)throw _0x1ec05b;if(_0x1ec05b instanceof Error&&'AbortError'===_0x1ec05b['name'])throw new ht('ai-request-aborted',this,{'originalError':_0x1ec05b});throw new ht('ai-request-failed',this,{'originalError':_0x1ec05b});}}function us(_0x8dc16f,_0x3c7fff,_0x2068ce){const t=_0x8dc16f['t'];switch(_0x3c7fff){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'},_0x2068ce);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.'},_0x2068ce);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.'},_0x2068ce);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.'},_0x2068ce);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'},_0x2068ce);case'AI_CHAT_SUGGESTION_ACTION_SUGGEST':return t({'id':'AI_CHAT_SUGGESTION_ACTION_SUGGEST','string':'Suggest'},_0x2068ce);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'},_0x2068ce);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.'},_0x2068ce);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.'},_0x2068ce);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.'},_0x2068ce);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.'},_0x2068ce);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'},_0x2068ce);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.'},_0x2068ce);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 _0x3c7fff;}}const ds='ck-ai-button-primary',_s='ck-ai-button-secondary',As='ck-ai-button-tertiary';function gs(_0x499430,_0x26d65d){const _0x180416=new Nt(_0x499430),_0x4433a2=us(_0x499430,'AI_TABS_LABEL_MINIMIZE'),_0x2abb3f=us(_0x499430,'AI_TABS_LABEL_MAXIMIZE');return _0x180416['set']({'withText':!0x1,'icon':_0x1479f2,'tooltip':!0x0,'class':'ck-ai-tabs__resize\x20'+As}),_0x180416['bind']('label')['to'](_0x26d65d,'isMaximized',_0xa656fe=>_0xa656fe?_0x4433a2:_0x2abb3f),_0x180416['bind']('icon')['to'](_0x26d65d,'isMaximized',_0x169f00=>_0x169f00?_0x17f5ad:_0x1479f2),_0x180416['bind']('isOn')['to'](_0x26d65d,'isMaximized'),_0x180416['on']('execute',()=>{_0x26d65d['fire']('resizeTabs');}),_0x180416;}function Is(_0x1f2b6b){return _0x12da97(_0x1f2b6b);}function Es(_0x4b85be){return _0x208fec(_0x4b85be);}function ps(_0x47971a,_0x55d209,_0x21ced8){const _0x587310=null!==_0x55d209?_0x359d48=>_0x359d48['attribs'][_0x47971a]===_0x55d209:_0x472a07=>Boolean(_0x472a07['attribs'][_0x47971a]);return _0x5b0b3c(_0x2c084a=>_0x158702(_0x2c084a)&&_0x587310(_0x2c084a),_0x21ced8);}function Ts(_0x3564ad,_0x42047d,_0x45f6ae){const _0x2f2484=null!==_0x42047d?_0x3a4dc9=>_0x3a4dc9['attribs'][_0x3564ad]===_0x42047d:_0x254f6a=>Boolean(_0x254f6a['attribs'][_0x3564ad]);return _0x5bcee3(_0x563e1d=>_0x158702(_0x563e1d)&&_0x2f2484(_0x563e1d),_0x45f6ae);}function ms(_0x49b029,_0xd489f1){return _0x49b029&&_0x158702(_0x49b029)?_0x49b029['attribs'][_0xd489f1]:null;}function Cs(_0x481b0e,_0x29305f,_0x190396){_0x158702(_0x481b0e)&&(null===_0x190396?delete _0x481b0e['attribs'][_0x29305f]:_0x481b0e['attribs'][_0x29305f]=_0x190396);}function ws(_0xaa6a8,_0x4810e8,_0x212b88){const _0x51f063=_0x4810e8['cloneNode'](!0x0);'beforebegin'===_0x212b88?_0x5c4e1e(_0xaa6a8,_0x51f063):'afterbegin'===_0x212b88?_0x4128f7(_0xaa6a8,_0x51f063):'beforeend'===_0x212b88?_0x35b472(_0xaa6a8,_0x51f063):'afterend'===_0x212b88&&_0x104e4c(_0xaa6a8,_0x51f063);}function fs(_0x29ffd6){const _0x4d43b8=[];let _0x2ceaac=_0x29ffd6;for(;_0x2ceaac;)_0x2ceaac=_0x4b4520(_0x2ceaac),_0x2ceaac&&_0x4d43b8['push'](_0x2ceaac);return _0x4d43b8;}function Ss(_0x130099){return _0x130099['replace'](/^\s+/gm,'')['replace'](/\s+$/gm,'')['replace'](/\n*/g,'')['replace'](/\s+/g,'\x20')['replace'](/>\s*</g,'><');}function bs(_0x5ca8cc){let _0xb15fe4=0x0;for(;_0x5ca8cc['parentNode'];)_0x5ca8cc=_0x5ca8cc['parentNode'],_0xb15fe4++;return _0xb15fe4;}function Rs(_0x24ce79){const _0x154d5d=[];let _0x48f8db=_0x24ce79['nextSibling'];for(;_0x48f8db;)_0x154d5d['push'](_0x48f8db),_0x48f8db=_0x48f8db['nextSibling'];_0x154d5d['forEach'](_0x151f47=>{_0x4a6be4(_0x151f47);});}class Os extends/* #__PURE__ -- @preserve */
25
+ ct(){['_m2html'];constructor(){super();const _0x581726=Object['entries'](_0x13b68e),_0x202bb9=_0x581726['findIndex'](([_0x5b9c52])=>'rehypeDomRaw'===_0x5b9c52);if(-0x1===_0x202bb9)throw new ht('ai-response-parser-unable-to-set-up-parser');_0x581726['splice'](_0x202bb9+0x1,0x0,['rehypeSanitize',_0x29d3ed]),this['_m2html']=new _0x64e73e({'plugins':Object['fromEntries'](_0x581726)});}['convertMarkdownToHTML'](_0xfaa6cc){const _0x28a389=this['_m2html']['parse'](_0xfaa6cc);return this['parseAndNormalizeHTML'](_0x28a389);}['parseAndNormalizeHTML'](_0x243c5b){return this['_parseHTML'](_0x243c5b);}['_parseHTML'](_0x1d314b){const _0x4a6724=Is('<dummy>'+_0x1d314b['replace'](/^\t+/gm,'\x20')['replace'](/\n*/g,'')['replace'](/\s+/g,'\x20')['replace'](/<[^>]*?$/g,'')+'</dummy>');return _0x4a6724['children']=_0x4a6724['children'][0x0]['children'],_0x4a6724;}}class ks extends/* #__PURE__ -- @preserve */
26
+ ct(){['_generateUid'];['_touchedNodesState']={'newIds':[],'modifiedIds':[],'removedIds':[],'invalidIds':[],'lastTouchedId':null};['_existingDataIds']=new Set();constructor(_0x2fef99){super(),this['_generateUid']=_0x2fef99||ot;}['merge'](_0xee46c4,_0x77605a,_0xf64e2){const _0x391ad3=_0xee46c4['cloneNode'](!0x0);if(0x0===_0x77605a['childNodes']['length']){const _0x12b366=[];return Ts('data-id','new-element',_0x391ad3)['forEach'](_0x39ff82=>{const _0x35f742=this['_generateUid']();Cs(_0x39ff82,'data-id',_0x35f742),_0x12b366['push'](_0x35f742);}),this['_removeSpecialComments'](_0x391ad3),{'parsedContent':_0x391ad3,'newNodeIds':_0x12b366,'modifiedNodeIds':[],'removedNodeIds':[]};}_0xf64e2&&_0xf64e2['markUnstableElements']&&this['_markLastTagElementUnstable'](_0x391ad3),this['_touchedNodesState']['newIds']=[],this['_touchedNodesState']['modifiedIds']=[],this['_touchedNodesState']['removedIds']=[],this['_touchedNodesState']['invalidIds']=[],this['_touchedNodesState']['lastTouchedId']=null,this['_existingDataIds']=new Set(Ts('data-id',null,_0x77605a)['map'](_0x24c9de=>ms(_0x24c9de,'data-id'))['filter'](_0x5243ba=>!!_0x5243ba));let _0x1934c4=-0x1,_0x45d8da=!0x1;const _0x5bb453=_0x391ad3['childNodes'],_0x5f3760=Array['from'](_0x5bb453)['filter'](_0x248e3e=>!(0x3===_0x248e3e['nodeType']&&''===Es(_0x248e3e)['trim']())),_0x2f0345=_0x5f3760['length'];for(let _0x442834=0x0;_0x442834<_0x2f0345;_0x442834++){const _0x54346f=_0x5f3760[_0x442834],_0x50710b=_0x5f3760[_0x442834+0x1];if(this['_isNewNode'](_0x54346f)){if(-0x1===_0x1934c4&&(_0x1934c4=_0x442834),this['_markWrappedElements'](_0x54346f),!this['_isNewNode'](_0x50710b)){const [_0x11f785,_0x4c38dd]=this['_findReferenceNode'](_0x54346f,_0x45d8da,_0x77605a);if(_0x11f785){const _0x13634a=Array['from'](_0x5f3760)['slice'](_0x1934c4,_0x442834+0x1);this['_insertNodes'](_0x11f785,_0x13634a,_0x4c38dd),_0x1934c4=-0x1;}}}else{if(this['_isExistingContentComment'](_0x54346f))_0x45d8da=!0x0;else{if(this['_isExistingNode'](_0x54346f)){const _0x50cf44=ms(_0x54346f,'data-id');if(_0x50cf44&&this['_existingDataIds']['has'](_0x50cf44)){const _0x555f2f=ps('data-id',_0x50cf44,_0x77605a);this['_replaceNode'](_0x555f2f,_0x54346f);}if(this['_touchedNodesState']['removedIds']['includes'](_0x50cf44)){const _0x591460=this['_touchedNodesState']['removedIds']['indexOf'](_0x50cf44);this['_touchedNodesState']['removedIds']['splice'](_0x591460,0x1);}}else{if(this['_isDelNode'](_0x54346f)){const _0x34eb1f=ms(_0x54346f,'data-id');this['_touchedNodesState']['modifiedIds']['includes'](_0x34eb1f)||this['_storeDeletedElementIds'](_0x54346f);}}}}}for(const _0x9cba53 of this['_touchedNodesState']['removedIds']){const _0x5db615=ps('data-id',_0x9cba53,_0x77605a);if(_0x5db615){if(_0xf64e2&&_0xf64e2['replaceRemovedWith']){this['_touchedNodesState']['lastTouchedId']=_0x9cba53;const _0x1b5718=_0xf64e2['replaceRemovedWith']['cloneNode'](!0x0);Cs(_0x1b5718,'data-id',_0x9cba53),Cs(_0x1b5718,'data-removed','true'),_0x15065f(_0x5db615,_0x1b5718);}else _0x4a6be4(_0x5db615);}}if(Ts('data-wrapped-id',null,_0x77605a)['forEach'](_0x308755=>{const _0x207a7e=ps('data-id',ms(_0x308755,'data-wrapped-id'),_0x77605a);var _0xeca1ee,_0x3d7b0b;_0x207a7e&&(_0x3d7b0b=_0x308755,_0x4a6be4(_0xeca1ee=_0x207a7e),_0x15065f(_0x3d7b0b,_0xeca1ee));}),Ts('data-id','new-element',_0x77605a)['forEach'](_0x3fd157=>{const _0x58659b=this['_getUid'](_0x3fd157);Cs(_0x3fd157,'data-id',_0x58659b),this['_touchedNodesState']['newIds']['push'](_0x58659b);}),this['_removeSpecialComments'](_0x77605a),_0xf64e2&&_0xf64e2['markUnstableElements']&&this['_markUnstableElements'](_0x77605a,_0xf64e2['markUnstableElementsDepth']||0x0),_0xf64e2&&_0xf64e2['cutAfterLastChange']&&this['_touchedNodesState']['lastTouchedId']){let _0x3f1480=ps('data-id',this['_touchedNodesState']['lastTouchedId'],_0x77605a);for(;_0x3f1480;)Rs(_0x3f1480),_0x3f1480=_0x3f1480['parentNode'];}return{'parsedContent':_0x77605a,'newNodeIds':this['_touchedNodesState']['newIds'],'modifiedNodeIds':this['_touchedNodesState']['modifiedIds'],'removedNodeIds':this['_touchedNodesState']['removedIds']};}['_insertNodes'](_0x520af8,_0x91cc78,_0x14519a){for(const _0x5c22c0 of _0x91cc78){const _0x7d0e99=this['_getUid'](_0x5c22c0);Cs(_0x5c22c0,'data-id',_0x7d0e99),this['_touchedNodesState']['newIds']['push'](_0x7d0e99),this['_touchedNodesState']['lastTouchedId']=_0x7d0e99;}const _0x3456c6='afterbegin'===_0x14519a||'afterend'===_0x14519a?_0x91cc78['reverse']():_0x91cc78;for(const _0xbc85bf of _0x3456c6)ws(_0x520af8,_0xbc85bf,_0x14519a);}['_replaceNode'](_0xf1a08,_0x31689f){if(!_0xf1a08)return;if(_0x50dc79=_0x31689f,Ss(Es(_0xf1a08))===Ss(Es(_0x50dc79)))return;var _0x50dc79;const _0x286679=this['_getUid'](_0xf1a08);Cs(_0x31689f,'data-id',_0x286679),this['_touchedNodesState']['modifiedIds']['push'](_0x286679),this['_touchedNodesState']['lastTouchedId']=_0x286679,_0x15065f(_0xf1a08,_0x31689f['cloneNode'](!0x0));}['_findReferenceNode'](_0x54bb4c,_0x4308ce,_0x6772ac){const _0x1bd82a=this['_findPrevElementWithDataId'](_0x54bb4c,!0x1);if(_0x1bd82a){const _0xbbfcd0=this['_getNodeDataId'](_0x1bd82a),_0x438d4f=ps('data-id',_0xbbfcd0,_0x6772ac);if(_0x438d4f)return[_0x438d4f,'afterend'];this['_touchedNodesState']['invalidIds']['push'](_0xbbfcd0);}const _0x4111b4=this['_findNextElementWithDataId'](_0x54bb4c,!0x1);if(_0x4111b4){const _0x442cfe=this['_getNodeDataId'](_0x4111b4),_0xbb2915=ps('data-id',_0x442cfe,_0x6772ac);if(_0xbb2915)return[_0xbb2915,'beforebegin'];this['_touchedNodesState']['invalidIds']['push'](_0x442cfe);}return _0x4308ce?_0x54bb4c['nextSibling']?this['_findFallbackReferenceNode'](_0x54bb4c,_0x6772ac):[_0x6772ac['childNodes'][_0x6772ac['childNodes']['length']-0x1],'afterend']:[_0x6772ac['childNodes'][0x0],'beforebegin'];}['_findFallbackReferenceNode'](_0x9022df,_0x4e298d){const _0x4ca36b=[],_0x58fb75=this['_findPrevElementWithDataId'](_0x9022df,!0x0);if(_0x58fb75){const _0x1f8fd7=ps('data-id',this['_getNodeDataId'](_0x58fb75),_0x4e298d);_0x1f8fd7&&_0x4ca36b['push']([_0x1f8fd7,'afterend']);}const _0x416c8e=this['_findNextElementWithDataId'](_0x9022df,!0x0);if(_0x416c8e){const _0x5d04f9=ps('data-id',this['_getNodeDataId'](_0x416c8e),_0x4e298d);_0x5d04f9&&_0x4ca36b['push']([_0x5d04f9,'beforebegin']);}if(_0x4ca36b['length']>0x1)return bs(_0x4ca36b[0x0][0x0])<=bs(_0x4ca36b[0x1][0x0])?_0x4ca36b[0x0]:_0x4ca36b[0x1];return 0x1===_0x4ca36b['length']?_0x4ca36b[0x0]:[_0x4e298d['lastChild'],'afterend'];}['_findNextElementWithDataId'](_0x21d240,_0x58d2b9){let _0x38033a=_0x21d240['nextSibling'],_0x5da321=null,_0x4b44dd=!0x1;for(;_0x38033a;){if(_0x6c1ccb(_0x38033a)){if(this['_isDelNode'](_0x38033a)&&(_0x5da321=_0x38033a),this['_isExistingContentComment'](_0x38033a)&&_0x58d2b9&&!_0x4b44dd){_0x4b44dd=!0x0,_0x38033a=_0x38033a['nextSibling'];continue;}break;}const _0x4ea00e=ms(_0x38033a,'data-id');if(_0x4ea00e&&'new-element'!==_0x4ea00e&&this['_existingDataIds']['has'](_0x4ea00e)){_0x5da321=_0x38033a;break;}_0x38033a=_0x38033a['nextSibling'];}return _0x5da321;}['_findPrevElementWithDataId'](_0x39baf9,_0xf1c883){let _0x40c90c=_0x39baf9['previousSibling'],_0x3e897e=null,_0x4dafdd=!0x1;for(;_0x40c90c;){if(_0x6c1ccb(_0x40c90c)){if(this['_isDelNode'](_0x40c90c)&&(_0x3e897e=_0x40c90c),this['_isExistingContentComment'](_0x40c90c)&&_0xf1c883&&!_0x4dafdd){_0x4dafdd=!0x0,_0x40c90c=_0x40c90c['previousSibling'];continue;}break;}const _0x3ecfc8=ms(_0x40c90c,'data-id');if(_0x3ecfc8&&'new-element'!==_0x3ecfc8&&this['_existingDataIds']['has'](_0x3ecfc8)){_0x3e897e=_0x40c90c;break;}_0x40c90c=_0x40c90c['previousSibling'];}return _0x3e897e;}['_markWrappedElements'](_0x42eaa0){_0x158702(_0x42eaa0)&&Ts('data-id',null,_0x42eaa0)['forEach'](_0x3abab5=>{this['_isExistingNode'](_0x3abab5)&&!this['_hasWrappedParent'](_0x3abab5)&&(Cs(_0x3abab5,'data-wrapped-id',ms(_0x3abab5,'data-id')),Cs(_0x3abab5,'data-id',null));});}['_getNodeDataId'](_0x46084){if(!_0x46084)return null;if(_0x158702(_0x46084))return ms(_0x46084,'data-id');if(_0x6c1ccb(_0x46084)){const _0x59bf93=Es(_0x46084)['match'](/removed[\s*-]data-id="([^"]+)"/);if(_0x59bf93&&_0x59bf93[0x1])return _0x59bf93[0x1];}return null;}['_storeDeletedElementIds'](_0x1d75bf){if(_0x6c1ccb(_0x1d75bf)){const _0x36064a=Es(_0x1d75bf)['match'](/removed[\s*-]data-id="([^"]+)"/);_0x36064a&&_0x36064a[0x1]&&this['_touchedNodesState']['removedIds']['push'](_0x36064a[0x1]);}}['_getUid'](_0x359bd8){return this['_isExistingNode'](_0x359bd8)?ms(_0x359bd8,'data-id'):this['_generateUid']();}['_removeSpecialComments'](_0x4d06ec){(function(_0x870782){return _0x23ffc2(_0x529a61=>_0x6c1ccb(_0x529a61),_0x870782,!0x0,0x1/0x0);}(_0x4d06ec)['filter'](_0x3d4127=>this['_isDelNode'](_0x3d4127)||this['_isExistingContentComment'](_0x3d4127))['forEach'](_0x28836=>{_0x4a6be4(_0x28836);}));}['_markLastTagElementUnstable'](_0x56af95){const _0x41bc65=_0x56af95['childNodes'],_0x2e4bde=_0x41bc65[_0x41bc65['length']-0x1];_0x2e4bde&&_0x158702(_0x2e4bde)&&Cs(_0x2e4bde,'data-unstable','true');}['_markUnstableElements'](_0x14e2f5,_0x44ac8a){const _0x146fc0=ps('data-unstable','true',_0x14e2f5);if(!_0x146fc0)return;const _0x2027b7=fs(_0x146fc0)['slice'](0x0,-0x1),_0x38ef4b=_0x2027b7['length'];let _0x299fff=_0x146fc0;if(_0x38ef4b>_0x44ac8a){let _0x27ddd7=_0x38ef4b,_0x369771=null;for(;_0x27ddd7>_0x44ac8a&&_0x27ddd7>=0x0;)_0x27ddd7--,_0x369771=_0x2027b7[_0x27ddd7];_0x369771&&(_0x299fff=_0x369771,Cs(_0x146fc0,'data-unstable',null),Cs(_0x369771,'data-unstable','true'));}else{if(_0x38ef4b<_0x44ac8a){let _0x482c5a=_0x38ef4b,_0x2bae29=_0x146fc0;for(;_0x482c5a<_0x44ac8a;){const _0x304645=_0x2bae29['childNodes']['filter'](_0x4dc64e=>_0x158702(_0x4dc64e));if(0x0===_0x304645['length'])break;_0x482c5a++,_0x2bae29=_0x304645[_0x304645['length']-0x1];}_0x2bae29&&(_0x299fff=_0x2bae29,Cs(_0x146fc0,'data-unstable',null),Cs(_0x2bae29,'data-unstable','true'));}}let _0x3029d0=_0x299fff;for(;_0x3029d0;){for(;_0x3029d0['nextSibling'];)_0x3029d0=_0x3029d0['nextSibling'],_0x158702(_0x3029d0)&&Cs(_0x3029d0,'data-unstable','true');_0x3029d0=_0x3029d0['parentNode'];}}['_isNewNode'](_0x4bfe01){return Boolean('new-element'===ms(_0x4bfe01,'data-id'));}['_isExistingNode'](_0x381fdd){return Boolean((ms(_0x381fdd,'data-id')||'')['length']>0x0&&'new-element'!==ms(_0x381fdd,'data-id'));}['_isDelNode'](_0x58ca34){return!!_0x58ca34&&Boolean(_0x6c1ccb(_0x58ca34)&&Es(_0x58ca34)['match'](/removed[\s*-]data-id="[^"]+"/));}['_hasWrappedParent'](_0x59f513){let _0x78c216=_0x59f513['parentNode'];for(;_0x78c216;){if(ms(_0x78c216,'data-wrapped-id'))return!0x0;_0x78c216=_0x78c216['parentNode'];}return!0x1;}['_isExistingContentComment'](_0x359371){return Boolean(_0x6c1ccb(_0x359371)&&Es(_0x359371)['match'](/\s*existing[\s*-](content|document)\s*/g));}}function Ns({editor:_0x46d75a,changeGroups:_0x5893f0,documentContextContent:_0x4056f6,showDiff:_0x5cfe24,trimUnchanged:_0x46d55e=!0x0}){return _0x5893f0['map'](_0x3bc60f=>{const _0xda7da5=new _0x3c6c04([]),_0x440139=new _0x3c6c04([]);for(const _0x3a5224 of _0x3bc60f['changes'])if(_0x5cfe24&&'removed'==_0x3a5224['type']||_0x440139['children']['push'](_0x3a5224['node']['cloneNode'](!0x0)),'new'!=_0x3a5224['type']&&(_0x5cfe24||'removed'!=_0x3a5224['type'])){const _0x3532f1=_0x5b0b3c(_0x57f741=>ms(_0x57f741,'data-id')==_0x3a5224['id'],_0x4056f6,!0x0);_0x3532f1&&_0xda7da5['children']['push'](_0x3532f1['cloneNode'](!0x0));}const {content:_0x362833,hasChanges:_0xbac44}=function(_0x4e7320,_0x38267c,_0x52e182,_0x31fb0f,_0x4cda04=!0x0){const _0x48dfab=_0x4e7320['plugins']['get']('DocumentCompare'),_0x59e0fc=Es(_0x38267c),_0x2f9b4b=Es(_0x52e182),_0x7d88c5=_0x4e7320['data']['parse'](_0x59e0fc,'$root'),_0x4ae266=_0x4e7320['model']['createPositionAt'](_0x7d88c5,0x0),_0x58c28e=_0x48dfab['getDiff'](_0x59e0fc,_0x2f9b4b,{'anchor':_0x4ae266,'markDeletions':_0x31fb0f}),_0x5168a8=_0x58c28e['getOperations']();if(0x0==_0x5168a8['length'])return{'content':_0x38267c['cloneNode'](!0x0),'hasChanges':!0x1};_0x31fb0f?function(_0x575692,_0x2c502a,_0x4d39cc){if(0x0==_0x575692['length'])return;const _0x44da87=_0x4d39cc['plugins']['get']('DocumentCompare'),_0x3b03b6=_0x4d39cc['plugins']['get']('SuggestionsConversion');_0x4d39cc['model']['change'](_0x505497=>{const _0x2c9bf7=new Set();for(let _0xa099b1=0x0;_0xa099b1<_0x575692['length'];_0xa099b1++){const _0x1bf213=_0x575692[_0xa099b1];if(_0x1bf213['baseVersion']=null,_0x1bf213['isDocumentOperation']=!0x1,_0x44da87['isMarkedRemoveOperation'](_0x1bf213)){const _0x466e3a=_0x1cd318(_0x1bf213['newRange'],_0x4d39cc['model']),_0x2051e4='suggestion:deletion:'+ot()+':$aiSuggestion';_0x2c502a['markers']['set'](_0x2051e4,_0x466e3a);}else switch(_0x1bf213['type']){case'rename':{if(_0x1bf213['oldName']==_0x1bf213['newName'])break;_0x505497['batch']['addOperation'](_0x1bf213),_0x4d39cc['model']['applyOperation'](_0x1bf213);const _0x26b4f1='$elementName',_0x32e843=_0x1bf213['position'],_0xc95405=_0x4d39cc['model']['createRange'](_0x32e843,_0x4d39cc['model']['createPositionAt'](_0x32e843['nodeAfter'],'end')),_0x3de133='suggestion:attribute:'+_0x26b4f1+':'+ot()+':$aiSuggestion';_0x2c502a['markers']['set'](_0x3de133,_0xc95405);break;}case'addAttribute':case'removeAttribute':case'changeAttribute':{if(_0x1bf213['oldValue']==_0x1bf213['newValue'])break;_0x505497['batch']['addOperation'](_0x1bf213),_0x4d39cc['model']['applyOperation'](_0x1bf213);const _0x2b9e55=_0x1bf213['key'];if(!_0x3b03b6['isRegisteredAttribute'](_0x2b9e55))break;const _0x42d5a0=_0x1cd318(_0x1bf213['range'],_0x4d39cc['model']),_0x50d9ec='suggestion:attribute:'+_0x2b9e55+':'+ot()+':$aiSuggestion';_0x2c502a['markers']['set'](_0x50d9ec,_0x42d5a0);break;}case'insert':{_0x505497['batch']['addOperation'](_0x1bf213),_0x4d39cc['model']['applyOperation'](_0x1bf213);if(_0x575692[_0xa099b1+0x1]&&'move'==_0x575692[_0xa099b1+0x1]['type']){vs(_0x2c502a,_0x1bf213);break;}const _0x5efe03=_0x1bf213['position'],_0x3b22a4=_0x1bf213['howMany'],_0x230f17=_0x1cd318(_0x4d39cc['model']['createRange'](_0x5efe03,_0x5efe03['getShiftedBy'](_0x3b22a4)),_0x4d39cc['model']),_0x2e23c6='suggestion:insertion:'+ot()+':$aiSuggestion';_0x2c502a['markers']['set'](_0x2e23c6,_0x230f17);break;}case'split':{_0x505497['batch']['addOperation'](_0x1bf213),_0x4d39cc['model']['applyOperation'](_0x1bf213);const _0x52a47a=_0x1bf213['splitPosition'],_0x478230=_0x1bf213['moveTargetPosition'],_0xe2066f=_0x4d39cc['model']['createRange'](_0x52a47a,_0x478230),_0x5d01cc='suggestion:insertion:'+ot()+':$aiSuggestion';_0x2c502a['markers']['set'](_0x5d01cc,_0xe2066f);break;}case'move':{_0x505497['batch']['addOperation'](_0x1bf213),_0x4d39cc['model']['applyOperation'](_0x1bf213),_0x575692[_0xa099b1-0x1]&&'insert'==_0x575692[_0xa099b1-0x1]['type']&&vs(_0x2c502a,_0x1bf213);const _0x27902f=_0x1bf213['getMovedRangeStart'](),_0x3e39c2=_0x1bf213['howMany'];for(let _0x531254=0x0;_0x531254<_0x3e39c2;_0x531254++){const _0x4ff81a=_0x27902f['getShiftedBy'](_0x531254)['nodeAfter'];_0x2c9bf7['add'](_0x4ff81a);}break;}case'remove':{const _0x4e1f60=_0x1bf213['sourcePosition'],_0x1d0247=_0x1bf213['howMany'],_0x49e86a=new _0x285dd6(_0x4e1f60,_0x1d0247);_0x505497['batch']['addOperation'](_0x49e86a),_0x4d39cc['model']['applyOperation'](_0x49e86a);break;}}}for(const _0x4f8519 of _0x2c9bf7){const _0xac8ce7=_0x4d39cc['model']['createRangeOn'](_0x4f8519),_0xc0dc4a='suggestion:formatBlock:$fakeWrap:'+ot()+':$aiSuggestion';_0x2c502a['markers']['set'](_0xc0dc4a,_0x1cd318(_0xac8ce7,_0x4d39cc['model']));}});}(_0x5168a8,_0x7d88c5,_0x4e7320):_0x4e7320['model']['change'](_0x3dfd4=>{for(const _0xc9a543 of _0x5168a8)if('remove'==_0xc9a543['type']){const _0x41e072=_0xc9a543['sourcePosition'],_0x5598c4=_0xc9a543['howMany'],_0x522e4c=new _0x285dd6(_0x41e072,_0x5598c4);_0x3dfd4['batch']['addOperation'](_0x522e4c),_0x4e7320['model']['applyOperation'](_0x522e4c);}else{if('marker'==_0xc9a543['type']){const _0x1da248=_0xc9a543['name'],_0x445ed1=_0xc9a543['newRange'];null!==_0x445ed1?_0x7d88c5['markers']['set'](_0x1da248,_0x445ed1):_0x7d88c5['markers']['delete'](_0x1da248);}else _0xc9a543['baseVersion']=null,_0xc9a543['isDocumentOperation']=!0x1,_0x3dfd4['batch']['addOperation'](_0xc9a543),_0x4e7320['model']['applyOperation'](_0xc9a543);}});if(_0x4cda04){const _0x2dbc28=ys(_0x4e7320,_0x5168a8,_0x7d88c5);xs(_0x4e7320['model'],_0x2dbc28),function(_0x3fa479,_0x3a3f20){const _0x2397f3=_0x3a3f20['getFirstRange']()['start'];let _0x265f44=_0x3a3f20['getFirstRange']()['end'];const _0x5e9013=_0x2397f3['root'];(_0x265f44['textNode']||_0x265f44['nodeAfter']&&_0x265f44['nodeAfter']['is']('$text'))&&(_0x358c66(_0x265f44,'...'),_0x265f44=_0x265f44['getShiftedBy'](0x3)),(_0x2397f3['textNode']||_0x2397f3['nodeBefore']&&_0x2397f3['nodeBefore']['is']('$text'))&&(_0x358c66(_0x2397f3,'...'),function(_0xe7757d,_0x5a3b9f,_0x1a6e9c){for(let [_0x58e661,_0x38a6cd]of _0xe7757d['markers']){const _0xd65bec=_0x38a6cd['_getTransformedByInsertion'](_0x5a3b9f,_0x1a6e9c,!0x1);_0x38a6cd=_0xd65bec[0x0],_0xe7757d['markers']['set'](_0x58e661,_0x38a6cd);}}(_0x5e9013,_0x2397f3,0x3),_0x2397f3['parent']==_0x265f44['parent']&&(_0x265f44=_0x265f44['getShiftedBy'](0x3)));const _0x2f26fa=_0x3fa479['createRange'](_0x3fa479['createPositionAt'](_0x5e9013,0x0),_0x2397f3),_0x482ca9=_0x3fa479['createRange'](_0x265f44,_0x3fa479['createPositionAt'](_0x5e9013,'end')),_0x46f7c7=[..._0x2f26fa['getMinimalFlatRanges'](),..._0x482ca9['getMinimalFlatRanges']()];_0x46f7c7['reverse']();for(const _0x3a0799 of _0x46f7c7)_0x3acfdc(_0x3a0799),Ds(_0x5e9013,_0x3a0799);}(_0x4e7320['model'],_0x2dbc28);}const _0x3221f5=_0x4e7320['data']['stringify'](_0x7d88c5,{'showSuggestionHighlights':!0x0});return{'content':Is(_0x3221f5),'hasChanges':!0x0};}(_0x46d75a,_0xda7da5,_0x440139,_0x5cfe24,_0x46d55e);return{'type':_0x3bc60f['changes'][0x0]['type'],'index':_0x3bc60f['index'],'content':_0x362833,'hasChanges':_0xbac44};});}function vs(_0x4c8600,_0x1459ae){for(const [_0x4e04cf,_0x1e3bc3]of _0x4c8600['markers']){const _0x17eb05=_0x3b0db7['_createFromRanges'](_0x1e3bc3['getTransformedByOperation'](_0x1459ae));_0x4c8600['markers']['set'](_0x4e04cf,_0x17eb05);}}function ys(_0x48dab1,_0x45b8f0,_0x501142){const _0xea8d2d=_0x48dab1['plugins']['get']('DocumentCompare');let _0x4c4e59=_0x48dab1['model']['createPositionAt'](_0x501142,Number['POSITIVE_INFINITY']),_0x3ddb9d=_0x48dab1['model']['createPositionAt'](_0x501142,0x0);for(const _0x49d498 of _0x45b8f0){let _0x45528,_0x2f64e7;if(_0xea8d2d['isMarkedRemoveOperation'](_0x49d498))_0x45528=_0x49d498['newRange']['start'],_0x2f64e7=_0x49d498['newRange']['end'];else switch(_0x4c4e59=_0x4c4e59['getTransformedByOperation'](_0x49d498),_0x3ddb9d=_0x3ddb9d['getTransformedByOperation'](_0x49d498),_0x49d498['type']){case'rename':_0x45528=_0x49d498['position'],_0x2f64e7=_0x45528['getShiftedBy'](0x1);break;case'addAttribute':case'removeAttribute':case'changeAttribute':_0x45528=_0x49d498['range']['start'],_0x2f64e7=_0x49d498['range']['end'];break;case'insert':_0x45528=_0x49d498['position'],_0x2f64e7=_0x45528['getShiftedBy'](_0x49d498['howMany']);break;case'split':_0x45528=_0x49d498['splitPosition'],_0x2f64e7=_0x49d498['moveTargetPosition'];break;case'merge':{const _0x28696d=_0x49d498['targetPosition']['path']['slice'](0x0,-0x1);_0x45528=_0x48dab1['model']['createPositionFromPath'](_0x501142,_0x28696d),_0x2f64e7=_0x45528['getShiftedBy'](0x1);break;}case'remove':{const _0x2acfc3=_0x49d498['howMany'],_0x290fa3=_0x49d498['sourcePosition']['_getTransformedByInsertion'](_0x49d498['targetPosition'],_0x2acfc3),_0x4a462b=_0x49d498['getMovedRangeStart']();'remove'==_0x49d498['type']?(_0x45528=_0x290fa3,_0x2f64e7=_0x290fa3):(_0x45528=_0x4a462b,_0x2f64e7=_0x4a462b['getShiftedBy'](_0x2acfc3));break;}}_0x45528&&_0x45528['isBefore'](_0x4c4e59)&&(_0x4c4e59=_0x45528['clone'](),_0x4c4e59['stickiness']='toNone'),_0x2f64e7&&_0x2f64e7['isAfter'](_0x3ddb9d)&&(_0x3ddb9d=_0x2f64e7['clone'](),_0x3ddb9d['stickiness']='toNone');}return _0x48dab1['model']['createSelection'](_0x48dab1['model']['createRange'](_0x4c4e59,_0x3ddb9d));}function xs(_0x5235cc,_0x103d14){Ls(_0x5235cc,_0x103d14,'forward');const _0x1404a2=_0x103d14['getFirstRange']();_0x103d14['setTo']([]),_0x103d14['setTo'](_0x1404a2,{'backward':!0x0}),Ls(_0x5235cc,_0x103d14,'backward');}function Ls(_0x348d46,_0x2d4201,_0x3f9f6d){let _0x51e1b2=0x14;for(;_0x51e1b2;){_0x348d46['modifySelection'](_0x2d4201,{'unit':'word','direction':_0x3f9f6d}),_0x51e1b2--;const _0x41a64e=_0x2d4201['focus']['forward'==_0x3f9f6d?'nodeBefore':'nodeAfter'];if(_0x41a64e&&_0x41a64e['is']('element')&&_0x348d46['schema']['isBlock'](_0x41a64e)&&_0x348d46['schema']['isObject'](_0x41a64e))break;}}function Ds(_0x517153,_0x5da9cb){for(const [_0x5de0f0,_0x4d24fb]of _0x517153['markers']){const _0x2631af=_0x4d24fb['_getTransformedByDeletion'](_0x5da9cb['start'],_0x5da9cb['end']['offset']-_0x5da9cb['start']['offset']);null!=_0x2631af?_0x517153['markers']['set'](_0x5de0f0,_0x2631af):_0x517153['markers']['delete'](_0x5de0f0);}}class Ps extends ct(){['id'];['interactionId'];['type'];['sources']=[];['parsedContent']=new _0x3c6c04([]);['parsedMergedContent']=new _0x3c6c04([]);['changeGroups']=[];['areActionsDisabled']=!0x1;['documentContextContent'];['aiResponseParser'];['aiResponseApplier'];['editor'];['cachedSuggestionContentParts']={'withDiff':[],'withoutDiff':[]};constructor({type:_0x16274d,content:_0xacbf31='',isDone:_0x24d604=!0x1,interactionId:_0x54b8de,areActionsDisabled:_0x2507e0,documentContextContent:_0x15d9b7,editor:_0x5e98e1,id:_0x27b2bc}){super(),this['id']=_0x27b2bc||ot(),this['interactionId']=_0x54b8de,this['type']=_0x16274d,this['areActionsDisabled']=!!_0x2507e0,this['editor']=_0x5e98e1,this['aiResponseParser']=new Os(),this['aiResponseApplier']=new ks(),this['documentContextContent']=Is(_0x15d9b7||''),this['set']('isDone',_0x24d604),this['on']('change:content',()=>{this['onContentChange']();}),this['set']('content',_0xacbf31);}['appendContent'](_0x5880f6){this['set']('content',this['content']+_0x5880f6);}['done'](){this['isDone']||(this['set']('isDone',!0x0),this['onContentChange']());}['destroy'](){this['stopListening']();}['setChangeGroupState'](_0x38db1f,_0x5151e6){this['changeGroups'][_0x38db1f]['state']=_0x5151e6,this['fire']('replyChangeGroupStateUpdated',{'reply':this,'index':_0x38db1f,'state':_0x5151e6});}['getContentParts']({showDiff:_0x24144f,groupIndex:_0x1a942e}){if(!this['editor'])throw new ht('ai-get-editor-from-context-no-editor',null,{'aiReply':this});const _0x372926=this['_getCachedContentParts'](_0x24144f,_0x1a942e);if(_0x372926)return _0x372926;let _0x36481c=[];if(void 0x0===_0x1a942e)_0x36481c=this['changeGroups'];else{const _0x221a19=this['changeGroups']['find'](({index:_0x1066ca})=>_0x1066ca===_0x1a942e);if(!_0x221a19)throw new ht('ai-reply-get-content-parts-group-not-found',null,{'aiReply':this,'groupIndex':_0x1a942e});_0x36481c=[_0x221a19];}const _0xfaefc2=Ns({'editor':this['editor'],'showDiff':_0x24144f,'changeGroups':_0x36481c,'documentContextContent':this['documentContextContent']});return this['_setCachedContentParts'](_0x24144f,_0xfaefc2),_0xfaefc2;}['_getCachedContentParts'](_0x111477,_0x578718){const _0x412000=_0x111477?'withDiff':'withoutDiff';if(!this['cachedSuggestionContentParts'][_0x412000]['length'])return null;const _0x147d12=this['cachedSuggestionContentParts'][_0x412000];if(void 0x0===_0x578718)return _0x147d12['length']>0x0&&_0x147d12['length']!==this['changeGroups']['length']?(this['_setCachedContentParts'](_0x111477,null),null):_0x13755d(_0x147d12);{const _0x2ee1a0=_0x147d12['find'](({index:_0x170669})=>_0x170669===_0x578718);if(_0x2ee1a0)return[_0x13755d(_0x2ee1a0)];}return null;}['_setCachedContentParts'](_0x396419,_0x3c7d64){const _0x866228=_0x396419?'withDiff':'withoutDiff';_0x3c7d64?_0x3c7d64['forEach'](_0x2b746a=>{const _0x2f14d4=this['cachedSuggestionContentParts'][_0x866228],_0xadbfaa=_0x2f14d4['find'](({index:_0x491a15})=>_0x491a15===_0x2b746a['index']);if(_0xadbfaa){const _0x38aef8=_0x2f14d4['indexOf'](_0xadbfaa);_0x2f14d4['splice'](_0x38aef8,0x1,_0x2b746a);}else _0x2f14d4['push'](_0x2b746a);}):this['cachedSuggestionContentParts'][_0x866228]['length']=0x0;}['onContentChange'](){if('modification'===this['type']){this['parsedContent']=this['aiResponseParser']['parseAndNormalizeHTML'](this['content']);const _0x592fb2=this['changeGroups'];this['updateChangeGroups']();const _0x5b89ec=this['_getDifferentChangeGroups'](_0x592fb2,this['changeGroups']);(_0x5b89ec['length']||this['isDone'])&&(this['fire']('replyContentUpdated',this,_0x5b89ec),this['cachedSuggestionContentParts']['withDiff']['length']=this['cachedSuggestionContentParts']['withoutDiff']['length']=0x0);}else this['parsedContent']=this['aiResponseParser']['convertMarkdownToHTML'](this['content']),this['fire']('replyContentUpdated',this);}['_getDifferentChangeGroups'](_0x40dbd8,_0x18d230){const _0x561fb2=[];for(const _0x2db043 of _0x18d230){const _0x3dd20d=_0x40dbd8[_0x2db043['index']];_0x3dd20d?_0x3dd20d['changes']['length']!==_0x2db043['changes']['length']?_0x561fb2['push'](_0x2db043):_0x3dd20d['changes']['forEach']((_0xeec17e,_0x2c16d4)=>{const _0x2a6527=_0x2db043['changes'][_0x2c16d4];_0xeec17e['id']!==_0x2a6527['id']&&_0x561fb2['push'](_0x2db043);}):_0x561fb2['push'](_0x2db043);}return _0x561fb2;}['updateChangeGroups'](){const _0x47df37=new _0x359756('p',{},[new _0x359756('span',{'style':'color:\x20#808080;\x20font-style:\x20italic'},[new _0x111ade(us(this['editor']['locale'],'AI_SUGGESTION_CONTENT_PART_REMOVED'))])]),_0x3c965f=this['aiResponseApplier']['merge'](this['parsedContent'],this['documentContextContent']['cloneNode'](!0x0),{'markUnstableElements':!this['isDone'],'replaceRemovedWith':_0x47df37,'cutAfterLastChange':!this['isDone']});if(!_0x3c965f['modifiedNodeIds']['length']&&!this['isDone'])return;this['parsedMergedContent']=_0x3c965f['parsedContent'];let _0x4255d8=[];if(_0x5bcee3(_0x32a4bb=>{const _0x2dfdaa=ms(_0x32a4bb,'data-id');if(!_0x2dfdaa||!_0x1e4280(_0x2dfdaa))return!0x1;const _0x3b1b2e=[_0x32a4bb,...fs(_0x32a4bb)]['at'](-0x2);if(_0x32a4bb!=_0x3b1b2e){const _0x545061=ms(_0x3b1b2e,'data-id');_0x1e4280(_0x545061)||(_0x4255d8['push']({'node':_0x3b1b2e,'id':_0x545061,'type':'modified'}),_0x3c965f['modifiedNodeIds']['push'](_0x545061));}else _0x3c965f['modifiedNodeIds']['includes'](_0x2dfdaa)?_0x4255d8['push']({'node':_0x32a4bb,'type':'modified','id':_0x2dfdaa}):_0x3c965f['newNodeIds']['includes'](_0x2dfdaa)?_0x4255d8['push']({'node':_0x32a4bb,'type':'new','id':_0x2dfdaa,'anchorId':ms(_0x32a4bb['previousSibling'],'data-id')}):_0x4255d8['push']({'node':_0x32a4bb,'type':'removed','id':_0x2dfdaa});return!0x0;},this['parsedMergedContent']),_0x4255d8=_0x4255d8['filter'](({node:_0x12b56})=>[...fs(_0x12b56),_0x12b56]['every'](_0x42a0c4=>!ms(_0x42a0c4,'data-unstable'))),0x0==_0x4255d8['length'])return;const _0x526d21=[[_0x4255d8[0x0]]];for(let _0x4f4460=0x1;_0x4f4460<_0x4255d8['length'];_0x4f4460++){const _0x1c8ba2=_0x526d21[_0x526d21['length']-0x1],_0x4d807b=_0x1c8ba2[_0x1c8ba2['length']-0x1];_0x4255d8[_0x4f4460]['node']['previousSibling']==_0x4d807b['node']&&'modified'!=_0x4255d8[_0x4f4460]['type']&&'modified'!=_0x4d807b['type']?_0x1c8ba2['push'](_0x4255d8[_0x4f4460]):_0x526d21['push']([_0x4255d8[_0x4f4460]]);}for(const _0x447e17 of _0x526d21){const _0x16d608=_0x447e17[0x0],_0x17a80a=_0x447e17[_0x447e17['length']-0x1],_0x2446ca=_0x4b4b43(_0x16d608['node']['previousSibling']);_0x2446ca&&_0x447e17['unshift'](_0x2446ca);const _0x1ae426=_0x4b4b43(_0x17a80a['node']['nextSibling']);_0x1ae426&&_0x447e17['push'](_0x1ae426);}function _0x1e4280(_0x5d0773){return _0x3c965f['modifiedNodeIds']['includes'](_0x5d0773)||_0x3c965f['newNodeIds']['includes'](_0x5d0773)||_0x3c965f['removedNodeIds']['includes'](_0x5d0773);}function _0x4b4b43(_0x2a7705){if(_0x2a7705&&ms(_0x2a7705,'data-id')&&!ms(_0x2a7705,'data-unstable')){const _0x35223e=ms(_0x2a7705,'data-id');if(!_0x1e4280(_0x35223e))return{'node':_0x2a7705,'type':'context','id':_0x35223e};}return null;}this['changeGroups']=_0x526d21['map']((_0x19e60a,_0x6a657c)=>({'changes':_0x19e60a,'state':'pending','index':_0x6a657c}));}}const Hs=['interactionCreated','interactionStarted','interactionStopped','interactionFinished','interactionDestroyed','replyCreated','replyContentUpdated','replyChangeGroupStateUpdated','setConversationTitle','webSearchStarted','webSearchFinished','reasoningStarted','reasoningFinished','toolDataReceived','error'];class Ms extends pt(){['id'];['replies']=[];['currentReply'];['messageId'];['actionCallId'];['currentRequest'];['connector'];['isStopped']=!0x1;['isDestroyed']=!0x1;['editor'];['_isReasoning']=!0x1;['_isWebSearching']=!0x1;constructor({connector:_0x3e303f,editor:_0x1a8de9}){super(),this['id']=ot(),this['connector']=_0x3e303f,this['isStopped']=!0x0,this['editor']=_0x1a8de9;}async['start'](){const _0x14dfb1=[];let _0x29271c,_0x396b33,_0x3b0846;this['isStopped']=!0x1;try{this['currentRequest']=await this['sendRequest'](),this['fire']('interactionStarted',this);const _0x4a816c=await this['currentRequest']['getStream']();for await(const _0x4db119 of _0x4a816c){if(this['isStopped'])return;if('error'==_0x4db119['event'])return void this['fire']('error',{'error':new ht('ai-chat-interaction-error',this)});switch(_0x4db119['event']){case'message-metadata':this['messageId']=_0x4db119['data']['messageId'];break;case'action-metadata':this['actionCallId']=_0x4db119['data']['callId'];break;case'conversation-title':this['setConversationTitle'](_0x4db119['data']['conversationTitle'],!0x0);break;case'source':_0x14dfb1['push'](_0x4db119['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'](),_0x29271c='modification-delta'==_0x4db119['event']?'modification':'text',_0x396b33='modification-delta'==_0x4db119['event']?_0x4db119['data']['id']:void 0x0,this['currentReply']&&this['currentReply']['type']!=_0x29271c&&(this['currentReply']['done'](),this['currentReply']=void 0x0),this['currentReply']||(this['currentReply']=this['createReply']({'type':_0x29271c,'interactionId':this['id'],'id':_0x396b33}),'modification'==_0x29271c&&(this['currentReply']['sources']=_0x14dfb1['splice'](0x0))),this['currentReply']['appendContent'](_0x4db119['data']['textDelta']);break;case'mcp-tool-result':_0x3b0846=JSON['parse'](_0x4db119['data']['result']),this['_handleToolResultData']({'toolName':_0x4db119['data']['toolName'],'data':_0x3b0846['data'],'attributes':_0x3b0846['attributes']});break;case'mcp-tool-notification':this['_handleToolNotificationData']({'toolName':_0x4db119['data']['toolName'],'data':_0x4db119['data']['data']});}}}finally{this['isStopped']||(this['currentReply']&&_0x14dfb1['length']>0x0&&(this['currentReply']['sources']=_0x14dfb1['splice'](0x0)),this['_finalizeInteraction'](),this['fire']('interactionFinished',this));}}['stop'](){this['isStopped']||(this['_finalizeInteraction'](),this['fire']('interactionStopped',this));}['getReply'](_0x4c1517){return this['replies']['find'](_0x48deef=>_0x48deef['id']===_0x4c1517);}['destroy'](){this['isDestroyed']||(this['stop'](),this['replies']['forEach'](_0xa093b5=>_0xa093b5['destroy']()),this['replies']=[],this['isDestroyed']=!0x0,this['fire']('interactionDestroyed',this),this['stopListening']());}['createReply'](_0x8a8068){const _0x45d8f4=new Ps({'editor':this['editor'],'documentContextContent':this['getDocumentContext']()?.['content'],..._0x8a8068});return this['replies']['push'](_0x45d8f4),_0x45d8f4['delegate'](...Hs)['to'](this),this['fire']('replyCreated',_0x45d8f4),_0x45d8f4;}['setConversationTitle'](_0x33f246,_0x4d8f65=!0x1){this['fire']('setConversationTitle',_0x33f246,_0x4d8f65);}['resetWebSearchState'](){this['_isWebSearching']&&(this['_isWebSearching']=!0x1,this['fire']('webSearchFinished',this));}['resetReasoningState'](){this['_isReasoning']&&(this['_isReasoning']=!0x1,this['fire']('reasoningFinished',this));}['_handleToolResultData'](_0x46060d){this['fire']('toolDataReceived',{'type':'result','toolName':_0x46060d['toolName'],'data':structuredClone(_0x46060d['data']||{}),'attributes':structuredClone(_0x46060d['attributes']||{})},this);}['_handleToolNotificationData'](_0x2befcf){this['fire']('toolDataReceived',{'type':'notification','toolName':_0x2befcf['toolName'],'data':structuredClone(_0x2befcf['data'])},this);}['_finalizeInteraction'](){this['isStopped']=!0x0,this['currentRequest']&&this['currentRequest']['abortController']['abort'](),this['currentReply']&&this['currentReply']['done'](),this['currentRequest']=this['currentReply']=void 0x0;}}var Us=function(_0x2663e1){return _0x2663e1['TOOL']='mcp-tool-context',_0x2663e1['FILE']='file',_0x2663e1['DOCUMENT']='document',_0x2663e1['URL']='web-resource',_0x2663e1['TEXT']='text',_0x2663e1['SELECTION']='selection',_0x2663e1;}({}),Vs=function(_0xd00a1d){return _0xd00a1d['TEXT']='text',_0xd00a1d['MARKDOWN']='markdown',_0xd00a1d['HTML']='html',_0xd00a1d;}({});const Bs=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']]),Gs=['contextItemAdded','contextItemRemoved','contextItemLoadingEnded','contextSent','error','addContextOptionsChanged','sourceResourcesLoaded','resourceStateChanged','uploadProgressChanged'];class Fs extends ct(){['_connector'];['_config'];['_ownerId'];constructor({connector:_0x471a2c,config:_0x304fce,ownerId:_0x13561a}){super(),this['_connector']=_0x471a2c,this['_config']=_0x304fce,this['_ownerId']=_0x13561a;}['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'](_0x3971bb){const _0x39da90=await this['_createContextItemFromContent'](_0x3971bb);return this['_addToConversationContextItem'](_0x39da90),'current-document'===_0x39da90['uiId']&&this['_toggleAddCurrentDocumentOptionVisibility'](),_0x39da90;}async['_createContextItemFromContent'](_0x499dbf){if(_0x499dbf['type']===Us['DOCUMENT']){const _0x3b1405=await this['_connector']['fetchDocument'](this['_ownerId'],_0x499dbf['id'])['getDocument']();return{'id':'current-document','uiId':'current-document','label':'Current\x20document','type':_0x499dbf['type'],'content':_0x3b1405['content'],'hidden':this['_conversationContextItems']['has']('current-document'),'version':_0x3b1405['attributes']?.['version'],'sessionId':_0x3b1405['attributes']?.['sessionId']};}if(_0x499dbf['type']===Us['TOOL'])return{'id':_0x499dbf['id'],'uiId':_0x499dbf['id'],'label':_0x499dbf['data']?.['label']||_0x499dbf['id'],'type':Us['TOOL'],'mcpServerName':_0x499dbf['mcpServerName'],'toolName':_0x499dbf['toolName'],'data':_0x499dbf['data']||{}};return{'id':_0x499dbf['id'],'uiId':_0x499dbf['id'],'label':_0x499dbf['attributes']?.['label']||_0x499dbf['name']||_0x499dbf['url']||_0x499dbf['id'],'type':_0x499dbf['type'],..._0x499dbf?.['attributes']?.['resourceId']?{'resourceId':_0x499dbf['attributes']?.['resourceId']}:{}};}['getSentContextItems'](){return new Map(this['_conversationContextItems']);}['removeFromContext'](_0x30f4d6){const _0x5948a0=this['_pendingContextItems']['get'](_0x30f4d6);_0x5948a0?.['isReadOnly']||this['_removeContextItem'](_0x30f4d6);}['clearPendingContextItems'](){if(0x0===this['_pendingContextItems']['size'])return;for(const _0x23c890 of this['_pendingContextItems']['values']())this['_removeContextItem'](_0x23c890['uiId']);const _0x38e03d=this['_conversationContextItems']['get']('current-document')||this['_pendingContextItems']['get']('current-document');_0x38e03d&&this['_addContextItem']({..._0x38e03d,'isReadOnly':!0x0,'hidden':!0x0});}['addToConversationContext'](_0x2b3657){for(const _0x2863fc of _0x2b3657['values']())this['_addToConversationContextItem'](_0x2863fc);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'](_0x5a768d){return Array['from'](_0x5a768d['values']())['map'](_0x350382=>this['_mapContextItemToRequestData'](_0x350382))['filter'](_0x56ee7a=>null!==_0x56ee7a);}async['addFilesToContext'](_0x577588,_0x180630,_0x1878c2=Us['FILE']){const _0x5befa3='files-'+ot();this['_startUploadOperation'](_0x5befa3);try{await Promise['all'](_0x577588['map'](async _0x26626b=>{const _0x33dca8='file-'+ot(),_0x25f72d=_0x24fbe9(_0x26626b['name']);try{this['_addContextItem']({'type':_0x1878c2,'label':_0x180630?.['label']||_0x25f72d,'uiId':_0x33dca8,'resourceId':_0x180630?.['resourceId']},!0x0);const _0x357c00=this['_connector']['uploadFile'](this['_ownerId'],_0x26626b,_0x180630);this['_ongoingUploads']['set'](_0x33dca8,_0x357c00['abortController']);const {id:_0x488ee3}=await _0x357c00['getId']();this['_ongoingUploads']['delete'](_0x33dca8),this['_finishContextItemLoading']({'type':_0x1878c2,'id':_0x488ee3,'label':_0x180630?.['label']||_0x25f72d,'uiId':_0x33dca8,'resourceId':_0x180630?.['resourceId']},!0x1);}catch(_0x8f6b2a){this['_ongoingUploads']['delete'](_0x33dca8);if(!(_0x8f6b2a instanceof ht&&_0x8f6b2a['message']['startsWith']('ai-request-aborted'))){const _0x237949=Bs['get'](_0x8f6b2a['code'])||'ai-chat-file-upload-failed',_0x3f833a=new ht(_0x237949,null,{'fileName':_0x25f72d,..._0x8f6b2a});_0x3f833a['stack']=_0x8f6b2a['stack'],this['fire']('error',{'error':_0x3f833a});}this['_removeContextItem'](_0x33dca8);}}));}finally{this['_finishUploadOperation'](_0x5befa3);}}['addCurrentDocumentToContext'](_0x379fcf){if(this['isCurrentDocumentInContext']()||!this['_addContextOptionsState']['document']['enabled'])return;const _0x14508f={'type':Us['DOCUMENT'],'uiId':'current-document','label':_0x379fcf,'isReadOnly':this['_conversationContextItems']['has']('current-document'),'hidden':this['_conversationContextItems']['has']('current-document')};this['_addContextItem'](_0x14508f);}async['updateCurrentDocument'](_0x42375a,_0x12246a,_0x466d63,_0x1e1de6){const _0x4d4c6a=this['_pendingContextItems']['get']('current-document');if(_0x4d4c6a&&_0x42375a){_0x4d4c6a['selection']=_0x1e1de6?_0x1e1de6['map'](_0x57ada7=>({'start':_0x57ada7['start'],'end':_0x57ada7['end']})):[];try{if(_0x4d4c6a['version']===_0x12246a)return;const {id:_0x1ced50}=await this['_connector']['uploadDocument'](this['_ownerId'],_0x42375a,{'version':_0x12246a,'sessionId':_0x466d63})['getId']();_0x4d4c6a['id']=_0x1ced50,_0x4d4c6a['content']=_0x42375a,_0x4d4c6a['version']=_0x12246a,_0x4d4c6a['sessionId']=_0x466d63;}catch(_0xed88ff){const _0x56b387=new ht('ai-chat-document-upload-failed',null);_0x56b387['stack']=_0xed88ff['stack'],this['fire']('error',{'error':_0x56b387});}}}['addSelectionToContext'](_0x28637f){this['_addContextItem']({'type':Us['SELECTION'],'label':_0x28637f,'uiId':'selection','content':_0x28637f});}['removeSelectionFromContext'](){this['_removeContextItem']('selection');}async['addUrlToContext'](_0x10f331,_0x3cf633){const _0x1bc188='url-'+ot();this['_startUploadOperation'](_0x1bc188);const _0x3c2023='url-'+ot();try{this['_addContextItem']({'type':Us['URL'],'label':_0x3cf633?.['label']||_0x10f331,'uiId':_0x3c2023,'resourceId':_0x3cf633?.['resourceId']},!0x0);const _0x14ecbc=this['_connector']['uploadUrl'](this['_ownerId'],_0x10f331,_0x3cf633);this['_ongoingUploads']['set'](_0x3c2023,_0x14ecbc['abortController']);const {id:_0x2b8937}=await _0x14ecbc['getId']();this['_ongoingUploads']['delete'](_0x3c2023),this['_finishContextItemLoading']({'type':Us['URL'],'id':_0x2b8937,'label':_0x3cf633?.['label']||_0x10f331,'uiId':_0x3c2023,'resourceId':_0x3cf633?.['resourceId']},!0x1);}catch(_0x591ab6){this['_ongoingUploads']['delete'](_0x3c2023),(_0x591ab6['message']['startsWith']('ai-request-aborted')||this['fire']('error',{'error':new ht('ai-chat-url-upload-failed',this,{'url':_0x10f331,'originalError':_0x591ab6}),'url':_0x10f331}),this['_removeContextItem'](_0x3c2023));}finally{this['_finishUploadOperation'](_0x1bc188);}}['addToolItemToContext'](_0x199290){_0x199290['id']=_0x199290['id']??ot()['substring'](0x0,0x15),this['_pendingContextItems']['set'](_0x199290['uiId'],_0x199290),this['fire']('contextItemAdded',{'contextItem':_0x199290,'isLoading':!0x1});}async['loadSourceResources'](_0x3aae6b,_0x43f657,_0x24cd3f){const _0x25b675=this['_addContextOptionsState']['sources']['find'](_0x3420aa=>_0x3420aa['id']===_0x3aae6b);if(!_0x25b675)return this['fire']('error',{'error':new ht('ai-chat-source-not-found',this,{'sourceId':_0x3aae6b}),'sourceId':_0x3aae6b}),[];try{const _0x438f31=(await _0x25b675['getResources'](_0x43f657))['map'](_0x3c4704=>{const _0x2ba271=this['_isResourceInContext'](_0x3c4704['id']);return{..._0x3c4704,'isInContext':_0x2ba271};});return _0x25b675['resources']=_0x438f31,this['fire']('sourceResourcesLoaded',{'sourceId':_0x3aae6b,'source':_0x25b675,'resources':_0x438f31,'uid':_0x24cd3f}),_0x438f31;}catch(_0x1a6a6b){return this['fire']('error',{'error':new ht('ai-chat-source-resources-load-failed',this,{'sourceId':_0x3aae6b,'originalError':_0x1a6a6b}),'sourceId':_0x3aae6b,'sourceLabel':_0x25b675['label']}),[];}}async['addResourceToContext'](_0x4085bf,_0x3a5e73){if(this['_isResourceInContext'](_0x3a5e73['id']))return;let _0x4bdc4a=_0x3a5e73['data'];if(!_0x4bdc4a&&_0x4085bf['getData'])try{_0x4bdc4a=await _0x4085bf['getData'](_0x3a5e73['id']);}catch(_0x456c93){return void this['fire']('error',{'error':new ht('ai-chat-resource-load-failed',this,{'resourceId':_0x3a5e73['id'],'sourceId':_0x4085bf['id'],'originalError':_0x456c93}),'resourceId':_0x3a5e73['id'],'sourceId':_0x4085bf['id']});}if(_0x4bdc4a)switch(_0x3a5e73['type']){case Us['URL']:if('string'!=typeof _0x4bdc4a)return void this['fire']('error',{'error':new ht('ai-chat-context-invalid-data',this,{'resourceId':_0x3a5e73['id'],'sourceId':_0x4085bf['id'],'expectedType':'string','actualType':typeof _0x4bdc4a}),'resourceId':_0x3a5e73['id'],'sourceId':_0x4085bf['id']});await this['addUrlToContext'](_0x4bdc4a,{'label':_0x3a5e73['label'],'resourceId':_0x3a5e73['id']});break;case Us['FILE']:if(!(_0x4bdc4a instanceof File))return void this['fire']('error',{'error':new ht('ai-chat-context-invalid-data',this,{'resourceId':_0x3a5e73['id'],'sourceId':_0x4085bf['id'],'expectedType':'File','actualType':typeof _0x4bdc4a}),'resourceId':_0x3a5e73['id'],'sourceId':_0x4085bf['id']});await this['addFilesToContext']([_0x4bdc4a],{'label':_0x3a5e73['label'],'resourceId':_0x3a5e73['id']});break;case Us['TEXT']:if('object'!=typeof _0x4bdc4a||!('content'in _0x4bdc4a)||!('type'in _0x4bdc4a))return void this['fire']('error',{'error':new ht('ai-chat-context-invalid-data',this,{'resourceId':_0x3a5e73['id'],'sourceId':_0x4085bf['id'],'expectedType':'object\x20with\x20content\x20and\x20type\x20properties','actualType':typeof _0x4bdc4a}),'resourceId':_0x3a5e73['id'],'sourceId':_0x4085bf['id']});_0x4bdc4a=Fs['_convertTextResourceToFile'](_0x4bdc4a,_0x3a5e73['label']),await this['addFilesToContext']([_0x4bdc4a],{'label':_0x3a5e73['label'],'resourceId':_0x3a5e73['id']},Us['TEXT']);break;case Us['TOOL']:break;default:this['fire']('error',{'error':new ht('ai-chat-context-unsupported-type',this,{'resourceId':_0x3a5e73['id'],'sourceId':_0x4085bf['id'],'resourceType':_0x3a5e73['type']}),'resourceId':_0x3a5e73['id'],'sourceId':_0x4085bf['id']});}else this['fire']('error',{'error':new ht('ai-chat-resource-no-data',this,{'resourceId':_0x3a5e73['id'],'sourceId':_0x4085bf['id']}),'resourceId':_0x3a5e73['id'],'sourceId':_0x4085bf['id']});}static['_convertTextResourceToFile'](_0x124b1a,_0x3225b5){switch(_0x124b1a['type']){case Vs['MARKDOWN']:return new File([_0x124b1a['content']],_0x3225b5,{'type':'text/markdown'});case Vs['HTML']:return new File([_0x124b1a['content']],_0x3225b5,{'type':'text/html'});default:return new File([_0x124b1a['content']],_0x3225b5,{'type':'text/plain'});}}static['_mapContextItemToRequestData'](_0x4d2f86){switch(_0x4d2f86['type']){case Us['FILE']:return{'type':Us['FILE'],'id':_0x4d2f86['id']};case Us['URL']:return{'type':Us['URL'],'id':_0x4d2f86['id']};case Us['DOCUMENT']:return{'type':Us['DOCUMENT'],'id':_0x4d2f86['id'],..._0x4d2f86['selection']?.['length']&&{'selection':_0x4d2f86['selection']}};case Us['TEXT']:return{'type':Us['FILE'],'id':_0x4d2f86['id']};case Us['TOOL']:{const _0x375c2c=_0x4d2f86;return{'type':Us['TOOL'],'mcpServerName':_0x375c2c['mcpServerName'],'toolName':_0x375c2c['toolName'],'data':_0x375c2c['data'],'id':_0x375c2c['id']};}default:return null;}}['_addContextItem'](_0x42fcc8,_0x55b045=!0x1){if(this['_pendingContextItems']['set'](_0x42fcc8['uiId'],_0x42fcc8),_0x42fcc8['hidden']||this['fire']('contextItemAdded',{'contextItem':_0x42fcc8,'isLoading':_0x55b045}),'current-document'===_0x42fcc8['uiId']&&this['_toggleAddCurrentDocumentOptionVisibility'](),_0x42fcc8['resourceId']){const _0x1d0cbc=this['_findSourceIdsByResourceId'](_0x42fcc8['resourceId']);_0x1d0cbc&&_0x1d0cbc['forEach'](_0x3f221c=>{this['_updateResourceInContextState'](_0x3f221c,_0x42fcc8['resourceId'],!0x0);});}}['_removeContextItem'](_0xb6b6a9){const _0x170f27=this['_pendingContextItems']['get'](_0xb6b6a9),_0x50b51a=this['_ongoingUploads']['get'](_0xb6b6a9);if(_0x50b51a&&(_0x50b51a['abort'](),this['_ongoingUploads']['delete'](_0xb6b6a9)),_0x170f27?.['resourceId']){const _0x9a995b=this['_findSourceIdsByResourceId'](_0x170f27['resourceId']);_0x9a995b&&_0x9a995b['forEach'](_0x3e078e=>{this['_updateResourceInContextState'](_0x3e078e,_0x170f27['resourceId'],!0x1);});}this['_pendingContextItems']['delete'](_0xb6b6a9),this['fire']('contextItemRemoved',{'uiId':_0xb6b6a9,'type':_0x170f27?.['type']}),'current-document'===_0xb6b6a9&&this['_toggleAddCurrentDocumentOptionVisibility']();}['_finishContextItemLoading'](_0x22f649,_0x463bea){if(this['_pendingContextItems']['has'](_0x22f649['uiId'])&&(this['_pendingContextItems']['set'](_0x22f649['uiId'],_0x22f649),this['fire']('contextItemLoadingEnded',{'contextItem':_0x22f649,'isLoading':_0x463bea}),_0x22f649['resourceId'])){const _0x572eba=this['_findSourceIdsByResourceId'](_0x22f649['resourceId']);_0x572eba&&_0x572eba['forEach'](_0x1979e8=>{this['_updateResourceInContextState'](_0x1979e8,_0x22f649['resourceId'],!0x0);});}}['_addToConversationContextItem'](_0x519753){this['_conversationContextItems']['set'](_0x519753['uiId'],_0x519753);}['_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'](_0x4d1fe7=>({..._0x4d1fe7,'enabled':!0x0}))??[]},this['fire']('addContextOptionsChanged',{'options':this['_addContextOptionsState']});}['_getCustomSourcesInitialState'](){return this['_config']?.['sources']?.['map'](_0x4b4c08=>({..._0x4b4c08,'resources':[]}))??[];}['_toggleAddCurrentDocumentOptionVisibility'](){const _0x25f7cf=this['isCurrentDocumentInContext']()||this['isCurrentDocumentInConversation']();this['_addContextOptionsState']['document']['isHidden']=_0x25f7cf,this['fire']('addContextOptionsChanged',{'options':this['_addContextOptionsState']});}['_isResourceInContext'](_0x5a8144){for(const _0x3eea67 of this['_pendingContextItems']['values']())if(_0x3eea67['resourceId']===_0x5a8144)return!0x0;for(const _0x449c43 of this['_conversationContextItems']['values']())if(_0x449c43['resourceId']===_0x5a8144)return!0x0;return!0x1;}['_findSourceIdsByResourceId'](_0x48d5c8){const _0x413272=[];for(const _0x2078fc of this['_addContextOptionsState']['sources']){_0x2078fc['resources']['find'](_0x47ad49=>_0x47ad49['id']===_0x48d5c8)&&_0x413272['push'](_0x2078fc['id']);}return 0x0===_0x413272['length']?null:_0x413272;}['_updateResourceInContextState'](_0x4d9e76,_0x5e7abf,_0x5b6e2c){const _0x204de5=this['_addContextOptionsState']['sources']['find'](_0x11aa7f=>_0x11aa7f['id']===_0x4d9e76);if(!_0x204de5)return;const _0x52b155=_0x204de5['resources']['find'](_0x17f764=>_0x17f764['id']===_0x5e7abf);_0x52b155&&(_0x52b155['isInContext']=_0x5b6e2c,this['fire']('resourceStateChanged',{'sourceId':_0x4d9e76,'resourceId':_0x5e7abf,'isInContext':_0x5b6e2c}));}['_startUploadOperation'](_0x24a6a9){this['_ongoingUploadOperations']['set'](_0x24a6a9,!0x0),this['_ongoingUploadOperations']['size']&&this['fire']('uploadProgressChanged',{'isUploadInProgress':!0x0});}['_finishUploadOperation'](_0x29ea31){this['_ongoingUploadOperations']['delete'](_0x29ea31),0x0===this['_ongoingUploadOperations']['size']&&this['fire']('uploadProgressChanged',{'isUploadInProgress':!0x1});}}const Ks=['capabilitiesUpdated'];class Ws extends pt(){['_isWebSearchEnabled'];['_isReasoningEnabled'];constructor(){super(),this['_isWebSearchEnabled']=!0x1,this['_isReasoningEnabled']=!0x1;}['init'](){this['reset']();}['reset'](){this['setWebSearch'](!0x1),this['setReasoning'](!0x1);}['getCapabilitiesConfig'](){return{'isWebSearchEnabled':this['_isWebSearchEnabled'],'isReasoningEnabled':this['_isReasoningEnabled']};}static['getCapabilitiesRequestData'](_0x355113){const _0x5150f6={};return _0x355113&&_0x355113['isWebSearchEnabled']&&(_0x5150f6['webSearch']={}),_0x355113&&_0x355113['isReasoningEnabled']&&(_0x5150f6['reasoning']={}),_0x5150f6;}['toggleWebSearch'](){this['setWebSearch'](!this['_isWebSearchEnabled']);}['toggleReasoning'](){this['setReasoning'](!this['_isReasoningEnabled']);}['setWebSearch'](_0x359b7e){_0x359b7e!==this['_isWebSearchEnabled']&&(this['_isWebSearchEnabled']=_0x359b7e,this['fire']('capabilitiesUpdated',this['getCapabilitiesConfig']()));}['setReasoning'](_0x5c524d){_0x5c524d!==this['_isReasoningEnabled']&&(this['_isReasoningEnabled']=_0x5c524d,this['fire']('capabilitiesUpdated',this['getCapabilitiesConfig']()));}}class Ys extends Ms{['userMessage'];['conversationId'];['contextItems']=new Map();['capabilities'];['model'];['attributes'];constructor(_0x294742){super(_0x294742),this['conversationId']=_0x294742['conversationId'],this['contextItems']=_0x294742['contextItems'],this['capabilities']=_0x294742['capabilities'],this['userMessage']=_0x294742['userMessage'],this['model']=_0x294742['model'],this['attributes']=_0x294742['attributes'];}async['sendRequest'](){return this['connector']['queryAssistant']({'message':this['userMessage'],'conversationId':this['conversationId'],'parts':Fs['mapContextItemsToRequestData'](this['contextItems']),'capabilities':Ws['getCapabilitiesRequestData'](this['capabilities']),'model':this['model'],'attributes':this['attributes']});}['getDocumentContext'](){return this['contextItems']['get']('current-document');}}class $s extends pt(){['id'];['isStarted']=!0x1;['isFromHistory'];['interactions']=[];['currentInteraction'];['selectedModel'];['connector'];['options'];constructor(_0x16a4f1){super(),this['options']=_0x16a4f1,this['connector']=_0x16a4f1['connector'],this['chatModels']=_0x16a4f1['chatModels'],this['id']=_0x16a4f1['conversationId'],this['isFromHistory']=_0x16a4f1['isFromHistory'];}async['init'](_0xaf62bc){try{this['chatContext']=new Fs({'connector':this['connector'],'config':_0xaf62bc,'ownerId':this['id']}),this['chatContext']['delegate'](...Gs)['to'](this),this['chatContext']['init'](),this['chatCapabilities']=new Ws(),this['chatCapabilities']['delegate'](...Ks)['to'](this),this['chatCapabilities']['init']();const _0x49b09c=await this['chatModels']['getAvailableModels']();this['fire']('conversationInitialized',{'availableModels':_0x49b09c});const _0x303202=await this['chatModels']['getModel'](this['options']['selectedModelId']);_0x303202&&await this['setModel'](_0x303202);}catch(_0x5d2ad5){const _0x3b5cab=new ht('ai-chat-conversation-init-failed',null,{'message':_0x5d2ad5['message']||_0x5d2ad5});_0x3b5cab['stack']=_0x5d2ad5['stack'],this['fire']('error',{'error':_0x3b5cab});}}async['start'](){if(this['isStarted'])throw new ht('ai-chat-conversation-already-started',null,{'conversation':this});if(!this['selectedModel'])throw new ht('ai-chat-conversation-start-no-model-selected',null,{'conversation':this});try{const {id:_0x52e6c8}=await this['connector']['startConversation'](this['id'],this['options']['group'])['getConversation']();this['id']=_0x52e6c8,this['isStarted']=!0x0,this['fire']('conversationStarted',{'conversationId':this['id'],'selectedModel':this['selectedModel']});}catch(_0x15ec16){const _0x43542c=new ht('ai-chat-conversation-start-failed',null,{'message':_0x15ec16['message'],'conversationId':this['id']});throw _0x43542c['stack']=_0x15ec16['stack'],this['fire']('error',{'error':_0x43542c}),_0x43542c;}}async['load'](_0x82e083,_0x565b98){try{const _0x3cd666=await this['connector']['fetchConversation'](_0x82e083)['getConversation'](),_0xebcb99=await this['connector']['fetchConversationMessages'](_0x82e083)['getMessages'](),_0x1ee302=_0xebcb99[0x0]['model'];this['isStarted']=!0x0,this['id']=_0x3cd666['id'],'title'in _0x3cd666?this['fire']('setConversationTitle',_0x3cd666['title'],!0x0):this['fire']('setConversationTitle','',!0x0);const _0x2aad33=(await this['chatModels']['getAll']())['find'](_0x3b57db=>_0x3b57db['id']['toLowerCase']()===_0x1ee302['toLowerCase']());return this['selectedModel']=_0x2aad33,this['fire']('modelSelected',{'selectedModel':_0x2aad33,'isDisabled':!0x0}),await this['_processMessagesToInteractions'](_0xebcb99,_0x565b98,_0x1ee302),this['currentInteraction']=void 0x0,this;}catch(_0x22f54b){const _0x5364ed=new ht('ai-chat-conversation-init-from-id-failed',null,{'message':_0x22f54b['message'],'conversationId':_0x82e083});throw _0x5364ed['stack']=_0x22f54b['stack'],this['fire']('error',{'error':_0x5364ed}),_0x5364ed;}}async['_processMessagesToInteractions'](_0x410ad6,_0x368b98,_0x1bb7be){let _0x52c3b8;for(const _0xa324e8 of _0x410ad6)if('user'===_0xa324e8['role']){const _0x5e361e=await this['_extractContextItems'](_0xa324e8),_0x4f59c6={'isReasoningEnabled':Object['hasOwn'](_0xa324e8['capabilities'],'reasoning'),'isWebSearchEnabled':Object['hasOwn'](_0xa324e8['capabilities'],'webSearch')};_0x52c3b8=this['createInteraction']({'userMessage':_0xa324e8['prompt'],'contextItems':_0x5e361e,'capabilities':_0x4f59c6,'modelId':_0x1bb7be,'attributes':_0xa324e8['attributes']}),this['currentInteraction']=_0x52c3b8,this['chatContext']['addToConversationContext'](this['currentInteraction']['contextItems']);}else{if('assistant'===_0xa324e8['role']&&_0x52c3b8){const _0x24722e=[];for(const _0x4248ce of _0xa324e8['content'])switch(_0x4248ce['type']){case'text':case'modification':{const _0x10f5fb=_0x52c3b8['getDocumentContext']()?.['sessionId']!==_0x368b98;_0x52c3b8['currentReply']=_0x52c3b8['createReply']({'type':_0x4248ce['type'],'isDone':!0x0,'interactionId':_0x52c3b8['id'],'areActionsDisabled':_0x10f5fb}),_0x52c3b8['currentReply']['appendContent'](_0x4248ce['content']),_0x24722e['length']>0x0&&(_0x52c3b8['currentReply']['sources']=_0x24722e['splice'](0x0));break;}case'url':_0x24722e['push'](_0x4248ce);break;case'mcp-tool-result':{const {data:_0x310f54,attributes:_0x42ccd5}=JSON['parse'](_0x4248ce['content']);_0x52c3b8['_handleToolResultData']({'toolName':_0x4248ce['toolName'],'data':_0x310f54,'attributes':_0x42ccd5});break;}}}}}async['_extractContextItems'](_0x14df35){const _0x5ff487=new Map();if(!_0x14df35['content'])return _0x5ff487;for(const _0x530361 of _0x14df35['content']){const _0x432909=await this['chatContext']['populateFromMessage'](_0x530361);_0x432909&&_0x5ff487['set'](_0x432909['id'],_0x432909);}return _0x5ff487;}async['handleUserInteraction']({userMessage:_0x29161d,attributes:_0x1ec529}){if(!this['isStarted'])throw new ht('ai-chat-handle-user-conversation-not-initialized',null,{'conversation':this});if(this['currentInteraction'])throw new ht('ai-chat-handle-user-interaction-already-in-progress',null,{'conversation':this});try{const _0x147f64=this['chatContext']['getPendingContextItems'](),_0x2cf4ed=this['chatCapabilities']['getCapabilitiesConfig'](),_0x2b9329=this['selectedModel']['id'];this['currentInteraction']=this['createInteraction']({'userMessage':_0x29161d,'contextItems':_0x147f64,'capabilities':_0x2cf4ed,'modelId':_0x2b9329,'attributes':_0x1ec529}),await this['currentInteraction']['start'](),this['chatContext']['addToConversationContext'](this['currentInteraction']['contextItems']);}catch(_0x13ad50){if(_0x13ad50 instanceof ht)this['fire']('error',{'interactionId':this['currentInteraction']?this['currentInteraction']['id']:void 0x0,'error':_0x13ad50});else{const _0x56a6d4=Bs['get'](_0x13ad50['code'])||'ai-chat-handle-user-interaction-start-failed';this['fire']('error',{'interactionId':this['currentInteraction']?this['currentInteraction']['id']:void 0x0,'error':new ht(_0x56a6d4,null,{'error':_0x13ad50})});}}finally{this['currentInteraction']?.['stop'](),this['currentInteraction']=void 0x0;}}['createInteraction']({userMessage:_0x4cdcee,contextItems:_0x481280,capabilities:_0x1270ab,modelId:_0x594f8d,attributes:_0x11bde0}){const _0x14a9f=new Ys({'userMessage':_0x4cdcee,'contextItems':_0x481280,'capabilities':_0x1270ab,'conversationId':this['id'],'connector':this['connector'],'editor':this['options']['getEditor']&&this['options']['getEditor'](),'model':_0x594f8d,'attributes':_0x11bde0});return _0x14a9f['delegate'](...Hs)['to'](this),this['interactions']['push'](_0x14a9f),this['fire']('interactionCreated',_0x14a9f),_0x14a9f;}['getInteraction'](_0x425c62){return this['interactions']['find'](_0x1262cc=>_0x1262cc['id']===_0x425c62);}['removeInteraction'](_0x2815a6){const _0x4867c3=this['getInteraction'](_0x2815a6);_0x4867c3&&(_0x4867c3['destroy'](),this['interactions']['splice'](this['interactions']['indexOf'](_0x4867c3),0x1));}get['lastInteraction'](){return this['interactions'][this['interactions']['length']-0x1];}['addCurrentDocumentToContext'](_0x1e03d7){this['chatContext']['addCurrentDocumentToContext'](_0x1e03d7);}async['updateCurrentDocumentInContext']({content:_0x5e9f71,version:_0x3a6aec,sessionId:_0x3c4aa7,selections:_0x1587b9}){await this['chatContext']['updateCurrentDocument'](_0x5e9f71,_0x3a6aec,_0x3c4aa7,_0x1587b9);}['getCurrentDocumentContext'](){return this['currentInteraction']?.['getDocumentContext']()?.['content']||'';}['addSelectionToContext'](_0x377d8e){this['chatContext']['addSelectionToContext'](_0x377d8e);}['removeSelectionFromContext'](){this['chatContext']['removeSelectionFromContext']();}['addFilesToContext'](_0x54e84d){this['chatContext']['addFilesToContext'](_0x54e84d);}['addUrlToContext'](_0x436133){this['chatContext']['addUrlToContext'](_0x436133);}['addToolItemToContext'](_0x1a0ec2){this['chatContext']['addToolItemToContext'](_0x1a0ec2);}['addResourceToContext'](_0x566c45,_0x2cd503){this['chatContext']['addResourceToContext'](_0x566c45,_0x2cd503);}['loadSourceResources'](_0x40794c,_0x4abed0,_0x33b44a){return this['chatContext']['loadSourceResources'](_0x40794c,_0x4abed0,_0x33b44a);}['removeFromContext'](_0x2e3ee4){this['chatContext']['removeFromContext'](_0x2e3ee4);}['setWebSearch'](_0x4f96d8){this['chatCapabilities']['setWebSearch'](_0x4f96d8);}['toggleWebSearch'](){this['chatCapabilities']['toggleWebSearch']();}['setReasoning'](_0x300795){this['chatCapabilities']['setReasoning'](_0x300795);}['toggleReasoning'](){this['chatCapabilities']['toggleReasoning']();}['isCurrentDocumentInContext'](){return this['chatContext']['isCurrentDocumentInContext']();}['isCurrentDocumentInConversation'](){return this['chatContext']['isCurrentDocumentInConversation']();}['isSelectionInContext'](){return this['chatContext']['isSelectionInContext']();}async['setModel'](_0x144547){_0x144547?!0x1===await this['chatModels']['isAvailable'](_0x144547)&&(Tt('ai-chat-conversation-set-model-not-available',{'conversation':this,'model':_0x144547}),_0x144547=(await this['chatModels']['getAvailableModels']())[0x0]):(Tt('ai-chat-conversation-set-model-null',{'conversation':this}),_0x144547=(await this['chatModels']['getAvailableModels']())[0x0]),_0x144547['id']!==this['selectedModel']?.['id']&&(this['selectedModel']=_0x144547,this['chatCapabilities']['reset'](),this['fire']('modelSelected',{'selectedModel':_0x144547}));}}class qs extends pt(){['_connector'];['_config'];['_locale'];['_modelList']=[];['_modelsRequest']=null;constructor({connector:_0x378569,config:_0x182db7,locale:_0x38e644}){super(),this['_connector']=_0x378569,this['_config']=_0x182db7,this['_locale']=_0x38e644;}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 _0x3eea4c=await this['getAll']();let _0x145d81;return _0x145d81=this['_availableModels']?this['_filterModels'](_0x3eea4c,this['_availableModels']):_0x3eea4c['filter'](_0x51809d=>_0x51809d['recommended']),_0x145d81;}async['getModel'](_0x4c1efd){const _0x4e38d5=await this['getAll']();if(!_0x4e38d5['length'])return null;if(_0x4c1efd){const _0x196824=this['_getModelById'](_0x4e38d5,_0x4c1efd);if(_0x196824)return _0x196824;Tt('ai-chat-model-id-unrecognized',{'modelId':_0x4c1efd,'fallBackModelId':this['_defaultModelId']});}return this['getDefault']();}async['getDefault'](){const _0x1a22d3=await this['getAvailableModels']();if(!_0x1a22d3['length'])return null;if(this['_defaultModelId']){const _0x899a7a=this['_getModelById'](_0x1a22d3,this['_defaultModelId']);if(_0x899a7a)return _0x899a7a;Tt('ai-chat-default-model-id-unrecognized',{'defaultModelId':this['_defaultModelId'],'fallBackModelId':_0x1a22d3[0x0]['id']});}return _0x1a22d3[0x0];}async['isAvailable'](_0x438bc4){return(await this['getAvailableModels']())['some'](_0x4036c3=>_0x4036c3['name']===_0x438bc4['name']&&_0x4036c3['provider']===_0x438bc4['provider']);}async['_retrieveModels'](){if(!this['_modelList']['length'])try{const _0xe28e4d=this['_locale']['uiLanguage']||'en',_0x1f55c7=this['_connector']['getModels'](_0xe28e4d),_0x43eff5=await _0x1f55c7['list']();this['_modelList']=_0x43eff5['items']['map'](_0x980ddb=>Qs(_0x980ddb)?{..._0x980ddb,'name':us(this['_locale'],'AI_MODEL_NAME_AUTO')}:_0x980ddb);}catch(_0x1ce895){throw mt('ai-models-unable-to-retrieve',{'error':_0x1ce895}),_0x1ce895;}return[...this['_modelList']];}['_filterModels'](_0x1c8db2,_0x2fcba5){let _0x349fc4;if(_0x2fcba5){_0x349fc4=[];const _0x12058f=new Set(),_0xd6e119='string'==typeof _0x2fcba5?[_0x2fcba5['toLocaleLowerCase']()]:_0x2fcba5['map'](_0x123b5a=>_0x123b5a['toLocaleLowerCase']());for(const _0x38d888 of _0xd6e119)for(const _0x15dbd3 of _0x1c8db2)!_0x12058f['has'](_0x15dbd3['id'])&&this['_isMatchingFilter'](_0x15dbd3,_0x38d888)&&(_0x349fc4['push'](_0x15dbd3),_0x12058f['add'](_0x15dbd3['id']));}else _0x349fc4=_0x1c8db2;return _0x349fc4;}['_isMatchingFilter'](_0x1f82fa,_0x3f147a){const _0x172cb3=_0x1f82fa['id']['toLocaleLowerCase'](),_0x53307d=_0x1f82fa['name']['toLocaleLowerCase'](),_0x12a753=_0x1f82fa['provider']['toLocaleLowerCase']();return _0x172cb3===_0x3f147a||_0x53307d===_0x3f147a||Qs(_0x1f82fa)&&'auto'===_0x3f147a||_0x12a753===_0x3f147a||_0x172cb3['startsWith'](_0x3f147a);}['_getModelById'](_0x173f62,_0x2583c0){return _0x173f62['find'](_0x1d508b=>Qs(_0x1d508b)&&'auto'===_0x2583c0?_0x1d508b:_0x1d508b['id']===_0x2583c0)||null;}}function Qs(_0x5a371){return _0x5a371['id']['startsWith']('agent');}function Xs(_0x4d3e2c){if(_0x4d3e2c instanceof _0x457883)return _0x4d3e2c;if(_0x4d3e2c?.['editors']&&_0x4d3e2c['editors']['get'](0x0))return _0x4d3e2c['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.'),_0x4d3e2c['editors']['get'](0x0);throw new ht('ai-get-editor-from-context-no-editor');}function zs({editor:_0x7bc032,interaction:_0x3c8710,reply:_0x3656de,groups:_0x22bce5,transform:_0xd984c4,documentCompare:_0x3281c7,documentCompareOptions:_0x50305f}){const _0x47af93=_0x3c8710['getDocumentContext']();if(!_0x47af93)return[];const _0x3bd5eb=_0x47af93['content'],_0x18dcfc=_0x47af93['version'],_0xfe67ac=_0x3656de['documentContextContent']['cloneNode'](!0x0);for(const {changes:_0x1740ed}of _0x22bce5){const _0xc3859c=_0x1740ed['filter'](_0x51ce3b=>'new'!=_0x51ce3b['type'])['map'](_0x732930=>ps('data-id',_0x732930['id'],_0xfe67ac)),_0x17d824=_0x1740ed['filter'](_0x2675d5=>'removed'!=_0x2675d5['type'])['map'](_0x2dd5a5=>_0x2dd5a5['node']['cloneNode'](!0x0));let _0x303fdd=null;if(_0xc3859c['length']){_0x303fdd=_0xc3859c[0x0]['previousSibling'];for(let _0x2ff316=0x0;_0x2ff316<_0xc3859c['length'];_0x2ff316++)_0x4a6be4(_0xc3859c[_0x2ff316]);}if(_0x17d824['length']){_0x303fdd||(_0x1740ed[0x0]['anchorId']?_0x303fdd=ps('data-id',_0x1740ed[0x0]['anchorId'],_0xfe67ac):(_0x303fdd=_0x17d824['shift'](),_0x4128f7(_0xfe67ac,_0x303fdd)));for(let _0x38a48a=0x0;_0x38a48a<_0x17d824['length'];_0x38a48a++)_0x104e4c(_0x303fdd,_0x17d824[_0x38a48a]),_0x303fdd=_0x17d824[_0x38a48a];}}const _0x429f49=Es(_0xfe67ac),_0x3404b9=_0x3281c7['getDiff'](_0x3bd5eb,_0x429f49,_0x50305f)['getOperations']();if(_0xd984c4){const _0x194ba5=_0x7bc032['model']['document']['history']['getOperations'](_0x18dcfc),_0x2de020={'document':_0x7bc032['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1};return _0x20fadc(_0x3404b9,_0x194ba5,_0x2de020)['operationsA'];}return _0x3404b9;}function js(_0x174d22,_0x410a8e){if('marker'!=_0x410a8e['type'])return;const _0x34e73e=_0x174d22['model']['markers']['get'](_0x410a8e['name']);_0x34e73e&&(_0x410a8e['oldRange']=_0x34e73e['getRange']());}class Js extends _0x25e92e{['activeConversation'];['_aiEditing'];['_aiConnector'];['_aiChatUi'];['_aiChatModels'];['_aiChatBalloon'];['_batchToChanges']=new Map();['_currentPreviewedChangeGroup']=null;['_bodyCollection'];static get['requires'](){return[ls,_0x32e5d7];}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 qs({'connector':this['_aiConnector'],'config':this['context']['config']['get']('ai.models'),'locale':this['context']['locale']});const _0x5eaf65=this['context']['plugins']['get']('AITabs');this['listenTo'](this['_aiChatUi'],'startConversation',()=>{this['_startConversationSafely']();}),this['listenTo'](this['_aiChatUi'],'sendUserMessage',(_0xa7f52,_0x477adb)=>{this['_handleUIUserMessage']({'message':_0x477adb});}),this['listenTo'](_0x5eaf65,'resizedTabs',(_0x3c9f81,_0x4d164b)=>{this['_setIsMaximized'](_0x4d164b);}),this['listenTo'](this['_aiChatUi'],'resizeTabs',()=>{_0x5eaf65['resize']();}),this['listenTo'](_0x5eaf65['view'],'change:activeTab',(_0x32ef3d,_0x4baba8,_0x844c03)=>{'chat'!==_0x844c03&&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',(_0x1b5000,_0x543eaa)=>{this['activeConversation']?.['addFilesToContext'](Array['from'](_0x543eaa));}),this['listenTo'](this['_aiChatUi'],'addUrlToContext',(_0x2f9222,_0x550b79)=>{this['activeConversation']?.['addUrlToContext'](_0x550b79);}),this['listenTo'](this['_aiChatUi'],'executeCustomItemCallback',(_0x23cce6,_0x1eb920)=>{_0x1eb920['callback'](this['context']);}),this['listenTo'](this['_aiChatUi'],'addResourceToContext',(_0x2f39f1,_0x424ece)=>{this['activeConversation']?.['addResourceToContext'](_0x424ece['source'],_0x424ece['resource']);}),this['listenTo'](this['_aiChatUi'],'removeContextItem',(_0x359fe2,_0x1c8aa5)=>{this['_removeFromContext'](_0x1c8aa5);}),this['listenTo'](this['_aiChatUi'],'loadSourceResources',(_0x1ddcaf,_0x571835)=>{this['activeConversation']?.['loadSourceResources'](_0x571835['sourceId'],_0x571835['query'],_0x571835['uid']);}),this['listenTo'](this['_aiChatUi'],'toggleWebSearch',()=>{this['_toggleWebSearch']();}),this['listenTo'](this['_aiChatUi'],'toggleReasoning',()=>{this['_toggleReasoning']();}),this['listenTo'](this['_aiChatUi'],'selectModel',(_0x757f0e,_0x8c2c5a)=>{this['activeConversation']?.['setModel'](_0x8c2c5a);}),this['listenTo'](this['_aiChatUi'],'like',(_0x4b0179,{replyId:_0x7ac23d})=>{console['log']('Liked\x20response',_0x7ac23d);}),this['listenTo'](this['_aiChatUi'],'dislike',(_0x4414fe,{replyId:_0x27dff3})=>{console['log']('Disliked\x20response',_0x27dff3);}),this['listenTo'](this['_aiChatUi'],'insertSuggestion',(_0x2aafb1,_0x55c2f3)=>{this['_insertSuggestion'](_0x55c2f3);}),this['listenTo'](this['_aiChatUi'],'showChangeInText',(_0x230a75,{replyId:_0x4615ff,partIndex:_0x25e2ea})=>{this['_aiChatBalloonShowDiff']=this['_aiChatUi']['showDiff'],this['_openBalloonFor'](_0x4615ff,_0x25e2ea);}),this['listenTo'](this['_aiChatUi'],'mouseOverSuggestion',(_0xb78b9a,{replyId:_0x257c60,partIndex:_0x4ebdeb})=>{const _0x255e4d=this['_getDocumentRangeForReplyChanges'](_0x257c60,_0x4ebdeb);_0x255e4d&&'$graveyard'!=_0x255e4d['range']['root']['rootName']&&this['_aiEditing']['showFakeVisualSelection']({'ranges':[_0x255e4d['range']],'id':'change-area','priority':0xa});}),this['listenTo'](this['_aiChatUi'],'mouseLeaveSuggestion',()=>{this['_aiEditing']['hideFakeVisualSelection']('change-area');}),this['listenTo'](this['_aiChatUi'],'applySuggestion',(_0x2ac84f,_0x107bda)=>{this['_aiEditing']['hideFakeVisualSelection']('change-area'),this['_applySuggestion'](_0x107bda);}),this['listenTo'](this['_aiChatUi'],'toggleSuggestionDisplayMode',async(_0x363e89,{replyId:_0xb1392a,showDiff:_0x1a8f90})=>{const {reply:_0x24a28e}=this['getInteractionAndReplyById'](_0xb1392a),_0x35294b=_0x24a28e['getContentParts']({'showDiff':_0x1a8f90});await this['_aiChatUi']['updateFeedItemAIReplySuggestionContent']({'id':_0x24a28e['id'],'parts':_0x35294b,'renderingStrategy':'static'});}),this['listenTo'](this['_aiChatUi'],'rejectSuggestion',(_0x4b69fc,{replyId:_0x4b9d8e,partIndex:_0x2ab583})=>{this['_rejectSuggestion']({'replyId':_0x4b9d8e,'partIndex':_0x2ab583}),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:_0x1d7a8e,partIndex:_0x170f29}=this['_currentPreviewedChangeGroup'];this['_aiChatBalloonShowDiff']=!this['_aiChatBalloonShowDiff'];const {reply:_0xc40e2b}=this['getInteractionAndReplyById'](_0x1d7a8e),_0x4c2f91=_0xc40e2b['getContentParts']({'showDiff':this['_aiChatBalloonShowDiff'],'groupIndex':_0x170f29});this['_aiChatBalloon']['updateContent']({'part':_0x4c2f91[0x0],'renderingStrategy':'static','keepErrors':!0x0});}),this['listenTo'](this['_aiChatBalloon'],'applySuggestion',()=>{const {replyId:_0xae8318,partIndex:_0x2a7446}=this['_currentPreviewedChangeGroup'];this['_applySuggestion']({'replyId':_0xae8318,'partIndex':_0x2a7446}),this['_aiChatBalloon']['setState']('accepted');}),this['listenTo'](this['_aiChatBalloon'],'insertSuggestion',()=>{const {replyId:_0x41340f,partIndex:_0x468cbb}=this['_currentPreviewedChangeGroup'];this['_insertSuggestion']({'replyId':_0x41340f,'partIndex':_0x468cbb}),this['_aiChatBalloon']['setState']('accepted');}),this['listenTo'](this['_aiChatBalloon'],'rejectSuggestion',()=>{const {replyId:_0x50b96c,partIndex:_0x7a58cb}=this['_currentPreviewedChangeGroup'];this['_rejectSuggestion']({'replyId':_0x50b96c,'partIndex':_0x7a58cb}),this['_aiChatBalloon']['setState']('rejected');}),this['listenTo'](this['_aiChatBalloon'],'showNext',()=>{const {replyId:_0x3ada8e,partIndex:_0x11c342}=this['_currentPreviewedChangeGroup'],_0x59fb9b=this['_getPresentableSiblingContentPartIndex'](_0x3ada8e,_0x11c342,'next');null!==_0x59fb9b&&this['_openBalloonFor'](_0x3ada8e,_0x59fb9b);}),this['listenTo'](this['_aiChatBalloon'],'showPrevious',()=>{const {replyId:_0x12dae7,partIndex:_0x291622}=this['_currentPreviewedChangeGroup'],_0x7ce30d=this['_getPresentableSiblingContentPartIndex'](_0x12dae7,_0x291622,'previous');null!==_0x7ce30d&&this['_openBalloonFor'](_0x12dae7,_0x7ce30d);}),this['listenTo'](this['_aiChatBalloon'],'dialogClosed',(_0x5ece5c,{id:_0x5edf33})=>{if('aiChatBalloon'!==_0x5edf33)return;const {replyId:_0x2a0f5d,partIndex:_0x231d41}=this['_currentPreviewedChangeGroup'];this['_currentPreviewedChangeGroup']=null,this['_aiChatUi']['setFeedItemAIReplySuggestionPartActive']({'id':_0x2a0f5d,'index':_0x231d41,'isActive':!0x1});}));}async['afterInit'](){this['context']instanceof _0x457883?this['_integrateEditor'](this['context']):this['listenTo'](this['context']['editors'],'add',(_0x56f8cb,_0x3267fe)=>{_0x3267fe['on']('ready',()=>{this['_integrateEditor'](_0x3267fe);});});const _0x52fe7a=this['context']['config']['get']('ai.chat.initialConversation');let _0x17652a=_0x52fe7a;if('lastCreated'!=_0x52fe7a||(_0x17652a=await this['_getLastCreatedConversationId'](),_0x17652a))return'new'==_0x17652a?this['_startConversationSafely']():this['loadConversation'](_0x17652a);}async['destroy'](){return await this['_stopLastInteraction'](),this['_bodyCollection']['detachFromDom'](),super['destroy']();}async['loadConversation'](_0x4d94dc){this['context']['plugins']['has']('AIChatBalloon')&&this['context']['plugins']['get']('AIChatBalloon')['close'](),(this['context']['plugins']['get'](cs)['view']['activateTab']('chat'),this['_aiChatUi']['setFeedItemRenderingStrategy']('static'),this['_aiChatUi']['toggleLoadingSkeleton'](!0x0),await this['_stopLastInteraction']());try{await this['_aiConnector']['fetchConversation'](_0x4d94dc)['getConversation'](),await this['_startConversationSafely'](_0x4d94dc),this['_updateConversationTitle']('\x20'),await this['activeConversation']['load'](_0x4d94dc,this['_aiEditing']['sessionId']),this['activeConversation']['isCurrentDocumentInConversation']()&&this['addCurrentDocumentToChatContext']();}catch(_0x4a758e){this['_aiChatUi']['addFeedItemError']({'errorMessage':us(this['context']['locale'],'AI_CHAT_UNABLE_TO_LOAD_CONVERSATION'),'id':_0x4d94dc}),this['_logError'](new ht('ai-chat-conversation-not-found',this,{'error':_0x4a758e}));}finally{this['_aiChatUi']['startAutoScroll'](),this['_aiChatUi']['setFeedItemRenderingStrategy']('streaming'),this['_aiChatUi']['toggleLoadingSkeleton'](!0x1);}}['registerToolDataCallback'](_0x193399){let _0x677b70=null,_0x1a8c6f=null;this['on']('toolDataReceived',(_0x510e11,_0x5c929f,_0xcb145b)=>{_0xcb145b['id']!==_0x677b70&&(_0x677b70=_0xcb145b['id'],_0x1a8c6f=this['_getAIChatFeedAPI'](_0xcb145b)),_0x193399(_0x5c929f,_0x1a8c6f);});}['addCurrentDocumentToChatContext'](){this['activeConversation']?.['addCurrentDocumentToContext'](us(this['context']['locale'],'AI_CHAT_CONTEXT_CURRENT_DOCUMENT'));}async['addSelectionToChatContext'](){const _0x4fdc02=this['_aiEditing']['getSelectionText']();this['activeConversation']?.['addSelectionToContext'](_0x4fdc02),this['addCurrentDocumentToChatContext']();}['removeSelectionFromChatContext'](){this['activeConversation']?.['removeSelectionFromContext']();}['focusPromptInput'](){this['_aiChatUi']['focusPromptInput']();}async['startConversation'](){await this['_startConversationSafely']();}async['sendMessage'](_0x3d95a4){await this['_handleUIUserMessage'](_0x3d95a4);}['getGroupId'](){const _0x11ebc5=this['context']['config']['get']('collaboration.channelId');if(!_0x11ebc5)throw new ht('ai-chat-missing-channel-id',this);return _0x11ebc5;}['_handleRemovedConversation'](_0x23e0bc){this['activeConversation']['id']===_0x23e0bc&&this['_startConversationSafely']();}['_insertSuggestion'](_0x8090a8){const _0x2f7d97=Xs(this['context']);if(!_0x2f7d97['plugins']['has']('TrackChanges'))throw new ht('ai-no-track-changes',null);const _0x162f3b=this['context']['plugins']['get']('DocumentCompare'),{reply:_0x3b341b,interaction:_0x123303}=this['getInteractionAndReplyById'](_0x8090a8['replyId']),_0x1e4d7a=this['_getDocumentRangeForReplyChanges'](_0x8090a8['replyId'],_0x8090a8['partIndex']),_0x18d615=void 0x0!==_0x8090a8['partIndex']?[_0x3b341b['changeGroups'][_0x8090a8['partIndex']]]:_0x3b341b['changeGroups']['filter'](_0x5815c2=>'pending'==_0x5815c2['state']),_0x258ca5=_0x18d615['map'](_0x55bd5c=>_0x3b341b['changeGroups']['indexOf'](_0x55bd5c));if(!_0x1e4d7a||'$graveyard'==_0x1e4d7a['range']['root']['rootName'])return void _0x258ca5['forEach'](_0x54a734=>_0x3b341b['setChangeGroupState'](_0x54a734,'outdated'));_0x258ca5['forEach'](_0x347d21=>_0x3b341b['setChangeGroupState'](_0x347d21,'accepted'));const _0x210677=zs({'editor':_0x2f7d97,'reply':_0x3b341b,'interaction':_0x123303,'groups':_0x18d615,'transform':!0x0,'documentCompare':_0x162f3b,'documentCompareOptions':{'anchor':'main','markDeletions':!0x0}});let _0x41215f;_0x1e4d7a&&this['_scrollToSuggestionRange'](_0x1e4d7a['range']),_0x2f7d97['model']['change'](_0x2bcc76=>{_0x41215f=_0x2bcc76['batch'],_0x2f7d97['plugins']['get']('TrackChangesEditing')['_applyOperationsAsSuggestions'](_0x210677),this['_aiEditing']['hideFakeVisualSelection']('change-area');}),this['_batchToChanges']['set'](_0x41215f,{'interactionId':_0x123303['id'],'replyId':_0x3b341b['id'],'indexes':_0x258ca5['slice']()}),this['_updateRatings'](_0x3b341b);}['_applySuggestion'](_0x21f42f){const _0x27f98c=Xs(this['context']),_0x362df2=this['context']['plugins']['get'](_0x32e5d7),{reply:_0x10b06c,interaction:_0x1c5328}=this['getInteractionAndReplyById'](_0x21f42f['replyId']),_0x3d374d=this['_getDocumentRangeForReplyChanges'](_0x21f42f['replyId'],_0x21f42f['partIndex']),_0xbd93ec=void 0x0!==_0x21f42f['partIndex']?[_0x10b06c['changeGroups'][_0x21f42f['partIndex']]]:_0x10b06c['changeGroups']['filter'](_0x4b81c5=>'pending'==_0x4b81c5['state']),_0x4192db=_0xbd93ec['map'](_0x489746=>_0x10b06c['changeGroups']['indexOf'](_0x489746));if(!_0x3d374d||'$graveyard'==_0x3d374d['range']['root']['rootName'])return void _0x4192db['forEach'](_0x12e8c0=>_0x10b06c['setChangeGroupState'](_0x12e8c0,'outdated'));_0x4192db['forEach'](_0x5ddbd7=>_0x10b06c['setChangeGroupState'](_0x5ddbd7,'accepted'));const _0x3aabe2=zs({'editor':_0x27f98c,'reply':_0x10b06c,'interaction':_0x1c5328,'groups':_0xbd93ec,'transform':!0x0,'documentCompare':_0x362df2,'documentCompareOptions':{'anchor':'main','markDeletions':!0x1}});let _0x4a4f0d;_0x3d374d&&this['_scrollToSuggestionRange'](_0x3d374d['range']),_0x27f98c['model']['change'](_0x15bd6a=>{_0x4a4f0d=_0x15bd6a['batch'];for(const _0x309b42 of _0x3aabe2)_0x309b42['baseVersion']=_0x27f98c['model']['document']['version'],js(_0x27f98c,_0x309b42),_0x15bd6a['batch']['addOperation'](_0x309b42),_0x27f98c['model']['applyOperation'](_0x309b42);}),this['_batchToChanges']['set'](_0x4a4f0d,{'interactionId':_0x1c5328['id'],'replyId':_0x10b06c['id'],'indexes':_0x4192db['slice']()}),this['_updateRatings'](_0x10b06c);}['_rejectSuggestion'](_0x53f71b){const {reply:_0x13ab62}=this['getInteractionAndReplyById'](_0x53f71b['replyId']);_0x13ab62['setChangeGroupState'](_0x53f71b['partIndex'],'rejected');}['_openBalloonFor'](_0x4599f4,_0x1d6d16){if(!this['_aiChatBalloon'])return;const {reply:_0x4523e1}=this['getInteractionAndReplyById'](_0x4599f4),_0x4c4849=_0x4523e1['getContentParts']({'showDiff':this['_aiChatBalloonShowDiff']});let _0x3d4ec7,_0x181007;if(void 0x0!==_0x1d6d16?(_0x181007=_0x4c4849['find'](_0x502776=>_0x502776['index']==_0x1d6d16),_0x3d4ec7=_0x181007?.['index']):(_0x181007=_0x4c4849[0x0],_0x3d4ec7=_0x181007['index']),this['_currentPreviewedChangeGroup']?.['replyId']==_0x4599f4&&this['_currentPreviewedChangeGroup']?.['partIndex']==_0x3d4ec7)return;const _0x3ff8c1=this['_getUserPresentableContentPartDocumentRange'](_0x4599f4,_0x4523e1,_0x181007);if(!_0x3ff8c1)return void this['_aiChatBalloon']['close']();this['_currentPreviewedChangeGroup']={'replyId':_0x4599f4,'partIndex':_0x3d4ec7},this['_scrollToSuggestionRange'](_0x3ff8c1,!0x0);const _0x3a2d64=this['_getPresentableSiblingContentPartIndex'](_0x4599f4,_0x3d4ec7,'next');this['_aiChatBalloon']['updateContent']({'part':_0x181007,'renderingStrategy':'static'}),this['_aiChatBalloon']['open']({'index':_0x3d4ec7,'title':us(this['context']['locale'],'AI_BALLOON_HEADER_TITLE',(_0x3d4ec7+0x1)['toString']()),'showRotator':null!==_0x3a2d64,'ranges':[_0x3ff8c1],'areActionsDisabled':_0x4523e1['areActionsDisabled']}),this['_aiChatBalloon']['setState']('pending'),this['_aiChatUi']['scrollFeedToSuggestion'](_0x4599f4,_0x3d4ec7),this['_aiChatUi']['setFeedItemAIReplySuggestionPartActive']({'id':_0x4599f4,'index':_0x3d4ec7,'isActive':!0x0});}['_getPresentableSiblingContentPartIndex'](_0x389d11,_0x4648df,_0x534c62){const {reply:_0x28a687}=this['getInteractionAndReplyById'](_0x389d11),_0x31f827=_0x28a687['getContentParts']({'showDiff':this['_aiChatBalloonShowDiff']});if(0x1==_0x31f827['length'])return null;const _0x230641=_0x31f827['findIndex'](_0x4fab2d=>_0x4fab2d['index']==_0x4648df),_0x4f692d='next'==_0x534c62?0x1:-0x1;let _0x5ea088=_0x31f827['at']((_0x230641+_0x4f692d)%_0x31f827['length'])['index'],_0x983c2=_0x31f827[_0x5ea088];for(;!this['_getUserPresentableContentPartDocumentRange'](_0x389d11,_0x28a687,_0x983c2);){if(_0x5ea088=_0x31f827['at']((_0x5ea088+_0x4f692d)%_0x31f827['length'])['index'],_0x5ea088===_0x230641)return null;_0x983c2=_0x31f827[_0x5ea088];}return _0x5ea088;}['_getUserPresentableContentPartDocumentRange'](_0x1e6d2f,_0x5eeb01,_0x117582){const _0x5018ce=_0x5eeb01['changeGroups'];if(!_0x117582['hasChanges'])return null;const _0x1f3b82=_0x5018ce['find'](_0x29f4b6=>_0x29f4b6['index']==_0x117582['index']);if('pending'!==_0x1f3b82?.['state'])return null;const _0x57d076=this['_getDocumentRangeForReplyChanges'](_0x1e6d2f,_0x117582['index']);if(!_0x57d076)return null;const {range:_0x5e1356,currentIndex:_0x93ee7c}=_0x57d076;return'$graveyard'==_0x5e1356['root']['rootName']?(_0x5eeb01['setChangeGroupState'](_0x93ee7c,'outdated'),null):_0x57d076['range'];}['_getDocumentRangeForReplyChanges'](_0x28b6a9,_0x5d2a55){const _0x3370d5=Xs(this['context']),{reply:_0x555c63,interaction:_0xaeae74}=this['getInteractionAndReplyById'](_0x28b6a9),_0x4acf1c=_0x555c63['changeGroups']['filter'](_0x582f5f=>'pending'==_0x582f5f['state']),_0x41402d=_0x4acf1c['map'](_0x2e32e7=>_0x555c63['changeGroups']['indexOf'](_0x2e32e7));void 0x0===_0x5d2a55&&(_0x5d2a55=_0x41402d[0x0]);const _0xc692b7=_0x41402d['indexOf'](_0x5d2a55);if(-0x1==_0xc692b7)return null;const _0x585603=_0x4acf1c[_0xc692b7],_0x1c9043=new _0x3c6c04([]),_0x80783e=new _0x3c6c04([]);for(const _0x4afeb3 of _0x585603['changes'])if('removed'!=_0x4afeb3['type']&&_0x80783e['children']['push'](_0x4afeb3['node']['cloneNode'](!0x0)),'new'!=_0x4afeb3['type']){const _0x1d02b1=_0x5b0b3c(_0x3c2cf8=>ms(_0x3c2cf8,'data-id')==_0x4afeb3['id'],_0x555c63['documentContextContent'],!0x0);_0x1c9043['children']['push'](_0x1d02b1['cloneNode'](!0x0));}if(0x0==_0x1c9043['children']['length']){if(_0x585603['changes'][0x0]['anchorId']){const _0x4b8480=ps('data-id',_0x585603['changes'][0x0]['anchorId'],_0x555c63['documentContextContent']);_0x1c9043['children']['unshift'](_0x4b8480['cloneNode'](!0x0)),_0x80783e['children']['unshift'](_0x4b8480['cloneNode'](!0x0)),_0x4b8480['nextSibling']&&(_0x1c9043['children']['push'](_0x4b8480['nextSibling']['cloneNode'](!0x0)),_0x80783e['children']['push'](_0x4b8480['nextSibling']['cloneNode'](!0x0)));}else{const _0x3518f4=_0x555c63['documentContextContent']['children'][0x0];if(!_0x3518f4)return null;_0x1c9043['children']['push'](_0x3518f4['cloneNode'](!0x0)),_0x80783e['children']['push'](_0x3518f4['cloneNode'](!0x0));}}const _0x335340=_0xaeae74['getDocumentContext'](),_0x5cac45=_0x3370d5['data']['parse'](_0x335340['content']),_0x57e99b=Es(_0x1c9043),_0x256bc4=_0x3370d5['data']['parse'](_0x57e99b),_0x2e381f=_0x3370d5['data']['parse'](_0x57e99b),_0x34733e=_0x3370d5['model']['createPositionAt'](_0x256bc4,0x0),_0x3e02a0=Es(_0x80783e),_0x2480d2={'anchor':_0x34733e,'markDeletions':!0x1},_0x4ebd2e=_0x3370d5['plugins']['get'](_0x32e5d7)['getDiff'](_0x57e99b,_0x3e02a0,_0x2480d2)['getOperations']();if(!_0x4ebd2e['length'])return null;_0x3370d5['model']['change'](_0x5b9262=>{for(const _0x218409 of _0x4ebd2e)if('remove'==_0x218409['type']){const _0x5e9e14=_0x218409['sourcePosition'],_0x1c2a05=_0x218409['howMany'],_0x14e003=new _0x285dd6(_0x5e9e14,_0x1c2a05);_0x5b9262['batch']['addOperation'](_0x14e003),_0x3370d5['model']['applyOperation'](_0x14e003);}else'marker'!==_0x218409['type']&&(_0x218409['baseVersion']=null,_0x218409['isDocumentOperation']=!0x1,_0x5b9262['batch']['addOperation'](_0x218409),_0x3370d5['model']['applyOperation'](_0x218409));});const _0x289097=ys(_0x3370d5,_0x4ebd2e,_0x256bc4);xs(_0x3370d5['model'],_0x289097);const _0x31f9cc=_0x289097['getFirstRange']()['start']['path']['slice'](),_0x1076bf=_0x289097['getFirstRange']()['end']['path']['slice'](),_0x30d1de=[];let _0x2067d4=_0x256bc4,_0x2703e8=_0x2e381f;for(let _0xeeb69d=0x0;_0xeeb69d<_0x1076bf['length'];_0xeeb69d++){const _0x574533=_0x2067d4['maxOffset']-_0x1076bf[_0xeeb69d];_0x30d1de[_0xeeb69d]=_0x2703e8['maxOffset']-_0x574533,_0x2067d4=_0x2067d4['getChildAtOffset'](_0x1076bf[_0xeeb69d]),_0x2703e8=_0x2703e8['getChildAtOffset'](_0x30d1de[_0xeeb69d]);}const _0xec7b0=_0x3370d5['model']['createRange'](_0x3370d5['model']['createPositionFromPath'](_0x2e381f,_0x31f9cc),_0x3370d5['model']['createPositionFromPath'](_0x2e381f,_0x30d1de)),_0x5b80df=_0x2e381f['getChild'](0x0)['getAttribute'](_0x5e786f),_0x1dbdb1=Array['from'](_0x5cac45['getChildren']())['find'](_0x321ac1=>_0x321ac1['getAttribute'](_0x5e786f)==_0x5b80df)['getPath'](),_0x2dcd77=_0xec7b0['start']['path']['slice'](),_0x36791e=_0xec7b0['end']['path']['slice']();_0x2dcd77[0x0]=_0x1dbdb1[0x0]+_0x2dcd77[0x0],_0x36791e[0x0]=_0x1dbdb1[0x0]+_0x36791e[0x0];let _0x9fccc7=_0x3370d5['model']['createRange'](_0x3370d5['model']['createPositionFromPath'](_0x3370d5['model']['document']['getRoot'](),_0x2dcd77),_0x3370d5['model']['createPositionFromPath'](_0x3370d5['model']['document']['getRoot'](),_0x36791e));const _0x43c9da=_0x3370d5['model']['document']['history']['getOperations'](_0x335340['version']);for(const _0x328a0d of _0x43c9da)_0x9fccc7=_0x3b0db7['_createFromRanges'](_0x9fccc7['getTransformedByOperation'](_0x328a0d));return{'range':_0x9fccc7,'currentIndex':_0x5d2a55};}['_integrateEditor'](_0x1ed00c){if(_0x1ed00c['plugins']['has']('Undo')){const _0x50db60=_0x1ed00c['commands']['get']('undo'),_0x5bccae=_0x1ed00c['commands']['get']('redo');this['listenTo'](_0x50db60,'revert',(_0x4a167d,_0x5870e6,_0x5e3778)=>{const _0x172e04=this['_batchToChanges']['get'](_0x5870e6);if(!_0x172e04)return;const _0x509edc=this['activeConversation']['getInteraction'](_0x172e04['interactionId'])['getReply'](_0x172e04['replyId']);_0x172e04['indexes']['forEach'](_0x5352dd=>_0x509edc['setChangeGroupState'](_0x5352dd,'pending')),this['_batchToChanges']['delete'](_0x5870e6),this['_batchToChanges']['set'](_0x5e3778,_0x172e04);}),this['listenTo'](_0x5bccae,'revert',(_0xf01bd7,_0x50f7e5,_0x57a36a)=>{const _0x3d1b22=this['_batchToChanges']['get'](_0x50f7e5);if(!_0x3d1b22)return;const _0x5586fa=this['activeConversation']['getInteraction'](_0x3d1b22['interactionId'])['getReply'](_0x3d1b22['replyId']);_0x3d1b22['indexes']['forEach'](_0x3f1c8f=>_0x5586fa['setChangeGroupState'](_0x3f1c8f,'accepted')),this['_batchToChanges']['delete'](_0x50f7e5),this['_batchToChanges']['set'](_0x57a36a,_0x3d1b22);});}const _0x4f4830=_0x1ed00c['config']['get']('ai.chat.context');_0x4f4830['alwaysAddSelection']&&_0x4f4830['document']['enabled']&&this['listenTo'](_0x1ed00c['model']['document']['selection'],'change:range',(_0x3d927f,_0x45df3a)=>{if(!_0x45df3a['directChange'])return;'chat'===_0x1ed00c['plugins']['get']('AITabs')['view']['activeTab']&&(_0x1ed00c['model']['hasContent'](_0x1ed00c['model']['document']['selection'])?this['addSelectionToChatContext']():this['removeSelectionFromChatContext']());});}async['_getLastCreatedConversationId'](){const _0x2a1491=this['_aiConnector']['fetchConversations'](this['getGroupId'](),{'limit':0x1,'sortBy':'createdAt'});try{const _0x17bdd8=await _0x2a1491['getConversations']();return _0x17bdd8['length']?_0x17bdd8[0x0]['id']:'new';}catch(_0x2389de){return this['_aiChatUi']['addFeedItemError']({'errorMessage':us(this['context']['locale'],'AI_CHAT_UNABLE_TO_LOAD_CONVERSATION'),'id':ot()}),this['_logError'](new ht('ai-chat-conversation-init-failed',this,{'error':_0x2389de})),this['_aiChatUi']['toggleLoadingSkeleton'](!0x1),this['_aiChatUi']['disableControls'](),null;}}async['_startConversationSafely'](_0x166b10){try{this['_aiChatUi']['enableControls'](),await this['_handleStartConversation'](_0x166b10);}catch(_0x46cf5e){this['_aiChatUi']['addFeedItemError']({'errorMessage':us(this['context']['locale'],'AI_CHAT_UNABLE_TO_START_CONVERSATION'),'id':_0x166b10||ot()}),console['error'](_0x46cf5e),this['activeConversation']=void 0x0,this['_aiChatUi']['disableControls']();}}async['_handleStartConversation'](_0x895c94){let _0x3cc082;this['context']['plugins']['has']('AIChatBalloon')&&this['context']['plugins']['get']('AIChatBalloon')['close'](),_0x895c94||!this['activeConversation']?_0x3cc082=this['context']['config']['get']('ai.models.defaultModelId'):this['_aiChatUi']['isModelAvailable']&&(_0x3cc082=this['activeConversation']['selectedModel']['id']),await this['_stopLastInteraction']();const _0x5269b0=this['getGroupId'](),_0x118fbf=_0x895c94||ot();this['activeConversation']=new $s({'connector':this['_aiConnector'],'chatModels':this['_aiChatModels'],'selectedModelId':_0x3cc082,'conversationId':_0x118fbf,'group':_0x5269b0,'getEditor':()=>Xs(this['context']),'isFromHistory':!!_0x895c94}),this['activeConversation']['delegate']('toolDataReceived','interactionStarted')['to'](this),this['activeConversation']['delegate']('toolDataReceived','interactionCreated','replyCreated')['to'](this),this['on']('interactionCreated',(_0x12943a,_0x3a6592)=>{this['_aiChatUi']['addFeedItemUserMessage'](_0x3a6592);}),this['on']('replyCreated',(_0x37bc59,_0xd0577d)=>{this['_addFeedItemReply'](_0xd0577d);}),this['activeConversation']['on']('conversationInitialized',(_0x28c392,_0x45daae)=>{this['_aiChatUi']['createConversation'](_0x45daae),this['_aiChatUi']['resetMessageInput'](),this['_aiChatUi']['clearPendingContextUI'](),this['_aiChatUi']['clearConversationContextUI'](),_0x895c94||(this['_aiChatUi']['resetConversationTitle'](),this['addCurrentDocumentToChatContext']());}),this['activeConversation']['on']('uploadProgressChanged',(_0x12f757,_0x7eb36a)=>{this['_aiChatUi']['setIsUploadInProgress'](_0x7eb36a['isUploadInProgress']);}),this['activeConversation']['on']('webSearchStarted',()=>{const _0x3cc746=this['_aiChatUi']['prepareLoadingMessage']({'isWebSearchEnabled':!0x0,'isReasoningEnabled':!0x1});this['_aiChatUi']['setLoadingMessage'](_0x3cc746);}),this['activeConversation']['on']('reasoningStarted',()=>{const _0x1a746b=this['_aiChatUi']['prepareLoadingMessage']({'isWebSearchEnabled':!0x1,'isReasoningEnabled':!0x0});this['_aiChatUi']['setLoadingMessage'](_0x1a746b);}),this['activeConversation']['on']('webSearchFinished',(_0x2f4c3c,_0x5c3562)=>{this['_aiChatUi']['addFeedInteractionHeader'](_0x5c3562,{'isWebSearchEnabled':!0x0,'isReasoningEnabled':!0x1});}),this['activeConversation']['on']('reasoningFinished',(_0x210939,_0x8cbd6d)=>{this['_aiChatUi']['addFeedInteractionHeader'](_0x8cbd6d,{'isWebSearchEnabled':!0x1,'isReasoningEnabled':!0x0});}),this['activeConversation']['on']('interactionStarted',()=>{this['_aiChatUi']['startInteraction']();}),this['activeConversation']['on']('interactionFinished',async()=>{await this['_aiChatUi']['finishInteraction']();}),this['activeConversation']['on']('interactionDestroyed',(_0x20fb41,_0x2b1d6c)=>{this['_aiChatUi']['removeFeedInteraction'](_0x2b1d6c['id']);}),this['activeConversation']['on']('setConversationTitle',(_0x6a0123,_0x5a7f35,_0x54c9c4)=>{this['_updateConversationTitle'](_0x5a7f35,_0x54c9c4);}),this['activeConversation']['on']('replyContentUpdated',async(_0x3f1783,_0x161929)=>{await this['_updateReplyContent']({'reply':_0x161929});}),this['activeConversation']['on']('replyChangeGroupStateUpdated',(_0x332217,{reply:_0x5620a8,index:_0x3a15a2,state:_0x492e4a})=>{this['_aiChatUi']['updateFeedItemAIReplySuggestionPartState']({'id':_0x5620a8['id'],'index':_0x3a15a2,'state':_0x492e4a}),this['_currentPreviewedChangeGroup']?.['replyId']['includes'](_0x5620a8['id'])&&this['_currentPreviewedChangeGroup']?.['partIndex']==_0x3a15a2&&this['_aiChatBalloon']?.['setState'](_0x492e4a);}),this['activeConversation']['on']('contextItemAdded',(_0x27e202,_0x45edc1)=>{if(this['_aiChatUi']['addContextItem'](_0x45edc1['contextItem'],_0x45edc1['isLoading']),'selection'===_0x45edc1['contextItem']['type']){const _0x418e04=[...Xs(this['context'])['model']['document']['selection']['getRanges']()];this['_aiEditing']['showFakeVisualSelection']({'ranges':_0x418e04,'id':'context','priority':0x1});}}),this['activeConversation']['on']('contextItemRemoved',(_0x57f863,_0xaa8bd1)=>{this['_aiChatUi']['removeContextItem'](_0xaa8bd1['uiId']),'current-document'==_0xaa8bd1['uiId']&&this['removeSelectionFromChatContext'](),'selection'===_0xaa8bd1['type']&&this['_aiEditing']['hideFakeVisualSelection']('context');}),this['activeConversation']['on']('contextItemLoadingEnded',(_0x430cfb,_0x5cce45)=>{this['_aiChatUi']['setContextItemLoading'](_0x5cce45['contextItem']['uiId'],_0x5cce45['isLoading']);}),this['activeConversation']['on']('contextSent',(_0x431596,_0x1e1cf7)=>{this['_aiChatUi']['setConversationContext'](_0x1e1cf7['contextItems']);}),this['activeConversation']['on']('addContextOptionsChanged',(_0x4f2533,_0x5377ce)=>{this['_aiChatUi']['setAddContextOptions'](_0x5377ce['options']);}),this['activeConversation']['on']('sourceResourcesLoaded',(_0x2caf29,_0x184c55)=>{this['_aiChatUi']['populateSourceResourceBalloon'](_0x184c55['sourceId'],_0x184c55['source'],_0x184c55['resources'],_0x184c55['uid']);}),this['activeConversation']['on']('resourceStateChanged',(_0x30cc8c,_0x3a2743)=>{this['_aiChatUi']['updateResourceState'](_0x3a2743['sourceId'],_0x3a2743['resourceId'],_0x3a2743['isInContext']);}),this['activeConversation']['on']('capabilitiesUpdated',(_0x328196,_0x45c191)=>{this['_aiChatUi']['updateCapabilities'](_0x45c191);}),this['activeConversation']['on']('modelSelected',async(_0x594a58,_0x53c5ef)=>{const _0x5e4c3f=(await this['_aiChatModels']['getAll']())['find'](_0x599293=>_0x599293['id']===_0x53c5ef['selectedModel']?.['id'])||null;this['_aiChatUi']['setSelectedModel'](_0x5e4c3f,_0x53c5ef['isDisabled']);}),this['activeConversation']['on']('error',(_0x10a1fa,{error:_0x3e8eb9,interactionId:_0x184254,fileName:_0x1a8007,url:_0x2b12ea,sourceId:_0x257036,sourceLabel:_0x376a5d})=>{const _0x597d54=_0x184254?_0x184254+':'+ot():ot();_0x3e8eb9['message']['startsWith']('ai-request-aborted')?this['_aiChatUi']['addFeedItemStaticMessage']({'staticMessage':us(this['context']['locale'],'AI_CHAT_ABORTED_MESSAGE'),'id':_0x597d54}):_0x3e8eb9['message']['startsWith']('ai-chat-conversation-init-failed')||_0x3e8eb9['message']['startsWith']('ai-chat-conversation-start-failed')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':us(this['context']['locale'],'AI_CHAT_UNABLE_TO_START_CONVERSATION'),'id':_0x597d54}),this['_logError'](_0x3e8eb9)):_0x3e8eb9['message']['startsWith']('ai-chat-file-upload-failed')?this['_aiChatUi']['addFeedItemError']({'errorMessage':us(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_FILE',_0x1a8007),'id':_0x597d54}):_0x3e8eb9['message']['startsWith']('ai-chat-url-upload-failed')?this['_aiChatUi']['addFeedItemError']({'errorMessage':us(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_URL',_0x2b12ea),'id':_0x597d54}):_0x3e8eb9['message']['startsWith']('ai-chat-context-invalid-data')?this['_aiChatUi']['addFeedItemError']({'errorMessage':us(this['context']['locale'],'AI_CHAT_CONTEXT_INVALID_DATA'),'id':_0x597d54}):_0x3e8eb9['message']['startsWith']('ai-chat-context-unsupported-type')?this['_aiChatUi']['addFeedItemError']({'errorMessage':us(this['context']['locale'],'AI_CHAT_CONTEXT_UNSUPPORTED_TYPE'),'id':_0x597d54}):_0x3e8eb9['message']['startsWith']('ai-chat-source-resources-load-failed')?(_0x257036&&this['_aiChatUi']['closeSourceResourceBalloon'](_0x257036),this['_aiChatUi']['addFeedItemError']({'errorMessage':us(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_LOAD_RESOURCES',_0x376a5d||'source'),'id':_0x597d54}),this['_logError'](_0x3e8eb9)):_0x3e8eb9['message']['startsWith']('ai-chat-resource-load-failed')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':us(this['context']['locale'],'AI_CHAT_RESOURCE_LOAD_FAILED'),'id':_0x597d54}),this['_logError'](_0x3e8eb9)):_0x3e8eb9['message']['startsWith']('ai-chat-invalid-request')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':us(this['context']['locale'],'AI_CHAT_INVALID_REQUEST'),'id':_0x597d54}),this['_logError'](_0x3e8eb9)):_0x3e8eb9['message']['startsWith']('ai-chat-context-unsupported-file-type')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':us(this['context']['locale'],'AI_CHAT_CONTEXT_UNSUPPORTED_FILE_TYPE'),'id':_0x597d54}),this['_logError'](_0x3e8eb9)):_0x3e8eb9['message']['startsWith']('ai-chat-context-file-too-large')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':us(this['context']['locale'],'AI_CHAT_CONTEXT_FILE_TOO_LARGE'),'id':_0x597d54}),this['_logError'](_0x3e8eb9)):_0x3e8eb9['message']['startsWith']('ai-chat-context-file-too-many-pages')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':us(this['context']['locale'],'AI_CHAT_CONTEXT_FILE_TOO_MANY_PAGES'),'id':_0x597d54}),this['_logError'](_0x3e8eb9)):_0x3e8eb9['message']['startsWith']('ai-chat-context-form-data-size-limits-exceeded')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':us(this['context']['locale'],'AI_CHAT_CONTEXT_FORM_DATA_SIZE_LIMITS_EXCEEDED'),'id':_0x597d54}),this['_logError'](_0x3e8eb9)):(this['_aiChatUi']['addFeedItemError']({'errorMessage':us(this['context']['locale'],'AI_CHAT_GENERIC_ERROR'),'id':_0x597d54}),this['_logError'](_0x3e8eb9));}),await this['activeConversation']['init'](this['context']['config']['get']('ai.chat.context')),_0x895c94||await this['activeConversation']['start']();}async['_handleUIUserMessage']({message:_0x3f0947,attributes:_0x357d4a}){if(!this['activeConversation'])throw new ht('ai-chat-controller-no-active-conversation');if(this['activeConversation']['isCurrentDocumentInContext']()){const _0x5c6317=await this['_aiEditing']['getDocumentData']();await this['activeConversation']['updateCurrentDocumentInContext'](_0x5c6317);}this['activeConversation']['id']&&this['activeConversation']['isStarted']&&await this['activeConversation']['handleUserInteraction']({'userMessage':_0x3f0947,'attributes':_0x357d4a});}['_setIsMaximized'](_0x1b3818){this['_aiChatUi']['setIsMaximized'](_0x1b3818);}['_logError'](_0x5e6cd8){mt(_0x5e6cd8['message']);}['_removeFromContext'](_0x577c22){this['activeConversation']?.['removeFromContext'](_0x577c22);}['_toggleWebSearch'](){this['activeConversation']?.['toggleWebSearch']();}['_toggleReasoning'](){this['activeConversation']?.['toggleReasoning']();}['getInteractionAndReplyById'](_0x536c47){const [_0x2f299a,_0x111577]=_0x536c47['split'](':'),_0x29db1e=this['activeConversation']['getInteraction'](_0x2f299a),_0x4812b1=_0x29db1e['getReply'](_0x111577);return{'interaction':_0x29db1e,'reply':_0x4812b1};}['_scrollToSuggestionRange'](_0x1b00da,_0x297d51=!0x1){const _0x118010=Xs(this['context']),_0x1873c5={'target':_0x118010['editing']['view']['domConverter']['viewRangeToDom'](_0x118010['editing']['mapper']['toViewRange'](_0x1b00da)),'viewportOffset':{'top':0x96,'left':0x0,'bottom':0x32,'right':0x0},'ancestorOffset':0x14,'alignToTop':_0x297d51};_0x297d51&&(_0x1873c5['alignToTop']=!0x0),Ct(_0x1873c5);}['_updateConversationTitle'](_0x47113a,_0x4192e3=!0x1){this['_aiChatUi']['setConversationTitle'](_0x47113a||us(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION'),_0x4192e3);}['_addFeedItemReply'](_0x1de1b0){'text'===_0x1de1b0['type']?this['_aiChatUi']['addFeedItemAIReply'](_0x1de1b0):this['_aiChatUi']['addFeedItemAISuggestion'](_0x1de1b0);}async['_updateReplyContent']({reply:_0x3bf17b,renderingStrategy:_0x499046}){const {id:_0x305ef7,interactionId:_0x1686a4,isDone:_0x5def0e,type:_0x4ebe41,parsedContent:_0x38ee08}=_0x3bf17b,_0x15f4de=_0x1686a4+':'+_0x305ef7;if('modification'===_0x4ebe41){const _0x56f231=_0x3bf17b['getContentParts']({'showDiff':this['_aiChatUi']['showDiff']});await this['_aiChatUi']['updateFeedItemAIReplySuggestionContent']({'id':_0x15f4de,'parts':_0x56f231,'renderingStrategy':_0x499046,'isDone':_0x5def0e});}else'text'===_0x4ebe41&&await this['_aiChatUi']['updateFeedItemAIReplyContent']({'id':_0x15f4de,'parsedContent':_0x38ee08,'renderingStrategy':_0x499046,'isDone':_0x5def0e});_0x5def0e&&_0x3bf17b['sources']['length']>0x0&&this['_aiChatUi']['updateFeedItemAIReplySources'](_0x15f4de,_0x3bf17b['sources']);}async['_stopLastInteraction'](){const _0x142dec=this['activeConversation']?.['lastInteraction'];_0x142dec&&(_0x142dec['stop'](),this['_aiChatUi']['stopInteraction'](_0x142dec));}async['_flushLastInteractionUI'](){const _0x5646d1=this['activeConversation']?.['lastInteraction'];if(_0x5646d1){for await(const _0x405593 of _0x5646d1['replies'])this['_aiChatUi']['hasFeedItem'](_0x405593['id'])||this['_addFeedItemReply'](_0x405593),await this['_updateReplyContent']({'reply':_0x405593,'renderingStrategy':'static'});}}['_updateRatings'](_0x5de495){const _0xa5bdc3={'positiveCount':_0x5de495['changeGroups']['filter'](_0x373423=>'accepted'===_0x373423['state'])['length'],'totalCount':_0x5de495['changeGroups']['length'],'modificationId':_0x5de495['id']},_0x5962a5=this['activeConversation']['getInteraction'](_0x5de495['interactionId'])['messageId'];_0x5962a5&&this['_aiConnector']['upsertAIChatRating'](this['activeConversation']['id'],_0x5962a5,_0xa5bdc3);}['_getAIChatFeedAPI'](_0x3b48b9){const _0x127248=this['_aiChatUi'],_0x97a64f=()=>{_0x3b48b9['resetWebSearchState'](),_0x3b48b9['resetReasoningState'](),_0x127248['clearLoadingMessage']();},_0x360954=()=>{_0x3b48b9['currentReply']&&(_0x3b48b9['currentReply']['done'](),_0x3b48b9['currentReply']=void 0x0);};return{'insertTextReply':(_0x34d6a2,_0x30281f)=>{_0x360954(),_0x97a64f();const _0x183986=_0x3b48b9['currentReply']=_0x3b48b9['createReply']({'type':'text','interactionId':_0x3b48b9['id'],'content':_0x34d6a2,'id':_0x30281f||ot()});return _0x360954(),_0x183986;},'insertCustomElement':async(_0x4c00be,_0x295f60)=>(_0x360954(),_0x97a64f(),_0x127248['addFeedItemCustomElement'](_0x4c00be,_0x295f60||ot())),'setLoadingMessage':_0x5322c7=>{_0x127248['setLoadingMessage'](_0x5322c7);},'clearLoadingMessage':()=>{_0x127248['clearLoadingMessage']();}};}}const Zs='ai-selection';class tn extends _0x25e92e{constructor(_0x9f76b){super(_0x9f76b),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 _0x1a4669=Xs(this['context']),_0x136bb3=_0x1a4669['plugins']['has']('RealTimeCollaborationClient')&&_0x1a4669['plugins']['get']('RealTimeCollaborationClient')['sessionId'];this['_sessionId']=_0x136bb3||ot();}return this['_sessionId'];}async['getDocumentData'](){const _0x375497=Xs(this['context']),_0x4e1fbf=_0x375497['model'],_0x571839=_0x375497['data']['toView'](_0x4e1fbf['document']['getRoot'](),{'convertAiChatSelectionMarker':!0x0}),_0x4ebe47=new _0x5e3237(_0x375497['editing']['view']['document']);this['_setDataIdsOnChildren'](_0x571839,_0x4ebe47);let _0x8164f5=await this['_getDocumentDataStringFromView'](_0x571839);const _0x184889=this['_getMarkersInDocumentOrder'](),_0x503d46=[];for(const _0x4db6e9 of _0x184889){const _0x57db54='<'+_0x4db6e9['name']+':start></'+_0x4db6e9['name']+':start>',_0x4f5407=_0x8164f5['indexOf'](_0x57db54);_0x8164f5=_0x8164f5['substring'](0x0,_0x4f5407)+_0x8164f5['substring'](_0x4f5407+_0x57db54['length']);const _0x2e4510='<'+_0x4db6e9['name']+':end></'+_0x4db6e9['name']+':end>',_0x114ea6=_0x8164f5['indexOf'](_0x2e4510);_0x8164f5=_0x8164f5['substring'](0x0,_0x114ea6)+_0x8164f5['substring'](_0x114ea6+_0x2e4510['length']),_0x503d46['push']({'markerName':_0x4db6e9['name'],'start':_0x4f5407,'end':_0x114ea6,'htmlFragment':_0x8164f5['substring'](_0x4f5407,_0x114ea6)});}return{'content':_0x8164f5,'version':_0x375497['model']['document']['version'],'sessionId':this['sessionId'],'selections':_0x503d46};}async['afterInit'](){this['context']instanceof _0x457883?this['_integrateEditor'](this['context']):this['listenTo'](this['context']['editors'],'add',(_0x4162fa,_0x5f3dac)=>{_0x5f3dac['on']('ready',()=>{this['_integrateEditor'](_0x5f3dac);});});}['_setOutputDataProcessor'](_0x5116e2){this['_outputDataProcessor']=_0x5116e2;}async['_getDocumentDataStringFromView'](_0x126cfc){let _0x4f3b87;const _0x292758=Xs(this['context']);if(this['_outputDataProcessor']){const _0x36331f=_0x292758['data']['processor']['domConverter']['viewToDom'](_0x126cfc),_0x53312c=await this['_outputDataProcessor'](_0x36331f);_0x4f3b87=_0x292758['data']['processor']['htmlWriter']['getHtml'](_0x53312c);}else _0x4f3b87=_0x292758['data']['processor']['toData'](_0x126cfc);return _0x4f3b87;}['_integrateEditor'](_0x55ab4a){_0x55ab4a['conversion']['for']('editingDowncast')['markerToHighlight']({'model':Zs,'view':({markerName:_0xb93d73})=>({'classes':['ck-ai-assistant-ui_theme','ck-fake-ai-selection','ck-fake-ai-selection-'+_0xb93d73['split'](':')[0x1]],'priority':0xc})}),_0x55ab4a['conversion']['for']('dataDowncast')['markerToElement']({'model':Zs,'view':(_0x34b938,{writer:_0x1fa74c,options:_0x3eab84})=>_0x3eab84['convertAiChatSelectionMarker']?_0x1fa74c['createUIElement'](_0x34b938['markerName']+':'+(_0x34b938['isOpening']?'start':'end')):null});}['showFakeVisualSelection'](_0x4a6900){const _0x9772f5=this['_fakeSelections'][0x0]||null;this['_addFakeSelection'](_0x4a6900);const _0x2bcf06=this['_fakeSelections'][0x0]||null;this['_refreshFakeSelection'](_0x9772f5,_0x2bcf06);}['hideFakeVisualSelection'](_0x3f67ae){const _0x249956=this['_fakeSelections'][0x0]||null;this['_removeFakeSelectionById'](_0x3f67ae);const _0x510944=this['_fakeSelections'][0x0]||null;this['_refreshFakeSelection'](_0x249956,_0x510944);}async['modelToDataWithIds'](_0x59b44d){const _0x5bcad6=Xs(this['context']),_0x4a4aea=_0x5bcad6['data']['toView'](_0x59b44d),_0x51e380=new _0x5e3237(_0x5bcad6['editing']['view']['document']);return this['_setDataIdsOnChildren'](_0x4a4aea,_0x51e380),this['_getDocumentDataStringFromView'](_0x4a4aea);}['_setDataIdsOnChildren'](_0x5e6ac1,_0x2974b3){let _0x214043=!0x1;const _0x403679=new Set();for(const _0x55fdc6 of _0x5e6ac1['getChildren']()){if(!_0x55fdc6['is']('view:element'))continue;const _0x15fec9=_0x55fdc6['is']('view:containerElement'),_0x3e879d=_0x55fdc6['is']('view:emptyElement'),_0xae05b5=this['_setDataIdsOnChildren'](_0x55fdc6,_0x2974b3);if(_0x55fdc6['hasAttribute']('data-id')){_0x214043=!0x0,_0x403679['add'](_0x55fdc6['getAttribute']('data-id'));continue;}(_0x15fec9||_0x3e879d||_0xae05b5)&&(_0x2974b3['setAttribute']('data-id',this['_nextDataId'](_0x403679),_0x55fdc6),_0x214043=!0x0);}return _0x214043;}['_nextDataId'](_0x3ac743){let _0x228cba;do{_0x228cba='';for(let _0x13810e=0x0;_0x13810e<0x4;_0x13810e++)_0x228cba+=String['fromCharCode'](0x61+Math['floor'](0x1a*Math['random']()));}while(_0x3ac743['has'](_0x228cba));return _0x3ac743['add'](_0x228cba),_0x228cba;}['getSelectionText'](){const {model:_0x4b9656}=Xs(this['context']),_0x23c43e=_0x4b9656['document']['selection'],_0x1420ba=[],_0x4669d1=Array['from'](_0x23c43e['getRanges']());_0x4669d1['sort']((_0x55e40f,_0x3e86f1)=>_0x55e40f['start']['isBefore'](_0x3e86f1['start'])?-0x1:0x1);for(const _0x533fd9 of _0x4669d1)for(const _0x5ce2e5 of _0x533fd9['getItems']())_0x5ce2e5['is']('$textProxy')?_0x1420ba['push'](_0x5ce2e5['data']):_0x5ce2e5['is']('element')&&_0x1420ba['length']>0x0&&'\x20'!==_0x1420ba[_0x1420ba['length']-0x1]&&_0x1420ba['push']('\x20');return _0x1420ba['length']?'\x22'+_0x1420ba['join']('')['trim']()+'\x22':us(this['context']['locale'],'AI_CHAT_CONTEXT_DOCUMENT_SELECTION_LABEL');}['_removeFakeSelectionById'](_0x1733e2){for(let _0x174a18=0x0;_0x174a18<this['_fakeSelections']['length'];_0x174a18++)if(this['_fakeSelections'][_0x174a18]['id']==_0x1733e2)return void this['_fakeSelections']['splice'](_0x174a18,0x1);}['_addFakeSelection'](_0x15fbde){this['_removeFakeSelectionById'](_0x15fbde['id']),wt(this['_fakeSelections'],_0x15fbde);}['_refreshFakeSelection'](_0x29d32d,_0x1b7ad0){if(_0x29d32d==_0x1b7ad0)return;const _0x5f174d=Xs(this['context']),_0x524ee0=_0x5f174d['model'];_0x524ee0['change'](_0x1bcd2f=>{if(_0x29d32d){const _0x101592=_0x5f174d['model']['markers']['getMarkersGroup'](Zs);for(const _0x286e58 of _0x101592)_0x1bcd2f['removeMarker'](_0x286e58);}if(_0x1b7ad0)for(let _0x204169=0x0;_0x204169<_0x1b7ad0['ranges']['length'];_0x204169++){let _0x19b327=_0x1b7ad0['ranges'][_0x204169];const _0x21b0f5=Zs+':'+_0x1b7ad0['id']+':'+_0x204169;if(_0x19b327['start']['isAtEnd']){const _0x1a9bbe=_0x19b327['start']['getLastMatchingPosition'](({item:_0x1599d2})=>!_0x524ee0['schema']['isContent'](_0x1599d2),{'boundaries':_0x19b327});_0x19b327=_0x1bcd2f['createRange'](_0x1a9bbe,_0x19b327['end']);}_0x1bcd2f['addMarker'](_0x21b0f5,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x19b327});}});}['_getMarkersInDocumentOrder'](){const _0x5ae624=Xs(this['context'])['model'];return Array['from'](_0x5ae624['markers']['getMarkersGroup'](Zs))['sort']((_0x2695ee,_0x1486e0)=>_0x2695ee['getStart']()['isBefore'](_0x1486e0['getStart']())?-0x1:_0x2695ee['getStart']()['isAfter'](_0x1486e0['getStart']())?0x1:0x0);}}const en=['showChangeInText','insertSuggestion','applySuggestion','rejectSuggestion','mouseOverSuggestion','mouseLeaveSuggestion','toggleSuggestionDisplayMode','like','dislike'],sn=[...en,'startConversation','resizeTabs','sendUserMessage','abortPromptStream','addDocumentToContext','addFileToContext','addUrlToContext','executeCustomItemCallback','addResourceToContext','removeContextItem','loadSourceResources','toggleWebSearch','toggleReasoning','selectModel'];class nn{['options'];['isStreaming']=!0x1;['document']=null;['nodesList']=[];['currentIndex']=0x0;['timeoutAbortController']=null;['lastUpdateTime']=0x0;constructor(_0xf6677c){this['options']={'delay':_0xf6677c['delay']??0x14,'textNodeStyle':_0xf6677c['textNodeStyle'],'onStreamUpdate':_0xf6677c['onStreamUpdate']||(()=>{})};}async['stream']({document:_0x363fbc,targetElement:_0x133f60,abortSignal:_0x518f0c}){this['isStreaming']&&this['stop'](),_0x518f0c?.['addEventListener']('abort',this['stop']['bind'](this)),this['document']=_0x857c03(_0x363fbc,!0x0),this['nodesList']=this['getParsedDocumentNodeList'](),this['isStreaming']=!0x0,this['currentIndex']>this['nodesList']['length']&&(this['currentIndex']=this['nodesList']['length']);for(let _0x361521=0x0;_0x361521<this['currentIndex'];_0x361521++)this['nodesList'][_0x361521]['shouldBeStreamed']=!0x0;do{const _0x364239=Date['now'](),_0x23fee2=this['nodesList'][this['currentIndex']],_0xa094a1=_0x364239-this['lastUpdateTime'];if(_0x23fee2){_0x23fee2['shouldBeStreamed']=!0x0;let _0x5121b1=_0x23fee2['parent'];for(;_0x5121b1;)_0x5121b1['shouldBeStreamed']=!0x0,_0x5121b1=_0x5121b1['parent'];}if(_0xa094a1<this['options']['delay'])try{const {promise:_0x9c222e,abortController:_0x155130}=hn(this['options']['delay']-_0xa094a1);this['timeoutAbortController']=_0x155130,await _0x9c222e;}catch(_0x19e011){return;}_0x2f4117(_0x133f60,'<'+_0x133f60['tagName']+'>'+this['renderNode'](this['document'])+'</'+_0x133f60['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:_0xbdd1b8}){Array['from'](_0xbdd1b8['querySelectorAll']('span[data-ck-html-streamer-word-chunk]'))['reverse']()['forEach'](_0x50226b=>{_0x50226b['replaceWith'](_0x50226b['childNodes'][0x0]);});}['stop'](){this['isStreaming']=!0x1,this['timeoutAbortController']&&(this['timeoutAbortController']['abort'](),this['timeoutAbortController']=null);}['renderNode'](_0x276d11){let _0x3eff9b='';if(function(_0x59c6ca){return _0x35d982(_0x59c6ca);}(_0x276d11)){for(const _0x3391ca of _0x276d11['children'])_0x3eff9b+=this['renderNode'](_0x3391ca);}else{if(on(_0x276d11)){if(!_0x276d11['shouldBeStreamed'])return'';const _0x146fa9=_0x276d11,_0x16f224=Object['entries'](_0x146fa9['attribs'])['map'](([_0x1cd31d,_0x28ae8f])=>_0x1cd31d+'=\x22'+_0x28ae8f+'\x22')['join']('\x20');_0x3eff9b+='<'+_0x146fa9['tagName']+(_0x16f224?'\x20'+_0x16f224:'')+'>';for(const _0x53be27 of ti(_0x146fa9))_0x3eff9b+=this['renderNode'](_0x53be27);_0x3eff9b+='</'+_0x146fa9['tagName']+'>';}else{if(!an(_0x276d11))return'';if(!_0x276d11['shouldBeStreamed'])return'';!function(_0x199ef4){if(!_0x199ef4['parent']||!on(_0x199ef4['parent']))return!0x1;if(!rn['includes'](_0x199ef4['parent']['tagName']))return!0x1;return!_0x19197f(_0x199ef4)['match'](/^\s*[<>]\s*$/);}(_0x276d11)?_0x3eff9b+=_0x208fec(_0x276d11):_0x3eff9b+=_0x208fec(new _0x359756('span',{'data-ck-html-streamer-word-chunk':'','style':this['options']['textNodeStyle']},[_0x276d11]));}}return _0x3eff9b;}['getParsedDocumentNodeList'](){const _0x2c14f4=[];return function(_0xebab53,_0x2af7d7){const _0x1b2b11=_0x43f9f9=>{if(_0x2af7d7(_0x43f9f9),_0x43f9f9 instanceof _0x3d43de)for(let _0x1e98b9=0x0;_0x1e98b9<_0x43f9f9['children']['length'];_0x1e98b9++){const _0x29d9c9=_0x43f9f9['children'][_0x1e98b9];_0x1b2b11(_0x29d9c9);}};for(let _0x2c74f9=0x0;_0x2c74f9<_0xebab53['children']['length'];_0x2c74f9++)_0x1b2b11(_0xebab53['children'][_0x2c74f9]);}(this['document'],_0x1746d4=>{if(an(_0x1746d4)){const _0x2f55bf=this['splitTextNodeIntoWordNodes'](_0x1746d4);_0x2f55bf['length']&&_0x2c14f4['push'](..._0x2f55bf);}_0x1746d4['isWordSplitSource']||_0x1746d4['isWordSplitResult']||_0x2c14f4['push'](_0x1746d4);}),_0x2c14f4;}['splitTextNodeIntoWordNodes'](_0x2bb6bf){if(_0x2bb6bf['isWordSplitSource']||_0x2bb6bf['isWordSplitResult'])return[];const _0x3609b2=_0x19197f(_0x2bb6bf)['match'](/(?:\s*\S+\s*)/g),_0x344c56=[];if(_0x3609b2&&_0x3609b2['length']>0x1){for(const _0x4d52c3 of _0x3609b2){const _0x35e6ef=new _0x111ade(_0x4d52c3);_0x35e6ef['isWordSplitResult']=!0x0,_0x5c4e1e(_0x2bb6bf,_0x35e6ef),_0x344c56['push'](_0x35e6ef);}_0x2bb6bf['isWordSplitSource']=!0x0,_0x4a6be4(_0x2bb6bf);}return _0x344c56;}}const rn=['p','li','td','th','span','h1','h2','h3','h4','h5','h6','b','strong','i','em','mark','del','ins','sup','sub','a','code','div'];function an(_0xe470a9){return _0x4dc3eb(_0xe470a9);}function on(_0x31c317){return _0x158702(_0x31c317);}function hn(_0x1dda3f){const _0x1b4a1b=new AbortController();return{'promise':new Promise((_0x4e82d1,_0x142f19)=>{const _0x12a40a=setTimeout(_0x4e82d1,_0x1dda3f);_0x1b4a1b['signal']['addEventListener']('abort',()=>{clearTimeout(_0x12a40a),_0x142f19();});}),'abortController':_0x1b4a1b};}class cn extends vt{['options'];['content']='';['htmlStreamer'];['children'];constructor(_0x4845fb){super();const _0x1f3b36=this['bindTemplate'];this['set']('isDone',!0x1),this['set']('isVisible',!0x0),this['htmlStreamer']=new nn({'textNodeStyle':'animation:\x20ck-html-streamer-fade-in\x20.5s','delay':0x14}),this['options']=_0x4845fb,this['children']=this['createCollection'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__item',_0x1f3b36['if']('isDone','ck-ai-chat__feed__item_done'),_0x1f3b36['if']('isVisible','ck-hidden',_0x3d1771=>!_0x3d1771),'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'](_0x2504df=>{_0x2504df['removeAttribute']('data-id');}),this['isDone']=!0x0;}async['streamIntoElement'](_0x2b2471,_0x5a01a5,_0x437462){await this['htmlStreamer']['stream']({'document':_0x2b2471,'targetElement':_0x5a01a5,'abortSignal':_0x437462});}}class ln extends vt{['showChangesToggleView'];constructor(_0x18ad84,_0x1a01e7){super(_0x18ad84),this['set']('isShowChangesToggleVisible',!0x0),this['showChangesToggleView']=new un(_0x18ad84),this['showChangesToggleView']['set']({'class':'ck-ai-suggestion__header__show-changes-toggle\x20ck-ai-chat-controls-button\x20'+As,'label':us(_0x18ad84,'AI_SUGGESTION_BUTTON_SHOW_CHANGES'),'withText':!0x0}),this['showChangesToggleView']['isOn']=_0x1a01e7['showDiff'],this['showChangesToggleView']['bind']('isVisible')['to'](this,'isShowChangesToggleVisible'),this['showChangesToggleView']['bind']('icon')['to'](this['showChangesToggleView'],'isOn',_0x35010a=>_0x35010a?_0x4a5aa5:_0xfbc311),this['showChangesToggleView']['on']('execute',()=>{this['showChangesToggleView']['isOn']=!this['showChangesToggleView']['isOn'],this['fire']('toggleShowChanges',{'isOn':this['showChangesToggleView']['isOn']});});const _0x335d51=new xt();_0x335d51['content']=_0xa5e512,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__header',!0x1===_0x1a01e7['showHeader']?'ck-hidden':null]['filter'](Boolean)},'children':[_0x335d51,{'tag':'span','children':[us(_0x18ad84,'AI_SUGGESTION_HEADER_TITLE')]},this['showChangesToggleView']]});}}class un extends Nt{['render'](){super['render'](),this['children']['remove'](this['iconView']),this['children']['add'](this['iconView']);}}const dn={'accepted':_0x503b53,'rejected':_0x1e153a,'outdated':_0x1e153a};class _n extends vt{['stateIconView'];constructor(_0x13fe1a){super(_0x13fe1a);const _0x5cc87a=this['bindTemplate'];this['set']('state','accepted'),this['set']('isVisible',!0x0),this['stateIconView']=new An(),this['stateIconView']['bind']('state')['to'](this),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__content-part-state',_0x5cc87a['to']('state',_0xfc9e80=>'ck-ai-suggestion__content-part-state_'+_0xfc9e80),_0x5cc87a['if']('isVisible','ck-hidden',_0x319884=>!_0x319884)]},'children':[{'tag':'span','attributes':{'class':['ck-ai-suggestion__content-part-state__label']},'children':[{'text':_0x5cc87a['to']('state',_0xb3eda5=>{switch(_0xb3eda5){case'accepted':return us(_0x13fe1a,'AI_SUGGESTION_CONTENT_PART_STATE_ACCEPTED');case'rejected':return us(_0x13fe1a,'AI_SUGGESTION_CONTENT_PART_STATE_REJECTED');case'outdated':return us(_0x13fe1a,'AI_SUGGESTION_CONTENT_PART_STATE_OUTDATED');}})}]},this['stateIconView']]});}['setState'](_0x4800a3){this['state']=_0x4800a3;}}class An extends xt{constructor(){super(),this['set']('state','accepted'),this['content']=dn[this['state']],this['on']('change:state',()=>{this['content']=dn[this['state']];});}}class gn extends kt{['_applyButton'];['_suggestButton'];constructor(_0x1bcb0b,_0x137fb3,_0x11bc22){super(_0x1bcb0b);const _0x55c340=Boolean(_0x11bc22);this['set']('isEnabled',!_0x55c340),this['set']('isVisible',!0x0),this['class']='ck-ai-suggestion-content-part-toolbar';const _0x166130=[];if(_0x55c340){const _0x1899f0=new Nt(_0x1bcb0b);_0x1899f0['set']({'label':us(_0x1bcb0b,'AI_SUGGESTION_DISABLED_TOOLTIP_MESSAGE'),'tooltip':!0x0,'tooltipPosition':'n','withText':!0x1,'icon':_0x293cf9}),_0x166130['push'](_0x1899f0);}else{_0x137fb3['includes']('applySuggestion')&&(this['_applyButton']=new Nt(_0x1bcb0b),this['_applyButton']['set']({'label':us(_0x1bcb0b,'AI_SUGGESTION_CONTENT_PART_APPLY'),'tooltip':!0x0,'tooltipPosition':'n','withText':!0x1,'icon':_0x503b53}),this['_applyButton']['bind']('isEnabled')['to'](this),this['_applyButton']['on']('execute',()=>{this['fire']('applySuggestion');}),_0x166130['push'](this['_applyButton'])),_0x137fb3['includes']('insertSuggestion')&&(this['_suggestButton']=new Nt(_0x1bcb0b),this['_suggestButton']['set']({'label':us(_0x1bcb0b,'AI_SUGGESTION_CONTENT_PART_ADD_SUGGESTION'),'tooltip':!0x0,'tooltipPosition':'n','withText':!0x1,'icon':_0x2009cd}),this['_suggestButton']['bind']('isEnabled')['to'](this),this['_suggestButton']['on']('execute',()=>{this['fire']('insertSuggestion');}),_0x166130['push'](this['_suggestButton']));const _0xda3c3=new Nt(_0x1bcb0b);_0xda3c3['set']({'label':us(_0x1bcb0b,'AI_SUGGESTION_CONTENT_PART_REJECT'),'tooltip':!0x0,'tooltipPosition':'n','withText':!0x1,'icon':_0x1e153a}),_0xda3c3['bind']('isEnabled')['to'](this),_0xda3c3['on']('execute',()=>{this['fire']('rejectSuggestion');}),_0x166130['push'](_0xda3c3);}this['items']['addMany'](_0x166130);const _0x21bcee=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':[_0x21bcee['if']('isVisible','ck-hidden',_0x3a65d6=>!_0x3a65d6)]}});}['setButtonsVisibility']({showApplyButton:_0x10340d,showSuggestButton:_0x5a6a9d}){this['_applyButton']&&(this['_applyButton']['isVisible']=_0x10340d),this['_suggestButton']&&(this['_suggestButton']['isVisible']=_0x5a6a9d);}}class In extends vt{['toolbarView'];['stateView'];['titleLabelView'];['children'];constructor(_0x5c8b9,{part:_0xa991e3,uiIndex:_0x3667cf,availableActions:_0x20eb51,areActionsDisabled:_0x456a08}){super(_0x5c8b9),this['set']('isEnabled',!0x0),this['set']('state','pending'),this['toolbarView']=new gn(_0x5c8b9,_0x20eb51,_0x456a08),this['toolbarView']['on']('rejectSuggestion',()=>{this['fire']('rejectSuggestion',{'index':_0xa991e3['index']});}),this['toolbarView']['on']('insertSuggestion',()=>{this['fire']('insertSuggestion',{'index':_0xa991e3['index']});}),this['toolbarView']['on']('applySuggestion',()=>{this['fire']('applySuggestion',{'index':_0xa991e3['index']});}),this['toolbarView']['bind']('isEnabled')['to'](this),this['stateView']=new _n(_0x5c8b9),this['titleLabelView']=new En(_0x5c8b9,_0x3667cf),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',(_0x51197e,_0x619a60,_0xdfea63,_0xb8ca12)=>{'pending'===_0xb8ca12?this['children']['remove'](this['toolbarView']):this['children']['remove'](this['stateView']),'pending'===_0xdfea63?this['children']['add'](this['toolbarView']):(this['stateView']['setState'](_0xdfea63),this['children']['add'](this['stateView']));});}}class En extends vt{constructor(_0x3d6c53,_0x47d9a3){super(_0x3d6c53),this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-suggestion__body__content-part__title__label']},'children':[us(_0x3d6c53,'AI_SUGGESTION_CONTENT_PART_TITLE',_0x47d9a3['toString']())]});}}class pn extends vt{['htmlStreamer'];constructor(_0x465a5f){super(_0x465a5f),this['htmlStreamer']=new nn({'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:_0xc20973,renderingStrategy:_0x7ee2ac,abortSignal:_0x218e8f}){'streaming'===_0x7ee2ac?await this['htmlStreamer']['stream']({'document':_0xc20973['content'],'targetElement':this['element'],'abortSignal':_0x218e8f}):this['element']['innerHTML']=Es(_0xc20973['content']);}['clear'](){this['htmlStreamer']['reset'](),this['element']['innerHTML']='';}}class Tn extends vt{['_children'];['_headerView'];['_streamableContentView'];constructor(_0x1ce962,{part:_0x3c5f68,uiIndex:_0x42cd60,areActionsDisabled:_0x3c6d31,availableActions:_0x16f405}){super(_0x1ce962);const _0x779d7d=this['bindTemplate'];this['set']('state','pending'),this['set']('isDone',!0x1),this['set']('isVisible',!0x1),this['set']('isActive',!0x1),this['set']('isEnabled',!0x1);const _0x220d01=()=>{this['isEnabled']=this['isDone']&&'pending'==this['state']&&!_0x3c6d31;};this['on']('change:state',_0x220d01),this['on']('change:isDone',_0x220d01),_0x220d01(),this['_children']=this['createCollection'](),this['_headerView']=new In(_0x1ce962,{'part':_0x3c5f68,'uiIndex':_0x42cd60,'availableActions':_0x16f405,'areActionsDisabled':_0x3c6d31}),this['_headerView']['bind']('isEnabled','state')['to'](this),this['_headerView']['delegate'](...en)['to'](this),this['_streamableContentView']=new pn(_0x1ce962),this['_children']['addMany']([this['_headerView'],this['_streamableContentView']]),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__body__content-part',_0x779d7d['to']('state',_0x566429=>'ck-ai-suggestion__body__content-part_'+_0x566429),_0x779d7d['if']('isEnabled','ck-ai-suggestion__body__content-part_enabled'),_0x779d7d['if']('isActive','ck-ai-suggestion__body__content-part_active'),_0x779d7d['if']('isVisible','ck-hidden',_0x35e7bd=>!_0x35e7bd)]},'children':this['_children'],'on':{'mouseenter':_0x779d7d['to'](()=>{this['isEnabled']&&this['fire']('mouseOverSuggestion',{'index':_0x3c5f68['index']});}),'mouseleave':_0x779d7d['to'](()=>{this['isEnabled']&&this['fire']('mouseLeaveSuggestion',{'index':_0x3c5f68['index']});}),'click':_0x779d7d['to'](_0x77960b=>{const _0x5269c7=_0x77960b['target'];this['isEnabled']&&!this['_headerView']['toolbarView']['element']['contains'](_0x5269c7)&&this['fire']('showChangeInText',{'index':_0x3c5f68['index']});})}});}async['updateContent']({part:_0x28a8de,renderingStrategy:_0xcca0b4,showUnchangedParts:_0x3a56c9=!0x1,abortSignal:_0x42c2fa}){this['partDefinition']=_0x28a8de,this['isVisible']=this['partDefinition']['hasChanges']||_0x3a56c9,this['isVisible']&&await this['_streamableContentView']['update']({'part':_0x28a8de,'renderingStrategy':_0xcca0b4,'abortSignal':_0x42c2fa});}['markAsDone'](){this['isDone']=!0x0;}}class mn extends pt(){['queue']=[];['isProcessing']=!0x1;['_abortController'];async['enqueue'](_0x85b197){const _0x4a4ee0=this['createTask'](_0x85b197);return this['queue']['push'](_0x4a4ee0),this['_processQueue'](),_0x4a4ee0['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(_0x138ca0=>{this['once']('_queueEmpty',()=>{_0x138ca0();});}):Promise['resolve']();}async['_processQueue'](){if(!this['isProcessing']){this['_abortController']=new AbortController(),this['isProcessing']=!0x0;try{for(;this['queue']['length']&&this['isProcessing'];){const _0x4ef55a=this['queue']['shift']();try{await _0x4ef55a['callback'](this['_abortController']['signal']),_0x4ef55a['resolve']();}catch(_0x25efeb){_0x4ef55a['reject'](_0x25efeb);}}}finally{this['isProcessing']=!0x1,this['_abortController']=void 0x0;}this['fire']('_queueEmpty');}}['createTask'](_0x2f51fa){let _0x45f81b,_0x564550;const _0x3063b1=new Promise((_0x1ad21d,_0x58adc9)=>{_0x45f81b=_0x1ad21d,_0x564550=_0x58adc9;});return{'callback':_0x2f51fa,'resolve':_0x45f81b,'reject':_0x564550,'completePromise':_0x3063b1};}}class Cn extends cn{constructor(_0x5b7bb0){super(_0x5b7bb0),this['extendTemplate']({'attributes':{'class':['ck-ai-notification','warning'===_0x5b7bb0['level']?'ck-ai-notification_warning':'ck-ai-notification_error']}});}['render'](){super['render'](),this['setContent'](this['options']['initialContent']),this['markAsDone']();}['setContent'](_0x3c70ef){this['element']['innerHTML']=_0x3c70ef;}}const wn=['applySuggestion','insertSuggestion'];class fn extends vt{['_applyChangesButton'];['_insertSuggestionsButton'];['children'];constructor(_0x2831ab,_0x2974f4=[...wn],_0x4f8193){super(_0x2831ab);const _0x1bdb8d=this['bindTemplate'],_0x252be6=Boolean(_0x4f8193);if(this['set']('isEnabled',!_0x252be6),this['set']('isVisible',!0x1),this['set']('isTrackChangesOn',!0x1),this['children']=this['createCollection'](),_0x252be6){const _0x541d4c=new Nt(_0x2831ab);_0x541d4c['set']({'label':us(_0x2831ab,'AI_SUGGESTION_DISABLED_TOOLTIP_MESSAGE'),'tooltip':!0x0,'tooltipPosition':'n','withText':!0x1,'icon':_0x293cf9});const _0x4712b3=new vt(_0x2831ab);_0x4712b3['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-chat__feed__suggestion__actions__info'},'children':[{'tag':'p','children':[us(_0x2831ab,'AI_SUGGESTION_DISABLED_FEED_MESSAGE'),_0x541d4c]}]}),this['children']['add'](_0x4712b3);}else this['_applyChangesButton']=new Nt(_0x2831ab),this['_applyChangesButton']['set']({'label':us(_0x2831ab,'AI_CHAT_SUGGESTION_ACTION_APPLY_ALL'),'withText':!0x0,'type':'button','isVisible':_0x2974f4['includes']('applySuggestion'),'class':ds}),this['_insertSuggestionsButton']=new Nt(_0x2831ab),this['_insertSuggestionsButton']['set']({'label':us(_0x2831ab,'AI_CHAT_SUGGESTION_ACTION_SUGGEST_ALL'),'withText':!0x0,'type':'button','isVisible':_0x2974f4['includes']('insertSuggestion'),'class':_s}),this['_insertSuggestionsButton']['on']('execute',()=>{this['fire']('insertSuggestion');}),this['_applyChangesButton']['on']('execute',()=>{this['fire']('applySuggestion');}),[this['_applyChangesButton'],this['_insertSuggestionsButton']]['forEach'](_0x6f3956=>{_0x6f3956['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',_0x1bdb8d['if']('isVisible','ck-hidden',_0x2eac2c=>!_0x2eac2c)]},'children':this['children']}),this['on']('change:isTrackChangesOn',()=>{this['_applyChangesButton']&&(this['_applyChangesButton']['isVisible']=!this['isTrackChangesOn']);});}['updateVisibility'](_0x3c9884){this['isVisible']=_0x3c9884;}['_switchButtonLabelsPlurality'](_0x216622){this['_applyChangesButton']&&this['_insertSuggestionsButton']&&(_0x216622?(this['_applyChangesButton']['label']=us(this['locale'],'AI_CHAT_SUGGESTION_ACTION_APPLY_ALL'),this['_insertSuggestionsButton']['label']=us(this['locale'],'AI_CHAT_SUGGESTION_ACTION_SUGGEST_ALL')):(this['_applyChangesButton']['label']=us(this['locale'],'AI_CHAT_SUGGESTION_ACTION_APPLY'),this['_insertSuggestionsButton']['label']=us(this['locale'],'AI_CHAT_SUGGESTION_ACTION_SUGGEST')));}}class Sn extends vt{['children'];['balloonPanelView'];['bodyCollection'];constructor(_0x398057,_0x35734f){super(_0x398057),this['bodyCollection']=_0x35734f,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',_0x4efbe4=>!_0x4efbe4)]},'children':this['children']});const _0x3ba343=new vt(this['locale']),_0x4e8240=new xt();_0x4e8240['content']=_0x43b9e2,_0x3ba343['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-web-sources__header']},'children':[_0x4e8240,{'tag':'span','children':[{'text':us(this['locale'],'AI_CHAT_SOURCES_HEADER')}]}]}),this['children']['add'](_0x3ba343),this['_setupBalloonPanel'](_0x398057);}['addSource'](_0x534510){this['children']['add'](new bn(this['locale'],_0x534510,this['balloonPanelView']));}['_setupBalloonPanel'](_0x49b2ee){this['balloonPanelView']=new Xt(_0x49b2ee),this['balloonPanelView']['extendTemplate']({'attributes':{'class':['ck-ai-web-source__tooltip-balloon']}}),this['bodyCollection']['add'](this['balloonPanelView']);}}class bn extends Nt{['balloonPanelView'];['source'];constructor(_0x39f9bd,_0xa0a95f,_0x3db1f6){super(_0x39f9bd),this['source']=_0xa0a95f,this['balloonPanelView']=_0x3db1f6,this['set']({'label':_0xa0a95f['title'],'class':['ck\x20ck-ai-web-source'],'withText':!0x0});const _0x12ff32=this['bindTemplate'];if(this['extendTemplate']({'on':{'click':_0x12ff32['to'](()=>{window['open'](_0xa0a95f['url'],'_blank');}),'mouseenter':_0x12ff32['to'](()=>{this['_showTooltip']();}),'mouseleave':_0x12ff32['to'](()=>{this['_hideTooltip']();})}}),_0xa0a95f['favicon']){const _0x51bce1=new vt(_0x39f9bd);_0x51bce1['setTemplate']({'tag':'img','attributes':{'src':_0xa0a95f['favicon']||_0x43b9e2,'alt':_0xa0a95f['title'],'class':['ck-ai-web-source__image']}}),this['children']['add'](_0x51bce1);}else this['set']('icon',_0x43b9e2);}['_createTooltipContentView'](_0x440240,_0x3405e1){const _0x185085=new vt(_0x440240),_0x1565d6=[];let _0x455139;_0x3405e1?.['favicon']?(_0x455139=new vt(_0x440240),_0x455139['setTemplate']({'tag':'img','attributes':{'src':_0x3405e1['favicon'],'alt':_0x3405e1['title'],'class':['ck-ai-web-source__tooltip-image']}})):(_0x455139=new xt(),_0x455139['content']=_0x43b9e2,_0x455139['extendTemplate']({'attributes':{'alt':_0x3405e1['title'],'class':['ck-ai-web-source__tooltip-image']}})),_0x1565d6['push'](_0x455139);const _0x54eb5a=new vt(_0x440240);_0x54eb5a['setTemplate']({'tag':'a','attributes':{'class':['ck-ai-web-source__tooltip-url'],'href':_0x3405e1['url']},'children':[{'text':new URL(_0x3405e1['url'])?.['hostname']}]}),_0x1565d6['push'](_0x54eb5a);const _0x29fb68=new vt(_0x440240);_0x29fb68['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-web-source__tooltip-row']},'children':_0x1565d6});const _0x547c90=new vt(_0x440240);return _0x547c90['setTemplate']({'tag':'span','attributes':{'class':['ck-ai-web-source__tooltip-row','ck-ai-web-source__tooltip-title']},'children':[{'text':_0x3405e1['title']['length']>0x190?_0x3405e1['title']['substring'](0x0,0x190)+'...':_0x3405e1['title']}]}),_0x185085['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-web-source__tooltip']},'children':[_0x29fb68,_0x547c90]}),_0x185085;}['_showTooltip'](){this['_updateTooltipContent'](),this['balloonPanelView']['pin']({'target':this['element'],'positions':[Xt['defaultPositions']['northArrowSouth'],Xt['defaultPositions']['northArrowSouthWest'],Xt['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 _0x4dbdf7=this['_createTooltipContentView'](this['locale'],this['source']);this['balloonPanelView']['content']['add'](_0x4dbdf7);}}class Rn extends vt{['_actionsView'];['_sourcesView'];['_children'];['_areActionsDisabled'];['_showUnchangedParts'];['_updateContentPartsPromiseQueue'];['_emptyPartsWarningView'];['_availableActions'];['_cachedContentParts']=[];constructor(_0x59d08e,_0x18e673){super(_0x59d08e);const {areActionsDisabled:_0x2333d5,showUnchangedParts:_0x106732,availableActions:_0x335c1c}=_0x18e673;this['_areActionsDisabled']=_0x2333d5,this['_showUnchangedParts']=_0x106732,this['_availableActions']=_0x335c1c,this['set']('hasPendingParts',!0x1),this['set']('isTrackChangesOn',!0x1),this['_children']=this['createCollection'](),this['_updateContentPartsPromiseQueue']=new mn(),this['_emptyPartsWarningView']=new Cn({'id':'empty-parts-warning','initialContent':us(_0x59d08e,'AI_SUGGESTION_EMPTY_PART_WARNING'),'level':'warning'}),this['_emptyPartsWarningView']['isVisible']=!0x1,this['_actionsView']=new fn(_0x59d08e,_0x18e673['availableActions'],this['_areActionsDisabled']),this['_actionsView']['bind']('isTrackChangesOn')['to'](this),this['_sourcesView']=new Sn(this['locale'],_0x18e673['bodyCollection']),_0x18e673['areActionsDisabled']?this['_actionsView']['isEnabled']=!0x1:this['_actionsView']['bind']('isEnabled')['to'](this,'hasPendingParts'),this['_actionsView']['delegate'](...en)['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:_0x58c216,renderingStrategy:_0x1e9647,abortSignal:_0x358cd8}){this['_children']['length']?_0x58c216['forEach'](_0x292238=>{const _0x40b873=this['_cachedContentParts']['findIndex'](_0x84ebdb=>_0x84ebdb['index']==_0x292238['index']);-0x1===_0x40b873?this['_cachedContentParts']['push'](_0x292238):this['_cachedContentParts'][_0x40b873]=_0x292238;}):this['_cachedContentParts']=_0x58c216;const _0x32930f=this['_showUnchangedParts']?_0x58c216:_0x58c216['filter'](_0x18e4a0=>_0x18e4a0['hasChanges']);this['_actionsView']['_switchButtonLabelsPlurality'](_0x32930f['length']>0x1);for(const _0x3de11e of _0x32930f)this['_updateContentPartsPromiseQueue']['enqueue'](async _0x206af8=>{let _0x5a83b5=this['getPartView'](_0x3de11e['index']);_0x5a83b5||(_0x5a83b5=new Tn(this['locale'],{'part':_0x3de11e,'uiIndex':this['_children']['length']+0x1,'areActionsDisabled':this['_areActionsDisabled'],'availableActions':this['_availableActions']}),_0x5a83b5['delegate'](...en)['to'](this),this['_children']['add'](_0x5a83b5),this['hasPendingParts']=!0x0),await _0x5a83b5['updateContent']({'part':_0x3de11e,'renderingStrategy':_0x1e9647,'showUnchangedParts':this['_showUnchangedParts'],'abortSignal':_0x206af8}),_0x5a83b5['markAsDone']();});return _0x358cd8?.['addEventListener']('abort',()=>{this['_updateContentPartsPromiseQueue']['abort']();}),this['_updateContentPartsPromiseQueue']['queueEmptyPromise'];}['updatePartState'](_0x10ebcd,_0x349c02){const _0x1346d0=this['getPartView'](_0x10ebcd);_0x1346d0&&(_0x1346d0['state']=_0x349c02),this['hasPendingParts']='pending'==_0x349c02||Array['from'](this['_children'])['some'](_0x234367=>'pending'==_0x234367['state']);}['setPartActive'](_0x3483a0,_0x300c5c){if(!0x1===_0x3483a0){for(const _0x2276f1 of this['_children'])_0x2276f1['isActive']=!0x1;}else{const _0x2fa7dc=this['getPartView'](_0x3483a0);_0x2fa7dc&&(_0x2fa7dc['isActive']=_0x300c5c);}}['updateSources'](_0x30d767){_0x30d767['forEach'](_0x5f364a=>this['_sourcesView']['addSource'](_0x5f364a)),this['_sourcesView']['isVisible']=!0x0;}['getPartView'](_0x11fc2b){return this['_children']['find'](_0x5e6c94=>_0x5e6c94['partDefinition']['index']==_0x11fc2b)??null;}['markAsDone'](){if(!this['_showUnchangedParts']){const _0x44bd31=!this['_cachedContentParts']['find'](({hasChanges:_0x30157c})=>_0x30157c),_0x59e9c6=!!this['_cachedContentParts']['find'](({hasChanges:_0x4637a7})=>!_0x4637a7);this['_emptyPartsWarningView']['isVisible']=0x0==this['_children']['length']||_0x59e9c6,_0x44bd31?this['_emptyPartsWarningView']['setContent'](us(this['locale'],'AI_SUGGESTION_NO_PARTS_WARNING')):this['_emptyPartsWarningView']['setContent'](us(this['locale'],'AI_SUGGESTION_EMPTY_PART_WARNING'));}this['_children']['forEach'](_0xea556e=>_0xea556e['markAsDone']()),this['_actionsView']['updateVisibility'](this['hasNonEmptyParts']);}get['hasNonEmptyParts'](){return this['_children']['filter'](_0x345e6a=>_0x345e6a['partDefinition']['hasChanges'])['length']>0x0;}}class On extends vt{['bodyView'];['children'];['headerView'];constructor(_0xca101d,_0x515997,_0x480154){super(_0xca101d);const {showDiff:_0x4bd546,areActionsDisabled:_0x4284f8,showUnchangedParts:_0x2fc9ab,availableActions:_0x5e3915}=_0x515997;this['set']('isTrackChangesOn',!0x1),this['set']('areChangesVisible',!0x1),this['children']=this['createCollection'](),this['headerView']=new ln(_0xca101d,{'showDiff':_0x4bd546}),this['headerView']['on']('toggleShowChanges',(_0x4aee4f,_0x3c1114)=>{this['areChangesVisible']=_0x3c1114['isOn'],this['fire']('toggleSuggestionDisplayMode',{'showDiff':_0x3c1114['isOn']});}),this['children']['add'](this['headerView']),this['bodyView']=new Rn(_0xca101d,{'areActionsDisabled':_0x4284f8,'showUnchangedParts':!!_0x2fc9ab,'availableActions':_0x5e3915,'bodyCollection':_0x480154}),this['bodyView']['delegate'](...en)['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'](_0xf16c94){await this['bodyView']['updateContentParts'](_0xf16c94);}['updateSources'](_0x35b721){this['bodyView']['updateSources'](_0x35b721);}['markAsDone'](){this['bodyView']['markAsDone'](),this['headerView']&&(this['headerView']['isShowChangesToggleVisible']=this['bodyView']['hasNonEmptyParts']);}}class kn extends cn{['containerView'];constructor(_0x4edc,_0x1cc3c7,_0x30c060){super(_0x1cc3c7),this['set']('isTrackChangesOn',!0x1),this['containerView']=new On(_0x4edc,{'showDiff':_0x1cc3c7['showDiff'],'areActionsDisabled':_0x1cc3c7['areActionsDisabled'],'availableActions':_0x1cc3c7['availableActions']},_0x30c060),this['containerView']['on']('toggleSuggestionDisplayMode',(_0x9e64d5,_0x5ba74a)=>{this['fire']('toggleSuggestionDisplayMode',{'replyId':this['options']['id'],'showDiff':_0x5ba74a['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',(_0x204939,{index:_0x216633})=>{this['fire']('showChangeInText',{'replyId':this['options']['id'],'partIndex':_0x216633});}),this['containerView']['on']('applySuggestion',(_0x8cf18a,{index:_0x37a9d8}={})=>{this['fire']('applySuggestion',{'replyId':this['options']['id'],'partIndex':_0x37a9d8});}),this['containerView']['on']('insertSuggestion',(_0x507ac3,{index:_0x5ee293}={})=>{this['fire']('insertSuggestion',{'replyId':this['options']['id'],'partIndex':_0x5ee293});}),this['containerView']['on']('rejectSuggestion',(_0x341947,{index:_0x514f7b})=>{this['fire']('rejectSuggestion',{'replyId':this['options']['id'],'partIndex':_0x514f7b});}),this['containerView']['on']('mouseOverSuggestion',(_0x587977,{index:_0x5323da})=>{this['fire']('mouseOverSuggestion',{'replyId':this['options']['id'],'partIndex':_0x5323da});}),this['containerView']['on']('mouseLeaveSuggestion',(_0x3be2de,{index:_0x4fcc52})=>{this['fire']('mouseLeaveSuggestion',{'replyId':this['options']['id'],'partIndex':_0x4fcc52});}),this['children']['addMany']([this['containerView']]),this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__ai-suggestion']}});}async['updateContent'](_0x571a75){await this['containerView']['updateContent'](_0x571a75);}['updatePartState'](_0x5e4c01,_0x11f496){this['containerView']['bodyView']['updatePartState'](_0x5e4c01,_0x11f496);}['setPartActive'](_0x4934fc,_0x3f7b08){!0x1===_0x4934fc?this['containerView']['bodyView']['setPartActive'](!0x1):this['containerView']['bodyView']['setPartActive'](_0x4934fc,_0x3f7b08);}['updateSources'](_0xbce7b7){this['containerView']['updateSources'](_0xbce7b7);}['getPartView'](_0x232598){return this['containerView']['bodyView']['getPartView'](_0x232598);}['markAsDone'](){super['markAsDone'](),this['containerView']['markAsDone']();}}class Nn extends cn{['replyContainer'];['_bodyCollection'];constructor(_0x4522b2,_0x58c496,_0xc9acb7){super(_0x58c496),this['_bodyCollection']=_0xc9acb7,this['locale']=_0x4522b2,this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__ai-reply']}}),this['replyContainer']=new vt(),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':Is(this['options']['initialContent']),'renderingStrategy':'static'}),this['markAsDone']());}async['updateContent']({parsedContent:_0x5e0f62,renderingStrategy:_0x3ce7c0,abortSignal:_0x2a1540}){'streaming'===_0x3ce7c0?await this['streamIntoElement'](_0x5e0f62,this['replyContainer']['element'],_0x2a1540):this['replyContainer']['element']['innerHTML']=_0x208fec(_0x5e0f62);}['updateSources'](_0x441097){const _0x2e319a=new Sn(this['locale'],this['_bodyCollection']);_0x2e319a['children']['addMany'](_0x441097['map'](_0x3d7abc=>new bn(this['locale'],_0x3d7abc,_0x2e319a['balloonPanelView']))),_0x2e319a['isVisible']=!0x0,this['children']['add'](_0x2e319a);}}class vn extends yt{constructor(_0x43cbb5=void 0x0){super();const _0x22bb62=_0x43cbb5?'ck-ai-spinner_'+_0x43cbb5:'';this['extendTemplate']({'tag':'span','attributes':{'class':['ck-ai-spinner',_0x22bb62]}});}}const yn={'file':_0x33be6f,'document':_0xa5e512,'web-resource':_0x1091b0,'text':_0x33be6f,'selection':_0x5f35af,'mcp-tool-context':_0xa5e512},xn='ck-ai-chat-context-chip',Ln='ck-ai-chat-context-chip_wide',Dn='ck-ai-chat-context-chip_document',Pn='ck-ai-chat-context-chip__label',Hn='ck-ai-chat-context-chip__type-icon',Mn='ck-ai-chat-context-controls__chip-tooltip',Un='n';class Vn extends Nt{constructor(_0x5bd17b,_0x1318b4,_0x3bbb10,_0x57d4bb,_0x979208=!0x1){super(_0x5bd17b),this['_isAnimationOnEnterEnabled']=_0x57d4bb,this['_initializeProperties'](_0x1318b4,_0x3bbb10,_0x979208),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'](_0x281e28,_0x59bf74,_0x4a1124){this['set']('label',_0x281e28['label']),this['set']('tooltip',!0x0),this['set']('itemType',_0x281e28['type']),this['set']('id',_0x281e28['uiId']),this['set']('readonly',_0x59bf74),this['set']('isLoading',_0x4a1124);}['_setupTemplate'](){const _0x34f64a=this['_createIconView'](),_0xd125c1=this['_createRemoveButton'](),_0x310797=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':this['_createTemplateAttributes'](_0x310797),'children':this['_createTemplateChildren'](_0x34f64a,_0xd125c1,_0x310797)});}['_createTemplateAttributes'](_0x18c927){return{'class':[xn,_0x18c927['if']('itemType',Dn,_0x581922=>'document'==_0x581922),_0x18c927['if']('itemType',Ln,_0x1f4acf=>'selection'==_0x1f4acf)],'data-cke-tooltip-text':_0x18c927['to']('label',Bn),'data-cke-tooltip-position':Un,'data-cke-tooltip-class':Mn};}['_createTemplateChildren'](_0xfcd599,_0x5a49eb,_0x2a5b4d){const _0x25f584=this['_createLabelElement'](_0x2a5b4d),_0x2d07a7=this['_createLoaderIcon']();return this['readonly']?[_0xfcd599,_0x25f584]:[_0xfcd599,_0x2d07a7,_0x25f584,_0x5a49eb];}['_createLabelElement'](_0xd8191b){return{'tag':'span','attributes':{'class':Pn},'children':[{'text':_0xd8191b['to']('label')}]};}['_createRemoveButton'](){const _0x2c269e=new Nt(this['locale']);return _0x2c269e['set']({'label':us(this['locale'],'AI_CHAT_CONTEXT_REMOVE_FROM_CONTEXT'),'icon':_0x4310eb}),this['_setupRemoveButtonEvent'](_0x2c269e),_0x2c269e;}['_setupRemoveButtonEvent'](_0x39bed6){_0x39bed6['on']('execute',()=>{this['fire']('removeContextItemChip',this['id']);});}['_createIconView'](){const _0x2c4b32=this['bindTemplate'],_0x305075=new xt();return _0x305075['content']=yn[this['itemType']],_0x305075['extendTemplate']({'attributes':{'class':[Hn,_0x2c4b32['if']('isLoading','ck-hidden',_0x5c8971=>_0x5c8971)]}}),_0x305075;}['_handleAnimationEndOnce'](_0x31abdf,_0x3733d7){if(!_0x31abdf)return;const _0x58155e=()=>{_0x3733d7(),_0x31abdf['removeEventListener']('animationend',_0x58155e),_0x31abdf['removeEventListener']('webkitAnimationEnd',_0x58155e);};_0x31abdf['addEventListener']('animationend',_0x58155e),_0x31abdf['addEventListener']('webkitAnimationEnd',_0x58155e);}['_createLoaderIcon'](){const _0x424cf6=new vn('small');return _0x424cf6['bind']('isVisible')['to'](this,'isLoading',_0x45027d=>_0x45027d),_0x424cf6;}}function Bn(_0x2c9ae8){if(!_0x2c9ae8)return _0x2c9ae8;if(_0x2c9ae8['length']<=0x78)return _0x2c9ae8;const _0xf03497=_0x2c9ae8['slice'](0x0,0x78),_0xe9a3ca=_0xf03497['lastIndexOf']('\x20');return(_0xe9a3ca>0x0?_0xf03497['slice'](0x0,_0xe9a3ca):_0xf03497)+'…';}const Gn={'maxVisibleRows':0x2,'rowDetectionTolerance':0x5,'showMoreLabelPrefix':'+\x20','viewportOffset':{'top':0x64,'bottom':0xa}},Fn='300px';class Kn{['_locale'];['_config'];['_visibleChips'];['_overflowChips'];['_showMoreButtonView']=null;['_showMoreBalloonPanelView']=null;['_containerElement']=null;['_bodyCollection'];['_parentView']=null;['_intersectionObserver']=null;['_pendingCalculation']=!0x1;constructor(_0x46d860,_0x292992,_0x3b4fa0,_0x32d4c0,_0x3c2dc6){this['_locale']=_0x46d860,this['_visibleChips']=_0x292992,this['_config']={...Gn,..._0x3b4fa0,'cssClasses':{'controlsButton':'','calculationContainer':'ck-calculation-container',..._0x3b4fa0['cssClasses']}},this['_overflowChips']=new _t(),this['_bodyCollection']=_0x32d4c0,this['_parentView']=_0x3c2dc6||null;}['setContainerElement'](_0x3c0926){this['_intersectionObserver']&&(this['_intersectionObserver']['disconnect'](),this['_intersectionObserver']=null),this['_containerElement']=_0x3c0926,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 _0x5e978c=[...this['_visibleChips'],...this['_overflowChips']],_0x110b35=this['_createCalculationContainer'](),_0x59a9ef=this['_calculateOverflowInContainer'](_0x110b35,_0x5e978c),_0x35dfc0=_0x110b35['_ancestorsToRestore'];_0x35dfc0&&this['_restoreAncestorVisibility'](_0x35dfc0),_0x110b35['remove'](),this['_applyOverflowResults'](_0x5e978c,_0x59a9ef);}['_createShowMoreButton'](){this['_showMoreButtonView']=this['_createShowMoreButtonView'](),this['_showMoreBalloonPanelView']=this['_createShowMoreBalloonPanelView'](),this['_showMoreButtonView']['render'](),this['_containerElement']['appendChild'](this['_showMoreButtonView']['element']),this['_showMoreButtonView']['on']('execute',()=>{this['_handleShowMoreButtonClick']();}),zt({'emitter':this['_showMoreBalloonPanelView'],'contextElements':[this['_showMoreBalloonPanelView']['element'],this['_showMoreButtonView']['element']],'callback':()=>this['hideBalloonPanel'](),'activator':()=>this['_showMoreButtonView']['isOn']});}['_createShowMoreButtonView'](){const _0x223386=new Nt(this['_locale']);_0x223386['set']({'label':'','withText':!0x0,'isToggleable':!0x0});const _0x22dc0c=[this['_config']['cssClasses']['showMoreButton']];return this['_config']['cssClasses']['controlsButton']&&_0x22dc0c['push'](this['_config']['cssClasses']['controlsButton']),_0x223386['extendTemplate']({'attributes':{'class':_0x22dc0c}}),_0x223386;}['_createShowMoreBalloonPanelView'](){const _0x3af200=new Xt(this['_locale']);return _0x3af200['extendTemplate']({'attributes':{'class':this['_config']['cssClasses']['showMoreBalloon']}}),this['_bodyCollection']['add'](_0x3af200),_0x3af200;}['_updateBalloonContent'](){if(this['_showMoreBalloonPanelView']&&(this['_showMoreBalloonPanelView']['content']['clear'](),this['_overflowChips']['length']>0x0)){this['_overflowChips']['forEach'](_0x35e826=>{_0x35e826['disableAnimationOnEnter']();});const _0x8197fe=new vt(this['_locale']);_0x8197fe['setTemplate']({'tag':'div','attributes':{'class':this['_config']['cssClasses']['overflowContainer']},'children':this['_overflowChips']}),this['_showMoreBalloonPanelView']['content']['add'](_0x8197fe);}}['_handleShowMoreButtonClick'](){this['_showMoreButtonView']['isOn']?this['hideBalloonPanel']():this['showBalloonPanel']();}['_updateShowMoreButtonVisibility'](){const _0x3ed389=this['_overflowChips']['length']>0x0;this['_showMoreButtonView']?.['element']&&(this['_showMoreButtonView']['element']['style']['display']=_0x3ed389?'':'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'](_0x1ac35a){const _0x3ebcf8=this['_containerElement']?.['tagName']['toLowerCase']()||'div',_0x2b5ad3=this['_containerElement']?.['classList'];if(_0x2b5ad3){const _0x4292d2=_0x2b5ad3[0x0]||'',_0x13556d=_0x1ac35a['querySelector']('.'+_0x4292d2),_0x51c3f3=_0x1ac35a['querySelector'](_0x3ebcf8);return _0x13556d||_0x51c3f3||_0x1ac35a;}return _0x1ac35a['querySelector'](_0x3ebcf8)||_0x1ac35a;}['_calculateContainerWidth'](){const _0x377730=this['_parentView']?.['element']||this['_containerElement'];if(!_0x377730)return Fn;const _0x2dcca8=window['getComputedStyle'](_0x377730)['width'];if('auto'===_0x2dcca8||'0px'===_0x2dcca8||!_0x2dcca8){const _0x5b0cbe=_0x377730['parentElement'];if(_0x5b0cbe){const _0xc0d532=window['getComputedStyle'](_0x5b0cbe);return'auto'!==_0xc0d532['width']?_0xc0d532['width']:Fn;}return Fn;}return _0x2dcca8;}['_applyCalculationStyles'](_0x44c4fd,_0x4f5ccf){this['_config']['cssClasses']['calculationContainer']&&_0x44c4fd['classList']['add'](this['_config']['cssClasses']['calculationContainer']),_0x44c4fd['style']['width']=_0x4f5ccf,_0x44c4fd['style']['position']='absolute',_0x44c4fd['style']['top']='-9999px',_0x44c4fd['style']['left']='-9999px',_0x44c4fd['style']['opacity']='0',_0x44c4fd['style']['pointerEvents']='none',_0x44c4fd['style']['zIndex']='-1',_0x44c4fd['style']['visibility']='visible\x20!important',_0x44c4fd['style']['display']='block\x20!important',_0x44c4fd['style']['boxSizing']='border-box';}['_restoreAncestorVisibility'](_0x4ecaa8){_0x4ecaa8['forEach'](({element:_0x5d006f,originalDisplay:_0x4e92cd,originalVisibility:_0x1325f7})=>{_0x5d006f['style']['display']=_0x4e92cd,_0x5d006f['style']['visibility']=_0x1325f7;});}['_makeAncestorsVisible'](_0x4c01f8){const _0x5298db=[];let _0x126a33=_0x4c01f8;for(;_0x126a33&&_0x126a33!==document['body'];){const _0x3fcc07=window['getComputedStyle'](_0x126a33);'none'!==_0x3fcc07['display']&&'hidden'!==_0x3fcc07['visibility']||(_0x5298db['push']({'element':_0x126a33,'originalDisplay':_0x126a33['style']['display'],'originalVisibility':_0x126a33['style']['visibility']}),_0x126a33['style']['display']='block',_0x126a33['style']['visibility']='visible'),_0x126a33=_0x126a33['parentElement'];}return _0x5298db;}['_createContainerElements'](){let _0x343261,_0x1d3cfa;return this['_parentView']?.['element']?(_0x343261=this['_parentView']['element']['cloneNode'](!0x0),_0x1d3cfa=this['_findTargetContainer'](_0x343261)):(_0x343261=document['createElement']('div'),_0x1d3cfa=_0x343261),{'calculationContainer':_0x343261,'targetContainer':_0x1d3cfa};}['_createCalculationContainer'](){const {calculationContainer:_0x8b241e,targetContainer:_0x3a16b2}=this['_createContainerElements'](),_0x3ca76c=this['_calculateContainerWidth']();this['_applyCalculationStyles'](_0x8b241e,_0x3ca76c);const _0x19c6b9=this['_parentView']?.['element']||this['_containerElement'],_0x55ab0a=_0x19c6b9?.['parentElement'];_0x55ab0a?_0x55ab0a['appendChild'](_0x8b241e):document['body']['appendChild'](_0x8b241e),_0x8b241e['_targetContainer']=_0x3a16b2;const _0x2c5f7c=this['_makeAncestorsVisible'](_0x55ab0a||null);return _0x8b241e['offsetWidth'],_0x8b241e['_ancestorsToRestore']=_0x2c5f7c,_0x8b241e;}['_calculateOverflowInContainer'](_0x1fe130,_0x3ee518){const _0x36bae2=_0x1fe130['_targetContainer']||_0x1fe130,_0x481a5a=[],{rowCount:_0x5bba35}=this['_renderChipsAndCountRows'](_0x36bae2,_0x3ee518);if(_0x5bba35<=this['_config']['maxVisibleRows'])return _0x481a5a;const _0x5b8e65=_0x3ee518['slice']();for(;_0x5b8e65['length']>0x0;){if(this['_testButtonFit'](_0x1fe130,_0x36bae2,_0x5b8e65)){const _0x5206e3=_0x3ee518['filter'](_0x4d3fe9=>!_0x5b8e65['includes'](_0x4d3fe9));_0x481a5a['push'](..._0x5206e3);break;}if(!_0x5b8e65['pop']())break;}return _0x481a5a;}['_renderChipsAndCountRows'](_0x2c4b92,_0x2c1735){_0x2c4b92['innerHTML']='',_0x2c1735['forEach'](_0x10f776=>{if(_0x10f776['element']){const _0x12f6b8=_0x10f776['element']['cloneNode'](!0x0);_0x2c4b92['appendChild'](_0x12f6b8);}}),_0x2c4b92['offsetWidth'];const _0x42c45d=_0x2c4b92['children'],_0x373fe4=[];return Array['from'](_0x42c45d)['forEach'](_0x4a272e=>{const _0x5149fa=_0x4a272e['getBoundingClientRect']()['top'];_0x373fe4['some'](_0x3c9a6c=>Math['abs'](_0x3c9a6c-_0x5149fa)<this['_config']['rowDetectionTolerance'])||_0x373fe4['push'](_0x5149fa);}),{'rowCount':_0x373fe4['length']};}['_createMockButton'](){const _0x2619d0=document['createElement']('button');return _0x2619d0['className']=this['_config']['cssClasses']['showMoreButton'],this['_config']['cssClasses']['controlsButton']&&_0x2619d0['classList']['add'](this['_config']['cssClasses']['controlsButton']),_0x2619d0['textContent']='+\x201',_0x2619d0;}['_testButtonFit'](_0x38720e,_0x2edc3a,_0x352de9){this['_renderChipsAndCountRows'](_0x2edc3a,_0x352de9);const _0x491127=this['_createMockButton']();_0x38720e['appendChild'](_0x491127),_0x38720e['offsetWidth'];const _0x28e2ae=[..._0x2edc3a['children'],_0x491127],_0xd81d79=[];_0x28e2ae['forEach'](_0x3d79af=>{const _0x43f8a8=_0x3d79af['getBoundingClientRect']()['top'];_0xd81d79['some'](_0x32ea6a=>Math['abs'](_0x32ea6a-_0x43f8a8)<this['_config']['rowDetectionTolerance'])||_0xd81d79['push'](_0x43f8a8);});const _0x531c40=_0xd81d79['length'];return _0x491127['remove'](),_0x531c40<=this['_config']['maxVisibleRows'];}['_distributeChips'](_0x135df3,_0x3d0de1){this['_visibleChips']['clear'](),this['_overflowChips']['clear'](),_0x135df3['forEach'](_0x818ac2=>{_0x3d0de1['includes'](_0x818ac2)?this['_overflowChips']['add'](_0x818ac2):this['_visibleChips']['add'](_0x818ac2);});}['_updateOverflowUI'](_0x3e9911){if(_0x3e9911>0x0&&!this['_showMoreButtonView']&&this['_createShowMoreButton'](),_0x3e9911>0x0&&this['_showMoreButtonView']){const _0x37edd4=''+this['_config']['showMoreLabelPrefix']+(_0x3e9911<0x63?_0x3e9911:'99');this['_showMoreButtonView']['label']=_0x37edd4;}this['_updateBalloonContent'](),this['_updateShowMoreButtonVisibility'](),this['_repinBalloonPanel']();}['_applyOverflowResults'](_0x12ab9d,_0x14608a){this['_distributeChips'](_0x12ab9d,_0x14608a),this['_updateOverflowUI'](_0x14608a['length']);}['_setupVisibilityObserver'](){this['_containerElement']&&'undefined'!=typeof IntersectionObserver&&(this['_intersectionObserver']=new IntersectionObserver(_0x3a1288=>{_0x3a1288[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 _0x323c13=this['_containerElement']['getBoundingClientRect']();if(0x0===_0x323c13['width']||0x0===_0x323c13['height'])return!0x1;const _0x587d69=window['innerHeight']||document['documentElement']['clientHeight'],_0x5a30f7=window['innerWidth']||document['documentElement']['clientWidth'],_0x184217=0xc8;return _0x323c13['bottom']>=-0xc8&&_0x323c13['top']<=_0x587d69+_0x184217&&_0x323c13['right']>=-0xc8&&_0x323c13['left']<=_0x5a30f7+_0x184217;}}const Wn='ck-ai-chat__feed__context-chips',Yn='ck-ai-chat-context-chips-wrapper',$n='ck-ai-chat-context-chips-wrapper-balloon',qn='ck-ai-chat-controls-button',Qn='ck-ai-chat-controls_context_show-more-button',Xn='ck-ai-chat-context-controls__show-more-balloon-panel';class zn extends vt{['_contextChips']=this['createCollection']();['_overflowManager'];['_bodyCollection'];constructor(_0x3b8d00,_0xa98bbd,_0x2a5f8a){super(_0x3b8d00),this['_bodyCollection']=_0x2a5f8a,this['_createContextChips'](_0xa98bbd);const _0x1130db={'cssClasses':{'showMoreButton':Qn+'\x20'+As,'showMoreBalloon':Xn,'overflowContainer':$n,'controlsButton':qn}};this['_overflowManager']=new Kn(_0x3b8d00,this['_contextChips'],_0x1130db,this['_bodyCollection'],this),this['setTemplate']({'tag':'div','attributes':{'class':[Wn,'ck','ck-reset_all']},'children':[{'tag':'div','attributes':{'class':Yn},'children':this['_contextChips']}]});}['render'](){super['render']();const _0x1f5266=this['element']['querySelector']('.'+Yn);_0x1f5266&&(this['_overflowManager']['setContainerElement'](_0x1f5266),this['_overflowManager']['reorganizeChips']());}['destroy'](){super['destroy'](),this['_overflowManager']['destroy']();}['_createContextChips'](_0x4016b7){for(const _0x57d25a of _0x4016b7){const _0x1f7143=new Vn(this['locale'],_0x57d25a,!0x0,!0x1);this['_contextChips']['add'](_0x1f7143);}}}class jn extends cn{['_contextChipsView']=null;['_locale'];['_bodyCollection'];['_messageContentView'];constructor(_0x4a87cb,_0x55624b,_0x22a01b){super(_0x55624b),this['_locale']=_0x4a87cb,this['_bodyCollection']=_0x22a01b,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 zn(this['_locale'],this['options']['contextItems']['filter'](_0xb0205=>!_0xb0205['hidden']),this['_bodyCollection']),this['_contextChipsView']['extendTemplate']({'attributes':{'class':'ck-ai-chat__feed__context-chips'}}),this['children']['add'](this['_contextChipsView']));}['_createMessageContentView'](){this['_messageContentView']=new vt(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 Jn extends cn{['capabilities'];constructor(_0x12e361,_0x4e75a9){super(_0x4e75a9);const {isWebSearchEnabled:_0x53ec8a,isReasoningEnabled:_0x1e7554}=_0x4e75a9['capabilities'],_0x35d567=[];let _0x576247='';_0x53ec8a&&_0x1e7554?(_0x576247=us(_0x12e361,'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH_REASONING'),_0x35d567['push'](Zn(_0x43b9e2)),_0x35d567['push'](Zn(_0xdc1179))):_0x53ec8a?(_0x576247=us(_0x12e361,'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH'),_0x35d567['push'](Zn(_0x43b9e2))):_0x1e7554&&(_0x576247=us(_0x12e361,'AI_CHAT_FEED_REPLY_ITEM_USED_REASONING'),_0x35d567['push'](Zn(_0xdc1179))),this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__interaction-header',_0x576247?'':'ck-hidden']}});const _0x5836c9=new vt();_0x5836c9['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__interaction-header__capabilities']},'children':[..._0x35d567,{'tag':'span','attributes':{'class':['ck-ai-chat__feed__interaction-header__capabilities__text']},'children':[_0x576247]}]}),this['children']['add'](_0x5836c9),this['capabilities']=_0x4e75a9['capabilities'];}}function Zn(_0x45aaee){const _0x49c1ea=new xt();return _0x49c1ea['content']=_0x45aaee,_0x49c1ea;}const tr=['wheel','touchstart','pointerdown','keydown'],er=['ArrowUp','ArrowDown','PageUp','PageDown','Home','End','\x20'];class ir{['element'];['animationFrameId'];['isRunning'];['abortController'];['isUserPaused'];constructor(_0x4e20ee){this['element']=_0x4e20ee,this['animationFrameId']=null,this['isRunning']=!0x1,this['abortController']=new AbortController(),this['isUserPaused']=!0x1;for(const _0x51f52e of tr){const _0x4c16c6='keydown'!==_0x51f52e;this['element']['addEventListener'](_0x51f52e,this['_onUserEvent']['bind'](this),{'passive':_0x4c16c6,'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'](_0x386445){if(this['isRunning']){if('keydown'===_0x386445['type']){const _0xf6e6ce=_0x386445['key'];if(!er['includes'](_0xf6e6ce))return;}_0x386445 instanceof WheelEvent?_0x386445['deltaY']<0x0?this['isUserPaused']=!0x0:this['isUserPaused']=!this['_isAtBottom']():this['isUserPaused']=!0x0;}}['_isAtBottom'](){const {scrollTop:_0x29d295,scrollHeight:_0x58d1d5,clientHeight:_0x188c35}=this['element'];return _0x58d1d5-_0x29d295-_0x188c35<=0x5;}['_rafUpdate'](){this['isRunning']&&(this['isUserPaused']||this['element']['scrollTo']({'top':this['element']['scrollHeight'],'behavior':'auto'}),this['animationFrameId']=requestAnimationFrame(this['_rafUpdate']['bind'](this)));}}class sr extends vt{constructor(_0x3c53b7,_0x4fe6b9){super(_0x3c53b7),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-skeleton']},'children':this['_createSkeletonItems'](_0x4fe6b9)});}['_createSkeletonItems'](_0xcf5fc0){const _0x3bd617=['ck','ck-ai-skeleton__item'];return _0xcf5fc0['map'](_0x36908f=>{let _0x160c66='';switch(_0x36908f['attributes']['align']){case'right':_0x160c66='margin-left:\x20auto;\x20margin-right:\x200;\x20text-align:\x20right;';break;case'center':_0x160c66='margin-left:\x20auto;\x20margin-right:\x20auto;\x20text-align:\x20center;';break;case'left':_0x160c66='margin-left:\x200;\x20margin-right:\x20auto;\x20text-align:\x20left;';}return{'tag':_0x36908f['tag'],'attributes':{'class':[..._0x3bd617,_0x36908f['attributes']['class']?_0x36908f['attributes']['class']:''],'style':'width:\x20'+_0x36908f['attributes']['width']+';\x20height:\x20'+_0x36908f['attributes']['height']+';'+_0x160c66}};});}}const nr={'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':rr(0x5,'100%','44px','right'),'aiChatResources':rr(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 rr(_0x5d200e,_0x1670f1,_0x30a56b,_0x368476){return new Array(_0x5d200e)['fill'](null)['map'](()=>({'tag':'div','attributes':{'width':_0x1670f1,'height':_0x30a56b,'align':_0x368476}}));}class ar extends cn{constructor(_0x41a545){super(_0x41a545),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 or extends vt{['children'];['scrollManager'];['_bodyCollection'];constructor(_0x2c0f00,_0x44fe25){super(_0x2c0f00),this['_bodyCollection']=_0x44fe25,this['set']('isPending',!0x1),this['set']('loadingMessage',''),this['set']('isLoadingSkeletonVisible',!0x1),this['set']('isTrackChangesOn',!0x1),this['children']=this['createCollection'](),this['children']['delegate'](...sn)['to'](this),this['_setupTemplate']();}['render'](){super['render'](),this['scrollManager']=new ir(this['element']);}['destroy'](){super['destroy'](),this['scrollManager']['destroy']();}['clear'](){this['children']['clear']();}['addItem'](_0x5c6492,_0x4087bf){let _0x53678d;return'ai-reply'===_0x5c6492?_0x53678d=new Nn(this['locale'],_0x4087bf,this['_bodyCollection']):'ai-suggestion-reply'===_0x5c6492?(_0x53678d=new kn(this['locale'],_0x4087bf,this['_bodyCollection']),_0x53678d['bind']('isTrackChangesOn')['to'](this)):_0x53678d='user-message'===_0x5c6492?new jn(this['locale'],_0x4087bf,this['_bodyCollection']):'interaction-header'===_0x5c6492?new Jn(this['locale'],_0x4087bf):'custom-element'===_0x5c6492?new ar(_0x4087bf):new Cn(_0x4087bf),this['children']['add'](_0x53678d),_0x53678d;}async['updateReplyItem']({id:_0x3a1d55,parsedContent:_0x58dce9,renderingStrategy:_0x53098e,abortSignal:_0x35d7bb}){const _0xab2368=this['getItemById'](_0x3a1d55);if(!(_0xab2368 instanceof Nn))throw new ht('ai-chat-feed-view-item-not-a-reply-item',null,{'itemView':_0xab2368,'id':_0x3a1d55,'parsedContent':_0x58dce9});await _0xab2368['updateContent']({'parsedContent':_0x58dce9,'renderingStrategy':_0x53098e,'abortSignal':_0x35d7bb});}async['updateWebSources'](_0xf2b406,_0x281258){const _0x12479c=this['getItemById'](_0xf2b406);if(_0x12479c instanceof kn)_0x12479c['updateSources'](_0x281258);else{if(!(_0x12479c instanceof Nn))throw new ht('ai-chat-feed-view-item-not-a-suggestion-or-reply-item',null,{'itemView':_0x12479c,'id':_0xf2b406,'sources':_0x281258});_0x12479c['updateSources'](_0x281258);}}async['updateSuggestionItem']({id:_0x31331d,parts:_0x43270a,renderingStrategy:_0x413792,abortSignal:_0x2bd77c}){const _0x1426f0=this['getItemById'](_0x31331d);if(!(_0x1426f0 instanceof kn))throw new ht('ai-chat-feed-view-item-not-a-suggestion-item',null,{'itemView':_0x1426f0,'id':_0x31331d,'parts':_0x43270a});await _0x1426f0['updateContent']({'parts':_0x43270a,'renderingStrategy':_0x413792,'abortSignal':_0x2bd77c});}['updateSuggestionPartState']({id:_0xb4e2d6,index:_0xdba45,state:_0x1d3740}){const _0x2db7b7=this['getItemById'](_0xb4e2d6);if(!(_0x2db7b7 instanceof kn))throw new ht('ai-chat-feed-view-item-not-a-suggestion-item',this,{'id':_0xb4e2d6});_0x2db7b7['updatePartState'](_0xdba45,_0x1d3740);}['setSuggestionPartActive']({id:_0x5ef479,index:_0x2dfe7e,isActive:_0x13f941}){const _0x5de48c=this['getItemById'](_0x5ef479);if(!(_0x5de48c instanceof kn))throw new ht('ai-chat-feed-view-item-not-a-suggestion-item',this,{'id':_0x5ef479});this['children']['filter'](_0x47da94=>_0x47da94 instanceof kn)['forEach'](_0x1d419c=>{_0x1d419c['setPartActive'](!0x1);}),_0x5de48c['setPartActive'](_0x2dfe7e,_0x13f941);}['markItemAsDone'](_0xeff64a){this['getItemById'](_0xeff64a)['markAsDone']();}['getItemIds'](){return this['children']['map'](_0x5b3eee=>_0x5b3eee['options']['id']);}['removeItem'](_0x4ca7db){this['children']['remove'](this['getItemById'](_0x4ca7db));}['hasItem'](_0x55a82b){return!!this['children']['find'](_0x4c309a=>_0x4c309a['options']['id']['includes'](_0x55a82b));}['scrollToSuggestion'](_0x1e8b38,_0x3a3c7b){const _0x23e07d=this['getItemById'](_0x1e8b38);if(!(_0x23e07d instanceof kn))return void Tt('ck-ai-chat-feed-view-scroll-to-suggestion-invalid-item',{'replyId':_0x1e8b38,'partIndex':_0x3a3c7b});const _0x410a39=_0x23e07d['getPartView'](_0x3a3c7b);_0x410a39?ft(_0x410a39['element'],0x14,this['element']['parentElement'],!0x0,!0x0):Tt('ck-ai-chat-feed-view-scroll-to-suggestion-part-view-not-found',{'replyId':_0x1e8b38,'partIndex':_0x3a3c7b});}['_setupTemplate'](){this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed']},'children':this['_createTemplateChildren']()});}['_createTemplateChildren'](){const _0x32382f=this['_createSkeletonLoader']();return[this['_createFeedItems'](),_0x32382f,this['_createFeedLoader']()];}['_createSkeletonLoader'](){const _0x2d1650=new sr(this['locale'],nr['aiFeed']);return _0x2d1650['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isLoadingSkeletonVisible','ck-hidden',_0x2a4d7d=>!_0x2a4d7d)]}}),_0x2d1650;}['_createFeedItems'](){const _0x460b88=new vt(this['locale']);return _0x460b88['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__items',this['bindTemplate']['if']('isLoadingSkeletonVisible','ck-hidden')]},'children':this['children']}),_0x460b88;}['_createFeedLoader'](){const _0xf18fb8=new vt(this['locale']);return _0xf18fb8['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__loader',this['bindTemplate']['if']('isPending','ck-hidden',_0x182273=>!_0x182273)]},'children':this['_createLoaderChildren']()}),_0xf18fb8;}['_createLoaderChildren'](){const _0x3ca40d=new vn();return _0x3ca40d['isVisible']=!0x0,[_0x3ca40d,{'tag':'span','attributes':{'class':['ck','ck-ai-chat__loader-text']},'children':[{'text':this['bindTemplate']['to']('loadingMessage')}]}];}['getItemById'](_0x4d6a4a){const _0x53e551=this['children']['find'](_0x2a8283=>_0x2a8283['options']['id']['includes'](_0x4d6a4a));if(!_0x53e551)throw new ht('ai-chat-feed-view-item-not-found',this,{'id':_0x4d6a4a});return _0x53e551;}['setLoadingMessage'](_0x4a23b5){this['set']('loadingMessage',_0x4a23b5);}['toggleLoadingSkeleton'](_0x115e30){this['set']('isLoadingSkeletonVisible',_0x115e30);}['startAutoScroll'](){this['scrollManager']['start']();}['stopAutoScroll'](){this['scrollManager']['stop']();}}class hr extends Dt{['filter'](){let _0x4d6427=0x0;for(const _0x91820c of this['items'])_0x4d6427+=_0x91820c['items']['length'];return{'resultsCount':_0x4d6427,'totalItemsCount':_0x4d6427};}}const cr='ck-ai-chat__prompt-input_highlighted';class lr extends Lt{['submitButtonView'];static ['MIN_ROWS']=0x1;static ['MAX_ROWS']=0xc;['_addContextButtonView'];['_queryViewResizeObserver'];constructor(_0x324197,_0x5efe51){super(_0x324197,{'queryView':{'label':'','creator':Vt,'showIcon':!0x1,'showResetButton':!0x1},'filteredView':new hr(_0x324197),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1}),this['set']('isEmpty',!0x0),this['set']('isUploadInProgress',!0x1),this['_addContextButtonView']=_0x5efe51,this['_queryViewResizeObserver']=null,this['queryView']['fieldView']['minRows']=lr['MIN_ROWS'],this['queryView']['fieldView']['maxRows']=lr['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',(_0x3854fc,_0x535f37)=>!_0x3854fc&&!_0x535f37),this['focusableChildren']['add'](this['submitButtonView']);}['render'](){super['render'](),this['queryView']['fieldWrapperChildren']['add'](this['submitButtonView']),this['keystrokes']['set']('enter',(_0x10c563,_0x2ec7c2)=>{this['isUploadInProgress']||this['isEmpty']||_0x10c563['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0x2ec7c2());}),this['queryView']['fieldView']['on']('update',()=>{this['isEmpty']=''===this['queryView']['fieldView']['element']['value']?.['trim']();});}['destroy'](){super['destroy'](),this['_queryViewResizeObserver']&&this['_queryViewResizeObserver']['destroy']();}['submit'](){const _0x355a8b=this['queryView']['fieldView']['element']['value']?.['trim']();if(!_0x355a8b)return this['queryView']['errorText']=us(this['locale'],'AI_CHAT_PROMPT_EMPTY_ERROR'),void(this['queryView']['fieldView']['hasError']=!0x0);this['queryView']['fieldView']['hasError']=!0x1;const _0x2fc1a3=_0x24fbe9(_0x355a8b);this['fire']('sendUserMessage',_0x2fc1a3),this['queryView']['fieldView']['reset']();}['setPlaceholderText'](_0x146966){this['queryView']['fieldView']['set']('placeholder',_0x146966);}['focus'](_0x5b8be1=!0x1){super['focus'](),_0x5b8be1&&(this['element']['classList']['contains'](cr)||(this['element']['classList']['add'](cr),setTimeout(()=>{this['element']['classList']['remove'](cr);},0x320)));}['_createSubmitButton'](){const _0x9fb6cc=new Nt(this['locale']);return _0x9fb6cc['set']({'icon':_0x4509b9,'label':us(this['locale'],'AI_CHAT_LABEL_SUBMIT'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-chat__prompt-submit-button\x20'+ds,'isEnabled':!0x1}),_0x9fb6cc['on']('execute',()=>{this['submit']();}),_0x9fb6cc;}['setIsUploadInProgress'](_0x5a0a89){this['isUploadInProgress']=_0x5a0a89;}['_setUpAddContextButtonPositioning'](){const _0x231cd9=this['locale'],_0x2d2732=()=>{lt['window']['requestAnimationFrame'](()=>{if(ut(this['element'])){const _0x527d19=new dt(this['queryView']['fieldView']['element']),_0x2b8892=new dt(this['_addContextButtonView']['element']),_0x41e111=_0x527d19['width'],_0x475070='rtl'===_0x231cd9['uiLanguageDirection']?'right':'left';_0x527d19['excludeScrollbarsAndBorders']();const _0x4d095e=_0x41e111-_0x527d19['width']+0x1;this['_addContextButtonView']['element']['style'][_0x475070]='calc('+(_0x41e111-_0x2b8892['width']-_0x4d095e)+'px\x20-\x20var(--ck-spacing-tiny))';}});};this['queryView']['fieldView']['on']('update',_0x2d2732),this['on']('render',()=>{_0x2d2732(),this['_queryViewResizeObserver']=new St(this['queryView']['fieldView']['element'],()=>{_0x2d2732();});});}}const ur='ck-ai-chat__prompt-capabilities',dr='ck-ai-chat-controls-button',_r='ck-ai-chat-controls-button--commands',Ar='ck-ai-chat-controls__model-selection',gr='ck-ai-chat-controls__model-selection__item-name',Ir='ck-ai-chat-controls__model-selection__item-description',Er='ck-ai-chat-controls__model-selection__item-capabilities',pr='n';class Tr extends vt{['_webSearchButton'];['_reasoningButton'];['_commandsButton'];['_modelSelectionDropdown'];['_modelSelectionDropdownItems'];['_modelNameView'];constructor(_0x3959e8){super(_0x3959e8),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',_0x2e3ee1=>'selector'===_0x2e3ee1),this['_modelSelectionDropdown']['buttonView']['bind']('tooltip')['to'](this,'modelSelectorEnabled',_0x2db0dc=>_0x2db0dc?this['_modelSelectionDropdown']['buttonView']['label']:us(this['locale'],'AI_CHAT_MODEL_SELECTOR_DISABLED_TOOLTIP')),this['_modelSelectionDropdown']['bind']('isEnabled')['to'](this,'modelSelectorEnabled',_0x125643=>_0x125643),this['_webSearchButton']['bind']('isOn')['to'](this,'webSearchActive',_0x3ed902=>_0x3ed902),this['_webSearchButton']['bind']('tooltip')['to'](this,'webSearchActive',_0x4d39a6=>us(this['locale'],_0x4d39a6?'AI_CHAT_DISABLE_WEB_SEARCH':'AI_CHAT_ENABLE_WEB_SEARCH')),this['_reasoningButton']['bind']('isOn')['to'](this,'reasoningActive',_0x32dd06=>_0x32dd06),this['_reasoningButton']['bind']('tooltip')['to'](this,'reasoningActive',_0x27f78e=>us(this['locale'],_0x27f78e?'AI_CHAT_DISABLE_REASONING':'AI_CHAT_ENABLE_REASONING')),this['setTemplate']({'tag':'div','attributes':{'class':[ur]},'children':[this['_modelSelectionDropdown'],this['_modelNameView'],this['_webSearchButton'],this['_reasoningButton'],this['_commandsButton']]}),this['_modelSelectionDropdownItems']=new _t(),jt(this['_modelSelectionDropdown'],this['_modelSelectionDropdownItems']);}['setModelList'](_0x3dc721,_0x565121){if(_0x565121)this['set']('modelDisplayMode','hidden');else{const _0x5e01f1=0x1===_0x3dc721['length'];this['set']('modelDisplayMode',_0x5e01f1?'name':'selector');}if(this['_modelSelectionDropdownItems']['clear'](),_0x3dc721?.['length'])for(const _0x14a302 of _0x3dc721){const _0x36a810=new Jt({'label':_0x14a302['name'],'withText':!0x0,'role':'menuitemradio','id':_0x14a302['id'],'model':_0x14a302});_0x36a810['bind']('isOn')['to'](this,'activeModelId',_0x3b375d=>_0x3b375d===_0x14a302['id']),this['_modelSelectionDropdownItems']['add']({'type':'button','model':_0x36a810,'labelView':new mr(this['locale'],_0x14a302)});}}['setWebSearch'](_0x554a6e){this['set']('webSearchActive',_0x554a6e);}['setReasoning'](_0x333e63){this['set']('reasoningActive',_0x333e63);}['setModel'](_0x3d12f8){if(!_0x3d12f8)return;this['activeModelId']=_0x3d12f8['id'],this['activeModelName']=_0x3d12f8['name']||_0x3d12f8['id'],this['_modelSelectionDropdown']['buttonView']['set']('label',_0x3d12f8['name']),this['_modelSelectionDropdown']['buttonView']['set']('tooltip',_0x3d12f8['name']);const _0x27aa9f=_0x3d12f8['capabilities']['webSearch']?.['enabled']??!0x1;this['set']('webSearchActive',!0x1),this['_webSearchButton']['set']('isOn',!0x1),this['_webSearchButton']['set']('isEnabled',_0x27aa9f),this['_webSearchButton']['set']('isVisible',_0x27aa9f);const _0x50482a=_0x3d12f8['capabilities']['reasoning']?.['enabled']??!0x1;this['set']('reasoningActive',!0x1),this['_reasoningButton']['set']('isOn',!0x1),this['_reasoningButton']['set']('isEnabled',_0x50482a),this['_reasoningButton']['set']('isVisible',_0x50482a);}['enableModelSelector'](){this['set']('modelSelectorEnabled',!0x0);}['disableModelSelector'](_0x288cba){this['set']('modelSelectorEnabled',!0x1),_0x288cba&&this['set']('modelDisplayMode','hidden');}['_createWebSearchButton'](){const _0x42a44b=new Nt();return _0x42a44b['set']({'label':us(this['locale'],'AI_CHAT_SEARCH_WEB'),'icon':_0x43b9e2,'class':dr+'\x20'+As,'isToggleable':!0x0,'tooltipPosition':pr}),_0x42a44b['on']('execute',()=>{this['fire']('toggleWebSearch');}),_0x42a44b;}['_createReasoningButton'](){const _0x156c8c=new Nt();return _0x156c8c['set']({'label':us(this['locale'],'AI_CHAT_REASONING'),'icon':_0xdc1179,'class':dr+'\x20'+As,'isToggleable':!0x0,'tooltipPosition':pr}),_0x156c8c['on']('execute',()=>{this['fire']('toggleReasoning');}),_0x156c8c;}['_createCommandsButton'](){const _0x128e84=new Nt();return _0x128e84['set']({'label':us(this['locale'],'AI_CHAT_COMMANDS'),'icon':_0x16b8d8,'withText':!0x0,'class':dr+'\x20'+As,'isToggleable':!0x0,'tooltip':us(this['locale'],'AI_CHAT_COMMANDS'),'tooltipPosition':pr}),_0x128e84['extendTemplate']({'attributes':{'class':[_r]}}),_0x128e84['on']('execute',()=>{console['log']('Commands\x20are\x20not\x20implemented\x20yet.'),alert('Commands\x20are\x20not\x20implemented\x20yet.');}),_0x128e84;}['_createModelSelectionDropdown'](){const _0x36c98e=Gt(this['locale']);return _0x36c98e['set']({'panelPosition':'ne','class':[Ar]}),_0x36c98e['buttonView']['set']({'label':us(this['locale'],'AI_CHAT_MODEL_SELECTOR_ENABLED_TOOLTIP'),'withText':!0x0,'tooltip':!0x0,'tooltipPosition':pr,'class':As}),this['listenTo'](_0x36c98e,'execute',_0x546f13=>{this['fire']('selectModel',_0x546f13['source']['model']);}),_0x36c98e;}['_createModelNameView'](){const _0x30ec4c=new Cr(this['locale']);return _0x30ec4c['bind']('text')['to'](this,'activeModelName',_0x221ca1=>_0x221ca1??''),_0x30ec4c['bind']('isVisible')['to'](this,'modelDisplayMode',_0x248ad3=>'name'===_0x248ad3),_0x30ec4c;}}let mr=class extends Mt{constructor(_0x28bc47,_0x2b6ecb){super();const _0x56923e=this['bindTemplate'],_0x36490c=this['createCollection']();this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-button__label'],'style':_0x56923e['to']('style'),'id':_0x56923e['to']('id')},'children':[{'tag':'div','attributes':{'class':[gr]},'children':[{'text':_0x56923e['to']('text')}]},{'tag':'div','attributes':{'class':[Ir]},'children':[{'tag':'span','children':[{'text':_0x2b6ecb['description']}]}]},{'tag':'div','attributes':{'class':[Er]},'children':_0x36490c}]}),_0x36490c['addMany'](this['_getCapabilityParts'](_0x28bc47,_0x43b9e2,'AI_CHAT_SEARCH_WEB',_0x2b6ecb['capabilities']['webSearch']?.['enabled']??!0x1)),_0x36490c['addMany'](this['_getCapabilityParts'](_0x28bc47,_0xdc1179,'AI_CHAT_REASONING',_0x2b6ecb['capabilities']['reasoning']?.['enabled']??!0x1));}['_getCapabilityParts'](_0x716669,_0x8c476a,_0x620d0c,_0x4fcb59){const _0x58ed38=new xt();_0x58ed38['content']=_0x8c476a;const _0x47938d=new vt(_0x716669);_0x47938d['setTemplate']({'tag':'span','children':[{'text':us(_0x716669,_0x620d0c)+':\x20'}]});const _0x4ec64=new vt(_0x716669);return _0x4ec64['setTemplate']({'tag':'span','children':[{'text':us(_0x716669,_0x4fcb59?'AI_CHAT_CAPABILITIES_YES':'AI_CHAT_CAPABILITIES_NO')}]}),[_0x58ed38,_0x47938d,_0x4ec64];}},Cr=class extends vt{constructor(_0x4beb0c){super(_0x4beb0c),this['set']('text',void 0x0),this['set']('isVisible',!0x0);const _0x54c055=this['bindTemplate'];this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-chat-controls__model-name',_0x54c055['if']('isVisible','ck-hidden',_0x307a6c=>!_0x307a6c)]},'children':[{'text':_0x54c055['to']('text')}]});}};const wr='ck-ai-chat-context-controls__url-form',fr='ck-ai-chat-context-controls__url-input-section';class Sr extends vt{['focusTracker'];['keystrokes'];['_focusables'];['focusCycler'];['urlInputField'];['backButton'];['confirmButton'];constructor(_0x5104e8){super(_0x5104e8),this['focusTracker']=new At(),this['keystrokes']=new gt(),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 Ut({'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'](_0x350fb6=>{this['focusTracker']['add'](_0x350fb6['element']),this['keystrokes']['listenTo'](_0x350fb6['element']);}),Zt({'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'](_0x5625c7){this['urlInputField']['errorText']=_0x5625c7,this['_updateConfirmButtonState'](),this['fire']('refreshBalloon');}['clearError'](){this['urlInputField']['errorText']=null,this['_updateConfirmButtonState']();}['_createBackButton'](){const _0x58d629=new Nt(this['locale']);return _0x58d629['set']({'icon':_0x5005b7,'tooltip':us(this['locale'],'AI_CHAT_CONTEXT_URL_BACK_TO_CONTEXT'),'tooltipPosition':'n','class':['ck-button-icon\x20ck-button-back']}),this['on']('change:withBackButton',(_0x5e46f8,_0x4a22fc,_0x59dd12)=>{_0x58d629['set']({'class':['ck-button-icon\x20ck-button-back'+(_0x59dd12?'':'\x20ck-hidden')]});}),_0x58d629;}['_createUrlInputField'](){const _0x56ba56=new te(this['locale'],_0x426dd5);return _0x56ba56['set']({'label':us(this['locale'],'AI_CHAT_CONTEXT_URL_LABEL'),'class':'ck-labeled-field-view_empty'}),_0x56ba56['fieldView']['set']({'placeholder':us(this['locale'],'AI_CHAT_CONTEXT_URL_PLACEHOLDER')}),_0x56ba56;}['_createConfirmButton'](){const _0x5d532e=new Nt(this['locale']);return _0x5d532e['set']({'icon':_0xe4c6eb,'tooltip':us(this['locale'],'AI_CHAT_CONTEXT_URL_ADD_URL'),'tooltipPosition':'n','class':'ck-button-icon','type':'submit','isEnabled':!0x1}),_0x5d532e;}['_setupTemplate'](){const _0x4c15b5=new _0x16cf91(this['locale'],{'label':us(this['locale'],'AI_CHAT_CONTEXT_URL_ADD_URL'),'class':'ck-ai-header\x20ck-ai-header_small\x20ck-ai-header_context-url'});_0x4c15b5['children']['add'](this['backButton'],0x0),this['setTemplate']({'tag':'form','attributes':{'class':wr,'tabindex':'-1'},'children':[_0x4c15b5,{'tag':'div','attributes':{'class':fr},'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',_0x32c9c7=>{_0x32c9c7['stop'](),this['_handleSubmit']();});}['_setupKeystrokes'](){this['keystrokes']['set']('esc',(_0x48b359,_0x58da49)=>{this['clear'](),this['fire']('cancel'),_0x58da49();});}['_handleSubmit'](){const _0x9051cb=this['getValue']()['trim']();_0x9051cb?this['_isValidUrl'](_0x9051cb)?(this['clearError'](),this['fire']('submitUrl',_0x9051cb)):this['setError'](us(this['locale'],'AI_CHAT_CONTEXT_URL_INVALID_ERROR')):this['setError'](us(this['locale'],'AI_CHAT_CONTEXT_URL_EMPTY_ERROR'));}['_updateConfirmButtonState'](){const _0x56e455=this['getValue']()['trim'](),_0x1f6df4=!!this['urlInputField']['errorText'];this['confirmButton']['isEnabled']=_0x56e455['length']>0x0&&!_0x1f6df4;}['_isValidUrl'](_0xb4dd02){try{return!!new URL(_0xb4dd02);}catch{return!0x1;}}}const br='ck-ai-chat-resources__item',Rr='ck-ai-chat-resources__item--in-context',Or='ck-ai-chat-resources__item-title',kr='ck-ai-chat-resources__item__icon';class Nr extends Ht{['resource'];['_titleView'];['_iconView'];constructor(_0x4a9dbb,_0x3b584b){super(_0x4a9dbb),this['resource']=_0x3b584b,this['set']('isInContext',!!_0x3b584b['isInContext']),this['_titleView']=this['_createTitleView'](),this['_iconView']=this['_createIconView'](),this['_setupTemplate']();}['render'](){super['render']();}['getResourceIcon'](_0x563537){if(_0x563537['isInContext'])return _0xe4c6eb;switch(_0x563537['type']){case Us['DOCUMENT']:return _0xa5e512;case Us['URL']:return _0x1091b0;case Us['FILE']:case Us['TEXT']:return _0x33be6f;default:return _0x42b884;}}['highlightText'](_0x33c775){if(!_0x33c775||''===_0x33c775['trim']())return void this['_titleView']['highlightText'](null);const _0x1ac578=new RegExp(_0x20b9f0(_0x33c775),'gi');this['_titleView']['highlightText'](_0x1ac578);}['updateResourceState'](_0x3ef4f4){this['resource']['isInContext']=_0x3ef4f4,this['isInContext']=_0x3ef4f4,this['_updateIcon']();}['_createTitleView'](){const _0x34a41=new _0x5baf8b();return _0x34a41['text']=this['resource']['label'],_0x34a41['extendTemplate']({'tag':'span','attributes':{'class':[Or]}}),_0x34a41;}['_createIconView'](){const _0x5ea80e=new xt();return _0x5ea80e['content']=this['getResourceIcon'](this['resource']),_0x5ea80e;}['_setupTemplate'](){const _0x38bdf1=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':[br,_0x38bdf1['if']('isVisible','ck-hidden',_0x122fda=>!_0x122fda),_0x38bdf1['if']('isInContext',Rr)]},'children':[{'tag':'div','attributes':{'class':[kr]},'children':[this['_iconView']]},this['_titleView']],'on':{'click':_0x38bdf1['to']('execute')}});}['_updateIcon'](){this['_iconView']['content']=this['getResourceIcon'](this['resource']);}}const vr='ck-ai-chat-resources__list';class yr extends Dt{['_source'];constructor(_0x3160e0,_0x3a1da2){super(_0x3160e0),this['_source']=_0x3a1da2,this['extendTemplate']({'attributes':{'class':[vr]}});}['setResources'](_0x597bd4,_0x91de60){this['items']['clear']();let _0x314d9d=_0x597bd4;if(this['_source']['useDefaultFiltering']&&_0x91de60&&''!==_0x91de60['trim']()){const _0x3e3080=new RegExp(_0x91de60['replace'](/[.*+?^${}()|[\]\\]/g,'\x5c$&'),'gi');_0x314d9d=_0x597bd4['filter'](_0x283588=>_0x3e3080['test'](_0x283588['label']));}for(const _0x4ba4f9 of _0x314d9d){const _0x3399c5=new Nr(this['locale'],_0x4ba4f9);_0x3399c5['on']('execute',()=>{this['_handleResourceSelection'](this['_source'],_0x4ba4f9);}),this['items']['add'](_0x3399c5);}this['_source']['useDefaultFiltering']&&this['highlightText'](_0x91de60);}['highlightText'](_0x45afd2){this['_source']['useDefaultFiltering']&&this['items']['forEach'](_0x5e2b5e=>{_0x5e2b5e['highlightText'](_0x45afd2);});}['updateResourceState'](_0x34fc70,_0x328207){for(const _0x5d297f of this['items']){const _0xedbaa2=_0x5d297f;_0xedbaa2['resource']['id']===_0x34fc70&&_0xedbaa2['updateResourceState'](_0x328207);}}['_handleResourceSelection'](_0x151a6a,_0x34ee2a){this['fire']('addResourceToContext',{'source':_0x151a6a,'resource':_0x34ee2a});}}class xr extends te{['iconView'];['resetButtonView'];['_viewConfig'];constructor(_0x22d9b6){const t=_0x22d9b6['t'],_0xbc9fb4={'showResetButton':!0x0,'showIcon':!0x0,'creator':_0x426dd5,'label':us(_0x22d9b6,'AI_CHAT_SEARCH_RESOURCES')};super(_0x22d9b6,_0xbc9fb4['creator']),this['label']=_0xbc9fb4['label'],this['_viewConfig']=_0xbc9fb4,this['_viewConfig']['showIcon']&&this['_setupSearchIcon'](),this['_viewConfig']['showResetButton']&&this['_setupResetButton'](_0x22d9b6,t),this['_setupEventListeners']();}['reset'](){this['fieldView']['reset'](),this['_viewConfig']['showResetButton']&&this['resetButtonView']&&(this['resetButtonView']['isVisible']=!0x1),this['search']('');}['search'](_0x21fcd9){this['fire']('search',_0x21fcd9);}['getQuery'](){return this['fieldView']['element']?.['value']||'';}['_setupSearchIcon'](){this['iconView']=new xt(),this['iconView']['content']=_0x5c1e6b,this['fieldWrapperChildren']['add'](this['iconView'],0x0),this['extendTemplate']({'attributes':{'class':'ck-search__query_with-icon'}});}['_setupResetButton'](_0x11e9b5,t){this['resetButtonView']=new Nt(_0x11e9b5),this['resetButtonView']['set']({'label':t('Clear'),'icon':_0x45659b,'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',_0x45081a=>!_0x45081a),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 Lr extends vt{['_searchView'];['_searchSection'];['_searchInputVisibleFrom'];['_resourcesListView'];['_skeletonLoader'];['_source'];['children'];['_latestLoadResourcesUid']=null;constructor(_0x1bac03,_0x1e7991){super(_0x1bac03),this['_source']=_0x1e7991['source'],this['_searchInputVisibleFrom']=_0x1e7991['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 _0x4539b4([this['_skeletonLoader'],this['_resourcesListView']]),this['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-chat-resources'},'children':this['children']});}['_createSearchView'](){return new xr(this['locale']);}['_createSearchSection'](){const _0x2d0f9e=new vt(this['locale']);return _0x2d0f9e['setTemplate']({'tag':'div','attributes':{'class':'ck\x20ck-search'},'children':[this['_searchView']]}),this['_searchView']['on']('search',(_0x2a0a00,_0x509269)=>{this['loadResources'](_0x509269),this['_source']['useDefaultFiltering']&&this['_resourcesListView']['highlightText'](_0x509269);}),_0x2d0f9e;}['_createResourcesListView'](){const _0xd081cd=new yr(this['locale'],this['_source']);return _0xd081cd['delegate']('addResourceToContext')['to'](this),_0xd081cd['extendTemplate']({'attributes':{'class':this['bindTemplate']['if']('isLoading','ck-hidden')}}),_0xd081cd;}['_createSkeletonView'](){const _0x131830=new sr(this['locale'],nr['aiChatResources']);return _0x131830['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isLoading','ck-hidden',_0x6894b6=>!_0x6894b6)]}}),_0x131830;}['render'](){super['render'](),this['loadResources']('');}['loadResources'](_0xef879a){const _0x52beab=ot();this['_latestLoadResourcesUid']=_0x52beab,this['fire']('loadSourceResources',{'sourceId':this['_source']['id'],'query':_0xef879a,'uid':_0x52beab}),this['isLoading']=!0x0;}['setResources'](_0x299dc8,_0x474a89){if(_0x474a89&&_0x474a89!==this['_latestLoadResourcesUid'])return;const _0x2118a8=this['_source']['useDefaultFiltering']?this['_searchView']['getQuery']():'';this['_resourcesListView']['setResources'](_0x299dc8,_0x2118a8),_0x299dc8['length']>=this['_searchInputVisibleFrom']&&!this['children']['has'](this['_searchSection'])&&this['children']['add'](this['_searchSection'],0x0),requestAnimationFrame(()=>{this['isLoading']=!0x1;});}['updateResourceState'](_0x2625d5,_0x2953f6){this['_resourcesListView']['updateResourceState'](_0x2625d5,_0x2953f6);}}const Dr='ck-ai-chat-context-controls__source-balloon-panel',Pr='ck-button-icon\x20ck-button-back',Hr='ck-ai-header\x20ck-ai-header_small\x20ck-ai-header_source';class Mr{['_sourceResourceBalloons']=new Map();['_bodyCollection'];['_locale'];['_config'];constructor(_0x1ea10f,_0x218a2f,_0x4f37e3){this['_locale']=_0x1ea10f,this['_bodyCollection']=_0x218a2f,this['_config']=_0x4f37e3;}['showSourceResourcesBalloon']({source:_0x5d1f6f,withBackButton:_0x22324c}){let _0x4759b4=this['_sourceResourceBalloons']['get'](_0x5d1f6f['id']);_0x4759b4||(_0x4759b4=this['_createSourceResourceBalloonPanel'](),this['_sourceResourceBalloons']['set'](_0x5d1f6f['id'],_0x4759b4),this['_setupSingleResourceBalloonClickOutsideHandler'](_0x4759b4)),this['_addSourceResourceContent']({'balloonPanel':_0x4759b4,'source':_0x5d1f6f,'withBackButton':_0x22324c}),_0x4759b4['show']();const _0x8746a=this['_config']['getTargetElement']();_0x8746a&&_0x4759b4['pin']({'target':_0x8746a,'limiter':this['_config']['getLimiterElement']()});}['populateSourceResourceBalloon'](_0x5d6755,_0x20d25b,_0x18c7e4){const _0x25a4eb=this['_sourceResourceBalloons']['get'](_0x5d6755);if(!_0x25a4eb)return;const _0x289134=this['_getResourcesViewFromBalloon'](_0x25a4eb);_0x289134&&(_0x289134['setResources'](_0x20d25b,_0x18c7e4),_0x289134['once']('change:isLoading',()=>{_0x25a4eb['pin']({'target':this['_config']['getTargetElement'](),'limiter':this['_config']['getLimiterElement']()});}));}['closeSourceResourceBalloon'](_0x4898c8){const _0x60a981=this['_sourceResourceBalloons']['get'](_0x4898c8);_0x60a981&&requestAnimationFrame(()=>{_0x60a981['hide'](),this['_sourceResourceBalloons']['delete'](_0x4898c8),this['_config']['onBalloonClosed']();});}['isAnyResourceBalloonVisible'](){for(const _0x472a24 of this['_sourceResourceBalloons']['values']())if(_0x472a24['isVisible'])return!0x0;return!0x1;}['updateResourceState'](_0x334638,_0x110852,_0x143df6){const _0x277183=this['_sourceResourceBalloons']['get'](_0x334638);if(!_0x277183||!_0x277183['isVisible'])return;const _0x44d9ea=this['_config']['getTargetElement']();if(!_0x44d9ea)return;_0x277183['pin']({'target':_0x44d9ea,'limiter':this['_config']['getLimiterElement']()});const _0x122448=this['_getResourcesViewFromBalloon'](_0x277183);_0x122448&&_0x122448['updateResourceState'](_0x110852,_0x143df6);}['destroy'](){for(const _0x385476 of this['_sourceResourceBalloons']['values']())_0x385476['destroy']();this['_sourceResourceBalloons']['clear']();}['_createSourceResourceBalloonPanel'](){const _0x42d0bb=new Xt(this['_locale']);return _0x42d0bb['extendTemplate']({'attributes':{'class':Dr}}),this['_bodyCollection']['add'](_0x42d0bb),_0x42d0bb;}['_addSourceResourceContent']({balloonPanel:_0x1388ea,source:_0x307b95,withBackButton:_0x20dac9}){_0x1388ea['content']['clear']();const _0x525a00=this['_createBalloonHeader']({'balloonPanel':_0x1388ea,'source':_0x307b95,'withBackButton':_0x20dac9});_0x1388ea['content']['add'](_0x525a00);const _0x262ee9=this['_createBalloonResourcesView'](_0x307b95);_0x1388ea['content']['add'](_0x262ee9);}['_createBalloonHeader']({balloonPanel:_0x500e09,source:_0x5bd8ca,withBackButton:_0x3c8307}){const _0x3051f7=new _0x16cf91(this['_locale'],{'label':_0x5bd8ca['label'],'class':Hr});return _0x3c8307&&_0x3051f7['children']['add'](this['_createBackButton'](_0x500e09),0x0),_0x3051f7;}['_createBackButton'](_0x475d03){const _0x2bcb7b=new Nt(this['_locale']);return _0x2bcb7b['set']({'icon':_0x5005b7,'tooltip':us(this['_locale'],'AI_CHAT_CONTEXT_URL_BACK_TO_CONTEXT'),'tooltipPosition':'n','class':Pr}),_0x2bcb7b['on']('execute',()=>{_0x475d03['hide'](),this['_config']['onBackToContext']();}),_0x2bcb7b;}['_createBalloonResourcesView'](_0x41d4ca){const _0x3a67ea=new Lr(this['_locale'],{'source':_0x41d4ca,'searchInputVisibleFrom':this['_config']['searchInputVisibleFrom']});return _0x3a67ea['on']('loadSourceResources',(_0x4d0305,_0x8d72a9)=>{this['_config']['onLoadSourceResources'](_0x8d72a9);}),_0x3a67ea['on']('addResourceToContext',(_0x4e83c6,_0x383fb4)=>{this['_config']['onResourceSelected'](_0x383fb4['source'],_0x383fb4['resource']),this['closeSourceResourceBalloon'](_0x41d4ca['id']);}),_0x3a67ea;}['_getResourcesViewFromBalloon'](_0x41af4e){const _0x56da29=_0x41af4e['content']['get'](0x1);return _0x56da29 instanceof Lr?_0x56da29:null;}['_setupSingleResourceBalloonClickOutsideHandler'](_0x4e80a6){zt({'emitter':_0x4e80a6,'contextElements':[_0x4e80a6['element']],'callback':()=>{_0x4e80a6['hide'](),this['_config']['onBalloonClosed']();},'activator':()=>_0x4e80a6['isVisible']});}}const Ur=['addDocumentToContext','addFileToContext','addUrlToContext','addResourceToContext','removeContextItem','loadSourceResources','executeCustomItemCallback'],Vr='ck-ai-chat-context-controls',Br='ck-ai-chat-context-controls__pending-contexts',Gr='ck-ai-chat-context-controls__add-context-balloon-panel',Fr='ck-ai-chat-context-controls__add-context-button',Kr='ck-ai-chat-context-controls__url-balloon-panel',Wr='ck-ai-chat-context-controls__balloon-button',Yr='ck-ai-chat-context-controls__balloon-button-source',$r='ck-ai-chat-controls-button',qr='ck-ai-chat-context-chips-wrapper-balloon',Qr='ck-ai-chat-controls_context_show-more-button',Xr='ck-ai-chat-context-controls__show-more-balloon-panel',zr='ck-ai-chat',jr=[Xt['defaultPositions']['northArrowSouthWest'],Xt['defaultPositions']['northArrowSouth'],Xt['defaultPositions']['northArrowSouthEast'],Xt['defaultPositions']['southArrowNorthWest'],Xt['defaultPositions']['southArrowNorth'],Xt['defaultPositions']['southArrowNorthEast']];class Jr extends vt{['addContextButtonView'];['_currentContextsChips']=this['createCollection']();['_conversationContextsChips']=this['createCollection']();['_overflowManager'];['_addContextBalloonPanelView'];['_urlBalloonPanelView'];['_urlInputView'];['_resourcesBalloonView'];['_addContextBalloonConfig'];['_hasExactlyOneSource']=!0x1;['bodyCollection'];constructor(_0x19a0e7,_0x17afa0){super(_0x19a0e7),this['bodyCollection']=_0x17afa0['bodyCollection'],this['_currentContextsChips']=this['createCollection'](),this['_conversationContextsChips']=this['createCollection'](),this['addContextButtonView']=this['_createAddContextButtonView'](_0x19a0e7),this['_addContextBalloonPanelView']=this['_createAddContextBalloonPanelView'](_0x19a0e7),this['_urlBalloonPanelView']=this['_createUrlBalloonPanelView'](_0x19a0e7),this['_resourcesBalloonView']=this['_createResourcesBalloonView'](_0x19a0e7,_0x17afa0);const _0x5cefc4={'cssClasses':{'showMoreButton':Qr+'\x20'+As,'showMoreBalloon':Xr,'overflowContainer':qr,'controlsButton':$r}};this['_overflowManager']=new Kn(_0x19a0e7,this['_currentContextsChips'],_0x5cefc4,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'](_0x1b75b2,_0xf1c696){const _0x3cc654=this['_createContextButton'](_0x1b75b2,'current',!0x0,_0xf1c696);this['_addContextToCollection'](_0x3cc654,this['_currentContextsChips']),this['_overflowManager']['reorganizeChips']();}['removeContextItem'](_0x3010cb){this['_removeContextFromCollection'](_0x3010cb,this['_currentContextsChips']),this['_removeContextFromCollection'](_0x3010cb,this['_overflowManager']['overflowChips']),this['_overflowManager']['reorganizeChips']();}['setContextItemLoading'](_0x2bc142,_0xc8df03){let _0x3cf2ae=this['_currentContextsChips']['find'](_0x21d5ea=>_0x21d5ea['id']===_0x2bc142);_0x3cf2ae||(_0x3cf2ae=this['_overflowManager']['overflowChips']['find'](_0x3b5f31=>_0x3b5f31['id']===_0x2bc142)),_0x3cf2ae&&(_0x3cf2ae['isLoading']=_0xc8df03);}['setConversationContext'](_0x99373e){this['_conversationContextsChips']['clear']();for(const _0x5f2dfe of _0x99373e){const _0x10561e=this['_createContextButton'](_0x5f2dfe,'conversation',!0x1,!0x1);this['_addContextToCollection'](_0x10561e,this['_conversationContextsChips']);}}['clearCurrentContextItems'](){this['_currentContextsChips']['clear'](),this['_overflowManager']['clear']();}['clearConversationContextItems'](){this['_conversationContextsChips']['clear']();}['updateResourceState'](_0x5e9592,_0x1edd4a,_0xbc95){this['_resourcesBalloonView']['updateResourceState'](_0x5e9592,_0x1edd4a,_0xbc95);}['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:_0x1dbf1f,withBackButton:_0x301ff5}){this['_resourcesBalloonView']['showSourceResourcesBalloon']({'source':_0x1dbf1f,'withBackButton':_0x301ff5}),this['addContextButtonView']['isOn']=!0x0;}['populateSourceResourceBalloon'](_0x4169c0,_0x307be0,_0x3487f0,_0x5bdcdf){this['_resourcesBalloonView']['populateSourceResourceBalloon'](_0x4169c0,_0x3487f0,_0x5bdcdf);}['closeSourceResourceBalloon'](_0x9255b6){this['_resourcesBalloonView']['closeSourceResourceBalloon'](_0x9255b6),this['addContextButtonView']['isOn']=!0x1;}['setAddContextOptions'](_0x37758b){this['_setBalloonPanelContent'](this['_addContextBalloonPanelView'],this['locale'],_0x37758b),this['_setAddContextButtonEnabled'](_0x37758b);}['_setAddContextButtonEnabled'](_0x498c31){const _0x43518c=!_0x498c31['document']['isHidden']&&_0x498c31['document']['enabled'],_0x42b601=_0x498c31['urls']['enabled'],_0x21a087=_0x498c31['files']['enabled'],_0x557811=_0x498c31['sources']['length']>0x0,_0x4798bd=_0x498c31['customItems']&&_0x498c31['customItems']['length']>0x0;this['addContextButtonView']['isEnabled']=_0x43518c||_0x42b601||_0x21a087||_0x557811||_0x4798bd;}['_setupTemplate'](){this['setTemplate']({'tag':'div','attributes':{'class':[Vr,'ck-reset_all-excluded']},'children':[{'tag':'div','attributes':{'class':Br},'children':this['_currentContextsChips']}]});}['_bindEventHandlers'](){this['addContextButtonView']['on']('execute',()=>{this['_handleAddContextButtonClick']();});}['_createAddContextButtonView'](_0x2915af){const _0x4f9bf2=new Nt(_0x2915af);return _0x4f9bf2['set']({'label':us(_0x2915af,'AI_CHAT_CONTEXT_ADD_CONTEXT'),'class':$r+'\x20'+Fr+'\x20'+As,'icon':_0x3e656c,'isToggleable':!0x0,'tooltip':!0x0,'tooltipPosition':'sw'}),_0x4f9bf2;}['_createAddContextBalloonPanelView'](_0x3eceb7){return this['_createBaseBalloonPanel'](_0x3eceb7,Gr);}['_createUrlBalloonPanelView'](_0x409087){const _0x486e85=this['_createBaseBalloonPanel'](_0x409087,Kr);return this['_addUrlContent'](_0x486e85,_0x409087),_0x486e85;}['_createResourcesBalloonView'](_0x4c11a9,_0x4f110b){const _0x3f4a19={'searchInputVisibleFrom':_0x4f110b['searchInputVisibleFrom'],'onBackToContext':()=>{this['showAddContextBalloonPanel'](),this['_addContextBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':jr});},'onResourceSelected':(_0x19058a,_0x21945f)=>{this['fire']('addResourceToContext',{'source':_0x19058a,'resource':_0x21945f});},'onLoadSourceResources':_0x72aeaf=>{this['fire']('loadSourceResources',_0x72aeaf);},'onBalloonClosed':()=>{this['addContextButtonView']['isOn']=!0x1;},'getLimiterElement':()=>this['_getLimiterElement'](),'getTargetElement':()=>this['addContextButtonView']['element']};return new Mr(_0x4c11a9,_0x4f110b['bodyCollection'],_0x3f4a19);}['_getLimiterElement'](){return this['element']?.['closest']('.'+zr)||document['body'];}['_createBaseBalloonPanel'](_0x2120cf,_0x4c0fec){const _0x390c1b=new Xt(_0x2120cf);return _0x390c1b['extendTemplate']({'attributes':{'class':_0x4c0fec}}),this['bodyCollection']['add'](_0x390c1b),_0x390c1b;}['_setBalloonPanelContent'](_0x39cc8a,_0x43a2f0,_0x5cadf8){if(_0x39cc8a['content']['clear'](),!_0x5cadf8['document']['isHidden']&&_0x5cadf8['document']['enabled']){const _0x46399a=this['_createBalloonButton'](_0x43a2f0,{'label':us(_0x43a2f0,'AI_CHAT_CONTEXT_CURRENT_DOCUMENT'),'icon':_0xa5e512});_0x46399a['on']('execute',()=>{this['fire']('addDocumentToContext'),this['hideAddContextBalloonPanel']();}),_0x39cc8a['content']['add'](_0x46399a);}if(_0x5cadf8['urls']['enabled']){const _0x290280=this['_createBalloonButton'](_0x43a2f0,{'label':us(_0x43a2f0,'AI_CHAT_CONTEXT_URL_LABEL'),'icon':_0x1091b0});_0x290280['on']('execute',()=>{this['hideAddContextBalloonPanel'](),this['showUrlBalloonPanel'](),this['_urlBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':jr}),this['_urlInputView']['focus']();}),_0x39cc8a['content']['add'](_0x290280);}if(_0x5cadf8['files']['enabled']){const _0x320a6a=new _0x4a4e34(_0x43a2f0);_0x320a6a['set']({'label':us(_0x43a2f0,'AI_CHAT_CONTEXT_FILE_LABEL'),'icon':_0x1a4e7f,'withText':!0x0,'tooltip':!0x0,'class':Wr,'allowMultipleFiles':!0x0}),_0x320a6a['on']('execute',()=>{this['hideAddContextBalloonPanel']();}),_0x320a6a['on']('done',(_0x370c9c,_0x31ffa)=>{this['fire']('addFileToContext',_0x31ffa);}),_0x320a6a['tooltip']=!0x0,_0x39cc8a['content']['add'](_0x320a6a);}for(const _0x3801a3 of _0x5cadf8['sources']){const _0x21121d=this['_createBalloonButton'](_0x43a2f0,{'label':_0x3801a3['label'],'icon':_0x3801a3['icon']||_0x42b884,'type':'source'});_0x39cc8a['content']['add'](_0x21121d),_0x21121d['on']('execute',()=>{this['hideAddContextBalloonPanel'](),this['_showSourceResourcesBalloon']({'source':_0x3801a3,'withBackButton':!this['_hasExactlyOneSource']});});}for(const _0xccda82 of _0x5cadf8['customItems']||[]){const _0x276860=this['_createBalloonButton'](_0x43a2f0,{'label':_0xccda82['label'],'icon':_0xccda82['icon']||_0x42b884,'type':'customItem'});_0x39cc8a['content']['add'](_0x276860),_0x276860['on']('execute',()=>{this['hideAddContextBalloonPanel'](),this['fire']('executeCustomItemCallback',_0xccda82);});}this['_hasExactlyOneSource']=0x1===_0x39cc8a['content']['length'],this['_urlInputView']['withBackButton']=!this['_hasExactlyOneSource'];}['_addUrlContent'](_0x3740f9,_0x1ebbcd){this['_urlInputView']=new Sr(_0x1ebbcd),this['_urlInputView']['on']('submitUrl',(_0x1e3dd7,_0x359385)=>{this['_handleUrlSubmit'](_0x359385);}),this['_urlInputView']['on']('cancel',()=>{this['hideUrlBalloonPanel'](),this['_hasExactlyOneSource']||(this['showAddContextBalloonPanel'](),this['_addContextBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':jr}));}),this['_urlInputView']['on']('refreshBalloon',()=>{this['_urlBalloonPanelView']['isVisible']&&this['_urlBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':jr});}),_0x3740f9['content']['add'](this['_urlInputView']);}['_createBalloonButton'](_0x3030d2,_0x4ea50e){const _0x2845d2='source'===_0x4ea50e['type']?new Zr(_0x3030d2):new Nt(_0x3030d2);return _0x2845d2['set']({'label':_0x4ea50e['label'],'icon':_0x4ea50e['icon'],'withText':!0x0,'tooltip':!0x0,'tooltipPosition':'sw','class':Wr}),_0x2845d2;}['_setupAllBalloonClickOutsideHandlers'](){this['_setupAddContextBalloonClickOutsideHandler'](),this['_setupUrlBalloonClickOutsideHandler']();}['_setupUrlBalloonClickOutsideHandler'](){zt({'emitter':this['_urlBalloonPanelView'],'contextElements':[this['_urlBalloonPanelView']['element']],'callback':()=>{this['hideUrlBalloonPanel']();},'activator':()=>this['_urlBalloonPanelView']['isVisible']});}['_toggleAddContextBalloon'](_0x47bcf9){const _0x2d0243=this['_addContextBalloonConfig'];_0x2d0243['buttonView']['isOn']=_0x47bcf9,_0x47bcf9?_0x2d0243['balloonView']['show']():_0x2d0243['balloonView']['hide']();}['_setupAddContextBalloonClickOutsideHandler'](){const {balloonView:_0x312cbc,buttonView:_0x32368f,hideMethod:_0x2d9115}=this['_addContextBalloonConfig'];zt({'emitter':_0x312cbc,'contextElements':[_0x312cbc['element'],_0x32368f['element']],'callback':()=>{_0x2d9115();},'activator':()=>_0x32368f['isOn']&&!this['_urlBalloonPanelView']['isVisible']&&!this['_resourcesBalloonView']['isAnyResourceBalloonVisible']()});}['_createContextButton'](_0x30cd08,_0x3d8f7b,_0x2604c7=!0x1,_0x577277=!0x1){const _0x296975='conversation'===_0x3d8f7b||!0x0===_0x30cd08['isReadOnly'],_0x2e3b54=new Vn(this['locale'],_0x30cd08,_0x296975,_0x2604c7,_0x577277);return _0x296975||_0x2e3b54['on']('removeContextItemChip',()=>{this['fire']('removeContextItem',_0x2e3b54['id']);}),_0x2e3b54;}['_addContextToCollection'](_0x7acb11,_0xe998fb){_0xe998fb['add'](_0x7acb11,0x0);}['_removeContextFromCollection'](_0x4216a3,_0x508f5c){const _0x4a5d7c=_0x508f5c['find'](_0x2d35b5=>_0x2d35b5['id']===_0x4216a3);_0x4a5d7c&&_0x508f5c['remove'](_0x4a5d7c);}['_handleAddContextButtonClick'](){this['addContextButtonView']['isOn']?this['hideAddContextBalloonPanel']():(this['showAddContextBalloonPanel'](),this['_addContextBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':jr}),this['_hasExactlyOneSource']&&this['_addContextBalloonPanelView']['content']['get'](0x0)?.['fire']('execute'));}['_handleUrlSubmit'](_0x351f54){this['_urlInputView']['clear'](),this['hideUrlBalloonPanel'](),this['fire']('addUrlToContext',_0x351f54);}}class Zr extends Nt{['arrowView'];constructor(_0x47feaa){super(_0x47feaa),this['set']({'withText':!0x0,'role':'menuitem'}),this['arrowView']=this['_createArrowView'](),this['extendTemplate']({'attributes':{'class':[Yr]}});}['render'](){super['render'](),this['children']['add'](this['arrowView']);}['_createArrowView'](){const _0x2ff960=new xt();return _0x2ff960['content']=_0x26638d,_0x2ff960['extendTemplate']({'attributes':{'class':Yr+'__arrow'}}),_0x2ff960;}}class ta extends vt{['_cancelButtonView'];['_loaderView'];constructor(_0x1bfead){super(_0x1bfead),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 _0x3155f3=new Nt(this['locale']);return _0x3155f3['set']({'label':us(this['locale'],'AI_CHAT_STOP_GENERATING'),'withText':!0x0,'class':_s+'\x20ck-ai-button-stop-generating','icon':_0x270a28}),_0x3155f3['on']('execute',()=>{this['fire']('abortPromptStream');}),_0x3155f3;}['_createLoaderView'](){const _0x1f63f9=new vt(this['locale']);return _0x1f63f9['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':us(this['locale'],'AI_CHAT_IS_WRITING')}]}),_0x1f63f9;}}class ea extends vt{['_contextPanelView'];['_promptInputView'];['_promptCapabilitiesView'];['_loaderView'];['_modelUnavailableMessageView'];['_shouldRestorePromptInputFocus'];constructor(_0x10fffe,_0x151e27){super(_0x10fffe),this['_contextPanelView']=this['_createContextPanelView'](_0x10fffe,{'bodyCollection':_0x151e27['bodyCollection'],'searchInputVisibleFrom':_0x151e27['contextResourcesSearchInputVisibleFrom']}),this['_promptInputView']=this['_createPromptInputView'](_0x10fffe),this['_promptCapabilitiesView']=this['_createPromptCapabilitiesView'](_0x10fffe),this['_loaderView']=this['_createLoaderView'](_0x10fffe),this['_modelUnavailableMessageView']=this['_createModelUnavailableMessageView'](_0x10fffe),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'](...Ur)['to'](this),this['set']('isModelAvailable',!0x0),this['set']('isDisabled',!0x1);const _0x49e0d4=this['bindTemplate'];this['setTemplate']({'tag':'form','attributes':{'class':['ck','ck-ai-chat-controls',_0x49e0d4['if']('isDisabled','ck-ai-chat-controls-disabled')]},'children':[{'tag':'div','attributes':{'class':[_0x49e0d4['if']('isLoading','ck-hidden',_0x32d286=>_0x32d286||!this['isModelAvailable']),_0x49e0d4['if']('isModelAvailable','ck-hidden',_0x5c3983=>!_0x5c3983||this['isLoading'])]},'children':[this['_contextPanelView'],this['_promptInputView'],this['_promptCapabilitiesView']]},{'tag':'div','attributes':{'class':[_0x49e0d4['if']('isLoading','ck-hidden',_0x3b6f1a=>!_0x3b6f1a)]},'children':[this['_loaderView']]},{'tag':'div','attributes':{'class':[_0x49e0d4['if']('isModelAvailable','ck-hidden',_0x1157e2=>_0x1157e2)]},'children':[this['_modelUnavailableMessageView']]}]}),zt({'emitter':this['_promptInputView'],'activator':()=>this['isLoading'],'contextElements':()=>[this['element']],'callback':()=>{this['_shouldRestorePromptInputFocus']=!0x1;}}),this['on']('change:isLoading',this['_handlePromptInputFocus'],{'priority':'low'});}['_createContextPanelView'](_0x441dd8,_0x4b807b){return new Jr(_0x441dd8,_0x4b807b);}['_createPromptInputView'](_0xff7f20){return new lr(_0xff7f20,this['_contextPanelView']['addContextButtonView']);}['_createPromptCapabilitiesView'](_0x34018e){return new Tr(_0x34018e);}['_createLoaderView'](_0x2db31f){return new ta(_0x2db31f);}['_createModelUnavailableMessageView'](_0x2f9795){const _0x28984f=new ia(_0x2f9795);return _0x28984f['delegate']('startConversation')['to'](this),_0x28984f;}['_handlePromptInputFocus'](_0x378e36,_0x45c205,_0x4a9079){_0x4a9079?this['_shouldRestorePromptInputFocus']=!0x0:this['_shouldRestorePromptInputFocus']&&this['_promptInputView']['focus']();}['addContextItem'](_0x537213,_0x184b5d){this['_contextPanelView']['addContextItem'](_0x537213,_0x184b5d);}['removeContextItem'](_0x2b2af3){this['_contextPanelView']['removeContextItem'](_0x2b2af3);}['setContextItemLoading'](_0x46ccf6,_0x519d36){this['_contextPanelView']['setContextItemLoading'](_0x46ccf6,_0x519d36);}['setIsUploadInProgress'](_0x484c93){this['_promptInputView']['setIsUploadInProgress'](_0x484c93);}['setConversationContext'](_0xc3d4c8){this['_contextPanelView']['setConversationContext'](_0xc3d4c8);}['clearPendingContextUI'](){this['_contextPanelView']['clearCurrentContextItems']();}['clearConversationContextUI'](){this['_contextPanelView']['clearConversationContextItems']();}['updateResourceState'](_0x349328,_0x5b5d9c,_0x48d6be){this['_contextPanelView']['updateResourceState'](_0x349328,_0x5b5d9c,_0x48d6be);}['setWebSearch'](_0x3f33b2){this['_promptCapabilitiesView']['setWebSearch'](_0x3f33b2);}['setReasoning'](_0x15027b){this['_promptCapabilitiesView']['setReasoning'](_0x15027b);}['resetMessageInput'](){this['_promptInputView']['reset']();}['setAddContextOptions'](_0x3df7c0){this['_contextPanelView']['setAddContextOptions'](_0x3df7c0);}['setInputPlaceholder'](_0xdcd900){this['_promptInputView']['setPlaceholderText'](_0xdcd900);}['setModelList'](_0x5bf43c,_0x2fc8b8){this['_promptCapabilitiesView']['setModelList'](_0x5bf43c,_0x2fc8b8);}['setModel'](_0x3d24d9){_0x3d24d9?(this['isModelAvailable']=!0x0,this['_promptCapabilitiesView']['setModel'](_0x3d24d9)):this['isModelAvailable']=!0x1;}['enableModelSelector'](){this['_promptCapabilitiesView']['enableModelSelector']();}['disableModelSelector'](_0x1923aa){this['_promptCapabilitiesView']['disableModelSelector'](_0x1923aa);}['populateSourceResourceBalloon'](_0x15dc98,_0x4788e8,_0xda1012,_0x4faf8f){this['_contextPanelView']['populateSourceResourceBalloon'](_0x15dc98,_0x4788e8,_0xda1012,_0x4faf8f);}['closeSourceResourceBalloon'](_0x23b884){this['_contextPanelView']['closeSourceResourceBalloon'](_0x23b884);}['focusPromptInput'](_0x1aa531=!0x1){this['_promptInputView']['focus'](_0x1aa531);}['setPromptInputValue'](_0x3f0376){this['_promptInputView']['queryView']['fieldView']['reset'](),this['_promptInputView']['queryView']['fieldView']['value']=_0x3f0376;}}class ia extends vt{constructor(_0x548512){super(_0x548512);const _0x3a70f9=new Nt(_0x548512);_0x3a70f9['set']({'label':us(this['locale'],'AI_CHAT_MODEL_UNAVAILABLE_MESSAGE_BUTTON'),'withText':!0x0,'class':['ck-ai-chat-controls__start-new-chat-button'],'tooltip':''}),_0x3a70f9['delegate']('execute')['to'](this,'startConversation'),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat-controls-model-unavailable-message']},'children':[{'tag':'p','children':[{'text':us(this['locale'],'AI_CHAT_MODEL_UNAVAILABLE_MESSAGE_TEXT')+'\x20'},_0x3a70f9]}]});}}class sa extends _0x16cf91{['conversationStartButton'];['resizeButton'];constructor(_0x395c79,_0x5defba){super(_0x395c79,{'label':us(_0x395c79,'AI_CHAT_HEADING'),'class':'ck-ai-header\x20ck-ai-header_chat','icon':_0x439de6}),this['set']('isMaximized',!0x1),this['conversationStartButton']=this['_createStartConversationButton'](_0x395c79),this['children']['add'](this['conversationStartButton']),_0x5defba&&(this['resizeButton']=gs(_0x395c79,this),this['children']['add'](this['resizeButton']));}['_createStartConversationButton'](_0x2bd7f6){const _0x58b051=new Nt(_0x2bd7f6);return _0x58b051['set']({'label':us(this['locale'],'AI_CHAT_LABEL_NEW_CHAT'),'withText':!0x0,'icon':_0x4ec8b1,'class':'ck-ai-chat__start-conversation\x20'+_s}),_0x58b051['on']('execute',()=>{this['fire']('startConversation');}),_0x58b051;}}class na extends vt{constructor(_0x3edfda){super(_0x3edfda),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-disclaimer']},'children':[{'tag':'p','attributes':{'class':['ck','ck-ai-disclaimer__content']},'children':[{'text':us(_0x3edfda,'AI_DISCLAIMER_TEXT')}]}]});}}class ra extends vt{['chatHeader'];['chatFeed'];['chatControls'];['chatDisclaimer'];['_bodyCollection'];constructor(_0x2aac03,_0x453ac2){super(_0x2aac03),this['_bodyCollection']=new Qt(_0x2aac03),this['_bodyCollection']['attachToDom'](),this['chatHeader']=new sa(_0x2aac03,_0x453ac2['showResizeButton']),this['chatHeader']['delegate'](...sn)['to'](this),this['chatFeed']=new or(_0x2aac03,this['_bodyCollection']),this['chatFeed']['delegate'](...sn)['to'](this),this['chatControls']=new ea(_0x2aac03,{'bodyCollection':this['_bodyCollection'],'contextResourcesSearchInputVisibleFrom':_0x453ac2['contextResourcesSearchInputVisibleFrom']}),this['chatControls']['delegate'](...sn)['to'](this),this['chatDisclaimer']=new na(_0x2aac03),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-ai-chat','ck-rounded-corners'],'dir':_0x2aac03['uiLanguageDirection']},'children':[this['chatHeader'],this['chatFeed'],this['chatControls'],this['chatDisclaimer']]});}['populateSourceResourceBalloon'](_0x55e5bc,_0x5c185c,_0x4bf8dd,_0x432fa9){this['chatControls']['populateSourceResourceBalloon'](_0x55e5bc,_0x5c185c,_0x4bf8dd,_0x432fa9);}['closeSourceResourceBalloon'](_0x2a5853){this['chatControls']['closeSourceResourceBalloon'](_0x2a5853);}['destroy'](){this['_bodyCollection']['detachFromDom'](),super['destroy']();}}class aa extends _0x25e92e{static get['requires'](){return[cs];}['_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(_0x3f9979){super(_0x3f9979);const _0x4b1d1a=this['context']['plugins']['get']('AITabs');this['set']('isBusy',!0x1),this['_promiseQueue']=new mn(),this['_view']=new ra(this['context']['locale'],{'showResizeButton':_0x4b1d1a['showResizeButton'],'contextResourcesSearchInputVisibleFrom':this['context']['config']['get']('ai.chat.context.searchInputVisibleFrom')}),this['_view']['delegate'](...sn)['to'](this),this['_view']['on']('toggleSuggestionDisplayMode',(_0x3c3fdd,{showDiff:_0x137e93})=>{this['showDiff']=_0x137e93;}),_0x4b1d1a['view']['addTab']({'id':'chat','buttonLabel':us(this['context']['locale'],'AI_CHAT_HEADING'),'buttonIcon':_0x439de6,'order':0x0,'content':this['_view']}),this['_view']['chatControls']['bind']('isLoading')['to'](this,'isBusy',_0x1e84f5=>_0x1e84f5),this['_view']['chatFeed']['bind']('isPending')['to'](this,'isBusy',_0x20e975=>_0x20e975),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder']()),this['bind']('isModelAvailable')['to'](this['_view']['chatControls'],'isModelAvailable');}['destroy'](){super['destroy'](),this['_titleAnimationInterval']&&clearInterval(this['_titleAnimationInterval']);}['createConversation'](_0x1bd0b3){const _0x24050c=this['context']['config']['get']('ai.chat.welcomeMessage')??us(this['context']['locale'],'AI_CHAT_WELCOME_MESSAGE');this['_view']['chatFeed']['clear'](),this['_view']['chatControls']['enableModelSelector'](),this['_view']['chatControls']['setModelList'](_0x1bd0b3['availableModels'],!this['context']['config']['get']('ai.models.showModelSelector')),this['addFeedItemStaticMessage']({'id':'conversation-start','staticMessage':_0x24050c}),this['fire']('conversationCreated');}async['addFeedItemStaticMessage']({id:_0x1b3fcf,staticMessage:_0x2e9ca1}){return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('ai-reply',{'id':_0x1b3fcf,'initialContent':'<p>'+_0x2e9ca1+'</p>'});});}async['addFeedItemUserMessage'](_0xe09bbe){const _0xa50a71=_0xe09bbe['attributes']?.['displayedPrompt']||_0xe09bbe['userMessage'];return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('user-message',{'contextItems':Array['from'](_0xe09bbe['contextItems']['values']()),'initialContent':'<p>'+_0xa50a71+'</p>','id':_0xe09bbe['id']});});}async['addFeedItemError']({errorMessage:_0x437855,id:_0x480bb0}){return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('error-message',{'initialContent':'<p>'+_0x437855+'</p>','id':_0x480bb0});});}async['addFeedItemAIReply'](_0x1e2fa8){return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('ai-reply',{'id':_0x1e2fa8['interactionId']+':'+_0x1e2fa8['id']}),this['clearLoadingMessage']();});}async['addFeedItemAISuggestion'](_0x5a079f){const _0x1b7bdd=Xs(this['context']);let _0x345287=_0x1b7bdd['config']['get']('ai.availableReplyActions')||[...wn];if(_0x1b7bdd['plugins']['has']('TrackChanges')){if(!this['_isTrackChangesCommandValueBound']){this['_isTrackChangesCommandValueBound']=!0x0;const _0x244a91=_0x1b7bdd['commands']['get']('trackChanges');this['_view']['chatFeed']['bind']('isTrackChangesOn')['to'](_0x244a91,'value');}}else _0x345287=_0x345287['filter'](_0x2f3c40=>'insertSuggestion'!=_0x2f3c40);return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('ai-suggestion-reply',{'id':_0x5a079f['interactionId']+':'+_0x5a079f['id'],'areActionsDisabled':_0x5a079f['areActionsDisabled'],'showDiff':this['showDiff'],'availableActions':_0x345287}),this['clearLoadingMessage']();});}async['addFeedInteractionHeader'](_0x51e3c2,_0x5b03e4){return this['_promiseQueue']['enqueue'](async()=>{const _0x174768=this['_view']['chatFeed']['children']['last'];if(_0x174768 instanceof Jn)return this['_view']['chatFeed']['children']['remove'](_0x174768),void this['_view']['chatFeed']['addItem']('interaction-header',{'id':_0x51e3c2['id'],'capabilities':{'isWebSearchEnabled':_0x174768['capabilities']['isWebSearchEnabled']||_0x5b03e4['isWebSearchEnabled'],'isReasoningEnabled':_0x174768['capabilities']['isReasoningEnabled']||_0x5b03e4['isReasoningEnabled']}});this['_view']['chatFeed']['addItem']('interaction-header',{'id':_0x51e3c2['id'],'capabilities':_0x5b03e4});});}async['addFeedItemCustomElement'](_0x3b4c94,_0x24f443){let _0x462c39;return await this['_promiseQueue']['enqueue'](async()=>{_0x462c39=this['_view']['chatFeed']['addItem']('custom-element',{'content':_0x3b4c94,'id':_0x24f443});}),_0x462c39;}['removeFeedItem'](_0x196c48){this['_view']['chatFeed']['removeItem'](_0x196c48);}['hasFeedItem'](_0x53c049){return this['_view']['chatFeed']['hasItem'](_0x53c049);}['updateFeedInteractionHeader'](_0x1cd3cc){const _0x4ec57d=this['_view']['chatFeed']['children']['find'](_0x259aa1=>_0x259aa1['options']['id']==_0x1cd3cc['id']&&_0x259aa1 instanceof Jn);_0x4ec57d&&_0x4ec57d['set']('isVisible',_0x1cd3cc['isVisible']);}async['updateFeedItemAIReplyContent'](_0x136165){const _0x3445b2=_0x136165['renderingStrategy']||this['feedItemRenderingStrategy'];return this['_promiseQueue']['enqueue'](async _0x16e277=>{await this['_view']['chatFeed']['updateReplyItem']({..._0x136165,'abortSignal':_0x16e277,'renderingStrategy':_0x3445b2}),_0x136165['isDone']&&this['markFeedItemAsDone'](_0x136165['id']);});}['updateFeedItemAIReplySources'](_0xa480ff,_0x228a12){this['_view']['chatFeed']['updateWebSources'](_0xa480ff,_0x228a12);}async['updateFeedItemAIReplySuggestionContent'](_0x1b9d29){const _0x499949=_0x1b9d29['renderingStrategy']||this['feedItemRenderingStrategy'];return this['_promiseQueue']['enqueue'](async _0x5d1b17=>{await this['_view']['chatFeed']['updateSuggestionItem']({..._0x1b9d29,'abortSignal':_0x5d1b17,'renderingStrategy':_0x499949}),_0x1b9d29['isDone']&&this['markFeedItemAsDone'](_0x1b9d29['id']);});}['updateFeedItemAIReplySuggestionPartState'](_0x43009d){this['_view']['chatFeed']['updateSuggestionPartState'](_0x43009d);}['setFeedItemAIReplySuggestionPartActive'](_0x237df0){this['_view']['chatFeed']['setSuggestionPartActive'](_0x237df0);}['markFeedItemAsDone'](_0x113fc4){this['_view']['chatFeed']['markItemAsDone'](_0x113fc4);}['removeFeedInteraction'](_0x5e4b10){this['_view']['chatFeed']['getItemIds']()['filter'](_0x2c300a=>_0x2c300a['startsWith'](_0x5e4b10))['forEach'](_0x576ef0=>this['_view']['chatFeed']['removeItem'](_0x576ef0));}['startInteraction'](){const _0x52cd60=this['prepareLoadingMessage']({'isWebSearchEnabled':!0x1,'isReasoningEnabled':!0x1});this['setLoadingMessage'](_0x52cd60),this['_view']['chatControls']['disableModelSelector'](!this['context']['config']['get']('ai.models.showModelSelector')),this['isBusy']=!0x0,this['_view']['chatFeed']['startAutoScroll']();}['stopInteraction'](_0x193c15){this['_promiseQueue']['abort'](),this['_view']['chatFeed']['getItemIds']()['filter'](_0x4811bb=>_0x4811bb['startsWith'](_0x193c15['id']))['forEach'](_0x47bd59=>this['markFeedItemAsDone'](_0x47bd59)),this['isBusy']=!0x1,this['_view']['chatFeed']['stopAutoScroll']();}async['finishInteraction'](){return this['_promiseQueue']['queueEmptyPromise']['then'](()=>{this['isBusy']=!0x1,this['_view']['chatFeed']['stopAutoScroll']();});}['addContextItem'](_0x5924ae,_0x259fa7){this['_view']['chatControls']['addContextItem'](_0x5924ae,_0x259fa7);}['removeContextItem'](_0x58bef9){this['_view']['chatControls']['removeContextItem'](_0x58bef9);}['setContextItemLoading'](_0x2bf360,_0x1fc821){this['_view']['chatControls']['setContextItemLoading'](_0x2bf360,_0x1fc821);}['setIsUploadInProgress'](_0x40569c){this['_view']['chatControls']['setIsUploadInProgress'](_0x40569c);}['setConversationContext'](_0x4971d2){this['_view']['chatControls']['setConversationContext'](_0x4971d2);}['clearPendingContextUI'](){this['_view']['chatControls']['clearPendingContextUI']();}['clearConversationContextUI'](){this['_view']['chatControls']['clearConversationContextUI']();}['updateResourceState'](_0x2b8e70,_0x70f318,_0x481920){this['_view']['chatControls']['updateResourceState'](_0x2b8e70,_0x70f318,_0x481920);}['resetMessageInput'](){this['_view']['chatControls']['resetMessageInput'](),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder']());}['setAddContextOptions'](_0x52e429){this['_view']['chatControls']['setAddContextOptions'](_0x52e429);}['updateCapabilities'](_0x376a7f){this['_view']['chatControls']['setWebSearch'](_0x376a7f['isWebSearchEnabled']),this['_view']['chatControls']['setReasoning'](_0x376a7f['isReasoningEnabled']),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder'](_0x376a7f));}['setSelectedModel'](_0x44a620,_0x5c47cb){this['_view']['chatControls']['setModel'](_0x44a620),_0x5c47cb&&this['_view']['chatControls']['disableModelSelector'](!0x1);}['setFeedItemRenderingStrategy'](_0x2dc098){this['feedItemRenderingStrategy']=_0x2dc098;}['toggleLoadingSkeleton'](_0x5eb170){this['_view']['chatFeed']['toggleLoadingSkeleton'](_0x5eb170);}['resetConversationTitle'](){this['setConversationTitle'](us(this['context']['locale'],'AI_CHAT_HEADING'));}['setConversationTitle'](_0xacdf64,_0x52a3a8=!0x1){if(_0x52a3a8&&!bt()&&_0xacdf64['length'])return this['_view']['chatHeader']['label']='',void this['_animateConversationTitle'](_0xacdf64);this['_view']['chatHeader']['label']=_0xacdf64;}['setLoadingMessage'](_0x25c436){this['_view']['chatFeed']['setLoadingMessage'](_0x25c436);}['clearLoadingMessage'](){this['_view']['chatFeed']['setLoadingMessage']('');}['_animateConversationTitle'](_0x878641){let _0x58bbb9=0x0;clearInterval(this['_titleAnimationInterval']),this['_titleAnimationInterval']=setInterval(()=>{this['_view']['chatHeader']['label']=this['_view']['chatHeader']['label']+_0x878641[_0x58bbb9],_0x58bbb9++,_0x58bbb9===_0x878641['length']&&clearInterval(this['_titleAnimationInterval']);},0x1e);}['setIsMaximized'](_0x47201c){this['_view']['chatHeader']['isMaximized']=_0x47201c;}['prepareLoadingMessage'](_0x31d683){return _0x31d683['isWebSearchEnabled']&&_0x31d683['isReasoningEnabled']?us(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH_REASONING'):_0x31d683['isWebSearchEnabled']?us(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH'):_0x31d683['isReasoningEnabled']?us(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_REASONING'):us(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_REGULAR');}['_getInputPlaceholder'](_0x434d5d){return _0x434d5d?_0x434d5d['isWebSearchEnabled']&&_0x434d5d['isReasoningEnabled']?us(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH_REASONING'):_0x434d5d['isWebSearchEnabled']?us(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH'):_0x434d5d['isReasoningEnabled']?us(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REASONING'):us(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REGULAR'):us(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REGULAR');}['populateSourceResourceBalloon'](_0x34dd1a,_0x558ff5,_0x2eaaa9,_0x9e669f){this['_view']['populateSourceResourceBalloon'](_0x34dd1a,_0x558ff5,_0x2eaaa9,_0x9e669f);}['closeSourceResourceBalloon'](_0x440d54){this['_view']['closeSourceResourceBalloon'](_0x440d54);}['setPromptInputValue'](_0x8b9578){this['_view']['chatControls']['setPromptInputValue'](_0x8b9578);}['focusPromptInput'](_0x23eb42=!0x1){this['_view']['chatControls']['focusPromptInput'](_0x23eb42);}['scrollFeedToSuggestion'](_0x57704f,_0x3836af){this['_view']['chatFeed']['scrollToSuggestion'](_0x57704f,_0x3836af);}['startAutoScroll'](){this['_view']['chatFeed']['startAutoScroll']();}['disableControls'](){this['_view']['chatControls']['isDisabled']=!0x0;}['enableControls'](){this['_view']['chatControls']['isDisabled']=!0x1;}}class oa extends Dt{['sections'];constructor(_0x22a20e,_0x542c02){super(_0x22a20e),this['sections']=_0x542c02,this['items']['addMany'](this['sections']),this['extendTemplate']({'attributes':{'class':['ck-ai-chat-history__sections']}});}['filter'](_0x290abb){let _0x18454f=0x0,_0x69644e=0x0;for(const _0x4dd9aa of this['sections']){const {resultsCount:_0x3be370,totalItemsCount:_0x209664}=_0x4dd9aa['filter'](_0x290abb);_0x18454f+=_0x3be370,_0x69644e+=_0x209664;}return{'resultsCount':_0x18454f,'totalItemsCount':_0x69644e};}}class ha extends Ht{['title'];['itemsViews'];['_itemsListView'];constructor(_0x345ecf,{title:_0x3a71ff,items:_0x19568d}){super(_0x345ecf);const _0x385749=this['bindTemplate'];this['set']('isVisible',!0x0),this['title']=_0x3a71ff,this['itemsViews']=_0x19568d;const _0x64c332=new vt(_0x345ecf);_0x64c332['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-history__section-title']},'children':[this['title']]}),this['_itemsListView']=new Dt(_0x345ecf),this['_itemsListView']['items']['addMany'](this['itemsViews']),this['setTemplate']({'tag':'li','attributes':{'class':['ck-ai-chat-history__section',_0x385749['if']('isVisible','ck-hidden',_0xb3123=>!_0xb3123)]},'children':[_0x64c332,this['_itemsListView']]});}['filter'](_0x406ab3){const _0x1dea25=this['itemsViews']['length'];let _0x5cb978=0x0;for(const _0x408adf of this['itemsViews']){if(_0x406ab3){const _0x2c92ac=_0x408adf['isMatching'](_0x406ab3);_0x408adf['isVisible']=!!_0x2c92ac,_0x408adf['highlightText'](_0x406ab3);}else _0x408adf['isVisible']=!0x0,_0x408adf['highlightText'](null);_0x408adf['isVisible']&&_0x5cb978++;}return this['isVisible']=_0x5cb978>0x0,{'resultsCount':_0x5cb978,'totalItemsCount':_0x1dea25};}['getItem'](_0x474fe4){return this['itemsViews']['find'](_0x5d9bc0=>_0x5d9bc0['id']===_0x474fe4);}['removeItem'](_0x1c461e){const _0x99942e=this['itemsViews']['indexOf'](_0x1c461e);-0x1!==_0x99942e&&(this['itemsViews']['splice'](_0x99942e,0x1),this['_itemsListView']['items']['remove'](_0x1c461e));}}class ca extends/* #__PURE__ -- @preserve */
27
+ _0xb2e6c2(Ht){['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(_0xb886e9,_0x2c9bf0){super(_0xb886e9);const _0x5d6be6=this['bindTemplate'];this['set']('isEdit',!0x1),this['set']('isVisible',!0x0),this['set']('pinned',!!_0x2c9bf0['pinned']),this['set']('loadingState',null),this['id']=_0x2c9bf0['id'];const {title:_0x29c7f2,createdAt:_0x4dee05,active:_0x4aba61=!0x1}=_0x2c9bf0;this['_titleView']=new _0x5baf8b(),this['_titleView']['text']=_0x29c7f2,this['_titleView']['extendTemplate']({'attributes':{'class':['ck-ai-chat-history__item-title']}});const _0x13d5e4=this['_createCheckView'](),_0x47d1e5=this['_createPinButtonView'](_0xb886e9),_0x3e8919=this['_createMenuDropdownView'](),_0xb40c6f=this['_createEditInputView'](_0xb886e9,_0x29c7f2),_0x308049=this['_createAcceptEditButtonView'](_0xb886e9,_0xb40c6f),_0x3cf9fd=this['_createCancelEditButtonView'](_0xb886e9,_0xb40c6f);this['actions']=this['createCollection'](),this['mainContent']=this['createCollection'](),this['mainContent']['add'](this['_titleView']),this['actions']['add'](_0x47d1e5),this['actions']['add'](_0x3e8919),this['on']('change:isEdit',(_0x395c9f,_0x266017,_0x41d387)=>{this['actions']['clear'](),this['mainContent']['clear'](),_0x41d387?(this['actions']['add'](_0x308049),this['actions']['add'](_0x3cf9fd),this['mainContent']['add'](_0xb40c6f),_0xb40c6f['element']['focus']()):(this['actions']['add'](_0x47d1e5),this['actions']['add'](_0x3e8919),this['mainContent']['add'](this['_titleView']));}),this['setTemplate']({'tag':'li','attributes':{'class':['ck-ai-chat-history__item',_0x4aba61?'ck-ai-chat-history__item--active':'',_0x5d6be6['if']('isVisible','ck-hidden',_0xe71543=>!_0xe71543),_0x5d6be6['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',_0x5d6be6['if']('loadingState','ck-hidden',_0x552789=>!!_0x552789)]},'children':_0x4aba61?[_0x13d5e4]:[]},{'tag':'div','attributes':{'class':['ck-ai-loader',_0x5d6be6['if']('loadingState','ck-hidden',_0x442db3=>!_0x442db3)]},'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',_0x5d6be6['if']('loadingState','ck-hidden',_0x49528e=>!!_0x49528e)]},'children':this['mainContent']},{'tag':'div','attributes':{'class':['ck-ai-loader__text',_0x5d6be6['if']('loadingState','ck-hidden',_0x98dd7f=>!_0x98dd7f)]},'children':[{'text':_0x5d6be6['to']('loadingState',_0x5a93ea=>_0x5a93ea?us(this['locale'],ca['LOADING_LABELS'][_0x5a93ea]):'')}]}]},{'tag':'span','attributes':{'class':['ck-ai-chat-history__item-date']},'children':[_0x4dee05]}]},{'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'](_0x1299e3){this['_titleView']['text']=_0x24fbe9(_0x1299e3);}['updateLoadingState'](_0x5b7a86,_0x14e75e){this['set']('loadingState',_0x14e75e?_0x5b7a86:null);}['_createCheckView'](){const _0x190f74=new xt();return _0x190f74['set']({'content':_0xe4c6eb}),_0x190f74;}['_createPinButtonView'](_0x1a05a3){const _0x43a25f=new Nt(_0x1a05a3);return _0x43a25f['set']({'label':us(_0x1a05a3,'AI_CHAT_HISTORY_PIN_BUTTON'),'icon':_0xc8b8cf,'withText':!0x1,'tooltip':!0x0}),_0x43a25f['bind']('isOn')['to'](this,'pinned'),_0x43a25f['on']('execute',()=>{const _0x5ade8b=!this['pinned'];this['fire']('setConversationPinned',{'id':this['id'],'pinned':_0x5ade8b});}),_0x43a25f;}['_createMenuDropdownView'](){const _0x457a10=Gt(this['locale'],_0x440150),_0x295be8=_0x457a10['panelView']['children'];_0x457a10['buttonView']['set']({'label':us(this['locale'],'AI_CHAT_HISTORY_SHOW_MORE_ITEMS'),'icon':_0x1d2157}),_0x457a10['panelPosition']='sw';const _0x41c32e=new Nt(this['locale']);_0x41c32e['label']=us(this['locale'],'AI_CHAT_HISTORY_EDIT_NAME'),_0x41c32e['withText']=!0x0,_0x41c32e['on']('execute',()=>{this['isEdit']=!0x0;});const _0x5467f7=new Nt(this['locale']);_0x5467f7['label']=us(this['locale'],'AI_CHAT_HISTORY_REMOVE'),_0x5467f7['withText']=!0x0,_0x5467f7['on']('execute',()=>{this['showConfirm'](us(this['locale'],'AI_CHAT_HISTORY_REMOVE_CONFIRM'),this['element'])['then'](()=>{this['fire']('removeConversation',{'id':this['id']});});});const _0x3c1883=new Dt(this['locale']),_0x18f8b9=new Ht(this['locale']);_0x18f8b9['children']['add'](_0x41c32e);const _0x34f669=new Ht(this['locale']);return _0x34f669['children']['add'](_0x5467f7),_0x3c1883['items']['addMany']([_0x18f8b9,_0x34f669]),_0x295be8['add'](_0x3c1883),_0x457a10;}['_createEditInputView'](_0x49b2ed,_0x51fe91){const _0x55fc14=new _0x4b5d97(_0x49b2ed),_0x4fba19=_0x55fc14['bindTemplate'];return _0x55fc14['value']=_0x51fe91,_0x55fc14['extendTemplate']({'on':{'keydown':_0x4fba19['to'](_0x53b9e6=>{'Enter'==_0x53b9e6['key']&&this['_commitEditInputValue'](_0x55fc14);})}}),_0x55fc14;}['_createAcceptEditButtonView'](_0x53802e,_0x1c7104){const _0x72bd60=new Nt(_0x53802e);return _0x72bd60['set']({'icon':_0xe4c6eb,'withText':!0x1,'tooltip':us(_0x53802e,'AI_CHAT_HISTORY_ACCEPT')}),_0x72bd60['extendTemplate']({'attributes':{'class':['ck-confirm-view-submit']}}),_0x72bd60['on']('execute',()=>{this['_commitEditInputValue'](_0x1c7104);}),_0x72bd60;}['_commitEditInputValue'](_0x2596cc){const _0x355dba=_0x2596cc['element']['value']||'';this['_titleView']['text']=_0x355dba,this['isEdit']=!0x1,this['fire']('editConversationTitle',{'id':this['id'],'title':_0x355dba});}['_createCancelEditButtonView'](_0x3d2abe,_0x5848da){const _0x42fb96=new Nt(_0x3d2abe);return _0x42fb96['set']({'icon':_0x45659b,'withText':!0x1,'tooltip':us(_0x3d2abe,'AI_CHAT_HISTORY_CANCEL')}),_0x42fb96['extendTemplate']({'attributes':{'class':['ck-confirm-view-cancel']}}),_0x42fb96['on']('execute',()=>{this['isEdit']=!0x1,_0x5848da['value']=this['_titleView']['text']||'',this['fire']('edit:cancel');}),_0x42fb96;}['_createSpinnerView'](){const _0x2aed36=new vn('tiny');return _0x2aed36['isVisible']=!0x0,_0x2aed36;}['isMatching'](_0x12f954){return this['_titleView']&&'string'==typeof this['_titleView']['text']&&this['_titleView']['text']['match'](_0x12f954)?{'title':!0x0}:null;}['highlightText'](_0x103026){this['_titleView']['highlightText'](_0x103026);}}class la extends vt{['searchView'];['mainErrorView'];['skeletonView'];['emptyView'];['sectionsView'];['resizeButton'];constructor(_0x1fd4ac,_0x270b04){super(_0x1fd4ac),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 _0x1d3981=new _0x16cf91(_0x1fd4ac,{'label':us(_0x1fd4ac,'AI_CHAT_HISTORY_HEADING'),'icon':_0xc604bb,'class':'ck-ai-header\x20ck-ai-header_history'});_0x270b04&&(this['resizeButton']=gs(_0x1fd4ac,this),_0x1d3981['children']['add'](this['resizeButton'])),this['sectionsView']=new oa(_0x1fd4ac,[]),this['sectionsView']['delegate'](...ua)['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',_0x121ca5=>!_0x121ca5)]}}),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':[_0x1d3981,{'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 _0x44746e=new _0x214c15(this['locale'],{'filteredView':this['sectionsView'],'queryView':{'label':us(this['locale'],'AI_CHAT_HISTORY_SEARCH_LABEL')},'infoView':{'text':{'notFound':{'primary':_0x295d8=>us(this['locale'],'AI_CHAT_HISTORY_SEARCH_NOT_FOUND_PRIMARY',_0x295d8),'secondary':us(this['locale'],'AI_CHAT_HISTORY_SEARCH_NOT_FOUND_SECONDARY')}}}}),_0x41c837=this['_createErrorView']();return _0x41c837['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('errorMessage','ck-hidden',_0x997601=>!_0x997601)]}}),_0x44746e['on']('render',()=>{_0x44746e['children']['add'](_0x41c837,0x1);}),_0x44746e['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isSearchViewVisible','ck-hidden',_0x1b15e9=>!_0x1b15e9)]}}),_0x44746e;}['_createSkeletonView'](){const _0x581a20=new sr(this['locale'],nr['aiHistory']);return _0x581a20['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isLoading','ck-hidden',_0x287437=>!_0x287437)]}}),_0x581a20;}['_createErrorView'](){const _0x681284=new vt(this['locale']),_0x10616d=new Nt(this['locale']);_0x10616d['set']({'withText':!0x1,'icon':_0x45659b,'class':'ck-ai-notification_error__dismiss-button'}),_0x10616d['bind']('isVisible')['to'](this,'hasItems',_0x275199=>!!_0x275199),_0x10616d['on']('execute',()=>{this['errorMessage']='';});const _0x2b070b=this['bindTemplate'];return _0x681284['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-notification','ck-ai-notification_error']},'children':[{'tag':'p','children':[{'text':_0x2b070b['to']('errorMessage')}]},_0x10616d]}),_0x681284;}['_createEmptyStateView'](){const _0x141234=new Nt(this['locale']);_0x141234['set']({'label':us(this['locale'],'AI_CHAT_LABEL_NEW_CHAT'),'withText':!0x0,'icon':_0x4ec8b1,'class':'ck-ai-chat__start-conversation\x20'+_s}),_0x141234['on']('execute',()=>{this['fire']('openChat');});const _0x2c9009=new vt(this['locale']);return _0x2c9009['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-history__empty',this['bindTemplate']['if']('isEmptyViewVisible','ck-hidden',_0x352fda=>!_0x352fda)]},'children':[{'tag':'p','attributes':{'class':['ck-ai-chat-history__empty-message']},'children':[us(this['locale'],'AI_CHAT_HISTORY_EMPTY_MESSAGE')]},_0x141234]}),_0x2c9009;}['_createListItemViews'](_0x24b338,_0xbce777){const _0x2b5995=[];for(const _0xb5d7bf of _0x24b338){const _0x6af335=new ca(_0xbce777,_0xb5d7bf);_0x6af335['delegate'](...ua)['to'](this),_0x2b5995['push'](_0x6af335);}return _0x2b5995;}['updateHistoryItemsWithCategories'](_0x13a1f0){const _0x231f10=this['locale']||'en',_0x16f7fc=[];for(const _0x44d143 of _0x13a1f0){const _0x1075ae=this['_createListItemViews'](_0x44d143['items'],_0x231f10);_0x16f7fc['push'](new ha(_0x231f10,{'title':_0x44d143['title'],'items':_0x1075ae}));}this['sectionsView']['sections']=_0x16f7fc,this['sectionsView']['items']['clear'](),this['sectionsView']['items']['addMany'](_0x16f7fc),this['hasItems']=_0x13a1f0['some'](_0x4ace8b=>_0x4ace8b['items']['length']>0x0),this['_refreshSearch']();}['removeHistoryItem'](_0x42e994){for(const _0x1a71bf of this['sectionsView']['sections']){const _0x357358=_0x1a71bf['getItem'](_0x42e994);if(_0x357358){if(_0x1a71bf['removeItem'](_0x357358),0x0===_0x1a71bf['itemsViews']['length']){const _0xae5a8=this['sectionsView']['sections']['indexOf'](_0x1a71bf);-0x1!==_0xae5a8&&(this['sectionsView']['sections']['splice'](_0xae5a8,0x1),this['sectionsView']['items']['remove'](_0x1a71bf));}this['hasItems']=this['sectionsView']['sections']['length']>0x0,this['_refreshSearch']();break;}}}['updateItemTitle'](_0x34e500,_0x5c8f32){for(const _0x5865e5 of this['sectionsView']['sections']){const _0x14ee54=_0x5865e5['getItem'](_0x34e500);if(_0x14ee54){_0x14ee54['updateTitle'](_0x5c8f32);break;}}}['updateItemLoadingState'](_0x286d58,_0x28806c,_0x51d8da){for(const _0x11bc45 of this['sectionsView']['sections']){const _0x1e2b8e=_0x11bc45['getItem'](_0x286d58);if(_0x1e2b8e){_0x1e2b8e['updateLoadingState'](_0x28806c,_0x51d8da);break;}}}['_refreshSearch'](){if(this['hasItems']){const _0x5aa985=this['searchView']['queryView']['fieldView']?.['element']?.['value']||'';this['searchView']['search'](_0x5aa985);}}}const ua=['showConversationHistory','removeConversation','editConversationTitle','setConversationPinned','selectConversation','openChat','resizeTabs'];class da extends _0x25e92e{static get['requires'](){return[cs];}['_historyView'];static get['pluginName'](){return'AIChatHistoryUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x18c1c3){super(_0x18c1c3);const _0x2d7d8f=this['context']['plugins']['get']('AITabs');this['_historyView']=new la(this['context']['locale'],_0x2d7d8f['showResizeButton']),this['_historyView']['delegate'](...ua)['to'](this),_0x2d7d8f['view']['addTab']({'id':'history','buttonLabel':us(this['context']['locale'],'AI_CHAT_HISTORY_HEADING'),'buttonIcon':_0xc604bb,'order':0x0,'content':this['_historyView']});}['removeHistoryItem'](_0x46a89c){this['_historyView']['removeHistoryItem'](_0x46a89c);}['updateItems'](_0x505516){this['_historyView']['updateHistoryItemsWithCategories'](_0x505516);}['updateItemTitle'](_0x45786e,_0x24cf93){this['_historyView']['updateItemTitle'](_0x45786e,_0x24cf93);}['updateItemLoadingState'](_0x4d5c17,_0x428053,_0xcad0bf){this['_historyView']['updateItemLoadingState'](_0x4d5c17,_0x428053,_0xcad0bf);}['setLoadingSkeleton'](_0x143e0b){this['_historyView']['isLoading']=_0x143e0b;}['showError'](_0x4b2038){this['_historyView']['errorMessage']=_0x4b2038;}['hideError'](){this['_historyView']['errorMessage']='';}['setIsMaximized'](_0x38f7be){this['_historyView']['isMaximized']=_0x38f7be;}}class _a extends ct(){['id'];['createdAt'];constructor({id:_0x63010d,title:_0x42cb9b,createdAt:_0x3c1230,updatedAt:_0x4b4ea9,pinned:_0x4722ba}){super(),this['id']=_0x63010d,this['createdAt']=new Date(_0x3c1230),this['set']('title',_0x42cb9b),this['set']('updatedAt',_0x4b4ea9?new Date(_0x4b4ea9):null),this['set']('pinned',_0x4722ba||!0x1);}['updateTitle'](_0x24fefd){this['set']('title',_0x24fbe9(_0x24fefd)),this['updatedAt']=new Date();}['updatePinned'](_0x455acc){this['set']('pinned',_0x455acc),this['updatedAt']=new Date();}}class Aa extends pt(){['items']=[];['connector'];['group'];constructor({connector:_0x525b42,group:_0x39e2bf}){super(),this['connector']=_0x525b42,this['group']=_0x39e2bf;}async['init'](){try{const _0xe34e70=this['connector']['fetchConversations'](this['group']),_0x55ea88=await _0xe34e70['getConversations']();this['loadItems'](_0x55ea88);}catch(_0x33d014){this['fire']('error',{'error':_0x33d014,'operation':'init'});}}['addItem'](_0x890464){this['items']['push'](_0x890464);}async['removeItem'](_0x59ada6){const _0x1621e1=this['items']['findIndex'](_0x2117ac=>_0x2117ac['id']===_0x59ada6);if(-0x1===_0x1621e1)return!0x1;try{return await this['connector']['deleteConversation'](_0x59ada6)['execute'](),this['items']['splice'](_0x1621e1,0x1),this['fire']('itemRemoved',{'itemId':_0x59ada6}),!0x0;}catch(_0x4150ac){return this['fire']('error',{'error':_0x4150ac,'operation':'removeItem','itemId':_0x59ada6}),!0x1;}}['getItem'](_0x457c3d){return this['items']['find'](_0x410222=>_0x410222['id']===_0x457c3d);}async['updateItemTitle'](_0x116baf,_0x1c5795){const _0x578397=this['getItem'](_0x116baf);if(!_0x578397)return!0x1;try{return await this['connector']['updateConversation'](_0x116baf,{'title':_0x1c5795})['getResult'](),_0x578397['updateTitle'](_0x1c5795),this['fire']('itemUpdated',{'itemId':_0x116baf,'updates':{'title':_0x1c5795}}),!0x0;}catch(_0x5737ef){return this['fire']('error',{'error':_0x5737ef,'operation':'updateItemTitle','itemId':_0x116baf}),!0x1;}}async['updateItemPinned'](_0x37f4d8,_0x29b32d){const _0x4c4990=this['getItem'](_0x37f4d8);if(!_0x4c4990)return!0x1;try{return await this['connector']['updateConversation'](_0x37f4d8,{'pinned':_0x29b32d})['getResult'](),_0x4c4990['updatePinned'](_0x29b32d),this['fire']('itemUpdated',{'itemId':_0x37f4d8,'updates':{'pinned':_0x29b32d}}),!0x0;}catch(_0x3c6c5c){return this['fire']('error',{'error':_0x3c6c5c,'operation':'updateItemPinned','itemId':_0x37f4d8}),!0x1;}}['loadItems'](_0x4ba320){try{this['items']=[],_0x4ba320['map'](_0x36d128=>{this['addItem'](new _a(_0x36d128));}),this['fire']('itemsLoaded',{'items':[...this['items']]});}catch(_0x5c6a40){this['fire']('error',{'error':_0x5c6a40,'operation':'loadItems'});}}['getItems'](_0x224e52={}){const _0x4b2cdc=void 0x0!==_0x224e52['pinned']&&_0x224e52['pinned'],_0x34960f=_0x224e52['from']?new Date(_0x224e52['from']['getFullYear'](),_0x224e52['from']['getMonth'](),_0x224e52['from']['getDate']()):null,_0x45a5af=_0x224e52['to']?new Date(_0x224e52['to']['getFullYear'](),_0x224e52['to']['getMonth'](),_0x224e52['to']['getDate']()):null;return this['items']['filter'](_0x1f5ecd=>{if(_0x1f5ecd['pinned']!==_0x4b2cdc)return!0x1;if(_0x45a5af){const _0x379261=new Date(_0x1f5ecd['createdAt']['getFullYear'](),_0x1f5ecd['createdAt']['getMonth'](),_0x1f5ecd['createdAt']['getDate']());return _0x34960f?_0x34960f['getTime']()===_0x45a5af['getTime']()?_0x379261['getTime']()===_0x34960f['getTime']():_0x379261<_0x45a5af&&_0x379261>=_0x34960f:_0x379261<_0x45a5af;}return!0x0;});}}class ga extends _0x25e92e{['_aiConnector'];['_aiChatHistoryUi'];['_aiChatController'];static get['requires'](){return[ls,Js,da,cs];}static get['pluginName'](){return'AIChatHistoryController';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){this['_aiConnector']=this['context']['plugins']['get'](ls),this['_aiChatHistoryUi']=this['context']['plugins']['get'](da),this['_aiChatController']=this['context']['plugins']['get'](Js);const _0x16ce3b=this['context']['plugins']['get'](cs);try{const _0x529d74=this['_aiChatController']['getGroupId']();this['history']=new Aa({'connector':this['_aiConnector'],'group':_0x529d74}),this['listenTo'](this['_aiChatHistoryUi'],'removeConversation',(_0x155b29,_0x38d70c)=>{this['_setItemLoading'](_0x38d70c['id'],'remove'),this['_handleRemove'](_0x38d70c['id']);}),this['listenTo'](this['_aiChatHistoryUi'],'editConversationTitle',(_0x5205ca,_0x24b2ce)=>{this['_setItemLoading'](_0x24b2ce['id'],'rename'),this['_handleEditTitle'](_0x24b2ce['id'],_0x24b2ce['title']);}),this['listenTo'](this['history'],'itemUpdated',(_0x5d1820,_0x5d9b81)=>{void 0x0!==_0x5d9b81['updates']['title']&&this['_aiChatHistoryUi']['updateItemTitle'](_0x5d9b81['itemId'],_0x5d9b81['updates']['title']),void 0x0!==_0x5d9b81['updates']['pinned']&&this['_updateHistoryItemsUI'](),this['_clearItemLoading'](_0x5d9b81['itemId']);}),this['listenTo'](this['history'],'itemRemoved',(_0x561e69,_0x582c64)=>{this['_aiChatController']['_handleRemovedConversation'](_0x582c64['itemId']),this['_aiChatHistoryUi']['removeHistoryItem'](_0x582c64['itemId']),this['_clearItemLoading'](_0x582c64['itemId']);}),this['listenTo'](this['history'],'itemsLoaded',()=>{this['_updateHistoryItemsUI']();}),this['listenTo'](this['history'],'error',(_0x196b07,_0x312a8b)=>{this['_handleHistoryErrorUI'](_0x312a8b['error'],_0x312a8b['operation'],_0x312a8b['itemId']);}),this['listenTo'](this['_aiChatHistoryUi'],'selectConversation',(_0x80dafe,_0x2dfe9f)=>{this['_handleSelectConversation'](_0x2dfe9f['id']);}),this['listenTo'](this['_aiChatHistoryUi'],'setConversationPinned',(_0x3e626f,_0x35bbd1)=>{const _0x5606a2=_0x35bbd1['pinned']?'pin':'unpin';this['_setItemLoading'](_0x35bbd1['id'],_0x5606a2),this['_handleTogglePin'](_0x35bbd1['id'],_0x35bbd1['pinned']);}),this['listenTo'](this['_aiChatHistoryUi'],'openChat',()=>{_0x16ce3b['view']['activateTab']('chat');}),this['listenTo'](this['_aiChatController'],'change:activeConversation',()=>{this['_updateHistoryItemsUI']();}),_0x16ce3b['view']['on']('activateTab:history',()=>{this['_showConversationHistory']();}),this['listenTo'](_0x16ce3b,'resizedTabs',(_0x2a7414,_0x21a525)=>{this['_setIsMaximized'](_0x21a525);}),this['listenTo'](this['_aiChatHistoryUi'],'resizeTabs',()=>{_0x16ce3b['resize']();});}catch(_0x1ca7b0){this['_handleHistoryErrorUI'](_0x1ca7b0,'init');}}async['_handleEditTitle'](_0xc4d110,_0x27b197){await this['history']['updateItemTitle'](_0xc4d110,_0x27b197);}async['_handleTogglePin'](_0x38efb8,_0x16421f){await this['history']['updateItemPinned'](_0x38efb8,_0x16421f);}async['_handleRemove'](_0x2c818a){await this['history']['removeItem'](_0x2c818a);}async['_handleSelectConversation'](_0x5a7376){await this['_aiChatController']['loadConversation'](_0x5a7376);}async['_showConversationHistory'](){this['_aiChatHistoryUi']['showError'](''),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x0),await this['history']['init'](),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x1);}['_updateHistoryItemsUI'](){const _0x278a0a=this['_aiChatController']['activeConversation']?.['id'],_0x2edec8=this['_getCategorizedItems']()['map'](_0x28e2f3=>({'title':_0x28e2f3['title'],'items':_0x28e2f3['items']['map'](_0x2068d1=>({'id':_0x2068d1['id'],'title':_0x2068d1['title']||us(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION'),'createdAt':new Date(_0x2068d1['createdAt'])['toLocaleDateString'](),'active':_0x2068d1['id']===_0x278a0a,'pinned':_0x2068d1['pinned']}))}));this['_aiChatHistoryUi']['updateItems'](_0x2edec8);}['_setItemLoading'](_0x8f9085,_0x25c3fe){this['_aiChatHistoryUi']['updateItemLoadingState'](_0x8f9085,_0x25c3fe,!0x0);}['_clearItemLoading'](_0x343465){this['_aiChatHistoryUi']['updateItemLoadingState'](_0x343465,null,!0x1);}['_handleHistoryErrorUI'](_0x1bb76a,_0x51a7eb,_0x5cbd65){const _0x591f63=this['_generateErrorMessage'](_0x51a7eb,_0x5cbd65);this['_aiChatHistoryUi']['showError'](_0x591f63),_0x5cbd65&&this['_clearItemLoading'](_0x5cbd65),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x1);}['_generateErrorMessage'](_0x139690,_0x4b63be){const _0x49ad30=_0x4b63be?this['history']['getItem'](_0x4b63be):null,_0x27083e=_0x49ad30?.['title']||us(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION');switch(_0x139690){case'updateItemTitle':return us(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_UPDATE_TITLE',_0x27083e);case'updateItemPinned':{const _0x24edc0=us(this['context']['locale'],_0x49ad30?.['pinned']?'AI_CHAT_HISTORY_UNPIN_ACTION':'AI_CHAT_HISTORY_PIN_ACTION');return us(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_UPDATE_PINNED',[_0x24edc0,_0x27083e]);}case'removeItem':return us(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_REMOVE_ITEM',_0x27083e);case'init':case'loadItems':return us(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_LOAD_ITEMS');default:return us(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_GENERIC');}}['_getCategorizedItems'](){const _0x59f00e=new Date(),_0x59bfb0=new Date(_0x59f00e['getFullYear'](),_0x59f00e['getMonth'](),_0x59f00e['getDate']()),_0x8cd7ab=new Date(_0x59bfb0);_0x8cd7ab['setDate'](_0x8cd7ab['getDate']()-0x1);const _0x4f0909=new Date(_0x59bfb0);_0x4f0909['setDate'](_0x4f0909['getDate']()-0xe);const _0x1a84b2=this['history']['getItems']({'pinned':!0x0}),_0x2aed3a=this['history']['getItems']({'from':_0x59bfb0,'to':_0x59bfb0}),_0x204083=this['history']['getItems']({'from':_0x8cd7ab,'to':_0x8cd7ab}),_0x140951=this['history']['getItems']({'from':_0x4f0909,'to':_0x8cd7ab}),_0x378412=this['history']['getItems']({'to':_0x4f0909}),_0x44bea8=[];return _0x1a84b2['length']>0x0&&_0x44bea8['push']({'title':us(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_PINNED'),'items':_0x1a84b2}),_0x2aed3a['length']>0x0&&_0x44bea8['push']({'title':us(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_TODAY'),'items':_0x2aed3a}),_0x204083['length']>0x0&&_0x44bea8['push']({'title':us(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_YESTERDAY'),'items':_0x204083}),_0x140951['length']>0x0&&_0x44bea8['push']({'title':us(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_LAST_14_DAYS'),'items':_0x140951}),_0x378412['length']>0x0&&_0x44bea8['push']({'title':us(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_LATER'),'items':_0x378412}),_0x44bea8;}['_setIsMaximized'](_0x302014){this['_aiChatHistoryUi']['setIsMaximized'](_0x302014);}}class Ia extends _0x25e92e{static get['requires'](){return[ga,da];}static get['pluginName'](){return'AIChatHistory';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class Ea extends _0x25e92e{static get['requires'](){return[Js,tn,aa,Ia];}static get['pluginName'](){return'AIChat';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x5d8c27){super(_0x5d8c27),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 pa extends Nt{['id'];constructor(_0x556be2,_0x4885fd){super(_0x556be2);const {id:_0xccc724,type:_0x1a06af,icon:_0x335b02}=_0x4885fd;this['id']=_0xccc724,this['set']({'label':_0x4885fd['label'],'withText':!0x0,'class':'ck-ai-chat-shortcut'}),this['extendTemplate']({'attributes':{'data-cke-ai-shortcut-id':_0x4885fd['id']}}),_0x335b02?this['icon']=_0x335b02:'chat'===_0x1a06af?this['icon']=_0x439de6:'review'===_0x1a06af?this['icon']=_0x1d0da2:'translate'===_0x1a06af&&(this['icon']=_0x4f4fba);}}class Ta extends vt{['listView'];constructor(_0x5c104c,_0x542d36){super(_0x5c104c);const _0x1b9c64=_0x542d36['map'](_0x1172d0=>{const _0x434a71=new Ht(this['locale']),_0x538eaf=new pa(this['locale'],_0x1172d0);return _0x434a71['children']['add'](_0x538eaf),_0x538eaf['delegate']('execute')['to'](this),_0x434a71;});this['listView']=new Dt(this['locale']),this['listView']['items']['addMany'](_0x1b9c64),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat-shortcuts']},'children':[this['listView']]});}}const ma='chat-shortcuts';var Ca=function(_0x52f1ad){return _0x52f1ad['CHAT']='chat',_0x52f1ad['REVIEW']='review',_0x52f1ad['TRANSLATE']='translate',_0x52f1ad;}({});class wa extends _0x25e92e{['_shortcuts'];['_shortcutsView'];['_aiChatUI'];static get['requires'](){return[aa];}static get['pluginName'](){return'AIChatShortcuts';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){this['_aiChatUI']=this['context']['plugins']['get'](aa),this['_shortcuts']=this['context']['config']['get']('ai.chat.shortcuts')??[];const _0x2bb9ab=this['context']['plugins']['get']('AIChatController');this['_shortcuts']['length']&&(this['_validateShortcuts'](),this['_aiChatUI']['on']('conversationCreated',()=>{_0x2bb9ab['activeConversation']['isFromHistory']||this['_injectShortcuts']();}),this['listenTo'](_0x2bb9ab,'interactionStarted',()=>{this['_removeShortcuts']();}));}['_validateShortcuts'](){const _0x390bcd=Object['values'](Ca);this['_shortcuts']['forEach'](_0x4a7e87=>{let _0x37fe1a=!0x0;if(_0x4a7e87['id']&&_0x4a7e87['label']&&_0x390bcd['includes'](_0x4a7e87['type'])?'chat'===_0x4a7e87['type']&&(_0x37fe1a='string'==typeof _0x4a7e87['prompt']):_0x37fe1a=!0x1,!_0x37fe1a)throw new ht('ai-chat-shortcuts-invalid-config',this['context'],{'shortcut':_0x4a7e87});});}['_injectShortcuts'](){const _0x5bfdcd=this['context']['plugins']['get'](aa);this['_shortcutsView']=new Ta(this['context']['locale'],this['_shortcuts']),this['_shortcutsView']['render'](),_0x5bfdcd['addFeedItemCustomElement'](this['_shortcutsView']['element'],ma),this['_shortcutsView']['on']('execute',_0x3c9da2=>{const _0x400d47=_0x3c9da2['source']['id'];this['_executeShortcut'](_0x400d47);});}['_removeShortcuts'](){const _0x388ba7=this['context']['plugins']['get'](aa);_0x388ba7['hasFeedItem'](ma)&&_0x388ba7['removeFeedItem'](ma),this['_shortcutsView']?.['destroy']();}['_executeShortcut'](_0x2e548a){const _0x3c7f01=this['_shortcuts']['find'](_0x3c1be3=>_0x3c1be3['id']===_0x2e548a),_0x1dace8=_0x3c7f01['type'];'chat'===_0x1dace8?this['_runChatShortcut'](_0x3c7f01):'review'===_0x1dace8?_0x3c7f01['commandId']?this['_runReviewShortcut'](_0x3c7f01):this['_switchTab']('reviewMode'):'translate'===_0x1dace8&&(_0x3c7f01['language']?this['_runTranslateShortcut'](_0x3c7f01):this['_switchTab']('translate'));}['_switchTab'](_0x53d031){if(!this['context']['plugins']['has']('AITabs'))throw new ht('ai-chat-shortcuts-ai-tabs-not-found',this['context'],{'tabName':_0x53d031});this['context']['plugins']['get']('AITabs')['view']['activateTab'](_0x53d031);}async['_runChatShortcut']({prompt:_0x1150fc,draftMode:_0x1e03b6,useWebSearch:_0x316345=!0x1,useReasoning:_0x5c3f7f=!0x1,model:_0x418084}){const _0x17b616=this['context']['plugins']['get']('AIChatController'),_0x2b5681=_0x17b616['activeConversation'];let _0x19ada9;_0x19ada9=_0x418084?await _0x2b5681['chatModels']['getModel'](_0x418084):await _0x2b5681['chatModels']['getDefault'](),_0x19ada9&&await _0x2b5681['setModel'](_0x19ada9),_0x2b5681['setWebSearch'](_0x316345),_0x2b5681['setReasoning'](_0x5c3f7f),_0x17b616['addCurrentDocumentToChatContext'](),_0x1e03b6?(this['_aiChatUI']['setPromptInputValue'](_0x1150fc),this['_aiChatUI']['focusPromptInput'](!0x0)):_0x17b616['sendMessage']({'message':_0x1150fc});}['_runReviewShortcut']({commandId:_0x351f49,model:_0x2bfebb,prompt:_0x8a0d0d,params:_0x4534c9}){if(!this['context']['plugins']['has']('AIReviewModeUI'))throw new ht('ai-chat-shortcuts-review-mode-not-found',this['context']);this['_switchTab']('reviewMode');const _0x4195f6={'id':_0x351f49,'isCustom':'custom'===_0x351f49};_0x2bfebb&&_0x8a0d0d&&(_0x4195f6['args']={'model':_0x2bfebb,'prompt':_0x8a0d0d}),_0x4534c9&&(_0x4195f6['params']=_0x4534c9),this['context']['plugins']['get']('AIReviewModeUI')['fire']('runReviewCheck',_0x4195f6);}['_runTranslateShortcut']({language:_0x4cfa2c}){if(!this['context']['plugins']['has']('AITranslateUI'))throw new ht('ai-chat-shortcuts-translate-not-found',this['context']);this['_switchTab']('translate'),this['context']['plugins']['get']('AITranslateUI')['fire']('runReviewCheck',{'id':_0x4cfa2c,'args':{'language':_0x4cfa2c}});}}class fa extends _0x26b415{constructor(_0x1d2b7d){super(_0x1d2b7d);const _0x16f875=_0x1d2b7d['plugins']['get']('AITabs')['view'];this['bind']('value')['to'](_0x16f875,'isVisible'),this['isEnabled']=!0x0;}['execute'](){const _0x44887c=this['editor']['plugins']['get']('AITabs')['view'];_0x44887c['isVisible']=!_0x44887c['isVisible'];}}class Sa extends _0x58645c{static get['requires'](){return[cs];}static get['pluginName'](){return'AIToggleButtonUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x36723b=this['editor'];_0x36723b['commands']['add']('toggleAi',new fa(_0x36723b)),_0x36723b['ui']['componentFactory']['add']('toggleAi',()=>{const _0x166fc6=this['_createAIUIButton'](Nt);return _0x166fc6['set']({'tooltip':!0x0,'class':'ck-ai-toggle-button'}),_0x166fc6;}),_0x36723b['ui']['componentFactory']['add']('menuBar:toggleAi',()=>{const _0x297265=this['_createAIUIButton'](Wt);return _0x297265['set']({'role':'menuitemcheckbox'}),_0x297265;});}['_createAIUIButton'](_0x2d1bf0){const _0x4e01e4=this['editor'],_0x432b62=_0x4e01e4['commands']['get']('toggleAi'),_0x3d1c50=new _0x2d1bf0(_0x4e01e4['locale']);return _0x3d1c50['set']({'label':us(_0x4e01e4['locale'],'AI_TOGGLE_BUTTON_LABEL'),'icon':_0x1f8a65,'isToggleable':!0x0}),_0x3d1c50['bind']('isEnabled')['to'](_0x432b62),_0x3d1c50['bind']('isOn')['to'](_0x432b62,'value',_0x112a3b=>!!_0x112a3b),this['listenTo'](_0x3d1c50,'execute',()=>{_0x432b62['execute']();}),_0x3d1c50;}}const ba=['applySuggestion','insertSuggestion','showNext','showPrevious'];class Ra extends vt{['_errorView'];constructor(_0x2a2299){super(_0x2a2299),this['set']('_errorMessage',''),this['set']('_isErrorVisible',!0x1);}['showBlockingError'](_0x5d6357){this['showError'](_0x5d6357);}['showError'](_0x2e9cce){this['_errorView']||(this['_errorView']=this['_createErrorView']()),this['_errorMessage']=_0x2e9cce,this['_isErrorVisible']=!0x0;}['hideError'](){this['_isErrorVisible']=!0x1;}['_createErrorView'](){const _0x101a52=new vt(this['locale']),_0x49fb74=new vt(this['locale']);return _0x49fb74['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-suggestion__error-text']},'children':[{'text':this['bindTemplate']['to']('_errorMessage')}]}),_0x101a52['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__error','ck-ai-balloon-error',this['bindTemplate']['if']('_isErrorVisible','ck-hidden',_0x4241ff=>!_0x4241ff)]},'children':[_0x49fb74]}),_0x101a52;}}const Oa=0xa;class ka extends _0x25e92e{static get['requires'](){return[tn];}static get['pluginName'](){return'AIBalloon';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['isOpen']=!0x1;['_currentConfig'];['_isUpdatingMarkers']=!0x1;['open'](_0x4cc765){const {id:_0x57db5b}=this['_currentConfig']??{};this['_currentConfig']=_0x4cc765;const {id:_0xd31634}=this['_currentConfig'];this['isOpen']&&_0x57db5b===_0xd31634?this['_updateDialog']():this['_showDialog']();}['close'](){const _0x16ab90=Xs(this['context'])['plugins']['get']('Dialog');_0x16ab90['isOpen']&&this['_currentConfig']&&_0x16ab90['id']===this['_currentConfig']['id']&&_0x16ab90['hide']();}['_updateDialog'](){const _0x56f247=Xs(this['context'])['plugins']['get']('Dialog'),{icon:_0x605938,title:_0x14c5d1}=this['_currentConfig'];_0x56f247['view']?.['headerView']&&(_0x56f247['view']['headerView']['label']=_0x14c5d1,_0x56f247['view']['headerView']['iconView']&&_0x605938&&(_0x56f247['view']['headerView']['iconView']['content']=_0x605938)),this['_isUpdatingMarkers']=!0x0,this['_showFakeVisualSelection'](),this['_isUpdatingMarkers']=!0x1,_0x56f247['view']?.['updatePosition']();}['_showFakeVisualSelection'](){this['context']['plugins']['get'](tn)['showFakeVisualSelection']({'ranges':this['_currentConfig']['ranges'],'id':'balloon','priority':0x64}),window['getSelection']()?.['removeAllRanges']();}['_hideFakeVisualSelection'](){this['context']['plugins']['get'](tn)['hideFakeVisualSelection']('balloon');}['_showDialog'](){const _0x54381c=Xs(this['context'])['plugins']['get']('Dialog'),{id:_0x3e164d,title:_0xf932c3,icon:_0x2d078e,class:_0x343490,mainView:_0x5aaec3}=this['_currentConfig'];_0x5aaec3['delegate'](...ba)['to'](this),_0x54381c['show']({'title':_0xf932c3,'icon':_0x2d078e,'hasCloseButton':!0x0,'id':_0x3e164d,'position':this['_calculateDialogPosition']['bind'](this),'className':'ck-ai-balloon\x20'+(_0x343490||''),'content':_0x5aaec3,'onShow':_0x23e30f=>{this['_showFakeVisualSelection'](),this['_setupFakeVisualSelectionMarkerRemovalListener']();const _0x56d8c9=this['_getSelectionElements']();_0x56d8c9&&_0x56d8c9[0x0]&&Ct({'target':_0x56d8c9[0x0],'ancestorOffset':0x14,'alignToTop':!0x0,'viewportOffset':{'top':0x14,'bottom':0x14,'left':0x0,'right':0x0}}),this['isOpen']=!0x0,_0x23e30f['once']('hide',()=>{this['fire']('beforeDialogClosed',{'id':_0x3e164d});},{'priority':'high'});},'onHide':()=>{this['_hideFakeVisualSelection'](),this['_cleanupFakeVisualSelectionMarkerRemovalListener'](),this['fire']('dialogClosed',{'id':_0x3e164d}),this['isOpen']=!0x1;}});}['_calculateDialogPosition'](_0x20dcbe,_0x391f45){if(!_0x391f45)return null;const _0x1b983b=this['_getSelectionElements']();if(!_0x1b983b||0x0===_0x1b983b['length'])return{'left':Math['round'](_0x391f45['left']+_0x391f45['width']/0x2-_0x20dcbe['width']/0x2),'top':Math['round'](_0x391f45['top']+_0x391f45['height']/0x2-_0x20dcbe['height']/0x2)};const _0x38411a=Math['round'](_0x391f45['left']+_0x391f45['width']/0x2-_0x20dcbe['width']/0x2),_0x2df286=_0x1b983b['map'](_0x3c0b6b=>new dt(_0x3c0b6b)),_0x2a648c=_0x20dcbe['height'];return{'left':_0x38411a,'top':this['_calculateOptimalTopPosition'](_0x2df286,_0x2a648c,_0x391f45)};}['_calculateOptimalTopPosition'](_0x5c079a,_0x1352cd,_0x99fcfb){const _0x455d87=new dt(lt['window']),_0x1a82d2=_0x5c079a['map'](_0x364f0b=>_0x364f0b['getVisible']())['filter'](_0x42b005=>_0x42b005),_0x5003be=dt['getBoundingRect'](_0x1a82d2);if(!_0x5003be)return Math['round'](_0x99fcfb['top']+_0x99fcfb['height']/0x2);const _0x5768d3=_0x455d87['getIntersection'](_0x5003be);if(!_0x5768d3)return Math['round'](_0x99fcfb['top']+_0x99fcfb['height']/0x2);const _0x5c6651=_0x99fcfb['getVisible'](),_0x47f3cf=_0x5c6651&&_0x5003be['height']>_0x5c6651['height'],_0x3ee985=_0x5768d3['top'],_0x346bde=_0x5768d3['bottom'];if(_0x47f3cf){const _0x103c9e=(_0x5c6651||_0x455d87)['height']/0x2-_0x1352cd/0x2,_0x1d710c=_0x3ee985-Oa-_0x99fcfb['top'],_0x112a3d=_0x99fcfb['bottom']-_0x346bde-Oa;return _0x1d710c>=_0x1352cd?Math['max'](Oa,_0x3ee985-_0x1352cd-Oa):_0x112a3d>=_0x1352cd?_0x346bde+Oa:Math['max'](Oa,_0x103c9e);}const _0x153dd0=_0x3ee985-_0x1352cd,_0x316d5a=_0x99fcfb['bottom']-_0x346bde-Oa,_0x4c3a00=_0x3ee985-Oa-_0x99fcfb['top'];let _0x33318f;if(_0x316d5a>=_0x1352cd)_0x33318f=_0x346bde+Oa;else{if(_0x4c3a00>=_0x1352cd)_0x33318f=_0x153dd0-Oa;else _0x33318f=_0x3ee985+_0x5003be['height']/0x2-_0x1352cd/0x2;}return _0x33318f;}['_setupFakeVisualSelectionMarkerRemovalListener'](){const _0x297a96=Xs(this['context']);this['listenTo'](_0x297a96['model']['document'],'change',()=>{if(!this['_isUpdatingMarkers']){for(const {name:_0x2affc1,data:{newRange:_0x4e5c33}}of _0x297a96['model']['document']['differ']['getChangedMarkers']())if(_0x2affc1['startsWith'](Zs+':')&&(_0x4e5c33&&(_0x4e5c33['start']['isEqual'](_0x4e5c33['end'])||'$graveyard'==_0x4e5c33['root']['rootName'])||null==_0x4e5c33)){const _0x1ebe19=us(this['context']['locale'],'AI_BALLOON_SELECTION_REMOVED_ERROR');this['_currentConfig']['mainView']['showBlockingError'](_0x1ebe19),this['fire']('selectionRemoved');}}});}['_cleanupFakeVisualSelectionMarkerRemovalListener'](){const _0x475dd0=Xs(this['context']);this['_currentConfig']['mainView']['hideError'](),this['stopListening'](_0x475dd0['model']['document']);}['_getSelectionElements'](){const _0xdf0f84=Xs(this['context']);return _0x342638(_0xdf0f84['editing'],[..._0xdf0f84['model']['markers']['getMarkersGroup']('ai-selection'),..._0xdf0f84['model']['markers']['getMarkersGroup']('ai-balloon-selection')]);}}class Na extends kt{['copyButton'];['likeButton'];['dislikeButton'];['showChangesButton'];['_config'];constructor(_0x40b74b,_0x520c8b={}){super(_0x40b74b),this['set']('isEnabled',!0x0),this['set']('isShowChangesOn',!0x1),this['_config']={'showCopy':!0x1,'showLike':!0x1,'showDislike':!0x1,..._0x520c8b};const _0x570b9b=!(this['_config']['showCopy']||this['_config']['showChanges']||this['_config']['showLike']||this['_config']['showDislike']||this['_config']['customView']?.['length']);this['class']=_0x570b9b?'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'](_0x3a1c62){this['showChangesButton']['isEnabled']=_0x3a1c62;}['_setupRatingButtons'](){this['likeButton']=new Nt(this['locale']),this['likeButton']['set']({'icon':_0x2257e0,'label':us(this['locale'],'AI_MINI_TOOLBAR_LIKE'),'class':As,'tooltip':!0x0}),this['likeButton']['bind']('isEnabled')['to'](this),this['likeButton']['on']('execute',()=>{this['fire']('like');}),this['dislikeButton']=new Nt(this['locale']),this['dislikeButton']['set']({'icon':_0x38052d,'label':us(this['locale'],'AI_MINI_TOOLBAR_DISLIKE'),'class':As,'tooltip':!0x0}),this['dislikeButton']['bind']('isEnabled')['to'](this),this['dislikeButton']['on']('execute',()=>{this['fire']('dislike');});}['_setupCopyButton'](){this['copyButton']=new Nt(this['locale']),this['copyButton']['set']({'icon':_0xae9e3f,'label':us(this['locale'],'AI_MINI_TOOLBAR_COPY'),'class':'ck-ai-mini-toolbar-copy-button\x20'+As,'tooltip':!0x0}),this['copyButton']['bind']('isEnabled')['to'](this);const _0x4c377b=new xt();_0x4c377b['set']({'content':_0xe4c6eb}),_0x4c377b['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'+As,setTimeout(()=>{this['copyButton']['class']='ck-ai-mini-toolbar-copy-button\x20'+As;},0x7d0);}),this['copyButton']['children']['add'](_0x4c377b);}['_setupShowChangesButton'](){this['showChangesButton']=new Nt(this['locale']),this['showChangesButton']['set']({'icon':_0xfbc311,'label':us(this['locale'],'AI_SUGGESTION_BUTTON_SHOW_CHANGES'),'withText':'full'==this['_config']['showChanges'],'tooltip':'full'!=this['_config']['showChanges'],'class':As}),this['showChangesButton']['bind']('isOn')['to'](this,'isShowChangesOn'),this['showChangesButton']['bind']('isEnabled')['to'](this),this['showChangesButton']['bind']('icon')['to'](this,'isShowChangesOn',_0x537180=>_0x537180?_0x4a5aa5:_0xfbc311),this['showChangesButton']['on']('execute',()=>{this['fire']('toggleShowChanges');});}}class va extends Ra{['children'];['nextButtonView'];['previousButtonView'];['focusCycler'];['_focusables'];['_focusTracker'];['_keystrokes'];['_config'];['_streamableContentView'];['_toolbarContainerView'];['_partToolbarView'];['_stateView'];['_miniToolbarView'];constructor(_0x506c96,_0x382b74){super(_0x506c96);const _0x27c531=this['bindTemplate'];this['set']('showDiff',!0x1),this['set']('_state','pending'),this['_focusTracker']=new At(),this['_keystrokes']=new gt(),this['_focusables']=this['createCollection'](),this['focusCycler']=new Ut({'focusables':this['_focusables'],'focusTracker':this['_focusTracker'],'keystrokeHandler':this['_keystrokes'],'actions':{'focusPrevious':'shift\x20+\x20tab','focusNext':'tab'}}),this['_config']=_0x382b74,this['nextButtonView']=this['_createNextButtonView'](),this['previousButtonView']=this['_createPreviousButtonView'](),this['_streamableContentView']=new pn(_0x506c96),this['_partToolbarView']=new gn(_0x506c96,_0x382b74['availableActions']),this['_partToolbarView']['delegate']('applySuggestion','insertSuggestion','rejectSuggestion')['to'](this),this['_togglePartToolbarButtonsVisibility'](_0x382b74),this['_stateView']=new _n(_0x506c96),this['_stateView']['isVisible']=!0x1,this['_miniToolbarView']=new Na(_0x506c96,{'showChanges':'full'}),this['_miniToolbarView']['bind']('isShowChangesOn')['to'](this,'showDiff'),this['_miniToolbarView']['on']('toggleShowChanges',()=>{this['fire']('toggleSuggestionDisplayMode');}),this['_toolbarContainerView']=new ya(_0x506c96,[this['_partToolbarView'],this['_stateView'],this['_miniToolbarView']]),this['children']=this['createCollection']([this['_streamableContentView'],this['_toolbarContainerView']]),this['on']('change:_state',(_0x38ed2a,_0x911ee1,_0x1ae550,_0x53c5d9)=>{let _0x2894ab,_0x5d6d8a;'pending'===_0x53c5d9?(_0x2894ab=this['_partToolbarView'],_0x5d6d8a=this['_stateView']):(_0x2894ab=this['_stateView'],_0x5d6d8a=this['_partToolbarView']),this['_stateView']['setState'](_0x1ae550),_0x2894ab['isVisible']=!0x1,_0x5d6d8a['isVisible']=!0x0;}),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat-balloon-main',_0x27c531['to']('_state',_0x362fbd=>'ck-ai-chat-balloon-main_state_'+_0x362fbd)]},'children':this['children']}),this['on']('change:isTrackChangesOn',()=>{this['_togglePartToolbarButtonsVisibility'](_0x382b74);});}['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'](_0x1704dd){_0x1704dd?.['keepErrors']||this['hideError'](),await this['_streamableContentView']['update'](_0x1704dd);}['setState'](_0x298546){this['_state']=_0x298546;}['showError'](_0x3e99e4){super['showError'](_0x3e99e4),this['children']['has'](this['_errorView'])||this['children']['add'](this['_errorView'],0x0);}['hideError'](){this['_isErrorVisible']&&(super['hideError'](),this['togglePartToolbarEnabled'](!0x0));}['showBlockingError'](_0x2eee17){super['showBlockingError'](_0x2eee17),this['togglePartToolbarEnabled'](!0x1);}['toggleRotatorButtonsVisibility'](_0x3961d3){this['nextButtonView']['isVisible']=this['previousButtonView']['isVisible']=_0x3961d3;}['togglePartToolbarEnabled'](_0x1c1d2e){this['_partToolbarView']['isEnabled']=_0x1c1d2e;}['_togglePartToolbarButtonsVisibility']({showApplyButton:_0x529d96,showSuggestButton:_0x1b224c}){_0x529d96=_0x529d96&&!this['isTrackChangesOn']&&this['_config']['availableActions']['includes']('applySuggestion'),_0x1b224c=_0x1b224c&&this['_config']['availableActions']['includes']('insertSuggestion'),this['_partToolbarView']['setButtonsVisibility']({'showApplyButton':_0x529d96,'showSuggestButton':_0x1b224c});}['_createNextButtonView'](){const _0x4588ea=new Nt(this['locale']);return _0x4588ea['set']({'icon':_0x57ee7e,'label':us(this['locale'],'AI_BALLOON_NEXT_LABEL'),'isVisible':!0x0}),_0x4588ea['on']('execute',()=>{this['fire']('showNext');}),_0x4588ea;}['_createPreviousButtonView'](){const _0x52682b=new Nt(this['locale']);return _0x52682b['set']({'icon':_0x499377,'label':us(this['locale'],'AI_BALLOON_PREVIOUS_LABEL'),'isVisible':!0x0}),_0x52682b['on']('execute',()=>{this['fire']('showPrevious');}),_0x52682b;}}class ya extends vt{constructor(_0x387cce,_0x5d6592){super(_0x387cce),this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-balloon__toolbar-container']},'children':_0x5d6592});}}class xa extends _0x58645c{static get['requires'](){return[Bt,ka];}static get['pluginName'](){return'AIChatBalloon';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['_chatBalloonView'];constructor(_0x39312c){super(_0x39312c),this['set']('showDiff',!0x1);}['open'](_0x1bf491){const _0x2082d2=this['editor'];this['_chatBalloonView']||(this['_chatBalloonView']=this['_createChatBalloonView']()),_0x2082d2['plugins']['get']('AIBalloon')['open']({..._0x1bf491,'id':'aiChatBalloon','class':'ck-ai-chat-balloon','mainView':this['_chatBalloonView']}),this['_toggleRotatorButtonsInDialogHeader'](_0x1bf491['showRotator']),this['_chatBalloonView']['togglePartToolbarEnabled'](!_0x1bf491['areActionsDisabled']),this['_restoreDefaultViewFocus']();}['close'](){this['editor']['plugins']['get']('AIBalloon')['close']();}['updateContent'](_0x287bf7){return this['_chatBalloonView']||(this['_chatBalloonView']=this['_createChatBalloonView']()),this['_chatBalloonView']['updateContent'](_0x287bf7);}['setState'](_0x389f6b){this['_chatBalloonView']&&this['_chatBalloonView']['setState'](_0x389f6b);}['_createChatBalloonView'](){const _0xb52925=this['editor'],_0x3df557=_0xb52925['plugins']['get']('AIBalloon'),_0x526997=_0xb52925['commands']['get']('trackChanges');let _0xc7717f=_0xb52925['config']['get']('ai.availableReplyActions')||[...wn];_0xb52925['plugins']['has']('TrackChanges')||(_0xc7717f=_0xc7717f['filter'](_0x40df36=>'insertSuggestion'!=_0x40df36));const _0x8d417b=new va(_0xb52925['locale'],{'availableActions':_0xc7717f,'showApplyButton':!0x0,'showSuggestButton':!!_0x526997});return _0x8d417b['bind']('showDiff')['to'](this),_0x8d417b['delegate'](...en)['to'](this),_0x8d417b['delegate']('showPrevious','showNext')['to'](this),_0x3df557['delegate']('dialogClosed')['to'](this),_0x8d417b['on']('applySuggestion',this['_restoreDefaultViewFocus']['bind'](this)),_0x8d417b['on']('insertSuggestion',this['_restoreDefaultViewFocus']['bind'](this)),_0x8d417b['on']('rejectSuggestion',this['_restoreDefaultViewFocus']['bind'](this)),_0x526997&&_0x8d417b['bind']('isTrackChangesOn')['to'](_0x526997,'value'),_0x8d417b['render'](),_0x8d417b;}['_toggleRotatorButtonsInDialogHeader'](_0x1f26f8){const _0x3ef5d2=this['editor'],_0x17c5b9=_0x3ef5d2['plugins']['get']('Dialog')['view']['headerView']['children'];this['_chatBalloonView']['toggleRotatorButtonsVisibility'](_0x1f26f8),_0x17c5b9['has'](this['_chatBalloonView']['previousButtonView'])||(_0x17c5b9['addMany']([this['_chatBalloonView']['previousButtonView'],this['_chatBalloonView']['nextButtonView']],0x0),_0x3ef5d2['plugins']['get']('AIBalloon')['once']('beforeDialogClosed',()=>{_0x17c5b9['remove'](this['_chatBalloonView']['previousButtonView']),_0x17c5b9['remove'](this['_chatBalloonView']['nextButtonView']);}));}['_restoreDefaultViewFocus'](){this['_chatBalloonView']['focus']();}}class La extends _0x58645c{static get['requires'](){return[Sa,xa,_0x3b3ef5];}static get['pluginName'](){return'AIEditorIntegration';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}function Da(_0x2bb3e7){const {editor:_0x36b268,action:_0x545d73,withText:_0x3b359b=!0x1,withIcon:_0x2209a2=!0x0,isInDropdown:_0x51c093=!0x0,shouldPreventFocus:_0x126110=!0x1}=_0x2bb3e7;return()=>{const _0x717c3e=_0x36b268['locale'],_0x2d41a5=new Nt(_0x717c3e),_0x3fd31e=_0x2d41a5['bindTemplate'];_0x51c093&&_0x2d41a5['extendTemplate']({'on':{'mouseenter':_0x3fd31e['to'](()=>{_0x126110&&_0x126110()||_0x2d41a5['focus']();})}});const _0x465875=_0x545d73['icon']??_0x545d73['parent']?.['icon'];return _0x2d41a5['set']({'label':_0x545d73['label'],'withText':_0x3b359b,'role':'menuitem','icon':_0x2209a2?_0x465875??_0x195043:void 0x0,'tooltip':!_0x3b359b,'class':'ck-ai-quick-actions-button','isEnabled':_0x545d73['isEnabled']}),_0x2d41a5['on']('execute',()=>{_0x36b268['editing']['view']['focus'](),_0x36b268['commands']['execute']('aiQuickAction',_0x545d73);}),_0x2d41a5;};}class Pa extends _0x4c2ae7{['arrowView'];constructor(_0x75de8c,_0x4a2237){super(_0x75de8c,_0x4a2237);const _0x379e88=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',_0x3565c7=>String(_0x3565c7)),'data-cke-tooltip-disabled':_0x379e88['to']('isOn')},'on':{'mouseenter':_0x379e88['to']('mouseenter')}});}['render'](){super['render'](),this['children']['add'](this['arrowView']);}['_createArrowView'](){const _0x5357d5=new xt();return _0x5357d5['content']=_0x26638d,_0x5357d5['extendTemplate']({'attributes':{'class':'ck-dropdown-menu-list__nested-menu__button__arrow'}}),_0x5357d5;}}class Ha extends Dt{['_allListItems'];['_allSearchableItems'];constructor(_0x4c9b69,_0x19a05,_0x44feaa){super(_0x4c9b69),this['_allListItems']=_0x19a05,this['_allSearchableItems']=_0x44feaa;}['filter'](_0x29d95a){if(!_0x29d95a)return this['items']['clear'](),this['items']['addMany'](this['_allListItems']),this['_clearHighlight'](),{'resultsCount':this['_allListItems']['length'],'totalItemsCount':this['_allListItems']['length']};const _0x497402=_0x29d95a['source']['toLowerCase']()['trim'](),_0x4e483d=this['_allSearchableItems']['filter'](_0x5cfeee=>(_0x5cfeee['groupLabel']?_0x5cfeee['label']+'\x20('+_0x5cfeee['groupLabel']+')':_0x5cfeee['label'])['toLowerCase']()['includes'](_0x497402));return this['items']['clear'](),this['items']['addMany'](_0x4e483d['sort']((_0x3cd856,_0x24c140)=>{const _0xa5a5eb=_0x3cd856['groupLabel'],_0x1d636a=_0x24c140['groupLabel'];return _0xa5a5eb||_0x1d636a?_0xa5a5eb?0x1:-0x1:0x0;})['map'](_0x50a536=>_0x50a536['item'])),this['_highlightQuery'](_0x497402,_0x4e483d),{'resultsCount':_0x4e483d['length'],'totalItemsCount':this['_allSearchableItems']['length']};}['_highlightQuery'](_0x103216,_0x257e09){if(!_0x103216)return;const _0xa52af7=new RegExp(_0x20b9f0(_0x103216),'gi');_0x257e09['forEach'](_0x348140=>{_0x348140['highlightViews']&&_0x348140['highlightViews']['forEach'](_0x21a08e=>{'function'==typeof _0x21a08e['highlightText']&&_0x21a08e['highlightText'](_0xa52af7);});});}['_clearHighlight'](){this['_allSearchableItems']['forEach'](_0x488e55=>{_0x488e55['highlightViews']&&_0x488e55['highlightViews']['forEach'](_0x1a52e8=>{'function'==typeof _0x1a52e8['highlightText']&&_0x1a52e8['highlightText'](null);});});}}const Ma='menu',Ua='menuitem';class Va extends vt{['_bodyCollection'];['optionsListView'];['_searchTextView']=null;['_allSearchableItems']=[];['children'];['focusTracker'];['keystrokes'];['_focusables'];['focusCycler'];['_openNestedPanels']=new Set();['_hasSearch'];constructor(_0x2bfab9,_0x47b705,_0x510fe8,_0x3b9e3f,_0x536f3b=!0x1){const _0x498d33=_0x2bfab9['locale'];super(_0x498d33),this['_bodyCollection']=_0x3b9e3f,this['_hasSearch']=_0x536f3b;const _0x4b6dae=this['_createListItems'](_0x2bfab9,_0x47b705,_0x510fe8);this['optionsListView']=new Ha(_0x498d33,_0x4b6dae,this['_allSearchableItems']),this['optionsListView']['role']=Ma,this['optionsListView']['items']['addMany'](_0x4b6dae),this['focusTracker']=new At(),this['keystrokes']=new gt(),_0x536f3b&&(this['_searchTextView']=this['_createSearchTextView']()),this['_focusables']=_0x4b6dae,this['focusCycler']=new Ut({'focusables':this['_focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes']}),_0x536f3b&&this['_searchTextView']&&this['focusCycler']['chain'](this['_searchTextView']['focusCycler']);const _0x32293f=_0x536f3b&&this['_searchTextView']?[this['_searchTextView']]:[this['optionsListView']];this['children']=new _0x4539b4(_0x32293f),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-ai-quick-actions','ck-rounded-corners'],'dir':_0x498d33['uiLanguageDirection']},'children':this['children']});}['_createSearchTextView'](){return new _0x214c15(this['locale'],{'filteredView':this['optionsListView'],'queryView':{'label':us(this['locale'],'AI_QUICK_ACTIONS_SEARCH')},'class':'ck-ai-quick-actions-search','infoView':{'text':{'notFound':{'primary':us(this['locale'],'AI_QUICK_ACTIONS_SEARCH_NOT_FOUND')}}}});}['_isSearchFocused'](){if(!this['_hasSearch']||!this['_searchTextView']||!this['_searchTextView']['queryView']['fieldView']['element'])return!0x1;const _0x364d25=this['_searchTextView']['queryView']['fieldView']['element']['ownerDocument']?.['activeElement'];return this['_searchTextView']['queryView']['fieldView']['element']['contains'](_0x364d25);}['_createListItems'](_0x564dff,_0x179ded,_0x4a47c0){const _0x3dc367=new _0x4539b4();return _0x179ded['forEach'](_0x20a036=>{if('actions'in _0x20a036){const {listItem:_0x5f37b2}=this['_createActionGroupButton'](_0x564dff,_0x20a036,_0x4a47c0);_0x3dc367['add'](_0x5f37b2),_0x20a036['actions']['forEach'](_0x1399ef=>{this['_createActionButton'](_0x564dff,_0x1399ef,_0x20a036['label'],_0x20a036['icon']);const {listItem:_0x513726,highlightViews:_0x3d8fce}=this['_createSearchResultActionButton'](_0x564dff,_0x1399ef,_0x20a036['label'],_0x20a036['icon']);this['_allSearchableItems']['push']({'item':_0x513726,'label':_0x1399ef['label'],'groupLabel':_0x20a036['label'],'highlightViews':_0x3d8fce});});}else{const {listItem:_0x342202}=this['_createActionButton'](_0x564dff,_0x20a036);_0x3dc367['add'](_0x342202);const _0x481c48=_0x342202['children']['first'];if(_0x481c48){const {listItem:_0x171a51,highlightViews:_0x1d4c0f}=this['_createSearchResultActionButton'](_0x564dff,_0x20a036);this['_allSearchableItems']['push']({'item':_0x171a51,'label':_0x481c48['label']||'','highlightViews':_0x1d4c0f});}}}),_0x3dc367;}['_createActionButton'](_0x44d546,_0x29282,_0x2881a4,_0x43502d){const _0x3edb2e=new Ht(this['locale']);if(_0x2881a4&&_0x43502d){const _0x65ba40=new Nt(this['locale']),_0x182dbe=_0x65ba40['bindTemplate'],_0x5cab34=new _0x5baf8b();_0x5cab34['text']=_0x29282['label'];const _0x33b5a0=new _0x5baf8b();_0x33b5a0['text']=_0x2881a4;const _0x529e0a=new xt();_0x529e0a['content']=_0x43502d,_0x529e0a['extendTemplate']({'attributes':{'class':'ck-ai-quick-actions-button__group-icon'}});const _0x222c12=new vt(this['locale']);_0x222c12['setTemplate']({'tag':'span','attributes':{'class':'ck-ai-quick-actions-button_with-group__open-paren'},'children':[{'text':'\x20('}]});const _0x1fd1be=new vt(this['locale']);return _0x1fd1be['setTemplate']({'tag':'span','attributes':{'class':'ck-ai-quick-actions-button_with-group__close-paren'},'children':[{'text':')'}]}),_0x65ba40['set']({'label':_0x29282['label']+'\x20('+_0x2881a4+')','withText':!0x0,'role':'menuitem','class':'ck-ai-quick-actions-button\x20ck-ai-quick-actions-button_with-group','tooltip':!0x1}),_0x65ba40['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':[_0x5cab34,_0x222c12,_0x529e0a,_0x33b5a0,_0x1fd1be],'on':{'mouseenter':_0x182dbe['to'](()=>{this['_isSearchFocused']()||_0x65ba40['focus']();}),'click':_0x182dbe['to'](()=>{_0x65ba40['fire']('execute');})}}),_0x65ba40['on']('execute',()=>{_0x44d546['editing']['view']['focus'](),_0x44d546['commands']['execute']('aiQuickAction',_0x29282);}),_0x3edb2e['children']['add'](_0x65ba40),{'listItem':_0x3edb2e,'highlightViews':[_0x5cab34,_0x33b5a0]};}{const _0x203dc4=new _0xdf6870(),_0x2eec1b=new Nt(this['locale'],_0x203dc4),_0xffcc6d=_0x2eec1b['bindTemplate'],_0x1b22e3=_0x29282['icon']??_0x29282['parent']?.['icon'],_0x4dfe1e=void 0x0!==_0x29282['icon'];return _0x2eec1b['set']({'label':_0x29282['label'],'withText':!0x0,'role':'menuitem','icon':_0x4dfe1e?_0x1b22e3??_0x195043:void 0x0,'tooltip':!0x1,'class':'ck-ai-quick-actions-button'}),_0x2eec1b['extendTemplate']({'on':{'mouseenter':_0xffcc6d['to'](()=>{this['_isSearchFocused']()||_0x2eec1b['focus']();})}}),_0x2eec1b['on']('execute',()=>{_0x44d546['editing']['view']['focus'](),_0x44d546['commands']['execute']('aiQuickAction',_0x29282);}),_0x3edb2e['children']['add'](_0x2eec1b),{'listItem':_0x3edb2e,'highlightViews':[_0x203dc4]};}}['_createSearchResultActionButton'](_0xdd7363,_0x10716b,_0x475035,_0x1f6896){return _0x475035&&_0x1f6896?this['_createSearchResultGroupedActionButton'](_0xdd7363,_0x10716b,_0x475035,_0x1f6896):this['_createSearchResultIndividualActionButton'](_0xdd7363,_0x10716b);}['_createSearchResultGroupedActionButton'](_0x4b3d3c,_0x504482,_0x505811,_0x1742dd){const _0x3f9de2=new Ht(this['locale']),_0xd9c635=new Nt(this['locale']),_0x1f67ac=_0xd9c635['bindTemplate'],{view:_0xc9a097,highlightView:_0x31be28}=this['_createSearchResultGroupRow'](_0x505811,_0x1742dd),{view:_0x17caec,highlightView:_0x204176}=this['_createSearchResultActionRow'](_0x504482['label']),_0x565990=this['_createSearchResultContentView'](_0xc9a097,_0x17caec);return _0xd9c635['set']({'label':_0x504482['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}),_0xd9c635['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':[_0x565990],'on':{'mouseenter':_0x1f67ac['to'](()=>{this['_isSearchFocused']()||_0xd9c635['focus']();}),'click':_0x1f67ac['to'](()=>{this['_handleSearchResultButtonClick'](_0xd9c635);})}}),this['_setupActionButtonExecution'](_0xd9c635,_0x4b3d3c,_0x504482),_0x3f9de2['children']['add'](_0xd9c635),{'listItem':_0x3f9de2,'highlightViews':[_0x31be28,_0x204176]};}['_createSearchResultIndividualActionButton'](_0xa5d50c,_0x1ec823){const _0x21875b=new Ht(this['locale']),_0x30166b=new _0xdf6870(),_0x295701=new Nt(this['locale'],_0x30166b),_0x8de52d=_0x295701['bindTemplate'];return _0x295701['set']({'label':_0x1ec823['label'],'withText':!0x0,'role':'menuitem','icon':void 0x0,'tooltip':!0x1,'class':'ck-ai-quick-actions-button\x20ck-ai-quick-actions-search-result-button'}),_0x295701['extendTemplate']({'on':{'mouseenter':_0x8de52d['to'](()=>{this['_isSearchFocused']()||_0x295701['focus']();})}}),this['_setupActionButtonExecution'](_0x295701,_0xa5d50c,_0x1ec823),_0x21875b['children']['add'](_0x295701),{'listItem':_0x21875b,'highlightViews':[_0x30166b]};}['_createSearchResultGroupRow'](_0x48b085,_0x1d15b1){const _0x3787b6=new vt(this['locale']),_0x5eb57a=new xt();_0x5eb57a['content']=_0x1d15b1,_0x5eb57a['extendTemplate']({'attributes':{'class':'ck-ai-quick-actions-button__group-icon'}});const _0x3455dc=new _0x5baf8b();return _0x3455dc['text']=_0x48b085,_0x3787b6['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-quick-actions-search-result__group-row'},'children':[_0x5eb57a,_0x3455dc]}),{'view':_0x3787b6,'highlightView':_0x3455dc};}['_createSearchResultActionRow'](_0x1338b8){const _0x438163=new vt(this['locale']),_0x30e54b=new _0x5baf8b();return _0x30e54b['text']=_0x1338b8,_0x438163['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-quick-actions-search-result__action-row'},'children':[_0x30e54b]}),{'view':_0x438163,'highlightView':_0x30e54b};}['_createSearchResultContentView'](_0x4d8d8f,_0x3b6427){const _0x94d7bc=new vt(this['locale']);return _0x94d7bc['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-quick-actions-search-result__content'},'children':[_0x4d8d8f,_0x3b6427]}),_0x94d7bc;}['_setupActionButtonExecution'](_0x35ba97,_0x238378,_0x2c9cfe){_0x35ba97['on']('execute',()=>{_0x238378['editing']['view']['focus'](),_0x238378['commands']['execute']('aiQuickAction',_0x2c9cfe);});}['_createActionGroupButton'](_0x244f31,_0x146040,_0x25c448){const _0x492875=new Ht(this['locale']),_0xdf2c32=new _0xdf6870(),_0x439922=new Pa(this['locale'],_0xdf2c32),_0x4d4172=_0x439922['bindTemplate'],_0x30ae67=this['_getPanelKeystroke'](_0x25c448),_0xcfe6b9=this['_createGroupActionsList'](_0x244f31,_0x146040['actions'],_0x25c448);_0x439922['set']({'label':_0x146040['label'],'withText':!0x0,'role':Ua,'icon':_0x146040['icon']??_0x195043,'isEnabled':_0x146040['actions']['some'](_0xa50b16=>_0xa50b16['isEnabled'])}),_0x439922['extendTemplate']({'on':{'mouseenter':_0x4d4172['to'](()=>{this['_isSearchFocused']()||_0x439922['focus']();})}});const _0x282d18=new Xt(this['locale']);return _0x282d18['extendTemplate']({'attributes':{'class':['ck','ck-reset_all','ck-ai-quick-actions-group-panel','ck-dropdown-menu__nested-menu__panel']},'on':{'keydown':_0x4d4172['to'](_0x503531=>{this['_handlePanelKeydown'](_0x503531,_0x30ae67,_0x439922,_0x282d18);})}}),_0x439922['bind']('isOn')['to'](_0x282d18,'isVisible'),this['_bodyCollection']['add'](_0x282d18),_0x282d18['content']['add'](_0xcfe6b9),this['_setupGroupMenuBehavior'](_0x439922,_0x282d18),_0x492875['children']['add'](_0x439922),{'listItem':_0x492875,'highlightView':_0xdf2c32};}['_createGroupActionsList'](_0x28d2a9,_0xd5f938,_0x332dc5){const _0x5116d0=new Dt(this['locale']);return _0x5116d0['extendTemplate']({'attributes':{'class':['ck','ck-reset_all','ck-ai-quick-actions-group-list','ck-dropdown-menu-list']}}),_0xd5f938['forEach'](_0x15c222=>{const _0x55fbc8=new Ht(this['locale']),_0x260c6a=Da({'editor':_0x28d2a9,'action':_0x15c222,'withText':!0x0,'withIcon':!0x1,'isInDropdown':!0x0,'shouldPreventFocus':()=>this['_isSearchFocused']()})();_0x55fbc8['children']['add'](_0x260c6a),_0x332dc5['focusTracker']['add'](_0x260c6a),_0x5116d0['items']['add'](_0x55fbc8);}),_0x5116d0;}['_setupGroupMenuBehavior'](_0x1cdc81,_0x5296eb){const _0x419ead=_0x1cdc81['bindTemplate'],_0x13bc94=this['_getButtonKeystroke'](_0x1cdc81);_0x1cdc81['extendTemplate']({'attributes':{'class':['ck-ai-quick-actions-group-button']},'on':{'mouseenter':_0x419ead['to'](()=>{this['_showNestedPanel'](_0x5296eb,_0x1cdc81);}),'mouseleave':_0x419ead['to'](_0x4d1a50=>{const _0x2da69e=_0x4d1a50['relatedTarget'];this['_isMovingToNestedMenu'](_0x2da69e,_0x5296eb)||this['_hideNestedPanel'](_0x5296eb);}),'keydown':_0x419ead['to'](_0x541feb=>{_0x541feb['key']==_0x13bc94&&(this['_showNestedPanel'](_0x5296eb,_0x1cdc81),_0x5296eb['content']['get'](0x0)['focus']());})}}),_0x5296eb['on']('render',()=>{_0x5296eb['element']?.['addEventListener']('mouseleave',_0x52317c=>{const _0x1e509d=_0x52317c['relatedTarget'];_0x1cdc81['element']?.['contains'](_0x1e509d)||this['_isMovingToNestedMenu'](_0x1e509d,_0x5296eb)||this['_hideNestedPanel'](_0x5296eb);});});}['_showNestedPanel'](_0x2c1fe8,_0x37d680){this['_openNestedPanels']['forEach'](_0x2a924f=>{_0x2a924f!==_0x2c1fe8&&_0x2a924f['isVisible']&&_0x2a924f['hide']();}),_0x2c1fe8['show'](),_0x2c1fe8['pin']({'positions':[_0x450e74['eastSouth']],'target':_0x37d680['element'],'fitInViewport':!0x0}),this['_openNestedPanels']['add'](_0x2c1fe8);}['_hideNestedPanel'](_0x1b2446){_0x1b2446['hide'](),this['_openNestedPanels']['delete'](_0x1b2446);}['_hideAllNestedPanels'](){this['_openNestedPanels']['forEach'](_0x4b5d2d=>_0x4b5d2d['hide']()),this['_openNestedPanels']['clear']();}['_isMovingToNestedMenu'](_0x319223,_0x16cdc9){if(!_0x319223)return!0x1;if(_0x16cdc9['element']?.['contains'](_0x319223))return!0x0;const _0x395bcb=_0x319223;return _0x395bcb['closest']&&(null!==_0x395bcb['closest']('.ck-ai-quick-actions-group-panel')||null!==_0x395bcb['closest']('.ck-ai-quick-actions-group-list')||null!==_0x395bcb['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'](_0x437c47){return'rtl'===_0x437c47['locale']['uiLanguageDirection']?'ArrowRight':'ArrowLeft';}['_getButtonKeystroke'](_0x58c49b){return'rtl'===_0x58c49b['locale']['uiLanguageDirection']?'ArrowLeft':'ArrowRight';}['_handlePanelKeydown'](_0x23a732,_0x207857,_0x19d9c8,_0x16fdb3){_0x23a732['key']==_0x207857&&(_0x19d9c8['focus'](),this['_hideNestedPanel'](_0x16fdb3));}['_handleSearchResultButtonClick'](_0x4bfb78){_0x4bfb78['fire']('execute');}}function Ba(_0x433a79){const {editor:_0x4cb575,content:_0x3573a0,buttonDefinition:_0x2b10cb,bodyCollection:_0x4f1388,hasSearch:_0x4bea18=!0x1}=_0x433a79;return()=>{const _0x1df00b=_0x4cb575['locale'],_0x382043=Gt(_0x1df00b);_0x382043['buttonView']['set']({'icon':_0x2b10cb['icon']??_0x195043,'label':_0x2b10cb['label'],'tooltip':!0x0}),_0x382043['set']({'class':'ck-ai-quick-actions-dropdown'});const _0x405dd4=new Va(_0x4cb575,_0x3573a0,_0x382043,_0x4f1388,_0x4bea18);return _0x382043['panelView']['children']['add'](_0x405dd4),_0x4bea18&&_0x382043['on']('change:isOpen',(_0x202a21,_0x45d5be,_0x591db9)=>{if(_0x591db9){if(_0x4cb575['plugins']['has']('AIEditing')){const _0x51cccc=_0x4cb575['plugins']['get'](tn),_0x100ec5=_0x4cb575['model']['document']['selection'],_0x572b6a=Array['from'](_0x100ec5['getRanges']());_0x572b6a['length']>0x0&&_0x51cccc['showFakeVisualSelection']({'ranges':_0x572b6a,'id':'quick-action','priority':0x14});}}else _0x4cb575['plugins']['has']('AIEditing')&&_0x4cb575['plugins']['get'](tn)['hideFakeVisualSelection']('quick-action'),_0x405dd4['resetSearch']();}),_0x382043;};}const Ga='<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>',Fa='<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>',Ka='<task>For\x20the\x20given\x20selected\x20part\x20of\x20an\x20HTML\x20document\x20you\x20must\x20extract\x20and\x20present\x20the\x20key\x20points\x20from\x20its\x20content.</task><rules>1.\x20Present\x20the\x20output\x20as\x20a\x20clear,\x20structured\x20list\x20(bullets\x20or\x20numbered).-\x20Each\x20point\x20should\x20be\x20concise\x20(one\x20sentence\x20or\x20less).-\x20Do\x20not\x20merge\x20distinct\x20ideas\x20into\x20one\x20bullet.2.\x20Identify\x20what\x20type\x20of\x20text\x20it\x20is\x20and\x20adapt\x20the\x20extraction\x20style:-\x20If\x20it\x20is\x20descriptive\x20capture\x20the\x20main\x20attributes\x20or\x20features.-\x20If\x20it\x20is\x20argumentative\x20extract\x20the\x20main\x20claim\x20and\x20supporting\x20reasons\x20separately.-\x20If\x20it\x20is\x20narrative/story-like\x20extract\x20the\x20main\x20events\x20in\x20chronological\x20order.-\x20If\x20it\x20is\x20data-driven\x20(stats,\x20figures,\x20facts)\x20highlight\x20the\x20most\x20important\x20facts\x20or\x20numbers.-\x20If\x20it\x20is\x20instructional\x20list\x20the\x20steps\x20or\x20main\x20actions\x20in\x20simplified\x20form.-\x20If\x20it\x20provides\x20comparisons\x20extract\x20the\x20contrasted\x20items\x20and\x20their\x20differences/similarities.-\x20If\x20it\x20does\x20not\x20fit\x20any\x20category\x20above\x20extract\x20the\x20main\x20ideas\x20in\x20plain,\x20short\x20statements.3.\x20Keep\x20the\x20list\x20between\x203–7\x20items\x20where\x20possible.-\x20If\x20the\x20text\x20is\x20very\x20short,\x20fewer\x20items\x20are\x20fine.-\x20If\x20it\x20is\x20very\x20long,\x20focus\x20on\x20the\x20most\x20important\x20ideas\x20only.4.\x20Do\x20not\x20copy\x20long\x20text\x20fragments\x20—\x20restate\x20in\x20simple\x20words.5.\x20Do\x20not\x20add\x20interpretation,\x20evaluation,\x20or\x20commentary\x20beyond\x20the\x20text.6.\x20Ensure\x20the\x20list\x20can\x20stand\x20alone\x20without\x20requiring\x20the\x20reader\x20to\x20see\x20the\x20original\x20document.7.\x20Use\x20the\x20context\x20of\x20the\x20whole\x20document,\x20but\x20focus\x20on\x20the\x20selected\x20part\x20when\x20creating\x20your\x20key\x20points.8.\x20Your\x20key\x20points\x20should\x20be\x20written\x20in\x20%0\x20language.</rules><constraints>1.\x20You\x20MUST\x20NOT\x20perform\x20any\x20edits\x20or\x20modifications\x20on\x20the\x20provided\x20document.2.\x20You\x20MUST\x20NOT\x20include\x20document\x20modifications\x20in\x20your\x20response.3.\x20Your\x20message\x20should\x20only\x20include\x20the\x20extracted\x20key\x20points.\x20Do\x20not\x20add\x20any\x20additional\x20text,\x20flattery,\x20questions\x20or\x20followup\x20suggestions.</constraints>';var Wa=function(_0x377a64){return _0x377a64['chat']='AIChat',_0x377a64['action']='AIActions',_0x377a64;}({});class Ya extends _0x58645c{static get['requires'](){return[_0x1107e4,ls];}static get['pluginName'](){return'AIQuickActionsUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}async['init'](){const _0x218fb0=await this['_getDefaultAndCustomActions']();this['_prepareQuickActionsDefinition'](_0x218fb0),this['_initializeQuickActionsComponentsAndCommands']();}static['getDefaultQuickActions'](_0xcc6f8c){return function(_0x92efb7){const _0x5cb560=new Intl['DisplayNames'](['en'],{'type':'language'})['of'](_0x92efb7['uiLanguage']),_0x3368b8=_0x5cb560||'English',_0x4108eb=[{'id':'ask-ai','label':us(_0x92efb7,'AI_QUICK_ACTIONS_ASK_AI'),'type':no['CHAT'],'icon':_0x541b7d},{'id':'chat-commands','label':us(_0x92efb7,'AI_QUICK_ACTIONS_CHAT_COMMANDS'),'icon':_0x541b7d,'actions':[{'id':'explain','label':us(_0x92efb7,'AI_QUICK_ACTIONS_EXPLAIN'),'displayedPrompt':us(_0x92efb7,'AI_QUICK_ACTIONS_EXPLAIN'),'prompt':Ga['replace']('%0',_0x3368b8),'type':no['CHAT']},{'id':'summarize','label':us(_0x92efb7,'AI_QUICK_ACTIONS_SUMMARIZE'),'displayedPrompt':us(_0x92efb7,'AI_QUICK_ACTIONS_SUMMARIZE'),'prompt':Fa['replace']('%0',_0x3368b8),'type':no['CHAT']},{'id':'highlight-key-points','label':us(_0x92efb7,'AI_QUICK_ACTIONS_HIGHLIGHT_KEY_POINTS'),'displayedPrompt':us(_0x92efb7,'AI_QUICK_ACTIONS_HIGHLIGHT_KEY_POINTS'),'prompt':Ka['replace']('%0',_0x3368b8),'type':no['CHAT']}]},{'id':'improve-writing','label':us(_0x92efb7,'AI_QUICK_ACTIONS_IMPROVE_WRITING'),'type':no['ACTION'],'icon':_0x3451ae},{'id':'continue','label':us(_0x92efb7,'AI_QUICK_ACTIONS_CONTINUE_WRITING'),'type':no['ACTION'],'icon':_0x2eaf7f},{'id':'fix-grammar','label':us(_0x92efb7,'AI_QUICK_ACTIONS_FIX_GRAMMAR_SPELLING'),'type':no['ACTION'],'icon':_0x14ca44},{'id':'adjust-length','label':us(_0x92efb7,'AI_QUICK_ACTIONS_ADJUST_LENGTH'),'icon':_0x1885aa,'actions':[{'id':'make-shorter','label':us(_0x92efb7,'AI_QUICK_ACTIONS_MAKE_SHORTER'),'type':no['ACTION']},{'id':'make-longer','label':us(_0x92efb7,'AI_QUICK_ACTIONS_MAKE_LONGER'),'type':no['ACTION']}]},{'id':'change-tone','label':us(_0x92efb7,'AI_QUICK_ACTIONS_CHANGE_TONE'),'icon':_0x5d5e5c,'actions':[{'id':'make-tone-casual','label':us(_0x92efb7,'AI_QUICK_ACTIONS_MORE_CASUAL'),'type':no['ACTION']},{'id':'make-tone-direct','label':us(_0x92efb7,'AI_QUICK_ACTIONS_MORE_DIRECT'),'type':no['ACTION']},{'id':'make-tone-friendly','label':us(_0x92efb7,'AI_QUICK_ACTIONS_MORE_FRIENDLY'),'type':no['ACTION']},{'id':'make-tone-confident','label':us(_0x92efb7,'AI_QUICK_ACTIONS_MORE_CONFIDENT'),'type':no['ACTION']},{'id':'make-tone-professional','label':us(_0x92efb7,'AI_QUICK_ACTIONS_MORE_PROFESSIONAL'),'type':no['ACTION']}]},{'id':'translate','label':us(_0x92efb7,'AI_QUICK_ACTIONS_TRANSLATE'),'icon':_0x4f4fba,'actions':[{'id':'translate-to-english','label':us(_0x92efb7,'AI_QUICK_ACTIONS_TRANSLATE_ENGLISH'),'type':no['ACTION'],'actionName':'translate','args':{'language':'english'}},{'id':'translate-to-chinese','label':us(_0x92efb7,'AI_QUICK_ACTIONS_TRANSLATE_CHINESE'),'type':no['ACTION'],'actionName':'translate','args':{'language':'chinese'}},{'id':'translate-to-spanish','label':us(_0x92efb7,'AI_QUICK_ACTIONS_TRANSLATE_SPANISH'),'type':no['ACTION'],'actionName':'translate','args':{'language':'spanish'}},{'id':'translate-to-german','label':us(_0x92efb7,'AI_QUICK_ACTIONS_TRANSLATE_GERMAN'),'type':no['ACTION'],'actionName':'translate','args':{'language':'german'}},{'id':'translate-to-french','label':us(_0x92efb7,'AI_QUICK_ACTIONS_TRANSLATE_FRENCH'),'type':no['ACTION'],'actionName':'translate','args':{'language':'french'}},{'id':'translate-to-japanese','label':us(_0x92efb7,'AI_QUICK_ACTIONS_TRANSLATE_JAPANESE'),'type':no['ACTION'],'actionName':'translate','args':{'language':'japanese'}},{'id':'translate-to-portuguese','label':us(_0x92efb7,'AI_QUICK_ACTIONS_TRANSLATE_PORTUGUESE'),'type':no['ACTION'],'actionName':'translate','args':{'language':'portuguese'}},{'id':'translate-to-korean','label':us(_0x92efb7,'AI_QUICK_ACTIONS_TRANSLATE_KOREAN'),'type':no['ACTION'],'actionName':'translate','args':{'language':'korean'}},{'id':'translate-to-italian','label':us(_0x92efb7,'AI_QUICK_ACTIONS_TRANSLATE_ITALIAN'),'type':no['ACTION'],'actionName':'translate','args':{'language':'italian'}},{'id':'translate-to-russian','label':us(_0x92efb7,'AI_QUICK_ACTIONS_TRANSLATE_RUSSIAN'),'type':no['ACTION'],'actionName':'translate','args':{'language':'russian'}}]},{'id':'other','label':us(_0x92efb7,'AI_QUICK_ACTIONS_OTHER'),'icon':tt,'actions':[]}];return _0x4108eb;}(_0xcc6f8c);}async['_getDefaultAndCustomActions'](){const _0x3f9f33=Ya['getDefaultQuickActions'](this['editor']['locale']),_0x179b6d=this['editor']['config']['get']('ai.quickActions.extraCommands')||[];let _0x15053a=[];try{_0x15053a=await new qs({'connector':this['editor']['plugins']['get']('AIConnector'),'locale':this['editor']['locale']})['getAll']();}catch(_0x214406){const _0xbcf40e=new ht('ai-quick-actions-models-unable-to-retrieve',this,{'error':_0x214406});mt(_0xbcf40e['message']);}finally{const _0x556a8c=_0x179b6d['map'](_0x425551=>({..._0x425551,'type':'chat'===_0x425551['type']?no['CHAT']:no['ACTION'],'icon':void 0x0}));_0x3f9f33['find'](_0x4f92b5=>'other'===_0x4f92b5['id'])['actions']['push'](..._0x556a8c),_0x3f9f33['forEach'](_0x1a9346=>{if('actions'in _0x1a9346)_0x1a9346['actions']['forEach'](_0x2d0681=>{if(_0x2d0681['isEnabled']=!!_0x15053a['find'](_0x51d0f8=>_0x51d0f8['id']===_0x2d0681['model'])||void 0x0===_0x2d0681['model'],!_0x2d0681['isEnabled']){const _0x17e7bd=new ht('ai-quick-actions-unavailable-model',this,{'actionId':_0x2d0681['id'],'modelId':_0x2d0681['model']});mt(_0x17e7bd['message']);}});else{if(_0x1a9346['isEnabled']=!!_0x15053a['find'](_0x145e4a=>_0x145e4a['id']===_0x1a9346['model'])||void 0x0===_0x1a9346['model'],!_0x1a9346['isEnabled']){const _0x194e60=new ht('ai-quick-actions-unavailable-model',this,{'actionId':_0x1a9346['id'],'modelId':_0x1a9346['model']});mt(_0x194e60['message']);}}});}return _0x3f9f33;}['_initializeQuickActionsComponentsAndCommands'](){const _0x5dc4e7=new Qt(this['editor']['locale']);_0x5dc4e7['attachToDom'](),this['_initializeQuickActionsDropdown'](_0x5dc4e7),this['_initializeQuickActionsMenuBar'](),this['_initializeQuickActionsComponents'](_0x5dc4e7);}['_initializeQuickActionsDropdown'](_0x2ce3f9){const _0x218af1=this['editor']['config']['get']('ai.quickActions.isSearchEnabled')??!0x0;this['editor']['ui']['componentFactory']['add']('aiQuickActions',Ba({'editor':this['editor'],'content':this['_quickActionsDefinition'],'buttonDefinition':{'icon':_0x195043,'label':us(this['editor']['locale'],'AI_QUICK_ACTIONS_HEADING')},'bodyCollection':_0x2ce3f9,'hasSearch':_0x218af1}));}['_prepareQuickActionsDefinition'](_0x1f17a9){this['_quickActionsDefinition']=_0x1f17a9['map'](_0x5ee342=>{if('actions'in _0x5ee342){const _0x34f54a=_0x5ee342;return{..._0x34f54a,'actions':_0x34f54a['actions']['map'](_0x304927=>{const {actions:_0x52c36f,..._0x107fa2}=_0x34f54a;return{..._0x304927,'parent':_0x107fa2};})['filter'](_0x19cc1c=>this['_shouldIncludeAction'](_0x19cc1c))};}return _0x5ee342;})['filter'](_0x4ab8a2=>'actions'in _0x4ab8a2?_0x4ab8a2['actions']['length']>0x0:this['_shouldIncludeAction'](_0x4ab8a2));}['_shouldIncludeAction'](_0x168b9b){const _0x1061b1=this['editor']['config']['get']('ai.quickActions.removeCommands')||[];return this['editor']['plugins']['has'](Wa[_0x168b9b['type']])&&!_0x1061b1['includes'](_0x168b9b['id'])&&!(_0x168b9b['type']===no['CHAT']&&!0x1===this['editor']['config']['get']('ai.chat.context.document.enabled'));}['_initializeQuickActionsComponents'](_0x5d591b){this['_quickActionsDefinition']['forEach'](_0x1439e1=>{if('actions'in _0x1439e1){const _0x2e504f=Ba({'editor':this['editor'],'content':_0x1439e1['actions'],'buttonDefinition':_0x1439e1,'bodyCollection':_0x5d591b});this['editor']['ui']['componentFactory']['add'](_0x1439e1['id'],_0x2e504f),_0x1439e1['actions']['forEach'](_0xcd7e44=>{const _0x2ef8d2=Da({'editor':this['editor'],'action':_0xcd7e44});this['editor']['ui']['componentFactory']['add'](_0xcd7e44['id'],_0x2ef8d2);});}else{const _0x5da47c=Da({'editor':this['editor'],'action':_0x1439e1,'withText':!0x1,'withIcon':!0x0,'isInDropdown':!0x1});this['editor']['ui']['componentFactory']['add'](_0x1439e1['id'],_0x5da47c);}});}['_initializeQuickActionsMenuBar'](){this['editor']['ui']['componentFactory']['add']('menuBar:aiQuickActions',_0x329e4d=>{const _0x17b891=new Kt(_0x329e4d),_0x24bc47=us(_0x329e4d,'AI_QUICK_ACTIONS_HEADING');_0x17b891['buttonView']['set']({'label':_0x24bc47,'icon':_0x195043});const _0x19e92e=new $t(_0x329e4d);_0x19e92e['set']({'ariaLabel':_0x24bc47,'role':'menu'}),this['_quickActionsDefinition']['forEach'](_0xe42c44=>{if('actions'in _0xe42c44){const _0x410318=_0xe42c44,_0x34788b=new qt(_0x329e4d,_0x17b891),_0x270847=new Kt(_0x329e4d),_0x3131a4=new $t(_0x329e4d);_0x270847['buttonView']['set']({'label':_0x410318['label'],'icon':_0x410318['icon']}),_0x410318['actions']['forEach'](_0x3f6f8e=>{const _0x2883ab=new qt(_0x329e4d,_0x270847),_0x478f4b=new Wt(_0x329e4d);_0x478f4b['set']({'label':_0x3f6f8e['label'],'icon':_0x3f6f8e['icon'],'role':'menuitem','isEnabled':_0x3f6f8e['isEnabled']}),_0x478f4b['on']('execute',()=>{this['_executeQuickAction'](_0x3f6f8e);}),_0x478f4b['delegate']('execute')['to'](_0x270847),_0x2883ab['children']['add'](_0x478f4b),_0x3131a4['items']['add'](_0x2883ab);}),_0x270847['panelView']['children']['add'](_0x3131a4),_0x34788b['children']['add'](_0x270847),_0x19e92e['items']['add'](_0x34788b);}else{const _0x330df1=_0xe42c44,_0x2dd841=new qt(_0x329e4d,_0x17b891),_0x1fbb34=new Wt(_0x329e4d);_0x1fbb34['set']({'label':_0x330df1['label'],'icon':_0x330df1['icon'],'role':'menuitem','isEnabled':_0x330df1['isEnabled']}),_0x1fbb34['on']('execute',()=>{this['_executeQuickAction'](_0x330df1);}),_0x1fbb34['delegate']('execute')['to'](_0x17b891),_0x2dd841['children']['add'](_0x1fbb34),_0x19e92e['items']['add'](_0x2dd841);}});const _0x1c8962=Object['values'](Wa)['some'](_0x14e9b0=>this['editor']['plugins']['has'](_0x14e9b0));return _0x17b891['set']({'isEnabled':_0x1c8962}),_0x17b891['panelView']['children']['add'](_0x19e92e),_0x17b891;});}['_executeQuickAction'](_0x4c611a){const _0x40563c=this['editor'];_0x40563c['editing']['view']['focus'](),_0x40563c['commands']['execute']('aiQuickAction',_0x4c611a);const _0x5c6bde=_0x40563c['ui']['view']['menuBarView'];_0x5c6bde&&_0x5c6bde['close']&&_0x5c6bde['close']();}}class $a extends _0x26b415{['execute'](_0x593a3d){switch(this['_expandSelectionIfCollapsed'](),_0x593a3d['type']){case no['CHAT']:if(!this['editor']['plugins']['has']('AIChat')){const _0x2f63e5=us(this['editor']['locale'],'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND','AIChat');throw new ht('ai-quick-actions-plugin-not-found',this['editor'],{'errorMessage':_0x2f63e5});}this['_handleAIChatAction'](_0x593a3d);break;case no['ACTION']:if(!this['editor']['plugins']['has']('AIActions')){const _0x571ee6=us(this['editor']['locale'],'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND','AIActions');throw new ht('ai-quick-actions-plugin-not-found',this['editor'],{'errorMessage':_0x571ee6});}this['_handleAIActionsAction'](_0x593a3d);}}async['_handleAIChatAction'](_0xf8118f){const _0x12acb7=this['editor']['plugins']['get']('AIChatController'),_0x4820db=this['editor']['plugins']['get']('AITabs')['view'];if(_0x4820db['isVisible']||(_0x4820db['isVisible']=!0x0),'chat'!==_0x4820db['activeTab']&&_0x4820db['activateTab']('chat'),'ask-ai'===_0xf8118f['id'])_0x12acb7['removeSelectionFromChatContext'](),_0x12acb7['addSelectionToChatContext'](),_0x12acb7['focusPromptInput']();else await _0x12acb7['startConversation'](),_0x12acb7['removeSelectionFromChatContext'](),_0x12acb7['addSelectionToChatContext'](),_0x12acb7['focusPromptInput'](),await _0x12acb7['sendMessage']({'message':_0xf8118f['prompt']||_0xf8118f['displayedPrompt']||_0xf8118f['label'],'attributes':{'quickActionData':{'id':_0xf8118f['id']},'displayedPrompt':_0xf8118f['displayedPrompt']}});}['_expandSelectionIfCollapsed'](){const _0x29d482=this['editor'],_0x3827b7=_0x29d482['model']['document']['selection'];if(!_0x3827b7['isCollapsed'])return;const _0x1fcb4d=It(_0x3827b7['getSelectedBlocks']())||_0x29d482['model']['schema']['getLimitElement'](_0x3827b7);_0x29d482['model']['change'](_0x5bf6b9=>{_0x5bf6b9['setSelection'](_0x1fcb4d,'in');});}['_handleAIActionsActionLabel'](_0x1fc233){return _0x1fc233['parent']?.['label']&&'other'!==_0x1fc233['parent']?.['id']?_0x1fc233['parent']['label']+':\x20'+_0x1fc233['label']:_0x1fc233['label'];}async['_handleAIActionsAction'](_0x1cd197){const _0xc21d8b=this['editor']['plugins']['get']('AIActions'),_0xf3a82a=_0x1cd197['prompt']?{'userMessage':_0x1cd197['prompt'],'model':_0x1cd197['model']}:{'actionName':_0x1cd197['actionName']||_0x1cd197['id'],'args':_0x1cd197['args']},_0x553bdf=this['_handleAIActionsActionLabel'](_0x1cd197);await _0xc21d8b['executeAction'](_0xf3a82a,_0x553bdf,_0x1cd197['icon']);}}class qa extends _0x58645c{static get['pluginName'](){return'AIQuickActionsEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x434926=this['editor'],_0x78d058=new $a(this['editor']);if(_0x434926['commands']['add']('aiQuickAction',_0x78d058),_0x434926['plugins']['has']('AIChat')){const _0x4cb712=this['editor']['plugins']['get']('AIChatController');_0x434926['model']['document']['selection']['on']('change:range',(_0xe8d151,_0x3066da)=>{_0x3066da['directChange']&&_0x4cb712['removeSelectionFromChatContext']();});}}}class Qa extends Ps{['updateChangeGroups'](){if(this['parsedMergedContent']=this['parsedContent']['cloneNode'](!0x0),0x0==this['parsedMergedContent']['childNodes']['length'])return void(this['changeGroups']=[]);const _0x1e0291=this['documentContextContent']['children']['map'](_0x75befa=>({'node':_0x75befa,'id':ms(_0x75befa,'data-id')})),_0x59c213=this['parsedMergedContent']['children']['map'](_0x305e1e=>({'node':_0x305e1e,'id':ms(_0x305e1e,'data-id')||ot()})),_0x50d728=_0xfe775d(_0x1e0291,_0x59c213,{'comparator':(_0x4a39c4,_0x2a8f01)=>_0x4a39c4['id']==_0x2a8f01['id'],'oneChangePerToken':!0x0});if(!this['isDone']){for(;_0x50d728['length']&&_0x50d728[_0x50d728['length']-0x1]['removed'];)_0x50d728['pop']();}const _0x57c402=_0x50d728['map'](_0x1adad9=>{const _0x2c497c=_0x1adad9['added']?'new':_0x1adad9['removed']?'removed':'modified';return{'node':_0x1adad9['value'][0x0]['node'],'type':_0x2c497c,'id':_0x1adad9['value'][0x0]['id']};});this['changeGroups']=[{'changes':_0x57c402,'state':'pending','index':0x0}];}['_getDifferentChangeGroups'](_0x3cdd0b,_0x3d1a5d){return _0x3d1a5d;}}class Xa extends Ms{['content'];['version'];['actionName'];['args'];['userMessage'];['model'];['hasError']=!0x1;constructor(_0x1edfb5){super(_0x1edfb5),this['content']=_0x1edfb5['content'],this['version']=_0x1edfb5['version'],this['actionName']=_0x1edfb5['actionName'],this['args']=_0x1edfb5['args'],this['userMessage']=_0x1edfb5['userMessage'],this['model']=_0x1edfb5['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':Us['TEXT'],'content':this['content'],'version':this['version'],'label':'Current\x20document','uiId':'current-document'};}['createReply'](_0x346461){const _0x5c67c3=new Qa({'editor':this['editor'],'documentContextContent':this['content'],..._0x346461});return this['replies']['push'](_0x5c67c3),_0x5c67c3['delegate'](...Hs)['to'](this),this['fire']('replyCreated',_0x5c67c3),_0x5c67c3;}}class za extends kt{constructor(_0x25cb0d,_0x140ee2=!0x0,_0x4718a7=!0x0){super(_0x25cb0d),this['set']('isEnabled',!0x1),_0x140ee2&&(this['applyButton']=this['_createButton'](us(_0x25cb0d,'AI_BALLOON_APPLY_BUTTON'),ds),this['applyButton']['bind']('isEnabled')['to'](this),this['items']['add'](this['applyButton'])),_0x4718a7&&(this['suggestButton']=this['_createButton'](us(_0x25cb0d,'AI_BALLOON_SUGGEST_BUTTON'),_0x140ee2?_s:ds),this['suggestButton']['bind']('isEnabled')['to'](this),this['items']['add'](this['suggestButton'])),this['setButtonsVisibility']({'showApplyButton':_0x140ee2,'showSuggestButton':_0x4718a7}),this['extendTemplate']({'attributes':{'class':['ck-ai-balloon__toolbar']}});}['setButtonsVisibility']({showApplyButton:_0x398544,showSuggestButton:_0x349dba}){this['applyButton']&&(this['applyButton']['isVisible']=_0x398544),this['suggestButton']&&(this['suggestButton']['isVisible']=_0x349dba);}['_createButton'](_0xc08580,_0x54dd35){const _0x13c82b=new Nt(this['locale']);return _0x13c82b['set']({'label':_0xc08580,'class':_0x54dd35,'isVisible':!0x0,'withText':!0x0}),_0x13c82b;}}class ja extends vt{constructor(_0x46d101){super(_0x46d101),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-balloon__disclaimer']},'children':[{'tag':'p','attributes':{'class':['ck','ck-ai-balloon__disclaimer-content']},'children':[{'text':us(_0x46d101,'AI_DISCLAIMER_TEXT')}]}]});}}class Ja extends vt{constructor(_0x17e7f2){super(_0x17e7f2),this['set']('isVisible',!0x0);const _0x560ec7=new vn('small');_0x560ec7['isVisible']=!0x0;const _0x274b69=new vt(this['locale']);_0x274b69['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-suggestion__loader-text']},'children':[us(this['locale'],'AI_CHAT_IS_WRITING')]}),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__loader',this['bindTemplate']['if']('isVisible','ck-hidden',_0x14d6a9=>!_0x14d6a9)]},'children':[_0x560ec7,_0x274b69]});}}class Za extends Ra{['focusCycler'];['_config'];['_contentWrapper'];['_streamableContentView'];['_toolbarView'];['_miniToolbarView'];['_loaderView'];['_disclaimerView'];['_focusTracker'];['_keystrokes'];['_dialogContent'];['_focusables'];['_scrollManager'];['_navigationPreviousButton'];['_navigationNextButton'];['_navigationTryAgainButton'];['_navigationCounter'];constructor(_0x14a8f9,_0x117dbe){super(_0x14a8f9),this['set']('isBusy',!0x1),this['set']('isTrackChangesOn',!0x1),this['set']('_isLoading',!0x1),this['set']('_hasError',!0x1),this['_config']=_0x117dbe,this['_focusTracker']=new At(),this['_keystrokes']=new gt(),this['_focusables']=this['createCollection'](),this['focusCycler']=new Ut({'focusables':this['_focusables'],'focusTracker':this['_focusTracker'],'keystrokeHandler':this['_keystrokes'],'actions':{'focusPrevious':'shift\x20+\x20tab','focusNext':'tab'}}),this['_dialogContent']=new _0x4539b4(),this['_addContentWrapper'](_0x117dbe),this['_addDisclaimerView'](),this['_addToolbar'](_0x117dbe),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'](_0x117dbe);});}['render'](){super['render']();for(const _0x4653d4 of this['_focusables'])this['_focusTracker']['add'](_0x4653d4['element']);this['_keystrokes']['listenTo'](this['element']),this['_initializeScrollManager']();}['destroy'](){super['destroy'](),this['_scrollManager']&&this['_scrollManager']['destroy']();}['focus'](_0x3e5731){-0x1===_0x3e5731?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}['setIsLoading'](_0x229b57){this['_isLoading']=_0x229b57;}['setErrorState'](){this['_hasError']=!0x0,this['_miniToolbarView']['toggleShowChangesEnabled'](!0x1);}['clearErrorState'](){this['_hasError']=!0x1,this['_miniToolbarView']['toggleShowChangesEnabled'](!0x0);}['showError'](_0x29bdd9){super['showError'](_0x29bdd9),this['_dialogContent']['has'](this['_errorView'])||this['_dialogContent']['add'](this['_errorView'],0x0);}['hideError'](){super['hideError'](),this['clearErrorState']();}['showBlockingError'](_0x3e1633){super['showBlockingError'](_0x3e1633),this['setErrorState']();}['addMiniToolbarItem'](_0x321b76){this['_miniToolbarView']['items']['has'](_0x321b76)||this['_miniToolbarView']['items']['add'](_0x321b76);}['removeMiniToolbarItem'](_0x2180c8){this['_miniToolbarView']['items']['has'](_0x2180c8)&&this['_miniToolbarView']['items']['remove'](_0x2180c8);}['showLoader'](){this['_loaderView']&&(this['_isLoading']=!0x0);}['hideLoader'](){this['_loaderView']&&(this['_isLoading']=!0x1);}['_toggleToolbarButtonsVisibility']({showApplyButton:_0x3e63c,showSuggestButton:_0x3af39b}){_0x3e63c=_0x3e63c&&!this['isTrackChangesOn']&&this['_config']['availableActions']['includes']('applySuggestion'),_0x3af39b=_0x3af39b&&this['_config']['availableActions']['includes']('insertSuggestion'),this['_toolbarView']['setButtonsVisibility']({'showApplyButton':_0x3e63c,'showSuggestButton':_0x3af39b});}async['updateContent'](_0x543b99){await this['_streamableContentView']['update'](_0x543b99);}['clearContent'](){this['_streamableContentView']['clear']();}['_addContentWrapper'](_0x104feb){this['_contentWrapper']=new vt(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'](_0x104feb['miniToolbarConfig'])]}),this['_dialogContent']['add'](this['_contentWrapper']);}['_addDisclaimerView'](){this['_disclaimerView']=new ja(this['locale']),this['_dialogContent']['add'](this['_disclaimerView']);}['_addToolbar']({showApplyButton:_0x40910b,showSuggestButton:_0x501d9e}){this['_toolbarView']=new za(this['locale'],_0x40910b,_0x501d9e),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',(_0x3d3be1,_0x3eb533,_0x4330c3)=>!(_0x3d3be1||_0x3eb533||_0x4330c3)),this['_toggleToolbarButtonsVisibility']({'showApplyButton':_0x40910b,'showSuggestButton':_0x501d9e}),this['_dialogContent']['add'](this['_toolbarView']);}['_createMiniToolbar'](_0x30d04e){return this['_miniToolbarView']=new Na(this['locale'],_0x30d04e),this['_miniToolbarView']['delegate'](...en)['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',(_0x5e92ad,_0x30fc25)=>!(_0x5e92ad||_0x30fc25)),this['_miniToolbarView'];}['_createLoaderView'](){return this['_loaderView']=new Ja(this['locale']),this['_loaderView']['bind']('isVisible')['to'](this,'_isLoading'),this['_loaderView'];}['_createStreamableContentView'](){return this['_streamableContentView']=new pn(this['locale']),this['_streamableContentView'];}['_setupMiniToolbarButtons'](){const _0x469e86=new Nt(this['locale']),_0x1f43b1=new Nt(this['locale']),_0x6cabf5=new to(this['locale']),_0x2b4821=new Nt(this['locale']);_0x469e86['set']({'icon':et,'label':us(this['locale'],'AI_ACTIONS_TRY_AGAIN'),'tooltip':!0x0,'class':'ck-ai-custom-action-button\x20'+As}),_0x1f43b1['set']({'icon':_0x5005b7,'tooltip':us(this['locale'],'AI_ACTIONS_PREVIOUS_INTERACTION'),'class':'ck-ai-navigation-button\x20ck-ai-previous-button\x20'+As}),_0x2b4821['set']({'icon':it,'tooltip':us(this['locale'],'AI_ACTIONS_NEXT_INTERACTION'),'class':'ck-ai-navigation-button\x20ck-ai-next-button\x20'+As}),_0x469e86['bind']('isEnabled')['to'](this,'isBusy',_0x4c2111=>!_0x4c2111),_0x469e86['on']('execute',()=>{this['fire']('tryAgain');}),_0x1f43b1['bind']('isEnabled')['to'](this,'isBusy',_0x277189=>!_0x277189),_0x1f43b1['on']('execute',()=>{this['fire']('showPrevious');}),_0x2b4821['bind']('isEnabled')['to'](this,'isBusy',_0x5db63b=>!_0x5db63b),_0x2b4821['on']('execute',()=>{this['fire']('showNext');}),this['_navigationPreviousButton']=_0x1f43b1,this['_navigationCounter']=_0x6cabf5,this['_navigationNextButton']=_0x2b4821,this['_navigationTryAgainButton']=_0x469e86;}['updateMiniToolbarButtons'](_0xa0b5e8,_0x4d22ff){this['_navigationPreviousButton']||this['_setupMiniToolbarButtons']();const _0x3ba403=_0xa0b5e8>0x1;if(this['addMiniToolbarItem'](this['_navigationTryAgainButton']),_0x3ba403){this['addMiniToolbarItem'](this['_navigationPreviousButton']),this['addMiniToolbarItem'](this['_navigationCounter']),this['addMiniToolbarItem'](this['_navigationNextButton']);const _0x259135=_0xa0b5e8-_0x4d22ff;this['_navigationCounter']['setInteractionCount'](_0x259135+'/'+_0xa0b5e8),this['_navigationPreviousButton']['isEnabled']=_0x4d22ff<_0xa0b5e8-0x1,this['_navigationNextButton']['isEnabled']=_0x4d22ff>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'](_0x3fc2ae){this['_isLoading']=_0x3fc2ae;}['resetShowChangesButton'](){this['_miniToolbarView']['isShowChangesOn']=!0x1;}['_initializeScrollManager'](){const _0x5265dc=this['_getScrollableElement']();_0x5265dc&&!this['_scrollManager']&&(this['_scrollManager']=new ir(_0x5265dc));}['_getScrollableElement'](){return this['_streamableContentView']['element'];}}class to extends vt{constructor(_0xf2200c){super(_0xf2200c);const _0x12bf89=this['bindTemplate'];this['set']('interactionCount','1/1'),this['setTemplate']({'tag':'span','attributes':{'class':['ck-ai-interaction-counter']},'children':[{'text':_0x12bf89['to']('interactionCount')}]});}['setInteractionCount'](_0x2cc694){this['set']('interactionCount',_0x2cc694);}}class eo extends _0x58645c{static get['requires'](){return[ls,Bt,tn,ka,_0x32e5d7];}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(_0x2a05d3){super(_0x2a05d3),this['_bodyCollection']=new Qt(this['editor']['locale']),this['_bodyCollection']['attachToDom'](),this['_aiConnector']=this['editor']['plugins']['get']('AIConnector'),this['set']('isBusy',!0x1),this['_promiseQueue']=new mn();}['stopInteraction'](){this['_stopInteraction']();}async['executeAction'](_0x14299f,_0x1546cf,_0x4dfef3){if(this['_stopInteraction'](),this['editor']['plugins']['has']('TableSelection')){if(this['editor']['plugins']['get']('TableSelection')['getSelectedTableCells']()){const {modelFragment:_0x4b8254,anchorData:_0x8d0a35}=this['_getExecuteDataInTable']();return this['_executeAction'](_0x14299f,_0x4b8254,_0x8d0a35,_0x1546cf,_0x4dfef3);}}const {modelFragment:_0x1fd52f,anchorData:_0x443601}=this['_getExecuteDataRegular']();return this['_executeAction'](_0x14299f,_0x1fd52f,_0x443601,_0x1546cf,_0x4dfef3);}async['destroy'](){return this['_stopInteraction'](),this['_bodyCollection']['detachFromDom'](),super['destroy']();}['_createActionsBalloonView'](){const _0x3aabf7=this['editor']['plugins']['has']('TrackChanges');let _0x4b37cf=this['editor']['config']['get']('ai.availableReplyActions')||[...wn];_0x3aabf7||(_0x4b37cf=_0x4b37cf['filter'](_0x108ed0=>'insertSuggestion'!=_0x108ed0));const _0x251644=this['editor']['commands']['get']('trackChanges'),_0x4f2ccb=new Za(this['editor']['locale'],{'showApplyButton':!0x0,'showSuggestButton':_0x3aabf7,'miniToolbarConfig':{'showChanges':'icon'},'availableActions':_0x4b37cf});return _0x4f2ccb['bind']('isBusy')['to'](this),_0x251644&&_0x4f2ccb['bind']('isTrackChangesOn')['to'](_0x251644,'value'),_0x4f2ccb['on']('tryAgain',()=>{this['_refreshInteraction']();}),_0x4f2ccb['on']('showPrevious',()=>{this['_navigateToPrevious']();}),_0x4f2ccb['on']('showNext',()=>{this['_navigateToNext']();}),_0x4f2ccb;}['_getExecuteDataRegular'](){const _0x51af28=this['editor']['model']['document']['selection'];if(_0x51af28['isCollapsed']){const _0x57865e=It(_0x51af28['getSelectedBlocks']())||this['editor']['model']['schema']['getLimitElement'](_0x51af28);this['editor']['model']['change'](_0x4117c0=>{_0x4117c0['setSelection'](_0x57865e,'in');});}const _0x44f950=_0x51af28['getFirstRange'](),_0x26a9c2=this['_wrapWithCommonAncestors'](this['editor']['model']['getSelectedContent'](_0x51af28),_0x44f950['start'],_0x44f950['end']);this['_copyMarkersToFragment'](_0x26a9c2,_0x51af28,{'isTableSelection':!0x1});const _0x14ebbc=_0x51af28['getFirstRange']()['start'],_0x872e3d=new Map();let _0xf69f83=_0x26a9c2;for(let _0x580902=0x0;_0x580902<_0x14ebbc['path']['length'];_0x580902++)_0x872e3d['set'](_0xf69f83,_0x14ebbc['path'][_0x580902]),_0xf69f83=_0xf69f83['getChild'](0x0);return{'modelFragment':_0x26a9c2,'anchorData':_0x872e3d};}['_getExecuteDataInTable'](){const _0xa646fc=this['editor']['model']['document']['selection'],_0x106988=this['editor']['plugins']['get']('TableSelection')['getSelectionAsFragment'](),_0x5e2da9=_0xa646fc['getFirstRange']()['start']['parent']['parent'],_0x3e52ab=this['editor']['model']['createRange'](this['editor']['model']['createPositionBefore'](_0x5e2da9),this['editor']['model']['createPositionAfter'](_0x5e2da9)),_0x56d9ee=this['_wrapWithCommonAncestors'](_0x106988,_0x3e52ab['start'],_0x3e52ab['end']);this['_copyMarkersToFragment'](_0x56d9ee,_0xa646fc,{'isTableSelection':!0x0});const _0x5bd535=_0xa646fc['getFirstRange']()['start'],_0x42a5f6=new Map();let _0x40c7bd=_0x56d9ee;for(let _0x5c0fba=0x0;_0x5c0fba<_0x5bd535['path']['length'];_0x5c0fba++)if(_0x42a5f6['set'](_0x40c7bd,_0x5bd535['path'][_0x5c0fba]),_0x5c0fba<_0x5bd535['path']['length']-0x1)_0x40c7bd=_0x40c7bd['getChild'](0x0);else{let _0x38024c=_0x40c7bd['nextSibling'];for(;_0x38024c;)_0x42a5f6['set'](_0x38024c,_0x5bd535['path'][_0x5c0fba]),_0x38024c=_0x38024c['nextSibling'];}return{'modelFragment':_0x56d9ee,'anchorData':_0x42a5f6};}async['_executeAction'](_0x140858,_0xe2277e,_0x59818b,_0x5862ce,_0x42065b){const _0x525c4e=this['editor']['plugins']['get'](tn),_0x1e3120=this['editor']['plugins']['get'](ka),_0x2ff638=this['editor']['model']['document']['selection'],_0x4c1171=await _0x525c4e['modelToDataWithIds'](_0xe2277e),_0x289f63=this['editor']['model']['document']['version'],_0xcab147=[..._0x2ff638['getRanges']()];return this['_actionsBalloonView']||(this['_actionsBalloonView']=this['_createActionsBalloonView']()),this['_clearInteractionHistory'](),this['_clearErrorState'](),this['_balloonShowDiff']=!0x1,this['_actionsBalloonView']['resetShowChangesButton'](),this['_actionsBalloonView']['clearContent'](),_0x1e3120['open']({'index':0x3e8*Math['random']()%0x3e8,'title':_0x5862ce,'icon':_0x42065b||_0x195043,'mainView':this['_actionsBalloonView'],'class':'ck-ai-actions-balloon','ranges':_0xcab147,'id':'aiActionsBalloon'}),this['_setLoadingState'](),this['stopListening'](this['_actionsBalloonView']),this['stopListening'](_0x1e3120),this['_interactionParams']={'action':_0x140858,'content':_0x4c1171,'version':_0x289f63,'aiBalloon':_0x1e3120,'modelFragment':_0xe2277e,'anchorData':_0x59818b},this['_setupApplyListeners'](),this['listenTo'](_0x1e3120,'selectionRemoved',()=>{this['_stopInteraction'](),this['_actionsBalloonView']['disableMiniToolbarButtons']();}),this['listenTo'](_0x1e3120,'dialogClosed',(_0x4cc457,{id:_0x5126e9})=>{if('aiActionsBalloon'===_0x5126e9){if(this['_interaction']&&this['_interaction']['replies']['length']>0x0){const _0x1da1fc=this['_interaction']['replies'][this['_interaction']['replies']['length']-0x1],_0x24149e=_0x1da1fc['changeGroups'][0x0];_0x24149e&&'pending'===_0x24149e['state']&&_0x1da1fc['setChangeGroupState'](0x0,'rejected');}this['_stopInteraction'](),this['_clearInteractionHistory'](),this['stopListening'](this['_actionsBalloonView']),this['stopListening'](_0x1e3120);}}),this['_createInteraction'](_0x4c1171,_0x289f63,_0x1e3120,_0x140858);}['_setupApplyListeners'](){if(!this['_interactionParams'])return;const {modelFragment:_0x3dc9aa,anchorData:_0x19f173}=this['_interactionParams'];this['listenTo'](this['_actionsBalloonView'],'applySuggestion',()=>{this['_applyChanges'](_0x3dc9aa,_0x19f173,!0x1);}),this['listenTo'](this['_actionsBalloonView'],'insertSuggestion',()=>{this['_applyChanges'](_0x3dc9aa,_0x19f173,!0x0);});}['_wrapWithCommonAncestors'](_0x1c612c,_0x5d3101,_0x409b8e){const _0x46fbf7=this['editor']['model']['createRange'](_0x5d3101,_0x409b8e)['getCommonAncestor'](),_0x177195=_0x46fbf7['is']('documentFragment')?[]:_0x46fbf7['getAncestors']({'includeSelf':!0x0})['slice'](0x1);if(_0x177195['length']){const _0x9a1a83=_0x177195['map'](_0x5b0c14=>_0x5b0c14['_clone'](!0x1));for(let _0x3c1795=0x1;_0x3c1795<_0x9a1a83['length'];_0x3c1795++)_0x9a1a83[_0x3c1795-0x1]['_appendChild'](_0x9a1a83[_0x3c1795]);return _0x9a1a83[_0x9a1a83['length']-0x1]['_appendChild'](_0x1c612c),new _0x35cdec(_0x9a1a83[0x0]);}return _0x1c612c;}['_copyMarkersToFragment'](_0x660ab1,_0x4b40ac,_0x5cb976={'isTableSelection':!0x1}){const _0x5370c1=this['editor']['model'],_0x5f51fb=Array['from'](_0x4b40ac['getRanges']()),_0x17dd78=_0x4b40ac['getFirstRange']()['start'];for(const _0xdc0905 of _0x5370c1['markers']){if(_0xdc0905['name']['startsWith'](Zs)||!_0xdc0905['affectsData'])continue;const _0x233941=_0xdc0905['getRange']();if(!_0x5f51fb['some'](_0x2516e5=>_0x2516e5['containsRange'](_0x233941,!0x0)))continue;const _0x21a70d=this['_regularCalculateMarkerPath'](_0x233941['start'],_0x17dd78,_0x5cb976['isTableSelection']),_0x3ae106=this['_regularCalculateMarkerPath'](_0x233941['end'],_0x17dd78,_0x5cb976['isTableSelection']),_0x5e9bfb=_0x5370c1['createPositionFromPath'](_0x660ab1,_0x21a70d),_0x1312d3=_0x5370c1['createPositionFromPath'](_0x660ab1,_0x3ae106);if(!_0x5e9bfb['isEqual'](_0x1312d3)){const _0x163efb=_0x5370c1['createRange'](_0x5e9bfb,_0x1312d3);_0x660ab1['markers']['set'](_0xdc0905['name'],_0x163efb);}}}['_regularCalculateMarkerPath'](_0x3d09d9,_0x448b46,_0x3b8a79=!0x1){const _0x434132=[..._0x3d09d9['path']['slice']()];for(let _0xd5c49=0x0;_0xd5c49<Math['max'](_0x448b46['path']['length'],_0x3d09d9['path']['length']);_0xd5c49++){const _0xcf1936=_0x448b46['path'][_0xd5c49]||0x0,_0xdf6e36=(_0x3d09d9['path'][_0xd5c49]||0x0)-_0xcf1936;if(_0x434132[_0xd5c49]=_0xdf6e36,0x0!==_0xdf6e36&&!_0x3b8a79)break;}return _0x434132;}async['_createInteraction'](_0x164d48,_0x36f2f6,_0x2aefac,_0x583fb0){const _0x4e499e=this['editor'];this['_interactionParams']||(this['_interactionParams']={'action':_0x583fb0,'content':_0x164d48,'version':_0x36f2f6,'aiBalloon':_0x2aefac,'modelFragment':this['editor']['model']['getSelectedContent'](this['editor']['model']['document']['selection']),'anchorData':new Map()});const _0x484284=new Xa({'connector':this['_aiConnector'],'editor':_0x4e499e,'content':_0x164d48,'version':_0x36f2f6,..._0x583fb0});this['_interactions']['push'](_0x484284);const _0x445321=(_0x5d8f96,_0x171231=!0x1,_0x2a09c3='streaming')=>this['_promiseQueue']['enqueue'](async _0x17127a=>{try{const _0x36d808=Ns({'editor':_0x4e499e,'changeGroups':_0x5d8f96['changeGroups'],'documentContextContent':_0x5d8f96['documentContextContent'],'showDiff':_0x171231,'trimUnchanged':!0x1});_0x36d808['length']&&await this['_actionsBalloonView']['updateContent']({'part':_0x36d808[0x0],'renderingStrategy':_0x2a09c3,'abortSignal':_0x17127a});}catch(_0x2e0199){if(this['_isAbortError'](_0x2e0199))return;throw _0x2e0199;}});this['_interaction']['on']('replyCreated',(_0x5d0039,_0x5c086d)=>{this['_actionsBalloonView']['hideLoader'](),this['_actionsBalloonView']['startAutoScroll'](),_0x445321(_0x5c086d)['catch'](_0x437306=>{this['_isAbortError'](_0x437306)||(console['error']('Error\x20updating\x20content\x20in\x20replyCreated:',_0x437306),this['_setErrorState'](_0x484284));});}),this['_interaction']['on']('replyContentUpdated',(_0x38c3bc,_0x2b510d)=>{_0x445321(_0x2b510d)['catch'](_0x1964e1=>{this['_isAbortError'](_0x1964e1)||(console['error']('Error\x20updating\x20content\x20in\x20replyContentUpdated:',_0x1964e1),this['_setErrorState'](_0x484284));});}),this['_interaction']['on']('interactionFinished',async()=>{try{await this['_clearLoadingState'](),this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']),await this['_promiseQueue']['queueEmptyPromise'];}catch(_0x4fe800){this['_isAbortError'](_0x4fe800)||(console['error']('Error\x20clearing\x20loading\x20state\x20in\x20interactionFinished:',_0x4fe800),this['_setErrorState'](_0x484284));}finally{this['_actionsBalloonView']['stopAutoScroll']();}}),this['listenTo'](this['_actionsBalloonView'],'toggleSuggestionDisplayMode',async(_0x334288,{showDiff:_0x517ac4})=>{try{this['_balloonShowDiff']=_0x517ac4;const _0x13b380=this['_interaction']['replies'][this['_interaction']['replies']['length']-0x1];_0x13b380&&await _0x445321(_0x13b380,_0x517ac4,'static');}catch(_0x3e39b7){this['_isAbortError'](_0x3e39b7)||(console['error']('Error\x20updating\x20content\x20in\x20toggleSuggestionDisplayMode:',_0x3e39b7),this['_setErrorState'](_0x484284));}}),this['_interaction']['on']('replyChangeGroupStateUpdated',(_0x305477,{reply:_0x4d9515})=>{const _0x119f67={'positiveCount':_0x4d9515['changeGroups']['filter'](_0x24c238=>'accepted'===_0x24c238['state'])['length'],'totalCount':_0x4d9515['changeGroups']['length']},_0x4ac6bf=this['_interaction']['actionCallId'],_0x17961a=this['_interaction']['actionName'];_0x17961a?this['_aiConnector']['upsertAIActionRating'](_0x17961a,_0x4ac6bf,_0x119f67):this['_aiConnector']['upsertCustomAIActionRating'](_0x4ac6bf,_0x119f67);}),this['_setLoadingState']();try{const _0x25ae56=await this['_interaction']['start']();return this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']),_0x25ae56;}catch(_0x34cfc5){if(this['_isAbortError'](_0x34cfc5))return;this['_actionsBalloonView']['hideLoader'](),this['_setErrorState'](_0x484284);}}['_applyChanges'](_0x44ae74,_0x3d739e,_0x24ab1e){const _0x4fe796=this['editor'];if(_0x24ab1e&&!_0x4fe796['plugins']['has']('TrackChanges'))throw new ht('ai-no-track-changes',null);const _0xdefc11=this['editor']['plugins']['get'](_0x32e5d7),_0x4adb75=this['_interactions'][this['_interactions']['length']-0x1-this['_currentInteractionIndex']];if(!_0x4adb75||!_0x4adb75['replies']['length'])return;const _0x33996c=_0x4adb75['replies'][_0x4adb75['replies']['length']-0x1],_0x1ae37b=_0x33996c['changeGroups'];_0x33996c['setChangeGroupState'](0x0,'accepted');let _0x56525e=zs({'editor':_0x4fe796,'reply':_0x33996c,'interaction':_0x4adb75,'groups':_0x1ae37b,'transform':!0x1,'documentCompare':_0xdefc11,'documentCompareOptions':{'anchor':_0x4fe796['model']['createPositionAt'](_0x44ae74,0x0),'markDeletions':_0x24ab1e}});_0x56525e=this['_filterOperationsOutsideRange'](_0x56525e,_0x3d739e);for(const _0x40b9a4 of _0x56525e)this['_anchorOperation'](_0x3d739e,_0x40b9a4,_0x4fe796['model']['document']['getRoot']());const _0x508d17=_0x4adb75['getDocumentContext']()['version'],_0x540322=_0x4fe796['model']['document']['history']['getOperations'](_0x508d17),_0x44061c={'document':_0x4fe796['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1},_0x14dac0=_0x20fadc(_0x56525e,_0x540322,_0x44061c)['operationsA'];_0x4fe796['model']['change'](_0x1d2232=>{if(_0x1d2232['setSelection'](_0x4fe796['model']['document']['selection']['focus']),_0x24ab1e)_0x4fe796['plugins']['get']('TrackChangesEditing')['_applyOperationsAsSuggestions'](_0x14dac0);else{for(const _0xbaf6f6 of _0x14dac0)_0xbaf6f6['baseVersion']=_0x4fe796['model']['document']['version'],js(_0x4fe796,_0xbaf6f6),_0x1d2232['batch']['addOperation'](_0xbaf6f6),_0x4fe796['model']['applyOperation'](_0xbaf6f6);}}),this['editor']['plugins']['get']('AIBalloon')['close']();}['_filterOperationsOutsideRange'](_0x3a98d9,_0x3b3f51){return _0x3a98d9['filter'](_0x54749a=>{if('rename'==_0x54749a['type']){const _0x42a02d=_0x54749a['position']['nodeAfter'];return!_0x3b3f51['has'](_0x42a02d);}if(_0x54749a['type']['indexOf']('Attribute')>-0x1){const _0x4900d5=_0x54749a['range']['start']['nodeAfter'];return!_0x3b3f51['has'](_0x4900d5);}return!0x0;});}['_anchorOperation'](_0x4207e4,_0x20c1d2,_0x1770c2){const _0x156ee0=_0x20c1d2['clone']();for(const _0x49d4e9 in _0x20c1d2){const _0x5a9f2b=_0x20c1d2[_0x49d4e9];_0x5a9f2b instanceof _0x3b0db7?_0x20c1d2[_0x49d4e9]=new _0x3b0db7(_0x3e2229(_0x5a9f2b['start']),_0x3e2229(_0x5a9f2b['end'])):_0x5a9f2b instanceof _0x54fe5a&&(_0x20c1d2[_0x49d4e9]=_0x3e2229(_0x5a9f2b));}if(['insert','move','remove','reinsert','split','merge']['includes'](_0x156ee0['type'])){if(_0x156ee0['isDocumentOperation']=!0x1,_0x156ee0['baseVersion']=null,'remove'==_0x156ee0['type']){const _0x1a69e5=_0x156ee0['sourcePosition'],_0x429f04=_0x156ee0['howMany'];new _0x285dd6(_0x1a69e5,_0x429f04)['_execute']();}else _0x156ee0['_execute']();}function _0x3e2229(_0x5bf1ec){if('$graveyard'==_0x5bf1ec['root']['rootName'])return _0x5bf1ec;const _0x520aa6=[];let _0x1d2b63=_0x5bf1ec['root'];for(let _0x40775a=0x0;_0x40775a<_0x5bf1ec['path']['length'];_0x40775a++){const _0x4928c0=_0x4207e4['get'](_0x1d2b63)||0x0;_0x520aa6[_0x40775a]=_0x5bf1ec['path'][_0x40775a]+_0x4928c0,_0x1d2b63=_0x1d2b63['getChildAtOffset'](_0x5bf1ec['path'][_0x40775a]);}return new _0x54fe5a(_0x1770c2,_0x520aa6,_0x5bf1ec['stickiness']);}}['_refreshInteraction'](){if(!this['_interactionParams'])return;this['_interactions']['length']>0x0&&this['_stopInteraction'](),this['_currentInteractionIndex']=0x0,this['_balloonShowDiff']=!0x1;const {action:_0x25ad09,content:_0x4588b8,version:_0x5dbbf4,aiBalloon:_0x19ccec}=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'](_0x4588b8,_0x5dbbf4,_0x19ccec,_0x25ad09)['catch'](_0x3101dd=>{this['_isAbortError'](_0x3101dd)||console['error']('Error\x20refreshing\x20interaction:',_0x3101dd);});}['_isAbortError'](_0x3b9931){return!!_0x3b9931['message']&&_0x3b9931['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 _0x408e3c=this['_interactions']['length'];this['_currentInteractionIndex']<_0x408e3c-0x1&&this['_displayInteractionAtIndex'](this['_currentInteractionIndex']+0x1);}['_navigateToNext'](){this['_currentInteractionIndex']>0x0&&this['_displayInteractionAtIndex'](this['_currentInteractionIndex']-0x1);}async['_displayInteractionAtIndex'](_0x4bd4d4){if(!this['_interactionParams'])return;this['_currentInteractionIndex']=_0x4bd4d4;const _0x580fe8=this['_interactions'][this['_interactions']['length']-0x1-this['_currentInteractionIndex']];if(!_0x580fe8)return;if(_0x580fe8['hasError'])return this['_setErrorState'](_0x580fe8),void this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']);if(!_0x580fe8['replies']['length'])return;this['_actionsBalloonView']['hideError'](),this['_interactionParams']&&this['_clearErrorState']();const _0x224149=_0x580fe8['replies'][_0x580fe8['replies']['length']-0x1];if(_0x224149){const _0x244d1b=this['editor'];try{const _0x53ec10=Ns({'editor':_0x244d1b,'changeGroups':_0x224149['changeGroups'],'documentContextContent':_0x224149['documentContextContent'],'showDiff':this['_balloonShowDiff'],'trimUnchanged':!0x1});await new Promise(_0x2dbdad=>setTimeout(_0x2dbdad,0x32)),await this['_actionsBalloonView']['updateContent']({'part':_0x53ec10[0x0],'renderingStrategy':'static','abortSignal':new AbortController()['signal']});}catch(_0x11d65c){this['_isAbortError'](_0x11d65c)||console['error']('Error\x20updating\x20content\x20during\x20navigation:',_0x11d65c);}}this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']);}['_setLoadingState'](){this['_actionsBalloonView']['setIsLoading'](!0x0),this['isBusy']=!0x0;}async['_setErrorState'](_0x560d22){const _0xac7ed5=us(this['editor']['locale'],'AI_ACTIONS_GENERIC_ERROR');this['_actionsBalloonView']['showError'](_0xac7ed5),_0x560d22['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);}}var io=function(_0x54182b){return _0x54182b['CONTINUE']='continue',_0x54182b['FIX_GRAMMAR']='fix-grammar',_0x54182b['IMPROVE_WRITING']='improve-writing',_0x54182b['MAKE_LONGER']='make-longer',_0x54182b['MAKE_SHORTER']='make-shorter',_0x54182b['MAKE_TONE_CASUAL']='make-tone-casual',_0x54182b['MAKE_TONE_FORMAL']='make-tone-formal',_0x54182b['TRANSLATE']='translate',_0x54182b;}({});class so extends _0x58645c{static get['requires'](){return[Ya,qa,eo];}static get['pluginName'](){return'AIQuickActions';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x14859c){super(_0x14859c),_0x14859c['config']['define']('ai.quickActions',{'extraCommands':[],'removeCommands':[],'isSearchEnabled':!0x0});}}var no=function(_0x4a0f4a){return _0x4a0f4a['CHAT']='chat',_0x4a0f4a['ACTION']='action',_0x4a0f4a;}({});class ro extends vt{['resultResponseView'];['acceptButtonView'];['dismissButtonView'];['infoButtonView'];['outdatedButtonView'];constructor(_0x2f8994,_0x3c45df){super(_0x2f8994),this['id']=_0x3c45df,this['set']('status','pending'),this['set']('changeId',_0x3c45df),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',(_0x23c20a,_0x45756a)=>{_0x45756a&&_0x45756a['target']&&'A'===_0x45756a['target']['tagName']&&_0x45756a['preventDefault'](),this['fire']('activateChange',{'id':_0x3c45df,'source':this,'uiInteraction':'click'});}),this['on']('mouseover',()=>{this['fire']('activateChange',{'id':_0x3c45df,'source':this,'uiInteraction':'hover'});}),this['on']('mouseout',()=>{this['fire']('deactivateChange',{'origin':'panel','id':_0x3c45df,'source':this});});}['setItemAsActive'](){this['isActive']=!0x0;}['setItemAsInactive'](){this['isActive']=!0x1;}['_createResultResponseView'](){const _0x1d0536=new vt(this['locale']);return _0x1d0536['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',_0x2eadc1=>!_0x2eadc1)]}}),_0x1d0536;}['_createAcceptButtonView'](){const _0x2d63fb=new Nt(this['locale']);return _0x2d63fb['set']({'label':us(this['locale'],'AI_REVIEW_MODE_ACCEPT_CHANGE'),'withText':!0x0}),_0x2d63fb['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x30e10b=>{this['fire']('acceptChange',{'id':this['changeId']}),_0x30e10b['stopPropagation']();})},'attributes':{'class':[_s,'ck-ai_review__check-run-result-accept-button',this['bindTemplate']['if']('status','ck-hidden',_0x1c62ec=>'pending'!==_0x1c62ec&&'accepted'!==_0x1c62ec),this['bindTemplate']['if']('status','ck-ai_review__check-run-result-accept-button',_0x392598=>'pending'===_0x392598),this['bindTemplate']['if']('status','ck-ai_review__check-run-result-status-button',_0x99422e=>'accepted'===_0x99422e)]}}),this['on']('change:status',(_0x24f7f5,_0x5816b6,_0x2caac3)=>{_0x2d63fb['isEnabled']='pending'===_0x2caac3,'accepted'===_0x2caac3&&(_0x2d63fb['label']=us(this['locale'],'AI_REVIEW_MODE_CHECK_STATUS_ACCEPTED'),_0x2d63fb['icon']=_0xe4c6eb);}),_0x2d63fb;}['_createDismissButtonView'](){const _0x37684b=new Nt(this['locale']);return _0x37684b['set']({'label':us(this['locale'],'AI_REVIEW_MODE_DISMISS_CHANGE'),'withText':!0x0}),_0x37684b['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x43cd01=>{this['fire']('dismissChange',{'id':this['changeId']}),_0x43cd01['stopPropagation']();})},'attributes':{'class':[As,this['bindTemplate']['if']('status','ck-hidden',_0x3f3c7f=>'pending'!==_0x3f3c7f&&'rejected'!==_0x3f3c7f),this['bindTemplate']['if']('status','ck-ai_review__check-run-result-dismiss-button',_0x5b265f=>'pending'===_0x5b265f),this['bindTemplate']['if']('status','ck-ai_review__check-run-result-status-button',_0x17c47b=>'rejected'===_0x17c47b)]}}),this['on']('change:status',(_0x1b6850,_0x334d6d,_0x308149)=>{_0x37684b['isEnabled']='pending'===_0x308149,'rejected'===_0x308149&&(_0x37684b['label']=us(this['locale'],'AI_REVIEW_MODE_CHECK_STATUS_REJECTED'),_0x37684b['icon']=_0x45659b);}),_0x37684b;}['_createInfoButtonView'](){const _0x1eab92=new Nt(this['locale']);return _0x1eab92['set']({'label':us(this['locale'],'AI_REVIEW_MODE_LEARN_MORE'),'icon':_0x293cf9,'tooltip':!0x0,'isToggleable':!0x0,'role':'menuitemcheckbox','class':As+'\x20ck-ai_review__check-run-result-info-button\x20ck-hidden'}),_0x1eab92['bind']('isOn')['to'](this,'isInfoToggleOn',_0x4be1ea=>_0x4be1ea),_0x1eab92['on']('execute',()=>{this['isInfoToggleOn']=!this['isInfoToggleOn'];}),_0x1eab92;}['_createOutdatedButtonView'](){const _0xbd10d5=new Nt(this['locale']);return _0xbd10d5['set']({'label':us(this['locale'],'AI_REVIEW_MODE_CHECK_STATUS_OUTDATED'),'icon':st,'withText':!0x0,'isEnabled':!0x1}),_0xbd10d5['extendTemplate']({'attributes':{'class':[As,'ck-ai_review__check-run-result-status-button',this['bindTemplate']['if']('status','ck-hidden',_0x56e6ec=>'outdated'!==_0x56e6ec)],'disabled':'disabled'}}),_0xbd10d5;}}class ao extends Xt{['resultItemView'];['_pinnedRectIndex']=void 0x0;['_pinnedTargetElement']=void 0x0;['_pinnedTargetChangeId']=void 0x0;constructor(_0xfa8b3c,_0x3358ae){super(_0xfa8b3c),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']()),_0x3358ae['add'](this);}['render'](){super['render'](),this['_setupClickOutsideHandler']();}['updateContent'](_0x58a35e){this['resultItemView']['changeId']=_0x58a35e['id'],this['resultItemView']['resultResponseView']['element']['innerHTML']=_0x58a35e['contentDiffed'];}['showBalloon'](_0x532401,_0x57d200,_0x28c096,_0x25b664,_0x2c35a0,_0x4f1bc4){const _0x33f521=_0x57d200();if(!_0x33f521)return;this['updateContent'](_0x532401),this['show']();const _0x5c6898=Array['from'](_0x33f521['getClientRects']())['reverse'](),_0x31fe98=this['_getPointedRectIndexFromEvent'](_0x28c096,_0x5c6898),_0x48db78=_0x5c6898[_0x31fe98??0x0];'click'===_0x25b664?(this['isDiffActive']=!0x0,this['pin']({'target':()=>this['_getBestRectPositionOnClick'](_0x57d200(),_0x31fe98,_0x532401['id'],_0x2c35a0,_0x4f1bc4)||_0x48db78})):'hover'===_0x25b664&&(this['isDiffActive']=!0x1,this['pin']({'target':()=>this['_getBestRectPositionOnHover'](_0x57d200(),_0x31fe98,_0x532401['id'])||_0x48db78}));}['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'](){zt({'emitter':this,'activator':()=>this['isVisible'],'contextElements':()=>{const _0x427ec2=[this['element']];return this['_pinnedTargetElement']&&_0x427ec2['push'](this['_pinnedTargetElement']),_0x427ec2;},'callback':()=>{this['hide'](),this['unpin'](),this['deactivateChange'](),this['_pinnedTargetElement']=void 0x0,this['_pinnedRectIndex']=void 0x0,this['_pinnedTargetChangeId']=void 0x0;}});}['_createContentView'](){const _0x54b3af=new vt();return this['resultItemView']=new ro(this['locale'],''),this['resultItemView']['resultResponseView']['extendTemplate']({'attributes':{'class':['ck-content']}}),this['resultItemView']['delegate']('acceptChange','dismissChange')['to'](this),_0x54b3af['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']]}]}),_0x54b3af;}['_getBestRectPositionOnClick'](_0x428909,_0x4ebc38,_0x2a58da,_0x41a381,_0x42866f){if(!_0x428909)return null;const _0x6c38b0=this['position']['replace']('arrow_',''),_0x4f72db=Array['from'](_0x428909['getClientRects']());let _0x4eb23a,_0x2aac4e=_0x4f72db['reverse']();return void 0x0!==_0x4ebc38&&this['_isPinnedRectVisible'](_0x2aac4e[_0x4ebc38],_0x41a381,_0x42866f)?(_0x4eb23a=_0x2aac4e[_0x4ebc38],this['_pinnedRectIndex']=_0x4ebc38):this['_isPinnedRectVisible'](_0x2aac4e[0x0],_0x41a381,_0x42866f)&&void 0x0===_0x4ebc38?_0x4eb23a=_0x2aac4e[0x0]:(_0x2aac4e='s'==_0x6c38b0[0x0]?[..._0x4f72db]['reverse']():_0x4f72db,_0x2aac4e['forEach'](_0x4d84c8=>{this['_isPinnedRectVisible'](_0x4d84c8,_0x41a381,_0x42866f)&&(_0x4eb23a=_0x4d84c8);})),this['_pinnedTargetChangeId']=_0x2a58da,this['_pinnedTargetElement']=_0x428909,_0x4eb23a||_0x428909['getBoundingClientRect']();}['_getBestRectPositionOnHover'](_0xeefa7a,_0x1309e7,_0x24a7a3){if(!_0xeefa7a)return null;const _0x41cf5e=Array['from'](_0xeefa7a['getClientRects']())['reverse']();if(void 0x0===this['_pinnedRectIndex']&&void 0x0!==_0x1309e7&&this['_pinnedTargetChangeId']!==_0x24a7a3)return this['_pinnedRectIndex']=_0x1309e7,this['_pinnedTargetElement']=_0xeefa7a,this['_pinnedTargetChangeId']=_0x24a7a3,_0x41cf5e[_0x1309e7];if(void 0x0!==this['_pinnedRectIndex']&&this['_pinnedTargetChangeId']===_0x24a7a3){if(_0xeefa7a!==this['_pinnedTargetElement'])return Array['from'](this['_pinnedTargetElement']['getClientRects']())['reverse']()[this['_pinnedRectIndex']];return _0x41cf5e[this['_pinnedRectIndex']];}return void 0x0!==_0x1309e7&&this['_pinnedTargetChangeId']!==_0x24a7a3?(this['_pinnedRectIndex']=_0x1309e7,this['_pinnedTargetElement']=_0xeefa7a,this['_pinnedTargetChangeId']=_0x24a7a3,_0x41cf5e[_0x1309e7]):_0xeefa7a['getBoundingClientRect']();}['_getPointedRectIndexFromEvent'](_0x3d5508,_0x1bbc7b){if(_0x3d5508)for(let _0x243e45=0x0;_0x243e45<_0x1bbc7b['length'];_0x243e45++){const _0x184ced=_0x1bbc7b[_0x243e45];if(_0x3d5508['clientX']>=_0x184ced['left']-0x3&&_0x3d5508['clientX']<=_0x184ced['right']+0x3&&_0x3d5508['clientY']>=_0x184ced['top']-0x3&&_0x3d5508['clientY']<=_0x184ced['bottom']+0x3)return _0x243e45;}}['_isPinnedRectVisible'](_0x1cb9e2,_0x334e2c,_0x247c5d){const _0x1e4acc=new dt(_0x1cb9e2),_0x4216dd=_0x334e2c||document['documentElement'],_0x46b987=_0x1e4acc['getIntersection'](Rt(_0x247c5d)),_0x8bbc8b=new dt(_0x4216dd)['getIntersection'](_0x1e4acc);return!!(_0x46b987&&_0x8bbc8b&&_0x1e4acc['width']>0x0);}}const oo=['getReviewCheckList','runReviewCheck','abortReviewStream','toggleDiff','acceptAllChanges','leaveReviewCoreResultList','activateChange','deactivateChange','acceptChange','dismissChange','learnMore','finishReview','retryReview'];class ho extends _0x25e92e{['_mainView'];['_balloonSuggestionView'];['_bodyCollection'];static get['requires'](){return[cs];}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x2344d3){super(_0x2344d3),this['_bodyCollection']=new Qt(this['context']['locale']),this['_bodyCollection']['attachToDom'](),this['_mainView']=this['createMainView'](),this['_mainView']['delegate'](...oo)['to'](this),this['_balloonSuggestionView']=new ao(this['context']['locale'],this['_bodyCollection']),this['_balloonSuggestionView']['delegate']('acceptChange','dismissChange','deactivateChange')['to'](this);}['init'](){const _0x5c1a0a=this['context']['plugins']['get']('AITabs');this['registerTab'](_0x5c1a0a);}['destroy'](){this['_bodyCollection']['detachFromDom'](),super['destroy']();}['setAvailableChecks'](_0x397a19){if(!this['_mainView']['reviewCheckListView']['hasChecks']()){const _0xb13fc=!this['context']['config']['get']('ai.models.showModelSelector');this['_mainView']['reviewCheckListView']['setChecks'](_0x397a19,_0xb13fc);}this['_mainView']['showReviewCheckListView']();}['showReviewCheckList'](){this['fire']('getReviewCheckList');}['showCheckRunResults'](_0x5e9ed0){_0x5e9ed0&&('error-general'!==_0x5e9ed0['status']?'error-chunk'!==_0x5e9ed0['status']?this['_mainView']['showReviewCheckResultsView']():this['showChunkErrorView']():this['showGeneralResultsErrorView']());}['showCheckRunResult'](_0x1b0c4c){this['_mainView']['addCheckRunResult'](_0x1b0c4c);}['showGeneralResultsErrorView'](){this['_mainView']['showGeneralResultsErrorView']();}['showGeneralReviewCoreErrorView'](_0x35d00b){this['_mainView']['showGeneralReviewCoreErrorView'](_0x35d00b??us(this['context']['locale'],'AI_REVIEW_INITIALIZATION_ERROR_MESSAGE'));}['showChunkErrorView'](){this['_mainView']['showChunkErrorView']();}['setCheckResultTitle'](_0x403926,_0x3285f1){this['_mainView']['reviewCheckResultsView']['setTitle'](_0x403926,_0x3285f1);}['setActiveStateInResults'](_0x337370){this['_mainView']['reviewCheckResultsView']['getResults']()['forEach'](_0xac6b20=>{_0xac6b20['id']===_0x337370&&_0xac6b20['setItemAsActive']();});}['resetActiveStateInResults'](){this['_mainView']['reviewCheckResultsView']['getResults']()['forEach'](_0x5ab630=>_0x5ab630['setItemAsInactive']());}['updateChangeState'](_0x26d1d9,_0xec2e06){'accepted'===_0xec2e06||'rejected'===_0xec2e06||'outdated'===_0xec2e06?this['_mainView']['reviewCheckResultsView']['hideResult'](_0x26d1d9,_0xec2e06):this['_mainView']['reviewCheckResultsView']['showResult'](_0x26d1d9,_0xec2e06);}['showReviewCompletedView'](){this['_mainView']['showReviewCompletedView']();}['showActionsWhenResultIsReady'](){this['_mainView']['showActionsWhenResultIsReady']();}['showNoChangesView'](){this['_mainView']['showNoChangesView']();}['hideActionsWhenResultIsReady'](){this['_mainView']['hideActionsWhenResultIsReady']();}['showChangeBalloon'](_0x176afb,_0x4b1e43,_0x533087,_0x446350,_0x38eaef,_0x1e954f){this['_balloonSuggestionView']['showBalloon'](_0x176afb,_0x4b1e43,_0x533087,_0x446350,_0x38eaef,_0x1e954f);}['hideChangeBalloon'](){this['_balloonSuggestionView']['hideBalloon']();}['hideDiffInBalloon'](){this['_balloonSuggestionView']['hideDiffInBalloon']();}['showDiffInBalloon'](){this['_balloonSuggestionView']['showDiffInBalloon']();}['getChangeElement'](_0x5836f3){const _0x9412aa=this['_mainView']['reviewCheckResultsView']['getResults']()['find'](_0x5bb024=>_0x5bb024['id']===_0x5836f3);return _0x9412aa?_0x9412aa['element']:null;}['deactivateChange'](){this['_balloonSuggestionView']['deactivateChange']();}}class co extends vt{constructor(_0x257b9b){super(_0x257b9b),this['set']('isVisible',!0x1),this['set']('errorMessage','');const _0x404f00=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai_review__general-error-container',_0x404f00['if']('isVisible','ck-hidden',_0x5d9b56=>!_0x5d9b56)]},'children':[{'tag':'p','attributes':{'class':'ck\x20ck-ai-notification\x20ck-ai-notification_error'},'children':[{'text':_0x404f00['to']('errorMessage')}]}]});}}class lo extends vt{['reviewCoreHeader'];['generalErrorView'];['reviewCheckListView'];['reviewCheckResultsView'];['reviewCompletedView'];constructor(_0x295a12,_0x92ad4a){super(_0x295a12),this['reviewCoreHeader']=_0x92ad4a['header'],this['generalErrorView']=new co(_0x295a12),this['reviewCheckListView']=_0x92ad4a['list'],this['reviewCheckListView']['delegate'](...oo)['to'](this),this['reviewCheckResultsView']=_0x92ad4a['results'],this['reviewCheckResultsView']['delegate'](...oo)['to'](this),this['reviewCompletedView']=_0x92ad4a['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'](_0x3e2290){this['reviewCheckResultsView']['addResult'](_0x3e2290),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'](_0x3e5cb2){this['generalErrorView']['set']('isVisible',!0x0),this['generalErrorView']['errorMessage']=_0x3e5cb2;}['showGeneralResultsErrorView'](){this['reviewCheckResultsView']['set']('isLoading',!0x1),this['showActionsWhenResultIsReady'](),this['reviewCheckResultsView']['showGeneralErrorMessage']();}['showChunkErrorView'](){this['reviewCheckResultsView']['set']('isLoading',!0x1),this['showActionsWhenResultIsReady'](),this['reviewCheckResultsView']['showChunkErrorMessage']();}}class uo extends Nt{constructor(_0x8225e1,_0x3139b4){super(_0x3139b4),this['set']({'label':_0x8225e1,'withText':!0x0,'class':ds}),this['on']('execute',()=>{this['fire']('finishReview');});}}class _o extends Ht{['_resultViews'];['_resultsHeader'];['reviewDisclaimer'];['_cancelButtonView'];['_acceptAllButtonView'];['_exitReviewButtonView'];['_toggleDiffButtonView'];['_errorMessageView'];['_finishReviewButtonView'];['_contents'];constructor(_0x1b9d4a,_0x3436a7){super(_0x1b9d4a),this['_contents']=_0x3436a7,this['_resultViews']=new _0x4539b4(),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 na(_0x1b9d4a),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 _0x59f0f5=this['_createCombinedSkeletonLoader'](),_0x316c1d=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run',_0x316c1d['if']('isLoading','ck-ai_review__check-run_loading',_0x35ef3d=>_0x35ef3d),_0x316c1d['if']('isResultReady','ck-ai_review__check-run_ready',_0x16f2e8=>_0x16f2e8),_0x316c1d['if']('isVisible','ck-hidden',_0x4e0bcd=>!_0x4e0bcd)]},'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',_0x5a0514=>_0x5a0514)]},'children':this['_resultViews']},_0x59f0f5]},this['reviewDisclaimer']]});}['clearResults'](){this['_resultViews']['clear']();}['getResults'](){return this['_resultViews'];}['addResult'](_0x23e828){const _0x29a332=new ro(this['locale'],_0x23e828['id']);_0x29a332['delegate']('acceptChange','dismissChange','activateChange','deactivateChange')['to'](this),this['_resultViews']['add'](_0x29a332),_0x29a332['resultResponseView']['element']['innerHTML']=_0x23e828['contentDiffed'];}['hideResult'](_0x2ca7a3,_0x3e007a){if('pending'===_0x3e007a)return;const _0x565b45=this['_resultViews']['find'](_0x5e5ddf=>_0x5e5ddf['id']===_0x2ca7a3);_0x565b45&&(_0x565b45['status']=_0x3e007a,_0x565b45['element']?.['classList']['add']('ck-ai_review__check-run-result_grayout'));}['showResult'](_0xd0d720,_0x2720ee){if('pending'!==_0x2720ee)return;const _0x346cef=this['_resultViews']['find'](_0x475224=>_0x475224['id']===_0xd0d720);_0x346cef&&(_0x346cef['status']=_0x2720ee,_0x346cef['element']?.['classList']['remove']('ck-ai_review__check-run-result_grayout'));}['setTitle'](_0x31d055,_0x5d5676){this['headerTitle']=_0x31d055,this['headerSubtitle']=_0x5d5676||'';}['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 sr(this['locale'],nr['aiReviewChecks']);}['_createCombinedSkeletonLoader'](){const _0x995e6f=new vt(this['locale']),_0x5f50bc=[];for(let _0x3b0bf8=0x0;_0x3b0bf8<0x10;_0x3b0bf8++){const _0x38bd7e=this['_createSkeletonLoader']();_0x38bd7e['extendTemplate']({'attributes':{'class':['ck-ai_review__check-run-skeleton-item']}}),_0x5f50bc['push'](_0x38bd7e);}return _0x995e6f['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-skeleton-container',this['bindTemplate']['if']('isLoading','ck-hidden',_0x199976=>!_0x199976)]},'children':_0x5f50bc}),_0x995e6f;}['_createErrorView'](){const _0x3e4398=new vt(this['locale']),_0x488a29=new Nt(this['locale']),t=this['locale']['t'];return _0x3e4398['delegate']('retryReview')['to'](this),_0x488a29['set']({'label':t('Try\x20again'),'withText':!0x0,'class':_s+'\x20ck-ai_review__check-run-error-retry-button'}),_0x488a29['on']('execute',()=>{this['fire']('retryReview');}),_0x3e4398['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-error-container',this['bindTemplate']['if']('showErrorMessage','ck-hidden',_0x50daf1=>!_0x50daf1),this['bindTemplate']['if']('errorType','ck-ai_review__check-run-error-container_border-bottom',_0x303f19=>'chunk'===_0x303f19)]},'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',_0x5c0ab5=>'chunk'===_0x5c0ab5)]},'children':[{'tag':'p','attributes':{'class':['ck-ai-notification__content',this['bindTemplate']['if']('errorType','ck-hidden',_0x5440f3=>'general'!==_0x5440f3)]},'children':[{'text':this['_contents']['generalErrorText']}]},{'tag':'p','attributes':{'class':['ck-ai-notification__content',this['bindTemplate']['if']('errorType','ck-hidden',_0x19d24c=>'chunk'!==_0x19d24c)]},'children':[{'text':us(this['locale'],'AI_REVIEW_MODE_CHUNK_ERROR_MESSAGE')}]}]},_0x488a29]}),_0x3e4398;}['_createCancelButtonView'](){const _0x19f799=new Nt(this['locale']);return _0x19f799['set']({'label':us(this['locale'],'AI_REVIEW_MODE_STOP_GENERATING'),'withText':!0x0,'class':[_s+'\x20ck-ai-button-stop-generating'],'icon':_0x270a28}),_0x19f799['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isResultReady','ck-hidden',_0x3c4ee1=>_0x3c4ee1),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x23bf52=>_0x23bf52)]}}),_0x19f799['on']('execute',()=>{this['fire']('abortReviewStream');}),_0x19f799;}['_createToggleDiffButtonView'](){const _0x20f014=new Nt(this['locale']);_0x20f014['set']({'tooltip':!0x0,'isToggleable':!0x0,'role':'menuitemcheckbox'}),_0x20f014['bind']('isEnabled')['to'](this,'isError',_0x5ace3d=>!_0x5ace3d),_0x20f014['extendTemplate']({'attributes':{'class':[_s,'ck-ai_review__check-run-toggle-diff-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0xd7affd=>!_0xd7affd),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x4d20a0=>_0x4d20a0)]}});const _0x59f750=us(this['locale'],'AI_REVIEW_MODE_HIDE_CHANGES'),_0x10d3a1=us(this['locale'],'AI_REVIEW_MODE_SHOW_CHANGES');return _0x20f014['bind']('isOn')['to'](this,'isToggleDiffOn',_0x30ecf9=>_0x30ecf9),_0x20f014['bind']('icon')['to'](this,'isToggleDiffOn',_0x1ca0ae=>_0x1ca0ae?nt:rt),_0x20f014['bind']('label')['to'](this,'isToggleDiffOn',_0x46faa3=>_0x46faa3?_0x59f750:_0x10d3a1),_0x20f014['on']('execute',()=>{this['isToggleDiffOn']=!this['isToggleDiffOn'],this['fire']('toggleDiff',{'on':this['isToggleDiffOn']});}),_0x20f014;}['_createAcceptAllButtonView'](){const _0x105909=new Nt(this['locale']);return _0x105909['set']({'label':us(this['locale'],'AI_REVIEW_MODE_ACCEPT_ALL'),'withText':!0x0}),_0x105909['bind']('isEnabled')['to'](this,'isError',_0x13642b=>!_0x13642b),_0x105909['extendTemplate']({'attributes':{'class':[ds,'ck-ai_review__check-run-accept-all-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0x18f32c=>!_0x18f32c),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x9ab84d=>_0x9ab84d)]}}),_0x105909['on']('execute',()=>{this['fire']('acceptAllChanges');}),_0x105909;}['_createExitReviewButtonView'](){const _0x2241de=new Nt(this['locale']);return _0x2241de['set']({'label':us(this['locale'],'AI_REVIEW_MODE_EXIT_REVIEW'),'withText':!0x0}),_0x2241de['extendTemplate']({'attributes':{'class':[As,'ck-ai_review__check-run-exit-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0x452982=>!_0x452982),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x5894fb=>_0x5894fb)]}}),_0x2241de['on']('execute',()=>{this['fire']('leaveReviewCoreResultList');}),_0x2241de;}['_createResultHeaderView'](){const _0x2ed5f8=new vt(this['locale']),_0x2d0d60=this['_createTitleView']();return _0x2ed5f8['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-header',this['bindTemplate']['if']('isCompleted','ck-ai_review__review-completed-header',_0x31a6ec=>_0x31a6ec)]},'children':[_0x2d0d60,{'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-header-buttons']},'children':[this['_cancelButtonView'],this['_acceptAllButtonView'],this['_exitReviewButtonView'],this['_toggleDiffButtonView'],this['_finishReviewButtonView']]}]}),_0x2ed5f8;}['_createTitleView'](){const _0x1aac33=new vt(this['locale']),_0xea1d54=new vn();return _0xea1d54['bind']('isVisible')['to'](this,'isResultReady',_0x292711=>!_0x292711),_0x1aac33['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-header-title-wrapper']},'children':[_0xea1d54,{'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-header-title-content',this['bindTemplate']['if']('isCompleted','ck-hidden',_0x40b216=>_0x40b216)]},'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',_0x200a55=>!_0x200a55)]},'children':[{'text':us(this['locale'],'AI_REVIEW_MODE_FINISH_REVIEW_HEADER_TITLE')}]}]}),_0x1aac33;}['_createFinishReviewButtonView'](){const _0x50a9aa=new uo(us(this['locale'],'AI_REVIEW_MODE_FINISH_REVIEW_BUTTON_LABEL'),this['locale']);return _0x50a9aa['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isCompleted','ck-hidden',_0x22ce6f=>!_0x22ce6f)]}}),_0x50a9aa['delegate']('finishReview')['to'](this),_0x50a9aa;}}class Ao extends Ht{['_resultsHeader'];['_finishReviewButtonView'];constructor(_0x569d29,_0xf5132a){super(_0x569d29),this['_finishReviewButtonView']=this['_createFinishReviewButtonView'](_0xf5132a['buttonText']),this['_resultsHeader']=this['_createResultHeaderView'](_0xf5132a['headerText']);const _0x57eb76=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__review-completed',_0x57eb76['if']('isVisible','ck-hidden',_0x2ef7ad=>!_0x2ef7ad)]},'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':_0xf5132a['emptyResultsText']}]}]}]});}['_createFinishReviewButtonView'](_0x5a472d){const _0x26fb51=new uo(_0x5a472d,this['locale']);return _0x26fb51['delegate']('finishReview')['to'](this),_0x26fb51;}['_createResultHeaderView'](_0x2770ef){const _0x42a0d5=new vt(this['locale']);return _0x42a0d5['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':_0x2770ef}]},{'tag':'div','attributes':{'class':['ck-ai_review__review-completed-header-buttons']},'children':[this['_finishReviewButtonView']]}]}),_0x42a0d5;}}class go extends vt{['_dropdownView'];['_defaultValue'];['_defaultLabel'];constructor(_0x1d3aa1,_0x403f59){super(_0x1d3aa1),this['_defaultValue']=_0x403f59['default']||(_0x403f59['data']['length']>0x0?_0x403f59['data'][0x0]['id']:''),this['_defaultLabel']=_0x403f59['data']['find'](_0x31bc93=>_0x31bc93['id']===this['_defaultValue'])?.['label']||'',this['set']('formValue',''),this['_dropdownView']=Gt(this['locale']);const _0x41173c=this['_prepareListOptions'](_0x403f59['data']);jt(this['_dropdownView'],_0x41173c,{'role':'menu','ariaLabel':_0x403f59['label']}),this['_dropdownView']['buttonView']['set']({'label':this['_defaultLabel'],'withText':!0x0}),this['_dropdownView']['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x2c4962=>{_0x2c4962['stopPropagation']();})}}),this['listenTo'](this['_dropdownView'],'execute',_0x904367=>{this['formValue']=_0x904367['source']['model']['id'],this['_dropdownView']['buttonView']['label']=_0x904367['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'](_0x58650a=[]){const _0x346371=new _t();this['resetToDefault']();for(const _0x37eb9b of _0x58650a){const _0x162412=new Jt({'label':_0x37eb9b['label'],'withText':!0x0,'role':'menuitemradio','id':_0x37eb9b['id'],'model':_0x37eb9b});_0x162412['bind']('isOn')['to'](this,'formValue',_0x42b167=>_0x42b167===_0x162412['id']);const _0x22f57b={'type':'button','model':_0x162412};_0x346371['add'](_0x22f57b);}return _0x346371;}}class Io extends Ht{['_formItem']=null;constructor(_0x2ed289,_0x1eb91b,_0x32f1c3){super(_0x2ed289),this['argsKey']=_0x1eb91b?.['argsKey'];if('dropdown'===_0x1eb91b['formType'])this['_formItem']=new go(this['locale'],_0x1eb91b);this['set']('value',''),this['bind']('value')['to'](this['_formItem'],'formValue');const _0x5e9390=new _0xe9ce1a(this['locale'],{'children':[this['_formItem']],'class':[_0x32f1c3?'ck-form__row_with-submit':'']});_0x32f1c3&&_0x5e9390['children']['add'](_0x32f1c3),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai_review__form-item','ck-reset_all']},'children':[_0x5e9390]});}['resetToDefault'](){this['_formItem']['resetToDefault']();}}class Eo extends _0x4939e3{['keystrokes'];static ['MIN_ROWS']=0x1;static ['MAX_ROWS']=0xc;constructor(_0x28c016){super(_0x28c016),this['set']('isEmpty',!0x0),this['keystrokes']=new gt(),this['minRows']=Eo['MIN_ROWS'],this['maxRows']=Eo['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 po extends vt{['focusTracker']=new At();['keystrokes']=new gt();['focusCycler'];['_focusables']=new _0x4539b4();['submitButtonView'];['cancelButtonView'];['promptInputView'];['actionsFooterView'];['_modelSelectionDropdown'];['_modelNameView'];['_modelSelectionDropdownItems'];['_check'];['_defaultValue'];['_defaultLabel'];constructor(_0xa70e16,_0x53d4f9,_0x259f64=!0x1){super(_0xa70e16),this['_check']=_0x53d4f9,this['set']('prompt',''),this['set']('modelId',''),this['set']('modelDisplayMode','selector'),this['set']('activeModelName',null),this['_defaultValue']=_0x53d4f9['defaultModel']?_0x53d4f9['defaultModel']['id']:'',this['_defaultLabel']=_0x53d4f9['defaultModel']?_0x53d4f9['defaultModel']['name']:'',this['submitButtonView']=this['_createSubmitButtonView'](),this['cancelButtonView']=this['_createCancelButtonView'](),(this['promptInputView']=new te(this['locale'],()=>new Eo(_0xa70e16)),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 _t(),this['_modelNameView']=this['_createModelNameView'](),this['_setModelList'](_0x259f64),jt(this['_modelSelectionDropdown'],this['_modelSelectionDropdownItems']),this['actionsFooterView']=this['_createActionsFooterView'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-custom-actions']},'children':[new _0xe9ce1a(this['locale'],{'children':[this['promptInputView']]}),new _0xe9ce1a(this['locale'],{'children':[this['actionsFooterView']]})]}),this['promptInputView']['fieldView']['keystrokes']['set']('Enter',(_0x2acf23,_0x4848cf)=>{this['_isValid']()?(this['fire']('runReviewCheck',{'id':'custom','args':{'prompt':this['prompt'],'model':this['modelId']},'isCustom':!0x0}),_0x4848cf()):_0x4848cf();}),this['focusCycler']=new Ut({'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'](_0x2401a5=>{this['_focusables']['add'](_0x2401a5),this['focusTracker']['add'](_0x2401a5['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 _0x24c481 of this['_getFormValidators']()){const _0x2f7088=_0x24c481();if(_0x2f7088)return this['promptInputView']['errorText']=_0x2f7088,!0x1;}return!0x0;}['_getFormValidators'](){return[()=>{if(0x0===this['promptInputView']['fieldView']['value']?.['trim']()['length'])return us(this['locale'],'AI_REVIEW_MODE_PROMPT_EMPTY_ERROR');}];}['_createSubmitButtonView'](){const _0x134cfa=new Nt(this['locale']),t=this['locale']['t'];return _0x134cfa['set']({'label':t('Submit'),'withText':!0x0,'class':ds}),_0x134cfa['on']('execute',()=>{this['_isValid']()&&this['fire']('runReviewCheck',{'id':'custom','args':{'prompt':this['prompt'],'model':this['modelId']},'isCustom':!0x0});}),_0x134cfa;}['_createCancelButtonView'](){const _0x5cfb9e=new Nt(this['locale']),t=this['locale']['t'];return _0x5cfb9e['set']({'label':t('Cancel'),'withText':!0x0,'class':As}),_0x5cfb9e['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x5f234d=>{_0x5f234d['stopPropagation']();})}}),_0x5cfb9e['on']('execute',()=>{this['resetToDefault'](),this['fire']('closeCustomCheck');}),_0x5cfb9e;}['_setModelList'](_0x179db9){this['_modelSelectionDropdownItems']['clear']();const _0x15068e=this['_check']['models'];if(_0x179db9)this['set']('modelDisplayMode','hidden');else{const _0x321fec=0x1===_0x15068e['length'];this['set']('modelDisplayMode',_0x321fec?'name':'selector');}if(this['resetToDefault'](),_0x15068e?.['length']){0x1===_0x15068e['length']&&this['set']('activeModelName',_0x15068e[0x0]['name']||_0x15068e[0x0]['id']);for(const _0x16518c of _0x15068e){const _0x36c812=new Jt({'label':_0x16518c['name'],'withText':!0x0,'role':'menuitemradio','id':_0x16518c['id'],'model':_0x16518c});_0x36c812['bind']('isOn')['to'](this,'modelId',_0x10d2e0=>_0x10d2e0===_0x16518c['id']),this['_modelSelectionDropdownItems']['add']({'type':'button','model':_0x36c812,'labelView':new mo(this['locale'],_0x16518c)});}}}['_createModelSelectionDropdown'](){const _0x1263e4=Gt(this['locale']);return _0x1263e4['set']({'panelPosition':'se','class':'ck-ai_review__check-list-item-model-dropdown'}),_0x1263e4['buttonView']['set']({'label':this['_defaultLabel'],'withText':!0x0,'tooltip':!0x0,'class':As}),_0x1263e4['buttonView']['bind']('isVisible')['to'](this,'modelDisplayMode',_0x47dfbe=>'selector'===_0x47dfbe),this['listenTo'](_0x1263e4,'execute',_0x571690=>{this['modelId']=_0x571690['source']['model']['id'],_0x1263e4['buttonView']['label']=_0x571690['source']['label'];}),_0x1263e4;}['_createModelNameView'](){const _0x8e79e1=new To(this['locale']);return _0x8e79e1['bind']('text')['to'](this,'activeModelName',_0x541cd9=>_0x541cd9??''),_0x8e79e1['bind']('isVisible')['to'](this,'modelDisplayMode',_0x5b8cf6=>'name'===_0x5b8cf6),_0x8e79e1;}['_createActionsFooterView'](){const _0x51c9e8=new vt(this['locale']);return _0x51c9e8['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']]}]}),_0x51c9e8;}}class To extends vt{constructor(_0x5e1d6e){super(_0x5e1d6e),this['set']('text',void 0x0),this['set']('isVisible',!0x0);const _0x4d27da=this['bindTemplate'];this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai_review__check-list-item-model-name',_0x4d27da['if']('isVisible','ck-hidden',_0x3bac37=>!_0x3bac37)]},'children':[{'text':_0x4d27da['to']('text')}]});}}class mo extends Mt{constructor(_0x264e2c,_0x2ccb3c){super();const _0x4bf670=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-button__label'],'style':_0x4bf670['to']('style'),'id':_0x4bf670['to']('id')},'children':[{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-model-dropdown-name']},'children':[{'tag':'span','children':[{'text':_0x4bf670['to']('text')}]}]},{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-model-dropdown-description']},'children':[{'tag':'span','children':[_0x2ccb3c['description']||'']}]}]});}}class Co extends Ht{['_formItemsCollection']=new _0x4539b4();['_customCheckView']=null;['_hideModels']=!0x1;constructor(_0x21ddc8,_0x1bf85c,_0x2bc158,_0x2a31b4=!0x1){super(_0x21ddc8),this['_hideModels']=_0x2a31b4,this['set']('isParametrizedViewOpen',!0x1),this['set']('isListItemRendered',!0x1),this['set']('isItemParametrized',_0x1bf85c['isParameterized']);const _0xd279b3=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',_0x1d991d=>_0x1d991d),this['bindTemplate']['if']('isListItemRendered','ck-ai_review__check-list-item_rendered',_0x395611=>_0x395611)],'style':{'--ck-ai-review-check-list-item-index':_0x2bc158}},'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':_0x1bf85c['title']}]},_0xd279b3]},{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-description']},'children':_0x1bf85c['description']?[{'text':_0x1bf85c['description']}]:[]}]}]},..._0x1bf85c['isParameterized']?[this['_createParameterizedView'](_0x1bf85c)]:[],...'custom'===_0x1bf85c['id']?[this['_createCustomView'](_0x1bf85c,this['_hideModels'])]:[]]}),this['on']('click',()=>{_0x1bf85c['isParameterized']?this['isParametrizedViewOpen']=!0x0:this['fire']('runReviewCheck',{'id':_0x1bf85c['id'],'args':_0x1bf85c['useArgs']?_0x1bf85c['args']:void 0x0});}),requestAnimationFrame(()=>{this['isListItemRendered']=!0x0;});}['render'](){super['render'](),this['isItemParametrized']&&zt({'emitter':this,'activator':()=>!0x0===this['isParametrizedViewOpen'],'contextElements':[this['element']],'callback':()=>{this['isParametrizedViewOpen']=!0x1;}});}['resetToDefault'](){this['isParametrizedViewOpen']=!0x1,this['_formItemsCollection']['forEach'](_0x5a9cd7=>{_0x5a9cd7['resetToDefault']();}),this['_customCheckView']&&this['_customCheckView']['resetToDefault']();}['_createIconView'](){const _0x256bb2=new xt();return _0x256bb2['content']=at,_0x256bb2['extendTemplate']({'attributes':{'class':['ck-ai_review__check-list-item-title-icon']}}),_0x256bb2;}['_createParameterizedView'](_0x2af36a){const _0x5d69b0=new vt(),_0x3d4cc1=this['_createFormView'](_0x2af36a);return _0x5d69b0['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-parameterized',this['bindTemplate']['if']('isParametrizedViewOpen','ck-hidden',_0x382137=>!_0x382137)]},'children':[_0x3d4cc1]}),_0x5d69b0;}['_createFormView'](_0x4529ec){const _0x16cb58=new vt(),_0x5264cf=Array['isArray'](_0x4529ec['options'])?_0x4529ec['options']:[],_0x46a8ef=new Nt(this['locale']),t=this['locale']['t'];_0x46a8ef['set']({'label':t('Submit'),'withText':!0x0,'class':ds}),_0x46a8ef['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x37daf6=>{_0x37daf6['stopPropagation']();})}}),_0x46a8ef['on']('execute',()=>{const _0x1e7b53=[],_0x595885={};this['_formItemsCollection']['forEach'](_0x201a1=>{_0x1e7b53['push'](_0x201a1['value']),_0x4529ec['useArgs']&&_0x4529ec['options']&&(_0x595885[_0x201a1['argsKey']]=_0x201a1['value']);}),this['fire']('runReviewCheck',{'id':_0x4529ec['id'],'params':_0x1e7b53['length']?_0x1e7b53:void 0x0,'args':Object['keys'](_0x595885)['length']?_0x595885:void 0x0});});const _0x5d81fe=_0x5264cf['length'];return _0x5264cf['forEach']((_0xe6ffb5,_0xd5eebd)=>{const _0x17c42b=_0xd5eebd===_0x5d81fe-0x1;this['_formItemsCollection']['add'](new Io(this['locale'],_0xe6ffb5,_0x17c42b?_0x46a8ef:null));}),_0x16cb58['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-parameterized-form']},'children':this['_formItemsCollection']}),_0x16cb58;}['_createCustomView'](_0x47dec4,_0x177b58=!0x1){return this['_customCheckView']=new po(this['locale'],_0x47dec4,_0x177b58),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',_0x189ebe=>!_0x189ebe)]}}),this['_customCheckView']['delegate']('runReviewCheck')['to'](this),this['listenTo'](this['_customCheckView'],'closeCustomCheck',()=>{this['isParametrizedViewOpen']=!0x1;}),this['on']('change:isParametrizedViewOpen',(_0x56e9e5,_0x1f6b4b,_0x6bc99c)=>{_0x6bc99c||this['_customCheckView']['resetFormValidationStatus']();}),this['_customCheckView'];}}class wo extends Ht{['_checkViews'];constructor(_0x7f287){super(_0x7f287),this['_checkViews']=new _0x4539b4(),this['_setupTemplate']();}['setChecks'](_0x1085b9,_0x8287cc=!0x1){this['_checkViews']['clear']();for(const [_0x6f1ed4,_0x4ac602]of _0x1085b9['entries']()){const _0x6be178=new Co(this['locale'],_0x4ac602,_0x6f1ed4,_0x8287cc);_0x6be178['delegate']('runReviewCheck')['to'](this),this['_checkViews']['add'](_0x6be178);}}['hasChecks'](){return this['_checkViews']['length']>0x0;}['resetAllParameterizedChecks'](){for(const _0x3260e0 of this['_checkViews'])_0x3260e0 instanceof Co&&_0x3260e0['resetToDefault']();}['_setupTemplate'](){const _0x2dc59b=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list',_0x2dc59b['if']('isVisible','ck-hidden',_0x37e18b=>!_0x37e18b)]},'children':this['_checkViews']});}}class fo extends ho{static get['pluginName'](){return'AIReviewModeUI';}['createMainView'](){const _0x5b51af=this['context']['locale'],_0x1a8fc6=new _0x16cf91(_0x5b51af,{'label':us(_0x5b51af,'AI_REVIEW_MODE'),'icon':_0x1d0da2,'class':'ck-ai-header\x20ck-ai-header_review'});return new lo(this['context']['locale'],{'header':_0x1a8fc6,'list':new wo(_0x5b51af),'results':new _o(_0x5b51af,{'generalErrorText':us(_0x5b51af,'AI_REVIEW_MODE_GENERAL_ERROR_MESSAGE')}),'completed':new Ao(_0x5b51af,{'headerText':us(_0x5b51af,'AI_REVIEW_MODE_FINISH_REVIEW_HEADER_TITLE'),'emptyResultsText':us(_0x5b51af,'AI_REVIEW_MODE_EMPTY_RESULTS_TEXT'),'buttonText':us(_0x5b51af,'AI_REVIEW_MODE_FINISH_REVIEW_BUTTON_LABEL')})});}['registerTab'](){const _0x1afcfd=this['context']['plugins']['get']('AITabs');_0x1afcfd['view']['on']('activateTab',(_0x3642ad,_0x2d67d0)=>{'reviewMode'===_0x2d67d0?this['fire']('getReviewCheckList'):this['fire']('leaveReview');}),_0x1afcfd['view']['addTab']({'id':'reviewMode','buttonLabel':us(this['context']['locale'],'AI_REVIEW_MODE'),'buttonIcon':_0x1d0da2,'order':0x0,'content':this['_mainView']});}}const So='review-';class bo extends _0x25e92e{static get['requires'](){return[_0x32e5d7,tn];}static get['pluginName'](){return'AIReviewCoreEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['_markers']=new Map();['_activeMarkers']=new Set();['_domEmitter'];['_eventEmitter'];constructor(_0x1ce152){super(_0x1ce152),this['_domEmitter']=new(Ot())(),this['_eventEmitter']=new(pt())();}get['emitter'](){return this['_eventEmitter'];}['afterInit'](){const _0x2e65ae=Xs(this['context']);_0x2e65ae['conversion']['for']('editingDowncast')['markerToElement']({'model':So+'insert','view':(_0x57d935,{writer:_0x2b29f3})=>{const _0x3b3298=this['_markers']['get'](_0x57d935['markerName']),_0x1f8978={'class':'ck-ai_review-marker_add'+(this['_activeMarkers']['has'](_0x3b3298?.['id']||'')?'\x20ck-ai_review__change_active':''),'data-marker-id':_0x57d935['markerName']};return _0x2b29f3['createUIElement']('span',_0x1f8978,function(_0x88603c){const _0x565f83=this['toDomElement'](_0x88603c);return _0x565f83['innerHTML']=_0x3b3298?.['content']?.['asString']||'',_0x565f83;});}}),_0x2e65ae['conversion']['for']('editingDowncast')['markerToHighlight']({'model':So+'remove-only','view':_0x344700=>{const _0x1448d3=this['_markers']['get'](_0x344700['markerName']),_0x3d1c4d=['ck-ai_review-marker_strikethrough'];return this['_activeMarkers']['has'](_0x1448d3?.['id']||'')&&_0x3d1c4d['push']('ck-ai_review__change_active'),{'classes':_0x3d1c4d,'attributes':{'data-marker-id':_0x344700['markerName']}};}}),_0x2e65ae['conversion']['for']('editingDowncast')['markerToHighlight']({'model':So+'remove-context','view':_0x3b5754=>{const _0x458523=this['_markers']['get'](_0x3b5754['markerName']),_0x181bf2=['ck-ai_review-marker_underline'];return this['_activeMarkers']['has'](_0x458523?.['id']||'')&&_0x181bf2['push']('ck-ai_review__change_active'),{'classes':_0x181bf2,'attributes':{'data-marker-id':_0x3b5754['markerName']}};}}),_0x2e65ae['conversion']['for']('editingDowncast')['markerToHighlight']({'model':So+'remove-text','view':_0x572335=>{const _0x2a385f=this['_markers']['get'](_0x572335['markerName']),_0xfafa7=['ck-ai_review-marker_hide'];return this['_activeMarkers']['has'](_0x2a385f?.['id']||'')&&_0xfafa7['push']('ck-ai_review__change_active'),{'classes':_0xfafa7,'attributes':{'data-marker-id':_0x572335['markerName']}};}}),_0x2e65ae['conversion']['for']('dataDowncast')['markerToElement']({'model':So+'suggestion-context','view':(_0x2cf1d3,{writer:_0x46d85e})=>_0x46d85e['createRawElement']('span',{'class':'ck-ai_review-marker_context-'+(_0x2cf1d3['isOpening']?'start':'end')})}),_0x2e65ae['conversion']['for']('downcast')['attributeToAttribute']({'model':_0x5e786f,'view':_0x1fa8e5});const _0x58fb7b=_0x2e65ae['ui']['getEditableElement']()||document['body'];this['_domEmitter']['listenTo'](_0x58fb7b,'mouseup',(_0x2a533e,_0x30cac0)=>{const _0x565c41=_0x30cac0['target'],_0x342b09=this['_findMarkerElement'](_0x565c41);if(!_0x342b09)return;const _0x422bea=_0x342b09['getAttribute']('data-marker-id'),_0x244d69=_0x422bea['split'](':')['pop']()?.['split']('_')[0x0];this['_eventEmitter']['fire']('changeMarkerClicked',{'markerId':_0x422bea,'changeId':_0x244d69,'markerElement':()=>this['_findMarkerElementById'](_0x422bea),'domEvent':_0x30cac0});},{'usePassive':!0x0,'priority':'highest'}),this['_domEmitter']['listenTo'](_0x58fb7b,'mouseover',(_0xa87460,_0x524eee)=>{const _0x20f83b=_0x524eee['target'],_0x290531=_0x524eee['relatedTarget'];let _0x12c7a3=this['_findMarkerElement'](_0x20f83b);if(!_0x12c7a3&&_0x290531&&(_0x12c7a3=this['_findMarkerElement'](_0x290531)),!_0x12c7a3)return;const _0x230528=_0x12c7a3['getAttribute']('data-marker-id'),_0xcf5225=_0x230528['split'](':')['pop']()?.['split']('_')[0x0];this['_eventEmitter']['fire']('changeMarkerHovered',{'changeId':_0xcf5225,'markerElement':()=>this['_findMarkerElementById'](_0x230528),'domEvent':_0x524eee});}),this['_domEmitter']['listenTo'](document,'mouseover',_0x5466d9((_0x3f73b9,_0x333105)=>{const _0x115c3b=_0x333105['target'];if(this['_findMarkerElement'](_0x115c3b))return;_0x115c3b['closest']('.ck-reset.ck-ai_review-balloon-panel-suggestion')||this['_eventEmitter']['fire']('changeMarkerBlurred');},0xc8)),_0x2e65ae['model']['document']['registerPostFixer'](_0x120f0e=>this['_validateMarkers'](_0x2e65ae,_0x120f0e)),_0x2e65ae['model']['document']['on']('change',()=>this['_handleMarkerChanges'](_0x2e65ae));}['getDocumentData'](){const _0x34363e=this['context']['plugins']['get']('AIEditing'),_0x57dc51=Xs(this['context']),_0x4da13b=_0x57dc51['model'],_0x1d8d33=new _0x35cdec();for(const _0x5d560d of _0x4da13b['document']['getRoot']()['getChildren']()){const _0x467197=_0x5d560d['_clone'](!0x0);_0x1d8d33['_appendChild'](_0x467197);}for(const _0x3230da of _0x4da13b['markers'])_0x1d8d33['markers']['set'](_0x3230da['name'],this['_changeRangeOwnerDocument'](_0x3230da['getRange']()['clone'](),_0x1d8d33));const _0x5af7c6=new _0x13e536({'ignoreElementEnd':!0x0,'startPosition':_0x4da13b['createPositionAt'](_0x1d8d33,0x0)}),_0x45dfc4=new Set(),_0x4908a2=new Map();for(const {item:_0x546744}of _0x5af7c6){if(!_0x546744['is']('$textProxy'))continue;const _0x4d2e45=_0x546744['parent'];if(_0x4d2e45&&_0x4d2e45['is']('element')){const _0x19639d=this['_upsertDataId'](_0x4d2e45,()=>_0x34363e['_nextDataId'](_0x45dfc4));_0x45dfc4['add'](_0x19639d);for(const _0xa722b9 of _0x4d2e45['getChildren']())_0xa722b9['is']('element')&&_0x45dfc4['add'](this['_upsertDataId'](_0xa722b9,()=>_0x34363e['_nextDataId'](_0x45dfc4)));let _0x2a1db7=_0x4d2e45;for(;_0x2a1db7['parent']&&!_0x2a1db7['parent']['is']('documentFragment');)_0x2a1db7=_0x2a1db7['parent'],_0x2a1db7['hasAttribute'](_0x5e786f)&&_0x2a1db7['_removeAttribute'](_0x5e786f);_0x4908a2['set'](_0x19639d,{'path':_0x4d2e45['getPath'](),'getContent':this['_createGetContentUsingDataIdFn'](_0x2a1db7['_clone'](!0x0),_0x19639d,_0x57dc51['data'])}),_0x5af7c6['jumpTo'](_0x4da13b['createPositionAfter'](_0x4d2e45));}}return{'content':_0x57dc51['data']['processor']['toData'](_0x57dc51['data']['toView'](_0x1d8d33)),'version':_0x57dc51['model']['document']['version'],'elements':_0x4908a2};}['diffContent'](_0x4ce33a,_0xe366ff,_0x18f9a9=!0x1){const _0x281303=[],_0x2d2f7c=Xs(this['context']),_0x47f8a7=_0x2d2f7c['data']['parse'](_0xe366ff,'$documentFragment'),_0x1366ed=_0x2d2f7c['data']['parse'](_0x4ce33a,'$documentFragment'),_0x57e454=_0x2d2f7c['model']['createPositionAt'](_0x1366ed,0x0);if(this['_haveSingleTopLevelElement'](_0x47f8a7)){if(!this['_hasSameTopLevelElement'](_0x1366ed,_0x47f8a7))return _0x281303;}else{const _0x332360=_0x2d2f7c['model']['schema'];if(!this['_haveOnlyInlineContent'](_0x1366ed,_0x332360)||!this['_haveOnlyInlineContent'](_0x47f8a7,_0x332360))return _0x281303;}const _0x2c0494=this['context']['plugins']['get']('DocumentCompare')['getDiff'](_0x4ce33a,_0xe366ff,{'anchor':_0x57e454,'markDeletions':!0x0})['getOperations']()['filter'](_0x154e35=>'insert'===_0x154e35['type']||'marker'===_0x154e35['type']&&_0x154e35['name']['startsWith']('$markedRemove')),_0x9af485=this['_groupAdjacentOperations'](_0x2c0494),_0x5a8f26=[];if(_0x18f9a9){if(_0x9af485['length']){const _0x520201=_0x9af485[0x0]['operations'][0x0],_0x4578d0='insert'===_0x520201['type']?_0x520201['position']:_0x520201['newRange']['start'],_0x2e19de=this['_getPositionLimitingRange'](_0x4578d0,_0x2d2f7c,'inside'),_0x18f973=_0x2e19de?_0x47f8a7['getChild'](0x0)['getChildren']():_0x47f8a7['getChildren'](),_0x21ee90=_0x2e19de||_0x2d2f7c['model']['createRangeIn'](_0x1366ed),_0x4b01a0=[new _0x25bdad('$markedRemove:synthetic'+ot(),null,_0x21ee90,_0x2d2f7c['model']['document']['model']['markers'],!0x0,_0x2d2f7c['model']['document']['version']+0x1),new _0x17ac9e(_0x21ee90['end'],_0x18f973,_0x2d2f7c['model']['document']['version']+0x2)];_0x5a8f26['push']({'operations':_0x4b01a0,'operationsIsolated':_0x4b01a0,'groupOffset':0x0});}}else _0x5a8f26['push'](..._0x9af485);let _0x5dcf2a=0x0;return _0x2d2f7c['model']['change'](_0x727d3a=>{for(let _0x54fccc=0x0;_0x54fccc<_0x5a8f26['length'];_0x54fccc++){const _0x277526=_0x5a8f26[_0x54fccc],_0x2bad38=_0x727d3a['createDocumentFragment']();for(const _0x399c86 of _0x1366ed['getChildren']())_0x727d3a['append'](_0x399c86['_clone'](!0x0),_0x2bad38);for(const _0x3cfab0 of _0x277526['operationsIsolated'])if('insert'===_0x3cfab0['type']){const _0x33b27f=_0x3cfab0;_0x33b27f['baseVersion']=null,_0x33b27f['isDocumentOperation']=!0x1,this['_changeOperationOwnerDocument'](_0x33b27f,_0x2bad38),_0x727d3a['batch']['addOperation'](_0x3cfab0),_0x2d2f7c['model']['applyOperation'](_0x3cfab0);const _0x4d5c27='suggestion:insertion:id:authorId:'+_0x5dcf2a++,_0x2b754b=_0x2d2f7c['model']['createRange'](_0x33b27f['position'],_0x33b27f['position']['getShiftedBy'](_0x33b27f['howMany']));_0x2bad38['markers']['set'](_0x4d5c27,_0x2b754b);}else{if('marker'===_0x3cfab0['type']&&_0x3cfab0['name']['startsWith']('$markedRemove')){const _0x3c216f=_0x3cfab0,_0x3c27b4='suggestion:deletion:id:authorId:'+_0x5dcf2a++;this['_changeOperationOwnerDocument'](_0x3c216f,_0x2bad38),_0x2bad38['markers']['set'](_0x3c27b4,_0x3c216f['newRange']);}}if(_0x18f9a9)_0x281303['push']({..._0x277526,'context':this['_createGetContentFn'](_0x1366ed,_0x2d2f7c['data']),'content':this['_createGetContentFn'](_0x1366ed,_0x2d2f7c['data'])});else{const _0x296f50=this['_getChangeContext'](this['_changePositionOwnerDocument'](this['_getOperationStart'](_0x277526['operationsIsolated'][0x0]),_0x2bad38),this['_changePositionOwnerDocument'](this['_getOperationEnd'](_0x277526['operationsIsolated'][_0x277526['operationsIsolated']['length']-0x1]),_0x2bad38));_0x2bad38['markers']['set'](So+'suggestion-context',new _0x3b0db7(_0x296f50['start'],_0x296f50['end'])),_0x281303['push']({..._0x277526,'context':this['_createGetContextFn'](_0x2bad38,_0x2d2f7c['data'],{'ellipsisBefore':_0x296f50['hasContentBefore'],'ellipsisAfter':_0x296f50['hasContentAfter']}),'content':this['_createGetContentFn'](_0x2bad38,_0x2d2f7c['data'])});}}}),_0x281303;}['markChangePositionInEditorContent'](_0x11c320,_0x21b51d){if(!_0x11c320['length'])return;const _0xcccf3a=_0x11c320[0x0]['parent']['id'],_0x6b990d=_0x21b51d['elements']['get'](_0xcccf3a);if(!_0x6b990d)return void console['warn']('No\x20element\x20found\x20for\x20ID:\x20'+_0xcccf3a);const _0x54d521=_0x6b990d['path'],_0x5276f4=Xs(this['context']),_0x73ecfb=_0x5276f4['model']['document']['history']['getOperations'](_0x21b51d['version']),_0x594f78=[];for(const _0x47be6e of _0x11c320){const _0x4be9fa=_0x47be6e['operationsIsolated']['map'](_0x2d36d8=>this['_translateOperationToEditorContent'](_0x2d36d8,_0x54d521,_0x5276f4['model']['document']['getRoots']()[0x0]));if(!_0x4be9fa||!_0x4be9fa['length'])continue;const _0x13c79f=_0x4be9fa['every'](_0xd9ca7f=>'marker'===_0xd9ca7f['type']&&_0xd9ca7f['name']['startsWith']('$markedRemove')),_0x243a6c={'document':_0x5276f4['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1},_0x3be351=_0x20fadc(_0x4be9fa,_0x73ecfb,_0x243a6c)['operationsA'];for(const _0x3f2d46 of _0x3be351)if('insert'===_0x3f2d46['type']){const _0x207e07=_0x3f2d46,_0x541b1c=_0x207e07['nodes'];_0x5276f4['model']['change'](_0x1d509e=>{const _0x4acce1=_0x1d509e['createDocumentFragment']();for(const _0x41178c of _0x541b1c)_0x1d509e['append'](_0x41178c['_clone'](!0x0),_0x4acce1);_0x594f78['push']({'start':_0x207e07['position'],'end':_0x207e07['position'],'type':'insert','groupId':_0x47be6e['id'],'content':{'asString':this['_createGetContentFn'](_0x4acce1,_0x5276f4['data'])(),'asFragment':_0x4acce1}});});}else{if('marker'===_0x3f2d46['type']&&_0x3f2d46['name']['startsWith']('$markedRemove')){const _0x7b1f94=_0x3f2d46;let _0x54a8ba='remove-text';if(_0x13c79f){const _0x1729fd=this['_findAdjacentContextDistance'](_0x7b1f94['newRange']['start'],'backward',_0x5276f4['model']['schema']),_0x121fed=this['_findAdjacentContextDistance'](_0x7b1f94['newRange']['end'],'forward',_0x5276f4['model']['schema']);if(_0x1729fd||_0x121fed){const _0x4bada7=_0x7b1f94['newRange']['start']['getShiftedBy'](-_0x1729fd),_0x35fc26=_0x7b1f94['newRange']['end']['getShiftedBy'](_0x121fed);_0x594f78['push']({'start':_0x4bada7,'end':_0x35fc26,'groupId':_0x47be6e['id'],'type':'remove-context'});}else _0x54a8ba='remove-only';}_0x594f78['push']({'start':_0x7b1f94['newRange']['start'],'end':_0x7b1f94['newRange']['end'],'groupId':_0x47be6e['id'],'type':_0x54a8ba});}}}this['_insertMarkers'](_0x594f78);}['clearAllMarkers'](){const _0x27aca3=Xs(this['context']);_0x27aca3['model']['change'](_0x4021ff=>{for(const _0x148c76 of this['_markers']['keys']())_0x27aca3['model']['markers']['get'](_0x148c76)&&_0x4021ff['removeMarker'](_0x148c76);}),this['_markers']['clear'](),this['_activeMarkers']['clear']();}['switchToReadOnly'](){Xs(this['context'])['enableReadOnlyMode']('ai-review');}['switchToEdit'](){Xs(this['context'])['disableReadOnlyMode']('ai-review');}['applyChange'](_0x48bc6f){const _0x225599=Xs(this['context']),_0x352993=_0x225599['model'],_0x2f8f2c=_0x48bc6f['map'](_0x2e9a48=>this['_getMarkersDataForGroup'](_0x2e9a48))['flat']();_0x352993['change'](_0x215e51=>{for(const _0x54e5b7 of _0x2f8f2c){const _0x487cda=_0x225599['model']['markers']['get'](_0x54e5b7['id']);if(_0x487cda){if('insert'===_0x54e5b7['type']){if(!_0x54e5b7['content'])continue;_0x352993['insertContent'](_0x54e5b7['content']['asFragment']||null,_0x487cda['getRange']()['start']);}else'remove-text'!==_0x54e5b7['type']&&'remove-only'!==_0x54e5b7['type']||_0x352993['deleteContent'](_0x352993['createSelection'](_0x487cda['getRange']()));_0x215e51['removeMarker'](_0x54e5b7['id']),this['_markers']['delete'](_0x54e5b7['id']);}}});}['rejectChange'](_0x5c8633){const _0x39b54c=Xs(this['context']),_0x5c5579=this['_getMarkersDataForGroup'](_0x5c8633);_0x39b54c['model']['change'](_0x3705dc=>{for(const _0x2a742c of _0x5c5579)_0x3705dc['removeMarker'](_0x2a742c['id']),this['_markers']['delete'](_0x2a742c['id']);});}['getEditor'](){return Xs(this['context']);}['getMarkerElementForChange'](_0x4a9e9f){const _0x3cfc4e=Array['from'](this['_markers']['values']())['filter'](_0x4afc1d=>_0x4afc1d['groupId']===_0x4a9e9f);if(!_0x3cfc4e['length'])return null;const _0xbeb87=0x1===_0x3cfc4e['length']?_0x3cfc4e[0x0]:this['_sortMarkers'](_0x3cfc4e)[0x0],_0x3633d2=Xs(this['context'])['model']['markers']['get'](_0xbeb87['id']);if(!_0x3633d2)return null;return{'modelRange':_0x3633d2['getRange'](),'getElement':()=>this['_findMarkerElementById'](_0xbeb87['id'])};}['getContentElementForChange'](_0x59f0fa){const _0x3522bf=Array['from'](this['_markers']['values']())['filter'](_0x4cd75e=>_0x4cd75e['groupId']===_0x59f0fa);if(!_0x3522bf['length'])return null;const _0x4bacff=0x1===_0x3522bf['length']?_0x3522bf[0x0]:this['_sortMarkers'](_0x3522bf)[0x0],_0x1f35b9=Xs(this['context']),_0x31d1ba=_0x1f35b9['model']['markers']['get'](_0x4bacff['id']);if(!_0x31d1ba)return null;const _0x111b66=_0x31d1ba['getRange'](),_0x5ddf0e=_0x1f35b9['editing']['view']['getDomRoot']();if(!_0x5ddf0e||!_0x111b66)return null;let _0x5306a9=_0x111b66['start']['parent'];for(;_0x5306a9['parent']&&'$root'!==_0x5306a9['parent']['name'];)_0x5306a9=_0x5306a9['parent'];if(!_0x5306a9||!_0x5306a9['name'])return null;const _0x288414=_0x5ddf0e['querySelector']('[data-marker-id=\x22'+_0x4bacff['id']+'\x22]');if(!_0x288414)return null;let _0x2c2354=null;_0x1f35b9['model']['change'](_0x1b2e8c=>{_0x2c2354=_0x1b2e8c['createDocumentFragment'](),_0x1b2e8c['append'](_0x5306a9['_clone'](!0x0),_0x2c2354);});const _0x15b713=_0x1f35b9['data']['toView'](_0x2c2354)['getChild'](0x0);return _0x288414['closest'](_0x15b713['name']);}['reactivateMarkers'](_0x3f7ee7){const _0x3d2216=this['_getMarkersDataForGroup'](_0x3f7ee7);if(!_0x3d2216['length'])return;const _0x3f327b=Array['from'](this['_activeMarkers'])['sort'](),_0x3cd7bb=Array['from'](new Set(_0x3d2216['map'](_0x7275dc=>_0x7275dc['id'])))['sort']();_0x3f327b['join']('|')!==_0x3cd7bb['join']('|')&&(this['setAllMarkersAsInactive'](),this['setMarkersInElementAsActive'](_0x3f7ee7));}['setMarkersInElementAsActive'](_0x661ed7){const _0x2753f0=this['_getMarkersDataForGroup'](_0x661ed7);if(!_0x2753f0['length'])return;const _0x474c4b=Xs(this['context']),_0x50dd71=new Set(_0x2753f0['map'](_0x3a326c=>_0x3a326c['id'])),_0xc30fe6=Array['from'](_0x50dd71['values']())['map'](_0x58ffff=>_0x474c4b['model']['markers']['get'](_0x58ffff))['filter'](_0x4f4db6=>!!_0x4f4db6);_0x50dd71['forEach'](_0x3f9098=>{this['_activeMarkers']['add'](_0x3f9098);}),_0x474c4b['model']['change'](()=>{_0xc30fe6['forEach'](_0xf94934=>{_0x474c4b['editing']['reconvertMarker'](_0xf94934);});});}['setAllMarkersAsInactive'](){const _0x5058a9=Array['from'](this['_activeMarkers']);if(!_0x5058a9['length'])return;this['_activeMarkers']['clear']();const _0x256a88=Xs(this['context']),_0xeb2d2=_0x5058a9['map'](_0x4964c0=>_0x256a88['model']['markers']['get'](_0x4964c0))['filter'](_0x4bec72=>!!_0x4bec72);_0x256a88['model']['change'](()=>{_0xeb2d2['forEach'](_0x500d47=>{_0x256a88['editing']['reconvertMarker'](_0x500d47);});});}['_getPositionLimitingRange'](_0xa9e51c,_0x58a829,_0x3d76c3='outside'){if(!_0xa9e51c)return null;let _0x46dc48=_0xa9e51c['parent'];for(;_0x46dc48&&_0x46dc48['parent']&&'$root'!==_0x46dc48['parent']['name']&&!_0x58a829['model']['schema']['isLimit'](_0x46dc48)&&!_0x58a829['model']['schema']['isBlock'](_0x46dc48);)_0x46dc48=_0x46dc48['parent'];if(!_0x46dc48||!_0x46dc48['name']||'$root'===_0x46dc48['name'])return null;let _0x307757=null;return _0x58a829['model']['change'](_0x3b80b2=>{_0x307757='inside'===_0x3d76c3?_0x3b80b2['createRangeIn'](_0x46dc48):_0x3b80b2['createRangeOn'](_0x46dc48);}),_0x307757;}['_validateMarkers'](_0x3560f8,_0x56c747){const _0x4958d7=Array['from'](this['_markers']['keys']()),_0x4e62f6=new Map();for(const _0xdcd795 of _0x4958d7){const _0x107aa2=_0x3560f8['model']['markers']['get'](_0xdcd795);if(!_0x107aa2)continue;const _0x3d0408=_0x107aa2['getStart']()['path'][0x0];_0x4e62f6['has'](_0x3d0408)||_0x4e62f6['set'](_0x3d0408,[]),_0x4e62f6['get'](_0x3d0408)['push'](_0x107aa2);}const _0x360ee4=new Set();for(const _0x56cdc3 of _0x3560f8['model']['document']['differ']['getChanges']()){let _0x25f772=-0x1,_0x55e308=null;if('insert'===_0x56cdc3['type'])_0x55e308=new _0x3b0db7(_0x56cdc3['position'],_0x56cdc3['position']['getShiftedBy'](_0x56cdc3['length'])),_0x25f772=_0x56cdc3['position']['path'][0x0];else{if('remove'!==_0x56cdc3['type'])continue;_0x55e308=new _0x3b0db7(_0x56cdc3['position']),_0x25f772=_0x56cdc3['position']['path'][0x0];}const _0x1a6ae8=_0x4e62f6['get'](_0x25f772)||[];if(_0x1a6ae8['length']){for(const _0x22f9c5 of _0x1a6ae8)if(_0x55e308['root']['rootName']===_0x22f9c5['getRange']()['root']['rootName']&&('insert'!==_0x56cdc3['type']||!_0x55e308['containsRange'](_0x22f9c5['getRange']()))&&(_0x55e308['isIntersecting'](_0x22f9c5['getRange']())||_0x55e308['start']['isTouching'](_0x22f9c5['getRange']()['end'])||_0x55e308['end']['isTouching'](_0x22f9c5['getRange']()['start']))){const _0x126078=this['_parseMarkerName'](_0x22f9c5['name']);Array['from'](this['_markers']['values']())['filter'](_0x1e26d4=>_0x1e26d4['groupId']===_0x126078['groupId'])['forEach'](_0x4920e3=>_0x360ee4['add'](_0x4920e3['id']));}}}if(_0x360ee4['size']){for(const _0x26dce4 of _0x360ee4)_0x56c747['removeMarker'](_0x26dce4);return!0x0;}return!0x1;}['_handleMarkerChanges'](_0x158435){for(const {name:_0xb69431,data:_0x5b5649}of _0x158435['model']['document']['differ']['getChangedMarkers']()){if(!_0xb69431['startsWith'](So))continue;const _0x2c16f5=_0x5b5649['oldRange'],_0x289e0f=_0x5b5649['newRange'],_0x278389=_0x2c16f5&&'$graveyard'===_0x2c16f5['root']['rootName'],_0x4f876d=_0x289e0f&&'$graveyard'===_0x289e0f['root']['rootName'];if(_0x278389&&_0x4f876d)continue;const _0x2cc562=this['_parseMarkerName'](_0xb69431);this['_markers']['get'](_0xb69431)&&(_0x4f876d||!_0x289e0f?this['_eventEmitter']['fire']('changeMarkerRemoved',{'markerId':_0xb69431,'changeId':_0x2cc562['groupId']}):_0x278389&&_0x289e0f&&this['_eventEmitter']['fire']('changeMarkerRestored',{'markerId':_0xb69431,'changeId':_0x2cc562['groupId']}));}}['_parseMarkerName'](_0x679d01){const _0x268661=_0x679d01['split'](':'),_0x2ffc3a=(_0x268661[0x1]||'')['split']('_');return{'prefix':_0x268661[0x0],'groupId':_0x2ffc3a[0x0],'suffix':_0x2ffc3a[0x1]};}['_translateOperationToEditorContent'](_0x4238c2,_0x2500b4,_0x4cc099){if('insert'===_0x4238c2['type']){const _0x5da621=_0x4238c2;return new _0x17ac9e(this['_changePosition'](_0x2500b4['concat'](_0x5da621['position']['offset']),_0x4cc099),_0x5da621['nodes'],_0x5da621['baseVersion']);}if('marker'===_0x4238c2['type']&&_0x4238c2['name']['startsWith']('$markedRemove')){const _0x567d6e=_0x4238c2;return new _0x25bdad(_0x567d6e['name'],_0x567d6e['oldRange'],this['_changeRange'](_0x567d6e['newRange'],_0x2500b4['concat'](_0x567d6e['newRange']['start']['offset']),_0x2500b4['concat'](_0x567d6e['newRange']['end']['offset']),_0x4cc099),_0x567d6e['_markers'],_0x567d6e['affectsData'],_0x567d6e['baseVersion']);}return _0x4238c2;}['_groupAdjacentOperations'](_0x378df8){if(!_0x378df8['length'])return[];const _0x21eaaa=[];let _0xbf333=0x0,_0xd14aca=0x0,_0x5339ec=[];for(let _0x350001=0x0;_0x350001<=_0x378df8['length'];_0x350001++){const _0x146918=_0x378df8[_0x350001],_0x5d5b05=_0x378df8[_0x350001-0x1];!_0x146918||_0x5d5b05&&!this['_getOperationEnd'](_0x5d5b05)['isTouching'](this['_getOperationStart'](_0x146918))?(_0x21eaaa['push']({'operations':_0x5339ec,'operationsIsolated':_0x5339ec['map'](_0x39be13=>this['_shiftOperation'](_0x39be13['clone'](),-_0xd14aca)),'groupOffset':_0xbf333}),_0x5339ec=_0x146918?[_0x146918]:[],_0xd14aca+=_0xbf333,_0xbf333=0x0):_0x5339ec['push'](_0x146918),_0x146918&&'insert'===_0x146918['type']&&(_0xbf333+=_0x146918['howMany']);}return _0x21eaaa;}['_findAdjacentContextDistance'](_0xc6df90,_0x380876,_0x3918f0,_0x18a544=0x1){const _0x28edd6=new _0x13e536({'startPosition':_0xc6df90,'direction':_0x380876});let _0x12deaa=0x0;for(let _0x237f86=0x0;_0x237f86<_0x18a544;_0x237f86++){let _0x2e7f28=0x0,_0x4a9774=!0x1,_0x2a0452='forward'===_0x380876?/^\W*\w+/:/\w+\W*$/;for(const {item:_0x207861}of _0x28edd6)if(_0x207861['is']('$textProxy')){const _0x4b4ab8=_0x2a0452['exec'](_0x207861['data']);if(_0x4b4ab8&&_0x4b4ab8['length']){if(_0x2e7f28+='forward'===_0x380876?_0x4b4ab8['index']+_0x4b4ab8[0x0]['length']:_0x207861['data']['length']-_0x4b4ab8['index'],_0x4b4ab8[0x0]['length']!==_0x207861['data']['length'])break;_0x4a9774=!0x0,_0x2a0452='forward'===_0x380876?/^\w+/:/\w+$/;}else{if(_0x4a9774)break;_0x2e7f28+=_0x207861['offsetSize'];}}else{if(_0x207861['is']('element')){_0x3918f0['isInline'](_0x207861)&&!_0x4a9774&&(_0x2e7f28+=0x1);break;}}_0x12deaa+=_0x2e7f28,_0x28edd6['jumpTo'](_0xc6df90['getShiftedBy']('forward'===_0x380876?_0x12deaa:-_0x12deaa));}return _0x12deaa;}['_getChangeContext'](_0x16eca4,_0x38f864){const _0x5b53d5=Xs(this['context'])['model']['schema'],_0x67f487=this['_findAdjacentContextDistance'](_0x16eca4,'backward',_0x5b53d5,0x6),_0x527320=this['_findAdjacentContextDistance'](_0x38f864,'forward',_0x5b53d5,0x6),_0x47ffbe=_0x16eca4['getShiftedBy'](-_0x67f487),_0x1ee5bd=_0x38f864['getShiftedBy'](_0x527320);return{'start':_0x47ffbe,'end':_0x1ee5bd,'hasContentBefore':!_0x47ffbe['isAtStart'],'hasContentAfter':!_0x1ee5bd['isAtEnd']};}['_insertMarkers'](_0x2e857b){const _0x10c8c7=this['context']['plugins']['get']('AIEditing'),_0x591979=new Set();Xs(this['context'])['model']['change'](_0x4667d2=>{for(const _0x2f966a of _0x2e857b){const _0x5de389=''+So+_0x2f966a['type']+':'+_0x2f966a['groupId']+'_'+_0x10c8c7['_nextDataId'](_0x591979);this['_markers']['set'](_0x5de389,{'id':_0x5de389,'groupId':_0x2f966a['groupId'],'type':_0x2f966a['type'],'content':_0x2f966a['content']}),_0x4667d2['addMarker'](_0x5de389,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x4667d2['createRange'](_0x2f966a['start'],_0x2f966a['end'])});}});}['_createGetContextFn'](_0x51df2,_0x20763b,_0x329945){let _0x7eeb65='';return()=>{if(!_0x7eeb65){const _0xb21edb=_0x20763b['toView'](_0x51df2,{'showSuggestionHighlights':!0x0});let _0x50ccbf=_0xb21edb['getChild'](0x0);if(_0x50ccbf['is']('containerElement')||(_0x50ccbf=_0xb21edb),!_0x50ccbf)return'';let _0x12078f=!0x1;const _0xcaeb10=[];for(const _0x455416 of _0x50ccbf['getChildren']())_0x455416['is']('element','span')&&_0x455416['hasClass']('ck-ai_review-marker_context-end')&&(_0x12078f=!0x1),_0x12078f&&_0xcaeb10['push'](_0x455416),_0x455416['is']('element','span')&&_0x455416['hasClass']('ck-ai_review-marker_context-start')&&(_0x12078f=!0x0);_0x50ccbf['_removeChildren'](0x0,_0x50ccbf['childCount']),_0x329945?.['ellipsisBefore']&&_0x50ccbf['_appendChild']('…'),_0x50ccbf['_appendChild'](_0xcaeb10),_0x329945?.['ellipsisAfter']&&_0x50ccbf['_appendChild']('…');const _0x1d4e08=_0x20763b['htmlProcessor']['domConverter']['viewToDom'](_0xb21edb),_0x5b9e09=_0x20763b['htmlProcessor']['htmlWriter']['getHtml'](_0x1d4e08);_0x7eeb65=_0x5b9e09;}return _0x7eeb65;};}['_createGetContentFn'](_0x2df386,_0x23fea0){let _0x2c6039='';return()=>(_0x2c6039||(_0x2c6039=_0x23fea0['stringify'](_0x2df386,{'showSuggestionHighlights':!0x0})),_0x2c6039);}['_createGetContentUsingDataIdFn'](_0x6373ed,_0x2105b0,_0x396bce){let _0x5f0cc7='';return()=>{if(!_0x5f0cc7){const _0x5e17d1=_0x396bce['toView'](new _0x35cdec(_0x6373ed)),_0x5205a5=_0x396bce['htmlProcessor']['domConverter']['viewToDom'](_0x5e17d1)['querySelector']('[data-id=\x22'+_0x2105b0+'\x22]');_0x5f0cc7=_0x5205a5?.['outerHTML']||'';}return _0x5f0cc7;};}['_findMarkerElement'](_0x200370,_0x595d12=0x5){let _0x29b29e=_0x200370,_0x5ed84a=null;for(let _0x1cc401=0x0;_0x1cc401<_0x595d12&&_0x29b29e;_0x1cc401++){if(!_0x29b29e['className']){_0x29b29e=_0x29b29e['parentElement'];continue;}if(!(''+_0x29b29e['className'])['includes']('ck-ai_review-marker_')){_0x29b29e=_0x29b29e['parentElement'];continue;}if(!_0x29b29e['getAttribute']('data-marker-id'))break;_0x5ed84a=_0x29b29e;break;}return _0x5ed84a;}['_findMarkerElementById'](_0x52d8dd){const _0x19c10b=Xs(this['context']),_0x220010=_0x19c10b['model']['markers']['get'](_0x52d8dd);return _0x220010?_0x3cee99(_0x19c10b['editing'],_0x220010):null;}['_getMarkersDataForGroup'](_0x46edce){return Array['from'](this['_markers']['values']())['filter'](_0x44c7b4=>_0x44c7b4['groupId']===_0x46edce);}['_getOperationStart'](_0x90759f){return'insert'===_0x90759f['type']?_0x90759f['position']:_0x90759f['newRange']['start'];}['_getOperationEnd'](_0x554220,_0x16154e=!0x1){return'insert'===_0x554220['type']?_0x16154e?_0x554220['position']:_0x554220['position']['getShiftedBy'](_0x554220['howMany']):_0x554220['newRange']['end'];}['_shiftOperation'](_0x3fa4a2,_0x2aa11c){return'insert'===_0x3fa4a2['type']?_0x3fa4a2['position']=_0x3fa4a2['position']['getShiftedBy'](_0x2aa11c):'marker'===_0x3fa4a2['type']&&_0x3fa4a2['newRange']&&(_0x3fa4a2['newRange']=new _0x3b0db7(_0x3fa4a2['newRange']['start']['getShiftedBy'](_0x2aa11c),_0x3fa4a2['newRange']['end']['getShiftedBy'](_0x2aa11c))),_0x3fa4a2;}['_changeOperationOwnerDocument'](_0x2cbe0d,_0x468f14){'insert'===_0x2cbe0d['type']?_0x2cbe0d['position']=this['_changePositionOwnerDocument'](_0x2cbe0d['position'],_0x468f14):'marker'===_0x2cbe0d['type']&&_0x2cbe0d['newRange']&&(_0x2cbe0d['newRange']=this['_changeRangeOwnerDocument'](_0x2cbe0d['newRange'],_0x468f14));}['_changePositionOwnerDocument'](_0x413e2d,_0x5b537f){return new _0x54fe5a(_0x5b537f,_0x413e2d['path']);}['_changeRangeOwnerDocument'](_0x22f68f,_0x204e0c){return new _0x3b0db7(this['_changePositionOwnerDocument'](_0x22f68f['start'],_0x204e0c),this['_changePositionOwnerDocument'](_0x22f68f['end'],_0x204e0c));}['_changePosition'](_0x27166a,_0x437486){return new _0x54fe5a(_0x437486,[..._0x27166a]);}['_changeRange'](_0x5be5f6,_0x31015b,_0xeb89c9,_0x398e51){return new _0x3b0db7(this['_changePosition'](_0x31015b,_0x398e51),this['_changePosition'](_0xeb89c9,_0x398e51));}['_sortMarkers'](_0x4c4170){const _0x50cf2c=_0x54591f=>{switch(_0x54591f){case'insert':return 0x0;case'remove-context':return 0x1;case'remove-only':return 0x2;case'remove-text':return 0x3;}};return _0x4c4170['sort']((_0xaff906,_0x569f14)=>_0x50cf2c(_0xaff906['type'])-_0x50cf2c(_0x569f14['type']));}['_hasSameTopLevelElement'](_0x1febcd,_0x15f5f0){const _0x82bcc5=_0x1febcd['getChild'](0x0),_0x4002ed=_0x15f5f0['getChild'](0x0);return!(!_0x82bcc5||!_0x4002ed)&&((!_0x82bcc5['is']('element')||!_0x4002ed['is']('element')||_0x82bcc5['name']===_0x4002ed['name'])&&!(_0x82bcc5['is']('element')&&!_0x4002ed['is']('element')||!_0x82bcc5['is']('element')&&_0x4002ed['is']('element')));}['_haveSingleTopLevelElement'](_0x3778ad){return 0x1===_0x3778ad['childCount'];}['_haveOnlyInlineContent'](_0x2a8397,_0x2a43e6){for(const _0x3dfc74 of _0x2a8397['getChildren']())if(_0x3dfc74['is']('element')&&!_0x2a43e6['isInline'](_0x3dfc74))return!0x1;return!0x0;}['_upsertDataId'](_0x5c37cd,_0x2fe5b5){let _0x1ab876=_0x5c37cd['getAttribute'](_0x5e786f);return _0x1ab876||(_0x1ab876=_0x2fe5b5(),_0x5c37cd['_setAttribute'](_0x5e786f,_0x1ab876)),_0x1ab876;}}class Ro extends pt(){['id'];['contentNew'];['contentInitial'];['documentVersion'];constructor({id:_0x2d0120,contentNew:_0x218b84,contentInitial:_0x1ba859,documentVersion:_0x37b596}){super(),this['id']=_0x2d0120,this['contentNew']=_0x218b84,this['contentInitial']=_0x1ba859,this['documentVersion']=_0x37b596;}}class Oo extends ct(){['id'];['parent'];['_data'];['_editorOperations']=[];constructor(_0x4b5b85,_0x59630d,_0xc0d237){super(),this['id']=_0x4b5b85,this['parent']=_0xc0d237,this['_data']=_0x59630d,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 ko extends ct(){['id']=ot();['callId'];['_results']=new Map();['_changes']=[];['_sourceCheck'];['_documentData'];['_aiConnector'];['_reviewParams'];['_reviewArgs'];['_activeRequest']=null;['_currentError'];['_wasAborted']=!0x1;constructor(_0x480745,_0x319b0d,_0x53552b,_0x37bd98,_0x53eb59){super(),this['_sourceCheck']=_0x319b0d,this['_documentData']=_0x480745,this['_aiConnector']=_0x53552b,this['_reviewParams']=_0x37bd98,this['_reviewArgs']=_0x53eb59,this['on']('change:status',(_0x12acdb,_0x21b14e,_0x420bf1)=>{'aborted'==_0x420bf1&&(this['_wasAborted']=!0x0),this['fire']('reviewCheckRunUpdated',{'status':_0x420bf1,'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'](_0x26ed43=>'pending'===_0x26ed43['status']);}get['currentError'](){return this['_currentError'];}['updateDocumentData'](_0x34310c){this['_documentData']=_0x34310c;}async['start'](){this['status']='loading',this['_currentError']=void 0x0;try{this['_activeRequest']=this['_createApiRequest']();const _0x5db18c=await this['_activeRequest']['getStream']();this['status']='data';for await(const _0x10f6d7 of _0x5db18c)'unmodified'!==_0x10f6d7['data']['operation']&&('error'!==_0x10f6d7['data']['operation']?'review-metadata'!==_0x10f6d7['event']?this['_addReviewCheckResult'](_0x10f6d7['data']['dataId'],_0x10f6d7['data']['textDelta']):this['callId']=_0x10f6d7['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(_0x16f776){this['_currentError']=_0x16f776,_0x16f776 instanceof Error&&_0x16f776['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'](_0x465c9c,_0x226df0){const _0x2efc6b=this['_results']['get'](_0x465c9c);if(!_0x2efc6b)return;if(0x0===_0x226df0['length'])return;const _0x254a55=[];_0x226df0['forEach']((_0x52d433,_0x2a4e5a)=>{const _0x2805ad=new Oo(_0x2efc6b['id']+'-'+_0x2a4e5a,_0x52d433,_0x2efc6b);_0x2805ad['on']('change:status',()=>{this['fire']('reviewCheckResultChangeStatusUpdated',{'change':_0x2805ad,'status':_0x2805ad['status']});}),_0x2805ad['on']('change:isActivated',()=>{_0x2805ad['isActivated']?this['fire']('reviewCheckResultActivated',{'change':_0x2805ad}):this['fire']('reviewCheckResultDeactivated',{'change':_0x2805ad});}),this['_changes']['push'](_0x2805ad),_0x254a55['push'](_0x2805ad);}),this['fire']('reviewCheckResultReady',{'changes':_0x254a55,'result':_0x2efc6b,'source':this});}['abort'](){this['_activeRequest']&&(this['_activeRequest']['abortController']['abort'](),this['_activeRequest']=null,this['status']='aborted');}['isChangeActive'](_0x9565e){const _0x4201fa=this['_changes']['find'](_0x1751fd=>_0x1751fd['id']===_0x9565e);return!(!_0x4201fa||'pending'!==_0x4201fa['status']);}['isAnyChangeActivated'](){return this['_changes']['some'](_0xc9b3fa=>!0x0===_0xc9b3fa['isActivated']);}['getActiveChanges'](){return this['_changes']['filter'](_0x1b539c=>'pending'===_0x1b539c['status']);}['getChangeById'](_0x541bf0){return this['_changes']['find'](_0x303f07=>_0x303f07['id']===_0x541bf0);}['markAllChangesAsAccepted'](){for(const _0x2934be of this['_changes'])'pending'===_0x2934be['status']&&(_0x2934be['status']='accepted');this['_checkIfFinished']();}['markChangeAsAccepted'](_0x1d4362){const _0x5ace4a=this['_changes']['find'](_0x129cc8=>_0x129cc8['id']===_0x1d4362);_0x5ace4a&&'pending'===_0x5ace4a['status']&&(_0x5ace4a['status']='accepted'),this['_checkIfFinished']();}['markChangeAsRejected'](_0x4f69f3){const _0x2c1caf=this['_changes']['find'](_0x596188=>_0x596188['id']===_0x4f69f3);_0x2c1caf&&'pending'===_0x2c1caf['status']&&(_0x2c1caf['status']='rejected'),this['_checkIfFinished']();}['markChangeAsOutdated'](_0x5a7764){const _0x2a9204=this['_changes']['find'](_0x2cdfcc=>_0x2cdfcc['id']===_0x5a7764);_0x2a9204&&'pending'===_0x2a9204['status']&&(_0x2a9204['status']='outdated'),this['_checkIfFinished']();}['markChangeAsPending'](_0x45e71c){const _0x52367f=this['_changes']['find'](_0x1450e4=>_0x1450e4['id']===_0x45e71c);_0x52367f&&'outdated'===_0x52367f['status']&&(_0x52367f['status']='pending'),this['_checkIfFinished']();}['activateChange'](_0x3b7cde){this['_changes']['filter'](_0x451069=>_0x451069['isActivated']&&_0x451069['id']!==_0x3b7cde)['forEach'](_0x352c87=>{_0x352c87['isActivated']=!0x1;});const _0x2ef0b7=this['_changes']['find'](_0x283f12=>_0x283f12['id']===_0x3b7cde);_0x2ef0b7&&'pending'===_0x2ef0b7['status']&&(_0x2ef0b7['isActivated']=!0x0);}['deactivateChange'](){this['_changes']['filter'](_0xe332ae=>_0xe332ae['isActivated'])['forEach'](_0x46dbe0=>{_0x46dbe0['isActivated']=!0x1;});}['forceReadyState'](){this['status']='ready';}async['sendRating'](_0x463ff7){if('initialized'===this['status']||'loading'===this['status']||'data'===this['status']||this['_wasAborted'])return;if(!this['callId']||0x0===this['_changes']['length'])return;let _0x404c7a;if(_0x463ff7){const _0x45277d=this['_changes']['find'](_0x1ca718=>_0x1ca718['id']===_0x463ff7);if(_0x45277d&&_0x45277d['isRated'])return;_0x45277d&&(_0x404c7a=_0x45277d['parent']['id'],_0x45277d['isRated']=!0x0);}const _0x2ebd88={'positiveCount':this['_changes']['filter'](_0x2fd032=>'accepted'===_0x2fd032['status'])['length'],'totalCount':this['_changes']['length']};this['_sendRatingRequest'](_0x2ebd88,this['callId'],_0x404c7a);}['_addReviewCheckResult'](_0x2bb6b2,_0x1de3f4){const _0x5ecd96=this['_documentData']['elements']['get'](_0x2bb6b2);if(!_0x5ecd96)return;const _0x437361=_0x5ecd96['getContent']();if(_0x437361===_0x1de3f4)return;const _0x94c61c=new Ro({'id':_0x2bb6b2,'contentInitial':_0x437361,'contentNew':_0x1de3f4,'documentVersion':this['_documentData']['version']});this['_results']['set'](_0x94c61c['id'],_0x94c61c),this['fire']('reviewCheckResultAdded',{'result':_0x94c61c,'source':this});}['_checkIfFinished'](){'finished'===this['status']&&(this['_changes']['filter'](_0x2c4897=>'pending'===_0x2c4897['status'])['length']>0x0&&(this['status']='ready')),'ready'===this['status']&&(0x0===this['_changes']['filter'](_0x2cf08a=>'pending'===_0x2cf08a['status'])['length']&&(this['status']='finished'));}}class No extends ko{get['subTitle'](){if(!this['_reviewParams']||0x0===this['_reviewParams']['length'])return'';const _0x160cda=[];if(this['_reviewParams']['length']>0x0&&this['_sourceCheck']['options'])for(let _0x458b40=0x0;_0x458b40<this['_reviewParams']['length'];_0x458b40++){if(!this['_reviewParams'][_0x458b40]||!this['_sourceCheck']['options'][_0x458b40])continue;const _0x5d7034=this['_sourceCheck']['options'][_0x458b40],_0x4293d7=_0x5d7034['data']?.['find'](_0x2291f1=>_0x2291f1['id']===this['_reviewParams'][_0x458b40]);_0x4293d7&&_0x160cda['push'](_0x4293d7['label']);}return _0x160cda['join'](',\x20');}get['reviewName'](){return this['_composeReviewName']();}['_createApiRequest'](){return this['_aiConnector']['callSystemReview']({'reviewName':this['_composeReviewName'](),'content':this['_documentData']['content'],'args':this['_reviewArgs']});}['_sendRatingRequest'](_0xd9a817,_0x459ba4,_0x5cb1c4){return this['_aiConnector']['upsertAIReviewRating'](this['reviewName'],_0x459ba4,_0xd9a817,_0x5cb1c4);}['_composeReviewName'](){return!this['_reviewParams']||0x0===this['_reviewParams']['length']||this['_sourceCheck']['useArgs']?this['_sourceCheck']['apiId']:[this['_sourceCheck']['apiId'],...this['_reviewParams']]['join']('-');}}class vo extends _0x25e92e{['_aiConnector'];['_aiReviewCoreUi'];['_aiReviewCoreEditing'];['_aiReviewCheckList'];['_currentReviewCheckRun'];['_changeActivationSource']=null;static get['requires'](){return[ls];}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(_0x339bcd,_0x14014b)=>{const _0x971943=this['_aiReviewCheckList']['getCheckById'](_0x14014b['id']);if(_0x971943){this['_onReviewCheckRun'](_0x14014b),this['_aiReviewCoreEditing']['switchToReadOnly'](),this['_currentReviewCheckRun']=this['_createReviewCheckRun'](_0x14014b,_0x971943),this['_aiReviewCoreUi']['setCheckResultTitle'](this['_currentReviewCheckRun']['title'],this['_currentReviewCheckRun']['subTitle']),this['_currentReviewCheckRun']['on']('reviewCheckRunUpdated',(_0x2f0cff,_0x22ee22)=>{switch(_0x22ee22['status']){case'data':case'loading':this['_aiReviewCoreUi']['showCheckRunResults'](_0x22ee22);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 ht('ai-review-mode-check-run-general-error',this,void 0x0,this['_currentReviewCheckRun']?.['currentError']));break;case'error-chunk':this['_aiReviewCoreUi']['showChunkErrorView'](),this['_logError'](new ht('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'!==_0x22ee22['status']&&'error-chunk'!==_0x22ee22['status']&&'error-general'!==_0x22ee22['status']||this['_currentReviewCheckRun']?.['sendRating']();}),this['_currentReviewCheckRun']['on']('reviewCheckResultAdded',(_0x5ab790,_0x5e0dff)=>{if(!this['_currentReviewCheckRun'])throw new ht('ai-review-mode-no-current-check-run',this);const _0x3c1d39=this['_diffContent'](_0x5e0dff['result']['contentInitial'],_0x5e0dff['result']['contentNew']);_0x5e0dff['source']['addResultChanges'](_0x5e0dff['result']['id'],_0x3c1d39);}),this['_currentReviewCheckRun']['on']('reviewCheckResultReady',(_0x40d1fb,_0x716209)=>{for(const _0xe91fb3 of _0x716209['changes'])this['_aiReviewCoreUi']['showCheckRunResult'](_0xe91fb3);this['_markChangePositionInEditorContent'](_0x716209['changes'],_0x716209['source']['documentData']);}),this['_currentReviewCheckRun']['on']('reviewCheckResultChangeStatusUpdated',(_0x267f59,_0x1c8ee2)=>{this['_aiReviewCoreUi']['updateChangeState'](_0x1c8ee2['change']['id'],_0x1c8ee2['status']);}),this['_currentReviewCheckRun']['on']('reviewCheckResultActivated',(_0x1f4649,_0x9b05ab)=>{this['_onReviewCheckResultActivated'](_0x9b05ab);}),this['_currentReviewCheckRun']['on']('reviewCheckResultDeactivated',()=>{this['_onReviewCheckResultDeactivated']();});try{await this['_currentReviewCheckRun']['start']();}catch(_0x53d8d6){_0x53d8d6 instanceof Error&&_0x53d8d6['message']['includes']('ai-request-aborted')||(_0x53d8d6 instanceof ht?this['_logError'](_0x53d8d6):this['_logError'](new ht('ai-review-mode-check-run-failed',this,void 0x0,_0x53d8d6)));}}else this['_logError'](new ht('ai-review-mode-source-check-not-found',this,{'checkId':_0x14014b['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 _0x3a4fc4=this['_currentReviewCheckRun']['getActiveChanges']();if(!_0x3a4fc4['length'])return;this['_aiReviewCoreEditing']['applyChange'](_0x3a4fc4['map'](_0x1e687a=>_0x1e687a['id']));const _0x448b86=this['_currentReviewCheckRun'];_0x448b86['markAllChangesAsAccepted'](),_0x448b86['sendRating']();}),this['listenTo'](this['_aiReviewCoreUi'],'acceptChange',(_0x340a2c,_0xb4270e)=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['isChangeActive'](_0xb4270e['id'])&&(this['_aiReviewCoreEditing']['applyChange']([_0xb4270e['id']]),this['_currentReviewCheckRun']['markChangeAsAccepted'](_0xb4270e['id']),this['_aiReviewCoreUi']['hideChangeBalloon'](),this['_currentReviewCheckRun']['sendRating'](_0xb4270e['id']));}),this['listenTo'](this['_aiReviewCoreUi'],'dismissChange',(_0x53e7a1,_0x35239f)=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['isChangeActive'](_0x35239f['id'])&&(this['_aiReviewCoreEditing']['rejectChange'](_0x35239f['id']),this['_currentReviewCheckRun']['markChangeAsRejected'](_0x35239f['id']),this['_aiReviewCoreUi']['hideChangeBalloon'](),this['_currentReviewCheckRun']['sendRating'](_0x35239f['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',(_0x1cbbad,_0x2bdd56)=>{this['_onActivateChange'](_0x2bdd56);}),this['listenTo'](this['_aiReviewCoreUi'],'deactivateChange',(_0x1580a4,_0x4ae6af)=>{this['_onDeactivateChange'](_0x4ae6af);}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerClicked',(_0x1de803,_0x4ef661)=>{this['_onChangeMarkerClicked'](_0x1de803,_0x4ef661);}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerHovered',(_0x545ed0,_0xdc2156)=>{this['_onChangeMarkerHovered'](_0x545ed0,_0xdc2156);}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerBlurred',()=>{this['_onChangeMarkerBlurred']();}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerRemoved',(_0x2cb7a9,_0x2a8cc9)=>{this['_onChangeMarkerRemoved'](_0x2cb7a9,_0x2a8cc9);}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerRestored',(_0x529b0d,_0x510706)=>{this['_onChangeMarkerRestored'](_0x529b0d,_0x510706);});}['_createReviewCheckRun'](_0x5b7b23,_0x125073){return new No(this['_aiReviewCoreEditing']['getDocumentData'](),_0x125073,this['_aiConnector'],_0x5b7b23['params'],_0x5b7b23['args']);}['_onChangeMarkerRemoved'](_0xf3b196,_0x51c174){this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['markChangeAsOutdated'](_0x51c174['changeId']);}['_onChangeMarkerRestored'](_0x3c4862,_0x53aa67){this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['markChangeAsPending'](_0x53aa67['changeId']);}['_onCheckRunFinished'](){this['_aiReviewCoreUi']['showReviewCompletedView']();}['_initRequiredPlugins'](){this['_aiConnector']=this['context']['plugins']['get']('AIConnector');}['_onReviewRunLeave'](_0x25fe7d=!0x1){this['_currentReviewCheckRun']&&(this['_currentReviewCheckRun']['hasModifications']||this['_currentReviewCheckRun']['sendRating'](),this['_currentReviewCheckRun']['stopListening'](),this['_currentReviewCheckRun']['abort'](),this['_currentReviewCheckRun']=void 0x0),_0x25fe7d&&this['_aiReviewCoreUi']['showReviewCheckList'](),this['_aiReviewCoreEditing']['clearAllMarkers'](),this['_aiReviewCoreEditing']['switchToEdit'](),this['_changeActivationSource']=null;const _0x1bcfe9=this['_aiReviewCoreEditing']['getEditor']();_0x1bcfe9&&_0x1bcfe9['editing']['view']['change'](_0x3202b2=>{const _0x31fdb8=_0x1bcfe9['editing']['view']['document']['getRoot']();_0x3202b2['removeClass']('ck-ai_review-diff',_0x31fdb8),_0x3202b2['removeClass']('ck-ai_review-highlights',_0x31fdb8),_0x3202b2['removeClass']('ck-ai-translate-mode-content',_0x31fdb8);});}['_getTranslationWithDefault'](_0x4958a2,_0x490011){const _0x1657e6=us(this['context']['locale'],_0x4958a2);return _0x1657e6===_0x4958a2?_0x490011:_0x1657e6;}['_logError'](_0x3ed248,_0x10eb60=!0x1){mt(_0x3ed248['message']),_0x10eb60||(_0x3ed248['message']['startsWith']('ai-review-mode-models-unable-to-retrieve')?this['_aiReviewCoreUi']['showGeneralReviewCoreErrorView']():this['_aiReviewCoreUi']['showGeneralResultsErrorView']());}['_scrollToChange'](_0x5038ad){if('content'===this['_changeActivationSource']){const _0x48f5a5=this['_aiReviewCoreUi']['getChangeElement'](_0x5038ad);_0x48f5a5&&ft(_0x48f5a5['closest']('.ck-ai_review__check-run-result')||_0x48f5a5);}else{if('panel'===this['_changeActivationSource']){const _0x84d9b9=this['_getChangeContentElement'](_0x5038ad);if(!_0x84d9b9)return;Ct({'target':_0x84d9b9,'viewportOffset':{'top':0x55,'left':0x0,'bottom':0x0,'right':0x0},'ancestorOffset':0x14,'alignToTop':!0x0});}}}}const yo=[{'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 xo{['id'];['commandId'];['title'];['description'];['isParameterized'];['useArgs'];['options'];['args'];get['apiId'](){return this['commandId'];}constructor(_0x5884b4){this['id']=_0x5884b4['id'],this['commandId']=_0x5884b4['commandId'],this['title']=_0x5884b4['title'],this['description']=_0x5884b4['description'],this['isParameterized']=_0x5884b4['isParameterized'],this['useArgs']=_0x5884b4['useArgs'],this['options']=_0x5884b4['options'],this['args']=_0x5884b4['args'];}}class Lo extends ct(){['_checks']=[];['setupChecks'](_0x4cf581){this['_checks']=_0x4cf581['map'](_0x4c12d6=>new xo(_0x4c12d6));}get['checks'](){return this['_checks'];}['getCheckById'](_0x84515e){return this['checks']['find'](_0x368f63=>_0x368f63['id']===_0x84515e);}['removeCheckById'](_0x46b1d9){this['_checks']=this['_checks']['filter'](_0x52cc2e=>_0x52cc2e['id']!==_0x46b1d9);}}class Do extends xo{['_models']=[];['_defaultModel']=null;constructor(_0x377744,_0x17df70,_0x4331e9){super(_0x377744),this['_models']=_0x17df70,this['_defaultModel']=_0x4331e9;}get['models'](){return this['_models'];}get['defaultModel'](){return this['_defaultModel'];}}class Po extends xo{['isExtra']=!0x0;['prompt'];['model'];['_defaultModel']=null;constructor(_0x3c2a5f,_0x55da3a,_0xc00f90){super(_0x3c2a5f),this['prompt']=_0x3c2a5f['prompt'],this['model']=_0x3c2a5f['model'],this['model']?this['_defaultModel']=_0x55da3a['find'](_0x40902e=>_0x40902e['id']===this['model'])||null:this['_defaultModel']=_0xc00f90;}get['defaultModel'](){return this['_defaultModel'];}}class Ho extends Lo{['_allModels']=[];['_recommendedModels']=[];['_defaultModel']=null;constructor(_0x4dee96,_0x5e29ee,_0xe65861){super(),this['_allModels']=_0x4dee96,this['_recommendedModels']=_0x5e29ee,this['_defaultModel']=_0xe65861;}['setupChecks'](_0x2efc8c){this['_checks']=_0x2efc8c['map'](_0x5e043d=>!0x0===_0x5e043d['isExtra']?new Po(_0x5e043d,this['_allModels'],this['_defaultModel']):'custom'===_0x5e043d['id']?new Do(_0x5e043d,this['_recommendedModels'],this['_defaultModel']):new xo(_0x5e043d));}}class Mo extends ko{['_prompt'];['_model'];constructor(_0x5c02da,_0x39a9d1,_0x1cbdef,_0x23678e,_0x58aef7){super(_0x1cbdef,_0x23678e,_0x58aef7),this['_prompt']=_0x5c02da,this['_model']=_0x39a9d1;}get['subTitle'](){return this['_prompt'];}['_createApiRequest'](){return this['_aiConnector']['callCustomReview']({'content':this['_documentData']['content'],'prompt':this['_prompt'],'model':this['_model']});}['_sendRatingRequest'](_0x278248,_0x37286d,_0xeb5f55){return this['_aiConnector']['upsertCustomAIReviewRating'](_0x37286d,_0x278248,_0xeb5f55);}}class Uo extends Mo{get['subTitle'](){return'';}set['prompt'](_0x18918a){this['_prompt']=_0x18918a;}set['model'](_0x41c00a){this['_model']=_0x41c00a;}}class Vo extends vo{static get['pluginName'](){return'AIReviewModeController';}['_isDiffOn']=!0x1;['_hasDefaultAvailableCommands']=!0x1;constructor(_0x2bd23a){super(_0x2bd23a),this['_hasDefaultAvailableCommands']=!this['context']['config']['get']('ai.review.availableCommands'),this['context']['config']['define']('ai.review.availableCommands',yo['map'](_0x50350a=>_0x50350a['id'])),this['context']['config']['define']('ai.review.extraCommands',[]);}async['init'](){await super['init'](),this['listenTo'](this['_aiReviewCoreUi'],'toggleDiff',(_0x5c78eb,_0x5aea3b)=>{this['_isDiffOn']=_0x5aea3b['on'],this['_onDiffChange'](this['_isDiffOn']);});}['_initRequiredPlugins'](){super['_initRequiredPlugins'](),this['_aiReviewCoreUi']=this['context']['plugins']['get']('AIReviewModeUI'),this['_aiReviewCoreEditing']=this['context']['plugins']['get']('AIReviewCoreEditing');}['_createReviewCheckRun'](_0x276487,_0x3f5896){return _0x276487['isCustom']?new Mo(_0x276487['args']['prompt'],_0x276487['args']['model'],this['_aiReviewCoreEditing']['getDocumentData'](),_0x3f5896,this['_aiConnector']):_0x3f5896['isExtra']?new Uo(_0x3f5896['prompt'],_0x3f5896['defaultModel']['id'],this['_aiReviewCoreEditing']['getDocumentData'](),_0x3f5896,this['_aiConnector']):new No(this['_aiReviewCoreEditing']['getDocumentData'](),_0x3f5896,this['_aiConnector'],_0x276487['params'],_0x276487['args']);}['_onReviewCheckResultActivated'](_0x5f1190){this['_aiReviewCoreUi']['setActiveStateInResults'](_0x5f1190['change']['id']),this['_scrollToChange'](_0x5f1190['change']['id']);const _0x3b4f0e=this['_aiReviewCoreEditing']['getMarkerElementForChange'](_0x5f1190['change']['id']);if(!_0x3b4f0e)return;const _0x3f31d5=this['_aiReviewCoreEditing']['getEditor']();this['_aiReviewCoreUi']['showChangeBalloon'](_0x5f1190['change'],()=>_0x3b4f0e['getElement'](),void 0x0,'click',_0x3f31d5?.['editing']?.['view']?.['getDomRoot'](),_0x3f31d5?.['ui']?.['viewportOffset']),this['_aiReviewCoreEditing']['setMarkersInElementAsActive'](_0x5f1190['change']['id']);}['_onReviewCheckResultDeactivated'](){this['_aiReviewCoreUi']['resetActiveStateInResults'](),this['_aiReviewCoreUi']['hideChangeBalloon'](),this['_aiReviewCoreEditing']['setAllMarkersAsInactive']();}['_onActivateChange'](_0x501b8e){this['_currentReviewCheckRun']&&'click'===_0x501b8e['uiInteraction']&&(this['_changeActivationSource']='panel',this['_currentReviewCheckRun']['activateChange'](_0x501b8e['id']));}['_onDeactivateChange'](_0xcb6bd5){this['_currentReviewCheckRun']&&'balloon'===_0xcb6bd5['origin']&&this['_currentReviewCheckRun']['deactivateChange']();}['_onChangeMarkerClicked'](_0x1b28ed,_0x22a9aa){if(!this['_currentReviewCheckRun'])return;this['_changeActivationSource']='content',this['_currentReviewCheckRun']['activateChange'](_0x22a9aa['changeId']);const _0x5a84be=this['_currentReviewCheckRun']['getChangeById'](_0x22a9aa['changeId']);if(!_0x5a84be)return;const _0x513bd8=this['_aiReviewCoreEditing']['getEditor']();this['_aiReviewCoreUi']['showChangeBalloon'](_0x5a84be,_0x22a9aa['markerElement'],_0x22a9aa['domEvent'],'click',_0x513bd8?.['editing']?.['view']?.['getDomRoot'](),_0x513bd8?.['ui']?.['viewportOffset']);}['_onChangeMarkerHovered'](_0x51435f,_0x553627){if(!this['_currentReviewCheckRun'])return;if(this['_currentReviewCheckRun']['isAnyChangeActivated']())return;const _0x34b8e6=this['_currentReviewCheckRun']['getChangeById'](_0x553627['changeId']);if(!_0x34b8e6)return;const _0x430d78=this['_aiReviewCoreEditing']['getEditor']();this['_aiReviewCoreUi']['showChangeBalloon'](_0x34b8e6,_0x553627['markerElement'],_0x553627['domEvent'],'hover',_0x430d78?.['editing']?.['view']?.['getDomRoot'](),_0x430d78?.['ui']?.['viewportOffset']);}['_onChangeMarkerBlurred'](){if(!this['_currentReviewCheckRun'])return;this['_currentReviewCheckRun']['isAnyChangeActivated']()||this['_aiReviewCoreUi']['hideChangeBalloon']();}['_getChangeContentElement'](_0x1a246f){const _0x264f67=this['_aiReviewCoreEditing']['getMarkerElementForChange'](_0x1a246f);return _0x264f67?_0x264f67['getElement']():null;}['_markChangePositionInEditorContent'](_0x2a4fcd,_0x26936c){this['_aiReviewCoreEditing']['markChangePositionInEditorContent'](_0x2a4fcd,_0x26936c);}['_diffContent'](_0xe88dd3,_0x20eb65){return this['_aiReviewCoreEditing']['diffContent'](_0xe88dd3,_0x20eb65);}['_onReviewCheckRun'](){this['_onDiffChange'](this['_isDiffOn']);}['_onDiffChange'](_0x2f29fa){const _0x3e4181=this['_aiReviewCoreEditing']['getEditor']();_0x2f29fa?this['_aiReviewCoreUi']['hideDiffInBalloon']():this['_aiReviewCoreUi']['showDiffInBalloon'](),_0x3e4181&&_0x3e4181['editing']['view']['change'](_0x20834c=>{const _0x4b8068=_0x3e4181['editing']['view']['document']['getRoot']();for(const _0x3515e0 of _0x4b8068['getClassNames']())_0x3515e0['startsWith']('ck-ai_review-')&&_0x20834c['removeClass'](_0x3515e0,_0x4b8068);_0x20834c['addClass'](_0x2f29fa?'ck-ai_review-diff':'ck-ai_review-highlights',_0x4b8068);});}async['_getChecksList'](){const _0x24460d=[...yo,...this['_getExtraChecks']()],_0x38064c=this['context']['config']['get']('ai.review.availableCommands')||[];this['_logErrorForNonExistentChecks'](_0x38064c,_0x24460d);let _0x137e52=_0x24460d;this['_hasDefaultAvailableCommands']||(_0x137e52=_0x38064c['map'](_0x381236=>_0x24460d['find'](_0x3ee5a2=>_0x3ee5a2['id']===_0x381236))['filter'](_0x255443=>!!_0x255443)),_0x137e52=_0x137e52['map'](_0x468ee6=>_0x468ee6['isExtra']?_0x468ee6:this['_translateReviewCheck'](_0x468ee6));const _0x2bdf2c=_0x137e52['some'](_0x13d59e=>_0x13d59e['isExtra']||'custom'===_0x13d59e['id']);let _0x45a2a6=[],_0x412b7e=[],_0x42e9fc=null;if(_0x2bdf2c){const _0x453733=await this['_getModels']();_0x45a2a6=_0x453733['all'],_0x412b7e=_0x453733['recommended'],_0x42e9fc=_0x453733['default'];}const _0x2d7221=new Ho(_0x45a2a6,_0x412b7e,_0x42e9fc);return _0x2d7221['setupChecks'](_0x137e52),_0x2bdf2c&&this['_filterChecksWithMissingModel'](_0x2d7221),_0x2d7221;}['_getExtraChecks'](){return(this['context']['config']['get']('ai.review.extraCommands')||[])['map'](_0xac39ae=>({'id':_0xac39ae['id'],'commandId':_0xac39ae['id'],'title':_0xac39ae['label'],'description':_0xac39ae['description'],'isParameterized':!0x1,'isExtra':!0x0,'prompt':_0xac39ae['prompt'],'model':_0xac39ae['model']}));}['_logErrorForNonExistentChecks'](_0x217701,_0x11dc2c){const _0x1fd7e0=_0x217701['filter'](_0x4dbcf2=>!_0x11dc2c['some'](_0x1db31d=>_0x1db31d['id']===_0x4dbcf2));_0x1fd7e0['length']&&this['_logError'](new ht('ai-review-mode-non-existent-commands-used',this,{'commandIds':_0x1fd7e0['join'](',\x20')}),!0x0);}async['_getModels'](){try{const _0x344764=new qs({'connector':this['_aiConnector'],'config':this['context']['config']['get']('ai.models'),'locale':this['context']['locale']});return{'all':await _0x344764['getAll'](),'recommended':await _0x344764['getAvailableModels'](),'default':await _0x344764['getDefault']()};}catch(_0x118d0d){return this['_logError'](new ht('ai-review-mode-models-unable-to-retrieve',this,void 0x0,_0x118d0d)),{'all':[],'recommended':[],'default':null};}}['_translateReviewCheck'](_0x10b69c){const _0x260601='AI_REVIEW_CHECK_'+_0x10b69c['id']['toUpperCase']()['replaceAll']('-','_'),_0x1d9280={..._0x10b69c,'title':this['_getTranslationWithDefault'](_0x260601+'_TITLE',_0x10b69c['title']),'description':this['_getTranslationWithDefault'](_0x260601+'_DESCRIPTION',_0x10b69c['description'])};return _0x10b69c['options']&&(_0x1d9280['options']=_0x10b69c['options']['map'](_0x388851=>({..._0x388851,'label':this['_getTranslationWithDefault'](_0x260601+'_OPTIONS_LABEL',_0x388851['label']||''),'data':_0x388851['data']?_0x388851['data']['map'](_0x78c5e0=>({..._0x78c5e0,'label':this['_getTranslationWithDefault'](_0x260601+'_OPTIONS_DATA_'+_0x78c5e0['id']['toUpperCase'](),_0x78c5e0['label'])})):void 0x0}))),_0x1d9280;}['_filterChecksWithMissingModel'](_0x26a796){const _0x21fb84=[];_0x26a796['checks']['forEach'](_0x504f1f=>{(_0x504f1f instanceof Po&&!_0x504f1f['defaultModel']||_0x504f1f instanceof Do&&!_0x504f1f['models']['length'])&&_0x21fb84['push'](_0x504f1f['id']);}),_0x21fb84['length']&&_0x21fb84['forEach'](_0x4952e1=>{_0x26a796['removeCheckById'](_0x4952e1),this['_logError'](new ht('ai-review-mode-command-unavailable-due-to-missing-model',this,{'commandId':_0x4952e1}),!0x0);});}}class Bo extends _0x25e92e{static get['requires'](){return[Vo,fo,bo];}static get['pluginName'](){return'AIReviewMode';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class Go extends xo{get['apiId'](){return'translate';}}class Fo extends Lo{['setupChecks'](_0xa47c0b){this['_checks']=_0xa47c0b['map'](_0x5df764=>new Go(_0x5df764));}}class Ko extends No{['_title'];constructor(_0x34a6cb,_0x17768f,_0x379350,_0x59661f,_0x4272ae,_0x533fc2){super(_0x34a6cb,_0x17768f,_0x379350,_0x4272ae,_0x533fc2),this['_title']=_0x59661f;}get['title'](){return this['_title'];}get['subTitle'](){return this['_sourceCheck']['title'];}}class Wo extends vo{static get['pluginName'](){return'AITranslateController';}constructor(_0x5ccc75){super(_0x5ccc75),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'](_0x31c4a6,_0x443f90){return new Ko(this['_aiReviewCoreEditing']['getDocumentData'](),_0x443f90,this['_aiConnector'],us(this['context']['locale'],'AI_REVIEW_CHECK_TRANSLATE_TITLE'),_0x31c4a6['params'],_0x31c4a6['args']);}['_onReviewCheckResultActivated'](_0x47c5dc){this['_aiReviewCoreUi']['setActiveStateInResults'](_0x47c5dc['change']['id']),this['_aiReviewCoreEditing']['setMarkersInElementAsActive'](_0x47c5dc['change']['id']);}['_onReviewCheckResultDeactivated'](){this['_aiReviewCoreEditing']['setAllMarkersAsInactive'](),this['_aiReviewCoreUi']['resetActiveStateInResults']();}['_onActivateChange'](_0x4cdf85){this['_currentReviewCheckRun']&&('hover'===_0x4cdf85['uiInteraction']&&(this['_changeActivationSource']='panel',this['_currentReviewCheckRun']['activateChange'](_0x4cdf85['id'])),'click'===_0x4cdf85['uiInteraction']&&this['_scrollToChange'](_0x4cdf85['id']));}['_onDeactivateChange'](_0x2432e4){this['_currentReviewCheckRun']&&'panel'===_0x2432e4['origin']&&this['_currentReviewCheckRun']['deactivateChange']();}['_onChangeMarkerClicked'](_0x382d5c,_0x408187){this['_currentReviewCheckRun']&&(this['_changeActivationSource']='content',this['_currentReviewCheckRun']['activateChange'](_0x408187['changeId']),this['_scrollToChange'](_0x408187['changeId']));}['_onChangeMarkerHovered'](_0x41a55a,_0x384f92){this['_currentReviewCheckRun']&&(this['_changeActivationSource']='content',this['_currentReviewCheckRun']['activateChange'](_0x384f92['changeId']),this['_aiReviewCoreEditing']['reactivateMarkers'](_0x384f92['changeId']));}['_onChangeMarkerBlurred'](){this['_currentReviewCheckRun']&&'content'===this['_changeActivationSource']&&(this['_currentReviewCheckRun']['deactivateChange'](),this['_aiReviewCoreEditing']['setAllMarkersAsInactive']());}['_getChangeContentElement'](_0x1f0664){return this['_aiReviewCoreEditing']['getContentElementForChange'](_0x1f0664);}['_markChangePositionInEditorContent'](_0x3140d2,_0x18f00e){this['_aiReviewCoreEditing']['markChangePositionInEditorContent'](_0x3140d2,_0x18f00e);}['_diffContent'](_0x2b6918,_0x5b851d){return this['_aiReviewCoreEditing']['diffContent'](_0x2b6918,_0x5b851d,!0x0);}['_onReviewCheckRun'](){const _0x8a7ea0=this['_aiReviewCoreEditing']['getEditor']();_0x8a7ea0&&_0x8a7ea0['editing']['view']['change'](_0x1d867a=>{const _0x4f6332=_0x8a7ea0['editing']['view']['document']['getRoot']();for(const _0xa32481 of _0x4f6332['getClassNames']())(_0xa32481['startsWith']('ck-ai-review-')||'ck-ai-translate-'===_0xa32481)&&_0x1d867a['removeClass'](_0xa32481,_0x4f6332);_0x1d867a['addClass']('ck-ai-translate-mode-content',_0x4f6332);});}async['_getChecksList'](){const _0x424f6f=[],_0x2351c8=this['context']['config']['get']('ai.translate.languages')||[];for(const _0x4d7c4a of _0x2351c8)_0x424f6f['push']({'title':_0x4d7c4a['label'],'id':_0x4d7c4a['id'],'commandId':_0x4d7c4a['id'],'description':'','isParameterized':!0x1,'useArgs':!0x0,'args':{'language':_0x4d7c4a['id']}});const _0x18988d=new Fo();return _0x18988d['setupChecks'](this['_translateChecks'](_0x424f6f)),_0x18988d;}['_translateChecks'](_0x48cb16){return _0x48cb16['map'](_0x22bac7=>{const _0xb831b4='AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_'+_0x22bac7['title']['toUpperCase']()['replaceAll']('-','_');return{..._0x22bac7,'title':this['_getTranslationWithDefault'](_0xb831b4,_0x22bac7['title'])};});}}class Yo extends _o{constructor(_0x2876da,_0x1a9426){super(_0x2876da,_0x1a9426),this['on']('set:isLoading',(_0x3129cd,_0x23b6e8,_0x375d74)=>{_0x375d74&&(this['headerTitle']=us(this['locale'],'AI_TRANSLATE_CHECK_RESULTS_LOADING_TITLE'));}),this['on']('set:isResultReady',(_0x31d9c3,_0x467366,_0x3fe3c8)=>{_0x3fe3c8&&(this['headerTitle']=us(this['locale'],'AI_TRANSLATE_CHECK_RESULTS_READY_TITLE'));});}['_createAcceptAllButtonView'](){const _0x1ac7da=super['_createAcceptAllButtonView']();return _0x1ac7da['set']('label',us(this['locale'],'AI_TRANSLATE_ACCEPT_ALL')),_0x1ac7da;}['_createExitReviewButtonView'](){const _0x34432e=super['_createExitReviewButtonView']();return _0x34432e['set']('label',us(this['locale'],'AI_CHAT_HISTORY_CANCEL')),_0x34432e;}}class $o extends wo{['_setupTemplate'](){const _0x42eef7=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-translate__check-list-wrapper',_0x42eef7['if']('isVisible','ck-hidden',_0x55e26a=>!_0x55e26a)]},'children':[{'tag':'div','attributes':{'class':['ck-ai-translate__check-list-header']},'children':[{'tag':'h2','children':[{'text':us(this['locale'],'AI_TRANSLATE_CHECK_LIST_HEADER_TITLE')}]},{'tag':'p','children':[{'text':us(this['locale'],'AI_TRANSLATE_CHECK_LIST_HEADER_DESCRIPTION')}]}]},{'tag':'div','attributes':{'class':['ck-ai_review__check-list',_0x42eef7['if']('isVisible','ck-hidden',_0x571cd7=>!_0x571cd7)]},'children':this['_checkViews']}]});}}class qo extends ho{static get['pluginName'](){return'AITranslateUI';}['createMainView'](){const _0x4a7962=this['context']['locale'],_0x53c7d2=new _0x16cf91(_0x4a7962,{'label':us(_0x4a7962,'AI_REVIEW_CHECK_TRANSLATE_TITLE'),'icon':_0x4f4fba,'class':'ck-ai-header\x20ck-ai-header_review-translate'}),_0xcaa0e0=new lo(_0x4a7962,{'header':_0x53c7d2,'list':new $o(_0x4a7962),'results':new Yo(_0x4a7962,{'generalErrorText':us(_0x4a7962,'AI_TRANSLATE_GENERAL_ERROR_MESSAGE')}),'completed':new Ao(_0x4a7962,{'headerText':us(_0x4a7962,'AI_TRANSLATE_FINISH_HEADER_TITLE'),'emptyResultsText':us(_0x4a7962,'AI_TRANSLATE_EMPTY_RESULTS_TEXT'),'buttonText':us(_0x4a7962,'AI_TRANSLATE_FINISH_BUTTON_LABEL')})});return _0xcaa0e0['extendTemplate']({'attributes':{'class':'ck-ai-translate-mode'}}),_0xcaa0e0;}['registerTab'](){const _0x77eb8=this['context']['plugins']['get']('AITabs');_0x77eb8['view']['on']('activateTab',(_0x2ef807,_0x5c9913)=>{'translate'===_0x5c9913?this['fire']('getReviewCheckList'):this['fire']('leaveReview');}),_0x77eb8['view']['addTab']({'id':'translate','buttonLabel':us(this['context']['locale'],'AI_REVIEW_CHECK_TRANSLATE_TITLE'),'buttonIcon':_0x4f4fba,'order':0x0,'content':this['_mainView']});}}class Qo extends _0x25e92e{static get['requires'](){return[Wo,qo,bo];}static get['pluginName'](){return'AITranslate';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}export{eo as AIActions,io as AIActionsNames,Ni as AIAdapter,Ji as AIAssistant,Xi as AIAssistantUI,ka as AIBalloon,Ea as AIChat,Js as AIChatController,Ia as AIChatHistory,ga as AIChatHistoryController,da as AIChatHistoryUI,wa as AIChatShortcuts,aa as AIChatUI,ls as AIConnector,tn as AIEditing,La as AIEditorIntegration,no as AIQuickActionType,so as AIQuickActions,Ya as AIQuickActionsUI,vi as AIRequestError,xo as AIReviewCheck,Ro as AIReviewCheckResult,ko as AIReviewCheckRun,Bo as AIReviewMode,vo as AIReviewModeController,bo as AIReviewModeEditing,fo as AIReviewModeUI,cs as AITabs,ts as AITextAdapter,Sa as AIToggleButtonUI,Qo as AITranslate,Wo as AITranslateController,qo as AITranslateUI,is as AWSTextAdapter,es as OpenAITextAdapter,xi as ShowAIAssistantCommand,fa as ToggleAICommand,gs as createResizeButton,Zi as getDefaultAICommands};