@ckeditor/ckeditor5-ai 47.4.0-alpha.3 → 47.4.0-alpha.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/ai.js +1 -1
- package/dist/index.js +5 -5
- 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 +15 -15
- package/src/aiactions/aiactions.js +1 -1
- package/src/aiactions/model/aiactionsinteraction.js +1 -1
- package/src/aiactions/model/aiactionsreply.js +1 -1
- package/src/aiassistant/adapters/aiadapter.js +1 -1
- package/src/aiassistant/adapters/aitextadapter.js +1 -1
- package/src/aiassistant/adapters/awstextadapter.js +1 -1
- package/src/aiassistant/adapters/openaitextadapter.js +1 -1
- package/src/aiassistant/aiassistant.js +1 -1
- package/src/aiassistant/aiassistantediting.js +1 -1
- package/src/aiassistant/aiassistantui.js +1 -1
- package/src/aiassistant/legacyerrors.js +1 -1
- package/src/aiassistant/ui/aiassistantcontroller.js +2 -2
- package/src/aiassistant/ui/form/aiformcontentarea.js +1 -1
- package/src/aiassistant/ui/form/aiformerrorview.js +1 -1
- package/src/aiassistant/ui/form/aiformpromptview.js +1 -1
- package/src/aiassistant/ui/form/aiformtoolbarview.js +1 -1
- package/src/aiassistant/ui/form/aiformview.js +1 -1
- package/src/aiassistant/ui/form/aihistorylistitemview.js +1 -1
- package/src/aiassistant/ui/form/aihistorylistview.js +1 -1
- package/src/aiassistant/ui/form/prompthistory.js +1 -1
- package/src/aiassistant/ui/showaiassistantcommand.js +1 -1
- package/src/aiassistant/utils/common-translations.js +1 -1
- package/src/aiassistant/utils/normalizecommandsconfig.js +1 -1
- package/src/aiballoon/aiballoon.js +1 -1
- package/src/aiballoon/ui/aiballoondisclaimerview.js +1 -1
- package/src/aiballoon/ui/aiballoontoolbarview.js +1 -1
- package/src/aiballoon/ui/aiballoonview.js +1 -1
- package/src/aichat/aichat.js +1 -1
- package/src/aichat/aichatcontroller.js +1 -1
- package/src/aichat/aichatui.js +1 -1
- package/src/aichat/model/aichatcontext.js +1 -1
- package/src/aichat/model/aichatconversation.js +1 -1
- package/src/aichat/model/aichatinteraction.js +1 -1
- package/src/aichat/ui/aichatcontrolsview.js +1 -1
- package/src/aichat/ui/aichatfeedview.js +1 -1
- package/src/aichat/ui/aichatheaderview.js +1 -1
- package/src/aichat/ui/aichatview.js +1 -1
- package/src/aichat/ui/controls/aichatchipsoverflowmanager.js +1 -1
- package/src/aichat/ui/controls/aichatcontextitembuttonview.js +1 -1
- package/src/aichat/ui/controls/aichatcontextpanelurlinputview.js +1 -1
- package/src/aichat/ui/controls/aichatcontextpanelview.js +1 -1
- package/src/aichat/ui/controls/aichatcontrolsloaderview.js +1 -1
- package/src/aichat/ui/controls/aichatpromptcapabilitiesview.js +1 -1
- package/src/aichat/ui/controls/aichatpromptinputview.js +1 -1
- package/src/aichat/ui/controls/aichatpromptsuggestionslistview.js +1 -1
- package/src/aichat/ui/controls/resources/aichatcontextresourceslistview.js +1 -1
- package/src/aichat/ui/controls/resources/aichatcontextresourcesview.js +1 -1
- package/src/aichat/ui/controls/resources/aichatresourcelistitemview.js +1 -1
- package/src/aichat/ui/controls/resources/aichatresourcesballoonview.js +1 -1
- package/src/aichat/ui/controls/resources/aichatresourcessearchinputview.js +1 -1
- package/src/aichat/ui/feed/aichatfeedcontextchipsview.js +1 -1
- package/src/aichat/ui/feed/aichatfeederroritemview.js +1 -1
- package/src/aichat/ui/feed/aichatfeedinteractionheaderview.js +1 -1
- package/src/aichat/ui/feed/aichatfeeditemview.js +1 -1
- package/src/aichat/ui/feed/aichatfeedreplyitemview.js +1 -1
- package/src/aichat/ui/feed/aichatfeedsuggestionitemactionsview.js +1 -1
- package/src/aichat/ui/feed/aichatfeedsuggestionitemview.js +1 -1
- package/src/aichat/ui/feed/aichatfeedusermessageitem.js +1 -1
- package/src/aichat/utils/eventnames.js +1 -1
- package/src/aichat/utils/promisequeue.js +1 -1
- package/src/aichathistory/aichathistory.js +1 -1
- package/src/aichathistory/aichathistorycontroller.js +1 -1
- package/src/aichathistory/aichathistoryui.js +1 -1
- package/src/aichathistory/model/aichathistoryconversations.js +1 -1
- package/src/aichathistory/model/aichathistoryitem.js +1 -1
- package/src/aichathistory/ui/aichathistorylistitemview.js +2 -2
- package/src/aichathistory/ui/aichathistorylistview.js +1 -1
- package/src/aichathistory/ui/aichathistorysectionlistview.js +1 -1
- package/src/aichathistory/ui/aichathistoryview.js +1 -1
- package/src/aicore/aiconnector.js +1 -1
- package/src/aicore/aiediting.js +1 -1
- package/src/aicore/model/aicapabilities.js +1 -1
- package/src/aicore/model/aicontext.js +1 -1
- package/src/aicore/model/aiinteraction.js +1 -1
- package/src/aicore/model/aimodels.js +1 -1
- package/src/aicore/model/aireply.js +1 -1
- package/src/aicore/pipeline/airesponseapplier.js +2 -2
- package/src/aicore/pipeline/airesponseparser.js +2 -2
- package/src/aicore/ui/aidisclaimerview.js +1 -1
- package/src/aicore/ui/aiskeleton.js +1 -1
- package/src/aicore/ui/aispinner.js +1 -1
- package/src/aicore/ui/suggestioncontainer/aiminitoolbarview.js +1 -1
- package/src/aicore/ui/suggestioncontainer/aisuggestionbodyview.js +1 -1
- package/src/aicore/ui/suggestioncontainer/aisuggestioncontainerview.js +1 -1
- package/src/aicore/ui/suggestioncontainer/aisuggestioncontentpartview.js +1 -1
- package/src/aicore/ui/suggestioncontainer/aisuggestionheaderview.js +1 -1
- package/src/aicore/utils/common-translations.js +1 -1
- package/src/aicore/utils/createresizebutton.js +1 -1
- package/src/aicore/utils/documentposition.js +1 -1
- package/src/aicore/utils/documentrange.js +1 -1
- package/src/aicore/utils/eventnames.js +1 -1
- package/src/aicore/utils/geteditorfromcontext.js +1 -1
- package/src/aicore/utils/getoperationsfromreply.js +1 -1
- package/src/aicore/utils/getsuggestionpartsfromreply.js +1 -1
- package/src/aicore/utils/htmlparser.js +1 -1
- package/src/aicore/utils/htmlstreamer.js +1 -1
- package/src/aicore/utils/scrollmanager.js +1 -1
- package/src/aieditorintegration/aieditorintegration.js +1 -1
- package/src/aieditorintegration/aitogglebutton/aitogglebuttonui.js +1 -1
- package/src/aieditorintegration/aitogglebutton/toggleaicommand.js +1 -1
- package/src/aiquickactions/aiquickactions.js +1 -1
- package/src/aiquickactions/aiquickactionscommand.js +1 -1
- package/src/aiquickactions/aiquickactionsediting.js +1 -1
- package/src/aiquickactions/aiquickactionsui.js +1 -1
- package/src/aiquickactions/ui/aiquickactionsbuttoncreator.js +1 -1
- package/src/aiquickactions/ui/aiquickactionsdropdowncontentview.js +1 -1
- package/src/aiquickactions/ui/aiquickactionsdropdowncreator.js +1 -1
- package/src/aiquickactions/ui/aiquickactionsfilteredlistview.js +1 -1
- package/src/aiquickactions/ui/dropdownmenubuttonwithhighlightview.js +1 -1
- package/src/aireviewmode/aireviewcheckdefinitions.js +1 -1
- package/src/aireviewmode/aireviewmode.js +1 -1
- package/src/aireviewmode/aireviewmodecontroller.js +1 -1
- package/src/aireviewmode/aireviewmodeediting.js +1 -1
- package/src/aireviewmode/aireviewmodeui.js +1 -1
- package/src/aireviewmode/model/aireviewcheck.js +1 -1
- package/src/aireviewmode/model/aireviewcheckcustom.js +1 -1
- package/src/aireviewmode/model/aireviewchecklist.js +1 -1
- package/src/aireviewmode/model/aireviewcheckresult.js +1 -1
- package/src/aireviewmode/model/aireviewcheckresultchange.js +1 -1
- package/src/aireviewmode/model/aireviewcheckrun.js +1 -1
- package/src/aireviewmode/model/aireviewcustomcheckrun.js +1 -1
- package/src/aireviewmode/model/aireviewsystemcheckrun.js +1 -1
- package/src/aireviewmode/ui/aireviemodepromptinputview.js +1 -1
- package/src/aireviewmode/ui/aireviewmodeballoonsuggestionview.js +1 -1
- package/src/aireviewmode/ui/aireviewmodechecklistitemresultview.js +1 -1
- package/src/aireviewmode/ui/aireviewmodecustomcheckview.js +1 -1
- package/src/aireviewmode/ui/aireviewmodefinishreviewbuttonview.js +1 -1
- package/src/aireviewmode/ui/aireviewmodegeneralerrorview.js +1 -1
- package/src/aireviewmode/ui/aireviewmodereviewchecklistview.js +1 -1
- package/src/aireviewmode/ui/aireviewmodereviewcheckresultsview.js +1 -1
- package/src/aireviewmode/ui/aireviewmodereviewcommandlistitemview.js +1 -1
- package/src/aireviewmode/ui/aireviewmodereviewcompletedview.js +1 -1
- package/src/aireviewmode/ui/aireviewmodeview.js +1 -1
- package/src/aireviewmode/ui/form/aireviewmodeformdropdown.js +1 -1
- package/src/aireviewmode/ui/form/aireviewmodeformmanager.js +1 -1
- package/src/aitabs/aitabs.js +1 -1
- package/src/aitabs/aitabsmainview.js +1 -1
- package/src/aitabs/tabs/aitabsview.js +1 -1
- package/src/aitabs/tabs/tabbuttonview.js +1 -1
- package/src/aitabs/tabs/tabpanelview.js +1 -1
- package/src/errors.js +1 -1
- package/src/errorsmap.js +1 -1
- package/src/index.js +1 -1
package/dist/index.js
CHANGED
|
@@ -20,8 +20,8 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
import{Plugin as _0x346ac8,Command as Qt,ContextPlugin as ot,Editor as _t}from'@ckeditor/ckeditor5-core/dist/index.js';import{IconCopy as _0x8c93b,IconCheck as _0x3cb840,IconError as _0x3769b2,IconSubmit as _0x2913f7,IconAIHistory as Ut,IconMagicWand as _0x49e0da,IconRobotPencil as _0x54d69e,IconMaximize as _0x5502eb,IconMinimize as to,IconDocumentWithLoupe as _0x4e4a4d,IconAddComment as _0x5a38fc,IconShowChangesOn as _0x44c63f,IconShowChangesOff as _0x4f3f9b,IconDocument as _0x193d2b,IconThreeStars as _0x2fb154,IconRemove as _0x5472b4,IconDocumentWithCheckmark as _0x411438,IconDocumentWithCross as _0x4b0f8d,IconLoupe as _0x4f50f5,IconCancel as _0x3a96a0,IconStop as _0x171167,IconAIChat as Ht,IconPlus as _0x357a3c,IconPin as _0x39ada3,IconThreeHorizontalDots as _0x16c5df,IconChevronRight as _0x37e1aa,IconInfo as _0x314620,IconOutdated as _0x2f860e,IconEye as _0x3db73e,IconEyeCrossedOut as _0x2bc066,IconAIReview as _0x223d73}from'@ckeditor/ckeditor5-icons/dist/index.js';import{uid as _0xdc126c,CKEditorError as _0x36b126,ObservableMixin as ts,global as lt,isVisible as _0x13140d,Rect as ct,Collection as _0x5137f7,FocusTracker as _0x25d272,KeystrokeHandler as _0xfe6d51,first as _0x165b43,toArray as _0x4a22ae,EmitterMixin as _0x19d98c,logWarning as _0x3219ae,logError as ft,scrollViewportToShowTarget as ht,ResizeObserver as _0x123cdf,_isMotionReduced as Pt,scrollAncestorsToShowTarget as _0x4ff008,getConstrainedViewportRect as _0x114f82,DomEmitterMixin as _0x5b5d27}from'@ckeditor/ckeditor5-utils/dist/index.js';import{ToolbarView as _0x312a64,ButtonView as _0xcbb426,View as _0x43effc,SpinnerView as _0x5da037,IconView as _0x4caa0b,AutocompleteView as _0x53698e,ListView as _0x5bd1ba,ListItemGroupView as _0x5230c7,ListItemView as _0x3f0116,ButtonLabelView as _0x43f368,FocusCycler as _0x4b849d,createLabeledTextarea as _0x49d9f6,Dialog as _0xe646c5,createDropdown as _0x2e287a,addMenuToDropdown as _0x10a136,MenuBarMenuView as _0x44a9af,MenuBarMenuListItemButtonView as _0x3ce5a8,DialogViewPosition as _0x54d5b5,MenuBarMenuListView as _0x32dd81,MenuBarMenuListItemView as _0x53ce29,UIModel as _0x3344bf,SplitButtonView as _0x25f6a8,BalloonPanelView as _0x2ae23a,BodyCollection as _0x44dc72,clickOutsideHandler as _0x4b855c,ListItemButtonView as _0x2ab14c,ViewCollection as _0x317ee8,addListToDropdown as _0x44b9be,submitHandler as _0x27e72b,LabeledFieldView as _0x454e15,createLabeledInputText as _0x42b133,FormHeaderView as _0xbcda8a,HighlightedTextView as _0x407d13,FileDialogButtonView as _0x486231,InputTextView as _0xa4bda4,SearchTextView as _0x1f1a68,ButtonLabelWithHighlightView as _0xa65920,DropdownMenuPanelPositioningFunctions as _0x3686ba,BalloonToolbar as _0x5a3ac9,FormRowView as _0x2eaca7,TextareaView as _0x19a367}from'@ckeditor/ckeditor5-ui/dist/index.js';import{ClipboardPipeline as _0x210076,ClipboardMarkersUtils as _0x500258}from'@ckeditor/ckeditor5-clipboard/dist/index.js';import{ViewDocumentDomEventData as _0x407c9a,ViewDataTransfer as _0x13d2e1,ViewUpcastWriter as _0x5b43a2,Matcher as _0xa40f65,_DetachOperation as it,_insertIntoModelNodeList as _0xf35697,_removeFromModelNodeList as _0x2f772f,ModelRange as _0x1026dd,ViewDowncastWriter as Ft,transformOperationSets as st,ModelDocumentFragment as _0x490745,ModelPosition as tt,ModelTreeWalker as _0x467163,InsertOperation as _0x55f538,MarkerOperation as _0x22c2d1}from'@ckeditor/ckeditor5-engine/dist/index.js';import{unescape as _0x5d07f8,escape as _0x469020,escapeRegExp as _0x54c692,debounce as _0x51d0da}from'es-toolkit/compat';import{BedrockRuntimeClient as _0x3bdc8d,InvokeModelWithResponseStreamCommand as _0x26e8c7,InvokeModelCommand as _0x62d133}from'@aws-sdk/client-bedrock-runtime';import{createParser as $t}from'eventsource-parser';import{parseDocument as _0x3254d4}from'htmlparser2';import{isTag as _0x499346,findOne as St,getParent as _0x5d775c,findAll as _0x4a6dcc,removeElement as _0x1b183f,replaceElement as _0x46b47c,prepend as _0x4c7871,prependChild as _0x377b76,appendChild as _0x19757f,append as _0x2301a3,find as _0x2e7bf0,isComment as _0x543d27,getChildren as _0x2bc64a,textContent as _0x1f24f8}from'domutils';import _0x4b71ff from'dom-serializer';import{Document as Rt,Element as _0xec973e,Text as _0x4e1833,cloneNode as _0xdcae32,isDocument as _0x59f677,isText as _0xa705c,NodeWithChildren as _0x1f4fb6}from'domhandler';import{MarkdownGfmMdToHtml as _0x46b180}from'@ckeditor/ckeditor5-markdown-gfm/dist/index.js';import{fixElementSuggestionRange as _0x7900ef,getAllMarkersDomElementsSorted as rt,DocumentCompare as _0x2dc9e7,DATA_ID_MODEL_ATTRIBUTE as yt,ConfirmMixin as _0x57d898,LateFocusDropdownButtonView as _0x1fb857,DATA_ID_VIEW_ATTRIBUTE as _0x29ff88}from'ckeditor5-collaboration/dist/index.js';import{cloneDeep as _0x26086b}from'es-toolkit';import{IconThumbUp as _0x526026,IconThumbDown as _0xbf231a,IconCopy as _0x2178ff,IconCheck as _0x16fc5d,IconShowChangesOff as _0x24690e,IconShowChangesOn as _0x4c508d,IconWeb as _0x46b22c,IconNextArrow as _0x4309f7,IconPreviousArrow as _0x1420c7,IconAI as Nt,IconClose as _0x516001,IconSelection as _0x498e88,IconFileUpload as _0x18ec8e,IconLink as _0x3ed6af,IconDocument as _0x584f93,IconBulb as _0x279253,IconDocumentOutline as _0x1c2f3f,IconPaperClip as _0x40e1b5,IconBrowseFiles as _0x26357d,IconDropdownArrow as _0x53f601,IconAIAskAI as _0x4e4731,IconAIQuickActions as _0x157b90,IconAIChatCommands as Bt,IconAIImproveWriting as Xt,IconAIContinueWriting as Jt,IconAIGrammarCheck as Vt,IconAIAdjustLength as Kt,IconAIChangeTone as Wt,IconAITranslate as te,IconAIOther as Zt,IconRefresh as _0xdacbe3}from'@ckeditor/ckeditor5-icons/dist/index.js';import _0x34c121 from'morphdom';import{SuggestionsConversion as zt}from'@ckeditor/ckeditor5-collaboration-core/dist/index.js';import{diffArrays as _0xbfd009}from'diff';const x='_ungrouppedCommands';function o(_0x2c4e9c,_0x439502){const _0x12add=(0x0,_0x439502['t'])('Other');return _0x2c4e9c['length']?'groupId'in _0x2c4e9c[0x0]?_0x2c4e9c:[{'groupId':x,'groupLabel':_0x12add,'order':0x1/0x0,'commands':_0x2c4e9c}]:[{'groupId':x,'groupLabel':_0x12add,'order':0x1/0x0,'commands':[]}];}const Wn=globalThis['DataTransfer'],f='ai-ui';class a extends _0x346ac8{static get['pluginName'](){return'AIAssistantEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const {editor:_0x270e6b}=this,_0x51bfb0=['ck-fake-ai-selection'];_0x270e6b['config']['get']('ai.assistant.useTheme')&&_0x51bfb0['push']('ck-ai-assistant-ui_theme'),_0x270e6b['conversion']['for']('editingDowncast')['markerToHighlight']({'model':f,'view':{'classes':_0x51bfb0,'priority':0xc}}),_0x270e6b['conversion']['for']('editingDowncast')['markerToElement']({'model':f,'view':(_0x57be62,{writer:_0x16ae8d})=>{if(!_0x57be62['markerRange']['isCollapsed'])return null;const _0x5b23c7=_0x16ae8d['createUIElement']('span');return _0x16ae8d['addClass'](['ck-fake-ai-selection','ck-fake-ai-selection_collapsed'],_0x5b23c7),_0x5b23c7;}});}['afterInit'](){!async function(_0x2d7956){const _0xf9afc3=_0x796f11([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]),_0x5933cf=0x3dffc4e1,_0x1a9713=0x3df8ba61^_0x5933cf,_0x5490a7=window[_0x796f11([0x44,0x61,0x74,0x65])][_0x796f11([0x6e,0x6f,0x77])](),_0x3b9147=_0x2d7956[_0x796f11([0x65,0x64,0x69,0x74,0x6f,0x72])],_0x5075e5=new window[(_0x796f11([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x12de43=>{_0x3b9147[_0x796f11([0x6f,0x6e,0x63,0x65])](_0x796f11([0x72,0x65,0x61,0x64,0x79]),_0x12de43);}),_0x446134={[_0x796f11([0x6b,0x74,0x79])]:_0x796f11([0x45,0x43]),[_0x796f11([0x75,0x73,0x65])]:_0x796f11([0x73,0x69,0x67]),[_0x796f11([0x63,0x72,0x76])]:_0x796f11([0x50,0x2d,0x32,0x35,0x36]),[_0x796f11([0x78])]:_0x796f11([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]),[_0x796f11([0x79])]:_0x796f11([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]),[_0x796f11([0x61,0x6c,0x67])]:_0x796f11([0x45,0x53,0x32,0x35,0x36])},_0x483298=_0x3b9147[_0x796f11([0x63,0x6f,0x6e,0x66,0x69,0x67])][_0x796f11([0x67,0x65,0x74])](_0x796f11([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79]));async function _0x5ee7a4(){let _0x760a17,_0x24a1c2=null,_0xca1ce1=null;try{if(_0x483298==_0x796f11([0x47,0x50,0x4c]))return _0x796f11([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]);if(_0x760a17=_0x37761a(),!_0x760a17)return _0x796f11([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);return _0x760a17[_0x796f11([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])]&&(_0xca1ce1=_0x5b1e71(_0x760a17[_0x796f11([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])],_0x760a17[_0x796f11([0x6a,0x74,0x69])])),await _0x3cfe6d()?_0x5c2ab0()?_0x1083e8()?_0x796f11([0x45,0x78,0x70,0x69,0x72,0x65,0x64]):_0x165ec6()?(_0x760a17[_0x796f11([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x796f11([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e])&&(_0x24a1c2=_0x1f1df7(_0x796f11([0x45,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e,0x4c,0x69,0x6d,0x69,0x74]))),await _0x1c2c6a()):_0x796f11([0x44,0x6f,0x6d,0x61,0x69,0x6e,0x4c,0x69,0x6d,0x69,0x74]):_0x796f11([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]):_0x796f11([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}catch{return _0x796f11([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}function _0x1083e8(){const _0x542950=[_0x796f11([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e]),_0x796f11([0x74,0x72,0x69,0x61,0x6c])][_0x796f11([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x760a17[_0x796f11([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])])?_0x5490a7/0x3e8:0xe10*_0x1a9713;return _0x760a17[_0x796f11([0x65,0x78,0x70])]<_0x542950;}function _0x5c2ab0(){const _0xf0d5df=_0x760a17[_0x796f11([0x66,0x65,0x61,0x74,0x75,0x72,0x65,0x73])];return!!_0xf0d5df&&(!!_0xf0d5df[_0x796f11([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x796f11([0x2a]))||!!_0xf0d5df[_0x796f11([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x796f11([0x41,0x49])));}function _0x165ec6(){const _0x49a760=_0x760a17[_0x796f11([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x64,0x48,0x6f,0x73,0x74,0x73])];if(!_0x49a760||0x0==_0x49a760[_0x796f11([0x6c,0x65,0x6e,0x67,0x74,0x68])])return!0x0;const {hostname:_0x46c7b8}=new URL(window[_0x796f11([0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e])]['href']);if(_0x49a760[_0x796f11([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x46c7b8))return!0x0;const _0x18d05e=_0x46c7b8[_0x796f11([0x73,0x70,0x6c,0x69,0x74])](_0x796f11([0x2e]));return _0x49a760[_0x796f11([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x25cf89=>_0x25cf89[_0x796f11([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x796f11([0x2a])))[_0x796f11([0x6d,0x61,0x70])](_0x23922e=>_0x23922e[_0x796f11([0x73,0x70,0x6c,0x69,0x74])](_0x796f11([0x2e])))[_0x796f11([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x50ce22=>_0x50ce22[_0x796f11([0x6c,0x65,0x6e,0x67,0x74,0x68])]<=_0x18d05e[_0x796f11([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0x796f11([0x6d,0x61,0x70])](_0x1348a9=>Array(_0x18d05e[_0x796f11([0x6c,0x65,0x6e,0x67,0x74,0x68])]-_0x1348a9[_0x796f11([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0x796f11([0x66,0x69,0x6c,0x6c])](_0x1348a9[0x0]===_0x796f11([0x2a])?_0x796f11([0x2a]):'')[_0x796f11([0x63,0x6f,0x6e,0x63,0x61,0x74])](_0x1348a9))[_0x796f11([0x73,0x6f,0x6d,0x65])](_0xe9b22d=>_0x18d05e[_0x796f11([0x65,0x76,0x65,0x72,0x79])]((_0xeda4dd,_0x4e10a7)=>_0xe9b22d[_0x4e10a7]===_0xeda4dd||_0xe9b22d[_0x4e10a7]===_0x796f11([0x2a])));}function _0x1c2c6a(){return _0x24a1c2&&_0xca1ce1?new window[(_0x796f11([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0xcc65c7,_0xb10702)=>{_0x24a1c2[_0x796f11([0x74,0x68,0x65,0x6e])](_0xcc65c7,_0xb10702),_0xca1ce1[_0x796f11([0x74,0x68,0x65,0x6e])](_0x2baaf1=>{_0x2baaf1!=_0x796f11([0x56,0x61,0x6c,0x69,0x64])&&_0xcc65c7(_0x2baaf1);},_0xb10702);}):_0x24a1c2||_0xca1ce1||_0x796f11([0x56,0x61,0x6c,0x69,0x64]);}}function _0x5b1e71(_0x2937af,_0x390fba){return new window[(_0x796f11([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x2fad52=>{if(_0x25367b())return _0x2fad52(_0x796f11([0x56,0x61,0x6c,0x69,0x64]));_0x2b260a(),_0x3b9147[_0x796f11([0x64,0x65,0x63,0x6f,0x72,0x61,0x74,0x65])](_0x796f11([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]));let _0x9fc533=!0x1;const _0x353920=_0xdc126c();function _0x25a367(_0x1885b1){return!!_0x1885b1&&(typeof _0x1885b1===_0x796f11([0x6f,0x62,0x6a,0x65,0x63,0x74])||typeof _0x1885b1===_0x796f11([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]))&&typeof _0x1885b1[_0x796f11([0x74,0x68,0x65,0x6e])]===_0x796f11([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e])&&typeof _0x1885b1[_0x796f11([0x63,0x61,0x74,0x63,0x68])]===_0x796f11([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]);}function _0x1e0b42(_0x20bc57){_0x20ad41(_0x20bc57)[_0x796f11([0x74,0x68,0x65,0x6e])](_0x22e700=>{if(!_0x22e700||_0x22e700[_0x796f11([0x73,0x74,0x61,0x74,0x75,0x73])]!=_0x796f11([0x6f,0x6b]))return _0x796f11([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]);return _0x255fa5(_0x414269(_0x353920+_0x390fba))!=_0x22e700[_0x796f11([0x76,0x65,0x72,0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6f,0x6e])]?_0x796f11([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]):_0x796f11([0x56,0x61,0x6c,0x69,0x64]);})[_0x796f11([0x74,0x68,0x65,0x6e])](_0x4f402b=>(_0x30d60d(),_0x4f402b),()=>{const _0x2cca0c=_0x4e5696();return null==_0x2cca0c?(_0x30d60d(),_0x796f11([0x56,0x61,0x6c,0x69,0x64])):_0x796f11(_0x5490a7-_0x2cca0c>(0x19f340e1^_0x5933cf)?[0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]:[0x56,0x61,0x6c,0x69,0x64]);})[_0x796f11([0x74,0x68,0x65,0x6e])](_0x2fad52)[_0x796f11([0x63,0x61,0x74,0x63,0x68])](()=>{_0x2fad52(_0x796f11([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});const _0x1cb1a6=0x3dc92a61^_0x5933cf;function _0x30d60d(){const _0x224a23=_0x796f11([0x6c,0x6c,0x63,0x74,0x2d])+_0x255fa5(_0x414269(_0x2937af)),_0x42471d=_0x8cc13f(_0x255fa5(window[_0x796f11([0x4d,0x61,0x74,0x68])][_0x796f11([0x63,0x65,0x69,0x6c])](_0x5490a7/_0x1cb1a6)));window[_0x796f11([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x796f11([0x73,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x224a23,_0x42471d);}function _0x4e5696(){const _0x54b042=_0x796f11([0x6c,0x6c,0x63,0x74,0x2d])+_0x255fa5(_0x414269(_0x2937af)),_0x588242=window[_0x796f11([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x796f11([0x67,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x54b042);return _0x588242?window[_0x796f11([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x8cc13f(_0x588242),0x10)*_0x1cb1a6:null;}function _0x20ad41(_0x429ce7){return new window[(_0x796f11([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x35aeaf,_0x3999c6)=>{_0x429ce7[_0x796f11([0x74,0x68,0x65,0x6e])](_0x35aeaf,_0x3999c6),window[_0x796f11([0x73,0x65,0x74,0x54,0x69,0x6d,0x65,0x6f,0x75,0x74])](_0x3999c6,0x3dfe1021^_0x5933cf);});}}_0x3b9147[_0x796f11([0x6f,0x6e])](_0x796f11([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),(_0x5ca421,_0xf527b7)=>{if(_0xf527b7[0x0]!=_0x2937af)return _0x2fad52(_0x796f11([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));_0xf527b7[0x1]={..._0xf527b7[0x1],[_0x796f11([0x72,0x65,0x71,0x75,0x65,0x73,0x74,0x49,0x64])]:_0x353920};},{[_0x796f11([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x796f11([0x68,0x69,0x67,0x68])}),_0x3b9147[_0x796f11([0x6f,0x6e])](_0x796f11([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),_0x176df6=>{_0x25a367(_0x176df6[_0x796f11([0x72,0x65,0x74,0x75,0x72,0x6e])])&&(_0x9fc533=!0x0,_0x1e0b42(_0x176df6[_0x796f11([0x72,0x65,0x74,0x75,0x72,0x6e])]));},{[_0x796f11([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x796f11([0x6c,0x6f,0x77])}),_0x5075e5[_0x796f11([0x74,0x68,0x65,0x6e])](()=>{_0x9fc533||_0x2fad52(_0x796f11([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});});function _0x25367b(){return _0x3b9147[_0x796f11([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x796f11([0x76,0x69,0x65,0x77])][_0x796f11([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]==_0x796f11([0x61,0x75,0x74,0x6f]);}function _0x2b260a(){_0x3b9147[_0x796f11([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x796f11([0x76,0x69,0x65,0x77])][_0x796f11([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]=_0x796f11([0x61,0x75,0x74,0x6f]);}}function _0x1f1df7(_0x4a822f){const _0x19c63f=[new window[(_0x796f11([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0xec3727=>setTimeout(_0xec3727,0x3df6fa2d^_0x5933cf)),_0x5075e5[_0x796f11([0x74,0x68,0x65,0x6e])](()=>new window[(_0x796f11([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x1c431c=>{let _0x324761=0x0;_0x3b9147[_0x796f11([0x6d,0x6f,0x64,0x65,0x6c])][_0x796f11([0x6f,0x6e])](_0x796f11([0x61,0x70,0x70,0x6c,0x79,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e]),(_0xfbfae0,_0x45f616)=>{_0x45f616[0x0][_0x796f11([0x69,0x73,0x44,0x6f,0x63,0x75,0x6d,0x65,0x6e,0x74,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e])]&&_0x324761++,_0x324761==(0x3dffc109^_0x5933cf)&&(_0x1c431c(),_0xfbfae0[_0x796f11([0x6f,0x66,0x66])]());});}))];return window[_0x796f11([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65])][_0x796f11([0x72,0x61,0x63,0x65])](_0x19c63f)[_0x796f11([0x74,0x68,0x65,0x6e])](()=>_0x4a822f);}async function _0xb81f0c(){await _0x5075e5,_0x3b9147[_0x796f11([0x6d,0x6f,0x64,0x65,0x6c])][_0x796f11([0x63,0x68,0x61,0x6e,0x67,0x65])]=_0x51b2f6,_0x3b9147[_0x796f11([0x6d,0x6f,0x64,0x65,0x6c])][_0x796f11([0x65,0x6e,0x71,0x75,0x65,0x75,0x65,0x43,0x68,0x61,0x6e,0x67,0x65])]=_0x51b2f6,_0x3b9147[_0x796f11([0x65,0x6e,0x61,0x62,0x6c,0x65,0x52,0x65,0x61,0x64,0x4f,0x6e,0x6c,0x79,0x4d,0x6f,0x64,0x65])](_0x796f11([0x6d,0x6f,0x64,0x65,0x6c]));}function _0x16513d(_0x45deec){const _0x3a6d1b=_0x58543d();_0x3b9147[_0x3a6d1b]=_0x796f11([0x61,0x69,0x4c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79])+_0x45deec,_0x45deec!=_0x796f11([0x56,0x61,0x6c,0x69,0x64])&&_0xb81f0c();}function _0x58543d(){const _0x5f4b18=window[_0x796f11([0x53,0x74,0x72,0x69,0x6e,0x67])](window[_0x796f11([0x70,0x65,0x72,0x66,0x6f,0x72,0x6d,0x61,0x6e,0x63,0x65])][_0x796f11([0x6e,0x6f,0x77])]())[_0x796f11([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](_0x796f11([0x2e]),'');let _0x4f9d82=_0x796f11([0x6e]);for(let _0x57bbbf=0x0;_0x57bbbf<_0x5f4b18[_0x796f11([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x57bbbf+=0x2){let _0x5a97d1=window[_0x796f11([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x5f4b18[_0x796f11([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x57bbbf,_0x57bbbf+0x2));_0x5a97d1>=_0xf9afc3[_0x796f11([0x6c,0x65,0x6e,0x67,0x74,0x68])]&&(_0x5a97d1-=_0xf9afc3[_0x796f11([0x6c,0x65,0x6e,0x67,0x74,0x68])]),_0x4f9d82+=_0xf9afc3[_0x5a97d1];}return _0x4f9d82;}function _0x37761a(){const _0x1187b4=_0x483298[_0x796f11([0x73,0x70,0x6c,0x69,0x74])](_0x796f11([0x2e]));if(0x3!=_0x1187b4[_0x796f11([0x6c,0x65,0x6e,0x67,0x74,0x68])])return null;return _0x5278f4(_0x1187b4[0x1]);function _0x5278f4(_0x2c7eea){const _0x57f021=_0x53b221(_0x2c7eea);return _0x57f021&&_0x32f996()?_0x57f021:null;function _0x32f996(){const _0x30b78e=_0x57f021[_0x796f11([0x6a,0x74,0x69])],_0x20b700=window[_0x796f11([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x30b78e[_0x796f11([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x30b78e[_0x796f11([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8),0x10),_0x3bfe6a={..._0x57f021,[_0x796f11([0x6a,0x74,0x69])]:_0x30b78e[_0x796f11([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](0x0,_0x30b78e[_0x796f11([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8)};return delete _0x3bfe6a[_0x796f11([0x76,0x63])],_0x414269(_0x3bfe6a)==_0x20b700;}}}async function _0x3cfe6d(){let _0x450db0=!0x0;try{const _0xa903ba=_0x483298[_0x796f11([0x73,0x70,0x6c,0x69,0x74])](_0x796f11([0x2e])),[_0x485cf5,_0x2fd19e,_0x4ac066]=_0xa903ba;return _0x228290(_0x485cf5),await _0x179192(_0x485cf5,_0x2fd19e,_0x4ac066),_0x450db0;}catch{return!0x1;}function _0x228290(_0x281b2f){const _0x5c5ceb=_0x53b221(_0x281b2f);_0x5c5ceb&&_0x5c5ceb[_0x796f11([0x61,0x6c,0x67])]==_0x796f11([0x45,0x53,0x32,0x35,0x36])||(_0x450db0=!0x1);}async function _0x179192(_0x24585b,_0x7c42ca,_0x4e12c7){const _0x3c350d=window[_0x796f11([0x55,0x69,0x6e,0x74,0x38,0x41,0x72,0x72,0x61,0x79])][_0x796f11([0x66,0x72,0x6f,0x6d])](_0x414260(_0x4e12c7),_0x298589=>_0x298589[_0x796f11([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](0x0)),_0x2d190d=new window[(_0x796f11([0x54,0x65,0x78,0x74,0x45,0x6e,0x63,0x6f,0x64,0x65,0x72]))]()[_0x796f11([0x65,0x6e,0x63,0x6f,0x64,0x65])](_0x24585b+_0x796f11([0x2e])+_0x7c42ca),_0x3d4d2d=window[_0x796f11([0x63,0x72,0x79,0x70,0x74,0x6f])][_0x796f11([0x73,0x75,0x62,0x74,0x6c,0x65])];if(!_0x3d4d2d)return;const _0x3ea799=await _0x3d4d2d[_0x796f11([0x69,0x6d,0x70,0x6f,0x72,0x74,0x4b,0x65,0x79])](_0x796f11([0x6a,0x77,0x6b]),_0x446134,{[_0x796f11([0x6e,0x61,0x6d,0x65])]:_0x796f11([0x45,0x43,0x44,0x53,0x41]),[_0x796f11([0x6e,0x61,0x6d,0x65,0x64,0x43,0x75,0x72,0x76,0x65])]:_0x796f11([0x50,0x2d,0x32,0x35,0x36])},!0x1,[_0x796f11([0x76,0x65,0x72,0x69,0x66,0x79])]);await _0x3d4d2d[_0x796f11([0x76,0x65,0x72,0x69,0x66,0x79])]({[_0x796f11([0x6e,0x61,0x6d,0x65])]:_0x796f11([0x45,0x43,0x44,0x53,0x41]),[_0x796f11([0x68,0x61,0x73,0x68])]:{[_0x796f11([0x6e,0x61,0x6d,0x65])]:_0x796f11([0x53,0x48,0x41,0x2d,0x32,0x35,0x36])}},_0x3ea799,_0x3c350d,_0x2d190d)||(_0x450db0=!0x1);}}function _0x53b221(_0x3f9fc0){return _0x3f9fc0[_0x796f11([0x73,0x74,0x61,0x72,0x74,0x73,0x57,0x69,0x74,0x68])](_0x796f11([0x65,0x79]))?JSON[_0x796f11([0x70,0x61,0x72,0x73,0x65])](_0x414260(_0x3f9fc0)):null;}function _0x414260(_0x18df01){return window[_0x796f11([0x61,0x74,0x6f,0x62])](_0x18df01[_0x796f11([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/-/g,_0x796f11([0x2b]))[_0x796f11([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/_/g,_0x796f11([0x2f])));}function _0x414269(_0x4652b4){let _0x262500=0x1505;function _0x518c11(_0x9a3c1f){for(let _0xacbd4e=0x0;_0xacbd4e<_0x9a3c1f[_0x796f11([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0xacbd4e++){const _0x1e8dde=_0x9a3c1f[_0x796f11([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](_0xacbd4e);_0x262500=(_0x262500<<0x5)+_0x262500+_0x1e8dde,_0x262500&=_0x262500;}}function _0x200275(_0x4b8872){Array[_0x796f11([0x69,0x73,0x41,0x72,0x72,0x61,0x79])](_0x4b8872)?_0x4b8872[_0x796f11([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](_0x200275):_0x4b8872&&typeof _0x4b8872==_0x796f11([0x6f,0x62,0x6a,0x65,0x63,0x74])?Object[_0x796f11([0x65,0x6e,0x74,0x72,0x69,0x65,0x73])](_0x4b8872)[_0x796f11([0x73,0x6f,0x72,0x74])]()[_0x796f11([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](([_0x31299f,_0x5651f0])=>{_0x518c11(_0x31299f),_0x200275(_0x5651f0);}):_0x518c11(window[_0x796f11([0x53,0x74,0x72,0x69,0x6e,0x67])](_0x4b8872));}return _0x200275(_0x4652b4),_0x262500>>>0x0;}function _0x255fa5(_0x54b1a1){return _0x54b1a1[_0x796f11([0x74,0x6f,0x53,0x74,0x72,0x69,0x6e,0x67])](0x10)[_0x796f11([0x70,0x61,0x64,0x53,0x74,0x61,0x72,0x74])](0x8,_0x796f11([0x30]));}function _0x8cc13f(_0x41f523){return _0x41f523[_0x796f11([0x73,0x70,0x6c,0x69,0x74])]('')[_0x796f11([0x72,0x65,0x76,0x65,0x72,0x73,0x65])]()[_0x796f11([0x6a,0x6f,0x69,0x6e])]('');}function _0x51b2f6(){}function _0x796f11(_0x4748d6){return _0x4748d6['map'](_0x92c42f=>String['fromCharCode'](_0x92c42f))['join']('');}_0x16513d(await _0x5ee7a4());}(this);}['showFakeVisualSelection'](){const _0x157171=this['editor']['model'];_0x157171['change'](_0x2d07c2=>{const _0x495311=_0x157171['document']['selection']['getRanges']();let _0x1aeae7=0x0;for(const _0x3d1ce4 of _0x495311){const _0x3d6977=f+':'+_0x1aeae7;if(_0x157171['markers']['has'](_0x3d6977))_0x2d07c2['updateMarker'](_0x3d6977,{'range':_0x3d1ce4});else{if(_0x3d1ce4['start']['isAtEnd']){const _0x110928=_0x3d1ce4['start']['getLastMatchingPosition'](({item:_0x11fe18})=>!_0x157171['schema']['isContent'](_0x11fe18),{'boundaries':_0x3d1ce4});_0x2d07c2['addMarker'](_0x3d6977,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x2d07c2['createRange'](_0x110928,_0x3d1ce4['end'])});}else _0x2d07c2['addMarker'](_0x3d6977,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x3d1ce4});}_0x1aeae7++;}});}['hideFakeVisualSelection'](){const _0x3a5fa4=this['editor']['model'],_0x558890=Array['from'](this['editor']['model']['markers']['getMarkersGroup'](f));_0x558890['length']&&_0x3a5fa4['change'](_0x39d4ae=>{_0x558890['forEach'](_0x293462=>{_0x39d4ae['removeMarker'](_0x293462);});});}['insertContent'](_0x2fc77a,_0x40dae7){const _0x408064=this['_getAISelection'](),_0x3356c9=_0x40dae7||_0x408064['getFirstRange']();this['editor']['model']['canEditAt'](_0x3356c9)&&this['editor']['model']['change'](_0x530f9f=>{this['hideFakeVisualSelection'](),_0x40dae7||this['_resetContentOfSelectedTableCells'](_0x530f9f,_0x408064),this['_pasteHTMLUsingClipboard']({'insertAt':_0x3356c9,'writer':_0x530f9f,'html':_0x2fc77a});});}['insertContentBelow'](_0x46f758){const {model:_0x2654b3}=this['editor'],_0x2f6677=this['_getAISelection']();_0x2654b3['change'](()=>{const _0x50bfb3=this['_prepareTableInsertBelowPosition'](_0x46f758,_0x2f6677)||this['_getDefaultInsertBelowPosition'](_0x2f6677);this['insertContent'](_0x46f758,_0x50bfb3);});}['_getAISelection'](){const _0x2dfb4c=this['editor']['model'],_0x368d20=Array['from'](_0x2dfb4c['markers']['getMarkersGroup'](f))['map'](_0x3946b1=>_0x3946b1['getRange']());return _0x2dfb4c['createSelection'](_0x368d20);}['_pasteHTMLUsingClipboard']({writer:_0x47441a,html:_0x44cbb3,insertAt:_0x46bdd8}){const {view:_0x3a44b3}=this['editor']['editing'],_0x1c3bc4=this['editor']['plugins']['get'](_0x210076),_0x4a1ecc=new Wn();_0x4a1ecc['setData']('text/html',_0x44cbb3);const _0x1f448c=new ClipboardEvent('paste',{'clipboardData':_0x4a1ecc}),_0x12817e=new _0x407c9a(_0x3a44b3,_0x1f448c,{'dataTransfer':new _0x13d2e1(_0x4a1ecc)});_0x47441a['setSelection'](_0x46bdd8);const _0x453bd4=(_0x43a8b6,_0x122cab)=>{_0x122cab['resultRange']&&_0x47441a['setSelection'](_0x122cab['resultRange']);};_0x1c3bc4['once']('contentInsertion',_0x453bd4,{'priority':'lowest'}),_0x3a44b3['document']['fire']('paste',_0x12817e),_0x1c3bc4['off']('contentInsertion',_0x453bd4);}['_getDefaultInsertBelowPosition'](_0x413150){const {model:_0x201f0f}=this['editor'],_0x7d185d=Array['from'](_0x413150['getSelectedBlocks']());return _0x7d185d['length']?_0x201f0f['createPositionAfter'](_0x7d185d['pop']()):_0x413150['getLastPosition']();}['_prepareTableInsertBelowPosition'](_0x34c253,_0x2b4148){const {model:_0x4df1d8,plugins:_0x1f101d}=this['editor'];if(_0x1f101d['has']('TableUtils')){const _0x4f8295=_0x1f101d['get']('TableUtils')['getSelectedTableCells'](_0x2b4148);if(_0x4f8295['length']){const _0x589c2d=this['_getTableRowCountFromContent'](_0x34c253),_0x21b8ab=this['_createEmptyTableRows'](_0x4f8295,_0x589c2d);return _0x4df1d8['createPositionAt'](_0x21b8ab,0x0);}}return null;}['_getTableRowCountFromContent'](_0x14a721){const _0x3c903d=this['editor']['plugins']['get']('TableUtils'),_0x4c1a37=this['editor']['data']['parse'](_0x14a721),_0xbcb5e1=Array['from'](_0x4c1a37['getChildren']())['filter'](_0x432cf7=>_0x432cf7['is']('element','table'));let _0x5b77b3=0x0;return _0xbcb5e1['forEach'](_0x1bdb61=>{_0x5b77b3+=_0x3c903d['getRows'](_0x1bdb61);}),_0x5b77b3;}['_createEmptyTableRows'](_0x5d0041,_0x13d086){const _0x2c5d6a=this['editor']['plugins']['get']('TableUtils'),_0x3e31db=_0x2c5d6a['getRowIndexes'](_0x5d0041),_0x2e4e4b=_0x2c5d6a['getColumnIndexes'](_0x5d0041),_0x5473fa=_0x3e31db['last']+0x1,_0x344534=_0x2e4e4b['first'],_0x34b88b=_0x5d0041[0x0]['findAncestor']('table');for(let _0x1e126f=0x0;_0x1e126f<_0x13d086;_0x1e126f++)_0x2c5d6a['insertRows'](_0x34b88b,{'at':_0x5473fa});return _0x34b88b['getChild'](_0x5473fa)['getChild'](_0x344534);}['_resetContentOfSelectedTableCells'](_0x6635ff,_0x235ffe){const {plugins:_0x23579a}=this['editor'],{model:_0x4ca672}=_0x6635ff;if(!_0x23579a['has']('TableUtils'))return;_0x23579a['get']('TableUtils')['getSelectedTableCells'](_0x235ffe)['length']&&_0x4ca672['deleteContent'](_0x235ffe);}}class K extends _0x346ac8{static get['pluginName'](){return'AIAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['afterInit'](){if(!this['textAdapter'])throw new _0x36b126('aiadapter-text-adapter-not-set',null);}}class tr extends Error{constructor(_0x112f5c){super(_0x112f5c),this['name']='AIRequestError';}}function Fn(_0x5c51d0,_0x1db254,_0x51bff7){const t=_0x5c51d0['t'];switch(_0x1db254){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',_0x51bff7);case'Error\x20during\x20AI\x20content\x20generation:\x20%0':return t('Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x51bff7);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'},_0x51bff7);case'AI_ERROR_CONTEXT_LENGTH':return t({'id':'AI_ERROR_CONTEXT_LENGTH','string':'Selected\x20content\x20is\x20too\x20long'});case'AI_ERROR_MODERATION':return t({'id':'AI_ERROR_MODERATION','string':'Requested\x20query\x20does\x20not\x20pass\x20moderation\x20rules'});case'AI_ERROR_FAILED':return t({'id':'AI_ERROR_FAILED','string':'Failed\x20to\x20communicate\x20with\x20the\x20AI\x20service'});default:return _0x1db254;}}class E extends Qt{['_commandDefinitions'];constructor(_0x426459,_0x500858){super(_0x426459),this['_commandDefinitions']=_0x500858,this['set']('enabledCommandsIds',[]),this['on']('change:_hasContext',(_0x3630d9,_0xfe9a09,_0x5591f1)=>{this['isEnabled']&&(this['enabledCommandsIds']=ns(this['_commandDefinitions'],_0x5591f1));}),this['set']('_hasContext',!0x1),this['on']('change:isEnabled',(_0x588de0,_0x3d8146,_0x2da70b)=>{this['enabledCommandsIds']=_0x2da70b?ns(this['_commandDefinitions'],this['_hasContext']):[];});}['refresh'](){const _0x21f6cf=this['editor']['model'];this['_hasContext']=function(_0x59df10){const _0x31fd6c=_0x59df10['document']['selection'];return _0x31fd6c['isCollapsed']?0x0!==[..._0x31fd6c['getSelectedBlocks']()]['length']&&![..._0x31fd6c['getSelectedBlocks']()][0x0]['isEmpty']:!!_0x59df10['hasContent'](_0x31fd6c['getFirstRange']());}(_0x21f6cf);const _0x1d936d=_0x21f6cf['document']['selection'],_0x2ea572=this['editor']['config']['get']('ai.assistant.disabledElements');for(const _0x282b68 of _0x1d936d['getRanges']())for(const _0x54a939 of _0x282b68['getItems']())if(_0x54a939['is']('element')&&_0x2ea572['includes'](_0x54a939['name']))return void(this['isEnabled']=!0x1);this['isEnabled']=!0x0;}['execute'](_0x4ce337='',_0x28a06c='',_0x54557b='custom'){this['editor']['plugins']['get'](n)['showUI'](_0x4ce337,_0x28a06c,_0x54557b);}}function ns(_0x2a6712,_0x987b4f){const _0x1b90eb=new Set();for(const _0x2c6707 of _0x2a6712['values']())(_0x987b4f||!0x1===_0x2c6707['requiresContent'])&&_0x1b90eb['add'](_0x2c6707['id']);return Array['from'](_0x1b90eb);}const hs=new RegExp(/^(.*?)<[a-zA-Z][a-zA-Z0-9_\-.]*[ >]/,'is');class j extends/* #__PURE__ -- @preserve */
|
|
24
|
-
ts(){['editor'];['textAdapter'];['view'];['_sanitizationContainer'];['_domParser'];['_xmlSerializer'];constructor(_0x272836,_0xd9453d,_0x14cddc){super(),this['editor']=_0x272836,this['textAdapter']=_0xd9453d,this['_sanitizationContainer']=document['createElement']('div'),this['_domParser']=new DOMParser(),this['_xmlSerializer']=new XMLSerializer(),this['view']=_0x14cddc,this['set']({'initialContext':'','currentContext':'','currentResponse':'','previousContext':void 0x0,'previousQuery':void 0x0,'previousLabel':void 0x0,'isProcessing':!0x1}),this['on']('set:currentContext',(_0x213e50,_0x107313,_0x25233d)=>{this['view']['value']=this['_sanitizeHTML'](_0x25233d);}),this['listenTo'](this['view'],'submitPrompt',(_0x6c4388,_0x39004c)=>{const _0x4dd9ed=this['currentContext']||this['initialContext'];this['_handleQuery'](_0x39004c,_0x4dd9ed,'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:_0x6f3899,query:_0x31768b,htmlContent:_0x4f8b75,label:_0x392729,mainActionLabel:_0x19752b}){this['view']['prompt']=_0x392729,this['view']['mainAction']=_0x19752b,this['initialContext']=_0x4f8b75,_0x31768b&&(this['view']['isRendered']?this['_handleQuery'](_0x31768b,_0x4f8b75,_0x6f3899,_0x392729):this['view']['once']('render',()=>{this['_handleQuery'](_0x31768b,_0x4f8b75,_0x6f3899,_0x392729);}));}['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'](_0x465419,_0x551da2,_0xc1c803,_0x5df550){return this['isProcessing']=!0x0,this['view']['startProcessing'](),this['previousContext']=_0x551da2,this['previousQuery']=_0x465419,this['previousLabel']=_0x5df550||_0x465419,this['previousActionId']=_0xc1c803,new Promise(_0x5ce262=>{this['textAdapter']['makeRequest']({'query':_0x465419,'context':_0x551da2,'onData':_0x482c14=>{this['currentResponse']=_0x482c14,this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse']);},'actionId':_0xc1c803})['then'](()=>{!this['currentContext']&&this['currentResponse']&&(this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse'],!0x0));})['catch'](_0x4af674=>{_0x4af674 instanceof tr?this['view']['handleError'](_0x4af674['message']):this['view']['handleError'](),_0x5ce262();})['finally'](()=>{this['stopProcessing'](),_0x5ce262();});});}['_parseAndNormalizeContent'](_0x923fa6,_0x590918=!0x1){const _0x39ced6=hs['exec'](_0x923fa6);_0x923fa6=_0x39ced6?_0x923fa6['substring'](_0x39ced6[0x1]['length']):_0x923fa6['length']<0x64&&!_0x590918?'':this['_stripMarkdownSyntax'](_0x923fa6);const _0x5f5309=this['_domParser']['parseFromString'](_0x923fa6,'text/html');if(_0x39ced6){const _0x365296=Array['from'](_0x5f5309['body']['childNodes']);_0x365296['reverse']();for(const _0x1adaff of _0x365296){if(_0x1adaff['nodeType']==Node['ELEMENT_NODE'])break;_0x1adaff['remove']();}}const _0x565ea0=this['editor']['data']['processor']['toView'](this['_xmlSerializer']['serializeToString'](_0x5f5309['body']));this['_isH1TagSupportEnabled']()||this['_normalizeResponseHeadings'](_0x565ea0);const _0x4a77ea=this['editor']['config']['get']('ai.assistant.preserveComments'),_0x508bb6=this['editor']['data']['toModel'](_0x565ea0);return _0x4a77ea||_0x508bb6['markers']['clear'](),this['editor']['data']['stringify'](_0x508bb6);}['_normalizeResponseHeadings'](_0x5379d3){const _0xb7c8e7=new _0x5b43a2(this['editor']['editing']['view']['document']),_0x96a276=new _0xa40f65({'name':/^h[1-5]$/}),_0x15fd7e=[];let _0x20b887=!0x1;for(const _0x5a9ea1 of _0x5379d3)_0x5a9ea1['is']('element')&&_0x96a276['match'](_0x5a9ea1)&&(_0x15fd7e['push'](_0x5a9ea1),'h1'==_0x5a9ea1['name']&&(_0x20b887=!0x0));if(_0x20b887){for(const _0x5bdb78 of _0x15fd7e)_0xb7c8e7['rename']('h'+(parseInt(_0x5bdb78['name'][0x1])+0x1),_0x5bdb78);}}['_isH1TagSupportEnabled'](){const {data:_0x4be0b0,editing:_0x5ea26c}=this['editor'],_0x285bbf=_0x4be0b0['htmlProcessor']['toView']('<h1></h1>'),_0x5a38d6=_0x4be0b0['toView'](_0x4be0b0['toModel'](_0x285bbf));return!!_0x5ea26c['view']['domConverter']['viewToDom'](_0x5a38d6)['querySelector']('h1');}['_sanitizeHTML'](_0x3fd6a5){return this['editor']['editing']['view']['domConverter']['setContentOf'](this['_sanitizationContainer'],_0x3fd6a5),this['_sanitizationContainer']['innerHTML'];}['_stripMarkdownSyntax'](_0x27c336){const _0x1a8e22=_0x27c336['trim']();return _0x1a8e22['startsWith']('```html')?_0x1a8e22['endsWith']('```')?_0x1a8e22['substring'](0x7,_0x1a8e22['length']-0x3):_0x1a8e22['substring'](0x7):_0x27c336;}}const _={'REPLACE':'replace','INSERT':'insert'};class yr extends _0x312a64{constructor(_0x3ac17a){super(_0x3ac17a),this['set']('isVisible',!0x1),this['set']('mainAction',_['REPLACE']),this['replaceButton']=this['_createButton']('','ck-button-action'),this['replaceButton']['bind']('label')['to'](this,'mainAction',_0x19a5ba=>Fn(_0x3ac17a,'AI_'+_0x19a5ba['toUpperCase']()+'_CONTENT')),this['insertButton']=this['_createButton'](Fn(_0x3ac17a,'Insert\x20below')),this['tryAgainButton']=this['_createButton'](Fn(_0x3ac17a,'Try\x20again')),this['stopButton']=this['_createButton'](Fn(_0x3ac17a,'Stop'));const _0x247b5c=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-form__toolbar',_0x247b5c['if']('isVisible','ck-hidden',_0x10fe2e=>!_0x10fe2e)]}}),this['items']['addMany']([this['replaceButton'],this['insertButton'],this['tryAgainButton'],this['stopButton']]);}['_createButton'](_0x174ef9,_0x599e31){const _0x4475bb=new _0xcbb426(this['locale']);return _0x4475bb['set']({'label':_0x174ef9,'class':_0x599e31||'','isVisible':!0x0,'withText':!0x0}),_0x4475bb;}}class Er extends _0x43effc{['contentFieldView'];['copyButtonView'];constructor(_0x831adb,_0x1f2285=''){super(_0x831adb),this['set']({'value':null,'isVisible':!0x1,'isProcessing':!0x1});const _0x22f87c=this['bindTemplate'];this['contentFieldView']=new Yn(_0x831adb,_0x1f2285),this['copyButtonView']=this['_createCopyButton'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area-wrapper',_0x22f87c['if']('isVisible','ck-hidden',_0xff707f=>!_0xff707f)],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area',_0x22f87c['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 _0x3a1b75=!0x1;this['on']('change:value',(_0x5580cf,_0x957faf,_0x1c7f48)=>{const _0x532c28=!this['contentFieldView']['element']['querySelector']('.ck-ai-form__loader');this['contentFieldView']['setContent'](_0x1c7f48),this['isProcessing']&&_0x532c28&&!_0x3a1b75&&this['element']['scrollTo']({'top':this['element']['scrollHeight'],'behavior':'smooth'});}),this['on']('change:isProcessing',(_0xd60c7d,_0x2709a4,_0x547b18)=>{_0x3a1b75=!0x1,_0x547b18?(this['value']=null,this['contentFieldView']['appendLoader']()):this['value']||this['contentFieldView']['setContent']('');}),this['listenTo'](this['element'],'wheel',()=>{_0x3a1b75=!0x0;}),this['listenTo'](this['element'],'mousedown',()=>{_0x3a1b75=!0x0;});}['focus'](){this['element']['focus']();}['_createCopyButton'](){const _0x2fb8e2=this['locale'],_0x4ac0c0=new _0xcbb426(this['locale']),_0x303f66='ck-ai-form__copy-button';return _0x4ac0c0['set']({'label':Fn(_0x2fb8e2,'Copy'),'icon':_0x8c93b,'class':_0x303f66,'tooltip':!0x0}),_0x4ac0c0['bind']('isVisible')['to'](this,'value',_0x4f4177=>!!_0x4f4177),_0x4ac0c0['bind']('isEnabled')['to'](this,'isProcessing',_0x53fe2c=>!_0x53fe2c),_0x4ac0c0['on']('execute',()=>{this['_copyHTMLToClipboard'](this['contentFieldView']['element']),_0x4ac0c0['icon']=_0x3cb840,_0x4ac0c0['class']=_0x303f66+'\x20ck-ai-form__copy-button--copied',this['focus'](),setTimeout(()=>{_0x4ac0c0['icon']=_0x8c93b,_0x4ac0c0['class']=_0x303f66;},0x3e8);}),_0x4ac0c0;}['_copyHTMLToClipboard'](_0xff8339){const {window:_0x245903,document:_0x3a9932}=lt;if(_0x245903['ClipboardItem']){const {Blob:_0x4187a7,ClipboardItem:_0x191a32}=_0x245903,_0x1a241f=[new _0x191a32({'text/html':new _0x4187a7([_0xff8339['innerHTML']],{'type':'text/html'}),'text/plain':new _0x4187a7([_0xff8339['textContent']||''],{'type':'text/plain'})})];navigator['clipboard']['write'](_0x1a241f);}else{const _0x41711b=_0x3a9932['createElement']('div');_0x41711b['style']['position']='absolute',_0x41711b['style']['left']='-9999px',_0x41711b['innerHTML']='<span>[</span>'+_0xff8339['innerHTML']+'<span>]</span>',_0x3a9932['body']['appendChild'](_0x41711b);const _0x3d4423=_0x3a9932['createRange']();_0x3d4423['setStartAfter'](_0x41711b['firstElementChild']),_0x3d4423['setEndBefore'](_0x41711b['lastElementChild']);const _0x3d6311=_0x245903['getSelection']();_0x3d6311['removeAllRanges'](),_0x3d6311['addRange'](_0x3d4423),_0x3a9932['execCommand']('copy'),_0x41711b['remove']();}}}class Yn extends _0x43effc{constructor(_0x2566d5,_0x15801b=''){super(_0x2566d5),this['loaderView']=this['_createLoader'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content',_0x15801b,'ck-reset_all-excluded','ck-ai-form__content-field']}});}['setContent'](_0x1f375f){this['element']['innerHTML']=_0x1f375f;}['appendLoader'](){this['element']['appendChild'](this['loaderView']['element']);}['_createLoader'](){const _0x5b1542=new _0x43effc(),_0x49ee12=this['locale'],_0x350b61=new _0x5da037();return _0x350b61['isVisible']=!0x0,_0x5b1542['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__loader']},'children':[_0x350b61,{'text':Fn(_0x49ee12,'AI\x20is\x20writing...')}]}),_0x5b1542['render'](),_0x5b1542;}}class vr extends _0x43effc{constructor(_0x59bc05,_0x187cc4=''){super(_0x59bc05);const _0x181726=new _0x4caa0b(),_0x13e0b9=this['bindTemplate'];this['set']('text',_0x187cc4),_0x181726['content']=_0x3769b2,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__error']},'children':[_0x181726,{'text':_0x13e0b9['to']('text')}]});}}class Ar extends _0x53698e{['submitButtonView'];['showHistoryButtonView'];constructor(_0x2564ff,_0x62530){super(_0x2564ff,_0x62530),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',(_0x402263,_0x119915)=>{_0x402263['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0x119915());});}['_createSubmitButton'](){const _0x3a07e8=new _0xcbb426(this['locale']),_0x12e10c=this['locale'];return _0x3a07e8['set']({'icon':_0x2913f7,'label':Fn(_0x12e10c,'Submit'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-form__submit'}),_0x3a07e8['on']('execute',()=>{this['submit']();}),_0x3a07e8['bind']('isEnabled')['to'](this['queryView']['fieldView'],'isEmpty',this,'isEnabled',(_0x9fcc8d,_0x5a4455)=>!_0x9fcc8d&&_0x5a4455),_0x3a07e8;}['_createShowHistoryButton'](){const _0x2ceeda=new _0xcbb426(this['locale']),_0x17ea29=this['resultsView'],_0x5dffdd=this['locale'];_0x2ceeda['set']({'label':Fn(_0x5dffdd,'History'),'withText':!0x1,'icon':Ut,'tooltip':!0x0,'tooltipPosition':'sw','class':'ck-ai-form__toggle-history'}),_0x2ceeda['bind']('isOn')['to'](_0x17ea29,'isVisible'),_0x2ceeda['bind']('isEnabled')['to'](this,'isEnabled'),_0x2ceeda['on']('execute',()=>{_0x17ea29['isVisible']=!_0x17ea29['isVisible'],_0x17ea29['isVisible']?this['filteredView']['focus']():this['focus']();});const _0x1b922f=()=>{lt['window']['requestAnimationFrame'](()=>{if(_0x13140d(this['element'])){const _0x5e081a=new ct(this['queryView']['fieldView']['element']),_0x48d218=_0x5e081a['width'],_0xe6867c='rtl'===_0x5dffdd['uiLanguageDirection']?'left':'right';_0x5e081a['excludeScrollbarsAndBorders'](),_0x2ceeda['element']['style'][_0xe6867c]=_0x48d218-_0x5e081a['width']+0x1+'px';}});};return this['queryView']['fieldView']['on']('update',_0x1b922f),this['on']('render',_0x1b922f),_0x2ceeda;}['submit'](){const _0x442b37=this['queryView']['fieldView']['element']['value'];this['fire']('submit',_0x442b37);}['focus'](_0x54e8ec){-0x1===_0x54e8ec?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}}class Pr extends _0x5bd1ba{['historyGroupView'];['clearHistoryButton'];constructor(_0x4edf4a){super(_0x4edf4a),this['clearHistoryButton']=this['_createClearHistoryButton'](),this['historyGroupView']=new _0x5230c7(),this['historyGroupView']['children']['add'](this['clearHistoryButton'],0x1),this['historyGroupView']['label']=Fn(_0x4edf4a,'Prompt\x20history'),this['historyGroupView']['items']['delegate']('execute')['to'](this),this['items']['add'](this['historyGroupView']);}['filter'](){let _0x2dc92c=0x0;for(const _0x2e42ec of this['items'])_0x2dc92c+=_0x2e42ec['items']['length'];return{'resultsCount':_0x2dc92c,'totalItemsCount':_0x2dc92c};}['_createClearHistoryButton'](){const _0xcc07ea=this['locale'],_0x1f3e2d=new _0xcbb426(this['locale']);return _0x1f3e2d['set']({'label':'('+Fn(_0xcc07ea,'Clear')+')','withText':!0x0}),_0x1f3e2d['on']('execute',()=>this['fire']('clearHistory')),_0x1f3e2d;}}class jr extends _0x3f0116{constructor(_0x22364e){super();const _0x1db5f7=new _0x43f368(),_0x3ef553=new _0xcbb426(this['locale'],_0x1db5f7);this['children']['add'](_0x3ef553),_0x3ef553['set']({'label':_0x22364e['prompt'],'withText':!0x0}),_0x3ef553['on']('execute',()=>{this['fire']('execute',{'value':_0x5d07f8(_0x22364e['prompt'])});});}}const So='CKEditor/AIFormView/PromptHistory';class Ir extends _0x5137f7{constructor(){super(),this['_loadFromSessionStorage'](),this['on']('add',(_0x19f69e,_0x3561c6)=>{const _0x435cf1=fo(_0x3561c6['prompt']);for(const _0x40b1d3 of this)if(_0x40b1d3!=_0x3561c6&&fo(_0x40b1d3['prompt'])===_0x435cf1){this['remove'](_0x40b1d3);break;}this['length']>0x14&&this['remove'](this['last']),this['_saveToSessionStorage']();}),this['on']('remove',()=>{this['_saveToSessionStorage']();});}['_loadFromSessionStorage'](){const _0x399618=sessionStorage['getItem'](So)||'[]';this['addMany'](JSON['parse'](_0x399618));}['_saveToSessionStorage'](){sessionStorage['setItem'](So,JSON['stringify'](this['map'](_0x2360f3=>_0x2360f3)));}}function fo(_0x382ffd){return _0x382ffd['toLowerCase']()['trim']();}class k extends _0x43effc{['focusTracker'];['keystrokes'];['contentArea'];['toolbar'];['promptView'];['errorView'];['_focusables'];['focusCycler'];['_promptHistory'];constructor(_0x1210c4,_0x455b21,_0x369d4b=''){super(_0x1210c4),this['set']('isEnabled',!0x0),this['set']('isProcessing',!0x1),this['set']('prompt',''),this['set']('value',''),this['set']('isError',!0x1),this['set']('mainAction',_['REPLACE']),this['_promptHistory']=new Ir(),this['errorView']=new vr(_0x1210c4),this['contentArea']=new Er(_0x1210c4,_0x369d4b),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 _0x25d272(),this['keystrokes']=new _0xfe6d51(),this['_focusables']=this['createCollection']([this['contentArea'],this['contentArea']['copyButtonView'],this['toolbar'],this['promptView']]),this['focusCycler']=new _0x4b849d({'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 _0x45eebd=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form',_0x455b21],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form-content']},'children':[{'tag':'div','attributes':{'class':[_0x45eebd['if']('isError','ck-hidden',_0x530fb8=>!_0x530fb8)]},'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'](_0x2c4121=0x1){-0x1===_0x2c4121?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 _0x1927e1=this['locale'],_0x2f4917=new Ar(_0x1927e1,{'queryView':{'label':Fn(_0x1927e1,'Ask\x20AI\x20to\x20edit\x20or\x20generate'),'creator':_0x49d9f6,'showIcon':!0x1,'showResetButton':!0x1},'infoView':{'text':{'noSearchableItems':{'primary':Fn(_0x1927e1,'Empty\x20history'),'secondary':Fn(_0x1927e1,'Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.')}}},'filteredView':this['_createHistoryView'](),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1});return _0x2f4917['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x3aa078,_0x3252ea)=>_0x3aa078&&!_0x3252ea),this['listenTo'](_0x2f4917,'submit',(_0x2435b2,_0x106401)=>{this['prompt']=_0x106401;const _0x371cfe=_0x469020(_0x106401);this['fire']('submitPrompt',_0x371cfe),_0x106401['trim']()&&this['_promptHistory']['add']({'prompt':_0x371cfe},0x0);},{'priority':'high'}),_0x2f4917;}['_createHistoryView'](){const _0xc3cf98=new Pr(this['locale']);return _0xc3cf98['historyGroupView']['items']['bindTo'](this['_promptHistory'])['as'](jr),_0xc3cf98['on']('clearHistory',()=>{this['_promptHistory']['clear'](),this['promptView']['search'](''),this['promptView']['focus']();}),_0xc3cf98;}['_createToolbar'](){const _0x58f9e0=new yr(this['locale']);return _0x58f9e0['replaceButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x1407ca,_0x33985a,_0x38d8ce)=>_0x1407ca&&!_0x33985a&&!!_0x38d8ce),_0x58f9e0['replaceButton']['delegate']('execute')['to'](this,'replaceContent'),_0x58f9e0['insertButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x1d3cff,_0x36462b,_0x54bc8c)=>_0x1d3cff&&!_0x36462b&&!!_0x54bc8c),_0x58f9e0['insertButton']['delegate']('execute')['to'](this,'insertContentBelow'),_0x58f9e0['tryAgainButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x3bd751,_0xc72ab2)=>_0x3bd751&&!_0xc72ab2),_0x58f9e0['tryAgainButton']['delegate']('execute')['to'](this,'tryAgainEvent'),_0x58f9e0['stopButton']['bind']('isEnabled')['to'](this,'isProcessing'),_0x58f9e0['stopButton']['delegate']('execute')['to'](this,'stopProcessing'),_0x58f9e0;}['startProcessing'](){this['value']='',this['isError']=!0x1,this['isProcessing']=!0x0,this['contentArea']['isVisible']=!0x0,this['toolbar']['isVisible']=!0x0,this['contentArea']['focus']();}['finishProcessing'](){const _0x103d42=this['locale'];this['isProcessing']=!0x1,this['prompt']='',this['promptView']['reset'](),this['value']&&(this['promptView']['queryView']['label']=Fn(_0x103d42,'Ask\x20AI\x20to\x20improve\x20generated\x20text'));}['handleError'](_0x292b8a){const _0x10d92d=this['locale'];this['finishProcessing'](),this['isError']=!0x0,this['errorView']['text']=_0x292b8a||Fn(_0x10d92d,'AI_ERROR_FAILED'),this['value']||(this['contentArea']['isVisible']=!0x1);}}const w=globalThis['DataTransfer'];class n extends _0x346ac8{['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[_0x500258,a,K,_0xe646c5];}constructor(_0x12b9ab){super(_0x12b9ab),_0x12b9ab['config']['define']('ai.assistant.disabledElements',['media','rawHtml','tableOfContents']),_0x12b9ab['config']['define']('ai.assistant.contentAreaCssClass',''),_0x12b9ab['config']['define']('ai.assistant.useTheme',!0x0),this['_uiCssClasses']='ck-ai-assistant-ui'+(_0x12b9ab['config']['get']('ai.assistant.useTheme')?'\x20ck-ai-assistant-ui_theme':'');}['init'](){const {editor:_0x1fa3a5}=this;this['_aiAdapter']=_0x1fa3a5['plugins']['get'](K),this['_dialog']=_0x1fa3a5['plugins']['get'](_0xe646c5),this['_formView']=null,this['_commandDefinitions']=this['_getResolvedCommandsDefinitions']();const _0x375715=new E(_0x1fa3a5,Array['from'](this['_commandDefinitions']['values']()));_0x1fa3a5['commands']['add']('showAIAssistant',_0x375715),_0x1fa3a5['ui']['componentFactory']['add']('aiCommands',_0x6ecfff=>{const _0x38be1c=_0x2e287a(_0x6ecfff);return _0x38be1c['set']({'class':'ck-ai-commands-dropdown\x20'+this['_uiCssClasses']}),_0x38be1c['buttonView']['set']({'label':Fn(_0x6ecfff,'AI\x20Commands'),'icon':_0x49e0da,'tooltip':!0x0}),_0x38be1c['on']('execute',_0x2307d6=>this['_onExecute'](_0x2307d6['source']['id'])),_0x10a136(_0x38be1c,_0x1fa3a5['ui']['view']['body'],function(_0x304ec7){const _0x605eeb=o(_0x304ec7['config']['get']('ai.assistant.commands'),_0x304ec7['locale']),_0x394d0e=B(_0x304ec7,_0x605eeb)['filter'](_0x1b9269=>_0x1b9269['commands']['length']);if(0x1===_0x394d0e['length'])return B(_0x304ec7,_0x394d0e[0x0]['commands'])['map'](_0x1ab30b=>({'id':_0x1ab30b['id'],'label':_0x1ab30b['label']}));return _0x394d0e['map'](_0x3aaac1=>{const {groupId:_0x5deeaf,groupLabel:_0x102b48,commands:_0xdb5b74}=_0x3aaac1,_0x234766=B(_0x304ec7,_0xdb5b74)['map'](_0x3e6f29=>({'id':_0x3e6f29['id'],'label':_0x3e6f29['label']}));return{'id':_0x5deeaf,'menu':_0x102b48||_0x5deeaf,'children':_0x234766};});}(_0x1fa3a5),{'ariaLabel':Fn(_0x6ecfff,'AI\x20Commands')}),_0x38be1c['menuView']['menuPanelClass']='ck-ai-commands-dropdown\x20'+this['_uiCssClasses'],_0x375715['on']('change:enabledCommandsIds',_0x13a604),_0x38be1c['menuView']['once']('render',_0x13a604),_0x38be1c;function _0x13a604(){_0x38be1c['isEnabled']=_0x375715['enabledCommandsIds']['length']>0x0;for(const _0x2d5949 of _0x38be1c['menuView']['buttons'])_0x2d5949['isEnabled']=_0x375715['enabledCommandsIds']['includes'](_0x2d5949['id']);}}),_0x1fa3a5['ui']['componentFactory']['add']('menuBar:aiCommands',_0x23d0ad=>{const _0x472f47=new _0x44a9af(_0x23d0ad);_0x472f47['buttonView']['set']({'label':Fn(_0x23d0ad,'AI\x20Commands'),'icon':_0x49e0da}),_0x472f47['bind']('isEnabled')['to'](_0x375715,'enabledCommandsIds',_0x3ec97f=>_0x3ec97f['length']>0x0);const _0xf08a11=o(_0x1fa3a5['config']['get']('ai.assistant.commands'),_0x23d0ad);return this['_populateMenuBarMenu'](_0x375715,_0x472f47,_0xf08a11,_0x2b0643=>this['_onExecute'](_0x2b0643)),_0x472f47;}),_0x1fa3a5['ui']['componentFactory']['add']('aiAssistant',()=>{const _0x1f4557=this['_createAIAssistantUIButton'](_0xcbb426);return _0x1f4557['set']({'tooltip':!0x0,'class':'ck-ai-assistant-button\x20'+this['_uiCssClasses']}),_0x1f4557;}),_0x1fa3a5['ui']['componentFactory']['add']('menuBar:aiAssistant',()=>{const _0x4f49ad=this['_createAIAssistantUIButton'](_0x3ce5a8);return _0x4f49ad['set']({'role':'menuitemcheckbox'}),_0x4f49ad;}),this['licenseKey']=this['editor']['config']['get']('licenseKey');const _0x5b3261=this['editor'];this['_licenseKeyCheckInterval']=setInterval(()=>{let _0x3892b9;for(const _0x2afccf in _0x5b3261){const _0x5c883a=_0x2afccf,_0x1c65ac=_0x5b3261[_0x5c883a];if('aiLicenseKeyValid'==_0x1c65ac||'aiLicenseKeyInvalid'==_0x1c65ac||'aiLicenseKeyExpired'==_0x1c65ac||'aiLicenseKeyDomainLimit'==_0x1c65ac||'aiLicenseKeyNotAllowed'==_0x1c65ac||'aiLicenseKeyEvaluationLimit'==_0x1c65ac||'aiLicenseKeyUsageLimit'==_0x1c65ac){delete _0x5b3261[_0x5c883a],_0x3892b9=_0x1c65ac,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'aiLicenseKeyInvalid'==_0x3892b9&&_0x5b3261['_showLicenseError']('invalid'),'aiLicenseKeyExpired'==_0x3892b9&&_0x5b3261['_showLicenseError']('expired'),'aiLicenseKeyDomainLimit'==_0x3892b9&&_0x5b3261['_showLicenseError']('domainLimit'),'aiLicenseKeyNotAllowed'==_0x3892b9&&_0x5b3261['_showLicenseError']('featureNotAllowed','AIAssistant'),'aiLicenseKeyEvaluationLimit'==_0x3892b9&&_0x5b3261['_showLicenseError']('evaluationLimit'),'aiLicenseKeyUsageLimit'==_0x3892b9&&_0x5b3261['_showLicenseError']('usageLimit');},0x3e8);}['destroy'](){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}['showUI'](_0x2ae063='',_0x4293c6='',_0x4e9167='custom'){const _0x3cae87=this['editor'],_0x241a92=_0x3cae87['editing']['view'],_0x331ea8=_0x3cae87['plugins']['get'](a),_0x4c5f94=_0x3cae87['plugins']['get'](_0x500258);_0x331ea8['showFakeVisualSelection']();const _0x520d4b=new w(),_0x21b679=new ClipboardEvent('copy',{'clipboardData':_0x520d4b}),_0x5bf487=new _0x13d2e1(_0x520d4b),_0x347aa2=new _0x407c9a(_0x241a92,_0x21b679,{'dataTransfer':_0x5bf487});_0x4c5f94['_forceMarkersCopy']('comment',()=>{_0x241a92['document']['fire']('copy',_0x347aa2);}),this['_formView']||(this['_initView'](),this['_aiAssistantController']=new j(_0x3cae87,this['_aiAdapter']['textAdapter'],this['_formView']));let _0x430e3f=_0x5bf487['getData']('text/html');const _0x20a91a=_0x3cae87['model']['document']['selection'],_0x456ee0=Array['from'](_0x20a91a['getRanges']());0x1===_0x456ee0['length']&&_0x456ee0[0x0]['isFlat']&&!_0x20a91a['getSelectedElement']()&&''!==_0x430e3f['replace'](/ /g,'')['trim']()&&(_0x430e3f='<p>'+_0x430e3f+'</p>'),this['_aiAssistantController']['updateView']({'actionId':_0x4e9167,'query':_0x2ae063,'htmlContent':_0x430e3f,'label':_0x4293c6,'mainActionLabel':_[_0x3cae87['model']['document']['selection']['isCollapsed']?'INSERT':'REPLACE']}),'aiAssistant'!==this['_dialog']['id']?this['_dialog']['show']({'id':'aiAssistant','icon':_0x54d69e,'title':Fn(this['editor']['locale'],'AI\x20Assistant'),'content':this['_formView'],'position':_0x54d5b5['EDITOR_TOP_SIDE'],'onShow':()=>{this['_formView']['focus']();},'onHide':()=>{this['_aiAssistantController']['reset'](),_0x331ea8['hideFakeVisualSelection']();}}):this['_dialog']['view']['wasMoved']||this['_dialog']['view']['updatePosition']();}['hideUI'](){this['_dialog']['hide']();}['_getResolvedCommandsDefinitions'](){const _0x1271d6=new Map(),_0x48fa4a=o(this['editor']['config']['get']('ai.assistant.commands'),this['editor']['locale']);for(const _0xa22300 of _0x48fa4a)for(const _0x7fd77b of _0xa22300['commands'])_0x1271d6['set'](_0x7fd77b['id'],{..._0x7fd77b,'groupId':_0xa22300['groupId'],'groupLabel':_0xa22300['groupLabel']||_0xa22300['groupId']});return _0x1271d6;}['_createAIAssistantUIButton'](_0xe5cc8c){const _0x304e62=this['editor'],_0x15009b=_0x304e62['commands']['get']('showAIAssistant'),_0x23efb4=new _0xe5cc8c(_0x304e62['locale']);return _0x23efb4['set']({'label':Fn(_0x304e62['locale'],'AI\x20Assistant'),'icon':_0x54d69e,'isToggleable':!0x0}),_0x23efb4['bind']('isEnabled')['to'](_0x15009b),_0x23efb4['bind']('isOn')['to'](this['_dialog'],'id',_0x133a57=>'aiAssistant'===_0x133a57),this['listenTo'](_0x23efb4,'execute',()=>{_0x23efb4['isOn']?this['hideUI']():_0x15009b['execute']();}),_0x23efb4;}['_initView'](){const _0x565622=this['editor']['plugins']['get'](a);this['_formView']=new k(this['editor']['locale'],this['_uiCssClasses'],this['editor']['config']['get']('ai.assistant.contentAreaCssClass')),this['_formView']['on']('change:value',()=>{this['_dialog']['view']['wasMoved']||this['_dialog']['view']['updatePosition']();}),this['_formView']['promptView']['queryView']['fieldView']['on']('update',()=>{this['_dialog']['view']['wasMoved']||this['_dialog']['view']['updatePosition']();}),this['listenTo'](this['_formView'],'replaceContent',()=>{_0x565622['insertContent'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['listenTo'](this['_formView'],'insertContentBelow',()=>{_0x565622['insertContentBelow'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['_initAriaAiStatusChangeAnnouncements']();}['_initAriaAiStatusChangeAnnouncements'](){const {locale:_0x4cf510,ui:{ariaLiveAnnouncer:_0x2bc1cf}}=this['editor'];this['_formView']['contentArea']['on']('change:isProcessing',(_0x4fbd0b,_0x286973,_0xa515c3)=>{const _0x913a57=this['_aiAssistantController']['currentContext'];_0xa515c3?_0x2bc1cf['announce'](Fn(_0x4cf510,'AI\x20is\x20writing')):_0x913a57&&_0x2bc1cf['announce'](Fn(_0x4cf510,'Generated\x20content:\x20%0',_0x913a57),{'politeness':'polite','isUnsafeHTML':!0x0});}),this['_formView']['on']('change:isError',(_0x577130,_0x12d360,_0x4f425e)=>{if(_0x4f425e){const _0x2146cf=this['_formView']['errorView']['text'];_0x2bc1cf['announce'](Fn(_0x4cf510,'Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x2146cf));}});}['_onExecute'](_0x2da5b8){const _0x3877ee=this['_commandDefinitions']['get'](_0x2da5b8),_0x478304=this['editor'],_0xbf95dc=_0x478304['model']['document']['selection'],_0x492e82=_0x478304['commands']['get']('showAIAssistant'),_0x889596=_0x478304['plugins']['get'](a),_0x4be9fa=''+(_0x3877ee['groupId']!==x?_0x3877ee['groupLabel']+':\x20':'')+_0x3877ee['label'];if(!0x1!==_0x3877ee['requiresContent']&&_0xbf95dc['isCollapsed']){const _0x3ddee6=_0x165b43(_0xbf95dc['getSelectedBlocks']())||_0x478304['model']['schema']['getLimitElement'](_0xbf95dc);_0x478304['model']['change'](_0x121340=>{_0x121340['setSelection'](_0x3ddee6,'in');});}_0x889596['showFakeVisualSelection'](),_0x492e82['execute'](_0x3877ee['prompt'],_0x4be9fa,'command:'+_0x2da5b8);}['_populateMenuBarMenu'](_0x113c50,_0x3ea3e6,_0x36a19c,_0x3351e7){const _0x1d54dc=this['editor'],_0x36d873=_0x1d54dc['locale'],_0x493bad=new _0x32dd81(_0x36d873),_0x4a29c4=B(_0x1d54dc,_0x36a19c)['filter'](_0x32efde=>_0x32efde['commands']['length']);0x1===_0x4a29c4['length']?this['_getMenuBarGroupButtons']({'command':_0x113c50,'commands':_0x4a29c4[0x0]['commands'],'parentMenuView':_0x3ea3e6,'onExecute':_0x3351e7})['forEach'](_0x3ff6b9=>_0x493bad['items']['add'](_0x3ff6b9)):_0x4a29c4['forEach'](({groupId:_0xf398ac,groupLabel:_0x3dd896,commands:_0x4337b6})=>{const _0xe7c76e=new _0x53ce29(_0x36d873,_0x3ea3e6),_0x7901db=new _0x44a9af(_0x36d873),_0x9bbfd8=new _0x32dd81(_0x36d873),_0xf2dced=this['_getMenuBarGroupButtons']({'command':_0x113c50,'commands':_0x4337b6,'parentMenuView':_0x7901db,'onExecute':_0x3351e7});_0x7901db['buttonView']['set']({'label':_0x3dd896||_0xf398ac}),_0x7901db['delegate']('execute')['to'](_0x3ea3e6),_0x9bbfd8['items']['addMany'](_0xf2dced),_0x7901db['panelView']['children']['add'](_0x9bbfd8),_0xe7c76e['children']['add'](_0x7901db),_0x493bad['items']['add'](_0xe7c76e);}),_0x3ea3e6['panelView']['children']['add'](_0x493bad);}['_getMenuBarGroupButtons']({command:_0x3d19db,commands:_0x5cc63a,parentMenuView:_0xe1a791,onExecute:_0x3e0747}){const _0x4735dc=this['editor'],_0x5c11b7=_0x4735dc['locale'];return B(_0x4735dc,_0x5cc63a)['map'](_0x529ef3=>{const _0x5c79fd=new _0x53ce29(_0x5c11b7,_0xe1a791),_0x5c51cf=new _0x3ce5a8(_0x5c11b7);return _0x5c51cf['set']({'label':_0x529ef3['label']}),_0x5c51cf['delegate']('execute')['to'](_0xe1a791),_0x5c51cf['on']('execute',()=>_0x3e0747(_0x529ef3['id'])),_0x5c51cf['bind']('isEnabled')['to'](_0x3d19db,'enabledCommandsIds',_0x52295d=>_0x52295d['includes'](_0x529ef3['id'])),_0x5c79fd['children']['add'](_0x5c51cf),_0x5c79fd;});}}function U(_0x2a56fc,_0x2b7878){return void 0x0!==_0x2a56fc['order']&&void 0x0===_0x2b7878['order']?0x1:void 0x0===_0x2a56fc['order']&&void 0x0!==_0x2b7878['order']?-0x1:void 0x0!==_0x2a56fc['order']&&void 0x0!==_0x2b7878['order']?_0x2a56fc['order']-_0x2b7878['order']:0x0;}function B(_0x2f31b8,_0x29fd6e){_0x29fd6e['sort'](U);const _0x73911b={},_0x5462b8=[];for(const _0x427466 of _0x29fd6e)if(void 0x0!==_0x427466['order']){if(_0x427466['order']in _0x73911b)throw new _0x36b126('ai-commands-config-order-collision',_0x2f31b8,{'conflictingDefinitions':[_0x427466,_0x73911b[_0x427466['order']]]});_0x73911b[_0x427466['order']]=_0x427466,_0x5462b8['splice'](_0x427466['order'],0x0,_0x427466);}else _0x5462b8['push'](_0x427466);return _0x5462b8;}class $n extends _0x346ac8{static get['requires'](){return[n,a];}static get['pluginName'](){return'AIAssistant';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x4885d7){super(_0x4885d7);const _0x2f2971=_0x4885d7['config'],_0x8600d7=_0x4885d7['locale'];_0x2f2971['define']('ai.assistant.preserveComments',!0x0),_0x2f2971['define']('ai.assistant.commands',qn(_0x8600d7)),_0x2f2971['define']('ai.assistant.extraCommandGroups',[]),_0x2f2971['define']('ai.assistant.removeCommands',[]);let _0x13a285=o(_0x2f2971['get']('ai.assistant.commands'),_0x8600d7);const _0xe30bc9=_0x2f2971['get']('ai.assistant.extraCommandGroups'),_0x2a3449=_0x2f2971['get']('ai.assistant.removeCommands');_0xe30bc9['forEach'](_0x40070f=>{const _0x2ba832=_0x13a285['find'](_0x49198d=>_0x49198d['groupId']===_0x40070f['groupId']);_0x2ba832?_0x2ba832['commands']=_0x2ba832['commands']['concat'](_0x40070f['commands']):_0x13a285['push'](_0x40070f);}),_0x13a285=_0x13a285['filter'](_0x1aa43e=>!_0x2a3449['includes'](_0x1aa43e['groupId'])),_0x13a285['forEach'](_0x65ecb5=>{_0x65ecb5['commands']=_0x65ecb5['commands']['filter'](_0x4d7242=>!_0x2a3449['includes'](_0x4d7242['id']));}),_0x2f2971['set']('ai.assistant.commands',_0x13a285);}}function qn(_0x155483){return[{'groupId':'editOrReview','groupLabel':Fn(_0x155483,'Edit\x20or\x20review'),'commands':[{'id':'improveWriting','label':Fn(_0x155483,'Improve\x20writing'),'prompt':'Fix\x20spelling\x20mistakes,\x20use\x20proper\x20grammar\x20and\x20apply\x20good\x20writing\x20practices.\x20Do\x20not\x20lose\x20the\x20original\x20meaning.'},{'id':'makeShorter','label':Fn(_0x155483,'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':Fn(_0x155483,'Make\x20longer'),'prompt':'Improve\x20this\x20content\x20by\x20using\x20descriptive\x20language\x20and\x20inserting\x20more\x20information\x20and\x20more\x20detailed\x20explanations.'},{'id':'simplifyLanguage','label':Fn(_0x155483,'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':Fn(_0x155483,'Generate\x20from\x20selection'),'commands':[{'id':'summarize','label':Fn(_0x155483,'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':Fn(_0x155483,'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':Fn(_0x155483,'Change\x20tone'),'commands':[{'id':'professional','label':Fn(_0x155483,'Professional'),'prompt':'Improve\x20using\x20polished,\x20formal,\x20and\x20respectful\x20language\x20to\x20convey\x20professional\x20expertise\x20and\x20competence.'},{'id':'casual','label':Fn(_0x155483,'Casual'),'prompt':'Improve\x20using\x20casual,\x20informal\x20language\x20to\x20convey\x20a\x20casual\x20conversation\x20with\x20a\x20real\x20person.'},{'id':'direct','label':Fn(_0x155483,'Direct'),'prompt':'Improve\x20using\x20direct\x20language,\x20using\x20only\x20the\x20essential\x20information.'},{'id':'confident','label':Fn(_0x155483,'Confident'),'prompt':'Improve\x20using\x20compelling,\x20optimistic\x20language\x20to\x20convey\x20confidence\x20in\x20the\x20writing.'},{'id':'friendly','label':Fn(_0x155483,'Friendly'),'prompt':'Improve\x20using\x20friendly,\x20comforting\x20language,\x20to\x20convey\x20understanding\x20and\x20empathy.'}]},{'groupId':'changeStyle','groupLabel':Fn(_0x155483,'Change\x20style'),'commands':[{'id':'business','label':Fn(_0x155483,'Business'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20business\x20professional\x20with\x20formal\x20language.'},{'id':'legal','label':Fn(_0x155483,'Legal'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20legal\x20professional\x20using\x20valid\x20legal\x20terminology.'},{'id':'journalism','label':Fn(_0x155483,'Journalism'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20journalist\x20using\x20engaging\x20language\x20to\x20convey\x20the\x20importance\x20of\x20the\x20information.'},{'id':'poetic','label':Fn(_0x155483,'Poetic'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20poem\x20using\x20poetic\x20techniques\x20without\x20losing\x20the\x20original\x20meaning.'}]},{'groupId':'translate','groupLabel':Fn(_0x155483,'Translate'),'commands':[{'id':'translateEnglish','label':Fn(_0x155483,'English'),'prompt':'Translate\x20the\x20content\x20to\x20English\x20language.'},{'id':'translateSpanish','label':Fn(_0x155483,'Spanish'),'prompt':'Translate\x20the\x20content\x20to\x20Spanish\x20language.'},{'id':'translatePortuguese','label':Fn(_0x155483,'Portuguese'),'prompt':'Translate\x20the\x20content\x20to\x20Portuguese\x20language.'},{'id':'translateGerman','label':Fn(_0x155483,'German'),'prompt':'Translate\x20the\x20content\x20to\x20German\x20language.'},{'id':'translateFrench','label':Fn(_0x155483,'French'),'prompt':'Translate\x20the\x20content\x20to\x20French\x20language.'},{'id':'translateChinese','label':Fn(_0x155483,'Simplified\x20Chinese'),'prompt':'Translate\x20the\x20content\x20to\x20Simplified\x20Chinese\x20language.'},{'id':'translateHindi','label':Fn(_0x155483,'Hindi'),'prompt':'Translate\x20the\x20content\x20to\x20Hindi\x20language.'},{'id':'translateArabic','label':Fn(_0x155483,'Arabic'),'prompt':'Translate\x20the\x20content\x20to\x20Arabic\x20language.'}]}];}class pe extends _0x346ac8{['abortController'];static get['requires'](){return[K];}constructor(_0x1044e6){super(_0x1044e6),this['abortController']=new AbortController();}['init'](){this['editor']['plugins']['get'](K)['textAdapter']=this;}['abort'](){this['abortController']['signal']['aborted']||(this['abortController']['abort'](),this['abortController']=new AbortController());}async['makeRequest'](_0x2ce306){return this['sendRequest'](_0x2ce306)['catch'](_0xfdfe14=>{if(_0xfdfe14 instanceof tr)return Promise['reject'](_0xfdfe14);if('AbortError'==_0xfdfe14['name'])return Promise['resolve']();throw console['error'](_0xfdfe14),new _0x36b126('aitextadapter-send-request-failed',null);});}async['_prepareRequestHeaders'](_0x4b8f68,_0x257317){const _0x1af8a2=this['editor']['locale'],_0x218224={'Content-Type':'application/json'};if('object'==typeof _0x4b8f68)Object['assign'](_0x218224,_0x4b8f68);else{if(_0x4b8f68)try{const _0x10515c=await _0x4b8f68(_0x257317);Object['assign'](_0x218224,_0x10515c);}catch{return Promise['reject'](new tr(Fn(_0x1af8a2,'AI_ERROR_GET_HEADERS')));}}return _0x218224;}async['_prepareRequestParameters'](_0x456eaa,_0x311abb){const _0x127858=this['editor']['locale'];if('object'==typeof _0x456eaa)return _0x456eaa;try{return await _0x456eaa(_0x311abb);}catch{return Promise['reject'](new tr(Fn(_0x127858,'AI_ERROR_GET_PARAMETERS')));}}}class Qn extends pe{['_apiUrl'];['_requestHeaders'];['_requestParameters'];static get['pluginName'](){return'OpenAITextAdapter';}constructor(_0x5a3b61){super(_0x5a3b61),_0x5a3b61['config']['define']('ai.assistant.adapter.openAI.apiUrl','https://api.openai.com/v1/chat/completions'),_0x5a3b61['config']['get']('ai.assistant.adapter.openAI.requestParameters')||_0x5a3b61['config']['define']('ai.assistant.adapter.openAI.requestParameters',{'model':'gpt-4o','temperature':0x1,'top_p':0x1,'stream':!0x0}),this['_apiUrl']=_0x5a3b61['config']['get']('ai.assistant.adapter.openAI.apiUrl'),this['_requestHeaders']=_0x5a3b61['config']['get']('ai.assistant.adapter.openAI.requestHeaders')||{},this['_requestParameters']=_0x5a3b61['config']['get']('ai.assistant.adapter.openAI.requestParameters');}async['sendRequest']({query:_0x4babba,context:_0x5a7558,onData:_0x8d7d2b,actionId:_0x46b86f}){const _0x318d87=this['editor']['locale'],_0x1caf7e=await this['prepareMessages'](_0x4babba,_0x5a7558,_0x46b86f),_0x537f15=await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x46b86f),_0x3b0a34=await this['_prepareRequestParameters'](this['_requestParameters'],_0x46b86f),_0x4f2987={'messages':_0x1caf7e,..._0x3b0a34},_0x357971={'method':'POST','headers':_0x537f15,'body':JSON['stringify'](_0x4f2987),'signal':this['abortController']['signal']},_0x4855ca=await fetch(this['_apiUrl'],_0x357971);if(_0x4855ca['ok'])return _0x3b0a34['stream']?await this['_readStreamableResponse'](_0x4855ca,_0x8d7d2b):await this['_readStaticResponse'](_0x4855ca,_0x8d7d2b),Promise['resolve']();{const _0x3a2512=await _0x4855ca['text']();return _0x3a2512['includes']('context_length_exceeded')?Promise['reject'](new tr(Fn(_0x318d87,'AI_ERROR_CONTEXT_LENGTH'))):_0x3a2512['includes']('Moderation')?Promise['reject'](new tr(Fn(_0x318d87,'AI_ERROR_MODERATION'))):Promise['reject'](new Error(_0x3a2512));}}async['prepareMessages'](_0x33bf70,_0x35d87c,_0x4bd584){let _0x37df98,_0x14fe0f;return _0x35d87c?(_0x37df98='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.',_0x14fe0f='Instruction:\x0a'+_0x33bf70+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x35d87c):(_0x37df98='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.',_0x14fe0f=_0x33bf70),[{'role':'system','content':_0x37df98},{'role':'user','content':_0x14fe0f}];}async['_readStreamableResponse'](_0x551e2f,_0x35405b){const _0x1243c2=_0x551e2f['body']['getReader'](),_0x514dfa=new TextDecoder();let _0x23c3ee='',_0x19ebb2='',_0x1eabc2='',_0x278b5d=!0x1;for(;!_0x278b5d;){const {done:_0x5265cc,value:_0x5f4623}=await _0x1243c2['read'](),_0x330783=_0x23c3ee+_0x514dfa['decode'](_0x5f4623);let _0x293c6d='';_0x278b5d=_0x5265cc;try{_0x293c6d=this['_cleanUpData'](_0x330783),_0x23c3ee='';}catch{_0x23c3ee=_0x330783;continue;}_0x19ebb2+=_0x293c6d,!_0x278b5d&&this['_isBufferIncomplete'](_0x19ebb2)||_0x19ebb2&&(_0x1eabc2+=_0x19ebb2,_0x19ebb2='',_0x35405b(_0x1eabc2));}return Promise['resolve']();}async['_readStaticResponse'](_0x258ea7,_0x543673){return _0x543673((await _0x258ea7['json']())['choices'][0x0]['message']['content']),Promise['resolve']();}['_isBufferIncomplete'](_0xd3920f){const _0x28f042=_0xd3920f['split']('<')['length']!==_0xd3920f['split']('>')['length'],_0x3d1856=_0xd3920f['length']<0x1e;return _0x28f042&&_0x3d1856;}['_cleanUpData'](_0x322127){return _0x322127['split'](/\n(?![^{]*\})/g)['map'](_0x38aa07=>_0x38aa07['replace']('data:\x20',''))['filter'](_0x12227d=>_0x12227d&&_0x12227d['length']>0x0&&'[DONE]'!==_0x12227d)['map'](_0x4d754c=>{const {choices:_0xd35499}=JSON['parse'](_0x4d754c);if(_0xd35499[0x0]?.['delta']?.['content'])return _0xd35499[0x0]['delta']['content'];})['filter'](_0x38fc8d=>_0x38fc8d)['join']('');}}class Xn extends pe{['_apiUrl'];['_requestHeaders'];['_bedrockClientConfig'];['_requestParameters'];static get['pluginName'](){return'AWSTextAdapter';}constructor(_0x31739b){super(_0x31739b),_0x31739b['config']['get']('ai.assistant.adapter.aws.requestParameters')||_0x31739b['config']['define']('ai.assistant.adapter.aws.requestParameters',{'model':'anthropic.claude-v2','max_tokens_to_sample':0x7d0,'temperature':0x1,'top_p':0x1,'top_k':0xfa,'anthropic_version':'bedrock-2023-05-31','stream':!0x0}),this['_apiUrl']=_0x31739b['config']['get']('ai.assistant.adapter.aws.apiUrl'),this['_bedrockClientConfig']=_0x31739b['config']['get']('ai.assistant.adapter.aws.bedrockClientConfig'),this['_requestHeaders']=_0x31739b['config']['get']('ai.assistant.adapter.aws.requestHeaders'),this['_requestParameters']=_0x31739b['config']['get']('ai.assistant.adapter.aws.requestParameters');}async['sendRequest']({query:_0x46ea4a,context:_0x25d67e,onData:_0x20534d,actionId:_0x5f5567}){const {model:_0x32bfe8,stream:_0x53ae03,..._0x4d607e}=await this['_prepareRequestParameters'](this['_requestParameters'],_0x5f5567),_0x41e8fb={'prompt':await this['preparePrompt'](_0x46ea4a,_0x25d67e,_0x32bfe8,_0x5f5567),..._0x4d607e};this['_apiUrl']?await this['_processProxyRequest'](_0x41e8fb,_0x32bfe8,_0x53ae03,_0x20534d,_0x5f5567):await this['_processAWSRequest'](_0x41e8fb,_0x32bfe8,_0x53ae03,_0x20534d);}async['preparePrompt'](_0x5d771e,_0x3526d6,_0xc477e5,_0x1ed3ad){let _0x49b70d,_0x39f092;return _0x3526d6?(_0x49b70d='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.',_0x39f092='Instruction:\x0a'+_0x5d771e+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x3526d6):(_0x49b70d='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.',_0x39f092=_0x5d771e),'meta.llama'==this['getModelFamily'](_0xc477e5)?'<<SYS>>\x0a'+_0x49b70d+'\x0a<</SYS>>\x0a[INST]\x0a'+_0x39f092+'\x0a[/INST]':'Human:\x0a'+_0x49b70d+'\x0a'+_0x39f092+'\x0a\x0aAssistant:';}['getModelFamily'](_0xe268b){if(/^anthropic\.claude/['test'](_0xe268b))return'anthropic.claude';if(/^ai21\.j2/['test'](_0xe268b))return'ai21.j2';if(/^cohere\.command/['test'](_0xe268b))return'cohere.command';if(/^meta\.llama/['test'](_0xe268b))return'meta.llama';throw new tr(Fn(this['editor']['locale'],'AI_ERROR_UNSUPPORTED_MODEL',_0xe268b));}async['_processProxyRequest'](_0xbf05f2,_0x7b5136,_0x2de5f7,_0x505130,_0x2241ae){const _0x58f490={'method':'POST','headers':await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x2241ae),'body':JSON['stringify']({..._0xbf05f2,'model':_0x7b5136,'stream':_0x2de5f7}),'signal':this['abortController']['signal']},_0x34dba1=await fetch(this['_apiUrl'],_0x58f490);_0x2de5f7?await this['_readStreamableResponse'](_0x34dba1,_0x7b5136,_0x505130):await this['_readStaticResponse'](_0x34dba1,_0x7b5136,_0x505130);}async['_processAWSRequest'](_0x4dfaa7,_0x5b2764,_0x58f0fa,_0x1ee385){const _0x5267a8=new _0x3bdc8d(this['_bedrockClientConfig']),_0x33bf18={'body':JSON['stringify'](_0x4dfaa7),'contentType':'application/json','accept':'application/json','modelId':_0x5b2764};let _0x19ce39;if(_0x58f0fa){const _0x5cb209=new _0x26e8c7(_0x33bf18);_0x19ce39=await _0x5267a8['send'](_0x5cb209,{'abortSignal':this['abortController']['signal']}),await this['_readAsyncIterableResponse'](_0x19ce39,_0x5b2764,_0x1ee385);}else{const _0x411575=new _0x62d133(_0x33bf18);_0x19ce39=await _0x5267a8['send'](_0x411575,{'abortSignal':this['abortController']['signal']}),await this['_readStaticResponse'](_0x19ce39,_0x5b2764,_0x1ee385);}}async['_readAsyncIterableResponse'](_0x27bc32,_0x5a7524,_0x361a72){const _0x52cc07=_0x27bc32['body'],_0x2abccf=new TextDecoder('utf-8');let _0x5a4f51='';for await(const _0x2197ba of _0x52cc07)if(_0x2197ba['chunk']){const _0x41927e=_0x2abccf['decode'](_0x2197ba['chunk']['bytes']),_0x27e990=JSON['parse'](_0x41927e);_0x5a4f51+=this['_getGeneratedText'](_0x27e990,_0x5a7524),_0x361a72(_0x5a4f51);}return Promise['resolve']();}async['_readStreamableResponse'](_0xc6e31d,_0x2883c2,_0x1409a1){const _0x5f29e5=_0xc6e31d['body'],_0x2ad50a=new TextDecoder('utf-8'),_0x42e4ec=_0x5f29e5['getReader']();let _0xe45f8d='',_0x329c7c='',_0x44ea3c=!0x1;for(;!_0x44ea3c;){const {done:_0x505baa,value:_0x50b698}=await _0x42e4ec['read']();if(_0x44ea3c=_0x505baa,_0x44ea3c)break;const _0x3dd891=(_0xe45f8d+_0x2ad50a['decode'](_0x50b698))['split']('\x0a')['map'](_0x177fb2=>{try{return _0xe45f8d='',JSON['parse'](_0x177fb2);}catch{return _0xe45f8d=_0x177fb2,null;}})['filter'](_0x4836a1=>null!==_0x4836a1);_0x3dd891['length']&&(_0x329c7c+=_0x3dd891['map'](_0x227135=>this['_getGeneratedText'](_0x227135,_0x2883c2))['join'](''),_0x1409a1(_0x329c7c));}return Promise['resolve']();}async['_readStaticResponse'](_0x5f12d5,_0x14af97,_0x4b5731){let _0x16f8dd;return _0x16f8dd=_0x5f12d5 instanceof Response?await _0x5f12d5['json']():JSON['parse'](new TextDecoder('utf-8')['decode'](_0x5f12d5['body'])),(_0x4b5731(this['_getGeneratedText'](_0x16f8dd,_0x14af97)),Promise['resolve']());}['_getGeneratedText'](_0x2c29dc,_0x80d7c1){switch(this['getModelFamily'](_0x80d7c1)){case'anthropic.claude':return _0x2c29dc['completion'];case'ai21.j2':return _0x2c29dc['completions'][0x0]['data']['text'];case'cohere.command':return _0x2c29dc['generations'][0x0]['text'];case'meta.llama':return _0x2c29dc['generation'];}}}class ia extends _0xcbb426{constructor(_0x1e5357,_0x2b9236={}){super(_0x1e5357),this['isToggleable']=!0x0,this['set']('side',_0x2b9236['side']||'top');const _0x2fc770=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-tab-button',..._0x4a22ae(_0x2b9236['class']||[]),_0x2fc770['to']('side',_0x48e0a6=>'ck-tab-button_'+_0x48e0a6),_0x2fc770['to']('class')]}});}['show'](){this['set']('isVisible',!0x0);}['hide'](){this['set']('isVisible',!0x1);}}class ea extends _0x43effc{['children'];constructor(_0x2f3d20,_0x201b12={}){super(_0x2f3d20);const _0x42ecdb=this['bindTemplate'];this['set']('isVisible',!0x1),this['set']('class',''),this['children']=this['createCollection'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck-tab-panel',..._0x4a22ae(_0x201b12['class']||[]),_0x42ecdb['to']('class'),_0x42ecdb['if']('isVisible','ck-hidden',_0x4751de=>!_0x4751de)]},'children':this['children']});}['show'](){this['set']('isVisible',!0x0);}['hide'](){this['set']('isVisible',!0x1);}}class ss extends _0x43effc{['buttonViews']=this['createCollection']();['panelViews']=this['createCollection']();['_tabs']=new Map();constructor(_0x253d1f,_0x32dd5b={}){super(_0x253d1f),this['set']('class',void 0x0),this['set']('activeTab',null),this['set']('side',_0x32dd5b['side']||'top'),this['set']('isMaximized',!0x1);const _0x4afc04=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset','ck-tabs',..._0x4a22ae(_0x32dd5b['class']||[]),_0x4afc04['to']('side',_0x348f8c=>'ck-tabs_'+_0x348f8c),_0x4afc04['to']('class'),_0x4afc04['to']('isMaximized',_0x43c50a=>_0x43c50a?'ck-ai-tabs_maximized':'')],'tabindex':'0'},'children':[{'tag':'div','attributes':{'class':['ck','ck-tabs__buttons-container',_0x4afc04['to']('side',_0x1fa985=>'ck-tabs__buttons-container_'+_0x1fa985)]},'children':this['buttonViews']},{'tag':'div','attributes':{'class':['ck','ck-tabs__panels-container',_0x4afc04['to']('side',_0x35b57d=>'ck-tabs__panels-container_'+_0x35b57d)]},'children':this['panelViews']},..._0x4a22ae(_0x32dd5b['children']||[])]});}['getTabIds'](){return[...this['_tabs']['keys']()];}['getTab'](_0x1e7c1d){const _0x1c4611=this['_tabs']['get'](_0x1e7c1d);return _0x1c4611||null;}['addTab'](_0x2a0fe5){const _0x111429=this['_setupButton']({'id':_0x2a0fe5['id'],'label':_0x2a0fe5['buttonLabel'],'icon':_0x2a0fe5['buttonIcon'],'order':_0x2a0fe5['order']}),_0x527b04=new ea(this['locale']);return _0x527b04['render'](),_0x2a0fe5['content']&&_0x527b04['children']['add'](_0x2a0fe5['content']),this['panelViews']['add'](_0x527b04),this['_tabs']['set'](_0x2a0fe5['id'],{'button':_0x111429,'panel':_0x527b04,'order':void 0x0!==_0x2a0fe5['order']?_0x2a0fe5['order']:null}),this['fire']('addTab:'+_0x2a0fe5['id'],{'id':_0x2a0fe5['id'],'button':_0x111429,'panel':_0x527b04}),null===this['activeTab']?this['activateTab'](_0x2a0fe5['id']):this['_hidePanel'](_0x2a0fe5['id']),{'button':_0x111429,'panel':_0x527b04};}['activateTab'](_0x19e557){if(null!==_0x19e557&&!this['getTab'](_0x19e557))throw new _0x36b126('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0x19e557});this['activeTab']!==_0x19e557&&(this['activeTab']&&this['_hidePanel'](this['activeTab']),this['activeTab']=_0x19e557,_0x19e557&&this['_showPanel'](_0x19e557),this['fire']('activateTab:'+_0x19e557,_0x19e557));}['showTab'](_0x2b7933){if(!this['getTab'](_0x2b7933))throw new _0x36b126('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0x2b7933});this['_showPanel'](_0x2b7933),this['_showButton'](_0x2b7933),this['fire']('show:'+_0x2b7933,_0x2b7933);}['hideTab'](_0x9c51e5){if(!this['getTab'](_0x9c51e5))throw new _0x36b126('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0x9c51e5});const _0x1a6475=this['activeTab'];this['_hidePanel'](_0x9c51e5),this['_hideButton'](_0x9c51e5);const _0x366024=this['getTabIds']();_0x1a6475===_0x9c51e5&&_0x366024['length']>0x1&&this['activateTab'](_0x366024['find'](_0x4bfde5=>_0x4bfde5!==_0x9c51e5)),this['fire']('hide:'+_0x9c51e5,_0x9c51e5);}['_getPanel'](_0x3cf578){const _0x1122d3=this['_tabs']['get'](_0x3cf578);return _0x1122d3?_0x1122d3['panel']:null;}['_showPanel'](_0x54ec0d){null!==this['activeTab']&&this['activeTab']!==_0x54ec0d||this['_getPanel'](_0x54ec0d)['show']();}['_hidePanel'](_0x524509){const _0x181a04=this['_getPanel'](_0x524509);_0x181a04['isVisible']&&(this['activeTab']===_0x524509&&(this['activeTab']=null),_0x181a04['hide']());}['_getButton'](_0x2094bf){const _0x2ee076=this['_tabs']['get'](_0x2094bf);return _0x2ee076?_0x2ee076['button']:null;}['_showButton'](_0x4fc6b4){this['_getButton'](_0x4fc6b4)['show']();}['_hideButton'](_0x5c612e){this['_getButton'](_0x5c612e)['hide']();}['_setupButton'](_0x3c5360){const _0x59abdd=new ia(this['locale'],{'side':this['side']}),_0x57761a=this['buttonViews'];if(_0x59abdd['set']({'label':_0x3c5360['label'],'icon':_0x3c5360['icon'],'tooltip':!0x0,'withText':!0x0}),_0x59abdd['bind']('isOn')['to'](this,'activeTab',_0x3e55e1=>_0x3e55e1===_0x3c5360['id']),_0x59abdd['bind']('side')['to'](this,'side'),_0x3c5360['order']){const _0xab1422=[...this['_tabs']]['reduce']((_0x40b7cf,_0x30bb1d)=>{const _0x8d1db0=_0x30bb1d[0x0],{order:_0xf69e5f}=_0x30bb1d[0x1];return!_0xf69e5f||_0xf69e5f>_0x3c5360['order']?_0x40b7cf:_0xf69e5f>=_0x40b7cf['order']?{'id':_0x8d1db0,'order':_0xf69e5f}:_0x40b7cf;},{'id':'','order':0x0}),_0x49d3e1=_0x57761a['getIndex'](this['_getButton'](_0xab1422['id']));_0x57761a['add'](_0x59abdd,_0x49d3e1+0x1);}else _0x57761a['add'](_0x59abdd);return _0x59abdd['on']('execute',()=>{this['activateTab'](_0x3c5360['id']);}),_0x59abdd;}}const di=['overlay','sidebar','custom'],ui=['left','right'];class ai extends ss{constructor(_0x379775,_0x60ffc={}){super(_0x379775,_0x60ffc),this['set']('type',_0x60ffc['type']||'sidebar'),this['set']('side',_0x60ffc['side']||'right'),this['set']('isVisible',_0x60ffc['visibleByDefault']??!0x0);const _0xe8a836=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-tabs',_0xe8a836['if']('type','ck-ai-tabs__overlay',_0x532cce=>'overlay'===_0x532cce),_0xe8a836['if']('type','ck-ai-tabs__sidebar',_0x665043=>'sidebar'===_0x665043),_0xe8a836['if']('isVisible','ck-hidden',_0x483d7e=>!_0x483d7e)]}}),this['buttonViews']['on']('add',(_0x288ee2,_0x4daa4c)=>{_0x4daa4c['set']('withText',!0x1);});}}class Ct extends ot{['view'];['container']=null;['showResizeButton']=!0x0;static get['pluginName'](){return'AITabs';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x2dd669){super(_0x2dd669);const _0x298ac1=this['context']['config']['get']('ai.container');if(this['set']('side','right'),!_0x298ac1)throw new _0x36b126('ai-tabs-configuration-not-found');if(void 0x0!==_0x298ac1['showResizeButton']&&(this['showResizeButton']=_0x298ac1['showResizeButton']),'sidebar'!==_0x298ac1['type']&&'overlay'!==_0x298ac1['type']||_0x298ac1['side']&&(this['side']=_0x298ac1['side']),'sidebar'===_0x298ac1['type']){if(this['container']=_0x298ac1['element'],this['set']('type','sidebar'),!this['container'])throw new _0x36b126('ai-tabs-sidebar-container-element-not-found');}else'overlay'===_0x298ac1['type']?(this['container']=document['body'],this['set']('type','overlay')):(this['container']=null,this['set']('type','custom'));this['view']=new ai(this['context']['locale'],{'side':this['side'],'type':this['type'],'visibleByDefault':void 0x0===_0x298ac1['visibleByDefault']||_0x298ac1['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 _t&&this['context']['ui']['focusTracker']['add'](this['view']['element']);}['switchType'](_0x2b06c6){if(_0x2b06c6&&this['type']!==_0x2b06c6){if(!di['includes'](_0x2b06c6))throw new _0x36b126('ai-tabs-unsupported-ui-type');this['type']=_0x2b06c6;}}['switchSide'](_0x210245){if(_0x210245&&this['side']!==_0x210245){if(!ui['includes'](_0x210245))throw new _0x36b126('ai-tabs-unsupported-ui-side');this['side']=_0x210245;}}['resize'](){this['view']['isMaximized']=!this['view']['isMaximized'],this['fire']('resizedTabs',this['view']['isMaximized']);}['destroy'](){super['destroy'](),this['view']['destroy'](),this['view']['element']&&this['view']['element']['remove']();}}class S extends ot{['_apiUrl'];['_token'];['_decoder'];static get['requires'](){return['CloudServices'];}static get['pluginName'](){return'AIConnector';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x111321){super(_0x111321),this['context']['config']['define']('ai.serviceUrl','https://ai.cke-cs.com/v1'),this['_apiUrl']=this['context']['config']['get']('ai.serviceUrl'),this['_token']=null,this['_decoder']=new TextDecoder();}['init'](){const _0x5ec592=this['context']['plugins']['get']('CloudServices');if(!_0x5ec592['token'])throw new _0x36b126('ai-missing-token',this);this['_token']=_0x5ec592['token'];}['startConversation'](_0x5411e7,_0x2aa0bf){const _0x39f303=this['_sendApiRequest']('/conversations','POST',{'id':_0x5411e7,'group':_0x2aa0bf});return{'getConversation':async()=>(await _0x39f303['request'])['json'](),'abortController':_0x39f303['abortController']};}['queryAssistant']({message:_0x37341d,conversationId:_0x13da16,parts:_0x132755,capabilities:_0x256593,model:_0x425bd3,quickActionData:_0x59b4a7}){const _0x1976a3={..._0x59b4a7&&{'quickActionData':_0x59b4a7}},_0x3419c6={'prompt':_0x37341d,'content':_0x132755,'model':_0x425bd3,..._0x256593&&{'capabilities':_0x256593},...Object['keys'](_0x1976a3)['length']>0x0&&{'attributes':_0x1976a3}},_0x3e18dc=this['_sendApiRequest']('/conversations/'+_0x13da16+'/messages','POST',_0x3419c6);return{'getStream':async()=>{const _0x4115eb=(await _0x3e18dc['request'])['body'];return this['_getStreamReader'](_0x4115eb);},'abortController':_0x3e18dc['abortController']};}['executeCustomAction']({content:_0x50c966,message:_0xaac7fa,model:_0x113e1b,outputFormat:_0x4ad9ee}){const _0x2fa3d1={'content':[{'type':'text','content':_0x50c966}],'prompt':_0xaac7fa,'model':_0x113e1b,'outputFormat':_0x4ad9ee},_0x576cfe=this['_sendApiRequest']('/actions/custom/calls','POST',_0x2fa3d1);return{'getStream':async()=>{const _0x2fc5a9=(await _0x576cfe['request'])['body'];return this['_getStreamReader'](_0x2fc5a9);},'abortController':_0x576cfe['abortController']};}['executeAction']({actionName:_0x39e9f8,content:_0xf50fc2,args:_0x1e016d}){const _0x4c5efe={'content':[{'type':'text','content':_0xf50fc2}],'args':_0x1e016d},_0xd3fd18=this['_sendApiRequest']('/actions/system/'+_0x39e9f8+'/calls','POST',_0x4c5efe);return{'getStream':async()=>{const _0x55e8c5=(await _0xd3fd18['request'])['body'];return this['_getStreamReader'](_0x55e8c5);},'abortController':_0xd3fd18['abortController']};}['uploadFile'](_0x58d780,_0x1031d7,_0xb8d0d0){const _0x53ef77=new FormData();_0x53ef77['append']('file',_0x1031d7,_0x1031d7['name']),_0xb8d0d0&&_0x53ef77['append']('attributes',JSON['stringify'](_0xb8d0d0));const _0x411055=this['_sendApiRequest']('/conversations/'+_0x58d780+'/files','POST',_0x53ef77);return{'getId':async()=>(await _0x411055['request'])['json'](),'abortController':_0x411055['abortController']};}['fetchDocument'](_0x33849b,_0x5df37e){const _0x2c8723=this['_sendApiRequest']('/conversations/'+_0x33849b+'/documents/'+_0x5df37e,'GET');return{'getDocument':async()=>(await _0x2c8723['request'])['json'](),'abortController':_0x2c8723['abortController']};}['uploadDocument'](_0x1cbeb0,_0x5c731e,_0x18372d){const _0x3dba94={'content':_0x5c731e};_0x18372d&&(_0x3dba94['attributes']=_0x18372d);const _0x41196e=this['_sendApiRequest']('/conversations/'+_0x1cbeb0+'/documents','POST',_0x3dba94);return{'getId':async()=>(await _0x41196e['request'])['json'](),'abortController':_0x41196e['abortController']};}['fetchConversations'](_0x1ea3da,_0x1a3c84){const _0x2d0bd0=new URLSearchParams();_0x2d0bd0['append']('excludeEmpty','true'),_0x2d0bd0['append']('limit','100'),_0x2d0bd0['append']('group',_0x1ea3da),_0x1a3c84&&_0x2d0bd0['append']('search',_0x1a3c84);const _0x470862=this['_sendApiRequest']('/conversations?'+_0x2d0bd0['toString'](),'GET');return{'getConversations':async()=>{const _0x1b4bee=await _0x470862['request'];return(await _0x1b4bee['json']())['items'];},'abortController':_0x470862['abortController']};}['deleteConversation'](_0x1b3597){const _0x5d3562=this['_sendApiRequest']('/conversations/'+_0x1b3597,'DELETE');return{'execute':async()=>{await _0x5d3562['request'];},'abortController':_0x5d3562['abortController']};}['updateConversation'](_0x258b67,_0x450d16){const _0x3bb5d3=this['_sendApiRequest']('/conversations/'+_0x258b67,'PATCH',_0x450d16);return{'getResult':async()=>(await _0x3bb5d3['request'],_0x450d16),'abortController':_0x3bb5d3['abortController']};}['fetchConversation'](_0x134926){const _0x32b4f9=this['_sendApiRequest']('/conversations/'+_0x134926,'GET');return{'getConversation':async()=>(await _0x32b4f9['request'])['json'](),'abortController':_0x32b4f9['abortController']};}['fetchConversationMessages'](_0x333cc7){const _0x3b33d6=this['_sendApiRequest']('/conversations/'+_0x333cc7+'/messages','GET');return{'getMessages':async()=>{const _0x44e042=await _0x3b33d6['request'];return(await _0x44e042['json']())['items'];},'abortController':_0x3b33d6['abortController']};}['uploadUrl'](_0x53b048,_0x13b34a,_0x13e025){const _0x8a84c0=this['_sendApiRequest']('/conversations/'+_0x53b048+'/web-resources','POST',{'url':_0x13b34a,'attributes':_0x13e025});return{'getId':async()=>(await _0x8a84c0['request'])['json'](),'abortController':_0x8a84c0['abortController']};}['getModels'](_0x2a2bc3='en'){const _0x20b197=new URLSearchParams();_0x20b197['append']('language',_0x2a2bc3);const _0xb8d7bb='/models/1?'+_0x20b197['toString'](),_0x279ab6=this['_sendApiRequest'](_0xb8d7bb,'GET');return{'list':async()=>await(await _0x279ab6['request'])['json'](),'abortController':_0x279ab6['abortController']};}['deleteFile'](_0x38f273,_0x14eba4){const _0x669741=this['_sendApiRequest']('/conversations/'+_0x38f273+'/files/'+_0x14eba4,'DELETE');return{'execute':async()=>{await _0x669741['request'];},'abortController':_0x669741['abortController']};}['deleteDocument'](_0x32bad9,_0x293e03){const _0x484129=this['_sendApiRequest']('/conversations/'+_0x32bad9+'/documents/'+_0x293e03,'DELETE');return{'execute':async()=>{await _0x484129['request'];},'abortController':_0x484129['abortController']};}['deleteWebResource'](_0x3629b7,_0x2b8566){const _0x2493d1=this['_sendApiRequest']('/conversations/'+_0x3629b7+'/web-resources/'+_0x2b8566,'DELETE');return{'execute':async()=>{await _0x2493d1['request'];},'abortController':_0x2493d1['abortController']};}['callSystemReview']({reviewName:_0x2014f3,content:_0x34f507,args:_0x4440e9}){const _0x561fec=this['_sendApiRequest']('/reviews/system/'+_0x2014f3+'/calls','POST',{'content':[{'type':'text','content':_0x34f507}],'args':_0x4440e9});return{'getStream':async()=>{const _0x20069a=(await _0x561fec['request'])['body'];return this['_getStreamReader'](_0x20069a);},'abortController':_0x561fec['abortController']};}['callCustomReview']({content:_0x397038,prompt:_0x2b9e20,model:_0x21af35}){const _0x1853bf=this['_sendApiRequest']('/reviews/custom/calls','POST',{'content':[{'type':'text','content':_0x397038}],'prompt':_0x2b9e20,'model':_0x21af35});return{'getStream':async()=>{const _0x1c6111=(await _0x1853bf['request'])['body'];return this['_getStreamReader'](_0x1c6111);},'abortController':_0x1853bf['abortController']};}['upsertAIChatRating'](_0x17b6a5,_0x3ccd32,_0x11dfb0){const _0x1ba237=this['_sendApiRequest']('/conversations/'+_0x17b6a5+'/messages/'+_0x3ccd32+'/ratings','PUT',{'positiveCount':_0x11dfb0['positiveCount'],'totalCount':_0x11dfb0['totalCount'],'modificationId':_0x11dfb0['modificationId']});return{'execute':async()=>{await _0x1ba237['request'];},'abortController':_0x1ba237['abortController']};}['upsertAIActionRating'](_0x216580,_0x3c6a88,_0x1564c0){const _0x218f57=this['_sendApiRequest']('/actions/system/'+_0x216580+'/calls/'+_0x3c6a88+'/ratings','PUT',{'positiveCount':_0x1564c0['positiveCount'],'totalCount':_0x1564c0['totalCount']});return{'execute':async()=>{await _0x218f57['request'];},'abortController':_0x218f57['abortController']};}['upsertCustomAIActionRating'](_0x32a47a,_0xac5bd8){const _0x4ddd42=this['_sendApiRequest']('/actions/custom/calls/'+_0x32a47a+'/ratings','PUT',{'positiveCount':_0xac5bd8['positiveCount'],'totalCount':_0xac5bd8['totalCount']});return{'execute':async()=>{await _0x4ddd42['request'];},'abortController':_0x4ddd42['abortController']};}['upsertAIReviewRating'](_0x270504,_0x34883a,_0x45ef28,_0x12a8b2){const _0x1436d6=this['_sendApiRequest']('/reviews/system/'+_0x270504+'/calls/'+_0x34883a+'/ratings','PUT',{'positiveCount':_0x45ef28['positiveCount'],'totalCount':_0x45ef28['totalCount'],'dataId':_0x12a8b2});return{'execute':async()=>{await _0x1436d6['request'];},'abortController':_0x1436d6['abortController']};}['upsertCustomAIReviewRating'](_0x24ae0c,_0x16b886,_0x51f51f){const _0x30f555=this['_sendApiRequest']('/reviews/custom/calls/'+_0x24ae0c+'/ratings','PUT',{'positiveCount':_0x16b886['positiveCount'],'totalCount':_0x16b886['totalCount'],'dataId':_0x51f51f});return{'execute':async()=>{await _0x30f555['request'];},'abortController':_0x30f555['abortController']};}['_sendApiRequest'](_0x11598f,_0x21d3de,_0x481bf8){const _0x345a7c=new AbortController(),_0x1c3ee3=_0x481bf8 instanceof FormData,_0x50f365={'Authorization':'Bearer\x20'+this['_token']?.['value']};_0x481bf8&&!_0x1c3ee3&&(_0x50f365['Content-Type']='application/json');const _0x11a304={'method':_0x21d3de,'headers':_0x50f365,'signal':_0x345a7c['signal']};return _0x481bf8&&(_0x11a304['body']=_0x1c3ee3?_0x481bf8:JSON['stringify'](_0x481bf8)),{'request':fetch(''+this['_apiUrl']+_0x11598f,_0x11a304)['catch'](_0x26001f=>{this['_handleError'](_0x26001f);})['then'](_0x37131d=>_0x37131d['ok']?_0x37131d:_0x37131d['json']()['then'](_0x25bff3=>{throw{'url':this['_apiUrl'],'path':_0x11598f,'method':_0x21d3de,'body':_0x481bf8,'status':(_0x37131d||{})['status'],'statusText':(_0x37131d||{})['statusText'],'code':_0x25bff3['code'],'message':_0x25bff3['message'],'traceId':_0x25bff3['traceId']};})),'abortController':_0x345a7c};}async*['_getStreamReader'](_0x59ec02){const _0x28548b=[],_0xef19bb=_0x59ec02['getReader'](),_0x2b6e6e=$t({'onError':_0x33c382=>{this['_handleError'](_0x33c382);},'onEvent':_0x4a8265=>{_0x4a8265['data']=JSON['parse'](_0x4a8265['data']),_0x28548b['push'](_0x4a8265);}});try{let _0x1b4aec=!0x1;for(;!_0x1b4aec;){const {done:_0x1f4ef1,value:_0x415da9}=await _0xef19bb['read']();_0x1f4ef1&&(_0x1b4aec=!0x0),_0x2b6e6e['feed'](this['_decoder']['decode'](_0x415da9,{'stream':!0x0})),yield*_0x28548b,_0x28548b['length']=0x0;}}catch(_0xa311db){this['_handleError'](_0xa311db);}finally{_0xef19bb['releaseLock'](),_0x2b6e6e['reset']();}}['_handleError'](_0x38dbf5){if(_0x38dbf5 instanceof _0x36b126)throw _0x38dbf5;if(_0x38dbf5 instanceof Error&&'AbortError'===_0x38dbf5['name'])throw new _0x36b126('ai-request-aborted',this,{'originalError':_0x38dbf5});throw new _0x36b126('ai-request-failed',this,{'originalError':_0x38dbf5});}}function i(_0x36057f,_0x5ded23,_0x186b2e){const t=_0x36057f['t'];switch(_0x5ded23){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'},_0x186b2e);case'AI_SUGGESTION_CONTENT_PART_REJECTED':return t({'id':'AI_SUGGESTION_CONTENT_PART_REJECTED','string':'Change\x20was\x20rejected'});case'AI_SUGGESTION_CONTENT_PART_OUTDATED':return t({'id':'AI_SUGGESTION_CONTENT_PART_OUTDATED','string':'Change\x20is\x20outdated'});case'AI_SUGGESTION_CONTENT_PART_ALREADY_APPLIED':return t({'id':'AI_SUGGESTION_CONTENT_PART_ALREADY_APPLIED','string':'Change\x20is\x20already\x20applied'});case'AI_SUGGESTION_CONTENT_PART_SHOW_IN_THE_TEXT':return t({'id':'AI_SUGGESTION_CONTENT_PART_SHOW_IN_THE_TEXT','string':'Preview'});case'AI_SUGGESTION_CONTENT_PART_ADD_AS_SUGGESTION':return t({'id':'AI_SUGGESTION_CONTENT_PART_ADD_AS_SUGGESTION','string':'Insert\x20as\x20suggestion'});case'AI_SUGGESTION_CONTENT_PART_DELETE':return t({'id':'AI_SUGGESTION_CONTENT_PART_DELETE','string':'Reject'});case'AI_SUGGESTION_CONTENT_PART_REMOVED':return t({'id':'AI_SUGGESTION_CONTENT_PART_REMOVED','string':'Removed\x20content.\x20Use\x20\x22Show\x20details\x22\x20to\x20learn\x20more.'});case'AI_DISCLAIMER_TEXT':return t({'id':'AI_DISCLAIMER_TEXT','string':'AI\x20can\x20make\x20mistakes.\x20Please\x20double-check\x20responses.'});case'AI_TABS_LABEL_MAXIMIZE':return t({'id':'AI_TABS_LABEL_MAXIMIZE','string':'Maximize'});case'AI_TABS_LABEL_MINIMIZE':return t({'id':'AI_TABS_LABEL_MINIMIZE','string':'Minimize'});case'AI_CHAT_HEADING':return t({'id':'AI_CHAT_HEADING','string':'Chat'});case'AI_CHAT_SOURCES_HEADER':return t({'id':'AI_CHAT_SOURCES_HEADER','string':'Sources'});case'AI_CHAT_UNTITLED_CONVERSATION':return t({'id':'AI_CHAT_UNTITLED_CONVERSATION','string':'Untitled\x20conversation'});case'AI_CHAT_LABEL_NEW_CHAT':return t({'id':'AI_CHAT_LABEL_NEW_CHAT','string':'New\x20chat'});case'AI_CHAT_STOP_GENERATING':return t({'id':'AI_CHAT_STOP_GENERATING','string':'Stop\x20generating'});case'AI_CHAT_IS_WRITING':return t({'id':'AI_CHAT_IS_WRITING','string':'AI\x20is\x20writing...'});case'AI_CHAT_PROMPT_EMPTY_ERROR':return t({'id':'AI_CHAT_PROMPT_EMPTY_ERROR','string':'This\x20field\x20cannot\x20be\x20empty.'});case'AI_CHAT_LABEL_SUBMIT':return t({'id':'AI_CHAT_LABEL_SUBMIT','string':'Submit'});case'AI_CHAT_WELCOME_MESSAGE':return t({'id':'AI_CHAT_WELCOME_MESSAGE','string':'Hi,\x20I\x27m\x20your\x20AI\x20assistant.\x20Think\x20of\x20me\x20as\x20your\x20writing\x20buddy,\x20reviewer,\x20or\x20research\x20partner.\x20I\x20can\x20suggest\x20changes\x20to\x20your\x20document,\x20help\x20generate\x20ideas,\x20offer\x20feedback,\x20discuss\x20attached\x20files,\x20and\x20much\x20more!'});case'AI_CHAT_ABORTED_MESSAGE':return t({'id':'AI_CHAT_ABORTED_MESSAGE','string':'The\x20request\x20was\x20aborted.'});case'AI_CHAT_GENERIC_ERROR':return t({'id':'AI_CHAT_GENERIC_ERROR','string':'Something\x20went\x20wrong\x20while\x20processing\x20your\x20request.\x20Please\x20try\x20again.'});case'AI_CHAT_UNABLE_TO_START_CONVERSATION':return t({'id':'AI_CHAT_UNABLE_TO_START_CONVERSATION','string':'Unable\x20to\x20start\x20conversation.\x20Please\x20make\x20sure\x20you\x20are\x20online\x20and\x20try\x20again.'});case'AI_CHAT_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.'},_0x186b2e);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.'},_0x186b2e);case'AI_CHAT_RESOURCE_LOAD_FAILED':return t({'id':'AI_CHAT_RESOURCE_LOAD_FAILED','string':'Failed\x20to\x20load\x20resource.\x20Please\x20try\x20again.'});case'AI_CHAT_CONTEXT_CURRENT_DOCUMENT':return t({'id':'AI_CHAT_CONTEXT_CURRENT_DOCUMENT','string':'Current\x20document'});case'AI_CHAT_CONTEXT_REMOVE_FROM_CONTEXT':return t({'id':'AI_CHAT_CONTEXT_REMOVE_FROM_CONTEXT','string':'Remove\x20from\x20context'});case'AI_CHAT_CONTEXT_ADD_CONTEXT':return t({'id':'AI_CHAT_CONTEXT_ADD_CONTEXT','string':'Add\x20context'});case'AI_CHAT_CONTEXT_URL_LABEL':return t({'id':'AI_CHAT_CONTEXT_URL_LABEL','string':'URL'});case'AI_CHAT_CONTEXT_FILE_LABEL':return t({'id':'AI_CHAT_CONTEXT_FILE_LABEL','string':'File'});case'AI_CHAT_CONTEXT_CURRENT_CONTEXT_LABEL':return t({'id':'AI_CHAT_CONTEXT_CURRENT_CONTEXT_LABEL','string':'Current\x20context'});case'AI_CHAT_SEARCH_WEB':return t({'id':'AI_CHAT_SEARCH_WEB','string':'Web\x20search'});case'AI_CHAT_ENABLE_WEB_SEARCH':return t({'id':'AI_CHAT_ENABLE_WEB_SEARCH','string':'Enable\x20web\x20search'});case'AI_CHAT_DISABLE_WEB_SEARCH':return t({'id':'AI_CHAT_DISABLE_WEB_SEARCH','string':'Disable\x20web\x20search'});case'AI_CHAT_REASONING':return t({'id':'AI_CHAT_REASONING','string':'Reasoning'});case'AI_CHAT_ENABLE_REASONING':return t({'id':'AI_CHAT_ENABLE_REASONING','string':'Enable\x20reasoning'});case'AI_CHAT_DISABLE_REASONING':return t({'id':'AI_CHAT_DISABLE_REASONING','string':'Disable\x20reasoning'});case'AI_CHAT_COMMANDS':return t({'id':'AI_CHAT_COMMANDS','string':'Commands'});case'AI_CHAT_SEARCH_RESOURCES':return t({'id':'AI_CHAT_SEARCH_RESOURCES','string':'Search\x20resources'});case'AI_CHAT_CONTEXT_URL_BACK_TO_CONTEXT':return t({'id':'AI_CHAT_CONTEXT_URL_BACK_TO_CONTEXT','string':'Back\x20to\x20context\x20options'});case'AI_CHAT_CONTEXT_URL_ADD_URL':return t({'id':'AI_CHAT_CONTEXT_URL_ADD_URL','string':'Add\x20URL'});case'AI_CHAT_CONTEXT_URL_PLACEHOLDER':return t({'id':'AI_CHAT_CONTEXT_URL_PLACEHOLDER','string':'Add\x20URL...'});case'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_URL':return t({'id':'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_URL','string':'Failed\x20to\x20upload\x20URL:\x20%0.\x20Please\x20try\x20again.'},_0x186b2e);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_SHOW_CHANGE_IN_TEXT':return t({'id':'AI_CHAT_SUGGESTION_ACTION_SHOW_CHANGE_IN_TEXT','string':'Preview','plural':'Preview'},_0x186b2e);case'AI_CHAT_SUGGESTION_ACTION_SHOW_CHANGE_IN_TEXT_TOOLTIP':return t({'id':'AI_CHAT_SUGGESTION_ACTION_SHOW_CHANGE_IN_TEXT_TOOLTIP','string':'Show\x20change\x20in\x20the\x20document','plural':'Show\x20changes\x20in\x20the\x20document'},_0x186b2e);case'AI_CHAT_SUGGESTION_ACTION_INSERT_SUGGESTION':return t({'id':'AI_CHAT_SUGGESTION_ACTION_INSERT_SUGGESTION','string':'Suggest','plural':'Suggest'},_0x186b2e);case'AI_CHAT_SUGGESTION_ACTION_INSERT_SUGGESTION_TOOLTIP':return t({'id':'AI_CHAT_SUGGESTION_ACTION_INSERT_SUGGESTION_TOOLTIP','string':'Insert\x20change\x20as\x20suggestion','plural':'Insert\x20changes\x20as\x20suggestions'},_0x186b2e);case'AI_CHAT_SUGGESTION_ACTION_APPLY_LABEL':return t({'id':'AI_CHAT_SUGGESTION_ACTION_APPLY_LABEL','string':'Apply','plural':'Apply\x20all'},_0x186b2e);case'AI_CHAT_SUGGESTION_ACTION_APPLY_TOOLTIP':return t({'id':'AI_CHAT_SUGGESTION_ACTION_APPLY_TOOLTIP','string':'Apply\x20changes\x20immediately','plural':'Apply\x20all\x20changes\x20immediately'},_0x186b2e);case'AI_CHAT_SUGGESTION_MORE_OPTIONS_TOOLTIP':return t({'id':'AI_CHAT_SUGGESTION_MORE_OPTIONS_TOOLTIP','string':'More\x20options'},_0x186b2e);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.'},_0x186b2e);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.'},_0x186b2e);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.'},_0x186b2e);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.'},_0x186b2e);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'},_0x186b2e);case'AI_BALLOON_APPLY_BUTTON':return t({'id':'AI_BALLOON_APPLY_BUTTON','string':'Apply'});case'AI_BALLOON_SUGGEST_BUTTON':return t({'id':'AI_BALLOON_SUGGEST_BUTTON','string':'Suggest'});case'AI_BALLOON_NEXT_TOOLTIP':return t({'id':'AI_BALLOON_NEXT_TOOLTIP','string':'Next'});case'AI_BALLOON_PREVIOUS_TOOLTIP':return t({'id':'AI_BALLOON_PREVIOUS_TOOLTIP','string':'Previous'});case'AI_SUGGESTION_NO_PARTS_WARNING':return t({'id':'AI_SUGGESTION_NO_PARTS_WARNING','string':'This\x20change\x20is\x20not\x20supported\x20by\x20the\x20editor\x20and\x20can\x27t\x20be\x20previewed\x20or\x20applied.'});case'AI_SUGGESTION_EMPTY_PART_WARNING':return t({'id':'AI_SUGGESTION_EMPTY_PART_WARNING','string':'Some\x20of\x20the\x20changes\x20are\x20not\x20supported\x20by\x20the\x20editor\x20and\x20can\x27t\x20be\x20previewed\x20or\x20applied.'});case'AI_ACTIONS_TRY_AGAIN':return t({'id':'AI_ACTIONS_TRY_AGAIN','string':'Retry'});case'AI_ACTIONS_PREVIOUS_INTERACTION':return t({'id':'AI_ACTIONS_PREVIOUS_INTERACTION','string':'Previous'});case'AI_ACTIONS_NEXT_INTERACTION':return t({'id':'AI_ACTIONS_NEXT_INTERACTION','string':'Next'});case'AI_MODEL_NAME_AUTO':return t({'id':'AI_MODEL_NAME_AUTO','string':'Auto'});case'AI_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.'},_0x186b2e);case'AI_QUICK_ACTIONS_OTHER':return t({'id':'AI_QUICK_ACTIONS_OTHER','string':'Other'});case'AI_ACTIONS_GENERIC_ERROR':return t({'id':'AI_ACTIONS_GENERIC_ERROR','string':'Sorry,\x20we\x20couldn\x27t\x20generate\x20the\x20response.\x20Please\x20try\x20again\x20in\x20a\x20moment.'});case'AI_ACTIONS_SELECTION_REMOVED_ERROR':return t({'id':'AI_ACTIONS_SELECTION_REMOVED_ERROR','string':'Changes\x20cannot\x20be\x20applied.\x20The\x20original\x20content\x20no\x20longer\x20exists.'});case'AI_REVIEW_MODE_STOP_GENERATING':return t({'id':'AI_REVIEW_MODE_STOP_GENERATING','string':'Stop\x20generating'});case'AI_REVIEW_MODE_HIDE_CHANGES':return t({'id':'AI_REVIEW_MODE_HIDE_CHANGES','string':'Hide\x20changes'});case'AI_REVIEW_MODE_SHOW_CHANGES':return t({'id':'AI_REVIEW_MODE_SHOW_CHANGES','string':'Show\x20changes'});case'AI_REVIEW_MODE_ACCEPT_ALL':return t({'id':'AI_REVIEW_MODE_ACCEPT_ALL','string':'Accept\x20all'});case'AI_REVIEW_MODE_EXIT_REVIEW':return t({'id':'AI_REVIEW_MODE_EXIT_REVIEW','string':'Exit\x20review'});case'AI_REVIEW_MODE_ACCEPT_CHANGE':return t({'id':'AI_REVIEW_MODE_ACCEPT_CHANGE','string':'Accept'});case'AI_REVIEW_MODE_DISMISS_CHANGE':return t({'id':'AI_REVIEW_MODE_DISMISS_CHANGE','string':'Dismiss'});case'AI_REVIEW_MODE_LEARN_MORE':return t({'id':'AI_REVIEW_MODE_LEARN_MORE','string':'Learn\x20more'});case'AI_REVIEW_MODE_COMPLETED_TEXT':return t({'id':'AI_REVIEW_MODE_COMPLETED_TEXT','string':'There\x27s\x20nothing\x20left\x20to\x20review.'});case'AI_REVIEW_MODE_EMPTY_RESULTS_TEXT':return t({'id':'AI_REVIEW_MODE_EMPTY_RESULTS_TEXT','string':'There\x20are\x20no\x20changes\x20to\x20suggest.'});case'AI_REVIEW_MODE_FINISH_REVIEW_BUTTON_LABEL':return t({'id':'AI_REVIEW_MODE_FINISH_REVIEW_BUTTON_LABEL','string':'Finish\x20Review'});case'AI_REVIEW_MODE_FINISH_REVIEW_HEADER_TITLE':return t({'id':'AI_REVIEW_MODE_FINISH_REVIEW_HEADER_TITLE','string':'Review\x20complete.\x20Finish\x20when\x20ready.'});case'AI_REVIEW_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'});default:return _0x5ded23;}}function ks(_0x470975,_0x53e4b6){const _0x4f6114=new _0xcbb426(_0x470975),_0x577857=i(_0x470975,'AI_TABS_LABEL_MINIMIZE'),_0x338cfb=i(_0x470975,'AI_TABS_LABEL_MAXIMIZE');return _0x4f6114['set']({'withText':!0x1,'icon':_0x5502eb,'tooltip':!0x0,'class':'ck-ai-tabs__resize\x20ck-ai-button-tertiary-text'}),_0x4f6114['bind']('label')['to'](_0x53e4b6,'isMaximized',_0x370ebe=>_0x370ebe?_0x577857:_0x338cfb),_0x4f6114['bind']('icon')['to'](_0x53e4b6,'isMaximized',_0x20ebb8=>_0x20ebb8?to:_0x5502eb),_0x4f6114['bind']('isOn')['to'](_0x53e4b6,'isMaximized'),_0x4f6114['on']('execute',()=>{_0x53e4b6['fire']('resizeTabs');}),_0x4f6114;}function He(_0x39b3a6){return _0x3254d4(_0x39b3a6);}function Ot(_0x10d23f){return _0x4b71ff(_0x10d23f);}function Dt(_0x28adf6,_0x46eb73,_0x690c01){const _0x23b483=null!==_0x46eb73?_0x127383=>_0x127383['attribs'][_0x28adf6]===_0x46eb73:_0x3e8e36=>Boolean(_0x3e8e36['attribs'][_0x28adf6]);return St(_0x1808cf=>_0x499346(_0x1808cf)&&_0x23b483(_0x1808cf),_0x690c01);}function Ze(_0x560a41,_0x2273b6,_0x32bfa6){const _0x3f1625=null!==_0x2273b6?_0x2f189c=>_0x2f189c['attribs'][_0x560a41]===_0x2273b6:_0x166aeb=>Boolean(_0x166aeb['attribs'][_0x560a41]);return _0x4a6dcc(_0x1d8592=>_0x499346(_0x1d8592)&&_0x3f1625(_0x1d8592),_0x32bfa6);}function vt(_0x4455e4,_0x373b21){return _0x4455e4&&_0x499346(_0x4455e4)?_0x4455e4['attribs'][_0x373b21]:null;}function Ji(_0x574f01,_0x5092db,_0x2c8c36){_0x499346(_0x574f01)&&(null===_0x2c8c36?delete _0x574f01['attribs'][_0x5092db]:_0x574f01['attribs'][_0x5092db]=_0x2c8c36);}function Wi(_0x453acd,_0x526001,_0x100e61){const _0x3006b4=_0x526001['cloneNode'](!0x0);'beforebegin'===_0x100e61?_0x4c7871(_0x453acd,_0x3006b4):'afterbegin'===_0x100e61?_0x377b76(_0x453acd,_0x3006b4):'beforeend'===_0x100e61?_0x19757f(_0x453acd,_0x3006b4):'afterend'===_0x100e61&&_0x2301a3(_0x453acd,_0x3006b4);}function qe(_0x20105a){const _0x5384cf=[];let _0x548b4a=_0x20105a;for(;_0x548b4a;)_0x548b4a=_0x5d775c(_0x548b4a),_0x548b4a&&_0x5384cf['push'](_0x548b4a);return _0x5384cf;}function zn(_0xdbb244){return _0xdbb244['replace'](/^\s+/gm,'')['replace'](/\s+$/gm,'')['replace'](/\n*/g,'')['replace'](/\s+/g,'\x20')['replace'](/>\s*</g,'><');}function Xi(_0x1cc3ff){let _0x55cc11=0x0;for(;_0x1cc3ff['parentNode'];)_0x1cc3ff=_0x1cc3ff['parentNode'],_0x55cc11++;return _0x55cc11;}function $i(_0x181db0){const _0x1e7b38=[];let _0x1b82d3=_0x181db0['nextSibling'];for(;_0x1b82d3;)_0x1e7b38['push'](_0x1b82d3),_0x1b82d3=_0x1b82d3['nextSibling'];_0x1e7b38['forEach'](_0x4e5fee=>{_0x1b183f(_0x4e5fee);});}class Ke extends/* #__PURE__ -- @preserve */
|
|
25
|
-
ts(){['_m2html'];constructor(){super(),this['_m2html']=new
|
|
26
|
-
ts(){['_generateUid'];['_touchedNodesState']={'newIds':[],'modifiedIds':[],'removedIds':[],'invalidIds':[],'lastTouchedId':null};['_existingDataIds']=new Set();constructor(_0x5303a1){super(),this['_generateUid']=_0x5303a1||_0xdc126c;}['merge'](_0x33ac8d,_0x10e40e,_0x25ced6){const _0x112a13=_0x33ac8d['cloneNode'](!0x0);if(0x0===_0x10e40e['childNodes']['length']){const _0x1c432c=[];return Ze('data-id','new-element',_0x112a13)['forEach'](_0x30a8f3=>{const _0xc5b46b=this['_generateUid']();Ji(_0x30a8f3,'data-id',_0xc5b46b),_0x1c432c['push'](_0xc5b46b);}),this['_removeSpecialComments'](_0x112a13),{'parsedContent':_0x112a13,'newNodeIds':_0x1c432c,'modifiedNodeIds':[],'removedNodeIds':[]};}_0x25ced6&&_0x25ced6['markUnstableElements']&&this['_markLastTagElementUnstable'](_0x112a13),this['_touchedNodesState']['newIds']=[],this['_touchedNodesState']['modifiedIds']=[],this['_touchedNodesState']['removedIds']=[],this['_touchedNodesState']['invalidIds']=[],this['_touchedNodesState']['lastTouchedId']=null,this['_existingDataIds']=new Set(Ze('data-id',null,_0x10e40e)['map'](_0x12c093=>vt(_0x12c093,'data-id'))['filter'](_0x21a1b6=>!!_0x21a1b6));let _0x47d94e=-0x1,_0x20d9d0=!0x1;const _0x55bd49=_0x112a13['childNodes'],_0x47a974=Array['from'](_0x55bd49)['filter'](_0x35410d=>!(0x3===_0x35410d['nodeType']&&''===Ot(_0x35410d)['trim']())),_0x3f8da3=_0x47a974['length'];for(let _0x196ec1=0x0;_0x196ec1<_0x3f8da3;_0x196ec1++){const _0x1cd555=_0x47a974[_0x196ec1],_0x23bec0=_0x47a974[_0x196ec1+0x1];if(this['_isNewNode'](_0x1cd555)){if(-0x1===_0x47d94e&&(_0x47d94e=_0x196ec1),this['_markWrappedElements'](_0x1cd555),!this['_isNewNode'](_0x23bec0)){const [_0x356b79,_0x4cb0f1]=this['_findReferenceNode'](_0x1cd555,_0x20d9d0,_0x10e40e);if(_0x356b79){const _0x1f49f9=Array['from'](_0x47a974)['slice'](_0x47d94e,_0x196ec1+0x1);this['_insertNodes'](_0x356b79,_0x1f49f9,_0x4cb0f1),_0x47d94e=-0x1;}}}else{if(this['_isExistingContentComment'](_0x1cd555))_0x20d9d0=!0x0;else{if(this['_isExistingNode'](_0x1cd555)){const _0x227787=vt(_0x1cd555,'data-id');if(_0x227787&&this['_existingDataIds']['has'](_0x227787)){const _0x2546a3=Dt('data-id',_0x227787,_0x10e40e);this['_replaceNode'](_0x2546a3,_0x1cd555);}if(this['_touchedNodesState']['removedIds']['includes'](_0x227787)){const _0x267a1c=this['_touchedNodesState']['removedIds']['indexOf'](_0x227787);this['_touchedNodesState']['removedIds']['splice'](_0x267a1c,0x1);}}else{if(this['_isDelNode'](_0x1cd555)){const _0x1e47e4=vt(_0x1cd555,'data-id');this['_touchedNodesState']['modifiedIds']['includes'](_0x1e47e4)||this['_storeDeletedElementIds'](_0x1cd555);}}}}}for(const _0xfe1c77 of this['_touchedNodesState']['removedIds']){const _0x37ac7d=Dt('data-id',_0xfe1c77,_0x10e40e);if(_0x37ac7d){if(_0x25ced6&&_0x25ced6['replaceRemovedWith']){this['_touchedNodesState']['lastTouchedId']=_0xfe1c77;const _0x38fd93=_0x25ced6['replaceRemovedWith']['cloneNode'](!0x0);Ji(_0x38fd93,'data-id',_0xfe1c77),Ji(_0x38fd93,'data-removed','true'),_0x46b47c(_0x37ac7d,_0x38fd93);}else _0x1b183f(_0x37ac7d);}}if(Ze('data-wrapped-id',null,_0x10e40e)['forEach'](_0x5ce404=>{const _0x5026f8=Dt('data-id',vt(_0x5ce404,'data-wrapped-id'),_0x10e40e);var _0x166a4f,_0xb6d972;_0x5026f8&&(_0xb6d972=_0x5ce404,_0x1b183f(_0x166a4f=_0x5026f8),_0x46b47c(_0xb6d972,_0x166a4f));}),Ze('data-id','new-element',_0x10e40e)['forEach'](_0x2bd95b=>{const _0x4a12c2=this['_getUid'](_0x2bd95b);Ji(_0x2bd95b,'data-id',_0x4a12c2),this['_touchedNodesState']['newIds']['push'](_0x4a12c2);}),this['_removeSpecialComments'](_0x10e40e),_0x25ced6&&_0x25ced6['markUnstableElements']&&this['_markUnstableElements'](_0x10e40e,_0x25ced6['markUnstableElementsDepth']||0x0),_0x25ced6&&_0x25ced6['cutAfterLastChange']&&this['_touchedNodesState']['lastTouchedId']){let _0x42814f=Dt('data-id',this['_touchedNodesState']['lastTouchedId'],_0x10e40e);for(;_0x42814f;)$i(_0x42814f),_0x42814f=_0x42814f['parentNode'];}return{'parsedContent':_0x10e40e,'newNodeIds':this['_touchedNodesState']['newIds'],'modifiedNodeIds':this['_touchedNodesState']['modifiedIds'],'removedNodeIds':this['_touchedNodesState']['removedIds']};}['_insertNodes'](_0x1601ed,_0x3426d4,_0x272270){for(const _0x542548 of _0x3426d4){const _0x61561e=this['_getUid'](_0x542548);Ji(_0x542548,'data-id',_0x61561e),this['_touchedNodesState']['newIds']['push'](_0x61561e),this['_touchedNodesState']['lastTouchedId']=_0x61561e;}const _0x4c3ef4='afterbegin'===_0x272270||'afterend'===_0x272270?_0x3426d4['reverse']():_0x3426d4;for(const _0x41662f of _0x4c3ef4)Wi(_0x1601ed,_0x41662f,_0x272270);}['_replaceNode'](_0x396c35,_0x4ebd5b){if(!_0x396c35)return;if(_0x2dff6b=_0x4ebd5b,zn(Ot(_0x396c35))===zn(Ot(_0x2dff6b)))return;var _0x2dff6b;const _0x18b36a=this['_getUid'](_0x396c35);Ji(_0x4ebd5b,'data-id',_0x18b36a),this['_touchedNodesState']['modifiedIds']['push'](_0x18b36a),this['_touchedNodesState']['lastTouchedId']=_0x18b36a,_0x46b47c(_0x396c35,_0x4ebd5b['cloneNode'](!0x0));}['_findReferenceNode'](_0x5f44a7,_0x49e9d1,_0x2a741d){const _0x349b9d=this['_findPrevElementWithDataId'](_0x5f44a7,!0x1);if(_0x349b9d){const _0x51e060=this['_getNodeDataId'](_0x349b9d),_0x13a366=Dt('data-id',_0x51e060,_0x2a741d);if(_0x13a366)return[_0x13a366,'afterend'];this['_touchedNodesState']['invalidIds']['push'](_0x51e060);}const _0x15e321=this['_findNextElementWithDataId'](_0x5f44a7,!0x1);if(_0x15e321){const _0x33b64b=this['_getNodeDataId'](_0x15e321),_0x3437d7=Dt('data-id',_0x33b64b,_0x2a741d);if(_0x3437d7)return[_0x3437d7,'beforebegin'];this['_touchedNodesState']['invalidIds']['push'](_0x33b64b);}return _0x49e9d1?_0x5f44a7['nextSibling']?this['_findFallbackReferenceNode'](_0x5f44a7,_0x2a741d):[_0x2a741d['childNodes'][_0x2a741d['childNodes']['length']-0x1],'afterend']:[_0x2a741d['childNodes'][0x0],'beforebegin'];}['_findFallbackReferenceNode'](_0x116776,_0x296a97){const _0x32721a=[],_0x30de67=this['_findPrevElementWithDataId'](_0x116776,!0x0);if(_0x30de67){const _0x45119f=Dt('data-id',this['_getNodeDataId'](_0x30de67),_0x296a97);_0x45119f&&_0x32721a['push']([_0x45119f,'afterend']);}const _0x46b802=this['_findNextElementWithDataId'](_0x116776,!0x0);if(_0x46b802){const _0x5cbf22=Dt('data-id',this['_getNodeDataId'](_0x46b802),_0x296a97);_0x5cbf22&&_0x32721a['push']([_0x5cbf22,'beforebegin']);}if(_0x32721a['length']>0x1)return Xi(_0x32721a[0x0][0x0])<=Xi(_0x32721a[0x1][0x0])?_0x32721a[0x0]:_0x32721a[0x1];return 0x1===_0x32721a['length']?_0x32721a[0x0]:[_0x296a97['lastChild'],'afterend'];}['_findNextElementWithDataId'](_0x3b1d9b,_0x170da3){let _0x1ec046=_0x3b1d9b['nextSibling'],_0x2545e4=null,_0x3e53ae=!0x1;for(;_0x1ec046;){if(_0x543d27(_0x1ec046)){if(this['_isDelNode'](_0x1ec046)&&(_0x2545e4=_0x1ec046),this['_isExistingContentComment'](_0x1ec046)&&_0x170da3&&!_0x3e53ae){_0x3e53ae=!0x0,_0x1ec046=_0x1ec046['nextSibling'];continue;}break;}const _0x15f448=vt(_0x1ec046,'data-id');if(_0x15f448&&'new-element'!==_0x15f448&&this['_existingDataIds']['has'](_0x15f448)){_0x2545e4=_0x1ec046;break;}_0x1ec046=_0x1ec046['nextSibling'];}return _0x2545e4;}['_findPrevElementWithDataId'](_0x47b82e,_0x549770){let _0x29021e=_0x47b82e['previousSibling'],_0x2a4a0c=null,_0x384869=!0x1;for(;_0x29021e;){if(_0x543d27(_0x29021e)){if(this['_isDelNode'](_0x29021e)&&(_0x2a4a0c=_0x29021e),this['_isExistingContentComment'](_0x29021e)&&_0x549770&&!_0x384869){_0x384869=!0x0,_0x29021e=_0x29021e['previousSibling'];continue;}break;}const _0x348685=vt(_0x29021e,'data-id');if(_0x348685&&'new-element'!==_0x348685&&this['_existingDataIds']['has'](_0x348685)){_0x2a4a0c=_0x29021e;break;}_0x29021e=_0x29021e['previousSibling'];}return _0x2a4a0c;}['_markWrappedElements'](_0x21ed1a){_0x499346(_0x21ed1a)&&Ze('data-id',null,_0x21ed1a)['forEach'](_0x3be3fe=>{this['_isExistingNode'](_0x3be3fe)&&!this['_hasWrappedParent'](_0x3be3fe)&&(Ji(_0x3be3fe,'data-wrapped-id',vt(_0x3be3fe,'data-id')),Ji(_0x3be3fe,'data-id',null));});}['_getNodeDataId'](_0x65a43){if(!_0x65a43)return null;if(_0x499346(_0x65a43))return vt(_0x65a43,'data-id');if(_0x543d27(_0x65a43)){const _0x4cb1c2=Ot(_0x65a43)['match'](/removed[\s*-]data-id="([^"]+)"/);if(_0x4cb1c2&&_0x4cb1c2[0x1])return _0x4cb1c2[0x1];}return null;}['_storeDeletedElementIds'](_0x5e4156){if(_0x543d27(_0x5e4156)){const _0x4939b3=Ot(_0x5e4156)['match'](/removed[\s*-]data-id="([^"]+)"/);_0x4939b3&&_0x4939b3[0x1]&&this['_touchedNodesState']['removedIds']['push'](_0x4939b3[0x1]);}}['_getUid'](_0x40a9ff){return this['_isExistingNode'](_0x40a9ff)?vt(_0x40a9ff,'data-id'):this['_generateUid']();}['_removeSpecialComments'](_0x288973){(function(_0x2096e0){return _0x2e7bf0(_0x2e0a2c=>_0x543d27(_0x2e0a2c),_0x2096e0,!0x0,0x1/0x0);}(_0x288973)['filter'](_0xea3bcd=>this['_isDelNode'](_0xea3bcd)||this['_isExistingContentComment'](_0xea3bcd))['forEach'](_0x8e55ef=>{_0x1b183f(_0x8e55ef);}));}['_markLastTagElementUnstable'](_0x3239fd){const _0x3e4377=_0x3239fd['childNodes'],_0x2b00f5=_0x3e4377[_0x3e4377['length']-0x1];_0x2b00f5&&_0x499346(_0x2b00f5)&&Ji(_0x2b00f5,'data-unstable','true');}['_markUnstableElements'](_0x110a97,_0x30a7fb){const _0x32f792=Dt('data-unstable','true',_0x110a97);if(!_0x32f792)return;const _0x9211e6=qe(_0x32f792)['slice'](0x0,-0x1),_0x21f531=_0x9211e6['length'];let _0x4f3b4b=_0x32f792;if(_0x21f531>_0x30a7fb){let _0x135be1=_0x21f531,_0x230598=null;for(;_0x135be1>_0x30a7fb&&_0x135be1>=0x0;)_0x135be1--,_0x230598=_0x9211e6[_0x135be1];_0x230598&&(_0x4f3b4b=_0x230598,Ji(_0x32f792,'data-unstable',null),Ji(_0x230598,'data-unstable','true'));}else{if(_0x21f531<_0x30a7fb){let _0x371427=_0x21f531,_0x4d3b5f=_0x32f792;for(;_0x371427<_0x30a7fb;){const _0x7fa4cc=_0x4d3b5f['childNodes']['filter'](_0x452551=>_0x499346(_0x452551));if(0x0===_0x7fa4cc['length'])break;_0x371427++,_0x4d3b5f=_0x7fa4cc[_0x7fa4cc['length']-0x1];}_0x4d3b5f&&(_0x4f3b4b=_0x4d3b5f,Ji(_0x32f792,'data-unstable',null),Ji(_0x4d3b5f,'data-unstable','true'));}}let _0x597a1d=_0x4f3b4b;for(;_0x597a1d;){for(;_0x597a1d['nextSibling'];)_0x597a1d=_0x597a1d['nextSibling'],_0x499346(_0x597a1d)&&Ji(_0x597a1d,'data-unstable','true');_0x597a1d=_0x597a1d['parentNode'];}}['_isNewNode'](_0x2b21ba){return Boolean('new-element'===vt(_0x2b21ba,'data-id'));}['_isExistingNode'](_0x24bd3d){return Boolean((vt(_0x24bd3d,'data-id')||'')['length']>0x0&&'new-element'!==vt(_0x24bd3d,'data-id'));}['_isDelNode'](_0x1962c2){return!!_0x1962c2&&Boolean(_0x543d27(_0x1962c2)&&Ot(_0x1962c2)['match'](/removed[\s*-]data-id="[^"]+"/));}['_hasWrappedParent'](_0x50507b){let _0x582af0=_0x50507b['parentNode'];for(;_0x582af0;){if(vt(_0x582af0,'data-wrapped-id'))return!0x0;_0x582af0=_0x582af0['parentNode'];}return!0x1;}['_isExistingContentComment'](_0x1116f3){return Boolean(_0x543d27(_0x1116f3)&&Ot(_0x1116f3)['match'](/\s*existing[\s*-](content|document)\s*/g));}}function Q({editor:_0x3cb05a,changeGroups:_0x4c5cdc,documentContextContent:_0x412da1,showDiff:_0x4475c2,trimUnchanged:_0x2284d9=!0x0}){return _0x4c5cdc['map'](_0x4ec97a=>{const _0x2eb078=new Rt([]),_0x18cc3f=new Rt([]);for(const _0x2b6d57 of _0x4ec97a['changes'])if(_0x4475c2&&'removed'==_0x2b6d57['type']||_0x18cc3f['children']['push'](_0x2b6d57['node']['cloneNode'](!0x0)),'new'!=_0x2b6d57['type']&&(_0x4475c2||'removed'!=_0x2b6d57['type'])){const _0x3860f4=St(_0x629e62=>vt(_0x629e62,'data-id')==_0x2b6d57['id'],_0x412da1,!0x0);_0x3860f4&&_0x2eb078['children']['push'](_0x3860f4['cloneNode'](!0x0));}const {content:_0x4616a5,hasChanges:_0x15b0a0}=function(_0x264322,_0x3dc22b,_0x53df0e,_0x46262f,_0x237fe0=!0x0){const _0x8eb063=_0x264322['plugins']['get']('DocumentCompare'),_0x43dfde=Ot(_0x3dc22b),_0xac1c1f=Ot(_0x53df0e),_0x38e6ee=_0x264322['data']['parse'](_0x43dfde,'$root'),_0x309cdb=_0x264322['model']['createPositionAt'](_0x38e6ee,0x0),_0x2bd284=_0x8eb063['getDiff'](_0x43dfde,_0xac1c1f,{'anchor':_0x309cdb,'markDeletions':_0x46262f,'context':'$root'}),_0x173ade=_0x2bd284['getOperations']();if(0x0==_0x173ade['length'])return{'content':_0x3dc22b['cloneNode'](!0x0),'hasChanges':!0x1};_0x46262f?function(_0x5eb7c6,_0x10a4c2,_0x1aa63f){if(0x0==_0x5eb7c6['length'])return;const _0x1a380d=_0x1aa63f['plugins']['get']('DocumentCompare'),_0x4ad08e=_0x1aa63f['plugins']['get']('SuggestionsConversion');_0x1aa63f['model']['change'](_0x5ed5af=>{const _0x36ac53=new Set();for(let _0x1134f7=0x0;_0x1134f7<_0x5eb7c6['length'];_0x1134f7++){const _0x2732d=_0x5eb7c6[_0x1134f7];if(_0x2732d['baseVersion']=null,_0x2732d['isDocumentOperation']=!0x1,_0x1a380d['isMarkedRemoveOperation'](_0x2732d)){const _0x145108=_0x7900ef(_0x2732d['newRange'],_0x1aa63f['model']),_0x15eec1='suggestion:deletion:'+_0xdc126c()+':$aiSuggestion';_0x10a4c2['markers']['set'](_0x15eec1,_0x145108);}else switch(_0x2732d['type']){case'rename':{if(_0x2732d['oldName']==_0x2732d['newName'])break;_0x5ed5af['batch']['addOperation'](_0x2732d),_0x1aa63f['model']['applyOperation'](_0x2732d);const _0x530c86='$elementName',_0x459301=_0x2732d['position'],_0x4026a0=_0x1aa63f['model']['createRange'](_0x459301,_0x1aa63f['model']['createPositionAt'](_0x459301['nodeAfter'],'end')),_0x5b17a='suggestion:attribute:'+_0x530c86+':'+_0xdc126c()+':$aiSuggestion';_0x10a4c2['markers']['set'](_0x5b17a,_0x4026a0);break;}case'addAttribute':case'removeAttribute':case'changeAttribute':{if(_0x2732d['oldValue']==_0x2732d['newValue'])break;_0x5ed5af['batch']['addOperation'](_0x2732d),_0x1aa63f['model']['applyOperation'](_0x2732d);const _0x1176b2=_0x2732d['key'];if(!_0x4ad08e['isRegisteredAttribute'](_0x1176b2))break;const _0x2baa45=_0x7900ef(_0x2732d['range'],_0x1aa63f['model']),_0x18aab1='suggestion:attribute:'+_0x1176b2+':'+_0xdc126c()+':$aiSuggestion';_0x10a4c2['markers']['set'](_0x18aab1,_0x2baa45);break;}case'insert':{_0x5ed5af['batch']['addOperation'](_0x2732d),_0x1aa63f['model']['applyOperation'](_0x2732d);if(_0x5eb7c6[_0x1134f7+0x1]&&'move'==_0x5eb7c6[_0x1134f7+0x1]['type']){ro(_0x10a4c2,_0x2732d);break;}const _0x2a0bc8=_0x2732d['position'],_0x2ce0a3=_0x2732d['howMany'],_0x1de6e0=_0x7900ef(_0x1aa63f['model']['createRange'](_0x2a0bc8,_0x2a0bc8['getShiftedBy'](_0x2ce0a3)),_0x1aa63f['model']),_0x253a42='suggestion:insertion:'+_0xdc126c()+':$aiSuggestion';_0x10a4c2['markers']['set'](_0x253a42,_0x1de6e0);break;}case'split':{_0x5ed5af['batch']['addOperation'](_0x2732d),_0x1aa63f['model']['applyOperation'](_0x2732d);const _0x492bef=_0x2732d['splitPosition'],_0x57a23e=_0x2732d['moveTargetPosition'],_0x5d4323=_0x1aa63f['model']['createRange'](_0x492bef,_0x57a23e),_0x22c6a7='suggestion:insertion:'+_0xdc126c()+':$aiSuggestion';_0x10a4c2['markers']['set'](_0x22c6a7,_0x5d4323);break;}case'move':{_0x5ed5af['batch']['addOperation'](_0x2732d),_0x1aa63f['model']['applyOperation'](_0x2732d),_0x5eb7c6[_0x1134f7-0x1]&&'insert'==_0x5eb7c6[_0x1134f7-0x1]['type']&&ro(_0x10a4c2,_0x2732d);const _0x3ff60d=_0x2732d['getMovedRangeStart'](),_0x46b144=_0x2732d['howMany'];for(let _0xe3f8fc=0x0;_0xe3f8fc<_0x46b144;_0xe3f8fc++){const _0xc1c507=_0x3ff60d['getShiftedBy'](_0xe3f8fc)['nodeAfter'];_0x36ac53['add'](_0xc1c507);}break;}case'remove':{const _0x5ace75=_0x2732d['sourcePosition'],_0x52e636=_0x2732d['howMany'],_0x47ed11=new it(_0x5ace75,_0x52e636);_0x5ed5af['batch']['addOperation'](_0x47ed11),_0x1aa63f['model']['applyOperation'](_0x47ed11);break;}}}for(const _0x25eabd of _0x36ac53){const _0x5d47cd=_0x1aa63f['model']['createRangeOn'](_0x25eabd),_0x1cc4d2='suggestion:formatBlock:$fakeWrap:'+_0xdc126c()+':$aiSuggestion';_0x10a4c2['markers']['set'](_0x1cc4d2,_0x7900ef(_0x5d47cd,_0x1aa63f['model']));}});}(_0x173ade,_0x38e6ee,_0x264322):_0x264322['model']['change'](_0x13f68c=>{for(const _0x2db3e2 of _0x173ade)if('remove'==_0x2db3e2['type']){const _0x457072=_0x2db3e2['sourcePosition'],_0xef58cf=_0x2db3e2['howMany'],_0x1d08b2=new it(_0x457072,_0xef58cf);_0x13f68c['batch']['addOperation'](_0x1d08b2),_0x264322['model']['applyOperation'](_0x1d08b2);}else{if('marker'==_0x2db3e2['type']){const _0xf09c7d=_0x2db3e2['name'],_0x5dfab7=_0x2db3e2['newRange'];_0x38e6ee['markers']['set'](_0xf09c7d,_0x5dfab7);}else _0x2db3e2['baseVersion']=null,_0x2db3e2['isDocumentOperation']=!0x1,_0x13f68c['batch']['addOperation'](_0x2db3e2),_0x264322['model']['applyOperation'](_0x2db3e2);}});if(_0x237fe0){const _0x330958=wt(_0x264322,_0x173ade,_0x38e6ee);Et(_0x264322['model'],_0x330958),function(_0x36a2b5,_0x5d1b83){const _0x108a17=_0x5d1b83['getFirstRange']()['start'];let _0x2285c9=_0x5d1b83['getFirstRange']()['end'];const _0x2def73=_0x108a17['root'];(_0x2285c9['textNode']||_0x2285c9['nodeAfter']&&_0x2285c9['nodeAfter']['is']('$text'))&&(_0xf35697(_0x2285c9,'...'),_0x2285c9=_0x2285c9['getShiftedBy'](0x3)),(_0x108a17['textNode']||_0x108a17['nodeBefore']&&_0x108a17['nodeBefore']['is']('$text'))&&(_0xf35697(_0x108a17,'...'),function(_0x1e57c5,_0x2abc59,_0x16b931){for(let [_0x20c8b8,_0x9f0df9]of _0x1e57c5['markers']){const _0x18ad00=_0x9f0df9['_getTransformedByInsertion'](_0x2abc59,_0x16b931,!0x1);_0x9f0df9=_0x18ad00[0x0],_0x1e57c5['markers']['set'](_0x20c8b8,_0x9f0df9);}}(_0x2def73,_0x108a17,0x3),_0x108a17['parent']==_0x2285c9['parent']&&(_0x2285c9=_0x2285c9['getShiftedBy'](0x3)));const _0x59fe55=_0x36a2b5['createRange'](_0x36a2b5['createPositionAt'](_0x2def73,0x0),_0x108a17),_0x1ede86=_0x36a2b5['createRange'](_0x2285c9,_0x36a2b5['createPositionAt'](_0x2def73,'end')),_0x45356f=[..._0x59fe55['getMinimalFlatRanges'](),..._0x1ede86['getMinimalFlatRanges']()];_0x45356f['reverse']();for(const _0x1d54e9 of _0x45356f)_0x2f772f(_0x1d54e9),Jn(_0x2def73,_0x1d54e9);}(_0x264322['model'],_0x330958);}const _0xca964d=_0x264322['data']['stringify'](_0x38e6ee,{'showSuggestionHighlights':!0x0});return{'content':He(_0xca964d),'hasChanges':!0x0};}(_0x3cb05a,_0x2eb078,_0x18cc3f,_0x4475c2,_0x2284d9);return{'type':_0x4ec97a['changes'][0x0]['type'],'index':_0x4ec97a['index'],'content':_0x4616a5,'hasChanges':_0x15b0a0};});}function ro(_0x566238,_0x3e9c8d){for(const [_0x10f26a,_0x258392]of _0x566238['markers']){const _0x13ebbd=_0x1026dd['_createFromRanges'](_0x258392['getTransformedByOperation'](_0x3e9c8d));_0x566238['markers']['set'](_0x10f26a,_0x13ebbd);}}function wt(_0x538aab,_0x381c1f,_0x16785f){const _0x1b13a4=_0x538aab['plugins']['get']('DocumentCompare');let _0x59915e=_0x538aab['model']['createPositionAt'](_0x16785f,Number['POSITIVE_INFINITY']),_0x3ac891=_0x538aab['model']['createPositionAt'](_0x16785f,0x0);for(const _0x214353 of _0x381c1f){let _0x1850e9,_0x50e4ff;if(_0x1b13a4['isMarkedRemoveOperation'](_0x214353))_0x1850e9=_0x214353['newRange']['start'],_0x50e4ff=_0x214353['newRange']['end'];else switch(_0x59915e=_0x59915e['getTransformedByOperation'](_0x214353),_0x3ac891=_0x3ac891['getTransformedByOperation'](_0x214353),_0x214353['type']){case'rename':_0x1850e9=_0x214353['position'],_0x50e4ff=_0x1850e9['getShiftedBy'](0x1);break;case'addAttribute':case'removeAttribute':case'changeAttribute':_0x1850e9=_0x214353['range']['start'],_0x50e4ff=_0x214353['range']['end'];break;case'insert':_0x1850e9=_0x214353['position'],_0x50e4ff=_0x1850e9['getShiftedBy'](_0x214353['howMany']);break;case'split':_0x1850e9=_0x214353['splitPosition'],_0x50e4ff=_0x214353['moveTargetPosition'];break;case'merge':{const _0x3094e9=_0x214353['targetPosition']['path']['slice'](0x0,-0x1);_0x1850e9=_0x538aab['model']['createPositionFromPath'](_0x16785f,_0x3094e9),_0x50e4ff=_0x1850e9['getShiftedBy'](0x1);break;}case'remove':{const _0x39a3cc=_0x214353['howMany'],_0x31ee22=_0x214353['sourcePosition']['_getTransformedByInsertion'](_0x214353['targetPosition'],_0x39a3cc),_0x4709ae=_0x214353['getMovedRangeStart']();'remove'==_0x214353['type']?(_0x1850e9=_0x31ee22,_0x50e4ff=_0x31ee22):(_0x1850e9=_0x4709ae,_0x50e4ff=_0x4709ae['getShiftedBy'](_0x39a3cc));break;}}_0x1850e9&&_0x1850e9['isBefore'](_0x59915e)&&(_0x59915e=_0x1850e9['clone'](),_0x59915e['stickiness']='toNone'),_0x50e4ff&&_0x50e4ff['isAfter'](_0x3ac891)&&(_0x3ac891=_0x50e4ff['clone'](),_0x3ac891['stickiness']='toNone');}return _0x538aab['model']['createSelection'](_0x538aab['model']['createRange'](_0x59915e,_0x3ac891));}function Et(_0x3574ad,_0x36b0db){so(_0x3574ad,_0x36b0db,'forward');const _0x5a28cc=_0x36b0db['getFirstRange']();_0x36b0db['setTo']([]),_0x36b0db['setTo'](_0x5a28cc,{'backward':!0x0}),so(_0x3574ad,_0x36b0db,'backward');}function so(_0x2ca9ec,_0x4b15b4,_0x500161){let _0x34f653=0x14;for(;_0x34f653;){_0x2ca9ec['modifySelection'](_0x4b15b4,{'unit':'word','direction':_0x500161}),_0x34f653--;const _0x43abbf=_0x4b15b4['focus']['forward'==_0x500161?'nodeBefore':'nodeAfter'];if(_0x43abbf&&_0x43abbf['is']('element')&&_0x2ca9ec['schema']['isBlock'](_0x43abbf)&&_0x2ca9ec['schema']['isObject'](_0x43abbf))break;}}function Jn(_0x461ca6,_0x1d5d78){for(const [_0x5d4786,_0x55964f]of _0x461ca6['markers']){const _0x50c8db=_0x55964f['_getTransformedByDeletion'](_0x1d5d78['start'],_0x1d5d78['end']['offset']-_0x1d5d78['start']['offset']);null!=_0x50c8db?_0x461ca6['markers']['set'](_0x5d4786,_0x50c8db):_0x461ca6['markers']['delete'](_0x5d4786);}}const Zn=['modification-delta','text-delta','web-search','reasoning'],Wr=['conversation-title'];class Ge extends ts(){['id'];['interactionId'];['type'];['sources']=[];['parsedContent']=new Rt([]);['parsedMergedContent']=new Rt([]);['changeGroups']=[];['areActionsDisabled']=!0x1;['documentContextContent'];['aiResponseParser'];['aiResponseApplier'];['editor'];['cachedSuggestionContentParts']={'withDiff':[],'withoutDiff':[]};constructor({type:_0x403015,content:_0x2ba85b='',isDone:_0x15987a=!0x1,interactionId:_0x48edab,areActionsDisabled:_0x17442b,documentContextContent:_0x4158de,editor:_0x29760f,id:_0x4cece4}){super(),this['id']=_0x4cece4||_0xdc126c(),this['interactionId']=_0x48edab,this['type']=_0x403015,this['areActionsDisabled']=!!_0x17442b,this['editor']=_0x29760f,this['aiResponseParser']=new Ke(),this['aiResponseApplier']=new Qe(),this['documentContextContent']=He(_0x4158de||''),this['set']('isDone',_0x15987a),this['on']('change:content',()=>{this['onContentChange']();}),this['set']('content',_0x2ba85b);}['appendContent'](_0x201b35){this['set']('content',this['content']+_0x201b35);}['done'](){this['isDone']||(this['set']('isDone',!0x0),this['onContentChange']());}['destroy'](){this['stopListening']();}['setChangeGroupState'](_0x4aedf0,_0x25d8aa){this['changeGroups'][_0x4aedf0]['state']=_0x25d8aa,this['fire']('replyChangeGroupStateUpdated',{'reply':this,'index':_0x4aedf0,'state':_0x25d8aa});}['getContentParts']({showDiff:_0x51554d,groupIndex:_0x4c9e85}){if(!this['editor'])throw new _0x36b126('ai-get-editor-from-context-no-editor',null,{'aiReply':this});const _0x33a4dd=this['_getCachedContentParts'](_0x51554d,_0x4c9e85);if(_0x33a4dd)return _0x33a4dd;let _0x1fbe60=[];if(void 0x0===_0x4c9e85)_0x1fbe60=this['changeGroups'];else{const _0x2764f5=this['changeGroups']['find'](({index:_0x1ce2d8})=>_0x1ce2d8===_0x4c9e85);if(!_0x2764f5)throw new _0x36b126('ai-reply-get-content-parts-group-not-found',null,{'aiReply':this,'groupIndex':_0x4c9e85});_0x1fbe60=[_0x2764f5];}const _0x164eb8=Q({'editor':this['editor'],'showDiff':_0x51554d,'changeGroups':_0x1fbe60,'documentContextContent':this['documentContextContent']});return this['_setCachedContentParts'](_0x51554d,_0x164eb8),_0x164eb8;}['_getCachedContentParts'](_0x5e87b1,_0x35c414){const _0x5826b6=_0x5e87b1?'withDiff':'withoutDiff';if(!this['cachedSuggestionContentParts'][_0x5826b6]['length'])return null;const _0x5011c2=this['cachedSuggestionContentParts'][_0x5826b6];if(void 0x0===_0x35c414)return _0x26086b(_0x5011c2);{const _0x310217=_0x5011c2['find'](({index:_0x527c7e})=>_0x527c7e===_0x35c414);if(_0x310217)return[_0x26086b(_0x310217)];}return null;}['_setCachedContentParts'](_0x50cafa,_0x1c6179){const _0x212e8b=_0x50cafa?'withDiff':'withoutDiff';_0x1c6179['forEach'](_0x160ef7=>{const _0x57c88c=this['cachedSuggestionContentParts'][_0x212e8b],_0x3a2f44=_0x57c88c['find'](({index:_0x1f7a24})=>_0x1f7a24===_0x160ef7['index']);if(_0x3a2f44){const _0x31cb68=_0x57c88c['indexOf'](_0x3a2f44);_0x57c88c['splice'](_0x31cb68,0x1,_0x160ef7);}else _0x57c88c['push'](_0x160ef7);});}['onContentChange'](){if('modification-delta'===this['type']){this['parsedContent']=this['aiResponseParser']['parseAndNormalizeHTML'](this['content']);const _0x4d1965=this['changeGroups'];this['updateChangeGroups']();const _0x5c32f4=this['_getDifferentChangeGroups'](_0x4d1965,this['changeGroups']);(_0x5c32f4['length']||this['isDone'])&&(this['fire']('replyContentUpdated',this,_0x5c32f4),this['cachedSuggestionContentParts']['withDiff']['length']=this['cachedSuggestionContentParts']['withoutDiff']['length']=0x0);}else this['parsedContent']=this['aiResponseParser']['convertMarkdownToHTML'](this['content']),this['fire']('replyContentUpdated',this);}['_getDifferentChangeGroups'](_0xbd8762,_0x3a88ca){const _0x62a2da=[];for(const _0x5042e2 of _0x3a88ca){const _0x547ec5=_0xbd8762[_0x5042e2['index']];_0x547ec5?_0x547ec5['changes']['length']!==_0x5042e2['changes']['length']?_0x62a2da['push'](_0x5042e2):_0x547ec5['changes']['forEach']((_0x22d14b,_0x31ece2)=>{const _0x8e5d0b=_0x5042e2['changes'][_0x31ece2];_0x22d14b['id']!==_0x8e5d0b['id']&&_0x62a2da['push'](_0x5042e2);}):_0x62a2da['push'](_0x5042e2);}return _0x62a2da;}['updateChangeGroups'](){const _0x303926=new _0xec973e('p',{},[new _0xec973e('span',{'style':'color:\x20#808080;\x20font-style:\x20italic'},[new _0x4e1833(i(this['editor']['locale'],'AI_SUGGESTION_CONTENT_PART_REMOVED'))])]),_0x41af65=this['aiResponseApplier']['merge'](this['parsedContent'],this['documentContextContent']['cloneNode'](!0x0),{'markUnstableElements':!this['isDone'],'replaceRemovedWith':_0x303926,'cutAfterLastChange':!this['isDone']});if(!_0x41af65['modifiedNodeIds']['length']&&!this['isDone'])return;this['parsedMergedContent']=_0x41af65['parsedContent'];let _0x1a7b78=[];if(_0x4a6dcc(_0x17f011=>{const _0x304022=vt(_0x17f011,'data-id');if(!_0x304022||!_0x3ab0a8(_0x304022))return!0x1;const _0x58aab2=[_0x17f011,...qe(_0x17f011)]['at'](-0x2);if(_0x17f011!=_0x58aab2){const _0x465a89=vt(_0x58aab2,'data-id');_0x3ab0a8(_0x465a89)||(_0x1a7b78['push']({'node':_0x58aab2,'id':_0x465a89,'type':'modified'}),_0x41af65['modifiedNodeIds']['push'](_0x465a89));}else _0x41af65['modifiedNodeIds']['includes'](_0x304022)?_0x1a7b78['push']({'node':_0x17f011,'type':'modified','id':_0x304022}):_0x41af65['newNodeIds']['includes'](_0x304022)?_0x1a7b78['push']({'node':_0x17f011,'type':'new','id':_0x304022,'anchorId':vt(_0x17f011['previousSibling'],'data-id')}):_0x1a7b78['push']({'node':_0x17f011,'type':'removed','id':_0x304022});return!0x0;},this['parsedMergedContent']),_0x1a7b78=_0x1a7b78['filter'](({node:_0x35abfd})=>[...qe(_0x35abfd),_0x35abfd]['every'](_0x2251da=>!vt(_0x2251da,'data-unstable'))),0x0==_0x1a7b78['length'])return;const _0xd83c4=[[_0x1a7b78[0x0]]];for(let _0x23a7a4=0x1;_0x23a7a4<_0x1a7b78['length'];_0x23a7a4++){const _0x523dfc=_0xd83c4[_0xd83c4['length']-0x1],_0x4ed4b6=_0x523dfc[_0x523dfc['length']-0x1];_0x1a7b78[_0x23a7a4]['node']['previousSibling']==_0x4ed4b6['node']&&'modified'!=_0x1a7b78[_0x23a7a4]['type']&&'modified'!=_0x4ed4b6['type']?_0x523dfc['push'](_0x1a7b78[_0x23a7a4]):_0xd83c4['push']([_0x1a7b78[_0x23a7a4]]);}for(const _0x3069d6 of _0xd83c4){const _0x239fae=_0x3069d6[0x0],_0x2b2251=_0x3069d6[_0x3069d6['length']-0x1],_0x1d94c6=_0x7ced98(_0x239fae['node']['previousSibling']);_0x1d94c6&&_0x3069d6['unshift'](_0x1d94c6);const _0x253c82=_0x7ced98(_0x2b2251['node']['nextSibling']);_0x253c82&&_0x3069d6['push'](_0x253c82);}function _0x3ab0a8(_0x57724b){return _0x41af65['modifiedNodeIds']['includes'](_0x57724b)||_0x41af65['newNodeIds']['includes'](_0x57724b)||_0x41af65['removedNodeIds']['includes'](_0x57724b);}function _0x7ced98(_0x21764b){if(_0x21764b&&vt(_0x21764b,'data-id')&&!vt(_0x21764b,'data-unstable')){const _0x543863=vt(_0x21764b,'data-id');if(!_0x3ab0a8(_0x543863))return{'node':_0x21764b,'type':'context','id':_0x543863};}return null;}this['changeGroups']=_0xd83c4['map']((_0x546924,_0x138efe)=>({'changes':_0x546924,'state':'pending','index':_0x138efe}));}}function Di(_0xa44217){return Object['values'](Zn)['includes'](_0xa44217);}function Fi(_0x1704bf){return Wr['includes'](_0x1704bf);}function Ui(_0x42f9f6){return'conversation-title'===_0x42f9f6;}function qi(_0x3cc342){return'source'===_0x3cc342;}const Ce=['interactionCreated','interactionStarted','interactionStopped','interactionFinished','interactionDestroyed','replyCreated','replyContentUpdated','replyChangeGroupStateUpdated','setConversationTitle','webSearchStarted','webSearchFinished','reasoningStarted','reasoningFinished','error'];class xe extends _0x19d98c(){['id'];['replies']=[];['currentReply'];['messageId'];['actionCallId'];['currentRequest'];['connector'];['isStopped']=!0x1;['isDestroyed']=!0x1;['editor'];['_isReasoning']=!0x1;['_isWebSearching']=!0x1;constructor({connector:_0x4372e5,editor:_0x4a0c71}){super(),this['id']=_0xdc126c(),this['connector']=_0x4372e5,this['isStopped']=!0x0,this['editor']=_0x4a0c71;}async['start'](){let _0x5d85e4;const _0x580dae=[];this['isStopped']=!0x1;try{this['currentRequest']=await this['sendRequest'](),this['fire']('interactionStarted',this);const _0x4c9694=await this['currentRequest']['getStream']();for await(const _0x52c34f of _0x4c9694){if(this['isStopped'])return;if('error'===_0x52c34f['event'])return void this['fire']('error',{'error':new _0x36b126('ai-chat-interaction-error',this)});if('message-metadata'!==_0x52c34f['event']){if('action-metadata'!==_0x52c34f['event']){if(Ui(_0x52c34f['event'])&&this['setConversationTitle'](_0x52c34f['data']['conversationTitle'],!0x0),qi(_0x52c34f['event']))_0x580dae['push'](_0x52c34f['data']['source']);else{if(Di(_0x52c34f['event'])){if(_0x52c34f['event']!==_0x5d85e4){if(_0x5d85e4=_0x52c34f['event'],'web-search'===_0x52c34f['event']){this['_isWebSearching']||(this['_isWebSearching']=!0x0,this['fire']('webSearchStarted',this));continue;}if('reasoning'===_0x52c34f['event']){this['_isReasoning']||(this['_isReasoning']=!0x0,this['fire']('reasoningStarted',this));continue;}this['_isReasoning']&&(this['_isReasoning']=!0x1,this['fire']('reasoningFinished',this)),this['_isWebSearching']&&(this['_isWebSearching']=!0x1,this['fire']('webSearchFinished',this)),this['currentReply']&&this['currentReply']['done'](),this['currentReply']=this['createReply']({'type':_0x52c34f['event'],'interactionId':this['id'],'id':_0x52c34f['data']?.['id']}),_0x580dae['length']>0x0&&'modification-delta'===_0x52c34f['event']&&(this['currentReply']['sources']=_0x580dae['splice'](0x0));}_0x52c34f['data']['textDelta']&&this['currentReply']['appendContent'](_0x52c34f['data']['textDelta']);}else Fi(_0x52c34f['event']);}}else this['actionCallId']=_0x52c34f['data']['callId'];}else this['messageId']=_0x52c34f['data']['messageId'];}}finally{this['isStopped']||(_0x580dae['length']>0x0&&(this['currentReply']['sources']=_0x580dae['splice'](0x0)),this['_finalizeInteraction'](),this['fire']('interactionFinished',this));}}['stop'](){this['isStopped']||(this['_finalizeInteraction'](),this['fire']('interactionStopped',this));}['getReply'](_0x3c90af){return this['replies']['find'](_0x1e8ae5=>_0x1e8ae5['id']===_0x3c90af);}['destroy'](){this['isDestroyed']||(this['stop'](),this['replies']['forEach'](_0x483225=>_0x483225['destroy']()),this['replies']=[],this['isDestroyed']=!0x0,this['fire']('interactionDestroyed',this),this['stopListening']());}['createReply'](_0x43e054){const _0x1f0475=new Ge({'editor':this['editor'],'documentContextContent':this['getDocumentContext']()?.['content'],..._0x43e054});return this['replies']['push'](_0x1f0475),_0x1f0475['delegate'](...Ce)['to'](this),this['fire']('replyCreated',_0x1f0475),_0x1f0475;}['setConversationTitle'](_0x43107f,_0x21b218=!0x1){this['fire']('setConversationTitle',_0x43107f,_0x21b218);}['_finalizeInteraction'](){this['isStopped']=!0x0,this['currentRequest']&&this['currentRequest']['abortController']['abort'](),this['currentReply']&&this['currentReply']['done'](),this['currentRequest']=this['currentReply']=void 0x0;}}var je=function(_0x55b129){return _0x55b129['FILE']='file',_0x55b129['DOCUMENT']='document',_0x55b129['URL']='web-resource',_0x55b129['TEXT']='text',_0x55b129['SELECTION']='selection',_0x55b129;}({}),be=function(_0x151a3f){return _0x151a3f['TEXT']='text',_0x151a3f['MARKDOWN']='markdown',_0x151a3f['HTML']='html',_0x151a3f;}({});const Fe=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']]),vi=['contextItemAdded','contextItemRemoved','contextItemLoadingEnded','contextSent','error','addContextOptionsChanged','sourceResourcesLoaded','resourceStateChanged','uploadProgressChanged'];class wi extends ts(){['_connector'];['_config'];['_ownerId'];constructor({connector:_0x33af3c,config:_0x4cfa80,ownerId:_0x15a682}){super(),this['_connector']=_0x33af3c,this['_config']=_0x4cfa80,this['_ownerId']=_0x15a682;}['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'](_0x2132b3){const _0x85fd47=await this['_createContextItemFromContent'](_0x2132b3);return this['_addToConversationContextItem'](_0x85fd47),'current-document'===_0x85fd47['uiId']&&this['_toggleAddCurrentDocumentOptionVisibility'](),_0x85fd47;}async['_createContextItemFromContent'](_0x45ecc8){if(_0x45ecc8['type']===je['DOCUMENT']){const _0x9e6acc=await this['_connector']['fetchDocument'](this['_ownerId'],_0x45ecc8['id'])['getDocument']();return{'id':'current-document','uiId':'current-document','label':'Current\x20document','type':_0x45ecc8['type'],'content':_0x9e6acc['content'],'hidden':this['_conversationContextItems']['has']('current-document'),'version':_0x9e6acc['attributes']?.['version'],'sessionId':_0x9e6acc['attributes']?.['sessionId']};}return{'id':_0x45ecc8['id'],'uiId':_0x45ecc8['id'],'label':_0x45ecc8['attributes']?.['label']||_0x45ecc8['name']||_0x45ecc8['url']||_0x45ecc8['id'],'type':_0x45ecc8['type'],..._0x45ecc8?.['attributes']?.['resourceId']?{'resourceId':_0x45ecc8['attributes']?.['resourceId']}:{}};}['getSentContextItems'](){return new Map(this['_conversationContextItems']);}['removeFromContext'](_0x385f62){const _0x57115b=this['_pendingContextItems']['get'](_0x385f62);_0x57115b?.['isReadOnly']||this['_removeContextItem'](_0x385f62);}['clearPendingContextItems'](){if(0x0===this['_pendingContextItems']['size'])return;for(const _0x302a8a of this['_pendingContextItems']['values']())this['_removeContextItem'](_0x302a8a['uiId']);const _0x591f11=this['_conversationContextItems']['get']('current-document')||this['_pendingContextItems']['get']('current-document');_0x591f11&&this['_addContextItem']({..._0x591f11,'isReadOnly':!0x0,'hidden':!0x0});}['addToConversationContext'](_0x25b5bc){for(const _0x4522f5 of _0x25b5bc['values']())this['_addToConversationContextItem'](_0x4522f5);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'](_0x4d34a9){return Array['from'](_0x4d34a9['values']())['map'](_0x5d3195=>this['_mapContextItemToRequestData'](_0x5d3195))['filter'](_0x32210f=>null!==_0x32210f);}async['addFilesToContext'](_0x5e4b13,_0x44f5df,_0x19605=je['FILE']){const _0x27ec2f='files-'+_0xdc126c();this['_startUploadOperation'](_0x27ec2f);try{await Promise['all'](_0x5e4b13['map'](async _0x1a5012=>{const _0x12933a='file-'+_0xdc126c(),_0x266c92=_0x469020(_0x1a5012['name']);try{this['_addContextItem']({'type':_0x19605,'label':_0x44f5df?.['label']||_0x266c92,'uiId':_0x12933a,'resourceId':_0x44f5df?.['resourceId']},!0x0);const _0x5714e7=this['_connector']['uploadFile'](this['_ownerId'],_0x1a5012,_0x44f5df);this['_ongoingUploads']['set'](_0x12933a,_0x5714e7['abortController']);const {id:_0x4a1f8c}=await _0x5714e7['getId']();this['_ongoingUploads']['delete'](_0x12933a),this['_finishContextItemLoading']({'type':_0x19605,'id':_0x4a1f8c,'label':_0x44f5df?.['label']||_0x266c92,'uiId':_0x12933a,'resourceId':_0x44f5df?.['resourceId']},!0x1);}catch(_0xab6536){this['_ongoingUploads']['delete'](_0x12933a);if(!(_0xab6536 instanceof _0x36b126&&_0xab6536['message']['startsWith']('ai-request-aborted'))){const _0x37cac3=Fe['get'](_0xab6536['code'])||'ai-chat-file-upload-failed',_0x905357=new _0x36b126(_0x37cac3,null,{'fileName':_0x266c92,..._0xab6536});_0x905357['stack']=_0xab6536['stack'],this['fire']('error',{'error':_0x905357});}this['_removeContextItem'](_0x12933a);}}));}finally{this['_finishUploadOperation'](_0x27ec2f);}}['addCurrentDocumentToContext'](_0x2feed8){if(this['isCurrentDocumentInContext']()||!this['_addContextOptionsState']['document']['enabled'])return;const _0xd152a={'type':je['DOCUMENT'],'uiId':'current-document','label':_0x2feed8,'isReadOnly':this['_conversationContextItems']['has']('current-document'),'hidden':this['_conversationContextItems']['has']('current-document')};this['_addContextItem'](_0xd152a);}async['updateCurrentDocument'](_0x520a41,_0xe55585,_0x55be6f,_0x3790d9){const _0x4cb08e=this['_pendingContextItems']['get']('current-document');if(_0x4cb08e&&_0x520a41){_0x4cb08e['selection']=_0x3790d9?_0x3790d9['map'](_0x16dce1=>({'start':_0x16dce1['start'],'end':_0x16dce1['end']})):[];try{if(_0x4cb08e['version']===_0xe55585)return;const {id:_0x544928}=await this['_connector']['uploadDocument'](this['_ownerId'],_0x520a41,{'version':_0xe55585,'sessionId':_0x55be6f})['getId']();_0x4cb08e['id']=_0x544928,_0x4cb08e['content']=_0x520a41,_0x4cb08e['version']=_0xe55585,_0x4cb08e['sessionId']=_0x55be6f;}catch(_0x540d7e){const _0x4115e9=new _0x36b126('ai-chat-document-upload-failed',null);_0x4115e9['stack']=_0x540d7e['stack'],this['fire']('error',{'error':_0x4115e9});}}}['addSelectionToContext'](_0x201524){this['_addContextItem']({'type':je['SELECTION'],'label':_0x201524,'uiId':'selection','content':_0x201524});}['removeSelectionFromContext'](){this['_removeContextItem']('selection');}async['addUrlToContext'](_0x48823c,_0x62df04){const _0x34c34d='url-'+_0xdc126c();this['_startUploadOperation'](_0x34c34d);const _0x3773dc='url-'+_0xdc126c();try{this['_addContextItem']({'type':je['URL'],'label':_0x62df04?.['label']||_0x48823c,'uiId':_0x3773dc,'resourceId':_0x62df04?.['resourceId']},!0x0);const _0x546a2f=this['_connector']['uploadUrl'](this['_ownerId'],_0x48823c,_0x62df04);this['_ongoingUploads']['set'](_0x3773dc,_0x546a2f['abortController']);const {id:_0x4591f9}=await _0x546a2f['getId']();this['_ongoingUploads']['delete'](_0x3773dc),this['_finishContextItemLoading']({'type':je['URL'],'id':_0x4591f9,'label':_0x62df04?.['label']||_0x48823c,'uiId':_0x3773dc,'resourceId':_0x62df04?.['resourceId']},!0x1);}catch(_0x4fd9b1){this['_ongoingUploads']['delete'](_0x3773dc),(_0x4fd9b1['message']['startsWith']('ai-request-aborted')||this['fire']('error',{'error':new _0x36b126('ai-chat-url-upload-failed',this,{'url':_0x48823c,'originalError':_0x4fd9b1}),'url':_0x48823c}),this['_removeContextItem'](_0x3773dc));}finally{this['_finishUploadOperation'](_0x34c34d);}}async['loadSourceResources'](_0x216602,_0x127182,_0x1db5d6){const _0x1f748f=this['_addContextOptionsState']['sources']['find'](_0x6e3c1e=>_0x6e3c1e['id']===_0x216602);if(!_0x1f748f)return this['fire']('error',{'error':new _0x36b126('ai-chat-source-not-found',this,{'sourceId':_0x216602}),'sourceId':_0x216602}),[];try{const _0x9daec7=(await _0x1f748f['getResources'](_0x127182))['map'](_0x505eb1=>{const _0x4fde36=this['_isResourceInContext'](_0x505eb1['id']);return{..._0x505eb1,'isInContext':_0x4fde36};});return _0x1f748f['resources']=_0x9daec7,this['fire']('sourceResourcesLoaded',{'sourceId':_0x216602,'source':_0x1f748f,'resources':_0x9daec7,'uid':_0x1db5d6}),_0x9daec7;}catch(_0x3c2d75){return this['fire']('error',{'error':new _0x36b126('ai-chat-source-resources-load-failed',this,{'sourceId':_0x216602,'originalError':_0x3c2d75}),'sourceId':_0x216602,'sourceLabel':_0x1f748f['label']}),[];}}async['addResourceToContext'](_0x210f94,_0x585f7c){if(this['_isResourceInContext'](_0x585f7c['id']))return;let _0x40974e=_0x585f7c['data'];if(!_0x40974e&&_0x210f94['getData'])try{_0x40974e=await _0x210f94['getData'](_0x585f7c['id']);}catch(_0x3465e5){return void this['fire']('error',{'error':new _0x36b126('ai-chat-resource-load-failed',this,{'resourceId':_0x585f7c['id'],'sourceId':_0x210f94['id'],'originalError':_0x3465e5}),'resourceId':_0x585f7c['id'],'sourceId':_0x210f94['id']});}if(_0x40974e)switch(_0x585f7c['type']){case je['URL']:if('string'!=typeof _0x40974e)return void this['fire']('error',{'error':new _0x36b126('ai-chat-context-invalid-data',this,{'resourceId':_0x585f7c['id'],'sourceId':_0x210f94['id'],'expectedType':'string','actualType':typeof _0x40974e}),'resourceId':_0x585f7c['id'],'sourceId':_0x210f94['id']});await this['addUrlToContext'](_0x40974e,{'label':_0x585f7c['label'],'resourceId':_0x585f7c['id']});break;case je['FILE']:if(!(_0x40974e instanceof File))return void this['fire']('error',{'error':new _0x36b126('ai-chat-context-invalid-data',this,{'resourceId':_0x585f7c['id'],'sourceId':_0x210f94['id'],'expectedType':'File','actualType':typeof _0x40974e}),'resourceId':_0x585f7c['id'],'sourceId':_0x210f94['id']});await this['addFilesToContext']([_0x40974e],{'label':_0x585f7c['label'],'resourceId':_0x585f7c['id']});break;case je['TEXT']:if('object'!=typeof _0x40974e||!('content'in _0x40974e)||!('type'in _0x40974e))return void this['fire']('error',{'error':new _0x36b126('ai-chat-context-invalid-data',this,{'resourceId':_0x585f7c['id'],'sourceId':_0x210f94['id'],'expectedType':'object\x20with\x20content\x20and\x20type\x20properties','actualType':typeof _0x40974e}),'resourceId':_0x585f7c['id'],'sourceId':_0x210f94['id']});_0x40974e=wi['_convertTextResourceToFile'](_0x40974e,_0x585f7c['label']),await this['addFilesToContext']([_0x40974e],{'label':_0x585f7c['label'],'resourceId':_0x585f7c['id']},je['TEXT']);break;default:this['fire']('error',{'error':new _0x36b126('ai-chat-context-unsupported-type',this,{'resourceId':_0x585f7c['id'],'sourceId':_0x210f94['id'],'resourceType':_0x585f7c['type']}),'resourceId':_0x585f7c['id'],'sourceId':_0x210f94['id']});}else this['fire']('error',{'error':new _0x36b126('ai-chat-resource-no-data',this,{'resourceId':_0x585f7c['id'],'sourceId':_0x210f94['id']}),'resourceId':_0x585f7c['id'],'sourceId':_0x210f94['id']});}static['_convertTextResourceToFile'](_0x58c130,_0x57cf7b){switch(_0x58c130['type']){case be['MARKDOWN']:return new File([_0x58c130['content']],_0x57cf7b,{'type':'text/markdown'});case be['HTML']:return new File([_0x58c130['content']],_0x57cf7b,{'type':'text/html'});default:return new File([_0x58c130['content']],_0x57cf7b,{'type':'text/plain'});}}static['_mapContextItemToRequestData'](_0x2f23f8){switch(_0x2f23f8['type']){case je['FILE']:return{'type':je['FILE'],'id':_0x2f23f8['id']};case je['URL']:return{'type':je['URL'],'id':_0x2f23f8['id']};case je['DOCUMENT']:return{'type':je['DOCUMENT'],'id':_0x2f23f8['id'],..._0x2f23f8['selection']?.['length']&&{'selection':_0x2f23f8['selection']}};case je['TEXT']:return{'type':je['FILE'],'id':_0x2f23f8['id']};default:return null;}}['_addContextItem'](_0x1a4a9b,_0x504252=!0x1){if(this['_pendingContextItems']['set'](_0x1a4a9b['uiId'],_0x1a4a9b),_0x1a4a9b['hidden']||this['fire']('contextItemAdded',{'contextItem':_0x1a4a9b,'isLoading':_0x504252}),'current-document'===_0x1a4a9b['uiId']&&this['_toggleAddCurrentDocumentOptionVisibility'](),_0x1a4a9b['resourceId']){const _0x1630ff=this['_findSourceIdsByResourceId'](_0x1a4a9b['resourceId']);_0x1630ff&&_0x1630ff['forEach'](_0x596fc5=>{this['_updateResourceInContextState'](_0x596fc5,_0x1a4a9b['resourceId'],!0x0);});}}['_removeContextItem'](_0x13b0a6){const _0x5309b7=this['_pendingContextItems']['get'](_0x13b0a6),_0x296240=this['_ongoingUploads']['get'](_0x13b0a6);if(_0x296240&&(_0x296240['abort'](),this['_ongoingUploads']['delete'](_0x13b0a6)),_0x5309b7?.['resourceId']){const _0xcd8fe4=this['_findSourceIdsByResourceId'](_0x5309b7['resourceId']);_0xcd8fe4&&_0xcd8fe4['forEach'](_0x5c671a=>{this['_updateResourceInContextState'](_0x5c671a,_0x5309b7['resourceId'],!0x1);});}this['_pendingContextItems']['delete'](_0x13b0a6),this['fire']('contextItemRemoved',{'uiId':_0x13b0a6,'type':_0x5309b7?.['type']}),'current-document'===_0x13b0a6&&this['_toggleAddCurrentDocumentOptionVisibility']();}['_finishContextItemLoading'](_0x32abc5,_0x28d726){if(this['_pendingContextItems']['has'](_0x32abc5['uiId'])&&(this['_pendingContextItems']['set'](_0x32abc5['uiId'],_0x32abc5),this['fire']('contextItemLoadingEnded',{'contextItem':_0x32abc5,'isLoading':_0x28d726}),_0x32abc5['resourceId'])){const _0x5c1477=this['_findSourceIdsByResourceId'](_0x32abc5['resourceId']);_0x5c1477&&_0x5c1477['forEach'](_0x2b984a=>{this['_updateResourceInContextState'](_0x2b984a,_0x32abc5['resourceId'],!0x0);});}}['_addToConversationContextItem'](_0x5128be){this['_conversationContextItems']['set'](_0x5128be['uiId'],_0x5128be);}['_setAddContextOptionsDefaultState'](){this['_addContextOptionsState']={'document':{'enabled':!0x1!==this['_config']?.['document']?.['enabled'],'isHidden':!0x1},'urls':{'enabled':!0x1!==this['_config']?.['urls']?.['enabled']},'files':{'enabled':!0x1!==this['_config']?.['files']?.['enabled']},'sources':this['_getCustomSourcesInitialState']()},this['fire']('addContextOptionsChanged',{'options':this['_addContextOptionsState']});}['_getCustomSourcesInitialState'](){return this['_config']?.['sources']?.['map'](_0x6f9ce8=>({..._0x6f9ce8,'resources':[]}))??[];}['_toggleAddCurrentDocumentOptionVisibility'](){const _0x131dbc=this['isCurrentDocumentInContext']()||this['isCurrentDocumentInConversation']();this['_addContextOptionsState']['document']['isHidden']=_0x131dbc,this['fire']('addContextOptionsChanged',{'options':this['_addContextOptionsState']});}['_isResourceInContext'](_0x5b487c){for(const _0x4875d2 of this['_pendingContextItems']['values']())if(_0x4875d2['resourceId']===_0x5b487c)return!0x0;for(const _0x2f3c47 of this['_conversationContextItems']['values']())if(_0x2f3c47['resourceId']===_0x5b487c)return!0x0;return!0x1;}['_findSourceIdsByResourceId'](_0x50376d){const _0x3444ec=[];for(const _0x51bd06 of this['_addContextOptionsState']['sources']){_0x51bd06['resources']['find'](_0x4cc081=>_0x4cc081['id']===_0x50376d)&&_0x3444ec['push'](_0x51bd06['id']);}return 0x0===_0x3444ec['length']?null:_0x3444ec;}['_updateResourceInContextState'](_0x31449c,_0x146540,_0x395794){const _0x23969c=this['_addContextOptionsState']['sources']['find'](_0x490857=>_0x490857['id']===_0x31449c);if(!_0x23969c)return;const _0x25049c=_0x23969c['resources']['find'](_0x3d143b=>_0x3d143b['id']===_0x146540);_0x25049c&&(_0x25049c['isInContext']=_0x395794,this['fire']('resourceStateChanged',{'sourceId':_0x31449c,'resourceId':_0x146540,'isInContext':_0x395794}));}['_startUploadOperation'](_0x49fc37){this['_ongoingUploadOperations']['set'](_0x49fc37,!0x0),this['_ongoingUploadOperations']['size']&&this['fire']('uploadProgressChanged',{'isUploadInProgress':!0x0});}['_finishUploadOperation'](_0x1ef602){this['_ongoingUploadOperations']['delete'](_0x1ef602),0x0===this['_ongoingUploadOperations']['size']&&this['fire']('uploadProgressChanged',{'isUploadInProgress':!0x1});}}const fi=['capabilitiesUpdated'];class Ii extends _0x19d98c(){['_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'](_0x385658){const _0x366661={};return _0x385658&&_0x385658['isWebSearchEnabled']&&(_0x366661['webSearch']={}),_0x385658&&_0x385658['isReasoningEnabled']&&(_0x366661['reasoning']={}),_0x366661;}['toggleWebSearch'](){this['setWebSearch'](!this['_isWebSearchEnabled']);}['toggleReasoning'](){this['setReasoning'](!this['_isReasoningEnabled']);}['setWebSearch'](_0x119dec){_0x119dec!==this['_isWebSearchEnabled']&&(this['_isWebSearchEnabled']=_0x119dec,this['fire']('capabilitiesUpdated',this['getCapabilitiesConfig']()));}['setReasoning'](_0x54b211){_0x54b211!==this['_isReasoningEnabled']&&(this['_isReasoningEnabled']=_0x54b211,this['fire']('capabilitiesUpdated',this['getCapabilitiesConfig']()));}}class Ci extends xe{['userMessage'];['conversationId'];['contextItems']=new Map();['model'];['quickActionData'];constructor(_0x3f1814){super(_0x3f1814),this['conversationId']=_0x3f1814['conversationId'],this['contextItems']=_0x3f1814['contextItems'],this['capabilities']=_0x3f1814['capabilities'],this['userMessage']=_0x3f1814['userMessage'],this['model']=_0x3f1814['model'],this['quickActionData']=_0x3f1814['quickActionData'];}async['sendRequest'](){return this['connector']['queryAssistant']({'message':this['userMessage'],'conversationId':this['conversationId'],'parts':wi['mapContextItemsToRequestData'](this['contextItems']),'capabilities':Ii['getCapabilitiesRequestData'](this['capabilities']),'model':this['model'],'quickActionData':this['quickActionData']});}['getDocumentContext'](){return this['contextItems']['get']('current-document');}}class Tt extends _0x19d98c(){['id'];['isStarted']=!0x1;['interactions']=[];['currentInteraction'];['selectedModel'];['connector'];['options'];constructor(_0x5e9d35){super(),this['options']=_0x5e9d35,this['connector']=_0x5e9d35['connector'],this['chatModels']=_0x5e9d35['chatModels'],this['id']=_0x5e9d35['conversationId'];}async['init'](_0x274811){try{this['chatContext']=new wi({'connector':this['connector'],'config':_0x274811,'ownerId':this['id']}),this['chatContext']['delegate'](...vi)['to'](this),this['chatContext']['init'](),this['chatCapabilities']=new Ii(),this['chatCapabilities']['delegate'](...fi)['to'](this),this['chatCapabilities']['init']();const _0x2ca5d6=await this['chatModels']['getAvailableModels']();this['fire']('conversationInitialized',{'availableModels':_0x2ca5d6});const _0x5ec9a8=await this['chatModels']['getModel'](this['options']['selectedModelId']);_0x5ec9a8&&await this['setModel'](_0x5ec9a8);}catch(_0x8bb769){const _0x244af0=new _0x36b126('ai-chat-conversation-init-failed',null,{'message':_0x8bb769['message']||_0x8bb769});_0x244af0['stack']=_0x8bb769['stack'],this['fire']('error',{'error':_0x244af0});}}async['start'](){if(this['isStarted'])throw new _0x36b126('ai-chat-conversation-already-started',null,{'conversation':this});if(!this['selectedModel'])throw new _0x36b126('ai-chat-conversation-start-no-model-selected',null,{'conversation':this});try{const {id:_0x2fa657}=await this['connector']['startConversation'](this['id'],this['options']['group'])['getConversation']();this['id']=_0x2fa657,this['isStarted']=!0x0,this['fire']('conversationStarted',{'conversationId':this['id'],'selectedModel':this['selectedModel']});}catch(_0x2bcea8){const _0x4c85ec=new _0x36b126('ai-chat-conversation-start-failed',null,{'message':_0x2bcea8['message'],'conversationId':this['id']});throw _0x4c85ec['stack']=_0x2bcea8['stack'],this['fire']('error',{'error':_0x4c85ec}),_0x4c85ec;}}async['load'](_0x835bb3,_0x313037){try{const _0x400346=await this['connector']['fetchConversation'](_0x835bb3)['getConversation'](),_0x2fa0d6=await this['connector']['fetchConversationMessages'](_0x835bb3)['getMessages'](),_0x12ff76=_0x2fa0d6[0x0]['model'];this['isStarted']=!0x0,this['id']=_0x400346['id'],'title'in _0x400346?this['fire']('setConversationTitle',_0x400346['title'],!0x0):this['fire']('setConversationTitle','',!0x0);const _0x573d78=(await this['chatModels']['getAll']())['find'](_0x5c7965=>_0x5c7965['id']['toLowerCase']()===_0x12ff76['toLowerCase']());return this['selectedModel']=_0x573d78,this['fire']('modelSelected',{'selectedModel':_0x573d78,'isDisabled':!0x0}),await this['_processMessagesToInteractions'](_0x2fa0d6,_0x313037,_0x12ff76),this['currentInteraction']=void 0x0,this;}catch(_0x5901d6){const _0x4f3313=new _0x36b126('ai-chat-conversation-init-from-id-failed',null,{'message':_0x5901d6['message'],'conversationId':_0x835bb3});throw _0x4f3313['stack']=_0x5901d6['stack'],this['fire']('error',{'error':_0x4f3313}),_0x4f3313;}}async['_processMessagesToInteractions'](_0x5e74dd,_0x3dbd2e,_0x403062){let _0x3c1928;for(const _0xb2f075 of _0x5e74dd)if('user'===_0xb2f075['role']){const _0x569a9d=await this['_extractContextItems'](_0xb2f075),_0x1f549a={'isReasoningEnabled':Object['hasOwn'](_0xb2f075['capabilities'],'reasoning'),'isWebSearchEnabled':Object['hasOwn'](_0xb2f075['capabilities'],'webSearch')};_0x3c1928=this['createInteraction']({'userMessage':_0xb2f075['prompt'],'contextItems':_0x569a9d,'capabilities':_0x1f549a,'modelId':_0x403062,'quickActionData':_0xb2f075['attributes']?.['quickActionData']}),this['currentInteraction']=_0x3c1928,this['chatContext']['addToConversationContext'](this['currentInteraction']['contextItems']);}else{if('assistant'===_0xb2f075['role']&&_0x3c1928)for(const _0x508218 of _0xb2f075['content']){const _0x25d236='text'===_0x508218['type']?'text-delta':'modification-delta',_0x48c96b=_0x3c1928['getDocumentContext']()?.['sessionId']!==_0x3dbd2e;_0x3c1928['currentReply']=_0x3c1928['createReply']({'type':_0x25d236,'isDone':!0x0,'interactionId':_0x3c1928['id'],'areActionsDisabled':_0x48c96b}),_0x3c1928['currentReply']['appendContent'](_0x508218['content']);}}}async['_extractContextItems'](_0x4a9b4a){const _0x57a66b=new Map();if(!_0x4a9b4a['content'])return _0x57a66b;for(const _0x45d41b of _0x4a9b4a['content']){const _0x3c2e78=await this['chatContext']['populateFromMessage'](_0x45d41b);_0x3c2e78&&_0x57a66b['set'](_0x3c2e78['id'],_0x3c2e78);}return _0x57a66b;}async['handleUserInteraction']({userMessage:_0x347f14,quickActionData:_0xa20983}){if(!this['isStarted'])throw new _0x36b126('ai-chat-handle-user-conversation-not-initialized',null,{'conversation':this});if(this['currentInteraction'])throw new _0x36b126('ai-chat-handle-user-interaction-already-in-progress',null,{'conversation':this});try{const _0x358b4d=this['chatContext']['getPendingContextItems'](),_0x8c8872=this['chatCapabilities']['getCapabilitiesConfig'](),_0x3ded3a=this['selectedModel']['id'];this['currentInteraction']=this['createInteraction']({'userMessage':_0x347f14,'contextItems':_0x358b4d,'capabilities':_0x8c8872,'modelId':_0x3ded3a,'quickActionData':_0xa20983}),await this['currentInteraction']['start'](),this['chatContext']['addToConversationContext'](this['currentInteraction']['contextItems']);}catch(_0x545c42){if(_0x545c42 instanceof _0x36b126)this['fire']('error',{'interactionId':this['currentInteraction']?this['currentInteraction']['id']:void 0x0,'error':_0x545c42});else{const _0x15a1cf=Fe['get'](_0x545c42['code'])||'ai-chat-handle-user-interaction-start-failed';this['fire']('error',{'interactionId':this['currentInteraction']?this['currentInteraction']['id']:void 0x0,'error':new _0x36b126(_0x15a1cf,null,{'error':_0x545c42})});}}finally{this['currentInteraction']?.['stop'](),this['currentInteraction']=void 0x0;}}['createInteraction']({userMessage:_0x33bd17,contextItems:_0x4c5b3d,capabilities:_0x3b2f7d,modelId:_0x54d15a,quickActionData:_0x5690c5}){const _0x10ee43=new Ci({'userMessage':_0x33bd17,'contextItems':_0x4c5b3d,'capabilities':_0x3b2f7d,'conversationId':this['id'],'connector':this['connector'],'editor':this['options']['getEditor']&&this['options']['getEditor'](),'model':_0x54d15a,'quickActionData':_0x5690c5});return _0x10ee43['delegate'](...Ce)['to'](this),this['interactions']['push'](_0x10ee43),this['fire']('interactionCreated',_0x10ee43),_0x10ee43;}['getInteraction'](_0x4d11ee){return this['interactions']['find'](_0x5e9de6=>_0x5e9de6['id']===_0x4d11ee);}['removeInteraction'](_0x481da1){const _0x4de9c9=this['getInteraction'](_0x481da1);_0x4de9c9&&(_0x4de9c9['destroy'](),this['interactions']['splice'](this['interactions']['indexOf'](_0x4de9c9),0x1));}get['lastInteraction'](){return this['interactions'][this['interactions']['length']-0x1];}['addCurrentDocumentToContext'](_0x4e3918){this['chatContext']['addCurrentDocumentToContext'](_0x4e3918);}async['updateCurrentDocumentInContext']({content:_0x2a8424,version:_0x40b7f9,sessionId:_0x51b74d,selections:_0x56459e}){await this['chatContext']['updateCurrentDocument'](_0x2a8424,_0x40b7f9,_0x51b74d,_0x56459e);}['getCurrentDocumentContext'](){return this['currentInteraction']?.['getDocumentContext']()?.['content']||'';}['addSelectionToContext'](_0x5f5850){this['chatContext']['addSelectionToContext'](_0x5f5850);}['removeSelectionFromContext'](){this['chatContext']['removeSelectionFromContext']();}['addFilesToContext'](_0x519737){this['chatContext']['addFilesToContext'](_0x519737);}['addUrlToContext'](_0x599f65){this['chatContext']['addUrlToContext'](_0x599f65);}['addResourceToContext'](_0x4533d6,_0x302104){this['chatContext']['addResourceToContext'](_0x4533d6,_0x302104);}['loadSourceResources'](_0x50f969,_0x2f07ff,_0x3d8c8e){return this['chatContext']['loadSourceResources'](_0x50f969,_0x2f07ff,_0x3d8c8e);}['removeFromContext'](_0x379735){this['chatContext']['removeFromContext'](_0x379735);}['toggleWebSearch'](){this['chatCapabilities']['toggleWebSearch']();}['toggleReasoning'](){this['chatCapabilities']['toggleReasoning']();}['isCurrentDocumentInContext'](){return this['chatContext']['isCurrentDocumentInContext']();}['isCurrentDocumentInConversation'](){return this['chatContext']['isCurrentDocumentInConversation']();}['isSelectionInContext'](){return this['chatContext']['isSelectionInContext']();}async['setModel'](_0x5a1f53){_0x5a1f53?!0x1===await this['chatModels']['isAvailable'](_0x5a1f53)&&(_0x3219ae('ai-chat-conversation-set-model-not-available',{'conversation':this,'model':_0x5a1f53}),_0x5a1f53=(await this['chatModels']['getAvailableModels']())[0x0]):(_0x3219ae('ai-chat-conversation-set-model-null',{'conversation':this}),_0x5a1f53=(await this['chatModels']['getAvailableModels']())[0x0]),_0x5a1f53['id']!==this['selectedModel']?.['id']&&(this['selectedModel']=_0x5a1f53,this['chatCapabilities']['reset'](),this['fire']('modelSelected',{'selectedModel':_0x5a1f53}));}}function ut(_0x4a14a3){if(_0x4a14a3 instanceof _t)return _0x4a14a3;if(_0x4a14a3?.['editors']&&_0x4a14a3['editors']['get'](0x0))return _0x4a14a3['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.'),_0x4a14a3['editors']['get'](0x0);throw new _0x36b126('ai-get-editor-from-context-no-editor');}const It='ai-selection';class R extends ot{['_displayedFakeSelectionId']=null;['_displayedFakeSelectionLocked']=!0x1;['_sessionId'];static get['pluginName'](){return'AIEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}get['sessionId'](){if(!this['_sessionId']){const _0x4811af=ut(this['context']),_0x564308=_0x4811af['plugins']['has']('RealTimeCollaborationClient')&&_0x4811af['plugins']['get']('RealTimeCollaborationClient')['sessionId'];this['_sessionId']=_0x564308||_0xdc126c();}return this['_sessionId'];}['getDocumentData'](){const _0xcd3b6b=ut(this['context']),_0x42c3c7=_0xcd3b6b['model'],_0x360a86=_0xcd3b6b['data']['toView'](_0x42c3c7['document']['getRoot'](),{'convertAiChatSelectionMarker':!0x0}),_0x7479f2=new Ft(_0xcd3b6b['editing']['view']['document']);this['_setDataIdsOnChildren'](_0x360a86,_0x7479f2);let _0x3def2d=_0xcd3b6b['data']['processor']['toData'](_0x360a86);const _0x509016=this['_getMarkersInDocumentOrder'](),_0x43cbcd=[];for(const _0x7bc0dd of _0x509016){const _0x51bb8='<'+_0x7bc0dd['name']+':start></'+_0x7bc0dd['name']+':start>',_0x1409ce=_0x3def2d['indexOf'](_0x51bb8);_0x3def2d=_0x3def2d['substring'](0x0,_0x1409ce)+_0x3def2d['substring'](_0x1409ce+_0x51bb8['length']);const _0x134048='<'+_0x7bc0dd['name']+':end></'+_0x7bc0dd['name']+':end>',_0x2b7bd3=_0x3def2d['indexOf'](_0x134048);_0x3def2d=_0x3def2d['substring'](0x0,_0x2b7bd3)+_0x3def2d['substring'](_0x2b7bd3+_0x134048['length']),_0x43cbcd['push']({'markerName':_0x7bc0dd['name'],'start':_0x1409ce,'end':_0x2b7bd3,'htmlFragment':_0x3def2d['substring'](_0x1409ce,_0x2b7bd3)});}return{'content':_0x3def2d,'version':_0xcd3b6b['model']['document']['version'],'sessionId':this['sessionId'],'selections':_0x43cbcd};}async['afterInit'](){this['context']instanceof _t?this['_integrateEditor'](this['context']):this['listenTo'](this['context']['editors'],'add',(_0x350237,_0x48023f)=>{_0x48023f['on']('ready',()=>{this['_integrateEditor'](_0x48023f);});});}['_integrateEditor'](_0xa57537){_0xa57537['conversion']['for']('editingDowncast')['markerToHighlight']({'model':It,'view':{'classes':['ck-fake-ai-selection','ck-ai-assistant-ui_theme'],'priority':0xc}}),_0xa57537['conversion']['for']('dataDowncast')['markerToElement']({'model':It,'view':(_0x932b2a,{writer:_0x4842f7,options:_0x2a1719})=>_0x2a1719['convertAiChatSelectionMarker']?_0x4842f7['createUIElement'](_0x932b2a['markerName']+':'+(_0x932b2a['isOpening']?'start':'end')):null});}['showFakeVisualSelection'](_0x4a234a,_0xc73302,_0x2fdec4=!0x1,_0x171c11=!0x1){if(this['_displayedFakeSelectionLocked']&&!_0x171c11)return!0x1;const _0x13cfdd=ut(this['context'])['model'];return _0x13cfdd['change'](_0x5c64b3=>{this['_displayedFakeSelectionId']&&this['hideFakeVisualSelection'](this['_displayedFakeSelectionId']),this['_displayedFakeSelectionId']=_0xc73302,this['_displayedFakeSelectionLocked']=_0x2fdec4;let _0x3ddf08=0x0;for(let _0x1c140c of _0x4a234a){const _0x370249=It+':'+_0x3ddf08;if(_0x1c140c['start']['isAtEnd']){const _0x3bae49=_0x1c140c['start']['getLastMatchingPosition'](({item:_0x1a699e})=>!_0x13cfdd['schema']['isContent'](_0x1a699e),{'boundaries':_0x1c140c});_0x1c140c=_0x5c64b3['createRange'](_0x3bae49,_0x1c140c['end']);}_0x5c64b3['addMarker'](_0x370249,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x1c140c}),_0x3ddf08++;}}),window['getSelection']()?.['removeAllRanges'](),!0x0;}['hideFakeVisualSelection'](_0x3a4ff0){if(this['_displayedFakeSelectionId']!=_0x3a4ff0)return!0x1;this['_displayedFakeSelectionId']=null,this['_displayedFakeSelectionLocked']=!0x1;const _0x44284f=ut(this['context']),_0x1dc0ca=_0x44284f['model']['markers']['getMarkersGroup'](It);return _0x44284f['model']['change'](_0x288529=>{for(const _0x38d6e5 of _0x1dc0ca)_0x288529['removeMarker'](_0x38d6e5);}),!0x0;}['modelToViewWithIds'](_0x1df521){const _0x49ae64=ut(this['context']),_0x14818d=_0x49ae64['data']['toView'](_0x1df521),_0x437834=new Ft(_0x49ae64['editing']['view']['document']);return this['_setDataIdsOnChildren'](_0x14818d,_0x437834),_0x14818d;}['_setDataIdsOnChildren'](_0x4c2d52,_0x1bff85){let _0x345f16=!0x1;const _0x482b4b=new Set();for(const _0x5ad649 of _0x4c2d52['getChildren']()){const _0x3b2bcb=_0x5ad649['is']('emptyElement')||_0x5ad649['is']('containerElement');if(!_0x5ad649['is']('element'))continue;(this['_setDataIdsOnChildren'](_0x5ad649,_0x1bff85)||_0x3b2bcb)&&(_0x1bff85['setAttribute']('data-id',this['_nextDataId'](_0x482b4b),_0x5ad649),_0x345f16=!0x0);}return _0x345f16;}['_nextDataId'](_0x1d3646){let _0x3ea80d;do{_0x3ea80d='';for(let _0x1a0c3f=0x0;_0x1a0c3f<0x4;_0x1a0c3f++)_0x3ea80d+=String['fromCharCode'](0x61+Math['floor'](0x1a*Math['random']()));}while(_0x1d3646['has'](_0x3ea80d));return _0x1d3646['add'](_0x3ea80d),_0x3ea80d;}['getSelectionText'](){const {model:_0x4127d3}=ut(this['context']),_0x292285=_0x4127d3['document']['selection'],_0x4c825a=_0x4127d3['getSelectedContent'](_0x292285),_0x435d73=[],_0x4fc32e=_0x4127d3['createRangeIn'](_0x4c825a)['getWalker']();for(const {item:_0x154091}of _0x4fc32e)_0x154091['is']('$textProxy')?_0x435d73['push'](_0x154091['data']):_0x154091['is']('element')&&_0x435d73['length']>0x0&&'\x20'!==_0x435d73[_0x435d73['length']-0x1]&&_0x435d73['push']('\x20');return'\x22'+_0x435d73['join']('')['trim']()+'\x22';}['_getMarkersInDocumentOrder'](){const _0x241fed=ut(this['context'])['model'];return Array['from'](_0x241fed['markers']['getMarkersGroup'](It))['sort']((_0x5a8b4a,_0x2be942)=>_0x5a8b4a['getStart']()['isBefore'](_0x2be942['getStart']())?-0x1:_0x5a8b4a['getStart']()['isAfter'](_0x2be942['getStart']())?0x1:0x0);}}const et=['applySuggestion','insertSuggestion','showChangeInText'];class ah extends _0x43effc{['actionsButton'];['children'];['applySuggestionModel'];['showChangeInTextModel'];['insertSuggestionModel'];['_partsCount']=0x1;['_dropdownOriginalConfig'];['_dropdownCurrentConfig'];['_firstRender']=!0x0;constructor(_0xc432a0,_0x42e192){super(_0xc432a0),this['_dropdownOriginalConfig']=_0x42e192||[...et],this['_dropdownCurrentConfig']=[...this['_dropdownOriginalConfig']];const _0x17e0da=this['bindTemplate'];this['set']('isEnabled',!0x0),this['set']('isVisible',!0x0),this['set']('isTrackChangesOn',!0x1),this['applySuggestionModel']=new _0x3344bf({'label':Pn('applySuggestion',_0xc432a0,this['_partsCount']),'icon':_0x3cb840,'withText':!0x0,'type':'button','actionName':'applySuggestion'}),this['showChangeInTextModel']=new _0x3344bf({'label':Pn('showChangeInText',_0xc432a0,this['_partsCount']),'icon':_0x4e4a4d,'withText':!0x0,'type':'button','actionName':'showChangeInText'}),this['insertSuggestionModel']=new _0x3344bf({'label':Pn('insertSuggestion',_0xc432a0,this['_partsCount']),'icon':_0x5a38fc,'withText':!0x0,'type':'button','actionName':'insertSuggestion'}),this['actionsButton']=this['_createActionsDropdownOrButton'](_0xc432a0),this['children']=this['createCollection'](),this['actionsButton']&&this['children']['add'](this['actionsButton']),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__ai-suggestion__actions',_0x17e0da['if']('isVisible','ck-hidden',_0x5a77af=>!_0x5a77af)]},'children':this['children']}),this['on']('change:isTrackChangesOn',()=>{this['_dropdownCurrentConfig']=this['isTrackChangesOn']?this['_dropdownOriginalConfig']['filter'](_0x4855bc=>'applySuggestion'!==_0x4855bc):[...this['_dropdownOriginalConfig']],this['_updateDropdownActions'](_0xc432a0);});}['_updateDropdownActions'](_0x58a824){this['actionsButton']&&this['children']['has'](this['actionsButton'])&&(this['children']['remove'](this['actionsButton']),this['actionsButton']['destroy']()),this['actionsButton']=this['_createActionsDropdownOrButton'](_0x58a824),this['actionsButton']&&this['children']['add'](this['actionsButton']);}['_createActionsDropdownOrButton'](_0x4e1909){if(0x0==this['_dropdownCurrentConfig']['length'])return null;const _0x425171=0x1===this['_dropdownCurrentConfig']['length']?this['_createActionsButton'](_0x4e1909):this['_createActionsDropdown'](_0x4e1909),_0x292388=this['_firstRender']?'':'ck-ai-chat__feed__ai-suggestion__actions--no-animation';_0x425171['set']({'label':Pn(this['_dropdownCurrentConfig'][0x0],_0x4e1909,this['_partsCount']),'tooltip':Hn(this['_dropdownCurrentConfig'][0x0],_0x4e1909,this['_partsCount']),'withText':!0x0,'class':'ck-ai-chat__feed__ai-suggestion__actions\x20'+_0x292388});for(const _0x2f9551 of this['_dropdownCurrentConfig'])_0x425171['on'](_0x2f9551,()=>{this['fire'](_0x2f9551);});return this['_firstRender']=!0x1,_0x425171;}['_createActionsButton'](_0x583655){const _0x3f56be=new _0xcbb426(_0x583655);return _0x3f56be['set']({'class':'ck-ai-button-primary','withText':!0x0}),_0x3f56be['on']('execute',()=>{_0x3f56be['fire'](this['_dropdownCurrentConfig'][0x0]);}),_0x3f56be;}['_createActionsDropdown'](_0x2e4ead){const _0x2807d9=new Nn(_0x2e4ead,{'listItemModels':this['_dropdownCurrentConfig']['map'](_0x56eb7b=>{switch(_0x56eb7b){case'applySuggestion':return this['applySuggestionModel'];case'showChangeInText':return this['showChangeInTextModel'];case'insertSuggestion':return this['insertSuggestionModel'];}})});return _0x2807d9['set']({'label':Pn(this['_dropdownCurrentConfig'][0x0],_0x2e4ead,this['_partsCount']),'tooltip':Hn(this['_dropdownCurrentConfig'][0x0],_0x2e4ead,this['_partsCount']),'withText':!0x0,'class':'ck-ai-chat__feed__ai-suggestion__actions','balloonPanelClass':'ck-ai-chat__feed__ai-suggestion__actions__balloon'}),_0x2807d9['bind']('isEnabled')['to'](this),_0x2807d9;}['updateLabels'](_0x2ecf40){const _0x43befd=this['locale'];this['_partsCount']=_0x2ecf40||this['_partsCount'],this['actionsButton']['set']({'label':Pn(this['_dropdownCurrentConfig'][0x0],_0x43befd,this['_partsCount']),'tooltip':Hn(this['_dropdownCurrentConfig'][0x0],_0x43befd,this['_partsCount'])}),this['applySuggestionModel']['label']=Pn('applySuggestion',_0x43befd,this['_partsCount']),this['showChangeInTextModel']['label']=Pn('showChangeInText',_0x43befd,this['_partsCount']),this['insertSuggestionModel']['label']=Pn('insertSuggestion',_0x43befd,this['_partsCount']);}}class Nn extends _0x25f6a8{['bodyCollection'];['balloonPanelView'];['listView'];['keystrokeHandler'];constructor(_0x379f12,_0x234116){super(_0x379f12),this['balloonPanelView']=new _0x2ae23a(this['locale']),this['bodyCollection']=new _0x44dc72(this['locale']),this['bodyCollection']['attachToDom'](),this['set']('balloonPanelClass',''),this['balloonPanelView']['bind']('class')['to'](this,'balloonPanelClass'),this['listView']=this['_setUpList'](_0x234116['listItemModels']['slice'](0x1)),this['bodyCollection']['add'](this['balloonPanelView']),this['balloonPanelView']['content']['add'](this['listView']),this['arrowView']['unbind']('tooltip'),this['arrowView']['set']('tooltip',i(this['locale'],'AI_CHAT_SUGGESTION_MORE_OPTIONS_TOOLTIP')),this['_setUpKeystrokes'](),this['on']('execute',()=>{const _0xbace12=_0x234116['listItemModels'][0x0]['actionName'];this['fire'](_0xbace12),this['balloonPanelView']['hide'](),this['arrowView']['focus']();}),this['on']('open',()=>{this['balloonPanelView']['isVisible']?(this['balloonPanelView']['hide'](),this['arrowView']['focus']()):(this['balloonPanelView']['pin']({'target':this['element'],'positions':['ltr'===this['locale']['uiLanguageDirection']?Gn:yn]}),this['listView']['focus']());}),_0x4b855c({'emitter':this['balloonPanelView'],'callback':()=>{this['balloonPanelView']['hide']();},'activator':()=>this['balloonPanelView']['isVisible'],'contextElements':()=>[this['element'],this['balloonPanelView']['element']]});}['_setUpList'](_0x2d4aae){const _0x5bcfa0=this['locale'],_0x44ab7e=new _0x5bd1ba(_0x5bcfa0);for(const _0x46f1ce of _0x2d4aae){const _0x1c4383=new _0x3f0116(_0x5bcfa0),_0x4ddb39=new _0x2ab14c(_0x5bcfa0);_0x4ddb39['bind'](...Object['keys'](_0x46f1ce))['to'](_0x46f1ce),_0x4ddb39['delegate']('execute')['to'](_0x44ab7e),_0x1c4383['children']['add'](_0x4ddb39),_0x44ab7e['items']['add'](_0x1c4383);}return _0x44ab7e['items']['delegate']('execute')['to'](this),_0x44ab7e['on']('execute',_0x110fa9=>{const _0xe65d0a=_0x110fa9['source'];this['fire'](_0xe65d0a['actionName']),this['balloonPanelView']['hide'](),this['arrowView']['focus']();}),_0x44ab7e;}['_setUpKeystrokes'](){this['keystrokeHandler']=new _0xfe6d51(),this['keystrokeHandler']['listenTo'](this['balloonPanelView']['element']),this['keystrokeHandler']['set']('esc',(_0x176590,_0x518ec4)=>{this['balloonPanelView']['hide'](),this['arrowView']['focus'](),_0x518ec4();});}['destroy'](){super['destroy'](),this['keystrokeHandler']['destroy'](),this['balloonPanelView']['destroy'](),this['bodyCollection']['detachFromDom']();}}function Gn(_0x2b012e){return{'top':_0x2b012e['bottom'],'left':_0x2b012e['left'],'name':'arrowless','config':{'withArrow':!0x1}};}function yn(_0x1dc332,_0x5ddcea){return{'top':_0x1dc332['bottom'],'left':_0x1dc332['left']-(_0x5ddcea['width']-_0x1dc332['width']),'name':'arrowless','config':{'withArrow':!0x1}};}function Pn(_0x51d472,_0x196888,_0x4d2ad5){switch(_0x51d472){case'applySuggestion':return i(_0x196888,'AI_CHAT_SUGGESTION_ACTION_APPLY_LABEL',_0x4d2ad5);case'showChangeInText':return i(_0x196888,'AI_CHAT_SUGGESTION_ACTION_SHOW_CHANGE_IN_TEXT',_0x4d2ad5);case'insertSuggestion':return i(_0x196888,'AI_CHAT_SUGGESTION_ACTION_INSERT_SUGGESTION',_0x4d2ad5);}}function Hn(_0x389d68,_0x2f52b4,_0x4b1853){switch(_0x389d68){case'applySuggestion':return i(_0x2f52b4,'AI_CHAT_SUGGESTION_ACTION_APPLY_TOOLTIP',_0x4b1853);case'showChangeInText':return i(_0x2f52b4,'AI_CHAT_SUGGESTION_ACTION_SHOW_CHANGE_IN_TEXT_TOOLTIP',_0x4b1853);case'insertSuggestion':return i(_0x2f52b4,'AI_CHAT_SUGGESTION_ACTION_INSERT_SUGGESTION_TOOLTIP',_0x4b1853);}}class At extends _0x19d98c(){['_connector'];['_availableModels'];['_defaultModelId'];['_locale'];['_modelList']=[];constructor({connector:_0x58dfa8,availableModels:_0x47d77c,defaultModelId:_0x3e9298,locale:_0xed423a}){super(),this['_connector']=_0x58dfa8,this['_availableModels']=_0x47d77c,this['_defaultModelId']=_0x3e9298,this['_locale']=_0xed423a;}async['getAll'](){if(!this['_modelList']['length'])try{const _0x41400b=this['_locale']['uiLanguage']||'en',_0x4776c2=this['_connector']['getModels'](_0x41400b),_0x483cf4=await _0x4776c2['list']();this['_modelList']=_0x483cf4['items']['map'](_0x9564c4=>ze(_0x9564c4)?{..._0x9564c4,'name':i(this['_locale'],'AI_MODEL_NAME_AUTO')}:_0x9564c4);}catch(_0x41b7b4){throw ft('ai-models-unable-to-retrieve',{'error':_0x41b7b4}),_0x41b7b4;}return[...this['_modelList']];}async['getAvailableModels'](){const _0x216a37=await this['getAll']();return this['_filterModels'](_0x216a37,this['_availableModels']);}async['getModel'](_0x5a32e1){const _0x26921e=await this['getAll']();if(!_0x26921e['length'])return null;if(_0x5a32e1){const _0x34a1d0=this['_getModelById'](_0x26921e,_0x5a32e1);if(_0x34a1d0)return _0x34a1d0;_0x3219ae('ai-chat-model-id-unrecognized',{'modelId':_0x5a32e1,'fallBackModelId':this['_defaultModelId']});}return this['getDefault']();}async['getDefault'](){const _0x1ed004=await this['getAvailableModels']();if(!_0x1ed004['length'])return null;if(this['_defaultModelId']){const _0x40d211=this['_getModelById'](_0x1ed004,this['_defaultModelId']);if(_0x40d211)return _0x40d211;_0x3219ae('ai-chat-default-model-id-unrecognized',{'defaultModelId':this['_defaultModelId'],'fallBackModelId':_0x1ed004[0x0]['id']});}return _0x1ed004[0x0];}async['isAvailable'](_0x86fe2b){return(await this['getAvailableModels']())['some'](_0x247b98=>_0x247b98['name']===_0x86fe2b['name']&&_0x247b98['provider']===_0x86fe2b['provider']);}['_filterModels'](_0xb38136,_0xb372ed){let _0x3cb768;if(_0xb372ed){_0x3cb768=[];const _0x5abf15='string'==typeof _0xb372ed?[_0xb372ed['toLocaleLowerCase']()]:_0xb372ed['map'](_0x5ce9b6=>_0x5ce9b6['toLocaleLowerCase']());for(const _0x593475 of _0x5abf15)for(const _0x27ecec of _0xb38136)(_0x27ecec['id']['toLocaleLowerCase']()===_0x593475||_0x27ecec['name']['toLocaleLowerCase']()===_0x593475||ze(_0x27ecec)&&'auto'===_0x593475||_0x27ecec['provider']['toLocaleLowerCase']()===_0x593475||_0x27ecec['id']['toLocaleLowerCase']()['startsWith'](_0x593475))&&_0x3cb768['push'](_0x27ecec);}else _0x3cb768=_0xb38136;return _0x3cb768;}['_getModelById'](_0x2f98c4,_0x26bacd){return _0x2f98c4['find'](_0x20b9a6=>ze(_0x20b9a6)&&'auto'===_0x26bacd?_0x20b9a6:_0x20b9a6['id']===_0x26bacd)||null;}}function ze(_0x2572ba){return _0x2572ba['id']['startsWith']('agent');}function z({editor:_0x55987a,interaction:_0x2e0d55,reply:_0x30f479,groups:_0x43cf36,transform:_0x244737,documentCompare:_0x4c9e0b,documentCompareOptions:_0x2ca538}){const _0x18bf1a=_0x2e0d55['getDocumentContext']();if(!_0x18bf1a)return[];const _0x120b48=_0x18bf1a['content'],_0x1e68d7=_0x18bf1a['version'],_0x190f98=_0x30f479['documentContextContent']['cloneNode'](!0x0);for(const {changes:_0x1252cf}of _0x43cf36){const _0x4540d0=_0x1252cf['filter'](_0x26fa78=>'new'!=_0x26fa78['type'])['map'](_0x48c3ea=>Dt('data-id',_0x48c3ea['id'],_0x190f98)),_0x19f63b=_0x1252cf['filter'](_0x3a3b2b=>'removed'!=_0x3a3b2b['type'])['map'](_0x447d41=>_0x447d41['node']['cloneNode'](!0x0));let _0x4fa7b2=null;if(_0x4540d0['length']){_0x4fa7b2=_0x4540d0[0x0]['previousSibling'];for(let _0xe5a0a0=0x0;_0xe5a0a0<_0x4540d0['length'];_0xe5a0a0++)_0x1b183f(_0x4540d0[_0xe5a0a0]);}if(_0x19f63b['length']){_0x4fa7b2||(_0x1252cf[0x0]['anchorId']?_0x4fa7b2=Dt('data-id',_0x1252cf[0x0]['anchorId'],_0x190f98):(_0x4fa7b2=_0x19f63b['shift'](),_0x377b76(_0x190f98,_0x4fa7b2)));for(let _0x2192f8=0x0;_0x2192f8<_0x19f63b['length'];_0x2192f8++)_0x2301a3(_0x4fa7b2,_0x19f63b[_0x2192f8]),_0x4fa7b2=_0x19f63b[_0x2192f8];}}const _0xba0cf5=Ot(_0x190f98),_0x4fdcad=_0x4c9e0b['getDiff'](_0x120b48,_0xba0cf5,_0x2ca538)['getOperations']();if(_0x244737){const _0x4f35a1=_0x55987a['model']['document']['history']['getOperations'](_0x1e68d7),_0x35fff0={'document':_0x55987a['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1};return st(_0x4fdcad,_0x4f35a1,_0x35fff0)['operationsA'];}return _0x4fdcad;}function Y(_0x1d5411,_0x2d73f1){if('marker'!=_0x2d73f1['type'])return;const _0x556721=_0x1d5411['model']['markers']['get'](_0x2d73f1['name']);_0x556721&&(_0x2d73f1['oldRange']=_0x556721['getRange']());}class Lr extends _0x312a64{['copyButton'];['likeButton'];['dislikeButton'];['showChangesButton'];['_config'];constructor(_0x4fd133,_0x30b134={},_0x2a931a){super(_0x4fd133),this['set']('isLoading',!0x1),this['_config']={'showCopy':!0x1,'showLike':!0x1,'showDislike':!0x1,..._0x30b134};const _0x1a1685=!(this['_config']['showCopy']||this['_config']['showChanges']||this['_config']['showLike']||this['_config']['showDislike']||this['_config']['customView']?.['length']);this['class']=_0x1a1685?'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'](_0x2a931a),this['items']['add'](this['showChangesButton'])),this['_setupRatingButtons'](),this['_config']['showLike']&&this['items']['add'](this['likeButton']),this['_config']['showDislike']&&this['items']['add'](this['dislikeButton']),this['_config']['customView']&&this['items']['addMany'](this['_config']['customView']);}['_setupRatingButtons'](){this['likeButton']=new _0xcbb426(this['locale']),this['likeButton']['set']({'icon':_0x526026,'label':i(this['locale'],'AI_MINI_TOOLBAR_LIKE'),'tooltip':!0x0}),this['likeButton']['bind']('isEnabled')['to'](this,'isLoading',_0x52b3ce=>!_0x52b3ce),this['likeButton']['on']('execute',()=>{this['fire']('like');}),this['dislikeButton']=new _0xcbb426(this['locale']),this['dislikeButton']['set']({'icon':_0xbf231a,'label':i(this['locale'],'AI_MINI_TOOLBAR_DISLIKE'),'tooltip':!0x0}),this['dislikeButton']['bind']('isEnabled')['to'](this,'isLoading',_0x52b3ae=>!_0x52b3ae),this['dislikeButton']['on']('execute',()=>{this['fire']('dislike');});}['_setupCopyButton'](){this['copyButton']=new _0xcbb426(this['locale']),this['copyButton']['set']({'icon':_0x2178ff,'label':i(this['locale'],'AI_MINI_TOOLBAR_COPY'),'class':'ck-ai-mini-toolbar-copy-button','tooltip':!0x0}),this['copyButton']['bind']('isEnabled')['to'](this,'isLoading',_0x30dd65=>!_0x30dd65);const _0x2ad00d=new _0x4caa0b();_0x2ad00d['set']({'content':_0x16fc5d}),_0x2ad00d['extendTemplate']({'attributes':{'class':['ck-ai-mini-toolbar-copy-button__check-mark']}}),this['copyButton']['on']('execute',()=>{this['copyButton']['class']='ck-ai-mini-toolbar-copy-button\x20ck-ai-mini-toolbar-copy-button_copied',setTimeout(()=>{this['copyButton']['class']='ck-ai-mini-toolbar-copy-button';},0x7d0);}),this['copyButton']['children']['add'](_0x2ad00d);}['_setupShowChangesButton'](_0xb46260){this['showChangesButton']=new _0xcbb426(this['locale']),this['showChangesButton']['set']({'icon':_0x24690e,'label':i(this['locale'],'AI_SUGGESTION_BUTTON_SHOW_CHANGES'),'withText':'full'==this['_config']['showChanges'],'tooltip':'full'!=this['_config']['showChanges'],'isOn':_0xb46260}),this['showChangesButton']['bind']('isEnabled')['to'](this,'isLoading',_0x57b031=>!_0x57b031),this['showChangesButton']['on']('execute',()=>{const _0x50c633=!this['showChangesButton']['isOn'];this['showChangesButton']['set']({'isOn':_0x50c633,'icon':_0x50c633?_0x4c508d:_0x24690e}),this['fire']('toggleShowChanges',_0x50c633);});}}class Tr extends _0x43effc{['showChangesToggleView'];constructor(_0x3f6946,_0x14b3d7){super(_0x3f6946),this['set']('isShowChangesToggleVisible',!0x0),this['showChangesToggleView']=new Yr(_0x3f6946),this['showChangesToggleView']['set']({'class':'ck-ai-suggestion__header__show-changes-toggle\x20ck-ai-chat-controls-button','label':i(_0x3f6946,'AI_SUGGESTION_BUTTON_SHOW_CHANGES'),'withText':!0x0}),this['showChangesToggleView']['isOn']=_0x14b3d7['showDiff'],this['showChangesToggleView']['bind']('isVisible')['to'](this,'isShowChangesToggleVisible'),this['showChangesToggleView']['bind']('icon')['to'](this['showChangesToggleView'],'isOn',_0x5ea7e0=>_0x5ea7e0?_0x44c63f:_0x4f3f9b),this['showChangesToggleView']['on']('execute',()=>{this['showChangesToggleView']['isOn']=!this['showChangesToggleView']['isOn'],this['fire']('toggleShowChanges',{'isOn':this['showChangesToggleView']['isOn']});});const _0x38aed3=new _0x4caa0b();_0x38aed3['content']=_0x193d2b,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__header',!0x1===_0x14b3d7['showHeader']?'ck-hidden':null]['filter'](Boolean)},'children':[_0x38aed3,{'tag':'span','children':[i(_0x3f6946,'AI_SUGGESTION_HEADER_TITLE')]},this['showChangesToggleView']]});}}class Yr extends _0xcbb426{['render'](){super['render'](),this['children']['remove'](this['iconView']),this['children']['add'](this['iconView']);}}class ha{['options'];['isStreaming']=!0x1;['document']=null;['nodesList']=[];['currentIndex']=0x0;['timeoutAbortController']=null;constructor(_0x27f5cc){this['options']={'delay':_0x27f5cc['delay']??0x14,'textNodeStyle':_0x27f5cc['textNodeStyle'],'onStreamUpdate':_0x27f5cc['onStreamUpdate']||(()=>{})};}async['stream']({document:_0x49b23c,targetElement:_0x466ac0,abortSignal:_0x2ac3e0}){this['isStreaming']&&this['stop'](),_0x2ac3e0?.['addEventListener']('abort',this['stop']['bind'](this)),this['document']=_0xdcae32(_0x49b23c,!0x0),this['nodesList']=this['getParsedDocumentNodeList'](),this['isStreaming']=!0x0,this['currentIndex']>this['nodesList']['length']&&(_0x3219ae('ai-html-streamer-current-index-out-of-bounds',{'currentIndex':this['currentIndex'],'nodeList':this['nodesList']}),this['currentIndex']=this['nodesList']['length']);for(let _0x22ff61=0x0;_0x22ff61<this['currentIndex'];_0x22ff61++)this['nodesList'][_0x22ff61]['shouldBeStreamed']=!0x0;let _0x4c5bb9=0x0;for(let _0x4ebcf5=this['currentIndex'];_0x4ebcf5<this['nodesList']['length'];_0x4ebcf5++){const _0x4c6e4b=Date['now'](),_0x1ce9e4=this['nodesList'][_0x4ebcf5],_0x5ce969=_0x4c6e4b-_0x4c5bb9;_0x1ce9e4['shouldBeStreamed']=!0x0;let _0x1b6482=_0x1ce9e4['parent'];for(;_0x1b6482;)_0x1b6482['shouldBeStreamed']=!0x0,_0x1b6482=_0x1b6482['parent'];if(_0x5ce969<this['options']['delay'])try{const {promise:_0xdca0d9,abortController:_0x5b6059}=pr(this['options']['delay']-_0x5ce969);this['timeoutAbortController']=_0x5b6059,await _0xdca0d9;}catch(_0x4b6643){return;}_0x34c121(_0x466ac0,'<'+_0x466ac0['tagName']+'>'+this['renderNode'](this['document'])+'</'+_0x466ac0['tagName']+'>',{'childrenOnly':!0x0}),this['options']['onStreamUpdate']&&this['options']['onStreamUpdate'](),this['currentIndex']=_0x4ebcf5,_0x4c5bb9=Date['now']();}this['isStreaming']=!0x1;}['cleanUpAnimations']({targetElement:_0x559319}){Array['from'](_0x559319['querySelectorAll']('span[data-ck-html-streamer-word-chunk]'))['reverse']()['forEach'](_0x41194=>{_0x41194['replaceWith'](_0x41194['childNodes'][0x0]);});}['stop'](){this['isStreaming']=!0x1,this['timeoutAbortController']&&(this['timeoutAbortController']['abort'](),this['timeoutAbortController']=null);}['renderNode'](_0x21964c){let _0x245a7c='';if(function(_0x25ca3a){return _0x59f677(_0x25ca3a);}(_0x21964c)){for(const _0x2fbe30 of _0x21964c['children'])_0x245a7c+=this['renderNode'](_0x2fbe30);}else{if(dr(_0x21964c)){if(!_0x21964c['shouldBeStreamed'])return'';const _0xb8bb0f=_0x21964c,_0x121952=Object['entries'](_0xb8bb0f['attribs'])['map'](([_0x362b1c,_0x4be4ad])=>_0x362b1c+'=\x22'+_0x4be4ad+'\x22')['join']('\x20');_0x245a7c+='<'+_0xb8bb0f['tagName']+(_0x121952?'\x20'+_0x121952:'')+'>';for(const _0x338f1e of _0x2bc64a(_0xb8bb0f))_0x245a7c+=this['renderNode'](_0x338f1e);_0x245a7c+='</'+_0xb8bb0f['tagName']+'>';}else{if(!ar(_0x21964c))return'';if(!_0x21964c['shouldBeStreamed'])return'';!function(_0x864f8e){if(!_0x864f8e['parent']||!dr(_0x864f8e['parent']))return!0x1;if(!cr['includes'](_0x864f8e['parent']['tagName']))return!0x1;return!_0x1f24f8(_0x864f8e)['match'](/^\s*[<>]\s*$/);}(_0x21964c)?_0x245a7c+=_0x4b71ff(_0x21964c):_0x245a7c+=_0x4b71ff(new _0xec973e('span',{'data-ck-html-streamer-word-chunk':'','style':this['options']['textNodeStyle']},[_0x21964c]));}}return _0x245a7c;}['getParsedDocumentNodeList'](){const _0x329699=[];return function(_0x5bd166,_0x603e6b){const _0x129d97=_0x4ba272=>{if(_0x603e6b(_0x4ba272),_0x4ba272 instanceof _0x1f4fb6)for(let _0x494b1f=0x0;_0x494b1f<_0x4ba272['children']['length'];_0x494b1f++){const _0x252e58=_0x4ba272['children'][_0x494b1f];_0x129d97(_0x252e58);}};for(let _0x26e2fb=0x0;_0x26e2fb<_0x5bd166['children']['length'];_0x26e2fb++)_0x129d97(_0x5bd166['children'][_0x26e2fb]);}(this['document'],_0x4f4f09=>{if(ar(_0x4f4f09)){const _0x3689d7=this['splitTextNodeIntoWordNodes'](_0x4f4f09);_0x3689d7['length']&&_0x329699['push'](..._0x3689d7);}_0x4f4f09['isWordSplitSource']||_0x4f4f09['isWordSplitResult']||_0x329699['push'](_0x4f4f09);}),_0x329699;}['splitTextNodeIntoWordNodes'](_0xc4024e){if(_0xc4024e['isWordSplitSource']||_0xc4024e['isWordSplitResult'])return[];const _0x547e87=_0x1f24f8(_0xc4024e)['match'](/(?:\s*\S+\s*)/g),_0x3494d7=[];if(_0x547e87&&_0x547e87['length']>0x1){for(const _0x3e298d of _0x547e87){const _0x23a7cc=new _0x4e1833(_0x3e298d);_0x23a7cc['isWordSplitResult']=!0x0,_0x4c7871(_0xc4024e,_0x23a7cc),_0x3494d7['push'](_0x23a7cc);}_0xc4024e['isWordSplitSource']=!0x0,_0x1b183f(_0xc4024e);}return _0x3494d7;}}const cr=['p','li','td','th','span','h1','h2','h3','h4','h5','h6','b','strong','i','em','mark','del','ins','sup','sub','a','code','div'];function ar(_0x444d31){return _0xa705c(_0x444d31);}function dr(_0x569be2){return _0x499346(_0x569be2);}function pr(_0x2a6d69){const _0x5de601=new AbortController();return{'promise':new Promise((_0x3a3e12,_0x5e53bb)=>{const _0x1973dd=setTimeout(_0x3a3e12,_0x2a6d69);_0x5de601['signal']['addEventListener']('abort',()=>{clearTimeout(_0x1973dd),_0x5e53bb();});}),'abortController':_0x5de601};}const Ee=['showChangeInText','insertSuggestion','applySuggestion','rejectSuggestion','mouseOverSuggestion','mouseLeaveSuggestion','toggleSuggestionDisplayMode','like','dislike'];class na extends _0x43effc{['htmlStreamer'];['children'];['headerView'];['contentView'];constructor(_0x185ecf,{part:_0x54b350,uiIndex:_0x4c9625,areActionsDisabled:_0x38298e,availableActions:_0x56989b}){super(_0x185ecf),this['set']('partDefinition',_0x54b350),this['set']('state','pending'),this['set']('isVisible',!0x1),this['bind']('isEnabled')['to'](this,'state',_0x46f71e=>'pending'==_0x46f71e&&!_0x38298e),this['children']=this['createCollection'](),this['htmlStreamer']=new ha({'textNodeStyle':'animation:\x20ck-html-streamer-fade-in\x20.5s','delay':0x14}),this['headerView']=new Un(_0x185ecf,{'part':_0x54b350,'uiIndex':_0x4c9625,'availableActions':_0x56989b}),this['headerView']['bind']('partDefinition')['to'](this),this['headerView']['bind']('isEnabled')['to'](this),this['headerView']['bind']('state')['to'](this),this['headerView']['delegate'](...Ee)['to'](this);const _0x496cf2=this['bindTemplate'];this['contentView']=new _0x43effc(),this['contentView']['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content','ck-reset_all-excluded','ck-ai-suggestion__body__content-part__content']}}),this['children']['addMany']([this['contentView']]),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__body__content-part',_0x496cf2['to']('state',_0x436b30=>'ck-ai-suggestion__body__content-part_'+_0x436b30),_0x496cf2['to']('isEnabled',_0xdfc4e6=>_0xdfc4e6?'ck-ai-suggestion__body__content-part_active':void 0x0),_0x496cf2['if']('isVisible','ck-hidden',_0x5af501=>!_0x5af501)]},'children':this['children'],'on':{'mouseenter':_0x496cf2['to'](()=>{this['isEnabled']&&this['fire']('mouseOverSuggestion',{'index':_0x54b350['index']});}),'mouseleave':_0x496cf2['to'](()=>{this['isEnabled']&&this['fire']('mouseLeaveSuggestion',{'index':_0x54b350['index']});})}});}async['updateContent']({part:_0x5f0639,renderingStrategy:_0x142869,showUnchangedParts:_0x531d25=!0x1,abortSignal:_0x227a6d}){this['partDefinition']=_0x5f0639,this['isVisible']=this['partDefinition']['hasChanges']||_0x531d25,this['isVisible']&&('streaming'===_0x142869?await this['htmlStreamer']['stream']({'document':this['partDefinition']['content'],'targetElement':this['contentView']['element'],'abortSignal':_0x227a6d}):this['contentView']['element']['innerHTML']=Ot(this['partDefinition']['content']));}['toggleHeader'](_0x3cb42f){_0x3cb42f?this['children']['has'](this['headerView'])||this['children']['add'](this['headerView'],0x0):this['children']['has'](this['headerView'])&&this['children']['remove'](this['headerView']);}}class Un extends _0x43effc{['children'];['_toolbarView'];['_iconStateAccepted'];['_iconStateRejected'];['_iconStateOutdated'];constructor(_0x399e95,{part:_0x46f1a4,uiIndex:_0x299cee,availableActions:_0x43e3a1}){super(_0x399e95),this['set']('partDefinition',_0x46f1a4),this['set']('isEnabled',!0x0),this['set']('state','pending');const _0x245a73=new _0x4caa0b();_0x245a73['content']=_0x2fb154,_0x245a73['extendTemplate']({'attributes':{'class':['ck-ai-suggestion__body__content-part__icon-title']}});const _0x30040e=[];if(_0x43e3a1['includes']('showChangeInText')){const _0x570e40=new _0xcbb426(_0x399e95);_0x570e40['set']({'label':i(_0x399e95,'AI_SUGGESTION_CONTENT_PART_SHOW_IN_THE_TEXT'),'tooltip':!0x0,'withText':!0x1,'icon':_0x4e4a4d}),_0x570e40['bind']('isEnabled')['to'](this),_0x570e40['on']('execute',()=>{this['fire']('showChangeInText',{'index':_0x46f1a4['index']});}),_0x30040e['push'](_0x570e40);}if(_0x43e3a1['includes']('insertSuggestion')){const _0x592d0c=new _0xcbb426(_0x399e95);_0x592d0c['set']({'label':i(_0x399e95,'AI_SUGGESTION_CONTENT_PART_ADD_AS_SUGGESTION'),'tooltip':!0x0,'withText':!0x1,'icon':_0x5a38fc}),_0x592d0c['bind']('isEnabled')['to'](this),_0x592d0c['on']('execute',()=>{this['fire']('insertSuggestion',{'index':_0x46f1a4['index']});}),_0x30040e['push'](_0x592d0c);}const _0x164cd6=new _0xcbb426(_0x399e95);_0x164cd6['set']({'label':i(_0x399e95,'AI_SUGGESTION_CONTENT_PART_DELETE'),'tooltip':!0x0,'withText':!0x1,'icon':_0x5472b4}),_0x164cd6['bind']('isEnabled')['to'](this),_0x164cd6['on']('execute',()=>{this['fire']('rejectSuggestion',{'index':_0x46f1a4['index']});}),_0x30040e['push'](_0x164cd6),this['_toolbarView']=new _0x312a64(_0x399e95),this['_toolbarView']['items']['addMany'](_0x30040e),this['_iconStateAccepted']=new _0x4caa0b(),this['_iconStateAccepted']['content']=_0x411438,this['_iconStateAccepted']['extendTemplate']({'attributes':{'class':['ck-ai-suggestion__body__content-part__icon-accepted'],'data-cke-tooltip-text':i(_0x399e95,'AI_SUGGESTION_CONTENT_PART_ALREADY_APPLIED'),'data-cke-tooltip-position':'n'}}),this['_iconStateRejected']=new _0x4caa0b(),this['_iconStateRejected']['content']=_0x4b0f8d,this['_iconStateRejected']['extendTemplate']({'attributes':{'class':['ck-ai-suggestion__body__content-part__icon-rejected'],'data-cke-tooltip-text':i(_0x399e95,'AI_SUGGESTION_CONTENT_PART_REJECTED'),'data-cke-tooltip-position':'n'}}),this['_iconStateOutdated']=new _0x4caa0b(),this['_iconStateOutdated']['content']=_0x4b0f8d,this['_iconStateOutdated']['extendTemplate']({'attributes':{'class':['ck-ai-suggestion__body__content-part__icon-outdated'],'data-cke-tooltip-text':i(_0x399e95,'AI_SUGGESTION_CONTENT_PART_OUTDATED'),'data-cke-tooltip-position':'n'}});const _0x2f7dfd=new _0x43effc(_0x399e95);_0x2f7dfd['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-suggestion__body__content-part__title__label']},'children':[i(_0x399e95,'AI_SUGGESTION_CONTENT_PART_TITLE',_0x299cee['toString']())]}),this['children']=this['createCollection'](),this['children']['addMany']([_0x245a73,_0x2f7dfd,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',(_0x194433,_0x56c5e2,_0x5491f7,_0xb9f795)=>{switch(_0xb9f795){case'pending':this['children']['remove'](this['_toolbarView']);break;case'accepted':this['children']['remove'](this['_iconStateAccepted']);break;case'rejected':this['children']['remove'](this['_iconStateRejected']);break;case'outdated':this['children']['remove'](this['_iconStateOutdated']);}switch(_0x5491f7){case'pending':this['children']['add'](this['_toolbarView']);break;case'accepted':this['children']['add'](this['_iconStateAccepted']);break;case'rejected':this['children']['add'](this['_iconStateRejected']);break;case'outdated':this['children']['add'](this['_iconStateOutdated']);}});}}class W extends _0x19d98c(){['queue']=[];['isProcessing']=!0x1;['_abortController'];async['enqueue'](_0x49fb90){const _0x4d0f25=this['createTask'](_0x49fb90);return this['queue']['push'](_0x4d0f25),this['_processQueue'](),_0x4d0f25['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(_0x5989f3=>{this['once']('_queueEmpty',()=>{_0x5989f3();});}):Promise['resolve']();}async['_processQueue'](){if(!this['isProcessing']){this['_abortController']=new AbortController(),this['isProcessing']=!0x0;try{for(;this['queue']['length']&&this['isProcessing'];){const _0x1cea8e=this['queue']['shift']();try{await _0x1cea8e['callback'](this['_abortController']['signal']),_0x1cea8e['resolve']();}catch(_0x510ea2){_0x1cea8e['reject'](_0x510ea2);}}}finally{this['isProcessing']=!0x1,this['_abortController']=void 0x0;}this['fire']('_queueEmpty');}}['createTask'](_0x4f0a74){let _0x40f4e6,_0x5d7249;const _0x3571d7=new Promise((_0xcfbf8a,_0x26b005)=>{_0x40f4e6=_0xcfbf8a,_0x5d7249=_0x26b005;});return{'callback':_0x4f0a74,'resolve':_0x40f4e6,'reject':_0x5d7249,'completePromise':_0x3571d7};}}class Fr extends _0x43effc{['options'];['content']='';['htmlStreamer'];['children'];constructor(_0xb1c7da){super();const _0x4caea2=this['bindTemplate'];this['set']('isDone',!0x1),this['set']('isVisible',!0x0),this['htmlStreamer']=new ha({'textNodeStyle':'animation:\x20ck-html-streamer-fade-in\x20.5s','delay':0x14}),this['options']=_0xb1c7da,this['children']=this['createCollection'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__item',_0x4caea2['if']('isDone','ck-ai-chat__feed__item_done'),_0x4caea2['if']('isVisible','ck-hidden',_0x4c39ab=>!_0x4c39ab),'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'](_0x11126b=>{_0x11126b['removeAttribute']('data-id');}),this['isDone']=!0x0;}async['streamIntoElement'](_0x406484,_0x36530c,_0x5a79e2){await this['htmlStreamer']['stream']({'document':_0x406484,'targetElement':_0x36530c,'abortSignal':_0x5a79e2});}}class Oe extends Fr{constructor(_0x3e7d76){super(_0x3e7d76),this['extendTemplate']({'attributes':{'class':['ck-ai-notification','warning'===_0x3e7d76['level']?'ck-ai-notification_warning':'ck-ai-notification_error']}});}['render'](){super['render'](),this['setContent'](this['options']['initialContent']),this['markAsDone']();}['setContent'](_0x413972){this['element']['innerHTML']=_0x413972;}}class Dr extends _0x43effc{['_children'];['_areActionsDisabled'];['_showUnchangedParts'];['_updateContentPartsPromiseQueue'];['_emptyPartsWarningView'];['_availableActions'];['_cachedContentParts']=[];constructor(_0x5b726e,_0x5d5d2a){super(_0x5b726e);const {areActionsDisabled:_0x2552e6,showUnchangedParts:_0x11dd2b,availableActions:_0x487da9}=_0x5d5d2a;this['_areActionsDisabled']=_0x2552e6,this['_showUnchangedParts']=_0x11dd2b,this['_availableActions']=_0x487da9,this['set']('hasPendingParts',!0x1),this['_children']=this['createCollection'](),this['_updateContentPartsPromiseQueue']=new W(),this['_emptyPartsWarningView']=new Oe({'id':'empty-parts-warning','initialContent':i(_0x5b726e,'AI_SUGGESTION_EMPTY_PART_WARNING'),'level':'warning'}),this['_emptyPartsWarningView']['isVisible']=!0x1,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__body']},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__body__content-parts']},'children':this['_children']},this['_emptyPartsWarningView']]});}get['partsCount'](){return this['_children']['length'];}async['updateContentParts']({parts:_0x5f3908,renderingStrategy:_0xd80f06,abortSignal:_0x310e4c}){this['_children']['length']?_0x5f3908['forEach'](_0xa19437=>{const _0x217151=this['_cachedContentParts']['findIndex'](_0x5135e8=>_0x5135e8['index']==_0xa19437['index']);-0x1===_0x217151?this['_cachedContentParts']['push'](_0xa19437):this['_cachedContentParts'][_0x217151]=_0xa19437;}):this['_cachedContentParts']=_0x5f3908;for(const _0x4d683c of _0x5f3908['filter'](_0x180d8f=>_0x180d8f['hasChanges']))this['_updateContentPartsPromiseQueue']['enqueue'](async _0x2cc9c0=>{let _0x3f8de1=this['getPartView'](_0x4d683c['index']);_0x3f8de1||(_0x3f8de1=new na(this['locale'],{'part':_0x4d683c,'uiIndex':this['_children']['length']+0x1,'areActionsDisabled':this['_areActionsDisabled'],'availableActions':this['_availableActions']}),_0x3f8de1['delegate'](...Ee)['to'](this),this['_children']['add'](_0x3f8de1),this['hasPendingParts']=!0x0),0x2===this['_children']['length']&&this['_children']['first']['toggleHeader'](!0x0),_0x3f8de1['toggleHeader'](this['_children']['length']>0x1),await _0x3f8de1['updateContent']({'part':_0x4d683c,'renderingStrategy':_0xd80f06,'showUnchangedParts':this['_showUnchangedParts'],'abortSignal':_0x2cc9c0});});return _0x310e4c?.['addEventListener']('abort',()=>{this['_updateContentPartsPromiseQueue']['abort']();}),this['_updateContentPartsPromiseQueue']['queueEmptyPromise'];}['updatePartState'](_0x15c20e,_0x52776c){const _0x5164ff=this['getPartView'](_0x15c20e);_0x5164ff&&(_0x5164ff['state']=_0x52776c),this['hasPendingParts']='pending'==_0x52776c||Array['from'](this['_children'])['some'](_0x4c0d3e=>'pending'==_0x4c0d3e['state']);}['getPartView'](_0x4bbd65){return this['_children']['find'](_0x4a9bca=>_0x4a9bca['partDefinition']['index']==_0x4bbd65)??null;}['markAsDone'](){if(!this['_showUnchangedParts']){const _0x4f1ca1=!this['_cachedContentParts']['find'](({hasChanges:_0x251372})=>_0x251372),_0x1ce9a0=!!this['_cachedContentParts']['find'](({hasChanges:_0xe7dded})=>!_0xe7dded);this['_emptyPartsWarningView']['isVisible']=0x0==this['_children']['length']||_0x1ce9a0,_0x4f1ca1?this['_emptyPartsWarningView']['setContent'](i(this['locale'],'AI_SUGGESTION_NO_PARTS_WARNING')):this['_emptyPartsWarningView']['setContent'](i(this['locale'],'AI_SUGGESTION_EMPTY_PART_WARNING'));}}get['hasNonEmptyParts'](){return!!this['_children']['find'](_0x1bf491=>_0x1bf491['partDefinition']['hasChanges']);}}class We extends _0x5da037{constructor(_0x44916f=void 0x0){super();const _0x148a7e=_0x44916f?'ck-ai-spinner_'+_0x44916f:'';this['extendTemplate']({'tag':'span','attributes':{'class':['ck-ai-spinner',_0x148a7e]}});}}class T extends _0x43effc{['bodyView'];['miniToolbarView'];['children'];['headerView'];['loaderView'];['errorView'];['sourcesView'];['_bodyCollection'];constructor(_0xf7364c,_0x563da0,_0x20cf13){super(_0xf7364c),this['_bodyCollection']=_0x20cf13;const {showDiff:_0x45922b,areActionsDisabled:_0x5a7082,miniToolbarConfig:_0x3f5a91,hideHeader:_0x59974f,showLoader:_0x2a7173,showUnchangedParts:_0x3db276,availableActions:_0x341d20}=_0x563da0;this['set']('areChangesVisible',!0x1),this['set']('isLoaderVisible',!!_0x2a7173),this['set']('isErrorVisible',!0x1),this['set']('isLoading',!0x1),this['children']=this['createCollection'](),_0x59974f||(this['headerView']=new Tr(_0xf7364c,{'showDiff':_0x45922b}),this['headerView']['on']('toggleShowChanges',(_0x27025a,_0x2a9089)=>{this['areChangesVisible']=_0x2a9089['isOn'],this['fire']('toggleSuggestionDisplayMode',{'showDiff':_0x2a9089['isOn']});}),this['children']['add'](this['headerView'])),this['bodyView']=new Dr(_0xf7364c,{'areActionsDisabled':_0x5a7082,'showUnchangedParts':!!_0x3db276,'availableActions':_0x341d20}),this['bodyView']['delegate'](...Ee)['to'](this),this['bodyView']['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isLoaderVisible','ck-hidden'),this['bindTemplate']['if']('isErrorVisible','ck-hidden')]}}),this['miniToolbarView']=new Lr(_0xf7364c,_0x3f5a91,_0x45922b),this['miniToolbarView']['delegate'](...Ee)['to'](this),this['miniToolbarView']['on']('toggleShowChanges',(_0xb1ed59,_0x2f0f69)=>{this['areChangesVisible']=_0x2f0f69,this['fire']('toggleSuggestionDisplayMode',{'showDiff':_0x2f0f69});}),this['miniToolbarView']['bind']('isLoading')['to'](this),this['children']['add'](this['bodyView']),this['children']['add'](this['miniToolbarView']),this['sourcesView']=new Sr(this['locale'],this['_bodyCollection']),this['children']['add'](this['sourcesView']),_0x2a7173&&(this['loaderView']=this['_createLoaderView'](),this['children']['add'](this['loaderView'])),this['errorView']=this['_createErrorView'](),this['children']['add'](this['errorView']),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__container','ck-rounded-corners']},'children':this['children']});}async['updateContent'](_0x27b841){await this['bodyView']['updateContentParts'](_0x27b841);}['updateSources'](_0x5e7806){const _0x329958=this['sourcesView'],_0x15bf25=_0x329958['balloonPanelView'];_0x329958['children']['addMany'](_0x5e7806['map'](_0x122443=>new Rr(this['locale'],_0x122443,_0x15bf25))),_0x329958['isVisible']=!0x0;}['showLoader'](){this['loaderView']&&(this['isLoaderVisible']=!0x0);}['hideLoader'](){this['loaderView']&&(this['isLoaderVisible']=!0x1);}['showError'](_0x2ef342){if(this['errorView']){const _0x4ce7b4=this['errorView']['element']?.['querySelector']('.ck-ai-suggestion__error-text');_0x4ce7b4&&(_0x4ce7b4['textContent']=_0x2ef342),this['isErrorVisible']=!0x0;}}['hideError'](){this['errorView']&&(this['isErrorVisible']=!0x1);}['markAsDone'](){this['bodyView']['markAsDone'](),this['headerView']&&(this['headerView']['isShowChangesToggleVisible']=this['bodyView']['hasNonEmptyParts']);}['setLoading'](){this['isLoading']=!0x0;}['clearLoading'](){this['isLoading']=!0x1;}['setErrorState'](){this['miniToolbarView']&&(this['miniToolbarView']['isLoading']=!0x0),this['headerView']?.['showChangesToggleView']&&(this['headerView']['showChangesToggleView']['isEnabled']=!0x1);}['clearErrorState'](){this['miniToolbarView']&&(this['miniToolbarView']['isLoading']=!0x1),this['headerView']?.['showChangesToggleView']&&(this['headerView']['showChangesToggleView']['isEnabled']=!0x0);}['addNavigationItem'](_0x428e28){this['miniToolbarView']['items']['add'](_0x428e28);}['removeNavigationItem'](_0x583bfd){this['miniToolbarView']['items']['remove'](_0x583bfd);}['_createLoaderView'](){const _0x3e9d67=new _0x43effc(this['locale']),_0x555191=new We('small');_0x555191['isVisible']=!0x0;const _0x4ba11b=new _0x43effc(this['locale']);return _0x4ba11b['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-suggestion__loader-text']},'children':[i(this['locale'],'AI_CHAT_IS_WRITING')]}),_0x3e9d67['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__loader',this['bindTemplate']['if']('isLoaderVisible','ck-hidden',_0x1f4be2=>!_0x1f4be2)]},'children':[_0x555191,_0x4ba11b]}),_0x3e9d67;}['_createErrorView'](){const _0x400286=new _0x43effc(this['locale']),_0x45fade=new _0x43effc(this['locale']);return _0x45fade['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-suggestion__error-text']},'children':[i(this['locale'],'AI_CHAT_GENERIC_ERROR')]}),_0x400286['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__error',this['bindTemplate']['if']('isErrorVisible','ck-hidden',_0x34a50e=>!_0x34a50e)]},'children':[_0x45fade]}),_0x400286;}}class Sr extends _0x43effc{['children'];['balloonPanelView'];['bodyCollection'];constructor(_0x1f54dd,_0x33f0bf){super(_0x1f54dd),this['bodyCollection']=_0x33f0bf,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',_0x4dcdb7=>!_0x4dcdb7)]},'children':this['children']});const _0x230da9=new _0x43effc(this['locale']),_0x566604=new _0x4caa0b();_0x566604['content']=_0x46b22c,_0x230da9['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-web-sources__header']},'children':[_0x566604,{'tag':'span','children':[{'text':i(this['locale'],'AI_CHAT_SOURCES_HEADER')}]}]}),this['children']['add'](_0x230da9),this['_setupBalloonPanel'](_0x1f54dd);}['_setupBalloonPanel'](_0x2448dc){this['balloonPanelView']=new _0x2ae23a(_0x2448dc),this['balloonPanelView']['extendTemplate']({'attributes':{'class':['ck-ai-web-source__tooltip-balloon']}}),this['bodyCollection']['add'](this['balloonPanelView']);}}class Rr extends _0xcbb426{['balloonPanelView'];['source'];constructor(_0x2bbe88,_0x344cdc,_0x3d62ca){super(_0x2bbe88),this['source']=_0x344cdc,this['balloonPanelView']=_0x3d62ca,this['set']({'label':_0x344cdc['title'],'class':['ck\x20ck-ai-web-source'],'withText':!0x0});const _0x144ff0=this['bindTemplate'];if(this['extendTemplate']({'on':{'click':_0x144ff0['to'](()=>{window['open'](_0x344cdc['url'],'_blank');}),'mouseenter':_0x144ff0['to'](()=>{this['_showTooltip']();}),'mouseleave':_0x144ff0['to'](()=>{this['_hideTooltip']();})}}),_0x344cdc['favicon']){const _0x269fa2=new _0x43effc(_0x2bbe88);_0x269fa2['setTemplate']({'tag':'img','attributes':{'src':_0x344cdc['favicon']||_0x46b22c,'alt':_0x344cdc['title'],'class':['ck-ai-web-source__image']}}),this['children']['add'](_0x269fa2);}else this['set']('icon',_0x46b22c);}['_createTooltipContentView'](_0x34b41f,_0x3171b5){const _0xfd6e5d=new _0x43effc(_0x34b41f),_0x5e4970=[];let _0x16f916;_0x3171b5?.['favicon']?(_0x16f916=new _0x43effc(_0x34b41f),_0x16f916['setTemplate']({'tag':'img','attributes':{'src':_0x3171b5['favicon'],'alt':_0x3171b5['title'],'class':['ck-ai-web-source__tooltip-image']}})):(_0x16f916=new _0x4caa0b(),_0x16f916['content']=_0x46b22c,_0x16f916['extendTemplate']({'attributes':{'alt':_0x3171b5['title'],'class':['ck-ai-web-source__tooltip-image']}})),_0x5e4970['push'](_0x16f916);const _0x1620d2=new _0x43effc(_0x34b41f);_0x1620d2['setTemplate']({'tag':'a','attributes':{'class':['ck-ai-web-source__tooltip-url'],'href':_0x3171b5['url']},'children':[{'text':new URL(_0x3171b5['url'])?.['hostname']}]}),_0x5e4970['push'](_0x1620d2);const _0xfaa3f3=new _0x43effc(_0x34b41f);_0xfaa3f3['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-web-source__tooltip-row']},'children':_0x5e4970});const _0x16bff1=new _0x43effc(_0x34b41f);return _0x16bff1['setTemplate']({'tag':'span','attributes':{'class':['ck-ai-web-source__tooltip-row','ck-ai-web-source__tooltip-title']},'children':[{'text':_0x3171b5['title']['length']>0x190?_0x3171b5['title']['substring'](0x0,0x190)+'...':_0x3171b5['title']}]}),_0xfd6e5d['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-web-source__tooltip']},'children':[_0xfaa3f3,_0x16bff1]}),_0xfd6e5d;}['_showTooltip'](){this['_updateTooltipContent'](),this['balloonPanelView']['pin']({'target':this['element'],'positions':[_0x2ae23a['defaultPositions']['northArrowSouth'],_0x2ae23a['defaultPositions']['northArrowSouthWest'],_0x2ae23a['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 _0x29b3b0=this['_createTooltipContentView'](this['locale'],this['source']);this['balloonPanelView']['content']['add'](_0x29b3b0);}}class cs extends _0x312a64{constructor(_0x4c16d6,_0x440f4f=!0x0,_0x55d679=!0x0){super(_0x4c16d6),this['set']('isLoading',!0x1),_0x440f4f&&(this['applyButton']=this['_createButton'](i(_0x4c16d6,'AI_BALLOON_APPLY_BUTTON'),'ck-ai-button-primary'),this['applyButton']['bind']('isEnabled')['to'](this,'isLoading',_0xf923e9=>!_0xf923e9),this['items']['add'](this['applyButton'])),_0x55d679&&(this['suggestButton']=this['_createButton'](i(_0x4c16d6,'AI_BALLOON_SUGGEST_BUTTON'),_0x440f4f?'ck-ai-button-secondary':'ck-ai-button-primary'),this['suggestButton']['bind']('isEnabled')['to'](this,'isLoading',_0x271872=>!_0x271872),this['items']['add'](this['suggestButton'])),this['extendTemplate']({'attributes':{'class':['ck-ai-balloon__toolbar']}});}['_createButton'](_0x466f1a,_0x37443f){const _0x5ddf1e=new _0xcbb426(this['locale']);return _0x5ddf1e['set']({'label':_0x466f1a,'class':_0x37443f||'','isVisible':!0x0,'withText':!0x0}),_0x5ddf1e;}}class ls extends _0x43effc{constructor(_0x4d085c){super(_0x4d085c),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-balloon__disclaimer']},'children':[{'tag':'p','attributes':{'class':['ck','ck-ai-balloon__disclaimer-content']},'children':[{'text':i(_0x4d085c,'AI_DISCLAIMER_TEXT')}]}]});}}const fs=['wheel','touchstart','pointerdown','keydown'],Fs=['ArrowUp','ArrowDown','PageUp','PageDown','Home','End','\x20'];class us{['element'];['animationFrameId'];['isRunning'];['abortController'];['isUserPaused'];constructor(_0x3d6e77){this['element']=_0x3d6e77,this['animationFrameId']=null,this['isRunning']=!0x1,this['abortController']=new AbortController(),this['isUserPaused']=!0x1;for(const _0x59e2fa of fs){const _0x2a3834='keydown'!==_0x59e2fa;this['element']['addEventListener'](_0x59e2fa,this['_onUserEvent']['bind'](this),{'passive':_0x2a3834,'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'](_0x1708cd){if(this['isRunning']){if('keydown'===_0x1708cd['type']){const _0x2a7d08=_0x1708cd['key'];if(!Fs['includes'](_0x2a7d08))return;}_0x1708cd instanceof WheelEvent?_0x1708cd['deltaY']<0x0?this['isUserPaused']=!0x0:this['isUserPaused']=!this['_isAtBottom']():this['isUserPaused']=!0x0;}}['_isAtBottom'](){const {scrollTop:_0x476b35,scrollHeight:_0x20a618,clientHeight:_0x1d2b3f}=this['element'];return _0x20a618-_0x476b35-_0x1d2b3f<=0x5;}['_rafUpdate'](){this['isRunning']&&(this['isUserPaused']||this['element']['scrollTo']({'top':this['element']['scrollHeight'],'behavior':'auto'}),this['animationFrameId']=requestAnimationFrame(this['_rafUpdate']['bind'](this)));}}const nt=['applySuggestion','insertSuggestion','showNext','showPrevious'];class at extends _0x43effc{['focusTracker'];['keystrokes'];['focusCycler'];['_availableActions'];['_focusables'];['_errorView'];['scrollManager'];constructor(_0x456d13,_0x16e446,_0x46b126,_0x33d32a){super(_0x456d13),this['_availableActions']=_0x46b126,this['set']('isLoading',!0x1),this['set']('isTrackChangesOn',_0x33d32a),this['set']('isErrorVisible',!0x1),this['set']('errorMessage',''),this['focusTracker']=new _0x25d272(),this['keystrokes']=new _0xfe6d51(),this['_focusables']=this['createCollection'](),this['focusCycler']=new _0x4b849d({'focusables':this['_focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes'],'actions':{'focusPrevious':'shift\x20+\x20tab','focusNext':'tab'}}),this['_dialogContent']=new _0x317ee8(),this['_addContentView'](_0x16e446['mainView']),this['_addDisclaimerView'](),this['_addToolbar'](_0x16e446['showApplyButton'],_0x16e446['showSuggestButton']),this['toolbar']['bind']('isLoading')['to'](this),this['_focusables']['clear'](),this['_focusables']['addMany']([this['toolbar']]),this['setTemplate']({'tag':'div','attributes':{'class':'ai-balloon-content'},'children':this['_dialogContent']}),this['on']('change:isTrackChangesOn',()=>{this['_dialogContent']['remove'](this['toolbar']),this['_addToolbar'](_0x16e446['showApplyButton'],_0x16e446['showSuggestButton']);});}['render'](){super['render']();for(const _0xfc9112 of this['_focusables'])this['focusTracker']['add'](_0xfc9112['element']);this['keystrokes']['listenTo'](this['element']),this['_initializeScrollManager']();}['destroy'](){super['destroy'](),this['scrollManager']&&this['scrollManager']['destroy']();}['focus'](_0x540337){-0x1===_0x540337?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}['setLoading'](){this['isLoading']=!0x0;}['clearLoading'](){this['isLoading']=!0x1;}['showError'](_0x173e0b){this['_errorView']||(this['_errorView']=this['_createErrorView'](),this['_dialogContent']['addMany']([this['_errorView']],0x0)),this['errorMessage']=_0x173e0b,this['isErrorVisible']=!0x0;}['hideError'](){this['isErrorVisible']=!0x1;}['showRecoverableError'](_0x140a62){this['showError'](_0x140a62);}['showBlockingError'](_0x467106){this['showError'](_0x467106),this['toolbar']&&(this['toolbar']['applyButton']&&(this['toolbar']['applyButton']['isEnabled']=!0x1),this['toolbar']['suggestButton']&&(this['toolbar']['suggestButton']['isEnabled']=!0x1));}['setupRotator'](_0x6e6055){const _0x17e3ce=this['_createNextButtonView'](),_0x20bf52=this['_createPreviousButtonView']();_0x6e6055['view']['headerView']['children']['add'](_0x17e3ce,0x2),_0x6e6055['view']['headerView']['children']['add'](_0x20bf52,0x0),this['_focusables']['addMany']([_0x17e3ce,_0x20bf52]),this['focusTracker']['add'](_0x17e3ce['element']),this['focusTracker']['add'](_0x20bf52['element']);}['_addContentView'](_0x5152dd){this['_mainView']=_0x5152dd,this['_dialogContent']['add'](this['_mainView']);}['updateContent'](_0x2cb3e1){const _0x1a63fb=this['_dialogContent']['getIndex'](this['_mainView']);this['_dialogContent']['remove'](this['_mainView']),this['_mainView']=_0x2cb3e1,this['_dialogContent']['add'](this['_mainView'],_0x1a63fb),this['hideError'](),this['scrollManager']&&this['scrollManager']['destroy'](),this['_initializeScrollManager']();}['_addDisclaimerView'](){this['disclaimerView']=new ls(this['locale']),this['_dialogContent']['add'](this['disclaimerView']);}['_addToolbar'](_0x21c93b=!0x0,_0x3cd64a=!0x0){_0x21c93b=_0x21c93b&&!this['isTrackChangesOn']&&this['_availableActions']['includes']('applySuggestion'),_0x3cd64a=_0x3cd64a&&this['_availableActions']['includes']('insertSuggestion'),this['toolbar']=new cs(this['locale'],_0x21c93b,_0x3cd64a),this['toolbar']['applyButton']?.['on']('execute',()=>{this['fire']('applySuggestion');}),this['toolbar']['suggestButton']?.['on']('execute',()=>{this['fire']('insertSuggestion');}),this['_dialogContent']['add'](this['toolbar']);}['_createNextButtonView'](){const _0x3b9e2c=new _0xcbb426(this['locale']);return _0x3b9e2c['set']({'icon':_0x4309f7,'tooltip':i(this['locale'],'AI_BALLOON_NEXT_TOOLTIP')}),_0x3b9e2c['on']('execute',()=>{this['fire']('showNext');}),_0x3b9e2c;}['_createPreviousButtonView'](){const _0x2f3405=new _0xcbb426(this['locale']);return _0x2f3405['set']({'icon':_0x1420c7,'tooltip':i(this['locale'],'AI_BALLOON_PREVIOUS_TOOLTIP')}),_0x2f3405['on']('execute',()=>{this['fire']('showPrevious');}),_0x2f3405;}['_createErrorView'](){const _0xec9718=new _0x43effc(this['locale']),_0x4b83c1=new _0x43effc(this['locale']);return _0x4b83c1['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-suggestion__error-text']},'children':[{'text':this['bindTemplate']['to']('errorMessage')}]}),_0xec9718['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__error','ai-balloon-error',this['bindTemplate']['if']('isErrorVisible','ck-hidden',_0xdd2eab=>!_0xdd2eab)]},'children':[_0x4b83c1]}),_0xec9718;}['startAutoScroll'](){this['_initializeScrollManager'](),this['scrollManager']&&this['scrollManager']['start']();}['stopAutoScroll'](){this['scrollManager']&&this['scrollManager']['stop']();}['_initializeScrollManager'](){const _0x55100a=this['_getScrollableElement']();_0x55100a&&!this['scrollManager']&&(this['scrollManager']=new us(_0x55100a));}['_getScrollableElement'](){return this['_mainView']instanceof T&&this['_mainView']['bodyView']['element']?this['_mainView']['bodyView']['element']:null;}}const mt=0xa;class H extends ot{static get['requires'](){return[S,R];}static get['pluginName'](){return'AIBalloon';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['isOpen']=!0x1;['_config'];['_isUpdatingMarkers']=!0x1;['_pendingRenderCallback']=null;['open'](_0x20519e){const _0x53aa47=ut(this['context']);if(this['_config']=_0x20519e,this['isOpen'])return void this['_updateBalloon'](_0x20519e);const _0x1d4952=this['context']['config']['get']('ai.availableReplyActions')||[...et],_0x738ca7=_0x53aa47?.['commands']['get']('trackChanges'),_0x491edf=_0x738ca7?.['value'];this['balloonView']=new at(_0x53aa47['locale'],_0x20519e,_0x1d4952,!!_0x491edf),this['balloonView']['delegate'](...nt)['to'](this),_0x738ca7&&this['balloonView']['bind']('isTrackChangesOn')['to'](_0x738ca7,'value'),this['_showDialog'](_0x20519e);}['close'](){ut(this['context'])['plugins']['get']('Dialog')['hide']();}['startAutoScroll'](){this['balloonView']&&this['balloonView']['startAutoScroll']();}['stopAutoScroll'](){this['balloonView']&&this['balloonView']['stopAutoScroll']();}['_updateBalloon'](_0x5d3f17){const _0x302e36=ut(this['context']),_0x52ae14=_0x302e36['plugins']['get']('Dialog');this['_pendingRenderCallback']&&(_0x302e36['editing']['view']['off']('render',this['_pendingRenderCallback']),this['_pendingRenderCallback']=null),this['_isUpdatingMarkers']=!0x0,_0x52ae14['view']?.['headerView']&&(_0x52ae14['view']['headerView']['label']=_0x5d3f17['title'],_0x52ae14['view']['headerView']['iconView']&&_0x5d3f17['icon']&&(_0x52ae14['view']['headerView']['iconView']['content']=_0x5d3f17['icon'])),this['balloonView']['updateContent'](_0x5d3f17['mainView']),this['_setupVisualSelection'](_0x5d3f17['ranges'],_0x5d3f17['index']),this['_pendingRenderCallback']=()=>{this['_isUpdatingMarkers']=!0x1,this['_pendingRenderCallback']=null,_0x52ae14['view']&&_0x52ae14['view']['updatePosition']();},_0x302e36['editing']['view']['once']('render',this['_pendingRenderCallback']);}['_setupVisualSelection'](_0x5c6c7a,_0x3d5a24){this['context']['plugins']['get'](R)['showFakeVisualSelection'](_0x5c6c7a,'ai-balloon-'+_0x3d5a24,!0x0,!0x0);}['_showDialog'](_0x361f24){const _0x30fa3e=ut(this['context']);this['_setupVisualSelection'](_0x361f24['ranges'],_0x361f24['index']);const _0x232561=this['_getSelectionElements']();_0x232561&&_0x232561[0x0]&&ht({'target':_0x232561[0x0],'ancestorOffset':0x14,'alignToTop':!0x0,'viewportOffset':{'top':0x14,'bottom':0x14,'left':0x0,'right':0x0}}),_0x30fa3e['plugins']['get']('Dialog')['show']({'title':_0x361f24['title'],'icon':_0x361f24['icon'],'hasCloseButton':!0x0,'id':'aiBalloon','position':this['_calculateDialogPosition']['bind'](this),'className':'ai-balloon'+(_0x361f24['showRotator']?'\x20ai-balloon-rotator':''),'content':this['balloonView'],'onShow':_0x1d025a=>{_0x361f24['showRotator']&&this['balloonView']['setupRotator'](_0x1d025a),this['_setupMarkerRemovalListener'](),this['isOpen']=!0x0;},'onHide':()=>{this['context']['plugins']['get']('AIEditing')['hideFakeVisualSelection']('ai-balloon-'+this['_config']['index']),this['_cleanupMarkerRemovalListener'](),this['fire']('dialogClosed'),this['isOpen']=!0x1;}});}['_calculateDialogPosition'](_0x1d3b72,_0x5caee3){if(!_0x5caee3)return null;const _0x23fb22=this['_getSelectionElements']();if(!_0x23fb22||0x0===_0x23fb22['length'])return{'left':Math['round'](_0x5caee3['left']+_0x5caee3['width']/0x2-_0x1d3b72['width']/0x2),'top':Math['round'](_0x5caee3['top']+_0x5caee3['height']/0x2-_0x1d3b72['height']/0x2)};const _0x4806f2=Math['round'](_0x5caee3['left']+_0x5caee3['width']/0x2-_0x1d3b72['width']/0x2),_0x3f128a=new ct(_0x23fb22[0x0]),_0x1e8393=new ct(_0x23fb22[_0x23fb22['length']-0x1]),_0x5a4d64=_0x1d3b72['height'],_0x19ae37=this['_config']['showRotator']?0x8:0x0;return{'left':_0x4806f2,'top':this['_calculateOptimalTopPosition'](_0x3f128a,_0x1e8393,_0x5a4d64,_0x19ae37,_0x5caee3)};}['_calculateOptimalTopPosition'](_0x50be2e,_0x3b396e,_0x4b8529,_0x55c2ac=0x0,_0x3711db){const _0x2bc77b=_0x4b8529+_0x55c2ac,_0x5318d5=new ct(lt['window']),_0x2e025c=[_0x50be2e['getVisible'](),_0x3b396e['getVisible']()]['filter'](_0x7bdfd1=>_0x7bdfd1),_0x57678c=ct['getBoundingRect'](_0x2e025c);if(!_0x57678c)return Math['round'](_0x3711db['top']+_0x3711db['height']/0x2);const _0x2f13f7=_0x5318d5['getIntersection'](_0x57678c);if(!_0x2f13f7)return Math['round'](_0x3711db['top']+_0x3711db['height']/0x2);const _0x5172f0=_0x3711db['getVisible'](),_0x41f076=_0x5172f0&&_0x57678c['height']>_0x5172f0['height'],_0x3a9578=_0x2f13f7['top'],_0x3344ef=_0x2f13f7['bottom'];if(_0x41f076){const _0x559dc3=(_0x5172f0||_0x5318d5)['height']/0x2-_0x2bc77b/0x2,_0x5a96eb=_0x3a9578-mt-_0x3711db['top'],_0x1bf94c=_0x3711db['bottom']-_0x3344ef-mt;return _0x5a96eb>=_0x2bc77b?Math['max'](mt,_0x3a9578-_0x2bc77b-mt):_0x1bf94c>=_0x2bc77b?_0x3344ef+mt:Math['max'](mt,_0x559dc3);}const _0x5660a2=_0x3a9578-_0x2bc77b,_0x4adc5e=_0x3711db['bottom']-_0x3344ef-mt,_0x5a769d=_0x3a9578-mt-_0x3711db['top'];let _0x106c62;if(_0x4adc5e>=_0x2bc77b)_0x106c62=_0x3344ef+mt;else{if(_0x5a769d>=_0x2bc77b)_0x106c62=_0x5660a2-mt;else _0x106c62=_0x3a9578+_0x57678c['height']/0x2-_0x2bc77b/0x2;}return _0x106c62;}['_setupMarkerRemovalListener'](){const _0x3e793f=ut(this['context']);this['listenTo'](_0x3e793f['model']['document'],'change',()=>{if(this['_isUpdatingMarkers'])return;for(const {name:_0x67d4e7,data:{newRange:_0xdbd48b}}of _0x3e793f['model']['document']['differ']['getChangedMarkers']())if(_0x67d4e7['startsWith']('ai-selection:')&&(_0xdbd48b&&(_0xdbd48b['start']['isEqual'](_0xdbd48b['end'])||'$graveyard'==_0xdbd48b['root']['rootName'])||null==_0xdbd48b)){const _0x32756b=i(this['context']['locale'],'AI_ACTIONS_SELECTION_REMOVED_ERROR');this['balloonView']['showBlockingError'](_0x32756b),this['fire']('selectionRemoved');}});}['_cleanupMarkerRemovalListener'](){const _0x3fe11d=ut(this['context']);this['stopListening'](_0x3fe11d['model']['document']);}['_getSelectionElements'](){const _0x234dea=ut(this['context']);return rt(_0x234dea['editing'],[..._0x234dea['model']['markers']['getMarkersGroup']('ai-selection'),..._0x234dea['model']['markers']['getMarkersGroup']('ai-balloon-selection')]);}}class dt extends ot{['_aiEditing'];['_aiConnector'];['_aiChatUi'];['_aiChatModels'];['_batchToChanges']=new Map();['_previewedChangeGroup']=null;['_balloonShowDiff']=!0x1;['_bodyCollection'];static get['requires'](){return[S,H,_0x2dc9e7];}static get['pluginName'](){return'AIChatController';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){this['_bodyCollection']=new _0x44dc72(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 At({'connector':this['_aiConnector'],'availableModels':this['context']['config']['get']('ai.chat.models.displayedModels'),'defaultModelId':this['context']['config']['get']('ai.chat.models.defaultModelId'),'locale':this['context']['locale']});const _0x10a993=this['context']['plugins']['get']('AITabs');this['listenTo'](this['_aiChatUi'],'startConversation',()=>{this['_startConversationSafely']();}),this['listenTo'](this['_aiChatUi'],'sendUserMessage',(_0x5b5a8f,_0x429ffa)=>{this['_handleUIUserMessage']({'userMessage':_0x429ffa});}),this['listenTo'](_0x10a993,'resizedTabs',(_0x3b1ed6,_0x26dde8)=>{this['_setIsMaximized'](_0x26dde8);}),this['listenTo'](this['_aiChatUi'],'resizeTabs',()=>{_0x10a993['resize']();}),this['listenTo'](this['_aiChatUi'],'abortPromptStream',async()=>{await this['_stopLastInteraction'](),await this['_flushLastInteractionUI'](),this['removeSelectionFromChatContext']();}),this['listenTo'](this['_aiChatUi'],'addDocumentToContext',()=>{this['activeConversation']?.['addCurrentDocumentToContext'](i(this['context']['locale'],'AI_CHAT_CONTEXT_CURRENT_DOCUMENT'));}),this['listenTo'](this['_aiChatUi'],'addFileToContext',(_0x56070b,_0x38afa8)=>{this['activeConversation']?.['addFilesToContext'](Array['from'](_0x38afa8));}),this['listenTo'](this['_aiChatUi'],'addUrlToContext',(_0x57e23b,_0x539b2b)=>{this['activeConversation']?.['addUrlToContext'](_0x539b2b);}),this['listenTo'](this['_aiChatUi'],'addResourceToContext',(_0x16fc07,_0x4a87cc)=>{this['activeConversation']?.['addResourceToContext'](_0x4a87cc['source'],_0x4a87cc['resource']);}),this['listenTo'](this['_aiChatUi'],'removeContextItem',(_0x9b21c1,_0x2467f5)=>{this['_removeFromContext'](_0x2467f5);}),this['listenTo'](this['_aiChatUi'],'loadSourceResources',(_0x1229cc,_0x114906)=>{this['activeConversation']?.['loadSourceResources'](_0x114906['sourceId'],_0x114906['query'],_0x114906['uid']);}),this['listenTo'](this['_aiChatUi'],'toggleWebSearch',()=>{this['_toggleWebSearch']();}),this['listenTo'](this['_aiChatUi'],'toggleReasoning',()=>{this['_toggleReasoning']();}),this['listenTo'](this['_aiChatUi'],'selectModel',(_0x390971,_0x1e5ea0)=>{this['activeConversation']?.['setModel'](_0x1e5ea0);}),this['listenTo'](this['_aiChatUi'],'like',(_0x3b6fea,{replyId:_0x38ba3a})=>{console['log']('Liked\x20response',_0x38ba3a);}),this['listenTo'](this['_aiChatUi'],'dislike',(_0x32bf3,{replyId:_0x5b5537})=>{console['log']('Disliked\x20response',_0x5b5537);}),this['listenTo'](this['_aiChatUi'],'insertSuggestion',(_0x16dce2,_0x2acd1a)=>{this['context']['plugins']['get'](H)['close'](),this['_insertSuggestion'](_0x2acd1a);}),this['listenTo'](this['_aiChatUi'],'showChangeInText',(_0xb70b3b,{replyId:_0x469bbd,partIndex:_0x351e38})=>{this['_balloonShowDiff']=this['_aiChatUi']['showDiff'],this['_openBalloonFor'](_0x469bbd,_0x351e38);}),this['listenTo'](this['_aiChatUi'],'mouseOverSuggestion',(_0x26caba,{replyId:_0x53078c,partIndex:_0x419efd})=>{const _0x21086e=this['_getDocumentRangeForReplyChanges'](_0x53078c,_0x419efd);_0x21086e&&'$graveyard'!=_0x21086e['range']['root']['rootName']&&this['_aiEditing']['showFakeVisualSelection']([_0x21086e['range']],'ai-chat-controller-mouse-over');}),this['listenTo'](this['_aiChatUi'],'mouseLeaveSuggestion',()=>{this['_aiEditing']['hideFakeVisualSelection']('ai-chat-controller-mouse-over');}),this['listenTo'](this['_aiChatUi'],'applySuggestion',(_0x31a7a3,_0x20117e)=>{this['context']['plugins']['get'](H)['close'](),this['_applySuggestion'](_0x20117e);}),this['listenTo'](this['_aiChatUi'],'toggleSuggestionDisplayMode',async(_0x31d21d,{replyId:_0x2b1ccd,showDiff:_0x59c93e})=>{const {reply:_0x5132f7}=this['getInteractionAndReplyById'](_0x2b1ccd),_0x4c10e8=_0x5132f7['getContentParts']({'showDiff':_0x59c93e});await this['_aiChatUi']['updateFeedItemAIReplySuggestionContent']({'id':_0x5132f7['id'],'parts':_0x4c10e8,'renderingStrategy':'static'});}),this['listenTo'](this['_aiChatUi'],'rejectSuggestion',(_0x5b28e9,{replyId:_0x1b33f1,partIndex:_0x527037})=>{this['_previewedChangeGroup']?.['replyId']==_0x1b33f1&&this['_previewedChangeGroup']?.['partIndex']==_0x527037&&this['context']['plugins']['get'](H)['close']();const {reply:_0x297cbe}=this['getInteractionAndReplyById'](_0x1b33f1);_0x297cbe['setChangeGroupState'](_0x527037,'rejected'),this['_aiEditing']['hideFakeVisualSelection']('ai-chat-controller-mouse-over');});}async['afterInit'](){this['context']instanceof _t?this['_integrateEditor'](this['context']):this['listenTo'](this['context']['editors'],'add',(_0x3a28cd,_0x738682)=>{_0x738682['on']('ready',()=>{this['_integrateEditor'](_0x738682);});}),await this['_startConversationSafely']();}['destroy'](){this['_bodyCollection']['detachFromDom'](),super['destroy']();}['_insertSuggestion'](_0x585822){const _0x5f5377=ut(this['context']);if(!_0x5f5377['plugins']['has']('TrackChanges'))throw new _0x36b126('ai-no-track-changes',null);const _0x52cbe7=this['context']['plugins']['get']('DocumentCompare'),{reply:_0x2b000e,interaction:_0x263b88}=this['getInteractionAndReplyById'](_0x585822['replyId']),_0x6e542e=this['_getDocumentRangeForReplyChanges'](_0x585822['replyId'],_0x585822['partIndex']),_0x22a1a1=void 0x0!==_0x585822['partIndex']?[_0x2b000e['changeGroups'][_0x585822['partIndex']]]:_0x2b000e['changeGroups']['filter'](_0x4f5afa=>'pending'==_0x4f5afa['state']),_0x183055=_0x22a1a1['map'](_0xa0dda3=>_0x2b000e['changeGroups']['indexOf'](_0xa0dda3));if(!_0x6e542e||'$graveyard'==_0x6e542e['range']['root']['rootName'])return void _0x183055['forEach'](_0x129b93=>_0x2b000e['setChangeGroupState'](_0x129b93,'outdated'));_0x183055['forEach'](_0x41e9cb=>_0x2b000e['setChangeGroupState'](_0x41e9cb,'accepted'));const _0x4a6ce4=z({'editor':_0x5f5377,'reply':_0x2b000e,'interaction':_0x263b88,'groups':_0x22a1a1,'transform':!0x0,'documentCompare':_0x52cbe7,'documentCompareOptions':{'anchor':'main','markDeletions':!0x0}});let _0x13a269;_0x6e542e&&this['_scrollToSuggestionRange'](_0x6e542e['range']),_0x5f5377['model']['change'](_0x104d5f=>{_0x13a269=_0x104d5f['batch'],_0x5f5377['plugins']['get']('TrackChangesEditing')['_applyOperationsAsSuggestions'](_0x4a6ce4),this['_aiEditing']['hideFakeVisualSelection']('ai-chat-controller-mouse-over');}),this['_batchToChanges']['set'](_0x13a269,{'interactionId':_0x263b88['id'],'replyId':_0x2b000e['id'],'indexes':_0x183055['slice']()}),this['_updateRatings'](_0x2b000e);}['_applySuggestion'](_0x2ad079){const _0x155f1b=ut(this['context']),_0xdb5740=this['context']['plugins']['get'](_0x2dc9e7),{reply:_0x22a1e2,interaction:_0x3b5b2e}=this['getInteractionAndReplyById'](_0x2ad079['replyId']),_0x4de1f9=this['_getDocumentRangeForReplyChanges'](_0x2ad079['replyId'],_0x2ad079['partIndex']),_0x3c63eb=void 0x0!==_0x2ad079['partIndex']?[_0x22a1e2['changeGroups'][_0x2ad079['partIndex']]]:_0x22a1e2['changeGroups']['filter'](_0x23609c=>'pending'==_0x23609c['state']),_0x33134e=_0x3c63eb['map'](_0x3f2a71=>_0x22a1e2['changeGroups']['indexOf'](_0x3f2a71));if(!_0x4de1f9||'$graveyard'==_0x4de1f9['range']['root']['rootName'])return void _0x33134e['forEach'](_0x1b5089=>_0x22a1e2['setChangeGroupState'](_0x1b5089,'outdated'));_0x33134e['forEach'](_0x40c952=>_0x22a1e2['setChangeGroupState'](_0x40c952,'accepted'));const _0x19888c=z({'editor':_0x155f1b,'reply':_0x22a1e2,'interaction':_0x3b5b2e,'groups':_0x3c63eb,'transform':!0x0,'documentCompare':_0xdb5740,'documentCompareOptions':{'anchor':'main','markDeletions':!0x1}});let _0x295100;_0x4de1f9&&this['_scrollToSuggestionRange'](_0x4de1f9['range']),_0x155f1b['model']['change'](_0x4edb4f=>{_0x295100=_0x4edb4f['batch'];for(const _0x3a0035 of _0x19888c)_0x3a0035['baseVersion']=_0x155f1b['model']['document']['version'],Y(_0x155f1b,_0x3a0035),_0x4edb4f['batch']['addOperation'](_0x3a0035),_0x155f1b['model']['applyOperation'](_0x3a0035);}),this['_batchToChanges']['set'](_0x295100,{'interactionId':_0x3b5b2e['id'],'replyId':_0x22a1e2['id'],'indexes':_0x33134e['slice']()}),this['_updateRatings'](_0x22a1e2);}['_openBalloonFor'](_0x1395c6,_0x1d8708){const _0x175f8d=ut(this['context']),_0x37a508=this['_getDocumentRangeForReplyChanges'](_0x1395c6,_0x1d8708),_0x577856=this['context']['plugins']['get'](H);if(!_0x37a508)return void _0x577856['close']();const {range:_0x26f895,currentIndex:_0x5c8095}=_0x37a508;if('$graveyard'==_0x26f895['root']['rootName']){const {reply:_0x597cc5}=this['getInteractionAndReplyById'](_0x1395c6);return _0x597cc5['setChangeGroupState'](_0x5c8095,'outdated'),void _0x577856['close']();}if(this['_previewedChangeGroup']?.['replyId']==_0x1395c6&&this['_previewedChangeGroup']?.['partIndex']==_0x5c8095)return;this['stopListening'](_0x577856),this['_previewedChangeGroup']={'replyId':_0x1395c6,'partIndex':_0x5c8095};let _0x1d9094=_0x175f8d['config']['get']('ai.availableReplyActions')||[...et];_0x175f8d['plugins']['has']('TrackChanges')||(_0x1d9094=_0x1d9094['filter'](_0x146bd3=>'insertSuggestion'!=_0x146bd3));const _0x5cdbb1=new T(_0x175f8d['locale'],{'showDiff':this['_balloonShowDiff'],'areActionsDisabled':!0x1,'miniToolbarConfig':{'showChanges':'full'},'hideHeader':!0x0,'availableActions':_0x1d9094},this['_bodyCollection']);this['stopListening'](_0x5cdbb1);const {reply:_0x59d00e}=this['getInteractionAndReplyById'](_0x1395c6),_0x42f568=_0x59d00e['getContentParts']({'showDiff':this['_balloonShowDiff']})['filter'](_0x2c3e5e=>_0x2c3e5e['hasChanges']),_0x4e51eb=_0x42f568['findIndex'](_0x4c57c5=>_0x4c57c5['index']==_0x5c8095);if(-0x1==_0x4e51eb)return;const _0x3b7c74=_0x42f568[_0x4e51eb],_0x3a934f=_0x42f568['at']((_0x4e51eb-0x1)%_0x42f568['length'])?.['index'],_0xc85b05=_0x42f568['at']((_0x4e51eb+0x1)%_0x42f568['length'])?.['index'];_0x5cdbb1['updateContent']({'parts':[_0x3b7c74],'renderingStrategy':'static'});const _0x2060dd=_0x5c8095!==_0x3a934f;this['_scrollToSuggestionRange'](_0x26f895,!0x0),_0x577856['open']({'index':_0x5c8095,'title':i(this['context']['locale'],'AI_BALLOON_HEADER_TITLE',(_0x4e51eb+0x1)['toString']()),'icon':Nt,'mainView':_0x5cdbb1,'showRotator':_0x2060dd,'showApplyButton':!0x0,'showSuggestButton':_0x175f8d['plugins']['has']('TrackChanges'),'ranges':[_0x26f895]}),this['_aiChatUi']['scrollFeedToSuggestion'](_0x1395c6,_0x5c8095),this['listenTo'](_0x5cdbb1,'toggleSuggestionDisplayMode',(_0x1ea24f,{showDiff:_0x218aff})=>{this['_balloonShowDiff']=_0x218aff;const {reply:_0x15c04e}=this['getInteractionAndReplyById'](_0x1395c6),_0x15141a=_0x15c04e['getContentParts']({'showDiff':_0x218aff,'groupIndex':_0x5c8095});_0x5cdbb1['updateContent']({'parts':_0x15141a,'renderingStrategy':'static'});}),this['listenTo'](_0x577856,'applySuggestion',()=>{this['_applySuggestion']({'replyId':_0x1395c6,'partIndex':_0x5c8095}),_0x2060dd?this['_openBalloonFor'](_0x1395c6,_0xc85b05):_0x577856['close']();}),this['listenTo'](_0x577856,'insertSuggestion',()=>{this['_insertSuggestion']({'replyId':_0x1395c6,'partIndex':_0x5c8095}),_0x2060dd?this['_openBalloonFor'](_0x1395c6,_0xc85b05):_0x577856['close']();}),_0x2060dd&&(this['listenTo'](_0x577856,'showNext',()=>{this['_openBalloonFor'](_0x1395c6,_0xc85b05);}),this['listenTo'](_0x577856,'showPrevious',()=>{this['_openBalloonFor'](_0x1395c6,_0x3a934f);})),this['listenTo'](_0x577856,'dialogClosed',()=>{this['stopListening'](_0x577856),this['stopListening'](_0x5cdbb1),this['_previewedChangeGroup']=null;});}['_getDocumentRangeForReplyChanges'](_0x552499,_0x937049){const _0x2a72c9=ut(this['context']),{reply:_0x7b7e32,interaction:_0x35d476}=this['getInteractionAndReplyById'](_0x552499),_0x4f0129=_0x7b7e32['changeGroups']['filter'](_0x1c2f71=>'pending'==_0x1c2f71['state']),_0x48b4e8=_0x4f0129['map'](_0x29a4eb=>_0x7b7e32['changeGroups']['indexOf'](_0x29a4eb));void 0x0===_0x937049&&(_0x937049=_0x48b4e8[0x0]);const _0x1fbde0=_0x48b4e8['indexOf'](_0x937049);if(-0x1==_0x1fbde0)return null;const _0x2cf7c7=_0x4f0129[_0x1fbde0],_0xc080e3=new Rt([]),_0x4b4de6=new Rt([]);for(const _0x29f9bf of _0x2cf7c7['changes'])if('removed'!=_0x29f9bf['type']&&_0x4b4de6['children']['push'](_0x29f9bf['node']['cloneNode'](!0x0)),'new'!=_0x29f9bf['type']){const _0x27684b=St(_0x5a4d29=>vt(_0x5a4d29,'data-id')==_0x29f9bf['id'],_0x7b7e32['documentContextContent'],!0x0);_0xc080e3['children']['push'](_0x27684b['cloneNode'](!0x0));}if(0x0==_0xc080e3['children']['length']){if(_0x2cf7c7['changes'][0x0]['anchorId']){const _0x159bbf=Dt('data-id',_0x2cf7c7['changes'][0x0]['anchorId'],_0x7b7e32['documentContextContent']);_0xc080e3['children']['unshift'](_0x159bbf['cloneNode'](!0x0)),_0x4b4de6['children']['unshift'](_0x159bbf['cloneNode'](!0x0)),_0x159bbf['nextSibling']&&(_0xc080e3['children']['push'](_0x159bbf['nextSibling']['cloneNode'](!0x0)),_0x4b4de6['children']['push'](_0x159bbf['nextSibling']['cloneNode'](!0x0)));}else{const _0xf04082=_0x7b7e32['documentContextContent']['children'][0x0];if(!_0xf04082)return null;_0xc080e3['children']['push'](_0xf04082['cloneNode'](!0x0)),_0x4b4de6['children']['push'](_0xf04082['cloneNode'](!0x0));}}const _0x43975d=_0x35d476['getDocumentContext'](),_0x47ea8e=_0x2a72c9['data']['parse'](_0x43975d['content'],'$root'),_0x1319eb=Ot(_0xc080e3),_0x3a86b4=_0x2a72c9['data']['parse'](_0x1319eb),_0x5b7ea4=_0x2a72c9['data']['parse'](_0x1319eb),_0x11fd26=_0x2a72c9['model']['createPositionAt'](_0x3a86b4,0x0),_0x2446a7=Ot(_0x4b4de6),_0x2bcffe={'anchor':_0x11fd26,'markDeletions':!0x1,'context':'$root'},_0x44df58=_0x2a72c9['plugins']['get'](_0x2dc9e7)['getDiff'](_0x1319eb,_0x2446a7,_0x2bcffe)['getOperations']();if(!_0x44df58['length'])return null;_0x2a72c9['model']['change'](_0x1fb17b=>{for(const _0x256205 of _0x44df58)if('remove'==_0x256205['type']){const _0x51bcda=_0x256205['sourcePosition'],_0x3458fb=_0x256205['howMany'],_0x2c1a9d=new it(_0x51bcda,_0x3458fb);_0x1fb17b['batch']['addOperation'](_0x2c1a9d),_0x2a72c9['model']['applyOperation'](_0x2c1a9d);}else'marker'!==_0x256205['type']&&(_0x256205['baseVersion']=null,_0x256205['isDocumentOperation']=!0x1,_0x1fb17b['batch']['addOperation'](_0x256205),_0x2a72c9['model']['applyOperation'](_0x256205));});const _0x9a9d13=wt(_0x2a72c9,_0x44df58,_0x3a86b4);Et(_0x2a72c9['model'],_0x9a9d13);const _0x4295d0=_0x9a9d13['getFirstRange']()['start']['path']['slice'](),_0x6764a2=_0x9a9d13['getFirstRange']()['end']['path']['slice'](),_0x4f9827=[];let _0x1a4411=_0x3a86b4,_0x374208=_0x5b7ea4;for(let _0x3a84b5=0x0;_0x3a84b5<_0x6764a2['length'];_0x3a84b5++){const _0x15fa72=_0x1a4411['maxOffset']-_0x6764a2[_0x3a84b5];_0x4f9827[_0x3a84b5]=_0x374208['maxOffset']-_0x15fa72,_0x1a4411=_0x1a4411['getChildAtOffset'](_0x6764a2[_0x3a84b5]),_0x374208=_0x374208['getChildAtOffset'](_0x4f9827[_0x3a84b5]);}const _0x1697ad=_0x2a72c9['model']['createRange'](_0x2a72c9['model']['createPositionFromPath'](_0x5b7ea4,_0x4295d0),_0x2a72c9['model']['createPositionFromPath'](_0x5b7ea4,_0x4f9827)),_0x1c9a82=_0x5b7ea4['getChild'](0x0)['getAttribute'](yt),_0x216fd4=Array['from'](_0x47ea8e['getChildren']())['find'](_0x5a1f49=>_0x5a1f49['getAttribute'](yt)==_0x1c9a82)['getPath'](),_0x27e873=_0x1697ad['start']['path']['slice'](),_0xb28ba1=_0x1697ad['end']['path']['slice']();_0x27e873[0x0]=_0x216fd4[0x0]+_0x27e873[0x0],_0xb28ba1[0x0]=_0x216fd4[0x0]+_0xb28ba1[0x0];let _0x324d66=_0x2a72c9['model']['createRange'](_0x2a72c9['model']['createPositionFromPath'](_0x2a72c9['model']['document']['getRoot'](),_0x27e873),_0x2a72c9['model']['createPositionFromPath'](_0x2a72c9['model']['document']['getRoot'](),_0xb28ba1));const _0x4437f9=_0x2a72c9['model']['document']['history']['getOperations'](_0x43975d['version']);for(const _0x4daf6c of _0x4437f9)_0x324d66=_0x1026dd['_createFromRanges'](_0x324d66['getTransformedByOperation'](_0x4daf6c));return{'range':_0x324d66,'currentIndex':_0x937049};}['_integrateEditor'](_0x3e3edc){if(!_0x3e3edc['plugins']['has']('Undo'))return;const _0x4518f6=_0x3e3edc['commands']['get']('undo'),_0x1f89e8=_0x3e3edc['commands']['get']('redo');this['listenTo'](_0x4518f6,'revert',(_0x4c69b5,_0x13603b,_0x1aa13f)=>{const _0x39fab4=this['_batchToChanges']['get'](_0x13603b);if(!_0x39fab4)return;const _0x9f66a4=this['activeConversation']['getInteraction'](_0x39fab4['interactionId'])['getReply'](_0x39fab4['replyId']);_0x39fab4['indexes']['forEach'](_0x4a9bb8=>_0x9f66a4['setChangeGroupState'](_0x4a9bb8,'pending')),this['_batchToChanges']['delete'](_0x13603b),this['_batchToChanges']['set'](_0x1aa13f,_0x39fab4);}),this['listenTo'](_0x1f89e8,'revert',(_0x10903a,_0x487fb5,_0x5e63e6)=>{const _0x28c33e=this['_batchToChanges']['get'](_0x487fb5);if(!_0x28c33e)return;const _0x5b76f4=this['activeConversation']['getInteraction'](_0x28c33e['interactionId'])['getReply'](_0x28c33e['replyId']);_0x28c33e['indexes']['forEach'](_0x143485=>_0x5b76f4['setChangeGroupState'](_0x143485,'accepted')),this['_batchToChanges']['delete'](_0x487fb5),this['_batchToChanges']['set'](_0x5e63e6,_0x28c33e);});}async['loadConversation'](_0x57f25b){this['context']['plugins']['get'](H)['close'](),this['_aiChatUi']['setFeedItemRenderingStrategy']('static'),this['_aiChatUi']['toggleLoadingSkeleton'](!0x0),await this['_stopLastInteraction']();try{await this['_aiConnector']['fetchConversation'](_0x57f25b)['getConversation'](),await this['_startConversationSafely'](_0x57f25b),this['updateConversationTitle']('\x20');const {sessionId:_0x442004}=this['_aiEditing']['getDocumentData']();await this['activeConversation']['load'](_0x57f25b,_0x442004),this['activeConversation']['isCurrentDocumentInConversation']()&&this['activeConversation']['addCurrentDocumentToContext'](i(this['context']['locale'],'AI_CHAT_CONTEXT_CURRENT_DOCUMENT'));}catch(_0x1a1a18){this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_UNABLE_TO_LOAD_CONVERSATION'),'id':_0x57f25b}),this['_logError'](new _0x36b126('ai-chat-conversation-not-found',this,{'error':_0x1a1a18}));}finally{this['context']['plugins']['get'](Ct)['view']['activateTab']('chat'),this['_aiChatUi']['startAutoScroll'](),this['_aiChatUi']['setFeedItemRenderingStrategy']('streaming'),this['_aiChatUi']['toggleLoadingSkeleton'](!0x1);}}['handleRemovedConversation'](_0x64f15a){this['activeConversation']['id']===_0x64f15a&&this['_startConversationSafely']();}async['addSelectionToChatContext'](){const _0x43df24=this['_aiEditing']['getSelectionText']();this['activeConversation']?.['addSelectionToContext'](_0x43df24),this['activeConversation']?.['addCurrentDocumentToContext'](i(this['context']['locale'],'AI_CHAT_CONTEXT_CURRENT_DOCUMENT'));}['removeSelectionFromChatContext'](){this['activeConversation']?.['removeSelectionFromContext']();}['focusPromptInput'](){this['_aiChatUi']['focusPromptInput']();}async['startConversation'](){await this['_startConversationSafely']();}async['sendMessage']({message:_0x191132,quickActionData:_0x3e78a6}){await this['_handleUIUserMessage']({'userMessage':_0x191132,'quickActionData':_0x3e78a6});}['getGroupId'](){const _0x5c77e4=this['context']['config']['get']('collaboration.channelId');if(!_0x5c77e4)throw new _0x36b126('ai-chat-missing-channel-id',this);return _0x5c77e4;}async['_startConversationSafely'](_0x106f64){try{this['_aiChatUi']['enableControls'](),await this['_handleStartConversation'](_0x106f64);}catch(_0x16f022){this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_UNABLE_TO_START_CONVERSATION'),'id':_0x106f64||_0xdc126c()}),console['error'](_0x16f022),this['activeConversation']=void 0x0,this['_aiChatUi']['disableControls']();}}async['_handleStartConversation'](_0x2e7453){const _0x2335c0=this['context']['plugins']['get'](H);let _0x4d03b8;_0x2335c0['isOpen']&&_0x2335c0['close'](),_0x2e7453||!this['activeConversation']?_0x4d03b8=this['context']['config']['get']('ai.chat.models.defaultModelId'):this['_aiChatUi']['isModelAvailable']&&(_0x4d03b8=this['activeConversation']['selectedModel']['id']),await this['_stopLastInteraction']();const _0x47e271=this['getGroupId'](),_0x37355c=_0x2e7453||_0xdc126c();this['activeConversation']=new Tt({'connector':this['_aiConnector'],'chatModels':this['_aiChatModels'],'selectedModelId':_0x4d03b8,'conversationId':_0x37355c,'group':_0x47e271,'getEditor':()=>ut(this['context'])}),this['activeConversation']['on']('conversationInitialized',(_0x31e967,_0x480d92)=>{this['_aiChatUi']['createConversation'](_0x480d92),this['_aiChatUi']['resetMessageInput'](),this['_aiChatUi']['clearPendingContextUI'](),this['_aiChatUi']['clearConversationContextUI'](),_0x2e7453||(this['_aiChatUi']['resetConversationTitle'](),this['activeConversation']?.['addCurrentDocumentToContext'](i(this['context']['locale'],'AI_CHAT_CONTEXT_CURRENT_DOCUMENT')));}),this['activeConversation']['on']('uploadProgressChanged',(_0x760dd9,_0x5e5b38)=>{this['_aiChatUi']['setIsUploadInProgress'](_0x5e5b38['isUploadInProgress']);}),this['activeConversation']['on']('interactionCreated',(_0x421901,_0x581210)=>{this['_aiChatUi']['addFeedItemUserMessage'](_0x581210);}),this['activeConversation']['on']('webSearchStarted',()=>{this['_aiChatUi']['setLoadingMessage']({'isWebSearchEnabled':!0x0,'isReasoningEnabled':!0x1});}),this['activeConversation']['on']('reasoningStarted',()=>{this['_aiChatUi']['setLoadingMessage']({'isWebSearchEnabled':!0x1,'isReasoningEnabled':!0x0});}),this['activeConversation']['on']('webSearchFinished',(_0x1a18a6,_0x4718d2)=>{this['_aiChatUi']['addFeedInteractionHeader'](_0x4718d2,{'isWebSearchEnabled':!0x0,'isReasoningEnabled':!0x1});}),this['activeConversation']['on']('reasoningFinished',(_0x298762,_0xf29f05)=>{this['_aiChatUi']['addFeedInteractionHeader'](_0xf29f05,{'isWebSearchEnabled':!0x1,'isReasoningEnabled':!0x0});}),this['activeConversation']['on']('interactionStarted',()=>{this['_aiChatUi']['startInteraction']();}),this['activeConversation']['on']('interactionFinished',async()=>{await this['_aiChatUi']['finishInteraction']();}),this['activeConversation']['on']('interactionDestroyed',(_0x366f86,_0x4bd5ff)=>{this['_aiChatUi']['removeFeedInteraction'](_0x4bd5ff['id']);}),this['activeConversation']['on']('setConversationTitle',(_0x432b6c,_0x2b8fc1,_0x5a3756)=>{this['updateConversationTitle'](_0x2b8fc1,_0x5a3756);}),this['activeConversation']['on']('replyCreated',(_0x564622,_0x15485e)=>{'text-delta'===_0x15485e['type']?this['_aiChatUi']['addFeedItemAIReply'](_0x15485e):this['_aiChatUi']['addFeedItemAISuggestion'](_0x15485e);}),this['activeConversation']['on']('replyContentUpdated',async(_0x525e06,_0x4f2f82)=>{await this['_updateReplyContent']({'reply':_0x4f2f82});}),this['activeConversation']['on']('replyChangeGroupStateUpdated',(_0x367809,{reply:_0x43b599,index:_0x5adf96,state:_0x51f896})=>{this['_aiChatUi']['updateFeedItemAIReplySuggestionPartState']({'id':_0x43b599['id'],'index':_0x5adf96,'state':_0x51f896});}),this['activeConversation']['on']('contextItemAdded',(_0xd538ff,_0x4dc9e1)=>{if(this['_aiChatUi']['addContextItem'](_0x4dc9e1['contextItem'],_0x4dc9e1['isLoading']),'selection'===_0x4dc9e1['contextItem']['type']){const _0x50826e=[...ut(this['context'])['model']['document']['selection']['getRanges']()];this['_aiEditing']['showFakeVisualSelection'](_0x50826e,'ai-conversation-'+this['activeConversation']?.['id']);}}),this['activeConversation']['on']('contextItemRemoved',(_0x2daafc,_0x4ad343)=>{this['_aiChatUi']['removeContextItem'](_0x4ad343['uiId']),'current-document'==_0x4ad343['uiId']&&this['removeSelectionFromChatContext'](),'selection'===_0x4ad343['type']&&this['_aiEditing']['hideFakeVisualSelection']('ai-conversation-'+this['activeConversation']?.['id']);}),this['activeConversation']['on']('contextItemLoadingEnded',(_0x2782cd,_0x32689f)=>{this['_aiChatUi']['setContextItemLoading'](_0x32689f['contextItem']['uiId'],_0x32689f['isLoading']);}),this['activeConversation']['on']('contextSent',(_0x174172,_0x27dc44)=>{this['_aiChatUi']['setConversationContext'](_0x27dc44['contextItems']);}),this['activeConversation']['on']('addContextOptionsChanged',(_0x1d281b,_0x4f9e5a)=>{this['_aiChatUi']['setAddContextOptions'](_0x4f9e5a['options']);}),this['activeConversation']['on']('sourceResourcesLoaded',(_0x2d8119,_0x25c8dd)=>{this['_aiChatUi']['populateSourceResourceBalloon'](_0x25c8dd['sourceId'],_0x25c8dd['source'],_0x25c8dd['resources'],_0x25c8dd['uid']);}),this['activeConversation']['on']('resourceStateChanged',(_0x45efd7,_0x3d2bf0)=>{this['_aiChatUi']['updateResourceState'](_0x3d2bf0['sourceId'],_0x3d2bf0['resourceId'],_0x3d2bf0['isInContext']);}),this['activeConversation']['on']('capabilitiesUpdated',(_0x448414,_0xc1aa83)=>{this['_aiChatUi']['updateCapabilities'](_0xc1aa83);}),this['activeConversation']['on']('modelSelected',(_0x8b1c96,_0x204a64)=>{this['_aiChatUi']['setSelectedModel'](_0x204a64['selectedModel'],_0x204a64['isDisabled']);}),this['activeConversation']['on']('error',(_0x4c8b8b,{error:_0x24873f,interactionId:_0x18b242,fileName:_0x370473,url:_0x4b05cf,sourceId:_0x34996c,sourceLabel:_0x3a1808})=>{const _0x205098=_0x18b242?_0x18b242+':'+_0xdc126c():_0xdc126c();_0x24873f['message']['startsWith']('ai-request-aborted')?this['_aiChatUi']['addFeedItemStaticMessage']({'staticMessage':i(this['context']['locale'],'AI_CHAT_ABORTED_MESSAGE'),'id':_0x205098}):_0x24873f['message']['startsWith']('ai-chat-conversation-init-failed')||_0x24873f['message']['startsWith']('ai-chat-conversation-start-failed')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_UNABLE_TO_START_CONVERSATION'),'id':_0x205098}),this['_logError'](_0x24873f)):_0x24873f['message']['startsWith']('ai-chat-file-upload-failed')?this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_FILE',_0x370473),'id':_0x205098}):_0x24873f['message']['startsWith']('ai-chat-url-upload-failed')?this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_URL',_0x4b05cf),'id':_0x205098}):_0x24873f['message']['startsWith']('ai-chat-context-invalid-data')?this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_CONTEXT_INVALID_DATA'),'id':_0x205098}):_0x24873f['message']['startsWith']('ai-chat-context-unsupported-type')?this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_CONTEXT_UNSUPPORTED_TYPE'),'id':_0x205098}):_0x24873f['message']['startsWith']('ai-chat-source-resources-load-failed')?(_0x34996c&&this['_aiChatUi']['closeSourceResourceBalloon'](_0x34996c),this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_LOAD_RESOURCES',_0x3a1808||'source'),'id':_0x205098}),this['_logError'](_0x24873f)):_0x24873f['message']['startsWith']('ai-chat-resource-load-failed')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_RESOURCE_LOAD_FAILED'),'id':_0x205098}),this['_logError'](_0x24873f)):_0x24873f['message']['startsWith']('ai-chat-invalid-request')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_INVALID_REQUEST'),'id':_0x205098}),this['_logError'](_0x24873f)):_0x24873f['message']['startsWith']('ai-chat-context-unsupported-file-type')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_CONTEXT_UNSUPPORTED_FILE_TYPE'),'id':_0x205098}),this['_logError'](_0x24873f)):_0x24873f['message']['startsWith']('ai-chat-context-file-too-large')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_CONTEXT_FILE_TOO_LARGE'),'id':_0x205098}),this['_logError'](_0x24873f)):_0x24873f['message']['startsWith']('ai-chat-context-file-too-many-pages')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_CONTEXT_FILE_TOO_MANY_PAGES'),'id':_0x205098}),this['_logError'](_0x24873f)):_0x24873f['message']['startsWith']('ai-chat-context-form-data-size-limits-exceeded')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_CONTEXT_FORM_DATA_SIZE_LIMITS_EXCEEDED'),'id':_0x205098}),this['_logError'](_0x24873f)):(this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_GENERIC_ERROR'),'id':_0x205098}),this['_logError'](_0x24873f));}),await this['activeConversation']['init'](this['context']['config']['get']('ai.chat.context')),_0x2e7453||await this['activeConversation']['start']();}async['_handleUIUserMessage']({userMessage:_0x4112f1,quickActionData:_0x554753}){if(!this['activeConversation'])throw new _0x36b126('ai-chat-controller-no-active-conversation');this['activeConversation']['isCurrentDocumentInContext']()&&await this['activeConversation']['updateCurrentDocumentInContext'](this['_aiEditing']['getDocumentData']()),this['activeConversation']['id']&&this['activeConversation']['isStarted']&&await this['activeConversation']['handleUserInteraction']({'userMessage':_0x4112f1,'quickActionData':_0x554753}),this['_removeAISelectionMarkers']();}['_removeAISelectionMarkers'](){const _0x6d26a1=ut(this['context'])['model'],_0xcf3bd6=Array['from'](_0x6d26a1['markers']['getMarkersGroup'](It));_0x6d26a1['change'](_0x3bcb47=>{_0xcf3bd6['forEach'](_0x37a764=>_0x3bcb47['removeMarker'](_0x37a764));});}['_showConversationHistory'](){console['log']('Showing\x20conversation\x20history...');}['_setIsMaximized'](_0x48a4c9){this['_aiChatUi']['setIsMaximized'](_0x48a4c9);}['_logError'](_0x2c0e43){ft(_0x2c0e43['message']);}['_removeFromContext'](_0x2c5d55){this['activeConversation']?.['removeFromContext'](_0x2c5d55);}['_toggleWebSearch'](){this['activeConversation']?.['toggleWebSearch']();}['_toggleReasoning'](){this['activeConversation']?.['toggleReasoning']();}['getInteractionAndReplyById'](_0x4df697){const [_0x4adcd5,_0x4a6661]=_0x4df697['split'](':'),_0x223125=this['activeConversation']['getInteraction'](_0x4adcd5),_0x1052f4=_0x223125['getReply'](_0x4a6661);return{'interaction':_0x223125,'reply':_0x1052f4};}['_scrollToSuggestionRange'](_0x980b4c,_0x14e6ca=!0x1){const _0x480495=ut(this['context']),_0x4ae1e2={'target':_0x480495['editing']['view']['domConverter']['viewRangeToDom'](_0x480495['editing']['mapper']['toViewRange'](_0x980b4c)),'viewportOffset':{'top':0x96,'left':0x0,'bottom':0x32,'right':0x0},'ancestorOffset':0x14,'alignToTop':_0x14e6ca};_0x14e6ca&&(_0x4ae1e2['alignToTop']=!0x0),ht(_0x4ae1e2);}['updateConversationTitle'](_0x2dd316,_0x396068=!0x1){this['_aiChatUi']['setConversationTitle'](_0x2dd316||i(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION'),_0x396068);}async['_updateReplyContent']({reply:_0x343a65,renderingStrategy:_0x13cdf6}){const {id:_0x4b6c3a,isDone:_0x583797,type:_0x2b2112,parsedContent:_0xe97eb1}=_0x343a65;if('modification-delta'===_0x2b2112){const _0x3a4e88=_0x343a65['getContentParts']({'showDiff':this['_aiChatUi']['showDiff']});await this['_aiChatUi']['updateFeedItemAIReplySuggestionContent']({'id':_0x4b6c3a,'parts':_0x3a4e88,'renderingStrategy':_0x13cdf6,'isDone':_0x583797});}else'text-delta'===_0x2b2112&&await this['_aiChatUi']['updateFeedItemAIReplyContent']({'id':_0x4b6c3a,'parsedContent':_0xe97eb1,'renderingStrategy':_0x13cdf6,'isDone':_0x583797});_0x583797&&_0x343a65['sources']['length']>0x0&&this['_aiChatUi']['updateFeedItemAIReplySources'](_0x4b6c3a,_0x343a65['sources']);}async['_stopLastInteraction'](){const _0x4af752=this['activeConversation']?.['lastInteraction'];_0x4af752&&(_0x4af752['stop'](),this['_aiChatUi']['stopInteraction'](_0x4af752));}async['_flushLastInteractionUI'](){const _0x8da560=this['activeConversation']?.['lastInteraction'];if(_0x8da560){for await(const _0x36b483 of _0x8da560['replies'])await this['_updateReplyContent']({'reply':_0x36b483,'renderingStrategy':'static'});}}['_updateRatings'](_0x582b6b){const _0x473d0f={'positiveCount':_0x582b6b['changeGroups']['filter'](_0x2d92af=>'accepted'===_0x2d92af['state'])['length'],'totalCount':_0x582b6b['changeGroups']['length'],'modificationId':_0x582b6b['id']},_0x232d19=this['activeConversation']['getInteraction'](_0x582b6b['interactionId'])['messageId'];this['_aiConnector']['upsertAIChatRating'](this['activeConversation']['id'],_0x232d19,_0x473d0f);}}const Mt=[...Ee,'startConversation','resizeTabs','sendUserMessage','abortPromptStream','addDocumentToContext','addFileToContext','addUrlToContext','addResourceToContext','removeContextItem','loadSourceResources','toggleWebSearch','toggleReasoning','selectModel'];class Le extends Fr{['containerView'];['actionsView'];constructor(_0x218e46,_0x3e9342,_0x4523cc){super(_0x3e9342),this['set']('isTrackChangesOn',!0x1),this['containerView']=new T(_0x218e46,{'showDiff':_0x3e9342['showDiff'],'areActionsDisabled':_0x3e9342['areActionsDisabled'],'availableActions':_0x3e9342['availableActions']},_0x4523cc),this['containerView']['on']('toggleSuggestionDisplayMode',(_0x1e8415,_0x3c3e33)=>{this['fire']('toggleSuggestionDisplayMode',{'replyId':this['options']['id'],'showDiff':_0x3c3e33['showDiff']});}),this['containerView']['on']('like',()=>{this['fire']('like',{'replyId':this['options']['id']});}),this['containerView']['on']('dislike',()=>{this['fire']('dislike',{'replyId':this['options']['id']});}),this['containerView']['on']('showChangeInText',(_0x2972a0,{index:_0x295699})=>{this['fire']('showChangeInText',{'replyId':this['options']['id'],'partIndex':_0x295699});}),this['containerView']['on']('insertSuggestion',(_0x1afae9,{index:_0x2cf8ea})=>{this['fire']('insertSuggestion',{'replyId':this['options']['id'],'partIndex':_0x2cf8ea});}),this['containerView']['on']('rejectSuggestion',(_0x161dd7,{index:_0x659864})=>{this['fire']('rejectSuggestion',{'replyId':this['options']['id'],'partIndex':_0x659864});}),this['containerView']['on']('mouseOverSuggestion',(_0x2590be,{index:_0x14b885})=>{this['fire']('mouseOverSuggestion',{'replyId':this['options']['id'],'partIndex':_0x14b885});}),this['containerView']['on']('mouseLeaveSuggestion',(_0x573260,{index:_0x273d85})=>{this['fire']('mouseLeaveSuggestion',{'replyId':this['options']['id'],'partIndex':_0x273d85});}),this['actionsView']=new ah(_0x218e46,this['options']['availableActions']),this['actionsView']['bind']('isTrackChangesOn')['to'](this,'isTrackChangesOn'),this['actionsView']['on']('showChangeInText',()=>{this['fire']('showChangeInText',{'replyId':this['options']['id']});}),this['actionsView']['on']('insertSuggestion',()=>{this['fire']('insertSuggestion',{'replyId':this['options']['id']});}),this['actionsView']['on']('applySuggestion',()=>{this['fire']('applySuggestion',{'replyId':this['options']['id']});}),_0x3e9342['areActionsDisabled']?this['actionsView']['isEnabled']=!0x1:this['actionsView']['bind']('isEnabled')['to'](this['containerView']['bodyView'],'hasPendingParts'),this['children']['addMany']([this['containerView'],this['actionsView']]),this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__ai-suggestion']}});}async['updateContent'](_0x21bc63){await this['containerView']['updateContent'](_0x21bc63),this['actionsView']['updateLabels'](this['containerView']['bodyView']['partsCount']);}['updatePartState'](_0x1a6bb5,_0x3ae2c1){this['containerView']['bodyView']['updatePartState'](_0x1a6bb5,_0x3ae2c1);}['updateSources'](_0x3b8f62){this['containerView']['updateSources'](_0x3b8f62);}['getPartView'](_0x4dcf02){return this['containerView']['bodyView']['getPartView'](_0x4dcf02);}['markAsDone'](){super['markAsDone'](),this['containerView']['markAsDone'](),this['actionsView']['isVisible']=this['containerView']['bodyView']['hasNonEmptyParts'];}}class Ve extends Fr{['replyContainer'];['_bodyCollection'];constructor(_0x183f8b,_0x332fbe,_0x34ddde){super(_0x332fbe),this['_bodyCollection']=_0x34ddde,this['locale']=_0x183f8b,this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__ai-reply']}}),this['replyContainer']=new _0x43effc(),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':He(this['options']['initialContent']),'renderingStrategy':'static'}),this['markAsDone']());}async['updateContent']({parsedContent:_0x5340fe,renderingStrategy:_0x236be4,abortSignal:_0x1eddec}){'streaming'===_0x236be4?await this['streamIntoElement'](_0x5340fe,this['replyContainer']['element'],_0x1eddec):this['replyContainer']['element']['innerHTML']=_0x4b71ff(_0x5340fe);}['updateSources'](_0x21c007){const _0x19295c=new Sr(this['locale'],this['_bodyCollection']);_0x19295c['children']['addMany'](_0x21c007['map'](_0x13f8b1=>new Rr(this['locale'],_0x13f8b1,_0x19295c['balloonPanelView']))),_0x19295c['isVisible']=!0x0,this['children']['add'](_0x19295c);}}const xn={'file':_0x18ec8e,'document':_0x584f93,'web-resource':_0x3ed6af,'text':_0x18ec8e,'selection':_0x498e88},$r='ck-ai-chat-context-chip',Qr='ck-ai-chat-context-chip_wide',Zr='ck-ai-chat-context-chip_document',ra='ck-ai-chat-context-chip__label',oa='ck-ai-chat-context-chip__type-icon',ca='ck-ai-chat-context-controls__chip-tooltip',Cn='n';class Bo extends _0xcbb426{constructor(_0x3e77d4,_0x366e91,_0x54c9dd,_0x35bdc9,_0x3c43e3=!0x1){super(_0x3e77d4),this['_isAnimationOnEnterEnabled']=_0x35bdc9,this['_initializeProperties'](_0x366e91,_0x54c9dd,_0x3c43e3),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'](_0x4fd988,_0x277d1e,_0x2ede93){this['set']('label',_0x4fd988['label']),this['set']('tooltip',!0x0),this['set']('itemType',_0x4fd988['type']),this['set']('id',_0x4fd988['uiId']),this['set']('readonly',_0x277d1e),this['set']('isLoading',_0x2ede93);}['_setupTemplate'](){const _0x11ad04=this['_createIconView'](),_0x64f8f8=this['_createRemoveButton'](),_0x25f42d=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':this['_createTemplateAttributes'](_0x25f42d),'children':this['_createTemplateChildren'](_0x11ad04,_0x64f8f8,_0x25f42d)});}['_createTemplateAttributes'](_0x100a95){return{'class':[$r,_0x100a95['if']('itemType',Zr,_0x2e0a38=>'document'==_0x2e0a38),_0x100a95['if']('itemType',Qr,_0x1a2b60=>'selection'==_0x1a2b60)],'data-cke-tooltip-text':_0x100a95['to']('label',In),'data-cke-tooltip-position':Cn,'data-cke-tooltip-class':ca};}['_createTemplateChildren'](_0x4f079d,_0x46cbca,_0x379f62){const _0x55293d=this['_createLabelElement'](_0x379f62),_0x5d13a3=this['_createLoaderIcon']();return this['readonly']?[_0x4f079d,_0x55293d]:[_0x4f079d,_0x5d13a3,_0x55293d,_0x46cbca];}['_createLabelElement'](_0x316785){return{'tag':'span','attributes':{'class':ra},'children':[{'text':_0x316785['to']('label')}]};}['_createRemoveButton'](){const _0x439c86=new _0xcbb426(this['locale']);return _0x439c86['set']({'label':i(this['locale'],'AI_CHAT_CONTEXT_REMOVE_FROM_CONTEXT'),'icon':_0x516001}),this['_setupRemoveButtonEvent'](_0x439c86),_0x439c86;}['_setupRemoveButtonEvent'](_0x55bc60){_0x55bc60['on']('execute',()=>{this['fire']('removeContextItemChip',this['id']);});}['_createIconView'](){const _0x4f9d9c=this['bindTemplate'],_0x362165=new _0x4caa0b();return _0x362165['content']=xn[this['itemType']],_0x362165['extendTemplate']({'attributes':{'class':[oa,_0x4f9d9c['if']('isLoading','ck-hidden',_0xde3d3e=>_0xde3d3e)]}}),_0x362165;}['_handleAnimationEndOnce'](_0x2afad2,_0x4f7bcc){if(!_0x2afad2)return;const _0x1c80c3=()=>{_0x4f7bcc(),_0x2afad2['removeEventListener']('animationend',_0x1c80c3),_0x2afad2['removeEventListener']('webkitAnimationEnd',_0x1c80c3);};_0x2afad2['addEventListener']('animationend',_0x1c80c3),_0x2afad2['addEventListener']('webkitAnimationEnd',_0x1c80c3);}['_createLoaderIcon'](){const _0x4dcbff=new We('small');return _0x4dcbff['bind']('isVisible')['to'](this,'isLoading',_0x3de9ee=>_0x3de9ee),_0x4dcbff;}}function In(_0x13578a){if(!_0x13578a)return _0x13578a;if(_0x13578a['length']<=0x78)return _0x13578a;const _0x59cbbe=_0x13578a['slice'](0x0,0x78),_0x49eadf=_0x59cbbe['lastIndexOf']('\x20');return(_0x49eadf>0x0?_0x59cbbe['slice'](0x0,_0x49eadf):_0x59cbbe)+'…';}const hn={'maxVisibleRows':0x2,'rowDetectionTolerance':0x5,'showMoreLabelPrefix':'+\x20','viewportOffset':{'top':0x64,'bottom':0xa}},an='300px';class To{['_locale'];['_config'];['_visibleChips'];['_overflowChips'];['_showMoreButtonView']=null;['_showMoreBalloonPanelView']=null;['_containerElement']=null;['_bodyCollection'];['_parentView']=null;['_intersectionObserver']=null;['_pendingCalculation']=!0x1;constructor(_0x43b93b,_0x474526,_0x20b326,_0x4cbdad,_0x184ab5){this['_locale']=_0x43b93b,this['_visibleChips']=_0x474526,this['_config']={...hn,..._0x20b326,'cssClasses':{'controlsButton':'','calculationContainer':'ck-calculation-container',..._0x20b326['cssClasses']}},this['_overflowChips']=new _0x5137f7(),this['_bodyCollection']=_0x4cbdad,this['_parentView']=_0x184ab5||null;}['setContainerElement'](_0x173d13){this['_intersectionObserver']&&(this['_intersectionObserver']['disconnect'](),this['_intersectionObserver']=null),this['_containerElement']=_0x173d13,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 _0x24f124=[...this['_visibleChips'],...this['_overflowChips']],_0xf3caa9=this['_createCalculationContainer'](),_0x4ed926=this['_calculateOverflowInContainer'](_0xf3caa9,_0x24f124),_0xf738c5=_0xf3caa9['_ancestorsToRestore'];_0xf738c5&&this['_restoreAncestorVisibility'](_0xf738c5),_0xf3caa9['remove'](),this['_applyOverflowResults'](_0x24f124,_0x4ed926);}['_createShowMoreButton'](){this['_showMoreButtonView']=this['_createShowMoreButtonView'](),this['_showMoreBalloonPanelView']=this['_createShowMoreBalloonPanelView'](),this['_showMoreButtonView']['render'](),this['_containerElement']['appendChild'](this['_showMoreButtonView']['element']),this['_showMoreButtonView']['on']('execute',()=>{this['_handleShowMoreButtonClick']();}),_0x4b855c({'emitter':this['_showMoreBalloonPanelView'],'contextElements':[this['_showMoreBalloonPanelView']['element'],this['_showMoreButtonView']['element']],'callback':()=>this['hideBalloonPanel'](),'activator':()=>this['_showMoreButtonView']['isOn']});}['_createShowMoreButtonView'](){const _0x2ac3d8=new _0xcbb426(this['_locale']);_0x2ac3d8['set']({'label':'','withText':!0x0,'isToggleable':!0x0});const _0x3ccbfc=[this['_config']['cssClasses']['showMoreButton']];return this['_config']['cssClasses']['controlsButton']&&_0x3ccbfc['push'](this['_config']['cssClasses']['controlsButton']),_0x2ac3d8['extendTemplate']({'attributes':{'class':_0x3ccbfc}}),_0x2ac3d8;}['_createShowMoreBalloonPanelView'](){const _0x77b0e0=new _0x2ae23a(this['_locale']);return _0x77b0e0['extendTemplate']({'attributes':{'class':this['_config']['cssClasses']['showMoreBalloon']}}),this['_bodyCollection']['add'](_0x77b0e0),_0x77b0e0;}['_updateBalloonContent'](){if(this['_showMoreBalloonPanelView']&&(this['_showMoreBalloonPanelView']['content']['clear'](),this['_overflowChips']['length']>0x0)){this['_overflowChips']['forEach'](_0x441640=>{_0x441640['disableAnimationOnEnter']();});const _0x23c3a2=new _0x43effc(this['_locale']);_0x23c3a2['setTemplate']({'tag':'div','attributes':{'class':this['_config']['cssClasses']['overflowContainer']},'children':this['_overflowChips']}),this['_showMoreBalloonPanelView']['content']['add'](_0x23c3a2);}}['_handleShowMoreButtonClick'](){this['_showMoreButtonView']['isOn']?this['hideBalloonPanel']():this['showBalloonPanel']();}['_updateShowMoreButtonVisibility'](){const _0x469f04=this['_overflowChips']['length']>0x0;this['_showMoreButtonView']?.['element']&&(this['_showMoreButtonView']['element']['style']['display']=_0x469f04?'':'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'](_0x3b1541){const _0x2405e9=this['_containerElement']?.['tagName']['toLowerCase']()||'div',_0x2014a2=this['_containerElement']?.['classList'];if(_0x2014a2){const _0x528fba=_0x2014a2[0x0]||'',_0x4da932=_0x3b1541['querySelector']('.'+_0x528fba),_0x108732=_0x3b1541['querySelector'](_0x2405e9);return _0x4da932||_0x108732||_0x3b1541;}return _0x3b1541['querySelector'](_0x2405e9)||_0x3b1541;}['_calculateContainerWidth'](){const _0x369fb9=this['_parentView']?.['element']||this['_containerElement'];if(!_0x369fb9)return an;const _0x3f130d=window['getComputedStyle'](_0x369fb9)['width'];if('auto'===_0x3f130d||'0px'===_0x3f130d||!_0x3f130d){const _0x2083f3=_0x369fb9['parentElement'];if(_0x2083f3){const _0x4cd83b=window['getComputedStyle'](_0x2083f3);return'auto'!==_0x4cd83b['width']?_0x4cd83b['width']:an;}return an;}return _0x3f130d;}['_applyCalculationStyles'](_0x24a60c,_0x3e4c6d){this['_config']['cssClasses']['calculationContainer']&&_0x24a60c['classList']['add'](this['_config']['cssClasses']['calculationContainer']),_0x24a60c['style']['width']=_0x3e4c6d,_0x24a60c['style']['position']='absolute',_0x24a60c['style']['top']='-9999px',_0x24a60c['style']['left']='-9999px',_0x24a60c['style']['opacity']='0',_0x24a60c['style']['pointerEvents']='none',_0x24a60c['style']['zIndex']='-1',_0x24a60c['style']['visibility']='visible\x20!important',_0x24a60c['style']['display']='block\x20!important',_0x24a60c['style']['boxSizing']='border-box';}['_restoreAncestorVisibility'](_0x529cc7){_0x529cc7['forEach'](({element:_0x559791,originalDisplay:_0x21944a,originalVisibility:_0x26b462})=>{_0x559791['style']['display']=_0x21944a,_0x559791['style']['visibility']=_0x26b462;});}['_makeAncestorsVisible'](_0x15d7f2){const _0x9ef97e=[];let _0x52996d=_0x15d7f2;for(;_0x52996d&&_0x52996d!==document['body'];){const _0x424fb6=window['getComputedStyle'](_0x52996d);'none'!==_0x424fb6['display']&&'hidden'!==_0x424fb6['visibility']||(_0x9ef97e['push']({'element':_0x52996d,'originalDisplay':_0x52996d['style']['display'],'originalVisibility':_0x52996d['style']['visibility']}),_0x52996d['style']['display']='block',_0x52996d['style']['visibility']='visible'),_0x52996d=_0x52996d['parentElement'];}return _0x9ef97e;}['_createContainerElements'](){let _0x49a71b,_0x3a5464;return this['_parentView']?.['element']?(_0x49a71b=this['_parentView']['element']['cloneNode'](!0x0),_0x3a5464=this['_findTargetContainer'](_0x49a71b)):(_0x49a71b=document['createElement']('div'),_0x3a5464=_0x49a71b),{'calculationContainer':_0x49a71b,'targetContainer':_0x3a5464};}['_createCalculationContainer'](){const {calculationContainer:_0x446bcb,targetContainer:_0x4df2a4}=this['_createContainerElements'](),_0x1b4a83=this['_calculateContainerWidth']();this['_applyCalculationStyles'](_0x446bcb,_0x1b4a83);const _0x26250a=this['_parentView']?.['element']||this['_containerElement'],_0x20ddc2=_0x26250a?.['parentElement'];_0x20ddc2?_0x20ddc2['appendChild'](_0x446bcb):document['body']['appendChild'](_0x446bcb),_0x446bcb['_targetContainer']=_0x4df2a4;const _0xfa828b=this['_makeAncestorsVisible'](_0x20ddc2||null);return _0x446bcb['offsetWidth'],_0x446bcb['_ancestorsToRestore']=_0xfa828b,_0x446bcb;}['_calculateOverflowInContainer'](_0x4271d7,_0x284384){const _0x535591=_0x4271d7['_targetContainer']||_0x4271d7,_0x1d278e=[],{rowCount:_0x2a05e6}=this['_renderChipsAndCountRows'](_0x535591,_0x284384);if(_0x2a05e6<=this['_config']['maxVisibleRows'])return _0x1d278e;const _0x3b1f06=_0x284384['slice']();for(;_0x3b1f06['length']>0x0;){if(this['_testButtonFit'](_0x4271d7,_0x535591,_0x3b1f06)){const _0x3e3d49=_0x284384['filter'](_0x1f6866=>!_0x3b1f06['includes'](_0x1f6866));_0x1d278e['push'](..._0x3e3d49);break;}if(!_0x3b1f06['pop']())break;}return _0x1d278e;}['_renderChipsAndCountRows'](_0x6e9b51,_0x2c57c4){_0x6e9b51['innerHTML']='',_0x2c57c4['forEach'](_0x5cc88b=>{if(_0x5cc88b['element']){const _0x1d4d19=_0x5cc88b['element']['cloneNode'](!0x0);_0x6e9b51['appendChild'](_0x1d4d19);}}),_0x6e9b51['offsetWidth'];const _0xac641a=_0x6e9b51['children'],_0x5673fa=[];return Array['from'](_0xac641a)['forEach'](_0x534dfa=>{const _0x5eb1db=_0x534dfa['getBoundingClientRect']()['top'];_0x5673fa['some'](_0x206667=>Math['abs'](_0x206667-_0x5eb1db)<this['_config']['rowDetectionTolerance'])||_0x5673fa['push'](_0x5eb1db);}),{'rowCount':_0x5673fa['length']};}['_createMockButton'](){const _0x22cae3=document['createElement']('button');return _0x22cae3['className']=this['_config']['cssClasses']['showMoreButton'],this['_config']['cssClasses']['controlsButton']&&_0x22cae3['classList']['add'](this['_config']['cssClasses']['controlsButton']),_0x22cae3['textContent']='+\x201',_0x22cae3;}['_testButtonFit'](_0x57cdc9,_0x8f36cf,_0x3732e0){this['_renderChipsAndCountRows'](_0x8f36cf,_0x3732e0);const _0x452876=this['_createMockButton']();_0x57cdc9['appendChild'](_0x452876),_0x57cdc9['offsetWidth'];const _0x3c2276=[..._0x8f36cf['children'],_0x452876],_0x3dcc93=[];_0x3c2276['forEach'](_0x15441d=>{const _0x381f93=_0x15441d['getBoundingClientRect']()['top'];_0x3dcc93['some'](_0xc734d1=>Math['abs'](_0xc734d1-_0x381f93)<this['_config']['rowDetectionTolerance'])||_0x3dcc93['push'](_0x381f93);});const _0x1f17ea=_0x3dcc93['length'];return _0x452876['remove'](),_0x1f17ea<=this['_config']['maxVisibleRows'];}['_distributeChips'](_0x134389,_0x39c88a){this['_visibleChips']['clear'](),this['_overflowChips']['clear'](),_0x134389['forEach'](_0xa078c3=>{_0x39c88a['includes'](_0xa078c3)?this['_overflowChips']['add'](_0xa078c3):this['_visibleChips']['add'](_0xa078c3);});}['_updateOverflowUI'](_0x389415){if(_0x389415>0x0&&!this['_showMoreButtonView']&&this['_createShowMoreButton'](),_0x389415>0x0&&this['_showMoreButtonView']){const _0x7f578d=''+this['_config']['showMoreLabelPrefix']+(_0x389415<0x63?_0x389415:'99');this['_showMoreButtonView']['label']=_0x7f578d;}this['_updateBalloonContent'](),this['_updateShowMoreButtonVisibility'](),this['_repinBalloonPanel']();}['_applyOverflowResults'](_0x5349c0,_0x4404c5){this['_distributeChips'](_0x5349c0,_0x4404c5),this['_updateOverflowUI'](_0x4404c5['length']);}['_setupVisibilityObserver'](){this['_containerElement']&&'undefined'!=typeof IntersectionObserver&&(this['_intersectionObserver']=new IntersectionObserver(_0xb2811e=>{_0xb2811e[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 _0x3e47e3=this['_containerElement']['getBoundingClientRect']();if(0x0===_0x3e47e3['width']||0x0===_0x3e47e3['height'])return!0x1;const _0x1ccff9=window['innerHeight']||document['documentElement']['clientHeight'],_0x46934e=window['innerWidth']||document['documentElement']['clientWidth'],_0x442e0a=0xc8;return _0x3e47e3['bottom']>=-0xc8&&_0x3e47e3['top']<=_0x1ccff9+_0x442e0a&&_0x3e47e3['right']>=-0xc8&&_0x3e47e3['left']<=_0x46934e+_0x442e0a;}}const la='ck-ai-chat__feed__context-chips',da='ck-ai-chat-context-chips-wrapper',ua='ck-ai-chat-context-chips-wrapper-balloon',_a='ck-ai-chat-controls-button',Ia='ck-ai-chat-controls_context_show-more-button',Aa='ck-ai-chat-context-controls__show-more-balloon-panel';class _h extends _0x43effc{['_contextChips']=this['createCollection']();['_overflowManager'];['_bodyCollection'];constructor(_0x56be63,_0x2fb7c9,_0x68b904){super(_0x56be63),this['_bodyCollection']=_0x68b904,this['_createContextChips'](_0x2fb7c9);const _0x2fb07c={'cssClasses':{'showMoreButton':Ia,'showMoreBalloon':Aa,'overflowContainer':ua,'controlsButton':_a}};this['_overflowManager']=new To(_0x56be63,this['_contextChips'],_0x2fb07c,this['_bodyCollection'],this),this['setTemplate']({'tag':'div','attributes':{'class':[la,'ck','ck-reset_all']},'children':[{'tag':'div','attributes':{'class':da},'children':this['_contextChips']}]});}['render'](){super['render']();const _0x37ff2b=this['element']['querySelector']('.'+da);_0x37ff2b&&(this['_overflowManager']['setContainerElement'](_0x37ff2b),this['_overflowManager']['reorganizeChips']());}['destroy'](){super['destroy'](),this['_overflowManager']['destroy']();}['_createContextChips'](_0x6f70a4){for(const _0x260b71 of _0x6f70a4){const _0xe5092b=new Bo(this['locale'],_0x260b71,!0x0,!0x1);this['_contextChips']['add'](_0xe5092b);}}}class Me extends Fr{['_contextChipsView']=null;['_locale'];['_bodyCollection'];['_messageContentView'];constructor(_0x2480e5,_0x2051da,_0x404000){super(_0x2051da),this['_locale']=_0x2480e5,this['_bodyCollection']=_0x404000,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 _h(this['_locale'],this['options']['contextItems']['filter'](_0x2b7da0=>!_0x2b7da0['hidden']),this['_bodyCollection']),this['_contextChipsView']['extendTemplate']({'attributes':{'class':'ck-ai-chat__feed__context-chips'}}),this['children']['add'](this['_contextChipsView']));}['_createMessageContentView'](){this['_messageContentView']=new _0x43effc(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 Lt extends Fr{['capabilities'];constructor(_0x4027c4,_0x412896){super(_0x412896);const {isWebSearchEnabled:_0x3118fd,isReasoningEnabled:_0x41695b}=_0x412896['capabilities'],_0x4ff799=[];let _0x159b88='';_0x3118fd&&_0x41695b?(_0x159b88=i(_0x4027c4,'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH_REASONING'),_0x4ff799['push'](aa(_0x46b22c)),_0x4ff799['push'](aa(_0x279253))):_0x3118fd?(_0x159b88=i(_0x4027c4,'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH'),_0x4ff799['push'](aa(_0x46b22c))):_0x41695b&&(_0x159b88=i(_0x4027c4,'AI_CHAT_FEED_REPLY_ITEM_USED_REASONING'),_0x4ff799['push'](aa(_0x279253))),this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__interaction-header',_0x159b88?'':'ck-hidden']}});const _0x28a8b2=new _0x43effc();_0x28a8b2['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__interaction-header__capabilities']},'children':[..._0x4ff799,{'tag':'span','attributes':{'class':['ck-ai-chat__feed__interaction-header__capabilities__text']},'children':[_0x159b88]}]}),this['children']['add'](_0x28a8b2),this['capabilities']=_0x412896['capabilities'];}}function aa(_0x171e6e){const _0x2e4edf=new _0x4caa0b();return _0x2e4edf['content']=_0x171e6e,_0x2e4edf;}class Pe extends _0x43effc{constructor(_0x2fef8e,_0x2b973c){super(_0x2fef8e),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-skeleton']},'children':this['_createSkeletonItems'](_0x2b973c)});}['_createSkeletonItems'](_0x4f8663){const _0x1a6018=['ck','ck-ai-skeleton__item'];return _0x4f8663['map'](_0x2039e3=>{let _0x56cdef='';switch(_0x2039e3['attributes']['align']){case'right':_0x56cdef='margin-left:\x20auto;\x20margin-right:\x200;\x20text-align:\x20right;';break;case'center':_0x56cdef='margin-left:\x20auto;\x20margin-right:\x20auto;\x20text-align:\x20center;';break;case'left':_0x56cdef='margin-left:\x200;\x20margin-right:\x20auto;\x20text-align:\x20left;';}return{'tag':_0x2039e3['tag'],'attributes':{'class':[..._0x1a6018,_0x2039e3['attributes']['class']?_0x2039e3['attributes']['class']:''],'style':'width:\x20'+_0x2039e3['attributes']['width']+';\x20height:\x20'+_0x2039e3['attributes']['height']+';'+_0x56cdef}};});}}const Be={'aiFeed':[{'tag':'div','attributes':{'width':'100%','height':'72px','align':'right'}},{'tag':'div','attributes':{'width':'250px','height':'40px','align':'right'}},{'tag':'div','attributes':{'width':'100%','height':'88px','align':'right'}},{'tag':'div','attributes':{'width':'150px','height':'40px','align':'right'}},{'tag':'div','attributes':{'width':'100%','height':'140px','align':'right'}},{'tag':'div','attributes':{'width':'250px','height':'40px','align':'right'}},{'tag':'div','attributes':{'width':'100%','height':'88px','align':'right'}}],'aiHistory':ta(0x5,'100%','44px','right'),'aiChatResources':ta(0x8,'100%','24px','right'),'aiReviewChecks':[{'tag':'div','attributes':{'width':'128px','height':'24px','align':'left'}},{'tag':'div','attributes':{'width':'100%','height':'24px','align':'left'}},{'tag':'div','attributes':{'width':'128px','height':'24px','align':'left'}}]};function ta(_0x22126b,_0x3dc3e2,_0x121b76,_0x5c000e){return new Array(_0x22126b)['fill'](null)['map'](()=>({'tag':'div','attributes':{'width':_0x3dc3e2,'height':_0x121b76,'align':_0x5c000e}}));}class pi extends _0x43effc{['children'];['scrollManager'];['_bodyCollection'];constructor(_0x212474,_0x1164d9){super(_0x212474),this['_bodyCollection']=_0x1164d9,this['set']('isPending',!0x1),this['set']('loadingMessage',''),this['set']('isLoadingSkeletonVisible',!0x1),this['set']('isTrackChangesOn',!0x1),this['children']=this['createCollection'](),this['children']['delegate'](...Mt)['to'](this),this['_setupTemplate']();}['render'](){super['render'](),this['scrollManager']=new us(this['element']);}['destroy'](){super['destroy'](),this['scrollManager']['destroy']();}['clear'](){this['children']['clear']();}['addItem'](_0xf97736,_0x332f22){let _0x36a8b8;'ai-reply'===_0xf97736?_0x36a8b8=new Ve(this['locale'],_0x332f22,this['_bodyCollection']):'ai-suggestion-reply'===_0xf97736?(_0x36a8b8=new Le(this['locale'],_0x332f22,this['_bodyCollection']),_0x36a8b8['bind']('isTrackChangesOn')['to'](this,'isTrackChangesOn')):_0x36a8b8='user-message'===_0xf97736?new Me(this['locale'],_0x332f22,this['_bodyCollection']):'interaction-header'===_0xf97736?new Lt(this['locale'],_0x332f22):new Oe(_0x332f22),this['children']['add'](_0x36a8b8);}async['updateReplyItem']({id:_0x53f5ad,parsedContent:_0x4dac,renderingStrategy:_0x3e5328,abortSignal:_0x1375d8}){const _0x3afe85=this['getItemById'](_0x53f5ad);if(!(_0x3afe85 instanceof Ve))throw new _0x36b126('ai-chat-feed-view-item-not-a-reply-item',null,{'itemView':_0x3afe85,'id':_0x53f5ad,'parsedContent':_0x4dac});await _0x3afe85['updateContent']({'parsedContent':_0x4dac,'renderingStrategy':_0x3e5328,'abortSignal':_0x1375d8});}async['updateWebSources'](_0x587bba,_0x25f135){const _0x3e40c1=this['getItemById'](_0x587bba);if(_0x3e40c1 instanceof Le)_0x3e40c1['updateSources'](_0x25f135);else{if(!(_0x3e40c1 instanceof Ve))throw new _0x36b126('ai-chat-feed-view-item-not-a-suggestion-or-reply-item',null,{'itemView':_0x3e40c1,'id':_0x587bba,'sources':_0x25f135});_0x3e40c1['updateSources'](_0x25f135);}}async['updateSuggestionItem']({id:_0x5cbd67,parts:_0x579b3f,renderingStrategy:_0x29afee,abortSignal:_0x35aeb5}){const _0x575696=this['getItemById'](_0x5cbd67);if(!(_0x575696 instanceof Le))throw new _0x36b126('ai-chat-feed-view-item-not-a-suggestion-item',null,{'itemView':_0x575696,'id':_0x5cbd67,'parts':_0x579b3f});await _0x575696['updateContent']({'parts':_0x579b3f,'renderingStrategy':_0x29afee,'abortSignal':_0x35aeb5});}['updateSuggestionPartState']({id:_0x1d82fd,index:_0x32213a,state:_0x5dc59d}){const _0x54f93b=this['getItemById'](_0x1d82fd);if(!(_0x54f93b instanceof Le))throw new _0x36b126('ai-chat-feed-view-item-not-a-suggestion-item',this,{'id':_0x1d82fd});_0x54f93b['updatePartState'](_0x32213a,_0x5dc59d);}['markItemAsDone'](_0x1379d8){this['getItemById'](_0x1379d8)['markAsDone']();}['getItemIds'](){return this['children']['map'](_0x17308a=>_0x17308a['options']['id']);}['removeItem'](_0xd08e5e){this['children']['remove'](this['getItemById'](_0xd08e5e));}['scrollToSuggestion'](_0x2a0c87,_0x10c5a5){const _0x283780=this['getItemById'](_0x2a0c87);if(!(_0x283780 instanceof Le))return void _0x3219ae('ck-ai-chat-feed-view-scroll-to-suggestion-invalid-item',{'replyId':_0x2a0c87,'partIndex':_0x10c5a5});const _0x281973=_0x283780['getPartView'](_0x10c5a5);_0x281973?ht({'target':_0x281973['element'],'ancestorOffset':0x14,'alignToTop':!0x0,'forceScroll':!0x0}):_0x3219ae('ck-ai-chat-feed-view-scroll-to-suggestion-part-view-not-found',{'replyId':_0x2a0c87,'partIndex':_0x10c5a5});}['_setupTemplate'](){this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed']},'children':this['_createTemplateChildren']()});}['_createTemplateChildren'](){const _0x5c6040=this['_createSkeletonLoader']();return[this['_createFeedItems'](),_0x5c6040,this['_createFeedLoader']()];}['_createSkeletonLoader'](){const _0x414bcd=new Pe(this['locale'],Be['aiFeed']);return _0x414bcd['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isLoadingSkeletonVisible','ck-hidden',_0x23fbbe=>!_0x23fbbe)]}}),_0x414bcd;}['_createFeedItems'](){const _0x4e66f7=new _0x43effc(this['locale']);return _0x4e66f7['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__items',this['bindTemplate']['if']('isLoadingSkeletonVisible','ck-hidden')]},'children':this['children']}),_0x4e66f7;}['_createFeedLoader'](){const _0x4e03e5=new _0x43effc(this['locale']);return _0x4e03e5['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__loader',this['bindTemplate']['if']('isPending','ck-hidden',_0x3fde7c=>!_0x3fde7c)]},'children':this['_createLoaderChildren']()}),_0x4e03e5;}['_createLoaderChildren'](){const _0x818c9f=new We();return _0x818c9f['isVisible']=!0x0,[_0x818c9f,{'tag':'span','attributes':{'class':['ck','ck-ai-chat__loader-text']},'children':[{'text':this['bindTemplate']['to']('loadingMessage')}]}];}['getItemById'](_0x14af41){const _0x12783f=this['children']['find'](_0x33bb16=>_0x33bb16['options']['id']['includes'](_0x14af41));if(!_0x12783f)throw new _0x36b126('ai-chat-feed-view-item-not-found',this,{'id':_0x14af41});return _0x12783f;}['setLoadingMessage'](_0x1f8061){this['set']('loadingMessage',_0x1f8061);}['toggleLoadingSkeleton'](_0x444374){this['set']('isLoadingSkeletonVisible',_0x444374);}['startAutoScroll'](){this['scrollManager']['start']();}['stopAutoScroll'](){this['scrollManager']['stop']();}}class Br extends _0x5bd1ba{['filter'](){let _0x497e71=0x0;for(const _0x5bb372 of this['items'])_0x497e71+=_0x5bb372['items']['length'];return{'resultsCount':_0x497e71,'totalItemsCount':_0x497e71};}}class ps extends _0x53698e{['submitButtonView'];static ['MIN_ROWS']=0x1;static ['MAX_ROWS']=0xc;['_addContextButtonView'];['_queryViewResizeObserver'];constructor(_0x374734,_0x21a5de){super(_0x374734,{'queryView':{'label':'','creator':_0x49d9f6,'showIcon':!0x1,'showResetButton':!0x1},'filteredView':new Br(_0x374734),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1}),this['set']('isEmpty',!0x0),this['set']('isUploadInProgress',!0x1),this['_addContextButtonView']=_0x21a5de,this['_queryViewResizeObserver']=null,this['queryView']['fieldView']['minRows']=ps['MIN_ROWS'],this['queryView']['fieldView']['maxRows']=ps['MAX_ROWS'],this['queryView']['fieldWrapperChildren']['add'](this['_addContextButtonView']),this['_setUpAddContextButtonPositioning'](),this['extendTemplate']({'attributes':{'class':['ck','ck-ai-chat__prompt-input']}}),this['submitButtonView']=this['_createSubmitButton'](),this['submitButtonView']['bind']('isEnabled')['to'](this,'isEmpty',this,'isUploadInProgress',(_0x36fc97,_0x242059)=>!_0x36fc97&&!_0x242059),this['focusableChildren']['add'](this['submitButtonView']);}['render'](){super['render'](),this['queryView']['fieldWrapperChildren']['add'](this['submitButtonView']),this['keystrokes']['set']('enter',(_0x1d6aa1,_0xc835b0)=>{this['isUploadInProgress']||this['isEmpty']||_0x1d6aa1['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0xc835b0());}),this['queryView']['fieldView']['on']('update',()=>{this['isEmpty']=''===this['queryView']['fieldView']['element']['value']?.['trim']();});}['destroy'](){super['destroy'](),this['_queryViewResizeObserver']&&this['_queryViewResizeObserver']['destroy']();}['submit'](){const _0xf472dd=this['queryView']['fieldView']['element']['value']?.['trim']();if(!_0xf472dd)return this['queryView']['errorText']=i(this['locale'],'AI_CHAT_PROMPT_EMPTY_ERROR'),void(this['queryView']['fieldView']['hasError']=!0x0);this['queryView']['fieldView']['hasError']=!0x1;const _0x42d226=_0x469020(_0xf472dd);this['fire']('sendUserMessage',_0x42d226),this['queryView']['fieldView']['reset']();}['setPlaceholderText'](_0x58d58c){this['queryView']['fieldView']['set']('placeholder',_0x58d58c);}['_createSubmitButton'](){const _0x1a869b=new _0xcbb426(this['locale']);return _0x1a869b['set']({'icon':_0x2913f7,'label':i(this['locale'],'AI_CHAT_LABEL_SUBMIT'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-chat__prompt-submit-button','isEnabled':!0x1}),_0x1a869b['on']('execute',()=>{this['submit']();}),_0x1a869b;}['setIsUploadInProgress'](_0x5214ab){this['isUploadInProgress']=_0x5214ab;}['_setUpAddContextButtonPositioning'](){const _0x21be18=this['locale'],_0x3d9e5f=()=>{lt['window']['requestAnimationFrame'](()=>{if(_0x13140d(this['element'])){const _0x2c0e9d=new ct(this['queryView']['fieldView']['element']),_0x402d60=new ct(this['_addContextButtonView']['element']),_0x28452d=_0x2c0e9d['width'],_0x5b0fe2='rtl'===_0x21be18['uiLanguageDirection']?'right':'left';_0x2c0e9d['excludeScrollbarsAndBorders']();const _0x2aae0=_0x28452d-_0x2c0e9d['width']+0x1;this['_addContextButtonView']['element']['style'][_0x5b0fe2]='calc('+(_0x28452d-_0x402d60['width']-_0x2aae0)+'px\x20-\x20var(--ck-spacing-tiny))';}});};this['queryView']['fieldView']['on']('update',_0x3d9e5f),this['on']('render',()=>{_0x3d9e5f(),this['_queryViewResizeObserver']=new _0x123cdf(this['queryView']['fieldView']['element'],()=>{_0x3d9e5f();});});}}const ga='ck-ai-chat__prompt-capabilities',ma='ck-ai-chat-controls-button',pa='ck-ai-chat-controls-button--commands',Ea='ck-ai-chat-controls__model-selection',Ta='ck-ai-chat-controls__model-selection__item-name',Ca='ck-ai-chat-controls__model-selection__item-description',wa='ck-ai-chat-controls__model-selection__item-capabilities',fa='n';class ms extends _0x43effc{['_webSearchButton'];['_reasoningButton'];['_commandsButton'];['_modelSelectionDropdown'];['_modelSelectionDropdownItems'];['_modelNameView'];constructor(_0x5c089b){super(_0x5c089b),this['set']('webSearchActive',!0x1),this['set']('reasoningActive',!0x1),this['set']('modelSelectorVisible',!0x0),this['set']('modelSelectorEnabled',!0x0),this['set']('activeModelId',null),this['set']('activeModelName',null),this['_modelSelectionDropdown']=this['_createModelSelectionDropdown'](),this['_modelNameView']=this['_createModelNameView'](),this['_webSearchButton']=this['_createWebSearchButton'](),this['_reasoningButton']=this['_createReasoningButton'](),this['_commandsButton']=this['_createCommandsButton'](),this['_modelSelectionDropdown']['buttonView']['bind']('isVisible')['to'](this,'modelSelectorVisible',_0x37b02c=>_0x37b02c),this['_modelSelectionDropdown']['buttonView']['bind']('tooltip')['to'](this,'modelSelectorEnabled',_0x48be37=>_0x48be37?this['_modelSelectionDropdown']['buttonView']['label']:i(this['locale'],'AI_CHAT_MODEL_SELECTOR_DISABLED_TOOLTIP')),this['_modelSelectionDropdown']['bind']('isEnabled')['to'](this,'modelSelectorEnabled',_0x2a3009=>_0x2a3009),this['_webSearchButton']['bind']('isOn')['to'](this,'webSearchActive',_0x2c1ad5=>_0x2c1ad5),this['_webSearchButton']['bind']('withText')['to'](this,'modelSelectorVisible',_0x18254a=>!_0x18254a),this['_webSearchButton']['bind']('tooltip')['to'](this,'webSearchActive',_0x503bb5=>i(this['locale'],_0x503bb5?'AI_CHAT_DISABLE_WEB_SEARCH':'AI_CHAT_ENABLE_WEB_SEARCH')),this['_reasoningButton']['bind']('isOn')['to'](this,'reasoningActive',_0x3399a7=>_0x3399a7),this['_reasoningButton']['bind']('withText')['to'](this,'modelSelectorVisible',_0x2e699f=>!_0x2e699f),this['_reasoningButton']['bind']('tooltip')['to'](this,'reasoningActive',_0x1f3127=>i(this['locale'],_0x1f3127?'AI_CHAT_DISABLE_REASONING':'AI_CHAT_ENABLE_REASONING')),this['setTemplate']({'tag':'div','attributes':{'class':[ga]},'children':[this['_modelSelectionDropdown'],this['_modelNameView'],this['_webSearchButton'],this['_reasoningButton'],this['_commandsButton']]}),this['_modelSelectionDropdownItems']=new _0x5137f7(),_0x44b9be(this['_modelSelectionDropdown'],this['_modelSelectionDropdownItems']);}['setModelList'](_0x45f222,_0x291895){if(this['set']('modelSelectorVisible',!(_0x291895&&_0x45f222['length']<=0x1)),this['_modelSelectionDropdownItems']['clear'](),_0x45f222?.['length'])for(const _0x28402a of _0x45f222){const _0x1d571e=new _0x3344bf({'label':_0x28402a['name'],'withText':!0x0,'role':'menuitemradio','id':_0x28402a['id'],'model':_0x28402a});_0x1d571e['bind']('isOn')['to'](this,'activeModelId',_0x3745b5=>_0x3745b5===_0x28402a['id']),this['_modelSelectionDropdownItems']['add']({'type':'button','model':_0x1d571e,'labelView':new ba(this['locale'],_0x28402a)});}}['setWebSearch'](_0x42e876){this['set']('webSearchActive',_0x42e876);}['setReasoning'](_0x1e2937){this['set']('reasoningActive',_0x1e2937);}['setModel'](_0x26bec){if(!_0x26bec)return;this['activeModelId']=_0x26bec['id'],this['activeModelName']=_0x26bec['name']||_0x26bec['id'],this['_modelSelectionDropdown']['buttonView']['set']('label',_0x26bec['name']),this['_modelSelectionDropdown']['buttonView']['set']('tooltip',_0x26bec['name']);const _0x331bfc=_0x26bec['capabilities']['webSearch']?.['enabled']??!0x1;this['set']('webSearchActive',!0x1),this['_webSearchButton']['set']('isOn',!0x1),this['_webSearchButton']['set']('isEnabled',_0x331bfc),this['_webSearchButton']['set']('isVisible',_0x331bfc);const _0x34fb31=_0x26bec['capabilities']['reasoning']?.['enabled']??!0x1;this['set']('reasoningActive',!0x1),this['_reasoningButton']['set']('isOn',!0x1),this['_reasoningButton']['set']('isEnabled',_0x34fb31),this['_reasoningButton']['set']('isVisible',_0x34fb31);}['enableModelSelector'](){this['set']('modelSelectorEnabled',!0x0),this['set']('modelSelectorVisible',!0x0);}['disableModelSelector'](_0x5978dc){this['set']('modelSelectorEnabled',!0x1),_0x5978dc&&this['set']('modelSelectorVisible',!0x1);}['_createWebSearchButton'](){const _0x245b21=new _0xcbb426();return _0x245b21['set']({'label':i(this['locale'],'AI_CHAT_SEARCH_WEB'),'icon':_0x46b22c,'class':ma,'isToggleable':!0x0,'tooltipPosition':fa}),_0x245b21['on']('execute',()=>{this['fire']('toggleWebSearch');}),_0x245b21;}['_createReasoningButton'](){const _0x4caf51=new _0xcbb426();return _0x4caf51['set']({'label':i(this['locale'],'AI_CHAT_REASONING'),'icon':_0x279253,'class':ma,'isToggleable':!0x0,'tooltipPosition':fa}),_0x4caf51['on']('execute',()=>{this['fire']('toggleReasoning');}),_0x4caf51;}['_createCommandsButton'](){const _0x5801d3=new _0xcbb426();return _0x5801d3['set']({'label':i(this['locale'],'AI_CHAT_COMMANDS'),'icon':Nt,'withText':!0x0,'class':ma,'isToggleable':!0x0,'tooltip':i(this['locale'],'AI_CHAT_COMMANDS'),'tooltipPosition':fa}),_0x5801d3['extendTemplate']({'attributes':{'class':[pa]}}),_0x5801d3['on']('execute',()=>{console['log']('Commands\x20are\x20not\x20implemented\x20yet.'),alert('Commands\x20are\x20not\x20implemented\x20yet.');}),_0x5801d3;}['_createModelSelectionDropdown'](){const _0x38c090=_0x2e287a(this['locale']);return _0x38c090['set']({'panelPosition':'ne','class':[Ea]}),_0x38c090['buttonView']['set']({'label':i(this['locale'],'AI_CHAT_MODEL_SELECTOR_ENABLED_TOOLTIP'),'withText':!0x0,'tooltip':!0x0,'tooltipPosition':fa}),this['listenTo'](_0x38c090,'execute',_0x347203=>{this['fire']('selectModel',_0x347203['source']['model']);}),_0x38c090;}['_createModelNameView'](){const _0x3609c2=new Jo(this['locale']);return _0x3609c2['bind']('text')['to'](this,'activeModelName',_0x16c9f3=>_0x16c9f3??''),_0x3609c2['bind']('isVisible')['to'](this,'modelSelectorVisible',this,'activeModelName',(_0x42dd8f,_0x22f886)=>!_0x42dd8f&&!_0x22f886?.['toLowerCase']()['startsWith']('agent')),_0x3609c2;}}let ba=class extends _0x43f368{constructor(_0x53e0bb,_0x1d0ea1){super();const _0x373f1b=this['bindTemplate'],_0x4cc98a=this['createCollection']();this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-button__label'],'style':_0x373f1b['to']('style'),'id':_0x373f1b['to']('id')},'children':[{'tag':'div','attributes':{'class':[Ta]},'children':[{'text':_0x373f1b['to']('text')}]},{'tag':'div','attributes':{'class':[Ca]},'children':[{'tag':'span','children':[{'text':_0x1d0ea1['description']}]}]},{'tag':'div','attributes':{'class':[wa]},'children':_0x4cc98a}]}),_0x4cc98a['addMany'](this['_getCapabilityParts'](_0x53e0bb,_0x46b22c,'AI_CHAT_SEARCH_WEB',_0x1d0ea1['capabilities']['webSearch']?.['enabled']??!0x1)),_0x4cc98a['addMany'](this['_getCapabilityParts'](_0x53e0bb,_0x279253,'AI_CHAT_REASONING',_0x1d0ea1['capabilities']['reasoning']?.['enabled']??!0x1));}['_getCapabilityParts'](_0x417382,_0x22a10f,_0x1f6f20,_0x5a080e){const _0x39fe5c=new _0x4caa0b();_0x39fe5c['content']=_0x22a10f;const _0x56ba0a=new _0x43effc(_0x417382);_0x56ba0a['setTemplate']({'tag':'span','children':[{'text':i(_0x417382,_0x1f6f20)+':\x20'}]});const _0x2bda63=new _0x43effc(_0x417382);return _0x2bda63['setTemplate']({'tag':'span','children':[{'text':i(_0x417382,_0x5a080e?'AI_CHAT_CAPABILITIES_YES':'AI_CHAT_CAPABILITIES_NO')}]}),[_0x39fe5c,_0x56ba0a,_0x2bda63];}};class Jo extends _0x43effc{constructor(_0x4df94c){super(_0x4df94c),this['set']('text',void 0x0),this['set']('isVisible',!0x0);const _0x49dbb3=this['bindTemplate'];this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-chat-controls__model-name',_0x49dbb3['if']('isVisible','ck-hidden',_0x510b75=>!_0x510b75)]},'children':[{'text':_0x49dbb3['to']('text')}]});}}const Sa='ck-ai-chat-context-controls__url-form',Oa='ck-ai-chat-context-controls__url-input-section';class bo extends _0x43effc{['focusTracker'];['keystrokes'];['_focusables'];['focusCycler'];['urlInputField'];['backButton'];['confirmButton'];constructor(_0x599c8c){super(_0x599c8c),this['focusTracker']=new _0x25d272(),this['keystrokes']=new _0xfe6d51(),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 _0x4b849d({'focusables':this['_focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes'],'actions':{'focusPrevious':'shift+tab','focusNext':'tab'}}),this['_setupTemplate'](),this['_setupEventHandlers'](),this['_setupKeystrokes']();}['render'](){super['render'](),this['_focusables']['forEach'](_0x39f20c=>{this['focusTracker']['add'](_0x39f20c['element']),this['keystrokes']['listenTo'](_0x39f20c['element']);}),_0x27e72b({'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'](_0x1d31fc){this['urlInputField']['errorText']=_0x1d31fc,this['_updateConfirmButtonState'](),this['fire']('refreshBalloon');}['clearError'](){this['urlInputField']['errorText']=null,this['_updateConfirmButtonState']();}['_createBackButton'](){const _0x276cdb=new _0xcbb426(this['locale']);return _0x276cdb['set']({'icon':_0x1420c7,'tooltip':i(this['locale'],'AI_CHAT_CONTEXT_URL_BACK_TO_CONTEXT'),'tooltipPosition':'n','class':'ck-button-icon\x20ck-button-back'}),_0x276cdb;}['_createUrlInputField'](){const _0x47bea7=new _0x454e15(this['locale'],_0x42b133);return _0x47bea7['set']({'label':i(this['locale'],'AI_CHAT_CONTEXT_URL_LABEL'),'class':'ck-labeled-field-view_empty'}),_0x47bea7['fieldView']['set']({'placeholder':i(this['locale'],'AI_CHAT_CONTEXT_URL_PLACEHOLDER')}),_0x47bea7;}['_createConfirmButton'](){const _0x4e5740=new _0xcbb426(this['locale']);return _0x4e5740['set']({'icon':_0x16fc5d,'tooltip':i(this['locale'],'AI_CHAT_CONTEXT_URL_ADD_URL'),'tooltipPosition':'n','class':'ck-button-icon','type':'submit','isEnabled':!0x1}),_0x4e5740;}['_setupTemplate'](){const _0x59c446=new _0xbcda8a(this['locale'],{'label':i(this['locale'],'AI_CHAT_CONTEXT_URL_ADD_URL'),'class':'ck-ai-header\x20ck-ai-header_small\x20ck-ai-header_context-url'});_0x59c446['children']['add'](this['backButton'],0x0),this['setTemplate']({'tag':'form','attributes':{'class':Sa,'tabindex':'-1'},'children':[_0x59c446,{'tag':'div','attributes':{'class':Oa},'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',_0x2fde4c=>{_0x2fde4c['stop'](),this['_handleSubmit']();});}['_setupKeystrokes'](){this['keystrokes']['set']('esc',(_0x2dacd6,_0x570131)=>{this['clear'](),this['fire']('cancel'),_0x570131();});}['_handleSubmit'](){const _0x51d767=this['getValue']()['trim']();_0x51d767?this['_isValidUrl'](_0x51d767)?(this['clearError'](),this['fire']('submitUrl',_0x51d767)):this['setError'](i(this['locale'],'AI_CHAT_CONTEXT_URL_INVALID_ERROR')):this['setError'](i(this['locale'],'AI_CHAT_CONTEXT_URL_EMPTY_ERROR'));}['_updateConfirmButtonState'](){const _0x245567=this['getValue']()['trim'](),_0x1bffab=!!this['urlInputField']['errorText'];this['confirmButton']['isEnabled']=_0x245567['length']>0x0&&!_0x1bffab;}['_isValidUrl'](_0x3c2244){try{return!!new URL(_0x3c2244);}catch{return!0x1;}}}const Ra='ck-ai-chat-resources__item',Na='ck-ai-chat-resources__item--in-context',ka='ck-ai-chat-resources__item-title',ya='ck-ai-chat-resources__item__icon';class sc extends _0x3f0116{['resource'];['_titleView'];['_iconView'];constructor(_0x36d578,_0x61fc94){super(_0x36d578),this['resource']=_0x61fc94,this['set']('isInContext',!!_0x61fc94['isInContext']),this['_titleView']=this['_createTitleView'](),this['_iconView']=this['_createIconView'](),this['_setupTemplate']();}['render'](){super['render']();}['getResourceIcon'](_0x52f020){if(_0x52f020['isInContext'])return _0x16fc5d;switch(_0x52f020['type']){case je['DOCUMENT']:return _0x584f93;case je['URL']:return _0x3ed6af;case je['FILE']:case je['TEXT']:return _0x18ec8e;default:return _0x1c2f3f;}}['highlightText'](_0x3928bb){if(!_0x3928bb||''===_0x3928bb['trim']())return void this['_titleView']['highlightText'](null);const _0x1d6b15=new RegExp(_0x54c692(_0x3928bb),'gi');this['_titleView']['highlightText'](_0x1d6b15);}['updateResourceState'](_0x2b5ef0){this['resource']['isInContext']=_0x2b5ef0,this['isInContext']=_0x2b5ef0,this['_updateIcon']();}['_createTitleView'](){const _0x2fa17b=new _0x407d13();return _0x2fa17b['text']=this['resource']['label'],_0x2fa17b['extendTemplate']({'tag':'span','attributes':{'class':[ka]}}),_0x2fa17b;}['_createIconView'](){const _0x14b982=new _0x4caa0b();return _0x14b982['content']=this['getResourceIcon'](this['resource']),_0x14b982;}['_setupTemplate'](){const _0x4d5886=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':[Ra,_0x4d5886['if']('isVisible','ck-hidden',_0x12a43a=>!_0x12a43a),_0x4d5886['if']('isInContext',Na)]},'children':[{'tag':'div','attributes':{'class':[ya]},'children':[this['_iconView']]},this['_titleView']],'on':{'click':_0x4d5886['to']('execute')}});}['_updateIcon'](){this['_iconView']['content']=this['getResourceIcon'](this['resource']);}}const va='ck-ai-chat-resources__list';class qr extends _0x5bd1ba{['_source'];constructor(_0x216c77,_0x126dbd){super(_0x216c77),this['_source']=_0x126dbd,this['extendTemplate']({'attributes':{'class':[va]}});}['setResources'](_0x432ff8,_0xbe6930){this['items']['clear']();let _0x5ddc8a=_0x432ff8;if(this['_source']['useDefaultFiltering']&&_0xbe6930&&''!==_0xbe6930['trim']()){const _0x195bb8=new RegExp(_0xbe6930['replace'](/[.*+?^${}()|[\]\\]/g,'\x5c$&'),'gi');_0x5ddc8a=_0x432ff8['filter'](_0x12bd17=>_0x195bb8['test'](_0x12bd17['label']));}for(const _0x472ce6 of _0x5ddc8a){const _0x48c002=new sc(this['locale'],_0x472ce6);_0x48c002['on']('execute',()=>{this['_handleResourceSelection'](this['_source'],_0x472ce6);}),this['items']['add'](_0x48c002);}this['_source']['useDefaultFiltering']&&this['highlightText'](_0xbe6930);}['highlightText'](_0x2417d5){this['_source']['useDefaultFiltering']&&this['items']['forEach'](_0x4ff711=>{_0x4ff711['highlightText'](_0x2417d5);});}['updateResourceState'](_0x5f4185,_0x298bc7){for(const _0xa064f9 of this['items']){const _0x2e52f1=_0xa064f9;_0x2e52f1['resource']['id']===_0x5f4185&&_0x2e52f1['updateResourceState'](_0x298bc7);}}['_handleResourceSelection'](_0x107864,_0x2b9c1a){this['fire']('addResourceToContext',{'source':_0x107864,'resource':_0x2b9c1a});}}class Ur extends _0x454e15{['iconView'];['resetButtonView'];['_viewConfig'];constructor(_0x307556){const t=_0x307556['t'],_0x5093ca={'showResetButton':!0x0,'showIcon':!0x0,'creator':_0x42b133,'label':i(_0x307556,'AI_CHAT_SEARCH_RESOURCES')};super(_0x307556,_0x5093ca['creator']),this['label']=_0x5093ca['label'],this['_viewConfig']=_0x5093ca,this['_viewConfig']['showIcon']&&this['_setupSearchIcon'](),this['_viewConfig']['showResetButton']&&this['_setupResetButton'](_0x307556,t),this['_setupEventListeners']();}['reset'](){this['fieldView']['reset'](),this['_viewConfig']['showResetButton']&&this['resetButtonView']&&(this['resetButtonView']['isVisible']=!0x1),this['search']('');}['search'](_0x5e59a3){this['fire']('search',_0x5e59a3);}['getQuery'](){return this['fieldView']['element']?.['value']||'';}['_setupSearchIcon'](){this['iconView']=new _0x4caa0b(),this['iconView']['content']=_0x4f50f5,this['fieldWrapperChildren']['add'](this['iconView'],0x0),this['extendTemplate']({'attributes':{'class':'ck-search__query_with-icon'}});}['_setupResetButton'](_0x4a799b,t){this['resetButtonView']=new _0xcbb426(_0x4a799b),this['resetButtonView']['set']({'label':t('Clear'),'icon':_0x3a96a0,'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',_0x27a5f0=>!_0x27a5f0),this['fieldWrapperChildren']['add'](this['resetButtonView']),this['extendTemplate']({'attributes':{'class':'ck-search__query_with-reset'}});}['_setupEventListeners'](){this['listenTo'](this['fieldView'],'input',()=>{this['search'](this['fieldView']['element']['value']);}),this['bind']('isEnabled')['to'](this);}}class Or extends _0x43effc{['_searchView'];['_searchSection'];['_searchInputVisibleFrom'];['_resourcesListView'];['_skeletonLoader'];['_source'];['children'];['_latestLoadResourcesUid']=null;constructor(_0x40846b,_0x2eae33){super(_0x40846b),this['_source']=_0x2eae33['source'],this['_searchInputVisibleFrom']=_0x2eae33['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 _0x317ee8([this['_skeletonLoader'],this['_resourcesListView']]),this['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-chat-resources'},'children':this['children']});}['_createSearchView'](){return new Ur(this['locale']);}['_createSearchSection'](){const _0x310929=new _0x43effc(this['locale']);return _0x310929['setTemplate']({'tag':'div','attributes':{'class':'ck\x20ck-search'},'children':[this['_searchView']]}),this['_searchView']['on']('search',(_0xfd3668,_0x106ab4)=>{this['loadResources'](_0x106ab4),this['_source']['useDefaultFiltering']&&this['_resourcesListView']['highlightText'](_0x106ab4);}),_0x310929;}['_createResourcesListView'](){const _0x270bc9=new qr(this['locale'],this['_source']);return _0x270bc9['delegate']('addResourceToContext')['to'](this),_0x270bc9['extendTemplate']({'attributes':{'class':this['bindTemplate']['if']('isLoading','ck-hidden')}}),_0x270bc9;}['_createSkeletonView'](){const _0x67ca44=new Pe(this['locale'],Be['aiChatResources']);return _0x67ca44['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isLoading','ck-hidden',_0x4f364d=>!_0x4f364d)]}}),_0x67ca44;}['render'](){super['render'](),this['loadResources']('');}['loadResources'](_0x264911){const _0x4d0427=_0xdc126c();this['_latestLoadResourcesUid']=_0x4d0427,this['fire']('loadSourceResources',{'sourceId':this['_source']['id'],'query':_0x264911,'uid':_0x4d0427}),this['isLoading']=!0x0;}['setResources'](_0x1dce85,_0x4505c3){if(_0x4505c3&&_0x4505c3!==this['_latestLoadResourcesUid'])return;const _0x58ceb4=this['_source']['useDefaultFiltering']?this['_searchView']['getQuery']():'';this['_resourcesListView']['setResources'](_0x1dce85,_0x58ceb4),_0x1dce85['length']>=this['_searchInputVisibleFrom']&&!this['children']['has'](this['_searchSection'])&&this['children']['add'](this['_searchSection'],0x0),requestAnimationFrame(()=>{this['isLoading']=!0x1;});}['updateResourceState'](_0x1fab8d,_0x568f5f){this['_resourcesListView']['updateResourceState'](_0x1fab8d,_0x568f5f);}}const xa='ck-ai-chat-context-controls__source-balloon-panel',La='ck-button-icon\x20ck-button-back',Ha='ck-ai-header\x20ck-ai-header_small\x20ck-ai-header_source';class Ao{['_sourceResourceBalloons']=new Map();['_bodyCollection'];['_locale'];['_config'];constructor(_0x5ade79,_0x253a13,_0xe1977d){this['_locale']=_0x5ade79,this['_bodyCollection']=_0x253a13,this['_config']=_0xe1977d;}['showSourceResourcesBalloon'](_0x37159a){let _0x2af5ec=this['_sourceResourceBalloons']['get'](_0x37159a['id']);_0x2af5ec||(_0x2af5ec=this['_createSourceResourceBalloonPanel'](),this['_sourceResourceBalloons']['set'](_0x37159a['id'],_0x2af5ec),this['_setupSingleResourceBalloonClickOutsideHandler'](_0x2af5ec)),this['_addSourceResourceContent'](_0x2af5ec,_0x37159a),_0x2af5ec['show']();const _0x2106d6=this['_config']['getTargetElement']();_0x2106d6&&_0x2af5ec['pin']({'target':_0x2106d6,'limiter':this['_config']['getLimiterElement']()});}['populateSourceResourceBalloon'](_0x1a0129,_0x3e412c,_0x5ef9e3){const _0x55e316=this['_sourceResourceBalloons']['get'](_0x1a0129);if(!_0x55e316)return;const _0x5f5108=this['_getResourcesViewFromBalloon'](_0x55e316);_0x5f5108&&(_0x5f5108['setResources'](_0x3e412c,_0x5ef9e3),_0x5f5108['once']('change:isLoading',()=>{_0x55e316['pin']({'target':this['_config']['getTargetElement'](),'limiter':this['_config']['getLimiterElement']()});}));}['closeSourceResourceBalloon'](_0x29ceba){const _0x107cdb=this['_sourceResourceBalloons']['get'](_0x29ceba);_0x107cdb&&requestAnimationFrame(()=>{_0x107cdb['hide'](),this['_sourceResourceBalloons']['delete'](_0x29ceba),this['_config']['onBalloonClosed']();});}['isAnyResourceBalloonVisible'](){for(const _0x4d7605 of this['_sourceResourceBalloons']['values']())if(_0x4d7605['isVisible'])return!0x0;return!0x1;}['updateResourceState'](_0x1b3b53,_0x2dff56,_0x35c22d){const _0x593112=this['_sourceResourceBalloons']['get'](_0x1b3b53);if(!_0x593112||!_0x593112['isVisible'])return;const _0x2a19fb=this['_config']['getTargetElement']();if(!_0x2a19fb)return;_0x593112['pin']({'target':_0x2a19fb,'limiter':this['_config']['getLimiterElement']()});const _0x32f5ae=this['_getResourcesViewFromBalloon'](_0x593112);_0x32f5ae&&_0x32f5ae['updateResourceState'](_0x2dff56,_0x35c22d);}['destroy'](){for(const _0x387a3a of this['_sourceResourceBalloons']['values']())_0x387a3a['destroy']();this['_sourceResourceBalloons']['clear']();}['_createSourceResourceBalloonPanel'](){const _0x1c165d=new _0x2ae23a(this['_locale']);return _0x1c165d['extendTemplate']({'attributes':{'class':xa}}),this['_bodyCollection']['add'](_0x1c165d),_0x1c165d;}['_addSourceResourceContent'](_0x20aa82,_0x361095){_0x20aa82['content']['clear']();const _0x1db7cb=this['_createBalloonHeader'](_0x20aa82,_0x361095);_0x20aa82['content']['add'](_0x1db7cb);const _0x979e80=this['_createBalloonResourcesView'](_0x361095);_0x20aa82['content']['add'](_0x979e80);}['_createBalloonHeader'](_0x381564,_0x478303){const _0x427e5c=this['_createBackButton'](_0x381564),_0x51b19a=new _0xbcda8a(this['_locale'],{'label':_0x478303['label'],'class':Ha});return _0x51b19a['children']['add'](_0x427e5c,0x0),_0x51b19a;}['_createBackButton'](_0x250cf3){const _0x4414fe=new _0xcbb426(this['_locale']);return _0x4414fe['set']({'icon':_0x1420c7,'tooltip':i(this['_locale'],'AI_CHAT_CONTEXT_URL_BACK_TO_CONTEXT'),'tooltipPosition':'n','class':La}),_0x4414fe['on']('execute',()=>{_0x250cf3['hide'](),this['_config']['onBackToContext']();}),_0x4414fe;}['_createBalloonResourcesView'](_0x4f2aa0){const _0x1849e0=new Or(this['_locale'],{'source':_0x4f2aa0,'searchInputVisibleFrom':this['_config']['searchInputVisibleFrom']});return _0x1849e0['on']('loadSourceResources',(_0x524457,_0x25cbe6)=>{this['_config']['onLoadSourceResources'](_0x25cbe6);}),_0x1849e0['on']('addResourceToContext',(_0x345b24,_0x2e9490)=>{this['_config']['onResourceSelected'](_0x2e9490['source'],_0x2e9490['resource']),this['closeSourceResourceBalloon'](_0x4f2aa0['id']);}),_0x1849e0;}['_getResourcesViewFromBalloon'](_0x2e88df){const _0xa9c05c=_0x2e88df['content']['get'](0x1);return _0xa9c05c instanceof Or?_0xa9c05c:null;}['_setupSingleResourceBalloonClickOutsideHandler'](_0x14ee35){_0x4b855c({'emitter':_0x14ee35,'contextElements':[_0x14ee35['element']],'callback':()=>{_0x14ee35['hide'](),this['_config']['onBalloonClosed']();},'activator':()=>_0x14ee35['isVisible']});}}const gs=['addDocumentToContext','addFileToContext','addUrlToContext','addResourceToContext','removeContextItem','loadSourceResources'],ko='ck-ai-chat-context-controls',Eo='ck-ai-chat-context-controls__pending-contexts',vo='ck-ai-chat-context-controls__add-context-balloon-panel',Vo='ck-ai-chat-context-controls__add-context-button',Io='ck-ai-chat-context-controls__url-balloon-panel',Po='ck-ai-chat-context-controls__balloon-button',Ro='ck-ai-chat-context-controls__balloon-button-source',Uo='ck-ai-chat-controls-button',Lo='ck-ai-chat-context-chips-wrapper-balloon',No='ck-ai-chat-controls_context_show-more-button',Oo='ck-ai-chat-context-controls__show-more-balloon-panel',Mo='ck-ai-chat',Ho=[_0x2ae23a['defaultPositions']['northArrowSouthWest'],_0x2ae23a['defaultPositions']['northArrowSouth'],_0x2ae23a['defaultPositions']['northArrowSouthEast'],_0x2ae23a['defaultPositions']['southArrowNorthWest'],_0x2ae23a['defaultPositions']['southArrowNorth'],_0x2ae23a['defaultPositions']['southArrowNorthEast']];class bs extends _0x43effc{['addContextButtonView'];['_currentContextsChips']=this['createCollection']();['_conversationContextsChips']=this['createCollection']();['_overflowManager'];['_addContextBalloonPanelView'];['_urlBalloonPanelView'];['_urlInputView'];['_resourcesBalloonView'];['_addContextBalloonConfig'];['bodyCollection'];constructor(_0x4ee439,_0x2c62cd){super(_0x4ee439),this['bodyCollection']=_0x2c62cd['bodyCollection'],this['_currentContextsChips']=this['createCollection'](),this['_conversationContextsChips']=this['createCollection'](),this['addContextButtonView']=this['_createAddContextButtonView'](_0x4ee439),this['_addContextBalloonPanelView']=this['_createAddContextBalloonPanelView'](_0x4ee439),this['_urlBalloonPanelView']=this['_createUrlBalloonPanelView'](_0x4ee439),this['_resourcesBalloonView']=this['_createResourcesBalloonView'](_0x4ee439,_0x2c62cd);const _0x59c663={'cssClasses':{'showMoreButton':No,'showMoreBalloon':Oo,'overflowContainer':Lo,'controlsButton':Uo}};this['_overflowManager']=new To(_0x4ee439,this['_currentContextsChips'],_0x59c663,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'](_0xb4df79,_0x37fca7){const _0x20a02c=this['_createContextButton'](_0xb4df79,'current',!0x0,_0x37fca7);this['_addContextToCollection'](_0x20a02c,this['_currentContextsChips']),this['_overflowManager']['reorganizeChips']();}['removeContextItem'](_0x17b9e9){this['_removeContextFromCollection'](_0x17b9e9,this['_currentContextsChips']),this['_removeContextFromCollection'](_0x17b9e9,this['_overflowManager']['overflowChips']),this['_overflowManager']['reorganizeChips']();}['setContextItemLoading'](_0x592c4a,_0x193443){let _0x5f0a5f=this['_currentContextsChips']['find'](_0x48e6c2=>_0x48e6c2['id']===_0x592c4a);_0x5f0a5f||(_0x5f0a5f=this['_overflowManager']['overflowChips']['find'](_0x5c8965=>_0x5c8965['id']===_0x592c4a)),_0x5f0a5f&&(_0x5f0a5f['isLoading']=_0x193443);}['setConversationContext'](_0x3c1df3){this['_conversationContextsChips']['clear']();for(const _0x101245 of _0x3c1df3){const _0x19ea66=this['_createContextButton'](_0x101245,'conversation',!0x1,!0x1);this['_addContextToCollection'](_0x19ea66,this['_conversationContextsChips']);}}['clearCurrentContextItems'](){this['_currentContextsChips']['clear'](),this['_overflowManager']['clear']();}['clearConversationContextItems'](){this['_conversationContextsChips']['clear']();}['updateResourceState'](_0x144a6d,_0x42b5f8,_0x3ba428){this['_resourcesBalloonView']['updateResourceState'](_0x144a6d,_0x42b5f8,_0x3ba428);}['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'](_0x3981fe){this['_resourcesBalloonView']['showSourceResourcesBalloon'](_0x3981fe),this['addContextButtonView']['isOn']=!0x0;}['populateSourceResourceBalloon'](_0x2f3f61,_0x24e649,_0x5848c3,_0x1d8772){this['_resourcesBalloonView']['populateSourceResourceBalloon'](_0x2f3f61,_0x5848c3,_0x1d8772);}['closeSourceResourceBalloon'](_0x226edd){this['_resourcesBalloonView']['closeSourceResourceBalloon'](_0x226edd),this['addContextButtonView']['isOn']=!0x1;}['setAddContextOptions'](_0x278e26){this['_setBalloonPanelContent'](this['_addContextBalloonPanelView'],this['locale'],_0x278e26),this['_setAddContextButtonEnabled'](_0x278e26);}['_setAddContextButtonEnabled'](_0x3bb80a){const _0x2bb0c3=!_0x3bb80a['document']['isHidden']&&_0x3bb80a['document']['enabled'],_0x400400=_0x3bb80a['urls']['enabled'],_0x52737a=_0x3bb80a['files']['enabled'];this['addContextButtonView']['isEnabled']=_0x2bb0c3||_0x400400||_0x52737a;}['_setupTemplate'](){this['setTemplate']({'tag':'div','attributes':{'class':[ko,'ck-reset_all-excluded']},'children':[{'tag':'div','attributes':{'class':Eo},'children':this['_currentContextsChips']}]});}['_bindEventHandlers'](){this['addContextButtonView']['on']('execute',()=>{this['_handleAddContextButtonClick']();});}['_createAddContextButtonView'](_0x4a2420){const _0xa82c4b=new _0xcbb426(_0x4a2420);return _0xa82c4b['set']({'label':i(_0x4a2420,'AI_CHAT_CONTEXT_ADD_CONTEXT'),'class':Uo+'\x20'+Vo,'icon':_0x40e1b5,'isToggleable':!0x0,'tooltip':!0x0,'tooltipPosition':'sw'}),_0xa82c4b;}['_createAddContextBalloonPanelView'](_0x97d24b){return this['_createBaseBalloonPanel'](_0x97d24b,vo);}['_createUrlBalloonPanelView'](_0x3b4891){const _0x32d275=this['_createBaseBalloonPanel'](_0x3b4891,Io);return this['_addUrlContent'](_0x32d275,_0x3b4891),_0x32d275;}['_createResourcesBalloonView'](_0x6408eb,_0x294dfe){const _0x45b042={'searchInputVisibleFrom':_0x294dfe['searchInputVisibleFrom'],'onBackToContext':()=>{this['showAddContextBalloonPanel'](),this['_addContextBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':Ho});},'onResourceSelected':(_0x2e6d13,_0x493f74)=>{this['fire']('addResourceToContext',{'source':_0x2e6d13,'resource':_0x493f74});},'onLoadSourceResources':_0x29dec6=>{this['fire']('loadSourceResources',_0x29dec6);},'onBalloonClosed':()=>{this['addContextButtonView']['isOn']=!0x1;},'getLimiterElement':()=>this['_getLimiterElement'](),'getTargetElement':()=>this['addContextButtonView']['element']};return new Ao(_0x6408eb,_0x294dfe['bodyCollection'],_0x45b042);}['_getLimiterElement'](){return this['element']?.['closest']('.'+Mo)||document['body'];}['_createBaseBalloonPanel'](_0x4dbd72,_0x2ccffa){const _0x158f52=new _0x2ae23a(_0x4dbd72);return _0x158f52['extendTemplate']({'attributes':{'class':_0x2ccffa}}),this['bodyCollection']['add'](_0x158f52),_0x158f52;}['_setBalloonPanelContent'](_0x1fcba8,_0x107568,_0x5c28f8){if(_0x1fcba8['content']['clear'](),!_0x5c28f8['document']['isHidden']&&_0x5c28f8['document']['enabled']){const _0x4609a0=this['_createBalloonButton'](_0x107568,{'label':i(_0x107568,'AI_CHAT_CONTEXT_CURRENT_DOCUMENT'),'icon':_0x584f93});_0x4609a0['on']('execute',()=>{this['fire']('addDocumentToContext'),this['hideAddContextBalloonPanel']();}),_0x1fcba8['content']['add'](_0x4609a0);}if(_0x5c28f8['urls']['enabled']){const _0x10e32e=this['_createBalloonButton'](_0x107568,{'label':i(_0x107568,'AI_CHAT_CONTEXT_URL_LABEL'),'icon':_0x3ed6af});_0x10e32e['on']('execute',()=>{this['hideAddContextBalloonPanel'](),this['showUrlBalloonPanel'](),this['_urlBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':Ho}),this['_urlInputView']['focus']();}),_0x1fcba8['content']['add'](_0x10e32e);}if(_0x5c28f8['files']['enabled']){const _0x3a0658=new _0x486231(_0x107568);_0x3a0658['set']({'label':i(_0x107568,'AI_CHAT_CONTEXT_FILE_LABEL'),'icon':_0x26357d,'withText':!0x0,'tooltip':!0x0,'class':Po,'allowMultipleFiles':!0x0}),_0x3a0658['on']('done',(_0x4c6386,_0x2508bc)=>{this['fire']('addFileToContext',_0x2508bc),this['hideAddContextBalloonPanel']();}),_0x3a0658['tooltip']=!0x0,_0x1fcba8['content']['add'](_0x3a0658);}for(const _0x9785cc of _0x5c28f8['sources']){const _0xdfe6e=this['_createBalloonButton'](_0x107568,{'label':_0x9785cc['label'],'icon':_0x9785cc['icon']||_0x1c2f3f,'type':'source'});_0x1fcba8['content']['add'](_0xdfe6e),_0xdfe6e['on']('execute',()=>{this['hideAddContextBalloonPanel'](),this['_showSourceResourcesBalloon'](_0x9785cc);});}}['_addUrlContent'](_0x1111c3,_0xc4c4d){this['_urlInputView']=new bo(_0xc4c4d),this['_urlInputView']['on']('submitUrl',(_0x507905,_0x12113c)=>{this['_handleUrlSubmit'](_0x12113c);}),this['_urlInputView']['on']('cancel',()=>{this['hideUrlBalloonPanel'](),this['showAddContextBalloonPanel'](),this['_addContextBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':Ho});}),this['_urlInputView']['on']('refreshBalloon',()=>{this['_urlBalloonPanelView']['isVisible']&&this['_urlBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':Ho});}),_0x1111c3['content']['add'](this['_urlInputView']);}['_createBalloonButton'](_0x43ab5c,_0x14dfc4){const _0x1615fc='source'===_0x14dfc4['type']?new Pa(_0x43ab5c):new _0xcbb426(_0x43ab5c);return _0x1615fc['set']({'label':_0x14dfc4['label'],'icon':_0x14dfc4['icon'],'withText':!0x0,'tooltip':!0x0,'tooltipPosition':'sw','class':Po}),_0x1615fc;}['_setupAllBalloonClickOutsideHandlers'](){this['_setupAddContextBalloonClickOutsideHandler'](),this['_setupUrlBalloonClickOutsideHandler']();}['_setupUrlBalloonClickOutsideHandler'](){_0x4b855c({'emitter':this['_urlBalloonPanelView'],'contextElements':[this['_urlBalloonPanelView']['element']],'callback':()=>{this['hideUrlBalloonPanel']();},'activator':()=>this['_urlBalloonPanelView']['isVisible']});}['_toggleAddContextBalloon'](_0x17dc7c){const _0x21396c=this['_addContextBalloonConfig'];_0x21396c['buttonView']['isOn']=_0x17dc7c,_0x17dc7c?_0x21396c['balloonView']['show']():_0x21396c['balloonView']['hide']();}['_setupAddContextBalloonClickOutsideHandler'](){const {balloonView:_0xc10d51,buttonView:_0x2c0199,hideMethod:_0x48c0b9}=this['_addContextBalloonConfig'];_0x4b855c({'emitter':_0xc10d51,'contextElements':[_0xc10d51['element'],_0x2c0199['element']],'callback':()=>{_0x48c0b9();},'activator':()=>_0x2c0199['isOn']&&!this['_urlBalloonPanelView']['isVisible']&&!this['_resourcesBalloonView']['isAnyResourceBalloonVisible']()});}['_createContextButton'](_0x702dce,_0x98299e,_0x344800=!0x1,_0xf77137=!0x1){const _0x487b86='conversation'===_0x98299e||!0x0===_0x702dce['isReadOnly'],_0x1e8f45=new Bo(this['locale'],_0x702dce,_0x487b86,_0x344800,_0xf77137);return _0x487b86||_0x1e8f45['on']('removeContextItemChip',()=>{this['fire']('removeContextItem',_0x1e8f45['id']);}),_0x1e8f45;}['_addContextToCollection'](_0x2c5ae6,_0x421bdc){_0x421bdc['add'](_0x2c5ae6,0x0);}['_removeContextFromCollection'](_0x13a45c,_0x570391){const _0x24b3b1=_0x570391['find'](_0x2efe6c=>_0x2efe6c['id']===_0x13a45c);_0x24b3b1&&_0x570391['remove'](_0x24b3b1);}['_handleAddContextButtonClick'](){this['addContextButtonView']['isOn']?this['hideAddContextBalloonPanel']():(this['showAddContextBalloonPanel'](),this['_addContextBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':Ho}));}['_handleUrlSubmit'](_0x15d70e){this['_urlInputView']['clear'](),this['hideUrlBalloonPanel'](),this['fire']('addUrlToContext',_0x15d70e);}}class Pa extends _0xcbb426{['arrowView'];constructor(_0x5daf54){super(_0x5daf54),this['set']({'withText':!0x0,'role':'menuitem'}),this['arrowView']=this['_createArrowView'](),this['extendTemplate']({'attributes':{'class':[Ro]}});}['render'](){super['render'](),this['children']['add'](this['arrowView']);}['_createArrowView'](){const _0x106c73=new _0x4caa0b();return _0x106c73['content']=_0x53f601,_0x106c73['extendTemplate']({'attributes':{'class':Ro+'__arrow'}}),_0x106c73;}}class _s extends _0x43effc{['_cancelButtonView'];['_loaderView'];constructor(_0x30ddb8){super(_0x30ddb8),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 _0x5d063a=new _0xcbb426(this['locale']);return _0x5d063a['set']({'label':i(this['locale'],'AI_CHAT_STOP_GENERATING'),'withText':!0x0,'class':'ck-ai-button-secondary\x20ck-ai-button-stop-generating','icon':_0x171167}),_0x5d063a['on']('execute',()=>{this['fire']('abortPromptStream');}),_0x5d063a;}['_createLoaderView'](){const _0x7225d2=new _0x43effc(this['locale']);return _0x7225d2['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-controls-loader']},'children':[{'tag':'div','attributes':{'class':['ck-ai-chat-controls-loader-icon']},'children':[{'tag':'div','attributes':{'class':['ck-ai-chat-controls-loader-icon-dot']}},{'tag':'div','attributes':{'class':['ck-ai-chat-controls-loader-icon-dot']}},{'tag':'div','attributes':{'class':['ck-ai-chat-controls-loader-icon-dot']}}]},{'text':i(this['locale'],'AI_CHAT_IS_WRITING')}]}),_0x7225d2;}}class ji extends _0x43effc{['_displayedModels']=[];['_contextPanelView'];['_promptInputView'];['_promptCapabilitiesView'];['_loaderView'];['_modelUnavailableMessageView'];['_shouldRestorePromptInputFocus'];constructor(_0x392f7a,_0x38334b){super(_0x392f7a),this['_contextPanelView']=this['_createContextPanelView'](_0x392f7a,{'bodyCollection':_0x38334b['bodyCollection'],'searchInputVisibleFrom':_0x38334b['contextResourcesSearchInputVisibleFrom']}),this['_promptInputView']=this['_createPromptInputView'](_0x392f7a),this['_promptCapabilitiesView']=this['_createPromptCapabilitiesView'](_0x392f7a),this['_loaderView']=this['_createLoaderView'](_0x392f7a),this['_modelUnavailableMessageView']=this['_createModelUnavailableMessageView'](_0x392f7a),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'](...gs)['to'](this),this['set']('isModelAvailable',!0x0),this['set']('isDisabled',!0x1);const _0x19fa7b=this['bindTemplate'];this['setTemplate']({'tag':'form','attributes':{'class':['ck','ck-ai-chat-controls',_0x19fa7b['if']('isDisabled','ck-ai-chat-controls-disabled')]},'children':[{'tag':'div','attributes':{'class':[_0x19fa7b['if']('isLoading','ck-hidden',_0x3b2460=>_0x3b2460||!this['isModelAvailable']),_0x19fa7b['if']('isModelAvailable','ck-hidden',_0x1dd672=>!_0x1dd672||this['isLoading'])]},'children':[this['_contextPanelView'],this['_promptInputView'],this['_promptCapabilitiesView']]},{'tag':'div','attributes':{'class':[_0x19fa7b['if']('isLoading','ck-hidden',_0x55fb8b=>!_0x55fb8b)]},'children':[this['_loaderView']]},{'tag':'div','attributes':{'class':[_0x19fa7b['if']('isModelAvailable','ck-hidden',_0x400b14=>_0x400b14)]},'children':[this['_modelUnavailableMessageView']]}]}),_0x4b855c({'emitter':this['_promptInputView'],'activator':()=>this['isLoading'],'contextElements':()=>[this['element']],'callback':()=>{this['_shouldRestorePromptInputFocus']=!0x1;}}),this['on']('change:isLoading',this['_handlePromptInputFocus'],{'priority':'low'});}['_createContextPanelView'](_0x12e6ad,_0x29e699){return new bs(_0x12e6ad,_0x29e699);}['_createPromptInputView'](_0x4fa7bd){return new ps(_0x4fa7bd,this['_contextPanelView']['addContextButtonView']);}['_createPromptCapabilitiesView'](_0x1aad33){return new ms(_0x1aad33);}['_createLoaderView'](_0x41170b){return new _s(_0x41170b);}['_createModelUnavailableMessageView'](_0x19426a){const _0x2311c3=new ws(_0x19426a);return _0x2311c3['delegate']('startConversation')['to'](this),_0x2311c3;}['_handlePromptInputFocus'](_0x411925,_0x2bab2f,_0x3e77c2){_0x3e77c2?this['_shouldRestorePromptInputFocus']=!0x0:this['_shouldRestorePromptInputFocus']&&this['_promptInputView']['focus']();}['addContextItem'](_0x3ba8ce,_0x50bae2){this['_contextPanelView']['addContextItem'](_0x3ba8ce,_0x50bae2);}['removeContextItem'](_0x1ec102){this['_contextPanelView']['removeContextItem'](_0x1ec102);}['setContextItemLoading'](_0x1c5faa,_0x180c13){this['_contextPanelView']['setContextItemLoading'](_0x1c5faa,_0x180c13);}['setIsUploadInProgress'](_0x42375a){this['_promptInputView']['setIsUploadInProgress'](_0x42375a);}['setConversationContext'](_0x44df66){this['_contextPanelView']['setConversationContext'](_0x44df66);}['clearPendingContextUI'](){this['_contextPanelView']['clearCurrentContextItems']();}['clearConversationContextUI'](){this['_contextPanelView']['clearConversationContextItems']();}['updateResourceState'](_0x5917f4,_0x558908,_0x1920d8){this['_contextPanelView']['updateResourceState'](_0x5917f4,_0x558908,_0x1920d8);}['setWebSearch'](_0x4ff67f){this['_promptCapabilitiesView']['setWebSearch'](_0x4ff67f);}['setReasoning'](_0x450a49){this['_promptCapabilitiesView']['setReasoning'](_0x450a49);}['resetMessageInput'](){this['_promptInputView']['reset']();}['setAddContextOptions'](_0x49b68e){this['_contextPanelView']['setAddContextOptions'](_0x49b68e);}['setInputPlaceholder'](_0x11c600){this['_promptInputView']['setPlaceholderText'](_0x11c600);}['setModelList'](_0x2cecd3,_0x5f5abf){this['_displayedModels']=_0x2cecd3,this['_promptCapabilitiesView']['setModelList'](_0x2cecd3,_0x5f5abf);}['setModel'](_0x2e50fd){(_0x2e50fd?this['_displayedModels']['find'](_0x2bdaab=>_0x2bdaab['id']===_0x2e50fd['id']):null)?(this['isModelAvailable']=!0x0,this['_promptCapabilitiesView']['setModel'](_0x2e50fd)):_0x2e50fd?.['id']['startsWith']('agent')?(this['isModelAvailable']=!0x0,this['_promptCapabilitiesView']['setModel'](this['_displayedModels'][0x0])):this['isModelAvailable']=!0x1;}['enableModelSelector'](){this['_promptCapabilitiesView']['enableModelSelector']();}['disableModelSelector'](_0xda8f2e){this['_promptCapabilitiesView']['disableModelSelector'](_0xda8f2e);}['populateSourceResourceBalloon'](_0x2b812d,_0x2cf7b0,_0x22adfb,_0x3010ec){this['_contextPanelView']['populateSourceResourceBalloon'](_0x2b812d,_0x2cf7b0,_0x22adfb,_0x3010ec);}['closeSourceResourceBalloon'](_0x2fc503){this['_contextPanelView']['closeSourceResourceBalloon'](_0x2fc503);}['focusPromptInput'](){this['_promptInputView']['focus']();}}class ws extends _0x43effc{constructor(_0x588fdc){super(_0x588fdc);const _0x5212b0=new _0xcbb426(_0x588fdc);_0x5212b0['set']({'label':i(this['locale'],'AI_CHAT_MODEL_UNAVAILABLE_MESSAGE_BUTTON'),'withText':!0x0,'class':['ck-ai-chat-controls__start-new-chat-button'],'tooltip':''}),_0x5212b0['delegate']('execute')['to'](this,'startConversation'),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat-controls-model-unavailable-message']},'children':[{'tag':'p','children':[{'text':i(this['locale'],'AI_CHAT_MODEL_UNAVAILABLE_MESSAGE_TEXT')+'\x20'},_0x5212b0]}]});}}class ki extends _0xbcda8a{['conversationStartButton'];['resizeButton'];constructor(_0x770052,_0x4067a2){super(_0x770052,{'label':i(_0x770052,'AI_CHAT_HEADING'),'class':'ck-ai-header\x20ck-ai-header_chat','icon':Ht}),this['set']('isMaximized',!0x1),this['conversationStartButton']=this['_createStartConversationButton'](_0x770052),this['children']['add'](this['conversationStartButton']),_0x4067a2&&(this['resizeButton']=ks(_0x770052,this),this['children']['add'](this['resizeButton']));}['_createStartConversationButton'](_0x2f0ba6){const _0x5696fc=new _0xcbb426(_0x2f0ba6);return _0x5696fc['set']({'label':i(this['locale'],'AI_CHAT_LABEL_NEW_CHAT'),'withText':!0x0,'icon':_0x357a3c,'class':'ck-ai-chat__start-conversation'}),_0x5696fc['on']('execute',()=>{this['fire']('startConversation');}),_0x5696fc;}}class bi extends _0x43effc{constructor(_0x214883){super(_0x214883),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-disclaimer']},'children':[{'tag':'p','attributes':{'class':['ck','ck-ai-disclaimer__content']},'children':[{'text':i(_0x214883,'AI_DISCLAIMER_TEXT')}]}]});}}class bt extends _0x43effc{['chatHeader'];['chatFeed'];['chatControls'];['chatDisclaimer'];['_bodyCollection'];constructor(_0x39b500,_0x38ec8b){super(_0x39b500),this['_bodyCollection']=new _0x44dc72(_0x39b500),this['_bodyCollection']['attachToDom'](),this['chatHeader']=new ki(_0x39b500,_0x38ec8b['showResizeButton']),this['chatHeader']['delegate'](...Mt)['to'](this),this['chatFeed']=new pi(_0x39b500,this['_bodyCollection']),this['chatFeed']['delegate'](...Mt)['to'](this),this['chatControls']=new ji(_0x39b500,{'bodyCollection':this['_bodyCollection'],'contextResourcesSearchInputVisibleFrom':_0x38ec8b['contextResourcesSearchInputVisibleFrom']}),this['chatControls']['delegate'](...Mt)['to'](this),this['chatDisclaimer']=new bi(_0x39b500),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-ai-chat','ck-rounded-corners'],'dir':_0x39b500['uiLanguageDirection']},'children':[this['chatHeader'],this['chatFeed'],this['chatControls'],this['chatDisclaimer']]});}['populateSourceResourceBalloon'](_0x540f2f,_0x2038ab,_0x127888,_0x2e7ab0){this['chatControls']['populateSourceResourceBalloon'](_0x540f2f,_0x2038ab,_0x127888,_0x2e7ab0);}['closeSourceResourceBalloon'](_0xb161c9){this['chatControls']['closeSourceResourceBalloon'](_0xb161c9);}['destroy'](){this['_bodyCollection']['detachFromDom'](),super['destroy']();}}class gt extends ot{static get['requires'](){return[Ct];}['_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(_0x43c3d4){super(_0x43c3d4);const _0x316306=this['context']['plugins']['get']('AITabs');this['set']('isBusy',!0x1),this['_promiseQueue']=new W(),this['_view']=new bt(this['context']['locale'],{'showResizeButton':_0x316306['showResizeButton'],'contextResourcesSearchInputVisibleFrom':this['context']['config']['get']('ai.chat.context.searchInputVisibleFrom')}),this['_view']['delegate'](...Mt)['to'](this),this['_view']['on']('toggleSuggestionDisplayMode',(_0x14da55,{showDiff:_0x5972c1})=>{this['showDiff']=_0x5972c1;}),_0x316306['view']['addTab']({'id':'chat','buttonLabel':i(this['context']['locale'],'AI_CHAT_HEADING'),'buttonIcon':Ht,'order':0x0,'content':this['_view']}),this['_view']['chatControls']['bind']('isLoading')['to'](this,'isBusy',_0x4f7215=>_0x4f7215),this['_view']['chatFeed']['bind']('isPending')['to'](this,'isBusy',_0x93144b=>_0x93144b),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder']()),this['bind']('isModelAvailable')['to'](this['_view']['chatControls'],'isModelAvailable');}['destroy'](){super['destroy'](),this['_titleAnimationInterval']&&clearInterval(this['_titleAnimationInterval']);}['createConversation'](_0x455233){this['_view']['chatFeed']['clear'](),this['_view']['chatControls']['enableModelSelector'](),this['_view']['chatControls']['setModelList'](_0x455233['availableModels'],!this['context']['config']['get']('ai.chat.models.modelSelectorAlwaysVisible')),this['addFeedItemStaticMessage']({'id':'conversation-start','staticMessage':i(this['context']['locale'],'AI_CHAT_WELCOME_MESSAGE')});}['addFeedItemStaticMessage']({id:_0x16f7cb,staticMessage:_0x1a7987}){this['_view']['chatFeed']['addItem']('ai-reply',{'id':_0x16f7cb,'initialContent':'<p>'+_0x1a7987+'</p>'});}['addFeedItemUserMessage'](_0xb189a4){const _0x1bcbc5=_0xb189a4['quickActionData']?.['displayedPrompt']||_0xb189a4['userMessage'];this['_view']['chatFeed']['addItem']('user-message',{'contextItems':Array['from'](_0xb189a4['contextItems']['values']()),'initialContent':'<p>'+_0x1bcbc5+'</p>','id':_0xb189a4['id']});}['addFeedItemError']({errorMessage:_0x930879,id:_0x48e9c7}){this['_view']['chatFeed']['addItem']('error-message',{'initialContent':'<p>'+_0x930879+'</p>','id':_0x48e9c7});}['addFeedItemAIReply'](_0x285c54){return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('ai-reply',{'id':_0x285c54['interactionId']+':'+_0x285c54['id']}),this['setLoadingMessage'](null);});}async['addFeedItemAISuggestion'](_0x4ca9a3){const _0x2a5c7d=ut(this['context']);let _0x166f4f=_0x2a5c7d['config']['get']('ai.availableReplyActions')||[...et];if(_0x2a5c7d['plugins']['has']('TrackChanges')){if(!this['_isTrackChangesCommandValueBound']){this['_isTrackChangesCommandValueBound']=!0x0;const _0x52fdad=_0x2a5c7d['commands']['get']('trackChanges');this['_view']['chatFeed']['bind']('isTrackChangesOn')['to'](_0x52fdad,'value');}}else _0x166f4f=_0x166f4f['filter'](_0x33e48b=>'insertSuggestion'!=_0x33e48b);return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('ai-suggestion-reply',{'id':_0x4ca9a3['interactionId']+':'+_0x4ca9a3['id'],'areActionsDisabled':_0x4ca9a3['areActionsDisabled'],'showDiff':this['showDiff'],'availableActions':_0x166f4f}),this['setLoadingMessage'](null);});}['addFeedInteractionHeader'](_0xc52268,_0x586f32){const _0x12cbeb=this['_view']['chatFeed']['children']['last'];if(_0x12cbeb instanceof Lt)return this['_view']['chatFeed']['children']['remove'](_0x12cbeb),void this['_view']['chatFeed']['addItem']('interaction-header',{'id':_0xc52268['id'],'capabilities':{'isWebSearchEnabled':_0x12cbeb['capabilities']['isWebSearchEnabled']||_0x586f32['isWebSearchEnabled'],'isReasoningEnabled':_0x12cbeb['capabilities']['isReasoningEnabled']||_0x586f32['isReasoningEnabled']}});this['_view']['chatFeed']['addItem']('interaction-header',{'id':_0xc52268['id'],'capabilities':_0x586f32});}['updateFeedInteractionHeader'](_0x249f2b){const _0xa03360=this['_view']['chatFeed']['children']['find'](_0x6bc019=>_0x6bc019['options']['id']==_0x249f2b['id']&&_0x6bc019 instanceof Lt);_0xa03360&&_0xa03360['set']('isVisible',_0x249f2b['isVisible']);}async['updateFeedItemAIReplyContent'](_0x20e2b0){const _0x1921a4=_0x20e2b0['renderingStrategy']||this['feedItemRenderingStrategy'];return this['_promiseQueue']['enqueue'](async _0x165056=>{await this['_view']['chatFeed']['updateReplyItem']({..._0x20e2b0,'abortSignal':_0x165056,'renderingStrategy':_0x1921a4}),_0x20e2b0['isDone']&&this['markFeedItemAsDone'](_0x20e2b0['id']);});}['updateFeedItemAIReplySources'](_0x24eb5e,_0x1945e4){this['_view']['chatFeed']['updateWebSources'](_0x24eb5e,_0x1945e4);}async['updateFeedItemAIReplySuggestionContent'](_0x18fdf9){const _0x123dd2=_0x18fdf9['renderingStrategy']||this['feedItemRenderingStrategy'];return this['_promiseQueue']['enqueue'](async _0x3ad32b=>{await this['_view']['chatFeed']['updateSuggestionItem']({..._0x18fdf9,'abortSignal':_0x3ad32b,'renderingStrategy':_0x123dd2}),_0x18fdf9['isDone']&&this['markFeedItemAsDone'](_0x18fdf9['id']);});}['updateFeedItemAIReplySuggestionPartState'](_0x1ddbc7){this['_view']['chatFeed']['updateSuggestionPartState'](_0x1ddbc7);}['markFeedItemAsDone'](_0xc9699f){this['_view']['chatFeed']['markItemAsDone'](_0xc9699f);}['removeFeedInteraction'](_0xb45d95){this['_view']['chatFeed']['getItemIds']()['filter'](_0x4e49bd=>_0x4e49bd['startsWith'](_0xb45d95))['forEach'](_0x3df760=>this['_view']['chatFeed']['removeItem'](_0x3df760));}['startInteraction'](){this['setLoadingMessage']({'isWebSearchEnabled':!0x1,'isReasoningEnabled':!0x1}),this['_view']['chatControls']['disableModelSelector'](!this['context']['config']['get']('ai.chat.models.modelSelectorAlwaysVisible')),this['isBusy']=!0x0,this['_view']['chatFeed']['startAutoScroll']();}['stopInteraction'](_0x454968){this['_promiseQueue']['abort'](),this['_view']['chatFeed']['getItemIds']()['filter'](_0x5611db=>_0x5611db['startsWith'](_0x454968['id']))['forEach'](_0x2c9661=>this['markFeedItemAsDone'](_0x2c9661)),this['isBusy']=!0x1,this['_view']['chatFeed']['stopAutoScroll']();}async['finishInteraction'](){return this['_promiseQueue']['queueEmptyPromise']['then'](()=>{this['isBusy']=!0x1,this['_view']['chatFeed']['stopAutoScroll']();});}['addContextItem'](_0x5b8b37,_0x5422ab){this['_view']['chatControls']['addContextItem'](_0x5b8b37,_0x5422ab);}['removeContextItem'](_0xc9d999){this['_view']['chatControls']['removeContextItem'](_0xc9d999);}['setContextItemLoading'](_0x2834ae,_0x21a9c3){this['_view']['chatControls']['setContextItemLoading'](_0x2834ae,_0x21a9c3);}['setIsUploadInProgress'](_0x273f9d){this['_view']['chatControls']['setIsUploadInProgress'](_0x273f9d);}['setConversationContext'](_0x3044e0){this['_view']['chatControls']['setConversationContext'](_0x3044e0);}['clearPendingContextUI'](){this['_view']['chatControls']['clearPendingContextUI']();}['clearConversationContextUI'](){this['_view']['chatControls']['clearConversationContextUI']();}['updateResourceState'](_0x2138e0,_0x46e4fa,_0xa5723e){this['_view']['chatControls']['updateResourceState'](_0x2138e0,_0x46e4fa,_0xa5723e);}['resetMessageInput'](){this['_view']['chatControls']['resetMessageInput'](),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder']());}['setAddContextOptions'](_0x3db65a){this['_view']['chatControls']['setAddContextOptions'](_0x3db65a);}['updateCapabilities'](_0x445690){this['_view']['chatControls']['setWebSearch'](_0x445690['isWebSearchEnabled']),this['_view']['chatControls']['setReasoning'](_0x445690['isReasoningEnabled']),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder'](_0x445690));}['setSelectedModel'](_0x47b9e7,_0x11f2ef){this['_view']['chatControls']['setModel'](_0x47b9e7),_0x11f2ef&&this['_view']['chatControls']['disableModelSelector'](!0x1);}['setFeedItemRenderingStrategy'](_0x5eee62){this['feedItemRenderingStrategy']=_0x5eee62;}['toggleLoadingSkeleton'](_0x2b4a17){this['_view']['chatFeed']['toggleLoadingSkeleton'](_0x2b4a17);}['resetConversationTitle'](){this['setConversationTitle'](i(this['context']['locale'],'AI_CHAT_HEADING'));}['setConversationTitle'](_0x37ad5d,_0x49f641=!0x1){if(_0x49f641&&!Pt()&&_0x37ad5d['length'])return this['_view']['chatHeader']['label']='',void this['_animateConversationTitle'](_0x37ad5d);this['_view']['chatHeader']['label']=_0x37ad5d;}['setLoadingMessage'](_0x18c0fa){const _0xcd4d7b=this['_getLoadingMessage'](_0x18c0fa);this['_view']['chatFeed']['setLoadingMessage'](_0xcd4d7b);}['_animateConversationTitle'](_0x182e62){let _0x35c8ac=0x0;clearInterval(this['_titleAnimationInterval']),this['_titleAnimationInterval']=setInterval(()=>{this['_view']['chatHeader']['label']=this['_view']['chatHeader']['label']+_0x182e62[_0x35c8ac],_0x35c8ac++,_0x35c8ac===_0x182e62['length']&&clearInterval(this['_titleAnimationInterval']);},0x1e);}['setIsMaximized'](_0x2873a3){this['_view']['chatHeader']['isMaximized']=_0x2873a3;}['_getLoadingMessage'](_0xf79960){return _0xf79960?_0xf79960['isWebSearchEnabled']&&_0xf79960['isReasoningEnabled']?i(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH_REASONING'):_0xf79960['isWebSearchEnabled']?i(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH'):_0xf79960['isReasoningEnabled']?i(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_REASONING'):i(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_REGULAR'):'';}['_getInputPlaceholder'](_0x4d6b53){return _0x4d6b53?_0x4d6b53['isWebSearchEnabled']&&_0x4d6b53['isReasoningEnabled']?i(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH_REASONING'):_0x4d6b53['isWebSearchEnabled']?i(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH'):_0x4d6b53['isReasoningEnabled']?i(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REASONING'):i(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REGULAR'):i(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REGULAR');}['populateSourceResourceBalloon'](_0x1d7062,_0x3af516,_0x23bf7c,_0x5efaf4){this['_view']['populateSourceResourceBalloon'](_0x1d7062,_0x3af516,_0x23bf7c,_0x5efaf4);}['closeSourceResourceBalloon'](_0x4dd7eb){this['_view']['closeSourceResourceBalloon'](_0x4dd7eb);}['focusPromptInput'](){this['_view']['chatControls']['focusPromptInput']();}['scrollFeedToSuggestion'](_0xf092d0,_0x5bf42a){this['_view']['chatFeed']['scrollToSuggestion'](_0xf092d0,_0x5bf42a);}['startAutoScroll'](){this['_view']['chatFeed']['startAutoScroll']();}['disableControls'](){this['_view']['chatControls']['isDisabled']=!0x0;}['enableControls'](){this['_view']['chatControls']['isDisabled']=!0x1;}}class Mi extends _0x5bd1ba{['sections'];constructor(_0x3ebc8c,_0x382935){super(_0x3ebc8c),this['sections']=_0x382935,this['items']['addMany'](this['sections']),this['extendTemplate']({'attributes':{'class':['ck-ai-chat-history__sections']}});}['filter'](_0x5cce19){let _0x3f494d=0x0,_0x1b360f=0x0;for(const _0x575849 of this['sections']){const {resultsCount:_0x3cecf4,totalItemsCount:_0xb31a10}=_0x575849['filter'](_0x5cce19);_0x3f494d+=_0x3cecf4,_0x1b360f+=_0xb31a10;}return{'resultsCount':_0x3f494d,'totalItemsCount':_0x1b360f};}}class xi extends _0x3f0116{['title'];['itemsViews'];['_itemsListView'];constructor(_0x4ab95e,{title:_0x58f440,items:_0x5755eb}){super(_0x4ab95e);const _0x261181=this['bindTemplate'];this['set']('isVisible',!0x0),this['title']=_0x58f440,this['itemsViews']=_0x5755eb;const _0x12c30e=new _0x43effc(_0x4ab95e);_0x12c30e['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-history__section-title']},'children':[this['title']]}),this['_itemsListView']=new _0x5bd1ba(_0x4ab95e),this['_itemsListView']['items']['addMany'](this['itemsViews']),this['setTemplate']({'tag':'li','attributes':{'class':['ck-ai-chat-history__section',_0x261181['if']('isVisible','ck-hidden',_0x4c2be8=>!_0x4c2be8)]},'children':[_0x12c30e,this['_itemsListView']]});}['filter'](_0x498d32){const _0x268e65=this['itemsViews']['length'];let _0x3351e5=0x0;for(const _0x2c3804 of this['itemsViews']){if(_0x498d32){const _0x59a5e9=_0x2c3804['isMatching'](_0x498d32);_0x2c3804['isVisible']=!!_0x59a5e9,_0x2c3804['highlightText'](_0x498d32);}else _0x2c3804['isVisible']=!0x0,_0x2c3804['highlightText'](null);_0x2c3804['isVisible']&&_0x3351e5++;}return this['isVisible']=_0x3351e5>0x0,{'resultsCount':_0x3351e5,'totalItemsCount':_0x268e65};}['getItem'](_0x9894c3){return this['itemsViews']['find'](_0x11fe2a=>_0x11fe2a['id']===_0x9894c3);}['removeItem'](_0x403596){const _0x302370=this['itemsViews']['indexOf'](_0x403596);-0x1!==_0x302370&&(this['itemsViews']['splice'](_0x302370,0x1),this['_itemsListView']['items']['remove'](_0x403596));}}class Li extends/* #__PURE__ -- @preserve */
|
|
27
|
-
_0x57d898(_0x3f0116){['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(_0x3cd637,_0x1f0860){super(_0x3cd637);const _0x32bdc4=this['bindTemplate'];this['set']('isEdit',!0x1),this['set']('isVisible',!0x0),this['set']('pinned',!!_0x1f0860['pinned']),this['set']('loadingState',null),this['id']=_0x1f0860['id'];const {title:_0x854df4,createdAt:_0x33d221,active:_0x193eff=!0x1}=_0x1f0860;this['_titleView']=new _0x407d13(),this['_titleView']['text']=_0x854df4,this['_titleView']['extendTemplate']({'attributes':{'class':['ck-ai-chat-history__item-title']}});const _0x3c26b6=this['_createCheckView'](),_0x266f8e=this['_createPinButtonView'](_0x3cd637),_0x65d795=this['_createMenuDropdownView'](),_0x4b4fe5=this['_createEditInputView'](_0x3cd637,_0x854df4),_0x212437=this['_createAcceptEditButtonView'](_0x3cd637,_0x4b4fe5),_0x48eb95=this['_createCancelEditButtonView'](_0x3cd637,_0x4b4fe5);this['actions']=this['createCollection'](),this['mainContent']=this['createCollection'](),this['mainContent']['add'](this['_titleView']),this['actions']['add'](_0x266f8e),this['actions']['add'](_0x65d795),this['on']('change:isEdit',(_0x5add2b,_0x57ca9a,_0x5cccc4)=>{this['actions']['clear'](),this['mainContent']['clear'](),_0x5cccc4?(this['actions']['add'](_0x212437),this['actions']['add'](_0x48eb95),this['mainContent']['add'](_0x4b4fe5),_0x4b4fe5['element']['focus']()):(this['actions']['add'](_0x266f8e),this['actions']['add'](_0x65d795),this['mainContent']['add'](this['_titleView']));}),this['setTemplate']({'tag':'li','attributes':{'class':['ck-ai-chat-history__item',_0x193eff?'ck-ai-chat-history__item--active':'',_0x32bdc4['if']('isVisible','ck-hidden',_0x3beb84=>!_0x3beb84),_0x32bdc4['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',_0x32bdc4['if']('loadingState','ck-hidden',_0x1a1cca=>!!_0x1a1cca)]},'children':_0x193eff?[_0x3c26b6]:[]},{'tag':'div','attributes':{'class':['ck-ai-loader',_0x32bdc4['if']('loadingState','ck-hidden',_0x2fb936=>!_0x2fb936)]},'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',_0x32bdc4['if']('loadingState','ck-hidden',_0x20e059=>!!_0x20e059)]},'children':this['mainContent']},{'tag':'div','attributes':{'class':['ck-ai-loader__text',_0x32bdc4['if']('loadingState','ck-hidden',_0x50e79=>!_0x50e79)]},'children':[{'text':_0x32bdc4['to']('loadingState',_0x4beb28=>_0x4beb28?i(this['locale'],Li['LOADING_LABELS'][_0x4beb28]):'')}]}]},{'tag':'span','attributes':{'class':['ck-ai-chat-history__item-date']},'children':[_0x33d221]}]},{'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'](_0x5c68e0){this['_titleView']['text']=_0x469020(_0x5c68e0);}['updateLoadingState'](_0x416ffa,_0x56acfc){this['set']('loadingState',_0x56acfc?_0x416ffa:null);}['_createCheckView'](){const _0x84eff9=new _0x4caa0b();return _0x84eff9['set']({'content':_0x3cb840}),_0x84eff9;}['_createPinButtonView'](_0x527077){const _0x27889b=new _0xcbb426(_0x527077);return _0x27889b['set']({'label':i(_0x527077,'AI_CHAT_HISTORY_PIN_BUTTON'),'icon':_0x39ada3,'withText':!0x1,'tooltip':!0x0}),_0x27889b['bind']('isOn')['to'](this,'pinned'),_0x27889b['on']('execute',()=>{const _0x52e638=!this['pinned'];this['fire']('setConversationPinned',{'id':this['id'],'pinned':_0x52e638});}),_0x27889b;}['_createMenuDropdownView'](){const _0x20c79f=_0x2e287a(this['locale'],_0x1fb857),_0x39c9ff=_0x20c79f['panelView']['children'];_0x20c79f['buttonView']['set']({'label':i(this['locale'],'AI_CHAT_HISTORY_SHOW_MORE_ITEMS'),'icon':_0x16c5df}),_0x20c79f['panelPosition']='sw';const _0x561b65=new _0xcbb426(this['locale']);_0x561b65['label']=i(this['locale'],'AI_CHAT_HISTORY_EDIT_NAME'),_0x561b65['withText']=!0x0,_0x561b65['on']('execute',()=>{this['isEdit']=!0x0;});const _0x91be65=new _0xcbb426(this['locale']);_0x91be65['label']=i(this['locale'],'AI_CHAT_HISTORY_REMOVE'),_0x91be65['withText']=!0x0,_0x91be65['on']('execute',()=>{this['showConfirm'](i(this['locale'],'AI_CHAT_HISTORY_REMOVE_CONFIRM'),this['element'])['then'](()=>{this['fire']('removeConversation',{'id':this['id']});});});const _0x5b6d0d=new _0x5bd1ba(this['locale']),_0x5994b8=new _0x3f0116(this['locale']);_0x5994b8['children']['add'](_0x561b65);const _0x25bb43=new _0x3f0116(this['locale']);return _0x25bb43['children']['add'](_0x91be65),_0x5b6d0d['items']['addMany']([_0x5994b8,_0x25bb43]),_0x39c9ff['add'](_0x5b6d0d),_0x20c79f;}['_createEditInputView'](_0x48f746,_0x23502c){const _0x31cec4=new _0xa4bda4(_0x48f746),_0x39ab5c=_0x31cec4['bindTemplate'];return _0x31cec4['value']=_0x23502c,_0x31cec4['extendTemplate']({'on':{'keydown':_0x39ab5c['to'](_0x57663f=>{'Enter'==_0x57663f['key']&&this['_commitEditInputValue'](_0x31cec4);})}}),_0x31cec4;}['_createAcceptEditButtonView'](_0x2b7847,_0x31bf25){const _0x288e69=new _0xcbb426(_0x2b7847);return _0x288e69['set']({'icon':_0x3cb840,'withText':!0x1,'tooltip':i(_0x2b7847,'AI_CHAT_HISTORY_ACCEPT')}),_0x288e69['extendTemplate']({'attributes':{'class':['ck-confirm-view-submit']}}),_0x288e69['on']('execute',()=>{this['_commitEditInputValue'](_0x31bf25);}),_0x288e69;}['_commitEditInputValue'](_0x7410c){const _0x366af2=_0x7410c['element']['value']||'';this['_titleView']['text']=_0x366af2,this['isEdit']=!0x1,this['fire']('editConversationTitle',{'id':this['id'],'title':_0x366af2});}['_createCancelEditButtonView'](_0x1885da,_0x151502){const _0x4d094f=new _0xcbb426(_0x1885da);return _0x4d094f['set']({'icon':_0x3a96a0,'withText':!0x1,'tooltip':i(_0x1885da,'AI_CHAT_HISTORY_CANCEL')}),_0x4d094f['extendTemplate']({'attributes':{'class':['ck-confirm-view-cancel']}}),_0x4d094f['on']('execute',()=>{this['isEdit']=!0x1,_0x151502['value']=this['_titleView']['text']||'',this['fire']('edit:cancel');}),_0x4d094f;}['_createSpinnerView'](){const _0x4d87cb=new We('tiny');return _0x4d87cb['isVisible']=!0x0,_0x4d87cb;}['isMatching'](_0x3dacd5){return this['_titleView']&&'string'==typeof this['_titleView']['text']&&this['_titleView']['text']['match'](_0x3dacd5)?{'title':!0x0}:null;}['highlightText'](_0x334b1a){this['_titleView']['highlightText'](_0x334b1a);}}class kt extends _0x43effc{['searchView'];['mainErrorView'];['skeletonView'];['emptyView'];['sectionsView'];['resizeButton'];constructor(_0x1d595f,_0x4deef4){super(_0x1d595f),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 _0x5c8eb4=new _0xbcda8a(_0x1d595f,{'label':i(_0x1d595f,'AI_CHAT_HISTORY_HEADING'),'icon':Ut,'class':'ck-ai-header\x20ck-ai-header_history'});_0x4deef4&&(this['resizeButton']=ks(_0x1d595f,this),_0x5c8eb4['children']['add'](this['resizeButton'])),this['sectionsView']=new Mi(_0x1d595f,[]),this['sectionsView']['delegate'](...Yi)['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',_0x3ad8ad=>!_0x3ad8ad)]}}),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':[_0x5c8eb4,{'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 _0x27bd7a=new _0x1f1a68(this['locale'],{'filteredView':this['sectionsView'],'queryView':{'label':i(this['locale'],'AI_CHAT_HISTORY_SEARCH_LABEL')},'infoView':{'text':{'notFound':{'primary':_0x17328c=>i(this['locale'],'AI_CHAT_HISTORY_SEARCH_NOT_FOUND_PRIMARY',_0x17328c),'secondary':i(this['locale'],'AI_CHAT_HISTORY_SEARCH_NOT_FOUND_SECONDARY')}}}}),_0x548e51=this['_createErrorView']();return _0x548e51['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('errorMessage','ck-hidden',_0x5603c8=>!_0x5603c8)]}}),_0x27bd7a['on']('render',()=>{_0x27bd7a['children']['add'](_0x548e51,0x1);}),_0x27bd7a['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isSearchViewVisible','ck-hidden',_0x249333=>!_0x249333)]}}),_0x27bd7a;}['_createSkeletonView'](){const _0x4315d6=new Pe(this['locale'],Be['aiHistory']);return _0x4315d6['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isLoading','ck-hidden',_0x2bf249=>!_0x2bf249)]}}),_0x4315d6;}['_createErrorView'](){const _0x3ab89d=new _0x43effc(this['locale']),_0x1501dd=new _0xcbb426(this['locale']);_0x1501dd['set']({'withText':!0x1,'icon':_0x3a96a0,'class':'ck-ai-notification_error__dismiss-button'}),_0x1501dd['bind']('isVisible')['to'](this,'hasItems',_0x71ce0d=>!!_0x71ce0d),_0x1501dd['on']('execute',()=>{this['errorMessage']='';});const _0x5515ad=this['bindTemplate'];return _0x3ab89d['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-notification','ck-ai-notification_error']},'children':[{'tag':'p','children':[{'text':_0x5515ad['to']('errorMessage')}]},_0x1501dd]}),_0x3ab89d;}['_createEmptyStateView'](){const _0x3581c9=new _0xcbb426(this['locale']);_0x3581c9['set']({'label':i(this['locale'],'AI_CHAT_LABEL_NEW_CHAT'),'withText':!0x0,'icon':_0x357a3c,'class':'ck-ai-chat__start-conversation'}),_0x3581c9['on']('execute',()=>{this['fire']('openChat');});const _0x1e99cc=new _0x43effc(this['locale']);return _0x1e99cc['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-history__empty',this['bindTemplate']['if']('isEmptyViewVisible','ck-hidden',_0x1df687=>!_0x1df687)]},'children':[{'tag':'p','attributes':{'class':['ck-ai-chat-history__empty-message']},'children':[i(this['locale'],'AI_CHAT_HISTORY_EMPTY_MESSAGE')]},_0x3581c9]}),_0x1e99cc;}['_createListItemViews'](_0x2be066,_0x5292cc){const _0x214008=[];for(const _0x320897 of _0x2be066){const _0x3a5d6e=new Li(_0x5292cc,_0x320897);_0x3a5d6e['delegate'](...Yi)['to'](this),_0x214008['push'](_0x3a5d6e);}return _0x214008;}['updateHistoryItemsWithCategories'](_0x222d6f){const _0x44fb96=this['locale']||'en',_0x7382c7=[];for(const _0x2c7d3c of _0x222d6f){const _0x25b99b=this['_createListItemViews'](_0x2c7d3c['items'],_0x44fb96);_0x7382c7['push'](new xi(_0x44fb96,{'title':_0x2c7d3c['title'],'items':_0x25b99b}));}this['sectionsView']['sections']=_0x7382c7,this['sectionsView']['items']['clear'](),this['sectionsView']['items']['addMany'](_0x7382c7),this['hasItems']=_0x222d6f['some'](_0x4d9fe1=>_0x4d9fe1['items']['length']>0x0),this['_refreshSearch']();}['removeHistoryItem'](_0x3eb949){for(const _0x32797e of this['sectionsView']['sections']){const _0x33c493=_0x32797e['getItem'](_0x3eb949);if(_0x33c493){if(_0x32797e['removeItem'](_0x33c493),0x0===_0x32797e['itemsViews']['length']){const _0x353cb1=this['sectionsView']['sections']['indexOf'](_0x32797e);-0x1!==_0x353cb1&&(this['sectionsView']['sections']['splice'](_0x353cb1,0x1),this['sectionsView']['items']['remove'](_0x32797e));}this['hasItems']=this['sectionsView']['sections']['length']>0x0,this['_refreshSearch']();break;}}}['updateItemTitle'](_0xca72e8,_0x494dbe){for(const _0x5efb67 of this['sectionsView']['sections']){const _0x537f0d=_0x5efb67['getItem'](_0xca72e8);if(_0x537f0d){_0x537f0d['updateTitle'](_0x494dbe);break;}}}['updateItemLoadingState'](_0x362779,_0x417fb4,_0x4d4a31){for(const _0x3f2ef7 of this['sectionsView']['sections']){const _0x1fe35e=_0x3f2ef7['getItem'](_0x362779);if(_0x1fe35e){_0x1fe35e['updateLoadingState'](_0x417fb4,_0x4d4a31);break;}}}['_refreshSearch'](){if(this['hasItems']){const _0x38fad7=this['searchView']['queryView']['fieldView']?.['element']?.['value']||'';this['searchView']['search'](_0x38fad7);}}}const Yi=['showConversationHistory','removeConversation','editConversationTitle','setConversationPinned','selectConversation','openChat','resizeTabs'];class xt extends ot{static get['requires'](){return[Ct];}['_historyView'];static get['pluginName'](){return'AIChatHistoryUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x3e806e){super(_0x3e806e);const _0x3a077d=this['context']['plugins']['get']('AITabs');this['_historyView']=new kt(this['context']['locale'],_0x3a077d['showResizeButton']),this['_historyView']['delegate'](...Yi)['to'](this),_0x3a077d['view']['addTab']({'id':'history','buttonLabel':i(this['context']['locale'],'AI_CHAT_HISTORY_HEADING'),'buttonIcon':Ut,'order':0x0,'content':this['_historyView']});}['removeHistoryItem'](_0x2c8d4a){this['_historyView']['removeHistoryItem'](_0x2c8d4a);}['updateItems'](_0x2852e3){this['_historyView']['updateHistoryItemsWithCategories'](_0x2852e3);}['updateItemTitle'](_0x2a30f1,_0xc473d7){this['_historyView']['updateItemTitle'](_0x2a30f1,_0xc473d7);}['updateItemLoadingState'](_0x207aea,_0x57e862,_0xc8c793){this['_historyView']['updateItemLoadingState'](_0x207aea,_0x57e862,_0xc8c793);}['setLoadingSkeleton'](_0x33a20c){this['_historyView']['isLoading']=_0x33a20c;}['showError'](_0x1a3395){this['_historyView']['errorMessage']=_0x1a3395;}['hideError'](){this['_historyView']['errorMessage']='';}['setIsMaximized'](_0x171052){this['_historyView']['isMaximized']=_0x171052;}}class Ue extends ts(){['id'];['createdAt'];constructor({id:_0x252af6,title:_0x520bf1,createdAt:_0xc2f7c8,updatedAt:_0x316c4d,pinned:_0x1f2524}){super(),this['id']=_0x252af6,this['createdAt']=new Date(_0xc2f7c8),this['set']('title',_0x520bf1),this['set']('updatedAt',_0x316c4d?new Date(_0x316c4d):null),this['set']('pinned',_0x1f2524||!0x1);}['updateTitle'](_0x890f5b){this['set']('title',_0x469020(_0x890f5b)),this['updatedAt']=new Date();}['updatePinned'](_0xf5702b){this['set']('pinned',_0xf5702b),this['updatedAt']=new Date();}}class Yt extends _0x19d98c(){['items']=[];['connector'];['group'];constructor({connector:_0x20ecb9,group:_0xd790c9}){super(),this['connector']=_0x20ecb9,this['group']=_0xd790c9;}async['init'](){try{const _0xeb08e5=this['connector']['fetchConversations'](this['group']),_0xbc3b36=await _0xeb08e5['getConversations']();this['loadItems'](_0xbc3b36);}catch(_0x38645b){this['fire']('error',{'error':_0x38645b,'operation':'init'});}}['addItem'](_0x183c55){this['items']['push'](_0x183c55);}async['removeItem'](_0x47ebf7){const _0x451d0e=this['items']['findIndex'](_0x1d8605=>_0x1d8605['id']===_0x47ebf7);if(-0x1===_0x451d0e)return!0x1;try{return await this['connector']['deleteConversation'](_0x47ebf7)['execute'](),this['items']['splice'](_0x451d0e,0x1),this['fire']('itemRemoved',{'itemId':_0x47ebf7}),!0x0;}catch(_0x3693d0){return this['fire']('error',{'error':_0x3693d0,'operation':'removeItem','itemId':_0x47ebf7}),!0x1;}}['getItem'](_0x506de5){return this['items']['find'](_0x3187dd=>_0x3187dd['id']===_0x506de5);}async['updateItemTitle'](_0x3303ca,_0x247d78){const _0x2a5333=this['getItem'](_0x3303ca);if(!_0x2a5333)return!0x1;try{return await this['connector']['updateConversation'](_0x3303ca,{'title':_0x247d78})['getResult'](),_0x2a5333['updateTitle'](_0x247d78),this['fire']('itemUpdated',{'itemId':_0x3303ca,'updates':{'title':_0x247d78}}),!0x0;}catch(_0x1f07c1){return this['fire']('error',{'error':_0x1f07c1,'operation':'updateItemTitle','itemId':_0x3303ca}),!0x1;}}async['updateItemPinned'](_0x312c78,_0x5cbc66){const _0x5a6015=this['getItem'](_0x312c78);if(!_0x5a6015)return!0x1;try{return await this['connector']['updateConversation'](_0x312c78,{'pinned':_0x5cbc66})['getResult'](),_0x5a6015['updatePinned'](_0x5cbc66),this['fire']('itemUpdated',{'itemId':_0x312c78,'updates':{'pinned':_0x5cbc66}}),!0x0;}catch(_0x46e71d){return this['fire']('error',{'error':_0x46e71d,'operation':'updateItemPinned','itemId':_0x312c78}),!0x1;}}['loadItems'](_0x45623e){try{this['items']=[],_0x45623e['map'](_0x30b639=>{this['addItem'](new Ue(_0x30b639));}),this['fire']('itemsLoaded',{'items':[...this['items']]});}catch(_0x3417dc){this['fire']('error',{'error':_0x3417dc,'operation':'loadItems'});}}['getItems'](_0x561a19={}){const _0x10c05=void 0x0!==_0x561a19['pinned']&&_0x561a19['pinned'],_0x2e455e=_0x561a19['from']?new Date(_0x561a19['from']['getFullYear'](),_0x561a19['from']['getMonth'](),_0x561a19['from']['getDate']()):null,_0x5dadfc=_0x561a19['to']?new Date(_0x561a19['to']['getFullYear'](),_0x561a19['to']['getMonth'](),_0x561a19['to']['getDate']()):null;return this['items']['filter'](_0x44f3e5=>{if(_0x44f3e5['pinned']!==_0x10c05)return!0x1;if(_0x5dadfc){const _0x119617=new Date(_0x44f3e5['createdAt']['getFullYear'](),_0x44f3e5['createdAt']['getMonth'](),_0x44f3e5['createdAt']['getDate']());return _0x2e455e?_0x2e455e['getTime']()===_0x5dadfc['getTime']()?_0x119617['getTime']()===_0x2e455e['getTime']():_0x119617<_0x5dadfc&&_0x119617>=_0x2e455e:_0x119617<_0x5dadfc;}return!0x0;});}}class jt extends ot{['_aiConnector'];['_aiChatHistoryUi'];['_aiChatController'];static get['requires'](){return[S,dt,xt,Ct];}static get['pluginName'](){return'AIChatHistoryController';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){this['_aiConnector']=this['context']['plugins']['get'](S),this['_aiChatHistoryUi']=this['context']['plugins']['get'](xt),this['_aiChatController']=this['context']['plugins']['get'](dt);const _0x3df52a=this['context']['plugins']['get'](Ct);try{const _0x1f4d53=this['_aiChatController']['getGroupId']();this['history']=new Yt({'connector':this['_aiConnector'],'group':_0x1f4d53}),this['listenTo'](this['_aiChatHistoryUi'],'removeConversation',(_0x18a9ee,_0x37572e)=>{this['_setItemLoading'](_0x37572e['id'],'remove'),this['_handleRemove'](_0x37572e['id']);}),this['listenTo'](this['_aiChatHistoryUi'],'editConversationTitle',(_0x184318,_0x627ddc)=>{this['_setItemLoading'](_0x627ddc['id'],'rename'),this['_handleEditTitle'](_0x627ddc['id'],_0x627ddc['title']);}),this['listenTo'](this['history'],'itemUpdated',(_0x5e905a,_0xb2eee)=>{void 0x0!==_0xb2eee['updates']['title']&&this['_aiChatHistoryUi']['updateItemTitle'](_0xb2eee['itemId'],_0xb2eee['updates']['title']),void 0x0!==_0xb2eee['updates']['pinned']&&this['_updateHistoryItemsUI'](),this['_clearItemLoading'](_0xb2eee['itemId']);}),this['listenTo'](this['history'],'itemRemoved',(_0x212fab,_0x570eeb)=>{this['_aiChatController']['handleRemovedConversation'](_0x570eeb['itemId']),this['_aiChatHistoryUi']['removeHistoryItem'](_0x570eeb['itemId']),this['_clearItemLoading'](_0x570eeb['itemId']);}),this['listenTo'](this['history'],'itemsLoaded',()=>{this['_updateHistoryItemsUI']();}),this['listenTo'](this['history'],'error',(_0x1c5903,_0x501953)=>{this['_handleHistoryErrorUI'](_0x501953['error'],_0x501953['operation'],_0x501953['itemId']);}),this['listenTo'](this['_aiChatHistoryUi'],'selectConversation',(_0x42ccf2,_0x5be722)=>{this['_handleSelectConversation'](_0x5be722['id']);}),this['listenTo'](this['_aiChatHistoryUi'],'setConversationPinned',(_0x4855b2,_0x3e7d85)=>{const _0x46f0d3=_0x3e7d85['pinned']?'pin':'unpin';this['_setItemLoading'](_0x3e7d85['id'],_0x46f0d3),this['_handleTogglePin'](_0x3e7d85['id'],_0x3e7d85['pinned']);}),this['listenTo'](this['_aiChatHistoryUi'],'openChat',()=>{_0x3df52a['view']['activateTab']('chat');}),this['listenTo'](this['_aiChatController'],'change:activeConversation',()=>{this['_updateHistoryItemsUI']();}),_0x3df52a['view']['on']('activateTab:history',()=>{this['_showConversationHistory']();}),this['listenTo'](_0x3df52a,'resizedTabs',(_0x139347,_0x4ee75c)=>{this['_setIsMaximized'](_0x4ee75c);}),this['listenTo'](this['_aiChatHistoryUi'],'resizeTabs',()=>{_0x3df52a['resize']();});}catch(_0x148dcc){this['_handleHistoryErrorUI'](_0x148dcc,'init');}}async['_handleEditTitle'](_0x36094a,_0x3b0e8a){await this['history']['updateItemTitle'](_0x36094a,_0x3b0e8a);}async['_handleTogglePin'](_0x4e9f0c,_0x29841a){await this['history']['updateItemPinned'](_0x4e9f0c,_0x29841a);}async['_handleRemove'](_0x33548a){await this['history']['removeItem'](_0x33548a);}async['_handleSelectConversation'](_0x35e990){await this['_aiChatController']['loadConversation'](_0x35e990);}async['_showConversationHistory'](){this['_aiChatHistoryUi']['showError'](''),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x0),await this['history']['init'](),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x1);}['_updateHistoryItemsUI'](){const _0x18f88c=this['_aiChatController']['activeConversation']?.['id'],_0x4d49c2=this['_getCategorizedItems']()['map'](_0x2763f3=>({'title':_0x2763f3['title'],'items':_0x2763f3['items']['map'](_0x5ead32=>({'id':_0x5ead32['id'],'title':_0x5ead32['title']||i(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION'),'createdAt':new Date(_0x5ead32['createdAt'])['toLocaleDateString'](),'active':_0x5ead32['id']===_0x18f88c,'pinned':_0x5ead32['pinned']}))}));this['_aiChatHistoryUi']['updateItems'](_0x4d49c2);}['_setItemLoading'](_0x2c768a,_0x3b7b9f){this['_aiChatHistoryUi']['updateItemLoadingState'](_0x2c768a,_0x3b7b9f,!0x0);}['_clearItemLoading'](_0x4573ea){this['_aiChatHistoryUi']['updateItemLoadingState'](_0x4573ea,null,!0x1);}['_handleHistoryErrorUI'](_0x4ac747,_0x56ccc5,_0x3c87ba){const _0x21bf7a=this['_generateErrorMessage'](_0x56ccc5,_0x3c87ba);this['_aiChatHistoryUi']['showError'](_0x21bf7a),_0x3c87ba&&this['_clearItemLoading'](_0x3c87ba),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x1);}['_generateErrorMessage'](_0x5e9265,_0xbb9046){const _0x59784f=_0xbb9046?this['history']['getItem'](_0xbb9046):null,_0x4ef82c=_0x59784f?.['title']||i(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION');switch(_0x5e9265){case'updateItemTitle':return i(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_UPDATE_TITLE',_0x4ef82c);case'updateItemPinned':{const _0x511b03=i(this['context']['locale'],_0x59784f?.['pinned']?'AI_CHAT_HISTORY_UNPIN_ACTION':'AI_CHAT_HISTORY_PIN_ACTION');return i(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_UPDATE_PINNED',[_0x511b03,_0x4ef82c]);}case'removeItem':return i(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_REMOVE_ITEM',_0x4ef82c);case'init':case'loadItems':return i(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_LOAD_ITEMS');default:return i(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_GENERIC');}}['_getCategorizedItems'](){const _0x476874=new Date(),_0x2825d8=new Date(_0x476874['getFullYear'](),_0x476874['getMonth'](),_0x476874['getDate']()),_0xdb9f9=new Date(_0x2825d8);_0xdb9f9['setDate'](_0xdb9f9['getDate']()-0x1);const _0x32f89b=new Date(_0x2825d8);_0x32f89b['setDate'](_0x32f89b['getDate']()-0xe);const _0x2666d6=this['history']['getItems']({'pinned':!0x0}),_0x4c4063=this['history']['getItems']({'from':_0x2825d8,'to':_0x2825d8}),_0x171015=this['history']['getItems']({'from':_0xdb9f9,'to':_0xdb9f9}),_0x332dd4=this['history']['getItems']({'from':_0x32f89b,'to':_0xdb9f9}),_0x31b02c=this['history']['getItems']({'to':_0x32f89b}),_0x4ba323=[];return _0x2666d6['length']>0x0&&_0x4ba323['push']({'title':i(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_PINNED'),'items':_0x2666d6}),_0x4c4063['length']>0x0&&_0x4ba323['push']({'title':i(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_TODAY'),'items':_0x4c4063}),_0x171015['length']>0x0&&_0x4ba323['push']({'title':i(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_YESTERDAY'),'items':_0x171015}),_0x332dd4['length']>0x0&&_0x4ba323['push']({'title':i(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_LAST_14_DAYS'),'items':_0x332dd4}),_0x31b02c['length']>0x0&&_0x4ba323['push']({'title':i(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_LATER'),'items':_0x31b02c}),_0x4ba323;}['_setIsMaximized'](_0x220c6c){this['_aiChatHistoryUi']['setIsMaximized'](_0x220c6c);}}class pt extends ot{static get['requires'](){return[jt,xt];}static get['pluginName'](){return'AIChatHistory';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class Da extends ot{static get['requires'](){return[dt,R,gt,pt];}static get['pluginName'](){return'AIChat';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x125fe8){super(_0x125fe8),this['context']['config']['define']('ai.chat.context',{'document':{'enabled':!0x0},'urls':{'enabled':!0x0},'files':{'enabled':!0x0},'sources':[]}),this['context']['config']['define']('ai.chat.models',{'defaultModelId':void 0x0,'modelSelectorAlwaysVisible':!0x0,'displayedModels':void 0x0});}async['addSelectionToChatContext'](){await this['context']['plugins']['get'](dt)['addSelectionToChatContext']();}async['startConversation'](){await this['context']['plugins']['get'](dt)['startConversation']();}async['sendMessage']({message:_0x13eaad,quickActionData:_0x407363}){await this['context']['plugins']['get'](dt)['sendMessage']({'message':_0x13eaad,'quickActionData':_0x407363});}['removeSelectionFromChatContext'](){this['context']['plugins']['get'](dt)['removeSelectionFromChatContext']();}['focusPromptInput'](){this['context']['plugins']['get'](dt)['focusPromptInput']();}}class co extends Qt{constructor(_0x5957b5){super(_0x5957b5);const _0x5dbcae=_0x5957b5['plugins']['get']('AITabs')['view'];this['bind']('value')['to'](_0x5dbcae,'isVisible'),this['isEnabled']=!0x0;}['execute'](){const _0x574c2e=this['editor']['plugins']['get']('AITabs')['view'];_0x574c2e['isVisible']=!_0x574c2e['isVisible'];}}class qt extends _0x346ac8{static get['requires'](){return[Ct];}static get['pluginName'](){return'AIToggleButtonUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x1fc82f=this['editor'];_0x1fc82f['commands']['add']('toggleAi',new co(_0x1fc82f)),_0x1fc82f['ui']['componentFactory']['add']('toggleAi',()=>{const _0x5cee11=this['_createAIUIButton'](_0xcbb426);return _0x5cee11['set']({'tooltip':!0x0,'class':'ck-ai-toggle-button'}),_0x5cee11;}),_0x1fc82f['ui']['componentFactory']['add']('menuBar:toggleAi',()=>{const _0x54b3ca=this['_createAIUIButton'](_0x3ce5a8);return _0x54b3ca['set']({'role':'menuitemcheckbox'}),_0x54b3ca;});}['_createAIUIButton'](_0x23408e){const _0x4ca724=this['editor'],_0x4bb434=_0x4ca724['commands']['get']('toggleAi'),_0x46d23=new _0x23408e(_0x4ca724['locale']);return _0x46d23['set']({'label':i(_0x4ca724['locale'],'AI_TOGGLE_BUTTON_LABEL'),'icon':_0x4e4731,'isToggleable':!0x0}),_0x46d23['bind']('isEnabled')['to'](_0x4bb434),_0x46d23['bind']('isOn')['to'](_0x4bb434,'value',_0x1c3e89=>!!_0x1c3e89),this['listenTo'](_0x46d23,'execute',()=>{_0x4bb434['execute']();}),_0x46d23;}}class Ma extends _0x346ac8{static get['requires'](){return[qt,zt];}static get['pluginName'](){return'AIEditorIntegration';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}function ie(_0x341601){const {editor:_0x2226db,action:_0x109f5f,withText:_0x4f972f=!0x1,withIcon:_0x3255b3=!0x0,isInDropdown:_0x295ac6=!0x0,shouldPreventFocus:_0x5a6284=!0x1}=_0x341601;return()=>{const _0x7e7ff7=_0x2226db['locale'],_0xe56606=new _0xcbb426(_0x7e7ff7),_0x4b5879=_0xe56606['bindTemplate'];_0x295ac6&&_0xe56606['extendTemplate']({'on':{'mouseenter':_0x4b5879['to'](()=>{_0x5a6284&&_0x5a6284()||_0xe56606['focus']();})}});const _0x3b2529=_0x109f5f['icon']??_0x109f5f['parent']?.['icon'];return _0xe56606['set']({'label':_0x109f5f['displayedPrompt'],'withText':_0x4f972f,'role':'menuitem','icon':_0x3255b3?_0x3b2529??_0x157b90:void 0x0,'tooltip':!_0x4f972f,'class':'ck-ai-quick-actions-button','isEnabled':_0x109f5f['isEnabled']}),_0xe56606['on']('execute',()=>{_0x2226db['editing']['view']['focus'](),_0x2226db['commands']['execute']('aiQuickAction',_0x109f5f);}),_0xe56606;};}class vs extends _0x2ab14c{['arrowView'];constructor(_0x2ad149,_0x22692f){super(_0x2ad149,_0x22692f);const _0x4d61ed=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',_0xa1e339=>String(_0xa1e339)),'data-cke-tooltip-disabled':_0x4d61ed['to']('isOn')},'on':{'mouseenter':_0x4d61ed['to']('mouseenter')}});}['render'](){super['render'](),this['children']['add'](this['arrowView']);}['_createArrowView'](){const _0x3e21c8=new _0x4caa0b();return _0x3e21c8['content']=_0x53f601,_0x3e21c8['extendTemplate']({'attributes':{'class':'ck-dropdown-menu-list__nested-menu__button__arrow'}}),_0x3e21c8;}}class Ss extends _0x5bd1ba{['_allListItems'];['_allSearchableItems'];constructor(_0x52c1d5,_0x4e1c70,_0xf63934){super(_0x52c1d5),this['_allListItems']=_0x4e1c70,this['_allSearchableItems']=_0xf63934;}['filter'](_0x3b1425){if(!_0x3b1425)return this['items']['clear'](),this['items']['addMany'](this['_allListItems']),this['_clearHighlight'](),{'resultsCount':this['_allListItems']['length'],'totalItemsCount':this['_allListItems']['length']};const _0x2f4dee=_0x3b1425['source']['toLowerCase']()['trim'](),_0x104075=this['_allSearchableItems']['filter'](_0x48a809=>(_0x48a809['groupLabel']?_0x48a809['label']+'\x20('+_0x48a809['groupLabel']+')':_0x48a809['label'])['toLowerCase']()['includes'](_0x2f4dee));return this['items']['clear'](),this['items']['addMany'](_0x104075['sort']((_0x5bedbc,_0x162f4b)=>{const _0x336ce1=_0x5bedbc['groupLabel'],_0x4fe132=_0x162f4b['groupLabel'];return _0x336ce1||_0x4fe132?_0x336ce1?0x1:-0x1:0x0;})['map'](_0x3f044f=>_0x3f044f['item'])),this['_highlightQuery'](_0x2f4dee,_0x104075),{'resultsCount':_0x104075['length'],'totalItemsCount':this['_allSearchableItems']['length']};}['_highlightQuery'](_0x2a9f88,_0x2a9ea7){if(!_0x2a9f88)return;const _0xd25176=new RegExp(_0x54c692(_0x2a9f88),'gi');_0x2a9ea7['forEach'](_0x43e22e=>{_0x43e22e['highlightViews']&&_0x43e22e['highlightViews']['forEach'](_0x408cf0=>{'function'==typeof _0x408cf0['highlightText']&&_0x408cf0['highlightText'](_0xd25176);});});}['_clearHighlight'](){this['_allSearchableItems']['forEach'](_0x2fc370=>{_0x2fc370['highlightViews']&&_0x2fc370['highlightViews']['forEach'](_0x573015=>{'function'==typeof _0x573015['highlightText']&&_0x573015['highlightText'](null);});});}}const ys='menu',Ts='menuitem';class ao extends _0x43effc{['_bodyCollection'];['optionsListView'];['_searchTextView']=null;['_allSearchableItems']=[];['children'];['focusTracker'];['keystrokes'];['_focusables'];['focusCycler'];['_openNestedPanels']=new Set();['_hasSearch'];constructor(_0x5576f1,_0x2279cf,_0x2c744a,_0x1c72ba,_0x5c8a57=!0x1){const _0x16e4db=_0x5576f1['locale'];super(_0x16e4db),this['_bodyCollection']=_0x1c72ba,this['_hasSearch']=_0x5c8a57;const _0x3c0ed3=this['_createListItems'](_0x5576f1,_0x2279cf,_0x2c744a);this['optionsListView']=new Ss(_0x16e4db,_0x3c0ed3,this['_allSearchableItems']),this['optionsListView']['role']=ys,this['optionsListView']['items']['addMany'](_0x3c0ed3),this['focusTracker']=new _0x25d272(),this['keystrokes']=new _0xfe6d51(),_0x5c8a57&&(this['_searchTextView']=this['_createSearchTextView']()),this['_focusables']=_0x3c0ed3,this['focusCycler']=new _0x4b849d({'focusables':this['_focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes']}),_0x5c8a57&&this['_searchTextView']&&this['focusCycler']['chain'](this['_searchTextView']['focusCycler']);const _0x2c77cd=_0x5c8a57&&this['_searchTextView']?[this['_searchTextView']]:[this['optionsListView']];this['children']=new _0x317ee8(_0x2c77cd),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-ai-quick-actions','ck-rounded-corners'],'dir':_0x16e4db['uiLanguageDirection']},'children':this['children']});}['_createSearchTextView'](){return new _0x1f1a68(this['locale'],{'filteredView':this['optionsListView'],'queryView':{'label':i(this['locale'],'AI_QUICK_ACTIONS_SEARCH')},'class':'ck-ai-quick-actions-search','infoView':{'text':{'notFound':{'primary':i(this['locale'],'AI_QUICK_ACTIONS_SEARCH_NOT_FOUND')}}}});}['_isSearchFocused'](){if(!this['_hasSearch']||!this['_searchTextView']||!this['_searchTextView']['queryView']['fieldView']['element'])return!0x1;const _0x260a1d=this['_searchTextView']['queryView']['fieldView']['element']['ownerDocument']?.['activeElement'];return this['_searchTextView']['queryView']['fieldView']['element']['contains'](_0x260a1d);}['_createListItems'](_0x1d80ce,_0x2b9308,_0x6ad2a){const _0x47d54f=new _0x317ee8();return _0x2b9308['forEach'](_0x57419e=>{if('actions'in _0x57419e){const {listItem:_0x369243}=this['_createActionGroupButton'](_0x1d80ce,_0x57419e,_0x6ad2a);_0x47d54f['add'](_0x369243),_0x57419e['actions']['forEach'](_0x55381c=>{this['_createActionButton'](_0x1d80ce,_0x55381c,_0x57419e['label'],_0x57419e['icon']);const {listItem:_0x48d2a5,highlightViews:_0x25ab40}=this['_createSearchResultActionButton'](_0x1d80ce,_0x55381c,_0x57419e['label'],_0x57419e['icon']);this['_allSearchableItems']['push']({'item':_0x48d2a5,'label':_0x55381c['displayedPrompt'],'groupLabel':_0x57419e['label'],'highlightViews':_0x25ab40});});}else{const {listItem:_0x31f872}=this['_createActionButton'](_0x1d80ce,_0x57419e);_0x47d54f['add'](_0x31f872);const _0x2b813e=_0x31f872['children']['first'];if(_0x2b813e){const {listItem:_0x5085b6,highlightViews:_0x546bd4}=this['_createSearchResultActionButton'](_0x1d80ce,_0x57419e);this['_allSearchableItems']['push']({'item':_0x5085b6,'label':_0x2b813e['label']||'','highlightViews':_0x546bd4});}}}),_0x47d54f;}['_createActionButton'](_0xb4c6ca,_0xd32874,_0x145289,_0x13c732){const _0xc61b98=new _0x3f0116(this['locale']);if(_0x145289&&_0x13c732){const _0x1ae0f3=new _0xcbb426(this['locale']),_0x7fb069=_0x1ae0f3['bindTemplate'],_0x33acbe=new _0x407d13();_0x33acbe['text']=_0xd32874['displayedPrompt'];const _0x1ca95c=new _0x407d13();_0x1ca95c['text']=_0x145289;const _0x37e269=new _0x4caa0b();_0x37e269['content']=_0x13c732,_0x37e269['extendTemplate']({'attributes':{'class':'ck-ai-quick-actions-button__group-icon'}});const _0x5ac68c=new _0x43effc(this['locale']);_0x5ac68c['setTemplate']({'tag':'span','attributes':{'class':'ck-ai-quick-actions-button_with-group__open-paren'},'children':[{'text':'\x20('}]});const _0x1c4e76=new _0x43effc(this['locale']);return _0x1c4e76['setTemplate']({'tag':'span','attributes':{'class':'ck-ai-quick-actions-button_with-group__close-paren'},'children':[{'text':')'}]}),_0x1ae0f3['set']({'label':_0xd32874['displayedPrompt']+'\x20('+_0x145289+')','withText':!0x0,'role':'menuitem','class':'ck-ai-quick-actions-button\x20ck-ai-quick-actions-button_with-group','tooltip':!0x1}),_0x1ae0f3['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':[_0x33acbe,_0x5ac68c,_0x37e269,_0x1ca95c,_0x1c4e76],'on':{'mouseenter':_0x7fb069['to'](()=>{this['_isSearchFocused']()||_0x1ae0f3['focus']();}),'click':_0x7fb069['to'](()=>{_0x1ae0f3['fire']('execute');})}}),_0x1ae0f3['on']('execute',()=>{_0xb4c6ca['editing']['view']['focus'](),_0xb4c6ca['commands']['execute']('aiQuickAction',_0xd32874);}),_0xc61b98['children']['add'](_0x1ae0f3),{'listItem':_0xc61b98,'highlightViews':[_0x33acbe,_0x1ca95c]};}{const _0xc99098=new _0xa65920(),_0x234133=new _0xcbb426(this['locale'],_0xc99098),_0x3509ec=_0x234133['bindTemplate'],_0x1b3f0a=_0xd32874['icon']??_0xd32874['parent']?.['icon'],_0xa64028=void 0x0!==_0xd32874['icon'];return _0x234133['set']({'label':_0xd32874['displayedPrompt'],'withText':!0x0,'role':'menuitem','icon':_0xa64028?_0x1b3f0a??_0x157b90:void 0x0,'tooltip':!0x1,'class':'ck-ai-quick-actions-button'}),_0x234133['extendTemplate']({'on':{'mouseenter':_0x3509ec['to'](()=>{this['_isSearchFocused']()||_0x234133['focus']();})}}),_0x234133['on']('execute',()=>{_0xb4c6ca['editing']['view']['focus'](),_0xb4c6ca['commands']['execute']('aiQuickAction',_0xd32874);}),_0xc61b98['children']['add'](_0x234133),{'listItem':_0xc61b98,'highlightViews':[_0xc99098]};}}['_createSearchResultActionButton'](_0x240a92,_0x9d229c,_0x39e148,_0x5f5abe){return _0x39e148&&_0x5f5abe?this['_createSearchResultGroupedActionButton'](_0x240a92,_0x9d229c,_0x39e148,_0x5f5abe):this['_createSearchResultIndividualActionButton'](_0x240a92,_0x9d229c);}['_createSearchResultGroupedActionButton'](_0x41c051,_0x1bba59,_0x3d6f7a,_0x4081a6){const _0x514e6d=new _0x3f0116(this['locale']),_0x43832d=new _0xcbb426(this['locale']),_0x72ab31=_0x43832d['bindTemplate'],{view:_0x260a48,highlightView:_0x1417ce}=this['_createSearchResultGroupRow'](_0x3d6f7a,_0x4081a6),{view:_0x2d94e3,highlightView:_0xb1e079}=this['_createSearchResultActionRow'](_0x1bba59['displayedPrompt']),_0x1d8d0d=this['_createSearchResultContentView'](_0x260a48,_0x2d94e3);return _0x43832d['set']({'label':_0x1bba59['displayedPrompt'],'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}),_0x43832d['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':[_0x1d8d0d],'on':{'mouseenter':_0x72ab31['to'](()=>{this['_isSearchFocused']()||_0x43832d['focus']();}),'click':_0x72ab31['to'](()=>{this['_handleSearchResultButtonClick'](_0x43832d);})}}),this['_setupActionButtonExecution'](_0x43832d,_0x41c051,_0x1bba59),_0x514e6d['children']['add'](_0x43832d),{'listItem':_0x514e6d,'highlightViews':[_0x1417ce,_0xb1e079]};}['_createSearchResultIndividualActionButton'](_0x22b2a9,_0x4594ac){const _0x3e4e9d=new _0x3f0116(this['locale']),_0x2f9d8d=new _0xa65920(),_0x50499a=new _0xcbb426(this['locale'],_0x2f9d8d),_0x167813=_0x50499a['bindTemplate'];return _0x50499a['set']({'label':_0x4594ac['displayedPrompt'],'withText':!0x0,'role':'menuitem','icon':void 0x0,'tooltip':!0x1,'class':'ck-ai-quick-actions-button\x20ck-ai-quick-actions-search-result-button'}),_0x50499a['extendTemplate']({'on':{'mouseenter':_0x167813['to'](()=>{this['_isSearchFocused']()||_0x50499a['focus']();})}}),this['_setupActionButtonExecution'](_0x50499a,_0x22b2a9,_0x4594ac),_0x3e4e9d['children']['add'](_0x50499a),{'listItem':_0x3e4e9d,'highlightViews':[_0x2f9d8d]};}['_createSearchResultGroupRow'](_0x4c3cc7,_0x17e7cd){const _0x428ebe=new _0x43effc(this['locale']),_0x44c590=new _0x4caa0b();_0x44c590['content']=_0x17e7cd,_0x44c590['extendTemplate']({'attributes':{'class':'ck-ai-quick-actions-button__group-icon'}});const _0x58721f=new _0x407d13();return _0x58721f['text']=_0x4c3cc7,_0x428ebe['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-quick-actions-search-result__group-row'},'children':[_0x44c590,_0x58721f]}),{'view':_0x428ebe,'highlightView':_0x58721f};}['_createSearchResultActionRow'](_0x571b0d){const _0x176a39=new _0x43effc(this['locale']),_0x172dfd=new _0x407d13();return _0x172dfd['text']=_0x571b0d,_0x176a39['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-quick-actions-search-result__action-row'},'children':[_0x172dfd]}),{'view':_0x176a39,'highlightView':_0x172dfd};}['_createSearchResultContentView'](_0x3e2cea,_0x54617f){const _0x59544c=new _0x43effc(this['locale']);return _0x59544c['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-quick-actions-search-result__content'},'children':[_0x3e2cea,_0x54617f]}),_0x59544c;}['_setupActionButtonExecution'](_0x52e501,_0x1b9a4a,_0x2479f4){_0x52e501['on']('execute',()=>{_0x1b9a4a['editing']['view']['focus'](),_0x1b9a4a['commands']['execute']('aiQuickAction',_0x2479f4);});}['_createActionGroupButton'](_0x3ffbf5,_0x480bb2,_0x4f3728){const _0x3e1b08=new _0x3f0116(this['locale']),_0x1bd2ad=new _0xa65920(),_0x52438a=new vs(this['locale'],_0x1bd2ad),_0x30eabc=_0x52438a['bindTemplate'],_0x1d7ebe=this['_getPanelKeystroke'](_0x4f3728),_0x5c31b8=this['_createGroupActionsList'](_0x3ffbf5,_0x480bb2['actions'],_0x4f3728);_0x52438a['set']({'label':_0x480bb2['label'],'withText':!0x0,'role':Ts,'icon':_0x480bb2['icon']??_0x157b90,'isEnabled':_0x480bb2['actions']['some'](_0x11c926=>_0x11c926['isEnabled'])}),_0x52438a['extendTemplate']({'on':{'mouseenter':_0x30eabc['to'](()=>{this['_isSearchFocused']()||_0x52438a['focus']();})}});const _0x1b7221=new _0x2ae23a(this['locale']);return _0x1b7221['extendTemplate']({'attributes':{'class':['ck','ck-reset_all','ck-ai-quick-actions-group-panel','ck-dropdown-menu__nested-menu__panel']},'on':{'keydown':_0x30eabc['to'](_0x58c4f1=>{this['_handlePanelKeydown'](_0x58c4f1,_0x1d7ebe,_0x52438a,_0x1b7221);})}}),_0x52438a['bind']('isOn')['to'](_0x1b7221,'isVisible'),this['_bodyCollection']['add'](_0x1b7221),_0x1b7221['content']['add'](_0x5c31b8),this['_setupGroupMenuBehavior'](_0x52438a,_0x1b7221),_0x3e1b08['children']['add'](_0x52438a),{'listItem':_0x3e1b08,'highlightView':_0x1bd2ad};}['_createGroupActionsList'](_0x2d0428,_0xb8a6ad,_0x22fa60){const _0x4a46c5=new _0x5bd1ba(this['locale']);return _0x4a46c5['extendTemplate']({'attributes':{'class':['ck','ck-reset_all','ck-ai-quick-actions-group-list','ck-dropdown-menu-list']}}),_0xb8a6ad['forEach'](_0x1db923=>{const _0x55049e=new _0x3f0116(this['locale']),_0x528023=ie({'editor':_0x2d0428,'action':_0x1db923,'withText':!0x0,'withIcon':!0x1,'isInDropdown':!0x0,'shouldPreventFocus':()=>this['_isSearchFocused']()})();_0x55049e['children']['add'](_0x528023),_0x22fa60['focusTracker']['add'](_0x528023),_0x4a46c5['items']['add'](_0x55049e);}),_0x4a46c5;}['_setupGroupMenuBehavior'](_0xf5d5b4,_0x3cd56d){const _0x4064f0=_0xf5d5b4['bindTemplate'],_0x4cc23f=this['_getButtonKeystroke'](_0xf5d5b4);_0xf5d5b4['extendTemplate']({'attributes':{'class':['ck-ai-quick-actions-group-button']},'on':{'mouseenter':_0x4064f0['to'](()=>{this['_showNestedPanel'](_0x3cd56d,_0xf5d5b4);}),'mouseleave':_0x4064f0['to'](_0x406c79=>{const _0x53157f=_0x406c79['relatedTarget'];this['_isMovingToNestedMenu'](_0x53157f,_0x3cd56d)||this['_hideNestedPanel'](_0x3cd56d);}),'keydown':_0x4064f0['to'](_0x5dca62=>{_0x5dca62['key']==_0x4cc23f&&(this['_showNestedPanel'](_0x3cd56d,_0xf5d5b4),_0x3cd56d['content']['get'](0x0)['focus']());})}}),_0x3cd56d['on']('render',()=>{_0x3cd56d['element']?.['addEventListener']('mouseleave',_0x52ccad=>{const _0xace7e0=_0x52ccad['relatedTarget'];_0xf5d5b4['element']?.['contains'](_0xace7e0)||this['_isMovingToNestedMenu'](_0xace7e0,_0x3cd56d)||this['_hideNestedPanel'](_0x3cd56d);});});}['_showNestedPanel'](_0x328795,_0xde407){this['_openNestedPanels']['forEach'](_0x1c8e04=>{_0x1c8e04!==_0x328795&&_0x1c8e04['isVisible']&&_0x1c8e04['hide']();}),_0x328795['show'](),_0x328795['pin']({'positions':[_0x3686ba['eastSouth']],'target':_0xde407['element'],'fitInViewport':!0x0}),this['_openNestedPanels']['add'](_0x328795);}['_hideNestedPanel'](_0x2e3607){_0x2e3607['hide'](),this['_openNestedPanels']['delete'](_0x2e3607);}['_hideAllNestedPanels'](){this['_openNestedPanels']['forEach'](_0x29179f=>_0x29179f['hide']()),this['_openNestedPanels']['clear']();}['_isMovingToNestedMenu'](_0x2447e5,_0x2c8026){if(!_0x2447e5)return!0x1;if(_0x2c8026['element']?.['contains'](_0x2447e5))return!0x0;const _0x22b564=_0x2447e5;return _0x22b564['closest']&&(null!==_0x22b564['closest']('.ck-ai-quick-actions-group-panel')||null!==_0x22b564['closest']('.ck-ai-quick-actions-group-list')||null!==_0x22b564['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'](_0x119dbe){return'rtl'===_0x119dbe['locale']['uiLanguageDirection']?'ArrowRight':'ArrowLeft';}['_getButtonKeystroke'](_0x469223){return'rtl'===_0x469223['locale']['uiLanguageDirection']?'ArrowLeft':'ArrowRight';}['_handlePanelKeydown'](_0xb295c8,_0xe9196f,_0xef8f76,_0x123411){_0xb295c8['key']==_0xe9196f&&(_0xef8f76['focus'](),this['_hideNestedPanel'](_0x123411));}['_handleSearchResultButtonClick'](_0xd4eb23){_0xd4eb23['fire']('execute');}}function ee(_0x12b33e){const {editor:_0x11d610,content:_0x535aa7,buttonDefinition:_0x629f19,bodyCollection:_0x410c8f,hasSearch:_0x3760de=!0x1}=_0x12b33e;return()=>{const _0x2472b6=_0x11d610['locale'],_0x1e4bf4=_0x2e287a(_0x2472b6);_0x1e4bf4['buttonView']['set']({'icon':_0x629f19['icon']??_0x157b90,'label':_0x629f19['label'],'tooltip':!0x0}),_0x1e4bf4['set']({'class':'ck-ai-quick-actions-dropdown'});const _0x1f22c9=new ao(_0x11d610,_0x535aa7,_0x1e4bf4,_0x410c8f,_0x3760de);if(_0x1e4bf4['panelView']['children']['add'](_0x1f22c9),_0x3760de){const _0x57d73e='ai-quick-actions-dropdown-selection';_0x1e4bf4['on']('change:isOpen',(_0x45843e,_0x139a1c,_0x38a68a)=>{if(_0x38a68a){if(_0x11d610['plugins']['has']('AIEditing')){const _0xe2dae8=_0x11d610['plugins']['get'](R),_0x55ca59=_0x11d610['model']['document']['selection'],_0x316aa6=Array['from'](_0x55ca59['getRanges']());_0x316aa6['length']>0x0&&_0xe2dae8['showFakeVisualSelection'](_0x316aa6,_0x57d73e,!0x1,!0x0);}}else _0x11d610['plugins']['has']('AIEditing')&&_0x11d610['plugins']['get'](R)['hideFakeVisualSelection'](_0x57d73e),_0x1f22c9['resetSearch']();});}return _0x1e4bf4;};}const oe='<task>For\x20given\x20selected\x20part\x20of\x20HTML\x20document\x20you\x20must\x20explain\x20the\x20meaning\x20of\x20it\x27s\x20content\x20clearly\x20and\x20in\x20plain\x20language.</task><rules>1.\x20Identify\x20what\x20type\x20of\x20text\x20it\x20is:-\x20If\x20it\x20looks\x20like\x20a\x20definition\x20explain\x20the\x20concept\x20in\x20simple\x20terms.-\x20If\x20it\x20looks\x20like\x20a\x20description\x20clarify\x20what\x20it\x20is\x20describing\x20and\x20why\x20it\x20matters.-\x20If\x20it\x20contains\x20technical\x20terms\x20or\x20jargon\x20break\x20them\x20down\x20into\x20everyday\x20language.-\x20If\x20it\x20looks\x20instructional\x20restate\x20as\x20clear\x20steps\x20someone\x20can\x20follow.-\x20If\x20it\x20provides\x20examples\x20explain\x20what\x20the\x20example\x20shows\x20and\x20why\x20it\x27s\x20relevant.-\x20If\x20it\x20presents\x20an\x20argument\x20or\x20claim\x20restate\x20the\x20claim\x20neutrally\x20and\x20explain\x20its\x20purpose.-\x20If\x20it\x20is\x20narrative/story-like\x20explain\x20what\x20event\x20or\x20situation\x20is\x20being\x20described.-\x20If\x20it\x20is\x20data-driven\x20(stats,\x20figures,\x20facts)\x20explain\x20what\x20the\x20data\x20indicates.-\x20If\x20it\x20is\x20a\x20quotation\x20explain\x20the\x20meaning\x20of\x20the\x20quote\x20in\x20context.-\x20If\x20it\x20compares/contrasts\x20things\x20explain\x20the\x20key\x20differences\x20or\x20similarities\x20simply.-\x20If\x20it\x20does\x20not\x20fit\x20any\x20of\x20the\x20categories\x20above\x20give\x20a\x20clear,\x20plain-language\x20explanation\x20of\x20its\x20meaning,\x20focusing\x20on\x20usefulness.2.\x20Provide\x20context\x20if\x20the\x20meaning\x20could\x20be\x20unclear\x20without\x20it.\x20(e.g.,\x20explain\x20where\x20such\x20a\x20term\x20might\x20be\x20used,\x20or\x20why\x20it\x20is\x20important).3.\x20Keep\x20the\x20explanation\x20short\x20but\x20complete\x20(2–5\x20sentences).Avoid\x20overly\x20technical\x20detail\x20unless\x20it\x20is\x20necessary\x20for\x20understanding.4.\x20Do\x20not\x20simply\x20repeat\x20the\x20original\x20text\x20—\x20restate\x20and\x20expand\x20it\x20in\x20plain\x20words.5.\x20If\x20possible,\x20add\x20a\x20short\x20example\x20or\x20analogy\x20to\x20make\x20it\x20easier\x20to\x20understand.6.\x20Use\x20the\x20context\x20of\x20the\x20whole\x20document,\x20but\x20focus\x20on\x20the\x20selected\x20part\x20when\x20creating\x20your\x20explanation.7.\x20Your\x20explanation\x20should\x20be\x20written\x20in\x20%0\x20language.</rules><constraints>1.\x20You\x20MUST\x20NOT\x20perform\x20any\x20edits\x20or\x20modifications\x20on\x20provided\x20document.2.\x20You\x20MUST\x20NOT\x20include\x20document\x20modifications\x20in\x20your\x20response.3.\x20Your\x20message\x20should\x20only\x20include\x20explanation.\x20Do\x20not\x20add\x20any\x20additional\x20text,\x20flattery,\x20questions\x20or\x20followup\x20suggestions.</constraints>',ae='<task>For\x20the\x20given\x20selected\x20part\x20of\x20an\x20HTML\x20document\x20you\x20must\x20summarize\x20its\x20content\x20in\x20a\x20few\x20sentences,\x20keeping\x20only\x20the\x20essential\x20meaning.</task><rules>1.\x20Your\x20summary\x20should\x20be\x20short\x20and\x20clear:-\x20Aim\x20for\x202–4\x20sentences\x20unless\x20the\x20text\x20is\x20extremely\x20short.-\x20Focus\x20on\x20capturing\x20the\x20main\x20idea(s)\x20without\x20unnecessary\x20detail.2.\x20Identify\x20what\x20type\x20of\x20text\x20it\x20is\x20and\x20adapt\x20the\x20summary\x20style:-\x20If\x20it\x20is\x20descriptive\x20condense\x20the\x20description\x20into\x20its\x20core\x20idea.-\x20If\x20it\x20is\x20argumentative\x20or\x20opinion-based\x20summarize\x20the\x20main\x20claim\x20and\x20reasoning\x20neutrally.-\x20If\x20it\x20is\x20narrative/story-like\x20capture\x20the\x20main\x20event\x20or\x20outcome\x20without\x20side\x20details.-\x20If\x20it\x20is\x20data-driven\x20(stats,\x20figures,\x20facts)\x20summarize\x20what\x20the\x20data\x20shows\x20in\x20plain\x20language.-\x20If\x20it\x20is\x20instructional\x20restate\x20the\x20overall\x20purpose\x20of\x20the\x20steps\x20without\x20listing\x20every\x20step.-\x20If\x20it\x20does\x20not\x20fit\x20any\x20of\x20the\x20categories\x20above\x20provide\x20a\x20general\x20concise\x20summary.3.\x20Provide\x20context\x20if\x20necessary\x20for\x20clarity:-\x20Mention\x20the\x20subject\x20or\x20topic\x20explicitly\x20so\x20the\x20summary\x20can\x20stand\x20alone.4.\x20Do\x20not\x20simply\x20copy\x20sentences\x20from\x20the\x20original\x20text\x20—\x20rephrase\x20in\x20plain\x20language.5.\x20Avoid\x20adding\x20new\x20information\x20or\x20interpretation\x20not\x20present\x20in\x20the\x20text.6.\x20Summarize\x20in\x20a\x20way\x20that\x20would\x20make\x20sense\x20to\x20someone\x20who\x20has\x20not\x20read\x20the\x20original\x20text.7.\x20Use\x20the\x20context\x20of\x20the\x20whole\x20document,\x20but\x20focus\x20on\x20the\x20selected\x20part\x20when\x20creating\x20your\x20summary.8.\x20Your\x20summary\x20should\x20be\x20written\x20in\x20%0\x20language.</rules><constraints>1.\x20You\x20MUST\x20NOT\x20perform\x20any\x20edits\x20or\x20modifications\x20on\x20the\x20provided\x20document.2.\x20You\x20MUST\x20NOT\x20include\x20document\x20modifications\x20in\x20your\x20response.3.\x20Your\x20message\x20should\x20only\x20include\x20the\x20summary.\x20Do\x20not\x20add\x20any\x20additional\x20text,\x20flattery,\x20questions\x20or\x20followup\x20suggestions.</constraints>',se='<task>For\x20the\x20given\x20selected\x20part\x20of\x20an\x20HTML\x20document\x20you\x20must\x20extract\x20and\x20present\x20the\x20key\x20points\x20from\x20its\x20content.</task><rules>1.\x20Present\x20the\x20output\x20as\x20a\x20clear,\x20structured\x20list\x20(bullets\x20or\x20numbered).-\x20Each\x20point\x20should\x20be\x20concise\x20(one\x20sentence\x20or\x20less).-\x20Do\x20not\x20merge\x20distinct\x20ideas\x20into\x20one\x20bullet.2.\x20Identify\x20what\x20type\x20of\x20text\x20it\x20is\x20and\x20adapt\x20the\x20extraction\x20style:-\x20If\x20it\x20is\x20descriptive\x20capture\x20the\x20main\x20attributes\x20or\x20features.-\x20If\x20it\x20is\x20argumentative\x20extract\x20the\x20main\x20claim\x20and\x20supporting\x20reasons\x20separately.-\x20If\x20it\x20is\x20narrative/story-like\x20extract\x20the\x20main\x20events\x20in\x20chronological\x20order.-\x20If\x20it\x20is\x20data-driven\x20(stats,\x20figures,\x20facts)\x20highlight\x20the\x20most\x20important\x20facts\x20or\x20numbers.-\x20If\x20it\x20is\x20instructional\x20list\x20the\x20steps\x20or\x20main\x20actions\x20in\x20simplified\x20form.-\x20If\x20it\x20provides\x20comparisons\x20extract\x20the\x20contrasted\x20items\x20and\x20their\x20differences/similarities.-\x20If\x20it\x20does\x20not\x20fit\x20any\x20category\x20above\x20extract\x20the\x20main\x20ideas\x20in\x20plain,\x20short\x20statements.3.\x20Keep\x20the\x20list\x20between\x203–7\x20items\x20where\x20possible.-\x20If\x20the\x20text\x20is\x20very\x20short,\x20fewer\x20items\x20are\x20fine.-\x20If\x20it\x20is\x20very\x20long,\x20focus\x20on\x20the\x20most\x20important\x20ideas\x20only.4.\x20Do\x20not\x20copy\x20long\x20text\x20fragments\x20—\x20restate\x20in\x20simple\x20words.5.\x20Do\x20not\x20add\x20interpretation,\x20evaluation,\x20or\x20commentary\x20beyond\x20the\x20text.6.\x20Ensure\x20the\x20list\x20can\x20stand\x20alone\x20without\x20requiring\x20the\x20reader\x20to\x20see\x20the\x20original\x20document.7.\x20Use\x20the\x20context\x20of\x20the\x20whole\x20document,\x20but\x20focus\x20on\x20the\x20selected\x20part\x20when\x20creating\x20your\x20key\x20points.8.\x20Your\x20key\x20points\x20should\x20be\x20written\x20in\x20%0\x20language.</rules><constraints>1.\x20You\x20MUST\x20NOT\x20perform\x20any\x20edits\x20or\x20modifications\x20on\x20the\x20provided\x20document.2.\x20You\x20MUST\x20NOT\x20include\x20document\x20modifications\x20in\x20your\x20response.3.\x20Your\x20message\x20should\x20only\x20include\x20the\x20extracted\x20key\x20points.\x20Do\x20not\x20add\x20any\x20additional\x20text,\x20flattery,\x20questions\x20or\x20followup\x20suggestions.</constraints>';var Gt=function(_0x3798c0){return _0x3798c0['CHAT']='CHAT',_0x3798c0['ACTION']='ACTION',_0x3798c0['REVIEW']='REVIEW',_0x3798c0;}({}),Ua=function(_0x21a657){return _0x21a657['CHAT']='AIChat',_0x21a657['ACTION']='AIActions',_0x21a657['REVIEW']='AIReviewMode',_0x21a657;}({});class ii extends _0x346ac8{static get['requires'](){return[_0x5a3ac9];}static get['pluginName'](){return'AIQuickActionsUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}async['init'](){const _0xaf9407=await this['_getDefaultAndCustomActions']();this['_prepareQuickActionsDefinition'](_0xaf9407),this['_initializeQuickActionsComponentsAndCommands']();}static['getDefaultQuickActions'](_0x2e33ad){return function(_0x4e0da2){const _0x1a9510=new Intl['DisplayNames'](['en'],{'type':'language'})['of'](_0x4e0da2['uiLanguage']),_0x57b199=_0x1a9510||'English',_0x361ce6=[{'id':'ask-ai','displayedPrompt':i(_0x4e0da2,'AI_QUICK_ACTIONS_ASK_AI'),'type':'CHAT','icon':Bt},{'id':'chat-commands','label':i(_0x4e0da2,'AI_QUICK_ACTIONS_CHAT_COMMANDS'),'icon':Bt,'actions':[{'id':'explain','displayedPrompt':i(_0x4e0da2,'AI_QUICK_ACTIONS_EXPLAIN'),'prompt':oe['replace']('%0',_0x57b199),'type':'CHAT'},{'id':'summarize','displayedPrompt':i(_0x4e0da2,'AI_QUICK_ACTIONS_SUMMARIZE'),'prompt':ae['replace']('%0',_0x57b199),'type':'CHAT'},{'id':'highlight-key-points','displayedPrompt':i(_0x4e0da2,'AI_QUICK_ACTIONS_HIGHLIGHT_KEY_POINTS'),'prompt':se['replace']('%0',_0x57b199),'type':'CHAT'}]},{'id':'improve-writing','displayedPrompt':i(_0x4e0da2,'AI_QUICK_ACTIONS_IMPROVE_WRITING'),'type':'ACTION','icon':Xt},{'id':'continue','displayedPrompt':i(_0x4e0da2,'AI_QUICK_ACTIONS_CONTINUE_WRITING'),'type':'ACTION','icon':Jt},{'id':'fix-grammar','displayedPrompt':i(_0x4e0da2,'AI_QUICK_ACTIONS_FIX_GRAMMAR_SPELLING'),'type':'ACTION','icon':Vt},{'id':'adjust-length','label':i(_0x4e0da2,'AI_QUICK_ACTIONS_ADJUST_LENGTH'),'icon':Kt,'actions':[{'id':'make-shorter','displayedPrompt':i(_0x4e0da2,'AI_QUICK_ACTIONS_MAKE_SHORTER'),'type':'ACTION'},{'id':'make-longer','displayedPrompt':i(_0x4e0da2,'AI_QUICK_ACTIONS_MAKE_LONGER'),'type':'ACTION'}]},{'id':'change-tone','label':i(_0x4e0da2,'AI_QUICK_ACTIONS_CHANGE_TONE'),'icon':Wt,'actions':[{'id':'make-tone-casual','displayedPrompt':i(_0x4e0da2,'AI_QUICK_ACTIONS_MORE_CASUAL'),'type':'ACTION'},{'id':'make-tone-direct','displayedPrompt':i(_0x4e0da2,'AI_QUICK_ACTIONS_MORE_DIRECT'),'type':'ACTION'},{'id':'make-tone-friendly','displayedPrompt':i(_0x4e0da2,'AI_QUICK_ACTIONS_MORE_FRIENDLY'),'type':'ACTION'},{'id':'make-tone-confident','displayedPrompt':i(_0x4e0da2,'AI_QUICK_ACTIONS_MORE_CONFIDENT'),'type':'ACTION'},{'id':'make-tone-professional','displayedPrompt':i(_0x4e0da2,'AI_QUICK_ACTIONS_MORE_PROFESSIONAL'),'type':'ACTION'}]},{'id':'translate','label':i(_0x4e0da2,'AI_QUICK_ACTIONS_TRANSLATE'),'icon':te,'actions':[{'id':'translate-to-english','displayedPrompt':i(_0x4e0da2,'AI_QUICK_ACTIONS_TRANSLATE_ENGLISH'),'type':'ACTION','actionName':'translate','args':{'language':'english'}},{'id':'translate-to-chinese','displayedPrompt':i(_0x4e0da2,'AI_QUICK_ACTIONS_TRANSLATE_CHINESE'),'type':'ACTION','actionName':'translate','args':{'language':'chinese'}},{'id':'translate-to-spanish','displayedPrompt':i(_0x4e0da2,'AI_QUICK_ACTIONS_TRANSLATE_SPANISH'),'type':'ACTION','actionName':'translate','args':{'language':'spanish'}},{'id':'translate-to-german','displayedPrompt':i(_0x4e0da2,'AI_QUICK_ACTIONS_TRANSLATE_GERMAN'),'type':'ACTION','actionName':'translate','args':{'language':'german'}},{'id':'translate-to-french','displayedPrompt':i(_0x4e0da2,'AI_QUICK_ACTIONS_TRANSLATE_FRENCH'),'type':'ACTION','actionName':'translate','args':{'language':'french'}},{'id':'translate-to-japanese','displayedPrompt':i(_0x4e0da2,'AI_QUICK_ACTIONS_TRANSLATE_JAPANESE'),'type':'ACTION','actionName':'translate','args':{'language':'japanese'}},{'id':'translate-to-portuguese','displayedPrompt':i(_0x4e0da2,'AI_QUICK_ACTIONS_TRANSLATE_PORTUGUESE'),'type':'ACTION','actionName':'translate','args':{'language':'portuguese'}},{'id':'translate-to-korean','displayedPrompt':i(_0x4e0da2,'AI_QUICK_ACTIONS_TRANSLATE_KOREAN'),'type':'ACTION','actionName':'translate','args':{'language':'korean'}},{'id':'translate-to-italian','displayedPrompt':i(_0x4e0da2,'AI_QUICK_ACTIONS_TRANSLATE_ITALIAN'),'type':'ACTION','actionName':'translate','args':{'language':'italian'}},{'id':'translate-to-russian','displayedPrompt':i(_0x4e0da2,'AI_QUICK_ACTIONS_TRANSLATE_RUSSIAN'),'type':'ACTION','actionName':'translate','args':{'language':'russian'}}]},{'id':'other','label':i(_0x4e0da2,'AI_QUICK_ACTIONS_OTHER'),'icon':Zt,'actions':[]}];return _0x361ce6;}(_0x2e33ad);}async['_getDefaultAndCustomActions'](){const _0x1e1cec=ii['getDefaultQuickActions'](this['editor']['locale']),_0xbe1c00=this['editor']['config']['get']('ai.quickActions.extraCommands')||[];let _0x4dc8ec=[];try{_0x4dc8ec=await new At({'connector':this['editor']['plugins']['get']('AIConnector'),'availableModels':this['editor']['config']['get']('ai.chat.models.displayedModels'),'locale':this['editor']['locale']})['getAvailableModels']();}catch(_0x5b05e1){const _0x449e07=new _0x36b126('ai-quick-actions-models-unable-to-retrieve',this,{'error':_0x5b05e1});ft(_0x449e07['message']);}finally{const _0x372136=_0xbe1c00['map'](_0x2a9174=>({..._0x2a9174,'icon':void 0x0}));_0x1e1cec['find'](_0x43c002=>'other'===_0x43c002['id'])['actions']['push'](..._0x372136),_0x1e1cec['forEach'](_0x43ac9f=>{if('actions'in _0x43ac9f)_0x43ac9f['actions']['forEach'](_0x338bb8=>{if(_0x338bb8['isEnabled']=!!_0x4dc8ec['find'](_0x40f0bd=>_0x40f0bd['id']===_0x338bb8['model'])||void 0x0===_0x338bb8['model'],!_0x338bb8['isEnabled']){const _0x57621d=new _0x36b126('ai-quick-actions-unavailable-model',this,{'actionId':_0x338bb8['id'],'modelId':_0x338bb8['model']});ft(_0x57621d['message']);}});else{if(_0x43ac9f['isEnabled']=!!_0x4dc8ec['find'](_0x5ab8cc=>_0x5ab8cc['id']===_0x43ac9f['model'])||void 0x0===_0x43ac9f['model'],!_0x43ac9f['isEnabled']){const _0x3ebbc6=new _0x36b126('ai-quick-actions-unavailable-model',this,{'actionId':_0x43ac9f['id'],'modelId':_0x43ac9f['model']});ft(_0x3ebbc6['message']);}}});}return _0x1e1cec;}['_initializeQuickActionsComponentsAndCommands'](){const _0x7fd204=new _0x44dc72(this['editor']['locale']);_0x7fd204['attachToDom'](),this['_initializeQuickActionsDropdown'](_0x7fd204),this['_initializeQuickActionsMenuBar'](),this['_initializeQuickActionsComponents'](_0x7fd204);}['_initializeQuickActionsDropdown'](_0x52d553){const _0x27911f=this['editor']['config']['get']('ai.quickActions.isSearchEnabled')??!0x0;this['editor']['ui']['componentFactory']['add']('aiQuickActions',ee({'editor':this['editor'],'content':this['_quickActionsDefinition'],'buttonDefinition':{'icon':_0x157b90,'label':i(this['editor']['locale'],'AI_QUICK_ACTIONS_HEADING')},'bodyCollection':_0x52d553,'hasSearch':_0x27911f}));}['_prepareQuickActionsDefinition'](_0x270498){this['_quickActionsDefinition']=_0x270498['map'](_0x5181f7=>{if('actions'in _0x5181f7){const _0x319d50=_0x5181f7;return{..._0x319d50,'actions':_0x319d50['actions']['map'](_0x57782d=>{const {actions:_0x56bc5c,..._0x385bcb}=_0x319d50;return{..._0x57782d,'parent':_0x385bcb};})['filter'](_0x2dd217=>this['_shouldIncludeAction'](_0x2dd217))};}return _0x5181f7;})['filter'](_0x567ed0=>'actions'in _0x567ed0?_0x567ed0['actions']['length']>0x0:this['_shouldIncludeAction'](_0x567ed0));}['_shouldIncludeAction'](_0x3640ad){const _0x2b0988=this['editor']['config']['get']('ai.quickActions.removeCommands')||[];return this['editor']['plugins']['has'](Ua[_0x3640ad['type']])&&!_0x2b0988['includes'](_0x3640ad['id'])&&!('CHAT'===_0x3640ad['type']&&!0x1===this['editor']['config']['get']('ai.chat.context.document.enabled'));}['_initializeQuickActionsComponents'](_0x3bb302){this['_quickActionsDefinition']['forEach'](_0x382ba2=>{if('actions'in _0x382ba2){const _0x2f0a38=ee({'editor':this['editor'],'content':_0x382ba2['actions'],'buttonDefinition':_0x382ba2,'bodyCollection':_0x3bb302});this['editor']['ui']['componentFactory']['add'](_0x382ba2['id'],_0x2f0a38),_0x382ba2['actions']['forEach'](_0x7b160d=>{const _0x4e90d6=ie({'editor':this['editor'],'action':_0x7b160d});this['editor']['ui']['componentFactory']['add'](_0x7b160d['id'],_0x4e90d6);});}else{const _0xf6ac5f=ie({'editor':this['editor'],'action':_0x382ba2,'withText':!0x1,'withIcon':!0x0,'isInDropdown':!0x1});this['editor']['ui']['componentFactory']['add'](_0x382ba2['id'],_0xf6ac5f);}});}['_initializeQuickActionsMenuBar'](){this['editor']['ui']['componentFactory']['add']('menuBar:aiQuickActions',_0x5f32eb=>{const _0x47e492=new _0x44a9af(_0x5f32eb),_0x3f7f79=i(_0x5f32eb,'AI_QUICK_ACTIONS_HEADING');_0x47e492['buttonView']['set']({'label':_0x3f7f79,'icon':_0x157b90});const _0x1a527a=new _0x32dd81(_0x5f32eb);_0x1a527a['set']({'ariaLabel':_0x3f7f79,'role':'menu'}),this['_quickActionsDefinition']['forEach'](_0x422350=>{if('actions'in _0x422350){const _0xafb27c=_0x422350,_0x82ed1=new _0x53ce29(_0x5f32eb,_0x47e492),_0x1e120d=new _0x44a9af(_0x5f32eb),_0x5e371c=new _0x32dd81(_0x5f32eb);_0x1e120d['buttonView']['set']({'label':_0xafb27c['label'],'icon':_0xafb27c['icon']}),_0xafb27c['actions']['forEach'](_0x53569e=>{const _0x1c9bae=new _0x53ce29(_0x5f32eb,_0x1e120d),_0x2349f6=new _0x3ce5a8(_0x5f32eb);_0x2349f6['set']({'label':_0x53569e['displayedPrompt'],'icon':_0x53569e['icon'],'role':'menuitem','isEnabled':_0x53569e['isEnabled']}),_0x2349f6['on']('execute',()=>{this['_executeQuickAction'](_0x53569e);}),_0x2349f6['delegate']('execute')['to'](_0x1e120d),_0x1c9bae['children']['add'](_0x2349f6),_0x5e371c['items']['add'](_0x1c9bae);}),_0x1e120d['panelView']['children']['add'](_0x5e371c),_0x82ed1['children']['add'](_0x1e120d),_0x1a527a['items']['add'](_0x82ed1);}else{const _0x134526=_0x422350,_0x2f7df1=new _0x53ce29(_0x5f32eb,_0x47e492),_0x647f34=new _0x3ce5a8(_0x5f32eb);_0x647f34['set']({'label':_0x134526['displayedPrompt'],'icon':_0x134526['icon'],'role':'menuitem','isEnabled':_0x134526['isEnabled']}),_0x647f34['on']('execute',()=>{this['_executeQuickAction'](_0x134526);}),_0x647f34['delegate']('execute')['to'](_0x47e492),_0x2f7df1['children']['add'](_0x647f34),_0x1a527a['items']['add'](_0x2f7df1);}});const _0xdc83bc=Object['values'](Ua)['some'](_0x356c2c=>this['editor']['plugins']['has'](_0x356c2c));return _0x47e492['set']({'isEnabled':_0xdc83bc}),_0x47e492['panelView']['children']['add'](_0x1a527a),_0x47e492;});}['_executeQuickAction'](_0x51c11){const _0x3f18ad=this['editor'];_0x3f18ad['editing']['view']['focus'](),_0x3f18ad['commands']['execute']('aiQuickAction',_0x51c11);const _0xff6829=_0x3f18ad['ui']['view']['menuBarView'];_0xff6829&&_0xff6829['close']&&_0xff6829['close']();}}class ci extends Qt{['execute'](_0x2bbf68){switch(this['_expandSelectionIfCollapsed'](),_0x2bbf68['type']){case Gt['CHAT']:if(!this['editor']['plugins']['has']('AIChat')){const _0x1d2054=i(this['editor']['locale'],'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND','AIChat');throw new _0x36b126('ai-quick-actions-plugin-not-found',this['editor'],{'errorMessage':_0x1d2054});}this['_handleAIChatAction'](_0x2bbf68);break;case Gt['ACTION']:if(!this['editor']['plugins']['has']('AIActions')){const _0x3d16fc=i(this['editor']['locale'],'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND','AIActions');throw new _0x36b126('ai-quick-actions-plugin-not-found',this['editor'],{'errorMessage':_0x3d16fc});}this['_handleAIActionsAction'](_0x2bbf68);break;case Gt['REVIEW']:if(!this['editor']['plugins']['has']('AIReviewMode')){const _0x506e1c=i(this['editor']['locale'],'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND','AIReviewMode');throw new _0x36b126('ai-quick-actions-plugin-not-found',this['editor'],{'errorMessage':_0x506e1c});}this['_handleAIReviewAction'](_0x2bbf68);}}async['_handleAIChatAction'](_0x1c6497){const _0x4696cd=this['editor']['plugins']['get']('AIChat'),_0x38db8a=this['editor']['plugins']['get']('AIChatController'),_0x4d8c23=this['editor']['plugins']['get']('AITabs')['view'];if(_0x4d8c23['isVisible']||(_0x4d8c23['isVisible']=!0x0),'chat'!==_0x4d8c23['activeTab']&&_0x4d8c23['activateTab']('chat'),'ask-ai'===_0x1c6497['id'])_0x38db8a['removeSelectionFromChatContext'](),await _0x4696cd['addSelectionToChatContext'](),_0x4696cd['focusPromptInput']();else await _0x4696cd['startConversation'](),_0x38db8a['removeSelectionFromChatContext'](),await _0x4696cd['addSelectionToChatContext'](),_0x4696cd['focusPromptInput'](),await _0x4696cd['sendMessage']({'message':_0x1c6497['prompt']||_0x1c6497['displayedPrompt'],'quickActionData':{'id':_0x1c6497['id'],'displayedPrompt':_0x1c6497['displayedPrompt']}});}['_expandSelectionIfCollapsed'](){const _0x2952c3=this['editor'],_0xd4d6b0=_0x2952c3['model']['document']['selection'];if(!_0xd4d6b0['isCollapsed'])return;const _0x532b1d=_0x165b43(_0xd4d6b0['getSelectedBlocks']())||_0x2952c3['model']['schema']['getLimitElement'](_0xd4d6b0);_0x2952c3['model']['change'](_0x315c2b=>{_0x315c2b['setSelection'](_0x532b1d,'in');});}['_handleAIActionsActionLabel'](_0x4274af){return _0x4274af['parent']?.['label']&&'other'!==_0x4274af['parent']?.['id']?_0x4274af['parent']['label']+':\x20'+_0x4274af['displayedPrompt']:_0x4274af['displayedPrompt'];}async['_handleAIActionsAction'](_0x1be2a0){const _0x3ddecb=this['editor']['plugins']['get']('AIActions'),_0x4612f7=_0x1be2a0['prompt']?{'userMessage':_0x1be2a0['prompt'],'model':_0x1be2a0['model']}:{'actionName':_0x1be2a0['actionName']||_0x1be2a0['id'],'args':_0x1be2a0['args']},_0x84a91e=this['_handleAIActionsActionLabel'](_0x1be2a0);await _0x3ddecb['executeAction'](_0x4612f7,_0x84a91e,_0x1be2a0['icon']);}async['_handleAIReviewAction'](_0x1517e3){console['log']('handleAIReviewAction',_0x1517e3);}}class ti extends _0x346ac8{static get['pluginName'](){return'AIQuickActionsEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x2076a0=this['editor'],_0x436018=new ci(this['editor']);if(_0x2076a0['commands']['add']('aiQuickAction',_0x436018),_0x2076a0['plugins']['has']('AIChat')){const _0x110db2=this['editor']['plugins']['get']('AIChat');_0x2076a0['model']['document']['selection']['on']('change:range',(_0x53f373,_0x46fe77)=>{_0x46fe77['directChange']&&_0x110db2['removeSelectionFromChatContext']();});}}}class Ae extends Ge{['updateChangeGroups'](){if(this['parsedMergedContent']=this['parsedContent']['cloneNode'](!0x0),0x0==this['parsedMergedContent']['childNodes']['length'])return void(this['changeGroups']=[]);const _0x37b459=this['documentContextContent']['children']['map'](_0x23f536=>({'node':_0x23f536,'id':vt(_0x23f536,'data-id')})),_0x1b981c=this['parsedMergedContent']['children']['map'](_0x54e504=>({'node':_0x54e504,'id':vt(_0x54e504,'data-id')||_0xdc126c()})),_0x10ba9e=_0xbfd009(_0x37b459,_0x1b981c,{'comparator':(_0x456978,_0x3d52a8)=>_0x456978['id']==_0x3d52a8['id'],'oneChangePerToken':!0x0});if(!this['isDone']){for(;_0x10ba9e['length']&&_0x10ba9e[_0x10ba9e['length']-0x1]['removed'];)_0x10ba9e['pop']();}const _0x3f3089=_0x10ba9e['map'](_0x2cb13c=>{const _0x39fc08=_0x2cb13c['added']?'new':_0x2cb13c['removed']?'removed':'modified';return{'node':_0x2cb13c['value'][0x0]['node'],'type':_0x39fc08,'id':_0x2cb13c['value'][0x0]['id']};});this['changeGroups']=[{'changes':_0x3f3089,'state':'pending','index':0x0}];}['_getDifferentChangeGroups'](_0xe2c45a,_0x3115e2){return _0x3115e2;}}class V extends xe{['content'];['version'];['actionName'];['args'];['userMessage'];['model'];['hasError']=!0x1;constructor(_0x20641e){super(_0x20641e),this['content']=_0x20641e['content'],this['version']=_0x20641e['version'],this['actionName']=_0x20641e['actionName'],this['args']=_0x20641e['args'],this['userMessage']=_0x20641e['userMessage'],this['model']=_0x20641e['model'];}async['sendRequest'](){return this['actionName']?this['connector']['executeAction']({'content':this['content'],'actionName':this['actionName'],'args':this['args']}):this['connector']['executeCustomAction']({'content':this['content'],'message':this['userMessage'],'model':this['model'],'outputFormat':'html'});}['getDocumentContext'](){return{'type':je['TEXT'],'content':this['content'],'version':this['version'],'label':'Current\x20document','uiId':'current-document'};}['createReply'](_0x1a7cb3){const _0xe3745f=new Ae({'editor':this['editor'],'documentContextContent':this['content'],..._0x1a7cb3});return this['replies']['push'](_0xe3745f),_0xe3745f['delegate'](...Ce)['to'](this),this['fire']('replyCreated',_0xe3745f),_0xe3745f;}}class ri extends _0x346ac8{static get['requires'](){return[S,_0xe646c5,R,H,_0x2dc9e7];}static get['pluginName'](){return'AIActions';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['_aiConnector'];['_interactions']=[];['_currentInteractionIndex']=0x0;['_interactionParams'];['_balloonShowDiff']=!0x1;['_customViews']=new _0x317ee8();['_navigationPreviousButton'];['_navigationCounter'];['_isNavigationCounterInView']=!0x1;['_navigationNextButton'];['_isNavigationPreviousButtonInView']=!0x1;['_isNavigationNextButtonInView']=!0x1;['_promiseQueue'];['_bodyCollection'];get['_interaction'](){return this['_interactions'][this['_interactions']['length']-0x1];}constructor(_0x19846f){super(_0x19846f),this['_bodyCollection']=new _0x44dc72(this['editor']['locale']),this['_bodyCollection']['attachToDom'](),this['_aiConnector']=this['editor']['plugins']['get']('AIConnector'),this['set']('isBusy',!0x1),this['_promiseQueue']=new W(),this['_setupCustomViews']();}['stopInteraction'](){this['_stopInteraction']();}async['executeAction'](_0x18c36e,_0x512aba,_0x3f0efd){if(this['editor']['plugins']['has']('TableSelection')){if(this['editor']['plugins']['get']('TableSelection')['getSelectedTableCells']()){const {modelFragment:_0x2f7994,anchorData:_0x1ac6e2}=this['_getExecuteDataInTable']();return this['_executeAction'](_0x18c36e,_0x2f7994,_0x1ac6e2,_0x512aba,_0x3f0efd);}}const {modelFragment:_0x1e6f8c,anchorData:_0xd32317}=this['_getExecuteDataRegular']();return this['_executeAction'](_0x18c36e,_0x1e6f8c,_0xd32317,_0x512aba,_0x3f0efd);}['destroy'](){this['_bodyCollection']['detachFromDom'](),super['destroy']();}['_getExecuteDataRegular'](){const _0x2aa4f3=this['editor']['model']['document']['selection'];if(_0x2aa4f3['isCollapsed']){const _0x5bfc43=_0x165b43(_0x2aa4f3['getSelectedBlocks']())||this['editor']['model']['schema']['getLimitElement'](_0x2aa4f3);this['editor']['model']['change'](_0x449845=>{_0x449845['setSelection'](_0x5bfc43,'in');});}const _0x348d31=_0x2aa4f3['getFirstRange'](),_0x52da76=this['_wrapWithCommonAncestors'](this['editor']['model']['getSelectedContent'](_0x2aa4f3),_0x348d31['start'],_0x348d31['end']),_0x3fed0f=_0x2aa4f3['getFirstRange']()['start'],_0x5a83ff=new Map();let _0x530df0=_0x52da76;for(let _0x507e04=0x0;_0x507e04<_0x3fed0f['path']['length'];_0x507e04++)_0x5a83ff['set'](_0x530df0,_0x3fed0f['path'][_0x507e04]),_0x530df0=_0x530df0['getChild'](0x0);return{'modelFragment':_0x52da76,'anchorData':_0x5a83ff};}['_getExecuteDataInTable'](){const _0x3d175c=this['editor']['model']['document']['selection'],_0x534d73=this['editor']['plugins']['get']('TableSelection')['getSelectionAsFragment'](),_0x51f426=_0x3d175c['getFirstRange']()['start']['parent']['parent'],_0x9bd2c7=this['_wrapWithCommonAncestors'](_0x534d73,this['editor']['model']['createPositionBefore'](_0x51f426),this['editor']['model']['createPositionAfter'](_0x51f426)),_0x5dd8d7=_0x3d175c['getFirstRange']()['start'],_0x478a24=new Map();let _0x575079=_0x9bd2c7;for(let _0x1e333d=0x0;_0x1e333d<_0x5dd8d7['path']['length'];_0x1e333d++)if(_0x478a24['set'](_0x575079,_0x5dd8d7['path'][_0x1e333d]),_0x1e333d<_0x5dd8d7['path']['length']-0x1)_0x575079=_0x575079['getChild'](0x0);else{let _0x1841d5=_0x575079['nextSibling'];for(;_0x1841d5;)_0x478a24['set'](_0x1841d5,_0x5dd8d7['path'][_0x1e333d]),_0x1841d5=_0x1841d5['nextSibling'];}return{'modelFragment':_0x9bd2c7,'anchorData':_0x478a24};}['_executeAction'](_0x32c400,_0x5c6cfc,_0x46177e,_0x3814d6,_0x332940){const _0x156bd8=this['editor']['plugins']['get'](R),_0x115fea=this['editor']['plugins']['get'](H),_0x2b9664=this['editor']['model']['document']['selection'],_0x37efd6=_0x156bd8['modelToViewWithIds'](_0x5c6cfc),_0x37e8e0=this['editor']['data']['processor']['toData'](_0x37efd6),_0x969143=this['editor']['model']['document']['version'],_0x4af74c=[..._0x2b9664['getRanges']()];let _0x244187=this['editor']['config']['get']('ai.availableReplyActions')||[...et];this['editor']['plugins']['has']('TrackChanges')||(_0x244187=_0x244187['filter'](_0x2d1d92=>'insertSuggestion'!=_0x2d1d92));const _0x2e48cf=new T(this['editor']['locale'],{'showDiff':!0x1,'areActionsDisabled':!0x1,'hideHeader':!0x0,'showLoader':!0x0,'miniToolbarConfig':{'showChanges':'icon','customView':this['_customViews']},'showUnchangedParts':!0x0,'availableActions':_0x244187},this['_bodyCollection']);return _0x115fea['open']({'index':0x3e8*Math['random']()%0x3e8,'title':_0x3814d6,'icon':_0x332940||_0x157b90,'mainView':_0x2e48cf,'showRotator':!0x1,'showApplyButton':!0x0,'showSuggestButton':this['editor']['plugins']['has']('TrackChanges'),'ranges':_0x4af74c}),this['_setLoadingState'](_0x2e48cf,_0x115fea),this['listenTo'](_0x115fea,'applySuggestion',()=>{this['_applyChanges'](_0x5c6cfc,_0x46177e,!0x1);}),this['listenTo'](_0x115fea,'insertSuggestion',()=>{this['_applyChanges'](_0x5c6cfc,_0x46177e,!0x0);}),this['listenTo'](_0x115fea,'selectionRemoved',()=>{this['_stopInteraction'](),this['_disableCustomViews']();}),this['listenTo'](_0x115fea,'dialogClosed',()=>{if(this['_interaction']&&this['_interaction']['replies']['length']>0x0){const _0x3a09a8=this['_interaction']['replies'][this['_interaction']['replies']['length']-0x1],_0x336f4c=_0x3a09a8['changeGroups'][0x0];_0x336f4c&&'pending'===_0x336f4c['state']&&_0x3a09a8['setChangeGroupState'](0x0,'rejected');}this['_stopInteraction'](),this['_clearInteractionHistory'](),this['stopListening'](_0x115fea);}),this['_createInteraction'](_0x37e8e0,_0x969143,_0x2e48cf,_0x115fea,_0x32c400);}['_wrapWithCommonAncestors'](_0x5459ee,_0x160411,_0x5ce0c7){const _0x42ddb1=this['editor']['model']['createRange'](_0x160411,_0x5ce0c7)['getCommonAncestor'](),_0x26308c=_0x42ddb1['is']('documentFragment')?[]:_0x42ddb1['getAncestors']({'includeSelf':!0x0})['slice'](0x1);if(_0x26308c['length']){const _0x172351=_0x26308c['map'](_0xd691dd=>_0xd691dd['_clone'](!0x1));for(let _0x249fdc=0x1;_0x249fdc<_0x172351['length'];_0x249fdc++)_0x172351[_0x249fdc-0x1]['_appendChild'](_0x172351[_0x249fdc]);return _0x172351[_0x172351['length']-0x1]['_appendChild'](_0x5459ee),new _0x490745(_0x172351[0x0]);}return _0x5459ee;}async['_createInteraction'](_0xc0e3c1,_0x4be520,_0x16280d,_0x3d4942,_0x5e9e03){const _0x129618=this['editor'];this['_interactionParams']={'action':_0x5e9e03,'content':_0xc0e3c1,'version':_0x4be520,'mainView':_0x16280d,'aiBalloon':_0x3d4942};const _0x20be21=new V({'connector':this['_aiConnector'],'editor':_0x129618,'content':_0xc0e3c1,'version':_0x4be520,..._0x5e9e03});this['_interactions']['push'](_0x20be21),_0x16280d['hideError']();const _0x24e7a2=(_0x11bfdd,_0x4a2433,_0x1b900a=!0x1,_0x270a0b='streaming')=>this['_promiseQueue']['enqueue'](async _0x43dea5=>{try{const _0x37908c=Q({'editor':_0x129618,'changeGroups':_0x11bfdd['changeGroups'],'documentContextContent':_0x11bfdd['documentContextContent'],'showDiff':_0x1b900a,'trimUnchanged':!0x1});await _0x4a2433['updateContent']({'parts':_0x37908c,'renderingStrategy':_0x270a0b,'abortSignal':_0x43dea5});}catch(_0x3c9f61){if(this['_isAbortError'](_0x3c9f61))return;throw _0x3c9f61;}});this['_interaction']['on']('replyCreated',(_0x4dbe0b,_0x5b2503)=>{_0x16280d['hideLoader'](),_0x3d4942['startAutoScroll'](),_0x24e7a2(_0x5b2503,_0x16280d)['catch'](_0x4e2845=>{this['_isAbortError'](_0x4e2845)||(console['error']('Error\x20updating\x20content\x20in\x20replyCreated:',_0x4e2845),this['_setErrorState'](_0x20be21,_0x16280d));});}),this['_interaction']['on']('replyContentUpdated',(_0x3f5953,_0x29ea90)=>{_0x24e7a2(_0x29ea90,_0x16280d)['catch'](_0x2acbac=>{this['_isAbortError'](_0x2acbac)||(console['error']('Error\x20updating\x20content\x20in\x20replyContentUpdated:',_0x2acbac),this['_setErrorState'](_0x20be21,_0x16280d));});}),this['_interaction']['on']('interactionFinished',async()=>{try{await this['_clearLoadingState'](_0x16280d,_0x3d4942),this['_updateNavigationUI'](),await this['_promiseQueue']['queueEmptyPromise'];}catch(_0x2b09a2){this['_isAbortError'](_0x2b09a2)||(console['error']('Error\x20clearing\x20loading\x20state\x20in\x20interactionFinished:',_0x2b09a2),this['_setErrorState'](_0x20be21,_0x16280d));}finally{_0x3d4942['stopAutoScroll']();}}),this['listenTo'](_0x16280d,'toggleSuggestionDisplayMode',async(_0x3e4276,{showDiff:_0x455ac8})=>{try{this['_balloonShowDiff']=_0x455ac8;const _0x5b6b72=this['_interaction']['replies'][this['_interaction']['replies']['length']-0x1];_0x5b6b72&&await _0x24e7a2(_0x5b6b72,_0x16280d,_0x455ac8,'static');}catch(_0x393cba){this['_isAbortError'](_0x393cba)||(console['error']('Error\x20updating\x20content\x20in\x20toggleSuggestionDisplayMode:',_0x393cba),this['_setErrorState'](_0x20be21,_0x16280d));}}),this['_interaction']['on']('replyChangeGroupStateUpdated',(_0x2c8811,{reply:_0x14fd75})=>{const _0xc78eea={'positiveCount':_0x14fd75['changeGroups']['filter'](_0x5e632e=>'accepted'===_0x5e632e['state'])['length'],'totalCount':_0x14fd75['changeGroups']['length']},_0x5e19f6=this['_interaction']['actionCallId'],_0x39ffb7=this['_interaction']['actionName'];_0x39ffb7?this['_aiConnector']['upsertAIActionRating'](_0x39ffb7,_0x5e19f6,_0xc78eea):this['_aiConnector']['upsertCustomAIActionRating'](_0x5e19f6,_0xc78eea);}),this['_setLoadingState'](_0x16280d,_0x3d4942);try{const _0x4bf709=await this['_interaction']['start']();return this['_updateNavigationUI'](),_0x4bf709;}catch(_0x3cc74a){if(this['_isAbortError'](_0x3cc74a))return;_0x16280d['hideLoader'](),this['_setErrorState'](_0x20be21,_0x16280d);}}['_applyChanges'](_0x47b24c,_0x15decd,_0x1508a7){const _0xe74b39=this['editor'];if(_0x1508a7&&!_0xe74b39['plugins']['has']('TrackChanges'))throw new _0x36b126('ai-no-track-changes',null);const _0x33522f=this['editor']['plugins']['get'](_0x2dc9e7),_0x51b105=this['_interaction'],_0x377aab=this['_interaction']['replies'][this['_interaction']['replies']['length']-0x1],_0x3de63c=_0x377aab['changeGroups'];_0x377aab['setChangeGroupState'](0x0,'accepted');let _0x379efe=z({'editor':_0xe74b39,'reply':_0x377aab,'interaction':_0x51b105,'groups':_0x3de63c,'transform':!0x1,'documentCompare':_0x33522f,'documentCompareOptions':{'anchor':_0xe74b39['model']['createPositionAt'](_0x47b24c,0x0),'markDeletions':_0x1508a7}});_0x379efe=this['_filterOperationsOutsideRange'](_0x379efe,_0x15decd);for(const _0x5259ba of _0x379efe)this['_anchorOperation'](_0x15decd,_0x5259ba,_0xe74b39['model']['document']['getRoot']());const _0x1e363b=_0x51b105['getDocumentContext']()['version'],_0x39b7e2=_0xe74b39['model']['document']['history']['getOperations'](_0x1e363b),_0x515590={'document':_0xe74b39['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1},_0x38072e=st(_0x379efe,_0x39b7e2,_0x515590)['operationsA'];_0xe74b39['model']['change'](_0x3c9bfe=>{if(_0x3c9bfe['setSelection'](_0xe74b39['model']['document']['selection']['focus']),_0x1508a7)_0xe74b39['plugins']['get']('TrackChangesEditing')['_applyOperationsAsSuggestions'](_0x38072e);else{for(const _0x32cc04 of _0x38072e)_0x32cc04['baseVersion']=_0xe74b39['model']['document']['version'],Y(_0xe74b39,_0x32cc04),_0x3c9bfe['batch']['addOperation'](_0x32cc04),_0xe74b39['model']['applyOperation'](_0x32cc04);}}),this['editor']['plugins']['get']('AIBalloon')['close']();}['_filterOperationsOutsideRange'](_0x31b3bf,_0x9501fd){return _0x31b3bf['filter'](_0x580694=>{if('rename'==_0x580694['type']){const _0x169f5a=_0x580694['position']['nodeAfter'];return!_0x9501fd['has'](_0x169f5a);}if(_0x580694['type']['indexOf']('Attribute')>-0x1){const _0x33106e=_0x580694['range']['start']['nodeAfter'];return!_0x9501fd['has'](_0x33106e);}return!0x0;});}['_anchorOperation'](_0x225a7f,_0x54f7b8,_0x1e7d66){const _0x5f413d=_0x54f7b8['clone']();for(const _0x38019c in _0x54f7b8){const _0x1cab7f=_0x54f7b8[_0x38019c];_0x1cab7f instanceof _0x1026dd?_0x54f7b8[_0x38019c]=new _0x1026dd(_0x1c6094(_0x1cab7f['start']),_0x1c6094(_0x1cab7f['end'])):_0x1cab7f instanceof tt&&(_0x54f7b8[_0x38019c]=_0x1c6094(_0x1cab7f));}if(['insert','move','remove','reinsert','split','merge']['includes'](_0x5f413d['type'])){if(_0x5f413d['isDocumentOperation']=!0x1,_0x5f413d['baseVersion']=null,'remove'==_0x5f413d['type']){const _0x4f0911=_0x5f413d['sourcePosition'],_0x561d33=_0x5f413d['howMany'];new it(_0x4f0911,_0x561d33)['_execute']();}else _0x5f413d['_execute']();}function _0x1c6094(_0x3908ab){if('$graveyard'==_0x3908ab['root']['rootName'])return _0x3908ab;const _0x1cba33=[];let _0x5c16a4=_0x3908ab['root'];for(let _0x1e862f=0x0;_0x1e862f<_0x3908ab['path']['length'];_0x1e862f++){const _0x399672=_0x225a7f['get'](_0x5c16a4)||0x0;_0x1cba33[_0x1e862f]=_0x3908ab['path'][_0x1e862f]+_0x399672,_0x5c16a4=_0x5c16a4['getChildAtOffset'](_0x3908ab['path'][_0x1e862f]);}return new tt(_0x1e7d66,_0x1cba33,_0x3908ab['stickiness']);}}['_refreshInteraction'](){if(!this['_interactionParams'])return;this['_interactions']['length']>0x0&&this['_stopInteraction'](),this['_currentInteractionIndex']=0x0,this['_balloonShowDiff']=!0x1;const {action:_0x153433,content:_0x4fb8cd,version:_0x1777cc,mainView:_0x4e3644,aiBalloon:_0x2edbaa}=this['_interactionParams'];_0x4e3644['areChangesVisible']=!0x1,_0x4e3644['hideError'](),this['_clearErrorState'](_0x4e3644,_0x2edbaa);const _0x142a2e=_0x4e3644;_0x142a2e['miniToolbarView']&&_0x142a2e['miniToolbarView']['showChangesButton']&&_0x142a2e['miniToolbarView']['showChangesButton']['set']({'isOn':!0x1,'icon':_0x24690e}),this['_clearSuggestionContent'](_0x4e3644),_0x4e3644['showLoader'](),this['_updateNavigationUI'](),this['stopListening'](_0x4e3644),this['_createInteraction'](_0x4fb8cd,_0x1777cc,_0x4e3644,_0x2edbaa,_0x153433)['catch'](_0x5951e6=>{this['_isAbortError'](_0x5951e6)||console['error']('Error\x20refreshing\x20interaction:',_0x5951e6);});}['_clearSuggestionContent'](_0xbfab4e){const _0x3f2ddf=_0xbfab4e['bodyView']['_children'];for(;_0x3f2ddf['length']>0x0;)_0x3f2ddf['remove'](_0x3f2ddf['first']);_0xbfab4e['bodyView']['hasPendingParts']=!0x1;}['_isAbortError'](_0x54ab18){return!!_0x54ab18['message']&&_0x54ab18['message']['startsWith']('ai-request-aborted');}['_clearInteractionHistory'](){this['_interactions']=[],this['_interactionParams']=void 0x0,this['_currentInteractionIndex']=0x0,this['_updateNavigationUI']();}['_stopInteraction'](){this['_interaction']&&this['_interaction']['stop'](),this['_promiseQueue']['abort'](),this['isBusy']=!0x1,this['_interactionParams']&&this['_interactionParams']['aiBalloon']['stopAutoScroll']();}['_setupCustomViews'](){const _0x570d51=new _0xcbb426(this['editor']['locale']),_0xc671cd=new _0xcbb426(this['editor']['locale']),_0x3d794a=new _0x43effc(this['editor']['locale']),_0x582254=new _0xcbb426(this['editor']['locale']);_0x570d51['set']({'icon':_0xdacbe3,'label':i(this['editor']['locale'],'AI_ACTIONS_TRY_AGAIN'),'tooltip':!0x0,'class':'ck-ai-custom-action-button'}),_0xc671cd['set']({'icon':_0x1420c7,'tooltip':i(this['editor']['locale'],'AI_ACTIONS_PREVIOUS_INTERACTION'),'class':'ck-ai-navigation-button\x20ck-ai-previous-button'}),_0x3d794a['setTemplate']({'tag':'span','attributes':{'class':['ck-ai-interaction-counter']},'children':['1/1']}),_0x582254['set']({'icon':_0x4309f7,'tooltip':i(this['editor']['locale'],'AI_ACTIONS_NEXT_INTERACTION'),'class':'ck-ai-navigation-button\x20ck-ai-next-button'}),_0x570d51['bind']('isEnabled')['to'](this,'isBusy',_0x192db2=>!_0x192db2),_0x570d51['on']('execute',()=>{this['_refreshInteraction']();}),_0xc671cd['bind']('isEnabled')['to'](this,'isBusy',_0x41fe56=>!_0x41fe56),_0xc671cd['on']('execute',()=>{this['_navigateToPrevious']();}),_0x582254['bind']('isEnabled')['to'](this,'isBusy',_0x1670e7=>!_0x1670e7),_0x582254['on']('execute',()=>{this['_navigateToNext']();}),this['_navigationPreviousButton']=_0xc671cd,this['_navigationCounter']=_0x3d794a,this['_navigationNextButton']=_0x582254,this['_customViews']['add'](_0x570d51);}['_navigateToPrevious'](){const _0x2c2045=this['_interactions']['length'];this['_currentInteractionIndex']<_0x2c2045-0x1&&this['_displayInteractionAtIndex'](this['_currentInteractionIndex']+0x1);}['_navigateToNext'](){this['_currentInteractionIndex']>0x0&&this['_displayInteractionAtIndex'](this['_currentInteractionIndex']-0x1);}async['_displayInteractionAtIndex'](_0x3e16bc){if(!this['_interactionParams'])return;this['_currentInteractionIndex']=_0x3e16bc;const {mainView:_0x2f7e8b}=this['_interactionParams'],_0x8e8a05=this['_interactions'][this['_interactions']['length']-0x1-this['_currentInteractionIndex']];if(!_0x8e8a05)return;if(_0x8e8a05['hasError'])return this['_setErrorState'](_0x8e8a05,_0x2f7e8b),void this['_updateNavigationUI']();if(!_0x8e8a05['replies']['length'])return;_0x2f7e8b['hideError'](),this['_interactionParams']&&this['_clearErrorState'](_0x2f7e8b,this['_interactionParams']['aiBalloon']);const _0x2adfbf=_0x8e8a05['replies'][_0x8e8a05['replies']['length']-0x1];if(_0x2adfbf){const _0x5b0c65=this['editor'];this['_clearSuggestionContent'](_0x2f7e8b);try{const _0x17e354=Q({'editor':_0x5b0c65,'changeGroups':_0x2adfbf['changeGroups'],'documentContextContent':_0x2adfbf['documentContextContent'],'showDiff':this['_balloonShowDiff'],'trimUnchanged':!0x1});this['_clearSuggestionContent'](_0x2f7e8b),await new Promise(_0x2abc5d=>setTimeout(_0x2abc5d,0x32)),await _0x2f7e8b['updateContent']({'parts':_0x17e354,'renderingStrategy':'static','abortSignal':new AbortController()['signal']});}catch(_0xacc46e){this['_isAbortError'](_0xacc46e)||console['error']('Error\x20updating\x20content\x20during\x20navigation:',_0xacc46e);}}this['_updateNavigationUI']();}['_updateNavigationUI'](){if(!this['_navigationPreviousButton']||!this['_navigationCounter']||!this['_navigationNextButton'])return;const _0x1d010b=this['_interactions']['length'],_0x1e6936=_0x1d010b>0x1,_0x2229c7=this['_interactionParams']?.['mainView'];if(_0x1e6936){this['_isNavigationPreviousButtonInView']||this['_isNavigationCounterInView']||this['_isNavigationNextButtonInView']||(this['_customViews']['add'](this['_navigationPreviousButton']),_0x2229c7?.['addNavigationItem'](this['_navigationPreviousButton']),this['_isNavigationPreviousButtonInView']=!0x0,this['_customViews']['add'](this['_navigationCounter']),_0x2229c7?.['addNavigationItem'](this['_navigationCounter']),this['_isNavigationCounterInView']=!0x0,this['_customViews']['add'](this['_navigationNextButton']),_0x2229c7?.['addNavigationItem'](this['_navigationNextButton']),this['_isNavigationNextButtonInView']=!0x0);const _0x1d94d8=_0x1d010b-this['_currentInteractionIndex'];this['_navigationCounter']['element']&&(this['_navigationCounter']['element']['textContent']=_0x1d94d8+'/'+_0x1d010b),this['_navigationPreviousButton']['isEnabled']=this['_currentInteractionIndex']<_0x1d010b-0x1,this['_navigationNextButton']['isEnabled']=this['_currentInteractionIndex']>0x0;}else(this['_isNavigationPreviousButtonInView']||this['_isNavigationCounterInView']||this['_isNavigationNextButtonInView'])&&(this['_customViews']['remove'](this['_navigationPreviousButton']),_0x2229c7?.['removeNavigationItem'](this['_navigationPreviousButton']),this['_isNavigationPreviousButtonInView']=!0x1,this['_customViews']['remove'](this['_navigationCounter']),_0x2229c7?.['removeNavigationItem'](this['_navigationCounter']),this['_isNavigationCounterInView']=!0x1,this['_customViews']['remove'](this['_navigationNextButton']),_0x2229c7?.['removeNavigationItem'](this['_navigationNextButton']),this['_isNavigationNextButtonInView']=!0x1);}['_setLoadingState'](_0x2fbcab,_0xee9acf){_0x2fbcab['setLoading'](),_0xee9acf['balloonView']['setLoading'](),this['isBusy']=!0x0;}async['_setErrorState'](_0x39d090,_0x2d3bb8){const _0x42875f=i(this['editor']['locale'],'AI_ACTIONS_GENERIC_ERROR');_0x2d3bb8['showError'](_0x42875f),_0x39d090['hasError']=!0x0,await this['_promiseQueue']['queueEmptyPromise'],_0x2d3bb8['setErrorState'](),this['_interactionParams']?.['aiBalloon']['balloonView']['toolbar']&&(this['_interactionParams']['aiBalloon']['balloonView']['toolbar']['isLoading']=!0x0);}['_clearErrorState'](_0x218bf8,_0x32c449){_0x218bf8['clearErrorState'](),_0x32c449['balloonView']['toolbar']&&(_0x32c449['balloonView']['toolbar']['isLoading']=!0x1);}async['_clearLoadingState'](_0xefca58,_0x4c7fe9){await this['_promiseQueue']['queueEmptyPromise'],this['isBusy']=!0x1,_0xefca58['clearLoading'](),_0x4c7fe9['balloonView']['clearLoading']();}['_disableCustomViews'](){this['_customViews']['forEach'](_0x56015c=>{'isEnabled'in _0x56015c&&(_0x56015c['isEnabled']=!0x1);});}}class Va extends _0x346ac8{static get['requires'](){return[ii,ti,ri];}static get['pluginName'](){return'AIQuickActions';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x3abe63){super(_0x3abe63),_0x3abe63['config']['define']('ai.quickActions',{'extraCommands':[],'removeCommands':[],'isSearchEnabled':!0x0});}}class js{['id'];['title'];['description'];['isParameterized'];['useArgs'];['options'];constructor({id:_0x35d5aa,title:_0x3ae232,description:_0x10ba1d,isParameterized:_0x2d146d,useArgs:_0x2fc6f5,options:_0x34d2a3}){this['id']=_0x35d5aa,this['title']=_0x3ae232,this['description']=_0x10ba1d,this['isParameterized']=_0x2d146d,this['useArgs']=_0x2fc6f5,this['options']=_0x34d2a3;}}class Bs extends js{['_models']=[];get['models'](){return this['_models'];}set['models'](_0x287530){this['_models']=_0x287530;}}class si extends ts(){['_checks'];constructor(_0x57190e){super(),this['_checks']=this['_mapCheckDefinitions'](_0x57190e);}get['checks'](){return this['_checks'];}['getCheckById'](_0x414b91){return this['checks']['find'](_0x16d45a=>_0x16d45a['id']===_0x414b91);}['removeCheckById'](_0xddb815){this['_checks']=this['_checks']['filter'](_0x4741bc=>_0x4741bc['id']!==_0xddb815);}['_mapCheckDefinitions'](_0x3c65a6){return _0x3c65a6['map'](_0x1e0ea6=>'custom'===_0x1e0ea6['id']?new Bs(_0x1e0ea6):new js(_0x1e0ea6));}}class Rs extends _0x19d98c(){['id'];['contentNew'];['contentInitial'];['documentVersion'];constructor({id:_0x9dc594,contentNew:_0x15d35c,contentInitial:_0x534bc5,documentVersion:_0x76776}){super(),this['id']=_0x9dc594,this['contentNew']=_0x15d35c,this['contentInitial']=_0x534bc5,this['documentVersion']=_0x76776;}}class Ds extends ts(){['id'];['parent'];['_data'];['_editorOperations']=[];constructor(_0xca41b1,_0x5e930d,_0x1d6d10){super(),this['id']=_0xca41b1,this['parent']=_0x1d6d10,this['_data']=_0x5e930d,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 zs extends ts(){['id']=_0xdc126c();['callId'];['_results']=new Map();['_changes']=[];['_sourceCheck'];['_documentData'];['_aiConnector'];['_reviewParams'];['_reviewArgs'];['_activeRequest']=null;['_currentError'];constructor(_0x456293,_0x1ed6f0,_0x7f4350,_0x3239d2,_0x16c386){super(),this['_sourceCheck']=_0x1ed6f0,this['_documentData']=_0x456293,this['_aiConnector']=_0x7f4350,this['_reviewParams']=_0x3239d2,this['_reviewArgs']=_0x16c386,this['on']('change:status',(_0x2ca7e6,_0x2d5a33,_0x48525c)=>{this['fire']('reviewCheckRunUpdated',{'status':_0x48525c,'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'](_0x4da877=>'pending'===_0x4da877['status']);}get['currentError'](){return this['_currentError'];}['updateDocumentData'](_0x1fd127){this['_documentData']=_0x1fd127;}async['start'](){this['status']='loading',this['_currentError']=void 0x0;try{this['_activeRequest']=this['_createApiRequest']();const _0x5a031d=await this['_activeRequest']['getStream']();this['status']='data';for await(const _0x5b154e of _0x5a031d)'unmodified'!==_0x5b154e['data']['operation']&&('error'!==_0x5b154e['data']['operation']?'review-metadata'!==_0x5b154e['event']?this['_addReviewCheckResult'](_0x5b154e['data']['dataId'],_0x5b154e['data']['textDelta']):this['callId']=_0x5b154e['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(_0x53518f){this['_currentError']=_0x53518f,_0x53518f instanceof Error&&_0x53518f['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'](_0x30cda0,_0x1e427f){const _0x4b417d=this['_results']['get'](_0x30cda0);if(!_0x4b417d)return;if(0x0===_0x1e427f['length'])return;const _0x2f092e=[];_0x1e427f['forEach']((_0x34fcf6,_0x1f79d0)=>{const _0x374df1=new Ds(_0x4b417d['id']+'-'+_0x1f79d0,_0x34fcf6,_0x4b417d);_0x374df1['on']('change:status',()=>{this['fire']('reviewCheckResultChangeStatusUpdated',{'change':_0x374df1,'status':_0x374df1['status']});}),_0x374df1['on']('change:isActivated',()=>{_0x374df1['isActivated']?this['fire']('reviewCheckResultActivated',{'change':_0x374df1}):this['fire']('reviewCheckResultDeactivated',{'change':_0x374df1});}),this['_changes']['push'](_0x374df1),_0x2f092e['push'](_0x374df1);}),this['fire']('reviewCheckResultReady',{'changes':_0x2f092e,'result':_0x4b417d,'source':this});}['abort'](){this['_activeRequest']&&(this['_activeRequest']['abortController']['abort'](),this['_activeRequest']=null,this['status']='aborted');}['isChangeActive'](_0x9f430e){const _0x4748d3=this['_changes']['find'](_0x4733c4=>_0x4733c4['id']===_0x9f430e);return!(!_0x4748d3||'pending'!==_0x4748d3['status']);}['isAnyChangeActivated'](){return this['_changes']['some'](_0x299305=>!0x0===_0x299305['isActivated']);}['getActiveChanges'](){return this['_changes']['filter'](_0x36d1bd=>'pending'===_0x36d1bd['status']);}['getChangeById'](_0x33a0b7){return this['_changes']['find'](_0x4cce08=>_0x4cce08['id']===_0x33a0b7);}['markAllChangesAsAccepted'](){for(const _0x1032d9 of this['_changes'])'pending'===_0x1032d9['status']&&(_0x1032d9['status']='accepted');this['_checkIfFinished']();}['markChangeAsAccepted'](_0xed4ce0){const _0x3bcd45=this['_changes']['find'](_0x1f34b8=>_0x1f34b8['id']===_0xed4ce0);_0x3bcd45&&'pending'===_0x3bcd45['status']&&(_0x3bcd45['status']='accepted'),this['_checkIfFinished']();}['markChangeAsRejected'](_0x1ad548){const _0x228e75=this['_changes']['find'](_0xefb337=>_0xefb337['id']===_0x1ad548);_0x228e75&&'pending'===_0x228e75['status']&&(_0x228e75['status']='rejected'),this['_checkIfFinished']();}['markChangeAsOutdated'](_0x4bc840){const _0x1e2865=this['_changes']['find'](_0x38f198=>_0x38f198['id']===_0x4bc840);_0x1e2865&&'pending'===_0x1e2865['status']&&(_0x1e2865['status']='outdated'),this['_checkIfFinished']();}['markChangeAsPending'](_0x45d83c){const _0x2a089e=this['_changes']['find'](_0x37b5ab=>_0x37b5ab['id']===_0x45d83c);_0x2a089e&&'outdated'===_0x2a089e['status']&&(_0x2a089e['status']='pending'),this['_checkIfFinished']();}['activateChange'](_0x3e2fc4){this['_changes']['filter'](_0x86375e=>_0x86375e['isActivated']&&_0x86375e['id']!==_0x3e2fc4)['forEach'](_0x28fe0e=>{_0x28fe0e['isActivated']=!0x1;});const _0xaf7a35=this['_changes']['find'](_0x45b502=>_0x45b502['id']===_0x3e2fc4);_0xaf7a35&&'pending'===_0xaf7a35['status']&&(_0xaf7a35['isActivated']=!0x0);}['deactivateChange'](){this['_changes']['filter'](_0x84f291=>_0x84f291['isActivated'])['forEach'](_0x108cc2=>{_0x108cc2['isActivated']=!0x1;});}['forceReadyState'](){this['status']='ready';}async['sendRating'](_0x57b9ea){if('initialized'===this['status']||'loading'===this['status']||'data'===this['status'])return;if(!this['callId']||0x0===this['_changes']['length'])return;let _0x58880f;if(_0x57b9ea){const _0xbfb3c=this['_changes']['find'](_0x1bd351=>_0x1bd351['id']===_0x57b9ea);if(_0xbfb3c&&_0xbfb3c['isRated'])return;_0xbfb3c&&(_0x58880f=_0xbfb3c['parent']['id'],_0xbfb3c['isRated']=!0x0);}const _0x37e052={'positiveCount':this['_changes']['filter'](_0x4ef947=>'accepted'===_0x4ef947['status'])['length'],'totalCount':this['_changes']['length']};this['_sendRatingRequest'](_0x37e052,this['callId'],_0x58880f);}['_addReviewCheckResult'](_0x3ff3c2,_0x5b7b4e){const _0x5c491f=this['_documentData']['elements']['get'](_0x3ff3c2);if(!_0x5c491f)return;const _0x16e429=_0x5c491f['getContent']();if(_0x16e429===_0x5b7b4e)return;const _0x3c892d=new Rs({'id':_0x3ff3c2,'contentInitial':_0x16e429,'contentNew':_0x5b7b4e,'documentVersion':this['_documentData']['version']});this['_results']['set'](_0x3c892d['id'],_0x3c892d),this['fire']('reviewCheckResultAdded',{'result':_0x3c892d,'source':this});}['_checkIfFinished'](){'finished'===this['status']&&(this['_changes']['filter'](_0xa2de06=>'pending'===_0xa2de06['status'])['length']>0x0&&(this['status']='ready')),'ready'===this['status']&&(0x0===this['_changes']['filter'](_0x45b529=>'pending'===_0x45b529['status'])['length']&&(this['status']='finished'));}}class hi extends zs{get['subTitle'](){if(!this['_reviewParams']||0x0===this['_reviewParams']['length'])return'';const _0x17e515=[];if(this['_reviewParams']['length']>0x0&&this['_sourceCheck']['options'])for(let _0x3de0ff=0x0;_0x3de0ff<this['_reviewParams']['length'];_0x3de0ff++){if(!this['_reviewParams'][_0x3de0ff]||!this['_sourceCheck']['options'][_0x3de0ff])continue;const _0x475c53=this['_sourceCheck']['options'][_0x3de0ff],_0x16d81f=_0x475c53['data']?.['find'](_0x3649aa=>_0x3649aa['id']===this['_reviewParams'][_0x3de0ff]);_0x16d81f&&_0x17e515['push'](_0x16d81f['label']);}return _0x17e515['join'](',\x20');}get['reviewName'](){return this['_composeReviewName']();}['_createApiRequest'](){return this['_aiConnector']['callSystemReview']({'reviewName':this['_composeReviewName'](),'content':this['_documentData']['content'],'args':this['_reviewArgs']});}['_sendRatingRequest'](_0x412e21,_0xb8ab42,_0x360a3d){return this['_aiConnector']['upsertAIReviewRating'](this['reviewName'],_0xb8ab42,_0x412e21,_0x360a3d);}['_composeReviewName'](){return!this['_reviewParams']||0x0===this['_reviewParams']['length']||this['_sourceCheck']['useArgs']?this['_sourceCheck']['id']:[this['_sourceCheck']['id'],...this['_reviewParams']]['join']('-');}}class oi extends zs{['_prompt'];['_model'];constructor(_0x1d3fb1,_0x408721,_0x4febe9,_0x1841af,_0x47e8f5){super(_0x4febe9,_0x1841af,_0x47e8f5),this['_prompt']=_0x1d3fb1,this['_model']=_0x408721;}get['subTitle'](){return this['_prompt'];}['_createApiRequest'](){return this['_aiConnector']['callCustomReview']({'content':this['_documentData']['content'],'prompt':this['_prompt'],'model':this['_model']});}['_sendRatingRequest'](_0x4f0571,_0x479eee,_0x3e284a){return this['_aiConnector']['upsertCustomAIReviewRating'](_0x479eee,_0x4f0571,_0x3e284a);}}const ni=[{'id':'custom','title':'Custom\x20command','description':'Type\x20a\x20custom\x20command\x20to\x20review\x20the\x20content\x20exactly\x20as\x20you\x20need.','isParameterized':!0x0},{'id':'correctness','title':'Correctness','description':'Ensure\x20the\x20text\x20is\x20factually\x20accurate\x20and\x20free\x20of\x20errors.','isParameterized':!0x1},{'id':'clarity','title':'Clarity','description':'Improve\x20the\x20clarity\x20and\x20readability\x20of\x20the\x20text.','isParameterized':!0x1},{'id':'readability','title':'Readability','description':'Enhance\x20the\x20overall\x20readability\x20of\x20the\x20text.','isParameterized':!0x1},{'id':'make','title':'Adjust\x20length','description':'Refine\x20text\x20length\x20to\x20match\x20your\x20needs.','isParameterized':!0x0,'options':[{'formType':'dropdown','label':'Adjust\x20length','default':'longer','data':[{'label':'Longer','id':'longer'},{'label':'Shorter','id':'shorter'}]}]},{'id':'make-tone','title':'Adjust\x20tone\x20and\x20style','description':'Choose\x20tone\x20and\x20style\x20to\x20change\x20content\x20as\x20you\x20need.','isParameterized':!0x0,'options':[{'formType':'dropdown','label':'Adjust\x20tone\x20and\x20style','default':'casual','data':[{'label':'Casual','id':'casual'},{'label':'Direct','id':'direct'},{'label':'Friendly','id':'friendly'},{'label':'Confident','id':'confident'},{'label':'Professional','id':'professional'}]}]},{'id':'translate','title':'Translate','description':'Translate\x20the\x20text\x20into\x20another\x20language.','isParameterized':!0x0,'useArgs':!0x0,'options':[{'formType':'dropdown','label':'Select\x20language','argsKey':'language','data':[{'label':'English','id':'english'},{'label':'Spanish','id':'spanish'},{'label':'French','id':'french'},{'label':'German','id':'german'},{'label':'Chinese\x20(Simplified)','id':'chinese'},{'label':'Japanese','id':'japanese'},{'label':'Russian','id':'russian'},{'label':'Portuguese','id':'portuguese'},{'label':'Korean','id':'korean'},{'label':'Italian','id':'italian'}]}]}];class re extends ot{['_aiConnector'];['_aiReviewModeUi'];['_aiReviewModeEditing'];['_aiReviewCheckList'];['_currentReviewCheckRun'];['_isDiffOn']=!0x1;['_changeActivationSource']=null;static get['requires'](){return[S];}static get['pluginName'](){return'AIReviewModeController';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}async['init'](){this['_aiConnector']=this['context']['plugins']['get']('AIConnector'),this['_aiReviewModeUi']=this['context']['plugins']['get']('AIReviewModeUI'),this['_aiReviewModeEditing']=this['context']['plugins']['get']('AIReviewModeEditing');const _0x4501b6=this['context']['config']['get']('ai.reviewMode.translations');if(_0x4501b6){for(const _0x867ae5 of ni)'translate'===_0x867ae5['id']&&(_0x867ae5['options'][0x0]['data']=_0x4501b6);}const _0x28f4ae=this['_translateReviewChecks'](ni);this['_aiReviewCheckList']=new si(_0x28f4ae);const _0x4bf82d=this['_aiReviewCheckList']['checks']['find'](_0x7671ff=>'custom'===_0x7671ff['id']);if(_0x4bf82d)try{_0x4bf82d['models']=await new At({'connector':this['_aiConnector'],'locale':this['context']['locale']})['getAll']();}catch(_0x4507c9){this['_aiReviewCheckList']['removeCheckById']('custom'),this['_logError'](new _0x36b126('ai-review-mode-models-unable-to-retrieve',this,{'error':_0x4507c9}));}this['listenTo'](this['_aiReviewModeUi'],'getReviewCheckList',()=>{this['_aiReviewModeUi']['setAvailableChecks'](this['_aiReviewCheckList']['checks']);}),this['listenTo'](this['_aiReviewModeUi'],'runReviewCheck',async(_0x14e033,_0x133e35)=>{const _0x2b36b5=this['_aiReviewCheckList']['getCheckById'](_0x133e35['id']);if(_0x2b36b5){this['_onDiffChange'](this['_isDiffOn']),_0x133e35['isCustom']?this['_currentReviewCheckRun']=new oi(_0x133e35['args']['prompt'],_0x133e35['args']['model'],this['_aiReviewModeEditing']['getDocumentData'](),_0x2b36b5,this['_aiConnector']):this['_currentReviewCheckRun']=new hi(this['_aiReviewModeEditing']['getDocumentData'](),_0x2b36b5,this['_aiConnector'],_0x133e35['params'],_0x133e35['args']),this['_aiReviewModeUi']['setCheckResultTitle'](this['_currentReviewCheckRun']['title'],this['_currentReviewCheckRun']['subTitle']),this['_currentReviewCheckRun']['on']('reviewCheckRunUpdated',(_0xeb0980,_0x4b6391)=>{switch(_0x4b6391['status']){case'data':case'loading':this['_aiReviewModeEditing']['switchToReadOnly'](),this['_aiReviewModeUi']['showCheckRunResults'](_0x4b6391);break;case'finished':this['_aiReviewModeUi']['showReviewCompletedView']();break;case'ready':this['_aiReviewModeUi']['showActionsWhenResultIsReady']();break;case'unmodified':this['_aiReviewModeUi']['showNoChangesView']();break;case'error-general':this['_aiReviewModeUi']['showGeneralResultsErrorView'](),this['_logError'](new _0x36b126('ai-review-mode-check-run-general-error',this,this['_currentReviewCheckRun']?.['currentError']));break;case'error-chunk':this['_aiReviewModeUi']['showChunkErrorView'](),this['_logError'](new _0x36b126('ai-review-mode-check-run-chunk-error',this,this['_currentReviewCheckRun']?.['currentError']));break;case'aborted':this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['processedResultsCount']>0x0?setTimeout(()=>{this['_currentReviewCheckRun']?.['forceReadyState']();},0x0):this['_onReviewModeRunLeave'](!0x0);}'ready'!==_0x4b6391['status']&&'error-chunk'!==_0x4b6391['status']&&'error-general'!==_0x4b6391['status']||this['_currentReviewCheckRun']?.['sendRating']();}),this['_currentReviewCheckRun']['on']('reviewCheckResultAdded',(_0x2a6b27,_0x3f318a)=>{if(!this['_currentReviewCheckRun'])throw new _0x36b126('ai-review-mode-no-current-check-run',this);const _0x4c0a29=this['_aiReviewModeEditing']['diffContent'](_0x3f318a['result']['contentInitial'],_0x3f318a['result']['contentNew']);_0x3f318a['source']['addResultChanges'](_0x3f318a['result']['id'],_0x4c0a29);}),this['_currentReviewCheckRun']['on']('reviewCheckResultReady',(_0x251f66,_0x11f058)=>{for(const _0x24b3e8 of _0x11f058['changes'])this['_aiReviewModeUi']['showCheckRunResult'](_0x24b3e8);this['_aiReviewModeEditing']['markChangePositionInEditorContent'](_0x11f058['changes'],_0x11f058['source']['documentData']);}),this['_currentReviewCheckRun']['on']('reviewCheckResultChangeStatusUpdated',(_0x1d9708,_0x33f1a9)=>{this['_aiReviewModeUi']['updateChangeState'](_0x33f1a9['change']['id'],_0x33f1a9['status']);}),this['_currentReviewCheckRun']['on']('reviewCheckResultActivated',(_0x51fb86,_0x55f95d)=>{this['_aiReviewModeUi']['setActiveStateInResults'](_0x55f95d['change']['id']);const _0x341e2f=this['_aiReviewModeEditing']['getMarkerElementForChange'](_0x55f95d['change']['id']);if(!_0x341e2f)return;if('content'===this['_changeActivationSource']){const _0x13066f=this['_aiReviewModeUi']['getChangeElement'](_0x55f95d['change']['id']);_0x13066f&&_0x4ff008(_0x13066f['closest']('.ck-ai-review-mode__check-run-result')||_0x13066f);}else{if('panel'===this['_changeActivationSource']){const _0x138a74={'target':_0x341e2f['domElement'],'viewportOffset':{'top':0x55,'left':0x0,'bottom':0x0,'right':0x0},'ancestorOffset':0x14,'alignToTop':!0x0};ht(_0x138a74);}}const _0x36a86e=this['_aiReviewModeEditing']['getEditor']();this['_aiReviewModeUi']['showChangeBalloon'](_0x55f95d['change'],_0x341e2f['domElement'],void 0x0,'click',_0x36a86e?.['editing']?.['view']?.['getDomRoot'](),_0x36a86e?.['ui']?.['viewportOffset']);}),this['_currentReviewCheckRun']['on']('reviewCheckResultDeactivated',()=>{this['_aiReviewModeUi']['resetActiveStateInResults'](),this['_aiReviewModeUi']['hideChangeBalloon']();});try{await this['_currentReviewCheckRun']['start']();}catch(_0x1d4c48){_0x1d4c48 instanceof Error&&_0x1d4c48['message']['includes']('ai-request-aborted')||(_0x1d4c48 instanceof _0x36b126?this['_logError'](_0x1d4c48):this['_logError'](new _0x36b126('ai-review-mode-check-run-failed',this,{'error':_0x1d4c48})));}}else this['_logError'](new _0x36b126('ai-review-mode-source-check-not-found',this,{'checkId':_0x133e35['id']}));}),this['listenTo'](this['_aiReviewModeUi'],'leaveReviewMode',()=>{this['_onReviewModeRunLeave']();}),this['listenTo'](this['_aiReviewModeUi'],'leaveReviewModeResultList',()=>{this['_onReviewModeRunLeave'](!0x0);}),this['listenTo'](this['_aiReviewModeUi'],'abortReviewStream',()=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['abort']();}),this['listenTo'](this['_aiReviewModeUi'],'finishReview',()=>{this['_onReviewModeRunLeave'](!0x0);}),this['listenTo'](this['_aiReviewModeUi'],'acceptAllChanges',()=>{if(!this['_currentReviewCheckRun'])return;const _0x4f5c6b=this['_currentReviewCheckRun']['getActiveChanges']();_0x4f5c6b['length']&&(this['_aiReviewModeEditing']['applyChange'](_0x4f5c6b['map'](_0xc9f9ff=>_0xc9f9ff['id'])),this['_currentReviewCheckRun']['markAllChangesAsAccepted'](),this['_currentReviewCheckRun']['sendRating']());}),this['listenTo'](this['_aiReviewModeUi'],'acceptChange',(_0x18c836,_0x4c293b)=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['isChangeActive'](_0x4c293b['id'])&&(this['_aiReviewModeEditing']['applyChange']([_0x4c293b['id']]),this['_currentReviewCheckRun']['markChangeAsAccepted'](_0x4c293b['id']),this['_aiReviewModeUi']['hideChangeBalloon'](),this['_currentReviewCheckRun']['sendRating'](_0x4c293b['id']));}),this['listenTo'](this['_aiReviewModeUi'],'dismissChange',(_0xc680df,_0x27b908)=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['isChangeActive'](_0x27b908['id'])&&(this['_aiReviewModeEditing']['rejectChange'](_0x27b908['id']),this['_currentReviewCheckRun']['markChangeAsRejected'](_0x27b908['id']),this['_aiReviewModeUi']['hideChangeBalloon'](),this['_currentReviewCheckRun']['sendRating'](_0x27b908['id']));}),this['listenTo'](this['_aiReviewModeUi'],'toggleDiff',(_0x5e7e39,_0x3ac574)=>{this['_isDiffOn']=_0x3ac574['on'],this['_onDiffChange'](this['_isDiffOn']);}),this['listenTo'](this['_aiReviewModeUi'],'retryReview',async()=>{this['_currentReviewCheckRun']&&(this['_aiReviewModeEditing']['clearAllMarkers'](),this['_currentReviewCheckRun']['updateDocumentData'](this['_aiReviewModeEditing']['getDocumentData']()),await this['_currentReviewCheckRun']['restart']());}),this['listenTo'](this['_aiReviewModeUi'],'activateChange',(_0x5097f6,_0xbd2604)=>{this['_currentReviewCheckRun']&&(this['_changeActivationSource']='panel',this['_currentReviewCheckRun']['activateChange'](_0xbd2604['id']));}),this['listenTo'](this['_aiReviewModeUi'],'deactivateChange',()=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['deactivateChange']();}),this['listenTo'](this['_aiReviewModeEditing']['emitter'],'changeMarkerClick',(_0x56a0f0,_0x1e50aa)=>{if(!this['_currentReviewCheckRun'])return;this['_changeActivationSource']='content',this['_currentReviewCheckRun']['activateChange'](_0x1e50aa['changeId']);const _0x4aca94=this['_currentReviewCheckRun']['getChangeById'](_0x1e50aa['changeId']);if(!_0x4aca94)return;const _0x103ffa=this['_aiReviewModeEditing']['getEditor']();this['_aiReviewModeUi']['showChangeBalloon'](_0x4aca94,_0x1e50aa['markerElement'],_0x1e50aa['domEvent'],'click',_0x103ffa?.['editing']?.['view']?.['getDomRoot'](),_0x103ffa?.['ui']?.['viewportOffset']);}),this['listenTo'](this['_aiReviewModeEditing']['emitter'],'changeMarkerHovered',(_0x474193,_0x4bd229)=>{if(!this['_currentReviewCheckRun'])return;if(this['_currentReviewCheckRun']['isAnyChangeActivated']())return;const _0x5c364a=this['_currentReviewCheckRun']['getChangeById'](_0x4bd229['changeId']);if(!_0x5c364a)return;const _0x52e1d9=this['_aiReviewModeEditing']['getEditor']();this['_aiReviewModeUi']['showChangeBalloon'](_0x5c364a,_0x4bd229['markerElement'],_0x4bd229['domEvent'],'hover',_0x52e1d9?.['editing']?.['view']?.['getDomRoot'](),_0x52e1d9?.['ui']?.['viewportOffset']);}),this['listenTo'](this['_aiReviewModeEditing']['emitter'],'changeMarkerBlurred',()=>{if(!this['_currentReviewCheckRun'])return;this['_currentReviewCheckRun']['isAnyChangeActivated']()||this['_aiReviewModeUi']['hideChangeBalloon']();}),this['listenTo'](this['_aiReviewModeEditing']['emitter'],'changeMarkerRemoved',(_0x531251,_0x3b8d3e)=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['markChangeAsOutdated'](_0x3b8d3e['changeId']);}),this['listenTo'](this['_aiReviewModeEditing']['emitter'],'changeMarkerRestored',(_0x58d6a8,_0x15ec5f)=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['markChangeAsPending'](_0x15ec5f['changeId']);});}['_onReviewModeRunLeave'](_0x1e298e=!0x1){this['_currentReviewCheckRun']&&(this['_currentReviewCheckRun']['hasModifications']||this['_currentReviewCheckRun']['sendRating'](),this['_currentReviewCheckRun']['stopListening'](),this['_currentReviewCheckRun']['abort'](),this['_currentReviewCheckRun']=void 0x0),_0x1e298e&&this['_aiReviewModeUi']['showReviewCheckList'](),this['_aiReviewModeEditing']['clearAllMarkers'](),this['_aiReviewModeEditing']['switchToEdit'](),this['_changeActivationSource']=null;const _0x9cb39d=this['_aiReviewModeEditing']['getEditor']();_0x9cb39d&&_0x9cb39d['editing']['view']['change'](_0x1a08eb=>{const _0x18b514=_0x9cb39d['editing']['view']['document']['getRoot']();_0x1a08eb['removeClass']('ck-ai-review-mode-diff',_0x18b514),_0x1a08eb['removeClass']('ck-ai-review-mode-highlights',_0x18b514);});}['_onDiffChange'](_0x31786b){const _0xbfc552=this['_aiReviewModeEditing']['getEditor']();_0x31786b?this['_aiReviewModeUi']['hideDiffInBalloon']():this['_aiReviewModeUi']['showDiffInBalloon'](),_0xbfc552&&_0xbfc552['editing']['view']['change'](_0x2ec932=>{const _0x20bdad=_0xbfc552['editing']['view']['document']['getRoot']();_0x2ec932['removeClass']('ck-ai-review-mode-diff',_0x20bdad),_0x2ec932['removeClass']('ck-ai-review-mode-highlights',_0x20bdad),_0x2ec932['addClass'](_0x31786b?'ck-ai-review-mode-diff':'ck-ai-review-mode-highlights',_0x20bdad);});}['_translateReviewChecks'](_0x37c695){return _0x37c695['map'](_0x540d6f=>{const _0x543cb5='AI_REVIEW_CHECK_'+_0x540d6f['id']['toUpperCase']()['replaceAll']('-','_'),_0x525c61={..._0x540d6f,'title':this['_getTranslationWithDefault'](_0x543cb5+'_TITLE',_0x540d6f['title']),'description':this['_getTranslationWithDefault'](_0x543cb5+'_DESCRIPTION',_0x540d6f['description'])};return _0x540d6f['options']&&(_0x525c61['options']=_0x540d6f['options']['map'](_0x508f73=>({..._0x508f73,'label':this['_getTranslationWithDefault'](_0x543cb5+'_OPTIONS_LABEL',_0x508f73['label']||''),'data':_0x508f73['data']?_0x508f73['data']['map'](_0x1dc36c=>({..._0x1dc36c,'label':this['_getTranslationWithDefault'](_0x543cb5+'_OPTIONS_DATA_'+_0x1dc36c['id']['toUpperCase'](),_0x1dc36c['label'])})):void 0x0}))),_0x525c61;});}['_getTranslationWithDefault'](_0x1eb7af,_0x1d80be){const _0x466ae7=i(this['context']['locale'],_0x1eb7af);return _0x466ae7===_0x1eb7af?_0x1d80be:_0x466ae7;}['_logError'](_0x3e6b50){ft(_0x3e6b50['message']),_0x3e6b50['message']['startsWith']('ai-review-mode-models-unable-to-retrieve')?this['_aiReviewModeUi']['showGeneralReviewModeErrorView']():this['_aiReviewModeUi']['showGeneralResultsErrorView']();}}class Mr extends _0x43effc{['_dropdownView'];['_defaultValue'];['_defaultLabel'];constructor(_0x2c5dde,_0x13358b){super(_0x2c5dde),this['_defaultValue']=_0x13358b['default']||(_0x13358b['data']['length']>0x0?_0x13358b['data'][0x0]['id']:''),this['_defaultLabel']=_0x13358b['data']['find'](_0xa7eb4=>_0xa7eb4['id']===this['_defaultValue'])?.['label']||'',this['set']('formValue',''),this['_dropdownView']=_0x2e287a(this['locale']);const _0x27f5cb=this['_prepareListOptions'](_0x13358b['data']);_0x44b9be(this['_dropdownView'],_0x27f5cb,{'role':'menu','ariaLabel':_0x13358b['label']}),this['_dropdownView']['buttonView']['set']({'label':this['_defaultLabel'],'withText':!0x0}),this['_dropdownView']['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x4eaaad=>{_0x4eaaad['stopPropagation']();})}}),this['listenTo'](this['_dropdownView'],'execute',_0x5513ce=>{this['formValue']=_0x5513ce['source']['model']['id'],this['_dropdownView']['buttonView']['label']=_0x5513ce['source']['model']['label'];}),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-ai-review-mode__check-list-item-parameterized-form-element','ck-ai-review-mode__check-list-item-parameterized-form-element_dropdown']},'children':[this['_dropdownView']]});}['resetToDefault'](){this['formValue']=this['_defaultValue'],this['_dropdownView']['buttonView']['label']=this['_defaultLabel'];}['_prepareListOptions'](_0x17bf4d=[]){const _0x27de80=new _0x5137f7();this['resetToDefault']();for(const _0x542f46 of _0x17bf4d){const _0x11bb7b=new _0x3344bf({'label':_0x542f46['label'],'withText':!0x0,'role':'menuitemradio','id':_0x542f46['id'],'model':_0x542f46});_0x11bb7b['bind']('isOn')['to'](this,'formValue',_0x5bed80=>_0x5bed80===_0x11bb7b['id']);const _0x9227ea={'type':'button','model':_0x11bb7b};_0x27de80['add'](_0x9227ea);}return _0x27de80;}}class ic extends _0x3f0116{['_formItem']=null;constructor(_0x1a3fb9,_0x56cb7f,_0x455045){super(_0x1a3fb9),this['argsKey']=_0x56cb7f?.['argsKey'];if('dropdown'===_0x56cb7f['formType'])this['_formItem']=new Mr(this['locale'],_0x56cb7f);this['set']('value',''),this['bind']('value')['to'](this['_formItem'],'formValue');const _0x305e3b=new _0x2eaca7(this['locale'],{'children':[this['_formItem']],'class':[_0x455045?'ck-form__row_with-submit':'']});_0x455045&&_0x305e3b['children']['add'](_0x455045),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-review-mode__form-item','ck-reset_all']},'children':[_0x305e3b]});}['resetToDefault'](){this['_formItem']['resetToDefault']();}}class Qs extends _0x19a367{['keystrokes'];static ['MIN_ROWS']=0x1;static ['MAX_ROWS']=0xc;constructor(_0x312a61){super(_0x312a61),this['set']('isEmpty',!0x0),this['keystrokes']=new _0xfe6d51(),this['minRows']=Qs['MIN_ROWS'],this['maxRows']=Qs['MAX_ROWS'],this['extendTemplate']({'attributes':{'id':'ai-review-mode-prompt-input','class':['ck','ck-review-mode__prompt-input']}});}['render'](){super['render'](),this['on']('update',()=>{this['isEmpty']=''===this['element']['value']?.['trim']();}),this['keystrokes']['listenTo'](this['element']);}}class tc extends _0x43effc{['focusTracker']=new _0x25d272();['keystrokes']=new _0xfe6d51();['focusCycler'];['_focusables']=new _0x317ee8();['submitButtonView'];['cancelButtonView'];['promptInputView'];['actionsFooterView'];['_modelSelectionDropdown'];['_modelSelectionDropdownItems'];['_check'];['_defaultValue'];['_defaultLabel'];constructor(_0x4dd540,_0x4520e3){super(_0x4dd540),this['_check']=_0x4520e3,this['set']('prompt',''),this['set']('modelId',''),this['_defaultValue']=_0x4520e3['models']&&_0x4520e3['models']['length']>0x0?_0x4520e3['models'][0x0]['id']:'',this['_defaultLabel']=_0x4520e3['models']&&_0x4520e3['models']['length']>0x0?_0x4520e3['models'][0x0]['name']:'',this['submitButtonView']=this['_createSubmitButtonView'](),this['cancelButtonView']=this['_createCancelButtonView'](),(this['promptInputView']=new _0x454e15(this['locale'],()=>new Qs(_0x4dd540)),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 _0x5137f7(),this['_setModelList'](),_0x44b9be(this['_modelSelectionDropdown'],this['_modelSelectionDropdownItems']),this['actionsFooterView']=this['_createActionsFooterView'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item-custom-actions']},'children':[new _0x2eaca7(this['locale'],{'children':[this['promptInputView']]}),new _0x2eaca7(this['locale'],{'children':[this['actionsFooterView']]})]}),this['promptInputView']['fieldView']['keystrokes']['set']('Enter',(_0x3a4a98,_0x5818ff)=>{this['_isValid']()?(this['fire']('runReviewCheck',{'id':'custom','args':{'prompt':this['prompt'],'model':this['modelId']},'isCustom':!0x0}),_0x5818ff()):_0x5818ff();}),this['focusCycler']=new _0x4b849d({'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'](_0x4eface=>{this['_focusables']['add'](_0x4eface),this['focusTracker']['add'](_0x4eface['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 _0x528769 of this['_getFormValidators']()){const _0x207906=_0x528769();if(_0x207906)return this['promptInputView']['errorText']=_0x207906,!0x1;}return!0x0;}['_getFormValidators'](){return[()=>{if(0x0===this['promptInputView']['fieldView']['value']?.['trim']()['length'])return i(this['locale'],'AI_REVIEW_MODE_PROMPT_EMPTY_ERROR');}];}['_createSubmitButtonView'](){const _0x212302=new _0xcbb426(this['locale']),t=this['locale']['t'];return _0x212302['set']({'label':t('Submit'),'withText':!0x0,'class':'ck-ai-button-primary'}),_0x212302['on']('execute',()=>{this['_isValid']()&&this['fire']('runReviewCheck',{'id':'custom','args':{'prompt':this['prompt'],'model':this['modelId']},'isCustom':!0x0});}),_0x212302;}['_createCancelButtonView'](){const _0x46c4b0=new _0xcbb426(this['locale']),t=this['locale']['t'];return _0x46c4b0['set']({'label':t('Cancel'),'withText':!0x0,'class':'ck-ai-button-tertiary-filled'}),_0x46c4b0['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x13f0d8=>{_0x13f0d8['stopPropagation']();})}}),_0x46c4b0['on']('execute',()=>{this['resetToDefault'](),this['fire']('closeCustomCheck');}),_0x46c4b0;}['_setModelList'](){this['_modelSelectionDropdownItems']['clear']();const _0x354e4f=this['_check']['models'];if(this['resetToDefault'](),_0x354e4f?.['length'])for(const _0x1260d6 of _0x354e4f){const _0x2a7368=new _0x3344bf({'label':_0x1260d6['name'],'withText':!0x0,'role':'menuitemradio','id':_0x1260d6['id'],'model':_0x1260d6});_0x2a7368['bind']('isOn')['to'](this,'modelId',_0x335abd=>_0x335abd===_0x1260d6['id']),this['_modelSelectionDropdownItems']['add']({'type':'button','model':_0x2a7368,'labelView':new Us(this['locale'],_0x1260d6)});}}['_createModelSelectionDropdown'](){const _0x449979=_0x2e287a(this['locale']);return _0x449979['set']({'panelPosition':'se','class':'ck-ai-review-mode__check-list-item-model-dropdown'}),_0x449979['buttonView']['set']({'label':this['_defaultLabel'],'withText':!0x0,'tooltip':!0x0}),this['listenTo'](_0x449979,'execute',_0x1c72dd=>{this['modelId']=_0x1c72dd['source']['model']['id'],_0x449979['buttonView']['label']=_0x1c72dd['source']['label'];}),_0x449979;}['_createActionsFooterView'](){const _0x4b6c7c=new _0x43effc(this['locale']);return _0x4b6c7c['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item-custom-actions-footer']},'children':[this['_modelSelectionDropdown'],{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item-parameterized-custom-actions-buttons']},'children':[this['cancelButtonView'],this['submitButtonView']]}]}),_0x4b6c7c;}}class Us extends _0x43f368{constructor(_0x2d1a0f,_0x2a17d3){super();const _0x107e21=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-button__label'],'style':_0x107e21['to']('style'),'id':_0x107e21['to']('id')},'children':[{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item-model-dropdown-name']},'children':[{'tag':'span','children':[{'text':_0x107e21['to']('text')}]}]},{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item-model-dropdown-description']},'children':[{'tag':'span','children':[_0x2a17d3['description']||'']}]}]});}}class Xs extends _0x3f0116{['_formItemsCollection']=new _0x317ee8();['_customCheckView']=null;constructor(_0x4dc76a,_0x4c5ff1,_0xf352df){super(_0x4dc76a),this['set']('isParametrizedViewOpen',!0x1),this['set']('isListItemRendered',!0x1),this['set']('isItemParametrized',_0x4c5ff1['isParameterized']);const _0x237443=this['_createIconView']();this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item',this['bindTemplate']['if']('isParametrizedViewOpen','ck-ai-review-mode__check-list-item_selected',_0x19acdf=>_0x19acdf),this['bindTemplate']['if']('isListItemRendered','ck-ai-review-mode__check-list-item_rendered',_0x683e6f=>_0x683e6f)],'style':{'--ck-ai-review-check-list-item-index':_0xf352df}},'on':{'click':this['bindTemplate']['to']('click')},'children':[{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item-content']},'children':[{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item-main-content']},'children':[{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item-title']},'children':[{'tag':'span','attributes':{'class':['ck-ai-review-mode__check-list-item-title-text']},'children':[{'text':_0x4c5ff1['title']}]},_0x237443]},{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item-description']},'children':[{'text':_0x4c5ff1['description']}]}]}]},..._0x4c5ff1['isParameterized']?[this['_createParameterizedView'](_0x4c5ff1)]:[],...'custom'===_0x4c5ff1['id']?[this['_createCustomView'](_0x4c5ff1)]:[]]}),this['on']('click',()=>{_0x4c5ff1['isParameterized']?this['isParametrizedViewOpen']=!0x0:this['fire']('runReviewCheck',{'id':_0x4c5ff1['id']});}),requestAnimationFrame(()=>{this['isListItemRendered']=!0x0;});}['render'](){super['render'](),this['isItemParametrized']&&_0x4b855c({'emitter':this,'activator':()=>!0x0===this['isParametrizedViewOpen'],'contextElements':[this['element']],'callback':()=>{this['isParametrizedViewOpen']=!0x1;}});}['resetToDefault'](){this['isParametrizedViewOpen']=!0x1,this['_formItemsCollection']['forEach'](_0x18f7c7=>{_0x18f7c7['resetToDefault']();}),this['_customCheckView']&&this['_customCheckView']['resetToDefault']();}['_createIconView'](){const _0x59fbb7=new _0x4caa0b();return _0x59fbb7['content']=_0x37e1aa,_0x59fbb7['extendTemplate']({'attributes':{'class':['ck-ai-review-mode__check-list-item-title-icon']}}),_0x59fbb7;}['_createParameterizedView'](_0xa33280){const _0x42fbd0=new _0x43effc(),_0x3881d0=this['_createFormView'](_0xa33280);return _0x42fbd0['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item-parameterized',this['bindTemplate']['if']('isParametrizedViewOpen','ck-hidden',_0x497cfc=>!_0x497cfc)]},'children':[_0x3881d0]}),_0x42fbd0;}['_createFormView'](_0x4a8084){const _0x56b116=new _0x43effc(),_0x970de6=Array['isArray'](_0x4a8084['options'])?_0x4a8084['options']:[],_0x3853bc=new _0xcbb426(this['locale']),t=this['locale']['t'];_0x3853bc['set']({'label':t('Submit'),'withText':!0x0,'class':'ck-ai-button-primary'}),_0x3853bc['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x35c019=>{_0x35c019['stopPropagation']();})}}),_0x3853bc['on']('execute',()=>{const _0x5bf0ad=[],_0x7d3a49={};this['_formItemsCollection']['forEach'](_0x148fb3=>{_0x5bf0ad['push'](_0x148fb3['value']),_0x4a8084['useArgs']&&_0x4a8084['options']&&(_0x7d3a49[_0x148fb3['argsKey']]=_0x148fb3['value']);}),this['fire']('runReviewCheck',{'id':_0x4a8084['id'],'params':_0x5bf0ad['length']?_0x5bf0ad:void 0x0,'args':Object['keys'](_0x7d3a49)['length']?_0x7d3a49:void 0x0});});const _0x29ec59=_0x970de6['length'];return _0x970de6['forEach']((_0x115ee3,_0x498388)=>{const _0x2ef590=_0x498388===_0x29ec59-0x1;this['_formItemsCollection']['add'](new ic(this['locale'],_0x115ee3,_0x2ef590?_0x3853bc:null));}),_0x56b116['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item-parameterized-form']},'children':this['_formItemsCollection']}),_0x56b116;}['_createCustomView'](_0x551bd5){return this['_customCheckView']=new tc(this['locale'],_0x551bd5),this['_customCheckView']['extendTemplate']({'attributes':{'class':['ck-ai-review-mode__check-list-item-parameterized','ck-ai-review-mode__check-list-item-parameterized_custom',this['bindTemplate']['if']('isParametrizedViewOpen','ck-hidden',_0x56052e=>!_0x56052e)]}}),this['_customCheckView']['delegate']('runReviewCheck')['to'](this),this['listenTo'](this['_customCheckView'],'closeCustomCheck',()=>{this['isParametrizedViewOpen']=!0x1;}),this['on']('change:isParametrizedViewOpen',(_0x3e62e8,_0x956496,_0x406d30)=>{_0x406d30||this['_customCheckView']['resetFormValidationStatus']();}),this['_customCheckView'];}}class ih extends _0x3f0116{['_checkViews'];constructor(_0x1e1bf7){super(_0x1e1bf7),this['_checkViews']=new _0x317ee8();const _0x405ef8=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list',_0x405ef8['if']('isVisible','ck-hidden',_0x14ddd3=>!_0x14ddd3)]},'children':this['_checkViews']});}['setChecks'](_0x5e31e6){this['_checkViews']['clear']();for(const [_0xeaddf8,_0x2692b3]of _0x5e31e6['entries']()){const _0x520716=new Xs(this['locale'],_0x2692b3,_0xeaddf8);_0x520716['delegate']('runReviewCheck')['to'](this),this['_checkViews']['add'](_0x520716);}}['hasChecks'](){return this['_checkViews']['length']>0x0;}['resetAllParameterizedChecks'](){for(const _0x1dd1b8 of this['_checkViews'])_0x1dd1b8 instanceof Xs&&_0x1dd1b8['resetToDefault']();}}class Ps extends _0x43effc{['resultResponseView'];['acceptButtonView'];['dismissButtonView'];['infoButtonView'];['outdatedButtonView'];constructor(_0x1b898a,_0x26f7f5){super(_0x1b898a),this['id']=_0x26f7f5,this['set']('status','pending'),this['set']('changeId',_0x26f7f5),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-mode__check-run-result',this['bindTemplate']['if']('isActive','ck-ai-review-mode__check-run-result_active')]},'on':{'click':this['bindTemplate']['to']('click')},'children':[this['resultResponseView'],{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-run-result-footer']},'children':[{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-run-result-action-buttons']},'children':[this['acceptButtonView'],this['dismissButtonView'],this['outdatedButtonView']]},this['infoButtonView']]}]}),this['on']('click',()=>{this['fire']('activateChange',{'id':_0x26f7f5,'source':this});});}['setItemAsActive'](){this['isActive']=!0x0;}['setItemAsInactive'](){this['isActive']=!0x1;}['_createResultResponseView'](){const _0x3f1c32=new _0x43effc(this['locale']);return _0x3f1c32['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content','ck-content-direct-excluded','ck-ai-review-mode__check-run-result-response',this['bindTemplate']['if']('showDiff','ck-hidden',_0x52d5a2=>!_0x52d5a2)]}}),_0x3f1c32;}['_createAcceptButtonView'](){const _0x453335=new _0xcbb426(this['locale']);return _0x453335['set']({'label':i(this['locale'],'AI_REVIEW_MODE_ACCEPT_CHANGE'),'withText':!0x0}),_0x453335['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x3dd853=>{this['fire']('acceptChange',{'id':this['changeId']}),_0x3dd853['stopPropagation']();})},'attributes':{'class':['ck-ai-button-secondary','ck-ai-review-mode__check-run-result-accept-button',this['bindTemplate']['if']('status','ck-hidden',_0x5a391e=>'pending'!==_0x5a391e&&'accepted'!==_0x5a391e),this['bindTemplate']['if']('status','ck-ai-review-mode__check-run-result-accept-button',_0x10cfab=>'pending'===_0x10cfab),this['bindTemplate']['if']('status','ck-ai-review-mode__check-run-result-status-button',_0x9fe3c8=>'accepted'===_0x9fe3c8)]}}),this['on']('change:status',(_0x2a85f5,_0x35e370,_0x4c6d95)=>{_0x453335['isEnabled']=!0x1,'accepted'===_0x4c6d95&&(_0x453335['label']=i(this['locale'],'AI_REVIEW_MODE_CHECK_STATUS_ACCEPTED'),_0x453335['icon']=_0x3cb840);}),_0x453335;}['_createDismissButtonView'](){const _0xa52285=new _0xcbb426(this['locale']);return _0xa52285['set']({'label':i(this['locale'],'AI_REVIEW_MODE_DISMISS_CHANGE'),'withText':!0x0}),_0xa52285['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x47b890=>{this['fire']('dismissChange',{'id':this['changeId']}),_0x47b890['stopPropagation']();})},'attributes':{'class':['ck-ai-button-tertiary-filled',this['bindTemplate']['if']('status','ck-hidden',_0x122a92=>'pending'!==_0x122a92&&'rejected'!==_0x122a92),this['bindTemplate']['if']('status','ck-ai-review-mode__check-run-result-dismiss-button',_0x3d6259=>'pending'===_0x3d6259),this['bindTemplate']['if']('status','ck-ai-review-mode__check-run-result-status-button',_0x4531ac=>'rejected'===_0x4531ac)]}}),this['on']('change:status',(_0x1a8ed9,_0x4150af,_0x2ca738)=>{_0xa52285['isEnabled']=!0x1,'rejected'===_0x2ca738&&(_0xa52285['label']=i(this['locale'],'AI_REVIEW_MODE_CHECK_STATUS_REJECTED'),_0xa52285['icon']=_0x3a96a0);}),_0xa52285;}['_createInfoButtonView'](){const _0x1fe4b2=new _0xcbb426(this['locale']);return _0x1fe4b2['set']({'label':i(this['locale'],'AI_REVIEW_MODE_LEARN_MORE'),'icon':_0x314620,'tooltip':!0x0,'isToggleable':!0x0,'role':'menuitemcheckbox','class':'ck-ai-button-tertiary-filled\x20ck-ai-review-mode__check-run-result-info-button\x20ck-hidden'}),_0x1fe4b2['bind']('isOn')['to'](this,'isInfoToggleOn',_0x3deada=>_0x3deada),_0x1fe4b2['on']('execute',()=>{this['isInfoToggleOn']=!this['isInfoToggleOn'];}),_0x1fe4b2;}['_createOutdatedButtonView'](){const _0xd6cc44=new _0xcbb426(this['locale']);return _0xd6cc44['set']({'label':i(this['locale'],'AI_REVIEW_MODE_CHECK_STATUS_OUTDATED'),'icon':_0x2f860e,'withText':!0x0,'isEnabled':!0x1}),_0xd6cc44['extendTemplate']({'attributes':{'class':['ck-ai-button-secondary','ck-ai-review-mode__check-run-result-status-button',this['bindTemplate']['if']('status','ck-hidden',_0xe38543=>'outdated'!==_0xe38543)],'disabled':'disabled'}}),_0xd6cc44;}}class gr extends _0xcbb426{constructor(_0x5694f9){super(_0x5694f9),this['set']({'label':i(this['locale'],'AI_REVIEW_MODE_FINISH_REVIEW_BUTTON_LABEL'),'withText':!0x0,'class':'ck-ai-button-primary'}),this['on']('execute',()=>{this['fire']('finishReview');});}}class eh extends _0x3f0116{['_resultViews'];['resultsHeader'];['reviewDisclaimer'];['_cancelButtonView'];['_acceptAllButtonView'];['_exitReviewButtonView'];['_toggleDiffButtonView'];['_errorMessageView'];['_finishReviewButtonView'];constructor(_0x4c00be){super(_0x4c00be),this['_resultViews']=new _0x317ee8(),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 bi(_0x4c00be),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 _0x2fb61c=this['_createCombinedSkeletonLoader'](),_0x406d89=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-run',_0x406d89['if']('isVisible','ck-hidden',_0x378cf6=>!_0x378cf6)]},'children':[this['resultsHeader'],{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-run-results-wrapper']},'children':[this['_errorMessageView'],{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-run-results-container',this['bindTemplate']['if']('isLoading','ck-hidden',_0xef900e=>_0xef900e)]},'children':this['_resultViews']},_0x2fb61c]},this['reviewDisclaimer']]});}['clearResults'](){this['_resultViews']['clear']();}['getResults'](){return this['_resultViews'];}['addResult'](_0x33f242){const _0x1c56c3=new Ps(this['locale'],_0x33f242['id']);_0x1c56c3['delegate']('acceptChange','dismissChange','activateChange')['to'](this),this['_resultViews']['add'](_0x1c56c3),_0x1c56c3['resultResponseView']['element']['innerHTML']=_0x33f242['contentDiffed'];}['hideResult'](_0x1c08ca,_0x55c15e){if('pending'===_0x55c15e)return;const _0x36b5aa=this['_resultViews']['find'](_0x27e433=>_0x27e433['id']===_0x1c08ca);_0x36b5aa&&(_0x36b5aa['status']=_0x55c15e,_0x36b5aa['element']?.['classList']['add']('ck-ai-review-mode__check-run-result_grayout'));}['showResult'](_0x224c72,_0x5b4a4e){if('pending'!==_0x5b4a4e)return;const _0x2c09d8=this['_resultViews']['find'](_0x4092be=>_0x4092be['id']===_0x224c72);_0x2c09d8&&(_0x2c09d8['status']=_0x5b4a4e,_0x2c09d8['element']?.['classList']['remove']('ck-ai-review-mode__check-run-result_grayout'));}['setTitle'](_0x3684f6,_0x19464e){this['headerTitle']=_0x3684f6,this['headerSubtitle']=_0x19464e||'';}['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 Pe(this['locale'],Be['aiReviewChecks']);}['_createCombinedSkeletonLoader'](){const _0xae4c0b=new _0x43effc(this['locale']),_0x4e2ed5=[];for(let _0x5963dc=0x0;_0x5963dc<0x10;_0x5963dc++){const _0x3ad4fa=this['_createSkeletonLoader']();_0x3ad4fa['extendTemplate']({'attributes':{'class':['ck-ai-review-mode__check-run-skeleton-item']}}),_0x4e2ed5['push'](_0x3ad4fa);}return _0xae4c0b['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-run-skeleton-container',this['bindTemplate']['if']('isLoading','ck-hidden',_0x8c41a5=>!_0x8c41a5)]},'children':_0x4e2ed5}),_0xae4c0b;}['_createErrorView'](){const _0xc3763c=new _0x43effc(this['locale']),_0x1036db=new _0xcbb426(this['locale']),t=this['locale']['t'];return _0xc3763c['delegate']('retryReview')['to'](this),_0x1036db['set']({'label':t('Try\x20again'),'withText':!0x0,'class':'ck-ai-button-secondary\x20ck-ai-review-mode__check-run-error-retry-button'}),_0x1036db['on']('execute',()=>{this['fire']('retryReview');}),_0xc3763c['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-run-error-container',this['bindTemplate']['if']('showErrorMessage','ck-hidden',_0x1d0671=>!_0x1d0671),this['bindTemplate']['if']('errorType','ck-ai-review-mode__check-run-error-container_border-bottom',_0x5cc0c3=>'chunk'===_0x5cc0c3)]},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-notification','ck-ai-notification_error','ck-ai-notification__full-width','ck-ai-review-mode__check-run-error-message',this['bindTemplate']['if']('errorType','ck-ai-notification_warning',_0x396622=>'chunk'===_0x396622)]},'children':[{'tag':'p','attributes':{'class':['ck-ai-notification__content',this['bindTemplate']['if']('errorType','ck-hidden',_0x2e9059=>'general'!==_0x2e9059)]},'children':[{'text':i(this['locale'],'AI_REVIEW_MODE_GENERAL_ERROR_MESSAGE')}]},{'tag':'p','attributes':{'class':['ck-ai-notification__content',this['bindTemplate']['if']('errorType','ck-hidden',_0x53fa4b=>'chunk'!==_0x53fa4b)]},'children':[{'text':i(this['locale'],'AI_REVIEW_MODE_CHUNK_ERROR_MESSAGE')}]}]},_0x1036db]}),_0xc3763c;}['_createCancelButtonView'](){const _0x26d728=new _0xcbb426(this['locale']);return _0x26d728['set']({'label':i(this['locale'],'AI_REVIEW_MODE_STOP_GENERATING'),'withText':!0x0,'class':['ck-ai-button-secondary\x20ck-ai-button-stop-generating'],'icon':_0x171167}),_0x26d728['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isResultReady','ck-hidden',_0x2da039=>_0x2da039),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x5a5e92=>_0x5a5e92)]}}),_0x26d728['on']('execute',()=>{this['fire']('abortReviewStream');}),_0x26d728;}['_createToggleDiffButtonView'](){const _0x3882da=new _0xcbb426(this['locale']);_0x3882da['set']({'tooltip':!0x0,'isToggleable':!0x0,'role':'menuitemcheckbox'}),_0x3882da['bind']('isEnabled')['to'](this,'isError',_0x4d2f38=>!_0x4d2f38),_0x3882da['extendTemplate']({'attributes':{'class':['ck-ai-button-secondary','ck-ai-review-mode__check-run-toggle-diff-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0x183ece=>!_0x183ece),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x2a31e2=>_0x2a31e2)]}});const _0x218e34=i(this['locale'],'AI_REVIEW_MODE_HIDE_CHANGES'),_0x573110=i(this['locale'],'AI_REVIEW_MODE_SHOW_CHANGES');return _0x3882da['bind']('isOn')['to'](this,'isToggleDiffOn',_0xcb51fd=>_0xcb51fd),_0x3882da['bind']('icon')['to'](this,'isToggleDiffOn',_0xedc355=>_0xedc355?_0x3db73e:_0x2bc066),_0x3882da['bind']('label')['to'](this,'isToggleDiffOn',_0x4d3c66=>_0x4d3c66?_0x218e34:_0x573110),_0x3882da['on']('execute',()=>{this['isToggleDiffOn']=!this['isToggleDiffOn'],this['fire']('toggleDiff',{'on':this['isToggleDiffOn']});}),_0x3882da;}['_createAcceptAllButtonView'](){const _0x2a2c1=new _0xcbb426(this['locale']);return _0x2a2c1['set']({'label':i(this['locale'],'AI_REVIEW_MODE_ACCEPT_ALL'),'withText':!0x0}),_0x2a2c1['bind']('isEnabled')['to'](this,'isError',_0x2d2721=>!_0x2d2721),_0x2a2c1['extendTemplate']({'attributes':{'class':['ck-ai-button-primary','ck-ai-review-mode__check-run-accept-all-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0x28cc8a=>!_0x28cc8a),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x1ae3dd=>_0x1ae3dd)]}}),_0x2a2c1['on']('execute',()=>{this['fire']('acceptAllChanges');}),_0x2a2c1;}['_createExitReviewButtonView'](){const _0x4846f0=new _0xcbb426(this['locale']);return _0x4846f0['set']({'label':i(this['locale'],'AI_REVIEW_MODE_EXIT_REVIEW'),'withText':!0x0}),_0x4846f0['extendTemplate']({'attributes':{'class':['ck-ai-button-tertiary-filled','ck-ai-review-mode__check-run-exit-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0x201c3f=>!_0x201c3f),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x1672ac=>_0x1672ac)]}}),_0x4846f0['on']('execute',()=>{this['fire']('leaveReviewModeResultList');}),_0x4846f0;}['_createResultHeaderView'](){const _0x802d9c=new _0x43effc(this['locale']),_0x3ff100=this['_createTitleView']();return _0x802d9c['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-run-results-header',this['bindTemplate']['if']('isCompleted','ck-ai-review-mode__review-completed-header',_0x1b6b6d=>_0x1b6b6d)]},'children':[_0x3ff100,{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-run-results-header-buttons']},'children':[this['_cancelButtonView'],this['_acceptAllButtonView'],this['_exitReviewButtonView'],this['_toggleDiffButtonView'],this['_finishReviewButtonView']]}]}),_0x802d9c;}['_createTitleView'](){const _0x32e9ff=new _0x43effc(this['locale']),_0x12aadb=new We();return _0x12aadb['bind']('isVisible')['to'](this,'isResultReady',_0x58fed3=>!_0x58fed3),_0x32e9ff['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-run-results-header-title-wrapper']},'children':[_0x12aadb,{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-run-results-header-title-content',this['bindTemplate']['if']('isCompleted','ck-hidden',_0x3ba346=>_0x3ba346)]},'children':[{'tag':'span','attributes':{'class':['ck-ai-review-mode__check-run-results-header-title']},'children':[{'text':this['bindTemplate']['to']('headerTitle')}]},{'tag':'span','attributes':{'class':['ck-ai-review-mode__check-run-results-header-subtitle']},'children':[{'text':this['bindTemplate']['to']('headerSubtitle')}]}]},{'tag':'span','attributes':{'class':['ck-ai-review-mode__review-completed-header-title',this['bindTemplate']['if']('isCompleted','ck-hidden',_0x1813ed=>!_0x1813ed)]},'children':[{'text':i(this['locale'],'AI_REVIEW_MODE_FINISH_REVIEW_HEADER_TITLE')}]}]}),_0x32e9ff;}['_createFinishReviewButtonView'](){const _0x2d375c=new gr(this['locale']);return _0x2d375c['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isCompleted','ck-hidden',_0x39a64f=>!_0x39a64f)]}}),_0x2d375c['delegate']('finishReview')['to'](this),_0x2d375c;}}class th extends _0x3f0116{['resultsHeader'];['_finishReviewButtonView'];constructor(_0x46893e){super(_0x46893e),this['_finishReviewButtonView']=this['_createFinishReviewButtonView'](),this['resultsHeader']=this['_createResultHeaderView']();const _0x362d61=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__review-completed',_0x362d61['if']('isVisible','ck-hidden',_0x4e7ed4=>!_0x4e7ed4)]},'children':[this['resultsHeader'],{'tag':'div','attributes':{'class':['ck-ai-review-mode__review-completed-content']},'children':[{'tag':'span','attributes':{'class':['ck-ai-review-mode__review-completed-content-icon']},'children':[{'text':'👍'}]},{'tag':'p','attributes':{'class':['ck-ai-review-mode__review-completed-content-text']},'children':[{'text':i(_0x46893e,'AI_REVIEW_MODE_EMPTY_RESULTS_TEXT')}]}]}]});}['_createFinishReviewButtonView'](){const _0x4e870a=new gr(this['locale']);return _0x4e870a['delegate']('finishReview')['to'](this),_0x4e870a;}['_createResultHeaderView'](){const _0x46fe7e=new _0x43effc(this['locale']);return _0x46fe7e['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__review-completed-header']},'children':[{'tag':'span','attributes':{'class':['ck-ai-review-mode__review-completed-header-title']},'children':[{'text':i(this['locale'],'AI_REVIEW_MODE_FINISH_REVIEW_HEADER_TITLE')}]},{'tag':'div','attributes':{'class':['ck-ai-review-mode__review-completed-header-buttons']},'children':[this['_finishReviewButtonView']]}]}),_0x46fe7e;}}class hh extends _0x43effc{constructor(_0x2655f1){super(_0x2655f1),this['set']('isVisible',!0x1),this['set']('errorMessage','');const _0x2e0aea=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-review-mode__general-error-container',_0x2e0aea['if']('isVisible','ck-hidden',_0x555c5a=>!_0x555c5a)]},'children':[{'tag':'p','attributes':{'class':'ck\x20ck-ai-notification\x20ck-ai-notification_error'},'children':[{'text':_0x2e0aea['to']('errorMessage')}]}]});}}class ve extends _0x43effc{['reviewModeHeader'];['generalErrorView'];['reviewCheckListView'];['reviewCheckResultsView'];['reviewCompletedView'];constructor(_0x1b645d){super(_0x1b645d),this['reviewModeHeader']=new _0xbcda8a(_0x1b645d,{'label':i(_0x1b645d,'AI_REVIEW_MODE'),'icon':_0x223d73,'class':'ck-ai-header\x20ck-ai-header_review-mode'}),this['generalErrorView']=new hh(_0x1b645d),this['reviewCheckListView']=new ih(_0x1b645d),this['reviewCheckListView']['delegate'](...sh)['to'](this),this['reviewCheckResultsView']=new eh(_0x1b645d),this['reviewCheckResultsView']['delegate'](...sh)['to'](this),this['reviewCompletedView']=new th(_0x1b645d),this['reviewCompletedView']['delegate']('finishReview')['to'](this),this['reviewCheckListView']['set']('isVisible',!0x1),this['reviewCheckResultsView']['set']('isVisible',!0x1),this['reviewCheckResultsView']['set']('isLoading',!0x1),this['reviewCheckResultsView']['set']('isResultReady',!0x1),this['reviewCompletedView']['set']('isVisible',!0x1),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-ai-review-mode','ck-rounded-corners'],'dir':'ltr'},'children':[this['reviewModeHeader'],this['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'](_0x4b68c0){this['reviewCheckResultsView']['addResult'](_0x4b68c0),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;}['showGeneralReviewModeErrorView'](_0x5a4b60){this['generalErrorView']['set']('isVisible',!0x0),this['generalErrorView']['errorMessage']=_0x5a4b60;}['showGeneralResultsErrorView'](){this['reviewCheckResultsView']['set']('isLoading',!0x1),this['showActionsWhenResultIsReady'](),this['reviewCheckResultsView']['showGeneralErrorMessage']();}['showChunkErrorView'](){this['reviewCheckResultsView']['set']('isLoading',!0x1),this['showActionsWhenResultIsReady'](),this['reviewCheckResultsView']['showChunkErrorMessage']();}}class Ie extends _0x2ae23a{['resultItemView'];['_pinnedRectIndex']=void 0x0;['_pinnedTargetElement']=void 0x0;['_pinnedTargetChangeId']=void 0x0;constructor(_0x5c67c3,_0x2a4a35){super(_0x5c67c3),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']()),_0x2a4a35['add'](this);}['render'](){super['render'](),this['_setupClickOutsideHandler']();}['updateContent'](_0x26e2fc){this['resultItemView']['changeId']=_0x26e2fc['id'],this['resultItemView']['resultResponseView']['element']['innerHTML']=_0x26e2fc['contentDiffed'];}['showBalloon'](_0x5d347c,_0x70728,_0x27960e,_0x598c70,_0xb6e6c8,_0x2ffadc){this['_removeActiveClassFromMarkers'](),this['updateContent'](_0x5d347c),this['show']();const _0x338875=Array['from'](_0x70728['getClientRects']())['reverse'](),_0x27b8cb=this['_getPointedRectIndexFromEvent'](_0x27960e,_0x338875);'click'===_0x598c70?(this['isDiffActive']=!0x0,this['_setActiveClassOnMarker'](_0x5d347c['id']),this['pin']({'target':()=>this['_getBestRectPositionOnClick'](_0x70728,_0x27b8cb,_0x5d347c['id'],_0xb6e6c8,_0x2ffadc)})):'hover'===_0x598c70&&(this['isDiffActive']=!0x1,this['pin']({'target':()=>this['_getBestRectPositionOnHover'](_0x70728,_0x27b8cb,_0x5d347c['id'])}));}['hideBalloon'](){this['hide'](),this['unpin'](),this['_removeActiveClassFromMarkers'](),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');}['_removeActiveClassFromMarkers'](){lt['document']['querySelectorAll']('.ck-ai-review-mode__change_active')['forEach'](_0xde020f=>{_0xde020f['classList']['remove']('ck-ai-review-mode__change_active');});}['_setActiveClassOnMarker'](_0x346e32){lt['document']['querySelectorAll']('span[data-marker-id*=\x22'+_0x346e32+'\x22]')['forEach'](_0x5cb96a=>{_0x5cb96a['classList']['add']('ck-ai-review-mode__change_active');});}['_setupClickOutsideHandler'](){_0x4b855c({'emitter':this,'activator':()=>this['isVisible'],'contextElements':()=>{const _0x434edd=[this['element']];return this['_pinnedTargetElement']&&_0x434edd['push'](this['_pinnedTargetElement']),_0x434edd;},'callback':()=>{this['hide'](),this['unpin'](),this['_removeActiveClassFromMarkers'](),this['deactivateChange'](),this['_pinnedTargetElement']=void 0x0,this['_pinnedRectIndex']=void 0x0,this['_pinnedTargetChangeId']=void 0x0;}});}['_createContentView'](){const _0x483124=new _0x43effc();return this['resultItemView']=new Ps(this['locale'],''),this['resultItemView']['resultResponseView']['extendTemplate']({'attributes':{'class':['ck-content']}}),this['resultItemView']['delegate']('acceptChange','dismissChange')['to'](this),_0x483124['setTemplate']({'tag':'div','attributes':{'class':['ck-reset','ck-ai-review-mode-balloon-panel-suggestion',this['bindTemplate']['if']('isDiffActive','ck-ai-review-mode-balloon-panel-suggestion_diff-active')]},'children':[{'tag':'p','attributes':{'class':['ck-ai-review-mode__suggestion-text']},'children':[this['resultItemView']]}]}),_0x483124;}['_getBestRectPositionOnClick'](_0x5aa45d,_0x12e981,_0x581fef,_0x1909cc,_0x278bbb){const _0x5c78b0=this['position']['replace']('arrow_',''),_0x1d0a95=Array['from'](_0x5aa45d['getClientRects']());let _0x278c2e,_0xd9e91=_0x1d0a95['reverse']();return void 0x0!==_0x12e981&&this['_isPinnedRectVisible'](_0xd9e91[_0x12e981],_0x1909cc,_0x278bbb)?(_0x278c2e=_0xd9e91[_0x12e981],this['_pinnedRectIndex']=_0x12e981):this['_isPinnedRectVisible'](_0xd9e91[0x0],_0x1909cc,_0x278bbb)&&void 0x0===_0x12e981?_0x278c2e=_0xd9e91[0x0]:(_0xd9e91='s'==_0x5c78b0[0x0]?[..._0x1d0a95]['reverse']():_0x1d0a95,_0xd9e91['forEach'](_0x15e26c=>{this['_isPinnedRectVisible'](_0x15e26c,_0x1909cc,_0x278bbb)&&(_0x278c2e=_0x15e26c);})),this['_pinnedTargetChangeId']=_0x581fef,this['_pinnedTargetElement']=_0x5aa45d,_0x278c2e||_0x5aa45d['getBoundingClientRect']();}['_getBestRectPositionOnHover'](_0x3b583e,_0x4b0b36,_0x35f8a5){const _0x458985=Array['from'](_0x3b583e['getClientRects']())['reverse']();if(void 0x0===this['_pinnedRectIndex']&&void 0x0!==_0x4b0b36&&this['_pinnedTargetChangeId']!==_0x35f8a5)return this['_pinnedRectIndex']=_0x4b0b36,this['_pinnedTargetElement']=_0x3b583e,this['_pinnedTargetChangeId']=_0x35f8a5,_0x458985[_0x4b0b36];if(void 0x0!==this['_pinnedRectIndex']&&this['_pinnedTargetChangeId']===_0x35f8a5){if(_0x3b583e!==this['_pinnedTargetElement'])return Array['from'](this['_pinnedTargetElement']['getClientRects']())['reverse']()[this['_pinnedRectIndex']];return _0x458985[this['_pinnedRectIndex']];}return void 0x0!==_0x4b0b36&&this['_pinnedTargetChangeId']!==_0x35f8a5?(this['_pinnedRectIndex']=_0x4b0b36,this['_pinnedTargetElement']=_0x3b583e,this['_pinnedTargetChangeId']=_0x35f8a5,_0x458985[_0x4b0b36]):_0x3b583e['getBoundingClientRect']();}['_getPointedRectIndexFromEvent'](_0x771285,_0x12c239){if(_0x771285)for(let _0x559769=0x0;_0x559769<_0x12c239['length'];_0x559769++){const _0x34b670=_0x12c239[_0x559769];if(_0x771285['clientX']>=_0x34b670['left']-0x3&&_0x771285['clientX']<=_0x34b670['right']+0x3&&_0x771285['clientY']>=_0x34b670['top']-0x3&&_0x771285['clientY']<=_0x34b670['bottom']+0x3)return _0x559769;}}['_isPinnedRectVisible'](_0x1ab6fd,_0x5b203a,_0x53520b){const _0x4e5234=new ct(_0x1ab6fd),_0x5a2eaf=_0x5b203a||document['documentElement'],_0x2cd1b2=_0x4e5234['getIntersection'](_0x114f82(_0x53520b)),_0x3098f8=new ct(_0x5a2eaf)['getIntersection'](_0x4e5234);return!!(_0x2cd1b2&&_0x3098f8&&_0x4e5234['width']>0x0);}}const sh=['getReviewCheckList','runReviewCheck','abortReviewStream','toggleDiff','acceptAllChanges','leaveReviewModeResultList','activateChange','acceptChange','dismissChange','learnMore','finishReview','retryReview'];class me extends ot{['_reviewModeView'];['_reviewModeBalloonSuggestionItemView'];['_bodyCollection'];static get['requires'](){return[Ct];}static get['pluginName'](){return'AIReviewModeUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x307efd){super(_0x307efd),this['_bodyCollection']=new _0x44dc72(this['context']['locale']),this['_bodyCollection']['attachToDom'](),this['_reviewModeView']=new ve(this['context']['locale']),this['_reviewModeView']['delegate'](...sh)['to'](this),this['_reviewModeBalloonSuggestionItemView']=new Ie(this['context']['locale'],this['_bodyCollection']),this['_reviewModeBalloonSuggestionItemView']['delegate']('acceptChange','dismissChange','deactivateChange')['to'](this);}['init'](){const _0x3c66fd=this['context']['plugins']['get']('AITabs');_0x3c66fd['view']['on']('activateTab',(_0xaa578b,_0x3307a9)=>{'reviewMode'===_0x3307a9?this['fire']('getReviewCheckList'):this['fire']('leaveReviewMode');}),_0x3c66fd['view']['addTab']({'id':'reviewMode','buttonLabel':i(this['context']['locale'],'AI_REVIEW_MODE'),'buttonIcon':_0x223d73,'order':0x0,'content':this['_reviewModeView']});}['destroy'](){this['_bodyCollection']['detachFromDom'](),super['destroy']();}['setAvailableChecks'](_0x26a001){this['_reviewModeView']['reviewCheckListView']['hasChecks']()||this['_reviewModeView']['reviewCheckListView']['setChecks'](_0x26a001),this['_reviewModeView']['showReviewCheckListView']();}['showReviewCheckList'](){this['fire']('getReviewCheckList');}['showCheckRunResults'](_0x3b1e1a){_0x3b1e1a&&('error-general'!==_0x3b1e1a['status']?'error-chunk'!==_0x3b1e1a['status']?this['_reviewModeView']['showReviewCheckResultsView']():this['showChunkErrorView']():this['showGeneralResultsErrorView']());}['showCheckRunResult'](_0x150d66){this['_reviewModeView']['addCheckRunResult'](_0x150d66);}['showGeneralResultsErrorView'](){this['_reviewModeView']['showGeneralResultsErrorView']();}['showGeneralReviewModeErrorView'](_0x530d43){this['_reviewModeView']['showGeneralReviewModeErrorView'](_0x530d43??i(this['context']['locale'],'AI_REVIEW_INITIALIZATION_ERROR_MESSAGE'));}['showChunkErrorView'](){this['_reviewModeView']['showChunkErrorView']();}['setCheckResultTitle'](_0x45066b,_0x2a4763){this['_reviewModeView']['reviewCheckResultsView']['setTitle'](_0x45066b,_0x2a4763);}['setActiveStateInResults'](_0x27e910){this['_reviewModeView']['reviewCheckResultsView']['getResults']()['forEach'](_0x5737a3=>{_0x5737a3['id']===_0x27e910&&_0x5737a3['setItemAsActive']();});}['resetActiveStateInResults'](){this['_reviewModeView']['reviewCheckResultsView']['getResults']()['forEach'](_0x57305d=>_0x57305d['setItemAsInactive']());}['updateChangeState'](_0x1189c7,_0x5305ff){'accepted'===_0x5305ff||'rejected'===_0x5305ff||'outdated'===_0x5305ff?this['_reviewModeView']['reviewCheckResultsView']['hideResult'](_0x1189c7,_0x5305ff):this['_reviewModeView']['reviewCheckResultsView']['showResult'](_0x1189c7,_0x5305ff);}['showReviewCompletedView'](){this['_reviewModeView']['showReviewCompletedView']();}['showActionsWhenResultIsReady'](){this['_reviewModeView']['showActionsWhenResultIsReady']();}['showNoChangesView'](){this['_reviewModeView']['showNoChangesView']();}['hideActionsWhenResultIsReady'](){this['_reviewModeView']['hideActionsWhenResultIsReady']();}['showChangeBalloon'](_0x45ba11,_0x4e1f85,_0x4b41cf,_0x4124ea,_0x102302,_0x5b3f54){this['_reviewModeBalloonSuggestionItemView']['showBalloon'](_0x45ba11,_0x4e1f85,_0x4b41cf,_0x4124ea,_0x102302,_0x5b3f54);}['hideChangeBalloon'](){this['_reviewModeBalloonSuggestionItemView']['hideBalloon']();}['hideDiffInBalloon'](){this['_reviewModeBalloonSuggestionItemView']['hideDiffInBalloon']();}['showDiffInBalloon'](){this['_reviewModeBalloonSuggestionItemView']['showDiffInBalloon']();}['getChangeElement'](_0x5c39ed){const _0x42ae89=this['_reviewModeView']['reviewCheckResultsView']['getResults']()['find'](_0x26fc63=>_0x26fc63['id']===_0x5c39ed);return _0x42ae89?_0x42ae89['element']:null;}['deactivateChange'](){this['_reviewModeBalloonSuggestionItemView']['deactivateChange']();}}const we='reviewmode-';class ce extends ot{static get['pluginName'](){return'AIReviewModeEditing';}static get['requires'](){return[_0x2dc9e7,R];}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['_markers']=new Map();['_domEmitter'];['_eventEmitter'];constructor(_0x5b1928){super(_0x5b1928),this['_domEmitter']=new(_0x5b5d27())(),this['_eventEmitter']=new(_0x19d98c())();}get['emitter'](){return this['_eventEmitter'];}['afterInit'](){const _0x359727=ut(this['context']);_0x359727['conversion']['for']('editingDowncast')['markerToElement']({'model':we+'insert','view':(_0x29bca7,{writer:_0x564bdb})=>{const _0x58f281=this['_markers']['get'](_0x29bca7['markerName']),_0x1d0e47={'class':'ck-ai_review-mode-marker_add','data-marker-id':_0x29bca7['markerName']};return _0x564bdb['createUIElement']('span',_0x1d0e47,function(_0x519a6d){const _0x38941d=this['toDomElement'](_0x519a6d);return _0x38941d['innerHTML']=_0x58f281?.['text']||'',_0x38941d;});}}),_0x359727['conversion']['for']('editingDowncast')['markerToHighlight']({'model':we+'remove-only','view':_0x40583a=>({'classes':'ck-ai_review-mode-marker_strikethrough','attributes':{'data-marker-id':_0x40583a['markerName']}})}),_0x359727['conversion']['for']('editingDowncast')['markerToHighlight']({'model':we+'remove-context','view':_0x400274=>({'classes':'ck-ai_review-mode-marker_underline','attributes':{'data-marker-id':_0x400274['markerName']}})}),_0x359727['conversion']['for']('editingDowncast')['markerToHighlight']({'model':we+'remove-text','view':_0x125469=>({'classes':'ck-ai_review-mode-marker_hide','attributes':{'data-marker-id':_0x125469['markerName']}})}),_0x359727['conversion']['for']('dataDowncast')['markerToElement']({'model':we+'suggestion-context','view':(_0x1b7af1,{writer:_0x262253})=>_0x262253['createRawElement']('span',{'class':'ck-ai_review-mode-marker_context-'+(_0x1b7af1['isOpening']?'start':'end')})}),_0x359727['conversion']['for']('downcast')['attributeToAttribute']({'model':yt,'view':_0x29ff88}),this['_domEmitter']['listenTo'](document,'click',(_0x8a3dbe,_0x4c0045)=>{const _0x1e3e97=_0x4c0045['target'],_0x48f1f6=this['_findMarkerElement'](_0x1e3e97);if(!_0x48f1f6)return;const _0x5ef12=_0x48f1f6['getAttribute']('data-marker-id'),_0x176334=_0x5ef12['split'](':')['pop']()?.['split']('_')[0x0];this['_eventEmitter']['fire']('changeMarkerClick',{'markerId':_0x5ef12,'changeId':_0x176334,'markerElement':_0x48f1f6,'domEvent':_0x4c0045});}),this['_domEmitter']['listenTo'](document,'mouseover',(_0x1f00dd,_0x132ba0)=>{const _0x67ea67=_0x132ba0['target'],_0x580e8d=_0x132ba0['relatedTarget'];let _0x3aa548=this['_findMarkerElement'](_0x67ea67);if(!_0x3aa548&&_0x580e8d&&(_0x3aa548=this['_findMarkerElement'](_0x580e8d)),!_0x3aa548)return;const _0x23bd0a=_0x3aa548['getAttribute']('data-marker-id'),_0xcd445c=_0x23bd0a['split'](':')['pop']()?.['split']('_')[0x0];this['_eventEmitter']['fire']('changeMarkerHovered',{'changeId':_0xcd445c,'markerElement':_0x3aa548,'domEvent':_0x132ba0});}),this['_domEmitter']['listenTo'](document,'mouseover',_0x51d0da((_0x14e130,_0x14f75b)=>{const _0x3e8ff5=_0x14f75b['target'];if(this['_findMarkerElement'](_0x3e8ff5))return;_0x3e8ff5['closest']('.ck-reset.ck-ai-review-mode-balloon-panel-suggestion')||this['_eventEmitter']['fire']('changeMarkerBlurred');},0xc8)),_0x359727['model']['document']['registerPostFixer'](_0x528f73=>this['_validateMarkers'](_0x359727,_0x528f73)),_0x359727['model']['document']['on']('change',()=>this['_handleMarkerChanges'](_0x359727));}['getDocumentData'](){const _0x13348b=this['context']['plugins']['get']('AIEditing'),_0x34dfeb=ut(this['context']),_0x22e1dc=_0x34dfeb['model'],_0x21b144=new _0x490745();for(const _0x16fcca of _0x22e1dc['document']['getRoot']()['getChildren']()){const _0x20307d=_0x16fcca['_clone'](!0x0);_0x21b144['_appendChild'](_0x20307d);}for(const _0x7b4532 of _0x22e1dc['markers'])_0x21b144['markers']['set'](_0x7b4532['name'],this['_changeRangeOwnerDocument'](_0x7b4532['getRange']()['clone'](),_0x21b144));const _0x10c6e8=new _0x467163({'ignoreElementEnd':!0x0,'startPosition':_0x22e1dc['createPositionAt'](_0x21b144,0x0)}),_0x21bd1c=new Set(),_0x3d3c67=new Map();for(const {item:_0x2c36b7}of _0x10c6e8){if(!_0x2c36b7['is']('$textProxy'))continue;const _0x228198=_0x2c36b7['parent'];if(_0x228198&&_0x228198['is']('element')){const _0x27b5bb=this['_upsertDataId'](_0x228198,()=>_0x13348b['_nextDataId'](_0x21bd1c));_0x21bd1c['add'](_0x27b5bb);for(const _0x10a8e2 of _0x228198['getChildren']())_0x10a8e2['is']('element')&&_0x21bd1c['add'](this['_upsertDataId'](_0x10a8e2,()=>_0x13348b['_nextDataId'](_0x21bd1c)));let _0x35dc9f=_0x228198;for(;_0x35dc9f['parent']&&!_0x35dc9f['parent']['is']('documentFragment');)_0x35dc9f=_0x35dc9f['parent'],_0x35dc9f['hasAttribute'](yt)&&_0x35dc9f['_removeAttribute'](yt);_0x3d3c67['set'](_0x27b5bb,{'path':_0x228198['getPath'](),'getContent':this['_createGetContentUsingDataIdFn'](_0x35dc9f['_clone'](!0x0),_0x27b5bb,_0x34dfeb['data'])}),_0x10c6e8['jumpTo'](_0x22e1dc['createPositionAfter'](_0x228198));}}return{'content':_0x34dfeb['data']['processor']['toData'](_0x34dfeb['data']['toView'](_0x21b144)),'version':_0x34dfeb['model']['document']['version'],'elements':_0x3d3c67};}['diffContent'](_0x11e8a4,_0x28bf28){const _0x51b30f=[],_0x28c8f1=ut(this['context']),_0x753dc5=_0x28c8f1['data']['parse'](_0x28bf28,'$documentFragment'),_0x326868=_0x28c8f1['data']['parse'](_0x11e8a4,'$documentFragment'),_0x597750=_0x28c8f1['model']['createPositionAt'](_0x326868,0x0);if(this['_haveSingleTopLevelElement'](_0x753dc5)){if(!this['_hasSameTopLevelElement'](_0x326868,_0x753dc5))return _0x51b30f;}else{const _0x2c7661=_0x28c8f1['model']['schema'];if(!this['_haveOnlyInlineContent'](_0x326868,_0x2c7661)||!this['_haveOnlyInlineContent'](_0x753dc5,_0x2c7661))return _0x51b30f;}const _0x110c18=this['context']['plugins']['get']('DocumentCompare')['getDiff'](_0x11e8a4,_0x28bf28,{'anchor':_0x597750,'markDeletions':!0x0})['getOperations']()['filter'](_0x404c9a=>'insert'===_0x404c9a['type']||'marker'===_0x404c9a['type']&&_0x404c9a['name']['startsWith']('$markedRemove')),_0x754928=this['_groupAdjacentOperations'](_0x110c18);let _0x4382d5=0x0;return _0x28c8f1['model']['change'](_0x172808=>{for(let _0x251085=0x0;_0x251085<_0x754928['length'];_0x251085++){const _0x371e6a=_0x754928[_0x251085],_0x124e56=_0x172808['createDocumentFragment']();for(const _0x4b8bf0 of _0x326868['getChildren']())_0x172808['append'](_0x4b8bf0['_clone'](!0x0),_0x124e56);for(const _0x130117 of _0x371e6a['operationsIsolated'])if('insert'===_0x130117['type']){const _0x325082=_0x130117;_0x325082['baseVersion']=null,_0x325082['isDocumentOperation']=!0x1,this['_changeOperationOwnerDocument'](_0x325082,_0x124e56),_0x172808['batch']['addOperation'](_0x130117),_0x28c8f1['model']['applyOperation'](_0x130117);const _0xfb9933='suggestion:insertion:id:authorId:'+_0x4382d5++,_0x2e9a08=_0x28c8f1['model']['createRange'](_0x325082['position'],_0x325082['position']['getShiftedBy'](_0x325082['howMany']));_0x124e56['markers']['set'](_0xfb9933,_0x2e9a08);}else{if('marker'===_0x130117['type']&&_0x130117['name']['startsWith']('$markedRemove')){const _0x31b1e5=_0x130117,_0x5dee9a='suggestion:deletion:id:authorId:'+_0x4382d5++;this['_changeOperationOwnerDocument'](_0x31b1e5,_0x124e56),_0x124e56['markers']['set'](_0x5dee9a,_0x31b1e5['newRange']);}}const _0x2aa998=this['_getChangeContext'](this['_changePositionOwnerDocument'](this['_getOperationStart'](_0x371e6a['operationsIsolated'][0x0]),_0x124e56),this['_changePositionOwnerDocument'](this['_getOperationEnd'](_0x371e6a['operationsIsolated'][_0x371e6a['operationsIsolated']['length']-0x1]),_0x124e56));_0x124e56['markers']['set'](we+'suggestion-context',new _0x1026dd(_0x2aa998['start'],_0x2aa998['end'])),_0x51b30f['push']({..._0x371e6a,'context':this['_createGetContextFn'](_0x124e56,_0x28c8f1['data'],{'ellipsisBefore':_0x2aa998['hasContentBefore'],'ellipsisAfter':_0x2aa998['hasContentAfter']}),'content':this['_createGetContentFn'](_0x124e56,_0x28c8f1['data'])});}}),_0x51b30f;}['markChangePositionInEditorContent'](_0x4d88b8,_0x2885d3){if(!_0x4d88b8['length'])return;const _0x4d8565=_0x4d88b8[0x0]['parent']['id'],_0x2acf39=_0x2885d3['elements']['get'](_0x4d8565);if(!_0x2acf39)return void console['warn']('No\x20element\x20found\x20for\x20ID:\x20'+_0x4d8565);const _0x533fe3=_0x2acf39['path'],_0x4a1e59=ut(this['context']),_0x31e300=_0x4a1e59['model']['document']['history']['getOperations'](_0x2885d3['version']),_0x3233d8=[];for(const _0x2c8fcc of _0x4d88b8){const _0xb1f95a=_0x2c8fcc['operationsIsolated']['map'](_0x55b64e=>this['_translateOperationToEditorContent'](_0x55b64e,_0x533fe3,_0x4a1e59['model']['document']['getRoots']()[0x0]));if(!_0xb1f95a||!_0xb1f95a['length'])continue;const _0x47a126=_0xb1f95a['every'](_0xe0ea57=>'marker'===_0xe0ea57['type']&&_0xe0ea57['name']['startsWith']('$markedRemove')),_0x4dad33={'document':_0x4a1e59['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1},_0x1a073e=st(_0xb1f95a,_0x31e300,_0x4dad33)['operationsA'];for(const _0x47a2de of _0x1a073e)if('insert'===_0x47a2de['type']){const _0x48c8b4=_0x47a2de,_0x2d1672=_0x48c8b4['nodes'];let _0x432d26='';for(const _0x3ab0bc of _0x2d1672)_0x3ab0bc&&_0x3ab0bc['is']('model:$text')&&(_0x432d26+=_0x3ab0bc['data']);_0x3233d8['push']({'start':_0x48c8b4['position'],'end':_0x48c8b4['position'],'type':'insert','groupId':_0x2c8fcc['id'],'text':_0x432d26});}else{if('marker'===_0x47a2de['type']&&_0x47a2de['name']['startsWith']('$markedRemove')){const _0x2abaef=_0x47a2de;let _0x158e14='remove-text';if(_0x47a126){const _0x5678ea=this['_findAdjacentContextDistance'](_0x2abaef['newRange']['start'],'backward',_0x4a1e59['model']['schema']),_0x85de1b=this['_findAdjacentContextDistance'](_0x2abaef['newRange']['end'],'forward',_0x4a1e59['model']['schema']);if(_0x5678ea||_0x85de1b){const _0x5e6209=_0x2abaef['newRange']['start']['getShiftedBy'](-_0x5678ea),_0x55c92e=_0x2abaef['newRange']['end']['getShiftedBy'](_0x85de1b);_0x3233d8['push']({'start':_0x5e6209,'end':_0x55c92e,'groupId':_0x2c8fcc['id'],'type':'remove-context'});}else _0x158e14='remove-only';}_0x3233d8['push']({'start':_0x2abaef['newRange']['start'],'end':_0x2abaef['newRange']['end'],'groupId':_0x2c8fcc['id'],'type':_0x158e14});}}}this['_insertMarkers'](_0x3233d8);}['clearAllMarkers'](){const _0x949fab=ut(this['context']);_0x949fab['model']['change'](_0x10b36d=>{for(const _0x15c98d of this['_markers']['keys']())_0x949fab['model']['markers']['get'](_0x15c98d)&&_0x10b36d['removeMarker'](_0x15c98d);}),this['_markers']['clear']();}['switchToReadOnly'](){ut(this['context'])['enableReadOnlyMode']('ai-review-mode');}['switchToEdit'](){ut(this['context'])['disableReadOnlyMode']('ai-review-mode');}['applyChange'](_0x37651f){const _0x121548=ut(this['context']),_0x433454=_0x121548['model'],_0x47e75e=_0x37651f['map'](_0x6ddf35=>this['_getMarkersDataForGroup'](_0x6ddf35))['flat']();_0x433454['change'](_0x934b10=>{for(const _0x31ffc4 of _0x47e75e){const _0x5e5f60=_0x121548['model']['markers']['get'](_0x31ffc4['id']);_0x5e5f60&&('insert'===_0x31ffc4['type']?_0x433454['insertContent'](_0x934b10['createText'](_0x31ffc4['text']||''),_0x5e5f60['getRange']()['start']):'remove-text'!==_0x31ffc4['type']&&'remove-only'!==_0x31ffc4['type']||_0x433454['deleteContent'](_0x433454['createSelection'](_0x5e5f60['getRange']())),_0x934b10['removeMarker'](_0x31ffc4['id']),this['_markers']['delete'](_0x31ffc4['id']));}});}['rejectChange'](_0x15c2b3){const _0x101b7c=ut(this['context']),_0x5605c3=this['_getMarkersDataForGroup'](_0x15c2b3);_0x101b7c['model']['change'](_0x1c2931=>{for(const _0x4116b6 of _0x5605c3)_0x1c2931['removeMarker'](_0x4116b6['id']),this['_markers']['delete'](_0x4116b6['id']);});}['getEditor'](){return ut(this['context']);}['getMarkerElementForChange'](_0x1a61f3){const _0x471311=Array['from'](this['_markers']['values']())['filter'](_0x482732=>_0x482732['groupId']===_0x1a61f3);if(!_0x471311['length'])return null;const _0x310cdf=0x1===_0x471311['length']?_0x471311[0x0]:this['_sortMarkers'](_0x471311)[0x0],_0x492782=ut(this['context']),_0x3e55a3=_0x492782['model']['markers']['get'](_0x310cdf['id']);if(!_0x3e55a3)return null;const _0x28cade=_0x3e55a3['getRange'](),_0x4c76e5=_0x492782['editing']['view']['getDomRoot']();if(!_0x4c76e5||!_0x28cade)return null;const _0x2fc4be=_0x4c76e5['querySelector']('[data-marker-id=\x22'+_0x310cdf['id']+'\x22]');return _0x2fc4be?{'modelRange':_0x28cade,'domElement':_0x2fc4be}:null;}['_validateMarkers'](_0x4022cf,_0xce90d7){const _0xa3458c=Array['from'](this['_markers']['keys']()),_0x488600=new Map();for(const _0x5ed30d of _0xa3458c){const _0x1723b3=_0x4022cf['model']['markers']['get'](_0x5ed30d);if(!_0x1723b3)continue;const _0x5ae3c8=_0x1723b3['getStart']()['path'][0x0];_0x488600['has'](_0x5ae3c8)||_0x488600['set'](_0x5ae3c8,[]),_0x488600['get'](_0x5ae3c8)['push'](_0x1723b3);}const _0x3fd63a=new Set();for(const _0x9c900c of _0x4022cf['model']['document']['differ']['getChanges']()){let _0x581e80=-0x1,_0xda8f5b=null;if('insert'===_0x9c900c['type'])_0xda8f5b=new _0x1026dd(_0x9c900c['position'],_0x9c900c['position']['getShiftedBy'](_0x9c900c['length'])),_0x581e80=_0x9c900c['position']['path'][0x0];else{if('remove'!==_0x9c900c['type'])continue;_0xda8f5b=new _0x1026dd(_0x9c900c['position']),_0x581e80=_0x9c900c['position']['path'][0x0];}const _0x56e118=_0x488600['get'](_0x581e80)||[];if(_0x56e118['length']){for(const _0x3ba64f of _0x56e118)if(_0xda8f5b['root']['rootName']===_0x3ba64f['getRange']()['root']['rootName']&&('insert'!==_0x9c900c['type']||!_0xda8f5b['containsRange'](_0x3ba64f['getRange']()))&&(_0xda8f5b['isIntersecting'](_0x3ba64f['getRange']())||_0xda8f5b['start']['isTouching'](_0x3ba64f['getRange']()['end'])||_0xda8f5b['end']['isTouching'](_0x3ba64f['getRange']()['start']))){const _0x3bebc8=this['_parseMarkerName'](_0x3ba64f['name']);Array['from'](this['_markers']['values']())['filter'](_0x393be7=>_0x393be7['groupId']===_0x3bebc8['groupId'])['forEach'](_0x23267e=>_0x3fd63a['add'](_0x23267e['id']));}}}if(_0x3fd63a['size']){for(const _0x2c3534 of _0x3fd63a)_0xce90d7['removeMarker'](_0x2c3534);return!0x0;}return!0x1;}['_handleMarkerChanges'](_0x33db45){for(const {name:_0x3595b8,data:_0x4aab0a}of _0x33db45['model']['document']['differ']['getChangedMarkers']()){if(!_0x3595b8['startsWith'](we))continue;const _0x14274e=_0x4aab0a['oldRange'],_0x214680=_0x4aab0a['newRange'],_0x2030af=_0x14274e&&'$graveyard'===_0x14274e['root']['rootName'],_0x3f8143=_0x214680&&'$graveyard'===_0x214680['root']['rootName'];if(_0x2030af&&_0x3f8143)continue;const _0x82e553=this['_parseMarkerName'](_0x3595b8);this['_markers']['get'](_0x3595b8)&&(_0x3f8143||!_0x214680?this['_eventEmitter']['fire']('changeMarkerRemoved',{'markerId':_0x3595b8,'changeId':_0x82e553['groupId']}):_0x2030af&&_0x214680&&this['_eventEmitter']['fire']('changeMarkerRestored',{'markerId':_0x3595b8,'changeId':_0x82e553['groupId']}));}}['_parseMarkerName'](_0x421929){const _0x50c492=_0x421929['split'](':'),_0x3311ae=(_0x50c492[0x1]||'')['split']('_');return{'prefix':_0x50c492[0x0],'groupId':_0x3311ae[0x0],'suffix':_0x3311ae[0x1]};}['_translateOperationToEditorContent'](_0x2d3820,_0x2737b2,_0x233b4d){if('insert'===_0x2d3820['type']){const _0x3e2c05=_0x2d3820;return new _0x55f538(this['_changePosition'](_0x2737b2['concat'](_0x3e2c05['position']['offset']),_0x233b4d),_0x3e2c05['nodes'],_0x3e2c05['baseVersion']);}if('marker'===_0x2d3820['type']&&_0x2d3820['name']['startsWith']('$markedRemove')){const _0x284f27=_0x2d3820;return new _0x22c2d1(_0x284f27['name'],_0x284f27['oldRange'],this['_changeRange'](_0x284f27['newRange'],_0x2737b2['concat'](_0x284f27['newRange']['start']['offset']),_0x2737b2['concat'](_0x284f27['newRange']['end']['offset']),_0x233b4d),_0x284f27['_markers'],_0x284f27['affectsData'],_0x284f27['baseVersion']);}return _0x2d3820;}['_groupAdjacentOperations'](_0xb135f2){if(!_0xb135f2['length'])return[];const _0x4cca16=[];let _0x1b80be=0x0,_0x1c36be=0x0,_0x42a57a=[];for(let _0x59d997=0x0;_0x59d997<=_0xb135f2['length'];_0x59d997++){const _0x3a54c9=_0xb135f2[_0x59d997],_0x511877=_0xb135f2[_0x59d997-0x1];!_0x3a54c9||_0x511877&&!this['_getOperationEnd'](_0x511877)['isTouching'](this['_getOperationStart'](_0x3a54c9))?(_0x4cca16['push']({'operations':_0x42a57a,'operationsIsolated':_0x42a57a['map'](_0x4ba93d=>this['_shiftOperation'](_0x4ba93d['clone'](),-_0x1c36be)),'groupOffset':_0x1b80be}),_0x42a57a=_0x3a54c9?[_0x3a54c9]:[],_0x1c36be+=_0x1b80be,_0x1b80be=0x0):_0x42a57a['push'](_0x3a54c9),_0x3a54c9&&'insert'===_0x3a54c9['type']&&(_0x1b80be+=_0x3a54c9['howMany']);}return _0x4cca16;}['_findAdjacentContextDistance'](_0x596bc7,_0x5c4886,_0x22042d,_0x236d8a=0x1){const _0x1e4c1b=new _0x467163({'startPosition':_0x596bc7,'direction':_0x5c4886});let _0x1d3ebd=0x0;for(let _0x4df6ca=0x0;_0x4df6ca<_0x236d8a;_0x4df6ca++){let _0x60dbd1=0x0,_0x1ad860=!0x1,_0x4594a2='forward'===_0x5c4886?/^\W*\w+/:/\w+\W*$/;for(const {item:_0x25da1e}of _0x1e4c1b)if(_0x25da1e['is']('$textProxy')){const _0x5e7292=_0x4594a2['exec'](_0x25da1e['data']);if(_0x5e7292&&_0x5e7292['length']){if(_0x60dbd1+='forward'===_0x5c4886?_0x5e7292['index']+_0x5e7292[0x0]['length']:_0x25da1e['data']['length']-_0x5e7292['index'],_0x5e7292[0x0]['length']!==_0x25da1e['data']['length'])break;_0x1ad860=!0x0,_0x4594a2='forward'===_0x5c4886?/^\w+/:/\w+$/;}else{if(_0x1ad860)break;_0x60dbd1+=_0x25da1e['offsetSize'];}}else{if(_0x25da1e['is']('element')){_0x22042d['isInline'](_0x25da1e)&&!_0x1ad860&&(_0x60dbd1+=0x1);break;}}_0x1d3ebd+=_0x60dbd1,_0x1e4c1b['jumpTo'](_0x596bc7['getShiftedBy']('forward'===_0x5c4886?_0x1d3ebd:-_0x1d3ebd));}return _0x1d3ebd;}['_getChangeContext'](_0x2a6259,_0x464b08){const _0x381996=ut(this['context'])['model']['schema'],_0x59adef=this['_findAdjacentContextDistance'](_0x2a6259,'backward',_0x381996,0x6),_0x5ac8a6=this['_findAdjacentContextDistance'](_0x464b08,'forward',_0x381996,0x6),_0x4a807e=_0x2a6259['getShiftedBy'](-_0x59adef),_0x311245=_0x464b08['getShiftedBy'](_0x5ac8a6);return{'start':_0x4a807e,'end':_0x311245,'hasContentBefore':!_0x4a807e['isAtStart'],'hasContentAfter':!_0x311245['isAtEnd']};}['_insertMarkers'](_0x263027){const _0x3b946c=this['context']['plugins']['get']('AIEditing'),_0x154560=new Set();ut(this['context'])['model']['change'](_0x4864b8=>{for(const _0x7cbd2e of _0x263027){const _0x7de82e=''+we+_0x7cbd2e['type']+':'+_0x7cbd2e['groupId']+'_'+_0x3b946c['_nextDataId'](_0x154560);this['_markers']['set'](_0x7de82e,{'id':_0x7de82e,'groupId':_0x7cbd2e['groupId'],'type':_0x7cbd2e['type'],'text':_0x7cbd2e['text']}),_0x4864b8['addMarker'](_0x7de82e,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x4864b8['createRange'](_0x7cbd2e['start'],_0x7cbd2e['end'])});}});}['_createGetContextFn'](_0x32fcc2,_0x385d02,_0x1b8f78){let _0x2b8623='';return()=>{if(!_0x2b8623){const _0x24351=_0x385d02['toView'](_0x32fcc2,{'showSuggestionHighlights':!0x0});let _0x414dc9=_0x24351['getChild'](0x0);if(_0x414dc9['is']('containerElement')||(_0x414dc9=_0x24351),!_0x414dc9)return'';let _0x3cb9fd=!0x1;const _0x10a60c=[];for(const _0x4024f0 of _0x414dc9['getChildren']())_0x4024f0['is']('element','span')&&_0x4024f0['hasClass']('ck-ai_review-mode-marker_context-end')&&(_0x3cb9fd=!0x1),_0x3cb9fd&&_0x10a60c['push'](_0x4024f0),_0x4024f0['is']('element','span')&&_0x4024f0['hasClass']('ck-ai_review-mode-marker_context-start')&&(_0x3cb9fd=!0x0);_0x414dc9['_removeChildren'](0x0,_0x414dc9['childCount']),_0x1b8f78?.['ellipsisBefore']&&_0x414dc9['_appendChild']('…'),_0x414dc9['_appendChild'](_0x10a60c),_0x1b8f78?.['ellipsisAfter']&&_0x414dc9['_appendChild']('…');const _0x3f7caf=_0x385d02['htmlProcessor']['domConverter']['viewToDom'](_0x24351),_0x5aa577=_0x385d02['htmlProcessor']['htmlWriter']['getHtml'](_0x3f7caf);_0x2b8623=_0x5aa577;}return _0x2b8623;};}['_createGetContentFn'](_0x43fa65,_0x30543c){let _0x4ed2d6='';return()=>(_0x4ed2d6||(_0x4ed2d6=_0x30543c['stringify'](_0x43fa65,{'showSuggestionHighlights':!0x0})),_0x4ed2d6);}['_createGetContentUsingDataIdFn'](_0x8af6da,_0x31e527,_0xa49a79){let _0x16b37e='';return()=>{if(!_0x16b37e){const _0x4e9b73=_0xa49a79['toView'](new _0x490745(_0x8af6da)),_0x1c82b3=_0xa49a79['htmlProcessor']['domConverter']['viewToDom'](_0x4e9b73)['querySelector']('[data-id=\x22'+_0x31e527+'\x22]');_0x16b37e=_0x1c82b3?.['outerHTML']||'';}return _0x16b37e;};}['_findMarkerElement'](_0x21304b,_0x253b87=0x5){let _0x22dfd8=_0x21304b,_0x38e171=null;for(let _0x503326=0x0;_0x503326<_0x253b87&&_0x22dfd8;_0x503326++){if(!_0x22dfd8['className']){_0x22dfd8=_0x22dfd8['parentElement'];continue;}if(!(''+_0x22dfd8['className'])['includes']('ck-ai_review-mode-marker_')){_0x22dfd8=_0x22dfd8['parentElement'];continue;}if(!_0x22dfd8['getAttribute']('data-marker-id'))break;_0x38e171=_0x22dfd8;break;}return _0x38e171;}['_getMarkersDataForGroup'](_0xddf903){return Array['from'](this['_markers']['values']())['filter'](_0x57e4b4=>_0x57e4b4['groupId']===_0xddf903);}['_getOperationStart'](_0x195b34){return'insert'===_0x195b34['type']?_0x195b34['position']:_0x195b34['newRange']['start'];}['_getOperationEnd'](_0x20bffb,_0x5f1bdb=!0x1){return'insert'===_0x20bffb['type']?_0x5f1bdb?_0x20bffb['position']:_0x20bffb['position']['getShiftedBy'](_0x20bffb['howMany']):_0x20bffb['newRange']['end'];}['_shiftOperation'](_0x2b52a9,_0x436498){return'insert'===_0x2b52a9['type']?_0x2b52a9['position']=_0x2b52a9['position']['getShiftedBy'](_0x436498):'marker'===_0x2b52a9['type']&&_0x2b52a9['newRange']&&(_0x2b52a9['newRange']=new _0x1026dd(_0x2b52a9['newRange']['start']['getShiftedBy'](_0x436498),_0x2b52a9['newRange']['end']['getShiftedBy'](_0x436498))),_0x2b52a9;}['_changeOperationOwnerDocument'](_0x4950f7,_0x423cd2){'insert'===_0x4950f7['type']?_0x4950f7['position']=this['_changePositionOwnerDocument'](_0x4950f7['position'],_0x423cd2):'marker'===_0x4950f7['type']&&_0x4950f7['newRange']&&(_0x4950f7['newRange']=this['_changeRangeOwnerDocument'](_0x4950f7['newRange'],_0x423cd2));}['_changePositionOwnerDocument'](_0x3814aa,_0x406e4d){return new tt(_0x406e4d,_0x3814aa['path']);}['_changeRangeOwnerDocument'](_0x3dffd1,_0x54b834){return new _0x1026dd(this['_changePositionOwnerDocument'](_0x3dffd1['start'],_0x54b834),this['_changePositionOwnerDocument'](_0x3dffd1['end'],_0x54b834));}['_changePosition'](_0x5c747b,_0x3e28cf){return new tt(_0x3e28cf,[..._0x5c747b]);}['_changeRange'](_0xaa4cd4,_0x4ddb17,_0x5d17af,_0x271a00){return new _0x1026dd(this['_changePosition'](_0x4ddb17,_0x271a00),this['_changePosition'](_0x5d17af,_0x271a00));}['_sortMarkers'](_0x37e5e6){const _0x471222=_0x1b53f8=>{switch(_0x1b53f8){case'insert':return 0x1;case'remove-context':return 0x2;case'remove-only':return 0x3;case'remove-text':return 0x4;}};return _0x37e5e6['sort']((_0x25ce8a,_0x52b640)=>_0x471222(_0x25ce8a['type'])-_0x471222(_0x52b640['type']));}['_hasSameTopLevelElement'](_0x1b418b,_0x3b8a49){const _0x38864d=_0x1b418b['getChild'](0x0),_0x2f5f6d=_0x3b8a49['getChild'](0x0);return!(!_0x38864d||!_0x2f5f6d)&&((!_0x38864d['is']('element')||!_0x2f5f6d['is']('element')||_0x38864d['name']===_0x2f5f6d['name'])&&!(_0x38864d['is']('element')&&!_0x2f5f6d['is']('element')||!_0x38864d['is']('element')&&_0x2f5f6d['is']('element')));}['_haveSingleTopLevelElement'](_0x3d1b92){return 0x1===_0x3d1b92['childCount'];}['_haveOnlyInlineContent'](_0x4588b1,_0x5c37b2){for(const _0x33f623 of _0x4588b1['getChildren']())if(_0x33f623['is']('element')&&!_0x5c37b2['isInline'](_0x33f623))return!0x1;return!0x0;}['_upsertDataId'](_0x55fb5e,_0x4ba5af){let _0x43f478=_0x55fb5e['getAttribute'](yt);return _0x43f478||(_0x43f478=_0x4ba5af(),_0x55fb5e['_setAttribute'](yt,_0x43f478)),_0x43f478;}}class Ga extends ot{static get['requires'](){return[re,me,ce];}static get['pluginName'](){return'AIReviewMode';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}export{ri as AIActions,K as AIAdapter,$n as AIAssistant,n as AIAssistantUI,H as AIBalloon,Da as AIChat,dt as AIChatController,pt as AIChatHistory,jt as AIChatHistoryController,xt as AIChatHistoryUI,gt as AIChatUI,S as AIConnector,R as AIEditing,Ma as AIEditorIntegration,Gt as AIQuickActionType,Va as AIQuickActions,ii as AIQuickActionsUI,tr as AIRequestError,js as AIReviewCheck,Rs as AIReviewCheckResult,zs as AIReviewCheckRun,Ga as AIReviewMode,re as AIReviewModeController,ce as AIReviewModeEditing,me as AIReviewModeUI,Ct as AITabs,pe as AITextAdapter,qt as AIToggleButtonUI,Xn as AWSTextAdapter,Qn as OpenAITextAdapter,E as ShowAIAssistantCommand,co as ToggleAICommand,ks as createResizeButton,qn as getDefaultAICommands};
|
|
23
|
+
import{Plugin as _0x3a21ac,Command as Qt,ContextPlugin as _0x53b1cd,Editor as _t}from'@ckeditor/ckeditor5-core/dist/index.js';import{IconCopy as _0x5e0584,IconCheck as _0x4ddb98,IconError as _0x1f7d72,IconSubmit as _0x515d2f,IconAIHistory as Ut,IconMagicWand as _0x3f2f71,IconRobotPencil as _0x488353,IconMaximize as _0x47b8ff,IconMinimize as to,IconDocumentWithLoupe as _0x129595,IconAddComment as _0xc643d7,IconShowChangesOn as _0x335011,IconShowChangesOff as _0x5aba39,IconDocument as _0x35c5f2,IconThreeStars as _0x21063c,IconRemove as _0x42b293,IconDocumentWithCheckmark as _0x2fd74b,IconDocumentWithCross as _0x4dc8b7,IconLoupe as _0x2fb02f,IconCancel as _0x43c7d2,IconStop as _0x14f5b8,IconAIChat as Ht,IconPlus as _0x5bfeb9,IconPin as _0x254f09,IconThreeHorizontalDots as _0x408af4,IconChevronRight as _0x2cda6f,IconInfo as _0x590152,IconOutdated as _0x4b903c,IconEye as _0x2a1219,IconEyeCrossedOut as _0x1d3ca5,IconAIReview as _0x406ae6}from'@ckeditor/ckeditor5-icons/dist/index.js';import{uid as _0x23a3b0,CKEditorError as _0x25e143,ObservableMixin as ts,global as _0x3610d0,isVisible as _0x248cca,Rect as _0x2e6861,Collection as _0xffd920,FocusTracker as _0x338162,KeystrokeHandler as _0x1b5c14,first as _0x1ee4fd,toArray as _0x25abe1,EmitterMixin as _0x32571c,logWarning as _0x17a23f,logError as ft,scrollViewportToShowTarget as _0xc42cd2,ResizeObserver as _0x7b9b5d,_isMotionReduced as Pt,scrollAncestorsToShowTarget as _0x4fe2cb,getConstrainedViewportRect as _0x44adda,DomEmitterMixin as _0x44280b}from'@ckeditor/ckeditor5-utils/dist/index.js';import{ToolbarView as _0x58f977,ButtonView as _0x5cf211,View as _0x55515f,SpinnerView as _0x2f5128,IconView as _0x1e0173,AutocompleteView as _0x275027,ListView as _0x429409,ListItemGroupView as _0x6fb56,ListItemView as _0x5f38b9,ButtonLabelView as _0xbcb951,FocusCycler as _0x2f6676,createLabeledTextarea as _0x28513c,Dialog as _0x14e96e,createDropdown as _0x4c9a3b,addMenuToDropdown as _0x52b06c,MenuBarMenuView as _0x3de95d,MenuBarMenuListItemButtonView as _0x13902c,DialogViewPosition as _0x2f4dee,MenuBarMenuListView as _0x470e26,MenuBarMenuListItemView as _0x184fc0,UIModel as _0x57b857,SplitButtonView as _0x4e347b,BalloonPanelView as _0x564e6d,BodyCollection as _0x1008b4,clickOutsideHandler as _0x1411c6,ListItemButtonView as _0xe41030,ViewCollection as _0x4b2ba7,addListToDropdown as _0x2100d6,submitHandler as _0x4a9f33,LabeledFieldView as _0x349f6b,createLabeledInputText as _0x34dc8b,FormHeaderView as _0x219fc7,HighlightedTextView as _0x201c3b,FileDialogButtonView as _0x23c441,InputTextView as _0x1f8052,SearchTextView as _0x33b88d,ButtonLabelWithHighlightView as _0x34f162,DropdownMenuPanelPositioningFunctions as _0x577a68,BalloonToolbar as _0x4e6183,FormRowView as _0x55c50c,TextareaView as _0x22b9ac}from'@ckeditor/ckeditor5-ui/dist/index.js';import{ClipboardPipeline as _0x14b12a,ClipboardMarkersUtils as _0x806c01}from'@ckeditor/ckeditor5-clipboard/dist/index.js';import{ViewDocumentDomEventData as _0x4e452c,ViewDataTransfer as _0x5b099b,ViewUpcastWriter as _0xc7bbe7,Matcher as _0x5a49ee,_DetachOperation as ut,_insertIntoModelNodeList as _0x2d640c,_removeFromModelNodeList as _0x594863,ModelRange as ct,ViewDowncastWriter as Ft,transformOperationSets as gt,ModelDocumentFragment as ht,ModelPosition as lt,ModelTreeWalker as _0x4c5bb1,InsertOperation as _0x1187e5,MarkerOperation as _0x192ebd}from'@ckeditor/ckeditor5-engine/dist/index.js';import{unescape as _0x40914e,escape as _0x25d6a2,escapeRegExp as _0x390c1d,debounce as _0x2ffa27}from'es-toolkit/compat';import{BedrockRuntimeClient as _0x38f8ef,InvokeModelWithResponseStreamCommand as _0x6a6571,InvokeModelCommand as _0xe019c9}from'@aws-sdk/client-bedrock-runtime';import{createParser as $t}from'eventsource-parser';import{parseDocument as _0x344289}from'htmlparser2';import{isTag as _0x1817c0,findOne as St,getParent as _0x22264a,findAll as _0x8c497d,removeElement as _0x14435b,replaceElement as _0x334b78,prepend as _0x5f0e2c,prependChild as _0x877764,appendChild as _0x2fc5f7,append as _0x41729d,find as _0x5b20dc,isComment as _0x4ac076,getChildren as _0x4321d2,textContent as _0xa8cf5e}from'domutils';import _0x3ae693 from'dom-serializer';import{Document as Rt,Element as _0x4a04d5,Text as _0x7b02c2,cloneNode as _0x4b2836,isDocument as _0x38319d,isText as _0xbc520a,NodeWithChildren as _0x4a4ac6}from'domhandler';import{MarkdownGfmMdToHtml as _0x5d6259}from'@ckeditor/ckeditor5-markdown-gfm/dist/index.js';import{fixElementSuggestionRange as _0x1f960a,getAllMarkersDomElementsSorted as _0x428d6f,DocumentCompare as ot,DATA_ID_MODEL_ATTRIBUTE as yt,ConfirmMixin as _0x413600,LateFocusDropdownButtonView as _0x15272b,DATA_ID_VIEW_ATTRIBUTE as _0x19a8d3}from'ckeditor5-collaboration/dist/index.js';import{cloneDeep as _0x132171}from'es-toolkit';import{IconThumbUp as _0x1d8b6d,IconThumbDown as _0x33f3ae,IconCopy as _0x1d15d2,IconCheck as _0x563475,IconShowChangesOff as it,IconShowChangesOn as _0x50fe49,IconWeb as _0x4f3dd0,IconNextArrow as _0x28046c,IconPreviousArrow as tt,IconAI as Nt,IconClose as _0x39dbfa,IconSelection as _0x3be534,IconFileUpload as _0x5b1096,IconLink as _0x41d008,IconDocument as _0x366289,IconBulb as _0x458e80,IconDocumentOutline as _0x1cc76c,IconPaperClip as _0x21b547,IconBrowseFiles as _0x10b491,IconDropdownArrow as _0x4a4728,IconAIAskAI as _0x236c83,IconAIQuickActions as _0x467386,IconAIChatCommands as Bt,IconAIImproveWriting as Xt,IconAIContinueWriting as Jt,IconAIGrammarCheck as Vt,IconAIAdjustLength as Kt,IconAIChangeTone as Wt,IconAITranslate as te,IconAIOther as Zt,IconRefresh as _0x4adff1}from'@ckeditor/ckeditor5-icons/dist/index.js';import _0x1113d2 from'morphdom';import{SuggestionsConversion as zt}from'@ckeditor/ckeditor5-collaboration-core/dist/index.js';import{diffArrays as _0x266b5b}from'diff';const x='_ungrouppedCommands';function o(_0x573856,_0x3fc770){const _0x3316ab=(0x0,_0x3fc770['t'])('Other');return _0x573856['length']?'groupId'in _0x573856[0x0]?_0x573856:[{'groupId':x,'groupLabel':_0x3316ab,'order':0x1/0x0,'commands':_0x573856}]:[{'groupId':x,'groupLabel':_0x3316ab,'order':0x1/0x0,'commands':[]}];}const Wn=globalThis['DataTransfer'],f='ai-ui';class a extends _0x3a21ac{static get['pluginName'](){return'AIAssistantEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const {editor:_0x1539b4}=this,_0x10b361=['ck-fake-ai-selection'];_0x1539b4['config']['get']('ai.assistant.useTheme')&&_0x10b361['push']('ck-ai-assistant-ui_theme'),_0x1539b4['conversion']['for']('editingDowncast')['markerToHighlight']({'model':f,'view':{'classes':_0x10b361,'priority':0xc}}),_0x1539b4['conversion']['for']('editingDowncast')['markerToElement']({'model':f,'view':(_0x5c0cfd,{writer:_0xfd7e7c})=>{if(!_0x5c0cfd['markerRange']['isCollapsed'])return null;const _0x3718dc=_0xfd7e7c['createUIElement']('span');return _0xfd7e7c['addClass'](['ck-fake-ai-selection','ck-fake-ai-selection_collapsed'],_0x3718dc),_0x3718dc;}});}['afterInit'](){!async function(_0xe473eb){const _0x28cc4a=_0x607272([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]),_0x2b8961=0x3dffc4e1,_0x35c99c=0x3df8ba51^_0x2b8961,_0x1272b9=window[_0x607272([0x44,0x61,0x74,0x65])][_0x607272([0x6e,0x6f,0x77])](),_0x1ed43d=_0xe473eb[_0x607272([0x65,0x64,0x69,0x74,0x6f,0x72])],_0x4f36fc=new window[(_0x607272([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x3c94d7=>{_0x1ed43d[_0x607272([0x6f,0x6e,0x63,0x65])](_0x607272([0x72,0x65,0x61,0x64,0x79]),_0x3c94d7);}),_0x12d621={[_0x607272([0x6b,0x74,0x79])]:_0x607272([0x45,0x43]),[_0x607272([0x75,0x73,0x65])]:_0x607272([0x73,0x69,0x67]),[_0x607272([0x63,0x72,0x76])]:_0x607272([0x50,0x2d,0x32,0x35,0x36]),[_0x607272([0x78])]:_0x607272([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]),[_0x607272([0x79])]:_0x607272([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]),[_0x607272([0x61,0x6c,0x67])]:_0x607272([0x45,0x53,0x32,0x35,0x36])},_0x497955=_0x1ed43d[_0x607272([0x63,0x6f,0x6e,0x66,0x69,0x67])][_0x607272([0x67,0x65,0x74])](_0x607272([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79]));async function _0x5cd90a(){let _0x578f85,_0x1fc8d6=null,_0x2e321c=null;try{if(_0x497955==_0x607272([0x47,0x50,0x4c]))return _0x607272([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]);if(_0x578f85=_0x228a0e(),!_0x578f85)return _0x607272([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);return _0x578f85[_0x607272([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])]&&(_0x2e321c=_0x5b8f25(_0x578f85[_0x607272([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])],_0x578f85[_0x607272([0x6a,0x74,0x69])])),await _0x2cc1fd()?_0x26f44c()?_0x1c9087()?_0x607272([0x45,0x78,0x70,0x69,0x72,0x65,0x64]):_0x431646()?(_0x578f85[_0x607272([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x607272([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e])&&(_0x1fc8d6=_0x17af14(_0x607272([0x45,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e,0x4c,0x69,0x6d,0x69,0x74]))),await _0x266f7a()):_0x607272([0x44,0x6f,0x6d,0x61,0x69,0x6e,0x4c,0x69,0x6d,0x69,0x74]):_0x607272([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]):_0x607272([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}catch{return _0x607272([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}function _0x1c9087(){const _0x14487f=[_0x607272([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e]),_0x607272([0x74,0x72,0x69,0x61,0x6c])][_0x607272([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x578f85[_0x607272([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])])?_0x1272b9/0x3e8:0xe10*_0x35c99c;return _0x578f85[_0x607272([0x65,0x78,0x70])]<_0x14487f;}function _0x26f44c(){const _0x44c366=_0x578f85[_0x607272([0x66,0x65,0x61,0x74,0x75,0x72,0x65,0x73])];return!!_0x44c366&&(!!_0x44c366[_0x607272([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x607272([0x2a]))||!!_0x44c366[_0x607272([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x607272([0x41,0x49])));}function _0x431646(){const _0x2ed397=_0x578f85[_0x607272([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x64,0x48,0x6f,0x73,0x74,0x73])];if(!_0x2ed397||0x0==_0x2ed397[_0x607272([0x6c,0x65,0x6e,0x67,0x74,0x68])])return!0x0;const {hostname:_0x8574f5}=new URL(window[_0x607272([0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e])]['href']);if(_0x2ed397[_0x607272([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x8574f5))return!0x0;const _0x5713c6=_0x8574f5[_0x607272([0x73,0x70,0x6c,0x69,0x74])](_0x607272([0x2e]));return _0x2ed397[_0x607272([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x3b6fe9=>_0x3b6fe9[_0x607272([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x607272([0x2a])))[_0x607272([0x6d,0x61,0x70])](_0x595cfb=>_0x595cfb[_0x607272([0x73,0x70,0x6c,0x69,0x74])](_0x607272([0x2e])))[_0x607272([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x1a67ad=>_0x1a67ad[_0x607272([0x6c,0x65,0x6e,0x67,0x74,0x68])]<=_0x5713c6[_0x607272([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0x607272([0x6d,0x61,0x70])](_0x3dc57a=>Array(_0x5713c6[_0x607272([0x6c,0x65,0x6e,0x67,0x74,0x68])]-_0x3dc57a[_0x607272([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0x607272([0x66,0x69,0x6c,0x6c])](_0x3dc57a[0x0]===_0x607272([0x2a])?_0x607272([0x2a]):'')[_0x607272([0x63,0x6f,0x6e,0x63,0x61,0x74])](_0x3dc57a))[_0x607272([0x73,0x6f,0x6d,0x65])](_0x44145e=>_0x5713c6[_0x607272([0x65,0x76,0x65,0x72,0x79])]((_0x1b2052,_0x2bc447)=>_0x44145e[_0x2bc447]===_0x1b2052||_0x44145e[_0x2bc447]===_0x607272([0x2a])));}function _0x266f7a(){return _0x1fc8d6&&_0x2e321c?new window[(_0x607272([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x15936d,_0x4bc625)=>{_0x1fc8d6[_0x607272([0x74,0x68,0x65,0x6e])](_0x15936d,_0x4bc625),_0x2e321c[_0x607272([0x74,0x68,0x65,0x6e])](_0x1a4bce=>{_0x1a4bce!=_0x607272([0x56,0x61,0x6c,0x69,0x64])&&_0x15936d(_0x1a4bce);},_0x4bc625);}):_0x1fc8d6||_0x2e321c||_0x607272([0x56,0x61,0x6c,0x69,0x64]);}}function _0x5b8f25(_0x2f691b,_0x2d2e19){return new window[(_0x607272([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x5056ef=>{if(_0x264053())return _0x5056ef(_0x607272([0x56,0x61,0x6c,0x69,0x64]));_0x4f5902(),_0x1ed43d[_0x607272([0x64,0x65,0x63,0x6f,0x72,0x61,0x74,0x65])](_0x607272([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]));let _0x129377=!0x1;const _0x5947d3=_0x23a3b0();function _0x388d99(_0x36d7dd){return!!_0x36d7dd&&(typeof _0x36d7dd===_0x607272([0x6f,0x62,0x6a,0x65,0x63,0x74])||typeof _0x36d7dd===_0x607272([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]))&&typeof _0x36d7dd[_0x607272([0x74,0x68,0x65,0x6e])]===_0x607272([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e])&&typeof _0x36d7dd[_0x607272([0x63,0x61,0x74,0x63,0x68])]===_0x607272([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]);}function _0x424dbf(_0x19b8f5){_0x5b99f9(_0x19b8f5)[_0x607272([0x74,0x68,0x65,0x6e])](_0x5dc884=>{if(!_0x5dc884||_0x5dc884[_0x607272([0x73,0x74,0x61,0x74,0x75,0x73])]!=_0x607272([0x6f,0x6b]))return _0x607272([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]);return _0xefcbfa(_0x4dc9ca(_0x5947d3+_0x2d2e19))!=_0x5dc884[_0x607272([0x76,0x65,0x72,0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6f,0x6e])]?_0x607272([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]):_0x607272([0x56,0x61,0x6c,0x69,0x64]);})[_0x607272([0x74,0x68,0x65,0x6e])](_0x410e36=>(_0x4359c3(),_0x410e36),()=>{const _0x406446=_0x39f666();return null==_0x406446?(_0x4359c3(),_0x607272([0x56,0x61,0x6c,0x69,0x64])):_0x607272(_0x1272b9-_0x406446>(0x19f340e1^_0x2b8961)?[0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]:[0x56,0x61,0x6c,0x69,0x64]);})[_0x607272([0x74,0x68,0x65,0x6e])](_0x5056ef)[_0x607272([0x63,0x61,0x74,0x63,0x68])](()=>{_0x5056ef(_0x607272([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});const _0x421055=0x3dc92a61^_0x2b8961;function _0x4359c3(){const _0x3ece5e=_0x607272([0x6c,0x6c,0x63,0x74,0x2d])+_0xefcbfa(_0x4dc9ca(_0x2f691b)),_0x29b563=_0x2bd210(_0xefcbfa(window[_0x607272([0x4d,0x61,0x74,0x68])][_0x607272([0x63,0x65,0x69,0x6c])](_0x1272b9/_0x421055)));window[_0x607272([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x607272([0x73,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x3ece5e,_0x29b563);}function _0x39f666(){const _0x2bafd4=_0x607272([0x6c,0x6c,0x63,0x74,0x2d])+_0xefcbfa(_0x4dc9ca(_0x2f691b)),_0x255be3=window[_0x607272([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x607272([0x67,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x2bafd4);return _0x255be3?window[_0x607272([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x2bd210(_0x255be3),0x10)*_0x421055:null;}function _0x5b99f9(_0x9b9f8c){return new window[(_0x607272([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x5b51c9,_0x435f04)=>{_0x9b9f8c[_0x607272([0x74,0x68,0x65,0x6e])](_0x5b51c9,_0x435f04),window[_0x607272([0x73,0x65,0x74,0x54,0x69,0x6d,0x65,0x6f,0x75,0x74])](_0x435f04,0x3dfe1021^_0x2b8961);});}}_0x1ed43d[_0x607272([0x6f,0x6e])](_0x607272([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),(_0x1a6203,_0x3d9aaa)=>{if(_0x3d9aaa[0x0]!=_0x2f691b)return _0x5056ef(_0x607272([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));_0x3d9aaa[0x1]={..._0x3d9aaa[0x1],[_0x607272([0x72,0x65,0x71,0x75,0x65,0x73,0x74,0x49,0x64])]:_0x5947d3};},{[_0x607272([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x607272([0x68,0x69,0x67,0x68])}),_0x1ed43d[_0x607272([0x6f,0x6e])](_0x607272([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),_0x44a5bf=>{_0x388d99(_0x44a5bf[_0x607272([0x72,0x65,0x74,0x75,0x72,0x6e])])&&(_0x129377=!0x0,_0x424dbf(_0x44a5bf[_0x607272([0x72,0x65,0x74,0x75,0x72,0x6e])]));},{[_0x607272([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x607272([0x6c,0x6f,0x77])}),_0x4f36fc[_0x607272([0x74,0x68,0x65,0x6e])](()=>{_0x129377||_0x5056ef(_0x607272([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});});function _0x264053(){return _0x1ed43d[_0x607272([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x607272([0x76,0x69,0x65,0x77])][_0x607272([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]==_0x607272([0x61,0x75,0x74,0x6f]);}function _0x4f5902(){_0x1ed43d[_0x607272([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x607272([0x76,0x69,0x65,0x77])][_0x607272([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]=_0x607272([0x61,0x75,0x74,0x6f]);}}function _0x17af14(_0x735b65){const _0x1df131=[new window[(_0x607272([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x34b1f3=>setTimeout(_0x34b1f3,0x3df6fa2d^_0x2b8961)),_0x4f36fc[_0x607272([0x74,0x68,0x65,0x6e])](()=>new window[(_0x607272([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x4a7851=>{let _0x28b515=0x0;_0x1ed43d[_0x607272([0x6d,0x6f,0x64,0x65,0x6c])][_0x607272([0x6f,0x6e])](_0x607272([0x61,0x70,0x70,0x6c,0x79,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e]),(_0x4d8f93,_0x258aae)=>{_0x258aae[0x0][_0x607272([0x69,0x73,0x44,0x6f,0x63,0x75,0x6d,0x65,0x6e,0x74,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e])]&&_0x28b515++,_0x28b515==(0x3dffc109^_0x2b8961)&&(_0x4a7851(),_0x4d8f93[_0x607272([0x6f,0x66,0x66])]());});}))];return window[_0x607272([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65])][_0x607272([0x72,0x61,0x63,0x65])](_0x1df131)[_0x607272([0x74,0x68,0x65,0x6e])](()=>_0x735b65);}async function _0x3dd7af(){await _0x4f36fc,_0x1ed43d[_0x607272([0x6d,0x6f,0x64,0x65,0x6c])][_0x607272([0x63,0x68,0x61,0x6e,0x67,0x65])]=_0x529586,_0x1ed43d[_0x607272([0x6d,0x6f,0x64,0x65,0x6c])][_0x607272([0x65,0x6e,0x71,0x75,0x65,0x75,0x65,0x43,0x68,0x61,0x6e,0x67,0x65])]=_0x529586,_0x1ed43d[_0x607272([0x65,0x6e,0x61,0x62,0x6c,0x65,0x52,0x65,0x61,0x64,0x4f,0x6e,0x6c,0x79,0x4d,0x6f,0x64,0x65])](_0x607272([0x6d,0x6f,0x64,0x65,0x6c]));}function _0x3410c0(_0xa89aa9){const _0x4e73b1=_0x17e29e();_0x1ed43d[_0x4e73b1]=_0x607272([0x61,0x69,0x4c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79])+_0xa89aa9,_0xa89aa9!=_0x607272([0x56,0x61,0x6c,0x69,0x64])&&_0x3dd7af();}function _0x17e29e(){const _0x367cf5=window[_0x607272([0x53,0x74,0x72,0x69,0x6e,0x67])](window[_0x607272([0x70,0x65,0x72,0x66,0x6f,0x72,0x6d,0x61,0x6e,0x63,0x65])][_0x607272([0x6e,0x6f,0x77])]())[_0x607272([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](_0x607272([0x2e]),'');let _0x212ec1=_0x607272([0x6e]);for(let _0x275cbe=0x0;_0x275cbe<_0x367cf5[_0x607272([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x275cbe+=0x2){let _0x44719a=window[_0x607272([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x367cf5[_0x607272([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x275cbe,_0x275cbe+0x2));_0x44719a>=_0x28cc4a[_0x607272([0x6c,0x65,0x6e,0x67,0x74,0x68])]&&(_0x44719a-=_0x28cc4a[_0x607272([0x6c,0x65,0x6e,0x67,0x74,0x68])]),_0x212ec1+=_0x28cc4a[_0x44719a];}return _0x212ec1;}function _0x228a0e(){const _0x13b9b8=_0x497955[_0x607272([0x73,0x70,0x6c,0x69,0x74])](_0x607272([0x2e]));if(0x3!=_0x13b9b8[_0x607272([0x6c,0x65,0x6e,0x67,0x74,0x68])])return null;return _0xb271a4(_0x13b9b8[0x1]);function _0xb271a4(_0x46d182){const _0x4e5036=_0x57362f(_0x46d182);return _0x4e5036&&_0x71f85f()?_0x4e5036:null;function _0x71f85f(){const _0x8bcf13=_0x4e5036[_0x607272([0x6a,0x74,0x69])],_0x2ccd7f=window[_0x607272([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x8bcf13[_0x607272([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x8bcf13[_0x607272([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8),0x10),_0x3406e9={..._0x4e5036,[_0x607272([0x6a,0x74,0x69])]:_0x8bcf13[_0x607272([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](0x0,_0x8bcf13[_0x607272([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8)};return delete _0x3406e9[_0x607272([0x76,0x63])],_0x4dc9ca(_0x3406e9)==_0x2ccd7f;}}}async function _0x2cc1fd(){let _0x261d37=!0x0;try{const _0x29e519=_0x497955[_0x607272([0x73,0x70,0x6c,0x69,0x74])](_0x607272([0x2e])),[_0x4196b0,_0x5c246c,_0x5a53bb]=_0x29e519;return _0x1e205b(_0x4196b0),await _0x4a941d(_0x4196b0,_0x5c246c,_0x5a53bb),_0x261d37;}catch{return!0x1;}function _0x1e205b(_0x4779f7){const _0x59a15f=_0x57362f(_0x4779f7);_0x59a15f&&_0x59a15f[_0x607272([0x61,0x6c,0x67])]==_0x607272([0x45,0x53,0x32,0x35,0x36])||(_0x261d37=!0x1);}async function _0x4a941d(_0x18b401,_0x4aada3,_0x44776b){const _0x28b9d9=window[_0x607272([0x55,0x69,0x6e,0x74,0x38,0x41,0x72,0x72,0x61,0x79])][_0x607272([0x66,0x72,0x6f,0x6d])](_0x3c5811(_0x44776b),_0x1ee1d9=>_0x1ee1d9[_0x607272([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](0x0)),_0x20fc9c=new window[(_0x607272([0x54,0x65,0x78,0x74,0x45,0x6e,0x63,0x6f,0x64,0x65,0x72]))]()[_0x607272([0x65,0x6e,0x63,0x6f,0x64,0x65])](_0x18b401+_0x607272([0x2e])+_0x4aada3),_0x4e103f=window[_0x607272([0x63,0x72,0x79,0x70,0x74,0x6f])][_0x607272([0x73,0x75,0x62,0x74,0x6c,0x65])];if(!_0x4e103f)return;const _0x4806f9=await _0x4e103f[_0x607272([0x69,0x6d,0x70,0x6f,0x72,0x74,0x4b,0x65,0x79])](_0x607272([0x6a,0x77,0x6b]),_0x12d621,{[_0x607272([0x6e,0x61,0x6d,0x65])]:_0x607272([0x45,0x43,0x44,0x53,0x41]),[_0x607272([0x6e,0x61,0x6d,0x65,0x64,0x43,0x75,0x72,0x76,0x65])]:_0x607272([0x50,0x2d,0x32,0x35,0x36])},!0x1,[_0x607272([0x76,0x65,0x72,0x69,0x66,0x79])]);await _0x4e103f[_0x607272([0x76,0x65,0x72,0x69,0x66,0x79])]({[_0x607272([0x6e,0x61,0x6d,0x65])]:_0x607272([0x45,0x43,0x44,0x53,0x41]),[_0x607272([0x68,0x61,0x73,0x68])]:{[_0x607272([0x6e,0x61,0x6d,0x65])]:_0x607272([0x53,0x48,0x41,0x2d,0x32,0x35,0x36])}},_0x4806f9,_0x28b9d9,_0x20fc9c)||(_0x261d37=!0x1);}}function _0x57362f(_0x28486f){return _0x28486f[_0x607272([0x73,0x74,0x61,0x72,0x74,0x73,0x57,0x69,0x74,0x68])](_0x607272([0x65,0x79]))?JSON[_0x607272([0x70,0x61,0x72,0x73,0x65])](_0x3c5811(_0x28486f)):null;}function _0x3c5811(_0x60c5e){return window[_0x607272([0x61,0x74,0x6f,0x62])](_0x60c5e[_0x607272([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/-/g,_0x607272([0x2b]))[_0x607272([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/_/g,_0x607272([0x2f])));}function _0x4dc9ca(_0x3d363f){let _0x46b3bf=0x1505;function _0x53202a(_0x2a37f0){for(let _0x433ddd=0x0;_0x433ddd<_0x2a37f0[_0x607272([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x433ddd++){const _0x39fc79=_0x2a37f0[_0x607272([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](_0x433ddd);_0x46b3bf=(_0x46b3bf<<0x5)+_0x46b3bf+_0x39fc79,_0x46b3bf&=_0x46b3bf;}}function _0x75d875(_0x3f5e9a){Array[_0x607272([0x69,0x73,0x41,0x72,0x72,0x61,0x79])](_0x3f5e9a)?_0x3f5e9a[_0x607272([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](_0x75d875):_0x3f5e9a&&typeof _0x3f5e9a==_0x607272([0x6f,0x62,0x6a,0x65,0x63,0x74])?Object[_0x607272([0x65,0x6e,0x74,0x72,0x69,0x65,0x73])](_0x3f5e9a)[_0x607272([0x73,0x6f,0x72,0x74])]()[_0x607272([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](([_0x3b395a,_0x53ae25])=>{_0x53202a(_0x3b395a),_0x75d875(_0x53ae25);}):_0x53202a(window[_0x607272([0x53,0x74,0x72,0x69,0x6e,0x67])](_0x3f5e9a));}return _0x75d875(_0x3d363f),_0x46b3bf>>>0x0;}function _0xefcbfa(_0xaab3a){return _0xaab3a[_0x607272([0x74,0x6f,0x53,0x74,0x72,0x69,0x6e,0x67])](0x10)[_0x607272([0x70,0x61,0x64,0x53,0x74,0x61,0x72,0x74])](0x8,_0x607272([0x30]));}function _0x2bd210(_0x21a9b1){return _0x21a9b1[_0x607272([0x73,0x70,0x6c,0x69,0x74])]('')[_0x607272([0x72,0x65,0x76,0x65,0x72,0x73,0x65])]()[_0x607272([0x6a,0x6f,0x69,0x6e])]('');}function _0x529586(){}function _0x607272(_0x577e06){return _0x577e06['map'](_0x30928c=>String['fromCharCode'](_0x30928c))['join']('');}_0x3410c0(await _0x5cd90a());}(this);}['showFakeVisualSelection'](){const _0x328221=this['editor']['model'];_0x328221['change'](_0xe38cf6=>{const _0x2f8511=_0x328221['document']['selection']['getRanges']();let _0x52eed1=0x0;for(const _0x3f3842 of _0x2f8511){const _0x3965ad=f+':'+_0x52eed1;if(_0x328221['markers']['has'](_0x3965ad))_0xe38cf6['updateMarker'](_0x3965ad,{'range':_0x3f3842});else{if(_0x3f3842['start']['isAtEnd']){const _0x5c3a5e=_0x3f3842['start']['getLastMatchingPosition'](({item:_0x1aebbe})=>!_0x328221['schema']['isContent'](_0x1aebbe),{'boundaries':_0x3f3842});_0xe38cf6['addMarker'](_0x3965ad,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0xe38cf6['createRange'](_0x5c3a5e,_0x3f3842['end'])});}else _0xe38cf6['addMarker'](_0x3965ad,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x3f3842});}_0x52eed1++;}});}['hideFakeVisualSelection'](){const _0xcaf212=this['editor']['model'],_0x2825d3=Array['from'](this['editor']['model']['markers']['getMarkersGroup'](f));_0x2825d3['length']&&_0xcaf212['change'](_0x5d592e=>{_0x2825d3['forEach'](_0x337b10=>{_0x5d592e['removeMarker'](_0x337b10);});});}['insertContent'](_0x4344f9,_0x2ac9f1){const _0x98068b=this['_getAISelection'](),_0xc1a7b4=_0x2ac9f1||_0x98068b['getFirstRange']();this['editor']['model']['canEditAt'](_0xc1a7b4)&&this['editor']['model']['change'](_0x202c7e=>{this['hideFakeVisualSelection'](),_0x2ac9f1||this['_resetContentOfSelectedTableCells'](_0x202c7e,_0x98068b),this['_pasteHTMLUsingClipboard']({'insertAt':_0xc1a7b4,'writer':_0x202c7e,'html':_0x4344f9});});}['insertContentBelow'](_0x5c55d4){const {model:_0x5e7e14}=this['editor'],_0x50d148=this['_getAISelection']();_0x5e7e14['change'](()=>{const _0x53678c=this['_prepareTableInsertBelowPosition'](_0x5c55d4,_0x50d148)||this['_getDefaultInsertBelowPosition'](_0x50d148);this['insertContent'](_0x5c55d4,_0x53678c);});}['_getAISelection'](){const _0x2067e4=this['editor']['model'],_0x149bb0=Array['from'](_0x2067e4['markers']['getMarkersGroup'](f))['map'](_0x107414=>_0x107414['getRange']());return _0x2067e4['createSelection'](_0x149bb0);}['_pasteHTMLUsingClipboard']({writer:_0x31ac2d,html:_0x2819e0,insertAt:_0x122267}){const {view:_0x210e55}=this['editor']['editing'],_0x1fae20=this['editor']['plugins']['get'](_0x14b12a),_0x4cf83c=new Wn();_0x4cf83c['setData']('text/html',_0x2819e0);const _0x21e367=new ClipboardEvent('paste',{'clipboardData':_0x4cf83c}),_0x3de7b7=new _0x4e452c(_0x210e55,_0x21e367,{'dataTransfer':new _0x5b099b(_0x4cf83c)});_0x31ac2d['setSelection'](_0x122267);const _0x163bc1=(_0xd12ea0,_0x16716f)=>{_0x16716f['resultRange']&&_0x31ac2d['setSelection'](_0x16716f['resultRange']);};_0x1fae20['once']('contentInsertion',_0x163bc1,{'priority':'lowest'}),_0x210e55['document']['fire']('paste',_0x3de7b7),_0x1fae20['off']('contentInsertion',_0x163bc1);}['_getDefaultInsertBelowPosition'](_0x4cf6ce){const {model:_0x1e0199}=this['editor'],_0x3a43bc=Array['from'](_0x4cf6ce['getSelectedBlocks']());return _0x3a43bc['length']?_0x1e0199['createPositionAfter'](_0x3a43bc['pop']()):_0x4cf6ce['getLastPosition']();}['_prepareTableInsertBelowPosition'](_0x378113,_0x3fc2d6){const {model:_0x48f3c8,plugins:_0x31f097}=this['editor'];if(_0x31f097['has']('TableUtils')){const _0x555727=_0x31f097['get']('TableUtils')['getSelectedTableCells'](_0x3fc2d6);if(_0x555727['length']){const _0x5ca162=this['_getTableRowCountFromContent'](_0x378113),_0x2ed512=this['_createEmptyTableRows'](_0x555727,_0x5ca162);return _0x48f3c8['createPositionAt'](_0x2ed512,0x0);}}return null;}['_getTableRowCountFromContent'](_0x1926e6){const _0x3ec672=this['editor']['plugins']['get']('TableUtils'),_0x50ac7d=this['editor']['data']['parse'](_0x1926e6),_0x105f03=Array['from'](_0x50ac7d['getChildren']())['filter'](_0xe27d94=>_0xe27d94['is']('element','table'));let _0x579cb3=0x0;return _0x105f03['forEach'](_0x52ad34=>{_0x579cb3+=_0x3ec672['getRows'](_0x52ad34);}),_0x579cb3;}['_createEmptyTableRows'](_0x3ef3c8,_0x445201){const _0x4d1d38=this['editor']['plugins']['get']('TableUtils'),_0x3d583a=_0x4d1d38['getRowIndexes'](_0x3ef3c8),_0x573a15=_0x4d1d38['getColumnIndexes'](_0x3ef3c8),_0xf7c861=_0x3d583a['last']+0x1,_0x5e3af8=_0x573a15['first'],_0x196ba9=_0x3ef3c8[0x0]['findAncestor']('table');for(let _0x137072=0x0;_0x137072<_0x445201;_0x137072++)_0x4d1d38['insertRows'](_0x196ba9,{'at':_0xf7c861});return _0x196ba9['getChild'](_0xf7c861)['getChild'](_0x5e3af8);}['_resetContentOfSelectedTableCells'](_0x40f25b,_0x3be0cb){const {plugins:_0x15f22d}=this['editor'],{model:_0x72bd1c}=_0x40f25b;if(!_0x15f22d['has']('TableUtils'))return;_0x15f22d['get']('TableUtils')['getSelectedTableCells'](_0x3be0cb)['length']&&_0x72bd1c['deleteContent'](_0x3be0cb);}}class K extends _0x3a21ac{static get['pluginName'](){return'AIAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['afterInit'](){if(!this['textAdapter'])throw new _0x25e143('aiadapter-text-adapter-not-set',null);}}class tr extends Error{constructor(_0x4863fe){super(_0x4863fe),this['name']='AIRequestError';}}function Fn(_0x3d4566,_0x252031,_0x40f68f){const t=_0x3d4566['t'];switch(_0x252031){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',_0x40f68f);case'Error\x20during\x20AI\x20content\x20generation:\x20%0':return t('Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x40f68f);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'},_0x40f68f);case'AI_ERROR_CONTEXT_LENGTH':return t({'id':'AI_ERROR_CONTEXT_LENGTH','string':'Selected\x20content\x20is\x20too\x20long'});case'AI_ERROR_MODERATION':return t({'id':'AI_ERROR_MODERATION','string':'Requested\x20query\x20does\x20not\x20pass\x20moderation\x20rules'});case'AI_ERROR_FAILED':return t({'id':'AI_ERROR_FAILED','string':'Failed\x20to\x20communicate\x20with\x20the\x20AI\x20service'});default:return _0x252031;}}class E extends Qt{['_commandDefinitions'];constructor(_0x1cf03e,_0x10d0ff){super(_0x1cf03e),this['_commandDefinitions']=_0x10d0ff,this['set']('enabledCommandsIds',[]),this['on']('change:_hasContext',(_0x77f657,_0x7f2d21,_0x330c0f)=>{this['isEnabled']&&(this['enabledCommandsIds']=ns(this['_commandDefinitions'],_0x330c0f));}),this['set']('_hasContext',!0x1),this['on']('change:isEnabled',(_0xa4bb6b,_0x126a1d,_0xfa1542)=>{this['enabledCommandsIds']=_0xfa1542?ns(this['_commandDefinitions'],this['_hasContext']):[];});}['refresh'](){const _0x109081=this['editor']['model'];this['_hasContext']=function(_0x33d1bb){const _0x508996=_0x33d1bb['document']['selection'];return _0x508996['isCollapsed']?0x0!==[..._0x508996['getSelectedBlocks']()]['length']&&![..._0x508996['getSelectedBlocks']()][0x0]['isEmpty']:!!_0x33d1bb['hasContent'](_0x508996['getFirstRange']());}(_0x109081);const _0x1305ec=_0x109081['document']['selection'],_0x46125d=this['editor']['config']['get']('ai.assistant.disabledElements');for(const _0x1d9dec of _0x1305ec['getRanges']())for(const _0x3d6d9a of _0x1d9dec['getItems']())if(_0x3d6d9a['is']('element')&&_0x46125d['includes'](_0x3d6d9a['name']))return void(this['isEnabled']=!0x1);this['isEnabled']=!0x0;}['execute'](_0x3b3380='',_0x24ff1e='',_0x6d1a3b='custom'){this['editor']['plugins']['get'](n)['showUI'](_0x3b3380,_0x24ff1e,_0x6d1a3b);}}function ns(_0x34ae88,_0x3b3873){const _0x5ad451=new Set();for(const _0x451b58 of _0x34ae88['values']())(_0x3b3873||!0x1===_0x451b58['requiresContent'])&&_0x5ad451['add'](_0x451b58['id']);return Array['from'](_0x5ad451);}const hs=new RegExp(/^(.*?)<[a-zA-Z][a-zA-Z0-9_\-.]*[ >]/,'is');class j extends/* #__PURE__ -- @preserve */
|
|
24
|
+
ts(){['editor'];['textAdapter'];['view'];['_sanitizationContainer'];['_domParser'];['_xmlSerializer'];constructor(_0x22a4d8,_0x21385b,_0x1223c9){super(),this['editor']=_0x22a4d8,this['textAdapter']=_0x21385b,this['_sanitizationContainer']=document['createElement']('div'),this['_domParser']=new DOMParser(),this['_xmlSerializer']=new XMLSerializer(),this['view']=_0x1223c9,this['set']({'initialContext':'','currentContext':'','currentResponse':'','previousContext':void 0x0,'previousQuery':void 0x0,'previousLabel':void 0x0,'isProcessing':!0x1}),this['on']('set:currentContext',(_0x125d8f,_0x5557bb,_0x37fe6d)=>{this['view']['value']=this['_sanitizeHTML'](_0x37fe6d);}),this['listenTo'](this['view'],'submitPrompt',(_0x2090cf,_0x58f17c)=>{const _0x333796=this['currentContext']||this['initialContext'];this['_handleQuery'](_0x58f17c,_0x333796,'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:_0xadee6,query:_0x560395,htmlContent:_0x1d0634,label:_0x400e0d,mainActionLabel:_0x22f7d8}){this['view']['prompt']=_0x400e0d,this['view']['mainAction']=_0x22f7d8,this['initialContext']=_0x1d0634,_0x560395&&(this['view']['isRendered']?this['_handleQuery'](_0x560395,_0x1d0634,_0xadee6,_0x400e0d):this['view']['once']('render',()=>{this['_handleQuery'](_0x560395,_0x1d0634,_0xadee6,_0x400e0d);}));}['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'](_0x4422e5,_0x364c42,_0x67a32f,_0x435354){return this['isProcessing']=!0x0,this['view']['startProcessing'](),this['previousContext']=_0x364c42,this['previousQuery']=_0x4422e5,this['previousLabel']=_0x435354||_0x4422e5,this['previousActionId']=_0x67a32f,new Promise(_0x20d44e=>{this['textAdapter']['makeRequest']({'query':_0x4422e5,'context':_0x364c42,'onData':_0x1b4834=>{this['currentResponse']=_0x1b4834,this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse']);},'actionId':_0x67a32f})['then'](()=>{!this['currentContext']&&this['currentResponse']&&(this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse'],!0x0));})['catch'](_0x8d64d3=>{_0x8d64d3 instanceof tr?this['view']['handleError'](_0x8d64d3['message']):this['view']['handleError'](),_0x20d44e();})['finally'](()=>{this['stopProcessing'](),_0x20d44e();});});}['_parseAndNormalizeContent'](_0x308086,_0x4c59b7=!0x1){const _0x3ebf6b=hs['exec'](_0x308086);_0x308086=_0x3ebf6b?_0x308086['substring'](_0x3ebf6b[0x1]['length']):_0x308086['length']<0x64&&!_0x4c59b7?'':this['_stripMarkdownSyntax'](_0x308086);const _0x2cdf44=this['_domParser']['parseFromString'](_0x308086,'text/html');if(_0x3ebf6b){const _0x526a08=Array['from'](_0x2cdf44['body']['childNodes']);_0x526a08['reverse']();for(const _0x199a93 of _0x526a08){if(_0x199a93['nodeType']==Node['ELEMENT_NODE'])break;_0x199a93['remove']();}}const _0x5bce74=this['editor']['data']['processor']['toView'](this['_xmlSerializer']['serializeToString'](_0x2cdf44['body']));this['_isH1TagSupportEnabled']()||this['_normalizeResponseHeadings'](_0x5bce74);const _0x420579=this['editor']['config']['get']('ai.assistant.preserveComments'),_0x2675e5=this['editor']['data']['toModel'](_0x5bce74);return _0x420579||_0x2675e5['markers']['clear'](),this['editor']['data']['stringify'](_0x2675e5);}['_normalizeResponseHeadings'](_0x2d282c){const _0x554af3=new _0xc7bbe7(this['editor']['editing']['view']['document']),_0x5479e2=new _0x5a49ee({'name':/^h[1-5]$/}),_0x21bd46=[];let _0x2d5dbb=!0x1;for(const _0x3d2a33 of _0x2d282c)_0x3d2a33['is']('element')&&_0x5479e2['match'](_0x3d2a33)&&(_0x21bd46['push'](_0x3d2a33),'h1'==_0x3d2a33['name']&&(_0x2d5dbb=!0x0));if(_0x2d5dbb){for(const _0x2c739a of _0x21bd46)_0x554af3['rename']('h'+(parseInt(_0x2c739a['name'][0x1])+0x1),_0x2c739a);}}['_isH1TagSupportEnabled'](){const {data:_0x28f481,editing:_0x3de227}=this['editor'],_0x4e297e=_0x28f481['htmlProcessor']['toView']('<h1></h1>'),_0x41af7b=_0x28f481['toView'](_0x28f481['toModel'](_0x4e297e));return!!_0x3de227['view']['domConverter']['viewToDom'](_0x41af7b)['querySelector']('h1');}['_sanitizeHTML'](_0x10a5bf){return this['editor']['editing']['view']['domConverter']['setContentOf'](this['_sanitizationContainer'],_0x10a5bf),this['_sanitizationContainer']['innerHTML'];}['_stripMarkdownSyntax'](_0x27ad8e){const _0x1838c5=_0x27ad8e['trim']();return _0x1838c5['startsWith']('```html')?_0x1838c5['endsWith']('```')?_0x1838c5['substring'](0x7,_0x1838c5['length']-0x3):_0x1838c5['substring'](0x7):_0x27ad8e;}}const _={'REPLACE':'replace','INSERT':'insert'};class yr extends _0x58f977{constructor(_0x580dac){super(_0x580dac),this['set']('isVisible',!0x1),this['set']('mainAction',_['REPLACE']),this['replaceButton']=this['_createButton']('','ck-button-action'),this['replaceButton']['bind']('label')['to'](this,'mainAction',_0x49d146=>Fn(_0x580dac,'AI_'+_0x49d146['toUpperCase']()+'_CONTENT')),this['insertButton']=this['_createButton'](Fn(_0x580dac,'Insert\x20below')),this['tryAgainButton']=this['_createButton'](Fn(_0x580dac,'Try\x20again')),this['stopButton']=this['_createButton'](Fn(_0x580dac,'Stop'));const _0x342ace=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-form__toolbar',_0x342ace['if']('isVisible','ck-hidden',_0x3271d5=>!_0x3271d5)]}}),this['items']['addMany']([this['replaceButton'],this['insertButton'],this['tryAgainButton'],this['stopButton']]);}['_createButton'](_0x56e709,_0x254413){const _0x4cd976=new _0x5cf211(this['locale']);return _0x4cd976['set']({'label':_0x56e709,'class':_0x254413||'','isVisible':!0x0,'withText':!0x0}),_0x4cd976;}}class Er extends _0x55515f{['contentFieldView'];['copyButtonView'];constructor(_0xc498a6,_0x580c51=''){super(_0xc498a6),this['set']({'value':null,'isVisible':!0x1,'isProcessing':!0x1});const _0x572547=this['bindTemplate'];this['contentFieldView']=new Yn(_0xc498a6,_0x580c51),this['copyButtonView']=this['_createCopyButton'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area-wrapper',_0x572547['if']('isVisible','ck-hidden',_0x53ae74=>!_0x53ae74)],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area',_0x572547['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 _0x3a83fa=!0x1;this['on']('change:value',(_0x2dd40c,_0x2ae561,_0x1ccc08)=>{const _0x3b1aa1=!this['contentFieldView']['element']['querySelector']('.ck-ai-form__loader');this['contentFieldView']['setContent'](_0x1ccc08),this['isProcessing']&&_0x3b1aa1&&!_0x3a83fa&&this['element']['scrollTo']({'top':this['element']['scrollHeight'],'behavior':'smooth'});}),this['on']('change:isProcessing',(_0x3c2d68,_0x52302a,_0x266fbf)=>{_0x3a83fa=!0x1,_0x266fbf?(this['value']=null,this['contentFieldView']['appendLoader']()):this['value']||this['contentFieldView']['setContent']('');}),this['listenTo'](this['element'],'wheel',()=>{_0x3a83fa=!0x0;}),this['listenTo'](this['element'],'mousedown',()=>{_0x3a83fa=!0x0;});}['focus'](){this['element']['focus']();}['_createCopyButton'](){const _0x1929bd=this['locale'],_0xbca46d=new _0x5cf211(this['locale']),_0x52a555='ck-ai-form__copy-button';return _0xbca46d['set']({'label':Fn(_0x1929bd,'Copy'),'icon':_0x5e0584,'class':_0x52a555,'tooltip':!0x0}),_0xbca46d['bind']('isVisible')['to'](this,'value',_0x4753b4=>!!_0x4753b4),_0xbca46d['bind']('isEnabled')['to'](this,'isProcessing',_0x490a5d=>!_0x490a5d),_0xbca46d['on']('execute',()=>{this['_copyHTMLToClipboard'](this['contentFieldView']['element']),_0xbca46d['icon']=_0x4ddb98,_0xbca46d['class']=_0x52a555+'\x20ck-ai-form__copy-button--copied',this['focus'](),setTimeout(()=>{_0xbca46d['icon']=_0x5e0584,_0xbca46d['class']=_0x52a555;},0x3e8);}),_0xbca46d;}['_copyHTMLToClipboard'](_0x4a234){const {window:_0x592042,document:_0x2e3658}=_0x3610d0;if(_0x592042['ClipboardItem']){const {Blob:_0x135ec0,ClipboardItem:_0x39fd1a}=_0x592042,_0x24a696=[new _0x39fd1a({'text/html':new _0x135ec0([_0x4a234['innerHTML']],{'type':'text/html'}),'text/plain':new _0x135ec0([_0x4a234['textContent']||''],{'type':'text/plain'})})];navigator['clipboard']['write'](_0x24a696);}else{const _0x5bbfb2=_0x2e3658['createElement']('div');_0x5bbfb2['style']['position']='absolute',_0x5bbfb2['style']['left']='-9999px',_0x5bbfb2['innerHTML']='<span>[</span>'+_0x4a234['innerHTML']+'<span>]</span>',_0x2e3658['body']['appendChild'](_0x5bbfb2);const _0x4de2e5=_0x2e3658['createRange']();_0x4de2e5['setStartAfter'](_0x5bbfb2['firstElementChild']),_0x4de2e5['setEndBefore'](_0x5bbfb2['lastElementChild']);const _0x4a87c2=_0x592042['getSelection']();_0x4a87c2['removeAllRanges'](),_0x4a87c2['addRange'](_0x4de2e5),_0x2e3658['execCommand']('copy'),_0x5bbfb2['remove']();}}}class Yn extends _0x55515f{constructor(_0x5d6736,_0x32e622=''){super(_0x5d6736),this['loaderView']=this['_createLoader'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content',_0x32e622,'ck-reset_all-excluded','ck-ai-form__content-field']}});}['setContent'](_0xc3a871){this['element']['innerHTML']=_0xc3a871;}['appendLoader'](){this['element']['appendChild'](this['loaderView']['element']);}['_createLoader'](){const _0x4e7dcf=new _0x55515f(),_0x1144d3=this['locale'],_0x525a3b=new _0x2f5128();return _0x525a3b['isVisible']=!0x0,_0x4e7dcf['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__loader']},'children':[_0x525a3b,{'text':Fn(_0x1144d3,'AI\x20is\x20writing...')}]}),_0x4e7dcf['render'](),_0x4e7dcf;}}class vr extends _0x55515f{constructor(_0x46ce88,_0x37192f=''){super(_0x46ce88);const _0x2d02a0=new _0x1e0173(),_0x3e0719=this['bindTemplate'];this['set']('text',_0x37192f),_0x2d02a0['content']=_0x1f7d72,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__error']},'children':[_0x2d02a0,{'text':_0x3e0719['to']('text')}]});}}class Ar extends _0x275027{['submitButtonView'];['showHistoryButtonView'];constructor(_0x27a911,_0x284f94){super(_0x27a911,_0x284f94),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',(_0x38003a,_0x1b92ae)=>{_0x38003a['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0x1b92ae());});}['_createSubmitButton'](){const _0xd1ed3a=new _0x5cf211(this['locale']),_0x11b6d7=this['locale'];return _0xd1ed3a['set']({'icon':_0x515d2f,'label':Fn(_0x11b6d7,'Submit'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-form__submit'}),_0xd1ed3a['on']('execute',()=>{this['submit']();}),_0xd1ed3a['bind']('isEnabled')['to'](this['queryView']['fieldView'],'isEmpty',this,'isEnabled',(_0x1b5f8d,_0x91720d)=>!_0x1b5f8d&&_0x91720d),_0xd1ed3a;}['_createShowHistoryButton'](){const _0x54b67a=new _0x5cf211(this['locale']),_0x5d4f8c=this['resultsView'],_0xbbaeb9=this['locale'];_0x54b67a['set']({'label':Fn(_0xbbaeb9,'History'),'withText':!0x1,'icon':Ut,'tooltip':!0x0,'tooltipPosition':'sw','class':'ck-ai-form__toggle-history'}),_0x54b67a['bind']('isOn')['to'](_0x5d4f8c,'isVisible'),_0x54b67a['bind']('isEnabled')['to'](this,'isEnabled'),_0x54b67a['on']('execute',()=>{_0x5d4f8c['isVisible']=!_0x5d4f8c['isVisible'],_0x5d4f8c['isVisible']?this['filteredView']['focus']():this['focus']();});const _0x1a2bdc=()=>{_0x3610d0['window']['requestAnimationFrame'](()=>{if(_0x248cca(this['element'])){const _0x2a9e0f=new _0x2e6861(this['queryView']['fieldView']['element']),_0x3e03f1=_0x2a9e0f['width'],_0x398b8c='rtl'===_0xbbaeb9['uiLanguageDirection']?'left':'right';_0x2a9e0f['excludeScrollbarsAndBorders'](),_0x54b67a['element']['style'][_0x398b8c]=_0x3e03f1-_0x2a9e0f['width']+0x1+'px';}});};return this['queryView']['fieldView']['on']('update',_0x1a2bdc),this['on']('render',_0x1a2bdc),_0x54b67a;}['submit'](){const _0x2bcd50=this['queryView']['fieldView']['element']['value'];this['fire']('submit',_0x2bcd50);}['focus'](_0xd79de3){-0x1===_0xd79de3?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}}class Pr extends _0x429409{['historyGroupView'];['clearHistoryButton'];constructor(_0xab958){super(_0xab958),this['clearHistoryButton']=this['_createClearHistoryButton'](),this['historyGroupView']=new _0x6fb56(),this['historyGroupView']['children']['add'](this['clearHistoryButton'],0x1),this['historyGroupView']['label']=Fn(_0xab958,'Prompt\x20history'),this['historyGroupView']['items']['delegate']('execute')['to'](this),this['items']['add'](this['historyGroupView']);}['filter'](){let _0x2b3055=0x0;for(const _0x14cc64 of this['items'])_0x2b3055+=_0x14cc64['items']['length'];return{'resultsCount':_0x2b3055,'totalItemsCount':_0x2b3055};}['_createClearHistoryButton'](){const _0x19ebf6=this['locale'],_0x2967f4=new _0x5cf211(this['locale']);return _0x2967f4['set']({'label':'('+Fn(_0x19ebf6,'Clear')+')','withText':!0x0}),_0x2967f4['on']('execute',()=>this['fire']('clearHistory')),_0x2967f4;}}class jr extends _0x5f38b9{constructor(_0xb504e){super();const _0x375183=new _0xbcb951(),_0x2bd36b=new _0x5cf211(this['locale'],_0x375183);this['children']['add'](_0x2bd36b),_0x2bd36b['set']({'label':_0xb504e['prompt'],'withText':!0x0}),_0x2bd36b['on']('execute',()=>{this['fire']('execute',{'value':_0x40914e(_0xb504e['prompt'])});});}}const So='CKEditor/AIFormView/PromptHistory';class Ir extends _0xffd920{constructor(){super(),this['_loadFromSessionStorage'](),this['on']('add',(_0x1f3bb2,_0x3254cc)=>{const _0x939aed=fo(_0x3254cc['prompt']);for(const _0x56341e of this)if(_0x56341e!=_0x3254cc&&fo(_0x56341e['prompt'])===_0x939aed){this['remove'](_0x56341e);break;}this['length']>0x14&&this['remove'](this['last']),this['_saveToSessionStorage']();}),this['on']('remove',()=>{this['_saveToSessionStorage']();});}['_loadFromSessionStorage'](){const _0x375a0b=sessionStorage['getItem'](So)||'[]';this['addMany'](JSON['parse'](_0x375a0b));}['_saveToSessionStorage'](){sessionStorage['setItem'](So,JSON['stringify'](this['map'](_0x2a89df=>_0x2a89df)));}}function fo(_0x1566bb){return _0x1566bb['toLowerCase']()['trim']();}class k extends _0x55515f{['focusTracker'];['keystrokes'];['contentArea'];['toolbar'];['promptView'];['errorView'];['_focusables'];['focusCycler'];['_promptHistory'];constructor(_0x331a5a,_0x33b2b6,_0x418390=''){super(_0x331a5a),this['set']('isEnabled',!0x0),this['set']('isProcessing',!0x1),this['set']('prompt',''),this['set']('value',''),this['set']('isError',!0x1),this['set']('mainAction',_['REPLACE']),this['_promptHistory']=new Ir(),this['errorView']=new vr(_0x331a5a),this['contentArea']=new Er(_0x331a5a,_0x418390),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 _0x338162(),this['keystrokes']=new _0x1b5c14(),this['_focusables']=this['createCollection']([this['contentArea'],this['contentArea']['copyButtonView'],this['toolbar'],this['promptView']]),this['focusCycler']=new _0x2f6676({'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 _0x302fca=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form',_0x33b2b6],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form-content']},'children':[{'tag':'div','attributes':{'class':[_0x302fca['if']('isError','ck-hidden',_0x29f6da=>!_0x29f6da)]},'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'](_0x38563b=0x1){-0x1===_0x38563b?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 _0x2e0d20=this['locale'],_0x9bd159=new Ar(_0x2e0d20,{'queryView':{'label':Fn(_0x2e0d20,'Ask\x20AI\x20to\x20edit\x20or\x20generate'),'creator':_0x28513c,'showIcon':!0x1,'showResetButton':!0x1},'infoView':{'text':{'noSearchableItems':{'primary':Fn(_0x2e0d20,'Empty\x20history'),'secondary':Fn(_0x2e0d20,'Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.')}}},'filteredView':this['_createHistoryView'](),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1});return _0x9bd159['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x35d958,_0x158a49)=>_0x35d958&&!_0x158a49),this['listenTo'](_0x9bd159,'submit',(_0x154664,_0x15dc86)=>{this['prompt']=_0x15dc86;const _0x17a694=_0x25d6a2(_0x15dc86);this['fire']('submitPrompt',_0x17a694),_0x15dc86['trim']()&&this['_promptHistory']['add']({'prompt':_0x17a694},0x0);},{'priority':'high'}),_0x9bd159;}['_createHistoryView'](){const _0x1053e6=new Pr(this['locale']);return _0x1053e6['historyGroupView']['items']['bindTo'](this['_promptHistory'])['as'](jr),_0x1053e6['on']('clearHistory',()=>{this['_promptHistory']['clear'](),this['promptView']['search'](''),this['promptView']['focus']();}),_0x1053e6;}['_createToolbar'](){const _0x50e860=new yr(this['locale']);return _0x50e860['replaceButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x1b01f0,_0x1e2cef,_0x46f1b3)=>_0x1b01f0&&!_0x1e2cef&&!!_0x46f1b3),_0x50e860['replaceButton']['delegate']('execute')['to'](this,'replaceContent'),_0x50e860['insertButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x1380eb,_0x53a2c0,_0x271e4e)=>_0x1380eb&&!_0x53a2c0&&!!_0x271e4e),_0x50e860['insertButton']['delegate']('execute')['to'](this,'insertContentBelow'),_0x50e860['tryAgainButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x23b870,_0x371528)=>_0x23b870&&!_0x371528),_0x50e860['tryAgainButton']['delegate']('execute')['to'](this,'tryAgainEvent'),_0x50e860['stopButton']['bind']('isEnabled')['to'](this,'isProcessing'),_0x50e860['stopButton']['delegate']('execute')['to'](this,'stopProcessing'),_0x50e860;}['startProcessing'](){this['value']='',this['isError']=!0x1,this['isProcessing']=!0x0,this['contentArea']['isVisible']=!0x0,this['toolbar']['isVisible']=!0x0,this['contentArea']['focus']();}['finishProcessing'](){const _0x7ca01e=this['locale'];this['isProcessing']=!0x1,this['prompt']='',this['promptView']['reset'](),this['value']&&(this['promptView']['queryView']['label']=Fn(_0x7ca01e,'Ask\x20AI\x20to\x20improve\x20generated\x20text'));}['handleError'](_0x5a1769){const _0x179d82=this['locale'];this['finishProcessing'](),this['isError']=!0x0,this['errorView']['text']=_0x5a1769||Fn(_0x179d82,'AI_ERROR_FAILED'),this['value']||(this['contentArea']['isVisible']=!0x1);}}const w=globalThis['DataTransfer'];class n extends _0x3a21ac{['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[_0x806c01,a,K,_0x14e96e];}constructor(_0x3673b6){super(_0x3673b6),_0x3673b6['config']['define']('ai.assistant.disabledElements',['media','rawHtml','tableOfContents']),_0x3673b6['config']['define']('ai.assistant.contentAreaCssClass',''),_0x3673b6['config']['define']('ai.assistant.useTheme',!0x0),this['_uiCssClasses']='ck-ai-assistant-ui'+(_0x3673b6['config']['get']('ai.assistant.useTheme')?'\x20ck-ai-assistant-ui_theme':'');}['init'](){const {editor:_0x4582c2}=this;this['_aiAdapter']=_0x4582c2['plugins']['get'](K),this['_dialog']=_0x4582c2['plugins']['get'](_0x14e96e),this['_formView']=null,this['_commandDefinitions']=this['_getResolvedCommandsDefinitions']();const _0x5cf646=new E(_0x4582c2,Array['from'](this['_commandDefinitions']['values']()));_0x4582c2['commands']['add']('showAIAssistant',_0x5cf646),_0x4582c2['ui']['componentFactory']['add']('aiCommands',_0x19bb6c=>{const _0x4c3e99=_0x4c9a3b(_0x19bb6c);return _0x4c3e99['set']({'class':'ck-ai-commands-dropdown\x20'+this['_uiCssClasses']}),_0x4c3e99['buttonView']['set']({'label':Fn(_0x19bb6c,'AI\x20Commands'),'icon':_0x3f2f71,'tooltip':!0x0}),_0x4c3e99['on']('execute',_0x43047e=>this['_onExecute'](_0x43047e['source']['id'])),_0x52b06c(_0x4c3e99,_0x4582c2['ui']['view']['body'],function(_0x5382e9){const _0x20d5a6=o(_0x5382e9['config']['get']('ai.assistant.commands'),_0x5382e9['locale']),_0x29dc7b=B(_0x5382e9,_0x20d5a6)['filter'](_0x2e145d=>_0x2e145d['commands']['length']);if(0x1===_0x29dc7b['length'])return B(_0x5382e9,_0x29dc7b[0x0]['commands'])['map'](_0x4224cb=>({'id':_0x4224cb['id'],'label':_0x4224cb['label']}));return _0x29dc7b['map'](_0x20fcf1=>{const {groupId:_0x4db651,groupLabel:_0x578188,commands:_0x43c969}=_0x20fcf1,_0x360ff1=B(_0x5382e9,_0x43c969)['map'](_0x5c11df=>({'id':_0x5c11df['id'],'label':_0x5c11df['label']}));return{'id':_0x4db651,'menu':_0x578188||_0x4db651,'children':_0x360ff1};});}(_0x4582c2),{'ariaLabel':Fn(_0x19bb6c,'AI\x20Commands')}),_0x4c3e99['menuView']['menuPanelClass']='ck-ai-commands-dropdown\x20'+this['_uiCssClasses'],_0x5cf646['on']('change:enabledCommandsIds',_0x519c3d),_0x4c3e99['menuView']['once']('render',_0x519c3d),_0x4c3e99;function _0x519c3d(){_0x4c3e99['isEnabled']=_0x5cf646['enabledCommandsIds']['length']>0x0;for(const _0x45ae05 of _0x4c3e99['menuView']['buttons'])_0x45ae05['isEnabled']=_0x5cf646['enabledCommandsIds']['includes'](_0x45ae05['id']);}}),_0x4582c2['ui']['componentFactory']['add']('menuBar:aiCommands',_0x28519b=>{const _0x1fc469=new _0x3de95d(_0x28519b);_0x1fc469['buttonView']['set']({'label':Fn(_0x28519b,'AI\x20Commands'),'icon':_0x3f2f71}),_0x1fc469['bind']('isEnabled')['to'](_0x5cf646,'enabledCommandsIds',_0x273dc9=>_0x273dc9['length']>0x0);const _0x1066ad=o(_0x4582c2['config']['get']('ai.assistant.commands'),_0x28519b);return this['_populateMenuBarMenu'](_0x5cf646,_0x1fc469,_0x1066ad,_0x396da6=>this['_onExecute'](_0x396da6)),_0x1fc469;}),_0x4582c2['ui']['componentFactory']['add']('aiAssistant',()=>{const _0x1a9e89=this['_createAIAssistantUIButton'](_0x5cf211);return _0x1a9e89['set']({'tooltip':!0x0,'class':'ck-ai-assistant-button\x20'+this['_uiCssClasses']}),_0x1a9e89;}),_0x4582c2['ui']['componentFactory']['add']('menuBar:aiAssistant',()=>{const _0x31b9d7=this['_createAIAssistantUIButton'](_0x13902c);return _0x31b9d7['set']({'role':'menuitemcheckbox'}),_0x31b9d7;}),this['licenseKey']=this['editor']['config']['get']('licenseKey');const _0x16e681=this['editor'];this['_licenseKeyCheckInterval']=setInterval(()=>{let _0x3e4150;for(const _0x3db51a in _0x16e681){const _0x173f65=_0x3db51a,_0x38f87a=_0x16e681[_0x173f65];if('aiLicenseKeyValid'==_0x38f87a||'aiLicenseKeyInvalid'==_0x38f87a||'aiLicenseKeyExpired'==_0x38f87a||'aiLicenseKeyDomainLimit'==_0x38f87a||'aiLicenseKeyNotAllowed'==_0x38f87a||'aiLicenseKeyEvaluationLimit'==_0x38f87a||'aiLicenseKeyUsageLimit'==_0x38f87a){delete _0x16e681[_0x173f65],_0x3e4150=_0x38f87a,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'aiLicenseKeyInvalid'==_0x3e4150&&_0x16e681['_showLicenseError']('invalid'),'aiLicenseKeyExpired'==_0x3e4150&&_0x16e681['_showLicenseError']('expired'),'aiLicenseKeyDomainLimit'==_0x3e4150&&_0x16e681['_showLicenseError']('domainLimit'),'aiLicenseKeyNotAllowed'==_0x3e4150&&_0x16e681['_showLicenseError']('featureNotAllowed','AIAssistant'),'aiLicenseKeyEvaluationLimit'==_0x3e4150&&_0x16e681['_showLicenseError']('evaluationLimit'),'aiLicenseKeyUsageLimit'==_0x3e4150&&_0x16e681['_showLicenseError']('usageLimit');},0x3e8);}['destroy'](){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}['showUI'](_0x3d6504='',_0x1d02c0='',_0x5ac27e='custom'){const _0x400274=this['editor'],_0x12bc48=_0x400274['editing']['view'],_0x1a23e7=_0x400274['plugins']['get'](a),_0x1bab55=_0x400274['plugins']['get'](_0x806c01);_0x1a23e7['showFakeVisualSelection']();const _0x21ee65=new w(),_0x162841=new ClipboardEvent('copy',{'clipboardData':_0x21ee65}),_0x48e8b7=new _0x5b099b(_0x21ee65),_0x4ce05d=new _0x4e452c(_0x12bc48,_0x162841,{'dataTransfer':_0x48e8b7});_0x1bab55['_forceMarkersCopy']('comment',()=>{_0x12bc48['document']['fire']('copy',_0x4ce05d);}),this['_formView']||(this['_initView'](),this['_aiAssistantController']=new j(_0x400274,this['_aiAdapter']['textAdapter'],this['_formView']));let _0x277679=_0x48e8b7['getData']('text/html');const _0x52f1c2=_0x400274['model']['document']['selection'],_0xf5d437=Array['from'](_0x52f1c2['getRanges']());0x1===_0xf5d437['length']&&_0xf5d437[0x0]['isFlat']&&!_0x52f1c2['getSelectedElement']()&&''!==_0x277679['replace'](/ /g,'')['trim']()&&(_0x277679='<p>'+_0x277679+'</p>'),this['_aiAssistantController']['updateView']({'actionId':_0x5ac27e,'query':_0x3d6504,'htmlContent':_0x277679,'label':_0x1d02c0,'mainActionLabel':_[_0x400274['model']['document']['selection']['isCollapsed']?'INSERT':'REPLACE']}),'aiAssistant'!==this['_dialog']['id']?this['_dialog']['show']({'id':'aiAssistant','icon':_0x488353,'title':Fn(this['editor']['locale'],'AI\x20Assistant'),'content':this['_formView'],'position':_0x2f4dee['EDITOR_TOP_SIDE'],'onShow':()=>{this['_formView']['focus']();},'onHide':()=>{this['_aiAssistantController']['reset'](),_0x1a23e7['hideFakeVisualSelection']();}}):this['_dialog']['view']['wasMoved']||this['_dialog']['view']['updatePosition']();}['hideUI'](){this['_dialog']['hide']();}['_getResolvedCommandsDefinitions'](){const _0x4d4f0b=new Map(),_0x2a17ed=o(this['editor']['config']['get']('ai.assistant.commands'),this['editor']['locale']);for(const _0x344802 of _0x2a17ed)for(const _0x3cbbbe of _0x344802['commands'])_0x4d4f0b['set'](_0x3cbbbe['id'],{..._0x3cbbbe,'groupId':_0x344802['groupId'],'groupLabel':_0x344802['groupLabel']||_0x344802['groupId']});return _0x4d4f0b;}['_createAIAssistantUIButton'](_0x13967d){const _0x18cd68=this['editor'],_0x1e8fa9=_0x18cd68['commands']['get']('showAIAssistant'),_0x1e42c8=new _0x13967d(_0x18cd68['locale']);return _0x1e42c8['set']({'label':Fn(_0x18cd68['locale'],'AI\x20Assistant'),'icon':_0x488353,'isToggleable':!0x0}),_0x1e42c8['bind']('isEnabled')['to'](_0x1e8fa9),_0x1e42c8['bind']('isOn')['to'](this['_dialog'],'id',_0xecd692=>'aiAssistant'===_0xecd692),this['listenTo'](_0x1e42c8,'execute',()=>{_0x1e42c8['isOn']?this['hideUI']():_0x1e8fa9['execute']();}),_0x1e42c8;}['_initView'](){const _0x15ee75=this['editor']['plugins']['get'](a);this['_formView']=new k(this['editor']['locale'],this['_uiCssClasses'],this['editor']['config']['get']('ai.assistant.contentAreaCssClass')),this['_formView']['on']('change:value',()=>{this['_dialog']['view']['wasMoved']||this['_dialog']['view']['updatePosition']();}),this['_formView']['promptView']['queryView']['fieldView']['on']('update',()=>{this['_dialog']['view']['wasMoved']||this['_dialog']['view']['updatePosition']();}),this['listenTo'](this['_formView'],'replaceContent',()=>{_0x15ee75['insertContent'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['listenTo'](this['_formView'],'insertContentBelow',()=>{_0x15ee75['insertContentBelow'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['_initAriaAiStatusChangeAnnouncements']();}['_initAriaAiStatusChangeAnnouncements'](){const {locale:_0x35e05d,ui:{ariaLiveAnnouncer:_0x51c6d8}}=this['editor'];this['_formView']['contentArea']['on']('change:isProcessing',(_0x3748aa,_0x384dc8,_0x3f395c)=>{const _0x1b6a4b=this['_aiAssistantController']['currentContext'];_0x3f395c?_0x51c6d8['announce'](Fn(_0x35e05d,'AI\x20is\x20writing')):_0x1b6a4b&&_0x51c6d8['announce'](Fn(_0x35e05d,'Generated\x20content:\x20%0',_0x1b6a4b),{'politeness':'polite','isUnsafeHTML':!0x0});}),this['_formView']['on']('change:isError',(_0x3f5e99,_0x39a78c,_0x59f9ae)=>{if(_0x59f9ae){const _0x418330=this['_formView']['errorView']['text'];_0x51c6d8['announce'](Fn(_0x35e05d,'Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x418330));}});}['_onExecute'](_0x51e6df){const _0x272b45=this['_commandDefinitions']['get'](_0x51e6df),_0x48b9c1=this['editor'],_0x10f526=_0x48b9c1['model']['document']['selection'],_0x5cf0eb=_0x48b9c1['commands']['get']('showAIAssistant'),_0x4d0b65=_0x48b9c1['plugins']['get'](a),_0x4ee6e8=''+(_0x272b45['groupId']!==x?_0x272b45['groupLabel']+':\x20':'')+_0x272b45['label'];if(!0x1!==_0x272b45['requiresContent']&&_0x10f526['isCollapsed']){const _0x2d693b=_0x1ee4fd(_0x10f526['getSelectedBlocks']())||_0x48b9c1['model']['schema']['getLimitElement'](_0x10f526);_0x48b9c1['model']['change'](_0x13adfb=>{_0x13adfb['setSelection'](_0x2d693b,'in');});}_0x4d0b65['showFakeVisualSelection'](),_0x5cf0eb['execute'](_0x272b45['prompt'],_0x4ee6e8,'command:'+_0x51e6df);}['_populateMenuBarMenu'](_0x5274cf,_0x4dff90,_0x25b0a6,_0x19c9b0){const _0x3c8473=this['editor'],_0x2cfe4f=_0x3c8473['locale'],_0x393c7f=new _0x470e26(_0x2cfe4f),_0x27301e=B(_0x3c8473,_0x25b0a6)['filter'](_0x83d4f3=>_0x83d4f3['commands']['length']);0x1===_0x27301e['length']?this['_getMenuBarGroupButtons']({'command':_0x5274cf,'commands':_0x27301e[0x0]['commands'],'parentMenuView':_0x4dff90,'onExecute':_0x19c9b0})['forEach'](_0x572b64=>_0x393c7f['items']['add'](_0x572b64)):_0x27301e['forEach'](({groupId:_0x4ebadc,groupLabel:_0x2633fc,commands:_0x14d194})=>{const _0x4a4acc=new _0x184fc0(_0x2cfe4f,_0x4dff90),_0x5807ca=new _0x3de95d(_0x2cfe4f),_0x39794b=new _0x470e26(_0x2cfe4f),_0x3b5448=this['_getMenuBarGroupButtons']({'command':_0x5274cf,'commands':_0x14d194,'parentMenuView':_0x5807ca,'onExecute':_0x19c9b0});_0x5807ca['buttonView']['set']({'label':_0x2633fc||_0x4ebadc}),_0x5807ca['delegate']('execute')['to'](_0x4dff90),_0x39794b['items']['addMany'](_0x3b5448),_0x5807ca['panelView']['children']['add'](_0x39794b),_0x4a4acc['children']['add'](_0x5807ca),_0x393c7f['items']['add'](_0x4a4acc);}),_0x4dff90['panelView']['children']['add'](_0x393c7f);}['_getMenuBarGroupButtons']({command:_0x53a454,commands:_0x1c3ee0,parentMenuView:_0x36dd35,onExecute:_0x3fbec8}){const _0x167101=this['editor'],_0x4bf0ff=_0x167101['locale'];return B(_0x167101,_0x1c3ee0)['map'](_0x1052c8=>{const _0x1dd46c=new _0x184fc0(_0x4bf0ff,_0x36dd35),_0x33a9cb=new _0x13902c(_0x4bf0ff);return _0x33a9cb['set']({'label':_0x1052c8['label']}),_0x33a9cb['delegate']('execute')['to'](_0x36dd35),_0x33a9cb['on']('execute',()=>_0x3fbec8(_0x1052c8['id'])),_0x33a9cb['bind']('isEnabled')['to'](_0x53a454,'enabledCommandsIds',_0x2acd2f=>_0x2acd2f['includes'](_0x1052c8['id'])),_0x1dd46c['children']['add'](_0x33a9cb),_0x1dd46c;});}}function U(_0x5dbef9,_0x596ffb){return void 0x0!==_0x5dbef9['order']&&void 0x0===_0x596ffb['order']?0x1:void 0x0===_0x5dbef9['order']&&void 0x0!==_0x596ffb['order']?-0x1:void 0x0!==_0x5dbef9['order']&&void 0x0!==_0x596ffb['order']?_0x5dbef9['order']-_0x596ffb['order']:0x0;}function B(_0x115021,_0x303ab5){_0x303ab5['sort'](U);const _0x2634d4={},_0x2c38fa=[];for(const _0x1b3d45 of _0x303ab5)if(void 0x0!==_0x1b3d45['order']){if(_0x1b3d45['order']in _0x2634d4)throw new _0x25e143('ai-commands-config-order-collision',_0x115021,{'conflictingDefinitions':[_0x1b3d45,_0x2634d4[_0x1b3d45['order']]]});_0x2634d4[_0x1b3d45['order']]=_0x1b3d45,_0x2c38fa['splice'](_0x1b3d45['order'],0x0,_0x1b3d45);}else _0x2c38fa['push'](_0x1b3d45);return _0x2c38fa;}class $n extends _0x3a21ac{static get['requires'](){return[n,a];}static get['pluginName'](){return'AIAssistant';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x21fe1c){super(_0x21fe1c);const _0x1078eb=_0x21fe1c['config'],_0x10695f=_0x21fe1c['locale'];_0x1078eb['define']('ai.assistant.preserveComments',!0x0),_0x1078eb['define']('ai.assistant.commands',qn(_0x10695f)),_0x1078eb['define']('ai.assistant.extraCommandGroups',[]),_0x1078eb['define']('ai.assistant.removeCommands',[]);let _0x1ff4e6=o(_0x1078eb['get']('ai.assistant.commands'),_0x10695f);const _0x436967=_0x1078eb['get']('ai.assistant.extraCommandGroups'),_0x394792=_0x1078eb['get']('ai.assistant.removeCommands');_0x436967['forEach'](_0x4d627c=>{const _0x5c7d67=_0x1ff4e6['find'](_0x28ee10=>_0x28ee10['groupId']===_0x4d627c['groupId']);_0x5c7d67?_0x5c7d67['commands']=_0x5c7d67['commands']['concat'](_0x4d627c['commands']):_0x1ff4e6['push'](_0x4d627c);}),_0x1ff4e6=_0x1ff4e6['filter'](_0x36c839=>!_0x394792['includes'](_0x36c839['groupId'])),_0x1ff4e6['forEach'](_0x3d4c50=>{_0x3d4c50['commands']=_0x3d4c50['commands']['filter'](_0x491615=>!_0x394792['includes'](_0x491615['id']));}),_0x1078eb['set']('ai.assistant.commands',_0x1ff4e6);}}function qn(_0x3c80e2){return[{'groupId':'editOrReview','groupLabel':Fn(_0x3c80e2,'Edit\x20or\x20review'),'commands':[{'id':'improveWriting','label':Fn(_0x3c80e2,'Improve\x20writing'),'prompt':'Fix\x20spelling\x20mistakes,\x20use\x20proper\x20grammar\x20and\x20apply\x20good\x20writing\x20practices.\x20Do\x20not\x20lose\x20the\x20original\x20meaning.'},{'id':'makeShorter','label':Fn(_0x3c80e2,'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':Fn(_0x3c80e2,'Make\x20longer'),'prompt':'Improve\x20this\x20content\x20by\x20using\x20descriptive\x20language\x20and\x20inserting\x20more\x20information\x20and\x20more\x20detailed\x20explanations.'},{'id':'simplifyLanguage','label':Fn(_0x3c80e2,'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':Fn(_0x3c80e2,'Generate\x20from\x20selection'),'commands':[{'id':'summarize','label':Fn(_0x3c80e2,'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':Fn(_0x3c80e2,'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':Fn(_0x3c80e2,'Change\x20tone'),'commands':[{'id':'professional','label':Fn(_0x3c80e2,'Professional'),'prompt':'Improve\x20using\x20polished,\x20formal,\x20and\x20respectful\x20language\x20to\x20convey\x20professional\x20expertise\x20and\x20competence.'},{'id':'casual','label':Fn(_0x3c80e2,'Casual'),'prompt':'Improve\x20using\x20casual,\x20informal\x20language\x20to\x20convey\x20a\x20casual\x20conversation\x20with\x20a\x20real\x20person.'},{'id':'direct','label':Fn(_0x3c80e2,'Direct'),'prompt':'Improve\x20using\x20direct\x20language,\x20using\x20only\x20the\x20essential\x20information.'},{'id':'confident','label':Fn(_0x3c80e2,'Confident'),'prompt':'Improve\x20using\x20compelling,\x20optimistic\x20language\x20to\x20convey\x20confidence\x20in\x20the\x20writing.'},{'id':'friendly','label':Fn(_0x3c80e2,'Friendly'),'prompt':'Improve\x20using\x20friendly,\x20comforting\x20language,\x20to\x20convey\x20understanding\x20and\x20empathy.'}]},{'groupId':'changeStyle','groupLabel':Fn(_0x3c80e2,'Change\x20style'),'commands':[{'id':'business','label':Fn(_0x3c80e2,'Business'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20business\x20professional\x20with\x20formal\x20language.'},{'id':'legal','label':Fn(_0x3c80e2,'Legal'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20legal\x20professional\x20using\x20valid\x20legal\x20terminology.'},{'id':'journalism','label':Fn(_0x3c80e2,'Journalism'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20journalist\x20using\x20engaging\x20language\x20to\x20convey\x20the\x20importance\x20of\x20the\x20information.'},{'id':'poetic','label':Fn(_0x3c80e2,'Poetic'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20poem\x20using\x20poetic\x20techniques\x20without\x20losing\x20the\x20original\x20meaning.'}]},{'groupId':'translate','groupLabel':Fn(_0x3c80e2,'Translate'),'commands':[{'id':'translateEnglish','label':Fn(_0x3c80e2,'English'),'prompt':'Translate\x20the\x20content\x20to\x20English\x20language.'},{'id':'translateSpanish','label':Fn(_0x3c80e2,'Spanish'),'prompt':'Translate\x20the\x20content\x20to\x20Spanish\x20language.'},{'id':'translatePortuguese','label':Fn(_0x3c80e2,'Portuguese'),'prompt':'Translate\x20the\x20content\x20to\x20Portuguese\x20language.'},{'id':'translateGerman','label':Fn(_0x3c80e2,'German'),'prompt':'Translate\x20the\x20content\x20to\x20German\x20language.'},{'id':'translateFrench','label':Fn(_0x3c80e2,'French'),'prompt':'Translate\x20the\x20content\x20to\x20French\x20language.'},{'id':'translateChinese','label':Fn(_0x3c80e2,'Simplified\x20Chinese'),'prompt':'Translate\x20the\x20content\x20to\x20Simplified\x20Chinese\x20language.'},{'id':'translateHindi','label':Fn(_0x3c80e2,'Hindi'),'prompt':'Translate\x20the\x20content\x20to\x20Hindi\x20language.'},{'id':'translateArabic','label':Fn(_0x3c80e2,'Arabic'),'prompt':'Translate\x20the\x20content\x20to\x20Arabic\x20language.'}]}];}class pe extends _0x3a21ac{['abortController'];static get['requires'](){return[K];}constructor(_0xc2b780){super(_0xc2b780),this['abortController']=new AbortController();}['init'](){this['editor']['plugins']['get'](K)['textAdapter']=this;}['abort'](){this['abortController']['signal']['aborted']||(this['abortController']['abort'](),this['abortController']=new AbortController());}async['makeRequest'](_0x36f948){return this['sendRequest'](_0x36f948)['catch'](_0x1696d2=>{if(_0x1696d2 instanceof tr)return Promise['reject'](_0x1696d2);if('AbortError'==_0x1696d2['name'])return Promise['resolve']();throw console['error'](_0x1696d2),new _0x25e143('aitextadapter-send-request-failed',null);});}async['_prepareRequestHeaders'](_0x1886ce,_0x2692cc){const _0x48c388=this['editor']['locale'],_0x31d88b={'Content-Type':'application/json'};if('object'==typeof _0x1886ce)Object['assign'](_0x31d88b,_0x1886ce);else{if(_0x1886ce)try{const _0x51b849=await _0x1886ce(_0x2692cc);Object['assign'](_0x31d88b,_0x51b849);}catch{return Promise['reject'](new tr(Fn(_0x48c388,'AI_ERROR_GET_HEADERS')));}}return _0x31d88b;}async['_prepareRequestParameters'](_0x4e44eb,_0x1f4306){const _0x5e2513=this['editor']['locale'];if('object'==typeof _0x4e44eb)return _0x4e44eb;try{return await _0x4e44eb(_0x1f4306);}catch{return Promise['reject'](new tr(Fn(_0x5e2513,'AI_ERROR_GET_PARAMETERS')));}}}class Qn extends pe{['_apiUrl'];['_requestHeaders'];['_requestParameters'];static get['pluginName'](){return'OpenAITextAdapter';}constructor(_0x55f050){super(_0x55f050),_0x55f050['config']['define']('ai.assistant.adapter.openAI.apiUrl','https://api.openai.com/v1/chat/completions'),_0x55f050['config']['get']('ai.assistant.adapter.openAI.requestParameters')||_0x55f050['config']['define']('ai.assistant.adapter.openAI.requestParameters',{'model':'gpt-4o','temperature':0x1,'top_p':0x1,'stream':!0x0}),this['_apiUrl']=_0x55f050['config']['get']('ai.assistant.adapter.openAI.apiUrl'),this['_requestHeaders']=_0x55f050['config']['get']('ai.assistant.adapter.openAI.requestHeaders')||{},this['_requestParameters']=_0x55f050['config']['get']('ai.assistant.adapter.openAI.requestParameters');}async['sendRequest']({query:_0x2f246e,context:_0x333780,onData:_0x3a6fb4,actionId:_0x30713a}){const _0x53c616=this['editor']['locale'],_0x152330=await this['prepareMessages'](_0x2f246e,_0x333780,_0x30713a),_0xa5fc44=await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x30713a),_0x3111b8=await this['_prepareRequestParameters'](this['_requestParameters'],_0x30713a),_0x242545={'messages':_0x152330,..._0x3111b8},_0x135568={'method':'POST','headers':_0xa5fc44,'body':JSON['stringify'](_0x242545),'signal':this['abortController']['signal']},_0x4d99cd=await fetch(this['_apiUrl'],_0x135568);if(_0x4d99cd['ok'])return _0x3111b8['stream']?await this['_readStreamableResponse'](_0x4d99cd,_0x3a6fb4):await this['_readStaticResponse'](_0x4d99cd,_0x3a6fb4),Promise['resolve']();{const _0x308d59=await _0x4d99cd['text']();return _0x308d59['includes']('context_length_exceeded')?Promise['reject'](new tr(Fn(_0x53c616,'AI_ERROR_CONTEXT_LENGTH'))):_0x308d59['includes']('Moderation')?Promise['reject'](new tr(Fn(_0x53c616,'AI_ERROR_MODERATION'))):Promise['reject'](new Error(_0x308d59));}}async['prepareMessages'](_0x5bdea8,_0x20b50b,_0x1eb5d3){let _0x4b9c6a,_0x56a198;return _0x20b50b?(_0x4b9c6a='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.',_0x56a198='Instruction:\x0a'+_0x5bdea8+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x20b50b):(_0x4b9c6a='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.',_0x56a198=_0x5bdea8),[{'role':'system','content':_0x4b9c6a},{'role':'user','content':_0x56a198}];}async['_readStreamableResponse'](_0x2ab9a0,_0x470641){const _0x14d5f0=_0x2ab9a0['body']['getReader'](),_0x4dd83b=new TextDecoder();let _0x1bb93d='',_0x569247='',_0x432955='',_0x3eaba=!0x1;for(;!_0x3eaba;){const {done:_0x31c1d5,value:_0x2d7a46}=await _0x14d5f0['read'](),_0xf51b06=_0x1bb93d+_0x4dd83b['decode'](_0x2d7a46);let _0x219fae='';_0x3eaba=_0x31c1d5;try{_0x219fae=this['_cleanUpData'](_0xf51b06),_0x1bb93d='';}catch{_0x1bb93d=_0xf51b06;continue;}_0x569247+=_0x219fae,!_0x3eaba&&this['_isBufferIncomplete'](_0x569247)||_0x569247&&(_0x432955+=_0x569247,_0x569247='',_0x470641(_0x432955));}return Promise['resolve']();}async['_readStaticResponse'](_0x515d1f,_0x8337f9){return _0x8337f9((await _0x515d1f['json']())['choices'][0x0]['message']['content']),Promise['resolve']();}['_isBufferIncomplete'](_0x5ee242){const _0x1aabcf=_0x5ee242['split']('<')['length']!==_0x5ee242['split']('>')['length'],_0x358fc9=_0x5ee242['length']<0x1e;return _0x1aabcf&&_0x358fc9;}['_cleanUpData'](_0x565ab8){return _0x565ab8['split'](/\n(?![^{]*\})/g)['map'](_0x428e66=>_0x428e66['replace']('data:\x20',''))['filter'](_0xb364df=>_0xb364df&&_0xb364df['length']>0x0&&'[DONE]'!==_0xb364df)['map'](_0x4b0a09=>{const {choices:_0x49d30e}=JSON['parse'](_0x4b0a09);if(_0x49d30e[0x0]?.['delta']?.['content'])return _0x49d30e[0x0]['delta']['content'];})['filter'](_0x27cb74=>_0x27cb74)['join']('');}}class Xn extends pe{['_apiUrl'];['_requestHeaders'];['_bedrockClientConfig'];['_requestParameters'];static get['pluginName'](){return'AWSTextAdapter';}constructor(_0x4fe404){super(_0x4fe404),_0x4fe404['config']['get']('ai.assistant.adapter.aws.requestParameters')||_0x4fe404['config']['define']('ai.assistant.adapter.aws.requestParameters',{'model':'anthropic.claude-v2','max_tokens_to_sample':0x7d0,'temperature':0x1,'top_p':0x1,'top_k':0xfa,'anthropic_version':'bedrock-2023-05-31','stream':!0x0}),this['_apiUrl']=_0x4fe404['config']['get']('ai.assistant.adapter.aws.apiUrl'),this['_bedrockClientConfig']=_0x4fe404['config']['get']('ai.assistant.adapter.aws.bedrockClientConfig'),this['_requestHeaders']=_0x4fe404['config']['get']('ai.assistant.adapter.aws.requestHeaders'),this['_requestParameters']=_0x4fe404['config']['get']('ai.assistant.adapter.aws.requestParameters');}async['sendRequest']({query:_0x156c96,context:_0x185924,onData:_0x150628,actionId:_0x49af8d}){const {model:_0x521553,stream:_0x57e68b,..._0x3e57f9}=await this['_prepareRequestParameters'](this['_requestParameters'],_0x49af8d),_0x7ea0b2={'prompt':await this['preparePrompt'](_0x156c96,_0x185924,_0x521553,_0x49af8d),..._0x3e57f9};this['_apiUrl']?await this['_processProxyRequest'](_0x7ea0b2,_0x521553,_0x57e68b,_0x150628,_0x49af8d):await this['_processAWSRequest'](_0x7ea0b2,_0x521553,_0x57e68b,_0x150628);}async['preparePrompt'](_0x5388b5,_0xf0404c,_0x5b04a4,_0x3816e8){let _0x294804,_0x17ff56;return _0xf0404c?(_0x294804='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.',_0x17ff56='Instruction:\x0a'+_0x5388b5+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0xf0404c):(_0x294804='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.',_0x17ff56=_0x5388b5),'meta.llama'==this['getModelFamily'](_0x5b04a4)?'<<SYS>>\x0a'+_0x294804+'\x0a<</SYS>>\x0a[INST]\x0a'+_0x17ff56+'\x0a[/INST]':'Human:\x0a'+_0x294804+'\x0a'+_0x17ff56+'\x0a\x0aAssistant:';}['getModelFamily'](_0x22dd00){if(/^anthropic\.claude/['test'](_0x22dd00))return'anthropic.claude';if(/^ai21\.j2/['test'](_0x22dd00))return'ai21.j2';if(/^cohere\.command/['test'](_0x22dd00))return'cohere.command';if(/^meta\.llama/['test'](_0x22dd00))return'meta.llama';throw new tr(Fn(this['editor']['locale'],'AI_ERROR_UNSUPPORTED_MODEL',_0x22dd00));}async['_processProxyRequest'](_0x284145,_0x1e5e8b,_0x2ef28c,_0x324a8e,_0x1c9367){const _0x39e3d0={'method':'POST','headers':await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x1c9367),'body':JSON['stringify']({..._0x284145,'model':_0x1e5e8b,'stream':_0x2ef28c}),'signal':this['abortController']['signal']},_0x578683=await fetch(this['_apiUrl'],_0x39e3d0);_0x2ef28c?await this['_readStreamableResponse'](_0x578683,_0x1e5e8b,_0x324a8e):await this['_readStaticResponse'](_0x578683,_0x1e5e8b,_0x324a8e);}async['_processAWSRequest'](_0x5aa71d,_0x1277be,_0x372be8,_0x5829c0){const _0x2199eb=new _0x38f8ef(this['_bedrockClientConfig']),_0x38f984={'body':JSON['stringify'](_0x5aa71d),'contentType':'application/json','accept':'application/json','modelId':_0x1277be};let _0x152311;if(_0x372be8){const _0x207b3e=new _0x6a6571(_0x38f984);_0x152311=await _0x2199eb['send'](_0x207b3e,{'abortSignal':this['abortController']['signal']}),await this['_readAsyncIterableResponse'](_0x152311,_0x1277be,_0x5829c0);}else{const _0xf5f08=new _0xe019c9(_0x38f984);_0x152311=await _0x2199eb['send'](_0xf5f08,{'abortSignal':this['abortController']['signal']}),await this['_readStaticResponse'](_0x152311,_0x1277be,_0x5829c0);}}async['_readAsyncIterableResponse'](_0x5497f1,_0x4af8b5,_0x515577){const _0x5624da=_0x5497f1['body'],_0xeb321c=new TextDecoder('utf-8');let _0x1f0b6e='';for await(const _0x13b4a5 of _0x5624da)if(_0x13b4a5['chunk']){const _0x5a731b=_0xeb321c['decode'](_0x13b4a5['chunk']['bytes']),_0x460ee5=JSON['parse'](_0x5a731b);_0x1f0b6e+=this['_getGeneratedText'](_0x460ee5,_0x4af8b5),_0x515577(_0x1f0b6e);}return Promise['resolve']();}async['_readStreamableResponse'](_0x37bd06,_0x40c13a,_0x14d740){const _0x454627=_0x37bd06['body'],_0x3cc927=new TextDecoder('utf-8'),_0x2832cd=_0x454627['getReader']();let _0x4f6b11='',_0x5f21f8='',_0xb34408=!0x1;for(;!_0xb34408;){const {done:_0x289dff,value:_0x3a75c5}=await _0x2832cd['read']();if(_0xb34408=_0x289dff,_0xb34408)break;const _0x488a34=(_0x4f6b11+_0x3cc927['decode'](_0x3a75c5))['split']('\x0a')['map'](_0x3613ef=>{try{return _0x4f6b11='',JSON['parse'](_0x3613ef);}catch{return _0x4f6b11=_0x3613ef,null;}})['filter'](_0x22232a=>null!==_0x22232a);_0x488a34['length']&&(_0x5f21f8+=_0x488a34['map'](_0x3d68d7=>this['_getGeneratedText'](_0x3d68d7,_0x40c13a))['join'](''),_0x14d740(_0x5f21f8));}return Promise['resolve']();}async['_readStaticResponse'](_0x3c5689,_0x55c919,_0x4df690){let _0x292ce2;return _0x292ce2=_0x3c5689 instanceof Response?await _0x3c5689['json']():JSON['parse'](new TextDecoder('utf-8')['decode'](_0x3c5689['body'])),(_0x4df690(this['_getGeneratedText'](_0x292ce2,_0x55c919)),Promise['resolve']());}['_getGeneratedText'](_0x3160d2,_0x110c89){switch(this['getModelFamily'](_0x110c89)){case'anthropic.claude':return _0x3160d2['completion'];case'ai21.j2':return _0x3160d2['completions'][0x0]['data']['text'];case'cohere.command':return _0x3160d2['generations'][0x0]['text'];case'meta.llama':return _0x3160d2['generation'];}}}class ia extends _0x5cf211{constructor(_0x17bcd7,_0x505710={}){super(_0x17bcd7),this['isToggleable']=!0x0,this['set']('side',_0x505710['side']||'top');const _0x1117e9=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-tab-button',..._0x25abe1(_0x505710['class']||[]),_0x1117e9['to']('side',_0x3c1af7=>'ck-tab-button_'+_0x3c1af7),_0x1117e9['to']('class')]}});}['show'](){this['set']('isVisible',!0x0);}['hide'](){this['set']('isVisible',!0x1);}}class ea extends _0x55515f{['children'];constructor(_0x14535c,_0x301e71={}){super(_0x14535c);const _0x38bf1d=this['bindTemplate'];this['set']('isVisible',!0x1),this['set']('class',''),this['children']=this['createCollection'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck-tab-panel',..._0x25abe1(_0x301e71['class']||[]),_0x38bf1d['to']('class'),_0x38bf1d['if']('isVisible','ck-hidden',_0x10c916=>!_0x10c916)]},'children':this['children']});}['show'](){this['set']('isVisible',!0x0);}['hide'](){this['set']('isVisible',!0x1);}}class ss extends _0x55515f{['buttonViews']=this['createCollection']();['panelViews']=this['createCollection']();['_tabs']=new Map();constructor(_0x1fbfd6,_0x50429e={}){super(_0x1fbfd6),this['set']('class',void 0x0),this['set']('activeTab',null),this['set']('side',_0x50429e['side']||'top'),this['set']('isMaximized',!0x1);const _0x416e16=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset','ck-tabs',..._0x25abe1(_0x50429e['class']||[]),_0x416e16['to']('side',_0x4eb2e1=>'ck-tabs_'+_0x4eb2e1),_0x416e16['to']('class'),_0x416e16['to']('isMaximized',_0x2eefa0=>_0x2eefa0?'ck-ai-tabs_maximized':'')],'tabindex':'0'},'children':[{'tag':'div','attributes':{'class':['ck','ck-tabs__buttons-container',_0x416e16['to']('side',_0x36ed59=>'ck-tabs__buttons-container_'+_0x36ed59)]},'children':this['buttonViews']},{'tag':'div','attributes':{'class':['ck','ck-tabs__panels-container',_0x416e16['to']('side',_0x4a0f27=>'ck-tabs__panels-container_'+_0x4a0f27)]},'children':this['panelViews']},..._0x25abe1(_0x50429e['children']||[])]});}['getTabIds'](){return[...this['_tabs']['keys']()];}['getTab'](_0x22db0b){const _0x4b58eb=this['_tabs']['get'](_0x22db0b);return _0x4b58eb||null;}['addTab'](_0x11ff5b){const _0x2124ae=this['_setupButton']({'id':_0x11ff5b['id'],'label':_0x11ff5b['buttonLabel'],'icon':_0x11ff5b['buttonIcon'],'order':_0x11ff5b['order']}),_0x4825ca=new ea(this['locale']);return _0x4825ca['render'](),_0x11ff5b['content']&&_0x4825ca['children']['add'](_0x11ff5b['content']),this['panelViews']['add'](_0x4825ca),this['_tabs']['set'](_0x11ff5b['id'],{'button':_0x2124ae,'panel':_0x4825ca,'order':void 0x0!==_0x11ff5b['order']?_0x11ff5b['order']:null}),this['fire']('addTab:'+_0x11ff5b['id'],{'id':_0x11ff5b['id'],'button':_0x2124ae,'panel':_0x4825ca}),null===this['activeTab']?this['activateTab'](_0x11ff5b['id']):this['_hidePanel'](_0x11ff5b['id']),{'button':_0x2124ae,'panel':_0x4825ca};}['activateTab'](_0x249064){if(null!==_0x249064&&!this['getTab'](_0x249064))throw new _0x25e143('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0x249064});this['activeTab']!==_0x249064&&(this['activeTab']&&this['_hidePanel'](this['activeTab']),this['activeTab']=_0x249064,_0x249064&&this['_showPanel'](_0x249064),this['fire']('activateTab:'+_0x249064,_0x249064));}['showTab'](_0x1a58d8){if(!this['getTab'](_0x1a58d8))throw new _0x25e143('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0x1a58d8});this['_showPanel'](_0x1a58d8),this['_showButton'](_0x1a58d8),this['fire']('show:'+_0x1a58d8,_0x1a58d8);}['hideTab'](_0x11e15e){if(!this['getTab'](_0x11e15e))throw new _0x25e143('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0x11e15e});const _0x22bcae=this['activeTab'];this['_hidePanel'](_0x11e15e),this['_hideButton'](_0x11e15e);const _0x4eab0a=this['getTabIds']();_0x22bcae===_0x11e15e&&_0x4eab0a['length']>0x1&&this['activateTab'](_0x4eab0a['find'](_0x3efdc2=>_0x3efdc2!==_0x11e15e)),this['fire']('hide:'+_0x11e15e,_0x11e15e);}['_getPanel'](_0x4b19eb){const _0x218b61=this['_tabs']['get'](_0x4b19eb);return _0x218b61?_0x218b61['panel']:null;}['_showPanel'](_0x5aed98){null!==this['activeTab']&&this['activeTab']!==_0x5aed98||this['_getPanel'](_0x5aed98)['show']();}['_hidePanel'](_0x256852){const _0x11ea72=this['_getPanel'](_0x256852);_0x11ea72['isVisible']&&(this['activeTab']===_0x256852&&(this['activeTab']=null),_0x11ea72['hide']());}['_getButton'](_0x535656){const _0x2a222a=this['_tabs']['get'](_0x535656);return _0x2a222a?_0x2a222a['button']:null;}['_showButton'](_0x938718){this['_getButton'](_0x938718)['show']();}['_hideButton'](_0x4d8eec){this['_getButton'](_0x4d8eec)['hide']();}['_setupButton'](_0x1d1eb2){const _0x26c8c4=new ia(this['locale'],{'side':this['side']}),_0x494459=this['buttonViews'];if(_0x26c8c4['set']({'label':_0x1d1eb2['label'],'icon':_0x1d1eb2['icon'],'tooltip':!0x0,'withText':!0x0}),_0x26c8c4['bind']('isOn')['to'](this,'activeTab',_0x52f238=>_0x52f238===_0x1d1eb2['id']),_0x26c8c4['bind']('side')['to'](this,'side'),_0x1d1eb2['order']){const _0x4fd3ce=[...this['_tabs']]['reduce']((_0x5a6308,_0xba8624)=>{const _0x3d43e1=_0xba8624[0x0],{order:_0x3f9f97}=_0xba8624[0x1];return!_0x3f9f97||_0x3f9f97>_0x1d1eb2['order']?_0x5a6308:_0x3f9f97>=_0x5a6308['order']?{'id':_0x3d43e1,'order':_0x3f9f97}:_0x5a6308;},{'id':'','order':0x0}),_0x33620c=_0x494459['getIndex'](this['_getButton'](_0x4fd3ce['id']));_0x494459['add'](_0x26c8c4,_0x33620c+0x1);}else _0x494459['add'](_0x26c8c4);return _0x26c8c4['on']('execute',()=>{this['activateTab'](_0x1d1eb2['id']);}),_0x26c8c4;}}const di=['overlay','sidebar','custom'],ui=['left','right'];class ai extends ss{constructor(_0x1ab4fa,_0x54eba8={}){super(_0x1ab4fa,_0x54eba8),this['set']('type',_0x54eba8['type']||'sidebar'),this['set']('side',_0x54eba8['side']||'right'),this['set']('isVisible',_0x54eba8['visibleByDefault']??!0x0);const _0x1f4bac=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-tabs',_0x1f4bac['if']('type','ck-ai-tabs__overlay',_0x1eb30b=>'overlay'===_0x1eb30b),_0x1f4bac['if']('type','ck-ai-tabs__sidebar',_0x10fe6e=>'sidebar'===_0x10fe6e),_0x1f4bac['if']('isVisible','ck-hidden',_0x123fd9=>!_0x123fd9)]}}),this['buttonViews']['on']('add',(_0x28bd1f,_0x21457c)=>{_0x21457c['set']('withText',!0x1);});}}class Ct extends _0x53b1cd{['view'];['container']=null;['showResizeButton']=!0x0;static get['pluginName'](){return'AITabs';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x591272){super(_0x591272);const _0xa3385b=this['context']['config']['get']('ai.container');if(this['set']('side','right'),!_0xa3385b)throw new _0x25e143('ai-tabs-configuration-not-found');if(void 0x0!==_0xa3385b['showResizeButton']&&(this['showResizeButton']=_0xa3385b['showResizeButton']),'sidebar'!==_0xa3385b['type']&&'overlay'!==_0xa3385b['type']||_0xa3385b['side']&&(this['side']=_0xa3385b['side']),'sidebar'===_0xa3385b['type']){if(this['container']=_0xa3385b['element'],this['set']('type','sidebar'),!this['container'])throw new _0x25e143('ai-tabs-sidebar-container-element-not-found');}else'overlay'===_0xa3385b['type']?(this['container']=document['body'],this['set']('type','overlay')):(this['container']=null,this['set']('type','custom'));this['view']=new ai(this['context']['locale'],{'side':this['side'],'type':this['type'],'visibleByDefault':void 0x0===_0xa3385b['visibleByDefault']||_0xa3385b['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 _t&&this['context']['ui']['focusTracker']['add'](this['view']['element']);}['switchType'](_0x12eadf){if(_0x12eadf&&this['type']!==_0x12eadf){if(!di['includes'](_0x12eadf))throw new _0x25e143('ai-tabs-unsupported-ui-type');this['type']=_0x12eadf;}}['switchSide'](_0xfddb30){if(_0xfddb30&&this['side']!==_0xfddb30){if(!ui['includes'](_0xfddb30))throw new _0x25e143('ai-tabs-unsupported-ui-side');this['side']=_0xfddb30;}}['resize'](){this['view']['isMaximized']=!this['view']['isMaximized'],this['fire']('resizedTabs',this['view']['isMaximized']);}['destroy'](){super['destroy'](),this['view']['destroy'](),this['view']['element']&&this['view']['element']['remove']();}}class R extends _0x53b1cd{['_apiUrl'];['_token'];['_decoder'];static get['requires'](){return['CloudServices'];}static get['pluginName'](){return'AIConnector';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x606754){super(_0x606754),this['context']['config']['define']('ai.serviceUrl','https://ai.cke-cs.com/v1'),this['_apiUrl']=this['context']['config']['get']('ai.serviceUrl'),this['_token']=null,this['_decoder']=new TextDecoder();}['init'](){const _0x29f94f=this['context']['plugins']['get']('CloudServices');if(!_0x29f94f['token'])throw new _0x25e143('ai-missing-token',this);this['_token']=_0x29f94f['token'];}['startConversation'](_0x58967f,_0x4ba6ae){const _0x4d9637=this['_sendApiRequest']('/conversations','POST',{'id':_0x58967f,'group':_0x4ba6ae});return{'getConversation':async()=>(await _0x4d9637['request'])['json'](),'abortController':_0x4d9637['abortController']};}['queryAssistant']({message:_0x11f9dc,conversationId:_0x277c24,parts:_0x892f9a,capabilities:_0x2b8d8f,model:_0x4c3b51,quickActionData:_0x40c1ba}){const _0xb9506a={..._0x40c1ba&&{'quickActionData':_0x40c1ba}},_0x492780={'prompt':_0x11f9dc,'content':_0x892f9a,'model':_0x4c3b51,..._0x2b8d8f&&{'capabilities':_0x2b8d8f},...Object['keys'](_0xb9506a)['length']>0x0&&{'attributes':_0xb9506a}},_0x40a2d8=this['_sendApiRequest']('/conversations/'+_0x277c24+'/messages','POST',_0x492780);return{'getStream':async()=>{const _0x30900e=(await _0x40a2d8['request'])['body'];return this['_getStreamReader'](_0x30900e);},'abortController':_0x40a2d8['abortController']};}['executeCustomAction']({content:_0x3d3e53,message:_0x4b4c77,model:_0x5dfd9f,outputFormat:_0x527830}){const _0x2aa2bb={'content':[{'type':'text','content':_0x3d3e53}],'prompt':_0x4b4c77,'model':_0x5dfd9f,'outputFormat':_0x527830},_0x28c277=this['_sendApiRequest']('/actions/custom/calls','POST',_0x2aa2bb);return{'getStream':async()=>{const _0x23f39e=(await _0x28c277['request'])['body'];return this['_getStreamReader'](_0x23f39e);},'abortController':_0x28c277['abortController']};}['executeAction']({actionName:_0x42a278,content:_0x58bac6,args:_0x37aeac}){const _0x4969da={'content':[{'type':'text','content':_0x58bac6}],'args':_0x37aeac},_0xd3fb6f=this['_sendApiRequest']('/actions/system/'+_0x42a278+'/calls','POST',_0x4969da);return{'getStream':async()=>{const _0x86081b=(await _0xd3fb6f['request'])['body'];return this['_getStreamReader'](_0x86081b);},'abortController':_0xd3fb6f['abortController']};}['uploadFile'](_0x4bf0ec,_0x26ae78,_0x42dde5){const _0x5c8b83=new FormData();_0x5c8b83['append']('file',_0x26ae78,_0x26ae78['name']),_0x42dde5&&_0x5c8b83['append']('attributes',JSON['stringify'](_0x42dde5));const _0x1d1a87=this['_sendApiRequest']('/conversations/'+_0x4bf0ec+'/files','POST',_0x5c8b83);return{'getId':async()=>(await _0x1d1a87['request'])['json'](),'abortController':_0x1d1a87['abortController']};}['fetchDocument'](_0x5b4d61,_0x1c4538){const _0x31cacb=this['_sendApiRequest']('/conversations/'+_0x5b4d61+'/documents/'+_0x1c4538,'GET');return{'getDocument':async()=>(await _0x31cacb['request'])['json'](),'abortController':_0x31cacb['abortController']};}['uploadDocument'](_0x284d8e,_0x5ccb6a,_0x1f5a28){const _0x3ebc94={'content':_0x5ccb6a};_0x1f5a28&&(_0x3ebc94['attributes']=_0x1f5a28);const _0x368737=this['_sendApiRequest']('/conversations/'+_0x284d8e+'/documents','POST',_0x3ebc94);return{'getId':async()=>(await _0x368737['request'])['json'](),'abortController':_0x368737['abortController']};}['fetchConversations'](_0x4563a1,_0x25e54f){const _0x153621=new URLSearchParams();_0x153621['append']('excludeEmpty','true'),_0x153621['append']('limit','100'),_0x153621['append']('group',_0x4563a1),_0x25e54f&&_0x153621['append']('search',_0x25e54f);const _0x4b3516=this['_sendApiRequest']('/conversations?'+_0x153621['toString'](),'GET');return{'getConversations':async()=>{const _0x34f905=await _0x4b3516['request'];return(await _0x34f905['json']())['items'];},'abortController':_0x4b3516['abortController']};}['deleteConversation'](_0x264ba7){const _0x127e0b=this['_sendApiRequest']('/conversations/'+_0x264ba7,'DELETE');return{'execute':async()=>{await _0x127e0b['request'];},'abortController':_0x127e0b['abortController']};}['updateConversation'](_0x4dfd21,_0x3fb993){const _0x129ce5=this['_sendApiRequest']('/conversations/'+_0x4dfd21,'PATCH',_0x3fb993);return{'getResult':async()=>(await _0x129ce5['request'],_0x3fb993),'abortController':_0x129ce5['abortController']};}['fetchConversation'](_0x59d443){const _0x1853eb=this['_sendApiRequest']('/conversations/'+_0x59d443,'GET');return{'getConversation':async()=>(await _0x1853eb['request'])['json'](),'abortController':_0x1853eb['abortController']};}['fetchConversationMessages'](_0x22628a){const _0x290a00=this['_sendApiRequest']('/conversations/'+_0x22628a+'/messages','GET');return{'getMessages':async()=>{const _0x19fb3c=await _0x290a00['request'];return(await _0x19fb3c['json']())['items'];},'abortController':_0x290a00['abortController']};}['uploadUrl'](_0x4e8a93,_0x113fe1,_0x11bf6f){const _0x1f0db7=this['_sendApiRequest']('/conversations/'+_0x4e8a93+'/web-resources','POST',{'url':_0x113fe1,'attributes':_0x11bf6f});return{'getId':async()=>(await _0x1f0db7['request'])['json'](),'abortController':_0x1f0db7['abortController']};}['getModels'](_0x54a483='en'){const _0x475a66=new URLSearchParams();_0x475a66['append']('language',_0x54a483);const _0x568273='/models/1?'+_0x475a66['toString'](),_0x4eaed9=this['_sendApiRequest'](_0x568273,'GET');return{'list':async()=>await(await _0x4eaed9['request'])['json'](),'abortController':_0x4eaed9['abortController']};}['deleteFile'](_0x9e3dd2,_0x2eccb9){const _0x3f6951=this['_sendApiRequest']('/conversations/'+_0x9e3dd2+'/files/'+_0x2eccb9,'DELETE');return{'execute':async()=>{await _0x3f6951['request'];},'abortController':_0x3f6951['abortController']};}['deleteDocument'](_0x59d66b,_0x24c018){const _0x3b7719=this['_sendApiRequest']('/conversations/'+_0x59d66b+'/documents/'+_0x24c018,'DELETE');return{'execute':async()=>{await _0x3b7719['request'];},'abortController':_0x3b7719['abortController']};}['deleteWebResource'](_0x5b8421,_0x550549){const _0x516278=this['_sendApiRequest']('/conversations/'+_0x5b8421+'/web-resources/'+_0x550549,'DELETE');return{'execute':async()=>{await _0x516278['request'];},'abortController':_0x516278['abortController']};}['callSystemReview']({reviewName:_0x2e0835,content:_0x53bdab,args:_0x40ee0f}){const _0x3596c2=this['_sendApiRequest']('/reviews/system/'+_0x2e0835+'/calls','POST',{'content':[{'type':'text','content':_0x53bdab}],'args':_0x40ee0f});return{'getStream':async()=>{const _0x386458=(await _0x3596c2['request'])['body'];return this['_getStreamReader'](_0x386458);},'abortController':_0x3596c2['abortController']};}['callCustomReview']({content:_0x59064c,prompt:_0x449370,model:_0x5a5bd3}){const _0x239a0b=this['_sendApiRequest']('/reviews/custom/calls','POST',{'content':[{'type':'text','content':_0x59064c}],'prompt':_0x449370,'model':_0x5a5bd3});return{'getStream':async()=>{const _0x228d83=(await _0x239a0b['request'])['body'];return this['_getStreamReader'](_0x228d83);},'abortController':_0x239a0b['abortController']};}['upsertAIChatRating'](_0x5f41df,_0x30c748,_0x4deaa6){const _0x3d4c59=this['_sendApiRequest']('/conversations/'+_0x5f41df+'/messages/'+_0x30c748+'/ratings','PUT',{'positiveCount':_0x4deaa6['positiveCount'],'totalCount':_0x4deaa6['totalCount'],'modificationId':_0x4deaa6['modificationId']});return{'execute':async()=>{await _0x3d4c59['request'];},'abortController':_0x3d4c59['abortController']};}['upsertAIActionRating'](_0x5d76e8,_0x47ac3f,_0x32bf7b){const _0x50d937=this['_sendApiRequest']('/actions/system/'+_0x5d76e8+'/calls/'+_0x47ac3f+'/ratings','PUT',{'positiveCount':_0x32bf7b['positiveCount'],'totalCount':_0x32bf7b['totalCount']});return{'execute':async()=>{await _0x50d937['request'];},'abortController':_0x50d937['abortController']};}['upsertCustomAIActionRating'](_0x1576fd,_0x25b7c0){const _0x28f21a=this['_sendApiRequest']('/actions/custom/calls/'+_0x1576fd+'/ratings','PUT',{'positiveCount':_0x25b7c0['positiveCount'],'totalCount':_0x25b7c0['totalCount']});return{'execute':async()=>{await _0x28f21a['request'];},'abortController':_0x28f21a['abortController']};}['upsertAIReviewRating'](_0x454eb2,_0x173bb7,_0x5a0adb,_0x2962cc){const _0xc90dae=this['_sendApiRequest']('/reviews/system/'+_0x454eb2+'/calls/'+_0x173bb7+'/ratings','PUT',{'positiveCount':_0x5a0adb['positiveCount'],'totalCount':_0x5a0adb['totalCount'],'dataId':_0x2962cc});return{'execute':async()=>{await _0xc90dae['request'];},'abortController':_0xc90dae['abortController']};}['upsertCustomAIReviewRating'](_0x412c53,_0x1f770a,_0x22644b){const _0x4b99aa=this['_sendApiRequest']('/reviews/custom/calls/'+_0x412c53+'/ratings','PUT',{'positiveCount':_0x1f770a['positiveCount'],'totalCount':_0x1f770a['totalCount'],'dataId':_0x22644b});return{'execute':async()=>{await _0x4b99aa['request'];},'abortController':_0x4b99aa['abortController']};}['_sendApiRequest'](_0x3725b2,_0x1446af,_0x2c50a6){const _0x3727cf=new AbortController(),_0x4b2dc3=_0x2c50a6 instanceof FormData,_0x53ccf7={'Authorization':'Bearer\x20'+this['_token']?.['value']};_0x2c50a6&&!_0x4b2dc3&&(_0x53ccf7['Content-Type']='application/json');const _0x20043f={'method':_0x1446af,'headers':_0x53ccf7,'signal':_0x3727cf['signal']};return _0x2c50a6&&(_0x20043f['body']=_0x4b2dc3?_0x2c50a6:JSON['stringify'](_0x2c50a6)),{'request':fetch(''+this['_apiUrl']+_0x3725b2,_0x20043f)['catch'](_0x245fb0=>{this['_handleError'](_0x245fb0);})['then'](_0x410830=>_0x410830['ok']?_0x410830:_0x410830['json']()['then'](_0x44df28=>{throw{'url':this['_apiUrl'],'path':_0x3725b2,'method':_0x1446af,'body':_0x2c50a6,'status':(_0x410830||{})['status'],'statusText':(_0x410830||{})['statusText'],'code':_0x44df28['code'],'message':_0x44df28['message'],'traceId':_0x44df28['traceId']};})),'abortController':_0x3727cf};}async*['_getStreamReader'](_0x511ad5){const _0x5e4926=[],_0x7db9e5=_0x511ad5['getReader'](),_0x539352=$t({'onError':_0x8dead8=>{this['_handleError'](_0x8dead8);},'onEvent':_0x4c6461=>{_0x4c6461['data']=JSON['parse'](_0x4c6461['data']),_0x5e4926['push'](_0x4c6461);}});try{let _0x2ce9c1=!0x1;for(;!_0x2ce9c1;){const {done:_0x3fe108,value:_0x41eb87}=await _0x7db9e5['read']();_0x3fe108&&(_0x2ce9c1=!0x0),_0x539352['feed'](this['_decoder']['decode'](_0x41eb87,{'stream':!0x0})),yield*_0x5e4926,_0x5e4926['length']=0x0;}}catch(_0x3a5e80){this['_handleError'](_0x3a5e80);}finally{_0x7db9e5['releaseLock'](),_0x539352['reset']();}}['_handleError'](_0x5cb1fd){if(_0x5cb1fd instanceof _0x25e143)throw _0x5cb1fd;if(_0x5cb1fd instanceof Error&&'AbortError'===_0x5cb1fd['name'])throw new _0x25e143('ai-request-aborted',this,{'originalError':_0x5cb1fd});throw new _0x25e143('ai-request-failed',this,{'originalError':_0x5cb1fd});}}function i(_0x20728b,_0x494a7f,_0x160b1f){const t=_0x20728b['t'];switch(_0x494a7f){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'},_0x160b1f);case'AI_SUGGESTION_CONTENT_PART_REJECTED':return t({'id':'AI_SUGGESTION_CONTENT_PART_REJECTED','string':'Change\x20was\x20rejected'});case'AI_SUGGESTION_CONTENT_PART_OUTDATED':return t({'id':'AI_SUGGESTION_CONTENT_PART_OUTDATED','string':'Change\x20is\x20outdated'});case'AI_SUGGESTION_CONTENT_PART_ALREADY_APPLIED':return t({'id':'AI_SUGGESTION_CONTENT_PART_ALREADY_APPLIED','string':'Change\x20is\x20already\x20applied'});case'AI_SUGGESTION_CONTENT_PART_SHOW_IN_THE_TEXT':return t({'id':'AI_SUGGESTION_CONTENT_PART_SHOW_IN_THE_TEXT','string':'Preview'});case'AI_SUGGESTION_CONTENT_PART_ADD_AS_SUGGESTION':return t({'id':'AI_SUGGESTION_CONTENT_PART_ADD_AS_SUGGESTION','string':'Insert\x20as\x20suggestion'});case'AI_SUGGESTION_CONTENT_PART_DELETE':return t({'id':'AI_SUGGESTION_CONTENT_PART_DELETE','string':'Reject'});case'AI_SUGGESTION_CONTENT_PART_REMOVED':return t({'id':'AI_SUGGESTION_CONTENT_PART_REMOVED','string':'Removed\x20content.\x20Use\x20\x22Show\x20details\x22\x20to\x20learn\x20more.'});case'AI_DISCLAIMER_TEXT':return t({'id':'AI_DISCLAIMER_TEXT','string':'AI\x20can\x20make\x20mistakes.\x20Please\x20double-check\x20responses.'});case'AI_TABS_LABEL_MAXIMIZE':return t({'id':'AI_TABS_LABEL_MAXIMIZE','string':'Maximize'});case'AI_TABS_LABEL_MINIMIZE':return t({'id':'AI_TABS_LABEL_MINIMIZE','string':'Minimize'});case'AI_CHAT_HEADING':return t({'id':'AI_CHAT_HEADING','string':'Chat'});case'AI_CHAT_SOURCES_HEADER':return t({'id':'AI_CHAT_SOURCES_HEADER','string':'Sources'});case'AI_CHAT_UNTITLED_CONVERSATION':return t({'id':'AI_CHAT_UNTITLED_CONVERSATION','string':'Untitled\x20conversation'});case'AI_CHAT_LABEL_NEW_CHAT':return t({'id':'AI_CHAT_LABEL_NEW_CHAT','string':'New\x20chat'});case'AI_CHAT_STOP_GENERATING':return t({'id':'AI_CHAT_STOP_GENERATING','string':'Stop\x20generating'});case'AI_CHAT_IS_WRITING':return t({'id':'AI_CHAT_IS_WRITING','string':'AI\x20is\x20writing...'});case'AI_CHAT_PROMPT_EMPTY_ERROR':return t({'id':'AI_CHAT_PROMPT_EMPTY_ERROR','string':'This\x20field\x20cannot\x20be\x20empty.'});case'AI_CHAT_LABEL_SUBMIT':return t({'id':'AI_CHAT_LABEL_SUBMIT','string':'Submit'});case'AI_CHAT_WELCOME_MESSAGE':return t({'id':'AI_CHAT_WELCOME_MESSAGE','string':'Hi,\x20I\x27m\x20your\x20AI\x20assistant.\x20Think\x20of\x20me\x20as\x20your\x20writing\x20buddy,\x20reviewer,\x20or\x20research\x20partner.\x20I\x20can\x20suggest\x20changes\x20to\x20your\x20document,\x20help\x20generate\x20ideas,\x20offer\x20feedback,\x20discuss\x20attached\x20files,\x20and\x20much\x20more!'});case'AI_CHAT_ABORTED_MESSAGE':return t({'id':'AI_CHAT_ABORTED_MESSAGE','string':'The\x20request\x20was\x20aborted.'});case'AI_CHAT_GENERIC_ERROR':return t({'id':'AI_CHAT_GENERIC_ERROR','string':'Something\x20went\x20wrong\x20while\x20processing\x20your\x20request.\x20Please\x20try\x20again.'});case'AI_CHAT_UNABLE_TO_START_CONVERSATION':return t({'id':'AI_CHAT_UNABLE_TO_START_CONVERSATION','string':'Unable\x20to\x20start\x20conversation.\x20Please\x20make\x20sure\x20you\x20are\x20online\x20and\x20try\x20again.'});case'AI_CHAT_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.'},_0x160b1f);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.'},_0x160b1f);case'AI_CHAT_RESOURCE_LOAD_FAILED':return t({'id':'AI_CHAT_RESOURCE_LOAD_FAILED','string':'Failed\x20to\x20load\x20resource.\x20Please\x20try\x20again.'});case'AI_CHAT_CONTEXT_CURRENT_DOCUMENT':return t({'id':'AI_CHAT_CONTEXT_CURRENT_DOCUMENT','string':'Current\x20document'});case'AI_CHAT_CONTEXT_REMOVE_FROM_CONTEXT':return t({'id':'AI_CHAT_CONTEXT_REMOVE_FROM_CONTEXT','string':'Remove\x20from\x20context'});case'AI_CHAT_CONTEXT_ADD_CONTEXT':return t({'id':'AI_CHAT_CONTEXT_ADD_CONTEXT','string':'Add\x20context'});case'AI_CHAT_CONTEXT_URL_LABEL':return t({'id':'AI_CHAT_CONTEXT_URL_LABEL','string':'URL'});case'AI_CHAT_CONTEXT_FILE_LABEL':return t({'id':'AI_CHAT_CONTEXT_FILE_LABEL','string':'File'});case'AI_CHAT_CONTEXT_CURRENT_CONTEXT_LABEL':return t({'id':'AI_CHAT_CONTEXT_CURRENT_CONTEXT_LABEL','string':'Current\x20context'});case'AI_CHAT_SEARCH_WEB':return t({'id':'AI_CHAT_SEARCH_WEB','string':'Web\x20search'});case'AI_CHAT_ENABLE_WEB_SEARCH':return t({'id':'AI_CHAT_ENABLE_WEB_SEARCH','string':'Enable\x20web\x20search'});case'AI_CHAT_DISABLE_WEB_SEARCH':return t({'id':'AI_CHAT_DISABLE_WEB_SEARCH','string':'Disable\x20web\x20search'});case'AI_CHAT_REASONING':return t({'id':'AI_CHAT_REASONING','string':'Reasoning'});case'AI_CHAT_ENABLE_REASONING':return t({'id':'AI_CHAT_ENABLE_REASONING','string':'Enable\x20reasoning'});case'AI_CHAT_DISABLE_REASONING':return t({'id':'AI_CHAT_DISABLE_REASONING','string':'Disable\x20reasoning'});case'AI_CHAT_COMMANDS':return t({'id':'AI_CHAT_COMMANDS','string':'Commands'});case'AI_CHAT_SEARCH_RESOURCES':return t({'id':'AI_CHAT_SEARCH_RESOURCES','string':'Search\x20resources'});case'AI_CHAT_CONTEXT_URL_BACK_TO_CONTEXT':return t({'id':'AI_CHAT_CONTEXT_URL_BACK_TO_CONTEXT','string':'Back\x20to\x20context\x20options'});case'AI_CHAT_CONTEXT_URL_ADD_URL':return t({'id':'AI_CHAT_CONTEXT_URL_ADD_URL','string':'Add\x20URL'});case'AI_CHAT_CONTEXT_URL_PLACEHOLDER':return t({'id':'AI_CHAT_CONTEXT_URL_PLACEHOLDER','string':'Add\x20URL...'});case'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_URL':return t({'id':'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_URL','string':'Failed\x20to\x20upload\x20URL:\x20%0.\x20Please\x20try\x20again.'},_0x160b1f);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_SHOW_CHANGE_IN_TEXT':return t({'id':'AI_CHAT_SUGGESTION_ACTION_SHOW_CHANGE_IN_TEXT','string':'Preview','plural':'Preview'},_0x160b1f);case'AI_CHAT_SUGGESTION_ACTION_SHOW_CHANGE_IN_TEXT_TOOLTIP':return t({'id':'AI_CHAT_SUGGESTION_ACTION_SHOW_CHANGE_IN_TEXT_TOOLTIP','string':'Show\x20change\x20in\x20the\x20document','plural':'Show\x20changes\x20in\x20the\x20document'},_0x160b1f);case'AI_CHAT_SUGGESTION_ACTION_INSERT_SUGGESTION':return t({'id':'AI_CHAT_SUGGESTION_ACTION_INSERT_SUGGESTION','string':'Suggest','plural':'Suggest'},_0x160b1f);case'AI_CHAT_SUGGESTION_ACTION_INSERT_SUGGESTION_TOOLTIP':return t({'id':'AI_CHAT_SUGGESTION_ACTION_INSERT_SUGGESTION_TOOLTIP','string':'Insert\x20change\x20as\x20suggestion','plural':'Insert\x20changes\x20as\x20suggestions'},_0x160b1f);case'AI_CHAT_SUGGESTION_ACTION_APPLY_LABEL':return t({'id':'AI_CHAT_SUGGESTION_ACTION_APPLY_LABEL','string':'Apply','plural':'Apply\x20all'},_0x160b1f);case'AI_CHAT_SUGGESTION_ACTION_APPLY_TOOLTIP':return t({'id':'AI_CHAT_SUGGESTION_ACTION_APPLY_TOOLTIP','string':'Apply\x20changes\x20immediately','plural':'Apply\x20all\x20changes\x20immediately'},_0x160b1f);case'AI_CHAT_SUGGESTION_MORE_OPTIONS_TOOLTIP':return t({'id':'AI_CHAT_SUGGESTION_MORE_OPTIONS_TOOLTIP','string':'More\x20options'},_0x160b1f);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.'},_0x160b1f);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.'},_0x160b1f);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.'},_0x160b1f);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.'},_0x160b1f);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'},_0x160b1f);case'AI_BALLOON_APPLY_BUTTON':return t({'id':'AI_BALLOON_APPLY_BUTTON','string':'Apply'});case'AI_BALLOON_SUGGEST_BUTTON':return t({'id':'AI_BALLOON_SUGGEST_BUTTON','string':'Suggest'});case'AI_BALLOON_NEXT_TOOLTIP':return t({'id':'AI_BALLOON_NEXT_TOOLTIP','string':'Next'});case'AI_BALLOON_PREVIOUS_TOOLTIP':return t({'id':'AI_BALLOON_PREVIOUS_TOOLTIP','string':'Previous'});case'AI_SUGGESTION_NO_PARTS_WARNING':return t({'id':'AI_SUGGESTION_NO_PARTS_WARNING','string':'This\x20change\x20is\x20not\x20supported\x20by\x20the\x20editor\x20and\x20can\x27t\x20be\x20previewed\x20or\x20applied.'});case'AI_SUGGESTION_EMPTY_PART_WARNING':return t({'id':'AI_SUGGESTION_EMPTY_PART_WARNING','string':'Some\x20of\x20the\x20changes\x20are\x20not\x20supported\x20by\x20the\x20editor\x20and\x20can\x27t\x20be\x20previewed\x20or\x20applied.'});case'AI_ACTIONS_TRY_AGAIN':return t({'id':'AI_ACTIONS_TRY_AGAIN','string':'Retry'});case'AI_ACTIONS_PREVIOUS_INTERACTION':return t({'id':'AI_ACTIONS_PREVIOUS_INTERACTION','string':'Previous'});case'AI_ACTIONS_NEXT_INTERACTION':return t({'id':'AI_ACTIONS_NEXT_INTERACTION','string':'Next'});case'AI_MODEL_NAME_AUTO':return t({'id':'AI_MODEL_NAME_AUTO','string':'Auto'});case'AI_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.'},_0x160b1f);case'AI_QUICK_ACTIONS_OTHER':return t({'id':'AI_QUICK_ACTIONS_OTHER','string':'Other'});case'AI_ACTIONS_GENERIC_ERROR':return t({'id':'AI_ACTIONS_GENERIC_ERROR','string':'Sorry,\x20we\x20couldn\x27t\x20generate\x20the\x20response.\x20Please\x20try\x20again\x20in\x20a\x20moment.'});case'AI_ACTIONS_SELECTION_REMOVED_ERROR':return t({'id':'AI_ACTIONS_SELECTION_REMOVED_ERROR','string':'Changes\x20cannot\x20be\x20applied.\x20The\x20original\x20content\x20no\x20longer\x20exists.'});case'AI_REVIEW_MODE_STOP_GENERATING':return t({'id':'AI_REVIEW_MODE_STOP_GENERATING','string':'Stop\x20generating'});case'AI_REVIEW_MODE_HIDE_CHANGES':return t({'id':'AI_REVIEW_MODE_HIDE_CHANGES','string':'Hide\x20changes'});case'AI_REVIEW_MODE_SHOW_CHANGES':return t({'id':'AI_REVIEW_MODE_SHOW_CHANGES','string':'Show\x20changes'});case'AI_REVIEW_MODE_ACCEPT_ALL':return t({'id':'AI_REVIEW_MODE_ACCEPT_ALL','string':'Accept\x20all'});case'AI_REVIEW_MODE_EXIT_REVIEW':return t({'id':'AI_REVIEW_MODE_EXIT_REVIEW','string':'Exit\x20review'});case'AI_REVIEW_MODE_ACCEPT_CHANGE':return t({'id':'AI_REVIEW_MODE_ACCEPT_CHANGE','string':'Accept'});case'AI_REVIEW_MODE_DISMISS_CHANGE':return t({'id':'AI_REVIEW_MODE_DISMISS_CHANGE','string':'Dismiss'});case'AI_REVIEW_MODE_LEARN_MORE':return t({'id':'AI_REVIEW_MODE_LEARN_MORE','string':'Learn\x20more'});case'AI_REVIEW_MODE_COMPLETED_TEXT':return t({'id':'AI_REVIEW_MODE_COMPLETED_TEXT','string':'There\x27s\x20nothing\x20left\x20to\x20review.'});case'AI_REVIEW_MODE_EMPTY_RESULTS_TEXT':return t({'id':'AI_REVIEW_MODE_EMPTY_RESULTS_TEXT','string':'There\x20are\x20no\x20changes\x20to\x20suggest.'});case'AI_REVIEW_MODE_FINISH_REVIEW_BUTTON_LABEL':return t({'id':'AI_REVIEW_MODE_FINISH_REVIEW_BUTTON_LABEL','string':'Finish\x20Review'});case'AI_REVIEW_MODE_FINISH_REVIEW_HEADER_TITLE':return t({'id':'AI_REVIEW_MODE_FINISH_REVIEW_HEADER_TITLE','string':'Review\x20complete.\x20Finish\x20when\x20ready.'});case'AI_REVIEW_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'});default:return _0x494a7f;}}function ks(_0x309faa,_0x14a75b){const _0x1be5bc=new _0x5cf211(_0x309faa),_0x24404d=i(_0x309faa,'AI_TABS_LABEL_MINIMIZE'),_0x5baee4=i(_0x309faa,'AI_TABS_LABEL_MAXIMIZE');return _0x1be5bc['set']({'withText':!0x1,'icon':_0x47b8ff,'tooltip':!0x0,'class':'ck-ai-tabs__resize\x20ck-ai-button-tertiary-text'}),_0x1be5bc['bind']('label')['to'](_0x14a75b,'isMaximized',_0x32e043=>_0x32e043?_0x24404d:_0x5baee4),_0x1be5bc['bind']('icon')['to'](_0x14a75b,'isMaximized',_0x40a845=>_0x40a845?to:_0x47b8ff),_0x1be5bc['bind']('isOn')['to'](_0x14a75b,'isMaximized'),_0x1be5bc['on']('execute',()=>{_0x14a75b['fire']('resizeTabs');}),_0x1be5bc;}function He(_0x43b0cc){return _0x344289(_0x43b0cc);}function Ot(_0x209af5){return _0x3ae693(_0x209af5);}function Dt(_0x462bf5,_0x1ca036,_0x30b0bd){const _0x10ee84=null!==_0x1ca036?_0x1a3c8a=>_0x1a3c8a['attribs'][_0x462bf5]===_0x1ca036:_0x5638da=>Boolean(_0x5638da['attribs'][_0x462bf5]);return St(_0x488309=>_0x1817c0(_0x488309)&&_0x10ee84(_0x488309),_0x30b0bd);}function Ze(_0x184362,_0x5048a7,_0x55aa28){const _0x58bc85=null!==_0x5048a7?_0x469037=>_0x469037['attribs'][_0x184362]===_0x5048a7:_0x2d9720=>Boolean(_0x2d9720['attribs'][_0x184362]);return _0x8c497d(_0x3ba970=>_0x1817c0(_0x3ba970)&&_0x58bc85(_0x3ba970),_0x55aa28);}function vt(_0x20cafd,_0x343bb1){return _0x20cafd&&_0x1817c0(_0x20cafd)?_0x20cafd['attribs'][_0x343bb1]:null;}function Ji(_0x449aac,_0x52306d,_0x31d222){_0x1817c0(_0x449aac)&&(null===_0x31d222?delete _0x449aac['attribs'][_0x52306d]:_0x449aac['attribs'][_0x52306d]=_0x31d222);}function Wi(_0x98dde9,_0x211475,_0x4291a9){const _0x21275d=_0x211475['cloneNode'](!0x0);'beforebegin'===_0x4291a9?_0x5f0e2c(_0x98dde9,_0x21275d):'afterbegin'===_0x4291a9?_0x877764(_0x98dde9,_0x21275d):'beforeend'===_0x4291a9?_0x2fc5f7(_0x98dde9,_0x21275d):'afterend'===_0x4291a9&&_0x41729d(_0x98dde9,_0x21275d);}function qe(_0x3f00e6){const _0x1f7152=[];let _0x1430c1=_0x3f00e6;for(;_0x1430c1;)_0x1430c1=_0x22264a(_0x1430c1),_0x1430c1&&_0x1f7152['push'](_0x1430c1);return _0x1f7152;}function zn(_0x3af1bc){return _0x3af1bc['replace'](/^\s+/gm,'')['replace'](/\s+$/gm,'')['replace'](/\n*/g,'')['replace'](/\s+/g,'\x20')['replace'](/>\s*</g,'><');}function Xi(_0x584913){let _0x471dfa=0x0;for(;_0x584913['parentNode'];)_0x584913=_0x584913['parentNode'],_0x471dfa++;return _0x471dfa;}function $i(_0x2de2a5){const _0x2c6f2c=[];let _0x503df0=_0x2de2a5['nextSibling'];for(;_0x503df0;)_0x2c6f2c['push'](_0x503df0),_0x503df0=_0x503df0['nextSibling'];_0x2c6f2c['forEach'](_0x54e2d9=>{_0x14435b(_0x54e2d9);});}class Ke extends/* #__PURE__ -- @preserve */
|
|
25
|
+
ts(){['_m2html'];constructor(){super(),this['_m2html']=new _0x5d6259();}['convertMarkdownToHTML'](_0x724323){const _0x448e75=this['_m2html']['parse'](_0x724323);return this['parseAndNormalizeHTML'](_0x448e75);}['parseAndNormalizeHTML'](_0x5ca98d){return this['_parseHTML'](_0x5ca98d);}['_parseHTML'](_0x2c798c){const _0x51bd10=He('<dummy>'+_0x2c798c['replace'](/^\t+/gm,'\x20')['replace'](/\n*/g,'')['replace'](/\s+/g,'\x20')['replace'](/<[^>]*?$/g,'')+'</dummy>');return _0x51bd10['children']=_0x51bd10['children'][0x0]['children'],_0x51bd10;}}class Qe extends/* #__PURE__ -- @preserve */
|
|
26
|
+
ts(){['_generateUid'];['_touchedNodesState']={'newIds':[],'modifiedIds':[],'removedIds':[],'invalidIds':[],'lastTouchedId':null};['_existingDataIds']=new Set();constructor(_0xfb3134){super(),this['_generateUid']=_0xfb3134||_0x23a3b0;}['merge'](_0x27ceed,_0x30b376,_0x4cae0d){const _0x1961bc=_0x27ceed['cloneNode'](!0x0);if(0x0===_0x30b376['childNodes']['length']){const _0x3fe846=[];return Ze('data-id','new-element',_0x1961bc)['forEach'](_0x1a1904=>{const _0xfe2260=this['_generateUid']();Ji(_0x1a1904,'data-id',_0xfe2260),_0x3fe846['push'](_0xfe2260);}),this['_removeSpecialComments'](_0x1961bc),{'parsedContent':_0x1961bc,'newNodeIds':_0x3fe846,'modifiedNodeIds':[],'removedNodeIds':[]};}_0x4cae0d&&_0x4cae0d['markUnstableElements']&&this['_markLastTagElementUnstable'](_0x1961bc),this['_touchedNodesState']['newIds']=[],this['_touchedNodesState']['modifiedIds']=[],this['_touchedNodesState']['removedIds']=[],this['_touchedNodesState']['invalidIds']=[],this['_touchedNodesState']['lastTouchedId']=null,this['_existingDataIds']=new Set(Ze('data-id',null,_0x30b376)['map'](_0x141cd8=>vt(_0x141cd8,'data-id'))['filter'](_0x44e134=>!!_0x44e134));let _0x3f797c=-0x1,_0x3909a3=!0x1;const _0x1ac955=_0x1961bc['childNodes'],_0x522b54=Array['from'](_0x1ac955)['filter'](_0xea2f06=>!(0x3===_0xea2f06['nodeType']&&''===Ot(_0xea2f06)['trim']())),_0x32f8da=_0x522b54['length'];for(let _0x3e8891=0x0;_0x3e8891<_0x32f8da;_0x3e8891++){const _0x175685=_0x522b54[_0x3e8891],_0x5a6b2d=_0x522b54[_0x3e8891+0x1];if(this['_isNewNode'](_0x175685)){if(-0x1===_0x3f797c&&(_0x3f797c=_0x3e8891),this['_markWrappedElements'](_0x175685),!this['_isNewNode'](_0x5a6b2d)){const [_0x1d461f,_0x1ae8c8]=this['_findReferenceNode'](_0x175685,_0x3909a3,_0x30b376);if(_0x1d461f){const _0x8167a=Array['from'](_0x522b54)['slice'](_0x3f797c,_0x3e8891+0x1);this['_insertNodes'](_0x1d461f,_0x8167a,_0x1ae8c8),_0x3f797c=-0x1;}}}else{if(this['_isExistingContentComment'](_0x175685))_0x3909a3=!0x0;else{if(this['_isExistingNode'](_0x175685)){const _0x2f88a3=vt(_0x175685,'data-id');if(_0x2f88a3&&this['_existingDataIds']['has'](_0x2f88a3)){const _0x250d43=Dt('data-id',_0x2f88a3,_0x30b376);this['_replaceNode'](_0x250d43,_0x175685);}if(this['_touchedNodesState']['removedIds']['includes'](_0x2f88a3)){const _0x543f5a=this['_touchedNodesState']['removedIds']['indexOf'](_0x2f88a3);this['_touchedNodesState']['removedIds']['splice'](_0x543f5a,0x1);}}else{if(this['_isDelNode'](_0x175685)){const _0x12cab5=vt(_0x175685,'data-id');this['_touchedNodesState']['modifiedIds']['includes'](_0x12cab5)||this['_storeDeletedElementIds'](_0x175685);}}}}}for(const _0x3aef17 of this['_touchedNodesState']['removedIds']){const _0x21d334=Dt('data-id',_0x3aef17,_0x30b376);if(_0x21d334){if(_0x4cae0d&&_0x4cae0d['replaceRemovedWith']){this['_touchedNodesState']['lastTouchedId']=_0x3aef17;const _0x3b26b6=_0x4cae0d['replaceRemovedWith']['cloneNode'](!0x0);Ji(_0x3b26b6,'data-id',_0x3aef17),Ji(_0x3b26b6,'data-removed','true'),_0x334b78(_0x21d334,_0x3b26b6);}else _0x14435b(_0x21d334);}}if(Ze('data-wrapped-id',null,_0x30b376)['forEach'](_0x1d5855=>{const _0x29222d=Dt('data-id',vt(_0x1d5855,'data-wrapped-id'),_0x30b376);var _0x164854,_0xb1803e;_0x29222d&&(_0xb1803e=_0x1d5855,_0x14435b(_0x164854=_0x29222d),_0x334b78(_0xb1803e,_0x164854));}),Ze('data-id','new-element',_0x30b376)['forEach'](_0x23a9b1=>{const _0x33dc30=this['_getUid'](_0x23a9b1);Ji(_0x23a9b1,'data-id',_0x33dc30),this['_touchedNodesState']['newIds']['push'](_0x33dc30);}),this['_removeSpecialComments'](_0x30b376),_0x4cae0d&&_0x4cae0d['markUnstableElements']&&this['_markUnstableElements'](_0x30b376,_0x4cae0d['markUnstableElementsDepth']||0x0),_0x4cae0d&&_0x4cae0d['cutAfterLastChange']&&this['_touchedNodesState']['lastTouchedId']){let _0x2a92ba=Dt('data-id',this['_touchedNodesState']['lastTouchedId'],_0x30b376);for(;_0x2a92ba;)$i(_0x2a92ba),_0x2a92ba=_0x2a92ba['parentNode'];}return{'parsedContent':_0x30b376,'newNodeIds':this['_touchedNodesState']['newIds'],'modifiedNodeIds':this['_touchedNodesState']['modifiedIds'],'removedNodeIds':this['_touchedNodesState']['removedIds']};}['_insertNodes'](_0x187ca5,_0x241134,_0x2e39dd){for(const _0x254698 of _0x241134){const _0x118453=this['_getUid'](_0x254698);Ji(_0x254698,'data-id',_0x118453),this['_touchedNodesState']['newIds']['push'](_0x118453),this['_touchedNodesState']['lastTouchedId']=_0x118453;}const _0x4dd4f0='afterbegin'===_0x2e39dd||'afterend'===_0x2e39dd?_0x241134['reverse']():_0x241134;for(const _0x20355f of _0x4dd4f0)Wi(_0x187ca5,_0x20355f,_0x2e39dd);}['_replaceNode'](_0x52a7d1,_0x4dc8ef){if(!_0x52a7d1)return;if(_0x3aa194=_0x4dc8ef,zn(Ot(_0x52a7d1))===zn(Ot(_0x3aa194)))return;var _0x3aa194;const _0x21afdd=this['_getUid'](_0x52a7d1);Ji(_0x4dc8ef,'data-id',_0x21afdd),this['_touchedNodesState']['modifiedIds']['push'](_0x21afdd),this['_touchedNodesState']['lastTouchedId']=_0x21afdd,_0x334b78(_0x52a7d1,_0x4dc8ef['cloneNode'](!0x0));}['_findReferenceNode'](_0x5ca3a2,_0x3022c5,_0x35c4d9){const _0x57280b=this['_findPrevElementWithDataId'](_0x5ca3a2,!0x1);if(_0x57280b){const _0x11d0f8=this['_getNodeDataId'](_0x57280b),_0x5ba76c=Dt('data-id',_0x11d0f8,_0x35c4d9);if(_0x5ba76c)return[_0x5ba76c,'afterend'];this['_touchedNodesState']['invalidIds']['push'](_0x11d0f8);}const _0x563e4d=this['_findNextElementWithDataId'](_0x5ca3a2,!0x1);if(_0x563e4d){const _0x56a929=this['_getNodeDataId'](_0x563e4d),_0x46b89a=Dt('data-id',_0x56a929,_0x35c4d9);if(_0x46b89a)return[_0x46b89a,'beforebegin'];this['_touchedNodesState']['invalidIds']['push'](_0x56a929);}return _0x3022c5?_0x5ca3a2['nextSibling']?this['_findFallbackReferenceNode'](_0x5ca3a2,_0x35c4d9):[_0x35c4d9['childNodes'][_0x35c4d9['childNodes']['length']-0x1],'afterend']:[_0x35c4d9['childNodes'][0x0],'beforebegin'];}['_findFallbackReferenceNode'](_0x2d4a37,_0x322e6b){const _0x1ae4c8=[],_0x10a69a=this['_findPrevElementWithDataId'](_0x2d4a37,!0x0);if(_0x10a69a){const _0x1ab10a=Dt('data-id',this['_getNodeDataId'](_0x10a69a),_0x322e6b);_0x1ab10a&&_0x1ae4c8['push']([_0x1ab10a,'afterend']);}const _0x41484f=this['_findNextElementWithDataId'](_0x2d4a37,!0x0);if(_0x41484f){const _0x43de4e=Dt('data-id',this['_getNodeDataId'](_0x41484f),_0x322e6b);_0x43de4e&&_0x1ae4c8['push']([_0x43de4e,'beforebegin']);}if(_0x1ae4c8['length']>0x1)return Xi(_0x1ae4c8[0x0][0x0])<=Xi(_0x1ae4c8[0x1][0x0])?_0x1ae4c8[0x0]:_0x1ae4c8[0x1];return 0x1===_0x1ae4c8['length']?_0x1ae4c8[0x0]:[_0x322e6b['lastChild'],'afterend'];}['_findNextElementWithDataId'](_0x13457b,_0x3e4d0a){let _0x54fc10=_0x13457b['nextSibling'],_0x4efe7f=null,_0x3c43c2=!0x1;for(;_0x54fc10;){if(_0x4ac076(_0x54fc10)){if(this['_isDelNode'](_0x54fc10)&&(_0x4efe7f=_0x54fc10),this['_isExistingContentComment'](_0x54fc10)&&_0x3e4d0a&&!_0x3c43c2){_0x3c43c2=!0x0,_0x54fc10=_0x54fc10['nextSibling'];continue;}break;}const _0x156a87=vt(_0x54fc10,'data-id');if(_0x156a87&&'new-element'!==_0x156a87&&this['_existingDataIds']['has'](_0x156a87)){_0x4efe7f=_0x54fc10;break;}_0x54fc10=_0x54fc10['nextSibling'];}return _0x4efe7f;}['_findPrevElementWithDataId'](_0x249ff0,_0x2dd247){let _0x30ea53=_0x249ff0['previousSibling'],_0x25ed4d=null,_0xeb0dd7=!0x1;for(;_0x30ea53;){if(_0x4ac076(_0x30ea53)){if(this['_isDelNode'](_0x30ea53)&&(_0x25ed4d=_0x30ea53),this['_isExistingContentComment'](_0x30ea53)&&_0x2dd247&&!_0xeb0dd7){_0xeb0dd7=!0x0,_0x30ea53=_0x30ea53['previousSibling'];continue;}break;}const _0x1b8ca4=vt(_0x30ea53,'data-id');if(_0x1b8ca4&&'new-element'!==_0x1b8ca4&&this['_existingDataIds']['has'](_0x1b8ca4)){_0x25ed4d=_0x30ea53;break;}_0x30ea53=_0x30ea53['previousSibling'];}return _0x25ed4d;}['_markWrappedElements'](_0x5a1994){_0x1817c0(_0x5a1994)&&Ze('data-id',null,_0x5a1994)['forEach'](_0x7ef030=>{this['_isExistingNode'](_0x7ef030)&&!this['_hasWrappedParent'](_0x7ef030)&&(Ji(_0x7ef030,'data-wrapped-id',vt(_0x7ef030,'data-id')),Ji(_0x7ef030,'data-id',null));});}['_getNodeDataId'](_0x1a2181){if(!_0x1a2181)return null;if(_0x1817c0(_0x1a2181))return vt(_0x1a2181,'data-id');if(_0x4ac076(_0x1a2181)){const _0x4d3dd4=Ot(_0x1a2181)['match'](/removed[\s*-]data-id="([^"]+)"/);if(_0x4d3dd4&&_0x4d3dd4[0x1])return _0x4d3dd4[0x1];}return null;}['_storeDeletedElementIds'](_0x4567d3){if(_0x4ac076(_0x4567d3)){const _0x78da0e=Ot(_0x4567d3)['match'](/removed[\s*-]data-id="([^"]+)"/);_0x78da0e&&_0x78da0e[0x1]&&this['_touchedNodesState']['removedIds']['push'](_0x78da0e[0x1]);}}['_getUid'](_0x491803){return this['_isExistingNode'](_0x491803)?vt(_0x491803,'data-id'):this['_generateUid']();}['_removeSpecialComments'](_0x349d0f){(function(_0x38f09d){return _0x5b20dc(_0x4a0284=>_0x4ac076(_0x4a0284),_0x38f09d,!0x0,0x1/0x0);}(_0x349d0f)['filter'](_0x21d604=>this['_isDelNode'](_0x21d604)||this['_isExistingContentComment'](_0x21d604))['forEach'](_0x273aee=>{_0x14435b(_0x273aee);}));}['_markLastTagElementUnstable'](_0x33ae3f){const _0x52cb09=_0x33ae3f['childNodes'],_0x364a41=_0x52cb09[_0x52cb09['length']-0x1];_0x364a41&&_0x1817c0(_0x364a41)&&Ji(_0x364a41,'data-unstable','true');}['_markUnstableElements'](_0x4309e6,_0x36fa60){const _0x3d6523=Dt('data-unstable','true',_0x4309e6);if(!_0x3d6523)return;const _0x3b42dc=qe(_0x3d6523)['slice'](0x0,-0x1),_0x3cf769=_0x3b42dc['length'];let _0x100020=_0x3d6523;if(_0x3cf769>_0x36fa60){let _0x39c033=_0x3cf769,_0x545581=null;for(;_0x39c033>_0x36fa60&&_0x39c033>=0x0;)_0x39c033--,_0x545581=_0x3b42dc[_0x39c033];_0x545581&&(_0x100020=_0x545581,Ji(_0x3d6523,'data-unstable',null),Ji(_0x545581,'data-unstable','true'));}else{if(_0x3cf769<_0x36fa60){let _0x5c4c2a=_0x3cf769,_0x1d7b34=_0x3d6523;for(;_0x5c4c2a<_0x36fa60;){const _0x40ff8a=_0x1d7b34['childNodes']['filter'](_0x2f8d51=>_0x1817c0(_0x2f8d51));if(0x0===_0x40ff8a['length'])break;_0x5c4c2a++,_0x1d7b34=_0x40ff8a[_0x40ff8a['length']-0x1];}_0x1d7b34&&(_0x100020=_0x1d7b34,Ji(_0x3d6523,'data-unstable',null),Ji(_0x1d7b34,'data-unstable','true'));}}let _0x31aea5=_0x100020;for(;_0x31aea5;){for(;_0x31aea5['nextSibling'];)_0x31aea5=_0x31aea5['nextSibling'],_0x1817c0(_0x31aea5)&&Ji(_0x31aea5,'data-unstable','true');_0x31aea5=_0x31aea5['parentNode'];}}['_isNewNode'](_0x4ffbdf){return Boolean('new-element'===vt(_0x4ffbdf,'data-id'));}['_isExistingNode'](_0x19e409){return Boolean((vt(_0x19e409,'data-id')||'')['length']>0x0&&'new-element'!==vt(_0x19e409,'data-id'));}['_isDelNode'](_0x517778){return!!_0x517778&&Boolean(_0x4ac076(_0x517778)&&Ot(_0x517778)['match'](/removed[\s*-]data-id="[^"]+"/));}['_hasWrappedParent'](_0x206bed){let _0x5f2301=_0x206bed['parentNode'];for(;_0x5f2301;){if(vt(_0x5f2301,'data-wrapped-id'))return!0x0;_0x5f2301=_0x5f2301['parentNode'];}return!0x1;}['_isExistingContentComment'](_0xc98478){return Boolean(_0x4ac076(_0xc98478)&&Ot(_0xc98478)['match'](/\s*existing[\s*-](content|document)\s*/g));}}function nt({editor:_0x535f09,changeGroups:_0x260d19,documentContextContent:_0x1888ce,showDiff:_0x2842e3,trimUnchanged:_0x185741=!0x0}){return _0x260d19['map'](_0x42f851=>{const _0x3fc531=new Rt([]),_0x46eff2=new Rt([]);for(const _0x42d015 of _0x42f851['changes'])if(_0x2842e3&&'removed'==_0x42d015['type']||_0x46eff2['children']['push'](_0x42d015['node']['cloneNode'](!0x0)),'new'!=_0x42d015['type']&&(_0x2842e3||'removed'!=_0x42d015['type'])){const _0x4aa1e7=St(_0x2207a6=>vt(_0x2207a6,'data-id')==_0x42d015['id'],_0x1888ce,!0x0);_0x4aa1e7&&_0x3fc531['children']['push'](_0x4aa1e7['cloneNode'](!0x0));}const {content:_0x528eb1,hasChanges:_0x3a4a01}=function(_0x3646d8,_0x40d65f,_0x1a425f,_0x42195b,_0x28e5fa=!0x0){const _0x3d9c0b=_0x3646d8['plugins']['get']('DocumentCompare'),_0x354cc5=Ot(_0x40d65f),_0x57a0bc=Ot(_0x1a425f),_0x2e8c3a=_0x3646d8['data']['parse'](_0x354cc5,'$root'),_0x1a2428=_0x3646d8['model']['createPositionAt'](_0x2e8c3a,0x0),_0x4ab96b=_0x3d9c0b['getDiff'](_0x354cc5,_0x57a0bc,{'anchor':_0x1a2428,'markDeletions':_0x42195b}),_0x437639=_0x4ab96b['getOperations']();if(0x0==_0x437639['length'])return{'content':_0x40d65f['cloneNode'](!0x0),'hasChanges':!0x1};_0x42195b?function(_0x5bbf5,_0x4278ce,_0x5c61e4){if(0x0==_0x5bbf5['length'])return;const _0x5842c8=_0x5c61e4['plugins']['get']('DocumentCompare'),_0x4bb33f=_0x5c61e4['plugins']['get']('SuggestionsConversion');_0x5c61e4['model']['change'](_0x1d4620=>{const _0x1b5a6c=new Set();for(let _0x32fd4a=0x0;_0x32fd4a<_0x5bbf5['length'];_0x32fd4a++){const _0x410ac8=_0x5bbf5[_0x32fd4a];if(_0x410ac8['baseVersion']=null,_0x410ac8['isDocumentOperation']=!0x1,_0x5842c8['isMarkedRemoveOperation'](_0x410ac8)){const _0x34b3d3=_0x1f960a(_0x410ac8['newRange'],_0x5c61e4['model']),_0x3c7488='suggestion:deletion:'+_0x23a3b0()+':$aiSuggestion';_0x4278ce['markers']['set'](_0x3c7488,_0x34b3d3);}else switch(_0x410ac8['type']){case'rename':{if(_0x410ac8['oldName']==_0x410ac8['newName'])break;_0x1d4620['batch']['addOperation'](_0x410ac8),_0x5c61e4['model']['applyOperation'](_0x410ac8);const _0xa2f28d='$elementName',_0x3b9f65=_0x410ac8['position'],_0x115f9f=_0x5c61e4['model']['createRange'](_0x3b9f65,_0x5c61e4['model']['createPositionAt'](_0x3b9f65['nodeAfter'],'end')),_0x1d5ac3='suggestion:attribute:'+_0xa2f28d+':'+_0x23a3b0()+':$aiSuggestion';_0x4278ce['markers']['set'](_0x1d5ac3,_0x115f9f);break;}case'addAttribute':case'removeAttribute':case'changeAttribute':{if(_0x410ac8['oldValue']==_0x410ac8['newValue'])break;_0x1d4620['batch']['addOperation'](_0x410ac8),_0x5c61e4['model']['applyOperation'](_0x410ac8);const _0x1ac804=_0x410ac8['key'];if(!_0x4bb33f['isRegisteredAttribute'](_0x1ac804))break;const _0x1cb5a3=_0x1f960a(_0x410ac8['range'],_0x5c61e4['model']),_0x3f7620='suggestion:attribute:'+_0x1ac804+':'+_0x23a3b0()+':$aiSuggestion';_0x4278ce['markers']['set'](_0x3f7620,_0x1cb5a3);break;}case'insert':{_0x1d4620['batch']['addOperation'](_0x410ac8),_0x5c61e4['model']['applyOperation'](_0x410ac8);if(_0x5bbf5[_0x32fd4a+0x1]&&'move'==_0x5bbf5[_0x32fd4a+0x1]['type']){ro(_0x4278ce,_0x410ac8);break;}const _0x5304aa=_0x410ac8['position'],_0x12e4e8=_0x410ac8['howMany'],_0x12a6dd=_0x1f960a(_0x5c61e4['model']['createRange'](_0x5304aa,_0x5304aa['getShiftedBy'](_0x12e4e8)),_0x5c61e4['model']),_0x3bea4d='suggestion:insertion:'+_0x23a3b0()+':$aiSuggestion';_0x4278ce['markers']['set'](_0x3bea4d,_0x12a6dd);break;}case'split':{_0x1d4620['batch']['addOperation'](_0x410ac8),_0x5c61e4['model']['applyOperation'](_0x410ac8);const _0x5bf93d=_0x410ac8['splitPosition'],_0xb50980=_0x410ac8['moveTargetPosition'],_0x5cf1b9=_0x5c61e4['model']['createRange'](_0x5bf93d,_0xb50980),_0x3ad80a='suggestion:insertion:'+_0x23a3b0()+':$aiSuggestion';_0x4278ce['markers']['set'](_0x3ad80a,_0x5cf1b9);break;}case'move':{_0x1d4620['batch']['addOperation'](_0x410ac8),_0x5c61e4['model']['applyOperation'](_0x410ac8),_0x5bbf5[_0x32fd4a-0x1]&&'insert'==_0x5bbf5[_0x32fd4a-0x1]['type']&&ro(_0x4278ce,_0x410ac8);const _0x3d754a=_0x410ac8['getMovedRangeStart'](),_0xcc7d58=_0x410ac8['howMany'];for(let _0x4a7a89=0x0;_0x4a7a89<_0xcc7d58;_0x4a7a89++){const _0xab1736=_0x3d754a['getShiftedBy'](_0x4a7a89)['nodeAfter'];_0x1b5a6c['add'](_0xab1736);}break;}case'remove':{const _0x2ce7d2=_0x410ac8['sourcePosition'],_0x31d4c4=_0x410ac8['howMany'],_0x3f07bf=new ut(_0x2ce7d2,_0x31d4c4);_0x1d4620['batch']['addOperation'](_0x3f07bf),_0x5c61e4['model']['applyOperation'](_0x3f07bf);break;}}}for(const _0x39f203 of _0x1b5a6c){const _0x76705c=_0x5c61e4['model']['createRangeOn'](_0x39f203),_0x2be2f8='suggestion:formatBlock:$fakeWrap:'+_0x23a3b0()+':$aiSuggestion';_0x4278ce['markers']['set'](_0x2be2f8,_0x1f960a(_0x76705c,_0x5c61e4['model']));}});}(_0x437639,_0x2e8c3a,_0x3646d8):_0x3646d8['model']['change'](_0x511a59=>{for(const _0x35345e of _0x437639)if('remove'==_0x35345e['type']){const _0x2eefd1=_0x35345e['sourcePosition'],_0x2b929d=_0x35345e['howMany'],_0x11f9c9=new ut(_0x2eefd1,_0x2b929d);_0x511a59['batch']['addOperation'](_0x11f9c9),_0x3646d8['model']['applyOperation'](_0x11f9c9);}else{if('marker'==_0x35345e['type']){const _0x28b882=_0x35345e['name'],_0x5251d3=_0x35345e['newRange'];_0x2e8c3a['markers']['set'](_0x28b882,_0x5251d3);}else _0x35345e['baseVersion']=null,_0x35345e['isDocumentOperation']=!0x1,_0x511a59['batch']['addOperation'](_0x35345e),_0x3646d8['model']['applyOperation'](_0x35345e);}});if(_0x28e5fa){const _0x50f461=wt(_0x3646d8,_0x437639,_0x2e8c3a);Et(_0x3646d8['model'],_0x50f461),function(_0x53643b,_0x537fc1){const _0x3aeb58=_0x537fc1['getFirstRange']()['start'];let _0xe3f465=_0x537fc1['getFirstRange']()['end'];const _0x32d9ca=_0x3aeb58['root'];(_0xe3f465['textNode']||_0xe3f465['nodeAfter']&&_0xe3f465['nodeAfter']['is']('$text'))&&(_0x2d640c(_0xe3f465,'...'),_0xe3f465=_0xe3f465['getShiftedBy'](0x3)),(_0x3aeb58['textNode']||_0x3aeb58['nodeBefore']&&_0x3aeb58['nodeBefore']['is']('$text'))&&(_0x2d640c(_0x3aeb58,'...'),function(_0x17351f,_0x2accf6,_0x5bb0c8){for(let [_0x306db0,_0x5d3351]of _0x17351f['markers']){const _0x4d6cd1=_0x5d3351['_getTransformedByInsertion'](_0x2accf6,_0x5bb0c8,!0x1);_0x5d3351=_0x4d6cd1[0x0],_0x17351f['markers']['set'](_0x306db0,_0x5d3351);}}(_0x32d9ca,_0x3aeb58,0x3),_0x3aeb58['parent']==_0xe3f465['parent']&&(_0xe3f465=_0xe3f465['getShiftedBy'](0x3)));const _0x2cc354=_0x53643b['createRange'](_0x53643b['createPositionAt'](_0x32d9ca,0x0),_0x3aeb58),_0x43d043=_0x53643b['createRange'](_0xe3f465,_0x53643b['createPositionAt'](_0x32d9ca,'end')),_0xb6fd=[..._0x2cc354['getMinimalFlatRanges'](),..._0x43d043['getMinimalFlatRanges']()];_0xb6fd['reverse']();for(const _0x589d8c of _0xb6fd)_0x594863(_0x589d8c),Jn(_0x32d9ca,_0x589d8c);}(_0x3646d8['model'],_0x50f461);}const _0x23d57c=_0x3646d8['data']['stringify'](_0x2e8c3a,{'showSuggestionHighlights':!0x0});return{'content':He(_0x23d57c),'hasChanges':!0x0};}(_0x535f09,_0x3fc531,_0x46eff2,_0x2842e3,_0x185741);return{'type':_0x42f851['changes'][0x0]['type'],'index':_0x42f851['index'],'content':_0x528eb1,'hasChanges':_0x3a4a01};});}function ro(_0x1c0e5d,_0x2ee673){for(const [_0x448138,_0xad2f08]of _0x1c0e5d['markers']){const _0x593d05=ct['_createFromRanges'](_0xad2f08['getTransformedByOperation'](_0x2ee673));_0x1c0e5d['markers']['set'](_0x448138,_0x593d05);}}function wt(_0x583e5e,_0x4bd67b,_0x214280){const _0x21025f=_0x583e5e['plugins']['get']('DocumentCompare');let _0x15b85c=_0x583e5e['model']['createPositionAt'](_0x214280,Number['POSITIVE_INFINITY']),_0x1f7f76=_0x583e5e['model']['createPositionAt'](_0x214280,0x0);for(const _0x5c03b7 of _0x4bd67b){let _0x349e17,_0x351550;if(_0x21025f['isMarkedRemoveOperation'](_0x5c03b7))_0x349e17=_0x5c03b7['newRange']['start'],_0x351550=_0x5c03b7['newRange']['end'];else switch(_0x15b85c=_0x15b85c['getTransformedByOperation'](_0x5c03b7),_0x1f7f76=_0x1f7f76['getTransformedByOperation'](_0x5c03b7),_0x5c03b7['type']){case'rename':_0x349e17=_0x5c03b7['position'],_0x351550=_0x349e17['getShiftedBy'](0x1);break;case'addAttribute':case'removeAttribute':case'changeAttribute':_0x349e17=_0x5c03b7['range']['start'],_0x351550=_0x5c03b7['range']['end'];break;case'insert':_0x349e17=_0x5c03b7['position'],_0x351550=_0x349e17['getShiftedBy'](_0x5c03b7['howMany']);break;case'split':_0x349e17=_0x5c03b7['splitPosition'],_0x351550=_0x5c03b7['moveTargetPosition'];break;case'merge':{const _0x4d1b08=_0x5c03b7['targetPosition']['path']['slice'](0x0,-0x1);_0x349e17=_0x583e5e['model']['createPositionFromPath'](_0x214280,_0x4d1b08),_0x351550=_0x349e17['getShiftedBy'](0x1);break;}case'remove':{const _0x47475e=_0x5c03b7['howMany'],_0x36e0e1=_0x5c03b7['sourcePosition']['_getTransformedByInsertion'](_0x5c03b7['targetPosition'],_0x47475e),_0x2d6556=_0x5c03b7['getMovedRangeStart']();'remove'==_0x5c03b7['type']?(_0x349e17=_0x36e0e1,_0x351550=_0x36e0e1):(_0x349e17=_0x2d6556,_0x351550=_0x2d6556['getShiftedBy'](_0x47475e));break;}}_0x349e17&&_0x349e17['isBefore'](_0x15b85c)&&(_0x15b85c=_0x349e17['clone'](),_0x15b85c['stickiness']='toNone'),_0x351550&&_0x351550['isAfter'](_0x1f7f76)&&(_0x1f7f76=_0x351550['clone'](),_0x1f7f76['stickiness']='toNone');}return _0x583e5e['model']['createSelection'](_0x583e5e['model']['createRange'](_0x15b85c,_0x1f7f76));}function Et(_0x54ff54,_0x5ee1e8){so(_0x54ff54,_0x5ee1e8,'forward');const _0x10474d=_0x5ee1e8['getFirstRange']();_0x5ee1e8['setTo']([]),_0x5ee1e8['setTo'](_0x10474d,{'backward':!0x0}),so(_0x54ff54,_0x5ee1e8,'backward');}function so(_0xee0a22,_0x538b4f,_0x327f85){let _0x3d686e=0x14;for(;_0x3d686e;){_0xee0a22['modifySelection'](_0x538b4f,{'unit':'word','direction':_0x327f85}),_0x3d686e--;const _0x5605b3=_0x538b4f['focus']['forward'==_0x327f85?'nodeBefore':'nodeAfter'];if(_0x5605b3&&_0x5605b3['is']('element')&&_0xee0a22['schema']['isBlock'](_0x5605b3)&&_0xee0a22['schema']['isObject'](_0x5605b3))break;}}function Jn(_0x20d19c,_0x55fd91){for(const [_0x4b1604,_0x9d4a7]of _0x20d19c['markers']){const _0x4ea252=_0x9d4a7['_getTransformedByDeletion'](_0x55fd91['start'],_0x55fd91['end']['offset']-_0x55fd91['start']['offset']);null!=_0x4ea252?_0x20d19c['markers']['set'](_0x4b1604,_0x4ea252):_0x20d19c['markers']['delete'](_0x4b1604);}}const Zn=['modification-delta','text-delta','web-search','reasoning'],Wr=['conversation-title'];class Ge extends ts(){['id'];['interactionId'];['type'];['sources']=[];['parsedContent']=new Rt([]);['parsedMergedContent']=new Rt([]);['changeGroups']=[];['areActionsDisabled']=!0x1;['documentContextContent'];['aiResponseParser'];['aiResponseApplier'];['editor'];['cachedSuggestionContentParts']={'withDiff':[],'withoutDiff':[]};constructor({type:_0x295eba,content:_0x4816a4='',isDone:_0x1d0da3=!0x1,interactionId:_0x12c2bf,areActionsDisabled:_0x35ead4,documentContextContent:_0x4c5cae,editor:_0x1fad1b,id:_0x432787}){super(),this['id']=_0x432787||_0x23a3b0(),this['interactionId']=_0x12c2bf,this['type']=_0x295eba,this['areActionsDisabled']=!!_0x35ead4,this['editor']=_0x1fad1b,this['aiResponseParser']=new Ke(),this['aiResponseApplier']=new Qe(),this['documentContextContent']=He(_0x4c5cae||''),this['set']('isDone',_0x1d0da3),this['on']('change:content',()=>{this['onContentChange']();}),this['set']('content',_0x4816a4);}['appendContent'](_0x237bac){this['set']('content',this['content']+_0x237bac);}['done'](){this['isDone']||(this['set']('isDone',!0x0),this['onContentChange']());}['destroy'](){this['stopListening']();}['setChangeGroupState'](_0x38cd7f,_0x315802){this['changeGroups'][_0x38cd7f]['state']=_0x315802,this['fire']('replyChangeGroupStateUpdated',{'reply':this,'index':_0x38cd7f,'state':_0x315802});}['getContentParts']({showDiff:_0x430827,groupIndex:_0x42d48f}){if(!this['editor'])throw new _0x25e143('ai-get-editor-from-context-no-editor',null,{'aiReply':this});const _0x31120a=this['_getCachedContentParts'](_0x430827,_0x42d48f);if(_0x31120a)return _0x31120a;let _0x12fd6e=[];if(void 0x0===_0x42d48f)_0x12fd6e=this['changeGroups'];else{const _0x32d94f=this['changeGroups']['find'](({index:_0x372f00})=>_0x372f00===_0x42d48f);if(!_0x32d94f)throw new _0x25e143('ai-reply-get-content-parts-group-not-found',null,{'aiReply':this,'groupIndex':_0x42d48f});_0x12fd6e=[_0x32d94f];}const _0x503cb9=nt({'editor':this['editor'],'showDiff':_0x430827,'changeGroups':_0x12fd6e,'documentContextContent':this['documentContextContent']});return this['_setCachedContentParts'](_0x430827,_0x503cb9),_0x503cb9;}['_getCachedContentParts'](_0xe87b51,_0x48d161){const _0x159170=_0xe87b51?'withDiff':'withoutDiff';if(!this['cachedSuggestionContentParts'][_0x159170]['length'])return null;const _0x545df0=this['cachedSuggestionContentParts'][_0x159170];if(void 0x0===_0x48d161)return _0x132171(_0x545df0);{const _0x5acc88=_0x545df0['find'](({index:_0x25f84e})=>_0x25f84e===_0x48d161);if(_0x5acc88)return[_0x132171(_0x5acc88)];}return null;}['_setCachedContentParts'](_0x2acc86,_0x1d521b){const _0x590281=_0x2acc86?'withDiff':'withoutDiff';_0x1d521b['forEach'](_0x4440b9=>{const _0x2c324e=this['cachedSuggestionContentParts'][_0x590281],_0x17995a=_0x2c324e['find'](({index:_0x33c164})=>_0x33c164===_0x4440b9['index']);if(_0x17995a){const _0x251716=_0x2c324e['indexOf'](_0x17995a);_0x2c324e['splice'](_0x251716,0x1,_0x4440b9);}else _0x2c324e['push'](_0x4440b9);});}['onContentChange'](){if('modification-delta'===this['type']){this['parsedContent']=this['aiResponseParser']['parseAndNormalizeHTML'](this['content']);const _0x3d6663=this['changeGroups'];this['updateChangeGroups']();const _0x38a6b1=this['_getDifferentChangeGroups'](_0x3d6663,this['changeGroups']);(_0x38a6b1['length']||this['isDone'])&&(this['fire']('replyContentUpdated',this,_0x38a6b1),this['cachedSuggestionContentParts']['withDiff']['length']=this['cachedSuggestionContentParts']['withoutDiff']['length']=0x0);}else this['parsedContent']=this['aiResponseParser']['convertMarkdownToHTML'](this['content']),this['fire']('replyContentUpdated',this);}['_getDifferentChangeGroups'](_0x3efe2c,_0x2668d7){const _0x28a35f=[];for(const _0xa88130 of _0x2668d7){const _0x15d3ee=_0x3efe2c[_0xa88130['index']];_0x15d3ee?_0x15d3ee['changes']['length']!==_0xa88130['changes']['length']?_0x28a35f['push'](_0xa88130):_0x15d3ee['changes']['forEach']((_0x1ba858,_0x1a3654)=>{const _0x3e8ba7=_0xa88130['changes'][_0x1a3654];_0x1ba858['id']!==_0x3e8ba7['id']&&_0x28a35f['push'](_0xa88130);}):_0x28a35f['push'](_0xa88130);}return _0x28a35f;}['updateChangeGroups'](){const _0x1fef6f=new _0x4a04d5('p',{},[new _0x4a04d5('span',{'style':'color:\x20#808080;\x20font-style:\x20italic'},[new _0x7b02c2(i(this['editor']['locale'],'AI_SUGGESTION_CONTENT_PART_REMOVED'))])]),_0x438dca=this['aiResponseApplier']['merge'](this['parsedContent'],this['documentContextContent']['cloneNode'](!0x0),{'markUnstableElements':!this['isDone'],'replaceRemovedWith':_0x1fef6f,'cutAfterLastChange':!this['isDone']});if(!_0x438dca['modifiedNodeIds']['length']&&!this['isDone'])return;this['parsedMergedContent']=_0x438dca['parsedContent'];let _0x4e85f3=[];if(_0x8c497d(_0x52ac3a=>{const _0xa72f6a=vt(_0x52ac3a,'data-id');if(!_0xa72f6a||!_0x2070d3(_0xa72f6a))return!0x1;const _0x4c1325=[_0x52ac3a,...qe(_0x52ac3a)]['at'](-0x2);if(_0x52ac3a!=_0x4c1325){const _0x3c06ad=vt(_0x4c1325,'data-id');_0x2070d3(_0x3c06ad)||(_0x4e85f3['push']({'node':_0x4c1325,'id':_0x3c06ad,'type':'modified'}),_0x438dca['modifiedNodeIds']['push'](_0x3c06ad));}else _0x438dca['modifiedNodeIds']['includes'](_0xa72f6a)?_0x4e85f3['push']({'node':_0x52ac3a,'type':'modified','id':_0xa72f6a}):_0x438dca['newNodeIds']['includes'](_0xa72f6a)?_0x4e85f3['push']({'node':_0x52ac3a,'type':'new','id':_0xa72f6a,'anchorId':vt(_0x52ac3a['previousSibling'],'data-id')}):_0x4e85f3['push']({'node':_0x52ac3a,'type':'removed','id':_0xa72f6a});return!0x0;},this['parsedMergedContent']),_0x4e85f3=_0x4e85f3['filter'](({node:_0x22a63e})=>[...qe(_0x22a63e),_0x22a63e]['every'](_0x21448b=>!vt(_0x21448b,'data-unstable'))),0x0==_0x4e85f3['length'])return;const _0x3396d8=[[_0x4e85f3[0x0]]];for(let _0x24b555=0x1;_0x24b555<_0x4e85f3['length'];_0x24b555++){const _0x2b44c1=_0x3396d8[_0x3396d8['length']-0x1],_0x5976b9=_0x2b44c1[_0x2b44c1['length']-0x1];_0x4e85f3[_0x24b555]['node']['previousSibling']==_0x5976b9['node']&&'modified'!=_0x4e85f3[_0x24b555]['type']&&'modified'!=_0x5976b9['type']?_0x2b44c1['push'](_0x4e85f3[_0x24b555]):_0x3396d8['push']([_0x4e85f3[_0x24b555]]);}for(const _0x1eff1e of _0x3396d8){const _0x5dae75=_0x1eff1e[0x0],_0x323964=_0x1eff1e[_0x1eff1e['length']-0x1],_0x1f6566=_0x2e8bb7(_0x5dae75['node']['previousSibling']);_0x1f6566&&_0x1eff1e['unshift'](_0x1f6566);const _0x4b7f6b=_0x2e8bb7(_0x323964['node']['nextSibling']);_0x4b7f6b&&_0x1eff1e['push'](_0x4b7f6b);}function _0x2070d3(_0x283619){return _0x438dca['modifiedNodeIds']['includes'](_0x283619)||_0x438dca['newNodeIds']['includes'](_0x283619)||_0x438dca['removedNodeIds']['includes'](_0x283619);}function _0x2e8bb7(_0x2d67ca){if(_0x2d67ca&&vt(_0x2d67ca,'data-id')&&!vt(_0x2d67ca,'data-unstable')){const _0x1295ca=vt(_0x2d67ca,'data-id');if(!_0x2070d3(_0x1295ca))return{'node':_0x2d67ca,'type':'context','id':_0x1295ca};}return null;}this['changeGroups']=_0x3396d8['map']((_0xf1c28a,_0x19f31b)=>({'changes':_0xf1c28a,'state':'pending','index':_0x19f31b}));}}function Di(_0x230234){return Object['values'](Zn)['includes'](_0x230234);}function Fi(_0x33871c){return Wr['includes'](_0x33871c);}function Ui(_0x1008a4){return'conversation-title'===_0x1008a4;}function qi(_0x30132f){return'source'===_0x30132f;}const Ce=['interactionCreated','interactionStarted','interactionStopped','interactionFinished','interactionDestroyed','replyCreated','replyContentUpdated','replyChangeGroupStateUpdated','setConversationTitle','webSearchStarted','webSearchFinished','reasoningStarted','reasoningFinished','error'];class xe extends _0x32571c(){['id'];['replies']=[];['currentReply'];['messageId'];['actionCallId'];['currentRequest'];['connector'];['isStopped']=!0x1;['isDestroyed']=!0x1;['editor'];['_isReasoning']=!0x1;['_isWebSearching']=!0x1;constructor({connector:_0x238a89,editor:_0x202f42}){super(),this['id']=_0x23a3b0(),this['connector']=_0x238a89,this['isStopped']=!0x0,this['editor']=_0x202f42;}async['start'](){let _0x207659;const _0x33bdfd=[];this['isStopped']=!0x1;try{this['currentRequest']=await this['sendRequest'](),this['fire']('interactionStarted',this);const _0x5eca53=await this['currentRequest']['getStream']();for await(const _0x222f15 of _0x5eca53){if(this['isStopped'])return;if('error'===_0x222f15['event'])return void this['fire']('error',{'error':new _0x25e143('ai-chat-interaction-error',this)});if('message-metadata'!==_0x222f15['event']){if('action-metadata'!==_0x222f15['event']){if(Ui(_0x222f15['event'])&&this['setConversationTitle'](_0x222f15['data']['conversationTitle'],!0x0),qi(_0x222f15['event']))_0x33bdfd['push'](_0x222f15['data']['source']);else{if(Di(_0x222f15['event'])){if(_0x222f15['event']!==_0x207659){if(_0x207659=_0x222f15['event'],'web-search'===_0x222f15['event']){this['_isWebSearching']||(this['_isWebSearching']=!0x0,this['fire']('webSearchStarted',this));continue;}if('reasoning'===_0x222f15['event']){this['_isReasoning']||(this['_isReasoning']=!0x0,this['fire']('reasoningStarted',this));continue;}this['_isReasoning']&&(this['_isReasoning']=!0x1,this['fire']('reasoningFinished',this)),this['_isWebSearching']&&(this['_isWebSearching']=!0x1,this['fire']('webSearchFinished',this)),this['currentReply']&&this['currentReply']['done'](),this['currentReply']=this['createReply']({'type':_0x222f15['event'],'interactionId':this['id'],'id':_0x222f15['data']?.['id']}),_0x33bdfd['length']>0x0&&'modification-delta'===_0x222f15['event']&&(this['currentReply']['sources']=_0x33bdfd['splice'](0x0));}_0x222f15['data']['textDelta']&&this['currentReply']['appendContent'](_0x222f15['data']['textDelta']);}else Fi(_0x222f15['event']);}}else this['actionCallId']=_0x222f15['data']['callId'];}else this['messageId']=_0x222f15['data']['messageId'];}}finally{this['isStopped']||(_0x33bdfd['length']>0x0&&(this['currentReply']['sources']=_0x33bdfd['splice'](0x0)),this['_finalizeInteraction'](),this['fire']('interactionFinished',this));}}['stop'](){this['isStopped']||(this['_finalizeInteraction'](),this['fire']('interactionStopped',this));}['getReply'](_0x274f7f){return this['replies']['find'](_0x1602ea=>_0x1602ea['id']===_0x274f7f);}['destroy'](){this['isDestroyed']||(this['stop'](),this['replies']['forEach'](_0xe75fed=>_0xe75fed['destroy']()),this['replies']=[],this['isDestroyed']=!0x0,this['fire']('interactionDestroyed',this),this['stopListening']());}['createReply'](_0x4bd7e9){const _0x30c127=new Ge({'editor':this['editor'],'documentContextContent':this['getDocumentContext']()?.['content'],..._0x4bd7e9});return this['replies']['push'](_0x30c127),_0x30c127['delegate'](...Ce)['to'](this),this['fire']('replyCreated',_0x30c127),_0x30c127;}['setConversationTitle'](_0x174a69,_0x3a08cb=!0x1){this['fire']('setConversationTitle',_0x174a69,_0x3a08cb);}['_finalizeInteraction'](){this['isStopped']=!0x0,this['currentRequest']&&this['currentRequest']['abortController']['abort'](),this['currentReply']&&this['currentReply']['done'](),this['currentRequest']=this['currentReply']=void 0x0;}}var je=function(_0x55d5c2){return _0x55d5c2['FILE']='file',_0x55d5c2['DOCUMENT']='document',_0x55d5c2['URL']='web-resource',_0x55d5c2['TEXT']='text',_0x55d5c2['SELECTION']='selection',_0x55d5c2;}({}),be=function(_0x5b6d62){return _0x5b6d62['TEXT']='text',_0x5b6d62['MARKDOWN']='markdown',_0x5b6d62['HTML']='html',_0x5b6d62;}({});const Fe=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']]),vi=['contextItemAdded','contextItemRemoved','contextItemLoadingEnded','contextSent','error','addContextOptionsChanged','sourceResourcesLoaded','resourceStateChanged','uploadProgressChanged'];class wi extends ts(){['_connector'];['_config'];['_ownerId'];constructor({connector:_0x4f6485,config:_0x455fca,ownerId:_0x843ce5}){super(),this['_connector']=_0x4f6485,this['_config']=_0x455fca,this['_ownerId']=_0x843ce5;}['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'](_0x29a7ee){const _0x3f36f7=await this['_createContextItemFromContent'](_0x29a7ee);return this['_addToConversationContextItem'](_0x3f36f7),'current-document'===_0x3f36f7['uiId']&&this['_toggleAddCurrentDocumentOptionVisibility'](),_0x3f36f7;}async['_createContextItemFromContent'](_0x18a736){if(_0x18a736['type']===je['DOCUMENT']){const _0xb9c671=await this['_connector']['fetchDocument'](this['_ownerId'],_0x18a736['id'])['getDocument']();return{'id':'current-document','uiId':'current-document','label':'Current\x20document','type':_0x18a736['type'],'content':_0xb9c671['content'],'hidden':this['_conversationContextItems']['has']('current-document'),'version':_0xb9c671['attributes']?.['version'],'sessionId':_0xb9c671['attributes']?.['sessionId']};}return{'id':_0x18a736['id'],'uiId':_0x18a736['id'],'label':_0x18a736['attributes']?.['label']||_0x18a736['name']||_0x18a736['url']||_0x18a736['id'],'type':_0x18a736['type'],..._0x18a736?.['attributes']?.['resourceId']?{'resourceId':_0x18a736['attributes']?.['resourceId']}:{}};}['getSentContextItems'](){return new Map(this['_conversationContextItems']);}['removeFromContext'](_0x28a5a2){const _0xb3bc28=this['_pendingContextItems']['get'](_0x28a5a2);_0xb3bc28?.['isReadOnly']||this['_removeContextItem'](_0x28a5a2);}['clearPendingContextItems'](){if(0x0===this['_pendingContextItems']['size'])return;for(const _0x5019ba of this['_pendingContextItems']['values']())this['_removeContextItem'](_0x5019ba['uiId']);const _0xfeadad=this['_conversationContextItems']['get']('current-document')||this['_pendingContextItems']['get']('current-document');_0xfeadad&&this['_addContextItem']({..._0xfeadad,'isReadOnly':!0x0,'hidden':!0x0});}['addToConversationContext'](_0x476aa7){for(const _0x4ee695 of _0x476aa7['values']())this['_addToConversationContextItem'](_0x4ee695);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'](_0x475bd5){return Array['from'](_0x475bd5['values']())['map'](_0x52d177=>this['_mapContextItemToRequestData'](_0x52d177))['filter'](_0x5c0954=>null!==_0x5c0954);}async['addFilesToContext'](_0x423278,_0x1bc4fe,_0x38baa3=je['FILE']){const _0xad1200='files-'+_0x23a3b0();this['_startUploadOperation'](_0xad1200);try{await Promise['all'](_0x423278['map'](async _0x25f8b6=>{const _0x443a6f='file-'+_0x23a3b0(),_0x4e6805=_0x25d6a2(_0x25f8b6['name']);try{this['_addContextItem']({'type':_0x38baa3,'label':_0x1bc4fe?.['label']||_0x4e6805,'uiId':_0x443a6f,'resourceId':_0x1bc4fe?.['resourceId']},!0x0);const _0x3d3ca9=this['_connector']['uploadFile'](this['_ownerId'],_0x25f8b6,_0x1bc4fe);this['_ongoingUploads']['set'](_0x443a6f,_0x3d3ca9['abortController']);const {id:_0x5e27a2}=await _0x3d3ca9['getId']();this['_ongoingUploads']['delete'](_0x443a6f),this['_finishContextItemLoading']({'type':_0x38baa3,'id':_0x5e27a2,'label':_0x1bc4fe?.['label']||_0x4e6805,'uiId':_0x443a6f,'resourceId':_0x1bc4fe?.['resourceId']},!0x1);}catch(_0x3cb3a9){this['_ongoingUploads']['delete'](_0x443a6f);if(!(_0x3cb3a9 instanceof _0x25e143&&_0x3cb3a9['message']['startsWith']('ai-request-aborted'))){const _0x5223d1=Fe['get'](_0x3cb3a9['code'])||'ai-chat-file-upload-failed',_0x91576b=new _0x25e143(_0x5223d1,null,{'fileName':_0x4e6805,..._0x3cb3a9});_0x91576b['stack']=_0x3cb3a9['stack'],this['fire']('error',{'error':_0x91576b});}this['_removeContextItem'](_0x443a6f);}}));}finally{this['_finishUploadOperation'](_0xad1200);}}['addCurrentDocumentToContext'](_0x11af17){if(this['isCurrentDocumentInContext']()||!this['_addContextOptionsState']['document']['enabled'])return;const _0x3105c3={'type':je['DOCUMENT'],'uiId':'current-document','label':_0x11af17,'isReadOnly':this['_conversationContextItems']['has']('current-document'),'hidden':this['_conversationContextItems']['has']('current-document')};this['_addContextItem'](_0x3105c3);}async['updateCurrentDocument'](_0x5b20f8,_0x3f3668,_0xd845d4,_0x56b42a){const _0x4a1d6d=this['_pendingContextItems']['get']('current-document');if(_0x4a1d6d&&_0x5b20f8){_0x4a1d6d['selection']=_0x56b42a?_0x56b42a['map'](_0x1bc358=>({'start':_0x1bc358['start'],'end':_0x1bc358['end']})):[];try{if(_0x4a1d6d['version']===_0x3f3668)return;const {id:_0x362250}=await this['_connector']['uploadDocument'](this['_ownerId'],_0x5b20f8,{'version':_0x3f3668,'sessionId':_0xd845d4})['getId']();_0x4a1d6d['id']=_0x362250,_0x4a1d6d['content']=_0x5b20f8,_0x4a1d6d['version']=_0x3f3668,_0x4a1d6d['sessionId']=_0xd845d4;}catch(_0x45adf7){const _0x58e16e=new _0x25e143('ai-chat-document-upload-failed',null);_0x58e16e['stack']=_0x45adf7['stack'],this['fire']('error',{'error':_0x58e16e});}}}['addSelectionToContext'](_0xa76447){this['_addContextItem']({'type':je['SELECTION'],'label':_0xa76447,'uiId':'selection','content':_0xa76447});}['removeSelectionFromContext'](){this['_removeContextItem']('selection');}async['addUrlToContext'](_0x49118a,_0x3fcbc4){const _0x56cd61='url-'+_0x23a3b0();this['_startUploadOperation'](_0x56cd61);const _0x41463b='url-'+_0x23a3b0();try{this['_addContextItem']({'type':je['URL'],'label':_0x3fcbc4?.['label']||_0x49118a,'uiId':_0x41463b,'resourceId':_0x3fcbc4?.['resourceId']},!0x0);const _0x31dace=this['_connector']['uploadUrl'](this['_ownerId'],_0x49118a,_0x3fcbc4);this['_ongoingUploads']['set'](_0x41463b,_0x31dace['abortController']);const {id:_0x2f518f}=await _0x31dace['getId']();this['_ongoingUploads']['delete'](_0x41463b),this['_finishContextItemLoading']({'type':je['URL'],'id':_0x2f518f,'label':_0x3fcbc4?.['label']||_0x49118a,'uiId':_0x41463b,'resourceId':_0x3fcbc4?.['resourceId']},!0x1);}catch(_0x3a1fd0){this['_ongoingUploads']['delete'](_0x41463b),(_0x3a1fd0['message']['startsWith']('ai-request-aborted')||this['fire']('error',{'error':new _0x25e143('ai-chat-url-upload-failed',this,{'url':_0x49118a,'originalError':_0x3a1fd0}),'url':_0x49118a}),this['_removeContextItem'](_0x41463b));}finally{this['_finishUploadOperation'](_0x56cd61);}}async['loadSourceResources'](_0x453b6c,_0x5a5a11,_0x2929ea){const _0x36ea3a=this['_addContextOptionsState']['sources']['find'](_0x37b105=>_0x37b105['id']===_0x453b6c);if(!_0x36ea3a)return this['fire']('error',{'error':new _0x25e143('ai-chat-source-not-found',this,{'sourceId':_0x453b6c}),'sourceId':_0x453b6c}),[];try{const _0x325ee9=(await _0x36ea3a['getResources'](_0x5a5a11))['map'](_0x594dea=>{const _0x27e590=this['_isResourceInContext'](_0x594dea['id']);return{..._0x594dea,'isInContext':_0x27e590};});return _0x36ea3a['resources']=_0x325ee9,this['fire']('sourceResourcesLoaded',{'sourceId':_0x453b6c,'source':_0x36ea3a,'resources':_0x325ee9,'uid':_0x2929ea}),_0x325ee9;}catch(_0xe40f55){return this['fire']('error',{'error':new _0x25e143('ai-chat-source-resources-load-failed',this,{'sourceId':_0x453b6c,'originalError':_0xe40f55}),'sourceId':_0x453b6c,'sourceLabel':_0x36ea3a['label']}),[];}}async['addResourceToContext'](_0x730ed6,_0x5a0eb0){if(this['_isResourceInContext'](_0x5a0eb0['id']))return;let _0x643b7e=_0x5a0eb0['data'];if(!_0x643b7e&&_0x730ed6['getData'])try{_0x643b7e=await _0x730ed6['getData'](_0x5a0eb0['id']);}catch(_0x4f94ef){return void this['fire']('error',{'error':new _0x25e143('ai-chat-resource-load-failed',this,{'resourceId':_0x5a0eb0['id'],'sourceId':_0x730ed6['id'],'originalError':_0x4f94ef}),'resourceId':_0x5a0eb0['id'],'sourceId':_0x730ed6['id']});}if(_0x643b7e)switch(_0x5a0eb0['type']){case je['URL']:if('string'!=typeof _0x643b7e)return void this['fire']('error',{'error':new _0x25e143('ai-chat-context-invalid-data',this,{'resourceId':_0x5a0eb0['id'],'sourceId':_0x730ed6['id'],'expectedType':'string','actualType':typeof _0x643b7e}),'resourceId':_0x5a0eb0['id'],'sourceId':_0x730ed6['id']});await this['addUrlToContext'](_0x643b7e,{'label':_0x5a0eb0['label'],'resourceId':_0x5a0eb0['id']});break;case je['FILE']:if(!(_0x643b7e instanceof File))return void this['fire']('error',{'error':new _0x25e143('ai-chat-context-invalid-data',this,{'resourceId':_0x5a0eb0['id'],'sourceId':_0x730ed6['id'],'expectedType':'File','actualType':typeof _0x643b7e}),'resourceId':_0x5a0eb0['id'],'sourceId':_0x730ed6['id']});await this['addFilesToContext']([_0x643b7e],{'label':_0x5a0eb0['label'],'resourceId':_0x5a0eb0['id']});break;case je['TEXT']:if('object'!=typeof _0x643b7e||!('content'in _0x643b7e)||!('type'in _0x643b7e))return void this['fire']('error',{'error':new _0x25e143('ai-chat-context-invalid-data',this,{'resourceId':_0x5a0eb0['id'],'sourceId':_0x730ed6['id'],'expectedType':'object\x20with\x20content\x20and\x20type\x20properties','actualType':typeof _0x643b7e}),'resourceId':_0x5a0eb0['id'],'sourceId':_0x730ed6['id']});_0x643b7e=wi['_convertTextResourceToFile'](_0x643b7e,_0x5a0eb0['label']),await this['addFilesToContext']([_0x643b7e],{'label':_0x5a0eb0['label'],'resourceId':_0x5a0eb0['id']},je['TEXT']);break;default:this['fire']('error',{'error':new _0x25e143('ai-chat-context-unsupported-type',this,{'resourceId':_0x5a0eb0['id'],'sourceId':_0x730ed6['id'],'resourceType':_0x5a0eb0['type']}),'resourceId':_0x5a0eb0['id'],'sourceId':_0x730ed6['id']});}else this['fire']('error',{'error':new _0x25e143('ai-chat-resource-no-data',this,{'resourceId':_0x5a0eb0['id'],'sourceId':_0x730ed6['id']}),'resourceId':_0x5a0eb0['id'],'sourceId':_0x730ed6['id']});}static['_convertTextResourceToFile'](_0x13c4e5,_0x499ac0){switch(_0x13c4e5['type']){case be['MARKDOWN']:return new File([_0x13c4e5['content']],_0x499ac0,{'type':'text/markdown'});case be['HTML']:return new File([_0x13c4e5['content']],_0x499ac0,{'type':'text/html'});default:return new File([_0x13c4e5['content']],_0x499ac0,{'type':'text/plain'});}}static['_mapContextItemToRequestData'](_0x2f3b27){switch(_0x2f3b27['type']){case je['FILE']:return{'type':je['FILE'],'id':_0x2f3b27['id']};case je['URL']:return{'type':je['URL'],'id':_0x2f3b27['id']};case je['DOCUMENT']:return{'type':je['DOCUMENT'],'id':_0x2f3b27['id'],..._0x2f3b27['selection']?.['length']&&{'selection':_0x2f3b27['selection']}};case je['TEXT']:return{'type':je['FILE'],'id':_0x2f3b27['id']};default:return null;}}['_addContextItem'](_0xbcd392,_0x869294=!0x1){if(this['_pendingContextItems']['set'](_0xbcd392['uiId'],_0xbcd392),_0xbcd392['hidden']||this['fire']('contextItemAdded',{'contextItem':_0xbcd392,'isLoading':_0x869294}),'current-document'===_0xbcd392['uiId']&&this['_toggleAddCurrentDocumentOptionVisibility'](),_0xbcd392['resourceId']){const _0x187e4e=this['_findSourceIdsByResourceId'](_0xbcd392['resourceId']);_0x187e4e&&_0x187e4e['forEach'](_0x233277=>{this['_updateResourceInContextState'](_0x233277,_0xbcd392['resourceId'],!0x0);});}}['_removeContextItem'](_0x51493d){const _0x5b4a47=this['_pendingContextItems']['get'](_0x51493d),_0x2a2795=this['_ongoingUploads']['get'](_0x51493d);if(_0x2a2795&&(_0x2a2795['abort'](),this['_ongoingUploads']['delete'](_0x51493d)),_0x5b4a47?.['resourceId']){const _0x4dad02=this['_findSourceIdsByResourceId'](_0x5b4a47['resourceId']);_0x4dad02&&_0x4dad02['forEach'](_0x263685=>{this['_updateResourceInContextState'](_0x263685,_0x5b4a47['resourceId'],!0x1);});}this['_pendingContextItems']['delete'](_0x51493d),this['fire']('contextItemRemoved',{'uiId':_0x51493d,'type':_0x5b4a47?.['type']}),'current-document'===_0x51493d&&this['_toggleAddCurrentDocumentOptionVisibility']();}['_finishContextItemLoading'](_0x14be5a,_0x28135c){if(this['_pendingContextItems']['has'](_0x14be5a['uiId'])&&(this['_pendingContextItems']['set'](_0x14be5a['uiId'],_0x14be5a),this['fire']('contextItemLoadingEnded',{'contextItem':_0x14be5a,'isLoading':_0x28135c}),_0x14be5a['resourceId'])){const _0x4db460=this['_findSourceIdsByResourceId'](_0x14be5a['resourceId']);_0x4db460&&_0x4db460['forEach'](_0x5a1de8=>{this['_updateResourceInContextState'](_0x5a1de8,_0x14be5a['resourceId'],!0x0);});}}['_addToConversationContextItem'](_0x127295){this['_conversationContextItems']['set'](_0x127295['uiId'],_0x127295);}['_setAddContextOptionsDefaultState'](){this['_addContextOptionsState']={'document':{'enabled':!0x1!==this['_config']?.['document']?.['enabled'],'isHidden':!0x1},'urls':{'enabled':!0x1!==this['_config']?.['urls']?.['enabled']},'files':{'enabled':!0x1!==this['_config']?.['files']?.['enabled']},'sources':this['_getCustomSourcesInitialState']()},this['fire']('addContextOptionsChanged',{'options':this['_addContextOptionsState']});}['_getCustomSourcesInitialState'](){return this['_config']?.['sources']?.['map'](_0x1bc9b9=>({..._0x1bc9b9,'resources':[]}))??[];}['_toggleAddCurrentDocumentOptionVisibility'](){const _0x1b03ee=this['isCurrentDocumentInContext']()||this['isCurrentDocumentInConversation']();this['_addContextOptionsState']['document']['isHidden']=_0x1b03ee,this['fire']('addContextOptionsChanged',{'options':this['_addContextOptionsState']});}['_isResourceInContext'](_0x2e72ed){for(const _0xe75c39 of this['_pendingContextItems']['values']())if(_0xe75c39['resourceId']===_0x2e72ed)return!0x0;for(const _0x5b78db of this['_conversationContextItems']['values']())if(_0x5b78db['resourceId']===_0x2e72ed)return!0x0;return!0x1;}['_findSourceIdsByResourceId'](_0x2121a4){const _0x5a0de7=[];for(const _0x5b3cf1 of this['_addContextOptionsState']['sources']){_0x5b3cf1['resources']['find'](_0x34ad00=>_0x34ad00['id']===_0x2121a4)&&_0x5a0de7['push'](_0x5b3cf1['id']);}return 0x0===_0x5a0de7['length']?null:_0x5a0de7;}['_updateResourceInContextState'](_0x47be17,_0x2a67e0,_0x3d3a8e){const _0x151c6b=this['_addContextOptionsState']['sources']['find'](_0x113d62=>_0x113d62['id']===_0x47be17);if(!_0x151c6b)return;const _0x40fbea=_0x151c6b['resources']['find'](_0xfd115e=>_0xfd115e['id']===_0x2a67e0);_0x40fbea&&(_0x40fbea['isInContext']=_0x3d3a8e,this['fire']('resourceStateChanged',{'sourceId':_0x47be17,'resourceId':_0x2a67e0,'isInContext':_0x3d3a8e}));}['_startUploadOperation'](_0x34a205){this['_ongoingUploadOperations']['set'](_0x34a205,!0x0),this['_ongoingUploadOperations']['size']&&this['fire']('uploadProgressChanged',{'isUploadInProgress':!0x0});}['_finishUploadOperation'](_0x18bfdd){this['_ongoingUploadOperations']['delete'](_0x18bfdd),0x0===this['_ongoingUploadOperations']['size']&&this['fire']('uploadProgressChanged',{'isUploadInProgress':!0x1});}}const fi=['capabilitiesUpdated'];class Ii extends _0x32571c(){['_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'](_0x190fff){const _0x13ca55={};return _0x190fff&&_0x190fff['isWebSearchEnabled']&&(_0x13ca55['webSearch']={}),_0x190fff&&_0x190fff['isReasoningEnabled']&&(_0x13ca55['reasoning']={}),_0x13ca55;}['toggleWebSearch'](){this['setWebSearch'](!this['_isWebSearchEnabled']);}['toggleReasoning'](){this['setReasoning'](!this['_isReasoningEnabled']);}['setWebSearch'](_0x12d136){_0x12d136!==this['_isWebSearchEnabled']&&(this['_isWebSearchEnabled']=_0x12d136,this['fire']('capabilitiesUpdated',this['getCapabilitiesConfig']()));}['setReasoning'](_0x26b66a){_0x26b66a!==this['_isReasoningEnabled']&&(this['_isReasoningEnabled']=_0x26b66a,this['fire']('capabilitiesUpdated',this['getCapabilitiesConfig']()));}}class Ci extends xe{['userMessage'];['conversationId'];['contextItems']=new Map();['model'];['quickActionData'];constructor(_0x1712b5){super(_0x1712b5),this['conversationId']=_0x1712b5['conversationId'],this['contextItems']=_0x1712b5['contextItems'],this['capabilities']=_0x1712b5['capabilities'],this['userMessage']=_0x1712b5['userMessage'],this['model']=_0x1712b5['model'],this['quickActionData']=_0x1712b5['quickActionData'];}async['sendRequest'](){return this['connector']['queryAssistant']({'message':this['userMessage'],'conversationId':this['conversationId'],'parts':wi['mapContextItemsToRequestData'](this['contextItems']),'capabilities':Ii['getCapabilitiesRequestData'](this['capabilities']),'model':this['model'],'quickActionData':this['quickActionData']});}['getDocumentContext'](){return this['contextItems']['get']('current-document');}}class Tt extends _0x32571c(){['id'];['isStarted']=!0x1;['interactions']=[];['currentInteraction'];['selectedModel'];['connector'];['options'];constructor(_0x1ba4d0){super(),this['options']=_0x1ba4d0,this['connector']=_0x1ba4d0['connector'],this['chatModels']=_0x1ba4d0['chatModels'],this['id']=_0x1ba4d0['conversationId'];}async['init'](_0x259a94){try{this['chatContext']=new wi({'connector':this['connector'],'config':_0x259a94,'ownerId':this['id']}),this['chatContext']['delegate'](...vi)['to'](this),this['chatContext']['init'](),this['chatCapabilities']=new Ii(),this['chatCapabilities']['delegate'](...fi)['to'](this),this['chatCapabilities']['init']();const _0x5c9d9a=await this['chatModels']['getAvailableModels']();this['fire']('conversationInitialized',{'availableModels':_0x5c9d9a});const _0x3356ab=await this['chatModels']['getModel'](this['options']['selectedModelId']);_0x3356ab&&await this['setModel'](_0x3356ab);}catch(_0x5e93b6){const _0x100cbe=new _0x25e143('ai-chat-conversation-init-failed',null,{'message':_0x5e93b6['message']||_0x5e93b6});_0x100cbe['stack']=_0x5e93b6['stack'],this['fire']('error',{'error':_0x100cbe});}}async['start'](){if(this['isStarted'])throw new _0x25e143('ai-chat-conversation-already-started',null,{'conversation':this});if(!this['selectedModel'])throw new _0x25e143('ai-chat-conversation-start-no-model-selected',null,{'conversation':this});try{const {id:_0x425c9f}=await this['connector']['startConversation'](this['id'],this['options']['group'])['getConversation']();this['id']=_0x425c9f,this['isStarted']=!0x0,this['fire']('conversationStarted',{'conversationId':this['id'],'selectedModel':this['selectedModel']});}catch(_0x150659){const _0x5a0519=new _0x25e143('ai-chat-conversation-start-failed',null,{'message':_0x150659['message'],'conversationId':this['id']});throw _0x5a0519['stack']=_0x150659['stack'],this['fire']('error',{'error':_0x5a0519}),_0x5a0519;}}async['load'](_0x148fd2,_0x525934){try{const _0x2e1f43=await this['connector']['fetchConversation'](_0x148fd2)['getConversation'](),_0x3ac570=await this['connector']['fetchConversationMessages'](_0x148fd2)['getMessages'](),_0x168bed=_0x3ac570[0x0]['model'];this['isStarted']=!0x0,this['id']=_0x2e1f43['id'],'title'in _0x2e1f43?this['fire']('setConversationTitle',_0x2e1f43['title'],!0x0):this['fire']('setConversationTitle','',!0x0);const _0x545cce=(await this['chatModels']['getAll']())['find'](_0x5a85c9=>_0x5a85c9['id']['toLowerCase']()===_0x168bed['toLowerCase']());return this['selectedModel']=_0x545cce,this['fire']('modelSelected',{'selectedModel':_0x545cce,'isDisabled':!0x0}),await this['_processMessagesToInteractions'](_0x3ac570,_0x525934,_0x168bed),this['currentInteraction']=void 0x0,this;}catch(_0x128221){const _0x634fd5=new _0x25e143('ai-chat-conversation-init-from-id-failed',null,{'message':_0x128221['message'],'conversationId':_0x148fd2});throw _0x634fd5['stack']=_0x128221['stack'],this['fire']('error',{'error':_0x634fd5}),_0x634fd5;}}async['_processMessagesToInteractions'](_0xa33899,_0x9f2ae9,_0x518f06){let _0x574059;for(const _0x49e144 of _0xa33899)if('user'===_0x49e144['role']){const _0x5b28fc=await this['_extractContextItems'](_0x49e144),_0x1f6c33={'isReasoningEnabled':Object['hasOwn'](_0x49e144['capabilities'],'reasoning'),'isWebSearchEnabled':Object['hasOwn'](_0x49e144['capabilities'],'webSearch')};_0x574059=this['createInteraction']({'userMessage':_0x49e144['prompt'],'contextItems':_0x5b28fc,'capabilities':_0x1f6c33,'modelId':_0x518f06,'quickActionData':_0x49e144['attributes']?.['quickActionData']}),this['currentInteraction']=_0x574059,this['chatContext']['addToConversationContext'](this['currentInteraction']['contextItems']);}else{if('assistant'===_0x49e144['role']&&_0x574059)for(const _0x5247e5 of _0x49e144['content']){const _0x401390='text'===_0x5247e5['type']?'text-delta':'modification-delta',_0x40fc9b=_0x574059['getDocumentContext']()?.['sessionId']!==_0x9f2ae9;_0x574059['currentReply']=_0x574059['createReply']({'type':_0x401390,'isDone':!0x0,'interactionId':_0x574059['id'],'areActionsDisabled':_0x40fc9b}),_0x574059['currentReply']['appendContent'](_0x5247e5['content']);}}}async['_extractContextItems'](_0x1a74d5){const _0x182896=new Map();if(!_0x1a74d5['content'])return _0x182896;for(const _0x26aacc of _0x1a74d5['content']){const _0x5a84db=await this['chatContext']['populateFromMessage'](_0x26aacc);_0x5a84db&&_0x182896['set'](_0x5a84db['id'],_0x5a84db);}return _0x182896;}async['handleUserInteraction']({userMessage:_0x19aeb1,quickActionData:_0x3639a2}){if(!this['isStarted'])throw new _0x25e143('ai-chat-handle-user-conversation-not-initialized',null,{'conversation':this});if(this['currentInteraction'])throw new _0x25e143('ai-chat-handle-user-interaction-already-in-progress',null,{'conversation':this});try{const _0x260167=this['chatContext']['getPendingContextItems'](),_0x44b0f6=this['chatCapabilities']['getCapabilitiesConfig'](),_0x5182bd=this['selectedModel']['id'];this['currentInteraction']=this['createInteraction']({'userMessage':_0x19aeb1,'contextItems':_0x260167,'capabilities':_0x44b0f6,'modelId':_0x5182bd,'quickActionData':_0x3639a2}),await this['currentInteraction']['start'](),this['chatContext']['addToConversationContext'](this['currentInteraction']['contextItems']);}catch(_0x335c38){if(_0x335c38 instanceof _0x25e143)this['fire']('error',{'interactionId':this['currentInteraction']?this['currentInteraction']['id']:void 0x0,'error':_0x335c38});else{const _0x3046b4=Fe['get'](_0x335c38['code'])||'ai-chat-handle-user-interaction-start-failed';this['fire']('error',{'interactionId':this['currentInteraction']?this['currentInteraction']['id']:void 0x0,'error':new _0x25e143(_0x3046b4,null,{'error':_0x335c38})});}}finally{this['currentInteraction']?.['stop'](),this['currentInteraction']=void 0x0;}}['createInteraction']({userMessage:_0xef9a5c,contextItems:_0x4c6487,capabilities:_0x189eb3,modelId:_0xfb9eb5,quickActionData:_0x56e15d}){const _0x56a001=new Ci({'userMessage':_0xef9a5c,'contextItems':_0x4c6487,'capabilities':_0x189eb3,'conversationId':this['id'],'connector':this['connector'],'editor':this['options']['getEditor']&&this['options']['getEditor'](),'model':_0xfb9eb5,'quickActionData':_0x56e15d});return _0x56a001['delegate'](...Ce)['to'](this),this['interactions']['push'](_0x56a001),this['fire']('interactionCreated',_0x56a001),_0x56a001;}['getInteraction'](_0x450306){return this['interactions']['find'](_0x34641d=>_0x34641d['id']===_0x450306);}['removeInteraction'](_0x2f7cde){const _0x467267=this['getInteraction'](_0x2f7cde);_0x467267&&(_0x467267['destroy'](),this['interactions']['splice'](this['interactions']['indexOf'](_0x467267),0x1));}get['lastInteraction'](){return this['interactions'][this['interactions']['length']-0x1];}['addCurrentDocumentToContext'](_0x469f31){this['chatContext']['addCurrentDocumentToContext'](_0x469f31);}async['updateCurrentDocumentInContext']({content:_0x583a76,version:_0x175684,sessionId:_0x58360c,selections:_0x3e7304}){await this['chatContext']['updateCurrentDocument'](_0x583a76,_0x175684,_0x58360c,_0x3e7304);}['getCurrentDocumentContext'](){return this['currentInteraction']?.['getDocumentContext']()?.['content']||'';}['addSelectionToContext'](_0x5c758c){this['chatContext']['addSelectionToContext'](_0x5c758c);}['removeSelectionFromContext'](){this['chatContext']['removeSelectionFromContext']();}['addFilesToContext'](_0x6eb37d){this['chatContext']['addFilesToContext'](_0x6eb37d);}['addUrlToContext'](_0x246a0f){this['chatContext']['addUrlToContext'](_0x246a0f);}['addResourceToContext'](_0xef16a4,_0x4577c5){this['chatContext']['addResourceToContext'](_0xef16a4,_0x4577c5);}['loadSourceResources'](_0x4e6c38,_0x306c38,_0xd20272){return this['chatContext']['loadSourceResources'](_0x4e6c38,_0x306c38,_0xd20272);}['removeFromContext'](_0xb77533){this['chatContext']['removeFromContext'](_0xb77533);}['toggleWebSearch'](){this['chatCapabilities']['toggleWebSearch']();}['toggleReasoning'](){this['chatCapabilities']['toggleReasoning']();}['isCurrentDocumentInContext'](){return this['chatContext']['isCurrentDocumentInContext']();}['isCurrentDocumentInConversation'](){return this['chatContext']['isCurrentDocumentInConversation']();}['isSelectionInContext'](){return this['chatContext']['isSelectionInContext']();}async['setModel'](_0x2bf52e){_0x2bf52e?!0x1===await this['chatModels']['isAvailable'](_0x2bf52e)&&(_0x17a23f('ai-chat-conversation-set-model-not-available',{'conversation':this,'model':_0x2bf52e}),_0x2bf52e=(await this['chatModels']['getAvailableModels']())[0x0]):(_0x17a23f('ai-chat-conversation-set-model-null',{'conversation':this}),_0x2bf52e=(await this['chatModels']['getAvailableModels']())[0x0]),_0x2bf52e['id']!==this['selectedModel']?.['id']&&(this['selectedModel']=_0x2bf52e,this['chatCapabilities']['reset'](),this['fire']('modelSelected',{'selectedModel':_0x2bf52e}));}}function q(_0x2b59df){if(_0x2b59df instanceof _t)return _0x2b59df;if(_0x2b59df?.['editors']&&_0x2b59df['editors']['get'](0x0))return _0x2b59df['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.'),_0x2b59df['editors']['get'](0x0);throw new _0x25e143('ai-get-editor-from-context-no-editor');}const It='ai-selection';class S extends _0x53b1cd{['_displayedFakeSelectionId']=null;['_displayedFakeSelectionLocked']=!0x1;['_sessionId'];static get['pluginName'](){return'AIEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}get['sessionId'](){if(!this['_sessionId']){const _0x284496=q(this['context']),_0x5b480d=_0x284496['plugins']['has']('RealTimeCollaborationClient')&&_0x284496['plugins']['get']('RealTimeCollaborationClient')['sessionId'];this['_sessionId']=_0x5b480d||_0x23a3b0();}return this['_sessionId'];}['getDocumentData'](){const _0x3e1d5d=q(this['context']),_0x2989b4=_0x3e1d5d['model'],_0x1b5079=_0x3e1d5d['data']['toView'](_0x2989b4['document']['getRoot'](),{'convertAiChatSelectionMarker':!0x0}),_0x13211d=new Ft(_0x3e1d5d['editing']['view']['document']);this['_setDataIdsOnChildren'](_0x1b5079,_0x13211d);let _0x422f69=_0x3e1d5d['data']['processor']['toData'](_0x1b5079);const _0x5bb5dc=this['_getMarkersInDocumentOrder'](),_0x374e98=[];for(const _0x41d962 of _0x5bb5dc){const _0x4ed6b2='<'+_0x41d962['name']+':start></'+_0x41d962['name']+':start>',_0x319b04=_0x422f69['indexOf'](_0x4ed6b2);_0x422f69=_0x422f69['substring'](0x0,_0x319b04)+_0x422f69['substring'](_0x319b04+_0x4ed6b2['length']);const _0x43e0aa='<'+_0x41d962['name']+':end></'+_0x41d962['name']+':end>',_0x1a878c=_0x422f69['indexOf'](_0x43e0aa);_0x422f69=_0x422f69['substring'](0x0,_0x1a878c)+_0x422f69['substring'](_0x1a878c+_0x43e0aa['length']),_0x374e98['push']({'markerName':_0x41d962['name'],'start':_0x319b04,'end':_0x1a878c,'htmlFragment':_0x422f69['substring'](_0x319b04,_0x1a878c)});}return{'content':_0x422f69,'version':_0x3e1d5d['model']['document']['version'],'sessionId':this['sessionId'],'selections':_0x374e98};}async['afterInit'](){this['context']instanceof _t?this['_integrateEditor'](this['context']):this['listenTo'](this['context']['editors'],'add',(_0x4e0aa2,_0x2cfad5)=>{_0x2cfad5['on']('ready',()=>{this['_integrateEditor'](_0x2cfad5);});});}['_integrateEditor'](_0x2003b4){_0x2003b4['conversion']['for']('editingDowncast')['markerToHighlight']({'model':It,'view':{'classes':['ck-fake-ai-selection','ck-ai-assistant-ui_theme'],'priority':0xc}}),_0x2003b4['conversion']['for']('dataDowncast')['markerToElement']({'model':It,'view':(_0x4b23cd,{writer:_0x55060c,options:_0x3eca18})=>_0x3eca18['convertAiChatSelectionMarker']?_0x55060c['createUIElement'](_0x4b23cd['markerName']+':'+(_0x4b23cd['isOpening']?'start':'end')):null});}['showFakeVisualSelection'](_0x1bd8e3,_0x13fd0f,_0x469838=!0x1,_0xb5ff33=!0x1){if(this['_displayedFakeSelectionLocked']&&!_0xb5ff33)return!0x1;const _0x486120=q(this['context'])['model'];return _0x486120['change'](_0x4f466e=>{this['_displayedFakeSelectionId']&&this['hideFakeVisualSelection'](this['_displayedFakeSelectionId']),this['_displayedFakeSelectionId']=_0x13fd0f,this['_displayedFakeSelectionLocked']=_0x469838;let _0x5957a3=0x0;for(let _0x44153f of _0x1bd8e3){const _0x54feab=It+':'+_0x5957a3;if(_0x44153f['start']['isAtEnd']){const _0x1f4b5c=_0x44153f['start']['getLastMatchingPosition'](({item:_0x465dbf})=>!_0x486120['schema']['isContent'](_0x465dbf),{'boundaries':_0x44153f});_0x44153f=_0x4f466e['createRange'](_0x1f4b5c,_0x44153f['end']);}_0x4f466e['addMarker'](_0x54feab,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x44153f}),_0x5957a3++;}}),window['getSelection']()?.['removeAllRanges'](),!0x0;}['hideFakeVisualSelection'](_0xd2677f){if(this['_displayedFakeSelectionId']!=_0xd2677f)return!0x1;this['_displayedFakeSelectionId']=null,this['_displayedFakeSelectionLocked']=!0x1;const _0x23ba3f=q(this['context']),_0x40cb1e=_0x23ba3f['model']['markers']['getMarkersGroup'](It);return _0x23ba3f['model']['change'](_0x50ceaa=>{for(const _0x33a097 of _0x40cb1e)_0x50ceaa['removeMarker'](_0x33a097);}),!0x0;}['modelToViewWithIds'](_0x30fb9f){const _0xded765=q(this['context']),_0x34dfe4=_0xded765['data']['toView'](_0x30fb9f),_0x4f4080=new Ft(_0xded765['editing']['view']['document']);return this['_setDataIdsOnChildren'](_0x34dfe4,_0x4f4080),_0x34dfe4;}['_setDataIdsOnChildren'](_0x4b45f5,_0x148d92){let _0xfae95b=!0x1;const _0x14dc10=new Set();for(const _0xacd866 of _0x4b45f5['getChildren']()){const _0x47ab0f=_0xacd866['is']('emptyElement')||_0xacd866['is']('containerElement');if(!_0xacd866['is']('element'))continue;(this['_setDataIdsOnChildren'](_0xacd866,_0x148d92)||_0x47ab0f)&&(_0x148d92['setAttribute']('data-id',this['_nextDataId'](_0x14dc10),_0xacd866),_0xfae95b=!0x0);}return _0xfae95b;}['_nextDataId'](_0x298234){let _0x37705a;do{_0x37705a='';for(let _0x47874c=0x0;_0x47874c<0x4;_0x47874c++)_0x37705a+=String['fromCharCode'](0x61+Math['floor'](0x1a*Math['random']()));}while(_0x298234['has'](_0x37705a));return _0x298234['add'](_0x37705a),_0x37705a;}['getSelectionText'](){const {model:_0x480bce}=q(this['context']),_0x43332d=_0x480bce['document']['selection'],_0x30808a=_0x480bce['getSelectedContent'](_0x43332d),_0x536d54=[],_0x546c98=_0x480bce['createRangeIn'](_0x30808a)['getWalker']();for(const {item:_0x55ca7c}of _0x546c98)_0x55ca7c['is']('$textProxy')?_0x536d54['push'](_0x55ca7c['data']):_0x55ca7c['is']('element')&&_0x536d54['length']>0x0&&'\x20'!==_0x536d54[_0x536d54['length']-0x1]&&_0x536d54['push']('\x20');return'\x22'+_0x536d54['join']('')['trim']()+'\x22';}['_getMarkersInDocumentOrder'](){const _0x22d9b0=q(this['context'])['model'];return Array['from'](_0x22d9b0['markers']['getMarkersGroup'](It))['sort']((_0x23c9a0,_0x41d554)=>_0x23c9a0['getStart']()['isBefore'](_0x41d554['getStart']())?-0x1:_0x23c9a0['getStart']()['isAfter'](_0x41d554['getStart']())?0x1:0x0);}}const H=['applySuggestion','insertSuggestion','showChangeInText'];class ah extends _0x55515f{['actionsButton'];['children'];['applySuggestionModel'];['showChangeInTextModel'];['insertSuggestionModel'];['_partsCount']=0x1;['_dropdownOriginalConfig'];['_dropdownCurrentConfig'];['_firstRender']=!0x0;constructor(_0x26f0f9,_0x110b0a){super(_0x26f0f9),this['_dropdownOriginalConfig']=_0x110b0a||[...H],this['_dropdownCurrentConfig']=[...this['_dropdownOriginalConfig']];const _0x2b496d=this['bindTemplate'];this['set']('isEnabled',!0x0),this['set']('isVisible',!0x0),this['set']('isTrackChangesOn',!0x1),this['applySuggestionModel']=new _0x57b857({'label':Pn('applySuggestion',_0x26f0f9,this['_partsCount']),'icon':_0x4ddb98,'withText':!0x0,'type':'button','actionName':'applySuggestion'}),this['showChangeInTextModel']=new _0x57b857({'label':Pn('showChangeInText',_0x26f0f9,this['_partsCount']),'icon':_0x129595,'withText':!0x0,'type':'button','actionName':'showChangeInText'}),this['insertSuggestionModel']=new _0x57b857({'label':Pn('insertSuggestion',_0x26f0f9,this['_partsCount']),'icon':_0xc643d7,'withText':!0x0,'type':'button','actionName':'insertSuggestion'}),this['actionsButton']=this['_createActionsDropdownOrButton'](_0x26f0f9),this['children']=this['createCollection'](),this['actionsButton']&&this['children']['add'](this['actionsButton']),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__ai-suggestion__actions',_0x2b496d['if']('isVisible','ck-hidden',_0xf284c3=>!_0xf284c3)]},'children':this['children']}),this['on']('change:isTrackChangesOn',()=>{this['_dropdownCurrentConfig']=this['isTrackChangesOn']?this['_dropdownOriginalConfig']['filter'](_0x40ea0a=>'applySuggestion'!==_0x40ea0a):[...this['_dropdownOriginalConfig']],this['_updateDropdownActions'](_0x26f0f9);});}['_updateDropdownActions'](_0x37573d){this['actionsButton']&&this['children']['has'](this['actionsButton'])&&(this['children']['remove'](this['actionsButton']),this['actionsButton']['destroy']()),this['actionsButton']=this['_createActionsDropdownOrButton'](_0x37573d),this['actionsButton']&&this['children']['add'](this['actionsButton']);}['_createActionsDropdownOrButton'](_0x4199f9){if(0x0==this['_dropdownCurrentConfig']['length'])return null;const _0x5c4371=0x1===this['_dropdownCurrentConfig']['length']?this['_createActionsButton'](_0x4199f9):this['_createActionsDropdown'](_0x4199f9),_0x28da25=this['_firstRender']?'':'ck-ai-chat__feed__ai-suggestion__actions--no-animation';_0x5c4371['set']({'label':Pn(this['_dropdownCurrentConfig'][0x0],_0x4199f9,this['_partsCount']),'tooltip':Hn(this['_dropdownCurrentConfig'][0x0],_0x4199f9,this['_partsCount']),'withText':!0x0,'class':'ck-ai-chat__feed__ai-suggestion__actions\x20'+_0x28da25});for(const _0x15e6d0 of this['_dropdownCurrentConfig'])_0x5c4371['on'](_0x15e6d0,()=>{this['fire'](_0x15e6d0);});return this['_firstRender']=!0x1,_0x5c4371;}['_createActionsButton'](_0x5a83a0){const _0x1ca018=new _0x5cf211(_0x5a83a0);return _0x1ca018['set']({'class':'ck-ai-button-primary','withText':!0x0}),_0x1ca018['on']('execute',()=>{_0x1ca018['fire'](this['_dropdownCurrentConfig'][0x0]);}),_0x1ca018;}['_createActionsDropdown'](_0x1eeb89){const _0x1d85b8=new Nn(_0x1eeb89,{'listItemModels':this['_dropdownCurrentConfig']['map'](_0x55875c=>{switch(_0x55875c){case'applySuggestion':return this['applySuggestionModel'];case'showChangeInText':return this['showChangeInTextModel'];case'insertSuggestion':return this['insertSuggestionModel'];}})});return _0x1d85b8['set']({'label':Pn(this['_dropdownCurrentConfig'][0x0],_0x1eeb89,this['_partsCount']),'tooltip':Hn(this['_dropdownCurrentConfig'][0x0],_0x1eeb89,this['_partsCount']),'withText':!0x0,'class':'ck-ai-chat__feed__ai-suggestion__actions','balloonPanelClass':'ck-ai-chat__feed__ai-suggestion__actions__balloon'}),_0x1d85b8['bind']('isEnabled')['to'](this),_0x1d85b8;}['updateLabels'](_0x5bba17){const _0x4d964b=this['locale'];this['_partsCount']=_0x5bba17||this['_partsCount'],this['actionsButton']['set']({'label':Pn(this['_dropdownCurrentConfig'][0x0],_0x4d964b,this['_partsCount']),'tooltip':Hn(this['_dropdownCurrentConfig'][0x0],_0x4d964b,this['_partsCount'])}),this['applySuggestionModel']['label']=Pn('applySuggestion',_0x4d964b,this['_partsCount']),this['showChangeInTextModel']['label']=Pn('showChangeInText',_0x4d964b,this['_partsCount']),this['insertSuggestionModel']['label']=Pn('insertSuggestion',_0x4d964b,this['_partsCount']);}}class Nn extends _0x4e347b{['bodyCollection'];['balloonPanelView'];['listView'];['keystrokeHandler'];constructor(_0x427cb9,_0x1d15ee){super(_0x427cb9),this['balloonPanelView']=new _0x564e6d(this['locale']),this['bodyCollection']=new _0x1008b4(this['locale']),this['bodyCollection']['attachToDom'](),this['set']('balloonPanelClass',''),this['balloonPanelView']['bind']('class')['to'](this,'balloonPanelClass'),this['listView']=this['_setUpList'](_0x1d15ee['listItemModels']['slice'](0x1)),this['bodyCollection']['add'](this['balloonPanelView']),this['balloonPanelView']['content']['add'](this['listView']),this['arrowView']['unbind']('tooltip'),this['arrowView']['set']('tooltip',i(this['locale'],'AI_CHAT_SUGGESTION_MORE_OPTIONS_TOOLTIP')),this['_setUpKeystrokes'](),this['on']('execute',()=>{const _0x1946ec=_0x1d15ee['listItemModels'][0x0]['actionName'];this['fire'](_0x1946ec),this['balloonPanelView']['hide'](),this['arrowView']['focus']();}),this['on']('open',()=>{this['balloonPanelView']['isVisible']?(this['balloonPanelView']['hide'](),this['arrowView']['focus']()):(this['balloonPanelView']['pin']({'target':this['element'],'positions':['ltr'===this['locale']['uiLanguageDirection']?Gn:yn]}),this['listView']['focus']());}),_0x1411c6({'emitter':this['balloonPanelView'],'callback':()=>{this['balloonPanelView']['hide']();},'activator':()=>this['balloonPanelView']['isVisible'],'contextElements':()=>[this['element'],this['balloonPanelView']['element']]});}['_setUpList'](_0x36a6e0){const _0x2822cf=this['locale'],_0x114751=new _0x429409(_0x2822cf);for(const _0x57abb7 of _0x36a6e0){const _0x18dec5=new _0x5f38b9(_0x2822cf),_0x36434e=new _0xe41030(_0x2822cf);_0x36434e['bind'](...Object['keys'](_0x57abb7))['to'](_0x57abb7),_0x36434e['delegate']('execute')['to'](_0x114751),_0x18dec5['children']['add'](_0x36434e),_0x114751['items']['add'](_0x18dec5);}return _0x114751['items']['delegate']('execute')['to'](this),_0x114751['on']('execute',_0x30ff2a=>{const _0x28a8b2=_0x30ff2a['source'];this['fire'](_0x28a8b2['actionName']),this['balloonPanelView']['hide'](),this['arrowView']['focus']();}),_0x114751;}['_setUpKeystrokes'](){this['keystrokeHandler']=new _0x1b5c14(),this['keystrokeHandler']['listenTo'](this['balloonPanelView']['element']),this['keystrokeHandler']['set']('esc',(_0xc0bb35,_0x182d70)=>{this['balloonPanelView']['hide'](),this['arrowView']['focus'](),_0x182d70();});}['destroy'](){super['destroy'](),this['keystrokeHandler']['destroy'](),this['balloonPanelView']['destroy'](),this['bodyCollection']['detachFromDom']();}}function Gn(_0xc36097){return{'top':_0xc36097['bottom'],'left':_0xc36097['left'],'name':'arrowless','config':{'withArrow':!0x1}};}function yn(_0x26cf5c,_0x256be8){return{'top':_0x26cf5c['bottom'],'left':_0x26cf5c['left']-(_0x256be8['width']-_0x26cf5c['width']),'name':'arrowless','config':{'withArrow':!0x1}};}function Pn(_0x231ff8,_0x1935dd,_0x448634){switch(_0x231ff8){case'applySuggestion':return i(_0x1935dd,'AI_CHAT_SUGGESTION_ACTION_APPLY_LABEL',_0x448634);case'showChangeInText':return i(_0x1935dd,'AI_CHAT_SUGGESTION_ACTION_SHOW_CHANGE_IN_TEXT',_0x448634);case'insertSuggestion':return i(_0x1935dd,'AI_CHAT_SUGGESTION_ACTION_INSERT_SUGGESTION',_0x448634);}}function Hn(_0x1e8f7f,_0x1296c8,_0x36f667){switch(_0x1e8f7f){case'applySuggestion':return i(_0x1296c8,'AI_CHAT_SUGGESTION_ACTION_APPLY_TOOLTIP',_0x36f667);case'showChangeInText':return i(_0x1296c8,'AI_CHAT_SUGGESTION_ACTION_SHOW_CHANGE_IN_TEXT_TOOLTIP',_0x36f667);case'insertSuggestion':return i(_0x1296c8,'AI_CHAT_SUGGESTION_ACTION_INSERT_SUGGESTION_TOOLTIP',_0x36f667);}}class At extends _0x32571c(){['_connector'];['_availableModels'];['_defaultModelId'];['_locale'];['_modelList']=[];constructor({connector:_0x19a660,availableModels:_0x51c057,defaultModelId:_0x37f9c1,locale:_0x3fdb3e}){super(),this['_connector']=_0x19a660,this['_availableModels']=_0x51c057,this['_defaultModelId']=_0x37f9c1,this['_locale']=_0x3fdb3e;}async['getAll'](){if(!this['_modelList']['length'])try{const _0x52b072=this['_locale']['uiLanguage']||'en',_0x4d58a4=this['_connector']['getModels'](_0x52b072),_0x1a81d3=await _0x4d58a4['list']();this['_modelList']=_0x1a81d3['items']['map'](_0x2954c0=>ze(_0x2954c0)?{..._0x2954c0,'name':i(this['_locale'],'AI_MODEL_NAME_AUTO')}:_0x2954c0);}catch(_0xfb83c0){throw ft('ai-models-unable-to-retrieve',{'error':_0xfb83c0}),_0xfb83c0;}return[...this['_modelList']];}async['getAvailableModels'](){const _0x3351ed=await this['getAll']();return this['_filterModels'](_0x3351ed,this['_availableModels']);}async['getModel'](_0x498e00){const _0x5f4559=await this['getAll']();if(!_0x5f4559['length'])return null;if(_0x498e00){const _0xb9569=this['_getModelById'](_0x5f4559,_0x498e00);if(_0xb9569)return _0xb9569;_0x17a23f('ai-chat-model-id-unrecognized',{'modelId':_0x498e00,'fallBackModelId':this['_defaultModelId']});}return this['getDefault']();}async['getDefault'](){const _0x5c248f=await this['getAvailableModels']();if(!_0x5c248f['length'])return null;if(this['_defaultModelId']){const _0x203c8f=this['_getModelById'](_0x5c248f,this['_defaultModelId']);if(_0x203c8f)return _0x203c8f;_0x17a23f('ai-chat-default-model-id-unrecognized',{'defaultModelId':this['_defaultModelId'],'fallBackModelId':_0x5c248f[0x0]['id']});}return _0x5c248f[0x0];}async['isAvailable'](_0x42da77){return(await this['getAvailableModels']())['some'](_0x19d2ad=>_0x19d2ad['name']===_0x42da77['name']&&_0x19d2ad['provider']===_0x42da77['provider']);}['_filterModels'](_0x31baf9,_0x221cfa){let _0x5664f1;if(_0x221cfa){_0x5664f1=[];const _0x440f37='string'==typeof _0x221cfa?[_0x221cfa['toLocaleLowerCase']()]:_0x221cfa['map'](_0x1a63ee=>_0x1a63ee['toLocaleLowerCase']());for(const _0x5d9603 of _0x440f37)for(const _0x4619c6 of _0x31baf9)(_0x4619c6['id']['toLocaleLowerCase']()===_0x5d9603||_0x4619c6['name']['toLocaleLowerCase']()===_0x5d9603||ze(_0x4619c6)&&'auto'===_0x5d9603||_0x4619c6['provider']['toLocaleLowerCase']()===_0x5d9603||_0x4619c6['id']['toLocaleLowerCase']()['startsWith'](_0x5d9603))&&_0x5664f1['push'](_0x4619c6);}else _0x5664f1=_0x31baf9;return _0x5664f1;}['_getModelById'](_0x30547f,_0x2e01c0){return _0x30547f['find'](_0x437668=>ze(_0x437668)&&'auto'===_0x2e01c0?_0x437668:_0x437668['id']===_0x2e01c0)||null;}}function ze(_0x1f81c3){return _0x1f81c3['id']['startsWith']('agent');}function at({editor:_0x548b09,interaction:_0x4a8f1b,reply:_0x3ab2f9,groups:_0x28af93,transform:_0x966267,documentCompare:_0x14e47a,documentCompareOptions:_0x5c26fb}){const _0x278af3=_0x4a8f1b['getDocumentContext']();if(!_0x278af3)return[];const _0x5283bf=_0x278af3['content'],_0x10f10f=_0x278af3['version'],_0x53faad=_0x3ab2f9['documentContextContent']['cloneNode'](!0x0);for(const {changes:_0x3970b7}of _0x28af93){const _0x25197d=_0x3970b7['filter'](_0x4669be=>'new'!=_0x4669be['type'])['map'](_0x5251aa=>Dt('data-id',_0x5251aa['id'],_0x53faad)),_0x3a4916=_0x3970b7['filter'](_0x570cf3=>'removed'!=_0x570cf3['type'])['map'](_0x32e1d4=>_0x32e1d4['node']['cloneNode'](!0x0));let _0x3bb6f8=null;if(_0x25197d['length']){_0x3bb6f8=_0x25197d[0x0]['previousSibling'];for(let _0x7eede0=0x0;_0x7eede0<_0x25197d['length'];_0x7eede0++)_0x14435b(_0x25197d[_0x7eede0]);}if(_0x3a4916['length']){_0x3bb6f8||(_0x3970b7[0x0]['anchorId']?_0x3bb6f8=Dt('data-id',_0x3970b7[0x0]['anchorId'],_0x53faad):(_0x3bb6f8=_0x3a4916['shift'](),_0x877764(_0x53faad,_0x3bb6f8)));for(let _0x2f97c3=0x0;_0x2f97c3<_0x3a4916['length'];_0x2f97c3++)_0x41729d(_0x3bb6f8,_0x3a4916[_0x2f97c3]),_0x3bb6f8=_0x3a4916[_0x2f97c3];}}const _0x269991=Ot(_0x53faad),_0x4670eb=_0x14e47a['getDiff'](_0x5283bf,_0x269991,_0x5c26fb)['getOperations']();if(_0x966267){const _0x476b1f=_0x548b09['model']['document']['history']['getOperations'](_0x10f10f),_0x1d85a1={'document':_0x548b09['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1};return gt(_0x4670eb,_0x476b1f,_0x1d85a1)['operationsA'];}return _0x4670eb;}function rt(_0x80e14,_0xb793ab){if('marker'!=_0xb793ab['type'])return;const _0x427bbd=_0x80e14['model']['markers']['get'](_0xb793ab['name']);_0x427bbd&&(_0xb793ab['oldRange']=_0x427bbd['getRange']());}class Lr extends _0x58f977{['copyButton'];['likeButton'];['dislikeButton'];['showChangesButton'];['_config'];constructor(_0x2ca2d5,_0x3ad370={},_0x53f5ec){super(_0x2ca2d5),this['set']('isLoading',!0x1),this['_config']={'showCopy':!0x1,'showLike':!0x1,'showDislike':!0x1,..._0x3ad370};const _0x14ccb5=!(this['_config']['showCopy']||this['_config']['showChanges']||this['_config']['showLike']||this['_config']['showDislike']||this['_config']['customView']?.['length']);this['class']=_0x14ccb5?'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'](_0x53f5ec),this['items']['add'](this['showChangesButton'])),this['_setupRatingButtons'](),this['_config']['showLike']&&this['items']['add'](this['likeButton']),this['_config']['showDislike']&&this['items']['add'](this['dislikeButton']),this['_config']['customView']&&this['items']['addMany'](this['_config']['customView']);}['_setupRatingButtons'](){this['likeButton']=new _0x5cf211(this['locale']),this['likeButton']['set']({'icon':_0x1d8b6d,'label':i(this['locale'],'AI_MINI_TOOLBAR_LIKE'),'tooltip':!0x0}),this['likeButton']['bind']('isEnabled')['to'](this,'isLoading',_0xa59c89=>!_0xa59c89),this['likeButton']['on']('execute',()=>{this['fire']('like');}),this['dislikeButton']=new _0x5cf211(this['locale']),this['dislikeButton']['set']({'icon':_0x33f3ae,'label':i(this['locale'],'AI_MINI_TOOLBAR_DISLIKE'),'tooltip':!0x0}),this['dislikeButton']['bind']('isEnabled')['to'](this,'isLoading',_0x23985b=>!_0x23985b),this['dislikeButton']['on']('execute',()=>{this['fire']('dislike');});}['_setupCopyButton'](){this['copyButton']=new _0x5cf211(this['locale']),this['copyButton']['set']({'icon':_0x1d15d2,'label':i(this['locale'],'AI_MINI_TOOLBAR_COPY'),'class':'ck-ai-mini-toolbar-copy-button','tooltip':!0x0}),this['copyButton']['bind']('isEnabled')['to'](this,'isLoading',_0x1f3c0d=>!_0x1f3c0d);const _0x158b27=new _0x1e0173();_0x158b27['set']({'content':_0x563475}),_0x158b27['extendTemplate']({'attributes':{'class':['ck-ai-mini-toolbar-copy-button__check-mark']}}),this['copyButton']['on']('execute',()=>{this['copyButton']['class']='ck-ai-mini-toolbar-copy-button\x20ck-ai-mini-toolbar-copy-button_copied',setTimeout(()=>{this['copyButton']['class']='ck-ai-mini-toolbar-copy-button';},0x7d0);}),this['copyButton']['children']['add'](_0x158b27);}['_setupShowChangesButton'](_0x2e2801){this['showChangesButton']=new _0x5cf211(this['locale']),this['showChangesButton']['set']({'icon':it,'label':i(this['locale'],'AI_SUGGESTION_BUTTON_SHOW_CHANGES'),'withText':'full'==this['_config']['showChanges'],'tooltip':'full'!=this['_config']['showChanges'],'isOn':_0x2e2801}),this['showChangesButton']['bind']('isEnabled')['to'](this,'isLoading',_0x3a920f=>!_0x3a920f),this['showChangesButton']['on']('execute',()=>{const _0xa38e1a=!this['showChangesButton']['isOn'];this['showChangesButton']['set']({'isOn':_0xa38e1a,'icon':_0xa38e1a?_0x50fe49:it}),this['fire']('toggleShowChanges',_0xa38e1a);});}}class Tr extends _0x55515f{['showChangesToggleView'];constructor(_0xebfa0b,_0x3c8650){super(_0xebfa0b),this['set']('isShowChangesToggleVisible',!0x0),this['showChangesToggleView']=new Yr(_0xebfa0b),this['showChangesToggleView']['set']({'class':'ck-ai-suggestion__header__show-changes-toggle\x20ck-ai-chat-controls-button','label':i(_0xebfa0b,'AI_SUGGESTION_BUTTON_SHOW_CHANGES'),'withText':!0x0}),this['showChangesToggleView']['isOn']=_0x3c8650['showDiff'],this['showChangesToggleView']['bind']('isVisible')['to'](this,'isShowChangesToggleVisible'),this['showChangesToggleView']['bind']('icon')['to'](this['showChangesToggleView'],'isOn',_0x323526=>_0x323526?_0x335011:_0x5aba39),this['showChangesToggleView']['on']('execute',()=>{this['showChangesToggleView']['isOn']=!this['showChangesToggleView']['isOn'],this['fire']('toggleShowChanges',{'isOn':this['showChangesToggleView']['isOn']});});const _0x386d87=new _0x1e0173();_0x386d87['content']=_0x35c5f2,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__header',!0x1===_0x3c8650['showHeader']?'ck-hidden':null]['filter'](Boolean)},'children':[_0x386d87,{'tag':'span','children':[i(_0xebfa0b,'AI_SUGGESTION_HEADER_TITLE')]},this['showChangesToggleView']]});}}class Yr extends _0x5cf211{['render'](){super['render'](),this['children']['remove'](this['iconView']),this['children']['add'](this['iconView']);}}class ha{['options'];['isStreaming']=!0x1;['document']=null;['nodesList']=[];['currentIndex']=0x0;['timeoutAbortController']=null;constructor(_0x36015d){this['options']={'delay':_0x36015d['delay']??0x14,'textNodeStyle':_0x36015d['textNodeStyle'],'onStreamUpdate':_0x36015d['onStreamUpdate']||(()=>{})};}async['stream']({document:_0x17c10a,targetElement:_0x3d0187,abortSignal:_0x41a5ba}){this['isStreaming']&&this['stop'](),_0x41a5ba?.['addEventListener']('abort',this['stop']['bind'](this)),this['document']=_0x4b2836(_0x17c10a,!0x0),this['nodesList']=this['getParsedDocumentNodeList'](),this['isStreaming']=!0x0,this['currentIndex']>this['nodesList']['length']&&(_0x17a23f('ai-html-streamer-current-index-out-of-bounds',{'currentIndex':this['currentIndex'],'nodeList':this['nodesList']}),this['currentIndex']=this['nodesList']['length']);for(let _0x4a0c84=0x0;_0x4a0c84<this['currentIndex'];_0x4a0c84++)this['nodesList'][_0x4a0c84]['shouldBeStreamed']=!0x0;let _0x1cbf03=0x0;for(let _0x331491=this['currentIndex'];_0x331491<this['nodesList']['length'];_0x331491++){const _0x139b2b=Date['now'](),_0x577bd1=this['nodesList'][_0x331491],_0x3f04b8=_0x139b2b-_0x1cbf03;_0x577bd1['shouldBeStreamed']=!0x0;let _0x2491ec=_0x577bd1['parent'];for(;_0x2491ec;)_0x2491ec['shouldBeStreamed']=!0x0,_0x2491ec=_0x2491ec['parent'];if(_0x3f04b8<this['options']['delay'])try{const {promise:_0x402d4c,abortController:_0x10785b}=pr(this['options']['delay']-_0x3f04b8);this['timeoutAbortController']=_0x10785b,await _0x402d4c;}catch(_0x3745c9){return;}_0x1113d2(_0x3d0187,'<'+_0x3d0187['tagName']+'>'+this['renderNode'](this['document'])+'</'+_0x3d0187['tagName']+'>',{'childrenOnly':!0x0}),this['options']['onStreamUpdate']&&this['options']['onStreamUpdate'](),this['currentIndex']=_0x331491,_0x1cbf03=Date['now']();}this['isStreaming']=!0x1;}['cleanUpAnimations']({targetElement:_0x1b7df7}){Array['from'](_0x1b7df7['querySelectorAll']('span[data-ck-html-streamer-word-chunk]'))['reverse']()['forEach'](_0x929a43=>{_0x929a43['replaceWith'](_0x929a43['childNodes'][0x0]);});}['stop'](){this['isStreaming']=!0x1,this['timeoutAbortController']&&(this['timeoutAbortController']['abort'](),this['timeoutAbortController']=null);}['renderNode'](_0x4c8eef){let _0x28c060='';if(function(_0x4ae3c8){return _0x38319d(_0x4ae3c8);}(_0x4c8eef)){for(const _0x1d8792 of _0x4c8eef['children'])_0x28c060+=this['renderNode'](_0x1d8792);}else{if(dr(_0x4c8eef)){if(!_0x4c8eef['shouldBeStreamed'])return'';const _0x3365d2=_0x4c8eef,_0x1986fb=Object['entries'](_0x3365d2['attribs'])['map'](([_0x408035,_0x5a6aae])=>_0x408035+'=\x22'+_0x5a6aae+'\x22')['join']('\x20');_0x28c060+='<'+_0x3365d2['tagName']+(_0x1986fb?'\x20'+_0x1986fb:'')+'>';for(const _0x278e3e of _0x4321d2(_0x3365d2))_0x28c060+=this['renderNode'](_0x278e3e);_0x28c060+='</'+_0x3365d2['tagName']+'>';}else{if(!ar(_0x4c8eef))return'';if(!_0x4c8eef['shouldBeStreamed'])return'';!function(_0x360239){if(!_0x360239['parent']||!dr(_0x360239['parent']))return!0x1;if(!cr['includes'](_0x360239['parent']['tagName']))return!0x1;return!_0xa8cf5e(_0x360239)['match'](/^\s*[<>]\s*$/);}(_0x4c8eef)?_0x28c060+=_0x3ae693(_0x4c8eef):_0x28c060+=_0x3ae693(new _0x4a04d5('span',{'data-ck-html-streamer-word-chunk':'','style':this['options']['textNodeStyle']},[_0x4c8eef]));}}return _0x28c060;}['getParsedDocumentNodeList'](){const _0x343931=[];return function(_0x4681bd,_0x3d4157){const _0x4fe413=_0x10d7ec=>{if(_0x3d4157(_0x10d7ec),_0x10d7ec instanceof _0x4a4ac6)for(let _0x1599a7=0x0;_0x1599a7<_0x10d7ec['children']['length'];_0x1599a7++){const _0x2d33b3=_0x10d7ec['children'][_0x1599a7];_0x4fe413(_0x2d33b3);}};for(let _0x172f87=0x0;_0x172f87<_0x4681bd['children']['length'];_0x172f87++)_0x4fe413(_0x4681bd['children'][_0x172f87]);}(this['document'],_0xb109dd=>{if(ar(_0xb109dd)){const _0x20de8c=this['splitTextNodeIntoWordNodes'](_0xb109dd);_0x20de8c['length']&&_0x343931['push'](..._0x20de8c);}_0xb109dd['isWordSplitSource']||_0xb109dd['isWordSplitResult']||_0x343931['push'](_0xb109dd);}),_0x343931;}['splitTextNodeIntoWordNodes'](_0x283047){if(_0x283047['isWordSplitSource']||_0x283047['isWordSplitResult'])return[];const _0x646ba=_0xa8cf5e(_0x283047)['match'](/(?:\s*\S+\s*)/g),_0x403139=[];if(_0x646ba&&_0x646ba['length']>0x1){for(const _0x237bd9 of _0x646ba){const _0x403a6e=new _0x7b02c2(_0x237bd9);_0x403a6e['isWordSplitResult']=!0x0,_0x5f0e2c(_0x283047,_0x403a6e),_0x403139['push'](_0x403a6e);}_0x283047['isWordSplitSource']=!0x0,_0x14435b(_0x283047);}return _0x403139;}}const cr=['p','li','td','th','span','h1','h2','h3','h4','h5','h6','b','strong','i','em','mark','del','ins','sup','sub','a','code','div'];function ar(_0x4ac460){return _0xbc520a(_0x4ac460);}function dr(_0x5c3cb5){return _0x1817c0(_0x5c3cb5);}function pr(_0x4afecd){const _0x9e618d=new AbortController();return{'promise':new Promise((_0x5d1047,_0x463945)=>{const _0x7b9747=setTimeout(_0x5d1047,_0x4afecd);_0x9e618d['signal']['addEventListener']('abort',()=>{clearTimeout(_0x7b9747),_0x463945();});}),'abortController':_0x9e618d};}const Ee=['showChangeInText','insertSuggestion','applySuggestion','rejectSuggestion','mouseOverSuggestion','mouseLeaveSuggestion','toggleSuggestionDisplayMode','like','dislike'];class na extends _0x55515f{['htmlStreamer'];['children'];['headerView'];['contentView'];constructor(_0x25de91,{part:_0x46e19f,uiIndex:_0x49bdcf,areActionsDisabled:_0x3f36dd,availableActions:_0x12930c}){super(_0x25de91),this['set']('partDefinition',_0x46e19f),this['set']('state','pending'),this['set']('isVisible',!0x1),this['bind']('isEnabled')['to'](this,'state',_0x109724=>'pending'==_0x109724&&!_0x3f36dd),this['children']=this['createCollection'](),this['htmlStreamer']=new ha({'textNodeStyle':'animation:\x20ck-html-streamer-fade-in\x20.5s','delay':0x14}),this['headerView']=new Un(_0x25de91,{'part':_0x46e19f,'uiIndex':_0x49bdcf,'availableActions':_0x12930c}),this['headerView']['bind']('partDefinition')['to'](this),this['headerView']['bind']('isEnabled')['to'](this),this['headerView']['bind']('state')['to'](this),this['headerView']['delegate'](...Ee)['to'](this);const _0x2fb448=this['bindTemplate'];this['contentView']=new _0x55515f(),this['contentView']['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content','ck-reset_all-excluded','ck-ai-suggestion__body__content-part__content']}}),this['children']['addMany']([this['contentView']]),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__body__content-part',_0x2fb448['to']('state',_0x18f690=>'ck-ai-suggestion__body__content-part_'+_0x18f690),_0x2fb448['to']('isEnabled',_0xb6f8ac=>_0xb6f8ac?'ck-ai-suggestion__body__content-part_active':void 0x0),_0x2fb448['if']('isVisible','ck-hidden',_0x631c70=>!_0x631c70)]},'children':this['children'],'on':{'mouseenter':_0x2fb448['to'](()=>{this['isEnabled']&&this['fire']('mouseOverSuggestion',{'index':_0x46e19f['index']});}),'mouseleave':_0x2fb448['to'](()=>{this['isEnabled']&&this['fire']('mouseLeaveSuggestion',{'index':_0x46e19f['index']});})}});}async['updateContent']({part:_0x523975,renderingStrategy:_0x4d44f8,showUnchangedParts:_0x306275=!0x1,abortSignal:_0x83611e}){this['partDefinition']=_0x523975,this['isVisible']=this['partDefinition']['hasChanges']||_0x306275,this['isVisible']&&('streaming'===_0x4d44f8?await this['htmlStreamer']['stream']({'document':this['partDefinition']['content'],'targetElement':this['contentView']['element'],'abortSignal':_0x83611e}):this['contentView']['element']['innerHTML']=Ot(this['partDefinition']['content']));}['toggleHeader'](_0x1c7096){_0x1c7096?this['children']['has'](this['headerView'])||this['children']['add'](this['headerView'],0x0):this['children']['has'](this['headerView'])&&this['children']['remove'](this['headerView']);}}class Un extends _0x55515f{['children'];['_toolbarView'];['_iconStateAccepted'];['_iconStateRejected'];['_iconStateOutdated'];constructor(_0x999664,{part:_0x45a937,uiIndex:_0xd62769,availableActions:_0x3012db}){super(_0x999664),this['set']('partDefinition',_0x45a937),this['set']('isEnabled',!0x0),this['set']('state','pending');const _0x1506c3=new _0x1e0173();_0x1506c3['content']=_0x21063c,_0x1506c3['extendTemplate']({'attributes':{'class':['ck-ai-suggestion__body__content-part__icon-title']}});const _0x114ecf=[];if(_0x3012db['includes']('showChangeInText')){const _0x4971d5=new _0x5cf211(_0x999664);_0x4971d5['set']({'label':i(_0x999664,'AI_SUGGESTION_CONTENT_PART_SHOW_IN_THE_TEXT'),'tooltip':!0x0,'withText':!0x1,'icon':_0x129595}),_0x4971d5['bind']('isEnabled')['to'](this),_0x4971d5['on']('execute',()=>{this['fire']('showChangeInText',{'index':_0x45a937['index']});}),_0x114ecf['push'](_0x4971d5);}if(_0x3012db['includes']('insertSuggestion')){const _0x4e5a34=new _0x5cf211(_0x999664);_0x4e5a34['set']({'label':i(_0x999664,'AI_SUGGESTION_CONTENT_PART_ADD_AS_SUGGESTION'),'tooltip':!0x0,'withText':!0x1,'icon':_0xc643d7}),_0x4e5a34['bind']('isEnabled')['to'](this),_0x4e5a34['on']('execute',()=>{this['fire']('insertSuggestion',{'index':_0x45a937['index']});}),_0x114ecf['push'](_0x4e5a34);}const _0x598326=new _0x5cf211(_0x999664);_0x598326['set']({'label':i(_0x999664,'AI_SUGGESTION_CONTENT_PART_DELETE'),'tooltip':!0x0,'withText':!0x1,'icon':_0x42b293}),_0x598326['bind']('isEnabled')['to'](this),_0x598326['on']('execute',()=>{this['fire']('rejectSuggestion',{'index':_0x45a937['index']});}),_0x114ecf['push'](_0x598326),this['_toolbarView']=new _0x58f977(_0x999664),this['_toolbarView']['items']['addMany'](_0x114ecf),this['_iconStateAccepted']=new _0x1e0173(),this['_iconStateAccepted']['content']=_0x2fd74b,this['_iconStateAccepted']['extendTemplate']({'attributes':{'class':['ck-ai-suggestion__body__content-part__icon-accepted'],'data-cke-tooltip-text':i(_0x999664,'AI_SUGGESTION_CONTENT_PART_ALREADY_APPLIED'),'data-cke-tooltip-position':'n'}}),this['_iconStateRejected']=new _0x1e0173(),this['_iconStateRejected']['content']=_0x4dc8b7,this['_iconStateRejected']['extendTemplate']({'attributes':{'class':['ck-ai-suggestion__body__content-part__icon-rejected'],'data-cke-tooltip-text':i(_0x999664,'AI_SUGGESTION_CONTENT_PART_REJECTED'),'data-cke-tooltip-position':'n'}}),this['_iconStateOutdated']=new _0x1e0173(),this['_iconStateOutdated']['content']=_0x4dc8b7,this['_iconStateOutdated']['extendTemplate']({'attributes':{'class':['ck-ai-suggestion__body__content-part__icon-outdated'],'data-cke-tooltip-text':i(_0x999664,'AI_SUGGESTION_CONTENT_PART_OUTDATED'),'data-cke-tooltip-position':'n'}});const _0x5363e1=new _0x55515f(_0x999664);_0x5363e1['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-suggestion__body__content-part__title__label']},'children':[i(_0x999664,'AI_SUGGESTION_CONTENT_PART_TITLE',_0xd62769['toString']())]}),this['children']=this['createCollection'](),this['children']['addMany']([_0x1506c3,_0x5363e1,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',(_0x54033a,_0x2d22e8,_0x3275fe,_0x1155e9)=>{switch(_0x1155e9){case'pending':this['children']['remove'](this['_toolbarView']);break;case'accepted':this['children']['remove'](this['_iconStateAccepted']);break;case'rejected':this['children']['remove'](this['_iconStateRejected']);break;case'outdated':this['children']['remove'](this['_iconStateOutdated']);}switch(_0x3275fe){case'pending':this['children']['add'](this['_toolbarView']);break;case'accepted':this['children']['add'](this['_iconStateAccepted']);break;case'rejected':this['children']['add'](this['_iconStateRejected']);break;case'outdated':this['children']['add'](this['_iconStateOutdated']);}});}}class et extends _0x32571c(){['queue']=[];['isProcessing']=!0x1;['_abortController'];async['enqueue'](_0x5436f6){const _0x418dc4=this['createTask'](_0x5436f6);return this['queue']['push'](_0x418dc4),this['_processQueue'](),_0x418dc4['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(_0x17af91=>{this['once']('_queueEmpty',()=>{_0x17af91();});}):Promise['resolve']();}async['_processQueue'](){if(!this['isProcessing']){this['_abortController']=new AbortController(),this['isProcessing']=!0x0;try{for(;this['queue']['length']&&this['isProcessing'];){const _0x36dd17=this['queue']['shift']();try{await _0x36dd17['callback'](this['_abortController']['signal']),_0x36dd17['resolve']();}catch(_0xbcd87b){_0x36dd17['reject'](_0xbcd87b);}}}finally{this['isProcessing']=!0x1,this['_abortController']=void 0x0;}this['fire']('_queueEmpty');}}['createTask'](_0x478cd3){let _0x181f86,_0x45e93f;const _0x1eb440=new Promise((_0x321e1e,_0x5f277d)=>{_0x181f86=_0x321e1e,_0x45e93f=_0x5f277d;});return{'callback':_0x478cd3,'resolve':_0x181f86,'reject':_0x45e93f,'completePromise':_0x1eb440};}}class Fr extends _0x55515f{['options'];['content']='';['htmlStreamer'];['children'];constructor(_0x3738ab){super();const _0x29f779=this['bindTemplate'];this['set']('isDone',!0x1),this['set']('isVisible',!0x0),this['htmlStreamer']=new ha({'textNodeStyle':'animation:\x20ck-html-streamer-fade-in\x20.5s','delay':0x14}),this['options']=_0x3738ab,this['children']=this['createCollection'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__item',_0x29f779['if']('isDone','ck-ai-chat__feed__item_done'),_0x29f779['if']('isVisible','ck-hidden',_0x1f136b=>!_0x1f136b),'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'](_0x39f17a=>{_0x39f17a['removeAttribute']('data-id');}),this['isDone']=!0x0;}async['streamIntoElement'](_0x5f196f,_0x4e6e07,_0x33898d){await this['htmlStreamer']['stream']({'document':_0x5f196f,'targetElement':_0x4e6e07,'abortSignal':_0x33898d});}}class Oe extends Fr{constructor(_0x359756){super(_0x359756),this['extendTemplate']({'attributes':{'class':['ck-ai-notification','warning'===_0x359756['level']?'ck-ai-notification_warning':'ck-ai-notification_error']}});}['render'](){super['render'](),this['setContent'](this['options']['initialContent']),this['markAsDone']();}['setContent'](_0x29aae5){this['element']['innerHTML']=_0x29aae5;}}class Dr extends _0x55515f{['_children'];['_areActionsDisabled'];['_showUnchangedParts'];['_updateContentPartsPromiseQueue'];['_emptyPartsWarningView'];['_availableActions'];['_cachedContentParts']=[];constructor(_0x31c04b,_0x4d7e2b){super(_0x31c04b);const {areActionsDisabled:_0x55e196,showUnchangedParts:_0x1afbc3,availableActions:_0x30cf58}=_0x4d7e2b;this['_areActionsDisabled']=_0x55e196,this['_showUnchangedParts']=_0x1afbc3,this['_availableActions']=_0x30cf58,this['set']('hasPendingParts',!0x1),this['_children']=this['createCollection'](),this['_updateContentPartsPromiseQueue']=new et(),this['_emptyPartsWarningView']=new Oe({'id':'empty-parts-warning','initialContent':i(_0x31c04b,'AI_SUGGESTION_EMPTY_PART_WARNING'),'level':'warning'}),this['_emptyPartsWarningView']['isVisible']=!0x1,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__body']},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__body__content-parts']},'children':this['_children']},this['_emptyPartsWarningView']]});}get['partsCount'](){return this['_children']['length'];}async['updateContentParts']({parts:_0x4e726d,renderingStrategy:_0x4dab83,abortSignal:_0x2b345e}){this['_children']['length']?_0x4e726d['forEach'](_0x28475a=>{const _0x16f51f=this['_cachedContentParts']['findIndex'](_0x53cb0c=>_0x53cb0c['index']==_0x28475a['index']);-0x1===_0x16f51f?this['_cachedContentParts']['push'](_0x28475a):this['_cachedContentParts'][_0x16f51f]=_0x28475a;}):this['_cachedContentParts']=_0x4e726d;for(const _0x359541 of _0x4e726d['filter'](_0x5ef951=>_0x5ef951['hasChanges']))this['_updateContentPartsPromiseQueue']['enqueue'](async _0x515934=>{let _0x491da6=this['getPartView'](_0x359541['index']);_0x491da6||(_0x491da6=new na(this['locale'],{'part':_0x359541,'uiIndex':this['_children']['length']+0x1,'areActionsDisabled':this['_areActionsDisabled'],'availableActions':this['_availableActions']}),_0x491da6['delegate'](...Ee)['to'](this),this['_children']['add'](_0x491da6),this['hasPendingParts']=!0x0),0x2===this['_children']['length']&&this['_children']['first']['toggleHeader'](!0x0),_0x491da6['toggleHeader'](this['_children']['length']>0x1),await _0x491da6['updateContent']({'part':_0x359541,'renderingStrategy':_0x4dab83,'showUnchangedParts':this['_showUnchangedParts'],'abortSignal':_0x515934});});return _0x2b345e?.['addEventListener']('abort',()=>{this['_updateContentPartsPromiseQueue']['abort']();}),this['_updateContentPartsPromiseQueue']['queueEmptyPromise'];}['updatePartState'](_0x6dc72c,_0x43afc4){const _0x308507=this['getPartView'](_0x6dc72c);_0x308507&&(_0x308507['state']=_0x43afc4),this['hasPendingParts']='pending'==_0x43afc4||Array['from'](this['_children'])['some'](_0xd7b1c1=>'pending'==_0xd7b1c1['state']);}['getPartView'](_0x13258b){return this['_children']['find'](_0x6542d5=>_0x6542d5['partDefinition']['index']==_0x13258b)??null;}['markAsDone'](){if(!this['_showUnchangedParts']){const _0x3b3201=!this['_cachedContentParts']['find'](({hasChanges:_0x2c68fa})=>_0x2c68fa),_0x4cf044=!!this['_cachedContentParts']['find'](({hasChanges:_0x461e84})=>!_0x461e84);this['_emptyPartsWarningView']['isVisible']=0x0==this['_children']['length']||_0x4cf044,_0x3b3201?this['_emptyPartsWarningView']['setContent'](i(this['locale'],'AI_SUGGESTION_NO_PARTS_WARNING')):this['_emptyPartsWarningView']['setContent'](i(this['locale'],'AI_SUGGESTION_EMPTY_PART_WARNING'));}}get['hasNonEmptyParts'](){return!!this['_children']['find'](_0x37c97f=>_0x37c97f['partDefinition']['hasChanges']);}}class We extends _0x2f5128{constructor(_0x3cb613=void 0x0){super();const _0x4813d3=_0x3cb613?'ck-ai-spinner_'+_0x3cb613:'';this['extendTemplate']({'tag':'span','attributes':{'class':['ck-ai-spinner',_0x4813d3]}});}}class F extends _0x55515f{['bodyView'];['miniToolbarView'];['children'];['headerView'];['loaderView'];['errorView'];['sourcesView'];['_bodyCollection'];constructor(_0x277296,_0x2d1d99,_0x500ce5){super(_0x277296),this['_bodyCollection']=_0x500ce5;const {showDiff:_0xe259f,areActionsDisabled:_0x150982,miniToolbarConfig:_0x5e07cc,hideHeader:_0x190ff1,showLoader:_0x119065,showUnchangedParts:_0x5cf849,availableActions:_0x2b2f64}=_0x2d1d99;this['set']('areChangesVisible',!0x1),this['set']('isLoaderVisible',!!_0x119065),this['set']('isErrorVisible',!0x1),this['set']('isLoading',!0x1),this['children']=this['createCollection'](),_0x190ff1||(this['headerView']=new Tr(_0x277296,{'showDiff':_0xe259f}),this['headerView']['on']('toggleShowChanges',(_0x10bca7,_0x520c14)=>{this['areChangesVisible']=_0x520c14['isOn'],this['fire']('toggleSuggestionDisplayMode',{'showDiff':_0x520c14['isOn']});}),this['children']['add'](this['headerView'])),this['bodyView']=new Dr(_0x277296,{'areActionsDisabled':_0x150982,'showUnchangedParts':!!_0x5cf849,'availableActions':_0x2b2f64}),this['bodyView']['delegate'](...Ee)['to'](this),this['bodyView']['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isLoaderVisible','ck-hidden'),this['bindTemplate']['if']('isErrorVisible','ck-hidden')]}}),this['miniToolbarView']=new Lr(_0x277296,_0x5e07cc,_0xe259f),this['miniToolbarView']['delegate'](...Ee)['to'](this),this['miniToolbarView']['on']('toggleShowChanges',(_0x24e432,_0x4f0a98)=>{this['areChangesVisible']=_0x4f0a98,this['fire']('toggleSuggestionDisplayMode',{'showDiff':_0x4f0a98});}),this['miniToolbarView']['bind']('isLoading')['to'](this),this['children']['add'](this['bodyView']),this['children']['add'](this['miniToolbarView']),this['sourcesView']=new Sr(this['locale'],this['_bodyCollection']),this['children']['add'](this['sourcesView']),_0x119065&&(this['loaderView']=this['_createLoaderView'](),this['children']['add'](this['loaderView'])),this['errorView']=this['_createErrorView'](),this['children']['add'](this['errorView']),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__container','ck-rounded-corners']},'children':this['children']});}async['updateContent'](_0x289005){await this['bodyView']['updateContentParts'](_0x289005);}['updateSources'](_0x797f21){const _0x50d683=this['sourcesView'],_0x3be6d7=_0x50d683['balloonPanelView'];_0x50d683['children']['addMany'](_0x797f21['map'](_0x18bc78=>new Rr(this['locale'],_0x18bc78,_0x3be6d7))),_0x50d683['isVisible']=!0x0;}['showLoader'](){this['loaderView']&&(this['isLoaderVisible']=!0x0);}['hideLoader'](){this['loaderView']&&(this['isLoaderVisible']=!0x1);}['showError'](_0xdd01f9){if(this['errorView']){const _0x46f3f7=this['errorView']['element']?.['querySelector']('.ck-ai-suggestion__error-text');_0x46f3f7&&(_0x46f3f7['textContent']=_0xdd01f9),this['isErrorVisible']=!0x0;}}['hideError'](){this['errorView']&&(this['isErrorVisible']=!0x1);}['markAsDone'](){this['bodyView']['markAsDone'](),this['headerView']&&(this['headerView']['isShowChangesToggleVisible']=this['bodyView']['hasNonEmptyParts']);}['setLoading'](){this['isLoading']=!0x0;}['clearLoading'](){this['isLoading']=!0x1;}['setErrorState'](){this['miniToolbarView']&&(this['miniToolbarView']['isLoading']=!0x0),this['headerView']?.['showChangesToggleView']&&(this['headerView']['showChangesToggleView']['isEnabled']=!0x1);}['clearErrorState'](){this['miniToolbarView']&&(this['miniToolbarView']['isLoading']=!0x1),this['headerView']?.['showChangesToggleView']&&(this['headerView']['showChangesToggleView']['isEnabled']=!0x0);}['addNavigationItem'](_0x4663a7){this['miniToolbarView']['items']['add'](_0x4663a7);}['removeNavigationItem'](_0x36dbb0){this['miniToolbarView']['items']['remove'](_0x36dbb0);}['_createLoaderView'](){const _0x18f1d7=new _0x55515f(this['locale']),_0x114851=new We('small');_0x114851['isVisible']=!0x0;const _0x24ba5c=new _0x55515f(this['locale']);return _0x24ba5c['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-suggestion__loader-text']},'children':[i(this['locale'],'AI_CHAT_IS_WRITING')]}),_0x18f1d7['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__loader',this['bindTemplate']['if']('isLoaderVisible','ck-hidden',_0x456956=>!_0x456956)]},'children':[_0x114851,_0x24ba5c]}),_0x18f1d7;}['_createErrorView'](){const _0x5b5f88=new _0x55515f(this['locale']),_0x36f618=new _0x55515f(this['locale']);return _0x36f618['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-suggestion__error-text']},'children':[i(this['locale'],'AI_CHAT_GENERIC_ERROR')]}),_0x5b5f88['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__error',this['bindTemplate']['if']('isErrorVisible','ck-hidden',_0x567144=>!_0x567144)]},'children':[_0x36f618]}),_0x5b5f88;}}class Sr extends _0x55515f{['children'];['balloonPanelView'];['bodyCollection'];constructor(_0x1fadfa,_0x4f47a0){super(_0x1fadfa),this['bodyCollection']=_0x4f47a0,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',_0x40192e=>!_0x40192e)]},'children':this['children']});const _0x5c8544=new _0x55515f(this['locale']),_0x528cad=new _0x1e0173();_0x528cad['content']=_0x4f3dd0,_0x5c8544['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-web-sources__header']},'children':[_0x528cad,{'tag':'span','children':[{'text':i(this['locale'],'AI_CHAT_SOURCES_HEADER')}]}]}),this['children']['add'](_0x5c8544),this['_setupBalloonPanel'](_0x1fadfa);}['_setupBalloonPanel'](_0x2a850c){this['balloonPanelView']=new _0x564e6d(_0x2a850c),this['balloonPanelView']['extendTemplate']({'attributes':{'class':['ck-ai-web-source__tooltip-balloon']}}),this['bodyCollection']['add'](this['balloonPanelView']);}}class Rr extends _0x5cf211{['balloonPanelView'];['source'];constructor(_0x4d27d9,_0x2019ee,_0x43357f){super(_0x4d27d9),this['source']=_0x2019ee,this['balloonPanelView']=_0x43357f,this['set']({'label':_0x2019ee['title'],'class':['ck\x20ck-ai-web-source'],'withText':!0x0});const _0x35ea99=this['bindTemplate'];if(this['extendTemplate']({'on':{'click':_0x35ea99['to'](()=>{window['open'](_0x2019ee['url'],'_blank');}),'mouseenter':_0x35ea99['to'](()=>{this['_showTooltip']();}),'mouseleave':_0x35ea99['to'](()=>{this['_hideTooltip']();})}}),_0x2019ee['favicon']){const _0x16e564=new _0x55515f(_0x4d27d9);_0x16e564['setTemplate']({'tag':'img','attributes':{'src':_0x2019ee['favicon']||_0x4f3dd0,'alt':_0x2019ee['title'],'class':['ck-ai-web-source__image']}}),this['children']['add'](_0x16e564);}else this['set']('icon',_0x4f3dd0);}['_createTooltipContentView'](_0x5d9e32,_0xfd1b68){const _0x184877=new _0x55515f(_0x5d9e32),_0x5ae1ee=[];let _0x45e6e6;_0xfd1b68?.['favicon']?(_0x45e6e6=new _0x55515f(_0x5d9e32),_0x45e6e6['setTemplate']({'tag':'img','attributes':{'src':_0xfd1b68['favicon'],'alt':_0xfd1b68['title'],'class':['ck-ai-web-source__tooltip-image']}})):(_0x45e6e6=new _0x1e0173(),_0x45e6e6['content']=_0x4f3dd0,_0x45e6e6['extendTemplate']({'attributes':{'alt':_0xfd1b68['title'],'class':['ck-ai-web-source__tooltip-image']}})),_0x5ae1ee['push'](_0x45e6e6);const _0x1bfff7=new _0x55515f(_0x5d9e32);_0x1bfff7['setTemplate']({'tag':'a','attributes':{'class':['ck-ai-web-source__tooltip-url'],'href':_0xfd1b68['url']},'children':[{'text':new URL(_0xfd1b68['url'])?.['hostname']}]}),_0x5ae1ee['push'](_0x1bfff7);const _0x4a2f42=new _0x55515f(_0x5d9e32);_0x4a2f42['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-web-source__tooltip-row']},'children':_0x5ae1ee});const _0x25c07b=new _0x55515f(_0x5d9e32);return _0x25c07b['setTemplate']({'tag':'span','attributes':{'class':['ck-ai-web-source__tooltip-row','ck-ai-web-source__tooltip-title']},'children':[{'text':_0xfd1b68['title']['length']>0x190?_0xfd1b68['title']['substring'](0x0,0x190)+'...':_0xfd1b68['title']}]}),_0x184877['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-web-source__tooltip']},'children':[_0x4a2f42,_0x25c07b]}),_0x184877;}['_showTooltip'](){this['_updateTooltipContent'](),this['balloonPanelView']['pin']({'target':this['element'],'positions':[_0x564e6d['defaultPositions']['northArrowSouth'],_0x564e6d['defaultPositions']['northArrowSouthWest'],_0x564e6d['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 _0x41acd0=this['_createTooltipContentView'](this['locale'],this['source']);this['balloonPanelView']['content']['add'](_0x41acd0);}}class cs extends _0x58f977{constructor(_0x39a7f9,_0x5aec8d=!0x0,_0x4447b8=!0x0){super(_0x39a7f9),this['set']('isLoading',!0x1),_0x5aec8d&&(this['applyButton']=this['_createButton'](i(_0x39a7f9,'AI_BALLOON_APPLY_BUTTON'),'ck-ai-button-primary'),this['applyButton']['bind']('isEnabled')['to'](this,'isLoading',_0x50d4ee=>!_0x50d4ee),this['items']['add'](this['applyButton'])),_0x4447b8&&(this['suggestButton']=this['_createButton'](i(_0x39a7f9,'AI_BALLOON_SUGGEST_BUTTON'),_0x5aec8d?'ck-ai-button-secondary':'ck-ai-button-primary'),this['suggestButton']['bind']('isEnabled')['to'](this,'isLoading',_0x5410e6=>!_0x5410e6),this['items']['add'](this['suggestButton'])),this['extendTemplate']({'attributes':{'class':['ck-ai-balloon__toolbar']}});}['_createButton'](_0x222be7,_0x3a6fb9){const _0x526f1e=new _0x5cf211(this['locale']);return _0x526f1e['set']({'label':_0x222be7,'class':_0x3a6fb9||'','isVisible':!0x0,'withText':!0x0}),_0x526f1e;}}class ls extends _0x55515f{constructor(_0x469dce){super(_0x469dce),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-balloon__disclaimer']},'children':[{'tag':'p','attributes':{'class':['ck','ck-ai-balloon__disclaimer-content']},'children':[{'text':i(_0x469dce,'AI_DISCLAIMER_TEXT')}]}]});}}const fs=['wheel','touchstart','pointerdown','keydown'],Fs=['ArrowUp','ArrowDown','PageUp','PageDown','Home','End','\x20'];class us{['element'];['animationFrameId'];['isRunning'];['abortController'];['isUserPaused'];constructor(_0x872d07){this['element']=_0x872d07,this['animationFrameId']=null,this['isRunning']=!0x1,this['abortController']=new AbortController(),this['isUserPaused']=!0x1;for(const _0x18fe6f of fs){const _0x594622='keydown'!==_0x18fe6f;this['element']['addEventListener'](_0x18fe6f,this['_onUserEvent']['bind'](this),{'passive':_0x594622,'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'](_0x3596ae){if(this['isRunning']){if('keydown'===_0x3596ae['type']){const _0x542869=_0x3596ae['key'];if(!Fs['includes'](_0x542869))return;}_0x3596ae instanceof WheelEvent?_0x3596ae['deltaY']<0x0?this['isUserPaused']=!0x0:this['isUserPaused']=!this['_isAtBottom']():this['isUserPaused']=!0x0;}}['_isAtBottom'](){const {scrollTop:_0x259318,scrollHeight:_0x437e5b,clientHeight:_0x28847c}=this['element'];return _0x437e5b-_0x259318-_0x28847c<=0x5;}['_rafUpdate'](){this['isRunning']&&(this['isUserPaused']||this['element']['scrollTo']({'top':this['element']['scrollHeight'],'behavior':'auto'}),this['animationFrameId']=requestAnimationFrame(this['_rafUpdate']['bind'](this)));}}const N=['applySuggestion','insertSuggestion','showNext','showPrevious'];class T extends _0x55515f{['focusTracker'];['keystrokes'];['focusCycler'];['_availableActions'];['_focusables'];['_errorView'];['scrollManager'];constructor(_0x288e41,_0x3a62d6,_0x1a7efa,_0x5361e7){super(_0x288e41),this['_availableActions']=_0x1a7efa,this['set']('isLoading',!0x1),this['set']('isTrackChangesOn',_0x5361e7),this['set']('isErrorVisible',!0x1),this['set']('errorMessage',''),this['focusTracker']=new _0x338162(),this['keystrokes']=new _0x1b5c14(),this['_focusables']=this['createCollection'](),this['focusCycler']=new _0x2f6676({'focusables':this['_focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes'],'actions':{'focusPrevious':'shift\x20+\x20tab','focusNext':'tab'}}),this['_dialogContent']=new _0x4b2ba7(),this['_addContentView'](_0x3a62d6['mainView']),this['_addDisclaimerView'](),this['_addToolbar'](_0x3a62d6['showApplyButton'],_0x3a62d6['showSuggestButton']),this['toolbar']['bind']('isLoading')['to'](this),this['_focusables']['clear'](),this['_focusables']['addMany']([this['toolbar']]),this['setTemplate']({'tag':'div','attributes':{'class':'ai-balloon-content'},'children':this['_dialogContent']}),this['on']('change:isTrackChangesOn',()=>{this['_dialogContent']['remove'](this['toolbar']),this['_addToolbar'](_0x3a62d6['showApplyButton'],_0x3a62d6['showSuggestButton']);});}['render'](){super['render']();for(const _0x1c8661 of this['_focusables'])this['focusTracker']['add'](_0x1c8661['element']);this['keystrokes']['listenTo'](this['element']),this['_initializeScrollManager']();}['destroy'](){super['destroy'](),this['scrollManager']&&this['scrollManager']['destroy']();}['focus'](_0x220b84){-0x1===_0x220b84?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}['setLoading'](){this['isLoading']=!0x0;}['clearLoading'](){this['isLoading']=!0x1;}['showError'](_0x3d4e2e){this['_errorView']||(this['_errorView']=this['_createErrorView'](),this['_dialogContent']['addMany']([this['_errorView']],0x0)),this['errorMessage']=_0x3d4e2e,this['isErrorVisible']=!0x0;}['hideError'](){this['isErrorVisible']=!0x1;}['showRecoverableError'](_0x406ff1){this['showError'](_0x406ff1);}['showBlockingError'](_0x37b3e){this['showError'](_0x37b3e),this['toolbar']&&(this['toolbar']['applyButton']&&(this['toolbar']['applyButton']['isEnabled']=!0x1),this['toolbar']['suggestButton']&&(this['toolbar']['suggestButton']['isEnabled']=!0x1));}['setupRotator'](_0x451dd3){const _0x389341=this['_createNextButtonView'](),_0x8e2ff7=this['_createPreviousButtonView']();_0x451dd3['view']['headerView']['children']['add'](_0x389341,0x2),_0x451dd3['view']['headerView']['children']['add'](_0x8e2ff7,0x0),this['_focusables']['addMany']([_0x389341,_0x8e2ff7]),this['focusTracker']['add'](_0x389341['element']),this['focusTracker']['add'](_0x8e2ff7['element']);}['_addContentView'](_0x2dc534){this['_mainView']=_0x2dc534,this['_dialogContent']['add'](this['_mainView']);}['updateContent'](_0x354989){const _0x24982e=this['_dialogContent']['getIndex'](this['_mainView']);this['_dialogContent']['remove'](this['_mainView']),this['_mainView']=_0x354989,this['_dialogContent']['add'](this['_mainView'],_0x24982e),this['hideError'](),this['scrollManager']&&this['scrollManager']['destroy'](),this['_initializeScrollManager']();}['_addDisclaimerView'](){this['disclaimerView']=new ls(this['locale']),this['_dialogContent']['add'](this['disclaimerView']);}['_addToolbar'](_0x1e1393=!0x0,_0x10b3c9=!0x0){_0x1e1393=_0x1e1393&&!this['isTrackChangesOn']&&this['_availableActions']['includes']('applySuggestion'),_0x10b3c9=_0x10b3c9&&this['_availableActions']['includes']('insertSuggestion'),this['toolbar']=new cs(this['locale'],_0x1e1393,_0x10b3c9),this['toolbar']['applyButton']?.['on']('execute',()=>{this['fire']('applySuggestion');}),this['toolbar']['suggestButton']?.['on']('execute',()=>{this['fire']('insertSuggestion');}),this['_dialogContent']['add'](this['toolbar']);}['_createNextButtonView'](){const _0x156d7d=new _0x5cf211(this['locale']);return _0x156d7d['set']({'icon':_0x28046c,'tooltip':i(this['locale'],'AI_BALLOON_NEXT_TOOLTIP')}),_0x156d7d['on']('execute',()=>{this['fire']('showNext');}),_0x156d7d;}['_createPreviousButtonView'](){const _0x46e451=new _0x5cf211(this['locale']);return _0x46e451['set']({'icon':tt,'tooltip':i(this['locale'],'AI_BALLOON_PREVIOUS_TOOLTIP')}),_0x46e451['on']('execute',()=>{this['fire']('showPrevious');}),_0x46e451;}['_createErrorView'](){const _0x529f37=new _0x55515f(this['locale']),_0x1966fb=new _0x55515f(this['locale']);return _0x1966fb['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-suggestion__error-text']},'children':[{'text':this['bindTemplate']['to']('errorMessage')}]}),_0x529f37['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__error','ai-balloon-error',this['bindTemplate']['if']('isErrorVisible','ck-hidden',_0x25a95d=>!_0x25a95d)]},'children':[_0x1966fb]}),_0x529f37;}['startAutoScroll'](){this['_initializeScrollManager'](),this['scrollManager']&&this['scrollManager']['start']();}['stopAutoScroll'](){this['scrollManager']&&this['scrollManager']['stop']();}['_initializeScrollManager'](){const _0x394fc9=this['_getScrollableElement']();_0x394fc9&&!this['scrollManager']&&(this['scrollManager']=new us(_0x394fc9));}['_getScrollableElement'](){return this['_mainView']instanceof F&&this['_mainView']['bodyView']['element']?this['_mainView']['bodyView']['element']:null;}}const z=0xa;class st extends _0x53b1cd{static get['requires'](){return[R,S];}static get['pluginName'](){return'AIBalloon';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['isOpen']=!0x1;['_config'];['_isUpdatingMarkers']=!0x1;['_pendingRenderCallback']=null;['open'](_0x4b1d19){const _0x3b8ad3=q(this['context']);if(this['_config']=_0x4b1d19,this['isOpen'])return void this['_updateBalloon'](_0x4b1d19);const _0x46bc53=this['context']['config']['get']('ai.availableReplyActions')||[...H],_0x20db14=_0x3b8ad3?.['commands']['get']('trackChanges'),_0x4cb6c7=_0x20db14?.['value'];this['balloonView']=new T(_0x3b8ad3['locale'],_0x4b1d19,_0x46bc53,!!_0x4cb6c7),this['balloonView']['delegate'](...N)['to'](this),_0x20db14&&this['balloonView']['bind']('isTrackChangesOn')['to'](_0x20db14,'value'),this['_showDialog'](_0x4b1d19);}['close'](){q(this['context'])['plugins']['get']('Dialog')['hide']();}['startAutoScroll'](){this['balloonView']&&this['balloonView']['startAutoScroll']();}['stopAutoScroll'](){this['balloonView']&&this['balloonView']['stopAutoScroll']();}['_updateBalloon'](_0x347348){const _0x229d87=q(this['context']),_0x524c19=_0x229d87['plugins']['get']('Dialog');this['_pendingRenderCallback']&&(_0x229d87['editing']['view']['off']('render',this['_pendingRenderCallback']),this['_pendingRenderCallback']=null),this['_isUpdatingMarkers']=!0x0,_0x524c19['view']?.['headerView']&&(_0x524c19['view']['headerView']['label']=_0x347348['title'],_0x524c19['view']['headerView']['iconView']&&_0x347348['icon']&&(_0x524c19['view']['headerView']['iconView']['content']=_0x347348['icon'])),this['balloonView']['updateContent'](_0x347348['mainView']),this['_setupVisualSelection'](_0x347348['ranges'],_0x347348['index']),this['_pendingRenderCallback']=()=>{this['_isUpdatingMarkers']=!0x1,this['_pendingRenderCallback']=null,_0x524c19['view']&&_0x524c19['view']['updatePosition']();},_0x229d87['editing']['view']['once']('render',this['_pendingRenderCallback']);}['_setupVisualSelection'](_0x53419c,_0xd84023){this['context']['plugins']['get'](S)['showFakeVisualSelection'](_0x53419c,'ai-balloon-'+_0xd84023,!0x0,!0x0);}['_showDialog'](_0x3e6e59){const _0x2261a2=q(this['context']);this['_setupVisualSelection'](_0x3e6e59['ranges'],_0x3e6e59['index']);const _0x993df0=this['_getSelectionElements']();_0x993df0&&_0x993df0[0x0]&&_0xc42cd2({'target':_0x993df0[0x0],'ancestorOffset':0x14,'alignToTop':!0x0,'viewportOffset':{'top':0x14,'bottom':0x14,'left':0x0,'right':0x0}}),_0x2261a2['plugins']['get']('Dialog')['show']({'title':_0x3e6e59['title'],'icon':_0x3e6e59['icon'],'hasCloseButton':!0x0,'id':'aiBalloon','position':this['_calculateDialogPosition']['bind'](this),'className':'ai-balloon'+(_0x3e6e59['showRotator']?'\x20ai-balloon-rotator':''),'content':this['balloonView'],'onShow':_0x561652=>{_0x3e6e59['showRotator']&&this['balloonView']['setupRotator'](_0x561652),this['_setupMarkerRemovalListener'](),this['isOpen']=!0x0;},'onHide':()=>{this['context']['plugins']['get']('AIEditing')['hideFakeVisualSelection']('ai-balloon-'+this['_config']['index']),this['_cleanupMarkerRemovalListener'](),this['fire']('dialogClosed'),this['isOpen']=!0x1;}});}['_calculateDialogPosition'](_0x170d72,_0x2b3f55){if(!_0x2b3f55)return null;const _0x4cb072=this['_getSelectionElements']();if(!_0x4cb072||0x0===_0x4cb072['length'])return{'left':Math['round'](_0x2b3f55['left']+_0x2b3f55['width']/0x2-_0x170d72['width']/0x2),'top':Math['round'](_0x2b3f55['top']+_0x2b3f55['height']/0x2-_0x170d72['height']/0x2)};const _0x21bc5a=Math['round'](_0x2b3f55['left']+_0x2b3f55['width']/0x2-_0x170d72['width']/0x2),_0x39d16a=new _0x2e6861(_0x4cb072[0x0]),_0x2557bb=new _0x2e6861(_0x4cb072[_0x4cb072['length']-0x1]),_0x12aac5=_0x170d72['height'],_0x133c8c=this['_config']['showRotator']?0x8:0x0;return{'left':_0x21bc5a,'top':this['_calculateOptimalTopPosition'](_0x39d16a,_0x2557bb,_0x12aac5,_0x133c8c,_0x2b3f55)};}['_calculateOptimalTopPosition'](_0xac6f3a,_0x54bb6d,_0x172a9a,_0x3a5ea7=0x0,_0x2b77a1){const _0x1a1bbc=_0x172a9a+_0x3a5ea7,_0x4f332b=new _0x2e6861(_0x3610d0['window']),_0x257a05=[_0xac6f3a['getVisible'](),_0x54bb6d['getVisible']()]['filter'](_0x3d9081=>_0x3d9081),_0x2e6182=_0x2e6861['getBoundingRect'](_0x257a05);if(!_0x2e6182)return Math['round'](_0x2b77a1['top']+_0x2b77a1['height']/0x2);const _0x31936e=_0x4f332b['getIntersection'](_0x2e6182);if(!_0x31936e)return Math['round'](_0x2b77a1['top']+_0x2b77a1['height']/0x2);const _0x437bab=_0x2b77a1['getVisible'](),_0x5cb8f0=_0x437bab&&_0x2e6182['height']>_0x437bab['height'],_0x1479ab=_0x31936e['top'],_0x281bfd=_0x31936e['bottom'];if(_0x5cb8f0){const _0x5930d1=(_0x437bab||_0x4f332b)['height']/0x2-_0x1a1bbc/0x2,_0x20f6cf=_0x1479ab-z-_0x2b77a1['top'],_0x175c8e=_0x2b77a1['bottom']-_0x281bfd-z;return _0x20f6cf>=_0x1a1bbc?Math['max'](z,_0x1479ab-_0x1a1bbc-z):_0x175c8e>=_0x1a1bbc?_0x281bfd+z:Math['max'](z,_0x5930d1);}const _0x308d3f=_0x1479ab-_0x1a1bbc,_0x24702c=_0x2b77a1['bottom']-_0x281bfd-z,_0x14bf09=_0x1479ab-z-_0x2b77a1['top'];let _0x2e5163;if(_0x24702c>=_0x1a1bbc)_0x2e5163=_0x281bfd+z;else{if(_0x14bf09>=_0x1a1bbc)_0x2e5163=_0x308d3f-z;else _0x2e5163=_0x1479ab+_0x2e6182['height']/0x2-_0x1a1bbc/0x2;}return _0x2e5163;}['_setupMarkerRemovalListener'](){const _0x4e244a=q(this['context']);this['listenTo'](_0x4e244a['model']['document'],'change',()=>{if(this['_isUpdatingMarkers'])return;for(const {name:_0x3192e5,data:{newRange:_0x3a820e}}of _0x4e244a['model']['document']['differ']['getChangedMarkers']())if(_0x3192e5['startsWith']('ai-selection:')&&(_0x3a820e&&(_0x3a820e['start']['isEqual'](_0x3a820e['end'])||'$graveyard'==_0x3a820e['root']['rootName'])||null==_0x3a820e)){const _0x1f1ce1=i(this['context']['locale'],'AI_ACTIONS_SELECTION_REMOVED_ERROR');this['balloonView']['showBlockingError'](_0x1f1ce1),this['fire']('selectionRemoved');}});}['_cleanupMarkerRemovalListener'](){const _0x5aa301=q(this['context']);this['stopListening'](_0x5aa301['model']['document']);}['_getSelectionElements'](){const _0x3b1bee=q(this['context']);return _0x428d6f(_0x3b1bee['editing'],[..._0x3b1bee['model']['markers']['getMarkersGroup']('ai-selection'),..._0x3b1bee['model']['markers']['getMarkersGroup']('ai-balloon-selection')]);}}class mt extends _0x53b1cd{['_aiEditing'];['_aiConnector'];['_aiChatUi'];['_aiChatModels'];['_batchToChanges']=new Map();['_previewedChangeGroup']=null;['_balloonShowDiff']=!0x1;['_bodyCollection'];static get['requires'](){return[R,st,ot];}static get['pluginName'](){return'AIChatController';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){this['_bodyCollection']=new _0x1008b4(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 At({'connector':this['_aiConnector'],'availableModels':this['context']['config']['get']('ai.chat.models.displayedModels'),'defaultModelId':this['context']['config']['get']('ai.chat.models.defaultModelId'),'locale':this['context']['locale']});const _0x21b2e7=this['context']['plugins']['get']('AITabs');this['listenTo'](this['_aiChatUi'],'startConversation',()=>{this['_startConversationSafely']();}),this['listenTo'](this['_aiChatUi'],'sendUserMessage',(_0x3bbd3d,_0x400acb)=>{this['_handleUIUserMessage']({'userMessage':_0x400acb});}),this['listenTo'](_0x21b2e7,'resizedTabs',(_0x4a924f,_0x41ce68)=>{this['_setIsMaximized'](_0x41ce68);}),this['listenTo'](this['_aiChatUi'],'resizeTabs',()=>{_0x21b2e7['resize']();}),this['listenTo'](this['_aiChatUi'],'abortPromptStream',async()=>{await this['_stopLastInteraction'](),await this['_flushLastInteractionUI'](),this['removeSelectionFromChatContext']();}),this['listenTo'](this['_aiChatUi'],'addDocumentToContext',()=>{this['activeConversation']?.['addCurrentDocumentToContext'](i(this['context']['locale'],'AI_CHAT_CONTEXT_CURRENT_DOCUMENT'));}),this['listenTo'](this['_aiChatUi'],'addFileToContext',(_0x1a09c9,_0x4398a5)=>{this['activeConversation']?.['addFilesToContext'](Array['from'](_0x4398a5));}),this['listenTo'](this['_aiChatUi'],'addUrlToContext',(_0x25a56c,_0x46a5d7)=>{this['activeConversation']?.['addUrlToContext'](_0x46a5d7);}),this['listenTo'](this['_aiChatUi'],'addResourceToContext',(_0x360603,_0x3359f7)=>{this['activeConversation']?.['addResourceToContext'](_0x3359f7['source'],_0x3359f7['resource']);}),this['listenTo'](this['_aiChatUi'],'removeContextItem',(_0x11361d,_0x1974b2)=>{this['_removeFromContext'](_0x1974b2);}),this['listenTo'](this['_aiChatUi'],'loadSourceResources',(_0xb2bcde,_0x406dda)=>{this['activeConversation']?.['loadSourceResources'](_0x406dda['sourceId'],_0x406dda['query'],_0x406dda['uid']);}),this['listenTo'](this['_aiChatUi'],'toggleWebSearch',()=>{this['_toggleWebSearch']();}),this['listenTo'](this['_aiChatUi'],'toggleReasoning',()=>{this['_toggleReasoning']();}),this['listenTo'](this['_aiChatUi'],'selectModel',(_0x1e4bf5,_0xa37799)=>{this['activeConversation']?.['setModel'](_0xa37799);}),this['listenTo'](this['_aiChatUi'],'like',(_0x992529,{replyId:_0x31a129})=>{console['log']('Liked\x20response',_0x31a129);}),this['listenTo'](this['_aiChatUi'],'dislike',(_0x3e3d19,{replyId:_0x1523a6})=>{console['log']('Disliked\x20response',_0x1523a6);}),this['listenTo'](this['_aiChatUi'],'insertSuggestion',(_0x599fe2,_0x52d782)=>{this['context']['plugins']['get'](st)['close'](),this['_insertSuggestion'](_0x52d782);}),this['listenTo'](this['_aiChatUi'],'showChangeInText',(_0x37a9cd,{replyId:_0x2dfc73,partIndex:_0x4471b7})=>{this['_balloonShowDiff']=this['_aiChatUi']['showDiff'],this['_openBalloonFor'](_0x2dfc73,_0x4471b7);}),this['listenTo'](this['_aiChatUi'],'mouseOverSuggestion',(_0x4ddaf6,{replyId:_0x264e19,partIndex:_0x2a7fa1})=>{const _0x1f60f5=this['_getDocumentRangeForReplyChanges'](_0x264e19,_0x2a7fa1);_0x1f60f5&&'$graveyard'!=_0x1f60f5['range']['root']['rootName']&&this['_aiEditing']['showFakeVisualSelection']([_0x1f60f5['range']],'ai-chat-controller-mouse-over');}),this['listenTo'](this['_aiChatUi'],'mouseLeaveSuggestion',()=>{this['_aiEditing']['hideFakeVisualSelection']('ai-chat-controller-mouse-over');}),this['listenTo'](this['_aiChatUi'],'applySuggestion',(_0x34c91b,_0xe74c0c)=>{this['context']['plugins']['get'](st)['close'](),this['_applySuggestion'](_0xe74c0c);}),this['listenTo'](this['_aiChatUi'],'toggleSuggestionDisplayMode',async(_0x1db9e7,{replyId:_0x58aeec,showDiff:_0x28f73f})=>{const {reply:_0x2ac3c0}=this['getInteractionAndReplyById'](_0x58aeec),_0x3237b8=_0x2ac3c0['getContentParts']({'showDiff':_0x28f73f});await this['_aiChatUi']['updateFeedItemAIReplySuggestionContent']({'id':_0x2ac3c0['id'],'parts':_0x3237b8,'renderingStrategy':'static'});}),this['listenTo'](this['_aiChatUi'],'rejectSuggestion',(_0x32767a,{replyId:_0x162e6a,partIndex:_0x6c9d84})=>{this['_previewedChangeGroup']?.['replyId']==_0x162e6a&&this['_previewedChangeGroup']?.['partIndex']==_0x6c9d84&&this['context']['plugins']['get'](st)['close']();const {reply:_0x5980d1}=this['getInteractionAndReplyById'](_0x162e6a);_0x5980d1['setChangeGroupState'](_0x6c9d84,'rejected'),this['_aiEditing']['hideFakeVisualSelection']('ai-chat-controller-mouse-over');});}async['afterInit'](){this['context']instanceof _t?this['_integrateEditor'](this['context']):this['listenTo'](this['context']['editors'],'add',(_0x4ff9fc,_0x3ab325)=>{_0x3ab325['on']('ready',()=>{this['_integrateEditor'](_0x3ab325);});}),await this['_startConversationSafely']();}['destroy'](){this['_bodyCollection']['detachFromDom'](),super['destroy']();}['_insertSuggestion'](_0x1da2ec){const _0x319418=q(this['context']);if(!_0x319418['plugins']['has']('TrackChanges'))throw new _0x25e143('ai-no-track-changes',null);const _0x3981a3=this['context']['plugins']['get']('DocumentCompare'),{reply:_0x185c2e,interaction:_0x2b0bae}=this['getInteractionAndReplyById'](_0x1da2ec['replyId']),_0x462835=this['_getDocumentRangeForReplyChanges'](_0x1da2ec['replyId'],_0x1da2ec['partIndex']),_0xfee800=void 0x0!==_0x1da2ec['partIndex']?[_0x185c2e['changeGroups'][_0x1da2ec['partIndex']]]:_0x185c2e['changeGroups']['filter'](_0x31d828=>'pending'==_0x31d828['state']),_0xc13153=_0xfee800['map'](_0x3d49a1=>_0x185c2e['changeGroups']['indexOf'](_0x3d49a1));if(!_0x462835||'$graveyard'==_0x462835['range']['root']['rootName'])return void _0xc13153['forEach'](_0x429d9b=>_0x185c2e['setChangeGroupState'](_0x429d9b,'outdated'));_0xc13153['forEach'](_0x1f2a17=>_0x185c2e['setChangeGroupState'](_0x1f2a17,'accepted'));const _0xd5932d=at({'editor':_0x319418,'reply':_0x185c2e,'interaction':_0x2b0bae,'groups':_0xfee800,'transform':!0x0,'documentCompare':_0x3981a3,'documentCompareOptions':{'anchor':'main','markDeletions':!0x0}});let _0xf5ee9a;_0x462835&&this['_scrollToSuggestionRange'](_0x462835['range']),_0x319418['model']['change'](_0x187c1f=>{_0xf5ee9a=_0x187c1f['batch'],_0x319418['plugins']['get']('TrackChangesEditing')['_applyOperationsAsSuggestions'](_0xd5932d),this['_aiEditing']['hideFakeVisualSelection']('ai-chat-controller-mouse-over');}),this['_batchToChanges']['set'](_0xf5ee9a,{'interactionId':_0x2b0bae['id'],'replyId':_0x185c2e['id'],'indexes':_0xc13153['slice']()}),this['_updateRatings'](_0x185c2e);}['_applySuggestion'](_0x3db13d){const _0x13c398=q(this['context']),_0x3750c8=this['context']['plugins']['get'](ot),{reply:_0x41a0c3,interaction:_0x4878b8}=this['getInteractionAndReplyById'](_0x3db13d['replyId']),_0x2a69a5=this['_getDocumentRangeForReplyChanges'](_0x3db13d['replyId'],_0x3db13d['partIndex']),_0x46cf80=void 0x0!==_0x3db13d['partIndex']?[_0x41a0c3['changeGroups'][_0x3db13d['partIndex']]]:_0x41a0c3['changeGroups']['filter'](_0x2459aa=>'pending'==_0x2459aa['state']),_0x380f72=_0x46cf80['map'](_0x42cb7b=>_0x41a0c3['changeGroups']['indexOf'](_0x42cb7b));if(!_0x2a69a5||'$graveyard'==_0x2a69a5['range']['root']['rootName'])return void _0x380f72['forEach'](_0x339829=>_0x41a0c3['setChangeGroupState'](_0x339829,'outdated'));_0x380f72['forEach'](_0x8ba2ad=>_0x41a0c3['setChangeGroupState'](_0x8ba2ad,'accepted'));const _0x2c350d=at({'editor':_0x13c398,'reply':_0x41a0c3,'interaction':_0x4878b8,'groups':_0x46cf80,'transform':!0x0,'documentCompare':_0x3750c8,'documentCompareOptions':{'anchor':'main','markDeletions':!0x1}});let _0xf919c0;_0x2a69a5&&this['_scrollToSuggestionRange'](_0x2a69a5['range']),_0x13c398['model']['change'](_0x409ba1=>{_0xf919c0=_0x409ba1['batch'];for(const _0x468d77 of _0x2c350d)_0x468d77['baseVersion']=_0x13c398['model']['document']['version'],rt(_0x13c398,_0x468d77),_0x409ba1['batch']['addOperation'](_0x468d77),_0x13c398['model']['applyOperation'](_0x468d77);}),this['_batchToChanges']['set'](_0xf919c0,{'interactionId':_0x4878b8['id'],'replyId':_0x41a0c3['id'],'indexes':_0x380f72['slice']()}),this['_updateRatings'](_0x41a0c3);}['_openBalloonFor'](_0x188d88,_0x294cdc){const _0x3449f2=q(this['context']),_0x162254=this['_getDocumentRangeForReplyChanges'](_0x188d88,_0x294cdc),_0x2bb209=this['context']['plugins']['get'](st);if(!_0x162254)return void _0x2bb209['close']();const {range:_0x5cdb34,currentIndex:_0x334ca1}=_0x162254;if('$graveyard'==_0x5cdb34['root']['rootName']){const {reply:_0x4a2a14}=this['getInteractionAndReplyById'](_0x188d88);return _0x4a2a14['setChangeGroupState'](_0x334ca1,'outdated'),void _0x2bb209['close']();}if(this['_previewedChangeGroup']?.['replyId']==_0x188d88&&this['_previewedChangeGroup']?.['partIndex']==_0x334ca1)return;this['stopListening'](_0x2bb209),this['_previewedChangeGroup']={'replyId':_0x188d88,'partIndex':_0x334ca1};let _0x604ae7=_0x3449f2['config']['get']('ai.availableReplyActions')||[...H];_0x3449f2['plugins']['has']('TrackChanges')||(_0x604ae7=_0x604ae7['filter'](_0x5a4a91=>'insertSuggestion'!=_0x5a4a91));const _0x204fb8=new F(_0x3449f2['locale'],{'showDiff':this['_balloonShowDiff'],'areActionsDisabled':!0x1,'miniToolbarConfig':{'showChanges':'full'},'hideHeader':!0x0,'availableActions':_0x604ae7},this['_bodyCollection']);this['stopListening'](_0x204fb8);const {reply:_0x10b136}=this['getInteractionAndReplyById'](_0x188d88),_0x62ede2=_0x10b136['getContentParts']({'showDiff':this['_balloonShowDiff']})['filter'](_0x457135=>_0x457135['hasChanges']),_0x1d3a33=_0x62ede2['findIndex'](_0x47e047=>_0x47e047['index']==_0x334ca1);if(-0x1==_0x1d3a33)return;const _0x264151=_0x62ede2[_0x1d3a33],_0x2c143e=_0x62ede2['at']((_0x1d3a33-0x1)%_0x62ede2['length'])?.['index'],_0x25b32d=_0x62ede2['at']((_0x1d3a33+0x1)%_0x62ede2['length'])?.['index'];_0x204fb8['updateContent']({'parts':[_0x264151],'renderingStrategy':'static'});const _0x4c300e=_0x334ca1!==_0x2c143e;this['_scrollToSuggestionRange'](_0x5cdb34,!0x0),_0x2bb209['open']({'index':_0x334ca1,'title':i(this['context']['locale'],'AI_BALLOON_HEADER_TITLE',(_0x1d3a33+0x1)['toString']()),'icon':Nt,'mainView':_0x204fb8,'showRotator':_0x4c300e,'showApplyButton':!0x0,'showSuggestButton':_0x3449f2['plugins']['has']('TrackChanges'),'ranges':[_0x5cdb34]}),this['_aiChatUi']['scrollFeedToSuggestion'](_0x188d88,_0x334ca1),this['listenTo'](_0x204fb8,'toggleSuggestionDisplayMode',(_0x567743,{showDiff:_0x5d228f})=>{this['_balloonShowDiff']=_0x5d228f;const {reply:_0x18c26e}=this['getInteractionAndReplyById'](_0x188d88),_0x3e630f=_0x18c26e['getContentParts']({'showDiff':_0x5d228f,'groupIndex':_0x334ca1});_0x204fb8['updateContent']({'parts':_0x3e630f,'renderingStrategy':'static'});}),this['listenTo'](_0x2bb209,'applySuggestion',()=>{this['_applySuggestion']({'replyId':_0x188d88,'partIndex':_0x334ca1}),_0x4c300e?this['_openBalloonFor'](_0x188d88,_0x25b32d):_0x2bb209['close']();}),this['listenTo'](_0x2bb209,'insertSuggestion',()=>{this['_insertSuggestion']({'replyId':_0x188d88,'partIndex':_0x334ca1}),_0x4c300e?this['_openBalloonFor'](_0x188d88,_0x25b32d):_0x2bb209['close']();}),_0x4c300e&&(this['listenTo'](_0x2bb209,'showNext',()=>{this['_openBalloonFor'](_0x188d88,_0x25b32d);}),this['listenTo'](_0x2bb209,'showPrevious',()=>{this['_openBalloonFor'](_0x188d88,_0x2c143e);})),this['listenTo'](_0x2bb209,'dialogClosed',()=>{this['stopListening'](_0x2bb209),this['stopListening'](_0x204fb8),this['_previewedChangeGroup']=null;});}['_getDocumentRangeForReplyChanges'](_0xdc34d1,_0x4b20b0){const _0x4cc289=q(this['context']),{reply:_0x41c3fd,interaction:_0x33e0b2}=this['getInteractionAndReplyById'](_0xdc34d1),_0x3f74b6=_0x41c3fd['changeGroups']['filter'](_0x45ecee=>'pending'==_0x45ecee['state']),_0x35871b=_0x3f74b6['map'](_0xae9998=>_0x41c3fd['changeGroups']['indexOf'](_0xae9998));void 0x0===_0x4b20b0&&(_0x4b20b0=_0x35871b[0x0]);const _0x37c22f=_0x35871b['indexOf'](_0x4b20b0);if(-0x1==_0x37c22f)return null;const _0x26dd4c=_0x3f74b6[_0x37c22f],_0xd0aae3=new Rt([]),_0x3d3744=new Rt([]);for(const _0x48588e of _0x26dd4c['changes'])if('removed'!=_0x48588e['type']&&_0x3d3744['children']['push'](_0x48588e['node']['cloneNode'](!0x0)),'new'!=_0x48588e['type']){const _0x1a79c0=St(_0x8aded5=>vt(_0x8aded5,'data-id')==_0x48588e['id'],_0x41c3fd['documentContextContent'],!0x0);_0xd0aae3['children']['push'](_0x1a79c0['cloneNode'](!0x0));}if(0x0==_0xd0aae3['children']['length']){if(_0x26dd4c['changes'][0x0]['anchorId']){const _0x455475=Dt('data-id',_0x26dd4c['changes'][0x0]['anchorId'],_0x41c3fd['documentContextContent']);_0xd0aae3['children']['unshift'](_0x455475['cloneNode'](!0x0)),_0x3d3744['children']['unshift'](_0x455475['cloneNode'](!0x0)),_0x455475['nextSibling']&&(_0xd0aae3['children']['push'](_0x455475['nextSibling']['cloneNode'](!0x0)),_0x3d3744['children']['push'](_0x455475['nextSibling']['cloneNode'](!0x0)));}else{const _0x50a606=_0x41c3fd['documentContextContent']['children'][0x0];if(!_0x50a606)return null;_0xd0aae3['children']['push'](_0x50a606['cloneNode'](!0x0)),_0x3d3744['children']['push'](_0x50a606['cloneNode'](!0x0));}}const _0x240f1e=_0x33e0b2['getDocumentContext'](),_0x210e67=_0x4cc289['data']['parse'](_0x240f1e['content']),_0xb04c2e=Ot(_0xd0aae3),_0x23efd7=_0x4cc289['data']['parse'](_0xb04c2e),_0x2ebde7=_0x4cc289['data']['parse'](_0xb04c2e),_0x4d7d4d=_0x4cc289['model']['createPositionAt'](_0x23efd7,0x0),_0x1b1573=Ot(_0x3d3744),_0x40f5f9={'anchor':_0x4d7d4d,'markDeletions':!0x1},_0x549252=_0x4cc289['plugins']['get'](ot)['getDiff'](_0xb04c2e,_0x1b1573,_0x40f5f9)['getOperations']();if(!_0x549252['length'])return null;_0x4cc289['model']['change'](_0x2f2fda=>{for(const _0x204124 of _0x549252)if('remove'==_0x204124['type']){const _0x4ef742=_0x204124['sourcePosition'],_0x4d7d37=_0x204124['howMany'],_0x1d7ab8=new ut(_0x4ef742,_0x4d7d37);_0x2f2fda['batch']['addOperation'](_0x1d7ab8),_0x4cc289['model']['applyOperation'](_0x1d7ab8);}else'marker'!==_0x204124['type']&&(_0x204124['baseVersion']=null,_0x204124['isDocumentOperation']=!0x1,_0x2f2fda['batch']['addOperation'](_0x204124),_0x4cc289['model']['applyOperation'](_0x204124));});const _0x3589af=wt(_0x4cc289,_0x549252,_0x23efd7);Et(_0x4cc289['model'],_0x3589af);const _0x46cb84=_0x3589af['getFirstRange']()['start']['path']['slice'](),_0x189419=_0x3589af['getFirstRange']()['end']['path']['slice'](),_0x110a69=[];let _0x564818=_0x23efd7,_0x2598fc=_0x2ebde7;for(let _0x532dfb=0x0;_0x532dfb<_0x189419['length'];_0x532dfb++){const _0x58cb06=_0x564818['maxOffset']-_0x189419[_0x532dfb];_0x110a69[_0x532dfb]=_0x2598fc['maxOffset']-_0x58cb06,_0x564818=_0x564818['getChildAtOffset'](_0x189419[_0x532dfb]),_0x2598fc=_0x2598fc['getChildAtOffset'](_0x110a69[_0x532dfb]);}const _0x30ca46=_0x4cc289['model']['createRange'](_0x4cc289['model']['createPositionFromPath'](_0x2ebde7,_0x46cb84),_0x4cc289['model']['createPositionFromPath'](_0x2ebde7,_0x110a69)),_0x306567=_0x2ebde7['getChild'](0x0)['getAttribute'](yt),_0xd3db9c=Array['from'](_0x210e67['getChildren']())['find'](_0x173394=>_0x173394['getAttribute'](yt)==_0x306567)['getPath'](),_0x400509=_0x30ca46['start']['path']['slice'](),_0x2758da=_0x30ca46['end']['path']['slice']();_0x400509[0x0]=_0xd3db9c[0x0]+_0x400509[0x0],_0x2758da[0x0]=_0xd3db9c[0x0]+_0x2758da[0x0];let _0x34cc20=_0x4cc289['model']['createRange'](_0x4cc289['model']['createPositionFromPath'](_0x4cc289['model']['document']['getRoot'](),_0x400509),_0x4cc289['model']['createPositionFromPath'](_0x4cc289['model']['document']['getRoot'](),_0x2758da));const _0x33b767=_0x4cc289['model']['document']['history']['getOperations'](_0x240f1e['version']);for(const _0x1a60c7 of _0x33b767)_0x34cc20=ct['_createFromRanges'](_0x34cc20['getTransformedByOperation'](_0x1a60c7));return{'range':_0x34cc20,'currentIndex':_0x4b20b0};}['_integrateEditor'](_0x363e68){if(!_0x363e68['plugins']['has']('Undo'))return;const _0x334947=_0x363e68['commands']['get']('undo'),_0x42b6bf=_0x363e68['commands']['get']('redo');this['listenTo'](_0x334947,'revert',(_0x29f0b9,_0x1df6d5,_0x339112)=>{const _0x46f491=this['_batchToChanges']['get'](_0x1df6d5);if(!_0x46f491)return;const _0x127a0f=this['activeConversation']['getInteraction'](_0x46f491['interactionId'])['getReply'](_0x46f491['replyId']);_0x46f491['indexes']['forEach'](_0x5abfa6=>_0x127a0f['setChangeGroupState'](_0x5abfa6,'pending')),this['_batchToChanges']['delete'](_0x1df6d5),this['_batchToChanges']['set'](_0x339112,_0x46f491);}),this['listenTo'](_0x42b6bf,'revert',(_0x51c516,_0x16ddd9,_0x51eb22)=>{const _0x227983=this['_batchToChanges']['get'](_0x16ddd9);if(!_0x227983)return;const _0x4623a4=this['activeConversation']['getInteraction'](_0x227983['interactionId'])['getReply'](_0x227983['replyId']);_0x227983['indexes']['forEach'](_0x4536e8=>_0x4623a4['setChangeGroupState'](_0x4536e8,'accepted')),this['_batchToChanges']['delete'](_0x16ddd9),this['_batchToChanges']['set'](_0x51eb22,_0x227983);});}async['loadConversation'](_0x366bcc){this['context']['plugins']['get'](st)['close'](),this['_aiChatUi']['setFeedItemRenderingStrategy']('static'),this['_aiChatUi']['toggleLoadingSkeleton'](!0x0),await this['_stopLastInteraction']();try{await this['_aiConnector']['fetchConversation'](_0x366bcc)['getConversation'](),await this['_startConversationSafely'](_0x366bcc),this['updateConversationTitle']('\x20');const {sessionId:_0x826eab}=this['_aiEditing']['getDocumentData']();await this['activeConversation']['load'](_0x366bcc,_0x826eab),this['activeConversation']['isCurrentDocumentInConversation']()&&this['activeConversation']['addCurrentDocumentToContext'](i(this['context']['locale'],'AI_CHAT_CONTEXT_CURRENT_DOCUMENT'));}catch(_0x3b36c3){this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_UNABLE_TO_LOAD_CONVERSATION'),'id':_0x366bcc}),this['_logError'](new _0x25e143('ai-chat-conversation-not-found',this,{'error':_0x3b36c3}));}finally{this['context']['plugins']['get'](Ct)['view']['activateTab']('chat'),this['_aiChatUi']['startAutoScroll'](),this['_aiChatUi']['setFeedItemRenderingStrategy']('streaming'),this['_aiChatUi']['toggleLoadingSkeleton'](!0x1);}}['handleRemovedConversation'](_0x4f2277){this['activeConversation']['id']===_0x4f2277&&this['_startConversationSafely']();}async['addSelectionToChatContext'](){const _0xea4514=this['_aiEditing']['getSelectionText']();this['activeConversation']?.['addSelectionToContext'](_0xea4514),this['activeConversation']?.['addCurrentDocumentToContext'](i(this['context']['locale'],'AI_CHAT_CONTEXT_CURRENT_DOCUMENT'));}['removeSelectionFromChatContext'](){this['activeConversation']?.['removeSelectionFromContext']();}['focusPromptInput'](){this['_aiChatUi']['focusPromptInput']();}async['startConversation'](){await this['_startConversationSafely']();}async['sendMessage']({message:_0x2fc566,quickActionData:_0x2564ed}){await this['_handleUIUserMessage']({'userMessage':_0x2fc566,'quickActionData':_0x2564ed});}['getGroupId'](){const _0x36a314=this['context']['config']['get']('collaboration.channelId');if(!_0x36a314)throw new _0x25e143('ai-chat-missing-channel-id',this);return _0x36a314;}async['_startConversationSafely'](_0x1cc689){try{this['_aiChatUi']['enableControls'](),await this['_handleStartConversation'](_0x1cc689);}catch(_0x287c7d){this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_UNABLE_TO_START_CONVERSATION'),'id':_0x1cc689||_0x23a3b0()}),console['error'](_0x287c7d),this['activeConversation']=void 0x0,this['_aiChatUi']['disableControls']();}}async['_handleStartConversation'](_0x4bc06a){const _0x62cade=this['context']['plugins']['get'](st);let _0x5a17bf;_0x62cade['isOpen']&&_0x62cade['close'](),_0x4bc06a||!this['activeConversation']?_0x5a17bf=this['context']['config']['get']('ai.chat.models.defaultModelId'):this['_aiChatUi']['isModelAvailable']&&(_0x5a17bf=this['activeConversation']['selectedModel']['id']),await this['_stopLastInteraction']();const _0x28c222=this['getGroupId'](),_0x498710=_0x4bc06a||_0x23a3b0();this['activeConversation']=new Tt({'connector':this['_aiConnector'],'chatModels':this['_aiChatModels'],'selectedModelId':_0x5a17bf,'conversationId':_0x498710,'group':_0x28c222,'getEditor':()=>q(this['context'])}),this['activeConversation']['on']('conversationInitialized',(_0x58bf15,_0x296b29)=>{this['_aiChatUi']['createConversation'](_0x296b29),this['_aiChatUi']['resetMessageInput'](),this['_aiChatUi']['clearPendingContextUI'](),this['_aiChatUi']['clearConversationContextUI'](),_0x4bc06a||(this['_aiChatUi']['resetConversationTitle'](),this['activeConversation']?.['addCurrentDocumentToContext'](i(this['context']['locale'],'AI_CHAT_CONTEXT_CURRENT_DOCUMENT')));}),this['activeConversation']['on']('uploadProgressChanged',(_0x76ecbf,_0x11f83f)=>{this['_aiChatUi']['setIsUploadInProgress'](_0x11f83f['isUploadInProgress']);}),this['activeConversation']['on']('interactionCreated',(_0x3bcd8c,_0x340727)=>{this['_aiChatUi']['addFeedItemUserMessage'](_0x340727);}),this['activeConversation']['on']('webSearchStarted',()=>{this['_aiChatUi']['setLoadingMessage']({'isWebSearchEnabled':!0x0,'isReasoningEnabled':!0x1});}),this['activeConversation']['on']('reasoningStarted',()=>{this['_aiChatUi']['setLoadingMessage']({'isWebSearchEnabled':!0x1,'isReasoningEnabled':!0x0});}),this['activeConversation']['on']('webSearchFinished',(_0x33a025,_0x10ce66)=>{this['_aiChatUi']['addFeedInteractionHeader'](_0x10ce66,{'isWebSearchEnabled':!0x0,'isReasoningEnabled':!0x1});}),this['activeConversation']['on']('reasoningFinished',(_0x14983d,_0x18a577)=>{this['_aiChatUi']['addFeedInteractionHeader'](_0x18a577,{'isWebSearchEnabled':!0x1,'isReasoningEnabled':!0x0});}),this['activeConversation']['on']('interactionStarted',()=>{this['_aiChatUi']['startInteraction']();}),this['activeConversation']['on']('interactionFinished',async()=>{await this['_aiChatUi']['finishInteraction']();}),this['activeConversation']['on']('interactionDestroyed',(_0x160f47,_0x3f483d)=>{this['_aiChatUi']['removeFeedInteraction'](_0x3f483d['id']);}),this['activeConversation']['on']('setConversationTitle',(_0x4b1bd6,_0x3898c8,_0x3c73c6)=>{this['updateConversationTitle'](_0x3898c8,_0x3c73c6);}),this['activeConversation']['on']('replyCreated',(_0x7b3afd,_0x457cc8)=>{'text-delta'===_0x457cc8['type']?this['_aiChatUi']['addFeedItemAIReply'](_0x457cc8):this['_aiChatUi']['addFeedItemAISuggestion'](_0x457cc8);}),this['activeConversation']['on']('replyContentUpdated',async(_0xe1edb5,_0x4ddea3)=>{await this['_updateReplyContent']({'reply':_0x4ddea3});}),this['activeConversation']['on']('replyChangeGroupStateUpdated',(_0x301266,{reply:_0x3d4800,index:_0x36db2d,state:_0x2b1e79})=>{this['_aiChatUi']['updateFeedItemAIReplySuggestionPartState']({'id':_0x3d4800['id'],'index':_0x36db2d,'state':_0x2b1e79});}),this['activeConversation']['on']('contextItemAdded',(_0x336575,_0x3a2635)=>{if(this['_aiChatUi']['addContextItem'](_0x3a2635['contextItem'],_0x3a2635['isLoading']),'selection'===_0x3a2635['contextItem']['type']){const _0x2ae1ef=[...q(this['context'])['model']['document']['selection']['getRanges']()];this['_aiEditing']['showFakeVisualSelection'](_0x2ae1ef,'ai-conversation-'+this['activeConversation']?.['id']);}}),this['activeConversation']['on']('contextItemRemoved',(_0x340523,_0xb3a55b)=>{this['_aiChatUi']['removeContextItem'](_0xb3a55b['uiId']),'current-document'==_0xb3a55b['uiId']&&this['removeSelectionFromChatContext'](),'selection'===_0xb3a55b['type']&&this['_aiEditing']['hideFakeVisualSelection']('ai-conversation-'+this['activeConversation']?.['id']);}),this['activeConversation']['on']('contextItemLoadingEnded',(_0xdf27fe,_0x1924a6)=>{this['_aiChatUi']['setContextItemLoading'](_0x1924a6['contextItem']['uiId'],_0x1924a6['isLoading']);}),this['activeConversation']['on']('contextSent',(_0x5d4342,_0x153438)=>{this['_aiChatUi']['setConversationContext'](_0x153438['contextItems']);}),this['activeConversation']['on']('addContextOptionsChanged',(_0x353fb9,_0x3b02ea)=>{this['_aiChatUi']['setAddContextOptions'](_0x3b02ea['options']);}),this['activeConversation']['on']('sourceResourcesLoaded',(_0x5b0af1,_0x16de36)=>{this['_aiChatUi']['populateSourceResourceBalloon'](_0x16de36['sourceId'],_0x16de36['source'],_0x16de36['resources'],_0x16de36['uid']);}),this['activeConversation']['on']('resourceStateChanged',(_0x2fd403,_0x34e013)=>{this['_aiChatUi']['updateResourceState'](_0x34e013['sourceId'],_0x34e013['resourceId'],_0x34e013['isInContext']);}),this['activeConversation']['on']('capabilitiesUpdated',(_0x1d12d8,_0x1f86d6)=>{this['_aiChatUi']['updateCapabilities'](_0x1f86d6);}),this['activeConversation']['on']('modelSelected',(_0x108ecd,_0x44e5c3)=>{this['_aiChatUi']['setSelectedModel'](_0x44e5c3['selectedModel'],_0x44e5c3['isDisabled']);}),this['activeConversation']['on']('error',(_0x21e05e,{error:_0x532c53,interactionId:_0x12514c,fileName:_0x125e59,url:_0x3d9861,sourceId:_0x51d6b7,sourceLabel:_0x39c533})=>{const _0xbc0115=_0x12514c?_0x12514c+':'+_0x23a3b0():_0x23a3b0();_0x532c53['message']['startsWith']('ai-request-aborted')?this['_aiChatUi']['addFeedItemStaticMessage']({'staticMessage':i(this['context']['locale'],'AI_CHAT_ABORTED_MESSAGE'),'id':_0xbc0115}):_0x532c53['message']['startsWith']('ai-chat-conversation-init-failed')||_0x532c53['message']['startsWith']('ai-chat-conversation-start-failed')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_UNABLE_TO_START_CONVERSATION'),'id':_0xbc0115}),this['_logError'](_0x532c53)):_0x532c53['message']['startsWith']('ai-chat-file-upload-failed')?this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_FILE',_0x125e59),'id':_0xbc0115}):_0x532c53['message']['startsWith']('ai-chat-url-upload-failed')?this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_URL',_0x3d9861),'id':_0xbc0115}):_0x532c53['message']['startsWith']('ai-chat-context-invalid-data')?this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_CONTEXT_INVALID_DATA'),'id':_0xbc0115}):_0x532c53['message']['startsWith']('ai-chat-context-unsupported-type')?this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_CONTEXT_UNSUPPORTED_TYPE'),'id':_0xbc0115}):_0x532c53['message']['startsWith']('ai-chat-source-resources-load-failed')?(_0x51d6b7&&this['_aiChatUi']['closeSourceResourceBalloon'](_0x51d6b7),this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_LOAD_RESOURCES',_0x39c533||'source'),'id':_0xbc0115}),this['_logError'](_0x532c53)):_0x532c53['message']['startsWith']('ai-chat-resource-load-failed')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_RESOURCE_LOAD_FAILED'),'id':_0xbc0115}),this['_logError'](_0x532c53)):_0x532c53['message']['startsWith']('ai-chat-invalid-request')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_INVALID_REQUEST'),'id':_0xbc0115}),this['_logError'](_0x532c53)):_0x532c53['message']['startsWith']('ai-chat-context-unsupported-file-type')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_CONTEXT_UNSUPPORTED_FILE_TYPE'),'id':_0xbc0115}),this['_logError'](_0x532c53)):_0x532c53['message']['startsWith']('ai-chat-context-file-too-large')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_CONTEXT_FILE_TOO_LARGE'),'id':_0xbc0115}),this['_logError'](_0x532c53)):_0x532c53['message']['startsWith']('ai-chat-context-file-too-many-pages')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_CONTEXT_FILE_TOO_MANY_PAGES'),'id':_0xbc0115}),this['_logError'](_0x532c53)):_0x532c53['message']['startsWith']('ai-chat-context-form-data-size-limits-exceeded')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_CONTEXT_FORM_DATA_SIZE_LIMITS_EXCEEDED'),'id':_0xbc0115}),this['_logError'](_0x532c53)):(this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_GENERIC_ERROR'),'id':_0xbc0115}),this['_logError'](_0x532c53));}),await this['activeConversation']['init'](this['context']['config']['get']('ai.chat.context')),_0x4bc06a||await this['activeConversation']['start']();}async['_handleUIUserMessage']({userMessage:_0x3e4ca6,quickActionData:_0x492af7}){if(!this['activeConversation'])throw new _0x25e143('ai-chat-controller-no-active-conversation');this['activeConversation']['isCurrentDocumentInContext']()&&await this['activeConversation']['updateCurrentDocumentInContext'](this['_aiEditing']['getDocumentData']()),this['activeConversation']['id']&&this['activeConversation']['isStarted']&&await this['activeConversation']['handleUserInteraction']({'userMessage':_0x3e4ca6,'quickActionData':_0x492af7}),this['_removeAISelectionMarkers']();}['_removeAISelectionMarkers'](){const _0x20e4ec=q(this['context'])['model'],_0x3bb895=Array['from'](_0x20e4ec['markers']['getMarkersGroup'](It));_0x20e4ec['change'](_0x30e52f=>{_0x3bb895['forEach'](_0x214971=>_0x30e52f['removeMarker'](_0x214971));});}['_showConversationHistory'](){console['log']('Showing\x20conversation\x20history...');}['_setIsMaximized'](_0x4b414b){this['_aiChatUi']['setIsMaximized'](_0x4b414b);}['_logError'](_0x3fe403){ft(_0x3fe403['message']);}['_removeFromContext'](_0x17bec0){this['activeConversation']?.['removeFromContext'](_0x17bec0);}['_toggleWebSearch'](){this['activeConversation']?.['toggleWebSearch']();}['_toggleReasoning'](){this['activeConversation']?.['toggleReasoning']();}['getInteractionAndReplyById'](_0x3d0cce){const [_0x3e3043,_0x18f2a7]=_0x3d0cce['split'](':'),_0x22cf43=this['activeConversation']['getInteraction'](_0x3e3043),_0x21b632=_0x22cf43['getReply'](_0x18f2a7);return{'interaction':_0x22cf43,'reply':_0x21b632};}['_scrollToSuggestionRange'](_0x52ac34,_0xf4668=!0x1){const _0x2321a0=q(this['context']),_0x17fb18={'target':_0x2321a0['editing']['view']['domConverter']['viewRangeToDom'](_0x2321a0['editing']['mapper']['toViewRange'](_0x52ac34)),'viewportOffset':{'top':0x96,'left':0x0,'bottom':0x32,'right':0x0},'ancestorOffset':0x14,'alignToTop':_0xf4668};_0xf4668&&(_0x17fb18['alignToTop']=!0x0),_0xc42cd2(_0x17fb18);}['updateConversationTitle'](_0x2d2903,_0x358209=!0x1){this['_aiChatUi']['setConversationTitle'](_0x2d2903||i(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION'),_0x358209);}async['_updateReplyContent']({reply:_0x34583b,renderingStrategy:_0x5ece43}){const {id:_0x3f2a05,isDone:_0xc3671b,type:_0x111620,parsedContent:_0x216186}=_0x34583b;if('modification-delta'===_0x111620){const _0x34d283=_0x34583b['getContentParts']({'showDiff':this['_aiChatUi']['showDiff']});await this['_aiChatUi']['updateFeedItemAIReplySuggestionContent']({'id':_0x3f2a05,'parts':_0x34d283,'renderingStrategy':_0x5ece43,'isDone':_0xc3671b});}else'text-delta'===_0x111620&&await this['_aiChatUi']['updateFeedItemAIReplyContent']({'id':_0x3f2a05,'parsedContent':_0x216186,'renderingStrategy':_0x5ece43,'isDone':_0xc3671b});_0xc3671b&&_0x34583b['sources']['length']>0x0&&this['_aiChatUi']['updateFeedItemAIReplySources'](_0x3f2a05,_0x34583b['sources']);}async['_stopLastInteraction'](){const _0x4867c4=this['activeConversation']?.['lastInteraction'];_0x4867c4&&(_0x4867c4['stop'](),this['_aiChatUi']['stopInteraction'](_0x4867c4));}async['_flushLastInteractionUI'](){const _0x2b4dfc=this['activeConversation']?.['lastInteraction'];if(_0x2b4dfc){for await(const _0x1bd45a of _0x2b4dfc['replies'])await this['_updateReplyContent']({'reply':_0x1bd45a,'renderingStrategy':'static'});}}['_updateRatings'](_0x54181f){const _0x4d2f06={'positiveCount':_0x54181f['changeGroups']['filter'](_0x3aad2d=>'accepted'===_0x3aad2d['state'])['length'],'totalCount':_0x54181f['changeGroups']['length'],'modificationId':_0x54181f['id']},_0x43ec10=this['activeConversation']['getInteraction'](_0x54181f['interactionId'])['messageId'];this['_aiConnector']['upsertAIChatRating'](this['activeConversation']['id'],_0x43ec10,_0x4d2f06);}}const Mt=[...Ee,'startConversation','resizeTabs','sendUserMessage','abortPromptStream','addDocumentToContext','addFileToContext','addUrlToContext','addResourceToContext','removeContextItem','loadSourceResources','toggleWebSearch','toggleReasoning','selectModel'];class Le extends Fr{['containerView'];['actionsView'];constructor(_0x2317a6,_0x5ee912,_0x4c0d86){super(_0x5ee912),this['set']('isTrackChangesOn',!0x1),this['containerView']=new F(_0x2317a6,{'showDiff':_0x5ee912['showDiff'],'areActionsDisabled':_0x5ee912['areActionsDisabled'],'availableActions':_0x5ee912['availableActions']},_0x4c0d86),this['containerView']['on']('toggleSuggestionDisplayMode',(_0x1456f1,_0x149a3f)=>{this['fire']('toggleSuggestionDisplayMode',{'replyId':this['options']['id'],'showDiff':_0x149a3f['showDiff']});}),this['containerView']['on']('like',()=>{this['fire']('like',{'replyId':this['options']['id']});}),this['containerView']['on']('dislike',()=>{this['fire']('dislike',{'replyId':this['options']['id']});}),this['containerView']['on']('showChangeInText',(_0x5286e0,{index:_0x419fb3})=>{this['fire']('showChangeInText',{'replyId':this['options']['id'],'partIndex':_0x419fb3});}),this['containerView']['on']('insertSuggestion',(_0x1693ef,{index:_0x2a8d13})=>{this['fire']('insertSuggestion',{'replyId':this['options']['id'],'partIndex':_0x2a8d13});}),this['containerView']['on']('rejectSuggestion',(_0x1712f7,{index:_0x421f03})=>{this['fire']('rejectSuggestion',{'replyId':this['options']['id'],'partIndex':_0x421f03});}),this['containerView']['on']('mouseOverSuggestion',(_0xd00287,{index:_0x53e845})=>{this['fire']('mouseOverSuggestion',{'replyId':this['options']['id'],'partIndex':_0x53e845});}),this['containerView']['on']('mouseLeaveSuggestion',(_0x29ba5d,{index:_0x54fa0a})=>{this['fire']('mouseLeaveSuggestion',{'replyId':this['options']['id'],'partIndex':_0x54fa0a});}),this['actionsView']=new ah(_0x2317a6,this['options']['availableActions']),this['actionsView']['bind']('isTrackChangesOn')['to'](this,'isTrackChangesOn'),this['actionsView']['on']('showChangeInText',()=>{this['fire']('showChangeInText',{'replyId':this['options']['id']});}),this['actionsView']['on']('insertSuggestion',()=>{this['fire']('insertSuggestion',{'replyId':this['options']['id']});}),this['actionsView']['on']('applySuggestion',()=>{this['fire']('applySuggestion',{'replyId':this['options']['id']});}),_0x5ee912['areActionsDisabled']?this['actionsView']['isEnabled']=!0x1:this['actionsView']['bind']('isEnabled')['to'](this['containerView']['bodyView'],'hasPendingParts'),this['children']['addMany']([this['containerView'],this['actionsView']]),this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__ai-suggestion']}});}async['updateContent'](_0x54f51f){await this['containerView']['updateContent'](_0x54f51f),this['actionsView']['updateLabels'](this['containerView']['bodyView']['partsCount']);}['updatePartState'](_0x4a55c8,_0x4c4873){this['containerView']['bodyView']['updatePartState'](_0x4a55c8,_0x4c4873);}['updateSources'](_0x552acb){this['containerView']['updateSources'](_0x552acb);}['getPartView'](_0x415b62){return this['containerView']['bodyView']['getPartView'](_0x415b62);}['markAsDone'](){super['markAsDone'](),this['containerView']['markAsDone'](),this['actionsView']['isVisible']=this['containerView']['bodyView']['hasNonEmptyParts'];}}class Ve extends Fr{['replyContainer'];['_bodyCollection'];constructor(_0x4aa528,_0x30b467,_0x20d6ae){super(_0x30b467),this['_bodyCollection']=_0x20d6ae,this['locale']=_0x4aa528,this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__ai-reply']}}),this['replyContainer']=new _0x55515f(),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':He(this['options']['initialContent']),'renderingStrategy':'static'}),this['markAsDone']());}async['updateContent']({parsedContent:_0x4a042d,renderingStrategy:_0x45d34c,abortSignal:_0xabfbc9}){'streaming'===_0x45d34c?await this['streamIntoElement'](_0x4a042d,this['replyContainer']['element'],_0xabfbc9):this['replyContainer']['element']['innerHTML']=_0x3ae693(_0x4a042d);}['updateSources'](_0x117f97){const _0x5325ff=new Sr(this['locale'],this['_bodyCollection']);_0x5325ff['children']['addMany'](_0x117f97['map'](_0x5e81f1=>new Rr(this['locale'],_0x5e81f1,_0x5325ff['balloonPanelView']))),_0x5325ff['isVisible']=!0x0,this['children']['add'](_0x5325ff);}}const xn={'file':_0x5b1096,'document':_0x366289,'web-resource':_0x41d008,'text':_0x5b1096,'selection':_0x3be534},$r='ck-ai-chat-context-chip',Qr='ck-ai-chat-context-chip_wide',Zr='ck-ai-chat-context-chip_document',ra='ck-ai-chat-context-chip__label',oa='ck-ai-chat-context-chip__type-icon',ca='ck-ai-chat-context-controls__chip-tooltip',Cn='n';class Bo extends _0x5cf211{constructor(_0x37e5cd,_0x861347,_0x407b7f,_0x4caafd,_0x27ff31=!0x1){super(_0x37e5cd),this['_isAnimationOnEnterEnabled']=_0x4caafd,this['_initializeProperties'](_0x861347,_0x407b7f,_0x27ff31),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'](_0x110ea7,_0x1e2256,_0x1799c0){this['set']('label',_0x110ea7['label']),this['set']('tooltip',!0x0),this['set']('itemType',_0x110ea7['type']),this['set']('id',_0x110ea7['uiId']),this['set']('readonly',_0x1e2256),this['set']('isLoading',_0x1799c0);}['_setupTemplate'](){const _0x2d494a=this['_createIconView'](),_0x1c5ae5=this['_createRemoveButton'](),_0x101ea7=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':this['_createTemplateAttributes'](_0x101ea7),'children':this['_createTemplateChildren'](_0x2d494a,_0x1c5ae5,_0x101ea7)});}['_createTemplateAttributes'](_0x508977){return{'class':[$r,_0x508977['if']('itemType',Zr,_0x483834=>'document'==_0x483834),_0x508977['if']('itemType',Qr,_0x8b4278=>'selection'==_0x8b4278)],'data-cke-tooltip-text':_0x508977['to']('label',In),'data-cke-tooltip-position':Cn,'data-cke-tooltip-class':ca};}['_createTemplateChildren'](_0x3d1ce1,_0x2cb735,_0xf0227d){const _0x24c4e1=this['_createLabelElement'](_0xf0227d),_0x489a12=this['_createLoaderIcon']();return this['readonly']?[_0x3d1ce1,_0x24c4e1]:[_0x3d1ce1,_0x489a12,_0x24c4e1,_0x2cb735];}['_createLabelElement'](_0x5b29ca){return{'tag':'span','attributes':{'class':ra},'children':[{'text':_0x5b29ca['to']('label')}]};}['_createRemoveButton'](){const _0x18557f=new _0x5cf211(this['locale']);return _0x18557f['set']({'label':i(this['locale'],'AI_CHAT_CONTEXT_REMOVE_FROM_CONTEXT'),'icon':_0x39dbfa}),this['_setupRemoveButtonEvent'](_0x18557f),_0x18557f;}['_setupRemoveButtonEvent'](_0x530d57){_0x530d57['on']('execute',()=>{this['fire']('removeContextItemChip',this['id']);});}['_createIconView'](){const _0x3c4d0c=this['bindTemplate'],_0xef9ccc=new _0x1e0173();return _0xef9ccc['content']=xn[this['itemType']],_0xef9ccc['extendTemplate']({'attributes':{'class':[oa,_0x3c4d0c['if']('isLoading','ck-hidden',_0x11c2cc=>_0x11c2cc)]}}),_0xef9ccc;}['_handleAnimationEndOnce'](_0x102819,_0x292c0e){if(!_0x102819)return;const _0x422184=()=>{_0x292c0e(),_0x102819['removeEventListener']('animationend',_0x422184),_0x102819['removeEventListener']('webkitAnimationEnd',_0x422184);};_0x102819['addEventListener']('animationend',_0x422184),_0x102819['addEventListener']('webkitAnimationEnd',_0x422184);}['_createLoaderIcon'](){const _0x24ebf5=new We('small');return _0x24ebf5['bind']('isVisible')['to'](this,'isLoading',_0x5d8934=>_0x5d8934),_0x24ebf5;}}function In(_0x5391dc){if(!_0x5391dc)return _0x5391dc;if(_0x5391dc['length']<=0x78)return _0x5391dc;const _0x4c602a=_0x5391dc['slice'](0x0,0x78),_0x56b1a4=_0x4c602a['lastIndexOf']('\x20');return(_0x56b1a4>0x0?_0x4c602a['slice'](0x0,_0x56b1a4):_0x4c602a)+'…';}const hn={'maxVisibleRows':0x2,'rowDetectionTolerance':0x5,'showMoreLabelPrefix':'+\x20','viewportOffset':{'top':0x64,'bottom':0xa}},an='300px';class To{['_locale'];['_config'];['_visibleChips'];['_overflowChips'];['_showMoreButtonView']=null;['_showMoreBalloonPanelView']=null;['_containerElement']=null;['_bodyCollection'];['_parentView']=null;['_intersectionObserver']=null;['_pendingCalculation']=!0x1;constructor(_0x4b18d7,_0x3065be,_0x1afd26,_0x281b6e,_0x238220){this['_locale']=_0x4b18d7,this['_visibleChips']=_0x3065be,this['_config']={...hn,..._0x1afd26,'cssClasses':{'controlsButton':'','calculationContainer':'ck-calculation-container',..._0x1afd26['cssClasses']}},this['_overflowChips']=new _0xffd920(),this['_bodyCollection']=_0x281b6e,this['_parentView']=_0x238220||null;}['setContainerElement'](_0x503e1e){this['_intersectionObserver']&&(this['_intersectionObserver']['disconnect'](),this['_intersectionObserver']=null),this['_containerElement']=_0x503e1e,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 _0x50623e=[...this['_visibleChips'],...this['_overflowChips']],_0x61a4e3=this['_createCalculationContainer'](),_0x54371c=this['_calculateOverflowInContainer'](_0x61a4e3,_0x50623e),_0x4137f0=_0x61a4e3['_ancestorsToRestore'];_0x4137f0&&this['_restoreAncestorVisibility'](_0x4137f0),_0x61a4e3['remove'](),this['_applyOverflowResults'](_0x50623e,_0x54371c);}['_createShowMoreButton'](){this['_showMoreButtonView']=this['_createShowMoreButtonView'](),this['_showMoreBalloonPanelView']=this['_createShowMoreBalloonPanelView'](),this['_showMoreButtonView']['render'](),this['_containerElement']['appendChild'](this['_showMoreButtonView']['element']),this['_showMoreButtonView']['on']('execute',()=>{this['_handleShowMoreButtonClick']();}),_0x1411c6({'emitter':this['_showMoreBalloonPanelView'],'contextElements':[this['_showMoreBalloonPanelView']['element'],this['_showMoreButtonView']['element']],'callback':()=>this['hideBalloonPanel'](),'activator':()=>this['_showMoreButtonView']['isOn']});}['_createShowMoreButtonView'](){const _0x1d13c0=new _0x5cf211(this['_locale']);_0x1d13c0['set']({'label':'','withText':!0x0,'isToggleable':!0x0});const _0x3fe71a=[this['_config']['cssClasses']['showMoreButton']];return this['_config']['cssClasses']['controlsButton']&&_0x3fe71a['push'](this['_config']['cssClasses']['controlsButton']),_0x1d13c0['extendTemplate']({'attributes':{'class':_0x3fe71a}}),_0x1d13c0;}['_createShowMoreBalloonPanelView'](){const _0x4462a5=new _0x564e6d(this['_locale']);return _0x4462a5['extendTemplate']({'attributes':{'class':this['_config']['cssClasses']['showMoreBalloon']}}),this['_bodyCollection']['add'](_0x4462a5),_0x4462a5;}['_updateBalloonContent'](){if(this['_showMoreBalloonPanelView']&&(this['_showMoreBalloonPanelView']['content']['clear'](),this['_overflowChips']['length']>0x0)){this['_overflowChips']['forEach'](_0x2d84ce=>{_0x2d84ce['disableAnimationOnEnter']();});const _0x3b210e=new _0x55515f(this['_locale']);_0x3b210e['setTemplate']({'tag':'div','attributes':{'class':this['_config']['cssClasses']['overflowContainer']},'children':this['_overflowChips']}),this['_showMoreBalloonPanelView']['content']['add'](_0x3b210e);}}['_handleShowMoreButtonClick'](){this['_showMoreButtonView']['isOn']?this['hideBalloonPanel']():this['showBalloonPanel']();}['_updateShowMoreButtonVisibility'](){const _0x33bfed=this['_overflowChips']['length']>0x0;this['_showMoreButtonView']?.['element']&&(this['_showMoreButtonView']['element']['style']['display']=_0x33bfed?'':'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'](_0x4ca22c){const _0x4e34ab=this['_containerElement']?.['tagName']['toLowerCase']()||'div',_0x5100a7=this['_containerElement']?.['classList'];if(_0x5100a7){const _0x2c3b37=_0x5100a7[0x0]||'',_0x464fd6=_0x4ca22c['querySelector']('.'+_0x2c3b37),_0x44ac41=_0x4ca22c['querySelector'](_0x4e34ab);return _0x464fd6||_0x44ac41||_0x4ca22c;}return _0x4ca22c['querySelector'](_0x4e34ab)||_0x4ca22c;}['_calculateContainerWidth'](){const _0xe765f6=this['_parentView']?.['element']||this['_containerElement'];if(!_0xe765f6)return an;const _0x56134f=window['getComputedStyle'](_0xe765f6)['width'];if('auto'===_0x56134f||'0px'===_0x56134f||!_0x56134f){const _0x4c3d43=_0xe765f6['parentElement'];if(_0x4c3d43){const _0x59fa12=window['getComputedStyle'](_0x4c3d43);return'auto'!==_0x59fa12['width']?_0x59fa12['width']:an;}return an;}return _0x56134f;}['_applyCalculationStyles'](_0x1a68ad,_0x21c70e){this['_config']['cssClasses']['calculationContainer']&&_0x1a68ad['classList']['add'](this['_config']['cssClasses']['calculationContainer']),_0x1a68ad['style']['width']=_0x21c70e,_0x1a68ad['style']['position']='absolute',_0x1a68ad['style']['top']='-9999px',_0x1a68ad['style']['left']='-9999px',_0x1a68ad['style']['opacity']='0',_0x1a68ad['style']['pointerEvents']='none',_0x1a68ad['style']['zIndex']='-1',_0x1a68ad['style']['visibility']='visible\x20!important',_0x1a68ad['style']['display']='block\x20!important',_0x1a68ad['style']['boxSizing']='border-box';}['_restoreAncestorVisibility'](_0x1163ef){_0x1163ef['forEach'](({element:_0x358a4e,originalDisplay:_0x53da42,originalVisibility:_0x21fbb9})=>{_0x358a4e['style']['display']=_0x53da42,_0x358a4e['style']['visibility']=_0x21fbb9;});}['_makeAncestorsVisible'](_0x5508eb){const _0x35d9d4=[];let _0x2ce66c=_0x5508eb;for(;_0x2ce66c&&_0x2ce66c!==document['body'];){const _0x3daa67=window['getComputedStyle'](_0x2ce66c);'none'!==_0x3daa67['display']&&'hidden'!==_0x3daa67['visibility']||(_0x35d9d4['push']({'element':_0x2ce66c,'originalDisplay':_0x2ce66c['style']['display'],'originalVisibility':_0x2ce66c['style']['visibility']}),_0x2ce66c['style']['display']='block',_0x2ce66c['style']['visibility']='visible'),_0x2ce66c=_0x2ce66c['parentElement'];}return _0x35d9d4;}['_createContainerElements'](){let _0x5265a0,_0x208241;return this['_parentView']?.['element']?(_0x5265a0=this['_parentView']['element']['cloneNode'](!0x0),_0x208241=this['_findTargetContainer'](_0x5265a0)):(_0x5265a0=document['createElement']('div'),_0x208241=_0x5265a0),{'calculationContainer':_0x5265a0,'targetContainer':_0x208241};}['_createCalculationContainer'](){const {calculationContainer:_0x3d1eda,targetContainer:_0x27bfb4}=this['_createContainerElements'](),_0x212a3e=this['_calculateContainerWidth']();this['_applyCalculationStyles'](_0x3d1eda,_0x212a3e);const _0x171fa4=this['_parentView']?.['element']||this['_containerElement'],_0x20dc30=_0x171fa4?.['parentElement'];_0x20dc30?_0x20dc30['appendChild'](_0x3d1eda):document['body']['appendChild'](_0x3d1eda),_0x3d1eda['_targetContainer']=_0x27bfb4;const _0x1794d4=this['_makeAncestorsVisible'](_0x20dc30||null);return _0x3d1eda['offsetWidth'],_0x3d1eda['_ancestorsToRestore']=_0x1794d4,_0x3d1eda;}['_calculateOverflowInContainer'](_0x594741,_0x4fd52a){const _0x1361ff=_0x594741['_targetContainer']||_0x594741,_0x24691d=[],{rowCount:_0x2d57a9}=this['_renderChipsAndCountRows'](_0x1361ff,_0x4fd52a);if(_0x2d57a9<=this['_config']['maxVisibleRows'])return _0x24691d;const _0x335b45=_0x4fd52a['slice']();for(;_0x335b45['length']>0x0;){if(this['_testButtonFit'](_0x594741,_0x1361ff,_0x335b45)){const _0x41b988=_0x4fd52a['filter'](_0x39c916=>!_0x335b45['includes'](_0x39c916));_0x24691d['push'](..._0x41b988);break;}if(!_0x335b45['pop']())break;}return _0x24691d;}['_renderChipsAndCountRows'](_0x2ed7a6,_0x529820){_0x2ed7a6['innerHTML']='',_0x529820['forEach'](_0x53e0ac=>{if(_0x53e0ac['element']){const _0x49a0ae=_0x53e0ac['element']['cloneNode'](!0x0);_0x2ed7a6['appendChild'](_0x49a0ae);}}),_0x2ed7a6['offsetWidth'];const _0x129744=_0x2ed7a6['children'],_0x5d635a=[];return Array['from'](_0x129744)['forEach'](_0x121f52=>{const _0x2b033d=_0x121f52['getBoundingClientRect']()['top'];_0x5d635a['some'](_0x56b8cf=>Math['abs'](_0x56b8cf-_0x2b033d)<this['_config']['rowDetectionTolerance'])||_0x5d635a['push'](_0x2b033d);}),{'rowCount':_0x5d635a['length']};}['_createMockButton'](){const _0x3ab348=document['createElement']('button');return _0x3ab348['className']=this['_config']['cssClasses']['showMoreButton'],this['_config']['cssClasses']['controlsButton']&&_0x3ab348['classList']['add'](this['_config']['cssClasses']['controlsButton']),_0x3ab348['textContent']='+\x201',_0x3ab348;}['_testButtonFit'](_0x9a1838,_0x2199da,_0x3da7fe){this['_renderChipsAndCountRows'](_0x2199da,_0x3da7fe);const _0x361d25=this['_createMockButton']();_0x9a1838['appendChild'](_0x361d25),_0x9a1838['offsetWidth'];const _0x1bd204=[..._0x2199da['children'],_0x361d25],_0x6b95fe=[];_0x1bd204['forEach'](_0x3faa0c=>{const _0x5199f0=_0x3faa0c['getBoundingClientRect']()['top'];_0x6b95fe['some'](_0x961193=>Math['abs'](_0x961193-_0x5199f0)<this['_config']['rowDetectionTolerance'])||_0x6b95fe['push'](_0x5199f0);});const _0x522b4a=_0x6b95fe['length'];return _0x361d25['remove'](),_0x522b4a<=this['_config']['maxVisibleRows'];}['_distributeChips'](_0x28ab77,_0x3818b6){this['_visibleChips']['clear'](),this['_overflowChips']['clear'](),_0x28ab77['forEach'](_0x3eaa31=>{_0x3818b6['includes'](_0x3eaa31)?this['_overflowChips']['add'](_0x3eaa31):this['_visibleChips']['add'](_0x3eaa31);});}['_updateOverflowUI'](_0x36a97f){if(_0x36a97f>0x0&&!this['_showMoreButtonView']&&this['_createShowMoreButton'](),_0x36a97f>0x0&&this['_showMoreButtonView']){const _0x498f4c=''+this['_config']['showMoreLabelPrefix']+(_0x36a97f<0x63?_0x36a97f:'99');this['_showMoreButtonView']['label']=_0x498f4c;}this['_updateBalloonContent'](),this['_updateShowMoreButtonVisibility'](),this['_repinBalloonPanel']();}['_applyOverflowResults'](_0x74c93c,_0x50f093){this['_distributeChips'](_0x74c93c,_0x50f093),this['_updateOverflowUI'](_0x50f093['length']);}['_setupVisibilityObserver'](){this['_containerElement']&&'undefined'!=typeof IntersectionObserver&&(this['_intersectionObserver']=new IntersectionObserver(_0x1855ac=>{_0x1855ac[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 _0x1ee53a=this['_containerElement']['getBoundingClientRect']();if(0x0===_0x1ee53a['width']||0x0===_0x1ee53a['height'])return!0x1;const _0x3d1fdb=window['innerHeight']||document['documentElement']['clientHeight'],_0x28615a=window['innerWidth']||document['documentElement']['clientWidth'],_0x50cabc=0xc8;return _0x1ee53a['bottom']>=-0xc8&&_0x1ee53a['top']<=_0x3d1fdb+_0x50cabc&&_0x1ee53a['right']>=-0xc8&&_0x1ee53a['left']<=_0x28615a+_0x50cabc;}}const la='ck-ai-chat__feed__context-chips',da='ck-ai-chat-context-chips-wrapper',ua='ck-ai-chat-context-chips-wrapper-balloon',_a='ck-ai-chat-controls-button',Ia='ck-ai-chat-controls_context_show-more-button',Aa='ck-ai-chat-context-controls__show-more-balloon-panel';class _h extends _0x55515f{['_contextChips']=this['createCollection']();['_overflowManager'];['_bodyCollection'];constructor(_0x8ff761,_0x581a00,_0x519d7e){super(_0x8ff761),this['_bodyCollection']=_0x519d7e,this['_createContextChips'](_0x581a00);const _0x2219fc={'cssClasses':{'showMoreButton':Ia,'showMoreBalloon':Aa,'overflowContainer':ua,'controlsButton':_a}};this['_overflowManager']=new To(_0x8ff761,this['_contextChips'],_0x2219fc,this['_bodyCollection'],this),this['setTemplate']({'tag':'div','attributes':{'class':[la,'ck','ck-reset_all']},'children':[{'tag':'div','attributes':{'class':da},'children':this['_contextChips']}]});}['render'](){super['render']();const _0x471e35=this['element']['querySelector']('.'+da);_0x471e35&&(this['_overflowManager']['setContainerElement'](_0x471e35),this['_overflowManager']['reorganizeChips']());}['destroy'](){super['destroy'](),this['_overflowManager']['destroy']();}['_createContextChips'](_0x134a1e){for(const _0x4d76d8 of _0x134a1e){const _0x3ac544=new Bo(this['locale'],_0x4d76d8,!0x0,!0x1);this['_contextChips']['add'](_0x3ac544);}}}class Me extends Fr{['_contextChipsView']=null;['_locale'];['_bodyCollection'];['_messageContentView'];constructor(_0x49747e,_0x40d5bf,_0x399974){super(_0x40d5bf),this['_locale']=_0x49747e,this['_bodyCollection']=_0x399974,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 _h(this['_locale'],this['options']['contextItems']['filter'](_0x280263=>!_0x280263['hidden']),this['_bodyCollection']),this['_contextChipsView']['extendTemplate']({'attributes':{'class':'ck-ai-chat__feed__context-chips'}}),this['children']['add'](this['_contextChipsView']));}['_createMessageContentView'](){this['_messageContentView']=new _0x55515f(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 Lt extends Fr{['capabilities'];constructor(_0x58b35f,_0x655ee1){super(_0x655ee1);const {isWebSearchEnabled:_0x5d80bb,isReasoningEnabled:_0x40c55b}=_0x655ee1['capabilities'],_0x5889c5=[];let _0xa6890b='';_0x5d80bb&&_0x40c55b?(_0xa6890b=i(_0x58b35f,'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH_REASONING'),_0x5889c5['push'](aa(_0x4f3dd0)),_0x5889c5['push'](aa(_0x458e80))):_0x5d80bb?(_0xa6890b=i(_0x58b35f,'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH'),_0x5889c5['push'](aa(_0x4f3dd0))):_0x40c55b&&(_0xa6890b=i(_0x58b35f,'AI_CHAT_FEED_REPLY_ITEM_USED_REASONING'),_0x5889c5['push'](aa(_0x458e80))),this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__interaction-header',_0xa6890b?'':'ck-hidden']}});const _0x450fcb=new _0x55515f();_0x450fcb['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__interaction-header__capabilities']},'children':[..._0x5889c5,{'tag':'span','attributes':{'class':['ck-ai-chat__feed__interaction-header__capabilities__text']},'children':[_0xa6890b]}]}),this['children']['add'](_0x450fcb),this['capabilities']=_0x655ee1['capabilities'];}}function aa(_0x109346){const _0x26a46b=new _0x1e0173();return _0x26a46b['content']=_0x109346,_0x26a46b;}class Pe extends _0x55515f{constructor(_0x364484,_0x1b54fa){super(_0x364484),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-skeleton']},'children':this['_createSkeletonItems'](_0x1b54fa)});}['_createSkeletonItems'](_0xcd10a5){const _0x464037=['ck','ck-ai-skeleton__item'];return _0xcd10a5['map'](_0x368733=>{let _0x4a1999='';switch(_0x368733['attributes']['align']){case'right':_0x4a1999='margin-left:\x20auto;\x20margin-right:\x200;\x20text-align:\x20right;';break;case'center':_0x4a1999='margin-left:\x20auto;\x20margin-right:\x20auto;\x20text-align:\x20center;';break;case'left':_0x4a1999='margin-left:\x200;\x20margin-right:\x20auto;\x20text-align:\x20left;';}return{'tag':_0x368733['tag'],'attributes':{'class':[..._0x464037,_0x368733['attributes']['class']?_0x368733['attributes']['class']:''],'style':'width:\x20'+_0x368733['attributes']['width']+';\x20height:\x20'+_0x368733['attributes']['height']+';'+_0x4a1999}};});}}const Be={'aiFeed':[{'tag':'div','attributes':{'width':'100%','height':'72px','align':'right'}},{'tag':'div','attributes':{'width':'250px','height':'40px','align':'right'}},{'tag':'div','attributes':{'width':'100%','height':'88px','align':'right'}},{'tag':'div','attributes':{'width':'150px','height':'40px','align':'right'}},{'tag':'div','attributes':{'width':'100%','height':'140px','align':'right'}},{'tag':'div','attributes':{'width':'250px','height':'40px','align':'right'}},{'tag':'div','attributes':{'width':'100%','height':'88px','align':'right'}}],'aiHistory':ta(0x5,'100%','44px','right'),'aiChatResources':ta(0x8,'100%','24px','right'),'aiReviewChecks':[{'tag':'div','attributes':{'width':'128px','height':'24px','align':'left'}},{'tag':'div','attributes':{'width':'100%','height':'24px','align':'left'}},{'tag':'div','attributes':{'width':'128px','height':'24px','align':'left'}}]};function ta(_0x43ae6e,_0x238c29,_0x234ec4,_0x4e7074){return new Array(_0x43ae6e)['fill'](null)['map'](()=>({'tag':'div','attributes':{'width':_0x238c29,'height':_0x234ec4,'align':_0x4e7074}}));}class pi extends _0x55515f{['children'];['scrollManager'];['_bodyCollection'];constructor(_0x1fad41,_0x60a6a0){super(_0x1fad41),this['_bodyCollection']=_0x60a6a0,this['set']('isPending',!0x1),this['set']('loadingMessage',''),this['set']('isLoadingSkeletonVisible',!0x1),this['set']('isTrackChangesOn',!0x1),this['children']=this['createCollection'](),this['children']['delegate'](...Mt)['to'](this),this['_setupTemplate']();}['render'](){super['render'](),this['scrollManager']=new us(this['element']);}['destroy'](){super['destroy'](),this['scrollManager']['destroy']();}['clear'](){this['children']['clear']();}['addItem'](_0x17f38d,_0x418e77){let _0x4058e9;'ai-reply'===_0x17f38d?_0x4058e9=new Ve(this['locale'],_0x418e77,this['_bodyCollection']):'ai-suggestion-reply'===_0x17f38d?(_0x4058e9=new Le(this['locale'],_0x418e77,this['_bodyCollection']),_0x4058e9['bind']('isTrackChangesOn')['to'](this,'isTrackChangesOn')):_0x4058e9='user-message'===_0x17f38d?new Me(this['locale'],_0x418e77,this['_bodyCollection']):'interaction-header'===_0x17f38d?new Lt(this['locale'],_0x418e77):new Oe(_0x418e77),this['children']['add'](_0x4058e9);}async['updateReplyItem']({id:_0x1e89b9,parsedContent:_0x26a5e5,renderingStrategy:_0x258cee,abortSignal:_0x4227f8}){const _0x164c1b=this['getItemById'](_0x1e89b9);if(!(_0x164c1b instanceof Ve))throw new _0x25e143('ai-chat-feed-view-item-not-a-reply-item',null,{'itemView':_0x164c1b,'id':_0x1e89b9,'parsedContent':_0x26a5e5});await _0x164c1b['updateContent']({'parsedContent':_0x26a5e5,'renderingStrategy':_0x258cee,'abortSignal':_0x4227f8});}async['updateWebSources'](_0x56bbdf,_0x3f355c){const _0x161f08=this['getItemById'](_0x56bbdf);if(_0x161f08 instanceof Le)_0x161f08['updateSources'](_0x3f355c);else{if(!(_0x161f08 instanceof Ve))throw new _0x25e143('ai-chat-feed-view-item-not-a-suggestion-or-reply-item',null,{'itemView':_0x161f08,'id':_0x56bbdf,'sources':_0x3f355c});_0x161f08['updateSources'](_0x3f355c);}}async['updateSuggestionItem']({id:_0x3a9757,parts:_0x298cb4,renderingStrategy:_0x13a87b,abortSignal:_0x56a7af}){const _0xf7546d=this['getItemById'](_0x3a9757);if(!(_0xf7546d instanceof Le))throw new _0x25e143('ai-chat-feed-view-item-not-a-suggestion-item',null,{'itemView':_0xf7546d,'id':_0x3a9757,'parts':_0x298cb4});await _0xf7546d['updateContent']({'parts':_0x298cb4,'renderingStrategy':_0x13a87b,'abortSignal':_0x56a7af});}['updateSuggestionPartState']({id:_0x4060b5,index:_0x57b085,state:_0x4ecb32}){const _0x37ace1=this['getItemById'](_0x4060b5);if(!(_0x37ace1 instanceof Le))throw new _0x25e143('ai-chat-feed-view-item-not-a-suggestion-item',this,{'id':_0x4060b5});_0x37ace1['updatePartState'](_0x57b085,_0x4ecb32);}['markItemAsDone'](_0x52413a){this['getItemById'](_0x52413a)['markAsDone']();}['getItemIds'](){return this['children']['map'](_0x51eea8=>_0x51eea8['options']['id']);}['removeItem'](_0x5d5a5c){this['children']['remove'](this['getItemById'](_0x5d5a5c));}['scrollToSuggestion'](_0x351c28,_0x58a4a1){const _0xef1142=this['getItemById'](_0x351c28);if(!(_0xef1142 instanceof Le))return void _0x17a23f('ck-ai-chat-feed-view-scroll-to-suggestion-invalid-item',{'replyId':_0x351c28,'partIndex':_0x58a4a1});const _0x8df37f=_0xef1142['getPartView'](_0x58a4a1);_0x8df37f?_0xc42cd2({'target':_0x8df37f['element'],'ancestorOffset':0x14,'alignToTop':!0x0,'forceScroll':!0x0}):_0x17a23f('ck-ai-chat-feed-view-scroll-to-suggestion-part-view-not-found',{'replyId':_0x351c28,'partIndex':_0x58a4a1});}['_setupTemplate'](){this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed']},'children':this['_createTemplateChildren']()});}['_createTemplateChildren'](){const _0xb8b407=this['_createSkeletonLoader']();return[this['_createFeedItems'](),_0xb8b407,this['_createFeedLoader']()];}['_createSkeletonLoader'](){const _0x5cc24e=new Pe(this['locale'],Be['aiFeed']);return _0x5cc24e['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isLoadingSkeletonVisible','ck-hidden',_0x4623e3=>!_0x4623e3)]}}),_0x5cc24e;}['_createFeedItems'](){const _0x4ece37=new _0x55515f(this['locale']);return _0x4ece37['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__items',this['bindTemplate']['if']('isLoadingSkeletonVisible','ck-hidden')]},'children':this['children']}),_0x4ece37;}['_createFeedLoader'](){const _0x18c617=new _0x55515f(this['locale']);return _0x18c617['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__loader',this['bindTemplate']['if']('isPending','ck-hidden',_0x531de1=>!_0x531de1)]},'children':this['_createLoaderChildren']()}),_0x18c617;}['_createLoaderChildren'](){const _0x55fddb=new We();return _0x55fddb['isVisible']=!0x0,[_0x55fddb,{'tag':'span','attributes':{'class':['ck','ck-ai-chat__loader-text']},'children':[{'text':this['bindTemplate']['to']('loadingMessage')}]}];}['getItemById'](_0x1b50d3){const _0x5da55c=this['children']['find'](_0x4a4ad2=>_0x4a4ad2['options']['id']['includes'](_0x1b50d3));if(!_0x5da55c)throw new _0x25e143('ai-chat-feed-view-item-not-found',this,{'id':_0x1b50d3});return _0x5da55c;}['setLoadingMessage'](_0x1ec1cf){this['set']('loadingMessage',_0x1ec1cf);}['toggleLoadingSkeleton'](_0x1b09a9){this['set']('isLoadingSkeletonVisible',_0x1b09a9);}['startAutoScroll'](){this['scrollManager']['start']();}['stopAutoScroll'](){this['scrollManager']['stop']();}}class Br extends _0x429409{['filter'](){let _0x1040ec=0x0;for(const _0x21ec3b of this['items'])_0x1040ec+=_0x21ec3b['items']['length'];return{'resultsCount':_0x1040ec,'totalItemsCount':_0x1040ec};}}class ps extends _0x275027{['submitButtonView'];static ['MIN_ROWS']=0x1;static ['MAX_ROWS']=0xc;['_addContextButtonView'];['_queryViewResizeObserver'];constructor(_0x5535bb,_0xa132bc){super(_0x5535bb,{'queryView':{'label':'','creator':_0x28513c,'showIcon':!0x1,'showResetButton':!0x1},'filteredView':new Br(_0x5535bb),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1}),this['set']('isEmpty',!0x0),this['set']('isUploadInProgress',!0x1),this['_addContextButtonView']=_0xa132bc,this['_queryViewResizeObserver']=null,this['queryView']['fieldView']['minRows']=ps['MIN_ROWS'],this['queryView']['fieldView']['maxRows']=ps['MAX_ROWS'],this['queryView']['fieldWrapperChildren']['add'](this['_addContextButtonView']),this['_setUpAddContextButtonPositioning'](),this['extendTemplate']({'attributes':{'class':['ck','ck-ai-chat__prompt-input']}}),this['submitButtonView']=this['_createSubmitButton'](),this['submitButtonView']['bind']('isEnabled')['to'](this,'isEmpty',this,'isUploadInProgress',(_0x124646,_0x170a70)=>!_0x124646&&!_0x170a70),this['focusableChildren']['add'](this['submitButtonView']);}['render'](){super['render'](),this['queryView']['fieldWrapperChildren']['add'](this['submitButtonView']),this['keystrokes']['set']('enter',(_0x370530,_0x22d927)=>{this['isUploadInProgress']||this['isEmpty']||_0x370530['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0x22d927());}),this['queryView']['fieldView']['on']('update',()=>{this['isEmpty']=''===this['queryView']['fieldView']['element']['value']?.['trim']();});}['destroy'](){super['destroy'](),this['_queryViewResizeObserver']&&this['_queryViewResizeObserver']['destroy']();}['submit'](){const _0x455832=this['queryView']['fieldView']['element']['value']?.['trim']();if(!_0x455832)return this['queryView']['errorText']=i(this['locale'],'AI_CHAT_PROMPT_EMPTY_ERROR'),void(this['queryView']['fieldView']['hasError']=!0x0);this['queryView']['fieldView']['hasError']=!0x1;const _0x3d7ee3=_0x25d6a2(_0x455832);this['fire']('sendUserMessage',_0x3d7ee3),this['queryView']['fieldView']['reset']();}['setPlaceholderText'](_0x234a34){this['queryView']['fieldView']['set']('placeholder',_0x234a34);}['_createSubmitButton'](){const _0x359330=new _0x5cf211(this['locale']);return _0x359330['set']({'icon':_0x515d2f,'label':i(this['locale'],'AI_CHAT_LABEL_SUBMIT'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-chat__prompt-submit-button','isEnabled':!0x1}),_0x359330['on']('execute',()=>{this['submit']();}),_0x359330;}['setIsUploadInProgress'](_0x247933){this['isUploadInProgress']=_0x247933;}['_setUpAddContextButtonPositioning'](){const _0x5c7afe=this['locale'],_0x55dd54=()=>{_0x3610d0['window']['requestAnimationFrame'](()=>{if(_0x248cca(this['element'])){const _0x538b7d=new _0x2e6861(this['queryView']['fieldView']['element']),_0x5ceab2=new _0x2e6861(this['_addContextButtonView']['element']),_0x493238=_0x538b7d['width'],_0x58bf85='rtl'===_0x5c7afe['uiLanguageDirection']?'right':'left';_0x538b7d['excludeScrollbarsAndBorders']();const _0x3307f1=_0x493238-_0x538b7d['width']+0x1;this['_addContextButtonView']['element']['style'][_0x58bf85]='calc('+(_0x493238-_0x5ceab2['width']-_0x3307f1)+'px\x20-\x20var(--ck-spacing-tiny))';}});};this['queryView']['fieldView']['on']('update',_0x55dd54),this['on']('render',()=>{_0x55dd54(),this['_queryViewResizeObserver']=new _0x7b9b5d(this['queryView']['fieldView']['element'],()=>{_0x55dd54();});});}}const ga='ck-ai-chat__prompt-capabilities',ma='ck-ai-chat-controls-button',pa='ck-ai-chat-controls-button--commands',Ea='ck-ai-chat-controls__model-selection',Ta='ck-ai-chat-controls__model-selection__item-name',Ca='ck-ai-chat-controls__model-selection__item-description',wa='ck-ai-chat-controls__model-selection__item-capabilities',fa='n';class ms extends _0x55515f{['_webSearchButton'];['_reasoningButton'];['_commandsButton'];['_modelSelectionDropdown'];['_modelSelectionDropdownItems'];['_modelNameView'];constructor(_0x43b838){super(_0x43b838),this['set']('webSearchActive',!0x1),this['set']('reasoningActive',!0x1),this['set']('modelSelectorVisible',!0x0),this['set']('modelSelectorEnabled',!0x0),this['set']('activeModelId',null),this['set']('activeModelName',null),this['_modelSelectionDropdown']=this['_createModelSelectionDropdown'](),this['_modelNameView']=this['_createModelNameView'](),this['_webSearchButton']=this['_createWebSearchButton'](),this['_reasoningButton']=this['_createReasoningButton'](),this['_commandsButton']=this['_createCommandsButton'](),this['_modelSelectionDropdown']['buttonView']['bind']('isVisible')['to'](this,'modelSelectorVisible',_0x5e4dde=>_0x5e4dde),this['_modelSelectionDropdown']['buttonView']['bind']('tooltip')['to'](this,'modelSelectorEnabled',_0x3736d1=>_0x3736d1?this['_modelSelectionDropdown']['buttonView']['label']:i(this['locale'],'AI_CHAT_MODEL_SELECTOR_DISABLED_TOOLTIP')),this['_modelSelectionDropdown']['bind']('isEnabled')['to'](this,'modelSelectorEnabled',_0x12e20e=>_0x12e20e),this['_webSearchButton']['bind']('isOn')['to'](this,'webSearchActive',_0x387032=>_0x387032),this['_webSearchButton']['bind']('withText')['to'](this,'modelSelectorVisible',_0x541993=>!_0x541993),this['_webSearchButton']['bind']('tooltip')['to'](this,'webSearchActive',_0x3ca7a6=>i(this['locale'],_0x3ca7a6?'AI_CHAT_DISABLE_WEB_SEARCH':'AI_CHAT_ENABLE_WEB_SEARCH')),this['_reasoningButton']['bind']('isOn')['to'](this,'reasoningActive',_0x48f6c1=>_0x48f6c1),this['_reasoningButton']['bind']('withText')['to'](this,'modelSelectorVisible',_0x364654=>!_0x364654),this['_reasoningButton']['bind']('tooltip')['to'](this,'reasoningActive',_0x340aea=>i(this['locale'],_0x340aea?'AI_CHAT_DISABLE_REASONING':'AI_CHAT_ENABLE_REASONING')),this['setTemplate']({'tag':'div','attributes':{'class':[ga]},'children':[this['_modelSelectionDropdown'],this['_modelNameView'],this['_webSearchButton'],this['_reasoningButton'],this['_commandsButton']]}),this['_modelSelectionDropdownItems']=new _0xffd920(),_0x2100d6(this['_modelSelectionDropdown'],this['_modelSelectionDropdownItems']);}['setModelList'](_0x108a83,_0x109630){if(this['set']('modelSelectorVisible',!(_0x109630&&_0x108a83['length']<=0x1)),this['_modelSelectionDropdownItems']['clear'](),_0x108a83?.['length'])for(const _0x7c95 of _0x108a83){const _0x38db5e=new _0x57b857({'label':_0x7c95['name'],'withText':!0x0,'role':'menuitemradio','id':_0x7c95['id'],'model':_0x7c95});_0x38db5e['bind']('isOn')['to'](this,'activeModelId',_0x9891b8=>_0x9891b8===_0x7c95['id']),this['_modelSelectionDropdownItems']['add']({'type':'button','model':_0x38db5e,'labelView':new ba(this['locale'],_0x7c95)});}}['setWebSearch'](_0x3858f2){this['set']('webSearchActive',_0x3858f2);}['setReasoning'](_0x6bc31e){this['set']('reasoningActive',_0x6bc31e);}['setModel'](_0x3e970b){if(!_0x3e970b)return;this['activeModelId']=_0x3e970b['id'],this['activeModelName']=_0x3e970b['name']||_0x3e970b['id'],this['_modelSelectionDropdown']['buttonView']['set']('label',_0x3e970b['name']),this['_modelSelectionDropdown']['buttonView']['set']('tooltip',_0x3e970b['name']);const _0x2c0980=_0x3e970b['capabilities']['webSearch']?.['enabled']??!0x1;this['set']('webSearchActive',!0x1),this['_webSearchButton']['set']('isOn',!0x1),this['_webSearchButton']['set']('isEnabled',_0x2c0980),this['_webSearchButton']['set']('isVisible',_0x2c0980);const _0x19e2db=_0x3e970b['capabilities']['reasoning']?.['enabled']??!0x1;this['set']('reasoningActive',!0x1),this['_reasoningButton']['set']('isOn',!0x1),this['_reasoningButton']['set']('isEnabled',_0x19e2db),this['_reasoningButton']['set']('isVisible',_0x19e2db);}['enableModelSelector'](){this['set']('modelSelectorEnabled',!0x0),this['set']('modelSelectorVisible',!0x0);}['disableModelSelector'](_0x1ad89d){this['set']('modelSelectorEnabled',!0x1),_0x1ad89d&&this['set']('modelSelectorVisible',!0x1);}['_createWebSearchButton'](){const _0x10bcdb=new _0x5cf211();return _0x10bcdb['set']({'label':i(this['locale'],'AI_CHAT_SEARCH_WEB'),'icon':_0x4f3dd0,'class':ma,'isToggleable':!0x0,'tooltipPosition':fa}),_0x10bcdb['on']('execute',()=>{this['fire']('toggleWebSearch');}),_0x10bcdb;}['_createReasoningButton'](){const _0x2a65ea=new _0x5cf211();return _0x2a65ea['set']({'label':i(this['locale'],'AI_CHAT_REASONING'),'icon':_0x458e80,'class':ma,'isToggleable':!0x0,'tooltipPosition':fa}),_0x2a65ea['on']('execute',()=>{this['fire']('toggleReasoning');}),_0x2a65ea;}['_createCommandsButton'](){const _0x1582ec=new _0x5cf211();return _0x1582ec['set']({'label':i(this['locale'],'AI_CHAT_COMMANDS'),'icon':Nt,'withText':!0x0,'class':ma,'isToggleable':!0x0,'tooltip':i(this['locale'],'AI_CHAT_COMMANDS'),'tooltipPosition':fa}),_0x1582ec['extendTemplate']({'attributes':{'class':[pa]}}),_0x1582ec['on']('execute',()=>{console['log']('Commands\x20are\x20not\x20implemented\x20yet.'),alert('Commands\x20are\x20not\x20implemented\x20yet.');}),_0x1582ec;}['_createModelSelectionDropdown'](){const _0x387276=_0x4c9a3b(this['locale']);return _0x387276['set']({'panelPosition':'ne','class':[Ea]}),_0x387276['buttonView']['set']({'label':i(this['locale'],'AI_CHAT_MODEL_SELECTOR_ENABLED_TOOLTIP'),'withText':!0x0,'tooltip':!0x0,'tooltipPosition':fa}),this['listenTo'](_0x387276,'execute',_0x43900e=>{this['fire']('selectModel',_0x43900e['source']['model']);}),_0x387276;}['_createModelNameView'](){const _0x2b7a5f=new Jo(this['locale']);return _0x2b7a5f['bind']('text')['to'](this,'activeModelName',_0x292e78=>_0x292e78??''),_0x2b7a5f['bind']('isVisible')['to'](this,'modelSelectorVisible',this,'activeModelName',(_0x230466,_0x447a06)=>!_0x230466&&!_0x447a06?.['toLowerCase']()['startsWith']('agent')),_0x2b7a5f;}}let ba=class extends _0xbcb951{constructor(_0x21c052,_0x386551){super();const _0x185423=this['bindTemplate'],_0x4d9c91=this['createCollection']();this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-button__label'],'style':_0x185423['to']('style'),'id':_0x185423['to']('id')},'children':[{'tag':'div','attributes':{'class':[Ta]},'children':[{'text':_0x185423['to']('text')}]},{'tag':'div','attributes':{'class':[Ca]},'children':[{'tag':'span','children':[{'text':_0x386551['description']}]}]},{'tag':'div','attributes':{'class':[wa]},'children':_0x4d9c91}]}),_0x4d9c91['addMany'](this['_getCapabilityParts'](_0x21c052,_0x4f3dd0,'AI_CHAT_SEARCH_WEB',_0x386551['capabilities']['webSearch']?.['enabled']??!0x1)),_0x4d9c91['addMany'](this['_getCapabilityParts'](_0x21c052,_0x458e80,'AI_CHAT_REASONING',_0x386551['capabilities']['reasoning']?.['enabled']??!0x1));}['_getCapabilityParts'](_0x20a27b,_0x5738ef,_0x5b408e,_0x1c5fc0){const _0x50b7c8=new _0x1e0173();_0x50b7c8['content']=_0x5738ef;const _0x31c4dc=new _0x55515f(_0x20a27b);_0x31c4dc['setTemplate']({'tag':'span','children':[{'text':i(_0x20a27b,_0x5b408e)+':\x20'}]});const _0x226dcc=new _0x55515f(_0x20a27b);return _0x226dcc['setTemplate']({'tag':'span','children':[{'text':i(_0x20a27b,_0x1c5fc0?'AI_CHAT_CAPABILITIES_YES':'AI_CHAT_CAPABILITIES_NO')}]}),[_0x50b7c8,_0x31c4dc,_0x226dcc];}};class Jo extends _0x55515f{constructor(_0x1971f6){super(_0x1971f6),this['set']('text',void 0x0),this['set']('isVisible',!0x0);const _0x5283f8=this['bindTemplate'];this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-chat-controls__model-name',_0x5283f8['if']('isVisible','ck-hidden',_0x4f8d56=>!_0x4f8d56)]},'children':[{'text':_0x5283f8['to']('text')}]});}}const Sa='ck-ai-chat-context-controls__url-form',Oa='ck-ai-chat-context-controls__url-input-section';class bo extends _0x55515f{['focusTracker'];['keystrokes'];['_focusables'];['focusCycler'];['urlInputField'];['backButton'];['confirmButton'];constructor(_0x24d487){super(_0x24d487),this['focusTracker']=new _0x338162(),this['keystrokes']=new _0x1b5c14(),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 _0x2f6676({'focusables':this['_focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes'],'actions':{'focusPrevious':'shift+tab','focusNext':'tab'}}),this['_setupTemplate'](),this['_setupEventHandlers'](),this['_setupKeystrokes']();}['render'](){super['render'](),this['_focusables']['forEach'](_0x1ad55d=>{this['focusTracker']['add'](_0x1ad55d['element']),this['keystrokes']['listenTo'](_0x1ad55d['element']);}),_0x4a9f33({'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'](_0x202f45){this['urlInputField']['errorText']=_0x202f45,this['_updateConfirmButtonState'](),this['fire']('refreshBalloon');}['clearError'](){this['urlInputField']['errorText']=null,this['_updateConfirmButtonState']();}['_createBackButton'](){const _0x5637d8=new _0x5cf211(this['locale']);return _0x5637d8['set']({'icon':tt,'tooltip':i(this['locale'],'AI_CHAT_CONTEXT_URL_BACK_TO_CONTEXT'),'tooltipPosition':'n','class':'ck-button-icon\x20ck-button-back'}),_0x5637d8;}['_createUrlInputField'](){const _0x1a7802=new _0x349f6b(this['locale'],_0x34dc8b);return _0x1a7802['set']({'label':i(this['locale'],'AI_CHAT_CONTEXT_URL_LABEL'),'class':'ck-labeled-field-view_empty'}),_0x1a7802['fieldView']['set']({'placeholder':i(this['locale'],'AI_CHAT_CONTEXT_URL_PLACEHOLDER')}),_0x1a7802;}['_createConfirmButton'](){const _0x4f91f2=new _0x5cf211(this['locale']);return _0x4f91f2['set']({'icon':_0x563475,'tooltip':i(this['locale'],'AI_CHAT_CONTEXT_URL_ADD_URL'),'tooltipPosition':'n','class':'ck-button-icon','type':'submit','isEnabled':!0x1}),_0x4f91f2;}['_setupTemplate'](){const _0x486adf=new _0x219fc7(this['locale'],{'label':i(this['locale'],'AI_CHAT_CONTEXT_URL_ADD_URL'),'class':'ck-ai-header\x20ck-ai-header_small\x20ck-ai-header_context-url'});_0x486adf['children']['add'](this['backButton'],0x0),this['setTemplate']({'tag':'form','attributes':{'class':Sa,'tabindex':'-1'},'children':[_0x486adf,{'tag':'div','attributes':{'class':Oa},'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',_0x142390=>{_0x142390['stop'](),this['_handleSubmit']();});}['_setupKeystrokes'](){this['keystrokes']['set']('esc',(_0x5df6af,_0x206894)=>{this['clear'](),this['fire']('cancel'),_0x206894();});}['_handleSubmit'](){const _0x258630=this['getValue']()['trim']();_0x258630?this['_isValidUrl'](_0x258630)?(this['clearError'](),this['fire']('submitUrl',_0x258630)):this['setError'](i(this['locale'],'AI_CHAT_CONTEXT_URL_INVALID_ERROR')):this['setError'](i(this['locale'],'AI_CHAT_CONTEXT_URL_EMPTY_ERROR'));}['_updateConfirmButtonState'](){const _0x483b8d=this['getValue']()['trim'](),_0xf58548=!!this['urlInputField']['errorText'];this['confirmButton']['isEnabled']=_0x483b8d['length']>0x0&&!_0xf58548;}['_isValidUrl'](_0x1dc1f7){try{return!!new URL(_0x1dc1f7);}catch{return!0x1;}}}const Ra='ck-ai-chat-resources__item',Na='ck-ai-chat-resources__item--in-context',ka='ck-ai-chat-resources__item-title',ya='ck-ai-chat-resources__item__icon';class sc extends _0x5f38b9{['resource'];['_titleView'];['_iconView'];constructor(_0x3a5557,_0x87a848){super(_0x3a5557),this['resource']=_0x87a848,this['set']('isInContext',!!_0x87a848['isInContext']),this['_titleView']=this['_createTitleView'](),this['_iconView']=this['_createIconView'](),this['_setupTemplate']();}['render'](){super['render']();}['getResourceIcon'](_0x402b2b){if(_0x402b2b['isInContext'])return _0x563475;switch(_0x402b2b['type']){case je['DOCUMENT']:return _0x366289;case je['URL']:return _0x41d008;case je['FILE']:case je['TEXT']:return _0x5b1096;default:return _0x1cc76c;}}['highlightText'](_0x278d87){if(!_0x278d87||''===_0x278d87['trim']())return void this['_titleView']['highlightText'](null);const _0x35390a=new RegExp(_0x390c1d(_0x278d87),'gi');this['_titleView']['highlightText'](_0x35390a);}['updateResourceState'](_0xb3e145){this['resource']['isInContext']=_0xb3e145,this['isInContext']=_0xb3e145,this['_updateIcon']();}['_createTitleView'](){const _0x26df05=new _0x201c3b();return _0x26df05['text']=this['resource']['label'],_0x26df05['extendTemplate']({'tag':'span','attributes':{'class':[ka]}}),_0x26df05;}['_createIconView'](){const _0x383b94=new _0x1e0173();return _0x383b94['content']=this['getResourceIcon'](this['resource']),_0x383b94;}['_setupTemplate'](){const _0x3d250c=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':[Ra,_0x3d250c['if']('isVisible','ck-hidden',_0x96a730=>!_0x96a730),_0x3d250c['if']('isInContext',Na)]},'children':[{'tag':'div','attributes':{'class':[ya]},'children':[this['_iconView']]},this['_titleView']],'on':{'click':_0x3d250c['to']('execute')}});}['_updateIcon'](){this['_iconView']['content']=this['getResourceIcon'](this['resource']);}}const va='ck-ai-chat-resources__list';class qr extends _0x429409{['_source'];constructor(_0x3a8758,_0x2422de){super(_0x3a8758),this['_source']=_0x2422de,this['extendTemplate']({'attributes':{'class':[va]}});}['setResources'](_0x3902ad,_0x4d1124){this['items']['clear']();let _0x57dd80=_0x3902ad;if(this['_source']['useDefaultFiltering']&&_0x4d1124&&''!==_0x4d1124['trim']()){const _0x14f6eb=new RegExp(_0x4d1124['replace'](/[.*+?^${}()|[\]\\]/g,'\x5c$&'),'gi');_0x57dd80=_0x3902ad['filter'](_0x84571a=>_0x14f6eb['test'](_0x84571a['label']));}for(const _0x174390 of _0x57dd80){const _0x3278e7=new sc(this['locale'],_0x174390);_0x3278e7['on']('execute',()=>{this['_handleResourceSelection'](this['_source'],_0x174390);}),this['items']['add'](_0x3278e7);}this['_source']['useDefaultFiltering']&&this['highlightText'](_0x4d1124);}['highlightText'](_0x33a8a0){this['_source']['useDefaultFiltering']&&this['items']['forEach'](_0x5d1158=>{_0x5d1158['highlightText'](_0x33a8a0);});}['updateResourceState'](_0x17e1c7,_0x5bc402){for(const _0x5b18d4 of this['items']){const _0x108b84=_0x5b18d4;_0x108b84['resource']['id']===_0x17e1c7&&_0x108b84['updateResourceState'](_0x5bc402);}}['_handleResourceSelection'](_0x50b2dd,_0x2961a9){this['fire']('addResourceToContext',{'source':_0x50b2dd,'resource':_0x2961a9});}}class Ur extends _0x349f6b{['iconView'];['resetButtonView'];['_viewConfig'];constructor(_0x54f9ae){const t=_0x54f9ae['t'],_0x40d5b2={'showResetButton':!0x0,'showIcon':!0x0,'creator':_0x34dc8b,'label':i(_0x54f9ae,'AI_CHAT_SEARCH_RESOURCES')};super(_0x54f9ae,_0x40d5b2['creator']),this['label']=_0x40d5b2['label'],this['_viewConfig']=_0x40d5b2,this['_viewConfig']['showIcon']&&this['_setupSearchIcon'](),this['_viewConfig']['showResetButton']&&this['_setupResetButton'](_0x54f9ae,t),this['_setupEventListeners']();}['reset'](){this['fieldView']['reset'](),this['_viewConfig']['showResetButton']&&this['resetButtonView']&&(this['resetButtonView']['isVisible']=!0x1),this['search']('');}['search'](_0x37a39d){this['fire']('search',_0x37a39d);}['getQuery'](){return this['fieldView']['element']?.['value']||'';}['_setupSearchIcon'](){this['iconView']=new _0x1e0173(),this['iconView']['content']=_0x2fb02f,this['fieldWrapperChildren']['add'](this['iconView'],0x0),this['extendTemplate']({'attributes':{'class':'ck-search__query_with-icon'}});}['_setupResetButton'](_0x195083,t){this['resetButtonView']=new _0x5cf211(_0x195083),this['resetButtonView']['set']({'label':t('Clear'),'icon':_0x43c7d2,'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',_0x533aae=>!_0x533aae),this['fieldWrapperChildren']['add'](this['resetButtonView']),this['extendTemplate']({'attributes':{'class':'ck-search__query_with-reset'}});}['_setupEventListeners'](){this['listenTo'](this['fieldView'],'input',()=>{this['search'](this['fieldView']['element']['value']);}),this['bind']('isEnabled')['to'](this);}}class Or extends _0x55515f{['_searchView'];['_searchSection'];['_searchInputVisibleFrom'];['_resourcesListView'];['_skeletonLoader'];['_source'];['children'];['_latestLoadResourcesUid']=null;constructor(_0x3fff8a,_0x3fff88){super(_0x3fff8a),this['_source']=_0x3fff88['source'],this['_searchInputVisibleFrom']=_0x3fff88['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 _0x4b2ba7([this['_skeletonLoader'],this['_resourcesListView']]),this['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-chat-resources'},'children':this['children']});}['_createSearchView'](){return new Ur(this['locale']);}['_createSearchSection'](){const _0x3a63a2=new _0x55515f(this['locale']);return _0x3a63a2['setTemplate']({'tag':'div','attributes':{'class':'ck\x20ck-search'},'children':[this['_searchView']]}),this['_searchView']['on']('search',(_0xd18d8a,_0x1d5472)=>{this['loadResources'](_0x1d5472),this['_source']['useDefaultFiltering']&&this['_resourcesListView']['highlightText'](_0x1d5472);}),_0x3a63a2;}['_createResourcesListView'](){const _0x1566a8=new qr(this['locale'],this['_source']);return _0x1566a8['delegate']('addResourceToContext')['to'](this),_0x1566a8['extendTemplate']({'attributes':{'class':this['bindTemplate']['if']('isLoading','ck-hidden')}}),_0x1566a8;}['_createSkeletonView'](){const _0x58a9fd=new Pe(this['locale'],Be['aiChatResources']);return _0x58a9fd['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isLoading','ck-hidden',_0x321a3f=>!_0x321a3f)]}}),_0x58a9fd;}['render'](){super['render'](),this['loadResources']('');}['loadResources'](_0x341826){const _0x54c603=_0x23a3b0();this['_latestLoadResourcesUid']=_0x54c603,this['fire']('loadSourceResources',{'sourceId':this['_source']['id'],'query':_0x341826,'uid':_0x54c603}),this['isLoading']=!0x0;}['setResources'](_0xd9454f,_0x2455bf){if(_0x2455bf&&_0x2455bf!==this['_latestLoadResourcesUid'])return;const _0xdc81be=this['_source']['useDefaultFiltering']?this['_searchView']['getQuery']():'';this['_resourcesListView']['setResources'](_0xd9454f,_0xdc81be),_0xd9454f['length']>=this['_searchInputVisibleFrom']&&!this['children']['has'](this['_searchSection'])&&this['children']['add'](this['_searchSection'],0x0),requestAnimationFrame(()=>{this['isLoading']=!0x1;});}['updateResourceState'](_0x40e54d,_0xf9e8c2){this['_resourcesListView']['updateResourceState'](_0x40e54d,_0xf9e8c2);}}const xa='ck-ai-chat-context-controls__source-balloon-panel',La='ck-button-icon\x20ck-button-back',Ha='ck-ai-header\x20ck-ai-header_small\x20ck-ai-header_source';class Ao{['_sourceResourceBalloons']=new Map();['_bodyCollection'];['_locale'];['_config'];constructor(_0x1cc2ec,_0x1283ea,_0xd21e23){this['_locale']=_0x1cc2ec,this['_bodyCollection']=_0x1283ea,this['_config']=_0xd21e23;}['showSourceResourcesBalloon'](_0x2b9c37){let _0x3b67a5=this['_sourceResourceBalloons']['get'](_0x2b9c37['id']);_0x3b67a5||(_0x3b67a5=this['_createSourceResourceBalloonPanel'](),this['_sourceResourceBalloons']['set'](_0x2b9c37['id'],_0x3b67a5),this['_setupSingleResourceBalloonClickOutsideHandler'](_0x3b67a5)),this['_addSourceResourceContent'](_0x3b67a5,_0x2b9c37),_0x3b67a5['show']();const _0x20a301=this['_config']['getTargetElement']();_0x20a301&&_0x3b67a5['pin']({'target':_0x20a301,'limiter':this['_config']['getLimiterElement']()});}['populateSourceResourceBalloon'](_0x1fae9f,_0x5754f,_0x293096){const _0x432fa9=this['_sourceResourceBalloons']['get'](_0x1fae9f);if(!_0x432fa9)return;const _0xc78120=this['_getResourcesViewFromBalloon'](_0x432fa9);_0xc78120&&(_0xc78120['setResources'](_0x5754f,_0x293096),_0xc78120['once']('change:isLoading',()=>{_0x432fa9['pin']({'target':this['_config']['getTargetElement'](),'limiter':this['_config']['getLimiterElement']()});}));}['closeSourceResourceBalloon'](_0x50d13a){const _0x300e25=this['_sourceResourceBalloons']['get'](_0x50d13a);_0x300e25&&requestAnimationFrame(()=>{_0x300e25['hide'](),this['_sourceResourceBalloons']['delete'](_0x50d13a),this['_config']['onBalloonClosed']();});}['isAnyResourceBalloonVisible'](){for(const _0x5c69c0 of this['_sourceResourceBalloons']['values']())if(_0x5c69c0['isVisible'])return!0x0;return!0x1;}['updateResourceState'](_0x1bce65,_0x1bb704,_0x30acec){const _0x53b6d3=this['_sourceResourceBalloons']['get'](_0x1bce65);if(!_0x53b6d3||!_0x53b6d3['isVisible'])return;const _0x1807cf=this['_config']['getTargetElement']();if(!_0x1807cf)return;_0x53b6d3['pin']({'target':_0x1807cf,'limiter':this['_config']['getLimiterElement']()});const _0x49f979=this['_getResourcesViewFromBalloon'](_0x53b6d3);_0x49f979&&_0x49f979['updateResourceState'](_0x1bb704,_0x30acec);}['destroy'](){for(const _0x53e439 of this['_sourceResourceBalloons']['values']())_0x53e439['destroy']();this['_sourceResourceBalloons']['clear']();}['_createSourceResourceBalloonPanel'](){const _0x307ff6=new _0x564e6d(this['_locale']);return _0x307ff6['extendTemplate']({'attributes':{'class':xa}}),this['_bodyCollection']['add'](_0x307ff6),_0x307ff6;}['_addSourceResourceContent'](_0x3d2c96,_0x58e2f2){_0x3d2c96['content']['clear']();const _0x2f8ceb=this['_createBalloonHeader'](_0x3d2c96,_0x58e2f2);_0x3d2c96['content']['add'](_0x2f8ceb);const _0x52c30a=this['_createBalloonResourcesView'](_0x58e2f2);_0x3d2c96['content']['add'](_0x52c30a);}['_createBalloonHeader'](_0x41260a,_0x20474b){const _0x4867f1=this['_createBackButton'](_0x41260a),_0x13e84a=new _0x219fc7(this['_locale'],{'label':_0x20474b['label'],'class':Ha});return _0x13e84a['children']['add'](_0x4867f1,0x0),_0x13e84a;}['_createBackButton'](_0x3fba21){const _0x966f9b=new _0x5cf211(this['_locale']);return _0x966f9b['set']({'icon':tt,'tooltip':i(this['_locale'],'AI_CHAT_CONTEXT_URL_BACK_TO_CONTEXT'),'tooltipPosition':'n','class':La}),_0x966f9b['on']('execute',()=>{_0x3fba21['hide'](),this['_config']['onBackToContext']();}),_0x966f9b;}['_createBalloonResourcesView'](_0x3724d0){const _0x2bd576=new Or(this['_locale'],{'source':_0x3724d0,'searchInputVisibleFrom':this['_config']['searchInputVisibleFrom']});return _0x2bd576['on']('loadSourceResources',(_0x4a630c,_0x53234d)=>{this['_config']['onLoadSourceResources'](_0x53234d);}),_0x2bd576['on']('addResourceToContext',(_0x4184de,_0x21d9ff)=>{this['_config']['onResourceSelected'](_0x21d9ff['source'],_0x21d9ff['resource']),this['closeSourceResourceBalloon'](_0x3724d0['id']);}),_0x2bd576;}['_getResourcesViewFromBalloon'](_0x3dfa78){const _0x1fbfb6=_0x3dfa78['content']['get'](0x1);return _0x1fbfb6 instanceof Or?_0x1fbfb6:null;}['_setupSingleResourceBalloonClickOutsideHandler'](_0x424544){_0x1411c6({'emitter':_0x424544,'contextElements':[_0x424544['element']],'callback':()=>{_0x424544['hide'](),this['_config']['onBalloonClosed']();},'activator':()=>_0x424544['isVisible']});}}const gs=['addDocumentToContext','addFileToContext','addUrlToContext','addResourceToContext','removeContextItem','loadSourceResources'],ko='ck-ai-chat-context-controls',Eo='ck-ai-chat-context-controls__pending-contexts',vo='ck-ai-chat-context-controls__add-context-balloon-panel',Vo='ck-ai-chat-context-controls__add-context-button',Io='ck-ai-chat-context-controls__url-balloon-panel',Po='ck-ai-chat-context-controls__balloon-button',Ro='ck-ai-chat-context-controls__balloon-button-source',Uo='ck-ai-chat-controls-button',Lo='ck-ai-chat-context-chips-wrapper-balloon',No='ck-ai-chat-controls_context_show-more-button',Oo='ck-ai-chat-context-controls__show-more-balloon-panel',Mo='ck-ai-chat',Ho=[_0x564e6d['defaultPositions']['northArrowSouthWest'],_0x564e6d['defaultPositions']['northArrowSouth'],_0x564e6d['defaultPositions']['northArrowSouthEast'],_0x564e6d['defaultPositions']['southArrowNorthWest'],_0x564e6d['defaultPositions']['southArrowNorth'],_0x564e6d['defaultPositions']['southArrowNorthEast']];class bs extends _0x55515f{['addContextButtonView'];['_currentContextsChips']=this['createCollection']();['_conversationContextsChips']=this['createCollection']();['_overflowManager'];['_addContextBalloonPanelView'];['_urlBalloonPanelView'];['_urlInputView'];['_resourcesBalloonView'];['_addContextBalloonConfig'];['bodyCollection'];constructor(_0x343783,_0x1990f3){super(_0x343783),this['bodyCollection']=_0x1990f3['bodyCollection'],this['_currentContextsChips']=this['createCollection'](),this['_conversationContextsChips']=this['createCollection'](),this['addContextButtonView']=this['_createAddContextButtonView'](_0x343783),this['_addContextBalloonPanelView']=this['_createAddContextBalloonPanelView'](_0x343783),this['_urlBalloonPanelView']=this['_createUrlBalloonPanelView'](_0x343783),this['_resourcesBalloonView']=this['_createResourcesBalloonView'](_0x343783,_0x1990f3);const _0x36923e={'cssClasses':{'showMoreButton':No,'showMoreBalloon':Oo,'overflowContainer':Lo,'controlsButton':Uo}};this['_overflowManager']=new To(_0x343783,this['_currentContextsChips'],_0x36923e,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'](_0xd8de9f,_0x92b14c){const _0x21959f=this['_createContextButton'](_0xd8de9f,'current',!0x0,_0x92b14c);this['_addContextToCollection'](_0x21959f,this['_currentContextsChips']),this['_overflowManager']['reorganizeChips']();}['removeContextItem'](_0x51064a){this['_removeContextFromCollection'](_0x51064a,this['_currentContextsChips']),this['_removeContextFromCollection'](_0x51064a,this['_overflowManager']['overflowChips']),this['_overflowManager']['reorganizeChips']();}['setContextItemLoading'](_0x31a47a,_0x1479f3){let _0x1939a7=this['_currentContextsChips']['find'](_0x3c0800=>_0x3c0800['id']===_0x31a47a);_0x1939a7||(_0x1939a7=this['_overflowManager']['overflowChips']['find'](_0x2e6e52=>_0x2e6e52['id']===_0x31a47a)),_0x1939a7&&(_0x1939a7['isLoading']=_0x1479f3);}['setConversationContext'](_0x21f51d){this['_conversationContextsChips']['clear']();for(const _0x456310 of _0x21f51d){const _0x5bedcc=this['_createContextButton'](_0x456310,'conversation',!0x1,!0x1);this['_addContextToCollection'](_0x5bedcc,this['_conversationContextsChips']);}}['clearCurrentContextItems'](){this['_currentContextsChips']['clear'](),this['_overflowManager']['clear']();}['clearConversationContextItems'](){this['_conversationContextsChips']['clear']();}['updateResourceState'](_0x8ad7e7,_0x913c78,_0x2b153f){this['_resourcesBalloonView']['updateResourceState'](_0x8ad7e7,_0x913c78,_0x2b153f);}['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'](_0x35c1b9){this['_resourcesBalloonView']['showSourceResourcesBalloon'](_0x35c1b9),this['addContextButtonView']['isOn']=!0x0;}['populateSourceResourceBalloon'](_0xb9cf5b,_0x5f4cc5,_0x4ca5a0,_0x8cb025){this['_resourcesBalloonView']['populateSourceResourceBalloon'](_0xb9cf5b,_0x4ca5a0,_0x8cb025);}['closeSourceResourceBalloon'](_0xe428e2){this['_resourcesBalloonView']['closeSourceResourceBalloon'](_0xe428e2),this['addContextButtonView']['isOn']=!0x1;}['setAddContextOptions'](_0x2b7149){this['_setBalloonPanelContent'](this['_addContextBalloonPanelView'],this['locale'],_0x2b7149),this['_setAddContextButtonEnabled'](_0x2b7149);}['_setAddContextButtonEnabled'](_0x4816ba){const _0x4e34a0=!_0x4816ba['document']['isHidden']&&_0x4816ba['document']['enabled'],_0x50adc8=_0x4816ba['urls']['enabled'],_0x5b13e8=_0x4816ba['files']['enabled'];this['addContextButtonView']['isEnabled']=_0x4e34a0||_0x50adc8||_0x5b13e8;}['_setupTemplate'](){this['setTemplate']({'tag':'div','attributes':{'class':[ko,'ck-reset_all-excluded']},'children':[{'tag':'div','attributes':{'class':Eo},'children':this['_currentContextsChips']}]});}['_bindEventHandlers'](){this['addContextButtonView']['on']('execute',()=>{this['_handleAddContextButtonClick']();});}['_createAddContextButtonView'](_0x4bb59c){const _0x1adf35=new _0x5cf211(_0x4bb59c);return _0x1adf35['set']({'label':i(_0x4bb59c,'AI_CHAT_CONTEXT_ADD_CONTEXT'),'class':Uo+'\x20'+Vo,'icon':_0x21b547,'isToggleable':!0x0,'tooltip':!0x0,'tooltipPosition':'sw'}),_0x1adf35;}['_createAddContextBalloonPanelView'](_0x394793){return this['_createBaseBalloonPanel'](_0x394793,vo);}['_createUrlBalloonPanelView'](_0x3c23c1){const _0x3fa369=this['_createBaseBalloonPanel'](_0x3c23c1,Io);return this['_addUrlContent'](_0x3fa369,_0x3c23c1),_0x3fa369;}['_createResourcesBalloonView'](_0x2951f6,_0x26037f){const _0x30c8f9={'searchInputVisibleFrom':_0x26037f['searchInputVisibleFrom'],'onBackToContext':()=>{this['showAddContextBalloonPanel'](),this['_addContextBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':Ho});},'onResourceSelected':(_0x9c4f03,_0x1ac5d2)=>{this['fire']('addResourceToContext',{'source':_0x9c4f03,'resource':_0x1ac5d2});},'onLoadSourceResources':_0x2ca875=>{this['fire']('loadSourceResources',_0x2ca875);},'onBalloonClosed':()=>{this['addContextButtonView']['isOn']=!0x1;},'getLimiterElement':()=>this['_getLimiterElement'](),'getTargetElement':()=>this['addContextButtonView']['element']};return new Ao(_0x2951f6,_0x26037f['bodyCollection'],_0x30c8f9);}['_getLimiterElement'](){return this['element']?.['closest']('.'+Mo)||document['body'];}['_createBaseBalloonPanel'](_0x4e3de5,_0xa79ed2){const _0x21d207=new _0x564e6d(_0x4e3de5);return _0x21d207['extendTemplate']({'attributes':{'class':_0xa79ed2}}),this['bodyCollection']['add'](_0x21d207),_0x21d207;}['_setBalloonPanelContent'](_0x3cdb92,_0x3e021f,_0x1e5eda){if(_0x3cdb92['content']['clear'](),!_0x1e5eda['document']['isHidden']&&_0x1e5eda['document']['enabled']){const _0x4224a8=this['_createBalloonButton'](_0x3e021f,{'label':i(_0x3e021f,'AI_CHAT_CONTEXT_CURRENT_DOCUMENT'),'icon':_0x366289});_0x4224a8['on']('execute',()=>{this['fire']('addDocumentToContext'),this['hideAddContextBalloonPanel']();}),_0x3cdb92['content']['add'](_0x4224a8);}if(_0x1e5eda['urls']['enabled']){const _0x21269a=this['_createBalloonButton'](_0x3e021f,{'label':i(_0x3e021f,'AI_CHAT_CONTEXT_URL_LABEL'),'icon':_0x41d008});_0x21269a['on']('execute',()=>{this['hideAddContextBalloonPanel'](),this['showUrlBalloonPanel'](),this['_urlBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':Ho}),this['_urlInputView']['focus']();}),_0x3cdb92['content']['add'](_0x21269a);}if(_0x1e5eda['files']['enabled']){const _0x5589c4=new _0x23c441(_0x3e021f);_0x5589c4['set']({'label':i(_0x3e021f,'AI_CHAT_CONTEXT_FILE_LABEL'),'icon':_0x10b491,'withText':!0x0,'tooltip':!0x0,'class':Po,'allowMultipleFiles':!0x0}),_0x5589c4['on']('done',(_0x3f5811,_0x5f094d)=>{this['fire']('addFileToContext',_0x5f094d),this['hideAddContextBalloonPanel']();}),_0x5589c4['tooltip']=!0x0,_0x3cdb92['content']['add'](_0x5589c4);}for(const _0x111beb of _0x1e5eda['sources']){const _0x2a5fb7=this['_createBalloonButton'](_0x3e021f,{'label':_0x111beb['label'],'icon':_0x111beb['icon']||_0x1cc76c,'type':'source'});_0x3cdb92['content']['add'](_0x2a5fb7),_0x2a5fb7['on']('execute',()=>{this['hideAddContextBalloonPanel'](),this['_showSourceResourcesBalloon'](_0x111beb);});}}['_addUrlContent'](_0x47c23d,_0x520c60){this['_urlInputView']=new bo(_0x520c60),this['_urlInputView']['on']('submitUrl',(_0x4616af,_0x20f834)=>{this['_handleUrlSubmit'](_0x20f834);}),this['_urlInputView']['on']('cancel',()=>{this['hideUrlBalloonPanel'](),this['showAddContextBalloonPanel'](),this['_addContextBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':Ho});}),this['_urlInputView']['on']('refreshBalloon',()=>{this['_urlBalloonPanelView']['isVisible']&&this['_urlBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':Ho});}),_0x47c23d['content']['add'](this['_urlInputView']);}['_createBalloonButton'](_0x19e030,_0x3a5a54){const _0x10ed4c='source'===_0x3a5a54['type']?new Pa(_0x19e030):new _0x5cf211(_0x19e030);return _0x10ed4c['set']({'label':_0x3a5a54['label'],'icon':_0x3a5a54['icon'],'withText':!0x0,'tooltip':!0x0,'tooltipPosition':'sw','class':Po}),_0x10ed4c;}['_setupAllBalloonClickOutsideHandlers'](){this['_setupAddContextBalloonClickOutsideHandler'](),this['_setupUrlBalloonClickOutsideHandler']();}['_setupUrlBalloonClickOutsideHandler'](){_0x1411c6({'emitter':this['_urlBalloonPanelView'],'contextElements':[this['_urlBalloonPanelView']['element']],'callback':()=>{this['hideUrlBalloonPanel']();},'activator':()=>this['_urlBalloonPanelView']['isVisible']});}['_toggleAddContextBalloon'](_0x643919){const _0x3476d0=this['_addContextBalloonConfig'];_0x3476d0['buttonView']['isOn']=_0x643919,_0x643919?_0x3476d0['balloonView']['show']():_0x3476d0['balloonView']['hide']();}['_setupAddContextBalloonClickOutsideHandler'](){const {balloonView:_0x201b1f,buttonView:_0x440db0,hideMethod:_0x306705}=this['_addContextBalloonConfig'];_0x1411c6({'emitter':_0x201b1f,'contextElements':[_0x201b1f['element'],_0x440db0['element']],'callback':()=>{_0x306705();},'activator':()=>_0x440db0['isOn']&&!this['_urlBalloonPanelView']['isVisible']&&!this['_resourcesBalloonView']['isAnyResourceBalloonVisible']()});}['_createContextButton'](_0x429f7e,_0x5bad04,_0x46e210=!0x1,_0x4bdc5c=!0x1){const _0x2ab98a='conversation'===_0x5bad04||!0x0===_0x429f7e['isReadOnly'],_0x5e3f5c=new Bo(this['locale'],_0x429f7e,_0x2ab98a,_0x46e210,_0x4bdc5c);return _0x2ab98a||_0x5e3f5c['on']('removeContextItemChip',()=>{this['fire']('removeContextItem',_0x5e3f5c['id']);}),_0x5e3f5c;}['_addContextToCollection'](_0x53dfdd,_0x2ab425){_0x2ab425['add'](_0x53dfdd,0x0);}['_removeContextFromCollection'](_0x316ce1,_0x1593df){const _0x1bb2ac=_0x1593df['find'](_0x1a98ce=>_0x1a98ce['id']===_0x316ce1);_0x1bb2ac&&_0x1593df['remove'](_0x1bb2ac);}['_handleAddContextButtonClick'](){this['addContextButtonView']['isOn']?this['hideAddContextBalloonPanel']():(this['showAddContextBalloonPanel'](),this['_addContextBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':Ho}));}['_handleUrlSubmit'](_0xfcbf78){this['_urlInputView']['clear'](),this['hideUrlBalloonPanel'](),this['fire']('addUrlToContext',_0xfcbf78);}}class Pa extends _0x5cf211{['arrowView'];constructor(_0x17e7bd){super(_0x17e7bd),this['set']({'withText':!0x0,'role':'menuitem'}),this['arrowView']=this['_createArrowView'](),this['extendTemplate']({'attributes':{'class':[Ro]}});}['render'](){super['render'](),this['children']['add'](this['arrowView']);}['_createArrowView'](){const _0x565010=new _0x1e0173();return _0x565010['content']=_0x4a4728,_0x565010['extendTemplate']({'attributes':{'class':Ro+'__arrow'}}),_0x565010;}}class _s extends _0x55515f{['_cancelButtonView'];['_loaderView'];constructor(_0x84bc9e){super(_0x84bc9e),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 _0x398f34=new _0x5cf211(this['locale']);return _0x398f34['set']({'label':i(this['locale'],'AI_CHAT_STOP_GENERATING'),'withText':!0x0,'class':'ck-ai-button-secondary\x20ck-ai-button-stop-generating','icon':_0x14f5b8}),_0x398f34['on']('execute',()=>{this['fire']('abortPromptStream');}),_0x398f34;}['_createLoaderView'](){const _0x18a4cc=new _0x55515f(this['locale']);return _0x18a4cc['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-controls-loader']},'children':[{'tag':'div','attributes':{'class':['ck-ai-chat-controls-loader-icon']},'children':[{'tag':'div','attributes':{'class':['ck-ai-chat-controls-loader-icon-dot']}},{'tag':'div','attributes':{'class':['ck-ai-chat-controls-loader-icon-dot']}},{'tag':'div','attributes':{'class':['ck-ai-chat-controls-loader-icon-dot']}}]},{'text':i(this['locale'],'AI_CHAT_IS_WRITING')}]}),_0x18a4cc;}}class ji extends _0x55515f{['_displayedModels']=[];['_contextPanelView'];['_promptInputView'];['_promptCapabilitiesView'];['_loaderView'];['_modelUnavailableMessageView'];['_shouldRestorePromptInputFocus'];constructor(_0x104209,_0x1c4942){super(_0x104209),this['_contextPanelView']=this['_createContextPanelView'](_0x104209,{'bodyCollection':_0x1c4942['bodyCollection'],'searchInputVisibleFrom':_0x1c4942['contextResourcesSearchInputVisibleFrom']}),this['_promptInputView']=this['_createPromptInputView'](_0x104209),this['_promptCapabilitiesView']=this['_createPromptCapabilitiesView'](_0x104209),this['_loaderView']=this['_createLoaderView'](_0x104209),this['_modelUnavailableMessageView']=this['_createModelUnavailableMessageView'](_0x104209),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'](...gs)['to'](this),this['set']('isModelAvailable',!0x0),this['set']('isDisabled',!0x1);const _0x632d7b=this['bindTemplate'];this['setTemplate']({'tag':'form','attributes':{'class':['ck','ck-ai-chat-controls',_0x632d7b['if']('isDisabled','ck-ai-chat-controls-disabled')]},'children':[{'tag':'div','attributes':{'class':[_0x632d7b['if']('isLoading','ck-hidden',_0x3902aa=>_0x3902aa||!this['isModelAvailable']),_0x632d7b['if']('isModelAvailable','ck-hidden',_0x53acf7=>!_0x53acf7||this['isLoading'])]},'children':[this['_contextPanelView'],this['_promptInputView'],this['_promptCapabilitiesView']]},{'tag':'div','attributes':{'class':[_0x632d7b['if']('isLoading','ck-hidden',_0x2f85a3=>!_0x2f85a3)]},'children':[this['_loaderView']]},{'tag':'div','attributes':{'class':[_0x632d7b['if']('isModelAvailable','ck-hidden',_0x2b8fe7=>_0x2b8fe7)]},'children':[this['_modelUnavailableMessageView']]}]}),_0x1411c6({'emitter':this['_promptInputView'],'activator':()=>this['isLoading'],'contextElements':()=>[this['element']],'callback':()=>{this['_shouldRestorePromptInputFocus']=!0x1;}}),this['on']('change:isLoading',this['_handlePromptInputFocus'],{'priority':'low'});}['_createContextPanelView'](_0x88e8fc,_0x55095c){return new bs(_0x88e8fc,_0x55095c);}['_createPromptInputView'](_0x82a647){return new ps(_0x82a647,this['_contextPanelView']['addContextButtonView']);}['_createPromptCapabilitiesView'](_0x1a44db){return new ms(_0x1a44db);}['_createLoaderView'](_0x2c375e){return new _s(_0x2c375e);}['_createModelUnavailableMessageView'](_0x17d7f7){const _0x4f0724=new ws(_0x17d7f7);return _0x4f0724['delegate']('startConversation')['to'](this),_0x4f0724;}['_handlePromptInputFocus'](_0x2a9292,_0x15870a,_0x168509){_0x168509?this['_shouldRestorePromptInputFocus']=!0x0:this['_shouldRestorePromptInputFocus']&&this['_promptInputView']['focus']();}['addContextItem'](_0x3645d3,_0x1f555b){this['_contextPanelView']['addContextItem'](_0x3645d3,_0x1f555b);}['removeContextItem'](_0x506954){this['_contextPanelView']['removeContextItem'](_0x506954);}['setContextItemLoading'](_0x263b22,_0x1e7a39){this['_contextPanelView']['setContextItemLoading'](_0x263b22,_0x1e7a39);}['setIsUploadInProgress'](_0x39cdc0){this['_promptInputView']['setIsUploadInProgress'](_0x39cdc0);}['setConversationContext'](_0x431954){this['_contextPanelView']['setConversationContext'](_0x431954);}['clearPendingContextUI'](){this['_contextPanelView']['clearCurrentContextItems']();}['clearConversationContextUI'](){this['_contextPanelView']['clearConversationContextItems']();}['updateResourceState'](_0x5560a6,_0x5e8a8d,_0x372bcb){this['_contextPanelView']['updateResourceState'](_0x5560a6,_0x5e8a8d,_0x372bcb);}['setWebSearch'](_0x9f91ce){this['_promptCapabilitiesView']['setWebSearch'](_0x9f91ce);}['setReasoning'](_0x3b5fc8){this['_promptCapabilitiesView']['setReasoning'](_0x3b5fc8);}['resetMessageInput'](){this['_promptInputView']['reset']();}['setAddContextOptions'](_0x32f6b0){this['_contextPanelView']['setAddContextOptions'](_0x32f6b0);}['setInputPlaceholder'](_0x37e854){this['_promptInputView']['setPlaceholderText'](_0x37e854);}['setModelList'](_0x22a74a,_0x12ea9f){this['_displayedModels']=_0x22a74a,this['_promptCapabilitiesView']['setModelList'](_0x22a74a,_0x12ea9f);}['setModel'](_0x566fdb){(_0x566fdb?this['_displayedModels']['find'](_0x51ec2e=>_0x51ec2e['id']===_0x566fdb['id']):null)?(this['isModelAvailable']=!0x0,this['_promptCapabilitiesView']['setModel'](_0x566fdb)):_0x566fdb?.['id']['startsWith']('agent')?(this['isModelAvailable']=!0x0,this['_promptCapabilitiesView']['setModel'](this['_displayedModels'][0x0])):this['isModelAvailable']=!0x1;}['enableModelSelector'](){this['_promptCapabilitiesView']['enableModelSelector']();}['disableModelSelector'](_0x5ae631){this['_promptCapabilitiesView']['disableModelSelector'](_0x5ae631);}['populateSourceResourceBalloon'](_0x150199,_0x47ab72,_0x2cd9e0,_0x2c304c){this['_contextPanelView']['populateSourceResourceBalloon'](_0x150199,_0x47ab72,_0x2cd9e0,_0x2c304c);}['closeSourceResourceBalloon'](_0x39bb35){this['_contextPanelView']['closeSourceResourceBalloon'](_0x39bb35);}['focusPromptInput'](){this['_promptInputView']['focus']();}}class ws extends _0x55515f{constructor(_0x55d623){super(_0x55d623);const _0x12c8a4=new _0x5cf211(_0x55d623);_0x12c8a4['set']({'label':i(this['locale'],'AI_CHAT_MODEL_UNAVAILABLE_MESSAGE_BUTTON'),'withText':!0x0,'class':['ck-ai-chat-controls__start-new-chat-button'],'tooltip':''}),_0x12c8a4['delegate']('execute')['to'](this,'startConversation'),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat-controls-model-unavailable-message']},'children':[{'tag':'p','children':[{'text':i(this['locale'],'AI_CHAT_MODEL_UNAVAILABLE_MESSAGE_TEXT')+'\x20'},_0x12c8a4]}]});}}class ki extends _0x219fc7{['conversationStartButton'];['resizeButton'];constructor(_0x5c4d3a,_0xa5d719){super(_0x5c4d3a,{'label':i(_0x5c4d3a,'AI_CHAT_HEADING'),'class':'ck-ai-header\x20ck-ai-header_chat','icon':Ht}),this['set']('isMaximized',!0x1),this['conversationStartButton']=this['_createStartConversationButton'](_0x5c4d3a),this['children']['add'](this['conversationStartButton']),_0xa5d719&&(this['resizeButton']=ks(_0x5c4d3a,this),this['children']['add'](this['resizeButton']));}['_createStartConversationButton'](_0x2b51f9){const _0x2b0283=new _0x5cf211(_0x2b51f9);return _0x2b0283['set']({'label':i(this['locale'],'AI_CHAT_LABEL_NEW_CHAT'),'withText':!0x0,'icon':_0x5bfeb9,'class':'ck-ai-chat__start-conversation'}),_0x2b0283['on']('execute',()=>{this['fire']('startConversation');}),_0x2b0283;}}class bi extends _0x55515f{constructor(_0x13223e){super(_0x13223e),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-disclaimer']},'children':[{'tag':'p','attributes':{'class':['ck','ck-ai-disclaimer__content']},'children':[{'text':i(_0x13223e,'AI_DISCLAIMER_TEXT')}]}]});}}class bt extends _0x55515f{['chatHeader'];['chatFeed'];['chatControls'];['chatDisclaimer'];['_bodyCollection'];constructor(_0x247a35,_0x11289b){super(_0x247a35),this['_bodyCollection']=new _0x1008b4(_0x247a35),this['_bodyCollection']['attachToDom'](),this['chatHeader']=new ki(_0x247a35,_0x11289b['showResizeButton']),this['chatHeader']['delegate'](...Mt)['to'](this),this['chatFeed']=new pi(_0x247a35,this['_bodyCollection']),this['chatFeed']['delegate'](...Mt)['to'](this),this['chatControls']=new ji(_0x247a35,{'bodyCollection':this['_bodyCollection'],'contextResourcesSearchInputVisibleFrom':_0x11289b['contextResourcesSearchInputVisibleFrom']}),this['chatControls']['delegate'](...Mt)['to'](this),this['chatDisclaimer']=new bi(_0x247a35),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-ai-chat','ck-rounded-corners'],'dir':_0x247a35['uiLanguageDirection']},'children':[this['chatHeader'],this['chatFeed'],this['chatControls'],this['chatDisclaimer']]});}['populateSourceResourceBalloon'](_0x101d41,_0x23a1a7,_0x342163,_0x4f5f09){this['chatControls']['populateSourceResourceBalloon'](_0x101d41,_0x23a1a7,_0x342163,_0x4f5f09);}['closeSourceResourceBalloon'](_0x194660){this['chatControls']['closeSourceResourceBalloon'](_0x194660);}['destroy'](){this['_bodyCollection']['detachFromDom'](),super['destroy']();}}class dt extends _0x53b1cd{static get['requires'](){return[Ct];}['_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(_0x159bd6){super(_0x159bd6);const _0xfb5512=this['context']['plugins']['get']('AITabs');this['set']('isBusy',!0x1),this['_promiseQueue']=new et(),this['_view']=new bt(this['context']['locale'],{'showResizeButton':_0xfb5512['showResizeButton'],'contextResourcesSearchInputVisibleFrom':this['context']['config']['get']('ai.chat.context.searchInputVisibleFrom')}),this['_view']['delegate'](...Mt)['to'](this),this['_view']['on']('toggleSuggestionDisplayMode',(_0x1519bd,{showDiff:_0xca41f2})=>{this['showDiff']=_0xca41f2;}),_0xfb5512['view']['addTab']({'id':'chat','buttonLabel':i(this['context']['locale'],'AI_CHAT_HEADING'),'buttonIcon':Ht,'order':0x0,'content':this['_view']}),this['_view']['chatControls']['bind']('isLoading')['to'](this,'isBusy',_0x5f03a3=>_0x5f03a3),this['_view']['chatFeed']['bind']('isPending')['to'](this,'isBusy',_0x565238=>_0x565238),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder']()),this['bind']('isModelAvailable')['to'](this['_view']['chatControls'],'isModelAvailable');}['destroy'](){super['destroy'](),this['_titleAnimationInterval']&&clearInterval(this['_titleAnimationInterval']);}['createConversation'](_0x4c4f33){this['_view']['chatFeed']['clear'](),this['_view']['chatControls']['enableModelSelector'](),this['_view']['chatControls']['setModelList'](_0x4c4f33['availableModels'],!this['context']['config']['get']('ai.chat.models.modelSelectorAlwaysVisible')),this['addFeedItemStaticMessage']({'id':'conversation-start','staticMessage':i(this['context']['locale'],'AI_CHAT_WELCOME_MESSAGE')});}['addFeedItemStaticMessage']({id:_0x4a9d5b,staticMessage:_0x5d34ec}){this['_view']['chatFeed']['addItem']('ai-reply',{'id':_0x4a9d5b,'initialContent':'<p>'+_0x5d34ec+'</p>'});}['addFeedItemUserMessage'](_0x1a30f3){const _0x54f303=_0x1a30f3['quickActionData']?.['displayedPrompt']||_0x1a30f3['userMessage'];this['_view']['chatFeed']['addItem']('user-message',{'contextItems':Array['from'](_0x1a30f3['contextItems']['values']()),'initialContent':'<p>'+_0x54f303+'</p>','id':_0x1a30f3['id']});}['addFeedItemError']({errorMessage:_0xc26e43,id:_0x1b990e}){this['_view']['chatFeed']['addItem']('error-message',{'initialContent':'<p>'+_0xc26e43+'</p>','id':_0x1b990e});}['addFeedItemAIReply'](_0xe39e4c){return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('ai-reply',{'id':_0xe39e4c['interactionId']+':'+_0xe39e4c['id']}),this['setLoadingMessage'](null);});}async['addFeedItemAISuggestion'](_0x2c9064){const _0x2af7d4=q(this['context']);let _0x5ce7c4=_0x2af7d4['config']['get']('ai.availableReplyActions')||[...H];if(_0x2af7d4['plugins']['has']('TrackChanges')){if(!this['_isTrackChangesCommandValueBound']){this['_isTrackChangesCommandValueBound']=!0x0;const _0x277cbd=_0x2af7d4['commands']['get']('trackChanges');this['_view']['chatFeed']['bind']('isTrackChangesOn')['to'](_0x277cbd,'value');}}else _0x5ce7c4=_0x5ce7c4['filter'](_0x52a8ef=>'insertSuggestion'!=_0x52a8ef);return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('ai-suggestion-reply',{'id':_0x2c9064['interactionId']+':'+_0x2c9064['id'],'areActionsDisabled':_0x2c9064['areActionsDisabled'],'showDiff':this['showDiff'],'availableActions':_0x5ce7c4}),this['setLoadingMessage'](null);});}['addFeedInteractionHeader'](_0x4f5293,_0xa31f0f){const _0x40a248=this['_view']['chatFeed']['children']['last'];if(_0x40a248 instanceof Lt)return this['_view']['chatFeed']['children']['remove'](_0x40a248),void this['_view']['chatFeed']['addItem']('interaction-header',{'id':_0x4f5293['id'],'capabilities':{'isWebSearchEnabled':_0x40a248['capabilities']['isWebSearchEnabled']||_0xa31f0f['isWebSearchEnabled'],'isReasoningEnabled':_0x40a248['capabilities']['isReasoningEnabled']||_0xa31f0f['isReasoningEnabled']}});this['_view']['chatFeed']['addItem']('interaction-header',{'id':_0x4f5293['id'],'capabilities':_0xa31f0f});}['updateFeedInteractionHeader'](_0xeb31b2){const _0x2431ba=this['_view']['chatFeed']['children']['find'](_0x38a1a8=>_0x38a1a8['options']['id']==_0xeb31b2['id']&&_0x38a1a8 instanceof Lt);_0x2431ba&&_0x2431ba['set']('isVisible',_0xeb31b2['isVisible']);}async['updateFeedItemAIReplyContent'](_0x413e90){const _0x36292a=_0x413e90['renderingStrategy']||this['feedItemRenderingStrategy'];return this['_promiseQueue']['enqueue'](async _0x4d3a9f=>{await this['_view']['chatFeed']['updateReplyItem']({..._0x413e90,'abortSignal':_0x4d3a9f,'renderingStrategy':_0x36292a}),_0x413e90['isDone']&&this['markFeedItemAsDone'](_0x413e90['id']);});}['updateFeedItemAIReplySources'](_0x174469,_0x16fdf6){this['_view']['chatFeed']['updateWebSources'](_0x174469,_0x16fdf6);}async['updateFeedItemAIReplySuggestionContent'](_0x102a03){const _0x2ffa67=_0x102a03['renderingStrategy']||this['feedItemRenderingStrategy'];return this['_promiseQueue']['enqueue'](async _0x1105f0=>{await this['_view']['chatFeed']['updateSuggestionItem']({..._0x102a03,'abortSignal':_0x1105f0,'renderingStrategy':_0x2ffa67}),_0x102a03['isDone']&&this['markFeedItemAsDone'](_0x102a03['id']);});}['updateFeedItemAIReplySuggestionPartState'](_0x55e273){this['_view']['chatFeed']['updateSuggestionPartState'](_0x55e273);}['markFeedItemAsDone'](_0x4a11f7){this['_view']['chatFeed']['markItemAsDone'](_0x4a11f7);}['removeFeedInteraction'](_0xfb106c){this['_view']['chatFeed']['getItemIds']()['filter'](_0x4ad744=>_0x4ad744['startsWith'](_0xfb106c))['forEach'](_0x2ac031=>this['_view']['chatFeed']['removeItem'](_0x2ac031));}['startInteraction'](){this['setLoadingMessage']({'isWebSearchEnabled':!0x1,'isReasoningEnabled':!0x1}),this['_view']['chatControls']['disableModelSelector'](!this['context']['config']['get']('ai.chat.models.modelSelectorAlwaysVisible')),this['isBusy']=!0x0,this['_view']['chatFeed']['startAutoScroll']();}['stopInteraction'](_0x166ebd){this['_promiseQueue']['abort'](),this['_view']['chatFeed']['getItemIds']()['filter'](_0x261cb2=>_0x261cb2['startsWith'](_0x166ebd['id']))['forEach'](_0x1a618b=>this['markFeedItemAsDone'](_0x1a618b)),this['isBusy']=!0x1,this['_view']['chatFeed']['stopAutoScroll']();}async['finishInteraction'](){return this['_promiseQueue']['queueEmptyPromise']['then'](()=>{this['isBusy']=!0x1,this['_view']['chatFeed']['stopAutoScroll']();});}['addContextItem'](_0x20e833,_0x5082bf){this['_view']['chatControls']['addContextItem'](_0x20e833,_0x5082bf);}['removeContextItem'](_0x3bdb29){this['_view']['chatControls']['removeContextItem'](_0x3bdb29);}['setContextItemLoading'](_0x44103a,_0x58bdba){this['_view']['chatControls']['setContextItemLoading'](_0x44103a,_0x58bdba);}['setIsUploadInProgress'](_0x3a3fc0){this['_view']['chatControls']['setIsUploadInProgress'](_0x3a3fc0);}['setConversationContext'](_0x1fbb4e){this['_view']['chatControls']['setConversationContext'](_0x1fbb4e);}['clearPendingContextUI'](){this['_view']['chatControls']['clearPendingContextUI']();}['clearConversationContextUI'](){this['_view']['chatControls']['clearConversationContextUI']();}['updateResourceState'](_0x29d8a1,_0x28f0fe,_0x536998){this['_view']['chatControls']['updateResourceState'](_0x29d8a1,_0x28f0fe,_0x536998);}['resetMessageInput'](){this['_view']['chatControls']['resetMessageInput'](),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder']());}['setAddContextOptions'](_0xc1a3a5){this['_view']['chatControls']['setAddContextOptions'](_0xc1a3a5);}['updateCapabilities'](_0x231b80){this['_view']['chatControls']['setWebSearch'](_0x231b80['isWebSearchEnabled']),this['_view']['chatControls']['setReasoning'](_0x231b80['isReasoningEnabled']),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder'](_0x231b80));}['setSelectedModel'](_0x48079d,_0x28aaf8){this['_view']['chatControls']['setModel'](_0x48079d),_0x28aaf8&&this['_view']['chatControls']['disableModelSelector'](!0x1);}['setFeedItemRenderingStrategy'](_0x822f77){this['feedItemRenderingStrategy']=_0x822f77;}['toggleLoadingSkeleton'](_0x31ac0f){this['_view']['chatFeed']['toggleLoadingSkeleton'](_0x31ac0f);}['resetConversationTitle'](){this['setConversationTitle'](i(this['context']['locale'],'AI_CHAT_HEADING'));}['setConversationTitle'](_0x16ae52,_0x36146f=!0x1){if(_0x36146f&&!Pt()&&_0x16ae52['length'])return this['_view']['chatHeader']['label']='',void this['_animateConversationTitle'](_0x16ae52);this['_view']['chatHeader']['label']=_0x16ae52;}['setLoadingMessage'](_0x3a3e9d){const _0x32fbe2=this['_getLoadingMessage'](_0x3a3e9d);this['_view']['chatFeed']['setLoadingMessage'](_0x32fbe2);}['_animateConversationTitle'](_0x2b1702){let _0x52e5ae=0x0;clearInterval(this['_titleAnimationInterval']),this['_titleAnimationInterval']=setInterval(()=>{this['_view']['chatHeader']['label']=this['_view']['chatHeader']['label']+_0x2b1702[_0x52e5ae],_0x52e5ae++,_0x52e5ae===_0x2b1702['length']&&clearInterval(this['_titleAnimationInterval']);},0x1e);}['setIsMaximized'](_0x29a39e){this['_view']['chatHeader']['isMaximized']=_0x29a39e;}['_getLoadingMessage'](_0x4c0125){return _0x4c0125?_0x4c0125['isWebSearchEnabled']&&_0x4c0125['isReasoningEnabled']?i(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH_REASONING'):_0x4c0125['isWebSearchEnabled']?i(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH'):_0x4c0125['isReasoningEnabled']?i(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_REASONING'):i(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_REGULAR'):'';}['_getInputPlaceholder'](_0xb24fa8){return _0xb24fa8?_0xb24fa8['isWebSearchEnabled']&&_0xb24fa8['isReasoningEnabled']?i(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH_REASONING'):_0xb24fa8['isWebSearchEnabled']?i(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH'):_0xb24fa8['isReasoningEnabled']?i(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REASONING'):i(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REGULAR'):i(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REGULAR');}['populateSourceResourceBalloon'](_0x2a2e05,_0x3b25a1,_0x13a9dd,_0x1ca8ea){this['_view']['populateSourceResourceBalloon'](_0x2a2e05,_0x3b25a1,_0x13a9dd,_0x1ca8ea);}['closeSourceResourceBalloon'](_0x4b1ca1){this['_view']['closeSourceResourceBalloon'](_0x4b1ca1);}['focusPromptInput'](){this['_view']['chatControls']['focusPromptInput']();}['scrollFeedToSuggestion'](_0x1f4e0a,_0x4fee4c){this['_view']['chatFeed']['scrollToSuggestion'](_0x1f4e0a,_0x4fee4c);}['startAutoScroll'](){this['_view']['chatFeed']['startAutoScroll']();}['disableControls'](){this['_view']['chatControls']['isDisabled']=!0x0;}['enableControls'](){this['_view']['chatControls']['isDisabled']=!0x1;}}class Mi extends _0x429409{['sections'];constructor(_0x5b98cb,_0x1633c1){super(_0x5b98cb),this['sections']=_0x1633c1,this['items']['addMany'](this['sections']),this['extendTemplate']({'attributes':{'class':['ck-ai-chat-history__sections']}});}['filter'](_0x909cc7){let _0x5a888e=0x0,_0x176d66=0x0;for(const _0x1cc076 of this['sections']){const {resultsCount:_0x56b6e9,totalItemsCount:_0x5dc6dc}=_0x1cc076['filter'](_0x909cc7);_0x5a888e+=_0x56b6e9,_0x176d66+=_0x5dc6dc;}return{'resultsCount':_0x5a888e,'totalItemsCount':_0x176d66};}}class xi extends _0x5f38b9{['title'];['itemsViews'];['_itemsListView'];constructor(_0x496995,{title:_0x258e67,items:_0x2e5925}){super(_0x496995);const _0x772790=this['bindTemplate'];this['set']('isVisible',!0x0),this['title']=_0x258e67,this['itemsViews']=_0x2e5925;const _0x44d9ea=new _0x55515f(_0x496995);_0x44d9ea['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-history__section-title']},'children':[this['title']]}),this['_itemsListView']=new _0x429409(_0x496995),this['_itemsListView']['items']['addMany'](this['itemsViews']),this['setTemplate']({'tag':'li','attributes':{'class':['ck-ai-chat-history__section',_0x772790['if']('isVisible','ck-hidden',_0x4233be=>!_0x4233be)]},'children':[_0x44d9ea,this['_itemsListView']]});}['filter'](_0x11a50e){const _0x2e58cf=this['itemsViews']['length'];let _0x412d4a=0x0;for(const _0x33faa5 of this['itemsViews']){if(_0x11a50e){const _0x5adbca=_0x33faa5['isMatching'](_0x11a50e);_0x33faa5['isVisible']=!!_0x5adbca,_0x33faa5['highlightText'](_0x11a50e);}else _0x33faa5['isVisible']=!0x0,_0x33faa5['highlightText'](null);_0x33faa5['isVisible']&&_0x412d4a++;}return this['isVisible']=_0x412d4a>0x0,{'resultsCount':_0x412d4a,'totalItemsCount':_0x2e58cf};}['getItem'](_0x4a4050){return this['itemsViews']['find'](_0x44d6a4=>_0x44d6a4['id']===_0x4a4050);}['removeItem'](_0x26fa0a){const _0xb6972c=this['itemsViews']['indexOf'](_0x26fa0a);-0x1!==_0xb6972c&&(this['itemsViews']['splice'](_0xb6972c,0x1),this['_itemsListView']['items']['remove'](_0x26fa0a));}}class Li extends/* #__PURE__ -- @preserve */
|
|
27
|
+
_0x413600(_0x5f38b9){['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(_0x5b83ca,_0x39f343){super(_0x5b83ca);const _0x35d92f=this['bindTemplate'];this['set']('isEdit',!0x1),this['set']('isVisible',!0x0),this['set']('pinned',!!_0x39f343['pinned']),this['set']('loadingState',null),this['id']=_0x39f343['id'];const {title:_0x4f67e8,createdAt:_0x4d49ad,active:_0x47d76a=!0x1}=_0x39f343;this['_titleView']=new _0x201c3b(),this['_titleView']['text']=_0x4f67e8,this['_titleView']['extendTemplate']({'attributes':{'class':['ck-ai-chat-history__item-title']}});const _0x451503=this['_createCheckView'](),_0x3405fd=this['_createPinButtonView'](_0x5b83ca),_0x4ec64e=this['_createMenuDropdownView'](),_0x4b9282=this['_createEditInputView'](_0x5b83ca,_0x4f67e8),_0x232086=this['_createAcceptEditButtonView'](_0x5b83ca,_0x4b9282),_0x3905ac=this['_createCancelEditButtonView'](_0x5b83ca,_0x4b9282);this['actions']=this['createCollection'](),this['mainContent']=this['createCollection'](),this['mainContent']['add'](this['_titleView']),this['actions']['add'](_0x3405fd),this['actions']['add'](_0x4ec64e),this['on']('change:isEdit',(_0x4503a5,_0x4bdf11,_0x241e30)=>{this['actions']['clear'](),this['mainContent']['clear'](),_0x241e30?(this['actions']['add'](_0x232086),this['actions']['add'](_0x3905ac),this['mainContent']['add'](_0x4b9282),_0x4b9282['element']['focus']()):(this['actions']['add'](_0x3405fd),this['actions']['add'](_0x4ec64e),this['mainContent']['add'](this['_titleView']));}),this['setTemplate']({'tag':'li','attributes':{'class':['ck-ai-chat-history__item',_0x47d76a?'ck-ai-chat-history__item--active':'',_0x35d92f['if']('isVisible','ck-hidden',_0x4e88ba=>!_0x4e88ba),_0x35d92f['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',_0x35d92f['if']('loadingState','ck-hidden',_0xfa3ec4=>!!_0xfa3ec4)]},'children':_0x47d76a?[_0x451503]:[]},{'tag':'div','attributes':{'class':['ck-ai-loader',_0x35d92f['if']('loadingState','ck-hidden',_0x3b4698=>!_0x3b4698)]},'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',_0x35d92f['if']('loadingState','ck-hidden',_0x337e54=>!!_0x337e54)]},'children':this['mainContent']},{'tag':'div','attributes':{'class':['ck-ai-loader__text',_0x35d92f['if']('loadingState','ck-hidden',_0x8e7cc6=>!_0x8e7cc6)]},'children':[{'text':_0x35d92f['to']('loadingState',_0x136e40=>_0x136e40?i(this['locale'],Li['LOADING_LABELS'][_0x136e40]):'')}]}]},{'tag':'span','attributes':{'class':['ck-ai-chat-history__item-date']},'children':[_0x4d49ad]}]},{'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'](_0x2f7edd){this['_titleView']['text']=_0x25d6a2(_0x2f7edd);}['updateLoadingState'](_0x7f8a49,_0x1201f5){this['set']('loadingState',_0x1201f5?_0x7f8a49:null);}['_createCheckView'](){const _0x6637f2=new _0x1e0173();return _0x6637f2['set']({'content':_0x4ddb98}),_0x6637f2;}['_createPinButtonView'](_0x43cde4){const _0x3d3f5f=new _0x5cf211(_0x43cde4);return _0x3d3f5f['set']({'label':i(_0x43cde4,'AI_CHAT_HISTORY_PIN_BUTTON'),'icon':_0x254f09,'withText':!0x1,'tooltip':!0x0}),_0x3d3f5f['bind']('isOn')['to'](this,'pinned'),_0x3d3f5f['on']('execute',()=>{const _0xd36d67=!this['pinned'];this['fire']('setConversationPinned',{'id':this['id'],'pinned':_0xd36d67});}),_0x3d3f5f;}['_createMenuDropdownView'](){const _0x173db7=_0x4c9a3b(this['locale'],_0x15272b),_0x100fd5=_0x173db7['panelView']['children'];_0x173db7['buttonView']['set']({'label':i(this['locale'],'AI_CHAT_HISTORY_SHOW_MORE_ITEMS'),'icon':_0x408af4}),_0x173db7['panelPosition']='sw';const _0x16e539=new _0x5cf211(this['locale']);_0x16e539['label']=i(this['locale'],'AI_CHAT_HISTORY_EDIT_NAME'),_0x16e539['withText']=!0x0,_0x16e539['on']('execute',()=>{this['isEdit']=!0x0;});const _0x428a4d=new _0x5cf211(this['locale']);_0x428a4d['label']=i(this['locale'],'AI_CHAT_HISTORY_REMOVE'),_0x428a4d['withText']=!0x0,_0x428a4d['on']('execute',()=>{this['showConfirm'](i(this['locale'],'AI_CHAT_HISTORY_REMOVE_CONFIRM'),this['element'])['then'](()=>{this['fire']('removeConversation',{'id':this['id']});});});const _0x8d5c0c=new _0x429409(this['locale']),_0x5255cc=new _0x5f38b9(this['locale']);_0x5255cc['children']['add'](_0x16e539);const _0x2d303d=new _0x5f38b9(this['locale']);return _0x2d303d['children']['add'](_0x428a4d),_0x8d5c0c['items']['addMany']([_0x5255cc,_0x2d303d]),_0x100fd5['add'](_0x8d5c0c),_0x173db7;}['_createEditInputView'](_0x3ea538,_0x5d8fcb){const _0x1d37b3=new _0x1f8052(_0x3ea538),_0x161450=_0x1d37b3['bindTemplate'];return _0x1d37b3['value']=_0x5d8fcb,_0x1d37b3['extendTemplate']({'on':{'keydown':_0x161450['to'](_0x531280=>{'Enter'==_0x531280['key']&&this['_commitEditInputValue'](_0x1d37b3);})}}),_0x1d37b3;}['_createAcceptEditButtonView'](_0x222e09,_0x4e6154){const _0xb06e78=new _0x5cf211(_0x222e09);return _0xb06e78['set']({'icon':_0x4ddb98,'withText':!0x1,'tooltip':i(_0x222e09,'AI_CHAT_HISTORY_ACCEPT')}),_0xb06e78['extendTemplate']({'attributes':{'class':['ck-confirm-view-submit']}}),_0xb06e78['on']('execute',()=>{this['_commitEditInputValue'](_0x4e6154);}),_0xb06e78;}['_commitEditInputValue'](_0x26f068){const _0x4e59bc=_0x26f068['element']['value']||'';this['_titleView']['text']=_0x4e59bc,this['isEdit']=!0x1,this['fire']('editConversationTitle',{'id':this['id'],'title':_0x4e59bc});}['_createCancelEditButtonView'](_0x1af9bc,_0x46d5b2){const _0x54887f=new _0x5cf211(_0x1af9bc);return _0x54887f['set']({'icon':_0x43c7d2,'withText':!0x1,'tooltip':i(_0x1af9bc,'AI_CHAT_HISTORY_CANCEL')}),_0x54887f['extendTemplate']({'attributes':{'class':['ck-confirm-view-cancel']}}),_0x54887f['on']('execute',()=>{this['isEdit']=!0x1,_0x46d5b2['value']=this['_titleView']['text']||'',this['fire']('edit:cancel');}),_0x54887f;}['_createSpinnerView'](){const _0x16a483=new We('tiny');return _0x16a483['isVisible']=!0x0,_0x16a483;}['isMatching'](_0x51f1b2){return this['_titleView']&&'string'==typeof this['_titleView']['text']&&this['_titleView']['text']['match'](_0x51f1b2)?{'title':!0x0}:null;}['highlightText'](_0x3c1564){this['_titleView']['highlightText'](_0x3c1564);}}class kt extends _0x55515f{['searchView'];['mainErrorView'];['skeletonView'];['emptyView'];['sectionsView'];['resizeButton'];constructor(_0x371091,_0x9eb01c){super(_0x371091),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 _0x5214f9=new _0x219fc7(_0x371091,{'label':i(_0x371091,'AI_CHAT_HISTORY_HEADING'),'icon':Ut,'class':'ck-ai-header\x20ck-ai-header_history'});_0x9eb01c&&(this['resizeButton']=ks(_0x371091,this),_0x5214f9['children']['add'](this['resizeButton'])),this['sectionsView']=new Mi(_0x371091,[]),this['sectionsView']['delegate'](...Yi)['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',_0x4f7599=>!_0x4f7599)]}}),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':[_0x5214f9,{'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 _0x1209d5=new _0x33b88d(this['locale'],{'filteredView':this['sectionsView'],'queryView':{'label':i(this['locale'],'AI_CHAT_HISTORY_SEARCH_LABEL')},'infoView':{'text':{'notFound':{'primary':_0x276a89=>i(this['locale'],'AI_CHAT_HISTORY_SEARCH_NOT_FOUND_PRIMARY',_0x276a89),'secondary':i(this['locale'],'AI_CHAT_HISTORY_SEARCH_NOT_FOUND_SECONDARY')}}}}),_0x4dd91c=this['_createErrorView']();return _0x4dd91c['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('errorMessage','ck-hidden',_0x11b62c=>!_0x11b62c)]}}),_0x1209d5['on']('render',()=>{_0x1209d5['children']['add'](_0x4dd91c,0x1);}),_0x1209d5['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isSearchViewVisible','ck-hidden',_0x544a9b=>!_0x544a9b)]}}),_0x1209d5;}['_createSkeletonView'](){const _0x1da77d=new Pe(this['locale'],Be['aiHistory']);return _0x1da77d['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isLoading','ck-hidden',_0x434ffb=>!_0x434ffb)]}}),_0x1da77d;}['_createErrorView'](){const _0x3fb79d=new _0x55515f(this['locale']),_0x19c931=new _0x5cf211(this['locale']);_0x19c931['set']({'withText':!0x1,'icon':_0x43c7d2,'class':'ck-ai-notification_error__dismiss-button'}),_0x19c931['bind']('isVisible')['to'](this,'hasItems',_0x54b6be=>!!_0x54b6be),_0x19c931['on']('execute',()=>{this['errorMessage']='';});const _0x1204ba=this['bindTemplate'];return _0x3fb79d['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-notification','ck-ai-notification_error']},'children':[{'tag':'p','children':[{'text':_0x1204ba['to']('errorMessage')}]},_0x19c931]}),_0x3fb79d;}['_createEmptyStateView'](){const _0x3b9c15=new _0x5cf211(this['locale']);_0x3b9c15['set']({'label':i(this['locale'],'AI_CHAT_LABEL_NEW_CHAT'),'withText':!0x0,'icon':_0x5bfeb9,'class':'ck-ai-chat__start-conversation'}),_0x3b9c15['on']('execute',()=>{this['fire']('openChat');});const _0x5536ef=new _0x55515f(this['locale']);return _0x5536ef['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-history__empty',this['bindTemplate']['if']('isEmptyViewVisible','ck-hidden',_0xdcb099=>!_0xdcb099)]},'children':[{'tag':'p','attributes':{'class':['ck-ai-chat-history__empty-message']},'children':[i(this['locale'],'AI_CHAT_HISTORY_EMPTY_MESSAGE')]},_0x3b9c15]}),_0x5536ef;}['_createListItemViews'](_0x27083d,_0x1e3e58){const _0x427fa9=[];for(const _0x2fd02b of _0x27083d){const _0x3947a2=new Li(_0x1e3e58,_0x2fd02b);_0x3947a2['delegate'](...Yi)['to'](this),_0x427fa9['push'](_0x3947a2);}return _0x427fa9;}['updateHistoryItemsWithCategories'](_0x74d362){const _0x4fdd9b=this['locale']||'en',_0x37155d=[];for(const _0x708ac5 of _0x74d362){const _0x2ec441=this['_createListItemViews'](_0x708ac5['items'],_0x4fdd9b);_0x37155d['push'](new xi(_0x4fdd9b,{'title':_0x708ac5['title'],'items':_0x2ec441}));}this['sectionsView']['sections']=_0x37155d,this['sectionsView']['items']['clear'](),this['sectionsView']['items']['addMany'](_0x37155d),this['hasItems']=_0x74d362['some'](_0x38a8a3=>_0x38a8a3['items']['length']>0x0),this['_refreshSearch']();}['removeHistoryItem'](_0x15042e){for(const _0x270ed3 of this['sectionsView']['sections']){const _0x47e794=_0x270ed3['getItem'](_0x15042e);if(_0x47e794){if(_0x270ed3['removeItem'](_0x47e794),0x0===_0x270ed3['itemsViews']['length']){const _0x425ebd=this['sectionsView']['sections']['indexOf'](_0x270ed3);-0x1!==_0x425ebd&&(this['sectionsView']['sections']['splice'](_0x425ebd,0x1),this['sectionsView']['items']['remove'](_0x270ed3));}this['hasItems']=this['sectionsView']['sections']['length']>0x0,this['_refreshSearch']();break;}}}['updateItemTitle'](_0x2c83b5,_0x4176e0){for(const _0x38567d of this['sectionsView']['sections']){const _0x58a67a=_0x38567d['getItem'](_0x2c83b5);if(_0x58a67a){_0x58a67a['updateTitle'](_0x4176e0);break;}}}['updateItemLoadingState'](_0x4a672e,_0x313a0e,_0x21247b){for(const _0x4c1981 of this['sectionsView']['sections']){const _0x3c6b62=_0x4c1981['getItem'](_0x4a672e);if(_0x3c6b62){_0x3c6b62['updateLoadingState'](_0x313a0e,_0x21247b);break;}}}['_refreshSearch'](){if(this['hasItems']){const _0x5d6200=this['searchView']['queryView']['fieldView']?.['element']?.['value']||'';this['searchView']['search'](_0x5d6200);}}}const Yi=['showConversationHistory','removeConversation','editConversationTitle','setConversationPinned','selectConversation','openChat','resizeTabs'];class xt extends _0x53b1cd{static get['requires'](){return[Ct];}['_historyView'];static get['pluginName'](){return'AIChatHistoryUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x555ca7){super(_0x555ca7);const _0xda1ed0=this['context']['plugins']['get']('AITabs');this['_historyView']=new kt(this['context']['locale'],_0xda1ed0['showResizeButton']),this['_historyView']['delegate'](...Yi)['to'](this),_0xda1ed0['view']['addTab']({'id':'history','buttonLabel':i(this['context']['locale'],'AI_CHAT_HISTORY_HEADING'),'buttonIcon':Ut,'order':0x0,'content':this['_historyView']});}['removeHistoryItem'](_0x385aa5){this['_historyView']['removeHistoryItem'](_0x385aa5);}['updateItems'](_0x46d634){this['_historyView']['updateHistoryItemsWithCategories'](_0x46d634);}['updateItemTitle'](_0x5c4ad1,_0xcfd838){this['_historyView']['updateItemTitle'](_0x5c4ad1,_0xcfd838);}['updateItemLoadingState'](_0x461aac,_0x147e0d,_0x5775a3){this['_historyView']['updateItemLoadingState'](_0x461aac,_0x147e0d,_0x5775a3);}['setLoadingSkeleton'](_0x59de86){this['_historyView']['isLoading']=_0x59de86;}['showError'](_0x17c3ea){this['_historyView']['errorMessage']=_0x17c3ea;}['hideError'](){this['_historyView']['errorMessage']='';}['setIsMaximized'](_0x567377){this['_historyView']['isMaximized']=_0x567377;}}class Ue extends ts(){['id'];['createdAt'];constructor({id:_0x58f906,title:_0x48083c,createdAt:_0x423acb,updatedAt:_0x1db2ef,pinned:_0x30fc1e}){super(),this['id']=_0x58f906,this['createdAt']=new Date(_0x423acb),this['set']('title',_0x48083c),this['set']('updatedAt',_0x1db2ef?new Date(_0x1db2ef):null),this['set']('pinned',_0x30fc1e||!0x1);}['updateTitle'](_0x546f50){this['set']('title',_0x25d6a2(_0x546f50)),this['updatedAt']=new Date();}['updatePinned'](_0x4f532e){this['set']('pinned',_0x4f532e),this['updatedAt']=new Date();}}class Yt extends _0x32571c(){['items']=[];['connector'];['group'];constructor({connector:_0x306499,group:_0xf608fa}){super(),this['connector']=_0x306499,this['group']=_0xf608fa;}async['init'](){try{const _0x56b0f8=this['connector']['fetchConversations'](this['group']),_0x5b920f=await _0x56b0f8['getConversations']();this['loadItems'](_0x5b920f);}catch(_0xb688d2){this['fire']('error',{'error':_0xb688d2,'operation':'init'});}}['addItem'](_0x370216){this['items']['push'](_0x370216);}async['removeItem'](_0x2dbcc0){const _0x506374=this['items']['findIndex'](_0x43c8dd=>_0x43c8dd['id']===_0x2dbcc0);if(-0x1===_0x506374)return!0x1;try{return await this['connector']['deleteConversation'](_0x2dbcc0)['execute'](),this['items']['splice'](_0x506374,0x1),this['fire']('itemRemoved',{'itemId':_0x2dbcc0}),!0x0;}catch(_0x2c6e80){return this['fire']('error',{'error':_0x2c6e80,'operation':'removeItem','itemId':_0x2dbcc0}),!0x1;}}['getItem'](_0x1b5df3){return this['items']['find'](_0x532357=>_0x532357['id']===_0x1b5df3);}async['updateItemTitle'](_0x566c23,_0x29460){const _0x556e33=this['getItem'](_0x566c23);if(!_0x556e33)return!0x1;try{return await this['connector']['updateConversation'](_0x566c23,{'title':_0x29460})['getResult'](),_0x556e33['updateTitle'](_0x29460),this['fire']('itemUpdated',{'itemId':_0x566c23,'updates':{'title':_0x29460}}),!0x0;}catch(_0x412514){return this['fire']('error',{'error':_0x412514,'operation':'updateItemTitle','itemId':_0x566c23}),!0x1;}}async['updateItemPinned'](_0x1eabe6,_0x3be0be){const _0x1aacad=this['getItem'](_0x1eabe6);if(!_0x1aacad)return!0x1;try{return await this['connector']['updateConversation'](_0x1eabe6,{'pinned':_0x3be0be})['getResult'](),_0x1aacad['updatePinned'](_0x3be0be),this['fire']('itemUpdated',{'itemId':_0x1eabe6,'updates':{'pinned':_0x3be0be}}),!0x0;}catch(_0x2c5e38){return this['fire']('error',{'error':_0x2c5e38,'operation':'updateItemPinned','itemId':_0x1eabe6}),!0x1;}}['loadItems'](_0x153a77){try{this['items']=[],_0x153a77['map'](_0x33a8ac=>{this['addItem'](new Ue(_0x33a8ac));}),this['fire']('itemsLoaded',{'items':[...this['items']]});}catch(_0x18f537){this['fire']('error',{'error':_0x18f537,'operation':'loadItems'});}}['getItems'](_0x599c0b={}){const _0x3c0c92=void 0x0!==_0x599c0b['pinned']&&_0x599c0b['pinned'],_0x3a6586=_0x599c0b['from']?new Date(_0x599c0b['from']['getFullYear'](),_0x599c0b['from']['getMonth'](),_0x599c0b['from']['getDate']()):null,_0x5ba8ac=_0x599c0b['to']?new Date(_0x599c0b['to']['getFullYear'](),_0x599c0b['to']['getMonth'](),_0x599c0b['to']['getDate']()):null;return this['items']['filter'](_0xd4ffd1=>{if(_0xd4ffd1['pinned']!==_0x3c0c92)return!0x1;if(_0x5ba8ac){const _0x1b3a32=new Date(_0xd4ffd1['createdAt']['getFullYear'](),_0xd4ffd1['createdAt']['getMonth'](),_0xd4ffd1['createdAt']['getDate']());return _0x3a6586?_0x3a6586['getTime']()===_0x5ba8ac['getTime']()?_0x1b3a32['getTime']()===_0x3a6586['getTime']():_0x1b3a32<_0x5ba8ac&&_0x1b3a32>=_0x3a6586:_0x1b3a32<_0x5ba8ac;}return!0x0;});}}class jt extends _0x53b1cd{['_aiConnector'];['_aiChatHistoryUi'];['_aiChatController'];static get['requires'](){return[R,mt,xt,Ct];}static get['pluginName'](){return'AIChatHistoryController';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){this['_aiConnector']=this['context']['plugins']['get'](R),this['_aiChatHistoryUi']=this['context']['plugins']['get'](xt),this['_aiChatController']=this['context']['plugins']['get'](mt);const _0x8a513b=this['context']['plugins']['get'](Ct);try{const _0x552e57=this['_aiChatController']['getGroupId']();this['history']=new Yt({'connector':this['_aiConnector'],'group':_0x552e57}),this['listenTo'](this['_aiChatHistoryUi'],'removeConversation',(_0x5cd401,_0x17caef)=>{this['_setItemLoading'](_0x17caef['id'],'remove'),this['_handleRemove'](_0x17caef['id']);}),this['listenTo'](this['_aiChatHistoryUi'],'editConversationTitle',(_0x3cfd5a,_0x17a4fb)=>{this['_setItemLoading'](_0x17a4fb['id'],'rename'),this['_handleEditTitle'](_0x17a4fb['id'],_0x17a4fb['title']);}),this['listenTo'](this['history'],'itemUpdated',(_0x52a226,_0x4748a5)=>{void 0x0!==_0x4748a5['updates']['title']&&this['_aiChatHistoryUi']['updateItemTitle'](_0x4748a5['itemId'],_0x4748a5['updates']['title']),void 0x0!==_0x4748a5['updates']['pinned']&&this['_updateHistoryItemsUI'](),this['_clearItemLoading'](_0x4748a5['itemId']);}),this['listenTo'](this['history'],'itemRemoved',(_0x57f58f,_0x50a149)=>{this['_aiChatController']['handleRemovedConversation'](_0x50a149['itemId']),this['_aiChatHistoryUi']['removeHistoryItem'](_0x50a149['itemId']),this['_clearItemLoading'](_0x50a149['itemId']);}),this['listenTo'](this['history'],'itemsLoaded',()=>{this['_updateHistoryItemsUI']();}),this['listenTo'](this['history'],'error',(_0x3d7496,_0xb8ce36)=>{this['_handleHistoryErrorUI'](_0xb8ce36['error'],_0xb8ce36['operation'],_0xb8ce36['itemId']);}),this['listenTo'](this['_aiChatHistoryUi'],'selectConversation',(_0xc27df7,_0x99c901)=>{this['_handleSelectConversation'](_0x99c901['id']);}),this['listenTo'](this['_aiChatHistoryUi'],'setConversationPinned',(_0x50dff9,_0x138824)=>{const _0x26043a=_0x138824['pinned']?'pin':'unpin';this['_setItemLoading'](_0x138824['id'],_0x26043a),this['_handleTogglePin'](_0x138824['id'],_0x138824['pinned']);}),this['listenTo'](this['_aiChatHistoryUi'],'openChat',()=>{_0x8a513b['view']['activateTab']('chat');}),this['listenTo'](this['_aiChatController'],'change:activeConversation',()=>{this['_updateHistoryItemsUI']();}),_0x8a513b['view']['on']('activateTab:history',()=>{this['_showConversationHistory']();}),this['listenTo'](_0x8a513b,'resizedTabs',(_0x289de3,_0x51bc8f)=>{this['_setIsMaximized'](_0x51bc8f);}),this['listenTo'](this['_aiChatHistoryUi'],'resizeTabs',()=>{_0x8a513b['resize']();});}catch(_0x41c08b){this['_handleHistoryErrorUI'](_0x41c08b,'init');}}async['_handleEditTitle'](_0x5add44,_0x99f4dc){await this['history']['updateItemTitle'](_0x5add44,_0x99f4dc);}async['_handleTogglePin'](_0xa13d46,_0x1db414){await this['history']['updateItemPinned'](_0xa13d46,_0x1db414);}async['_handleRemove'](_0x126dd7){await this['history']['removeItem'](_0x126dd7);}async['_handleSelectConversation'](_0x18f9b9){await this['_aiChatController']['loadConversation'](_0x18f9b9);}async['_showConversationHistory'](){this['_aiChatHistoryUi']['showError'](''),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x0),await this['history']['init'](),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x1);}['_updateHistoryItemsUI'](){const _0x1b486c=this['_aiChatController']['activeConversation']?.['id'],_0x324d2a=this['_getCategorizedItems']()['map'](_0x1af9a1=>({'title':_0x1af9a1['title'],'items':_0x1af9a1['items']['map'](_0x1c5662=>({'id':_0x1c5662['id'],'title':_0x1c5662['title']||i(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION'),'createdAt':new Date(_0x1c5662['createdAt'])['toLocaleDateString'](),'active':_0x1c5662['id']===_0x1b486c,'pinned':_0x1c5662['pinned']}))}));this['_aiChatHistoryUi']['updateItems'](_0x324d2a);}['_setItemLoading'](_0x177560,_0x49988d){this['_aiChatHistoryUi']['updateItemLoadingState'](_0x177560,_0x49988d,!0x0);}['_clearItemLoading'](_0x5a4666){this['_aiChatHistoryUi']['updateItemLoadingState'](_0x5a4666,null,!0x1);}['_handleHistoryErrorUI'](_0x53ee89,_0x4b80f4,_0x567db4){const _0x273658=this['_generateErrorMessage'](_0x4b80f4,_0x567db4);this['_aiChatHistoryUi']['showError'](_0x273658),_0x567db4&&this['_clearItemLoading'](_0x567db4),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x1);}['_generateErrorMessage'](_0x573d80,_0x34f9e1){const _0x188b21=_0x34f9e1?this['history']['getItem'](_0x34f9e1):null,_0x2a413a=_0x188b21?.['title']||i(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION');switch(_0x573d80){case'updateItemTitle':return i(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_UPDATE_TITLE',_0x2a413a);case'updateItemPinned':{const _0x42e3ff=i(this['context']['locale'],_0x188b21?.['pinned']?'AI_CHAT_HISTORY_UNPIN_ACTION':'AI_CHAT_HISTORY_PIN_ACTION');return i(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_UPDATE_PINNED',[_0x42e3ff,_0x2a413a]);}case'removeItem':return i(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_REMOVE_ITEM',_0x2a413a);case'init':case'loadItems':return i(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_LOAD_ITEMS');default:return i(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_GENERIC');}}['_getCategorizedItems'](){const _0x4dcc7d=new Date(),_0x335775=new Date(_0x4dcc7d['getFullYear'](),_0x4dcc7d['getMonth'](),_0x4dcc7d['getDate']()),_0x390649=new Date(_0x335775);_0x390649['setDate'](_0x390649['getDate']()-0x1);const _0x444ef3=new Date(_0x335775);_0x444ef3['setDate'](_0x444ef3['getDate']()-0xe);const _0x31d5c7=this['history']['getItems']({'pinned':!0x0}),_0x1ffd83=this['history']['getItems']({'from':_0x335775,'to':_0x335775}),_0x27ed17=this['history']['getItems']({'from':_0x390649,'to':_0x390649}),_0x167e14=this['history']['getItems']({'from':_0x444ef3,'to':_0x390649}),_0x42d758=this['history']['getItems']({'to':_0x444ef3}),_0x110d60=[];return _0x31d5c7['length']>0x0&&_0x110d60['push']({'title':i(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_PINNED'),'items':_0x31d5c7}),_0x1ffd83['length']>0x0&&_0x110d60['push']({'title':i(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_TODAY'),'items':_0x1ffd83}),_0x27ed17['length']>0x0&&_0x110d60['push']({'title':i(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_YESTERDAY'),'items':_0x27ed17}),_0x167e14['length']>0x0&&_0x110d60['push']({'title':i(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_LAST_14_DAYS'),'items':_0x167e14}),_0x42d758['length']>0x0&&_0x110d60['push']({'title':i(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_LATER'),'items':_0x42d758}),_0x110d60;}['_setIsMaximized'](_0x586e0f){this['_aiChatHistoryUi']['setIsMaximized'](_0x586e0f);}}class pt extends _0x53b1cd{static get['requires'](){return[jt,xt];}static get['pluginName'](){return'AIChatHistory';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class Da extends _0x53b1cd{static get['requires'](){return[mt,S,dt,pt];}static get['pluginName'](){return'AIChat';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x5d4181){super(_0x5d4181),this['context']['config']['define']('ai.chat.context',{'document':{'enabled':!0x0},'urls':{'enabled':!0x0},'files':{'enabled':!0x0},'sources':[]}),this['context']['config']['define']('ai.chat.models',{'defaultModelId':void 0x0,'modelSelectorAlwaysVisible':!0x0,'displayedModels':void 0x0});}async['addSelectionToChatContext'](){await this['context']['plugins']['get'](mt)['addSelectionToChatContext']();}async['startConversation'](){await this['context']['plugins']['get'](mt)['startConversation']();}async['sendMessage']({message:_0x54c04c,quickActionData:_0x302bee}){await this['context']['plugins']['get'](mt)['sendMessage']({'message':_0x54c04c,'quickActionData':_0x302bee});}['removeSelectionFromChatContext'](){this['context']['plugins']['get'](mt)['removeSelectionFromChatContext']();}['focusPromptInput'](){this['context']['plugins']['get'](mt)['focusPromptInput']();}}class co extends Qt{constructor(_0x22d92d){super(_0x22d92d);const _0x457d38=_0x22d92d['plugins']['get']('AITabs')['view'];this['bind']('value')['to'](_0x457d38,'isVisible'),this['isEnabled']=!0x0;}['execute'](){const _0x17949d=this['editor']['plugins']['get']('AITabs')['view'];_0x17949d['isVisible']=!_0x17949d['isVisible'];}}class qt extends _0x3a21ac{static get['requires'](){return[Ct];}static get['pluginName'](){return'AIToggleButtonUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x3bd37b=this['editor'];_0x3bd37b['commands']['add']('toggleAi',new co(_0x3bd37b)),_0x3bd37b['ui']['componentFactory']['add']('toggleAi',()=>{const _0x1fc47e=this['_createAIUIButton'](_0x5cf211);return _0x1fc47e['set']({'tooltip':!0x0,'class':'ck-ai-toggle-button'}),_0x1fc47e;}),_0x3bd37b['ui']['componentFactory']['add']('menuBar:toggleAi',()=>{const _0x4f1d2c=this['_createAIUIButton'](_0x13902c);return _0x4f1d2c['set']({'role':'menuitemcheckbox'}),_0x4f1d2c;});}['_createAIUIButton'](_0x58146f){const _0x378290=this['editor'],_0x31bb44=_0x378290['commands']['get']('toggleAi'),_0x1f59c2=new _0x58146f(_0x378290['locale']);return _0x1f59c2['set']({'label':i(_0x378290['locale'],'AI_TOGGLE_BUTTON_LABEL'),'icon':_0x236c83,'isToggleable':!0x0}),_0x1f59c2['bind']('isEnabled')['to'](_0x31bb44),_0x1f59c2['bind']('isOn')['to'](_0x31bb44,'value',_0x36fc72=>!!_0x36fc72),this['listenTo'](_0x1f59c2,'execute',()=>{_0x31bb44['execute']();}),_0x1f59c2;}}class Ma extends _0x3a21ac{static get['requires'](){return[qt,zt];}static get['pluginName'](){return'AIEditorIntegration';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}function ie(_0x3f353e){const {editor:_0x25d9fe,action:_0x2fcdb0,withText:_0x7d823d=!0x1,withIcon:_0x2f14ae=!0x0,isInDropdown:_0x11e11c=!0x0,shouldPreventFocus:_0x58bfbb=!0x1}=_0x3f353e;return()=>{const _0x242307=_0x25d9fe['locale'],_0x3e06e9=new _0x5cf211(_0x242307),_0xe3d710=_0x3e06e9['bindTemplate'];_0x11e11c&&_0x3e06e9['extendTemplate']({'on':{'mouseenter':_0xe3d710['to'](()=>{_0x58bfbb&&_0x58bfbb()||_0x3e06e9['focus']();})}});const _0x56113a=_0x2fcdb0['icon']??_0x2fcdb0['parent']?.['icon'];return _0x3e06e9['set']({'label':_0x2fcdb0['displayedPrompt'],'withText':_0x7d823d,'role':'menuitem','icon':_0x2f14ae?_0x56113a??_0x467386:void 0x0,'tooltip':!_0x7d823d,'class':'ck-ai-quick-actions-button','isEnabled':_0x2fcdb0['isEnabled']}),_0x3e06e9['on']('execute',()=>{_0x25d9fe['editing']['view']['focus'](),_0x25d9fe['commands']['execute']('aiQuickAction',_0x2fcdb0);}),_0x3e06e9;};}class vs extends _0xe41030{['arrowView'];constructor(_0x5cf7b7,_0x5e483b){super(_0x5cf7b7,_0x5e483b);const _0x48538d=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',_0x11acef=>String(_0x11acef)),'data-cke-tooltip-disabled':_0x48538d['to']('isOn')},'on':{'mouseenter':_0x48538d['to']('mouseenter')}});}['render'](){super['render'](),this['children']['add'](this['arrowView']);}['_createArrowView'](){const _0xeb839=new _0x1e0173();return _0xeb839['content']=_0x4a4728,_0xeb839['extendTemplate']({'attributes':{'class':'ck-dropdown-menu-list__nested-menu__button__arrow'}}),_0xeb839;}}class Ss extends _0x429409{['_allListItems'];['_allSearchableItems'];constructor(_0x1540fa,_0x4b40f9,_0x166207){super(_0x1540fa),this['_allListItems']=_0x4b40f9,this['_allSearchableItems']=_0x166207;}['filter'](_0x6765b6){if(!_0x6765b6)return this['items']['clear'](),this['items']['addMany'](this['_allListItems']),this['_clearHighlight'](),{'resultsCount':this['_allListItems']['length'],'totalItemsCount':this['_allListItems']['length']};const _0x29f24e=_0x6765b6['source']['toLowerCase']()['trim'](),_0x538510=this['_allSearchableItems']['filter'](_0x4359dd=>(_0x4359dd['groupLabel']?_0x4359dd['label']+'\x20('+_0x4359dd['groupLabel']+')':_0x4359dd['label'])['toLowerCase']()['includes'](_0x29f24e));return this['items']['clear'](),this['items']['addMany'](_0x538510['sort']((_0x20153a,_0x2f8f7b)=>{const _0x20fcc0=_0x20153a['groupLabel'],_0x4c0efa=_0x2f8f7b['groupLabel'];return _0x20fcc0||_0x4c0efa?_0x20fcc0?0x1:-0x1:0x0;})['map'](_0x3fc16a=>_0x3fc16a['item'])),this['_highlightQuery'](_0x29f24e,_0x538510),{'resultsCount':_0x538510['length'],'totalItemsCount':this['_allSearchableItems']['length']};}['_highlightQuery'](_0xc50bc9,_0x3fc0b0){if(!_0xc50bc9)return;const _0x578320=new RegExp(_0x390c1d(_0xc50bc9),'gi');_0x3fc0b0['forEach'](_0x15aaba=>{_0x15aaba['highlightViews']&&_0x15aaba['highlightViews']['forEach'](_0xe20223=>{'function'==typeof _0xe20223['highlightText']&&_0xe20223['highlightText'](_0x578320);});});}['_clearHighlight'](){this['_allSearchableItems']['forEach'](_0x4b35d5=>{_0x4b35d5['highlightViews']&&_0x4b35d5['highlightViews']['forEach'](_0x35019e=>{'function'==typeof _0x35019e['highlightText']&&_0x35019e['highlightText'](null);});});}}const ys='menu',Ts='menuitem';class ao extends _0x55515f{['_bodyCollection'];['optionsListView'];['_searchTextView']=null;['_allSearchableItems']=[];['children'];['focusTracker'];['keystrokes'];['_focusables'];['focusCycler'];['_openNestedPanels']=new Set();['_hasSearch'];constructor(_0x56cd14,_0x3bd320,_0x2e71f8,_0x390c24,_0x19760c=!0x1){const _0x358492=_0x56cd14['locale'];super(_0x358492),this['_bodyCollection']=_0x390c24,this['_hasSearch']=_0x19760c;const _0x13427d=this['_createListItems'](_0x56cd14,_0x3bd320,_0x2e71f8);this['optionsListView']=new Ss(_0x358492,_0x13427d,this['_allSearchableItems']),this['optionsListView']['role']=ys,this['optionsListView']['items']['addMany'](_0x13427d),this['focusTracker']=new _0x338162(),this['keystrokes']=new _0x1b5c14(),_0x19760c&&(this['_searchTextView']=this['_createSearchTextView']()),this['_focusables']=_0x13427d,this['focusCycler']=new _0x2f6676({'focusables':this['_focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes']}),_0x19760c&&this['_searchTextView']&&this['focusCycler']['chain'](this['_searchTextView']['focusCycler']);const _0x251c86=_0x19760c&&this['_searchTextView']?[this['_searchTextView']]:[this['optionsListView']];this['children']=new _0x4b2ba7(_0x251c86),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-ai-quick-actions','ck-rounded-corners'],'dir':_0x358492['uiLanguageDirection']},'children':this['children']});}['_createSearchTextView'](){return new _0x33b88d(this['locale'],{'filteredView':this['optionsListView'],'queryView':{'label':i(this['locale'],'AI_QUICK_ACTIONS_SEARCH')},'class':'ck-ai-quick-actions-search','infoView':{'text':{'notFound':{'primary':i(this['locale'],'AI_QUICK_ACTIONS_SEARCH_NOT_FOUND')}}}});}['_isSearchFocused'](){if(!this['_hasSearch']||!this['_searchTextView']||!this['_searchTextView']['queryView']['fieldView']['element'])return!0x1;const _0x5778e7=this['_searchTextView']['queryView']['fieldView']['element']['ownerDocument']?.['activeElement'];return this['_searchTextView']['queryView']['fieldView']['element']['contains'](_0x5778e7);}['_createListItems'](_0x49b73e,_0x1c91ec,_0xc63cef){const _0x5e70cb=new _0x4b2ba7();return _0x1c91ec['forEach'](_0x3cbbf6=>{if('actions'in _0x3cbbf6){const {listItem:_0x3b9810}=this['_createActionGroupButton'](_0x49b73e,_0x3cbbf6,_0xc63cef);_0x5e70cb['add'](_0x3b9810),_0x3cbbf6['actions']['forEach'](_0x10fa51=>{this['_createActionButton'](_0x49b73e,_0x10fa51,_0x3cbbf6['label'],_0x3cbbf6['icon']);const {listItem:_0x32012a,highlightViews:_0x17c022}=this['_createSearchResultActionButton'](_0x49b73e,_0x10fa51,_0x3cbbf6['label'],_0x3cbbf6['icon']);this['_allSearchableItems']['push']({'item':_0x32012a,'label':_0x10fa51['displayedPrompt'],'groupLabel':_0x3cbbf6['label'],'highlightViews':_0x17c022});});}else{const {listItem:_0x5c9706}=this['_createActionButton'](_0x49b73e,_0x3cbbf6);_0x5e70cb['add'](_0x5c9706);const _0x14c4ec=_0x5c9706['children']['first'];if(_0x14c4ec){const {listItem:_0x2fd453,highlightViews:_0x3d3346}=this['_createSearchResultActionButton'](_0x49b73e,_0x3cbbf6);this['_allSearchableItems']['push']({'item':_0x2fd453,'label':_0x14c4ec['label']||'','highlightViews':_0x3d3346});}}}),_0x5e70cb;}['_createActionButton'](_0x45b8f8,_0x545c8d,_0x32d605,_0x485bbe){const _0x447c1f=new _0x5f38b9(this['locale']);if(_0x32d605&&_0x485bbe){const _0x411977=new _0x5cf211(this['locale']),_0x2aef88=_0x411977['bindTemplate'],_0x426e1e=new _0x201c3b();_0x426e1e['text']=_0x545c8d['displayedPrompt'];const _0x14dfa0=new _0x201c3b();_0x14dfa0['text']=_0x32d605;const _0x2ebd22=new _0x1e0173();_0x2ebd22['content']=_0x485bbe,_0x2ebd22['extendTemplate']({'attributes':{'class':'ck-ai-quick-actions-button__group-icon'}});const _0x34fde7=new _0x55515f(this['locale']);_0x34fde7['setTemplate']({'tag':'span','attributes':{'class':'ck-ai-quick-actions-button_with-group__open-paren'},'children':[{'text':'\x20('}]});const _0x183211=new _0x55515f(this['locale']);return _0x183211['setTemplate']({'tag':'span','attributes':{'class':'ck-ai-quick-actions-button_with-group__close-paren'},'children':[{'text':')'}]}),_0x411977['set']({'label':_0x545c8d['displayedPrompt']+'\x20('+_0x32d605+')','withText':!0x0,'role':'menuitem','class':'ck-ai-quick-actions-button\x20ck-ai-quick-actions-button_with-group','tooltip':!0x1}),_0x411977['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':[_0x426e1e,_0x34fde7,_0x2ebd22,_0x14dfa0,_0x183211],'on':{'mouseenter':_0x2aef88['to'](()=>{this['_isSearchFocused']()||_0x411977['focus']();}),'click':_0x2aef88['to'](()=>{_0x411977['fire']('execute');})}}),_0x411977['on']('execute',()=>{_0x45b8f8['editing']['view']['focus'](),_0x45b8f8['commands']['execute']('aiQuickAction',_0x545c8d);}),_0x447c1f['children']['add'](_0x411977),{'listItem':_0x447c1f,'highlightViews':[_0x426e1e,_0x14dfa0]};}{const _0x21026a=new _0x34f162(),_0x546c76=new _0x5cf211(this['locale'],_0x21026a),_0x20cfd7=_0x546c76['bindTemplate'],_0x4ad36a=_0x545c8d['icon']??_0x545c8d['parent']?.['icon'],_0x26aa29=void 0x0!==_0x545c8d['icon'];return _0x546c76['set']({'label':_0x545c8d['displayedPrompt'],'withText':!0x0,'role':'menuitem','icon':_0x26aa29?_0x4ad36a??_0x467386:void 0x0,'tooltip':!0x1,'class':'ck-ai-quick-actions-button'}),_0x546c76['extendTemplate']({'on':{'mouseenter':_0x20cfd7['to'](()=>{this['_isSearchFocused']()||_0x546c76['focus']();})}}),_0x546c76['on']('execute',()=>{_0x45b8f8['editing']['view']['focus'](),_0x45b8f8['commands']['execute']('aiQuickAction',_0x545c8d);}),_0x447c1f['children']['add'](_0x546c76),{'listItem':_0x447c1f,'highlightViews':[_0x21026a]};}}['_createSearchResultActionButton'](_0x21d3d8,_0x3e4a40,_0x4069f3,_0x1b06ef){return _0x4069f3&&_0x1b06ef?this['_createSearchResultGroupedActionButton'](_0x21d3d8,_0x3e4a40,_0x4069f3,_0x1b06ef):this['_createSearchResultIndividualActionButton'](_0x21d3d8,_0x3e4a40);}['_createSearchResultGroupedActionButton'](_0x11bbd0,_0x129353,_0x394a5f,_0x544546){const _0xf5eddb=new _0x5f38b9(this['locale']),_0xeaeef7=new _0x5cf211(this['locale']),_0x19f7f9=_0xeaeef7['bindTemplate'],{view:_0x583f66,highlightView:_0x5027fc}=this['_createSearchResultGroupRow'](_0x394a5f,_0x544546),{view:_0x1abf63,highlightView:_0x42ba5e}=this['_createSearchResultActionRow'](_0x129353['displayedPrompt']),_0x213fb3=this['_createSearchResultContentView'](_0x583f66,_0x1abf63);return _0xeaeef7['set']({'label':_0x129353['displayedPrompt'],'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}),_0xeaeef7['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':[_0x213fb3],'on':{'mouseenter':_0x19f7f9['to'](()=>{this['_isSearchFocused']()||_0xeaeef7['focus']();}),'click':_0x19f7f9['to'](()=>{this['_handleSearchResultButtonClick'](_0xeaeef7);})}}),this['_setupActionButtonExecution'](_0xeaeef7,_0x11bbd0,_0x129353),_0xf5eddb['children']['add'](_0xeaeef7),{'listItem':_0xf5eddb,'highlightViews':[_0x5027fc,_0x42ba5e]};}['_createSearchResultIndividualActionButton'](_0x553170,_0x541455){const _0x5138cc=new _0x5f38b9(this['locale']),_0x491264=new _0x34f162(),_0x4e268c=new _0x5cf211(this['locale'],_0x491264),_0xf40936=_0x4e268c['bindTemplate'];return _0x4e268c['set']({'label':_0x541455['displayedPrompt'],'withText':!0x0,'role':'menuitem','icon':void 0x0,'tooltip':!0x1,'class':'ck-ai-quick-actions-button\x20ck-ai-quick-actions-search-result-button'}),_0x4e268c['extendTemplate']({'on':{'mouseenter':_0xf40936['to'](()=>{this['_isSearchFocused']()||_0x4e268c['focus']();})}}),this['_setupActionButtonExecution'](_0x4e268c,_0x553170,_0x541455),_0x5138cc['children']['add'](_0x4e268c),{'listItem':_0x5138cc,'highlightViews':[_0x491264]};}['_createSearchResultGroupRow'](_0x25445a,_0x116d1b){const _0x2e7632=new _0x55515f(this['locale']),_0x25787a=new _0x1e0173();_0x25787a['content']=_0x116d1b,_0x25787a['extendTemplate']({'attributes':{'class':'ck-ai-quick-actions-button__group-icon'}});const _0x55adcd=new _0x201c3b();return _0x55adcd['text']=_0x25445a,_0x2e7632['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-quick-actions-search-result__group-row'},'children':[_0x25787a,_0x55adcd]}),{'view':_0x2e7632,'highlightView':_0x55adcd};}['_createSearchResultActionRow'](_0x516ebd){const _0xdd4fa5=new _0x55515f(this['locale']),_0x10e53e=new _0x201c3b();return _0x10e53e['text']=_0x516ebd,_0xdd4fa5['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-quick-actions-search-result__action-row'},'children':[_0x10e53e]}),{'view':_0xdd4fa5,'highlightView':_0x10e53e};}['_createSearchResultContentView'](_0x22d59d,_0x14de23){const _0x1b8d05=new _0x55515f(this['locale']);return _0x1b8d05['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-quick-actions-search-result__content'},'children':[_0x22d59d,_0x14de23]}),_0x1b8d05;}['_setupActionButtonExecution'](_0x2ed7d9,_0x17fd48,_0x1d7d8b){_0x2ed7d9['on']('execute',()=>{_0x17fd48['editing']['view']['focus'](),_0x17fd48['commands']['execute']('aiQuickAction',_0x1d7d8b);});}['_createActionGroupButton'](_0x91b41a,_0x514957,_0x52597f){const _0x269839=new _0x5f38b9(this['locale']),_0x1674d3=new _0x34f162(),_0x410029=new vs(this['locale'],_0x1674d3),_0x4282a6=_0x410029['bindTemplate'],_0x232527=this['_getPanelKeystroke'](_0x52597f),_0x5743b7=this['_createGroupActionsList'](_0x91b41a,_0x514957['actions'],_0x52597f);_0x410029['set']({'label':_0x514957['label'],'withText':!0x0,'role':Ts,'icon':_0x514957['icon']??_0x467386,'isEnabled':_0x514957['actions']['some'](_0x57f46a=>_0x57f46a['isEnabled'])}),_0x410029['extendTemplate']({'on':{'mouseenter':_0x4282a6['to'](()=>{this['_isSearchFocused']()||_0x410029['focus']();})}});const _0x18a00a=new _0x564e6d(this['locale']);return _0x18a00a['extendTemplate']({'attributes':{'class':['ck','ck-reset_all','ck-ai-quick-actions-group-panel','ck-dropdown-menu__nested-menu__panel']},'on':{'keydown':_0x4282a6['to'](_0x2e951f=>{this['_handlePanelKeydown'](_0x2e951f,_0x232527,_0x410029,_0x18a00a);})}}),_0x410029['bind']('isOn')['to'](_0x18a00a,'isVisible'),this['_bodyCollection']['add'](_0x18a00a),_0x18a00a['content']['add'](_0x5743b7),this['_setupGroupMenuBehavior'](_0x410029,_0x18a00a),_0x269839['children']['add'](_0x410029),{'listItem':_0x269839,'highlightView':_0x1674d3};}['_createGroupActionsList'](_0x12f0cf,_0x9bd38,_0x4dd845){const _0x10090a=new _0x429409(this['locale']);return _0x10090a['extendTemplate']({'attributes':{'class':['ck','ck-reset_all','ck-ai-quick-actions-group-list','ck-dropdown-menu-list']}}),_0x9bd38['forEach'](_0x3708ba=>{const _0x23336c=new _0x5f38b9(this['locale']),_0x2c6564=ie({'editor':_0x12f0cf,'action':_0x3708ba,'withText':!0x0,'withIcon':!0x1,'isInDropdown':!0x0,'shouldPreventFocus':()=>this['_isSearchFocused']()})();_0x23336c['children']['add'](_0x2c6564),_0x4dd845['focusTracker']['add'](_0x2c6564),_0x10090a['items']['add'](_0x23336c);}),_0x10090a;}['_setupGroupMenuBehavior'](_0x4c1447,_0x492564){const _0x15a265=_0x4c1447['bindTemplate'],_0x2d6a16=this['_getButtonKeystroke'](_0x4c1447);_0x4c1447['extendTemplate']({'attributes':{'class':['ck-ai-quick-actions-group-button']},'on':{'mouseenter':_0x15a265['to'](()=>{this['_showNestedPanel'](_0x492564,_0x4c1447);}),'mouseleave':_0x15a265['to'](_0x4d548f=>{const _0x5847bc=_0x4d548f['relatedTarget'];this['_isMovingToNestedMenu'](_0x5847bc,_0x492564)||this['_hideNestedPanel'](_0x492564);}),'keydown':_0x15a265['to'](_0x37a7f5=>{_0x37a7f5['key']==_0x2d6a16&&(this['_showNestedPanel'](_0x492564,_0x4c1447),_0x492564['content']['get'](0x0)['focus']());})}}),_0x492564['on']('render',()=>{_0x492564['element']?.['addEventListener']('mouseleave',_0x3d1820=>{const _0x360d8a=_0x3d1820['relatedTarget'];_0x4c1447['element']?.['contains'](_0x360d8a)||this['_isMovingToNestedMenu'](_0x360d8a,_0x492564)||this['_hideNestedPanel'](_0x492564);});});}['_showNestedPanel'](_0x3ac647,_0x5c15c4){this['_openNestedPanels']['forEach'](_0x46ae6d=>{_0x46ae6d!==_0x3ac647&&_0x46ae6d['isVisible']&&_0x46ae6d['hide']();}),_0x3ac647['show'](),_0x3ac647['pin']({'positions':[_0x577a68['eastSouth']],'target':_0x5c15c4['element'],'fitInViewport':!0x0}),this['_openNestedPanels']['add'](_0x3ac647);}['_hideNestedPanel'](_0x209c33){_0x209c33['hide'](),this['_openNestedPanels']['delete'](_0x209c33);}['_hideAllNestedPanels'](){this['_openNestedPanels']['forEach'](_0x32eb8e=>_0x32eb8e['hide']()),this['_openNestedPanels']['clear']();}['_isMovingToNestedMenu'](_0x1ce1ab,_0x3546ef){if(!_0x1ce1ab)return!0x1;if(_0x3546ef['element']?.['contains'](_0x1ce1ab))return!0x0;const _0x15a6fb=_0x1ce1ab;return _0x15a6fb['closest']&&(null!==_0x15a6fb['closest']('.ck-ai-quick-actions-group-panel')||null!==_0x15a6fb['closest']('.ck-ai-quick-actions-group-list')||null!==_0x15a6fb['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'](_0x2542f7){return'rtl'===_0x2542f7['locale']['uiLanguageDirection']?'ArrowRight':'ArrowLeft';}['_getButtonKeystroke'](_0x5ca145){return'rtl'===_0x5ca145['locale']['uiLanguageDirection']?'ArrowLeft':'ArrowRight';}['_handlePanelKeydown'](_0x4b2950,_0x3af072,_0x3d6417,_0x157fb7){_0x4b2950['key']==_0x3af072&&(_0x3d6417['focus'](),this['_hideNestedPanel'](_0x157fb7));}['_handleSearchResultButtonClick'](_0x368b4a){_0x368b4a['fire']('execute');}}function ee(_0x521b5e){const {editor:_0x3c7861,content:_0x2a35b7,buttonDefinition:_0x57076d,bodyCollection:_0x1c5d4a,hasSearch:_0x461410=!0x1}=_0x521b5e;return()=>{const _0x492425=_0x3c7861['locale'],_0x1fafb3=_0x4c9a3b(_0x492425);_0x1fafb3['buttonView']['set']({'icon':_0x57076d['icon']??_0x467386,'label':_0x57076d['label'],'tooltip':!0x0}),_0x1fafb3['set']({'class':'ck-ai-quick-actions-dropdown'});const _0x57a063=new ao(_0x3c7861,_0x2a35b7,_0x1fafb3,_0x1c5d4a,_0x461410);if(_0x1fafb3['panelView']['children']['add'](_0x57a063),_0x461410){const _0x14e378='ai-quick-actions-dropdown-selection';_0x1fafb3['on']('change:isOpen',(_0x193c0e,_0x3adc9f,_0x58198b)=>{if(_0x58198b){if(_0x3c7861['plugins']['has']('AIEditing')){const _0x4952b3=_0x3c7861['plugins']['get'](S),_0x2131f0=_0x3c7861['model']['document']['selection'],_0x2d32ee=Array['from'](_0x2131f0['getRanges']());_0x2d32ee['length']>0x0&&_0x4952b3['showFakeVisualSelection'](_0x2d32ee,_0x14e378,!0x1,!0x0);}}else _0x3c7861['plugins']['has']('AIEditing')&&_0x3c7861['plugins']['get'](S)['hideFakeVisualSelection'](_0x14e378),_0x57a063['resetSearch']();});}return _0x1fafb3;};}const oe='<task>For\x20given\x20selected\x20part\x20of\x20HTML\x20document\x20you\x20must\x20explain\x20the\x20meaning\x20of\x20it\x27s\x20content\x20clearly\x20and\x20in\x20plain\x20language.</task><rules>1.\x20Identify\x20what\x20type\x20of\x20text\x20it\x20is:-\x20If\x20it\x20looks\x20like\x20a\x20definition\x20explain\x20the\x20concept\x20in\x20simple\x20terms.-\x20If\x20it\x20looks\x20like\x20a\x20description\x20clarify\x20what\x20it\x20is\x20describing\x20and\x20why\x20it\x20matters.-\x20If\x20it\x20contains\x20technical\x20terms\x20or\x20jargon\x20break\x20them\x20down\x20into\x20everyday\x20language.-\x20If\x20it\x20looks\x20instructional\x20restate\x20as\x20clear\x20steps\x20someone\x20can\x20follow.-\x20If\x20it\x20provides\x20examples\x20explain\x20what\x20the\x20example\x20shows\x20and\x20why\x20it\x27s\x20relevant.-\x20If\x20it\x20presents\x20an\x20argument\x20or\x20claim\x20restate\x20the\x20claim\x20neutrally\x20and\x20explain\x20its\x20purpose.-\x20If\x20it\x20is\x20narrative/story-like\x20explain\x20what\x20event\x20or\x20situation\x20is\x20being\x20described.-\x20If\x20it\x20is\x20data-driven\x20(stats,\x20figures,\x20facts)\x20explain\x20what\x20the\x20data\x20indicates.-\x20If\x20it\x20is\x20a\x20quotation\x20explain\x20the\x20meaning\x20of\x20the\x20quote\x20in\x20context.-\x20If\x20it\x20compares/contrasts\x20things\x20explain\x20the\x20key\x20differences\x20or\x20similarities\x20simply.-\x20If\x20it\x20does\x20not\x20fit\x20any\x20of\x20the\x20categories\x20above\x20give\x20a\x20clear,\x20plain-language\x20explanation\x20of\x20its\x20meaning,\x20focusing\x20on\x20usefulness.2.\x20Provide\x20context\x20if\x20the\x20meaning\x20could\x20be\x20unclear\x20without\x20it.\x20(e.g.,\x20explain\x20where\x20such\x20a\x20term\x20might\x20be\x20used,\x20or\x20why\x20it\x20is\x20important).3.\x20Keep\x20the\x20explanation\x20short\x20but\x20complete\x20(2–5\x20sentences).Avoid\x20overly\x20technical\x20detail\x20unless\x20it\x20is\x20necessary\x20for\x20understanding.4.\x20Do\x20not\x20simply\x20repeat\x20the\x20original\x20text\x20—\x20restate\x20and\x20expand\x20it\x20in\x20plain\x20words.5.\x20If\x20possible,\x20add\x20a\x20short\x20example\x20or\x20analogy\x20to\x20make\x20it\x20easier\x20to\x20understand.6.\x20Use\x20the\x20context\x20of\x20the\x20whole\x20document,\x20but\x20focus\x20on\x20the\x20selected\x20part\x20when\x20creating\x20your\x20explanation.7.\x20Your\x20explanation\x20should\x20be\x20written\x20in\x20%0\x20language.</rules><constraints>1.\x20You\x20MUST\x20NOT\x20perform\x20any\x20edits\x20or\x20modifications\x20on\x20provided\x20document.2.\x20You\x20MUST\x20NOT\x20include\x20document\x20modifications\x20in\x20your\x20response.3.\x20Your\x20message\x20should\x20only\x20include\x20explanation.\x20Do\x20not\x20add\x20any\x20additional\x20text,\x20flattery,\x20questions\x20or\x20followup\x20suggestions.</constraints>',ae='<task>For\x20the\x20given\x20selected\x20part\x20of\x20an\x20HTML\x20document\x20you\x20must\x20summarize\x20its\x20content\x20in\x20a\x20few\x20sentences,\x20keeping\x20only\x20the\x20essential\x20meaning.</task><rules>1.\x20Your\x20summary\x20should\x20be\x20short\x20and\x20clear:-\x20Aim\x20for\x202–4\x20sentences\x20unless\x20the\x20text\x20is\x20extremely\x20short.-\x20Focus\x20on\x20capturing\x20the\x20main\x20idea(s)\x20without\x20unnecessary\x20detail.2.\x20Identify\x20what\x20type\x20of\x20text\x20it\x20is\x20and\x20adapt\x20the\x20summary\x20style:-\x20If\x20it\x20is\x20descriptive\x20condense\x20the\x20description\x20into\x20its\x20core\x20idea.-\x20If\x20it\x20is\x20argumentative\x20or\x20opinion-based\x20summarize\x20the\x20main\x20claim\x20and\x20reasoning\x20neutrally.-\x20If\x20it\x20is\x20narrative/story-like\x20capture\x20the\x20main\x20event\x20or\x20outcome\x20without\x20side\x20details.-\x20If\x20it\x20is\x20data-driven\x20(stats,\x20figures,\x20facts)\x20summarize\x20what\x20the\x20data\x20shows\x20in\x20plain\x20language.-\x20If\x20it\x20is\x20instructional\x20restate\x20the\x20overall\x20purpose\x20of\x20the\x20steps\x20without\x20listing\x20every\x20step.-\x20If\x20it\x20does\x20not\x20fit\x20any\x20of\x20the\x20categories\x20above\x20provide\x20a\x20general\x20concise\x20summary.3.\x20Provide\x20context\x20if\x20necessary\x20for\x20clarity:-\x20Mention\x20the\x20subject\x20or\x20topic\x20explicitly\x20so\x20the\x20summary\x20can\x20stand\x20alone.4.\x20Do\x20not\x20simply\x20copy\x20sentences\x20from\x20the\x20original\x20text\x20—\x20rephrase\x20in\x20plain\x20language.5.\x20Avoid\x20adding\x20new\x20information\x20or\x20interpretation\x20not\x20present\x20in\x20the\x20text.6.\x20Summarize\x20in\x20a\x20way\x20that\x20would\x20make\x20sense\x20to\x20someone\x20who\x20has\x20not\x20read\x20the\x20original\x20text.7.\x20Use\x20the\x20context\x20of\x20the\x20whole\x20document,\x20but\x20focus\x20on\x20the\x20selected\x20part\x20when\x20creating\x20your\x20summary.8.\x20Your\x20summary\x20should\x20be\x20written\x20in\x20%0\x20language.</rules><constraints>1.\x20You\x20MUST\x20NOT\x20perform\x20any\x20edits\x20or\x20modifications\x20on\x20the\x20provided\x20document.2.\x20You\x20MUST\x20NOT\x20include\x20document\x20modifications\x20in\x20your\x20response.3.\x20Your\x20message\x20should\x20only\x20include\x20the\x20summary.\x20Do\x20not\x20add\x20any\x20additional\x20text,\x20flattery,\x20questions\x20or\x20followup\x20suggestions.</constraints>',se='<task>For\x20the\x20given\x20selected\x20part\x20of\x20an\x20HTML\x20document\x20you\x20must\x20extract\x20and\x20present\x20the\x20key\x20points\x20from\x20its\x20content.</task><rules>1.\x20Present\x20the\x20output\x20as\x20a\x20clear,\x20structured\x20list\x20(bullets\x20or\x20numbered).-\x20Each\x20point\x20should\x20be\x20concise\x20(one\x20sentence\x20or\x20less).-\x20Do\x20not\x20merge\x20distinct\x20ideas\x20into\x20one\x20bullet.2.\x20Identify\x20what\x20type\x20of\x20text\x20it\x20is\x20and\x20adapt\x20the\x20extraction\x20style:-\x20If\x20it\x20is\x20descriptive\x20capture\x20the\x20main\x20attributes\x20or\x20features.-\x20If\x20it\x20is\x20argumentative\x20extract\x20the\x20main\x20claim\x20and\x20supporting\x20reasons\x20separately.-\x20If\x20it\x20is\x20narrative/story-like\x20extract\x20the\x20main\x20events\x20in\x20chronological\x20order.-\x20If\x20it\x20is\x20data-driven\x20(stats,\x20figures,\x20facts)\x20highlight\x20the\x20most\x20important\x20facts\x20or\x20numbers.-\x20If\x20it\x20is\x20instructional\x20list\x20the\x20steps\x20or\x20main\x20actions\x20in\x20simplified\x20form.-\x20If\x20it\x20provides\x20comparisons\x20extract\x20the\x20contrasted\x20items\x20and\x20their\x20differences/similarities.-\x20If\x20it\x20does\x20not\x20fit\x20any\x20category\x20above\x20extract\x20the\x20main\x20ideas\x20in\x20plain,\x20short\x20statements.3.\x20Keep\x20the\x20list\x20between\x203–7\x20items\x20where\x20possible.-\x20If\x20the\x20text\x20is\x20very\x20short,\x20fewer\x20items\x20are\x20fine.-\x20If\x20it\x20is\x20very\x20long,\x20focus\x20on\x20the\x20most\x20important\x20ideas\x20only.4.\x20Do\x20not\x20copy\x20long\x20text\x20fragments\x20—\x20restate\x20in\x20simple\x20words.5.\x20Do\x20not\x20add\x20interpretation,\x20evaluation,\x20or\x20commentary\x20beyond\x20the\x20text.6.\x20Ensure\x20the\x20list\x20can\x20stand\x20alone\x20without\x20requiring\x20the\x20reader\x20to\x20see\x20the\x20original\x20document.7.\x20Use\x20the\x20context\x20of\x20the\x20whole\x20document,\x20but\x20focus\x20on\x20the\x20selected\x20part\x20when\x20creating\x20your\x20key\x20points.8.\x20Your\x20key\x20points\x20should\x20be\x20written\x20in\x20%0\x20language.</rules><constraints>1.\x20You\x20MUST\x20NOT\x20perform\x20any\x20edits\x20or\x20modifications\x20on\x20the\x20provided\x20document.2.\x20You\x20MUST\x20NOT\x20include\x20document\x20modifications\x20in\x20your\x20response.3.\x20Your\x20message\x20should\x20only\x20include\x20the\x20extracted\x20key\x20points.\x20Do\x20not\x20add\x20any\x20additional\x20text,\x20flattery,\x20questions\x20or\x20followup\x20suggestions.</constraints>';var Gt=function(_0x5dee9c){return _0x5dee9c['CHAT']='CHAT',_0x5dee9c['ACTION']='ACTION',_0x5dee9c['REVIEW']='REVIEW',_0x5dee9c;}({}),Ua=function(_0x15e103){return _0x15e103['CHAT']='AIChat',_0x15e103['ACTION']='AIActions',_0x15e103['REVIEW']='AIReviewMode',_0x15e103;}({});class ii extends _0x3a21ac{static get['requires'](){return[_0x4e6183];}static get['pluginName'](){return'AIQuickActionsUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}async['init'](){const _0x69fb86=await this['_getDefaultAndCustomActions']();this['_prepareQuickActionsDefinition'](_0x69fb86),this['_initializeQuickActionsComponentsAndCommands']();}static['getDefaultQuickActions'](_0xb64c5d){return function(_0x1f4839){const _0x47fd40=new Intl['DisplayNames'](['en'],{'type':'language'})['of'](_0x1f4839['uiLanguage']),_0x50c7e0=_0x47fd40||'English',_0x4a8343=[{'id':'ask-ai','displayedPrompt':i(_0x1f4839,'AI_QUICK_ACTIONS_ASK_AI'),'type':'CHAT','icon':Bt},{'id':'chat-commands','label':i(_0x1f4839,'AI_QUICK_ACTIONS_CHAT_COMMANDS'),'icon':Bt,'actions':[{'id':'explain','displayedPrompt':i(_0x1f4839,'AI_QUICK_ACTIONS_EXPLAIN'),'prompt':oe['replace']('%0',_0x50c7e0),'type':'CHAT'},{'id':'summarize','displayedPrompt':i(_0x1f4839,'AI_QUICK_ACTIONS_SUMMARIZE'),'prompt':ae['replace']('%0',_0x50c7e0),'type':'CHAT'},{'id':'highlight-key-points','displayedPrompt':i(_0x1f4839,'AI_QUICK_ACTIONS_HIGHLIGHT_KEY_POINTS'),'prompt':se['replace']('%0',_0x50c7e0),'type':'CHAT'}]},{'id':'improve-writing','displayedPrompt':i(_0x1f4839,'AI_QUICK_ACTIONS_IMPROVE_WRITING'),'type':'ACTION','icon':Xt},{'id':'continue','displayedPrompt':i(_0x1f4839,'AI_QUICK_ACTIONS_CONTINUE_WRITING'),'type':'ACTION','icon':Jt},{'id':'fix-grammar','displayedPrompt':i(_0x1f4839,'AI_QUICK_ACTIONS_FIX_GRAMMAR_SPELLING'),'type':'ACTION','icon':Vt},{'id':'adjust-length','label':i(_0x1f4839,'AI_QUICK_ACTIONS_ADJUST_LENGTH'),'icon':Kt,'actions':[{'id':'make-shorter','displayedPrompt':i(_0x1f4839,'AI_QUICK_ACTIONS_MAKE_SHORTER'),'type':'ACTION'},{'id':'make-longer','displayedPrompt':i(_0x1f4839,'AI_QUICK_ACTIONS_MAKE_LONGER'),'type':'ACTION'}]},{'id':'change-tone','label':i(_0x1f4839,'AI_QUICK_ACTIONS_CHANGE_TONE'),'icon':Wt,'actions':[{'id':'make-tone-casual','displayedPrompt':i(_0x1f4839,'AI_QUICK_ACTIONS_MORE_CASUAL'),'type':'ACTION'},{'id':'make-tone-direct','displayedPrompt':i(_0x1f4839,'AI_QUICK_ACTIONS_MORE_DIRECT'),'type':'ACTION'},{'id':'make-tone-friendly','displayedPrompt':i(_0x1f4839,'AI_QUICK_ACTIONS_MORE_FRIENDLY'),'type':'ACTION'},{'id':'make-tone-confident','displayedPrompt':i(_0x1f4839,'AI_QUICK_ACTIONS_MORE_CONFIDENT'),'type':'ACTION'},{'id':'make-tone-professional','displayedPrompt':i(_0x1f4839,'AI_QUICK_ACTIONS_MORE_PROFESSIONAL'),'type':'ACTION'}]},{'id':'translate','label':i(_0x1f4839,'AI_QUICK_ACTIONS_TRANSLATE'),'icon':te,'actions':[{'id':'translate-to-english','displayedPrompt':i(_0x1f4839,'AI_QUICK_ACTIONS_TRANSLATE_ENGLISH'),'type':'ACTION','actionName':'translate','args':{'language':'english'}},{'id':'translate-to-chinese','displayedPrompt':i(_0x1f4839,'AI_QUICK_ACTIONS_TRANSLATE_CHINESE'),'type':'ACTION','actionName':'translate','args':{'language':'chinese'}},{'id':'translate-to-spanish','displayedPrompt':i(_0x1f4839,'AI_QUICK_ACTIONS_TRANSLATE_SPANISH'),'type':'ACTION','actionName':'translate','args':{'language':'spanish'}},{'id':'translate-to-german','displayedPrompt':i(_0x1f4839,'AI_QUICK_ACTIONS_TRANSLATE_GERMAN'),'type':'ACTION','actionName':'translate','args':{'language':'german'}},{'id':'translate-to-french','displayedPrompt':i(_0x1f4839,'AI_QUICK_ACTIONS_TRANSLATE_FRENCH'),'type':'ACTION','actionName':'translate','args':{'language':'french'}},{'id':'translate-to-japanese','displayedPrompt':i(_0x1f4839,'AI_QUICK_ACTIONS_TRANSLATE_JAPANESE'),'type':'ACTION','actionName':'translate','args':{'language':'japanese'}},{'id':'translate-to-portuguese','displayedPrompt':i(_0x1f4839,'AI_QUICK_ACTIONS_TRANSLATE_PORTUGUESE'),'type':'ACTION','actionName':'translate','args':{'language':'portuguese'}},{'id':'translate-to-korean','displayedPrompt':i(_0x1f4839,'AI_QUICK_ACTIONS_TRANSLATE_KOREAN'),'type':'ACTION','actionName':'translate','args':{'language':'korean'}},{'id':'translate-to-italian','displayedPrompt':i(_0x1f4839,'AI_QUICK_ACTIONS_TRANSLATE_ITALIAN'),'type':'ACTION','actionName':'translate','args':{'language':'italian'}},{'id':'translate-to-russian','displayedPrompt':i(_0x1f4839,'AI_QUICK_ACTIONS_TRANSLATE_RUSSIAN'),'type':'ACTION','actionName':'translate','args':{'language':'russian'}}]},{'id':'other','label':i(_0x1f4839,'AI_QUICK_ACTIONS_OTHER'),'icon':Zt,'actions':[]}];return _0x4a8343;}(_0xb64c5d);}async['_getDefaultAndCustomActions'](){const _0x3a688e=ii['getDefaultQuickActions'](this['editor']['locale']),_0x175301=this['editor']['config']['get']('ai.quickActions.extraCommands')||[];let _0x333ad8=[];try{_0x333ad8=await new At({'connector':this['editor']['plugins']['get']('AIConnector'),'availableModels':this['editor']['config']['get']('ai.chat.models.displayedModels'),'locale':this['editor']['locale']})['getAvailableModels']();}catch(_0x1a3b67){const _0x17fa67=new _0x25e143('ai-quick-actions-models-unable-to-retrieve',this,{'error':_0x1a3b67});ft(_0x17fa67['message']);}finally{const _0x452745=_0x175301['map'](_0x4026a8=>({..._0x4026a8,'icon':void 0x0}));_0x3a688e['find'](_0x4d6058=>'other'===_0x4d6058['id'])['actions']['push'](..._0x452745),_0x3a688e['forEach'](_0x2567d8=>{if('actions'in _0x2567d8)_0x2567d8['actions']['forEach'](_0x8a582e=>{if(_0x8a582e['isEnabled']=!!_0x333ad8['find'](_0x22738e=>_0x22738e['id']===_0x8a582e['model'])||void 0x0===_0x8a582e['model'],!_0x8a582e['isEnabled']){const _0x19a420=new _0x25e143('ai-quick-actions-unavailable-model',this,{'actionId':_0x8a582e['id'],'modelId':_0x8a582e['model']});ft(_0x19a420['message']);}});else{if(_0x2567d8['isEnabled']=!!_0x333ad8['find'](_0x40a4ab=>_0x40a4ab['id']===_0x2567d8['model'])||void 0x0===_0x2567d8['model'],!_0x2567d8['isEnabled']){const _0x2a31e5=new _0x25e143('ai-quick-actions-unavailable-model',this,{'actionId':_0x2567d8['id'],'modelId':_0x2567d8['model']});ft(_0x2a31e5['message']);}}});}return _0x3a688e;}['_initializeQuickActionsComponentsAndCommands'](){const _0x2d4498=new _0x1008b4(this['editor']['locale']);_0x2d4498['attachToDom'](),this['_initializeQuickActionsDropdown'](_0x2d4498),this['_initializeQuickActionsMenuBar'](),this['_initializeQuickActionsComponents'](_0x2d4498);}['_initializeQuickActionsDropdown'](_0x365f27){const _0x19f478=this['editor']['config']['get']('ai.quickActions.isSearchEnabled')??!0x0;this['editor']['ui']['componentFactory']['add']('aiQuickActions',ee({'editor':this['editor'],'content':this['_quickActionsDefinition'],'buttonDefinition':{'icon':_0x467386,'label':i(this['editor']['locale'],'AI_QUICK_ACTIONS_HEADING')},'bodyCollection':_0x365f27,'hasSearch':_0x19f478}));}['_prepareQuickActionsDefinition'](_0x337fc4){this['_quickActionsDefinition']=_0x337fc4['map'](_0x54038a=>{if('actions'in _0x54038a){const _0x1d7047=_0x54038a;return{..._0x1d7047,'actions':_0x1d7047['actions']['map'](_0x559500=>{const {actions:_0x4cd169,..._0xd5106a}=_0x1d7047;return{..._0x559500,'parent':_0xd5106a};})['filter'](_0x56b89d=>this['_shouldIncludeAction'](_0x56b89d))};}return _0x54038a;})['filter'](_0x1f3504=>'actions'in _0x1f3504?_0x1f3504['actions']['length']>0x0:this['_shouldIncludeAction'](_0x1f3504));}['_shouldIncludeAction'](_0x4348ae){const _0x50c32c=this['editor']['config']['get']('ai.quickActions.removeCommands')||[];return this['editor']['plugins']['has'](Ua[_0x4348ae['type']])&&!_0x50c32c['includes'](_0x4348ae['id'])&&!('CHAT'===_0x4348ae['type']&&!0x1===this['editor']['config']['get']('ai.chat.context.document.enabled'));}['_initializeQuickActionsComponents'](_0x54f871){this['_quickActionsDefinition']['forEach'](_0x5dc48b=>{if('actions'in _0x5dc48b){const _0x26376d=ee({'editor':this['editor'],'content':_0x5dc48b['actions'],'buttonDefinition':_0x5dc48b,'bodyCollection':_0x54f871});this['editor']['ui']['componentFactory']['add'](_0x5dc48b['id'],_0x26376d),_0x5dc48b['actions']['forEach'](_0x1f77d2=>{const _0x74e61=ie({'editor':this['editor'],'action':_0x1f77d2});this['editor']['ui']['componentFactory']['add'](_0x1f77d2['id'],_0x74e61);});}else{const _0x505d4d=ie({'editor':this['editor'],'action':_0x5dc48b,'withText':!0x1,'withIcon':!0x0,'isInDropdown':!0x1});this['editor']['ui']['componentFactory']['add'](_0x5dc48b['id'],_0x505d4d);}});}['_initializeQuickActionsMenuBar'](){this['editor']['ui']['componentFactory']['add']('menuBar:aiQuickActions',_0x508702=>{const _0x4f4828=new _0x3de95d(_0x508702),_0x310277=i(_0x508702,'AI_QUICK_ACTIONS_HEADING');_0x4f4828['buttonView']['set']({'label':_0x310277,'icon':_0x467386});const _0x249448=new _0x470e26(_0x508702);_0x249448['set']({'ariaLabel':_0x310277,'role':'menu'}),this['_quickActionsDefinition']['forEach'](_0x1495cf=>{if('actions'in _0x1495cf){const _0x3859ba=_0x1495cf,_0x1f02ee=new _0x184fc0(_0x508702,_0x4f4828),_0xd39d86=new _0x3de95d(_0x508702),_0x3cfbff=new _0x470e26(_0x508702);_0xd39d86['buttonView']['set']({'label':_0x3859ba['label'],'icon':_0x3859ba['icon']}),_0x3859ba['actions']['forEach'](_0x4c2264=>{const _0x3bbbdb=new _0x184fc0(_0x508702,_0xd39d86),_0x59c215=new _0x13902c(_0x508702);_0x59c215['set']({'label':_0x4c2264['displayedPrompt'],'icon':_0x4c2264['icon'],'role':'menuitem','isEnabled':_0x4c2264['isEnabled']}),_0x59c215['on']('execute',()=>{this['_executeQuickAction'](_0x4c2264);}),_0x59c215['delegate']('execute')['to'](_0xd39d86),_0x3bbbdb['children']['add'](_0x59c215),_0x3cfbff['items']['add'](_0x3bbbdb);}),_0xd39d86['panelView']['children']['add'](_0x3cfbff),_0x1f02ee['children']['add'](_0xd39d86),_0x249448['items']['add'](_0x1f02ee);}else{const _0x834e78=_0x1495cf,_0x1c868f=new _0x184fc0(_0x508702,_0x4f4828),_0x1d7f73=new _0x13902c(_0x508702);_0x1d7f73['set']({'label':_0x834e78['displayedPrompt'],'icon':_0x834e78['icon'],'role':'menuitem','isEnabled':_0x834e78['isEnabled']}),_0x1d7f73['on']('execute',()=>{this['_executeQuickAction'](_0x834e78);}),_0x1d7f73['delegate']('execute')['to'](_0x4f4828),_0x1c868f['children']['add'](_0x1d7f73),_0x249448['items']['add'](_0x1c868f);}});const _0x512334=Object['values'](Ua)['some'](_0x14dafb=>this['editor']['plugins']['has'](_0x14dafb));return _0x4f4828['set']({'isEnabled':_0x512334}),_0x4f4828['panelView']['children']['add'](_0x249448),_0x4f4828;});}['_executeQuickAction'](_0x81ecb){const _0x462fdd=this['editor'];_0x462fdd['editing']['view']['focus'](),_0x462fdd['commands']['execute']('aiQuickAction',_0x81ecb);const _0x329b51=_0x462fdd['ui']['view']['menuBarView'];_0x329b51&&_0x329b51['close']&&_0x329b51['close']();}}class ci extends Qt{['execute'](_0x1e19d9){switch(this['_expandSelectionIfCollapsed'](),_0x1e19d9['type']){case Gt['CHAT']:if(!this['editor']['plugins']['has']('AIChat')){const _0x1a111f=i(this['editor']['locale'],'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND','AIChat');throw new _0x25e143('ai-quick-actions-plugin-not-found',this['editor'],{'errorMessage':_0x1a111f});}this['_handleAIChatAction'](_0x1e19d9);break;case Gt['ACTION']:if(!this['editor']['plugins']['has']('AIActions')){const _0x43e51a=i(this['editor']['locale'],'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND','AIActions');throw new _0x25e143('ai-quick-actions-plugin-not-found',this['editor'],{'errorMessage':_0x43e51a});}this['_handleAIActionsAction'](_0x1e19d9);break;case Gt['REVIEW']:if(!this['editor']['plugins']['has']('AIReviewMode')){const _0x37251d=i(this['editor']['locale'],'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND','AIReviewMode');throw new _0x25e143('ai-quick-actions-plugin-not-found',this['editor'],{'errorMessage':_0x37251d});}this['_handleAIReviewAction'](_0x1e19d9);}}async['_handleAIChatAction'](_0x5847af){const _0x4c52ad=this['editor']['plugins']['get']('AIChat'),_0x37edb1=this['editor']['plugins']['get']('AIChatController'),_0x169da8=this['editor']['plugins']['get']('AITabs')['view'];if(_0x169da8['isVisible']||(_0x169da8['isVisible']=!0x0),'chat'!==_0x169da8['activeTab']&&_0x169da8['activateTab']('chat'),'ask-ai'===_0x5847af['id'])_0x37edb1['removeSelectionFromChatContext'](),await _0x4c52ad['addSelectionToChatContext'](),_0x4c52ad['focusPromptInput']();else await _0x4c52ad['startConversation'](),_0x37edb1['removeSelectionFromChatContext'](),await _0x4c52ad['addSelectionToChatContext'](),_0x4c52ad['focusPromptInput'](),await _0x4c52ad['sendMessage']({'message':_0x5847af['prompt']||_0x5847af['displayedPrompt'],'quickActionData':{'id':_0x5847af['id'],'displayedPrompt':_0x5847af['displayedPrompt']}});}['_expandSelectionIfCollapsed'](){const _0x10162b=this['editor'],_0xc9e5f8=_0x10162b['model']['document']['selection'];if(!_0xc9e5f8['isCollapsed'])return;const _0x1ce808=_0x1ee4fd(_0xc9e5f8['getSelectedBlocks']())||_0x10162b['model']['schema']['getLimitElement'](_0xc9e5f8);_0x10162b['model']['change'](_0x1ced7c=>{_0x1ced7c['setSelection'](_0x1ce808,'in');});}['_handleAIActionsActionLabel'](_0x2908f1){return _0x2908f1['parent']?.['label']&&'other'!==_0x2908f1['parent']?.['id']?_0x2908f1['parent']['label']+':\x20'+_0x2908f1['displayedPrompt']:_0x2908f1['displayedPrompt'];}async['_handleAIActionsAction'](_0x583d40){const _0x161915=this['editor']['plugins']['get']('AIActions'),_0x24e121=_0x583d40['prompt']?{'userMessage':_0x583d40['prompt'],'model':_0x583d40['model']}:{'actionName':_0x583d40['actionName']||_0x583d40['id'],'args':_0x583d40['args']},_0xed2acd=this['_handleAIActionsActionLabel'](_0x583d40);await _0x161915['executeAction'](_0x24e121,_0xed2acd,_0x583d40['icon']);}async['_handleAIReviewAction'](_0x261643){console['log']('handleAIReviewAction',_0x261643);}}class ti extends _0x3a21ac{static get['pluginName'](){return'AIQuickActionsEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x4a78cf=this['editor'],_0xe0efed=new ci(this['editor']);if(_0x4a78cf['commands']['add']('aiQuickAction',_0xe0efed),_0x4a78cf['plugins']['has']('AIChat')){const _0xa4c942=this['editor']['plugins']['get']('AIChat');_0x4a78cf['model']['document']['selection']['on']('change:range',(_0x3c9d32,_0x44b629)=>{_0x44b629['directChange']&&_0xa4c942['removeSelectionFromChatContext']();});}}}class Ae extends Ge{['updateChangeGroups'](){if(this['parsedMergedContent']=this['parsedContent']['cloneNode'](!0x0),0x0==this['parsedMergedContent']['childNodes']['length'])return void(this['changeGroups']=[]);const _0x1e038b=this['documentContextContent']['children']['map'](_0x3084af=>({'node':_0x3084af,'id':vt(_0x3084af,'data-id')})),_0x3d1b70=this['parsedMergedContent']['children']['map'](_0xdaf9b9=>({'node':_0xdaf9b9,'id':vt(_0xdaf9b9,'data-id')||_0x23a3b0()})),_0x621d0=_0x266b5b(_0x1e038b,_0x3d1b70,{'comparator':(_0x47cb1e,_0x9371a5)=>_0x47cb1e['id']==_0x9371a5['id'],'oneChangePerToken':!0x0});if(!this['isDone']){for(;_0x621d0['length']&&_0x621d0[_0x621d0['length']-0x1]['removed'];)_0x621d0['pop']();}const _0x327e79=_0x621d0['map'](_0x55e778=>{const _0x26d270=_0x55e778['added']?'new':_0x55e778['removed']?'removed':'modified';return{'node':_0x55e778['value'][0x0]['node'],'type':_0x26d270,'id':_0x55e778['value'][0x0]['id']};});this['changeGroups']=[{'changes':_0x327e79,'state':'pending','index':0x0}];}['_getDifferentChangeGroups'](_0x3588ac,_0x3afa13){return _0x3afa13;}}class X extends xe{['content'];['version'];['actionName'];['args'];['userMessage'];['model'];['hasError']=!0x1;constructor(_0x4bd16f){super(_0x4bd16f),this['content']=_0x4bd16f['content'],this['version']=_0x4bd16f['version'],this['actionName']=_0x4bd16f['actionName'],this['args']=_0x4bd16f['args'],this['userMessage']=_0x4bd16f['userMessage'],this['model']=_0x4bd16f['model'];}async['sendRequest'](){return this['actionName']?this['connector']['executeAction']({'content':this['content'],'actionName':this['actionName'],'args':this['args']}):this['connector']['executeCustomAction']({'content':this['content'],'message':this['userMessage'],'model':this['model'],'outputFormat':'html'});}['getDocumentContext'](){return{'type':je['TEXT'],'content':this['content'],'version':this['version'],'label':'Current\x20document','uiId':'current-document'};}['createReply'](_0x567a81){const _0x19c0f8=new Ae({'editor':this['editor'],'documentContextContent':this['content'],..._0x567a81});return this['replies']['push'](_0x19c0f8),_0x19c0f8['delegate'](...Ce)['to'](this),this['fire']('replyCreated',_0x19c0f8),_0x19c0f8;}}class ri extends _0x3a21ac{static get['requires'](){return[R,_0x14e96e,S,st,ot];}static get['pluginName'](){return'AIActions';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['_aiConnector'];['_interactions']=[];['_currentInteractionIndex']=0x0;['_interactionParams'];['_balloonShowDiff']=!0x1;['_customViews']=new _0x4b2ba7();['_navigationPreviousButton'];['_navigationCounter'];['_isNavigationCounterInView']=!0x1;['_navigationNextButton'];['_isNavigationPreviousButtonInView']=!0x1;['_isNavigationNextButtonInView']=!0x1;['_promiseQueue'];['_bodyCollection'];get['_interaction'](){return this['_interactions'][this['_interactions']['length']-0x1];}constructor(_0x5e72fd){super(_0x5e72fd),this['_bodyCollection']=new _0x1008b4(this['editor']['locale']),this['_bodyCollection']['attachToDom'](),this['_aiConnector']=this['editor']['plugins']['get']('AIConnector'),this['set']('isBusy',!0x1),this['_promiseQueue']=new et(),this['_setupCustomViews']();}['stopInteraction'](){this['_stopInteraction']();}async['executeAction'](_0x33672b,_0x4319a0,_0x4e1fec){if(this['editor']['plugins']['has']('TableSelection')){if(this['editor']['plugins']['get']('TableSelection')['getSelectedTableCells']()){const {modelFragment:_0x3f345f,anchorData:_0xe40db5}=this['_getExecuteDataInTable']();return this['_executeAction'](_0x33672b,_0x3f345f,_0xe40db5,_0x4319a0,_0x4e1fec);}}const {modelFragment:_0x9e561f,anchorData:_0x5db34c}=this['_getExecuteDataRegular']();return this['_executeAction'](_0x33672b,_0x9e561f,_0x5db34c,_0x4319a0,_0x4e1fec);}['destroy'](){this['_bodyCollection']['detachFromDom'](),super['destroy']();}['_getExecuteDataRegular'](){const _0x57fb5e=this['editor']['model']['document']['selection'];if(_0x57fb5e['isCollapsed']){const _0xc24c2a=_0x1ee4fd(_0x57fb5e['getSelectedBlocks']())||this['editor']['model']['schema']['getLimitElement'](_0x57fb5e);this['editor']['model']['change'](_0x39a45f=>{_0x39a45f['setSelection'](_0xc24c2a,'in');});}const _0x8c8713=_0x57fb5e['getFirstRange'](),_0x597db9=this['_wrapWithCommonAncestors'](this['editor']['model']['getSelectedContent'](_0x57fb5e),_0x8c8713['start'],_0x8c8713['end']),_0x57fd13=_0x57fb5e['getFirstRange']()['start'],_0x178381=new Map();let _0x199395=_0x597db9;for(let _0x2c0052=0x0;_0x2c0052<_0x57fd13['path']['length'];_0x2c0052++)_0x178381['set'](_0x199395,_0x57fd13['path'][_0x2c0052]),_0x199395=_0x199395['getChild'](0x0);return{'modelFragment':_0x597db9,'anchorData':_0x178381};}['_getExecuteDataInTable'](){const _0x3140ea=this['editor']['model']['document']['selection'],_0x7ac9fb=this['editor']['plugins']['get']('TableSelection')['getSelectionAsFragment'](),_0x468bf0=_0x3140ea['getFirstRange']()['start']['parent']['parent'],_0x38b180=this['_wrapWithCommonAncestors'](_0x7ac9fb,this['editor']['model']['createPositionBefore'](_0x468bf0),this['editor']['model']['createPositionAfter'](_0x468bf0)),_0x11e290=_0x3140ea['getFirstRange']()['start'],_0x45130c=new Map();let _0x2cb6d6=_0x38b180;for(let _0x11f4b8=0x0;_0x11f4b8<_0x11e290['path']['length'];_0x11f4b8++)if(_0x45130c['set'](_0x2cb6d6,_0x11e290['path'][_0x11f4b8]),_0x11f4b8<_0x11e290['path']['length']-0x1)_0x2cb6d6=_0x2cb6d6['getChild'](0x0);else{let _0x311df2=_0x2cb6d6['nextSibling'];for(;_0x311df2;)_0x45130c['set'](_0x311df2,_0x11e290['path'][_0x11f4b8]),_0x311df2=_0x311df2['nextSibling'];}return{'modelFragment':_0x38b180,'anchorData':_0x45130c};}['_executeAction'](_0x5aa6b8,_0x43ba32,_0x43c98b,_0x3b20de,_0x363958){const _0x14cba9=this['editor']['plugins']['get'](S),_0x558e2b=this['editor']['plugins']['get'](st),_0x5136cd=this['editor']['model']['document']['selection'],_0x32a2b4=_0x14cba9['modelToViewWithIds'](_0x43ba32),_0x2387a4=this['editor']['data']['processor']['toData'](_0x32a2b4),_0x41d1d3=this['editor']['model']['document']['version'],_0x29935e=[..._0x5136cd['getRanges']()];let _0x41600c=this['editor']['config']['get']('ai.availableReplyActions')||[...H];this['editor']['plugins']['has']('TrackChanges')||(_0x41600c=_0x41600c['filter'](_0x1089a9=>'insertSuggestion'!=_0x1089a9));const _0x545704=new F(this['editor']['locale'],{'showDiff':!0x1,'areActionsDisabled':!0x1,'hideHeader':!0x0,'showLoader':!0x0,'miniToolbarConfig':{'showChanges':'icon','customView':this['_customViews']},'showUnchangedParts':!0x0,'availableActions':_0x41600c},this['_bodyCollection']);return _0x558e2b['open']({'index':0x3e8*Math['random']()%0x3e8,'title':_0x3b20de,'icon':_0x363958||_0x467386,'mainView':_0x545704,'showRotator':!0x1,'showApplyButton':!0x0,'showSuggestButton':this['editor']['plugins']['has']('TrackChanges'),'ranges':_0x29935e}),this['_setLoadingState'](_0x545704,_0x558e2b),this['listenTo'](_0x558e2b,'applySuggestion',()=>{this['_applyChanges'](_0x43ba32,_0x43c98b,!0x1);}),this['listenTo'](_0x558e2b,'insertSuggestion',()=>{this['_applyChanges'](_0x43ba32,_0x43c98b,!0x0);}),this['listenTo'](_0x558e2b,'selectionRemoved',()=>{this['_stopInteraction'](),this['_disableCustomViews']();}),this['listenTo'](_0x558e2b,'dialogClosed',()=>{if(this['_interaction']&&this['_interaction']['replies']['length']>0x0){const _0x2f9930=this['_interaction']['replies'][this['_interaction']['replies']['length']-0x1],_0x530eaa=_0x2f9930['changeGroups'][0x0];_0x530eaa&&'pending'===_0x530eaa['state']&&_0x2f9930['setChangeGroupState'](0x0,'rejected');}this['_stopInteraction'](),this['_clearInteractionHistory'](),this['stopListening'](_0x558e2b);}),this['_createInteraction'](_0x2387a4,_0x41d1d3,_0x545704,_0x558e2b,_0x5aa6b8);}['_wrapWithCommonAncestors'](_0x210611,_0xe3b65c,_0x40af39){const _0x4e3667=this['editor']['model']['createRange'](_0xe3b65c,_0x40af39)['getCommonAncestor'](),_0x557149=_0x4e3667['is']('documentFragment')?[]:_0x4e3667['getAncestors']({'includeSelf':!0x0})['slice'](0x1);if(_0x557149['length']){const _0x5760eb=_0x557149['map'](_0x2774be=>_0x2774be['_clone'](!0x1));for(let _0x284d7c=0x1;_0x284d7c<_0x5760eb['length'];_0x284d7c++)_0x5760eb[_0x284d7c-0x1]['_appendChild'](_0x5760eb[_0x284d7c]);return _0x5760eb[_0x5760eb['length']-0x1]['_appendChild'](_0x210611),new ht(_0x5760eb[0x0]);}return _0x210611;}async['_createInteraction'](_0x5f4edb,_0x210eab,_0x5ec559,_0x572c9d,_0x1eeb69){const _0x4c3be7=this['editor'];this['_interactionParams']={'action':_0x1eeb69,'content':_0x5f4edb,'version':_0x210eab,'mainView':_0x5ec559,'aiBalloon':_0x572c9d};const _0x365765=new X({'connector':this['_aiConnector'],'editor':_0x4c3be7,'content':_0x5f4edb,'version':_0x210eab,..._0x1eeb69});this['_interactions']['push'](_0x365765),_0x5ec559['hideError']();const _0x5448f5=(_0x6357df,_0x1e5eea,_0x1543ef=!0x1,_0x197f79='streaming')=>this['_promiseQueue']['enqueue'](async _0x4676af=>{try{const _0x319505=nt({'editor':_0x4c3be7,'changeGroups':_0x6357df['changeGroups'],'documentContextContent':_0x6357df['documentContextContent'],'showDiff':_0x1543ef,'trimUnchanged':!0x1});await _0x1e5eea['updateContent']({'parts':_0x319505,'renderingStrategy':_0x197f79,'abortSignal':_0x4676af});}catch(_0x5057f7){if(this['_isAbortError'](_0x5057f7))return;throw _0x5057f7;}});this['_interaction']['on']('replyCreated',(_0x3f73e1,_0x28e93f)=>{_0x5ec559['hideLoader'](),_0x572c9d['startAutoScroll'](),_0x5448f5(_0x28e93f,_0x5ec559)['catch'](_0x332b19=>{this['_isAbortError'](_0x332b19)||(console['error']('Error\x20updating\x20content\x20in\x20replyCreated:',_0x332b19),this['_setErrorState'](_0x365765,_0x5ec559));});}),this['_interaction']['on']('replyContentUpdated',(_0x41186d,_0xe5ad2b)=>{_0x5448f5(_0xe5ad2b,_0x5ec559)['catch'](_0x3dea46=>{this['_isAbortError'](_0x3dea46)||(console['error']('Error\x20updating\x20content\x20in\x20replyContentUpdated:',_0x3dea46),this['_setErrorState'](_0x365765,_0x5ec559));});}),this['_interaction']['on']('interactionFinished',async()=>{try{await this['_clearLoadingState'](_0x5ec559,_0x572c9d),this['_updateNavigationUI'](),await this['_promiseQueue']['queueEmptyPromise'];}catch(_0x599f6f){this['_isAbortError'](_0x599f6f)||(console['error']('Error\x20clearing\x20loading\x20state\x20in\x20interactionFinished:',_0x599f6f),this['_setErrorState'](_0x365765,_0x5ec559));}finally{_0x572c9d['stopAutoScroll']();}}),this['listenTo'](_0x5ec559,'toggleSuggestionDisplayMode',async(_0x1349ce,{showDiff:_0x594d29})=>{try{this['_balloonShowDiff']=_0x594d29;const _0x519c90=this['_interaction']['replies'][this['_interaction']['replies']['length']-0x1];_0x519c90&&await _0x5448f5(_0x519c90,_0x5ec559,_0x594d29,'static');}catch(_0x1a9772){this['_isAbortError'](_0x1a9772)||(console['error']('Error\x20updating\x20content\x20in\x20toggleSuggestionDisplayMode:',_0x1a9772),this['_setErrorState'](_0x365765,_0x5ec559));}}),this['_interaction']['on']('replyChangeGroupStateUpdated',(_0x519fed,{reply:_0x595a61})=>{const _0x29a82d={'positiveCount':_0x595a61['changeGroups']['filter'](_0x4d0fcb=>'accepted'===_0x4d0fcb['state'])['length'],'totalCount':_0x595a61['changeGroups']['length']},_0x2a1595=this['_interaction']['actionCallId'],_0x5599bf=this['_interaction']['actionName'];_0x5599bf?this['_aiConnector']['upsertAIActionRating'](_0x5599bf,_0x2a1595,_0x29a82d):this['_aiConnector']['upsertCustomAIActionRating'](_0x2a1595,_0x29a82d);}),this['_setLoadingState'](_0x5ec559,_0x572c9d);try{const _0x1e9629=await this['_interaction']['start']();return this['_updateNavigationUI'](),_0x1e9629;}catch(_0x54fdb3){if(this['_isAbortError'](_0x54fdb3))return;_0x5ec559['hideLoader'](),this['_setErrorState'](_0x365765,_0x5ec559);}}['_applyChanges'](_0x5659b0,_0x3fb280,_0x480eef){const _0x3bdb62=this['editor'];if(_0x480eef&&!_0x3bdb62['plugins']['has']('TrackChanges'))throw new _0x25e143('ai-no-track-changes',null);const _0x1ef487=this['editor']['plugins']['get'](ot),_0x3ca797=this['_interaction'],_0x2980ef=this['_interaction']['replies'][this['_interaction']['replies']['length']-0x1],_0x4c7b5d=_0x2980ef['changeGroups'];_0x2980ef['setChangeGroupState'](0x0,'accepted');let _0x5ee3c9=at({'editor':_0x3bdb62,'reply':_0x2980ef,'interaction':_0x3ca797,'groups':_0x4c7b5d,'transform':!0x1,'documentCompare':_0x1ef487,'documentCompareOptions':{'anchor':_0x3bdb62['model']['createPositionAt'](_0x5659b0,0x0),'markDeletions':_0x480eef}});_0x5ee3c9=this['_filterOperationsOutsideRange'](_0x5ee3c9,_0x3fb280);for(const _0x54b596 of _0x5ee3c9)this['_anchorOperation'](_0x3fb280,_0x54b596,_0x3bdb62['model']['document']['getRoot']());const _0x126bba=_0x3ca797['getDocumentContext']()['version'],_0x893828=_0x3bdb62['model']['document']['history']['getOperations'](_0x126bba),_0x423448={'document':_0x3bdb62['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1},_0xa7d6ff=gt(_0x5ee3c9,_0x893828,_0x423448)['operationsA'];_0x3bdb62['model']['change'](_0x53035e=>{if(_0x53035e['setSelection'](_0x3bdb62['model']['document']['selection']['focus']),_0x480eef)_0x3bdb62['plugins']['get']('TrackChangesEditing')['_applyOperationsAsSuggestions'](_0xa7d6ff);else{for(const _0x42bfa3 of _0xa7d6ff)_0x42bfa3['baseVersion']=_0x3bdb62['model']['document']['version'],rt(_0x3bdb62,_0x42bfa3),_0x53035e['batch']['addOperation'](_0x42bfa3),_0x3bdb62['model']['applyOperation'](_0x42bfa3);}}),this['editor']['plugins']['get']('AIBalloon')['close']();}['_filterOperationsOutsideRange'](_0x2882a1,_0x152ddf){return _0x2882a1['filter'](_0x1d84bb=>{if('rename'==_0x1d84bb['type']){const _0x54aef7=_0x1d84bb['position']['nodeAfter'];return!_0x152ddf['has'](_0x54aef7);}if(_0x1d84bb['type']['indexOf']('Attribute')>-0x1){const _0x58a612=_0x1d84bb['range']['start']['nodeAfter'];return!_0x152ddf['has'](_0x58a612);}return!0x0;});}['_anchorOperation'](_0x9797f2,_0x17cb88,_0x413a21){const _0x28db5b=_0x17cb88['clone']();for(const _0xd0a083 in _0x17cb88){const _0x1a8ad8=_0x17cb88[_0xd0a083];_0x1a8ad8 instanceof ct?_0x17cb88[_0xd0a083]=new ct(_0x4c122c(_0x1a8ad8['start']),_0x4c122c(_0x1a8ad8['end'])):_0x1a8ad8 instanceof lt&&(_0x17cb88[_0xd0a083]=_0x4c122c(_0x1a8ad8));}if(['insert','move','remove','reinsert','split','merge']['includes'](_0x28db5b['type'])){if(_0x28db5b['isDocumentOperation']=!0x1,_0x28db5b['baseVersion']=null,'remove'==_0x28db5b['type']){const _0x262f74=_0x28db5b['sourcePosition'],_0x59362d=_0x28db5b['howMany'];new ut(_0x262f74,_0x59362d)['_execute']();}else _0x28db5b['_execute']();}function _0x4c122c(_0xd9d725){if('$graveyard'==_0xd9d725['root']['rootName'])return _0xd9d725;const _0x26a947=[];let _0x53ea21=_0xd9d725['root'];for(let _0x2477b7=0x0;_0x2477b7<_0xd9d725['path']['length'];_0x2477b7++){const _0xc96cd8=_0x9797f2['get'](_0x53ea21)||0x0;_0x26a947[_0x2477b7]=_0xd9d725['path'][_0x2477b7]+_0xc96cd8,_0x53ea21=_0x53ea21['getChildAtOffset'](_0xd9d725['path'][_0x2477b7]);}return new lt(_0x413a21,_0x26a947,_0xd9d725['stickiness']);}}['_refreshInteraction'](){if(!this['_interactionParams'])return;this['_interactions']['length']>0x0&&this['_stopInteraction'](),this['_currentInteractionIndex']=0x0,this['_balloonShowDiff']=!0x1;const {action:_0xd3a2fa,content:_0x43b3b0,version:_0x5200fa,mainView:_0xc558b8,aiBalloon:_0x2884ae}=this['_interactionParams'];_0xc558b8['areChangesVisible']=!0x1,_0xc558b8['hideError'](),this['_clearErrorState'](_0xc558b8,_0x2884ae);const _0x2546b0=_0xc558b8;_0x2546b0['miniToolbarView']&&_0x2546b0['miniToolbarView']['showChangesButton']&&_0x2546b0['miniToolbarView']['showChangesButton']['set']({'isOn':!0x1,'icon':it}),this['_clearSuggestionContent'](_0xc558b8),_0xc558b8['showLoader'](),this['_updateNavigationUI'](),this['stopListening'](_0xc558b8),this['_createInteraction'](_0x43b3b0,_0x5200fa,_0xc558b8,_0x2884ae,_0xd3a2fa)['catch'](_0x3e56cb=>{this['_isAbortError'](_0x3e56cb)||console['error']('Error\x20refreshing\x20interaction:',_0x3e56cb);});}['_clearSuggestionContent'](_0x208973){const _0x54d71f=_0x208973['bodyView']['_children'];for(;_0x54d71f['length']>0x0;)_0x54d71f['remove'](_0x54d71f['first']);_0x208973['bodyView']['hasPendingParts']=!0x1;}['_isAbortError'](_0x4a05da){return!!_0x4a05da['message']&&_0x4a05da['message']['startsWith']('ai-request-aborted');}['_clearInteractionHistory'](){this['_interactions']=[],this['_interactionParams']=void 0x0,this['_currentInteractionIndex']=0x0,this['_updateNavigationUI']();}['_stopInteraction'](){this['_interaction']&&this['_interaction']['stop'](),this['_promiseQueue']['abort'](),this['isBusy']=!0x1,this['_interactionParams']&&this['_interactionParams']['aiBalloon']['stopAutoScroll']();}['_setupCustomViews'](){const _0x3ac048=new _0x5cf211(this['editor']['locale']),_0x25eff3=new _0x5cf211(this['editor']['locale']),_0x42ad89=new _0x55515f(this['editor']['locale']),_0x49f155=new _0x5cf211(this['editor']['locale']);_0x3ac048['set']({'icon':_0x4adff1,'label':i(this['editor']['locale'],'AI_ACTIONS_TRY_AGAIN'),'tooltip':!0x0,'class':'ck-ai-custom-action-button'}),_0x25eff3['set']({'icon':tt,'tooltip':i(this['editor']['locale'],'AI_ACTIONS_PREVIOUS_INTERACTION'),'class':'ck-ai-navigation-button\x20ck-ai-previous-button'}),_0x42ad89['setTemplate']({'tag':'span','attributes':{'class':['ck-ai-interaction-counter']},'children':['1/1']}),_0x49f155['set']({'icon':_0x28046c,'tooltip':i(this['editor']['locale'],'AI_ACTIONS_NEXT_INTERACTION'),'class':'ck-ai-navigation-button\x20ck-ai-next-button'}),_0x3ac048['bind']('isEnabled')['to'](this,'isBusy',_0x4a3398=>!_0x4a3398),_0x3ac048['on']('execute',()=>{this['_refreshInteraction']();}),_0x25eff3['bind']('isEnabled')['to'](this,'isBusy',_0x25636b=>!_0x25636b),_0x25eff3['on']('execute',()=>{this['_navigateToPrevious']();}),_0x49f155['bind']('isEnabled')['to'](this,'isBusy',_0x380db7=>!_0x380db7),_0x49f155['on']('execute',()=>{this['_navigateToNext']();}),this['_navigationPreviousButton']=_0x25eff3,this['_navigationCounter']=_0x42ad89,this['_navigationNextButton']=_0x49f155,this['_customViews']['add'](_0x3ac048);}['_navigateToPrevious'](){const _0x5d79aa=this['_interactions']['length'];this['_currentInteractionIndex']<_0x5d79aa-0x1&&this['_displayInteractionAtIndex'](this['_currentInteractionIndex']+0x1);}['_navigateToNext'](){this['_currentInteractionIndex']>0x0&&this['_displayInteractionAtIndex'](this['_currentInteractionIndex']-0x1);}async['_displayInteractionAtIndex'](_0x45dd6e){if(!this['_interactionParams'])return;this['_currentInteractionIndex']=_0x45dd6e;const {mainView:_0x411a9f}=this['_interactionParams'],_0x43044e=this['_interactions'][this['_interactions']['length']-0x1-this['_currentInteractionIndex']];if(!_0x43044e)return;if(_0x43044e['hasError'])return this['_setErrorState'](_0x43044e,_0x411a9f),void this['_updateNavigationUI']();if(!_0x43044e['replies']['length'])return;_0x411a9f['hideError'](),this['_interactionParams']&&this['_clearErrorState'](_0x411a9f,this['_interactionParams']['aiBalloon']);const _0x4abbd0=_0x43044e['replies'][_0x43044e['replies']['length']-0x1];if(_0x4abbd0){const _0x56d597=this['editor'];this['_clearSuggestionContent'](_0x411a9f);try{const _0x15927f=nt({'editor':_0x56d597,'changeGroups':_0x4abbd0['changeGroups'],'documentContextContent':_0x4abbd0['documentContextContent'],'showDiff':this['_balloonShowDiff'],'trimUnchanged':!0x1});this['_clearSuggestionContent'](_0x411a9f),await new Promise(_0x31c023=>setTimeout(_0x31c023,0x32)),await _0x411a9f['updateContent']({'parts':_0x15927f,'renderingStrategy':'static','abortSignal':new AbortController()['signal']});}catch(_0x27eda6){this['_isAbortError'](_0x27eda6)||console['error']('Error\x20updating\x20content\x20during\x20navigation:',_0x27eda6);}}this['_updateNavigationUI']();}['_updateNavigationUI'](){if(!this['_navigationPreviousButton']||!this['_navigationCounter']||!this['_navigationNextButton'])return;const _0x561304=this['_interactions']['length'],_0x42ac8b=_0x561304>0x1,_0x78bc95=this['_interactionParams']?.['mainView'];if(_0x42ac8b){this['_isNavigationPreviousButtonInView']||this['_isNavigationCounterInView']||this['_isNavigationNextButtonInView']||(this['_customViews']['add'](this['_navigationPreviousButton']),_0x78bc95?.['addNavigationItem'](this['_navigationPreviousButton']),this['_isNavigationPreviousButtonInView']=!0x0,this['_customViews']['add'](this['_navigationCounter']),_0x78bc95?.['addNavigationItem'](this['_navigationCounter']),this['_isNavigationCounterInView']=!0x0,this['_customViews']['add'](this['_navigationNextButton']),_0x78bc95?.['addNavigationItem'](this['_navigationNextButton']),this['_isNavigationNextButtonInView']=!0x0);const _0x3e05b1=_0x561304-this['_currentInteractionIndex'];this['_navigationCounter']['element']&&(this['_navigationCounter']['element']['textContent']=_0x3e05b1+'/'+_0x561304),this['_navigationPreviousButton']['isEnabled']=this['_currentInteractionIndex']<_0x561304-0x1,this['_navigationNextButton']['isEnabled']=this['_currentInteractionIndex']>0x0;}else(this['_isNavigationPreviousButtonInView']||this['_isNavigationCounterInView']||this['_isNavigationNextButtonInView'])&&(this['_customViews']['remove'](this['_navigationPreviousButton']),_0x78bc95?.['removeNavigationItem'](this['_navigationPreviousButton']),this['_isNavigationPreviousButtonInView']=!0x1,this['_customViews']['remove'](this['_navigationCounter']),_0x78bc95?.['removeNavigationItem'](this['_navigationCounter']),this['_isNavigationCounterInView']=!0x1,this['_customViews']['remove'](this['_navigationNextButton']),_0x78bc95?.['removeNavigationItem'](this['_navigationNextButton']),this['_isNavigationNextButtonInView']=!0x1);}['_setLoadingState'](_0x41f17b,_0x140561){_0x41f17b['setLoading'](),_0x140561['balloonView']['setLoading'](),this['isBusy']=!0x0;}async['_setErrorState'](_0x1800ed,_0x2a9894){const _0x1a01fe=i(this['editor']['locale'],'AI_ACTIONS_GENERIC_ERROR');_0x2a9894['showError'](_0x1a01fe),_0x1800ed['hasError']=!0x0,await this['_promiseQueue']['queueEmptyPromise'],_0x2a9894['setErrorState'](),this['_interactionParams']?.['aiBalloon']['balloonView']['toolbar']&&(this['_interactionParams']['aiBalloon']['balloonView']['toolbar']['isLoading']=!0x0);}['_clearErrorState'](_0x30cb58,_0x3f7ef4){_0x30cb58['clearErrorState'](),_0x3f7ef4['balloonView']['toolbar']&&(_0x3f7ef4['balloonView']['toolbar']['isLoading']=!0x1);}async['_clearLoadingState'](_0x36b783,_0x3599eb){await this['_promiseQueue']['queueEmptyPromise'],this['isBusy']=!0x1,_0x36b783['clearLoading'](),_0x3599eb['balloonView']['clearLoading']();}['_disableCustomViews'](){this['_customViews']['forEach'](_0x52a1a7=>{'isEnabled'in _0x52a1a7&&(_0x52a1a7['isEnabled']=!0x1);});}}class Va extends _0x3a21ac{static get['requires'](){return[ii,ti,ri];}static get['pluginName'](){return'AIQuickActions';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0xecca49){super(_0xecca49),_0xecca49['config']['define']('ai.quickActions',{'extraCommands':[],'removeCommands':[],'isSearchEnabled':!0x0});}}class js{['id'];['title'];['description'];['isParameterized'];['useArgs'];['options'];constructor({id:_0x32e3c4,title:_0x4c13d4,description:_0x7cf8fc,isParameterized:_0x176731,useArgs:_0x265e1c,options:_0x20c0f1}){this['id']=_0x32e3c4,this['title']=_0x4c13d4,this['description']=_0x7cf8fc,this['isParameterized']=_0x176731,this['useArgs']=_0x265e1c,this['options']=_0x20c0f1;}}class Bs extends js{['_models']=[];get['models'](){return this['_models'];}set['models'](_0x9f0c17){this['_models']=_0x9f0c17;}}class si extends ts(){['_checks'];constructor(_0x454da9){super(),this['_checks']=this['_mapCheckDefinitions'](_0x454da9);}get['checks'](){return this['_checks'];}['getCheckById'](_0x5c332c){return this['checks']['find'](_0x1a60e2=>_0x1a60e2['id']===_0x5c332c);}['removeCheckById'](_0x1fe6fb){this['_checks']=this['_checks']['filter'](_0x19950c=>_0x19950c['id']!==_0x1fe6fb);}['_mapCheckDefinitions'](_0x53c10e){return _0x53c10e['map'](_0x5362cf=>'custom'===_0x5362cf['id']?new Bs(_0x5362cf):new js(_0x5362cf));}}class Rs extends _0x32571c(){['id'];['contentNew'];['contentInitial'];['documentVersion'];constructor({id:_0x2bf815,contentNew:_0x4a714e,contentInitial:_0x48e417,documentVersion:_0xe0dba}){super(),this['id']=_0x2bf815,this['contentNew']=_0x4a714e,this['contentInitial']=_0x48e417,this['documentVersion']=_0xe0dba;}}class Ds extends ts(){['id'];['parent'];['_data'];['_editorOperations']=[];constructor(_0x3ad679,_0x48653d,_0x399210){super(),this['id']=_0x3ad679,this['parent']=_0x399210,this['_data']=_0x48653d,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 zs extends ts(){['id']=_0x23a3b0();['callId'];['_results']=new Map();['_changes']=[];['_sourceCheck'];['_documentData'];['_aiConnector'];['_reviewParams'];['_reviewArgs'];['_activeRequest']=null;['_currentError'];constructor(_0xc2834,_0x127a6a,_0x5e602a,_0x5332e1,_0x4c18fc){super(),this['_sourceCheck']=_0x127a6a,this['_documentData']=_0xc2834,this['_aiConnector']=_0x5e602a,this['_reviewParams']=_0x5332e1,this['_reviewArgs']=_0x4c18fc,this['on']('change:status',(_0x1f50f4,_0x11591f,_0x3a336a)=>{this['fire']('reviewCheckRunUpdated',{'status':_0x3a336a,'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'](_0x93fee5=>'pending'===_0x93fee5['status']);}get['currentError'](){return this['_currentError'];}['updateDocumentData'](_0x3c2ded){this['_documentData']=_0x3c2ded;}async['start'](){this['status']='loading',this['_currentError']=void 0x0;try{this['_activeRequest']=this['_createApiRequest']();const _0x11f2c5=await this['_activeRequest']['getStream']();this['status']='data';for await(const _0x5084d3 of _0x11f2c5)'unmodified'!==_0x5084d3['data']['operation']&&('error'!==_0x5084d3['data']['operation']?'review-metadata'!==_0x5084d3['event']?this['_addReviewCheckResult'](_0x5084d3['data']['dataId'],_0x5084d3['data']['textDelta']):this['callId']=_0x5084d3['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(_0x1a394e){this['_currentError']=_0x1a394e,_0x1a394e instanceof Error&&_0x1a394e['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'](_0xd6c3cb,_0x7b8ce9){const _0x526727=this['_results']['get'](_0xd6c3cb);if(!_0x526727)return;if(0x0===_0x7b8ce9['length'])return;const _0x4f7f41=[];_0x7b8ce9['forEach']((_0x52dcc6,_0x1de565)=>{const _0x3dfa58=new Ds(_0x526727['id']+'-'+_0x1de565,_0x52dcc6,_0x526727);_0x3dfa58['on']('change:status',()=>{this['fire']('reviewCheckResultChangeStatusUpdated',{'change':_0x3dfa58,'status':_0x3dfa58['status']});}),_0x3dfa58['on']('change:isActivated',()=>{_0x3dfa58['isActivated']?this['fire']('reviewCheckResultActivated',{'change':_0x3dfa58}):this['fire']('reviewCheckResultDeactivated',{'change':_0x3dfa58});}),this['_changes']['push'](_0x3dfa58),_0x4f7f41['push'](_0x3dfa58);}),this['fire']('reviewCheckResultReady',{'changes':_0x4f7f41,'result':_0x526727,'source':this});}['abort'](){this['_activeRequest']&&(this['_activeRequest']['abortController']['abort'](),this['_activeRequest']=null,this['status']='aborted');}['isChangeActive'](_0x9393e9){const _0x50e058=this['_changes']['find'](_0x535d29=>_0x535d29['id']===_0x9393e9);return!(!_0x50e058||'pending'!==_0x50e058['status']);}['isAnyChangeActivated'](){return this['_changes']['some'](_0x4b0c06=>!0x0===_0x4b0c06['isActivated']);}['getActiveChanges'](){return this['_changes']['filter'](_0x2c732d=>'pending'===_0x2c732d['status']);}['getChangeById'](_0x104d8b){return this['_changes']['find'](_0x50340b=>_0x50340b['id']===_0x104d8b);}['markAllChangesAsAccepted'](){for(const _0xa559d of this['_changes'])'pending'===_0xa559d['status']&&(_0xa559d['status']='accepted');this['_checkIfFinished']();}['markChangeAsAccepted'](_0x3a5e7f){const _0x18afb0=this['_changes']['find'](_0x26d21d=>_0x26d21d['id']===_0x3a5e7f);_0x18afb0&&'pending'===_0x18afb0['status']&&(_0x18afb0['status']='accepted'),this['_checkIfFinished']();}['markChangeAsRejected'](_0x4309cc){const _0x1c0e84=this['_changes']['find'](_0x546c2c=>_0x546c2c['id']===_0x4309cc);_0x1c0e84&&'pending'===_0x1c0e84['status']&&(_0x1c0e84['status']='rejected'),this['_checkIfFinished']();}['markChangeAsOutdated'](_0x1b332f){const _0x49fd30=this['_changes']['find'](_0x50deef=>_0x50deef['id']===_0x1b332f);_0x49fd30&&'pending'===_0x49fd30['status']&&(_0x49fd30['status']='outdated'),this['_checkIfFinished']();}['markChangeAsPending'](_0x14615b){const _0x38708f=this['_changes']['find'](_0x308122=>_0x308122['id']===_0x14615b);_0x38708f&&'outdated'===_0x38708f['status']&&(_0x38708f['status']='pending'),this['_checkIfFinished']();}['activateChange'](_0x54de06){this['_changes']['filter'](_0x10fdf9=>_0x10fdf9['isActivated']&&_0x10fdf9['id']!==_0x54de06)['forEach'](_0x5e3c92=>{_0x5e3c92['isActivated']=!0x1;});const _0x2c3e05=this['_changes']['find'](_0x36478b=>_0x36478b['id']===_0x54de06);_0x2c3e05&&'pending'===_0x2c3e05['status']&&(_0x2c3e05['isActivated']=!0x0);}['deactivateChange'](){this['_changes']['filter'](_0x2f3c51=>_0x2f3c51['isActivated'])['forEach'](_0x143384=>{_0x143384['isActivated']=!0x1;});}['forceReadyState'](){this['status']='ready';}async['sendRating'](_0x1af83b){if('initialized'===this['status']||'loading'===this['status']||'data'===this['status'])return;if(!this['callId']||0x0===this['_changes']['length'])return;let _0x3ebacf;if(_0x1af83b){const _0x52de70=this['_changes']['find'](_0x473eb6=>_0x473eb6['id']===_0x1af83b);if(_0x52de70&&_0x52de70['isRated'])return;_0x52de70&&(_0x3ebacf=_0x52de70['parent']['id'],_0x52de70['isRated']=!0x0);}const _0x3a21f2={'positiveCount':this['_changes']['filter'](_0x54deb4=>'accepted'===_0x54deb4['status'])['length'],'totalCount':this['_changes']['length']};this['_sendRatingRequest'](_0x3a21f2,this['callId'],_0x3ebacf);}['_addReviewCheckResult'](_0x217454,_0x575184){const _0x745658=this['_documentData']['elements']['get'](_0x217454);if(!_0x745658)return;const _0x1a0271=_0x745658['getContent']();if(_0x1a0271===_0x575184)return;const _0xfc35c1=new Rs({'id':_0x217454,'contentInitial':_0x1a0271,'contentNew':_0x575184,'documentVersion':this['_documentData']['version']});this['_results']['set'](_0xfc35c1['id'],_0xfc35c1),this['fire']('reviewCheckResultAdded',{'result':_0xfc35c1,'source':this});}['_checkIfFinished'](){'finished'===this['status']&&(this['_changes']['filter'](_0x3b01e8=>'pending'===_0x3b01e8['status'])['length']>0x0&&(this['status']='ready')),'ready'===this['status']&&(0x0===this['_changes']['filter'](_0x3bc31a=>'pending'===_0x3bc31a['status'])['length']&&(this['status']='finished'));}}class hi extends zs{get['subTitle'](){if(!this['_reviewParams']||0x0===this['_reviewParams']['length'])return'';const _0x2e6148=[];if(this['_reviewParams']['length']>0x0&&this['_sourceCheck']['options'])for(let _0x30ab77=0x0;_0x30ab77<this['_reviewParams']['length'];_0x30ab77++){if(!this['_reviewParams'][_0x30ab77]||!this['_sourceCheck']['options'][_0x30ab77])continue;const _0x58cf97=this['_sourceCheck']['options'][_0x30ab77],_0xf85e9=_0x58cf97['data']?.['find'](_0x2cd02c=>_0x2cd02c['id']===this['_reviewParams'][_0x30ab77]);_0xf85e9&&_0x2e6148['push'](_0xf85e9['label']);}return _0x2e6148['join'](',\x20');}get['reviewName'](){return this['_composeReviewName']();}['_createApiRequest'](){return this['_aiConnector']['callSystemReview']({'reviewName':this['_composeReviewName'](),'content':this['_documentData']['content'],'args':this['_reviewArgs']});}['_sendRatingRequest'](_0x4ff9b9,_0x15fd12,_0x5e5805){return this['_aiConnector']['upsertAIReviewRating'](this['reviewName'],_0x15fd12,_0x4ff9b9,_0x5e5805);}['_composeReviewName'](){return!this['_reviewParams']||0x0===this['_reviewParams']['length']||this['_sourceCheck']['useArgs']?this['_sourceCheck']['id']:[this['_sourceCheck']['id'],...this['_reviewParams']]['join']('-');}}class oi extends zs{['_prompt'];['_model'];constructor(_0x36c2f5,_0xb392b0,_0x437f48,_0x139238,_0x37d3e6){super(_0x437f48,_0x139238,_0x37d3e6),this['_prompt']=_0x36c2f5,this['_model']=_0xb392b0;}get['subTitle'](){return this['_prompt'];}['_createApiRequest'](){return this['_aiConnector']['callCustomReview']({'content':this['_documentData']['content'],'prompt':this['_prompt'],'model':this['_model']});}['_sendRatingRequest'](_0x3d1b6f,_0x275514,_0x5657f3){return this['_aiConnector']['upsertCustomAIReviewRating'](_0x275514,_0x3d1b6f,_0x5657f3);}}const ni=[{'id':'custom','title':'Custom\x20command','description':'Type\x20a\x20custom\x20command\x20to\x20review\x20the\x20content\x20exactly\x20as\x20you\x20need.','isParameterized':!0x0},{'id':'correctness','title':'Correctness','description':'Ensure\x20the\x20text\x20is\x20factually\x20accurate\x20and\x20free\x20of\x20errors.','isParameterized':!0x1},{'id':'clarity','title':'Clarity','description':'Improve\x20the\x20clarity\x20and\x20readability\x20of\x20the\x20text.','isParameterized':!0x1},{'id':'readability','title':'Readability','description':'Enhance\x20the\x20overall\x20readability\x20of\x20the\x20text.','isParameterized':!0x1},{'id':'make','title':'Adjust\x20length','description':'Refine\x20text\x20length\x20to\x20match\x20your\x20needs.','isParameterized':!0x0,'options':[{'formType':'dropdown','label':'Adjust\x20length','default':'longer','data':[{'label':'Longer','id':'longer'},{'label':'Shorter','id':'shorter'}]}]},{'id':'make-tone','title':'Adjust\x20tone\x20and\x20style','description':'Choose\x20tone\x20and\x20style\x20to\x20change\x20content\x20as\x20you\x20need.','isParameterized':!0x0,'options':[{'formType':'dropdown','label':'Adjust\x20tone\x20and\x20style','default':'casual','data':[{'label':'Casual','id':'casual'},{'label':'Direct','id':'direct'},{'label':'Friendly','id':'friendly'},{'label':'Confident','id':'confident'},{'label':'Professional','id':'professional'}]}]},{'id':'translate','title':'Translate','description':'Translate\x20the\x20text\x20into\x20another\x20language.','isParameterized':!0x0,'useArgs':!0x0,'options':[{'formType':'dropdown','label':'Select\x20language','argsKey':'language','data':[{'label':'English','id':'english'},{'label':'Spanish','id':'spanish'},{'label':'French','id':'french'},{'label':'German','id':'german'},{'label':'Chinese\x20(Simplified)','id':'chinese'},{'label':'Japanese','id':'japanese'},{'label':'Russian','id':'russian'},{'label':'Portuguese','id':'portuguese'},{'label':'Korean','id':'korean'},{'label':'Italian','id':'italian'}]}]}];class re extends _0x53b1cd{['_aiConnector'];['_aiReviewModeUi'];['_aiReviewModeEditing'];['_aiReviewCheckList'];['_currentReviewCheckRun'];['_isDiffOn']=!0x1;['_changeActivationSource']=null;static get['requires'](){return[R];}static get['pluginName'](){return'AIReviewModeController';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}async['init'](){this['_aiConnector']=this['context']['plugins']['get']('AIConnector'),this['_aiReviewModeUi']=this['context']['plugins']['get']('AIReviewModeUI'),this['_aiReviewModeEditing']=this['context']['plugins']['get']('AIReviewModeEditing');const _0x1eb3d4=this['context']['config']['get']('ai.reviewMode.translations');if(_0x1eb3d4){for(const _0x5ae82b of ni)'translate'===_0x5ae82b['id']&&(_0x5ae82b['options'][0x0]['data']=_0x1eb3d4);}const _0x71e6d0=this['_translateReviewChecks'](ni);this['_aiReviewCheckList']=new si(_0x71e6d0);const _0x310aba=this['_aiReviewCheckList']['checks']['find'](_0x10d339=>'custom'===_0x10d339['id']);if(_0x310aba)try{_0x310aba['models']=await new At({'connector':this['_aiConnector'],'locale':this['context']['locale']})['getAll']();}catch(_0x1853ba){this['_aiReviewCheckList']['removeCheckById']('custom'),this['_logError'](new _0x25e143('ai-review-mode-models-unable-to-retrieve',this,{'error':_0x1853ba}));}this['listenTo'](this['_aiReviewModeUi'],'getReviewCheckList',()=>{this['_aiReviewModeUi']['setAvailableChecks'](this['_aiReviewCheckList']['checks']);}),this['listenTo'](this['_aiReviewModeUi'],'runReviewCheck',async(_0x3506aa,_0x40db54)=>{const _0x14e75c=this['_aiReviewCheckList']['getCheckById'](_0x40db54['id']);if(_0x14e75c){this['_onDiffChange'](this['_isDiffOn']),_0x40db54['isCustom']?this['_currentReviewCheckRun']=new oi(_0x40db54['args']['prompt'],_0x40db54['args']['model'],this['_aiReviewModeEditing']['getDocumentData'](),_0x14e75c,this['_aiConnector']):this['_currentReviewCheckRun']=new hi(this['_aiReviewModeEditing']['getDocumentData'](),_0x14e75c,this['_aiConnector'],_0x40db54['params'],_0x40db54['args']),this['_aiReviewModeUi']['setCheckResultTitle'](this['_currentReviewCheckRun']['title'],this['_currentReviewCheckRun']['subTitle']),this['_currentReviewCheckRun']['on']('reviewCheckRunUpdated',(_0x52a462,_0x1c9e84)=>{switch(_0x1c9e84['status']){case'data':case'loading':this['_aiReviewModeEditing']['switchToReadOnly'](),this['_aiReviewModeUi']['showCheckRunResults'](_0x1c9e84);break;case'finished':this['_aiReviewModeUi']['showReviewCompletedView']();break;case'ready':this['_aiReviewModeUi']['showActionsWhenResultIsReady']();break;case'unmodified':this['_aiReviewModeUi']['showNoChangesView']();break;case'error-general':this['_aiReviewModeUi']['showGeneralResultsErrorView'](),this['_logError'](new _0x25e143('ai-review-mode-check-run-general-error',this,this['_currentReviewCheckRun']?.['currentError']));break;case'error-chunk':this['_aiReviewModeUi']['showChunkErrorView'](),this['_logError'](new _0x25e143('ai-review-mode-check-run-chunk-error',this,this['_currentReviewCheckRun']?.['currentError']));break;case'aborted':this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['processedResultsCount']>0x0?setTimeout(()=>{this['_currentReviewCheckRun']?.['forceReadyState']();},0x0):this['_onReviewModeRunLeave'](!0x0);}'ready'!==_0x1c9e84['status']&&'error-chunk'!==_0x1c9e84['status']&&'error-general'!==_0x1c9e84['status']||this['_currentReviewCheckRun']?.['sendRating']();}),this['_currentReviewCheckRun']['on']('reviewCheckResultAdded',(_0x1ec5dd,_0x2a7875)=>{if(!this['_currentReviewCheckRun'])throw new _0x25e143('ai-review-mode-no-current-check-run',this);const _0x585298=this['_aiReviewModeEditing']['diffContent'](_0x2a7875['result']['contentInitial'],_0x2a7875['result']['contentNew']);_0x2a7875['source']['addResultChanges'](_0x2a7875['result']['id'],_0x585298);}),this['_currentReviewCheckRun']['on']('reviewCheckResultReady',(_0x2c24f1,_0x3bb1ae)=>{for(const _0x27b274 of _0x3bb1ae['changes'])this['_aiReviewModeUi']['showCheckRunResult'](_0x27b274);this['_aiReviewModeEditing']['markChangePositionInEditorContent'](_0x3bb1ae['changes'],_0x3bb1ae['source']['documentData']);}),this['_currentReviewCheckRun']['on']('reviewCheckResultChangeStatusUpdated',(_0x24cd28,_0x340e0c)=>{this['_aiReviewModeUi']['updateChangeState'](_0x340e0c['change']['id'],_0x340e0c['status']);}),this['_currentReviewCheckRun']['on']('reviewCheckResultActivated',(_0xa38c33,_0x1d0a24)=>{this['_aiReviewModeUi']['setActiveStateInResults'](_0x1d0a24['change']['id']);const _0x39e178=this['_aiReviewModeEditing']['getMarkerElementForChange'](_0x1d0a24['change']['id']);if(!_0x39e178)return;if('content'===this['_changeActivationSource']){const _0x278b52=this['_aiReviewModeUi']['getChangeElement'](_0x1d0a24['change']['id']);_0x278b52&&_0x4fe2cb(_0x278b52['closest']('.ck-ai-review-mode__check-run-result')||_0x278b52);}else{if('panel'===this['_changeActivationSource']){const _0x39a404={'target':_0x39e178['domElement'],'viewportOffset':{'top':0x55,'left':0x0,'bottom':0x0,'right':0x0},'ancestorOffset':0x14,'alignToTop':!0x0};_0xc42cd2(_0x39a404);}}const _0x3fdf3c=this['_aiReviewModeEditing']['getEditor']();this['_aiReviewModeUi']['showChangeBalloon'](_0x1d0a24['change'],_0x39e178['domElement'],void 0x0,'click',_0x3fdf3c?.['editing']?.['view']?.['getDomRoot'](),_0x3fdf3c?.['ui']?.['viewportOffset']);}),this['_currentReviewCheckRun']['on']('reviewCheckResultDeactivated',()=>{this['_aiReviewModeUi']['resetActiveStateInResults'](),this['_aiReviewModeUi']['hideChangeBalloon']();});try{await this['_currentReviewCheckRun']['start']();}catch(_0x1652d0){_0x1652d0 instanceof Error&&_0x1652d0['message']['includes']('ai-request-aborted')||(_0x1652d0 instanceof _0x25e143?this['_logError'](_0x1652d0):this['_logError'](new _0x25e143('ai-review-mode-check-run-failed',this,{'error':_0x1652d0})));}}else this['_logError'](new _0x25e143('ai-review-mode-source-check-not-found',this,{'checkId':_0x40db54['id']}));}),this['listenTo'](this['_aiReviewModeUi'],'leaveReviewMode',()=>{this['_onReviewModeRunLeave']();}),this['listenTo'](this['_aiReviewModeUi'],'leaveReviewModeResultList',()=>{this['_onReviewModeRunLeave'](!0x0);}),this['listenTo'](this['_aiReviewModeUi'],'abortReviewStream',()=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['abort']();}),this['listenTo'](this['_aiReviewModeUi'],'finishReview',()=>{this['_onReviewModeRunLeave'](!0x0);}),this['listenTo'](this['_aiReviewModeUi'],'acceptAllChanges',()=>{if(!this['_currentReviewCheckRun'])return;const _0x30e858=this['_currentReviewCheckRun']['getActiveChanges']();_0x30e858['length']&&(this['_aiReviewModeEditing']['applyChange'](_0x30e858['map'](_0x26163a=>_0x26163a['id'])),this['_currentReviewCheckRun']['markAllChangesAsAccepted'](),this['_currentReviewCheckRun']['sendRating']());}),this['listenTo'](this['_aiReviewModeUi'],'acceptChange',(_0x38876d,_0x51d539)=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['isChangeActive'](_0x51d539['id'])&&(this['_aiReviewModeEditing']['applyChange']([_0x51d539['id']]),this['_currentReviewCheckRun']['markChangeAsAccepted'](_0x51d539['id']),this['_aiReviewModeUi']['hideChangeBalloon'](),this['_currentReviewCheckRun']['sendRating'](_0x51d539['id']));}),this['listenTo'](this['_aiReviewModeUi'],'dismissChange',(_0x3ac682,_0x5868dc)=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['isChangeActive'](_0x5868dc['id'])&&(this['_aiReviewModeEditing']['rejectChange'](_0x5868dc['id']),this['_currentReviewCheckRun']['markChangeAsRejected'](_0x5868dc['id']),this['_aiReviewModeUi']['hideChangeBalloon'](),this['_currentReviewCheckRun']['sendRating'](_0x5868dc['id']));}),this['listenTo'](this['_aiReviewModeUi'],'toggleDiff',(_0x9b44a3,_0x514ed7)=>{this['_isDiffOn']=_0x514ed7['on'],this['_onDiffChange'](this['_isDiffOn']);}),this['listenTo'](this['_aiReviewModeUi'],'retryReview',async()=>{this['_currentReviewCheckRun']&&(this['_aiReviewModeEditing']['clearAllMarkers'](),this['_currentReviewCheckRun']['updateDocumentData'](this['_aiReviewModeEditing']['getDocumentData']()),await this['_currentReviewCheckRun']['restart']());}),this['listenTo'](this['_aiReviewModeUi'],'activateChange',(_0x48e6a8,_0x552d8b)=>{this['_currentReviewCheckRun']&&(this['_changeActivationSource']='panel',this['_currentReviewCheckRun']['activateChange'](_0x552d8b['id']));}),this['listenTo'](this['_aiReviewModeUi'],'deactivateChange',()=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['deactivateChange']();}),this['listenTo'](this['_aiReviewModeEditing']['emitter'],'changeMarkerClick',(_0x54cab3,_0x2fb1c7)=>{if(!this['_currentReviewCheckRun'])return;this['_changeActivationSource']='content',this['_currentReviewCheckRun']['activateChange'](_0x2fb1c7['changeId']);const _0x42fd12=this['_currentReviewCheckRun']['getChangeById'](_0x2fb1c7['changeId']);if(!_0x42fd12)return;const _0x379f82=this['_aiReviewModeEditing']['getEditor']();this['_aiReviewModeUi']['showChangeBalloon'](_0x42fd12,_0x2fb1c7['markerElement'],_0x2fb1c7['domEvent'],'click',_0x379f82?.['editing']?.['view']?.['getDomRoot'](),_0x379f82?.['ui']?.['viewportOffset']);}),this['listenTo'](this['_aiReviewModeEditing']['emitter'],'changeMarkerHovered',(_0x1fe9d6,_0x35f5a5)=>{if(!this['_currentReviewCheckRun'])return;if(this['_currentReviewCheckRun']['isAnyChangeActivated']())return;const _0x5c245a=this['_currentReviewCheckRun']['getChangeById'](_0x35f5a5['changeId']);if(!_0x5c245a)return;const _0x29017c=this['_aiReviewModeEditing']['getEditor']();this['_aiReviewModeUi']['showChangeBalloon'](_0x5c245a,_0x35f5a5['markerElement'],_0x35f5a5['domEvent'],'hover',_0x29017c?.['editing']?.['view']?.['getDomRoot'](),_0x29017c?.['ui']?.['viewportOffset']);}),this['listenTo'](this['_aiReviewModeEditing']['emitter'],'changeMarkerBlurred',()=>{if(!this['_currentReviewCheckRun'])return;this['_currentReviewCheckRun']['isAnyChangeActivated']()||this['_aiReviewModeUi']['hideChangeBalloon']();}),this['listenTo'](this['_aiReviewModeEditing']['emitter'],'changeMarkerRemoved',(_0xccc9ef,_0x513d66)=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['markChangeAsOutdated'](_0x513d66['changeId']);}),this['listenTo'](this['_aiReviewModeEditing']['emitter'],'changeMarkerRestored',(_0x20f703,_0x52c077)=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['markChangeAsPending'](_0x52c077['changeId']);});}['_onReviewModeRunLeave'](_0x3b3ca9=!0x1){this['_currentReviewCheckRun']&&(this['_currentReviewCheckRun']['hasModifications']||this['_currentReviewCheckRun']['sendRating'](),this['_currentReviewCheckRun']['stopListening'](),this['_currentReviewCheckRun']['abort'](),this['_currentReviewCheckRun']=void 0x0),_0x3b3ca9&&this['_aiReviewModeUi']['showReviewCheckList'](),this['_aiReviewModeEditing']['clearAllMarkers'](),this['_aiReviewModeEditing']['switchToEdit'](),this['_changeActivationSource']=null;const _0x5731e9=this['_aiReviewModeEditing']['getEditor']();_0x5731e9&&_0x5731e9['editing']['view']['change'](_0x5401ee=>{const _0x3bfec4=_0x5731e9['editing']['view']['document']['getRoot']();_0x5401ee['removeClass']('ck-ai-review-mode-diff',_0x3bfec4),_0x5401ee['removeClass']('ck-ai-review-mode-highlights',_0x3bfec4);});}['_onDiffChange'](_0x1d10a9){const _0x1cbb2e=this['_aiReviewModeEditing']['getEditor']();_0x1d10a9?this['_aiReviewModeUi']['hideDiffInBalloon']():this['_aiReviewModeUi']['showDiffInBalloon'](),_0x1cbb2e&&_0x1cbb2e['editing']['view']['change'](_0x3f152b=>{const _0x14ee01=_0x1cbb2e['editing']['view']['document']['getRoot']();_0x3f152b['removeClass']('ck-ai-review-mode-diff',_0x14ee01),_0x3f152b['removeClass']('ck-ai-review-mode-highlights',_0x14ee01),_0x3f152b['addClass'](_0x1d10a9?'ck-ai-review-mode-diff':'ck-ai-review-mode-highlights',_0x14ee01);});}['_translateReviewChecks'](_0x228ce1){return _0x228ce1['map'](_0x57683b=>{const _0x34fcd7='AI_REVIEW_CHECK_'+_0x57683b['id']['toUpperCase']()['replaceAll']('-','_'),_0x4c81c9={..._0x57683b,'title':this['_getTranslationWithDefault'](_0x34fcd7+'_TITLE',_0x57683b['title']),'description':this['_getTranslationWithDefault'](_0x34fcd7+'_DESCRIPTION',_0x57683b['description'])};return _0x57683b['options']&&(_0x4c81c9['options']=_0x57683b['options']['map'](_0x342b44=>({..._0x342b44,'label':this['_getTranslationWithDefault'](_0x34fcd7+'_OPTIONS_LABEL',_0x342b44['label']||''),'data':_0x342b44['data']?_0x342b44['data']['map'](_0x4ca3e0=>({..._0x4ca3e0,'label':this['_getTranslationWithDefault'](_0x34fcd7+'_OPTIONS_DATA_'+_0x4ca3e0['id']['toUpperCase'](),_0x4ca3e0['label'])})):void 0x0}))),_0x4c81c9;});}['_getTranslationWithDefault'](_0x16446d,_0x359de7){const _0x3c65a6=i(this['context']['locale'],_0x16446d);return _0x3c65a6===_0x16446d?_0x359de7:_0x3c65a6;}['_logError'](_0x1f83bd){ft(_0x1f83bd['message']),_0x1f83bd['message']['startsWith']('ai-review-mode-models-unable-to-retrieve')?this['_aiReviewModeUi']['showGeneralReviewModeErrorView']():this['_aiReviewModeUi']['showGeneralResultsErrorView']();}}class Mr extends _0x55515f{['_dropdownView'];['_defaultValue'];['_defaultLabel'];constructor(_0x2dc442,_0x533970){super(_0x2dc442),this['_defaultValue']=_0x533970['default']||(_0x533970['data']['length']>0x0?_0x533970['data'][0x0]['id']:''),this['_defaultLabel']=_0x533970['data']['find'](_0x37f1f4=>_0x37f1f4['id']===this['_defaultValue'])?.['label']||'',this['set']('formValue',''),this['_dropdownView']=_0x4c9a3b(this['locale']);const _0x328ac7=this['_prepareListOptions'](_0x533970['data']);_0x2100d6(this['_dropdownView'],_0x328ac7,{'role':'menu','ariaLabel':_0x533970['label']}),this['_dropdownView']['buttonView']['set']({'label':this['_defaultLabel'],'withText':!0x0}),this['_dropdownView']['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x58d1e3=>{_0x58d1e3['stopPropagation']();})}}),this['listenTo'](this['_dropdownView'],'execute',_0xb56b34=>{this['formValue']=_0xb56b34['source']['model']['id'],this['_dropdownView']['buttonView']['label']=_0xb56b34['source']['model']['label'];}),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-ai-review-mode__check-list-item-parameterized-form-element','ck-ai-review-mode__check-list-item-parameterized-form-element_dropdown']},'children':[this['_dropdownView']]});}['resetToDefault'](){this['formValue']=this['_defaultValue'],this['_dropdownView']['buttonView']['label']=this['_defaultLabel'];}['_prepareListOptions'](_0x551f34=[]){const _0x3d6c19=new _0xffd920();this['resetToDefault']();for(const _0x32c831 of _0x551f34){const _0x2b6270=new _0x57b857({'label':_0x32c831['label'],'withText':!0x0,'role':'menuitemradio','id':_0x32c831['id'],'model':_0x32c831});_0x2b6270['bind']('isOn')['to'](this,'formValue',_0x15026d=>_0x15026d===_0x2b6270['id']);const _0xb73664={'type':'button','model':_0x2b6270};_0x3d6c19['add'](_0xb73664);}return _0x3d6c19;}}class ic extends _0x5f38b9{['_formItem']=null;constructor(_0x14cf68,_0x52c2fd,_0x5a0c6b){super(_0x14cf68),this['argsKey']=_0x52c2fd?.['argsKey'];if('dropdown'===_0x52c2fd['formType'])this['_formItem']=new Mr(this['locale'],_0x52c2fd);this['set']('value',''),this['bind']('value')['to'](this['_formItem'],'formValue');const _0x98e24a=new _0x55c50c(this['locale'],{'children':[this['_formItem']],'class':[_0x5a0c6b?'ck-form__row_with-submit':'']});_0x5a0c6b&&_0x98e24a['children']['add'](_0x5a0c6b),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-review-mode__form-item','ck-reset_all']},'children':[_0x98e24a]});}['resetToDefault'](){this['_formItem']['resetToDefault']();}}class Qs extends _0x22b9ac{['keystrokes'];static ['MIN_ROWS']=0x1;static ['MAX_ROWS']=0xc;constructor(_0x50bb74){super(_0x50bb74),this['set']('isEmpty',!0x0),this['keystrokes']=new _0x1b5c14(),this['minRows']=Qs['MIN_ROWS'],this['maxRows']=Qs['MAX_ROWS'],this['extendTemplate']({'attributes':{'id':'ai-review-mode-prompt-input','class':['ck','ck-review-mode__prompt-input']}});}['render'](){super['render'](),this['on']('update',()=>{this['isEmpty']=''===this['element']['value']?.['trim']();}),this['keystrokes']['listenTo'](this['element']);}}class tc extends _0x55515f{['focusTracker']=new _0x338162();['keystrokes']=new _0x1b5c14();['focusCycler'];['_focusables']=new _0x4b2ba7();['submitButtonView'];['cancelButtonView'];['promptInputView'];['actionsFooterView'];['_modelSelectionDropdown'];['_modelSelectionDropdownItems'];['_check'];['_defaultValue'];['_defaultLabel'];constructor(_0x1e9236,_0x5142b7){super(_0x1e9236),this['_check']=_0x5142b7,this['set']('prompt',''),this['set']('modelId',''),this['_defaultValue']=_0x5142b7['models']&&_0x5142b7['models']['length']>0x0?_0x5142b7['models'][0x0]['id']:'',this['_defaultLabel']=_0x5142b7['models']&&_0x5142b7['models']['length']>0x0?_0x5142b7['models'][0x0]['name']:'',this['submitButtonView']=this['_createSubmitButtonView'](),this['cancelButtonView']=this['_createCancelButtonView'](),(this['promptInputView']=new _0x349f6b(this['locale'],()=>new Qs(_0x1e9236)),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 _0xffd920(),this['_setModelList'](),_0x2100d6(this['_modelSelectionDropdown'],this['_modelSelectionDropdownItems']),this['actionsFooterView']=this['_createActionsFooterView'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item-custom-actions']},'children':[new _0x55c50c(this['locale'],{'children':[this['promptInputView']]}),new _0x55c50c(this['locale'],{'children':[this['actionsFooterView']]})]}),this['promptInputView']['fieldView']['keystrokes']['set']('Enter',(_0xa7dc12,_0x198e3b)=>{this['_isValid']()?(this['fire']('runReviewCheck',{'id':'custom','args':{'prompt':this['prompt'],'model':this['modelId']},'isCustom':!0x0}),_0x198e3b()):_0x198e3b();}),this['focusCycler']=new _0x2f6676({'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'](_0x5cfbd0=>{this['_focusables']['add'](_0x5cfbd0),this['focusTracker']['add'](_0x5cfbd0['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 _0x3b345e of this['_getFormValidators']()){const _0x67825a=_0x3b345e();if(_0x67825a)return this['promptInputView']['errorText']=_0x67825a,!0x1;}return!0x0;}['_getFormValidators'](){return[()=>{if(0x0===this['promptInputView']['fieldView']['value']?.['trim']()['length'])return i(this['locale'],'AI_REVIEW_MODE_PROMPT_EMPTY_ERROR');}];}['_createSubmitButtonView'](){const _0x5f5697=new _0x5cf211(this['locale']),t=this['locale']['t'];return _0x5f5697['set']({'label':t('Submit'),'withText':!0x0,'class':'ck-ai-button-primary'}),_0x5f5697['on']('execute',()=>{this['_isValid']()&&this['fire']('runReviewCheck',{'id':'custom','args':{'prompt':this['prompt'],'model':this['modelId']},'isCustom':!0x0});}),_0x5f5697;}['_createCancelButtonView'](){const _0x5d6f5f=new _0x5cf211(this['locale']),t=this['locale']['t'];return _0x5d6f5f['set']({'label':t('Cancel'),'withText':!0x0,'class':'ck-ai-button-tertiary-filled'}),_0x5d6f5f['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x3d28c8=>{_0x3d28c8['stopPropagation']();})}}),_0x5d6f5f['on']('execute',()=>{this['resetToDefault'](),this['fire']('closeCustomCheck');}),_0x5d6f5f;}['_setModelList'](){this['_modelSelectionDropdownItems']['clear']();const _0x51b807=this['_check']['models'];if(this['resetToDefault'](),_0x51b807?.['length'])for(const _0x783157 of _0x51b807){const _0x51f323=new _0x57b857({'label':_0x783157['name'],'withText':!0x0,'role':'menuitemradio','id':_0x783157['id'],'model':_0x783157});_0x51f323['bind']('isOn')['to'](this,'modelId',_0x56c1d9=>_0x56c1d9===_0x783157['id']),this['_modelSelectionDropdownItems']['add']({'type':'button','model':_0x51f323,'labelView':new Us(this['locale'],_0x783157)});}}['_createModelSelectionDropdown'](){const _0x399775=_0x4c9a3b(this['locale']);return _0x399775['set']({'panelPosition':'se','class':'ck-ai-review-mode__check-list-item-model-dropdown'}),_0x399775['buttonView']['set']({'label':this['_defaultLabel'],'withText':!0x0,'tooltip':!0x0}),this['listenTo'](_0x399775,'execute',_0x146760=>{this['modelId']=_0x146760['source']['model']['id'],_0x399775['buttonView']['label']=_0x146760['source']['label'];}),_0x399775;}['_createActionsFooterView'](){const _0x2dd8fc=new _0x55515f(this['locale']);return _0x2dd8fc['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item-custom-actions-footer']},'children':[this['_modelSelectionDropdown'],{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item-parameterized-custom-actions-buttons']},'children':[this['cancelButtonView'],this['submitButtonView']]}]}),_0x2dd8fc;}}class Us extends _0xbcb951{constructor(_0x8d2357,_0x38cdcd){super();const _0x2c9045=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-button__label'],'style':_0x2c9045['to']('style'),'id':_0x2c9045['to']('id')},'children':[{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item-model-dropdown-name']},'children':[{'tag':'span','children':[{'text':_0x2c9045['to']('text')}]}]},{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item-model-dropdown-description']},'children':[{'tag':'span','children':[_0x38cdcd['description']||'']}]}]});}}class Xs extends _0x5f38b9{['_formItemsCollection']=new _0x4b2ba7();['_customCheckView']=null;constructor(_0x5a5092,_0x8ef970,_0x56a69d){super(_0x5a5092),this['set']('isParametrizedViewOpen',!0x1),this['set']('isListItemRendered',!0x1),this['set']('isItemParametrized',_0x8ef970['isParameterized']);const _0x442626=this['_createIconView']();this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item',this['bindTemplate']['if']('isParametrizedViewOpen','ck-ai-review-mode__check-list-item_selected',_0x55be8e=>_0x55be8e),this['bindTemplate']['if']('isListItemRendered','ck-ai-review-mode__check-list-item_rendered',_0x3877e1=>_0x3877e1)],'style':{'--ck-ai-review-check-list-item-index':_0x56a69d}},'on':{'click':this['bindTemplate']['to']('click')},'children':[{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item-content']},'children':[{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item-main-content']},'children':[{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item-title']},'children':[{'tag':'span','attributes':{'class':['ck-ai-review-mode__check-list-item-title-text']},'children':[{'text':_0x8ef970['title']}]},_0x442626]},{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item-description']},'children':[{'text':_0x8ef970['description']}]}]}]},..._0x8ef970['isParameterized']?[this['_createParameterizedView'](_0x8ef970)]:[],...'custom'===_0x8ef970['id']?[this['_createCustomView'](_0x8ef970)]:[]]}),this['on']('click',()=>{_0x8ef970['isParameterized']?this['isParametrizedViewOpen']=!0x0:this['fire']('runReviewCheck',{'id':_0x8ef970['id']});}),requestAnimationFrame(()=>{this['isListItemRendered']=!0x0;});}['render'](){super['render'](),this['isItemParametrized']&&_0x1411c6({'emitter':this,'activator':()=>!0x0===this['isParametrizedViewOpen'],'contextElements':[this['element']],'callback':()=>{this['isParametrizedViewOpen']=!0x1;}});}['resetToDefault'](){this['isParametrizedViewOpen']=!0x1,this['_formItemsCollection']['forEach'](_0x3e59a9=>{_0x3e59a9['resetToDefault']();}),this['_customCheckView']&&this['_customCheckView']['resetToDefault']();}['_createIconView'](){const _0x300be7=new _0x1e0173();return _0x300be7['content']=_0x2cda6f,_0x300be7['extendTemplate']({'attributes':{'class':['ck-ai-review-mode__check-list-item-title-icon']}}),_0x300be7;}['_createParameterizedView'](_0x4d35b3){const _0x185105=new _0x55515f(),_0x185690=this['_createFormView'](_0x4d35b3);return _0x185105['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item-parameterized',this['bindTemplate']['if']('isParametrizedViewOpen','ck-hidden',_0x2c4190=>!_0x2c4190)]},'children':[_0x185690]}),_0x185105;}['_createFormView'](_0x187d2d){const _0x23dc90=new _0x55515f(),_0x558a31=Array['isArray'](_0x187d2d['options'])?_0x187d2d['options']:[],_0x208854=new _0x5cf211(this['locale']),t=this['locale']['t'];_0x208854['set']({'label':t('Submit'),'withText':!0x0,'class':'ck-ai-button-primary'}),_0x208854['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x51e405=>{_0x51e405['stopPropagation']();})}}),_0x208854['on']('execute',()=>{const _0x1f4404=[],_0x520ca5={};this['_formItemsCollection']['forEach'](_0x57edd4=>{_0x1f4404['push'](_0x57edd4['value']),_0x187d2d['useArgs']&&_0x187d2d['options']&&(_0x520ca5[_0x57edd4['argsKey']]=_0x57edd4['value']);}),this['fire']('runReviewCheck',{'id':_0x187d2d['id'],'params':_0x1f4404['length']?_0x1f4404:void 0x0,'args':Object['keys'](_0x520ca5)['length']?_0x520ca5:void 0x0});});const _0x29d5e2=_0x558a31['length'];return _0x558a31['forEach']((_0x150b2b,_0x15ed0d)=>{const _0x1f2f0b=_0x15ed0d===_0x29d5e2-0x1;this['_formItemsCollection']['add'](new ic(this['locale'],_0x150b2b,_0x1f2f0b?_0x208854:null));}),_0x23dc90['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item-parameterized-form']},'children':this['_formItemsCollection']}),_0x23dc90;}['_createCustomView'](_0x34405b){return this['_customCheckView']=new tc(this['locale'],_0x34405b),this['_customCheckView']['extendTemplate']({'attributes':{'class':['ck-ai-review-mode__check-list-item-parameterized','ck-ai-review-mode__check-list-item-parameterized_custom',this['bindTemplate']['if']('isParametrizedViewOpen','ck-hidden',_0x3d9881=>!_0x3d9881)]}}),this['_customCheckView']['delegate']('runReviewCheck')['to'](this),this['listenTo'](this['_customCheckView'],'closeCustomCheck',()=>{this['isParametrizedViewOpen']=!0x1;}),this['on']('change:isParametrizedViewOpen',(_0x2cb53e,_0x32c631,_0x3403dd)=>{_0x3403dd||this['_customCheckView']['resetFormValidationStatus']();}),this['_customCheckView'];}}class ih extends _0x5f38b9{['_checkViews'];constructor(_0x28220e){super(_0x28220e),this['_checkViews']=new _0x4b2ba7();const _0x3fa54c=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list',_0x3fa54c['if']('isVisible','ck-hidden',_0x482330=>!_0x482330)]},'children':this['_checkViews']});}['setChecks'](_0x5bcf91){this['_checkViews']['clear']();for(const [_0x455bb1,_0x30c7e9]of _0x5bcf91['entries']()){const _0x1d69a9=new Xs(this['locale'],_0x30c7e9,_0x455bb1);_0x1d69a9['delegate']('runReviewCheck')['to'](this),this['_checkViews']['add'](_0x1d69a9);}}['hasChecks'](){return this['_checkViews']['length']>0x0;}['resetAllParameterizedChecks'](){for(const _0x348ad6 of this['_checkViews'])_0x348ad6 instanceof Xs&&_0x348ad6['resetToDefault']();}}class Ps extends _0x55515f{['resultResponseView'];['acceptButtonView'];['dismissButtonView'];['infoButtonView'];['outdatedButtonView'];constructor(_0x382301,_0x39566e){super(_0x382301),this['id']=_0x39566e,this['set']('status','pending'),this['set']('changeId',_0x39566e),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-mode__check-run-result',this['bindTemplate']['if']('isActive','ck-ai-review-mode__check-run-result_active')]},'on':{'click':this['bindTemplate']['to']('click')},'children':[this['resultResponseView'],{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-run-result-footer']},'children':[{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-run-result-action-buttons']},'children':[this['acceptButtonView'],this['dismissButtonView'],this['outdatedButtonView']]},this['infoButtonView']]}]}),this['on']('click',()=>{this['fire']('activateChange',{'id':_0x39566e,'source':this});});}['setItemAsActive'](){this['isActive']=!0x0;}['setItemAsInactive'](){this['isActive']=!0x1;}['_createResultResponseView'](){const _0x64807=new _0x55515f(this['locale']);return _0x64807['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content','ck-content-direct-excluded','ck-ai-review-mode__check-run-result-response',this['bindTemplate']['if']('showDiff','ck-hidden',_0x4b4f34=>!_0x4b4f34)]}}),_0x64807;}['_createAcceptButtonView'](){const _0x284677=new _0x5cf211(this['locale']);return _0x284677['set']({'label':i(this['locale'],'AI_REVIEW_MODE_ACCEPT_CHANGE'),'withText':!0x0}),_0x284677['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x3ec8eb=>{this['fire']('acceptChange',{'id':this['changeId']}),_0x3ec8eb['stopPropagation']();})},'attributes':{'class':['ck-ai-button-secondary','ck-ai-review-mode__check-run-result-accept-button',this['bindTemplate']['if']('status','ck-hidden',_0x11f81e=>'pending'!==_0x11f81e&&'accepted'!==_0x11f81e),this['bindTemplate']['if']('status','ck-ai-review-mode__check-run-result-accept-button',_0x378bd5=>'pending'===_0x378bd5),this['bindTemplate']['if']('status','ck-ai-review-mode__check-run-result-status-button',_0x5eed1a=>'accepted'===_0x5eed1a)]}}),this['on']('change:status',(_0x59b497,_0xdd4051,_0x36eab6)=>{_0x284677['isEnabled']=!0x1,'accepted'===_0x36eab6&&(_0x284677['label']=i(this['locale'],'AI_REVIEW_MODE_CHECK_STATUS_ACCEPTED'),_0x284677['icon']=_0x4ddb98);}),_0x284677;}['_createDismissButtonView'](){const _0x1d6dd8=new _0x5cf211(this['locale']);return _0x1d6dd8['set']({'label':i(this['locale'],'AI_REVIEW_MODE_DISMISS_CHANGE'),'withText':!0x0}),_0x1d6dd8['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x477eba=>{this['fire']('dismissChange',{'id':this['changeId']}),_0x477eba['stopPropagation']();})},'attributes':{'class':['ck-ai-button-tertiary-filled',this['bindTemplate']['if']('status','ck-hidden',_0x5d5a6c=>'pending'!==_0x5d5a6c&&'rejected'!==_0x5d5a6c),this['bindTemplate']['if']('status','ck-ai-review-mode__check-run-result-dismiss-button',_0x1772ff=>'pending'===_0x1772ff),this['bindTemplate']['if']('status','ck-ai-review-mode__check-run-result-status-button',_0x13cfee=>'rejected'===_0x13cfee)]}}),this['on']('change:status',(_0x3024f7,_0x4391c3,_0x487423)=>{_0x1d6dd8['isEnabled']=!0x1,'rejected'===_0x487423&&(_0x1d6dd8['label']=i(this['locale'],'AI_REVIEW_MODE_CHECK_STATUS_REJECTED'),_0x1d6dd8['icon']=_0x43c7d2);}),_0x1d6dd8;}['_createInfoButtonView'](){const _0xe68844=new _0x5cf211(this['locale']);return _0xe68844['set']({'label':i(this['locale'],'AI_REVIEW_MODE_LEARN_MORE'),'icon':_0x590152,'tooltip':!0x0,'isToggleable':!0x0,'role':'menuitemcheckbox','class':'ck-ai-button-tertiary-filled\x20ck-ai-review-mode__check-run-result-info-button\x20ck-hidden'}),_0xe68844['bind']('isOn')['to'](this,'isInfoToggleOn',_0x1cad14=>_0x1cad14),_0xe68844['on']('execute',()=>{this['isInfoToggleOn']=!this['isInfoToggleOn'];}),_0xe68844;}['_createOutdatedButtonView'](){const _0x2f7d5c=new _0x5cf211(this['locale']);return _0x2f7d5c['set']({'label':i(this['locale'],'AI_REVIEW_MODE_CHECK_STATUS_OUTDATED'),'icon':_0x4b903c,'withText':!0x0,'isEnabled':!0x1}),_0x2f7d5c['extendTemplate']({'attributes':{'class':['ck-ai-button-secondary','ck-ai-review-mode__check-run-result-status-button',this['bindTemplate']['if']('status','ck-hidden',_0x26acc1=>'outdated'!==_0x26acc1)],'disabled':'disabled'}}),_0x2f7d5c;}}class gr extends _0x5cf211{constructor(_0x18b9aa){super(_0x18b9aa),this['set']({'label':i(this['locale'],'AI_REVIEW_MODE_FINISH_REVIEW_BUTTON_LABEL'),'withText':!0x0,'class':'ck-ai-button-primary'}),this['on']('execute',()=>{this['fire']('finishReview');});}}class eh extends _0x5f38b9{['_resultViews'];['resultsHeader'];['reviewDisclaimer'];['_cancelButtonView'];['_acceptAllButtonView'];['_exitReviewButtonView'];['_toggleDiffButtonView'];['_errorMessageView'];['_finishReviewButtonView'];constructor(_0x9a49c0){super(_0x9a49c0),this['_resultViews']=new _0x4b2ba7(),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 bi(_0x9a49c0),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 _0x307830=this['_createCombinedSkeletonLoader'](),_0x124694=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-run',_0x124694['if']('isVisible','ck-hidden',_0x3c15db=>!_0x3c15db)]},'children':[this['resultsHeader'],{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-run-results-wrapper']},'children':[this['_errorMessageView'],{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-run-results-container',this['bindTemplate']['if']('isLoading','ck-hidden',_0x38eaed=>_0x38eaed)]},'children':this['_resultViews']},_0x307830]},this['reviewDisclaimer']]});}['clearResults'](){this['_resultViews']['clear']();}['getResults'](){return this['_resultViews'];}['addResult'](_0x5722a3){const _0x4fd0f9=new Ps(this['locale'],_0x5722a3['id']);_0x4fd0f9['delegate']('acceptChange','dismissChange','activateChange')['to'](this),this['_resultViews']['add'](_0x4fd0f9),_0x4fd0f9['resultResponseView']['element']['innerHTML']=_0x5722a3['contentDiffed'];}['hideResult'](_0x1608ec,_0x3807e5){if('pending'===_0x3807e5)return;const _0x1e8747=this['_resultViews']['find'](_0x10d780=>_0x10d780['id']===_0x1608ec);_0x1e8747&&(_0x1e8747['status']=_0x3807e5,_0x1e8747['element']?.['classList']['add']('ck-ai-review-mode__check-run-result_grayout'));}['showResult'](_0xae328a,_0x3082b2){if('pending'!==_0x3082b2)return;const _0x119f81=this['_resultViews']['find'](_0x45ad89=>_0x45ad89['id']===_0xae328a);_0x119f81&&(_0x119f81['status']=_0x3082b2,_0x119f81['element']?.['classList']['remove']('ck-ai-review-mode__check-run-result_grayout'));}['setTitle'](_0x4d5873,_0x10916f){this['headerTitle']=_0x4d5873,this['headerSubtitle']=_0x10916f||'';}['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 Pe(this['locale'],Be['aiReviewChecks']);}['_createCombinedSkeletonLoader'](){const _0x54c7cf=new _0x55515f(this['locale']),_0x8d670=[];for(let _0x1b78a3=0x0;_0x1b78a3<0x10;_0x1b78a3++){const _0x1d3149=this['_createSkeletonLoader']();_0x1d3149['extendTemplate']({'attributes':{'class':['ck-ai-review-mode__check-run-skeleton-item']}}),_0x8d670['push'](_0x1d3149);}return _0x54c7cf['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-run-skeleton-container',this['bindTemplate']['if']('isLoading','ck-hidden',_0x7ad4b3=>!_0x7ad4b3)]},'children':_0x8d670}),_0x54c7cf;}['_createErrorView'](){const _0x4752c1=new _0x55515f(this['locale']),_0x13f333=new _0x5cf211(this['locale']),t=this['locale']['t'];return _0x4752c1['delegate']('retryReview')['to'](this),_0x13f333['set']({'label':t('Try\x20again'),'withText':!0x0,'class':'ck-ai-button-secondary\x20ck-ai-review-mode__check-run-error-retry-button'}),_0x13f333['on']('execute',()=>{this['fire']('retryReview');}),_0x4752c1['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-run-error-container',this['bindTemplate']['if']('showErrorMessage','ck-hidden',_0x574701=>!_0x574701),this['bindTemplate']['if']('errorType','ck-ai-review-mode__check-run-error-container_border-bottom',_0x164e76=>'chunk'===_0x164e76)]},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-notification','ck-ai-notification_error','ck-ai-notification__full-width','ck-ai-review-mode__check-run-error-message',this['bindTemplate']['if']('errorType','ck-ai-notification_warning',_0xbe88f=>'chunk'===_0xbe88f)]},'children':[{'tag':'p','attributes':{'class':['ck-ai-notification__content',this['bindTemplate']['if']('errorType','ck-hidden',_0x4d6c04=>'general'!==_0x4d6c04)]},'children':[{'text':i(this['locale'],'AI_REVIEW_MODE_GENERAL_ERROR_MESSAGE')}]},{'tag':'p','attributes':{'class':['ck-ai-notification__content',this['bindTemplate']['if']('errorType','ck-hidden',_0x2d2e98=>'chunk'!==_0x2d2e98)]},'children':[{'text':i(this['locale'],'AI_REVIEW_MODE_CHUNK_ERROR_MESSAGE')}]}]},_0x13f333]}),_0x4752c1;}['_createCancelButtonView'](){const _0x44bf02=new _0x5cf211(this['locale']);return _0x44bf02['set']({'label':i(this['locale'],'AI_REVIEW_MODE_STOP_GENERATING'),'withText':!0x0,'class':['ck-ai-button-secondary\x20ck-ai-button-stop-generating'],'icon':_0x14f5b8}),_0x44bf02['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isResultReady','ck-hidden',_0x3a2c78=>_0x3a2c78),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x685e75=>_0x685e75)]}}),_0x44bf02['on']('execute',()=>{this['fire']('abortReviewStream');}),_0x44bf02;}['_createToggleDiffButtonView'](){const _0x485b91=new _0x5cf211(this['locale']);_0x485b91['set']({'tooltip':!0x0,'isToggleable':!0x0,'role':'menuitemcheckbox'}),_0x485b91['bind']('isEnabled')['to'](this,'isError',_0x182168=>!_0x182168),_0x485b91['extendTemplate']({'attributes':{'class':['ck-ai-button-secondary','ck-ai-review-mode__check-run-toggle-diff-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0x51f4b4=>!_0x51f4b4),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x11933e=>_0x11933e)]}});const _0x28962b=i(this['locale'],'AI_REVIEW_MODE_HIDE_CHANGES'),_0x1a8943=i(this['locale'],'AI_REVIEW_MODE_SHOW_CHANGES');return _0x485b91['bind']('isOn')['to'](this,'isToggleDiffOn',_0x1167cb=>_0x1167cb),_0x485b91['bind']('icon')['to'](this,'isToggleDiffOn',_0x2401e1=>_0x2401e1?_0x2a1219:_0x1d3ca5),_0x485b91['bind']('label')['to'](this,'isToggleDiffOn',_0x49ba9e=>_0x49ba9e?_0x28962b:_0x1a8943),_0x485b91['on']('execute',()=>{this['isToggleDiffOn']=!this['isToggleDiffOn'],this['fire']('toggleDiff',{'on':this['isToggleDiffOn']});}),_0x485b91;}['_createAcceptAllButtonView'](){const _0x596dbd=new _0x5cf211(this['locale']);return _0x596dbd['set']({'label':i(this['locale'],'AI_REVIEW_MODE_ACCEPT_ALL'),'withText':!0x0}),_0x596dbd['bind']('isEnabled')['to'](this,'isError',_0x421a42=>!_0x421a42),_0x596dbd['extendTemplate']({'attributes':{'class':['ck-ai-button-primary','ck-ai-review-mode__check-run-accept-all-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0x1fe09e=>!_0x1fe09e),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x566abe=>_0x566abe)]}}),_0x596dbd['on']('execute',()=>{this['fire']('acceptAllChanges');}),_0x596dbd;}['_createExitReviewButtonView'](){const _0x5a0a51=new _0x5cf211(this['locale']);return _0x5a0a51['set']({'label':i(this['locale'],'AI_REVIEW_MODE_EXIT_REVIEW'),'withText':!0x0}),_0x5a0a51['extendTemplate']({'attributes':{'class':['ck-ai-button-tertiary-filled','ck-ai-review-mode__check-run-exit-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0x39257c=>!_0x39257c),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x4d64f8=>_0x4d64f8)]}}),_0x5a0a51['on']('execute',()=>{this['fire']('leaveReviewModeResultList');}),_0x5a0a51;}['_createResultHeaderView'](){const _0x16e94e=new _0x55515f(this['locale']),_0x33195d=this['_createTitleView']();return _0x16e94e['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-run-results-header',this['bindTemplate']['if']('isCompleted','ck-ai-review-mode__review-completed-header',_0x5ea4ae=>_0x5ea4ae)]},'children':[_0x33195d,{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-run-results-header-buttons']},'children':[this['_cancelButtonView'],this['_acceptAllButtonView'],this['_exitReviewButtonView'],this['_toggleDiffButtonView'],this['_finishReviewButtonView']]}]}),_0x16e94e;}['_createTitleView'](){const _0x260250=new _0x55515f(this['locale']),_0x22600a=new We();return _0x22600a['bind']('isVisible')['to'](this,'isResultReady',_0x2138bb=>!_0x2138bb),_0x260250['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-run-results-header-title-wrapper']},'children':[_0x22600a,{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-run-results-header-title-content',this['bindTemplate']['if']('isCompleted','ck-hidden',_0x32fff9=>_0x32fff9)]},'children':[{'tag':'span','attributes':{'class':['ck-ai-review-mode__check-run-results-header-title']},'children':[{'text':this['bindTemplate']['to']('headerTitle')}]},{'tag':'span','attributes':{'class':['ck-ai-review-mode__check-run-results-header-subtitle']},'children':[{'text':this['bindTemplate']['to']('headerSubtitle')}]}]},{'tag':'span','attributes':{'class':['ck-ai-review-mode__review-completed-header-title',this['bindTemplate']['if']('isCompleted','ck-hidden',_0x315d9b=>!_0x315d9b)]},'children':[{'text':i(this['locale'],'AI_REVIEW_MODE_FINISH_REVIEW_HEADER_TITLE')}]}]}),_0x260250;}['_createFinishReviewButtonView'](){const _0x139f86=new gr(this['locale']);return _0x139f86['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isCompleted','ck-hidden',_0x277b80=>!_0x277b80)]}}),_0x139f86['delegate']('finishReview')['to'](this),_0x139f86;}}class th extends _0x5f38b9{['resultsHeader'];['_finishReviewButtonView'];constructor(_0x701e1b){super(_0x701e1b),this['_finishReviewButtonView']=this['_createFinishReviewButtonView'](),this['resultsHeader']=this['_createResultHeaderView']();const _0x61c31f=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__review-completed',_0x61c31f['if']('isVisible','ck-hidden',_0x72fd61=>!_0x72fd61)]},'children':[this['resultsHeader'],{'tag':'div','attributes':{'class':['ck-ai-review-mode__review-completed-content']},'children':[{'tag':'span','attributes':{'class':['ck-ai-review-mode__review-completed-content-icon']},'children':[{'text':'👍'}]},{'tag':'p','attributes':{'class':['ck-ai-review-mode__review-completed-content-text']},'children':[{'text':i(_0x701e1b,'AI_REVIEW_MODE_EMPTY_RESULTS_TEXT')}]}]}]});}['_createFinishReviewButtonView'](){const _0x12db64=new gr(this['locale']);return _0x12db64['delegate']('finishReview')['to'](this),_0x12db64;}['_createResultHeaderView'](){const _0x253f77=new _0x55515f(this['locale']);return _0x253f77['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__review-completed-header']},'children':[{'tag':'span','attributes':{'class':['ck-ai-review-mode__review-completed-header-title']},'children':[{'text':i(this['locale'],'AI_REVIEW_MODE_FINISH_REVIEW_HEADER_TITLE')}]},{'tag':'div','attributes':{'class':['ck-ai-review-mode__review-completed-header-buttons']},'children':[this['_finishReviewButtonView']]}]}),_0x253f77;}}class hh extends _0x55515f{constructor(_0x533ff4){super(_0x533ff4),this['set']('isVisible',!0x1),this['set']('errorMessage','');const _0x16f08a=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-review-mode__general-error-container',_0x16f08a['if']('isVisible','ck-hidden',_0xed0a38=>!_0xed0a38)]},'children':[{'tag':'p','attributes':{'class':'ck\x20ck-ai-notification\x20ck-ai-notification_error'},'children':[{'text':_0x16f08a['to']('errorMessage')}]}]});}}class ve extends _0x55515f{['reviewModeHeader'];['generalErrorView'];['reviewCheckListView'];['reviewCheckResultsView'];['reviewCompletedView'];constructor(_0x40d4be){super(_0x40d4be),this['reviewModeHeader']=new _0x219fc7(_0x40d4be,{'label':i(_0x40d4be,'AI_REVIEW_MODE'),'icon':_0x406ae6,'class':'ck-ai-header\x20ck-ai-header_review-mode'}),this['generalErrorView']=new hh(_0x40d4be),this['reviewCheckListView']=new ih(_0x40d4be),this['reviewCheckListView']['delegate'](...sh)['to'](this),this['reviewCheckResultsView']=new eh(_0x40d4be),this['reviewCheckResultsView']['delegate'](...sh)['to'](this),this['reviewCompletedView']=new th(_0x40d4be),this['reviewCompletedView']['delegate']('finishReview')['to'](this),this['reviewCheckListView']['set']('isVisible',!0x1),this['reviewCheckResultsView']['set']('isVisible',!0x1),this['reviewCheckResultsView']['set']('isLoading',!0x1),this['reviewCheckResultsView']['set']('isResultReady',!0x1),this['reviewCompletedView']['set']('isVisible',!0x1),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-ai-review-mode','ck-rounded-corners'],'dir':'ltr'},'children':[this['reviewModeHeader'],this['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'](_0x5ed0c3){this['reviewCheckResultsView']['addResult'](_0x5ed0c3),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;}['showGeneralReviewModeErrorView'](_0x51ef2a){this['generalErrorView']['set']('isVisible',!0x0),this['generalErrorView']['errorMessage']=_0x51ef2a;}['showGeneralResultsErrorView'](){this['reviewCheckResultsView']['set']('isLoading',!0x1),this['showActionsWhenResultIsReady'](),this['reviewCheckResultsView']['showGeneralErrorMessage']();}['showChunkErrorView'](){this['reviewCheckResultsView']['set']('isLoading',!0x1),this['showActionsWhenResultIsReady'](),this['reviewCheckResultsView']['showChunkErrorMessage']();}}class Ie extends _0x564e6d{['resultItemView'];['_pinnedRectIndex']=void 0x0;['_pinnedTargetElement']=void 0x0;['_pinnedTargetChangeId']=void 0x0;constructor(_0x3d5efd,_0x4ea1a4){super(_0x3d5efd),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']()),_0x4ea1a4['add'](this);}['render'](){super['render'](),this['_setupClickOutsideHandler']();}['updateContent'](_0xfa778c){this['resultItemView']['changeId']=_0xfa778c['id'],this['resultItemView']['resultResponseView']['element']['innerHTML']=_0xfa778c['contentDiffed'];}['showBalloon'](_0x9e097c,_0x1d1d2e,_0x1feac4,_0x1f6639,_0x4e5e24,_0x1de224){this['_removeActiveClassFromMarkers'](),this['updateContent'](_0x9e097c),this['show']();const _0x146e81=Array['from'](_0x1d1d2e['getClientRects']())['reverse'](),_0x4967a3=this['_getPointedRectIndexFromEvent'](_0x1feac4,_0x146e81);'click'===_0x1f6639?(this['isDiffActive']=!0x0,this['_setActiveClassOnMarker'](_0x9e097c['id']),this['pin']({'target':()=>this['_getBestRectPositionOnClick'](_0x1d1d2e,_0x4967a3,_0x9e097c['id'],_0x4e5e24,_0x1de224)})):'hover'===_0x1f6639&&(this['isDiffActive']=!0x1,this['pin']({'target':()=>this['_getBestRectPositionOnHover'](_0x1d1d2e,_0x4967a3,_0x9e097c['id'])}));}['hideBalloon'](){this['hide'](),this['unpin'](),this['_removeActiveClassFromMarkers'](),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');}['_removeActiveClassFromMarkers'](){_0x3610d0['document']['querySelectorAll']('.ck-ai-review-mode__change_active')['forEach'](_0x4831fa=>{_0x4831fa['classList']['remove']('ck-ai-review-mode__change_active');});}['_setActiveClassOnMarker'](_0x3c963c){_0x3610d0['document']['querySelectorAll']('span[data-marker-id*=\x22'+_0x3c963c+'\x22]')['forEach'](_0xb4d761=>{_0xb4d761['classList']['add']('ck-ai-review-mode__change_active');});}['_setupClickOutsideHandler'](){_0x1411c6({'emitter':this,'activator':()=>this['isVisible'],'contextElements':()=>{const _0x3f8ea1=[this['element']];return this['_pinnedTargetElement']&&_0x3f8ea1['push'](this['_pinnedTargetElement']),_0x3f8ea1;},'callback':()=>{this['hide'](),this['unpin'](),this['_removeActiveClassFromMarkers'](),this['deactivateChange'](),this['_pinnedTargetElement']=void 0x0,this['_pinnedRectIndex']=void 0x0,this['_pinnedTargetChangeId']=void 0x0;}});}['_createContentView'](){const _0x1844bc=new _0x55515f();return this['resultItemView']=new Ps(this['locale'],''),this['resultItemView']['resultResponseView']['extendTemplate']({'attributes':{'class':['ck-content']}}),this['resultItemView']['delegate']('acceptChange','dismissChange')['to'](this),_0x1844bc['setTemplate']({'tag':'div','attributes':{'class':['ck-reset','ck-ai-review-mode-balloon-panel-suggestion',this['bindTemplate']['if']('isDiffActive','ck-ai-review-mode-balloon-panel-suggestion_diff-active')]},'children':[{'tag':'p','attributes':{'class':['ck-ai-review-mode__suggestion-text']},'children':[this['resultItemView']]}]}),_0x1844bc;}['_getBestRectPositionOnClick'](_0x5235d4,_0xcfb1b4,_0x25f00e,_0x26aaf7,_0x3ea770){const _0x2d9272=this['position']['replace']('arrow_',''),_0x43467b=Array['from'](_0x5235d4['getClientRects']());let _0x4edbc3,_0x536729=_0x43467b['reverse']();return void 0x0!==_0xcfb1b4&&this['_isPinnedRectVisible'](_0x536729[_0xcfb1b4],_0x26aaf7,_0x3ea770)?(_0x4edbc3=_0x536729[_0xcfb1b4],this['_pinnedRectIndex']=_0xcfb1b4):this['_isPinnedRectVisible'](_0x536729[0x0],_0x26aaf7,_0x3ea770)&&void 0x0===_0xcfb1b4?_0x4edbc3=_0x536729[0x0]:(_0x536729='s'==_0x2d9272[0x0]?[..._0x43467b]['reverse']():_0x43467b,_0x536729['forEach'](_0x420deb=>{this['_isPinnedRectVisible'](_0x420deb,_0x26aaf7,_0x3ea770)&&(_0x4edbc3=_0x420deb);})),this['_pinnedTargetChangeId']=_0x25f00e,this['_pinnedTargetElement']=_0x5235d4,_0x4edbc3||_0x5235d4['getBoundingClientRect']();}['_getBestRectPositionOnHover'](_0x201102,_0x25231b,_0x49b1a3){const _0x2e4393=Array['from'](_0x201102['getClientRects']())['reverse']();if(void 0x0===this['_pinnedRectIndex']&&void 0x0!==_0x25231b&&this['_pinnedTargetChangeId']!==_0x49b1a3)return this['_pinnedRectIndex']=_0x25231b,this['_pinnedTargetElement']=_0x201102,this['_pinnedTargetChangeId']=_0x49b1a3,_0x2e4393[_0x25231b];if(void 0x0!==this['_pinnedRectIndex']&&this['_pinnedTargetChangeId']===_0x49b1a3){if(_0x201102!==this['_pinnedTargetElement'])return Array['from'](this['_pinnedTargetElement']['getClientRects']())['reverse']()[this['_pinnedRectIndex']];return _0x2e4393[this['_pinnedRectIndex']];}return void 0x0!==_0x25231b&&this['_pinnedTargetChangeId']!==_0x49b1a3?(this['_pinnedRectIndex']=_0x25231b,this['_pinnedTargetElement']=_0x201102,this['_pinnedTargetChangeId']=_0x49b1a3,_0x2e4393[_0x25231b]):_0x201102['getBoundingClientRect']();}['_getPointedRectIndexFromEvent'](_0x437c91,_0x5cf67b){if(_0x437c91)for(let _0xdf5d3a=0x0;_0xdf5d3a<_0x5cf67b['length'];_0xdf5d3a++){const _0x18d39b=_0x5cf67b[_0xdf5d3a];if(_0x437c91['clientX']>=_0x18d39b['left']-0x3&&_0x437c91['clientX']<=_0x18d39b['right']+0x3&&_0x437c91['clientY']>=_0x18d39b['top']-0x3&&_0x437c91['clientY']<=_0x18d39b['bottom']+0x3)return _0xdf5d3a;}}['_isPinnedRectVisible'](_0x2a5e64,_0xadca84,_0x558e10){const _0x2d94c7=new _0x2e6861(_0x2a5e64),_0xf08abe=_0xadca84||document['documentElement'],_0x120823=_0x2d94c7['getIntersection'](_0x44adda(_0x558e10)),_0x5d107f=new _0x2e6861(_0xf08abe)['getIntersection'](_0x2d94c7);return!!(_0x120823&&_0x5d107f&&_0x2d94c7['width']>0x0);}}const sh=['getReviewCheckList','runReviewCheck','abortReviewStream','toggleDiff','acceptAllChanges','leaveReviewModeResultList','activateChange','acceptChange','dismissChange','learnMore','finishReview','retryReview'];class me extends _0x53b1cd{['_reviewModeView'];['_reviewModeBalloonSuggestionItemView'];['_bodyCollection'];static get['requires'](){return[Ct];}static get['pluginName'](){return'AIReviewModeUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x29ce84){super(_0x29ce84),this['_bodyCollection']=new _0x1008b4(this['context']['locale']),this['_bodyCollection']['attachToDom'](),this['_reviewModeView']=new ve(this['context']['locale']),this['_reviewModeView']['delegate'](...sh)['to'](this),this['_reviewModeBalloonSuggestionItemView']=new Ie(this['context']['locale'],this['_bodyCollection']),this['_reviewModeBalloonSuggestionItemView']['delegate']('acceptChange','dismissChange','deactivateChange')['to'](this);}['init'](){const _0x26882b=this['context']['plugins']['get']('AITabs');_0x26882b['view']['on']('activateTab',(_0x5250d9,_0x5a9f57)=>{'reviewMode'===_0x5a9f57?this['fire']('getReviewCheckList'):this['fire']('leaveReviewMode');}),_0x26882b['view']['addTab']({'id':'reviewMode','buttonLabel':i(this['context']['locale'],'AI_REVIEW_MODE'),'buttonIcon':_0x406ae6,'order':0x0,'content':this['_reviewModeView']});}['destroy'](){this['_bodyCollection']['detachFromDom'](),super['destroy']();}['setAvailableChecks'](_0x12ccdd){this['_reviewModeView']['reviewCheckListView']['hasChecks']()||this['_reviewModeView']['reviewCheckListView']['setChecks'](_0x12ccdd),this['_reviewModeView']['showReviewCheckListView']();}['showReviewCheckList'](){this['fire']('getReviewCheckList');}['showCheckRunResults'](_0x8e2d1c){_0x8e2d1c&&('error-general'!==_0x8e2d1c['status']?'error-chunk'!==_0x8e2d1c['status']?this['_reviewModeView']['showReviewCheckResultsView']():this['showChunkErrorView']():this['showGeneralResultsErrorView']());}['showCheckRunResult'](_0x2eb29b){this['_reviewModeView']['addCheckRunResult'](_0x2eb29b);}['showGeneralResultsErrorView'](){this['_reviewModeView']['showGeneralResultsErrorView']();}['showGeneralReviewModeErrorView'](_0x3a79ae){this['_reviewModeView']['showGeneralReviewModeErrorView'](_0x3a79ae??i(this['context']['locale'],'AI_REVIEW_INITIALIZATION_ERROR_MESSAGE'));}['showChunkErrorView'](){this['_reviewModeView']['showChunkErrorView']();}['setCheckResultTitle'](_0x14e864,_0x2ae733){this['_reviewModeView']['reviewCheckResultsView']['setTitle'](_0x14e864,_0x2ae733);}['setActiveStateInResults'](_0x1920b7){this['_reviewModeView']['reviewCheckResultsView']['getResults']()['forEach'](_0x51ff55=>{_0x51ff55['id']===_0x1920b7&&_0x51ff55['setItemAsActive']();});}['resetActiveStateInResults'](){this['_reviewModeView']['reviewCheckResultsView']['getResults']()['forEach'](_0x2d713b=>_0x2d713b['setItemAsInactive']());}['updateChangeState'](_0x1adb5e,_0x4ddc4a){'accepted'===_0x4ddc4a||'rejected'===_0x4ddc4a||'outdated'===_0x4ddc4a?this['_reviewModeView']['reviewCheckResultsView']['hideResult'](_0x1adb5e,_0x4ddc4a):this['_reviewModeView']['reviewCheckResultsView']['showResult'](_0x1adb5e,_0x4ddc4a);}['showReviewCompletedView'](){this['_reviewModeView']['showReviewCompletedView']();}['showActionsWhenResultIsReady'](){this['_reviewModeView']['showActionsWhenResultIsReady']();}['showNoChangesView'](){this['_reviewModeView']['showNoChangesView']();}['hideActionsWhenResultIsReady'](){this['_reviewModeView']['hideActionsWhenResultIsReady']();}['showChangeBalloon'](_0x243804,_0x4663fc,_0x2d61fa,_0x42da2b,_0x1c605c,_0x316adb){this['_reviewModeBalloonSuggestionItemView']['showBalloon'](_0x243804,_0x4663fc,_0x2d61fa,_0x42da2b,_0x1c605c,_0x316adb);}['hideChangeBalloon'](){this['_reviewModeBalloonSuggestionItemView']['hideBalloon']();}['hideDiffInBalloon'](){this['_reviewModeBalloonSuggestionItemView']['hideDiffInBalloon']();}['showDiffInBalloon'](){this['_reviewModeBalloonSuggestionItemView']['showDiffInBalloon']();}['getChangeElement'](_0x29aabd){const _0x3768de=this['_reviewModeView']['reviewCheckResultsView']['getResults']()['find'](_0x19080b=>_0x19080b['id']===_0x29aabd);return _0x3768de?_0x3768de['element']:null;}['deactivateChange'](){this['_reviewModeBalloonSuggestionItemView']['deactivateChange']();}}const we='reviewmode-';class ce extends _0x53b1cd{static get['pluginName'](){return'AIReviewModeEditing';}static get['requires'](){return[ot,S];}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['_markers']=new Map();['_domEmitter'];['_eventEmitter'];constructor(_0x357409){super(_0x357409),this['_domEmitter']=new(_0x44280b())(),this['_eventEmitter']=new(_0x32571c())();}get['emitter'](){return this['_eventEmitter'];}['afterInit'](){const _0x2b2d49=q(this['context']);_0x2b2d49['conversion']['for']('editingDowncast')['markerToElement']({'model':we+'insert','view':(_0x5ef341,{writer:_0x3af93f})=>{const _0x1d2e53=this['_markers']['get'](_0x5ef341['markerName']),_0xcd53d9={'class':'ck-ai_review-mode-marker_add','data-marker-id':_0x5ef341['markerName']};return _0x3af93f['createUIElement']('span',_0xcd53d9,function(_0x39ca16){const _0x476ada=this['toDomElement'](_0x39ca16);return _0x476ada['innerHTML']=_0x1d2e53?.['text']||'',_0x476ada;});}}),_0x2b2d49['conversion']['for']('editingDowncast')['markerToHighlight']({'model':we+'remove-only','view':_0xac67e1=>({'classes':'ck-ai_review-mode-marker_strikethrough','attributes':{'data-marker-id':_0xac67e1['markerName']}})}),_0x2b2d49['conversion']['for']('editingDowncast')['markerToHighlight']({'model':we+'remove-context','view':_0x5b6328=>({'classes':'ck-ai_review-mode-marker_underline','attributes':{'data-marker-id':_0x5b6328['markerName']}})}),_0x2b2d49['conversion']['for']('editingDowncast')['markerToHighlight']({'model':we+'remove-text','view':_0x40a249=>({'classes':'ck-ai_review-mode-marker_hide','attributes':{'data-marker-id':_0x40a249['markerName']}})}),_0x2b2d49['conversion']['for']('dataDowncast')['markerToElement']({'model':we+'suggestion-context','view':(_0x901907,{writer:_0x1a96c0})=>_0x1a96c0['createRawElement']('span',{'class':'ck-ai_review-mode-marker_context-'+(_0x901907['isOpening']?'start':'end')})}),_0x2b2d49['conversion']['for']('downcast')['attributeToAttribute']({'model':yt,'view':_0x19a8d3}),this['_domEmitter']['listenTo'](document,'click',(_0xc0d312,_0x17f32d)=>{const _0x2fd405=_0x17f32d['target'],_0x2b45bd=this['_findMarkerElement'](_0x2fd405);if(!_0x2b45bd)return;const _0x23f65a=_0x2b45bd['getAttribute']('data-marker-id'),_0x1d007c=_0x23f65a['split'](':')['pop']()?.['split']('_')[0x0];this['_eventEmitter']['fire']('changeMarkerClick',{'markerId':_0x23f65a,'changeId':_0x1d007c,'markerElement':_0x2b45bd,'domEvent':_0x17f32d});}),this['_domEmitter']['listenTo'](document,'mouseover',(_0x56bcfe,_0x2dbe1e)=>{const _0x2e6d95=_0x2dbe1e['target'],_0x4ddfec=_0x2dbe1e['relatedTarget'];let _0x4f854b=this['_findMarkerElement'](_0x2e6d95);if(!_0x4f854b&&_0x4ddfec&&(_0x4f854b=this['_findMarkerElement'](_0x4ddfec)),!_0x4f854b)return;const _0x5bcd91=_0x4f854b['getAttribute']('data-marker-id'),_0xea77d1=_0x5bcd91['split'](':')['pop']()?.['split']('_')[0x0];this['_eventEmitter']['fire']('changeMarkerHovered',{'changeId':_0xea77d1,'markerElement':_0x4f854b,'domEvent':_0x2dbe1e});}),this['_domEmitter']['listenTo'](document,'mouseover',_0x2ffa27((_0x3821bd,_0x4162c0)=>{const _0x5ac64b=_0x4162c0['target'];if(this['_findMarkerElement'](_0x5ac64b))return;_0x5ac64b['closest']('.ck-reset.ck-ai-review-mode-balloon-panel-suggestion')||this['_eventEmitter']['fire']('changeMarkerBlurred');},0xc8)),_0x2b2d49['model']['document']['registerPostFixer'](_0x18f7f5=>this['_validateMarkers'](_0x2b2d49,_0x18f7f5)),_0x2b2d49['model']['document']['on']('change',()=>this['_handleMarkerChanges'](_0x2b2d49));}['getDocumentData'](){const _0x2c297c=this['context']['plugins']['get']('AIEditing'),_0x25ea1b=q(this['context']),_0x5d7ca2=_0x25ea1b['model'],_0x4a5345=new ht();for(const _0x33c325 of _0x5d7ca2['document']['getRoot']()['getChildren']()){const _0x1fa02b=_0x33c325['_clone'](!0x0);_0x4a5345['_appendChild'](_0x1fa02b);}for(const _0x5aa00f of _0x5d7ca2['markers'])_0x4a5345['markers']['set'](_0x5aa00f['name'],this['_changeRangeOwnerDocument'](_0x5aa00f['getRange']()['clone'](),_0x4a5345));const _0x5bcfd5=new _0x4c5bb1({'ignoreElementEnd':!0x0,'startPosition':_0x5d7ca2['createPositionAt'](_0x4a5345,0x0)}),_0x547daf=new Set(),_0x5f26c4=new Map();for(const {item:_0x3c29be}of _0x5bcfd5){if(!_0x3c29be['is']('$textProxy'))continue;const _0x455484=_0x3c29be['parent'];if(_0x455484&&_0x455484['is']('element')){const _0xad450e=this['_upsertDataId'](_0x455484,()=>_0x2c297c['_nextDataId'](_0x547daf));_0x547daf['add'](_0xad450e);for(const _0x412e97 of _0x455484['getChildren']())_0x412e97['is']('element')&&_0x547daf['add'](this['_upsertDataId'](_0x412e97,()=>_0x2c297c['_nextDataId'](_0x547daf)));let _0x3dcbe6=_0x455484;for(;_0x3dcbe6['parent']&&!_0x3dcbe6['parent']['is']('documentFragment');)_0x3dcbe6=_0x3dcbe6['parent'],_0x3dcbe6['hasAttribute'](yt)&&_0x3dcbe6['_removeAttribute'](yt);_0x5f26c4['set'](_0xad450e,{'path':_0x455484['getPath'](),'getContent':this['_createGetContentUsingDataIdFn'](_0x3dcbe6['_clone'](!0x0),_0xad450e,_0x25ea1b['data'])}),_0x5bcfd5['jumpTo'](_0x5d7ca2['createPositionAfter'](_0x455484));}}return{'content':_0x25ea1b['data']['processor']['toData'](_0x25ea1b['data']['toView'](_0x4a5345)),'version':_0x25ea1b['model']['document']['version'],'elements':_0x5f26c4};}['diffContent'](_0x47c758,_0x3cff6d){const _0x251ddc=[],_0x36ba03=q(this['context']),_0x24dd6b=_0x36ba03['data']['parse'](_0x3cff6d,'$documentFragment'),_0x1c4fab=_0x36ba03['data']['parse'](_0x47c758,'$documentFragment'),_0x1390d3=_0x36ba03['model']['createPositionAt'](_0x1c4fab,0x0);if(this['_haveSingleTopLevelElement'](_0x24dd6b)){if(!this['_hasSameTopLevelElement'](_0x1c4fab,_0x24dd6b))return _0x251ddc;}else{const _0x5cc3b5=_0x36ba03['model']['schema'];if(!this['_haveOnlyInlineContent'](_0x1c4fab,_0x5cc3b5)||!this['_haveOnlyInlineContent'](_0x24dd6b,_0x5cc3b5))return _0x251ddc;}const _0x5855f6=this['context']['plugins']['get']('DocumentCompare')['getDiff'](_0x47c758,_0x3cff6d,{'anchor':_0x1390d3,'markDeletions':!0x0})['getOperations']()['filter'](_0x19cd0c=>'insert'===_0x19cd0c['type']||'marker'===_0x19cd0c['type']&&_0x19cd0c['name']['startsWith']('$markedRemove')),_0x52b7ca=this['_groupAdjacentOperations'](_0x5855f6);let _0x584cc4=0x0;return _0x36ba03['model']['change'](_0x5caa7d=>{for(let _0x3db8c6=0x0;_0x3db8c6<_0x52b7ca['length'];_0x3db8c6++){const _0x40c642=_0x52b7ca[_0x3db8c6],_0x2c1a1a=_0x5caa7d['createDocumentFragment']();for(const _0x2066fd of _0x1c4fab['getChildren']())_0x5caa7d['append'](_0x2066fd['_clone'](!0x0),_0x2c1a1a);for(const _0x24796c of _0x40c642['operationsIsolated'])if('insert'===_0x24796c['type']){const _0x3a500f=_0x24796c;_0x3a500f['baseVersion']=null,_0x3a500f['isDocumentOperation']=!0x1,this['_changeOperationOwnerDocument'](_0x3a500f,_0x2c1a1a),_0x5caa7d['batch']['addOperation'](_0x24796c),_0x36ba03['model']['applyOperation'](_0x24796c);const _0x4c55be='suggestion:insertion:id:authorId:'+_0x584cc4++,_0x31f6c1=_0x36ba03['model']['createRange'](_0x3a500f['position'],_0x3a500f['position']['getShiftedBy'](_0x3a500f['howMany']));_0x2c1a1a['markers']['set'](_0x4c55be,_0x31f6c1);}else{if('marker'===_0x24796c['type']&&_0x24796c['name']['startsWith']('$markedRemove')){const _0x5cbbcd=_0x24796c,_0x5e049c='suggestion:deletion:id:authorId:'+_0x584cc4++;this['_changeOperationOwnerDocument'](_0x5cbbcd,_0x2c1a1a),_0x2c1a1a['markers']['set'](_0x5e049c,_0x5cbbcd['newRange']);}}const _0x563dfb=this['_getChangeContext'](this['_changePositionOwnerDocument'](this['_getOperationStart'](_0x40c642['operationsIsolated'][0x0]),_0x2c1a1a),this['_changePositionOwnerDocument'](this['_getOperationEnd'](_0x40c642['operationsIsolated'][_0x40c642['operationsIsolated']['length']-0x1]),_0x2c1a1a));_0x2c1a1a['markers']['set'](we+'suggestion-context',new ct(_0x563dfb['start'],_0x563dfb['end'])),_0x251ddc['push']({..._0x40c642,'context':this['_createGetContextFn'](_0x2c1a1a,_0x36ba03['data'],{'ellipsisBefore':_0x563dfb['hasContentBefore'],'ellipsisAfter':_0x563dfb['hasContentAfter']}),'content':this['_createGetContentFn'](_0x2c1a1a,_0x36ba03['data'])});}}),_0x251ddc;}['markChangePositionInEditorContent'](_0x7591c9,_0x2c2df2){if(!_0x7591c9['length'])return;const _0x2acf58=_0x7591c9[0x0]['parent']['id'],_0x3c424e=_0x2c2df2['elements']['get'](_0x2acf58);if(!_0x3c424e)return void console['warn']('No\x20element\x20found\x20for\x20ID:\x20'+_0x2acf58);const _0xb17426=_0x3c424e['path'],_0x4c168c=q(this['context']),_0x240cfe=_0x4c168c['model']['document']['history']['getOperations'](_0x2c2df2['version']),_0x258329=[];for(const _0x3cc7fb of _0x7591c9){const _0x59eb34=_0x3cc7fb['operationsIsolated']['map'](_0x30df6c=>this['_translateOperationToEditorContent'](_0x30df6c,_0xb17426,_0x4c168c['model']['document']['getRoots']()[0x0]));if(!_0x59eb34||!_0x59eb34['length'])continue;const _0x24b52f=_0x59eb34['every'](_0x2ef85f=>'marker'===_0x2ef85f['type']&&_0x2ef85f['name']['startsWith']('$markedRemove')),_0x5d83f7={'document':_0x4c168c['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1},_0x4b9697=gt(_0x59eb34,_0x240cfe,_0x5d83f7)['operationsA'];for(const _0x260a39 of _0x4b9697)if('insert'===_0x260a39['type']){const _0x17b4d4=_0x260a39,_0x4927b4=_0x17b4d4['nodes'];let _0x73705d='';for(const _0x324f2d of _0x4927b4)_0x324f2d&&_0x324f2d['is']('model:$text')&&(_0x73705d+=_0x324f2d['data']);_0x258329['push']({'start':_0x17b4d4['position'],'end':_0x17b4d4['position'],'type':'insert','groupId':_0x3cc7fb['id'],'text':_0x73705d});}else{if('marker'===_0x260a39['type']&&_0x260a39['name']['startsWith']('$markedRemove')){const _0x1d18e2=_0x260a39;let _0x372b96='remove-text';if(_0x24b52f){const _0x7c19a5=this['_findAdjacentContextDistance'](_0x1d18e2['newRange']['start'],'backward',_0x4c168c['model']['schema']),_0x2c7e4c=this['_findAdjacentContextDistance'](_0x1d18e2['newRange']['end'],'forward',_0x4c168c['model']['schema']);if(_0x7c19a5||_0x2c7e4c){const _0x3da153=_0x1d18e2['newRange']['start']['getShiftedBy'](-_0x7c19a5),_0x5594be=_0x1d18e2['newRange']['end']['getShiftedBy'](_0x2c7e4c);_0x258329['push']({'start':_0x3da153,'end':_0x5594be,'groupId':_0x3cc7fb['id'],'type':'remove-context'});}else _0x372b96='remove-only';}_0x258329['push']({'start':_0x1d18e2['newRange']['start'],'end':_0x1d18e2['newRange']['end'],'groupId':_0x3cc7fb['id'],'type':_0x372b96});}}}this['_insertMarkers'](_0x258329);}['clearAllMarkers'](){const _0x3cc643=q(this['context']);_0x3cc643['model']['change'](_0x1feb26=>{for(const _0x3e21cf of this['_markers']['keys']())_0x3cc643['model']['markers']['get'](_0x3e21cf)&&_0x1feb26['removeMarker'](_0x3e21cf);}),this['_markers']['clear']();}['switchToReadOnly'](){q(this['context'])['enableReadOnlyMode']('ai-review-mode');}['switchToEdit'](){q(this['context'])['disableReadOnlyMode']('ai-review-mode');}['applyChange'](_0x282ad6){const _0x21dcc2=q(this['context']),_0x5d5d54=_0x21dcc2['model'],_0x4ab75c=_0x282ad6['map'](_0x23e607=>this['_getMarkersDataForGroup'](_0x23e607))['flat']();_0x5d5d54['change'](_0x36fac6=>{for(const _0x3c2611 of _0x4ab75c){const _0x219617=_0x21dcc2['model']['markers']['get'](_0x3c2611['id']);_0x219617&&('insert'===_0x3c2611['type']?_0x5d5d54['insertContent'](_0x36fac6['createText'](_0x3c2611['text']||''),_0x219617['getRange']()['start']):'remove-text'!==_0x3c2611['type']&&'remove-only'!==_0x3c2611['type']||_0x5d5d54['deleteContent'](_0x5d5d54['createSelection'](_0x219617['getRange']())),_0x36fac6['removeMarker'](_0x3c2611['id']),this['_markers']['delete'](_0x3c2611['id']));}});}['rejectChange'](_0x461bfc){const _0x54939a=q(this['context']),_0x33204f=this['_getMarkersDataForGroup'](_0x461bfc);_0x54939a['model']['change'](_0x336b2f=>{for(const _0x43589d of _0x33204f)_0x336b2f['removeMarker'](_0x43589d['id']),this['_markers']['delete'](_0x43589d['id']);});}['getEditor'](){return q(this['context']);}['getMarkerElementForChange'](_0xb02fca){const _0x41865c=Array['from'](this['_markers']['values']())['filter'](_0x32e78b=>_0x32e78b['groupId']===_0xb02fca);if(!_0x41865c['length'])return null;const _0x347a7d=0x1===_0x41865c['length']?_0x41865c[0x0]:this['_sortMarkers'](_0x41865c)[0x0],_0x58ac8e=q(this['context']),_0x5ac5a0=_0x58ac8e['model']['markers']['get'](_0x347a7d['id']);if(!_0x5ac5a0)return null;const _0x2b53b7=_0x5ac5a0['getRange'](),_0x2d591c=_0x58ac8e['editing']['view']['getDomRoot']();if(!_0x2d591c||!_0x2b53b7)return null;const _0x1d5ab9=_0x2d591c['querySelector']('[data-marker-id=\x22'+_0x347a7d['id']+'\x22]');return _0x1d5ab9?{'modelRange':_0x2b53b7,'domElement':_0x1d5ab9}:null;}['_validateMarkers'](_0x374843,_0x3ce92d){const _0x39f7bc=Array['from'](this['_markers']['keys']()),_0x121ef8=new Map();for(const _0x5d6c45 of _0x39f7bc){const _0x3405f1=_0x374843['model']['markers']['get'](_0x5d6c45);if(!_0x3405f1)continue;const _0x3846ed=_0x3405f1['getStart']()['path'][0x0];_0x121ef8['has'](_0x3846ed)||_0x121ef8['set'](_0x3846ed,[]),_0x121ef8['get'](_0x3846ed)['push'](_0x3405f1);}const _0x3c4423=new Set();for(const _0x5527dc of _0x374843['model']['document']['differ']['getChanges']()){let _0x1488c8=-0x1,_0x51b1e7=null;if('insert'===_0x5527dc['type'])_0x51b1e7=new ct(_0x5527dc['position'],_0x5527dc['position']['getShiftedBy'](_0x5527dc['length'])),_0x1488c8=_0x5527dc['position']['path'][0x0];else{if('remove'!==_0x5527dc['type'])continue;_0x51b1e7=new ct(_0x5527dc['position']),_0x1488c8=_0x5527dc['position']['path'][0x0];}const _0x3400fb=_0x121ef8['get'](_0x1488c8)||[];if(_0x3400fb['length']){for(const _0x43a3a2 of _0x3400fb)if(_0x51b1e7['root']['rootName']===_0x43a3a2['getRange']()['root']['rootName']&&('insert'!==_0x5527dc['type']||!_0x51b1e7['containsRange'](_0x43a3a2['getRange']()))&&(_0x51b1e7['isIntersecting'](_0x43a3a2['getRange']())||_0x51b1e7['start']['isTouching'](_0x43a3a2['getRange']()['end'])||_0x51b1e7['end']['isTouching'](_0x43a3a2['getRange']()['start']))){const _0x210cf8=this['_parseMarkerName'](_0x43a3a2['name']);Array['from'](this['_markers']['values']())['filter'](_0xc53581=>_0xc53581['groupId']===_0x210cf8['groupId'])['forEach'](_0x1f14ad=>_0x3c4423['add'](_0x1f14ad['id']));}}}if(_0x3c4423['size']){for(const _0x3f3310 of _0x3c4423)_0x3ce92d['removeMarker'](_0x3f3310);return!0x0;}return!0x1;}['_handleMarkerChanges'](_0x2df423){for(const {name:_0x49728a,data:_0x12041a}of _0x2df423['model']['document']['differ']['getChangedMarkers']()){if(!_0x49728a['startsWith'](we))continue;const _0x55761f=_0x12041a['oldRange'],_0x5bcb83=_0x12041a['newRange'],_0x36269d=_0x55761f&&'$graveyard'===_0x55761f['root']['rootName'],_0x523269=_0x5bcb83&&'$graveyard'===_0x5bcb83['root']['rootName'];if(_0x36269d&&_0x523269)continue;const _0x4710c3=this['_parseMarkerName'](_0x49728a);this['_markers']['get'](_0x49728a)&&(_0x523269||!_0x5bcb83?this['_eventEmitter']['fire']('changeMarkerRemoved',{'markerId':_0x49728a,'changeId':_0x4710c3['groupId']}):_0x36269d&&_0x5bcb83&&this['_eventEmitter']['fire']('changeMarkerRestored',{'markerId':_0x49728a,'changeId':_0x4710c3['groupId']}));}}['_parseMarkerName'](_0xa53a87){const _0x500186=_0xa53a87['split'](':'),_0x42c2b5=(_0x500186[0x1]||'')['split']('_');return{'prefix':_0x500186[0x0],'groupId':_0x42c2b5[0x0],'suffix':_0x42c2b5[0x1]};}['_translateOperationToEditorContent'](_0x380f4d,_0x3ad127,_0xca30a8){if('insert'===_0x380f4d['type']){const _0x22657a=_0x380f4d;return new _0x1187e5(this['_changePosition'](_0x3ad127['concat'](_0x22657a['position']['offset']),_0xca30a8),_0x22657a['nodes'],_0x22657a['baseVersion']);}if('marker'===_0x380f4d['type']&&_0x380f4d['name']['startsWith']('$markedRemove')){const _0x199f9e=_0x380f4d;return new _0x192ebd(_0x199f9e['name'],_0x199f9e['oldRange'],this['_changeRange'](_0x199f9e['newRange'],_0x3ad127['concat'](_0x199f9e['newRange']['start']['offset']),_0x3ad127['concat'](_0x199f9e['newRange']['end']['offset']),_0xca30a8),_0x199f9e['_markers'],_0x199f9e['affectsData'],_0x199f9e['baseVersion']);}return _0x380f4d;}['_groupAdjacentOperations'](_0xf6d82e){if(!_0xf6d82e['length'])return[];const _0x44fa4e=[];let _0x40d412=0x0,_0x348aee=0x0,_0x20ab0a=[];for(let _0x2d080b=0x0;_0x2d080b<=_0xf6d82e['length'];_0x2d080b++){const _0x39c4e4=_0xf6d82e[_0x2d080b],_0x2ead75=_0xf6d82e[_0x2d080b-0x1];!_0x39c4e4||_0x2ead75&&!this['_getOperationEnd'](_0x2ead75)['isTouching'](this['_getOperationStart'](_0x39c4e4))?(_0x44fa4e['push']({'operations':_0x20ab0a,'operationsIsolated':_0x20ab0a['map'](_0x141bf5=>this['_shiftOperation'](_0x141bf5['clone'](),-_0x348aee)),'groupOffset':_0x40d412}),_0x20ab0a=_0x39c4e4?[_0x39c4e4]:[],_0x348aee+=_0x40d412,_0x40d412=0x0):_0x20ab0a['push'](_0x39c4e4),_0x39c4e4&&'insert'===_0x39c4e4['type']&&(_0x40d412+=_0x39c4e4['howMany']);}return _0x44fa4e;}['_findAdjacentContextDistance'](_0x5d6fa0,_0x59f5aa,_0x101532,_0x70d232=0x1){const _0x29dd09=new _0x4c5bb1({'startPosition':_0x5d6fa0,'direction':_0x59f5aa});let _0x46f558=0x0;for(let _0x3240f8=0x0;_0x3240f8<_0x70d232;_0x3240f8++){let _0x11b961=0x0,_0x4c99f4=!0x1,_0x290196='forward'===_0x59f5aa?/^\W*\w+/:/\w+\W*$/;for(const {item:_0x552124}of _0x29dd09)if(_0x552124['is']('$textProxy')){const _0x2173c6=_0x290196['exec'](_0x552124['data']);if(_0x2173c6&&_0x2173c6['length']){if(_0x11b961+='forward'===_0x59f5aa?_0x2173c6['index']+_0x2173c6[0x0]['length']:_0x552124['data']['length']-_0x2173c6['index'],_0x2173c6[0x0]['length']!==_0x552124['data']['length'])break;_0x4c99f4=!0x0,_0x290196='forward'===_0x59f5aa?/^\w+/:/\w+$/;}else{if(_0x4c99f4)break;_0x11b961+=_0x552124['offsetSize'];}}else{if(_0x552124['is']('element')){_0x101532['isInline'](_0x552124)&&!_0x4c99f4&&(_0x11b961+=0x1);break;}}_0x46f558+=_0x11b961,_0x29dd09['jumpTo'](_0x5d6fa0['getShiftedBy']('forward'===_0x59f5aa?_0x46f558:-_0x46f558));}return _0x46f558;}['_getChangeContext'](_0x374324,_0x1ae259){const _0x3478cb=q(this['context'])['model']['schema'],_0x5b3fb0=this['_findAdjacentContextDistance'](_0x374324,'backward',_0x3478cb,0x6),_0xb4ab72=this['_findAdjacentContextDistance'](_0x1ae259,'forward',_0x3478cb,0x6),_0x1216ec=_0x374324['getShiftedBy'](-_0x5b3fb0),_0x33ea47=_0x1ae259['getShiftedBy'](_0xb4ab72);return{'start':_0x1216ec,'end':_0x33ea47,'hasContentBefore':!_0x1216ec['isAtStart'],'hasContentAfter':!_0x33ea47['isAtEnd']};}['_insertMarkers'](_0x5603ee){const _0x4ec361=this['context']['plugins']['get']('AIEditing'),_0x651a46=new Set();q(this['context'])['model']['change'](_0x380138=>{for(const _0x55341a of _0x5603ee){const _0x153a57=''+we+_0x55341a['type']+':'+_0x55341a['groupId']+'_'+_0x4ec361['_nextDataId'](_0x651a46);this['_markers']['set'](_0x153a57,{'id':_0x153a57,'groupId':_0x55341a['groupId'],'type':_0x55341a['type'],'text':_0x55341a['text']}),_0x380138['addMarker'](_0x153a57,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x380138['createRange'](_0x55341a['start'],_0x55341a['end'])});}});}['_createGetContextFn'](_0x44e135,_0x2675d6,_0x399123){let _0x4ba2d1='';return()=>{if(!_0x4ba2d1){const _0x46edb4=_0x2675d6['toView'](_0x44e135,{'showSuggestionHighlights':!0x0});let _0x137a43=_0x46edb4['getChild'](0x0);if(_0x137a43['is']('containerElement')||(_0x137a43=_0x46edb4),!_0x137a43)return'';let _0x439f33=!0x1;const _0x437288=[];for(const _0x1e9fb1 of _0x137a43['getChildren']())_0x1e9fb1['is']('element','span')&&_0x1e9fb1['hasClass']('ck-ai_review-mode-marker_context-end')&&(_0x439f33=!0x1),_0x439f33&&_0x437288['push'](_0x1e9fb1),_0x1e9fb1['is']('element','span')&&_0x1e9fb1['hasClass']('ck-ai_review-mode-marker_context-start')&&(_0x439f33=!0x0);_0x137a43['_removeChildren'](0x0,_0x137a43['childCount']),_0x399123?.['ellipsisBefore']&&_0x137a43['_appendChild']('…'),_0x137a43['_appendChild'](_0x437288),_0x399123?.['ellipsisAfter']&&_0x137a43['_appendChild']('…');const _0x2fc2ca=_0x2675d6['htmlProcessor']['domConverter']['viewToDom'](_0x46edb4),_0x2d3710=_0x2675d6['htmlProcessor']['htmlWriter']['getHtml'](_0x2fc2ca);_0x4ba2d1=_0x2d3710;}return _0x4ba2d1;};}['_createGetContentFn'](_0x3e4340,_0x236358){let _0x31d372='';return()=>(_0x31d372||(_0x31d372=_0x236358['stringify'](_0x3e4340,{'showSuggestionHighlights':!0x0})),_0x31d372);}['_createGetContentUsingDataIdFn'](_0x41ecd8,_0x174937,_0x49435b){let _0x3fd578='';return()=>{if(!_0x3fd578){const _0x178a85=_0x49435b['toView'](new ht(_0x41ecd8)),_0x2c5a37=_0x49435b['htmlProcessor']['domConverter']['viewToDom'](_0x178a85)['querySelector']('[data-id=\x22'+_0x174937+'\x22]');_0x3fd578=_0x2c5a37?.['outerHTML']||'';}return _0x3fd578;};}['_findMarkerElement'](_0x15a820,_0xcaeeb0=0x5){let _0x2bf355=_0x15a820,_0x6402d6=null;for(let _0x3e5d75=0x0;_0x3e5d75<_0xcaeeb0&&_0x2bf355;_0x3e5d75++){if(!_0x2bf355['className']){_0x2bf355=_0x2bf355['parentElement'];continue;}if(!(''+_0x2bf355['className'])['includes']('ck-ai_review-mode-marker_')){_0x2bf355=_0x2bf355['parentElement'];continue;}if(!_0x2bf355['getAttribute']('data-marker-id'))break;_0x6402d6=_0x2bf355;break;}return _0x6402d6;}['_getMarkersDataForGroup'](_0x23c8a9){return Array['from'](this['_markers']['values']())['filter'](_0x4dc48d=>_0x4dc48d['groupId']===_0x23c8a9);}['_getOperationStart'](_0x1a39a1){return'insert'===_0x1a39a1['type']?_0x1a39a1['position']:_0x1a39a1['newRange']['start'];}['_getOperationEnd'](_0x2e1112,_0x247d6a=!0x1){return'insert'===_0x2e1112['type']?_0x247d6a?_0x2e1112['position']:_0x2e1112['position']['getShiftedBy'](_0x2e1112['howMany']):_0x2e1112['newRange']['end'];}['_shiftOperation'](_0x737d1e,_0x420c8f){return'insert'===_0x737d1e['type']?_0x737d1e['position']=_0x737d1e['position']['getShiftedBy'](_0x420c8f):'marker'===_0x737d1e['type']&&_0x737d1e['newRange']&&(_0x737d1e['newRange']=new ct(_0x737d1e['newRange']['start']['getShiftedBy'](_0x420c8f),_0x737d1e['newRange']['end']['getShiftedBy'](_0x420c8f))),_0x737d1e;}['_changeOperationOwnerDocument'](_0x36f29a,_0x2c7865){'insert'===_0x36f29a['type']?_0x36f29a['position']=this['_changePositionOwnerDocument'](_0x36f29a['position'],_0x2c7865):'marker'===_0x36f29a['type']&&_0x36f29a['newRange']&&(_0x36f29a['newRange']=this['_changeRangeOwnerDocument'](_0x36f29a['newRange'],_0x2c7865));}['_changePositionOwnerDocument'](_0x51ada0,_0x5d835e){return new lt(_0x5d835e,_0x51ada0['path']);}['_changeRangeOwnerDocument'](_0x18790c,_0x101ef9){return new ct(this['_changePositionOwnerDocument'](_0x18790c['start'],_0x101ef9),this['_changePositionOwnerDocument'](_0x18790c['end'],_0x101ef9));}['_changePosition'](_0x73890c,_0x4fe27c){return new lt(_0x4fe27c,[..._0x73890c]);}['_changeRange'](_0x4e1ea5,_0x13e97a,_0x5d0ed1,_0x12a86d){return new ct(this['_changePosition'](_0x13e97a,_0x12a86d),this['_changePosition'](_0x5d0ed1,_0x12a86d));}['_sortMarkers'](_0x4d7762){const _0x437046=_0x2a1d3e=>{switch(_0x2a1d3e){case'insert':return 0x1;case'remove-context':return 0x2;case'remove-only':return 0x3;case'remove-text':return 0x4;}};return _0x4d7762['sort']((_0x5ae045,_0x5905c2)=>_0x437046(_0x5ae045['type'])-_0x437046(_0x5905c2['type']));}['_hasSameTopLevelElement'](_0x50767c,_0x427e51){const _0x4e61cc=_0x50767c['getChild'](0x0),_0x480efc=_0x427e51['getChild'](0x0);return!(!_0x4e61cc||!_0x480efc)&&((!_0x4e61cc['is']('element')||!_0x480efc['is']('element')||_0x4e61cc['name']===_0x480efc['name'])&&!(_0x4e61cc['is']('element')&&!_0x480efc['is']('element')||!_0x4e61cc['is']('element')&&_0x480efc['is']('element')));}['_haveSingleTopLevelElement'](_0x12eb3f){return 0x1===_0x12eb3f['childCount'];}['_haveOnlyInlineContent'](_0x277a8d,_0x47c284){for(const _0x47f632 of _0x277a8d['getChildren']())if(_0x47f632['is']('element')&&!_0x47c284['isInline'](_0x47f632))return!0x1;return!0x0;}['_upsertDataId'](_0x5f3c6d,_0x300d25){let _0x5c4092=_0x5f3c6d['getAttribute'](yt);return _0x5c4092||(_0x5c4092=_0x300d25(),_0x5f3c6d['_setAttribute'](yt,_0x5c4092)),_0x5c4092;}}class Ga extends _0x53b1cd{static get['requires'](){return[re,me,ce];}static get['pluginName'](){return'AIReviewMode';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}export{ri as AIActions,K as AIAdapter,$n as AIAssistant,n as AIAssistantUI,st as AIBalloon,Da as AIChat,mt as AIChatController,pt as AIChatHistory,jt as AIChatHistoryController,xt as AIChatHistoryUI,dt as AIChatUI,R as AIConnector,S as AIEditing,Ma as AIEditorIntegration,Gt as AIQuickActionType,Va as AIQuickActions,ii as AIQuickActionsUI,tr as AIRequestError,js as AIReviewCheck,Rs as AIReviewCheckResult,zs as AIReviewCheckRun,Ga as AIReviewMode,re as AIReviewModeController,ce as AIReviewModeEditing,me as AIReviewModeUI,Ct as AITabs,pe as AITextAdapter,qt as AIToggleButtonUI,Xn as AWSTextAdapter,Qn as OpenAITextAdapter,E as ShowAIAssistantCommand,co as ToggleAICommand,ks as createResizeButton,qn as getDefaultAICommands};
|