@ckeditor/ckeditor5-ai 48.0.0-alpha.11 → 48.0.0-alpha.12
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.
- package/dist/index.js +6 -6
- package/dist/translations/af.js +1 -1
- package/dist/translations/af.umd.js +1 -1
- package/dist/translations/ar.js +1 -1
- package/dist/translations/ar.umd.js +1 -1
- package/dist/translations/ast.js +1 -1
- package/dist/translations/ast.umd.js +1 -1
- package/dist/translations/az.js +1 -1
- package/dist/translations/az.umd.js +1 -1
- package/dist/translations/be.js +1 -1
- package/dist/translations/be.umd.js +1 -1
- package/dist/translations/bg.js +1 -1
- package/dist/translations/bg.umd.js +1 -1
- package/dist/translations/bn.js +1 -1
- package/dist/translations/bn.umd.js +1 -1
- package/dist/translations/bs.js +1 -1
- package/dist/translations/bs.umd.js +1 -1
- package/dist/translations/ca.js +1 -1
- package/dist/translations/ca.umd.js +1 -1
- package/dist/translations/cs.js +1 -1
- package/dist/translations/cs.umd.js +1 -1
- package/dist/translations/da.js +1 -1
- package/dist/translations/da.umd.js +1 -1
- package/dist/translations/de-ch.js +1 -1
- package/dist/translations/de-ch.umd.js +1 -1
- package/dist/translations/de.js +1 -1
- package/dist/translations/de.umd.js +1 -1
- package/dist/translations/el.js +1 -1
- package/dist/translations/el.umd.js +1 -1
- package/dist/translations/en-au.js +1 -1
- package/dist/translations/en-au.umd.js +1 -1
- package/dist/translations/en-gb.js +1 -1
- package/dist/translations/en-gb.umd.js +1 -1
- package/dist/translations/en.js +1 -1
- package/dist/translations/en.umd.js +1 -1
- package/dist/translations/eo.js +1 -1
- package/dist/translations/eo.umd.js +1 -1
- package/dist/translations/es-co.js +1 -1
- package/dist/translations/es-co.umd.js +1 -1
- package/dist/translations/es.js +1 -1
- package/dist/translations/es.umd.js +1 -1
- package/dist/translations/et.js +1 -1
- package/dist/translations/et.umd.js +1 -1
- package/dist/translations/eu.js +1 -1
- package/dist/translations/eu.umd.js +1 -1
- package/dist/translations/fa.js +1 -1
- package/dist/translations/fa.umd.js +1 -1
- package/dist/translations/fi.js +1 -1
- package/dist/translations/fi.umd.js +1 -1
- package/dist/translations/fr.js +1 -1
- package/dist/translations/fr.umd.js +1 -1
- package/dist/translations/gl.js +1 -1
- package/dist/translations/gl.umd.js +1 -1
- package/dist/translations/gu.js +1 -1
- package/dist/translations/gu.umd.js +1 -1
- package/dist/translations/he.js +1 -1
- package/dist/translations/he.umd.js +1 -1
- package/dist/translations/hi.js +1 -1
- package/dist/translations/hi.umd.js +1 -1
- package/dist/translations/hr.js +1 -1
- package/dist/translations/hr.umd.js +1 -1
- package/dist/translations/hu.js +1 -1
- package/dist/translations/hu.umd.js +1 -1
- package/dist/translations/hy.js +1 -1
- package/dist/translations/hy.umd.js +1 -1
- package/dist/translations/id.js +1 -1
- package/dist/translations/id.umd.js +1 -1
- package/dist/translations/it.js +1 -1
- package/dist/translations/it.umd.js +1 -1
- package/dist/translations/ja.js +1 -1
- package/dist/translations/ja.umd.js +1 -1
- package/dist/translations/jv.js +1 -1
- package/dist/translations/jv.umd.js +1 -1
- package/dist/translations/kk.js +1 -1
- package/dist/translations/kk.umd.js +1 -1
- package/dist/translations/km.js +1 -1
- package/dist/translations/km.umd.js +1 -1
- package/dist/translations/kn.js +1 -1
- package/dist/translations/kn.umd.js +1 -1
- package/dist/translations/ko.js +1 -1
- package/dist/translations/ko.umd.js +1 -1
- package/dist/translations/ku.js +1 -1
- package/dist/translations/ku.umd.js +1 -1
- package/dist/translations/lt.js +1 -1
- package/dist/translations/lt.umd.js +1 -1
- package/dist/translations/lv.js +1 -1
- package/dist/translations/lv.umd.js +1 -1
- package/dist/translations/ms.js +1 -1
- package/dist/translations/ms.umd.js +1 -1
- package/dist/translations/nb.js +1 -1
- package/dist/translations/nb.umd.js +1 -1
- package/dist/translations/ne.js +1 -1
- package/dist/translations/ne.umd.js +1 -1
- package/dist/translations/nl.js +1 -1
- package/dist/translations/nl.umd.js +1 -1
- package/dist/translations/no.js +1 -1
- package/dist/translations/no.umd.js +1 -1
- package/dist/translations/oc.js +1 -1
- package/dist/translations/oc.umd.js +1 -1
- package/dist/translations/pl.js +1 -1
- package/dist/translations/pl.umd.js +1 -1
- package/dist/translations/pt-br.js +1 -1
- package/dist/translations/pt-br.umd.js +1 -1
- package/dist/translations/pt.js +1 -1
- package/dist/translations/pt.umd.js +1 -1
- package/dist/translations/ro.js +1 -1
- package/dist/translations/ro.umd.js +1 -1
- package/dist/translations/ru.js +1 -1
- package/dist/translations/ru.umd.js +1 -1
- package/dist/translations/si.js +1 -1
- package/dist/translations/si.umd.js +1 -1
- package/dist/translations/sk.js +1 -1
- package/dist/translations/sk.umd.js +1 -1
- package/dist/translations/sl.js +1 -1
- package/dist/translations/sl.umd.js +1 -1
- package/dist/translations/sq.js +1 -1
- package/dist/translations/sq.umd.js +1 -1
- package/dist/translations/sr-latn.js +1 -1
- package/dist/translations/sr-latn.umd.js +1 -1
- package/dist/translations/sr.js +1 -1
- package/dist/translations/sr.umd.js +1 -1
- package/dist/translations/sv.js +1 -1
- package/dist/translations/sv.umd.js +1 -1
- package/dist/translations/th.js +1 -1
- package/dist/translations/th.umd.js +1 -1
- package/dist/translations/ti.js +1 -1
- package/dist/translations/ti.umd.js +1 -1
- package/dist/translations/tk.js +1 -1
- package/dist/translations/tk.umd.js +1 -1
- package/dist/translations/tr.js +1 -1
- package/dist/translations/tr.umd.js +1 -1
- package/dist/translations/tt.js +1 -1
- package/dist/translations/tt.umd.js +1 -1
- package/dist/translations/ug.js +1 -1
- package/dist/translations/ug.umd.js +1 -1
- package/dist/translations/uk.js +1 -1
- package/dist/translations/uk.umd.js +1 -1
- package/dist/translations/ur.js +1 -1
- package/dist/translations/ur.umd.js +1 -1
- package/dist/translations/uz.js +1 -1
- package/dist/translations/uz.umd.js +1 -1
- package/dist/translations/vi.js +1 -1
- package/dist/translations/vi.umd.js +1 -1
- package/dist/translations/zh-cn.js +1 -1
- package/dist/translations/zh-cn.umd.js +1 -1
- package/dist/translations/zh.js +1 -1
- package/dist/translations/zh.umd.js +1 -1
- package/package.json +12 -12
package/dist/index.js
CHANGED
|
@@ -20,9 +20,9 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
import{Plugin as _0x2dfd9d,Command as _0x335282,ContextPlugin as _0x1aa7e1,Editor as _0xbeb021}from'@ckeditor/ckeditor5-core/dist/index.js';import{IconCopy as _0x5ed933,IconCheck as _0x2bffb7,IconError as _0xfd1c0b,IconSubmit as _0x2f55c0,IconAIHistory as _0x38f93d,IconMagicWand as _0x3b98e8,IconRobotPencil as _0x15ae43,IconMaximize as _0x3740f2,IconMinimize as _0x1b9793,IconShowChangesOn as _0x381746,IconShowChangesOff as _0x40fc31,IconDocument as _0x4dad6b,IconBoxWithCross as _0x1c22f1,IconBoxWithCheck as _0x32b9f4,IconBoxWithMarker as _0x397e2a,IconInfo as _0x5689fd,IconWeb as _0x12d01f,IconCancel as _0x101f07,IconSelection as _0x47c1bc,IconFileUpload as _0x467af8,IconLink as _0x108376,IconBulb as _0x1c694e,IconAI as _0x5ebaaf,IconPreviousArrow as _0x3429b1,IconDocumentOutline as _0x123b6a,IconLoupe as _0x5e42ce,IconPaperClip as _0x481b9b,IconBrowseFiles as _0x50a9f0,IconDropdownArrow as _0x52b6b2,IconStop as _0x914ad1,IconAIChat as _0x1f2170,IconPlus as _0x15dcd7,IconPin as _0x4208c7,IconThreeHorizontalDots as _0x2b9494,IconAIReview as _0x15e910,IconAITranslate as _0x16125b,IconAIAskAI as _0x22c2b9,IconThumbUp as _0x49edf9,IconThumbDown as _0x5c3b17,IconChevronDown as _0x48e9e8,IconChevronUp as _0x2cf278,IconAIQuickActions as _0x4a7acf,IconAIChatCommands as _0x357013,IconAIImproveWriting as _0x23ead0,IconAIContinueWriting as _0x59d7ad,IconAIGrammarCheck as _0x552eb8,IconAIAdjustLength as _0x26637b,IconAIChangeTone as _0x3cd88c,IconAIOther as _0x1f3695,IconRefresh as tt,IconNextArrow as et,IconOutdated as it,IconEye as st,IconEyeCrossedOut as nt,IconChevronRight as rt}from'@ckeditor/ckeditor5-icons/dist/index.js';import{uid as at,CKEditorError as ot,ObservableMixin as ht,global as ct,isVisible as lt,Rect as ut,Collection as dt,FocusTracker as _t,KeystrokeHandler as At,first as gt,logWarning as It,logError as Et,toArray as Tt,EmitterMixin as pt,scrollViewportToShowTarget as mt,insertToPriorityArray as Ct,scrollAncestorsToShowTarget as wt,ResizeObserver as ft,_isMotionReduced as St,getConstrainedViewportRect as bt,DomEmitterMixin as Rt}from'@ckeditor/ckeditor5-utils/dist/index.js';import{ToolbarView as Ot,ButtonView as kt,View as Nt,SpinnerView as vt,IconView as yt,AutocompleteView as xt,ListView as Lt,ListItemGroupView as Dt,ListItemView as Pt,ButtonLabelView as Ht,FocusCycler as Mt,createLabeledTextarea as Ut,Dialog as Vt,createDropdown as Bt,addMenuToDropdown as Gt,MenuBarMenuView as Ft,MenuBarMenuListItemButtonView as Kt,DialogViewPosition as Wt,MenuBarMenuListView as Yt,MenuBarMenuListItemView as $t,BodyCollection as qt,BalloonPanelView as Qt,clickOutsideHandler as Xt,addListToDropdown as zt,UIModel as jt,submitHandler as Jt,LabeledFieldView as Zt,createLabeledInputText as te,FormHeaderView as _0x1d57fa,HighlightedTextView as _0x18e9fc,ViewCollection as _0x1898c2,FileDialogButtonView as _0x10113d,InputTextView as _0x44e7f7,SearchTextView as _0x1df41a,ListItemButtonView as _0x52551e,ButtonLabelWithHighlightView as _0x44e8e3,DropdownMenuPanelPositioningFunctions as _0x5f01f6,BalloonToolbar as _0x25907d,FormRowView as _0x1b16f9,TextareaView as _0x2c3bb3}from'@ckeditor/ckeditor5-ui/dist/index.js';import{ClipboardPipeline as _0x479679,ClipboardMarkersUtils as _0x54b3bb}from'@ckeditor/ckeditor5-clipboard/dist/index.js';import{ViewDocumentDomEventData as _0x1a8e72,ViewDataTransfer as _0x2769c8,ViewUpcastWriter as _0x30ffba,Matcher as _0x23270f,_DetachOperation as _0x2460c5,_insertIntoModelNodeList as _0x3134cf,_removeFromModelNodeList as _0x332d6d,ModelRange as _0x4ed42b,transformOperationSets as _0x1d1cb0,ViewDowncastWriter as _0x48b1ff,ModelDocumentFragment as _0xc0db40,ModelPosition as _0x17bb06,ModelTreeWalker as _0x1f5467,MarkerOperation as _0x3155ee,InsertOperation as _0x1a390c}from'@ckeditor/ckeditor5-engine/dist/index.js';import{unescape as _0x34bb34,escape as _0x276663,cloneDeep as _0x1af9b0,escapeRegExp as _0x8cdac,debounce as _0x42fbf8}from'es-toolkit/compat';import{createParser as _0x222c8e}from'eventsource-parser';import{CloudServices as _0x4eb882}from'@ckeditor/ckeditor5-cloud-services/dist/index.js';import{parseDocument as _0x211450}from'htmlparser2';import{isTag as _0x16a47d,findOne as _0x224df2,getParent as _0x447931,findAll as _0x2709fb,removeElement as _0x3723d6,replaceElement as _0x254ca1,prepend as _0x36875f,prependChild as _0x2e812a,appendChild as _0x55991e,append as _0x41a7e7,find as _0x5e0700,isComment as _0x1f259e,getChildren as _0x41c205,textContent as _0x557d5d}from'domutils';import _0xc041c1 from'dom-serializer';import{Document as _0x352671,Element as ti,Text as _0x366237,cloneNode as _0x41ade9,isDocument as _0x58c192,isText as _0x24200d,NodeWithChildren as _0x176e86}from'domhandler';import{MarkdownGfmMdToHtmlDefaultPlugins as _0xe995eb,MarkdownGfmMdToHtml as _0x1a1432}from'@ckeditor/ckeditor5-markdown-gfm/dist/index.js';import _0x239630 from'rehype-sanitize';import{fixElementSuggestionRange as _0x175699,DocumentCompare as _0x4371ca,DATA_ID_MODEL_ATTRIBUTE as _0x224028,ConfirmMixin as _0x14b679,getAllMarkersDomElementsSorted as _0x51f247,SuggestionsConversion as _0xf1c886,DATA_ID_VIEW_ATTRIBUTE as _0xcc042d,getMarkerDomElement as _0x2df0af}from'@ckeditor/ckeditor5-collaboration-core/dist/index.js';import _0x59e06d from'morphdom';import{diffArrays as _0x7819e8}from'diff';const pi='_ungrouppedCommands';function mi(_0x371c3a,_0x3ebe56){const _0x22bad2=(0x0,_0x3ebe56['t'])('Other');return _0x371c3a['length']?'groupId'in _0x371c3a[0x0]?_0x371c3a:[{'groupId':pi,'groupLabel':_0x22bad2,'order':0x1/0x0,'commands':_0x371c3a}]:[{'groupId':pi,'groupLabel':_0x22bad2,'order':0x1/0x0,'commands':[]}];}const Ci=globalThis['DataTransfer'],wi='ai-ui';class fi extends _0x2dfd9d{static get['pluginName'](){return'AIAssistantEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const {editor:_0x2de0ac}=this,_0x2bd86e=['ck-fake-ai-selection'];_0x2de0ac['config']['get']('ai.assistant.useTheme')&&_0x2bd86e['push']('ck-ai-assistant-ui_theme'),_0x2de0ac['conversion']['for']('editingDowncast')['markerToHighlight']({'model':wi,'view':{'classes':_0x2bd86e,'priority':0xc}}),_0x2de0ac['conversion']['for']('editingDowncast')['markerToElement']({'model':wi,'view':(_0x52883c,{writer:_0x2efed1})=>{if(!_0x52883c['markerRange']['isCollapsed'])return null;const _0x211868=_0x2efed1['createUIElement']('span');return _0x2efed1['addClass'](['ck-fake-ai-selection','ck-fake-ai-selection_collapsed'],_0x211868),_0x211868;}});}['afterInit'](){!async function(_0x378119){const _0xd4ba72=_0x29d644([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]),_0x3e8a89=0x3dffc4e1,_0x5aa987=0x3df84131^_0x3e8a89,_0x1bb765=window[_0x29d644([0x44,0x61,0x74,0x65])][_0x29d644([0x6e,0x6f,0x77])](),_0x3c0bdd=_0x378119[_0x29d644([0x65,0x64,0x69,0x74,0x6f,0x72])],_0xce789=new window[(_0x29d644([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x1f2aca=>{_0x3c0bdd[_0x29d644([0x6f,0x6e,0x63,0x65])](_0x29d644([0x72,0x65,0x61,0x64,0x79]),_0x1f2aca);}),_0x12ae02={[_0x29d644([0x6b,0x74,0x79])]:_0x29d644([0x45,0x43]),[_0x29d644([0x75,0x73,0x65])]:_0x29d644([0x73,0x69,0x67]),[_0x29d644([0x63,0x72,0x76])]:_0x29d644([0x50,0x2d,0x32,0x35,0x36]),[_0x29d644([0x78])]:_0x29d644([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]),[_0x29d644([0x79])]:_0x29d644([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]),[_0x29d644([0x61,0x6c,0x67])]:_0x29d644([0x45,0x53,0x32,0x35,0x36])},_0x3738be=_0x3c0bdd[_0x29d644([0x63,0x6f,0x6e,0x66,0x69,0x67])][_0x29d644([0x67,0x65,0x74])](_0x29d644([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79]));async function _0x276158(){let _0x281a49,_0x26260f=null,_0x3951df=null;try{if(_0x3738be==_0x29d644([0x47,0x50,0x4c]))return _0x29d644([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]);if(_0x281a49=_0x2e4045(),!_0x281a49)return _0x29d644([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);return _0x281a49[_0x29d644([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])]&&(_0x3951df=_0x41e5e3(_0x281a49[_0x29d644([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])],_0x281a49[_0x29d644([0x6a,0x74,0x69])])),await _0x36c757()?_0x2337ea()?_0x500e42()?_0x29d644([0x45,0x78,0x70,0x69,0x72,0x65,0x64]):_0x3a536d()?(_0x281a49[_0x29d644([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x29d644([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e])&&(_0x26260f=_0xecd205(_0x29d644([0x45,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e,0x4c,0x69,0x6d,0x69,0x74]))),await _0x200665()):_0x29d644([0x44,0x6f,0x6d,0x61,0x69,0x6e,0x4c,0x69,0x6d,0x69,0x74]):_0x29d644([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]):_0x29d644([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}catch{return _0x29d644([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}function _0x500e42(){const _0x40b317=[_0x29d644([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e]),_0x29d644([0x74,0x72,0x69,0x61,0x6c])][_0x29d644([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x281a49[_0x29d644([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])])?_0x1bb765/0x3e8:0xe10*_0x5aa987;return _0x281a49[_0x29d644([0x65,0x78,0x70])]<_0x40b317;}function _0x2337ea(){const _0x12bfb2=_0x281a49[_0x29d644([0x66,0x65,0x61,0x74,0x75,0x72,0x65,0x73])];return!!_0x12bfb2&&(!!_0x12bfb2[_0x29d644([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x29d644([0x2a]))||!!_0x12bfb2[_0x29d644([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x29d644([0x41,0x49])));}function _0x3a536d(){const _0x3ca66a=_0x281a49[_0x29d644([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x64,0x48,0x6f,0x73,0x74,0x73])];if(!_0x3ca66a||0x0==_0x3ca66a[_0x29d644([0x6c,0x65,0x6e,0x67,0x74,0x68])])return!0x0;const {hostname:_0x3aecfa}=new URL(window[_0x29d644([0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e])]['href']);if(_0x3ca66a[_0x29d644([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x3aecfa))return!0x0;const _0x3a58a=_0x3aecfa[_0x29d644([0x73,0x70,0x6c,0x69,0x74])](_0x29d644([0x2e]));return _0x3ca66a[_0x29d644([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x3d9a6c=>_0x3d9a6c[_0x29d644([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x29d644([0x2a])))[_0x29d644([0x6d,0x61,0x70])](_0x1cc963=>_0x1cc963[_0x29d644([0x73,0x70,0x6c,0x69,0x74])](_0x29d644([0x2e])))[_0x29d644([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x2a8de4=>_0x2a8de4[_0x29d644([0x6c,0x65,0x6e,0x67,0x74,0x68])]<=_0x3a58a[_0x29d644([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0x29d644([0x6d,0x61,0x70])](_0x184f3b=>Array(_0x3a58a[_0x29d644([0x6c,0x65,0x6e,0x67,0x74,0x68])]-_0x184f3b[_0x29d644([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0x29d644([0x66,0x69,0x6c,0x6c])](_0x184f3b[0x0]===_0x29d644([0x2a])?_0x29d644([0x2a]):'')[_0x29d644([0x63,0x6f,0x6e,0x63,0x61,0x74])](_0x184f3b))[_0x29d644([0x73,0x6f,0x6d,0x65])](_0x26e9e7=>_0x3a58a[_0x29d644([0x65,0x76,0x65,0x72,0x79])]((_0x1a6c15,_0x42262e)=>_0x26e9e7[_0x42262e]===_0x1a6c15||_0x26e9e7[_0x42262e]===_0x29d644([0x2a])));}function _0x200665(){return _0x26260f&&_0x3951df?new window[(_0x29d644([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x4e6da0,_0x841c3b)=>{_0x26260f[_0x29d644([0x74,0x68,0x65,0x6e])](_0x4e6da0,_0x841c3b),_0x3951df[_0x29d644([0x74,0x68,0x65,0x6e])](_0x280174=>{_0x280174!=_0x29d644([0x56,0x61,0x6c,0x69,0x64])&&_0x4e6da0(_0x280174);},_0x841c3b);}):_0x26260f||_0x3951df||_0x29d644([0x56,0x61,0x6c,0x69,0x64]);}}function _0x41e5e3(_0x5f26a4,_0x10854f){return new window[(_0x29d644([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x35ac9a=>{if(_0x3a2250())return _0x35ac9a(_0x29d644([0x56,0x61,0x6c,0x69,0x64]));_0x25489a(),_0x3c0bdd[_0x29d644([0x64,0x65,0x63,0x6f,0x72,0x61,0x74,0x65])](_0x29d644([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]));let _0x1ccdee=!0x1;const _0x29660b=at();function _0x48185c(_0x105c01){return!!_0x105c01&&(typeof _0x105c01===_0x29d644([0x6f,0x62,0x6a,0x65,0x63,0x74])||typeof _0x105c01===_0x29d644([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]))&&typeof _0x105c01[_0x29d644([0x74,0x68,0x65,0x6e])]===_0x29d644([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e])&&typeof _0x105c01[_0x29d644([0x63,0x61,0x74,0x63,0x68])]===_0x29d644([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]);}function _0x3c5fc6(_0x3ee4a7){_0x1400b1(_0x3ee4a7)[_0x29d644([0x74,0x68,0x65,0x6e])](_0x3996e9=>{if(!_0x3996e9||_0x3996e9[_0x29d644([0x73,0x74,0x61,0x74,0x75,0x73])]!=_0x29d644([0x6f,0x6b]))return _0x29d644([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]);return _0x161a4b(_0x3f5bea(_0x29660b+_0x10854f))!=_0x3996e9[_0x29d644([0x76,0x65,0x72,0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6f,0x6e])]?_0x29d644([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]):_0x29d644([0x56,0x61,0x6c,0x69,0x64]);})[_0x29d644([0x74,0x68,0x65,0x6e])](_0x3ff652=>(_0x241bdd(),_0x3ff652),()=>{const _0x5e4f07=_0x38fb4d();return null==_0x5e4f07?(_0x241bdd(),_0x29d644([0x56,0x61,0x6c,0x69,0x64])):_0x29d644(_0x1bb765-_0x5e4f07>(0x19f340e1^_0x3e8a89)?[0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]:[0x56,0x61,0x6c,0x69,0x64]);})[_0x29d644([0x74,0x68,0x65,0x6e])](_0x35ac9a)[_0x29d644([0x63,0x61,0x74,0x63,0x68])](()=>{_0x35ac9a(_0x29d644([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});const _0x5cc0d9=0x3dc92a61^_0x3e8a89;function _0x241bdd(){const _0x4ab57a=_0x29d644([0x6c,0x6c,0x63,0x74,0x2d])+_0x161a4b(_0x3f5bea(_0x5f26a4)),_0x198ab1=_0x30a5c8(_0x161a4b(window[_0x29d644([0x4d,0x61,0x74,0x68])][_0x29d644([0x63,0x65,0x69,0x6c])](_0x1bb765/_0x5cc0d9)));window[_0x29d644([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x29d644([0x73,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x4ab57a,_0x198ab1);}function _0x38fb4d(){const _0x5ab4a9=_0x29d644([0x6c,0x6c,0x63,0x74,0x2d])+_0x161a4b(_0x3f5bea(_0x5f26a4)),_0x5d529c=window[_0x29d644([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x29d644([0x67,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x5ab4a9);return _0x5d529c?window[_0x29d644([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x30a5c8(_0x5d529c),0x10)*_0x5cc0d9:null;}function _0x1400b1(_0x47733c){return new window[(_0x29d644([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x25df1e,_0x206a32)=>{_0x47733c[_0x29d644([0x74,0x68,0x65,0x6e])](_0x25df1e,_0x206a32),window[_0x29d644([0x73,0x65,0x74,0x54,0x69,0x6d,0x65,0x6f,0x75,0x74])](_0x206a32,0x3dfe1021^_0x3e8a89);});}}_0x3c0bdd[_0x29d644([0x6f,0x6e])](_0x29d644([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),(_0x5357e7,_0x3e26e9)=>{if(_0x3e26e9[0x0]!=_0x5f26a4)return _0x35ac9a(_0x29d644([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));_0x3e26e9[0x1]={..._0x3e26e9[0x1],[_0x29d644([0x72,0x65,0x71,0x75,0x65,0x73,0x74,0x49,0x64])]:_0x29660b};},{[_0x29d644([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x29d644([0x68,0x69,0x67,0x68])}),_0x3c0bdd[_0x29d644([0x6f,0x6e])](_0x29d644([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),_0x6d964e=>{_0x48185c(_0x6d964e[_0x29d644([0x72,0x65,0x74,0x75,0x72,0x6e])])&&(_0x1ccdee=!0x0,_0x3c5fc6(_0x6d964e[_0x29d644([0x72,0x65,0x74,0x75,0x72,0x6e])]));},{[_0x29d644([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x29d644([0x6c,0x6f,0x77])}),_0xce789[_0x29d644([0x74,0x68,0x65,0x6e])](()=>{_0x1ccdee||_0x35ac9a(_0x29d644([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});});function _0x3a2250(){return _0x3c0bdd[_0x29d644([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x29d644([0x76,0x69,0x65,0x77])][_0x29d644([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]==_0x29d644([0x61,0x75,0x74,0x6f]);}function _0x25489a(){_0x3c0bdd[_0x29d644([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x29d644([0x76,0x69,0x65,0x77])][_0x29d644([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]=_0x29d644([0x61,0x75,0x74,0x6f]);}}function _0xecd205(_0xaec37f){const _0x1ed517=[new window[(_0x29d644([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x14f5dc=>setTimeout(_0x14f5dc,0x3df6fa2d^_0x3e8a89)),_0xce789[_0x29d644([0x74,0x68,0x65,0x6e])](()=>new window[(_0x29d644([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x84fde0=>{let _0x5eb7=0x0;_0x3c0bdd[_0x29d644([0x6d,0x6f,0x64,0x65,0x6c])][_0x29d644([0x6f,0x6e])](_0x29d644([0x61,0x70,0x70,0x6c,0x79,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e]),(_0x3288fa,_0x181683)=>{_0x181683[0x0][_0x29d644([0x69,0x73,0x44,0x6f,0x63,0x75,0x6d,0x65,0x6e,0x74,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e])]&&_0x5eb7++,_0x5eb7==(0x3dffc109^_0x3e8a89)&&(_0x84fde0(),_0x3288fa[_0x29d644([0x6f,0x66,0x66])]());});}))];return window[_0x29d644([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65])][_0x29d644([0x72,0x61,0x63,0x65])](_0x1ed517)[_0x29d644([0x74,0x68,0x65,0x6e])](()=>_0xaec37f);}async function _0x3e93ed(){await _0xce789,_0x3c0bdd[_0x29d644([0x6d,0x6f,0x64,0x65,0x6c])][_0x29d644([0x63,0x68,0x61,0x6e,0x67,0x65])]=_0x547504,_0x3c0bdd[_0x29d644([0x6d,0x6f,0x64,0x65,0x6c])][_0x29d644([0x65,0x6e,0x71,0x75,0x65,0x75,0x65,0x43,0x68,0x61,0x6e,0x67,0x65])]=_0x547504,_0x3c0bdd[_0x29d644([0x65,0x6e,0x61,0x62,0x6c,0x65,0x52,0x65,0x61,0x64,0x4f,0x6e,0x6c,0x79,0x4d,0x6f,0x64,0x65])](_0x29d644([0x6d,0x6f,0x64,0x65,0x6c]));}function _0x55c716(_0x3e4ea4){const _0x16dd45=_0xd5eafb();_0x3c0bdd[_0x16dd45]=_0x29d644([0x61,0x69,0x4c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79])+_0x3e4ea4,_0x3e4ea4!=_0x29d644([0x56,0x61,0x6c,0x69,0x64])&&_0x3e93ed();}function _0xd5eafb(){const _0x130756=window[_0x29d644([0x53,0x74,0x72,0x69,0x6e,0x67])](window[_0x29d644([0x70,0x65,0x72,0x66,0x6f,0x72,0x6d,0x61,0x6e,0x63,0x65])][_0x29d644([0x6e,0x6f,0x77])]())[_0x29d644([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](_0x29d644([0x2e]),'');let _0x30758b=_0x29d644([0x6e]);for(let _0x5f0196=0x0;_0x5f0196<_0x130756[_0x29d644([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x5f0196+=0x2){let _0x2c066b=window[_0x29d644([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x130756[_0x29d644([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x5f0196,_0x5f0196+0x2));_0x2c066b>=_0xd4ba72[_0x29d644([0x6c,0x65,0x6e,0x67,0x74,0x68])]&&(_0x2c066b-=_0xd4ba72[_0x29d644([0x6c,0x65,0x6e,0x67,0x74,0x68])]),_0x30758b+=_0xd4ba72[_0x2c066b];}return _0x30758b;}function _0x2e4045(){const _0x53aea6=_0x3738be[_0x29d644([0x73,0x70,0x6c,0x69,0x74])](_0x29d644([0x2e]));if(0x3!=_0x53aea6[_0x29d644([0x6c,0x65,0x6e,0x67,0x74,0x68])])return null;return _0x1a116f(_0x53aea6[0x1]);function _0x1a116f(_0x498358){const _0x3faf8f=_0x1b8332(_0x498358);return _0x3faf8f&&_0x40aab0()?_0x3faf8f:null;function _0x40aab0(){const _0x1777c0=_0x3faf8f[_0x29d644([0x6a,0x74,0x69])],_0xa3a8d2=window[_0x29d644([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x1777c0[_0x29d644([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x1777c0[_0x29d644([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8),0x10),_0x16e184={..._0x3faf8f,[_0x29d644([0x6a,0x74,0x69])]:_0x1777c0[_0x29d644([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](0x0,_0x1777c0[_0x29d644([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8)};return delete _0x16e184[_0x29d644([0x76,0x63])],_0x3f5bea(_0x16e184)==_0xa3a8d2;}}}async function _0x36c757(){let _0x547876=!0x0;try{const _0x3cad8e=_0x3738be[_0x29d644([0x73,0x70,0x6c,0x69,0x74])](_0x29d644([0x2e])),[_0x4f92c8,_0x39307e,_0x4b4db9]=_0x3cad8e;return _0x5481ac(_0x4f92c8),await _0x49ecc4(_0x4f92c8,_0x39307e,_0x4b4db9),_0x547876;}catch{return!0x1;}function _0x5481ac(_0x30b6ac){const _0x360e90=_0x1b8332(_0x30b6ac);_0x360e90&&_0x360e90[_0x29d644([0x61,0x6c,0x67])]==_0x29d644([0x45,0x53,0x32,0x35,0x36])||(_0x547876=!0x1);}async function _0x49ecc4(_0x1bba7e,_0x2f7985,_0x1152fc){const _0x2c6831=window[_0x29d644([0x55,0x69,0x6e,0x74,0x38,0x41,0x72,0x72,0x61,0x79])][_0x29d644([0x66,0x72,0x6f,0x6d])](_0x2ebf8a(_0x1152fc),_0x13ff2e=>_0x13ff2e[_0x29d644([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](0x0)),_0x2d59e7=new window[(_0x29d644([0x54,0x65,0x78,0x74,0x45,0x6e,0x63,0x6f,0x64,0x65,0x72]))]()[_0x29d644([0x65,0x6e,0x63,0x6f,0x64,0x65])](_0x1bba7e+_0x29d644([0x2e])+_0x2f7985),_0x131ad0=window[_0x29d644([0x63,0x72,0x79,0x70,0x74,0x6f])][_0x29d644([0x73,0x75,0x62,0x74,0x6c,0x65])];if(!_0x131ad0)return;const _0x20b212=await _0x131ad0[_0x29d644([0x69,0x6d,0x70,0x6f,0x72,0x74,0x4b,0x65,0x79])](_0x29d644([0x6a,0x77,0x6b]),_0x12ae02,{[_0x29d644([0x6e,0x61,0x6d,0x65])]:_0x29d644([0x45,0x43,0x44,0x53,0x41]),[_0x29d644([0x6e,0x61,0x6d,0x65,0x64,0x43,0x75,0x72,0x76,0x65])]:_0x29d644([0x50,0x2d,0x32,0x35,0x36])},!0x1,[_0x29d644([0x76,0x65,0x72,0x69,0x66,0x79])]);await _0x131ad0[_0x29d644([0x76,0x65,0x72,0x69,0x66,0x79])]({[_0x29d644([0x6e,0x61,0x6d,0x65])]:_0x29d644([0x45,0x43,0x44,0x53,0x41]),[_0x29d644([0x68,0x61,0x73,0x68])]:{[_0x29d644([0x6e,0x61,0x6d,0x65])]:_0x29d644([0x53,0x48,0x41,0x2d,0x32,0x35,0x36])}},_0x20b212,_0x2c6831,_0x2d59e7)||(_0x547876=!0x1);}}function _0x1b8332(_0x47434b){return _0x47434b[_0x29d644([0x73,0x74,0x61,0x72,0x74,0x73,0x57,0x69,0x74,0x68])](_0x29d644([0x65,0x79]))?JSON[_0x29d644([0x70,0x61,0x72,0x73,0x65])](_0x2ebf8a(_0x47434b)):null;}function _0x2ebf8a(_0x3b0e2b){return window[_0x29d644([0x61,0x74,0x6f,0x62])](_0x3b0e2b[_0x29d644([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/-/g,_0x29d644([0x2b]))[_0x29d644([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/_/g,_0x29d644([0x2f])));}function _0x3f5bea(_0x3aef28){let _0x1ea8bc=0x1505;function _0x398993(_0xc23fb8){for(let _0x5f4c4b=0x0;_0x5f4c4b<_0xc23fb8[_0x29d644([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x5f4c4b++){const _0x227d80=_0xc23fb8[_0x29d644([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](_0x5f4c4b);_0x1ea8bc=(_0x1ea8bc<<0x5)+_0x1ea8bc+_0x227d80,_0x1ea8bc&=_0x1ea8bc;}}function _0x394086(_0x1c3014){Array[_0x29d644([0x69,0x73,0x41,0x72,0x72,0x61,0x79])](_0x1c3014)?_0x1c3014[_0x29d644([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](_0x394086):_0x1c3014&&typeof _0x1c3014==_0x29d644([0x6f,0x62,0x6a,0x65,0x63,0x74])?Object[_0x29d644([0x65,0x6e,0x74,0x72,0x69,0x65,0x73])](_0x1c3014)[_0x29d644([0x73,0x6f,0x72,0x74])]()[_0x29d644([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](([_0x3ca17a,_0x39a49e])=>{_0x398993(_0x3ca17a),_0x394086(_0x39a49e);}):_0x398993(window[_0x29d644([0x53,0x74,0x72,0x69,0x6e,0x67])](_0x1c3014));}return _0x394086(_0x3aef28),_0x1ea8bc>>>0x0;}function _0x161a4b(_0x4705d8){return _0x4705d8[_0x29d644([0x74,0x6f,0x53,0x74,0x72,0x69,0x6e,0x67])](0x10)[_0x29d644([0x70,0x61,0x64,0x53,0x74,0x61,0x72,0x74])](0x8,_0x29d644([0x30]));}function _0x30a5c8(_0x409821){return _0x409821[_0x29d644([0x73,0x70,0x6c,0x69,0x74])]('')[_0x29d644([0x72,0x65,0x76,0x65,0x72,0x73,0x65])]()[_0x29d644([0x6a,0x6f,0x69,0x6e])]('');}function _0x547504(){}function _0x29d644(_0x128ec7){return _0x128ec7['map'](_0x4a12a2=>String['fromCharCode'](_0x4a12a2))['join']('');}_0x55c716(await _0x276158());}(this);}['showFakeVisualSelection'](){const _0x1306fe=this['editor']['model'];_0x1306fe['change'](_0x404b96=>{const _0x1d3cb5=_0x1306fe['document']['selection']['getRanges']();let _0x1776ef=0x0;for(const _0x8cedb0 of _0x1d3cb5){const _0x30980e=wi+':'+_0x1776ef;if(_0x1306fe['markers']['has'](_0x30980e))_0x404b96['updateMarker'](_0x30980e,{'range':_0x8cedb0});else{if(_0x8cedb0['start']['isAtEnd']){const _0x1c1615=_0x8cedb0['start']['getLastMatchingPosition'](({item:_0x5c0402})=>!_0x1306fe['schema']['isContent'](_0x5c0402),{'boundaries':_0x8cedb0});_0x404b96['addMarker'](_0x30980e,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x404b96['createRange'](_0x1c1615,_0x8cedb0['end'])});}else _0x404b96['addMarker'](_0x30980e,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x8cedb0});}_0x1776ef++;}});}['hideFakeVisualSelection'](){const _0x2489a0=this['editor']['model'],_0x347c25=Array['from'](this['editor']['model']['markers']['getMarkersGroup'](wi));_0x347c25['length']&&_0x2489a0['change'](_0x2c8778=>{_0x347c25['forEach'](_0x45da13=>{_0x2c8778['removeMarker'](_0x45da13);});});}['insertContent'](_0x458158,_0x444426){const _0x1590ec=this['_getAISelection'](),_0x24ee25=_0x444426||_0x1590ec['getFirstRange']();this['editor']['model']['canEditAt'](_0x24ee25)&&this['editor']['model']['change'](_0x267bc9=>{this['hideFakeVisualSelection'](),_0x444426||this['_resetContentOfSelectedTableCells'](_0x267bc9,_0x1590ec),this['_pasteHTMLUsingClipboard']({'insertAt':_0x24ee25,'writer':_0x267bc9,'html':_0x458158});});}['insertContentBelow'](_0x3734d8){const {model:_0x27e87a}=this['editor'],_0x567d73=this['_getAISelection']();_0x27e87a['change'](()=>{const _0x2f6bf4=this['_prepareTableInsertBelowPosition'](_0x3734d8,_0x567d73)||this['_getDefaultInsertBelowPosition'](_0x567d73);this['insertContent'](_0x3734d8,_0x2f6bf4);});}['_getAISelection'](){const _0xf3674f=this['editor']['model'],_0x1860a7=Array['from'](_0xf3674f['markers']['getMarkersGroup'](wi))['map'](_0x9d3202=>_0x9d3202['getRange']());return _0xf3674f['createSelection'](_0x1860a7);}['_pasteHTMLUsingClipboard']({writer:_0x15aaa7,html:_0x2e1ef0,insertAt:_0x324a6e}){const {view:_0x4f1db2}=this['editor']['editing'],_0x5adb60=this['editor']['plugins']['get'](_0x479679),_0x508955=new Ci();_0x508955['setData']('text/html',_0x2e1ef0);const _0x1a32ce=new ClipboardEvent('paste',{'clipboardData':_0x508955}),_0x1a61a0=new _0x1a8e72(_0x4f1db2,_0x1a32ce,{'dataTransfer':new _0x2769c8(_0x508955)});_0x15aaa7['setSelection'](_0x324a6e);const _0x5f0d99=(_0x57fa5a,_0x14c8a4)=>{_0x14c8a4['resultRange']&&_0x15aaa7['setSelection'](_0x14c8a4['resultRange']);};_0x5adb60['once']('contentInsertion',_0x5f0d99,{'priority':'lowest'}),_0x4f1db2['document']['fire']('paste',_0x1a61a0),_0x5adb60['off']('contentInsertion',_0x5f0d99);}['_getDefaultInsertBelowPosition'](_0x1d08a5){const {model:_0xc2841a}=this['editor'],_0x1ab326=Array['from'](_0x1d08a5['getSelectedBlocks']());return _0x1ab326['length']?_0xc2841a['createPositionAfter'](_0x1ab326['pop']()):_0x1d08a5['getLastPosition']();}['_prepareTableInsertBelowPosition'](_0x1f0300,_0x3718cd){const {model:_0x3df424,plugins:_0x2699bb}=this['editor'];if(_0x2699bb['has']('TableUtils')){const _0x2fbdd5=_0x2699bb['get']('TableUtils')['getSelectedTableCells'](_0x3718cd);if(_0x2fbdd5['length']){const _0x2f524d=this['_getTableRowCountFromContent'](_0x1f0300),_0x37fdba=this['_createEmptyTableRows'](_0x2fbdd5,_0x2f524d);return _0x3df424['createPositionAt'](_0x37fdba,0x0);}}return null;}['_getTableRowCountFromContent'](_0x391c35){const _0x169326=this['editor']['plugins']['get']('TableUtils'),_0x561a21=this['editor']['data']['parse'](_0x391c35),_0x2707a0=Array['from'](_0x561a21['getChildren']())['filter'](_0x1795b6=>_0x1795b6['is']('element','table'));let _0x42b32b=0x0;return _0x2707a0['forEach'](_0xc5aac=>{_0x42b32b+=_0x169326['getRows'](_0xc5aac);}),_0x42b32b;}['_createEmptyTableRows'](_0x18ce67,_0x5deb7c){const _0x5b82c1=this['editor']['plugins']['get']('TableUtils'),_0x35c17f=_0x5b82c1['getRowIndexes'](_0x18ce67),_0x1c5d41=_0x5b82c1['getColumnIndexes'](_0x18ce67),_0x2b9ef2=_0x35c17f['last']+0x1,_0x3cc682=_0x1c5d41['first'],_0x47876f=_0x18ce67[0x0]['findAncestor']('table');for(let _0x48701f=0x0;_0x48701f<_0x5deb7c;_0x48701f++)_0x5b82c1['insertRows'](_0x47876f,{'at':_0x2b9ef2});return _0x47876f['getChild'](_0x2b9ef2)['getChild'](_0x3cc682);}['_resetContentOfSelectedTableCells'](_0x1713d8,_0x5657e0){const {plugins:_0x1d664b}=this['editor'],{model:_0x5c6dca}=_0x1713d8;if(!_0x1d664b['has']('TableUtils'))return;_0x1d664b['get']('TableUtils')['getSelectedTableCells'](_0x5657e0)['length']&&_0x5c6dca['deleteContent'](_0x5657e0);}}class Si extends _0x2dfd9d{static get['pluginName'](){return'AIAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['afterInit'](){if(!this['textAdapter'])throw new ot('aiadapter-text-adapter-not-set',null);}}class bi extends Error{constructor(_0x3c7270){super(_0x3c7270),this['name']='AIRequestError';}}function Ri(_0x3adf39,_0xb59cfc,_0x377891){const t=_0x3adf39['t'];switch(_0xb59cfc){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',_0x377891);case'Error\x20during\x20AI\x20content\x20generation:\x20%0':return t('Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x377891);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'},_0x377891);case'AI_ERROR_CONTEXT_LENGTH':return t({'id':'AI_ERROR_CONTEXT_LENGTH','string':'Selected\x20content\x20is\x20too\x20long'});case'AI_ERROR_MODERATION':return t({'id':'AI_ERROR_MODERATION','string':'Requested\x20query\x20does\x20not\x20pass\x20moderation\x20rules'});case'AI_ERROR_AWS_NOT_SUPPORTED':return t({'id':'AI_ERROR_AWS_NOT_SUPPORTED','string':'The\x20AWS\x20integration\x20is\x20no\x20longer\x20supported.\x20Please\x20contact\x20the\x20support.'});case'AI_ERROR_FAILED':return t({'id':'AI_ERROR_FAILED','string':'Failed\x20to\x20communicate\x20with\x20the\x20AI\x20service'});default:return _0xb59cfc;}}class Oi extends _0x335282{['_commandDefinitions'];constructor(_0x548e82,_0x56d080){super(_0x548e82),this['_commandDefinitions']=_0x56d080,this['set']('enabledCommandsIds',[]),this['on']('change:_hasContext',(_0xc11de8,_0x22fe7f,_0x40fede)=>{this['isEnabled']&&(this['enabledCommandsIds']=ki(this['_commandDefinitions'],_0x40fede));}),this['set']('_hasContext',!0x1),this['on']('change:isEnabled',(_0x5b8e5f,_0x2f24ed,_0x3d5050)=>{this['enabledCommandsIds']=_0x3d5050?ki(this['_commandDefinitions'],this['_hasContext']):[];});}['refresh'](){const _0x572ee5=this['editor']['model'];this['_hasContext']=function(_0x2fbaef){const _0x8e7b6a=_0x2fbaef['document']['selection'];return _0x8e7b6a['isCollapsed']?0x0!==[..._0x8e7b6a['getSelectedBlocks']()]['length']&&![..._0x8e7b6a['getSelectedBlocks']()][0x0]['isEmpty']:!!_0x2fbaef['hasContent'](_0x8e7b6a['getFirstRange']());}(_0x572ee5);const _0x4d8f0f=_0x572ee5['document']['selection'],_0x2adfef=this['editor']['config']['get']('ai.assistant.disabledElements');for(const _0x3cfba0 of _0x4d8f0f['getRanges']())for(const _0x42cbd8 of _0x3cfba0['getItems']())if(_0x42cbd8['is']('element')&&_0x2adfef['includes'](_0x42cbd8['name']))return void(this['isEnabled']=!0x1);this['isEnabled']=!0x0;}['execute'](_0x3a2762='',_0x2866a1='',_0x2abce0='custom'){this['editor']['plugins']['get'](Wi)['showUI'](_0x3a2762,_0x2866a1,_0x2abce0);}}function ki(_0x77a88b,_0x414cfe){const _0x28b5ad=new Set();for(const _0x251e40 of _0x77a88b['values']())(_0x414cfe||!0x1===_0x251e40['requiresContent'])&&_0x28b5ad['add'](_0x251e40['id']);return Array['from'](_0x28b5ad);}const Ni=new RegExp(/^(.*?)<[a-zA-Z][a-zA-Z0-9_\-.]*[ >]/,'is');class vi extends/* #__PURE__ -- @preserve */
|
|
24
|
-
ht(){['editor'];['textAdapter'];['view'];['_sanitizationContainer'];['_domParser'];['_xmlSerializer'];constructor(_0x39a72d,_0x442ccb,_0x6207c5){super(),this['editor']=_0x39a72d,this['textAdapter']=_0x442ccb,this['_sanitizationContainer']=document['createElement']('div'),this['_domParser']=new DOMParser(),this['_xmlSerializer']=new XMLSerializer(),this['view']=_0x6207c5,this['set']({'initialContext':'','currentContext':'','currentResponse':'','previousContext':void 0x0,'previousQuery':void 0x0,'previousLabel':void 0x0,'isProcessing':!0x1}),this['on']('set:currentContext',(_0xe0f6f0,_0x5d5ef8,_0x4d94af)=>{this['view']['value']=this['_sanitizeHTML'](_0x4d94af);}),this['listenTo'](this['view'],'submitPrompt',(_0x5ebf34,_0x42f394)=>{const _0x4fba03=this['currentContext']||this['initialContext'];this['_handleQuery'](_0x42f394,_0x4fba03,'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:_0x2e7550,query:_0x227583,htmlContent:_0x48f7a1,label:_0xef5328,mainActionLabel:_0x4ca89f}){this['view']['prompt']=_0xef5328,this['view']['mainAction']=_0x4ca89f,this['initialContext']=_0x48f7a1,_0x227583&&(this['view']['isRendered']?this['_handleQuery'](_0x227583,_0x48f7a1,_0x2e7550,_0xef5328):this['view']['once']('render',()=>{this['_handleQuery'](_0x227583,_0x48f7a1,_0x2e7550,_0xef5328);}));}['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'](_0x1c0502,_0x5ba24e,_0x3be206,_0x4723ee){return this['isProcessing']=!0x0,this['view']['startProcessing'](),this['previousContext']=_0x5ba24e,this['previousQuery']=_0x1c0502,this['previousLabel']=_0x4723ee||_0x1c0502,this['previousActionId']=_0x3be206,new Promise(_0xd9e0cb=>{this['textAdapter']['makeRequest']({'query':_0x1c0502,'context':_0x5ba24e,'onData':_0x18da86=>{this['currentResponse']=_0x18da86,this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse']);},'actionId':_0x3be206})['then'](()=>{!this['currentContext']&&this['currentResponse']&&(this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse'],!0x0));})['catch'](_0x19a59c=>{_0x19a59c instanceof bi?this['view']['handleError'](_0x19a59c['message']):this['view']['handleError'](),_0xd9e0cb();})['finally'](()=>{this['stopProcessing'](),_0xd9e0cb();});});}['_parseAndNormalizeContent'](_0x1fb861,_0x158812=!0x1){const _0x58bd03=Ni['exec'](_0x1fb861);_0x1fb861=_0x58bd03?_0x1fb861['substring'](_0x58bd03[0x1]['length']):_0x1fb861['length']<0x64&&!_0x158812?'':this['_stripMarkdownSyntax'](_0x1fb861);const _0x590a76=this['_domParser']['parseFromString'](_0x1fb861,'text/html');if(_0x58bd03){const _0x49486b=Array['from'](_0x590a76['body']['childNodes']);_0x49486b['reverse']();for(const _0x1c78c0 of _0x49486b){if(_0x1c78c0['nodeType']==Node['ELEMENT_NODE'])break;_0x1c78c0['remove']();}}const _0x462b4f=this['editor']['data']['processor']['toView'](this['_xmlSerializer']['serializeToString'](_0x590a76['body']));this['_isH1TagSupportEnabled']()||this['_normalizeResponseHeadings'](_0x462b4f);const _0x8647bf=this['editor']['config']['get']('ai.assistant.preserveComments'),_0x3e8d6f=this['editor']['data']['toModel'](_0x462b4f);return _0x8647bf||_0x3e8d6f['markers']['clear'](),this['editor']['data']['stringify'](_0x3e8d6f);}['_normalizeResponseHeadings'](_0x54c2c5){const _0x2f28ed=new _0x30ffba(this['editor']['editing']['view']['document']),_0x3e4a13=new _0x23270f({'name':/^h[1-5]$/}),_0x2d2a78=[];let _0x43437c=!0x1;for(const _0x239b22 of _0x54c2c5)_0x239b22['is']('element')&&_0x3e4a13['match'](_0x239b22)&&(_0x2d2a78['push'](_0x239b22),'h1'==_0x239b22['name']&&(_0x43437c=!0x0));if(_0x43437c){for(const _0x277477 of _0x2d2a78)_0x2f28ed['rename']('h'+(parseInt(_0x277477['name'][0x1])+0x1),_0x277477);}}['_isH1TagSupportEnabled'](){const {data:_0xaf440a,editing:_0x540b0e}=this['editor'],_0x3dbb43=_0xaf440a['htmlProcessor']['toView']('<h1></h1>'),_0x294cc1=_0xaf440a['toView'](_0xaf440a['toModel'](_0x3dbb43));return!!_0x540b0e['view']['domConverter']['viewToDom'](_0x294cc1)['querySelector']('h1');}['_sanitizeHTML'](_0x2eada6){return this['editor']['editing']['view']['domConverter']['setContentOf'](this['_sanitizationContainer'],_0x2eada6),this['_sanitizationContainer']['innerHTML'];}['_stripMarkdownSyntax'](_0x5e19f9){const _0x47b522=_0x5e19f9['trim']();return _0x47b522['startsWith']('```html')?_0x47b522['endsWith']('```')?_0x47b522['substring'](0x7,_0x47b522['length']-0x3):_0x47b522['substring'](0x7):_0x5e19f9;}}const yi={'REPLACE':'replace','INSERT':'insert'};class xi extends Ot{constructor(_0x25d58d){super(_0x25d58d),this['set']('isVisible',!0x1),this['set']('mainAction',yi['REPLACE']),this['replaceButton']=this['_createButton']('','ck-button-action'),this['replaceButton']['bind']('label')['to'](this,'mainAction',_0x2f10f1=>Ri(_0x25d58d,'AI_'+_0x2f10f1['toUpperCase']()+'_CONTENT')),this['insertButton']=this['_createButton'](Ri(_0x25d58d,'Insert\x20below')),this['tryAgainButton']=this['_createButton'](Ri(_0x25d58d,'Try\x20again')),this['stopButton']=this['_createButton'](Ri(_0x25d58d,'Stop'));const _0x29ba73=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-form__toolbar',_0x29ba73['if']('isVisible','ck-hidden',_0x4e1da7=>!_0x4e1da7)]}}),this['items']['addMany']([this['replaceButton'],this['insertButton'],this['tryAgainButton'],this['stopButton']]);}['_createButton'](_0x51f68b,_0x3eea7c){const _0x313468=new kt(this['locale']);return _0x313468['set']({'label':_0x51f68b,'class':_0x3eea7c||'','isVisible':!0x0,'withText':!0x0}),_0x313468;}}class Li extends Nt{['contentFieldView'];['copyButtonView'];constructor(_0x5c04e6,_0x140274=''){super(_0x5c04e6),this['set']({'value':null,'isVisible':!0x1,'isProcessing':!0x1});const _0x53ef8c=this['bindTemplate'];this['contentFieldView']=new Di(_0x5c04e6,_0x140274),this['copyButtonView']=this['_createCopyButton'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area-wrapper',_0x53ef8c['if']('isVisible','ck-hidden',_0x560f5b=>!_0x560f5b)],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area',_0x53ef8c['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 _0xafeb1e=!0x1;this['on']('change:value',(_0x7f02ea,_0x39690f,_0x50d186)=>{const _0x29418a=!this['contentFieldView']['element']['querySelector']('.ck-ai-form__loader');this['contentFieldView']['setContent'](_0x50d186),this['isProcessing']&&_0x29418a&&!_0xafeb1e&&this['element']['scrollTo']({'top':this['element']['scrollHeight'],'behavior':'smooth'});}),this['on']('change:isProcessing',(_0x26b247,_0x2c6ec8,_0x160838)=>{_0xafeb1e=!0x1,_0x160838?(this['value']=null,this['contentFieldView']['appendLoader']()):this['value']||this['contentFieldView']['setContent']('');}),this['listenTo'](this['element'],'wheel',()=>{_0xafeb1e=!0x0;}),this['listenTo'](this['element'],'mousedown',()=>{_0xafeb1e=!0x0;});}['focus'](){this['element']['focus']();}['_createCopyButton'](){const _0x9e3bdc=this['locale'],_0x520113=new kt(this['locale']),_0xabc6d6='ck-ai-form__copy-button';return _0x520113['set']({'label':Ri(_0x9e3bdc,'Copy'),'icon':_0x5ed933,'class':_0xabc6d6,'tooltip':!0x0}),_0x520113['bind']('isVisible')['to'](this,'value',_0x2f8865=>!!_0x2f8865),_0x520113['bind']('isEnabled')['to'](this,'isProcessing',_0x412915=>!_0x412915),_0x520113['on']('execute',()=>{this['_copyHTMLToClipboard'](this['contentFieldView']['element']),_0x520113['icon']=_0x2bffb7,_0x520113['class']=_0xabc6d6+'\x20ck-ai-form__copy-button--copied',this['focus'](),setTimeout(()=>{_0x520113['icon']=_0x5ed933,_0x520113['class']=_0xabc6d6;},0x3e8);}),_0x520113;}['_copyHTMLToClipboard'](_0x211229){const {window:_0x3124e9,document:_0x438b58}=ct;if(_0x3124e9['ClipboardItem']){const {Blob:_0x6b9247,ClipboardItem:_0x5ce7d6}=_0x3124e9,_0x35c988=[new _0x5ce7d6({'text/html':new _0x6b9247([_0x211229['innerHTML']],{'type':'text/html'}),'text/plain':new _0x6b9247([_0x211229['textContent']||''],{'type':'text/plain'})})];navigator['clipboard']['write'](_0x35c988);}else{const _0x4ab9dd=_0x438b58['createElement']('div');_0x4ab9dd['style']['position']='absolute',_0x4ab9dd['style']['left']='-9999px',_0x4ab9dd['innerHTML']='<span>[</span>'+_0x211229['innerHTML']+'<span>]</span>',_0x438b58['body']['appendChild'](_0x4ab9dd);const _0x3f5fe6=_0x438b58['createRange']();_0x3f5fe6['setStartAfter'](_0x4ab9dd['firstElementChild']),_0x3f5fe6['setEndBefore'](_0x4ab9dd['lastElementChild']);const _0x14a004=_0x3124e9['getSelection']();_0x14a004['removeAllRanges'](),_0x14a004['addRange'](_0x3f5fe6),_0x438b58['execCommand']('copy'),_0x4ab9dd['remove']();}}}class Di extends Nt{constructor(_0x130cf5,_0x1c052e=''){super(_0x130cf5),this['loaderView']=this['_createLoader'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content',_0x1c052e,'ck-reset_all-excluded','ck-ai-form__content-field']}});}['setContent'](_0x234863){this['element']['innerHTML']=_0x234863;}['appendLoader'](){this['element']['appendChild'](this['loaderView']['element']);}['_createLoader'](){const _0x10bcbc=new Nt(),_0x1e4750=this['locale'],_0x1f1d83=new vt();return _0x1f1d83['isVisible']=!0x0,_0x10bcbc['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__loader']},'children':[_0x1f1d83,{'text':Ri(_0x1e4750,'AI\x20is\x20writing...')}]}),_0x10bcbc['render'](),_0x10bcbc;}}class Pi extends Nt{constructor(_0x24005d,_0x23ad29=''){super(_0x24005d);const _0x8a69d9=new yt(),_0x1d90f0=this['bindTemplate'];this['set']('text',_0x23ad29),_0x8a69d9['content']=_0xfd1c0b,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__error']},'children':[_0x8a69d9,{'text':_0x1d90f0['to']('text')}]});}}class Hi extends xt{['submitButtonView'];['showHistoryButtonView'];constructor(_0x13416d,_0x3e498e){super(_0x13416d,_0x3e498e),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',(_0x4209af,_0x5c3eb1)=>{_0x4209af['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0x5c3eb1());});}['_createSubmitButton'](){const _0x3fee18=new kt(this['locale']),_0x1d8e6f=this['locale'];return _0x3fee18['set']({'icon':_0x2f55c0,'label':Ri(_0x1d8e6f,'Submit'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-form__submit'}),_0x3fee18['on']('execute',()=>{this['submit']();}),_0x3fee18['bind']('isEnabled')['to'](this['queryView']['fieldView'],'isEmpty',this,'isEnabled',(_0x3399c8,_0x5b2971)=>!_0x3399c8&&_0x5b2971),_0x3fee18;}['_createShowHistoryButton'](){const _0x5dab9b=new kt(this['locale']),_0x2af956=this['resultsView'],_0x3320ac=this['locale'];_0x5dab9b['set']({'label':Ri(_0x3320ac,'History'),'withText':!0x1,'icon':_0x38f93d,'tooltip':!0x0,'tooltipPosition':'sw','class':'ck-ai-form__toggle-history'}),_0x5dab9b['bind']('isOn')['to'](_0x2af956,'isVisible'),_0x5dab9b['bind']('isEnabled')['to'](this,'isEnabled'),_0x5dab9b['on']('execute',()=>{_0x2af956['isVisible']=!_0x2af956['isVisible'],_0x2af956['isVisible']?this['filteredView']['focus']():this['focus']();});const _0x21de3f=()=>{ct['window']['requestAnimationFrame'](()=>{if(lt(this['element'])){const _0x7b4ca2=new ut(this['queryView']['fieldView']['element']),_0x4aa04d=_0x7b4ca2['width'],_0x3720cc='rtl'===_0x3320ac['uiLanguageDirection']?'left':'right';_0x7b4ca2['excludeScrollbarsAndBorders'](),_0x5dab9b['element']['style'][_0x3720cc]=_0x4aa04d-_0x7b4ca2['width']+0x1+'px';}});};return this['queryView']['fieldView']['on']('update',_0x21de3f),this['on']('render',_0x21de3f),_0x5dab9b;}['submit'](){const _0x38eae3=this['queryView']['fieldView']['element']['value'];this['fire']('submit',_0x38eae3);}['focus'](_0x297bff){-0x1===_0x297bff?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}}class Mi extends Lt{['historyGroupView'];['clearHistoryButton'];constructor(_0x33da15){super(_0x33da15),this['clearHistoryButton']=this['_createClearHistoryButton'](),this['historyGroupView']=new Dt(),this['historyGroupView']['children']['add'](this['clearHistoryButton'],0x1),this['historyGroupView']['label']=Ri(_0x33da15,'Prompt\x20history'),this['historyGroupView']['items']['delegate']('execute')['to'](this),this['items']['add'](this['historyGroupView']);}['filter'](){let _0xbffcc9=0x0;for(const _0x1294f3 of this['items'])_0xbffcc9+=_0x1294f3['items']['length'];return{'resultsCount':_0xbffcc9,'totalItemsCount':_0xbffcc9};}['_createClearHistoryButton'](){const _0x3bcc72=this['locale'],_0x5c7b1a=new kt(this['locale']);return _0x5c7b1a['set']({'label':'('+Ri(_0x3bcc72,'Clear')+')','withText':!0x0}),_0x5c7b1a['on']('execute',()=>this['fire']('clearHistory')),_0x5c7b1a;}}class Ui extends Pt{constructor(_0x490167){super();const _0x8a1987=new Ht(),_0x2c0110=new kt(this['locale'],_0x8a1987);this['children']['add'](_0x2c0110),_0x2c0110['set']({'label':_0x490167['prompt'],'withText':!0x0}),_0x2c0110['on']('execute',()=>{this['fire']('execute',{'value':_0x34bb34(_0x490167['prompt'])});});}}const Vi='CKEditor/AIFormView/PromptHistory';class Bi extends dt{constructor(){super(),this['_loadFromSessionStorage'](),this['on']('add',(_0x42ed27,_0x1527b4)=>{const _0x3fddfe=Gi(_0x1527b4['prompt']);for(const _0x1019bb of this)if(_0x1019bb!=_0x1527b4&&Gi(_0x1019bb['prompt'])===_0x3fddfe){this['remove'](_0x1019bb);break;}this['length']>0x14&&this['remove'](this['last']),this['_saveToSessionStorage']();}),this['on']('remove',()=>{this['_saveToSessionStorage']();});}['_loadFromSessionStorage'](){const _0x228393=sessionStorage['getItem'](Vi)||'[]';this['addMany'](JSON['parse'](_0x228393));}['_saveToSessionStorage'](){sessionStorage['setItem'](Vi,JSON['stringify'](this['map'](_0x1ac05e=>_0x1ac05e)));}}function Gi(_0x3feda7){return _0x3feda7['toLowerCase']()['trim']();}class Fi extends Nt{['focusTracker'];['keystrokes'];['contentArea'];['toolbar'];['promptView'];['errorView'];['_focusables'];['focusCycler'];['_promptHistory'];constructor(_0x3a4dd5,_0x1c46e4,_0x55d104=''){super(_0x3a4dd5),this['set']('isEnabled',!0x0),this['set']('isProcessing',!0x1),this['set']('prompt',''),this['set']('value',''),this['set']('isError',!0x1),this['set']('mainAction',yi['REPLACE']),this['_promptHistory']=new Bi(),this['errorView']=new Pi(_0x3a4dd5),this['contentArea']=new Li(_0x3a4dd5,_0x55d104),this['contentArea']['bind']('isProcessing')['to'](this),this['contentArea']['bind']('value')['to'](this),this['toolbar']=this['_createToolbar'](),this['toolbar']['bind']('mainAction')['to'](this),this['promptView']=this['_createPromptView'](),this['focusTracker']=new _t(),this['keystrokes']=new At(),this['_focusables']=this['createCollection']([this['contentArea'],this['contentArea']['copyButtonView'],this['toolbar'],this['promptView']]),this['focusCycler']=new Mt({'focusables':this['_focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes'],'actions':{'focusPrevious':'shift\x20+\x20tab','focusNext':'tab'}}),this['focusCycler']['chain'](this['promptView']['focusCycler']),this['promptView']['queryView']['fieldView']['bind']('value')['to'](this,'prompt');const _0x219fec=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form',_0x1c46e4],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form-content']},'children':[{'tag':'div','attributes':{'class':[_0x219fec['if']('isError','ck-hidden',_0x31e871=>!_0x31e871)]},'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'](_0x329181=0x1){-0x1===_0x329181?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 _0x55780f=this['locale'],_0x3d940d=new Hi(_0x55780f,{'queryView':{'label':Ri(_0x55780f,'Ask\x20AI\x20to\x20edit\x20or\x20generate'),'creator':Ut,'showIcon':!0x1,'showResetButton':!0x1},'infoView':{'text':{'noSearchableItems':{'primary':Ri(_0x55780f,'Empty\x20history'),'secondary':Ri(_0x55780f,'Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.')}}},'filteredView':this['_createHistoryView'](),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1});return _0x3d940d['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x497952,_0x57890b)=>_0x497952&&!_0x57890b),this['listenTo'](_0x3d940d,'submit',(_0x16a534,_0x31bec1)=>{this['prompt']=_0x31bec1;const _0x1c59ac=_0x276663(_0x31bec1);this['fire']('submitPrompt',_0x1c59ac),_0x31bec1['trim']()&&this['_promptHistory']['add']({'prompt':_0x1c59ac},0x0);},{'priority':'high'}),_0x3d940d;}['_createHistoryView'](){const _0x4da13b=new Mi(this['locale']);return _0x4da13b['historyGroupView']['items']['bindTo'](this['_promptHistory'])['as'](Ui),_0x4da13b['on']('clearHistory',()=>{this['_promptHistory']['clear'](),this['promptView']['search'](''),this['promptView']['focus']();}),_0x4da13b;}['_createToolbar'](){const _0x5b9778=new xi(this['locale']);return _0x5b9778['replaceButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x39f5dc,_0x1b196b,_0x32c319)=>_0x39f5dc&&!_0x1b196b&&!!_0x32c319),_0x5b9778['replaceButton']['delegate']('execute')['to'](this,'replaceContent'),_0x5b9778['insertButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x2e486b,_0x3bea72,_0x58615a)=>_0x2e486b&&!_0x3bea72&&!!_0x58615a),_0x5b9778['insertButton']['delegate']('execute')['to'](this,'insertContentBelow'),_0x5b9778['tryAgainButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x38d8cb,_0x3a9efb)=>_0x38d8cb&&!_0x3a9efb),_0x5b9778['tryAgainButton']['delegate']('execute')['to'](this,'tryAgainEvent'),_0x5b9778['stopButton']['bind']('isEnabled')['to'](this,'isProcessing'),_0x5b9778['stopButton']['delegate']('execute')['to'](this,'stopProcessing'),_0x5b9778;}['startProcessing'](){this['value']='',this['isError']=!0x1,this['isProcessing']=!0x0,this['contentArea']['isVisible']=!0x0,this['toolbar']['isVisible']=!0x0,this['contentArea']['focus']();}['finishProcessing'](){const _0x2c4a9b=this['locale'];this['isProcessing']=!0x1,this['prompt']='',this['promptView']['reset'](),this['value']&&(this['promptView']['queryView']['label']=Ri(_0x2c4a9b,'Ask\x20AI\x20to\x20improve\x20generated\x20text'));}['handleError'](_0x3cab0f){const _0x606b3a=this['locale'];this['finishProcessing'](),this['isError']=!0x0,this['errorView']['text']=_0x3cab0f||Ri(_0x606b3a,'AI_ERROR_FAILED'),this['value']||(this['contentArea']['isVisible']=!0x1);}}const Ki=globalThis['DataTransfer'];class Wi extends _0x2dfd9d{['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[_0x54b3bb,fi,Si,Vt];}constructor(_0x35957a){super(_0x35957a),_0x35957a['config']['define']('ai.assistant.disabledElements',['media','rawHtml','tableOfContents']),_0x35957a['config']['define']('ai.assistant.contentAreaCssClass',''),_0x35957a['config']['define']('ai.assistant.useTheme',!0x0),this['_uiCssClasses']='ck-ai-assistant-ui'+(_0x35957a['config']['get']('ai.assistant.useTheme')?'\x20ck-ai-assistant-ui_theme':'');}['init'](){const {editor:_0x3bc406}=this;this['_aiAdapter']=_0x3bc406['plugins']['get'](Si),this['_dialog']=_0x3bc406['plugins']['get'](Vt),this['_formView']=null,this['_commandDefinitions']=this['_getResolvedCommandsDefinitions']();const _0x53f68e=new Oi(_0x3bc406,Array['from'](this['_commandDefinitions']['values']()));_0x3bc406['commands']['add']('showAIAssistant',_0x53f68e),_0x3bc406['ui']['componentFactory']['add']('aiCommands',_0x3f7510=>{const _0x532168=Bt(_0x3f7510);return _0x532168['set']({'class':'ck-ai-commands-dropdown\x20'+this['_uiCssClasses']}),_0x532168['buttonView']['set']({'label':Ri(_0x3f7510,'AI\x20Commands'),'icon':_0x3b98e8,'tooltip':!0x0}),_0x532168['on']('execute',_0x280210=>this['_onExecute'](_0x280210['source']['id'])),Gt(_0x532168,_0x3bc406['ui']['view']['body'],function(_0x26db05){const _0x354031=mi(_0x26db05['config']['get']('ai.assistant.commands'),_0x26db05['locale']),_0x5586bb=$i(_0x26db05,_0x354031)['filter'](_0x142445=>_0x142445['commands']['length']);if(0x1===_0x5586bb['length'])return $i(_0x26db05,_0x5586bb[0x0]['commands'])['map'](_0x33e26e=>({'id':_0x33e26e['id'],'label':_0x33e26e['label']}));return _0x5586bb['map'](_0x3a0b1c=>{const {groupId:_0x24fd83,groupLabel:_0x102b8a,commands:_0x91e189}=_0x3a0b1c,_0x3642aa=$i(_0x26db05,_0x91e189)['map'](_0x7c7c66=>({'id':_0x7c7c66['id'],'label':_0x7c7c66['label']}));return{'id':_0x24fd83,'menu':_0x102b8a||_0x24fd83,'children':_0x3642aa};});}(_0x3bc406),{'ariaLabel':Ri(_0x3f7510,'AI\x20Commands')}),_0x532168['menuView']['menuPanelClass']='ck-ai-commands-dropdown\x20'+this['_uiCssClasses'],_0x53f68e['on']('change:enabledCommandsIds',_0x3724a9),_0x532168['menuView']['once']('render',_0x3724a9),_0x532168;function _0x3724a9(){_0x532168['isEnabled']=_0x53f68e['enabledCommandsIds']['length']>0x0;for(const _0x3be953 of _0x532168['menuView']['buttons'])_0x3be953['isEnabled']=_0x53f68e['enabledCommandsIds']['includes'](_0x3be953['id']);}}),_0x3bc406['ui']['componentFactory']['add']('menuBar:aiCommands',_0x533c66=>{const _0x77379a=new Ft(_0x533c66);_0x77379a['buttonView']['set']({'label':Ri(_0x533c66,'AI\x20Commands'),'icon':_0x3b98e8}),_0x77379a['bind']('isEnabled')['to'](_0x53f68e,'enabledCommandsIds',_0x1f72dd=>_0x1f72dd['length']>0x0);const _0x5921f4=mi(_0x3bc406['config']['get']('ai.assistant.commands'),_0x533c66);return this['_populateMenuBarMenu'](_0x53f68e,_0x77379a,_0x5921f4,_0x223feb=>this['_onExecute'](_0x223feb)),_0x77379a;}),_0x3bc406['ui']['componentFactory']['add']('aiAssistant',()=>{const _0x32574f=this['_createAIAssistantUIButton'](kt);return _0x32574f['set']({'tooltip':!0x0,'class':'ck-ai-assistant-button\x20'+this['_uiCssClasses']}),_0x32574f;}),_0x3bc406['ui']['componentFactory']['add']('menuBar:aiAssistant',()=>{const _0x475faa=this['_createAIAssistantUIButton'](Kt);return _0x475faa['set']({'role':'menuitemcheckbox'}),_0x475faa;}),this['licenseKey']=this['editor']['config']['get']('licenseKey');const _0xa31f11=this['editor'];this['_licenseKeyCheckInterval']=setInterval(()=>{let _0x4fad6f;for(const _0x1f6f0f in _0xa31f11){const _0x1d59fd=_0x1f6f0f,_0x49d9e1=_0xa31f11[_0x1d59fd];if('aiLicenseKeyValid'==_0x49d9e1||'aiLicenseKeyInvalid'==_0x49d9e1||'aiLicenseKeyExpired'==_0x49d9e1||'aiLicenseKeyDomainLimit'==_0x49d9e1||'aiLicenseKeyNotAllowed'==_0x49d9e1||'aiLicenseKeyEvaluationLimit'==_0x49d9e1||'aiLicenseKeyUsageLimit'==_0x49d9e1){delete _0xa31f11[_0x1d59fd],_0x4fad6f=_0x49d9e1,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'aiLicenseKeyInvalid'==_0x4fad6f&&_0xa31f11['_showLicenseError']('invalid'),'aiLicenseKeyExpired'==_0x4fad6f&&_0xa31f11['_showLicenseError']('expired'),'aiLicenseKeyDomainLimit'==_0x4fad6f&&_0xa31f11['_showLicenseError']('domainLimit'),'aiLicenseKeyNotAllowed'==_0x4fad6f&&_0xa31f11['_showLicenseError']('featureNotAllowed','AIAssistant'),'aiLicenseKeyEvaluationLimit'==_0x4fad6f&&_0xa31f11['_showLicenseError']('evaluationLimit'),'aiLicenseKeyUsageLimit'==_0x4fad6f&&_0xa31f11['_showLicenseError']('usageLimit');},0x3e8);}['destroy'](){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}['showUI'](_0x2c676b='',_0x3cee9c='',_0x21fdc5='custom'){const _0x2285b6=this['editor'],_0xb78e60=_0x2285b6['editing']['view'],_0x2067f8=_0x2285b6['plugins']['get'](fi),_0xa0b27a=_0x2285b6['plugins']['get'](_0x54b3bb);_0x2067f8['showFakeVisualSelection']();const _0x399e32=new Ki(),_0x1be7ae=new ClipboardEvent('copy',{'clipboardData':_0x399e32}),_0x2a905e=new _0x2769c8(_0x399e32),_0x220ec9=new _0x1a8e72(_0xb78e60,_0x1be7ae,{'dataTransfer':_0x2a905e});_0xa0b27a['_forceMarkersCopy']('comment',()=>{_0xb78e60['document']['fire']('copy',_0x220ec9);}),this['_formView']||(this['_initView'](),this['_aiAssistantController']=new vi(_0x2285b6,this['_aiAdapter']['textAdapter'],this['_formView']));let _0x599e07=_0x2a905e['getData']('text/html');const _0x5f19ad=_0x2285b6['model']['document']['selection'],_0x25e9ad=Array['from'](_0x5f19ad['getRanges']());0x1===_0x25e9ad['length']&&_0x25e9ad[0x0]['isFlat']&&!_0x5f19ad['getSelectedElement']()&&''!==_0x599e07['replace'](/ /g,'')['trim']()&&(_0x599e07='<p>'+_0x599e07+'</p>'),this['_aiAssistantController']['updateView']({'actionId':_0x21fdc5,'query':_0x2c676b,'htmlContent':_0x599e07,'label':_0x3cee9c,'mainActionLabel':yi[_0x2285b6['model']['document']['selection']['isCollapsed']?'INSERT':'REPLACE']}),'aiAssistant'!==this['_dialog']['id']?this['_dialog']['show']({'id':'aiAssistant','icon':_0x15ae43,'title':Ri(this['editor']['locale'],'AI\x20Assistant'),'content':this['_formView'],'position':Wt['EDITOR_TOP_SIDE'],'onShow':()=>{this['_formView']['focus']();},'onHide':()=>{this['_aiAssistantController']['reset'](),_0x2067f8['hideFakeVisualSelection']();}}):this['_dialog']['view']['wasMoved']||this['_dialog']['view']['updatePosition']();}['hideUI'](){this['_dialog']['hide']();}['_getResolvedCommandsDefinitions'](){const _0x129da9=new Map(),_0x2c648d=mi(this['editor']['config']['get']('ai.assistant.commands'),this['editor']['locale']);for(const _0x1167a8 of _0x2c648d)for(const _0x5c00a7 of _0x1167a8['commands'])_0x129da9['set'](_0x5c00a7['id'],{..._0x5c00a7,'groupId':_0x1167a8['groupId'],'groupLabel':_0x1167a8['groupLabel']||_0x1167a8['groupId']});return _0x129da9;}['_createAIAssistantUIButton'](_0x5da7a3){const _0x185573=this['editor'],_0x56de0c=_0x185573['commands']['get']('showAIAssistant'),_0x441d7e=new _0x5da7a3(_0x185573['locale']);return _0x441d7e['set']({'label':Ri(_0x185573['locale'],'AI\x20Assistant'),'icon':_0x15ae43,'isToggleable':!0x0}),_0x441d7e['bind']('isEnabled')['to'](_0x56de0c),_0x441d7e['bind']('isOn')['to'](this['_dialog'],'id',_0x27bf39=>'aiAssistant'===_0x27bf39),this['listenTo'](_0x441d7e,'execute',()=>{_0x441d7e['isOn']?this['hideUI']():_0x56de0c['execute']();}),_0x441d7e;}['_initView'](){const _0x3096db=this['editor']['plugins']['get'](fi);this['_formView']=new Fi(this['editor']['locale'],this['_uiCssClasses'],this['editor']['config']['get']('ai.assistant.contentAreaCssClass')),this['_formView']['on']('change:value',()=>{this['_dialog']['view']['wasMoved']||this['_dialog']['view']['updatePosition']();}),this['_formView']['promptView']['queryView']['fieldView']['on']('update',()=>{this['_dialog']['view']['wasMoved']||this['_dialog']['view']['updatePosition']();}),this['listenTo'](this['_formView'],'replaceContent',()=>{_0x3096db['insertContent'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['listenTo'](this['_formView'],'insertContentBelow',()=>{_0x3096db['insertContentBelow'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['_initAriaAiStatusChangeAnnouncements']();}['_initAriaAiStatusChangeAnnouncements'](){const {locale:_0x3372ae,ui:{ariaLiveAnnouncer:_0x2621a1}}=this['editor'];this['_formView']['contentArea']['on']('change:isProcessing',(_0x493612,_0x1ca0cb,_0x48199b)=>{const _0x1cfc5a=this['_aiAssistantController']['currentContext'];_0x48199b?_0x2621a1['announce'](Ri(_0x3372ae,'AI\x20is\x20writing')):_0x1cfc5a&&_0x2621a1['announce'](Ri(_0x3372ae,'Generated\x20content:\x20%0',_0x1cfc5a),{'politeness':'polite','isUnsafeHTML':!0x0});}),this['_formView']['on']('change:isError',(_0x3b763c,_0x1f7639,_0xb43e57)=>{if(_0xb43e57){const _0x5cbe34=this['_formView']['errorView']['text'];_0x2621a1['announce'](Ri(_0x3372ae,'Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x5cbe34));}});}['_onExecute'](_0x1731bc){const _0x1fbe59=this['_commandDefinitions']['get'](_0x1731bc),_0x445d8b=this['editor'],_0x3bd3d6=_0x445d8b['model']['document']['selection'],_0x5ad9e1=_0x445d8b['commands']['get']('showAIAssistant'),_0x36813d=_0x445d8b['plugins']['get'](fi),_0x5c43b6=''+(_0x1fbe59['groupId']!==pi?_0x1fbe59['groupLabel']+':\x20':'')+_0x1fbe59['label'];if(!0x1!==_0x1fbe59['requiresContent']&&_0x3bd3d6['isCollapsed']){const _0x2769c3=gt(_0x3bd3d6['getSelectedBlocks']())||_0x445d8b['model']['schema']['getLimitElement'](_0x3bd3d6);_0x445d8b['model']['change'](_0x226ad4=>{_0x226ad4['setSelection'](_0x2769c3,'in');});}_0x36813d['showFakeVisualSelection'](),_0x5ad9e1['execute'](_0x1fbe59['prompt'],_0x5c43b6,'command:'+_0x1731bc);}['_populateMenuBarMenu'](_0xd2740d,_0x48728c,_0x23bf9a,_0x24a081){const _0x1742c1=this['editor'],_0x370cb2=_0x1742c1['locale'],_0x35a9cf=new Yt(_0x370cb2),_0x3e923d=$i(_0x1742c1,_0x23bf9a)['filter'](_0x257541=>_0x257541['commands']['length']);0x1===_0x3e923d['length']?this['_getMenuBarGroupButtons']({'command':_0xd2740d,'commands':_0x3e923d[0x0]['commands'],'parentMenuView':_0x48728c,'onExecute':_0x24a081})['forEach'](_0x17f4bb=>_0x35a9cf['items']['add'](_0x17f4bb)):_0x3e923d['forEach'](({groupId:_0x2ded52,groupLabel:_0xf79c9f,commands:_0x536117})=>{const _0x200557=new $t(_0x370cb2,_0x48728c),_0x3ea771=new Ft(_0x370cb2),_0x2cbe40=new Yt(_0x370cb2),_0x277999=this['_getMenuBarGroupButtons']({'command':_0xd2740d,'commands':_0x536117,'parentMenuView':_0x3ea771,'onExecute':_0x24a081});_0x3ea771['buttonView']['set']({'label':_0xf79c9f||_0x2ded52}),_0x3ea771['delegate']('execute')['to'](_0x48728c),_0x2cbe40['items']['addMany'](_0x277999),_0x3ea771['panelView']['children']['add'](_0x2cbe40),_0x200557['children']['add'](_0x3ea771),_0x35a9cf['items']['add'](_0x200557);}),_0x48728c['panelView']['children']['add'](_0x35a9cf);}['_getMenuBarGroupButtons']({command:_0x286af6,commands:_0x58cd54,parentMenuView:_0x18ef94,onExecute:_0x41281c}){const _0x5d2d2e=this['editor'],_0x3a2c68=_0x5d2d2e['locale'];return $i(_0x5d2d2e,_0x58cd54)['map'](_0x419ef6=>{const _0xd985c=new $t(_0x3a2c68,_0x18ef94),_0x13e3fc=new Kt(_0x3a2c68);return _0x13e3fc['set']({'label':_0x419ef6['label']}),_0x13e3fc['delegate']('execute')['to'](_0x18ef94),_0x13e3fc['on']('execute',()=>_0x41281c(_0x419ef6['id'])),_0x13e3fc['bind']('isEnabled')['to'](_0x286af6,'enabledCommandsIds',_0x47e0c3=>_0x47e0c3['includes'](_0x419ef6['id'])),_0xd985c['children']['add'](_0x13e3fc),_0xd985c;});}}function Yi(_0x22e661,_0x2d6fa8){return void 0x0!==_0x22e661['order']&&void 0x0===_0x2d6fa8['order']?0x1:void 0x0===_0x22e661['order']&&void 0x0!==_0x2d6fa8['order']?-0x1:void 0x0!==_0x22e661['order']&&void 0x0!==_0x2d6fa8['order']?_0x22e661['order']-_0x2d6fa8['order']:0x0;}function $i(_0x5b1e5c,_0x26a3a0){_0x26a3a0['sort'](Yi);const _0x55d181={},_0x27fd3d=[];for(const _0x25a868 of _0x26a3a0)if(void 0x0!==_0x25a868['order']){if(_0x25a868['order']in _0x55d181)throw new ot('ai-commands-config-order-collision',_0x5b1e5c,{'conflictingDefinitions':[_0x25a868,_0x55d181[_0x25a868['order']]]});_0x55d181[_0x25a868['order']]=_0x25a868,_0x27fd3d['splice'](_0x25a868['order'],0x0,_0x25a868);}else _0x27fd3d['push'](_0x25a868);return _0x27fd3d;}class qi extends _0x2dfd9d{static get['requires'](){return[Wi,fi];}static get['pluginName'](){return'AIAssistant';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x5fcf50){super(_0x5fcf50);const _0x5befcf=_0x5fcf50['config'],_0x95f6d1=_0x5fcf50['locale'];_0x5befcf['define']('ai.assistant.preserveComments',!0x0),_0x5befcf['define']('ai.assistant.commands',Qi(_0x95f6d1)),_0x5befcf['define']('ai.assistant.extraCommandGroups',[]),_0x5befcf['define']('ai.assistant.removeCommands',[]);let _0x432d19=mi(_0x5befcf['get']('ai.assistant.commands'),_0x95f6d1);const _0x20a21a=_0x5befcf['get']('ai.assistant.extraCommandGroups'),_0x7664df=_0x5befcf['get']('ai.assistant.removeCommands');_0x20a21a['forEach'](_0x4f71d6=>{const _0x455a1d=_0x432d19['find'](_0x32de90=>_0x32de90['groupId']===_0x4f71d6['groupId']);_0x455a1d?_0x455a1d['commands']=_0x455a1d['commands']['concat'](_0x4f71d6['commands']):_0x432d19['push'](_0x4f71d6);}),_0x432d19=_0x432d19['filter'](_0x810b05=>!_0x7664df['includes'](_0x810b05['groupId'])),_0x432d19['forEach'](_0x54f0b8=>{_0x54f0b8['commands']=_0x54f0b8['commands']['filter'](_0x371900=>!_0x7664df['includes'](_0x371900['id']));}),_0x5befcf['set']('ai.assistant.commands',_0x432d19);}}function Qi(_0x279a9f){return[{'groupId':'editOrReview','groupLabel':Ri(_0x279a9f,'Edit\x20or\x20review'),'commands':[{'id':'improveWriting','label':Ri(_0x279a9f,'Improve\x20writing'),'prompt':'Fix\x20spelling\x20mistakes,\x20use\x20proper\x20grammar\x20and\x20apply\x20good\x20writing\x20practices.\x20Do\x20not\x20lose\x20the\x20original\x20meaning.'},{'id':'makeShorter','label':Ri(_0x279a9f,'Make\x20shorter'),'prompt':'Remove\x20any\x20repetitive,\x20redundant,\x20or\x20non-essential\x20writing\x20in\x20this\x20content\x20without\x20changing\x20the\x20meaning\x20or\x20losing\x20any\x20key\x20information.'},{'id':'makeLonger','label':Ri(_0x279a9f,'Make\x20longer'),'prompt':'Improve\x20this\x20content\x20by\x20using\x20descriptive\x20language\x20and\x20inserting\x20more\x20information\x20and\x20more\x20detailed\x20explanations.'},{'id':'simplifyLanguage','label':Ri(_0x279a9f,'Simplify\x20language'),'prompt':'Simplify\x20the\x20writing\x20style\x20of\x20this\x20content\x20and\x20reduce\x20the\x20complexity,\x20so\x20that\x20the\x20content\x20is\x20easy\x20to\x20understand.'}]},{'groupId':'generate','groupLabel':Ri(_0x279a9f,'Generate\x20from\x20selection'),'commands':[{'id':'summarize','label':Ri(_0x279a9f,'Summarize'),'prompt':'Summarize\x20this\x20content\x20into\x20one\x20paragraph\x20of\x20text.\x20Include\x20only\x20the\x20key\x20ideas\x20and\x20conclusions.\x20Keep\x20it\x20short.\x20Do\x20not\x20keep\x20original\x20text\x20formatting.'},{'id':'continue','label':Ri(_0x279a9f,'Continue'),'prompt':'Start\x20with\x20the\x20provided\x20content\x20and\x20write\x20at\x20the\x20end\x20of\x20it\x20continuing\x20this\x20topic.\x20Keep\x20the\x20added\x20part\x20short.'}]},{'groupId':'changeTone','groupLabel':Ri(_0x279a9f,'Change\x20tone'),'commands':[{'id':'professional','label':Ri(_0x279a9f,'Professional'),'prompt':'Improve\x20using\x20polished,\x20formal,\x20and\x20respectful\x20language\x20to\x20convey\x20professional\x20expertise\x20and\x20competence.'},{'id':'casual','label':Ri(_0x279a9f,'Casual'),'prompt':'Improve\x20using\x20casual,\x20informal\x20language\x20to\x20convey\x20a\x20casual\x20conversation\x20with\x20a\x20real\x20person.'},{'id':'direct','label':Ri(_0x279a9f,'Direct'),'prompt':'Improve\x20using\x20direct\x20language,\x20using\x20only\x20the\x20essential\x20information.'},{'id':'confident','label':Ri(_0x279a9f,'Confident'),'prompt':'Improve\x20using\x20compelling,\x20optimistic\x20language\x20to\x20convey\x20confidence\x20in\x20the\x20writing.'},{'id':'friendly','label':Ri(_0x279a9f,'Friendly'),'prompt':'Improve\x20using\x20friendly,\x20comforting\x20language,\x20to\x20convey\x20understanding\x20and\x20empathy.'}]},{'groupId':'changeStyle','groupLabel':Ri(_0x279a9f,'Change\x20style'),'commands':[{'id':'business','label':Ri(_0x279a9f,'Business'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20business\x20professional\x20with\x20formal\x20language.'},{'id':'legal','label':Ri(_0x279a9f,'Legal'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20legal\x20professional\x20using\x20valid\x20legal\x20terminology.'},{'id':'journalism','label':Ri(_0x279a9f,'Journalism'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20journalist\x20using\x20engaging\x20language\x20to\x20convey\x20the\x20importance\x20of\x20the\x20information.'},{'id':'poetic','label':Ri(_0x279a9f,'Poetic'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20poem\x20using\x20poetic\x20techniques\x20without\x20losing\x20the\x20original\x20meaning.'}]},{'groupId':'translate','groupLabel':Ri(_0x279a9f,'Translate'),'commands':[{'id':'translateEnglish','label':Ri(_0x279a9f,'English'),'prompt':'Translate\x20the\x20content\x20to\x20English\x20language.'},{'id':'translateSpanish','label':Ri(_0x279a9f,'Spanish'),'prompt':'Translate\x20the\x20content\x20to\x20Spanish\x20language.'},{'id':'translatePortuguese','label':Ri(_0x279a9f,'Portuguese'),'prompt':'Translate\x20the\x20content\x20to\x20Portuguese\x20language.'},{'id':'translateGerman','label':Ri(_0x279a9f,'German'),'prompt':'Translate\x20the\x20content\x20to\x20German\x20language.'},{'id':'translateFrench','label':Ri(_0x279a9f,'French'),'prompt':'Translate\x20the\x20content\x20to\x20French\x20language.'},{'id':'translateChinese','label':Ri(_0x279a9f,'Simplified\x20Chinese'),'prompt':'Translate\x20the\x20content\x20to\x20Simplified\x20Chinese\x20language.'},{'id':'translateHindi','label':Ri(_0x279a9f,'Hindi'),'prompt':'Translate\x20the\x20content\x20to\x20Hindi\x20language.'},{'id':'translateArabic','label':Ri(_0x279a9f,'Arabic'),'prompt':'Translate\x20the\x20content\x20to\x20Arabic\x20language.'}]}];}class Xi extends _0x2dfd9d{['abortController'];static get['requires'](){return[Si];}constructor(_0x1c9832){super(_0x1c9832),this['abortController']=new AbortController();}['init'](){this['editor']['plugins']['get'](Si)['textAdapter']=this;}['abort'](){this['abortController']['signal']['aborted']||(this['abortController']['abort'](),this['abortController']=new AbortController());}async['makeRequest'](_0x4e4747){return this['sendRequest'](_0x4e4747)['catch'](_0x732ce=>{if(_0x732ce instanceof bi)return Promise['reject'](_0x732ce);if('AbortError'==_0x732ce['name'])return Promise['resolve']();throw console['error'](_0x732ce),new ot('aitextadapter-send-request-failed',null);});}async['_prepareRequestHeaders'](_0x5ef57a,_0x519696){const _0x48ad66=this['editor']['locale'],_0x1273be={'Content-Type':'application/json'};if('object'==typeof _0x5ef57a)Object['assign'](_0x1273be,_0x5ef57a);else{if(_0x5ef57a)try{const _0x538bac=await _0x5ef57a(_0x519696);Object['assign'](_0x1273be,_0x538bac);}catch{return Promise['reject'](new bi(Ri(_0x48ad66,'AI_ERROR_GET_HEADERS')));}}return _0x1273be;}async['_prepareRequestParameters'](_0x4b1778,_0x348c4a){const _0x2799c4=this['editor']['locale'];if('object'==typeof _0x4b1778)return _0x4b1778;try{return await _0x4b1778(_0x348c4a);}catch{return Promise['reject'](new bi(Ri(_0x2799c4,'AI_ERROR_GET_PARAMETERS')));}}}class zi extends Xi{['_apiUrl'];['_requestHeaders'];['_requestParameters'];static get['pluginName'](){return'OpenAITextAdapter';}constructor(_0x27b080){super(_0x27b080),_0x27b080['config']['define']('ai.assistant.adapter.openAI.apiUrl','https://api.openai.com/v1/chat/completions'),_0x27b080['config']['get']('ai.assistant.adapter.openAI.requestParameters')||_0x27b080['config']['define']('ai.assistant.adapter.openAI.requestParameters',{'model':'gpt-4o','temperature':0x1,'top_p':0x1,'stream':!0x0}),this['_apiUrl']=_0x27b080['config']['get']('ai.assistant.adapter.openAI.apiUrl'),this['_requestHeaders']=_0x27b080['config']['get']('ai.assistant.adapter.openAI.requestHeaders')||{},this['_requestParameters']=_0x27b080['config']['get']('ai.assistant.adapter.openAI.requestParameters');}async['sendRequest']({query:_0xdf2c41,context:_0x1ff74c,onData:_0x4b34d3,actionId:_0x19a45c}){const _0x4ad698=this['editor']['locale'],_0x4a7a1d=await this['prepareMessages'](_0xdf2c41,_0x1ff74c,_0x19a45c),_0x245ad0=await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x19a45c),_0x96428a=await this['_prepareRequestParameters'](this['_requestParameters'],_0x19a45c),_0x1add91={'messages':_0x4a7a1d,..._0x96428a},_0x52853e={'method':'POST','headers':_0x245ad0,'body':JSON['stringify'](_0x1add91),'signal':this['abortController']['signal']},_0x23b09b=await fetch(this['_apiUrl'],_0x52853e);if(_0x23b09b['ok'])return _0x96428a['stream']?await this['_readStreamableResponse'](_0x23b09b,_0x4b34d3):await this['_readStaticResponse'](_0x23b09b,_0x4b34d3),Promise['resolve']();{const _0x3d98d1=await _0x23b09b['text']();return _0x3d98d1['includes']('context_length_exceeded')?Promise['reject'](new bi(Ri(_0x4ad698,'AI_ERROR_CONTEXT_LENGTH'))):_0x3d98d1['includes']('Moderation')?Promise['reject'](new bi(Ri(_0x4ad698,'AI_ERROR_MODERATION'))):Promise['reject'](new Error(_0x3d98d1));}}async['prepareMessages'](_0x4e75c8,_0x26e86a,_0x520bca){let _0x1a9a83,_0x26554a;return _0x26e86a?(_0x1a9a83='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.',_0x26554a='Instruction:\x0a'+_0x4e75c8+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x26e86a):(_0x1a9a83='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.',_0x26554a=_0x4e75c8),[{'role':'system','content':_0x1a9a83},{'role':'user','content':_0x26554a}];}async['_readStreamableResponse'](_0x486eb4,_0x54f1ad){const _0x4c3abc=_0x486eb4['body']['getReader'](),_0x1f3694=new TextDecoder();let _0x22074f='',_0x204754='',_0x5b8028='',_0x3f7e3a=!0x1;for(;!_0x3f7e3a;){const {done:_0x386ce4,value:_0x3ffd95}=await _0x4c3abc['read'](),_0x2e83dd=_0x22074f+_0x1f3694['decode'](_0x3ffd95);let _0x2c39e8='';_0x3f7e3a=_0x386ce4;try{_0x2c39e8=this['_cleanUpData'](_0x2e83dd),_0x22074f='';}catch{_0x22074f=_0x2e83dd;continue;}_0x204754+=_0x2c39e8,!_0x3f7e3a&&this['_isBufferIncomplete'](_0x204754)||_0x204754&&(_0x5b8028+=_0x204754,_0x204754='',_0x54f1ad(_0x5b8028));}return Promise['resolve']();}async['_readStaticResponse'](_0x4530e7,_0x50bc05){return _0x50bc05((await _0x4530e7['json']())['choices'][0x0]['message']['content']),Promise['resolve']();}['_isBufferIncomplete'](_0x69a6ba){const _0xf5c512=_0x69a6ba['split']('<')['length']!==_0x69a6ba['split']('>')['length'],_0x5af1e0=_0x69a6ba['length']<0x1e;return _0xf5c512&&_0x5af1e0;}['_cleanUpData'](_0x3926aa){return _0x3926aa['split'](/\n(?![^{]*\})/g)['map'](_0x38fa5c=>_0x38fa5c['replace']('data:\x20',''))['filter'](_0x5014de=>_0x5014de&&_0x5014de['length']>0x0&&'[DONE]'!==_0x5014de)['map'](_0x2a97ee=>{const {choices:_0x34052d}=JSON['parse'](_0x2a97ee);if(_0x34052d[0x0]?.['delta']?.['content'])return _0x34052d[0x0]['delta']['content'];})['filter'](_0x14a2cd=>_0x14a2cd)['join']('');}}class ji extends Xi{static get['pluginName'](){return'AWSTextAdapter';}['init'](){super['init'](),It('ai-aws-adapter-not-supported');}async['sendRequest'](_0x18df18){throw Et('ai-aws-adapter-not-supported'),new bi(Ri(this['editor']['locale'],'AI_ERROR_AWS_NOT_SUPPORTED'));}}class Ji extends kt{constructor(_0x52995f,_0x34c202={}){super(_0x52995f),this['isToggleable']=!0x0,this['set']('side',_0x34c202['side']||'top');const _0x2bc497=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-tab-button',...Tt(_0x34c202['class']||[]),_0x2bc497['to']('side',_0x523dde=>'ck-tab-button_'+_0x523dde),_0x2bc497['to']('class')]}});}['show'](){this['set']('isVisible',!0x0);}['hide'](){this['set']('isVisible',!0x1);}}class Zi extends Nt{['children'];constructor(_0x5d0efc,_0x1708cc={}){super(_0x5d0efc);const _0x1b32bb=this['bindTemplate'];this['set']('isVisible',!0x1),this['set']('class',''),this['children']=this['createCollection'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck-tab-panel',...Tt(_0x1708cc['class']||[]),_0x1b32bb['to']('class'),_0x1b32bb['if']('isVisible','ck-hidden',_0x1b006a=>!_0x1b006a)]},'children':this['children']});}['show'](){this['set']('isVisible',!0x0);}['hide'](){this['set']('isVisible',!0x1);}}class ts extends Nt{['buttonViews']=this['createCollection']();['panelViews']=this['createCollection']();['_tabs']=new Map();constructor(_0xec1005,_0x11bbce={}){super(_0xec1005),this['set']('class',void 0x0),this['set']('activeTab',null),this['set']('side',_0x11bbce['side']||'top'),this['set']('isMaximized',!0x1);const _0x1aed8e=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset','ck-tabs',...Tt(_0x11bbce['class']||[]),_0x1aed8e['to']('side',_0x5ef181=>'ck-tabs_'+_0x5ef181),_0x1aed8e['to']('class'),_0x1aed8e['to']('isMaximized',_0x11392a=>_0x11392a?'ck-ai-tabs_maximized':'')],'tabindex':'0'},'children':[{'tag':'div','attributes':{'class':['ck','ck-tabs__buttons-container',_0x1aed8e['to']('side',_0x5e24d8=>'ck-tabs__buttons-container_'+_0x5e24d8)]},'children':this['buttonViews']},{'tag':'div','attributes':{'class':['ck','ck-tabs__panels-container',_0x1aed8e['to']('side',_0x2e7fde=>'ck-tabs__panels-container_'+_0x2e7fde)]},'children':this['panelViews']},...Tt(_0x11bbce['children']||[])]});}['getTabIds'](){return[...this['_tabs']['keys']()];}['getTab'](_0x193597){const _0x249848=this['_tabs']['get'](_0x193597);return _0x249848||null;}['addTab'](_0xa577a){const _0x47f571=this['_setupButton']({'id':_0xa577a['id'],'label':_0xa577a['buttonLabel'],'icon':_0xa577a['buttonIcon'],'order':_0xa577a['order']}),_0x55f998=new Zi(this['locale']);return _0x55f998['render'](),_0xa577a['content']&&_0x55f998['children']['add'](_0xa577a['content']),this['panelViews']['add'](_0x55f998),this['_tabs']['set'](_0xa577a['id'],{'button':_0x47f571,'panel':_0x55f998,'order':void 0x0!==_0xa577a['order']?_0xa577a['order']:null}),this['fire']('addTab:'+_0xa577a['id'],{'id':_0xa577a['id'],'button':_0x47f571,'panel':_0x55f998}),null===this['activeTab']?this['activateTab'](_0xa577a['id']):this['_hidePanel'](_0xa577a['id']),{'button':_0x47f571,'panel':_0x55f998};}['activateTab'](_0x45bf4b){if(null!==_0x45bf4b&&!this['getTab'](_0x45bf4b))throw new ot('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0x45bf4b});this['activeTab']!==_0x45bf4b&&(this['activeTab']&&this['_hidePanel'](this['activeTab']),this['activeTab']=_0x45bf4b,_0x45bf4b&&this['_showPanel'](_0x45bf4b),this['fire']('activateTab:'+_0x45bf4b,_0x45bf4b));}['showTab'](_0x296ec5){if(!this['getTab'](_0x296ec5))throw new ot('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0x296ec5});this['_showPanel'](_0x296ec5),this['_showButton'](_0x296ec5),this['fire']('show:'+_0x296ec5,_0x296ec5);}['hideTab'](_0x48e896){if(!this['getTab'](_0x48e896))throw new ot('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0x48e896});const _0x1d41a2=this['activeTab'];this['_hidePanel'](_0x48e896),this['_hideButton'](_0x48e896);const _0x2cc523=this['getTabIds']();_0x1d41a2===_0x48e896&&_0x2cc523['length']>0x1&&this['activateTab'](_0x2cc523['find'](_0x4530ca=>_0x4530ca!==_0x48e896)),this['fire']('hide:'+_0x48e896,_0x48e896);}['_getPanel'](_0x334404){const _0x2154aa=this['_tabs']['get'](_0x334404);return _0x2154aa?_0x2154aa['panel']:null;}['_showPanel'](_0x543ef2){null!==this['activeTab']&&this['activeTab']!==_0x543ef2||this['_getPanel'](_0x543ef2)['show']();}['_hidePanel'](_0x3675d8){const _0x5c1040=this['_getPanel'](_0x3675d8);_0x5c1040['isVisible']&&(this['activeTab']===_0x3675d8&&(this['activeTab']=null),_0x5c1040['hide']());}['_getButton'](_0x5d3744){const _0x266105=this['_tabs']['get'](_0x5d3744);return _0x266105?_0x266105['button']:null;}['_showButton'](_0x436542){this['_getButton'](_0x436542)['show']();}['_hideButton'](_0x1517e5){this['_getButton'](_0x1517e5)['hide']();}['_setupButton'](_0x14db2a){const _0x4b0622=new Ji(this['locale'],{'side':this['side']}),_0x569d31=this['buttonViews'];if(_0x4b0622['set']({'label':_0x14db2a['label'],'icon':_0x14db2a['icon'],'tooltip':!0x0,'withText':!0x0}),_0x4b0622['bind']('isOn')['to'](this,'activeTab',_0x546ecf=>_0x546ecf===_0x14db2a['id']),_0x4b0622['bind']('side')['to'](this,'side'),_0x14db2a['order']){const _0x5235f2=[...this['_tabs']]['reduce']((_0x2c4572,_0x1a752a)=>{const _0x2a5abf=_0x1a752a[0x0],{order:_0x54e206}=_0x1a752a[0x1];return!_0x54e206||_0x54e206>_0x14db2a['order']?_0x2c4572:_0x54e206>=_0x2c4572['order']?{'id':_0x2a5abf,'order':_0x54e206}:_0x2c4572;},{'id':'','order':0x0}),_0x2ab861=_0x569d31['getIndex'](this['_getButton'](_0x5235f2['id']));_0x569d31['add'](_0x4b0622,_0x2ab861+0x1);}else _0x569d31['add'](_0x4b0622);return _0x4b0622['on']('execute',()=>{this['activateTab'](_0x14db2a['id']);}),_0x4b0622;}}const es=['overlay','sidebar','custom'],is=['left','right'];class ss extends ts{constructor(_0xc3f1f2,_0x138201={}){super(_0xc3f1f2,_0x138201),this['set']('type',_0x138201['type']||'sidebar'),this['set']('side',_0x138201['side']||'right'),this['set']('isVisible',_0x138201['visibleByDefault']??!0x0);const _0x298e00=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-tabs',_0x298e00['if']('type','ck-ai-tabs__overlay',_0x38d778=>'overlay'===_0x38d778),_0x298e00['if']('type','ck-ai-tabs__sidebar',_0x589eb1=>'sidebar'===_0x589eb1),_0x298e00['if']('isVisible','ck-hidden',_0x828d51=>!_0x828d51)]}}),this['buttonViews']['on']('add',(_0x48b07a,_0x27250f)=>{_0x27250f['set']('withText',!0x1);});}}class ns extends _0x1aa7e1{['view'];['container']=null;['showResizeButton']=!0x0;static get['pluginName'](){return'AITabs';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0xb53228){super(_0xb53228);const _0x5d81bc=this['context']['config']['get']('ai.container');if(this['set']('side','right'),!_0x5d81bc)throw new ot('ai-tabs-configuration-not-found');if(void 0x0!==_0x5d81bc['showResizeButton']&&(this['showResizeButton']=_0x5d81bc['showResizeButton']),'sidebar'!==_0x5d81bc['type']&&'overlay'!==_0x5d81bc['type']||_0x5d81bc['side']&&(this['side']=_0x5d81bc['side']),'sidebar'===_0x5d81bc['type']){if(this['container']=_0x5d81bc['element'],this['set']('type','sidebar'),!this['container'])throw new ot('ai-tabs-sidebar-container-element-not-found');}else'overlay'===_0x5d81bc['type']?(this['container']=document['body'],this['set']('type','overlay')):(this['container']=null,this['set']('type','custom'));this['view']=new ss(this['context']['locale'],{'side':this['side'],'type':this['type'],'visibleByDefault':void 0x0===_0x5d81bc['visibleByDefault']||_0x5d81bc['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 _0xbeb021&&this['context']['ui']['focusTracker']['add'](this['view']['element']);}['switchType'](_0x56b640){if(_0x56b640&&this['type']!==_0x56b640){if(!es['includes'](_0x56b640))throw new ot('ai-tabs-unsupported-ui-type');this['type']=_0x56b640;}}['switchSide'](_0x5dab08){if(_0x5dab08&&this['side']!==_0x5dab08){if(!is['includes'](_0x5dab08))throw new ot('ai-tabs-unsupported-ui-side');this['side']=_0x5dab08;}}['resize'](){this['view']['isMaximized']=!this['view']['isMaximized'],this['fire']('resizedTabs',this['view']['isMaximized']);}['destroy'](){super['destroy'](),this['view']['destroy'](),this['view']['element']&&this['view']['element']['remove']();}}class rs extends _0x1aa7e1{['_apiUrl'];['_token'];['_decoder'];['_responseCache'];static get['requires'](){return[_0x4eb882];}static get['pluginName'](){return'AIConnector';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x2ed0e0){super(_0x2ed0e0),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 _0x32adbe=this['context']['plugins']['get'](_0x4eb882);if(!_0x32adbe['token'])throw new ot('ai-missing-token',this);this['_token']=_0x32adbe['token'];}['startConversation'](_0x115dcb,_0x16ab21){const _0x1198e6=this['_sendApiRequest']('/conversations','POST',{'id':_0x115dcb,'group':_0x16ab21});return{'getConversation':async()=>(await _0x1198e6['request'])['json'](),'abortController':_0x1198e6['abortController']};}['queryAssistant']({message:_0x194318,conversationId:_0x579090,parts:_0x2e8beb,capabilities:_0x1bd13b,model:_0x5dfc94,attributes:_0x3fe0f7}){const _0x236ed8={'prompt':_0x194318,'content':_0x2e8beb,'model':_0x5dfc94,..._0x1bd13b&&{'capabilities':_0x1bd13b},..._0x3fe0f7&&{'attributes':_0x3fe0f7}},_0x25775c=this['_sendApiRequest']('/conversations/'+_0x579090+'/messages','POST',_0x236ed8);return{'getStream':async()=>{const _0x3e8bd9=(await _0x25775c['request'])['body'];return this['_getStreamReader'](_0x3e8bd9);},'abortController':_0x25775c['abortController']};}['executeCustomAction']({content:_0x42759f,message:_0x160b0d,model:_0xac3030,outputFormat:_0x4f9a22}){const _0x3c8cc6={'content':[{'type':'text','content':_0x42759f}],'prompt':_0x160b0d,'model':_0xac3030,'outputFormat':_0x4f9a22},_0x38326c=this['_sendApiRequest']('/actions/custom/calls','POST',_0x3c8cc6);return{'getStream':async()=>{const _0x4ca888=(await _0x38326c['request'])['body'];return this['_getStreamReader'](_0x4ca888);},'abortController':_0x38326c['abortController']};}['executeAction']({actionName:_0x2bbadb,content:_0x4c6bba,args:_0x393af9}){const _0x4726b9={'content':[{'type':'text','content':_0x4c6bba}],'args':_0x393af9},_0x530c12=this['_sendApiRequest']('/actions/system/'+_0x2bbadb+'/calls','POST',_0x4726b9);return{'getStream':async()=>{const _0x37e07d=(await _0x530c12['request'])['body'];return this['_getStreamReader'](_0x37e07d);},'abortController':_0x530c12['abortController']};}['uploadFile'](_0x425fb8,_0x5410ca,_0x3fd3e0){const _0x119623=new FormData();_0x119623['append']('file',_0x5410ca,_0x5410ca['name']),_0x3fd3e0&&_0x119623['append']('attributes',JSON['stringify'](_0x3fd3e0));const _0x4e03a6=this['_sendApiRequest']('/conversations/'+_0x425fb8+'/files','POST',_0x119623);return{'getId':async()=>(await _0x4e03a6['request'])['json'](),'abortController':_0x4e03a6['abortController']};}['fetchDocument'](_0x256ba6,_0x18af80){const _0x2eb7b7=this['_sendApiRequest']('/conversations/'+_0x256ba6+'/documents/'+_0x18af80,'GET');return{'getDocument':async()=>(await _0x2eb7b7['request'])['json'](),'abortController':_0x2eb7b7['abortController']};}['uploadDocument'](_0x7d8b27,_0xa51d25,_0x31bd31){const _0x197ee0={'content':_0xa51d25};_0x31bd31&&(_0x197ee0['attributes']=_0x31bd31);const _0x3781cd=this['_sendApiRequest']('/conversations/'+_0x7d8b27+'/documents','POST',_0x197ee0);return{'getId':async()=>(await _0x3781cd['request'])['json'](),'abortController':_0x3781cd['abortController']};}['fetchConversations'](_0x1d8647,_0xaa9e54={}){const _0x1baa02=new URLSearchParams();_0x1baa02['append']('group',_0x1d8647),_0x1baa02['append']('excludeEmpty',!0x1!==_0xaa9e54['excludeEmpty']?'true':'false'),_0x1baa02['append']('limit',_0xaa9e54['limit']?_0xaa9e54['limit']['toString']():'100'),_0x1baa02['append']('sortBy',_0xaa9e54['sortBy']?_0xaa9e54['sortBy']:'createdAt'),_0x1baa02['append']('order',_0xaa9e54['order']?_0xaa9e54['order']:'desc');const _0x569286=this['_sendApiRequest']('/conversations?'+_0x1baa02['toString'](),'GET');return{'getConversations':async()=>{const _0x534b24=await _0x569286['request'];return(await _0x534b24['json']())['items'];},'abortController':_0x569286['abortController']};}['deleteConversation'](_0x5a76f8){const _0x257a86=this['_sendApiRequest']('/conversations/'+_0x5a76f8,'DELETE');return{'execute':async()=>{await _0x257a86['request'];},'abortController':_0x257a86['abortController']};}['updateConversation'](_0x134f47,_0x3103e0){const _0xa60bdb=this['_sendApiRequest']('/conversations/'+_0x134f47,'PATCH',_0x3103e0);return{'getResult':async()=>(await _0xa60bdb['request'],_0x3103e0),'abortController':_0xa60bdb['abortController']};}['fetchConversation'](_0x14d771){const _0x4ae19d=this['_sendApiRequest']('/conversations/'+_0x14d771,'GET');return{'getConversation':async()=>(await _0x4ae19d['request'])['json'](),'abortController':_0x4ae19d['abortController']};}['fetchConversationMessages'](_0x43b8c9){const _0xac13f1=this['_sendApiRequest']('/conversations/'+_0x43b8c9+'/messages','GET');return{'getMessages':async()=>{const _0x45d842=await _0xac13f1['request'];return(await _0x45d842['json']())['items'];},'abortController':_0xac13f1['abortController']};}['uploadUrl'](_0x39bfed,_0x1c1eba,_0x219de4){const _0x3241cf=this['_sendApiRequest']('/conversations/'+_0x39bfed+'/web-resources','POST',{'url':_0x1c1eba,'attributes':_0x219de4});return{'getId':async()=>(await _0x3241cf['request'])['json'](),'abortController':_0x3241cf['abortController']};}['getModels'](_0x1ae2c2='en'){const _0x454c95=new URLSearchParams();_0x454c95['append']('language',_0x1ae2c2);const _0x54bb96='/models/1?'+_0x454c95['toString'](),_0x2e9529=this['_sendApiRequest'](_0x54bb96,'GET',void 0x0,!0x0);return{'list':async()=>await(await _0x2e9529['request'])['json'](),'abortController':_0x2e9529['abortController']};}['deleteFile'](_0x2572fb,_0x453b0f){const _0x5816e2=this['_sendApiRequest']('/conversations/'+_0x2572fb+'/files/'+_0x453b0f,'DELETE');return{'execute':async()=>{await _0x5816e2['request'];},'abortController':_0x5816e2['abortController']};}['deleteDocument'](_0x10e630,_0x11ebd1){const _0x2f696f=this['_sendApiRequest']('/conversations/'+_0x10e630+'/documents/'+_0x11ebd1,'DELETE');return{'execute':async()=>{await _0x2f696f['request'];},'abortController':_0x2f696f['abortController']};}['deleteWebResource'](_0x489ca1,_0x272617){const _0x425aad=this['_sendApiRequest']('/conversations/'+_0x489ca1+'/web-resources/'+_0x272617,'DELETE');return{'execute':async()=>{await _0x425aad['request'];},'abortController':_0x425aad['abortController']};}['callSystemReview']({reviewName:_0x4c9715,content:_0x4b1861,args:_0x589ab3}){const _0x32847b=this['_sendApiRequest']('/reviews/system/'+_0x4c9715+'/calls','POST',{'content':[{'type':'text','content':_0x4b1861}],'args':_0x589ab3});return{'getStream':async()=>{const _0x105ee3=(await _0x32847b['request'])['body'];return this['_getStreamReader'](_0x105ee3);},'abortController':_0x32847b['abortController']};}['callCustomReview']({content:_0x273215,prompt:_0x486e70,model:_0x155139}){const _0x54ac7=this['_sendApiRequest']('/reviews/custom/calls','POST',{'content':[{'type':'text','content':_0x273215}],'prompt':_0x486e70,'model':_0x155139});return{'getStream':async()=>{const _0x534beb=(await _0x54ac7['request'])['body'];return this['_getStreamReader'](_0x534beb);},'abortController':_0x54ac7['abortController']};}['upsertAIChatRating'](_0xd7b9c6,_0x5e17f2,_0x4c6da4){const _0x11c513=this['_sendApiRequest']('/conversations/'+_0xd7b9c6+'/messages/'+_0x5e17f2+'/ratings','PUT',{'positiveCount':_0x4c6da4['positiveCount'],'totalCount':_0x4c6da4['totalCount'],'modificationId':_0x4c6da4['modificationId']});return{'execute':async()=>{await _0x11c513['request'];},'abortController':_0x11c513['abortController']};}['upsertAIActionRating'](_0x139c19,_0x3cdd79,_0x47bde8){const _0x26eb6b=this['_sendApiRequest']('/actions/system/'+_0x139c19+'/calls/'+_0x3cdd79+'/ratings','PUT',{'positiveCount':_0x47bde8['positiveCount'],'totalCount':_0x47bde8['totalCount']});return{'execute':async()=>{await _0x26eb6b['request'];},'abortController':_0x26eb6b['abortController']};}['upsertCustomAIActionRating'](_0x16036c,_0x4b21dd){const _0x4bc914=this['_sendApiRequest']('/actions/custom/calls/'+_0x16036c+'/ratings','PUT',{'positiveCount':_0x4b21dd['positiveCount'],'totalCount':_0x4b21dd['totalCount']});return{'execute':async()=>{await _0x4bc914['request'];},'abortController':_0x4bc914['abortController']};}['upsertAIReviewRating'](_0x152b77,_0x353e7d,_0x32f23c,_0x373750){const _0x10b699=this['_sendApiRequest']('/reviews/system/'+_0x152b77+'/calls/'+_0x353e7d+'/ratings','PUT',{'positiveCount':_0x32f23c['positiveCount'],'totalCount':_0x32f23c['totalCount'],'dataId':_0x373750});return{'execute':async()=>{await _0x10b699['request'];},'abortController':_0x10b699['abortController']};}['upsertCustomAIReviewRating'](_0x5f4f11,_0x1b706e,_0x4e9b74){const _0xcdce55=this['_sendApiRequest']('/reviews/custom/calls/'+_0x5f4f11+'/ratings','PUT',{'positiveCount':_0x1b706e['positiveCount'],'totalCount':_0x1b706e['totalCount'],'dataId':_0x4e9b74});return{'execute':async()=>{await _0xcdce55['request'];},'abortController':_0xcdce55['abortController']};}['_sendApiRequest'](_0x122560,_0x24e7cc,_0x28d43d,_0x4da256=!0x1){const _0x553f87=new AbortController(),_0x31b64c=_0x4da256?_0x24e7cc+':'+_0x122560:null;if(_0x31b64c){const _0x1b8f05=this['_responseCache']['get'](_0x31b64c);if(_0x1b8f05)return{'request':_0x1b8f05['then'](_0x5dfb76=>_0x5dfb76['clone']()),'abortController':_0x553f87};}const _0x3b71c6=_0x28d43d instanceof FormData,_0x5d0478={'Authorization':'Bearer\x20'+this['_token']?.['value']};_0x28d43d&&!_0x3b71c6&&(_0x5d0478['Content-Type']='application/json');const _0x2d3f95={'method':_0x24e7cc,'headers':_0x5d0478,'signal':_0x553f87['signal']};_0x28d43d&&(_0x2d3f95['body']=_0x3b71c6?_0x28d43d:JSON['stringify'](_0x28d43d));const _0x12e65c=fetch(''+this['_apiUrl']+_0x122560,_0x2d3f95)['catch'](_0xe0bde8=>{_0x31b64c&&this['_responseCache']['delete'](_0x31b64c),this['_handleError'](_0xe0bde8);})['then'](_0x3cdbbf=>_0x3cdbbf['ok']?_0x3cdbbf:_0x3cdbbf['json']()['then'](_0x10dc84=>{throw _0x31b64c&&this['_responseCache']['delete'](_0x31b64c),{'url':this['_apiUrl'],'path':_0x122560,'method':_0x24e7cc,'body':_0x28d43d,'status':(_0x3cdbbf||{})['status'],'statusText':(_0x3cdbbf||{})['statusText'],'code':_0x10dc84['code'],'message':_0x10dc84['message'],'traceId':_0x10dc84['traceId']};}));return _0x31b64c&&this['_responseCache']['set'](_0x31b64c,_0x12e65c['then'](_0x277edb=>_0x277edb['clone']())),{'request':_0x12e65c,'abortController':_0x553f87};}async*['_getStreamReader'](_0x347d3c){const _0x49812e=[],_0xca80cf=_0x347d3c['getReader'](),_0x29578b=_0x222c8e({'onError':_0x3fc519=>{this['_handleError'](_0x3fc519);},'onEvent':_0x38b6b5=>{_0x38b6b5['data']=JSON['parse'](_0x38b6b5['data']),_0x49812e['push'](_0x38b6b5);}});try{let _0x10348f=!0x1;for(;!_0x10348f;){const {done:_0x31f96f,value:_0xc91d3b}=await _0xca80cf['read']();_0x31f96f&&(_0x10348f=!0x0),_0x29578b['feed'](this['_decoder']['decode'](_0xc91d3b,{'stream':!0x0})),yield*_0x49812e,_0x49812e['length']=0x0;}}catch(_0x2b77ee){this['_handleError'](_0x2b77ee);}finally{_0xca80cf['releaseLock'](),_0x29578b['reset']();}}['_handleError'](_0x26144e){if(_0x26144e instanceof ot)throw _0x26144e;if(_0x26144e instanceof Error&&'AbortError'===_0x26144e['name'])throw new ot('ai-request-aborted',this,{'originalError':_0x26144e});throw new ot('ai-request-failed',this,{'originalError':_0x26144e});}}function as(_0x53277e,_0x1b8404,_0x435165){const t=_0x53277e['t'];switch(_0x1b8404){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'},_0x435165);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.'},_0x435165);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.'},_0x435165);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.'},_0x435165);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'},_0x435165);case'AI_CHAT_SUGGESTION_ACTION_SUGGEST':return t({'id':'AI_CHAT_SUGGESTION_ACTION_SUGGEST','string':'Suggest'},_0x435165);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'},_0x435165);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.'},_0x435165);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.'},_0x435165);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.'},_0x435165);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.'},_0x435165);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'},_0x435165);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.'},_0x435165);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 _0x1b8404;}}const os='ck-ai-button-primary',hs='ck-ai-button-secondary',cs='ck-ai-button-tertiary';function ls(_0x36ec99,_0x37af6a){const _0x5e82a5=new kt(_0x36ec99),_0x2575a4=as(_0x36ec99,'AI_TABS_LABEL_MINIMIZE'),_0x4d4adb=as(_0x36ec99,'AI_TABS_LABEL_MAXIMIZE');return _0x5e82a5['set']({'withText':!0x1,'icon':_0x3740f2,'tooltip':!0x0,'class':'ck-ai-tabs__resize\x20'+cs}),_0x5e82a5['bind']('label')['to'](_0x37af6a,'isMaximized',_0x242eec=>_0x242eec?_0x2575a4:_0x4d4adb),_0x5e82a5['bind']('icon')['to'](_0x37af6a,'isMaximized',_0x574d9e=>_0x574d9e?_0x1b9793:_0x3740f2),_0x5e82a5['bind']('isOn')['to'](_0x37af6a,'isMaximized'),_0x5e82a5['on']('execute',()=>{_0x37af6a['fire']('resizeTabs');}),_0x5e82a5;}function us(_0x6bade2){return _0x211450(_0x6bade2);}function ds(_0x4b9cbc){return _0xc041c1(_0x4b9cbc);}function _s(_0x3586b4,_0x270db6,_0x33f3a1){const _0x2924dc=null!==_0x270db6?_0x4be736=>_0x4be736['attribs'][_0x3586b4]===_0x270db6:_0x18debc=>Boolean(_0x18debc['attribs'][_0x3586b4]);return _0x224df2(_0x3438e2=>_0x16a47d(_0x3438e2)&&_0x2924dc(_0x3438e2),_0x33f3a1);}function As(_0x542b30,_0x2943de,_0x9eef56){const _0x19b48d=null!==_0x2943de?_0x169dea=>_0x169dea['attribs'][_0x542b30]===_0x2943de:_0x4c791b=>Boolean(_0x4c791b['attribs'][_0x542b30]);return _0x2709fb(_0x154900=>_0x16a47d(_0x154900)&&_0x19b48d(_0x154900),_0x9eef56);}function gs(_0x5b87c7,_0x55e9e0){return _0x5b87c7&&_0x16a47d(_0x5b87c7)?_0x5b87c7['attribs'][_0x55e9e0]:null;}function Is(_0x2b0efd,_0x94427c,_0x226154){_0x16a47d(_0x2b0efd)&&(null===_0x226154?delete _0x2b0efd['attribs'][_0x94427c]:_0x2b0efd['attribs'][_0x94427c]=_0x226154);}function Es(_0x48cb66,_0x44d35c,_0x3abc9b){const _0x410145=_0x44d35c['cloneNode'](!0x0);'beforebegin'===_0x3abc9b?_0x36875f(_0x48cb66,_0x410145):'afterbegin'===_0x3abc9b?_0x2e812a(_0x48cb66,_0x410145):'beforeend'===_0x3abc9b?_0x55991e(_0x48cb66,_0x410145):'afterend'===_0x3abc9b&&_0x41a7e7(_0x48cb66,_0x410145);}function Ts(_0x59b0e4){const _0x48325e=[];let _0x17c9b3=_0x59b0e4;for(;_0x17c9b3;)_0x17c9b3=_0x447931(_0x17c9b3),_0x17c9b3&&_0x48325e['push'](_0x17c9b3);return _0x48325e;}function ps(_0x561422){return _0x561422['replace'](/^\s+/gm,'')['replace'](/\s+$/gm,'')['replace'](/\n*/g,'')['replace'](/\s+/g,'\x20')['replace'](/>\s*</g,'><');}function ms(_0x4ac070){let _0x5ee811=0x0;for(;_0x4ac070['parentNode'];)_0x4ac070=_0x4ac070['parentNode'],_0x5ee811++;return _0x5ee811;}function Cs(_0x5a836a){const _0x5cf8a4=[];let _0x1597c8=_0x5a836a['nextSibling'];for(;_0x1597c8;)_0x5cf8a4['push'](_0x1597c8),_0x1597c8=_0x1597c8['nextSibling'];_0x5cf8a4['forEach'](_0x57a54b=>{_0x3723d6(_0x57a54b);});}class ws extends/* #__PURE__ -- @preserve */
|
|
25
|
-
ht(){['_m2html'];constructor(){super();const
|
|
26
|
-
ht(){['_generateUid'];['_touchedNodesState']={'newIds':[],'modifiedIds':[],'removedIds':[],'invalidIds':[],'lastTouchedId':null};['_existingDataIds']=new Set();constructor(_0x267d6a){super(),this['_generateUid']=_0x267d6a||at;}['merge'](_0x56268d,_0x3bb10c,_0x1db151){const _0x2fe74c=_0x56268d['cloneNode'](!0x0);if(0x0===_0x3bb10c['childNodes']['length']){const _0x8802d5=[];return As('data-id','new-element',_0x2fe74c)['forEach'](_0x3904b0=>{const _0x285c61=this['_generateUid']();Is(_0x3904b0,'data-id',_0x285c61),_0x8802d5['push'](_0x285c61);}),this['_removeSpecialComments'](_0x2fe74c),{'parsedContent':_0x2fe74c,'newNodeIds':_0x8802d5,'modifiedNodeIds':[],'removedNodeIds':[]};}_0x1db151&&_0x1db151['markUnstableElements']&&this['_markLastTagElementUnstable'](_0x2fe74c),this['_touchedNodesState']['newIds']=[],this['_touchedNodesState']['modifiedIds']=[],this['_touchedNodesState']['removedIds']=[],this['_touchedNodesState']['invalidIds']=[],this['_touchedNodesState']['lastTouchedId']=null,this['_existingDataIds']=new Set(As('data-id',null,_0x3bb10c)['map'](_0xe99002=>gs(_0xe99002,'data-id'))['filter'](_0x205b40=>!!_0x205b40));let _0x509fe0=-0x1,_0x33ef82=!0x1;const _0x58c50f=_0x2fe74c['childNodes'],_0x575d3a=Array['from'](_0x58c50f)['filter'](_0x4134f0=>!(0x3===_0x4134f0['nodeType']&&''===ds(_0x4134f0)['trim']())),_0x37d488=_0x575d3a['length'];for(let _0x251d0f=0x0;_0x251d0f<_0x37d488;_0x251d0f++){const _0xba6909=_0x575d3a[_0x251d0f],_0x22cc8b=_0x575d3a[_0x251d0f+0x1];if(this['_isNewNode'](_0xba6909)){if(-0x1===_0x509fe0&&(_0x509fe0=_0x251d0f),this['_markWrappedElements'](_0xba6909),!this['_isNewNode'](_0x22cc8b)){const [_0x477a41,_0x1672d8]=this['_findReferenceNode'](_0xba6909,_0x33ef82,_0x3bb10c);if(_0x477a41){const _0x327b26=Array['from'](_0x575d3a)['slice'](_0x509fe0,_0x251d0f+0x1);this['_insertNodes'](_0x477a41,_0x327b26,_0x1672d8),_0x509fe0=-0x1;}}}else{if(this['_isExistingContentComment'](_0xba6909))_0x33ef82=!0x0;else{if(this['_isExistingNode'](_0xba6909)){const _0x368792=gs(_0xba6909,'data-id');if(_0x368792&&this['_existingDataIds']['has'](_0x368792)){const _0x38a52e=_s('data-id',_0x368792,_0x3bb10c);this['_replaceNode'](_0x38a52e,_0xba6909);}if(this['_touchedNodesState']['removedIds']['includes'](_0x368792)){const _0x5bc397=this['_touchedNodesState']['removedIds']['indexOf'](_0x368792);this['_touchedNodesState']['removedIds']['splice'](_0x5bc397,0x1);}}else{if(this['_isDelNode'](_0xba6909)){const _0x18360c=gs(_0xba6909,'data-id');this['_touchedNodesState']['modifiedIds']['includes'](_0x18360c)||this['_storeDeletedElementIds'](_0xba6909);}}}}}for(const _0x237f30 of this['_touchedNodesState']['removedIds']){const _0x38cda1=_s('data-id',_0x237f30,_0x3bb10c);if(_0x38cda1){if(_0x1db151&&_0x1db151['replaceRemovedWith']){this['_touchedNodesState']['lastTouchedId']=_0x237f30;const _0x5378f0=_0x1db151['replaceRemovedWith']['cloneNode'](!0x0);Is(_0x5378f0,'data-id',_0x237f30),Is(_0x5378f0,'data-removed','true'),_0x254ca1(_0x38cda1,_0x5378f0);}else _0x3723d6(_0x38cda1);}}if(As('data-wrapped-id',null,_0x3bb10c)['forEach'](_0x9d3dc1=>{const _0x19159d=_s('data-id',gs(_0x9d3dc1,'data-wrapped-id'),_0x3bb10c);var _0x471824,_0x4f8000;_0x19159d&&(_0x4f8000=_0x9d3dc1,_0x3723d6(_0x471824=_0x19159d),_0x254ca1(_0x4f8000,_0x471824));}),As('data-id','new-element',_0x3bb10c)['forEach'](_0x24c520=>{const _0x499331=this['_getUid'](_0x24c520);Is(_0x24c520,'data-id',_0x499331),this['_touchedNodesState']['newIds']['push'](_0x499331);}),this['_removeSpecialComments'](_0x3bb10c),_0x1db151&&_0x1db151['markUnstableElements']&&this['_markUnstableElements'](_0x3bb10c,_0x1db151['markUnstableElementsDepth']||0x0),_0x1db151&&_0x1db151['cutAfterLastChange']&&this['_touchedNodesState']['lastTouchedId']){let _0x2d131d=_s('data-id',this['_touchedNodesState']['lastTouchedId'],_0x3bb10c);for(;_0x2d131d;)Cs(_0x2d131d),_0x2d131d=_0x2d131d['parentNode'];}return{'parsedContent':_0x3bb10c,'newNodeIds':this['_touchedNodesState']['newIds'],'modifiedNodeIds':this['_touchedNodesState']['modifiedIds'],'removedNodeIds':this['_touchedNodesState']['removedIds']};}['_insertNodes'](_0x1caac5,_0x325da2,_0x4b4d98){for(const _0x54733c of _0x325da2){const _0x1fe6fe=this['_getUid'](_0x54733c);Is(_0x54733c,'data-id',_0x1fe6fe),this['_touchedNodesState']['newIds']['push'](_0x1fe6fe),this['_touchedNodesState']['lastTouchedId']=_0x1fe6fe;}const _0x4949f6='afterbegin'===_0x4b4d98||'afterend'===_0x4b4d98?_0x325da2['reverse']():_0x325da2;for(const _0x373f15 of _0x4949f6)Es(_0x1caac5,_0x373f15,_0x4b4d98);}['_replaceNode'](_0xc0b082,_0x4ef22a){if(!_0xc0b082)return;if(_0x9a6480=_0x4ef22a,ps(ds(_0xc0b082))===ps(ds(_0x9a6480)))return;var _0x9a6480;const _0x3bf535=this['_getUid'](_0xc0b082);Is(_0x4ef22a,'data-id',_0x3bf535),this['_touchedNodesState']['modifiedIds']['push'](_0x3bf535),this['_touchedNodesState']['lastTouchedId']=_0x3bf535,_0x254ca1(_0xc0b082,_0x4ef22a['cloneNode'](!0x0));}['_findReferenceNode'](_0x150321,_0x562c97,_0x3998f8){const _0x17e922=this['_findPrevElementWithDataId'](_0x150321,!0x1);if(_0x17e922){const _0x164492=this['_getNodeDataId'](_0x17e922),_0x4e09c1=_s('data-id',_0x164492,_0x3998f8);if(_0x4e09c1)return[_0x4e09c1,'afterend'];this['_touchedNodesState']['invalidIds']['push'](_0x164492);}const _0x20eaa4=this['_findNextElementWithDataId'](_0x150321,!0x1);if(_0x20eaa4){const _0x1c7684=this['_getNodeDataId'](_0x20eaa4),_0x54ff31=_s('data-id',_0x1c7684,_0x3998f8);if(_0x54ff31)return[_0x54ff31,'beforebegin'];this['_touchedNodesState']['invalidIds']['push'](_0x1c7684);}return _0x562c97?_0x150321['nextSibling']?this['_findFallbackReferenceNode'](_0x150321,_0x3998f8):[_0x3998f8['childNodes'][_0x3998f8['childNodes']['length']-0x1],'afterend']:[_0x3998f8['childNodes'][0x0],'beforebegin'];}['_findFallbackReferenceNode'](_0x4e9232,_0x4cd23d){const _0x1863d5=[],_0xe215cc=this['_findPrevElementWithDataId'](_0x4e9232,!0x0);if(_0xe215cc){const _0x407c13=_s('data-id',this['_getNodeDataId'](_0xe215cc),_0x4cd23d);_0x407c13&&_0x1863d5['push']([_0x407c13,'afterend']);}const _0x4f8c59=this['_findNextElementWithDataId'](_0x4e9232,!0x0);if(_0x4f8c59){const _0x1da6f9=_s('data-id',this['_getNodeDataId'](_0x4f8c59),_0x4cd23d);_0x1da6f9&&_0x1863d5['push']([_0x1da6f9,'beforebegin']);}if(_0x1863d5['length']>0x1)return ms(_0x1863d5[0x0][0x0])<=ms(_0x1863d5[0x1][0x0])?_0x1863d5[0x0]:_0x1863d5[0x1];return 0x1===_0x1863d5['length']?_0x1863d5[0x0]:[_0x4cd23d['lastChild'],'afterend'];}['_findNextElementWithDataId'](_0x2edb98,_0x7c6e0){let _0x4264a8=_0x2edb98['nextSibling'],_0x2e520a=null,_0x1c80cb=!0x1;for(;_0x4264a8;){if(_0x1f259e(_0x4264a8)){if(this['_isDelNode'](_0x4264a8)&&(_0x2e520a=_0x4264a8),this['_isExistingContentComment'](_0x4264a8)&&_0x7c6e0&&!_0x1c80cb){_0x1c80cb=!0x0,_0x4264a8=_0x4264a8['nextSibling'];continue;}break;}const _0x141aa2=gs(_0x4264a8,'data-id');if(_0x141aa2&&'new-element'!==_0x141aa2&&this['_existingDataIds']['has'](_0x141aa2)){_0x2e520a=_0x4264a8;break;}_0x4264a8=_0x4264a8['nextSibling'];}return _0x2e520a;}['_findPrevElementWithDataId'](_0x148030,_0xd2000b){let _0x2c7413=_0x148030['previousSibling'],_0x8e0ecc=null,_0x15b36a=!0x1;for(;_0x2c7413;){if(_0x1f259e(_0x2c7413)){if(this['_isDelNode'](_0x2c7413)&&(_0x8e0ecc=_0x2c7413),this['_isExistingContentComment'](_0x2c7413)&&_0xd2000b&&!_0x15b36a){_0x15b36a=!0x0,_0x2c7413=_0x2c7413['previousSibling'];continue;}break;}const _0x1688e5=gs(_0x2c7413,'data-id');if(_0x1688e5&&'new-element'!==_0x1688e5&&this['_existingDataIds']['has'](_0x1688e5)){_0x8e0ecc=_0x2c7413;break;}_0x2c7413=_0x2c7413['previousSibling'];}return _0x8e0ecc;}['_markWrappedElements'](_0x3ac35a){_0x16a47d(_0x3ac35a)&&As('data-id',null,_0x3ac35a)['forEach'](_0xedc1d7=>{this['_isExistingNode'](_0xedc1d7)&&!this['_hasWrappedParent'](_0xedc1d7)&&(Is(_0xedc1d7,'data-wrapped-id',gs(_0xedc1d7,'data-id')),Is(_0xedc1d7,'data-id',null));});}['_getNodeDataId'](_0x10cbe5){if(!_0x10cbe5)return null;if(_0x16a47d(_0x10cbe5))return gs(_0x10cbe5,'data-id');if(_0x1f259e(_0x10cbe5)){const _0xd8f574=ds(_0x10cbe5)['match'](/removed[\s*-]data-id="([^"]+)"/);if(_0xd8f574&&_0xd8f574[0x1])return _0xd8f574[0x1];}return null;}['_storeDeletedElementIds'](_0xdec14){if(_0x1f259e(_0xdec14)){const _0x100a43=ds(_0xdec14)['match'](/removed[\s*-]data-id="([^"]+)"/);_0x100a43&&_0x100a43[0x1]&&this['_touchedNodesState']['removedIds']['push'](_0x100a43[0x1]);}}['_getUid'](_0x225faa){return this['_isExistingNode'](_0x225faa)?gs(_0x225faa,'data-id'):this['_generateUid']();}['_removeSpecialComments'](_0x23ec32){(function(_0x53fb7a){return _0x5e0700(_0x1795d9=>_0x1f259e(_0x1795d9),_0x53fb7a,!0x0,0x1/0x0);}(_0x23ec32)['filter'](_0x43e2c4=>this['_isDelNode'](_0x43e2c4)||this['_isExistingContentComment'](_0x43e2c4))['forEach'](_0x32243d=>{_0x3723d6(_0x32243d);}));}['_markLastTagElementUnstable'](_0x3e1abf){const _0x3da942=_0x3e1abf['childNodes'],_0x50e777=_0x3da942[_0x3da942['length']-0x1];_0x50e777&&_0x16a47d(_0x50e777)&&Is(_0x50e777,'data-unstable','true');}['_markUnstableElements'](_0x586695,_0x2ad02b){const _0x183e23=_s('data-unstable','true',_0x586695);if(!_0x183e23)return;const _0x9c535e=Ts(_0x183e23)['slice'](0x0,-0x1),_0x9ce35a=_0x9c535e['length'];let _0x433bde=_0x183e23;if(_0x9ce35a>_0x2ad02b){let _0x3aa5dc=_0x9ce35a,_0x48681a=null;for(;_0x3aa5dc>_0x2ad02b&&_0x3aa5dc>=0x0;)_0x3aa5dc--,_0x48681a=_0x9c535e[_0x3aa5dc];_0x48681a&&(_0x433bde=_0x48681a,Is(_0x183e23,'data-unstable',null),Is(_0x48681a,'data-unstable','true'));}else{if(_0x9ce35a<_0x2ad02b){let _0x22da71=_0x9ce35a,_0x23e314=_0x183e23;for(;_0x22da71<_0x2ad02b;){const _0x619706=_0x23e314['childNodes']['filter'](_0x2a5896=>_0x16a47d(_0x2a5896));if(0x0===_0x619706['length'])break;_0x22da71++,_0x23e314=_0x619706[_0x619706['length']-0x1];}_0x23e314&&(_0x433bde=_0x23e314,Is(_0x183e23,'data-unstable',null),Is(_0x23e314,'data-unstable','true'));}}let _0x336327=_0x433bde;for(;_0x336327;){for(;_0x336327['nextSibling'];)_0x336327=_0x336327['nextSibling'],_0x16a47d(_0x336327)&&Is(_0x336327,'data-unstable','true');_0x336327=_0x336327['parentNode'];}}['_isNewNode'](_0x444b13){return Boolean('new-element'===gs(_0x444b13,'data-id'));}['_isExistingNode'](_0x5ae7a0){return Boolean((gs(_0x5ae7a0,'data-id')||'')['length']>0x0&&'new-element'!==gs(_0x5ae7a0,'data-id'));}['_isDelNode'](_0x204077){return!!_0x204077&&Boolean(_0x1f259e(_0x204077)&&ds(_0x204077)['match'](/removed[\s*-]data-id="[^"]+"/));}['_hasWrappedParent'](_0x40c849){let _0x33b55a=_0x40c849['parentNode'];for(;_0x33b55a;){if(gs(_0x33b55a,'data-wrapped-id'))return!0x0;_0x33b55a=_0x33b55a['parentNode'];}return!0x1;}['_isExistingContentComment'](_0xa59b5c){return Boolean(_0x1f259e(_0xa59b5c)&&ds(_0xa59b5c)['match'](/\s*existing[\s*-](content|document)\s*/g));}}function Ss({editor:_0x598b6e,changeGroups:_0x10bbac,documentContextContent:_0x23d3cf,showDiff:_0x2ae061,trimUnchanged:_0xdc69e3=!0x0}){return _0x10bbac['map'](_0x529069=>{const _0xf636bc=new _0x352671([]),_0x496cc8=new _0x352671([]);for(const _0x314af2 of _0x529069['changes'])if(_0x2ae061&&'removed'==_0x314af2['type']||_0x496cc8['children']['push'](_0x314af2['node']['cloneNode'](!0x0)),'new'!=_0x314af2['type']&&(_0x2ae061||'removed'!=_0x314af2['type'])){const _0x4d32fe=_0x224df2(_0x379a16=>gs(_0x379a16,'data-id')==_0x314af2['id'],_0x23d3cf,!0x0);_0x4d32fe&&_0xf636bc['children']['push'](_0x4d32fe['cloneNode'](!0x0));}const {content:_0x585ef3,hasChanges:_0x24505c}=function(_0xfdb8d7,_0x3e342d,_0x173a1d,_0x58e77e,_0x3d0d0a=!0x0){const _0x3a41f4=_0xfdb8d7['plugins']['get']('DocumentCompare'),_0x3137a6=ds(_0x3e342d),_0x43d72c=ds(_0x173a1d),_0x4bb914=_0xfdb8d7['data']['parse'](_0x3137a6,'$root'),_0x43df5b=_0xfdb8d7['model']['createPositionAt'](_0x4bb914,0x0),_0x1e14d8=_0x3a41f4['getDiff'](_0x3137a6,_0x43d72c,{'anchor':_0x43df5b,'markDeletions':_0x58e77e}),_0x5755e4=_0x1e14d8['getOperations']();if(0x0==_0x5755e4['length'])return{'content':_0x3e342d['cloneNode'](!0x0),'hasChanges':!0x1};_0x58e77e?function(_0x48b6cc,_0x3f68e4,_0xa46527){if(0x0==_0x48b6cc['length'])return;const _0x39212f=_0xa46527['plugins']['get']('DocumentCompare'),_0x43433b=_0xa46527['plugins']['get']('SuggestionsConversion');_0xa46527['model']['change'](_0x54c7de=>{const _0x55f4d1=new Set();for(let _0x5f24e9=0x0;_0x5f24e9<_0x48b6cc['length'];_0x5f24e9++){const _0x32fa52=_0x48b6cc[_0x5f24e9];if(_0x32fa52['baseVersion']=null,_0x32fa52['isDocumentOperation']=!0x1,_0x39212f['isMarkedRemoveOperation'](_0x32fa52)){const _0x1381e5=_0x175699(_0x32fa52['newRange'],_0xa46527['model']),_0x5c0cc8='suggestion:deletion:'+at()+':$aiSuggestion';_0x3f68e4['markers']['set'](_0x5c0cc8,_0x1381e5);}else switch(_0x32fa52['type']){case'rename':{if(_0x32fa52['oldName']==_0x32fa52['newName'])break;_0x54c7de['batch']['addOperation'](_0x32fa52),_0xa46527['model']['applyOperation'](_0x32fa52);const _0x522ff9='$elementName',_0x2f662d=_0x32fa52['position'],_0x1657f7=_0xa46527['model']['createRange'](_0x2f662d,_0xa46527['model']['createPositionAt'](_0x2f662d['nodeAfter'],'end')),_0x1ad00f='suggestion:attribute:'+_0x522ff9+':'+at()+':$aiSuggestion';_0x3f68e4['markers']['set'](_0x1ad00f,_0x1657f7);break;}case'addAttribute':case'removeAttribute':case'changeAttribute':{if(_0x32fa52['oldValue']==_0x32fa52['newValue'])break;_0x54c7de['batch']['addOperation'](_0x32fa52),_0xa46527['model']['applyOperation'](_0x32fa52);const _0x45dada=_0x32fa52['key'];if(!_0x43433b['isRegisteredAttribute'](_0x45dada))break;const _0x45161f=_0x175699(_0x32fa52['range'],_0xa46527['model']),_0x147ecf='suggestion:attribute:'+_0x45dada+':'+at()+':$aiSuggestion';_0x3f68e4['markers']['set'](_0x147ecf,_0x45161f);break;}case'insert':{_0x54c7de['batch']['addOperation'](_0x32fa52),_0xa46527['model']['applyOperation'](_0x32fa52);if(_0x48b6cc[_0x5f24e9+0x1]&&'move'==_0x48b6cc[_0x5f24e9+0x1]['type']){bs(_0x3f68e4,_0x32fa52);break;}const _0x366763=_0x32fa52['position'],_0x484725=_0x32fa52['howMany'],_0x3c23ae=_0x175699(_0xa46527['model']['createRange'](_0x366763,_0x366763['getShiftedBy'](_0x484725)),_0xa46527['model']),_0x3ae848='suggestion:insertion:'+at()+':$aiSuggestion';_0x3f68e4['markers']['set'](_0x3ae848,_0x3c23ae);break;}case'split':{_0x54c7de['batch']['addOperation'](_0x32fa52),_0xa46527['model']['applyOperation'](_0x32fa52);const _0x14f612=_0x32fa52['splitPosition'],_0x5b156d=_0x32fa52['moveTargetPosition'],_0x52311a=_0xa46527['model']['createRange'](_0x14f612,_0x5b156d),_0x1cca6e='suggestion:insertion:'+at()+':$aiSuggestion';_0x3f68e4['markers']['set'](_0x1cca6e,_0x52311a);break;}case'move':{_0x54c7de['batch']['addOperation'](_0x32fa52),_0xa46527['model']['applyOperation'](_0x32fa52),_0x48b6cc[_0x5f24e9-0x1]&&'insert'==_0x48b6cc[_0x5f24e9-0x1]['type']&&bs(_0x3f68e4,_0x32fa52);const _0x4589ae=_0x32fa52['getMovedRangeStart'](),_0x5db66e=_0x32fa52['howMany'];for(let _0x4b249f=0x0;_0x4b249f<_0x5db66e;_0x4b249f++){const _0x521290=_0x4589ae['getShiftedBy'](_0x4b249f)['nodeAfter'];_0x55f4d1['add'](_0x521290);}break;}case'remove':{const _0x538778=_0x32fa52['sourcePosition'],_0x5b1273=_0x32fa52['howMany'],_0x1e4436=new _0x2460c5(_0x538778,_0x5b1273);_0x54c7de['batch']['addOperation'](_0x1e4436),_0xa46527['model']['applyOperation'](_0x1e4436);break;}}}for(const _0x2e27c4 of _0x55f4d1){const _0xcaec04=_0xa46527['model']['createRangeOn'](_0x2e27c4),_0x477bd6='suggestion:formatBlock:$fakeWrap:'+at()+':$aiSuggestion';_0x3f68e4['markers']['set'](_0x477bd6,_0x175699(_0xcaec04,_0xa46527['model']));}});}(_0x5755e4,_0x4bb914,_0xfdb8d7):_0xfdb8d7['model']['change'](_0x42590d=>{for(const _0xe47509 of _0x5755e4)if('remove'==_0xe47509['type']){const _0x51eeec=_0xe47509['sourcePosition'],_0x1ff062=_0xe47509['howMany'],_0x339887=new _0x2460c5(_0x51eeec,_0x1ff062);_0x42590d['batch']['addOperation'](_0x339887),_0xfdb8d7['model']['applyOperation'](_0x339887);}else{if('marker'==_0xe47509['type']){const _0x154249=_0xe47509['name'],_0x2da241=_0xe47509['newRange'];null!==_0x2da241?_0x4bb914['markers']['set'](_0x154249,_0x2da241):_0x4bb914['markers']['delete'](_0x154249);}else _0xe47509['baseVersion']=null,_0xe47509['isDocumentOperation']=!0x1,_0x42590d['batch']['addOperation'](_0xe47509),_0xfdb8d7['model']['applyOperation'](_0xe47509);}});if(_0x3d0d0a){const _0x5e65ec=Rs(_0xfdb8d7,_0x5755e4,_0x4bb914);Os(_0xfdb8d7['model'],_0x5e65ec),function(_0x16a14a,_0x12d672){const _0x4a953e=_0x12d672['getFirstRange']()['start'];let _0x55717c=_0x12d672['getFirstRange']()['end'];const _0x5894d3=_0x4a953e['root'];(_0x55717c['textNode']||_0x55717c['nodeAfter']&&_0x55717c['nodeAfter']['is']('$text'))&&(_0x3134cf(_0x55717c,'...'),_0x55717c=_0x55717c['getShiftedBy'](0x3)),(_0x4a953e['textNode']||_0x4a953e['nodeBefore']&&_0x4a953e['nodeBefore']['is']('$text'))&&(_0x3134cf(_0x4a953e,'...'),function(_0xfd7ebb,_0x1cfc68,_0x43bfc4){for(let [_0x2378f4,_0xb8ecfc]of _0xfd7ebb['markers']){const _0x4e07b3=_0xb8ecfc['_getTransformedByInsertion'](_0x1cfc68,_0x43bfc4,!0x1);_0xb8ecfc=_0x4e07b3[0x0],_0xfd7ebb['markers']['set'](_0x2378f4,_0xb8ecfc);}}(_0x5894d3,_0x4a953e,0x3),_0x4a953e['parent']==_0x55717c['parent']&&(_0x55717c=_0x55717c['getShiftedBy'](0x3)));const _0x440090=_0x16a14a['createRange'](_0x16a14a['createPositionAt'](_0x5894d3,0x0),_0x4a953e),_0x11da0d=_0x16a14a['createRange'](_0x55717c,_0x16a14a['createPositionAt'](_0x5894d3,'end')),_0x90fa6=[..._0x440090['getMinimalFlatRanges'](),..._0x11da0d['getMinimalFlatRanges']()];_0x90fa6['reverse']();for(const _0x5f14e1 of _0x90fa6)_0x332d6d(_0x5f14e1),Ns(_0x5894d3,_0x5f14e1);}(_0xfdb8d7['model'],_0x5e65ec);}const _0x3d37ca=_0xfdb8d7['data']['stringify'](_0x4bb914,{'showSuggestionHighlights':!0x0});return{'content':us(_0x3d37ca),'hasChanges':!0x0};}(_0x598b6e,_0xf636bc,_0x496cc8,_0x2ae061,_0xdc69e3);return{'type':_0x529069['changes'][0x0]['type'],'index':_0x529069['index'],'content':_0x585ef3,'hasChanges':_0x24505c};});}function bs(_0x39a5c5,_0x3da626){for(const [_0x166f01,_0x4fc9cc]of _0x39a5c5['markers']){const _0x86190d=_0x4ed42b['_createFromRanges'](_0x4fc9cc['getTransformedByOperation'](_0x3da626));_0x39a5c5['markers']['set'](_0x166f01,_0x86190d);}}function Rs(_0x45b044,_0x80c03e,_0x2d01d5){const _0x22fef0=_0x45b044['plugins']['get']('DocumentCompare');let _0x323699=_0x45b044['model']['createPositionAt'](_0x2d01d5,Number['POSITIVE_INFINITY']),_0x4e0109=_0x45b044['model']['createPositionAt'](_0x2d01d5,0x0);for(const _0x53e431 of _0x80c03e){let _0x4b1a85,_0x6f4057;if(_0x22fef0['isMarkedRemoveOperation'](_0x53e431))_0x4b1a85=_0x53e431['newRange']['start'],_0x6f4057=_0x53e431['newRange']['end'];else switch(_0x323699=_0x323699['getTransformedByOperation'](_0x53e431),_0x4e0109=_0x4e0109['getTransformedByOperation'](_0x53e431),_0x53e431['type']){case'rename':_0x4b1a85=_0x53e431['position'],_0x6f4057=_0x4b1a85['getShiftedBy'](0x1);break;case'addAttribute':case'removeAttribute':case'changeAttribute':_0x4b1a85=_0x53e431['range']['start'],_0x6f4057=_0x53e431['range']['end'];break;case'insert':_0x4b1a85=_0x53e431['position'],_0x6f4057=_0x4b1a85['getShiftedBy'](_0x53e431['howMany']);break;case'split':_0x4b1a85=_0x53e431['splitPosition'],_0x6f4057=_0x53e431['moveTargetPosition'];break;case'merge':{const _0x2aad1f=_0x53e431['targetPosition']['path']['slice'](0x0,-0x1);_0x4b1a85=_0x45b044['model']['createPositionFromPath'](_0x2d01d5,_0x2aad1f),_0x6f4057=_0x4b1a85['getShiftedBy'](0x1);break;}case'remove':{const _0xb14169=_0x53e431['howMany'],_0x3b7eb9=_0x53e431['sourcePosition']['_getTransformedByInsertion'](_0x53e431['targetPosition'],_0xb14169),_0x275838=_0x53e431['getMovedRangeStart']();'remove'==_0x53e431['type']?(_0x4b1a85=_0x3b7eb9,_0x6f4057=_0x3b7eb9):(_0x4b1a85=_0x275838,_0x6f4057=_0x275838['getShiftedBy'](_0xb14169));break;}}_0x4b1a85&&_0x4b1a85['isBefore'](_0x323699)&&(_0x323699=_0x4b1a85['clone'](),_0x323699['stickiness']='toNone'),_0x6f4057&&_0x6f4057['isAfter'](_0x4e0109)&&(_0x4e0109=_0x6f4057['clone'](),_0x4e0109['stickiness']='toNone');}return _0x45b044['model']['createSelection'](_0x45b044['model']['createRange'](_0x323699,_0x4e0109));}function Os(_0x3f07b4,_0x2ac7f2){ks(_0x3f07b4,_0x2ac7f2,'forward');const _0x27290d=_0x2ac7f2['getFirstRange']();_0x2ac7f2['setTo']([]),_0x2ac7f2['setTo'](_0x27290d,{'backward':!0x0}),ks(_0x3f07b4,_0x2ac7f2,'backward');}function ks(_0x38297c,_0x4b55e8,_0x78db77){let _0x5b7b50=0x14;for(;_0x5b7b50;){_0x38297c['modifySelection'](_0x4b55e8,{'unit':'word','direction':_0x78db77}),_0x5b7b50--;const _0x5632d8=_0x4b55e8['focus']['forward'==_0x78db77?'nodeBefore':'nodeAfter'];if(_0x5632d8&&_0x5632d8['is']('element')&&_0x38297c['schema']['isBlock'](_0x5632d8)&&_0x38297c['schema']['isObject'](_0x5632d8))break;}}function Ns(_0x404fad,_0xe8a84){for(const [_0x572302,_0x4761ac]of _0x404fad['markers']){const _0x47b1b9=_0x4761ac['_getTransformedByDeletion'](_0xe8a84['start'],_0xe8a84['end']['offset']-_0xe8a84['start']['offset']);null!=_0x47b1b9?_0x404fad['markers']['set'](_0x572302,_0x47b1b9):_0x404fad['markers']['delete'](_0x572302);}}class vs extends ht(){['id'];['interactionId'];['type'];['sources']=[];['parsedContent']=new _0x352671([]);['parsedMergedContent']=new _0x352671([]);['changeGroups']=[];['areActionsDisabled']=!0x1;['documentContextContent'];['aiResponseParser'];['aiResponseApplier'];['editor'];['cachedSuggestionContentParts']={'withDiff':[],'withoutDiff':[]};constructor({type:_0x51211f,content:_0x59a338='',isDone:_0x379bbc=!0x1,interactionId:_0x740fd1,areActionsDisabled:_0x5b18ab,documentContextContent:_0x557c2e,editor:_0x5547c1,id:_0x26f3c9}){super(),this['id']=_0x26f3c9||at(),this['interactionId']=_0x740fd1,this['type']=_0x51211f,this['areActionsDisabled']=!!_0x5b18ab,this['editor']=_0x5547c1,this['aiResponseParser']=new ws(),this['aiResponseApplier']=new fs(),this['documentContextContent']=us(_0x557c2e||''),this['set']('isDone',_0x379bbc),this['on']('change:content',()=>{this['onContentChange']();}),this['set']('content',_0x59a338);}['appendContent'](_0x178a21){this['set']('content',this['content']+_0x178a21);}['done'](){this['isDone']||(this['set']('isDone',!0x0),this['onContentChange']());}['destroy'](){this['stopListening']();}['setChangeGroupState'](_0x5605c3,_0xc1945c){this['changeGroups'][_0x5605c3]['state']=_0xc1945c,this['fire']('replyChangeGroupStateUpdated',{'reply':this,'index':_0x5605c3,'state':_0xc1945c});}['getContentParts']({showDiff:_0x30c214,groupIndex:_0x2975bd}){if(!this['editor'])throw new ot('ai-get-editor-from-context-no-editor',null,{'aiReply':this});const _0x3fa99f=this['_getCachedContentParts'](_0x30c214,_0x2975bd);if(_0x3fa99f)return _0x3fa99f;let _0x56394b=[];if(void 0x0===_0x2975bd)_0x56394b=this['changeGroups'];else{const _0xe7066d=this['changeGroups']['find'](({index:_0x3beee6})=>_0x3beee6===_0x2975bd);if(!_0xe7066d)throw new ot('ai-reply-get-content-parts-group-not-found',null,{'aiReply':this,'groupIndex':_0x2975bd});_0x56394b=[_0xe7066d];}const _0x16dd20=Ss({'editor':this['editor'],'showDiff':_0x30c214,'changeGroups':_0x56394b,'documentContextContent':this['documentContextContent']});return this['_setCachedContentParts'](_0x30c214,_0x16dd20),_0x16dd20;}['_getCachedContentParts'](_0x4d0692,_0x4590ee){const _0x22cb80=_0x4d0692?'withDiff':'withoutDiff';if(!this['cachedSuggestionContentParts'][_0x22cb80]['length'])return null;const _0x8e1900=this['cachedSuggestionContentParts'][_0x22cb80];if(void 0x0===_0x4590ee)return _0x8e1900['length']>0x0&&_0x8e1900['length']!==this['changeGroups']['length']?(this['_setCachedContentParts'](_0x4d0692,null),null):_0x1af9b0(_0x8e1900);{const _0x4c5902=_0x8e1900['find'](({index:_0x1157e5})=>_0x1157e5===_0x4590ee);if(_0x4c5902)return[_0x1af9b0(_0x4c5902)];}return null;}['_setCachedContentParts'](_0x179a69,_0x2c8be3){const _0x3007cb=_0x179a69?'withDiff':'withoutDiff';_0x2c8be3?_0x2c8be3['forEach'](_0x4122ea=>{const _0x4e3082=this['cachedSuggestionContentParts'][_0x3007cb],_0x1af367=_0x4e3082['find'](({index:_0x31bc16})=>_0x31bc16===_0x4122ea['index']);if(_0x1af367){const _0x5e3a23=_0x4e3082['indexOf'](_0x1af367);_0x4e3082['splice'](_0x5e3a23,0x1,_0x4122ea);}else _0x4e3082['push'](_0x4122ea);}):this['cachedSuggestionContentParts'][_0x3007cb]['length']=0x0;}['onContentChange'](){if('modification'===this['type']){this['parsedContent']=this['aiResponseParser']['parseAndNormalizeHTML'](this['content']);const _0x1bcdc1=this['changeGroups'];this['updateChangeGroups']();const _0x5273fd=this['_getDifferentChangeGroups'](_0x1bcdc1,this['changeGroups']);(_0x5273fd['length']||this['isDone'])&&(this['fire']('replyContentUpdated',this,_0x5273fd),this['cachedSuggestionContentParts']['withDiff']['length']=this['cachedSuggestionContentParts']['withoutDiff']['length']=0x0);}else this['parsedContent']=this['aiResponseParser']['convertMarkdownToHTML'](this['content']),this['fire']('replyContentUpdated',this);}['_getDifferentChangeGroups'](_0x56f3e1,_0x171c6b){const _0x31eeaa=[];for(const _0x44386e of _0x171c6b){const _0x5a4453=_0x56f3e1[_0x44386e['index']];_0x5a4453?_0x5a4453['changes']['length']!==_0x44386e['changes']['length']?_0x31eeaa['push'](_0x44386e):_0x5a4453['changes']['forEach']((_0x3a937c,_0x533f66)=>{const _0x29f16b=_0x44386e['changes'][_0x533f66];_0x3a937c['id']!==_0x29f16b['id']&&_0x31eeaa['push'](_0x44386e);}):_0x31eeaa['push'](_0x44386e);}return _0x31eeaa;}['updateChangeGroups'](){const _0x24fd56=new ti('p',{},[new ti('span',{'style':'color:\x20#808080;\x20font-style:\x20italic'},[new _0x366237(as(this['editor']['locale'],'AI_SUGGESTION_CONTENT_PART_REMOVED'))])]),_0x5d9c83=this['aiResponseApplier']['merge'](this['parsedContent'],this['documentContextContent']['cloneNode'](!0x0),{'markUnstableElements':!this['isDone'],'replaceRemovedWith':_0x24fd56,'cutAfterLastChange':!this['isDone']});if(!_0x5d9c83['modifiedNodeIds']['length']&&!this['isDone'])return;this['parsedMergedContent']=_0x5d9c83['parsedContent'];let _0x2d400e=[];if(_0x2709fb(_0x332e27=>{const _0x32a2fd=gs(_0x332e27,'data-id');if(!_0x32a2fd||!_0x57b2e2(_0x32a2fd))return!0x1;const _0x429ac8=[_0x332e27,...Ts(_0x332e27)]['at'](-0x2);if(_0x332e27!=_0x429ac8){const _0x44fb49=gs(_0x429ac8,'data-id');_0x57b2e2(_0x44fb49)||(_0x2d400e['push']({'node':_0x429ac8,'id':_0x44fb49,'type':'modified'}),_0x5d9c83['modifiedNodeIds']['push'](_0x44fb49));}else _0x5d9c83['modifiedNodeIds']['includes'](_0x32a2fd)?_0x2d400e['push']({'node':_0x332e27,'type':'modified','id':_0x32a2fd}):_0x5d9c83['newNodeIds']['includes'](_0x32a2fd)?_0x2d400e['push']({'node':_0x332e27,'type':'new','id':_0x32a2fd,'anchorId':gs(_0x332e27['previousSibling'],'data-id')}):_0x2d400e['push']({'node':_0x332e27,'type':'removed','id':_0x32a2fd});return!0x0;},this['parsedMergedContent']),_0x2d400e=_0x2d400e['filter'](({node:_0x2cc7a2})=>[...Ts(_0x2cc7a2),_0x2cc7a2]['every'](_0x10acad=>!gs(_0x10acad,'data-unstable'))),0x0==_0x2d400e['length'])return;const _0x440ed4=[[_0x2d400e[0x0]]];for(let _0x5019e8=0x1;_0x5019e8<_0x2d400e['length'];_0x5019e8++){const _0x4e88d0=_0x440ed4[_0x440ed4['length']-0x1],_0x560984=_0x4e88d0[_0x4e88d0['length']-0x1];_0x2d400e[_0x5019e8]['node']['previousSibling']==_0x560984['node']&&'modified'!=_0x2d400e[_0x5019e8]['type']&&'modified'!=_0x560984['type']?_0x4e88d0['push'](_0x2d400e[_0x5019e8]):_0x440ed4['push']([_0x2d400e[_0x5019e8]]);}for(const _0x5cb185 of _0x440ed4){const _0x5772a6=_0x5cb185[0x0],_0x29620f=_0x5cb185[_0x5cb185['length']-0x1],_0x35a696=_0x5c7baf(_0x5772a6['node']['previousSibling']);_0x35a696&&_0x5cb185['unshift'](_0x35a696);const _0x5beaee=_0x5c7baf(_0x29620f['node']['nextSibling']);_0x5beaee&&_0x5cb185['push'](_0x5beaee);}function _0x57b2e2(_0x415617){return _0x5d9c83['modifiedNodeIds']['includes'](_0x415617)||_0x5d9c83['newNodeIds']['includes'](_0x415617)||_0x5d9c83['removedNodeIds']['includes'](_0x415617);}function _0x5c7baf(_0x5b0a94){if(_0x5b0a94&&gs(_0x5b0a94,'data-id')&&!gs(_0x5b0a94,'data-unstable')){const _0x4e954d=gs(_0x5b0a94,'data-id');if(!_0x57b2e2(_0x4e954d))return{'node':_0x5b0a94,'type':'context','id':_0x4e954d};}return null;}this['changeGroups']=_0x440ed4['map']((_0x2c6def,_0x4e42d1)=>({'changes':_0x2c6def,'state':'pending','index':_0x4e42d1}));}}const ys=['interactionCreated','interactionStarted','interactionStopped','interactionFinished','interactionDestroyed','replyCreated','replyContentUpdated','replyChangeGroupStateUpdated','setConversationTitle','webSearchStarted','webSearchFinished','reasoningStarted','reasoningFinished','toolDataReceived','error'];class xs extends pt(){['id'];['replies']=[];['currentReply'];['messageId'];['actionCallId'];['currentRequest'];['connector'];['isStopped']=!0x1;['isDestroyed']=!0x1;['editor'];['_isReasoning']=!0x1;['_isWebSearching']=!0x1;constructor({connector:_0x492971,editor:_0x5e57a9}){super(),this['id']=at(),this['connector']=_0x492971,this['isStopped']=!0x0,this['editor']=_0x5e57a9;}async['start'](){const _0x55cc84=[];let _0x56c3b9,_0x3d71fa,_0x2b324f;this['isStopped']=!0x1;try{this['currentRequest']=await this['sendRequest'](),this['fire']('interactionStarted',this);const _0x2d1d32=await this['currentRequest']['getStream']();for await(const _0x39640f of _0x2d1d32){if(this['isStopped'])return;if('error'==_0x39640f['event'])return void this['fire']('error',{'error':new ot('ai-chat-interaction-error',this)});switch(_0x39640f['event']){case'message-metadata':this['messageId']=_0x39640f['data']['messageId'];break;case'action-metadata':this['actionCallId']=_0x39640f['data']['callId'];break;case'conversation-title':this['setConversationTitle'](_0x39640f['data']['conversationTitle'],!0x0);break;case'source':_0x55cc84['push'](_0x39640f['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'](),_0x56c3b9='modification-delta'==_0x39640f['event']?'modification':'text',_0x3d71fa='modification-delta'==_0x39640f['event']?_0x39640f['data']['id']:void 0x0,this['currentReply']&&this['currentReply']['type']!=_0x56c3b9&&(this['currentReply']['done'](),this['currentReply']=void 0x0),this['currentReply']||(this['currentReply']=this['createReply']({'type':_0x56c3b9,'interactionId':this['id'],'id':_0x3d71fa}),'modification'==_0x56c3b9&&(this['currentReply']['sources']=_0x55cc84['splice'](0x0))),this['currentReply']['appendContent'](_0x39640f['data']['textDelta']);break;case'mcp-tool-result':_0x2b324f=JSON['parse'](_0x39640f['data']['result']),this['_handleToolResultData']({'toolName':_0x39640f['data']['toolName'],'data':_0x2b324f['data'],'attributes':_0x2b324f['attributes']});break;case'mcp-tool-notification':this['_handleToolNotificationData']({'toolName':_0x39640f['data']['toolName'],'data':_0x39640f['data']['data']});}}}finally{this['isStopped']||(this['currentReply']&&_0x55cc84['length']>0x0&&(this['currentReply']['sources']=_0x55cc84['splice'](0x0)),this['_finalizeInteraction'](),this['fire']('interactionFinished',this));}}['stop'](){this['isStopped']||(this['_finalizeInteraction'](),this['fire']('interactionStopped',this));}['getReply'](_0x206b6d){return this['replies']['find'](_0x48c39b=>_0x48c39b['id']===_0x206b6d);}['destroy'](){this['isDestroyed']||(this['stop'](),this['replies']['forEach'](_0x4cfe76=>_0x4cfe76['destroy']()),this['replies']=[],this['isDestroyed']=!0x0,this['fire']('interactionDestroyed',this),this['stopListening']());}['createReply'](_0x26133e){const _0x534d0c=new vs({'editor':this['editor'],'documentContextContent':this['getDocumentContext']()?.['content'],..._0x26133e});return this['replies']['push'](_0x534d0c),_0x534d0c['delegate'](...ys)['to'](this),this['fire']('replyCreated',_0x534d0c),_0x534d0c;}['setConversationTitle'](_0x1f8d2f,_0x4c44b2=!0x1){this['fire']('setConversationTitle',_0x1f8d2f,_0x4c44b2);}['resetWebSearchState'](){this['_isWebSearching']&&(this['_isWebSearching']=!0x1,this['fire']('webSearchFinished',this));}['resetReasoningState'](){this['_isReasoning']&&(this['_isReasoning']=!0x1,this['fire']('reasoningFinished',this));}['_handleToolResultData'](_0x3ae5ec){this['fire']('toolDataReceived',{'type':'result','toolName':_0x3ae5ec['toolName'],'data':structuredClone(_0x3ae5ec['data']||{}),'attributes':structuredClone(_0x3ae5ec['attributes']||{})},this);}['_handleToolNotificationData'](_0x4eff7b){this['fire']('toolDataReceived',{'type':'notification','toolName':_0x4eff7b['toolName'],'data':structuredClone(_0x4eff7b['data'])},this);}['_finalizeInteraction'](){this['isStopped']=!0x0,this['currentRequest']&&this['currentRequest']['abortController']['abort'](),this['currentReply']&&this['currentReply']['done'](),this['currentRequest']=this['currentReply']=void 0x0;}}const Ls=new Map([['usage-limits-exceeded','ai-usage-limits-exceeded'],['rate-limits-exceeded','ai-rate-limits-exceeded'],['invalid-content-type','ai-invalid-content-type'],['invalid-request-data','ai-chat-invalid-request'],['model-already-set','ai-chat-model-already-set'],['model-not-found','ai-chat-model-not-found'],['unsafe-content-detected','ai-chat-unsafe-content-detected'],['unsupported-content-type','ai-chat-unsupported-content-type'],['content-too-large','ai-chat-content-too-large'],['unsupported-file-type','ai-chat-context-unsupported-file-type'],['file-too-large','ai-chat-context-file-too-large'],['file-too-many-pages','ai-chat-context-file-too-many-pages'],['form-data-size-limits-exceeded','ai-chat-context-form-data-size-limits-exceeded']]),Ds=['contextItemAdded','contextItemRemoved','contextItemLoadingEnded','contextSent','error','addContextOptionsChanged','sourceResourcesLoaded','resourceStateChanged','uploadProgressChanged'];class Ps extends ht(){['_connector'];['_config'];['_ownerId'];constructor({connector:_0x3a4ad8,config:_0xed2b7e,ownerId:_0x519b8f}){super(),this['_connector']=_0x3a4ad8,this['_config']=_0xed2b7e,this['_ownerId']=_0x519b8f;}['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'](_0x1f1177){const _0x260663=await this['_createContextItemFromContent'](_0x1f1177);return this['_addToConversationContextItem'](_0x260663),'current-document'===_0x260663['uiId']&&this['_toggleAddCurrentDocumentOptionVisibility'](),_0x260663;}async['_createContextItemFromContent'](_0x98065b){if('document'===_0x98065b['type']){const _0x999fa8=await this['_connector']['fetchDocument'](this['_ownerId'],_0x98065b['id'])['getDocument']();return{'id':'current-document','uiId':'current-document','label':'Current\x20document','type':_0x98065b['type'],'content':_0x999fa8['content'],'hidden':this['_conversationContextItems']['has']('current-document'),'version':_0x999fa8['attributes']?.['version'],'sessionId':_0x999fa8['attributes']?.['sessionId']};}if('mcp-tool-context'===_0x98065b['type'])return{'id':_0x98065b['id'],'uiId':_0x98065b['id'],'label':_0x98065b['data']?.['label']||_0x98065b['id'],'type':'mcp-tool-context','mcpServerName':_0x98065b['mcpServerName'],'toolName':_0x98065b['toolName'],'data':_0x98065b['data']||{}};return{'id':_0x98065b['id'],'uiId':_0x98065b['id'],'label':_0x98065b['attributes']?.['label']||_0x98065b['name']||_0x98065b['url']||_0x98065b['id'],'type':_0x98065b['type'],..._0x98065b?.['attributes']?.['resourceId']?{'resourceId':_0x98065b['attributes']?.['resourceId']}:{}};}['getSentContextItems'](){return new Map(this['_conversationContextItems']);}['removeFromContext'](_0x28a55b){const _0x46fb10=this['_pendingContextItems']['get'](_0x28a55b);_0x46fb10?.['isReadOnly']||this['_removeContextItem'](_0x28a55b);}['clearPendingContextItems'](){if(0x0===this['_pendingContextItems']['size'])return;for(const _0x260829 of this['_pendingContextItems']['values']())this['_removeContextItem'](_0x260829['uiId']);const _0x432cb2=this['_conversationContextItems']['get']('current-document')||this['_pendingContextItems']['get']('current-document');_0x432cb2&&this['_addContextItem']({..._0x432cb2,'isReadOnly':!0x0,'hidden':!0x0});}['addToConversationContext'](_0x1f67b2){for(const _0x380652 of _0x1f67b2['values']())this['_addToConversationContextItem'](_0x380652);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'](_0x3c0375){return Array['from'](_0x3c0375['values']())['map'](_0x42ce48=>this['_mapContextItemToRequestData'](_0x42ce48))['filter'](_0x4b02a4=>null!==_0x4b02a4);}async['addFilesToContext'](_0x14f188,_0x175472,_0x2aaa76='file'){const _0x8cc113='files-'+at();this['_startUploadOperation'](_0x8cc113);try{await Promise['all'](_0x14f188['map'](async _0x31b930=>{const _0x47e020='file-'+at(),_0x33b47a=_0x276663(_0x31b930['name']);try{this['_addContextItem']({'type':_0x2aaa76,'label':_0x175472?.['label']||_0x33b47a,'uiId':_0x47e020,'resourceId':_0x175472?.['resourceId']},!0x0);const _0x579fd0=this['_connector']['uploadFile'](this['_ownerId'],_0x31b930,_0x175472);this['_ongoingUploads']['set'](_0x47e020,_0x579fd0['abortController']);const {id:_0xe8a724}=await _0x579fd0['getId']();this['_ongoingUploads']['delete'](_0x47e020),this['_finishContextItemLoading']({'type':_0x2aaa76,'id':_0xe8a724,'label':_0x175472?.['label']||_0x33b47a,'uiId':_0x47e020,'resourceId':_0x175472?.['resourceId']},!0x1);}catch(_0x34985f){this['_ongoingUploads']['delete'](_0x47e020);if(!(_0x34985f instanceof ot&&_0x34985f['message']['startsWith']('ai-request-aborted'))){const _0x4c6b49=Ls['get'](_0x34985f['code'])||'ai-chat-file-upload-failed',_0xa37311=new ot(_0x4c6b49,null,{'fileName':_0x33b47a,..._0x34985f});_0xa37311['stack']=_0x34985f['stack'],this['fire']('error',{'error':_0xa37311});}this['_removeContextItem'](_0x47e020);}}));}finally{this['_finishUploadOperation'](_0x8cc113);}}['addCurrentDocumentToContext'](_0x391376){if(this['isCurrentDocumentInContext']()||!this['_addContextOptionsState']['document']['enabled'])return;const _0xb263d1={'type':'document','uiId':'current-document','label':_0x391376,'isReadOnly':this['_conversationContextItems']['has']('current-document'),'hidden':this['_conversationContextItems']['has']('current-document')};this['_addContextItem'](_0xb263d1);}async['updateCurrentDocument'](_0x371b88,_0x58c426,_0x5dbe29,_0x3b9d6c){const _0x24aa38=this['_pendingContextItems']['get']('current-document');if(_0x24aa38&&_0x371b88){_0x24aa38['selection']=_0x3b9d6c?_0x3b9d6c['map'](_0x2daf9e=>({'start':_0x2daf9e['start'],'end':_0x2daf9e['end']})):[];try{if(_0x24aa38['version']===_0x58c426)return;const {id:_0x196112}=await this['_connector']['uploadDocument'](this['_ownerId'],_0x371b88,{'version':_0x58c426,'sessionId':_0x5dbe29})['getId']();_0x24aa38['id']=_0x196112,_0x24aa38['content']=_0x371b88,_0x24aa38['version']=_0x58c426,_0x24aa38['sessionId']=_0x5dbe29;}catch(_0x4391e1){const _0x35ace1=new ot('ai-chat-document-upload-failed',null);_0x35ace1['stack']=_0x4391e1['stack'],this['fire']('error',{'error':_0x35ace1});}}}['addSelectionToContext'](_0x419019){this['_addContextItem']({'type':'selection','label':_0x419019,'uiId':'selection','content':_0x419019});}['removeSelectionFromContext'](){this['_removeContextItem']('selection');}async['addUrlToContext'](_0x134f92,_0x590f94){const _0x1c99f3='url-'+at();this['_startUploadOperation'](_0x1c99f3);const _0x1059f9='url-'+at();try{this['_addContextItem']({'type':'web-resource','label':_0x590f94?.['label']||_0x134f92,'uiId':_0x1059f9,'resourceId':_0x590f94?.['resourceId']},!0x0);const _0x29e1cf=this['_connector']['uploadUrl'](this['_ownerId'],_0x134f92,_0x590f94);this['_ongoingUploads']['set'](_0x1059f9,_0x29e1cf['abortController']);const {id:_0x5a0d86}=await _0x29e1cf['getId']();this['_ongoingUploads']['delete'](_0x1059f9),this['_finishContextItemLoading']({'type':'web-resource','id':_0x5a0d86,'label':_0x590f94?.['label']||_0x134f92,'uiId':_0x1059f9,'resourceId':_0x590f94?.['resourceId']},!0x1);}catch(_0x2c2c43){this['_ongoingUploads']['delete'](_0x1059f9),(_0x2c2c43['message']['startsWith']('ai-request-aborted')||this['fire']('error',{'error':new ot('ai-chat-url-upload-failed',this,{'url':_0x134f92,'originalError':_0x2c2c43}),'url':_0x134f92}),this['_removeContextItem'](_0x1059f9));}finally{this['_finishUploadOperation'](_0x1c99f3);}}['addToolItemToContext'](_0x431db5){_0x431db5['id']=_0x431db5['id']??at()['substring'](0x0,0x15),this['_pendingContextItems']['set'](_0x431db5['uiId'],_0x431db5),this['fire']('contextItemAdded',{'contextItem':_0x431db5,'isLoading':!0x1});}async['loadSourceResources'](_0x5b4f9b,_0x179c66,_0x24278e){const _0x7f255d=this['_addContextOptionsState']['sources']['find'](_0x366260=>_0x366260['id']===_0x5b4f9b);if(!_0x7f255d)return this['fire']('error',{'error':new ot('ai-chat-source-not-found',this,{'sourceId':_0x5b4f9b}),'sourceId':_0x5b4f9b}),[];try{const _0x3c7c62=(await _0x7f255d['getResources'](_0x179c66))['map'](_0x485faa=>{const _0x3ecc5c=this['_isResourceInContext'](_0x485faa['id']);return{..._0x485faa,'isInContext':_0x3ecc5c};});return _0x7f255d['resources']=_0x3c7c62,this['fire']('sourceResourcesLoaded',{'sourceId':_0x5b4f9b,'source':_0x7f255d,'resources':_0x3c7c62,'uid':_0x24278e}),_0x3c7c62;}catch(_0x1b1be0){return this['fire']('error',{'error':new ot('ai-chat-source-resources-load-failed',this,{'sourceId':_0x5b4f9b,'originalError':_0x1b1be0}),'sourceId':_0x5b4f9b,'sourceLabel':_0x7f255d['label']}),[];}}async['addResourceToContext'](_0x2dd1c5,_0x143877){if(this['_isResourceInContext'](_0x143877['id']))return;let _0x4fb2f6=_0x143877['data'];if(!_0x4fb2f6&&_0x2dd1c5['getData'])try{_0x4fb2f6=await _0x2dd1c5['getData'](_0x143877['id']);}catch(_0x564c99){return void this['fire']('error',{'error':new ot('ai-chat-resource-load-failed',this,{'resourceId':_0x143877['id'],'sourceId':_0x2dd1c5['id'],'originalError':_0x564c99}),'resourceId':_0x143877['id'],'sourceId':_0x2dd1c5['id']});}if(_0x4fb2f6)switch(_0x143877['type']){case'web-resource':if('string'!=typeof _0x4fb2f6)return void this['fire']('error',{'error':new ot('ai-chat-context-invalid-data',this,{'resourceId':_0x143877['id'],'sourceId':_0x2dd1c5['id'],'expectedType':'string','actualType':typeof _0x4fb2f6}),'resourceId':_0x143877['id'],'sourceId':_0x2dd1c5['id']});await this['addUrlToContext'](_0x4fb2f6,{'label':_0x143877['label'],'resourceId':_0x143877['id']});break;case'file':if(!(_0x4fb2f6 instanceof File))return void this['fire']('error',{'error':new ot('ai-chat-context-invalid-data',this,{'resourceId':_0x143877['id'],'sourceId':_0x2dd1c5['id'],'expectedType':'File','actualType':typeof _0x4fb2f6}),'resourceId':_0x143877['id'],'sourceId':_0x2dd1c5['id']});await this['addFilesToContext']([_0x4fb2f6],{'label':_0x143877['label'],'resourceId':_0x143877['id']});break;case'text':if('object'!=typeof _0x4fb2f6||!('content'in _0x4fb2f6)||!('type'in _0x4fb2f6))return void this['fire']('error',{'error':new ot('ai-chat-context-invalid-data',this,{'resourceId':_0x143877['id'],'sourceId':_0x2dd1c5['id'],'expectedType':'object\x20with\x20content\x20and\x20type\x20properties','actualType':typeof _0x4fb2f6}),'resourceId':_0x143877['id'],'sourceId':_0x2dd1c5['id']});_0x4fb2f6=Ps['_convertTextResourceToFile'](_0x4fb2f6,_0x143877['label']),await this['addFilesToContext']([_0x4fb2f6],{'label':_0x143877['label'],'resourceId':_0x143877['id']},'text');break;case'mcp-tool-context':break;default:this['fire']('error',{'error':new ot('ai-chat-context-unsupported-type',this,{'resourceId':_0x143877['id'],'sourceId':_0x2dd1c5['id'],'resourceType':_0x143877['type']}),'resourceId':_0x143877['id'],'sourceId':_0x2dd1c5['id']});}else this['fire']('error',{'error':new ot('ai-chat-resource-no-data',this,{'resourceId':_0x143877['id'],'sourceId':_0x2dd1c5['id']}),'resourceId':_0x143877['id'],'sourceId':_0x2dd1c5['id']});}static['_convertTextResourceToFile'](_0x1019f2,_0x437982){switch(_0x1019f2['type']){case'markdown':return new File([_0x1019f2['content']],_0x437982,{'type':'text/markdown'});case'html':return new File([_0x1019f2['content']],_0x437982,{'type':'text/html'});default:return new File([_0x1019f2['content']],_0x437982,{'type':'text/plain'});}}static['_mapContextItemToRequestData'](_0x4683b1){switch(_0x4683b1['type']){case'file':case'text':return{'type':'file','id':_0x4683b1['id']};case'web-resource':return{'type':'web-resource','id':_0x4683b1['id']};case'document':return{'type':'document','id':_0x4683b1['id'],..._0x4683b1['selection']?.['length']&&{'selection':_0x4683b1['selection']}};case'mcp-tool-context':{const _0x36444c=_0x4683b1;return{'type':'mcp-tool-context','mcpServerName':_0x36444c['mcpServerName'],'toolName':_0x36444c['toolName'],'data':_0x36444c['data'],'id':_0x36444c['id']};}default:return null;}}['_addContextItem'](_0x575f15,_0x2ef0e3=!0x1){if(this['_pendingContextItems']['set'](_0x575f15['uiId'],_0x575f15),_0x575f15['hidden']||this['fire']('contextItemAdded',{'contextItem':_0x575f15,'isLoading':_0x2ef0e3}),'current-document'===_0x575f15['uiId']&&this['_toggleAddCurrentDocumentOptionVisibility'](),_0x575f15['resourceId']){const _0x2d6ad6=this['_findSourceIdsByResourceId'](_0x575f15['resourceId']);_0x2d6ad6&&_0x2d6ad6['forEach'](_0x111846=>{this['_updateResourceInContextState'](_0x111846,_0x575f15['resourceId'],!0x0);});}}['_removeContextItem'](_0x5ad094){const _0x3068da=this['_pendingContextItems']['get'](_0x5ad094),_0x3c97d1=this['_ongoingUploads']['get'](_0x5ad094);if(_0x3c97d1&&(_0x3c97d1['abort'](),this['_ongoingUploads']['delete'](_0x5ad094)),_0x3068da?.['resourceId']){const _0x2995bf=this['_findSourceIdsByResourceId'](_0x3068da['resourceId']);_0x2995bf&&_0x2995bf['forEach'](_0x11d2f1=>{this['_updateResourceInContextState'](_0x11d2f1,_0x3068da['resourceId'],!0x1);});}this['_pendingContextItems']['delete'](_0x5ad094),this['fire']('contextItemRemoved',{'uiId':_0x5ad094,'type':_0x3068da?.['type']}),'current-document'===_0x5ad094&&this['_toggleAddCurrentDocumentOptionVisibility']();}['_finishContextItemLoading'](_0x2f2326,_0x15d820){if(this['_pendingContextItems']['has'](_0x2f2326['uiId'])&&(this['_pendingContextItems']['set'](_0x2f2326['uiId'],_0x2f2326),this['fire']('contextItemLoadingEnded',{'contextItem':_0x2f2326,'isLoading':_0x15d820}),_0x2f2326['resourceId'])){const _0x1383a5=this['_findSourceIdsByResourceId'](_0x2f2326['resourceId']);_0x1383a5&&_0x1383a5['forEach'](_0x3a9280=>{this['_updateResourceInContextState'](_0x3a9280,_0x2f2326['resourceId'],!0x0);});}}['_addToConversationContextItem'](_0x2177ca){this['_conversationContextItems']['set'](_0x2177ca['uiId'],_0x2177ca);}['_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'](_0x6b3d89=>({..._0x6b3d89,'enabled':!0x0}))??[]},this['fire']('addContextOptionsChanged',{'options':this['_addContextOptionsState']});}['_getCustomSourcesInitialState'](){return this['_config']?.['sources']?.['map'](_0x20bd01=>({..._0x20bd01,'resources':[]}))??[];}['_toggleAddCurrentDocumentOptionVisibility'](){const _0x425221=this['isCurrentDocumentInContext']()||this['isCurrentDocumentInConversation']();this['_addContextOptionsState']['document']['isHidden']=_0x425221,this['fire']('addContextOptionsChanged',{'options':this['_addContextOptionsState']});}['_isResourceInContext'](_0x59d84b){for(const _0x3d8bf1 of this['_pendingContextItems']['values']())if(_0x3d8bf1['resourceId']===_0x59d84b)return!0x0;for(const _0x361d24 of this['_conversationContextItems']['values']())if(_0x361d24['resourceId']===_0x59d84b)return!0x0;return!0x1;}['_findSourceIdsByResourceId'](_0x22767b){const _0x1c3307=[];for(const _0x41c638 of this['_addContextOptionsState']['sources']){_0x41c638['resources']['find'](_0xfee3fe=>_0xfee3fe['id']===_0x22767b)&&_0x1c3307['push'](_0x41c638['id']);}return 0x0===_0x1c3307['length']?null:_0x1c3307;}['_updateResourceInContextState'](_0x349d58,_0x102540,_0x3d2adc){const _0x2d3b74=this['_addContextOptionsState']['sources']['find'](_0x136aa4=>_0x136aa4['id']===_0x349d58);if(!_0x2d3b74)return;const _0x387835=_0x2d3b74['resources']['find'](_0x1271a7=>_0x1271a7['id']===_0x102540);_0x387835&&(_0x387835['isInContext']=_0x3d2adc,this['fire']('resourceStateChanged',{'sourceId':_0x349d58,'resourceId':_0x102540,'isInContext':_0x3d2adc}));}['_startUploadOperation'](_0x25c9fa){this['_ongoingUploadOperations']['set'](_0x25c9fa,!0x0),this['_ongoingUploadOperations']['size']&&this['fire']('uploadProgressChanged',{'isUploadInProgress':!0x0});}['_finishUploadOperation'](_0x2b05e9){this['_ongoingUploadOperations']['delete'](_0x2b05e9),0x0===this['_ongoingUploadOperations']['size']&&this['fire']('uploadProgressChanged',{'isUploadInProgress':!0x1});}}const Hs=['capabilitiesUpdated'];class Ms extends pt(){['_isWebSearchEnabled'];['_isReasoningEnabled'];constructor(){super(),this['_isWebSearchEnabled']=!0x1,this['_isReasoningEnabled']=!0x1;}['init'](){this['reset']();}['reset'](){this['setWebSearch'](!0x1),this['setReasoning'](!0x1);}['getCapabilitiesConfig'](){return{'isWebSearchEnabled':this['_isWebSearchEnabled'],'isReasoningEnabled':this['_isReasoningEnabled']};}static['getCapabilitiesRequestData'](_0x18fd3a){const _0x509ed2={};return _0x18fd3a&&_0x18fd3a['isWebSearchEnabled']&&(_0x509ed2['webSearch']={}),_0x18fd3a&&_0x18fd3a['isReasoningEnabled']&&(_0x509ed2['reasoning']={}),_0x509ed2;}['toggleWebSearch'](){this['setWebSearch'](!this['_isWebSearchEnabled']);}['toggleReasoning'](){this['setReasoning'](!this['_isReasoningEnabled']);}['setWebSearch'](_0xa2f3c9){_0xa2f3c9!==this['_isWebSearchEnabled']&&(this['_isWebSearchEnabled']=_0xa2f3c9,this['fire']('capabilitiesUpdated',this['getCapabilitiesConfig']()));}['setReasoning'](_0x43892b){_0x43892b!==this['_isReasoningEnabled']&&(this['_isReasoningEnabled']=_0x43892b,this['fire']('capabilitiesUpdated',this['getCapabilitiesConfig']()));}}class Us extends xs{['userMessage'];['conversationId'];['contextItems']=new Map();['capabilities'];['model'];['attributes'];constructor(_0x1b6f64){super(_0x1b6f64),this['conversationId']=_0x1b6f64['conversationId'],this['contextItems']=_0x1b6f64['contextItems'],this['capabilities']=_0x1b6f64['capabilities'],this['userMessage']=_0x1b6f64['userMessage'],this['model']=_0x1b6f64['model'],this['attributes']=_0x1b6f64['attributes'];}async['sendRequest'](){return this['connector']['queryAssistant']({'message':this['userMessage'],'conversationId':this['conversationId'],'parts':Ps['mapContextItemsToRequestData'](this['contextItems']),'capabilities':Ms['getCapabilitiesRequestData'](this['capabilities']),'model':this['model'],'attributes':this['attributes']});}['getDocumentContext'](){return this['contextItems']['get']('current-document');}}class Vs extends pt(){['id'];['isStarted']=!0x1;['isFromHistory'];['interactions']=[];['currentInteraction'];['selectedModel'];['connector'];['options'];constructor(_0x24aa10){super(),this['options']=_0x24aa10,this['connector']=_0x24aa10['connector'],this['chatModels']=_0x24aa10['chatModels'],this['id']=_0x24aa10['conversationId'],this['isFromHistory']=_0x24aa10['isFromHistory'];}async['init'](_0x354b0b){try{this['chatContext']=new Ps({'connector':this['connector'],'config':_0x354b0b,'ownerId':this['id']}),this['chatContext']['delegate'](...Ds)['to'](this),this['chatContext']['init'](),this['chatCapabilities']=new Ms(),this['chatCapabilities']['delegate'](...Hs)['to'](this),this['chatCapabilities']['init']();const _0x3f441e=await this['chatModels']['getAvailableModels']();this['fire']('conversationInitialized',{'availableModels':_0x3f441e});const _0x323edb=await this['chatModels']['getModel'](this['options']['selectedModelId']);_0x323edb&&await this['setModel'](_0x323edb);}catch(_0x3a0004){const _0x32ec16=new ot('ai-chat-conversation-init-failed',null,{'message':_0x3a0004['message']||_0x3a0004});_0x32ec16['stack']=_0x3a0004['stack'],this['fire']('error',{'error':_0x32ec16});}}async['start'](){if(this['isStarted'])throw new ot('ai-chat-conversation-already-started',null,{'conversation':this});if(!this['selectedModel'])throw new ot('ai-chat-conversation-start-no-model-selected',null,{'conversation':this});try{const {id:_0x5a4c16}=await this['connector']['startConversation'](this['id'],this['options']['group'])['getConversation']();this['id']=_0x5a4c16,this['isStarted']=!0x0,this['fire']('conversationStarted',{'conversationId':this['id'],'selectedModel':this['selectedModel']});}catch(_0xc5d36c){const _0x364754=new ot('ai-chat-conversation-start-failed',null,{'message':_0xc5d36c['message'],'conversationId':this['id']});throw _0x364754['stack']=_0xc5d36c['stack'],this['fire']('error',{'error':_0x364754}),_0x364754;}}async['load'](_0x3fd3bc,_0x48bc1e){try{const _0xb1e904=await this['connector']['fetchConversation'](_0x3fd3bc)['getConversation'](),_0x110d53=await this['connector']['fetchConversationMessages'](_0x3fd3bc)['getMessages'](),_0xc1aceb=_0x110d53[0x0]['model'];this['isStarted']=!0x0,this['id']=_0xb1e904['id'],'title'in _0xb1e904?this['fire']('setConversationTitle',_0xb1e904['title'],!0x0):this['fire']('setConversationTitle','',!0x0);const _0x1704b8=(await this['chatModels']['getAll']())['find'](_0x108783=>_0x108783['id']['toLowerCase']()===_0xc1aceb['toLowerCase']());return this['selectedModel']=_0x1704b8,this['fire']('modelSelected',{'selectedModel':_0x1704b8,'isDisabled':!0x0}),await this['_processMessagesToInteractions'](_0x110d53,_0x48bc1e,_0xc1aceb),this['currentInteraction']=void 0x0,this;}catch(_0x2619f6){const _0x2c93b9=new ot('ai-chat-conversation-init-from-id-failed',null,{'message':_0x2619f6['message'],'conversationId':_0x3fd3bc});throw _0x2c93b9['stack']=_0x2619f6['stack'],this['fire']('error',{'error':_0x2c93b9}),_0x2c93b9;}}async['_processMessagesToInteractions'](_0x561301,_0xbdc3b6,_0x2b5675){let _0x156585;for(const _0x19a34f of _0x561301)if('user'===_0x19a34f['role']){const _0x32aefb=await this['_extractContextItems'](_0x19a34f),_0x168a6a={'isReasoningEnabled':Object['hasOwn'](_0x19a34f['capabilities'],'reasoning'),'isWebSearchEnabled':Object['hasOwn'](_0x19a34f['capabilities'],'webSearch')};_0x156585=this['createInteraction']({'userMessage':_0x19a34f['prompt'],'contextItems':_0x32aefb,'capabilities':_0x168a6a,'modelId':_0x2b5675,'attributes':_0x19a34f['attributes']}),this['currentInteraction']=_0x156585,this['chatContext']['addToConversationContext'](this['currentInteraction']['contextItems']);}else{if('assistant'===_0x19a34f['role']&&_0x156585){const _0x526071=[];for(const _0x28ba07 of _0x19a34f['content'])switch(_0x28ba07['type']){case'text':case'modification':{const _0x48767d=_0x156585['getDocumentContext']()?.['sessionId']!==_0xbdc3b6;_0x156585['currentReply']=_0x156585['createReply']({'type':_0x28ba07['type'],'isDone':!0x0,'interactionId':_0x156585['id'],'areActionsDisabled':_0x48767d}),_0x156585['currentReply']['appendContent'](_0x28ba07['content']),_0x526071['length']>0x0&&(_0x156585['currentReply']['sources']=_0x526071['splice'](0x0));break;}case'url':_0x526071['push'](_0x28ba07);break;case'mcp-tool-result':{const {data:_0x18b75c,attributes:_0x359074}=JSON['parse'](_0x28ba07['content']);_0x156585['_handleToolResultData']({'toolName':_0x28ba07['toolName'],'data':_0x18b75c,'attributes':_0x359074});break;}}}}}async['_extractContextItems'](_0x5d8a4b){const _0x160226=new Map();if(!_0x5d8a4b['content'])return _0x160226;for(const _0x56a90d of _0x5d8a4b['content']){const _0x98c6ee=await this['chatContext']['populateFromMessage'](_0x56a90d);_0x98c6ee&&_0x160226['set'](_0x98c6ee['id'],_0x98c6ee);}return _0x160226;}async['handleUserInteraction']({userMessage:_0x352c40,attributes:_0x2dc27e}){if(!this['isStarted'])throw new ot('ai-chat-handle-user-conversation-not-initialized',null,{'conversation':this});if(this['currentInteraction'])throw new ot('ai-chat-handle-user-interaction-already-in-progress',null,{'conversation':this});try{const _0xdd75c4=this['chatContext']['getPendingContextItems'](),_0x476cf1=this['chatCapabilities']['getCapabilitiesConfig'](),_0x406a24=this['selectedModel']['id'];this['currentInteraction']=this['createInteraction']({'userMessage':_0x352c40,'contextItems':_0xdd75c4,'capabilities':_0x476cf1,'modelId':_0x406a24,'attributes':_0x2dc27e}),await this['currentInteraction']['start'](),this['chatContext']['addToConversationContext'](this['currentInteraction']['contextItems']);}catch(_0x10671a){if(_0x10671a instanceof ot)this['fire']('error',{'interactionId':this['currentInteraction']?this['currentInteraction']['id']:void 0x0,'error':_0x10671a});else{const _0x2651e0=Ls['get'](_0x10671a['code'])||'ai-chat-handle-user-interaction-start-failed';this['fire']('error',{'interactionId':this['currentInteraction']?this['currentInteraction']['id']:void 0x0,'error':new ot(_0x2651e0,null,{'error':_0x10671a})});}}finally{this['currentInteraction']?.['stop'](),this['currentInteraction']=void 0x0;}}['createInteraction']({userMessage:_0x5a8352,contextItems:_0xa8867c,capabilities:_0x289651,modelId:_0x4ea062,attributes:_0x409506}){const _0x3d178f=new Us({'userMessage':_0x5a8352,'contextItems':_0xa8867c,'capabilities':_0x289651,'conversationId':this['id'],'connector':this['connector'],'editor':this['options']['getEditor']&&this['options']['getEditor'](),'model':_0x4ea062,'attributes':_0x409506});return _0x3d178f['delegate'](...ys)['to'](this),this['interactions']['push'](_0x3d178f),this['fire']('interactionCreated',_0x3d178f),_0x3d178f;}['getInteraction'](_0x253332){return this['interactions']['find'](_0x15e2d8=>_0x15e2d8['id']===_0x253332);}['removeInteraction'](_0x28ddd1){const _0x4a296c=this['getInteraction'](_0x28ddd1);_0x4a296c&&(_0x4a296c['destroy'](),this['interactions']['splice'](this['interactions']['indexOf'](_0x4a296c),0x1));}get['lastInteraction'](){return this['interactions'][this['interactions']['length']-0x1];}['addCurrentDocumentToContext'](_0x2d04bf){this['chatContext']['addCurrentDocumentToContext'](_0x2d04bf);}async['updateCurrentDocumentInContext']({content:_0x1fa533,version:_0x447811,sessionId:_0x183d4d,selections:_0x2e5daa}){await this['chatContext']['updateCurrentDocument'](_0x1fa533,_0x447811,_0x183d4d,_0x2e5daa);}['getCurrentDocumentContext'](){return this['currentInteraction']?.['getDocumentContext']()?.['content']||'';}['addSelectionToContext'](_0x2f4b76){this['chatContext']['addSelectionToContext'](_0x2f4b76);}['removeSelectionFromContext'](){this['chatContext']['removeSelectionFromContext']();}['addFilesToContext'](_0x3ff8ff){this['chatContext']['addFilesToContext'](_0x3ff8ff);}['addUrlToContext'](_0x2afd97){this['chatContext']['addUrlToContext'](_0x2afd97);}['addToolItemToContext'](_0x3c79c1){this['chatContext']['addToolItemToContext'](_0x3c79c1);}['addResourceToContext'](_0xa3c980,_0xe4f5e){this['chatContext']['addResourceToContext'](_0xa3c980,_0xe4f5e);}['loadSourceResources'](_0x1089da,_0x48f537,_0x40fff4){return this['chatContext']['loadSourceResources'](_0x1089da,_0x48f537,_0x40fff4);}['removeFromContext'](_0x120c48){this['chatContext']['removeFromContext'](_0x120c48);}['setWebSearch'](_0xa5862f){this['chatCapabilities']['setWebSearch'](_0xa5862f);}['toggleWebSearch'](){this['chatCapabilities']['toggleWebSearch']();}['setReasoning'](_0x45d5b1){this['chatCapabilities']['setReasoning'](_0x45d5b1);}['toggleReasoning'](){this['chatCapabilities']['toggleReasoning']();}['isCurrentDocumentInContext'](){return this['chatContext']['isCurrentDocumentInContext']();}['isCurrentDocumentInConversation'](){return this['chatContext']['isCurrentDocumentInConversation']();}['isSelectionInContext'](){return this['chatContext']['isSelectionInContext']();}async['setModel'](_0x540d21){_0x540d21?!0x1===await this['chatModels']['isAvailable'](_0x540d21)&&(It('ai-chat-conversation-set-model-not-available',{'conversation':this,'model':_0x540d21}),_0x540d21=(await this['chatModels']['getAvailableModels']())[0x0]):(It('ai-chat-conversation-set-model-null',{'conversation':this}),_0x540d21=(await this['chatModels']['getAvailableModels']())[0x0]),_0x540d21['id']!==this['selectedModel']?.['id']&&(this['selectedModel']=_0x540d21,this['chatCapabilities']['reset'](),this['fire']('modelSelected',{'selectedModel':_0x540d21}));}}class Bs extends pt(){['_connector'];['_config'];['_locale'];['_modelList']=[];['_modelsRequest']=null;constructor({connector:_0x3b900e,config:_0x489430,locale:_0x3cbcf4}){super(),this['_connector']=_0x3b900e,this['_config']=_0x489430,this['_locale']=_0x3cbcf4;}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 _0x5e58ad=await this['getAll']();let _0x73bc8e;return _0x73bc8e=this['_availableModels']?this['_filterModels'](_0x5e58ad,this['_availableModels']):_0x5e58ad['filter'](_0x1863de=>_0x1863de['recommended']),_0x73bc8e;}async['getModel'](_0x5bf136){const _0x4ed1d1=await this['getAll']();if(!_0x4ed1d1['length'])return null;if(_0x5bf136){const _0x449b6b=this['_getModelById'](_0x4ed1d1,_0x5bf136);if(_0x449b6b)return _0x449b6b;It('ai-chat-model-id-unrecognized',{'modelId':_0x5bf136,'fallBackModelId':this['_defaultModelId']});}return this['getDefault']();}async['getDefault'](){const _0x3f1aa1=await this['getAvailableModels']();if(!_0x3f1aa1['length'])return null;if(this['_defaultModelId']){const _0x151586=this['_getModelById'](_0x3f1aa1,this['_defaultModelId']);if(_0x151586)return _0x151586;It('ai-chat-default-model-id-unrecognized',{'defaultModelId':this['_defaultModelId'],'fallBackModelId':_0x3f1aa1[0x0]['id']});}return _0x3f1aa1[0x0];}async['isAvailable'](_0x310c6e){return(await this['getAvailableModels']())['some'](_0x3d57be=>_0x3d57be['name']===_0x310c6e['name']&&_0x3d57be['provider']===_0x310c6e['provider']);}async['_retrieveModels'](){if(!this['_modelList']['length'])try{const _0x2fb9ee=this['_locale']['uiLanguage']||'en',_0x38333b=this['_connector']['getModels'](_0x2fb9ee),_0x3de640=await _0x38333b['list']();this['_modelList']=_0x3de640['items']['map'](_0x3a78a7=>Gs(_0x3a78a7)?{..._0x3a78a7,'name':as(this['_locale'],'AI_MODEL_NAME_AUTO')}:_0x3a78a7);}catch(_0x43b715){throw Et('ai-models-unable-to-retrieve',{'error':_0x43b715}),_0x43b715;}return[...this['_modelList']];}['_filterModels'](_0x1934ed,_0x3ad850){let _0x493552;if(_0x3ad850){_0x493552=[];const _0x361b75=new Set(),_0x3c98f5='string'==typeof _0x3ad850?[_0x3ad850['toLocaleLowerCase']()]:_0x3ad850['map'](_0x572cd9=>_0x572cd9['toLocaleLowerCase']());for(const _0x4fbac8 of _0x3c98f5)for(const _0x149a91 of _0x1934ed)!_0x361b75['has'](_0x149a91['id'])&&this['_isMatchingFilter'](_0x149a91,_0x4fbac8)&&(_0x493552['push'](_0x149a91),_0x361b75['add'](_0x149a91['id']));}else _0x493552=_0x1934ed;return _0x493552;}['_isMatchingFilter'](_0x3d9a11,_0x41a234){const _0x1d0edf=_0x3d9a11['id']['toLocaleLowerCase'](),_0x592f38=_0x3d9a11['name']['toLocaleLowerCase'](),_0x568c49=_0x3d9a11['provider']['toLocaleLowerCase']();return _0x1d0edf===_0x41a234||_0x592f38===_0x41a234||Gs(_0x3d9a11)&&'auto'===_0x41a234||_0x568c49===_0x41a234||_0x1d0edf['startsWith'](_0x41a234);}['_getModelById'](_0x1b4057,_0x295faa){return _0x1b4057['find'](_0x25fe31=>Gs(_0x25fe31)&&'auto'===_0x295faa?_0x25fe31:_0x25fe31['id']===_0x295faa)||null;}}function Gs(_0x3557b0){return _0x3557b0['id']['startsWith']('agent');}function Fs(_0x201b38){if(_0x201b38 instanceof _0xbeb021)return _0x201b38;if(_0x201b38?.['editors']&&_0x201b38['editors']['get'](0x0))return _0x201b38['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.'),_0x201b38['editors']['get'](0x0);throw new ot('ai-get-editor-from-context-no-editor');}function Ks({editor:_0x2d4d1f,interaction:_0x2c12fc,reply:_0x3722a5,groups:_0x554f35,transform:_0x3036d2,documentCompare:_0x514088,documentCompareOptions:_0x5a3925}){const _0x3f3149=_0x2c12fc['getDocumentContext']();if(!_0x3f3149)return[];const _0x3c9b9f=_0x3f3149['content'],_0xe0ca57=_0x3f3149['version'],_0x3677e8=_0x3722a5['documentContextContent']['cloneNode'](!0x0);for(const {changes:_0x1478a4}of _0x554f35){const _0x2dd822=_0x1478a4['filter'](_0x367352=>'new'!=_0x367352['type'])['map'](_0x5df4e5=>_s('data-id',_0x5df4e5['id'],_0x3677e8)),_0x452dc6=_0x1478a4['filter'](_0x1cfd3e=>'removed'!=_0x1cfd3e['type'])['map'](_0x41599a=>_0x41599a['node']['cloneNode'](!0x0));let _0x3bc086=null;if(_0x2dd822['length']){_0x3bc086=_0x2dd822[0x0]['previousSibling'];for(let _0x2c6115=0x0;_0x2c6115<_0x2dd822['length'];_0x2c6115++)_0x3723d6(_0x2dd822[_0x2c6115]);}if(_0x452dc6['length']){_0x3bc086||(_0x1478a4[0x0]['anchorId']?_0x3bc086=_s('data-id',_0x1478a4[0x0]['anchorId'],_0x3677e8):(_0x3bc086=_0x452dc6['shift'](),_0x2e812a(_0x3677e8,_0x3bc086)));for(let _0x57d8e9=0x0;_0x57d8e9<_0x452dc6['length'];_0x57d8e9++)_0x41a7e7(_0x3bc086,_0x452dc6[_0x57d8e9]),_0x3bc086=_0x452dc6[_0x57d8e9];}}const _0x4ef8a8=ds(_0x3677e8),_0x3fb3e6=_0x514088['getDiff'](_0x3c9b9f,_0x4ef8a8,_0x5a3925)['getOperations']();if(_0x3036d2){const _0x58cc40=_0x2d4d1f['model']['document']['history']['getOperations'](_0xe0ca57),_0x4ac212={'document':_0x2d4d1f['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1};return _0x1d1cb0(_0x3fb3e6,_0x58cc40,_0x4ac212)['operationsA'];}return _0x3fb3e6;}function Ws(_0x27a07e,_0x25c1d5){if('marker'!=_0x25c1d5['type'])return;const _0x426175=_0x27a07e['model']['markers']['get'](_0x25c1d5['name']);_0x426175&&(_0x25c1d5['oldRange']=_0x426175['getRange']());}class Ys extends _0x1aa7e1{['activeConversation'];['_aiEditing'];['_aiConnector'];['_aiChatUi'];['_aiChatModels'];['_aiChatBalloon'];['_batchToChanges']=new Map();['_currentPreviewedChangeGroup']=null;['_bodyCollection'];static get['requires'](){return[rs,_0x4371ca];}static get['pluginName'](){return'AIChatController';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){this['_bodyCollection']=new qt(this['context']['locale']),this['_bodyCollection']['attachToDom'](),this['_aiConnector']=this['context']['plugins']['get']('AIConnector'),this['_aiChatUi']=this['context']['plugins']['get']('AIChatUI'),this['_aiEditing']=this['context']['plugins']['get']('AIEditing'),this['_aiChatModels']=new Bs({'connector':this['_aiConnector'],'config':this['context']['config']['get']('ai.models'),'locale':this['context']['locale']});const _0x57889c=this['context']['plugins']['get']('AITabs');this['listenTo'](this['_aiChatUi'],'startConversation',()=>{this['_startConversationSafely']();}),this['listenTo'](this['_aiChatUi'],'sendUserMessage',(_0x5ab683,_0x2e747b)=>{this['_handleUIUserMessage']({'message':_0x2e747b});}),this['listenTo'](_0x57889c,'resizedTabs',(_0x433293,_0x18398f)=>{this['_setIsMaximized'](_0x18398f);}),this['listenTo'](this['_aiChatUi'],'resizeTabs',()=>{_0x57889c['resize']();}),this['listenTo'](_0x57889c['view'],'change:activeTab',(_0x5472d0,_0x5d8ba7,_0x4f6e41)=>{'chat'!==_0x4f6e41&&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',(_0x486d2e,_0x3e694c)=>{this['activeConversation']?.['addFilesToContext'](Array['from'](_0x3e694c));}),this['listenTo'](this['_aiChatUi'],'addUrlToContext',(_0x472ef3,_0x1854f3)=>{this['activeConversation']?.['addUrlToContext'](_0x1854f3);}),this['listenTo'](this['_aiChatUi'],'executeCustomItemCallback',(_0x42e961,_0x47666f)=>{_0x47666f['callback'](this['context']);}),this['listenTo'](this['_aiChatUi'],'addResourceToContext',(_0x4bf737,_0x383704)=>{this['activeConversation']?.['addResourceToContext'](_0x383704['source'],_0x383704['resource']);}),this['listenTo'](this['_aiChatUi'],'removeContextItem',(_0x5d5198,_0x46c525)=>{this['_removeFromContext'](_0x46c525);}),this['listenTo'](this['_aiChatUi'],'loadSourceResources',(_0x37ae54,_0x2246b7)=>{this['activeConversation']?.['loadSourceResources'](_0x2246b7['sourceId'],_0x2246b7['query'],_0x2246b7['uid']);}),this['listenTo'](this['_aiChatUi'],'toggleWebSearch',()=>{this['_toggleWebSearch']();}),this['listenTo'](this['_aiChatUi'],'toggleReasoning',()=>{this['_toggleReasoning']();}),this['listenTo'](this['_aiChatUi'],'selectModel',(_0x3854a6,_0x58d44c)=>{this['activeConversation']?.['setModel'](_0x58d44c);}),this['listenTo'](this['_aiChatUi'],'like',(_0x4a5b46,{replyId:_0xa15719})=>{console['log']('Liked\x20response',_0xa15719);}),this['listenTo'](this['_aiChatUi'],'dislike',(_0x32d0e8,{replyId:_0x713e54})=>{console['log']('Disliked\x20response',_0x713e54);}),this['listenTo'](this['_aiChatUi'],'insertSuggestion',(_0x2c1153,_0x208a67)=>{this['_insertSuggestion'](_0x208a67);}),this['listenTo'](this['_aiChatUi'],'showChangeInText',(_0x360f66,{replyId:_0x21f48f,partIndex:_0x5bef9a})=>{this['_aiChatBalloonShowDiff']=this['_aiChatUi']['showDiff'],this['_openBalloonFor'](_0x21f48f,_0x5bef9a);}),this['listenTo'](this['_aiChatUi'],'mouseOverSuggestion',(_0x2334a2,{replyId:_0xa3f132,partIndex:_0x385fbc})=>{const _0x1d4696=this['_getDocumentRangeForReplyChanges'](_0xa3f132,_0x385fbc);_0x1d4696&&'$graveyard'!=_0x1d4696['range']['root']['rootName']&&this['_aiEditing']['showFakeVisualSelection']({'ranges':[_0x1d4696['range']],'id':'change-area','priority':0xa});}),this['listenTo'](this['_aiChatUi'],'mouseLeaveSuggestion',()=>{this['_aiEditing']['hideFakeVisualSelection']('change-area');}),this['listenTo'](this['_aiChatUi'],'applySuggestion',(_0x271215,_0x5cf19a)=>{this['_aiEditing']['hideFakeVisualSelection']('change-area'),this['_applySuggestion'](_0x5cf19a);}),this['listenTo'](this['_aiChatUi'],'toggleSuggestionDisplayMode',async(_0x20079f,{replyId:_0x8907fa,showDiff:_0x5e7ebb})=>{const {reply:_0x262658}=this['getInteractionAndReplyById'](_0x8907fa),_0x54fc91=_0x262658['getContentParts']({'showDiff':_0x5e7ebb});await this['_aiChatUi']['updateFeedItemAIReplySuggestionContent']({'id':_0x262658['id'],'parts':_0x54fc91,'renderingStrategy':'static'});}),this['listenTo'](this['_aiChatUi'],'rejectSuggestion',(_0x235578,{replyId:_0x1cfd7f,partIndex:_0x12c6cd})=>{this['_rejectSuggestion']({'replyId':_0x1cfd7f,'partIndex':_0x12c6cd}),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:_0xb8fb4c,partIndex:_0x11270c}=this['_currentPreviewedChangeGroup'];this['_aiChatBalloonShowDiff']=!this['_aiChatBalloonShowDiff'];const {reply:_0x2aeb3c}=this['getInteractionAndReplyById'](_0xb8fb4c),_0x128718=_0x2aeb3c['getContentParts']({'showDiff':this['_aiChatBalloonShowDiff'],'groupIndex':_0x11270c});this['_aiChatBalloon']['updateContent']({'part':_0x128718[0x0],'renderingStrategy':'static','keepErrors':!0x0});}),this['listenTo'](this['_aiChatBalloon'],'applySuggestion',()=>{const {replyId:_0x2158ca,partIndex:_0xe293be}=this['_currentPreviewedChangeGroup'];this['_applySuggestion']({'replyId':_0x2158ca,'partIndex':_0xe293be}),this['_aiChatBalloon']['setState']('accepted');}),this['listenTo'](this['_aiChatBalloon'],'insertSuggestion',()=>{const {replyId:_0x274b3a,partIndex:_0x38e9cd}=this['_currentPreviewedChangeGroup'];this['_insertSuggestion']({'replyId':_0x274b3a,'partIndex':_0x38e9cd}),this['_aiChatBalloon']['setState']('accepted');}),this['listenTo'](this['_aiChatBalloon'],'rejectSuggestion',()=>{const {replyId:_0x46bf27,partIndex:_0x1755f4}=this['_currentPreviewedChangeGroup'];this['_rejectSuggestion']({'replyId':_0x46bf27,'partIndex':_0x1755f4}),this['_aiChatBalloon']['setState']('rejected');}),this['listenTo'](this['_aiChatBalloon'],'showNext',()=>{const {replyId:_0x2dd035,partIndex:_0x29c9af}=this['_currentPreviewedChangeGroup'],_0x5de81c=this['_getPresentableSiblingContentPartIndex'](_0x2dd035,_0x29c9af,'next');null!==_0x5de81c&&this['_openBalloonFor'](_0x2dd035,_0x5de81c);}),this['listenTo'](this['_aiChatBalloon'],'showPrevious',()=>{const {replyId:_0x5792dc,partIndex:_0x7a5492}=this['_currentPreviewedChangeGroup'],_0x503cff=this['_getPresentableSiblingContentPartIndex'](_0x5792dc,_0x7a5492,'previous');null!==_0x503cff&&this['_openBalloonFor'](_0x5792dc,_0x503cff);}),this['listenTo'](this['_aiChatBalloon'],'dialogClosed',(_0x145393,{id:_0xa5bed7})=>{if('aiChatBalloon'!==_0xa5bed7)return;const {replyId:_0x253456,partIndex:_0x57b0fd}=this['_currentPreviewedChangeGroup'];this['_currentPreviewedChangeGroup']=null,this['_aiChatUi']['setFeedItemAIReplySuggestionPartActive']({'id':_0x253456,'index':_0x57b0fd,'isActive':!0x1});})),this['on']('interactionCreated',(_0x3dbde2,_0x4f2819)=>{this['_aiChatUi']['addFeedItemUserMessage'](_0x4f2819);}),this['on']('replyCreated',(_0x6f8390,_0x575444)=>{this['_addFeedItemReply'](_0x575444);});}async['afterInit'](){this['context']instanceof _0xbeb021?this['_integrateEditor'](this['context']):this['listenTo'](this['context']['editors'],'add',(_0x3fecbd,_0x36e368)=>{_0x36e368['on']('ready',()=>{this['_integrateEditor'](_0x36e368);});});const _0x14f603=this['context']['config']['get']('ai.chat.initialConversation');let _0xb891b5=_0x14f603;if('lastCreated'!=_0x14f603||(_0xb891b5=await this['_getLastCreatedConversationId'](),_0xb891b5))return'new'==_0xb891b5?this['_startConversationSafely']():this['loadConversation'](_0xb891b5);}async['destroy'](){return await this['_stopLastInteraction'](),this['_bodyCollection']['detachFromDom'](),super['destroy']();}async['loadConversation'](_0x4dfe95){this['context']['plugins']['has']('AIChatBalloon')&&this['context']['plugins']['get']('AIChatBalloon')['close'](),(this['context']['plugins']['get'](ns)['view']['activateTab']('chat'),this['_aiChatUi']['setFeedItemRenderingStrategy']('static'),this['_aiChatUi']['toggleLoadingSkeleton'](!0x0),await this['_stopLastInteraction']());try{await this['_aiConnector']['fetchConversation'](_0x4dfe95)['getConversation'](),await this['_startConversationSafely'](_0x4dfe95),this['_updateConversationTitle']('\x20'),await this['activeConversation']['load'](_0x4dfe95,this['_aiEditing']['sessionId']),this['activeConversation']['isCurrentDocumentInConversation']()&&this['addCurrentDocumentToChatContext']();}catch(_0x280612){this['_aiChatUi']['addFeedItemError']({'errorMessage':as(this['context']['locale'],'AI_CHAT_UNABLE_TO_LOAD_CONVERSATION'),'id':_0x4dfe95}),this['_logError'](new ot('ai-chat-conversation-not-found',this,{'error':_0x280612}));}finally{this['_aiChatUi']['startAutoScroll'](),this['_aiChatUi']['setFeedItemRenderingStrategy']('streaming'),this['_aiChatUi']['toggleLoadingSkeleton'](!0x1);}}['registerToolDataCallback'](_0x47acd7){let _0x48f044=null,_0x4dcfa7=null;this['on']('toolDataReceived',(_0x123a0d,_0x403d29,_0x49315d)=>{_0x49315d['id']!==_0x48f044&&(_0x48f044=_0x49315d['id'],_0x4dcfa7=this['_getAIChatFeedAPI'](_0x49315d)),_0x47acd7(_0x403d29,_0x4dcfa7);});}['addCurrentDocumentToChatContext'](){this['activeConversation']?.['addCurrentDocumentToContext'](as(this['context']['locale'],'AI_CHAT_CONTEXT_CURRENT_DOCUMENT'));}async['addSelectionToChatContext'](){const _0x28840a=this['_aiEditing']['getSelectionText']();this['activeConversation']?.['addSelectionToContext'](_0x28840a),this['addCurrentDocumentToChatContext']();}['removeSelectionFromChatContext'](){this['activeConversation']?.['removeSelectionFromContext']();}['focusPromptInput'](){this['_aiChatUi']['focusPromptInput']();}async['startConversation'](){await this['_startConversationSafely']();}async['sendMessage'](_0x91c367){await this['_handleUIUserMessage'](_0x91c367);}['getGroupId'](){const _0x520c88=this['context']['config']['get']('collaboration.channelId');if(!_0x520c88)throw new ot('ai-chat-missing-channel-id',this);return _0x520c88;}['_handleRemovedConversation'](_0x332376){this['activeConversation']['id']===_0x332376&&this['_startConversationSafely']();}['_insertSuggestion'](_0x345131){const _0x27f4f9=Fs(this['context']);if(!_0x27f4f9['plugins']['has']('TrackChanges'))throw new ot('ai-no-track-changes',null);const _0x5851f2=this['context']['plugins']['get']('DocumentCompare'),{reply:_0x1c582d,interaction:_0x1d2fbe}=this['getInteractionAndReplyById'](_0x345131['replyId']),_0x324359=this['_getDocumentRangeForReplyChanges'](_0x345131['replyId'],_0x345131['partIndex']),_0x894472=void 0x0!==_0x345131['partIndex']?[_0x1c582d['changeGroups'][_0x345131['partIndex']]]:_0x1c582d['changeGroups']['filter'](_0x387b6c=>'pending'==_0x387b6c['state']),_0x48a0da=_0x894472['map'](_0x2cd0ac=>_0x1c582d['changeGroups']['indexOf'](_0x2cd0ac));if(!_0x324359||'$graveyard'==_0x324359['range']['root']['rootName'])return void _0x48a0da['forEach'](_0x475574=>_0x1c582d['setChangeGroupState'](_0x475574,'outdated'));_0x48a0da['forEach'](_0x100802=>_0x1c582d['setChangeGroupState'](_0x100802,'accepted'));const _0x235596=Ks({'editor':_0x27f4f9,'reply':_0x1c582d,'interaction':_0x1d2fbe,'groups':_0x894472,'transform':!0x0,'documentCompare':_0x5851f2,'documentCompareOptions':{'anchor':'main','markDeletions':!0x0}});let _0x3e5bbc;_0x324359&&this['_scrollToSuggestionRange'](_0x324359['range']),_0x27f4f9['model']['change'](_0x203575=>{_0x3e5bbc=_0x203575['batch'],_0x27f4f9['plugins']['get']('TrackChangesEditing')['_applyOperationsAsSuggestions'](_0x235596),this['_aiEditing']['hideFakeVisualSelection']('change-area');}),this['_batchToChanges']['set'](_0x3e5bbc,{'interactionId':_0x1d2fbe['id'],'replyId':_0x1c582d['id'],'indexes':_0x48a0da['slice']()}),this['_updateRatings'](_0x1c582d);}['_applySuggestion'](_0x406726){const _0x76c04c=Fs(this['context']),_0x1181cb=this['context']['plugins']['get'](_0x4371ca),{reply:_0x533cfa,interaction:_0x56f224}=this['getInteractionAndReplyById'](_0x406726['replyId']),_0x3586cf=this['_getDocumentRangeForReplyChanges'](_0x406726['replyId'],_0x406726['partIndex']),_0x76f16e=void 0x0!==_0x406726['partIndex']?[_0x533cfa['changeGroups'][_0x406726['partIndex']]]:_0x533cfa['changeGroups']['filter'](_0x389308=>'pending'==_0x389308['state']),_0x46486b=_0x76f16e['map'](_0x527d32=>_0x533cfa['changeGroups']['indexOf'](_0x527d32));if(!_0x3586cf||'$graveyard'==_0x3586cf['range']['root']['rootName'])return void _0x46486b['forEach'](_0x3111b0=>_0x533cfa['setChangeGroupState'](_0x3111b0,'outdated'));_0x46486b['forEach'](_0x432ea9=>_0x533cfa['setChangeGroupState'](_0x432ea9,'accepted'));const _0x40abb6=Ks({'editor':_0x76c04c,'reply':_0x533cfa,'interaction':_0x56f224,'groups':_0x76f16e,'transform':!0x0,'documentCompare':_0x1181cb,'documentCompareOptions':{'anchor':'main','markDeletions':!0x1}});let _0x199623;_0x3586cf&&this['_scrollToSuggestionRange'](_0x3586cf['range']),_0x76c04c['model']['change'](_0x3593d3=>{_0x199623=_0x3593d3['batch'];for(const _0x125736 of _0x40abb6)_0x125736['baseVersion']=_0x76c04c['model']['document']['version'],Ws(_0x76c04c,_0x125736),_0x3593d3['batch']['addOperation'](_0x125736),_0x76c04c['model']['applyOperation'](_0x125736);}),this['_batchToChanges']['set'](_0x199623,{'interactionId':_0x56f224['id'],'replyId':_0x533cfa['id'],'indexes':_0x46486b['slice']()}),this['_updateRatings'](_0x533cfa);}['_rejectSuggestion'](_0x53a0d6){const {reply:_0x25d5e5}=this['getInteractionAndReplyById'](_0x53a0d6['replyId']);_0x25d5e5['setChangeGroupState'](_0x53a0d6['partIndex'],'rejected');}['_openBalloonFor'](_0x835a30,_0x5c2d6a){if(!this['_aiChatBalloon'])return;const {reply:_0x265d6f}=this['getInteractionAndReplyById'](_0x835a30),_0x5135be=_0x265d6f['getContentParts']({'showDiff':this['_aiChatBalloonShowDiff']});let _0x5a0f71,_0x21b414;if(void 0x0!==_0x5c2d6a?(_0x21b414=_0x5135be['find'](_0x17ced8=>_0x17ced8['index']==_0x5c2d6a),_0x5a0f71=_0x21b414?.['index']):(_0x21b414=_0x5135be[0x0],_0x5a0f71=_0x21b414['index']),this['_currentPreviewedChangeGroup']?.['replyId']==_0x835a30&&this['_currentPreviewedChangeGroup']?.['partIndex']==_0x5a0f71)return;const _0x30202a=this['_getUserPresentableContentPartDocumentRange'](_0x835a30,_0x265d6f,_0x21b414);if(!_0x30202a)return void this['_aiChatBalloon']['close']();this['_currentPreviewedChangeGroup']={'replyId':_0x835a30,'partIndex':_0x5a0f71},this['_scrollToSuggestionRange'](_0x30202a,!0x0);const _0x1068a7=this['_getPresentableSiblingContentPartIndex'](_0x835a30,_0x5a0f71,'next');this['_aiChatBalloon']['updateContent']({'part':_0x21b414,'renderingStrategy':'static'}),this['_aiChatBalloon']['open']({'index':_0x5a0f71,'title':as(this['context']['locale'],'AI_BALLOON_HEADER_TITLE',(_0x5a0f71+0x1)['toString']()),'showRotator':null!==_0x1068a7,'ranges':[_0x30202a],'areActionsDisabled':_0x265d6f['areActionsDisabled']}),this['_aiChatBalloon']['setState']('pending'),this['_aiChatUi']['scrollFeedToSuggestion'](_0x835a30,_0x5a0f71),this['_aiChatUi']['setFeedItemAIReplySuggestionPartActive']({'id':_0x835a30,'index':_0x5a0f71,'isActive':!0x0});}['_getPresentableSiblingContentPartIndex'](_0x40feeb,_0x2fb82d,_0x5d5dfc){const {reply:_0xfe54dc}=this['getInteractionAndReplyById'](_0x40feeb),_0x4f305f=_0xfe54dc['getContentParts']({'showDiff':this['_aiChatBalloonShowDiff']});if(0x1==_0x4f305f['length'])return null;const _0x36e8ae=_0x4f305f['findIndex'](_0x228498=>_0x228498['index']==_0x2fb82d),_0x1bee61='next'==_0x5d5dfc?0x1:-0x1;let _0x467e36=_0x4f305f['at']((_0x36e8ae+_0x1bee61)%_0x4f305f['length'])['index'],_0x42325d=_0x4f305f[_0x467e36];for(;!this['_getUserPresentableContentPartDocumentRange'](_0x40feeb,_0xfe54dc,_0x42325d);){if(_0x467e36=_0x4f305f['at']((_0x467e36+_0x1bee61)%_0x4f305f['length'])['index'],_0x467e36===_0x36e8ae)return null;_0x42325d=_0x4f305f[_0x467e36];}return _0x467e36;}['_getUserPresentableContentPartDocumentRange'](_0x3b38a6,_0x283a56,_0x2b0c7a){const _0x432628=_0x283a56['changeGroups'];if(!_0x2b0c7a['hasChanges'])return null;const _0x527495=_0x432628['find'](_0x1b2f64=>_0x1b2f64['index']==_0x2b0c7a['index']);if('pending'!==_0x527495?.['state'])return null;const _0x16ef2d=this['_getDocumentRangeForReplyChanges'](_0x3b38a6,_0x2b0c7a['index']);if(!_0x16ef2d)return null;const {range:_0x560dea,currentIndex:_0x3aade6}=_0x16ef2d;return'$graveyard'==_0x560dea['root']['rootName']?(_0x283a56['setChangeGroupState'](_0x3aade6,'outdated'),null):_0x16ef2d['range'];}['_getDocumentRangeForReplyChanges'](_0x2640cd,_0x4e060e){const _0x2ca086=Fs(this['context']),{reply:_0x1cd86b,interaction:_0x2aa78b}=this['getInteractionAndReplyById'](_0x2640cd),_0x118252=_0x1cd86b['changeGroups']['filter'](_0x3fd61b=>'pending'==_0x3fd61b['state']),_0x50dc11=_0x118252['map'](_0x11afd5=>_0x1cd86b['changeGroups']['indexOf'](_0x11afd5));void 0x0===_0x4e060e&&(_0x4e060e=_0x50dc11[0x0]);const _0x4c7db1=_0x50dc11['indexOf'](_0x4e060e);if(-0x1==_0x4c7db1)return null;const _0x4f5e0f=_0x118252[_0x4c7db1],_0x357b63=new _0x352671([]),_0xf4e2be=new _0x352671([]);for(const _0xdc0143 of _0x4f5e0f['changes'])if('removed'!=_0xdc0143['type']&&_0xf4e2be['children']['push'](_0xdc0143['node']['cloneNode'](!0x0)),'new'!=_0xdc0143['type']){const _0x4d75f0=_0x224df2(_0x36b606=>gs(_0x36b606,'data-id')==_0xdc0143['id'],_0x1cd86b['documentContextContent'],!0x0);_0x357b63['children']['push'](_0x4d75f0['cloneNode'](!0x0));}if(0x0==_0x357b63['children']['length']){if(_0x4f5e0f['changes'][0x0]['anchorId']){const _0x359fd2=_s('data-id',_0x4f5e0f['changes'][0x0]['anchorId'],_0x1cd86b['documentContextContent']);_0x357b63['children']['unshift'](_0x359fd2['cloneNode'](!0x0)),_0xf4e2be['children']['unshift'](_0x359fd2['cloneNode'](!0x0)),_0x359fd2['nextSibling']&&(_0x357b63['children']['push'](_0x359fd2['nextSibling']['cloneNode'](!0x0)),_0xf4e2be['children']['push'](_0x359fd2['nextSibling']['cloneNode'](!0x0)));}else{const _0x5ea4ce=_0x1cd86b['documentContextContent']['children'][0x0];if(!_0x5ea4ce)return null;_0x357b63['children']['push'](_0x5ea4ce['cloneNode'](!0x0)),_0xf4e2be['children']['push'](_0x5ea4ce['cloneNode'](!0x0));}}const _0x357eb9=_0x2aa78b['getDocumentContext'](),_0x3626dc=_0x2ca086['data']['parse'](_0x357eb9['content']),_0x307051=ds(_0x357b63),_0x44b80=_0x2ca086['data']['parse'](_0x307051),_0x35af9d=_0x2ca086['data']['parse'](_0x307051),_0x3b7274=_0x2ca086['model']['createPositionAt'](_0x44b80,0x0),_0xf8afbc=ds(_0xf4e2be),_0xd1c247={'anchor':_0x3b7274,'markDeletions':!0x1},_0x22e3f9=_0x2ca086['plugins']['get'](_0x4371ca)['getDiff'](_0x307051,_0xf8afbc,_0xd1c247)['getOperations']();if(!_0x22e3f9['length'])return null;_0x2ca086['model']['change'](_0x36dbdf=>{for(const _0x2bdc41 of _0x22e3f9)if('remove'==_0x2bdc41['type']){const _0x54445a=_0x2bdc41['sourcePosition'],_0x1b3e4c=_0x2bdc41['howMany'],_0x287d3e=new _0x2460c5(_0x54445a,_0x1b3e4c);_0x36dbdf['batch']['addOperation'](_0x287d3e),_0x2ca086['model']['applyOperation'](_0x287d3e);}else'marker'!==_0x2bdc41['type']&&(_0x2bdc41['baseVersion']=null,_0x2bdc41['isDocumentOperation']=!0x1,_0x36dbdf['batch']['addOperation'](_0x2bdc41),_0x2ca086['model']['applyOperation'](_0x2bdc41));});const _0x1eba3b=Rs(_0x2ca086,_0x22e3f9,_0x44b80);Os(_0x2ca086['model'],_0x1eba3b);const _0x2c0952=_0x1eba3b['getFirstRange']()['start']['path']['slice'](),_0x48c4a4=_0x1eba3b['getFirstRange']()['end']['path']['slice'](),_0x42fe8e=[];let _0x11d524=_0x44b80,_0x11aad4=_0x35af9d;for(let _0x10d2c5=0x0;_0x10d2c5<_0x48c4a4['length'];_0x10d2c5++){const _0x2b9b6b=_0x11d524['maxOffset']-_0x48c4a4[_0x10d2c5];_0x42fe8e[_0x10d2c5]=_0x11aad4['maxOffset']-_0x2b9b6b,_0x11d524=_0x11d524['getChildAtOffset'](_0x48c4a4[_0x10d2c5]),_0x11aad4=_0x11aad4['getChildAtOffset'](_0x42fe8e[_0x10d2c5]);}const _0x594d84=_0x2ca086['model']['createRange'](_0x2ca086['model']['createPositionFromPath'](_0x35af9d,_0x2c0952),_0x2ca086['model']['createPositionFromPath'](_0x35af9d,_0x42fe8e)),_0xda4307=_0x35af9d['getChild'](0x0)['getAttribute'](_0x224028),_0x3fb887=Array['from'](_0x3626dc['getChildren']())['find'](_0x47f90d=>_0x47f90d['getAttribute'](_0x224028)==_0xda4307)['getPath'](),_0x492e1c=_0x594d84['start']['path']['slice'](),_0x487c07=_0x594d84['end']['path']['slice']();_0x492e1c[0x0]=_0x3fb887[0x0]+_0x492e1c[0x0],_0x487c07[0x0]=_0x3fb887[0x0]+_0x487c07[0x0];let _0x7b1045=_0x2ca086['model']['createRange'](_0x2ca086['model']['createPositionFromPath'](_0x2ca086['model']['document']['getRoot'](),_0x492e1c),_0x2ca086['model']['createPositionFromPath'](_0x2ca086['model']['document']['getRoot'](),_0x487c07));const _0x58b96a=_0x2ca086['model']['document']['history']['getOperations'](_0x357eb9['version']);for(const _0x2a6a63 of _0x58b96a)_0x7b1045=_0x4ed42b['_createFromRanges'](_0x7b1045['getTransformedByOperation'](_0x2a6a63));return{'range':_0x7b1045,'currentIndex':_0x4e060e};}['_integrateEditor'](_0x3eb8b8){if(_0x3eb8b8['plugins']['has']('Undo')){const _0x407ab1=_0x3eb8b8['commands']['get']('undo'),_0x3e92db=_0x3eb8b8['commands']['get']('redo');this['listenTo'](_0x407ab1,'revert',(_0x472e65,_0x400038,_0x2e33b1)=>{const _0x1b72c5=this['_batchToChanges']['get'](_0x400038);if(!_0x1b72c5)return;const _0x4256d1=this['activeConversation']['getInteraction'](_0x1b72c5['interactionId'])['getReply'](_0x1b72c5['replyId']);_0x1b72c5['indexes']['forEach'](_0xcdd752=>_0x4256d1['setChangeGroupState'](_0xcdd752,'pending')),this['_batchToChanges']['delete'](_0x400038),this['_batchToChanges']['set'](_0x2e33b1,_0x1b72c5);}),this['listenTo'](_0x3e92db,'revert',(_0x404433,_0x4abe47,_0x4a3c6)=>{const _0x2c29ac=this['_batchToChanges']['get'](_0x4abe47);if(!_0x2c29ac)return;const _0x56a085=this['activeConversation']['getInteraction'](_0x2c29ac['interactionId'])['getReply'](_0x2c29ac['replyId']);_0x2c29ac['indexes']['forEach'](_0x163d99=>_0x56a085['setChangeGroupState'](_0x163d99,'accepted')),this['_batchToChanges']['delete'](_0x4abe47),this['_batchToChanges']['set'](_0x4a3c6,_0x2c29ac);});}const _0x174998=_0x3eb8b8['config']['get']('ai.chat.context');_0x174998['alwaysAddSelection']&&_0x174998['document']['enabled']&&this['listenTo'](_0x3eb8b8['model']['document']['selection'],'change:range',(_0x6a70a1,_0x599071)=>{if(!_0x599071['directChange'])return;'chat'===_0x3eb8b8['plugins']['get']('AITabs')['view']['activeTab']&&(_0x3eb8b8['model']['hasContent'](_0x3eb8b8['model']['document']['selection'])?this['addSelectionToChatContext']():this['removeSelectionFromChatContext']());});}async['_getLastCreatedConversationId'](){const _0x214b3b=this['_aiConnector']['fetchConversations'](this['getGroupId'](),{'limit':0x1,'sortBy':'createdAt'});try{const _0xc1a087=await _0x214b3b['getConversations']();return _0xc1a087['length']?_0xc1a087[0x0]['id']:'new';}catch(_0x1e6ba6){return this['_aiChatUi']['addFeedItemError']({'errorMessage':as(this['context']['locale'],'AI_CHAT_UNABLE_TO_LOAD_CONVERSATION'),'id':at()}),this['_logError'](new ot('ai-chat-conversation-init-failed',this,{'error':_0x1e6ba6})),this['_aiChatUi']['toggleLoadingSkeleton'](!0x1),this['_aiChatUi']['disableControls'](),null;}}async['_startConversationSafely'](_0x19ba0e){try{this['_aiChatUi']['enableControls'](),await this['_handleStartConversation'](_0x19ba0e);}catch(_0x160e1e){this['_aiChatUi']['addFeedItemError']({'errorMessage':as(this['context']['locale'],'AI_CHAT_UNABLE_TO_START_CONVERSATION'),'id':_0x19ba0e||at()}),console['error'](_0x160e1e),this['activeConversation']=void 0x0,this['_aiChatUi']['disableControls']();}}async['_handleStartConversation'](_0x137f0d){let _0x2aa141;this['context']['plugins']['has']('AIChatBalloon')&&this['context']['plugins']['get']('AIChatBalloon')['close'](),_0x137f0d||!this['activeConversation']?_0x2aa141=this['context']['config']['get']('ai.models.defaultModelId'):this['_aiChatUi']['isModelAvailable']&&(_0x2aa141=this['activeConversation']['selectedModel']['id']),await this['_stopLastInteraction']();const _0x28e697=this['getGroupId'](),_0x21fc2b=_0x137f0d||at();this['activeConversation']=new Vs({'connector':this['_aiConnector'],'chatModels':this['_aiChatModels'],'selectedModelId':_0x2aa141,'conversationId':_0x21fc2b,'group':_0x28e697,'getEditor':()=>Fs(this['context']),'isFromHistory':!!_0x137f0d}),this['activeConversation']['delegate']('toolDataReceived','interactionCreated','interactionStarted','replyCreated')['to'](this),this['activeConversation']['on']('conversationInitialized',(_0x4acf2f,_0x43dec2)=>{this['_aiChatUi']['createConversation'](_0x43dec2),this['_aiChatUi']['resetMessageInput'](),this['_aiChatUi']['clearPendingContextUI'](),this['_aiChatUi']['clearConversationContextUI'](),_0x137f0d||(this['_aiChatUi']['resetConversationTitle'](),this['addCurrentDocumentToChatContext']());}),this['activeConversation']['on']('uploadProgressChanged',(_0x55d237,_0x3858da)=>{this['_aiChatUi']['setIsUploadInProgress'](_0x3858da['isUploadInProgress']);}),this['activeConversation']['on']('webSearchStarted',()=>{const _0x4caa9e=this['_aiChatUi']['prepareLoadingMessage']({'isWebSearchEnabled':!0x0,'isReasoningEnabled':!0x1});this['_aiChatUi']['setLoadingMessage'](_0x4caa9e);}),this['activeConversation']['on']('reasoningStarted',()=>{const _0x20114a=this['_aiChatUi']['prepareLoadingMessage']({'isWebSearchEnabled':!0x1,'isReasoningEnabled':!0x0});this['_aiChatUi']['setLoadingMessage'](_0x20114a);}),this['activeConversation']['on']('webSearchFinished',(_0x4b296a,_0x461ac5)=>{this['_aiChatUi']['addFeedInteractionHeader'](_0x461ac5,{'isWebSearchEnabled':!0x0,'isReasoningEnabled':!0x1});}),this['activeConversation']['on']('reasoningFinished',(_0x296aba,_0x4e21d7)=>{this['_aiChatUi']['addFeedInteractionHeader'](_0x4e21d7,{'isWebSearchEnabled':!0x1,'isReasoningEnabled':!0x0});}),this['activeConversation']['on']('interactionStarted',()=>{this['_aiChatUi']['startInteraction']();}),this['activeConversation']['on']('interactionFinished',async()=>{await this['_aiChatUi']['finishInteraction']();}),this['activeConversation']['on']('interactionDestroyed',(_0x3e3bb7,_0x50e2df)=>{this['_aiChatUi']['removeFeedInteraction'](_0x50e2df['id']);}),this['activeConversation']['on']('setConversationTitle',(_0x19b8bc,_0x392aef,_0x51eca8)=>{this['_updateConversationTitle'](_0x392aef,_0x51eca8);}),this['activeConversation']['on']('replyContentUpdated',async(_0xbd0bf6,_0x69f3eb)=>{await this['_updateReplyContent']({'reply':_0x69f3eb});}),this['activeConversation']['on']('replyChangeGroupStateUpdated',(_0x22965d,{reply:_0x4a5d44,index:_0x132a2d,state:_0x4da453})=>{this['_aiChatUi']['updateFeedItemAIReplySuggestionPartState']({'id':_0x4a5d44['id'],'index':_0x132a2d,'state':_0x4da453}),this['_currentPreviewedChangeGroup']?.['replyId']['includes'](_0x4a5d44['id'])&&this['_currentPreviewedChangeGroup']?.['partIndex']==_0x132a2d&&this['_aiChatBalloon']?.['setState'](_0x4da453);}),this['activeConversation']['on']('contextItemAdded',(_0x4506c9,_0x3860b2)=>{if(this['_aiChatUi']['addContextItem'](_0x3860b2['contextItem'],_0x3860b2['isLoading']),'selection'===_0x3860b2['contextItem']['type']){const _0x54c553=[...Fs(this['context'])['model']['document']['selection']['getRanges']()];this['_aiEditing']['showFakeVisualSelection']({'ranges':_0x54c553,'id':'context','priority':0x1});}}),this['activeConversation']['on']('contextItemRemoved',(_0x21a76c,_0x290216)=>{this['_aiChatUi']['removeContextItem'](_0x290216['uiId']),'current-document'==_0x290216['uiId']&&this['removeSelectionFromChatContext'](),'selection'===_0x290216['type']&&this['_aiEditing']['hideFakeVisualSelection']('context');}),this['activeConversation']['on']('contextItemLoadingEnded',(_0x28c3bd,_0x3e5ff0)=>{this['_aiChatUi']['setContextItemLoading'](_0x3e5ff0['contextItem']['uiId'],_0x3e5ff0['isLoading']);}),this['activeConversation']['on']('contextSent',(_0x485dde,_0x4854e2)=>{this['_aiChatUi']['setConversationContext'](_0x4854e2['contextItems']);}),this['activeConversation']['on']('addContextOptionsChanged',(_0x1780ab,_0x5e6488)=>{this['_aiChatUi']['setAddContextOptions'](_0x5e6488['options']);}),this['activeConversation']['on']('sourceResourcesLoaded',(_0x40b571,_0x14fd8d)=>{this['_aiChatUi']['populateSourceResourceBalloon'](_0x14fd8d['sourceId'],_0x14fd8d['source'],_0x14fd8d['resources'],_0x14fd8d['uid']);}),this['activeConversation']['on']('resourceStateChanged',(_0x1d572e,_0x2c9b05)=>{this['_aiChatUi']['updateResourceState'](_0x2c9b05['sourceId'],_0x2c9b05['resourceId'],_0x2c9b05['isInContext']);}),this['activeConversation']['on']('capabilitiesUpdated',(_0x649cfb,_0x2f0916)=>{this['_aiChatUi']['updateCapabilities'](_0x2f0916);}),this['activeConversation']['on']('modelSelected',async(_0x1780fa,_0x48f0a1)=>{const _0x53c7ed=(await this['_aiChatModels']['getAll']())['find'](_0x24e665=>_0x24e665['id']===_0x48f0a1['selectedModel']?.['id'])||null;this['_aiChatUi']['setSelectedModel'](_0x53c7ed,_0x48f0a1['isDisabled']);}),this['activeConversation']['on']('error',(_0x19f581,{error:_0x3c308e,interactionId:_0x295126,fileName:_0x2d84ef,url:_0x3fc118,sourceId:_0x4238ee,sourceLabel:_0x312b09})=>{const _0x215378=_0x295126?_0x295126+':'+at():at();_0x3c308e['message']['startsWith']('ai-request-aborted')?this['_aiChatUi']['addFeedItemStaticMessage']({'staticMessage':as(this['context']['locale'],'AI_CHAT_ABORTED_MESSAGE'),'id':_0x215378}):_0x3c308e['message']['startsWith']('ai-chat-conversation-init-failed')||_0x3c308e['message']['startsWith']('ai-chat-conversation-start-failed')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':as(this['context']['locale'],'AI_CHAT_UNABLE_TO_START_CONVERSATION'),'id':_0x215378}),this['_logError'](_0x3c308e)):_0x3c308e['message']['startsWith']('ai-chat-file-upload-failed')?this['_aiChatUi']['addFeedItemError']({'errorMessage':as(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_FILE',_0x2d84ef),'id':_0x215378}):_0x3c308e['message']['startsWith']('ai-chat-url-upload-failed')?this['_aiChatUi']['addFeedItemError']({'errorMessage':as(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_URL',_0x3fc118),'id':_0x215378}):_0x3c308e['message']['startsWith']('ai-chat-context-invalid-data')?this['_aiChatUi']['addFeedItemError']({'errorMessage':as(this['context']['locale'],'AI_CHAT_CONTEXT_INVALID_DATA'),'id':_0x215378}):_0x3c308e['message']['startsWith']('ai-chat-context-unsupported-type')?this['_aiChatUi']['addFeedItemError']({'errorMessage':as(this['context']['locale'],'AI_CHAT_CONTEXT_UNSUPPORTED_TYPE'),'id':_0x215378}):_0x3c308e['message']['startsWith']('ai-chat-source-resources-load-failed')?(_0x4238ee&&this['_aiChatUi']['closeSourceResourceBalloon'](_0x4238ee),this['_aiChatUi']['addFeedItemError']({'errorMessage':as(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_LOAD_RESOURCES',_0x312b09||'source'),'id':_0x215378}),this['_logError'](_0x3c308e)):_0x3c308e['message']['startsWith']('ai-chat-resource-load-failed')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':as(this['context']['locale'],'AI_CHAT_RESOURCE_LOAD_FAILED'),'id':_0x215378}),this['_logError'](_0x3c308e)):_0x3c308e['message']['startsWith']('ai-chat-invalid-request')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':as(this['context']['locale'],'AI_CHAT_INVALID_REQUEST'),'id':_0x215378}),this['_logError'](_0x3c308e)):_0x3c308e['message']['startsWith']('ai-chat-context-unsupported-file-type')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':as(this['context']['locale'],'AI_CHAT_CONTEXT_UNSUPPORTED_FILE_TYPE'),'id':_0x215378}),this['_logError'](_0x3c308e)):_0x3c308e['message']['startsWith']('ai-chat-context-file-too-large')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':as(this['context']['locale'],'AI_CHAT_CONTEXT_FILE_TOO_LARGE'),'id':_0x215378}),this['_logError'](_0x3c308e)):_0x3c308e['message']['startsWith']('ai-chat-context-file-too-many-pages')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':as(this['context']['locale'],'AI_CHAT_CONTEXT_FILE_TOO_MANY_PAGES'),'id':_0x215378}),this['_logError'](_0x3c308e)):_0x3c308e['message']['startsWith']('ai-chat-context-form-data-size-limits-exceeded')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':as(this['context']['locale'],'AI_CHAT_CONTEXT_FORM_DATA_SIZE_LIMITS_EXCEEDED'),'id':_0x215378}),this['_logError'](_0x3c308e)):(this['_aiChatUi']['addFeedItemError']({'errorMessage':as(this['context']['locale'],'AI_CHAT_GENERIC_ERROR'),'id':_0x215378}),this['_logError'](_0x3c308e));}),await this['activeConversation']['init'](this['context']['config']['get']('ai.chat.context')),_0x137f0d||await this['activeConversation']['start']();}async['_handleUIUserMessage']({message:_0x5111d2,attributes:_0x283a90}){if(!this['activeConversation'])throw new ot('ai-chat-controller-no-active-conversation');if(this['activeConversation']['isCurrentDocumentInContext']()){const _0x2dbe10=await this['_aiEditing']['getDocumentData']();await this['activeConversation']['updateCurrentDocumentInContext'](_0x2dbe10);}this['activeConversation']['id']&&this['activeConversation']['isStarted']&&await this['activeConversation']['handleUserInteraction']({'userMessage':_0x5111d2,'attributes':_0x283a90});}['_setIsMaximized'](_0x31d635){this['_aiChatUi']['setIsMaximized'](_0x31d635);}['_logError'](_0x2c3b21){Et(_0x2c3b21['message']);}['_removeFromContext'](_0x5d888b){this['activeConversation']?.['removeFromContext'](_0x5d888b);}['_toggleWebSearch'](){this['activeConversation']?.['toggleWebSearch']();}['_toggleReasoning'](){this['activeConversation']?.['toggleReasoning']();}['getInteractionAndReplyById'](_0x353a90){const [_0x580255,_0x285cd7]=_0x353a90['split'](':'),_0x147f7b=this['activeConversation']['getInteraction'](_0x580255),_0x139604=_0x147f7b['getReply'](_0x285cd7);return{'interaction':_0x147f7b,'reply':_0x139604};}['_scrollToSuggestionRange'](_0x50fbb7,_0x2ed28e=!0x1){const _0x30d08b=Fs(this['context']),_0x479426={'target':_0x30d08b['editing']['view']['domConverter']['viewRangeToDom'](_0x30d08b['editing']['mapper']['toViewRange'](_0x50fbb7)),'viewportOffset':{'top':0x96,'left':0x0,'bottom':0x32,'right':0x0},'ancestorOffset':0x14,'alignToTop':_0x2ed28e};_0x2ed28e&&(_0x479426['alignToTop']=!0x0),mt(_0x479426);}['_updateConversationTitle'](_0xd304e4,_0x126d50=!0x1){this['_aiChatUi']['setConversationTitle'](_0xd304e4||as(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION'),_0x126d50);}['_addFeedItemReply'](_0x59516f){'text'===_0x59516f['type']?this['_aiChatUi']['addFeedItemAIReply'](_0x59516f):this['_aiChatUi']['addFeedItemAISuggestion'](_0x59516f);}async['_updateReplyContent']({reply:_0x44315d,renderingStrategy:_0x235227}){const {id:_0x4eac12,interactionId:_0x30120d,isDone:_0x197fbb,type:_0x5df1ae,parsedContent:_0x3836ef}=_0x44315d,_0x450c42=_0x30120d+':'+_0x4eac12;if('modification'===_0x5df1ae){const _0x16ae15=_0x44315d['getContentParts']({'showDiff':this['_aiChatUi']['showDiff']});await this['_aiChatUi']['updateFeedItemAIReplySuggestionContent']({'id':_0x450c42,'parts':_0x16ae15,'renderingStrategy':_0x235227,'isDone':_0x197fbb});}else'text'===_0x5df1ae&&await this['_aiChatUi']['updateFeedItemAIReplyContent']({'id':_0x450c42,'parsedContent':_0x3836ef,'renderingStrategy':_0x235227,'isDone':_0x197fbb});_0x197fbb&&_0x44315d['sources']['length']>0x0&&this['_aiChatUi']['updateFeedItemAIReplySources'](_0x450c42,_0x44315d['sources']);}async['_stopLastInteraction'](){const _0x5bd9ec=this['activeConversation']?.['lastInteraction'];_0x5bd9ec&&(_0x5bd9ec['stop'](),this['_aiChatUi']['stopInteraction'](_0x5bd9ec));}async['_flushLastInteractionUI'](){const _0x11e4ee=this['activeConversation']?.['lastInteraction'];if(_0x11e4ee){for await(const _0x2633c3 of _0x11e4ee['replies'])this['_aiChatUi']['hasFeedItem'](_0x2633c3['id'])||this['_addFeedItemReply'](_0x2633c3),await this['_updateReplyContent']({'reply':_0x2633c3,'renderingStrategy':'static'});}}['_updateRatings'](_0x4cebee){const _0x41507d={'positiveCount':_0x4cebee['changeGroups']['filter'](_0x61b4ea=>'accepted'===_0x61b4ea['state'])['length'],'totalCount':_0x4cebee['changeGroups']['length'],'modificationId':_0x4cebee['id']},_0x22eeef=this['activeConversation']['getInteraction'](_0x4cebee['interactionId'])['messageId'];_0x22eeef&&this['_aiConnector']['upsertAIChatRating'](this['activeConversation']['id'],_0x22eeef,_0x41507d);}['_getAIChatFeedAPI'](_0x89114e){const _0x2adb5a=this['_aiChatUi'],_0x2d4aa5=()=>{_0x89114e['resetWebSearchState'](),_0x89114e['resetReasoningState'](),_0x2adb5a['clearLoadingMessage']();},_0x2088b6=()=>{_0x89114e['currentReply']&&(_0x89114e['currentReply']['done'](),_0x89114e['currentReply']=void 0x0);};return{'insertTextReply':(_0x5c8aa9,_0x482d56)=>{_0x2088b6(),_0x2d4aa5();const _0x123d1f=_0x89114e['currentReply']=_0x89114e['createReply']({'type':'text','interactionId':_0x89114e['id'],'content':_0x5c8aa9,'id':_0x482d56||at()});return _0x2088b6(),_0x123d1f;},'insertCustomElement':async(_0x395b4c,_0x52963d)=>(_0x2088b6(),_0x2d4aa5(),_0x2adb5a['addFeedItemCustomElement'](_0x395b4c,_0x52963d||at())),'setLoadingMessage':_0xf3d8a8=>{_0x2adb5a['setLoadingMessage'](_0xf3d8a8);},'clearLoadingMessage':()=>{_0x2adb5a['clearLoadingMessage']();}};}}const $s='ai-selection';class qs extends _0x1aa7e1{constructor(_0x1a245f){super(_0x1a245f),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 _0x4f1dd3=Fs(this['context']),_0x54ef00=_0x4f1dd3['plugins']['has']('RealTimeCollaborationClient')&&_0x4f1dd3['plugins']['get']('RealTimeCollaborationClient')['sessionId'];this['_sessionId']=_0x54ef00||at();}return this['_sessionId'];}async['getDocumentData'](){const _0x44caf6=Fs(this['context']),_0x489383=_0x44caf6['model'],_0xebb77f=_0x44caf6['data']['toView'](_0x489383['document']['getRoot'](),{'convertAiChatSelectionMarker':!0x0}),_0x130197=new _0x48b1ff(_0x44caf6['editing']['view']['document']);this['_setDataIdsOnChildren'](_0xebb77f,_0x130197);let _0x2101b4=await this['_getDocumentDataStringFromView'](_0xebb77f);const _0x311d6e=this['_getMarkersInDocumentOrder'](),_0xc754cf=[];for(const _0x37df69 of _0x311d6e){const _0x9787f5='<'+_0x37df69['name']+':start></'+_0x37df69['name']+':start>',_0x1c9918=_0x2101b4['indexOf'](_0x9787f5);_0x2101b4=_0x2101b4['substring'](0x0,_0x1c9918)+_0x2101b4['substring'](_0x1c9918+_0x9787f5['length']);const _0x50ddb2='<'+_0x37df69['name']+':end></'+_0x37df69['name']+':end>',_0x5bc56e=_0x2101b4['indexOf'](_0x50ddb2);_0x2101b4=_0x2101b4['substring'](0x0,_0x5bc56e)+_0x2101b4['substring'](_0x5bc56e+_0x50ddb2['length']),_0xc754cf['push']({'markerName':_0x37df69['name'],'start':_0x1c9918,'end':_0x5bc56e,'htmlFragment':_0x2101b4['substring'](_0x1c9918,_0x5bc56e)});}return{'content':_0x2101b4,'version':_0x44caf6['model']['document']['version'],'sessionId':this['sessionId'],'selections':_0xc754cf};}async['afterInit'](){this['context']instanceof _0xbeb021?this['_integrateEditor'](this['context']):this['listenTo'](this['context']['editors'],'add',(_0x571afc,_0x3fcdd1)=>{_0x3fcdd1['on']('ready',()=>{this['_integrateEditor'](_0x3fcdd1);});});}['_setOutputDataProcessor'](_0x2ae97c){this['_outputDataProcessor']=_0x2ae97c;}async['_getDocumentDataStringFromView'](_0x2370ed){let _0xd33ffd;const _0x2f3a6f=Fs(this['context']);if(this['_outputDataProcessor']){const _0x5c78a3=_0x2f3a6f['data']['processor']['domConverter']['viewToDom'](_0x2370ed),_0x305d74=await this['_outputDataProcessor'](_0x5c78a3);_0xd33ffd=_0x2f3a6f['data']['processor']['htmlWriter']['getHtml'](_0x305d74);}else _0xd33ffd=_0x2f3a6f['data']['processor']['toData'](_0x2370ed);return _0xd33ffd;}['_integrateEditor'](_0x2615ac){_0x2615ac['conversion']['for']('editingDowncast')['markerToHighlight']({'model':$s,'view':({markerName:_0xf48e65})=>({'classes':['ck-ai-assistant-ui_theme','ck-fake-ai-selection','ck-fake-ai-selection-'+_0xf48e65['split'](':')[0x1]],'priority':0xc})}),_0x2615ac['conversion']['for']('dataDowncast')['markerToElement']({'model':$s,'view':(_0x330e50,{writer:_0x2b40fa,options:_0xe4a1df})=>_0xe4a1df['convertAiChatSelectionMarker']?_0x2b40fa['createUIElement'](_0x330e50['markerName']+':'+(_0x330e50['isOpening']?'start':'end')):null});}['showFakeVisualSelection'](_0x4a7ecd){const _0x32fcf6=this['_fakeSelections'][0x0]||null;this['_addFakeSelection'](_0x4a7ecd);const _0xe8bf3a=this['_fakeSelections'][0x0]||null;this['_refreshFakeSelection'](_0x32fcf6,_0xe8bf3a);}['hideFakeVisualSelection'](_0x1a2c05){const _0x596a82=this['_fakeSelections'][0x0]||null;this['_removeFakeSelectionById'](_0x1a2c05);const _0xb8eaad=this['_fakeSelections'][0x0]||null;this['_refreshFakeSelection'](_0x596a82,_0xb8eaad);}async['modelToDataWithIds'](_0x1d29bc){const _0x1fa885=Fs(this['context']),_0x16d1d5=_0x1fa885['data']['toView'](_0x1d29bc),_0x1301d8=new _0x48b1ff(_0x1fa885['editing']['view']['document']);return this['_setDataIdsOnChildren'](_0x16d1d5,_0x1301d8),this['_getDocumentDataStringFromView'](_0x16d1d5);}['_setDataIdsOnChildren'](_0x366e40,_0x146431){let _0x8a1ed8=!0x1;const _0x31557c=new Set();for(const _0x3f6d58 of _0x366e40['getChildren']()){if(!_0x3f6d58['is']('view:element'))continue;const _0x5633c2=_0x3f6d58['is']('view:containerElement'),_0x218b9e=_0x3f6d58['is']('view:emptyElement'),_0x29d63a=this['_setDataIdsOnChildren'](_0x3f6d58,_0x146431);if(_0x3f6d58['hasAttribute']('data-id')){_0x8a1ed8=!0x0,_0x31557c['add'](_0x3f6d58['getAttribute']('data-id'));continue;}(_0x5633c2||_0x218b9e||_0x29d63a)&&(_0x146431['setAttribute']('data-id',this['_nextDataId'](_0x31557c),_0x3f6d58),_0x8a1ed8=!0x0);}return _0x8a1ed8;}['_nextDataId'](_0x45aaf7){let _0xa42dc9;do{_0xa42dc9='';for(let _0x1672b4=0x0;_0x1672b4<0x4;_0x1672b4++)_0xa42dc9+=String['fromCharCode'](0x61+Math['floor'](0x1a*Math['random']()));}while(_0x45aaf7['has'](_0xa42dc9));return _0x45aaf7['add'](_0xa42dc9),_0xa42dc9;}['getSelectionText'](){const {model:_0x2d17aa}=Fs(this['context']),_0x2b8503=_0x2d17aa['document']['selection'],_0xa3aca8=[],_0x3cdf9e=Array['from'](_0x2b8503['getRanges']());_0x3cdf9e['sort']((_0x54168e,_0x220510)=>_0x54168e['start']['isBefore'](_0x220510['start'])?-0x1:0x1);for(const _0x3da041 of _0x3cdf9e)for(const _0x1d694e of _0x3da041['getItems']())_0x1d694e['is']('$textProxy')?_0xa3aca8['push'](_0x1d694e['data']):_0x1d694e['is']('element')&&_0xa3aca8['length']>0x0&&'\x20'!==_0xa3aca8[_0xa3aca8['length']-0x1]&&_0xa3aca8['push']('\x20');return _0xa3aca8['length']?'\x22'+_0xa3aca8['join']('')['trim']()+'\x22':as(this['context']['locale'],'AI_CHAT_CONTEXT_DOCUMENT_SELECTION_LABEL');}['_removeFakeSelectionById'](_0x70b22f){for(let _0x50b33e=0x0;_0x50b33e<this['_fakeSelections']['length'];_0x50b33e++)if(this['_fakeSelections'][_0x50b33e]['id']==_0x70b22f)return void this['_fakeSelections']['splice'](_0x50b33e,0x1);}['_addFakeSelection'](_0x51bd35){this['_removeFakeSelectionById'](_0x51bd35['id']),Ct(this['_fakeSelections'],_0x51bd35);}['_refreshFakeSelection'](_0x3c64e0,_0x12f4ff){if(_0x3c64e0==_0x12f4ff)return;const _0x5249a6=Fs(this['context']),_0x3578d5=_0x5249a6['model'];_0x3578d5['change'](_0x198c89=>{if(_0x3c64e0){const _0x1ab817=_0x5249a6['model']['markers']['getMarkersGroup']($s);for(const _0xdf90f5 of _0x1ab817)_0x198c89['removeMarker'](_0xdf90f5);}if(_0x12f4ff)for(let _0x229c5d=0x0;_0x229c5d<_0x12f4ff['ranges']['length'];_0x229c5d++){let _0x270f78=_0x12f4ff['ranges'][_0x229c5d];const _0x5f28e3=$s+':'+_0x12f4ff['id']+':'+_0x229c5d;if(_0x270f78['start']['isAtEnd']){const _0x215da3=_0x270f78['start']['getLastMatchingPosition'](({item:_0x5d595d})=>!_0x3578d5['schema']['isContent'](_0x5d595d),{'boundaries':_0x270f78});_0x270f78=_0x198c89['createRange'](_0x215da3,_0x270f78['end']);}_0x198c89['addMarker'](_0x5f28e3,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x270f78});}});}['_getMarkersInDocumentOrder'](){const _0x386906=Fs(this['context'])['model'];return Array['from'](_0x386906['markers']['getMarkersGroup']($s))['sort']((_0x5caa74,_0x3a357e)=>_0x5caa74['getStart']()['isBefore'](_0x3a357e['getStart']())?-0x1:_0x5caa74['getStart']()['isAfter'](_0x3a357e['getStart']())?0x1:0x0);}}const Qs=['showChangeInText','insertSuggestion','applySuggestion','rejectSuggestion','mouseOverSuggestion','mouseLeaveSuggestion','toggleSuggestionDisplayMode','like','dislike'],Xs=[...Qs,'startConversation','resizeTabs','sendUserMessage','abortPromptStream','addDocumentToContext','addFileToContext','addUrlToContext','executeCustomItemCallback','addResourceToContext','removeContextItem','loadSourceResources','toggleWebSearch','toggleReasoning','selectModel'];class zs{['options'];['isStreaming']=!0x1;['document']=null;['nodesList']=[];['currentIndex']=0x0;['timeoutAbortController']=null;['lastUpdateTime']=0x0;constructor(_0x242538){this['options']={'delay':_0x242538['delay']??0x14,'textNodeStyle':_0x242538['textNodeStyle'],'onStreamUpdate':_0x242538['onStreamUpdate']||(()=>{})};}async['stream']({document:_0x4eb229,targetElement:_0x501d90,abortSignal:_0x497b61}){this['isStreaming']&&this['stop'](),_0x497b61?.['addEventListener']('abort',this['stop']['bind'](this)),this['document']=_0x41ade9(_0x4eb229,!0x0),this['nodesList']=this['getParsedDocumentNodeList'](),this['isStreaming']=!0x0,this['currentIndex']>this['nodesList']['length']&&(this['currentIndex']=this['nodesList']['length']);for(let _0x4021dc=0x0;_0x4021dc<this['currentIndex'];_0x4021dc++)this['nodesList'][_0x4021dc]['shouldBeStreamed']=!0x0;do{const _0x448f2b=Date['now'](),_0x576d66=this['nodesList'][this['currentIndex']],_0x3ae63b=_0x448f2b-this['lastUpdateTime'];if(_0x576d66){_0x576d66['shouldBeStreamed']=!0x0;let _0x453479=_0x576d66['parent'];for(;_0x453479;)_0x453479['shouldBeStreamed']=!0x0,_0x453479=_0x453479['parent'];}if(_0x3ae63b<this['options']['delay'])try{const {promise:_0x53726d,abortController:_0x3d6f04}=tn(this['options']['delay']-_0x3ae63b);this['timeoutAbortController']=_0x3d6f04,await _0x53726d;}catch(_0x2fdac5){return;}_0x59e06d(_0x501d90,'<'+_0x501d90['tagName']+'>'+this['renderNode'](this['document'])+'</'+_0x501d90['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:_0x47c055}){Array['from'](_0x47c055['querySelectorAll']('span[data-ck-html-streamer-word-chunk]'))['reverse']()['forEach'](_0x2174c0=>{_0x2174c0['replaceWith'](_0x2174c0['childNodes'][0x0]);});}['stop'](){this['isStreaming']=!0x1,this['timeoutAbortController']&&(this['timeoutAbortController']['abort'](),this['timeoutAbortController']=null);}['renderNode'](_0x415220){let _0x1481db='';if(function(_0x4457a5){return _0x58c192(_0x4457a5);}(_0x415220)){for(const _0x2fc1ab of _0x415220['children'])_0x1481db+=this['renderNode'](_0x2fc1ab);}else{if(Zs(_0x415220)){if(!_0x415220['shouldBeStreamed'])return'';const _0x379f13=_0x415220,_0x418efa=Object['entries'](_0x379f13['attribs'])['map'](([_0x4672c1,_0x158d04])=>_0x4672c1+'=\x22'+_0x158d04+'\x22')['join']('\x20');_0x1481db+='<'+_0x379f13['tagName']+(_0x418efa?'\x20'+_0x418efa:'')+'>';for(const _0x3b01af of _0x41c205(_0x379f13))_0x1481db+=this['renderNode'](_0x3b01af);_0x1481db+='</'+_0x379f13['tagName']+'>';}else{if(!Js(_0x415220))return'';if(!_0x415220['shouldBeStreamed'])return'';!function(_0x315de9){if(!_0x315de9['parent']||!Zs(_0x315de9['parent']))return!0x1;if(!js['includes'](_0x315de9['parent']['tagName']))return!0x1;return!_0x557d5d(_0x315de9)['match'](/^\s*[<>]\s*$/);}(_0x415220)?_0x1481db+=_0xc041c1(_0x415220):_0x1481db+=_0xc041c1(new ti('span',{'data-ck-html-streamer-word-chunk':'','style':this['options']['textNodeStyle']},[_0x415220]));}}return _0x1481db;}['getParsedDocumentNodeList'](){const _0x484a2c=[];return function(_0x17edee,_0x194ba4){const _0xed435=_0x3d2bb8=>{if(_0x194ba4(_0x3d2bb8),_0x3d2bb8 instanceof _0x176e86)for(let _0x3ce60d=0x0;_0x3ce60d<_0x3d2bb8['children']['length'];_0x3ce60d++){const _0xd2a01f=_0x3d2bb8['children'][_0x3ce60d];_0xed435(_0xd2a01f);}};for(let _0x2a6884=0x0;_0x2a6884<_0x17edee['children']['length'];_0x2a6884++)_0xed435(_0x17edee['children'][_0x2a6884]);}(this['document'],_0x4266e2=>{if(Js(_0x4266e2)){const _0x5eab62=this['splitTextNodeIntoWordNodes'](_0x4266e2);_0x5eab62['length']&&_0x484a2c['push'](..._0x5eab62);}_0x4266e2['isWordSplitSource']||_0x4266e2['isWordSplitResult']||_0x484a2c['push'](_0x4266e2);}),_0x484a2c;}['splitTextNodeIntoWordNodes'](_0x343e87){if(_0x343e87['isWordSplitSource']||_0x343e87['isWordSplitResult'])return[];const _0x2f74b6=_0x557d5d(_0x343e87)['match'](/(?:\s*\S+\s*)/g),_0x5057ec=[];if(_0x2f74b6&&_0x2f74b6['length']>0x1){for(const _0x2a476f of _0x2f74b6){const _0x1bb7c5=new _0x366237(_0x2a476f);_0x1bb7c5['isWordSplitResult']=!0x0,_0x36875f(_0x343e87,_0x1bb7c5),_0x5057ec['push'](_0x1bb7c5);}_0x343e87['isWordSplitSource']=!0x0,_0x3723d6(_0x343e87);}return _0x5057ec;}}const js=['p','li','td','th','span','h1','h2','h3','h4','h5','h6','b','strong','i','em','mark','del','ins','sup','sub','a','code','div'];function Js(_0x3f173f){return _0x24200d(_0x3f173f);}function Zs(_0x4d05f4){return _0x16a47d(_0x4d05f4);}function tn(_0xf1d8da){const _0x312b02=new AbortController();return{'promise':new Promise((_0x1ef2dc,_0x5558fc)=>{const _0x58a67e=setTimeout(_0x1ef2dc,_0xf1d8da);_0x312b02['signal']['addEventListener']('abort',()=>{clearTimeout(_0x58a67e),_0x5558fc();});}),'abortController':_0x312b02};}class en extends Nt{['options'];['content']='';['htmlStreamer'];['children'];constructor(_0x112913){super();const _0xb9bd7d=this['bindTemplate'];this['set']('isDone',!0x1),this['set']('isVisible',!0x0),this['htmlStreamer']=new zs({'textNodeStyle':'animation:\x20ck-html-streamer-fade-in\x20.5s','delay':0x14}),this['options']=_0x112913,this['children']=this['createCollection'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__item',_0xb9bd7d['if']('isDone','ck-ai-chat__feed__item_done'),_0xb9bd7d['if']('isVisible','ck-hidden',_0x2fc1a1=>!_0x2fc1a1),'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'](_0x24d627=>{_0x24d627['removeAttribute']('data-id');}),this['isDone']=!0x0;}async['streamIntoElement'](_0x1d85ad,_0x4723bd,_0x16b144){await this['htmlStreamer']['stream']({'document':_0x1d85ad,'targetElement':_0x4723bd,'abortSignal':_0x16b144});}}class sn extends Nt{['showChangesToggleView'];constructor(_0x1674aa,_0x999faf){super(_0x1674aa),this['set']('isShowChangesToggleVisible',!0x0),this['showChangesToggleView']=new nn(_0x1674aa),this['showChangesToggleView']['set']({'class':'ck-ai-suggestion__header__show-changes-toggle\x20ck-ai-chat-controls-button\x20'+cs,'label':as(_0x1674aa,'AI_SUGGESTION_BUTTON_SHOW_CHANGES'),'withText':!0x0}),this['showChangesToggleView']['isOn']=_0x999faf['showDiff'],this['showChangesToggleView']['bind']('isVisible')['to'](this,'isShowChangesToggleVisible'),this['showChangesToggleView']['bind']('icon')['to'](this['showChangesToggleView'],'isOn',_0x2ef09c=>_0x2ef09c?_0x381746:_0x40fc31),this['showChangesToggleView']['on']('execute',()=>{this['showChangesToggleView']['isOn']=!this['showChangesToggleView']['isOn'],this['fire']('toggleShowChanges',{'isOn':this['showChangesToggleView']['isOn']});});const _0x2eb198=new yt();_0x2eb198['content']=_0x4dad6b,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__header',!0x1===_0x999faf['showHeader']?'ck-hidden':null]['filter'](Boolean)},'children':[_0x2eb198,{'tag':'span','children':[as(_0x1674aa,'AI_SUGGESTION_HEADER_TITLE')]},this['showChangesToggleView']]});}}class nn extends kt{['render'](){super['render'](),this['children']['remove'](this['iconView']),this['children']['add'](this['iconView']);}}const rn={'accepted':_0x32b9f4,'rejected':_0x1c22f1,'outdated':_0x1c22f1};class an extends Nt{['stateIconView'];constructor(_0x482756){super(_0x482756);const _0x3ae02c=this['bindTemplate'];this['set']('state','accepted'),this['set']('isVisible',!0x0),this['stateIconView']=new on(),this['stateIconView']['bind']('state')['to'](this),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__content-part-state',_0x3ae02c['to']('state',_0x586544=>'ck-ai-suggestion__content-part-state_'+_0x586544),_0x3ae02c['if']('isVisible','ck-hidden',_0x5c08b0=>!_0x5c08b0)]},'children':[{'tag':'span','attributes':{'class':['ck-ai-suggestion__content-part-state__label']},'children':[{'text':_0x3ae02c['to']('state',_0x128e56=>{switch(_0x128e56){case'accepted':return as(_0x482756,'AI_SUGGESTION_CONTENT_PART_STATE_ACCEPTED');case'rejected':return as(_0x482756,'AI_SUGGESTION_CONTENT_PART_STATE_REJECTED');case'outdated':return as(_0x482756,'AI_SUGGESTION_CONTENT_PART_STATE_OUTDATED');}})}]},this['stateIconView']]});}['setState'](_0x2d3002){this['state']=_0x2d3002;}}class on extends yt{constructor(){super(),this['set']('state','accepted'),this['content']=rn[this['state']],this['on']('change:state',()=>{this['content']=rn[this['state']];});}}class hn extends Ot{['_applyButton'];['_suggestButton'];constructor(_0x150aca,_0xa871e5,_0x1777a5){super(_0x150aca);const _0x538e95=Boolean(_0x1777a5);this['set']('isEnabled',!_0x538e95),this['set']('isVisible',!0x0),this['class']='ck-ai-suggestion-content-part-toolbar';const _0x379039=[];if(_0x538e95){const _0x1a78f8=new kt(_0x150aca);_0x1a78f8['set']({'label':as(_0x150aca,'AI_SUGGESTION_DISABLED_TOOLTIP_MESSAGE'),'tooltip':!0x0,'withText':!0x1,'icon':_0x5689fd}),_0x1a78f8['extendTemplate']({'attributes':{'data-cke-tooltip-class':'ck-ai-suggestion-content-part-disabled-actions-tooltip'}}),_0x379039['push'](_0x1a78f8);}else{_0xa871e5['includes']('applySuggestion')&&(this['_applyButton']=new kt(_0x150aca),this['_applyButton']['set']({'label':as(_0x150aca,'AI_SUGGESTION_CONTENT_PART_APPLY'),'tooltip':!0x0,'tooltipPosition':'n','withText':!0x1,'icon':_0x32b9f4}),this['_applyButton']['bind']('isEnabled')['to'](this),this['_applyButton']['on']('execute',()=>{this['fire']('applySuggestion');}),_0x379039['push'](this['_applyButton'])),_0xa871e5['includes']('insertSuggestion')&&(this['_suggestButton']=new kt(_0x150aca),this['_suggestButton']['set']({'label':as(_0x150aca,'AI_SUGGESTION_CONTENT_PART_ADD_SUGGESTION'),'tooltip':!0x0,'tooltipPosition':'n','withText':!0x1,'icon':_0x397e2a}),this['_suggestButton']['bind']('isEnabled')['to'](this),this['_suggestButton']['on']('execute',()=>{this['fire']('insertSuggestion');}),_0x379039['push'](this['_suggestButton']));const _0x1ef855=new kt(_0x150aca);_0x1ef855['set']({'label':as(_0x150aca,'AI_SUGGESTION_CONTENT_PART_REJECT'),'tooltip':!0x0,'tooltipPosition':'n','withText':!0x1,'icon':_0x1c22f1}),_0x1ef855['bind']('isEnabled')['to'](this),_0x1ef855['on']('execute',()=>{this['fire']('rejectSuggestion');}),_0x379039['push'](_0x1ef855);}this['items']['addMany'](_0x379039);const _0x444bdd=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':[_0x444bdd['if']('isVisible','ck-hidden',_0x368d03=>!_0x368d03)]}});}['setButtonsVisibility']({showApplyButton:_0x407569,showSuggestButton:_0x1c97c7}){this['_applyButton']&&(this['_applyButton']['isVisible']=_0x407569),this['_suggestButton']&&(this['_suggestButton']['isVisible']=_0x1c97c7);}}class cn extends Nt{['toolbarView'];['stateView'];['titleLabelView'];['children'];constructor(_0x23a55b,{part:_0x1245f9,uiIndex:_0x5e384a,availableActions:_0x977cb1,areActionsDisabled:_0x2dd495}){super(_0x23a55b),this['set']('isEnabled',!0x0),this['set']('state','pending'),this['toolbarView']=new hn(_0x23a55b,_0x977cb1,_0x2dd495),this['toolbarView']['on']('rejectSuggestion',()=>{this['fire']('rejectSuggestion',{'index':_0x1245f9['index']});}),this['toolbarView']['on']('insertSuggestion',()=>{this['fire']('insertSuggestion',{'index':_0x1245f9['index']});}),this['toolbarView']['on']('applySuggestion',()=>{this['fire']('applySuggestion',{'index':_0x1245f9['index']});}),this['toolbarView']['bind']('isEnabled')['to'](this),this['stateView']=new an(_0x23a55b),this['titleLabelView']=new ln(_0x23a55b,_0x5e384a),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',(_0x37fe12,_0x141783,_0x13b6fb,_0x332420)=>{'pending'===_0x332420?this['children']['remove'](this['toolbarView']):this['children']['remove'](this['stateView']),'pending'===_0x13b6fb?this['children']['add'](this['toolbarView']):(this['stateView']['setState'](_0x13b6fb),this['children']['add'](this['stateView']));});}}class ln extends Nt{constructor(_0x415de5,_0x286fe2){super(_0x415de5),this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-suggestion__body__content-part__title__label']},'children':[as(_0x415de5,'AI_SUGGESTION_CONTENT_PART_TITLE',_0x286fe2['toString']())]});}}class un extends Nt{['htmlStreamer'];constructor(_0x383db2){super(_0x383db2),this['htmlStreamer']=new zs({'textNodeStyle':'animation:\x20ck-html-streamer-fade-in\x20.5s','delay':0x14}),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content','ck-reset_all-excluded','ck-ai-suggestion-streamable-content']}});}async['update']({part:_0x5c8366,renderingStrategy:_0x4ce614,abortSignal:_0x21378a}){'streaming'===_0x4ce614?await this['htmlStreamer']['stream']({'document':_0x5c8366['content'],'targetElement':this['element'],'abortSignal':_0x21378a}):this['element']['innerHTML']=ds(_0x5c8366['content']);}['clear'](){this['htmlStreamer']['reset'](),this['element']['innerHTML']='';}}class dn extends Nt{['_children'];['_headerView'];['_streamableContentView'];constructor(_0x4133af,{part:_0x419766,uiIndex:_0x3b0fe0,areActionsDisabled:_0x51d57a,availableActions:_0x2a4b0e}){super(_0x4133af);const _0x370941=this['bindTemplate'];this['set']('state','pending'),this['set']('isDone',!0x1),this['set']('isVisible',!0x1),this['set']('isActive',!0x1),this['set']('isEnabled',!0x1);const _0x374f24=()=>{this['isEnabled']=this['isDone']&&'pending'==this['state']&&!_0x51d57a;};this['on']('change:state',_0x374f24),this['on']('change:isDone',_0x374f24),_0x374f24(),this['_children']=this['createCollection'](),this['_headerView']=new cn(_0x4133af,{'part':_0x419766,'uiIndex':_0x3b0fe0,'availableActions':_0x2a4b0e,'areActionsDisabled':_0x51d57a}),this['_headerView']['bind']('isEnabled','state')['to'](this),this['_headerView']['delegate'](...Qs)['to'](this),this['_streamableContentView']=new un(_0x4133af),this['_children']['addMany']([this['_headerView'],this['_streamableContentView']]),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__body__content-part',_0x370941['to']('state',_0x12f59a=>'ck-ai-suggestion__body__content-part_'+_0x12f59a),_0x370941['if']('isEnabled','ck-ai-suggestion__body__content-part_enabled'),_0x370941['if']('isActive','ck-ai-suggestion__body__content-part_active'),_0x370941['if']('isVisible','ck-hidden',_0x61fc22=>!_0x61fc22)]},'children':this['_children'],'on':{'mouseenter':_0x370941['to'](()=>{this['isEnabled']&&this['fire']('mouseOverSuggestion',{'index':_0x419766['index']});}),'mouseleave':_0x370941['to'](()=>{this['isEnabled']&&this['fire']('mouseLeaveSuggestion',{'index':_0x419766['index']});}),'click':_0x370941['to'](_0x4592bc=>{const _0x38e4f5=_0x4592bc['target'];this['isEnabled']&&!this['_headerView']['toolbarView']['element']['contains'](_0x38e4f5)&&this['fire']('showChangeInText',{'index':_0x419766['index']});})}});}async['updateContent']({part:_0x2216aa,renderingStrategy:_0x19c457,showUnchangedParts:_0x1582fe=!0x1,abortSignal:_0x353175}){this['partDefinition']=_0x2216aa,this['isVisible']=this['partDefinition']['hasChanges']||_0x1582fe,this['isVisible']&&await this['_streamableContentView']['update']({'part':_0x2216aa,'renderingStrategy':_0x19c457,'abortSignal':_0x353175});}['markAsDone'](){this['isDone']=!0x0;}}class _n extends pt(){['queue']=[];['isProcessing']=!0x1;['_abortController'];async['enqueue'](_0x1aaf5d){const _0x4a4f6b=this['createTask'](_0x1aaf5d);return this['queue']['push'](_0x4a4f6b),this['_processQueue'](),_0x4a4f6b['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(_0x1a1bd6=>{this['once']('_queueEmpty',()=>{_0x1a1bd6();});}):Promise['resolve']();}async['_processQueue'](){if(!this['isProcessing']){this['_abortController']=new AbortController(),this['isProcessing']=!0x0;try{for(;this['queue']['length']&&this['isProcessing'];){const _0x5a46d5=this['queue']['shift']();try{await _0x5a46d5['callback'](this['_abortController']['signal']),_0x5a46d5['resolve']();}catch(_0x40f193){_0x5a46d5['reject'](_0x40f193);}}}finally{this['isProcessing']=!0x1,this['_abortController']=void 0x0;}this['fire']('_queueEmpty');}}['createTask'](_0x37d225){let _0x11b56,_0x14a833;const _0xc17517=new Promise((_0x3822be,_0x4c33a0)=>{_0x11b56=_0x3822be,_0x14a833=_0x4c33a0;});return{'callback':_0x37d225,'resolve':_0x11b56,'reject':_0x14a833,'completePromise':_0xc17517};}}class An extends en{constructor(_0x55d623){super(_0x55d623),this['extendTemplate']({'attributes':{'class':['ck-ai-notification','warning'===_0x55d623['level']?'ck-ai-notification_warning':'ck-ai-notification_error']}});}['render'](){super['render'](),this['setContent'](this['options']['initialContent']),this['markAsDone']();}['setContent'](_0x4a5540){this['element']['innerHTML']=_0x4a5540;}}const gn=['applySuggestion','insertSuggestion'];class In extends Nt{['_applyChangesButton'];['_insertSuggestionsButton'];['children'];constructor(_0x65686b,_0x528d5c=[...gn],_0x25b527){super(_0x65686b);const _0x4bb6eb=this['bindTemplate'],_0x2b3136=Boolean(_0x25b527);if(this['set']('isEnabled',!_0x2b3136),this['set']('isVisible',!0x1),this['set']('isTrackChangesOn',!0x1),this['children']=this['createCollection'](),_0x2b3136){const _0x1e9735=new kt(_0x65686b);_0x1e9735['set']({'label':as(_0x65686b,'AI_SUGGESTION_DISABLED_TOOLTIP_MESSAGE'),'tooltip':!0x0,'withText':!0x1,'icon':_0x5689fd}),_0x1e9735['extendTemplate']({'attributes':{'data-cke-tooltip-class':'ck-ai-suggestion-content-part-disabled-actions-tooltip'}});const _0x4fedfa=new Nt(_0x65686b);_0x4fedfa['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-chat__feed__suggestion__actions__info'},'children':[{'tag':'p','children':[as(_0x65686b,'AI_SUGGESTION_DISABLED_FEED_MESSAGE'),_0x1e9735]}]}),this['children']['add'](_0x4fedfa);}else this['_applyChangesButton']=new kt(_0x65686b),this['_applyChangesButton']['set']({'label':as(_0x65686b,'AI_CHAT_SUGGESTION_ACTION_APPLY_ALL'),'withText':!0x0,'type':'button','isVisible':_0x528d5c['includes']('applySuggestion'),'class':os}),this['_insertSuggestionsButton']=new kt(_0x65686b),this['_insertSuggestionsButton']['set']({'label':as(_0x65686b,'AI_CHAT_SUGGESTION_ACTION_SUGGEST_ALL'),'withText':!0x0,'type':'button','isVisible':_0x528d5c['includes']('insertSuggestion'),'class':hs}),this['_insertSuggestionsButton']['on']('execute',()=>{this['fire']('insertSuggestion');}),this['_applyChangesButton']['on']('execute',()=>{this['fire']('applySuggestion');}),[this['_applyChangesButton'],this['_insertSuggestionsButton']]['forEach'](_0x27dee2=>{_0x27dee2['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',_0x4bb6eb['if']('isVisible','ck-hidden',_0x5efe7b=>!_0x5efe7b)]},'children':this['children']}),this['on']('change:isTrackChangesOn',()=>{this['_applyChangesButton']&&(this['_applyChangesButton']['isVisible']=!this['isTrackChangesOn']);});}['updateVisibility'](_0x6d043f){this['isVisible']=_0x6d043f;}['_switchButtonLabelsPlurality'](_0x2b0292){this['_applyChangesButton']&&this['_insertSuggestionsButton']&&(_0x2b0292?(this['_applyChangesButton']['label']=as(this['locale'],'AI_CHAT_SUGGESTION_ACTION_APPLY_ALL'),this['_insertSuggestionsButton']['label']=as(this['locale'],'AI_CHAT_SUGGESTION_ACTION_SUGGEST_ALL')):(this['_applyChangesButton']['label']=as(this['locale'],'AI_CHAT_SUGGESTION_ACTION_APPLY'),this['_insertSuggestionsButton']['label']=as(this['locale'],'AI_CHAT_SUGGESTION_ACTION_SUGGEST')));}}class En extends Nt{['children'];['balloonPanelView'];['bodyCollection'];constructor(_0x12e883,_0x564da2){super(_0x12e883),this['bodyCollection']=_0x564da2,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',_0x5d1e39=>!_0x5d1e39)]},'children':this['children']});const _0x45e152=new Nt(this['locale']),_0x3241b4=new yt();_0x3241b4['content']=_0x12d01f,_0x45e152['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-web-sources__header']},'children':[_0x3241b4,{'tag':'span','children':[{'text':as(this['locale'],'AI_CHAT_SOURCES_HEADER')}]}]}),this['children']['add'](_0x45e152),this['_setupBalloonPanel'](_0x12e883);}['addSource'](_0xa29d84){this['children']['add'](new Tn(this['locale'],_0xa29d84,this['balloonPanelView']));}['_setupBalloonPanel'](_0x3f07ba){this['balloonPanelView']=new Qt(_0x3f07ba),this['balloonPanelView']['extendTemplate']({'attributes':{'class':['ck-ai-web-source__tooltip-balloon']}}),this['bodyCollection']['add'](this['balloonPanelView']);}}class Tn extends kt{['balloonPanelView'];['source'];constructor(_0x49b29f,_0x17d3cd,_0x297c50){super(_0x49b29f),this['source']=_0x17d3cd,this['balloonPanelView']=_0x297c50,this['set']({'label':_0x17d3cd['title'],'class':['ck\x20ck-ai-web-source'],'withText':!0x0});const _0x5674a0=this['bindTemplate'];if(this['extendTemplate']({'on':{'click':_0x5674a0['to'](()=>{window['open'](_0x17d3cd['url'],'_blank');}),'mouseenter':_0x5674a0['to'](()=>{this['_showTooltip']();}),'mouseleave':_0x5674a0['to'](()=>{this['_hideTooltip']();})}}),_0x17d3cd['favicon']){const _0xa7d2f1=new Nt(_0x49b29f);_0xa7d2f1['setTemplate']({'tag':'img','attributes':{'src':_0x17d3cd['favicon']||_0x12d01f,'alt':_0x17d3cd['title'],'class':['ck-ai-web-source__image']}}),this['children']['add'](_0xa7d2f1);}else this['set']('icon',_0x12d01f);}['_createTooltipContentView'](_0x161d61,_0x24081b){const _0x6e3753=new Nt(_0x161d61),_0x56e7be=[];let _0x2fcd10;_0x24081b?.['favicon']?(_0x2fcd10=new Nt(_0x161d61),_0x2fcd10['setTemplate']({'tag':'img','attributes':{'src':_0x24081b['favicon'],'alt':_0x24081b['title'],'class':['ck-ai-web-source__tooltip-image']}})):(_0x2fcd10=new yt(),_0x2fcd10['content']=_0x12d01f,_0x2fcd10['extendTemplate']({'attributes':{'alt':_0x24081b['title'],'class':['ck-ai-web-source__tooltip-image']}})),_0x56e7be['push'](_0x2fcd10);const _0x627216=new Nt(_0x161d61);_0x627216['setTemplate']({'tag':'a','attributes':{'class':['ck-ai-web-source__tooltip-url'],'href':_0x24081b['url']},'children':[{'text':new URL(_0x24081b['url'])?.['hostname']}]}),_0x56e7be['push'](_0x627216);const _0xce9b13=new Nt(_0x161d61);_0xce9b13['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-web-source__tooltip-row']},'children':_0x56e7be});const _0x32491b=new Nt(_0x161d61);return _0x32491b['setTemplate']({'tag':'span','attributes':{'class':['ck-ai-web-source__tooltip-row','ck-ai-web-source__tooltip-title']},'children':[{'text':_0x24081b['title']['length']>0x190?_0x24081b['title']['substring'](0x0,0x190)+'...':_0x24081b['title']}]}),_0x6e3753['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-web-source__tooltip']},'children':[_0xce9b13,_0x32491b]}),_0x6e3753;}['_showTooltip'](){this['_updateTooltipContent'](),this['balloonPanelView']['pin']({'target':this['element'],'positions':[Qt['defaultPositions']['northArrowSouth'],Qt['defaultPositions']['northArrowSouthWest'],Qt['defaultPositions']['northArrowSouthEast']],'limiter':document['querySelector']('.ck-ai-chat')}),this['balloonPanelView']['show']();}['_hideTooltip'](){this['balloonPanelView']['hide']();}['_updateTooltipContent'](){this['balloonPanelView']['content']['get'](0x0)?.['destroy'](),this['balloonPanelView']['content']['clear']();const _0x2d5aa6=this['_createTooltipContentView'](this['locale'],this['source']);this['balloonPanelView']['content']['add'](_0x2d5aa6);}}class pn extends Nt{['_actionsView'];['_sourcesView'];['_children'];['_areActionsDisabled'];['_showUnchangedParts'];['_updateContentPartsPromiseQueue'];['_emptyPartsWarningView'];['_availableActions'];['_cachedContentParts']=[];constructor(_0x1b6002,_0x495ad5){super(_0x1b6002);const {areActionsDisabled:_0xe56ac8,showUnchangedParts:_0x1150c6,availableActions:_0x29ac87}=_0x495ad5;this['_areActionsDisabled']=_0xe56ac8,this['_showUnchangedParts']=_0x1150c6,this['_availableActions']=_0x29ac87,this['set']('hasPendingParts',!0x1),this['set']('isTrackChangesOn',!0x1),this['_children']=this['createCollection'](),this['_updateContentPartsPromiseQueue']=new _n(),this['_emptyPartsWarningView']=new An({'id':'empty-parts-warning','initialContent':as(_0x1b6002,'AI_SUGGESTION_EMPTY_PART_WARNING'),'level':'warning'}),this['_emptyPartsWarningView']['isVisible']=!0x1,this['_actionsView']=new In(_0x1b6002,_0x495ad5['availableActions'],this['_areActionsDisabled']),this['_actionsView']['bind']('isTrackChangesOn')['to'](this),this['_sourcesView']=new En(this['locale'],_0x495ad5['bodyCollection']),_0x495ad5['areActionsDisabled']?this['_actionsView']['isEnabled']=!0x1:this['_actionsView']['bind']('isEnabled')['to'](this,'hasPendingParts'),this['_actionsView']['delegate'](...Qs)['to'](this),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__body']},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__body__content-parts']},'children':this['_children']},this['_emptyPartsWarningView'],this['_actionsView'],this['_sourcesView']]});}get['partsCount'](){return this['_children']['length'];}async['updateContentParts']({parts:_0x590208,renderingStrategy:_0x1c80a7,abortSignal:_0x320276}){this['_children']['length']?_0x590208['forEach'](_0x5e72eb=>{const _0x55987c=this['_cachedContentParts']['findIndex'](_0x2a7ccb=>_0x2a7ccb['index']==_0x5e72eb['index']);-0x1===_0x55987c?this['_cachedContentParts']['push'](_0x5e72eb):this['_cachedContentParts'][_0x55987c]=_0x5e72eb;}):this['_cachedContentParts']=_0x590208;const _0x512e41=this['_showUnchangedParts']?_0x590208:_0x590208['filter'](_0x457ad1=>_0x457ad1['hasChanges']);this['_actionsView']['_switchButtonLabelsPlurality'](_0x512e41['length']>0x1);for(const _0xe94c11 of _0x512e41)this['_updateContentPartsPromiseQueue']['enqueue'](async _0x23c6e8=>{let _0x33f8dc=this['getPartView'](_0xe94c11['index']);_0x33f8dc||(_0x33f8dc=new dn(this['locale'],{'part':_0xe94c11,'uiIndex':this['_children']['length']+0x1,'areActionsDisabled':this['_areActionsDisabled'],'availableActions':this['_availableActions']}),_0x33f8dc['delegate'](...Qs)['to'](this),this['_children']['add'](_0x33f8dc),this['hasPendingParts']=!0x0),await _0x33f8dc['updateContent']({'part':_0xe94c11,'renderingStrategy':_0x1c80a7,'showUnchangedParts':this['_showUnchangedParts'],'abortSignal':_0x23c6e8}),_0x33f8dc['markAsDone']();});return _0x320276?.['addEventListener']('abort',()=>{this['_updateContentPartsPromiseQueue']['abort']();}),this['_updateContentPartsPromiseQueue']['queueEmptyPromise'];}['updatePartState'](_0x43f475,_0x29a03f){const _0x24c745=this['getPartView'](_0x43f475);_0x24c745&&(_0x24c745['state']=_0x29a03f),this['hasPendingParts']='pending'==_0x29a03f||Array['from'](this['_children'])['some'](_0x42ff27=>'pending'==_0x42ff27['state']);}['setPartActive'](_0x114fa0,_0x240237){if(!0x1===_0x114fa0){for(const _0x5e827e of this['_children'])_0x5e827e['isActive']=!0x1;}else{const _0x399b31=this['getPartView'](_0x114fa0);_0x399b31&&(_0x399b31['isActive']=_0x240237);}}['updateSources'](_0x2aa9e2){_0x2aa9e2['forEach'](_0x395077=>this['_sourcesView']['addSource'](_0x395077)),this['_sourcesView']['isVisible']=!0x0;}['getPartView'](_0x3c3f32){return this['_children']['find'](_0x555ab7=>_0x555ab7['partDefinition']['index']==_0x3c3f32)??null;}['markAsDone'](){if(!this['_showUnchangedParts']){const _0x121878=!this['_cachedContentParts']['find'](({hasChanges:_0x2e3cae})=>_0x2e3cae),_0x3888dc=!!this['_cachedContentParts']['find'](({hasChanges:_0x5371a2})=>!_0x5371a2);this['_emptyPartsWarningView']['isVisible']=0x0==this['_children']['length']||_0x3888dc,_0x121878?this['_emptyPartsWarningView']['setContent'](as(this['locale'],'AI_SUGGESTION_NO_PARTS_WARNING')):this['_emptyPartsWarningView']['setContent'](as(this['locale'],'AI_SUGGESTION_EMPTY_PART_WARNING'));}this['_children']['forEach'](_0x4e81ce=>_0x4e81ce['markAsDone']()),this['_actionsView']['updateVisibility'](this['hasNonEmptyParts']);}get['hasNonEmptyParts'](){return this['_children']['filter'](_0x1483fa=>_0x1483fa['partDefinition']['hasChanges'])['length']>0x0;}}class mn extends Nt{['bodyView'];['children'];['headerView'];constructor(_0x2e4262,_0x2ad967,_0x5217a9){super(_0x2e4262);const {showDiff:_0x51b541,areActionsDisabled:_0x56aefd,showUnchangedParts:_0x137b83,availableActions:_0x44516f}=_0x2ad967;this['set']('isTrackChangesOn',!0x1),this['set']('areChangesVisible',!0x1),this['children']=this['createCollection'](),this['headerView']=new sn(_0x2e4262,{'showDiff':_0x51b541}),this['headerView']['on']('toggleShowChanges',(_0x338f06,_0x9e9680)=>{this['areChangesVisible']=_0x9e9680['isOn'],this['fire']('toggleSuggestionDisplayMode',{'showDiff':_0x9e9680['isOn']});}),this['children']['add'](this['headerView']),this['bodyView']=new pn(_0x2e4262,{'areActionsDisabled':_0x56aefd,'showUnchangedParts':!!_0x137b83,'availableActions':_0x44516f,'bodyCollection':_0x5217a9}),this['bodyView']['delegate'](...Qs)['to'](this),this['bodyView']['bind']('isTrackChangesOn')['to'](this),this['children']['add'](this['bodyView']),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__container','ck-rounded-corners']},'children':this['children']});}async['updateContent'](_0x218131){await this['bodyView']['updateContentParts'](_0x218131);}['updateSources'](_0x401b87){this['bodyView']['updateSources'](_0x401b87);}['markAsDone'](){this['bodyView']['markAsDone'](),this['headerView']&&(this['headerView']['isShowChangesToggleVisible']=this['bodyView']['hasNonEmptyParts']);}}class Cn extends en{['containerView'];constructor(_0x2beca8,_0x2371a9,_0xd8890d){super(_0x2371a9),this['set']('isTrackChangesOn',!0x1),this['containerView']=new mn(_0x2beca8,{'showDiff':_0x2371a9['showDiff'],'areActionsDisabled':_0x2371a9['areActionsDisabled'],'availableActions':_0x2371a9['availableActions']},_0xd8890d),this['containerView']['on']('toggleSuggestionDisplayMode',(_0x50db93,_0x231d54)=>{this['fire']('toggleSuggestionDisplayMode',{'replyId':this['options']['id'],'showDiff':_0x231d54['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',(_0x3c3210,{index:_0x41dafb})=>{this['fire']('showChangeInText',{'replyId':this['options']['id'],'partIndex':_0x41dafb});}),this['containerView']['on']('applySuggestion',(_0x3eebcb,{index:_0x3fa722}={})=>{this['fire']('applySuggestion',{'replyId':this['options']['id'],'partIndex':_0x3fa722});}),this['containerView']['on']('insertSuggestion',(_0x2bb0b9,{index:_0x53845}={})=>{this['fire']('insertSuggestion',{'replyId':this['options']['id'],'partIndex':_0x53845});}),this['containerView']['on']('rejectSuggestion',(_0x421415,{index:_0x475139})=>{this['fire']('rejectSuggestion',{'replyId':this['options']['id'],'partIndex':_0x475139});}),this['containerView']['on']('mouseOverSuggestion',(_0x50b5c1,{index:_0x4d2759})=>{this['fire']('mouseOverSuggestion',{'replyId':this['options']['id'],'partIndex':_0x4d2759});}),this['containerView']['on']('mouseLeaveSuggestion',(_0x2a2ef4,{index:_0x1af442})=>{this['fire']('mouseLeaveSuggestion',{'replyId':this['options']['id'],'partIndex':_0x1af442});}),this['children']['addMany']([this['containerView']]),this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__ai-suggestion']}});}async['updateContent'](_0x5f4f83){await this['containerView']['updateContent'](_0x5f4f83);}['updatePartState'](_0x11f111,_0x34ce85){this['containerView']['bodyView']['updatePartState'](_0x11f111,_0x34ce85);}['setPartActive'](_0x1e5181,_0x3d83eb){!0x1===_0x1e5181?this['containerView']['bodyView']['setPartActive'](!0x1):this['containerView']['bodyView']['setPartActive'](_0x1e5181,_0x3d83eb);}['updateSources'](_0x11ace7){this['containerView']['updateSources'](_0x11ace7);}['getPartView'](_0x109a0b){return this['containerView']['bodyView']['getPartView'](_0x109a0b);}['markAsDone'](){super['markAsDone'](),this['containerView']['markAsDone']();}}class wn extends en{['replyContainer'];['_bodyCollection'];constructor(_0x2c8f97,_0x24404c,_0x2e4b6b){super(_0x24404c),this['_bodyCollection']=_0x2e4b6b,this['locale']=_0x2c8f97,this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__ai-reply']}}),this['replyContainer']=new Nt(),this['replyContainer']['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all-excluded','ck-ai-chat__feed__ai-reply-container']}}),this['children']['add'](this['replyContainer']);}async['render'](){super['render'](),this['options']['initialContent']&&(await this['updateContent']({'parsedContent':us(this['options']['initialContent']),'renderingStrategy':'static'}),this['markAsDone']());}async['updateContent']({parsedContent:_0x25fc5c,renderingStrategy:_0x5ce101,abortSignal:_0x19d5a8}){'streaming'===_0x5ce101?await this['streamIntoElement'](_0x25fc5c,this['replyContainer']['element'],_0x19d5a8):this['replyContainer']['element']['innerHTML']=_0xc041c1(_0x25fc5c);}['updateSources'](_0x551a4d){const _0x24c5e9=new En(this['locale'],this['_bodyCollection']);_0x24c5e9['children']['addMany'](_0x551a4d['map'](_0x4adeee=>new Tn(this['locale'],_0x4adeee,_0x24c5e9['balloonPanelView']))),_0x24c5e9['isVisible']=!0x0,this['children']['add'](_0x24c5e9);}}class fn extends vt{constructor(_0x20bf34=void 0x0){super();const _0x341ab9=_0x20bf34?'ck-ai-spinner_'+_0x20bf34:'';this['extendTemplate']({'tag':'span','attributes':{'class':['ck-ai-spinner',_0x341ab9]}});}}const Sn={'file':_0x467af8,'document':_0x4dad6b,'web-resource':_0x108376,'text':_0x467af8,'selection':_0x47c1bc,'mcp-tool-context':_0x4dad6b},bn='ck-ai-chat-context-chip',Rn='ck-ai-chat-context-chip_wide',On='ck-ai-chat-context-chip_document',kn='ck-ai-chat-context-chip__label',Nn='ck-ai-chat-context-chip__type-icon',vn='ck-ai-chat-context-controls__chip-tooltip',yn='n';class xn extends kt{constructor(_0x4d8af5,_0x591edb,_0x3bfbb5,_0xaa02df,_0x37767a=!0x1){super(_0x4d8af5),this['_isAnimationOnEnterEnabled']=_0xaa02df,this['_initializeProperties'](_0x591edb,_0x3bfbb5,_0x37767a),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'](_0x3c31f4,_0x3d32f1,_0x2f7b5c){this['set']('label',_0x3c31f4['label']),this['set']('tooltip',!0x0),this['set']('itemType',_0x3c31f4['type']),this['set']('id',_0x3c31f4['uiId']),this['set']('readonly',_0x3d32f1),this['set']('isLoading',_0x2f7b5c);}['_setupTemplate'](){const _0x195a43=this['_createIconView'](),_0x22709c=this['_createRemoveButton'](),_0x5a17b1=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':this['_createTemplateAttributes'](_0x5a17b1),'children':this['_createTemplateChildren'](_0x195a43,_0x22709c,_0x5a17b1)});}['_createTemplateAttributes'](_0x1e8f78){return{'class':[bn,_0x1e8f78['if']('itemType',On,_0x2a0782=>'document'==_0x2a0782),_0x1e8f78['if']('itemType',Rn,_0xc56e82=>'selection'==_0xc56e82)],'data-cke-tooltip-text':_0x1e8f78['to']('label',Ln),'data-cke-tooltip-position':yn,'data-cke-tooltip-class':vn};}['_createTemplateChildren'](_0x3df6d4,_0x4c9295,_0x352f18){const _0x276774=this['_createLabelElement'](_0x352f18),_0xc6af3b=this['_createLoaderIcon']();return this['readonly']?[_0x3df6d4,_0x276774]:[_0x3df6d4,_0xc6af3b,_0x276774,_0x4c9295];}['_createLabelElement'](_0x5500f1){return{'tag':'span','attributes':{'class':kn},'children':[{'text':_0x5500f1['to']('label')}]};}['_createRemoveButton'](){const _0x5c1dba=new kt(this['locale']);return _0x5c1dba['set']({'label':as(this['locale'],'AI_CHAT_CONTEXT_REMOVE_FROM_CONTEXT'),'icon':_0x101f07}),this['_setupRemoveButtonEvent'](_0x5c1dba),_0x5c1dba;}['_setupRemoveButtonEvent'](_0xe6dcee){_0xe6dcee['on']('execute',()=>{this['fire']('removeContextItemChip',this['id']);});}['_createIconView'](){const _0x935756=this['bindTemplate'],_0x3dde96=new yt();return _0x3dde96['content']=Sn[this['itemType']],_0x3dde96['extendTemplate']({'attributes':{'class':[Nn,_0x935756['if']('isLoading','ck-hidden',_0x454619=>_0x454619)]}}),_0x3dde96;}['_handleAnimationEndOnce'](_0x170153,_0x1c4650){if(!_0x170153)return;const _0x245252=()=>{_0x1c4650(),_0x170153['removeEventListener']('animationend',_0x245252),_0x170153['removeEventListener']('webkitAnimationEnd',_0x245252);};_0x170153['addEventListener']('animationend',_0x245252),_0x170153['addEventListener']('webkitAnimationEnd',_0x245252);}['_createLoaderIcon'](){const _0x26392b=new fn('small');return _0x26392b['bind']('isVisible')['to'](this,'isLoading',_0x4d4671=>_0x4d4671),_0x26392b;}}function Ln(_0x1b16c9){if(!_0x1b16c9)return _0x1b16c9;if(_0x1b16c9['length']<=0x78)return _0x1b16c9;const _0x48bf26=_0x1b16c9['slice'](0x0,0x78),_0x374a32=_0x48bf26['lastIndexOf']('\x20');return(_0x374a32>0x0?_0x48bf26['slice'](0x0,_0x374a32):_0x48bf26)+'…';}const Dn={'maxVisibleRows':0x2,'rowDetectionTolerance':0x5,'showMoreLabelPrefix':'+\x20','viewportOffset':{'top':0x64,'bottom':0xa}},Pn='300px';class Hn{['_locale'];['_config'];['_visibleChips'];['_overflowChips'];['_showMoreButtonView']=null;['_showMoreBalloonPanelView']=null;['_containerElement']=null;['_bodyCollection'];['_parentView']=null;['_intersectionObserver']=null;['_pendingCalculation']=!0x1;constructor(_0x3bb9c6,_0x40fb0d,_0xaef634,_0x4c5b42,_0x41d731){this['_locale']=_0x3bb9c6,this['_visibleChips']=_0x40fb0d,this['_config']={...Dn,..._0xaef634,'cssClasses':{'controlsButton':'','calculationContainer':'ck-calculation-container',..._0xaef634['cssClasses']}},this['_overflowChips']=new dt(),this['_bodyCollection']=_0x4c5b42,this['_parentView']=_0x41d731||null;}['setContainerElement'](_0x28d22d){this['_intersectionObserver']&&(this['_intersectionObserver']['disconnect'](),this['_intersectionObserver']=null),this['_containerElement']=_0x28d22d,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 _0x243802=[...this['_visibleChips'],...this['_overflowChips']],_0x40974a=this['_createCalculationContainer'](),_0x36665c=this['_calculateOverflowInContainer'](_0x40974a,_0x243802),_0x35540a=_0x40974a['_ancestorsToRestore'];_0x35540a&&this['_restoreAncestorVisibility'](_0x35540a),_0x40974a['remove'](),this['_applyOverflowResults'](_0x243802,_0x36665c);}['_createShowMoreButton'](){this['_showMoreButtonView']=this['_createShowMoreButtonView'](),this['_showMoreBalloonPanelView']=this['_createShowMoreBalloonPanelView'](),this['_showMoreButtonView']['render'](),this['_containerElement']['appendChild'](this['_showMoreButtonView']['element']),this['_showMoreButtonView']['on']('execute',()=>{this['_handleShowMoreButtonClick']();}),Xt({'emitter':this['_showMoreBalloonPanelView'],'contextElements':[this['_showMoreBalloonPanelView']['element'],this['_showMoreButtonView']['element']],'callback':()=>this['hideBalloonPanel'](),'activator':()=>this['_showMoreButtonView']['isOn']});}['_createShowMoreButtonView'](){const _0x14cf28=new kt(this['_locale']);_0x14cf28['set']({'label':'','withText':!0x0,'isToggleable':!0x0});const _0x5468f4=[this['_config']['cssClasses']['showMoreButton']];return this['_config']['cssClasses']['controlsButton']&&_0x5468f4['push'](this['_config']['cssClasses']['controlsButton']),_0x14cf28['extendTemplate']({'attributes':{'class':_0x5468f4}}),_0x14cf28;}['_createShowMoreBalloonPanelView'](){const _0x1db01a=new Qt(this['_locale']);return _0x1db01a['extendTemplate']({'attributes':{'class':this['_config']['cssClasses']['showMoreBalloon']}}),this['_bodyCollection']['add'](_0x1db01a),_0x1db01a;}['_updateBalloonContent'](){if(this['_showMoreBalloonPanelView']&&(this['_showMoreBalloonPanelView']['content']['clear'](),this['_overflowChips']['length']>0x0)){this['_overflowChips']['forEach'](_0x6cd8a6=>{_0x6cd8a6['disableAnimationOnEnter']();});const _0x2e342e=new Nt(this['_locale']);_0x2e342e['setTemplate']({'tag':'div','attributes':{'class':this['_config']['cssClasses']['overflowContainer']},'children':this['_overflowChips']}),this['_showMoreBalloonPanelView']['content']['add'](_0x2e342e);}}['_handleShowMoreButtonClick'](){this['_showMoreButtonView']['isOn']?this['hideBalloonPanel']():this['showBalloonPanel']();}['_updateShowMoreButtonVisibility'](){const _0x444ff8=this['_overflowChips']['length']>0x0;this['_showMoreButtonView']?.['element']&&(this['_showMoreButtonView']['element']['style']['display']=_0x444ff8?'':'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'](_0x39b1bc){const _0x4f0d32=this['_containerElement']?.['tagName']['toLowerCase']()||'div',_0x46540f=this['_containerElement']?.['classList'];if(_0x46540f){const _0x3e47bd=_0x46540f[0x0]||'',_0x236972=_0x39b1bc['querySelector']('.'+_0x3e47bd),_0x5d1092=_0x39b1bc['querySelector'](_0x4f0d32);return _0x236972||_0x5d1092||_0x39b1bc;}return _0x39b1bc['querySelector'](_0x4f0d32)||_0x39b1bc;}['_calculateContainerWidth'](){const _0x5893b5=this['_parentView']?.['element']||this['_containerElement'];if(!_0x5893b5)return Pn;const _0x3e3f20=window['getComputedStyle'](_0x5893b5)['width'];if('auto'===_0x3e3f20||'0px'===_0x3e3f20||!_0x3e3f20){const _0x494c62=_0x5893b5['parentElement'];if(_0x494c62){const _0xd6252=window['getComputedStyle'](_0x494c62);return'auto'!==_0xd6252['width']?_0xd6252['width']:Pn;}return Pn;}return _0x3e3f20;}['_applyCalculationStyles'](_0x4f435b,_0x9dbe25){this['_config']['cssClasses']['calculationContainer']&&_0x4f435b['classList']['add'](this['_config']['cssClasses']['calculationContainer']),_0x4f435b['style']['width']=_0x9dbe25,_0x4f435b['style']['position']='absolute',_0x4f435b['style']['top']='-9999px',_0x4f435b['style']['left']='-9999px',_0x4f435b['style']['opacity']='0',_0x4f435b['style']['pointerEvents']='none',_0x4f435b['style']['zIndex']='-1',_0x4f435b['style']['visibility']='visible\x20!important',_0x4f435b['style']['display']='block\x20!important',_0x4f435b['style']['boxSizing']='border-box';}['_restoreAncestorVisibility'](_0x58653e){_0x58653e['forEach'](({element:_0x56cb01,originalDisplay:_0x45fbe9,originalVisibility:_0x301ae8})=>{_0x56cb01['style']['display']=_0x45fbe9,_0x56cb01['style']['visibility']=_0x301ae8;});}['_makeAncestorsVisible'](_0x3a9c26){const _0x98efae=[];let _0x2dd1b9=_0x3a9c26;for(;_0x2dd1b9&&_0x2dd1b9!==document['body'];){const _0x3ce63c=window['getComputedStyle'](_0x2dd1b9);'none'!==_0x3ce63c['display']&&'hidden'!==_0x3ce63c['visibility']||(_0x98efae['push']({'element':_0x2dd1b9,'originalDisplay':_0x2dd1b9['style']['display'],'originalVisibility':_0x2dd1b9['style']['visibility']}),_0x2dd1b9['style']['display']='block',_0x2dd1b9['style']['visibility']='visible'),_0x2dd1b9=_0x2dd1b9['parentElement'];}return _0x98efae;}['_createContainerElements'](){let _0xac63a5,_0x475761;return this['_parentView']?.['element']?(_0xac63a5=this['_parentView']['element']['cloneNode'](!0x0),_0x475761=this['_findTargetContainer'](_0xac63a5)):(_0xac63a5=document['createElement']('div'),_0x475761=_0xac63a5),{'calculationContainer':_0xac63a5,'targetContainer':_0x475761};}['_createCalculationContainer'](){const {calculationContainer:_0x54d8df,targetContainer:_0xe58540}=this['_createContainerElements'](),_0x4f2392=this['_calculateContainerWidth']();this['_applyCalculationStyles'](_0x54d8df,_0x4f2392);const _0x426d76=this['_parentView']?.['element']||this['_containerElement'],_0x5e5569=_0x426d76?.['parentElement'];_0x5e5569?_0x5e5569['appendChild'](_0x54d8df):document['body']['appendChild'](_0x54d8df),_0x54d8df['_targetContainer']=_0xe58540;const _0x541878=this['_makeAncestorsVisible'](_0x5e5569||null);return _0x54d8df['offsetWidth'],_0x54d8df['_ancestorsToRestore']=_0x541878,_0x54d8df;}['_calculateOverflowInContainer'](_0xd6a41c,_0x8cfcd){const _0x565776=_0xd6a41c['_targetContainer']||_0xd6a41c,_0x25f20b=[],{rowCount:_0x4dcfbf}=this['_renderChipsAndCountRows'](_0x565776,_0x8cfcd);if(_0x4dcfbf<=this['_config']['maxVisibleRows'])return _0x25f20b;const _0xa8273f=_0x8cfcd['slice']();for(;_0xa8273f['length']>0x0;){if(this['_testButtonFit'](_0xd6a41c,_0x565776,_0xa8273f)){const _0x142706=_0x8cfcd['filter'](_0x608e95=>!_0xa8273f['includes'](_0x608e95));_0x25f20b['push'](..._0x142706);break;}if(!_0xa8273f['pop']())break;}return _0x25f20b;}['_renderChipsAndCountRows'](_0x4aa089,_0x5d4cb9){_0x4aa089['innerHTML']='',_0x5d4cb9['forEach'](_0x789d2a=>{if(_0x789d2a['element']){const _0x33062d=_0x789d2a['element']['cloneNode'](!0x0);_0x4aa089['appendChild'](_0x33062d);}}),_0x4aa089['offsetWidth'];const _0x1f1894=_0x4aa089['children'],_0x460d4e=[];return Array['from'](_0x1f1894)['forEach'](_0x20751f=>{const _0x121ab4=_0x20751f['getBoundingClientRect']()['top'];_0x460d4e['some'](_0x129c62=>Math['abs'](_0x129c62-_0x121ab4)<this['_config']['rowDetectionTolerance'])||_0x460d4e['push'](_0x121ab4);}),{'rowCount':_0x460d4e['length']};}['_createMockButton'](){const _0x2de405=document['createElement']('button');return _0x2de405['className']=this['_config']['cssClasses']['showMoreButton'],this['_config']['cssClasses']['controlsButton']&&_0x2de405['classList']['add'](this['_config']['cssClasses']['controlsButton']),_0x2de405['textContent']='+\x201',_0x2de405;}['_testButtonFit'](_0x4d78fd,_0x9cba8d,_0x3f51d3){this['_renderChipsAndCountRows'](_0x9cba8d,_0x3f51d3);const _0x17fe19=this['_createMockButton']();_0x4d78fd['appendChild'](_0x17fe19),_0x4d78fd['offsetWidth'];const _0x46e683=[..._0x9cba8d['children'],_0x17fe19],_0x4df5a8=[];_0x46e683['forEach'](_0x50ac9e=>{const _0x1f466c=_0x50ac9e['getBoundingClientRect']()['top'];_0x4df5a8['some'](_0x544005=>Math['abs'](_0x544005-_0x1f466c)<this['_config']['rowDetectionTolerance'])||_0x4df5a8['push'](_0x1f466c);});const _0x36365e=_0x4df5a8['length'];return _0x17fe19['remove'](),_0x36365e<=this['_config']['maxVisibleRows'];}['_distributeChips'](_0x796356,_0x58d839){this['_visibleChips']['clear'](),this['_overflowChips']['clear'](),_0x796356['forEach'](_0x418d8a=>{_0x58d839['includes'](_0x418d8a)?this['_overflowChips']['add'](_0x418d8a):this['_visibleChips']['add'](_0x418d8a);});}['_updateOverflowUI'](_0x56a184){if(_0x56a184>0x0&&!this['_showMoreButtonView']&&this['_createShowMoreButton'](),_0x56a184>0x0&&this['_showMoreButtonView']){const _0x4195ef=''+this['_config']['showMoreLabelPrefix']+(_0x56a184<0x63?_0x56a184:'99');this['_showMoreButtonView']['label']=_0x4195ef;}this['_updateBalloonContent'](),this['_updateShowMoreButtonVisibility'](),this['_repinBalloonPanel']();}['_applyOverflowResults'](_0x378ab0,_0x571ba7){this['_distributeChips'](_0x378ab0,_0x571ba7),this['_updateOverflowUI'](_0x571ba7['length']);}['_setupVisibilityObserver'](){this['_containerElement']&&'undefined'!=typeof IntersectionObserver&&(this['_intersectionObserver']=new IntersectionObserver(_0x1388f2=>{_0x1388f2[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 _0x433166=this['_containerElement']['getBoundingClientRect']();if(0x0===_0x433166['width']||0x0===_0x433166['height'])return!0x1;const _0x85f398=window['innerHeight']||document['documentElement']['clientHeight'],_0x51cd38=window['innerWidth']||document['documentElement']['clientWidth'],_0xd8e46f=0xc8;return _0x433166['bottom']>=-0xc8&&_0x433166['top']<=_0x85f398+_0xd8e46f&&_0x433166['right']>=-0xc8&&_0x433166['left']<=_0x51cd38+_0xd8e46f;}}const Mn='ck-ai-chat__feed__context-chips',Un='ck-ai-chat-context-chips-wrapper',Vn='ck-ai-chat-context-chips-wrapper-balloon',Bn='ck-ai-chat-controls-button',Gn='ck-ai-chat-controls_context_show-more-button',Fn='ck-ai-chat-context-controls__show-more-balloon-panel';class Kn extends Nt{['_contextChips']=this['createCollection']();['_overflowManager'];['_bodyCollection'];constructor(_0xdc7f7e,_0x397781,_0x25bc74){super(_0xdc7f7e),this['_bodyCollection']=_0x25bc74,this['_createContextChips'](_0x397781);const _0x549460={'cssClasses':{'showMoreButton':Gn+'\x20'+cs,'showMoreBalloon':Fn,'overflowContainer':Vn,'controlsButton':Bn}};this['_overflowManager']=new Hn(_0xdc7f7e,this['_contextChips'],_0x549460,this['_bodyCollection'],this),this['setTemplate']({'tag':'div','attributes':{'class':[Mn,'ck','ck-reset_all']},'children':[{'tag':'div','attributes':{'class':Un},'children':this['_contextChips']}]});}['render'](){super['render']();const _0x3de15d=this['element']['querySelector']('.'+Un);_0x3de15d&&(this['_overflowManager']['setContainerElement'](_0x3de15d),this['_overflowManager']['reorganizeChips']());}['destroy'](){super['destroy'](),this['_overflowManager']['destroy']();}['_createContextChips'](_0x22d8bc){for(const _0x5c6368 of _0x22d8bc){const _0x5e4546=new xn(this['locale'],_0x5c6368,!0x0,!0x1);this['_contextChips']['add'](_0x5e4546);}}}class Wn extends en{['_contextChipsView']=null;['_locale'];['_bodyCollection'];['_messageContentView'];constructor(_0x337b79,_0x1f1a74,_0x20fde1){super(_0x1f1a74),this['_locale']=_0x337b79,this['_bodyCollection']=_0x20fde1,this['_createContextChipsView'](),this['_createMessageContentView'](),this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__user-message']}});}['_createContextChipsView'](){this['options']['contextItems']&&this['options']['contextItems']['length']>0x0&&(this['_contextChipsView']=new Kn(this['_locale'],this['options']['contextItems']['filter'](_0x47993b=>!_0x47993b['hidden']),this['_bodyCollection']),this['_contextChipsView']['extendTemplate']({'attributes':{'class':'ck-ai-chat__feed__context-chips'}}),this['children']['add'](this['_contextChipsView']));}['_createMessageContentView'](){this['_messageContentView']=new Nt(this['_locale']),this['_messageContentView']['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-chat__feed__message-content'}}),this['children']['add'](this['_messageContentView']);}['render'](){super['render'](),this['_messageContentView']['element']['innerHTML']=this['options']['initialContent'],this['markAsDone']();}}class Yn extends en{['capabilities'];constructor(_0x26ea87,_0xb45eb8){super(_0xb45eb8);const {isWebSearchEnabled:_0x57e8b2,isReasoningEnabled:_0x2cbec2}=_0xb45eb8['capabilities'],_0x528dcf=[];let _0x17774c='';_0x57e8b2&&_0x2cbec2?(_0x17774c=as(_0x26ea87,'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH_REASONING'),_0x528dcf['push']($n(_0x12d01f)),_0x528dcf['push']($n(_0x1c694e))):_0x57e8b2?(_0x17774c=as(_0x26ea87,'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH'),_0x528dcf['push']($n(_0x12d01f))):_0x2cbec2&&(_0x17774c=as(_0x26ea87,'AI_CHAT_FEED_REPLY_ITEM_USED_REASONING'),_0x528dcf['push']($n(_0x1c694e))),this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__interaction-header',_0x17774c?'':'ck-hidden']}});const _0x1e6b30=new Nt();_0x1e6b30['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__interaction-header__capabilities']},'children':[..._0x528dcf,{'tag':'span','attributes':{'class':['ck-ai-chat__feed__interaction-header__capabilities__text']},'children':[_0x17774c]}]}),this['children']['add'](_0x1e6b30),this['capabilities']=_0xb45eb8['capabilities'];}}function $n(_0x446fb3){const _0x2cbbe8=new yt();return _0x2cbbe8['content']=_0x446fb3,_0x2cbbe8;}const qn=['wheel','touchstart','pointerdown','keydown'],Qn=['ArrowUp','ArrowDown','PageUp','PageDown','Home','End','\x20'];class Xn{['element'];['animationFrameId'];['isRunning'];['abortController'];['isUserPaused'];constructor(_0x472a38){this['element']=_0x472a38,this['animationFrameId']=null,this['isRunning']=!0x1,this['abortController']=new AbortController(),this['isUserPaused']=!0x1;for(const _0x1ce0f2 of qn){const _0x4ab15e='keydown'!==_0x1ce0f2;this['element']['addEventListener'](_0x1ce0f2,this['_onUserEvent']['bind'](this),{'passive':_0x4ab15e,'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'](_0x23ee23){if(this['isRunning']){if('keydown'===_0x23ee23['type']){const _0x52c23e=_0x23ee23['key'];if(!Qn['includes'](_0x52c23e))return;}_0x23ee23 instanceof WheelEvent?_0x23ee23['deltaY']<0x0?this['isUserPaused']=!0x0:this['isUserPaused']=!this['_isAtBottom']():this['isUserPaused']=!0x0;}}['_isAtBottom'](){const {scrollTop:_0x16d77b,scrollHeight:_0x3868bf,clientHeight:_0x4ed47b}=this['element'];return _0x3868bf-_0x16d77b-_0x4ed47b<=0x5;}['_rafUpdate'](){this['isRunning']&&(this['isUserPaused']||this['element']['scrollTo']({'top':this['element']['scrollHeight'],'behavior':'auto'}),this['animationFrameId']=requestAnimationFrame(this['_rafUpdate']['bind'](this)));}}class zn extends Nt{constructor(_0xfcaf9f,_0x2c3ca0){super(_0xfcaf9f),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-skeleton']},'children':this['_createSkeletonItems'](_0x2c3ca0)});}['_createSkeletonItems'](_0x2aff7d){const _0x50a352=['ck','ck-ai-skeleton__item'];return _0x2aff7d['map'](_0x413ce7=>{let _0x49ca41='';switch(_0x413ce7['attributes']['align']){case'right':_0x49ca41='margin-left:\x20auto;\x20margin-right:\x200;\x20text-align:\x20right;';break;case'center':_0x49ca41='margin-left:\x20auto;\x20margin-right:\x20auto;\x20text-align:\x20center;';break;case'left':_0x49ca41='margin-left:\x200;\x20margin-right:\x20auto;\x20text-align:\x20left;';}return{'tag':_0x413ce7['tag'],'attributes':{'class':[..._0x50a352,_0x413ce7['attributes']['class']?_0x413ce7['attributes']['class']:''],'style':'width:\x20'+_0x413ce7['attributes']['width']+';\x20height:\x20'+_0x413ce7['attributes']['height']+';'+_0x49ca41}};});}}const jn={'aiFeed':[{'tag':'div','attributes':{'width':'100%','height':'72px','align':'right'}},{'tag':'div','attributes':{'width':'250px','height':'40px','align':'right'}},{'tag':'div','attributes':{'width':'100%','height':'88px','align':'right'}},{'tag':'div','attributes':{'width':'150px','height':'40px','align':'right'}},{'tag':'div','attributes':{'width':'100%','height':'140px','align':'right'}},{'tag':'div','attributes':{'width':'250px','height':'40px','align':'right'}},{'tag':'div','attributes':{'width':'100%','height':'88px','align':'right'}}],'aiHistory':Jn(0x5,'100%','44px','right'),'aiChatResources':Jn(0x8,'100%','24px','right'),'aiReviewChecks':[{'tag':'div','attributes':{'width':'128px','height':'24px','align':'left'}},{'tag':'div','attributes':{'width':'100%','height':'24px','align':'left'}},{'tag':'div','attributes':{'width':'128px','height':'24px','align':'left'}}]};function Jn(_0x34fe31,_0x46a732,_0x2e4fc6,_0x35e824){return new Array(_0x34fe31)['fill'](null)['map'](()=>({'tag':'div','attributes':{'width':_0x46a732,'height':_0x2e4fc6,'align':_0x35e824}}));}class Zn extends en{constructor(_0x44638b){super(_0x44638b),this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__custom-element']}});}async['render'](){super['render'](),'string'==typeof this['options']['content']?this['element']['innerHTML']=this['options']['content']:this['element']['appendChild'](this['options']['content']);}}class tr extends Nt{['children'];['scrollManager'];['_bodyCollection'];constructor(_0x428f28,_0xb2ac5e){super(_0x428f28),this['_bodyCollection']=_0xb2ac5e,this['set']('isPending',!0x1),this['set']('loadingMessage',''),this['set']('isLoadingSkeletonVisible',!0x1),this['set']('isTrackChangesOn',!0x1),this['children']=this['createCollection'](),this['children']['delegate'](...Xs)['to'](this),this['_setupTemplate']();}['render'](){super['render'](),this['scrollManager']=new Xn(this['element']);}['destroy'](){super['destroy'](),this['scrollManager']['destroy']();}['clear'](){this['children']['clear']();}['addItem'](_0x2e9371,_0x456408){let _0x398e7a;return'ai-reply'===_0x2e9371?_0x398e7a=new wn(this['locale'],_0x456408,this['_bodyCollection']):'ai-suggestion-reply'===_0x2e9371?(_0x398e7a=new Cn(this['locale'],_0x456408,this['_bodyCollection']),_0x398e7a['bind']('isTrackChangesOn')['to'](this)):_0x398e7a='user-message'===_0x2e9371?new Wn(this['locale'],_0x456408,this['_bodyCollection']):'interaction-header'===_0x2e9371?new Yn(this['locale'],_0x456408):'custom-element'===_0x2e9371?new Zn(_0x456408):new An(_0x456408),this['children']['add'](_0x398e7a),_0x398e7a;}async['updateReplyItem']({id:_0x36678d,parsedContent:_0x387c0f,renderingStrategy:_0x46f4bd,abortSignal:_0x108401}){const _0x588fa0=this['getItemById'](_0x36678d);if(!(_0x588fa0 instanceof wn))throw new ot('ai-chat-feed-view-item-not-a-reply-item',null,{'itemView':_0x588fa0,'id':_0x36678d,'parsedContent':_0x387c0f});await _0x588fa0['updateContent']({'parsedContent':_0x387c0f,'renderingStrategy':_0x46f4bd,'abortSignal':_0x108401});}async['updateWebSources'](_0x335d1c,_0x8d6cfd){const _0x51eebc=this['getItemById'](_0x335d1c);if(_0x51eebc instanceof Cn)_0x51eebc['updateSources'](_0x8d6cfd);else{if(!(_0x51eebc instanceof wn))throw new ot('ai-chat-feed-view-item-not-a-suggestion-or-reply-item',null,{'itemView':_0x51eebc,'id':_0x335d1c,'sources':_0x8d6cfd});_0x51eebc['updateSources'](_0x8d6cfd);}}async['updateSuggestionItem']({id:_0x1e14a5,parts:_0x565feb,renderingStrategy:_0x4a005d,abortSignal:_0x126e4a}){const _0x36b66f=this['getItemById'](_0x1e14a5);if(!(_0x36b66f instanceof Cn))throw new ot('ai-chat-feed-view-item-not-a-suggestion-item',null,{'itemView':_0x36b66f,'id':_0x1e14a5,'parts':_0x565feb});await _0x36b66f['updateContent']({'parts':_0x565feb,'renderingStrategy':_0x4a005d,'abortSignal':_0x126e4a});}['updateSuggestionPartState']({id:_0x9e4931,index:_0x3a3f92,state:_0x38a4fe}){const _0x598850=this['getItemById'](_0x9e4931);if(!(_0x598850 instanceof Cn))throw new ot('ai-chat-feed-view-item-not-a-suggestion-item',this,{'id':_0x9e4931});_0x598850['updatePartState'](_0x3a3f92,_0x38a4fe);}['setSuggestionPartActive']({id:_0x7627ac,index:_0x4fd2bc,isActive:_0x4c73c8}){const _0x4746d2=this['getItemById'](_0x7627ac);if(!(_0x4746d2 instanceof Cn))throw new ot('ai-chat-feed-view-item-not-a-suggestion-item',this,{'id':_0x7627ac});this['children']['filter'](_0x4dde44=>_0x4dde44 instanceof Cn)['forEach'](_0x27ca0f=>{_0x27ca0f['setPartActive'](!0x1);}),_0x4746d2['setPartActive'](_0x4fd2bc,_0x4c73c8);}['markItemAsDone'](_0x19d70f){this['getItemById'](_0x19d70f)['markAsDone']();}['getItemIds'](){return this['children']['map'](_0x1ee7ff=>_0x1ee7ff['options']['id']);}['removeItem'](_0x4b06ab){this['children']['remove'](this['getItemById'](_0x4b06ab));}['hasItem'](_0x4f87f5){return!!this['children']['find'](_0xe26fcc=>_0xe26fcc['options']['id']['includes'](_0x4f87f5));}['scrollToSuggestion'](_0x18e395,_0x742276){const _0x452125=this['getItemById'](_0x18e395);if(!(_0x452125 instanceof Cn))return void It('ck-ai-chat-feed-view-scroll-to-suggestion-invalid-item',{'replyId':_0x18e395,'partIndex':_0x742276});const _0x11d17e=_0x452125['getPartView'](_0x742276);_0x11d17e?wt(_0x11d17e['element'],0x14,this['element']['parentElement'],!0x0,!0x0):It('ck-ai-chat-feed-view-scroll-to-suggestion-part-view-not-found',{'replyId':_0x18e395,'partIndex':_0x742276});}['_setupTemplate'](){this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed']},'children':this['_createTemplateChildren']()});}['_createTemplateChildren'](){const _0x300834=this['_createSkeletonLoader']();return[this['_createFeedItems'](),_0x300834,this['_createFeedLoader']()];}['_createSkeletonLoader'](){const _0x465bac=new zn(this['locale'],jn['aiFeed']);return _0x465bac['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isLoadingSkeletonVisible','ck-hidden',_0xa79f5f=>!_0xa79f5f)]}}),_0x465bac;}['_createFeedItems'](){const _0x28666c=new Nt(this['locale']);return _0x28666c['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__items',this['bindTemplate']['if']('isLoadingSkeletonVisible','ck-hidden')]},'children':this['children']}),_0x28666c;}['_createFeedLoader'](){const _0x2abee8=new Nt(this['locale']);return _0x2abee8['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__loader',this['bindTemplate']['if']('isPending','ck-hidden',_0x1add62=>!_0x1add62)]},'children':this['_createLoaderChildren']()}),_0x2abee8;}['_createLoaderChildren'](){const _0x423153=new fn();return _0x423153['isVisible']=!0x0,[_0x423153,{'tag':'span','attributes':{'class':['ck','ck-ai-chat__loader-text']},'children':[{'text':this['bindTemplate']['to']('loadingMessage')}]}];}['getItemById'](_0x57ebb4){const _0x5bb48c=this['children']['find'](_0x5cd73d=>_0x5cd73d['options']['id']['includes'](_0x57ebb4));if(!_0x5bb48c)throw new ot('ai-chat-feed-view-item-not-found',this,{'id':_0x57ebb4});return _0x5bb48c;}['setLoadingMessage'](_0x51d941){this['set']('loadingMessage',_0x51d941);}['toggleLoadingSkeleton'](_0x5a63d2){this['set']('isLoadingSkeletonVisible',_0x5a63d2);}['startAutoScroll'](){this['scrollManager']['start']();}['stopAutoScroll'](){this['scrollManager']['stop']();}}class er extends Lt{['filter'](){let _0x3e8063=0x0;for(const _0x1187d6 of this['items'])_0x3e8063+=_0x1187d6['items']['length'];return{'resultsCount':_0x3e8063,'totalItemsCount':_0x3e8063};}}const ir='ck-ai-chat__prompt-input_highlighted';class sr extends xt{['submitButtonView'];static ['MIN_ROWS']=0x1;static ['MAX_ROWS']=0xc;['_addContextButtonView'];['_queryViewResizeObserver'];constructor(_0x1cadb3,_0x7076c8){super(_0x1cadb3,{'queryView':{'label':'','creator':Ut,'showIcon':!0x1,'showResetButton':!0x1},'filteredView':new er(_0x1cadb3),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1}),this['set']('isEmpty',!0x0),this['set']('isUploadInProgress',!0x1),this['_addContextButtonView']=_0x7076c8,this['_queryViewResizeObserver']=null,this['queryView']['fieldView']['minRows']=sr['MIN_ROWS'],this['queryView']['fieldView']['maxRows']=sr['MAX_ROWS'],this['queryView']['fieldWrapperChildren']['add'](this['_addContextButtonView']),this['_setUpAddContextButtonPositioning'](),this['extendTemplate']({'attributes':{'class':['ck','ck-ai-chat__prompt-input']}}),this['submitButtonView']=this['_createSubmitButton'](),this['submitButtonView']['bind']('isEnabled')['to'](this,'isEmpty',this,'isUploadInProgress',(_0x4eb397,_0x5212a4)=>!_0x4eb397&&!_0x5212a4),this['focusableChildren']['add'](this['submitButtonView']);}['render'](){super['render'](),this['queryView']['fieldWrapperChildren']['add'](this['submitButtonView']),this['keystrokes']['set']('enter',(_0x354545,_0x51243e)=>{this['isUploadInProgress']||this['isEmpty']||_0x354545['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0x51243e());}),this['queryView']['fieldView']['on']('update',()=>{this['isEmpty']=''===this['queryView']['fieldView']['element']['value']?.['trim']();});}['destroy'](){super['destroy'](),this['_queryViewResizeObserver']&&this['_queryViewResizeObserver']['destroy']();}['submit'](){const _0x31b26d=this['queryView']['fieldView']['element']['value']?.['trim']();if(!_0x31b26d)return this['queryView']['errorText']=as(this['locale'],'AI_CHAT_PROMPT_EMPTY_ERROR'),void(this['queryView']['fieldView']['hasError']=!0x0);this['queryView']['fieldView']['hasError']=!0x1;const _0x42d91b=_0x276663(_0x31b26d);this['fire']('sendUserMessage',_0x42d91b),this['queryView']['fieldView']['reset']();}['setPlaceholderText'](_0x15b5b6){this['queryView']['fieldView']['set']('placeholder',_0x15b5b6);}['focus'](_0x511965=!0x1){super['focus'](),_0x511965&&(this['element']['classList']['contains'](ir)||(this['element']['classList']['add'](ir),setTimeout(()=>{this['element']['classList']['remove'](ir);},0x320)));}['_createSubmitButton'](){const _0x51fe56=new kt(this['locale']);return _0x51fe56['set']({'icon':_0x2f55c0,'label':as(this['locale'],'AI_CHAT_LABEL_SUBMIT'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-chat__prompt-submit-button\x20'+os,'isEnabled':!0x1}),_0x51fe56['on']('execute',()=>{this['submit']();}),_0x51fe56;}['setIsUploadInProgress'](_0x51f517){this['isUploadInProgress']=_0x51f517;}['_setUpAddContextButtonPositioning'](){const _0x2ebdcf=this['locale'],_0x5ef053=()=>{ct['window']['requestAnimationFrame'](()=>{if(lt(this['element'])){const _0x570a32=new ut(this['queryView']['fieldView']['element']),_0x51aef3=new ut(this['_addContextButtonView']['element']),_0x15099c=_0x570a32['width'],_0x685ffe='rtl'===_0x2ebdcf['uiLanguageDirection']?'right':'left';_0x570a32['excludeScrollbarsAndBorders']();const _0xfdda50=_0x15099c-_0x570a32['width']+0x1;this['_addContextButtonView']['element']['style'][_0x685ffe]='calc('+(_0x15099c-_0x51aef3['width']-_0xfdda50)+'px\x20-\x20var(--ck-spacing-tiny))';}});};this['queryView']['fieldView']['on']('update',_0x5ef053),this['on']('render',()=>{_0x5ef053(),this['_queryViewResizeObserver']=new ft(this['queryView']['fieldView']['element'],()=>{_0x5ef053();});});}}const nr='ck-ai-chat__prompt-capabilities',rr='ck-ai-chat-controls-button',ar='ck-ai-chat-controls-button--commands',or='ck-ai-chat-controls__model-selection',hr='ck-ai-chat-controls__model-selection__item-name',cr='ck-ai-chat-controls__model-selection__item-description',lr='ck-ai-chat-controls__model-selection__item-capabilities',ur='n';class dr extends Nt{['_webSearchButton'];['_reasoningButton'];['_commandsButton'];['_modelSelectionDropdown'];['_modelSelectionDropdownItems'];['_modelNameView'];constructor(_0x2feedd){super(_0x2feedd),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',_0x45f864=>'selector'===_0x45f864),this['_modelSelectionDropdown']['buttonView']['bind']('tooltip')['to'](this,'modelSelectorEnabled',_0x39531b=>_0x39531b?this['_modelSelectionDropdown']['buttonView']['label']:as(this['locale'],'AI_CHAT_MODEL_SELECTOR_DISABLED_TOOLTIP')),this['_modelSelectionDropdown']['bind']('isEnabled')['to'](this,'modelSelectorEnabled',_0x33f1b5=>_0x33f1b5),this['_webSearchButton']['bind']('isOn')['to'](this,'webSearchActive',_0x15ccc3=>_0x15ccc3),this['_webSearchButton']['bind']('tooltip')['to'](this,'webSearchActive',_0x451dcb=>as(this['locale'],_0x451dcb?'AI_CHAT_DISABLE_WEB_SEARCH':'AI_CHAT_ENABLE_WEB_SEARCH')),this['_reasoningButton']['bind']('isOn')['to'](this,'reasoningActive',_0x23560b=>_0x23560b),this['_reasoningButton']['bind']('tooltip')['to'](this,'reasoningActive',_0x4476ec=>as(this['locale'],_0x4476ec?'AI_CHAT_DISABLE_REASONING':'AI_CHAT_ENABLE_REASONING')),this['setTemplate']({'tag':'div','attributes':{'class':[nr]},'children':[this['_modelSelectionDropdown'],this['_modelNameView'],this['_webSearchButton'],this['_reasoningButton'],this['_commandsButton']]}),this['_modelSelectionDropdownItems']=new dt(),zt(this['_modelSelectionDropdown'],this['_modelSelectionDropdownItems']);}['setModelList'](_0x3672c1,_0x1eced2){if(_0x1eced2)this['set']('modelDisplayMode','hidden');else{const _0x3c79e1=0x1===_0x3672c1['length'];this['set']('modelDisplayMode',_0x3c79e1?'name':'selector');}if(this['_modelSelectionDropdownItems']['clear'](),_0x3672c1?.['length'])for(const _0xb4579b of _0x3672c1){const _0x1ba118=new jt({'label':_0xb4579b['name'],'withText':!0x0,'role':'menuitemradio','id':_0xb4579b['id'],'model':_0xb4579b});_0x1ba118['bind']('isOn')['to'](this,'activeModelId',_0xfbab7d=>_0xfbab7d===_0xb4579b['id']),this['_modelSelectionDropdownItems']['add']({'type':'button','model':_0x1ba118,'labelView':new _r(this['locale'],_0xb4579b)});}}['setWebSearch'](_0x41e38f){this['set']('webSearchActive',_0x41e38f);}['setReasoning'](_0x34f554){this['set']('reasoningActive',_0x34f554);}['setModel'](_0x831f44){if(!_0x831f44)return;this['activeModelId']=_0x831f44['id'],this['activeModelName']=_0x831f44['name']||_0x831f44['id'],this['_modelSelectionDropdown']['buttonView']['set']('label',_0x831f44['name']),this['_modelSelectionDropdown']['buttonView']['set']('tooltip',_0x831f44['name']);const _0x1e42cb=_0x831f44['capabilities']['webSearch']?.['enabled']??!0x1;this['set']('webSearchActive',!0x1),this['_webSearchButton']['set']('isOn',!0x1),this['_webSearchButton']['set']('isEnabled',_0x1e42cb),this['_webSearchButton']['set']('isVisible',_0x1e42cb);const _0x15520a=_0x831f44['capabilities']['reasoning']?.['enabled']??!0x1;this['set']('reasoningActive',!0x1),this['_reasoningButton']['set']('isOn',!0x1),this['_reasoningButton']['set']('isEnabled',_0x15520a),this['_reasoningButton']['set']('isVisible',_0x15520a);}['enableModelSelector'](){this['set']('modelSelectorEnabled',!0x0);}['disableModelSelector'](_0x212252){this['set']('modelSelectorEnabled',!0x1),_0x212252&&this['set']('modelDisplayMode','hidden');}['_createWebSearchButton'](){const _0x33b7d3=new kt();return _0x33b7d3['set']({'label':as(this['locale'],'AI_CHAT_SEARCH_WEB'),'icon':_0x12d01f,'class':rr+'\x20'+cs,'isToggleable':!0x0,'tooltipPosition':ur}),_0x33b7d3['on']('execute',()=>{this['fire']('toggleWebSearch');}),_0x33b7d3;}['_createReasoningButton'](){const _0x594293=new kt();return _0x594293['set']({'label':as(this['locale'],'AI_CHAT_REASONING'),'icon':_0x1c694e,'class':rr+'\x20'+cs,'isToggleable':!0x0,'tooltipPosition':ur}),_0x594293['on']('execute',()=>{this['fire']('toggleReasoning');}),_0x594293;}['_createCommandsButton'](){const _0xc9eba9=new kt();return _0xc9eba9['set']({'label':as(this['locale'],'AI_CHAT_COMMANDS'),'icon':_0x5ebaaf,'withText':!0x0,'class':rr+'\x20'+cs,'isToggleable':!0x0,'tooltip':as(this['locale'],'AI_CHAT_COMMANDS'),'tooltipPosition':ur}),_0xc9eba9['extendTemplate']({'attributes':{'class':[ar]}}),_0xc9eba9['on']('execute',()=>{console['log']('Commands\x20are\x20not\x20implemented\x20yet.'),alert('Commands\x20are\x20not\x20implemented\x20yet.');}),_0xc9eba9;}['_createModelSelectionDropdown'](){const _0x383a25=Bt(this['locale']);return _0x383a25['set']({'panelPosition':'ne','class':[or]}),_0x383a25['buttonView']['set']({'label':as(this['locale'],'AI_CHAT_MODEL_SELECTOR_ENABLED_TOOLTIP'),'withText':!0x0,'tooltip':!0x0,'tooltipPosition':ur,'class':cs}),this['listenTo'](_0x383a25,'execute',_0x1e5676=>{this['fire']('selectModel',_0x1e5676['source']['model']);}),_0x383a25;}['_createModelNameView'](){const _0x34833d=new Ar(this['locale']);return _0x34833d['bind']('text')['to'](this,'activeModelName',_0x256860=>_0x256860??''),_0x34833d['bind']('isVisible')['to'](this,'modelDisplayMode',_0x566f2d=>'name'===_0x566f2d),_0x34833d;}}let _r=class extends Ht{constructor(_0x198d7b,_0x213747){super();const _0x32ac0a=this['bindTemplate'],_0x4f5c27=this['createCollection']();this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-button__label'],'style':_0x32ac0a['to']('style'),'id':_0x32ac0a['to']('id')},'children':[{'tag':'div','attributes':{'class':[hr]},'children':[{'text':_0x32ac0a['to']('text')}]},{'tag':'div','attributes':{'class':[cr]},'children':[{'tag':'span','children':[{'text':_0x213747['description']}]}]},{'tag':'div','attributes':{'class':[lr]},'children':_0x4f5c27}]}),_0x4f5c27['addMany'](this['_getCapabilityParts'](_0x198d7b,_0x12d01f,'AI_CHAT_SEARCH_WEB',_0x213747['capabilities']['webSearch']?.['enabled']??!0x1)),_0x4f5c27['addMany'](this['_getCapabilityParts'](_0x198d7b,_0x1c694e,'AI_CHAT_REASONING',_0x213747['capabilities']['reasoning']?.['enabled']??!0x1));}['_getCapabilityParts'](_0x538990,_0x2e264b,_0x220c27,_0x2886ef){const _0x27103c=new yt();_0x27103c['content']=_0x2e264b;const _0x46b3aa=new Nt(_0x538990);_0x46b3aa['setTemplate']({'tag':'span','children':[{'text':as(_0x538990,_0x220c27)+':\x20'}]});const _0x227425=new Nt(_0x538990);return _0x227425['setTemplate']({'tag':'span','children':[{'text':as(_0x538990,_0x2886ef?'AI_CHAT_CAPABILITIES_YES':'AI_CHAT_CAPABILITIES_NO')}]}),[_0x27103c,_0x46b3aa,_0x227425];}},Ar=class extends Nt{constructor(_0x5d33d5){super(_0x5d33d5),this['set']('text',void 0x0),this['set']('isVisible',!0x0);const _0x16f717=this['bindTemplate'];this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-chat-controls__model-name',_0x16f717['if']('isVisible','ck-hidden',_0x177fdd=>!_0x177fdd)]},'children':[{'text':_0x16f717['to']('text')}]});}};const gr='ck-ai-chat-context-controls__url-form',Ir='ck-ai-chat-context-controls__url-input-section';class Er extends Nt{['focusTracker'];['keystrokes'];['_focusables'];['focusCycler'];['urlInputField'];['backButton'];['confirmButton'];constructor(_0x300354){super(_0x300354),this['focusTracker']=new _t(),this['keystrokes']=new At(),this['backButton']=this['_createBackButton'](),this['urlInputField']=this['_createUrlInputField'](),this['confirmButton']=this['_createConfirmButton'](),this['_focusables']=this['createCollection']([this['backButton'],this['urlInputField'],this['confirmButton']]),this['focusCycler']=new Mt({'focusables':this['_focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes'],'actions':{'focusPrevious':'shift+tab','focusNext':'tab'}}),this['set']('withBackButton',!0x0),this['_setupTemplate'](),this['_setupEventHandlers'](),this['_setupKeystrokes']();}['render'](){super['render'](),this['_focusables']['forEach'](_0x464e0c=>{this['focusTracker']['add'](_0x464e0c['element']),this['keystrokes']['listenTo'](_0x464e0c['element']);}),Jt({'view':this}),this['focus']();}['destroy'](){super['destroy'](),this['focusTracker']['destroy'](),this['keystrokes']['destroy']();}['focus'](){this['urlInputField']['focus']();}['getValue'](){return this['urlInputField']['fieldView']['element']?.['value']?.['trim']()||'';}['clear'](){this['urlInputField']['fieldView']['element']['value']='',this['urlInputField']['errorText']=null,this['confirmButton']['isEnabled']=!0x1;}['setError'](_0x4c9a79){this['urlInputField']['errorText']=_0x4c9a79,this['_updateConfirmButtonState'](),this['fire']('refreshBalloon');}['clearError'](){this['urlInputField']['errorText']=null,this['_updateConfirmButtonState']();}['_createBackButton'](){const _0x188a22=new kt(this['locale']);return _0x188a22['set']({'icon':_0x3429b1,'tooltip':as(this['locale'],'AI_CHAT_CONTEXT_URL_BACK_TO_CONTEXT'),'tooltipPosition':'n','class':['ck-button-icon\x20ck-button-back']}),this['on']('change:withBackButton',(_0x34a8d1,_0x18a4a0,_0x2813a2)=>{_0x188a22['set']({'class':['ck-button-icon\x20ck-button-back'+(_0x2813a2?'':'\x20ck-hidden')]});}),_0x188a22;}['_createUrlInputField'](){const _0x340525=new Zt(this['locale'],te);return _0x340525['set']({'label':as(this['locale'],'AI_CHAT_CONTEXT_URL_LABEL'),'class':'ck-labeled-field-view_empty'}),_0x340525['fieldView']['set']({'placeholder':as(this['locale'],'AI_CHAT_CONTEXT_URL_PLACEHOLDER')}),_0x340525;}['_createConfirmButton'](){const _0x3e218c=new kt(this['locale']);return _0x3e218c['set']({'icon':_0x2bffb7,'tooltip':as(this['locale'],'AI_CHAT_CONTEXT_URL_ADD_URL'),'tooltipPosition':'n','class':'ck-button-icon','type':'submit','isEnabled':!0x1}),_0x3e218c;}['_setupTemplate'](){const _0xdc829b=new _0x1d57fa(this['locale'],{'label':as(this['locale'],'AI_CHAT_CONTEXT_URL_ADD_URL'),'class':'ck-ai-header\x20ck-ai-header_small\x20ck-ai-header_context-url'});_0xdc829b['children']['add'](this['backButton'],0x0),this['setTemplate']({'tag':'form','attributes':{'class':gr,'tabindex':'-1'},'children':[_0xdc829b,{'tag':'div','attributes':{'class':Ir},'children':[this['urlInputField'],this['confirmButton']]}]});}['_setupEventHandlers'](){this['backButton']['on']('execute',()=>{this['clear'](),this['fire']('cancel');}),this['urlInputField']['fieldView']['on']('input',()=>{this['clearError'](),this['_updateConfirmButtonState'](),this['fire']('refreshBalloon');}),this['on']('submit',_0x1617ef=>{_0x1617ef['stop'](),this['_handleSubmit']();});}['_setupKeystrokes'](){this['keystrokes']['set']('esc',(_0x388425,_0x2ffa32)=>{this['clear'](),this['fire']('cancel'),_0x2ffa32();});}['_handleSubmit'](){const _0x20c6ef=this['getValue']()['trim']();_0x20c6ef?this['_isValidUrl'](_0x20c6ef)?(this['clearError'](),this['fire']('submitUrl',_0x20c6ef)):this['setError'](as(this['locale'],'AI_CHAT_CONTEXT_URL_INVALID_ERROR')):this['setError'](as(this['locale'],'AI_CHAT_CONTEXT_URL_EMPTY_ERROR'));}['_updateConfirmButtonState'](){const _0x5dfe4d=this['getValue']()['trim'](),_0xad3d4c=!!this['urlInputField']['errorText'];this['confirmButton']['isEnabled']=_0x5dfe4d['length']>0x0&&!_0xad3d4c;}['_isValidUrl'](_0x43ce93){try{return!!new URL(_0x43ce93);}catch{return!0x1;}}}const Tr='ck-ai-chat-resources__item',pr='ck-ai-chat-resources__item--in-context',mr='ck-ai-chat-resources__item-title',Cr='ck-ai-chat-resources__item__icon';class wr extends Pt{['resource'];['_titleView'];['_iconView'];constructor(_0x5256b4,_0x514536){super(_0x5256b4),this['resource']=_0x514536,this['set']('isInContext',!!_0x514536['isInContext']),this['_titleView']=this['_createTitleView'](),this['_iconView']=this['_createIconView'](),this['_setupTemplate']();}['render'](){super['render']();}['getResourceIcon'](_0x9b03c1){if(_0x9b03c1['isInContext'])return _0x2bffb7;switch(_0x9b03c1['type']){case'document':return _0x4dad6b;case'web-resource':return _0x108376;case'file':case'text':return _0x467af8;default:return _0x123b6a;}}['highlightText'](_0x2075d9){if(!_0x2075d9||''===_0x2075d9['trim']())return void this['_titleView']['highlightText'](null);const _0x220899=new RegExp(_0x8cdac(_0x2075d9),'gi');this['_titleView']['highlightText'](_0x220899);}['updateResourceState'](_0x133f7c){this['resource']['isInContext']=_0x133f7c,this['isInContext']=_0x133f7c,this['_updateIcon']();}['_createTitleView'](){const _0x59c696=new _0x18e9fc();return _0x59c696['text']=this['resource']['label'],_0x59c696['extendTemplate']({'tag':'span','attributes':{'class':[mr]}}),_0x59c696;}['_createIconView'](){const _0x4e8816=new yt();return _0x4e8816['content']=this['getResourceIcon'](this['resource']),_0x4e8816;}['_setupTemplate'](){const _0xe01710=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':[Tr,_0xe01710['if']('isVisible','ck-hidden',_0x155edb=>!_0x155edb),_0xe01710['if']('isInContext',pr)]},'children':[{'tag':'div','attributes':{'class':[Cr]},'children':[this['_iconView']]},this['_titleView']],'on':{'click':_0xe01710['to']('execute')}});}['_updateIcon'](){this['_iconView']['content']=this['getResourceIcon'](this['resource']);}}const fr='ck-ai-chat-resources__list';class Sr extends Lt{['_source'];constructor(_0x39ebef,_0x15aaa4){super(_0x39ebef),this['_source']=_0x15aaa4,this['extendTemplate']({'attributes':{'class':[fr]}});}['setResources'](_0x419ee0,_0x1e8641){this['items']['clear']();let _0x1f3ba2=_0x419ee0;if(this['_source']['useDefaultFiltering']&&_0x1e8641&&''!==_0x1e8641['trim']()){const _0x527762=new RegExp(_0x1e8641['replace'](/[.*+?^${}()|[\]\\]/g,'\x5c$&'),'gi');_0x1f3ba2=_0x419ee0['filter'](_0x1ad777=>_0x527762['test'](_0x1ad777['label']));}for(const _0x7799b9 of _0x1f3ba2){const _0x28a25f=new wr(this['locale'],_0x7799b9);_0x28a25f['on']('execute',()=>{this['_handleResourceSelection'](this['_source'],_0x7799b9);}),this['items']['add'](_0x28a25f);}this['_source']['useDefaultFiltering']&&this['highlightText'](_0x1e8641);}['highlightText'](_0x2cf017){this['_source']['useDefaultFiltering']&&this['items']['forEach'](_0x5ed95a=>{_0x5ed95a['highlightText'](_0x2cf017);});}['updateResourceState'](_0xe8dff9,_0xae52a0){for(const _0x3f3666 of this['items']){const _0x5d18dd=_0x3f3666;_0x5d18dd['resource']['id']===_0xe8dff9&&_0x5d18dd['updateResourceState'](_0xae52a0);}}['_handleResourceSelection'](_0x81c63e,_0x571a95){this['fire']('addResourceToContext',{'source':_0x81c63e,'resource':_0x571a95});}}class br extends Zt{['iconView'];['resetButtonView'];['_viewConfig'];constructor(_0x51f514){const t=_0x51f514['t'],_0x546d57={'showResetButton':!0x0,'showIcon':!0x0,'creator':te,'label':as(_0x51f514,'AI_CHAT_SEARCH_RESOURCES')};super(_0x51f514,_0x546d57['creator']),this['label']=_0x546d57['label'],this['_viewConfig']=_0x546d57,this['_viewConfig']['showIcon']&&this['_setupSearchIcon'](),this['_viewConfig']['showResetButton']&&this['_setupResetButton'](_0x51f514,t),this['_setupEventListeners']();}['reset'](){this['fieldView']['reset'](),this['_viewConfig']['showResetButton']&&this['resetButtonView']&&(this['resetButtonView']['isVisible']=!0x1),this['search']('');}['search'](_0x671ec5){this['fire']('search',_0x671ec5);}['getQuery'](){return this['fieldView']['element']?.['value']||'';}['_setupSearchIcon'](){this['iconView']=new yt(),this['iconView']['content']=_0x5e42ce,this['fieldWrapperChildren']['add'](this['iconView'],0x0),this['extendTemplate']({'attributes':{'class':'ck-search__query_with-icon'}});}['_setupResetButton'](_0x33ae62,t){this['resetButtonView']=new kt(_0x33ae62),this['resetButtonView']['set']({'label':t('Clear'),'icon':_0x101f07,'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',_0x363c5c=>!_0x363c5c),this['fieldWrapperChildren']['add'](this['resetButtonView']),this['extendTemplate']({'attributes':{'class':'ck-search__query_with-reset'}});}['_setupEventListeners'](){this['listenTo'](this['fieldView'],'input',()=>{this['search'](this['fieldView']['element']['value']);}),this['bind']('isEnabled')['to'](this);}}class Rr extends Nt{['_searchView'];['_searchSection'];['_searchInputVisibleFrom'];['_resourcesListView'];['_skeletonLoader'];['_source'];['children'];['_latestLoadResourcesUid']=null;constructor(_0x5a51ab,_0x2830c5){super(_0x5a51ab),this['_source']=_0x2830c5['source'],this['_searchInputVisibleFrom']=_0x2830c5['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 _0x1898c2([this['_skeletonLoader'],this['_resourcesListView']]),this['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-chat-resources'},'children':this['children']});}['_createSearchView'](){return new br(this['locale']);}['_createSearchSection'](){const _0x5179ea=new Nt(this['locale']);return _0x5179ea['setTemplate']({'tag':'div','attributes':{'class':'ck\x20ck-search'},'children':[this['_searchView']]}),this['_searchView']['on']('search',(_0x1db1a1,_0xb27f81)=>{this['loadResources'](_0xb27f81),this['_source']['useDefaultFiltering']&&this['_resourcesListView']['highlightText'](_0xb27f81);}),_0x5179ea;}['_createResourcesListView'](){const _0x337255=new Sr(this['locale'],this['_source']);return _0x337255['delegate']('addResourceToContext')['to'](this),_0x337255['extendTemplate']({'attributes':{'class':this['bindTemplate']['if']('isLoading','ck-hidden')}}),_0x337255;}['_createSkeletonView'](){const _0x4a0294=new zn(this['locale'],jn['aiChatResources']);return _0x4a0294['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isLoading','ck-hidden',_0x3323c1=>!_0x3323c1)]}}),_0x4a0294;}['render'](){super['render'](),this['loadResources']('');}['loadResources'](_0x25f778){const _0x11150e=at();this['_latestLoadResourcesUid']=_0x11150e,this['fire']('loadSourceResources',{'sourceId':this['_source']['id'],'query':_0x25f778,'uid':_0x11150e}),this['isLoading']=!0x0;}['setResources'](_0xc93481,_0x1fcfe1){if(_0x1fcfe1&&_0x1fcfe1!==this['_latestLoadResourcesUid'])return;const _0x1a6a42=this['_source']['useDefaultFiltering']?this['_searchView']['getQuery']():'';this['_resourcesListView']['setResources'](_0xc93481,_0x1a6a42),_0xc93481['length']>=this['_searchInputVisibleFrom']&&!this['children']['has'](this['_searchSection'])&&this['children']['add'](this['_searchSection'],0x0),requestAnimationFrame(()=>{this['isLoading']=!0x1;});}['updateResourceState'](_0x5b7994,_0x498e3a){this['_resourcesListView']['updateResourceState'](_0x5b7994,_0x498e3a);}}const Or='ck-ai-chat-context-controls__source-balloon-panel',kr='ck-button-icon\x20ck-button-back',Nr='ck-ai-header\x20ck-ai-header_small\x20ck-ai-header_source';class vr{['_sourceResourceBalloons']=new Map();['_bodyCollection'];['_locale'];['_config'];constructor(_0xa652de,_0x16a3ae,_0xa9591){this['_locale']=_0xa652de,this['_bodyCollection']=_0x16a3ae,this['_config']=_0xa9591;}['showSourceResourcesBalloon']({source:_0x11a46c,withBackButton:_0x3f9ff9}){let _0x2631cc=this['_sourceResourceBalloons']['get'](_0x11a46c['id']);_0x2631cc||(_0x2631cc=this['_createSourceResourceBalloonPanel'](),this['_sourceResourceBalloons']['set'](_0x11a46c['id'],_0x2631cc),this['_setupSingleResourceBalloonClickOutsideHandler'](_0x2631cc)),this['_addSourceResourceContent']({'balloonPanel':_0x2631cc,'source':_0x11a46c,'withBackButton':_0x3f9ff9}),_0x2631cc['show']();const _0x15fedd=this['_config']['getTargetElement']();_0x15fedd&&_0x2631cc['pin']({'target':_0x15fedd,'limiter':this['_config']['getLimiterElement']()});}['populateSourceResourceBalloon'](_0x4c87cc,_0xf9001d,_0xc85cd7){const _0x1dd894=this['_sourceResourceBalloons']['get'](_0x4c87cc);if(!_0x1dd894)return;const _0x379d54=this['_getResourcesViewFromBalloon'](_0x1dd894);_0x379d54&&(_0x379d54['setResources'](_0xf9001d,_0xc85cd7),_0x379d54['once']('change:isLoading',()=>{_0x1dd894['pin']({'target':this['_config']['getTargetElement'](),'limiter':this['_config']['getLimiterElement']()});}));}['closeSourceResourceBalloon'](_0x5ec9f6){const _0x3a552d=this['_sourceResourceBalloons']['get'](_0x5ec9f6);_0x3a552d&&requestAnimationFrame(()=>{_0x3a552d['hide'](),this['_sourceResourceBalloons']['delete'](_0x5ec9f6),this['_config']['onBalloonClosed']();});}['isAnyResourceBalloonVisible'](){for(const _0xdb6cc2 of this['_sourceResourceBalloons']['values']())if(_0xdb6cc2['isVisible'])return!0x0;return!0x1;}['updateResourceState'](_0x2847d3,_0xa77c1a,_0x3e7e80){const _0x33c6ca=this['_sourceResourceBalloons']['get'](_0x2847d3);if(!_0x33c6ca||!_0x33c6ca['isVisible'])return;const _0x4f0040=this['_config']['getTargetElement']();if(!_0x4f0040)return;_0x33c6ca['pin']({'target':_0x4f0040,'limiter':this['_config']['getLimiterElement']()});const _0x5a374e=this['_getResourcesViewFromBalloon'](_0x33c6ca);_0x5a374e&&_0x5a374e['updateResourceState'](_0xa77c1a,_0x3e7e80);}['destroy'](){for(const _0x1f5016 of this['_sourceResourceBalloons']['values']())_0x1f5016['destroy']();this['_sourceResourceBalloons']['clear']();}['_createSourceResourceBalloonPanel'](){const _0x97e82f=new Qt(this['_locale']);return _0x97e82f['extendTemplate']({'attributes':{'class':Or}}),this['_bodyCollection']['add'](_0x97e82f),_0x97e82f;}['_addSourceResourceContent']({balloonPanel:_0x451d9c,source:_0x46be1a,withBackButton:_0x450a8e}){_0x451d9c['content']['clear']();const _0x211ae=this['_createBalloonHeader']({'balloonPanel':_0x451d9c,'source':_0x46be1a,'withBackButton':_0x450a8e});_0x451d9c['content']['add'](_0x211ae);const _0x1e502d=this['_createBalloonResourcesView'](_0x46be1a);_0x451d9c['content']['add'](_0x1e502d);}['_createBalloonHeader']({balloonPanel:_0x2348b3,source:_0x34b9ff,withBackButton:_0x169138}){const _0x349315=new _0x1d57fa(this['_locale'],{'label':_0x34b9ff['label'],'class':Nr});return _0x169138&&_0x349315['children']['add'](this['_createBackButton'](_0x2348b3),0x0),_0x349315;}['_createBackButton'](_0x406ba7){const _0x411ef7=new kt(this['_locale']);return _0x411ef7['set']({'icon':_0x3429b1,'tooltip':as(this['_locale'],'AI_CHAT_CONTEXT_URL_BACK_TO_CONTEXT'),'tooltipPosition':'n','class':kr}),_0x411ef7['on']('execute',()=>{_0x406ba7['hide'](),this['_config']['onBackToContext']();}),_0x411ef7;}['_createBalloonResourcesView'](_0x6c6057){const _0x5064ff=new Rr(this['_locale'],{'source':_0x6c6057,'searchInputVisibleFrom':this['_config']['searchInputVisibleFrom']});return _0x5064ff['on']('loadSourceResources',(_0x3aeb34,_0x4105a9)=>{this['_config']['onLoadSourceResources'](_0x4105a9);}),_0x5064ff['on']('addResourceToContext',(_0x54a54e,_0x18daf0)=>{this['_config']['onResourceSelected'](_0x18daf0['source'],_0x18daf0['resource']),this['closeSourceResourceBalloon'](_0x6c6057['id']);}),_0x5064ff;}['_getResourcesViewFromBalloon'](_0x118ff2){const _0xf9fe2b=_0x118ff2['content']['get'](0x1);return _0xf9fe2b instanceof Rr?_0xf9fe2b:null;}['_setupSingleResourceBalloonClickOutsideHandler'](_0x530a63){Xt({'emitter':_0x530a63,'contextElements':[_0x530a63['element']],'callback':()=>{_0x530a63['hide'](),this['_config']['onBalloonClosed']();},'activator':()=>_0x530a63['isVisible']});}}const yr=['addDocumentToContext','addFileToContext','addUrlToContext','addResourceToContext','removeContextItem','loadSourceResources','executeCustomItemCallback'],xr='ck-ai-chat-context-controls',Lr='ck-ai-chat-context-controls__pending-contexts',Dr='ck-ai-chat-context-controls__add-context-balloon-panel',Pr='ck-ai-chat-context-controls__add-context-button',Hr='ck-ai-chat-context-controls__url-balloon-panel',Mr='ck-ai-chat-context-controls__balloon-button',Ur='ck-ai-chat-context-controls__balloon-button-source',Vr='ck-ai-chat-controls-button',Br='ck-ai-chat-context-chips-wrapper-balloon',Gr='ck-ai-chat-controls_context_show-more-button',Fr='ck-ai-chat-context-controls__show-more-balloon-panel',Kr='ck-ai-chat',Wr=[Qt['defaultPositions']['northArrowSouthWest'],Qt['defaultPositions']['northArrowSouth'],Qt['defaultPositions']['northArrowSouthEast'],Qt['defaultPositions']['southArrowNorthWest'],Qt['defaultPositions']['southArrowNorth'],Qt['defaultPositions']['southArrowNorthEast']];class Yr extends Nt{['addContextButtonView'];['_currentContextsChips']=this['createCollection']();['_conversationContextsChips']=this['createCollection']();['_overflowManager'];['_addContextBalloonPanelView'];['_urlBalloonPanelView'];['_urlInputView'];['_resourcesBalloonView'];['_addContextBalloonConfig'];['_hasExactlyOneSource']=!0x1;['bodyCollection'];constructor(_0x21caed,_0x3d57fa){super(_0x21caed),this['bodyCollection']=_0x3d57fa['bodyCollection'],this['_currentContextsChips']=this['createCollection'](),this['_conversationContextsChips']=this['createCollection'](),this['addContextButtonView']=this['_createAddContextButtonView'](_0x21caed),this['_addContextBalloonPanelView']=this['_createAddContextBalloonPanelView'](_0x21caed),this['_urlBalloonPanelView']=this['_createUrlBalloonPanelView'](_0x21caed),this['_resourcesBalloonView']=this['_createResourcesBalloonView'](_0x21caed,_0x3d57fa);const _0x27bebd={'cssClasses':{'showMoreButton':Gr+'\x20'+cs,'showMoreBalloon':Fr,'overflowContainer':Br,'controlsButton':Vr}};this['_overflowManager']=new Hn(_0x21caed,this['_currentContextsChips'],_0x27bebd,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'](_0x5123dd,_0x385159){const _0x5c2e60=this['_createContextButton'](_0x5123dd,'current',!0x0,_0x385159);this['_addContextToCollection'](_0x5c2e60,this['_currentContextsChips']),this['_overflowManager']['reorganizeChips']();}['removeContextItem'](_0xeb863c){this['_removeContextFromCollection'](_0xeb863c,this['_currentContextsChips']),this['_removeContextFromCollection'](_0xeb863c,this['_overflowManager']['overflowChips']),this['_overflowManager']['reorganizeChips']();}['setContextItemLoading'](_0x3a7da2,_0x5a8e1b){let _0x7a6577=this['_currentContextsChips']['find'](_0xc837df=>_0xc837df['id']===_0x3a7da2);_0x7a6577||(_0x7a6577=this['_overflowManager']['overflowChips']['find'](_0x1e9def=>_0x1e9def['id']===_0x3a7da2)),_0x7a6577&&(_0x7a6577['isLoading']=_0x5a8e1b);}['setConversationContext'](_0x4bbee8){this['_conversationContextsChips']['clear']();for(const _0x3de680 of _0x4bbee8){const _0x24fb60=this['_createContextButton'](_0x3de680,'conversation',!0x1,!0x1);this['_addContextToCollection'](_0x24fb60,this['_conversationContextsChips']);}}['clearCurrentContextItems'](){this['_currentContextsChips']['clear'](),this['_overflowManager']['clear']();}['clearConversationContextItems'](){this['_conversationContextsChips']['clear']();}['updateResourceState'](_0x1b94fd,_0x43154c,_0x300f35){this['_resourcesBalloonView']['updateResourceState'](_0x1b94fd,_0x43154c,_0x300f35);}['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:_0x38d13f,withBackButton:_0x3c15c1}){this['_resourcesBalloonView']['showSourceResourcesBalloon']({'source':_0x38d13f,'withBackButton':_0x3c15c1}),this['addContextButtonView']['isOn']=!0x0;}['populateSourceResourceBalloon'](_0x28bf41,_0x1cb6ce,_0x4f6bdc,_0x507c48){this['_resourcesBalloonView']['populateSourceResourceBalloon'](_0x28bf41,_0x4f6bdc,_0x507c48);}['closeSourceResourceBalloon'](_0x2fbb95){this['_resourcesBalloonView']['closeSourceResourceBalloon'](_0x2fbb95),this['addContextButtonView']['isOn']=!0x1;}['setAddContextOptions'](_0xb79019){this['_setBalloonPanelContent'](this['_addContextBalloonPanelView'],this['locale'],_0xb79019),this['_setAddContextButtonEnabled'](_0xb79019);}['_setAddContextButtonEnabled'](_0x176d48){const _0x2cef85=!_0x176d48['document']['isHidden']&&_0x176d48['document']['enabled'],_0x408f27=_0x176d48['urls']['enabled'],_0x5962b7=_0x176d48['files']['enabled'],_0x596b94=_0x176d48['sources']['length']>0x0,_0x550fde=_0x176d48['customItems']&&_0x176d48['customItems']['length']>0x0;this['addContextButtonView']['isEnabled']=_0x2cef85||_0x408f27||_0x5962b7||_0x596b94||_0x550fde;}['_setupTemplate'](){this['setTemplate']({'tag':'div','attributes':{'class':[xr,'ck-reset_all-excluded']},'children':[{'tag':'div','attributes':{'class':Lr},'children':this['_currentContextsChips']}]});}['_bindEventHandlers'](){this['addContextButtonView']['on']('execute',()=>{this['_handleAddContextButtonClick']();});}['_createAddContextButtonView'](_0x50253b){const _0x4746a7=new kt(_0x50253b);return _0x4746a7['set']({'label':as(_0x50253b,'AI_CHAT_CONTEXT_ADD_CONTEXT'),'class':Vr+'\x20'+Pr+'\x20'+cs,'icon':_0x481b9b,'isToggleable':!0x0,'tooltip':!0x0,'tooltipPosition':'sw'}),_0x4746a7;}['_createAddContextBalloonPanelView'](_0x24b5bb){return this['_createBaseBalloonPanel'](_0x24b5bb,Dr);}['_createUrlBalloonPanelView'](_0x2aead1){const _0x18a30d=this['_createBaseBalloonPanel'](_0x2aead1,Hr);return this['_addUrlContent'](_0x18a30d,_0x2aead1),_0x18a30d;}['_createResourcesBalloonView'](_0xc0d087,_0x1e3550){const _0x36a822={'searchInputVisibleFrom':_0x1e3550['searchInputVisibleFrom'],'onBackToContext':()=>{this['showAddContextBalloonPanel'](),this['_addContextBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':Wr});},'onResourceSelected':(_0x26c9fd,_0x2d490c)=>{this['fire']('addResourceToContext',{'source':_0x26c9fd,'resource':_0x2d490c});},'onLoadSourceResources':_0x4da273=>{this['fire']('loadSourceResources',_0x4da273);},'onBalloonClosed':()=>{this['addContextButtonView']['isOn']=!0x1;},'getLimiterElement':()=>this['_getLimiterElement'](),'getTargetElement':()=>this['addContextButtonView']['element']};return new vr(_0xc0d087,_0x1e3550['bodyCollection'],_0x36a822);}['_getLimiterElement'](){return this['element']?.['closest']('.'+Kr)||document['body'];}['_createBaseBalloonPanel'](_0x19d100,_0xd36aed){const _0x58e9a1=new Qt(_0x19d100);return _0x58e9a1['extendTemplate']({'attributes':{'class':_0xd36aed}}),this['bodyCollection']['add'](_0x58e9a1),_0x58e9a1;}['_setBalloonPanelContent'](_0x5b9e73,_0xa5bd2b,_0x80978c){if(_0x5b9e73['content']['clear'](),!_0x80978c['document']['isHidden']&&_0x80978c['document']['enabled']){const _0x283240=this['_createBalloonButton'](_0xa5bd2b,{'label':as(_0xa5bd2b,'AI_CHAT_CONTEXT_CURRENT_DOCUMENT'),'icon':_0x4dad6b});_0x283240['on']('execute',()=>{this['fire']('addDocumentToContext'),this['hideAddContextBalloonPanel']();}),_0x5b9e73['content']['add'](_0x283240);}if(_0x80978c['urls']['enabled']){const _0x151a60=this['_createBalloonButton'](_0xa5bd2b,{'label':as(_0xa5bd2b,'AI_CHAT_CONTEXT_URL_LABEL'),'icon':_0x108376});_0x151a60['on']('execute',()=>{this['hideAddContextBalloonPanel'](),this['showUrlBalloonPanel'](),this['_urlBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':Wr}),this['_urlInputView']['focus']();}),_0x5b9e73['content']['add'](_0x151a60);}if(_0x80978c['files']['enabled']){const _0x123f57=new _0x10113d(_0xa5bd2b);_0x123f57['set']({'label':as(_0xa5bd2b,'AI_CHAT_CONTEXT_FILE_LABEL'),'icon':_0x50a9f0,'withText':!0x0,'tooltip':!0x0,'class':Mr,'allowMultipleFiles':!0x0}),_0x123f57['on']('execute',()=>{this['hideAddContextBalloonPanel']();}),_0x123f57['on']('done',(_0x2a55f9,_0x3d7244)=>{this['fire']('addFileToContext',_0x3d7244);}),_0x123f57['tooltip']=!0x0,_0x5b9e73['content']['add'](_0x123f57);}for(const _0x24efc9 of _0x80978c['sources']){const _0x44cc61=this['_createBalloonButton'](_0xa5bd2b,{'label':_0x24efc9['label'],'icon':_0x24efc9['icon']||_0x123b6a,'type':'source'});_0x5b9e73['content']['add'](_0x44cc61),_0x44cc61['on']('execute',()=>{this['hideAddContextBalloonPanel'](),this['_showSourceResourcesBalloon']({'source':_0x24efc9,'withBackButton':!this['_hasExactlyOneSource']});});}for(const _0x1dc792 of _0x80978c['customItems']||[]){const _0x2acb49=this['_createBalloonButton'](_0xa5bd2b,{'label':_0x1dc792['label'],'icon':_0x1dc792['icon']||_0x123b6a,'type':'customItem'});_0x5b9e73['content']['add'](_0x2acb49),_0x2acb49['on']('execute',()=>{this['hideAddContextBalloonPanel'](),this['fire']('executeCustomItemCallback',_0x1dc792);});}this['_hasExactlyOneSource']=0x1===_0x5b9e73['content']['length'],this['_urlInputView']['withBackButton']=!this['_hasExactlyOneSource'];}['_addUrlContent'](_0x5bbf35,_0x2c0dcc){this['_urlInputView']=new Er(_0x2c0dcc),this['_urlInputView']['on']('submitUrl',(_0x1017a9,_0x3d377e)=>{this['_handleUrlSubmit'](_0x3d377e);}),this['_urlInputView']['on']('cancel',()=>{this['hideUrlBalloonPanel'](),this['_hasExactlyOneSource']||(this['showAddContextBalloonPanel'](),this['_addContextBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':Wr}));}),this['_urlInputView']['on']('refreshBalloon',()=>{this['_urlBalloonPanelView']['isVisible']&&this['_urlBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':Wr});}),_0x5bbf35['content']['add'](this['_urlInputView']);}['_createBalloonButton'](_0xb05546,_0x47037d){const _0x25f776='source'===_0x47037d['type']?new $r(_0xb05546):new kt(_0xb05546);return _0x25f776['set']({'label':_0x47037d['label'],'icon':_0x47037d['icon'],'withText':!0x0,'tooltip':!0x0,'tooltipPosition':'sw','class':Mr}),_0x25f776;}['_setupAllBalloonClickOutsideHandlers'](){this['_setupAddContextBalloonClickOutsideHandler'](),this['_setupUrlBalloonClickOutsideHandler']();}['_setupUrlBalloonClickOutsideHandler'](){Xt({'emitter':this['_urlBalloonPanelView'],'contextElements':[this['_urlBalloonPanelView']['element']],'callback':()=>{this['hideUrlBalloonPanel']();},'activator':()=>this['_urlBalloonPanelView']['isVisible']});}['_toggleAddContextBalloon'](_0x58e6ce){const _0x52048a=this['_addContextBalloonConfig'];_0x52048a['buttonView']['isOn']=_0x58e6ce,_0x58e6ce?_0x52048a['balloonView']['show']():_0x52048a['balloonView']['hide']();}['_setupAddContextBalloonClickOutsideHandler'](){const {balloonView:_0x2601cd,buttonView:_0x1bbd83,hideMethod:_0x4b477c}=this['_addContextBalloonConfig'];Xt({'emitter':_0x2601cd,'contextElements':[_0x2601cd['element'],_0x1bbd83['element']],'callback':()=>{_0x4b477c();},'activator':()=>_0x1bbd83['isOn']&&!this['_urlBalloonPanelView']['isVisible']&&!this['_resourcesBalloonView']['isAnyResourceBalloonVisible']()});}['_createContextButton'](_0x457d4c,_0x2ed00e,_0x4d8896=!0x1,_0x482c45=!0x1){const _0x415045='conversation'===_0x2ed00e||!0x0===_0x457d4c['isReadOnly'],_0x11251c=new xn(this['locale'],_0x457d4c,_0x415045,_0x4d8896,_0x482c45);return _0x415045||_0x11251c['on']('removeContextItemChip',()=>{this['fire']('removeContextItem',_0x11251c['id']);}),_0x11251c;}['_addContextToCollection'](_0x569545,_0x2a5079){_0x2a5079['add'](_0x569545,0x0);}['_removeContextFromCollection'](_0x35a3df,_0x2f81dc){const _0x3e62f0=_0x2f81dc['find'](_0x3c44c6=>_0x3c44c6['id']===_0x35a3df);_0x3e62f0&&_0x2f81dc['remove'](_0x3e62f0);}['_handleAddContextButtonClick'](){this['addContextButtonView']['isOn']?this['hideAddContextBalloonPanel']():(this['showAddContextBalloonPanel'](),this['_addContextBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':Wr}),this['_hasExactlyOneSource']&&this['_addContextBalloonPanelView']['content']['get'](0x0)?.['fire']('execute'));}['_handleUrlSubmit'](_0x10641a){this['_urlInputView']['clear'](),this['hideUrlBalloonPanel'](),this['fire']('addUrlToContext',_0x10641a);}}class $r extends kt{['arrowView'];constructor(_0x5847ca){super(_0x5847ca),this['set']({'withText':!0x0,'role':'menuitem'}),this['arrowView']=this['_createArrowView'](),this['extendTemplate']({'attributes':{'class':[Ur]}});}['render'](){super['render'](),this['children']['add'](this['arrowView']);}['_createArrowView'](){const _0x25a3db=new yt();return _0x25a3db['content']=_0x52b6b2,_0x25a3db['extendTemplate']({'attributes':{'class':Ur+'__arrow'}}),_0x25a3db;}}class qr extends Nt{['_cancelButtonView'];['_loaderView'];constructor(_0x433033){super(_0x433033),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 _0x1e0623=new kt(this['locale']);return _0x1e0623['set']({'label':as(this['locale'],'AI_CHAT_STOP_GENERATING'),'withText':!0x0,'class':hs+'\x20ck-ai-button-stop-generating','icon':_0x914ad1}),_0x1e0623['on']('execute',()=>{this['fire']('abortPromptStream');}),_0x1e0623;}['_createLoaderView'](){const _0x2db5ba=new Nt(this['locale']);return _0x2db5ba['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-controls-loader']},'children':[{'tag':'div','attributes':{'class':['ck-ai-chat-controls-loader-icon']},'children':[{'tag':'div','attributes':{'class':['ck-ai-chat-controls-loader-icon-dot']}},{'tag':'div','attributes':{'class':['ck-ai-chat-controls-loader-icon-dot']}},{'tag':'div','attributes':{'class':['ck-ai-chat-controls-loader-icon-dot']}}]},{'text':as(this['locale'],'AI_CHAT_IS_WRITING')}]}),_0x2db5ba;}}class Qr extends Nt{['_contextPanelView'];['_promptInputView'];['_promptCapabilitiesView'];['_loaderView'];['_modelUnavailableMessageView'];['_shouldRestorePromptInputFocus'];constructor(_0x3748c2,_0x514556){super(_0x3748c2),this['_contextPanelView']=this['_createContextPanelView'](_0x3748c2,{'bodyCollection':_0x514556['bodyCollection'],'searchInputVisibleFrom':_0x514556['contextResourcesSearchInputVisibleFrom']}),this['_promptInputView']=this['_createPromptInputView'](_0x3748c2),this['_promptCapabilitiesView']=this['_createPromptCapabilitiesView'](_0x3748c2),this['_loaderView']=this['_createLoaderView'](_0x3748c2),this['_modelUnavailableMessageView']=this['_createModelUnavailableMessageView'](_0x3748c2),this['_shouldRestorePromptInputFocus']=!0x1,this['_promptInputView']['delegate']('sendUserMessage')['to'](this),this['_loaderView']['delegate']('abortPromptStream')['to'](this),this['_promptCapabilitiesView']['delegate']('toggleWebSearch')['to'](this),this['_promptCapabilitiesView']['delegate']('toggleReasoning')['to'](this),this['_promptCapabilitiesView']['delegate']('selectModel')['to'](this),this['_contextPanelView']['delegate'](...yr)['to'](this),this['set']('isModelAvailable',!0x0),this['set']('isDisabled',!0x1);const _0x4f850f=this['bindTemplate'];this['setTemplate']({'tag':'form','attributes':{'class':['ck','ck-ai-chat-controls',_0x4f850f['if']('isDisabled','ck-ai-chat-controls-disabled')]},'children':[{'tag':'div','attributes':{'class':[_0x4f850f['if']('isLoading','ck-hidden',_0x5731ba=>_0x5731ba||!this['isModelAvailable']),_0x4f850f['if']('isModelAvailable','ck-hidden',_0x2e5004=>!_0x2e5004||this['isLoading'])]},'children':[this['_contextPanelView'],this['_promptInputView'],this['_promptCapabilitiesView']]},{'tag':'div','attributes':{'class':[_0x4f850f['if']('isLoading','ck-hidden',_0x5e1c6e=>!_0x5e1c6e)]},'children':[this['_loaderView']]},{'tag':'div','attributes':{'class':[_0x4f850f['if']('isModelAvailable','ck-hidden',_0x1fe52e=>_0x1fe52e)]},'children':[this['_modelUnavailableMessageView']]}]}),Xt({'emitter':this['_promptInputView'],'activator':()=>this['isLoading'],'contextElements':()=>[this['element']],'callback':()=>{this['_shouldRestorePromptInputFocus']=!0x1;}}),this['on']('change:isLoading',this['_handlePromptInputFocus'],{'priority':'low'});}['_createContextPanelView'](_0x37cf41,_0x448e80){return new Yr(_0x37cf41,_0x448e80);}['_createPromptInputView'](_0x13fb4e){return new sr(_0x13fb4e,this['_contextPanelView']['addContextButtonView']);}['_createPromptCapabilitiesView'](_0x315f9d){return new dr(_0x315f9d);}['_createLoaderView'](_0x459302){return new qr(_0x459302);}['_createModelUnavailableMessageView'](_0x106df7){const _0x5e915a=new Xr(_0x106df7);return _0x5e915a['delegate']('startConversation')['to'](this),_0x5e915a;}['_handlePromptInputFocus'](_0x86f0d2,_0x67c7a8,_0x4d77cf){_0x4d77cf?this['_shouldRestorePromptInputFocus']=!0x0:this['_shouldRestorePromptInputFocus']&&this['_promptInputView']['focus']();}['addContextItem'](_0x1dc1b4,_0x4eef83){this['_contextPanelView']['addContextItem'](_0x1dc1b4,_0x4eef83);}['removeContextItem'](_0x4b1449){this['_contextPanelView']['removeContextItem'](_0x4b1449);}['setContextItemLoading'](_0x50c09e,_0x25cb76){this['_contextPanelView']['setContextItemLoading'](_0x50c09e,_0x25cb76);}['setIsUploadInProgress'](_0x2c5c90){this['_promptInputView']['setIsUploadInProgress'](_0x2c5c90);}['setConversationContext'](_0x1e18c9){this['_contextPanelView']['setConversationContext'](_0x1e18c9);}['clearPendingContextUI'](){this['_contextPanelView']['clearCurrentContextItems']();}['clearConversationContextUI'](){this['_contextPanelView']['clearConversationContextItems']();}['updateResourceState'](_0x13c040,_0x5001a8,_0x7fb516){this['_contextPanelView']['updateResourceState'](_0x13c040,_0x5001a8,_0x7fb516);}['setWebSearch'](_0x621538){this['_promptCapabilitiesView']['setWebSearch'](_0x621538);}['setReasoning'](_0x537728){this['_promptCapabilitiesView']['setReasoning'](_0x537728);}['resetMessageInput'](){this['_promptInputView']['reset']();}['setAddContextOptions'](_0x1de842){this['_contextPanelView']['setAddContextOptions'](_0x1de842);}['setInputPlaceholder'](_0x1a64b6){this['_promptInputView']['setPlaceholderText'](_0x1a64b6);}['setModelList'](_0x2a01b9,_0x38dc77){this['_promptCapabilitiesView']['setModelList'](_0x2a01b9,_0x38dc77);}['setModel'](_0x2a7f81){_0x2a7f81?(this['isModelAvailable']=!0x0,this['_promptCapabilitiesView']['setModel'](_0x2a7f81)):this['isModelAvailable']=!0x1;}['enableModelSelector'](){this['_promptCapabilitiesView']['enableModelSelector']();}['disableModelSelector'](_0x1b08e4){this['_promptCapabilitiesView']['disableModelSelector'](_0x1b08e4);}['populateSourceResourceBalloon'](_0x497da5,_0x45fbbe,_0x1f0b6f,_0x9d1a76){this['_contextPanelView']['populateSourceResourceBalloon'](_0x497da5,_0x45fbbe,_0x1f0b6f,_0x9d1a76);}['closeSourceResourceBalloon'](_0x1f8c29){this['_contextPanelView']['closeSourceResourceBalloon'](_0x1f8c29);}['focusPromptInput'](_0x4fdb73=!0x1){this['_promptInputView']['focus'](_0x4fdb73);}['setPromptInputValue'](_0x15767d){this['_promptInputView']['queryView']['fieldView']['reset'](),this['_promptInputView']['queryView']['fieldView']['value']=_0x15767d;}}class Xr extends Nt{constructor(_0x3d2c46){super(_0x3d2c46);const _0x4a7705=new kt(_0x3d2c46);_0x4a7705['set']({'label':as(this['locale'],'AI_CHAT_MODEL_UNAVAILABLE_MESSAGE_BUTTON'),'withText':!0x0,'class':['ck-ai-chat-controls__start-new-chat-button'],'tooltip':''}),_0x4a7705['delegate']('execute')['to'](this,'startConversation'),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat-controls-model-unavailable-message']},'children':[{'tag':'p','children':[{'text':as(this['locale'],'AI_CHAT_MODEL_UNAVAILABLE_MESSAGE_TEXT')+'\x20'},_0x4a7705]}]});}}class zr extends _0x1d57fa{['conversationStartButton'];['resizeButton'];constructor(_0x1710d7,_0x1da634){super(_0x1710d7,{'label':as(_0x1710d7,'AI_CHAT_HEADING'),'class':'ck-ai-header\x20ck-ai-header_chat','icon':_0x1f2170}),this['set']('isMaximized',!0x1),this['conversationStartButton']=this['_createStartConversationButton'](_0x1710d7),this['children']['add'](this['conversationStartButton']),_0x1da634&&(this['resizeButton']=ls(_0x1710d7,this),this['children']['add'](this['resizeButton']));}['_createStartConversationButton'](_0x3ee50e){const _0x43997b=new kt(_0x3ee50e);return _0x43997b['set']({'label':as(this['locale'],'AI_CHAT_LABEL_NEW_CHAT'),'withText':!0x0,'icon':_0x15dcd7,'class':'ck-ai-chat__start-conversation\x20'+hs}),_0x43997b['on']('execute',()=>{this['fire']('startConversation');}),_0x43997b;}}class jr extends Nt{constructor(_0x59c4ec){super(_0x59c4ec),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-disclaimer']},'children':[{'tag':'p','attributes':{'class':['ck','ck-ai-disclaimer__content']},'children':[{'text':as(_0x59c4ec,'AI_DISCLAIMER_TEXT')}]}]});}}class Jr extends Nt{['chatHeader'];['chatFeed'];['chatControls'];['chatDisclaimer'];['_bodyCollection'];constructor(_0x289596,_0x1cce68){super(_0x289596),this['_bodyCollection']=new qt(_0x289596),this['_bodyCollection']['attachToDom'](),this['chatHeader']=new zr(_0x289596,_0x1cce68['showResizeButton']),this['chatHeader']['delegate'](...Xs)['to'](this),this['chatFeed']=new tr(_0x289596,this['_bodyCollection']),this['chatFeed']['delegate'](...Xs)['to'](this),this['chatControls']=new Qr(_0x289596,{'bodyCollection':this['_bodyCollection'],'contextResourcesSearchInputVisibleFrom':_0x1cce68['contextResourcesSearchInputVisibleFrom']}),this['chatControls']['delegate'](...Xs)['to'](this),this['chatDisclaimer']=new jr(_0x289596),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-ai-chat','ck-rounded-corners'],'dir':_0x289596['uiLanguageDirection']},'children':[this['chatHeader'],this['chatFeed'],this['chatControls'],this['chatDisclaimer']]});}['populateSourceResourceBalloon'](_0x438d38,_0x3f3a37,_0xcf14af,_0x4e2c1f){this['chatControls']['populateSourceResourceBalloon'](_0x438d38,_0x3f3a37,_0xcf14af,_0x4e2c1f);}['closeSourceResourceBalloon'](_0xd8b48b){this['chatControls']['closeSourceResourceBalloon'](_0xd8b48b);}['destroy'](){this['_bodyCollection']['detachFromDom'](),super['destroy']();}}class Zr extends _0x1aa7e1{static get['requires'](){return[ns];}['_view'];static get['pluginName'](){return'AIChatUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['feedItemRenderingStrategy']='streaming';['showDiff']=!0x0;['_promiseQueue'];['_interactionPromiseResolver'];['_titleAnimationInterval']=void 0x0;['_isTrackChangesCommandValueBound']=!0x1;constructor(_0x1f9cb4){super(_0x1f9cb4);const _0x4bfa37=this['context']['plugins']['get']('AITabs');this['set']('isBusy',!0x1),this['_promiseQueue']=new _n(),this['_view']=new Jr(this['context']['locale'],{'showResizeButton':_0x4bfa37['showResizeButton'],'contextResourcesSearchInputVisibleFrom':this['context']['config']['get']('ai.chat.context.searchInputVisibleFrom')}),this['_view']['delegate'](...Xs)['to'](this),this['_view']['on']('toggleSuggestionDisplayMode',(_0xfb87e9,{showDiff:_0x1c96b5})=>{this['showDiff']=_0x1c96b5;}),_0x4bfa37['view']['addTab']({'id':'chat','buttonLabel':as(this['context']['locale'],'AI_CHAT_HEADING'),'buttonIcon':_0x1f2170,'order':0x0,'content':this['_view']}),this['_view']['chatControls']['bind']('isLoading')['to'](this,'isBusy',_0x9617c8=>_0x9617c8),this['_view']['chatFeed']['bind']('isPending')['to'](this,'isBusy',_0x51a7ae=>_0x51a7ae),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder']()),this['bind']('isModelAvailable')['to'](this['_view']['chatControls'],'isModelAvailable');}['destroy'](){super['destroy'](),this['_titleAnimationInterval']&&clearInterval(this['_titleAnimationInterval']);}['createConversation'](_0x3d3b80){const _0x378568=this['context']['config']['get']('ai.chat.welcomeMessage')??as(this['context']['locale'],'AI_CHAT_WELCOME_MESSAGE');this['_view']['chatFeed']['clear'](),this['_view']['chatControls']['enableModelSelector'](),this['_view']['chatControls']['setModelList'](_0x3d3b80['availableModels'],!this['context']['config']['get']('ai.models.showModelSelector')),this['addFeedItemStaticMessage']({'id':'conversation-start','staticMessage':_0x378568}),this['fire']('conversationCreated');}async['addFeedItemStaticMessage']({id:_0x18a35c,staticMessage:_0x1b7699}){return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('ai-reply',{'id':_0x18a35c,'initialContent':'<p>'+_0x1b7699+'</p>'});});}async['addFeedItemUserMessage'](_0x22fcf1){const _0x2351ef=_0x22fcf1['attributes']?.['displayedPrompt']||_0x22fcf1['userMessage'];return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('user-message',{'contextItems':Array['from'](_0x22fcf1['contextItems']['values']()),'initialContent':'<p>'+_0x2351ef+'</p>','id':_0x22fcf1['id']});});}async['addFeedItemError']({errorMessage:_0x3c5e48,id:_0x472da9}){return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('error-message',{'initialContent':'<p>'+_0x3c5e48+'</p>','id':_0x472da9});});}async['addFeedItemAIReply'](_0x1cbb3f){return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('ai-reply',{'id':_0x1cbb3f['interactionId']+':'+_0x1cbb3f['id']}),this['clearLoadingMessage']();});}async['addFeedItemAISuggestion'](_0x306d1a){const _0x3d809f=Fs(this['context']);let _0x1d4da5=_0x3d809f['config']['get']('ai.availableReplyActions')||[...gn];if(_0x3d809f['plugins']['has']('TrackChanges')){if(!this['_isTrackChangesCommandValueBound']){this['_isTrackChangesCommandValueBound']=!0x0;const _0x5cf5f7=_0x3d809f['commands']['get']('trackChanges');this['_view']['chatFeed']['bind']('isTrackChangesOn')['to'](_0x5cf5f7,'value');}}else _0x1d4da5=_0x1d4da5['filter'](_0x3077d2=>'insertSuggestion'!=_0x3077d2);return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('ai-suggestion-reply',{'id':_0x306d1a['interactionId']+':'+_0x306d1a['id'],'areActionsDisabled':_0x306d1a['areActionsDisabled'],'showDiff':this['showDiff'],'availableActions':_0x1d4da5}),this['clearLoadingMessage']();});}async['addFeedInteractionHeader'](_0x12a980,_0x512616){return this['_promiseQueue']['enqueue'](async()=>{const _0x2110ad=this['_view']['chatFeed']['children']['last'];if(_0x2110ad instanceof Yn)return this['_view']['chatFeed']['children']['remove'](_0x2110ad),void this['_view']['chatFeed']['addItem']('interaction-header',{'id':_0x12a980['id'],'capabilities':{'isWebSearchEnabled':_0x2110ad['capabilities']['isWebSearchEnabled']||_0x512616['isWebSearchEnabled'],'isReasoningEnabled':_0x2110ad['capabilities']['isReasoningEnabled']||_0x512616['isReasoningEnabled']}});this['_view']['chatFeed']['addItem']('interaction-header',{'id':_0x12a980['id'],'capabilities':_0x512616});});}async['addFeedItemCustomElement'](_0x1aac43,_0x1d737a){let _0x24897a;return await this['_promiseQueue']['enqueue'](async()=>{_0x24897a=this['_view']['chatFeed']['addItem']('custom-element',{'content':_0x1aac43,'id':_0x1d737a});}),_0x24897a;}['removeFeedItem'](_0x4beec1){this['_view']['chatFeed']['removeItem'](_0x4beec1);}['hasFeedItem'](_0x4811b0){return this['_view']['chatFeed']['hasItem'](_0x4811b0);}['updateFeedInteractionHeader'](_0x55ecb3){const _0x589f39=this['_view']['chatFeed']['children']['find'](_0x2e531b=>_0x2e531b['options']['id']==_0x55ecb3['id']&&_0x2e531b instanceof Yn);_0x589f39&&_0x589f39['set']('isVisible',_0x55ecb3['isVisible']);}async['updateFeedItemAIReplyContent'](_0x2650de){const _0x511421=_0x2650de['renderingStrategy']||this['feedItemRenderingStrategy'];return this['_promiseQueue']['enqueue'](async _0x24da74=>{await this['_view']['chatFeed']['updateReplyItem']({..._0x2650de,'abortSignal':_0x24da74,'renderingStrategy':_0x511421}),_0x2650de['isDone']&&this['markFeedItemAsDone'](_0x2650de['id']);});}['updateFeedItemAIReplySources'](_0x337dff,_0x441700){this['_view']['chatFeed']['updateWebSources'](_0x337dff,_0x441700);}async['updateFeedItemAIReplySuggestionContent'](_0x3dd4f7){const _0x44fb9b=_0x3dd4f7['renderingStrategy']||this['feedItemRenderingStrategy'];return this['_promiseQueue']['enqueue'](async _0x51c903=>{await this['_view']['chatFeed']['updateSuggestionItem']({..._0x3dd4f7,'abortSignal':_0x51c903,'renderingStrategy':_0x44fb9b}),_0x3dd4f7['isDone']&&this['markFeedItemAsDone'](_0x3dd4f7['id']);});}['updateFeedItemAIReplySuggestionPartState'](_0x250f23){this['_view']['chatFeed']['updateSuggestionPartState'](_0x250f23);}['setFeedItemAIReplySuggestionPartActive'](_0x4da8f7){this['_view']['chatFeed']['setSuggestionPartActive'](_0x4da8f7);}['markFeedItemAsDone'](_0x763d2){this['_view']['chatFeed']['markItemAsDone'](_0x763d2);}['removeFeedInteraction'](_0x262c6e){this['_view']['chatFeed']['getItemIds']()['filter'](_0xc35cdf=>_0xc35cdf['startsWith'](_0x262c6e))['forEach'](_0x2276ce=>this['_view']['chatFeed']['removeItem'](_0x2276ce));}['startInteraction'](){const _0x7112b8=this['prepareLoadingMessage']({'isWebSearchEnabled':!0x1,'isReasoningEnabled':!0x1});this['setLoadingMessage'](_0x7112b8),this['_view']['chatControls']['disableModelSelector'](!this['context']['config']['get']('ai.models.showModelSelector')),this['isBusy']=!0x0,this['_view']['chatFeed']['startAutoScroll']();}['stopInteraction'](_0x31799f){this['_promiseQueue']['abort'](),this['_view']['chatFeed']['getItemIds']()['filter'](_0xf8cc30=>_0xf8cc30['startsWith'](_0x31799f['id']))['forEach'](_0x1b3f35=>this['markFeedItemAsDone'](_0x1b3f35)),this['isBusy']=!0x1,this['_view']['chatFeed']['stopAutoScroll']();}async['finishInteraction'](){return this['_promiseQueue']['queueEmptyPromise']['then'](()=>{this['isBusy']=!0x1,this['_view']['chatFeed']['stopAutoScroll']();});}['addContextItem'](_0x155256,_0x4066b6){this['_view']['chatControls']['addContextItem'](_0x155256,_0x4066b6);}['removeContextItem'](_0x5acf96){this['_view']['chatControls']['removeContextItem'](_0x5acf96);}['setContextItemLoading'](_0x2ed83d,_0x36a208){this['_view']['chatControls']['setContextItemLoading'](_0x2ed83d,_0x36a208);}['setIsUploadInProgress'](_0xc5f3ac){this['_view']['chatControls']['setIsUploadInProgress'](_0xc5f3ac);}['setConversationContext'](_0x3e30a9){this['_view']['chatControls']['setConversationContext'](_0x3e30a9);}['clearPendingContextUI'](){this['_view']['chatControls']['clearPendingContextUI']();}['clearConversationContextUI'](){this['_view']['chatControls']['clearConversationContextUI']();}['updateResourceState'](_0x1cfad4,_0x3ec4e6,_0x1654ff){this['_view']['chatControls']['updateResourceState'](_0x1cfad4,_0x3ec4e6,_0x1654ff);}['resetMessageInput'](){this['_view']['chatControls']['resetMessageInput'](),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder']());}['setAddContextOptions'](_0x2955f7){this['_view']['chatControls']['setAddContextOptions'](_0x2955f7);}['updateCapabilities'](_0xf4969c){this['_view']['chatControls']['setWebSearch'](_0xf4969c['isWebSearchEnabled']),this['_view']['chatControls']['setReasoning'](_0xf4969c['isReasoningEnabled']),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder'](_0xf4969c));}['setSelectedModel'](_0x4a5052,_0x283342){this['_view']['chatControls']['setModel'](_0x4a5052),_0x283342&&this['_view']['chatControls']['disableModelSelector'](!0x1);}['setFeedItemRenderingStrategy'](_0xb1ecf3){this['feedItemRenderingStrategy']=_0xb1ecf3;}['toggleLoadingSkeleton'](_0x20d854){this['_view']['chatFeed']['toggleLoadingSkeleton'](_0x20d854);}['resetConversationTitle'](){this['setConversationTitle'](as(this['context']['locale'],'AI_CHAT_HEADING'));}['setConversationTitle'](_0x3c1ba5,_0x4b9f7e=!0x1){if(_0x4b9f7e&&!St()&&_0x3c1ba5['length'])return this['_view']['chatHeader']['label']='',void this['_animateConversationTitle'](_0x3c1ba5);this['_view']['chatHeader']['label']=_0x3c1ba5;}['setLoadingMessage'](_0x4441c2){this['_view']['chatFeed']['setLoadingMessage'](_0x4441c2);}['clearLoadingMessage'](){this['_view']['chatFeed']['setLoadingMessage']('');}['_animateConversationTitle'](_0x3721c8){let _0x132b74=0x0;clearInterval(this['_titleAnimationInterval']),this['_titleAnimationInterval']=setInterval(()=>{this['_view']['chatHeader']['label']=this['_view']['chatHeader']['label']+_0x3721c8[_0x132b74],_0x132b74++,_0x132b74===_0x3721c8['length']&&clearInterval(this['_titleAnimationInterval']);},0x1e);}['setIsMaximized'](_0x44f092){this['_view']['chatHeader']['isMaximized']=_0x44f092;}['prepareLoadingMessage'](_0x24125a){return _0x24125a['isWebSearchEnabled']&&_0x24125a['isReasoningEnabled']?as(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH_REASONING'):_0x24125a['isWebSearchEnabled']?as(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH'):_0x24125a['isReasoningEnabled']?as(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_REASONING'):as(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_REGULAR');}['_getInputPlaceholder'](_0x38ef07){return _0x38ef07?_0x38ef07['isWebSearchEnabled']&&_0x38ef07['isReasoningEnabled']?as(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH_REASONING'):_0x38ef07['isWebSearchEnabled']?as(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH'):_0x38ef07['isReasoningEnabled']?as(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REASONING'):as(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REGULAR'):as(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REGULAR');}['populateSourceResourceBalloon'](_0x3979da,_0x4348e9,_0x172402,_0x5b039d){this['_view']['populateSourceResourceBalloon'](_0x3979da,_0x4348e9,_0x172402,_0x5b039d);}['closeSourceResourceBalloon'](_0x1ce362){this['_view']['closeSourceResourceBalloon'](_0x1ce362);}['setPromptInputValue'](_0x4a07a5){this['_view']['chatControls']['setPromptInputValue'](_0x4a07a5);}['focusPromptInput'](_0xceaa9=!0x1){this['_view']['chatControls']['focusPromptInput'](_0xceaa9);}['scrollFeedToSuggestion'](_0x8396fb,_0x163253){this['_view']['chatFeed']['scrollToSuggestion'](_0x8396fb,_0x163253);}['startAutoScroll'](){this['_view']['chatFeed']['startAutoScroll']();}['disableControls'](){this['_view']['chatControls']['isDisabled']=!0x0;}['enableControls'](){this['_view']['chatControls']['isDisabled']=!0x1;}}class ta extends Lt{['sections'];constructor(_0x534ae0,_0x273dc9){super(_0x534ae0),this['sections']=_0x273dc9,this['items']['addMany'](this['sections']),this['extendTemplate']({'attributes':{'class':['ck-ai-chat-history__sections']}});}['filter'](_0x28c0e2){let _0x48ff0e=0x0,_0x1287aa=0x0;for(const _0x574aff of this['sections']){const {resultsCount:_0x2bc659,totalItemsCount:_0x557c3b}=_0x574aff['filter'](_0x28c0e2);_0x48ff0e+=_0x2bc659,_0x1287aa+=_0x557c3b;}return{'resultsCount':_0x48ff0e,'totalItemsCount':_0x1287aa};}}class ea extends Pt{['title'];['itemsViews'];['_itemsListView'];constructor(_0x385ad9,{title:_0x49eabe,items:_0x266a65}){super(_0x385ad9);const _0x313dae=this['bindTemplate'];this['set']('isVisible',!0x0),this['title']=_0x49eabe,this['itemsViews']=_0x266a65;const _0x5a13e7=new Nt(_0x385ad9);_0x5a13e7['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-history__section-title']},'children':[this['title']]}),this['_itemsListView']=new Lt(_0x385ad9),this['_itemsListView']['items']['addMany'](this['itemsViews']),this['setTemplate']({'tag':'li','attributes':{'class':['ck-ai-chat-history__section',_0x313dae['if']('isVisible','ck-hidden',_0x19707c=>!_0x19707c)]},'children':[_0x5a13e7,this['_itemsListView']]});}['filter'](_0x12351b){const _0x2cb534=this['itemsViews']['length'];let _0x39ac44=0x0;for(const _0x4825f9 of this['itemsViews']){if(_0x12351b){const _0x3dae9d=_0x4825f9['isMatching'](_0x12351b);_0x4825f9['isVisible']=!!_0x3dae9d,_0x4825f9['highlightText'](_0x12351b);}else _0x4825f9['isVisible']=!0x0,_0x4825f9['highlightText'](null);_0x4825f9['isVisible']&&_0x39ac44++;}return this['isVisible']=_0x39ac44>0x0,{'resultsCount':_0x39ac44,'totalItemsCount':_0x2cb534};}['getItem'](_0x27decd){return this['itemsViews']['find'](_0x413509=>_0x413509['id']===_0x27decd);}['removeItem'](_0x5a4ff1){const _0x1afe7b=this['itemsViews']['indexOf'](_0x5a4ff1);-0x1!==_0x1afe7b&&(this['itemsViews']['splice'](_0x1afe7b,0x1),this['_itemsListView']['items']['remove'](_0x5a4ff1));}}class ia extends/* #__PURE__ -- @preserve */
|
|
27
|
-
_0x14b679(Pt){['id'];static ['LOADING_LABELS']={'remove':'AI_CHAT_HISTORY_LOADING_REMOVING','rename':'AI_CHAT_HISTORY_LOADING_RENAMING','pin':'AI_CHAT_HISTORY_LOADING_PINNING','unpin':'AI_CHAT_HISTORY_LOADING_UNPINNING'};['actions'];['mainContent'];['_titleView'];constructor(_0x34d749,_0x5024a){super(_0x34d749);const _0x24354f=this['bindTemplate'];this['set']('isEdit',!0x1),this['set']('isVisible',!0x0),this['set']('pinned',!!_0x5024a['pinned']),this['set']('loadingState',null),this['id']=_0x5024a['id'];const {title:_0x461417,createdAt:_0x4ca310,active:_0x311a07=!0x1}=_0x5024a;this['_titleView']=new _0x18e9fc(),this['_titleView']['text']=_0x461417,this['_titleView']['extendTemplate']({'attributes':{'class':['ck-ai-chat-history__item-title']}});const _0x4f735=this['_createCheckView'](),_0x23c693=this['_createPinButtonView'](_0x34d749),_0x4751b8=this['_createMenuDropdownView'](),_0x5d451d=this['_createEditInputView'](_0x34d749,_0x461417),_0x2ffe38=this['_createAcceptEditButtonView'](_0x34d749,_0x5d451d),_0xf57a99=this['_createCancelEditButtonView'](_0x34d749,_0x5d451d);this['actions']=this['createCollection'](),this['mainContent']=this['createCollection'](),this['mainContent']['add'](this['_titleView']),this['actions']['add'](_0x23c693),this['actions']['add'](_0x4751b8),this['on']('change:isEdit',(_0x2ef8c2,_0x5ef456,_0x46f081)=>{this['actions']['clear'](),this['mainContent']['clear'](),_0x46f081?(this['actions']['add'](_0x2ffe38),this['actions']['add'](_0xf57a99),this['mainContent']['add'](_0x5d451d),_0x5d451d['element']['focus']()):(this['actions']['add'](_0x23c693),this['actions']['add'](_0x4751b8),this['mainContent']['add'](this['_titleView']));}),this['setTemplate']({'tag':'li','attributes':{'class':['ck-ai-chat-history__item',_0x311a07?'ck-ai-chat-history__item--active':'',_0x24354f['if']('isVisible','ck-hidden',_0x2c28b3=>!_0x2c28b3),_0x24354f['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',_0x24354f['if']('loadingState','ck-hidden',_0x592d73=>!!_0x592d73)]},'children':_0x311a07?[_0x4f735]:[]},{'tag':'div','attributes':{'class':['ck-ai-loader',_0x24354f['if']('loadingState','ck-hidden',_0x5ac419=>!_0x5ac419)]},'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',_0x24354f['if']('loadingState','ck-hidden',_0x51b4f9=>!!_0x51b4f9)]},'children':this['mainContent']},{'tag':'div','attributes':{'class':['ck-ai-loader__text',_0x24354f['if']('loadingState','ck-hidden',_0x5b22c2=>!_0x5b22c2)]},'children':[{'text':_0x24354f['to']('loadingState',_0x9d6c8a=>_0x9d6c8a?as(this['locale'],ia['LOADING_LABELS'][_0x9d6c8a]):'')}]}]},{'tag':'span','attributes':{'class':['ck-ai-chat-history__item-date']},'children':[_0x4ca310]}]},{'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'](_0x75baac){this['_titleView']['text']=_0x276663(_0x75baac);}['updateLoadingState'](_0x15ed6d,_0x3613bc){this['set']('loadingState',_0x3613bc?_0x15ed6d:null);}['_createCheckView'](){const _0x484608=new yt();return _0x484608['set']({'content':_0x2bffb7}),_0x484608;}['_createPinButtonView'](_0x5c3e8e){const _0x5bd10b=new kt(_0x5c3e8e);return _0x5bd10b['set']({'label':as(_0x5c3e8e,'AI_CHAT_HISTORY_PIN_BUTTON'),'icon':_0x4208c7,'withText':!0x1,'tooltip':!0x0}),_0x5bd10b['bind']('isOn')['to'](this,'pinned'),_0x5bd10b['on']('execute',()=>{const _0x198719=!this['pinned'];this['fire']('setConversationPinned',{'id':this['id'],'pinned':_0x198719});}),_0x5bd10b;}['_createMenuDropdownView'](){const _0x2553b2=Bt(this['locale']),_0x43af73=_0x2553b2['panelView']['children'];_0x2553b2['buttonView']['set']({'label':as(this['locale'],'AI_CHAT_HISTORY_SHOW_MORE_ITEMS'),'icon':_0x2b9494}),_0x2553b2['panelPosition']='sw';const _0x1b664d=new kt(this['locale']);_0x1b664d['label']=as(this['locale'],'AI_CHAT_HISTORY_EDIT_NAME'),_0x1b664d['withText']=!0x0,_0x1b664d['on']('execute',()=>{this['isEdit']=!0x0;});const _0xd7481e=new kt(this['locale']);_0xd7481e['label']=as(this['locale'],'AI_CHAT_HISTORY_REMOVE'),_0xd7481e['withText']=!0x0,_0xd7481e['on']('execute',()=>{this['showConfirm'](as(this['locale'],'AI_CHAT_HISTORY_REMOVE_CONFIRM'),this['element'])['then'](()=>{this['fire']('removeConversation',{'id':this['id']});});});const _0xb74f11=new Lt(this['locale']),_0x3e5c92=new Pt(this['locale']);_0x3e5c92['children']['add'](_0x1b664d);const _0x3f7545=new Pt(this['locale']);return _0x3f7545['children']['add'](_0xd7481e),_0xb74f11['items']['addMany']([_0x3e5c92,_0x3f7545]),_0x43af73['add'](_0xb74f11),_0x2553b2;}['_createEditInputView'](_0x5698fa,_0x18c8b4){const _0xd44eeb=new _0x44e7f7(_0x5698fa),_0x187f40=_0xd44eeb['bindTemplate'];return _0xd44eeb['value']=_0x18c8b4,_0xd44eeb['extendTemplate']({'on':{'keydown':_0x187f40['to'](_0xfdde08=>{'Enter'==_0xfdde08['key']&&this['_commitEditInputValue'](_0xd44eeb);})}}),_0xd44eeb;}['_createAcceptEditButtonView'](_0x365c28,_0x4de781){const _0x269cc0=new kt(_0x365c28);return _0x269cc0['set']({'icon':_0x2bffb7,'withText':!0x1,'tooltip':as(_0x365c28,'AI_CHAT_HISTORY_ACCEPT')}),_0x269cc0['extendTemplate']({'attributes':{'class':['ck-confirm-view-submit']}}),_0x269cc0['on']('execute',()=>{this['_commitEditInputValue'](_0x4de781);}),_0x269cc0;}['_commitEditInputValue'](_0x1781fd){const _0x3288dd=_0x1781fd['element']['value']||'';this['_titleView']['text']=_0x3288dd,this['isEdit']=!0x1,this['fire']('editConversationTitle',{'id':this['id'],'title':_0x3288dd});}['_createCancelEditButtonView'](_0x31ecde,_0x3e8e9c){const _0x444eec=new kt(_0x31ecde);return _0x444eec['set']({'icon':_0x101f07,'withText':!0x1,'tooltip':as(_0x31ecde,'AI_CHAT_HISTORY_CANCEL')}),_0x444eec['extendTemplate']({'attributes':{'class':['ck-confirm-view-cancel']}}),_0x444eec['on']('execute',()=>{this['isEdit']=!0x1,_0x3e8e9c['value']=this['_titleView']['text']||'',this['fire']('edit:cancel');}),_0x444eec;}['_createSpinnerView'](){const _0x138d6d=new fn('tiny');return _0x138d6d['isVisible']=!0x0,_0x138d6d;}['isMatching'](_0x41e02d){return this['_titleView']&&'string'==typeof this['_titleView']['text']&&this['_titleView']['text']['match'](_0x41e02d)?{'title':!0x0}:null;}['highlightText'](_0x3c0266){this['_titleView']['highlightText'](_0x3c0266);}}class sa extends Nt{['searchView'];['mainErrorView'];['skeletonView'];['emptyView'];['sectionsView'];['resizeButton'];constructor(_0x35b40b,_0x14cbd0){super(_0x35b40b),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 _0x52ebcd=new _0x1d57fa(_0x35b40b,{'label':as(_0x35b40b,'AI_CHAT_HISTORY_HEADING'),'icon':_0x38f93d,'class':'ck-ai-header\x20ck-ai-header_history'});_0x14cbd0&&(this['resizeButton']=ls(_0x35b40b,this),_0x52ebcd['children']['add'](this['resizeButton'])),this['sectionsView']=new ta(_0x35b40b,[]),this['sectionsView']['delegate'](...na)['to'](this),this['mainErrorView']=this['_createErrorView'](),this['skeletonView']=this['_createSkeletonView'](),this['emptyView']=this['_createEmptyStateView'](),this['searchView']=this['_createSearchView'](),this['mainErrorView']['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isMainErrorViewVisible','ck-hidden',_0x1853bb=>!_0x1853bb)]}}),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':[_0x52ebcd,{'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 _0x251c13=new _0x1df41a(this['locale'],{'filteredView':this['sectionsView'],'queryView':{'label':as(this['locale'],'AI_CHAT_HISTORY_SEARCH_LABEL')},'infoView':{'text':{'notFound':{'primary':_0x828ab=>as(this['locale'],'AI_CHAT_HISTORY_SEARCH_NOT_FOUND_PRIMARY',_0x828ab),'secondary':as(this['locale'],'AI_CHAT_HISTORY_SEARCH_NOT_FOUND_SECONDARY')}}}}),_0x2cf439=this['_createErrorView']();return _0x2cf439['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('errorMessage','ck-hidden',_0x38a1d6=>!_0x38a1d6)]}}),_0x251c13['on']('render',()=>{_0x251c13['children']['add'](_0x2cf439,0x1);}),_0x251c13['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isSearchViewVisible','ck-hidden',_0x425f4c=>!_0x425f4c)]}}),_0x251c13;}['_createSkeletonView'](){const _0x2941ee=new zn(this['locale'],jn['aiHistory']);return _0x2941ee['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isLoading','ck-hidden',_0x13a426=>!_0x13a426)]}}),_0x2941ee;}['_createErrorView'](){const _0xd1e489=new Nt(this['locale']),_0x237ed5=new kt(this['locale']);_0x237ed5['set']({'withText':!0x1,'icon':_0x101f07,'class':'ck-ai-notification_error__dismiss-button'}),_0x237ed5['bind']('isVisible')['to'](this,'hasItems',_0x1a73cb=>!!_0x1a73cb),_0x237ed5['on']('execute',()=>{this['errorMessage']='';});const _0x3bb1dd=this['bindTemplate'];return _0xd1e489['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-notification','ck-ai-notification_error']},'children':[{'tag':'p','children':[{'text':_0x3bb1dd['to']('errorMessage')}]},_0x237ed5]}),_0xd1e489;}['_createEmptyStateView'](){const _0x39b08e=new kt(this['locale']);_0x39b08e['set']({'label':as(this['locale'],'AI_CHAT_LABEL_NEW_CHAT'),'withText':!0x0,'icon':_0x15dcd7,'class':'ck-ai-chat__start-conversation\x20'+hs}),_0x39b08e['on']('execute',()=>{this['fire']('openChat');});const _0x2ef90a=new Nt(this['locale']);return _0x2ef90a['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-history__empty',this['bindTemplate']['if']('isEmptyViewVisible','ck-hidden',_0x54d6da=>!_0x54d6da)]},'children':[{'tag':'p','attributes':{'class':['ck-ai-chat-history__empty-message']},'children':[as(this['locale'],'AI_CHAT_HISTORY_EMPTY_MESSAGE')]},_0x39b08e]}),_0x2ef90a;}['_createListItemViews'](_0x450f77,_0x43cff4){const _0x31f845=[];for(const _0x2712d2 of _0x450f77){const _0x2a49f4=new ia(_0x43cff4,_0x2712d2);_0x2a49f4['delegate'](...na)['to'](this),_0x31f845['push'](_0x2a49f4);}return _0x31f845;}['updateHistoryItemsWithCategories'](_0x1b5453){const _0x373070=this['locale']||'en',_0x3396b6=[];for(const _0xd0239f of _0x1b5453){const _0x3081a0=this['_createListItemViews'](_0xd0239f['items'],_0x373070);_0x3396b6['push'](new ea(_0x373070,{'title':_0xd0239f['title'],'items':_0x3081a0}));}this['sectionsView']['sections']=_0x3396b6,this['sectionsView']['items']['clear'](),this['sectionsView']['items']['addMany'](_0x3396b6),this['hasItems']=_0x1b5453['some'](_0x54d4ad=>_0x54d4ad['items']['length']>0x0),this['_refreshSearch']();}['removeHistoryItem'](_0xa2c50d){for(const _0x5d21e2 of this['sectionsView']['sections']){const _0x435e57=_0x5d21e2['getItem'](_0xa2c50d);if(_0x435e57){if(_0x5d21e2['removeItem'](_0x435e57),0x0===_0x5d21e2['itemsViews']['length']){const _0x51af3d=this['sectionsView']['sections']['indexOf'](_0x5d21e2);-0x1!==_0x51af3d&&(this['sectionsView']['sections']['splice'](_0x51af3d,0x1),this['sectionsView']['items']['remove'](_0x5d21e2));}this['hasItems']=this['sectionsView']['sections']['length']>0x0,this['_refreshSearch']();break;}}}['updateItemTitle'](_0x5cc811,_0x14dce7){for(const _0x35d6f4 of this['sectionsView']['sections']){const _0xbb67f5=_0x35d6f4['getItem'](_0x5cc811);if(_0xbb67f5){_0xbb67f5['updateTitle'](_0x14dce7);break;}}}['updateItemLoadingState'](_0x51865a,_0x3e2e0c,_0x321988){for(const _0x54d5f7 of this['sectionsView']['sections']){const _0x513170=_0x54d5f7['getItem'](_0x51865a);if(_0x513170){_0x513170['updateLoadingState'](_0x3e2e0c,_0x321988);break;}}}['_refreshSearch'](){if(this['hasItems']){const _0xbf3e10=this['searchView']['queryView']['fieldView']?.['element']?.['value']||'';this['searchView']['search'](_0xbf3e10);}}}const na=['showConversationHistory','removeConversation','editConversationTitle','setConversationPinned','selectConversation','openChat','resizeTabs'];class ra extends _0x1aa7e1{static get['requires'](){return[ns];}['_historyView'];static get['pluginName'](){return'AIChatHistoryUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x4a94db){super(_0x4a94db);const _0x22bf48=this['context']['plugins']['get']('AITabs');this['_historyView']=new sa(this['context']['locale'],_0x22bf48['showResizeButton']),this['_historyView']['delegate'](...na)['to'](this),_0x22bf48['view']['addTab']({'id':'history','buttonLabel':as(this['context']['locale'],'AI_CHAT_HISTORY_HEADING'),'buttonIcon':_0x38f93d,'order':0x0,'content':this['_historyView']});}['removeHistoryItem'](_0x32b9d6){this['_historyView']['removeHistoryItem'](_0x32b9d6);}['updateItems'](_0x20abcf){this['_historyView']['updateHistoryItemsWithCategories'](_0x20abcf);}['updateItemTitle'](_0x4ded1c,_0x6b184b){this['_historyView']['updateItemTitle'](_0x4ded1c,_0x6b184b);}['updateItemLoadingState'](_0x5b28b1,_0x14e8e9,_0x2fe1e6){this['_historyView']['updateItemLoadingState'](_0x5b28b1,_0x14e8e9,_0x2fe1e6);}['setLoadingSkeleton'](_0x419d17){this['_historyView']['isLoading']=_0x419d17;}['showError'](_0x28e31c){this['_historyView']['errorMessage']=_0x28e31c;}['hideError'](){this['_historyView']['errorMessage']='';}['setIsMaximized'](_0x132710){this['_historyView']['isMaximized']=_0x132710;}}class aa extends ht(){['id'];['createdAt'];constructor({id:_0x3448b1,title:_0xc8588f,createdAt:_0x26a885,updatedAt:_0x58699c,pinned:_0x38817e}){super(),this['id']=_0x3448b1,this['createdAt']=new Date(_0x26a885),this['set']('title',_0xc8588f),this['set']('updatedAt',_0x58699c?new Date(_0x58699c):null),this['set']('pinned',_0x38817e||!0x1);}['updateTitle'](_0x4abfb8){this['set']('title',_0x276663(_0x4abfb8)),this['updatedAt']=new Date();}['updatePinned'](_0x5abc49){this['set']('pinned',_0x5abc49),this['updatedAt']=new Date();}}class oa extends pt(){['items']=[];['connector'];['group'];constructor({connector:_0x281b49,group:_0x93f063}){super(),this['connector']=_0x281b49,this['group']=_0x93f063;}async['init'](){try{const _0x47a9cc=this['connector']['fetchConversations'](this['group']),_0x216bc1=await _0x47a9cc['getConversations']();this['loadItems'](_0x216bc1);}catch(_0x360e1f){this['fire']('error',{'error':_0x360e1f,'operation':'init'});}}['addItem'](_0x2a3f14){this['items']['push'](_0x2a3f14);}async['removeItem'](_0x4e4499){const _0xa75e10=this['items']['findIndex'](_0x33513f=>_0x33513f['id']===_0x4e4499);if(-0x1===_0xa75e10)return!0x1;try{return await this['connector']['deleteConversation'](_0x4e4499)['execute'](),this['items']['splice'](_0xa75e10,0x1),this['fire']('itemRemoved',{'itemId':_0x4e4499}),!0x0;}catch(_0x8d48d7){return this['fire']('error',{'error':_0x8d48d7,'operation':'removeItem','itemId':_0x4e4499}),!0x1;}}['getItem'](_0x552cf2){return this['items']['find'](_0x37171=>_0x37171['id']===_0x552cf2);}async['updateItemTitle'](_0x382d64,_0x57de5c){const _0x441e33=this['getItem'](_0x382d64);if(!_0x441e33)return!0x1;try{return await this['connector']['updateConversation'](_0x382d64,{'title':_0x57de5c})['getResult'](),_0x441e33['updateTitle'](_0x57de5c),this['fire']('itemUpdated',{'itemId':_0x382d64,'updates':{'title':_0x57de5c}}),!0x0;}catch(_0x4f358c){return this['fire']('error',{'error':_0x4f358c,'operation':'updateItemTitle','itemId':_0x382d64}),!0x1;}}async['updateItemPinned'](_0xd29db7,_0x3392a1){const _0x11e5de=this['getItem'](_0xd29db7);if(!_0x11e5de)return!0x1;try{return await this['connector']['updateConversation'](_0xd29db7,{'pinned':_0x3392a1})['getResult'](),_0x11e5de['updatePinned'](_0x3392a1),this['fire']('itemUpdated',{'itemId':_0xd29db7,'updates':{'pinned':_0x3392a1}}),!0x0;}catch(_0x54e924){return this['fire']('error',{'error':_0x54e924,'operation':'updateItemPinned','itemId':_0xd29db7}),!0x1;}}['loadItems'](_0x2de1e0){try{this['items']=[],_0x2de1e0['map'](_0x492196=>{this['addItem'](new aa(_0x492196));}),this['fire']('itemsLoaded',{'items':[...this['items']]});}catch(_0x49d845){this['fire']('error',{'error':_0x49d845,'operation':'loadItems'});}}['getItems'](_0x1b2c9b={}){const _0x504bf4=void 0x0!==_0x1b2c9b['pinned']&&_0x1b2c9b['pinned'],_0x32f00b=_0x1b2c9b['from']?new Date(_0x1b2c9b['from']['getFullYear'](),_0x1b2c9b['from']['getMonth'](),_0x1b2c9b['from']['getDate']()):null,_0x4eed50=_0x1b2c9b['to']?new Date(_0x1b2c9b['to']['getFullYear'](),_0x1b2c9b['to']['getMonth'](),_0x1b2c9b['to']['getDate']()):null;return this['items']['filter'](_0x516f11=>{if(_0x516f11['pinned']!==_0x504bf4)return!0x1;if(_0x4eed50){const _0x1c9256=new Date(_0x516f11['createdAt']['getFullYear'](),_0x516f11['createdAt']['getMonth'](),_0x516f11['createdAt']['getDate']());return _0x32f00b?_0x32f00b['getTime']()===_0x4eed50['getTime']()?_0x1c9256['getTime']()===_0x32f00b['getTime']():_0x1c9256<_0x4eed50&&_0x1c9256>=_0x32f00b:_0x1c9256<_0x4eed50;}return!0x0;});}}class ha extends _0x1aa7e1{['_aiConnector'];['_aiChatHistoryUi'];['_aiChatController'];static get['requires'](){return[rs,Ys,ra,ns];}static get['pluginName'](){return'AIChatHistoryController';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){this['_aiConnector']=this['context']['plugins']['get'](rs),this['_aiChatHistoryUi']=this['context']['plugins']['get'](ra),this['_aiChatController']=this['context']['plugins']['get'](Ys);const _0xb716e2=this['context']['plugins']['get'](ns);try{const _0x1240d5=this['_aiChatController']['getGroupId']();this['history']=new oa({'connector':this['_aiConnector'],'group':_0x1240d5}),this['listenTo'](this['_aiChatHistoryUi'],'removeConversation',(_0x521def,_0x58fb12)=>{this['_setItemLoading'](_0x58fb12['id'],'remove'),this['_handleRemove'](_0x58fb12['id']);}),this['listenTo'](this['_aiChatHistoryUi'],'editConversationTitle',(_0x2120e0,_0x57703a)=>{this['_setItemLoading'](_0x57703a['id'],'rename'),this['_handleEditTitle'](_0x57703a['id'],_0x57703a['title']);}),this['listenTo'](this['history'],'itemUpdated',(_0x779f1e,_0x45b807)=>{void 0x0!==_0x45b807['updates']['title']&&this['_aiChatHistoryUi']['updateItemTitle'](_0x45b807['itemId'],_0x45b807['updates']['title']),void 0x0!==_0x45b807['updates']['pinned']&&this['_updateHistoryItemsUI'](),this['_clearItemLoading'](_0x45b807['itemId']);}),this['listenTo'](this['history'],'itemRemoved',(_0x3c4518,_0x584525)=>{this['_aiChatController']['_handleRemovedConversation'](_0x584525['itemId']),this['_aiChatHistoryUi']['removeHistoryItem'](_0x584525['itemId']),this['_clearItemLoading'](_0x584525['itemId']);}),this['listenTo'](this['history'],'itemsLoaded',()=>{this['_updateHistoryItemsUI']();}),this['listenTo'](this['history'],'error',(_0x44ed91,_0x67d64f)=>{this['_handleHistoryErrorUI'](_0x67d64f['error'],_0x67d64f['operation'],_0x67d64f['itemId']);}),this['listenTo'](this['_aiChatHistoryUi'],'selectConversation',(_0x3cc740,_0x33d0a5)=>{this['_handleSelectConversation'](_0x33d0a5['id']);}),this['listenTo'](this['_aiChatHistoryUi'],'setConversationPinned',(_0x554760,_0x8a413c)=>{const _0x562826=_0x8a413c['pinned']?'pin':'unpin';this['_setItemLoading'](_0x8a413c['id'],_0x562826),this['_handleTogglePin'](_0x8a413c['id'],_0x8a413c['pinned']);}),this['listenTo'](this['_aiChatHistoryUi'],'openChat',()=>{_0xb716e2['view']['activateTab']('chat');}),this['listenTo'](this['_aiChatController'],'change:activeConversation',()=>{this['_updateHistoryItemsUI']();}),_0xb716e2['view']['on']('activateTab:history',()=>{this['_showConversationHistory']();}),this['listenTo'](_0xb716e2,'resizedTabs',(_0x3cbc18,_0x5de1c9)=>{this['_setIsMaximized'](_0x5de1c9);}),this['listenTo'](this['_aiChatHistoryUi'],'resizeTabs',()=>{_0xb716e2['resize']();});}catch(_0x14df85){this['_handleHistoryErrorUI'](_0x14df85,'init');}}async['_handleEditTitle'](_0x458896,_0x176688){await this['history']['updateItemTitle'](_0x458896,_0x176688);}async['_handleTogglePin'](_0x1470c1,_0x37d586){await this['history']['updateItemPinned'](_0x1470c1,_0x37d586);}async['_handleRemove'](_0x3e6f75){await this['history']['removeItem'](_0x3e6f75);}async['_handleSelectConversation'](_0x5d941f){await this['_aiChatController']['loadConversation'](_0x5d941f);}async['_showConversationHistory'](){this['_aiChatHistoryUi']['showError'](''),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x0),await this['history']['init'](),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x1);}['_updateHistoryItemsUI'](){const _0x172d26=this['_aiChatController']['activeConversation']?.['id'],_0x2f8566=this['_getCategorizedItems']()['map'](_0x13a035=>({'title':_0x13a035['title'],'items':_0x13a035['items']['map'](_0x50f838=>({'id':_0x50f838['id'],'title':_0x50f838['title']||as(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION'),'createdAt':new Date(_0x50f838['createdAt'])['toLocaleDateString'](),'active':_0x50f838['id']===_0x172d26,'pinned':_0x50f838['pinned']}))}));this['_aiChatHistoryUi']['updateItems'](_0x2f8566);}['_setItemLoading'](_0x2e3a22,_0x2ad2cb){this['_aiChatHistoryUi']['updateItemLoadingState'](_0x2e3a22,_0x2ad2cb,!0x0);}['_clearItemLoading'](_0xdedc41){this['_aiChatHistoryUi']['updateItemLoadingState'](_0xdedc41,null,!0x1);}['_handleHistoryErrorUI'](_0x22b784,_0xa9cfb0,_0x2c3592){const _0x1c65ea=this['_generateErrorMessage'](_0xa9cfb0,_0x2c3592);this['_aiChatHistoryUi']['showError'](_0x1c65ea),_0x2c3592&&this['_clearItemLoading'](_0x2c3592),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x1);}['_generateErrorMessage'](_0x507010,_0x5c04c4){const _0x1fe48b=_0x5c04c4?this['history']['getItem'](_0x5c04c4):null,_0x3b4d0e=_0x1fe48b?.['title']||as(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION');switch(_0x507010){case'updateItemTitle':return as(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_UPDATE_TITLE',_0x3b4d0e);case'updateItemPinned':{const _0x5d424b=as(this['context']['locale'],_0x1fe48b?.['pinned']?'AI_CHAT_HISTORY_UNPIN_ACTION':'AI_CHAT_HISTORY_PIN_ACTION');return as(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_UPDATE_PINNED',[_0x5d424b,_0x3b4d0e]);}case'removeItem':return as(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_REMOVE_ITEM',_0x3b4d0e);case'init':case'loadItems':return as(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_LOAD_ITEMS');default:return as(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_GENERIC');}}['_getCategorizedItems'](){const _0xb12ebd=new Date(),_0xb6db63=new Date(_0xb12ebd['getFullYear'](),_0xb12ebd['getMonth'](),_0xb12ebd['getDate']()),_0x21bf06=new Date(_0xb6db63);_0x21bf06['setDate'](_0x21bf06['getDate']()-0x1);const _0x1b256e=new Date(_0xb6db63);_0x1b256e['setDate'](_0x1b256e['getDate']()-0xe);const _0x150d12=this['history']['getItems']({'pinned':!0x0}),_0x495117=this['history']['getItems']({'from':_0xb6db63,'to':_0xb6db63}),_0x5f1dd9=this['history']['getItems']({'from':_0x21bf06,'to':_0x21bf06}),_0x241a7b=this['history']['getItems']({'from':_0x1b256e,'to':_0x21bf06}),_0x5335aa=this['history']['getItems']({'to':_0x1b256e}),_0x49bef1=[];return _0x150d12['length']>0x0&&_0x49bef1['push']({'title':as(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_PINNED'),'items':_0x150d12}),_0x495117['length']>0x0&&_0x49bef1['push']({'title':as(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_TODAY'),'items':_0x495117}),_0x5f1dd9['length']>0x0&&_0x49bef1['push']({'title':as(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_YESTERDAY'),'items':_0x5f1dd9}),_0x241a7b['length']>0x0&&_0x49bef1['push']({'title':as(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_LAST_14_DAYS'),'items':_0x241a7b}),_0x5335aa['length']>0x0&&_0x49bef1['push']({'title':as(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_LATER'),'items':_0x5335aa}),_0x49bef1;}['_setIsMaximized'](_0x4e39eb){this['_aiChatHistoryUi']['setIsMaximized'](_0x4e39eb);}}class ca extends _0x1aa7e1{static get['requires'](){return[ha,ra];}static get['pluginName'](){return'AIChatHistory';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class la extends _0x1aa7e1{static get['requires'](){return[Ys,qs,Zr,ca];}static get['pluginName'](){return'AIChat';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x5479f1){super(_0x5479f1),this['context']['config']['define']('ai.chat.context',{'document':{'enabled':!0x0},'urls':{'enabled':!0x0},'files':{'enabled':!0x0},'sources':[],'alwaysAddSelection':!0x1}),this['context']['config']['define']('ai.chat.initialConversation','new');}}class ua extends kt{['id'];constructor(_0x54f90e,_0x3e36b8){super(_0x54f90e);const {id:_0x3206f3,type:_0x58d54f,icon:_0x1d6a87}=_0x3e36b8;this['id']=_0x3206f3,this['set']({'label':_0x3e36b8['label'],'withText':!0x0,'class':'ck-ai-chat-shortcut'}),this['extendTemplate']({'attributes':{'data-cke-ai-shortcut-id':_0x3e36b8['id']}}),_0x1d6a87?this['icon']=_0x1d6a87:'chat'===_0x58d54f?this['icon']=_0x1f2170:'review'===_0x58d54f?this['icon']=_0x15e910:'translate'===_0x58d54f&&(this['icon']=_0x16125b);}}class da extends Nt{['listView'];constructor(_0x5c0466,_0x5e1358){super(_0x5c0466);const _0x3d17b9=_0x5e1358['map'](_0x4ef14b=>{const _0x3d4625=new Pt(this['locale']),_0x2eb62b=new ua(this['locale'],_0x4ef14b);return _0x3d4625['children']['add'](_0x2eb62b),_0x2eb62b['delegate']('execute')['to'](this),_0x3d4625;});this['listView']=new Lt(this['locale']),this['listView']['items']['addMany'](_0x3d17b9),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat-shortcuts']},'children':[this['listView']]});}}const _a='chat-shortcuts';class Aa extends _0x1aa7e1{['_shortcuts'];['_shortcutsView'];['_aiChatUI'];static get['requires'](){return[Zr];}static get['pluginName'](){return'AIChatShortcuts';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){this['_aiChatUI']=this['context']['plugins']['get'](Zr),this['_shortcuts']=this['context']['config']['get']('ai.chat.shortcuts')??[];const _0x41a6f2=this['context']['plugins']['get']('AIChatController');this['_shortcuts']['length']&&(this['_validateShortcuts'](),this['_aiChatUI']['on']('conversationCreated',()=>{_0x41a6f2['activeConversation']['isFromHistory']||this['_injectShortcuts']();}),this['listenTo'](_0x41a6f2,'interactionStarted',()=>{this['_removeShortcuts']();}));}['_validateShortcuts'](){const _0x5835d9=['chat','review','translate'];this['_shortcuts']['forEach'](_0x1e753c=>{let _0x4329da=!0x0;if(_0x1e753c['id']&&_0x1e753c['label']&&_0x5835d9['includes'](_0x1e753c['type'])?'chat'===_0x1e753c['type']&&(_0x4329da='string'==typeof _0x1e753c['prompt']):_0x4329da=!0x1,!_0x4329da)throw new ot('ai-chat-shortcuts-invalid-config',this['context'],{'shortcut':_0x1e753c});});}['_injectShortcuts'](){const _0x3d40e3=this['context']['plugins']['get'](Zr);this['_shortcutsView']=new da(this['context']['locale'],this['_shortcuts']),this['_shortcutsView']['render'](),_0x3d40e3['addFeedItemCustomElement'](this['_shortcutsView']['element'],_a),this['_shortcutsView']['on']('execute',_0x33dae2=>{const _0x3febb6=_0x33dae2['source']['id'];this['_executeShortcut'](_0x3febb6);});}['_removeShortcuts'](){const _0x2872e9=this['context']['plugins']['get'](Zr);_0x2872e9['hasFeedItem'](_a)&&_0x2872e9['removeFeedItem'](_a),this['_shortcutsView']?.['destroy']();}['_executeShortcut'](_0x2ae51b){const _0x592f0c=this['_shortcuts']['find'](_0x2dc0bc=>_0x2dc0bc['id']===_0x2ae51b),_0x50b0c1=_0x592f0c['type'];'chat'===_0x50b0c1?this['_runChatShortcut'](_0x592f0c):'review'===_0x50b0c1?_0x592f0c['commandId']?this['_runReviewShortcut'](_0x592f0c):this['_switchTab']('reviewMode'):'translate'===_0x50b0c1&&(_0x592f0c['language']?this['_runTranslateShortcut'](_0x592f0c):this['_switchTab']('translate'));}['_switchTab'](_0x2776f5){if(!this['context']['plugins']['has']('AITabs'))throw new ot('ai-chat-shortcuts-ai-tabs-not-found',this['context'],{'tabName':_0x2776f5});this['context']['plugins']['get']('AITabs')['view']['activateTab'](_0x2776f5);}async['_runChatShortcut']({prompt:_0x44ab1d,draftMode:_0x563f36,useWebSearch:_0x17ef3d=!0x1,useReasoning:_0x4ddb19=!0x1,model:_0x2e5eee}){const _0x3a4fd2=this['context']['plugins']['get']('AIChatController'),_0x249cea=_0x3a4fd2['activeConversation'];let _0xb8882f;_0xb8882f=_0x2e5eee?await _0x249cea['chatModels']['getModel'](_0x2e5eee):await _0x249cea['chatModels']['getDefault'](),_0xb8882f&&await _0x249cea['setModel'](_0xb8882f),_0x249cea['setWebSearch'](_0x17ef3d),_0x249cea['setReasoning'](_0x4ddb19),_0x3a4fd2['addCurrentDocumentToChatContext'](),_0x563f36?(this['_aiChatUI']['setPromptInputValue'](_0x44ab1d),this['_aiChatUI']['focusPromptInput'](!0x0)):_0x3a4fd2['sendMessage']({'message':_0x44ab1d});}['_runReviewShortcut']({commandId:_0x2e4134,model:_0x41e05c,prompt:_0x4ca534,params:_0x2445cd}){if(!this['context']['plugins']['has']('AIReviewModeUI'))throw new ot('ai-chat-shortcuts-review-mode-not-found',this['context']);this['_switchTab']('reviewMode');const _0x1be0eb={'id':_0x2e4134,'isCustom':'custom'===_0x2e4134};_0x41e05c&&_0x4ca534&&(_0x1be0eb['args']={'model':_0x41e05c,'prompt':_0x4ca534}),_0x2445cd&&(_0x1be0eb['params']=_0x2445cd),this['context']['plugins']['get']('AIReviewModeUI')['fire']('runReviewCheck',_0x1be0eb);}['_runTranslateShortcut']({language:_0x309f2c}){if(!this['context']['plugins']['has']('AITranslateUI'))throw new ot('ai-chat-shortcuts-translate-not-found',this['context']);this['_switchTab']('translate'),this['context']['plugins']['get']('AITranslateUI')['fire']('runReviewCheck',{'id':_0x309f2c,'args':{'language':_0x309f2c}});}}class ga extends _0x335282{constructor(_0x5df599){super(_0x5df599);const _0x26b668=_0x5df599['plugins']['get']('AITabs')['view'];this['bind']('value')['to'](_0x26b668,'isVisible'),this['isEnabled']=!0x0;}['execute'](){const _0x1020fa=this['editor']['plugins']['get']('AITabs')['view'];_0x1020fa['isVisible']=!_0x1020fa['isVisible'];}}class Ia extends _0x2dfd9d{static get['requires'](){return[ns];}static get['pluginName'](){return'AIToggleButtonUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x2ce413=this['editor'];_0x2ce413['commands']['add']('toggleAi',new ga(_0x2ce413)),_0x2ce413['ui']['componentFactory']['add']('toggleAi',()=>{const _0x3375a2=this['_createAIUIButton'](kt);return _0x3375a2['set']({'tooltip':!0x0,'class':'ck-ai-toggle-button'}),_0x3375a2;}),_0x2ce413['ui']['componentFactory']['add']('menuBar:toggleAi',()=>{const _0x57a087=this['_createAIUIButton'](Kt);return _0x57a087['set']({'role':'menuitemcheckbox'}),_0x57a087;});}['_createAIUIButton'](_0x698f40){const _0x848fe2=this['editor'],_0x2da00a=_0x848fe2['commands']['get']('toggleAi'),_0x314f7a=new _0x698f40(_0x848fe2['locale']);return _0x314f7a['set']({'label':as(_0x848fe2['locale'],'AI_TOGGLE_BUTTON_LABEL'),'icon':_0x22c2b9,'isToggleable':!0x0}),_0x314f7a['bind']('isEnabled')['to'](_0x2da00a),_0x314f7a['bind']('isOn')['to'](_0x2da00a,'value',_0x128b00=>!!_0x128b00),this['listenTo'](_0x314f7a,'execute',()=>{_0x2da00a['execute']();}),_0x314f7a;}}const Ea=['applySuggestion','insertSuggestion','showNext','showPrevious'];class Ta extends Nt{['_errorView'];constructor(_0x1089b6){super(_0x1089b6),this['set']('_errorMessage',''),this['set']('_isErrorVisible',!0x1);}['showBlockingError'](_0x2d586a){this['showError'](_0x2d586a);}['showError'](_0x23350c){this['_errorView']||(this['_errorView']=this['_createErrorView']()),this['_errorMessage']=_0x23350c,this['_isErrorVisible']=!0x0;}['hideError'](){this['_isErrorVisible']=!0x1;}['_createErrorView'](){const _0x20967d=new Nt(this['locale']),_0x26aab0=new Nt(this['locale']);return _0x26aab0['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-suggestion__error-text']},'children':[{'text':this['bindTemplate']['to']('_errorMessage')}]}),_0x20967d['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__error','ck-ai-balloon-error',this['bindTemplate']['if']('_isErrorVisible','ck-hidden',_0x3cf579=>!_0x3cf579)]},'children':[_0x26aab0]}),_0x20967d;}}const pa=0xa;class ma extends _0x1aa7e1{static get['requires'](){return[qs];}static get['pluginName'](){return'AIBalloon';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['isOpen']=!0x1;['_currentConfig'];['_isUpdatingMarkers']=!0x1;['open'](_0x4145b9){const {id:_0x1cc137}=this['_currentConfig']??{};this['_currentConfig']=_0x4145b9;const {id:_0x3dcab3}=this['_currentConfig'];this['isOpen']&&_0x1cc137===_0x3dcab3?this['_updateDialog']():this['_showDialog']();}['close'](){const _0x315fcf=Fs(this['context'])['plugins']['get']('Dialog');_0x315fcf['isOpen']&&this['_currentConfig']&&_0x315fcf['id']===this['_currentConfig']['id']&&_0x315fcf['hide']();}['_updateDialog'](){const _0xca4bcc=Fs(this['context'])['plugins']['get']('Dialog'),{icon:_0x1adadf,title:_0x46e662}=this['_currentConfig'];_0xca4bcc['view']?.['headerView']&&(_0xca4bcc['view']['headerView']['label']=_0x46e662,_0xca4bcc['view']['headerView']['iconView']&&_0x1adadf&&(_0xca4bcc['view']['headerView']['iconView']['content']=_0x1adadf)),this['_isUpdatingMarkers']=!0x0,this['_showFakeVisualSelection'](),this['_isUpdatingMarkers']=!0x1,_0xca4bcc['view']?.['updatePosition']();}['_showFakeVisualSelection'](){this['context']['plugins']['get'](qs)['showFakeVisualSelection']({'ranges':this['_currentConfig']['ranges'],'id':'balloon','priority':0x64}),window['getSelection']()?.['removeAllRanges']();}['_hideFakeVisualSelection'](){this['context']['plugins']['get'](qs)['hideFakeVisualSelection']('balloon');}['_showDialog'](){const _0x5db6aa=Fs(this['context'])['plugins']['get']('Dialog'),{id:_0x423929,title:_0x455606,icon:_0x16f510,class:_0x46613a,mainView:_0x1676c0}=this['_currentConfig'];_0x1676c0['delegate'](...Ea)['to'](this),_0x5db6aa['show']({'title':_0x455606,'icon':_0x16f510,'hasCloseButton':!0x0,'id':_0x423929,'position':this['_calculateDialogPosition']['bind'](this),'className':'ck-ai-balloon\x20'+(_0x46613a||''),'content':_0x1676c0,'onShow':_0x604f73=>{this['_showFakeVisualSelection'](),this['_setupFakeVisualSelectionMarkerRemovalListener']();const _0x6b604a=this['_getSelectionElements']();_0x6b604a&&_0x6b604a[0x0]&&mt({'target':_0x6b604a[0x0],'ancestorOffset':0x14,'alignToTop':!0x0,'viewportOffset':{'top':0x14,'bottom':0x14,'left':0x0,'right':0x0}}),this['isOpen']=!0x0,_0x604f73['once']('hide',()=>{this['fire']('beforeDialogClosed',{'id':_0x423929});},{'priority':'high'});},'onHide':()=>{this['_hideFakeVisualSelection'](),this['_cleanupFakeVisualSelectionMarkerRemovalListener'](),this['fire']('dialogClosed',{'id':_0x423929}),this['isOpen']=!0x1;}});}['_calculateDialogPosition'](_0x283d03,_0x1207a6){if(!_0x1207a6)return null;const _0x498ed0=this['_getSelectionElements']();if(!_0x498ed0||0x0===_0x498ed0['length'])return{'left':Math['round'](_0x1207a6['left']+_0x1207a6['width']/0x2-_0x283d03['width']/0x2),'top':Math['round'](_0x1207a6['top']+_0x1207a6['height']/0x2-_0x283d03['height']/0x2)};const _0x50d0c4=Math['round'](_0x1207a6['left']+_0x1207a6['width']/0x2-_0x283d03['width']/0x2),_0x4b3dfe=_0x498ed0['map'](_0x443147=>new ut(_0x443147)),_0x28c4f9=_0x283d03['height'];return{'left':_0x50d0c4,'top':this['_calculateOptimalTopPosition'](_0x4b3dfe,_0x28c4f9,_0x1207a6)};}['_calculateOptimalTopPosition'](_0x5dea24,_0x121220,_0x5f5dd5){const _0x4f77ee=new ut(ct['window']),_0x1bc054=_0x5dea24['map'](_0x40c724=>_0x40c724['getVisible']())['filter'](_0x11b8bd=>_0x11b8bd),_0x5aac00=ut['getBoundingRect'](_0x1bc054);if(!_0x5aac00)return Math['round'](_0x5f5dd5['top']+_0x5f5dd5['height']/0x2);const _0x409704=_0x4f77ee['getIntersection'](_0x5aac00);if(!_0x409704)return Math['round'](_0x5f5dd5['top']+_0x5f5dd5['height']/0x2);const _0x1ebf9b=_0x5f5dd5['getVisible'](),_0x30362d=_0x1ebf9b&&_0x5aac00['height']>_0x1ebf9b['height'],_0x47d064=_0x409704['top'],_0x17a2bb=_0x409704['bottom'];if(_0x30362d){const _0x9f75b1=(_0x1ebf9b||_0x4f77ee)['height']/0x2-_0x121220/0x2,_0x1b795d=_0x47d064-pa-_0x5f5dd5['top'],_0x53801e=_0x5f5dd5['bottom']-_0x17a2bb-pa;return _0x1b795d>=_0x121220?Math['max'](pa,_0x47d064-_0x121220-pa):_0x53801e>=_0x121220?_0x17a2bb+pa:Math['max'](pa,_0x9f75b1);}const _0x56db93=_0x47d064-_0x121220,_0x4f382c=_0x5f5dd5['bottom']-_0x17a2bb-pa,_0x51e91d=_0x47d064-pa-_0x5f5dd5['top'];let _0x7b1f54;if(_0x4f382c>=_0x121220)_0x7b1f54=_0x17a2bb+pa;else{if(_0x51e91d>=_0x121220)_0x7b1f54=_0x56db93-pa;else _0x7b1f54=_0x47d064+_0x5aac00['height']/0x2-_0x121220/0x2;}return _0x7b1f54;}['_setupFakeVisualSelectionMarkerRemovalListener'](){const _0x34b6e4=Fs(this['context']);this['listenTo'](_0x34b6e4['model']['document'],'change',()=>{if(!this['_isUpdatingMarkers']){for(const {name:_0x132f21,data:{newRange:_0x134369}}of _0x34b6e4['model']['document']['differ']['getChangedMarkers']())if(_0x132f21['startsWith']($s+':')&&(_0x134369&&(_0x134369['start']['isEqual'](_0x134369['end'])||'$graveyard'==_0x134369['root']['rootName'])||null==_0x134369)){const _0xf13401=as(this['context']['locale'],'AI_BALLOON_SELECTION_REMOVED_ERROR');this['_currentConfig']['mainView']['showBlockingError'](_0xf13401),this['fire']('selectionRemoved');}}});}['_cleanupFakeVisualSelectionMarkerRemovalListener'](){const _0x3baeaf=Fs(this['context']);this['_currentConfig']['mainView']['hideError'](),this['stopListening'](_0x3baeaf['model']['document']);}['_getSelectionElements'](){const _0x5b5f78=Fs(this['context']);return _0x51f247(_0x5b5f78['editing'],[..._0x5b5f78['model']['markers']['getMarkersGroup']('ai-selection'),..._0x5b5f78['model']['markers']['getMarkersGroup']('ai-balloon-selection')]);}}class Ca extends Ot{['copyButton'];['likeButton'];['dislikeButton'];['showChangesButton'];['_config'];constructor(_0xa30354,_0x14669f={}){super(_0xa30354),this['set']('isEnabled',!0x0),this['set']('isShowChangesOn',!0x1),this['_config']={'showCopy':!0x1,'showLike':!0x1,'showDislike':!0x1,..._0x14669f};const _0x1fc3c7=!(this['_config']['showCopy']||this['_config']['showChanges']||this['_config']['showLike']||this['_config']['showDislike']||this['_config']['customView']?.['length']);this['class']=_0x1fc3c7?'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'](_0x65b5e5){this['showChangesButton']['isEnabled']=_0x65b5e5;}['_setupRatingButtons'](){this['likeButton']=new kt(this['locale']),this['likeButton']['set']({'icon':_0x49edf9,'label':as(this['locale'],'AI_MINI_TOOLBAR_LIKE'),'class':cs,'tooltip':!0x0}),this['likeButton']['bind']('isEnabled')['to'](this),this['likeButton']['on']('execute',()=>{this['fire']('like');}),this['dislikeButton']=new kt(this['locale']),this['dislikeButton']['set']({'icon':_0x5c3b17,'label':as(this['locale'],'AI_MINI_TOOLBAR_DISLIKE'),'class':cs,'tooltip':!0x0}),this['dislikeButton']['bind']('isEnabled')['to'](this),this['dislikeButton']['on']('execute',()=>{this['fire']('dislike');});}['_setupCopyButton'](){this['copyButton']=new kt(this['locale']),this['copyButton']['set']({'icon':_0x5ed933,'label':as(this['locale'],'AI_MINI_TOOLBAR_COPY'),'class':'ck-ai-mini-toolbar-copy-button\x20'+cs,'tooltip':!0x0}),this['copyButton']['bind']('isEnabled')['to'](this);const _0x39c7d0=new yt();_0x39c7d0['set']({'content':_0x2bffb7}),_0x39c7d0['extendTemplate']({'attributes':{'class':['ck-ai-mini-toolbar-copy-button__check-mark']}}),this['copyButton']['on']('execute',()=>{this['copyButton']['class']='ck-ai-mini-toolbar-copy-button\x20ck-ai-mini-toolbar-copy-button_copied\x20'+cs,setTimeout(()=>{this['copyButton']['class']='ck-ai-mini-toolbar-copy-button\x20'+cs;},0x7d0);}),this['copyButton']['children']['add'](_0x39c7d0);}['_setupShowChangesButton'](){this['showChangesButton']=new kt(this['locale']),this['showChangesButton']['set']({'icon':_0x40fc31,'label':as(this['locale'],'AI_SUGGESTION_BUTTON_SHOW_CHANGES'),'withText':'full'==this['_config']['showChanges'],'tooltip':'full'!=this['_config']['showChanges'],'class':cs}),this['showChangesButton']['bind']('isOn')['to'](this,'isShowChangesOn'),this['showChangesButton']['bind']('isEnabled')['to'](this),this['showChangesButton']['bind']('icon')['to'](this,'isShowChangesOn',_0x1a4056=>_0x1a4056?_0x381746:_0x40fc31),this['showChangesButton']['on']('execute',()=>{this['fire']('toggleShowChanges');});}}class wa extends Ta{['children'];['nextButtonView'];['previousButtonView'];['focusCycler'];['_focusables'];['_focusTracker'];['_keystrokes'];['_config'];['_streamableContentView'];['_toolbarContainerView'];['_partToolbarView'];['_stateView'];['_miniToolbarView'];constructor(_0xec818e,_0x1335ab){super(_0xec818e);const _0x477d64=this['bindTemplate'];this['set']('showDiff',!0x1),this['set']('_state','pending'),this['_focusTracker']=new _t(),this['_keystrokes']=new At(),this['_focusables']=this['createCollection'](),this['focusCycler']=new Mt({'focusables':this['_focusables'],'focusTracker':this['_focusTracker'],'keystrokeHandler':this['_keystrokes'],'actions':{'focusPrevious':'shift\x20+\x20tab','focusNext':'tab'}}),this['_config']=_0x1335ab,this['nextButtonView']=this['_createNextButtonView'](),this['previousButtonView']=this['_createPreviousButtonView'](),this['_streamableContentView']=new un(_0xec818e),this['_partToolbarView']=new hn(_0xec818e,_0x1335ab['availableActions']),this['_partToolbarView']['delegate']('applySuggestion','insertSuggestion','rejectSuggestion')['to'](this),this['_togglePartToolbarButtonsVisibility'](_0x1335ab),this['_stateView']=new an(_0xec818e),this['_stateView']['isVisible']=!0x1,this['_miniToolbarView']=new Ca(_0xec818e,{'showChanges':'full'}),this['_miniToolbarView']['bind']('isShowChangesOn')['to'](this,'showDiff'),this['_miniToolbarView']['on']('toggleShowChanges',()=>{this['fire']('toggleSuggestionDisplayMode');}),this['_toolbarContainerView']=new fa(_0xec818e,[this['_partToolbarView'],this['_stateView'],this['_miniToolbarView']]),this['children']=this['createCollection']([this['_streamableContentView'],this['_toolbarContainerView']]),this['on']('change:_state',(_0xaeba47,_0x8034c9,_0x518751,_0xdeb468)=>{let _0x532251,_0x407b8b;'pending'===_0xdeb468?(_0x532251=this['_partToolbarView'],_0x407b8b=this['_stateView']):(_0x532251=this['_stateView'],_0x407b8b=this['_partToolbarView']),this['_stateView']['setState'](_0x518751),_0x532251['isVisible']=!0x1,_0x407b8b['isVisible']=!0x0;}),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat-balloon-main',_0x477d64['to']('_state',_0x11c3c7=>'ck-ai-chat-balloon-main_state_'+_0x11c3c7)]},'children':this['children']}),this['on']('change:isTrackChangesOn',()=>{this['_togglePartToolbarButtonsVisibility'](_0x1335ab);});}['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'](_0x39c498){_0x39c498?.['keepErrors']||this['hideError'](),await this['_streamableContentView']['update'](_0x39c498);}['setState'](_0x24501d){this['_state']=_0x24501d;}['showError'](_0x24c8c9){super['showError'](_0x24c8c9),this['children']['has'](this['_errorView'])||this['children']['add'](this['_errorView'],0x0);}['hideError'](){this['_isErrorVisible']&&(super['hideError'](),this['togglePartToolbarEnabled'](!0x0));}['showBlockingError'](_0x1e3f99){super['showBlockingError'](_0x1e3f99),this['togglePartToolbarEnabled'](!0x1);}['toggleRotatorButtonsVisibility'](_0x3dba25){this['nextButtonView']['isVisible']=this['previousButtonView']['isVisible']=_0x3dba25;}['togglePartToolbarEnabled'](_0x422923){this['_partToolbarView']['isEnabled']=_0x422923;}['_togglePartToolbarButtonsVisibility']({showApplyButton:_0x429b48,showSuggestButton:_0x548092}){_0x429b48=_0x429b48&&!this['isTrackChangesOn']&&this['_config']['availableActions']['includes']('applySuggestion'),_0x548092=_0x548092&&this['_config']['availableActions']['includes']('insertSuggestion'),this['_partToolbarView']['setButtonsVisibility']({'showApplyButton':_0x429b48,'showSuggestButton':_0x548092});}['_createNextButtonView'](){const _0x16c496=new kt(this['locale']);return _0x16c496['set']({'icon':_0x48e9e8,'label':as(this['locale'],'AI_BALLOON_NEXT_LABEL'),'isVisible':!0x0}),_0x16c496['on']('execute',()=>{this['fire']('showNext');}),_0x16c496;}['_createPreviousButtonView'](){const _0x21e8f5=new kt(this['locale']);return _0x21e8f5['set']({'icon':_0x2cf278,'label':as(this['locale'],'AI_BALLOON_PREVIOUS_LABEL'),'isVisible':!0x0}),_0x21e8f5['on']('execute',()=>{this['fire']('showPrevious');}),_0x21e8f5;}}class fa extends Nt{constructor(_0x2557e4,_0x593f8b){super(_0x2557e4),this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-balloon__toolbar-container']},'children':_0x593f8b});}}class Sa extends _0x2dfd9d{static get['requires'](){return[Vt,ma];}static get['pluginName'](){return'AIChatBalloon';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['_chatBalloonView'];constructor(_0x2a5bd6){super(_0x2a5bd6),this['set']('showDiff',!0x1);}['open'](_0x3a281d){const _0x3d8471=this['editor'];this['_chatBalloonView']||(this['_chatBalloonView']=this['_createChatBalloonView']()),_0x3d8471['plugins']['get']('AIBalloon')['open']({..._0x3a281d,'id':'aiChatBalloon','class':'ck-ai-chat-balloon','mainView':this['_chatBalloonView']}),this['_toggleRotatorButtonsInDialogHeader'](_0x3a281d['showRotator']),this['_chatBalloonView']['togglePartToolbarEnabled'](!_0x3a281d['areActionsDisabled']),this['_restoreDefaultViewFocus']();}['close'](){this['editor']['plugins']['get']('AIBalloon')['close']();}['updateContent'](_0x5bac70){return this['_chatBalloonView']||(this['_chatBalloonView']=this['_createChatBalloonView']()),this['_chatBalloonView']['updateContent'](_0x5bac70);}['setState'](_0x2a6b73){this['_chatBalloonView']&&this['_chatBalloonView']['setState'](_0x2a6b73);}['_createChatBalloonView'](){const _0x133a23=this['editor'],_0x2b5185=_0x133a23['plugins']['get']('AIBalloon'),_0x515024=_0x133a23['commands']['get']('trackChanges');let _0x46a89d=_0x133a23['config']['get']('ai.availableReplyActions')||[...gn];_0x133a23['plugins']['has']('TrackChanges')||(_0x46a89d=_0x46a89d['filter'](_0x4522ab=>'insertSuggestion'!=_0x4522ab));const _0x40d2e5=new wa(_0x133a23['locale'],{'availableActions':_0x46a89d,'showApplyButton':!0x0,'showSuggestButton':!!_0x515024});return _0x40d2e5['bind']('showDiff')['to'](this),_0x40d2e5['delegate'](...Qs)['to'](this),_0x40d2e5['delegate']('showPrevious','showNext')['to'](this),_0x2b5185['delegate']('dialogClosed')['to'](this),_0x40d2e5['on']('applySuggestion',this['_restoreDefaultViewFocus']['bind'](this)),_0x40d2e5['on']('insertSuggestion',this['_restoreDefaultViewFocus']['bind'](this)),_0x40d2e5['on']('rejectSuggestion',this['_restoreDefaultViewFocus']['bind'](this)),_0x515024&&_0x40d2e5['bind']('isTrackChangesOn')['to'](_0x515024,'value'),_0x40d2e5['render'](),_0x40d2e5;}['_toggleRotatorButtonsInDialogHeader'](_0x314e34){const _0x9e81a0=this['editor'],_0x4878bd=_0x9e81a0['plugins']['get']('Dialog')['view']['headerView']['children'];this['_chatBalloonView']['toggleRotatorButtonsVisibility'](_0x314e34),_0x4878bd['has'](this['_chatBalloonView']['previousButtonView'])||(_0x4878bd['addMany']([this['_chatBalloonView']['previousButtonView'],this['_chatBalloonView']['nextButtonView']],0x0),_0x9e81a0['plugins']['get']('AIBalloon')['once']('beforeDialogClosed',()=>{_0x4878bd['remove'](this['_chatBalloonView']['previousButtonView']),_0x4878bd['remove'](this['_chatBalloonView']['nextButtonView']);}));}['_restoreDefaultViewFocus'](){this['_chatBalloonView']['focus']();}}class ba extends _0x2dfd9d{static get['requires'](){return[Ia,Sa,_0xf1c886];}static get['pluginName'](){return'AIEditorIntegration';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}function Ra(_0x4ddee1){const {editor:_0x112028,action:_0x5569f2,withText:_0x122012=!0x1,withIcon:_0x1d4b8f=!0x0,isInDropdown:_0x3b3363=!0x0,shouldPreventFocus:_0x4f7530=!0x1}=_0x4ddee1;return()=>{const _0x3b49d0=_0x112028['locale'],_0x443d6c=new kt(_0x3b49d0),_0x41d21c=_0x443d6c['bindTemplate'];_0x3b3363&&_0x443d6c['extendTemplate']({'on':{'mouseenter':_0x41d21c['to'](()=>{_0x4f7530&&_0x4f7530()||_0x443d6c['focus']();})}});const _0x213826=_0x5569f2['icon']??_0x5569f2['parent']?.['icon'];return _0x443d6c['set']({'label':_0x5569f2['label'],'withText':_0x122012,'role':'menuitem','icon':_0x1d4b8f?_0x213826??_0x4a7acf:void 0x0,'tooltip':!_0x122012,'class':'ck-ai-quick-actions-button','isEnabled':_0x5569f2['isEnabled']}),_0x443d6c['on']('execute',()=>{_0x112028['editing']['view']['focus'](),_0x112028['commands']['execute']('aiQuickAction',_0x5569f2);}),_0x443d6c;};}class Oa extends _0x52551e{['arrowView'];constructor(_0x21ef26,_0x24d782){super(_0x21ef26,_0x24d782);const _0x2348c5=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',_0xdd3bd1=>String(_0xdd3bd1)),'data-cke-tooltip-disabled':_0x2348c5['to']('isOn')},'on':{'mouseenter':_0x2348c5['to']('mouseenter')}});}['render'](){super['render'](),this['children']['add'](this['arrowView']);}['_createArrowView'](){const _0x218ae7=new yt();return _0x218ae7['content']=_0x52b6b2,_0x218ae7['extendTemplate']({'attributes':{'class':'ck-dropdown-menu-list__nested-menu__button__arrow'}}),_0x218ae7;}}class ka extends Lt{['_allListItems'];['_allSearchableItems'];constructor(_0x1b4042,_0x13e78d,_0x2df39d){super(_0x1b4042),this['_allListItems']=_0x13e78d,this['_allSearchableItems']=_0x2df39d;}['filter'](_0x1f656b){if(!_0x1f656b)return this['items']['clear'](),this['items']['addMany'](this['_allListItems']),this['_clearHighlight'](),{'resultsCount':this['_allListItems']['length'],'totalItemsCount':this['_allListItems']['length']};const _0x45b16b=_0x1f656b['source']['toLowerCase']()['trim'](),_0x1b815f=this['_allSearchableItems']['filter'](_0x402257=>(_0x402257['groupLabel']?_0x402257['label']+'\x20('+_0x402257['groupLabel']+')':_0x402257['label'])['toLowerCase']()['includes'](_0x45b16b));return this['items']['clear'](),this['items']['addMany'](_0x1b815f['sort']((_0x53d0ab,_0xf42b41)=>{const _0x58b1c3=_0x53d0ab['groupLabel'],_0x334224=_0xf42b41['groupLabel'];return _0x58b1c3||_0x334224?_0x58b1c3?0x1:-0x1:0x0;})['map'](_0x407f58=>_0x407f58['item'])),this['_highlightQuery'](_0x45b16b,_0x1b815f),{'resultsCount':_0x1b815f['length'],'totalItemsCount':this['_allSearchableItems']['length']};}['_highlightQuery'](_0x3a9bb2,_0xc3c941){if(!_0x3a9bb2)return;const _0x58157b=new RegExp(_0x8cdac(_0x3a9bb2),'gi');_0xc3c941['forEach'](_0x45ae69=>{_0x45ae69['highlightViews']&&_0x45ae69['highlightViews']['forEach'](_0x33d7eb=>{'function'==typeof _0x33d7eb['highlightText']&&_0x33d7eb['highlightText'](_0x58157b);});});}['_clearHighlight'](){this['_allSearchableItems']['forEach'](_0x1d0789=>{_0x1d0789['highlightViews']&&_0x1d0789['highlightViews']['forEach'](_0x4e1a95=>{'function'==typeof _0x4e1a95['highlightText']&&_0x4e1a95['highlightText'](null);});});}}const Na='menu',va='menuitem';class ya extends Nt{['_bodyCollection'];['optionsListView'];['_searchTextView']=null;['_allSearchableItems']=[];['children'];['focusTracker'];['keystrokes'];['_focusables'];['focusCycler'];['_openNestedPanels']=new Set();['_hasSearch'];constructor(_0x5ce031,_0x3660ca,_0x5b620c,_0x278531,_0x42713a=!0x1){const _0x40d6b9=_0x5ce031['locale'];super(_0x40d6b9),this['_bodyCollection']=_0x278531,this['_hasSearch']=_0x42713a;const _0x51a07c=this['_createListItems'](_0x5ce031,_0x3660ca,_0x5b620c);this['optionsListView']=new ka(_0x40d6b9,_0x51a07c,this['_allSearchableItems']),this['optionsListView']['role']=Na,this['optionsListView']['items']['addMany'](_0x51a07c),this['focusTracker']=new _t(),this['keystrokes']=new At(),_0x42713a&&(this['_searchTextView']=this['_createSearchTextView']()),this['_focusables']=_0x51a07c,this['focusCycler']=new Mt({'focusables':this['_focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes']}),_0x42713a&&this['_searchTextView']&&this['focusCycler']['chain'](this['_searchTextView']['focusCycler']);const _0x45ff1e=_0x42713a&&this['_searchTextView']?[this['_searchTextView']]:[this['optionsListView']];this['children']=new _0x1898c2(_0x45ff1e),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-ai-quick-actions','ck-rounded-corners'],'dir':_0x40d6b9['uiLanguageDirection']},'children':this['children']});}['_createSearchTextView'](){return new _0x1df41a(this['locale'],{'filteredView':this['optionsListView'],'queryView':{'label':as(this['locale'],'AI_QUICK_ACTIONS_SEARCH')},'class':'ck-ai-quick-actions-search','infoView':{'text':{'notFound':{'primary':as(this['locale'],'AI_QUICK_ACTIONS_SEARCH_NOT_FOUND')}}}});}['_isSearchFocused'](){if(!this['_hasSearch']||!this['_searchTextView']||!this['_searchTextView']['queryView']['fieldView']['element'])return!0x1;const _0x4df66f=this['_searchTextView']['queryView']['fieldView']['element']['ownerDocument']?.['activeElement'];return this['_searchTextView']['queryView']['fieldView']['element']['contains'](_0x4df66f);}['_createListItems'](_0x55b0a2,_0x20aa3b,_0x44e154){const _0x244af2=new _0x1898c2();return _0x20aa3b['forEach'](_0x380233=>{if('actions'in _0x380233){const {listItem:_0x542a0d}=this['_createActionGroupButton'](_0x55b0a2,_0x380233,_0x44e154);_0x244af2['add'](_0x542a0d),_0x380233['actions']['forEach'](_0x26b1c7=>{this['_createActionButton'](_0x55b0a2,_0x26b1c7,_0x380233['label'],_0x380233['icon']);const {listItem:_0x3ff606,highlightViews:_0x448292}=this['_createSearchResultActionButton'](_0x55b0a2,_0x26b1c7,_0x380233['label'],_0x380233['icon']);this['_allSearchableItems']['push']({'item':_0x3ff606,'label':_0x26b1c7['label'],'groupLabel':_0x380233['label'],'highlightViews':_0x448292});});}else{const {listItem:_0x368858}=this['_createActionButton'](_0x55b0a2,_0x380233);_0x244af2['add'](_0x368858);const _0x26d3e1=_0x368858['children']['first'];if(_0x26d3e1){const {listItem:_0x5750a7,highlightViews:_0x2ad4d7}=this['_createSearchResultActionButton'](_0x55b0a2,_0x380233);this['_allSearchableItems']['push']({'item':_0x5750a7,'label':_0x26d3e1['label']||'','highlightViews':_0x2ad4d7});}}}),_0x244af2;}['_createActionButton'](_0x1e15c9,_0x1274bc,_0x93cbd1,_0x57400c){const _0x1d06ab=new Pt(this['locale']);if(_0x93cbd1&&_0x57400c){const _0x353c10=new kt(this['locale']),_0x55dd77=_0x353c10['bindTemplate'],_0x567f52=new _0x18e9fc();_0x567f52['text']=_0x1274bc['label'];const _0x3dbd8f=new _0x18e9fc();_0x3dbd8f['text']=_0x93cbd1;const _0x32cc5c=new yt();_0x32cc5c['content']=_0x57400c,_0x32cc5c['extendTemplate']({'attributes':{'class':'ck-ai-quick-actions-button__group-icon'}});const _0x4a44f4=new Nt(this['locale']);_0x4a44f4['setTemplate']({'tag':'span','attributes':{'class':'ck-ai-quick-actions-button_with-group__open-paren'},'children':[{'text':'\x20('}]});const _0x29c2d6=new Nt(this['locale']);return _0x29c2d6['setTemplate']({'tag':'span','attributes':{'class':'ck-ai-quick-actions-button_with-group__close-paren'},'children':[{'text':')'}]}),_0x353c10['set']({'label':_0x1274bc['label']+'\x20('+_0x93cbd1+')','withText':!0x0,'role':'menuitem','class':'ck-ai-quick-actions-button\x20ck-ai-quick-actions-button_with-group','tooltip':!0x1}),_0x353c10['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':[_0x567f52,_0x4a44f4,_0x32cc5c,_0x3dbd8f,_0x29c2d6],'on':{'mouseenter':_0x55dd77['to'](()=>{this['_isSearchFocused']()||_0x353c10['focus']();}),'click':_0x55dd77['to'](()=>{_0x353c10['fire']('execute');})}}),_0x353c10['on']('execute',()=>{_0x1e15c9['editing']['view']['focus'](),_0x1e15c9['commands']['execute']('aiQuickAction',_0x1274bc);}),_0x1d06ab['children']['add'](_0x353c10),{'listItem':_0x1d06ab,'highlightViews':[_0x567f52,_0x3dbd8f]};}{const _0x319667=new _0x44e8e3(),_0x497f7c=new kt(this['locale'],_0x319667),_0x3fc59c=_0x497f7c['bindTemplate'],_0x5c9c41=_0x1274bc['icon']??_0x1274bc['parent']?.['icon'],_0x4c7c2f=void 0x0!==_0x1274bc['icon'];return _0x497f7c['set']({'label':_0x1274bc['label'],'withText':!0x0,'role':'menuitem','icon':_0x4c7c2f?_0x5c9c41??_0x4a7acf:void 0x0,'tooltip':!0x1,'class':'ck-ai-quick-actions-button'}),_0x497f7c['extendTemplate']({'on':{'mouseenter':_0x3fc59c['to'](()=>{this['_isSearchFocused']()||_0x497f7c['focus']();})}}),_0x497f7c['on']('execute',()=>{_0x1e15c9['editing']['view']['focus'](),_0x1e15c9['commands']['execute']('aiQuickAction',_0x1274bc);}),_0x1d06ab['children']['add'](_0x497f7c),{'listItem':_0x1d06ab,'highlightViews':[_0x319667]};}}['_createSearchResultActionButton'](_0x790a1d,_0x518b7f,_0x189f46,_0x21af9f){return _0x189f46&&_0x21af9f?this['_createSearchResultGroupedActionButton'](_0x790a1d,_0x518b7f,_0x189f46,_0x21af9f):this['_createSearchResultIndividualActionButton'](_0x790a1d,_0x518b7f);}['_createSearchResultGroupedActionButton'](_0xa0b18f,_0x301baf,_0x5ebb0b,_0x29cbdc){const _0x279585=new Pt(this['locale']),_0x192e12=new kt(this['locale']),_0x3db609=_0x192e12['bindTemplate'],{view:_0x16a941,highlightView:_0x5bbd05}=this['_createSearchResultGroupRow'](_0x5ebb0b,_0x29cbdc),{view:_0x1c07e2,highlightView:_0x148735}=this['_createSearchResultActionRow'](_0x301baf['label']),_0x5dbc59=this['_createSearchResultContentView'](_0x16a941,_0x1c07e2);return _0x192e12['set']({'label':_0x301baf['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}),_0x192e12['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':[_0x5dbc59],'on':{'mouseenter':_0x3db609['to'](()=>{this['_isSearchFocused']()||_0x192e12['focus']();}),'click':_0x3db609['to'](()=>{this['_handleSearchResultButtonClick'](_0x192e12);})}}),this['_setupActionButtonExecution'](_0x192e12,_0xa0b18f,_0x301baf),_0x279585['children']['add'](_0x192e12),{'listItem':_0x279585,'highlightViews':[_0x5bbd05,_0x148735]};}['_createSearchResultIndividualActionButton'](_0x309d8c,_0xea60bf){const _0x1f7cd4=new Pt(this['locale']),_0x11da1c=new _0x44e8e3(),_0x3962ed=new kt(this['locale'],_0x11da1c),_0xe30d18=_0x3962ed['bindTemplate'];return _0x3962ed['set']({'label':_0xea60bf['label'],'withText':!0x0,'role':'menuitem','icon':void 0x0,'tooltip':!0x1,'class':'ck-ai-quick-actions-button\x20ck-ai-quick-actions-search-result-button'}),_0x3962ed['extendTemplate']({'on':{'mouseenter':_0xe30d18['to'](()=>{this['_isSearchFocused']()||_0x3962ed['focus']();})}}),this['_setupActionButtonExecution'](_0x3962ed,_0x309d8c,_0xea60bf),_0x1f7cd4['children']['add'](_0x3962ed),{'listItem':_0x1f7cd4,'highlightViews':[_0x11da1c]};}['_createSearchResultGroupRow'](_0x1b15e9,_0x2cf51e){const _0x26f5b3=new Nt(this['locale']),_0x3981c0=new yt();_0x3981c0['content']=_0x2cf51e,_0x3981c0['extendTemplate']({'attributes':{'class':'ck-ai-quick-actions-button__group-icon'}});const _0x182ddf=new _0x18e9fc();return _0x182ddf['text']=_0x1b15e9,_0x26f5b3['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-quick-actions-search-result__group-row'},'children':[_0x3981c0,_0x182ddf]}),{'view':_0x26f5b3,'highlightView':_0x182ddf};}['_createSearchResultActionRow'](_0x1adb55){const _0x4030fa=new Nt(this['locale']),_0x451318=new _0x18e9fc();return _0x451318['text']=_0x1adb55,_0x4030fa['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-quick-actions-search-result__action-row'},'children':[_0x451318]}),{'view':_0x4030fa,'highlightView':_0x451318};}['_createSearchResultContentView'](_0x5d8a5f,_0x1cb42a){const _0x3c59a2=new Nt(this['locale']);return _0x3c59a2['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-quick-actions-search-result__content'},'children':[_0x5d8a5f,_0x1cb42a]}),_0x3c59a2;}['_setupActionButtonExecution'](_0x460061,_0x18cf40,_0xb6d918){_0x460061['on']('execute',()=>{_0x18cf40['editing']['view']['focus'](),_0x18cf40['commands']['execute']('aiQuickAction',_0xb6d918);});}['_createActionGroupButton'](_0x45d20e,_0x34f363,_0x590d02){const _0xb3c614=new Pt(this['locale']),_0x1b1b0f=new _0x44e8e3(),_0x4d4683=new Oa(this['locale'],_0x1b1b0f),_0x20f32c=_0x4d4683['bindTemplate'],_0x29c085=this['_getPanelKeystroke'](_0x590d02),_0x391fec=this['_createGroupActionsList'](_0x45d20e,_0x34f363['actions'],_0x590d02);_0x4d4683['set']({'label':_0x34f363['label'],'withText':!0x0,'role':va,'icon':_0x34f363['icon']??_0x4a7acf,'isEnabled':_0x34f363['actions']['some'](_0x82e4ec=>_0x82e4ec['isEnabled'])}),_0x4d4683['extendTemplate']({'on':{'mouseenter':_0x20f32c['to'](()=>{this['_isSearchFocused']()||_0x4d4683['focus']();})}});const _0x9c5717=new Qt(this['locale']);return _0x9c5717['extendTemplate']({'attributes':{'class':['ck','ck-reset_all','ck-ai-quick-actions-group-panel','ck-dropdown-menu__nested-menu__panel']},'on':{'keydown':_0x20f32c['to'](_0x2f34a5=>{this['_handlePanelKeydown'](_0x2f34a5,_0x29c085,_0x4d4683,_0x9c5717);})}}),_0x4d4683['bind']('isOn')['to'](_0x9c5717,'isVisible'),this['_bodyCollection']['add'](_0x9c5717),_0x9c5717['content']['add'](_0x391fec),this['_setupGroupMenuBehavior'](_0x4d4683,_0x9c5717),_0xb3c614['children']['add'](_0x4d4683),{'listItem':_0xb3c614,'highlightView':_0x1b1b0f};}['_createGroupActionsList'](_0x4bc20,_0x213db0,_0x1beb13){const _0x53cafb=new Lt(this['locale']);return _0x53cafb['extendTemplate']({'attributes':{'class':['ck','ck-reset_all','ck-ai-quick-actions-group-list','ck-dropdown-menu-list']}}),_0x213db0['forEach'](_0x44ad99=>{const _0x547a13=new Pt(this['locale']),_0x1d2ebc=Ra({'editor':_0x4bc20,'action':_0x44ad99,'withText':!0x0,'withIcon':!0x1,'isInDropdown':!0x0,'shouldPreventFocus':()=>this['_isSearchFocused']()})();_0x547a13['children']['add'](_0x1d2ebc),_0x1beb13['focusTracker']['add'](_0x1d2ebc),_0x53cafb['items']['add'](_0x547a13);}),_0x53cafb;}['_setupGroupMenuBehavior'](_0x506ced,_0x25c795){const _0x57748d=_0x506ced['bindTemplate'],_0x188831=this['_getButtonKeystroke'](_0x506ced);_0x506ced['extendTemplate']({'attributes':{'class':['ck-ai-quick-actions-group-button']},'on':{'mouseenter':_0x57748d['to'](()=>{this['_showNestedPanel'](_0x25c795,_0x506ced);}),'mouseleave':_0x57748d['to'](_0x25b732=>{const _0x1062f6=_0x25b732['relatedTarget'];this['_isMovingToNestedMenu'](_0x1062f6,_0x25c795)||this['_hideNestedPanel'](_0x25c795);}),'keydown':_0x57748d['to'](_0x1430ba=>{_0x1430ba['key']==_0x188831&&(this['_showNestedPanel'](_0x25c795,_0x506ced),_0x25c795['content']['get'](0x0)['focus']());})}}),_0x25c795['on']('render',()=>{_0x25c795['element']?.['addEventListener']('mouseleave',_0x35b2ad=>{const _0x45de30=_0x35b2ad['relatedTarget'];_0x506ced['element']?.['contains'](_0x45de30)||this['_isMovingToNestedMenu'](_0x45de30,_0x25c795)||this['_hideNestedPanel'](_0x25c795);});});}['_showNestedPanel'](_0xdc48b4,_0x4ff051){this['_openNestedPanels']['forEach'](_0x49fcad=>{_0x49fcad!==_0xdc48b4&&_0x49fcad['isVisible']&&_0x49fcad['hide']();}),_0xdc48b4['show'](),_0xdc48b4['pin']({'positions':[_0x5f01f6['eastSouth']],'target':_0x4ff051['element'],'fitInViewport':!0x0}),this['_openNestedPanels']['add'](_0xdc48b4);}['_hideNestedPanel'](_0x144dba){_0x144dba['hide'](),this['_openNestedPanels']['delete'](_0x144dba);}['_hideAllNestedPanels'](){this['_openNestedPanels']['forEach'](_0x5d5a4e=>_0x5d5a4e['hide']()),this['_openNestedPanels']['clear']();}['_isMovingToNestedMenu'](_0x12929d,_0x322b8b){if(!_0x12929d)return!0x1;if(_0x322b8b['element']?.['contains'](_0x12929d))return!0x0;const _0x3afecd=_0x12929d;return _0x3afecd['closest']&&(null!==_0x3afecd['closest']('.ck-ai-quick-actions-group-panel')||null!==_0x3afecd['closest']('.ck-ai-quick-actions-group-list')||null!==_0x3afecd['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'](_0x1269cd){return'rtl'===_0x1269cd['locale']['uiLanguageDirection']?'ArrowRight':'ArrowLeft';}['_getButtonKeystroke'](_0x374f33){return'rtl'===_0x374f33['locale']['uiLanguageDirection']?'ArrowLeft':'ArrowRight';}['_handlePanelKeydown'](_0x4f15ba,_0x3e3d49,_0xb19225,_0x5c5677){_0x4f15ba['key']==_0x3e3d49&&(_0xb19225['focus'](),this['_hideNestedPanel'](_0x5c5677));}['_handleSearchResultButtonClick'](_0x111f85){_0x111f85['fire']('execute');}}function xa(_0x49028a){const {editor:_0x22c266,content:_0x2aa9c2,buttonDefinition:_0x3210b8,bodyCollection:_0x400248,hasSearch:_0x23fdee=!0x1}=_0x49028a;return()=>{const _0x24ed75=_0x22c266['locale'],_0x372d83=Bt(_0x24ed75);_0x372d83['buttonView']['set']({'icon':_0x3210b8['icon']??_0x4a7acf,'label':_0x3210b8['label'],'tooltip':!0x0}),_0x372d83['set']({'class':'ck-ai-quick-actions-dropdown'});const _0x1f2343=new ya(_0x22c266,_0x2aa9c2,_0x372d83,_0x400248,_0x23fdee);return _0x372d83['panelView']['children']['add'](_0x1f2343),_0x23fdee&&_0x372d83['on']('change:isOpen',(_0x41ab7e,_0x786a7e,_0x23d333)=>{if(_0x23d333){if(_0x22c266['plugins']['has']('AIEditing')){const _0x325cbb=_0x22c266['plugins']['get'](qs),_0xedbeb0=_0x22c266['model']['document']['selection'],_0x194e92=Array['from'](_0xedbeb0['getRanges']());_0x194e92['length']>0x0&&_0x325cbb['showFakeVisualSelection']({'ranges':_0x194e92,'id':'quick-action','priority':0x14});}}else _0x22c266['plugins']['has']('AIEditing')&&_0x22c266['plugins']['get'](qs)['hideFakeVisualSelection']('quick-action'),_0x1f2343['resetSearch']();}),_0x372d83;};}const La='<task>For\x20given\x20selected\x20part\x20of\x20HTML\x20document\x20you\x20must\x20explain\x20the\x20meaning\x20of\x20it\x27s\x20content\x20clearly\x20and\x20in\x20plain\x20language.</task><rules>1.\x20Identify\x20what\x20type\x20of\x20text\x20it\x20is:-\x20If\x20it\x20looks\x20like\x20a\x20definition\x20explain\x20the\x20concept\x20in\x20simple\x20terms.-\x20If\x20it\x20looks\x20like\x20a\x20description\x20clarify\x20what\x20it\x20is\x20describing\x20and\x20why\x20it\x20matters.-\x20If\x20it\x20contains\x20technical\x20terms\x20or\x20jargon\x20break\x20them\x20down\x20into\x20everyday\x20language.-\x20If\x20it\x20looks\x20instructional\x20restate\x20as\x20clear\x20steps\x20someone\x20can\x20follow.-\x20If\x20it\x20provides\x20examples\x20explain\x20what\x20the\x20example\x20shows\x20and\x20why\x20it\x27s\x20relevant.-\x20If\x20it\x20presents\x20an\x20argument\x20or\x20claim\x20restate\x20the\x20claim\x20neutrally\x20and\x20explain\x20its\x20purpose.-\x20If\x20it\x20is\x20narrative/story-like\x20explain\x20what\x20event\x20or\x20situation\x20is\x20being\x20described.-\x20If\x20it\x20is\x20data-driven\x20(stats,\x20figures,\x20facts)\x20explain\x20what\x20the\x20data\x20indicates.-\x20If\x20it\x20is\x20a\x20quotation\x20explain\x20the\x20meaning\x20of\x20the\x20quote\x20in\x20context.-\x20If\x20it\x20compares/contrasts\x20things\x20explain\x20the\x20key\x20differences\x20or\x20similarities\x20simply.-\x20If\x20it\x20does\x20not\x20fit\x20any\x20of\x20the\x20categories\x20above\x20give\x20a\x20clear,\x20plain-language\x20explanation\x20of\x20its\x20meaning,\x20focusing\x20on\x20usefulness.2.\x20Provide\x20context\x20if\x20the\x20meaning\x20could\x20be\x20unclear\x20without\x20it.\x20(e.g.,\x20explain\x20where\x20such\x20a\x20term\x20might\x20be\x20used,\x20or\x20why\x20it\x20is\x20important).3.\x20Keep\x20the\x20explanation\x20short\x20but\x20complete\x20(2–5\x20sentences).Avoid\x20overly\x20technical\x20detail\x20unless\x20it\x20is\x20necessary\x20for\x20understanding.4.\x20Do\x20not\x20simply\x20repeat\x20the\x20original\x20text\x20—\x20restate\x20and\x20expand\x20it\x20in\x20plain\x20words.5.\x20If\x20possible,\x20add\x20a\x20short\x20example\x20or\x20analogy\x20to\x20make\x20it\x20easier\x20to\x20understand.6.\x20Use\x20the\x20context\x20of\x20the\x20whole\x20document,\x20but\x20focus\x20on\x20the\x20selected\x20part\x20when\x20creating\x20your\x20explanation.7.\x20Your\x20explanation\x20should\x20be\x20written\x20in\x20%0\x20language.</rules><constraints>1.\x20You\x20MUST\x20NOT\x20perform\x20any\x20edits\x20or\x20modifications\x20on\x20provided\x20document.2.\x20You\x20MUST\x20NOT\x20include\x20document\x20modifications\x20in\x20your\x20response.3.\x20Your\x20message\x20should\x20only\x20include\x20explanation.\x20Do\x20not\x20add\x20any\x20additional\x20text,\x20flattery,\x20questions\x20or\x20followup\x20suggestions.</constraints>',Da='<task>For\x20the\x20given\x20selected\x20part\x20of\x20an\x20HTML\x20document\x20you\x20must\x20summarize\x20its\x20content\x20in\x20a\x20few\x20sentences,\x20keeping\x20only\x20the\x20essential\x20meaning.</task><rules>1.\x20Your\x20summary\x20should\x20be\x20short\x20and\x20clear:-\x20Aim\x20for\x202–4\x20sentences\x20unless\x20the\x20text\x20is\x20extremely\x20short.-\x20Focus\x20on\x20capturing\x20the\x20main\x20idea(s)\x20without\x20unnecessary\x20detail.2.\x20Identify\x20what\x20type\x20of\x20text\x20it\x20is\x20and\x20adapt\x20the\x20summary\x20style:-\x20If\x20it\x20is\x20descriptive\x20condense\x20the\x20description\x20into\x20its\x20core\x20idea.-\x20If\x20it\x20is\x20argumentative\x20or\x20opinion-based\x20summarize\x20the\x20main\x20claim\x20and\x20reasoning\x20neutrally.-\x20If\x20it\x20is\x20narrative/story-like\x20capture\x20the\x20main\x20event\x20or\x20outcome\x20without\x20side\x20details.-\x20If\x20it\x20is\x20data-driven\x20(stats,\x20figures,\x20facts)\x20summarize\x20what\x20the\x20data\x20shows\x20in\x20plain\x20language.-\x20If\x20it\x20is\x20instructional\x20restate\x20the\x20overall\x20purpose\x20of\x20the\x20steps\x20without\x20listing\x20every\x20step.-\x20If\x20it\x20does\x20not\x20fit\x20any\x20of\x20the\x20categories\x20above\x20provide\x20a\x20general\x20concise\x20summary.3.\x20Provide\x20context\x20if\x20necessary\x20for\x20clarity:-\x20Mention\x20the\x20subject\x20or\x20topic\x20explicitly\x20so\x20the\x20summary\x20can\x20stand\x20alone.4.\x20Do\x20not\x20simply\x20copy\x20sentences\x20from\x20the\x20original\x20text\x20—\x20rephrase\x20in\x20plain\x20language.5.\x20Avoid\x20adding\x20new\x20information\x20or\x20interpretation\x20not\x20present\x20in\x20the\x20text.6.\x20Summarize\x20in\x20a\x20way\x20that\x20would\x20make\x20sense\x20to\x20someone\x20who\x20has\x20not\x20read\x20the\x20original\x20text.7.\x20Use\x20the\x20context\x20of\x20the\x20whole\x20document,\x20but\x20focus\x20on\x20the\x20selected\x20part\x20when\x20creating\x20your\x20summary.8.\x20Your\x20summary\x20should\x20be\x20written\x20in\x20%0\x20language.</rules><constraints>1.\x20You\x20MUST\x20NOT\x20perform\x20any\x20edits\x20or\x20modifications\x20on\x20the\x20provided\x20document.2.\x20You\x20MUST\x20NOT\x20include\x20document\x20modifications\x20in\x20your\x20response.3.\x20Your\x20message\x20should\x20only\x20include\x20the\x20summary.\x20Do\x20not\x20add\x20any\x20additional\x20text,\x20flattery,\x20questions\x20or\x20followup\x20suggestions.</constraints>',Pa='<task>For\x20the\x20given\x20selected\x20part\x20of\x20an\x20HTML\x20document\x20you\x20must\x20extract\x20and\x20present\x20the\x20key\x20points\x20from\x20its\x20content.</task><rules>1.\x20Present\x20the\x20output\x20as\x20a\x20clear,\x20structured\x20list\x20(bullets\x20or\x20numbered).-\x20Each\x20point\x20should\x20be\x20concise\x20(one\x20sentence\x20or\x20less).-\x20Do\x20not\x20merge\x20distinct\x20ideas\x20into\x20one\x20bullet.2.\x20Identify\x20what\x20type\x20of\x20text\x20it\x20is\x20and\x20adapt\x20the\x20extraction\x20style:-\x20If\x20it\x20is\x20descriptive\x20capture\x20the\x20main\x20attributes\x20or\x20features.-\x20If\x20it\x20is\x20argumentative\x20extract\x20the\x20main\x20claim\x20and\x20supporting\x20reasons\x20separately.-\x20If\x20it\x20is\x20narrative/story-like\x20extract\x20the\x20main\x20events\x20in\x20chronological\x20order.-\x20If\x20it\x20is\x20data-driven\x20(stats,\x20figures,\x20facts)\x20highlight\x20the\x20most\x20important\x20facts\x20or\x20numbers.-\x20If\x20it\x20is\x20instructional\x20list\x20the\x20steps\x20or\x20main\x20actions\x20in\x20simplified\x20form.-\x20If\x20it\x20provides\x20comparisons\x20extract\x20the\x20contrasted\x20items\x20and\x20their\x20differences/similarities.-\x20If\x20it\x20does\x20not\x20fit\x20any\x20category\x20above\x20extract\x20the\x20main\x20ideas\x20in\x20plain,\x20short\x20statements.3.\x20Keep\x20the\x20list\x20between\x203–7\x20items\x20where\x20possible.-\x20If\x20the\x20text\x20is\x20very\x20short,\x20fewer\x20items\x20are\x20fine.-\x20If\x20it\x20is\x20very\x20long,\x20focus\x20on\x20the\x20most\x20important\x20ideas\x20only.4.\x20Do\x20not\x20copy\x20long\x20text\x20fragments\x20—\x20restate\x20in\x20simple\x20words.5.\x20Do\x20not\x20add\x20interpretation,\x20evaluation,\x20or\x20commentary\x20beyond\x20the\x20text.6.\x20Ensure\x20the\x20list\x20can\x20stand\x20alone\x20without\x20requiring\x20the\x20reader\x20to\x20see\x20the\x20original\x20document.7.\x20Use\x20the\x20context\x20of\x20the\x20whole\x20document,\x20but\x20focus\x20on\x20the\x20selected\x20part\x20when\x20creating\x20your\x20key\x20points.8.\x20Your\x20key\x20points\x20should\x20be\x20written\x20in\x20%0\x20language.</rules><constraints>1.\x20You\x20MUST\x20NOT\x20perform\x20any\x20edits\x20or\x20modifications\x20on\x20the\x20provided\x20document.2.\x20You\x20MUST\x20NOT\x20include\x20document\x20modifications\x20in\x20your\x20response.3.\x20Your\x20message\x20should\x20only\x20include\x20the\x20extracted\x20key\x20points.\x20Do\x20not\x20add\x20any\x20additional\x20text,\x20flattery,\x20questions\x20or\x20followup\x20suggestions.</constraints>',Ha=/* #__PURE__ -- @preserve */
|
|
28
|
-
((()=>({'chat':'AIChat','action':'AIActions'}))());class Ma extends _0x2dfd9d{static get['requires'](){return[_0x25907d,rs];}static get['pluginName'](){return'AIQuickActionsUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}async['init'](){const _0x42566b=await this['_getDefaultAndCustomActions']();this['_prepareQuickActionsDefinition'](_0x42566b),this['_initializeQuickActionsComponentsAndCommands']();}static['getDefaultQuickActions'](_0x3e50af){return function(_0xfe04b1){const _0x39c2e8=new Intl['DisplayNames'](['en'],{'type':'language'})['of'](_0xfe04b1['uiLanguage']),_0x1d9714=_0x39c2e8||'English',_0x238825=[{'id':'ask-ai','label':as(_0xfe04b1,'AI_QUICK_ACTIONS_ASK_AI'),'type':'chat','icon':_0x357013},{'id':'chat-commands','label':as(_0xfe04b1,'AI_QUICK_ACTIONS_CHAT_COMMANDS'),'icon':_0x357013,'actions':[{'id':'explain','label':as(_0xfe04b1,'AI_QUICK_ACTIONS_EXPLAIN'),'displayedPrompt':as(_0xfe04b1,'AI_QUICK_ACTIONS_EXPLAIN'),'prompt':La['replace']('%0',_0x1d9714),'type':'chat'},{'id':'summarize','label':as(_0xfe04b1,'AI_QUICK_ACTIONS_SUMMARIZE'),'displayedPrompt':as(_0xfe04b1,'AI_QUICK_ACTIONS_SUMMARIZE'),'prompt':Da['replace']('%0',_0x1d9714),'type':'chat'},{'id':'highlight-key-points','label':as(_0xfe04b1,'AI_QUICK_ACTIONS_HIGHLIGHT_KEY_POINTS'),'displayedPrompt':as(_0xfe04b1,'AI_QUICK_ACTIONS_HIGHLIGHT_KEY_POINTS'),'prompt':Pa['replace']('%0',_0x1d9714),'type':'chat'}]},{'id':'improve-writing','label':as(_0xfe04b1,'AI_QUICK_ACTIONS_IMPROVE_WRITING'),'type':'action','icon':_0x23ead0},{'id':'continue','label':as(_0xfe04b1,'AI_QUICK_ACTIONS_CONTINUE_WRITING'),'type':'action','icon':_0x59d7ad},{'id':'fix-grammar','label':as(_0xfe04b1,'AI_QUICK_ACTIONS_FIX_GRAMMAR_SPELLING'),'type':'action','icon':_0x552eb8},{'id':'adjust-length','label':as(_0xfe04b1,'AI_QUICK_ACTIONS_ADJUST_LENGTH'),'icon':_0x26637b,'actions':[{'id':'make-shorter','label':as(_0xfe04b1,'AI_QUICK_ACTIONS_MAKE_SHORTER'),'type':'action'},{'id':'make-longer','label':as(_0xfe04b1,'AI_QUICK_ACTIONS_MAKE_LONGER'),'type':'action'}]},{'id':'change-tone','label':as(_0xfe04b1,'AI_QUICK_ACTIONS_CHANGE_TONE'),'icon':_0x3cd88c,'actions':[{'id':'make-tone-casual','label':as(_0xfe04b1,'AI_QUICK_ACTIONS_MORE_CASUAL'),'type':'action'},{'id':'make-tone-direct','label':as(_0xfe04b1,'AI_QUICK_ACTIONS_MORE_DIRECT'),'type':'action'},{'id':'make-tone-friendly','label':as(_0xfe04b1,'AI_QUICK_ACTIONS_MORE_FRIENDLY'),'type':'action'},{'id':'make-tone-confident','label':as(_0xfe04b1,'AI_QUICK_ACTIONS_MORE_CONFIDENT'),'type':'action'},{'id':'make-tone-professional','label':as(_0xfe04b1,'AI_QUICK_ACTIONS_MORE_PROFESSIONAL'),'type':'action'}]},{'id':'translate','label':as(_0xfe04b1,'AI_QUICK_ACTIONS_TRANSLATE'),'icon':_0x16125b,'actions':[{'id':'translate-to-english','label':as(_0xfe04b1,'AI_QUICK_ACTIONS_TRANSLATE_ENGLISH'),'type':'action','actionName':'translate','args':{'language':'english'}},{'id':'translate-to-chinese','label':as(_0xfe04b1,'AI_QUICK_ACTIONS_TRANSLATE_CHINESE'),'type':'action','actionName':'translate','args':{'language':'chinese'}},{'id':'translate-to-spanish','label':as(_0xfe04b1,'AI_QUICK_ACTIONS_TRANSLATE_SPANISH'),'type':'action','actionName':'translate','args':{'language':'spanish'}},{'id':'translate-to-german','label':as(_0xfe04b1,'AI_QUICK_ACTIONS_TRANSLATE_GERMAN'),'type':'action','actionName':'translate','args':{'language':'german'}},{'id':'translate-to-french','label':as(_0xfe04b1,'AI_QUICK_ACTIONS_TRANSLATE_FRENCH'),'type':'action','actionName':'translate','args':{'language':'french'}},{'id':'translate-to-japanese','label':as(_0xfe04b1,'AI_QUICK_ACTIONS_TRANSLATE_JAPANESE'),'type':'action','actionName':'translate','args':{'language':'japanese'}},{'id':'translate-to-portuguese','label':as(_0xfe04b1,'AI_QUICK_ACTIONS_TRANSLATE_PORTUGUESE'),'type':'action','actionName':'translate','args':{'language':'portuguese'}},{'id':'translate-to-korean','label':as(_0xfe04b1,'AI_QUICK_ACTIONS_TRANSLATE_KOREAN'),'type':'action','actionName':'translate','args':{'language':'korean'}},{'id':'translate-to-italian','label':as(_0xfe04b1,'AI_QUICK_ACTIONS_TRANSLATE_ITALIAN'),'type':'action','actionName':'translate','args':{'language':'italian'}},{'id':'translate-to-russian','label':as(_0xfe04b1,'AI_QUICK_ACTIONS_TRANSLATE_RUSSIAN'),'type':'action','actionName':'translate','args':{'language':'russian'}}]},{'id':'other','label':as(_0xfe04b1,'AI_QUICK_ACTIONS_OTHER'),'icon':_0x1f3695,'actions':[]}];return _0x238825;}(_0x3e50af);}async['_getDefaultAndCustomActions'](){const _0x54b1ef=Ma['getDefaultQuickActions'](this['editor']['locale']),_0x59f9d6=this['editor']['config']['get']('ai.quickActions.extraCommands')||[];let _0x365340=[];try{_0x365340=await new Bs({'connector':this['editor']['plugins']['get']('AIConnector'),'locale':this['editor']['locale']})['getAll']();}catch(_0x2317d1){const _0x5df548=new ot('ai-quick-actions-models-unable-to-retrieve',this,{'error':_0x2317d1});Et(_0x5df548['message']);}finally{const _0x2abf45=_0x59f9d6['map'](_0xfdab29=>({..._0xfdab29,'type':'chat'===_0xfdab29['type']?'chat':'action','icon':void 0x0}));_0x54b1ef['find'](_0x1b23e8=>'other'===_0x1b23e8['id'])['actions']['push'](..._0x2abf45),_0x54b1ef['forEach'](_0x3c943f=>{if('actions'in _0x3c943f)_0x3c943f['actions']['forEach'](_0x157e62=>{if(_0x157e62['isEnabled']=!!_0x365340['find'](_0x4d4e44=>_0x4d4e44['id']===_0x157e62['model'])||void 0x0===_0x157e62['model'],!_0x157e62['isEnabled']){const _0x5dd7eb=new ot('ai-quick-actions-unavailable-model',this,{'actionId':_0x157e62['id'],'modelId':_0x157e62['model']});Et(_0x5dd7eb['message']);}});else{if(_0x3c943f['isEnabled']=!!_0x365340['find'](_0x9f4b89=>_0x9f4b89['id']===_0x3c943f['model'])||void 0x0===_0x3c943f['model'],!_0x3c943f['isEnabled']){const _0x2bcd82=new ot('ai-quick-actions-unavailable-model',this,{'actionId':_0x3c943f['id'],'modelId':_0x3c943f['model']});Et(_0x2bcd82['message']);}}});}return _0x54b1ef;}['_initializeQuickActionsComponentsAndCommands'](){const _0x129edb=new qt(this['editor']['locale']);_0x129edb['attachToDom'](),this['_initializeQuickActionsDropdown'](_0x129edb),this['_initializeQuickActionsMenuBar'](),this['_initializeQuickActionsComponents'](_0x129edb);}['_initializeQuickActionsDropdown'](_0x3a8e8d){const _0xc1714d=this['editor']['config']['get']('ai.quickActions.isSearchEnabled')??!0x0;this['editor']['ui']['componentFactory']['add']('aiQuickActions',xa({'editor':this['editor'],'content':this['_quickActionsDefinition'],'buttonDefinition':{'icon':_0x4a7acf,'label':as(this['editor']['locale'],'AI_QUICK_ACTIONS_HEADING')},'bodyCollection':_0x3a8e8d,'hasSearch':_0xc1714d}));}['_prepareQuickActionsDefinition'](_0x4192ab){this['_quickActionsDefinition']=_0x4192ab['map'](_0x59ee3f=>{if('actions'in _0x59ee3f){const _0x1cd965=_0x59ee3f;return{..._0x1cd965,'actions':_0x1cd965['actions']['map'](_0x295f8e=>{const {actions:_0x109b0b,..._0x349845}=_0x1cd965;return{..._0x295f8e,'parent':_0x349845};})['filter'](_0x455eea=>this['_shouldIncludeAction'](_0x455eea))};}return _0x59ee3f;})['filter'](_0x1131ee=>'actions'in _0x1131ee?_0x1131ee['actions']['length']>0x0:this['_shouldIncludeAction'](_0x1131ee));}['_shouldIncludeAction'](_0x275f12){const _0x4e8288=this['editor']['config']['get']('ai.quickActions.removeCommands')||[];return this['editor']['plugins']['has'](Ha[_0x275f12['type']])&&!_0x4e8288['includes'](_0x275f12['id'])&&!('chat'===_0x275f12['type']&&!0x1===this['editor']['config']['get']('ai.chat.context.document.enabled'));}['_initializeQuickActionsComponents'](_0x273451){this['_quickActionsDefinition']['forEach'](_0x10e260=>{if('actions'in _0x10e260){const _0x325685=xa({'editor':this['editor'],'content':_0x10e260['actions'],'buttonDefinition':_0x10e260,'bodyCollection':_0x273451});this['editor']['ui']['componentFactory']['add'](_0x10e260['id'],_0x325685),_0x10e260['actions']['forEach'](_0x620a65=>{const _0x36be64=Ra({'editor':this['editor'],'action':_0x620a65});this['editor']['ui']['componentFactory']['add'](_0x620a65['id'],_0x36be64);});}else{const _0x516af2=Ra({'editor':this['editor'],'action':_0x10e260,'withText':!0x1,'withIcon':!0x0,'isInDropdown':!0x1});this['editor']['ui']['componentFactory']['add'](_0x10e260['id'],_0x516af2);}});}['_initializeQuickActionsMenuBar'](){this['editor']['ui']['componentFactory']['add']('menuBar:aiQuickActions',_0x113948=>{const _0x5f464a=new Ft(_0x113948),_0x46686e=as(_0x113948,'AI_QUICK_ACTIONS_HEADING');_0x5f464a['buttonView']['set']({'label':_0x46686e,'icon':_0x4a7acf});const _0x476942=new Yt(_0x113948);_0x476942['set']({'ariaLabel':_0x46686e,'role':'menu'}),this['_quickActionsDefinition']['forEach'](_0x3e3cf2=>{if('actions'in _0x3e3cf2){const _0x21d848=_0x3e3cf2,_0x3eeb0e=new $t(_0x113948,_0x5f464a),_0x5a2915=new Ft(_0x113948),_0x1d0b60=new Yt(_0x113948);_0x5a2915['buttonView']['set']({'label':_0x21d848['label'],'icon':_0x21d848['icon']}),_0x21d848['actions']['forEach'](_0x62e5a7=>{const _0x463273=new $t(_0x113948,_0x5a2915),_0x40851d=new Kt(_0x113948);_0x40851d['set']({'label':_0x62e5a7['label'],'icon':_0x62e5a7['icon'],'role':'menuitem','isEnabled':_0x62e5a7['isEnabled']}),_0x40851d['on']('execute',()=>{this['_executeQuickAction'](_0x62e5a7);}),_0x40851d['delegate']('execute')['to'](_0x5a2915),_0x463273['children']['add'](_0x40851d),_0x1d0b60['items']['add'](_0x463273);}),_0x5a2915['panelView']['children']['add'](_0x1d0b60),_0x3eeb0e['children']['add'](_0x5a2915),_0x476942['items']['add'](_0x3eeb0e);}else{const _0x1027a9=_0x3e3cf2,_0x3cd32d=new $t(_0x113948,_0x5f464a),_0x4da908=new Kt(_0x113948);_0x4da908['set']({'label':_0x1027a9['label'],'icon':_0x1027a9['icon'],'role':'menuitem','isEnabled':_0x1027a9['isEnabled']}),_0x4da908['on']('execute',()=>{this['_executeQuickAction'](_0x1027a9);}),_0x4da908['delegate']('execute')['to'](_0x5f464a),_0x3cd32d['children']['add'](_0x4da908),_0x476942['items']['add'](_0x3cd32d);}});const _0x1aee97=Object['values'](Ha)['some'](_0x5513f0=>this['editor']['plugins']['has'](_0x5513f0));return _0x5f464a['set']({'isEnabled':_0x1aee97}),_0x5f464a['panelView']['children']['add'](_0x476942),_0x5f464a;});}['_executeQuickAction'](_0x15470c){const _0x44e0a1=this['editor'];_0x44e0a1['editing']['view']['focus'](),_0x44e0a1['commands']['execute']('aiQuickAction',_0x15470c);const _0x43b75f=_0x44e0a1['ui']['view']['menuBarView'];_0x43b75f&&_0x43b75f['close']&&_0x43b75f['close']();}}class Ua extends _0x335282{['execute'](_0x571bf1){switch(this['_expandSelectionIfCollapsed'](),_0x571bf1['type']){case'chat':if(!this['editor']['plugins']['has']('AIChat')){const _0x558bfc=as(this['editor']['locale'],'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND','AIChat');throw new ot('ai-quick-actions-plugin-not-found',this['editor'],{'errorMessage':_0x558bfc});}this['_handleAIChatAction'](_0x571bf1);break;case'action':if(!this['editor']['plugins']['has']('AIActions')){const _0x32429a=as(this['editor']['locale'],'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND','AIActions');throw new ot('ai-quick-actions-plugin-not-found',this['editor'],{'errorMessage':_0x32429a});}this['_handleAIActionsAction'](_0x571bf1);}}async['_handleAIChatAction'](_0x3d7056){const _0x209b1e=this['editor']['plugins']['get']('AIChatController'),_0x2ed6a2=this['editor']['plugins']['get']('AITabs')['view'];if(_0x2ed6a2['isVisible']||(_0x2ed6a2['isVisible']=!0x0),'chat'!==_0x2ed6a2['activeTab']&&_0x2ed6a2['activateTab']('chat'),'ask-ai'===_0x3d7056['id'])_0x209b1e['removeSelectionFromChatContext'](),_0x209b1e['addSelectionToChatContext'](),_0x209b1e['focusPromptInput']();else await _0x209b1e['startConversation'](),_0x209b1e['removeSelectionFromChatContext'](),_0x209b1e['addSelectionToChatContext'](),_0x209b1e['focusPromptInput'](),await _0x209b1e['sendMessage']({'message':_0x3d7056['prompt']||_0x3d7056['displayedPrompt']||_0x3d7056['label'],'attributes':{'quickActionData':{'id':_0x3d7056['id']},'displayedPrompt':_0x3d7056['displayedPrompt']}});}['_expandSelectionIfCollapsed'](){const _0x5af02b=this['editor'],_0x4d71fc=_0x5af02b['model']['document']['selection'];if(!_0x4d71fc['isCollapsed'])return;const _0x377fa2=gt(_0x4d71fc['getSelectedBlocks']())||_0x5af02b['model']['schema']['getLimitElement'](_0x4d71fc);_0x5af02b['model']['change'](_0x43c28d=>{_0x43c28d['setSelection'](_0x377fa2,'in');});}['_handleAIActionsActionLabel'](_0x20f483){return _0x20f483['parent']?.['label']&&'other'!==_0x20f483['parent']?.['id']?_0x20f483['parent']['label']+':\x20'+_0x20f483['label']:_0x20f483['label'];}async['_handleAIActionsAction'](_0x5c1b78){const _0x40442d=this['editor']['plugins']['get']('AIActions'),_0x22de7b=_0x5c1b78['prompt']?{'userMessage':_0x5c1b78['prompt'],'model':_0x5c1b78['model']}:{'actionName':_0x5c1b78['actionName']||_0x5c1b78['id'],'args':_0x5c1b78['args']},_0x174e81=this['_handleAIActionsActionLabel'](_0x5c1b78);await _0x40442d['executeAction'](_0x22de7b,_0x174e81,_0x5c1b78['icon']);}}class Va extends _0x2dfd9d{static get['pluginName'](){return'AIQuickActionsEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x4ab3ef=this['editor'],_0x55e652=new Ua(this['editor']);if(_0x4ab3ef['commands']['add']('aiQuickAction',_0x55e652),_0x4ab3ef['plugins']['has']('AIChat')){const _0x4a62b4=this['editor']['plugins']['get']('AIChatController');_0x4ab3ef['model']['document']['selection']['on']('change:range',(_0x7c62aa,_0x9a8c1c)=>{_0x9a8c1c['directChange']&&_0x4a62b4['removeSelectionFromChatContext']();});}}}class Ba extends vs{['updateChangeGroups'](){if(this['parsedMergedContent']=this['parsedContent']['cloneNode'](!0x0),0x0==this['parsedMergedContent']['childNodes']['length'])return void(this['changeGroups']=[]);const _0x5edec8=this['documentContextContent']['children']['map'](_0x44bb6d=>({'node':_0x44bb6d,'id':gs(_0x44bb6d,'data-id')})),_0x1f7b1d=this['parsedMergedContent']['children']['map'](_0x58fca3=>({'node':_0x58fca3,'id':gs(_0x58fca3,'data-id')||at()})),_0x471dbc=_0x7819e8(_0x5edec8,_0x1f7b1d,{'comparator':(_0x143559,_0xb42094)=>_0x143559['id']==_0xb42094['id'],'oneChangePerToken':!0x0});if(!this['isDone']){for(;_0x471dbc['length']&&_0x471dbc[_0x471dbc['length']-0x1]['removed'];)_0x471dbc['pop']();}const _0x4d7140=_0x471dbc['map'](_0x3fef86=>{const _0x56c6f6=_0x3fef86['added']?'new':_0x3fef86['removed']?'removed':'modified';return{'node':_0x3fef86['value'][0x0]['node'],'type':_0x56c6f6,'id':_0x3fef86['value'][0x0]['id']};});this['changeGroups']=[{'changes':_0x4d7140,'state':'pending','index':0x0}];}['_getDifferentChangeGroups'](_0x985344,_0x5ed793){return _0x5ed793;}}class Ga extends xs{['content'];['version'];['actionName'];['args'];['userMessage'];['model'];['hasError']=!0x1;['stoppedExplicitly']=!0x1;constructor(_0x2bb680){super(_0x2bb680),this['content']=_0x2bb680['content'],this['version']=_0x2bb680['version'],this['actionName']=_0x2bb680['actionName'],this['args']=_0x2bb680['args'],this['userMessage']=_0x2bb680['userMessage'],this['model']=_0x2bb680['model'],this['on']('interactionStopped',()=>{this['stoppedExplicitly']=!0x0;});}async['sendRequest'](){return this['actionName']?this['connector']['executeAction']({'content':this['content'],'actionName':this['actionName'],'args':this['args']}):this['connector']['executeCustomAction']({'content':this['content'],'message':this['userMessage'],'model':this['model'],'outputFormat':'html'});}['getDocumentContext'](){return{'type':'text','content':this['content'],'version':this['version'],'label':'Current\x20document','uiId':'current-document'};}['createReply'](_0x3dbd71){const _0x2b8f32=new Ba({'editor':this['editor'],'documentContextContent':this['content'],..._0x3dbd71});return this['replies']['push'](_0x2b8f32),_0x2b8f32['delegate'](...ys)['to'](this),this['fire']('replyCreated',_0x2b8f32),_0x2b8f32;}}class Fa extends Ot{constructor(_0x4351,_0x353b21=!0x0,_0x44019e=!0x0){super(_0x4351),this['set']('isEnabled',!0x1),_0x353b21&&(this['applyButton']=this['_createButton'](as(_0x4351,'AI_BALLOON_APPLY_BUTTON'),os),this['applyButton']['bind']('isEnabled')['to'](this),this['items']['add'](this['applyButton'])),_0x44019e&&(this['suggestButton']=this['_createButton'](as(_0x4351,'AI_BALLOON_SUGGEST_BUTTON'),_0x353b21?hs:os),this['suggestButton']['bind']('isEnabled')['to'](this),this['items']['add'](this['suggestButton'])),this['setButtonsVisibility']({'showApplyButton':_0x353b21,'showSuggestButton':_0x44019e}),this['extendTemplate']({'attributes':{'class':['ck-ai-balloon__toolbar']}});}['setButtonsVisibility']({showApplyButton:_0xca9dcc,showSuggestButton:_0x2e40fc}){this['applyButton']&&(this['applyButton']['isVisible']=_0xca9dcc),this['suggestButton']&&(this['suggestButton']['isVisible']=_0x2e40fc);}['_createButton'](_0x420a47,_0x153781){const _0x55cdf8=new kt(this['locale']);return _0x55cdf8['set']({'label':_0x420a47,'class':_0x153781,'isVisible':!0x0,'withText':!0x0}),_0x55cdf8;}}class Ka extends Nt{constructor(_0x3f5717){super(_0x3f5717),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-balloon__disclaimer']},'children':[{'tag':'p','attributes':{'class':['ck','ck-ai-balloon__disclaimer-content']},'children':[{'text':as(_0x3f5717,'AI_DISCLAIMER_TEXT')}]}]});}}class Wa extends Nt{constructor(_0x3a3c12){super(_0x3a3c12),this['set']('isVisible',!0x0);const _0x5565ad=new fn('small');_0x5565ad['isVisible']=!0x0;const _0x1ed42e=new Nt(this['locale']);_0x1ed42e['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-suggestion__loader-text']},'children':[as(this['locale'],'AI_CHAT_IS_WRITING')]}),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__loader',this['bindTemplate']['if']('isVisible','ck-hidden',_0x385ff4=>!_0x385ff4)]},'children':[_0x5565ad,_0x1ed42e]});}}class Ya extends Ta{['focusCycler'];['_config'];['_contentWrapper'];['_streamableContentView'];['_toolbarView'];['_miniToolbarView'];['_loaderView'];['_disclaimerView'];['_focusTracker'];['_keystrokes'];['_dialogContent'];['_focusables'];['_scrollManager'];['_navigationPreviousButton'];['_navigationNextButton'];['_navigationTryAgainButton'];['_navigationCounter'];constructor(_0x4cd34e,_0x38e6ad){super(_0x4cd34e),this['set']('isBusy',!0x1),this['set']('isTrackChangesOn',!0x1),this['set']('_isLoading',!0x1),this['set']('_hasError',!0x1),this['_config']=_0x38e6ad,this['_focusTracker']=new _t(),this['_keystrokes']=new At(),this['_focusables']=this['createCollection'](),this['focusCycler']=new Mt({'focusables':this['_focusables'],'focusTracker':this['_focusTracker'],'keystrokeHandler':this['_keystrokes'],'actions':{'focusPrevious':'shift\x20+\x20tab','focusNext':'tab'}}),this['_dialogContent']=new _0x1898c2(),this['_addContentWrapper'](_0x38e6ad),this['_addDisclaimerView'](),this['_addToolbar'](_0x38e6ad),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'](_0x38e6ad);});}['render'](){super['render']();for(const _0x233794 of this['_focusables'])this['_focusTracker']['add'](_0x233794['element']);this['_keystrokes']['listenTo'](this['element']),this['_initializeScrollManager']();}['destroy'](){super['destroy'](),this['_scrollManager']&&this['_scrollManager']['destroy']();}['focus'](_0x55405c){-0x1===_0x55405c?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}['setIsLoading'](_0x27d4cd){this['_isLoading']=_0x27d4cd;}['setErrorState'](){this['_hasError']=!0x0,this['_miniToolbarView']['toggleShowChangesEnabled'](!0x1);}['clearErrorState'](){this['_hasError']=!0x1,this['_miniToolbarView']['toggleShowChangesEnabled'](!0x0);}['showError'](_0x2822ef){super['showError'](_0x2822ef),this['_dialogContent']['has'](this['_errorView'])||this['_dialogContent']['add'](this['_errorView'],0x0);}['hideError'](){super['hideError'](),this['clearErrorState']();}['showBlockingError'](_0x4ff2f1){super['showBlockingError'](_0x4ff2f1),this['setErrorState']();}['addMiniToolbarItem'](_0x546e95){this['_miniToolbarView']['items']['has'](_0x546e95)||this['_miniToolbarView']['items']['add'](_0x546e95);}['removeMiniToolbarItem'](_0x2847ec){this['_miniToolbarView']['items']['has'](_0x2847ec)&&this['_miniToolbarView']['items']['remove'](_0x2847ec);}['showLoader'](){this['_loaderView']&&(this['_isLoading']=!0x0);}['hideLoader'](){this['_loaderView']&&(this['_isLoading']=!0x1);}['_toggleToolbarButtonsVisibility']({showApplyButton:_0x2f3cfb,showSuggestButton:_0x29903d}){_0x2f3cfb=_0x2f3cfb&&!this['isTrackChangesOn']&&this['_config']['availableActions']['includes']('applySuggestion'),_0x29903d=_0x29903d&&this['_config']['availableActions']['includes']('insertSuggestion'),this['_toolbarView']['setButtonsVisibility']({'showApplyButton':_0x2f3cfb,'showSuggestButton':_0x29903d});}async['updateContent'](_0x302a47){await this['_streamableContentView']['update'](_0x302a47);}['clearContent'](){this['_streamableContentView']['clear']();}['_addContentWrapper'](_0x50f75b){this['_contentWrapper']=new Nt(this['locale']),this['_contentWrapper']['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-actions-balloon-content']},'children':[{'tag':'div','attributes':{'class':['ck-ai-actions-balloon-content-wrapper']},'children':[this['_createLoaderView'](),this['_createStreamableContentView']()]},this['_createMiniToolbar'](_0x50f75b['miniToolbarConfig'])]}),this['_dialogContent']['add'](this['_contentWrapper']);}['_addDisclaimerView'](){this['_disclaimerView']=new Ka(this['locale']),this['_dialogContent']['add'](this['_disclaimerView']);}['_addToolbar']({showApplyButton:_0x522a86,showSuggestButton:_0x13da48}){this['_toolbarView']=new Fa(this['locale'],_0x522a86,_0x13da48),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',(_0x11db09,_0x122bba,_0x538a33)=>!(_0x11db09||_0x122bba||_0x538a33)),this['_toggleToolbarButtonsVisibility']({'showApplyButton':_0x522a86,'showSuggestButton':_0x13da48}),this['_dialogContent']['add'](this['_toolbarView']);}['_createMiniToolbar'](_0x151acb){return this['_miniToolbarView']=new Ca(this['locale'],_0x151acb),this['_miniToolbarView']['delegate'](...Qs)['to'](this),this['_miniToolbarView']['on']('toggleShowChanges',()=>{this['_miniToolbarView']['isShowChangesOn']=!this['_miniToolbarView']['isShowChangesOn'],this['fire']('toggleSuggestionDisplayMode',{'showDiff':this['_miniToolbarView']['isShowChangesOn']});}),this['_miniToolbarView']['bind']('isEnabled')['to'](this,'isBusy',this,'_isLoading',(_0x2e2e36,_0x37d5cf)=>!(_0x2e2e36||_0x37d5cf)),this['_miniToolbarView'];}['_createLoaderView'](){return this['_loaderView']=new Wa(this['locale']),this['_loaderView']['bind']('isVisible')['to'](this,'_isLoading'),this['_loaderView'];}['_createStreamableContentView'](){return this['_streamableContentView']=new un(this['locale']),this['_streamableContentView'];}['_setupMiniToolbarButtons'](){const _0xf39d40=new kt(this['locale']),_0x2abdc7=new kt(this['locale']),_0x4b26ea=new $a(this['locale']),_0xab10e2=new kt(this['locale']);_0xf39d40['set']({'icon':tt,'label':as(this['locale'],'AI_ACTIONS_TRY_AGAIN'),'tooltip':!0x0,'class':'ck-ai-custom-action-button\x20'+cs}),_0x2abdc7['set']({'icon':_0x3429b1,'tooltip':as(this['locale'],'AI_ACTIONS_PREVIOUS_INTERACTION'),'class':'ck-ai-navigation-button\x20ck-ai-previous-button\x20'+cs}),_0xab10e2['set']({'icon':et,'tooltip':as(this['locale'],'AI_ACTIONS_NEXT_INTERACTION'),'class':'ck-ai-navigation-button\x20ck-ai-next-button\x20'+cs}),_0xf39d40['bind']('isEnabled')['to'](this,'isBusy',_0x5073f4=>!_0x5073f4),_0xf39d40['on']('execute',()=>{this['fire']('tryAgain');}),_0x2abdc7['bind']('isEnabled')['to'](this,'isBusy',_0x367adc=>!_0x367adc),_0x2abdc7['on']('execute',()=>{this['fire']('showPrevious');}),_0xab10e2['bind']('isEnabled')['to'](this,'isBusy',_0x6ec9b=>!_0x6ec9b),_0xab10e2['on']('execute',()=>{this['fire']('showNext');}),this['_navigationPreviousButton']=_0x2abdc7,this['_navigationCounter']=_0x4b26ea,this['_navigationNextButton']=_0xab10e2,this['_navigationTryAgainButton']=_0xf39d40;}['updateMiniToolbarButtons'](_0x3537fe,_0x565f12){this['_navigationPreviousButton']||this['_setupMiniToolbarButtons']();const _0x2c47cb=_0x3537fe>0x1;if(this['addMiniToolbarItem'](this['_navigationTryAgainButton']),_0x2c47cb){this['addMiniToolbarItem'](this['_navigationPreviousButton']),this['addMiniToolbarItem'](this['_navigationCounter']),this['addMiniToolbarItem'](this['_navigationNextButton']);const _0x584fa1=_0x3537fe-_0x565f12;this['_navigationCounter']['setInteractionCount'](_0x584fa1+'/'+_0x3537fe),this['_navigationPreviousButton']['isEnabled']=_0x565f12<_0x3537fe-0x1,this['_navigationNextButton']['isEnabled']=_0x565f12>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'](_0x182ecd){this['_isLoading']=_0x182ecd;}['resetShowChangesButton'](){this['_miniToolbarView']['isShowChangesOn']=!0x1;}['_initializeScrollManager'](){const _0x3262c3=this['_getScrollableElement']();_0x3262c3&&!this['_scrollManager']&&(this['_scrollManager']=new Xn(_0x3262c3));}['_getScrollableElement'](){return this['_streamableContentView']['element'];}}class $a extends Nt{constructor(_0x287afb){super(_0x287afb);const _0x59323f=this['bindTemplate'];this['set']('interactionCount','1/1'),this['setTemplate']({'tag':'span','attributes':{'class':['ck-ai-interaction-counter']},'children':[{'text':_0x59323f['to']('interactionCount')}]});}['setInteractionCount'](_0x1be171){this['set']('interactionCount',_0x1be171);}}class qa extends _0x2dfd9d{static get['requires'](){return[rs,Vt,qs,ma,_0x4371ca];}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(_0x2bf9a0){super(_0x2bf9a0),this['_bodyCollection']=new qt(this['editor']['locale']),this['_bodyCollection']['attachToDom'](),this['_aiConnector']=this['editor']['plugins']['get']('AIConnector'),this['set']('isBusy',!0x1),this['_promiseQueue']=new _n();}['stopInteraction'](){this['_stopInteraction']();}async['executeAction'](_0x1f2999,_0x52a8d3,_0x535d50){if(this['_stopInteraction'](),this['editor']['plugins']['has']('TableSelection')){if(this['editor']['plugins']['get']('TableSelection')['getSelectedTableCells']()){const {modelFragment:_0x441a3d,anchorData:_0x2f06f7}=this['_getExecuteDataInTable']();return this['_executeAction'](_0x1f2999,_0x441a3d,_0x2f06f7,_0x52a8d3,_0x535d50);}}const {modelFragment:_0x3ffd6c,anchorData:_0xb56bd4}=this['_getExecuteDataRegular']();return this['_executeAction'](_0x1f2999,_0x3ffd6c,_0xb56bd4,_0x52a8d3,_0x535d50);}async['destroy'](){return this['_stopInteraction'](),this['_bodyCollection']['detachFromDom'](),super['destroy']();}['_createActionsBalloonView'](){const _0x4fa211=this['editor']['plugins']['has']('TrackChanges');let _0x38a52c=this['editor']['config']['get']('ai.availableReplyActions')||[...gn];_0x4fa211||(_0x38a52c=_0x38a52c['filter'](_0x532bbd=>'insertSuggestion'!=_0x532bbd));const _0x4fb784=this['editor']['commands']['get']('trackChanges'),_0xf4933a=new Ya(this['editor']['locale'],{'showApplyButton':!0x0,'showSuggestButton':_0x4fa211,'miniToolbarConfig':{'showChanges':'icon'},'availableActions':_0x38a52c});return _0xf4933a['bind']('isBusy')['to'](this),_0x4fb784&&_0xf4933a['bind']('isTrackChangesOn')['to'](_0x4fb784,'value'),_0xf4933a['on']('tryAgain',()=>{this['_refreshInteraction']();}),_0xf4933a['on']('showPrevious',()=>{this['_navigateToPrevious']();}),_0xf4933a['on']('showNext',()=>{this['_navigateToNext']();}),_0xf4933a;}['_getExecuteDataRegular'](){const _0x5708dc=this['editor']['model']['document']['selection'];if(_0x5708dc['isCollapsed']){const _0x2f2a79=gt(_0x5708dc['getSelectedBlocks']())||this['editor']['model']['schema']['getLimitElement'](_0x5708dc);this['editor']['model']['change'](_0x233efe=>{_0x233efe['setSelection'](_0x2f2a79,'in');});}const _0x1b7b36=_0x5708dc['getFirstRange'](),_0x4545db=this['_wrapWithCommonAncestors'](this['editor']['model']['getSelectedContent'](_0x5708dc),_0x1b7b36['start'],_0x1b7b36['end']);this['_copyMarkersToFragment'](_0x4545db,_0x5708dc,{'isTableSelection':!0x1});const _0x2d5d33=_0x5708dc['getFirstRange']()['start'],_0x5a6e26=new Map();let _0x299d31=_0x4545db;for(let _0x40ba22=0x0;_0x40ba22<_0x2d5d33['path']['length'];_0x40ba22++)_0x5a6e26['set'](_0x299d31,_0x2d5d33['path'][_0x40ba22]),_0x299d31=_0x299d31['getChild'](0x0);return{'modelFragment':_0x4545db,'anchorData':_0x5a6e26};}['_getExecuteDataInTable'](){const _0xbeb998=this['editor']['model']['document']['selection'],_0x354281=this['editor']['plugins']['get']('TableSelection')['getSelectionAsFragment'](),_0x505870=_0xbeb998['getFirstRange']()['start']['parent']['parent'],_0x21645e=this['editor']['model']['createRange'](this['editor']['model']['createPositionBefore'](_0x505870),this['editor']['model']['createPositionAfter'](_0x505870)),_0x4e418f=this['_wrapWithCommonAncestors'](_0x354281,_0x21645e['start'],_0x21645e['end']);this['_copyMarkersToFragment'](_0x4e418f,_0xbeb998,{'isTableSelection':!0x0});const _0x5a4b31=_0xbeb998['getFirstRange']()['start'],_0x3e7c4b=new Map();let _0x53d3ba=_0x4e418f;for(let _0x18bef0=0x0;_0x18bef0<_0x5a4b31['path']['length'];_0x18bef0++)if(_0x3e7c4b['set'](_0x53d3ba,_0x5a4b31['path'][_0x18bef0]),_0x18bef0<_0x5a4b31['path']['length']-0x1)_0x53d3ba=_0x53d3ba['getChild'](0x0);else{let _0x28ce23=_0x53d3ba['nextSibling'];for(;_0x28ce23;)_0x3e7c4b['set'](_0x28ce23,_0x5a4b31['path'][_0x18bef0]),_0x28ce23=_0x28ce23['nextSibling'];}return{'modelFragment':_0x4e418f,'anchorData':_0x3e7c4b};}async['_executeAction'](_0x3592f6,_0x1de8c7,_0x2f13b1,_0x1983bb,_0x2b8789){const _0x1398e1=this['editor']['plugins']['get'](qs),_0x30e24d=this['editor']['plugins']['get'](ma),_0x5d3832=this['editor']['model']['document']['selection'],_0xbcb387=await _0x1398e1['modelToDataWithIds'](_0x1de8c7),_0x117ffc=this['editor']['model']['document']['version'],_0x5e16ab=[..._0x5d3832['getRanges']()];return this['_actionsBalloonView']||(this['_actionsBalloonView']=this['_createActionsBalloonView']()),this['_clearInteractionHistory'](),this['_clearErrorState'](),this['_balloonShowDiff']=!0x1,this['_actionsBalloonView']['resetShowChangesButton'](),this['_actionsBalloonView']['clearContent'](),_0x30e24d['open']({'index':0x3e8*Math['random']()%0x3e8,'title':_0x1983bb,'icon':_0x2b8789||_0x4a7acf,'mainView':this['_actionsBalloonView'],'class':'ck-ai-actions-balloon','ranges':_0x5e16ab,'id':'aiActionsBalloon'}),this['_setLoadingState'](),this['stopListening'](this['_actionsBalloonView']),this['stopListening'](_0x30e24d),this['_interactionParams']={'action':_0x3592f6,'content':_0xbcb387,'version':_0x117ffc,'aiBalloon':_0x30e24d,'modelFragment':_0x1de8c7,'anchorData':_0x2f13b1},this['_setupApplyListeners'](),this['listenTo'](_0x30e24d,'selectionRemoved',()=>{this['_stopInteraction'](),this['_actionsBalloonView']['disableMiniToolbarButtons']();}),this['listenTo'](_0x30e24d,'dialogClosed',(_0x3688d8,{id:_0xc80493})=>{if('aiActionsBalloon'===_0xc80493){for(const _0x5a98b5 of this['_interactions']){if(0x0===_0x5a98b5['replies']['length']||_0x5a98b5['stoppedExplicitly'])continue;const _0x2ba4b6=_0x5a98b5['replies'][_0x5a98b5['replies']['length']-0x1],_0x221046=_0x2ba4b6['changeGroups'][0x0];_0x221046&&'pending'===_0x221046['state']&&_0x2ba4b6['setChangeGroupState'](0x0,'rejected');}this['_stopInteraction'](),this['_clearInteractionHistory'](),this['stopListening'](this['_actionsBalloonView']),this['stopListening'](_0x30e24d);}}),this['_createInteraction'](_0xbcb387,_0x117ffc,_0x30e24d,_0x3592f6);}['_setupApplyListeners'](){if(!this['_interactionParams'])return;const {modelFragment:_0x5d2fe9,anchorData:_0x214e0d}=this['_interactionParams'];this['listenTo'](this['_actionsBalloonView'],'applySuggestion',()=>{this['_applyChanges'](_0x5d2fe9,_0x214e0d,!0x1);}),this['listenTo'](this['_actionsBalloonView'],'insertSuggestion',()=>{this['_applyChanges'](_0x5d2fe9,_0x214e0d,!0x0);});}['_wrapWithCommonAncestors'](_0x571b2a,_0x137194,_0x128f2d){const _0x39ff5d=this['editor']['model']['createRange'](_0x137194,_0x128f2d)['getCommonAncestor'](),_0x3ca60c=_0x39ff5d['is']('documentFragment')?[]:_0x39ff5d['getAncestors']({'includeSelf':!0x0})['slice'](0x1);if(_0x3ca60c['length']){const _0x5681dd=_0x3ca60c['map'](_0x430046=>_0x430046['_clone'](!0x1));for(let _0x1b85ca=0x1;_0x1b85ca<_0x5681dd['length'];_0x1b85ca++)_0x5681dd[_0x1b85ca-0x1]['_appendChild'](_0x5681dd[_0x1b85ca]);return _0x5681dd[_0x5681dd['length']-0x1]['_appendChild'](_0x571b2a),new _0xc0db40(_0x5681dd[0x0]);}return _0x571b2a;}['_copyMarkersToFragment'](_0x1fde3f,_0x12620c,_0x44e58e={'isTableSelection':!0x1}){const _0x4c2de3=this['editor']['model'],_0x2b375f=Array['from'](_0x12620c['getRanges']()),_0x4e13c9=_0x12620c['getFirstRange']()['start'];for(const _0x23aee5 of _0x4c2de3['markers']){if(_0x23aee5['name']['startsWith']($s)||!_0x23aee5['affectsData'])continue;const _0x35c980=_0x23aee5['getRange']();if(!_0x2b375f['some'](_0x2b91e4=>_0x2b91e4['containsRange'](_0x35c980,!0x0)))continue;const _0x45da52=this['_regularCalculateMarkerPath'](_0x35c980['start'],_0x4e13c9,_0x44e58e['isTableSelection']),_0x64a2c6=this['_regularCalculateMarkerPath'](_0x35c980['end'],_0x4e13c9,_0x44e58e['isTableSelection']),_0x4fa190=_0x4c2de3['createPositionFromPath'](_0x1fde3f,_0x45da52),_0x365f00=_0x4c2de3['createPositionFromPath'](_0x1fde3f,_0x64a2c6);if(!_0x4fa190['isEqual'](_0x365f00)){const _0x116937=_0x4c2de3['createRange'](_0x4fa190,_0x365f00);_0x1fde3f['markers']['set'](_0x23aee5['name'],_0x116937);}}}['_regularCalculateMarkerPath'](_0x5d5965,_0x42e0c5,_0x485bda=!0x1){const _0x470247=[..._0x5d5965['path']['slice']()];for(let _0x1c6e1f=0x0;_0x1c6e1f<Math['max'](_0x42e0c5['path']['length'],_0x5d5965['path']['length']);_0x1c6e1f++){const _0x2a1b27=_0x42e0c5['path'][_0x1c6e1f]||0x0,_0x47630e=(_0x5d5965['path'][_0x1c6e1f]||0x0)-_0x2a1b27;if(_0x470247[_0x1c6e1f]=_0x47630e,0x0!==_0x47630e&&!_0x485bda)break;}return _0x470247;}async['_createInteraction'](_0x23448c,_0x9ce8ee,_0x48843e,_0x1ca423){const _0x37fece=this['editor'];this['_interactionParams']||(this['_interactionParams']={'action':_0x1ca423,'content':_0x23448c,'version':_0x9ce8ee,'aiBalloon':_0x48843e,'modelFragment':this['editor']['model']['getSelectedContent'](this['editor']['model']['document']['selection']),'anchorData':new Map()});const _0x27dc8e=new Ga({'connector':this['_aiConnector'],'editor':_0x37fece,'content':_0x23448c,'version':_0x9ce8ee,..._0x1ca423});this['_interactions']['push'](_0x27dc8e);const _0x2670f9=(_0x3ffb6e,_0x283fc6=!0x1,_0x17432f='streaming')=>this['_promiseQueue']['enqueue'](async _0x4087c3=>{try{const _0x429f9f=Ss({'editor':_0x37fece,'changeGroups':_0x3ffb6e['changeGroups'],'documentContextContent':_0x3ffb6e['documentContextContent'],'showDiff':_0x283fc6,'trimUnchanged':!0x1});_0x429f9f['length']&&await this['_actionsBalloonView']['updateContent']({'part':_0x429f9f[0x0],'renderingStrategy':_0x17432f,'abortSignal':_0x4087c3});}catch(_0x515c4a){if(this['_isAbortError'](_0x515c4a))return;throw _0x515c4a;}});_0x27dc8e['on']('replyCreated',(_0x1bf4c0,_0x1582b5)=>{this['_actionsBalloonView']['hideLoader'](),this['_actionsBalloonView']['startAutoScroll'](),_0x2670f9(_0x1582b5)['catch'](_0x375722=>{this['_isAbortError'](_0x375722)||(console['error']('Error\x20updating\x20content\x20in\x20replyCreated:',_0x375722),this['_setErrorState'](_0x27dc8e));});}),_0x27dc8e['on']('replyContentUpdated',(_0x2483a4,_0x175687)=>{_0x2670f9(_0x175687)['catch'](_0x466bf5=>{this['_isAbortError'](_0x466bf5)||(console['error']('Error\x20updating\x20content\x20in\x20replyContentUpdated:',_0x466bf5),this['_setErrorState'](_0x27dc8e));});}),_0x27dc8e['on']('interactionFinished',async()=>{try{await this['_clearLoadingState'](),this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']),await this['_promiseQueue']['queueEmptyPromise'];}catch(_0x15c549){this['_isAbortError'](_0x15c549)||(console['error']('Error\x20clearing\x20loading\x20state\x20in\x20interactionFinished:',_0x15c549),this['_setErrorState'](_0x27dc8e));}finally{this['_actionsBalloonView']['stopAutoScroll']();}}),this['listenTo'](this['_actionsBalloonView'],'toggleSuggestionDisplayMode',async(_0x3ce47f,{showDiff:_0x21bafb})=>{try{this['_balloonShowDiff']=_0x21bafb;const _0x56239a=this['_interaction']['replies'][this['_interaction']['replies']['length']-0x1];_0x56239a&&await _0x2670f9(_0x56239a,_0x21bafb,'static');}catch(_0x4743b4){this['_isAbortError'](_0x4743b4)||(console['error']('Error\x20updating\x20content\x20in\x20toggleSuggestionDisplayMode:',_0x4743b4),this['_setErrorState'](_0x27dc8e));}}),_0x27dc8e['on']('replyChangeGroupStateUpdated',()=>{const _0x2873b2={'positiveCount':_0x27dc8e['replies']['reduce']((_0x1f1bad,_0x53bb14)=>_0x1f1bad+_0x53bb14['changeGroups']['filter'](_0x291567=>'accepted'===_0x291567['state'])['length'],0x0),'totalCount':_0x27dc8e['replies']['reduce']((_0x59a63a,_0x2bae88)=>_0x59a63a+_0x2bae88['changeGroups']['length'],0x0)},_0x214f80=_0x27dc8e['actionCallId'],_0x8cc02d=_0x27dc8e['actionName'];_0x8cc02d?this['_aiConnector']['upsertAIActionRating'](_0x8cc02d,_0x214f80,_0x2873b2):this['_aiConnector']['upsertCustomAIActionRating'](_0x214f80,_0x2873b2);}),this['_setLoadingState']();try{const _0x7879a4=await _0x27dc8e['start']();return this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']),_0x7879a4;}catch(_0x5e6fb3){if(this['_isAbortError'](_0x5e6fb3))return;this['_actionsBalloonView']['hideLoader'](),this['_setErrorState'](_0x27dc8e);}}['_applyChanges'](_0x35927a,_0x5174d1,_0x2c04e3){const _0x53b216=this['editor'];if(_0x2c04e3&&!_0x53b216['plugins']['has']('TrackChanges'))throw new ot('ai-no-track-changes',null);const _0x5541b9=this['editor']['plugins']['get'](_0x4371ca),_0x2b81de=this['_interactions'][this['_interactions']['length']-0x1-this['_currentInteractionIndex']];if(!_0x2b81de||!_0x2b81de['replies']['length'])return;const _0x58d7e5=_0x2b81de['replies'][_0x2b81de['replies']['length']-0x1],_0x3fe74c=_0x58d7e5['changeGroups'];_0x58d7e5['setChangeGroupState'](0x0,'accepted');let _0x3897f6=Ks({'editor':_0x53b216,'reply':_0x58d7e5,'interaction':_0x2b81de,'groups':_0x3fe74c,'transform':!0x1,'documentCompare':_0x5541b9,'documentCompareOptions':{'anchor':_0x53b216['model']['createPositionAt'](_0x35927a,0x0),'markDeletions':_0x2c04e3}});_0x3897f6=this['_filterOperationsOutsideRange'](_0x3897f6,_0x5174d1);for(const _0xa07495 of _0x3897f6)this['_anchorOperation'](_0x5174d1,_0xa07495,_0x53b216['model']['document']['getRoot']());const _0x171e3b=_0x2b81de['getDocumentContext']()['version'],_0xdb0c83=_0x53b216['model']['document']['history']['getOperations'](_0x171e3b),_0x1feeb7={'document':_0x53b216['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1},_0x3aeb21=_0x1d1cb0(_0x3897f6,_0xdb0c83,_0x1feeb7)['operationsA'];_0x53b216['model']['change'](_0x1073e3=>{if(_0x1073e3['setSelection'](_0x53b216['model']['document']['selection']['focus']),_0x2c04e3)_0x53b216['plugins']['get']('TrackChangesEditing')['_applyOperationsAsSuggestions'](_0x3aeb21);else{for(const _0x4e88b2 of _0x3aeb21)_0x4e88b2['baseVersion']=_0x53b216['model']['document']['version'],Ws(_0x53b216,_0x4e88b2),_0x1073e3['batch']['addOperation'](_0x4e88b2),_0x53b216['model']['applyOperation'](_0x4e88b2);}}),this['editor']['plugins']['get']('AIBalloon')['close']();}['_filterOperationsOutsideRange'](_0xefb2ee,_0x246c00){return _0xefb2ee['filter'](_0x45362c=>{if('rename'==_0x45362c['type']){const _0x2f1438=_0x45362c['position']['nodeAfter'];return!_0x246c00['has'](_0x2f1438);}if(_0x45362c['type']['indexOf']('Attribute')>-0x1){const _0x185b7d=_0x45362c['range']['start']['nodeAfter'];return!_0x246c00['has'](_0x185b7d);}return!0x0;});}['_anchorOperation'](_0x57d7bc,_0x2aa607,_0x5a54cc){const _0x2f7a33=_0x2aa607['clone']();for(const _0x3fc755 in _0x2aa607){const _0x3f7913=_0x2aa607[_0x3fc755];_0x3f7913 instanceof _0x4ed42b?_0x2aa607[_0x3fc755]=new _0x4ed42b(_0x1ba708(_0x3f7913['start']),_0x1ba708(_0x3f7913['end'])):_0x3f7913 instanceof _0x17bb06&&(_0x2aa607[_0x3fc755]=_0x1ba708(_0x3f7913));}if(['insert','move','remove','reinsert','split','merge']['includes'](_0x2f7a33['type'])){if(_0x2f7a33['isDocumentOperation']=!0x1,_0x2f7a33['baseVersion']=null,'remove'==_0x2f7a33['type']){const _0x51d3de=_0x2f7a33['sourcePosition'],_0x191339=_0x2f7a33['howMany'];new _0x2460c5(_0x51d3de,_0x191339)['_execute']();}else _0x2f7a33['_execute']();}function _0x1ba708(_0x4a222f){if('$graveyard'==_0x4a222f['root']['rootName'])return _0x4a222f;const _0x5d1bf7=[];let _0x28ef41=_0x4a222f['root'];for(let _0x111d31=0x0;_0x111d31<_0x4a222f['path']['length'];_0x111d31++){const _0x2e2040=_0x57d7bc['get'](_0x28ef41)||0x0;_0x5d1bf7[_0x111d31]=_0x4a222f['path'][_0x111d31]+_0x2e2040,_0x28ef41=_0x28ef41['getChildAtOffset'](_0x4a222f['path'][_0x111d31]);}return new _0x17bb06(_0x5a54cc,_0x5d1bf7,_0x4a222f['stickiness']);}}['_refreshInteraction'](){if(!this['_interactionParams'])return;this['_interactions']['length']>0x0&&this['_stopInteraction'](),this['_currentInteractionIndex']=0x0,this['_balloonShowDiff']=!0x1;const {action:_0x426cd6,content:_0x59aab8,version:_0x39052d,aiBalloon:_0x50c6b3}=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'](_0x59aab8,_0x39052d,_0x50c6b3,_0x426cd6)['catch'](_0x52aaaa=>{this['_isAbortError'](_0x52aaaa)||console['error']('Error\x20refreshing\x20interaction:',_0x52aaaa);});}['_isAbortError'](_0x4c095c){return!!_0x4c095c['message']&&_0x4c095c['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 _0x2dc365=this['_interactions']['length'];this['_currentInteractionIndex']<_0x2dc365-0x1&&this['_displayInteractionAtIndex'](this['_currentInteractionIndex']+0x1);}['_navigateToNext'](){this['_currentInteractionIndex']>0x0&&this['_displayInteractionAtIndex'](this['_currentInteractionIndex']-0x1);}async['_displayInteractionAtIndex'](_0x396672){if(!this['_interactionParams'])return;this['_currentInteractionIndex']=_0x396672;const _0x3f9436=this['_interactions'][this['_interactions']['length']-0x1-this['_currentInteractionIndex']];if(!_0x3f9436)return;if(_0x3f9436['hasError'])return this['_setErrorState'](_0x3f9436),void this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']);if(!_0x3f9436['replies']['length'])return;this['_actionsBalloonView']['hideError'](),this['_interactionParams']&&this['_clearErrorState']();const _0x32754a=_0x3f9436['replies'][_0x3f9436['replies']['length']-0x1];if(_0x32754a){const _0x40ee50=this['editor'];try{const _0x1b76f3=Ss({'editor':_0x40ee50,'changeGroups':_0x32754a['changeGroups'],'documentContextContent':_0x32754a['documentContextContent'],'showDiff':this['_balloonShowDiff'],'trimUnchanged':!0x1});await new Promise(_0x410e82=>setTimeout(_0x410e82,0x32)),await this['_actionsBalloonView']['updateContent']({'part':_0x1b76f3[0x0],'renderingStrategy':'static','abortSignal':new AbortController()['signal']});}catch(_0x25dbde){this['_isAbortError'](_0x25dbde)||console['error']('Error\x20updating\x20content\x20during\x20navigation:',_0x25dbde);}}this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']);}['_setLoadingState'](){this['_actionsBalloonView']['setIsLoading'](!0x0),this['isBusy']=!0x0;}async['_setErrorState'](_0x494f0d){const _0x383144=as(this['editor']['locale'],'AI_ACTIONS_GENERIC_ERROR');this['_actionsBalloonView']['showError'](_0x383144),_0x494f0d['hasError']=!0x0,await this['_promiseQueue']['queueEmptyPromise'],this['_actionsBalloonView']['setErrorState'](),this['_actionsBalloonView']['toggleIsLoading'](!0x0);}['_clearErrorState'](){this['_actionsBalloonView']['hideError'](),this['_actionsBalloonView']['toggleIsLoading'](!0x1);}async['_clearLoadingState'](){await this['_promiseQueue']['queueEmptyPromise'],this['isBusy']=!0x1,this['_actionsBalloonView']['setIsLoading'](!0x1);}}class Qa extends _0x2dfd9d{static get['requires'](){return[Ma,Va,qa];}static get['pluginName'](){return'AIQuickActions';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x5d53de){super(_0x5d53de),_0x5d53de['config']['define']('ai.quickActions',{'extraCommands':[],'removeCommands':[],'isSearchEnabled':!0x0});}}class Xa extends Nt{['resultResponseView'];['acceptButtonView'];['dismissButtonView'];['infoButtonView'];['outdatedButtonView'];constructor(_0x3311e9,_0x3907cb){super(_0x3311e9),this['id']=_0x3907cb,this['set']('status','pending'),this['set']('changeId',_0x3907cb),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',(_0x4f1f8b,_0x4bdc23)=>{_0x4bdc23&&_0x4bdc23['target']&&'A'===_0x4bdc23['target']['tagName']&&_0x4bdc23['preventDefault'](),this['fire']('activateChange',{'id':_0x3907cb,'source':this,'uiInteraction':'click'});}),this['on']('mouseover',()=>{this['fire']('activateChange',{'id':_0x3907cb,'source':this,'uiInteraction':'hover'});}),this['on']('mouseout',()=>{this['fire']('deactivateChange',{'origin':'panel','id':_0x3907cb,'source':this});});}['setItemAsActive'](){this['isActive']=!0x0;}['setItemAsInactive'](){this['isActive']=!0x1;}['_createResultResponseView'](){const _0x316d5d=new Nt(this['locale']);return _0x316d5d['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',_0x17e491=>!_0x17e491)]}}),_0x316d5d;}['_createAcceptButtonView'](){const _0x2b2dec=new kt(this['locale']);return _0x2b2dec['set']({'label':as(this['locale'],'AI_REVIEW_MODE_ACCEPT_CHANGE'),'withText':!0x0}),_0x2b2dec['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x40a239=>{this['fire']('acceptChange',{'id':this['changeId']}),_0x40a239['stopPropagation']();})},'attributes':{'class':[this['bindTemplate']['if']('status','ck-hidden',_0x2400ea=>'pending'!==_0x2400ea&&'accepted'!==_0x2400ea),this['bindTemplate']['if']('status',hs,_0x1d6308=>'pending'===_0x1d6308),this['bindTemplate']['if']('status',cs,_0x5e4642=>'pending'!==_0x5e4642),this['bindTemplate']['if']('status','ck-ai_review__check-run-result-status-button',_0x2a03c4=>'accepted'===_0x2a03c4)]}}),this['on']('change:status',(_0x29db02,_0x4506db,_0x2959f8)=>{_0x2b2dec['isEnabled']='pending'===_0x2959f8,'accepted'===_0x2959f8&&(_0x2b2dec['label']=as(this['locale'],'AI_REVIEW_MODE_CHECK_STATUS_ACCEPTED'),_0x2b2dec['icon']=_0x2bffb7);}),_0x2b2dec;}['_createDismissButtonView'](){const _0x2ae789=new kt(this['locale']);return _0x2ae789['set']({'label':as(this['locale'],'AI_REVIEW_MODE_DISMISS_CHANGE'),'withText':!0x0}),_0x2ae789['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x23a651=>{this['fire']('dismissChange',{'id':this['changeId']}),_0x23a651['stopPropagation']();})},'attributes':{'class':[cs,this['bindTemplate']['if']('status','ck-hidden',_0x5abdf0=>'pending'!==_0x5abdf0&&'rejected'!==_0x5abdf0),this['bindTemplate']['if']('status','ck-ai_review__check-run-result-dismiss-button',_0xe4235=>'pending'===_0xe4235),this['bindTemplate']['if']('status','ck-ai_review__check-run-result-status-button',_0x266618=>'rejected'===_0x266618)]}}),this['on']('change:status',(_0x3e8002,_0x520ce1,_0x5b6067)=>{_0x2ae789['isEnabled']='pending'===_0x5b6067,'rejected'===_0x5b6067&&(_0x2ae789['label']=as(this['locale'],'AI_REVIEW_MODE_CHECK_STATUS_REJECTED'),_0x2ae789['icon']=_0x101f07);}),_0x2ae789;}['_createInfoButtonView'](){const _0x31539d=new kt(this['locale']);return _0x31539d['set']({'label':as(this['locale'],'AI_REVIEW_MODE_LEARN_MORE'),'icon':_0x5689fd,'tooltip':!0x0,'isToggleable':!0x0,'role':'menuitemcheckbox','class':cs+'\x20ck-ai_review__check-run-result-info-button\x20ck-hidden'}),_0x31539d['bind']('isOn')['to'](this,'isInfoToggleOn',_0x1ee654=>_0x1ee654),_0x31539d['on']('execute',()=>{this['isInfoToggleOn']=!this['isInfoToggleOn'];}),_0x31539d;}['_createOutdatedButtonView'](){const _0x55a625=new kt(this['locale']);return _0x55a625['set']({'label':as(this['locale'],'AI_REVIEW_MODE_CHECK_STATUS_OUTDATED'),'icon':it,'withText':!0x0,'isEnabled':!0x1}),_0x55a625['extendTemplate']({'attributes':{'class':[cs,'ck-ai_review__check-run-result-status-button',this['bindTemplate']['if']('status','ck-hidden',_0x1853a6=>'outdated'!==_0x1853a6)],'disabled':'disabled'}}),_0x55a625;}}class za extends Qt{['resultItemView'];['_pinnedRectIndex']=void 0x0;['_pinnedTargetElement']=void 0x0;['_pinnedTargetChangeId']=void 0x0;constructor(_0x5b4565,_0x34cfc6){super(_0x5b4565),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']()),_0x34cfc6['add'](this);}['render'](){super['render'](),this['_setupClickOutsideHandler']();}['updateContent'](_0x24f5fa){this['resultItemView']['changeId']=_0x24f5fa['id'],this['resultItemView']['resultResponseView']['element']['innerHTML']=_0x24f5fa['contentDiffed'];}['showBalloon'](_0x1e7e86,_0xec4bd1,_0x1e15a2,_0xfdcc43,_0x32c961,_0x2a8c64){const _0x14323b=_0xec4bd1();if(!_0x14323b)return;this['updateContent'](_0x1e7e86),this['show']();const _0x140f9c=Array['from'](_0x14323b['getClientRects']())['reverse'](),_0x1bc7a8=this['_getPointedRectIndexFromEvent'](_0x1e15a2,_0x140f9c),_0x39b768=_0x140f9c[_0x1bc7a8??0x0];'click'===_0xfdcc43?(this['isDiffActive']=!0x0,this['pin']({'target':()=>this['_getBestRectPositionOnClick'](_0xec4bd1(),_0x1bc7a8,_0x1e7e86['id'],_0x32c961,_0x2a8c64)||_0x39b768})):'hover'===_0xfdcc43&&(this['isDiffActive']=!0x1,this['pin']({'target':()=>this['_getBestRectPositionOnHover'](_0xec4bd1(),_0x1bc7a8,_0x1e7e86['id'])||_0x39b768}));}['hideBalloon'](){this['hide'](),this['unpin'](),this['_pinnedRectIndex']=void 0x0,this['_pinnedTargetElement']=void 0x0,this['_pinnedTargetChangeId']=void 0x0;}['hideDiffInBalloon'](){this['resultItemView']['showDiff']=!0x1;}['showDiffInBalloon'](){this['resultItemView']['showDiff']=!0x0;}['deactivateChange'](){this['fire']('deactivateChange',{'origin':'balloon'});}['_setupClickOutsideHandler'](){Xt({'emitter':this,'activator':()=>this['isVisible'],'contextElements':()=>{const _0x2aa9e7=[this['element']];return this['_pinnedTargetElement']&&_0x2aa9e7['push'](this['_pinnedTargetElement']),_0x2aa9e7;},'callback':()=>{this['hide'](),this['unpin'](),this['deactivateChange'](),this['_pinnedTargetElement']=void 0x0,this['_pinnedRectIndex']=void 0x0,this['_pinnedTargetChangeId']=void 0x0;}});}['_createContentView'](){const _0x5ea4f7=new Nt();return this['resultItemView']=new Xa(this['locale'],''),this['resultItemView']['resultResponseView']['extendTemplate']({'attributes':{'class':['ck-content']}}),this['resultItemView']['delegate']('acceptChange','dismissChange')['to'](this),_0x5ea4f7['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']]}]}),_0x5ea4f7;}['_getBestRectPositionOnClick'](_0x314403,_0x4be9d5,_0x5af3dc,_0x3b5820,_0x350d48){if(!_0x314403)return null;const _0x277b27=this['position']['replace']('arrow_',''),_0x2daae9=Array['from'](_0x314403['getClientRects']());let _0x55ed0d,_0x6e658e=_0x2daae9['reverse']();return void 0x0!==_0x4be9d5&&this['_isPinnedRectVisible'](_0x6e658e[_0x4be9d5],_0x3b5820,_0x350d48)?(_0x55ed0d=_0x6e658e[_0x4be9d5],this['_pinnedRectIndex']=_0x4be9d5):this['_isPinnedRectVisible'](_0x6e658e[0x0],_0x3b5820,_0x350d48)&&void 0x0===_0x4be9d5?_0x55ed0d=_0x6e658e[0x0]:(_0x6e658e='s'==_0x277b27[0x0]?[..._0x2daae9]['reverse']():_0x2daae9,_0x6e658e['forEach'](_0x2810f3=>{this['_isPinnedRectVisible'](_0x2810f3,_0x3b5820,_0x350d48)&&(_0x55ed0d=_0x2810f3);})),this['_pinnedTargetChangeId']=_0x5af3dc,this['_pinnedTargetElement']=_0x314403,_0x55ed0d||_0x314403['getBoundingClientRect']();}['_getBestRectPositionOnHover'](_0x18b28b,_0xa359c5,_0x47fdb0){if(!_0x18b28b)return null;const _0x4565c9=Array['from'](_0x18b28b['getClientRects']())['reverse']();if(void 0x0===this['_pinnedRectIndex']&&void 0x0!==_0xa359c5&&this['_pinnedTargetChangeId']!==_0x47fdb0)return this['_pinnedRectIndex']=_0xa359c5,this['_pinnedTargetElement']=_0x18b28b,this['_pinnedTargetChangeId']=_0x47fdb0,_0x4565c9[_0xa359c5];if(void 0x0!==this['_pinnedRectIndex']&&this['_pinnedTargetChangeId']===_0x47fdb0){if(_0x18b28b!==this['_pinnedTargetElement'])return Array['from'](this['_pinnedTargetElement']['getClientRects']())['reverse']()[this['_pinnedRectIndex']];return _0x4565c9[this['_pinnedRectIndex']];}return void 0x0!==_0xa359c5&&this['_pinnedTargetChangeId']!==_0x47fdb0?(this['_pinnedRectIndex']=_0xa359c5,this['_pinnedTargetElement']=_0x18b28b,this['_pinnedTargetChangeId']=_0x47fdb0,_0x4565c9[_0xa359c5]):_0x18b28b['getBoundingClientRect']();}['_getPointedRectIndexFromEvent'](_0x2261e1,_0x2acf7b){if(_0x2261e1)for(let _0x28faa8=0x0;_0x28faa8<_0x2acf7b['length'];_0x28faa8++){const _0x31cb7d=_0x2acf7b[_0x28faa8];if(_0x2261e1['clientX']>=_0x31cb7d['left']-0x3&&_0x2261e1['clientX']<=_0x31cb7d['right']+0x3&&_0x2261e1['clientY']>=_0x31cb7d['top']-0x3&&_0x2261e1['clientY']<=_0x31cb7d['bottom']+0x3)return _0x28faa8;}}['_isPinnedRectVisible'](_0x32549d,_0x4246d5,_0x298a04){const _0x317ec4=new ut(_0x32549d),_0x481b81=_0x4246d5||document['documentElement'],_0x574d42=_0x317ec4['getIntersection'](bt(_0x298a04)),_0x14b697=new ut(_0x481b81)['getIntersection'](_0x317ec4);return!!(_0x574d42&&_0x14b697&&_0x317ec4['width']>0x0);}}const ja=['getReviewCheckList','runReviewCheck','abortReviewStream','toggleDiff','acceptAllChanges','leaveReviewCoreResultList','activateChange','deactivateChange','acceptChange','dismissChange','learnMore','finishReview','retryReview'];class Ja extends _0x1aa7e1{['_mainView'];['_balloonSuggestionView'];['_bodyCollection'];static get['requires'](){return[ns];}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x540d97){super(_0x540d97),this['_bodyCollection']=new qt(this['context']['locale']),this['_bodyCollection']['attachToDom'](),this['_mainView']=this['createMainView'](),this['_mainView']['delegate'](...ja)['to'](this),this['_balloonSuggestionView']=new za(this['context']['locale'],this['_bodyCollection']),this['_balloonSuggestionView']['delegate']('acceptChange','dismissChange','deactivateChange')['to'](this);}['init'](){const _0x2d34f4=this['context']['plugins']['get']('AITabs');this['registerTab'](_0x2d34f4);}['destroy'](){this['_bodyCollection']['detachFromDom'](),super['destroy']();}['setAvailableChecks'](_0x58ab84){if(!this['_mainView']['reviewCheckListView']['hasChecks']()){const _0x227ee6=!this['context']['config']['get']('ai.models.showModelSelector');this['_mainView']['reviewCheckListView']['setChecks'](_0x58ab84,_0x227ee6);}this['_mainView']['showReviewCheckListView']();}['showReviewCheckList'](){this['fire']('getReviewCheckList');}['showCheckRunResults'](_0x532538){_0x532538&&('error-general'!==_0x532538['status']?'error-chunk'!==_0x532538['status']?this['_mainView']['showReviewCheckResultsView']():this['showChunkErrorView']():this['showGeneralResultsErrorView']());}['showCheckRunResult'](_0x368294){this['_mainView']['addCheckRunResult'](_0x368294);}['showGeneralResultsErrorView'](){this['_mainView']['showGeneralResultsErrorView']();}['showGeneralReviewCoreErrorView'](_0x310bbd){this['_mainView']['showGeneralReviewCoreErrorView'](_0x310bbd??as(this['context']['locale'],'AI_REVIEW_INITIALIZATION_ERROR_MESSAGE'));}['showChunkErrorView'](){this['_mainView']['showChunkErrorView']();}['setCheckResultTitle'](_0x3504c4,_0x607950){this['_mainView']['reviewCheckResultsView']['setTitle'](_0x3504c4,_0x607950);}['setActiveStateInResults'](_0x5d658b){this['_mainView']['reviewCheckResultsView']['getResults']()['forEach'](_0x32fb17=>{_0x32fb17['id']===_0x5d658b&&_0x32fb17['setItemAsActive']();});}['resetActiveStateInResults'](){this['_mainView']['reviewCheckResultsView']['getResults']()['forEach'](_0x516710=>_0x516710['setItemAsInactive']());}['updateChangeState'](_0x2f756e,_0x4adbbc){'accepted'===_0x4adbbc||'rejected'===_0x4adbbc||'outdated'===_0x4adbbc?this['_mainView']['reviewCheckResultsView']['hideResult'](_0x2f756e,_0x4adbbc):this['_mainView']['reviewCheckResultsView']['showResult'](_0x2f756e,_0x4adbbc);}['showReviewCompletedView'](){this['_mainView']['showReviewCompletedView']();}['showActionsWhenResultIsReady'](){this['_mainView']['showActionsWhenResultIsReady']();}['showNoChangesView'](){this['_mainView']['showNoChangesView']();}['hideActionsWhenResultIsReady'](){this['_mainView']['hideActionsWhenResultIsReady']();}['showChangeBalloon'](_0xc62e0e,_0x1f9425,_0x15c462,_0x57170c,_0x331ad1,_0x35a135){this['_balloonSuggestionView']['showBalloon'](_0xc62e0e,_0x1f9425,_0x15c462,_0x57170c,_0x331ad1,_0x35a135);}['hideChangeBalloon'](){this['_balloonSuggestionView']['hideBalloon']();}['hideDiffInBalloon'](){this['_balloonSuggestionView']['hideDiffInBalloon']();}['showDiffInBalloon'](){this['_balloonSuggestionView']['showDiffInBalloon']();}['getChangeElement'](_0x31416f){const _0x51294d=this['_mainView']['reviewCheckResultsView']['getResults']()['find'](_0x22704b=>_0x22704b['id']===_0x31416f);return _0x51294d?_0x51294d['element']:null;}['deactivateChange'](){this['_balloonSuggestionView']['deactivateChange']();}}class Za extends Nt{constructor(_0x56db09){super(_0x56db09),this['set']('isVisible',!0x1),this['set']('errorMessage','');const _0x5ba4ea=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai_review__general-error-container',_0x5ba4ea['if']('isVisible','ck-hidden',_0x3c3a69=>!_0x3c3a69)]},'children':[{'tag':'p','attributes':{'class':'ck\x20ck-ai-notification\x20ck-ai-notification_error'},'children':[{'text':_0x5ba4ea['to']('errorMessage')}]}]});}}class to extends Nt{['reviewCoreHeader'];['generalErrorView'];['reviewCheckListView'];['reviewCheckResultsView'];['reviewCompletedView'];constructor(_0x3e4df0,_0x26955c){super(_0x3e4df0),this['reviewCoreHeader']=_0x26955c['header'],this['generalErrorView']=new Za(_0x3e4df0),this['reviewCheckListView']=_0x26955c['list'],this['reviewCheckListView']['delegate'](...ja)['to'](this),this['reviewCheckResultsView']=_0x26955c['results'],this['reviewCheckResultsView']['delegate'](...ja)['to'](this),this['reviewCompletedView']=_0x26955c['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'](_0xd691b1){this['reviewCheckResultsView']['addResult'](_0xd691b1),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'](_0x45f0b2){this['generalErrorView']['set']('isVisible',!0x0),this['generalErrorView']['errorMessage']=_0x45f0b2;}['showGeneralResultsErrorView'](){this['reviewCheckResultsView']['set']('isLoading',!0x1),this['showActionsWhenResultIsReady'](),this['reviewCheckResultsView']['showGeneralErrorMessage']();}['showChunkErrorView'](){this['reviewCheckResultsView']['set']('isLoading',!0x1),this['showActionsWhenResultIsReady'](),this['reviewCheckResultsView']['showChunkErrorMessage']();}}class eo extends kt{constructor(_0x33b23d,_0x488d5e){super(_0x488d5e),this['set']({'label':_0x33b23d,'withText':!0x0,'class':os}),this['on']('execute',()=>{this['fire']('finishReview');});}}class io extends Pt{['_resultViews'];['_resultsHeader'];['reviewDisclaimer'];['_cancelButtonView'];['_acceptAllButtonView'];['_exitReviewButtonView'];['_toggleDiffButtonView'];['_errorMessageView'];['_finishReviewButtonView'];['_contents'];constructor(_0x23e00e,_0x1c8ec2){super(_0x23e00e),this['_contents']=_0x1c8ec2,this['_resultViews']=new _0x1898c2(),this['_cancelButtonView']=this['_createCancelButtonView'](),this['_acceptAllButtonView']=this['_createAcceptAllButtonView'](),this['_exitReviewButtonView']=this['_createExitReviewButtonView'](),this['_toggleDiffButtonView']=this['_createToggleDiffButtonView'](),this['_finishReviewButtonView']=this['_createFinishReviewButtonView'](),this['_resultsHeader']=this['_createResultHeaderView'](),this['_errorMessageView']=this['_createErrorView'](),this['reviewDisclaimer']=new jr(_0x23e00e),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 _0x4899e2=this['_createCombinedSkeletonLoader'](),_0x396731=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run',_0x396731['if']('isLoading','ck-ai_review__check-run_loading',_0x18eff8=>_0x18eff8),_0x396731['if']('isResultReady','ck-ai_review__check-run_ready',_0x43aa85=>_0x43aa85),_0x396731['if']('isVisible','ck-hidden',_0x263d30=>!_0x263d30)]},'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',_0x15af99=>_0x15af99)]},'children':this['_resultViews']},_0x4899e2]},this['reviewDisclaimer']]});}['clearResults'](){this['_resultViews']['clear']();}['getResults'](){return this['_resultViews'];}['addResult'](_0x476763){const _0x508b4c=new Xa(this['locale'],_0x476763['id']);_0x508b4c['delegate']('acceptChange','dismissChange','activateChange','deactivateChange')['to'](this),this['_resultViews']['add'](_0x508b4c),_0x508b4c['resultResponseView']['element']['innerHTML']=_0x476763['contentDiffed'];}['hideResult'](_0x338a78,_0x5e6254){if('pending'===_0x5e6254)return;const _0x205600=this['_resultViews']['find'](_0x47f5b6=>_0x47f5b6['id']===_0x338a78);_0x205600&&(_0x205600['status']=_0x5e6254,_0x205600['element']?.['classList']['add']('ck-ai_review__check-run-result_grayout'));}['showResult'](_0x3e7398,_0x2e9ebe){if('pending'!==_0x2e9ebe)return;const _0xc79435=this['_resultViews']['find'](_0x163bc5=>_0x163bc5['id']===_0x3e7398);_0xc79435&&(_0xc79435['status']=_0x2e9ebe,_0xc79435['element']?.['classList']['remove']('ck-ai_review__check-run-result_grayout'));}['setTitle'](_0xa0c88b,_0x100af0){this['headerTitle']=_0xa0c88b,this['headerSubtitle']=_0x100af0||'';}['showChunkErrorMessage'](){this['errorType']='chunk',this['showErrorMessage']=!0x0;}['showGeneralErrorMessage'](){this['isError']=!0x0,this['errorType']='general',this['showErrorMessage']=!0x0;}['resetErrorState'](){this['isError']=!0x1,this['errorType']='general',this['showErrorMessage']=!0x1;}['_createSkeletonLoader'](){return new zn(this['locale'],jn['aiReviewChecks']);}['_createCombinedSkeletonLoader'](){const _0x4bf08c=new Nt(this['locale']),_0x2be8c8=[];for(let _0x108235=0x0;_0x108235<0x10;_0x108235++){const _0x55945f=this['_createSkeletonLoader']();_0x55945f['extendTemplate']({'attributes':{'class':['ck-ai_review__check-run-skeleton-item']}}),_0x2be8c8['push'](_0x55945f);}return _0x4bf08c['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-skeleton-container',this['bindTemplate']['if']('isLoading','ck-hidden',_0x197e6f=>!_0x197e6f)]},'children':_0x2be8c8}),_0x4bf08c;}['_createErrorView'](){const _0x5e7124=new Nt(this['locale']),_0x22157e=new kt(this['locale']),t=this['locale']['t'];return _0x5e7124['delegate']('retryReview')['to'](this),_0x22157e['set']({'label':t('Try\x20again'),'withText':!0x0,'class':hs+'\x20ck-ai_review__check-run-error-retry-button'}),_0x22157e['on']('execute',()=>{this['fire']('retryReview');}),_0x5e7124['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-error-container',this['bindTemplate']['if']('showErrorMessage','ck-hidden',_0x16df14=>!_0x16df14),this['bindTemplate']['if']('errorType','ck-ai_review__check-run-error-container_border-bottom',_0x115a0b=>'chunk'===_0x115a0b)]},'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',_0x7ab8c4=>'chunk'===_0x7ab8c4)]},'children':[{'tag':'p','attributes':{'class':['ck-ai-notification__content',this['bindTemplate']['if']('errorType','ck-hidden',_0x3fdd88=>'general'!==_0x3fdd88)]},'children':[{'text':this['_contents']['generalErrorText']}]},{'tag':'p','attributes':{'class':['ck-ai-notification__content',this['bindTemplate']['if']('errorType','ck-hidden',_0x1f8535=>'chunk'!==_0x1f8535)]},'children':[{'text':as(this['locale'],'AI_REVIEW_MODE_CHUNK_ERROR_MESSAGE')}]}]},_0x22157e]}),_0x5e7124;}['_createCancelButtonView'](){const _0x432a83=new kt(this['locale']);return _0x432a83['set']({'label':as(this['locale'],'AI_REVIEW_MODE_STOP_GENERATING'),'withText':!0x0,'class':[hs+'\x20ck-ai-button-stop-generating'],'icon':_0x914ad1}),_0x432a83['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isResultReady','ck-hidden',_0x17d4ed=>_0x17d4ed),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x27d92d=>_0x27d92d)]}}),_0x432a83['on']('execute',()=>{this['fire']('abortReviewStream');}),_0x432a83;}['_createToggleDiffButtonView'](){const _0x38102a=new kt(this['locale']);_0x38102a['set']({'tooltip':!0x0,'isToggleable':!0x0,'role':'menuitemcheckbox'}),_0x38102a['bind']('isEnabled')['to'](this,'isError',_0x1061ff=>!_0x1061ff),_0x38102a['extendTemplate']({'attributes':{'class':[hs,'ck-ai_review__check-run-toggle-diff-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0x217531=>!_0x217531),this['bindTemplate']['if']('isCompleted','ck-hidden',_0xaf699c=>_0xaf699c)]}});const _0x424123=as(this['locale'],'AI_REVIEW_MODE_HIDE_CHANGES'),_0x5b203f=as(this['locale'],'AI_REVIEW_MODE_SHOW_CHANGES');return _0x38102a['bind']('isOn')['to'](this,'isToggleDiffOn',_0x17c3e5=>_0x17c3e5),_0x38102a['bind']('icon')['to'](this,'isToggleDiffOn',_0x366ab0=>_0x366ab0?st:nt),_0x38102a['bind']('label')['to'](this,'isToggleDiffOn',_0x1e4d38=>_0x1e4d38?_0x424123:_0x5b203f),_0x38102a['on']('execute',()=>{this['isToggleDiffOn']=!this['isToggleDiffOn'],this['fire']('toggleDiff',{'on':this['isToggleDiffOn']});}),_0x38102a;}['_createAcceptAllButtonView'](){const _0x1ab6e6=new kt(this['locale']);return _0x1ab6e6['set']({'label':as(this['locale'],'AI_REVIEW_MODE_ACCEPT_ALL'),'withText':!0x0}),_0x1ab6e6['bind']('isEnabled')['to'](this,'isError',_0x170786=>!_0x170786),_0x1ab6e6['extendTemplate']({'attributes':{'class':[os,'ck-ai_review__check-run-accept-all-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0x110bf6=>!_0x110bf6),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x26c75e=>_0x26c75e)]}}),_0x1ab6e6['on']('execute',()=>{this['fire']('acceptAllChanges');}),_0x1ab6e6;}['_createExitReviewButtonView'](){const _0x2876d=new kt(this['locale']);return _0x2876d['set']({'label':as(this['locale'],'AI_REVIEW_MODE_EXIT_REVIEW'),'withText':!0x0}),_0x2876d['extendTemplate']({'attributes':{'class':[cs,'ck-ai_review__check-run-exit-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0x1ff74d=>!_0x1ff74d),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x5259ac=>_0x5259ac)]}}),_0x2876d['on']('execute',()=>{this['fire']('leaveReviewCoreResultList');}),_0x2876d;}['_createResultHeaderView'](){const _0x5c68f4=new Nt(this['locale']),_0x374b38=this['_createTitleView']();return _0x5c68f4['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-header',this['bindTemplate']['if']('isCompleted','ck-ai_review__review-completed-header',_0x32755a=>_0x32755a)]},'children':[_0x374b38,{'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-header-buttons']},'children':[this['_cancelButtonView'],this['_acceptAllButtonView'],this['_exitReviewButtonView'],this['_toggleDiffButtonView'],this['_finishReviewButtonView']]}]}),_0x5c68f4;}['_createTitleView'](){const _0x2f58da=new Nt(this['locale']),_0x4ea5d3=new fn();return _0x4ea5d3['bind']('isVisible')['to'](this,'isResultReady',_0x27f3f7=>!_0x27f3f7),_0x2f58da['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-header-title-wrapper']},'children':[_0x4ea5d3,{'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-header-title-content',this['bindTemplate']['if']('isCompleted','ck-hidden',_0x5b555a=>_0x5b555a)]},'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',_0x44d894=>!_0x44d894)]},'children':[{'text':as(this['locale'],'AI_REVIEW_MODE_FINISH_REVIEW_HEADER_TITLE')}]}]}),_0x2f58da;}['_createFinishReviewButtonView'](){const _0x39df9e=new eo(as(this['locale'],'AI_REVIEW_MODE_FINISH_REVIEW_BUTTON_LABEL'),this['locale']);return _0x39df9e['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isCompleted','ck-hidden',_0x478b80=>!_0x478b80)]}}),_0x39df9e['delegate']('finishReview')['to'](this),_0x39df9e;}}class so extends Pt{['_resultsHeader'];['_finishReviewButtonView'];constructor(_0x331e64,_0x433442){super(_0x331e64),this['_finishReviewButtonView']=this['_createFinishReviewButtonView'](_0x433442['buttonText']),this['_resultsHeader']=this['_createResultHeaderView'](_0x433442['headerText']);const _0x2c0da3=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__review-completed',_0x2c0da3['if']('isVisible','ck-hidden',_0x5ba983=>!_0x5ba983)]},'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':_0x433442['emptyResultsText']}]}]}]});}['_createFinishReviewButtonView'](_0x24bc8a){const _0x559100=new eo(_0x24bc8a,this['locale']);return _0x559100['delegate']('finishReview')['to'](this),_0x559100;}['_createResultHeaderView'](_0x3f5229){const _0x31fa45=new Nt(this['locale']);return _0x31fa45['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':_0x3f5229}]},{'tag':'div','attributes':{'class':['ck-ai_review__review-completed-header-buttons']},'children':[this['_finishReviewButtonView']]}]}),_0x31fa45;}}class no extends Nt{['_dropdownView'];['_defaultValue'];['_defaultLabel'];constructor(_0x19814c,_0x5e70e8){super(_0x19814c),this['_defaultValue']=_0x5e70e8['default']||(_0x5e70e8['data']['length']>0x0?_0x5e70e8['data'][0x0]['id']:''),this['_defaultLabel']=_0x5e70e8['data']['find'](_0x1f3fcb=>_0x1f3fcb['id']===this['_defaultValue'])?.['label']||'',this['set']('formValue',''),this['_dropdownView']=Bt(this['locale']);const _0x20bd90=this['_prepareListOptions'](_0x5e70e8['data']);zt(this['_dropdownView'],_0x20bd90,{'role':'menu','ariaLabel':_0x5e70e8['label']}),this['_dropdownView']['buttonView']['set']({'label':this['_defaultLabel'],'withText':!0x0}),this['_dropdownView']['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x45dbdb=>{_0x45dbdb['stopPropagation']();})}}),this['listenTo'](this['_dropdownView'],'execute',_0x1df44c=>{this['formValue']=_0x1df44c['source']['model']['id'],this['_dropdownView']['buttonView']['label']=_0x1df44c['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'](_0x2c0a8a=[]){const _0x265091=new dt();this['resetToDefault']();for(const _0x25c51b of _0x2c0a8a){const _0x23c270=new jt({'label':_0x25c51b['label'],'withText':!0x0,'role':'menuitemradio','id':_0x25c51b['id'],'model':_0x25c51b});_0x23c270['bind']('isOn')['to'](this,'formValue',_0x116f9b=>_0x116f9b===_0x23c270['id']);const _0x4f3bcc={'type':'button','model':_0x23c270};_0x265091['add'](_0x4f3bcc);}return _0x265091;}}class ro extends Pt{['_formItem']=null;constructor(_0xb7356a,_0x184f5f,_0x21414e){super(_0xb7356a),this['argsKey']=_0x184f5f?.['argsKey'];if('dropdown'===_0x184f5f['formType'])this['_formItem']=new no(this['locale'],_0x184f5f);this['set']('value',''),this['bind']('value')['to'](this['_formItem'],'formValue');const _0x162efd=new _0x1b16f9(this['locale'],{'children':[this['_formItem']],'class':[_0x21414e?'ck-form__row_with-submit':'']});_0x21414e&&_0x162efd['children']['add'](_0x21414e),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai_review__form-item','ck-reset_all']},'children':[_0x162efd]});}['resetToDefault'](){this['_formItem']['resetToDefault']();}}class ao extends _0x2c3bb3{['keystrokes'];static ['MIN_ROWS']=0x1;static ['MAX_ROWS']=0xc;constructor(_0x3d1ff7){super(_0x3d1ff7),this['set']('isEmpty',!0x0),this['keystrokes']=new At(),this['minRows']=ao['MIN_ROWS'],this['maxRows']=ao['MAX_ROWS'],this['extendTemplate']({'attributes':{'id':'ai-review-prompt-input','class':['ck','ck-review__prompt-input']}});}['render'](){super['render'](),this['on']('update',()=>{this['isEmpty']=''===this['element']['value']?.['trim']();}),this['keystrokes']['listenTo'](this['element']);}}class oo extends Nt{['focusTracker']=new _t();['keystrokes']=new At();['focusCycler'];['_focusables']=new _0x1898c2();['submitButtonView'];['cancelButtonView'];['promptInputView'];['actionsFooterView'];['_modelSelectionDropdown'];['_modelNameView'];['_modelSelectionDropdownItems'];['_check'];['_defaultValue'];['_defaultLabel'];constructor(_0x32d82c,_0x26f952,_0x138886=!0x1){super(_0x32d82c),this['_check']=_0x26f952,this['set']('prompt',''),this['set']('modelId',''),this['set']('modelDisplayMode','selector'),this['set']('activeModelName',null),this['_defaultValue']=_0x26f952['defaultModel']?_0x26f952['defaultModel']['id']:'',this['_defaultLabel']=_0x26f952['defaultModel']?_0x26f952['defaultModel']['name']:'',this['submitButtonView']=this['_createSubmitButtonView'](),this['cancelButtonView']=this['_createCancelButtonView'](),(this['promptInputView']=new Zt(this['locale'],()=>new ao(_0x32d82c)),this['promptInputView']['fieldView']['bind']('value')['to'](this,'prompt'),this['promptInputView']['fieldView']['on']('input',()=>{this['prompt']=this['promptInputView']['fieldView']['element']['value'];}),this['_modelSelectionDropdown']=this['_createModelSelectionDropdown'](),this['_modelSelectionDropdownItems']=new dt(),this['_modelNameView']=this['_createModelNameView'](),this['_setModelList'](_0x138886),zt(this['_modelSelectionDropdown'],this['_modelSelectionDropdownItems']),this['actionsFooterView']=this['_createActionsFooterView'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-custom-actions']},'children':[new _0x1b16f9(this['locale'],{'children':[this['promptInputView']]}),new _0x1b16f9(this['locale'],{'children':[this['actionsFooterView']]})]}),this['promptInputView']['fieldView']['keystrokes']['set']('Enter',(_0x1e7561,_0x511ebb)=>{this['_isValid']()?(this['fire']('runReviewCheck',{'id':'custom','args':{'prompt':this['prompt'],'model':this['modelId']},'isCustom':!0x0}),_0x511ebb()):_0x511ebb();}),this['focusCycler']=new Mt({'focusables':this['_focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes'],'actions':{'focusPrevious':'shift\x20+\x20tab','focusNext':'tab'}}));}['render'](){super['render'](),([this['promptInputView'],this['_modelSelectionDropdown'],this['cancelButtonView'],this['submitButtonView']]['forEach'](_0x372933=>{this['_focusables']['add'](_0x372933),this['focusTracker']['add'](_0x372933['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 _0xd22d42 of this['_getFormValidators']()){const _0x198f39=_0xd22d42();if(_0x198f39)return this['promptInputView']['errorText']=_0x198f39,!0x1;}return!0x0;}['_getFormValidators'](){return[()=>{if(0x0===this['promptInputView']['fieldView']['value']?.['trim']()['length'])return as(this['locale'],'AI_REVIEW_MODE_PROMPT_EMPTY_ERROR');}];}['_createSubmitButtonView'](){const _0x3accd9=new kt(this['locale']),t=this['locale']['t'];return _0x3accd9['set']({'label':t('Submit'),'withText':!0x0,'class':os}),_0x3accd9['on']('execute',()=>{this['_isValid']()&&this['fire']('runReviewCheck',{'id':'custom','args':{'prompt':this['prompt'],'model':this['modelId']},'isCustom':!0x0});}),_0x3accd9;}['_createCancelButtonView'](){const _0x6ee1e9=new kt(this['locale']),t=this['locale']['t'];return _0x6ee1e9['set']({'label':t('Cancel'),'withText':!0x0,'class':cs}),_0x6ee1e9['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x2574ad=>{_0x2574ad['stopPropagation']();})}}),_0x6ee1e9['on']('execute',()=>{this['resetToDefault'](),this['fire']('closeCustomCheck');}),_0x6ee1e9;}['_setModelList'](_0x4fd992){this['_modelSelectionDropdownItems']['clear']();const _0x269de1=this['_check']['models'];if(_0x4fd992)this['set']('modelDisplayMode','hidden');else{const _0x4c20ec=0x1===_0x269de1['length'];this['set']('modelDisplayMode',_0x4c20ec?'name':'selector');}if(this['resetToDefault'](),_0x269de1?.['length']){0x1===_0x269de1['length']&&this['set']('activeModelName',_0x269de1[0x0]['name']||_0x269de1[0x0]['id']);for(const _0x27fced of _0x269de1){const _0xe8ebdd=new jt({'label':_0x27fced['name'],'withText':!0x0,'role':'menuitemradio','id':_0x27fced['id'],'model':_0x27fced});_0xe8ebdd['bind']('isOn')['to'](this,'modelId',_0x5e011c=>_0x5e011c===_0x27fced['id']),this['_modelSelectionDropdownItems']['add']({'type':'button','model':_0xe8ebdd,'labelView':new co(this['locale'],_0x27fced)});}}}['_createModelSelectionDropdown'](){const _0x471006=Bt(this['locale']);return _0x471006['set']({'panelPosition':'se','class':'ck-ai_review__check-list-item-model-dropdown'}),_0x471006['buttonView']['set']({'label':this['_defaultLabel'],'withText':!0x0,'tooltip':!0x0,'class':cs}),_0x471006['buttonView']['bind']('isVisible')['to'](this,'modelDisplayMode',_0x5319d5=>'selector'===_0x5319d5),this['listenTo'](_0x471006,'execute',_0x2e2da0=>{this['modelId']=_0x2e2da0['source']['model']['id'],_0x471006['buttonView']['label']=_0x2e2da0['source']['label'];}),_0x471006;}['_createModelNameView'](){const _0x2905c1=new ho(this['locale']);return _0x2905c1['bind']('text')['to'](this,'activeModelName',_0x40820e=>_0x40820e??''),_0x2905c1['bind']('isVisible')['to'](this,'modelDisplayMode',_0xe6f0cb=>'name'===_0xe6f0cb),_0x2905c1;}['_createActionsFooterView'](){const _0x42fe25=new Nt(this['locale']);return _0x42fe25['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']]}]}),_0x42fe25;}}class ho extends Nt{constructor(_0x562dfb){super(_0x562dfb),this['set']('text',void 0x0),this['set']('isVisible',!0x0);const _0x1d5a69=this['bindTemplate'];this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai_review__check-list-item-model-name',_0x1d5a69['if']('isVisible','ck-hidden',_0x3173dd=>!_0x3173dd)]},'children':[{'text':_0x1d5a69['to']('text')}]});}}class co extends Ht{constructor(_0x4fa3f9,_0x377d39){super();const _0x3697a6=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-button__label'],'style':_0x3697a6['to']('style'),'id':_0x3697a6['to']('id')},'children':[{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-model-dropdown-name']},'children':[{'tag':'span','children':[{'text':_0x3697a6['to']('text')}]}]},{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-model-dropdown-description']},'children':[{'tag':'span','children':[_0x377d39['description']||'']}]}]});}}class lo extends Pt{['_formItemsCollection']=new _0x1898c2();['_customCheckView']=null;['_hideModels']=!0x1;constructor(_0x329a05,_0x20c016,_0x1876ce,_0x464562=!0x1){super(_0x329a05),this['_hideModels']=_0x464562,this['set']('isParametrizedViewOpen',!0x1),this['set']('isListItemRendered',!0x1),this['set']('isItemParametrized',_0x20c016['isParameterized']);const _0x2149e4=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',_0x4b53ce=>_0x4b53ce),this['bindTemplate']['if']('isListItemRendered','ck-ai_review__check-list-item_rendered',_0x14e6d7=>_0x14e6d7)],'style':{'--ck-ai-review-check-list-item-index':_0x1876ce}},'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':_0x20c016['title']}]},_0x2149e4]},{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-description']},'children':_0x20c016['description']?[{'text':_0x20c016['description']}]:[]}]}]},..._0x20c016['isParameterized']?[this['_createParameterizedView'](_0x20c016)]:[],...'custom'===_0x20c016['id']?[this['_createCustomView'](_0x20c016,this['_hideModels'])]:[]]}),this['on']('click',()=>{_0x20c016['isParameterized']?this['isParametrizedViewOpen']=!0x0:this['fire']('runReviewCheck',{'id':_0x20c016['id'],'args':_0x20c016['useArgs']?_0x20c016['args']:void 0x0});}),requestAnimationFrame(()=>{this['isListItemRendered']=!0x0;});}['render'](){super['render'](),this['isItemParametrized']&&Xt({'emitter':this,'activator':()=>!0x0===this['isParametrizedViewOpen'],'contextElements':[this['element']],'callback':()=>{this['isParametrizedViewOpen']=!0x1;}});}['resetToDefault'](){this['isParametrizedViewOpen']=!0x1,this['_formItemsCollection']['forEach'](_0x27b260=>{_0x27b260['resetToDefault']();}),this['_customCheckView']&&this['_customCheckView']['resetToDefault']();}['_createIconView'](){const _0x37555c=new yt();return _0x37555c['content']=rt,_0x37555c['extendTemplate']({'attributes':{'class':['ck-ai_review__check-list-item-title-icon']}}),_0x37555c;}['_createParameterizedView'](_0x4f4693){const _0x4964d5=new Nt(),_0x34b0e9=this['_createFormView'](_0x4f4693);return _0x4964d5['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-parameterized',this['bindTemplate']['if']('isParametrizedViewOpen','ck-hidden',_0x58db0c=>!_0x58db0c)]},'children':[_0x34b0e9]}),_0x4964d5;}['_createFormView'](_0x272d34){const _0x11cbdc=new Nt(),_0x576fbf=Array['isArray'](_0x272d34['options'])?_0x272d34['options']:[],_0x406c93=new kt(this['locale']),t=this['locale']['t'];_0x406c93['set']({'label':t('Submit'),'withText':!0x0,'class':os}),_0x406c93['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x258737=>{_0x258737['stopPropagation']();})}}),_0x406c93['on']('execute',()=>{const _0x5aac97=[],_0x4a1903={};this['_formItemsCollection']['forEach'](_0x1c96fa=>{_0x5aac97['push'](_0x1c96fa['value']),_0x272d34['useArgs']&&_0x272d34['options']&&(_0x4a1903[_0x1c96fa['argsKey']]=_0x1c96fa['value']);}),this['fire']('runReviewCheck',{'id':_0x272d34['id'],'params':_0x5aac97['length']?_0x5aac97:void 0x0,'args':Object['keys'](_0x4a1903)['length']?_0x4a1903:void 0x0});});const _0x1d93bd=_0x576fbf['length'];return _0x576fbf['forEach']((_0x28afd9,_0x26178d)=>{const _0x63ee6c=_0x26178d===_0x1d93bd-0x1;this['_formItemsCollection']['add'](new ro(this['locale'],_0x28afd9,_0x63ee6c?_0x406c93:null));}),_0x11cbdc['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-parameterized-form']},'children':this['_formItemsCollection']}),_0x11cbdc;}['_createCustomView'](_0x159752,_0x2a3f1e=!0x1){return this['_customCheckView']=new oo(this['locale'],_0x159752,_0x2a3f1e),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',_0xd315cb=>!_0xd315cb)]}}),this['_customCheckView']['delegate']('runReviewCheck')['to'](this),this['listenTo'](this['_customCheckView'],'closeCustomCheck',()=>{this['isParametrizedViewOpen']=!0x1;}),this['on']('change:isParametrizedViewOpen',(_0x1f2c9d,_0x171144,_0x2d90c5)=>{_0x2d90c5||this['_customCheckView']['resetFormValidationStatus']();}),this['_customCheckView'];}}class uo extends Pt{['_checkViews'];constructor(_0x311985){super(_0x311985),this['_checkViews']=new _0x1898c2(),this['_setupTemplate']();}['setChecks'](_0x9245ae,_0x2fc247=!0x1){this['_checkViews']['clear']();for(const [_0x15195d,_0x3a3269]of _0x9245ae['entries']()){const _0x28c3e5=new lo(this['locale'],_0x3a3269,_0x15195d,_0x2fc247);_0x28c3e5['delegate']('runReviewCheck')['to'](this),this['_checkViews']['add'](_0x28c3e5);}}['hasChecks'](){return this['_checkViews']['length']>0x0;}['resetAllParameterizedChecks'](){for(const _0x2fb1de of this['_checkViews'])_0x2fb1de instanceof lo&&_0x2fb1de['resetToDefault']();}['_setupTemplate'](){const _0x2bfd79=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list',_0x2bfd79['if']('isVisible','ck-hidden',_0x4cf7f7=>!_0x4cf7f7)]},'children':this['_checkViews']});}}class _o extends Ja{static get['pluginName'](){return'AIReviewModeUI';}['createMainView'](){const _0x39432a=this['context']['locale'],_0x5c046b=new _0x1d57fa(_0x39432a,{'label':as(_0x39432a,'AI_REVIEW_MODE'),'icon':_0x15e910,'class':'ck-ai-header\x20ck-ai-header_review'});return new to(this['context']['locale'],{'header':_0x5c046b,'list':new uo(_0x39432a),'results':new io(_0x39432a,{'generalErrorText':as(_0x39432a,'AI_REVIEW_MODE_GENERAL_ERROR_MESSAGE')}),'completed':new so(_0x39432a,{'headerText':as(_0x39432a,'AI_REVIEW_MODE_FINISH_REVIEW_HEADER_TITLE'),'emptyResultsText':as(_0x39432a,'AI_REVIEW_MODE_EMPTY_RESULTS_TEXT'),'buttonText':as(_0x39432a,'AI_REVIEW_MODE_FINISH_REVIEW_BUTTON_LABEL')})});}['registerTab'](){const _0x461522=this['context']['plugins']['get']('AITabs');_0x461522['view']['on']('activateTab',(_0x330674,_0x3804bd)=>{'reviewMode'===_0x3804bd?this['fire']('getReviewCheckList'):this['fire']('leaveReview');}),_0x461522['view']['addTab']({'id':'reviewMode','buttonLabel':as(this['context']['locale'],'AI_REVIEW_MODE'),'buttonIcon':_0x15e910,'order':0x0,'content':this['_mainView']});}}const Ao='review-';class go extends _0x1aa7e1{static get['requires'](){return[_0x4371ca,qs];}static get['pluginName'](){return'AIReviewCoreEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['_markers']=new Map();['_activeMarkers']=new Set();['_domEmitter'];['_eventEmitter'];constructor(_0xd0b8f4){super(_0xd0b8f4),this['_domEmitter']=new(Rt())(),this['_eventEmitter']=new(pt())();}get['emitter'](){return this['_eventEmitter'];}['afterInit'](){const _0x16b29d=Fs(this['context']);_0x16b29d['conversion']['for']('editingDowncast')['markerToElement']({'model':Ao+'insert','view':(_0x36aa5d,{writer:_0x1ab8dd})=>{const _0x23ba56=this['_markers']['get'](_0x36aa5d['markerName']),_0x284dd8={'class':'ck-ai_review-marker_add'+(this['_activeMarkers']['has'](_0x23ba56?.['id']||'')?'\x20ck-ai_review__change_active':''),'data-marker-id':_0x36aa5d['markerName']};return _0x1ab8dd['createUIElement']('span',_0x284dd8,function(_0x329335){const _0x180026=this['toDomElement'](_0x329335);return _0x180026['innerHTML']=_0x23ba56?.['content']?.['asString']||'',_0x180026;});}}),_0x16b29d['conversion']['for']('editingDowncast')['markerToHighlight']({'model':Ao+'remove-only','view':_0xe9d64f=>{const _0x13b793=this['_markers']['get'](_0xe9d64f['markerName']),_0x1d423b=['ck-ai_review-marker_strikethrough'];return this['_activeMarkers']['has'](_0x13b793?.['id']||'')&&_0x1d423b['push']('ck-ai_review__change_active'),{'classes':_0x1d423b,'attributes':{'data-marker-id':_0xe9d64f['markerName']}};}}),_0x16b29d['conversion']['for']('editingDowncast')['markerToHighlight']({'model':Ao+'remove-context','view':_0x53f872=>{const _0x3bfb21=this['_markers']['get'](_0x53f872['markerName']),_0x13e100=['ck-ai_review-marker_underline'];return this['_activeMarkers']['has'](_0x3bfb21?.['id']||'')&&_0x13e100['push']('ck-ai_review__change_active'),{'classes':_0x13e100,'attributes':{'data-marker-id':_0x53f872['markerName']}};}}),_0x16b29d['conversion']['for']('editingDowncast')['markerToHighlight']({'model':Ao+'remove-text','view':_0x5e7251=>{const _0x5f4cf2=this['_markers']['get'](_0x5e7251['markerName']),_0x44efaf=['ck-ai_review-marker_hide'];return this['_activeMarkers']['has'](_0x5f4cf2?.['id']||'')&&_0x44efaf['push']('ck-ai_review__change_active'),{'classes':_0x44efaf,'attributes':{'data-marker-id':_0x5e7251['markerName']}};}}),_0x16b29d['conversion']['for']('dataDowncast')['markerToElement']({'model':Ao+'suggestion-context','view':(_0x5fc424,{writer:_0x5d814a})=>_0x5d814a['createRawElement']('span',{'class':'ck-ai_review-marker_context-'+(_0x5fc424['isOpening']?'start':'end')})}),_0x16b29d['conversion']['for']('downcast')['attributeToAttribute']({'model':_0x224028,'view':_0xcc042d});const _0x16d01f=_0x16b29d['ui']['getEditableElement']()||document['body'];this['_domEmitter']['listenTo'](_0x16d01f,'mouseup',(_0x287d4d,_0x4aeec2)=>{const _0x369eab=_0x4aeec2['target'],_0x472bf3=this['_findMarkerElement'](_0x369eab);if(!_0x472bf3)return;const _0x2e0c6f=_0x472bf3['getAttribute']('data-marker-id'),_0xed782d=_0x2e0c6f['split'](':')['pop']()?.['split']('_')[0x0];this['_eventEmitter']['fire']('changeMarkerClicked',{'markerId':_0x2e0c6f,'changeId':_0xed782d,'markerElement':()=>this['_findMarkerElementById'](_0x2e0c6f),'domEvent':_0x4aeec2});},{'usePassive':!0x0,'priority':'highest'}),this['_domEmitter']['listenTo'](_0x16d01f,'mouseover',(_0x2864c9,_0x5586f7)=>{const _0x1f72c0=_0x5586f7['target'],_0x257d7a=_0x5586f7['relatedTarget'];let _0x4b7e58=this['_findMarkerElement'](_0x1f72c0);if(!_0x4b7e58&&_0x257d7a&&(_0x4b7e58=this['_findMarkerElement'](_0x257d7a)),!_0x4b7e58)return;const _0x82125a=_0x4b7e58['getAttribute']('data-marker-id'),_0x2bceba=_0x82125a['split'](':')['pop']()?.['split']('_')[0x0];this['_eventEmitter']['fire']('changeMarkerHovered',{'changeId':_0x2bceba,'markerElement':()=>this['_findMarkerElementById'](_0x82125a),'domEvent':_0x5586f7});}),this['_domEmitter']['listenTo'](document,'mouseover',_0x42fbf8((_0x5f3ab5,_0x55667f)=>{const _0x189583=_0x55667f['target'];if(this['_findMarkerElement'](_0x189583))return;_0x189583['closest']('.ck-reset.ck-ai_review-balloon-panel-suggestion')||this['_eventEmitter']['fire']('changeMarkerBlurred');},0xc8)),_0x16b29d['model']['document']['registerPostFixer'](_0x140044=>this['_validateMarkers'](_0x16b29d,_0x140044)),_0x16b29d['model']['document']['on']('change',()=>this['_handleMarkerChanges'](_0x16b29d));}['getDocumentData'](){const _0x18ee22=this['context']['plugins']['get']('AIEditing'),_0x57ff7b=Fs(this['context']),_0xd6a6ea=_0x57ff7b['model'],_0x558a9c=new _0xc0db40();for(const _0x5dc5e0 of _0xd6a6ea['document']['getRoot']()['getChildren']()){const _0x3badb7=_0x5dc5e0['_clone'](!0x0);_0x558a9c['_appendChild'](_0x3badb7);}for(const _0x4ca8e4 of _0xd6a6ea['markers'])_0x558a9c['markers']['set'](_0x4ca8e4['name'],this['_changeRangeOwnerDocument'](_0x4ca8e4['getRange']()['clone'](),_0x558a9c));const _0x11cd48=new _0x1f5467({'ignoreElementEnd':!0x0,'startPosition':_0xd6a6ea['createPositionAt'](_0x558a9c,0x0)}),_0x58da87=new Set(),_0x28dec8=new Map();for(const {item:_0x27c50f}of _0x11cd48){if(!_0x27c50f['is']('$textProxy'))continue;const _0x545270=_0x27c50f['parent'];if(_0x545270&&_0x545270['is']('element')){const _0xc349ea=this['_upsertDataId'](_0x545270,()=>_0x18ee22['_nextDataId'](_0x58da87));_0x58da87['add'](_0xc349ea);for(const _0x372b24 of _0x545270['getChildren']())_0x372b24['is']('element')&&_0x58da87['add'](this['_upsertDataId'](_0x372b24,()=>_0x18ee22['_nextDataId'](_0x58da87)));let _0x50d678=_0x545270;for(;_0x50d678['parent']&&!_0x50d678['parent']['is']('documentFragment');)_0x50d678=_0x50d678['parent'],_0x50d678['hasAttribute'](_0x224028)&&_0x50d678['_removeAttribute'](_0x224028);_0x28dec8['set'](_0xc349ea,{'path':_0x545270['getPath'](),'getContent':this['_createGetContentUsingDataIdFn'](_0x50d678['_clone'](!0x0),_0xc349ea,_0x57ff7b['data'])}),_0x11cd48['jumpTo'](_0xd6a6ea['createPositionAfter'](_0x545270));}}return{'content':_0x57ff7b['data']['processor']['toData'](_0x57ff7b['data']['toView'](_0x558a9c)),'version':_0x57ff7b['model']['document']['version'],'elements':_0x28dec8};}['diffContent'](_0x4baa0b,_0x2014cc,_0x978258=!0x1){const _0x565b65=[],_0x330e0f=Fs(this['context']),_0x25608e=_0x330e0f['data']['parse'](_0x2014cc,'$documentFragment'),_0x430d42=_0x330e0f['data']['parse'](_0x4baa0b,'$documentFragment'),_0x1713ab=_0x330e0f['model']['createPositionAt'](_0x430d42,0x0);if(this['_haveSingleTopLevelElement'](_0x25608e)){if(!this['_hasSameTopLevelElement'](_0x430d42,_0x25608e))return _0x565b65;}else{const _0x48668a=_0x330e0f['model']['schema'];if(!this['_haveOnlyInlineContent'](_0x430d42,_0x48668a)||!this['_haveOnlyInlineContent'](_0x25608e,_0x48668a))return _0x565b65;}const _0x120787=this['context']['plugins']['get']('DocumentCompare')['getDiff'](_0x4baa0b,_0x2014cc,{'anchor':_0x1713ab,'markDeletions':!0x0})['getOperations']()['filter'](_0x5ce0e1=>'insert'===_0x5ce0e1['type']||'marker'===_0x5ce0e1['type']&&_0x5ce0e1['name']['startsWith']('$markedRemove')),_0x2e94bd=this['_groupAdjacentOperations'](_0x120787),_0x5b8950=[];if(_0x978258){if(_0x2e94bd['length']){const _0x30b091=_0x2e94bd[0x0]['operations'][0x0],_0x15d2bf='insert'===_0x30b091['type']?_0x30b091['position']:_0x30b091['newRange']['start'],_0x2def96=this['_getPositionLimitingRange'](_0x15d2bf,_0x330e0f,'inside'),_0x31859d=_0x2def96?_0x25608e['getChild'](0x0)['getChildren']():_0x25608e['getChildren'](),_0x7855c0=_0x2def96||_0x330e0f['model']['createRangeIn'](_0x430d42),_0x48c1bf=[new _0x3155ee('$markedRemove:synthetic'+at(),null,_0x7855c0,_0x330e0f['model']['document']['model']['markers'],!0x0,_0x330e0f['model']['document']['version']+0x1),new _0x1a390c(_0x7855c0['end'],_0x31859d,_0x330e0f['model']['document']['version']+0x2)];_0x5b8950['push']({'operations':_0x48c1bf,'operationsIsolated':_0x48c1bf,'groupOffset':0x0});}}else _0x5b8950['push'](..._0x2e94bd);let _0x271d1d=0x0;return _0x330e0f['model']['change'](_0x3f1daa=>{for(let _0x2898f5=0x0;_0x2898f5<_0x5b8950['length'];_0x2898f5++){const _0x470632=_0x5b8950[_0x2898f5],_0x3ae9c5=_0x3f1daa['createDocumentFragment']();for(const _0xe4de18 of _0x430d42['getChildren']())_0x3f1daa['append'](_0xe4de18['_clone'](!0x0),_0x3ae9c5);for(const _0x199964 of _0x470632['operationsIsolated'])if('insert'===_0x199964['type']){const _0x1e6656=_0x199964;_0x1e6656['baseVersion']=null,_0x1e6656['isDocumentOperation']=!0x1,this['_changeOperationOwnerDocument'](_0x1e6656,_0x3ae9c5),_0x3f1daa['batch']['addOperation'](_0x199964),_0x330e0f['model']['applyOperation'](_0x199964);const _0x1383cf='suggestion:insertion:id:authorId:'+_0x271d1d++,_0xe79fb4=_0x330e0f['model']['createRange'](_0x1e6656['position'],_0x1e6656['position']['getShiftedBy'](_0x1e6656['howMany']));_0x3ae9c5['markers']['set'](_0x1383cf,_0xe79fb4);}else{if('marker'===_0x199964['type']&&_0x199964['name']['startsWith']('$markedRemove')){const _0x3a7789=_0x199964,_0x1b6461='suggestion:deletion:id:authorId:'+_0x271d1d++;this['_changeOperationOwnerDocument'](_0x3a7789,_0x3ae9c5),_0x3ae9c5['markers']['set'](_0x1b6461,_0x3a7789['newRange']);}}if(_0x978258)_0x565b65['push']({..._0x470632,'context':this['_createGetContentFn'](_0x430d42,_0x330e0f['data']),'content':this['_createGetContentFn'](_0x430d42,_0x330e0f['data'])});else{const _0x360279=this['_getChangeContext'](this['_changePositionOwnerDocument'](this['_getOperationStart'](_0x470632['operationsIsolated'][0x0]),_0x3ae9c5),this['_changePositionOwnerDocument'](this['_getOperationEnd'](_0x470632['operationsIsolated'][_0x470632['operationsIsolated']['length']-0x1]),_0x3ae9c5));_0x3ae9c5['markers']['set'](Ao+'suggestion-context',new _0x4ed42b(_0x360279['start'],_0x360279['end'])),_0x565b65['push']({..._0x470632,'context':this['_createGetContextFn'](_0x3ae9c5,_0x330e0f['data'],{'ellipsisBefore':_0x360279['hasContentBefore'],'ellipsisAfter':_0x360279['hasContentAfter']}),'content':this['_createGetContentFn'](_0x3ae9c5,_0x330e0f['data'])});}}}),_0x565b65;}['markChangePositionInEditorContent'](_0xa93c9d,_0x4a5191){if(!_0xa93c9d['length'])return;const _0x2ab2c1=_0xa93c9d[0x0]['parent']['id'],_0x2b84a3=_0x4a5191['elements']['get'](_0x2ab2c1);if(!_0x2b84a3)return void console['warn']('No\x20element\x20found\x20for\x20ID:\x20'+_0x2ab2c1);const _0x349bc5=_0x2b84a3['path'],_0x3b9360=Fs(this['context']),_0x1ec51c=_0x3b9360['model']['document']['history']['getOperations'](_0x4a5191['version']),_0x41daa5=[];for(const _0x4b82de of _0xa93c9d){const _0x48b702=_0x4b82de['operationsIsolated']['map'](_0x55d4f0=>this['_translateOperationToEditorContent'](_0x55d4f0,_0x349bc5,_0x3b9360['model']['document']['getRoots']()[0x0]));if(!_0x48b702||!_0x48b702['length'])continue;const _0x2e5682=_0x48b702['every'](_0x170090=>'marker'===_0x170090['type']&&_0x170090['name']['startsWith']('$markedRemove')),_0x4e4ee6={'document':_0x3b9360['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1},_0x2efd26=_0x1d1cb0(_0x48b702,_0x1ec51c,_0x4e4ee6)['operationsA'];for(const _0x5119b5 of _0x2efd26)if('insert'===_0x5119b5['type']){const _0x4e2c23=_0x5119b5,_0x352da6=_0x4e2c23['nodes'];_0x3b9360['model']['change'](_0x2a7f36=>{const _0x39b5f9=_0x2a7f36['createDocumentFragment']();for(const _0x5cb59a of _0x352da6)_0x2a7f36['append'](_0x5cb59a['_clone'](!0x0),_0x39b5f9);_0x41daa5['push']({'start':_0x4e2c23['position'],'end':_0x4e2c23['position'],'type':'insert','groupId':_0x4b82de['id'],'content':{'asString':this['_createGetContentFn'](_0x39b5f9,_0x3b9360['data'])(),'asFragment':_0x39b5f9}});});}else{if('marker'===_0x5119b5['type']&&_0x5119b5['name']['startsWith']('$markedRemove')){const _0x334f77=_0x5119b5;let _0x1164bb='remove-text';if(_0x2e5682){const _0x4f37f9=this['_findAdjacentContextDistance'](_0x334f77['newRange']['start'],'backward',_0x3b9360['model']['schema']),_0x25b8ae=this['_findAdjacentContextDistance'](_0x334f77['newRange']['end'],'forward',_0x3b9360['model']['schema']);if(_0x4f37f9||_0x25b8ae){const _0x454d72=_0x334f77['newRange']['start']['getShiftedBy'](-_0x4f37f9),_0x196ba9=_0x334f77['newRange']['end']['getShiftedBy'](_0x25b8ae);_0x41daa5['push']({'start':_0x454d72,'end':_0x196ba9,'groupId':_0x4b82de['id'],'type':'remove-context'});}else _0x1164bb='remove-only';}_0x41daa5['push']({'start':_0x334f77['newRange']['start'],'end':_0x334f77['newRange']['end'],'groupId':_0x4b82de['id'],'type':_0x1164bb});}}}this['_insertMarkers'](_0x41daa5);}['clearAllMarkers'](){const _0x2a4094=Fs(this['context']);_0x2a4094['model']['change'](_0x33fa58=>{for(const _0x210a92 of this['_markers']['keys']())_0x2a4094['model']['markers']['get'](_0x210a92)&&_0x33fa58['removeMarker'](_0x210a92);}),this['_markers']['clear'](),this['_activeMarkers']['clear']();}['switchToReadOnly'](){Fs(this['context'])['enableReadOnlyMode']('ai-review');}['switchToEdit'](){Fs(this['context'])['disableReadOnlyMode']('ai-review');}['applyChange'](_0x36cfae){const _0x57a91b=Fs(this['context']),_0x3b1dca=_0x57a91b['model'],_0x5d9449=_0x36cfae['map'](_0xa7920f=>this['_getMarkersDataForGroup'](_0xa7920f))['flat']();_0x3b1dca['change'](_0x4dc220=>{for(const _0x489c7b of _0x5d9449){const _0x39a28d=_0x57a91b['model']['markers']['get'](_0x489c7b['id']);if(_0x39a28d){if('insert'===_0x489c7b['type']){if(!_0x489c7b['content'])continue;_0x3b1dca['insertContent'](_0x489c7b['content']['asFragment']||null,_0x39a28d['getRange']()['start']);}else'remove-text'!==_0x489c7b['type']&&'remove-only'!==_0x489c7b['type']||_0x3b1dca['deleteContent'](_0x3b1dca['createSelection'](_0x39a28d['getRange']()));_0x4dc220['removeMarker'](_0x489c7b['id']),this['_markers']['delete'](_0x489c7b['id']);}}});}['rejectChange'](_0x1e8918){const _0x4734f3=Fs(this['context']),_0x302ffb=this['_getMarkersDataForGroup'](_0x1e8918);_0x4734f3['model']['change'](_0x2d9554=>{for(const _0x34212d of _0x302ffb)_0x2d9554['removeMarker'](_0x34212d['id']),this['_markers']['delete'](_0x34212d['id']);});}['getEditor'](){return Fs(this['context']);}['getMarkerElementForChange'](_0xd74577){const _0x14e69f=Array['from'](this['_markers']['values']())['filter'](_0x299795=>_0x299795['groupId']===_0xd74577);if(!_0x14e69f['length'])return null;const _0x5bfe95=0x1===_0x14e69f['length']?_0x14e69f[0x0]:this['_sortMarkers'](_0x14e69f)[0x0],_0x2f6320=Fs(this['context'])['model']['markers']['get'](_0x5bfe95['id']);if(!_0x2f6320)return null;return{'modelRange':_0x2f6320['getRange'](),'getElement':()=>this['_findMarkerElementById'](_0x5bfe95['id'])};}['getContentElementForChange'](_0x68f40b){const _0x5ed7f4=Array['from'](this['_markers']['values']())['filter'](_0x4323ab=>_0x4323ab['groupId']===_0x68f40b);if(!_0x5ed7f4['length'])return null;const _0x29d53d=0x1===_0x5ed7f4['length']?_0x5ed7f4[0x0]:this['_sortMarkers'](_0x5ed7f4)[0x0],_0x4703eb=Fs(this['context']),_0x32e5d9=_0x4703eb['model']['markers']['get'](_0x29d53d['id']);if(!_0x32e5d9)return null;const _0x34bfd9=_0x32e5d9['getRange'](),_0x316ebe=_0x4703eb['editing']['view']['getDomRoot']();if(!_0x316ebe||!_0x34bfd9)return null;let _0x2732fd=_0x34bfd9['start']['parent'];for(;_0x2732fd['parent']&&'$root'!==_0x2732fd['parent']['name'];)_0x2732fd=_0x2732fd['parent'];if(!_0x2732fd||!_0x2732fd['name'])return null;const _0x1f1bbb=_0x316ebe['querySelector']('[data-marker-id=\x22'+_0x29d53d['id']+'\x22]');if(!_0x1f1bbb)return null;let _0x2f5466=null;_0x4703eb['model']['change'](_0x2a3cdd=>{_0x2f5466=_0x2a3cdd['createDocumentFragment'](),_0x2a3cdd['append'](_0x2732fd['_clone'](!0x0),_0x2f5466);});const _0x1a7ba8=_0x4703eb['data']['toView'](_0x2f5466)['getChild'](0x0);return _0x1f1bbb['closest'](_0x1a7ba8['name']);}['reactivateMarkers'](_0x5cc1e1){const _0x1739ee=this['_getMarkersDataForGroup'](_0x5cc1e1);if(!_0x1739ee['length'])return;const _0x50d0dc=Array['from'](this['_activeMarkers'])['sort'](),_0x32439f=Array['from'](new Set(_0x1739ee['map'](_0x4989e7=>_0x4989e7['id'])))['sort']();_0x50d0dc['join']('|')!==_0x32439f['join']('|')&&(this['setAllMarkersAsInactive'](),this['setMarkersInElementAsActive'](_0x5cc1e1));}['setMarkersInElementAsActive'](_0x24d1d1){const _0x3ec0d9=this['_getMarkersDataForGroup'](_0x24d1d1);if(!_0x3ec0d9['length'])return;const _0x3f4827=Fs(this['context']),_0xc07fd=new Set(_0x3ec0d9['map'](_0x5800b2=>_0x5800b2['id'])),_0x375bad=Array['from'](_0xc07fd['values']())['map'](_0x29c0d5=>_0x3f4827['model']['markers']['get'](_0x29c0d5))['filter'](_0x38558b=>!!_0x38558b);_0xc07fd['forEach'](_0x10e828=>{this['_activeMarkers']['add'](_0x10e828);}),_0x3f4827['model']['change'](()=>{_0x375bad['forEach'](_0x5dfd0a=>{_0x3f4827['editing']['reconvertMarker'](_0x5dfd0a);});});}['setAllMarkersAsInactive'](){const _0x3d04e6=Array['from'](this['_activeMarkers']);if(!_0x3d04e6['length'])return;this['_activeMarkers']['clear']();const _0x5cb3ac=Fs(this['context']),_0x20931e=_0x3d04e6['map'](_0x1feb85=>_0x5cb3ac['model']['markers']['get'](_0x1feb85))['filter'](_0x2a7b6b=>!!_0x2a7b6b);_0x5cb3ac['model']['change'](()=>{_0x20931e['forEach'](_0x3be65e=>{_0x5cb3ac['editing']['reconvertMarker'](_0x3be65e);});});}['_getPositionLimitingRange'](_0x267af2,_0x24fb87,_0x19f5da='outside'){if(!_0x267af2)return null;let _0x38e593=_0x267af2['parent'];for(;_0x38e593&&_0x38e593['parent']&&'$root'!==_0x38e593['parent']['name']&&!_0x24fb87['model']['schema']['isLimit'](_0x38e593)&&!_0x24fb87['model']['schema']['isBlock'](_0x38e593);)_0x38e593=_0x38e593['parent'];if(!_0x38e593||!_0x38e593['name']||'$root'===_0x38e593['name'])return null;let _0x32b39d=null;return _0x24fb87['model']['change'](_0x5afeb6=>{_0x32b39d='inside'===_0x19f5da?_0x5afeb6['createRangeIn'](_0x38e593):_0x5afeb6['createRangeOn'](_0x38e593);}),_0x32b39d;}['_validateMarkers'](_0x1aaab2,_0x3f7809){const _0x3dff2f=Array['from'](this['_markers']['keys']()),_0x59bdab=new Map();for(const _0x4aaa1b of _0x3dff2f){const _0x3f040f=_0x1aaab2['model']['markers']['get'](_0x4aaa1b);if(!_0x3f040f)continue;const _0x2a9608=_0x3f040f['getStart']()['path'][0x0];_0x59bdab['has'](_0x2a9608)||_0x59bdab['set'](_0x2a9608,[]),_0x59bdab['get'](_0x2a9608)['push'](_0x3f040f);}const _0x5e46f7=new Set();for(const _0x309453 of _0x1aaab2['model']['document']['differ']['getChanges']()){let _0x18b2e1=-0x1,_0x4f0484=null;if('insert'===_0x309453['type'])_0x4f0484=new _0x4ed42b(_0x309453['position'],_0x309453['position']['getShiftedBy'](_0x309453['length'])),_0x18b2e1=_0x309453['position']['path'][0x0];else{if('remove'!==_0x309453['type'])continue;_0x4f0484=new _0x4ed42b(_0x309453['position']),_0x18b2e1=_0x309453['position']['path'][0x0];}const _0x2f4544=_0x59bdab['get'](_0x18b2e1)||[];if(_0x2f4544['length']){for(const _0x90f09d of _0x2f4544)if(_0x4f0484['root']['rootName']===_0x90f09d['getRange']()['root']['rootName']&&('insert'!==_0x309453['type']||!_0x4f0484['containsRange'](_0x90f09d['getRange']()))&&(_0x4f0484['isIntersecting'](_0x90f09d['getRange']())||_0x4f0484['start']['isTouching'](_0x90f09d['getRange']()['end'])||_0x4f0484['end']['isTouching'](_0x90f09d['getRange']()['start']))){const _0x45197f=this['_parseMarkerName'](_0x90f09d['name']);Array['from'](this['_markers']['values']())['filter'](_0xedd551=>_0xedd551['groupId']===_0x45197f['groupId'])['forEach'](_0x446ce0=>_0x5e46f7['add'](_0x446ce0['id']));}}}if(_0x5e46f7['size']){for(const _0x29baf4 of _0x5e46f7)_0x3f7809['removeMarker'](_0x29baf4);return!0x0;}return!0x1;}['_handleMarkerChanges'](_0x584f9a){for(const {name:_0x17d491,data:_0x243481}of _0x584f9a['model']['document']['differ']['getChangedMarkers']()){if(!_0x17d491['startsWith'](Ao))continue;const _0x5a17c1=_0x243481['oldRange'],_0x34eb58=_0x243481['newRange'],_0x15c359=_0x5a17c1&&'$graveyard'===_0x5a17c1['root']['rootName'],_0x11317f=_0x34eb58&&'$graveyard'===_0x34eb58['root']['rootName'];if(_0x15c359&&_0x11317f)continue;const _0x490100=this['_parseMarkerName'](_0x17d491);this['_markers']['get'](_0x17d491)&&(_0x11317f||!_0x34eb58?this['_eventEmitter']['fire']('changeMarkerRemoved',{'markerId':_0x17d491,'changeId':_0x490100['groupId']}):_0x15c359&&_0x34eb58&&this['_eventEmitter']['fire']('changeMarkerRestored',{'markerId':_0x17d491,'changeId':_0x490100['groupId']}));}}['_parseMarkerName'](_0x2b3da4){const _0x1ce058=_0x2b3da4['split'](':'),_0x1d27fe=(_0x1ce058[0x1]||'')['split']('_');return{'prefix':_0x1ce058[0x0],'groupId':_0x1d27fe[0x0],'suffix':_0x1d27fe[0x1]};}['_translateOperationToEditorContent'](_0x5d09e0,_0x40eca6,_0x365311){if('insert'===_0x5d09e0['type']){const _0x45b83a=_0x5d09e0;return new _0x1a390c(this['_changePosition'](_0x40eca6['concat'](_0x45b83a['position']['offset']),_0x365311),_0x45b83a['nodes'],_0x45b83a['baseVersion']);}if('marker'===_0x5d09e0['type']&&_0x5d09e0['name']['startsWith']('$markedRemove')){const _0x27fe6e=_0x5d09e0;return new _0x3155ee(_0x27fe6e['name'],_0x27fe6e['oldRange'],this['_changeRange'](_0x27fe6e['newRange'],_0x40eca6['concat'](_0x27fe6e['newRange']['start']['offset']),_0x40eca6['concat'](_0x27fe6e['newRange']['end']['offset']),_0x365311),_0x27fe6e['_markers'],_0x27fe6e['affectsData'],_0x27fe6e['baseVersion']);}return _0x5d09e0;}['_groupAdjacentOperations'](_0x593b8a){if(!_0x593b8a['length'])return[];const _0x1d136b=[];let _0x33f31c=0x0,_0xb21f9b=0x0,_0x2e5f85=[];for(let _0x4f1570=0x0;_0x4f1570<=_0x593b8a['length'];_0x4f1570++){const _0x5cc023=_0x593b8a[_0x4f1570],_0x56a1d8=_0x593b8a[_0x4f1570-0x1];!_0x5cc023||_0x56a1d8&&!this['_getOperationEnd'](_0x56a1d8)['isTouching'](this['_getOperationStart'](_0x5cc023))?(_0x1d136b['push']({'operations':_0x2e5f85,'operationsIsolated':_0x2e5f85['map'](_0x145001=>this['_shiftOperation'](_0x145001['clone'](),-_0xb21f9b)),'groupOffset':_0x33f31c}),_0x2e5f85=_0x5cc023?[_0x5cc023]:[],_0xb21f9b+=_0x33f31c,_0x33f31c=0x0):_0x2e5f85['push'](_0x5cc023),_0x5cc023&&'insert'===_0x5cc023['type']&&(_0x33f31c+=_0x5cc023['howMany']);}return _0x1d136b;}['_findAdjacentContextDistance'](_0x45374e,_0x11eb48,_0x19b431,_0x15f278=0x1){const _0x410586=new _0x1f5467({'startPosition':_0x45374e,'direction':_0x11eb48});let _0x2d392e=0x0;for(let _0x232d58=0x0;_0x232d58<_0x15f278;_0x232d58++){let _0x1a48a4=0x0,_0x184f6c=!0x1,_0x4a28f9='forward'===_0x11eb48?/^\W*\w+/:/\w+\W*$/;for(const {item:_0x55c638}of _0x410586)if(_0x55c638['is']('$textProxy')){const _0x27eb97=_0x4a28f9['exec'](_0x55c638['data']);if(_0x27eb97&&_0x27eb97['length']){if(_0x1a48a4+='forward'===_0x11eb48?_0x27eb97['index']+_0x27eb97[0x0]['length']:_0x55c638['data']['length']-_0x27eb97['index'],_0x27eb97[0x0]['length']!==_0x55c638['data']['length'])break;_0x184f6c=!0x0,_0x4a28f9='forward'===_0x11eb48?/^\w+/:/\w+$/;}else{if(_0x184f6c)break;_0x1a48a4+=_0x55c638['offsetSize'];}}else{if(_0x55c638['is']('element')){_0x19b431['isInline'](_0x55c638)&&!_0x184f6c&&(_0x1a48a4+=0x1);break;}}_0x2d392e+=_0x1a48a4,_0x410586['jumpTo'](_0x45374e['getShiftedBy']('forward'===_0x11eb48?_0x2d392e:-_0x2d392e));}return _0x2d392e;}['_getChangeContext'](_0x2fbc25,_0x4af550){const _0xb77c57=Fs(this['context'])['model']['schema'],_0x165848=this['_findAdjacentContextDistance'](_0x2fbc25,'backward',_0xb77c57,0x6),_0x28f8aa=this['_findAdjacentContextDistance'](_0x4af550,'forward',_0xb77c57,0x6),_0x22269e=_0x2fbc25['getShiftedBy'](-_0x165848),_0x2c40fe=_0x4af550['getShiftedBy'](_0x28f8aa);return{'start':_0x22269e,'end':_0x2c40fe,'hasContentBefore':!_0x22269e['isAtStart'],'hasContentAfter':!_0x2c40fe['isAtEnd']};}['_insertMarkers'](_0x266ab4){const _0x3b0a6a=this['context']['plugins']['get']('AIEditing'),_0x3e53ba=new Set();Fs(this['context'])['model']['change'](_0x422e7e=>{for(const _0x1180c3 of _0x266ab4){const _0x264fe3=''+Ao+_0x1180c3['type']+':'+_0x1180c3['groupId']+'_'+_0x3b0a6a['_nextDataId'](_0x3e53ba);this['_markers']['set'](_0x264fe3,{'id':_0x264fe3,'groupId':_0x1180c3['groupId'],'type':_0x1180c3['type'],'content':_0x1180c3['content']}),_0x422e7e['addMarker'](_0x264fe3,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x422e7e['createRange'](_0x1180c3['start'],_0x1180c3['end'])});}});}['_createGetContextFn'](_0x4e7d80,_0x2d33a6,_0xc286a1){let _0x514c0c='';return()=>{if(!_0x514c0c){const _0x577314=_0x2d33a6['toView'](_0x4e7d80,{'showSuggestionHighlights':!0x0});let _0x5d91f3=_0x577314['getChild'](0x0);if(_0x5d91f3['is']('containerElement')||(_0x5d91f3=_0x577314),!_0x5d91f3)return'';let _0xf69055=!0x1;const _0x59c96f=[];for(const _0x240492 of _0x5d91f3['getChildren']())_0x240492['is']('element','span')&&_0x240492['hasClass']('ck-ai_review-marker_context-end')&&(_0xf69055=!0x1),_0xf69055&&_0x59c96f['push'](_0x240492),_0x240492['is']('element','span')&&_0x240492['hasClass']('ck-ai_review-marker_context-start')&&(_0xf69055=!0x0);_0x5d91f3['_removeChildren'](0x0,_0x5d91f3['childCount']),_0xc286a1?.['ellipsisBefore']&&_0x5d91f3['_appendChild']('…'),_0x5d91f3['_appendChild'](_0x59c96f),_0xc286a1?.['ellipsisAfter']&&_0x5d91f3['_appendChild']('…');const _0x14fe24=_0x2d33a6['htmlProcessor']['domConverter']['viewToDom'](_0x577314),_0x587098=_0x2d33a6['htmlProcessor']['htmlWriter']['getHtml'](_0x14fe24);_0x514c0c=_0x587098;}return _0x514c0c;};}['_createGetContentFn'](_0x2f8020,_0x5b21bb){let _0x1c162d='';return()=>(_0x1c162d||(_0x1c162d=_0x5b21bb['stringify'](_0x2f8020,{'showSuggestionHighlights':!0x0})),_0x1c162d);}['_createGetContentUsingDataIdFn'](_0x215740,_0x51ae6a,_0x1acca4){let _0xde65b3='';return()=>{if(!_0xde65b3){const _0x247ca2=_0x1acca4['toView'](new _0xc0db40(_0x215740)),_0x33b859=_0x1acca4['htmlProcessor']['domConverter']['viewToDom'](_0x247ca2)['querySelector']('[data-id=\x22'+_0x51ae6a+'\x22]');_0xde65b3=_0x33b859?.['outerHTML']||'';}return _0xde65b3;};}['_findMarkerElement'](_0x2d6b9d,_0x19ca1a=0x5){let _0x46d8f6=_0x2d6b9d,_0x596956=null;for(let _0x3789bd=0x0;_0x3789bd<_0x19ca1a&&_0x46d8f6;_0x3789bd++){if(!_0x46d8f6['className']){_0x46d8f6=_0x46d8f6['parentElement'];continue;}if(!(''+_0x46d8f6['className'])['includes']('ck-ai_review-marker_')){_0x46d8f6=_0x46d8f6['parentElement'];continue;}if(!_0x46d8f6['getAttribute']('data-marker-id'))break;_0x596956=_0x46d8f6;break;}return _0x596956;}['_findMarkerElementById'](_0x76e81a){const _0x2c34b9=Fs(this['context']),_0x4bed72=_0x2c34b9['model']['markers']['get'](_0x76e81a);return _0x4bed72?_0x2df0af(_0x2c34b9['editing'],_0x4bed72):null;}['_getMarkersDataForGroup'](_0x244998){return Array['from'](this['_markers']['values']())['filter'](_0x5a0458=>_0x5a0458['groupId']===_0x244998);}['_getOperationStart'](_0x31f3ad){return'insert'===_0x31f3ad['type']?_0x31f3ad['position']:_0x31f3ad['newRange']['start'];}['_getOperationEnd'](_0x101bf7,_0x2a8b22=!0x1){return'insert'===_0x101bf7['type']?_0x2a8b22?_0x101bf7['position']:_0x101bf7['position']['getShiftedBy'](_0x101bf7['howMany']):_0x101bf7['newRange']['end'];}['_shiftOperation'](_0x2b0883,_0x324c50){return'insert'===_0x2b0883['type']?_0x2b0883['position']=_0x2b0883['position']['getShiftedBy'](_0x324c50):'marker'===_0x2b0883['type']&&_0x2b0883['newRange']&&(_0x2b0883['newRange']=new _0x4ed42b(_0x2b0883['newRange']['start']['getShiftedBy'](_0x324c50),_0x2b0883['newRange']['end']['getShiftedBy'](_0x324c50))),_0x2b0883;}['_changeOperationOwnerDocument'](_0x40264a,_0x5735de){'insert'===_0x40264a['type']?_0x40264a['position']=this['_changePositionOwnerDocument'](_0x40264a['position'],_0x5735de):'marker'===_0x40264a['type']&&_0x40264a['newRange']&&(_0x40264a['newRange']=this['_changeRangeOwnerDocument'](_0x40264a['newRange'],_0x5735de));}['_changePositionOwnerDocument'](_0x1b64cc,_0x19205c){return new _0x17bb06(_0x19205c,_0x1b64cc['path']);}['_changeRangeOwnerDocument'](_0x2723e8,_0x5592d5){return new _0x4ed42b(this['_changePositionOwnerDocument'](_0x2723e8['start'],_0x5592d5),this['_changePositionOwnerDocument'](_0x2723e8['end'],_0x5592d5));}['_changePosition'](_0x1d4d69,_0x5ab512){return new _0x17bb06(_0x5ab512,[..._0x1d4d69]);}['_changeRange'](_0x12c664,_0xe859cf,_0x4b8887,_0x125eb6){return new _0x4ed42b(this['_changePosition'](_0xe859cf,_0x125eb6),this['_changePosition'](_0x4b8887,_0x125eb6));}['_sortMarkers'](_0x289dc8){const _0x58dcd6=_0x2c715a=>{switch(_0x2c715a){case'insert':return 0x0;case'remove-context':return 0x1;case'remove-only':return 0x2;case'remove-text':return 0x3;}};return _0x289dc8['sort']((_0x4ba336,_0x5702c0)=>_0x58dcd6(_0x4ba336['type'])-_0x58dcd6(_0x5702c0['type']));}['_hasSameTopLevelElement'](_0x41a298,_0x4349ca){const _0x17f510=_0x41a298['getChild'](0x0),_0x200b5b=_0x4349ca['getChild'](0x0);return!(!_0x17f510||!_0x200b5b)&&((!_0x17f510['is']('element')||!_0x200b5b['is']('element')||_0x17f510['name']===_0x200b5b['name'])&&!(_0x17f510['is']('element')&&!_0x200b5b['is']('element')||!_0x17f510['is']('element')&&_0x200b5b['is']('element')));}['_haveSingleTopLevelElement'](_0x3712c0){return 0x1===_0x3712c0['childCount'];}['_haveOnlyInlineContent'](_0x134117,_0x5b20f1){for(const _0x10f4c0 of _0x134117['getChildren']())if(_0x10f4c0['is']('element')&&!_0x5b20f1['isInline'](_0x10f4c0))return!0x1;return!0x0;}['_upsertDataId'](_0x187080,_0x30fce4){let _0x176b9d=_0x187080['getAttribute'](_0x224028);return _0x176b9d||(_0x176b9d=_0x30fce4(),_0x187080['_setAttribute'](_0x224028,_0x176b9d)),_0x176b9d;}}class Io extends pt(){['id'];['contentNew'];['contentInitial'];['documentVersion'];constructor({id:_0x7cd7ff,contentNew:_0x2ef812,contentInitial:_0x10ffa9,documentVersion:_0x49aeb8}){super(),this['id']=_0x7cd7ff,this['contentNew']=_0x2ef812,this['contentInitial']=_0x10ffa9,this['documentVersion']=_0x49aeb8;}}class Eo extends ht(){['id'];['parent'];['_data'];['_editorOperations']=[];constructor(_0x452602,_0xd3ce91,_0x565e19){super(),this['id']=_0x452602,this['parent']=_0x565e19,this['_data']=_0xd3ce91,this['set']('isActivated',!0x1),this['set']('isRated',!0x1),this['set']('status','pending'),this['on']('change:status',()=>{'pending'!==this['status']&&this['isActivated']&&(this['isActivated']=!0x1);});}get['contentDiffed'](){return this['_data']['context']();}get['operations'](){return this['_data']['operations'];}get['operationsIsolated'](){return this['_data']['operationsIsolated'];}}class To extends ht(){['id']=at();['callId'];['_results']=new Map();['_changes']=[];['_sourceCheck'];['_documentData'];['_aiConnector'];['_reviewParams'];['_reviewArgs'];['_activeRequest']=null;['_currentError'];['_wasAborted']=!0x1;constructor(_0x296055,_0x424d24,_0xadc8fa,_0x18aa86,_0xdf7172){super(),this['_sourceCheck']=_0x424d24,this['_documentData']=_0x296055,this['_aiConnector']=_0xadc8fa,this['_reviewParams']=_0x18aa86,this['_reviewArgs']=_0xdf7172,this['on']('change:status',(_0x26cc31,_0x4b0354,_0x4c9efb)=>{'aborted'==_0x4c9efb&&(this['_wasAborted']=!0x0),this['fire']('reviewCheckRunUpdated',{'status':_0x4c9efb,'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'](_0x4e4333=>'pending'===_0x4e4333['status']);}get['currentError'](){return this['_currentError'];}['updateDocumentData'](_0x1725cb){this['_documentData']=_0x1725cb;}async['start'](){this['status']='loading',this['_currentError']=void 0x0;try{this['_activeRequest']=this['_createApiRequest']();const _0x23ba68=await this['_activeRequest']['getStream']();this['status']='data';for await(const _0x29d794 of _0x23ba68)'unmodified'!==_0x29d794['data']['operation']&&('error'!==_0x29d794['data']['operation']?'review-metadata'!==_0x29d794['event']?this['_addReviewCheckResult'](_0x29d794['data']['dataId'],_0x29d794['data']['textDelta']):this['callId']=_0x29d794['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(_0x1beb05){this['_currentError']=_0x1beb05,_0x1beb05 instanceof Error&&_0x1beb05['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'](_0x229c23,_0x245f29){const _0x100b6b=this['_results']['get'](_0x229c23);if(!_0x100b6b)return;if(0x0===_0x245f29['length'])return;const _0x568e3c=[];_0x245f29['forEach']((_0x39875f,_0xf3f664)=>{const _0x135472=new Eo(_0x100b6b['id']+'-'+_0xf3f664,_0x39875f,_0x100b6b);_0x135472['on']('change:status',()=>{this['fire']('reviewCheckResultChangeStatusUpdated',{'change':_0x135472,'status':_0x135472['status']});}),_0x135472['on']('change:isActivated',()=>{_0x135472['isActivated']?this['fire']('reviewCheckResultActivated',{'change':_0x135472}):this['fire']('reviewCheckResultDeactivated',{'change':_0x135472});}),this['_changes']['push'](_0x135472),_0x568e3c['push'](_0x135472);}),this['fire']('reviewCheckResultReady',{'changes':_0x568e3c,'result':_0x100b6b,'source':this});}['abort'](){this['_activeRequest']&&(this['_activeRequest']['abortController']['abort'](),this['_activeRequest']=null,this['status']='aborted');}['isChangeActive'](_0x37db24){const _0x389367=this['_changes']['find'](_0x31ac3b=>_0x31ac3b['id']===_0x37db24);return!(!_0x389367||'pending'!==_0x389367['status']);}['isAnyChangeActivated'](){return this['_changes']['some'](_0x3c2c92=>!0x0===_0x3c2c92['isActivated']);}['getActiveChanges'](){return this['_changes']['filter'](_0x153e07=>'pending'===_0x153e07['status']);}['getChangeById'](_0x3642d0){return this['_changes']['find'](_0x580de7=>_0x580de7['id']===_0x3642d0);}['markAllChangesAsAccepted'](){for(const _0x299581 of this['_changes'])'pending'===_0x299581['status']&&(_0x299581['status']='accepted');this['_checkIfFinished']();}['markChangeAsAccepted'](_0x174f60){const _0x19635a=this['_changes']['find'](_0x38cfe1=>_0x38cfe1['id']===_0x174f60);_0x19635a&&'pending'===_0x19635a['status']&&(_0x19635a['status']='accepted'),this['_checkIfFinished']();}['markChangeAsRejected'](_0x1ea54a){const _0x4f7bd2=this['_changes']['find'](_0x4152c0=>_0x4152c0['id']===_0x1ea54a);_0x4f7bd2&&'pending'===_0x4f7bd2['status']&&(_0x4f7bd2['status']='rejected'),this['_checkIfFinished']();}['markChangeAsOutdated'](_0xa885f7){const _0x4afd3b=this['_changes']['find'](_0x18a025=>_0x18a025['id']===_0xa885f7);_0x4afd3b&&'pending'===_0x4afd3b['status']&&(_0x4afd3b['status']='outdated'),this['_checkIfFinished']();}['markChangeAsPending'](_0x2001a6){const _0x53ec50=this['_changes']['find'](_0x44e94b=>_0x44e94b['id']===_0x2001a6);_0x53ec50&&'outdated'===_0x53ec50['status']&&(_0x53ec50['status']='pending'),this['_checkIfFinished']();}['activateChange'](_0x3fbd10){this['_changes']['filter'](_0x19ba5e=>_0x19ba5e['isActivated']&&_0x19ba5e['id']!==_0x3fbd10)['forEach'](_0x17a486=>{_0x17a486['isActivated']=!0x1;});const _0x1bd96c=this['_changes']['find'](_0x122e7b=>_0x122e7b['id']===_0x3fbd10);_0x1bd96c&&'pending'===_0x1bd96c['status']&&(_0x1bd96c['isActivated']=!0x0);}['deactivateChange'](){this['_changes']['filter'](_0x149842=>_0x149842['isActivated'])['forEach'](_0x4ac448=>{_0x4ac448['isActivated']=!0x1;});}['forceReadyState'](){this['status']='ready';}async['sendRating'](_0xff51d0){if('initialized'===this['status']||'loading'===this['status']||'data'===this['status']||this['_wasAborted'])return;if(!this['callId']||0x0===this['_changes']['length'])return;let _0x57fceb;if(_0xff51d0){const _0x1c4529=this['_changes']['find'](_0x310023=>_0x310023['id']===_0xff51d0);if(_0x1c4529&&_0x1c4529['isRated'])return;_0x1c4529&&(_0x57fceb=_0x1c4529['parent']['id'],_0x1c4529['isRated']=!0x0);}const _0x4e0150={'positiveCount':this['_changes']['filter'](_0x1933de=>'accepted'===_0x1933de['status'])['length'],'totalCount':this['_changes']['length']};this['_sendRatingRequest'](_0x4e0150,this['callId'],_0x57fceb);}['_addReviewCheckResult'](_0x221b7c,_0x4beedf){const _0x27b868=this['_documentData']['elements']['get'](_0x221b7c);if(!_0x27b868)return;const _0x4c3836=_0x27b868['getContent']();if(_0x4c3836===_0x4beedf)return;const _0x112779=new Io({'id':_0x221b7c,'contentInitial':_0x4c3836,'contentNew':_0x4beedf,'documentVersion':this['_documentData']['version']});this['_results']['set'](_0x112779['id'],_0x112779),this['fire']('reviewCheckResultAdded',{'result':_0x112779,'source':this});}['_checkIfFinished'](){'finished'===this['status']&&(this['_changes']['filter'](_0x135f9e=>'pending'===_0x135f9e['status'])['length']>0x0&&(this['status']='ready')),'ready'===this['status']&&(0x0===this['_changes']['filter'](_0x42e70f=>'pending'===_0x42e70f['status'])['length']&&(this['status']='finished'));}}class po extends To{get['subTitle'](){if(!this['_reviewParams']||0x0===this['_reviewParams']['length'])return'';const _0x257fb7=[];if(this['_reviewParams']['length']>0x0&&this['_sourceCheck']['options'])for(let _0x3edac8=0x0;_0x3edac8<this['_reviewParams']['length'];_0x3edac8++){if(!this['_reviewParams'][_0x3edac8]||!this['_sourceCheck']['options'][_0x3edac8])continue;const _0x2d3243=this['_sourceCheck']['options'][_0x3edac8],_0x4549c7=_0x2d3243['data']?.['find'](_0x2191eb=>_0x2191eb['id']===this['_reviewParams'][_0x3edac8]);_0x4549c7&&_0x257fb7['push'](_0x4549c7['label']);}return _0x257fb7['join'](',\x20');}get['reviewName'](){return this['_composeReviewName']();}['_createApiRequest'](){return this['_aiConnector']['callSystemReview']({'reviewName':this['_composeReviewName'](),'content':this['_documentData']['content'],'args':this['_reviewArgs']});}['_sendRatingRequest'](_0x3f9f38,_0x2658ea,_0x4bef2b){return this['_aiConnector']['upsertAIReviewRating'](this['reviewName'],_0x2658ea,_0x3f9f38,_0x4bef2b);}['_composeReviewName'](){return!this['_reviewParams']||0x0===this['_reviewParams']['length']||this['_sourceCheck']['useArgs']?this['_sourceCheck']['apiId']:[this['_sourceCheck']['apiId'],...this['_reviewParams']]['join']('-');}}class mo extends _0x1aa7e1{['_aiConnector'];['_aiReviewCoreUi'];['_aiReviewCoreEditing'];['_aiReviewCheckList'];['_currentReviewCheckRun'];['_changeActivationSource']=null;static get['requires'](){return[rs];}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}async['init'](){this['_initRequiredPlugins'](),this['_aiReviewCheckList']=await this['_getChecksList'](),this['listenTo'](this['_aiReviewCoreUi'],'getReviewCheckList',()=>{this['_aiReviewCoreUi']['setAvailableChecks'](this['_aiReviewCheckList']['checks']);}),this['listenTo'](this['_aiReviewCoreUi'],'runReviewCheck',async(_0x5f2fe0,_0x2630ff)=>{const _0x3687d1=this['_aiReviewCheckList']['getCheckById'](_0x2630ff['id']);if(_0x3687d1){this['_onReviewCheckRun'](_0x2630ff),this['_aiReviewCoreEditing']['switchToReadOnly'](),this['_currentReviewCheckRun']=this['_createReviewCheckRun'](_0x2630ff,_0x3687d1),this['_aiReviewCoreUi']['setCheckResultTitle'](this['_currentReviewCheckRun']['title'],this['_currentReviewCheckRun']['subTitle']),this['_currentReviewCheckRun']['on']('reviewCheckRunUpdated',(_0xec68dd,_0x400c11)=>{switch(_0x400c11['status']){case'data':case'loading':this['_aiReviewCoreUi']['showCheckRunResults'](_0x400c11);break;case'finished':this['_onCheckRunFinished']();break;case'ready':this['_aiReviewCoreUi']['showActionsWhenResultIsReady']();break;case'unmodified':this['_aiReviewCoreUi']['showNoChangesView']();break;case'error-general':this['_aiReviewCoreUi']['showGeneralResultsErrorView'](),this['_logError'](new ot('ai-review-mode-check-run-general-error',this,void 0x0,this['_currentReviewCheckRun']?.['currentError']));break;case'error-chunk':this['_aiReviewCoreUi']['showChunkErrorView'](),this['_logError'](new ot('ai-review-mode-check-run-chunk-error',this,void 0x0,this['_currentReviewCheckRun']?.['currentError']));break;case'aborted':this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['processedResultsCount']>0x0?setTimeout(()=>{this['_currentReviewCheckRun']?.['forceReadyState']();},0x0):this['_onReviewRunLeave'](!0x0);}'ready'!==_0x400c11['status']&&'error-chunk'!==_0x400c11['status']&&'error-general'!==_0x400c11['status']||this['_currentReviewCheckRun']?.['sendRating']();}),this['_currentReviewCheckRun']['on']('reviewCheckResultAdded',(_0xf5a753,_0x1ea9c4)=>{if(!this['_currentReviewCheckRun'])throw new ot('ai-review-mode-no-current-check-run',this);const _0x1b89c4=this['_diffContent'](_0x1ea9c4['result']['contentInitial'],_0x1ea9c4['result']['contentNew']);_0x1ea9c4['source']['addResultChanges'](_0x1ea9c4['result']['id'],_0x1b89c4);}),this['_currentReviewCheckRun']['on']('reviewCheckResultReady',(_0x9e4e9d,_0x56f77d)=>{for(const _0x4ba252 of _0x56f77d['changes'])this['_aiReviewCoreUi']['showCheckRunResult'](_0x4ba252);this['_markChangePositionInEditorContent'](_0x56f77d['changes'],_0x56f77d['source']['documentData']);}),this['_currentReviewCheckRun']['on']('reviewCheckResultChangeStatusUpdated',(_0x4ac3e1,_0x1a87f9)=>{this['_aiReviewCoreUi']['updateChangeState'](_0x1a87f9['change']['id'],_0x1a87f9['status']);}),this['_currentReviewCheckRun']['on']('reviewCheckResultActivated',(_0x38e88a,_0x1a9275)=>{this['_onReviewCheckResultActivated'](_0x1a9275);}),this['_currentReviewCheckRun']['on']('reviewCheckResultDeactivated',()=>{this['_onReviewCheckResultDeactivated']();});try{await this['_currentReviewCheckRun']['start']();}catch(_0x5dbd79){_0x5dbd79 instanceof Error&&_0x5dbd79['message']['includes']('ai-request-aborted')||(_0x5dbd79 instanceof ot?this['_logError'](_0x5dbd79):this['_logError'](new ot('ai-review-mode-check-run-failed',this,void 0x0,_0x5dbd79)));}}else this['_logError'](new ot('ai-review-mode-source-check-not-found',this,{'checkId':_0x2630ff['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 _0x475320=this['_currentReviewCheckRun']['getActiveChanges']();if(!_0x475320['length'])return;this['_aiReviewCoreEditing']['applyChange'](_0x475320['map'](_0x4745a2=>_0x4745a2['id']));const _0x54fb1d=this['_currentReviewCheckRun'];_0x54fb1d['markAllChangesAsAccepted'](),_0x54fb1d['sendRating']();}),this['listenTo'](this['_aiReviewCoreUi'],'acceptChange',(_0x4305de,_0x41affa)=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['isChangeActive'](_0x41affa['id'])&&(this['_aiReviewCoreEditing']['applyChange']([_0x41affa['id']]),this['_currentReviewCheckRun']['markChangeAsAccepted'](_0x41affa['id']),this['_aiReviewCoreUi']['hideChangeBalloon'](),this['_currentReviewCheckRun']['sendRating'](_0x41affa['id']));}),this['listenTo'](this['_aiReviewCoreUi'],'dismissChange',(_0x495bda,_0xcff5c6)=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['isChangeActive'](_0xcff5c6['id'])&&(this['_aiReviewCoreEditing']['rejectChange'](_0xcff5c6['id']),this['_currentReviewCheckRun']['markChangeAsRejected'](_0xcff5c6['id']),this['_aiReviewCoreUi']['hideChangeBalloon'](),this['_currentReviewCheckRun']['sendRating'](_0xcff5c6['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',(_0x452872,_0x10a25b)=>{this['_onActivateChange'](_0x10a25b);}),this['listenTo'](this['_aiReviewCoreUi'],'deactivateChange',(_0x4c2071,_0x1e0cad)=>{this['_onDeactivateChange'](_0x1e0cad);}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerClicked',(_0x28177b,_0x3074e6)=>{this['_onChangeMarkerClicked'](_0x28177b,_0x3074e6);}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerHovered',(_0x556758,_0x522bf8)=>{this['_onChangeMarkerHovered'](_0x556758,_0x522bf8);}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerBlurred',()=>{this['_onChangeMarkerBlurred']();}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerRemoved',(_0x3fa424,_0xdd1fb4)=>{this['_onChangeMarkerRemoved'](_0x3fa424,_0xdd1fb4);}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerRestored',(_0x454399,_0x28ea86)=>{this['_onChangeMarkerRestored'](_0x454399,_0x28ea86);});}['_createReviewCheckRun'](_0x550da3,_0x4bf92b){return new po(this['_aiReviewCoreEditing']['getDocumentData'](),_0x4bf92b,this['_aiConnector'],_0x550da3['params'],_0x550da3['args']);}['_onChangeMarkerRemoved'](_0x2aa857,_0x39ed1e){this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['markChangeAsOutdated'](_0x39ed1e['changeId']);}['_onChangeMarkerRestored'](_0x1707fb,_0x2cb670){this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['markChangeAsPending'](_0x2cb670['changeId']);}['_onCheckRunFinished'](){this['_aiReviewCoreUi']['showReviewCompletedView']();}['_initRequiredPlugins'](){this['_aiConnector']=this['context']['plugins']['get']('AIConnector');}['_onReviewRunLeave'](_0x5acbc6=!0x1){this['_currentReviewCheckRun']&&(this['_currentReviewCheckRun']['hasModifications']||this['_currentReviewCheckRun']['sendRating'](),this['_currentReviewCheckRun']['stopListening'](),this['_currentReviewCheckRun']['abort'](),this['_currentReviewCheckRun']=void 0x0),_0x5acbc6&&this['_aiReviewCoreUi']['showReviewCheckList'](),this['_aiReviewCoreEditing']['clearAllMarkers'](),this['_aiReviewCoreEditing']['switchToEdit'](),this['_changeActivationSource']=null;const _0x4aaaa8=this['_aiReviewCoreEditing']['getEditor']();_0x4aaaa8&&_0x4aaaa8['editing']['view']['change'](_0x2d472e=>{const _0xaa62a2=_0x4aaaa8['editing']['view']['document']['getRoot']();_0x2d472e['removeClass']('ck-ai_review-diff',_0xaa62a2),_0x2d472e['removeClass']('ck-ai_review-highlights',_0xaa62a2),_0x2d472e['removeClass']('ck-ai-translate-mode-content',_0xaa62a2);});}['_getTranslationWithDefault'](_0x1db209,_0x36ac77){const _0x11a31c=as(this['context']['locale'],_0x1db209);return _0x11a31c===_0x1db209?_0x36ac77:_0x11a31c;}['_logError'](_0x418392,_0x57f30d=!0x1){Et(_0x418392['message']),_0x57f30d||(_0x418392['message']['startsWith']('ai-review-mode-models-unable-to-retrieve')?this['_aiReviewCoreUi']['showGeneralReviewCoreErrorView']():this['_aiReviewCoreUi']['showGeneralResultsErrorView']());}['_scrollToChange'](_0x364d59){if('content'===this['_changeActivationSource']){const _0x54bbc7=this['_aiReviewCoreUi']['getChangeElement'](_0x364d59);_0x54bbc7&&wt(_0x54bbc7['closest']('.ck-ai_review__check-run-result')||_0x54bbc7);}else{if('panel'===this['_changeActivationSource']){const _0x3dd608=this['_getChangeContentElement'](_0x364d59);if(!_0x3dd608)return;mt({'target':_0x3dd608,'viewportOffset':{'top':0x55,'left':0x0,'bottom':0x0,'right':0x0},'ancestorOffset':0x14,'alignToTop':!0x0});}}}}const Co=[{'id':'custom','commandId':'custom','title':'Custom\x20command','description':'Type\x20a\x20custom\x20command\x20to\x20review\x20the\x20content\x20exactly\x20as\x20you\x20need.','isParameterized':!0x0},{'id':'correctness','commandId':'correctness','title':'Correctness','description':'Ensure\x20the\x20text\x20is\x20factually\x20accurate\x20and\x20free\x20of\x20errors.','isParameterized':!0x1},{'id':'clarity','commandId':'clarity','title':'Clarity','description':'Improve\x20the\x20clarity\x20and\x20readability\x20of\x20the\x20text.','isParameterized':!0x1},{'id':'readability','commandId':'readability','title':'Readability','description':'Enhance\x20the\x20overall\x20readability\x20of\x20the\x20text.','isParameterized':!0x1},{'id':'length','commandId':'make','title':'Adjust\x20length','description':'Refine\x20text\x20length\x20to\x20match\x20your\x20needs.','isParameterized':!0x0,'options':[{'formType':'dropdown','label':'Adjust\x20length','default':'longer','data':[{'label':'Longer','id':'longer'},{'label':'Shorter','id':'shorter'}]}]},{'id':'tone','commandId':'make-tone','title':'Adjust\x20tone\x20and\x20style','description':'Choose\x20tone\x20and\x20style\x20to\x20change\x20content\x20as\x20you\x20need.','isParameterized':!0x0,'options':[{'formType':'dropdown','label':'Adjust\x20tone\x20and\x20style','default':'casual','data':[{'label':'Casual','id':'casual'},{'label':'Direct','id':'direct'},{'label':'Friendly','id':'friendly'},{'label':'Confident','id':'confident'},{'label':'Professional','id':'professional'}]}]}];class wo{['id'];['commandId'];['title'];['description'];['isParameterized'];['useArgs'];['options'];['args'];get['apiId'](){return this['commandId'];}constructor(_0x242475){this['id']=_0x242475['id'],this['commandId']=_0x242475['commandId'],this['title']=_0x242475['title'],this['description']=_0x242475['description'],this['isParameterized']=_0x242475['isParameterized'],this['useArgs']=_0x242475['useArgs'],this['options']=_0x242475['options'],this['args']=_0x242475['args'];}}class fo extends ht(){['_checks']=[];['setupChecks'](_0x74045e){this['_checks']=_0x74045e['map'](_0x187f86=>new wo(_0x187f86));}get['checks'](){return this['_checks'];}['getCheckById'](_0x4111bf){return this['checks']['find'](_0x13b0f8=>_0x13b0f8['id']===_0x4111bf);}['removeCheckById'](_0x1aba5c){this['_checks']=this['_checks']['filter'](_0x1481af=>_0x1481af['id']!==_0x1aba5c);}}class So extends wo{['_models']=[];['_defaultModel']=null;constructor(_0x3f3b48,_0x23cd9e,_0x3058c3){super(_0x3f3b48),this['_models']=_0x23cd9e,this['_defaultModel']=_0x3058c3;}get['models'](){return this['_models'];}get['defaultModel'](){return this['_defaultModel'];}}class bo extends wo{['isExtra']=!0x0;['prompt'];['model'];['_defaultModel']=null;constructor(_0x7acc02,_0x1a5386,_0x322c7b){super(_0x7acc02),this['prompt']=_0x7acc02['prompt'],this['model']=_0x7acc02['model'],this['model']?this['_defaultModel']=_0x1a5386['find'](_0x2bcd30=>_0x2bcd30['id']===this['model'])||null:this['_defaultModel']=_0x322c7b;}get['defaultModel'](){return this['_defaultModel'];}}class Ro extends fo{['_allModels']=[];['_recommendedModels']=[];['_defaultModel']=null;constructor(_0x4cb86c,_0x1178c2,_0x4f6fa2){super(),this['_allModels']=_0x4cb86c,this['_recommendedModels']=_0x1178c2,this['_defaultModel']=_0x4f6fa2;}['setupChecks'](_0x5362fc){this['_checks']=_0x5362fc['map'](_0x389998=>!0x0===_0x389998['isExtra']?new bo(_0x389998,this['_allModels'],this['_defaultModel']):'custom'===_0x389998['id']?new So(_0x389998,this['_recommendedModels'],this['_defaultModel']):new wo(_0x389998));}}class Oo extends To{['_prompt'];['_model'];constructor(_0x3b5a51,_0x52a494,_0x4ef9cd,_0x11b81e,_0x49fa82){super(_0x4ef9cd,_0x11b81e,_0x49fa82),this['_prompt']=_0x3b5a51,this['_model']=_0x52a494;}get['subTitle'](){return this['_prompt'];}['_createApiRequest'](){return this['_aiConnector']['callCustomReview']({'content':this['_documentData']['content'],'prompt':this['_prompt'],'model':this['_model']});}['_sendRatingRequest'](_0x4360b6,_0x39545a,_0x38045a){return this['_aiConnector']['upsertCustomAIReviewRating'](_0x39545a,_0x4360b6,_0x38045a);}}class ko extends Oo{get['subTitle'](){return'';}set['prompt'](_0x27dbc9){this['_prompt']=_0x27dbc9;}set['model'](_0x4b7c5d){this['_model']=_0x4b7c5d;}}class No extends mo{static get['pluginName'](){return'AIReviewModeController';}['_isDiffOn']=!0x1;['_hasDefaultAvailableCommands']=!0x1;constructor(_0x252a58){super(_0x252a58),this['_hasDefaultAvailableCommands']=!this['context']['config']['get']('ai.review.availableCommands'),this['context']['config']['define']('ai.review.availableCommands',Co['map'](_0x3a5836=>_0x3a5836['id'])),this['context']['config']['define']('ai.review.extraCommands',[]);}async['init'](){await super['init'](),this['listenTo'](this['_aiReviewCoreUi'],'toggleDiff',(_0x5d9d6b,_0x4e437f)=>{this['_isDiffOn']=_0x4e437f['on'],this['_onDiffChange'](this['_isDiffOn']);});}['_initRequiredPlugins'](){super['_initRequiredPlugins'](),this['_aiReviewCoreUi']=this['context']['plugins']['get']('AIReviewModeUI'),this['_aiReviewCoreEditing']=this['context']['plugins']['get']('AIReviewCoreEditing');}['_createReviewCheckRun'](_0x5e4906,_0x45fde2){return _0x5e4906['isCustom']?new Oo(_0x5e4906['args']['prompt'],_0x5e4906['args']['model'],this['_aiReviewCoreEditing']['getDocumentData'](),_0x45fde2,this['_aiConnector']):_0x45fde2['isExtra']?new ko(_0x45fde2['prompt'],_0x45fde2['defaultModel']['id'],this['_aiReviewCoreEditing']['getDocumentData'](),_0x45fde2,this['_aiConnector']):new po(this['_aiReviewCoreEditing']['getDocumentData'](),_0x45fde2,this['_aiConnector'],_0x5e4906['params'],_0x5e4906['args']);}['_onReviewCheckResultActivated'](_0x4258f5){this['_aiReviewCoreUi']['setActiveStateInResults'](_0x4258f5['change']['id']),this['_scrollToChange'](_0x4258f5['change']['id']);const _0xe24aeb=this['_aiReviewCoreEditing']['getMarkerElementForChange'](_0x4258f5['change']['id']);if(!_0xe24aeb)return;const _0x37d64d=this['_aiReviewCoreEditing']['getEditor']();this['_aiReviewCoreUi']['showChangeBalloon'](_0x4258f5['change'],()=>_0xe24aeb['getElement'](),void 0x0,'click',_0x37d64d?.['editing']?.['view']?.['getDomRoot'](),_0x37d64d?.['ui']?.['viewportOffset']),this['_aiReviewCoreEditing']['setMarkersInElementAsActive'](_0x4258f5['change']['id']);}['_onReviewCheckResultDeactivated'](){this['_aiReviewCoreUi']['resetActiveStateInResults'](),this['_aiReviewCoreUi']['hideChangeBalloon'](),this['_aiReviewCoreEditing']['setAllMarkersAsInactive']();}['_onActivateChange'](_0x43e98a){this['_currentReviewCheckRun']&&'click'===_0x43e98a['uiInteraction']&&(this['_changeActivationSource']='panel',this['_currentReviewCheckRun']['activateChange'](_0x43e98a['id']));}['_onDeactivateChange'](_0xffd0a5){this['_currentReviewCheckRun']&&'balloon'===_0xffd0a5['origin']&&this['_currentReviewCheckRun']['deactivateChange']();}['_onChangeMarkerClicked'](_0x338912,_0x11ebd2){if(!this['_currentReviewCheckRun'])return;this['_changeActivationSource']='content',this['_currentReviewCheckRun']['activateChange'](_0x11ebd2['changeId']);const _0x32a1b9=this['_currentReviewCheckRun']['getChangeById'](_0x11ebd2['changeId']);if(!_0x32a1b9)return;const _0x19c75b=this['_aiReviewCoreEditing']['getEditor']();this['_aiReviewCoreUi']['showChangeBalloon'](_0x32a1b9,_0x11ebd2['markerElement'],_0x11ebd2['domEvent'],'click',_0x19c75b?.['editing']?.['view']?.['getDomRoot'](),_0x19c75b?.['ui']?.['viewportOffset']);}['_onChangeMarkerHovered'](_0x2807ce,_0x568dfc){if(!this['_currentReviewCheckRun'])return;if(this['_currentReviewCheckRun']['isAnyChangeActivated']())return;const _0x5c62de=this['_currentReviewCheckRun']['getChangeById'](_0x568dfc['changeId']);if(!_0x5c62de)return;const _0x4cf1a6=this['_aiReviewCoreEditing']['getEditor']();this['_aiReviewCoreUi']['showChangeBalloon'](_0x5c62de,_0x568dfc['markerElement'],_0x568dfc['domEvent'],'hover',_0x4cf1a6?.['editing']?.['view']?.['getDomRoot'](),_0x4cf1a6?.['ui']?.['viewportOffset']);}['_onChangeMarkerBlurred'](){if(!this['_currentReviewCheckRun'])return;this['_currentReviewCheckRun']['isAnyChangeActivated']()||this['_aiReviewCoreUi']['hideChangeBalloon']();}['_getChangeContentElement'](_0xfc92ae){const _0x552fb0=this['_aiReviewCoreEditing']['getMarkerElementForChange'](_0xfc92ae);return _0x552fb0?_0x552fb0['getElement']():null;}['_markChangePositionInEditorContent'](_0x162308,_0x373221){this['_aiReviewCoreEditing']['markChangePositionInEditorContent'](_0x162308,_0x373221);}['_diffContent'](_0x147178,_0x4c045f){return this['_aiReviewCoreEditing']['diffContent'](_0x147178,_0x4c045f);}['_onReviewCheckRun'](){this['_onDiffChange'](this['_isDiffOn']);}['_onDiffChange'](_0x176c67){const _0x28c2ff=this['_aiReviewCoreEditing']['getEditor']();_0x176c67?this['_aiReviewCoreUi']['hideDiffInBalloon']():this['_aiReviewCoreUi']['showDiffInBalloon'](),_0x28c2ff&&_0x28c2ff['editing']['view']['change'](_0x2c3dbf=>{const _0x528a67=_0x28c2ff['editing']['view']['document']['getRoot']();for(const _0xa84bae of _0x528a67['getClassNames']())_0xa84bae['startsWith']('ck-ai_review-')&&_0x2c3dbf['removeClass'](_0xa84bae,_0x528a67);_0x2c3dbf['addClass'](_0x176c67?'ck-ai_review-diff':'ck-ai_review-highlights',_0x528a67);});}async['_getChecksList'](){const _0x3841a8=[...Co,...this['_getExtraChecks']()],_0x42ff1c=this['context']['config']['get']('ai.review.availableCommands')||[];this['_logErrorForNonExistentChecks'](_0x42ff1c,_0x3841a8);let _0x2b7ccc=_0x3841a8;this['_hasDefaultAvailableCommands']||(_0x2b7ccc=_0x42ff1c['map'](_0x2e927f=>_0x3841a8['find'](_0x35d34d=>_0x35d34d['id']===_0x2e927f))['filter'](_0x576330=>!!_0x576330)),_0x2b7ccc=_0x2b7ccc['map'](_0x1a6246=>_0x1a6246['isExtra']?_0x1a6246:this['_translateReviewCheck'](_0x1a6246));const _0x2fc04a=_0x2b7ccc['some'](_0x5b083b=>_0x5b083b['isExtra']||'custom'===_0x5b083b['id']);let _0x1b5729=[],_0x3f82cf=[],_0x21e275=null;if(_0x2fc04a){const _0x291fb6=await this['_getModels']();_0x1b5729=_0x291fb6['all'],_0x3f82cf=_0x291fb6['recommended'],_0x21e275=_0x291fb6['default'];}const _0x24300f=new Ro(_0x1b5729,_0x3f82cf,_0x21e275);return _0x24300f['setupChecks'](_0x2b7ccc),_0x2fc04a&&this['_filterChecksWithMissingModel'](_0x24300f),_0x24300f;}['_getExtraChecks'](){return(this['context']['config']['get']('ai.review.extraCommands')||[])['map'](_0x48782d=>({'id':_0x48782d['id'],'commandId':_0x48782d['id'],'title':_0x48782d['label'],'description':_0x48782d['description'],'isParameterized':!0x1,'isExtra':!0x0,'prompt':_0x48782d['prompt'],'model':_0x48782d['model']}));}['_logErrorForNonExistentChecks'](_0xfb6a67,_0x4373e0){const _0x5269a7=_0xfb6a67['filter'](_0x317ce7=>!_0x4373e0['some'](_0x22798c=>_0x22798c['id']===_0x317ce7));_0x5269a7['length']&&this['_logError'](new ot('ai-review-mode-non-existent-commands-used',this,{'commandIds':_0x5269a7['join'](',\x20')}),!0x0);}async['_getModels'](){try{const _0x25a303=new Bs({'connector':this['_aiConnector'],'config':this['context']['config']['get']('ai.models'),'locale':this['context']['locale']});return{'all':await _0x25a303['getAll'](),'recommended':await _0x25a303['getAvailableModels'](),'default':await _0x25a303['getDefault']()};}catch(_0x41d4a7){return this['_logError'](new ot('ai-review-mode-models-unable-to-retrieve',this,void 0x0,_0x41d4a7)),{'all':[],'recommended':[],'default':null};}}['_translateReviewCheck'](_0x5974be){const _0x1e5238='AI_REVIEW_CHECK_'+_0x5974be['id']['toUpperCase']()['replaceAll']('-','_'),_0x34946b={..._0x5974be,'title':this['_getTranslationWithDefault'](_0x1e5238+'_TITLE',_0x5974be['title']),'description':this['_getTranslationWithDefault'](_0x1e5238+'_DESCRIPTION',_0x5974be['description'])};return _0x5974be['options']&&(_0x34946b['options']=_0x5974be['options']['map'](_0x21d746=>({..._0x21d746,'label':this['_getTranslationWithDefault'](_0x1e5238+'_OPTIONS_LABEL',_0x21d746['label']||''),'data':_0x21d746['data']?_0x21d746['data']['map'](_0x1ad227=>({..._0x1ad227,'label':this['_getTranslationWithDefault'](_0x1e5238+'_OPTIONS_DATA_'+_0x1ad227['id']['toUpperCase'](),_0x1ad227['label'])})):void 0x0}))),_0x34946b;}['_filterChecksWithMissingModel'](_0x3180fa){const _0x33c328=[];_0x3180fa['checks']['forEach'](_0x4e3013=>{(_0x4e3013 instanceof bo&&!_0x4e3013['defaultModel']||_0x4e3013 instanceof So&&!_0x4e3013['models']['length'])&&_0x33c328['push'](_0x4e3013['id']);}),_0x33c328['length']&&_0x33c328['forEach'](_0x4d7916=>{_0x3180fa['removeCheckById'](_0x4d7916),this['_logError'](new ot('ai-review-mode-command-unavailable-due-to-missing-model',this,{'commandId':_0x4d7916}),!0x0);});}}class vo extends _0x1aa7e1{static get['requires'](){return[No,_o,go];}static get['pluginName'](){return'AIReviewMode';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class yo extends wo{get['apiId'](){return'translate';}}class xo extends fo{['setupChecks'](_0x5cc600){this['_checks']=_0x5cc600['map'](_0x46c99c=>new yo(_0x46c99c));}}class Lo extends po{['_title'];constructor(_0x5c14dd,_0x378a28,_0x3936d2,_0x10feca,_0x5da79a,_0x1f9fb4){super(_0x5c14dd,_0x378a28,_0x3936d2,_0x5da79a,_0x1f9fb4),this['_title']=_0x10feca;}get['title'](){return this['_title'];}get['subTitle'](){return this['_sourceCheck']['title'];}}class Do extends mo{static get['pluginName'](){return'AITranslateController';}constructor(_0x5db6d1){super(_0x5db6d1),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'](_0x4b26d7,_0x3a656b){return new Lo(this['_aiReviewCoreEditing']['getDocumentData'](),_0x3a656b,this['_aiConnector'],as(this['context']['locale'],'AI_REVIEW_CHECK_TRANSLATE_TITLE'),_0x4b26d7['params'],_0x4b26d7['args']);}['_onReviewCheckResultActivated'](_0x1672cb){this['_aiReviewCoreUi']['setActiveStateInResults'](_0x1672cb['change']['id']),this['_aiReviewCoreEditing']['setMarkersInElementAsActive'](_0x1672cb['change']['id']);}['_onReviewCheckResultDeactivated'](){this['_aiReviewCoreEditing']['setAllMarkersAsInactive'](),this['_aiReviewCoreUi']['resetActiveStateInResults']();}['_onActivateChange'](_0x57b280){this['_currentReviewCheckRun']&&('hover'===_0x57b280['uiInteraction']&&(this['_changeActivationSource']='panel',this['_currentReviewCheckRun']['activateChange'](_0x57b280['id'])),'click'===_0x57b280['uiInteraction']&&this['_scrollToChange'](_0x57b280['id']));}['_onDeactivateChange'](_0x5bf904){this['_currentReviewCheckRun']&&'panel'===_0x5bf904['origin']&&this['_currentReviewCheckRun']['deactivateChange']();}['_onChangeMarkerClicked'](_0x1e3f71,_0x5d62e8){this['_currentReviewCheckRun']&&(this['_changeActivationSource']='content',this['_currentReviewCheckRun']['activateChange'](_0x5d62e8['changeId']),this['_scrollToChange'](_0x5d62e8['changeId']));}['_onChangeMarkerHovered'](_0x366967,_0x5309bb){this['_currentReviewCheckRun']&&(this['_changeActivationSource']='content',this['_currentReviewCheckRun']['activateChange'](_0x5309bb['changeId']),this['_aiReviewCoreEditing']['reactivateMarkers'](_0x5309bb['changeId']));}['_onChangeMarkerBlurred'](){this['_currentReviewCheckRun']&&'content'===this['_changeActivationSource']&&(this['_currentReviewCheckRun']['deactivateChange'](),this['_aiReviewCoreEditing']['setAllMarkersAsInactive']());}['_getChangeContentElement'](_0x30fc03){return this['_aiReviewCoreEditing']['getContentElementForChange'](_0x30fc03);}['_markChangePositionInEditorContent'](_0x1b0221,_0x44bc8c){this['_aiReviewCoreEditing']['markChangePositionInEditorContent'](_0x1b0221,_0x44bc8c);}['_diffContent'](_0x5f4f32,_0x361577){return this['_aiReviewCoreEditing']['diffContent'](_0x5f4f32,_0x361577,!0x0);}['_onReviewCheckRun'](){const _0x4ee25a=this['_aiReviewCoreEditing']['getEditor']();_0x4ee25a&&_0x4ee25a['editing']['view']['change'](_0x1e53a6=>{const _0x57ba8e=_0x4ee25a['editing']['view']['document']['getRoot']();for(const _0x1b654c of _0x57ba8e['getClassNames']())(_0x1b654c['startsWith']('ck-ai-review-')||'ck-ai-translate-'===_0x1b654c)&&_0x1e53a6['removeClass'](_0x1b654c,_0x57ba8e);_0x1e53a6['addClass']('ck-ai-translate-mode-content',_0x57ba8e);});}async['_getChecksList'](){const _0x2f98d2=[],_0x341f8a=this['context']['config']['get']('ai.translate.languages')||[];for(const _0xbfa4dd of _0x341f8a)_0x2f98d2['push']({'title':_0xbfa4dd['label'],'id':_0xbfa4dd['id'],'commandId':_0xbfa4dd['id'],'description':'','isParameterized':!0x1,'useArgs':!0x0,'args':{'language':_0xbfa4dd['id']}});const _0x1b24b3=new xo();return _0x1b24b3['setupChecks'](this['_translateChecks'](_0x2f98d2)),_0x1b24b3;}['_translateChecks'](_0x47b281){return _0x47b281['map'](_0x4337e3=>{const _0x18380c='AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_'+_0x4337e3['title']['toUpperCase']()['replaceAll']('-','_');return{..._0x4337e3,'title':this['_getTranslationWithDefault'](_0x18380c,_0x4337e3['title'])};});}}class Po extends io{constructor(_0xa715ed,_0x1622c5){super(_0xa715ed,_0x1622c5),this['on']('set:isLoading',(_0x3be751,_0x1ef342,_0x1192fc)=>{_0x1192fc&&(this['headerTitle']=as(this['locale'],'AI_TRANSLATE_CHECK_RESULTS_LOADING_TITLE'));}),this['on']('set:isResultReady',(_0x66280b,_0x3a3411,_0xd42a59)=>{_0xd42a59&&(this['headerTitle']=as(this['locale'],'AI_TRANSLATE_CHECK_RESULTS_READY_TITLE'));});}['_createAcceptAllButtonView'](){const _0x394a32=super['_createAcceptAllButtonView']();return _0x394a32['set']('label',as(this['locale'],'AI_TRANSLATE_ACCEPT_ALL')),_0x394a32;}['_createExitReviewButtonView'](){const _0xb4f5e7=super['_createExitReviewButtonView']();return _0xb4f5e7['set']('label',as(this['locale'],'AI_CHAT_HISTORY_CANCEL')),_0xb4f5e7;}}class Ho extends uo{['_setupTemplate'](){const _0x40c50b=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-translate__check-list-wrapper',_0x40c50b['if']('isVisible','ck-hidden',_0x1a57eb=>!_0x1a57eb)]},'children':[{'tag':'div','attributes':{'class':['ck-ai-translate__check-list-header']},'children':[{'tag':'h2','children':[{'text':as(this['locale'],'AI_TRANSLATE_CHECK_LIST_HEADER_TITLE')}]},{'tag':'p','children':[{'text':as(this['locale'],'AI_TRANSLATE_CHECK_LIST_HEADER_DESCRIPTION')}]}]},{'tag':'div','attributes':{'class':['ck-ai_review__check-list',_0x40c50b['if']('isVisible','ck-hidden',_0x5e68fc=>!_0x5e68fc)]},'children':this['_checkViews']}]});}}class Mo extends Ja{static get['pluginName'](){return'AITranslateUI';}['createMainView'](){const _0x2f102c=this['context']['locale'],_0x1d5110=new _0x1d57fa(_0x2f102c,{'label':as(_0x2f102c,'AI_REVIEW_CHECK_TRANSLATE_TITLE'),'icon':_0x16125b,'class':'ck-ai-header\x20ck-ai-header_review-translate'}),_0x1070b3=new to(_0x2f102c,{'header':_0x1d5110,'list':new Ho(_0x2f102c),'results':new Po(_0x2f102c,{'generalErrorText':as(_0x2f102c,'AI_TRANSLATE_GENERAL_ERROR_MESSAGE')}),'completed':new so(_0x2f102c,{'headerText':as(_0x2f102c,'AI_TRANSLATE_FINISH_HEADER_TITLE'),'emptyResultsText':as(_0x2f102c,'AI_TRANSLATE_EMPTY_RESULTS_TEXT'),'buttonText':as(_0x2f102c,'AI_TRANSLATE_FINISH_BUTTON_LABEL')})});return _0x1070b3['extendTemplate']({'attributes':{'class':'ck-ai-translate-mode'}}),_0x1070b3;}['registerTab'](){const _0x5a328a=this['context']['plugins']['get']('AITabs');_0x5a328a['view']['on']('activateTab',(_0x343d30,_0xa07414)=>{'translate'===_0xa07414?this['fire']('getReviewCheckList'):this['fire']('leaveReview');}),_0x5a328a['view']['addTab']({'id':'translate','buttonLabel':as(this['context']['locale'],'AI_REVIEW_CHECK_TRANSLATE_TITLE'),'buttonIcon':_0x16125b,'order':0x0,'content':this['_mainView']});}}class Uo extends _0x1aa7e1{static get['requires'](){return[Do,Mo,go];}static get['pluginName'](){return'AITranslate';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}export{qa as AIActions,Si as AIAdapter,qi as AIAssistant,Wi as AIAssistantUI,ma as AIBalloon,la as AIChat,Ys as AIChatController,ca as AIChatHistory,ha as AIChatHistoryController,ra as AIChatHistoryUI,Aa as AIChatShortcuts,Zr as AIChatUI,rs as AIConnector,qs as AIEditing,ba as AIEditorIntegration,Qa as AIQuickActions,Ma as AIQuickActionsUI,bi as AIRequestError,wo as AIReviewCheck,Io as AIReviewCheckResult,To as AIReviewCheckRun,vo as AIReviewMode,mo as AIReviewModeController,go as AIReviewModeEditing,_o as AIReviewModeUI,ns as AITabs,Xi as AITextAdapter,Ia as AIToggleButtonUI,Uo as AITranslate,Do as AITranslateController,Mo as AITranslateUI,ji as AWSTextAdapter,zi as OpenAITextAdapter,Oi as ShowAIAssistantCommand,ga as ToggleAICommand,ls as createResizeButton,Qi as getDefaultAICommands};
|
|
23
|
+
import{Plugin as _0x2db8aa,Command as _0x46077b,ContextPlugin as _0x333531,Editor as _0x20ae3c}from'@ckeditor/ckeditor5-core/dist/index.js';import{IconCopy as _0x1f3e9a,IconCheck as _0x253f15,IconError as _0x1ac100,IconSubmit as _0x37a21a,IconAIHistory as _0x2e660f,IconMagicWand as _0x171239,IconRobotPencil as _0x5e1e81,IconMaximize as _0x12e914,IconMinimize as _0x53d1da,IconShowChangesOn as _0x43f29c,IconShowChangesOff as _0x55a63e,IconDocument as _0xaaa825,IconBoxWithCross as _0x33ab6a,IconBoxWithCheck as _0x575bee,IconBoxWithMarker as _0x4899d4,IconInfo as _0x147769,IconWeb as _0x596377,IconCancel as _0x6494e0,IconSelection as _0x416536,IconFileUpload as _0x5e55fc,IconLink as _0x8ee664,IconBulb as _0x5e3239,IconAI as _0x3f202d,IconPreviousArrow as _0xb3d9b4,IconDocumentOutline as _0x33f88b,IconLoupe as _0x199a84,IconPaperClip as _0x2e44b6,IconBrowseFiles as _0x780de3,IconDropdownArrow as _0x35eca3,IconStop as _0x4d09f1,IconAIChat as _0x20ae05,IconPlus as _0x4cd16e,IconPin as _0x514118,IconThreeHorizontalDots as _0xfb681,IconAIReview as _0x5d7a94,IconAITranslate as _0x20525b,IconAIAskAI as _0x2f67c4,IconThumbUp as _0x4bad33,IconThumbDown as _0x10e733,IconChevronDown as _0x5ade8b,IconChevronUp as _0x4c2017,IconAIQuickActions as _0xadd0ff,IconAIChatCommands as _0x160f40,IconAIImproveWriting as _0x4cbf9a,IconAIContinueWriting as _0x2f867c,IconAIGrammarCheck as _0x1d2a05,IconAIAdjustLength as _0x5628ec,IconAIChangeTone as _0x3e6679,IconAIOther as _0x1ad21b,IconRefresh as tt,IconNextArrow as et,IconOutdated as it,IconEye as st,IconEyeCrossedOut as nt,IconChevronRight as rt}from'@ckeditor/ckeditor5-icons/dist/index.js';import{uid as at,CKEditorError as ot,ObservableMixin as ht,global as ct,isVisible as lt,Rect as ut,Collection as dt,FocusTracker as _t,KeystrokeHandler as At,first as gt,logWarning as It,logError as Et,toArray as Tt,EmitterMixin as pt,scrollViewportToShowTarget as mt,insertToPriorityArray as Ct,scrollAncestorsToShowTarget as wt,ResizeObserver as ft,_isMotionReduced as St,getConstrainedViewportRect as bt,DomEmitterMixin as Rt}from'@ckeditor/ckeditor5-utils/dist/index.js';import{ToolbarView as Ot,ButtonView as kt,View as Nt,SpinnerView as vt,IconView as yt,AutocompleteView as xt,ListView as Lt,ListItemGroupView as Dt,ListItemView as Pt,ButtonLabelView as Ht,FocusCycler as Mt,createLabeledTextarea as Ut,Dialog as Vt,createDropdown as Bt,addMenuToDropdown as Gt,MenuBarMenuView as Ft,MenuBarMenuListItemButtonView as Kt,DialogViewPosition as Wt,MenuBarMenuListView as Yt,MenuBarMenuListItemView as $t,BodyCollection as qt,BalloonPanelView as Qt,clickOutsideHandler as Xt,addListToDropdown as zt,UIModel as jt,submitHandler as Jt,LabeledFieldView as Zt,createLabeledInputText as te,FormHeaderView as _0x3b6a7d,HighlightedTextView as _0x51d6a3,ViewCollection as _0x5ba55d,FileDialogButtonView as _0x384b8e,InputTextView as _0x20a14c,SearchTextView as _0x39d3b1,ListItemButtonView as _0x575b1f,ButtonLabelWithHighlightView as _0x31cc2f,DropdownMenuPanelPositioningFunctions as _0x4bd091,BalloonToolbar as _0x2d17a3,FormRowView as _0x583e67,TextareaView as _0x24ece4}from'@ckeditor/ckeditor5-ui/dist/index.js';import{ClipboardPipeline as _0x246320,ClipboardMarkersUtils as _0x538780}from'@ckeditor/ckeditor5-clipboard/dist/index.js';import{ViewDocumentDomEventData as _0x116501,ViewDataTransfer as _0x40cdb0,ViewUpcastWriter as _0x43104e,Matcher as _0x240f7c,_DetachOperation as _0x30ee68,_insertIntoModelNodeList as _0x186e6c,_removeFromModelNodeList as _0x42666a,ModelRange as _0x34cb53,transformOperationSets as _0x4693a2,ViewDowncastWriter as _0x27d124,ModelDocumentFragment as _0x23a0e5,ModelPosition as _0x31292e,ModelTreeWalker as _0x66aaa3,MarkerOperation as _0x480c88,InsertOperation as _0x4fd0d3}from'@ckeditor/ckeditor5-engine/dist/index.js';import{unescape as _0x12c0e3,escape as _0x2fa763,cloneDeep as _0x500b79,escapeRegExp as _0xe514b6,debounce as _0x212c8b}from'es-toolkit/compat';import{createParser as _0x1e3095}from'eventsource-parser';import{CloudServices as _0x1587b7}from'@ckeditor/ckeditor5-cloud-services/dist/index.js';import{parseDocument as _0xe52b52}from'htmlparser2';import{isTag as _0x1005f8,findOne as _0xd5f574,getParent as _0x107731,findAll as _0x155b48,removeElement as _0x13f11d,replaceElement as _0x35991e,prepend as _0xc74076,prependChild as _0x480634,appendChild as _0x77a4e5,append as _0x1ac603,find as _0x1925bc,isComment as _0x5fa535,getChildren as _0x3dd017,textContent as _0x33acc6}from'domutils';import _0x11d3e7 from'dom-serializer';import{Document as _0x450a47,Element as ti,Text as _0xea0ca3,cloneNode as _0x4ca565,isDocument as _0x28eaa2,isText as _0x54530a,NodeWithChildren as _0x3e43b8}from'domhandler';import{MarkdownGfmMdToHtmlDefaultPlugins as _0x26f49c,MarkdownGfmMdToHtml as _0x361b7f}from'@ckeditor/ckeditor5-markdown-gfm/dist/index.js';import _0x16306a from'rehype-sanitize';import{fixElementSuggestionRange as _0x3d8ea2,DocumentCompare as _0x515afb,DATA_ID_MODEL_ATTRIBUTE as _0x45927f,ConfirmMixin as _0x32cb9f,getAllMarkersDomElementsSorted as _0x395590,SuggestionsConversion as _0x47af91,DATA_ID_VIEW_ATTRIBUTE as _0x139d70,getMarkerDomElement as _0x5e1d44}from'@ckeditor/ckeditor5-collaboration-core/dist/index.js';import _0x58e95e from'morphdom';import{diffArrays as _0x5b5740}from'diff';const pi='_ungrouppedCommands';function mi(_0x477a70,_0x5203cf){const _0x16a975=(0x0,_0x5203cf['t'])('Other');return _0x477a70['length']?'groupId'in _0x477a70[0x0]?_0x477a70:[{'groupId':pi,'groupLabel':_0x16a975,'order':0x1/0x0,'commands':_0x477a70}]:[{'groupId':pi,'groupLabel':_0x16a975,'order':0x1/0x0,'commands':[]}];}const Ci=globalThis['DataTransfer'],wi='ai-ui';class fi extends _0x2db8aa{static get['pluginName'](){return'AIAssistantEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const {editor:_0x1145fd}=this,_0x49819d=['ck-fake-ai-selection'];_0x1145fd['config']['get']('ai.assistant.useTheme')&&_0x49819d['push']('ck-ai-assistant-ui_theme'),_0x1145fd['conversion']['for']('editingDowncast')['markerToHighlight']({'model':wi,'view':{'classes':_0x49819d,'priority':0xc}}),_0x1145fd['conversion']['for']('editingDowncast')['markerToElement']({'model':wi,'view':(_0x2605b3,{writer:_0x5ad644})=>{if(!_0x2605b3['markerRange']['isCollapsed'])return null;const _0x1e77c3=_0x5ad644['createUIElement']('span');return _0x5ad644['addClass'](['ck-fake-ai-selection','ck-fake-ai-selection_collapsed'],_0x1e77c3),_0x1e77c3;}});}['afterInit'](){!async function(_0xe6e509){const _0x362a00=_0xf7dc67([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]),_0x6b2fa0=0x3dffc4e1,_0x229cdc=0x3df84109^_0x6b2fa0,_0x4a3a3a=window[_0xf7dc67([0x44,0x61,0x74,0x65])][_0xf7dc67([0x6e,0x6f,0x77])](),_0x49419e=_0xe6e509[_0xf7dc67([0x65,0x64,0x69,0x74,0x6f,0x72])],_0x1ff457=new window[(_0xf7dc67([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x5c6f8a=>{_0x49419e[_0xf7dc67([0x6f,0x6e,0x63,0x65])](_0xf7dc67([0x72,0x65,0x61,0x64,0x79]),_0x5c6f8a);}),_0x2ebe7e={[_0xf7dc67([0x6b,0x74,0x79])]:_0xf7dc67([0x45,0x43]),[_0xf7dc67([0x75,0x73,0x65])]:_0xf7dc67([0x73,0x69,0x67]),[_0xf7dc67([0x63,0x72,0x76])]:_0xf7dc67([0x50,0x2d,0x32,0x35,0x36]),[_0xf7dc67([0x78])]:_0xf7dc67([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]),[_0xf7dc67([0x79])]:_0xf7dc67([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]),[_0xf7dc67([0x61,0x6c,0x67])]:_0xf7dc67([0x45,0x53,0x32,0x35,0x36])},_0x5ae0d2=_0x49419e[_0xf7dc67([0x63,0x6f,0x6e,0x66,0x69,0x67])][_0xf7dc67([0x67,0x65,0x74])](_0xf7dc67([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79]));async function _0x22bd26(){let _0x5cff59,_0x299081=null,_0x59f3ab=null;try{if(_0x5ae0d2==_0xf7dc67([0x47,0x50,0x4c]))return _0xf7dc67([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]);if(_0x5cff59=_0x2bf1e5(),!_0x5cff59)return _0xf7dc67([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);return _0x5cff59[_0xf7dc67([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])]&&(_0x59f3ab=_0xfe3375(_0x5cff59[_0xf7dc67([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])],_0x5cff59[_0xf7dc67([0x6a,0x74,0x69])])),await _0x5d2834()?_0x11e639()?_0x5d74d8()?_0xf7dc67([0x45,0x78,0x70,0x69,0x72,0x65,0x64]):_0x4cbb8c()?(_0x5cff59[_0xf7dc67([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0xf7dc67([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e])&&(_0x299081=_0x15200e(_0xf7dc67([0x45,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e,0x4c,0x69,0x6d,0x69,0x74]))),await _0x45fc0c()):_0xf7dc67([0x44,0x6f,0x6d,0x61,0x69,0x6e,0x4c,0x69,0x6d,0x69,0x74]):_0xf7dc67([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]):_0xf7dc67([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}catch{return _0xf7dc67([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}function _0x5d74d8(){const _0x68f6aa=[_0xf7dc67([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e]),_0xf7dc67([0x74,0x72,0x69,0x61,0x6c])][_0xf7dc67([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x5cff59[_0xf7dc67([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])])?_0x4a3a3a/0x3e8:0xe10*_0x229cdc;return _0x5cff59[_0xf7dc67([0x65,0x78,0x70])]<_0x68f6aa;}function _0x11e639(){const _0x57fc1f=_0x5cff59[_0xf7dc67([0x66,0x65,0x61,0x74,0x75,0x72,0x65,0x73])];return!!_0x57fc1f&&(!!_0x57fc1f[_0xf7dc67([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0xf7dc67([0x2a]))||!!_0x57fc1f[_0xf7dc67([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0xf7dc67([0x41,0x49])));}function _0x4cbb8c(){const _0x30457e=_0x5cff59[_0xf7dc67([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x64,0x48,0x6f,0x73,0x74,0x73])];if(!_0x30457e||0x0==_0x30457e[_0xf7dc67([0x6c,0x65,0x6e,0x67,0x74,0x68])])return!0x0;const {hostname:_0x4806a6}=new URL(window[_0xf7dc67([0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e])]['href']);if(_0x30457e[_0xf7dc67([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x4806a6))return!0x0;const _0x19f89b=_0x4806a6[_0xf7dc67([0x73,0x70,0x6c,0x69,0x74])](_0xf7dc67([0x2e]));return _0x30457e[_0xf7dc67([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x43b968=>_0x43b968[_0xf7dc67([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0xf7dc67([0x2a])))[_0xf7dc67([0x6d,0x61,0x70])](_0x59050b=>_0x59050b[_0xf7dc67([0x73,0x70,0x6c,0x69,0x74])](_0xf7dc67([0x2e])))[_0xf7dc67([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x262435=>_0x262435[_0xf7dc67([0x6c,0x65,0x6e,0x67,0x74,0x68])]<=_0x19f89b[_0xf7dc67([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0xf7dc67([0x6d,0x61,0x70])](_0x5bd291=>Array(_0x19f89b[_0xf7dc67([0x6c,0x65,0x6e,0x67,0x74,0x68])]-_0x5bd291[_0xf7dc67([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0xf7dc67([0x66,0x69,0x6c,0x6c])](_0x5bd291[0x0]===_0xf7dc67([0x2a])?_0xf7dc67([0x2a]):'')[_0xf7dc67([0x63,0x6f,0x6e,0x63,0x61,0x74])](_0x5bd291))[_0xf7dc67([0x73,0x6f,0x6d,0x65])](_0x563af=>_0x19f89b[_0xf7dc67([0x65,0x76,0x65,0x72,0x79])]((_0x5239a3,_0xc1e9db)=>_0x563af[_0xc1e9db]===_0x5239a3||_0x563af[_0xc1e9db]===_0xf7dc67([0x2a])));}function _0x45fc0c(){return _0x299081&&_0x59f3ab?new window[(_0xf7dc67([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x52c760,_0x4d5a1b)=>{_0x299081[_0xf7dc67([0x74,0x68,0x65,0x6e])](_0x52c760,_0x4d5a1b),_0x59f3ab[_0xf7dc67([0x74,0x68,0x65,0x6e])](_0x23baa2=>{_0x23baa2!=_0xf7dc67([0x56,0x61,0x6c,0x69,0x64])&&_0x52c760(_0x23baa2);},_0x4d5a1b);}):_0x299081||_0x59f3ab||_0xf7dc67([0x56,0x61,0x6c,0x69,0x64]);}}function _0xfe3375(_0xdfcc96,_0x38ddc1){return new window[(_0xf7dc67([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x4814c4=>{if(_0x347ba7())return _0x4814c4(_0xf7dc67([0x56,0x61,0x6c,0x69,0x64]));_0x20121e(),_0x49419e[_0xf7dc67([0x64,0x65,0x63,0x6f,0x72,0x61,0x74,0x65])](_0xf7dc67([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]));let _0xf8b75f=!0x1;const _0x3a48ec=at();function _0x41084d(_0x191d16){return!!_0x191d16&&(typeof _0x191d16===_0xf7dc67([0x6f,0x62,0x6a,0x65,0x63,0x74])||typeof _0x191d16===_0xf7dc67([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]))&&typeof _0x191d16[_0xf7dc67([0x74,0x68,0x65,0x6e])]===_0xf7dc67([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e])&&typeof _0x191d16[_0xf7dc67([0x63,0x61,0x74,0x63,0x68])]===_0xf7dc67([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]);}function _0x153312(_0xefe033){_0x36ba60(_0xefe033)[_0xf7dc67([0x74,0x68,0x65,0x6e])](_0x4b2711=>{if(!_0x4b2711||_0x4b2711[_0xf7dc67([0x73,0x74,0x61,0x74,0x75,0x73])]!=_0xf7dc67([0x6f,0x6b]))return _0xf7dc67([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]);return _0x318699(_0x1b159d(_0x3a48ec+_0x38ddc1))!=_0x4b2711[_0xf7dc67([0x76,0x65,0x72,0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6f,0x6e])]?_0xf7dc67([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]):_0xf7dc67([0x56,0x61,0x6c,0x69,0x64]);})[_0xf7dc67([0x74,0x68,0x65,0x6e])](_0x338a33=>(_0x2da481(),_0x338a33),()=>{const _0x49d094=_0x588a5f();return null==_0x49d094?(_0x2da481(),_0xf7dc67([0x56,0x61,0x6c,0x69,0x64])):_0xf7dc67(_0x4a3a3a-_0x49d094>(0x19f340e1^_0x6b2fa0)?[0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]:[0x56,0x61,0x6c,0x69,0x64]);})[_0xf7dc67([0x74,0x68,0x65,0x6e])](_0x4814c4)[_0xf7dc67([0x63,0x61,0x74,0x63,0x68])](()=>{_0x4814c4(_0xf7dc67([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});const _0x2fe7f4=0x3dc92a61^_0x6b2fa0;function _0x2da481(){const _0x1783ca=_0xf7dc67([0x6c,0x6c,0x63,0x74,0x2d])+_0x318699(_0x1b159d(_0xdfcc96)),_0x20e77f=_0x4c6d4c(_0x318699(window[_0xf7dc67([0x4d,0x61,0x74,0x68])][_0xf7dc67([0x63,0x65,0x69,0x6c])](_0x4a3a3a/_0x2fe7f4)));window[_0xf7dc67([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0xf7dc67([0x73,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x1783ca,_0x20e77f);}function _0x588a5f(){const _0x1f9a5b=_0xf7dc67([0x6c,0x6c,0x63,0x74,0x2d])+_0x318699(_0x1b159d(_0xdfcc96)),_0x31d89e=window[_0xf7dc67([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0xf7dc67([0x67,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x1f9a5b);return _0x31d89e?window[_0xf7dc67([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x4c6d4c(_0x31d89e),0x10)*_0x2fe7f4:null;}function _0x36ba60(_0x4e7c14){return new window[(_0xf7dc67([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x2f85a5,_0x4ab995)=>{_0x4e7c14[_0xf7dc67([0x74,0x68,0x65,0x6e])](_0x2f85a5,_0x4ab995),window[_0xf7dc67([0x73,0x65,0x74,0x54,0x69,0x6d,0x65,0x6f,0x75,0x74])](_0x4ab995,0x3dfe1021^_0x6b2fa0);});}}_0x49419e[_0xf7dc67([0x6f,0x6e])](_0xf7dc67([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),(_0x474d7e,_0x40ebb7)=>{if(_0x40ebb7[0x0]!=_0xdfcc96)return _0x4814c4(_0xf7dc67([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));_0x40ebb7[0x1]={..._0x40ebb7[0x1],[_0xf7dc67([0x72,0x65,0x71,0x75,0x65,0x73,0x74,0x49,0x64])]:_0x3a48ec};},{[_0xf7dc67([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0xf7dc67([0x68,0x69,0x67,0x68])}),_0x49419e[_0xf7dc67([0x6f,0x6e])](_0xf7dc67([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),_0x21e2e3=>{_0x41084d(_0x21e2e3[_0xf7dc67([0x72,0x65,0x74,0x75,0x72,0x6e])])&&(_0xf8b75f=!0x0,_0x153312(_0x21e2e3[_0xf7dc67([0x72,0x65,0x74,0x75,0x72,0x6e])]));},{[_0xf7dc67([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0xf7dc67([0x6c,0x6f,0x77])}),_0x1ff457[_0xf7dc67([0x74,0x68,0x65,0x6e])](()=>{_0xf8b75f||_0x4814c4(_0xf7dc67([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});});function _0x347ba7(){return _0x49419e[_0xf7dc67([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0xf7dc67([0x76,0x69,0x65,0x77])][_0xf7dc67([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]==_0xf7dc67([0x61,0x75,0x74,0x6f]);}function _0x20121e(){_0x49419e[_0xf7dc67([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0xf7dc67([0x76,0x69,0x65,0x77])][_0xf7dc67([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]=_0xf7dc67([0x61,0x75,0x74,0x6f]);}}function _0x15200e(_0x4ce8a3){const _0x2b63a0=[new window[(_0xf7dc67([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x8e0392=>setTimeout(_0x8e0392,0x3df6fa2d^_0x6b2fa0)),_0x1ff457[_0xf7dc67([0x74,0x68,0x65,0x6e])](()=>new window[(_0xf7dc67([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x41a01a=>{let _0x4a810c=0x0;_0x49419e[_0xf7dc67([0x6d,0x6f,0x64,0x65,0x6c])][_0xf7dc67([0x6f,0x6e])](_0xf7dc67([0x61,0x70,0x70,0x6c,0x79,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e]),(_0x5afde2,_0x5a8748)=>{_0x5a8748[0x0][_0xf7dc67([0x69,0x73,0x44,0x6f,0x63,0x75,0x6d,0x65,0x6e,0x74,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e])]&&_0x4a810c++,_0x4a810c==(0x3dffc109^_0x6b2fa0)&&(_0x41a01a(),_0x5afde2[_0xf7dc67([0x6f,0x66,0x66])]());});}))];return window[_0xf7dc67([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65])][_0xf7dc67([0x72,0x61,0x63,0x65])](_0x2b63a0)[_0xf7dc67([0x74,0x68,0x65,0x6e])](()=>_0x4ce8a3);}async function _0x418972(){await _0x1ff457,_0x49419e[_0xf7dc67([0x6d,0x6f,0x64,0x65,0x6c])][_0xf7dc67([0x63,0x68,0x61,0x6e,0x67,0x65])]=_0x2bb668,_0x49419e[_0xf7dc67([0x6d,0x6f,0x64,0x65,0x6c])][_0xf7dc67([0x65,0x6e,0x71,0x75,0x65,0x75,0x65,0x43,0x68,0x61,0x6e,0x67,0x65])]=_0x2bb668,_0x49419e[_0xf7dc67([0x65,0x6e,0x61,0x62,0x6c,0x65,0x52,0x65,0x61,0x64,0x4f,0x6e,0x6c,0x79,0x4d,0x6f,0x64,0x65])](_0xf7dc67([0x6d,0x6f,0x64,0x65,0x6c]));}function _0x526d4c(_0x10ed2f){const _0x5e29bf=_0x35e3ab();_0x49419e[_0x5e29bf]=_0xf7dc67([0x61,0x69,0x4c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79])+_0x10ed2f,_0x10ed2f!=_0xf7dc67([0x56,0x61,0x6c,0x69,0x64])&&_0x418972();}function _0x35e3ab(){const _0x55b433=window[_0xf7dc67([0x53,0x74,0x72,0x69,0x6e,0x67])](window[_0xf7dc67([0x70,0x65,0x72,0x66,0x6f,0x72,0x6d,0x61,0x6e,0x63,0x65])][_0xf7dc67([0x6e,0x6f,0x77])]())[_0xf7dc67([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](_0xf7dc67([0x2e]),'');let _0x8dd9c6=_0xf7dc67([0x6e]);for(let _0x11c4bd=0x0;_0x11c4bd<_0x55b433[_0xf7dc67([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x11c4bd+=0x2){let _0x51f108=window[_0xf7dc67([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x55b433[_0xf7dc67([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x11c4bd,_0x11c4bd+0x2));_0x51f108>=_0x362a00[_0xf7dc67([0x6c,0x65,0x6e,0x67,0x74,0x68])]&&(_0x51f108-=_0x362a00[_0xf7dc67([0x6c,0x65,0x6e,0x67,0x74,0x68])]),_0x8dd9c6+=_0x362a00[_0x51f108];}return _0x8dd9c6;}function _0x2bf1e5(){const _0x3377c5=_0x5ae0d2[_0xf7dc67([0x73,0x70,0x6c,0x69,0x74])](_0xf7dc67([0x2e]));if(0x3!=_0x3377c5[_0xf7dc67([0x6c,0x65,0x6e,0x67,0x74,0x68])])return null;return _0x3dfb37(_0x3377c5[0x1]);function _0x3dfb37(_0x6a090c){const _0x1dd6d4=_0x399e82(_0x6a090c);return _0x1dd6d4&&_0x106dd5()?_0x1dd6d4:null;function _0x106dd5(){const _0x3f3381=_0x1dd6d4[_0xf7dc67([0x6a,0x74,0x69])],_0xcfbe8a=window[_0xf7dc67([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x3f3381[_0xf7dc67([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x3f3381[_0xf7dc67([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8),0x10),_0x19b5e5={..._0x1dd6d4,[_0xf7dc67([0x6a,0x74,0x69])]:_0x3f3381[_0xf7dc67([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](0x0,_0x3f3381[_0xf7dc67([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8)};return delete _0x19b5e5[_0xf7dc67([0x76,0x63])],_0x1b159d(_0x19b5e5)==_0xcfbe8a;}}}async function _0x5d2834(){let _0x31de37=!0x0;try{const _0x46dc4c=_0x5ae0d2[_0xf7dc67([0x73,0x70,0x6c,0x69,0x74])](_0xf7dc67([0x2e])),[_0x239d34,_0x11bd64,_0x441658]=_0x46dc4c;return _0x480a36(_0x239d34),await _0x6a6349(_0x239d34,_0x11bd64,_0x441658),_0x31de37;}catch{return!0x1;}function _0x480a36(_0x392bcd){const _0x214512=_0x399e82(_0x392bcd);_0x214512&&_0x214512[_0xf7dc67([0x61,0x6c,0x67])]==_0xf7dc67([0x45,0x53,0x32,0x35,0x36])||(_0x31de37=!0x1);}async function _0x6a6349(_0x5c38a8,_0x5b52cc,_0x5b1b37){const _0x4f2ee3=window[_0xf7dc67([0x55,0x69,0x6e,0x74,0x38,0x41,0x72,0x72,0x61,0x79])][_0xf7dc67([0x66,0x72,0x6f,0x6d])](_0x32b2c8(_0x5b1b37),_0x2768dc=>_0x2768dc[_0xf7dc67([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](0x0)),_0x170f64=new window[(_0xf7dc67([0x54,0x65,0x78,0x74,0x45,0x6e,0x63,0x6f,0x64,0x65,0x72]))]()[_0xf7dc67([0x65,0x6e,0x63,0x6f,0x64,0x65])](_0x5c38a8+_0xf7dc67([0x2e])+_0x5b52cc),_0x1a9be6=window[_0xf7dc67([0x63,0x72,0x79,0x70,0x74,0x6f])][_0xf7dc67([0x73,0x75,0x62,0x74,0x6c,0x65])];if(!_0x1a9be6)return;const _0x2e7556=await _0x1a9be6[_0xf7dc67([0x69,0x6d,0x70,0x6f,0x72,0x74,0x4b,0x65,0x79])](_0xf7dc67([0x6a,0x77,0x6b]),_0x2ebe7e,{[_0xf7dc67([0x6e,0x61,0x6d,0x65])]:_0xf7dc67([0x45,0x43,0x44,0x53,0x41]),[_0xf7dc67([0x6e,0x61,0x6d,0x65,0x64,0x43,0x75,0x72,0x76,0x65])]:_0xf7dc67([0x50,0x2d,0x32,0x35,0x36])},!0x1,[_0xf7dc67([0x76,0x65,0x72,0x69,0x66,0x79])]);await _0x1a9be6[_0xf7dc67([0x76,0x65,0x72,0x69,0x66,0x79])]({[_0xf7dc67([0x6e,0x61,0x6d,0x65])]:_0xf7dc67([0x45,0x43,0x44,0x53,0x41]),[_0xf7dc67([0x68,0x61,0x73,0x68])]:{[_0xf7dc67([0x6e,0x61,0x6d,0x65])]:_0xf7dc67([0x53,0x48,0x41,0x2d,0x32,0x35,0x36])}},_0x2e7556,_0x4f2ee3,_0x170f64)||(_0x31de37=!0x1);}}function _0x399e82(_0x408bd6){return _0x408bd6[_0xf7dc67([0x73,0x74,0x61,0x72,0x74,0x73,0x57,0x69,0x74,0x68])](_0xf7dc67([0x65,0x79]))?JSON[_0xf7dc67([0x70,0x61,0x72,0x73,0x65])](_0x32b2c8(_0x408bd6)):null;}function _0x32b2c8(_0x583bb9){return window[_0xf7dc67([0x61,0x74,0x6f,0x62])](_0x583bb9[_0xf7dc67([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/-/g,_0xf7dc67([0x2b]))[_0xf7dc67([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/_/g,_0xf7dc67([0x2f])));}function _0x1b159d(_0x596d4d){let _0x1c6918=0x1505;function _0x103dcb(_0x5613ca){for(let _0x5ab2d6=0x0;_0x5ab2d6<_0x5613ca[_0xf7dc67([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x5ab2d6++){const _0x1bb876=_0x5613ca[_0xf7dc67([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](_0x5ab2d6);_0x1c6918=(_0x1c6918<<0x5)+_0x1c6918+_0x1bb876,_0x1c6918&=_0x1c6918;}}function _0x53385b(_0x52ada5){Array[_0xf7dc67([0x69,0x73,0x41,0x72,0x72,0x61,0x79])](_0x52ada5)?_0x52ada5[_0xf7dc67([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](_0x53385b):_0x52ada5&&typeof _0x52ada5==_0xf7dc67([0x6f,0x62,0x6a,0x65,0x63,0x74])?Object[_0xf7dc67([0x65,0x6e,0x74,0x72,0x69,0x65,0x73])](_0x52ada5)[_0xf7dc67([0x73,0x6f,0x72,0x74])]()[_0xf7dc67([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](([_0x3851df,_0x266cef])=>{_0x103dcb(_0x3851df),_0x53385b(_0x266cef);}):_0x103dcb(window[_0xf7dc67([0x53,0x74,0x72,0x69,0x6e,0x67])](_0x52ada5));}return _0x53385b(_0x596d4d),_0x1c6918>>>0x0;}function _0x318699(_0x4c180e){return _0x4c180e[_0xf7dc67([0x74,0x6f,0x53,0x74,0x72,0x69,0x6e,0x67])](0x10)[_0xf7dc67([0x70,0x61,0x64,0x53,0x74,0x61,0x72,0x74])](0x8,_0xf7dc67([0x30]));}function _0x4c6d4c(_0x18f3ee){return _0x18f3ee[_0xf7dc67([0x73,0x70,0x6c,0x69,0x74])]('')[_0xf7dc67([0x72,0x65,0x76,0x65,0x72,0x73,0x65])]()[_0xf7dc67([0x6a,0x6f,0x69,0x6e])]('');}function _0x2bb668(){}function _0xf7dc67(_0x49772d){return _0x49772d['map'](_0x59dcb9=>String['fromCharCode'](_0x59dcb9))['join']('');}_0x526d4c(await _0x22bd26());}(this);}['showFakeVisualSelection'](){const _0x56c153=this['editor']['model'];_0x56c153['change'](_0x2fa24e=>{const _0x2e76f9=_0x56c153['document']['selection']['getRanges']();let _0x11c797=0x0;for(const _0x51c0ca of _0x2e76f9){const _0x3b2426=wi+':'+_0x11c797;if(_0x56c153['markers']['has'](_0x3b2426))_0x2fa24e['updateMarker'](_0x3b2426,{'range':_0x51c0ca});else{if(_0x51c0ca['start']['isAtEnd']){const _0x4f1876=_0x51c0ca['start']['getLastMatchingPosition'](({item:_0x1803c2})=>!_0x56c153['schema']['isContent'](_0x1803c2),{'boundaries':_0x51c0ca});_0x2fa24e['addMarker'](_0x3b2426,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x2fa24e['createRange'](_0x4f1876,_0x51c0ca['end'])});}else _0x2fa24e['addMarker'](_0x3b2426,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x51c0ca});}_0x11c797++;}});}['hideFakeVisualSelection'](){const _0x1fc27b=this['editor']['model'],_0x572b4e=Array['from'](this['editor']['model']['markers']['getMarkersGroup'](wi));_0x572b4e['length']&&_0x1fc27b['change'](_0x5bde1f=>{_0x572b4e['forEach'](_0x536356=>{_0x5bde1f['removeMarker'](_0x536356);});});}['insertContent'](_0x105d4b,_0x36956a){const _0x1398db=this['_getAISelection'](),_0x4c7d21=_0x36956a||_0x1398db['getFirstRange']();this['editor']['model']['canEditAt'](_0x4c7d21)&&this['editor']['model']['change'](_0x534f02=>{this['hideFakeVisualSelection'](),_0x36956a||this['_resetContentOfSelectedTableCells'](_0x534f02,_0x1398db),this['_pasteHTMLUsingClipboard']({'insertAt':_0x4c7d21,'writer':_0x534f02,'html':_0x105d4b});});}['insertContentBelow'](_0x2221d3){const {model:_0x46472e}=this['editor'],_0x29c1a6=this['_getAISelection']();_0x46472e['change'](()=>{const _0x53b72b=this['_prepareTableInsertBelowPosition'](_0x2221d3,_0x29c1a6)||this['_getDefaultInsertBelowPosition'](_0x29c1a6);this['insertContent'](_0x2221d3,_0x53b72b);});}['_getAISelection'](){const _0x3b6787=this['editor']['model'],_0x1d69f8=Array['from'](_0x3b6787['markers']['getMarkersGroup'](wi))['map'](_0x376b5b=>_0x376b5b['getRange']());return _0x3b6787['createSelection'](_0x1d69f8);}['_pasteHTMLUsingClipboard']({writer:_0x3cc01f,html:_0x1d1c9d,insertAt:_0x10620f}){const {view:_0x55101e}=this['editor']['editing'],_0x399db8=this['editor']['plugins']['get'](_0x246320),_0x360116=new Ci();_0x360116['setData']('text/html',_0x1d1c9d);const _0x23734f=new ClipboardEvent('paste',{'clipboardData':_0x360116}),_0x271de9=new _0x116501(_0x55101e,_0x23734f,{'dataTransfer':new _0x40cdb0(_0x360116)});_0x3cc01f['setSelection'](_0x10620f);const _0x11c0e8=(_0x36182b,_0x4fabfd)=>{_0x4fabfd['resultRange']&&_0x3cc01f['setSelection'](_0x4fabfd['resultRange']);};_0x399db8['once']('contentInsertion',_0x11c0e8,{'priority':'lowest'}),_0x55101e['document']['fire']('paste',_0x271de9),_0x399db8['off']('contentInsertion',_0x11c0e8);}['_getDefaultInsertBelowPosition'](_0x1d1c78){const {model:_0x123d04}=this['editor'],_0x3a600c=Array['from'](_0x1d1c78['getSelectedBlocks']());return _0x3a600c['length']?_0x123d04['createPositionAfter'](_0x3a600c['pop']()):_0x1d1c78['getLastPosition']();}['_prepareTableInsertBelowPosition'](_0x481ed7,_0x38eed4){const {model:_0x127ac4,plugins:_0x28c21a}=this['editor'];if(_0x28c21a['has']('TableUtils')){const _0x542902=_0x28c21a['get']('TableUtils')['getSelectedTableCells'](_0x38eed4);if(_0x542902['length']){const _0x105a45=this['_getTableRowCountFromContent'](_0x481ed7),_0x301839=this['_createEmptyTableRows'](_0x542902,_0x105a45);return _0x127ac4['createPositionAt'](_0x301839,0x0);}}return null;}['_getTableRowCountFromContent'](_0x312f1f){const _0x3b23be=this['editor']['plugins']['get']('TableUtils'),_0x588a4d=this['editor']['data']['parse'](_0x312f1f),_0x178df9=Array['from'](_0x588a4d['getChildren']())['filter'](_0x3ce286=>_0x3ce286['is']('element','table'));let _0x5f24e4=0x0;return _0x178df9['forEach'](_0x5c5287=>{_0x5f24e4+=_0x3b23be['getRows'](_0x5c5287);}),_0x5f24e4;}['_createEmptyTableRows'](_0x35e1da,_0x290ae4){const _0x16b01a=this['editor']['plugins']['get']('TableUtils'),_0x2e04bf=_0x16b01a['getRowIndexes'](_0x35e1da),_0x2821e9=_0x16b01a['getColumnIndexes'](_0x35e1da),_0x11569a=_0x2e04bf['last']+0x1,_0x4ef58f=_0x2821e9['first'],_0xfd2736=_0x35e1da[0x0]['findAncestor']('table');for(let _0x1777c0=0x0;_0x1777c0<_0x290ae4;_0x1777c0++)_0x16b01a['insertRows'](_0xfd2736,{'at':_0x11569a});return _0xfd2736['getChild'](_0x11569a)['getChild'](_0x4ef58f);}['_resetContentOfSelectedTableCells'](_0x506f3f,_0x195c7b){const {plugins:_0x6de3df}=this['editor'],{model:_0x44731b}=_0x506f3f;if(!_0x6de3df['has']('TableUtils'))return;_0x6de3df['get']('TableUtils')['getSelectedTableCells'](_0x195c7b)['length']&&_0x44731b['deleteContent'](_0x195c7b);}}class Si extends _0x2db8aa{static get['pluginName'](){return'AIAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['afterInit'](){if(!this['textAdapter'])throw new ot('aiadapter-text-adapter-not-set',null);}}class bi extends Error{constructor(_0x1f2bb0){super(_0x1f2bb0),this['name']='AIRequestError';}}function Ri(_0x4d0e10,_0x14b402,_0x2a6fd8){const t=_0x4d0e10['t'];switch(_0x14b402){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',_0x2a6fd8);case'Error\x20during\x20AI\x20content\x20generation:\x20%0':return t('Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x2a6fd8);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'},_0x2a6fd8);case'AI_ERROR_CONTEXT_LENGTH':return t({'id':'AI_ERROR_CONTEXT_LENGTH','string':'Selected\x20content\x20is\x20too\x20long'});case'AI_ERROR_MODERATION':return t({'id':'AI_ERROR_MODERATION','string':'Requested\x20query\x20does\x20not\x20pass\x20moderation\x20rules'});case'AI_ERROR_AWS_NOT_SUPPORTED':return t({'id':'AI_ERROR_AWS_NOT_SUPPORTED','string':'The\x20AWS\x20integration\x20is\x20no\x20longer\x20supported.\x20Please\x20contact\x20the\x20support.'});case'AI_ERROR_FAILED':return t({'id':'AI_ERROR_FAILED','string':'Failed\x20to\x20communicate\x20with\x20the\x20AI\x20service'});default:return _0x14b402;}}class Oi extends _0x46077b{['_commandDefinitions'];constructor(_0x547521,_0x11e250){super(_0x547521),this['_commandDefinitions']=_0x11e250,this['set']('enabledCommandsIds',[]),this['on']('change:_hasContext',(_0x2351d2,_0x1b22dd,_0x29d2d6)=>{this['isEnabled']&&(this['enabledCommandsIds']=ki(this['_commandDefinitions'],_0x29d2d6));}),this['set']('_hasContext',!0x1),this['on']('change:isEnabled',(_0x56d1ab,_0x365e8b,_0xb98600)=>{this['enabledCommandsIds']=_0xb98600?ki(this['_commandDefinitions'],this['_hasContext']):[];});}['refresh'](){const _0x46b621=this['editor']['model'];this['_hasContext']=function(_0x4da96f){const _0x460762=_0x4da96f['document']['selection'];return _0x460762['isCollapsed']?0x0!==[..._0x460762['getSelectedBlocks']()]['length']&&![..._0x460762['getSelectedBlocks']()][0x0]['isEmpty']:!!_0x4da96f['hasContent'](_0x460762['getFirstRange']());}(_0x46b621);const _0xde67aa=_0x46b621['document']['selection'],_0x1f3d18=this['editor']['config']['get']('ai.assistant.disabledElements');for(const _0x5c7b08 of _0xde67aa['getRanges']())for(const _0x3cfbf6 of _0x5c7b08['getItems']())if(_0x3cfbf6['is']('element')&&_0x1f3d18['includes'](_0x3cfbf6['name']))return void(this['isEnabled']=!0x1);this['isEnabled']=!0x0;}['execute'](_0x438cbd='',_0x634a29='',_0x14fb8c='custom'){this['editor']['plugins']['get'](Wi)['showUI'](_0x438cbd,_0x634a29,_0x14fb8c);}}function ki(_0x5b1953,_0x5abf37){const _0xc92d8a=new Set();for(const _0x597fcc of _0x5b1953['values']())(_0x5abf37||!0x1===_0x597fcc['requiresContent'])&&_0xc92d8a['add'](_0x597fcc['id']);return Array['from'](_0xc92d8a);}const Ni=new RegExp(/^(.*?)<[a-zA-Z][a-zA-Z0-9_\-.]*[ >]/,'is');class vi extends/* #__PURE__ -- @preserve */
|
|
24
|
+
ht(){['editor'];['textAdapter'];['view'];['_sanitizationContainer'];['_domParser'];['_xmlSerializer'];constructor(_0x4406af,_0xc1e751,_0x459c83){super(),this['editor']=_0x4406af,this['textAdapter']=_0xc1e751,this['_sanitizationContainer']=document['createElement']('div'),this['_domParser']=new DOMParser(),this['_xmlSerializer']=new XMLSerializer(),this['view']=_0x459c83,this['set']({'initialContext':'','currentContext':'','currentResponse':'','previousContext':void 0x0,'previousQuery':void 0x0,'previousLabel':void 0x0,'isProcessing':!0x1}),this['on']('set:currentContext',(_0x310648,_0x26eb5b,_0x49d782)=>{this['view']['value']=this['_sanitizeHTML'](_0x49d782);}),this['listenTo'](this['view'],'submitPrompt',(_0x4782e4,_0x193a0c)=>{const _0x404b5f=this['currentContext']||this['initialContext'];this['_handleQuery'](_0x193a0c,_0x404b5f,'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:_0x1244fe,query:_0x2996cf,htmlContent:_0x39acc6,label:_0x98c53d,mainActionLabel:_0x2fe33b}){this['view']['prompt']=_0x98c53d,this['view']['mainAction']=_0x2fe33b,this['initialContext']=_0x39acc6,_0x2996cf&&(this['view']['isRendered']?this['_handleQuery'](_0x2996cf,_0x39acc6,_0x1244fe,_0x98c53d):this['view']['once']('render',()=>{this['_handleQuery'](_0x2996cf,_0x39acc6,_0x1244fe,_0x98c53d);}));}['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'](_0x12f1fe,_0x10b483,_0x48635d,_0x3a5aea){return this['isProcessing']=!0x0,this['view']['startProcessing'](),this['previousContext']=_0x10b483,this['previousQuery']=_0x12f1fe,this['previousLabel']=_0x3a5aea||_0x12f1fe,this['previousActionId']=_0x48635d,new Promise(_0x279f20=>{this['textAdapter']['makeRequest']({'query':_0x12f1fe,'context':_0x10b483,'onData':_0x259271=>{this['currentResponse']=_0x259271,this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse']);},'actionId':_0x48635d})['then'](()=>{!this['currentContext']&&this['currentResponse']&&(this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse'],!0x0));})['catch'](_0x46ce43=>{_0x46ce43 instanceof bi?this['view']['handleError'](_0x46ce43['message']):this['view']['handleError'](),_0x279f20();})['finally'](()=>{this['stopProcessing'](),_0x279f20();});});}['_parseAndNormalizeContent'](_0x1095e9,_0x361186=!0x1){const _0x5449d0=Ni['exec'](_0x1095e9);_0x1095e9=_0x5449d0?_0x1095e9['substring'](_0x5449d0[0x1]['length']):_0x1095e9['length']<0x64&&!_0x361186?'':this['_stripMarkdownSyntax'](_0x1095e9);const _0x2152a0=this['_domParser']['parseFromString'](_0x1095e9,'text/html');if(_0x5449d0){const _0x276b7b=Array['from'](_0x2152a0['body']['childNodes']);_0x276b7b['reverse']();for(const _0x233d93 of _0x276b7b){if(_0x233d93['nodeType']==Node['ELEMENT_NODE'])break;_0x233d93['remove']();}}const _0x20ef76=this['editor']['data']['processor']['toView'](this['_xmlSerializer']['serializeToString'](_0x2152a0['body']));this['_isH1TagSupportEnabled']()||this['_normalizeResponseHeadings'](_0x20ef76);const _0x25cfd5=this['editor']['config']['get']('ai.assistant.preserveComments'),_0x222c45=this['editor']['data']['toModel'](_0x20ef76);return _0x25cfd5||_0x222c45['markers']['clear'](),this['editor']['data']['stringify'](_0x222c45);}['_normalizeResponseHeadings'](_0x4a7aaf){const _0x53b8b8=new _0x43104e(this['editor']['editing']['view']['document']),_0x21651c=new _0x240f7c({'name':/^h[1-5]$/}),_0x5e2382=[];let _0x546088=!0x1;for(const _0x3d33ec of _0x4a7aaf)_0x3d33ec['is']('element')&&_0x21651c['match'](_0x3d33ec)&&(_0x5e2382['push'](_0x3d33ec),'h1'==_0x3d33ec['name']&&(_0x546088=!0x0));if(_0x546088){for(const _0x218d3b of _0x5e2382)_0x53b8b8['rename']('h'+(parseInt(_0x218d3b['name'][0x1])+0x1),_0x218d3b);}}['_isH1TagSupportEnabled'](){const {data:_0x456761,editing:_0x4fbc28}=this['editor'],_0x129a3e=_0x456761['htmlProcessor']['toView']('<h1></h1>'),_0x1cd94d=_0x456761['toView'](_0x456761['toModel'](_0x129a3e));return!!_0x4fbc28['view']['domConverter']['viewToDom'](_0x1cd94d)['querySelector']('h1');}['_sanitizeHTML'](_0x424a92){return this['editor']['editing']['view']['domConverter']['setContentOf'](this['_sanitizationContainer'],_0x424a92),this['_sanitizationContainer']['innerHTML'];}['_stripMarkdownSyntax'](_0x3fba37){const _0x2811a5=_0x3fba37['trim']();return _0x2811a5['startsWith']('```html')?_0x2811a5['endsWith']('```')?_0x2811a5['substring'](0x7,_0x2811a5['length']-0x3):_0x2811a5['substring'](0x7):_0x3fba37;}}const yi={'REPLACE':'replace','INSERT':'insert'};class xi extends Ot{constructor(_0x1b8497){super(_0x1b8497),this['set']('isVisible',!0x1),this['set']('mainAction',yi['REPLACE']),this['replaceButton']=this['_createButton']('','ck-button-action'),this['replaceButton']['bind']('label')['to'](this,'mainAction',_0x1f5c2e=>Ri(_0x1b8497,'AI_'+_0x1f5c2e['toUpperCase']()+'_CONTENT')),this['insertButton']=this['_createButton'](Ri(_0x1b8497,'Insert\x20below')),this['tryAgainButton']=this['_createButton'](Ri(_0x1b8497,'Try\x20again')),this['stopButton']=this['_createButton'](Ri(_0x1b8497,'Stop'));const _0x568ded=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-form__toolbar',_0x568ded['if']('isVisible','ck-hidden',_0x19f753=>!_0x19f753)]}}),this['items']['addMany']([this['replaceButton'],this['insertButton'],this['tryAgainButton'],this['stopButton']]);}['_createButton'](_0x4f3f30,_0x3d17fe){const _0x4adb4c=new kt(this['locale']);return _0x4adb4c['set']({'label':_0x4f3f30,'class':_0x3d17fe||'','isVisible':!0x0,'withText':!0x0}),_0x4adb4c;}}class Li extends Nt{['contentFieldView'];['copyButtonView'];constructor(_0x3e77e4,_0x424a24=''){super(_0x3e77e4),this['set']({'value':null,'isVisible':!0x1,'isProcessing':!0x1});const _0x4fba40=this['bindTemplate'];this['contentFieldView']=new Di(_0x3e77e4,_0x424a24),this['copyButtonView']=this['_createCopyButton'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area-wrapper',_0x4fba40['if']('isVisible','ck-hidden',_0xbbd473=>!_0xbbd473)],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area',_0x4fba40['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 _0x1018ad=!0x1;this['on']('change:value',(_0x1649cf,_0x2ff1e2,_0x3d78d3)=>{const _0x1c2268=!this['contentFieldView']['element']['querySelector']('.ck-ai-form__loader');this['contentFieldView']['setContent'](_0x3d78d3),this['isProcessing']&&_0x1c2268&&!_0x1018ad&&this['element']['scrollTo']({'top':this['element']['scrollHeight'],'behavior':'smooth'});}),this['on']('change:isProcessing',(_0x380cba,_0x3d9fc6,_0x113249)=>{_0x1018ad=!0x1,_0x113249?(this['value']=null,this['contentFieldView']['appendLoader']()):this['value']||this['contentFieldView']['setContent']('');}),this['listenTo'](this['element'],'wheel',()=>{_0x1018ad=!0x0;}),this['listenTo'](this['element'],'mousedown',()=>{_0x1018ad=!0x0;});}['focus'](){this['element']['focus']();}['_createCopyButton'](){const _0x4849d3=this['locale'],_0x35bd6b=new kt(this['locale']),_0x581a1d='ck-ai-form__copy-button';return _0x35bd6b['set']({'label':Ri(_0x4849d3,'Copy'),'icon':_0x1f3e9a,'class':_0x581a1d,'tooltip':!0x0}),_0x35bd6b['bind']('isVisible')['to'](this,'value',_0x2c6852=>!!_0x2c6852),_0x35bd6b['bind']('isEnabled')['to'](this,'isProcessing',_0x5e116e=>!_0x5e116e),_0x35bd6b['on']('execute',()=>{this['_copyHTMLToClipboard'](this['contentFieldView']['element']),_0x35bd6b['icon']=_0x253f15,_0x35bd6b['class']=_0x581a1d+'\x20ck-ai-form__copy-button--copied',this['focus'](),setTimeout(()=>{_0x35bd6b['icon']=_0x1f3e9a,_0x35bd6b['class']=_0x581a1d;},0x3e8);}),_0x35bd6b;}['_copyHTMLToClipboard'](_0x4f34f1){const {window:_0x536072,document:_0x4bb67c}=ct;if(_0x536072['ClipboardItem']){const {Blob:_0x2a1a43,ClipboardItem:_0x14a9a9}=_0x536072,_0x59aa4a=[new _0x14a9a9({'text/html':new _0x2a1a43([_0x4f34f1['innerHTML']],{'type':'text/html'}),'text/plain':new _0x2a1a43([_0x4f34f1['textContent']||''],{'type':'text/plain'})})];navigator['clipboard']['write'](_0x59aa4a);}else{const _0x5f54d6=_0x4bb67c['createElement']('div');_0x5f54d6['style']['position']='absolute',_0x5f54d6['style']['left']='-9999px',_0x5f54d6['innerHTML']='<span>[</span>'+_0x4f34f1['innerHTML']+'<span>]</span>',_0x4bb67c['body']['appendChild'](_0x5f54d6);const _0x567222=_0x4bb67c['createRange']();_0x567222['setStartAfter'](_0x5f54d6['firstElementChild']),_0x567222['setEndBefore'](_0x5f54d6['lastElementChild']);const _0x287a2c=_0x536072['getSelection']();_0x287a2c['removeAllRanges'](),_0x287a2c['addRange'](_0x567222),_0x4bb67c['execCommand']('copy'),_0x5f54d6['remove']();}}}class Di extends Nt{constructor(_0x2de94c,_0x2c69f0=''){super(_0x2de94c),this['loaderView']=this['_createLoader'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content',_0x2c69f0,'ck-reset_all-excluded','ck-ai-form__content-field']}});}['setContent'](_0x5f4e57){this['element']['innerHTML']=_0x5f4e57;}['appendLoader'](){this['element']['appendChild'](this['loaderView']['element']);}['_createLoader'](){const _0x341562=new Nt(),_0x3e9f3d=this['locale'],_0x1909d1=new vt();return _0x1909d1['isVisible']=!0x0,_0x341562['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__loader']},'children':[_0x1909d1,{'text':Ri(_0x3e9f3d,'AI\x20is\x20writing...')}]}),_0x341562['render'](),_0x341562;}}class Pi extends Nt{constructor(_0x51d35d,_0x21eac5=''){super(_0x51d35d);const _0x131fdf=new yt(),_0x56a00e=this['bindTemplate'];this['set']('text',_0x21eac5),_0x131fdf['content']=_0x1ac100,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__error']},'children':[_0x131fdf,{'text':_0x56a00e['to']('text')}]});}}class Hi extends xt{['submitButtonView'];['showHistoryButtonView'];constructor(_0x2a22e5,_0x18c2ce){super(_0x2a22e5,_0x18c2ce),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',(_0x42affa,_0x5df247)=>{_0x42affa['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0x5df247());});}['_createSubmitButton'](){const _0x371775=new kt(this['locale']),_0x5987b9=this['locale'];return _0x371775['set']({'icon':_0x37a21a,'label':Ri(_0x5987b9,'Submit'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-form__submit'}),_0x371775['on']('execute',()=>{this['submit']();}),_0x371775['bind']('isEnabled')['to'](this['queryView']['fieldView'],'isEmpty',this,'isEnabled',(_0x235c65,_0x11a1de)=>!_0x235c65&&_0x11a1de),_0x371775;}['_createShowHistoryButton'](){const _0x41ec31=new kt(this['locale']),_0x1aa80a=this['resultsView'],_0x305425=this['locale'];_0x41ec31['set']({'label':Ri(_0x305425,'History'),'withText':!0x1,'icon':_0x2e660f,'tooltip':!0x0,'tooltipPosition':'sw','class':'ck-ai-form__toggle-history'}),_0x41ec31['bind']('isOn')['to'](_0x1aa80a,'isVisible'),_0x41ec31['bind']('isEnabled')['to'](this,'isEnabled'),_0x41ec31['on']('execute',()=>{_0x1aa80a['isVisible']=!_0x1aa80a['isVisible'],_0x1aa80a['isVisible']?this['filteredView']['focus']():this['focus']();});const _0x2a7900=()=>{ct['window']['requestAnimationFrame'](()=>{if(lt(this['element'])){const _0x3bdb8f=new ut(this['queryView']['fieldView']['element']),_0xbc4367=_0x3bdb8f['width'],_0x6e9e94='rtl'===_0x305425['uiLanguageDirection']?'left':'right';_0x3bdb8f['excludeScrollbarsAndBorders'](),_0x41ec31['element']['style'][_0x6e9e94]=_0xbc4367-_0x3bdb8f['width']+0x1+'px';}});};return this['queryView']['fieldView']['on']('update',_0x2a7900),this['on']('render',_0x2a7900),_0x41ec31;}['submit'](){const _0x11297b=this['queryView']['fieldView']['element']['value'];this['fire']('submit',_0x11297b);}['focus'](_0x3b3fe9){-0x1===_0x3b3fe9?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}}class Mi extends Lt{['historyGroupView'];['clearHistoryButton'];constructor(_0xa2525a){super(_0xa2525a),this['clearHistoryButton']=this['_createClearHistoryButton'](),this['historyGroupView']=new Dt(),this['historyGroupView']['children']['add'](this['clearHistoryButton'],0x1),this['historyGroupView']['label']=Ri(_0xa2525a,'Prompt\x20history'),this['historyGroupView']['items']['delegate']('execute')['to'](this),this['items']['add'](this['historyGroupView']);}['filter'](){let _0x202a40=0x0;for(const _0x4db18d of this['items'])_0x202a40+=_0x4db18d['items']['length'];return{'resultsCount':_0x202a40,'totalItemsCount':_0x202a40};}['_createClearHistoryButton'](){const _0x4ff2f6=this['locale'],_0x5791df=new kt(this['locale']);return _0x5791df['set']({'label':'('+Ri(_0x4ff2f6,'Clear')+')','withText':!0x0}),_0x5791df['on']('execute',()=>this['fire']('clearHistory')),_0x5791df;}}class Ui extends Pt{constructor(_0x38fd52){super();const _0x255086=new Ht(),_0x41fa3b=new kt(this['locale'],_0x255086);this['children']['add'](_0x41fa3b),_0x41fa3b['set']({'label':_0x38fd52['prompt'],'withText':!0x0}),_0x41fa3b['on']('execute',()=>{this['fire']('execute',{'value':_0x12c0e3(_0x38fd52['prompt'])});});}}const Vi='CKEditor/AIFormView/PromptHistory';class Bi extends dt{constructor(){super(),this['_loadFromSessionStorage'](),this['on']('add',(_0x476c7c,_0x337326)=>{const _0x310101=Gi(_0x337326['prompt']);for(const _0x440b0d of this)if(_0x440b0d!=_0x337326&&Gi(_0x440b0d['prompt'])===_0x310101){this['remove'](_0x440b0d);break;}this['length']>0x14&&this['remove'](this['last']),this['_saveToSessionStorage']();}),this['on']('remove',()=>{this['_saveToSessionStorage']();});}['_loadFromSessionStorage'](){const _0x1ed085=sessionStorage['getItem'](Vi)||'[]';this['addMany'](JSON['parse'](_0x1ed085));}['_saveToSessionStorage'](){sessionStorage['setItem'](Vi,JSON['stringify'](this['map'](_0x4b1512=>_0x4b1512)));}}function Gi(_0x46b22f){return _0x46b22f['toLowerCase']()['trim']();}class Fi extends Nt{['focusTracker'];['keystrokes'];['contentArea'];['toolbar'];['promptView'];['errorView'];['_focusables'];['focusCycler'];['_promptHistory'];constructor(_0x42ba4b,_0x51a967,_0x280346=''){super(_0x42ba4b),this['set']('isEnabled',!0x0),this['set']('isProcessing',!0x1),this['set']('prompt',''),this['set']('value',''),this['set']('isError',!0x1),this['set']('mainAction',yi['REPLACE']),this['_promptHistory']=new Bi(),this['errorView']=new Pi(_0x42ba4b),this['contentArea']=new Li(_0x42ba4b,_0x280346),this['contentArea']['bind']('isProcessing')['to'](this),this['contentArea']['bind']('value')['to'](this),this['toolbar']=this['_createToolbar'](),this['toolbar']['bind']('mainAction')['to'](this),this['promptView']=this['_createPromptView'](),this['focusTracker']=new _t(),this['keystrokes']=new At(),this['_focusables']=this['createCollection']([this['contentArea'],this['contentArea']['copyButtonView'],this['toolbar'],this['promptView']]),this['focusCycler']=new Mt({'focusables':this['_focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes'],'actions':{'focusPrevious':'shift\x20+\x20tab','focusNext':'tab'}}),this['focusCycler']['chain'](this['promptView']['focusCycler']),this['promptView']['queryView']['fieldView']['bind']('value')['to'](this,'prompt');const _0x11196e=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form',_0x51a967],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form-content']},'children':[{'tag':'div','attributes':{'class':[_0x11196e['if']('isError','ck-hidden',_0x703307=>!_0x703307)]},'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'](_0x1aa52f=0x1){-0x1===_0x1aa52f?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 _0x565c8f=this['locale'],_0xf79e28=new Hi(_0x565c8f,{'queryView':{'label':Ri(_0x565c8f,'Ask\x20AI\x20to\x20edit\x20or\x20generate'),'creator':Ut,'showIcon':!0x1,'showResetButton':!0x1},'infoView':{'text':{'noSearchableItems':{'primary':Ri(_0x565c8f,'Empty\x20history'),'secondary':Ri(_0x565c8f,'Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.')}}},'filteredView':this['_createHistoryView'](),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1});return _0xf79e28['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x5606f0,_0x140ad0)=>_0x5606f0&&!_0x140ad0),this['listenTo'](_0xf79e28,'submit',(_0x414e3c,_0x497c43)=>{this['prompt']=_0x497c43;const _0x50d946=_0x2fa763(_0x497c43);this['fire']('submitPrompt',_0x50d946),_0x497c43['trim']()&&this['_promptHistory']['add']({'prompt':_0x50d946},0x0);},{'priority':'high'}),_0xf79e28;}['_createHistoryView'](){const _0x88fa8d=new Mi(this['locale']);return _0x88fa8d['historyGroupView']['items']['bindTo'](this['_promptHistory'])['as'](Ui),_0x88fa8d['on']('clearHistory',()=>{this['_promptHistory']['clear'](),this['promptView']['search'](''),this['promptView']['focus']();}),_0x88fa8d;}['_createToolbar'](){const _0xeb265a=new xi(this['locale']);return _0xeb265a['replaceButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x5bca85,_0x3e74ee,_0x4f8df3)=>_0x5bca85&&!_0x3e74ee&&!!_0x4f8df3),_0xeb265a['replaceButton']['delegate']('execute')['to'](this,'replaceContent'),_0xeb265a['insertButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x605258,_0x4975d5,_0x104327)=>_0x605258&&!_0x4975d5&&!!_0x104327),_0xeb265a['insertButton']['delegate']('execute')['to'](this,'insertContentBelow'),_0xeb265a['tryAgainButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x2e4eb5,_0x2d8b05)=>_0x2e4eb5&&!_0x2d8b05),_0xeb265a['tryAgainButton']['delegate']('execute')['to'](this,'tryAgainEvent'),_0xeb265a['stopButton']['bind']('isEnabled')['to'](this,'isProcessing'),_0xeb265a['stopButton']['delegate']('execute')['to'](this,'stopProcessing'),_0xeb265a;}['startProcessing'](){this['value']='',this['isError']=!0x1,this['isProcessing']=!0x0,this['contentArea']['isVisible']=!0x0,this['toolbar']['isVisible']=!0x0,this['contentArea']['focus']();}['finishProcessing'](){const _0x2495f9=this['locale'];this['isProcessing']=!0x1,this['prompt']='',this['promptView']['reset'](),this['value']&&(this['promptView']['queryView']['label']=Ri(_0x2495f9,'Ask\x20AI\x20to\x20improve\x20generated\x20text'));}['handleError'](_0x42e0bc){const _0x5b2f0b=this['locale'];this['finishProcessing'](),this['isError']=!0x0,this['errorView']['text']=_0x42e0bc||Ri(_0x5b2f0b,'AI_ERROR_FAILED'),this['value']||(this['contentArea']['isVisible']=!0x1);}}const Ki=globalThis['DataTransfer'];class Wi extends _0x2db8aa{['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[_0x538780,fi,Si,Vt];}constructor(_0xf1f59a){super(_0xf1f59a),_0xf1f59a['config']['define']('ai.assistant.disabledElements',['media','rawHtml','tableOfContents']),_0xf1f59a['config']['define']('ai.assistant.contentAreaCssClass',''),_0xf1f59a['config']['define']('ai.assistant.useTheme',!0x0),this['_uiCssClasses']='ck-ai-assistant-ui'+(_0xf1f59a['config']['get']('ai.assistant.useTheme')?'\x20ck-ai-assistant-ui_theme':'');}['init'](){const {editor:_0x28e1bb}=this;this['_aiAdapter']=_0x28e1bb['plugins']['get'](Si),this['_dialog']=_0x28e1bb['plugins']['get'](Vt),this['_formView']=null,this['_commandDefinitions']=this['_getResolvedCommandsDefinitions']();const _0x1319f4=new Oi(_0x28e1bb,Array['from'](this['_commandDefinitions']['values']()));_0x28e1bb['commands']['add']('showAIAssistant',_0x1319f4),_0x28e1bb['ui']['componentFactory']['add']('aiCommands',_0x4f6452=>{const _0x218809=Bt(_0x4f6452);return _0x218809['set']({'class':'ck-ai-commands-dropdown\x20'+this['_uiCssClasses']}),_0x218809['buttonView']['set']({'label':Ri(_0x4f6452,'AI\x20Commands'),'icon':_0x171239,'tooltip':!0x0}),_0x218809['on']('execute',_0x3746fb=>this['_onExecute'](_0x3746fb['source']['id'])),Gt(_0x218809,_0x28e1bb['ui']['view']['body'],function(_0x53a405){const _0x15c994=mi(_0x53a405['config']['get']('ai.assistant.commands'),_0x53a405['locale']),_0x329173=$i(_0x53a405,_0x15c994)['filter'](_0x7adf20=>_0x7adf20['commands']['length']);if(0x1===_0x329173['length'])return $i(_0x53a405,_0x329173[0x0]['commands'])['map'](_0x234e28=>({'id':_0x234e28['id'],'label':_0x234e28['label']}));return _0x329173['map'](_0xc04025=>{const {groupId:_0x21ebc6,groupLabel:_0x2dc048,commands:_0x3f4e6e}=_0xc04025,_0x30f2ce=$i(_0x53a405,_0x3f4e6e)['map'](_0x420a9a=>({'id':_0x420a9a['id'],'label':_0x420a9a['label']}));return{'id':_0x21ebc6,'menu':_0x2dc048||_0x21ebc6,'children':_0x30f2ce};});}(_0x28e1bb),{'ariaLabel':Ri(_0x4f6452,'AI\x20Commands')}),_0x218809['menuView']['menuPanelClass']='ck-ai-commands-dropdown\x20'+this['_uiCssClasses'],_0x1319f4['on']('change:enabledCommandsIds',_0x21c8d2),_0x218809['menuView']['once']('render',_0x21c8d2),_0x218809;function _0x21c8d2(){_0x218809['isEnabled']=_0x1319f4['enabledCommandsIds']['length']>0x0;for(const _0x15cead of _0x218809['menuView']['buttons'])_0x15cead['isEnabled']=_0x1319f4['enabledCommandsIds']['includes'](_0x15cead['id']);}}),_0x28e1bb['ui']['componentFactory']['add']('menuBar:aiCommands',_0x5069f1=>{const _0x5d024e=new Ft(_0x5069f1);_0x5d024e['buttonView']['set']({'label':Ri(_0x5069f1,'AI\x20Commands'),'icon':_0x171239}),_0x5d024e['bind']('isEnabled')['to'](_0x1319f4,'enabledCommandsIds',_0x1e02d1=>_0x1e02d1['length']>0x0);const _0x5ede44=mi(_0x28e1bb['config']['get']('ai.assistant.commands'),_0x5069f1);return this['_populateMenuBarMenu'](_0x1319f4,_0x5d024e,_0x5ede44,_0x1c527d=>this['_onExecute'](_0x1c527d)),_0x5d024e;}),_0x28e1bb['ui']['componentFactory']['add']('aiAssistant',()=>{const _0x2bfed4=this['_createAIAssistantUIButton'](kt);return _0x2bfed4['set']({'tooltip':!0x0,'class':'ck-ai-assistant-button\x20'+this['_uiCssClasses']}),_0x2bfed4;}),_0x28e1bb['ui']['componentFactory']['add']('menuBar:aiAssistant',()=>{const _0x50f173=this['_createAIAssistantUIButton'](Kt);return _0x50f173['set']({'role':'menuitemcheckbox'}),_0x50f173;}),this['licenseKey']=this['editor']['config']['get']('licenseKey');const _0x13c06e=this['editor'];this['_licenseKeyCheckInterval']=setInterval(()=>{let _0x34b23e;for(const _0x366550 in _0x13c06e){const _0x4bad1e=_0x366550,_0x432034=_0x13c06e[_0x4bad1e];if('aiLicenseKeyValid'==_0x432034||'aiLicenseKeyInvalid'==_0x432034||'aiLicenseKeyExpired'==_0x432034||'aiLicenseKeyDomainLimit'==_0x432034||'aiLicenseKeyNotAllowed'==_0x432034||'aiLicenseKeyEvaluationLimit'==_0x432034||'aiLicenseKeyUsageLimit'==_0x432034){delete _0x13c06e[_0x4bad1e],_0x34b23e=_0x432034,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'aiLicenseKeyInvalid'==_0x34b23e&&_0x13c06e['_showLicenseError']('invalid'),'aiLicenseKeyExpired'==_0x34b23e&&_0x13c06e['_showLicenseError']('expired'),'aiLicenseKeyDomainLimit'==_0x34b23e&&_0x13c06e['_showLicenseError']('domainLimit'),'aiLicenseKeyNotAllowed'==_0x34b23e&&_0x13c06e['_showLicenseError']('featureNotAllowed','AIAssistant'),'aiLicenseKeyEvaluationLimit'==_0x34b23e&&_0x13c06e['_showLicenseError']('evaluationLimit'),'aiLicenseKeyUsageLimit'==_0x34b23e&&_0x13c06e['_showLicenseError']('usageLimit');},0x3e8);}['destroy'](){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}['showUI'](_0x33db69='',_0x10be4c='',_0x54b9ad='custom'){const _0xbdcdd8=this['editor'],_0x1e1097=_0xbdcdd8['editing']['view'],_0x23fade=_0xbdcdd8['plugins']['get'](fi),_0x334bdb=_0xbdcdd8['plugins']['get'](_0x538780);_0x23fade['showFakeVisualSelection']();const _0x3391dd=new Ki(),_0x456aa0=new ClipboardEvent('copy',{'clipboardData':_0x3391dd}),_0x16fb9b=new _0x40cdb0(_0x3391dd),_0x50b133=new _0x116501(_0x1e1097,_0x456aa0,{'dataTransfer':_0x16fb9b});_0x334bdb['_forceMarkersCopy']('comment',()=>{_0x1e1097['document']['fire']('copy',_0x50b133);}),this['_formView']||(this['_initView'](),this['_aiAssistantController']=new vi(_0xbdcdd8,this['_aiAdapter']['textAdapter'],this['_formView']));let _0xd8137c=_0x16fb9b['getData']('text/html');const _0x1bb9f8=_0xbdcdd8['model']['document']['selection'],_0xd70f06=Array['from'](_0x1bb9f8['getRanges']());0x1===_0xd70f06['length']&&_0xd70f06[0x0]['isFlat']&&!_0x1bb9f8['getSelectedElement']()&&''!==_0xd8137c['replace'](/ /g,'')['trim']()&&(_0xd8137c='<p>'+_0xd8137c+'</p>'),this['_aiAssistantController']['updateView']({'actionId':_0x54b9ad,'query':_0x33db69,'htmlContent':_0xd8137c,'label':_0x10be4c,'mainActionLabel':yi[_0xbdcdd8['model']['document']['selection']['isCollapsed']?'INSERT':'REPLACE']}),'aiAssistant'!==this['_dialog']['id']?this['_dialog']['show']({'id':'aiAssistant','icon':_0x5e1e81,'title':Ri(this['editor']['locale'],'AI\x20Assistant'),'content':this['_formView'],'position':Wt['EDITOR_TOP_SIDE'],'onShow':()=>{this['_formView']['focus']();},'onHide':()=>{this['_aiAssistantController']['reset'](),_0x23fade['hideFakeVisualSelection']();}}):this['_dialog']['view']['wasMoved']||this['_dialog']['view']['updatePosition']();}['hideUI'](){this['_dialog']['hide']();}['_getResolvedCommandsDefinitions'](){const _0x55d643=new Map(),_0x5211b9=mi(this['editor']['config']['get']('ai.assistant.commands'),this['editor']['locale']);for(const _0x4a2be6 of _0x5211b9)for(const _0x5abbf2 of _0x4a2be6['commands'])_0x55d643['set'](_0x5abbf2['id'],{..._0x5abbf2,'groupId':_0x4a2be6['groupId'],'groupLabel':_0x4a2be6['groupLabel']||_0x4a2be6['groupId']});return _0x55d643;}['_createAIAssistantUIButton'](_0x2dce12){const _0x19b90a=this['editor'],_0x251b66=_0x19b90a['commands']['get']('showAIAssistant'),_0x164abf=new _0x2dce12(_0x19b90a['locale']);return _0x164abf['set']({'label':Ri(_0x19b90a['locale'],'AI\x20Assistant'),'icon':_0x5e1e81,'isToggleable':!0x0}),_0x164abf['bind']('isEnabled')['to'](_0x251b66),_0x164abf['bind']('isOn')['to'](this['_dialog'],'id',_0x42a569=>'aiAssistant'===_0x42a569),this['listenTo'](_0x164abf,'execute',()=>{_0x164abf['isOn']?this['hideUI']():_0x251b66['execute']();}),_0x164abf;}['_initView'](){const _0x3cc4dd=this['editor']['plugins']['get'](fi);this['_formView']=new Fi(this['editor']['locale'],this['_uiCssClasses'],this['editor']['config']['get']('ai.assistant.contentAreaCssClass')),this['_formView']['on']('change:value',()=>{this['_dialog']['view']['wasMoved']||this['_dialog']['view']['updatePosition']();}),this['_formView']['promptView']['queryView']['fieldView']['on']('update',()=>{this['_dialog']['view']['wasMoved']||this['_dialog']['view']['updatePosition']();}),this['listenTo'](this['_formView'],'replaceContent',()=>{_0x3cc4dd['insertContent'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['listenTo'](this['_formView'],'insertContentBelow',()=>{_0x3cc4dd['insertContentBelow'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['_initAriaAiStatusChangeAnnouncements']();}['_initAriaAiStatusChangeAnnouncements'](){const {locale:_0x382ccf,ui:{ariaLiveAnnouncer:_0x5b9b24}}=this['editor'];this['_formView']['contentArea']['on']('change:isProcessing',(_0xe03ff6,_0x4b1c2c,_0x1f619a)=>{const _0x413fa0=this['_aiAssistantController']['currentContext'];_0x1f619a?_0x5b9b24['announce'](Ri(_0x382ccf,'AI\x20is\x20writing')):_0x413fa0&&_0x5b9b24['announce'](Ri(_0x382ccf,'Generated\x20content:\x20%0',_0x413fa0),{'politeness':'polite','isUnsafeHTML':!0x0});}),this['_formView']['on']('change:isError',(_0x5572be,_0x2717df,_0x35df0a)=>{if(_0x35df0a){const _0x61bd19=this['_formView']['errorView']['text'];_0x5b9b24['announce'](Ri(_0x382ccf,'Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x61bd19));}});}['_onExecute'](_0x248403){const _0x523a33=this['_commandDefinitions']['get'](_0x248403),_0xccd07b=this['editor'],_0x53e25d=_0xccd07b['model']['document']['selection'],_0x4e5358=_0xccd07b['commands']['get']('showAIAssistant'),_0x128daa=_0xccd07b['plugins']['get'](fi),_0x570c98=''+(_0x523a33['groupId']!==pi?_0x523a33['groupLabel']+':\x20':'')+_0x523a33['label'];if(!0x1!==_0x523a33['requiresContent']&&_0x53e25d['isCollapsed']){const _0x3c831a=gt(_0x53e25d['getSelectedBlocks']())||_0xccd07b['model']['schema']['getLimitElement'](_0x53e25d);_0xccd07b['model']['change'](_0x122287=>{_0x122287['setSelection'](_0x3c831a,'in');});}_0x128daa['showFakeVisualSelection'](),_0x4e5358['execute'](_0x523a33['prompt'],_0x570c98,'command:'+_0x248403);}['_populateMenuBarMenu'](_0x274bf0,_0x202476,_0x1d9695,_0x1d57ab){const _0x1de1bd=this['editor'],_0x477770=_0x1de1bd['locale'],_0x42b40d=new Yt(_0x477770),_0x728263=$i(_0x1de1bd,_0x1d9695)['filter'](_0x1b9e2d=>_0x1b9e2d['commands']['length']);0x1===_0x728263['length']?this['_getMenuBarGroupButtons']({'command':_0x274bf0,'commands':_0x728263[0x0]['commands'],'parentMenuView':_0x202476,'onExecute':_0x1d57ab})['forEach'](_0x237cd8=>_0x42b40d['items']['add'](_0x237cd8)):_0x728263['forEach'](({groupId:_0x2a3efa,groupLabel:_0x59d9ef,commands:_0x36ed34})=>{const _0x5179da=new $t(_0x477770,_0x202476),_0x13e808=new Ft(_0x477770),_0x462db7=new Yt(_0x477770),_0xdc7729=this['_getMenuBarGroupButtons']({'command':_0x274bf0,'commands':_0x36ed34,'parentMenuView':_0x13e808,'onExecute':_0x1d57ab});_0x13e808['buttonView']['set']({'label':_0x59d9ef||_0x2a3efa}),_0x13e808['delegate']('execute')['to'](_0x202476),_0x462db7['items']['addMany'](_0xdc7729),_0x13e808['panelView']['children']['add'](_0x462db7),_0x5179da['children']['add'](_0x13e808),_0x42b40d['items']['add'](_0x5179da);}),_0x202476['panelView']['children']['add'](_0x42b40d);}['_getMenuBarGroupButtons']({command:_0x3e1a6c,commands:_0x1e0663,parentMenuView:_0x36067c,onExecute:_0x4e04d3}){const _0x1763e6=this['editor'],_0x323616=_0x1763e6['locale'];return $i(_0x1763e6,_0x1e0663)['map'](_0xfaf888=>{const _0x28000d=new $t(_0x323616,_0x36067c),_0x5ced33=new Kt(_0x323616);return _0x5ced33['set']({'label':_0xfaf888['label']}),_0x5ced33['delegate']('execute')['to'](_0x36067c),_0x5ced33['on']('execute',()=>_0x4e04d3(_0xfaf888['id'])),_0x5ced33['bind']('isEnabled')['to'](_0x3e1a6c,'enabledCommandsIds',_0x17411a=>_0x17411a['includes'](_0xfaf888['id'])),_0x28000d['children']['add'](_0x5ced33),_0x28000d;});}}function Yi(_0x43dd0b,_0x53ee36){return void 0x0!==_0x43dd0b['order']&&void 0x0===_0x53ee36['order']?0x1:void 0x0===_0x43dd0b['order']&&void 0x0!==_0x53ee36['order']?-0x1:void 0x0!==_0x43dd0b['order']&&void 0x0!==_0x53ee36['order']?_0x43dd0b['order']-_0x53ee36['order']:0x0;}function $i(_0x185574,_0x1de44e){_0x1de44e['sort'](Yi);const _0x29421a={},_0xfee4ee=[];for(const _0x406430 of _0x1de44e)if(void 0x0!==_0x406430['order']){if(_0x406430['order']in _0x29421a)throw new ot('ai-commands-config-order-collision',_0x185574,{'conflictingDefinitions':[_0x406430,_0x29421a[_0x406430['order']]]});_0x29421a[_0x406430['order']]=_0x406430,_0xfee4ee['splice'](_0x406430['order'],0x0,_0x406430);}else _0xfee4ee['push'](_0x406430);return _0xfee4ee;}class qi extends _0x2db8aa{static get['requires'](){return[Wi,fi];}static get['pluginName'](){return'AIAssistant';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x319fd7){super(_0x319fd7);const _0x5796b7=_0x319fd7['config'],_0x2b145e=_0x319fd7['locale'];_0x5796b7['define']('ai.assistant.preserveComments',!0x0),_0x5796b7['define']('ai.assistant.commands',Qi(_0x2b145e)),_0x5796b7['define']('ai.assistant.extraCommandGroups',[]),_0x5796b7['define']('ai.assistant.removeCommands',[]);let _0x1e567f=mi(_0x5796b7['get']('ai.assistant.commands'),_0x2b145e);const _0x26d0a2=_0x5796b7['get']('ai.assistant.extraCommandGroups'),_0x2afa81=_0x5796b7['get']('ai.assistant.removeCommands');_0x26d0a2['forEach'](_0x5a75b3=>{const _0x3b2cf8=_0x1e567f['find'](_0x24f15a=>_0x24f15a['groupId']===_0x5a75b3['groupId']);_0x3b2cf8?_0x3b2cf8['commands']=_0x3b2cf8['commands']['concat'](_0x5a75b3['commands']):_0x1e567f['push'](_0x5a75b3);}),_0x1e567f=_0x1e567f['filter'](_0x463b26=>!_0x2afa81['includes'](_0x463b26['groupId'])),_0x1e567f['forEach'](_0x1acc00=>{_0x1acc00['commands']=_0x1acc00['commands']['filter'](_0x293b09=>!_0x2afa81['includes'](_0x293b09['id']));}),_0x5796b7['set']('ai.assistant.commands',_0x1e567f);}}function Qi(_0x119562){return[{'groupId':'editOrReview','groupLabel':Ri(_0x119562,'Edit\x20or\x20review'),'commands':[{'id':'improveWriting','label':Ri(_0x119562,'Improve\x20writing'),'prompt':'Fix\x20spelling\x20mistakes,\x20use\x20proper\x20grammar\x20and\x20apply\x20good\x20writing\x20practices.\x20Do\x20not\x20lose\x20the\x20original\x20meaning.'},{'id':'makeShorter','label':Ri(_0x119562,'Make\x20shorter'),'prompt':'Remove\x20any\x20repetitive,\x20redundant,\x20or\x20non-essential\x20writing\x20in\x20this\x20content\x20without\x20changing\x20the\x20meaning\x20or\x20losing\x20any\x20key\x20information.'},{'id':'makeLonger','label':Ri(_0x119562,'Make\x20longer'),'prompt':'Improve\x20this\x20content\x20by\x20using\x20descriptive\x20language\x20and\x20inserting\x20more\x20information\x20and\x20more\x20detailed\x20explanations.'},{'id':'simplifyLanguage','label':Ri(_0x119562,'Simplify\x20language'),'prompt':'Simplify\x20the\x20writing\x20style\x20of\x20this\x20content\x20and\x20reduce\x20the\x20complexity,\x20so\x20that\x20the\x20content\x20is\x20easy\x20to\x20understand.'}]},{'groupId':'generate','groupLabel':Ri(_0x119562,'Generate\x20from\x20selection'),'commands':[{'id':'summarize','label':Ri(_0x119562,'Summarize'),'prompt':'Summarize\x20this\x20content\x20into\x20one\x20paragraph\x20of\x20text.\x20Include\x20only\x20the\x20key\x20ideas\x20and\x20conclusions.\x20Keep\x20it\x20short.\x20Do\x20not\x20keep\x20original\x20text\x20formatting.'},{'id':'continue','label':Ri(_0x119562,'Continue'),'prompt':'Start\x20with\x20the\x20provided\x20content\x20and\x20write\x20at\x20the\x20end\x20of\x20it\x20continuing\x20this\x20topic.\x20Keep\x20the\x20added\x20part\x20short.'}]},{'groupId':'changeTone','groupLabel':Ri(_0x119562,'Change\x20tone'),'commands':[{'id':'professional','label':Ri(_0x119562,'Professional'),'prompt':'Improve\x20using\x20polished,\x20formal,\x20and\x20respectful\x20language\x20to\x20convey\x20professional\x20expertise\x20and\x20competence.'},{'id':'casual','label':Ri(_0x119562,'Casual'),'prompt':'Improve\x20using\x20casual,\x20informal\x20language\x20to\x20convey\x20a\x20casual\x20conversation\x20with\x20a\x20real\x20person.'},{'id':'direct','label':Ri(_0x119562,'Direct'),'prompt':'Improve\x20using\x20direct\x20language,\x20using\x20only\x20the\x20essential\x20information.'},{'id':'confident','label':Ri(_0x119562,'Confident'),'prompt':'Improve\x20using\x20compelling,\x20optimistic\x20language\x20to\x20convey\x20confidence\x20in\x20the\x20writing.'},{'id':'friendly','label':Ri(_0x119562,'Friendly'),'prompt':'Improve\x20using\x20friendly,\x20comforting\x20language,\x20to\x20convey\x20understanding\x20and\x20empathy.'}]},{'groupId':'changeStyle','groupLabel':Ri(_0x119562,'Change\x20style'),'commands':[{'id':'business','label':Ri(_0x119562,'Business'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20business\x20professional\x20with\x20formal\x20language.'},{'id':'legal','label':Ri(_0x119562,'Legal'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20legal\x20professional\x20using\x20valid\x20legal\x20terminology.'},{'id':'journalism','label':Ri(_0x119562,'Journalism'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20journalist\x20using\x20engaging\x20language\x20to\x20convey\x20the\x20importance\x20of\x20the\x20information.'},{'id':'poetic','label':Ri(_0x119562,'Poetic'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20poem\x20using\x20poetic\x20techniques\x20without\x20losing\x20the\x20original\x20meaning.'}]},{'groupId':'translate','groupLabel':Ri(_0x119562,'Translate'),'commands':[{'id':'translateEnglish','label':Ri(_0x119562,'English'),'prompt':'Translate\x20the\x20content\x20to\x20English\x20language.'},{'id':'translateSpanish','label':Ri(_0x119562,'Spanish'),'prompt':'Translate\x20the\x20content\x20to\x20Spanish\x20language.'},{'id':'translatePortuguese','label':Ri(_0x119562,'Portuguese'),'prompt':'Translate\x20the\x20content\x20to\x20Portuguese\x20language.'},{'id':'translateGerman','label':Ri(_0x119562,'German'),'prompt':'Translate\x20the\x20content\x20to\x20German\x20language.'},{'id':'translateFrench','label':Ri(_0x119562,'French'),'prompt':'Translate\x20the\x20content\x20to\x20French\x20language.'},{'id':'translateChinese','label':Ri(_0x119562,'Simplified\x20Chinese'),'prompt':'Translate\x20the\x20content\x20to\x20Simplified\x20Chinese\x20language.'},{'id':'translateHindi','label':Ri(_0x119562,'Hindi'),'prompt':'Translate\x20the\x20content\x20to\x20Hindi\x20language.'},{'id':'translateArabic','label':Ri(_0x119562,'Arabic'),'prompt':'Translate\x20the\x20content\x20to\x20Arabic\x20language.'}]}];}class Xi extends _0x2db8aa{['abortController'];static get['requires'](){return[Si];}constructor(_0x253ad7){super(_0x253ad7),this['abortController']=new AbortController();}['init'](){this['editor']['plugins']['get'](Si)['textAdapter']=this;}['abort'](){this['abortController']['signal']['aborted']||(this['abortController']['abort'](),this['abortController']=new AbortController());}async['makeRequest'](_0x4084b1){return this['sendRequest'](_0x4084b1)['catch'](_0xc8127f=>{if(_0xc8127f instanceof bi)return Promise['reject'](_0xc8127f);if('AbortError'==_0xc8127f['name'])return Promise['resolve']();throw console['error'](_0xc8127f),new ot('aitextadapter-send-request-failed',null);});}async['_prepareRequestHeaders'](_0x1aae72,_0x55fe4c){const _0x3d7e1c=this['editor']['locale'],_0x1d480={'Content-Type':'application/json'};if('object'==typeof _0x1aae72)Object['assign'](_0x1d480,_0x1aae72);else{if(_0x1aae72)try{const _0x38bce7=await _0x1aae72(_0x55fe4c);Object['assign'](_0x1d480,_0x38bce7);}catch{return Promise['reject'](new bi(Ri(_0x3d7e1c,'AI_ERROR_GET_HEADERS')));}}return _0x1d480;}async['_prepareRequestParameters'](_0x368197,_0x2e85b8){const _0x2c486a=this['editor']['locale'];if('object'==typeof _0x368197)return _0x368197;try{return await _0x368197(_0x2e85b8);}catch{return Promise['reject'](new bi(Ri(_0x2c486a,'AI_ERROR_GET_PARAMETERS')));}}}class zi extends Xi{['_apiUrl'];['_requestHeaders'];['_requestParameters'];static get['pluginName'](){return'OpenAITextAdapter';}constructor(_0x457a87){super(_0x457a87),_0x457a87['config']['define']('ai.assistant.adapter.openAI.apiUrl','https://api.openai.com/v1/chat/completions'),_0x457a87['config']['get']('ai.assistant.adapter.openAI.requestParameters')||_0x457a87['config']['define']('ai.assistant.adapter.openAI.requestParameters',{'model':'gpt-4o','temperature':0x1,'top_p':0x1,'stream':!0x0}),this['_apiUrl']=_0x457a87['config']['get']('ai.assistant.adapter.openAI.apiUrl'),this['_requestHeaders']=_0x457a87['config']['get']('ai.assistant.adapter.openAI.requestHeaders')||{},this['_requestParameters']=_0x457a87['config']['get']('ai.assistant.adapter.openAI.requestParameters');}async['sendRequest']({query:_0x30e43e,context:_0x24f21d,onData:_0x5bc14b,actionId:_0x162d20}){const _0x31e4db=this['editor']['locale'],_0x6f4541=await this['prepareMessages'](_0x30e43e,_0x24f21d,_0x162d20),_0x3c092e=await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x162d20),_0x526892=await this['_prepareRequestParameters'](this['_requestParameters'],_0x162d20),_0x3e3200={'messages':_0x6f4541,..._0x526892},_0x1e794a={'method':'POST','headers':_0x3c092e,'body':JSON['stringify'](_0x3e3200),'signal':this['abortController']['signal']},_0xf27361=await fetch(this['_apiUrl'],_0x1e794a);if(_0xf27361['ok'])return _0x526892['stream']?await this['_readStreamableResponse'](_0xf27361,_0x5bc14b):await this['_readStaticResponse'](_0xf27361,_0x5bc14b),Promise['resolve']();{const _0x40ce7e=await _0xf27361['text']();return _0x40ce7e['includes']('context_length_exceeded')?Promise['reject'](new bi(Ri(_0x31e4db,'AI_ERROR_CONTEXT_LENGTH'))):_0x40ce7e['includes']('Moderation')?Promise['reject'](new bi(Ri(_0x31e4db,'AI_ERROR_MODERATION'))):Promise['reject'](new Error(_0x40ce7e));}}async['prepareMessages'](_0x2c1998,_0x4196e5,_0x32fda6){let _0x436755,_0x2ee514;return _0x4196e5?(_0x436755='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.',_0x2ee514='Instruction:\x0a'+_0x2c1998+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x4196e5):(_0x436755='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.',_0x2ee514=_0x2c1998),[{'role':'system','content':_0x436755},{'role':'user','content':_0x2ee514}];}async['_readStreamableResponse'](_0x409e60,_0x523ecd){const _0x2ac11b=_0x409e60['body']['getReader'](),_0x5cdd56=new TextDecoder();let _0x17b34c='',_0x55df04='',_0xd8cceb='',_0x181bf3=!0x1;for(;!_0x181bf3;){const {done:_0x3abcee,value:_0x379ec1}=await _0x2ac11b['read'](),_0x4ec175=_0x17b34c+_0x5cdd56['decode'](_0x379ec1);let _0x4580a0='';_0x181bf3=_0x3abcee;try{_0x4580a0=this['_cleanUpData'](_0x4ec175),_0x17b34c='';}catch{_0x17b34c=_0x4ec175;continue;}_0x55df04+=_0x4580a0,!_0x181bf3&&this['_isBufferIncomplete'](_0x55df04)||_0x55df04&&(_0xd8cceb+=_0x55df04,_0x55df04='',_0x523ecd(_0xd8cceb));}return Promise['resolve']();}async['_readStaticResponse'](_0x4adea5,_0x59c957){return _0x59c957((await _0x4adea5['json']())['choices'][0x0]['message']['content']),Promise['resolve']();}['_isBufferIncomplete'](_0x3ed199){const _0x350701=_0x3ed199['split']('<')['length']!==_0x3ed199['split']('>')['length'],_0x3310da=_0x3ed199['length']<0x1e;return _0x350701&&_0x3310da;}['_cleanUpData'](_0x14ff3e){return _0x14ff3e['split'](/\n(?![^{]*\})/g)['map'](_0x9f2d21=>_0x9f2d21['replace']('data:\x20',''))['filter'](_0x5993be=>_0x5993be&&_0x5993be['length']>0x0&&'[DONE]'!==_0x5993be)['map'](_0x2f35be=>{const {choices:_0x301291}=JSON['parse'](_0x2f35be);if(_0x301291[0x0]?.['delta']?.['content'])return _0x301291[0x0]['delta']['content'];})['filter'](_0x413ff6=>_0x413ff6)['join']('');}}class ji extends Xi{static get['pluginName'](){return'AWSTextAdapter';}['init'](){super['init'](),It('ai-aws-adapter-not-supported');}async['sendRequest'](_0x454780){throw Et('ai-aws-adapter-not-supported'),new bi(Ri(this['editor']['locale'],'AI_ERROR_AWS_NOT_SUPPORTED'));}}class Ji extends kt{constructor(_0x4151aa,_0x5138c9={}){super(_0x4151aa),this['isToggleable']=!0x0,this['set']('side',_0x5138c9['side']||'top');const _0xdfcb60=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-tab-button',...Tt(_0x5138c9['class']||[]),_0xdfcb60['to']('side',_0x52a4d1=>'ck-tab-button_'+_0x52a4d1),_0xdfcb60['to']('class')]}});}['show'](){this['set']('isVisible',!0x0);}['hide'](){this['set']('isVisible',!0x1);}}class Zi extends Nt{['children'];constructor(_0xe8a246,_0x22d8a6={}){super(_0xe8a246);const _0x4481f1=this['bindTemplate'];this['set']('isVisible',!0x1),this['set']('class',''),this['children']=this['createCollection'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck-tab-panel',...Tt(_0x22d8a6['class']||[]),_0x4481f1['to']('class'),_0x4481f1['if']('isVisible','ck-hidden',_0x3b235c=>!_0x3b235c)]},'children':this['children']});}['show'](){this['set']('isVisible',!0x0);}['hide'](){this['set']('isVisible',!0x1);}}class ts extends Nt{['buttonViews']=this['createCollection']();['panelViews']=this['createCollection']();['_tabs']=new Map();constructor(_0x52e668,_0x81f0c2={}){super(_0x52e668),this['set']('class',void 0x0),this['set']('activeTab',null),this['set']('side',_0x81f0c2['side']||'top'),this['set']('isMaximized',!0x1);const _0x2ecb9c=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset','ck-tabs',...Tt(_0x81f0c2['class']||[]),_0x2ecb9c['to']('side',_0x19e7a0=>'ck-tabs_'+_0x19e7a0),_0x2ecb9c['to']('class'),_0x2ecb9c['to']('isMaximized',_0x3f4e5a=>_0x3f4e5a?'ck-ai-tabs_maximized':'')],'tabindex':'0'},'children':[{'tag':'div','attributes':{'class':['ck','ck-tabs__buttons-container',_0x2ecb9c['to']('side',_0x445080=>'ck-tabs__buttons-container_'+_0x445080)]},'children':this['buttonViews']},{'tag':'div','attributes':{'class':['ck','ck-tabs__panels-container',_0x2ecb9c['to']('side',_0x50936c=>'ck-tabs__panels-container_'+_0x50936c)]},'children':this['panelViews']},...Tt(_0x81f0c2['children']||[])]});}['getTabIds'](){return[...this['_tabs']['keys']()];}['getTab'](_0x112ac2){const _0x3de940=this['_tabs']['get'](_0x112ac2);return _0x3de940||null;}['addTab'](_0x70b1a8){const _0x473840=this['_setupButton']({'id':_0x70b1a8['id'],'label':_0x70b1a8['buttonLabel'],'icon':_0x70b1a8['buttonIcon'],'order':_0x70b1a8['order']}),_0x120d75=new Zi(this['locale']);return _0x120d75['render'](),_0x70b1a8['content']&&_0x120d75['children']['add'](_0x70b1a8['content']),this['panelViews']['add'](_0x120d75),this['_tabs']['set'](_0x70b1a8['id'],{'button':_0x473840,'panel':_0x120d75,'order':void 0x0!==_0x70b1a8['order']?_0x70b1a8['order']:null}),this['fire']('addTab:'+_0x70b1a8['id'],{'id':_0x70b1a8['id'],'button':_0x473840,'panel':_0x120d75}),null===this['activeTab']?this['activateTab'](_0x70b1a8['id']):this['_hidePanel'](_0x70b1a8['id']),{'button':_0x473840,'panel':_0x120d75};}['activateTab'](_0x67490e){if(null!==_0x67490e&&!this['getTab'](_0x67490e))throw new ot('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0x67490e});this['activeTab']!==_0x67490e&&(this['activeTab']&&this['_hidePanel'](this['activeTab']),this['activeTab']=_0x67490e,_0x67490e&&this['_showPanel'](_0x67490e),this['fire']('activateTab:'+_0x67490e,_0x67490e));}['showTab'](_0x2c4da1){if(!this['getTab'](_0x2c4da1))throw new ot('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0x2c4da1});this['_showPanel'](_0x2c4da1),this['_showButton'](_0x2c4da1),this['fire']('show:'+_0x2c4da1,_0x2c4da1);}['hideTab'](_0x6ada2d){if(!this['getTab'](_0x6ada2d))throw new ot('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0x6ada2d});const _0xeb6b4b=this['activeTab'];this['_hidePanel'](_0x6ada2d),this['_hideButton'](_0x6ada2d);const _0x3a8afa=this['getTabIds']();_0xeb6b4b===_0x6ada2d&&_0x3a8afa['length']>0x1&&this['activateTab'](_0x3a8afa['find'](_0x830d17=>_0x830d17!==_0x6ada2d)),this['fire']('hide:'+_0x6ada2d,_0x6ada2d);}['_getPanel'](_0x20ed9f){const _0x34e51a=this['_tabs']['get'](_0x20ed9f);return _0x34e51a?_0x34e51a['panel']:null;}['_showPanel'](_0x3ab36b){null!==this['activeTab']&&this['activeTab']!==_0x3ab36b||this['_getPanel'](_0x3ab36b)['show']();}['_hidePanel'](_0x237941){const _0x2d5d4b=this['_getPanel'](_0x237941);_0x2d5d4b['isVisible']&&(this['activeTab']===_0x237941&&(this['activeTab']=null),_0x2d5d4b['hide']());}['_getButton'](_0x440aaa){const _0x25d734=this['_tabs']['get'](_0x440aaa);return _0x25d734?_0x25d734['button']:null;}['_showButton'](_0x1cae02){this['_getButton'](_0x1cae02)['show']();}['_hideButton'](_0xbcd415){this['_getButton'](_0xbcd415)['hide']();}['_setupButton'](_0x2e2299){const _0x4fba6d=new Ji(this['locale'],{'side':this['side']}),_0xbefc39=this['buttonViews'];if(_0x4fba6d['set']({'label':_0x2e2299['label'],'icon':_0x2e2299['icon'],'tooltip':!0x0,'withText':!0x0}),_0x4fba6d['bind']('isOn')['to'](this,'activeTab',_0x5b5a34=>_0x5b5a34===_0x2e2299['id']),_0x4fba6d['bind']('side')['to'](this,'side'),_0x2e2299['order']){const _0x5e784c=[...this['_tabs']]['reduce']((_0x4e49a9,_0x5cf8b9)=>{const _0x161ebf=_0x5cf8b9[0x0],{order:_0x273ab9}=_0x5cf8b9[0x1];return!_0x273ab9||_0x273ab9>_0x2e2299['order']?_0x4e49a9:_0x273ab9>=_0x4e49a9['order']?{'id':_0x161ebf,'order':_0x273ab9}:_0x4e49a9;},{'id':'','order':0x0}),_0x34affd=_0xbefc39['getIndex'](this['_getButton'](_0x5e784c['id']));_0xbefc39['add'](_0x4fba6d,_0x34affd+0x1);}else _0xbefc39['add'](_0x4fba6d);return _0x4fba6d['on']('execute',()=>{this['activateTab'](_0x2e2299['id']);}),_0x4fba6d;}}const es=['overlay','sidebar','custom'],is=['left','right'];class ss extends ts{constructor(_0x41f83f,_0xe48a6a={}){super(_0x41f83f,_0xe48a6a),this['set']('type',_0xe48a6a['type']||'sidebar'),this['set']('side',_0xe48a6a['side']||'right'),this['set']('isVisible',_0xe48a6a['visibleByDefault']??!0x0);const _0x2460fc=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-tabs',_0x2460fc['if']('type','ck-ai-tabs__overlay',_0x32d3c7=>'overlay'===_0x32d3c7),_0x2460fc['if']('type','ck-ai-tabs__sidebar',_0x36432d=>'sidebar'===_0x36432d),_0x2460fc['if']('isVisible','ck-hidden',_0x37f85a=>!_0x37f85a)]}}),this['buttonViews']['on']('add',(_0x38a60a,_0x41c262)=>{_0x41c262['set']('withText',!0x1);});}}class ns extends _0x333531{['view'];['container']=null;['showResizeButton']=!0x0;static get['pluginName'](){return'AITabs';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x712e4b){super(_0x712e4b);const _0x32c268=this['context']['config']['get']('ai.container');if(this['set']('side','right'),!_0x32c268)throw new ot('ai-tabs-configuration-not-found');if(void 0x0!==_0x32c268['showResizeButton']&&(this['showResizeButton']=_0x32c268['showResizeButton']),'sidebar'!==_0x32c268['type']&&'overlay'!==_0x32c268['type']||_0x32c268['side']&&(this['side']=_0x32c268['side']),'sidebar'===_0x32c268['type']){if(this['container']=_0x32c268['element'],this['set']('type','sidebar'),!this['container'])throw new ot('ai-tabs-sidebar-container-element-not-found');}else'overlay'===_0x32c268['type']?(this['container']=document['body'],this['set']('type','overlay')):(this['container']=null,this['set']('type','custom'));this['view']=new ss(this['context']['locale'],{'side':this['side'],'type':this['type'],'visibleByDefault':void 0x0===_0x32c268['visibleByDefault']||_0x32c268['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 _0x20ae3c&&this['context']['ui']['focusTracker']['add'](this['view']['element']);}['switchType'](_0x2b43a0){if(_0x2b43a0&&this['type']!==_0x2b43a0){if(!es['includes'](_0x2b43a0))throw new ot('ai-tabs-unsupported-ui-type');this['type']=_0x2b43a0;}}['switchSide'](_0x2ef4ad){if(_0x2ef4ad&&this['side']!==_0x2ef4ad){if(!is['includes'](_0x2ef4ad))throw new ot('ai-tabs-unsupported-ui-side');this['side']=_0x2ef4ad;}}['resize'](){this['view']['isMaximized']=!this['view']['isMaximized'],this['fire']('resizedTabs',this['view']['isMaximized']);}['destroy'](){super['destroy'](),this['view']['destroy'](),this['view']['element']&&this['view']['element']['remove']();}}class rs extends _0x333531{['_apiUrl'];['_token'];['_decoder'];['_responseCache'];static get['requires'](){return[_0x1587b7];}static get['pluginName'](){return'AIConnector';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x4f3005){super(_0x4f3005),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 _0x68d9f7=this['context']['plugins']['get'](_0x1587b7);if(!_0x68d9f7['token'])throw new ot('ai-missing-token',this);this['_token']=_0x68d9f7['token'];}['startConversation'](_0x37c98c,_0x1cfa65){const _0x348adb=this['_sendApiRequest']('/conversations','POST',{'id':_0x37c98c,'group':_0x1cfa65});return{'getConversation':async()=>(await _0x348adb['request'])['json'](),'abortController':_0x348adb['abortController']};}['queryAssistant']({message:_0x196b54,conversationId:_0x56defc,parts:_0x165d15,capabilities:_0x327a6b,model:_0x3e4d80,attributes:_0x16e8fd}){const _0x5c71dc={'prompt':_0x196b54,'content':_0x165d15,'model':_0x3e4d80,..._0x327a6b&&{'capabilities':_0x327a6b},..._0x16e8fd&&{'attributes':_0x16e8fd}},_0x162184=this['_sendApiRequest']('/conversations/'+_0x56defc+'/messages','POST',_0x5c71dc);return{'getStream':async()=>{const _0x4e2a44=(await _0x162184['request'])['body'];return this['_getStreamReader'](_0x4e2a44);},'abortController':_0x162184['abortController']};}['executeCustomAction']({content:_0x15a2c9,message:_0x11a258,model:_0x7ae570,outputFormat:_0x64f55c}){const _0x4619a4={'content':[{'type':'text','content':_0x15a2c9}],'prompt':_0x11a258,'model':_0x7ae570,'outputFormat':_0x64f55c},_0x1ff8d1=this['_sendApiRequest']('/actions/custom/calls','POST',_0x4619a4);return{'getStream':async()=>{const _0x59f5fe=(await _0x1ff8d1['request'])['body'];return this['_getStreamReader'](_0x59f5fe);},'abortController':_0x1ff8d1['abortController']};}['executeAction']({actionName:_0x4b58d4,content:_0x153131,args:_0x2d9da2}){const _0x2e573c={'content':[{'type':'text','content':_0x153131}],'args':_0x2d9da2},_0x16635b=this['_sendApiRequest']('/actions/system/'+_0x4b58d4+'/calls','POST',_0x2e573c);return{'getStream':async()=>{const _0x3b91f2=(await _0x16635b['request'])['body'];return this['_getStreamReader'](_0x3b91f2);},'abortController':_0x16635b['abortController']};}['uploadFile'](_0x14f50a,_0x21ac32,_0x4de05f){const _0x4b567d=new FormData();_0x4b567d['append']('file',_0x21ac32,_0x21ac32['name']),_0x4de05f&&_0x4b567d['append']('attributes',JSON['stringify'](_0x4de05f));const _0x37cd56=this['_sendApiRequest']('/conversations/'+_0x14f50a+'/files','POST',_0x4b567d);return{'getId':async()=>(await _0x37cd56['request'])['json'](),'abortController':_0x37cd56['abortController']};}['fetchDocument'](_0x1891fa,_0x52c3b6){const _0x490daf=this['_sendApiRequest']('/conversations/'+_0x1891fa+'/documents/'+_0x52c3b6,'GET');return{'getDocument':async()=>(await _0x490daf['request'])['json'](),'abortController':_0x490daf['abortController']};}['uploadDocument'](_0x39a4eb,_0x51ad23,_0x11c2f4){const _0x3df0ce={'content':_0x51ad23};_0x11c2f4&&(_0x3df0ce['attributes']=_0x11c2f4);const _0x3764ff=this['_sendApiRequest']('/conversations/'+_0x39a4eb+'/documents','POST',_0x3df0ce);return{'getId':async()=>(await _0x3764ff['request'])['json'](),'abortController':_0x3764ff['abortController']};}['fetchConversations'](_0x61781c,_0x25a77f={}){const _0x4da9bb=new URLSearchParams();_0x4da9bb['append']('group',_0x61781c),_0x4da9bb['append']('excludeEmpty',!0x1!==_0x25a77f['excludeEmpty']?'true':'false'),_0x4da9bb['append']('limit',_0x25a77f['limit']?_0x25a77f['limit']['toString']():'100'),_0x4da9bb['append']('sortBy',_0x25a77f['sortBy']?_0x25a77f['sortBy']:'createdAt'),_0x4da9bb['append']('order',_0x25a77f['order']?_0x25a77f['order']:'desc');const _0x2c51f8=this['_sendApiRequest']('/conversations?'+_0x4da9bb['toString'](),'GET');return{'getConversations':async()=>{const _0x2a6b19=await _0x2c51f8['request'];return(await _0x2a6b19['json']())['items'];},'abortController':_0x2c51f8['abortController']};}['deleteConversation'](_0x5596e7){const _0x3efd35=this['_sendApiRequest']('/conversations/'+_0x5596e7,'DELETE');return{'execute':async()=>{await _0x3efd35['request'];},'abortController':_0x3efd35['abortController']};}['updateConversation'](_0x5370ed,_0x55d1c9){const _0x2342e6=this['_sendApiRequest']('/conversations/'+_0x5370ed,'PATCH',_0x55d1c9);return{'getResult':async()=>(await _0x2342e6['request'],_0x55d1c9),'abortController':_0x2342e6['abortController']};}['fetchConversation'](_0x411612){const _0x1c8231=this['_sendApiRequest']('/conversations/'+_0x411612,'GET');return{'getConversation':async()=>(await _0x1c8231['request'])['json'](),'abortController':_0x1c8231['abortController']};}['fetchConversationMessages'](_0x5bef65){const _0x5c9642=this['_sendApiRequest']('/conversations/'+_0x5bef65+'/messages','GET');return{'getMessages':async()=>{const _0x16a708=await _0x5c9642['request'];return(await _0x16a708['json']())['items'];},'abortController':_0x5c9642['abortController']};}['uploadUrl'](_0x232919,_0x2c746c,_0x47ade8){const _0x4263de=this['_sendApiRequest']('/conversations/'+_0x232919+'/web-resources','POST',{'url':_0x2c746c,'attributes':_0x47ade8});return{'getId':async()=>(await _0x4263de['request'])['json'](),'abortController':_0x4263de['abortController']};}['getModels'](_0x4e6061='en'){const _0x2a1dff=new URLSearchParams();_0x2a1dff['append']('language',_0x4e6061);const _0x6240b7='/models/1?'+_0x2a1dff['toString'](),_0x48acf4=this['_sendApiRequest'](_0x6240b7,'GET',void 0x0,!0x0);return{'list':async()=>await(await _0x48acf4['request'])['json'](),'abortController':_0x48acf4['abortController']};}['deleteFile'](_0x4d53c7,_0x4c6ee4){const _0x20956a=this['_sendApiRequest']('/conversations/'+_0x4d53c7+'/files/'+_0x4c6ee4,'DELETE');return{'execute':async()=>{await _0x20956a['request'];},'abortController':_0x20956a['abortController']};}['deleteDocument'](_0x41d782,_0x1af17f){const _0x13be89=this['_sendApiRequest']('/conversations/'+_0x41d782+'/documents/'+_0x1af17f,'DELETE');return{'execute':async()=>{await _0x13be89['request'];},'abortController':_0x13be89['abortController']};}['deleteWebResource'](_0x365a84,_0x4b684c){const _0x37f6da=this['_sendApiRequest']('/conversations/'+_0x365a84+'/web-resources/'+_0x4b684c,'DELETE');return{'execute':async()=>{await _0x37f6da['request'];},'abortController':_0x37f6da['abortController']};}['callSystemReview']({reviewName:_0x2c469f,content:_0x4daa22,args:_0x1e16e5}){const _0x192696=this['_sendApiRequest']('/reviews/system/'+_0x2c469f+'/calls','POST',{'content':[{'type':'text','content':_0x4daa22}],'args':_0x1e16e5});return{'getStream':async()=>{const _0x233614=(await _0x192696['request'])['body'];return this['_getStreamReader'](_0x233614);},'abortController':_0x192696['abortController']};}['callCustomReview']({content:_0x13eb96,prompt:_0x402384,model:_0xb1f6ab}){const _0x471026=this['_sendApiRequest']('/reviews/custom/calls','POST',{'content':[{'type':'text','content':_0x13eb96}],'prompt':_0x402384,'model':_0xb1f6ab});return{'getStream':async()=>{const _0x1ddd29=(await _0x471026['request'])['body'];return this['_getStreamReader'](_0x1ddd29);},'abortController':_0x471026['abortController']};}['upsertAIChatRating'](_0x3d72c6,_0x2f3d7d,_0xa1b5d7){const _0x4f3b32=this['_sendApiRequest']('/conversations/'+_0x3d72c6+'/messages/'+_0x2f3d7d+'/ratings','PUT',{'positiveCount':_0xa1b5d7['positiveCount'],'totalCount':_0xa1b5d7['totalCount'],'modificationId':_0xa1b5d7['modificationId']});return{'execute':async()=>{await _0x4f3b32['request'];},'abortController':_0x4f3b32['abortController']};}['upsertAIActionRating'](_0x3154d8,_0x22f20a,_0x1d2397){const _0x125c84=this['_sendApiRequest']('/actions/system/'+_0x3154d8+'/calls/'+_0x22f20a+'/ratings','PUT',{'positiveCount':_0x1d2397['positiveCount'],'totalCount':_0x1d2397['totalCount']});return{'execute':async()=>{await _0x125c84['request'];},'abortController':_0x125c84['abortController']};}['upsertCustomAIActionRating'](_0x4ce370,_0xba3f44){const _0x1c0149=this['_sendApiRequest']('/actions/custom/calls/'+_0x4ce370+'/ratings','PUT',{'positiveCount':_0xba3f44['positiveCount'],'totalCount':_0xba3f44['totalCount']});return{'execute':async()=>{await _0x1c0149['request'];},'abortController':_0x1c0149['abortController']};}['upsertAIReviewRating'](_0x27776d,_0x36f687,_0x4f84ab,_0x2bbdf5){const _0x39098b=this['_sendApiRequest']('/reviews/system/'+_0x27776d+'/calls/'+_0x36f687+'/ratings','PUT',{'positiveCount':_0x4f84ab['positiveCount'],'totalCount':_0x4f84ab['totalCount'],'dataId':_0x2bbdf5});return{'execute':async()=>{await _0x39098b['request'];},'abortController':_0x39098b['abortController']};}['upsertCustomAIReviewRating'](_0x415c6a,_0x599fc9,_0x5cd3df){const _0x5426b0=this['_sendApiRequest']('/reviews/custom/calls/'+_0x415c6a+'/ratings','PUT',{'positiveCount':_0x599fc9['positiveCount'],'totalCount':_0x599fc9['totalCount'],'dataId':_0x5cd3df});return{'execute':async()=>{await _0x5426b0['request'];},'abortController':_0x5426b0['abortController']};}['_sendApiRequest'](_0x4a9930,_0x300b79,_0xd3f562,_0x151bb2=!0x1){const _0x169d80=new AbortController(),_0x54f887=_0x151bb2?_0x300b79+':'+_0x4a9930:null;if(_0x54f887){const _0x47a8e4=this['_responseCache']['get'](_0x54f887);if(_0x47a8e4)return{'request':_0x47a8e4['then'](_0x424351=>_0x424351['clone']()),'abortController':_0x169d80};}const _0x53ada0=_0xd3f562 instanceof FormData,_0x41070c={'Authorization':'Bearer\x20'+this['_token']?.['value']};_0xd3f562&&!_0x53ada0&&(_0x41070c['Content-Type']='application/json');const _0x4c68b4={'method':_0x300b79,'headers':_0x41070c,'signal':_0x169d80['signal']};_0xd3f562&&(_0x4c68b4['body']=_0x53ada0?_0xd3f562:JSON['stringify'](_0xd3f562));const _0x4ea12f=fetch(''+this['_apiUrl']+_0x4a9930,_0x4c68b4)['catch'](_0x286d96=>{_0x54f887&&this['_responseCache']['delete'](_0x54f887),this['_handleError'](_0x286d96);})['then'](_0x4d9ec1=>_0x4d9ec1['ok']?_0x4d9ec1:_0x4d9ec1['json']()['then'](_0x5e7909=>{throw _0x54f887&&this['_responseCache']['delete'](_0x54f887),{'url':this['_apiUrl'],'path':_0x4a9930,'method':_0x300b79,'body':_0xd3f562,'status':(_0x4d9ec1||{})['status'],'statusText':(_0x4d9ec1||{})['statusText'],'code':_0x5e7909['code'],'message':_0x5e7909['message'],'traceId':_0x5e7909['traceId']};}));return _0x54f887&&this['_responseCache']['set'](_0x54f887,_0x4ea12f['then'](_0x5d1f82=>_0x5d1f82['clone']())),{'request':_0x4ea12f,'abortController':_0x169d80};}async*['_getStreamReader'](_0x18744b){const _0x49d8df=[],_0x23dc61=_0x18744b['getReader'](),_0x2d266b=_0x1e3095({'onError':_0x5a1228=>{this['_handleError'](_0x5a1228);},'onEvent':_0x59a028=>{_0x59a028['data']=JSON['parse'](_0x59a028['data']),_0x49d8df['push'](_0x59a028);}});try{let _0x5c5c95=!0x1;for(;!_0x5c5c95;){const {done:_0x1b7ea0,value:_0x2ab3c9}=await _0x23dc61['read']();_0x1b7ea0&&(_0x5c5c95=!0x0),_0x2d266b['feed'](this['_decoder']['decode'](_0x2ab3c9,{'stream':!0x0})),yield*_0x49d8df,_0x49d8df['length']=0x0;}}catch(_0x6115f){this['_handleError'](_0x6115f);}finally{_0x23dc61['releaseLock'](),_0x2d266b['reset']();}}['_handleError'](_0x5c63c5){if(_0x5c63c5 instanceof ot)throw _0x5c63c5;if(_0x5c63c5 instanceof Error&&'AbortError'===_0x5c63c5['name'])throw new ot('ai-request-aborted',this,{'originalError':_0x5c63c5});throw new ot('ai-request-failed',this,{'originalError':_0x5c63c5});}}function as(_0x2bc49b,_0x5e564d,_0x2726f5){const t=_0x2bc49b['t'];switch(_0x5e564d){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'},_0x2726f5);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.'},_0x2726f5);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.'},_0x2726f5);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.'},_0x2726f5);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'},_0x2726f5);case'AI_CHAT_SUGGESTION_ACTION_SUGGEST':return t({'id':'AI_CHAT_SUGGESTION_ACTION_SUGGEST','string':'Suggest'},_0x2726f5);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'},_0x2726f5);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.'},_0x2726f5);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.'},_0x2726f5);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.'},_0x2726f5);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.'},_0x2726f5);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'},_0x2726f5);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.'},_0x2726f5);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 _0x5e564d;}}const os='ck-ai-button-primary',hs='ck-ai-button-secondary',cs='ck-ai-button-tertiary';function ls(_0x3d3a3d,_0x1d2050){const _0x19b1ed=new kt(_0x3d3a3d),_0x58f159=as(_0x3d3a3d,'AI_TABS_LABEL_MINIMIZE'),_0x495ecd=as(_0x3d3a3d,'AI_TABS_LABEL_MAXIMIZE');return _0x19b1ed['set']({'withText':!0x1,'icon':_0x12e914,'tooltip':!0x0,'class':'ck-ai-tabs__resize\x20'+cs}),_0x19b1ed['bind']('label')['to'](_0x1d2050,'isMaximized',_0x1cc2a6=>_0x1cc2a6?_0x58f159:_0x495ecd),_0x19b1ed['bind']('icon')['to'](_0x1d2050,'isMaximized',_0x3ad5a5=>_0x3ad5a5?_0x53d1da:_0x12e914),_0x19b1ed['bind']('isOn')['to'](_0x1d2050,'isMaximized'),_0x19b1ed['on']('execute',()=>{_0x1d2050['fire']('resizeTabs');}),_0x19b1ed;}function us(_0x13e0a0){return _0xe52b52(_0x13e0a0);}function ds(_0x2d3dbe){return _0x11d3e7(_0x2d3dbe);}function _s(_0x579656,_0x2ed17b,_0x7fbee0){const _0x3bf618=null!==_0x2ed17b?_0x26e64b=>_0x26e64b['attribs'][_0x579656]===_0x2ed17b:_0x5ab3c1=>Boolean(_0x5ab3c1['attribs'][_0x579656]);return _0xd5f574(_0x594619=>_0x1005f8(_0x594619)&&_0x3bf618(_0x594619),_0x7fbee0);}function As(_0x45fdb7,_0x5ee597,_0x2918f7){const _0x28104a=null!==_0x5ee597?_0x11b0fe=>_0x11b0fe['attribs'][_0x45fdb7]===_0x5ee597:_0x16f38a=>Boolean(_0x16f38a['attribs'][_0x45fdb7]);return _0x155b48(_0x187920=>_0x1005f8(_0x187920)&&_0x28104a(_0x187920),_0x2918f7);}function gs(_0x159a72,_0x17cf15){return _0x159a72&&_0x1005f8(_0x159a72)?_0x159a72['attribs'][_0x17cf15]:null;}function Is(_0x1f11b7,_0x20f629,_0x551b15){_0x1005f8(_0x1f11b7)&&(null===_0x551b15?delete _0x1f11b7['attribs'][_0x20f629]:_0x1f11b7['attribs'][_0x20f629]=_0x551b15);}function Es(_0x5b1b9a,_0x5b07d0,_0x58edb3){const _0x1ed4d2=_0x5b07d0['cloneNode'](!0x0);'beforebegin'===_0x58edb3?_0xc74076(_0x5b1b9a,_0x1ed4d2):'afterbegin'===_0x58edb3?_0x480634(_0x5b1b9a,_0x1ed4d2):'beforeend'===_0x58edb3?_0x77a4e5(_0x5b1b9a,_0x1ed4d2):'afterend'===_0x58edb3&&_0x1ac603(_0x5b1b9a,_0x1ed4d2);}function Ts(_0x4f5c25){const _0x2686dd=[];let _0x1fe4da=_0x4f5c25;for(;_0x1fe4da;)_0x1fe4da=_0x107731(_0x1fe4da),_0x1fe4da&&_0x2686dd['push'](_0x1fe4da);return _0x2686dd;}function ps(_0x524402){return _0x524402['replace'](/^\s+/gm,'')['replace'](/\s+$/gm,'')['replace'](/\n*/g,'')['replace'](/\s+/g,'\x20')['replace'](/>\s*</g,'><');}function ms(_0x420e85){let _0xa9beb1=0x0;for(;_0x420e85['parentNode'];)_0x420e85=_0x420e85['parentNode'],_0xa9beb1++;return _0xa9beb1;}function Cs(_0xf08f98){const _0x224c05=[];let _0x37eb3e=_0xf08f98['nextSibling'];for(;_0x37eb3e;)_0x224c05['push'](_0x37eb3e),_0x37eb3e=_0x37eb3e['nextSibling'];_0x224c05['forEach'](_0x22f9f5=>{_0x13f11d(_0x22f9f5);});}class ws extends/* #__PURE__ -- @preserve */
|
|
25
|
+
ht(){['_m2html'];constructor(){super();const _0xf0ef6d=Object['entries'](_0x26f49c),_0x1b92ad=_0xf0ef6d['findIndex'](([_0xdd1bde])=>'rehypeDomRaw'===_0xdd1bde);if(-0x1===_0x1b92ad)throw new ot('ai-response-parser-unable-to-set-up-parser');_0xf0ef6d['splice'](_0x1b92ad+0x1,0x0,['rehypeSanitize',_0x16306a]),this['_m2html']=new _0x361b7f({'plugins':Object['fromEntries'](_0xf0ef6d)});}['convertMarkdownToHTML'](_0x196bda){const _0x505559=this['_m2html']['parse'](_0x196bda);return this['parseAndNormalizeHTML'](_0x505559);}['parseAndNormalizeHTML'](_0x522115){return this['_parseHTML'](_0x522115);}['_parseHTML'](_0x207df1){const _0x215f2c=us('<dummy>'+_0x207df1['replace'](/^\t+/gm,'\x20')['replace'](/\n*/g,'')['replace'](/\s+/g,'\x20')['replace'](/<[^>]*?$/g,'')+'</dummy>');return _0x215f2c['children']=_0x215f2c['children'][0x0]['children'],_0x215f2c;}}class fs extends/* #__PURE__ -- @preserve */
|
|
26
|
+
ht(){['_generateUid'];['_touchedNodesState']={'newIds':[],'modifiedIds':[],'removedIds':[],'invalidIds':[],'lastTouchedId':null};['_existingDataIds']=new Set();constructor(_0x11c66d){super(),this['_generateUid']=_0x11c66d||at;}['merge'](_0x3a7647,_0x4db762,_0x22adb2){const _0x437540=_0x3a7647['cloneNode'](!0x0);if(0x0===_0x4db762['childNodes']['length']){const _0xe4a666=[];return As('data-id','new-element',_0x437540)['forEach'](_0x1a0ab4=>{const _0x3e53a1=this['_generateUid']();Is(_0x1a0ab4,'data-id',_0x3e53a1),_0xe4a666['push'](_0x3e53a1);}),this['_removeSpecialComments'](_0x437540),{'parsedContent':_0x437540,'newNodeIds':_0xe4a666,'modifiedNodeIds':[],'removedNodeIds':[]};}_0x22adb2&&_0x22adb2['markUnstableElements']&&this['_markLastTagElementUnstable'](_0x437540),this['_touchedNodesState']['newIds']=[],this['_touchedNodesState']['modifiedIds']=[],this['_touchedNodesState']['removedIds']=[],this['_touchedNodesState']['invalidIds']=[],this['_touchedNodesState']['lastTouchedId']=null,this['_existingDataIds']=new Set(As('data-id',null,_0x4db762)['map'](_0x20f022=>gs(_0x20f022,'data-id'))['filter'](_0x21cb5f=>!!_0x21cb5f));let _0x385679=-0x1,_0x332e40=!0x1;const _0xa68fe5=_0x437540['childNodes'],_0x5bba1d=Array['from'](_0xa68fe5)['filter'](_0x283c14=>!(0x3===_0x283c14['nodeType']&&''===ds(_0x283c14)['trim']())),_0x139a31=_0x5bba1d['length'];for(let _0xc17dee=0x0;_0xc17dee<_0x139a31;_0xc17dee++){const _0x866d1=_0x5bba1d[_0xc17dee],_0x1d752e=_0x5bba1d[_0xc17dee+0x1];if(this['_isNewNode'](_0x866d1)){if(-0x1===_0x385679&&(_0x385679=_0xc17dee),this['_markWrappedElements'](_0x866d1),!this['_isNewNode'](_0x1d752e)){const [_0x22d720,_0x316825]=this['_findReferenceNode'](_0x866d1,_0x332e40,_0x4db762);if(_0x22d720){const _0x3fa390=Array['from'](_0x5bba1d)['slice'](_0x385679,_0xc17dee+0x1);this['_insertNodes'](_0x22d720,_0x3fa390,_0x316825),_0x385679=-0x1;}}}else{if(this['_isExistingContentComment'](_0x866d1))_0x332e40=!0x0;else{if(this['_isExistingNode'](_0x866d1)){const _0x2a2e5a=gs(_0x866d1,'data-id');if(_0x2a2e5a&&this['_existingDataIds']['has'](_0x2a2e5a)){const _0x6e87a3=_s('data-id',_0x2a2e5a,_0x4db762);this['_replaceNode'](_0x6e87a3,_0x866d1);}if(this['_touchedNodesState']['removedIds']['includes'](_0x2a2e5a)){const _0x15cf1e=this['_touchedNodesState']['removedIds']['indexOf'](_0x2a2e5a);this['_touchedNodesState']['removedIds']['splice'](_0x15cf1e,0x1);}}else{if(this['_isDelNode'](_0x866d1)){const _0x9992a5=gs(_0x866d1,'data-id');this['_touchedNodesState']['modifiedIds']['includes'](_0x9992a5)||this['_storeDeletedElementIds'](_0x866d1);}}}}}for(const _0x4d49bf of this['_touchedNodesState']['removedIds']){const _0x5b7110=_s('data-id',_0x4d49bf,_0x4db762);if(_0x5b7110){if(_0x22adb2&&_0x22adb2['replaceRemovedWith']){this['_touchedNodesState']['lastTouchedId']=_0x4d49bf;const _0x52b29a=_0x22adb2['replaceRemovedWith']['cloneNode'](!0x0);Is(_0x52b29a,'data-id',_0x4d49bf),Is(_0x52b29a,'data-removed','true'),_0x35991e(_0x5b7110,_0x52b29a);}else _0x13f11d(_0x5b7110);}}if(As('data-wrapped-id',null,_0x4db762)['forEach'](_0x58db75=>{const _0x404a3b=_s('data-id',gs(_0x58db75,'data-wrapped-id'),_0x4db762);var _0x4c337d,_0x4034f8;_0x404a3b&&(_0x4034f8=_0x58db75,_0x13f11d(_0x4c337d=_0x404a3b),_0x35991e(_0x4034f8,_0x4c337d));}),As('data-id','new-element',_0x4db762)['forEach'](_0x2500be=>{const _0x154249=this['_getUid'](_0x2500be);Is(_0x2500be,'data-id',_0x154249),this['_touchedNodesState']['newIds']['push'](_0x154249);}),this['_removeSpecialComments'](_0x4db762),_0x22adb2&&_0x22adb2['markUnstableElements']&&this['_markUnstableElements'](_0x4db762,_0x22adb2['markUnstableElementsDepth']||0x0),_0x22adb2&&_0x22adb2['cutAfterLastChange']&&this['_touchedNodesState']['lastTouchedId']){let _0x55dbcd=_s('data-id',this['_touchedNodesState']['lastTouchedId'],_0x4db762);for(;_0x55dbcd;)Cs(_0x55dbcd),_0x55dbcd=_0x55dbcd['parentNode'];}return{'parsedContent':_0x4db762,'newNodeIds':this['_touchedNodesState']['newIds'],'modifiedNodeIds':this['_touchedNodesState']['modifiedIds'],'removedNodeIds':this['_touchedNodesState']['removedIds']};}['_insertNodes'](_0x1935db,_0x213f66,_0x20c074){for(const _0x5c21a of _0x213f66){const _0x9a70df=this['_getUid'](_0x5c21a);Is(_0x5c21a,'data-id',_0x9a70df),this['_touchedNodesState']['newIds']['push'](_0x9a70df),this['_touchedNodesState']['lastTouchedId']=_0x9a70df;}const _0x53bbde='afterbegin'===_0x20c074||'afterend'===_0x20c074?_0x213f66['reverse']():_0x213f66;for(const _0x5f2a93 of _0x53bbde)Es(_0x1935db,_0x5f2a93,_0x20c074);}['_replaceNode'](_0x3e476b,_0x5bdb5c){if(!_0x3e476b)return;if(_0x44df63=_0x5bdb5c,ps(ds(_0x3e476b))===ps(ds(_0x44df63)))return;var _0x44df63;const _0x29c1d8=this['_getUid'](_0x3e476b);Is(_0x5bdb5c,'data-id',_0x29c1d8),this['_touchedNodesState']['modifiedIds']['push'](_0x29c1d8),this['_touchedNodesState']['lastTouchedId']=_0x29c1d8,_0x35991e(_0x3e476b,_0x5bdb5c['cloneNode'](!0x0));}['_findReferenceNode'](_0x16ddfd,_0x1712c0,_0x51ecf4){const _0x36ff27=this['_findPrevElementWithDataId'](_0x16ddfd,!0x1);if(_0x36ff27){const _0x33dc3f=this['_getNodeDataId'](_0x36ff27),_0xe28fdb=_s('data-id',_0x33dc3f,_0x51ecf4);if(_0xe28fdb)return[_0xe28fdb,'afterend'];this['_touchedNodesState']['invalidIds']['push'](_0x33dc3f);}const _0x2be349=this['_findNextElementWithDataId'](_0x16ddfd,!0x1);if(_0x2be349){const _0x3f9dae=this['_getNodeDataId'](_0x2be349),_0x280df3=_s('data-id',_0x3f9dae,_0x51ecf4);if(_0x280df3)return[_0x280df3,'beforebegin'];this['_touchedNodesState']['invalidIds']['push'](_0x3f9dae);}return _0x1712c0?_0x16ddfd['nextSibling']?this['_findFallbackReferenceNode'](_0x16ddfd,_0x51ecf4):[_0x51ecf4['childNodes'][_0x51ecf4['childNodes']['length']-0x1],'afterend']:[_0x51ecf4['childNodes'][0x0],'beforebegin'];}['_findFallbackReferenceNode'](_0x27433e,_0x170d8c){const _0x1a5ad7=[],_0x17e771=this['_findPrevElementWithDataId'](_0x27433e,!0x0);if(_0x17e771){const _0x41ad58=_s('data-id',this['_getNodeDataId'](_0x17e771),_0x170d8c);_0x41ad58&&_0x1a5ad7['push']([_0x41ad58,'afterend']);}const _0x57e003=this['_findNextElementWithDataId'](_0x27433e,!0x0);if(_0x57e003){const _0x7c2f30=_s('data-id',this['_getNodeDataId'](_0x57e003),_0x170d8c);_0x7c2f30&&_0x1a5ad7['push']([_0x7c2f30,'beforebegin']);}if(_0x1a5ad7['length']>0x1)return ms(_0x1a5ad7[0x0][0x0])<=ms(_0x1a5ad7[0x1][0x0])?_0x1a5ad7[0x0]:_0x1a5ad7[0x1];return 0x1===_0x1a5ad7['length']?_0x1a5ad7[0x0]:[_0x170d8c['lastChild'],'afterend'];}['_findNextElementWithDataId'](_0x1a279a,_0x31903d){let _0x56aa4d=_0x1a279a['nextSibling'],_0x1c68c0=null,_0x2fa38d=!0x1;for(;_0x56aa4d;){if(_0x5fa535(_0x56aa4d)){if(this['_isDelNode'](_0x56aa4d)&&(_0x1c68c0=_0x56aa4d),this['_isExistingContentComment'](_0x56aa4d)&&_0x31903d&&!_0x2fa38d){_0x2fa38d=!0x0,_0x56aa4d=_0x56aa4d['nextSibling'];continue;}break;}const _0xaa9525=gs(_0x56aa4d,'data-id');if(_0xaa9525&&'new-element'!==_0xaa9525&&this['_existingDataIds']['has'](_0xaa9525)){_0x1c68c0=_0x56aa4d;break;}_0x56aa4d=_0x56aa4d['nextSibling'];}return _0x1c68c0;}['_findPrevElementWithDataId'](_0x4d900f,_0x3053bd){let _0xa5c0fc=_0x4d900f['previousSibling'],_0x4f8b4f=null,_0x2ddb71=!0x1;for(;_0xa5c0fc;){if(_0x5fa535(_0xa5c0fc)){if(this['_isDelNode'](_0xa5c0fc)&&(_0x4f8b4f=_0xa5c0fc),this['_isExistingContentComment'](_0xa5c0fc)&&_0x3053bd&&!_0x2ddb71){_0x2ddb71=!0x0,_0xa5c0fc=_0xa5c0fc['previousSibling'];continue;}break;}const _0x268257=gs(_0xa5c0fc,'data-id');if(_0x268257&&'new-element'!==_0x268257&&this['_existingDataIds']['has'](_0x268257)){_0x4f8b4f=_0xa5c0fc;break;}_0xa5c0fc=_0xa5c0fc['previousSibling'];}return _0x4f8b4f;}['_markWrappedElements'](_0x501b98){_0x1005f8(_0x501b98)&&As('data-id',null,_0x501b98)['forEach'](_0x240a38=>{this['_isExistingNode'](_0x240a38)&&!this['_hasWrappedParent'](_0x240a38)&&(Is(_0x240a38,'data-wrapped-id',gs(_0x240a38,'data-id')),Is(_0x240a38,'data-id',null));});}['_getNodeDataId'](_0x256a45){if(!_0x256a45)return null;if(_0x1005f8(_0x256a45))return gs(_0x256a45,'data-id');if(_0x5fa535(_0x256a45)){const _0x47dbe7=ds(_0x256a45)['match'](/removed[\s*-]data-id="([^"]+)"/);if(_0x47dbe7&&_0x47dbe7[0x1])return _0x47dbe7[0x1];}return null;}['_storeDeletedElementIds'](_0x53fcc8){if(_0x5fa535(_0x53fcc8)){const _0x1b351e=ds(_0x53fcc8)['match'](/removed[\s*-]data-id="([^"]+)"/);_0x1b351e&&_0x1b351e[0x1]&&this['_touchedNodesState']['removedIds']['push'](_0x1b351e[0x1]);}}['_getUid'](_0x46d202){return this['_isExistingNode'](_0x46d202)?gs(_0x46d202,'data-id'):this['_generateUid']();}['_removeSpecialComments'](_0x2793fc){(function(_0x13e5a2){return _0x1925bc(_0x478fa3=>_0x5fa535(_0x478fa3),_0x13e5a2,!0x0,0x1/0x0);}(_0x2793fc)['filter'](_0x10be4a=>this['_isDelNode'](_0x10be4a)||this['_isExistingContentComment'](_0x10be4a))['forEach'](_0xaac241=>{_0x13f11d(_0xaac241);}));}['_markLastTagElementUnstable'](_0x6074d8){const _0x46027f=_0x6074d8['childNodes'],_0x254639=_0x46027f[_0x46027f['length']-0x1];_0x254639&&_0x1005f8(_0x254639)&&Is(_0x254639,'data-unstable','true');}['_markUnstableElements'](_0x204910,_0xb89847){const _0x20a4f1=_s('data-unstable','true',_0x204910);if(!_0x20a4f1)return;const _0x5afe16=Ts(_0x20a4f1)['slice'](0x0,-0x1),_0x1357c8=_0x5afe16['length'];let _0x3d5b74=_0x20a4f1;if(_0x1357c8>_0xb89847){let _0x1b792a=_0x1357c8,_0x4d87a3=null;for(;_0x1b792a>_0xb89847&&_0x1b792a>=0x0;)_0x1b792a--,_0x4d87a3=_0x5afe16[_0x1b792a];_0x4d87a3&&(_0x3d5b74=_0x4d87a3,Is(_0x20a4f1,'data-unstable',null),Is(_0x4d87a3,'data-unstable','true'));}else{if(_0x1357c8<_0xb89847){let _0x22bffd=_0x1357c8,_0x8f9ea9=_0x20a4f1;for(;_0x22bffd<_0xb89847;){const _0x261f6b=_0x8f9ea9['childNodes']['filter'](_0x127ad3=>_0x1005f8(_0x127ad3));if(0x0===_0x261f6b['length'])break;_0x22bffd++,_0x8f9ea9=_0x261f6b[_0x261f6b['length']-0x1];}_0x8f9ea9&&(_0x3d5b74=_0x8f9ea9,Is(_0x20a4f1,'data-unstable',null),Is(_0x8f9ea9,'data-unstable','true'));}}let _0x19ace0=_0x3d5b74;for(;_0x19ace0;){for(;_0x19ace0['nextSibling'];)_0x19ace0=_0x19ace0['nextSibling'],_0x1005f8(_0x19ace0)&&Is(_0x19ace0,'data-unstable','true');_0x19ace0=_0x19ace0['parentNode'];}}['_isNewNode'](_0x23e8d5){return Boolean('new-element'===gs(_0x23e8d5,'data-id'));}['_isExistingNode'](_0x9606ae){return Boolean((gs(_0x9606ae,'data-id')||'')['length']>0x0&&'new-element'!==gs(_0x9606ae,'data-id'));}['_isDelNode'](_0x51baf4){return!!_0x51baf4&&Boolean(_0x5fa535(_0x51baf4)&&ds(_0x51baf4)['match'](/removed[\s*-]data-id="[^"]+"/));}['_hasWrappedParent'](_0x3d6d68){let _0xb481dc=_0x3d6d68['parentNode'];for(;_0xb481dc;){if(gs(_0xb481dc,'data-wrapped-id'))return!0x0;_0xb481dc=_0xb481dc['parentNode'];}return!0x1;}['_isExistingContentComment'](_0x1131cb){return Boolean(_0x5fa535(_0x1131cb)&&ds(_0x1131cb)['match'](/\s*existing[\s*-](content|document)\s*/g));}}function Ss({editor:_0x48e82b,changeGroups:_0x14efa3,documentContextContent:_0x961ad0,showDiff:_0x199de0,trimUnchanged:_0x4efca1=!0x0}){return _0x14efa3['map'](_0x467189=>{const _0x1d026f=new _0x450a47([]),_0x1c6845=new _0x450a47([]);for(const _0x592255 of _0x467189['changes'])if(_0x199de0&&'removed'==_0x592255['type']||_0x1c6845['children']['push'](_0x592255['node']['cloneNode'](!0x0)),'new'!=_0x592255['type']&&(_0x199de0||'removed'!=_0x592255['type'])){const _0x5391f4=_0xd5f574(_0x12d4fe=>gs(_0x12d4fe,'data-id')==_0x592255['id'],_0x961ad0,!0x0);_0x5391f4&&_0x1d026f['children']['push'](_0x5391f4['cloneNode'](!0x0));}const {content:_0x817a6b,hasChanges:_0x17fcdd}=function(_0x144794,_0x3ceaf2,_0x2db69f,_0x2957d1,_0x41ae58=!0x0){const _0x1eb972=_0x144794['plugins']['get']('DocumentCompare'),_0x5a178b=ds(_0x3ceaf2),_0x221d91=ds(_0x2db69f),_0x330167=_0x144794['data']['parse'](_0x5a178b,'$root'),_0x2ad453=_0x144794['model']['createPositionAt'](_0x330167,0x0),_0x403165=_0x1eb972['getDiff'](_0x5a178b,_0x221d91,{'anchor':_0x2ad453,'markDeletions':_0x2957d1}),_0xb3e8f8=_0x403165['getOperations']();if(0x0==_0xb3e8f8['length'])return{'content':_0x3ceaf2['cloneNode'](!0x0),'hasChanges':!0x1};_0x2957d1?function(_0x58fd1e,_0x5840ee,_0x2bcd35){if(0x0==_0x58fd1e['length'])return;const _0x1c086a=_0x2bcd35['plugins']['get']('DocumentCompare'),_0x8f71a7=_0x2bcd35['plugins']['get']('SuggestionsConversion');_0x2bcd35['model']['change'](_0x3c7605=>{const _0xe2aa87=new Set();for(let _0x3ed054=0x0;_0x3ed054<_0x58fd1e['length'];_0x3ed054++){const _0x1f33e7=_0x58fd1e[_0x3ed054];if(_0x1f33e7['baseVersion']=null,_0x1f33e7['isDocumentOperation']=!0x1,_0x1c086a['isMarkedRemoveOperation'](_0x1f33e7)){const _0xd4e362=_0x3d8ea2(_0x1f33e7['newRange'],_0x2bcd35['model']),_0x342080='suggestion:deletion:'+at()+':$aiSuggestion';_0x5840ee['markers']['set'](_0x342080,_0xd4e362);}else switch(_0x1f33e7['type']){case'rename':{if(_0x1f33e7['oldName']==_0x1f33e7['newName'])break;_0x3c7605['batch']['addOperation'](_0x1f33e7),_0x2bcd35['model']['applyOperation'](_0x1f33e7);const _0x499c46='$elementName',_0x364b4f=_0x1f33e7['position'],_0xb738da=_0x2bcd35['model']['createRange'](_0x364b4f,_0x2bcd35['model']['createPositionAt'](_0x364b4f['nodeAfter'],'end')),_0x3efb61='suggestion:attribute:'+_0x499c46+':'+at()+':$aiSuggestion';_0x5840ee['markers']['set'](_0x3efb61,_0xb738da);break;}case'addAttribute':case'removeAttribute':case'changeAttribute':{if(_0x1f33e7['oldValue']==_0x1f33e7['newValue'])break;_0x3c7605['batch']['addOperation'](_0x1f33e7),_0x2bcd35['model']['applyOperation'](_0x1f33e7);const _0x2cf303=_0x1f33e7['key'];if(!_0x8f71a7['isRegisteredAttribute'](_0x2cf303))break;const _0x55d3dc=_0x3d8ea2(_0x1f33e7['range'],_0x2bcd35['model']),_0x400bb5='suggestion:attribute:'+_0x2cf303+':'+at()+':$aiSuggestion';_0x5840ee['markers']['set'](_0x400bb5,_0x55d3dc);break;}case'insert':{_0x3c7605['batch']['addOperation'](_0x1f33e7),_0x2bcd35['model']['applyOperation'](_0x1f33e7);if(_0x58fd1e[_0x3ed054+0x1]&&'move'==_0x58fd1e[_0x3ed054+0x1]['type']){bs(_0x5840ee,_0x1f33e7);break;}const _0x13ad67=_0x1f33e7['position'],_0x44fa37=_0x1f33e7['howMany'],_0x409ab8=_0x3d8ea2(_0x2bcd35['model']['createRange'](_0x13ad67,_0x13ad67['getShiftedBy'](_0x44fa37)),_0x2bcd35['model']),_0x5c7b12='suggestion:insertion:'+at()+':$aiSuggestion';_0x5840ee['markers']['set'](_0x5c7b12,_0x409ab8);break;}case'split':{_0x3c7605['batch']['addOperation'](_0x1f33e7),_0x2bcd35['model']['applyOperation'](_0x1f33e7);const _0x544baa=_0x1f33e7['splitPosition'],_0x560859=_0x1f33e7['moveTargetPosition'],_0x48d594=_0x2bcd35['model']['createRange'](_0x544baa,_0x560859),_0x17daf5='suggestion:insertion:'+at()+':$aiSuggestion';_0x5840ee['markers']['set'](_0x17daf5,_0x48d594);break;}case'move':{_0x3c7605['batch']['addOperation'](_0x1f33e7),_0x2bcd35['model']['applyOperation'](_0x1f33e7),_0x58fd1e[_0x3ed054-0x1]&&'insert'==_0x58fd1e[_0x3ed054-0x1]['type']&&bs(_0x5840ee,_0x1f33e7);const _0x4c8272=_0x1f33e7['getMovedRangeStart'](),_0x5bbd6d=_0x1f33e7['howMany'];for(let _0xfd74b8=0x0;_0xfd74b8<_0x5bbd6d;_0xfd74b8++){const _0x5c8dee=_0x4c8272['getShiftedBy'](_0xfd74b8)['nodeAfter'];_0xe2aa87['add'](_0x5c8dee);}break;}case'remove':{const _0x388d7b=_0x1f33e7['sourcePosition'],_0x13324f=_0x1f33e7['howMany'],_0x5609f0=new _0x30ee68(_0x388d7b,_0x13324f);_0x3c7605['batch']['addOperation'](_0x5609f0),_0x2bcd35['model']['applyOperation'](_0x5609f0);break;}}}for(const _0x3c7d18 of _0xe2aa87){const _0x3d9ac0=_0x2bcd35['model']['createRangeOn'](_0x3c7d18),_0x491aae='suggestion:formatBlock:$fakeWrap:'+at()+':$aiSuggestion';_0x5840ee['markers']['set'](_0x491aae,_0x3d8ea2(_0x3d9ac0,_0x2bcd35['model']));}});}(_0xb3e8f8,_0x330167,_0x144794):_0x144794['model']['change'](_0x76dfb3=>{for(const _0xf127df of _0xb3e8f8)if('remove'==_0xf127df['type']){const _0x17749c=_0xf127df['sourcePosition'],_0xc7e211=_0xf127df['howMany'],_0x36a636=new _0x30ee68(_0x17749c,_0xc7e211);_0x76dfb3['batch']['addOperation'](_0x36a636),_0x144794['model']['applyOperation'](_0x36a636);}else{if('marker'==_0xf127df['type']){const _0x311965=_0xf127df['name'],_0x4d6969=_0xf127df['newRange'];null!==_0x4d6969?_0x330167['markers']['set'](_0x311965,_0x4d6969):_0x330167['markers']['delete'](_0x311965);}else _0xf127df['baseVersion']=null,_0xf127df['isDocumentOperation']=!0x1,_0x76dfb3['batch']['addOperation'](_0xf127df),_0x144794['model']['applyOperation'](_0xf127df);}});if(_0x41ae58){const _0x497149=Rs(_0x144794,_0xb3e8f8,_0x330167);Os(_0x144794['model'],_0x497149),function(_0xd901cb,_0xbc5771){const _0x4530b9=_0xbc5771['getFirstRange']()['start'];let _0x435578=_0xbc5771['getFirstRange']()['end'];const _0x12274a=_0x4530b9['root'];(_0x435578['textNode']||_0x435578['nodeAfter']&&_0x435578['nodeAfter']['is']('$text'))&&(_0x186e6c(_0x435578,'...'),_0x435578=_0x435578['getShiftedBy'](0x3)),(_0x4530b9['textNode']||_0x4530b9['nodeBefore']&&_0x4530b9['nodeBefore']['is']('$text'))&&(_0x186e6c(_0x4530b9,'...'),function(_0x1dda4f,_0x364676,_0x50cd5f){for(let [_0x23c1fe,_0x4c70e3]of _0x1dda4f['markers']){const _0x5375cc=_0x4c70e3['_getTransformedByInsertion'](_0x364676,_0x50cd5f,!0x1);_0x4c70e3=_0x5375cc[0x0],_0x1dda4f['markers']['set'](_0x23c1fe,_0x4c70e3);}}(_0x12274a,_0x4530b9,0x3),_0x4530b9['parent']==_0x435578['parent']&&(_0x435578=_0x435578['getShiftedBy'](0x3)));const _0x551e80=_0xd901cb['createRange'](_0xd901cb['createPositionAt'](_0x12274a,0x0),_0x4530b9),_0x4c48e6=_0xd901cb['createRange'](_0x435578,_0xd901cb['createPositionAt'](_0x12274a,'end')),_0x4d60cb=[..._0x551e80['getMinimalFlatRanges'](),..._0x4c48e6['getMinimalFlatRanges']()];_0x4d60cb['reverse']();for(const _0x131a24 of _0x4d60cb)_0x42666a(_0x131a24),Ns(_0x12274a,_0x131a24);}(_0x144794['model'],_0x497149);}const _0x2b4d5=_0x144794['data']['stringify'](_0x330167,{'showSuggestionHighlights':!0x0});return{'content':us(_0x2b4d5),'hasChanges':!0x0};}(_0x48e82b,_0x1d026f,_0x1c6845,_0x199de0,_0x4efca1);return{'type':_0x467189['changes'][0x0]['type'],'index':_0x467189['index'],'content':_0x817a6b,'hasChanges':_0x17fcdd};});}function bs(_0x481b1a,_0x21fc3a){for(const [_0x1db3d6,_0x4caa8d]of _0x481b1a['markers']){const _0x4567e6=_0x34cb53['_createFromRanges'](_0x4caa8d['getTransformedByOperation'](_0x21fc3a));_0x481b1a['markers']['set'](_0x1db3d6,_0x4567e6);}}function Rs(_0x592665,_0x55f5e2,_0x268776){const _0x423206=_0x592665['plugins']['get']('DocumentCompare');let _0x246fa2=_0x592665['model']['createPositionAt'](_0x268776,Number['POSITIVE_INFINITY']),_0x45c7c2=_0x592665['model']['createPositionAt'](_0x268776,0x0);for(const _0x102544 of _0x55f5e2){let _0x47fc58,_0x24872f;if(_0x423206['isMarkedRemoveOperation'](_0x102544))_0x47fc58=_0x102544['newRange']['start'],_0x24872f=_0x102544['newRange']['end'];else switch(_0x246fa2=_0x246fa2['getTransformedByOperation'](_0x102544),_0x45c7c2=_0x45c7c2['getTransformedByOperation'](_0x102544),_0x102544['type']){case'rename':_0x47fc58=_0x102544['position'],_0x24872f=_0x47fc58['getShiftedBy'](0x1);break;case'addAttribute':case'removeAttribute':case'changeAttribute':_0x47fc58=_0x102544['range']['start'],_0x24872f=_0x102544['range']['end'];break;case'insert':_0x47fc58=_0x102544['position'],_0x24872f=_0x47fc58['getShiftedBy'](_0x102544['howMany']);break;case'split':_0x47fc58=_0x102544['splitPosition'],_0x24872f=_0x102544['moveTargetPosition'];break;case'merge':{const _0xff8c54=_0x102544['targetPosition']['path']['slice'](0x0,-0x1);_0x47fc58=_0x592665['model']['createPositionFromPath'](_0x268776,_0xff8c54),_0x24872f=_0x47fc58['getShiftedBy'](0x1);break;}case'remove':{const _0x57f7ea=_0x102544['howMany'],_0x4cfe1e=_0x102544['sourcePosition']['_getTransformedByInsertion'](_0x102544['targetPosition'],_0x57f7ea),_0x277cc5=_0x102544['getMovedRangeStart']();'remove'==_0x102544['type']?(_0x47fc58=_0x4cfe1e,_0x24872f=_0x4cfe1e):(_0x47fc58=_0x277cc5,_0x24872f=_0x277cc5['getShiftedBy'](_0x57f7ea));break;}}_0x47fc58&&_0x47fc58['isBefore'](_0x246fa2)&&(_0x246fa2=_0x47fc58['clone'](),_0x246fa2['stickiness']='toNone'),_0x24872f&&_0x24872f['isAfter'](_0x45c7c2)&&(_0x45c7c2=_0x24872f['clone'](),_0x45c7c2['stickiness']='toNone');}return _0x592665['model']['createSelection'](_0x592665['model']['createRange'](_0x246fa2,_0x45c7c2));}function Os(_0x5ad9c5,_0x4aedba){ks(_0x5ad9c5,_0x4aedba,'forward');const _0x301602=_0x4aedba['getFirstRange']();_0x4aedba['setTo']([]),_0x4aedba['setTo'](_0x301602,{'backward':!0x0}),ks(_0x5ad9c5,_0x4aedba,'backward');}function ks(_0x5097f2,_0x1b4f82,_0x5a658f){let _0x4862d9=0x14;for(;_0x4862d9;){_0x5097f2['modifySelection'](_0x1b4f82,{'unit':'word','direction':_0x5a658f}),_0x4862d9--;const _0x2ecaba=_0x1b4f82['focus']['forward'==_0x5a658f?'nodeBefore':'nodeAfter'];if(_0x2ecaba&&_0x2ecaba['is']('element')&&_0x5097f2['schema']['isBlock'](_0x2ecaba)&&_0x5097f2['schema']['isObject'](_0x2ecaba))break;}}function Ns(_0x1da05c,_0x59d982){for(const [_0x18b5a5,_0x5bef51]of _0x1da05c['markers']){const _0x11dc59=_0x5bef51['_getTransformedByDeletion'](_0x59d982['start'],_0x59d982['end']['offset']-_0x59d982['start']['offset']);null!=_0x11dc59?_0x1da05c['markers']['set'](_0x18b5a5,_0x11dc59):_0x1da05c['markers']['delete'](_0x18b5a5);}}class vs extends ht(){['id'];['interactionId'];['type'];['sources']=[];['parsedContent']=new _0x450a47([]);['parsedMergedContent']=new _0x450a47([]);['changeGroups']=[];['areActionsDisabled']=!0x1;['documentContextContent'];['aiResponseParser'];['aiResponseApplier'];['editor'];['cachedSuggestionContentParts']={'withDiff':[],'withoutDiff':[]};constructor({type:_0x3448e1,content:_0xe020ca='',isDone:_0x94be27=!0x1,interactionId:_0x5a22a5,areActionsDisabled:_0x507aa4,documentContextContent:_0x4f3dd1,editor:_0x80d251,id:_0x2bd9e2}){super(),this['id']=_0x2bd9e2||at(),this['interactionId']=_0x5a22a5,this['type']=_0x3448e1,this['areActionsDisabled']=!!_0x507aa4,this['editor']=_0x80d251,this['aiResponseParser']=new ws(),this['aiResponseApplier']=new fs(),this['documentContextContent']=us(_0x4f3dd1||''),this['set']('isDone',_0x94be27),this['on']('change:content',()=>{this['onContentChange']();}),this['set']('content',_0xe020ca);}['appendContent'](_0x483b1d){this['set']('content',this['content']+_0x483b1d);}['done'](){this['isDone']||(this['set']('isDone',!0x0),this['onContentChange']());}['destroy'](){this['stopListening']();}['setChangeGroupState'](_0x5763cc,_0x57bb11){this['changeGroups'][_0x5763cc]['state']=_0x57bb11,this['fire']('replyChangeGroupStateUpdated',{'reply':this,'index':_0x5763cc,'state':_0x57bb11});}['getContentParts']({showDiff:_0x3d474e,groupIndex:_0x14b34e}){if(!this['editor'])throw new ot('ai-get-editor-from-context-no-editor',null,{'aiReply':this});const _0x564695=this['_getCachedContentParts'](_0x3d474e,_0x14b34e);if(_0x564695)return _0x564695;let _0x13f7d3=[];if(void 0x0===_0x14b34e)_0x13f7d3=this['changeGroups'];else{const _0x129059=this['changeGroups']['find'](({index:_0x43b58c})=>_0x43b58c===_0x14b34e);if(!_0x129059)throw new ot('ai-reply-get-content-parts-group-not-found',null,{'aiReply':this,'groupIndex':_0x14b34e});_0x13f7d3=[_0x129059];}const _0x355e32=Ss({'editor':this['editor'],'showDiff':_0x3d474e,'changeGroups':_0x13f7d3,'documentContextContent':this['documentContextContent']});return this['_setCachedContentParts'](_0x3d474e,_0x355e32),_0x355e32;}['_getCachedContentParts'](_0x2ff3b3,_0xfc9d19){const _0x5dfe02=_0x2ff3b3?'withDiff':'withoutDiff';if(!this['cachedSuggestionContentParts'][_0x5dfe02]['length'])return null;const _0x47da4c=this['cachedSuggestionContentParts'][_0x5dfe02];if(void 0x0===_0xfc9d19)return _0x47da4c['length']>0x0&&_0x47da4c['length']!==this['changeGroups']['length']?(this['_setCachedContentParts'](_0x2ff3b3,null),null):_0x500b79(_0x47da4c);{const _0x1a9a7d=_0x47da4c['find'](({index:_0x3d6c3})=>_0x3d6c3===_0xfc9d19);if(_0x1a9a7d)return[_0x500b79(_0x1a9a7d)];}return null;}['_setCachedContentParts'](_0x1ecc87,_0x1e46bf){const _0x3cf793=_0x1ecc87?'withDiff':'withoutDiff';_0x1e46bf?_0x1e46bf['forEach'](_0x4b09ca=>{const _0x507d97=this['cachedSuggestionContentParts'][_0x3cf793],_0x2fb49a=_0x507d97['find'](({index:_0x5e2477})=>_0x5e2477===_0x4b09ca['index']);if(_0x2fb49a){const _0x14ac61=_0x507d97['indexOf'](_0x2fb49a);_0x507d97['splice'](_0x14ac61,0x1,_0x4b09ca);}else _0x507d97['push'](_0x4b09ca);}):this['cachedSuggestionContentParts'][_0x3cf793]['length']=0x0;}['onContentChange'](){if('modification'===this['type']){this['parsedContent']=this['aiResponseParser']['parseAndNormalizeHTML'](this['content']);const _0x58695e=this['changeGroups'];this['updateChangeGroups']();const _0x5f3ad3=this['_getDifferentChangeGroups'](_0x58695e,this['changeGroups']);(_0x5f3ad3['length']||this['isDone'])&&(this['fire']('replyContentUpdated',this,_0x5f3ad3),this['cachedSuggestionContentParts']['withDiff']['length']=this['cachedSuggestionContentParts']['withoutDiff']['length']=0x0);}else this['parsedContent']=this['aiResponseParser']['convertMarkdownToHTML'](this['content']),this['fire']('replyContentUpdated',this);}['_getDifferentChangeGroups'](_0x3303c0,_0x1adc5c){const _0x506086=[];for(const _0x2e3d6b of _0x1adc5c){const _0x464319=_0x3303c0[_0x2e3d6b['index']];_0x464319?_0x464319['changes']['length']!==_0x2e3d6b['changes']['length']?_0x506086['push'](_0x2e3d6b):_0x464319['changes']['forEach']((_0x5c7533,_0x709e8c)=>{const _0x21b5e0=_0x2e3d6b['changes'][_0x709e8c];_0x5c7533['id']!==_0x21b5e0['id']&&_0x506086['push'](_0x2e3d6b);}):_0x506086['push'](_0x2e3d6b);}return _0x506086;}['updateChangeGroups'](){const _0x116667=new ti('p',{},[new ti('span',{'style':'color:\x20#808080;\x20font-style:\x20italic'},[new _0xea0ca3(as(this['editor']['locale'],'AI_SUGGESTION_CONTENT_PART_REMOVED'))])]),_0x460c15=this['aiResponseApplier']['merge'](this['parsedContent'],this['documentContextContent']['cloneNode'](!0x0),{'markUnstableElements':!this['isDone'],'replaceRemovedWith':_0x116667,'cutAfterLastChange':!this['isDone']});if(!_0x460c15['modifiedNodeIds']['length']&&!this['isDone'])return;this['parsedMergedContent']=_0x460c15['parsedContent'];let _0x47cead=[];if(_0x155b48(_0x542193=>{const _0x3ad38c=gs(_0x542193,'data-id');if(!_0x3ad38c||!_0x3dc561(_0x3ad38c))return!0x1;const _0x42d25a=[_0x542193,...Ts(_0x542193)]['at'](-0x2);if(_0x542193!=_0x42d25a){const _0x24eaa8=gs(_0x42d25a,'data-id');_0x3dc561(_0x24eaa8)||(_0x47cead['push']({'node':_0x42d25a,'id':_0x24eaa8,'type':'modified'}),_0x460c15['modifiedNodeIds']['push'](_0x24eaa8));}else _0x460c15['modifiedNodeIds']['includes'](_0x3ad38c)?_0x47cead['push']({'node':_0x542193,'type':'modified','id':_0x3ad38c}):_0x460c15['newNodeIds']['includes'](_0x3ad38c)?_0x47cead['push']({'node':_0x542193,'type':'new','id':_0x3ad38c,'anchorId':gs(_0x542193['previousSibling'],'data-id')}):_0x47cead['push']({'node':_0x542193,'type':'removed','id':_0x3ad38c});return!0x0;},this['parsedMergedContent']),_0x47cead=_0x47cead['filter'](({node:_0xfa921c})=>[...Ts(_0xfa921c),_0xfa921c]['every'](_0x332840=>!gs(_0x332840,'data-unstable'))),0x0==_0x47cead['length'])return;const _0x51289c=[[_0x47cead[0x0]]];for(let _0x386f5c=0x1;_0x386f5c<_0x47cead['length'];_0x386f5c++){const _0x31061a=_0x51289c[_0x51289c['length']-0x1],_0xbf3dae=_0x31061a[_0x31061a['length']-0x1];_0x47cead[_0x386f5c]['node']['previousSibling']==_0xbf3dae['node']&&'modified'!=_0x47cead[_0x386f5c]['type']&&'modified'!=_0xbf3dae['type']?_0x31061a['push'](_0x47cead[_0x386f5c]):_0x51289c['push']([_0x47cead[_0x386f5c]]);}for(const _0x4770c3 of _0x51289c){const _0x4c65e5=_0x4770c3[0x0],_0x39906c=_0x4770c3[_0x4770c3['length']-0x1],_0x343b67=_0x3f7a0c(_0x4c65e5['node']['previousSibling']);_0x343b67&&_0x4770c3['unshift'](_0x343b67);const _0x697175=_0x3f7a0c(_0x39906c['node']['nextSibling']);_0x697175&&_0x4770c3['push'](_0x697175);}function _0x3dc561(_0x264204){return _0x460c15['modifiedNodeIds']['includes'](_0x264204)||_0x460c15['newNodeIds']['includes'](_0x264204)||_0x460c15['removedNodeIds']['includes'](_0x264204);}function _0x3f7a0c(_0x4e84ed){if(_0x4e84ed&&gs(_0x4e84ed,'data-id')&&!gs(_0x4e84ed,'data-unstable')){const _0x247d00=gs(_0x4e84ed,'data-id');if(!_0x3dc561(_0x247d00))return{'node':_0x4e84ed,'type':'context','id':_0x247d00};}return null;}this['changeGroups']=_0x51289c['map']((_0x278e84,_0x18c2f1)=>({'changes':_0x278e84,'state':'pending','index':_0x18c2f1}));}}const ys=['interactionCreated','interactionStarted','interactionStopped','interactionFinished','interactionDestroyed','replyCreated','replyContentUpdated','replyChangeGroupStateUpdated','setConversationTitle','webSearchStarted','webSearchFinished','reasoningStarted','reasoningFinished','toolDataReceived','error'];class xs extends pt(){['id'];['replies']=[];['currentReply'];['messageId'];['actionCallId'];['currentRequest'];['connector'];['isStopped']=!0x1;['isDestroyed']=!0x1;['editor'];['_isReasoning']=!0x1;['_isWebSearching']=!0x1;constructor({connector:_0x169b78,editor:_0x1e2cc5}){super(),this['id']=at(),this['connector']=_0x169b78,this['isStopped']=!0x0,this['editor']=_0x1e2cc5;}async['start'](){const _0x232bee=[];let _0x231a03,_0x489709,_0x2720f8;this['isStopped']=!0x1;try{this['currentRequest']=await this['sendRequest'](),this['fire']('interactionStarted',this);const _0x1378d5=await this['currentRequest']['getStream']();for await(const _0x29ee36 of _0x1378d5){if(this['isStopped'])return;if('error'==_0x29ee36['event'])return void this['fire']('error',{'error':new ot('ai-chat-interaction-error',this)});switch(_0x29ee36['event']){case'message-metadata':this['messageId']=_0x29ee36['data']['messageId'];break;case'action-metadata':this['actionCallId']=_0x29ee36['data']['callId'];break;case'conversation-title':this['setConversationTitle'](_0x29ee36['data']['conversationTitle'],!0x0);break;case'source':_0x232bee['push'](_0x29ee36['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'](),_0x231a03='modification-delta'==_0x29ee36['event']?'modification':'text',_0x489709='modification-delta'==_0x29ee36['event']?_0x29ee36['data']['id']:void 0x0,this['currentReply']&&this['currentReply']['type']!=_0x231a03&&(this['currentReply']['done'](),this['currentReply']=void 0x0),this['currentReply']||(this['currentReply']=this['createReply']({'type':_0x231a03,'interactionId':this['id'],'id':_0x489709}),'modification'==_0x231a03&&(this['currentReply']['sources']=_0x232bee['splice'](0x0))),this['currentReply']['appendContent'](_0x29ee36['data']['textDelta']);break;case'mcp-tool-result':_0x2720f8=JSON['parse'](_0x29ee36['data']['result']),this['_handleToolResultData']({'toolName':_0x29ee36['data']['toolName'],'data':_0x2720f8['data'],'attributes':_0x2720f8['attributes']});break;case'mcp-tool-notification':this['_handleToolNotificationData']({'toolName':_0x29ee36['data']['toolName'],'data':_0x29ee36['data']['data']});}}}finally{this['isStopped']||(this['currentReply']&&_0x232bee['length']>0x0&&(this['currentReply']['sources']=_0x232bee['splice'](0x0)),this['_finalizeInteraction'](),this['fire']('interactionFinished',this));}}['stop'](){this['isStopped']||(this['_finalizeInteraction'](),this['fire']('interactionStopped',this));}['getReply'](_0x3a04c9){return this['replies']['find'](_0x25adb2=>_0x25adb2['id']===_0x3a04c9);}['destroy'](){this['isDestroyed']||(this['stop'](),this['replies']['forEach'](_0x2ac25c=>_0x2ac25c['destroy']()),this['replies']=[],this['isDestroyed']=!0x0,this['fire']('interactionDestroyed',this),this['stopListening']());}['createReply'](_0x144e23){const _0x2bd017=new vs({'editor':this['editor'],'documentContextContent':this['getDocumentContext']()?.['content'],..._0x144e23});return this['replies']['push'](_0x2bd017),_0x2bd017['delegate'](...ys)['to'](this),this['fire']('replyCreated',_0x2bd017),_0x2bd017;}['setConversationTitle'](_0x5bf1cd,_0x4dbfde=!0x1){this['fire']('setConversationTitle',_0x5bf1cd,_0x4dbfde);}['resetWebSearchState'](){this['_isWebSearching']&&(this['_isWebSearching']=!0x1,this['fire']('webSearchFinished',this));}['resetReasoningState'](){this['_isReasoning']&&(this['_isReasoning']=!0x1,this['fire']('reasoningFinished',this));}['_handleToolResultData'](_0x416b62){this['fire']('toolDataReceived',{'type':'result','toolName':_0x416b62['toolName'],'data':structuredClone(_0x416b62['data']||{}),'attributes':structuredClone(_0x416b62['attributes']||{})},this);}['_handleToolNotificationData'](_0x23fc99){this['fire']('toolDataReceived',{'type':'notification','toolName':_0x23fc99['toolName'],'data':structuredClone(_0x23fc99['data'])},this);}['_finalizeInteraction'](){this['isStopped']=!0x0,this['currentRequest']&&this['currentRequest']['abortController']['abort'](),this['currentReply']&&this['currentReply']['done'](),this['currentRequest']=this['currentReply']=void 0x0;}}const Ls=new Map([['usage-limits-exceeded','ai-usage-limits-exceeded'],['rate-limits-exceeded','ai-rate-limits-exceeded'],['invalid-content-type','ai-invalid-content-type'],['invalid-request-data','ai-chat-invalid-request'],['model-already-set','ai-chat-model-already-set'],['model-not-found','ai-chat-model-not-found'],['unsafe-content-detected','ai-chat-unsafe-content-detected'],['unsupported-content-type','ai-chat-unsupported-content-type'],['content-too-large','ai-chat-content-too-large'],['unsupported-file-type','ai-chat-context-unsupported-file-type'],['file-too-large','ai-chat-context-file-too-large'],['file-too-many-pages','ai-chat-context-file-too-many-pages'],['form-data-size-limits-exceeded','ai-chat-context-form-data-size-limits-exceeded']]),Ds=['contextItemAdded','contextItemRemoved','contextItemLoadingEnded','contextSent','error','addContextOptionsChanged','sourceResourcesLoaded','resourceStateChanged','uploadProgressChanged'];class Ps extends ht(){['_connector'];['_config'];['_ownerId'];constructor({connector:_0x4df4e2,config:_0x28e4d2,ownerId:_0x23a088}){super(),this['_connector']=_0x4df4e2,this['_config']=_0x28e4d2,this['_ownerId']=_0x23a088;}['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'](_0x3ea7fe){const _0x14ec86=await this['_createContextItemFromContent'](_0x3ea7fe);return this['_addToConversationContextItem'](_0x14ec86),'current-document'===_0x14ec86['uiId']&&this['_toggleAddCurrentDocumentOptionVisibility'](),_0x14ec86;}async['_createContextItemFromContent'](_0x537ded){if('document'===_0x537ded['type']){const _0x2eeaa9=await this['_connector']['fetchDocument'](this['_ownerId'],_0x537ded['id'])['getDocument']();return{'id':'current-document','uiId':'current-document','label':'Current\x20document','type':_0x537ded['type'],'content':_0x2eeaa9['content'],'hidden':this['_conversationContextItems']['has']('current-document'),'version':_0x2eeaa9['attributes']?.['version'],'sessionId':_0x2eeaa9['attributes']?.['sessionId']};}if('mcp-tool-context'===_0x537ded['type'])return{'id':_0x537ded['id'],'uiId':_0x537ded['id'],'label':_0x537ded['data']?.['label']||_0x537ded['id'],'type':'mcp-tool-context','mcpServerName':_0x537ded['mcpServerName'],'toolName':_0x537ded['toolName'],'data':_0x537ded['data']||{}};return{'id':_0x537ded['id'],'uiId':_0x537ded['id'],'label':_0x537ded['attributes']?.['label']||_0x537ded['name']||_0x537ded['url']||_0x537ded['id'],'type':_0x537ded['type'],..._0x537ded?.['attributes']?.['resourceId']?{'resourceId':_0x537ded['attributes']?.['resourceId']}:{}};}['getSentContextItems'](){return new Map(this['_conversationContextItems']);}['removeFromContext'](_0x48c6ef){const _0x556e09=this['_pendingContextItems']['get'](_0x48c6ef);_0x556e09?.['isReadOnly']||this['_removeContextItem'](_0x48c6ef);}['clearPendingContextItems'](){if(0x0===this['_pendingContextItems']['size'])return;for(const _0x58aae2 of this['_pendingContextItems']['values']())this['_removeContextItem'](_0x58aae2['uiId']);const _0xa20cfb=this['_conversationContextItems']['get']('current-document')||this['_pendingContextItems']['get']('current-document');_0xa20cfb&&this['_addContextItem']({..._0xa20cfb,'isReadOnly':!0x0,'hidden':!0x0});}['addToConversationContext'](_0x5ab064){for(const _0x4bde97 of _0x5ab064['values']())this['_addToConversationContextItem'](_0x4bde97);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'](_0x269f26){return Array['from'](_0x269f26['values']())['map'](_0xf1044c=>this['_mapContextItemToRequestData'](_0xf1044c))['filter'](_0x49ccb1=>null!==_0x49ccb1);}async['addFilesToContext'](_0xd7e70b,_0x53227a,_0x371932='file'){const _0x49ad05='files-'+at();this['_startUploadOperation'](_0x49ad05);try{await Promise['all'](_0xd7e70b['map'](async _0x31a5db=>{const _0x3ae5d4='file-'+at(),_0x358527=_0x2fa763(_0x31a5db['name']);try{this['_addContextItem']({'type':_0x371932,'label':_0x53227a?.['label']||_0x358527,'uiId':_0x3ae5d4,'resourceId':_0x53227a?.['resourceId']},!0x0);const _0x19f301=this['_connector']['uploadFile'](this['_ownerId'],_0x31a5db,_0x53227a);this['_ongoingUploads']['set'](_0x3ae5d4,_0x19f301['abortController']);const {id:_0x3756cb}=await _0x19f301['getId']();this['_ongoingUploads']['delete'](_0x3ae5d4),this['_finishContextItemLoading']({'type':_0x371932,'id':_0x3756cb,'label':_0x53227a?.['label']||_0x358527,'uiId':_0x3ae5d4,'resourceId':_0x53227a?.['resourceId']},!0x1);}catch(_0x5bed93){this['_ongoingUploads']['delete'](_0x3ae5d4);if(!(_0x5bed93 instanceof ot&&_0x5bed93['message']['startsWith']('ai-request-aborted'))){const _0x1df1e3=Ls['get'](_0x5bed93['code'])||'ai-chat-file-upload-failed',_0x59f8ac=new ot(_0x1df1e3,null,{'fileName':_0x358527,..._0x5bed93});_0x59f8ac['stack']=_0x5bed93['stack'],this['fire']('error',{'error':_0x59f8ac});}this['_removeContextItem'](_0x3ae5d4);}}));}finally{this['_finishUploadOperation'](_0x49ad05);}}['addCurrentDocumentToContext'](_0x20b50c){if(this['isCurrentDocumentInContext']()||!this['_addContextOptionsState']['document']['enabled'])return;const _0x219a38={'type':'document','uiId':'current-document','label':_0x20b50c,'isReadOnly':this['_conversationContextItems']['has']('current-document'),'hidden':this['_conversationContextItems']['has']('current-document')};this['_addContextItem'](_0x219a38);}async['updateCurrentDocument'](_0x393d4e,_0xe3467d,_0x2dc042,_0x4cc3e8){const _0x3addfe=this['_pendingContextItems']['get']('current-document');if(_0x3addfe&&_0x393d4e){_0x3addfe['selection']=_0x4cc3e8?_0x4cc3e8['map'](_0x53550b=>({'start':_0x53550b['start'],'end':_0x53550b['end']})):[];try{if(_0x3addfe['version']===_0xe3467d)return;const {id:_0x1d9295}=await this['_connector']['uploadDocument'](this['_ownerId'],_0x393d4e,{'version':_0xe3467d,'sessionId':_0x2dc042})['getId']();_0x3addfe['id']=_0x1d9295,_0x3addfe['content']=_0x393d4e,_0x3addfe['version']=_0xe3467d,_0x3addfe['sessionId']=_0x2dc042;}catch(_0xf24f18){const _0x480014=new ot('ai-chat-document-upload-failed',null);_0x480014['stack']=_0xf24f18['stack'],this['fire']('error',{'error':_0x480014});}}}['addSelectionToContext'](_0x50270a){this['_addContextItem']({'type':'selection','label':_0x50270a,'uiId':'selection','content':_0x50270a});}['removeSelectionFromContext'](){this['_removeContextItem']('selection');}async['addUrlToContext'](_0x1efba8,_0x5e543f){const _0x24f1f9='url-'+at();this['_startUploadOperation'](_0x24f1f9);const _0x321399='url-'+at();try{this['_addContextItem']({'type':'web-resource','label':_0x5e543f?.['label']||_0x1efba8,'uiId':_0x321399,'resourceId':_0x5e543f?.['resourceId']},!0x0);const _0x541948=this['_connector']['uploadUrl'](this['_ownerId'],_0x1efba8,_0x5e543f);this['_ongoingUploads']['set'](_0x321399,_0x541948['abortController']);const {id:_0x9a23b}=await _0x541948['getId']();this['_ongoingUploads']['delete'](_0x321399),this['_finishContextItemLoading']({'type':'web-resource','id':_0x9a23b,'label':_0x5e543f?.['label']||_0x1efba8,'uiId':_0x321399,'resourceId':_0x5e543f?.['resourceId']},!0x1);}catch(_0x1a8431){this['_ongoingUploads']['delete'](_0x321399),(_0x1a8431['message']['startsWith']('ai-request-aborted')||this['fire']('error',{'error':new ot('ai-chat-url-upload-failed',this,{'url':_0x1efba8,'originalError':_0x1a8431}),'url':_0x1efba8}),this['_removeContextItem'](_0x321399));}finally{this['_finishUploadOperation'](_0x24f1f9);}}['addToolItemToContext'](_0x1537a7){_0x1537a7['id']=_0x1537a7['id']??at()['substring'](0x0,0x15),this['_pendingContextItems']['set'](_0x1537a7['uiId'],_0x1537a7),this['fire']('contextItemAdded',{'contextItem':_0x1537a7,'isLoading':!0x1});}async['loadSourceResources'](_0x1d031d,_0x23a16d,_0x15afcd){const _0x1af54f=this['_addContextOptionsState']['sources']['find'](_0x438576=>_0x438576['id']===_0x1d031d);if(!_0x1af54f)return this['fire']('error',{'error':new ot('ai-chat-source-not-found',this,{'sourceId':_0x1d031d}),'sourceId':_0x1d031d}),[];try{const _0x25ae7d=(await _0x1af54f['getResources'](_0x23a16d))['map'](_0x579dc1=>{const _0x122acc=this['_isResourceInContext'](_0x579dc1['id']);return{..._0x579dc1,'isInContext':_0x122acc};});return _0x1af54f['resources']=_0x25ae7d,this['fire']('sourceResourcesLoaded',{'sourceId':_0x1d031d,'source':_0x1af54f,'resources':_0x25ae7d,'uid':_0x15afcd}),_0x25ae7d;}catch(_0x598a14){return this['fire']('error',{'error':new ot('ai-chat-source-resources-load-failed',this,{'sourceId':_0x1d031d,'originalError':_0x598a14}),'sourceId':_0x1d031d,'sourceLabel':_0x1af54f['label']}),[];}}async['addResourceToContext'](_0x3291a3,_0x1df0e4){if(this['_isResourceInContext'](_0x1df0e4['id']))return;let _0x22e000=_0x1df0e4['data'];if(!_0x22e000&&_0x3291a3['getData'])try{_0x22e000=await _0x3291a3['getData'](_0x1df0e4['id']);}catch(_0x6f0ac8){return void this['fire']('error',{'error':new ot('ai-chat-resource-load-failed',this,{'resourceId':_0x1df0e4['id'],'sourceId':_0x3291a3['id'],'originalError':_0x6f0ac8}),'resourceId':_0x1df0e4['id'],'sourceId':_0x3291a3['id']});}if(_0x22e000)switch(_0x1df0e4['type']){case'web-resource':if('string'!=typeof _0x22e000)return void this['fire']('error',{'error':new ot('ai-chat-context-invalid-data',this,{'resourceId':_0x1df0e4['id'],'sourceId':_0x3291a3['id'],'expectedType':'string','actualType':typeof _0x22e000}),'resourceId':_0x1df0e4['id'],'sourceId':_0x3291a3['id']});await this['addUrlToContext'](_0x22e000,{'label':_0x1df0e4['label'],'resourceId':_0x1df0e4['id']});break;case'file':if(!(_0x22e000 instanceof File))return void this['fire']('error',{'error':new ot('ai-chat-context-invalid-data',this,{'resourceId':_0x1df0e4['id'],'sourceId':_0x3291a3['id'],'expectedType':'File','actualType':typeof _0x22e000}),'resourceId':_0x1df0e4['id'],'sourceId':_0x3291a3['id']});await this['addFilesToContext']([_0x22e000],{'label':_0x1df0e4['label'],'resourceId':_0x1df0e4['id']});break;case'text':if('object'!=typeof _0x22e000||!('content'in _0x22e000)||!('type'in _0x22e000))return void this['fire']('error',{'error':new ot('ai-chat-context-invalid-data',this,{'resourceId':_0x1df0e4['id'],'sourceId':_0x3291a3['id'],'expectedType':'object\x20with\x20content\x20and\x20type\x20properties','actualType':typeof _0x22e000}),'resourceId':_0x1df0e4['id'],'sourceId':_0x3291a3['id']});_0x22e000=Ps['_convertTextResourceToFile'](_0x22e000,_0x1df0e4['label']),await this['addFilesToContext']([_0x22e000],{'label':_0x1df0e4['label'],'resourceId':_0x1df0e4['id']},'text');break;case'mcp-tool-context':break;default:this['fire']('error',{'error':new ot('ai-chat-context-unsupported-type',this,{'resourceId':_0x1df0e4['id'],'sourceId':_0x3291a3['id'],'resourceType':_0x1df0e4['type']}),'resourceId':_0x1df0e4['id'],'sourceId':_0x3291a3['id']});}else this['fire']('error',{'error':new ot('ai-chat-resource-no-data',this,{'resourceId':_0x1df0e4['id'],'sourceId':_0x3291a3['id']}),'resourceId':_0x1df0e4['id'],'sourceId':_0x3291a3['id']});}static['_convertTextResourceToFile'](_0x56d555,_0x48ab5f){switch(_0x56d555['type']){case'markdown':return new File([_0x56d555['content']],_0x48ab5f,{'type':'text/markdown'});case'html':return new File([_0x56d555['content']],_0x48ab5f,{'type':'text/html'});default:return new File([_0x56d555['content']],_0x48ab5f,{'type':'text/plain'});}}static['_mapContextItemToRequestData'](_0x2ae168){switch(_0x2ae168['type']){case'file':case'text':return{'type':'file','id':_0x2ae168['id']};case'web-resource':return{'type':'web-resource','id':_0x2ae168['id']};case'document':return{'type':'document','id':_0x2ae168['id'],..._0x2ae168['selection']?.['length']&&{'selection':_0x2ae168['selection']}};case'mcp-tool-context':{const _0x1450ca=_0x2ae168;return{'type':'mcp-tool-context','mcpServerName':_0x1450ca['mcpServerName'],'toolName':_0x1450ca['toolName'],'data':_0x1450ca['data'],'id':_0x1450ca['id']};}default:return null;}}['_addContextItem'](_0x3d5a6d,_0x229fbd=!0x1){if(this['_pendingContextItems']['set'](_0x3d5a6d['uiId'],_0x3d5a6d),_0x3d5a6d['hidden']||this['fire']('contextItemAdded',{'contextItem':_0x3d5a6d,'isLoading':_0x229fbd}),'current-document'===_0x3d5a6d['uiId']&&this['_toggleAddCurrentDocumentOptionVisibility'](),_0x3d5a6d['resourceId']){const _0x9ca4e3=this['_findSourceIdsByResourceId'](_0x3d5a6d['resourceId']);_0x9ca4e3&&_0x9ca4e3['forEach'](_0xc79068=>{this['_updateResourceInContextState'](_0xc79068,_0x3d5a6d['resourceId'],!0x0);});}}['_removeContextItem'](_0x366d58){const _0x3089f5=this['_pendingContextItems']['get'](_0x366d58),_0x85f4fe=this['_ongoingUploads']['get'](_0x366d58);if(_0x85f4fe&&(_0x85f4fe['abort'](),this['_ongoingUploads']['delete'](_0x366d58)),_0x3089f5?.['resourceId']){const _0xc0bf9e=this['_findSourceIdsByResourceId'](_0x3089f5['resourceId']);_0xc0bf9e&&_0xc0bf9e['forEach'](_0xa59e1f=>{this['_updateResourceInContextState'](_0xa59e1f,_0x3089f5['resourceId'],!0x1);});}this['_pendingContextItems']['delete'](_0x366d58),this['fire']('contextItemRemoved',{'uiId':_0x366d58,'type':_0x3089f5?.['type']}),'current-document'===_0x366d58&&this['_toggleAddCurrentDocumentOptionVisibility']();}['_finishContextItemLoading'](_0x3158ea,_0x508a0c){if(this['_pendingContextItems']['has'](_0x3158ea['uiId'])&&(this['_pendingContextItems']['set'](_0x3158ea['uiId'],_0x3158ea),this['fire']('contextItemLoadingEnded',{'contextItem':_0x3158ea,'isLoading':_0x508a0c}),_0x3158ea['resourceId'])){const _0xef7f92=this['_findSourceIdsByResourceId'](_0x3158ea['resourceId']);_0xef7f92&&_0xef7f92['forEach'](_0x5707f4=>{this['_updateResourceInContextState'](_0x5707f4,_0x3158ea['resourceId'],!0x0);});}}['_addToConversationContextItem'](_0x53e392){this['_conversationContextItems']['set'](_0x53e392['uiId'],_0x53e392);}['_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'](_0x67d0e8=>({..._0x67d0e8,'enabled':!0x0}))??[]},this['fire']('addContextOptionsChanged',{'options':this['_addContextOptionsState']});}['_getCustomSourcesInitialState'](){return this['_config']?.['sources']?.['map'](_0x8af2d5=>({..._0x8af2d5,'resources':[]}))??[];}['_toggleAddCurrentDocumentOptionVisibility'](){const _0x425636=this['isCurrentDocumentInContext']()||this['isCurrentDocumentInConversation']();this['_addContextOptionsState']['document']['isHidden']=_0x425636,this['fire']('addContextOptionsChanged',{'options':this['_addContextOptionsState']});}['_isResourceInContext'](_0x1df6c8){for(const _0x4a2abd of this['_pendingContextItems']['values']())if(_0x4a2abd['resourceId']===_0x1df6c8)return!0x0;for(const _0x111dc1 of this['_conversationContextItems']['values']())if(_0x111dc1['resourceId']===_0x1df6c8)return!0x0;return!0x1;}['_findSourceIdsByResourceId'](_0x50be0f){const _0x161a90=[];for(const _0x57c20c of this['_addContextOptionsState']['sources']){_0x57c20c['resources']['find'](_0x13a65a=>_0x13a65a['id']===_0x50be0f)&&_0x161a90['push'](_0x57c20c['id']);}return 0x0===_0x161a90['length']?null:_0x161a90;}['_updateResourceInContextState'](_0x1c2c26,_0x49df4a,_0x540d2d){const _0x44c76b=this['_addContextOptionsState']['sources']['find'](_0xa68d70=>_0xa68d70['id']===_0x1c2c26);if(!_0x44c76b)return;const _0x43d6ca=_0x44c76b['resources']['find'](_0x146843=>_0x146843['id']===_0x49df4a);_0x43d6ca&&(_0x43d6ca['isInContext']=_0x540d2d,this['fire']('resourceStateChanged',{'sourceId':_0x1c2c26,'resourceId':_0x49df4a,'isInContext':_0x540d2d}));}['_startUploadOperation'](_0x13403f){this['_ongoingUploadOperations']['set'](_0x13403f,!0x0),this['_ongoingUploadOperations']['size']&&this['fire']('uploadProgressChanged',{'isUploadInProgress':!0x0});}['_finishUploadOperation'](_0x26d6e2){this['_ongoingUploadOperations']['delete'](_0x26d6e2),0x0===this['_ongoingUploadOperations']['size']&&this['fire']('uploadProgressChanged',{'isUploadInProgress':!0x1});}}const Hs=['capabilitiesUpdated'];class Ms extends pt(){['_isWebSearchEnabled'];['_isReasoningEnabled'];constructor(){super(),this['_isWebSearchEnabled']=!0x1,this['_isReasoningEnabled']=!0x1;}['init'](){this['reset']();}['reset'](){this['setWebSearch'](!0x1),this['setReasoning'](!0x1);}['getCapabilitiesConfig'](){return{'isWebSearchEnabled':this['_isWebSearchEnabled'],'isReasoningEnabled':this['_isReasoningEnabled']};}static['getCapabilitiesRequestData'](_0x52551a){const _0x3e4ebb={};return _0x52551a&&_0x52551a['isWebSearchEnabled']&&(_0x3e4ebb['webSearch']={}),_0x52551a&&_0x52551a['isReasoningEnabled']&&(_0x3e4ebb['reasoning']={}),_0x3e4ebb;}['toggleWebSearch'](){this['setWebSearch'](!this['_isWebSearchEnabled']);}['toggleReasoning'](){this['setReasoning'](!this['_isReasoningEnabled']);}['setWebSearch'](_0x3cbf8c){_0x3cbf8c!==this['_isWebSearchEnabled']&&(this['_isWebSearchEnabled']=_0x3cbf8c,this['fire']('capabilitiesUpdated',this['getCapabilitiesConfig']()));}['setReasoning'](_0x16a943){_0x16a943!==this['_isReasoningEnabled']&&(this['_isReasoningEnabled']=_0x16a943,this['fire']('capabilitiesUpdated',this['getCapabilitiesConfig']()));}}class Us extends xs{['userMessage'];['conversationId'];['contextItems']=new Map();['capabilities'];['model'];['attributes'];constructor(_0x1d84ea){super(_0x1d84ea),this['conversationId']=_0x1d84ea['conversationId'],this['contextItems']=_0x1d84ea['contextItems'],this['capabilities']=_0x1d84ea['capabilities'],this['userMessage']=_0x1d84ea['userMessage'],this['model']=_0x1d84ea['model'],this['attributes']=_0x1d84ea['attributes'];}async['sendRequest'](){return this['connector']['queryAssistant']({'message':this['userMessage'],'conversationId':this['conversationId'],'parts':Ps['mapContextItemsToRequestData'](this['contextItems']),'capabilities':Ms['getCapabilitiesRequestData'](this['capabilities']),'model':this['model'],'attributes':this['attributes']});}['getDocumentContext'](){return this['contextItems']['get']('current-document');}}class Vs extends pt(){['id'];['isStarted']=!0x1;['isFromHistory'];['interactions']=[];['currentInteraction'];['selectedModel'];['connector'];['options'];constructor(_0x44ee0b){super(),this['options']=_0x44ee0b,this['connector']=_0x44ee0b['connector'],this['chatModels']=_0x44ee0b['chatModels'],this['id']=_0x44ee0b['conversationId'],this['isFromHistory']=_0x44ee0b['isFromHistory'];}async['init'](_0x897eb9){try{this['chatContext']=new Ps({'connector':this['connector'],'config':_0x897eb9,'ownerId':this['id']}),this['chatContext']['delegate'](...Ds)['to'](this),this['chatContext']['init'](),this['chatCapabilities']=new Ms(),this['chatCapabilities']['delegate'](...Hs)['to'](this),this['chatCapabilities']['init']();const _0x178606=await this['chatModels']['getAvailableModels']();this['fire']('conversationInitialized',{'availableModels':_0x178606});const _0x1197e6=await this['chatModels']['getModel'](this['options']['selectedModelId']);_0x1197e6&&await this['setModel'](_0x1197e6);}catch(_0x379975){const _0x53db88=new ot('ai-chat-conversation-init-failed',null,{'message':_0x379975['message']||_0x379975});_0x53db88['stack']=_0x379975['stack'],this['fire']('error',{'error':_0x53db88});}}async['start'](){if(this['isStarted'])throw new ot('ai-chat-conversation-already-started',null,{'conversation':this});if(!this['selectedModel'])throw new ot('ai-chat-conversation-start-no-model-selected',null,{'conversation':this});try{const {id:_0x4108b0}=await this['connector']['startConversation'](this['id'],this['options']['group'])['getConversation']();this['id']=_0x4108b0,this['isStarted']=!0x0,this['fire']('conversationStarted',{'conversationId':this['id'],'selectedModel':this['selectedModel']});}catch(_0x389149){const _0x4c1e51=new ot('ai-chat-conversation-start-failed',null,{'message':_0x389149['message'],'conversationId':this['id']});throw _0x4c1e51['stack']=_0x389149['stack'],this['fire']('error',{'error':_0x4c1e51}),_0x4c1e51;}}async['load'](_0x44675d,_0x2534de){try{const _0x14e8d4=await this['connector']['fetchConversation'](_0x44675d)['getConversation'](),_0x2fba01=await this['connector']['fetchConversationMessages'](_0x44675d)['getMessages'](),_0x2200b3=_0x2fba01[0x0]['model'];this['isStarted']=!0x0,this['id']=_0x14e8d4['id'],'title'in _0x14e8d4?this['fire']('setConversationTitle',_0x14e8d4['title'],!0x0):this['fire']('setConversationTitle','',!0x0);const _0x250e4d=(await this['chatModels']['getAll']())['find'](_0x5621ad=>_0x5621ad['id']['toLowerCase']()===_0x2200b3['toLowerCase']());return this['selectedModel']=_0x250e4d,this['fire']('modelSelected',{'selectedModel':_0x250e4d,'isDisabled':!0x0}),await this['_processMessagesToInteractions'](_0x2fba01,_0x2534de,_0x2200b3),this['currentInteraction']=void 0x0,this;}catch(_0x1c7e03){const _0x302734=new ot('ai-chat-conversation-init-from-id-failed',null,{'message':_0x1c7e03['message'],'conversationId':_0x44675d});throw _0x302734['stack']=_0x1c7e03['stack'],this['fire']('error',{'error':_0x302734}),_0x302734;}}async['_processMessagesToInteractions'](_0x4978c8,_0x5aa53e,_0x78503a){let _0x1534a2;for(const _0x2602a4 of _0x4978c8)if('user'===_0x2602a4['role']){const _0x48c000=await this['_extractContextItems'](_0x2602a4),_0x5cd9a3={'isReasoningEnabled':Object['hasOwn'](_0x2602a4['capabilities'],'reasoning'),'isWebSearchEnabled':Object['hasOwn'](_0x2602a4['capabilities'],'webSearch')};_0x1534a2=this['createInteraction']({'userMessage':_0x2602a4['prompt'],'contextItems':_0x48c000,'capabilities':_0x5cd9a3,'modelId':_0x78503a,'attributes':_0x2602a4['attributes']}),this['currentInteraction']=_0x1534a2,this['chatContext']['addToConversationContext'](this['currentInteraction']['contextItems']);}else{if('assistant'===_0x2602a4['role']&&_0x1534a2){const _0x55bfa4=[];for(const _0x4e4998 of _0x2602a4['content'])switch(_0x4e4998['type']){case'text':case'modification':{const _0x5f1f1c=_0x1534a2['getDocumentContext']()?.['sessionId']!==_0x5aa53e;_0x1534a2['currentReply']=_0x1534a2['createReply']({'type':_0x4e4998['type'],'isDone':!0x0,'interactionId':_0x1534a2['id'],'areActionsDisabled':_0x5f1f1c}),_0x1534a2['currentReply']['appendContent'](_0x4e4998['content']),_0x55bfa4['length']>0x0&&(_0x1534a2['currentReply']['sources']=_0x55bfa4['splice'](0x0));break;}case'url':_0x55bfa4['push'](_0x4e4998);break;case'mcp-tool-result':{const {data:_0x493b4e,attributes:_0x39d084}=JSON['parse'](_0x4e4998['content']);_0x1534a2['_handleToolResultData']({'toolName':_0x4e4998['toolName'],'data':_0x493b4e,'attributes':_0x39d084});break;}}}}}async['_extractContextItems'](_0x1b4dbc){const _0x11bef5=new Map();if(!_0x1b4dbc['content'])return _0x11bef5;for(const _0x503ee0 of _0x1b4dbc['content']){const _0x9e5bb5=await this['chatContext']['populateFromMessage'](_0x503ee0);_0x9e5bb5&&_0x11bef5['set'](_0x9e5bb5['id'],_0x9e5bb5);}return _0x11bef5;}async['handleUserInteraction']({userMessage:_0xae5aba,attributes:_0x194203}){if(!this['isStarted'])throw new ot('ai-chat-handle-user-conversation-not-initialized',null,{'conversation':this});if(this['currentInteraction'])throw new ot('ai-chat-handle-user-interaction-already-in-progress',null,{'conversation':this});try{const _0xd2e3b4=this['chatContext']['getPendingContextItems'](),_0x5e0b30=this['chatCapabilities']['getCapabilitiesConfig'](),_0x96b43a=this['selectedModel']['id'];this['currentInteraction']=this['createInteraction']({'userMessage':_0xae5aba,'contextItems':_0xd2e3b4,'capabilities':_0x5e0b30,'modelId':_0x96b43a,'attributes':_0x194203}),await this['currentInteraction']['start'](),this['chatContext']['addToConversationContext'](this['currentInteraction']['contextItems']);}catch(_0x5bce04){if(_0x5bce04 instanceof ot)this['fire']('error',{'interactionId':this['currentInteraction']?this['currentInteraction']['id']:void 0x0,'error':_0x5bce04});else{const _0x530d5b=Ls['get'](_0x5bce04['code'])||'ai-chat-handle-user-interaction-start-failed';this['fire']('error',{'interactionId':this['currentInteraction']?this['currentInteraction']['id']:void 0x0,'error':new ot(_0x530d5b,null,{'error':_0x5bce04})});}}finally{this['currentInteraction']?.['stop'](),this['currentInteraction']=void 0x0;}}['createInteraction']({userMessage:_0x2e4733,contextItems:_0x4d4a56,capabilities:_0x28aa7d,modelId:_0x4d3384,attributes:_0x58af2f}){const _0x1054b8=new Us({'userMessage':_0x2e4733,'contextItems':_0x4d4a56,'capabilities':_0x28aa7d,'conversationId':this['id'],'connector':this['connector'],'editor':this['options']['getEditor']&&this['options']['getEditor'](),'model':_0x4d3384,'attributes':_0x58af2f});return _0x1054b8['delegate'](...ys)['to'](this),this['interactions']['push'](_0x1054b8),this['fire']('interactionCreated',_0x1054b8),_0x1054b8;}['getInteraction'](_0x1d04d8){return this['interactions']['find'](_0x55bb02=>_0x55bb02['id']===_0x1d04d8);}['removeInteraction'](_0x3fd1b7){const _0x2d9e18=this['getInteraction'](_0x3fd1b7);_0x2d9e18&&(_0x2d9e18['destroy'](),this['interactions']['splice'](this['interactions']['indexOf'](_0x2d9e18),0x1));}get['lastInteraction'](){return this['interactions'][this['interactions']['length']-0x1];}['addCurrentDocumentToContext'](_0x3d2a6e){this['chatContext']['addCurrentDocumentToContext'](_0x3d2a6e);}async['updateCurrentDocumentInContext']({content:_0x37c8cc,version:_0x42d9d0,sessionId:_0xbb5ca3,selections:_0xc0c37c}){await this['chatContext']['updateCurrentDocument'](_0x37c8cc,_0x42d9d0,_0xbb5ca3,_0xc0c37c);}['getCurrentDocumentContext'](){return this['currentInteraction']?.['getDocumentContext']()?.['content']||'';}['addSelectionToContext'](_0x537c78){this['chatContext']['addSelectionToContext'](_0x537c78);}['removeSelectionFromContext'](){this['chatContext']['removeSelectionFromContext']();}['addFilesToContext'](_0x1914a9){this['chatContext']['addFilesToContext'](_0x1914a9);}['addUrlToContext'](_0x3cd8c2){this['chatContext']['addUrlToContext'](_0x3cd8c2);}['addToolItemToContext'](_0x3447b2){this['chatContext']['addToolItemToContext'](_0x3447b2);}['addResourceToContext'](_0x254b59,_0x5ebbe7){this['chatContext']['addResourceToContext'](_0x254b59,_0x5ebbe7);}['loadSourceResources'](_0x120680,_0x14a9f3,_0x5306eb){return this['chatContext']['loadSourceResources'](_0x120680,_0x14a9f3,_0x5306eb);}['removeFromContext'](_0x261ab9){this['chatContext']['removeFromContext'](_0x261ab9);}['setWebSearch'](_0xaa91d1){this['chatCapabilities']['setWebSearch'](_0xaa91d1);}['toggleWebSearch'](){this['chatCapabilities']['toggleWebSearch']();}['setReasoning'](_0x34b921){this['chatCapabilities']['setReasoning'](_0x34b921);}['toggleReasoning'](){this['chatCapabilities']['toggleReasoning']();}['isCurrentDocumentInContext'](){return this['chatContext']['isCurrentDocumentInContext']();}['isCurrentDocumentInConversation'](){return this['chatContext']['isCurrentDocumentInConversation']();}['isSelectionInContext'](){return this['chatContext']['isSelectionInContext']();}async['setModel'](_0x3284c3){_0x3284c3?!0x1===await this['chatModels']['isAvailable'](_0x3284c3)&&(It('ai-chat-conversation-set-model-not-available',{'conversation':this,'model':_0x3284c3}),_0x3284c3=(await this['chatModels']['getAvailableModels']())[0x0]):(It('ai-chat-conversation-set-model-null',{'conversation':this}),_0x3284c3=(await this['chatModels']['getAvailableModels']())[0x0]),_0x3284c3['id']!==this['selectedModel']?.['id']&&(this['selectedModel']=_0x3284c3,this['chatCapabilities']['reset'](),this['fire']('modelSelected',{'selectedModel':_0x3284c3}));}}class Bs extends pt(){['_connector'];['_config'];['_locale'];['_modelList']=[];['_modelsRequest']=null;constructor({connector:_0x266006,config:_0x428076,locale:_0x373495}){super(),this['_connector']=_0x266006,this['_config']=_0x428076,this['_locale']=_0x373495;}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 _0x1e4dbc=await this['getAll']();let _0xd8eed6;return _0xd8eed6=this['_availableModels']?this['_filterModels'](_0x1e4dbc,this['_availableModels']):_0x1e4dbc['filter'](_0x4d6f9f=>_0x4d6f9f['recommended']),_0xd8eed6;}async['getModel'](_0x14d09f){const _0x51f880=await this['getAll']();if(!_0x51f880['length'])return null;if(_0x14d09f){const _0x21679e=this['_getModelById'](_0x51f880,_0x14d09f);if(_0x21679e)return _0x21679e;It('ai-chat-model-id-unrecognized',{'modelId':_0x14d09f,'fallBackModelId':this['_defaultModelId']});}return this['getDefault']();}async['getDefault'](){const _0x1613f8=await this['getAvailableModels']();if(!_0x1613f8['length'])return null;if(this['_defaultModelId']){const _0x587c70=this['_getModelById'](_0x1613f8,this['_defaultModelId']);if(_0x587c70)return _0x587c70;It('ai-chat-default-model-id-unrecognized',{'defaultModelId':this['_defaultModelId'],'fallBackModelId':_0x1613f8[0x0]['id']});}return _0x1613f8[0x0];}async['isAvailable'](_0x3e9657){return(await this['getAvailableModels']())['some'](_0x1b5c03=>_0x1b5c03['name']===_0x3e9657['name']&&_0x1b5c03['provider']===_0x3e9657['provider']);}async['_retrieveModels'](){if(!this['_modelList']['length'])try{const _0x172308=this['_locale']['uiLanguage']||'en',_0x4676aa=this['_connector']['getModels'](_0x172308),_0x2c855f=await _0x4676aa['list']();this['_modelList']=_0x2c855f['items']['map'](_0x3f79d6=>Gs(_0x3f79d6)?{..._0x3f79d6,'name':as(this['_locale'],'AI_MODEL_NAME_AUTO')}:_0x3f79d6);}catch(_0x185085){throw Et('ai-models-unable-to-retrieve',{'error':_0x185085}),_0x185085;}return[...this['_modelList']];}['_filterModels'](_0x127da1,_0x5d6089){let _0x3443ad;if(_0x5d6089){_0x3443ad=[];const _0x257953=new Set(),_0x1763ed='string'==typeof _0x5d6089?[_0x5d6089['toLocaleLowerCase']()]:_0x5d6089['map'](_0x474fd4=>_0x474fd4['toLocaleLowerCase']());for(const _0x1179c5 of _0x1763ed)for(const _0x5c3b65 of _0x127da1)!_0x257953['has'](_0x5c3b65['id'])&&this['_isMatchingFilter'](_0x5c3b65,_0x1179c5)&&(_0x3443ad['push'](_0x5c3b65),_0x257953['add'](_0x5c3b65['id']));}else _0x3443ad=_0x127da1;return _0x3443ad;}['_isMatchingFilter'](_0x338b6c,_0x4945fa){const _0x381166=_0x338b6c['id']['toLocaleLowerCase'](),_0x475b96=_0x338b6c['name']['toLocaleLowerCase'](),_0x565941=_0x338b6c['provider']['toLocaleLowerCase']();return _0x381166===_0x4945fa||_0x475b96===_0x4945fa||Gs(_0x338b6c)&&'auto'===_0x4945fa||_0x565941===_0x4945fa||_0x381166['startsWith'](_0x4945fa);}['_getModelById'](_0x3f89d1,_0x18b55c){return _0x3f89d1['find'](_0x51d17d=>Gs(_0x51d17d)&&'auto'===_0x18b55c?_0x51d17d:_0x51d17d['id']===_0x18b55c)||null;}}function Gs(_0x3f3692){return _0x3f3692['id']['startsWith']('agent');}function Fs(_0x5537c3){if(_0x5537c3 instanceof _0x20ae3c)return _0x5537c3;if(_0x5537c3?.['editors']&&_0x5537c3['editors']['get'](0x0))return _0x5537c3['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.'),_0x5537c3['editors']['get'](0x0);throw new ot('ai-get-editor-from-context-no-editor');}function Ks({editor:_0x3a7f32,interaction:_0x3d3556,reply:_0x1a2921,groups:_0x53aced,transform:_0x36947b,documentCompare:_0x23bd26,documentCompareOptions:_0x25d42a}){const _0x4a8764=_0x3d3556['getDocumentContext']();if(!_0x4a8764)return[];const _0x4d8000=_0x4a8764['content'],_0x49ad81=_0x4a8764['version'],_0x246f86=_0x1a2921['documentContextContent']['cloneNode'](!0x0);for(const {changes:_0x314225}of _0x53aced){const _0x368e69=_0x314225['filter'](_0x59e6fa=>'new'!=_0x59e6fa['type'])['map'](_0x213d5c=>_s('data-id',_0x213d5c['id'],_0x246f86)),_0x3997c2=_0x314225['filter'](_0x4fc6c3=>'removed'!=_0x4fc6c3['type'])['map'](_0x3d65d1=>_0x3d65d1['node']['cloneNode'](!0x0));let _0x1bbf11=null;if(_0x368e69['length']){_0x1bbf11=_0x368e69[0x0]['previousSibling'];for(let _0x5ebfb8=0x0;_0x5ebfb8<_0x368e69['length'];_0x5ebfb8++)_0x13f11d(_0x368e69[_0x5ebfb8]);}if(_0x3997c2['length']){_0x1bbf11||(_0x314225[0x0]['anchorId']?_0x1bbf11=_s('data-id',_0x314225[0x0]['anchorId'],_0x246f86):(_0x1bbf11=_0x3997c2['shift'](),_0x480634(_0x246f86,_0x1bbf11)));for(let _0x3f6664=0x0;_0x3f6664<_0x3997c2['length'];_0x3f6664++)_0x1ac603(_0x1bbf11,_0x3997c2[_0x3f6664]),_0x1bbf11=_0x3997c2[_0x3f6664];}}const _0x4bb529=ds(_0x246f86),_0x27dc0e=_0x23bd26['getDiff'](_0x4d8000,_0x4bb529,_0x25d42a)['getOperations']();if(_0x36947b){const _0x216b65=_0x3a7f32['model']['document']['history']['getOperations'](_0x49ad81),_0x300cd3={'document':_0x3a7f32['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1};return _0x4693a2(_0x27dc0e,_0x216b65,_0x300cd3)['operationsA'];}return _0x27dc0e;}function Ws(_0x9f3061,_0x13c653){if('marker'!=_0x13c653['type'])return;const _0x3e9b6e=_0x9f3061['model']['markers']['get'](_0x13c653['name']);_0x3e9b6e&&(_0x13c653['oldRange']=_0x3e9b6e['getRange']());}class Ys extends _0x333531{['activeConversation'];['_aiEditing'];['_aiConnector'];['_aiChatUi'];['_aiChatModels'];['_aiChatBalloon'];['_batchToChanges']=new Map();['_currentPreviewedChangeGroup']=null;['_bodyCollection'];static get['requires'](){return[rs,_0x515afb];}static get['pluginName'](){return'AIChatController';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){this['_bodyCollection']=new qt(this['context']['locale']),this['_bodyCollection']['attachToDom'](),this['_aiConnector']=this['context']['plugins']['get']('AIConnector'),this['_aiChatUi']=this['context']['plugins']['get']('AIChatUI'),this['_aiEditing']=this['context']['plugins']['get']('AIEditing'),this['_aiChatModels']=new Bs({'connector':this['_aiConnector'],'config':this['context']['config']['get']('ai.models'),'locale':this['context']['locale']});const _0x13a8d7=this['context']['plugins']['get']('AITabs');this['listenTo'](this['_aiChatUi'],'startConversation',()=>{this['_startConversationSafely']();}),this['listenTo'](this['_aiChatUi'],'sendUserMessage',(_0x1d0aa7,_0x3eacbd)=>{this['_handleUIUserMessage']({'message':_0x3eacbd});}),this['listenTo'](_0x13a8d7,'resizedTabs',(_0x49ab37,_0x3f39a4)=>{this['_setIsMaximized'](_0x3f39a4);}),this['listenTo'](this['_aiChatUi'],'resizeTabs',()=>{_0x13a8d7['resize']();}),this['listenTo'](_0x13a8d7['view'],'change:activeTab',(_0x303a13,_0x346e86,_0x3c098f)=>{'chat'!==_0x3c098f&&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',(_0x1006d4,_0x1ec89f)=>{this['activeConversation']?.['addFilesToContext'](Array['from'](_0x1ec89f));}),this['listenTo'](this['_aiChatUi'],'addUrlToContext',(_0x48706f,_0x542139)=>{this['activeConversation']?.['addUrlToContext'](_0x542139);}),this['listenTo'](this['_aiChatUi'],'executeCustomItemCallback',(_0x432b12,_0x5de165)=>{_0x5de165['callback'](this['context']);}),this['listenTo'](this['_aiChatUi'],'addResourceToContext',(_0xbc2a52,_0x2502c4)=>{this['activeConversation']?.['addResourceToContext'](_0x2502c4['source'],_0x2502c4['resource']);}),this['listenTo'](this['_aiChatUi'],'removeContextItem',(_0x2d18cf,_0x4efddc)=>{this['_removeFromContext'](_0x4efddc);}),this['listenTo'](this['_aiChatUi'],'loadSourceResources',(_0x315d9e,_0x372273)=>{this['activeConversation']?.['loadSourceResources'](_0x372273['sourceId'],_0x372273['query'],_0x372273['uid']);}),this['listenTo'](this['_aiChatUi'],'toggleWebSearch',()=>{this['_toggleWebSearch']();}),this['listenTo'](this['_aiChatUi'],'toggleReasoning',()=>{this['_toggleReasoning']();}),this['listenTo'](this['_aiChatUi'],'selectModel',(_0x593cf9,_0x30f850)=>{this['activeConversation']?.['setModel'](_0x30f850);}),this['listenTo'](this['_aiChatUi'],'like',(_0x2c7c82,{replyId:_0xd3ddc3})=>{console['log']('Liked\x20response',_0xd3ddc3);}),this['listenTo'](this['_aiChatUi'],'dislike',(_0x3e990d,{replyId:_0x5a1554})=>{console['log']('Disliked\x20response',_0x5a1554);}),this['listenTo'](this['_aiChatUi'],'insertSuggestion',(_0x2f81cf,_0x19c97b)=>{this['_insertSuggestion'](_0x19c97b);}),this['listenTo'](this['_aiChatUi'],'showChangeInText',(_0x591c82,{replyId:_0x14190b,partIndex:_0x47067e})=>{this['_aiChatBalloonShowDiff']=this['_aiChatUi']['showDiff'],this['_openBalloonFor'](_0x14190b,_0x47067e);}),this['listenTo'](this['_aiChatUi'],'mouseOverSuggestion',(_0x24264b,{replyId:_0x5f0005,partIndex:_0x42bf44})=>{const _0x4a2f35=this['_getDocumentRangeForReplyChanges'](_0x5f0005,_0x42bf44);_0x4a2f35&&'$graveyard'!=_0x4a2f35['range']['root']['rootName']&&this['_aiEditing']['showFakeVisualSelection']({'ranges':[_0x4a2f35['range']],'id':'change-area','priority':0xa});}),this['listenTo'](this['_aiChatUi'],'mouseLeaveSuggestion',()=>{this['_aiEditing']['hideFakeVisualSelection']('change-area');}),this['listenTo'](this['_aiChatUi'],'applySuggestion',(_0x36b41e,_0x5a671b)=>{this['_aiEditing']['hideFakeVisualSelection']('change-area'),this['_applySuggestion'](_0x5a671b);}),this['listenTo'](this['_aiChatUi'],'toggleSuggestionDisplayMode',async(_0x4563d6,{replyId:_0x341ad5,showDiff:_0x1aabe1})=>{const {reply:_0x299c8e}=this['getInteractionAndReplyById'](_0x341ad5),_0x341595=_0x299c8e['getContentParts']({'showDiff':_0x1aabe1});await this['_aiChatUi']['updateFeedItemAIReplySuggestionContent']({'id':_0x299c8e['id'],'parts':_0x341595,'renderingStrategy':'static'});}),this['listenTo'](this['_aiChatUi'],'rejectSuggestion',(_0x10913c,{replyId:_0x2ac965,partIndex:_0x80f4cc})=>{this['_rejectSuggestion']({'replyId':_0x2ac965,'partIndex':_0x80f4cc}),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:_0xcfdf17,partIndex:_0x3990fb}=this['_currentPreviewedChangeGroup'];this['_aiChatBalloonShowDiff']=!this['_aiChatBalloonShowDiff'];const {reply:_0x5ba2e3}=this['getInteractionAndReplyById'](_0xcfdf17),_0x5278e5=_0x5ba2e3['getContentParts']({'showDiff':this['_aiChatBalloonShowDiff'],'groupIndex':_0x3990fb});this['_aiChatBalloon']['updateContent']({'part':_0x5278e5[0x0],'renderingStrategy':'static','keepErrors':!0x0});}),this['listenTo'](this['_aiChatBalloon'],'applySuggestion',()=>{const {replyId:_0x2f6742,partIndex:_0x417fa0}=this['_currentPreviewedChangeGroup'];this['_applySuggestion']({'replyId':_0x2f6742,'partIndex':_0x417fa0}),this['_aiChatBalloon']['setState']('accepted');}),this['listenTo'](this['_aiChatBalloon'],'insertSuggestion',()=>{const {replyId:_0x53c048,partIndex:_0x34b324}=this['_currentPreviewedChangeGroup'];this['_insertSuggestion']({'replyId':_0x53c048,'partIndex':_0x34b324}),this['_aiChatBalloon']['setState']('accepted');}),this['listenTo'](this['_aiChatBalloon'],'rejectSuggestion',()=>{const {replyId:_0x4f2d8a,partIndex:_0x424885}=this['_currentPreviewedChangeGroup'];this['_rejectSuggestion']({'replyId':_0x4f2d8a,'partIndex':_0x424885}),this['_aiChatBalloon']['setState']('rejected');}),this['listenTo'](this['_aiChatBalloon'],'showNext',()=>{const {replyId:_0x54a0b4,partIndex:_0x1f7a4c}=this['_currentPreviewedChangeGroup'],_0x119005=this['_getPresentableSiblingContentPartIndex'](_0x54a0b4,_0x1f7a4c,'next');null!==_0x119005&&this['_openBalloonFor'](_0x54a0b4,_0x119005);}),this['listenTo'](this['_aiChatBalloon'],'showPrevious',()=>{const {replyId:_0x1a05ce,partIndex:_0x58f3a6}=this['_currentPreviewedChangeGroup'],_0x1d16b4=this['_getPresentableSiblingContentPartIndex'](_0x1a05ce,_0x58f3a6,'previous');null!==_0x1d16b4&&this['_openBalloonFor'](_0x1a05ce,_0x1d16b4);}),this['listenTo'](this['_aiChatBalloon'],'dialogClosed',(_0x21d76d,{id:_0x47f97b})=>{if('aiChatBalloon'!==_0x47f97b)return;const {replyId:_0x529f11,partIndex:_0x5767bf}=this['_currentPreviewedChangeGroup'];this['_currentPreviewedChangeGroup']=null,this['_aiChatUi']['setFeedItemAIReplySuggestionPartActive']({'id':_0x529f11,'index':_0x5767bf,'isActive':!0x1});})),this['on']('interactionCreated',(_0x5d6f49,_0x15214b)=>{this['_aiChatUi']['addFeedItemUserMessage'](_0x15214b);}),this['on']('replyCreated',(_0x39aa4f,_0x533dd3)=>{this['_addFeedItemReply'](_0x533dd3);});}async['afterInit'](){this['context']instanceof _0x20ae3c?this['_integrateEditor'](this['context']):this['listenTo'](this['context']['editors'],'add',(_0x3d2061,_0x1adcf0)=>{_0x1adcf0['on']('ready',()=>{this['_integrateEditor'](_0x1adcf0);});});const _0x4c02bb=this['context']['config']['get']('ai.chat.initialConversation');let _0xd20392=_0x4c02bb;if('lastCreated'!=_0x4c02bb||(_0xd20392=await this['_getLastCreatedConversationId'](),_0xd20392))return'new'==_0xd20392?this['_startConversationSafely']():this['loadConversation'](_0xd20392);}async['destroy'](){return await this['_stopLastInteraction'](),this['_bodyCollection']['detachFromDom'](),super['destroy']();}async['loadConversation'](_0x4cf431){this['context']['plugins']['has']('AIChatBalloon')&&this['context']['plugins']['get']('AIChatBalloon')['close'](),(this['context']['plugins']['get'](ns)['view']['activateTab']('chat'),this['_aiChatUi']['setFeedItemRenderingStrategy']('static'),this['_aiChatUi']['toggleLoadingSkeleton'](!0x0),await this['_stopLastInteraction']());try{await this['_aiConnector']['fetchConversation'](_0x4cf431)['getConversation'](),await this['_startConversationSafely'](_0x4cf431),this['_updateConversationTitle']('\x20'),await this['activeConversation']['load'](_0x4cf431,this['_aiEditing']['sessionId']),this['activeConversation']['isCurrentDocumentInConversation']()&&this['addCurrentDocumentToChatContext']();}catch(_0x34d900){this['_aiChatUi']['addFeedItemError']({'errorMessage':as(this['context']['locale'],'AI_CHAT_UNABLE_TO_LOAD_CONVERSATION'),'id':_0x4cf431}),this['_logError'](new ot('ai-chat-conversation-not-found',this,{'error':_0x34d900}));}finally{this['_aiChatUi']['startAutoScroll'](),this['_aiChatUi']['setFeedItemRenderingStrategy']('streaming'),this['_aiChatUi']['toggleLoadingSkeleton'](!0x1);}}['registerToolDataCallback'](_0x3bb501){let _0x4f5373=null,_0x5ae074=null;this['on']('toolDataReceived',(_0x401737,_0x503d2d,_0x7468d2)=>{_0x7468d2['id']!==_0x4f5373&&(_0x4f5373=_0x7468d2['id'],_0x5ae074=this['_getAIChatFeedAPI'](_0x7468d2)),_0x3bb501(_0x503d2d,_0x5ae074);});}['addCurrentDocumentToChatContext'](){this['activeConversation']?.['addCurrentDocumentToContext'](as(this['context']['locale'],'AI_CHAT_CONTEXT_CURRENT_DOCUMENT'));}async['addSelectionToChatContext'](){const _0x4af4c3=this['_aiEditing']['getSelectionText']();this['activeConversation']?.['addSelectionToContext'](_0x4af4c3),this['addCurrentDocumentToChatContext']();}['removeSelectionFromChatContext'](){this['activeConversation']?.['removeSelectionFromContext']();}['focusPromptInput'](){this['_aiChatUi']['focusPromptInput']();}async['startConversation'](){await this['_startConversationSafely']();}async['sendMessage'](_0xaa95fe){await this['_handleUIUserMessage'](_0xaa95fe);}['getGroupId'](){const _0x2879e4=this['context']['config']['get']('collaboration.channelId');if(!_0x2879e4)throw new ot('ai-chat-missing-channel-id',this);return _0x2879e4;}['_handleRemovedConversation'](_0x3986c3){this['activeConversation']['id']===_0x3986c3&&this['_startConversationSafely']();}['_insertSuggestion'](_0x218568){const _0x584114=Fs(this['context']);if(!_0x584114['plugins']['has']('TrackChanges'))throw new ot('ai-no-track-changes',null);const _0x366734=this['context']['plugins']['get']('DocumentCompare'),{reply:_0x1ed3ea,interaction:_0x404bc5}=this['getInteractionAndReplyById'](_0x218568['replyId']),_0x27013d=this['_getDocumentRangeForReplyChanges'](_0x218568['replyId'],_0x218568['partIndex']),_0x78b11d=void 0x0!==_0x218568['partIndex']?[_0x1ed3ea['changeGroups'][_0x218568['partIndex']]]:_0x1ed3ea['changeGroups']['filter'](_0x578aac=>'pending'==_0x578aac['state']),_0xdf3054=_0x78b11d['map'](_0x444b37=>_0x1ed3ea['changeGroups']['indexOf'](_0x444b37));if(!_0x27013d||'$graveyard'==_0x27013d['range']['root']['rootName'])return void _0xdf3054['forEach'](_0x5dad22=>_0x1ed3ea['setChangeGroupState'](_0x5dad22,'outdated'));_0xdf3054['forEach'](_0x402e66=>_0x1ed3ea['setChangeGroupState'](_0x402e66,'accepted'));const _0x3c9f79=Ks({'editor':_0x584114,'reply':_0x1ed3ea,'interaction':_0x404bc5,'groups':_0x78b11d,'transform':!0x0,'documentCompare':_0x366734,'documentCompareOptions':{'anchor':'main','markDeletions':!0x0}});let _0x10424b;_0x27013d&&this['_scrollToSuggestionRange'](_0x27013d['range']),_0x584114['model']['change'](_0xb58a09=>{_0x10424b=_0xb58a09['batch'],_0x584114['plugins']['get']('TrackChangesEditing')['_applyOperationsAsSuggestions'](_0x3c9f79),this['_aiEditing']['hideFakeVisualSelection']('change-area');}),this['_batchToChanges']['set'](_0x10424b,{'interactionId':_0x404bc5['id'],'replyId':_0x1ed3ea['id'],'indexes':_0xdf3054['slice']()}),this['_updateRatings'](_0x1ed3ea);}['_applySuggestion'](_0x1d07fb){const _0xd42784=Fs(this['context']),_0x27fa1a=this['context']['plugins']['get'](_0x515afb),{reply:_0x4a856b,interaction:_0x30ac2e}=this['getInteractionAndReplyById'](_0x1d07fb['replyId']),_0x2d93ae=this['_getDocumentRangeForReplyChanges'](_0x1d07fb['replyId'],_0x1d07fb['partIndex']),_0x47de9e=void 0x0!==_0x1d07fb['partIndex']?[_0x4a856b['changeGroups'][_0x1d07fb['partIndex']]]:_0x4a856b['changeGroups']['filter'](_0x1c2d81=>'pending'==_0x1c2d81['state']),_0x3a34ee=_0x47de9e['map'](_0x5a2e16=>_0x4a856b['changeGroups']['indexOf'](_0x5a2e16));if(!_0x2d93ae||'$graveyard'==_0x2d93ae['range']['root']['rootName'])return void _0x3a34ee['forEach'](_0x45df41=>_0x4a856b['setChangeGroupState'](_0x45df41,'outdated'));_0x3a34ee['forEach'](_0x2c207d=>_0x4a856b['setChangeGroupState'](_0x2c207d,'accepted'));const _0x3f09d8=Ks({'editor':_0xd42784,'reply':_0x4a856b,'interaction':_0x30ac2e,'groups':_0x47de9e,'transform':!0x0,'documentCompare':_0x27fa1a,'documentCompareOptions':{'anchor':'main','markDeletions':!0x1}});let _0x50e304;_0x2d93ae&&this['_scrollToSuggestionRange'](_0x2d93ae['range']),_0xd42784['model']['change'](_0x481b57=>{_0x50e304=_0x481b57['batch'];for(const _0x43020f of _0x3f09d8)_0x43020f['baseVersion']=_0xd42784['model']['document']['version'],Ws(_0xd42784,_0x43020f),_0x481b57['batch']['addOperation'](_0x43020f),_0xd42784['model']['applyOperation'](_0x43020f);}),this['_batchToChanges']['set'](_0x50e304,{'interactionId':_0x30ac2e['id'],'replyId':_0x4a856b['id'],'indexes':_0x3a34ee['slice']()}),this['_updateRatings'](_0x4a856b);}['_rejectSuggestion'](_0x2b3177){const {reply:_0x3a3e11}=this['getInteractionAndReplyById'](_0x2b3177['replyId']);_0x3a3e11['setChangeGroupState'](_0x2b3177['partIndex'],'rejected');}['_openBalloonFor'](_0x1e807b,_0x25f70b){if(!this['_aiChatBalloon'])return;const {reply:_0x50ce9a}=this['getInteractionAndReplyById'](_0x1e807b),_0x4d113e=_0x50ce9a['getContentParts']({'showDiff':this['_aiChatBalloonShowDiff']});let _0x118aba,_0xf00a1d;if(void 0x0!==_0x25f70b?(_0xf00a1d=_0x4d113e['find'](_0xfad615=>_0xfad615['index']==_0x25f70b),_0x118aba=_0xf00a1d?.['index']):(_0xf00a1d=_0x4d113e[0x0],_0x118aba=_0xf00a1d['index']),this['_currentPreviewedChangeGroup']?.['replyId']==_0x1e807b&&this['_currentPreviewedChangeGroup']?.['partIndex']==_0x118aba)return;const _0x44ae3e=this['_getUserPresentableContentPartDocumentRange'](_0x1e807b,_0x50ce9a,_0xf00a1d);if(!_0x44ae3e)return void this['_aiChatBalloon']['close']();this['_currentPreviewedChangeGroup']={'replyId':_0x1e807b,'partIndex':_0x118aba},this['_scrollToSuggestionRange'](_0x44ae3e,!0x0);const _0x59da72=this['_getPresentableSiblingContentPartIndex'](_0x1e807b,_0x118aba,'next');this['_aiChatBalloon']['updateContent']({'part':_0xf00a1d,'renderingStrategy':'static'}),this['_aiChatBalloon']['open']({'index':_0x118aba,'title':as(this['context']['locale'],'AI_BALLOON_HEADER_TITLE',(_0x118aba+0x1)['toString']()),'showRotator':null!==_0x59da72,'ranges':[_0x44ae3e],'areActionsDisabled':_0x50ce9a['areActionsDisabled']}),this['_aiChatBalloon']['setState']('pending'),this['_aiChatUi']['scrollFeedToSuggestion'](_0x1e807b,_0x118aba),this['_aiChatUi']['setFeedItemAIReplySuggestionPartActive']({'id':_0x1e807b,'index':_0x118aba,'isActive':!0x0});}['_getPresentableSiblingContentPartIndex'](_0x5ae941,_0x1619d5,_0x3ddc83){const {reply:_0x326e7d}=this['getInteractionAndReplyById'](_0x5ae941),_0x3b72a3=_0x326e7d['getContentParts']({'showDiff':this['_aiChatBalloonShowDiff']});if(0x1==_0x3b72a3['length'])return null;const _0x478c18=_0x3b72a3['findIndex'](_0xf6b1ed=>_0xf6b1ed['index']==_0x1619d5),_0x24a8b0='next'==_0x3ddc83?0x1:-0x1;let _0x2e1a40=_0x3b72a3['at']((_0x478c18+_0x24a8b0)%_0x3b72a3['length'])['index'],_0x21e2a7=_0x3b72a3[_0x2e1a40];for(;!this['_getUserPresentableContentPartDocumentRange'](_0x5ae941,_0x326e7d,_0x21e2a7);){if(_0x2e1a40=_0x3b72a3['at']((_0x2e1a40+_0x24a8b0)%_0x3b72a3['length'])['index'],_0x2e1a40===_0x478c18)return null;_0x21e2a7=_0x3b72a3[_0x2e1a40];}return _0x2e1a40;}['_getUserPresentableContentPartDocumentRange'](_0x3f1adf,_0x163826,_0x129233){const _0xb0d4d8=_0x163826['changeGroups'];if(!_0x129233['hasChanges'])return null;const _0x55d752=_0xb0d4d8['find'](_0x4d5481=>_0x4d5481['index']==_0x129233['index']);if('pending'!==_0x55d752?.['state'])return null;const _0x3a773f=this['_getDocumentRangeForReplyChanges'](_0x3f1adf,_0x129233['index']);if(!_0x3a773f)return null;const {range:_0x532cfa,currentIndex:_0x4d9bcd}=_0x3a773f;return'$graveyard'==_0x532cfa['root']['rootName']?(_0x163826['setChangeGroupState'](_0x4d9bcd,'outdated'),null):_0x3a773f['range'];}['_getDocumentRangeForReplyChanges'](_0x3e9d86,_0x3440a6){const _0x1d8cce=Fs(this['context']),{reply:_0x149d6c,interaction:_0x14a6a7}=this['getInteractionAndReplyById'](_0x3e9d86),_0x536b8=_0x149d6c['changeGroups']['filter'](_0x259616=>'pending'==_0x259616['state']),_0x2c1ca9=_0x536b8['map'](_0x3abc45=>_0x149d6c['changeGroups']['indexOf'](_0x3abc45));void 0x0===_0x3440a6&&(_0x3440a6=_0x2c1ca9[0x0]);const _0x4c62ef=_0x2c1ca9['indexOf'](_0x3440a6);if(-0x1==_0x4c62ef)return null;const _0x14d2b5=_0x536b8[_0x4c62ef],_0x59f458=new _0x450a47([]),_0x15a429=new _0x450a47([]);for(const _0x14127b of _0x14d2b5['changes'])if('removed'!=_0x14127b['type']&&_0x15a429['children']['push'](_0x14127b['node']['cloneNode'](!0x0)),'new'!=_0x14127b['type']){const _0x48cc9b=_0xd5f574(_0x4c6f61=>gs(_0x4c6f61,'data-id')==_0x14127b['id'],_0x149d6c['documentContextContent'],!0x0);_0x59f458['children']['push'](_0x48cc9b['cloneNode'](!0x0));}if(0x0==_0x59f458['children']['length']){if(_0x14d2b5['changes'][0x0]['anchorId']){const _0x466693=_s('data-id',_0x14d2b5['changes'][0x0]['anchorId'],_0x149d6c['documentContextContent']);_0x59f458['children']['unshift'](_0x466693['cloneNode'](!0x0)),_0x15a429['children']['unshift'](_0x466693['cloneNode'](!0x0)),_0x466693['nextSibling']&&(_0x59f458['children']['push'](_0x466693['nextSibling']['cloneNode'](!0x0)),_0x15a429['children']['push'](_0x466693['nextSibling']['cloneNode'](!0x0)));}else{const _0x1e4815=_0x149d6c['documentContextContent']['children'][0x0];if(!_0x1e4815)return null;_0x59f458['children']['push'](_0x1e4815['cloneNode'](!0x0)),_0x15a429['children']['push'](_0x1e4815['cloneNode'](!0x0));}}const _0x21cc85=_0x14a6a7['getDocumentContext'](),_0x3a23b5=_0x1d8cce['data']['parse'](_0x21cc85['content']),_0x564c7b=ds(_0x59f458),_0x39f665=_0x1d8cce['data']['parse'](_0x564c7b),_0x3db9de=_0x1d8cce['data']['parse'](_0x564c7b),_0x59752f=_0x1d8cce['model']['createPositionAt'](_0x39f665,0x0),_0x112820=ds(_0x15a429),_0x599333={'anchor':_0x59752f,'markDeletions':!0x1},_0x389e92=_0x1d8cce['plugins']['get'](_0x515afb)['getDiff'](_0x564c7b,_0x112820,_0x599333)['getOperations']();if(!_0x389e92['length'])return null;_0x1d8cce['model']['change'](_0x2d1cd1=>{for(const _0x5b586d of _0x389e92)if('remove'==_0x5b586d['type']){const _0x17da39=_0x5b586d['sourcePosition'],_0x12c27c=_0x5b586d['howMany'],_0x501742=new _0x30ee68(_0x17da39,_0x12c27c);_0x2d1cd1['batch']['addOperation'](_0x501742),_0x1d8cce['model']['applyOperation'](_0x501742);}else'marker'!==_0x5b586d['type']&&(_0x5b586d['baseVersion']=null,_0x5b586d['isDocumentOperation']=!0x1,_0x2d1cd1['batch']['addOperation'](_0x5b586d),_0x1d8cce['model']['applyOperation'](_0x5b586d));});const _0x2a72f0=Rs(_0x1d8cce,_0x389e92,_0x39f665);Os(_0x1d8cce['model'],_0x2a72f0);const _0x1f6dd1=_0x2a72f0['getFirstRange']()['start']['path']['slice'](),_0x270119=_0x2a72f0['getFirstRange']()['end']['path']['slice'](),_0x5f4f3c=[];let _0x64e884=_0x39f665,_0x1ae328=_0x3db9de;for(let _0xcd91e7=0x0;_0xcd91e7<_0x270119['length'];_0xcd91e7++){const _0x429e86=_0x64e884['maxOffset']-_0x270119[_0xcd91e7];_0x5f4f3c[_0xcd91e7]=_0x1ae328['maxOffset']-_0x429e86,_0x64e884=_0x64e884['getChildAtOffset'](_0x270119[_0xcd91e7]),_0x1ae328=_0x1ae328['getChildAtOffset'](_0x5f4f3c[_0xcd91e7]);}const _0xb73891=_0x1d8cce['model']['createRange'](_0x1d8cce['model']['createPositionFromPath'](_0x3db9de,_0x1f6dd1),_0x1d8cce['model']['createPositionFromPath'](_0x3db9de,_0x5f4f3c)),_0x52b10c=_0x3db9de['getChild'](0x0)['getAttribute'](_0x45927f),_0x2d7f26=Array['from'](_0x3a23b5['getChildren']())['find'](_0x390f38=>_0x390f38['getAttribute'](_0x45927f)==_0x52b10c)['getPath'](),_0x462a78=_0xb73891['start']['path']['slice'](),_0x45a7c9=_0xb73891['end']['path']['slice']();_0x462a78[0x0]=_0x2d7f26[0x0]+_0x462a78[0x0],_0x45a7c9[0x0]=_0x2d7f26[0x0]+_0x45a7c9[0x0];let _0x32e8f3=_0x1d8cce['model']['createRange'](_0x1d8cce['model']['createPositionFromPath'](_0x1d8cce['model']['document']['getRoot'](),_0x462a78),_0x1d8cce['model']['createPositionFromPath'](_0x1d8cce['model']['document']['getRoot'](),_0x45a7c9));const _0x241e92=_0x1d8cce['model']['document']['history']['getOperations'](_0x21cc85['version']);for(const _0x2e73ac of _0x241e92)_0x32e8f3=_0x34cb53['_createFromRanges'](_0x32e8f3['getTransformedByOperation'](_0x2e73ac));return{'range':_0x32e8f3,'currentIndex':_0x3440a6};}['_integrateEditor'](_0x3ef974){if(_0x3ef974['plugins']['has']('Undo')){const _0x549571=_0x3ef974['commands']['get']('undo'),_0x293943=_0x3ef974['commands']['get']('redo');this['listenTo'](_0x549571,'revert',(_0x69a327,_0x4cc255,_0x31e65a)=>{const _0x2a4961=this['_batchToChanges']['get'](_0x4cc255);if(!_0x2a4961)return;const _0x553464=this['activeConversation']['getInteraction'](_0x2a4961['interactionId'])['getReply'](_0x2a4961['replyId']);_0x2a4961['indexes']['forEach'](_0x19b22c=>_0x553464['setChangeGroupState'](_0x19b22c,'pending')),this['_batchToChanges']['delete'](_0x4cc255),this['_batchToChanges']['set'](_0x31e65a,_0x2a4961);}),this['listenTo'](_0x293943,'revert',(_0x180dae,_0x220da7,_0x1229bd)=>{const _0x4ce45a=this['_batchToChanges']['get'](_0x220da7);if(!_0x4ce45a)return;const _0x1cb254=this['activeConversation']['getInteraction'](_0x4ce45a['interactionId'])['getReply'](_0x4ce45a['replyId']);_0x4ce45a['indexes']['forEach'](_0x387ff8=>_0x1cb254['setChangeGroupState'](_0x387ff8,'accepted')),this['_batchToChanges']['delete'](_0x220da7),this['_batchToChanges']['set'](_0x1229bd,_0x4ce45a);});}const _0x4d4c07=_0x3ef974['config']['get']('ai.chat.context');_0x4d4c07['alwaysAddSelection']&&_0x4d4c07['document']['enabled']&&this['listenTo'](_0x3ef974['model']['document']['selection'],'change:range',(_0x2fd7cb,_0x26bca1)=>{if(!_0x26bca1['directChange'])return;'chat'===_0x3ef974['plugins']['get']('AITabs')['view']['activeTab']&&(_0x3ef974['model']['hasContent'](_0x3ef974['model']['document']['selection'])?this['addSelectionToChatContext']():this['removeSelectionFromChatContext']());});}async['_getLastCreatedConversationId'](){const _0x3b5521=this['_aiConnector']['fetchConversations'](this['getGroupId'](),{'limit':0x1,'sortBy':'createdAt'});try{const _0x1fda05=await _0x3b5521['getConversations']();return _0x1fda05['length']?_0x1fda05[0x0]['id']:'new';}catch(_0x4fc692){return this['_aiChatUi']['addFeedItemError']({'errorMessage':as(this['context']['locale'],'AI_CHAT_UNABLE_TO_LOAD_CONVERSATION'),'id':at()}),this['_logError'](new ot('ai-chat-conversation-init-failed',this,{'error':_0x4fc692})),this['_aiChatUi']['toggleLoadingSkeleton'](!0x1),this['_aiChatUi']['disableControls'](),null;}}async['_startConversationSafely'](_0x4704cd){try{this['_aiChatUi']['enableControls'](),await this['_handleStartConversation'](_0x4704cd);}catch(_0x573fba){this['_aiChatUi']['addFeedItemError']({'errorMessage':as(this['context']['locale'],'AI_CHAT_UNABLE_TO_START_CONVERSATION'),'id':_0x4704cd||at()}),console['error'](_0x573fba),this['activeConversation']=void 0x0,this['_aiChatUi']['disableControls']();}}async['_handleStartConversation'](_0x189b6c){let _0x34b542;this['context']['plugins']['has']('AIChatBalloon')&&this['context']['plugins']['get']('AIChatBalloon')['close'](),_0x189b6c||!this['activeConversation']?_0x34b542=this['context']['config']['get']('ai.models.defaultModelId'):this['_aiChatUi']['isModelAvailable']&&(_0x34b542=this['activeConversation']['selectedModel']['id']),await this['_stopLastInteraction']();const _0x46e5db=this['getGroupId'](),_0x79d52=_0x189b6c||at();this['activeConversation']=new Vs({'connector':this['_aiConnector'],'chatModels':this['_aiChatModels'],'selectedModelId':_0x34b542,'conversationId':_0x79d52,'group':_0x46e5db,'getEditor':()=>Fs(this['context']),'isFromHistory':!!_0x189b6c}),this['activeConversation']['delegate']('toolDataReceived','interactionCreated','interactionStarted','replyCreated')['to'](this),this['activeConversation']['on']('conversationInitialized',(_0x3d4d72,_0x5c3fc0)=>{this['_aiChatUi']['createConversation'](_0x5c3fc0),this['_aiChatUi']['resetMessageInput'](),this['_aiChatUi']['clearPendingContextUI'](),this['_aiChatUi']['clearConversationContextUI'](),_0x189b6c||(this['_aiChatUi']['resetConversationTitle'](),this['addCurrentDocumentToChatContext']());}),this['activeConversation']['on']('uploadProgressChanged',(_0x3215e4,_0x241634)=>{this['_aiChatUi']['setIsUploadInProgress'](_0x241634['isUploadInProgress']);}),this['activeConversation']['on']('webSearchStarted',()=>{const _0x22cea1=this['_aiChatUi']['prepareLoadingMessage']({'isWebSearchEnabled':!0x0,'isReasoningEnabled':!0x1});this['_aiChatUi']['setLoadingMessage'](_0x22cea1);}),this['activeConversation']['on']('reasoningStarted',()=>{const _0x1ea0d8=this['_aiChatUi']['prepareLoadingMessage']({'isWebSearchEnabled':!0x1,'isReasoningEnabled':!0x0});this['_aiChatUi']['setLoadingMessage'](_0x1ea0d8);}),this['activeConversation']['on']('webSearchFinished',(_0x2b4832,_0x413d14)=>{this['_aiChatUi']['addFeedInteractionHeader'](_0x413d14,{'isWebSearchEnabled':!0x0,'isReasoningEnabled':!0x1});}),this['activeConversation']['on']('reasoningFinished',(_0x392639,_0x28a41f)=>{this['_aiChatUi']['addFeedInteractionHeader'](_0x28a41f,{'isWebSearchEnabled':!0x1,'isReasoningEnabled':!0x0});}),this['activeConversation']['on']('interactionStarted',()=>{this['_aiChatUi']['startInteraction']();}),this['activeConversation']['on']('interactionFinished',async()=>{await this['_aiChatUi']['finishInteraction']();}),this['activeConversation']['on']('interactionDestroyed',(_0x4e85c6,_0x56ea6)=>{this['_aiChatUi']['removeFeedInteraction'](_0x56ea6['id']);}),this['activeConversation']['on']('setConversationTitle',(_0x83b12,_0x1966c1,_0x242909)=>{this['_updateConversationTitle'](_0x1966c1,_0x242909);}),this['activeConversation']['on']('replyContentUpdated',async(_0x85501,_0x1fcd6f)=>{await this['_updateReplyContent']({'reply':_0x1fcd6f});}),this['activeConversation']['on']('replyChangeGroupStateUpdated',(_0x25bc0c,{reply:_0x137f86,index:_0x1dad2a,state:_0x371fa8})=>{this['_aiChatUi']['updateFeedItemAIReplySuggestionPartState']({'id':_0x137f86['id'],'index':_0x1dad2a,'state':_0x371fa8}),this['_currentPreviewedChangeGroup']?.['replyId']['includes'](_0x137f86['id'])&&this['_currentPreviewedChangeGroup']?.['partIndex']==_0x1dad2a&&this['_aiChatBalloon']?.['setState'](_0x371fa8);}),this['activeConversation']['on']('contextItemAdded',(_0x5f4f88,_0x1a340)=>{if(this['_aiChatUi']['addContextItem'](_0x1a340['contextItem'],_0x1a340['isLoading']),'selection'===_0x1a340['contextItem']['type']){const _0x5c55c2=[...Fs(this['context'])['model']['document']['selection']['getRanges']()];this['_aiEditing']['showFakeVisualSelection']({'ranges':_0x5c55c2,'id':'context','priority':0x1});}}),this['activeConversation']['on']('contextItemRemoved',(_0x130e02,_0x59a81d)=>{this['_aiChatUi']['removeContextItem'](_0x59a81d['uiId']),'current-document'==_0x59a81d['uiId']&&this['removeSelectionFromChatContext'](),'selection'===_0x59a81d['type']&&this['_aiEditing']['hideFakeVisualSelection']('context');}),this['activeConversation']['on']('contextItemLoadingEnded',(_0x5679fa,_0x336dcf)=>{this['_aiChatUi']['setContextItemLoading'](_0x336dcf['contextItem']['uiId'],_0x336dcf['isLoading']);}),this['activeConversation']['on']('contextSent',(_0x46f876,_0x1cade5)=>{this['_aiChatUi']['setConversationContext'](_0x1cade5['contextItems']);}),this['activeConversation']['on']('addContextOptionsChanged',(_0x272e0d,_0x2d5294)=>{this['_aiChatUi']['setAddContextOptions'](_0x2d5294['options']);}),this['activeConversation']['on']('sourceResourcesLoaded',(_0x5b5105,_0x15b49a)=>{this['_aiChatUi']['populateSourceResourceBalloon'](_0x15b49a['sourceId'],_0x15b49a['source'],_0x15b49a['resources'],_0x15b49a['uid']);}),this['activeConversation']['on']('resourceStateChanged',(_0x5d289c,_0x448432)=>{this['_aiChatUi']['updateResourceState'](_0x448432['sourceId'],_0x448432['resourceId'],_0x448432['isInContext']);}),this['activeConversation']['on']('capabilitiesUpdated',(_0x55434c,_0x4885b6)=>{this['_aiChatUi']['updateCapabilities'](_0x4885b6);}),this['activeConversation']['on']('modelSelected',async(_0x3eb616,_0x4c8be9)=>{const _0x100343=(await this['_aiChatModels']['getAll']())['find'](_0x343642=>_0x343642['id']===_0x4c8be9['selectedModel']?.['id'])||null;this['_aiChatUi']['setSelectedModel'](_0x100343,_0x4c8be9['isDisabled']);}),this['activeConversation']['on']('error',(_0x3836b1,{error:_0x1d0ea,interactionId:_0x277bca,fileName:_0x4441a7,url:_0x1a5103,sourceId:_0x41eb07,sourceLabel:_0x56b4a2})=>{const _0x37e15e=_0x277bca?_0x277bca+':'+at():at();_0x1d0ea['message']['startsWith']('ai-request-aborted')?this['_aiChatUi']['addFeedItemStaticMessage']({'staticMessage':as(this['context']['locale'],'AI_CHAT_ABORTED_MESSAGE'),'id':_0x37e15e}):_0x1d0ea['message']['startsWith']('ai-chat-conversation-init-failed')||_0x1d0ea['message']['startsWith']('ai-chat-conversation-start-failed')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':as(this['context']['locale'],'AI_CHAT_UNABLE_TO_START_CONVERSATION'),'id':_0x37e15e}),this['_logError'](_0x1d0ea)):_0x1d0ea['message']['startsWith']('ai-chat-file-upload-failed')?this['_aiChatUi']['addFeedItemError']({'errorMessage':as(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_FILE',_0x4441a7),'id':_0x37e15e}):_0x1d0ea['message']['startsWith']('ai-chat-url-upload-failed')?this['_aiChatUi']['addFeedItemError']({'errorMessage':as(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_URL',_0x1a5103),'id':_0x37e15e}):_0x1d0ea['message']['startsWith']('ai-chat-context-invalid-data')?this['_aiChatUi']['addFeedItemError']({'errorMessage':as(this['context']['locale'],'AI_CHAT_CONTEXT_INVALID_DATA'),'id':_0x37e15e}):_0x1d0ea['message']['startsWith']('ai-chat-context-unsupported-type')?this['_aiChatUi']['addFeedItemError']({'errorMessage':as(this['context']['locale'],'AI_CHAT_CONTEXT_UNSUPPORTED_TYPE'),'id':_0x37e15e}):_0x1d0ea['message']['startsWith']('ai-chat-source-resources-load-failed')?(_0x41eb07&&this['_aiChatUi']['closeSourceResourceBalloon'](_0x41eb07),this['_aiChatUi']['addFeedItemError']({'errorMessage':as(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_LOAD_RESOURCES',_0x56b4a2||'source'),'id':_0x37e15e}),this['_logError'](_0x1d0ea)):_0x1d0ea['message']['startsWith']('ai-chat-resource-load-failed')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':as(this['context']['locale'],'AI_CHAT_RESOURCE_LOAD_FAILED'),'id':_0x37e15e}),this['_logError'](_0x1d0ea)):_0x1d0ea['message']['startsWith']('ai-chat-invalid-request')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':as(this['context']['locale'],'AI_CHAT_INVALID_REQUEST'),'id':_0x37e15e}),this['_logError'](_0x1d0ea)):_0x1d0ea['message']['startsWith']('ai-chat-context-unsupported-file-type')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':as(this['context']['locale'],'AI_CHAT_CONTEXT_UNSUPPORTED_FILE_TYPE'),'id':_0x37e15e}),this['_logError'](_0x1d0ea)):_0x1d0ea['message']['startsWith']('ai-chat-context-file-too-large')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':as(this['context']['locale'],'AI_CHAT_CONTEXT_FILE_TOO_LARGE'),'id':_0x37e15e}),this['_logError'](_0x1d0ea)):_0x1d0ea['message']['startsWith']('ai-chat-context-file-too-many-pages')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':as(this['context']['locale'],'AI_CHAT_CONTEXT_FILE_TOO_MANY_PAGES'),'id':_0x37e15e}),this['_logError'](_0x1d0ea)):_0x1d0ea['message']['startsWith']('ai-chat-context-form-data-size-limits-exceeded')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':as(this['context']['locale'],'AI_CHAT_CONTEXT_FORM_DATA_SIZE_LIMITS_EXCEEDED'),'id':_0x37e15e}),this['_logError'](_0x1d0ea)):(this['_aiChatUi']['addFeedItemError']({'errorMessage':as(this['context']['locale'],'AI_CHAT_GENERIC_ERROR'),'id':_0x37e15e}),this['_logError'](_0x1d0ea));}),await this['activeConversation']['init'](this['context']['config']['get']('ai.chat.context')),_0x189b6c||await this['activeConversation']['start']();}async['_handleUIUserMessage']({message:_0xb9ee2c,attributes:_0x468459}){if(!this['activeConversation'])throw new ot('ai-chat-controller-no-active-conversation');if(this['activeConversation']['isCurrentDocumentInContext']()){const _0x1a4076=await this['_aiEditing']['getDocumentData']();await this['activeConversation']['updateCurrentDocumentInContext'](_0x1a4076);}this['activeConversation']['id']&&this['activeConversation']['isStarted']&&await this['activeConversation']['handleUserInteraction']({'userMessage':_0xb9ee2c,'attributes':_0x468459});}['_setIsMaximized'](_0x2651a4){this['_aiChatUi']['setIsMaximized'](_0x2651a4);}['_logError'](_0x4e6fcc){Et(_0x4e6fcc['message']);}['_removeFromContext'](_0x4ff46f){this['activeConversation']?.['removeFromContext'](_0x4ff46f);}['_toggleWebSearch'](){this['activeConversation']?.['toggleWebSearch']();}['_toggleReasoning'](){this['activeConversation']?.['toggleReasoning']();}['getInteractionAndReplyById'](_0x1098e5){const [_0x30a485,_0x350ef7]=_0x1098e5['split'](':'),_0x1cfd52=this['activeConversation']['getInteraction'](_0x30a485),_0x1b369a=_0x1cfd52['getReply'](_0x350ef7);return{'interaction':_0x1cfd52,'reply':_0x1b369a};}['_scrollToSuggestionRange'](_0x44d2cf,_0x4d558d=!0x1){const _0x4e10e8=Fs(this['context']),_0x58053c={'target':_0x4e10e8['editing']['view']['domConverter']['viewRangeToDom'](_0x4e10e8['editing']['mapper']['toViewRange'](_0x44d2cf)),'viewportOffset':{'top':0x96,'left':0x0,'bottom':0x32,'right':0x0},'ancestorOffset':0x14,'alignToTop':_0x4d558d};_0x4d558d&&(_0x58053c['alignToTop']=!0x0),mt(_0x58053c);}['_updateConversationTitle'](_0x27c48d,_0x1cce67=!0x1){this['_aiChatUi']['setConversationTitle'](_0x27c48d||as(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION'),_0x1cce67);}['_addFeedItemReply'](_0x2dd231){'text'===_0x2dd231['type']?this['_aiChatUi']['addFeedItemAIReply'](_0x2dd231):this['_aiChatUi']['addFeedItemAISuggestion'](_0x2dd231);}async['_updateReplyContent']({reply:_0x42b2a1,renderingStrategy:_0x21fe84}){const {id:_0x312163,interactionId:_0x4509e2,isDone:_0x300c84,type:_0x2b854c,parsedContent:_0x4df322}=_0x42b2a1,_0x219526=_0x4509e2+':'+_0x312163;if('modification'===_0x2b854c){const _0x152061=_0x42b2a1['getContentParts']({'showDiff':this['_aiChatUi']['showDiff']});await this['_aiChatUi']['updateFeedItemAIReplySuggestionContent']({'id':_0x219526,'parts':_0x152061,'renderingStrategy':_0x21fe84,'isDone':_0x300c84});}else'text'===_0x2b854c&&await this['_aiChatUi']['updateFeedItemAIReplyContent']({'id':_0x219526,'parsedContent':_0x4df322,'renderingStrategy':_0x21fe84,'isDone':_0x300c84});_0x300c84&&_0x42b2a1['sources']['length']>0x0&&this['_aiChatUi']['updateFeedItemAIReplySources'](_0x219526,_0x42b2a1['sources']);}async['_stopLastInteraction'](){const _0x520ff0=this['activeConversation']?.['lastInteraction'];_0x520ff0&&(_0x520ff0['stop'](),this['_aiChatUi']['stopInteraction'](_0x520ff0));}async['_flushLastInteractionUI'](){const _0x35a650=this['activeConversation']?.['lastInteraction'];if(_0x35a650){for await(const _0xd8822b of _0x35a650['replies'])this['_aiChatUi']['hasFeedItem'](_0xd8822b['id'])||this['_addFeedItemReply'](_0xd8822b),await this['_updateReplyContent']({'reply':_0xd8822b,'renderingStrategy':'static'});}}['_updateRatings'](_0x59c217){const _0x4e661e={'positiveCount':_0x59c217['changeGroups']['filter'](_0x203b7b=>'accepted'===_0x203b7b['state'])['length'],'totalCount':_0x59c217['changeGroups']['length'],'modificationId':_0x59c217['id']},_0x3a8d1d=this['activeConversation']['getInteraction'](_0x59c217['interactionId'])['messageId'];_0x3a8d1d&&this['_aiConnector']['upsertAIChatRating'](this['activeConversation']['id'],_0x3a8d1d,_0x4e661e);}['_getAIChatFeedAPI'](_0x39485c){const _0x429676=this['_aiChatUi'],_0x595c13=()=>{_0x39485c['resetWebSearchState'](),_0x39485c['resetReasoningState'](),_0x429676['clearLoadingMessage']();},_0x25bc8c=()=>{_0x39485c['currentReply']&&(_0x39485c['currentReply']['done'](),_0x39485c['currentReply']=void 0x0);};return{'insertTextReply':(_0x5d333e,_0x19d54c)=>{_0x25bc8c(),_0x595c13();const _0x298441=_0x39485c['currentReply']=_0x39485c['createReply']({'type':'text','interactionId':_0x39485c['id'],'content':_0x5d333e,'id':_0x19d54c||at()});return _0x25bc8c(),_0x298441;},'insertCustomElement':async(_0xbf8744,_0x7ef5a5)=>(_0x25bc8c(),_0x595c13(),_0x429676['addFeedItemCustomElement'](_0xbf8744,_0x7ef5a5||at())),'setLoadingMessage':_0x13dd28=>{_0x429676['setLoadingMessage'](_0x13dd28);},'clearLoadingMessage':()=>{_0x429676['clearLoadingMessage']();}};}}const $s='ai-selection';class qs extends _0x333531{constructor(_0x355318){super(_0x355318),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 _0x8e524c=Fs(this['context']),_0x2145a8=_0x8e524c['plugins']['has']('RealTimeCollaborationClient')&&_0x8e524c['plugins']['get']('RealTimeCollaborationClient')['sessionId'];this['_sessionId']=_0x2145a8||at();}return this['_sessionId'];}async['getDocumentData'](){const _0x272e23=Fs(this['context']),_0xc636ea=_0x272e23['model'],_0x41f34b=_0x272e23['data']['toView'](_0xc636ea['document']['getRoot'](),{'convertAiChatSelectionMarker':!0x0}),_0x533245=new _0x27d124(_0x272e23['editing']['view']['document']);this['_setDataIdsOnChildren'](_0x41f34b,_0x533245);let _0x146538=await this['_getDocumentDataStringFromView'](_0x41f34b);const _0xfdc871=this['_getMarkersInDocumentOrder'](),_0x1a0782=[];for(const _0x32562d of _0xfdc871){const _0xc6231a='<'+_0x32562d['name']+':start></'+_0x32562d['name']+':start>',_0x4cf038=_0x146538['indexOf'](_0xc6231a);_0x146538=_0x146538['substring'](0x0,_0x4cf038)+_0x146538['substring'](_0x4cf038+_0xc6231a['length']);const _0x54265d='<'+_0x32562d['name']+':end></'+_0x32562d['name']+':end>',_0x3d797b=_0x146538['indexOf'](_0x54265d);_0x146538=_0x146538['substring'](0x0,_0x3d797b)+_0x146538['substring'](_0x3d797b+_0x54265d['length']),_0x1a0782['push']({'markerName':_0x32562d['name'],'start':_0x4cf038,'end':_0x3d797b,'htmlFragment':_0x146538['substring'](_0x4cf038,_0x3d797b)});}return{'content':_0x146538,'version':_0x272e23['model']['document']['version'],'sessionId':this['sessionId'],'selections':_0x1a0782};}async['afterInit'](){this['context']instanceof _0x20ae3c?this['_integrateEditor'](this['context']):this['listenTo'](this['context']['editors'],'add',(_0x58e5a4,_0x30966b)=>{_0x30966b['on']('ready',()=>{this['_integrateEditor'](_0x30966b);});});}['_setOutputDataProcessor'](_0x5f518f){this['_outputDataProcessor']=_0x5f518f;}async['_getDocumentDataStringFromView'](_0x94998d){let _0x4a5bb0;const _0x1d3b37=Fs(this['context']);if(this['_outputDataProcessor']){const _0x5351db=_0x1d3b37['data']['processor']['domConverter']['viewToDom'](_0x94998d),_0x34ba12=await this['_outputDataProcessor'](_0x5351db);_0x4a5bb0=_0x1d3b37['data']['processor']['htmlWriter']['getHtml'](_0x34ba12);}else _0x4a5bb0=_0x1d3b37['data']['processor']['toData'](_0x94998d);return _0x4a5bb0;}['_integrateEditor'](_0x4a76a9){_0x4a76a9['conversion']['for']('editingDowncast')['markerToHighlight']({'model':$s,'view':({markerName:_0x47a581})=>({'classes':['ck-ai-assistant-ui_theme','ck-fake-ai-selection','ck-fake-ai-selection-'+_0x47a581['split'](':')[0x1]],'priority':0xc})}),_0x4a76a9['conversion']['for']('dataDowncast')['markerToElement']({'model':$s,'view':(_0xff5023,{writer:_0x1268c9,options:_0x2e4839})=>_0x2e4839['convertAiChatSelectionMarker']?_0x1268c9['createUIElement'](_0xff5023['markerName']+':'+(_0xff5023['isOpening']?'start':'end')):null});}['showFakeVisualSelection'](_0x1751eb){const _0xbf6d31=this['_fakeSelections'][0x0]||null;this['_addFakeSelection'](_0x1751eb);const _0x3c2b47=this['_fakeSelections'][0x0]||null;this['_refreshFakeSelection'](_0xbf6d31,_0x3c2b47);}['hideFakeVisualSelection'](_0x456bad){const _0x108f7f=this['_fakeSelections'][0x0]||null;this['_removeFakeSelectionById'](_0x456bad);const _0x4b2322=this['_fakeSelections'][0x0]||null;this['_refreshFakeSelection'](_0x108f7f,_0x4b2322);}async['modelToDataWithIds'](_0xbe9168){const _0x4388b3=Fs(this['context']),_0x2e13bd=_0x4388b3['data']['toView'](_0xbe9168),_0x23fbfb=new _0x27d124(_0x4388b3['editing']['view']['document']);return this['_setDataIdsOnChildren'](_0x2e13bd,_0x23fbfb),this['_getDocumentDataStringFromView'](_0x2e13bd);}['_setDataIdsOnChildren'](_0x5ce051,_0x3ab9bc){let _0x1a6c80=!0x1;const _0x32c454=new Set();for(const _0x1c3360 of _0x5ce051['getChildren']()){if(!_0x1c3360['is']('view:element'))continue;const _0x31185a=_0x1c3360['is']('view:containerElement'),_0x25c44f=_0x1c3360['is']('view:emptyElement'),_0x563af2=this['_setDataIdsOnChildren'](_0x1c3360,_0x3ab9bc);if(_0x1c3360['hasAttribute']('data-id')){_0x1a6c80=!0x0,_0x32c454['add'](_0x1c3360['getAttribute']('data-id'));continue;}(_0x31185a||_0x25c44f||_0x563af2)&&(_0x3ab9bc['setAttribute']('data-id',this['_nextDataId'](_0x32c454),_0x1c3360),_0x1a6c80=!0x0);}return _0x1a6c80;}['_nextDataId'](_0xe3cf3){let _0x271b7e;do{_0x271b7e='';for(let _0x1e096c=0x0;_0x1e096c<0x4;_0x1e096c++)_0x271b7e+=String['fromCharCode'](0x61+Math['floor'](0x1a*Math['random']()));}while(_0xe3cf3['has'](_0x271b7e));return _0xe3cf3['add'](_0x271b7e),_0x271b7e;}['getSelectionText'](){const {model:_0x1bca1d}=Fs(this['context']),_0xb02c76=_0x1bca1d['document']['selection'],_0x545d92=[],_0x39b267=Array['from'](_0xb02c76['getRanges']());_0x39b267['sort']((_0x5209bf,_0x494821)=>_0x5209bf['start']['isBefore'](_0x494821['start'])?-0x1:0x1);for(const _0x1f05c4 of _0x39b267)for(const _0x2292ac of _0x1f05c4['getItems']())_0x2292ac['is']('$textProxy')?_0x545d92['push'](_0x2292ac['data']):_0x2292ac['is']('element')&&_0x545d92['length']>0x0&&'\x20'!==_0x545d92[_0x545d92['length']-0x1]&&_0x545d92['push']('\x20');return _0x545d92['length']?'\x22'+_0x545d92['join']('')['trim']()+'\x22':as(this['context']['locale'],'AI_CHAT_CONTEXT_DOCUMENT_SELECTION_LABEL');}['_removeFakeSelectionById'](_0x29bf69){for(let _0x116676=0x0;_0x116676<this['_fakeSelections']['length'];_0x116676++)if(this['_fakeSelections'][_0x116676]['id']==_0x29bf69)return void this['_fakeSelections']['splice'](_0x116676,0x1);}['_addFakeSelection'](_0x3b7137){this['_removeFakeSelectionById'](_0x3b7137['id']),Ct(this['_fakeSelections'],_0x3b7137);}['_refreshFakeSelection'](_0xbd2b37,_0x5087b0){if(_0xbd2b37==_0x5087b0)return;const _0x471dec=Fs(this['context']),_0x31fccd=_0x471dec['model'];_0x31fccd['change'](_0x1ace2f=>{if(_0xbd2b37){const _0x1d93d4=_0x471dec['model']['markers']['getMarkersGroup']($s);for(const _0x59319e of _0x1d93d4)_0x1ace2f['removeMarker'](_0x59319e);}if(_0x5087b0)for(let _0xfc875d=0x0;_0xfc875d<_0x5087b0['ranges']['length'];_0xfc875d++){let _0x188457=_0x5087b0['ranges'][_0xfc875d];const _0xf5525e=$s+':'+_0x5087b0['id']+':'+_0xfc875d;if(_0x188457['start']['isAtEnd']){const _0x1e1439=_0x188457['start']['getLastMatchingPosition'](({item:_0xf01d2d})=>!_0x31fccd['schema']['isContent'](_0xf01d2d),{'boundaries':_0x188457});_0x188457=_0x1ace2f['createRange'](_0x1e1439,_0x188457['end']);}_0x1ace2f['addMarker'](_0xf5525e,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x188457});}});}['_getMarkersInDocumentOrder'](){const _0x79dd65=Fs(this['context'])['model'];return Array['from'](_0x79dd65['markers']['getMarkersGroup']($s))['sort']((_0x3e44c9,_0x4aea2d)=>_0x3e44c9['getStart']()['isBefore'](_0x4aea2d['getStart']())?-0x1:_0x3e44c9['getStart']()['isAfter'](_0x4aea2d['getStart']())?0x1:0x0);}}const Qs=['showChangeInText','insertSuggestion','applySuggestion','rejectSuggestion','mouseOverSuggestion','mouseLeaveSuggestion','toggleSuggestionDisplayMode','like','dislike'],Xs=[...Qs,'startConversation','resizeTabs','sendUserMessage','abortPromptStream','addDocumentToContext','addFileToContext','addUrlToContext','executeCustomItemCallback','addResourceToContext','removeContextItem','loadSourceResources','toggleWebSearch','toggleReasoning','selectModel'];class zs{['options'];['isStreaming']=!0x1;['document']=null;['nodesList']=[];['currentIndex']=0x0;['timeoutAbortController']=null;['lastUpdateTime']=0x0;constructor(_0x520c89){this['options']={'delay':_0x520c89['delay']??0x14,'textNodeStyle':_0x520c89['textNodeStyle'],'onStreamUpdate':_0x520c89['onStreamUpdate']||(()=>{})};}async['stream']({document:_0x2507bd,targetElement:_0x416878,abortSignal:_0x267ada}){this['isStreaming']&&this['stop'](),_0x267ada?.['addEventListener']('abort',this['stop']['bind'](this)),this['document']=_0x4ca565(_0x2507bd,!0x0),this['nodesList']=this['getParsedDocumentNodeList'](),this['isStreaming']=!0x0,this['currentIndex']>this['nodesList']['length']&&(this['currentIndex']=this['nodesList']['length']);for(let _0x542bba=0x0;_0x542bba<this['currentIndex'];_0x542bba++)this['nodesList'][_0x542bba]['shouldBeStreamed']=!0x0;do{const _0x4791f3=Date['now'](),_0xe68990=this['nodesList'][this['currentIndex']],_0x39154b=_0x4791f3-this['lastUpdateTime'];if(_0xe68990){_0xe68990['shouldBeStreamed']=!0x0;let _0x4cb9d2=_0xe68990['parent'];for(;_0x4cb9d2;)_0x4cb9d2['shouldBeStreamed']=!0x0,_0x4cb9d2=_0x4cb9d2['parent'];}if(_0x39154b<this['options']['delay'])try{const {promise:_0x233f72,abortController:_0x385df0}=tn(this['options']['delay']-_0x39154b);this['timeoutAbortController']=_0x385df0,await _0x233f72;}catch(_0x2ddbb4){return;}_0x58e95e(_0x416878,'<'+_0x416878['tagName']+'>'+this['renderNode'](this['document'])+'</'+_0x416878['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:_0x3146ee}){Array['from'](_0x3146ee['querySelectorAll']('span[data-ck-html-streamer-word-chunk]'))['reverse']()['forEach'](_0x2f56ff=>{_0x2f56ff['replaceWith'](_0x2f56ff['childNodes'][0x0]);});}['stop'](){this['isStreaming']=!0x1,this['timeoutAbortController']&&(this['timeoutAbortController']['abort'](),this['timeoutAbortController']=null);}['renderNode'](_0x4b04c5){let _0x4c82f8='';if(function(_0x50a290){return _0x28eaa2(_0x50a290);}(_0x4b04c5)){for(const _0x4f2de6 of _0x4b04c5['children'])_0x4c82f8+=this['renderNode'](_0x4f2de6);}else{if(Zs(_0x4b04c5)){if(!_0x4b04c5['shouldBeStreamed'])return'';const _0xd33e14=_0x4b04c5,_0x3870af=Object['entries'](_0xd33e14['attribs'])['map'](([_0x1848e4,_0x1255f4])=>_0x1848e4+'=\x22'+_0x1255f4+'\x22')['join']('\x20');_0x4c82f8+='<'+_0xd33e14['tagName']+(_0x3870af?'\x20'+_0x3870af:'')+'>';for(const _0xe08e3b of _0x3dd017(_0xd33e14))_0x4c82f8+=this['renderNode'](_0xe08e3b);_0x4c82f8+='</'+_0xd33e14['tagName']+'>';}else{if(!Js(_0x4b04c5))return'';if(!_0x4b04c5['shouldBeStreamed'])return'';!function(_0x1fb8a2){if(!_0x1fb8a2['parent']||!Zs(_0x1fb8a2['parent']))return!0x1;if(!js['includes'](_0x1fb8a2['parent']['tagName']))return!0x1;return!_0x33acc6(_0x1fb8a2)['match'](/^\s*[<>]\s*$/);}(_0x4b04c5)?_0x4c82f8+=_0x11d3e7(_0x4b04c5):_0x4c82f8+=_0x11d3e7(new ti('span',{'data-ck-html-streamer-word-chunk':'','style':this['options']['textNodeStyle']},[_0x4b04c5]));}}return _0x4c82f8;}['getParsedDocumentNodeList'](){const _0x3d759b=[];return function(_0x2e5e0a,_0x59f613){const _0x51489f=_0x24626c=>{if(_0x59f613(_0x24626c),_0x24626c instanceof _0x3e43b8)for(let _0x1b6f69=0x0;_0x1b6f69<_0x24626c['children']['length'];_0x1b6f69++){const _0x16761b=_0x24626c['children'][_0x1b6f69];_0x51489f(_0x16761b);}};for(let _0x2f8e17=0x0;_0x2f8e17<_0x2e5e0a['children']['length'];_0x2f8e17++)_0x51489f(_0x2e5e0a['children'][_0x2f8e17]);}(this['document'],_0x2736b3=>{if(Js(_0x2736b3)){const _0x13945b=this['splitTextNodeIntoWordNodes'](_0x2736b3);_0x13945b['length']&&_0x3d759b['push'](..._0x13945b);}_0x2736b3['isWordSplitSource']||_0x2736b3['isWordSplitResult']||_0x3d759b['push'](_0x2736b3);}),_0x3d759b;}['splitTextNodeIntoWordNodes'](_0x461e8c){if(_0x461e8c['isWordSplitSource']||_0x461e8c['isWordSplitResult'])return[];const _0x48b09f=_0x33acc6(_0x461e8c)['match'](/(?:\s*\S+\s*)/g),_0x4136a7=[];if(_0x48b09f&&_0x48b09f['length']>0x1){for(const _0x4e4f04 of _0x48b09f){const _0x3c0766=new _0xea0ca3(_0x4e4f04);_0x3c0766['isWordSplitResult']=!0x0,_0xc74076(_0x461e8c,_0x3c0766),_0x4136a7['push'](_0x3c0766);}_0x461e8c['isWordSplitSource']=!0x0,_0x13f11d(_0x461e8c);}return _0x4136a7;}}const js=['p','li','td','th','span','h1','h2','h3','h4','h5','h6','b','strong','i','em','mark','del','ins','sup','sub','a','code','div'];function Js(_0x4b539a){return _0x54530a(_0x4b539a);}function Zs(_0x2bbd7a){return _0x1005f8(_0x2bbd7a);}function tn(_0x427d3a){const _0x3898f5=new AbortController();return{'promise':new Promise((_0x2c6881,_0x49390c)=>{const _0x20c30b=setTimeout(_0x2c6881,_0x427d3a);_0x3898f5['signal']['addEventListener']('abort',()=>{clearTimeout(_0x20c30b),_0x49390c();});}),'abortController':_0x3898f5};}class en extends Nt{['options'];['content']='';['htmlStreamer'];['children'];constructor(_0x5c7391){super();const _0x1fc9bc=this['bindTemplate'];this['set']('isDone',!0x1),this['set']('isVisible',!0x0),this['htmlStreamer']=new zs({'textNodeStyle':'animation:\x20ck-html-streamer-fade-in\x20.5s','delay':0x14}),this['options']=_0x5c7391,this['children']=this['createCollection'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__item',_0x1fc9bc['if']('isDone','ck-ai-chat__feed__item_done'),_0x1fc9bc['if']('isVisible','ck-hidden',_0x2df940=>!_0x2df940),'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'](_0x229efe=>{_0x229efe['removeAttribute']('data-id');}),this['isDone']=!0x0;}async['streamIntoElement'](_0x2d5f81,_0x35a226,_0x4e3be5){await this['htmlStreamer']['stream']({'document':_0x2d5f81,'targetElement':_0x35a226,'abortSignal':_0x4e3be5});}}class sn extends Nt{['showChangesToggleView'];constructor(_0x3890fe,_0x55de7f){super(_0x3890fe),this['set']('isShowChangesToggleVisible',!0x0),this['showChangesToggleView']=new nn(_0x3890fe),this['showChangesToggleView']['set']({'class':'ck-ai-suggestion__header__show-changes-toggle\x20ck-ai-chat-controls-button\x20'+cs,'label':as(_0x3890fe,'AI_SUGGESTION_BUTTON_SHOW_CHANGES'),'withText':!0x0}),this['showChangesToggleView']['isOn']=_0x55de7f['showDiff'],this['showChangesToggleView']['bind']('isVisible')['to'](this,'isShowChangesToggleVisible'),this['showChangesToggleView']['bind']('icon')['to'](this['showChangesToggleView'],'isOn',_0x2ba393=>_0x2ba393?_0x43f29c:_0x55a63e),this['showChangesToggleView']['on']('execute',()=>{this['showChangesToggleView']['isOn']=!this['showChangesToggleView']['isOn'],this['fire']('toggleShowChanges',{'isOn':this['showChangesToggleView']['isOn']});});const _0x25433c=new yt();_0x25433c['content']=_0xaaa825,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__header',!0x1===_0x55de7f['showHeader']?'ck-hidden':null]['filter'](Boolean)},'children':[_0x25433c,{'tag':'span','children':[as(_0x3890fe,'AI_SUGGESTION_HEADER_TITLE')]},this['showChangesToggleView']]});}}class nn extends kt{['render'](){super['render'](),this['children']['remove'](this['iconView']),this['children']['add'](this['iconView']);}}const rn={'accepted':_0x575bee,'rejected':_0x33ab6a,'outdated':_0x33ab6a};class an extends Nt{['stateIconView'];constructor(_0x165c3d){super(_0x165c3d);const _0x1677df=this['bindTemplate'];this['set']('state','accepted'),this['set']('isVisible',!0x0),this['stateIconView']=new on(),this['stateIconView']['bind']('state')['to'](this),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__content-part-state',_0x1677df['to']('state',_0x53aa40=>'ck-ai-suggestion__content-part-state_'+_0x53aa40),_0x1677df['if']('isVisible','ck-hidden',_0x1f1154=>!_0x1f1154)]},'children':[{'tag':'span','attributes':{'class':['ck-ai-suggestion__content-part-state__label']},'children':[{'text':_0x1677df['to']('state',_0x536808=>{switch(_0x536808){case'accepted':return as(_0x165c3d,'AI_SUGGESTION_CONTENT_PART_STATE_ACCEPTED');case'rejected':return as(_0x165c3d,'AI_SUGGESTION_CONTENT_PART_STATE_REJECTED');case'outdated':return as(_0x165c3d,'AI_SUGGESTION_CONTENT_PART_STATE_OUTDATED');}})}]},this['stateIconView']]});}['setState'](_0x2c6c41){this['state']=_0x2c6c41;}}class on extends yt{constructor(){super(),this['set']('state','accepted'),this['content']=rn[this['state']],this['on']('change:state',()=>{this['content']=rn[this['state']];});}}class hn extends Ot{['_applyButton'];['_suggestButton'];constructor(_0x2be124,_0x4a73f2,_0x1f89b9){super(_0x2be124);const _0x5daf70=Boolean(_0x1f89b9);this['set']('isEnabled',!_0x5daf70),this['set']('isVisible',!0x0),this['class']='ck-ai-suggestion-content-part-toolbar';const _0x1f9b46=[];if(_0x5daf70){const _0x54074d=new kt(_0x2be124);_0x54074d['set']({'label':as(_0x2be124,'AI_SUGGESTION_DISABLED_TOOLTIP_MESSAGE'),'tooltip':!0x0,'withText':!0x1,'icon':_0x147769}),_0x54074d['extendTemplate']({'attributes':{'data-cke-tooltip-class':'ck-ai-suggestion-content-part-disabled-actions-tooltip'}}),_0x1f9b46['push'](_0x54074d);}else{_0x4a73f2['includes']('applySuggestion')&&(this['_applyButton']=new kt(_0x2be124),this['_applyButton']['set']({'label':as(_0x2be124,'AI_SUGGESTION_CONTENT_PART_APPLY'),'tooltip':!0x0,'tooltipPosition':'n','withText':!0x1,'icon':_0x575bee}),this['_applyButton']['bind']('isEnabled')['to'](this),this['_applyButton']['on']('execute',()=>{this['fire']('applySuggestion');}),_0x1f9b46['push'](this['_applyButton'])),_0x4a73f2['includes']('insertSuggestion')&&(this['_suggestButton']=new kt(_0x2be124),this['_suggestButton']['set']({'label':as(_0x2be124,'AI_SUGGESTION_CONTENT_PART_ADD_SUGGESTION'),'tooltip':!0x0,'tooltipPosition':'n','withText':!0x1,'icon':_0x4899d4}),this['_suggestButton']['bind']('isEnabled')['to'](this),this['_suggestButton']['on']('execute',()=>{this['fire']('insertSuggestion');}),_0x1f9b46['push'](this['_suggestButton']));const _0x38ca1b=new kt(_0x2be124);_0x38ca1b['set']({'label':as(_0x2be124,'AI_SUGGESTION_CONTENT_PART_REJECT'),'tooltip':!0x0,'tooltipPosition':'n','withText':!0x1,'icon':_0x33ab6a}),_0x38ca1b['bind']('isEnabled')['to'](this),_0x38ca1b['on']('execute',()=>{this['fire']('rejectSuggestion');}),_0x1f9b46['push'](_0x38ca1b);}this['items']['addMany'](_0x1f9b46);const _0x598780=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':[_0x598780['if']('isVisible','ck-hidden',_0x3713b7=>!_0x3713b7)]}});}['setButtonsVisibility']({showApplyButton:_0x1d1cb2,showSuggestButton:_0x3fafa1}){this['_applyButton']&&(this['_applyButton']['isVisible']=_0x1d1cb2),this['_suggestButton']&&(this['_suggestButton']['isVisible']=_0x3fafa1);}}class cn extends Nt{['toolbarView'];['stateView'];['titleLabelView'];['children'];constructor(_0x3a6262,{part:_0x250db5,uiIndex:_0x3c4073,availableActions:_0x5e0cfa,areActionsDisabled:_0x5330ad}){super(_0x3a6262),this['set']('isEnabled',!0x0),this['set']('state','pending'),this['toolbarView']=new hn(_0x3a6262,_0x5e0cfa,_0x5330ad),this['toolbarView']['on']('rejectSuggestion',()=>{this['fire']('rejectSuggestion',{'index':_0x250db5['index']});}),this['toolbarView']['on']('insertSuggestion',()=>{this['fire']('insertSuggestion',{'index':_0x250db5['index']});}),this['toolbarView']['on']('applySuggestion',()=>{this['fire']('applySuggestion',{'index':_0x250db5['index']});}),this['toolbarView']['bind']('isEnabled')['to'](this),this['stateView']=new an(_0x3a6262),this['titleLabelView']=new ln(_0x3a6262,_0x3c4073),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',(_0x4c5860,_0x4f5161,_0x1eba29,_0x497a2c)=>{'pending'===_0x497a2c?this['children']['remove'](this['toolbarView']):this['children']['remove'](this['stateView']),'pending'===_0x1eba29?this['children']['add'](this['toolbarView']):(this['stateView']['setState'](_0x1eba29),this['children']['add'](this['stateView']));});}}class ln extends Nt{constructor(_0x1e0241,_0x1cdb91){super(_0x1e0241),this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-suggestion__body__content-part__title__label']},'children':[as(_0x1e0241,'AI_SUGGESTION_CONTENT_PART_TITLE',_0x1cdb91['toString']())]});}}class un extends Nt{['htmlStreamer'];constructor(_0x5c7ff5){super(_0x5c7ff5),this['htmlStreamer']=new zs({'textNodeStyle':'animation:\x20ck-html-streamer-fade-in\x20.5s','delay':0x14}),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content','ck-reset_all-excluded','ck-ai-suggestion-streamable-content']}});}async['update']({part:_0x26b1b2,renderingStrategy:_0x489927,abortSignal:_0x4b8037}){'streaming'===_0x489927?await this['htmlStreamer']['stream']({'document':_0x26b1b2['content'],'targetElement':this['element'],'abortSignal':_0x4b8037}):this['element']['innerHTML']=ds(_0x26b1b2['content']);}['clear'](){this['htmlStreamer']['reset'](),this['element']['innerHTML']='';}}class dn extends Nt{['_children'];['_headerView'];['_streamableContentView'];constructor(_0x6f5229,{part:_0x54d214,uiIndex:_0x568083,areActionsDisabled:_0x43fc84,availableActions:_0x57e16c}){super(_0x6f5229);const _0x20c8c3=this['bindTemplate'];this['set']('state','pending'),this['set']('isDone',!0x1),this['set']('isVisible',!0x1),this['set']('isActive',!0x1),this['set']('isEnabled',!0x1);const _0x33f1f0=()=>{this['isEnabled']=this['isDone']&&'pending'==this['state']&&!_0x43fc84;};this['on']('change:state',_0x33f1f0),this['on']('change:isDone',_0x33f1f0),_0x33f1f0(),this['_children']=this['createCollection'](),this['_headerView']=new cn(_0x6f5229,{'part':_0x54d214,'uiIndex':_0x568083,'availableActions':_0x57e16c,'areActionsDisabled':_0x43fc84}),this['_headerView']['bind']('isEnabled','state')['to'](this),this['_headerView']['delegate'](...Qs)['to'](this),this['_streamableContentView']=new un(_0x6f5229),this['_children']['addMany']([this['_headerView'],this['_streamableContentView']]),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__body__content-part',_0x20c8c3['to']('state',_0x47a461=>'ck-ai-suggestion__body__content-part_'+_0x47a461),_0x20c8c3['if']('isEnabled','ck-ai-suggestion__body__content-part_enabled'),_0x20c8c3['if']('isActive','ck-ai-suggestion__body__content-part_active'),_0x20c8c3['if']('isVisible','ck-hidden',_0x589eae=>!_0x589eae)]},'children':this['_children'],'on':{'mouseenter':_0x20c8c3['to'](()=>{this['isEnabled']&&this['fire']('mouseOverSuggestion',{'index':_0x54d214['index']});}),'mouseleave':_0x20c8c3['to'](()=>{this['isEnabled']&&this['fire']('mouseLeaveSuggestion',{'index':_0x54d214['index']});}),'click':_0x20c8c3['to'](_0xf79336=>{const _0x273537=_0xf79336['target'];this['isEnabled']&&!this['_headerView']['toolbarView']['element']['contains'](_0x273537)&&this['fire']('showChangeInText',{'index':_0x54d214['index']});})}});}async['updateContent']({part:_0x46a121,renderingStrategy:_0x43536a,showUnchangedParts:_0x14e977=!0x1,abortSignal:_0x19eb4a}){this['partDefinition']=_0x46a121,this['isVisible']=this['partDefinition']['hasChanges']||_0x14e977,this['isVisible']&&await this['_streamableContentView']['update']({'part':_0x46a121,'renderingStrategy':_0x43536a,'abortSignal':_0x19eb4a});}['markAsDone'](){this['isDone']=!0x0;}}class _n extends pt(){['queue']=[];['isProcessing']=!0x1;['_abortController'];async['enqueue'](_0x196092){const _0x508e25=this['createTask'](_0x196092);return this['queue']['push'](_0x508e25),this['_processQueue'](),_0x508e25['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(_0x3d0fa5=>{this['once']('_queueEmpty',()=>{_0x3d0fa5();});}):Promise['resolve']();}async['_processQueue'](){if(!this['isProcessing']){this['_abortController']=new AbortController(),this['isProcessing']=!0x0;try{for(;this['queue']['length']&&this['isProcessing'];){const _0xf3c952=this['queue']['shift']();try{await _0xf3c952['callback'](this['_abortController']['signal']),_0xf3c952['resolve']();}catch(_0x175215){_0xf3c952['reject'](_0x175215);}}}finally{this['isProcessing']=!0x1,this['_abortController']=void 0x0;}this['fire']('_queueEmpty');}}['createTask'](_0x41aec8){let _0x3950bb,_0x506723;const _0x10b954=new Promise((_0x4f9dd1,_0x3c3bc7)=>{_0x3950bb=_0x4f9dd1,_0x506723=_0x3c3bc7;});return{'callback':_0x41aec8,'resolve':_0x3950bb,'reject':_0x506723,'completePromise':_0x10b954};}}class An extends en{constructor(_0x208222){super(_0x208222),this['extendTemplate']({'attributes':{'class':['ck-ai-notification','warning'===_0x208222['level']?'ck-ai-notification_warning':'ck-ai-notification_error']}});}['render'](){super['render'](),this['setContent'](this['options']['initialContent']),this['markAsDone']();}['setContent'](_0x41c076){this['element']['innerHTML']=_0x41c076;}}const gn=['applySuggestion','insertSuggestion'];class In extends Nt{['_applyChangesButton'];['_insertSuggestionsButton'];['children'];constructor(_0x564842,_0x2434b1=[...gn],_0x421ce0){super(_0x564842);const _0xbee1cb=this['bindTemplate'],_0x4cfb0f=Boolean(_0x421ce0);if(this['set']('isEnabled',!_0x4cfb0f),this['set']('isVisible',!0x1),this['set']('isTrackChangesOn',!0x1),this['children']=this['createCollection'](),_0x4cfb0f){const _0x3a6972=new kt(_0x564842);_0x3a6972['set']({'label':as(_0x564842,'AI_SUGGESTION_DISABLED_TOOLTIP_MESSAGE'),'tooltip':!0x0,'withText':!0x1,'icon':_0x147769}),_0x3a6972['extendTemplate']({'attributes':{'data-cke-tooltip-class':'ck-ai-suggestion-content-part-disabled-actions-tooltip'}});const _0x99f1f5=new Nt(_0x564842);_0x99f1f5['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-chat__feed__suggestion__actions__info'},'children':[{'tag':'p','children':[as(_0x564842,'AI_SUGGESTION_DISABLED_FEED_MESSAGE'),_0x3a6972]}]}),this['children']['add'](_0x99f1f5);}else this['_applyChangesButton']=new kt(_0x564842),this['_applyChangesButton']['set']({'label':as(_0x564842,'AI_CHAT_SUGGESTION_ACTION_APPLY_ALL'),'withText':!0x0,'type':'button','isVisible':_0x2434b1['includes']('applySuggestion'),'class':os}),this['_insertSuggestionsButton']=new kt(_0x564842),this['_insertSuggestionsButton']['set']({'label':as(_0x564842,'AI_CHAT_SUGGESTION_ACTION_SUGGEST_ALL'),'withText':!0x0,'type':'button','isVisible':_0x2434b1['includes']('insertSuggestion'),'class':hs}),this['_insertSuggestionsButton']['on']('execute',()=>{this['fire']('insertSuggestion');}),this['_applyChangesButton']['on']('execute',()=>{this['fire']('applySuggestion');}),[this['_applyChangesButton'],this['_insertSuggestionsButton']]['forEach'](_0x97e69a=>{_0x97e69a['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',_0xbee1cb['if']('isVisible','ck-hidden',_0x584f4e=>!_0x584f4e)]},'children':this['children']}),this['on']('change:isTrackChangesOn',()=>{this['_applyChangesButton']&&(this['_applyChangesButton']['isVisible']=!this['isTrackChangesOn']);});}['updateVisibility'](_0x5ad1ac){this['isVisible']=_0x5ad1ac;}['_switchButtonLabelsPlurality'](_0x38f8ed){this['_applyChangesButton']&&this['_insertSuggestionsButton']&&(_0x38f8ed?(this['_applyChangesButton']['label']=as(this['locale'],'AI_CHAT_SUGGESTION_ACTION_APPLY_ALL'),this['_insertSuggestionsButton']['label']=as(this['locale'],'AI_CHAT_SUGGESTION_ACTION_SUGGEST_ALL')):(this['_applyChangesButton']['label']=as(this['locale'],'AI_CHAT_SUGGESTION_ACTION_APPLY'),this['_insertSuggestionsButton']['label']=as(this['locale'],'AI_CHAT_SUGGESTION_ACTION_SUGGEST')));}}class En extends Nt{['children'];['balloonPanelView'];['bodyCollection'];constructor(_0x21a86,_0x398bef){super(_0x21a86),this['bodyCollection']=_0x398bef,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',_0x38c91f=>!_0x38c91f)]},'children':this['children']});const _0x1a938b=new Nt(this['locale']),_0x44d154=new yt();_0x44d154['content']=_0x596377,_0x1a938b['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-web-sources__header']},'children':[_0x44d154,{'tag':'span','children':[{'text':as(this['locale'],'AI_CHAT_SOURCES_HEADER')}]}]}),this['children']['add'](_0x1a938b),this['_setupBalloonPanel'](_0x21a86);}['addSource'](_0xf0f00e){this['children']['add'](new Tn(this['locale'],_0xf0f00e,this['balloonPanelView']));}['_setupBalloonPanel'](_0x28a919){this['balloonPanelView']=new Qt(_0x28a919),this['balloonPanelView']['extendTemplate']({'attributes':{'class':['ck-ai-web-source__tooltip-balloon']}}),this['bodyCollection']['add'](this['balloonPanelView']);}}class Tn extends kt{['balloonPanelView'];['source'];constructor(_0xb3ee28,_0x25d1f8,_0x3c06a2){super(_0xb3ee28),this['source']=_0x25d1f8,this['balloonPanelView']=_0x3c06a2,this['set']({'label':_0x25d1f8['title'],'class':['ck\x20ck-ai-web-source'],'withText':!0x0});const _0x51806d=this['bindTemplate'];if(this['extendTemplate']({'on':{'click':_0x51806d['to'](()=>{window['open'](_0x25d1f8['url'],'_blank');}),'mouseenter':_0x51806d['to'](()=>{this['_showTooltip']();}),'mouseleave':_0x51806d['to'](()=>{this['_hideTooltip']();})}}),_0x25d1f8['favicon']){const _0x1d087e=new Nt(_0xb3ee28);_0x1d087e['setTemplate']({'tag':'img','attributes':{'src':_0x25d1f8['favicon']||_0x596377,'alt':_0x25d1f8['title'],'class':['ck-ai-web-source__image']}}),this['children']['add'](_0x1d087e);}else this['set']('icon',_0x596377);}['_createTooltipContentView'](_0x186d0c,_0x32661d){const _0x49faa5=new Nt(_0x186d0c),_0x49b435=[];let _0x40a0d0;_0x32661d?.['favicon']?(_0x40a0d0=new Nt(_0x186d0c),_0x40a0d0['setTemplate']({'tag':'img','attributes':{'src':_0x32661d['favicon'],'alt':_0x32661d['title'],'class':['ck-ai-web-source__tooltip-image']}})):(_0x40a0d0=new yt(),_0x40a0d0['content']=_0x596377,_0x40a0d0['extendTemplate']({'attributes':{'alt':_0x32661d['title'],'class':['ck-ai-web-source__tooltip-image']}})),_0x49b435['push'](_0x40a0d0);const _0x108838=new Nt(_0x186d0c);_0x108838['setTemplate']({'tag':'a','attributes':{'class':['ck-ai-web-source__tooltip-url'],'href':_0x32661d['url']},'children':[{'text':new URL(_0x32661d['url'])?.['hostname']}]}),_0x49b435['push'](_0x108838);const _0x2ffa70=new Nt(_0x186d0c);_0x2ffa70['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-web-source__tooltip-row']},'children':_0x49b435});const _0x5834d2=new Nt(_0x186d0c);return _0x5834d2['setTemplate']({'tag':'span','attributes':{'class':['ck-ai-web-source__tooltip-row','ck-ai-web-source__tooltip-title']},'children':[{'text':_0x32661d['title']['length']>0x190?_0x32661d['title']['substring'](0x0,0x190)+'...':_0x32661d['title']}]}),_0x49faa5['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-web-source__tooltip']},'children':[_0x2ffa70,_0x5834d2]}),_0x49faa5;}['_showTooltip'](){this['_updateTooltipContent'](),this['balloonPanelView']['pin']({'target':this['element'],'positions':[Qt['defaultPositions']['northArrowSouth'],Qt['defaultPositions']['northArrowSouthWest'],Qt['defaultPositions']['northArrowSouthEast']],'limiter':document['querySelector']('.ck-ai-chat')}),this['balloonPanelView']['show']();}['_hideTooltip'](){this['balloonPanelView']['hide']();}['_updateTooltipContent'](){this['balloonPanelView']['content']['get'](0x0)?.['destroy'](),this['balloonPanelView']['content']['clear']();const _0x2c46b5=this['_createTooltipContentView'](this['locale'],this['source']);this['balloonPanelView']['content']['add'](_0x2c46b5);}}class pn extends Nt{['_actionsView'];['_sourcesView'];['_children'];['_areActionsDisabled'];['_showUnchangedParts'];['_updateContentPartsPromiseQueue'];['_emptyPartsWarningView'];['_availableActions'];['_cachedContentParts']=[];constructor(_0x446408,_0x232b15){super(_0x446408);const {areActionsDisabled:_0x57969f,showUnchangedParts:_0x669db4,availableActions:_0x52d8c9}=_0x232b15;this['_areActionsDisabled']=_0x57969f,this['_showUnchangedParts']=_0x669db4,this['_availableActions']=_0x52d8c9,this['set']('hasPendingParts',!0x1),this['set']('isTrackChangesOn',!0x1),this['_children']=this['createCollection'](),this['_updateContentPartsPromiseQueue']=new _n(),this['_emptyPartsWarningView']=new An({'id':'empty-parts-warning','initialContent':as(_0x446408,'AI_SUGGESTION_EMPTY_PART_WARNING'),'level':'warning'}),this['_emptyPartsWarningView']['isVisible']=!0x1,this['_actionsView']=new In(_0x446408,_0x232b15['availableActions'],this['_areActionsDisabled']),this['_actionsView']['bind']('isTrackChangesOn')['to'](this),this['_sourcesView']=new En(this['locale'],_0x232b15['bodyCollection']),_0x232b15['areActionsDisabled']?this['_actionsView']['isEnabled']=!0x1:this['_actionsView']['bind']('isEnabled')['to'](this,'hasPendingParts'),this['_actionsView']['delegate'](...Qs)['to'](this),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__body']},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__body__content-parts']},'children':this['_children']},this['_emptyPartsWarningView'],this['_actionsView'],this['_sourcesView']]});}get['partsCount'](){return this['_children']['length'];}async['updateContentParts']({parts:_0x56b7c0,renderingStrategy:_0x2240a4,abortSignal:_0x1b8959}){this['_children']['length']?_0x56b7c0['forEach'](_0x291362=>{const _0x32baaf=this['_cachedContentParts']['findIndex'](_0x45b639=>_0x45b639['index']==_0x291362['index']);-0x1===_0x32baaf?this['_cachedContentParts']['push'](_0x291362):this['_cachedContentParts'][_0x32baaf]=_0x291362;}):this['_cachedContentParts']=_0x56b7c0;const _0x97d02e=this['_showUnchangedParts']?_0x56b7c0:_0x56b7c0['filter'](_0x4a121b=>_0x4a121b['hasChanges']);this['_actionsView']['_switchButtonLabelsPlurality'](_0x97d02e['length']>0x1);for(const _0x2a7485 of _0x97d02e)this['_updateContentPartsPromiseQueue']['enqueue'](async _0xdec073=>{let _0x1d879a=this['getPartView'](_0x2a7485['index']);_0x1d879a||(_0x1d879a=new dn(this['locale'],{'part':_0x2a7485,'uiIndex':this['_children']['length']+0x1,'areActionsDisabled':this['_areActionsDisabled'],'availableActions':this['_availableActions']}),_0x1d879a['delegate'](...Qs)['to'](this),this['_children']['add'](_0x1d879a),this['hasPendingParts']=!0x0),await _0x1d879a['updateContent']({'part':_0x2a7485,'renderingStrategy':_0x2240a4,'showUnchangedParts':this['_showUnchangedParts'],'abortSignal':_0xdec073}),_0x1d879a['markAsDone']();});return _0x1b8959?.['addEventListener']('abort',()=>{this['_updateContentPartsPromiseQueue']['abort']();}),this['_updateContentPartsPromiseQueue']['queueEmptyPromise'];}['updatePartState'](_0x32290f,_0x2a1f2f){const _0x231077=this['getPartView'](_0x32290f);_0x231077&&(_0x231077['state']=_0x2a1f2f),this['hasPendingParts']='pending'==_0x2a1f2f||Array['from'](this['_children'])['some'](_0x4abf1e=>'pending'==_0x4abf1e['state']);}['setPartActive'](_0x22ccda,_0xdacc36){if(!0x1===_0x22ccda){for(const _0x312a4f of this['_children'])_0x312a4f['isActive']=!0x1;}else{const _0x238267=this['getPartView'](_0x22ccda);_0x238267&&(_0x238267['isActive']=_0xdacc36);}}['updateSources'](_0x45e92f){_0x45e92f['forEach'](_0x3e38b4=>this['_sourcesView']['addSource'](_0x3e38b4)),this['_sourcesView']['isVisible']=!0x0;}['getPartView'](_0x39cde7){return this['_children']['find'](_0x15e239=>_0x15e239['partDefinition']['index']==_0x39cde7)??null;}['markAsDone'](){if(!this['_showUnchangedParts']){const _0x5f12bc=!this['_cachedContentParts']['find'](({hasChanges:_0x1a33de})=>_0x1a33de),_0x5f333d=!!this['_cachedContentParts']['find'](({hasChanges:_0xa6f8b})=>!_0xa6f8b);this['_emptyPartsWarningView']['isVisible']=0x0==this['_children']['length']||_0x5f333d,_0x5f12bc?this['_emptyPartsWarningView']['setContent'](as(this['locale'],'AI_SUGGESTION_NO_PARTS_WARNING')):this['_emptyPartsWarningView']['setContent'](as(this['locale'],'AI_SUGGESTION_EMPTY_PART_WARNING'));}this['_children']['forEach'](_0x1c68d8=>_0x1c68d8['markAsDone']()),this['_actionsView']['updateVisibility'](this['hasNonEmptyParts']);}get['hasNonEmptyParts'](){return this['_children']['filter'](_0xccefcf=>_0xccefcf['partDefinition']['hasChanges'])['length']>0x0;}}class mn extends Nt{['bodyView'];['children'];['headerView'];constructor(_0x3b4914,_0x243a3f,_0xac2129){super(_0x3b4914);const {showDiff:_0x5e773e,areActionsDisabled:_0x394671,showUnchangedParts:_0x30389e,availableActions:_0xbcf81c}=_0x243a3f;this['set']('isTrackChangesOn',!0x1),this['set']('areChangesVisible',!0x1),this['children']=this['createCollection'](),this['headerView']=new sn(_0x3b4914,{'showDiff':_0x5e773e}),this['headerView']['on']('toggleShowChanges',(_0x415e2d,_0x28066d)=>{this['areChangesVisible']=_0x28066d['isOn'],this['fire']('toggleSuggestionDisplayMode',{'showDiff':_0x28066d['isOn']});}),this['children']['add'](this['headerView']),this['bodyView']=new pn(_0x3b4914,{'areActionsDisabled':_0x394671,'showUnchangedParts':!!_0x30389e,'availableActions':_0xbcf81c,'bodyCollection':_0xac2129}),this['bodyView']['delegate'](...Qs)['to'](this),this['bodyView']['bind']('isTrackChangesOn')['to'](this),this['children']['add'](this['bodyView']),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__container','ck-rounded-corners']},'children':this['children']});}async['updateContent'](_0x8bd29f){await this['bodyView']['updateContentParts'](_0x8bd29f);}['updateSources'](_0x42c4a2){this['bodyView']['updateSources'](_0x42c4a2);}['markAsDone'](){this['bodyView']['markAsDone'](),this['headerView']&&(this['headerView']['isShowChangesToggleVisible']=this['bodyView']['hasNonEmptyParts']);}}class Cn extends en{['containerView'];constructor(_0x141a58,_0x9b9331,_0x135473){super(_0x9b9331),this['set']('isTrackChangesOn',!0x1),this['containerView']=new mn(_0x141a58,{'showDiff':_0x9b9331['showDiff'],'areActionsDisabled':_0x9b9331['areActionsDisabled'],'availableActions':_0x9b9331['availableActions']},_0x135473),this['containerView']['on']('toggleSuggestionDisplayMode',(_0x1ac9d5,_0x3273ab)=>{this['fire']('toggleSuggestionDisplayMode',{'replyId':this['options']['id'],'showDiff':_0x3273ab['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',(_0x3feed6,{index:_0x5e6b84})=>{this['fire']('showChangeInText',{'replyId':this['options']['id'],'partIndex':_0x5e6b84});}),this['containerView']['on']('applySuggestion',(_0x5a92b7,{index:_0x19ca9f}={})=>{this['fire']('applySuggestion',{'replyId':this['options']['id'],'partIndex':_0x19ca9f});}),this['containerView']['on']('insertSuggestion',(_0x1051dc,{index:_0x58e38b}={})=>{this['fire']('insertSuggestion',{'replyId':this['options']['id'],'partIndex':_0x58e38b});}),this['containerView']['on']('rejectSuggestion',(_0x224e9c,{index:_0x4c518f})=>{this['fire']('rejectSuggestion',{'replyId':this['options']['id'],'partIndex':_0x4c518f});}),this['containerView']['on']('mouseOverSuggestion',(_0x2b94a6,{index:_0x11ad85})=>{this['fire']('mouseOverSuggestion',{'replyId':this['options']['id'],'partIndex':_0x11ad85});}),this['containerView']['on']('mouseLeaveSuggestion',(_0x3058a3,{index:_0x1c9ad8})=>{this['fire']('mouseLeaveSuggestion',{'replyId':this['options']['id'],'partIndex':_0x1c9ad8});}),this['children']['addMany']([this['containerView']]),this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__ai-suggestion']}});}async['updateContent'](_0x4ecfdf){await this['containerView']['updateContent'](_0x4ecfdf);}['updatePartState'](_0x8e5e52,_0x169449){this['containerView']['bodyView']['updatePartState'](_0x8e5e52,_0x169449);}['setPartActive'](_0x169b1f,_0x11e74d){!0x1===_0x169b1f?this['containerView']['bodyView']['setPartActive'](!0x1):this['containerView']['bodyView']['setPartActive'](_0x169b1f,_0x11e74d);}['updateSources'](_0x5c240c){this['containerView']['updateSources'](_0x5c240c);}['getPartView'](_0x10d12f){return this['containerView']['bodyView']['getPartView'](_0x10d12f);}['markAsDone'](){super['markAsDone'](),this['containerView']['markAsDone']();}}class wn extends en{['replyContainer'];['_bodyCollection'];constructor(_0x5d8f88,_0x47b82f,_0x2e692b){super(_0x47b82f),this['_bodyCollection']=_0x2e692b,this['locale']=_0x5d8f88,this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__ai-reply']}}),this['replyContainer']=new Nt(),this['replyContainer']['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all-excluded','ck-ai-chat__feed__ai-reply-container']}}),this['children']['add'](this['replyContainer']);}async['render'](){super['render'](),this['options']['initialContent']&&(await this['updateContent']({'parsedContent':us(this['options']['initialContent']),'renderingStrategy':'static'}),this['markAsDone']());}async['updateContent']({parsedContent:_0x1852d7,renderingStrategy:_0x394e44,abortSignal:_0x11a2f1}){'streaming'===_0x394e44?await this['streamIntoElement'](_0x1852d7,this['replyContainer']['element'],_0x11a2f1):this['replyContainer']['element']['innerHTML']=_0x11d3e7(_0x1852d7);}['updateSources'](_0x42a37b){const _0x56580b=new En(this['locale'],this['_bodyCollection']);_0x56580b['children']['addMany'](_0x42a37b['map'](_0x43f04f=>new Tn(this['locale'],_0x43f04f,_0x56580b['balloonPanelView']))),_0x56580b['isVisible']=!0x0,this['children']['add'](_0x56580b);}}class fn extends vt{constructor(_0x40916b=void 0x0){super();const _0x18b5ce=_0x40916b?'ck-ai-spinner_'+_0x40916b:'';this['extendTemplate']({'tag':'span','attributes':{'class':['ck-ai-spinner',_0x18b5ce]}});}}const Sn={'file':_0x5e55fc,'document':_0xaaa825,'web-resource':_0x8ee664,'text':_0x5e55fc,'selection':_0x416536,'mcp-tool-context':_0xaaa825},bn='ck-ai-chat-context-chip',Rn='ck-ai-chat-context-chip_wide',On='ck-ai-chat-context-chip_document',kn='ck-ai-chat-context-chip__label',Nn='ck-ai-chat-context-chip__type-icon',vn='ck-ai-chat-context-controls__chip-tooltip',yn='n';class xn extends kt{constructor(_0x4152be,_0x4b7260,_0x1ac792,_0x461aca,_0x449c47=!0x1){super(_0x4152be),this['_isAnimationOnEnterEnabled']=_0x461aca,this['_initializeProperties'](_0x4b7260,_0x1ac792,_0x449c47),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'](_0x11d703,_0x4a2918,_0x13f742){this['set']('label',_0x11d703['label']),this['set']('tooltip',!0x0),this['set']('itemType',_0x11d703['type']),this['set']('id',_0x11d703['uiId']),this['set']('readonly',_0x4a2918),this['set']('isLoading',_0x13f742);}['_setupTemplate'](){const _0x32fe95=this['_createIconView'](),_0x4d60fa=this['_createRemoveButton'](),_0x6710aa=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':this['_createTemplateAttributes'](_0x6710aa),'children':this['_createTemplateChildren'](_0x32fe95,_0x4d60fa,_0x6710aa)});}['_createTemplateAttributes'](_0x2e14c1){return{'class':[bn,_0x2e14c1['if']('itemType',On,_0xca495d=>'document'==_0xca495d),_0x2e14c1['if']('itemType',Rn,_0x147db9=>'selection'==_0x147db9)],'data-cke-tooltip-text':_0x2e14c1['to']('label',Ln),'data-cke-tooltip-position':yn,'data-cke-tooltip-class':vn};}['_createTemplateChildren'](_0x4ca051,_0x3ecfb7,_0x536bf2){const _0x279b7e=this['_createLabelElement'](_0x536bf2),_0x2b760b=this['_createLoaderIcon']();return this['readonly']?[_0x4ca051,_0x279b7e]:[_0x4ca051,_0x2b760b,_0x279b7e,_0x3ecfb7];}['_createLabelElement'](_0x1794bd){return{'tag':'span','attributes':{'class':kn},'children':[{'text':_0x1794bd['to']('label')}]};}['_createRemoveButton'](){const _0x111271=new kt(this['locale']);return _0x111271['set']({'label':as(this['locale'],'AI_CHAT_CONTEXT_REMOVE_FROM_CONTEXT'),'icon':_0x6494e0}),this['_setupRemoveButtonEvent'](_0x111271),_0x111271;}['_setupRemoveButtonEvent'](_0x6ffda){_0x6ffda['on']('execute',()=>{this['fire']('removeContextItemChip',this['id']);});}['_createIconView'](){const _0x432151=this['bindTemplate'],_0x328c58=new yt();return _0x328c58['content']=Sn[this['itemType']],_0x328c58['extendTemplate']({'attributes':{'class':[Nn,_0x432151['if']('isLoading','ck-hidden',_0x150f3e=>_0x150f3e)]}}),_0x328c58;}['_handleAnimationEndOnce'](_0x17bb98,_0x4172a9){if(!_0x17bb98)return;const _0x482e95=()=>{_0x4172a9(),_0x17bb98['removeEventListener']('animationend',_0x482e95),_0x17bb98['removeEventListener']('webkitAnimationEnd',_0x482e95);};_0x17bb98['addEventListener']('animationend',_0x482e95),_0x17bb98['addEventListener']('webkitAnimationEnd',_0x482e95);}['_createLoaderIcon'](){const _0x3145d3=new fn('small');return _0x3145d3['bind']('isVisible')['to'](this,'isLoading',_0xa24a5a=>_0xa24a5a),_0x3145d3;}}function Ln(_0x5edf45){if(!_0x5edf45)return _0x5edf45;if(_0x5edf45['length']<=0x78)return _0x5edf45;const _0x9cc64e=_0x5edf45['slice'](0x0,0x78),_0x380c2c=_0x9cc64e['lastIndexOf']('\x20');return(_0x380c2c>0x0?_0x9cc64e['slice'](0x0,_0x380c2c):_0x9cc64e)+'…';}const Dn={'maxVisibleRows':0x2,'rowDetectionTolerance':0x5,'showMoreLabelPrefix':'+\x20','viewportOffset':{'top':0x64,'bottom':0xa}},Pn='300px';class Hn{['_locale'];['_config'];['_visibleChips'];['_overflowChips'];['_showMoreButtonView']=null;['_showMoreBalloonPanelView']=null;['_containerElement']=null;['_bodyCollection'];['_parentView']=null;['_intersectionObserver']=null;['_pendingCalculation']=!0x1;constructor(_0x3bed8a,_0x200048,_0x594cdf,_0x370ac9,_0x50abab){this['_locale']=_0x3bed8a,this['_visibleChips']=_0x200048,this['_config']={...Dn,..._0x594cdf,'cssClasses':{'controlsButton':'','calculationContainer':'ck-calculation-container',..._0x594cdf['cssClasses']}},this['_overflowChips']=new dt(),this['_bodyCollection']=_0x370ac9,this['_parentView']=_0x50abab||null;}['setContainerElement'](_0x1335fa){this['_intersectionObserver']&&(this['_intersectionObserver']['disconnect'](),this['_intersectionObserver']=null),this['_containerElement']=_0x1335fa,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 _0x1a30cb=[...this['_visibleChips'],...this['_overflowChips']],_0x5658d2=this['_createCalculationContainer'](),_0x49ba59=this['_calculateOverflowInContainer'](_0x5658d2,_0x1a30cb),_0x54ecc5=_0x5658d2['_ancestorsToRestore'];_0x54ecc5&&this['_restoreAncestorVisibility'](_0x54ecc5),_0x5658d2['remove'](),this['_applyOverflowResults'](_0x1a30cb,_0x49ba59);}['_createShowMoreButton'](){this['_showMoreButtonView']=this['_createShowMoreButtonView'](),this['_showMoreBalloonPanelView']=this['_createShowMoreBalloonPanelView'](),this['_showMoreButtonView']['render'](),this['_containerElement']['appendChild'](this['_showMoreButtonView']['element']),this['_showMoreButtonView']['on']('execute',()=>{this['_handleShowMoreButtonClick']();}),Xt({'emitter':this['_showMoreBalloonPanelView'],'contextElements':[this['_showMoreBalloonPanelView']['element'],this['_showMoreButtonView']['element']],'callback':()=>this['hideBalloonPanel'](),'activator':()=>this['_showMoreButtonView']['isOn']});}['_createShowMoreButtonView'](){const _0x3f2c44=new kt(this['_locale']);_0x3f2c44['set']({'label':'','withText':!0x0,'isToggleable':!0x0});const _0x5480c4=[this['_config']['cssClasses']['showMoreButton']];return this['_config']['cssClasses']['controlsButton']&&_0x5480c4['push'](this['_config']['cssClasses']['controlsButton']),_0x3f2c44['extendTemplate']({'attributes':{'class':_0x5480c4}}),_0x3f2c44;}['_createShowMoreBalloonPanelView'](){const _0x23af89=new Qt(this['_locale']);return _0x23af89['extendTemplate']({'attributes':{'class':this['_config']['cssClasses']['showMoreBalloon']}}),this['_bodyCollection']['add'](_0x23af89),_0x23af89;}['_updateBalloonContent'](){if(this['_showMoreBalloonPanelView']&&(this['_showMoreBalloonPanelView']['content']['clear'](),this['_overflowChips']['length']>0x0)){this['_overflowChips']['forEach'](_0x8d04ee=>{_0x8d04ee['disableAnimationOnEnter']();});const _0x2b5cdd=new Nt(this['_locale']);_0x2b5cdd['setTemplate']({'tag':'div','attributes':{'class':this['_config']['cssClasses']['overflowContainer']},'children':this['_overflowChips']}),this['_showMoreBalloonPanelView']['content']['add'](_0x2b5cdd);}}['_handleShowMoreButtonClick'](){this['_showMoreButtonView']['isOn']?this['hideBalloonPanel']():this['showBalloonPanel']();}['_updateShowMoreButtonVisibility'](){const _0x2caf11=this['_overflowChips']['length']>0x0;this['_showMoreButtonView']?.['element']&&(this['_showMoreButtonView']['element']['style']['display']=_0x2caf11?'':'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'](_0x33faa8){const _0x1dc256=this['_containerElement']?.['tagName']['toLowerCase']()||'div',_0x2cda14=this['_containerElement']?.['classList'];if(_0x2cda14){const _0x2362b5=_0x2cda14[0x0]||'',_0x23dd6c=_0x33faa8['querySelector']('.'+_0x2362b5),_0x53ef4f=_0x33faa8['querySelector'](_0x1dc256);return _0x23dd6c||_0x53ef4f||_0x33faa8;}return _0x33faa8['querySelector'](_0x1dc256)||_0x33faa8;}['_calculateContainerWidth'](){const _0xeeac10=this['_parentView']?.['element']||this['_containerElement'];if(!_0xeeac10)return Pn;const _0x11f3d3=window['getComputedStyle'](_0xeeac10)['width'];if('auto'===_0x11f3d3||'0px'===_0x11f3d3||!_0x11f3d3){const _0xcdeb96=_0xeeac10['parentElement'];if(_0xcdeb96){const _0x159153=window['getComputedStyle'](_0xcdeb96);return'auto'!==_0x159153['width']?_0x159153['width']:Pn;}return Pn;}return _0x11f3d3;}['_applyCalculationStyles'](_0x574f7d,_0x37cdd9){this['_config']['cssClasses']['calculationContainer']&&_0x574f7d['classList']['add'](this['_config']['cssClasses']['calculationContainer']),_0x574f7d['style']['width']=_0x37cdd9,_0x574f7d['style']['position']='absolute',_0x574f7d['style']['top']='-9999px',_0x574f7d['style']['left']='-9999px',_0x574f7d['style']['opacity']='0',_0x574f7d['style']['pointerEvents']='none',_0x574f7d['style']['zIndex']='-1',_0x574f7d['style']['visibility']='visible\x20!important',_0x574f7d['style']['display']='block\x20!important',_0x574f7d['style']['boxSizing']='border-box';}['_restoreAncestorVisibility'](_0x4ff8e6){_0x4ff8e6['forEach'](({element:_0x8b95b3,originalDisplay:_0x58789a,originalVisibility:_0x5672f5})=>{_0x8b95b3['style']['display']=_0x58789a,_0x8b95b3['style']['visibility']=_0x5672f5;});}['_makeAncestorsVisible'](_0x4ecf3b){const _0x5b928c=[];let _0x52ef9d=_0x4ecf3b;for(;_0x52ef9d&&_0x52ef9d!==document['body'];){const _0x545aff=window['getComputedStyle'](_0x52ef9d);'none'!==_0x545aff['display']&&'hidden'!==_0x545aff['visibility']||(_0x5b928c['push']({'element':_0x52ef9d,'originalDisplay':_0x52ef9d['style']['display'],'originalVisibility':_0x52ef9d['style']['visibility']}),_0x52ef9d['style']['display']='block',_0x52ef9d['style']['visibility']='visible'),_0x52ef9d=_0x52ef9d['parentElement'];}return _0x5b928c;}['_createContainerElements'](){let _0x484c39,_0x543599;return this['_parentView']?.['element']?(_0x484c39=this['_parentView']['element']['cloneNode'](!0x0),_0x543599=this['_findTargetContainer'](_0x484c39)):(_0x484c39=document['createElement']('div'),_0x543599=_0x484c39),{'calculationContainer':_0x484c39,'targetContainer':_0x543599};}['_createCalculationContainer'](){const {calculationContainer:_0x377e8b,targetContainer:_0x509047}=this['_createContainerElements'](),_0xf70528=this['_calculateContainerWidth']();this['_applyCalculationStyles'](_0x377e8b,_0xf70528);const _0x49f217=this['_parentView']?.['element']||this['_containerElement'],_0x331200=_0x49f217?.['parentElement'];_0x331200?_0x331200['appendChild'](_0x377e8b):document['body']['appendChild'](_0x377e8b),_0x377e8b['_targetContainer']=_0x509047;const _0x1e376c=this['_makeAncestorsVisible'](_0x331200||null);return _0x377e8b['offsetWidth'],_0x377e8b['_ancestorsToRestore']=_0x1e376c,_0x377e8b;}['_calculateOverflowInContainer'](_0x50ed37,_0x5d7ac1){const _0x88641a=_0x50ed37['_targetContainer']||_0x50ed37,_0x40b5c7=[],{rowCount:_0x11a8d8}=this['_renderChipsAndCountRows'](_0x88641a,_0x5d7ac1);if(_0x11a8d8<=this['_config']['maxVisibleRows'])return _0x40b5c7;const _0x3b1abf=_0x5d7ac1['slice']();for(;_0x3b1abf['length']>0x0;){if(this['_testButtonFit'](_0x50ed37,_0x88641a,_0x3b1abf)){const _0x415892=_0x5d7ac1['filter'](_0x11f817=>!_0x3b1abf['includes'](_0x11f817));_0x40b5c7['push'](..._0x415892);break;}if(!_0x3b1abf['pop']())break;}return _0x40b5c7;}['_renderChipsAndCountRows'](_0x136829,_0x36778e){_0x136829['innerHTML']='',_0x36778e['forEach'](_0x2737ba=>{if(_0x2737ba['element']){const _0x58441d=_0x2737ba['element']['cloneNode'](!0x0);_0x136829['appendChild'](_0x58441d);}}),_0x136829['offsetWidth'];const _0x1f259d=_0x136829['children'],_0x45c6f5=[];return Array['from'](_0x1f259d)['forEach'](_0x5812c0=>{const _0x5aec6b=_0x5812c0['getBoundingClientRect']()['top'];_0x45c6f5['some'](_0x4381c2=>Math['abs'](_0x4381c2-_0x5aec6b)<this['_config']['rowDetectionTolerance'])||_0x45c6f5['push'](_0x5aec6b);}),{'rowCount':_0x45c6f5['length']};}['_createMockButton'](){const _0xbb044c=document['createElement']('button');return _0xbb044c['className']=this['_config']['cssClasses']['showMoreButton'],this['_config']['cssClasses']['controlsButton']&&_0xbb044c['classList']['add'](this['_config']['cssClasses']['controlsButton']),_0xbb044c['textContent']='+\x201',_0xbb044c;}['_testButtonFit'](_0x3fef88,_0x2510a9,_0x377b95){this['_renderChipsAndCountRows'](_0x2510a9,_0x377b95);const _0x15d2c9=this['_createMockButton']();_0x3fef88['appendChild'](_0x15d2c9),_0x3fef88['offsetWidth'];const _0x1caf46=[..._0x2510a9['children'],_0x15d2c9],_0x4c2220=[];_0x1caf46['forEach'](_0x5c3845=>{const _0xb5a0d8=_0x5c3845['getBoundingClientRect']()['top'];_0x4c2220['some'](_0x3651fb=>Math['abs'](_0x3651fb-_0xb5a0d8)<this['_config']['rowDetectionTolerance'])||_0x4c2220['push'](_0xb5a0d8);});const _0x17bb38=_0x4c2220['length'];return _0x15d2c9['remove'](),_0x17bb38<=this['_config']['maxVisibleRows'];}['_distributeChips'](_0x12095c,_0x1e45e4){this['_visibleChips']['clear'](),this['_overflowChips']['clear'](),_0x12095c['forEach'](_0x20fdc5=>{_0x1e45e4['includes'](_0x20fdc5)?this['_overflowChips']['add'](_0x20fdc5):this['_visibleChips']['add'](_0x20fdc5);});}['_updateOverflowUI'](_0x2ccac4){if(_0x2ccac4>0x0&&!this['_showMoreButtonView']&&this['_createShowMoreButton'](),_0x2ccac4>0x0&&this['_showMoreButtonView']){const _0x48810d=''+this['_config']['showMoreLabelPrefix']+(_0x2ccac4<0x63?_0x2ccac4:'99');this['_showMoreButtonView']['label']=_0x48810d;}this['_updateBalloonContent'](),this['_updateShowMoreButtonVisibility'](),this['_repinBalloonPanel']();}['_applyOverflowResults'](_0xd8e63,_0x4c812d){this['_distributeChips'](_0xd8e63,_0x4c812d),this['_updateOverflowUI'](_0x4c812d['length']);}['_setupVisibilityObserver'](){this['_containerElement']&&'undefined'!=typeof IntersectionObserver&&(this['_intersectionObserver']=new IntersectionObserver(_0x537572=>{_0x537572[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 _0x5b351b=this['_containerElement']['getBoundingClientRect']();if(0x0===_0x5b351b['width']||0x0===_0x5b351b['height'])return!0x1;const _0x34e32d=window['innerHeight']||document['documentElement']['clientHeight'],_0x36678f=window['innerWidth']||document['documentElement']['clientWidth'],_0x2286aa=0xc8;return _0x5b351b['bottom']>=-0xc8&&_0x5b351b['top']<=_0x34e32d+_0x2286aa&&_0x5b351b['right']>=-0xc8&&_0x5b351b['left']<=_0x36678f+_0x2286aa;}}const Mn='ck-ai-chat__feed__context-chips',Un='ck-ai-chat-context-chips-wrapper',Vn='ck-ai-chat-context-chips-wrapper-balloon',Bn='ck-ai-chat-controls-button',Gn='ck-ai-chat-controls_context_show-more-button',Fn='ck-ai-chat-context-controls__show-more-balloon-panel';class Kn extends Nt{['_contextChips']=this['createCollection']();['_overflowManager'];['_bodyCollection'];constructor(_0xce443,_0x3235d8,_0x5575df){super(_0xce443),this['_bodyCollection']=_0x5575df,this['_createContextChips'](_0x3235d8);const _0x1a44c7={'cssClasses':{'showMoreButton':Gn+'\x20'+cs,'showMoreBalloon':Fn,'overflowContainer':Vn,'controlsButton':Bn}};this['_overflowManager']=new Hn(_0xce443,this['_contextChips'],_0x1a44c7,this['_bodyCollection'],this),this['setTemplate']({'tag':'div','attributes':{'class':[Mn,'ck','ck-reset_all']},'children':[{'tag':'div','attributes':{'class':Un},'children':this['_contextChips']}]});}['render'](){super['render']();const _0x358e11=this['element']['querySelector']('.'+Un);_0x358e11&&(this['_overflowManager']['setContainerElement'](_0x358e11),this['_overflowManager']['reorganizeChips']());}['destroy'](){super['destroy'](),this['_overflowManager']['destroy']();}['_createContextChips'](_0x11b8a6){for(const _0x3f9a8a of _0x11b8a6){const _0x2eca21=new xn(this['locale'],_0x3f9a8a,!0x0,!0x1);this['_contextChips']['add'](_0x2eca21);}}}class Wn extends en{['_contextChipsView']=null;['_locale'];['_bodyCollection'];['_messageContentView'];constructor(_0x1f7811,_0x5ac68e,_0x1de4c0){super(_0x5ac68e),this['_locale']=_0x1f7811,this['_bodyCollection']=_0x1de4c0,this['_createContextChipsView'](),this['_createMessageContentView'](),this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__user-message']}});}['_createContextChipsView'](){this['options']['contextItems']&&this['options']['contextItems']['length']>0x0&&(this['_contextChipsView']=new Kn(this['_locale'],this['options']['contextItems']['filter'](_0x463755=>!_0x463755['hidden']),this['_bodyCollection']),this['_contextChipsView']['extendTemplate']({'attributes':{'class':'ck-ai-chat__feed__context-chips'}}),this['children']['add'](this['_contextChipsView']));}['_createMessageContentView'](){this['_messageContentView']=new Nt(this['_locale']),this['_messageContentView']['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-chat__feed__message-content'}}),this['children']['add'](this['_messageContentView']);}['render'](){super['render'](),this['_messageContentView']['element']['innerHTML']=this['options']['initialContent'],this['markAsDone']();}}class Yn extends en{['capabilities'];constructor(_0x501c77,_0x2b654e){super(_0x2b654e);const {isWebSearchEnabled:_0x4c2428,isReasoningEnabled:_0x3bc72e}=_0x2b654e['capabilities'],_0x1ce4ad=[];let _0x2c0bef='';_0x4c2428&&_0x3bc72e?(_0x2c0bef=as(_0x501c77,'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH_REASONING'),_0x1ce4ad['push']($n(_0x596377)),_0x1ce4ad['push']($n(_0x5e3239))):_0x4c2428?(_0x2c0bef=as(_0x501c77,'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH'),_0x1ce4ad['push']($n(_0x596377))):_0x3bc72e&&(_0x2c0bef=as(_0x501c77,'AI_CHAT_FEED_REPLY_ITEM_USED_REASONING'),_0x1ce4ad['push']($n(_0x5e3239))),this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__interaction-header',_0x2c0bef?'':'ck-hidden']}});const _0x27ecef=new Nt();_0x27ecef['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__interaction-header__capabilities']},'children':[..._0x1ce4ad,{'tag':'span','attributes':{'class':['ck-ai-chat__feed__interaction-header__capabilities__text']},'children':[_0x2c0bef]}]}),this['children']['add'](_0x27ecef),this['capabilities']=_0x2b654e['capabilities'];}}function $n(_0x39f7ca){const _0x1544a9=new yt();return _0x1544a9['content']=_0x39f7ca,_0x1544a9;}const qn=['wheel','touchstart','pointerdown','keydown'],Qn=['ArrowUp','ArrowDown','PageUp','PageDown','Home','End','\x20'];class Xn{['element'];['animationFrameId'];['isRunning'];['abortController'];['isUserPaused'];constructor(_0x86b12e){this['element']=_0x86b12e,this['animationFrameId']=null,this['isRunning']=!0x1,this['abortController']=new AbortController(),this['isUserPaused']=!0x1;for(const _0x36ea48 of qn){const _0x459365='keydown'!==_0x36ea48;this['element']['addEventListener'](_0x36ea48,this['_onUserEvent']['bind'](this),{'passive':_0x459365,'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'](_0x191063){if(this['isRunning']){if('keydown'===_0x191063['type']){const _0x3b2498=_0x191063['key'];if(!Qn['includes'](_0x3b2498))return;}_0x191063 instanceof WheelEvent?_0x191063['deltaY']<0x0?this['isUserPaused']=!0x0:this['isUserPaused']=!this['_isAtBottom']():this['isUserPaused']=!0x0;}}['_isAtBottom'](){const {scrollTop:_0x39bcdf,scrollHeight:_0x9d8b26,clientHeight:_0x31d2af}=this['element'];return _0x9d8b26-_0x39bcdf-_0x31d2af<=0x5;}['_rafUpdate'](){this['isRunning']&&(this['isUserPaused']||this['element']['scrollTo']({'top':this['element']['scrollHeight'],'behavior':'auto'}),this['animationFrameId']=requestAnimationFrame(this['_rafUpdate']['bind'](this)));}}class zn extends Nt{constructor(_0x422f45,_0x10b141){super(_0x422f45),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-skeleton']},'children':this['_createSkeletonItems'](_0x10b141)});}['_createSkeletonItems'](_0x5bc755){const _0x577e81=['ck','ck-ai-skeleton__item'];return _0x5bc755['map'](_0x21fff9=>{let _0x2952ce='';switch(_0x21fff9['attributes']['align']){case'right':_0x2952ce='margin-left:\x20auto;\x20margin-right:\x200;\x20text-align:\x20right;';break;case'center':_0x2952ce='margin-left:\x20auto;\x20margin-right:\x20auto;\x20text-align:\x20center;';break;case'left':_0x2952ce='margin-left:\x200;\x20margin-right:\x20auto;\x20text-align:\x20left;';}return{'tag':_0x21fff9['tag'],'attributes':{'class':[..._0x577e81,_0x21fff9['attributes']['class']?_0x21fff9['attributes']['class']:''],'style':'width:\x20'+_0x21fff9['attributes']['width']+';\x20height:\x20'+_0x21fff9['attributes']['height']+';'+_0x2952ce}};});}}const jn={'aiFeed':[{'tag':'div','attributes':{'width':'100%','height':'72px','align':'right'}},{'tag':'div','attributes':{'width':'250px','height':'40px','align':'right'}},{'tag':'div','attributes':{'width':'100%','height':'88px','align':'right'}},{'tag':'div','attributes':{'width':'150px','height':'40px','align':'right'}},{'tag':'div','attributes':{'width':'100%','height':'140px','align':'right'}},{'tag':'div','attributes':{'width':'250px','height':'40px','align':'right'}},{'tag':'div','attributes':{'width':'100%','height':'88px','align':'right'}}],'aiHistory':Jn(0x5,'100%','44px','right'),'aiChatResources':Jn(0x8,'100%','24px','right'),'aiReviewChecks':[{'tag':'div','attributes':{'width':'128px','height':'24px','align':'left'}},{'tag':'div','attributes':{'width':'100%','height':'24px','align':'left'}},{'tag':'div','attributes':{'width':'128px','height':'24px','align':'left'}}]};function Jn(_0x3d2265,_0x317ce6,_0x5a63a9,_0x4acc4e){return new Array(_0x3d2265)['fill'](null)['map'](()=>({'tag':'div','attributes':{'width':_0x317ce6,'height':_0x5a63a9,'align':_0x4acc4e}}));}class Zn extends en{constructor(_0x3f0ab0){super(_0x3f0ab0),this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__custom-element']}});}async['render'](){super['render'](),'string'==typeof this['options']['content']?this['element']['innerHTML']=this['options']['content']:this['element']['appendChild'](this['options']['content']);}}class tr extends Nt{['children'];['scrollManager'];['_bodyCollection'];constructor(_0x2f139c,_0x550cd5){super(_0x2f139c),this['_bodyCollection']=_0x550cd5,this['set']('isPending',!0x1),this['set']('loadingMessage',''),this['set']('isLoadingSkeletonVisible',!0x1),this['set']('isTrackChangesOn',!0x1),this['children']=this['createCollection'](),this['children']['delegate'](...Xs)['to'](this),this['_setupTemplate']();}['render'](){super['render'](),this['scrollManager']=new Xn(this['element']);}['destroy'](){super['destroy'](),this['scrollManager']['destroy']();}['clear'](){this['children']['clear']();}['addItem'](_0x5204c8,_0x4dca47){let _0x3ac737;return'ai-reply'===_0x5204c8?_0x3ac737=new wn(this['locale'],_0x4dca47,this['_bodyCollection']):'ai-suggestion-reply'===_0x5204c8?(_0x3ac737=new Cn(this['locale'],_0x4dca47,this['_bodyCollection']),_0x3ac737['bind']('isTrackChangesOn')['to'](this)):_0x3ac737='user-message'===_0x5204c8?new Wn(this['locale'],_0x4dca47,this['_bodyCollection']):'interaction-header'===_0x5204c8?new Yn(this['locale'],_0x4dca47):'custom-element'===_0x5204c8?new Zn(_0x4dca47):new An(_0x4dca47),this['children']['add'](_0x3ac737),_0x3ac737;}async['updateReplyItem']({id:_0x4881f9,parsedContent:_0x54e088,renderingStrategy:_0xf1a18d,abortSignal:_0x2c20eb}){const _0xe917a1=this['getItemById'](_0x4881f9);if(!(_0xe917a1 instanceof wn))throw new ot('ai-chat-feed-view-item-not-a-reply-item',null,{'itemView':_0xe917a1,'id':_0x4881f9,'parsedContent':_0x54e088});await _0xe917a1['updateContent']({'parsedContent':_0x54e088,'renderingStrategy':_0xf1a18d,'abortSignal':_0x2c20eb});}async['updateWebSources'](_0x2959f8,_0x1ba3b7){const _0x593785=this['getItemById'](_0x2959f8);if(_0x593785 instanceof Cn)_0x593785['updateSources'](_0x1ba3b7);else{if(!(_0x593785 instanceof wn))throw new ot('ai-chat-feed-view-item-not-a-suggestion-or-reply-item',null,{'itemView':_0x593785,'id':_0x2959f8,'sources':_0x1ba3b7});_0x593785['updateSources'](_0x1ba3b7);}}async['updateSuggestionItem']({id:_0x4f8723,parts:_0x4ff36d,renderingStrategy:_0xfe5d5d,abortSignal:_0x18026c}){const _0x49f4a1=this['getItemById'](_0x4f8723);if(!(_0x49f4a1 instanceof Cn))throw new ot('ai-chat-feed-view-item-not-a-suggestion-item',null,{'itemView':_0x49f4a1,'id':_0x4f8723,'parts':_0x4ff36d});await _0x49f4a1['updateContent']({'parts':_0x4ff36d,'renderingStrategy':_0xfe5d5d,'abortSignal':_0x18026c});}['updateSuggestionPartState']({id:_0x2892db,index:_0x1951ba,state:_0x2222bc}){const _0x594e23=this['getItemById'](_0x2892db);if(!(_0x594e23 instanceof Cn))throw new ot('ai-chat-feed-view-item-not-a-suggestion-item',this,{'id':_0x2892db});_0x594e23['updatePartState'](_0x1951ba,_0x2222bc);}['setSuggestionPartActive']({id:_0x3a42bb,index:_0x1a6dae,isActive:_0x5f2140}){const _0x1253f6=this['getItemById'](_0x3a42bb);if(!(_0x1253f6 instanceof Cn))throw new ot('ai-chat-feed-view-item-not-a-suggestion-item',this,{'id':_0x3a42bb});this['children']['filter'](_0x35ebe9=>_0x35ebe9 instanceof Cn)['forEach'](_0x2811db=>{_0x2811db['setPartActive'](!0x1);}),_0x1253f6['setPartActive'](_0x1a6dae,_0x5f2140);}['markItemAsDone'](_0x18890d){this['getItemById'](_0x18890d)['markAsDone']();}['getItemIds'](){return this['children']['map'](_0x12fe6b=>_0x12fe6b['options']['id']);}['removeItem'](_0x47f6a6){this['children']['remove'](this['getItemById'](_0x47f6a6));}['hasItem'](_0x4aa75d){return!!this['children']['find'](_0x385263=>_0x385263['options']['id']['includes'](_0x4aa75d));}['scrollToSuggestion'](_0x1d0257,_0x1c9606){const _0x1d0748=this['getItemById'](_0x1d0257);if(!(_0x1d0748 instanceof Cn))return void It('ck-ai-chat-feed-view-scroll-to-suggestion-invalid-item',{'replyId':_0x1d0257,'partIndex':_0x1c9606});const _0x635de3=_0x1d0748['getPartView'](_0x1c9606);_0x635de3?wt(_0x635de3['element'],0x14,this['element']['parentElement'],!0x0,!0x0):It('ck-ai-chat-feed-view-scroll-to-suggestion-part-view-not-found',{'replyId':_0x1d0257,'partIndex':_0x1c9606});}['_setupTemplate'](){this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed']},'children':this['_createTemplateChildren']()});}['_createTemplateChildren'](){const _0x2f24bf=this['_createSkeletonLoader']();return[this['_createFeedItems'](),_0x2f24bf,this['_createFeedLoader']()];}['_createSkeletonLoader'](){const _0x500f55=new zn(this['locale'],jn['aiFeed']);return _0x500f55['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isLoadingSkeletonVisible','ck-hidden',_0x3a75d3=>!_0x3a75d3)]}}),_0x500f55;}['_createFeedItems'](){const _0x3c8c46=new Nt(this['locale']);return _0x3c8c46['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__items',this['bindTemplate']['if']('isLoadingSkeletonVisible','ck-hidden')]},'children':this['children']}),_0x3c8c46;}['_createFeedLoader'](){const _0x4a9064=new Nt(this['locale']);return _0x4a9064['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__loader',this['bindTemplate']['if']('isPending','ck-hidden',_0x835cb8=>!_0x835cb8)]},'children':this['_createLoaderChildren']()}),_0x4a9064;}['_createLoaderChildren'](){const _0x191397=new fn();return _0x191397['isVisible']=!0x0,[_0x191397,{'tag':'span','attributes':{'class':['ck','ck-ai-chat__loader-text']},'children':[{'text':this['bindTemplate']['to']('loadingMessage')}]}];}['getItemById'](_0x243c57){const _0x28e751=this['children']['find'](_0x1c574d=>_0x1c574d['options']['id']['includes'](_0x243c57));if(!_0x28e751)throw new ot('ai-chat-feed-view-item-not-found',this,{'id':_0x243c57});return _0x28e751;}['setLoadingMessage'](_0x4dbc7a){this['set']('loadingMessage',_0x4dbc7a);}['toggleLoadingSkeleton'](_0x5196c9){this['set']('isLoadingSkeletonVisible',_0x5196c9);}['startAutoScroll'](){this['scrollManager']['start']();}['stopAutoScroll'](){this['scrollManager']['stop']();}}class er extends Lt{['filter'](){let _0x2aaad7=0x0;for(const _0x3b01fc of this['items'])_0x2aaad7+=_0x3b01fc['items']['length'];return{'resultsCount':_0x2aaad7,'totalItemsCount':_0x2aaad7};}}const ir='ck-ai-chat__prompt-input_highlighted';class sr extends xt{['submitButtonView'];static ['MIN_ROWS']=0x1;static ['MAX_ROWS']=0xc;['_addContextButtonView'];['_queryViewResizeObserver'];constructor(_0x229028,_0x13053e){super(_0x229028,{'queryView':{'label':'','creator':Ut,'showIcon':!0x1,'showResetButton':!0x1},'filteredView':new er(_0x229028),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1}),this['set']('isEmpty',!0x0),this['set']('isUploadInProgress',!0x1),this['_addContextButtonView']=_0x13053e,this['_queryViewResizeObserver']=null,this['queryView']['fieldView']['minRows']=sr['MIN_ROWS'],this['queryView']['fieldView']['maxRows']=sr['MAX_ROWS'],this['queryView']['fieldWrapperChildren']['add'](this['_addContextButtonView']),this['_setUpAddContextButtonPositioning'](),this['extendTemplate']({'attributes':{'class':['ck','ck-ai-chat__prompt-input']}}),this['submitButtonView']=this['_createSubmitButton'](),this['submitButtonView']['bind']('isEnabled')['to'](this,'isEmpty',this,'isUploadInProgress',(_0x56326c,_0xc4b4e6)=>!_0x56326c&&!_0xc4b4e6),this['focusableChildren']['add'](this['submitButtonView']);}['render'](){super['render'](),this['queryView']['fieldWrapperChildren']['add'](this['submitButtonView']),this['keystrokes']['set']('enter',(_0x3e774b,_0x3d8f5f)=>{this['isUploadInProgress']||this['isEmpty']||_0x3e774b['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0x3d8f5f());}),this['queryView']['fieldView']['on']('update',()=>{this['isEmpty']=''===this['queryView']['fieldView']['element']['value']?.['trim']();});}['destroy'](){super['destroy'](),this['_queryViewResizeObserver']&&this['_queryViewResizeObserver']['destroy']();}['submit'](){const _0x1611b8=this['queryView']['fieldView']['element']['value']?.['trim']();if(!_0x1611b8)return this['queryView']['errorText']=as(this['locale'],'AI_CHAT_PROMPT_EMPTY_ERROR'),void(this['queryView']['fieldView']['hasError']=!0x0);this['queryView']['fieldView']['hasError']=!0x1;const _0x32b921=_0x2fa763(_0x1611b8);this['fire']('sendUserMessage',_0x32b921),this['queryView']['fieldView']['reset']();}['setPlaceholderText'](_0x325ac8){this['queryView']['fieldView']['set']('placeholder',_0x325ac8);}['focus'](_0x46cafa=!0x1){super['focus'](),_0x46cafa&&(this['element']['classList']['contains'](ir)||(this['element']['classList']['add'](ir),setTimeout(()=>{this['element']['classList']['remove'](ir);},0x320)));}['_createSubmitButton'](){const _0x246c37=new kt(this['locale']);return _0x246c37['set']({'icon':_0x37a21a,'label':as(this['locale'],'AI_CHAT_LABEL_SUBMIT'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-chat__prompt-submit-button\x20'+os,'isEnabled':!0x1}),_0x246c37['on']('execute',()=>{this['submit']();}),_0x246c37;}['setIsUploadInProgress'](_0xb79720){this['isUploadInProgress']=_0xb79720;}['_setUpAddContextButtonPositioning'](){const _0x4d381d=this['locale'],_0x5cb42f=()=>{ct['window']['requestAnimationFrame'](()=>{if(lt(this['element'])){const _0x6e0d6d=new ut(this['queryView']['fieldView']['element']),_0x1d2140=new ut(this['_addContextButtonView']['element']),_0x1245e5=_0x6e0d6d['width'],_0x2b1268='rtl'===_0x4d381d['uiLanguageDirection']?'right':'left';_0x6e0d6d['excludeScrollbarsAndBorders']();const _0x514b10=_0x1245e5-_0x6e0d6d['width']+0x1;this['_addContextButtonView']['element']['style'][_0x2b1268]='calc('+(_0x1245e5-_0x1d2140['width']-_0x514b10)+'px\x20-\x20var(--ck-spacing-tiny))';}});};this['queryView']['fieldView']['on']('update',_0x5cb42f),this['on']('render',()=>{_0x5cb42f(),this['_queryViewResizeObserver']=new ft(this['queryView']['fieldView']['element'],()=>{_0x5cb42f();});});}}const nr='ck-ai-chat__prompt-capabilities',rr='ck-ai-chat-controls-button',ar='ck-ai-chat-controls-button--commands',or='ck-ai-chat-controls__model-selection',hr='ck-ai-chat-controls__model-selection__item-name',cr='ck-ai-chat-controls__model-selection__item-description',lr='ck-ai-chat-controls__model-selection__item-capabilities',ur='n';class dr extends Nt{['_webSearchButton'];['_reasoningButton'];['_commandsButton'];['_modelSelectionDropdown'];['_modelSelectionDropdownItems'];['_modelNameView'];constructor(_0x4e606b){super(_0x4e606b),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',_0x51277d=>'selector'===_0x51277d),this['_modelSelectionDropdown']['buttonView']['bind']('tooltip')['to'](this,'modelSelectorEnabled',_0xc9c1b4=>_0xc9c1b4?this['_modelSelectionDropdown']['buttonView']['label']:as(this['locale'],'AI_CHAT_MODEL_SELECTOR_DISABLED_TOOLTIP')),this['_modelSelectionDropdown']['bind']('isEnabled')['to'](this,'modelSelectorEnabled',_0x6f8b3=>_0x6f8b3),this['_webSearchButton']['bind']('isOn')['to'](this,'webSearchActive',_0x1a40fb=>_0x1a40fb),this['_webSearchButton']['bind']('tooltip')['to'](this,'webSearchActive',_0x2a30f2=>as(this['locale'],_0x2a30f2?'AI_CHAT_DISABLE_WEB_SEARCH':'AI_CHAT_ENABLE_WEB_SEARCH')),this['_reasoningButton']['bind']('isOn')['to'](this,'reasoningActive',_0x4c4adf=>_0x4c4adf),this['_reasoningButton']['bind']('tooltip')['to'](this,'reasoningActive',_0x317c45=>as(this['locale'],_0x317c45?'AI_CHAT_DISABLE_REASONING':'AI_CHAT_ENABLE_REASONING')),this['setTemplate']({'tag':'div','attributes':{'class':[nr]},'children':[this['_modelSelectionDropdown'],this['_modelNameView'],this['_webSearchButton'],this['_reasoningButton'],this['_commandsButton']]}),this['_modelSelectionDropdownItems']=new dt(),zt(this['_modelSelectionDropdown'],this['_modelSelectionDropdownItems']);}['setModelList'](_0x300da1,_0x5b2962){if(_0x5b2962)this['set']('modelDisplayMode','hidden');else{const _0x2afac5=0x1===_0x300da1['length'];this['set']('modelDisplayMode',_0x2afac5?'name':'selector');}if(this['_modelSelectionDropdownItems']['clear'](),_0x300da1?.['length'])for(const _0x156f54 of _0x300da1){const _0xffea6d=new jt({'label':_0x156f54['name'],'withText':!0x0,'role':'menuitemradio','id':_0x156f54['id'],'model':_0x156f54});_0xffea6d['bind']('isOn')['to'](this,'activeModelId',_0xccf4bb=>_0xccf4bb===_0x156f54['id']),this['_modelSelectionDropdownItems']['add']({'type':'button','model':_0xffea6d,'labelView':new _r(this['locale'],_0x156f54)});}}['setWebSearch'](_0x3f97f5){this['set']('webSearchActive',_0x3f97f5);}['setReasoning'](_0x20b4ae){this['set']('reasoningActive',_0x20b4ae);}['setModel'](_0x5400c7){if(!_0x5400c7)return;this['activeModelId']=_0x5400c7['id'],this['activeModelName']=_0x5400c7['name']||_0x5400c7['id'],this['_modelSelectionDropdown']['buttonView']['set']('label',_0x5400c7['name']),this['_modelSelectionDropdown']['buttonView']['set']('tooltip',_0x5400c7['name']);const _0x5d2821=_0x5400c7['capabilities']['webSearch']?.['enabled']??!0x1;this['set']('webSearchActive',!0x1),this['_webSearchButton']['set']('isOn',!0x1),this['_webSearchButton']['set']('isEnabled',_0x5d2821),this['_webSearchButton']['set']('isVisible',_0x5d2821);const _0x28a9a0=_0x5400c7['capabilities']['reasoning']?.['enabled']??!0x1;this['set']('reasoningActive',!0x1),this['_reasoningButton']['set']('isOn',!0x1),this['_reasoningButton']['set']('isEnabled',_0x28a9a0),this['_reasoningButton']['set']('isVisible',_0x28a9a0);}['enableModelSelector'](){this['set']('modelSelectorEnabled',!0x0);}['disableModelSelector'](_0x2f6a67){this['set']('modelSelectorEnabled',!0x1),_0x2f6a67&&this['set']('modelDisplayMode','hidden');}['_createWebSearchButton'](){const _0x205a50=new kt();return _0x205a50['set']({'label':as(this['locale'],'AI_CHAT_SEARCH_WEB'),'icon':_0x596377,'class':rr+'\x20'+cs,'isToggleable':!0x0,'tooltipPosition':ur}),_0x205a50['on']('execute',()=>{this['fire']('toggleWebSearch');}),_0x205a50;}['_createReasoningButton'](){const _0x2e7f56=new kt();return _0x2e7f56['set']({'label':as(this['locale'],'AI_CHAT_REASONING'),'icon':_0x5e3239,'class':rr+'\x20'+cs,'isToggleable':!0x0,'tooltipPosition':ur}),_0x2e7f56['on']('execute',()=>{this['fire']('toggleReasoning');}),_0x2e7f56;}['_createCommandsButton'](){const _0x1f74a5=new kt();return _0x1f74a5['set']({'label':as(this['locale'],'AI_CHAT_COMMANDS'),'icon':_0x3f202d,'withText':!0x0,'class':rr+'\x20'+cs,'isToggleable':!0x0,'tooltip':as(this['locale'],'AI_CHAT_COMMANDS'),'tooltipPosition':ur}),_0x1f74a5['extendTemplate']({'attributes':{'class':[ar]}}),_0x1f74a5['on']('execute',()=>{console['log']('Commands\x20are\x20not\x20implemented\x20yet.'),alert('Commands\x20are\x20not\x20implemented\x20yet.');}),_0x1f74a5;}['_createModelSelectionDropdown'](){const _0x13ed40=Bt(this['locale']);return _0x13ed40['set']({'panelPosition':'ne','class':[or]}),_0x13ed40['buttonView']['set']({'label':as(this['locale'],'AI_CHAT_MODEL_SELECTOR_ENABLED_TOOLTIP'),'withText':!0x0,'tooltip':!0x0,'tooltipPosition':ur,'class':cs}),this['listenTo'](_0x13ed40,'execute',_0x348db2=>{this['fire']('selectModel',_0x348db2['source']['model']);}),_0x13ed40;}['_createModelNameView'](){const _0x368232=new Ar(this['locale']);return _0x368232['bind']('text')['to'](this,'activeModelName',_0x5c02c3=>_0x5c02c3??''),_0x368232['bind']('isVisible')['to'](this,'modelDisplayMode',_0x21ab94=>'name'===_0x21ab94),_0x368232;}}let _r=class extends Ht{constructor(_0x30a1e6,_0x38857d){super();const _0x3f168b=this['bindTemplate'],_0x2dced3=this['createCollection']();this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-button__label'],'style':_0x3f168b['to']('style'),'id':_0x3f168b['to']('id')},'children':[{'tag':'div','attributes':{'class':[hr]},'children':[{'text':_0x3f168b['to']('text')}]},{'tag':'div','attributes':{'class':[cr]},'children':[{'tag':'span','children':[{'text':_0x38857d['description']}]}]},{'tag':'div','attributes':{'class':[lr]},'children':_0x2dced3}]}),_0x2dced3['addMany'](this['_getCapabilityParts'](_0x30a1e6,_0x596377,'AI_CHAT_SEARCH_WEB',_0x38857d['capabilities']['webSearch']?.['enabled']??!0x1)),_0x2dced3['addMany'](this['_getCapabilityParts'](_0x30a1e6,_0x5e3239,'AI_CHAT_REASONING',_0x38857d['capabilities']['reasoning']?.['enabled']??!0x1));}['_getCapabilityParts'](_0x55d6fc,_0x2d204e,_0x1babf6,_0x28bcaf){const _0x3f645a=new yt();_0x3f645a['content']=_0x2d204e;const _0x1ae47b=new Nt(_0x55d6fc);_0x1ae47b['setTemplate']({'tag':'span','children':[{'text':as(_0x55d6fc,_0x1babf6)+':\x20'}]});const _0x18502f=new Nt(_0x55d6fc);return _0x18502f['setTemplate']({'tag':'span','children':[{'text':as(_0x55d6fc,_0x28bcaf?'AI_CHAT_CAPABILITIES_YES':'AI_CHAT_CAPABILITIES_NO')}]}),[_0x3f645a,_0x1ae47b,_0x18502f];}},Ar=class extends Nt{constructor(_0xb3f3f8){super(_0xb3f3f8),this['set']('text',void 0x0),this['set']('isVisible',!0x0);const _0x3f3a84=this['bindTemplate'];this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-chat-controls__model-name',_0x3f3a84['if']('isVisible','ck-hidden',_0x41d605=>!_0x41d605)]},'children':[{'text':_0x3f3a84['to']('text')}]});}};const gr='ck-ai-chat-context-controls__url-form',Ir='ck-ai-chat-context-controls__url-input-section';class Er extends Nt{['focusTracker'];['keystrokes'];['_focusables'];['focusCycler'];['urlInputField'];['backButton'];['confirmButton'];constructor(_0x33c64a){super(_0x33c64a),this['focusTracker']=new _t(),this['keystrokes']=new At(),this['backButton']=this['_createBackButton'](),this['urlInputField']=this['_createUrlInputField'](),this['confirmButton']=this['_createConfirmButton'](),this['_focusables']=this['createCollection']([this['backButton'],this['urlInputField'],this['confirmButton']]),this['focusCycler']=new Mt({'focusables':this['_focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes'],'actions':{'focusPrevious':'shift+tab','focusNext':'tab'}}),this['set']('withBackButton',!0x0),this['_setupTemplate'](),this['_setupEventHandlers'](),this['_setupKeystrokes']();}['render'](){super['render'](),this['_focusables']['forEach'](_0x2af4d6=>{this['focusTracker']['add'](_0x2af4d6['element']),this['keystrokes']['listenTo'](_0x2af4d6['element']);}),Jt({'view':this}),this['focus']();}['destroy'](){super['destroy'](),this['focusTracker']['destroy'](),this['keystrokes']['destroy']();}['focus'](){this['urlInputField']['focus']();}['getValue'](){return this['urlInputField']['fieldView']['element']?.['value']?.['trim']()||'';}['clear'](){this['urlInputField']['fieldView']['element']['value']='',this['urlInputField']['errorText']=null,this['confirmButton']['isEnabled']=!0x1;}['setError'](_0x24e11a){this['urlInputField']['errorText']=_0x24e11a,this['_updateConfirmButtonState'](),this['fire']('refreshBalloon');}['clearError'](){this['urlInputField']['errorText']=null,this['_updateConfirmButtonState']();}['_createBackButton'](){const _0x4c53e7=new kt(this['locale']);return _0x4c53e7['set']({'icon':_0xb3d9b4,'tooltip':as(this['locale'],'AI_CHAT_CONTEXT_URL_BACK_TO_CONTEXT'),'tooltipPosition':'n','class':['ck-button-icon\x20ck-button-back']}),this['on']('change:withBackButton',(_0x44dba2,_0x27a0c6,_0x4048d9)=>{_0x4c53e7['set']({'class':['ck-button-icon\x20ck-button-back'+(_0x4048d9?'':'\x20ck-hidden')]});}),_0x4c53e7;}['_createUrlInputField'](){const _0x4365e7=new Zt(this['locale'],te);return _0x4365e7['set']({'label':as(this['locale'],'AI_CHAT_CONTEXT_URL_LABEL'),'class':'ck-labeled-field-view_empty'}),_0x4365e7['fieldView']['set']({'placeholder':as(this['locale'],'AI_CHAT_CONTEXT_URL_PLACEHOLDER')}),_0x4365e7;}['_createConfirmButton'](){const _0x46047d=new kt(this['locale']);return _0x46047d['set']({'icon':_0x253f15,'tooltip':as(this['locale'],'AI_CHAT_CONTEXT_URL_ADD_URL'),'tooltipPosition':'n','class':'ck-button-icon','type':'submit','isEnabled':!0x1}),_0x46047d;}['_setupTemplate'](){const _0x10e0f7=new _0x3b6a7d(this['locale'],{'label':as(this['locale'],'AI_CHAT_CONTEXT_URL_ADD_URL'),'class':'ck-ai-header\x20ck-ai-header_small\x20ck-ai-header_context-url'});_0x10e0f7['children']['add'](this['backButton'],0x0),this['setTemplate']({'tag':'form','attributes':{'class':gr,'tabindex':'-1'},'children':[_0x10e0f7,{'tag':'div','attributes':{'class':Ir},'children':[this['urlInputField'],this['confirmButton']]}]});}['_setupEventHandlers'](){this['backButton']['on']('execute',()=>{this['clear'](),this['fire']('cancel');}),this['urlInputField']['fieldView']['on']('input',()=>{this['clearError'](),this['_updateConfirmButtonState'](),this['fire']('refreshBalloon');}),this['on']('submit',_0x1ab00a=>{_0x1ab00a['stop'](),this['_handleSubmit']();});}['_setupKeystrokes'](){this['keystrokes']['set']('esc',(_0x3ab1a6,_0x505141)=>{this['clear'](),this['fire']('cancel'),_0x505141();});}['_handleSubmit'](){const _0x3a2469=this['getValue']()['trim']();_0x3a2469?this['_isValidUrl'](_0x3a2469)?(this['clearError'](),this['fire']('submitUrl',_0x3a2469)):this['setError'](as(this['locale'],'AI_CHAT_CONTEXT_URL_INVALID_ERROR')):this['setError'](as(this['locale'],'AI_CHAT_CONTEXT_URL_EMPTY_ERROR'));}['_updateConfirmButtonState'](){const _0x217877=this['getValue']()['trim'](),_0x3e1731=!!this['urlInputField']['errorText'];this['confirmButton']['isEnabled']=_0x217877['length']>0x0&&!_0x3e1731;}['_isValidUrl'](_0x4653d2){try{return!!new URL(_0x4653d2);}catch{return!0x1;}}}const Tr='ck-ai-chat-resources__item',pr='ck-ai-chat-resources__item--in-context',mr='ck-ai-chat-resources__item-title',Cr='ck-ai-chat-resources__item__icon';class wr extends Pt{['resource'];['_titleView'];['_iconView'];constructor(_0x495a20,_0x3ea4c9){super(_0x495a20),this['resource']=_0x3ea4c9,this['set']('isInContext',!!_0x3ea4c9['isInContext']),this['_titleView']=this['_createTitleView'](),this['_iconView']=this['_createIconView'](),this['_setupTemplate']();}['render'](){super['render']();}['getResourceIcon'](_0x54101){if(_0x54101['isInContext'])return _0x253f15;switch(_0x54101['type']){case'document':return _0xaaa825;case'web-resource':return _0x8ee664;case'file':case'text':return _0x5e55fc;default:return _0x33f88b;}}['highlightText'](_0x5bf165){if(!_0x5bf165||''===_0x5bf165['trim']())return void this['_titleView']['highlightText'](null);const _0x5d77c8=new RegExp(_0xe514b6(_0x5bf165),'gi');this['_titleView']['highlightText'](_0x5d77c8);}['updateResourceState'](_0x629226){this['resource']['isInContext']=_0x629226,this['isInContext']=_0x629226,this['_updateIcon']();}['_createTitleView'](){const _0x544e83=new _0x51d6a3();return _0x544e83['text']=this['resource']['label'],_0x544e83['extendTemplate']({'tag':'span','attributes':{'class':[mr]}}),_0x544e83;}['_createIconView'](){const _0x38450d=new yt();return _0x38450d['content']=this['getResourceIcon'](this['resource']),_0x38450d;}['_setupTemplate'](){const _0x5f4455=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':[Tr,_0x5f4455['if']('isVisible','ck-hidden',_0x315af1=>!_0x315af1),_0x5f4455['if']('isInContext',pr)]},'children':[{'tag':'div','attributes':{'class':[Cr]},'children':[this['_iconView']]},this['_titleView']],'on':{'click':_0x5f4455['to']('execute')}});}['_updateIcon'](){this['_iconView']['content']=this['getResourceIcon'](this['resource']);}}const fr='ck-ai-chat-resources__list';class Sr extends Lt{['_source'];constructor(_0x53d74d,_0x5178af){super(_0x53d74d),this['_source']=_0x5178af,this['extendTemplate']({'attributes':{'class':[fr]}});}['setResources'](_0x2aef0c,_0x525697){this['items']['clear']();let _0x5f47a7=_0x2aef0c;if(this['_source']['useDefaultFiltering']&&_0x525697&&''!==_0x525697['trim']()){const _0x5a3da4=new RegExp(_0x525697['replace'](/[.*+?^${}()|[\]\\]/g,'\x5c$&'),'gi');_0x5f47a7=_0x2aef0c['filter'](_0x3f0498=>_0x5a3da4['test'](_0x3f0498['label']));}for(const _0x396490 of _0x5f47a7){const _0x56ee35=new wr(this['locale'],_0x396490);_0x56ee35['on']('execute',()=>{this['_handleResourceSelection'](this['_source'],_0x396490);}),this['items']['add'](_0x56ee35);}this['_source']['useDefaultFiltering']&&this['highlightText'](_0x525697);}['highlightText'](_0x152b0c){this['_source']['useDefaultFiltering']&&this['items']['forEach'](_0x1e10b4=>{_0x1e10b4['highlightText'](_0x152b0c);});}['updateResourceState'](_0x4e653b,_0x327156){for(const _0x5f527d of this['items']){const _0x4f70e1=_0x5f527d;_0x4f70e1['resource']['id']===_0x4e653b&&_0x4f70e1['updateResourceState'](_0x327156);}}['_handleResourceSelection'](_0xce5756,_0x20a0f9){this['fire']('addResourceToContext',{'source':_0xce5756,'resource':_0x20a0f9});}}class br extends Zt{['iconView'];['resetButtonView'];['_viewConfig'];constructor(_0x5e2697){const t=_0x5e2697['t'],_0x577b4f={'showResetButton':!0x0,'showIcon':!0x0,'creator':te,'label':as(_0x5e2697,'AI_CHAT_SEARCH_RESOURCES')};super(_0x5e2697,_0x577b4f['creator']),this['label']=_0x577b4f['label'],this['_viewConfig']=_0x577b4f,this['_viewConfig']['showIcon']&&this['_setupSearchIcon'](),this['_viewConfig']['showResetButton']&&this['_setupResetButton'](_0x5e2697,t),this['_setupEventListeners']();}['reset'](){this['fieldView']['reset'](),this['_viewConfig']['showResetButton']&&this['resetButtonView']&&(this['resetButtonView']['isVisible']=!0x1),this['search']('');}['search'](_0x4815bd){this['fire']('search',_0x4815bd);}['getQuery'](){return this['fieldView']['element']?.['value']||'';}['_setupSearchIcon'](){this['iconView']=new yt(),this['iconView']['content']=_0x199a84,this['fieldWrapperChildren']['add'](this['iconView'],0x0),this['extendTemplate']({'attributes':{'class':'ck-search__query_with-icon'}});}['_setupResetButton'](_0x54167b,t){this['resetButtonView']=new kt(_0x54167b),this['resetButtonView']['set']({'label':t('Clear'),'icon':_0x6494e0,'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',_0x40f5a0=>!_0x40f5a0),this['fieldWrapperChildren']['add'](this['resetButtonView']),this['extendTemplate']({'attributes':{'class':'ck-search__query_with-reset'}});}['_setupEventListeners'](){this['listenTo'](this['fieldView'],'input',()=>{this['search'](this['fieldView']['element']['value']);}),this['bind']('isEnabled')['to'](this);}}class Rr extends Nt{['_searchView'];['_searchSection'];['_searchInputVisibleFrom'];['_resourcesListView'];['_skeletonLoader'];['_source'];['children'];['_latestLoadResourcesUid']=null;constructor(_0x1c1fc9,_0x1d9529){super(_0x1c1fc9),this['_source']=_0x1d9529['source'],this['_searchInputVisibleFrom']=_0x1d9529['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 _0x5ba55d([this['_skeletonLoader'],this['_resourcesListView']]),this['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-chat-resources'},'children':this['children']});}['_createSearchView'](){return new br(this['locale']);}['_createSearchSection'](){const _0x3d286a=new Nt(this['locale']);return _0x3d286a['setTemplate']({'tag':'div','attributes':{'class':'ck\x20ck-search'},'children':[this['_searchView']]}),this['_searchView']['on']('search',(_0x38697e,_0x1cf3a3)=>{this['loadResources'](_0x1cf3a3),this['_source']['useDefaultFiltering']&&this['_resourcesListView']['highlightText'](_0x1cf3a3);}),_0x3d286a;}['_createResourcesListView'](){const _0x1d95e4=new Sr(this['locale'],this['_source']);return _0x1d95e4['delegate']('addResourceToContext')['to'](this),_0x1d95e4['extendTemplate']({'attributes':{'class':this['bindTemplate']['if']('isLoading','ck-hidden')}}),_0x1d95e4;}['_createSkeletonView'](){const _0x4e3129=new zn(this['locale'],jn['aiChatResources']);return _0x4e3129['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isLoading','ck-hidden',_0x529468=>!_0x529468)]}}),_0x4e3129;}['render'](){super['render'](),this['loadResources']('');}['loadResources'](_0x1f65f7){const _0x2509f5=at();this['_latestLoadResourcesUid']=_0x2509f5,this['fire']('loadSourceResources',{'sourceId':this['_source']['id'],'query':_0x1f65f7,'uid':_0x2509f5}),this['isLoading']=!0x0;}['setResources'](_0x1fd15f,_0x1d4fb0){if(_0x1d4fb0&&_0x1d4fb0!==this['_latestLoadResourcesUid'])return;const _0x763595=this['_source']['useDefaultFiltering']?this['_searchView']['getQuery']():'';this['_resourcesListView']['setResources'](_0x1fd15f,_0x763595),_0x1fd15f['length']>=this['_searchInputVisibleFrom']&&!this['children']['has'](this['_searchSection'])&&this['children']['add'](this['_searchSection'],0x0),requestAnimationFrame(()=>{this['isLoading']=!0x1;});}['updateResourceState'](_0x169515,_0x4e0720){this['_resourcesListView']['updateResourceState'](_0x169515,_0x4e0720);}}const Or='ck-ai-chat-context-controls__source-balloon-panel',kr='ck-button-icon\x20ck-button-back',Nr='ck-ai-header\x20ck-ai-header_small\x20ck-ai-header_source';class vr{['_sourceResourceBalloons']=new Map();['_bodyCollection'];['_locale'];['_config'];constructor(_0x988119,_0x4f37c4,_0x4cba2b){this['_locale']=_0x988119,this['_bodyCollection']=_0x4f37c4,this['_config']=_0x4cba2b;}['showSourceResourcesBalloon']({source:_0x159a88,withBackButton:_0x16cd26}){let _0x14989c=this['_sourceResourceBalloons']['get'](_0x159a88['id']);_0x14989c||(_0x14989c=this['_createSourceResourceBalloonPanel'](),this['_sourceResourceBalloons']['set'](_0x159a88['id'],_0x14989c),this['_setupSingleResourceBalloonClickOutsideHandler'](_0x14989c)),this['_addSourceResourceContent']({'balloonPanel':_0x14989c,'source':_0x159a88,'withBackButton':_0x16cd26}),_0x14989c['show']();const _0x4eee62=this['_config']['getTargetElement']();_0x4eee62&&_0x14989c['pin']({'target':_0x4eee62,'limiter':this['_config']['getLimiterElement']()});}['populateSourceResourceBalloon'](_0x33d572,_0x40bde8,_0x2d2d45){const _0x5b70a8=this['_sourceResourceBalloons']['get'](_0x33d572);if(!_0x5b70a8)return;const _0x142c3d=this['_getResourcesViewFromBalloon'](_0x5b70a8);_0x142c3d&&(_0x142c3d['setResources'](_0x40bde8,_0x2d2d45),_0x142c3d['once']('change:isLoading',()=>{_0x5b70a8['pin']({'target':this['_config']['getTargetElement'](),'limiter':this['_config']['getLimiterElement']()});}));}['closeSourceResourceBalloon'](_0x5af918){const _0x24529b=this['_sourceResourceBalloons']['get'](_0x5af918);_0x24529b&&requestAnimationFrame(()=>{_0x24529b['hide'](),this['_sourceResourceBalloons']['delete'](_0x5af918),this['_config']['onBalloonClosed']();});}['isAnyResourceBalloonVisible'](){for(const _0x9923dd of this['_sourceResourceBalloons']['values']())if(_0x9923dd['isVisible'])return!0x0;return!0x1;}['updateResourceState'](_0x2a2b90,_0x3bff2f,_0x1e1632){const _0xf14ba3=this['_sourceResourceBalloons']['get'](_0x2a2b90);if(!_0xf14ba3||!_0xf14ba3['isVisible'])return;const _0x4e6046=this['_config']['getTargetElement']();if(!_0x4e6046)return;_0xf14ba3['pin']({'target':_0x4e6046,'limiter':this['_config']['getLimiterElement']()});const _0x54bdb6=this['_getResourcesViewFromBalloon'](_0xf14ba3);_0x54bdb6&&_0x54bdb6['updateResourceState'](_0x3bff2f,_0x1e1632);}['destroy'](){for(const _0x5d1825 of this['_sourceResourceBalloons']['values']())_0x5d1825['destroy']();this['_sourceResourceBalloons']['clear']();}['_createSourceResourceBalloonPanel'](){const _0x54a461=new Qt(this['_locale']);return _0x54a461['extendTemplate']({'attributes':{'class':Or}}),this['_bodyCollection']['add'](_0x54a461),_0x54a461;}['_addSourceResourceContent']({balloonPanel:_0x59ff5e,source:_0x481a33,withBackButton:_0x3feedb}){_0x59ff5e['content']['clear']();const _0xe120d5=this['_createBalloonHeader']({'balloonPanel':_0x59ff5e,'source':_0x481a33,'withBackButton':_0x3feedb});_0x59ff5e['content']['add'](_0xe120d5);const _0x3120f6=this['_createBalloonResourcesView'](_0x481a33);_0x59ff5e['content']['add'](_0x3120f6);}['_createBalloonHeader']({balloonPanel:_0x4ab8bb,source:_0xed2617,withBackButton:_0x3f5bad}){const _0x2d25c9=new _0x3b6a7d(this['_locale'],{'label':_0xed2617['label'],'class':Nr});return _0x3f5bad&&_0x2d25c9['children']['add'](this['_createBackButton'](_0x4ab8bb),0x0),_0x2d25c9;}['_createBackButton'](_0x4906e7){const _0x4b5d0a=new kt(this['_locale']);return _0x4b5d0a['set']({'icon':_0xb3d9b4,'tooltip':as(this['_locale'],'AI_CHAT_CONTEXT_URL_BACK_TO_CONTEXT'),'tooltipPosition':'n','class':kr}),_0x4b5d0a['on']('execute',()=>{_0x4906e7['hide'](),this['_config']['onBackToContext']();}),_0x4b5d0a;}['_createBalloonResourcesView'](_0x2cb9cd){const _0x39d205=new Rr(this['_locale'],{'source':_0x2cb9cd,'searchInputVisibleFrom':this['_config']['searchInputVisibleFrom']});return _0x39d205['on']('loadSourceResources',(_0x1de825,_0x586eb2)=>{this['_config']['onLoadSourceResources'](_0x586eb2);}),_0x39d205['on']('addResourceToContext',(_0x2c8216,_0x2d1831)=>{this['_config']['onResourceSelected'](_0x2d1831['source'],_0x2d1831['resource']),this['closeSourceResourceBalloon'](_0x2cb9cd['id']);}),_0x39d205;}['_getResourcesViewFromBalloon'](_0xe821fe){const _0x26e6e9=_0xe821fe['content']['get'](0x1);return _0x26e6e9 instanceof Rr?_0x26e6e9:null;}['_setupSingleResourceBalloonClickOutsideHandler'](_0x25e61d){Xt({'emitter':_0x25e61d,'contextElements':[_0x25e61d['element']],'callback':()=>{_0x25e61d['hide'](),this['_config']['onBalloonClosed']();},'activator':()=>_0x25e61d['isVisible']});}}const yr=['addDocumentToContext','addFileToContext','addUrlToContext','addResourceToContext','removeContextItem','loadSourceResources','executeCustomItemCallback'],xr='ck-ai-chat-context-controls',Lr='ck-ai-chat-context-controls__pending-contexts',Dr='ck-ai-chat-context-controls__add-context-balloon-panel',Pr='ck-ai-chat-context-controls__add-context-button',Hr='ck-ai-chat-context-controls__url-balloon-panel',Mr='ck-ai-chat-context-controls__balloon-button',Ur='ck-ai-chat-context-controls__balloon-button-source',Vr='ck-ai-chat-controls-button',Br='ck-ai-chat-context-chips-wrapper-balloon',Gr='ck-ai-chat-controls_context_show-more-button',Fr='ck-ai-chat-context-controls__show-more-balloon-panel',Kr='ck-ai-chat',Wr=[Qt['defaultPositions']['northArrowSouthWest'],Qt['defaultPositions']['northArrowSouth'],Qt['defaultPositions']['northArrowSouthEast'],Qt['defaultPositions']['southArrowNorthWest'],Qt['defaultPositions']['southArrowNorth'],Qt['defaultPositions']['southArrowNorthEast']];class Yr extends Nt{['addContextButtonView'];['_currentContextsChips']=this['createCollection']();['_conversationContextsChips']=this['createCollection']();['_overflowManager'];['_addContextBalloonPanelView'];['_urlBalloonPanelView'];['_urlInputView'];['_resourcesBalloonView'];['_addContextBalloonConfig'];['_hasExactlyOneSource']=!0x1;['bodyCollection'];constructor(_0x1b5213,_0x4ff5b1){super(_0x1b5213),this['bodyCollection']=_0x4ff5b1['bodyCollection'],this['_currentContextsChips']=this['createCollection'](),this['_conversationContextsChips']=this['createCollection'](),this['addContextButtonView']=this['_createAddContextButtonView'](_0x1b5213),this['_addContextBalloonPanelView']=this['_createAddContextBalloonPanelView'](_0x1b5213),this['_urlBalloonPanelView']=this['_createUrlBalloonPanelView'](_0x1b5213),this['_resourcesBalloonView']=this['_createResourcesBalloonView'](_0x1b5213,_0x4ff5b1);const _0x4f5209={'cssClasses':{'showMoreButton':Gr+'\x20'+cs,'showMoreBalloon':Fr,'overflowContainer':Br,'controlsButton':Vr}};this['_overflowManager']=new Hn(_0x1b5213,this['_currentContextsChips'],_0x4f5209,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'](_0x3e3ac5,_0x3b9fcc){const _0x1e94d3=this['_createContextButton'](_0x3e3ac5,'current',!0x0,_0x3b9fcc);this['_addContextToCollection'](_0x1e94d3,this['_currentContextsChips']),this['_overflowManager']['reorganizeChips']();}['removeContextItem'](_0x4a0ab5){this['_removeContextFromCollection'](_0x4a0ab5,this['_currentContextsChips']),this['_removeContextFromCollection'](_0x4a0ab5,this['_overflowManager']['overflowChips']),this['_overflowManager']['reorganizeChips']();}['setContextItemLoading'](_0x119095,_0x2f6abf){let _0x4d38d9=this['_currentContextsChips']['find'](_0x289bcd=>_0x289bcd['id']===_0x119095);_0x4d38d9||(_0x4d38d9=this['_overflowManager']['overflowChips']['find'](_0x447c68=>_0x447c68['id']===_0x119095)),_0x4d38d9&&(_0x4d38d9['isLoading']=_0x2f6abf);}['setConversationContext'](_0x44e176){this['_conversationContextsChips']['clear']();for(const _0x38c2e2 of _0x44e176){const _0xae3150=this['_createContextButton'](_0x38c2e2,'conversation',!0x1,!0x1);this['_addContextToCollection'](_0xae3150,this['_conversationContextsChips']);}}['clearCurrentContextItems'](){this['_currentContextsChips']['clear'](),this['_overflowManager']['clear']();}['clearConversationContextItems'](){this['_conversationContextsChips']['clear']();}['updateResourceState'](_0x290992,_0x36dd49,_0x5ebc18){this['_resourcesBalloonView']['updateResourceState'](_0x290992,_0x36dd49,_0x5ebc18);}['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:_0x53b329,withBackButton:_0x2844ab}){this['_resourcesBalloonView']['showSourceResourcesBalloon']({'source':_0x53b329,'withBackButton':_0x2844ab}),this['addContextButtonView']['isOn']=!0x0;}['populateSourceResourceBalloon'](_0x417659,_0x28a0c8,_0x2bcb1b,_0x238570){this['_resourcesBalloonView']['populateSourceResourceBalloon'](_0x417659,_0x2bcb1b,_0x238570);}['closeSourceResourceBalloon'](_0xfde861){this['_resourcesBalloonView']['closeSourceResourceBalloon'](_0xfde861),this['addContextButtonView']['isOn']=!0x1;}['setAddContextOptions'](_0x3e2b33){this['_setBalloonPanelContent'](this['_addContextBalloonPanelView'],this['locale'],_0x3e2b33),this['_setAddContextButtonEnabled'](_0x3e2b33);}['_setAddContextButtonEnabled'](_0xac07a5){const _0x1f1b13=!_0xac07a5['document']['isHidden']&&_0xac07a5['document']['enabled'],_0x276293=_0xac07a5['urls']['enabled'],_0x2c81c3=_0xac07a5['files']['enabled'],_0x302222=_0xac07a5['sources']['length']>0x0,_0x5f3134=_0xac07a5['customItems']&&_0xac07a5['customItems']['length']>0x0;this['addContextButtonView']['isEnabled']=_0x1f1b13||_0x276293||_0x2c81c3||_0x302222||_0x5f3134;}['_setupTemplate'](){this['setTemplate']({'tag':'div','attributes':{'class':[xr,'ck-reset_all-excluded']},'children':[{'tag':'div','attributes':{'class':Lr},'children':this['_currentContextsChips']}]});}['_bindEventHandlers'](){this['addContextButtonView']['on']('execute',()=>{this['_handleAddContextButtonClick']();});}['_createAddContextButtonView'](_0x5627ae){const _0x3afaa6=new kt(_0x5627ae);return _0x3afaa6['set']({'label':as(_0x5627ae,'AI_CHAT_CONTEXT_ADD_CONTEXT'),'class':Vr+'\x20'+Pr+'\x20'+cs,'icon':_0x2e44b6,'isToggleable':!0x0,'tooltip':!0x0,'tooltipPosition':'sw'}),_0x3afaa6;}['_createAddContextBalloonPanelView'](_0x8080d9){return this['_createBaseBalloonPanel'](_0x8080d9,Dr);}['_createUrlBalloonPanelView'](_0x213227){const _0x261d34=this['_createBaseBalloonPanel'](_0x213227,Hr);return this['_addUrlContent'](_0x261d34,_0x213227),_0x261d34;}['_createResourcesBalloonView'](_0x433f65,_0x1cb54a){const _0x3775fc={'searchInputVisibleFrom':_0x1cb54a['searchInputVisibleFrom'],'onBackToContext':()=>{this['showAddContextBalloonPanel'](),this['_addContextBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':Wr});},'onResourceSelected':(_0x1d206c,_0x17a0b8)=>{this['fire']('addResourceToContext',{'source':_0x1d206c,'resource':_0x17a0b8});},'onLoadSourceResources':_0x130151=>{this['fire']('loadSourceResources',_0x130151);},'onBalloonClosed':()=>{this['addContextButtonView']['isOn']=!0x1;},'getLimiterElement':()=>this['_getLimiterElement'](),'getTargetElement':()=>this['addContextButtonView']['element']};return new vr(_0x433f65,_0x1cb54a['bodyCollection'],_0x3775fc);}['_getLimiterElement'](){return this['element']?.['closest']('.'+Kr)||document['body'];}['_createBaseBalloonPanel'](_0x575117,_0x5e2f63){const _0x56f93b=new Qt(_0x575117);return _0x56f93b['extendTemplate']({'attributes':{'class':_0x5e2f63}}),this['bodyCollection']['add'](_0x56f93b),_0x56f93b;}['_setBalloonPanelContent'](_0x13d4c2,_0xdf30bb,_0xaaa459){if(_0x13d4c2['content']['clear'](),!_0xaaa459['document']['isHidden']&&_0xaaa459['document']['enabled']){const _0xf6961e=this['_createBalloonButton'](_0xdf30bb,{'label':as(_0xdf30bb,'AI_CHAT_CONTEXT_CURRENT_DOCUMENT'),'icon':_0xaaa825});_0xf6961e['on']('execute',()=>{this['fire']('addDocumentToContext'),this['hideAddContextBalloonPanel']();}),_0x13d4c2['content']['add'](_0xf6961e);}if(_0xaaa459['urls']['enabled']){const _0x4f5c11=this['_createBalloonButton'](_0xdf30bb,{'label':as(_0xdf30bb,'AI_CHAT_CONTEXT_URL_LABEL'),'icon':_0x8ee664});_0x4f5c11['on']('execute',()=>{this['hideAddContextBalloonPanel'](),this['showUrlBalloonPanel'](),this['_urlBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':Wr}),this['_urlInputView']['focus']();}),_0x13d4c2['content']['add'](_0x4f5c11);}if(_0xaaa459['files']['enabled']){const _0x4e8fb9=new _0x384b8e(_0xdf30bb);_0x4e8fb9['set']({'label':as(_0xdf30bb,'AI_CHAT_CONTEXT_FILE_LABEL'),'icon':_0x780de3,'withText':!0x0,'tooltip':!0x0,'class':Mr,'allowMultipleFiles':!0x0}),_0x4e8fb9['on']('execute',()=>{this['hideAddContextBalloonPanel']();}),_0x4e8fb9['on']('done',(_0x445805,_0x5001df)=>{this['fire']('addFileToContext',_0x5001df);}),_0x4e8fb9['tooltip']=!0x0,_0x13d4c2['content']['add'](_0x4e8fb9);}for(const _0x5ce773 of _0xaaa459['sources']){const _0x424bf3=this['_createBalloonButton'](_0xdf30bb,{'label':_0x5ce773['label'],'icon':_0x5ce773['icon']||_0x33f88b,'type':'source'});_0x13d4c2['content']['add'](_0x424bf3),_0x424bf3['on']('execute',()=>{this['hideAddContextBalloonPanel'](),this['_showSourceResourcesBalloon']({'source':_0x5ce773,'withBackButton':!this['_hasExactlyOneSource']});});}for(const _0x4cf7f3 of _0xaaa459['customItems']||[]){const _0x5a60a8=this['_createBalloonButton'](_0xdf30bb,{'label':_0x4cf7f3['label'],'icon':_0x4cf7f3['icon']||_0x33f88b,'type':'customItem'});_0x13d4c2['content']['add'](_0x5a60a8),_0x5a60a8['on']('execute',()=>{this['hideAddContextBalloonPanel'](),this['fire']('executeCustomItemCallback',_0x4cf7f3);});}this['_hasExactlyOneSource']=0x1===_0x13d4c2['content']['length'],this['_urlInputView']['withBackButton']=!this['_hasExactlyOneSource'];}['_addUrlContent'](_0x3b2630,_0x4608ce){this['_urlInputView']=new Er(_0x4608ce),this['_urlInputView']['on']('submitUrl',(_0x4b4264,_0x585177)=>{this['_handleUrlSubmit'](_0x585177);}),this['_urlInputView']['on']('cancel',()=>{this['hideUrlBalloonPanel'](),this['_hasExactlyOneSource']||(this['showAddContextBalloonPanel'](),this['_addContextBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':Wr}));}),this['_urlInputView']['on']('refreshBalloon',()=>{this['_urlBalloonPanelView']['isVisible']&&this['_urlBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':Wr});}),_0x3b2630['content']['add'](this['_urlInputView']);}['_createBalloonButton'](_0xc06f53,_0x523dd9){const _0x417aaf='source'===_0x523dd9['type']?new $r(_0xc06f53):new kt(_0xc06f53);return _0x417aaf['set']({'label':_0x523dd9['label'],'icon':_0x523dd9['icon'],'withText':!0x0,'tooltip':!0x0,'tooltipPosition':'sw','class':Mr}),_0x417aaf;}['_setupAllBalloonClickOutsideHandlers'](){this['_setupAddContextBalloonClickOutsideHandler'](),this['_setupUrlBalloonClickOutsideHandler']();}['_setupUrlBalloonClickOutsideHandler'](){Xt({'emitter':this['_urlBalloonPanelView'],'contextElements':[this['_urlBalloonPanelView']['element']],'callback':()=>{this['hideUrlBalloonPanel']();},'activator':()=>this['_urlBalloonPanelView']['isVisible']});}['_toggleAddContextBalloon'](_0x38f60f){const _0x1ccbbb=this['_addContextBalloonConfig'];_0x1ccbbb['buttonView']['isOn']=_0x38f60f,_0x38f60f?_0x1ccbbb['balloonView']['show']():_0x1ccbbb['balloonView']['hide']();}['_setupAddContextBalloonClickOutsideHandler'](){const {balloonView:_0x4811a0,buttonView:_0x57ed48,hideMethod:_0x2bb85d}=this['_addContextBalloonConfig'];Xt({'emitter':_0x4811a0,'contextElements':[_0x4811a0['element'],_0x57ed48['element']],'callback':()=>{_0x2bb85d();},'activator':()=>_0x57ed48['isOn']&&!this['_urlBalloonPanelView']['isVisible']&&!this['_resourcesBalloonView']['isAnyResourceBalloonVisible']()});}['_createContextButton'](_0x396e70,_0x30683e,_0x15bf5e=!0x1,_0x59155d=!0x1){const _0x2087ef='conversation'===_0x30683e||!0x0===_0x396e70['isReadOnly'],_0xef019c=new xn(this['locale'],_0x396e70,_0x2087ef,_0x15bf5e,_0x59155d);return _0x2087ef||_0xef019c['on']('removeContextItemChip',()=>{this['fire']('removeContextItem',_0xef019c['id']);}),_0xef019c;}['_addContextToCollection'](_0x41b633,_0x2683a8){_0x2683a8['add'](_0x41b633,0x0);}['_removeContextFromCollection'](_0x45c3ff,_0x581487){const _0xa29a23=_0x581487['find'](_0x4d7640=>_0x4d7640['id']===_0x45c3ff);_0xa29a23&&_0x581487['remove'](_0xa29a23);}['_handleAddContextButtonClick'](){this['addContextButtonView']['isOn']?this['hideAddContextBalloonPanel']():(this['showAddContextBalloonPanel'](),this['_addContextBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':Wr}),this['_hasExactlyOneSource']&&this['_addContextBalloonPanelView']['content']['get'](0x0)?.['fire']('execute'));}['_handleUrlSubmit'](_0x4a97e8){this['_urlInputView']['clear'](),this['hideUrlBalloonPanel'](),this['fire']('addUrlToContext',_0x4a97e8);}}class $r extends kt{['arrowView'];constructor(_0x2a1d22){super(_0x2a1d22),this['set']({'withText':!0x0,'role':'menuitem'}),this['arrowView']=this['_createArrowView'](),this['extendTemplate']({'attributes':{'class':[Ur]}});}['render'](){super['render'](),this['children']['add'](this['arrowView']);}['_createArrowView'](){const _0x29e452=new yt();return _0x29e452['content']=_0x35eca3,_0x29e452['extendTemplate']({'attributes':{'class':Ur+'__arrow'}}),_0x29e452;}}class qr extends Nt{['_cancelButtonView'];['_loaderView'];constructor(_0x16e9da){super(_0x16e9da),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 _0x497103=new kt(this['locale']);return _0x497103['set']({'label':as(this['locale'],'AI_CHAT_STOP_GENERATING'),'withText':!0x0,'class':hs+'\x20ck-ai-button-stop-generating','icon':_0x4d09f1}),_0x497103['on']('execute',()=>{this['fire']('abortPromptStream');}),_0x497103;}['_createLoaderView'](){const _0x4701e7=new Nt(this['locale']);return _0x4701e7['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-controls-loader']},'children':[{'tag':'div','attributes':{'class':['ck-ai-chat-controls-loader-icon']},'children':[{'tag':'div','attributes':{'class':['ck-ai-chat-controls-loader-icon-dot']}},{'tag':'div','attributes':{'class':['ck-ai-chat-controls-loader-icon-dot']}},{'tag':'div','attributes':{'class':['ck-ai-chat-controls-loader-icon-dot']}}]},{'text':as(this['locale'],'AI_CHAT_IS_WRITING')}]}),_0x4701e7;}}class Qr extends Nt{['_contextPanelView'];['_promptInputView'];['_promptCapabilitiesView'];['_loaderView'];['_modelUnavailableMessageView'];['_shouldRestorePromptInputFocus'];constructor(_0x477b32,_0xb53e68){super(_0x477b32),this['_contextPanelView']=this['_createContextPanelView'](_0x477b32,{'bodyCollection':_0xb53e68['bodyCollection'],'searchInputVisibleFrom':_0xb53e68['contextResourcesSearchInputVisibleFrom']}),this['_promptInputView']=this['_createPromptInputView'](_0x477b32),this['_promptCapabilitiesView']=this['_createPromptCapabilitiesView'](_0x477b32),this['_loaderView']=this['_createLoaderView'](_0x477b32),this['_modelUnavailableMessageView']=this['_createModelUnavailableMessageView'](_0x477b32),this['_shouldRestorePromptInputFocus']=!0x1,this['_promptInputView']['delegate']('sendUserMessage')['to'](this),this['_loaderView']['delegate']('abortPromptStream')['to'](this),this['_promptCapabilitiesView']['delegate']('toggleWebSearch')['to'](this),this['_promptCapabilitiesView']['delegate']('toggleReasoning')['to'](this),this['_promptCapabilitiesView']['delegate']('selectModel')['to'](this),this['_contextPanelView']['delegate'](...yr)['to'](this),this['set']('isModelAvailable',!0x0),this['set']('isDisabled',!0x1);const _0x5b952a=this['bindTemplate'];this['setTemplate']({'tag':'form','attributes':{'class':['ck','ck-ai-chat-controls',_0x5b952a['if']('isDisabled','ck-ai-chat-controls-disabled')]},'children':[{'tag':'div','attributes':{'class':[_0x5b952a['if']('isLoading','ck-hidden',_0x52d5b2=>_0x52d5b2||!this['isModelAvailable']),_0x5b952a['if']('isModelAvailable','ck-hidden',_0x5b54e5=>!_0x5b54e5||this['isLoading'])]},'children':[this['_contextPanelView'],this['_promptInputView'],this['_promptCapabilitiesView']]},{'tag':'div','attributes':{'class':[_0x5b952a['if']('isLoading','ck-hidden',_0x3965fa=>!_0x3965fa)]},'children':[this['_loaderView']]},{'tag':'div','attributes':{'class':[_0x5b952a['if']('isModelAvailable','ck-hidden',_0x4411d1=>_0x4411d1)]},'children':[this['_modelUnavailableMessageView']]}]}),Xt({'emitter':this['_promptInputView'],'activator':()=>this['isLoading'],'contextElements':()=>[this['element']],'callback':()=>{this['_shouldRestorePromptInputFocus']=!0x1;}}),this['on']('change:isLoading',this['_handlePromptInputFocus'],{'priority':'low'});}['_createContextPanelView'](_0x5ee640,_0x568211){return new Yr(_0x5ee640,_0x568211);}['_createPromptInputView'](_0x5ac873){return new sr(_0x5ac873,this['_contextPanelView']['addContextButtonView']);}['_createPromptCapabilitiesView'](_0x434ed1){return new dr(_0x434ed1);}['_createLoaderView'](_0x5f09b9){return new qr(_0x5f09b9);}['_createModelUnavailableMessageView'](_0x19a2b1){const _0x29fdf7=new Xr(_0x19a2b1);return _0x29fdf7['delegate']('startConversation')['to'](this),_0x29fdf7;}['_handlePromptInputFocus'](_0x2266a8,_0x25e1ba,_0x243b1b){_0x243b1b?this['_shouldRestorePromptInputFocus']=!0x0:this['_shouldRestorePromptInputFocus']&&this['_promptInputView']['focus']();}['addContextItem'](_0x1158c0,_0x12621e){this['_contextPanelView']['addContextItem'](_0x1158c0,_0x12621e);}['removeContextItem'](_0x3cda57){this['_contextPanelView']['removeContextItem'](_0x3cda57);}['setContextItemLoading'](_0x386c1a,_0x1e0dee){this['_contextPanelView']['setContextItemLoading'](_0x386c1a,_0x1e0dee);}['setIsUploadInProgress'](_0x3a18d1){this['_promptInputView']['setIsUploadInProgress'](_0x3a18d1);}['setConversationContext'](_0x94d7b1){this['_contextPanelView']['setConversationContext'](_0x94d7b1);}['clearPendingContextUI'](){this['_contextPanelView']['clearCurrentContextItems']();}['clearConversationContextUI'](){this['_contextPanelView']['clearConversationContextItems']();}['updateResourceState'](_0x547e3d,_0x1d2945,_0x123832){this['_contextPanelView']['updateResourceState'](_0x547e3d,_0x1d2945,_0x123832);}['setWebSearch'](_0xfd4e63){this['_promptCapabilitiesView']['setWebSearch'](_0xfd4e63);}['setReasoning'](_0xf2b1e8){this['_promptCapabilitiesView']['setReasoning'](_0xf2b1e8);}['resetMessageInput'](){this['_promptInputView']['reset']();}['setAddContextOptions'](_0x22cab7){this['_contextPanelView']['setAddContextOptions'](_0x22cab7);}['setInputPlaceholder'](_0x58b500){this['_promptInputView']['setPlaceholderText'](_0x58b500);}['setModelList'](_0x2089f7,_0xc8e6aa){this['_promptCapabilitiesView']['setModelList'](_0x2089f7,_0xc8e6aa);}['setModel'](_0x12b1ea){_0x12b1ea?(this['isModelAvailable']=!0x0,this['_promptCapabilitiesView']['setModel'](_0x12b1ea)):this['isModelAvailable']=!0x1;}['enableModelSelector'](){this['_promptCapabilitiesView']['enableModelSelector']();}['disableModelSelector'](_0x58c8fd){this['_promptCapabilitiesView']['disableModelSelector'](_0x58c8fd);}['populateSourceResourceBalloon'](_0x2f9e92,_0x4f43ad,_0x101a89,_0x43f816){this['_contextPanelView']['populateSourceResourceBalloon'](_0x2f9e92,_0x4f43ad,_0x101a89,_0x43f816);}['closeSourceResourceBalloon'](_0x558108){this['_contextPanelView']['closeSourceResourceBalloon'](_0x558108);}['focusPromptInput'](_0x1448bb=!0x1){this['_promptInputView']['focus'](_0x1448bb);}['setPromptInputValue'](_0x9c7f4){this['_promptInputView']['queryView']['fieldView']['reset'](),this['_promptInputView']['queryView']['fieldView']['value']=_0x9c7f4;}}class Xr extends Nt{constructor(_0x4c2a6b){super(_0x4c2a6b);const _0x41316c=new kt(_0x4c2a6b);_0x41316c['set']({'label':as(this['locale'],'AI_CHAT_MODEL_UNAVAILABLE_MESSAGE_BUTTON'),'withText':!0x0,'class':['ck-ai-chat-controls__start-new-chat-button'],'tooltip':''}),_0x41316c['delegate']('execute')['to'](this,'startConversation'),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat-controls-model-unavailable-message']},'children':[{'tag':'p','children':[{'text':as(this['locale'],'AI_CHAT_MODEL_UNAVAILABLE_MESSAGE_TEXT')+'\x20'},_0x41316c]}]});}}class zr extends _0x3b6a7d{['conversationStartButton'];['resizeButton'];constructor(_0x51b1f1,_0x25d815){super(_0x51b1f1,{'label':as(_0x51b1f1,'AI_CHAT_HEADING'),'class':'ck-ai-header\x20ck-ai-header_chat','icon':_0x20ae05}),this['set']('isMaximized',!0x1),this['conversationStartButton']=this['_createStartConversationButton'](_0x51b1f1),this['children']['add'](this['conversationStartButton']),_0x25d815&&(this['resizeButton']=ls(_0x51b1f1,this),this['children']['add'](this['resizeButton']));}['_createStartConversationButton'](_0x5cbd85){const _0x504105=new kt(_0x5cbd85);return _0x504105['set']({'label':as(this['locale'],'AI_CHAT_LABEL_NEW_CHAT'),'withText':!0x0,'icon':_0x4cd16e,'class':'ck-ai-chat__start-conversation\x20'+hs}),_0x504105['on']('execute',()=>{this['fire']('startConversation');}),_0x504105;}}class jr extends Nt{constructor(_0x57ff4b){super(_0x57ff4b),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-disclaimer']},'children':[{'tag':'p','attributes':{'class':['ck','ck-ai-disclaimer__content']},'children':[{'text':as(_0x57ff4b,'AI_DISCLAIMER_TEXT')}]}]});}}class Jr extends Nt{['chatHeader'];['chatFeed'];['chatControls'];['chatDisclaimer'];['_bodyCollection'];constructor(_0x15b0bc,_0x2fded6){super(_0x15b0bc),this['_bodyCollection']=new qt(_0x15b0bc),this['_bodyCollection']['attachToDom'](),this['chatHeader']=new zr(_0x15b0bc,_0x2fded6['showResizeButton']),this['chatHeader']['delegate'](...Xs)['to'](this),this['chatFeed']=new tr(_0x15b0bc,this['_bodyCollection']),this['chatFeed']['delegate'](...Xs)['to'](this),this['chatControls']=new Qr(_0x15b0bc,{'bodyCollection':this['_bodyCollection'],'contextResourcesSearchInputVisibleFrom':_0x2fded6['contextResourcesSearchInputVisibleFrom']}),this['chatControls']['delegate'](...Xs)['to'](this),this['chatDisclaimer']=new jr(_0x15b0bc),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-ai-chat','ck-rounded-corners'],'dir':_0x15b0bc['uiLanguageDirection']},'children':[this['chatHeader'],this['chatFeed'],this['chatControls'],this['chatDisclaimer']]});}['populateSourceResourceBalloon'](_0x58deed,_0x583128,_0x77f781,_0x3086cd){this['chatControls']['populateSourceResourceBalloon'](_0x58deed,_0x583128,_0x77f781,_0x3086cd);}['closeSourceResourceBalloon'](_0x28eb76){this['chatControls']['closeSourceResourceBalloon'](_0x28eb76);}['destroy'](){this['_bodyCollection']['detachFromDom'](),super['destroy']();}}class Zr extends _0x333531{static get['requires'](){return[ns];}['_view'];static get['pluginName'](){return'AIChatUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['feedItemRenderingStrategy']='streaming';['showDiff']=!0x0;['_promiseQueue'];['_interactionPromiseResolver'];['_titleAnimationInterval']=void 0x0;['_isTrackChangesCommandValueBound']=!0x1;constructor(_0x5bdae7){super(_0x5bdae7);const _0x4207b0=this['context']['plugins']['get']('AITabs');this['set']('isBusy',!0x1),this['_promiseQueue']=new _n(),this['_view']=new Jr(this['context']['locale'],{'showResizeButton':_0x4207b0['showResizeButton'],'contextResourcesSearchInputVisibleFrom':this['context']['config']['get']('ai.chat.context.searchInputVisibleFrom')}),this['_view']['delegate'](...Xs)['to'](this),this['_view']['on']('toggleSuggestionDisplayMode',(_0x2e6817,{showDiff:_0xaecf07})=>{this['showDiff']=_0xaecf07;}),_0x4207b0['view']['addTab']({'id':'chat','buttonLabel':as(this['context']['locale'],'AI_CHAT_HEADING'),'buttonIcon':_0x20ae05,'order':0x0,'content':this['_view']}),this['_view']['chatControls']['bind']('isLoading')['to'](this,'isBusy',_0x31d6a1=>_0x31d6a1),this['_view']['chatFeed']['bind']('isPending')['to'](this,'isBusy',_0x3a3009=>_0x3a3009),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder']()),this['bind']('isModelAvailable')['to'](this['_view']['chatControls'],'isModelAvailable');}['destroy'](){super['destroy'](),this['_titleAnimationInterval']&&clearInterval(this['_titleAnimationInterval']);}['createConversation'](_0x50d9fa){const _0x5151a2=this['context']['config']['get']('ai.chat.welcomeMessage')??as(this['context']['locale'],'AI_CHAT_WELCOME_MESSAGE');this['_view']['chatFeed']['clear'](),this['_view']['chatControls']['enableModelSelector'](),this['_view']['chatControls']['setModelList'](_0x50d9fa['availableModels'],!this['context']['config']['get']('ai.models.showModelSelector')),this['addFeedItemStaticMessage']({'id':'conversation-start','staticMessage':_0x5151a2}),this['fire']('conversationCreated');}async['addFeedItemStaticMessage']({id:_0x2de005,staticMessage:_0x398595}){return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('ai-reply',{'id':_0x2de005,'initialContent':'<p>'+_0x398595+'</p>'});});}async['addFeedItemUserMessage'](_0x1ea5ca){const _0x159c45=_0x1ea5ca['attributes']?.['displayedPrompt']||_0x1ea5ca['userMessage'];return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('user-message',{'contextItems':Array['from'](_0x1ea5ca['contextItems']['values']()),'initialContent':'<p>'+_0x159c45+'</p>','id':_0x1ea5ca['id']});});}async['addFeedItemError']({errorMessage:_0x170926,id:_0x3a91a4}){return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('error-message',{'initialContent':'<p>'+_0x170926+'</p>','id':_0x3a91a4});});}async['addFeedItemAIReply'](_0x2975a8){return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('ai-reply',{'id':_0x2975a8['interactionId']+':'+_0x2975a8['id']}),this['clearLoadingMessage']();});}async['addFeedItemAISuggestion'](_0x4a6a94){const _0xe69a57=Fs(this['context']);let _0x4b28ef=_0xe69a57['config']['get']('ai.availableReplyActions')||[...gn];if(_0xe69a57['plugins']['has']('TrackChanges')){if(!this['_isTrackChangesCommandValueBound']){this['_isTrackChangesCommandValueBound']=!0x0;const _0x57aa88=_0xe69a57['commands']['get']('trackChanges');this['_view']['chatFeed']['bind']('isTrackChangesOn')['to'](_0x57aa88,'value');}}else _0x4b28ef=_0x4b28ef['filter'](_0x5de92f=>'insertSuggestion'!=_0x5de92f);return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('ai-suggestion-reply',{'id':_0x4a6a94['interactionId']+':'+_0x4a6a94['id'],'areActionsDisabled':_0x4a6a94['areActionsDisabled'],'showDiff':this['showDiff'],'availableActions':_0x4b28ef}),this['clearLoadingMessage']();});}async['addFeedInteractionHeader'](_0x54d2f4,_0x3cd49c){return this['_promiseQueue']['enqueue'](async()=>{const _0x4ab855=this['_view']['chatFeed']['children']['last'];if(_0x4ab855 instanceof Yn)return this['_view']['chatFeed']['children']['remove'](_0x4ab855),void this['_view']['chatFeed']['addItem']('interaction-header',{'id':_0x54d2f4['id'],'capabilities':{'isWebSearchEnabled':_0x4ab855['capabilities']['isWebSearchEnabled']||_0x3cd49c['isWebSearchEnabled'],'isReasoningEnabled':_0x4ab855['capabilities']['isReasoningEnabled']||_0x3cd49c['isReasoningEnabled']}});this['_view']['chatFeed']['addItem']('interaction-header',{'id':_0x54d2f4['id'],'capabilities':_0x3cd49c});});}async['addFeedItemCustomElement'](_0x12debb,_0x328be8){let _0x1433fb;return await this['_promiseQueue']['enqueue'](async()=>{_0x1433fb=this['_view']['chatFeed']['addItem']('custom-element',{'content':_0x12debb,'id':_0x328be8});}),_0x1433fb;}['removeFeedItem'](_0x1cac8e){this['_view']['chatFeed']['removeItem'](_0x1cac8e);}['hasFeedItem'](_0x5555e2){return this['_view']['chatFeed']['hasItem'](_0x5555e2);}['updateFeedInteractionHeader'](_0x3579ee){const _0x1f8474=this['_view']['chatFeed']['children']['find'](_0xa3a195=>_0xa3a195['options']['id']==_0x3579ee['id']&&_0xa3a195 instanceof Yn);_0x1f8474&&_0x1f8474['set']('isVisible',_0x3579ee['isVisible']);}async['updateFeedItemAIReplyContent'](_0x16c970){const _0x53e88b=_0x16c970['renderingStrategy']||this['feedItemRenderingStrategy'];return this['_promiseQueue']['enqueue'](async _0x49d634=>{await this['_view']['chatFeed']['updateReplyItem']({..._0x16c970,'abortSignal':_0x49d634,'renderingStrategy':_0x53e88b}),_0x16c970['isDone']&&this['markFeedItemAsDone'](_0x16c970['id']);});}['updateFeedItemAIReplySources'](_0x58e7af,_0x5bed3c){this['_view']['chatFeed']['updateWebSources'](_0x58e7af,_0x5bed3c);}async['updateFeedItemAIReplySuggestionContent'](_0x4c54b1){const _0x1e100d=_0x4c54b1['renderingStrategy']||this['feedItemRenderingStrategy'];return this['_promiseQueue']['enqueue'](async _0x276905=>{await this['_view']['chatFeed']['updateSuggestionItem']({..._0x4c54b1,'abortSignal':_0x276905,'renderingStrategy':_0x1e100d}),_0x4c54b1['isDone']&&this['markFeedItemAsDone'](_0x4c54b1['id']);});}['updateFeedItemAIReplySuggestionPartState'](_0x4dd376){this['_view']['chatFeed']['updateSuggestionPartState'](_0x4dd376);}['setFeedItemAIReplySuggestionPartActive'](_0x2af9ff){this['_view']['chatFeed']['setSuggestionPartActive'](_0x2af9ff);}['markFeedItemAsDone'](_0x4279e7){this['_view']['chatFeed']['markItemAsDone'](_0x4279e7);}['removeFeedInteraction'](_0x2edaf6){this['_view']['chatFeed']['getItemIds']()['filter'](_0x4d0306=>_0x4d0306['startsWith'](_0x2edaf6))['forEach'](_0xed9e89=>this['_view']['chatFeed']['removeItem'](_0xed9e89));}['startInteraction'](){const _0x32d734=this['prepareLoadingMessage']({'isWebSearchEnabled':!0x1,'isReasoningEnabled':!0x1});this['setLoadingMessage'](_0x32d734),this['_view']['chatControls']['disableModelSelector'](!this['context']['config']['get']('ai.models.showModelSelector')),this['isBusy']=!0x0,this['_view']['chatFeed']['startAutoScroll']();}['stopInteraction'](_0x53e8c1){this['_promiseQueue']['abort'](),this['_view']['chatFeed']['getItemIds']()['filter'](_0x455779=>_0x455779['startsWith'](_0x53e8c1['id']))['forEach'](_0x69d1d5=>this['markFeedItemAsDone'](_0x69d1d5)),this['isBusy']=!0x1,this['_view']['chatFeed']['stopAutoScroll']();}async['finishInteraction'](){return this['_promiseQueue']['queueEmptyPromise']['then'](()=>{this['isBusy']=!0x1,this['_view']['chatFeed']['stopAutoScroll']();});}['addContextItem'](_0x560817,_0xe8787e){this['_view']['chatControls']['addContextItem'](_0x560817,_0xe8787e);}['removeContextItem'](_0x3f91fc){this['_view']['chatControls']['removeContextItem'](_0x3f91fc);}['setContextItemLoading'](_0x235f46,_0x30d520){this['_view']['chatControls']['setContextItemLoading'](_0x235f46,_0x30d520);}['setIsUploadInProgress'](_0x377ce5){this['_view']['chatControls']['setIsUploadInProgress'](_0x377ce5);}['setConversationContext'](_0x127e40){this['_view']['chatControls']['setConversationContext'](_0x127e40);}['clearPendingContextUI'](){this['_view']['chatControls']['clearPendingContextUI']();}['clearConversationContextUI'](){this['_view']['chatControls']['clearConversationContextUI']();}['updateResourceState'](_0x1e2c3b,_0x3cf12d,_0x520090){this['_view']['chatControls']['updateResourceState'](_0x1e2c3b,_0x3cf12d,_0x520090);}['resetMessageInput'](){this['_view']['chatControls']['resetMessageInput'](),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder']());}['setAddContextOptions'](_0x268a67){this['_view']['chatControls']['setAddContextOptions'](_0x268a67);}['updateCapabilities'](_0x6c10a){this['_view']['chatControls']['setWebSearch'](_0x6c10a['isWebSearchEnabled']),this['_view']['chatControls']['setReasoning'](_0x6c10a['isReasoningEnabled']),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder'](_0x6c10a));}['setSelectedModel'](_0x56e308,_0x264b36){this['_view']['chatControls']['setModel'](_0x56e308),_0x264b36&&this['_view']['chatControls']['disableModelSelector'](!0x1);}['setFeedItemRenderingStrategy'](_0xa7172b){this['feedItemRenderingStrategy']=_0xa7172b;}['toggleLoadingSkeleton'](_0xb5931f){this['_view']['chatFeed']['toggleLoadingSkeleton'](_0xb5931f);}['resetConversationTitle'](){this['setConversationTitle'](as(this['context']['locale'],'AI_CHAT_HEADING'));}['setConversationTitle'](_0x2d56c4,_0x49e820=!0x1){if(_0x49e820&&!St()&&_0x2d56c4['length'])return this['_view']['chatHeader']['label']='',void this['_animateConversationTitle'](_0x2d56c4);this['_view']['chatHeader']['label']=_0x2d56c4;}['setLoadingMessage'](_0x254711){this['_view']['chatFeed']['setLoadingMessage'](_0x254711);}['clearLoadingMessage'](){this['_view']['chatFeed']['setLoadingMessage']('');}['_animateConversationTitle'](_0x5a75e4){let _0x46471c=0x0;clearInterval(this['_titleAnimationInterval']),this['_titleAnimationInterval']=setInterval(()=>{this['_view']['chatHeader']['label']=this['_view']['chatHeader']['label']+_0x5a75e4[_0x46471c],_0x46471c++,_0x46471c===_0x5a75e4['length']&&clearInterval(this['_titleAnimationInterval']);},0x1e);}['setIsMaximized'](_0x4edb30){this['_view']['chatHeader']['isMaximized']=_0x4edb30;}['prepareLoadingMessage'](_0x153650){return _0x153650['isWebSearchEnabled']&&_0x153650['isReasoningEnabled']?as(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH_REASONING'):_0x153650['isWebSearchEnabled']?as(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH'):_0x153650['isReasoningEnabled']?as(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_REASONING'):as(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_REGULAR');}['_getInputPlaceholder'](_0x13ea16){return _0x13ea16?_0x13ea16['isWebSearchEnabled']&&_0x13ea16['isReasoningEnabled']?as(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH_REASONING'):_0x13ea16['isWebSearchEnabled']?as(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH'):_0x13ea16['isReasoningEnabled']?as(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REASONING'):as(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REGULAR'):as(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REGULAR');}['populateSourceResourceBalloon'](_0x53a127,_0x2473d0,_0x2aa019,_0x117821){this['_view']['populateSourceResourceBalloon'](_0x53a127,_0x2473d0,_0x2aa019,_0x117821);}['closeSourceResourceBalloon'](_0x38b297){this['_view']['closeSourceResourceBalloon'](_0x38b297);}['setPromptInputValue'](_0x90d800){this['_view']['chatControls']['setPromptInputValue'](_0x90d800);}['focusPromptInput'](_0x4ab9d7=!0x1){this['_view']['chatControls']['focusPromptInput'](_0x4ab9d7);}['scrollFeedToSuggestion'](_0x2e51fe,_0x22d501){this['_view']['chatFeed']['scrollToSuggestion'](_0x2e51fe,_0x22d501);}['startAutoScroll'](){this['_view']['chatFeed']['startAutoScroll']();}['disableControls'](){this['_view']['chatControls']['isDisabled']=!0x0;}['enableControls'](){this['_view']['chatControls']['isDisabled']=!0x1;}}class ta extends Lt{['sections'];constructor(_0x1fca33,_0xff9b1e){super(_0x1fca33),this['sections']=_0xff9b1e,this['items']['addMany'](this['sections']),this['extendTemplate']({'attributes':{'class':['ck-ai-chat-history__sections']}});}['filter'](_0x52454b){let _0x19317a=0x0,_0x4b1eb0=0x0;for(const _0x58334f of this['sections']){const {resultsCount:_0x50ba3e,totalItemsCount:_0x50bfde}=_0x58334f['filter'](_0x52454b);_0x19317a+=_0x50ba3e,_0x4b1eb0+=_0x50bfde;}return{'resultsCount':_0x19317a,'totalItemsCount':_0x4b1eb0};}}class ea extends Pt{['title'];['itemsViews'];['_itemsListView'];constructor(_0x3ebb38,{title:_0x4e4972,items:_0x131171}){super(_0x3ebb38);const _0x15c32e=this['bindTemplate'];this['set']('isVisible',!0x0),this['title']=_0x4e4972,this['itemsViews']=_0x131171;const _0x2690ac=new Nt(_0x3ebb38);_0x2690ac['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-history__section-title']},'children':[this['title']]}),this['_itemsListView']=new Lt(_0x3ebb38),this['_itemsListView']['items']['addMany'](this['itemsViews']),this['setTemplate']({'tag':'li','attributes':{'class':['ck-ai-chat-history__section',_0x15c32e['if']('isVisible','ck-hidden',_0x6f3158=>!_0x6f3158)]},'children':[_0x2690ac,this['_itemsListView']]});}['filter'](_0x486d12){const _0x4462c=this['itemsViews']['length'];let _0x12baf5=0x0;for(const _0x13da56 of this['itemsViews']){if(_0x486d12){const _0x516f41=_0x13da56['isMatching'](_0x486d12);_0x13da56['isVisible']=!!_0x516f41,_0x13da56['highlightText'](_0x486d12);}else _0x13da56['isVisible']=!0x0,_0x13da56['highlightText'](null);_0x13da56['isVisible']&&_0x12baf5++;}return this['isVisible']=_0x12baf5>0x0,{'resultsCount':_0x12baf5,'totalItemsCount':_0x4462c};}['getItem'](_0x5c412f){return this['itemsViews']['find'](_0x50cfe0=>_0x50cfe0['id']===_0x5c412f);}['removeItem'](_0x467ce2){const _0xa56f5c=this['itemsViews']['indexOf'](_0x467ce2);-0x1!==_0xa56f5c&&(this['itemsViews']['splice'](_0xa56f5c,0x1),this['_itemsListView']['items']['remove'](_0x467ce2));}}class ia extends/* #__PURE__ -- @preserve */
|
|
27
|
+
_0x32cb9f(Pt){['id'];static ['LOADING_LABELS']={'remove':'AI_CHAT_HISTORY_LOADING_REMOVING','rename':'AI_CHAT_HISTORY_LOADING_RENAMING','pin':'AI_CHAT_HISTORY_LOADING_PINNING','unpin':'AI_CHAT_HISTORY_LOADING_UNPINNING'};['actions'];['mainContent'];['_titleView'];constructor(_0x516dff,_0x1f42c3){super(_0x516dff);const _0x4a70ac=this['bindTemplate'];this['set']('isEdit',!0x1),this['set']('isVisible',!0x0),this['set']('pinned',!!_0x1f42c3['pinned']),this['set']('loadingState',null),this['id']=_0x1f42c3['id'];const {title:_0x4b45f4,createdAt:_0x278248,active:_0x3d0bbb=!0x1}=_0x1f42c3;this['_titleView']=new _0x51d6a3(),this['_titleView']['text']=_0x4b45f4,this['_titleView']['extendTemplate']({'attributes':{'class':['ck-ai-chat-history__item-title']}});const _0x34c03f=this['_createCheckView'](),_0x8dcae3=this['_createPinButtonView'](_0x516dff),_0x20bf7d=this['_createMenuDropdownView'](),_0x15672f=this['_createEditInputView'](_0x516dff,_0x4b45f4),_0x192ced=this['_createAcceptEditButtonView'](_0x516dff,_0x15672f),_0x11a32e=this['_createCancelEditButtonView'](_0x516dff,_0x15672f);this['actions']=this['createCollection'](),this['mainContent']=this['createCollection'](),this['mainContent']['add'](this['_titleView']),this['actions']['add'](_0x8dcae3),this['actions']['add'](_0x20bf7d),this['on']('change:isEdit',(_0x334f98,_0x179ac7,_0x5f37ba)=>{this['actions']['clear'](),this['mainContent']['clear'](),_0x5f37ba?(this['actions']['add'](_0x192ced),this['actions']['add'](_0x11a32e),this['mainContent']['add'](_0x15672f),_0x15672f['element']['focus']()):(this['actions']['add'](_0x8dcae3),this['actions']['add'](_0x20bf7d),this['mainContent']['add'](this['_titleView']));}),this['setTemplate']({'tag':'li','attributes':{'class':['ck-ai-chat-history__item',_0x3d0bbb?'ck-ai-chat-history__item--active':'',_0x4a70ac['if']('isVisible','ck-hidden',_0x2fb6ba=>!_0x2fb6ba),_0x4a70ac['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',_0x4a70ac['if']('loadingState','ck-hidden',_0x5789f3=>!!_0x5789f3)]},'children':_0x3d0bbb?[_0x34c03f]:[]},{'tag':'div','attributes':{'class':['ck-ai-loader',_0x4a70ac['if']('loadingState','ck-hidden',_0x2c1273=>!_0x2c1273)]},'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',_0x4a70ac['if']('loadingState','ck-hidden',_0x511d55=>!!_0x511d55)]},'children':this['mainContent']},{'tag':'div','attributes':{'class':['ck-ai-loader__text',_0x4a70ac['if']('loadingState','ck-hidden',_0x55a76d=>!_0x55a76d)]},'children':[{'text':_0x4a70ac['to']('loadingState',_0x25b293=>_0x25b293?as(this['locale'],ia['LOADING_LABELS'][_0x25b293]):'')}]}]},{'tag':'span','attributes':{'class':['ck-ai-chat-history__item-date']},'children':[_0x278248]}]},{'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'](_0x4faf4f){this['_titleView']['text']=_0x2fa763(_0x4faf4f);}['updateLoadingState'](_0x1ac8f8,_0x4f5439){this['set']('loadingState',_0x4f5439?_0x1ac8f8:null);}['_createCheckView'](){const _0x210ae3=new yt();return _0x210ae3['set']({'content':_0x253f15}),_0x210ae3;}['_createPinButtonView'](_0x57febc){const _0xee6f5b=new kt(_0x57febc);return _0xee6f5b['set']({'label':as(_0x57febc,'AI_CHAT_HISTORY_PIN_BUTTON'),'icon':_0x514118,'withText':!0x1,'tooltip':!0x0}),_0xee6f5b['bind']('isOn')['to'](this,'pinned'),_0xee6f5b['on']('execute',()=>{const _0x5e9328=!this['pinned'];this['fire']('setConversationPinned',{'id':this['id'],'pinned':_0x5e9328});}),_0xee6f5b;}['_createMenuDropdownView'](){const _0x52441f=Bt(this['locale']),_0x50cf8b=_0x52441f['panelView']['children'];_0x52441f['buttonView']['set']({'label':as(this['locale'],'AI_CHAT_HISTORY_SHOW_MORE_ITEMS'),'icon':_0xfb681}),_0x52441f['panelPosition']='sw';const _0x232f44=new kt(this['locale']);_0x232f44['label']=as(this['locale'],'AI_CHAT_HISTORY_EDIT_NAME'),_0x232f44['withText']=!0x0,_0x232f44['on']('execute',()=>{this['isEdit']=!0x0;});const _0xe002b8=new kt(this['locale']);_0xe002b8['label']=as(this['locale'],'AI_CHAT_HISTORY_REMOVE'),_0xe002b8['withText']=!0x0,_0xe002b8['on']('execute',()=>{this['showConfirm'](as(this['locale'],'AI_CHAT_HISTORY_REMOVE_CONFIRM'),this['element'])['then'](()=>{this['fire']('removeConversation',{'id':this['id']});});});const _0x3b6b8d=new Lt(this['locale']),_0x46863b=new Pt(this['locale']);_0x46863b['children']['add'](_0x232f44);const _0x1b8fbb=new Pt(this['locale']);return _0x1b8fbb['children']['add'](_0xe002b8),_0x3b6b8d['items']['addMany']([_0x46863b,_0x1b8fbb]),_0x50cf8b['add'](_0x3b6b8d),_0x52441f;}['_createEditInputView'](_0x182edf,_0x41ecca){const _0x81d9e7=new _0x20a14c(_0x182edf),_0x3bb654=_0x81d9e7['bindTemplate'];return _0x81d9e7['value']=_0x41ecca,_0x81d9e7['extendTemplate']({'on':{'keydown':_0x3bb654['to'](_0x2c8869=>{'Enter'==_0x2c8869['key']&&this['_commitEditInputValue'](_0x81d9e7);})}}),_0x81d9e7;}['_createAcceptEditButtonView'](_0x586e98,_0x4c31b9){const _0x19e380=new kt(_0x586e98);return _0x19e380['set']({'icon':_0x253f15,'withText':!0x1,'tooltip':as(_0x586e98,'AI_CHAT_HISTORY_ACCEPT')}),_0x19e380['extendTemplate']({'attributes':{'class':['ck-confirm-view-submit']}}),_0x19e380['on']('execute',()=>{this['_commitEditInputValue'](_0x4c31b9);}),_0x19e380;}['_commitEditInputValue'](_0x1fb49b){const _0x22dcc2=_0x1fb49b['element']['value']||'';this['_titleView']['text']=_0x22dcc2,this['isEdit']=!0x1,this['fire']('editConversationTitle',{'id':this['id'],'title':_0x22dcc2});}['_createCancelEditButtonView'](_0x266170,_0x153ae9){const _0x4680b8=new kt(_0x266170);return _0x4680b8['set']({'icon':_0x6494e0,'withText':!0x1,'tooltip':as(_0x266170,'AI_CHAT_HISTORY_CANCEL')}),_0x4680b8['extendTemplate']({'attributes':{'class':['ck-confirm-view-cancel']}}),_0x4680b8['on']('execute',()=>{this['isEdit']=!0x1,_0x153ae9['value']=this['_titleView']['text']||'',this['fire']('edit:cancel');}),_0x4680b8;}['_createSpinnerView'](){const _0x56fa25=new fn('tiny');return _0x56fa25['isVisible']=!0x0,_0x56fa25;}['isMatching'](_0x8ef160){return this['_titleView']&&'string'==typeof this['_titleView']['text']&&this['_titleView']['text']['match'](_0x8ef160)?{'title':!0x0}:null;}['highlightText'](_0x2279ca){this['_titleView']['highlightText'](_0x2279ca);}}class sa extends Nt{['searchView'];['mainErrorView'];['skeletonView'];['emptyView'];['sectionsView'];['resizeButton'];constructor(_0x5f0895,_0x5d9595){super(_0x5f0895),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 _0x25a49a=new _0x3b6a7d(_0x5f0895,{'label':as(_0x5f0895,'AI_CHAT_HISTORY_HEADING'),'icon':_0x2e660f,'class':'ck-ai-header\x20ck-ai-header_history'});_0x5d9595&&(this['resizeButton']=ls(_0x5f0895,this),_0x25a49a['children']['add'](this['resizeButton'])),this['sectionsView']=new ta(_0x5f0895,[]),this['sectionsView']['delegate'](...na)['to'](this),this['mainErrorView']=this['_createErrorView'](),this['skeletonView']=this['_createSkeletonView'](),this['emptyView']=this['_createEmptyStateView'](),this['searchView']=this['_createSearchView'](),this['mainErrorView']['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isMainErrorViewVisible','ck-hidden',_0x1b41eb=>!_0x1b41eb)]}}),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':[_0x25a49a,{'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 _0x55668b=new _0x39d3b1(this['locale'],{'filteredView':this['sectionsView'],'queryView':{'label':as(this['locale'],'AI_CHAT_HISTORY_SEARCH_LABEL')},'infoView':{'text':{'notFound':{'primary':_0x230c2a=>as(this['locale'],'AI_CHAT_HISTORY_SEARCH_NOT_FOUND_PRIMARY',_0x230c2a),'secondary':as(this['locale'],'AI_CHAT_HISTORY_SEARCH_NOT_FOUND_SECONDARY')}}}}),_0x542558=this['_createErrorView']();return _0x542558['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('errorMessage','ck-hidden',_0x390900=>!_0x390900)]}}),_0x55668b['on']('render',()=>{_0x55668b['children']['add'](_0x542558,0x1);}),_0x55668b['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isSearchViewVisible','ck-hidden',_0x15f300=>!_0x15f300)]}}),_0x55668b;}['_createSkeletonView'](){const _0x37f2e2=new zn(this['locale'],jn['aiHistory']);return _0x37f2e2['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isLoading','ck-hidden',_0x29f43e=>!_0x29f43e)]}}),_0x37f2e2;}['_createErrorView'](){const _0x53e47a=new Nt(this['locale']),_0x45fe2d=new kt(this['locale']);_0x45fe2d['set']({'withText':!0x1,'icon':_0x6494e0,'class':'ck-ai-notification_error__dismiss-button'}),_0x45fe2d['bind']('isVisible')['to'](this,'hasItems',_0x16b795=>!!_0x16b795),_0x45fe2d['on']('execute',()=>{this['errorMessage']='';});const _0x5889c2=this['bindTemplate'];return _0x53e47a['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-notification','ck-ai-notification_error']},'children':[{'tag':'p','children':[{'text':_0x5889c2['to']('errorMessage')}]},_0x45fe2d]}),_0x53e47a;}['_createEmptyStateView'](){const _0xb76a8=new kt(this['locale']);_0xb76a8['set']({'label':as(this['locale'],'AI_CHAT_LABEL_NEW_CHAT'),'withText':!0x0,'icon':_0x4cd16e,'class':'ck-ai-chat__start-conversation\x20'+hs}),_0xb76a8['on']('execute',()=>{this['fire']('openChat');});const _0x2cebf6=new Nt(this['locale']);return _0x2cebf6['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-history__empty',this['bindTemplate']['if']('isEmptyViewVisible','ck-hidden',_0x3b1c47=>!_0x3b1c47)]},'children':[{'tag':'p','attributes':{'class':['ck-ai-chat-history__empty-message']},'children':[as(this['locale'],'AI_CHAT_HISTORY_EMPTY_MESSAGE')]},_0xb76a8]}),_0x2cebf6;}['_createListItemViews'](_0x57ec43,_0x51cc9a){const _0x13f527=[];for(const _0x25e17c of _0x57ec43){const _0x56c859=new ia(_0x51cc9a,_0x25e17c);_0x56c859['delegate'](...na)['to'](this),_0x13f527['push'](_0x56c859);}return _0x13f527;}['updateHistoryItemsWithCategories'](_0x549bb9){const _0x26d901=this['locale']||'en',_0x2d4a6f=[];for(const _0x238c6d of _0x549bb9){const _0x309b0c=this['_createListItemViews'](_0x238c6d['items'],_0x26d901);_0x2d4a6f['push'](new ea(_0x26d901,{'title':_0x238c6d['title'],'items':_0x309b0c}));}this['sectionsView']['sections']=_0x2d4a6f,this['sectionsView']['items']['clear'](),this['sectionsView']['items']['addMany'](_0x2d4a6f),this['hasItems']=_0x549bb9['some'](_0x26804b=>_0x26804b['items']['length']>0x0),this['_refreshSearch']();}['removeHistoryItem'](_0x5f3dfc){for(const _0x92ba2e of this['sectionsView']['sections']){const _0x3b4194=_0x92ba2e['getItem'](_0x5f3dfc);if(_0x3b4194){if(_0x92ba2e['removeItem'](_0x3b4194),0x0===_0x92ba2e['itemsViews']['length']){const _0xf99bee=this['sectionsView']['sections']['indexOf'](_0x92ba2e);-0x1!==_0xf99bee&&(this['sectionsView']['sections']['splice'](_0xf99bee,0x1),this['sectionsView']['items']['remove'](_0x92ba2e));}this['hasItems']=this['sectionsView']['sections']['length']>0x0,this['_refreshSearch']();break;}}}['updateItemTitle'](_0x5d0239,_0xa75ecd){for(const _0x49bb1e of this['sectionsView']['sections']){const _0x3e6dd8=_0x49bb1e['getItem'](_0x5d0239);if(_0x3e6dd8){_0x3e6dd8['updateTitle'](_0xa75ecd);break;}}}['updateItemLoadingState'](_0x2febea,_0x3f37d6,_0x520723){for(const _0x53e3ea of this['sectionsView']['sections']){const _0x1d70b7=_0x53e3ea['getItem'](_0x2febea);if(_0x1d70b7){_0x1d70b7['updateLoadingState'](_0x3f37d6,_0x520723);break;}}}['_refreshSearch'](){if(this['hasItems']){const _0x2153fe=this['searchView']['queryView']['fieldView']?.['element']?.['value']||'';this['searchView']['search'](_0x2153fe);}}}const na=['showConversationHistory','removeConversation','editConversationTitle','setConversationPinned','selectConversation','openChat','resizeTabs'];class ra extends _0x333531{static get['requires'](){return[ns];}['_historyView'];static get['pluginName'](){return'AIChatHistoryUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x55d79a){super(_0x55d79a);const _0x53a2c0=this['context']['plugins']['get']('AITabs');this['_historyView']=new sa(this['context']['locale'],_0x53a2c0['showResizeButton']),this['_historyView']['delegate'](...na)['to'](this),_0x53a2c0['view']['addTab']({'id':'history','buttonLabel':as(this['context']['locale'],'AI_CHAT_HISTORY_HEADING'),'buttonIcon':_0x2e660f,'order':0x0,'content':this['_historyView']});}['removeHistoryItem'](_0x498091){this['_historyView']['removeHistoryItem'](_0x498091);}['updateItems'](_0x46d00a){this['_historyView']['updateHistoryItemsWithCategories'](_0x46d00a);}['updateItemTitle'](_0x18bc7e,_0x440fcf){this['_historyView']['updateItemTitle'](_0x18bc7e,_0x440fcf);}['updateItemLoadingState'](_0x36647b,_0x2769c9,_0x1736ac){this['_historyView']['updateItemLoadingState'](_0x36647b,_0x2769c9,_0x1736ac);}['setLoadingSkeleton'](_0x255915){this['_historyView']['isLoading']=_0x255915;}['showError'](_0x5f239a){this['_historyView']['errorMessage']=_0x5f239a;}['hideError'](){this['_historyView']['errorMessage']='';}['setIsMaximized'](_0x51ad3f){this['_historyView']['isMaximized']=_0x51ad3f;}}class aa extends ht(){['id'];['createdAt'];constructor({id:_0x23b692,title:_0x1bf646,createdAt:_0x42f587,updatedAt:_0xee1512,pinned:_0x496d01}){super(),this['id']=_0x23b692,this['createdAt']=new Date(_0x42f587),this['set']('title',_0x1bf646),this['set']('updatedAt',_0xee1512?new Date(_0xee1512):null),this['set']('pinned',_0x496d01||!0x1);}['updateTitle'](_0x467f5e){this['set']('title',_0x2fa763(_0x467f5e)),this['updatedAt']=new Date();}['updatePinned'](_0x51ca01){this['set']('pinned',_0x51ca01),this['updatedAt']=new Date();}}class oa extends pt(){['items']=[];['connector'];['group'];constructor({connector:_0x4136fa,group:_0x1e9147}){super(),this['connector']=_0x4136fa,this['group']=_0x1e9147;}async['init'](){try{const _0x36bb4d=this['connector']['fetchConversations'](this['group']),_0x9bcc90=await _0x36bb4d['getConversations']();this['loadItems'](_0x9bcc90);}catch(_0x2bd935){this['fire']('error',{'error':_0x2bd935,'operation':'init'});}}['addItem'](_0x29f91f){this['items']['push'](_0x29f91f);}async['removeItem'](_0x11abb6){const _0x5e216c=this['items']['findIndex'](_0x52c879=>_0x52c879['id']===_0x11abb6);if(-0x1===_0x5e216c)return!0x1;try{return await this['connector']['deleteConversation'](_0x11abb6)['execute'](),this['items']['splice'](_0x5e216c,0x1),this['fire']('itemRemoved',{'itemId':_0x11abb6}),!0x0;}catch(_0x5124de){return this['fire']('error',{'error':_0x5124de,'operation':'removeItem','itemId':_0x11abb6}),!0x1;}}['getItem'](_0x5803a4){return this['items']['find'](_0x561250=>_0x561250['id']===_0x5803a4);}async['updateItemTitle'](_0x32a77d,_0x3dcc0c){const _0x92237d=this['getItem'](_0x32a77d);if(!_0x92237d)return!0x1;try{return await this['connector']['updateConversation'](_0x32a77d,{'title':_0x3dcc0c})['getResult'](),_0x92237d['updateTitle'](_0x3dcc0c),this['fire']('itemUpdated',{'itemId':_0x32a77d,'updates':{'title':_0x3dcc0c}}),!0x0;}catch(_0x315411){return this['fire']('error',{'error':_0x315411,'operation':'updateItemTitle','itemId':_0x32a77d}),!0x1;}}async['updateItemPinned'](_0x5d0523,_0x510463){const _0x16f214=this['getItem'](_0x5d0523);if(!_0x16f214)return!0x1;try{return await this['connector']['updateConversation'](_0x5d0523,{'pinned':_0x510463})['getResult'](),_0x16f214['updatePinned'](_0x510463),this['fire']('itemUpdated',{'itemId':_0x5d0523,'updates':{'pinned':_0x510463}}),!0x0;}catch(_0x164792){return this['fire']('error',{'error':_0x164792,'operation':'updateItemPinned','itemId':_0x5d0523}),!0x1;}}['loadItems'](_0x519f13){try{this['items']=[],_0x519f13['map'](_0x4a3d1f=>{this['addItem'](new aa(_0x4a3d1f));}),this['fire']('itemsLoaded',{'items':[...this['items']]});}catch(_0x2f71a7){this['fire']('error',{'error':_0x2f71a7,'operation':'loadItems'});}}['getItems'](_0x3dada4={}){const _0x3f55da=void 0x0!==_0x3dada4['pinned']&&_0x3dada4['pinned'],_0x2f35d6=_0x3dada4['from']?new Date(_0x3dada4['from']['getFullYear'](),_0x3dada4['from']['getMonth'](),_0x3dada4['from']['getDate']()):null,_0x19dcfd=_0x3dada4['to']?new Date(_0x3dada4['to']['getFullYear'](),_0x3dada4['to']['getMonth'](),_0x3dada4['to']['getDate']()):null;return this['items']['filter'](_0x2e81a6=>{if(_0x2e81a6['pinned']!==_0x3f55da)return!0x1;if(_0x19dcfd){const _0x49da34=new Date(_0x2e81a6['createdAt']['getFullYear'](),_0x2e81a6['createdAt']['getMonth'](),_0x2e81a6['createdAt']['getDate']());return _0x2f35d6?_0x2f35d6['getTime']()===_0x19dcfd['getTime']()?_0x49da34['getTime']()===_0x2f35d6['getTime']():_0x49da34<_0x19dcfd&&_0x49da34>=_0x2f35d6:_0x49da34<_0x19dcfd;}return!0x0;});}}class ha extends _0x333531{['_aiConnector'];['_aiChatHistoryUi'];['_aiChatController'];static get['requires'](){return[rs,Ys,ra,ns];}static get['pluginName'](){return'AIChatHistoryController';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){this['_aiConnector']=this['context']['plugins']['get'](rs),this['_aiChatHistoryUi']=this['context']['plugins']['get'](ra),this['_aiChatController']=this['context']['plugins']['get'](Ys);const _0x438eb1=this['context']['plugins']['get'](ns);try{const _0x4e6f9a=this['_aiChatController']['getGroupId']();this['history']=new oa({'connector':this['_aiConnector'],'group':_0x4e6f9a}),this['listenTo'](this['_aiChatHistoryUi'],'removeConversation',(_0x5ef584,_0x56de1f)=>{this['_setItemLoading'](_0x56de1f['id'],'remove'),this['_handleRemove'](_0x56de1f['id']);}),this['listenTo'](this['_aiChatHistoryUi'],'editConversationTitle',(_0x2f2841,_0x19cc83)=>{this['_setItemLoading'](_0x19cc83['id'],'rename'),this['_handleEditTitle'](_0x19cc83['id'],_0x19cc83['title']);}),this['listenTo'](this['history'],'itemUpdated',(_0x18dc98,_0x2ce3f2)=>{void 0x0!==_0x2ce3f2['updates']['title']&&this['_aiChatHistoryUi']['updateItemTitle'](_0x2ce3f2['itemId'],_0x2ce3f2['updates']['title']),void 0x0!==_0x2ce3f2['updates']['pinned']&&this['_updateHistoryItemsUI'](),this['_clearItemLoading'](_0x2ce3f2['itemId']);}),this['listenTo'](this['history'],'itemRemoved',(_0x48c5d2,_0x384134)=>{this['_aiChatController']['_handleRemovedConversation'](_0x384134['itemId']),this['_aiChatHistoryUi']['removeHistoryItem'](_0x384134['itemId']),this['_clearItemLoading'](_0x384134['itemId']);}),this['listenTo'](this['history'],'itemsLoaded',()=>{this['_updateHistoryItemsUI']();}),this['listenTo'](this['history'],'error',(_0x1b7d01,_0x1abc3e)=>{this['_handleHistoryErrorUI'](_0x1abc3e['error'],_0x1abc3e['operation'],_0x1abc3e['itemId']);}),this['listenTo'](this['_aiChatHistoryUi'],'selectConversation',(_0x48409c,_0x401ea3)=>{this['_handleSelectConversation'](_0x401ea3['id']);}),this['listenTo'](this['_aiChatHistoryUi'],'setConversationPinned',(_0x416dd6,_0x4cb3a3)=>{const _0x3f275d=_0x4cb3a3['pinned']?'pin':'unpin';this['_setItemLoading'](_0x4cb3a3['id'],_0x3f275d),this['_handleTogglePin'](_0x4cb3a3['id'],_0x4cb3a3['pinned']);}),this['listenTo'](this['_aiChatHistoryUi'],'openChat',()=>{_0x438eb1['view']['activateTab']('chat');}),this['listenTo'](this['_aiChatController'],'change:activeConversation',()=>{this['_updateHistoryItemsUI']();}),_0x438eb1['view']['on']('activateTab:history',()=>{this['_showConversationHistory']();}),this['listenTo'](_0x438eb1,'resizedTabs',(_0xcd1796,_0xd4f88d)=>{this['_setIsMaximized'](_0xd4f88d);}),this['listenTo'](this['_aiChatHistoryUi'],'resizeTabs',()=>{_0x438eb1['resize']();});}catch(_0x1d2165){this['_handleHistoryErrorUI'](_0x1d2165,'init');}}async['_handleEditTitle'](_0x386177,_0x4b7e9f){await this['history']['updateItemTitle'](_0x386177,_0x4b7e9f);}async['_handleTogglePin'](_0x3908e5,_0x155a2a){await this['history']['updateItemPinned'](_0x3908e5,_0x155a2a);}async['_handleRemove'](_0x5e585b){await this['history']['removeItem'](_0x5e585b);}async['_handleSelectConversation'](_0x3ac1f6){await this['_aiChatController']['loadConversation'](_0x3ac1f6);}async['_showConversationHistory'](){this['_aiChatHistoryUi']['showError'](''),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x0),await this['history']['init'](),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x1);}['_updateHistoryItemsUI'](){const _0x38a683=this['_aiChatController']['activeConversation']?.['id'],_0x2deb1a=this['_getCategorizedItems']()['map'](_0x3acdb1=>({'title':_0x3acdb1['title'],'items':_0x3acdb1['items']['map'](_0x15e7ca=>({'id':_0x15e7ca['id'],'title':_0x15e7ca['title']||as(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION'),'createdAt':new Date(_0x15e7ca['createdAt'])['toLocaleDateString'](),'active':_0x15e7ca['id']===_0x38a683,'pinned':_0x15e7ca['pinned']}))}));this['_aiChatHistoryUi']['updateItems'](_0x2deb1a);}['_setItemLoading'](_0x69c0fd,_0x237fb4){this['_aiChatHistoryUi']['updateItemLoadingState'](_0x69c0fd,_0x237fb4,!0x0);}['_clearItemLoading'](_0x2b666e){this['_aiChatHistoryUi']['updateItemLoadingState'](_0x2b666e,null,!0x1);}['_handleHistoryErrorUI'](_0x2dff72,_0x37f02c,_0x28f3f7){const _0x53a52f=this['_generateErrorMessage'](_0x37f02c,_0x28f3f7);this['_aiChatHistoryUi']['showError'](_0x53a52f),_0x28f3f7&&this['_clearItemLoading'](_0x28f3f7),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x1);}['_generateErrorMessage'](_0x8a3a64,_0x5749da){const _0x225231=_0x5749da?this['history']['getItem'](_0x5749da):null,_0x21ec2a=_0x225231?.['title']||as(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION');switch(_0x8a3a64){case'updateItemTitle':return as(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_UPDATE_TITLE',_0x21ec2a);case'updateItemPinned':{const _0x226b9f=as(this['context']['locale'],_0x225231?.['pinned']?'AI_CHAT_HISTORY_UNPIN_ACTION':'AI_CHAT_HISTORY_PIN_ACTION');return as(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_UPDATE_PINNED',[_0x226b9f,_0x21ec2a]);}case'removeItem':return as(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_REMOVE_ITEM',_0x21ec2a);case'init':case'loadItems':return as(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_LOAD_ITEMS');default:return as(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_GENERIC');}}['_getCategorizedItems'](){const _0x4f9bb1=new Date(),_0x55cc3f=new Date(_0x4f9bb1['getFullYear'](),_0x4f9bb1['getMonth'](),_0x4f9bb1['getDate']()),_0x31fb31=new Date(_0x55cc3f);_0x31fb31['setDate'](_0x31fb31['getDate']()-0x1);const _0x557e9b=new Date(_0x55cc3f);_0x557e9b['setDate'](_0x557e9b['getDate']()-0xe);const _0x460bc3=this['history']['getItems']({'pinned':!0x0}),_0x381888=this['history']['getItems']({'from':_0x55cc3f,'to':_0x55cc3f}),_0x4a35a2=this['history']['getItems']({'from':_0x31fb31,'to':_0x31fb31}),_0x4ba7e2=this['history']['getItems']({'from':_0x557e9b,'to':_0x31fb31}),_0x2d169d=this['history']['getItems']({'to':_0x557e9b}),_0x385dcf=[];return _0x460bc3['length']>0x0&&_0x385dcf['push']({'title':as(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_PINNED'),'items':_0x460bc3}),_0x381888['length']>0x0&&_0x385dcf['push']({'title':as(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_TODAY'),'items':_0x381888}),_0x4a35a2['length']>0x0&&_0x385dcf['push']({'title':as(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_YESTERDAY'),'items':_0x4a35a2}),_0x4ba7e2['length']>0x0&&_0x385dcf['push']({'title':as(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_LAST_14_DAYS'),'items':_0x4ba7e2}),_0x2d169d['length']>0x0&&_0x385dcf['push']({'title':as(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_LATER'),'items':_0x2d169d}),_0x385dcf;}['_setIsMaximized'](_0x52735a){this['_aiChatHistoryUi']['setIsMaximized'](_0x52735a);}}class ca extends _0x333531{static get['requires'](){return[ha,ra];}static get['pluginName'](){return'AIChatHistory';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class la extends _0x333531{static get['requires'](){return[Ys,qs,Zr,ca];}static get['pluginName'](){return'AIChat';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x486554){super(_0x486554),this['context']['config']['define']('ai.chat.context',{'document':{'enabled':!0x0},'urls':{'enabled':!0x0},'files':{'enabled':!0x0},'sources':[],'alwaysAddSelection':!0x1}),this['context']['config']['define']('ai.chat.initialConversation','new');}}class ua extends kt{['id'];constructor(_0x4447b7,_0x43c30a){super(_0x4447b7);const {id:_0x415aad,type:_0x2fecdf,icon:_0x5cdc92}=_0x43c30a;this['id']=_0x415aad,this['set']({'label':_0x43c30a['label'],'withText':!0x0,'class':'ck-ai-chat-shortcut'}),this['extendTemplate']({'attributes':{'data-cke-ai-shortcut-id':_0x43c30a['id']}}),_0x5cdc92?this['icon']=_0x5cdc92:'chat'===_0x2fecdf?this['icon']=_0x20ae05:'review'===_0x2fecdf?this['icon']=_0x5d7a94:'translate'===_0x2fecdf&&(this['icon']=_0x20525b);}}class da extends Nt{['listView'];constructor(_0x139b7a,_0x394579){super(_0x139b7a);const _0x5c06a1=_0x394579['map'](_0x499e55=>{const _0x3cca92=new Pt(this['locale']),_0x467842=new ua(this['locale'],_0x499e55);return _0x3cca92['children']['add'](_0x467842),_0x467842['delegate']('execute')['to'](this),_0x3cca92;});this['listView']=new Lt(this['locale']),this['listView']['items']['addMany'](_0x5c06a1),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat-shortcuts']},'children':[this['listView']]});}}const _a='chat-shortcuts';class Aa extends _0x333531{['_shortcuts'];['_shortcutsView'];['_aiChatUI'];static get['requires'](){return[Zr];}static get['pluginName'](){return'AIChatShortcuts';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){this['_aiChatUI']=this['context']['plugins']['get'](Zr),this['_shortcuts']=this['context']['config']['get']('ai.chat.shortcuts')??[];const _0x22f4d6=this['context']['plugins']['get']('AIChatController');this['_shortcuts']['length']&&(this['_validateShortcuts'](),this['_aiChatUI']['on']('conversationCreated',()=>{_0x22f4d6['activeConversation']['isFromHistory']||this['_injectShortcuts']();}),this['listenTo'](_0x22f4d6,'interactionStarted',()=>{this['_removeShortcuts']();}));}['_validateShortcuts'](){const _0x1fcb4d=['chat','review','translate'];this['_shortcuts']['forEach'](_0xcd3684=>{let _0x4c34c4=!0x0;if(_0xcd3684['id']&&_0xcd3684['label']&&_0x1fcb4d['includes'](_0xcd3684['type'])?'chat'===_0xcd3684['type']&&(_0x4c34c4='string'==typeof _0xcd3684['prompt']):_0x4c34c4=!0x1,!_0x4c34c4)throw new ot('ai-chat-shortcuts-invalid-config',this['context'],{'shortcut':_0xcd3684});});}['_injectShortcuts'](){const _0x27ed81=this['context']['plugins']['get'](Zr);this['_shortcutsView']=new da(this['context']['locale'],this['_shortcuts']),this['_shortcutsView']['render'](),_0x27ed81['addFeedItemCustomElement'](this['_shortcutsView']['element'],_a),this['_shortcutsView']['on']('execute',_0x4edcae=>{const _0x3dee1a=_0x4edcae['source']['id'];this['_executeShortcut'](_0x3dee1a);});}['_removeShortcuts'](){const _0x39ce72=this['context']['plugins']['get'](Zr);_0x39ce72['hasFeedItem'](_a)&&_0x39ce72['removeFeedItem'](_a),this['_shortcutsView']?.['destroy']();}['_executeShortcut'](_0x1b518a){const _0x1a7f14=this['_shortcuts']['find'](_0x45d39b=>_0x45d39b['id']===_0x1b518a),_0x5e345b=_0x1a7f14['type'];'chat'===_0x5e345b?this['_runChatShortcut'](_0x1a7f14):'review'===_0x5e345b?_0x1a7f14['commandId']?this['_runReviewShortcut'](_0x1a7f14):this['_switchTab']('reviewMode'):'translate'===_0x5e345b&&(_0x1a7f14['language']?this['_runTranslateShortcut'](_0x1a7f14):this['_switchTab']('translate'));}['_switchTab'](_0xbbda13){if(!this['context']['plugins']['has']('AITabs'))throw new ot('ai-chat-shortcuts-ai-tabs-not-found',this['context'],{'tabName':_0xbbda13});this['context']['plugins']['get']('AITabs')['view']['activateTab'](_0xbbda13);}async['_runChatShortcut']({prompt:_0x5287d0,draftMode:_0x4a6825,useWebSearch:_0x2c0263=!0x1,useReasoning:_0x7058a0=!0x1,model:_0x1db7f2}){const _0x524fcd=this['context']['plugins']['get']('AIChatController'),_0x49368c=_0x524fcd['activeConversation'];let _0xa856da;_0xa856da=_0x1db7f2?await _0x49368c['chatModels']['getModel'](_0x1db7f2):await _0x49368c['chatModels']['getDefault'](),_0xa856da&&await _0x49368c['setModel'](_0xa856da),_0x49368c['setWebSearch'](_0x2c0263),_0x49368c['setReasoning'](_0x7058a0),_0x524fcd['addCurrentDocumentToChatContext'](),_0x4a6825?(this['_aiChatUI']['setPromptInputValue'](_0x5287d0),this['_aiChatUI']['focusPromptInput'](!0x0)):_0x524fcd['sendMessage']({'message':_0x5287d0});}['_runReviewShortcut']({commandId:_0x1a775d,model:_0x2de05e,prompt:_0x47db34,params:_0x4adbf6}){if(!this['context']['plugins']['has']('AIReviewModeUI'))throw new ot('ai-chat-shortcuts-review-mode-not-found',this['context']);this['_switchTab']('reviewMode');const _0x119abe={'id':_0x1a775d,'isCustom':'custom'===_0x1a775d};_0x2de05e&&_0x47db34&&(_0x119abe['args']={'model':_0x2de05e,'prompt':_0x47db34}),_0x4adbf6&&(_0x119abe['params']=_0x4adbf6),this['context']['plugins']['get']('AIReviewModeUI')['fire']('runReviewCheck',_0x119abe);}['_runTranslateShortcut']({language:_0x173dbe}){if(!this['context']['plugins']['has']('AITranslateUI'))throw new ot('ai-chat-shortcuts-translate-not-found',this['context']);this['_switchTab']('translate'),this['context']['plugins']['get']('AITranslateUI')['fire']('runReviewCheck',{'id':_0x173dbe,'args':{'language':_0x173dbe}});}}class ga extends _0x46077b{constructor(_0x2833c8){super(_0x2833c8);const _0x1fb6a0=_0x2833c8['plugins']['get']('AITabs')['view'];this['bind']('value')['to'](_0x1fb6a0,'isVisible'),this['isEnabled']=!0x0;}['execute'](){const _0x55ac64=this['editor']['plugins']['get']('AITabs')['view'];_0x55ac64['isVisible']=!_0x55ac64['isVisible'];}}class Ia extends _0x2db8aa{static get['requires'](){return[ns];}static get['pluginName'](){return'AIToggleButtonUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x2b1456=this['editor'];_0x2b1456['commands']['add']('toggleAi',new ga(_0x2b1456)),_0x2b1456['ui']['componentFactory']['add']('toggleAi',()=>{const _0x3c25ab=this['_createAIUIButton'](kt);return _0x3c25ab['set']({'tooltip':!0x0,'class':'ck-ai-toggle-button'}),_0x3c25ab;}),_0x2b1456['ui']['componentFactory']['add']('menuBar:toggleAi',()=>{const _0x522c09=this['_createAIUIButton'](Kt);return _0x522c09['set']({'role':'menuitemcheckbox'}),_0x522c09;});}['_createAIUIButton'](_0x5e810e){const _0x45456f=this['editor'],_0x4cdda0=_0x45456f['commands']['get']('toggleAi'),_0x58e894=new _0x5e810e(_0x45456f['locale']);return _0x58e894['set']({'label':as(_0x45456f['locale'],'AI_TOGGLE_BUTTON_LABEL'),'icon':_0x2f67c4,'isToggleable':!0x0}),_0x58e894['bind']('isEnabled')['to'](_0x4cdda0),_0x58e894['bind']('isOn')['to'](_0x4cdda0,'value',_0xd8474b=>!!_0xd8474b),this['listenTo'](_0x58e894,'execute',()=>{_0x4cdda0['execute']();}),_0x58e894;}}const Ea=['applySuggestion','insertSuggestion','showNext','showPrevious'];class Ta extends Nt{['_errorView'];constructor(_0x42061a){super(_0x42061a),this['set']('_errorMessage',''),this['set']('_isErrorVisible',!0x1);}['showBlockingError'](_0x7fbd51){this['showError'](_0x7fbd51);}['showError'](_0x2d89f9){this['_errorView']||(this['_errorView']=this['_createErrorView']()),this['_errorMessage']=_0x2d89f9,this['_isErrorVisible']=!0x0;}['hideError'](){this['_isErrorVisible']=!0x1;}['_createErrorView'](){const _0x15e819=new Nt(this['locale']),_0x2bdd84=new Nt(this['locale']);return _0x2bdd84['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-suggestion__error-text']},'children':[{'text':this['bindTemplate']['to']('_errorMessage')}]}),_0x15e819['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__error','ck-ai-balloon-error',this['bindTemplate']['if']('_isErrorVisible','ck-hidden',_0x422379=>!_0x422379)]},'children':[_0x2bdd84]}),_0x15e819;}}const pa=0xa;class ma extends _0x333531{static get['requires'](){return[qs];}static get['pluginName'](){return'AIBalloon';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['isOpen']=!0x1;['_currentConfig'];['_isUpdatingMarkers']=!0x1;['open'](_0x6e6c93){const {id:_0xf960ac}=this['_currentConfig']??{};this['_currentConfig']=_0x6e6c93;const {id:_0x56f31d}=this['_currentConfig'];this['isOpen']&&_0xf960ac===_0x56f31d?this['_updateDialog']():this['_showDialog']();}['close'](){const _0x50d895=Fs(this['context'])['plugins']['get']('Dialog');_0x50d895['isOpen']&&this['_currentConfig']&&_0x50d895['id']===this['_currentConfig']['id']&&_0x50d895['hide']();}['_updateDialog'](){const _0x47aa02=Fs(this['context'])['plugins']['get']('Dialog'),{icon:_0x39a759,title:_0x288c86}=this['_currentConfig'];_0x47aa02['view']?.['headerView']&&(_0x47aa02['view']['headerView']['label']=_0x288c86,_0x47aa02['view']['headerView']['iconView']&&_0x39a759&&(_0x47aa02['view']['headerView']['iconView']['content']=_0x39a759)),this['_isUpdatingMarkers']=!0x0,this['_showFakeVisualSelection'](),this['_isUpdatingMarkers']=!0x1,_0x47aa02['view']?.['updatePosition']();}['_showFakeVisualSelection'](){this['context']['plugins']['get'](qs)['showFakeVisualSelection']({'ranges':this['_currentConfig']['ranges'],'id':'balloon','priority':0x64}),window['getSelection']()?.['removeAllRanges']();}['_hideFakeVisualSelection'](){this['context']['plugins']['get'](qs)['hideFakeVisualSelection']('balloon');}['_showDialog'](){const _0xc948c7=Fs(this['context'])['plugins']['get']('Dialog'),{id:_0x5dd875,title:_0x4fd9de,icon:_0x1624a1,class:_0x15e982,mainView:_0x5d2bfa}=this['_currentConfig'];_0x5d2bfa['delegate'](...Ea)['to'](this),_0xc948c7['show']({'title':_0x4fd9de,'icon':_0x1624a1,'hasCloseButton':!0x0,'id':_0x5dd875,'position':this['_calculateDialogPosition']['bind'](this),'className':'ck-ai-balloon\x20'+(_0x15e982||''),'content':_0x5d2bfa,'onShow':_0x4040b2=>{this['_showFakeVisualSelection'](),this['_setupFakeVisualSelectionMarkerRemovalListener']();const _0x14c8ad=this['_getSelectionElements']();_0x14c8ad&&_0x14c8ad[0x0]&&mt({'target':_0x14c8ad[0x0],'ancestorOffset':0x14,'alignToTop':!0x0,'viewportOffset':{'top':0x14,'bottom':0x14,'left':0x0,'right':0x0}}),this['isOpen']=!0x0,_0x4040b2['once']('hide',()=>{this['fire']('beforeDialogClosed',{'id':_0x5dd875});},{'priority':'high'});},'onHide':()=>{this['_hideFakeVisualSelection'](),this['_cleanupFakeVisualSelectionMarkerRemovalListener'](),this['fire']('dialogClosed',{'id':_0x5dd875}),this['isOpen']=!0x1;}});}['_calculateDialogPosition'](_0xe09ce9,_0x3e285b){if(!_0x3e285b)return null;const _0x43b6e8=this['_getSelectionElements']();if(!_0x43b6e8||0x0===_0x43b6e8['length'])return{'left':Math['round'](_0x3e285b['left']+_0x3e285b['width']/0x2-_0xe09ce9['width']/0x2),'top':Math['round'](_0x3e285b['top']+_0x3e285b['height']/0x2-_0xe09ce9['height']/0x2)};const _0x3e36f7=Math['round'](_0x3e285b['left']+_0x3e285b['width']/0x2-_0xe09ce9['width']/0x2),_0x2c70b2=_0x43b6e8['map'](_0x39ec5e=>new ut(_0x39ec5e)),_0x999abc=_0xe09ce9['height'];return{'left':_0x3e36f7,'top':this['_calculateOptimalTopPosition'](_0x2c70b2,_0x999abc,_0x3e285b)};}['_calculateOptimalTopPosition'](_0x1e3a06,_0x580d05,_0x5aec6f){const _0x3ff17a=new ut(ct['window']),_0x5cb530=_0x1e3a06['map'](_0x224a3d=>_0x224a3d['getVisible']())['filter'](_0x57b527=>_0x57b527),_0x3f4ac2=ut['getBoundingRect'](_0x5cb530);if(!_0x3f4ac2)return Math['round'](_0x5aec6f['top']+_0x5aec6f['height']/0x2);const _0x2c41bf=_0x3ff17a['getIntersection'](_0x3f4ac2);if(!_0x2c41bf)return Math['round'](_0x5aec6f['top']+_0x5aec6f['height']/0x2);const _0x197d41=_0x5aec6f['getVisible'](),_0x1301de=_0x197d41&&_0x3f4ac2['height']>_0x197d41['height'],_0x115852=_0x2c41bf['top'],_0x53e885=_0x2c41bf['bottom'];if(_0x1301de){const _0x49b26b=(_0x197d41||_0x3ff17a)['height']/0x2-_0x580d05/0x2,_0xb1a7de=_0x115852-pa-_0x5aec6f['top'],_0x17c8a1=_0x5aec6f['bottom']-_0x53e885-pa;return _0xb1a7de>=_0x580d05?Math['max'](pa,_0x115852-_0x580d05-pa):_0x17c8a1>=_0x580d05?_0x53e885+pa:Math['max'](pa,_0x49b26b);}const _0x5cfb44=_0x115852-_0x580d05,_0x2181c8=_0x5aec6f['bottom']-_0x53e885-pa,_0x5c642e=_0x115852-pa-_0x5aec6f['top'];let _0x256925;if(_0x2181c8>=_0x580d05)_0x256925=_0x53e885+pa;else{if(_0x5c642e>=_0x580d05)_0x256925=_0x5cfb44-pa;else _0x256925=_0x115852+_0x3f4ac2['height']/0x2-_0x580d05/0x2;}return _0x256925;}['_setupFakeVisualSelectionMarkerRemovalListener'](){const _0x35f975=Fs(this['context']);this['listenTo'](_0x35f975['model']['document'],'change',()=>{if(!this['_isUpdatingMarkers']){for(const {name:_0x40ce3b,data:{newRange:_0x3a2b23}}of _0x35f975['model']['document']['differ']['getChangedMarkers']())if(_0x40ce3b['startsWith']($s+':')&&(_0x3a2b23&&(_0x3a2b23['start']['isEqual'](_0x3a2b23['end'])||'$graveyard'==_0x3a2b23['root']['rootName'])||null==_0x3a2b23)){const _0x61a838=as(this['context']['locale'],'AI_BALLOON_SELECTION_REMOVED_ERROR');this['_currentConfig']['mainView']['showBlockingError'](_0x61a838),this['fire']('selectionRemoved');}}});}['_cleanupFakeVisualSelectionMarkerRemovalListener'](){const _0x16e5ba=Fs(this['context']);this['_currentConfig']['mainView']['hideError'](),this['stopListening'](_0x16e5ba['model']['document']);}['_getSelectionElements'](){const _0x281822=Fs(this['context']);return _0x395590(_0x281822['editing'],[..._0x281822['model']['markers']['getMarkersGroup']('ai-selection'),..._0x281822['model']['markers']['getMarkersGroup']('ai-balloon-selection')]);}}class Ca extends Ot{['copyButton'];['likeButton'];['dislikeButton'];['showChangesButton'];['_config'];constructor(_0x3cb0ac,_0x2b2572={}){super(_0x3cb0ac),this['set']('isEnabled',!0x0),this['set']('isShowChangesOn',!0x1),this['_config']={'showCopy':!0x1,'showLike':!0x1,'showDislike':!0x1,..._0x2b2572};const _0x1e86a6=!(this['_config']['showCopy']||this['_config']['showChanges']||this['_config']['showLike']||this['_config']['showDislike']||this['_config']['customView']?.['length']);this['class']=_0x1e86a6?'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'](_0x3ac0fc){this['showChangesButton']['isEnabled']=_0x3ac0fc;}['_setupRatingButtons'](){this['likeButton']=new kt(this['locale']),this['likeButton']['set']({'icon':_0x4bad33,'label':as(this['locale'],'AI_MINI_TOOLBAR_LIKE'),'class':cs,'tooltip':!0x0}),this['likeButton']['bind']('isEnabled')['to'](this),this['likeButton']['on']('execute',()=>{this['fire']('like');}),this['dislikeButton']=new kt(this['locale']),this['dislikeButton']['set']({'icon':_0x10e733,'label':as(this['locale'],'AI_MINI_TOOLBAR_DISLIKE'),'class':cs,'tooltip':!0x0}),this['dislikeButton']['bind']('isEnabled')['to'](this),this['dislikeButton']['on']('execute',()=>{this['fire']('dislike');});}['_setupCopyButton'](){this['copyButton']=new kt(this['locale']),this['copyButton']['set']({'icon':_0x1f3e9a,'label':as(this['locale'],'AI_MINI_TOOLBAR_COPY'),'class':'ck-ai-mini-toolbar-copy-button\x20'+cs,'tooltip':!0x0}),this['copyButton']['bind']('isEnabled')['to'](this);const _0x5d47a8=new yt();_0x5d47a8['set']({'content':_0x253f15}),_0x5d47a8['extendTemplate']({'attributes':{'class':['ck-ai-mini-toolbar-copy-button__check-mark']}}),this['copyButton']['on']('execute',()=>{this['copyButton']['class']='ck-ai-mini-toolbar-copy-button\x20ck-ai-mini-toolbar-copy-button_copied\x20'+cs,setTimeout(()=>{this['copyButton']['class']='ck-ai-mini-toolbar-copy-button\x20'+cs;},0x7d0);}),this['copyButton']['children']['add'](_0x5d47a8);}['_setupShowChangesButton'](){this['showChangesButton']=new kt(this['locale']),this['showChangesButton']['set']({'icon':_0x55a63e,'label':as(this['locale'],'AI_SUGGESTION_BUTTON_SHOW_CHANGES'),'withText':'full'==this['_config']['showChanges'],'tooltip':'full'!=this['_config']['showChanges'],'class':cs}),this['showChangesButton']['bind']('isOn')['to'](this,'isShowChangesOn'),this['showChangesButton']['bind']('isEnabled')['to'](this),this['showChangesButton']['bind']('icon')['to'](this,'isShowChangesOn',_0x533ec5=>_0x533ec5?_0x43f29c:_0x55a63e),this['showChangesButton']['on']('execute',()=>{this['fire']('toggleShowChanges');});}}class wa extends Ta{['children'];['nextButtonView'];['previousButtonView'];['focusCycler'];['_focusables'];['_focusTracker'];['_keystrokes'];['_config'];['_streamableContentView'];['_toolbarContainerView'];['_partToolbarView'];['_stateView'];['_miniToolbarView'];constructor(_0x43b94a,_0x34d1f4){super(_0x43b94a);const _0x3f2474=this['bindTemplate'];this['set']('showDiff',!0x1),this['set']('_state','pending'),this['_focusTracker']=new _t(),this['_keystrokes']=new At(),this['_focusables']=this['createCollection'](),this['focusCycler']=new Mt({'focusables':this['_focusables'],'focusTracker':this['_focusTracker'],'keystrokeHandler':this['_keystrokes'],'actions':{'focusPrevious':'shift\x20+\x20tab','focusNext':'tab'}}),this['_config']=_0x34d1f4,this['nextButtonView']=this['_createNextButtonView'](),this['previousButtonView']=this['_createPreviousButtonView'](),this['_streamableContentView']=new un(_0x43b94a),this['_partToolbarView']=new hn(_0x43b94a,_0x34d1f4['availableActions']),this['_partToolbarView']['delegate']('applySuggestion','insertSuggestion','rejectSuggestion')['to'](this),this['_togglePartToolbarButtonsVisibility'](_0x34d1f4),this['_stateView']=new an(_0x43b94a),this['_stateView']['isVisible']=!0x1,this['_miniToolbarView']=new Ca(_0x43b94a,{'showChanges':'full'}),this['_miniToolbarView']['bind']('isShowChangesOn')['to'](this,'showDiff'),this['_miniToolbarView']['on']('toggleShowChanges',()=>{this['fire']('toggleSuggestionDisplayMode');}),this['_toolbarContainerView']=new fa(_0x43b94a,[this['_partToolbarView'],this['_stateView'],this['_miniToolbarView']]),this['children']=this['createCollection']([this['_streamableContentView'],this['_toolbarContainerView']]),this['on']('change:_state',(_0x344f57,_0x258ecc,_0x3665a5,_0x34627d)=>{let _0x58105f,_0x220745;'pending'===_0x34627d?(_0x58105f=this['_partToolbarView'],_0x220745=this['_stateView']):(_0x58105f=this['_stateView'],_0x220745=this['_partToolbarView']),this['_stateView']['setState'](_0x3665a5),_0x58105f['isVisible']=!0x1,_0x220745['isVisible']=!0x0;}),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat-balloon-main',_0x3f2474['to']('_state',_0x3cb731=>'ck-ai-chat-balloon-main_state_'+_0x3cb731)]},'children':this['children']}),this['on']('change:isTrackChangesOn',()=>{this['_togglePartToolbarButtonsVisibility'](_0x34d1f4);});}['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'](_0x219f1a){_0x219f1a?.['keepErrors']||this['hideError'](),await this['_streamableContentView']['update'](_0x219f1a);}['setState'](_0x307a4c){this['_state']=_0x307a4c;}['showError'](_0x2052c3){super['showError'](_0x2052c3),this['children']['has'](this['_errorView'])||this['children']['add'](this['_errorView'],0x0);}['hideError'](){this['_isErrorVisible']&&(super['hideError'](),this['togglePartToolbarEnabled'](!0x0));}['showBlockingError'](_0x24808a){super['showBlockingError'](_0x24808a),this['togglePartToolbarEnabled'](!0x1);}['toggleRotatorButtonsVisibility'](_0x379b08){this['nextButtonView']['isVisible']=this['previousButtonView']['isVisible']=_0x379b08;}['togglePartToolbarEnabled'](_0x5afd3b){this['_partToolbarView']['isEnabled']=_0x5afd3b;}['_togglePartToolbarButtonsVisibility']({showApplyButton:_0x29501f,showSuggestButton:_0x5bf8dd}){_0x29501f=_0x29501f&&!this['isTrackChangesOn']&&this['_config']['availableActions']['includes']('applySuggestion'),_0x5bf8dd=_0x5bf8dd&&this['_config']['availableActions']['includes']('insertSuggestion'),this['_partToolbarView']['setButtonsVisibility']({'showApplyButton':_0x29501f,'showSuggestButton':_0x5bf8dd});}['_createNextButtonView'](){const _0xf15e87=new kt(this['locale']);return _0xf15e87['set']({'icon':_0x5ade8b,'label':as(this['locale'],'AI_BALLOON_NEXT_LABEL'),'isVisible':!0x0}),_0xf15e87['on']('execute',()=>{this['fire']('showNext');}),_0xf15e87;}['_createPreviousButtonView'](){const _0x1c15c2=new kt(this['locale']);return _0x1c15c2['set']({'icon':_0x4c2017,'label':as(this['locale'],'AI_BALLOON_PREVIOUS_LABEL'),'isVisible':!0x0}),_0x1c15c2['on']('execute',()=>{this['fire']('showPrevious');}),_0x1c15c2;}}class fa extends Nt{constructor(_0x3361ef,_0x2ef8ed){super(_0x3361ef),this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-balloon__toolbar-container']},'children':_0x2ef8ed});}}class Sa extends _0x2db8aa{static get['requires'](){return[Vt,ma];}static get['pluginName'](){return'AIChatBalloon';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['_chatBalloonView'];constructor(_0x504d22){super(_0x504d22),this['set']('showDiff',!0x1);}['open'](_0x2d76c1){const _0x15397e=this['editor'];this['_chatBalloonView']||(this['_chatBalloonView']=this['_createChatBalloonView']()),_0x15397e['plugins']['get']('AIBalloon')['open']({..._0x2d76c1,'id':'aiChatBalloon','class':'ck-ai-chat-balloon','mainView':this['_chatBalloonView']}),this['_toggleRotatorButtonsInDialogHeader'](_0x2d76c1['showRotator']),this['_chatBalloonView']['togglePartToolbarEnabled'](!_0x2d76c1['areActionsDisabled']),this['_restoreDefaultViewFocus']();}['close'](){this['editor']['plugins']['get']('AIBalloon')['close']();}['updateContent'](_0x1cfb46){return this['_chatBalloonView']||(this['_chatBalloonView']=this['_createChatBalloonView']()),this['_chatBalloonView']['updateContent'](_0x1cfb46);}['setState'](_0x470beb){this['_chatBalloonView']&&this['_chatBalloonView']['setState'](_0x470beb);}['_createChatBalloonView'](){const _0x34dbd2=this['editor'],_0x4da1d9=_0x34dbd2['plugins']['get']('AIBalloon'),_0x47dccf=_0x34dbd2['commands']['get']('trackChanges');let _0x29b919=_0x34dbd2['config']['get']('ai.availableReplyActions')||[...gn];_0x34dbd2['plugins']['has']('TrackChanges')||(_0x29b919=_0x29b919['filter'](_0x412bd2=>'insertSuggestion'!=_0x412bd2));const _0x464a5b=new wa(_0x34dbd2['locale'],{'availableActions':_0x29b919,'showApplyButton':!0x0,'showSuggestButton':!!_0x47dccf});return _0x464a5b['bind']('showDiff')['to'](this),_0x464a5b['delegate'](...Qs)['to'](this),_0x464a5b['delegate']('showPrevious','showNext')['to'](this),_0x4da1d9['delegate']('dialogClosed')['to'](this),_0x464a5b['on']('applySuggestion',this['_restoreDefaultViewFocus']['bind'](this)),_0x464a5b['on']('insertSuggestion',this['_restoreDefaultViewFocus']['bind'](this)),_0x464a5b['on']('rejectSuggestion',this['_restoreDefaultViewFocus']['bind'](this)),_0x47dccf&&_0x464a5b['bind']('isTrackChangesOn')['to'](_0x47dccf,'value'),_0x464a5b['render'](),_0x464a5b;}['_toggleRotatorButtonsInDialogHeader'](_0x339002){const _0x1f716f=this['editor'],_0x2de6d9=_0x1f716f['plugins']['get']('Dialog')['view']['headerView']['children'];this['_chatBalloonView']['toggleRotatorButtonsVisibility'](_0x339002),_0x2de6d9['has'](this['_chatBalloonView']['previousButtonView'])||(_0x2de6d9['addMany']([this['_chatBalloonView']['previousButtonView'],this['_chatBalloonView']['nextButtonView']],0x0),_0x1f716f['plugins']['get']('AIBalloon')['once']('beforeDialogClosed',()=>{_0x2de6d9['remove'](this['_chatBalloonView']['previousButtonView']),_0x2de6d9['remove'](this['_chatBalloonView']['nextButtonView']);}));}['_restoreDefaultViewFocus'](){this['_chatBalloonView']['focus']();}}class ba extends _0x2db8aa{static get['requires'](){return[Ia,Sa,_0x47af91];}static get['pluginName'](){return'AIEditorIntegration';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}function Ra(_0x4bf2f9){const {editor:_0x343860,action:_0x364211,withText:_0x320654=!0x1,withIcon:_0xd8c8a3=!0x0,isInDropdown:_0x4fba51=!0x0,shouldPreventFocus:_0x4e160f=!0x1}=_0x4bf2f9;return()=>{const _0x26389e=_0x343860['locale'],_0x2ebeb1=new kt(_0x26389e),_0x4e6776=_0x2ebeb1['bindTemplate'];_0x4fba51&&_0x2ebeb1['extendTemplate']({'on':{'mouseenter':_0x4e6776['to'](()=>{_0x4e160f&&_0x4e160f()||_0x2ebeb1['focus']();})}});const _0x6fc929=_0x364211['icon']??_0x364211['parent']?.['icon'];return _0x2ebeb1['set']({'label':_0x364211['label'],'withText':_0x320654,'role':'menuitem','icon':_0xd8c8a3?_0x6fc929??_0xadd0ff:void 0x0,'tooltip':!_0x320654,'class':'ck-ai-quick-actions-button','isEnabled':_0x364211['isEnabled']}),_0x2ebeb1['on']('execute',()=>{_0x343860['editing']['view']['focus'](),_0x343860['commands']['execute']('aiQuickAction',_0x364211);}),_0x2ebeb1;};}class Oa extends _0x575b1f{['arrowView'];constructor(_0x49bd71,_0x20a126){super(_0x49bd71,_0x20a126);const _0x3e8048=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',_0xab6c48=>String(_0xab6c48)),'data-cke-tooltip-disabled':_0x3e8048['to']('isOn')},'on':{'mouseenter':_0x3e8048['to']('mouseenter')}});}['render'](){super['render'](),this['children']['add'](this['arrowView']);}['_createArrowView'](){const _0x27bdbc=new yt();return _0x27bdbc['content']=_0x35eca3,_0x27bdbc['extendTemplate']({'attributes':{'class':'ck-dropdown-menu-list__nested-menu__button__arrow'}}),_0x27bdbc;}}class ka extends Lt{['_allListItems'];['_allSearchableItems'];constructor(_0x5e8c9e,_0x2cffe7,_0x11aff3){super(_0x5e8c9e),this['_allListItems']=_0x2cffe7,this['_allSearchableItems']=_0x11aff3;}['filter'](_0x57d2ac){if(!_0x57d2ac)return this['items']['clear'](),this['items']['addMany'](this['_allListItems']),this['_clearHighlight'](),{'resultsCount':this['_allListItems']['length'],'totalItemsCount':this['_allListItems']['length']};const _0xb2521d=_0x57d2ac['source']['toLowerCase']()['trim'](),_0x30052e=this['_allSearchableItems']['filter'](_0x50e81d=>(_0x50e81d['groupLabel']?_0x50e81d['label']+'\x20('+_0x50e81d['groupLabel']+')':_0x50e81d['label'])['toLowerCase']()['includes'](_0xb2521d));return this['items']['clear'](),this['items']['addMany'](_0x30052e['sort']((_0x4fa7c4,_0xd33c7e)=>{const _0x3657c0=_0x4fa7c4['groupLabel'],_0x2340f0=_0xd33c7e['groupLabel'];return _0x3657c0||_0x2340f0?_0x3657c0?0x1:-0x1:0x0;})['map'](_0x554353=>_0x554353['item'])),this['_highlightQuery'](_0xb2521d,_0x30052e),{'resultsCount':_0x30052e['length'],'totalItemsCount':this['_allSearchableItems']['length']};}['_highlightQuery'](_0x5c45bb,_0x255191){if(!_0x5c45bb)return;const _0x3b9a38=new RegExp(_0xe514b6(_0x5c45bb),'gi');_0x255191['forEach'](_0x1de920=>{_0x1de920['highlightViews']&&_0x1de920['highlightViews']['forEach'](_0x5d0622=>{'function'==typeof _0x5d0622['highlightText']&&_0x5d0622['highlightText'](_0x3b9a38);});});}['_clearHighlight'](){this['_allSearchableItems']['forEach'](_0x51842c=>{_0x51842c['highlightViews']&&_0x51842c['highlightViews']['forEach'](_0x274424=>{'function'==typeof _0x274424['highlightText']&&_0x274424['highlightText'](null);});});}}const Na='menu',va='menuitem';class ya extends Nt{['_bodyCollection'];['optionsListView'];['_searchTextView']=null;['_allSearchableItems']=[];['children'];['focusTracker'];['keystrokes'];['_focusables'];['focusCycler'];['_openNestedPanels']=new Set();['_hasSearch'];constructor(_0x4e0b65,_0x3085b1,_0x52b7ae,_0x108598,_0x39cdc6=!0x1){const _0x195416=_0x4e0b65['locale'];super(_0x195416),this['_bodyCollection']=_0x108598,this['_hasSearch']=_0x39cdc6;const _0x4726b=this['_createListItems'](_0x4e0b65,_0x3085b1,_0x52b7ae);this['optionsListView']=new ka(_0x195416,_0x4726b,this['_allSearchableItems']),this['optionsListView']['role']=Na,this['optionsListView']['items']['addMany'](_0x4726b),this['focusTracker']=new _t(),this['keystrokes']=new At(),_0x39cdc6&&(this['_searchTextView']=this['_createSearchTextView']()),this['_focusables']=_0x4726b,this['focusCycler']=new Mt({'focusables':this['_focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes']}),_0x39cdc6&&this['_searchTextView']&&this['focusCycler']['chain'](this['_searchTextView']['focusCycler']);const _0x17cbf6=_0x39cdc6&&this['_searchTextView']?[this['_searchTextView']]:[this['optionsListView']];this['children']=new _0x5ba55d(_0x17cbf6),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-ai-quick-actions','ck-rounded-corners'],'dir':_0x195416['uiLanguageDirection']},'children':this['children']});}['_createSearchTextView'](){return new _0x39d3b1(this['locale'],{'filteredView':this['optionsListView'],'queryView':{'label':as(this['locale'],'AI_QUICK_ACTIONS_SEARCH')},'class':'ck-ai-quick-actions-search','infoView':{'text':{'notFound':{'primary':as(this['locale'],'AI_QUICK_ACTIONS_SEARCH_NOT_FOUND')}}}});}['_isSearchFocused'](){if(!this['_hasSearch']||!this['_searchTextView']||!this['_searchTextView']['queryView']['fieldView']['element'])return!0x1;const _0x169a84=this['_searchTextView']['queryView']['fieldView']['element']['ownerDocument']?.['activeElement'];return this['_searchTextView']['queryView']['fieldView']['element']['contains'](_0x169a84);}['_createListItems'](_0x1cce8e,_0x1ba186,_0xdca126){const _0x5650ad=new _0x5ba55d();return _0x1ba186['forEach'](_0x592109=>{if('actions'in _0x592109){const {listItem:_0x5c04f7}=this['_createActionGroupButton'](_0x1cce8e,_0x592109,_0xdca126);_0x5650ad['add'](_0x5c04f7),_0x592109['actions']['forEach'](_0xdd5fd7=>{this['_createActionButton'](_0x1cce8e,_0xdd5fd7,_0x592109['label'],_0x592109['icon']);const {listItem:_0xcf4a2c,highlightViews:_0x4df8b7}=this['_createSearchResultActionButton'](_0x1cce8e,_0xdd5fd7,_0x592109['label'],_0x592109['icon']);this['_allSearchableItems']['push']({'item':_0xcf4a2c,'label':_0xdd5fd7['label'],'groupLabel':_0x592109['label'],'highlightViews':_0x4df8b7});});}else{const {listItem:_0x49b33d}=this['_createActionButton'](_0x1cce8e,_0x592109);_0x5650ad['add'](_0x49b33d);const _0x5ae85f=_0x49b33d['children']['first'];if(_0x5ae85f){const {listItem:_0x50e173,highlightViews:_0x2efe19}=this['_createSearchResultActionButton'](_0x1cce8e,_0x592109);this['_allSearchableItems']['push']({'item':_0x50e173,'label':_0x5ae85f['label']||'','highlightViews':_0x2efe19});}}}),_0x5650ad;}['_createActionButton'](_0x254a5f,_0x2dee09,_0x24bded,_0xe64bb3){const _0x831f9b=new Pt(this['locale']);if(_0x24bded&&_0xe64bb3){const _0xcbcf28=new kt(this['locale']),_0x508437=_0xcbcf28['bindTemplate'],_0x360d5a=new _0x51d6a3();_0x360d5a['text']=_0x2dee09['label'];const _0x3b3129=new _0x51d6a3();_0x3b3129['text']=_0x24bded;const _0x34e1ad=new yt();_0x34e1ad['content']=_0xe64bb3,_0x34e1ad['extendTemplate']({'attributes':{'class':'ck-ai-quick-actions-button__group-icon'}});const _0x5d0ca2=new Nt(this['locale']);_0x5d0ca2['setTemplate']({'tag':'span','attributes':{'class':'ck-ai-quick-actions-button_with-group__open-paren'},'children':[{'text':'\x20('}]});const _0x1e4144=new Nt(this['locale']);return _0x1e4144['setTemplate']({'tag':'span','attributes':{'class':'ck-ai-quick-actions-button_with-group__close-paren'},'children':[{'text':')'}]}),_0xcbcf28['set']({'label':_0x2dee09['label']+'\x20('+_0x24bded+')','withText':!0x0,'role':'menuitem','class':'ck-ai-quick-actions-button\x20ck-ai-quick-actions-button_with-group','tooltip':!0x1}),_0xcbcf28['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':[_0x360d5a,_0x5d0ca2,_0x34e1ad,_0x3b3129,_0x1e4144],'on':{'mouseenter':_0x508437['to'](()=>{this['_isSearchFocused']()||_0xcbcf28['focus']();}),'click':_0x508437['to'](()=>{_0xcbcf28['fire']('execute');})}}),_0xcbcf28['on']('execute',()=>{_0x254a5f['editing']['view']['focus'](),_0x254a5f['commands']['execute']('aiQuickAction',_0x2dee09);}),_0x831f9b['children']['add'](_0xcbcf28),{'listItem':_0x831f9b,'highlightViews':[_0x360d5a,_0x3b3129]};}{const _0x533b3a=new _0x31cc2f(),_0x5b8f35=new kt(this['locale'],_0x533b3a),_0x1dbc42=_0x5b8f35['bindTemplate'],_0x2b6519=_0x2dee09['icon']??_0x2dee09['parent']?.['icon'],_0x99c2d8=void 0x0!==_0x2dee09['icon'];return _0x5b8f35['set']({'label':_0x2dee09['label'],'withText':!0x0,'role':'menuitem','icon':_0x99c2d8?_0x2b6519??_0xadd0ff:void 0x0,'tooltip':!0x1,'class':'ck-ai-quick-actions-button'}),_0x5b8f35['extendTemplate']({'on':{'mouseenter':_0x1dbc42['to'](()=>{this['_isSearchFocused']()||_0x5b8f35['focus']();})}}),_0x5b8f35['on']('execute',()=>{_0x254a5f['editing']['view']['focus'](),_0x254a5f['commands']['execute']('aiQuickAction',_0x2dee09);}),_0x831f9b['children']['add'](_0x5b8f35),{'listItem':_0x831f9b,'highlightViews':[_0x533b3a]};}}['_createSearchResultActionButton'](_0x1fa342,_0x1baf66,_0xc3a020,_0x54574a){return _0xc3a020&&_0x54574a?this['_createSearchResultGroupedActionButton'](_0x1fa342,_0x1baf66,_0xc3a020,_0x54574a):this['_createSearchResultIndividualActionButton'](_0x1fa342,_0x1baf66);}['_createSearchResultGroupedActionButton'](_0x1c747c,_0x4928dc,_0x1e1a22,_0x58fab9){const _0x535d10=new Pt(this['locale']),_0x1506e2=new kt(this['locale']),_0x2f54d3=_0x1506e2['bindTemplate'],{view:_0x128fc4,highlightView:_0x58959e}=this['_createSearchResultGroupRow'](_0x1e1a22,_0x58fab9),{view:_0x5cc39e,highlightView:_0x4bc3b5}=this['_createSearchResultActionRow'](_0x4928dc['label']),_0x3654f5=this['_createSearchResultContentView'](_0x128fc4,_0x5cc39e);return _0x1506e2['set']({'label':_0x4928dc['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}),_0x1506e2['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':[_0x3654f5],'on':{'mouseenter':_0x2f54d3['to'](()=>{this['_isSearchFocused']()||_0x1506e2['focus']();}),'click':_0x2f54d3['to'](()=>{this['_handleSearchResultButtonClick'](_0x1506e2);})}}),this['_setupActionButtonExecution'](_0x1506e2,_0x1c747c,_0x4928dc),_0x535d10['children']['add'](_0x1506e2),{'listItem':_0x535d10,'highlightViews':[_0x58959e,_0x4bc3b5]};}['_createSearchResultIndividualActionButton'](_0x3a5efd,_0x24218a){const _0x2b5851=new Pt(this['locale']),_0x2b9dfa=new _0x31cc2f(),_0xe69e8=new kt(this['locale'],_0x2b9dfa),_0x522883=_0xe69e8['bindTemplate'];return _0xe69e8['set']({'label':_0x24218a['label'],'withText':!0x0,'role':'menuitem','icon':void 0x0,'tooltip':!0x1,'class':'ck-ai-quick-actions-button\x20ck-ai-quick-actions-search-result-button'}),_0xe69e8['extendTemplate']({'on':{'mouseenter':_0x522883['to'](()=>{this['_isSearchFocused']()||_0xe69e8['focus']();})}}),this['_setupActionButtonExecution'](_0xe69e8,_0x3a5efd,_0x24218a),_0x2b5851['children']['add'](_0xe69e8),{'listItem':_0x2b5851,'highlightViews':[_0x2b9dfa]};}['_createSearchResultGroupRow'](_0x25de5d,_0x5433fb){const _0x15da05=new Nt(this['locale']),_0x47b580=new yt();_0x47b580['content']=_0x5433fb,_0x47b580['extendTemplate']({'attributes':{'class':'ck-ai-quick-actions-button__group-icon'}});const _0x24fe30=new _0x51d6a3();return _0x24fe30['text']=_0x25de5d,_0x15da05['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-quick-actions-search-result__group-row'},'children':[_0x47b580,_0x24fe30]}),{'view':_0x15da05,'highlightView':_0x24fe30};}['_createSearchResultActionRow'](_0x28b260){const _0x372418=new Nt(this['locale']),_0x36968d=new _0x51d6a3();return _0x36968d['text']=_0x28b260,_0x372418['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-quick-actions-search-result__action-row'},'children':[_0x36968d]}),{'view':_0x372418,'highlightView':_0x36968d};}['_createSearchResultContentView'](_0x3941d9,_0x20a723){const _0x3cf418=new Nt(this['locale']);return _0x3cf418['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-quick-actions-search-result__content'},'children':[_0x3941d9,_0x20a723]}),_0x3cf418;}['_setupActionButtonExecution'](_0x4a1cec,_0x32add8,_0x4d67a3){_0x4a1cec['on']('execute',()=>{_0x32add8['editing']['view']['focus'](),_0x32add8['commands']['execute']('aiQuickAction',_0x4d67a3);});}['_createActionGroupButton'](_0x199678,_0x1be4b8,_0x30c801){const _0x344cc3=new Pt(this['locale']),_0x3aec3f=new _0x31cc2f(),_0x1ee46e=new Oa(this['locale'],_0x3aec3f),_0x270875=_0x1ee46e['bindTemplate'],_0x506ca8=this['_getPanelKeystroke'](_0x30c801),_0x5d2ef6=this['_createGroupActionsList'](_0x199678,_0x1be4b8['actions'],_0x30c801);_0x1ee46e['set']({'label':_0x1be4b8['label'],'withText':!0x0,'role':va,'icon':_0x1be4b8['icon']??_0xadd0ff,'isEnabled':_0x1be4b8['actions']['some'](_0x1593c1=>_0x1593c1['isEnabled'])}),_0x1ee46e['extendTemplate']({'on':{'mouseenter':_0x270875['to'](()=>{this['_isSearchFocused']()||_0x1ee46e['focus']();})}});const _0xbabe00=new Qt(this['locale']);return _0xbabe00['extendTemplate']({'attributes':{'class':['ck','ck-reset_all','ck-ai-quick-actions-group-panel','ck-dropdown-menu__nested-menu__panel']},'on':{'keydown':_0x270875['to'](_0x73cff3=>{this['_handlePanelKeydown'](_0x73cff3,_0x506ca8,_0x1ee46e,_0xbabe00);})}}),_0x1ee46e['bind']('isOn')['to'](_0xbabe00,'isVisible'),this['_bodyCollection']['add'](_0xbabe00),_0xbabe00['content']['add'](_0x5d2ef6),this['_setupGroupMenuBehavior'](_0x1ee46e,_0xbabe00),_0x344cc3['children']['add'](_0x1ee46e),{'listItem':_0x344cc3,'highlightView':_0x3aec3f};}['_createGroupActionsList'](_0x432109,_0x366fcf,_0x4a35db){const _0x3c507f=new Lt(this['locale']);return _0x3c507f['extendTemplate']({'attributes':{'class':['ck','ck-reset_all','ck-ai-quick-actions-group-list','ck-dropdown-menu-list']}}),_0x366fcf['forEach'](_0x32b9aa=>{const _0x59c2e2=new Pt(this['locale']),_0x396748=Ra({'editor':_0x432109,'action':_0x32b9aa,'withText':!0x0,'withIcon':!0x1,'isInDropdown':!0x0,'shouldPreventFocus':()=>this['_isSearchFocused']()})();_0x59c2e2['children']['add'](_0x396748),_0x4a35db['focusTracker']['add'](_0x396748),_0x3c507f['items']['add'](_0x59c2e2);}),_0x3c507f;}['_setupGroupMenuBehavior'](_0x1dbbc0,_0x436e38){const _0x3453d9=_0x1dbbc0['bindTemplate'],_0xb2b71e=this['_getButtonKeystroke'](_0x1dbbc0);_0x1dbbc0['extendTemplate']({'attributes':{'class':['ck-ai-quick-actions-group-button']},'on':{'mouseenter':_0x3453d9['to'](()=>{this['_showNestedPanel'](_0x436e38,_0x1dbbc0);}),'mouseleave':_0x3453d9['to'](_0x56344e=>{const _0x416d44=_0x56344e['relatedTarget'];this['_isMovingToNestedMenu'](_0x416d44,_0x436e38)||this['_hideNestedPanel'](_0x436e38);}),'keydown':_0x3453d9['to'](_0x121797=>{_0x121797['key']==_0xb2b71e&&(this['_showNestedPanel'](_0x436e38,_0x1dbbc0),_0x436e38['content']['get'](0x0)['focus']());})}}),_0x436e38['on']('render',()=>{_0x436e38['element']?.['addEventListener']('mouseleave',_0x133459=>{const _0x114fd5=_0x133459['relatedTarget'];_0x1dbbc0['element']?.['contains'](_0x114fd5)||this['_isMovingToNestedMenu'](_0x114fd5,_0x436e38)||this['_hideNestedPanel'](_0x436e38);});});}['_showNestedPanel'](_0x145e65,_0x493c5e){this['_openNestedPanels']['forEach'](_0x3641ff=>{_0x3641ff!==_0x145e65&&_0x3641ff['isVisible']&&_0x3641ff['hide']();}),_0x145e65['show'](),_0x145e65['pin']({'positions':[_0x4bd091['eastSouth']],'target':_0x493c5e['element'],'fitInViewport':!0x0}),this['_openNestedPanels']['add'](_0x145e65);}['_hideNestedPanel'](_0x52f93){_0x52f93['hide'](),this['_openNestedPanels']['delete'](_0x52f93);}['_hideAllNestedPanels'](){this['_openNestedPanels']['forEach'](_0x430f0c=>_0x430f0c['hide']()),this['_openNestedPanels']['clear']();}['_isMovingToNestedMenu'](_0xb9a68b,_0x1b9fc5){if(!_0xb9a68b)return!0x1;if(_0x1b9fc5['element']?.['contains'](_0xb9a68b))return!0x0;const _0x3d346d=_0xb9a68b;return _0x3d346d['closest']&&(null!==_0x3d346d['closest']('.ck-ai-quick-actions-group-panel')||null!==_0x3d346d['closest']('.ck-ai-quick-actions-group-list')||null!==_0x3d346d['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'](_0x183fa5){return'rtl'===_0x183fa5['locale']['uiLanguageDirection']?'ArrowRight':'ArrowLeft';}['_getButtonKeystroke'](_0x36983c){return'rtl'===_0x36983c['locale']['uiLanguageDirection']?'ArrowLeft':'ArrowRight';}['_handlePanelKeydown'](_0x34bcee,_0x4eb504,_0x5eb9ee,_0x517256){_0x34bcee['key']==_0x4eb504&&(_0x5eb9ee['focus'](),this['_hideNestedPanel'](_0x517256));}['_handleSearchResultButtonClick'](_0x4b3586){_0x4b3586['fire']('execute');}}function xa(_0x5b6b6c){const {editor:_0x854701,content:_0x1dd9cd,buttonDefinition:_0x1459c2,bodyCollection:_0x44508a,hasSearch:_0x100a63=!0x1}=_0x5b6b6c;return()=>{const _0x832165=_0x854701['locale'],_0x5a0bf4=Bt(_0x832165);_0x5a0bf4['buttonView']['set']({'icon':_0x1459c2['icon']??_0xadd0ff,'label':_0x1459c2['label'],'tooltip':!0x0}),_0x5a0bf4['set']({'class':'ck-ai-quick-actions-dropdown'});const _0x4a23f6=new ya(_0x854701,_0x1dd9cd,_0x5a0bf4,_0x44508a,_0x100a63);return _0x5a0bf4['panelView']['children']['add'](_0x4a23f6),_0x100a63&&_0x5a0bf4['on']('change:isOpen',(_0x5f0c50,_0x4c8099,_0x5c8261)=>{if(_0x5c8261){if(_0x854701['plugins']['has']('AIEditing')){const _0x491b92=_0x854701['plugins']['get'](qs),_0x9abfe1=_0x854701['model']['document']['selection'],_0x354dae=Array['from'](_0x9abfe1['getRanges']());_0x354dae['length']>0x0&&_0x491b92['showFakeVisualSelection']({'ranges':_0x354dae,'id':'quick-action','priority':0x14});}}else _0x854701['plugins']['has']('AIEditing')&&_0x854701['plugins']['get'](qs)['hideFakeVisualSelection']('quick-action'),_0x4a23f6['resetSearch']();}),_0x5a0bf4;};}const La='<task>For\x20given\x20selected\x20part\x20of\x20HTML\x20document\x20you\x20must\x20explain\x20the\x20meaning\x20of\x20it\x27s\x20content\x20clearly\x20and\x20in\x20plain\x20language.</task><rules>1.\x20Identify\x20what\x20type\x20of\x20text\x20it\x20is:-\x20If\x20it\x20looks\x20like\x20a\x20definition\x20explain\x20the\x20concept\x20in\x20simple\x20terms.-\x20If\x20it\x20looks\x20like\x20a\x20description\x20clarify\x20what\x20it\x20is\x20describing\x20and\x20why\x20it\x20matters.-\x20If\x20it\x20contains\x20technical\x20terms\x20or\x20jargon\x20break\x20them\x20down\x20into\x20everyday\x20language.-\x20If\x20it\x20looks\x20instructional\x20restate\x20as\x20clear\x20steps\x20someone\x20can\x20follow.-\x20If\x20it\x20provides\x20examples\x20explain\x20what\x20the\x20example\x20shows\x20and\x20why\x20it\x27s\x20relevant.-\x20If\x20it\x20presents\x20an\x20argument\x20or\x20claim\x20restate\x20the\x20claim\x20neutrally\x20and\x20explain\x20its\x20purpose.-\x20If\x20it\x20is\x20narrative/story-like\x20explain\x20what\x20event\x20or\x20situation\x20is\x20being\x20described.-\x20If\x20it\x20is\x20data-driven\x20(stats,\x20figures,\x20facts)\x20explain\x20what\x20the\x20data\x20indicates.-\x20If\x20it\x20is\x20a\x20quotation\x20explain\x20the\x20meaning\x20of\x20the\x20quote\x20in\x20context.-\x20If\x20it\x20compares/contrasts\x20things\x20explain\x20the\x20key\x20differences\x20or\x20similarities\x20simply.-\x20If\x20it\x20does\x20not\x20fit\x20any\x20of\x20the\x20categories\x20above\x20give\x20a\x20clear,\x20plain-language\x20explanation\x20of\x20its\x20meaning,\x20focusing\x20on\x20usefulness.2.\x20Provide\x20context\x20if\x20the\x20meaning\x20could\x20be\x20unclear\x20without\x20it.\x20(e.g.,\x20explain\x20where\x20such\x20a\x20term\x20might\x20be\x20used,\x20or\x20why\x20it\x20is\x20important).3.\x20Keep\x20the\x20explanation\x20short\x20but\x20complete\x20(2–5\x20sentences).Avoid\x20overly\x20technical\x20detail\x20unless\x20it\x20is\x20necessary\x20for\x20understanding.4.\x20Do\x20not\x20simply\x20repeat\x20the\x20original\x20text\x20—\x20restate\x20and\x20expand\x20it\x20in\x20plain\x20words.5.\x20If\x20possible,\x20add\x20a\x20short\x20example\x20or\x20analogy\x20to\x20make\x20it\x20easier\x20to\x20understand.6.\x20Use\x20the\x20context\x20of\x20the\x20whole\x20document,\x20but\x20focus\x20on\x20the\x20selected\x20part\x20when\x20creating\x20your\x20explanation.7.\x20Your\x20explanation\x20should\x20be\x20written\x20in\x20%0\x20language.</rules><constraints>1.\x20You\x20MUST\x20NOT\x20perform\x20any\x20edits\x20or\x20modifications\x20on\x20provided\x20document.2.\x20You\x20MUST\x20NOT\x20include\x20document\x20modifications\x20in\x20your\x20response.3.\x20Your\x20message\x20should\x20only\x20include\x20explanation.\x20Do\x20not\x20add\x20any\x20additional\x20text,\x20flattery,\x20questions\x20or\x20followup\x20suggestions.</constraints>',Da='<task>For\x20the\x20given\x20selected\x20part\x20of\x20an\x20HTML\x20document\x20you\x20must\x20summarize\x20its\x20content\x20in\x20a\x20few\x20sentences,\x20keeping\x20only\x20the\x20essential\x20meaning.</task><rules>1.\x20Your\x20summary\x20should\x20be\x20short\x20and\x20clear:-\x20Aim\x20for\x202–4\x20sentences\x20unless\x20the\x20text\x20is\x20extremely\x20short.-\x20Focus\x20on\x20capturing\x20the\x20main\x20idea(s)\x20without\x20unnecessary\x20detail.2.\x20Identify\x20what\x20type\x20of\x20text\x20it\x20is\x20and\x20adapt\x20the\x20summary\x20style:-\x20If\x20it\x20is\x20descriptive\x20condense\x20the\x20description\x20into\x20its\x20core\x20idea.-\x20If\x20it\x20is\x20argumentative\x20or\x20opinion-based\x20summarize\x20the\x20main\x20claim\x20and\x20reasoning\x20neutrally.-\x20If\x20it\x20is\x20narrative/story-like\x20capture\x20the\x20main\x20event\x20or\x20outcome\x20without\x20side\x20details.-\x20If\x20it\x20is\x20data-driven\x20(stats,\x20figures,\x20facts)\x20summarize\x20what\x20the\x20data\x20shows\x20in\x20plain\x20language.-\x20If\x20it\x20is\x20instructional\x20restate\x20the\x20overall\x20purpose\x20of\x20the\x20steps\x20without\x20listing\x20every\x20step.-\x20If\x20it\x20does\x20not\x20fit\x20any\x20of\x20the\x20categories\x20above\x20provide\x20a\x20general\x20concise\x20summary.3.\x20Provide\x20context\x20if\x20necessary\x20for\x20clarity:-\x20Mention\x20the\x20subject\x20or\x20topic\x20explicitly\x20so\x20the\x20summary\x20can\x20stand\x20alone.4.\x20Do\x20not\x20simply\x20copy\x20sentences\x20from\x20the\x20original\x20text\x20—\x20rephrase\x20in\x20plain\x20language.5.\x20Avoid\x20adding\x20new\x20information\x20or\x20interpretation\x20not\x20present\x20in\x20the\x20text.6.\x20Summarize\x20in\x20a\x20way\x20that\x20would\x20make\x20sense\x20to\x20someone\x20who\x20has\x20not\x20read\x20the\x20original\x20text.7.\x20Use\x20the\x20context\x20of\x20the\x20whole\x20document,\x20but\x20focus\x20on\x20the\x20selected\x20part\x20when\x20creating\x20your\x20summary.8.\x20Your\x20summary\x20should\x20be\x20written\x20in\x20%0\x20language.</rules><constraints>1.\x20You\x20MUST\x20NOT\x20perform\x20any\x20edits\x20or\x20modifications\x20on\x20the\x20provided\x20document.2.\x20You\x20MUST\x20NOT\x20include\x20document\x20modifications\x20in\x20your\x20response.3.\x20Your\x20message\x20should\x20only\x20include\x20the\x20summary.\x20Do\x20not\x20add\x20any\x20additional\x20text,\x20flattery,\x20questions\x20or\x20followup\x20suggestions.</constraints>',Pa='<task>For\x20the\x20given\x20selected\x20part\x20of\x20an\x20HTML\x20document\x20you\x20must\x20extract\x20and\x20present\x20the\x20key\x20points\x20from\x20its\x20content.</task><rules>1.\x20Present\x20the\x20output\x20as\x20a\x20clear,\x20structured\x20list\x20(bullets\x20or\x20numbered).-\x20Each\x20point\x20should\x20be\x20concise\x20(one\x20sentence\x20or\x20less).-\x20Do\x20not\x20merge\x20distinct\x20ideas\x20into\x20one\x20bullet.2.\x20Identify\x20what\x20type\x20of\x20text\x20it\x20is\x20and\x20adapt\x20the\x20extraction\x20style:-\x20If\x20it\x20is\x20descriptive\x20capture\x20the\x20main\x20attributes\x20or\x20features.-\x20If\x20it\x20is\x20argumentative\x20extract\x20the\x20main\x20claim\x20and\x20supporting\x20reasons\x20separately.-\x20If\x20it\x20is\x20narrative/story-like\x20extract\x20the\x20main\x20events\x20in\x20chronological\x20order.-\x20If\x20it\x20is\x20data-driven\x20(stats,\x20figures,\x20facts)\x20highlight\x20the\x20most\x20important\x20facts\x20or\x20numbers.-\x20If\x20it\x20is\x20instructional\x20list\x20the\x20steps\x20or\x20main\x20actions\x20in\x20simplified\x20form.-\x20If\x20it\x20provides\x20comparisons\x20extract\x20the\x20contrasted\x20items\x20and\x20their\x20differences/similarities.-\x20If\x20it\x20does\x20not\x20fit\x20any\x20category\x20above\x20extract\x20the\x20main\x20ideas\x20in\x20plain,\x20short\x20statements.3.\x20Keep\x20the\x20list\x20between\x203–7\x20items\x20where\x20possible.-\x20If\x20the\x20text\x20is\x20very\x20short,\x20fewer\x20items\x20are\x20fine.-\x20If\x20it\x20is\x20very\x20long,\x20focus\x20on\x20the\x20most\x20important\x20ideas\x20only.4.\x20Do\x20not\x20copy\x20long\x20text\x20fragments\x20—\x20restate\x20in\x20simple\x20words.5.\x20Do\x20not\x20add\x20interpretation,\x20evaluation,\x20or\x20commentary\x20beyond\x20the\x20text.6.\x20Ensure\x20the\x20list\x20can\x20stand\x20alone\x20without\x20requiring\x20the\x20reader\x20to\x20see\x20the\x20original\x20document.7.\x20Use\x20the\x20context\x20of\x20the\x20whole\x20document,\x20but\x20focus\x20on\x20the\x20selected\x20part\x20when\x20creating\x20your\x20key\x20points.8.\x20Your\x20key\x20points\x20should\x20be\x20written\x20in\x20%0\x20language.</rules><constraints>1.\x20You\x20MUST\x20NOT\x20perform\x20any\x20edits\x20or\x20modifications\x20on\x20the\x20provided\x20document.2.\x20You\x20MUST\x20NOT\x20include\x20document\x20modifications\x20in\x20your\x20response.3.\x20Your\x20message\x20should\x20only\x20include\x20the\x20extracted\x20key\x20points.\x20Do\x20not\x20add\x20any\x20additional\x20text,\x20flattery,\x20questions\x20or\x20followup\x20suggestions.</constraints>',Ha=/* #__PURE__ -- @preserve */
|
|
28
|
+
((()=>({'chat':'AIChat','action':'AIActions'}))());class Ma extends _0x2db8aa{static get['requires'](){return[_0x2d17a3,rs];}static get['pluginName'](){return'AIQuickActionsUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}async['init'](){const _0x628f7b=await this['_getDefaultAndCustomActions']();this['_prepareQuickActionsDefinition'](_0x628f7b),this['_initializeQuickActionsComponentsAndCommands']();}static['getDefaultQuickActions'](_0x552cf5){return function(_0x4b80f2){const _0x171475=new Intl['DisplayNames'](['en'],{'type':'language'})['of'](_0x4b80f2['uiLanguage']),_0x36427d=_0x171475||'English',_0x40e5d9=[{'id':'ask-ai','label':as(_0x4b80f2,'AI_QUICK_ACTIONS_ASK_AI'),'type':'chat','icon':_0x160f40},{'id':'chat-commands','label':as(_0x4b80f2,'AI_QUICK_ACTIONS_CHAT_COMMANDS'),'icon':_0x160f40,'actions':[{'id':'explain','label':as(_0x4b80f2,'AI_QUICK_ACTIONS_EXPLAIN'),'displayedPrompt':as(_0x4b80f2,'AI_QUICK_ACTIONS_EXPLAIN'),'prompt':La['replace']('%0',_0x36427d),'type':'chat'},{'id':'summarize','label':as(_0x4b80f2,'AI_QUICK_ACTIONS_SUMMARIZE'),'displayedPrompt':as(_0x4b80f2,'AI_QUICK_ACTIONS_SUMMARIZE'),'prompt':Da['replace']('%0',_0x36427d),'type':'chat'},{'id':'highlight-key-points','label':as(_0x4b80f2,'AI_QUICK_ACTIONS_HIGHLIGHT_KEY_POINTS'),'displayedPrompt':as(_0x4b80f2,'AI_QUICK_ACTIONS_HIGHLIGHT_KEY_POINTS'),'prompt':Pa['replace']('%0',_0x36427d),'type':'chat'}]},{'id':'improve-writing','label':as(_0x4b80f2,'AI_QUICK_ACTIONS_IMPROVE_WRITING'),'type':'action','icon':_0x4cbf9a},{'id':'continue','label':as(_0x4b80f2,'AI_QUICK_ACTIONS_CONTINUE_WRITING'),'type':'action','icon':_0x2f867c},{'id':'fix-grammar','label':as(_0x4b80f2,'AI_QUICK_ACTIONS_FIX_GRAMMAR_SPELLING'),'type':'action','icon':_0x1d2a05},{'id':'adjust-length','label':as(_0x4b80f2,'AI_QUICK_ACTIONS_ADJUST_LENGTH'),'icon':_0x5628ec,'actions':[{'id':'make-shorter','label':as(_0x4b80f2,'AI_QUICK_ACTIONS_MAKE_SHORTER'),'type':'action'},{'id':'make-longer','label':as(_0x4b80f2,'AI_QUICK_ACTIONS_MAKE_LONGER'),'type':'action'}]},{'id':'change-tone','label':as(_0x4b80f2,'AI_QUICK_ACTIONS_CHANGE_TONE'),'icon':_0x3e6679,'actions':[{'id':'make-tone-casual','label':as(_0x4b80f2,'AI_QUICK_ACTIONS_MORE_CASUAL'),'type':'action'},{'id':'make-tone-direct','label':as(_0x4b80f2,'AI_QUICK_ACTIONS_MORE_DIRECT'),'type':'action'},{'id':'make-tone-friendly','label':as(_0x4b80f2,'AI_QUICK_ACTIONS_MORE_FRIENDLY'),'type':'action'},{'id':'make-tone-confident','label':as(_0x4b80f2,'AI_QUICK_ACTIONS_MORE_CONFIDENT'),'type':'action'},{'id':'make-tone-professional','label':as(_0x4b80f2,'AI_QUICK_ACTIONS_MORE_PROFESSIONAL'),'type':'action'}]},{'id':'translate','label':as(_0x4b80f2,'AI_QUICK_ACTIONS_TRANSLATE'),'icon':_0x20525b,'actions':[{'id':'translate-to-english','label':as(_0x4b80f2,'AI_QUICK_ACTIONS_TRANSLATE_ENGLISH'),'type':'action','actionName':'translate','args':{'language':'english'}},{'id':'translate-to-chinese','label':as(_0x4b80f2,'AI_QUICK_ACTIONS_TRANSLATE_CHINESE'),'type':'action','actionName':'translate','args':{'language':'chinese'}},{'id':'translate-to-spanish','label':as(_0x4b80f2,'AI_QUICK_ACTIONS_TRANSLATE_SPANISH'),'type':'action','actionName':'translate','args':{'language':'spanish'}},{'id':'translate-to-german','label':as(_0x4b80f2,'AI_QUICK_ACTIONS_TRANSLATE_GERMAN'),'type':'action','actionName':'translate','args':{'language':'german'}},{'id':'translate-to-french','label':as(_0x4b80f2,'AI_QUICK_ACTIONS_TRANSLATE_FRENCH'),'type':'action','actionName':'translate','args':{'language':'french'}},{'id':'translate-to-japanese','label':as(_0x4b80f2,'AI_QUICK_ACTIONS_TRANSLATE_JAPANESE'),'type':'action','actionName':'translate','args':{'language':'japanese'}},{'id':'translate-to-portuguese','label':as(_0x4b80f2,'AI_QUICK_ACTIONS_TRANSLATE_PORTUGUESE'),'type':'action','actionName':'translate','args':{'language':'portuguese'}},{'id':'translate-to-korean','label':as(_0x4b80f2,'AI_QUICK_ACTIONS_TRANSLATE_KOREAN'),'type':'action','actionName':'translate','args':{'language':'korean'}},{'id':'translate-to-italian','label':as(_0x4b80f2,'AI_QUICK_ACTIONS_TRANSLATE_ITALIAN'),'type':'action','actionName':'translate','args':{'language':'italian'}},{'id':'translate-to-russian','label':as(_0x4b80f2,'AI_QUICK_ACTIONS_TRANSLATE_RUSSIAN'),'type':'action','actionName':'translate','args':{'language':'russian'}}]},{'id':'other','label':as(_0x4b80f2,'AI_QUICK_ACTIONS_OTHER'),'icon':_0x1ad21b,'actions':[]}];return _0x40e5d9;}(_0x552cf5);}async['_getDefaultAndCustomActions'](){const _0x1d5cf4=Ma['getDefaultQuickActions'](this['editor']['locale']),_0x5752b9=this['editor']['config']['get']('ai.quickActions.extraCommands')||[];let _0x3251b3=[];try{_0x3251b3=await new Bs({'connector':this['editor']['plugins']['get']('AIConnector'),'locale':this['editor']['locale']})['getAll']();}catch(_0x375776){const _0x3ae3b0=new ot('ai-quick-actions-models-unable-to-retrieve',this,{'error':_0x375776});Et(_0x3ae3b0['message']);}finally{const _0x44eaee=_0x5752b9['map'](_0x2280f2=>({..._0x2280f2,'type':'chat'===_0x2280f2['type']?'chat':'action','icon':void 0x0}));_0x1d5cf4['find'](_0x578daf=>'other'===_0x578daf['id'])['actions']['push'](..._0x44eaee),_0x1d5cf4['forEach'](_0x31b3ec=>{if('actions'in _0x31b3ec)_0x31b3ec['actions']['forEach'](_0x2e3d0e=>{if(_0x2e3d0e['isEnabled']=!!_0x3251b3['find'](_0xa55d9e=>_0xa55d9e['id']===_0x2e3d0e['model'])||void 0x0===_0x2e3d0e['model'],!_0x2e3d0e['isEnabled']){const _0x5e7c8d=new ot('ai-quick-actions-unavailable-model',this,{'actionId':_0x2e3d0e['id'],'modelId':_0x2e3d0e['model']});Et(_0x5e7c8d['message']);}});else{if(_0x31b3ec['isEnabled']=!!_0x3251b3['find'](_0x94501=>_0x94501['id']===_0x31b3ec['model'])||void 0x0===_0x31b3ec['model'],!_0x31b3ec['isEnabled']){const _0x8a4e58=new ot('ai-quick-actions-unavailable-model',this,{'actionId':_0x31b3ec['id'],'modelId':_0x31b3ec['model']});Et(_0x8a4e58['message']);}}});}return _0x1d5cf4;}['_initializeQuickActionsComponentsAndCommands'](){const _0x258358=new qt(this['editor']['locale']);_0x258358['attachToDom'](),this['_initializeQuickActionsDropdown'](_0x258358),this['_initializeQuickActionsMenuBar'](),this['_initializeQuickActionsComponents'](_0x258358);}['_initializeQuickActionsDropdown'](_0xe2d7f1){const _0x524ce2=this['editor']['config']['get']('ai.quickActions.isSearchEnabled')??!0x0;this['editor']['ui']['componentFactory']['add']('aiQuickActions',xa({'editor':this['editor'],'content':this['_quickActionsDefinition'],'buttonDefinition':{'icon':_0xadd0ff,'label':as(this['editor']['locale'],'AI_QUICK_ACTIONS_HEADING')},'bodyCollection':_0xe2d7f1,'hasSearch':_0x524ce2}));}['_prepareQuickActionsDefinition'](_0x158668){this['_quickActionsDefinition']=_0x158668['map'](_0x5631a4=>{if('actions'in _0x5631a4){const _0x1ba080=_0x5631a4;return{..._0x1ba080,'actions':_0x1ba080['actions']['map'](_0x42741f=>{const {actions:_0x2a2af8,..._0x2b56a6}=_0x1ba080;return{..._0x42741f,'parent':_0x2b56a6};})['filter'](_0xea0fc7=>this['_shouldIncludeAction'](_0xea0fc7))};}return _0x5631a4;})['filter'](_0xa78d19=>'actions'in _0xa78d19?_0xa78d19['actions']['length']>0x0:this['_shouldIncludeAction'](_0xa78d19));}['_shouldIncludeAction'](_0x104732){const _0xbc4e14=this['editor']['config']['get']('ai.quickActions.removeCommands')||[];return this['editor']['plugins']['has'](Ha[_0x104732['type']])&&!_0xbc4e14['includes'](_0x104732['id'])&&!('chat'===_0x104732['type']&&!0x1===this['editor']['config']['get']('ai.chat.context.document.enabled'));}['_initializeQuickActionsComponents'](_0x5f21f5){this['_quickActionsDefinition']['forEach'](_0x15564f=>{if('actions'in _0x15564f){const _0x197065=xa({'editor':this['editor'],'content':_0x15564f['actions'],'buttonDefinition':_0x15564f,'bodyCollection':_0x5f21f5});this['editor']['ui']['componentFactory']['add'](_0x15564f['id'],_0x197065),_0x15564f['actions']['forEach'](_0x5d6349=>{const _0x99982f=Ra({'editor':this['editor'],'action':_0x5d6349});this['editor']['ui']['componentFactory']['add'](_0x5d6349['id'],_0x99982f);});}else{const _0x58e3ff=Ra({'editor':this['editor'],'action':_0x15564f,'withText':!0x1,'withIcon':!0x0,'isInDropdown':!0x1});this['editor']['ui']['componentFactory']['add'](_0x15564f['id'],_0x58e3ff);}});}['_initializeQuickActionsMenuBar'](){this['editor']['ui']['componentFactory']['add']('menuBar:aiQuickActions',_0x58ef0e=>{const _0x532960=new Ft(_0x58ef0e),_0x4b0498=as(_0x58ef0e,'AI_QUICK_ACTIONS_HEADING');_0x532960['buttonView']['set']({'label':_0x4b0498,'icon':_0xadd0ff});const _0x201ad7=new Yt(_0x58ef0e);_0x201ad7['set']({'ariaLabel':_0x4b0498,'role':'menu'}),this['_quickActionsDefinition']['forEach'](_0x515fc7=>{if('actions'in _0x515fc7){const _0x53fd2a=_0x515fc7,_0x2305ef=new $t(_0x58ef0e,_0x532960),_0x49eb5d=new Ft(_0x58ef0e),_0x768412=new Yt(_0x58ef0e);_0x49eb5d['buttonView']['set']({'label':_0x53fd2a['label'],'icon':_0x53fd2a['icon']}),_0x53fd2a['actions']['forEach'](_0x1443c7=>{const _0x43d060=new $t(_0x58ef0e,_0x49eb5d),_0x11808d=new Kt(_0x58ef0e);_0x11808d['set']({'label':_0x1443c7['label'],'icon':_0x1443c7['icon'],'role':'menuitem','isEnabled':_0x1443c7['isEnabled']}),_0x11808d['on']('execute',()=>{this['_executeQuickAction'](_0x1443c7);}),_0x11808d['delegate']('execute')['to'](_0x49eb5d),_0x43d060['children']['add'](_0x11808d),_0x768412['items']['add'](_0x43d060);}),_0x49eb5d['panelView']['children']['add'](_0x768412),_0x2305ef['children']['add'](_0x49eb5d),_0x201ad7['items']['add'](_0x2305ef);}else{const _0xccbf65=_0x515fc7,_0x2f1deb=new $t(_0x58ef0e,_0x532960),_0x43ac16=new Kt(_0x58ef0e);_0x43ac16['set']({'label':_0xccbf65['label'],'icon':_0xccbf65['icon'],'role':'menuitem','isEnabled':_0xccbf65['isEnabled']}),_0x43ac16['on']('execute',()=>{this['_executeQuickAction'](_0xccbf65);}),_0x43ac16['delegate']('execute')['to'](_0x532960),_0x2f1deb['children']['add'](_0x43ac16),_0x201ad7['items']['add'](_0x2f1deb);}});const _0x1a7a99=Object['values'](Ha)['some'](_0x1f61f4=>this['editor']['plugins']['has'](_0x1f61f4));return _0x532960['set']({'isEnabled':_0x1a7a99}),_0x532960['panelView']['children']['add'](_0x201ad7),_0x532960;});}['_executeQuickAction'](_0x3141c7){const _0x495a35=this['editor'];_0x495a35['editing']['view']['focus'](),_0x495a35['commands']['execute']('aiQuickAction',_0x3141c7);const _0x498781=_0x495a35['ui']['view']['menuBarView'];_0x498781&&_0x498781['close']&&_0x498781['close']();}}class Ua extends _0x46077b{['execute'](_0x23085a){switch(this['_expandSelectionIfCollapsed'](),_0x23085a['type']){case'chat':if(!this['editor']['plugins']['has']('AIChat')){const _0x2cbe5e=as(this['editor']['locale'],'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND','AIChat');throw new ot('ai-quick-actions-plugin-not-found',this['editor'],{'errorMessage':_0x2cbe5e});}this['_handleAIChatAction'](_0x23085a);break;case'action':if(!this['editor']['plugins']['has']('AIActions')){const _0x1b228d=as(this['editor']['locale'],'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND','AIActions');throw new ot('ai-quick-actions-plugin-not-found',this['editor'],{'errorMessage':_0x1b228d});}this['_handleAIActionsAction'](_0x23085a);}}async['_handleAIChatAction'](_0x130ccd){const _0x1e3d1b=this['editor']['plugins']['get']('AIChatController'),_0x250505=this['editor']['plugins']['get']('AITabs')['view'];if(_0x250505['isVisible']||(_0x250505['isVisible']=!0x0),'chat'!==_0x250505['activeTab']&&_0x250505['activateTab']('chat'),'ask-ai'===_0x130ccd['id'])_0x1e3d1b['removeSelectionFromChatContext'](),_0x1e3d1b['addSelectionToChatContext'](),_0x1e3d1b['focusPromptInput']();else await _0x1e3d1b['startConversation'](),_0x1e3d1b['removeSelectionFromChatContext'](),_0x1e3d1b['addSelectionToChatContext'](),_0x1e3d1b['focusPromptInput'](),await _0x1e3d1b['sendMessage']({'message':_0x130ccd['prompt']||_0x130ccd['displayedPrompt']||_0x130ccd['label'],'attributes':{'quickActionData':{'id':_0x130ccd['id']},'displayedPrompt':_0x130ccd['displayedPrompt']}});}['_expandSelectionIfCollapsed'](){const _0x4b9ae5=this['editor'],_0x17cc26=_0x4b9ae5['model']['document']['selection'];if(!_0x17cc26['isCollapsed'])return;const _0x43265f=gt(_0x17cc26['getSelectedBlocks']())||_0x4b9ae5['model']['schema']['getLimitElement'](_0x17cc26);_0x4b9ae5['model']['change'](_0x14eaaf=>{_0x14eaaf['setSelection'](_0x43265f,'in');});}['_handleAIActionsActionLabel'](_0x2e7a9a){return _0x2e7a9a['parent']?.['label']&&'other'!==_0x2e7a9a['parent']?.['id']?_0x2e7a9a['parent']['label']+':\x20'+_0x2e7a9a['label']:_0x2e7a9a['label'];}async['_handleAIActionsAction'](_0x578c5d){const _0x2669f0=this['editor']['plugins']['get']('AIActions'),_0x4e339b=_0x578c5d['prompt']?{'userMessage':_0x578c5d['prompt'],'model':_0x578c5d['model']}:{'actionName':_0x578c5d['actionName']||_0x578c5d['id'],'args':_0x578c5d['args']},_0x4aad5a=this['_handleAIActionsActionLabel'](_0x578c5d);await _0x2669f0['executeAction'](_0x4e339b,_0x4aad5a,_0x578c5d['icon']);}}class Va extends _0x2db8aa{static get['pluginName'](){return'AIQuickActionsEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x43818e=this['editor'],_0xcd63a2=new Ua(this['editor']);if(_0x43818e['commands']['add']('aiQuickAction',_0xcd63a2),_0x43818e['plugins']['has']('AIChat')){const _0x530fa2=this['editor']['plugins']['get']('AIChatController');_0x43818e['model']['document']['selection']['on']('change:range',(_0x47dc4f,_0x4ca710)=>{_0x4ca710['directChange']&&_0x530fa2['removeSelectionFromChatContext']();});}}}class Ba extends vs{['updateChangeGroups'](){if(this['parsedMergedContent']=this['parsedContent']['cloneNode'](!0x0),0x0==this['parsedMergedContent']['childNodes']['length'])return void(this['changeGroups']=[]);const _0x5ec273=this['documentContextContent']['children']['map'](_0x1d5aea=>({'node':_0x1d5aea,'id':gs(_0x1d5aea,'data-id')})),_0x579515=this['parsedMergedContent']['children']['map'](_0x2b2868=>({'node':_0x2b2868,'id':gs(_0x2b2868,'data-id')||at()})),_0x30ff79=_0x5b5740(_0x5ec273,_0x579515,{'comparator':(_0x19631f,_0x488ec3)=>_0x19631f['id']==_0x488ec3['id'],'oneChangePerToken':!0x0});if(!this['isDone']){for(;_0x30ff79['length']&&_0x30ff79[_0x30ff79['length']-0x1]['removed'];)_0x30ff79['pop']();}const _0x34185a=_0x30ff79['map'](_0x46a2c4=>{const _0x31fa1e=_0x46a2c4['added']?'new':_0x46a2c4['removed']?'removed':'modified';return{'node':_0x46a2c4['value'][0x0]['node'],'type':_0x31fa1e,'id':_0x46a2c4['value'][0x0]['id']};});this['changeGroups']=[{'changes':_0x34185a,'state':'pending','index':0x0}];}['_getDifferentChangeGroups'](_0x8a6892,_0x21db3a){return _0x21db3a;}}class Ga extends xs{['content'];['version'];['actionName'];['args'];['userMessage'];['model'];['hasError']=!0x1;['stoppedExplicitly']=!0x1;constructor(_0x557c58){super(_0x557c58),this['content']=_0x557c58['content'],this['version']=_0x557c58['version'],this['actionName']=_0x557c58['actionName'],this['args']=_0x557c58['args'],this['userMessage']=_0x557c58['userMessage'],this['model']=_0x557c58['model'],this['on']('interactionStopped',()=>{this['stoppedExplicitly']=!0x0;});}async['sendRequest'](){return this['actionName']?this['connector']['executeAction']({'content':this['content'],'actionName':this['actionName'],'args':this['args']}):this['connector']['executeCustomAction']({'content':this['content'],'message':this['userMessage'],'model':this['model'],'outputFormat':'html'});}['getDocumentContext'](){return{'type':'text','content':this['content'],'version':this['version'],'label':'Current\x20document','uiId':'current-document'};}['createReply'](_0x45587e){const _0x2444e9=new Ba({'editor':this['editor'],'documentContextContent':this['content'],..._0x45587e});return this['replies']['push'](_0x2444e9),_0x2444e9['delegate'](...ys)['to'](this),this['fire']('replyCreated',_0x2444e9),_0x2444e9;}}class Fa extends Ot{constructor(_0xba3db9,_0x616f42=!0x0,_0x1063aa=!0x0){super(_0xba3db9),this['set']('isEnabled',!0x1),_0x616f42&&(this['applyButton']=this['_createButton'](as(_0xba3db9,'AI_BALLOON_APPLY_BUTTON'),os),this['applyButton']['bind']('isEnabled')['to'](this),this['items']['add'](this['applyButton'])),_0x1063aa&&(this['suggestButton']=this['_createButton'](as(_0xba3db9,'AI_BALLOON_SUGGEST_BUTTON'),_0x616f42?hs:os),this['suggestButton']['bind']('isEnabled')['to'](this),this['items']['add'](this['suggestButton'])),this['setButtonsVisibility']({'showApplyButton':_0x616f42,'showSuggestButton':_0x1063aa}),this['extendTemplate']({'attributes':{'class':['ck-ai-balloon__toolbar']}});}['setButtonsVisibility']({showApplyButton:_0x2b233b,showSuggestButton:_0x4f5bb6}){this['applyButton']&&(this['applyButton']['isVisible']=_0x2b233b),this['suggestButton']&&(this['suggestButton']['isVisible']=_0x4f5bb6);}['_createButton'](_0x1be3e0,_0x5afcfa){const _0x4a5f26=new kt(this['locale']);return _0x4a5f26['set']({'label':_0x1be3e0,'class':_0x5afcfa,'isVisible':!0x0,'withText':!0x0}),_0x4a5f26;}}class Ka extends Nt{constructor(_0x3015f2){super(_0x3015f2),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-balloon__disclaimer']},'children':[{'tag':'p','attributes':{'class':['ck','ck-ai-balloon__disclaimer-content']},'children':[{'text':as(_0x3015f2,'AI_DISCLAIMER_TEXT')}]}]});}}class Wa extends Nt{constructor(_0xf8aa8a){super(_0xf8aa8a),this['set']('isVisible',!0x0);const _0xfa2f99=new fn('small');_0xfa2f99['isVisible']=!0x0;const _0x4cb2fd=new Nt(this['locale']);_0x4cb2fd['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-suggestion__loader-text']},'children':[as(this['locale'],'AI_CHAT_IS_WRITING')]}),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__loader',this['bindTemplate']['if']('isVisible','ck-hidden',_0x1d0aea=>!_0x1d0aea)]},'children':[_0xfa2f99,_0x4cb2fd]});}}class Ya extends Ta{['focusCycler'];['_config'];['_contentWrapper'];['_streamableContentView'];['_toolbarView'];['_miniToolbarView'];['_loaderView'];['_disclaimerView'];['_focusTracker'];['_keystrokes'];['_dialogContent'];['_focusables'];['_scrollManager'];['_navigationPreviousButton'];['_navigationNextButton'];['_navigationTryAgainButton'];['_navigationCounter'];constructor(_0x47ca91,_0x3a6d7f){super(_0x47ca91),this['set']('isBusy',!0x1),this['set']('isTrackChangesOn',!0x1),this['set']('_isLoading',!0x1),this['set']('_hasError',!0x1),this['_config']=_0x3a6d7f,this['_focusTracker']=new _t(),this['_keystrokes']=new At(),this['_focusables']=this['createCollection'](),this['focusCycler']=new Mt({'focusables':this['_focusables'],'focusTracker':this['_focusTracker'],'keystrokeHandler':this['_keystrokes'],'actions':{'focusPrevious':'shift\x20+\x20tab','focusNext':'tab'}}),this['_dialogContent']=new _0x5ba55d(),this['_addContentWrapper'](_0x3a6d7f),this['_addDisclaimerView'](),this['_addToolbar'](_0x3a6d7f),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'](_0x3a6d7f);});}['render'](){super['render']();for(const _0x1a622e of this['_focusables'])this['_focusTracker']['add'](_0x1a622e['element']);this['_keystrokes']['listenTo'](this['element']),this['_initializeScrollManager']();}['destroy'](){super['destroy'](),this['_scrollManager']&&this['_scrollManager']['destroy']();}['focus'](_0x16ab3e){-0x1===_0x16ab3e?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}['setIsLoading'](_0x4a2114){this['_isLoading']=_0x4a2114;}['setErrorState'](){this['_hasError']=!0x0,this['_miniToolbarView']['toggleShowChangesEnabled'](!0x1);}['clearErrorState'](){this['_hasError']=!0x1,this['_miniToolbarView']['toggleShowChangesEnabled'](!0x0);}['showError'](_0x3a3758){super['showError'](_0x3a3758),this['_dialogContent']['has'](this['_errorView'])||this['_dialogContent']['add'](this['_errorView'],0x0);}['hideError'](){super['hideError'](),this['clearErrorState']();}['showBlockingError'](_0x463a63){super['showBlockingError'](_0x463a63),this['setErrorState']();}['addMiniToolbarItem'](_0x18dfd5){this['_miniToolbarView']['items']['has'](_0x18dfd5)||this['_miniToolbarView']['items']['add'](_0x18dfd5);}['removeMiniToolbarItem'](_0x4159c7){this['_miniToolbarView']['items']['has'](_0x4159c7)&&this['_miniToolbarView']['items']['remove'](_0x4159c7);}['showLoader'](){this['_loaderView']&&(this['_isLoading']=!0x0);}['hideLoader'](){this['_loaderView']&&(this['_isLoading']=!0x1);}['_toggleToolbarButtonsVisibility']({showApplyButton:_0x5b2263,showSuggestButton:_0x13101b}){_0x5b2263=_0x5b2263&&!this['isTrackChangesOn']&&this['_config']['availableActions']['includes']('applySuggestion'),_0x13101b=_0x13101b&&this['_config']['availableActions']['includes']('insertSuggestion'),this['_toolbarView']['setButtonsVisibility']({'showApplyButton':_0x5b2263,'showSuggestButton':_0x13101b});}async['updateContent'](_0x5c34af){await this['_streamableContentView']['update'](_0x5c34af);}['clearContent'](){this['_streamableContentView']['clear']();}['_addContentWrapper'](_0x509a5b){this['_contentWrapper']=new Nt(this['locale']),this['_contentWrapper']['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-actions-balloon-content']},'children':[{'tag':'div','attributes':{'class':['ck-ai-actions-balloon-content-wrapper']},'children':[this['_createLoaderView'](),this['_createStreamableContentView']()]},this['_createMiniToolbar'](_0x509a5b['miniToolbarConfig'])]}),this['_dialogContent']['add'](this['_contentWrapper']);}['_addDisclaimerView'](){this['_disclaimerView']=new Ka(this['locale']),this['_dialogContent']['add'](this['_disclaimerView']);}['_addToolbar']({showApplyButton:_0x54ad49,showSuggestButton:_0x1dbe3b}){this['_toolbarView']=new Fa(this['locale'],_0x54ad49,_0x1dbe3b),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',(_0x4df2f6,_0x2d2627,_0x4a85a8)=>!(_0x4df2f6||_0x2d2627||_0x4a85a8)),this['_toggleToolbarButtonsVisibility']({'showApplyButton':_0x54ad49,'showSuggestButton':_0x1dbe3b}),this['_dialogContent']['add'](this['_toolbarView']);}['_createMiniToolbar'](_0x4e92d4){return this['_miniToolbarView']=new Ca(this['locale'],_0x4e92d4),this['_miniToolbarView']['delegate'](...Qs)['to'](this),this['_miniToolbarView']['on']('toggleShowChanges',()=>{this['_miniToolbarView']['isShowChangesOn']=!this['_miniToolbarView']['isShowChangesOn'],this['fire']('toggleSuggestionDisplayMode',{'showDiff':this['_miniToolbarView']['isShowChangesOn']});}),this['_miniToolbarView']['bind']('isEnabled')['to'](this,'isBusy',this,'_isLoading',(_0xb5d253,_0x2e60cc)=>!(_0xb5d253||_0x2e60cc)),this['_miniToolbarView'];}['_createLoaderView'](){return this['_loaderView']=new Wa(this['locale']),this['_loaderView']['bind']('isVisible')['to'](this,'_isLoading'),this['_loaderView'];}['_createStreamableContentView'](){return this['_streamableContentView']=new un(this['locale']),this['_streamableContentView'];}['_setupMiniToolbarButtons'](){const _0x25847c=new kt(this['locale']),_0x4cec9f=new kt(this['locale']),_0x1d7b49=new $a(this['locale']),_0x1e1366=new kt(this['locale']);_0x25847c['set']({'icon':tt,'label':as(this['locale'],'AI_ACTIONS_TRY_AGAIN'),'tooltip':!0x0,'class':'ck-ai-custom-action-button\x20'+cs}),_0x4cec9f['set']({'icon':_0xb3d9b4,'tooltip':as(this['locale'],'AI_ACTIONS_PREVIOUS_INTERACTION'),'class':'ck-ai-navigation-button\x20ck-ai-previous-button\x20'+cs}),_0x1e1366['set']({'icon':et,'tooltip':as(this['locale'],'AI_ACTIONS_NEXT_INTERACTION'),'class':'ck-ai-navigation-button\x20ck-ai-next-button\x20'+cs}),_0x25847c['bind']('isEnabled')['to'](this,'isBusy',_0x122bd5=>!_0x122bd5),_0x25847c['on']('execute',()=>{this['fire']('tryAgain');}),_0x4cec9f['bind']('isEnabled')['to'](this,'isBusy',_0x187817=>!_0x187817),_0x4cec9f['on']('execute',()=>{this['fire']('showPrevious');}),_0x1e1366['bind']('isEnabled')['to'](this,'isBusy',_0x4d4949=>!_0x4d4949),_0x1e1366['on']('execute',()=>{this['fire']('showNext');}),this['_navigationPreviousButton']=_0x4cec9f,this['_navigationCounter']=_0x1d7b49,this['_navigationNextButton']=_0x1e1366,this['_navigationTryAgainButton']=_0x25847c;}['updateMiniToolbarButtons'](_0xe1664,_0x183fa8){this['_navigationPreviousButton']||this['_setupMiniToolbarButtons']();const _0x57d94b=_0xe1664>0x1;if(this['addMiniToolbarItem'](this['_navigationTryAgainButton']),_0x57d94b){this['addMiniToolbarItem'](this['_navigationPreviousButton']),this['addMiniToolbarItem'](this['_navigationCounter']),this['addMiniToolbarItem'](this['_navigationNextButton']);const _0x46a70b=_0xe1664-_0x183fa8;this['_navigationCounter']['setInteractionCount'](_0x46a70b+'/'+_0xe1664),this['_navigationPreviousButton']['isEnabled']=_0x183fa8<_0xe1664-0x1,this['_navigationNextButton']['isEnabled']=_0x183fa8>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'](_0x1716eb){this['_isLoading']=_0x1716eb;}['resetShowChangesButton'](){this['_miniToolbarView']['isShowChangesOn']=!0x1;}['_initializeScrollManager'](){const _0x312b37=this['_getScrollableElement']();_0x312b37&&!this['_scrollManager']&&(this['_scrollManager']=new Xn(_0x312b37));}['_getScrollableElement'](){return this['_streamableContentView']['element'];}}class $a extends Nt{constructor(_0x26c902){super(_0x26c902);const _0x4fc25a=this['bindTemplate'];this['set']('interactionCount','1/1'),this['setTemplate']({'tag':'span','attributes':{'class':['ck-ai-interaction-counter']},'children':[{'text':_0x4fc25a['to']('interactionCount')}]});}['setInteractionCount'](_0x238090){this['set']('interactionCount',_0x238090);}}class qa extends _0x2db8aa{static get['requires'](){return[rs,Vt,qs,ma,_0x515afb];}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(_0x4f433f){super(_0x4f433f),this['_bodyCollection']=new qt(this['editor']['locale']),this['_bodyCollection']['attachToDom'](),this['_aiConnector']=this['editor']['plugins']['get']('AIConnector'),this['set']('isBusy',!0x1),this['_promiseQueue']=new _n();}['stopInteraction'](){this['_stopInteraction']();}async['executeAction'](_0x5ddd85,_0x23e875,_0x20f37d){if(this['_stopInteraction'](),this['editor']['plugins']['has']('TableSelection')){if(this['editor']['plugins']['get']('TableSelection')['getSelectedTableCells']()){const {modelFragment:_0x367966,anchorData:_0x46c95e}=this['_getExecuteDataInTable']();return this['_executeAction'](_0x5ddd85,_0x367966,_0x46c95e,_0x23e875,_0x20f37d);}}const {modelFragment:_0x2208aa,anchorData:_0x4a8dc6}=this['_getExecuteDataRegular']();return this['_executeAction'](_0x5ddd85,_0x2208aa,_0x4a8dc6,_0x23e875,_0x20f37d);}async['destroy'](){return this['_stopInteraction'](),this['_bodyCollection']['detachFromDom'](),super['destroy']();}['_createActionsBalloonView'](){const _0x2c228b=this['editor']['plugins']['has']('TrackChanges');let _0x585996=this['editor']['config']['get']('ai.availableReplyActions')||[...gn];_0x2c228b||(_0x585996=_0x585996['filter'](_0x3270d1=>'insertSuggestion'!=_0x3270d1));const _0x339f68=this['editor']['commands']['get']('trackChanges'),_0x425000=new Ya(this['editor']['locale'],{'showApplyButton':!0x0,'showSuggestButton':_0x2c228b,'miniToolbarConfig':{'showChanges':'icon'},'availableActions':_0x585996});return _0x425000['bind']('isBusy')['to'](this),_0x339f68&&_0x425000['bind']('isTrackChangesOn')['to'](_0x339f68,'value'),_0x425000['on']('tryAgain',()=>{this['_refreshInteraction']();}),_0x425000['on']('showPrevious',()=>{this['_navigateToPrevious']();}),_0x425000['on']('showNext',()=>{this['_navigateToNext']();}),_0x425000;}['_getExecuteDataRegular'](){const _0x9c24d7=this['editor']['model']['document']['selection'];if(_0x9c24d7['isCollapsed']){const _0x2d3642=gt(_0x9c24d7['getSelectedBlocks']())||this['editor']['model']['schema']['getLimitElement'](_0x9c24d7);this['editor']['model']['change'](_0x2a94ce=>{_0x2a94ce['setSelection'](_0x2d3642,'in');});}const _0x4d0352=_0x9c24d7['getFirstRange'](),_0x2d0b20=this['_wrapWithCommonAncestors'](this['editor']['model']['getSelectedContent'](_0x9c24d7),_0x4d0352['start'],_0x4d0352['end']);this['_copyMarkersToFragment'](_0x2d0b20,_0x9c24d7,{'isTableSelection':!0x1});const _0x582a57=_0x9c24d7['getFirstRange']()['start'],_0x2b7c58=new Map();let _0x69e3b4=_0x2d0b20;for(let _0x4481c4=0x0;_0x4481c4<_0x582a57['path']['length'];_0x4481c4++)_0x2b7c58['set'](_0x69e3b4,_0x582a57['path'][_0x4481c4]),_0x69e3b4=_0x69e3b4['getChild'](0x0);return{'modelFragment':_0x2d0b20,'anchorData':_0x2b7c58};}['_getExecuteDataInTable'](){const _0x1df4b3=this['editor']['model']['document']['selection'],_0x3a4d6f=this['editor']['plugins']['get']('TableSelection')['getSelectionAsFragment'](),_0x211ab4=_0x1df4b3['getFirstRange']()['start']['parent']['parent'],_0x4308e0=this['editor']['model']['createRange'](this['editor']['model']['createPositionBefore'](_0x211ab4),this['editor']['model']['createPositionAfter'](_0x211ab4)),_0xaba44d=this['_wrapWithCommonAncestors'](_0x3a4d6f,_0x4308e0['start'],_0x4308e0['end']);this['_copyMarkersToFragment'](_0xaba44d,_0x1df4b3,{'isTableSelection':!0x0});const _0x1a6433=_0x1df4b3['getFirstRange']()['start'],_0x247804=new Map();let _0x27c036=_0xaba44d;for(let _0x1e4ca9=0x0;_0x1e4ca9<_0x1a6433['path']['length'];_0x1e4ca9++)if(_0x247804['set'](_0x27c036,_0x1a6433['path'][_0x1e4ca9]),_0x1e4ca9<_0x1a6433['path']['length']-0x1)_0x27c036=_0x27c036['getChild'](0x0);else{let _0x4044c5=_0x27c036['nextSibling'];for(;_0x4044c5;)_0x247804['set'](_0x4044c5,_0x1a6433['path'][_0x1e4ca9]),_0x4044c5=_0x4044c5['nextSibling'];}return{'modelFragment':_0xaba44d,'anchorData':_0x247804};}async['_executeAction'](_0x5f366f,_0x553e5c,_0x280213,_0x30a165,_0x4bebfb){const _0x3f10c2=this['editor']['plugins']['get'](qs),_0x396dea=this['editor']['plugins']['get'](ma),_0x4da36b=this['editor']['model']['document']['selection'],_0x47197f=await _0x3f10c2['modelToDataWithIds'](_0x553e5c),_0x545589=this['editor']['model']['document']['version'],_0x5419a7=[..._0x4da36b['getRanges']()];return this['_actionsBalloonView']||(this['_actionsBalloonView']=this['_createActionsBalloonView']()),this['_clearInteractionHistory'](),this['_clearErrorState'](),this['_balloonShowDiff']=!0x1,this['_actionsBalloonView']['resetShowChangesButton'](),this['_actionsBalloonView']['clearContent'](),_0x396dea['open']({'index':0x3e8*Math['random']()%0x3e8,'title':_0x30a165,'icon':_0x4bebfb||_0xadd0ff,'mainView':this['_actionsBalloonView'],'class':'ck-ai-actions-balloon','ranges':_0x5419a7,'id':'aiActionsBalloon'}),this['_setLoadingState'](),this['stopListening'](this['_actionsBalloonView']),this['stopListening'](_0x396dea),this['_interactionParams']={'action':_0x5f366f,'content':_0x47197f,'version':_0x545589,'aiBalloon':_0x396dea,'modelFragment':_0x553e5c,'anchorData':_0x280213},this['_setupApplyListeners'](),this['listenTo'](_0x396dea,'selectionRemoved',()=>{this['_stopInteraction'](),this['_actionsBalloonView']['disableMiniToolbarButtons']();}),this['listenTo'](_0x396dea,'dialogClosed',(_0x4240f9,{id:_0x941272})=>{if('aiActionsBalloon'===_0x941272){for(const _0x4dd606 of this['_interactions']){if(0x0===_0x4dd606['replies']['length']||_0x4dd606['stoppedExplicitly'])continue;const _0x425298=_0x4dd606['replies'][_0x4dd606['replies']['length']-0x1],_0x31669d=_0x425298['changeGroups'][0x0];_0x31669d&&'pending'===_0x31669d['state']&&_0x425298['setChangeGroupState'](0x0,'rejected');}this['_stopInteraction'](),this['_clearInteractionHistory'](),this['stopListening'](this['_actionsBalloonView']),this['stopListening'](_0x396dea);}}),this['_createInteraction'](_0x47197f,_0x545589,_0x396dea,_0x5f366f);}['_setupApplyListeners'](){if(!this['_interactionParams'])return;const {modelFragment:_0x5d9d58,anchorData:_0x4fef21}=this['_interactionParams'];this['listenTo'](this['_actionsBalloonView'],'applySuggestion',()=>{this['_applyChanges'](_0x5d9d58,_0x4fef21,!0x1);}),this['listenTo'](this['_actionsBalloonView'],'insertSuggestion',()=>{this['_applyChanges'](_0x5d9d58,_0x4fef21,!0x0);});}['_wrapWithCommonAncestors'](_0x30aa1a,_0x56956c,_0x348005){const _0x31d06c=this['editor']['model']['createRange'](_0x56956c,_0x348005)['getCommonAncestor'](),_0x3281c9=_0x31d06c['is']('documentFragment')?[]:_0x31d06c['getAncestors']({'includeSelf':!0x0})['slice'](0x1);if(_0x3281c9['length']){const _0x10fe8c=_0x3281c9['map'](_0x4fbaac=>_0x4fbaac['_clone'](!0x1));for(let _0xe4100d=0x1;_0xe4100d<_0x10fe8c['length'];_0xe4100d++)_0x10fe8c[_0xe4100d-0x1]['_appendChild'](_0x10fe8c[_0xe4100d]);return _0x10fe8c[_0x10fe8c['length']-0x1]['_appendChild'](_0x30aa1a),new _0x23a0e5(_0x10fe8c[0x0]);}return _0x30aa1a;}['_copyMarkersToFragment'](_0x16c7a,_0x24401c,_0x437eae={'isTableSelection':!0x1}){const _0x463c83=this['editor']['model'],_0x1349fc=Array['from'](_0x24401c['getRanges']()),_0xaacc1f=_0x24401c['getFirstRange']()['start'];for(const _0x5a33e8 of _0x463c83['markers']){if(_0x5a33e8['name']['startsWith']($s)||!_0x5a33e8['affectsData'])continue;const _0x3f7c44=_0x5a33e8['getRange']();if(!_0x1349fc['some'](_0x18c1b2=>_0x18c1b2['containsRange'](_0x3f7c44,!0x0)))continue;const _0x2a2b73=this['_regularCalculateMarkerPath'](_0x3f7c44['start'],_0xaacc1f,_0x437eae['isTableSelection']),_0x59aa57=this['_regularCalculateMarkerPath'](_0x3f7c44['end'],_0xaacc1f,_0x437eae['isTableSelection']),_0x3c0204=_0x463c83['createPositionFromPath'](_0x16c7a,_0x2a2b73),_0x3b2bf2=_0x463c83['createPositionFromPath'](_0x16c7a,_0x59aa57);if(!_0x3c0204['isEqual'](_0x3b2bf2)){const _0x2e0b65=_0x463c83['createRange'](_0x3c0204,_0x3b2bf2);_0x16c7a['markers']['set'](_0x5a33e8['name'],_0x2e0b65);}}}['_regularCalculateMarkerPath'](_0x330b38,_0x2b4a37,_0x5ccc89=!0x1){const _0x338114=[..._0x330b38['path']['slice']()];for(let _0x2e2aff=0x0;_0x2e2aff<Math['max'](_0x2b4a37['path']['length'],_0x330b38['path']['length']);_0x2e2aff++){const _0x335a2f=_0x2b4a37['path'][_0x2e2aff]||0x0,_0x58108e=(_0x330b38['path'][_0x2e2aff]||0x0)-_0x335a2f;if(_0x338114[_0x2e2aff]=_0x58108e,0x0!==_0x58108e&&!_0x5ccc89)break;}return _0x338114;}async['_createInteraction'](_0x3802b9,_0x5f0f4b,_0x1416d3,_0x2f2397){const _0x326e17=this['editor'];this['_interactionParams']||(this['_interactionParams']={'action':_0x2f2397,'content':_0x3802b9,'version':_0x5f0f4b,'aiBalloon':_0x1416d3,'modelFragment':this['editor']['model']['getSelectedContent'](this['editor']['model']['document']['selection']),'anchorData':new Map()});const _0x12a364=new Ga({'connector':this['_aiConnector'],'editor':_0x326e17,'content':_0x3802b9,'version':_0x5f0f4b,..._0x2f2397});this['_interactions']['push'](_0x12a364);const _0xb57295=(_0xa7c03d,_0x43b7de=!0x1,_0x383cf9='streaming')=>this['_promiseQueue']['enqueue'](async _0x5aa2ed=>{try{const _0x163dea=Ss({'editor':_0x326e17,'changeGroups':_0xa7c03d['changeGroups'],'documentContextContent':_0xa7c03d['documentContextContent'],'showDiff':_0x43b7de,'trimUnchanged':!0x1});_0x163dea['length']&&await this['_actionsBalloonView']['updateContent']({'part':_0x163dea[0x0],'renderingStrategy':_0x383cf9,'abortSignal':_0x5aa2ed});}catch(_0x23433b){if(this['_isAbortError'](_0x23433b))return;throw _0x23433b;}});_0x12a364['on']('replyCreated',(_0x1cf739,_0x2abfff)=>{this['_actionsBalloonView']['hideLoader'](),this['_actionsBalloonView']['startAutoScroll'](),_0xb57295(_0x2abfff)['catch'](_0x3e2318=>{this['_isAbortError'](_0x3e2318)||(console['error']('Error\x20updating\x20content\x20in\x20replyCreated:',_0x3e2318),this['_setErrorState'](_0x12a364));});}),_0x12a364['on']('replyContentUpdated',(_0x2e98bc,_0x5013f8)=>{_0xb57295(_0x5013f8)['catch'](_0x50fe4e=>{this['_isAbortError'](_0x50fe4e)||(console['error']('Error\x20updating\x20content\x20in\x20replyContentUpdated:',_0x50fe4e),this['_setErrorState'](_0x12a364));});}),_0x12a364['on']('interactionFinished',async()=>{try{await this['_clearLoadingState'](),this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']),await this['_promiseQueue']['queueEmptyPromise'];}catch(_0x6b7b1b){this['_isAbortError'](_0x6b7b1b)||(console['error']('Error\x20clearing\x20loading\x20state\x20in\x20interactionFinished:',_0x6b7b1b),this['_setErrorState'](_0x12a364));}finally{this['_actionsBalloonView']['stopAutoScroll']();}}),this['listenTo'](this['_actionsBalloonView'],'toggleSuggestionDisplayMode',async(_0x2f0e9b,{showDiff:_0x37a00d})=>{try{this['_balloonShowDiff']=_0x37a00d;const _0x245a1b=this['_interaction']['replies'][this['_interaction']['replies']['length']-0x1];_0x245a1b&&await _0xb57295(_0x245a1b,_0x37a00d,'static');}catch(_0x1cbe9a){this['_isAbortError'](_0x1cbe9a)||(console['error']('Error\x20updating\x20content\x20in\x20toggleSuggestionDisplayMode:',_0x1cbe9a),this['_setErrorState'](_0x12a364));}}),_0x12a364['on']('replyChangeGroupStateUpdated',()=>{const _0x4498d9={'positiveCount':_0x12a364['replies']['reduce']((_0x125aac,_0x20fc6b)=>_0x125aac+_0x20fc6b['changeGroups']['filter'](_0x3525b8=>'accepted'===_0x3525b8['state'])['length'],0x0),'totalCount':_0x12a364['replies']['reduce']((_0x326fc3,_0x447489)=>_0x326fc3+_0x447489['changeGroups']['length'],0x0)},_0x4ed386=_0x12a364['actionCallId'],_0x2cbcb7=_0x12a364['actionName'];_0x2cbcb7?this['_aiConnector']['upsertAIActionRating'](_0x2cbcb7,_0x4ed386,_0x4498d9):this['_aiConnector']['upsertCustomAIActionRating'](_0x4ed386,_0x4498d9);}),this['_setLoadingState']();try{const _0x41c4fd=await _0x12a364['start']();return this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']),_0x41c4fd;}catch(_0x3a726f){if(this['_isAbortError'](_0x3a726f))return;this['_actionsBalloonView']['hideLoader'](),this['_setErrorState'](_0x12a364);}}['_applyChanges'](_0x2e4e0f,_0x29ba16,_0x7dd551){const _0x1cf6ee=this['editor'];if(_0x7dd551&&!_0x1cf6ee['plugins']['has']('TrackChanges'))throw new ot('ai-no-track-changes',null);const _0x235ff8=this['editor']['plugins']['get'](_0x515afb),_0x1d1a4a=this['_interactions'][this['_interactions']['length']-0x1-this['_currentInteractionIndex']];if(!_0x1d1a4a||!_0x1d1a4a['replies']['length'])return;const _0x5804e7=_0x1d1a4a['replies'][_0x1d1a4a['replies']['length']-0x1],_0x110f34=_0x5804e7['changeGroups'];_0x5804e7['setChangeGroupState'](0x0,'accepted');let _0x307e85=Ks({'editor':_0x1cf6ee,'reply':_0x5804e7,'interaction':_0x1d1a4a,'groups':_0x110f34,'transform':!0x1,'documentCompare':_0x235ff8,'documentCompareOptions':{'anchor':_0x1cf6ee['model']['createPositionAt'](_0x2e4e0f,0x0),'markDeletions':_0x7dd551}});_0x307e85=this['_filterOperationsOutsideRange'](_0x307e85,_0x29ba16);for(const _0x50bed0 of _0x307e85)this['_anchorOperation'](_0x29ba16,_0x50bed0,_0x1cf6ee['model']['document']['getRoot']());const _0x27919c=_0x1d1a4a['getDocumentContext']()['version'],_0x5f0088=_0x1cf6ee['model']['document']['history']['getOperations'](_0x27919c),_0x17a9ca={'document':_0x1cf6ee['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1},_0x46f2eb=_0x4693a2(_0x307e85,_0x5f0088,_0x17a9ca)['operationsA'];_0x1cf6ee['model']['change'](_0x32e627=>{if(_0x32e627['setSelection'](_0x1cf6ee['model']['document']['selection']['focus']),_0x7dd551)_0x1cf6ee['plugins']['get']('TrackChangesEditing')['_applyOperationsAsSuggestions'](_0x46f2eb);else{for(const _0xeb5402 of _0x46f2eb)_0xeb5402['baseVersion']=_0x1cf6ee['model']['document']['version'],Ws(_0x1cf6ee,_0xeb5402),_0x32e627['batch']['addOperation'](_0xeb5402),_0x1cf6ee['model']['applyOperation'](_0xeb5402);}}),this['editor']['plugins']['get']('AIBalloon')['close']();}['_filterOperationsOutsideRange'](_0x9ebe27,_0x282cff){return _0x9ebe27['filter'](_0x5b8a30=>{if('rename'==_0x5b8a30['type']){const _0x5d134d=_0x5b8a30['position']['nodeAfter'];return!_0x282cff['has'](_0x5d134d);}if(_0x5b8a30['type']['indexOf']('Attribute')>-0x1){const _0x2ed340=_0x5b8a30['range']['start']['nodeAfter'];return!_0x282cff['has'](_0x2ed340);}return!0x0;});}['_anchorOperation'](_0x408ce2,_0x2110fb,_0x2c2b0a){const _0x573993=_0x2110fb['clone']();for(const _0x5ab457 in _0x2110fb){const _0x1abe86=_0x2110fb[_0x5ab457];_0x1abe86 instanceof _0x34cb53?_0x2110fb[_0x5ab457]=new _0x34cb53(_0x2fa5ca(_0x1abe86['start']),_0x2fa5ca(_0x1abe86['end'])):_0x1abe86 instanceof _0x31292e&&(_0x2110fb[_0x5ab457]=_0x2fa5ca(_0x1abe86));}if(['insert','move','remove','reinsert','split','merge']['includes'](_0x573993['type'])){if(_0x573993['isDocumentOperation']=!0x1,_0x573993['baseVersion']=null,'remove'==_0x573993['type']){const _0x1d82a2=_0x573993['sourcePosition'],_0x4280cc=_0x573993['howMany'];new _0x30ee68(_0x1d82a2,_0x4280cc)['_execute']();}else _0x573993['_execute']();}function _0x2fa5ca(_0x5e7661){if('$graveyard'==_0x5e7661['root']['rootName'])return _0x5e7661;const _0x54366e=[];let _0x5f5dd9=_0x5e7661['root'];for(let _0x5312a2=0x0;_0x5312a2<_0x5e7661['path']['length'];_0x5312a2++){const _0x12b54b=_0x408ce2['get'](_0x5f5dd9)||0x0;_0x54366e[_0x5312a2]=_0x5e7661['path'][_0x5312a2]+_0x12b54b,_0x5f5dd9=_0x5f5dd9['getChildAtOffset'](_0x5e7661['path'][_0x5312a2]);}return new _0x31292e(_0x2c2b0a,_0x54366e,_0x5e7661['stickiness']);}}['_refreshInteraction'](){if(!this['_interactionParams'])return;this['_interactions']['length']>0x0&&this['_stopInteraction'](),this['_currentInteractionIndex']=0x0,this['_balloonShowDiff']=!0x1;const {action:_0x4153be,content:_0x2c5469,version:_0x35f669,aiBalloon:_0x5a0f54}=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'](_0x2c5469,_0x35f669,_0x5a0f54,_0x4153be)['catch'](_0x319fe9=>{this['_isAbortError'](_0x319fe9)||console['error']('Error\x20refreshing\x20interaction:',_0x319fe9);});}['_isAbortError'](_0x2582fc){return!!_0x2582fc['message']&&_0x2582fc['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 _0x56f87d=this['_interactions']['length'];this['_currentInteractionIndex']<_0x56f87d-0x1&&this['_displayInteractionAtIndex'](this['_currentInteractionIndex']+0x1);}['_navigateToNext'](){this['_currentInteractionIndex']>0x0&&this['_displayInteractionAtIndex'](this['_currentInteractionIndex']-0x1);}async['_displayInteractionAtIndex'](_0xe13af3){if(!this['_interactionParams'])return;this['_currentInteractionIndex']=_0xe13af3;const _0x2a5064=this['_interactions'][this['_interactions']['length']-0x1-this['_currentInteractionIndex']];if(!_0x2a5064)return;if(_0x2a5064['hasError'])return this['_setErrorState'](_0x2a5064),void this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']);if(!_0x2a5064['replies']['length'])return;this['_actionsBalloonView']['hideError'](),this['_interactionParams']&&this['_clearErrorState']();const _0x15943e=_0x2a5064['replies'][_0x2a5064['replies']['length']-0x1];if(_0x15943e){const _0x5d6f3f=this['editor'];try{const _0x1b336f=Ss({'editor':_0x5d6f3f,'changeGroups':_0x15943e['changeGroups'],'documentContextContent':_0x15943e['documentContextContent'],'showDiff':this['_balloonShowDiff'],'trimUnchanged':!0x1});await new Promise(_0x5a21d0=>setTimeout(_0x5a21d0,0x32)),await this['_actionsBalloonView']['updateContent']({'part':_0x1b336f[0x0],'renderingStrategy':'static','abortSignal':new AbortController()['signal']});}catch(_0x4974cd){this['_isAbortError'](_0x4974cd)||console['error']('Error\x20updating\x20content\x20during\x20navigation:',_0x4974cd);}}this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']);}['_setLoadingState'](){this['_actionsBalloonView']['setIsLoading'](!0x0),this['isBusy']=!0x0;}async['_setErrorState'](_0xfbefb7){const _0x2e7c65=as(this['editor']['locale'],'AI_ACTIONS_GENERIC_ERROR');this['_actionsBalloonView']['showError'](_0x2e7c65),_0xfbefb7['hasError']=!0x0,await this['_promiseQueue']['queueEmptyPromise'],this['_actionsBalloonView']['setErrorState'](),this['_actionsBalloonView']['toggleIsLoading'](!0x0);}['_clearErrorState'](){this['_actionsBalloonView']['hideError'](),this['_actionsBalloonView']['toggleIsLoading'](!0x1);}async['_clearLoadingState'](){await this['_promiseQueue']['queueEmptyPromise'],this['isBusy']=!0x1,this['_actionsBalloonView']['setIsLoading'](!0x1);}}class Qa extends _0x2db8aa{static get['requires'](){return[Ma,Va,qa];}static get['pluginName'](){return'AIQuickActions';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x112466){super(_0x112466),_0x112466['config']['define']('ai.quickActions',{'extraCommands':[],'removeCommands':[],'isSearchEnabled':!0x0});}}class Xa extends Nt{['resultResponseView'];['acceptButtonView'];['dismissButtonView'];['infoButtonView'];['outdatedButtonView'];constructor(_0x3accee,_0x56ae26){super(_0x3accee),this['id']=_0x56ae26,this['set']('status','pending'),this['set']('changeId',_0x56ae26),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',(_0x4bcf7c,_0x6af2f5)=>{_0x6af2f5&&_0x6af2f5['target']&&'A'===_0x6af2f5['target']['tagName']&&_0x6af2f5['preventDefault'](),this['fire']('activateChange',{'id':_0x56ae26,'source':this,'uiInteraction':'click'});}),this['on']('mouseover',()=>{this['fire']('activateChange',{'id':_0x56ae26,'source':this,'uiInteraction':'hover'});}),this['on']('mouseout',()=>{this['fire']('deactivateChange',{'origin':'panel','id':_0x56ae26,'source':this});});}['setItemAsActive'](){this['isActive']=!0x0;}['setItemAsInactive'](){this['isActive']=!0x1;}['_createResultResponseView'](){const _0x3564cf=new Nt(this['locale']);return _0x3564cf['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',_0x44dbc5=>!_0x44dbc5)]}}),_0x3564cf;}['_createAcceptButtonView'](){const _0x35c363=new kt(this['locale']);return _0x35c363['set']({'label':as(this['locale'],'AI_REVIEW_MODE_ACCEPT_CHANGE'),'withText':!0x0}),_0x35c363['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x4299f2=>{this['fire']('acceptChange',{'id':this['changeId']}),_0x4299f2['stopPropagation']();})},'attributes':{'class':[this['bindTemplate']['if']('status','ck-hidden',_0x177c82=>'pending'!==_0x177c82&&'accepted'!==_0x177c82),this['bindTemplate']['if']('status',hs,_0x42007d=>'pending'===_0x42007d),this['bindTemplate']['if']('status',cs,_0x2ed09f=>'pending'!==_0x2ed09f),this['bindTemplate']['if']('status','ck-ai_review__check-run-result-status-button',_0x4f2eb3=>'accepted'===_0x4f2eb3)]}}),this['on']('change:status',(_0x454a17,_0x33ddfe,_0x2746b6)=>{_0x35c363['isEnabled']='pending'===_0x2746b6,'accepted'===_0x2746b6&&(_0x35c363['label']=as(this['locale'],'AI_REVIEW_MODE_CHECK_STATUS_ACCEPTED'),_0x35c363['icon']=_0x253f15);}),_0x35c363;}['_createDismissButtonView'](){const _0x4ecbf4=new kt(this['locale']);return _0x4ecbf4['set']({'label':as(this['locale'],'AI_REVIEW_MODE_DISMISS_CHANGE'),'withText':!0x0}),_0x4ecbf4['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x14e67b=>{this['fire']('dismissChange',{'id':this['changeId']}),_0x14e67b['stopPropagation']();})},'attributes':{'class':[cs,this['bindTemplate']['if']('status','ck-hidden',_0x33d547=>'pending'!==_0x33d547&&'rejected'!==_0x33d547),this['bindTemplate']['if']('status','ck-ai_review__check-run-result-dismiss-button',_0x51c207=>'pending'===_0x51c207),this['bindTemplate']['if']('status','ck-ai_review__check-run-result-status-button',_0x3088f4=>'rejected'===_0x3088f4)]}}),this['on']('change:status',(_0x3da977,_0x507687,_0x36b268)=>{_0x4ecbf4['isEnabled']='pending'===_0x36b268,'rejected'===_0x36b268&&(_0x4ecbf4['label']=as(this['locale'],'AI_REVIEW_MODE_CHECK_STATUS_REJECTED'),_0x4ecbf4['icon']=_0x6494e0);}),_0x4ecbf4;}['_createInfoButtonView'](){const _0x468f53=new kt(this['locale']);return _0x468f53['set']({'label':as(this['locale'],'AI_REVIEW_MODE_LEARN_MORE'),'icon':_0x147769,'tooltip':!0x0,'isToggleable':!0x0,'role':'menuitemcheckbox','class':cs+'\x20ck-ai_review__check-run-result-info-button\x20ck-hidden'}),_0x468f53['bind']('isOn')['to'](this,'isInfoToggleOn',_0x11c18a=>_0x11c18a),_0x468f53['on']('execute',()=>{this['isInfoToggleOn']=!this['isInfoToggleOn'];}),_0x468f53;}['_createOutdatedButtonView'](){const _0x50d274=new kt(this['locale']);return _0x50d274['set']({'label':as(this['locale'],'AI_REVIEW_MODE_CHECK_STATUS_OUTDATED'),'icon':it,'withText':!0x0,'isEnabled':!0x1}),_0x50d274['extendTemplate']({'attributes':{'class':[cs,'ck-ai_review__check-run-result-status-button',this['bindTemplate']['if']('status','ck-hidden',_0x434174=>'outdated'!==_0x434174)],'disabled':'disabled'}}),_0x50d274;}}class za extends Qt{['resultItemView'];['_pinnedRectIndex']=void 0x0;['_pinnedTargetElement']=void 0x0;['_pinnedTargetChangeId']=void 0x0;constructor(_0x3d6bd1,_0x4fbaaa){super(_0x3d6bd1),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']()),_0x4fbaaa['add'](this);}['render'](){super['render'](),this['_setupClickOutsideHandler']();}['updateContent'](_0x3ede74){this['resultItemView']['changeId']=_0x3ede74['id'],this['resultItemView']['resultResponseView']['element']['innerHTML']=_0x3ede74['contentDiffed'];}['showBalloon'](_0x1c052d,_0x3de0f4,_0x35ba70,_0x575f70,_0x3c47a6,_0x2c55f5){const _0x49875e=_0x3de0f4();if(!_0x49875e)return;this['updateContent'](_0x1c052d),this['show']();const _0x2b7d2c=Array['from'](_0x49875e['getClientRects']())['reverse'](),_0x901172=this['_getPointedRectIndexFromEvent'](_0x35ba70,_0x2b7d2c),_0x12e0cd=_0x2b7d2c[_0x901172??0x0];'click'===_0x575f70?(this['isDiffActive']=!0x0,this['pin']({'target':()=>this['_getBestRectPositionOnClick'](_0x3de0f4(),_0x901172,_0x1c052d['id'],_0x3c47a6,_0x2c55f5)||_0x12e0cd})):'hover'===_0x575f70&&(this['isDiffActive']=!0x1,this['pin']({'target':()=>this['_getBestRectPositionOnHover'](_0x3de0f4(),_0x901172,_0x1c052d['id'])||_0x12e0cd}));}['hideBalloon'](){this['hide'](),this['unpin'](),this['_pinnedRectIndex']=void 0x0,this['_pinnedTargetElement']=void 0x0,this['_pinnedTargetChangeId']=void 0x0;}['hideDiffInBalloon'](){this['resultItemView']['showDiff']=!0x1;}['showDiffInBalloon'](){this['resultItemView']['showDiff']=!0x0;}['deactivateChange'](){this['fire']('deactivateChange',{'origin':'balloon'});}['_setupClickOutsideHandler'](){Xt({'emitter':this,'activator':()=>this['isVisible'],'contextElements':()=>{const _0x4c1567=[this['element']];return this['_pinnedTargetElement']&&_0x4c1567['push'](this['_pinnedTargetElement']),_0x4c1567;},'callback':()=>{this['hide'](),this['unpin'](),this['deactivateChange'](),this['_pinnedTargetElement']=void 0x0,this['_pinnedRectIndex']=void 0x0,this['_pinnedTargetChangeId']=void 0x0;}});}['_createContentView'](){const _0x4c14c2=new Nt();return this['resultItemView']=new Xa(this['locale'],''),this['resultItemView']['resultResponseView']['extendTemplate']({'attributes':{'class':['ck-content']}}),this['resultItemView']['delegate']('acceptChange','dismissChange')['to'](this),_0x4c14c2['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']]}]}),_0x4c14c2;}['_getBestRectPositionOnClick'](_0x2ed2ca,_0xe2103f,_0x2210a8,_0x58efa3,_0x258730){if(!_0x2ed2ca)return null;const _0x3f68d7=this['position']['replace']('arrow_',''),_0x2a652e=Array['from'](_0x2ed2ca['getClientRects']());let _0x3ff514,_0x400b01=_0x2a652e['reverse']();return void 0x0!==_0xe2103f&&this['_isPinnedRectVisible'](_0x400b01[_0xe2103f],_0x58efa3,_0x258730)?(_0x3ff514=_0x400b01[_0xe2103f],this['_pinnedRectIndex']=_0xe2103f):this['_isPinnedRectVisible'](_0x400b01[0x0],_0x58efa3,_0x258730)&&void 0x0===_0xe2103f?_0x3ff514=_0x400b01[0x0]:(_0x400b01='s'==_0x3f68d7[0x0]?[..._0x2a652e]['reverse']():_0x2a652e,_0x400b01['forEach'](_0x549b61=>{this['_isPinnedRectVisible'](_0x549b61,_0x58efa3,_0x258730)&&(_0x3ff514=_0x549b61);})),this['_pinnedTargetChangeId']=_0x2210a8,this['_pinnedTargetElement']=_0x2ed2ca,_0x3ff514||_0x2ed2ca['getBoundingClientRect']();}['_getBestRectPositionOnHover'](_0x2676c1,_0x14d688,_0xc816c7){if(!_0x2676c1)return null;const _0x3711b6=Array['from'](_0x2676c1['getClientRects']())['reverse']();if(void 0x0===this['_pinnedRectIndex']&&void 0x0!==_0x14d688&&this['_pinnedTargetChangeId']!==_0xc816c7)return this['_pinnedRectIndex']=_0x14d688,this['_pinnedTargetElement']=_0x2676c1,this['_pinnedTargetChangeId']=_0xc816c7,_0x3711b6[_0x14d688];if(void 0x0!==this['_pinnedRectIndex']&&this['_pinnedTargetChangeId']===_0xc816c7){if(_0x2676c1!==this['_pinnedTargetElement'])return Array['from'](this['_pinnedTargetElement']['getClientRects']())['reverse']()[this['_pinnedRectIndex']];return _0x3711b6[this['_pinnedRectIndex']];}return void 0x0!==_0x14d688&&this['_pinnedTargetChangeId']!==_0xc816c7?(this['_pinnedRectIndex']=_0x14d688,this['_pinnedTargetElement']=_0x2676c1,this['_pinnedTargetChangeId']=_0xc816c7,_0x3711b6[_0x14d688]):_0x2676c1['getBoundingClientRect']();}['_getPointedRectIndexFromEvent'](_0x40f3d9,_0x5a63c5){if(_0x40f3d9)for(let _0x68ecff=0x0;_0x68ecff<_0x5a63c5['length'];_0x68ecff++){const _0x2a0673=_0x5a63c5[_0x68ecff];if(_0x40f3d9['clientX']>=_0x2a0673['left']-0x3&&_0x40f3d9['clientX']<=_0x2a0673['right']+0x3&&_0x40f3d9['clientY']>=_0x2a0673['top']-0x3&&_0x40f3d9['clientY']<=_0x2a0673['bottom']+0x3)return _0x68ecff;}}['_isPinnedRectVisible'](_0x4a7a9d,_0x3610bc,_0x2a79e3){const _0x639d1b=new ut(_0x4a7a9d),_0x37bbf1=_0x3610bc||document['documentElement'],_0x25c862=_0x639d1b['getIntersection'](bt(_0x2a79e3)),_0x1e516a=new ut(_0x37bbf1)['getIntersection'](_0x639d1b);return!!(_0x25c862&&_0x1e516a&&_0x639d1b['width']>0x0);}}const ja=['getReviewCheckList','runReviewCheck','abortReviewStream','toggleDiff','acceptAllChanges','leaveReviewCoreResultList','activateChange','deactivateChange','acceptChange','dismissChange','learnMore','finishReview','retryReview'];class Ja extends _0x333531{['_mainView'];['_balloonSuggestionView'];['_bodyCollection'];static get['requires'](){return[ns];}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x46d8ac){super(_0x46d8ac),this['_bodyCollection']=new qt(this['context']['locale']),this['_bodyCollection']['attachToDom'](),this['_mainView']=this['createMainView'](),this['_mainView']['delegate'](...ja)['to'](this),this['_balloonSuggestionView']=new za(this['context']['locale'],this['_bodyCollection']),this['_balloonSuggestionView']['delegate']('acceptChange','dismissChange','deactivateChange')['to'](this);}['init'](){const _0x4f78b6=this['context']['plugins']['get']('AITabs');this['registerTab'](_0x4f78b6);}['destroy'](){this['_bodyCollection']['detachFromDom'](),super['destroy']();}['setAvailableChecks'](_0x42a70a){if(!this['_mainView']['reviewCheckListView']['hasChecks']()){const _0x39386f=!this['context']['config']['get']('ai.models.showModelSelector');this['_mainView']['reviewCheckListView']['setChecks'](_0x42a70a,_0x39386f);}this['_mainView']['showReviewCheckListView']();}['showReviewCheckList'](){this['fire']('getReviewCheckList');}['showCheckRunResults'](_0x5eff46){_0x5eff46&&('error-general'!==_0x5eff46['status']?'error-chunk'!==_0x5eff46['status']?this['_mainView']['showReviewCheckResultsView']():this['showChunkErrorView']():this['showGeneralResultsErrorView']());}['showCheckRunResult'](_0x25abdf){this['_mainView']['addCheckRunResult'](_0x25abdf);}['showGeneralResultsErrorView'](){this['_mainView']['showGeneralResultsErrorView']();}['showGeneralReviewCoreErrorView'](_0x5670e6){this['_mainView']['showGeneralReviewCoreErrorView'](_0x5670e6??as(this['context']['locale'],'AI_REVIEW_INITIALIZATION_ERROR_MESSAGE'));}['showChunkErrorView'](){this['_mainView']['showChunkErrorView']();}['setCheckResultTitle'](_0x1d74ec,_0x50330a){this['_mainView']['reviewCheckResultsView']['setTitle'](_0x1d74ec,_0x50330a);}['setActiveStateInResults'](_0x1c858c){this['_mainView']['reviewCheckResultsView']['getResults']()['forEach'](_0x495d2b=>{_0x495d2b['id']===_0x1c858c&&_0x495d2b['setItemAsActive']();});}['resetActiveStateInResults'](){this['_mainView']['reviewCheckResultsView']['getResults']()['forEach'](_0x4a2da3=>_0x4a2da3['setItemAsInactive']());}['updateChangeState'](_0x2a0c22,_0x292557){'accepted'===_0x292557||'rejected'===_0x292557||'outdated'===_0x292557?this['_mainView']['reviewCheckResultsView']['hideResult'](_0x2a0c22,_0x292557):this['_mainView']['reviewCheckResultsView']['showResult'](_0x2a0c22,_0x292557);}['showReviewCompletedView'](){this['_mainView']['showReviewCompletedView']();}['showActionsWhenResultIsReady'](){this['_mainView']['showActionsWhenResultIsReady']();}['showNoChangesView'](){this['_mainView']['showNoChangesView']();}['hideActionsWhenResultIsReady'](){this['_mainView']['hideActionsWhenResultIsReady']();}['showChangeBalloon'](_0x28a766,_0x420cab,_0x1a1348,_0x2b6371,_0x4b4d52,_0x1c255d){this['_balloonSuggestionView']['showBalloon'](_0x28a766,_0x420cab,_0x1a1348,_0x2b6371,_0x4b4d52,_0x1c255d);}['hideChangeBalloon'](){this['_balloonSuggestionView']['hideBalloon']();}['hideDiffInBalloon'](){this['_balloonSuggestionView']['hideDiffInBalloon']();}['showDiffInBalloon'](){this['_balloonSuggestionView']['showDiffInBalloon']();}['getChangeElement'](_0x1f607b){const _0x447bd1=this['_mainView']['reviewCheckResultsView']['getResults']()['find'](_0x79a655=>_0x79a655['id']===_0x1f607b);return _0x447bd1?_0x447bd1['element']:null;}['deactivateChange'](){this['_balloonSuggestionView']['deactivateChange']();}}class Za extends Nt{constructor(_0x437a08){super(_0x437a08),this['set']('isVisible',!0x1),this['set']('errorMessage','');const _0x38a56b=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai_review__general-error-container',_0x38a56b['if']('isVisible','ck-hidden',_0x6e1c0=>!_0x6e1c0)]},'children':[{'tag':'p','attributes':{'class':'ck\x20ck-ai-notification\x20ck-ai-notification_error'},'children':[{'text':_0x38a56b['to']('errorMessage')}]}]});}}class to extends Nt{['reviewCoreHeader'];['generalErrorView'];['reviewCheckListView'];['reviewCheckResultsView'];['reviewCompletedView'];constructor(_0x330704,_0x177f96){super(_0x330704),this['reviewCoreHeader']=_0x177f96['header'],this['generalErrorView']=new Za(_0x330704),this['reviewCheckListView']=_0x177f96['list'],this['reviewCheckListView']['delegate'](...ja)['to'](this),this['reviewCheckResultsView']=_0x177f96['results'],this['reviewCheckResultsView']['delegate'](...ja)['to'](this),this['reviewCompletedView']=_0x177f96['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'](_0x1e388f){this['reviewCheckResultsView']['addResult'](_0x1e388f),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'](_0x41b77f){this['generalErrorView']['set']('isVisible',!0x0),this['generalErrorView']['errorMessage']=_0x41b77f;}['showGeneralResultsErrorView'](){this['reviewCheckResultsView']['set']('isLoading',!0x1),this['showActionsWhenResultIsReady'](),this['reviewCheckResultsView']['showGeneralErrorMessage']();}['showChunkErrorView'](){this['reviewCheckResultsView']['set']('isLoading',!0x1),this['showActionsWhenResultIsReady'](),this['reviewCheckResultsView']['showChunkErrorMessage']();}}class eo extends kt{constructor(_0x5821e3,_0x2a49fc){super(_0x2a49fc),this['set']({'label':_0x5821e3,'withText':!0x0,'class':os}),this['on']('execute',()=>{this['fire']('finishReview');});}}class io extends Pt{['_resultViews'];['_resultsHeader'];['reviewDisclaimer'];['_cancelButtonView'];['_acceptAllButtonView'];['_exitReviewButtonView'];['_toggleDiffButtonView'];['_errorMessageView'];['_finishReviewButtonView'];['_contents'];constructor(_0x55eba8,_0xf8f719){super(_0x55eba8),this['_contents']=_0xf8f719,this['_resultViews']=new _0x5ba55d(),this['_cancelButtonView']=this['_createCancelButtonView'](),this['_acceptAllButtonView']=this['_createAcceptAllButtonView'](),this['_exitReviewButtonView']=this['_createExitReviewButtonView'](),this['_toggleDiffButtonView']=this['_createToggleDiffButtonView'](),this['_finishReviewButtonView']=this['_createFinishReviewButtonView'](),this['_resultsHeader']=this['_createResultHeaderView'](),this['_errorMessageView']=this['_createErrorView'](),this['reviewDisclaimer']=new jr(_0x55eba8),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 _0x44c77a=this['_createCombinedSkeletonLoader'](),_0x4f20a8=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run',_0x4f20a8['if']('isLoading','ck-ai_review__check-run_loading',_0x30873f=>_0x30873f),_0x4f20a8['if']('isResultReady','ck-ai_review__check-run_ready',_0x5116fc=>_0x5116fc),_0x4f20a8['if']('isVisible','ck-hidden',_0x52b74a=>!_0x52b74a)]},'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',_0xf0661=>_0xf0661)]},'children':this['_resultViews']},_0x44c77a]},this['reviewDisclaimer']]});}['clearResults'](){this['_resultViews']['clear']();}['getResults'](){return this['_resultViews'];}['addResult'](_0x40206c){const _0x5787a7=new Xa(this['locale'],_0x40206c['id']);_0x5787a7['delegate']('acceptChange','dismissChange','activateChange','deactivateChange')['to'](this),this['_resultViews']['add'](_0x5787a7),_0x5787a7['resultResponseView']['element']['innerHTML']=_0x40206c['contentDiffed'];}['hideResult'](_0xe8dfad,_0x934eb5){if('pending'===_0x934eb5)return;const _0x1630fc=this['_resultViews']['find'](_0x26d614=>_0x26d614['id']===_0xe8dfad);_0x1630fc&&(_0x1630fc['status']=_0x934eb5,_0x1630fc['element']?.['classList']['add']('ck-ai_review__check-run-result_grayout'));}['showResult'](_0x2c9d5b,_0x221ff5){if('pending'!==_0x221ff5)return;const _0x146911=this['_resultViews']['find'](_0x33fd61=>_0x33fd61['id']===_0x2c9d5b);_0x146911&&(_0x146911['status']=_0x221ff5,_0x146911['element']?.['classList']['remove']('ck-ai_review__check-run-result_grayout'));}['setTitle'](_0x2ee61,_0x2315b4){this['headerTitle']=_0x2ee61,this['headerSubtitle']=_0x2315b4||'';}['showChunkErrorMessage'](){this['errorType']='chunk',this['showErrorMessage']=!0x0;}['showGeneralErrorMessage'](){this['isError']=!0x0,this['errorType']='general',this['showErrorMessage']=!0x0;}['resetErrorState'](){this['isError']=!0x1,this['errorType']='general',this['showErrorMessage']=!0x1;}['_createSkeletonLoader'](){return new zn(this['locale'],jn['aiReviewChecks']);}['_createCombinedSkeletonLoader'](){const _0x181f6c=new Nt(this['locale']),_0xcd6def=[];for(let _0x1efd94=0x0;_0x1efd94<0x10;_0x1efd94++){const _0x5e558a=this['_createSkeletonLoader']();_0x5e558a['extendTemplate']({'attributes':{'class':['ck-ai_review__check-run-skeleton-item']}}),_0xcd6def['push'](_0x5e558a);}return _0x181f6c['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-skeleton-container',this['bindTemplate']['if']('isLoading','ck-hidden',_0x1c97d4=>!_0x1c97d4)]},'children':_0xcd6def}),_0x181f6c;}['_createErrorView'](){const _0x1dc42d=new Nt(this['locale']),_0x2e01f2=new kt(this['locale']),t=this['locale']['t'];return _0x1dc42d['delegate']('retryReview')['to'](this),_0x2e01f2['set']({'label':t('Try\x20again'),'withText':!0x0,'class':hs+'\x20ck-ai_review__check-run-error-retry-button'}),_0x2e01f2['on']('execute',()=>{this['fire']('retryReview');}),_0x1dc42d['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-error-container',this['bindTemplate']['if']('showErrorMessage','ck-hidden',_0xc19def=>!_0xc19def),this['bindTemplate']['if']('errorType','ck-ai_review__check-run-error-container_border-bottom',_0x13d60b=>'chunk'===_0x13d60b)]},'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',_0xd7ed14=>'chunk'===_0xd7ed14)]},'children':[{'tag':'p','attributes':{'class':['ck-ai-notification__content',this['bindTemplate']['if']('errorType','ck-hidden',_0x73499e=>'general'!==_0x73499e)]},'children':[{'text':this['_contents']['generalErrorText']}]},{'tag':'p','attributes':{'class':['ck-ai-notification__content',this['bindTemplate']['if']('errorType','ck-hidden',_0x2e29a1=>'chunk'!==_0x2e29a1)]},'children':[{'text':as(this['locale'],'AI_REVIEW_MODE_CHUNK_ERROR_MESSAGE')}]}]},_0x2e01f2]}),_0x1dc42d;}['_createCancelButtonView'](){const _0x2da401=new kt(this['locale']);return _0x2da401['set']({'label':as(this['locale'],'AI_REVIEW_MODE_STOP_GENERATING'),'withText':!0x0,'class':[hs+'\x20ck-ai-button-stop-generating'],'icon':_0x4d09f1}),_0x2da401['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isResultReady','ck-hidden',_0x3b15f0=>_0x3b15f0),this['bindTemplate']['if']('isCompleted','ck-hidden',_0xef3cbe=>_0xef3cbe)]}}),_0x2da401['on']('execute',()=>{this['fire']('abortReviewStream');}),_0x2da401;}['_createToggleDiffButtonView'](){const _0x2f62b4=new kt(this['locale']);_0x2f62b4['set']({'tooltip':!0x0,'isToggleable':!0x0,'role':'menuitemcheckbox'}),_0x2f62b4['bind']('isEnabled')['to'](this,'isError',_0x182edd=>!_0x182edd),_0x2f62b4['extendTemplate']({'attributes':{'class':[hs,'ck-ai_review__check-run-toggle-diff-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0x588322=>!_0x588322),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x180475=>_0x180475)]}});const _0x493b83=as(this['locale'],'AI_REVIEW_MODE_HIDE_CHANGES'),_0x1f49ed=as(this['locale'],'AI_REVIEW_MODE_SHOW_CHANGES');return _0x2f62b4['bind']('isOn')['to'](this,'isToggleDiffOn',_0x237f58=>_0x237f58),_0x2f62b4['bind']('icon')['to'](this,'isToggleDiffOn',_0x26b2a9=>_0x26b2a9?st:nt),_0x2f62b4['bind']('label')['to'](this,'isToggleDiffOn',_0xe448d2=>_0xe448d2?_0x493b83:_0x1f49ed),_0x2f62b4['on']('execute',()=>{this['isToggleDiffOn']=!this['isToggleDiffOn'],this['fire']('toggleDiff',{'on':this['isToggleDiffOn']});}),_0x2f62b4;}['_createAcceptAllButtonView'](){const _0x14ee8a=new kt(this['locale']);return _0x14ee8a['set']({'label':as(this['locale'],'AI_REVIEW_MODE_ACCEPT_ALL'),'withText':!0x0}),_0x14ee8a['bind']('isEnabled')['to'](this,'isError',_0x3ba20f=>!_0x3ba20f),_0x14ee8a['extendTemplate']({'attributes':{'class':[os,'ck-ai_review__check-run-accept-all-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0x5a5cc4=>!_0x5a5cc4),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x34c07a=>_0x34c07a)]}}),_0x14ee8a['on']('execute',()=>{this['fire']('acceptAllChanges');}),_0x14ee8a;}['_createExitReviewButtonView'](){const _0x26b77d=new kt(this['locale']);return _0x26b77d['set']({'label':as(this['locale'],'AI_REVIEW_MODE_EXIT_REVIEW'),'withText':!0x0}),_0x26b77d['extendTemplate']({'attributes':{'class':[cs,'ck-ai_review__check-run-exit-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0x305446=>!_0x305446),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x45f0ca=>_0x45f0ca)]}}),_0x26b77d['on']('execute',()=>{this['fire']('leaveReviewCoreResultList');}),_0x26b77d;}['_createResultHeaderView'](){const _0x556102=new Nt(this['locale']),_0x2cd40a=this['_createTitleView']();return _0x556102['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-header',this['bindTemplate']['if']('isCompleted','ck-ai_review__review-completed-header',_0x139f7e=>_0x139f7e)]},'children':[_0x2cd40a,{'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-header-buttons']},'children':[this['_cancelButtonView'],this['_acceptAllButtonView'],this['_exitReviewButtonView'],this['_toggleDiffButtonView'],this['_finishReviewButtonView']]}]}),_0x556102;}['_createTitleView'](){const _0x19e27a=new Nt(this['locale']),_0x4ee6a1=new fn();return _0x4ee6a1['bind']('isVisible')['to'](this,'isResultReady',_0x59eee7=>!_0x59eee7),_0x19e27a['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-header-title-wrapper']},'children':[_0x4ee6a1,{'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-header-title-content',this['bindTemplate']['if']('isCompleted','ck-hidden',_0x4fb6e3=>_0x4fb6e3)]},'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',_0x37cd31=>!_0x37cd31)]},'children':[{'text':as(this['locale'],'AI_REVIEW_MODE_FINISH_REVIEW_HEADER_TITLE')}]}]}),_0x19e27a;}['_createFinishReviewButtonView'](){const _0x157b38=new eo(as(this['locale'],'AI_REVIEW_MODE_FINISH_REVIEW_BUTTON_LABEL'),this['locale']);return _0x157b38['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isCompleted','ck-hidden',_0x957c9=>!_0x957c9)]}}),_0x157b38['delegate']('finishReview')['to'](this),_0x157b38;}}class so extends Pt{['_resultsHeader'];['_finishReviewButtonView'];constructor(_0x4c3e16,_0x580986){super(_0x4c3e16),this['_finishReviewButtonView']=this['_createFinishReviewButtonView'](_0x580986['buttonText']),this['_resultsHeader']=this['_createResultHeaderView'](_0x580986['headerText']);const _0xfec15c=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__review-completed',_0xfec15c['if']('isVisible','ck-hidden',_0x4e4859=>!_0x4e4859)]},'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':_0x580986['emptyResultsText']}]}]}]});}['_createFinishReviewButtonView'](_0x147180){const _0x486ef8=new eo(_0x147180,this['locale']);return _0x486ef8['delegate']('finishReview')['to'](this),_0x486ef8;}['_createResultHeaderView'](_0x409549){const _0x3d694c=new Nt(this['locale']);return _0x3d694c['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':_0x409549}]},{'tag':'div','attributes':{'class':['ck-ai_review__review-completed-header-buttons']},'children':[this['_finishReviewButtonView']]}]}),_0x3d694c;}}class no extends Nt{['_dropdownView'];['_defaultValue'];['_defaultLabel'];constructor(_0x5f49f4,_0x24a80f){super(_0x5f49f4),this['_defaultValue']=_0x24a80f['default']||(_0x24a80f['data']['length']>0x0?_0x24a80f['data'][0x0]['id']:''),this['_defaultLabel']=_0x24a80f['data']['find'](_0x594abd=>_0x594abd['id']===this['_defaultValue'])?.['label']||'',this['set']('formValue',''),this['_dropdownView']=Bt(this['locale']);const _0x140c5a=this['_prepareListOptions'](_0x24a80f['data']);zt(this['_dropdownView'],_0x140c5a,{'role':'menu','ariaLabel':_0x24a80f['label']}),this['_dropdownView']['buttonView']['set']({'label':this['_defaultLabel'],'withText':!0x0}),this['_dropdownView']['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x53e000=>{_0x53e000['stopPropagation']();})}}),this['listenTo'](this['_dropdownView'],'execute',_0x118a54=>{this['formValue']=_0x118a54['source']['model']['id'],this['_dropdownView']['buttonView']['label']=_0x118a54['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'](_0x68597d=[]){const _0x566258=new dt();this['resetToDefault']();for(const _0x144f69 of _0x68597d){const _0x126df9=new jt({'label':_0x144f69['label'],'withText':!0x0,'role':'menuitemradio','id':_0x144f69['id'],'model':_0x144f69});_0x126df9['bind']('isOn')['to'](this,'formValue',_0x32c259=>_0x32c259===_0x126df9['id']);const _0x4044c7={'type':'button','model':_0x126df9};_0x566258['add'](_0x4044c7);}return _0x566258;}}class ro extends Pt{['_formItem']=null;constructor(_0x4020f5,_0x1e7dfb,_0x5a7621){super(_0x4020f5),this['argsKey']=_0x1e7dfb?.['argsKey'];if('dropdown'===_0x1e7dfb['formType'])this['_formItem']=new no(this['locale'],_0x1e7dfb);this['set']('value',''),this['bind']('value')['to'](this['_formItem'],'formValue');const _0x3156f5=new _0x583e67(this['locale'],{'children':[this['_formItem']],'class':[_0x5a7621?'ck-form__row_with-submit':'']});_0x5a7621&&_0x3156f5['children']['add'](_0x5a7621),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai_review__form-item','ck-reset_all']},'children':[_0x3156f5]});}['resetToDefault'](){this['_formItem']['resetToDefault']();}}class ao extends _0x24ece4{['keystrokes'];static ['MIN_ROWS']=0x1;static ['MAX_ROWS']=0xc;constructor(_0x33a0ca){super(_0x33a0ca),this['set']('isEmpty',!0x0),this['keystrokes']=new At(),this['minRows']=ao['MIN_ROWS'],this['maxRows']=ao['MAX_ROWS'],this['extendTemplate']({'attributes':{'id':'ai-review-prompt-input','class':['ck','ck-review__prompt-input']}});}['render'](){super['render'](),this['on']('update',()=>{this['isEmpty']=''===this['element']['value']?.['trim']();}),this['keystrokes']['listenTo'](this['element']);}}class oo extends Nt{['focusTracker']=new _t();['keystrokes']=new At();['focusCycler'];['_focusables']=new _0x5ba55d();['submitButtonView'];['cancelButtonView'];['promptInputView'];['actionsFooterView'];['_modelSelectionDropdown'];['_modelNameView'];['_modelSelectionDropdownItems'];['_check'];['_defaultValue'];['_defaultLabel'];constructor(_0x4fe7fe,_0x4e32af,_0x5326f4=!0x1){super(_0x4fe7fe),this['_check']=_0x4e32af,this['set']('prompt',''),this['set']('modelId',''),this['set']('modelDisplayMode','selector'),this['set']('activeModelName',null),this['_defaultValue']=_0x4e32af['defaultModel']?_0x4e32af['defaultModel']['id']:'',this['_defaultLabel']=_0x4e32af['defaultModel']?_0x4e32af['defaultModel']['name']:'',this['submitButtonView']=this['_createSubmitButtonView'](),this['cancelButtonView']=this['_createCancelButtonView'](),(this['promptInputView']=new Zt(this['locale'],()=>new ao(_0x4fe7fe)),this['promptInputView']['fieldView']['bind']('value')['to'](this,'prompt'),this['promptInputView']['fieldView']['on']('input',()=>{this['prompt']=this['promptInputView']['fieldView']['element']['value'];}),this['_modelSelectionDropdown']=this['_createModelSelectionDropdown'](),this['_modelSelectionDropdownItems']=new dt(),this['_modelNameView']=this['_createModelNameView'](),this['_setModelList'](_0x5326f4),zt(this['_modelSelectionDropdown'],this['_modelSelectionDropdownItems']),this['actionsFooterView']=this['_createActionsFooterView'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-custom-actions']},'children':[new _0x583e67(this['locale'],{'children':[this['promptInputView']]}),new _0x583e67(this['locale'],{'children':[this['actionsFooterView']]})]}),this['promptInputView']['fieldView']['keystrokes']['set']('Enter',(_0x55b1ce,_0x2374b9)=>{this['_isValid']()?(this['fire']('runReviewCheck',{'id':'custom','args':{'prompt':this['prompt'],'model':this['modelId']},'isCustom':!0x0}),_0x2374b9()):_0x2374b9();}),this['focusCycler']=new Mt({'focusables':this['_focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes'],'actions':{'focusPrevious':'shift\x20+\x20tab','focusNext':'tab'}}));}['render'](){super['render'](),([this['promptInputView'],this['_modelSelectionDropdown'],this['cancelButtonView'],this['submitButtonView']]['forEach'](_0x1eb7d6=>{this['_focusables']['add'](_0x1eb7d6),this['focusTracker']['add'](_0x1eb7d6['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 _0xad3967 of this['_getFormValidators']()){const _0x1e4fa0=_0xad3967();if(_0x1e4fa0)return this['promptInputView']['errorText']=_0x1e4fa0,!0x1;}return!0x0;}['_getFormValidators'](){return[()=>{if(0x0===this['promptInputView']['fieldView']['value']?.['trim']()['length'])return as(this['locale'],'AI_REVIEW_MODE_PROMPT_EMPTY_ERROR');}];}['_createSubmitButtonView'](){const _0x37367f=new kt(this['locale']),t=this['locale']['t'];return _0x37367f['set']({'label':t('Submit'),'withText':!0x0,'class':os}),_0x37367f['on']('execute',()=>{this['_isValid']()&&this['fire']('runReviewCheck',{'id':'custom','args':{'prompt':this['prompt'],'model':this['modelId']},'isCustom':!0x0});}),_0x37367f;}['_createCancelButtonView'](){const _0x19296e=new kt(this['locale']),t=this['locale']['t'];return _0x19296e['set']({'label':t('Cancel'),'withText':!0x0,'class':cs}),_0x19296e['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x2182ba=>{_0x2182ba['stopPropagation']();})}}),_0x19296e['on']('execute',()=>{this['resetToDefault'](),this['fire']('closeCustomCheck');}),_0x19296e;}['_setModelList'](_0x2b4451){this['_modelSelectionDropdownItems']['clear']();const _0x249901=this['_check']['models'];if(_0x2b4451)this['set']('modelDisplayMode','hidden');else{const _0x17eeee=0x1===_0x249901['length'];this['set']('modelDisplayMode',_0x17eeee?'name':'selector');}if(this['resetToDefault'](),_0x249901?.['length']){0x1===_0x249901['length']&&this['set']('activeModelName',_0x249901[0x0]['name']||_0x249901[0x0]['id']);for(const _0x1b0e8f of _0x249901){const _0x5f5908=new jt({'label':_0x1b0e8f['name'],'withText':!0x0,'role':'menuitemradio','id':_0x1b0e8f['id'],'model':_0x1b0e8f});_0x5f5908['bind']('isOn')['to'](this,'modelId',_0x1a90af=>_0x1a90af===_0x1b0e8f['id']),this['_modelSelectionDropdownItems']['add']({'type':'button','model':_0x5f5908,'labelView':new co(this['locale'],_0x1b0e8f)});}}}['_createModelSelectionDropdown'](){const _0x3b1556=Bt(this['locale']);return _0x3b1556['set']({'panelPosition':'se','class':'ck-ai_review__check-list-item-model-dropdown'}),_0x3b1556['buttonView']['set']({'label':this['_defaultLabel'],'withText':!0x0,'tooltip':!0x0,'class':cs}),_0x3b1556['buttonView']['bind']('isVisible')['to'](this,'modelDisplayMode',_0x17e7ef=>'selector'===_0x17e7ef),this['listenTo'](_0x3b1556,'execute',_0xef254=>{this['modelId']=_0xef254['source']['model']['id'],_0x3b1556['buttonView']['label']=_0xef254['source']['label'];}),_0x3b1556;}['_createModelNameView'](){const _0x4fa8a7=new ho(this['locale']);return _0x4fa8a7['bind']('text')['to'](this,'activeModelName',_0xb68ee2=>_0xb68ee2??''),_0x4fa8a7['bind']('isVisible')['to'](this,'modelDisplayMode',_0xf75d48=>'name'===_0xf75d48),_0x4fa8a7;}['_createActionsFooterView'](){const _0x28b81f=new Nt(this['locale']);return _0x28b81f['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']]}]}),_0x28b81f;}}class ho extends Nt{constructor(_0x1491f7){super(_0x1491f7),this['set']('text',void 0x0),this['set']('isVisible',!0x0);const _0x3ab8a7=this['bindTemplate'];this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai_review__check-list-item-model-name',_0x3ab8a7['if']('isVisible','ck-hidden',_0x72dd4f=>!_0x72dd4f)]},'children':[{'text':_0x3ab8a7['to']('text')}]});}}class co extends Ht{constructor(_0xe61651,_0x1cd71a){super();const _0x37b2c0=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-button__label'],'style':_0x37b2c0['to']('style'),'id':_0x37b2c0['to']('id')},'children':[{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-model-dropdown-name']},'children':[{'tag':'span','children':[{'text':_0x37b2c0['to']('text')}]}]},{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-model-dropdown-description']},'children':[{'tag':'span','children':[_0x1cd71a['description']||'']}]}]});}}class lo extends Pt{['_formItemsCollection']=new _0x5ba55d();['_customCheckView']=null;['_hideModels']=!0x1;constructor(_0x12e440,_0x59ca74,_0x4c8288,_0x2bd126=!0x1){super(_0x12e440),this['_hideModels']=_0x2bd126,this['set']('isParametrizedViewOpen',!0x1),this['set']('isListItemRendered',!0x1),this['set']('isItemParametrized',_0x59ca74['isParameterized']);const _0x298c56=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',_0x226355=>_0x226355),this['bindTemplate']['if']('isListItemRendered','ck-ai_review__check-list-item_rendered',_0x3f12be=>_0x3f12be)],'style':{'--ck-ai-review-check-list-item-index':_0x4c8288}},'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':_0x59ca74['title']}]},_0x298c56]},{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-description']},'children':_0x59ca74['description']?[{'text':_0x59ca74['description']}]:[]}]}]},..._0x59ca74['isParameterized']?[this['_createParameterizedView'](_0x59ca74)]:[],...'custom'===_0x59ca74['id']?[this['_createCustomView'](_0x59ca74,this['_hideModels'])]:[]]}),this['on']('click',()=>{_0x59ca74['isParameterized']?this['isParametrizedViewOpen']=!0x0:this['fire']('runReviewCheck',{'id':_0x59ca74['id'],'args':_0x59ca74['useArgs']?_0x59ca74['args']:void 0x0});}),requestAnimationFrame(()=>{this['isListItemRendered']=!0x0;});}['render'](){super['render'](),this['isItemParametrized']&&Xt({'emitter':this,'activator':()=>!0x0===this['isParametrizedViewOpen'],'contextElements':[this['element']],'callback':()=>{this['isParametrizedViewOpen']=!0x1;}});}['resetToDefault'](){this['isParametrizedViewOpen']=!0x1,this['_formItemsCollection']['forEach'](_0x5cc3b1=>{_0x5cc3b1['resetToDefault']();}),this['_customCheckView']&&this['_customCheckView']['resetToDefault']();}['_createIconView'](){const _0x2e4380=new yt();return _0x2e4380['content']=rt,_0x2e4380['extendTemplate']({'attributes':{'class':['ck-ai_review__check-list-item-title-icon']}}),_0x2e4380;}['_createParameterizedView'](_0x295e10){const _0x13cab1=new Nt(),_0x136d9a=this['_createFormView'](_0x295e10);return _0x13cab1['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-parameterized',this['bindTemplate']['if']('isParametrizedViewOpen','ck-hidden',_0x27428e=>!_0x27428e)]},'children':[_0x136d9a]}),_0x13cab1;}['_createFormView'](_0x50fc25){const _0x179908=new Nt(),_0x28422e=Array['isArray'](_0x50fc25['options'])?_0x50fc25['options']:[],_0x342826=new kt(this['locale']),t=this['locale']['t'];_0x342826['set']({'label':t('Submit'),'withText':!0x0,'class':os}),_0x342826['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x49df63=>{_0x49df63['stopPropagation']();})}}),_0x342826['on']('execute',()=>{const _0x3be770=[],_0x7fc969={};this['_formItemsCollection']['forEach'](_0x2412ea=>{_0x3be770['push'](_0x2412ea['value']),_0x50fc25['useArgs']&&_0x50fc25['options']&&(_0x7fc969[_0x2412ea['argsKey']]=_0x2412ea['value']);}),this['fire']('runReviewCheck',{'id':_0x50fc25['id'],'params':_0x3be770['length']?_0x3be770:void 0x0,'args':Object['keys'](_0x7fc969)['length']?_0x7fc969:void 0x0});});const _0x43e67a=_0x28422e['length'];return _0x28422e['forEach']((_0xad84c9,_0x9da36)=>{const _0x4ba795=_0x9da36===_0x43e67a-0x1;this['_formItemsCollection']['add'](new ro(this['locale'],_0xad84c9,_0x4ba795?_0x342826:null));}),_0x179908['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-parameterized-form']},'children':this['_formItemsCollection']}),_0x179908;}['_createCustomView'](_0xddfa28,_0x274225=!0x1){return this['_customCheckView']=new oo(this['locale'],_0xddfa28,_0x274225),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',_0x22280c=>!_0x22280c)]}}),this['_customCheckView']['delegate']('runReviewCheck')['to'](this),this['listenTo'](this['_customCheckView'],'closeCustomCheck',()=>{this['isParametrizedViewOpen']=!0x1;}),this['on']('change:isParametrizedViewOpen',(_0x29048d,_0x46fdb0,_0x11409)=>{_0x11409||this['_customCheckView']['resetFormValidationStatus']();}),this['_customCheckView'];}}class uo extends Pt{['_checkViews'];constructor(_0x3c8c57){super(_0x3c8c57),this['_checkViews']=new _0x5ba55d(),this['_setupTemplate']();}['setChecks'](_0x3626a5,_0x15e0a1=!0x1){this['_checkViews']['clear']();for(const [_0x124a69,_0x529db4]of _0x3626a5['entries']()){const _0x4d813b=new lo(this['locale'],_0x529db4,_0x124a69,_0x15e0a1);_0x4d813b['delegate']('runReviewCheck')['to'](this),this['_checkViews']['add'](_0x4d813b);}}['hasChecks'](){return this['_checkViews']['length']>0x0;}['resetAllParameterizedChecks'](){for(const _0x3974d2 of this['_checkViews'])_0x3974d2 instanceof lo&&_0x3974d2['resetToDefault']();}['_setupTemplate'](){const _0x4e8d01=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list',_0x4e8d01['if']('isVisible','ck-hidden',_0x48dc38=>!_0x48dc38)]},'children':this['_checkViews']});}}class _o extends Ja{static get['pluginName'](){return'AIReviewModeUI';}['createMainView'](){const _0x5e2f4c=this['context']['locale'],_0x56a5ae=new _0x3b6a7d(_0x5e2f4c,{'label':as(_0x5e2f4c,'AI_REVIEW_MODE'),'icon':_0x5d7a94,'class':'ck-ai-header\x20ck-ai-header_review'});return new to(this['context']['locale'],{'header':_0x56a5ae,'list':new uo(_0x5e2f4c),'results':new io(_0x5e2f4c,{'generalErrorText':as(_0x5e2f4c,'AI_REVIEW_MODE_GENERAL_ERROR_MESSAGE')}),'completed':new so(_0x5e2f4c,{'headerText':as(_0x5e2f4c,'AI_REVIEW_MODE_FINISH_REVIEW_HEADER_TITLE'),'emptyResultsText':as(_0x5e2f4c,'AI_REVIEW_MODE_EMPTY_RESULTS_TEXT'),'buttonText':as(_0x5e2f4c,'AI_REVIEW_MODE_FINISH_REVIEW_BUTTON_LABEL')})});}['registerTab'](){const _0x701152=this['context']['plugins']['get']('AITabs');_0x701152['view']['on']('activateTab',(_0x144968,_0x579339)=>{'reviewMode'===_0x579339?this['fire']('getReviewCheckList'):this['fire']('leaveReview');}),_0x701152['view']['addTab']({'id':'reviewMode','buttonLabel':as(this['context']['locale'],'AI_REVIEW_MODE'),'buttonIcon':_0x5d7a94,'order':0x0,'content':this['_mainView']});}}const Ao='review-';class go extends _0x333531{static get['requires'](){return[_0x515afb,qs];}static get['pluginName'](){return'AIReviewCoreEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['_markers']=new Map();['_activeMarkers']=new Set();['_domEmitter'];['_eventEmitter'];constructor(_0x446c4d){super(_0x446c4d),this['_domEmitter']=new(Rt())(),this['_eventEmitter']=new(pt())();}get['emitter'](){return this['_eventEmitter'];}['afterInit'](){const _0x295525=Fs(this['context']);_0x295525['conversion']['for']('editingDowncast')['markerToElement']({'model':Ao+'insert','view':(_0x450147,{writer:_0x32be99})=>{const _0x328e3c=this['_markers']['get'](_0x450147['markerName']),_0x91d7ea={'class':'ck-ai_review-marker_add'+(this['_activeMarkers']['has'](_0x328e3c?.['id']||'')?'\x20ck-ai_review__change_active':''),'data-marker-id':_0x450147['markerName']};return _0x32be99['createUIElement']('span',_0x91d7ea,function(_0xe838bb){const _0xec8031=this['toDomElement'](_0xe838bb);return _0xec8031['innerHTML']=_0x328e3c?.['content']?.['asString']||'',_0xec8031;});}}),_0x295525['conversion']['for']('editingDowncast')['markerToHighlight']({'model':Ao+'remove-only','view':_0x373137=>{const _0x43b5a6=this['_markers']['get'](_0x373137['markerName']),_0x5935d1=['ck-ai_review-marker_strikethrough'];return this['_activeMarkers']['has'](_0x43b5a6?.['id']||'')&&_0x5935d1['push']('ck-ai_review__change_active'),{'classes':_0x5935d1,'attributes':{'data-marker-id':_0x373137['markerName']}};}}),_0x295525['conversion']['for']('editingDowncast')['markerToHighlight']({'model':Ao+'remove-context','view':_0x59d58c=>{const _0x5e3913=this['_markers']['get'](_0x59d58c['markerName']),_0x4d1776=['ck-ai_review-marker_underline'];return this['_activeMarkers']['has'](_0x5e3913?.['id']||'')&&_0x4d1776['push']('ck-ai_review__change_active'),{'classes':_0x4d1776,'attributes':{'data-marker-id':_0x59d58c['markerName']}};}}),_0x295525['conversion']['for']('editingDowncast')['markerToHighlight']({'model':Ao+'remove-text','view':_0x52ea92=>{const _0x361859=this['_markers']['get'](_0x52ea92['markerName']),_0x3376a5=['ck-ai_review-marker_hide'];return this['_activeMarkers']['has'](_0x361859?.['id']||'')&&_0x3376a5['push']('ck-ai_review__change_active'),{'classes':_0x3376a5,'attributes':{'data-marker-id':_0x52ea92['markerName']}};}}),_0x295525['conversion']['for']('dataDowncast')['markerToElement']({'model':Ao+'suggestion-context','view':(_0x205584,{writer:_0x4a5e9b})=>_0x4a5e9b['createRawElement']('span',{'class':'ck-ai_review-marker_context-'+(_0x205584['isOpening']?'start':'end')})}),_0x295525['conversion']['for']('downcast')['attributeToAttribute']({'model':_0x45927f,'view':_0x139d70});const _0x2d69e0=_0x295525['ui']['getEditableElement']()||document['body'];this['_domEmitter']['listenTo'](_0x2d69e0,'mouseup',(_0x1787e6,_0x25fc4b)=>{const _0x4c35a5=_0x25fc4b['target'],_0x3dba1f=this['_findMarkerElement'](_0x4c35a5);if(!_0x3dba1f)return;const _0x45472a=_0x3dba1f['getAttribute']('data-marker-id'),_0x2efe23=_0x45472a['split'](':')['pop']()?.['split']('_')[0x0];this['_eventEmitter']['fire']('changeMarkerClicked',{'markerId':_0x45472a,'changeId':_0x2efe23,'markerElement':()=>this['_findMarkerElementById'](_0x45472a),'domEvent':_0x25fc4b});},{'usePassive':!0x0,'priority':'highest'}),this['_domEmitter']['listenTo'](_0x2d69e0,'mouseover',(_0x490ed8,_0x12d202)=>{const _0x1d231f=_0x12d202['target'],_0x5ca924=_0x12d202['relatedTarget'];let _0x124683=this['_findMarkerElement'](_0x1d231f);if(!_0x124683&&_0x5ca924&&(_0x124683=this['_findMarkerElement'](_0x5ca924)),!_0x124683)return;const _0x2c7948=_0x124683['getAttribute']('data-marker-id'),_0x5dbf1d=_0x2c7948['split'](':')['pop']()?.['split']('_')[0x0];this['_eventEmitter']['fire']('changeMarkerHovered',{'changeId':_0x5dbf1d,'markerElement':()=>this['_findMarkerElementById'](_0x2c7948),'domEvent':_0x12d202});}),this['_domEmitter']['listenTo'](document,'mouseover',_0x212c8b((_0x42e5f8,_0x5a0649)=>{const _0x3d14fa=_0x5a0649['target'];if(this['_findMarkerElement'](_0x3d14fa))return;_0x3d14fa['closest']('.ck-reset.ck-ai_review-balloon-panel-suggestion')||this['_eventEmitter']['fire']('changeMarkerBlurred');},0xc8)),_0x295525['model']['document']['registerPostFixer'](_0x66890d=>this['_validateMarkers'](_0x295525,_0x66890d)),_0x295525['model']['document']['on']('change',()=>this['_handleMarkerChanges'](_0x295525));}['getDocumentData'](){const _0x350dcd=this['context']['plugins']['get']('AIEditing'),_0x4e9437=Fs(this['context']),_0x535ac3=_0x4e9437['model'],_0x2e433a=new _0x23a0e5();for(const _0x79d3ce of _0x535ac3['document']['getRoot']()['getChildren']()){const _0x538c44=_0x79d3ce['_clone'](!0x0);_0x2e433a['_appendChild'](_0x538c44);}for(const _0x4d31a8 of _0x535ac3['markers'])_0x2e433a['markers']['set'](_0x4d31a8['name'],this['_changeRangeOwnerDocument'](_0x4d31a8['getRange']()['clone'](),_0x2e433a));const _0x5d7db4=new _0x66aaa3({'ignoreElementEnd':!0x0,'startPosition':_0x535ac3['createPositionAt'](_0x2e433a,0x0)}),_0x7dab46=new Set(),_0x47a177=new Map();for(const {item:_0x4c8210}of _0x5d7db4){if(!_0x4c8210['is']('$textProxy'))continue;const _0x55d311=_0x4c8210['parent'];if(_0x55d311&&_0x55d311['is']('element')){const _0x2ba8d=this['_upsertDataId'](_0x55d311,()=>_0x350dcd['_nextDataId'](_0x7dab46));_0x7dab46['add'](_0x2ba8d);for(const _0x4c55b6 of _0x55d311['getChildren']())_0x4c55b6['is']('element')&&_0x7dab46['add'](this['_upsertDataId'](_0x4c55b6,()=>_0x350dcd['_nextDataId'](_0x7dab46)));let _0x493786=_0x55d311;for(;_0x493786['parent']&&!_0x493786['parent']['is']('documentFragment');)_0x493786=_0x493786['parent'],_0x493786['hasAttribute'](_0x45927f)&&_0x493786['_removeAttribute'](_0x45927f);_0x47a177['set'](_0x2ba8d,{'path':_0x55d311['getPath'](),'getContent':this['_createGetContentUsingDataIdFn'](_0x493786['_clone'](!0x0),_0x2ba8d,_0x4e9437['data'])}),_0x5d7db4['jumpTo'](_0x535ac3['createPositionAfter'](_0x55d311));}}return{'content':_0x4e9437['data']['processor']['toData'](_0x4e9437['data']['toView'](_0x2e433a)),'version':_0x4e9437['model']['document']['version'],'elements':_0x47a177};}['diffContent'](_0x3bc91a,_0x4478bc,_0x5bb2ca=!0x1){const _0xfa5787=[],_0xf46210=Fs(this['context']),_0xc914a0=_0xf46210['data']['parse'](_0x4478bc,'$documentFragment'),_0x809c8c=_0xf46210['data']['parse'](_0x3bc91a,'$documentFragment'),_0x4db477=_0xf46210['model']['createPositionAt'](_0x809c8c,0x0);if(this['_haveSingleTopLevelElement'](_0xc914a0)){if(!this['_hasSameTopLevelElement'](_0x809c8c,_0xc914a0))return _0xfa5787;}else{const _0x8cfc00=_0xf46210['model']['schema'];if(!this['_haveOnlyInlineContent'](_0x809c8c,_0x8cfc00)||!this['_haveOnlyInlineContent'](_0xc914a0,_0x8cfc00))return _0xfa5787;}const _0x36a698=this['context']['plugins']['get']('DocumentCompare')['getDiff'](_0x3bc91a,_0x4478bc,{'anchor':_0x4db477,'markDeletions':!0x0})['getOperations']()['filter'](_0x400af6=>'insert'===_0x400af6['type']||'marker'===_0x400af6['type']&&_0x400af6['name']['startsWith']('$markedRemove')),_0x2029a5=this['_groupAdjacentOperations'](_0x36a698),_0x37869f=[];if(_0x5bb2ca){if(_0x2029a5['length']){const _0x1cd96a=_0x2029a5[0x0]['operations'][0x0],_0x510704='insert'===_0x1cd96a['type']?_0x1cd96a['position']:_0x1cd96a['newRange']['start'],_0xd0f3b=this['_getPositionLimitingRange'](_0x510704,_0xf46210,'inside'),_0x55cad8=_0xd0f3b?_0xc914a0['getChild'](0x0)['getChildren']():_0xc914a0['getChildren'](),_0x3c587e=_0xd0f3b||_0xf46210['model']['createRangeIn'](_0x809c8c),_0x40914d=[new _0x480c88('$markedRemove:synthetic'+at(),null,_0x3c587e,_0xf46210['model']['document']['model']['markers'],!0x0,_0xf46210['model']['document']['version']+0x1),new _0x4fd0d3(_0x3c587e['end'],_0x55cad8,_0xf46210['model']['document']['version']+0x2)];_0x37869f['push']({'operations':_0x40914d,'operationsIsolated':_0x40914d,'groupOffset':0x0});}}else _0x37869f['push'](..._0x2029a5);let _0x605c63=0x0;return _0xf46210['model']['change'](_0x460353=>{for(let _0x325e8b=0x0;_0x325e8b<_0x37869f['length'];_0x325e8b++){const _0x4ccb64=_0x37869f[_0x325e8b],_0x2fb51f=_0x460353['createDocumentFragment']();for(const _0x2f06ea of _0x809c8c['getChildren']())_0x460353['append'](_0x2f06ea['_clone'](!0x0),_0x2fb51f);for(const _0x46e5c8 of _0x4ccb64['operationsIsolated'])if('insert'===_0x46e5c8['type']){const _0x4fbd87=_0x46e5c8;_0x4fbd87['baseVersion']=null,_0x4fbd87['isDocumentOperation']=!0x1,this['_changeOperationOwnerDocument'](_0x4fbd87,_0x2fb51f),_0x460353['batch']['addOperation'](_0x46e5c8),_0xf46210['model']['applyOperation'](_0x46e5c8);const _0x40f755='suggestion:insertion:id:authorId:'+_0x605c63++,_0x258b82=_0xf46210['model']['createRange'](_0x4fbd87['position'],_0x4fbd87['position']['getShiftedBy'](_0x4fbd87['howMany']));_0x2fb51f['markers']['set'](_0x40f755,_0x258b82);}else{if('marker'===_0x46e5c8['type']&&_0x46e5c8['name']['startsWith']('$markedRemove')){const _0x145dec=_0x46e5c8,_0x5d4cae='suggestion:deletion:id:authorId:'+_0x605c63++;this['_changeOperationOwnerDocument'](_0x145dec,_0x2fb51f),_0x2fb51f['markers']['set'](_0x5d4cae,_0x145dec['newRange']);}}if(_0x5bb2ca)_0xfa5787['push']({..._0x4ccb64,'context':this['_createGetContentFn'](_0x809c8c,_0xf46210['data']),'content':this['_createGetContentFn'](_0x809c8c,_0xf46210['data'])});else{const _0xcd0ea6=this['_getChangeContext'](this['_changePositionOwnerDocument'](this['_getOperationStart'](_0x4ccb64['operationsIsolated'][0x0]),_0x2fb51f),this['_changePositionOwnerDocument'](this['_getOperationEnd'](_0x4ccb64['operationsIsolated'][_0x4ccb64['operationsIsolated']['length']-0x1]),_0x2fb51f));_0x2fb51f['markers']['set'](Ao+'suggestion-context',new _0x34cb53(_0xcd0ea6['start'],_0xcd0ea6['end'])),_0xfa5787['push']({..._0x4ccb64,'context':this['_createGetContextFn'](_0x2fb51f,_0xf46210['data'],{'ellipsisBefore':_0xcd0ea6['hasContentBefore'],'ellipsisAfter':_0xcd0ea6['hasContentAfter']}),'content':this['_createGetContentFn'](_0x2fb51f,_0xf46210['data'])});}}}),_0xfa5787;}['markChangePositionInEditorContent'](_0x57daa6,_0x55e7ec){if(!_0x57daa6['length'])return;const _0x1dcadb=_0x57daa6[0x0]['parent']['id'],_0x4f422f=_0x55e7ec['elements']['get'](_0x1dcadb);if(!_0x4f422f)return void console['warn']('No\x20element\x20found\x20for\x20ID:\x20'+_0x1dcadb);const _0x31aa28=_0x4f422f['path'],_0x2bda08=Fs(this['context']),_0x4e8e58=_0x2bda08['model']['document']['history']['getOperations'](_0x55e7ec['version']),_0x2c4048=[];for(const _0x19e416 of _0x57daa6){const _0x24eec3=_0x19e416['operationsIsolated']['map'](_0x5e7b6c=>this['_translateOperationToEditorContent'](_0x5e7b6c,_0x31aa28,_0x2bda08['model']['document']['getRoots']()[0x0]));if(!_0x24eec3||!_0x24eec3['length'])continue;const _0x2c99b0=_0x24eec3['every'](_0x39ade4=>'marker'===_0x39ade4['type']&&_0x39ade4['name']['startsWith']('$markedRemove')),_0x1c28ac={'document':_0x2bda08['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1},_0x2ae8b1=_0x4693a2(_0x24eec3,_0x4e8e58,_0x1c28ac)['operationsA'];for(const _0x1d26cf of _0x2ae8b1)if('insert'===_0x1d26cf['type']){const _0x55dbcc=_0x1d26cf,_0x50799c=_0x55dbcc['nodes'];_0x2bda08['model']['change'](_0x2cf9bd=>{const _0x2196ca=_0x2cf9bd['createDocumentFragment']();for(const _0x1bce8a of _0x50799c)_0x2cf9bd['append'](_0x1bce8a['_clone'](!0x0),_0x2196ca);_0x2c4048['push']({'start':_0x55dbcc['position'],'end':_0x55dbcc['position'],'type':'insert','groupId':_0x19e416['id'],'content':{'asString':this['_createGetContentFn'](_0x2196ca,_0x2bda08['data'])(),'asFragment':_0x2196ca}});});}else{if('marker'===_0x1d26cf['type']&&_0x1d26cf['name']['startsWith']('$markedRemove')){const _0x51c9e3=_0x1d26cf;let _0x28c36a='remove-text';if(_0x2c99b0){const _0x9040c7=this['_findAdjacentContextDistance'](_0x51c9e3['newRange']['start'],'backward',_0x2bda08['model']['schema']),_0x37f04f=this['_findAdjacentContextDistance'](_0x51c9e3['newRange']['end'],'forward',_0x2bda08['model']['schema']);if(_0x9040c7||_0x37f04f){const _0x6a1b53=_0x51c9e3['newRange']['start']['getShiftedBy'](-_0x9040c7),_0x2bca60=_0x51c9e3['newRange']['end']['getShiftedBy'](_0x37f04f);_0x2c4048['push']({'start':_0x6a1b53,'end':_0x2bca60,'groupId':_0x19e416['id'],'type':'remove-context'});}else _0x28c36a='remove-only';}_0x2c4048['push']({'start':_0x51c9e3['newRange']['start'],'end':_0x51c9e3['newRange']['end'],'groupId':_0x19e416['id'],'type':_0x28c36a});}}}this['_insertMarkers'](_0x2c4048);}['clearAllMarkers'](){const _0x34ca86=Fs(this['context']);_0x34ca86['model']['change'](_0x4b91c8=>{for(const _0x53cf61 of this['_markers']['keys']())_0x34ca86['model']['markers']['get'](_0x53cf61)&&_0x4b91c8['removeMarker'](_0x53cf61);}),this['_markers']['clear'](),this['_activeMarkers']['clear']();}['switchToReadOnly'](){Fs(this['context'])['enableReadOnlyMode']('ai-review');}['switchToEdit'](){Fs(this['context'])['disableReadOnlyMode']('ai-review');}['applyChange'](_0x58ade6){const _0x1d6ae5=Fs(this['context']),_0xa64045=_0x1d6ae5['model'],_0x16c3c2=_0x58ade6['map'](_0x59efc8=>this['_getMarkersDataForGroup'](_0x59efc8))['flat']();_0xa64045['change'](_0x1f1d34=>{for(const _0x1c84df of _0x16c3c2){const _0x48df83=_0x1d6ae5['model']['markers']['get'](_0x1c84df['id']);if(_0x48df83){if('insert'===_0x1c84df['type']){if(!_0x1c84df['content'])continue;_0xa64045['insertContent'](_0x1c84df['content']['asFragment']||null,_0x48df83['getRange']()['start']);}else'remove-text'!==_0x1c84df['type']&&'remove-only'!==_0x1c84df['type']||_0xa64045['deleteContent'](_0xa64045['createSelection'](_0x48df83['getRange']()));_0x1f1d34['removeMarker'](_0x1c84df['id']),this['_markers']['delete'](_0x1c84df['id']);}}});}['rejectChange'](_0x45732b){const _0xa1f7f0=Fs(this['context']),_0x1b1145=this['_getMarkersDataForGroup'](_0x45732b);_0xa1f7f0['model']['change'](_0x256212=>{for(const _0x62609e of _0x1b1145)_0x256212['removeMarker'](_0x62609e['id']),this['_markers']['delete'](_0x62609e['id']);});}['getEditor'](){return Fs(this['context']);}['getMarkerElementForChange'](_0x575a92){const _0x43c84e=Array['from'](this['_markers']['values']())['filter'](_0x1446ed=>_0x1446ed['groupId']===_0x575a92);if(!_0x43c84e['length'])return null;const _0x55d011=0x1===_0x43c84e['length']?_0x43c84e[0x0]:this['_sortMarkers'](_0x43c84e)[0x0],_0x276eb1=Fs(this['context'])['model']['markers']['get'](_0x55d011['id']);if(!_0x276eb1)return null;return{'modelRange':_0x276eb1['getRange'](),'getElement':()=>this['_findMarkerElementById'](_0x55d011['id'])};}['getContentElementForChange'](_0x15a7eb){const _0x34b4c8=Array['from'](this['_markers']['values']())['filter'](_0x65969f=>_0x65969f['groupId']===_0x15a7eb);if(!_0x34b4c8['length'])return null;const _0x5c16bb=0x1===_0x34b4c8['length']?_0x34b4c8[0x0]:this['_sortMarkers'](_0x34b4c8)[0x0],_0x51287e=Fs(this['context']),_0x488fd6=_0x51287e['model']['markers']['get'](_0x5c16bb['id']);if(!_0x488fd6)return null;const _0x537e17=_0x488fd6['getRange'](),_0x1622e0=_0x51287e['editing']['view']['getDomRoot']();if(!_0x1622e0||!_0x537e17)return null;let _0x2c7119=_0x537e17['start']['parent'];for(;_0x2c7119['parent']&&'$root'!==_0x2c7119['parent']['name'];)_0x2c7119=_0x2c7119['parent'];if(!_0x2c7119||!_0x2c7119['name'])return null;const _0x376196=_0x1622e0['querySelector']('[data-marker-id=\x22'+_0x5c16bb['id']+'\x22]');if(!_0x376196)return null;let _0x22689e=null;_0x51287e['model']['change'](_0x501e8f=>{_0x22689e=_0x501e8f['createDocumentFragment'](),_0x501e8f['append'](_0x2c7119['_clone'](!0x0),_0x22689e);});const _0x289045=_0x51287e['data']['toView'](_0x22689e)['getChild'](0x0);return _0x376196['closest'](_0x289045['name']);}['reactivateMarkers'](_0x473855){const _0x580dd1=this['_getMarkersDataForGroup'](_0x473855);if(!_0x580dd1['length'])return;const _0x53aebf=Array['from'](this['_activeMarkers'])['sort'](),_0x45f5ad=Array['from'](new Set(_0x580dd1['map'](_0xfee660=>_0xfee660['id'])))['sort']();_0x53aebf['join']('|')!==_0x45f5ad['join']('|')&&(this['setAllMarkersAsInactive'](),this['setMarkersInElementAsActive'](_0x473855));}['setMarkersInElementAsActive'](_0x4f6786){const _0x26f75d=this['_getMarkersDataForGroup'](_0x4f6786);if(!_0x26f75d['length'])return;const _0x111786=Fs(this['context']),_0x3be024=new Set(_0x26f75d['map'](_0x5e3453=>_0x5e3453['id'])),_0x11eb6a=Array['from'](_0x3be024['values']())['map'](_0x2780a9=>_0x111786['model']['markers']['get'](_0x2780a9))['filter'](_0x40493c=>!!_0x40493c);_0x3be024['forEach'](_0x138608=>{this['_activeMarkers']['add'](_0x138608);}),_0x111786['model']['change'](()=>{_0x11eb6a['forEach'](_0x5c448d=>{_0x111786['editing']['reconvertMarker'](_0x5c448d);});});}['setAllMarkersAsInactive'](){const _0x478ccb=Array['from'](this['_activeMarkers']);if(!_0x478ccb['length'])return;this['_activeMarkers']['clear']();const _0x54b40c=Fs(this['context']),_0x3ee175=_0x478ccb['map'](_0x46888e=>_0x54b40c['model']['markers']['get'](_0x46888e))['filter'](_0x41b985=>!!_0x41b985);_0x54b40c['model']['change'](()=>{_0x3ee175['forEach'](_0x234767=>{_0x54b40c['editing']['reconvertMarker'](_0x234767);});});}['_getPositionLimitingRange'](_0x3eed01,_0x1eb09c,_0x57a8d6='outside'){if(!_0x3eed01)return null;let _0x5c04fe=_0x3eed01['parent'];for(;_0x5c04fe&&_0x5c04fe['parent']&&'$root'!==_0x5c04fe['parent']['name']&&!_0x1eb09c['model']['schema']['isLimit'](_0x5c04fe)&&!_0x1eb09c['model']['schema']['isBlock'](_0x5c04fe);)_0x5c04fe=_0x5c04fe['parent'];if(!_0x5c04fe||!_0x5c04fe['name']||'$root'===_0x5c04fe['name'])return null;let _0x41ab8e=null;return _0x1eb09c['model']['change'](_0x354ea3=>{_0x41ab8e='inside'===_0x57a8d6?_0x354ea3['createRangeIn'](_0x5c04fe):_0x354ea3['createRangeOn'](_0x5c04fe);}),_0x41ab8e;}['_validateMarkers'](_0x30115a,_0xb440f4){const _0x1ca23e=Array['from'](this['_markers']['keys']()),_0x406736=new Map();for(const _0x1996d7 of _0x1ca23e){const _0x3499a3=_0x30115a['model']['markers']['get'](_0x1996d7);if(!_0x3499a3)continue;const _0x235af8=_0x3499a3['getStart']()['path'][0x0];_0x406736['has'](_0x235af8)||_0x406736['set'](_0x235af8,[]),_0x406736['get'](_0x235af8)['push'](_0x3499a3);}const _0x2a312c=new Set();for(const _0x54eb9b of _0x30115a['model']['document']['differ']['getChanges']()){let _0x38986f=-0x1,_0x4d0596=null;if('insert'===_0x54eb9b['type'])_0x4d0596=new _0x34cb53(_0x54eb9b['position'],_0x54eb9b['position']['getShiftedBy'](_0x54eb9b['length'])),_0x38986f=_0x54eb9b['position']['path'][0x0];else{if('remove'!==_0x54eb9b['type'])continue;_0x4d0596=new _0x34cb53(_0x54eb9b['position']),_0x38986f=_0x54eb9b['position']['path'][0x0];}const _0x14d542=_0x406736['get'](_0x38986f)||[];if(_0x14d542['length']){for(const _0x39ab39 of _0x14d542)if(_0x4d0596['root']['rootName']===_0x39ab39['getRange']()['root']['rootName']&&('insert'!==_0x54eb9b['type']||!_0x4d0596['containsRange'](_0x39ab39['getRange']()))&&(_0x4d0596['isIntersecting'](_0x39ab39['getRange']())||_0x4d0596['start']['isTouching'](_0x39ab39['getRange']()['end'])||_0x4d0596['end']['isTouching'](_0x39ab39['getRange']()['start']))){const _0x1a8bc0=this['_parseMarkerName'](_0x39ab39['name']);Array['from'](this['_markers']['values']())['filter'](_0x379e35=>_0x379e35['groupId']===_0x1a8bc0['groupId'])['forEach'](_0x2c135c=>_0x2a312c['add'](_0x2c135c['id']));}}}if(_0x2a312c['size']){for(const _0x42028c of _0x2a312c)_0xb440f4['removeMarker'](_0x42028c);return!0x0;}return!0x1;}['_handleMarkerChanges'](_0x5910dc){for(const {name:_0x40a0f7,data:_0x403757}of _0x5910dc['model']['document']['differ']['getChangedMarkers']()){if(!_0x40a0f7['startsWith'](Ao))continue;const _0x4c0263=_0x403757['oldRange'],_0x3fb4d8=_0x403757['newRange'],_0x49523c=_0x4c0263&&'$graveyard'===_0x4c0263['root']['rootName'],_0x4ad6f5=_0x3fb4d8&&'$graveyard'===_0x3fb4d8['root']['rootName'];if(_0x49523c&&_0x4ad6f5)continue;const _0x2f1ef8=this['_parseMarkerName'](_0x40a0f7);this['_markers']['get'](_0x40a0f7)&&(_0x4ad6f5||!_0x3fb4d8?this['_eventEmitter']['fire']('changeMarkerRemoved',{'markerId':_0x40a0f7,'changeId':_0x2f1ef8['groupId']}):_0x49523c&&_0x3fb4d8&&this['_eventEmitter']['fire']('changeMarkerRestored',{'markerId':_0x40a0f7,'changeId':_0x2f1ef8['groupId']}));}}['_parseMarkerName'](_0x338079){const _0x2292b8=_0x338079['split'](':'),_0x45fafc=(_0x2292b8[0x1]||'')['split']('_');return{'prefix':_0x2292b8[0x0],'groupId':_0x45fafc[0x0],'suffix':_0x45fafc[0x1]};}['_translateOperationToEditorContent'](_0x36a043,_0x1430a2,_0x3794c0){if('insert'===_0x36a043['type']){const _0x411f66=_0x36a043;return new _0x4fd0d3(this['_changePosition'](_0x1430a2['concat'](_0x411f66['position']['offset']),_0x3794c0),_0x411f66['nodes'],_0x411f66['baseVersion']);}if('marker'===_0x36a043['type']&&_0x36a043['name']['startsWith']('$markedRemove')){const _0x111ed6=_0x36a043;return new _0x480c88(_0x111ed6['name'],_0x111ed6['oldRange'],this['_changeRange'](_0x111ed6['newRange'],_0x1430a2['concat'](_0x111ed6['newRange']['start']['offset']),_0x1430a2['concat'](_0x111ed6['newRange']['end']['offset']),_0x3794c0),_0x111ed6['_markers'],_0x111ed6['affectsData'],_0x111ed6['baseVersion']);}return _0x36a043;}['_groupAdjacentOperations'](_0x163d18){if(!_0x163d18['length'])return[];const _0x681ca5=[];let _0x111e7c=0x0,_0x8bf9eb=0x0,_0xd8484e=[];for(let _0x3b227b=0x0;_0x3b227b<=_0x163d18['length'];_0x3b227b++){const _0x25db74=_0x163d18[_0x3b227b],_0x102bd1=_0x163d18[_0x3b227b-0x1];!_0x25db74||_0x102bd1&&!this['_getOperationEnd'](_0x102bd1)['isTouching'](this['_getOperationStart'](_0x25db74))?(_0x681ca5['push']({'operations':_0xd8484e,'operationsIsolated':_0xd8484e['map'](_0x4d7303=>this['_shiftOperation'](_0x4d7303['clone'](),-_0x8bf9eb)),'groupOffset':_0x111e7c}),_0xd8484e=_0x25db74?[_0x25db74]:[],_0x8bf9eb+=_0x111e7c,_0x111e7c=0x0):_0xd8484e['push'](_0x25db74),_0x25db74&&'insert'===_0x25db74['type']&&(_0x111e7c+=_0x25db74['howMany']);}return _0x681ca5;}['_findAdjacentContextDistance'](_0x9faaea,_0x9c79d6,_0x250e63,_0x198dca=0x1){const _0x2bf95d=new _0x66aaa3({'startPosition':_0x9faaea,'direction':_0x9c79d6});let _0x1a96a8=0x0;for(let _0x52c432=0x0;_0x52c432<_0x198dca;_0x52c432++){let _0x3d8dd3=0x0,_0x50ed52=!0x1,_0x61c930='forward'===_0x9c79d6?/^\W*\w+/:/\w+\W*$/;for(const {item:_0x452209}of _0x2bf95d)if(_0x452209['is']('$textProxy')){const _0x197a87=_0x61c930['exec'](_0x452209['data']);if(_0x197a87&&_0x197a87['length']){if(_0x3d8dd3+='forward'===_0x9c79d6?_0x197a87['index']+_0x197a87[0x0]['length']:_0x452209['data']['length']-_0x197a87['index'],_0x197a87[0x0]['length']!==_0x452209['data']['length'])break;_0x50ed52=!0x0,_0x61c930='forward'===_0x9c79d6?/^\w+/:/\w+$/;}else{if(_0x50ed52)break;_0x3d8dd3+=_0x452209['offsetSize'];}}else{if(_0x452209['is']('element')){_0x250e63['isInline'](_0x452209)&&!_0x50ed52&&(_0x3d8dd3+=0x1);break;}}_0x1a96a8+=_0x3d8dd3,_0x2bf95d['jumpTo'](_0x9faaea['getShiftedBy']('forward'===_0x9c79d6?_0x1a96a8:-_0x1a96a8));}return _0x1a96a8;}['_getChangeContext'](_0x459294,_0x176482){const _0x1ec7fd=Fs(this['context'])['model']['schema'],_0x4ab154=this['_findAdjacentContextDistance'](_0x459294,'backward',_0x1ec7fd,0x6),_0x334cb1=this['_findAdjacentContextDistance'](_0x176482,'forward',_0x1ec7fd,0x6),_0x364f2a=_0x459294['getShiftedBy'](-_0x4ab154),_0x5ebe1b=_0x176482['getShiftedBy'](_0x334cb1);return{'start':_0x364f2a,'end':_0x5ebe1b,'hasContentBefore':!_0x364f2a['isAtStart'],'hasContentAfter':!_0x5ebe1b['isAtEnd']};}['_insertMarkers'](_0x100473){const _0x2b57cb=this['context']['plugins']['get']('AIEditing'),_0x4c1dbd=new Set();Fs(this['context'])['model']['change'](_0x483e97=>{for(const _0x4e1d64 of _0x100473){const _0xf1b0ee=''+Ao+_0x4e1d64['type']+':'+_0x4e1d64['groupId']+'_'+_0x2b57cb['_nextDataId'](_0x4c1dbd);this['_markers']['set'](_0xf1b0ee,{'id':_0xf1b0ee,'groupId':_0x4e1d64['groupId'],'type':_0x4e1d64['type'],'content':_0x4e1d64['content']}),_0x483e97['addMarker'](_0xf1b0ee,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x483e97['createRange'](_0x4e1d64['start'],_0x4e1d64['end'])});}});}['_createGetContextFn'](_0x495573,_0x29a1c3,_0x3253cf){let _0x3045a5='';return()=>{if(!_0x3045a5){const _0x4b246c=_0x29a1c3['toView'](_0x495573,{'showSuggestionHighlights':!0x0});let _0x386feb=_0x4b246c['getChild'](0x0);if(_0x386feb['is']('containerElement')||(_0x386feb=_0x4b246c),!_0x386feb)return'';let _0x520393=!0x1;const _0x36158b=[];for(const _0x5b7fc4 of _0x386feb['getChildren']())_0x5b7fc4['is']('element','span')&&_0x5b7fc4['hasClass']('ck-ai_review-marker_context-end')&&(_0x520393=!0x1),_0x520393&&_0x36158b['push'](_0x5b7fc4),_0x5b7fc4['is']('element','span')&&_0x5b7fc4['hasClass']('ck-ai_review-marker_context-start')&&(_0x520393=!0x0);_0x386feb['_removeChildren'](0x0,_0x386feb['childCount']),_0x3253cf?.['ellipsisBefore']&&_0x386feb['_appendChild']('…'),_0x386feb['_appendChild'](_0x36158b),_0x3253cf?.['ellipsisAfter']&&_0x386feb['_appendChild']('…');const _0x2a675d=_0x29a1c3['htmlProcessor']['domConverter']['viewToDom'](_0x4b246c),_0x389924=_0x29a1c3['htmlProcessor']['htmlWriter']['getHtml'](_0x2a675d);_0x3045a5=_0x389924;}return _0x3045a5;};}['_createGetContentFn'](_0x2d55e7,_0x2527e2){let _0x1f0d03='';return()=>(_0x1f0d03||(_0x1f0d03=_0x2527e2['stringify'](_0x2d55e7,{'showSuggestionHighlights':!0x0})),_0x1f0d03);}['_createGetContentUsingDataIdFn'](_0x2db70b,_0x1ff0e7,_0x1aaa93){let _0x1926ac='';return()=>{if(!_0x1926ac){const _0x1e66d5=_0x1aaa93['toView'](new _0x23a0e5(_0x2db70b)),_0x270e75=_0x1aaa93['htmlProcessor']['domConverter']['viewToDom'](_0x1e66d5)['querySelector']('[data-id=\x22'+_0x1ff0e7+'\x22]');_0x1926ac=_0x270e75?.['outerHTML']||'';}return _0x1926ac;};}['_findMarkerElement'](_0x47895f,_0x32222e=0x5){let _0x2732e0=_0x47895f,_0x3b218d=null;for(let _0x24a008=0x0;_0x24a008<_0x32222e&&_0x2732e0;_0x24a008++){if(!_0x2732e0['className']){_0x2732e0=_0x2732e0['parentElement'];continue;}if(!(''+_0x2732e0['className'])['includes']('ck-ai_review-marker_')){_0x2732e0=_0x2732e0['parentElement'];continue;}if(!_0x2732e0['getAttribute']('data-marker-id'))break;_0x3b218d=_0x2732e0;break;}return _0x3b218d;}['_findMarkerElementById'](_0x438077){const _0x1b9380=Fs(this['context']),_0x3f07e6=_0x1b9380['model']['markers']['get'](_0x438077);return _0x3f07e6?_0x5e1d44(_0x1b9380['editing'],_0x3f07e6):null;}['_getMarkersDataForGroup'](_0x596ed4){return Array['from'](this['_markers']['values']())['filter'](_0x7f9481=>_0x7f9481['groupId']===_0x596ed4);}['_getOperationStart'](_0x390da1){return'insert'===_0x390da1['type']?_0x390da1['position']:_0x390da1['newRange']['start'];}['_getOperationEnd'](_0x85ae95,_0x11ccaa=!0x1){return'insert'===_0x85ae95['type']?_0x11ccaa?_0x85ae95['position']:_0x85ae95['position']['getShiftedBy'](_0x85ae95['howMany']):_0x85ae95['newRange']['end'];}['_shiftOperation'](_0x5623a7,_0x477df6){return'insert'===_0x5623a7['type']?_0x5623a7['position']=_0x5623a7['position']['getShiftedBy'](_0x477df6):'marker'===_0x5623a7['type']&&_0x5623a7['newRange']&&(_0x5623a7['newRange']=new _0x34cb53(_0x5623a7['newRange']['start']['getShiftedBy'](_0x477df6),_0x5623a7['newRange']['end']['getShiftedBy'](_0x477df6))),_0x5623a7;}['_changeOperationOwnerDocument'](_0x39778c,_0x3c064e){'insert'===_0x39778c['type']?_0x39778c['position']=this['_changePositionOwnerDocument'](_0x39778c['position'],_0x3c064e):'marker'===_0x39778c['type']&&_0x39778c['newRange']&&(_0x39778c['newRange']=this['_changeRangeOwnerDocument'](_0x39778c['newRange'],_0x3c064e));}['_changePositionOwnerDocument'](_0x5907bd,_0x188679){return new _0x31292e(_0x188679,_0x5907bd['path']);}['_changeRangeOwnerDocument'](_0x23a93e,_0x39945c){return new _0x34cb53(this['_changePositionOwnerDocument'](_0x23a93e['start'],_0x39945c),this['_changePositionOwnerDocument'](_0x23a93e['end'],_0x39945c));}['_changePosition'](_0x2fe511,_0x55573b){return new _0x31292e(_0x55573b,[..._0x2fe511]);}['_changeRange'](_0x29b75b,_0x43f68f,_0x4553f7,_0xa773f8){return new _0x34cb53(this['_changePosition'](_0x43f68f,_0xa773f8),this['_changePosition'](_0x4553f7,_0xa773f8));}['_sortMarkers'](_0x27c895){const _0x19d387=_0x44cdd4=>{switch(_0x44cdd4){case'insert':return 0x0;case'remove-context':return 0x1;case'remove-only':return 0x2;case'remove-text':return 0x3;}};return _0x27c895['sort']((_0x230bac,_0x86e41e)=>_0x19d387(_0x230bac['type'])-_0x19d387(_0x86e41e['type']));}['_hasSameTopLevelElement'](_0x3ba3ed,_0x837886){const _0x3f64d0=_0x3ba3ed['getChild'](0x0),_0x41fcc7=_0x837886['getChild'](0x0);return!(!_0x3f64d0||!_0x41fcc7)&&((!_0x3f64d0['is']('element')||!_0x41fcc7['is']('element')||_0x3f64d0['name']===_0x41fcc7['name'])&&!(_0x3f64d0['is']('element')&&!_0x41fcc7['is']('element')||!_0x3f64d0['is']('element')&&_0x41fcc7['is']('element')));}['_haveSingleTopLevelElement'](_0x579447){return 0x1===_0x579447['childCount'];}['_haveOnlyInlineContent'](_0x1ed14c,_0x5bd66f){for(const _0x556459 of _0x1ed14c['getChildren']())if(_0x556459['is']('element')&&!_0x5bd66f['isInline'](_0x556459))return!0x1;return!0x0;}['_upsertDataId'](_0x49e7a8,_0x1016b5){let _0x5f54f7=_0x49e7a8['getAttribute'](_0x45927f);return _0x5f54f7||(_0x5f54f7=_0x1016b5(),_0x49e7a8['_setAttribute'](_0x45927f,_0x5f54f7)),_0x5f54f7;}}class Io extends pt(){['id'];['contentNew'];['contentInitial'];['documentVersion'];constructor({id:_0x405082,contentNew:_0x49fc1f,contentInitial:_0x18d39c,documentVersion:_0x35fa5f}){super(),this['id']=_0x405082,this['contentNew']=_0x49fc1f,this['contentInitial']=_0x18d39c,this['documentVersion']=_0x35fa5f;}}class Eo extends ht(){['id'];['parent'];['_data'];['_editorOperations']=[];constructor(_0x266e27,_0x59433f,_0x5a869a){super(),this['id']=_0x266e27,this['parent']=_0x5a869a,this['_data']=_0x59433f,this['set']('isActivated',!0x1),this['set']('isRated',!0x1),this['set']('status','pending'),this['on']('change:status',()=>{'pending'!==this['status']&&this['isActivated']&&(this['isActivated']=!0x1);});}get['contentDiffed'](){return this['_data']['context']();}get['operations'](){return this['_data']['operations'];}get['operationsIsolated'](){return this['_data']['operationsIsolated'];}}class To extends ht(){['id']=at();['callId'];['_results']=new Map();['_changes']=[];['_sourceCheck'];['_documentData'];['_aiConnector'];['_reviewParams'];['_reviewArgs'];['_activeRequest']=null;['_currentError'];['_wasAborted']=!0x1;constructor(_0x518fc3,_0x1e8a30,_0x4854b3,_0x4be3a4,_0x473233){super(),this['_sourceCheck']=_0x1e8a30,this['_documentData']=_0x518fc3,this['_aiConnector']=_0x4854b3,this['_reviewParams']=_0x4be3a4,this['_reviewArgs']=_0x473233,this['on']('change:status',(_0x5231ff,_0x4b8e56,_0x51eab4)=>{'aborted'==_0x51eab4&&(this['_wasAborted']=!0x0),this['fire']('reviewCheckRunUpdated',{'status':_0x51eab4,'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'](_0x3a267a=>'pending'===_0x3a267a['status']);}get['currentError'](){return this['_currentError'];}['updateDocumentData'](_0x8d56b6){this['_documentData']=_0x8d56b6;}async['start'](){this['status']='loading',this['_currentError']=void 0x0;try{this['_activeRequest']=this['_createApiRequest']();const _0x2d6e3f=await this['_activeRequest']['getStream']();this['status']='data';for await(const _0x538a5d of _0x2d6e3f)'unmodified'!==_0x538a5d['data']['operation']&&('error'!==_0x538a5d['data']['operation']?'review-metadata'!==_0x538a5d['event']?this['_addReviewCheckResult'](_0x538a5d['data']['dataId'],_0x538a5d['data']['textDelta']):this['callId']=_0x538a5d['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(_0x17cf5f){this['_currentError']=_0x17cf5f,_0x17cf5f instanceof Error&&_0x17cf5f['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'](_0x465cb3,_0x3696c9){const _0x5cae19=this['_results']['get'](_0x465cb3);if(!_0x5cae19)return;if(0x0===_0x3696c9['length'])return;const _0x22bc80=[];_0x3696c9['forEach']((_0x4095cf,_0x4835e3)=>{const _0x5c9ad1=new Eo(_0x5cae19['id']+'-'+_0x4835e3,_0x4095cf,_0x5cae19);_0x5c9ad1['on']('change:status',()=>{this['fire']('reviewCheckResultChangeStatusUpdated',{'change':_0x5c9ad1,'status':_0x5c9ad1['status']});}),_0x5c9ad1['on']('change:isActivated',()=>{_0x5c9ad1['isActivated']?this['fire']('reviewCheckResultActivated',{'change':_0x5c9ad1}):this['fire']('reviewCheckResultDeactivated',{'change':_0x5c9ad1});}),this['_changes']['push'](_0x5c9ad1),_0x22bc80['push'](_0x5c9ad1);}),this['fire']('reviewCheckResultReady',{'changes':_0x22bc80,'result':_0x5cae19,'source':this});}['abort'](){this['_activeRequest']&&(this['_activeRequest']['abortController']['abort'](),this['_activeRequest']=null,this['status']='aborted');}['isChangeActive'](_0x187bf0){const _0xc30c78=this['_changes']['find'](_0x5a936b=>_0x5a936b['id']===_0x187bf0);return!(!_0xc30c78||'pending'!==_0xc30c78['status']);}['isAnyChangeActivated'](){return this['_changes']['some'](_0x10b12e=>!0x0===_0x10b12e['isActivated']);}['getActiveChanges'](){return this['_changes']['filter'](_0x22b904=>'pending'===_0x22b904['status']);}['getChangeById'](_0x248e3f){return this['_changes']['find'](_0xca702f=>_0xca702f['id']===_0x248e3f);}['markAllChangesAsAccepted'](){for(const _0x7b8882 of this['_changes'])'pending'===_0x7b8882['status']&&(_0x7b8882['status']='accepted');this['_checkIfFinished']();}['markChangeAsAccepted'](_0x4da7bb){const _0x666b3c=this['_changes']['find'](_0x4bea0f=>_0x4bea0f['id']===_0x4da7bb);_0x666b3c&&'pending'===_0x666b3c['status']&&(_0x666b3c['status']='accepted'),this['_checkIfFinished']();}['markChangeAsRejected'](_0x3402d4){const _0x31ba35=this['_changes']['find'](_0x4ee54c=>_0x4ee54c['id']===_0x3402d4);_0x31ba35&&'pending'===_0x31ba35['status']&&(_0x31ba35['status']='rejected'),this['_checkIfFinished']();}['markChangeAsOutdated'](_0xe67884){const _0x1d452e=this['_changes']['find'](_0x2c47d5=>_0x2c47d5['id']===_0xe67884);_0x1d452e&&'pending'===_0x1d452e['status']&&(_0x1d452e['status']='outdated'),this['_checkIfFinished']();}['markChangeAsPending'](_0xafe94d){const _0x36ead4=this['_changes']['find'](_0x18190e=>_0x18190e['id']===_0xafe94d);_0x36ead4&&'outdated'===_0x36ead4['status']&&(_0x36ead4['status']='pending'),this['_checkIfFinished']();}['activateChange'](_0x568054){this['_changes']['filter'](_0x130608=>_0x130608['isActivated']&&_0x130608['id']!==_0x568054)['forEach'](_0x47a1c5=>{_0x47a1c5['isActivated']=!0x1;});const _0x1bdb5d=this['_changes']['find'](_0x17992e=>_0x17992e['id']===_0x568054);_0x1bdb5d&&'pending'===_0x1bdb5d['status']&&(_0x1bdb5d['isActivated']=!0x0);}['deactivateChange'](){this['_changes']['filter'](_0x1a6d62=>_0x1a6d62['isActivated'])['forEach'](_0x33b8dd=>{_0x33b8dd['isActivated']=!0x1;});}['forceReadyState'](){this['status']='ready';}async['sendRating'](_0x37d728){if('initialized'===this['status']||'loading'===this['status']||'data'===this['status']||this['_wasAborted'])return;if(!this['callId']||0x0===this['_changes']['length'])return;let _0x58820c;if(_0x37d728){const _0x278518=this['_changes']['find'](_0x4d7d04=>_0x4d7d04['id']===_0x37d728);if(_0x278518&&_0x278518['isRated'])return;_0x278518&&(_0x58820c=_0x278518['parent']['id'],_0x278518['isRated']=!0x0);}const _0x59306f={'positiveCount':this['_changes']['filter'](_0x581e69=>'accepted'===_0x581e69['status'])['length'],'totalCount':this['_changes']['length']};this['_sendRatingRequest'](_0x59306f,this['callId'],_0x58820c);}['_addReviewCheckResult'](_0x16498e,_0x2ff7f8){const _0x25e92d=this['_documentData']['elements']['get'](_0x16498e);if(!_0x25e92d)return;const _0x2a0ba0=_0x25e92d['getContent']();if(_0x2a0ba0===_0x2ff7f8)return;const _0x27e53d=new Io({'id':_0x16498e,'contentInitial':_0x2a0ba0,'contentNew':_0x2ff7f8,'documentVersion':this['_documentData']['version']});this['_results']['set'](_0x27e53d['id'],_0x27e53d),this['fire']('reviewCheckResultAdded',{'result':_0x27e53d,'source':this});}['_checkIfFinished'](){'finished'===this['status']&&(this['_changes']['filter'](_0x3f3576=>'pending'===_0x3f3576['status'])['length']>0x0&&(this['status']='ready')),'ready'===this['status']&&(0x0===this['_changes']['filter'](_0x5f15e1=>'pending'===_0x5f15e1['status'])['length']&&(this['status']='finished'));}}class po extends To{get['subTitle'](){if(!this['_reviewParams']||0x0===this['_reviewParams']['length'])return'';const _0x1b7815=[];if(this['_reviewParams']['length']>0x0&&this['_sourceCheck']['options'])for(let _0x1e47a8=0x0;_0x1e47a8<this['_reviewParams']['length'];_0x1e47a8++){if(!this['_reviewParams'][_0x1e47a8]||!this['_sourceCheck']['options'][_0x1e47a8])continue;const _0x43bc89=this['_sourceCheck']['options'][_0x1e47a8],_0x2b8c14=_0x43bc89['data']?.['find'](_0x1ebc24=>_0x1ebc24['id']===this['_reviewParams'][_0x1e47a8]);_0x2b8c14&&_0x1b7815['push'](_0x2b8c14['label']);}return _0x1b7815['join'](',\x20');}get['reviewName'](){return this['_composeReviewName']();}['_createApiRequest'](){return this['_aiConnector']['callSystemReview']({'reviewName':this['_composeReviewName'](),'content':this['_documentData']['content'],'args':this['_reviewArgs']});}['_sendRatingRequest'](_0x1c83f7,_0x4652b0,_0x5a54b){return this['_aiConnector']['upsertAIReviewRating'](this['reviewName'],_0x4652b0,_0x1c83f7,_0x5a54b);}['_composeReviewName'](){return!this['_reviewParams']||0x0===this['_reviewParams']['length']||this['_sourceCheck']['useArgs']?this['_sourceCheck']['apiId']:[this['_sourceCheck']['apiId'],...this['_reviewParams']]['join']('-');}}class mo extends _0x333531{['_aiConnector'];['_aiReviewCoreUi'];['_aiReviewCoreEditing'];['_aiReviewCheckList'];['_currentReviewCheckRun'];['_changeActivationSource']=null;static get['requires'](){return[rs];}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}async['init'](){this['_initRequiredPlugins'](),this['_aiReviewCheckList']=await this['_getChecksList'](),this['listenTo'](this['_aiReviewCoreUi'],'getReviewCheckList',()=>{this['_aiReviewCoreUi']['setAvailableChecks'](this['_aiReviewCheckList']['checks']);}),this['listenTo'](this['_aiReviewCoreUi'],'runReviewCheck',async(_0xd85327,_0x4a9343)=>{const _0x416431=this['_aiReviewCheckList']['getCheckById'](_0x4a9343['id']);if(_0x416431){this['_onReviewCheckRun'](_0x4a9343),this['_aiReviewCoreEditing']['switchToReadOnly'](),this['_currentReviewCheckRun']=this['_createReviewCheckRun'](_0x4a9343,_0x416431),this['_aiReviewCoreUi']['setCheckResultTitle'](this['_currentReviewCheckRun']['title'],this['_currentReviewCheckRun']['subTitle']),this['_currentReviewCheckRun']['on']('reviewCheckRunUpdated',(_0x48a149,_0x1f9331)=>{switch(_0x1f9331['status']){case'data':case'loading':this['_aiReviewCoreUi']['showCheckRunResults'](_0x1f9331);break;case'finished':this['_onCheckRunFinished']();break;case'ready':this['_aiReviewCoreUi']['showActionsWhenResultIsReady']();break;case'unmodified':this['_aiReviewCoreUi']['showNoChangesView']();break;case'error-general':this['_aiReviewCoreUi']['showGeneralResultsErrorView'](),this['_logError'](new ot('ai-review-mode-check-run-general-error',this,void 0x0,this['_currentReviewCheckRun']?.['currentError']));break;case'error-chunk':this['_aiReviewCoreUi']['showChunkErrorView'](),this['_logError'](new ot('ai-review-mode-check-run-chunk-error',this,void 0x0,this['_currentReviewCheckRun']?.['currentError']));break;case'aborted':this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['processedResultsCount']>0x0?setTimeout(()=>{this['_currentReviewCheckRun']?.['forceReadyState']();},0x0):this['_onReviewRunLeave'](!0x0);}'ready'!==_0x1f9331['status']&&'error-chunk'!==_0x1f9331['status']&&'error-general'!==_0x1f9331['status']||this['_currentReviewCheckRun']?.['sendRating']();}),this['_currentReviewCheckRun']['on']('reviewCheckResultAdded',(_0x1f4450,_0x1fc04d)=>{if(!this['_currentReviewCheckRun'])throw new ot('ai-review-mode-no-current-check-run',this);const _0x231057=this['_diffContent'](_0x1fc04d['result']['contentInitial'],_0x1fc04d['result']['contentNew']);_0x1fc04d['source']['addResultChanges'](_0x1fc04d['result']['id'],_0x231057);}),this['_currentReviewCheckRun']['on']('reviewCheckResultReady',(_0xa792fe,_0x96a8a0)=>{for(const _0xa07ef5 of _0x96a8a0['changes'])this['_aiReviewCoreUi']['showCheckRunResult'](_0xa07ef5);this['_markChangePositionInEditorContent'](_0x96a8a0['changes'],_0x96a8a0['source']['documentData']);}),this['_currentReviewCheckRun']['on']('reviewCheckResultChangeStatusUpdated',(_0x3b14e2,_0x2a59b4)=>{this['_aiReviewCoreUi']['updateChangeState'](_0x2a59b4['change']['id'],_0x2a59b4['status']);}),this['_currentReviewCheckRun']['on']('reviewCheckResultActivated',(_0x5a4fe1,_0x47bd98)=>{this['_onReviewCheckResultActivated'](_0x47bd98);}),this['_currentReviewCheckRun']['on']('reviewCheckResultDeactivated',()=>{this['_onReviewCheckResultDeactivated']();});try{await this['_currentReviewCheckRun']['start']();}catch(_0x2f7680){_0x2f7680 instanceof Error&&_0x2f7680['message']['includes']('ai-request-aborted')||(_0x2f7680 instanceof ot?this['_logError'](_0x2f7680):this['_logError'](new ot('ai-review-mode-check-run-failed',this,void 0x0,_0x2f7680)));}}else this['_logError'](new ot('ai-review-mode-source-check-not-found',this,{'checkId':_0x4a9343['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 _0x55605a=this['_currentReviewCheckRun']['getActiveChanges']();if(!_0x55605a['length'])return;this['_aiReviewCoreEditing']['applyChange'](_0x55605a['map'](_0x357d3d=>_0x357d3d['id']));const _0x31aa5e=this['_currentReviewCheckRun'];_0x31aa5e['markAllChangesAsAccepted'](),_0x31aa5e['sendRating']();}),this['listenTo'](this['_aiReviewCoreUi'],'acceptChange',(_0x196bf6,_0x58cd29)=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['isChangeActive'](_0x58cd29['id'])&&(this['_aiReviewCoreEditing']['applyChange']([_0x58cd29['id']]),this['_currentReviewCheckRun']['markChangeAsAccepted'](_0x58cd29['id']),this['_aiReviewCoreUi']['hideChangeBalloon'](),this['_currentReviewCheckRun']['sendRating'](_0x58cd29['id']));}),this['listenTo'](this['_aiReviewCoreUi'],'dismissChange',(_0x303276,_0x537866)=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['isChangeActive'](_0x537866['id'])&&(this['_aiReviewCoreEditing']['rejectChange'](_0x537866['id']),this['_currentReviewCheckRun']['markChangeAsRejected'](_0x537866['id']),this['_aiReviewCoreUi']['hideChangeBalloon'](),this['_currentReviewCheckRun']['sendRating'](_0x537866['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',(_0x2205a2,_0x279840)=>{this['_onActivateChange'](_0x279840);}),this['listenTo'](this['_aiReviewCoreUi'],'deactivateChange',(_0x54afd1,_0x377b99)=>{this['_onDeactivateChange'](_0x377b99);}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerClicked',(_0x3e5a33,_0x485733)=>{this['_onChangeMarkerClicked'](_0x3e5a33,_0x485733);}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerHovered',(_0x2ce768,_0x4c762d)=>{this['_onChangeMarkerHovered'](_0x2ce768,_0x4c762d);}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerBlurred',()=>{this['_onChangeMarkerBlurred']();}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerRemoved',(_0x194983,_0x110f67)=>{this['_onChangeMarkerRemoved'](_0x194983,_0x110f67);}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerRestored',(_0x3f2a88,_0x39470c)=>{this['_onChangeMarkerRestored'](_0x3f2a88,_0x39470c);});}['_createReviewCheckRun'](_0x60c624,_0x47606e){return new po(this['_aiReviewCoreEditing']['getDocumentData'](),_0x47606e,this['_aiConnector'],_0x60c624['params'],_0x60c624['args']);}['_onChangeMarkerRemoved'](_0x4b6c51,_0x31e3b0){this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['markChangeAsOutdated'](_0x31e3b0['changeId']);}['_onChangeMarkerRestored'](_0x40c82e,_0x174da5){this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['markChangeAsPending'](_0x174da5['changeId']);}['_onCheckRunFinished'](){this['_aiReviewCoreUi']['showReviewCompletedView']();}['_initRequiredPlugins'](){this['_aiConnector']=this['context']['plugins']['get']('AIConnector');}['_onReviewRunLeave'](_0x2464a4=!0x1){this['_currentReviewCheckRun']&&(this['_currentReviewCheckRun']['hasModifications']||this['_currentReviewCheckRun']['sendRating'](),this['_currentReviewCheckRun']['stopListening'](),this['_currentReviewCheckRun']['abort'](),this['_currentReviewCheckRun']=void 0x0),_0x2464a4&&this['_aiReviewCoreUi']['showReviewCheckList'](),this['_aiReviewCoreEditing']['clearAllMarkers'](),this['_aiReviewCoreEditing']['switchToEdit'](),this['_changeActivationSource']=null;const _0xf3ef14=this['_aiReviewCoreEditing']['getEditor']();_0xf3ef14&&_0xf3ef14['editing']['view']['change'](_0x4aaee3=>{const _0x190d64=_0xf3ef14['editing']['view']['document']['getRoot']();_0x4aaee3['removeClass']('ck-ai_review-diff',_0x190d64),_0x4aaee3['removeClass']('ck-ai_review-highlights',_0x190d64),_0x4aaee3['removeClass']('ck-ai-translate-mode-content',_0x190d64);});}['_getTranslationWithDefault'](_0x5bf99d,_0x495930){const _0x1b7336=as(this['context']['locale'],_0x5bf99d);return _0x1b7336===_0x5bf99d?_0x495930:_0x1b7336;}['_logError'](_0x300be2,_0xafb250=!0x1){Et(_0x300be2['message']),_0xafb250||(_0x300be2['message']['startsWith']('ai-review-mode-models-unable-to-retrieve')?this['_aiReviewCoreUi']['showGeneralReviewCoreErrorView']():this['_aiReviewCoreUi']['showGeneralResultsErrorView']());}['_scrollToChange'](_0x5b38e8){if('content'===this['_changeActivationSource']){const _0x288830=this['_aiReviewCoreUi']['getChangeElement'](_0x5b38e8);_0x288830&&wt(_0x288830['closest']('.ck-ai_review__check-run-result')||_0x288830);}else{if('panel'===this['_changeActivationSource']){const _0x144451=this['_getChangeContentElement'](_0x5b38e8);if(!_0x144451)return;mt({'target':_0x144451,'viewportOffset':{'top':0x55,'left':0x0,'bottom':0x0,'right':0x0},'ancestorOffset':0x14,'alignToTop':!0x0});}}}}const Co=[{'id':'custom','commandId':'custom','title':'Custom\x20command','description':'Type\x20a\x20custom\x20command\x20to\x20review\x20the\x20content\x20exactly\x20as\x20you\x20need.','isParameterized':!0x0},{'id':'correctness','commandId':'correctness','title':'Correctness','description':'Ensure\x20the\x20text\x20is\x20factually\x20accurate\x20and\x20free\x20of\x20errors.','isParameterized':!0x1},{'id':'clarity','commandId':'clarity','title':'Clarity','description':'Improve\x20the\x20clarity\x20and\x20readability\x20of\x20the\x20text.','isParameterized':!0x1},{'id':'readability','commandId':'readability','title':'Readability','description':'Enhance\x20the\x20overall\x20readability\x20of\x20the\x20text.','isParameterized':!0x1},{'id':'length','commandId':'make','title':'Adjust\x20length','description':'Refine\x20text\x20length\x20to\x20match\x20your\x20needs.','isParameterized':!0x0,'options':[{'formType':'dropdown','label':'Adjust\x20length','default':'longer','data':[{'label':'Longer','id':'longer'},{'label':'Shorter','id':'shorter'}]}]},{'id':'tone','commandId':'make-tone','title':'Adjust\x20tone\x20and\x20style','description':'Choose\x20tone\x20and\x20style\x20to\x20change\x20content\x20as\x20you\x20need.','isParameterized':!0x0,'options':[{'formType':'dropdown','label':'Adjust\x20tone\x20and\x20style','default':'casual','data':[{'label':'Casual','id':'casual'},{'label':'Direct','id':'direct'},{'label':'Friendly','id':'friendly'},{'label':'Confident','id':'confident'},{'label':'Professional','id':'professional'}]}]}];class wo{['id'];['commandId'];['title'];['description'];['isParameterized'];['useArgs'];['options'];['args'];get['apiId'](){return this['commandId'];}constructor(_0x3edeee){this['id']=_0x3edeee['id'],this['commandId']=_0x3edeee['commandId'],this['title']=_0x3edeee['title'],this['description']=_0x3edeee['description'],this['isParameterized']=_0x3edeee['isParameterized'],this['useArgs']=_0x3edeee['useArgs'],this['options']=_0x3edeee['options'],this['args']=_0x3edeee['args'];}}class fo extends ht(){['_checks']=[];['setupChecks'](_0x5e97d0){this['_checks']=_0x5e97d0['map'](_0x4d9223=>new wo(_0x4d9223));}get['checks'](){return this['_checks'];}['getCheckById'](_0x1b0f0b){return this['checks']['find'](_0x133b44=>_0x133b44['id']===_0x1b0f0b);}['removeCheckById'](_0xf81d52){this['_checks']=this['_checks']['filter'](_0x5c3d2f=>_0x5c3d2f['id']!==_0xf81d52);}}class So extends wo{['_models']=[];['_defaultModel']=null;constructor(_0x12f0df,_0x24b3c3,_0x5976cf){super(_0x12f0df),this['_models']=_0x24b3c3,this['_defaultModel']=_0x5976cf;}get['models'](){return this['_models'];}get['defaultModel'](){return this['_defaultModel'];}}class bo extends wo{['isExtra']=!0x0;['prompt'];['model'];['_defaultModel']=null;constructor(_0x469762,_0x1b9527,_0x3df4bd){super(_0x469762),this['prompt']=_0x469762['prompt'],this['model']=_0x469762['model'],this['model']?this['_defaultModel']=_0x1b9527['find'](_0x3dab0d=>_0x3dab0d['id']===this['model'])||null:this['_defaultModel']=_0x3df4bd;}get['defaultModel'](){return this['_defaultModel'];}}class Ro extends fo{['_allModels']=[];['_recommendedModels']=[];['_defaultModel']=null;constructor(_0x482a29,_0x4fa914,_0x277643){super(),this['_allModels']=_0x482a29,this['_recommendedModels']=_0x4fa914,this['_defaultModel']=_0x277643;}['setupChecks'](_0x56426e){this['_checks']=_0x56426e['map'](_0x4d35e2=>!0x0===_0x4d35e2['isExtra']?new bo(_0x4d35e2,this['_allModels'],this['_defaultModel']):'custom'===_0x4d35e2['id']?new So(_0x4d35e2,this['_recommendedModels'],this['_defaultModel']):new wo(_0x4d35e2));}}class Oo extends To{['_prompt'];['_model'];constructor(_0x4edf22,_0x3dde99,_0x1b5f99,_0xb5d05e,_0x2d8e29){super(_0x1b5f99,_0xb5d05e,_0x2d8e29),this['_prompt']=_0x4edf22,this['_model']=_0x3dde99;}get['subTitle'](){return this['_prompt'];}['_createApiRequest'](){return this['_aiConnector']['callCustomReview']({'content':this['_documentData']['content'],'prompt':this['_prompt'],'model':this['_model']});}['_sendRatingRequest'](_0x1ef907,_0x371d2e,_0xcaf7e4){return this['_aiConnector']['upsertCustomAIReviewRating'](_0x371d2e,_0x1ef907,_0xcaf7e4);}}class ko extends Oo{get['subTitle'](){return'';}set['prompt'](_0x78326c){this['_prompt']=_0x78326c;}set['model'](_0x3c076b){this['_model']=_0x3c076b;}}class No extends mo{static get['pluginName'](){return'AIReviewModeController';}['_isDiffOn']=!0x1;['_hasDefaultAvailableCommands']=!0x1;constructor(_0x470e50){super(_0x470e50),this['_hasDefaultAvailableCommands']=!this['context']['config']['get']('ai.review.availableCommands'),this['context']['config']['define']('ai.review.availableCommands',Co['map'](_0x1eed4a=>_0x1eed4a['id'])),this['context']['config']['define']('ai.review.extraCommands',[]);}async['init'](){await super['init'](),this['listenTo'](this['_aiReviewCoreUi'],'toggleDiff',(_0x3e6890,_0x5c4cb4)=>{this['_isDiffOn']=_0x5c4cb4['on'],this['_onDiffChange'](this['_isDiffOn']);});}['_initRequiredPlugins'](){super['_initRequiredPlugins'](),this['_aiReviewCoreUi']=this['context']['plugins']['get']('AIReviewModeUI'),this['_aiReviewCoreEditing']=this['context']['plugins']['get']('AIReviewCoreEditing');}['_createReviewCheckRun'](_0x1a26d9,_0x38935a){return _0x1a26d9['isCustom']?new Oo(_0x1a26d9['args']['prompt'],_0x1a26d9['args']['model'],this['_aiReviewCoreEditing']['getDocumentData'](),_0x38935a,this['_aiConnector']):_0x38935a['isExtra']?new ko(_0x38935a['prompt'],_0x38935a['defaultModel']['id'],this['_aiReviewCoreEditing']['getDocumentData'](),_0x38935a,this['_aiConnector']):new po(this['_aiReviewCoreEditing']['getDocumentData'](),_0x38935a,this['_aiConnector'],_0x1a26d9['params'],_0x1a26d9['args']);}['_onReviewCheckResultActivated'](_0xd45a8e){this['_aiReviewCoreUi']['setActiveStateInResults'](_0xd45a8e['change']['id']),this['_scrollToChange'](_0xd45a8e['change']['id']);const _0xd54bcb=this['_aiReviewCoreEditing']['getMarkerElementForChange'](_0xd45a8e['change']['id']);if(!_0xd54bcb)return;const _0x1068db=this['_aiReviewCoreEditing']['getEditor']();this['_aiReviewCoreUi']['showChangeBalloon'](_0xd45a8e['change'],()=>_0xd54bcb['getElement'](),void 0x0,'click',_0x1068db?.['editing']?.['view']?.['getDomRoot'](),_0x1068db?.['ui']?.['viewportOffset']),this['_aiReviewCoreEditing']['setMarkersInElementAsActive'](_0xd45a8e['change']['id']);}['_onReviewCheckResultDeactivated'](){this['_aiReviewCoreUi']['resetActiveStateInResults'](),this['_aiReviewCoreUi']['hideChangeBalloon'](),this['_aiReviewCoreEditing']['setAllMarkersAsInactive']();}['_onActivateChange'](_0x181895){this['_currentReviewCheckRun']&&'click'===_0x181895['uiInteraction']&&(this['_changeActivationSource']='panel',this['_currentReviewCheckRun']['activateChange'](_0x181895['id']));}['_onDeactivateChange'](_0x4584bf){this['_currentReviewCheckRun']&&'balloon'===_0x4584bf['origin']&&this['_currentReviewCheckRun']['deactivateChange']();}['_onChangeMarkerClicked'](_0x53d8ca,_0x26730c){if(!this['_currentReviewCheckRun'])return;this['_changeActivationSource']='content',this['_currentReviewCheckRun']['activateChange'](_0x26730c['changeId']);const _0x3bd8d3=this['_currentReviewCheckRun']['getChangeById'](_0x26730c['changeId']);if(!_0x3bd8d3)return;const _0x103eb0=this['_aiReviewCoreEditing']['getEditor']();this['_aiReviewCoreUi']['showChangeBalloon'](_0x3bd8d3,_0x26730c['markerElement'],_0x26730c['domEvent'],'click',_0x103eb0?.['editing']?.['view']?.['getDomRoot'](),_0x103eb0?.['ui']?.['viewportOffset']);}['_onChangeMarkerHovered'](_0x863d86,_0x56551e){if(!this['_currentReviewCheckRun'])return;if(this['_currentReviewCheckRun']['isAnyChangeActivated']())return;const _0xb6e172=this['_currentReviewCheckRun']['getChangeById'](_0x56551e['changeId']);if(!_0xb6e172)return;const _0x2d37a3=this['_aiReviewCoreEditing']['getEditor']();this['_aiReviewCoreUi']['showChangeBalloon'](_0xb6e172,_0x56551e['markerElement'],_0x56551e['domEvent'],'hover',_0x2d37a3?.['editing']?.['view']?.['getDomRoot'](),_0x2d37a3?.['ui']?.['viewportOffset']);}['_onChangeMarkerBlurred'](){if(!this['_currentReviewCheckRun'])return;this['_currentReviewCheckRun']['isAnyChangeActivated']()||this['_aiReviewCoreUi']['hideChangeBalloon']();}['_getChangeContentElement'](_0x4297fc){const _0x2eb6ac=this['_aiReviewCoreEditing']['getMarkerElementForChange'](_0x4297fc);return _0x2eb6ac?_0x2eb6ac['getElement']():null;}['_markChangePositionInEditorContent'](_0x234b5d,_0x4fb2d5){this['_aiReviewCoreEditing']['markChangePositionInEditorContent'](_0x234b5d,_0x4fb2d5);}['_diffContent'](_0x52d22b,_0x15979a){return this['_aiReviewCoreEditing']['diffContent'](_0x52d22b,_0x15979a);}['_onReviewCheckRun'](){this['_onDiffChange'](this['_isDiffOn']);}['_onDiffChange'](_0x16dbbf){const _0x312104=this['_aiReviewCoreEditing']['getEditor']();_0x16dbbf?this['_aiReviewCoreUi']['hideDiffInBalloon']():this['_aiReviewCoreUi']['showDiffInBalloon'](),_0x312104&&_0x312104['editing']['view']['change'](_0x14801d=>{const _0x5f19d6=_0x312104['editing']['view']['document']['getRoot']();for(const _0x58783a of _0x5f19d6['getClassNames']())_0x58783a['startsWith']('ck-ai_review-')&&_0x14801d['removeClass'](_0x58783a,_0x5f19d6);_0x14801d['addClass'](_0x16dbbf?'ck-ai_review-diff':'ck-ai_review-highlights',_0x5f19d6);});}async['_getChecksList'](){const _0x20cf7a=[...Co,...this['_getExtraChecks']()],_0xf2839b=this['context']['config']['get']('ai.review.availableCommands')||[];this['_logErrorForNonExistentChecks'](_0xf2839b,_0x20cf7a);let _0x594f0c=_0x20cf7a;this['_hasDefaultAvailableCommands']||(_0x594f0c=_0xf2839b['map'](_0x49b5ff=>_0x20cf7a['find'](_0x4bfb25=>_0x4bfb25['id']===_0x49b5ff))['filter'](_0x1fd3ce=>!!_0x1fd3ce)),_0x594f0c=_0x594f0c['map'](_0x4ea9c6=>_0x4ea9c6['isExtra']?_0x4ea9c6:this['_translateReviewCheck'](_0x4ea9c6));const _0x1426d3=_0x594f0c['some'](_0x110458=>_0x110458['isExtra']||'custom'===_0x110458['id']);let _0x7bb202=[],_0x48d82a=[],_0x54ef50=null;if(_0x1426d3){const _0x550de4=await this['_getModels']();_0x7bb202=_0x550de4['all'],_0x48d82a=_0x550de4['recommended'],_0x54ef50=_0x550de4['default'];}const _0x2efbb0=new Ro(_0x7bb202,_0x48d82a,_0x54ef50);return _0x2efbb0['setupChecks'](_0x594f0c),_0x1426d3&&this['_filterChecksWithMissingModel'](_0x2efbb0),_0x2efbb0;}['_getExtraChecks'](){return(this['context']['config']['get']('ai.review.extraCommands')||[])['map'](_0x448e50=>({'id':_0x448e50['id'],'commandId':_0x448e50['id'],'title':_0x448e50['label'],'description':_0x448e50['description'],'isParameterized':!0x1,'isExtra':!0x0,'prompt':_0x448e50['prompt'],'model':_0x448e50['model']}));}['_logErrorForNonExistentChecks'](_0x4874e4,_0x496211){const _0x318856=_0x4874e4['filter'](_0x29bd42=>!_0x496211['some'](_0xc6ed2=>_0xc6ed2['id']===_0x29bd42));_0x318856['length']&&this['_logError'](new ot('ai-review-mode-non-existent-commands-used',this,{'commandIds':_0x318856['join'](',\x20')}),!0x0);}async['_getModels'](){try{const _0x288365=new Bs({'connector':this['_aiConnector'],'config':this['context']['config']['get']('ai.models'),'locale':this['context']['locale']});return{'all':await _0x288365['getAll'](),'recommended':await _0x288365['getAvailableModels'](),'default':await _0x288365['getDefault']()};}catch(_0x3c4bf7){return this['_logError'](new ot('ai-review-mode-models-unable-to-retrieve',this,void 0x0,_0x3c4bf7)),{'all':[],'recommended':[],'default':null};}}['_translateReviewCheck'](_0x3318b0){const _0x5503ee='AI_REVIEW_CHECK_'+_0x3318b0['id']['toUpperCase']()['replaceAll']('-','_'),_0x514e5c={..._0x3318b0,'title':this['_getTranslationWithDefault'](_0x5503ee+'_TITLE',_0x3318b0['title']),'description':this['_getTranslationWithDefault'](_0x5503ee+'_DESCRIPTION',_0x3318b0['description'])};return _0x3318b0['options']&&(_0x514e5c['options']=_0x3318b0['options']['map'](_0x38661a=>({..._0x38661a,'label':this['_getTranslationWithDefault'](_0x5503ee+'_OPTIONS_LABEL',_0x38661a['label']||''),'data':_0x38661a['data']?_0x38661a['data']['map'](_0x5970ce=>({..._0x5970ce,'label':this['_getTranslationWithDefault'](_0x5503ee+'_OPTIONS_DATA_'+_0x5970ce['id']['toUpperCase'](),_0x5970ce['label'])})):void 0x0}))),_0x514e5c;}['_filterChecksWithMissingModel'](_0x3e8bcc){const _0x2f95b7=[];_0x3e8bcc['checks']['forEach'](_0x2b898d=>{(_0x2b898d instanceof bo&&!_0x2b898d['defaultModel']||_0x2b898d instanceof So&&!_0x2b898d['models']['length'])&&_0x2f95b7['push'](_0x2b898d['id']);}),_0x2f95b7['length']&&_0x2f95b7['forEach'](_0x4a4cc3=>{_0x3e8bcc['removeCheckById'](_0x4a4cc3),this['_logError'](new ot('ai-review-mode-command-unavailable-due-to-missing-model',this,{'commandId':_0x4a4cc3}),!0x0);});}}class vo extends _0x333531{static get['requires'](){return[No,_o,go];}static get['pluginName'](){return'AIReviewMode';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class yo extends wo{get['apiId'](){return'translate';}}class xo extends fo{['setupChecks'](_0x479fa5){this['_checks']=_0x479fa5['map'](_0x382d5b=>new yo(_0x382d5b));}}class Lo extends po{['_title'];constructor(_0x93d8fa,_0x381622,_0x306cb2,_0x35b562,_0x3638d9,_0x2e93d6){super(_0x93d8fa,_0x381622,_0x306cb2,_0x3638d9,_0x2e93d6),this['_title']=_0x35b562;}get['title'](){return this['_title'];}get['subTitle'](){return this['_sourceCheck']['title'];}}class Do extends mo{static get['pluginName'](){return'AITranslateController';}constructor(_0x2a1dca){super(_0x2a1dca),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'](_0x21e77e,_0xe8719a){return new Lo(this['_aiReviewCoreEditing']['getDocumentData'](),_0xe8719a,this['_aiConnector'],as(this['context']['locale'],'AI_REVIEW_CHECK_TRANSLATE_TITLE'),_0x21e77e['params'],_0x21e77e['args']);}['_onReviewCheckResultActivated'](_0x3f63af){this['_aiReviewCoreUi']['setActiveStateInResults'](_0x3f63af['change']['id']),this['_aiReviewCoreEditing']['setMarkersInElementAsActive'](_0x3f63af['change']['id']);}['_onReviewCheckResultDeactivated'](){this['_aiReviewCoreEditing']['setAllMarkersAsInactive'](),this['_aiReviewCoreUi']['resetActiveStateInResults']();}['_onActivateChange'](_0x1e0941){this['_currentReviewCheckRun']&&('hover'===_0x1e0941['uiInteraction']&&(this['_changeActivationSource']='panel',this['_currentReviewCheckRun']['activateChange'](_0x1e0941['id'])),'click'===_0x1e0941['uiInteraction']&&this['_scrollToChange'](_0x1e0941['id']));}['_onDeactivateChange'](_0x5a9283){this['_currentReviewCheckRun']&&'panel'===_0x5a9283['origin']&&this['_currentReviewCheckRun']['deactivateChange']();}['_onChangeMarkerClicked'](_0x5bdfb9,_0x166f1f){this['_currentReviewCheckRun']&&(this['_changeActivationSource']='content',this['_currentReviewCheckRun']['activateChange'](_0x166f1f['changeId']),this['_scrollToChange'](_0x166f1f['changeId']));}['_onChangeMarkerHovered'](_0x46f1e3,_0x506c0c){this['_currentReviewCheckRun']&&(this['_changeActivationSource']='content',this['_currentReviewCheckRun']['activateChange'](_0x506c0c['changeId']),this['_aiReviewCoreEditing']['reactivateMarkers'](_0x506c0c['changeId']));}['_onChangeMarkerBlurred'](){this['_currentReviewCheckRun']&&'content'===this['_changeActivationSource']&&(this['_currentReviewCheckRun']['deactivateChange'](),this['_aiReviewCoreEditing']['setAllMarkersAsInactive']());}['_getChangeContentElement'](_0x2a0d46){return this['_aiReviewCoreEditing']['getContentElementForChange'](_0x2a0d46);}['_markChangePositionInEditorContent'](_0x14172a,_0x54ff12){this['_aiReviewCoreEditing']['markChangePositionInEditorContent'](_0x14172a,_0x54ff12);}['_diffContent'](_0x18e7c0,_0x1c77e1){return this['_aiReviewCoreEditing']['diffContent'](_0x18e7c0,_0x1c77e1,!0x0);}['_onReviewCheckRun'](){const _0x4631d0=this['_aiReviewCoreEditing']['getEditor']();_0x4631d0&&_0x4631d0['editing']['view']['change'](_0x39a70c=>{const _0x276361=_0x4631d0['editing']['view']['document']['getRoot']();for(const _0x3ffc36 of _0x276361['getClassNames']())(_0x3ffc36['startsWith']('ck-ai-review-')||'ck-ai-translate-'===_0x3ffc36)&&_0x39a70c['removeClass'](_0x3ffc36,_0x276361);_0x39a70c['addClass']('ck-ai-translate-mode-content',_0x276361);});}async['_getChecksList'](){const _0x58c2c3=[],_0x52bb4f=this['context']['config']['get']('ai.translate.languages')||[];for(const _0x2261ac of _0x52bb4f)_0x58c2c3['push']({'title':_0x2261ac['label'],'id':_0x2261ac['id'],'commandId':_0x2261ac['id'],'description':'','isParameterized':!0x1,'useArgs':!0x0,'args':{'language':_0x2261ac['id']}});const _0x29241a=new xo();return _0x29241a['setupChecks'](this['_translateChecks'](_0x58c2c3)),_0x29241a;}['_translateChecks'](_0x31d9f6){return _0x31d9f6['map'](_0x386552=>{const _0x16a4c3='AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_'+_0x386552['title']['toUpperCase']()['replaceAll']('-','_');return{..._0x386552,'title':this['_getTranslationWithDefault'](_0x16a4c3,_0x386552['title'])};});}}class Po extends io{constructor(_0x494411,_0x19e3e1){super(_0x494411,_0x19e3e1),this['on']('set:isLoading',(_0x24cb64,_0x329402,_0x3de12c)=>{_0x3de12c&&(this['headerTitle']=as(this['locale'],'AI_TRANSLATE_CHECK_RESULTS_LOADING_TITLE'));}),this['on']('set:isResultReady',(_0x4542e8,_0x121ec4,_0x1a9ffd)=>{_0x1a9ffd&&(this['headerTitle']=as(this['locale'],'AI_TRANSLATE_CHECK_RESULTS_READY_TITLE'));});}['_createAcceptAllButtonView'](){const _0x84dc1a=super['_createAcceptAllButtonView']();return _0x84dc1a['set']('label',as(this['locale'],'AI_TRANSLATE_ACCEPT_ALL')),_0x84dc1a;}['_createExitReviewButtonView'](){const _0x23ef0c=super['_createExitReviewButtonView']();return _0x23ef0c['set']('label',as(this['locale'],'AI_CHAT_HISTORY_CANCEL')),_0x23ef0c;}}class Ho extends uo{['_setupTemplate'](){const _0x19d613=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-translate__check-list-wrapper',_0x19d613['if']('isVisible','ck-hidden',_0x5dcd7c=>!_0x5dcd7c)]},'children':[{'tag':'div','attributes':{'class':['ck-ai-translate__check-list-header']},'children':[{'tag':'h2','children':[{'text':as(this['locale'],'AI_TRANSLATE_CHECK_LIST_HEADER_TITLE')}]},{'tag':'p','children':[{'text':as(this['locale'],'AI_TRANSLATE_CHECK_LIST_HEADER_DESCRIPTION')}]}]},{'tag':'div','attributes':{'class':['ck-ai_review__check-list',_0x19d613['if']('isVisible','ck-hidden',_0x4f5ef8=>!_0x4f5ef8)]},'children':this['_checkViews']}]});}}class Mo extends Ja{static get['pluginName'](){return'AITranslateUI';}['createMainView'](){const _0x4b0bc4=this['context']['locale'],_0x1da65c=new _0x3b6a7d(_0x4b0bc4,{'label':as(_0x4b0bc4,'AI_REVIEW_CHECK_TRANSLATE_TITLE'),'icon':_0x20525b,'class':'ck-ai-header\x20ck-ai-header_review-translate'}),_0x2819e4=new to(_0x4b0bc4,{'header':_0x1da65c,'list':new Ho(_0x4b0bc4),'results':new Po(_0x4b0bc4,{'generalErrorText':as(_0x4b0bc4,'AI_TRANSLATE_GENERAL_ERROR_MESSAGE')}),'completed':new so(_0x4b0bc4,{'headerText':as(_0x4b0bc4,'AI_TRANSLATE_FINISH_HEADER_TITLE'),'emptyResultsText':as(_0x4b0bc4,'AI_TRANSLATE_EMPTY_RESULTS_TEXT'),'buttonText':as(_0x4b0bc4,'AI_TRANSLATE_FINISH_BUTTON_LABEL')})});return _0x2819e4['extendTemplate']({'attributes':{'class':'ck-ai-translate-mode'}}),_0x2819e4;}['registerTab'](){const _0x36a500=this['context']['plugins']['get']('AITabs');_0x36a500['view']['on']('activateTab',(_0x475ed4,_0x1a8346)=>{'translate'===_0x1a8346?this['fire']('getReviewCheckList'):this['fire']('leaveReview');}),_0x36a500['view']['addTab']({'id':'translate','buttonLabel':as(this['context']['locale'],'AI_REVIEW_CHECK_TRANSLATE_TITLE'),'buttonIcon':_0x20525b,'order':0x0,'content':this['_mainView']});}}class Uo extends _0x333531{static get['requires'](){return[Do,Mo,go];}static get['pluginName'](){return'AITranslate';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}export{qa as AIActions,Si as AIAdapter,qi as AIAssistant,Wi as AIAssistantUI,ma as AIBalloon,la as AIChat,Ys as AIChatController,ca as AIChatHistory,ha as AIChatHistoryController,ra as AIChatHistoryUI,Aa as AIChatShortcuts,Zr as AIChatUI,rs as AIConnector,qs as AIEditing,ba as AIEditorIntegration,Qa as AIQuickActions,Ma as AIQuickActionsUI,bi as AIRequestError,wo as AIReviewCheck,Io as AIReviewCheckResult,To as AIReviewCheckRun,vo as AIReviewMode,mo as AIReviewModeController,go as AIReviewModeEditing,_o as AIReviewModeUI,ns as AITabs,Xi as AITextAdapter,Ia as AIToggleButtonUI,Uo as AITranslate,Do as AITranslateController,Mo as AITranslateUI,ji as AWSTextAdapter,zi as OpenAITextAdapter,Oi as ShowAIAssistantCommand,ga as ToggleAICommand,ls as createResizeButton,Qi as getDefaultAICommands};
|