@ckeditor/ckeditor5-ai 47.7.2 → 47.7.3-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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/aiballoonview.js +1 -1
- package/src/aichat/aichat.js +1 -1
- package/src/aichat/aichatballoon.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/aichatballoonview.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/aichatfeedcustomelementview.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/aichatshortcuts/aichatshortcuts.js +1 -1
- package/src/aichatshortcuts/ui/aichatshortcutsview.js +1 -1
- package/src/aichatshortcuts/ui/aichatshortcutview.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/aisuggestioncontentpartheaderview.js +1 -1
- package/src/aicore/ui/suggestioncontainer/aisuggestioncontentpartstateview.js +1 -1
- package/src/aicore/ui/suggestioncontainer/aisuggestioncontentparttoolbarview.js +1 -1
- package/src/aicore/ui/suggestioncontainer/aisuggestioncontentpartview.js +1 -1
- package/src/aicore/ui/suggestioncontainer/aisuggestionheaderview.js +1 -1
- package/src/aicore/ui/suggestioncontainer/aisuggestionloaderview.js +1 -1
- package/src/aicore/ui/suggestioncontainer/aisuggestionstreamablecontentview.js +1 -1
- package/src/aicore/ui/suggestioncontainer/aiwebsourcesview.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/balloon/aiactionsballoondisclaimerview.js +1 -1
- package/src/aiquickactions/ui/balloon/aiactionsballoontoolbarview.js +1 -1
- package/src/aiquickactions/ui/balloon/aiactionsballoonview.js +1 -1
- package/src/aiquickactions/ui/dropdownmenubuttonwithhighlightview.js +1 -1
- package/src/aireviewcore/aireviewcorecontroller.js +1 -1
- package/src/aireviewcore/aireviewcoreediting.js +1 -1
- package/src/aireviewcore/aireviewcoreui.js +1 -1
- package/src/aireviewcore/model/aireviewcheck.js +1 -1
- package/src/aireviewcore/model/aireviewchecklist.js +1 -1
- package/src/aireviewcore/model/aireviewcheckresult.js +1 -1
- package/src/aireviewcore/model/aireviewcheckresultchange.js +1 -1
- package/src/aireviewcore/model/aireviewcheckrun.js +1 -1
- package/src/aireviewcore/model/aireviewsystemcheckrun.js +1 -1
- package/src/aireviewcore/ui/aireviewcoreballoonsuggestionview.js +1 -1
- package/src/aireviewcore/ui/aireviewcorechecklistitemresultview.js +1 -1
- package/src/aireviewcore/ui/aireviewcorecustomcheckview.js +1 -1
- package/src/aireviewcore/ui/aireviewcorefinishreviewbuttonview.js +1 -1
- package/src/aireviewcore/ui/aireviewcoregeneralerrorview.js +1 -1
- package/src/aireviewcore/ui/aireviewcorepromptinputview.js +1 -1
- package/src/aireviewcore/ui/aireviewcorereviewchecklistview.js +1 -1
- package/src/aireviewcore/ui/aireviewcorereviewcommandlistitemview.js +1 -1
- package/src/aireviewcore/ui/aireviewcorereviewcompletedview.js +1 -1
- package/src/aireviewcore/ui/aireviewcoreuicheckresultsview.js +1 -1
- package/src/aireviewcore/ui/aireviewcoreview.js +1 -1
- package/src/aireviewcore/ui/form/aireviewcoreformdropdown.js +1 -1
- package/src/aireviewcore/ui/form/aireviewcoreformmanager.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/aireviewmodeui.js +1 -1
- package/src/aireviewmode/model/aireviewcheckcustom.js +1 -1
- package/src/aireviewmode/model/aireviewcheckextra.js +1 -1
- package/src/aireviewmode/model/aireviewcustomcheckrun.js +1 -1
- package/src/aireviewmode/model/aireviewextracheckrun.js +1 -1
- package/src/aireviewmode/model/aireviewmodechecklist.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/aitranslate/aitranslate.js +1 -1
- package/src/aitranslate/aitranslatecontroller.js +1 -1
- package/src/aitranslate/aitranslateui.js +1 -1
- package/src/aitranslate/model/aitranslatecheck.js +1 -1
- package/src/aitranslate/model/aitranslatechecklist.js +1 -1
- package/src/aitranslate/model/aitranslatecheckrun.js +1 -1
- package/src/aitranslate/ui/aitranslatechecklistview.js +1 -1
- package/src/aitranslate/ui/aitranslatecheckresultsview.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 _0x361c0d,Command as Lt,ContextPlugin as _0x3a5602,Editor as _0x2cda04}from'@ckeditor/ckeditor5-core/dist/index.js';import{IconCopy as _0x41a51c,IconCheck as _0x24d29c,IconError as _0xf1053e,IconSubmit as _0x40c783,IconAIHistory as Nt,IconMagicWand as _0x3699a1,IconRobotPencil as _0x152ed0,IconMaximize as _0x3ff106,IconMinimize as _0x2e4568,IconShowChangesOn as _0x2f2c13,IconShowChangesOff as _0x189462,IconDocument as _0x53a0ad,IconBoxWithCross as _0x1e26a1,IconBoxWithCheck as _0x327ee4,IconBoxWithMarker as _0x40fbce,IconInfo as _0x169d70,IconLoupe as _0x4c94fe,IconCancel as _0x4718d2,IconStop as _0x197784,IconAIChat as Et,IconPlus as _0x1fce8d,IconPin as _0x404f94,IconThreeHorizontalDots as _0x214ca4,IconChevronDown as _0x179898,IconChevronUp as _0x2ca36b,IconOutdated as _0x42666d,IconEye as _0x59f2c5,IconEyeCrossedOut as _0x359228,IconChevronRight as _0x215c94,IconAIReview as _0x4081d8,IconAITranslate as _0x20e0a0}from'@ckeditor/ckeditor5-icons/dist/index.js';import{uid as _0x48eb5e,CKEditorError as _0x563e6a,ObservableMixin as ts,global as _0x44426a,isVisible as _0x334b9e,Rect as _0x4b725e,Collection as _0x7916ba,FocusTracker as _0x5f2dfb,KeystrokeHandler as _0x15425,first as _0x42aa06,logWarning as _0xa8aac2,logError as _0x4e5dbd,toArray as _0x5f0c81,EmitterMixin as _0x5bd7c6,scrollViewportToShowTarget as _0x1fa956,scrollAncestorsToShowTarget as _0x54a145,ResizeObserver as _0x592694,_isMotionReduced as mt,getConstrainedViewportRect as _0x117236,DomEmitterMixin as _0x3423db}from'@ckeditor/ckeditor5-utils/dist/index.js';import{ToolbarView as _0x14c71e,ButtonView as _0x2cf640,View as _0xc3e5b1,SpinnerView as _0x559c75,IconView as _0x59b3d9,AutocompleteView as _0xf03a68,ListView as _0x163c9e,ListItemGroupView as _0x4cfb21,ListItemView as _0x663ac1,ButtonLabelView as _0x23a78e,FocusCycler as _0x1af4a5,createLabeledTextarea as _0xbfd767,Dialog as _0x3a1450,createDropdown as _0x3e48f8,addMenuToDropdown as _0x4923a2,MenuBarMenuView as _0x580086,MenuBarMenuListItemButtonView as _0x226c2e,DialogViewPosition as _0x1c5421,MenuBarMenuListView as _0x3dd394,MenuBarMenuListItemView as _0x30af6d,BodyCollection as _0x340c25,BalloonPanelView as _0x5442ef,clickOutsideHandler as _0x1d212b,addListToDropdown as _0x5aa31c,UIModel as _0x201273,submitHandler as _0x28e7fc,LabeledFieldView as _0x16298f,createLabeledInputText as th,FormHeaderView as _0x1e299f,HighlightedTextView as _0x19afdf,ViewCollection as _0xf5a45d,FileDialogButtonView as _0x538cbe,InputTextView as _0x4a24d0,SearchTextView as _0x56da7a,ListItemButtonView as _0x4e6947,ButtonLabelWithHighlightView as _0x49352c,DropdownMenuPanelPositioningFunctions as _0x3770f5,BalloonToolbar as te,FormRowView as _0x42755e,TextareaView as _0x2fe62a}from'@ckeditor/ckeditor5-ui/dist/index.js';import{ClipboardPipeline as _0x40b091,ClipboardMarkersUtils as _0x5a0b98}from'@ckeditor/ckeditor5-clipboard/dist/index.js';import{ViewDocumentDomEventData as _0x2e4e75,ViewDataTransfer as _0x181e06,ViewUpcastWriter as _0x25de84,Matcher as _0x2901ef,_DetachOperation as lt,_insertIntoModelNodeList as _0x296e10,_removeFromModelNodeList as to,ModelRange as dt,transformOperationSets as kt,ViewDowncastWriter as Dt,ModelDocumentFragment as bt,ModelPosition as vt,ModelTreeWalker as _0x1f3d99,MarkerOperation as _0x2a897f,InsertOperation as _0x4675cd}from'@ckeditor/ckeditor5-engine/dist/index.js';import{unescape as _0x4a8a27,escape as _0x528e40,escapeRegExp as _0x15b1ec,debounce as _0x49634e}from'es-toolkit/compat';import{createParser as $t}from'eventsource-parser';import{parseDocument as _0x4b17c9}from'htmlparser2';import{isTag as _0x40e032,findOne as gt,getParent as _0x4708b7,findAll as _0x4c7e33,removeElement as _0x12acc3,replaceElement as _0xd8634b,prepend as _0x4856b5,prependChild as _0x8342b6,appendChild as _0xadca60,append as _0x43ba66,find as _0x284730,isComment as _0x38b3c0,getChildren as _0x3a470b,textContent as _0x1099ea}from'domutils';import _0x17e525 from'dom-serializer';import{Document as _t,Element as _0x504ef3,Text as _0x201b94,cloneNode as _0x38bb01,isDocument as _0x82e93c,isText as _0x207546,NodeWithChildren as _0x409cd6}from'domhandler';import{MarkdownGfmMdToHtml as _0x499648}from'@ckeditor/ckeditor5-markdown-gfm/dist/index.js';import{fixElementSuggestionRange as _0x5df738,DocumentCompare as ot,DATA_ID_MODEL_ATTRIBUTE as nt,ConfirmMixin as _0x28ab1a,LateFocusDropdownButtonView as _0x3c46f6,getAllMarkersDomElementsSorted as _0x18a8b5,SuggestionsConversion as zt,DATA_ID_VIEW_ATTRIBUTE as _0x5b56f8,getMarkerDomElement as _0xce5e3b}from'ckeditor5-collaboration/dist/index.js';import{cloneDeep as _0x4f0e8d}from'es-toolkit';import _0x352e48 from'morphdom';import{IconWeb as _0xd8346c,IconClose as _0x3daaaf,IconDocument as _0x2ff8c2,IconSelection as _0x413c92,IconFileUpload as _0x4d62fe,IconLink as _0xa0ac3e,IconBulb as _0xd8dd72,IconAI as _0x51d4bb,IconPreviousArrow as _0x5d4f8c,IconCheck as _0x2b7211,IconDocumentOutline as _0x5313d0,IconPaperClip as _0x3b2e9c,IconBrowseFiles as _0x3e59fd,IconDropdownArrow as _0x468b06,IconAIChat as _0x382801,IconAIReview as _0x17e3b2,IconAITranslate as Vt,IconAIAskAI as _0x2ab699,IconThumbUp as _0x2ea5c6,IconThumbDown as _0x427eb3,IconCopy as _0x571e92,IconShowChangesOff as _0x1c481d,IconShowChangesOn as _0x339447,IconAIQuickActions as yt,IconAIChatCommands as Gt,IconAIImproveWriting as Bt,IconAIContinueWriting as Ft,IconAIGrammarCheck as Wt,IconAIAdjustLength as Kt,IconAIChangeTone as Yt,IconAIOther as Jt,IconRefresh as _0x42e42d,IconNextArrow as _0x254ba8}from'@ckeditor/ckeditor5-icons/dist/index.js';import{diffArrays as _0x411a1f}from'diff';const x='_ungrouppedCommands';function o(_0x305070,_0x160d43){const _0x51eecc=(0x0,_0x160d43['t'])('Other');return _0x305070['length']?'groupId'in _0x305070[0x0]?_0x305070:[{'groupId':x,'groupLabel':_0x51eecc,'order':0x1/0x0,'commands':_0x305070}]:[{'groupId':x,'groupLabel':_0x51eecc,'order':0x1/0x0,'commands':[]}];}const Gn=globalThis['DataTransfer'],f='ai-ui';class a extends _0x361c0d{static get['pluginName'](){return'AIAssistantEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const {editor:_0x36bd6e}=this,_0x5f3143=['ck-fake-ai-selection'];_0x36bd6e['config']['get']('ai.assistant.useTheme')&&_0x5f3143['push']('ck-ai-assistant-ui_theme'),_0x36bd6e['conversion']['for']('editingDowncast')['markerToHighlight']({'model':f,'view':{'classes':_0x5f3143,'priority':0xc}}),_0x36bd6e['conversion']['for']('editingDowncast')['markerToElement']({'model':f,'view':(_0x31d114,{writer:_0x491e8d})=>{if(!_0x31d114['markerRange']['isCollapsed'])return null;const _0x29b214=_0x491e8d['createUIElement']('span');return _0x491e8d['addClass'](['ck-fake-ai-selection','ck-fake-ai-selection_collapsed'],_0x29b214),_0x29b214;}});}['afterInit'](){!async function(_0x529653){const _0x3215ef=_0x38b0ea([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]),_0x1aaed3=0x3dffc4e1,_0x496827=0x3df84e89^_0x1aaed3,_0x226b71=window[_0x38b0ea([0x44,0x61,0x74,0x65])][_0x38b0ea([0x6e,0x6f,0x77])](),_0x2d2517=_0x529653[_0x38b0ea([0x65,0x64,0x69,0x74,0x6f,0x72])],_0x58ce3b=new window[(_0x38b0ea([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x3043a0=>{_0x2d2517[_0x38b0ea([0x6f,0x6e,0x63,0x65])](_0x38b0ea([0x72,0x65,0x61,0x64,0x79]),_0x3043a0);}),_0x55126f={[_0x38b0ea([0x6b,0x74,0x79])]:_0x38b0ea([0x45,0x43]),[_0x38b0ea([0x75,0x73,0x65])]:_0x38b0ea([0x73,0x69,0x67]),[_0x38b0ea([0x63,0x72,0x76])]:_0x38b0ea([0x50,0x2d,0x32,0x35,0x36]),[_0x38b0ea([0x78])]:_0x38b0ea([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]),[_0x38b0ea([0x79])]:_0x38b0ea([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]),[_0x38b0ea([0x61,0x6c,0x67])]:_0x38b0ea([0x45,0x53,0x32,0x35,0x36])},_0x2d55bc=_0x2d2517[_0x38b0ea([0x63,0x6f,0x6e,0x66,0x69,0x67])][_0x38b0ea([0x67,0x65,0x74])](_0x38b0ea([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79]));async function _0xc2b078(){let _0x395eaf,_0xb19453=null,_0x55399c=null;try{if(_0x2d55bc==_0x38b0ea([0x47,0x50,0x4c]))return _0x38b0ea([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]);if(_0x395eaf=_0x499965(),!_0x395eaf)return _0x38b0ea([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);return _0x395eaf[_0x38b0ea([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])]&&(_0x55399c=_0x445858(_0x395eaf[_0x38b0ea([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])],_0x395eaf[_0x38b0ea([0x6a,0x74,0x69])])),await _0x3c17b9()?_0xb68e14()?_0x379427()?_0x38b0ea([0x45,0x78,0x70,0x69,0x72,0x65,0x64]):_0x5ee40e()?(_0x395eaf[_0x38b0ea([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x38b0ea([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e])&&(_0xb19453=_0x5ade40(_0x38b0ea([0x45,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e,0x4c,0x69,0x6d,0x69,0x74]))),await _0xd7f128()):_0x38b0ea([0x44,0x6f,0x6d,0x61,0x69,0x6e,0x4c,0x69,0x6d,0x69,0x74]):_0x38b0ea([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]):_0x38b0ea([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}catch{return _0x38b0ea([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}function _0x379427(){const _0x23f30d=[_0x38b0ea([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e]),_0x38b0ea([0x74,0x72,0x69,0x61,0x6c])][_0x38b0ea([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x395eaf[_0x38b0ea([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])])?_0x226b71/0x3e8:0xe10*_0x496827;return _0x395eaf[_0x38b0ea([0x65,0x78,0x70])]<_0x23f30d;}function _0xb68e14(){const _0x26734b=_0x395eaf[_0x38b0ea([0x66,0x65,0x61,0x74,0x75,0x72,0x65,0x73])];return!!_0x26734b&&(!!_0x26734b[_0x38b0ea([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x38b0ea([0x2a]))||!!_0x26734b[_0x38b0ea([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x38b0ea([0x41,0x49])));}function _0x5ee40e(){const _0x3bf70f=_0x395eaf[_0x38b0ea([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x64,0x48,0x6f,0x73,0x74,0x73])];if(!_0x3bf70f||0x0==_0x3bf70f[_0x38b0ea([0x6c,0x65,0x6e,0x67,0x74,0x68])])return!0x0;const {hostname:_0x3a5f35}=new URL(window[_0x38b0ea([0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e])]['href']);if(_0x3bf70f[_0x38b0ea([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x3a5f35))return!0x0;const _0x5ad4b6=_0x3a5f35[_0x38b0ea([0x73,0x70,0x6c,0x69,0x74])](_0x38b0ea([0x2e]));return _0x3bf70f[_0x38b0ea([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x26540a=>_0x26540a[_0x38b0ea([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x38b0ea([0x2a])))[_0x38b0ea([0x6d,0x61,0x70])](_0x39ab84=>_0x39ab84[_0x38b0ea([0x73,0x70,0x6c,0x69,0x74])](_0x38b0ea([0x2e])))[_0x38b0ea([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x5b9324=>_0x5b9324[_0x38b0ea([0x6c,0x65,0x6e,0x67,0x74,0x68])]<=_0x5ad4b6[_0x38b0ea([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0x38b0ea([0x6d,0x61,0x70])](_0x32d6fe=>Array(_0x5ad4b6[_0x38b0ea([0x6c,0x65,0x6e,0x67,0x74,0x68])]-_0x32d6fe[_0x38b0ea([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0x38b0ea([0x66,0x69,0x6c,0x6c])](_0x32d6fe[0x0]===_0x38b0ea([0x2a])?_0x38b0ea([0x2a]):'')[_0x38b0ea([0x63,0x6f,0x6e,0x63,0x61,0x74])](_0x32d6fe))[_0x38b0ea([0x73,0x6f,0x6d,0x65])](_0x1db9da=>_0x5ad4b6[_0x38b0ea([0x65,0x76,0x65,0x72,0x79])]((_0x3b61a7,_0x45ccde)=>_0x1db9da[_0x45ccde]===_0x3b61a7||_0x1db9da[_0x45ccde]===_0x38b0ea([0x2a])));}function _0xd7f128(){return _0xb19453&&_0x55399c?new window[(_0x38b0ea([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x27465f,_0xc12655)=>{_0xb19453[_0x38b0ea([0x74,0x68,0x65,0x6e])](_0x27465f,_0xc12655),_0x55399c[_0x38b0ea([0x74,0x68,0x65,0x6e])](_0x112ee4=>{_0x112ee4!=_0x38b0ea([0x56,0x61,0x6c,0x69,0x64])&&_0x27465f(_0x112ee4);},_0xc12655);}):_0xb19453||_0x55399c||_0x38b0ea([0x56,0x61,0x6c,0x69,0x64]);}}function _0x445858(_0x118b52,_0x368355){return new window[(_0x38b0ea([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x5c5d0a=>{if(_0x4e7f3f())return _0x5c5d0a(_0x38b0ea([0x56,0x61,0x6c,0x69,0x64]));_0x2e9c1d(),_0x2d2517[_0x38b0ea([0x64,0x65,0x63,0x6f,0x72,0x61,0x74,0x65])](_0x38b0ea([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]));let _0x4d475c=!0x1;const _0x3b4f31=_0x48eb5e();function _0x20d468(_0x424ad1){return!!_0x424ad1&&(typeof _0x424ad1===_0x38b0ea([0x6f,0x62,0x6a,0x65,0x63,0x74])||typeof _0x424ad1===_0x38b0ea([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]))&&typeof _0x424ad1[_0x38b0ea([0x74,0x68,0x65,0x6e])]===_0x38b0ea([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e])&&typeof _0x424ad1[_0x38b0ea([0x63,0x61,0x74,0x63,0x68])]===_0x38b0ea([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]);}function _0x57667e(_0x4d29af){_0x5af4d1(_0x4d29af)[_0x38b0ea([0x74,0x68,0x65,0x6e])](_0x2cae4b=>{if(!_0x2cae4b||_0x2cae4b[_0x38b0ea([0x73,0x74,0x61,0x74,0x75,0x73])]!=_0x38b0ea([0x6f,0x6b]))return _0x38b0ea([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]);return _0x587310(_0x501f09(_0x3b4f31+_0x368355))!=_0x2cae4b[_0x38b0ea([0x76,0x65,0x72,0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6f,0x6e])]?_0x38b0ea([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]):_0x38b0ea([0x56,0x61,0x6c,0x69,0x64]);})[_0x38b0ea([0x74,0x68,0x65,0x6e])](_0x2d137f=>(_0x313115(),_0x2d137f),()=>{const _0x19fc6=_0x26d082();return null==_0x19fc6?(_0x313115(),_0x38b0ea([0x56,0x61,0x6c,0x69,0x64])):_0x38b0ea(_0x226b71-_0x19fc6>(0x19f340e1^_0x1aaed3)?[0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]:[0x56,0x61,0x6c,0x69,0x64]);})[_0x38b0ea([0x74,0x68,0x65,0x6e])](_0x5c5d0a)[_0x38b0ea([0x63,0x61,0x74,0x63,0x68])](()=>{_0x5c5d0a(_0x38b0ea([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});const _0x32871a=0x3dc92a61^_0x1aaed3;function _0x313115(){const _0x361bc2=_0x38b0ea([0x6c,0x6c,0x63,0x74,0x2d])+_0x587310(_0x501f09(_0x118b52)),_0x18aa49=_0x42a561(_0x587310(window[_0x38b0ea([0x4d,0x61,0x74,0x68])][_0x38b0ea([0x63,0x65,0x69,0x6c])](_0x226b71/_0x32871a)));window[_0x38b0ea([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x38b0ea([0x73,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x361bc2,_0x18aa49);}function _0x26d082(){const _0x4612b2=_0x38b0ea([0x6c,0x6c,0x63,0x74,0x2d])+_0x587310(_0x501f09(_0x118b52)),_0x4a33fe=window[_0x38b0ea([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x38b0ea([0x67,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x4612b2);return _0x4a33fe?window[_0x38b0ea([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x42a561(_0x4a33fe),0x10)*_0x32871a:null;}function _0x5af4d1(_0xa8beb8){return new window[(_0x38b0ea([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x3cf106,_0x1f94ee)=>{_0xa8beb8[_0x38b0ea([0x74,0x68,0x65,0x6e])](_0x3cf106,_0x1f94ee),window[_0x38b0ea([0x73,0x65,0x74,0x54,0x69,0x6d,0x65,0x6f,0x75,0x74])](_0x1f94ee,0x3dfe1021^_0x1aaed3);});}}_0x2d2517[_0x38b0ea([0x6f,0x6e])](_0x38b0ea([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),(_0x47771f,_0x30901e)=>{if(_0x30901e[0x0]!=_0x118b52)return _0x5c5d0a(_0x38b0ea([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));_0x30901e[0x1]={..._0x30901e[0x1],[_0x38b0ea([0x72,0x65,0x71,0x75,0x65,0x73,0x74,0x49,0x64])]:_0x3b4f31};},{[_0x38b0ea([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x38b0ea([0x68,0x69,0x67,0x68])}),_0x2d2517[_0x38b0ea([0x6f,0x6e])](_0x38b0ea([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),_0x83157c=>{_0x20d468(_0x83157c[_0x38b0ea([0x72,0x65,0x74,0x75,0x72,0x6e])])&&(_0x4d475c=!0x0,_0x57667e(_0x83157c[_0x38b0ea([0x72,0x65,0x74,0x75,0x72,0x6e])]));},{[_0x38b0ea([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x38b0ea([0x6c,0x6f,0x77])}),_0x58ce3b[_0x38b0ea([0x74,0x68,0x65,0x6e])](()=>{_0x4d475c||_0x5c5d0a(_0x38b0ea([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});});function _0x4e7f3f(){return _0x2d2517[_0x38b0ea([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x38b0ea([0x76,0x69,0x65,0x77])][_0x38b0ea([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]==_0x38b0ea([0x61,0x75,0x74,0x6f]);}function _0x2e9c1d(){_0x2d2517[_0x38b0ea([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x38b0ea([0x76,0x69,0x65,0x77])][_0x38b0ea([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]=_0x38b0ea([0x61,0x75,0x74,0x6f]);}}function _0x5ade40(_0x47206a){const _0x5801a7=[new window[(_0x38b0ea([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x30680e=>setTimeout(_0x30680e,0x3df6fa2d^_0x1aaed3)),_0x58ce3b[_0x38b0ea([0x74,0x68,0x65,0x6e])](()=>new window[(_0x38b0ea([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x74c70=>{let _0x36de49=0x0;_0x2d2517[_0x38b0ea([0x6d,0x6f,0x64,0x65,0x6c])][_0x38b0ea([0x6f,0x6e])](_0x38b0ea([0x61,0x70,0x70,0x6c,0x79,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e]),(_0x1acab6,_0x4f7e0d)=>{_0x4f7e0d[0x0][_0x38b0ea([0x69,0x73,0x44,0x6f,0x63,0x75,0x6d,0x65,0x6e,0x74,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e])]&&_0x36de49++,_0x36de49==(0x3dffc109^_0x1aaed3)&&(_0x74c70(),_0x1acab6[_0x38b0ea([0x6f,0x66,0x66])]());});}))];return window[_0x38b0ea([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65])][_0x38b0ea([0x72,0x61,0x63,0x65])](_0x5801a7)[_0x38b0ea([0x74,0x68,0x65,0x6e])](()=>_0x47206a);}async function _0x27ab30(){await _0x58ce3b,_0x2d2517[_0x38b0ea([0x6d,0x6f,0x64,0x65,0x6c])][_0x38b0ea([0x63,0x68,0x61,0x6e,0x67,0x65])]=_0x29a874,_0x2d2517[_0x38b0ea([0x6d,0x6f,0x64,0x65,0x6c])][_0x38b0ea([0x65,0x6e,0x71,0x75,0x65,0x75,0x65,0x43,0x68,0x61,0x6e,0x67,0x65])]=_0x29a874,_0x2d2517[_0x38b0ea([0x65,0x6e,0x61,0x62,0x6c,0x65,0x52,0x65,0x61,0x64,0x4f,0x6e,0x6c,0x79,0x4d,0x6f,0x64,0x65])](_0x38b0ea([0x6d,0x6f,0x64,0x65,0x6c]));}function _0xcdc8b5(_0x116b67){const _0x1239da=_0x287745();_0x2d2517[_0x1239da]=_0x38b0ea([0x61,0x69,0x4c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79])+_0x116b67,_0x116b67!=_0x38b0ea([0x56,0x61,0x6c,0x69,0x64])&&_0x27ab30();}function _0x287745(){const _0x57520c=window[_0x38b0ea([0x53,0x74,0x72,0x69,0x6e,0x67])](window[_0x38b0ea([0x70,0x65,0x72,0x66,0x6f,0x72,0x6d,0x61,0x6e,0x63,0x65])][_0x38b0ea([0x6e,0x6f,0x77])]())[_0x38b0ea([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](_0x38b0ea([0x2e]),'');let _0x460f4f=_0x38b0ea([0x6e]);for(let _0x3fcad5=0x0;_0x3fcad5<_0x57520c[_0x38b0ea([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x3fcad5+=0x2){let _0x332f4c=window[_0x38b0ea([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x57520c[_0x38b0ea([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x3fcad5,_0x3fcad5+0x2));_0x332f4c>=_0x3215ef[_0x38b0ea([0x6c,0x65,0x6e,0x67,0x74,0x68])]&&(_0x332f4c-=_0x3215ef[_0x38b0ea([0x6c,0x65,0x6e,0x67,0x74,0x68])]),_0x460f4f+=_0x3215ef[_0x332f4c];}return _0x460f4f;}function _0x499965(){const _0x3dc006=_0x2d55bc[_0x38b0ea([0x73,0x70,0x6c,0x69,0x74])](_0x38b0ea([0x2e]));if(0x3!=_0x3dc006[_0x38b0ea([0x6c,0x65,0x6e,0x67,0x74,0x68])])return null;return _0x11f70a(_0x3dc006[0x1]);function _0x11f70a(_0xce1aa4){const _0x536ac1=_0x2d3cd0(_0xce1aa4);return _0x536ac1&&_0x287082()?_0x536ac1:null;function _0x287082(){const _0x190c0c=_0x536ac1[_0x38b0ea([0x6a,0x74,0x69])],_0xf65263=window[_0x38b0ea([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x190c0c[_0x38b0ea([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x190c0c[_0x38b0ea([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8),0x10),_0x3e3fed={..._0x536ac1,[_0x38b0ea([0x6a,0x74,0x69])]:_0x190c0c[_0x38b0ea([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](0x0,_0x190c0c[_0x38b0ea([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8)};return delete _0x3e3fed[_0x38b0ea([0x76,0x63])],_0x501f09(_0x3e3fed)==_0xf65263;}}}async function _0x3c17b9(){let _0x510dc3=!0x0;try{const _0x23a8ba=_0x2d55bc[_0x38b0ea([0x73,0x70,0x6c,0x69,0x74])](_0x38b0ea([0x2e])),[_0xa6c6e7,_0x4750e4,_0x4118c6]=_0x23a8ba;return _0x53e400(_0xa6c6e7),await _0x456d8d(_0xa6c6e7,_0x4750e4,_0x4118c6),_0x510dc3;}catch{return!0x1;}function _0x53e400(_0x2f7309){const _0xf2bda2=_0x2d3cd0(_0x2f7309);_0xf2bda2&&_0xf2bda2[_0x38b0ea([0x61,0x6c,0x67])]==_0x38b0ea([0x45,0x53,0x32,0x35,0x36])||(_0x510dc3=!0x1);}async function _0x456d8d(_0x4b585d,_0x2b0850,_0x30243f){const _0x2ae8c8=window[_0x38b0ea([0x55,0x69,0x6e,0x74,0x38,0x41,0x72,0x72,0x61,0x79])][_0x38b0ea([0x66,0x72,0x6f,0x6d])](_0x126c53(_0x30243f),_0x1c4e20=>_0x1c4e20[_0x38b0ea([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](0x0)),_0x51a052=new window[(_0x38b0ea([0x54,0x65,0x78,0x74,0x45,0x6e,0x63,0x6f,0x64,0x65,0x72]))]()[_0x38b0ea([0x65,0x6e,0x63,0x6f,0x64,0x65])](_0x4b585d+_0x38b0ea([0x2e])+_0x2b0850),_0x31f17b=window[_0x38b0ea([0x63,0x72,0x79,0x70,0x74,0x6f])][_0x38b0ea([0x73,0x75,0x62,0x74,0x6c,0x65])];if(!_0x31f17b)return;const _0x161550=await _0x31f17b[_0x38b0ea([0x69,0x6d,0x70,0x6f,0x72,0x74,0x4b,0x65,0x79])](_0x38b0ea([0x6a,0x77,0x6b]),_0x55126f,{[_0x38b0ea([0x6e,0x61,0x6d,0x65])]:_0x38b0ea([0x45,0x43,0x44,0x53,0x41]),[_0x38b0ea([0x6e,0x61,0x6d,0x65,0x64,0x43,0x75,0x72,0x76,0x65])]:_0x38b0ea([0x50,0x2d,0x32,0x35,0x36])},!0x1,[_0x38b0ea([0x76,0x65,0x72,0x69,0x66,0x79])]);await _0x31f17b[_0x38b0ea([0x76,0x65,0x72,0x69,0x66,0x79])]({[_0x38b0ea([0x6e,0x61,0x6d,0x65])]:_0x38b0ea([0x45,0x43,0x44,0x53,0x41]),[_0x38b0ea([0x68,0x61,0x73,0x68])]:{[_0x38b0ea([0x6e,0x61,0x6d,0x65])]:_0x38b0ea([0x53,0x48,0x41,0x2d,0x32,0x35,0x36])}},_0x161550,_0x2ae8c8,_0x51a052)||(_0x510dc3=!0x1);}}function _0x2d3cd0(_0xe61d0b){return _0xe61d0b[_0x38b0ea([0x73,0x74,0x61,0x72,0x74,0x73,0x57,0x69,0x74,0x68])](_0x38b0ea([0x65,0x79]))?JSON[_0x38b0ea([0x70,0x61,0x72,0x73,0x65])](_0x126c53(_0xe61d0b)):null;}function _0x126c53(_0x4ab5c1){return window[_0x38b0ea([0x61,0x74,0x6f,0x62])](_0x4ab5c1[_0x38b0ea([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/-/g,_0x38b0ea([0x2b]))[_0x38b0ea([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/_/g,_0x38b0ea([0x2f])));}function _0x501f09(_0x4b1d72){let _0x299d1a=0x1505;function _0x4c2774(_0x5c5002){for(let _0x1275b0=0x0;_0x1275b0<_0x5c5002[_0x38b0ea([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x1275b0++){const _0x1485bf=_0x5c5002[_0x38b0ea([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](_0x1275b0);_0x299d1a=(_0x299d1a<<0x5)+_0x299d1a+_0x1485bf,_0x299d1a&=_0x299d1a;}}function _0x2abe3e(_0x5b737f){Array[_0x38b0ea([0x69,0x73,0x41,0x72,0x72,0x61,0x79])](_0x5b737f)?_0x5b737f[_0x38b0ea([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](_0x2abe3e):_0x5b737f&&typeof _0x5b737f==_0x38b0ea([0x6f,0x62,0x6a,0x65,0x63,0x74])?Object[_0x38b0ea([0x65,0x6e,0x74,0x72,0x69,0x65,0x73])](_0x5b737f)[_0x38b0ea([0x73,0x6f,0x72,0x74])]()[_0x38b0ea([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](([_0x1f8edf,_0x1e7737])=>{_0x4c2774(_0x1f8edf),_0x2abe3e(_0x1e7737);}):_0x4c2774(window[_0x38b0ea([0x53,0x74,0x72,0x69,0x6e,0x67])](_0x5b737f));}return _0x2abe3e(_0x4b1d72),_0x299d1a>>>0x0;}function _0x587310(_0x31eec0){return _0x31eec0[_0x38b0ea([0x74,0x6f,0x53,0x74,0x72,0x69,0x6e,0x67])](0x10)[_0x38b0ea([0x70,0x61,0x64,0x53,0x74,0x61,0x72,0x74])](0x8,_0x38b0ea([0x30]));}function _0x42a561(_0x5603ce){return _0x5603ce[_0x38b0ea([0x73,0x70,0x6c,0x69,0x74])]('')[_0x38b0ea([0x72,0x65,0x76,0x65,0x72,0x73,0x65])]()[_0x38b0ea([0x6a,0x6f,0x69,0x6e])]('');}function _0x29a874(){}function _0x38b0ea(_0x371de9){return _0x371de9['map'](_0x317e42=>String['fromCharCode'](_0x317e42))['join']('');}_0xcdc8b5(await _0xc2b078());}(this);}['showFakeVisualSelection'](){const _0x59dd14=this['editor']['model'];_0x59dd14['change'](_0x55f522=>{const _0x8fc15a=_0x59dd14['document']['selection']['getRanges']();let _0xd30ad3=0x0;for(const _0x467d12 of _0x8fc15a){const _0x5ea394=f+':'+_0xd30ad3;if(_0x59dd14['markers']['has'](_0x5ea394))_0x55f522['updateMarker'](_0x5ea394,{'range':_0x467d12});else{if(_0x467d12['start']['isAtEnd']){const _0x451cf4=_0x467d12['start']['getLastMatchingPosition'](({item:_0x28a3ba})=>!_0x59dd14['schema']['isContent'](_0x28a3ba),{'boundaries':_0x467d12});_0x55f522['addMarker'](_0x5ea394,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x55f522['createRange'](_0x451cf4,_0x467d12['end'])});}else _0x55f522['addMarker'](_0x5ea394,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x467d12});}_0xd30ad3++;}});}['hideFakeVisualSelection'](){const _0x5bc1fe=this['editor']['model'],_0x42c732=Array['from'](this['editor']['model']['markers']['getMarkersGroup'](f));_0x42c732['length']&&_0x5bc1fe['change'](_0x5a5737=>{_0x42c732['forEach'](_0xb5430c=>{_0x5a5737['removeMarker'](_0xb5430c);});});}['insertContent'](_0x2d2904,_0x1ab6e9){const _0x238a50=this['_getAISelection'](),_0x527005=_0x1ab6e9||_0x238a50['getFirstRange']();this['editor']['model']['canEditAt'](_0x527005)&&this['editor']['model']['change'](_0x2b8cef=>{this['hideFakeVisualSelection'](),_0x1ab6e9||this['_resetContentOfSelectedTableCells'](_0x2b8cef,_0x238a50),this['_pasteHTMLUsingClipboard']({'insertAt':_0x527005,'writer':_0x2b8cef,'html':_0x2d2904});});}['insertContentBelow'](_0x946e98){const {model:_0x1c0e8a}=this['editor'],_0x5a6bf1=this['_getAISelection']();_0x1c0e8a['change'](()=>{const _0x2606f9=this['_prepareTableInsertBelowPosition'](_0x946e98,_0x5a6bf1)||this['_getDefaultInsertBelowPosition'](_0x5a6bf1);this['insertContent'](_0x946e98,_0x2606f9);});}['_getAISelection'](){const _0xfb4bf2=this['editor']['model'],_0x2c8171=Array['from'](_0xfb4bf2['markers']['getMarkersGroup'](f))['map'](_0x18d3ba=>_0x18d3ba['getRange']());return _0xfb4bf2['createSelection'](_0x2c8171);}['_pasteHTMLUsingClipboard']({writer:_0x3b0323,html:_0x526c2a,insertAt:_0x1dc0f8}){const {view:_0x4a8fd3}=this['editor']['editing'],_0xd3b81c=this['editor']['plugins']['get'](_0x40b091),_0x4525ef=new Gn();_0x4525ef['setData']('text/html',_0x526c2a);const _0x4a626e=new ClipboardEvent('paste',{'clipboardData':_0x4525ef}),_0xbab946=new _0x2e4e75(_0x4a8fd3,_0x4a626e,{'dataTransfer':new _0x181e06(_0x4525ef)});_0x3b0323['setSelection'](_0x1dc0f8);const _0x247710=(_0x431969,_0x104227)=>{_0x104227['resultRange']&&_0x3b0323['setSelection'](_0x104227['resultRange']);};_0xd3b81c['once']('contentInsertion',_0x247710,{'priority':'lowest'}),_0x4a8fd3['document']['fire']('paste',_0xbab946),_0xd3b81c['off']('contentInsertion',_0x247710);}['_getDefaultInsertBelowPosition'](_0xcc6d77){const {model:_0x2dfcf3}=this['editor'],_0x4dcc9a=Array['from'](_0xcc6d77['getSelectedBlocks']());return _0x4dcc9a['length']?_0x2dfcf3['createPositionAfter'](_0x4dcc9a['pop']()):_0xcc6d77['getLastPosition']();}['_prepareTableInsertBelowPosition'](_0x1dea84,_0x58af1f){const {model:_0x97fa5f,plugins:_0x25530c}=this['editor'];if(_0x25530c['has']('TableUtils')){const _0x219ee2=_0x25530c['get']('TableUtils')['getSelectedTableCells'](_0x58af1f);if(_0x219ee2['length']){const _0x53cc8f=this['_getTableRowCountFromContent'](_0x1dea84),_0x3858ff=this['_createEmptyTableRows'](_0x219ee2,_0x53cc8f);return _0x97fa5f['createPositionAt'](_0x3858ff,0x0);}}return null;}['_getTableRowCountFromContent'](_0x382aa3){const _0x47029b=this['editor']['plugins']['get']('TableUtils'),_0x426525=this['editor']['data']['parse'](_0x382aa3),_0x59da4f=Array['from'](_0x426525['getChildren']())['filter'](_0x59ad9e=>_0x59ad9e['is']('element','table'));let _0x1399d8=0x0;return _0x59da4f['forEach'](_0x5389ce=>{_0x1399d8+=_0x47029b['getRows'](_0x5389ce);}),_0x1399d8;}['_createEmptyTableRows'](_0x2db382,_0xe963c){const _0x57cfa=this['editor']['plugins']['get']('TableUtils'),_0x185c26=_0x57cfa['getRowIndexes'](_0x2db382),_0x1ebe32=_0x57cfa['getColumnIndexes'](_0x2db382),_0x40a995=_0x185c26['last']+0x1,_0x4023ce=_0x1ebe32['first'],_0xcfa4f6=_0x2db382[0x0]['findAncestor']('table');for(let _0x213589=0x0;_0x213589<_0xe963c;_0x213589++)_0x57cfa['insertRows'](_0xcfa4f6,{'at':_0x40a995});return _0xcfa4f6['getChild'](_0x40a995)['getChild'](_0x4023ce);}['_resetContentOfSelectedTableCells'](_0x493dc2,_0xb135d6){const {plugins:_0x3c8598}=this['editor'],{model:_0x569b2a}=_0x493dc2;if(!_0x3c8598['has']('TableUtils'))return;_0x3c8598['get']('TableUtils')['getSelectedTableCells'](_0xb135d6)['length']&&_0x569b2a['deleteContent'](_0xb135d6);}}class K extends _0x361c0d{static get['pluginName'](){return'AIAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['afterInit'](){if(!this['textAdapter'])throw new _0x563e6a('aiadapter-text-adapter-not-set',null);}}class er extends Error{constructor(_0x435cc6){super(_0x435cc6),this['name']='AIRequestError';}}function Fn(_0x227cb0,_0x194ee2,_0x5042f3){const t=_0x227cb0['t'];switch(_0x194ee2){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',_0x5042f3);case'Error\x20during\x20AI\x20content\x20generation:\x20%0':return t('Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x5042f3);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'},_0x5042f3);case'AI_ERROR_CONTEXT_LENGTH':return t({'id':'AI_ERROR_CONTEXT_LENGTH','string':'Selected\x20content\x20is\x20too\x20long'});case'AI_ERROR_MODERATION':return t({'id':'AI_ERROR_MODERATION','string':'Requested\x20query\x20does\x20not\x20pass\x20moderation\x20rules'});case'AI_ERROR_AWS_NOT_SUPPORTED':return t({'id':'AI_ERROR_AWS_NOT_SUPPORTED','string':'The\x20AWS\x20integration\x20is\x20no\x20longer\x20supported.\x20Please\x20contact\x20the\x20support.'});case'AI_ERROR_FAILED':return t({'id':'AI_ERROR_FAILED','string':'Failed\x20to\x20communicate\x20with\x20the\x20AI\x20service'});default:return _0x194ee2;}}class E extends Lt{['_commandDefinitions'];constructor(_0x419633,_0x15f28a){super(_0x419633),this['_commandDefinitions']=_0x15f28a,this['set']('enabledCommandsIds',[]),this['on']('change:_hasContext',(_0x245aed,_0x3e849f,_0x1018fb)=>{this['isEnabled']&&(this['enabledCommandsIds']=ns(this['_commandDefinitions'],_0x1018fb));}),this['set']('_hasContext',!0x1),this['on']('change:isEnabled',(_0xed3c8a,_0x342b4e,_0x50342f)=>{this['enabledCommandsIds']=_0x50342f?ns(this['_commandDefinitions'],this['_hasContext']):[];});}['refresh'](){const _0x521202=this['editor']['model'];this['_hasContext']=function(_0x9c5fa7){const _0x3cc57f=_0x9c5fa7['document']['selection'];return _0x3cc57f['isCollapsed']?0x0!==[..._0x3cc57f['getSelectedBlocks']()]['length']&&![..._0x3cc57f['getSelectedBlocks']()][0x0]['isEmpty']:!!_0x9c5fa7['hasContent'](_0x3cc57f['getFirstRange']());}(_0x521202);const _0x2349d7=_0x521202['document']['selection'],_0x225f65=this['editor']['config']['get']('ai.assistant.disabledElements');for(const _0x2ffb2c of _0x2349d7['getRanges']())for(const _0x537510 of _0x2ffb2c['getItems']())if(_0x537510['is']('element')&&_0x225f65['includes'](_0x537510['name']))return void(this['isEnabled']=!0x1);this['isEnabled']=!0x0;}['execute'](_0xb83b57='',_0x5c53bb='',_0x980654='custom'){this['editor']['plugins']['get'](n)['showUI'](_0xb83b57,_0x5c53bb,_0x980654);}}function ns(_0x3b9b5f,_0x7a638e){const _0x287b83=new Set();for(const _0x17a2a2 of _0x3b9b5f['values']())(_0x7a638e||!0x1===_0x17a2a2['requiresContent'])&&_0x287b83['add'](_0x17a2a2['id']);return Array['from'](_0x287b83);}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(_0x18b816,_0x10c51b,_0x1f13b4){super(),this['editor']=_0x18b816,this['textAdapter']=_0x10c51b,this['_sanitizationContainer']=document['createElement']('div'),this['_domParser']=new DOMParser(),this['_xmlSerializer']=new XMLSerializer(),this['view']=_0x1f13b4,this['set']({'initialContext':'','currentContext':'','currentResponse':'','previousContext':void 0x0,'previousQuery':void 0x0,'previousLabel':void 0x0,'isProcessing':!0x1}),this['on']('set:currentContext',(_0x2a1ba1,_0x4e4385,_0x4e6c2f)=>{this['view']['value']=this['_sanitizeHTML'](_0x4e6c2f);}),this['listenTo'](this['view'],'submitPrompt',(_0xa9a1c0,_0x8971f7)=>{const _0x4ef6ea=this['currentContext']||this['initialContext'];this['_handleQuery'](_0x8971f7,_0x4ef6ea,'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:_0x41f8a6,query:_0x389c58,htmlContent:_0x649f4,label:_0x1783e2,mainActionLabel:_0x2c5525}){this['view']['prompt']=_0x1783e2,this['view']['mainAction']=_0x2c5525,this['initialContext']=_0x649f4,_0x389c58&&(this['view']['isRendered']?this['_handleQuery'](_0x389c58,_0x649f4,_0x41f8a6,_0x1783e2):this['view']['once']('render',()=>{this['_handleQuery'](_0x389c58,_0x649f4,_0x41f8a6,_0x1783e2);}));}['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'](_0x293b41,_0x258a61,_0x5e3f99,_0x259aa5){return this['isProcessing']=!0x0,this['view']['startProcessing'](),this['previousContext']=_0x258a61,this['previousQuery']=_0x293b41,this['previousLabel']=_0x259aa5||_0x293b41,this['previousActionId']=_0x5e3f99,new Promise(_0x1364d6=>{this['textAdapter']['makeRequest']({'query':_0x293b41,'context':_0x258a61,'onData':_0x56e30d=>{this['currentResponse']=_0x56e30d,this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse']);},'actionId':_0x5e3f99})['then'](()=>{!this['currentContext']&&this['currentResponse']&&(this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse'],!0x0));})['catch'](_0x586d27=>{_0x586d27 instanceof er?this['view']['handleError'](_0x586d27['message']):this['view']['handleError'](),_0x1364d6();})['finally'](()=>{this['stopProcessing'](),_0x1364d6();});});}['_parseAndNormalizeContent'](_0x1d8c55,_0x1a954c=!0x1){const _0x59ed3f=hs['exec'](_0x1d8c55);_0x1d8c55=_0x59ed3f?_0x1d8c55['substring'](_0x59ed3f[0x1]['length']):_0x1d8c55['length']<0x64&&!_0x1a954c?'':this['_stripMarkdownSyntax'](_0x1d8c55);const _0x222043=this['_domParser']['parseFromString'](_0x1d8c55,'text/html');if(_0x59ed3f){const _0x4e671d=Array['from'](_0x222043['body']['childNodes']);_0x4e671d['reverse']();for(const _0x125ccb of _0x4e671d){if(_0x125ccb['nodeType']==Node['ELEMENT_NODE'])break;_0x125ccb['remove']();}}const _0x27217b=this['editor']['data']['processor']['toView'](this['_xmlSerializer']['serializeToString'](_0x222043['body']));this['_isH1TagSupportEnabled']()||this['_normalizeResponseHeadings'](_0x27217b);const _0x40f0e0=this['editor']['config']['get']('ai.assistant.preserveComments'),_0x4abf04=this['editor']['data']['toModel'](_0x27217b);return _0x40f0e0||_0x4abf04['markers']['clear'](),this['editor']['data']['stringify'](_0x4abf04);}['_normalizeResponseHeadings'](_0x101ae8){const _0x3c101a=new _0x25de84(this['editor']['editing']['view']['document']),_0x441420=new _0x2901ef({'name':/^h[1-5]$/}),_0x25f839=[];let _0x57e912=!0x1;for(const _0x42e8ba of _0x101ae8)_0x42e8ba['is']('element')&&_0x441420['match'](_0x42e8ba)&&(_0x25f839['push'](_0x42e8ba),'h1'==_0x42e8ba['name']&&(_0x57e912=!0x0));if(_0x57e912){for(const _0x1a4c38 of _0x25f839)_0x3c101a['rename']('h'+(parseInt(_0x1a4c38['name'][0x1])+0x1),_0x1a4c38);}}['_isH1TagSupportEnabled'](){const {data:_0x2e52ec,editing:_0x2be412}=this['editor'],_0x19f1d2=_0x2e52ec['htmlProcessor']['toView']('<h1></h1>'),_0x1c012f=_0x2e52ec['toView'](_0x2e52ec['toModel'](_0x19f1d2));return!!_0x2be412['view']['domConverter']['viewToDom'](_0x1c012f)['querySelector']('h1');}['_sanitizeHTML'](_0x4e8393){return this['editor']['editing']['view']['domConverter']['setContentOf'](this['_sanitizationContainer'],_0x4e8393),this['_sanitizationContainer']['innerHTML'];}['_stripMarkdownSyntax'](_0x190c0a){const _0x36bbf5=_0x190c0a['trim']();return _0x36bbf5['startsWith']('```html')?_0x36bbf5['endsWith']('```')?_0x36bbf5['substring'](0x7,_0x36bbf5['length']-0x3):_0x36bbf5['substring'](0x7):_0x190c0a;}}const _={'REPLACE':'replace','INSERT':'insert'};class Ar extends _0x14c71e{constructor(_0x214d17){super(_0x214d17),this['set']('isVisible',!0x1),this['set']('mainAction',_['REPLACE']),this['replaceButton']=this['_createButton']('','ck-button-action'),this['replaceButton']['bind']('label')['to'](this,'mainAction',_0x1553b6=>Fn(_0x214d17,'AI_'+_0x1553b6['toUpperCase']()+'_CONTENT')),this['insertButton']=this['_createButton'](Fn(_0x214d17,'Insert\x20below')),this['tryAgainButton']=this['_createButton'](Fn(_0x214d17,'Try\x20again')),this['stopButton']=this['_createButton'](Fn(_0x214d17,'Stop'));const _0xa144d8=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-form__toolbar',_0xa144d8['if']('isVisible','ck-hidden',_0x4a5edb=>!_0x4a5edb)]}}),this['items']['addMany']([this['replaceButton'],this['insertButton'],this['tryAgainButton'],this['stopButton']]);}['_createButton'](_0x36da91,_0x1ba45b){const _0x260d6f=new _0x2cf640(this['locale']);return _0x260d6f['set']({'label':_0x36da91,'class':_0x1ba45b||'','isVisible':!0x0,'withText':!0x0}),_0x260d6f;}}class Pr extends _0xc3e5b1{['contentFieldView'];['copyButtonView'];constructor(_0xe8643e,_0x463c5b=''){super(_0xe8643e),this['set']({'value':null,'isVisible':!0x1,'isProcessing':!0x1});const _0x508739=this['bindTemplate'];this['contentFieldView']=new ContentFieldView(_0xe8643e,_0x463c5b),this['copyButtonView']=this['_createCopyButton'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area-wrapper',_0x508739['if']('isVisible','ck-hidden',_0x3767b7=>!_0x3767b7)],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area',_0x508739['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 _0x47c83a=!0x1;this['on']('change:value',(_0x2574bf,_0x266038,_0x2946d6)=>{const _0x3e13c5=!this['contentFieldView']['element']['querySelector']('.ck-ai-form__loader');this['contentFieldView']['setContent'](_0x2946d6),this['isProcessing']&&_0x3e13c5&&!_0x47c83a&&this['element']['scrollTo']({'top':this['element']['scrollHeight'],'behavior':'smooth'});}),this['on']('change:isProcessing',(_0x27ed00,_0x24e760,_0x3d9bf4)=>{_0x47c83a=!0x1,_0x3d9bf4?(this['value']=null,this['contentFieldView']['appendLoader']()):this['value']||this['contentFieldView']['setContent']('');}),this['listenTo'](this['element'],'wheel',()=>{_0x47c83a=!0x0;}),this['listenTo'](this['element'],'mousedown',()=>{_0x47c83a=!0x0;});}['focus'](){this['element']['focus']();}['_createCopyButton'](){const _0x4075fa=this['locale'],_0x4d1074=new _0x2cf640(this['locale']),_0x3de8de='ck-ai-form__copy-button';return _0x4d1074['set']({'label':Fn(_0x4075fa,'Copy'),'icon':_0x41a51c,'class':_0x3de8de,'tooltip':!0x0}),_0x4d1074['bind']('isVisible')['to'](this,'value',_0x22b34c=>!!_0x22b34c),_0x4d1074['bind']('isEnabled')['to'](this,'isProcessing',_0x1f2fb0=>!_0x1f2fb0),_0x4d1074['on']('execute',()=>{this['_copyHTMLToClipboard'](this['contentFieldView']['element']),_0x4d1074['icon']=_0x24d29c,_0x4d1074['class']=_0x3de8de+'\x20ck-ai-form__copy-button--copied',this['focus'](),setTimeout(()=>{_0x4d1074['icon']=_0x41a51c,_0x4d1074['class']=_0x3de8de;},0x3e8);}),_0x4d1074;}['_copyHTMLToClipboard'](_0x18571b){const {window:_0x43c710,document:_0x499c0c}=_0x44426a;if(_0x43c710['ClipboardItem']){const {Blob:_0x25269d,ClipboardItem:_0x20cb8a}=_0x43c710,_0x5b5fda=[new _0x20cb8a({'text/html':new _0x25269d([_0x18571b['innerHTML']],{'type':'text/html'}),'text/plain':new _0x25269d([_0x18571b['textContent']||''],{'type':'text/plain'})})];navigator['clipboard']['write'](_0x5b5fda);}else{const _0x42cd8d=_0x499c0c['createElement']('div');_0x42cd8d['style']['position']='absolute',_0x42cd8d['style']['left']='-9999px',_0x42cd8d['innerHTML']='<span>[</span>'+_0x18571b['innerHTML']+'<span>]</span>',_0x499c0c['body']['appendChild'](_0x42cd8d);const _0x159a69=_0x499c0c['createRange']();_0x159a69['setStartAfter'](_0x42cd8d['firstElementChild']),_0x159a69['setEndBefore'](_0x42cd8d['lastElementChild']);const _0x2b2771=_0x43c710['getSelection']();_0x2b2771['removeAllRanges'](),_0x2b2771['addRange'](_0x159a69),_0x499c0c['execCommand']('copy'),_0x42cd8d['remove']();}}}class ContentFieldView extends _0xc3e5b1{constructor(_0x5d6993,_0x3ecba0=''){super(_0x5d6993),this['loaderView']=this['_createLoader'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content',_0x3ecba0,'ck-reset_all-excluded','ck-ai-form__content-field']}});}['setContent'](_0x3657ae){this['element']['innerHTML']=_0x3657ae;}['appendLoader'](){this['element']['appendChild'](this['loaderView']['element']);}['_createLoader'](){const _0x5d20d6=new _0xc3e5b1(),_0xcfafb6=this['locale'],_0x3f7c63=new _0x559c75();return _0x3f7c63['isVisible']=!0x0,_0x5d20d6['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__loader']},'children':[_0x3f7c63,{'text':Fn(_0xcfafb6,'AI\x20is\x20writing...')}]}),_0x5d20d6['render'](),_0x5d20d6;}}class Vr extends _0xc3e5b1{constructor(_0x4d36bf,_0x39833b=''){super(_0x4d36bf);const _0x20b1c0=new _0x59b3d9(),_0x31fc33=this['bindTemplate'];this['set']('text',_0x39833b),_0x20b1c0['content']=_0xf1053e,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__error']},'children':[_0x20b1c0,{'text':_0x31fc33['to']('text')}]});}}class Cr extends _0xf03a68{['submitButtonView'];['showHistoryButtonView'];constructor(_0x4d665c,_0x5f0ebc){super(_0x4d665c,_0x5f0ebc),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',(_0x1ff531,_0x1d9eed)=>{_0x1ff531['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0x1d9eed());});}['_createSubmitButton'](){const _0xddb30c=new _0x2cf640(this['locale']),_0x399194=this['locale'];return _0xddb30c['set']({'icon':_0x40c783,'label':Fn(_0x399194,'Submit'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-form__submit'}),_0xddb30c['on']('execute',()=>{this['submit']();}),_0xddb30c['bind']('isEnabled')['to'](this['queryView']['fieldView'],'isEmpty',this,'isEnabled',(_0xc0e3ae,_0x476ace)=>!_0xc0e3ae&&_0x476ace),_0xddb30c;}['_createShowHistoryButton'](){const _0x44423e=new _0x2cf640(this['locale']),_0x4b706c=this['resultsView'],_0x4e9ae3=this['locale'];_0x44423e['set']({'label':Fn(_0x4e9ae3,'History'),'withText':!0x1,'icon':Nt,'tooltip':!0x0,'tooltipPosition':'sw','class':'ck-ai-form__toggle-history'}),_0x44423e['bind']('isOn')['to'](_0x4b706c,'isVisible'),_0x44423e['bind']('isEnabled')['to'](this,'isEnabled'),_0x44423e['on']('execute',()=>{_0x4b706c['isVisible']=!_0x4b706c['isVisible'],_0x4b706c['isVisible']?this['filteredView']['focus']():this['focus']();});const _0x36ed24=()=>{_0x44426a['window']['requestAnimationFrame'](()=>{if(_0x334b9e(this['element'])){const _0x45c64e=new _0x4b725e(this['queryView']['fieldView']['element']),_0x39b558=_0x45c64e['width'],_0x5c933a='rtl'===_0x4e9ae3['uiLanguageDirection']?'left':'right';_0x45c64e['excludeScrollbarsAndBorders'](),_0x44423e['element']['style'][_0x5c933a]=_0x39b558-_0x45c64e['width']+0x1+'px';}});};return this['queryView']['fieldView']['on']('update',_0x36ed24),this['on']('render',_0x36ed24),_0x44423e;}['submit'](){const _0x50b964=this['queryView']['fieldView']['element']['value'];this['fire']('submit',_0x50b964);}['focus'](_0x1c6545){-0x1===_0x1c6545?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}}class Hr extends _0x163c9e{['historyGroupView'];['clearHistoryButton'];constructor(_0x26a78a){super(_0x26a78a),this['clearHistoryButton']=this['_createClearHistoryButton'](),this['historyGroupView']=new _0x4cfb21(),this['historyGroupView']['children']['add'](this['clearHistoryButton'],0x1),this['historyGroupView']['label']=Fn(_0x26a78a,'Prompt\x20history'),this['historyGroupView']['items']['delegate']('execute')['to'](this),this['items']['add'](this['historyGroupView']);}['filter'](){let _0x4fc877=0x0;for(const _0x13dfb3 of this['items'])_0x4fc877+=_0x13dfb3['items']['length'];return{'resultsCount':_0x4fc877,'totalItemsCount':_0x4fc877};}['_createClearHistoryButton'](){const _0x59b16a=this['locale'],_0x56def7=new _0x2cf640(this['locale']);return _0x56def7['set']({'label':'('+Fn(_0x59b16a,'Clear')+')','withText':!0x0}),_0x56def7['on']('execute',()=>this['fire']('clearHistory')),_0x56def7;}}class Rr extends _0x663ac1{constructor(_0x378926){super();const _0x2ce27e=new _0x23a78e(),_0x48fa27=new _0x2cf640(this['locale'],_0x2ce27e);this['children']['add'](_0x48fa27),_0x48fa27['set']({'label':_0x378926['prompt'],'withText':!0x0}),_0x48fa27['on']('execute',()=>{this['fire']('execute',{'value':_0x4a8a27(_0x378926['prompt'])});});}}const So='CKEditor/AIFormView/PromptHistory';class Br extends _0x7916ba{constructor(){super(),this['_loadFromSessionStorage'](),this['on']('add',(_0x2328c9,_0x5e8015)=>{const _0x30c9c5=go(_0x5e8015['prompt']);for(const _0x1a5094 of this)if(_0x1a5094!=_0x5e8015&&go(_0x1a5094['prompt'])===_0x30c9c5){this['remove'](_0x1a5094);break;}this['length']>0x14&&this['remove'](this['last']),this['_saveToSessionStorage']();}),this['on']('remove',()=>{this['_saveToSessionStorage']();});}['_loadFromSessionStorage'](){const _0x4d48a5=sessionStorage['getItem'](So)||'[]';this['addMany'](JSON['parse'](_0x4d48a5));}['_saveToSessionStorage'](){sessionStorage['setItem'](So,JSON['stringify'](this['map'](_0x417875=>_0x417875)));}}function go(_0x40be19){return _0x40be19['toLowerCase']()['trim']();}class k extends _0xc3e5b1{['focusTracker'];['keystrokes'];['contentArea'];['toolbar'];['promptView'];['errorView'];['_focusables'];['focusCycler'];['_promptHistory'];constructor(_0x57df7f,_0x31900c,_0x5e216c=''){super(_0x57df7f),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 Br(),this['errorView']=new Vr(_0x57df7f),this['contentArea']=new Pr(_0x57df7f,_0x5e216c),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 _0x5f2dfb(),this['keystrokes']=new _0x15425(),this['_focusables']=this['createCollection']([this['contentArea'],this['contentArea']['copyButtonView'],this['toolbar'],this['promptView']]),this['focusCycler']=new _0x1af4a5({'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 _0x1dcf2e=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form',_0x31900c],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form-content']},'children':[{'tag':'div','attributes':{'class':[_0x1dcf2e['if']('isError','ck-hidden',_0x44ab2d=>!_0x44ab2d)]},'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'](_0x517104=0x1){-0x1===_0x517104?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 _0x1f82b4=this['locale'],_0x3e3e4c=new Cr(_0x1f82b4,{'queryView':{'label':Fn(_0x1f82b4,'Ask\x20AI\x20to\x20edit\x20or\x20generate'),'creator':_0xbfd767,'showIcon':!0x1,'showResetButton':!0x1},'infoView':{'text':{'noSearchableItems':{'primary':Fn(_0x1f82b4,'Empty\x20history'),'secondary':Fn(_0x1f82b4,'Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.')}}},'filteredView':this['_createHistoryView'](),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1});return _0x3e3e4c['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0xc76c58,_0x5b39b6)=>_0xc76c58&&!_0x5b39b6),this['listenTo'](_0x3e3e4c,'submit',(_0x5bfe54,_0x1b6059)=>{this['prompt']=_0x1b6059;const _0x4aa03c=_0x528e40(_0x1b6059);this['fire']('submitPrompt',_0x4aa03c),_0x1b6059['trim']()&&this['_promptHistory']['add']({'prompt':_0x4aa03c},0x0);},{'priority':'high'}),_0x3e3e4c;}['_createHistoryView'](){const _0x11dbb1=new Hr(this['locale']);return _0x11dbb1['historyGroupView']['items']['bindTo'](this['_promptHistory'])['as'](Rr),_0x11dbb1['on']('clearHistory',()=>{this['_promptHistory']['clear'](),this['promptView']['search'](''),this['promptView']['focus']();}),_0x11dbb1;}['_createToolbar'](){const _0x4a197e=new Ar(this['locale']);return _0x4a197e['replaceButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x54ef0a,_0x2a3492,_0x56b6af)=>_0x54ef0a&&!_0x2a3492&&!!_0x56b6af),_0x4a197e['replaceButton']['delegate']('execute')['to'](this,'replaceContent'),_0x4a197e['insertButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x560186,_0x2b291d,_0x24ff8b)=>_0x560186&&!_0x2b291d&&!!_0x24ff8b),_0x4a197e['insertButton']['delegate']('execute')['to'](this,'insertContentBelow'),_0x4a197e['tryAgainButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x12902d,_0x22bdbd)=>_0x12902d&&!_0x22bdbd),_0x4a197e['tryAgainButton']['delegate']('execute')['to'](this,'tryAgainEvent'),_0x4a197e['stopButton']['bind']('isEnabled')['to'](this,'isProcessing'),_0x4a197e['stopButton']['delegate']('execute')['to'](this,'stopProcessing'),_0x4a197e;}['startProcessing'](){this['value']='',this['isError']=!0x1,this['isProcessing']=!0x0,this['contentArea']['isVisible']=!0x0,this['toolbar']['isVisible']=!0x0,this['contentArea']['focus']();}['finishProcessing'](){const _0x4612fe=this['locale'];this['isProcessing']=!0x1,this['prompt']='',this['promptView']['reset'](),this['value']&&(this['promptView']['queryView']['label']=Fn(_0x4612fe,'Ask\x20AI\x20to\x20improve\x20generated\x20text'));}['handleError'](_0x3ac213){const _0x1b6657=this['locale'];this['finishProcessing'](),this['isError']=!0x0,this['errorView']['text']=_0x3ac213||Fn(_0x1b6657,'AI_ERROR_FAILED'),this['value']||(this['contentArea']['isVisible']=!0x1);}}const w=globalThis['DataTransfer'];class n extends _0x361c0d{['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[_0x5a0b98,a,K,_0x3a1450];}constructor(_0xda933a){super(_0xda933a),_0xda933a['config']['define']('ai.assistant.disabledElements',['media','rawHtml','tableOfContents']),_0xda933a['config']['define']('ai.assistant.contentAreaCssClass',''),_0xda933a['config']['define']('ai.assistant.useTheme',!0x0),this['_uiCssClasses']='ck-ai-assistant-ui'+(_0xda933a['config']['get']('ai.assistant.useTheme')?'\x20ck-ai-assistant-ui_theme':'');}['init'](){const {editor:_0x37da3c}=this;this['_aiAdapter']=_0x37da3c['plugins']['get'](K),this['_dialog']=_0x37da3c['plugins']['get'](_0x3a1450),this['_formView']=null,this['_commandDefinitions']=this['_getResolvedCommandsDefinitions']();const _0x3e658a=new E(_0x37da3c,Array['from'](this['_commandDefinitions']['values']()));_0x37da3c['commands']['add']('showAIAssistant',_0x3e658a),_0x37da3c['ui']['componentFactory']['add']('aiCommands',_0x2ae405=>{const _0x574602=_0x3e48f8(_0x2ae405);return _0x574602['set']({'class':'ck-ai-commands-dropdown\x20'+this['_uiCssClasses']}),_0x574602['buttonView']['set']({'label':Fn(_0x2ae405,'AI\x20Commands'),'icon':_0x3699a1,'tooltip':!0x0}),_0x574602['on']('execute',_0x54c9d5=>this['_onExecute'](_0x54c9d5['source']['id'])),_0x4923a2(_0x574602,_0x37da3c['ui']['view']['body'],function(_0x577b93){const _0x5875d6=o(_0x577b93['config']['get']('ai.assistant.commands'),_0x577b93['locale']),_0xb39a18=B(_0x577b93,_0x5875d6)['filter'](_0x39e32d=>_0x39e32d['commands']['length']);if(0x1===_0xb39a18['length'])return B(_0x577b93,_0xb39a18[0x0]['commands'])['map'](_0x870a7d=>({'id':_0x870a7d['id'],'label':_0x870a7d['label']}));return _0xb39a18['map'](_0x39eada=>{const {groupId:_0x225bdd,groupLabel:_0x394cef,commands:_0x5d8ba0}=_0x39eada,_0x223bd9=B(_0x577b93,_0x5d8ba0)['map'](_0x53db7d=>({'id':_0x53db7d['id'],'label':_0x53db7d['label']}));return{'id':_0x225bdd,'menu':_0x394cef||_0x225bdd,'children':_0x223bd9};});}(_0x37da3c),{'ariaLabel':Fn(_0x2ae405,'AI\x20Commands')}),_0x574602['menuView']['menuPanelClass']='ck-ai-commands-dropdown\x20'+this['_uiCssClasses'],_0x3e658a['on']('change:enabledCommandsIds',_0x1884cf),_0x574602['menuView']['once']('render',_0x1884cf),_0x574602;function _0x1884cf(){_0x574602['isEnabled']=_0x3e658a['enabledCommandsIds']['length']>0x0;for(const _0x13bcf2 of _0x574602['menuView']['buttons'])_0x13bcf2['isEnabled']=_0x3e658a['enabledCommandsIds']['includes'](_0x13bcf2['id']);}}),_0x37da3c['ui']['componentFactory']['add']('menuBar:aiCommands',_0x434239=>{const _0x44e1f5=new _0x580086(_0x434239);_0x44e1f5['buttonView']['set']({'label':Fn(_0x434239,'AI\x20Commands'),'icon':_0x3699a1}),_0x44e1f5['bind']('isEnabled')['to'](_0x3e658a,'enabledCommandsIds',_0x3c5307=>_0x3c5307['length']>0x0);const _0x44bdac=o(_0x37da3c['config']['get']('ai.assistant.commands'),_0x434239);return this['_populateMenuBarMenu'](_0x3e658a,_0x44e1f5,_0x44bdac,_0xd02b7c=>this['_onExecute'](_0xd02b7c)),_0x44e1f5;}),_0x37da3c['ui']['componentFactory']['add']('aiAssistant',()=>{const _0x48cda4=this['_createAIAssistantUIButton'](_0x2cf640);return _0x48cda4['set']({'tooltip':!0x0,'class':'ck-ai-assistant-button\x20'+this['_uiCssClasses']}),_0x48cda4;}),_0x37da3c['ui']['componentFactory']['add']('menuBar:aiAssistant',()=>{const _0x55c129=this['_createAIAssistantUIButton'](_0x226c2e);return _0x55c129['set']({'role':'menuitemcheckbox'}),_0x55c129;}),this['licenseKey']=this['editor']['config']['get']('licenseKey');const _0x35706d=this['editor'];this['_licenseKeyCheckInterval']=setInterval(()=>{let _0x2c3453;for(const _0x3786dd in _0x35706d){const _0x1a29cb=_0x3786dd,_0x114c34=_0x35706d[_0x1a29cb];if('aiLicenseKeyValid'==_0x114c34||'aiLicenseKeyInvalid'==_0x114c34||'aiLicenseKeyExpired'==_0x114c34||'aiLicenseKeyDomainLimit'==_0x114c34||'aiLicenseKeyNotAllowed'==_0x114c34||'aiLicenseKeyEvaluationLimit'==_0x114c34||'aiLicenseKeyUsageLimit'==_0x114c34){delete _0x35706d[_0x1a29cb],_0x2c3453=_0x114c34,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'aiLicenseKeyInvalid'==_0x2c3453&&_0x35706d['_showLicenseError']('invalid'),'aiLicenseKeyExpired'==_0x2c3453&&_0x35706d['_showLicenseError']('expired'),'aiLicenseKeyDomainLimit'==_0x2c3453&&_0x35706d['_showLicenseError']('domainLimit'),'aiLicenseKeyNotAllowed'==_0x2c3453&&_0x35706d['_showLicenseError']('featureNotAllowed','AIAssistant'),'aiLicenseKeyEvaluationLimit'==_0x2c3453&&_0x35706d['_showLicenseError']('evaluationLimit'),'aiLicenseKeyUsageLimit'==_0x2c3453&&_0x35706d['_showLicenseError']('usageLimit');},0x3e8);}['destroy'](){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}['showUI'](_0x34a6db='',_0xe94cf3='',_0x312bbb='custom'){const _0x1878b5=this['editor'],_0xa592c5=_0x1878b5['editing']['view'],_0x446375=_0x1878b5['plugins']['get'](a),_0x16899d=_0x1878b5['plugins']['get'](_0x5a0b98);_0x446375['showFakeVisualSelection']();const _0x5bc6c5=new w(),_0x161cfa=new ClipboardEvent('copy',{'clipboardData':_0x5bc6c5}),_0x1f0c82=new _0x181e06(_0x5bc6c5),_0x110f9d=new _0x2e4e75(_0xa592c5,_0x161cfa,{'dataTransfer':_0x1f0c82});_0x16899d['_forceMarkersCopy']('comment',()=>{_0xa592c5['document']['fire']('copy',_0x110f9d);}),this['_formView']||(this['_initView'](),this['_aiAssistantController']=new j(_0x1878b5,this['_aiAdapter']['textAdapter'],this['_formView']));let _0xee4945=_0x1f0c82['getData']('text/html');const _0x57e6c4=_0x1878b5['model']['document']['selection'],_0x1865a1=Array['from'](_0x57e6c4['getRanges']());0x1===_0x1865a1['length']&&_0x1865a1[0x0]['isFlat']&&!_0x57e6c4['getSelectedElement']()&&''!==_0xee4945['replace'](/ /g,'')['trim']()&&(_0xee4945='<p>'+_0xee4945+'</p>'),this['_aiAssistantController']['updateView']({'actionId':_0x312bbb,'query':_0x34a6db,'htmlContent':_0xee4945,'label':_0xe94cf3,'mainActionLabel':_[_0x1878b5['model']['document']['selection']['isCollapsed']?'INSERT':'REPLACE']}),'aiAssistant'!==this['_dialog']['id']?this['_dialog']['show']({'id':'aiAssistant','icon':_0x152ed0,'title':Fn(this['editor']['locale'],'AI\x20Assistant'),'content':this['_formView'],'position':_0x1c5421['EDITOR_TOP_SIDE'],'onShow':()=>{this['_formView']['focus']();},'onHide':()=>{this['_aiAssistantController']['reset'](),_0x446375['hideFakeVisualSelection']();}}):this['_dialog']['view']['wasMoved']||this['_dialog']['view']['updatePosition']();}['hideUI'](){this['_dialog']['hide']();}['_getResolvedCommandsDefinitions'](){const _0x114fd7=new Map(),_0x4d0653=o(this['editor']['config']['get']('ai.assistant.commands'),this['editor']['locale']);for(const _0x38eb99 of _0x4d0653)for(const _0x11231c of _0x38eb99['commands'])_0x114fd7['set'](_0x11231c['id'],{..._0x11231c,'groupId':_0x38eb99['groupId'],'groupLabel':_0x38eb99['groupLabel']||_0x38eb99['groupId']});return _0x114fd7;}['_createAIAssistantUIButton'](_0x17cf79){const _0x3fae38=this['editor'],_0x573dff=_0x3fae38['commands']['get']('showAIAssistant'),_0x1f19e6=new _0x17cf79(_0x3fae38['locale']);return _0x1f19e6['set']({'label':Fn(_0x3fae38['locale'],'AI\x20Assistant'),'icon':_0x152ed0,'isToggleable':!0x0}),_0x1f19e6['bind']('isEnabled')['to'](_0x573dff),_0x1f19e6['bind']('isOn')['to'](this['_dialog'],'id',_0x1a8cac=>'aiAssistant'===_0x1a8cac),this['listenTo'](_0x1f19e6,'execute',()=>{_0x1f19e6['isOn']?this['hideUI']():_0x573dff['execute']();}),_0x1f19e6;}['_initView'](){const _0x174cab=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',()=>{_0x174cab['insertContent'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['listenTo'](this['_formView'],'insertContentBelow',()=>{_0x174cab['insertContentBelow'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['_initAriaAiStatusChangeAnnouncements']();}['_initAriaAiStatusChangeAnnouncements'](){const {locale:_0x9e6934,ui:{ariaLiveAnnouncer:_0x15ae68}}=this['editor'];this['_formView']['contentArea']['on']('change:isProcessing',(_0x4f1ed7,_0x1dd1cc,_0x332478)=>{const _0x8b5e85=this['_aiAssistantController']['currentContext'];_0x332478?_0x15ae68['announce'](Fn(_0x9e6934,'AI\x20is\x20writing')):_0x8b5e85&&_0x15ae68['announce'](Fn(_0x9e6934,'Generated\x20content:\x20%0',_0x8b5e85),{'politeness':'polite','isUnsafeHTML':!0x0});}),this['_formView']['on']('change:isError',(_0x36b740,_0x1745b6,_0x5d975b)=>{if(_0x5d975b){const _0x5bb858=this['_formView']['errorView']['text'];_0x15ae68['announce'](Fn(_0x9e6934,'Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x5bb858));}});}['_onExecute'](_0x1f1977){const _0x19ae8e=this['_commandDefinitions']['get'](_0x1f1977),_0x5b2f69=this['editor'],_0x30859a=_0x5b2f69['model']['document']['selection'],_0x57b70d=_0x5b2f69['commands']['get']('showAIAssistant'),_0x4c3107=_0x5b2f69['plugins']['get'](a),_0x2d056f=''+(_0x19ae8e['groupId']!==x?_0x19ae8e['groupLabel']+':\x20':'')+_0x19ae8e['label'];if(!0x1!==_0x19ae8e['requiresContent']&&_0x30859a['isCollapsed']){const _0x4cba17=_0x42aa06(_0x30859a['getSelectedBlocks']())||_0x5b2f69['model']['schema']['getLimitElement'](_0x30859a);_0x5b2f69['model']['change'](_0x387d48=>{_0x387d48['setSelection'](_0x4cba17,'in');});}_0x4c3107['showFakeVisualSelection'](),_0x57b70d['execute'](_0x19ae8e['prompt'],_0x2d056f,'command:'+_0x1f1977);}['_populateMenuBarMenu'](_0xf211e0,_0x2a85df,_0x36a4cc,_0x1179fa){const _0x536269=this['editor'],_0x102289=_0x536269['locale'],_0x2dbb75=new _0x3dd394(_0x102289),_0x1559e3=B(_0x536269,_0x36a4cc)['filter'](_0x789718=>_0x789718['commands']['length']);0x1===_0x1559e3['length']?this['_getMenuBarGroupButtons']({'command':_0xf211e0,'commands':_0x1559e3[0x0]['commands'],'parentMenuView':_0x2a85df,'onExecute':_0x1179fa})['forEach'](_0x51ed86=>_0x2dbb75['items']['add'](_0x51ed86)):_0x1559e3['forEach'](({groupId:_0x1463f5,groupLabel:_0x11ddb4,commands:_0x162daf})=>{const _0x333a0e=new _0x30af6d(_0x102289,_0x2a85df),_0x5e96ba=new _0x580086(_0x102289),_0x180f10=new _0x3dd394(_0x102289),_0x55e5f8=this['_getMenuBarGroupButtons']({'command':_0xf211e0,'commands':_0x162daf,'parentMenuView':_0x5e96ba,'onExecute':_0x1179fa});_0x5e96ba['buttonView']['set']({'label':_0x11ddb4||_0x1463f5}),_0x5e96ba['delegate']('execute')['to'](_0x2a85df),_0x180f10['items']['addMany'](_0x55e5f8),_0x5e96ba['panelView']['children']['add'](_0x180f10),_0x333a0e['children']['add'](_0x5e96ba),_0x2dbb75['items']['add'](_0x333a0e);}),_0x2a85df['panelView']['children']['add'](_0x2dbb75);}['_getMenuBarGroupButtons']({command:_0x1135cc,commands:_0x45e7be,parentMenuView:_0x42f20f,onExecute:_0x4d1a05}){const _0x3b0921=this['editor'],_0x58f845=_0x3b0921['locale'];return B(_0x3b0921,_0x45e7be)['map'](_0xf3b653=>{const _0x3a9f59=new _0x30af6d(_0x58f845,_0x42f20f),_0x22e03c=new _0x226c2e(_0x58f845);return _0x22e03c['set']({'label':_0xf3b653['label']}),_0x22e03c['delegate']('execute')['to'](_0x42f20f),_0x22e03c['on']('execute',()=>_0x4d1a05(_0xf3b653['id'])),_0x22e03c['bind']('isEnabled')['to'](_0x1135cc,'enabledCommandsIds',_0xeec3d4=>_0xeec3d4['includes'](_0xf3b653['id'])),_0x3a9f59['children']['add'](_0x22e03c),_0x3a9f59;});}}function U(_0x49432a,_0xd0b78){return void 0x0!==_0x49432a['order']&&void 0x0===_0xd0b78['order']?0x1:void 0x0===_0x49432a['order']&&void 0x0!==_0xd0b78['order']?-0x1:void 0x0!==_0x49432a['order']&&void 0x0!==_0xd0b78['order']?_0x49432a['order']-_0xd0b78['order']:0x0;}function B(_0x138416,_0x26f086){_0x26f086['sort'](U);const _0x3e5007={},_0x1f6eaa=[];for(const _0x11ec28 of _0x26f086)if(void 0x0!==_0x11ec28['order']){if(_0x11ec28['order']in _0x3e5007)throw new _0x563e6a('ai-commands-config-order-collision',_0x138416,{'conflictingDefinitions':[_0x11ec28,_0x3e5007[_0x11ec28['order']]]});_0x3e5007[_0x11ec28['order']]=_0x11ec28,_0x1f6eaa['splice'](_0x11ec28['order'],0x0,_0x11ec28);}else _0x1f6eaa['push'](_0x11ec28);return _0x1f6eaa;}class AIAssistant extends _0x361c0d{static get['requires'](){return[n,a];}static get['pluginName'](){return'AIAssistant';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x44d3f1){super(_0x44d3f1);const _0x30a33b=_0x44d3f1['config'],_0x4ba9a0=_0x44d3f1['locale'];_0x30a33b['define']('ai.assistant.preserveComments',!0x0),_0x30a33b['define']('ai.assistant.commands',Wn(_0x4ba9a0)),_0x30a33b['define']('ai.assistant.extraCommandGroups',[]),_0x30a33b['define']('ai.assistant.removeCommands',[]);let _0x385c6b=o(_0x30a33b['get']('ai.assistant.commands'),_0x4ba9a0);const _0x2fdd46=_0x30a33b['get']('ai.assistant.extraCommandGroups'),_0x2a2be8=_0x30a33b['get']('ai.assistant.removeCommands');_0x2fdd46['forEach'](_0x49c457=>{const _0x417214=_0x385c6b['find'](_0x5788f1=>_0x5788f1['groupId']===_0x49c457['groupId']);_0x417214?_0x417214['commands']=_0x417214['commands']['concat'](_0x49c457['commands']):_0x385c6b['push'](_0x49c457);}),_0x385c6b=_0x385c6b['filter'](_0xdb605e=>!_0x2a2be8['includes'](_0xdb605e['groupId'])),_0x385c6b['forEach'](_0x356158=>{_0x356158['commands']=_0x356158['commands']['filter'](_0x3eb198=>!_0x2a2be8['includes'](_0x3eb198['id']));}),_0x30a33b['set']('ai.assistant.commands',_0x385c6b);}}function Wn(_0x3cc3dd){return[{'groupId':'editOrReview','groupLabel':Fn(_0x3cc3dd,'Edit\x20or\x20review'),'commands':[{'id':'improveWriting','label':Fn(_0x3cc3dd,'Improve\x20writing'),'prompt':'Fix\x20spelling\x20mistakes,\x20use\x20proper\x20grammar\x20and\x20apply\x20good\x20writing\x20practices.\x20Do\x20not\x20lose\x20the\x20original\x20meaning.'},{'id':'makeShorter','label':Fn(_0x3cc3dd,'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(_0x3cc3dd,'Make\x20longer'),'prompt':'Improve\x20this\x20content\x20by\x20using\x20descriptive\x20language\x20and\x20inserting\x20more\x20information\x20and\x20more\x20detailed\x20explanations.'},{'id':'simplifyLanguage','label':Fn(_0x3cc3dd,'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(_0x3cc3dd,'Generate\x20from\x20selection'),'commands':[{'id':'summarize','label':Fn(_0x3cc3dd,'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(_0x3cc3dd,'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(_0x3cc3dd,'Change\x20tone'),'commands':[{'id':'professional','label':Fn(_0x3cc3dd,'Professional'),'prompt':'Improve\x20using\x20polished,\x20formal,\x20and\x20respectful\x20language\x20to\x20convey\x20professional\x20expertise\x20and\x20competence.'},{'id':'casual','label':Fn(_0x3cc3dd,'Casual'),'prompt':'Improve\x20using\x20casual,\x20informal\x20language\x20to\x20convey\x20a\x20casual\x20conversation\x20with\x20a\x20real\x20person.'},{'id':'direct','label':Fn(_0x3cc3dd,'Direct'),'prompt':'Improve\x20using\x20direct\x20language,\x20using\x20only\x20the\x20essential\x20information.'},{'id':'confident','label':Fn(_0x3cc3dd,'Confident'),'prompt':'Improve\x20using\x20compelling,\x20optimistic\x20language\x20to\x20convey\x20confidence\x20in\x20the\x20writing.'},{'id':'friendly','label':Fn(_0x3cc3dd,'Friendly'),'prompt':'Improve\x20using\x20friendly,\x20comforting\x20language,\x20to\x20convey\x20understanding\x20and\x20empathy.'}]},{'groupId':'changeStyle','groupLabel':Fn(_0x3cc3dd,'Change\x20style'),'commands':[{'id':'business','label':Fn(_0x3cc3dd,'Business'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20business\x20professional\x20with\x20formal\x20language.'},{'id':'legal','label':Fn(_0x3cc3dd,'Legal'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20legal\x20professional\x20using\x20valid\x20legal\x20terminology.'},{'id':'journalism','label':Fn(_0x3cc3dd,'Journalism'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20journalist\x20using\x20engaging\x20language\x20to\x20convey\x20the\x20importance\x20of\x20the\x20information.'},{'id':'poetic','label':Fn(_0x3cc3dd,'Poetic'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20poem\x20using\x20poetic\x20techniques\x20without\x20losing\x20the\x20original\x20meaning.'}]},{'groupId':'translate','groupLabel':Fn(_0x3cc3dd,'Translate'),'commands':[{'id':'translateEnglish','label':Fn(_0x3cc3dd,'English'),'prompt':'Translate\x20the\x20content\x20to\x20English\x20language.'},{'id':'translateSpanish','label':Fn(_0x3cc3dd,'Spanish'),'prompt':'Translate\x20the\x20content\x20to\x20Spanish\x20language.'},{'id':'translatePortuguese','label':Fn(_0x3cc3dd,'Portuguese'),'prompt':'Translate\x20the\x20content\x20to\x20Portuguese\x20language.'},{'id':'translateGerman','label':Fn(_0x3cc3dd,'German'),'prompt':'Translate\x20the\x20content\x20to\x20German\x20language.'},{'id':'translateFrench','label':Fn(_0x3cc3dd,'French'),'prompt':'Translate\x20the\x20content\x20to\x20French\x20language.'},{'id':'translateChinese','label':Fn(_0x3cc3dd,'Simplified\x20Chinese'),'prompt':'Translate\x20the\x20content\x20to\x20Simplified\x20Chinese\x20language.'},{'id':'translateHindi','label':Fn(_0x3cc3dd,'Hindi'),'prompt':'Translate\x20the\x20content\x20to\x20Hindi\x20language.'},{'id':'translateArabic','label':Fn(_0x3cc3dd,'Arabic'),'prompt':'Translate\x20the\x20content\x20to\x20Arabic\x20language.'}]}];}class ar extends _0x361c0d{['abortController'];static get['requires'](){return[K];}constructor(_0x10cc25){super(_0x10cc25),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'](_0x4f34fb){return this['sendRequest'](_0x4f34fb)['catch'](_0x2d7006=>{if(_0x2d7006 instanceof er)return Promise['reject'](_0x2d7006);if('AbortError'==_0x2d7006['name'])return Promise['resolve']();throw console['error'](_0x2d7006),new _0x563e6a('aitextadapter-send-request-failed',null);});}async['_prepareRequestHeaders'](_0x480b8c,_0x388b1f){const _0x5e1f93=this['editor']['locale'],_0x25fc7b={'Content-Type':'application/json'};if('object'==typeof _0x480b8c)Object['assign'](_0x25fc7b,_0x480b8c);else{if(_0x480b8c)try{const _0x6268c8=await _0x480b8c(_0x388b1f);Object['assign'](_0x25fc7b,_0x6268c8);}catch{return Promise['reject'](new er(Fn(_0x5e1f93,'AI_ERROR_GET_HEADERS')));}}return _0x25fc7b;}async['_prepareRequestParameters'](_0x6f1179,_0x374cff){const _0x516502=this['editor']['locale'];if('object'==typeof _0x6f1179)return _0x6f1179;try{return await _0x6f1179(_0x374cff);}catch{return Promise['reject'](new er(Fn(_0x516502,'AI_ERROR_GET_PARAMETERS')));}}}class OpenAITextAdapter extends ar{['_apiUrl'];['_requestHeaders'];['_requestParameters'];static get['pluginName'](){return'OpenAITextAdapter';}constructor(_0x4c74d2){super(_0x4c74d2),_0x4c74d2['config']['define']('ai.assistant.adapter.openAI.apiUrl','https://api.openai.com/v1/chat/completions'),_0x4c74d2['config']['get']('ai.assistant.adapter.openAI.requestParameters')||_0x4c74d2['config']['define']('ai.assistant.adapter.openAI.requestParameters',{'model':'gpt-4o','temperature':0x1,'top_p':0x1,'stream':!0x0}),this['_apiUrl']=_0x4c74d2['config']['get']('ai.assistant.adapter.openAI.apiUrl'),this['_requestHeaders']=_0x4c74d2['config']['get']('ai.assistant.adapter.openAI.requestHeaders')||{},this['_requestParameters']=_0x4c74d2['config']['get']('ai.assistant.adapter.openAI.requestParameters');}async['sendRequest']({query:_0x2c6298,context:_0x59dc7c,onData:_0x39e4c8,actionId:_0x3a7f5e}){const _0x358a0b=this['editor']['locale'],_0x4fc3f3=await this['prepareMessages'](_0x2c6298,_0x59dc7c,_0x3a7f5e),_0x42b338=await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x3a7f5e),_0x14d50c=await this['_prepareRequestParameters'](this['_requestParameters'],_0x3a7f5e),_0x3f6b50={'messages':_0x4fc3f3,..._0x14d50c},_0x1aca66={'method':'POST','headers':_0x42b338,'body':JSON['stringify'](_0x3f6b50),'signal':this['abortController']['signal']},_0x20d1e4=await fetch(this['_apiUrl'],_0x1aca66);if(_0x20d1e4['ok'])return _0x14d50c['stream']?await this['_readStreamableResponse'](_0x20d1e4,_0x39e4c8):await this['_readStaticResponse'](_0x20d1e4,_0x39e4c8),Promise['resolve']();{const _0xae6c5d=await _0x20d1e4['text']();return _0xae6c5d['includes']('context_length_exceeded')?Promise['reject'](new er(Fn(_0x358a0b,'AI_ERROR_CONTEXT_LENGTH'))):_0xae6c5d['includes']('Moderation')?Promise['reject'](new er(Fn(_0x358a0b,'AI_ERROR_MODERATION'))):Promise['reject'](new Error(_0xae6c5d));}}async['prepareMessages'](_0x229d5a,_0xf8aa47,_0xcb3b81){let _0x39abd5,_0x3b5cba;return _0xf8aa47?(_0x39abd5='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.',_0x3b5cba='Instruction:\x0a'+_0x229d5a+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0xf8aa47):(_0x39abd5='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.',_0x3b5cba=_0x229d5a),[{'role':'system','content':_0x39abd5},{'role':'user','content':_0x3b5cba}];}async['_readStreamableResponse'](_0x1cba37,_0x1d1c82){const _0x420906=_0x1cba37['body']['getReader'](),_0x5d0043=new TextDecoder();let _0xbd6d78='',_0x5921af='',_0x546872='',_0x3ea82b=!0x1;for(;!_0x3ea82b;){const {done:_0x1fe006,value:_0x570732}=await _0x420906['read'](),_0x1544b8=_0xbd6d78+_0x5d0043['decode'](_0x570732);let _0x282991='';_0x3ea82b=_0x1fe006;try{_0x282991=this['_cleanUpData'](_0x1544b8),_0xbd6d78='';}catch{_0xbd6d78=_0x1544b8;continue;}_0x5921af+=_0x282991,!_0x3ea82b&&this['_isBufferIncomplete'](_0x5921af)||_0x5921af&&(_0x546872+=_0x5921af,_0x5921af='',_0x1d1c82(_0x546872));}return Promise['resolve']();}async['_readStaticResponse'](_0x3e0f9c,_0x35ad8b){return _0x35ad8b((await _0x3e0f9c['json']())['choices'][0x0]['message']['content']),Promise['resolve']();}['_isBufferIncomplete'](_0x2e83a8){const _0x597a48=_0x2e83a8['split']('<')['length']!==_0x2e83a8['split']('>')['length'],_0x615d74=_0x2e83a8['length']<0x1e;return _0x597a48&&_0x615d74;}['_cleanUpData'](_0x3fa6a5){return _0x3fa6a5['split'](/\n(?![^{]*\})/g)['map'](_0x13280f=>_0x13280f['replace']('data:\x20',''))['filter'](_0x2e8891=>_0x2e8891&&_0x2e8891['length']>0x0&&'[DONE]'!==_0x2e8891)['map'](_0x3a6182=>{const {choices:_0x275a95}=JSON['parse'](_0x3a6182);if(_0x275a95[0x0]?.['delta']?.['content'])return _0x275a95[0x0]['delta']['content'];})['filter'](_0x2e66e4=>_0x2e66e4)['join']('');}}class AWSTextAdapter extends ar{static get['pluginName'](){return'AWSTextAdapter';}['init'](){super['init'](),_0xa8aac2('ai-aws-adapter-not-supported');}async['sendRequest'](_0x52970f){throw _0x4e5dbd('ai-aws-adapter-not-supported'),new er(Fn(this['editor']['locale'],'AI_ERROR_AWS_NOT_SUPPORTED'));}}class ia extends _0x2cf640{constructor(_0x5ae55c,_0x4a139d={}){super(_0x5ae55c),this['isToggleable']=!0x0,this['set']('side',_0x4a139d['side']||'top');const _0x444a12=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-tab-button',..._0x5f0c81(_0x4a139d['class']||[]),_0x444a12['to']('side',_0x2c0945=>'ck-tab-button_'+_0x2c0945),_0x444a12['to']('class')]}});}['show'](){this['set']('isVisible',!0x0);}['hide'](){this['set']('isVisible',!0x1);}}class ea extends _0xc3e5b1{['children'];constructor(_0xb6ef17,_0x545a6a={}){super(_0xb6ef17);const _0x2d1c51=this['bindTemplate'];this['set']('isVisible',!0x1),this['set']('class',''),this['children']=this['createCollection'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck-tab-panel',..._0x5f0c81(_0x545a6a['class']||[]),_0x2d1c51['to']('class'),_0x2d1c51['if']('isVisible','ck-hidden',_0x36774e=>!_0x36774e)]},'children':this['children']});}['show'](){this['set']('isVisible',!0x0);}['hide'](){this['set']('isVisible',!0x1);}}class ss extends _0xc3e5b1{['buttonViews']=this['createCollection']();['panelViews']=this['createCollection']();['_tabs']=new Map();constructor(_0x3270d4,_0x47c2e1={}){super(_0x3270d4),this['set']('class',void 0x0),this['set']('activeTab',null),this['set']('side',_0x47c2e1['side']||'top'),this['set']('isMaximized',!0x1);const _0x554973=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset','ck-tabs',..._0x5f0c81(_0x47c2e1['class']||[]),_0x554973['to']('side',_0x19481f=>'ck-tabs_'+_0x19481f),_0x554973['to']('class'),_0x554973['to']('isMaximized',_0x3c9cb=>_0x3c9cb?'ck-ai-tabs_maximized':'')],'tabindex':'0'},'children':[{'tag':'div','attributes':{'class':['ck','ck-tabs__buttons-container',_0x554973['to']('side',_0x4cc745=>'ck-tabs__buttons-container_'+_0x4cc745)]},'children':this['buttonViews']},{'tag':'div','attributes':{'class':['ck','ck-tabs__panels-container',_0x554973['to']('side',_0x1849cf=>'ck-tabs__panels-container_'+_0x1849cf)]},'children':this['panelViews']},..._0x5f0c81(_0x47c2e1['children']||[])]});}['getTabIds'](){return[...this['_tabs']['keys']()];}['getTab'](_0x23ecea){const _0x58a82d=this['_tabs']['get'](_0x23ecea);return _0x58a82d||null;}['addTab'](_0x11cdc5){const _0x194960=this['_setupButton']({'id':_0x11cdc5['id'],'label':_0x11cdc5['buttonLabel'],'icon':_0x11cdc5['buttonIcon'],'order':_0x11cdc5['order']}),_0x4e8c0a=new ea(this['locale']);return _0x4e8c0a['render'](),_0x11cdc5['content']&&_0x4e8c0a['children']['add'](_0x11cdc5['content']),this['panelViews']['add'](_0x4e8c0a),this['_tabs']['set'](_0x11cdc5['id'],{'button':_0x194960,'panel':_0x4e8c0a,'order':void 0x0!==_0x11cdc5['order']?_0x11cdc5['order']:null}),this['fire']('addTab:'+_0x11cdc5['id'],{'id':_0x11cdc5['id'],'button':_0x194960,'panel':_0x4e8c0a}),null===this['activeTab']?this['activateTab'](_0x11cdc5['id']):this['_hidePanel'](_0x11cdc5['id']),{'button':_0x194960,'panel':_0x4e8c0a};}['activateTab'](_0x3f9f72){if(null!==_0x3f9f72&&!this['getTab'](_0x3f9f72))throw new _0x563e6a('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0x3f9f72});this['activeTab']!==_0x3f9f72&&(this['activeTab']&&this['_hidePanel'](this['activeTab']),this['activeTab']=_0x3f9f72,_0x3f9f72&&this['_showPanel'](_0x3f9f72),this['fire']('activateTab:'+_0x3f9f72,_0x3f9f72));}['showTab'](_0xd35a32){if(!this['getTab'](_0xd35a32))throw new _0x563e6a('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0xd35a32});this['_showPanel'](_0xd35a32),this['_showButton'](_0xd35a32),this['fire']('show:'+_0xd35a32,_0xd35a32);}['hideTab'](_0x198586){if(!this['getTab'](_0x198586))throw new _0x563e6a('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0x198586});const _0xebcad7=this['activeTab'];this['_hidePanel'](_0x198586),this['_hideButton'](_0x198586);const _0x1f2f5a=this['getTabIds']();_0xebcad7===_0x198586&&_0x1f2f5a['length']>0x1&&this['activateTab'](_0x1f2f5a['find'](_0x44d9a6=>_0x44d9a6!==_0x198586)),this['fire']('hide:'+_0x198586,_0x198586);}['_getPanel'](_0x49cd23){const _0x3633b0=this['_tabs']['get'](_0x49cd23);return _0x3633b0?_0x3633b0['panel']:null;}['_showPanel'](_0x18c493){null!==this['activeTab']&&this['activeTab']!==_0x18c493||this['_getPanel'](_0x18c493)['show']();}['_hidePanel'](_0x120d13){const _0x4753db=this['_getPanel'](_0x120d13);_0x4753db['isVisible']&&(this['activeTab']===_0x120d13&&(this['activeTab']=null),_0x4753db['hide']());}['_getButton'](_0x29c593){const _0x270f92=this['_tabs']['get'](_0x29c593);return _0x270f92?_0x270f92['button']:null;}['_showButton'](_0x4768c7){this['_getButton'](_0x4768c7)['show']();}['_hideButton'](_0xb53933){this['_getButton'](_0xb53933)['hide']();}['_setupButton'](_0xacacd9){const _0x22189b=new ia(this['locale'],{'side':this['side']}),_0x26649b=this['buttonViews'];if(_0x22189b['set']({'label':_0xacacd9['label'],'icon':_0xacacd9['icon'],'tooltip':!0x0,'withText':!0x0}),_0x22189b['bind']('isOn')['to'](this,'activeTab',_0x4c0d60=>_0x4c0d60===_0xacacd9['id']),_0x22189b['bind']('side')['to'](this,'side'),_0xacacd9['order']){const _0x3f4ba1=[...this['_tabs']]['reduce']((_0x38543b,_0x1292ee)=>{const _0x137a32=_0x1292ee[0x0],{order:_0x1e9632}=_0x1292ee[0x1];return!_0x1e9632||_0x1e9632>_0xacacd9['order']?_0x38543b:_0x1e9632>=_0x38543b['order']?{'id':_0x137a32,'order':_0x1e9632}:_0x38543b;},{'id':'','order':0x0}),_0x5709bb=_0x26649b['getIndex'](this['_getButton'](_0x3f4ba1['id']));_0x26649b['add'](_0x22189b,_0x5709bb+0x1);}else _0x26649b['add'](_0x22189b);return _0x22189b['on']('execute',()=>{this['activateTab'](_0xacacd9['id']);}),_0x22189b;}}const ni=['overlay','sidebar','custom'],oi=['left','right'];class hi extends ss{constructor(_0x590e57,_0x23826f={}){super(_0x590e57,_0x23826f),this['set']('type',_0x23826f['type']||'sidebar'),this['set']('side',_0x23826f['side']||'right'),this['set']('isVisible',_0x23826f['visibleByDefault']??!0x0);const _0x489093=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-tabs',_0x489093['if']('type','ck-ai-tabs__overlay',_0x9b606f=>'overlay'===_0x9b606f),_0x489093['if']('type','ck-ai-tabs__sidebar',_0x3f995d=>'sidebar'===_0x3f995d),_0x489093['if']('isVisible','ck-hidden',_0x134383=>!_0x134383)]}}),this['buttonViews']['on']('add',(_0x47b0eb,_0x53bc85)=>{_0x53bc85['set']('withText',!0x1);});}}class it extends _0x3a5602{['view'];['container']=null;['showResizeButton']=!0x0;static get['pluginName'](){return'AITabs';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x573600){super(_0x573600);const _0xd7c5dc=this['context']['config']['get']('ai.container');if(this['set']('side','right'),!_0xd7c5dc)throw new _0x563e6a('ai-tabs-configuration-not-found');if(void 0x0!==_0xd7c5dc['showResizeButton']&&(this['showResizeButton']=_0xd7c5dc['showResizeButton']),'sidebar'!==_0xd7c5dc['type']&&'overlay'!==_0xd7c5dc['type']||_0xd7c5dc['side']&&(this['side']=_0xd7c5dc['side']),'sidebar'===_0xd7c5dc['type']){if(this['container']=_0xd7c5dc['element'],this['set']('type','sidebar'),!this['container'])throw new _0x563e6a('ai-tabs-sidebar-container-element-not-found');}else'overlay'===_0xd7c5dc['type']?(this['container']=document['body'],this['set']('type','overlay')):(this['container']=null,this['set']('type','custom'));this['view']=new hi(this['context']['locale'],{'side':this['side'],'type':this['type'],'visibleByDefault':void 0x0===_0xd7c5dc['visibleByDefault']||_0xd7c5dc['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 _0x2cda04&&this['context']['ui']['focusTracker']['add'](this['view']['element']);}['switchType'](_0x11dccf){if(_0x11dccf&&this['type']!==_0x11dccf){if(!ni['includes'](_0x11dccf))throw new _0x563e6a('ai-tabs-unsupported-ui-type');this['type']=_0x11dccf;}}['switchSide'](_0x1a9887){if(_0x1a9887&&this['side']!==_0x1a9887){if(!oi['includes'](_0x1a9887))throw new _0x563e6a('ai-tabs-unsupported-ui-side');this['side']=_0x1a9887;}}['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 tt extends _0x3a5602{['_apiUrl'];['_token'];['_decoder'];static get['requires'](){return['CloudServices'];}static get['pluginName'](){return'AIConnector';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x49cfd7){super(_0x49cfd7),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 _0xc35e13=this['context']['plugins']['get']('CloudServices');if(!_0xc35e13['token'])throw new _0x563e6a('ai-missing-token',this);this['_token']=_0xc35e13['token'];}['startConversation'](_0x26bb6d,_0x203cef){const _0x3f70c7=this['_sendApiRequest']('/conversations','POST',{'id':_0x26bb6d,'group':_0x203cef});return{'getConversation':async()=>(await _0x3f70c7['request'])['json'](),'abortController':_0x3f70c7['abortController']};}['queryAssistant']({message:_0xc8c5bf,conversationId:_0xcca93a,parts:_0x444b62,capabilities:_0x1d439f,model:_0x294a0a,attributes:_0x518071}){const _0x45c84a={'prompt':_0xc8c5bf,'content':_0x444b62,'model':_0x294a0a,..._0x1d439f&&{'capabilities':_0x1d439f},..._0x518071&&{'attributes':_0x518071}},_0x28582b=this['_sendApiRequest']('/conversations/'+_0xcca93a+'/messages','POST',_0x45c84a);return{'getStream':async()=>{const _0x1bca08=(await _0x28582b['request'])['body'];return this['_getStreamReader'](_0x1bca08);},'abortController':_0x28582b['abortController']};}['executeCustomAction']({content:_0x32e4db,message:_0x3777ff,model:_0x4e442d,outputFormat:_0x4853f6}){const _0x175757={'content':[{'type':'text','content':_0x32e4db}],'prompt':_0x3777ff,'model':_0x4e442d,'outputFormat':_0x4853f6},_0x247aa7=this['_sendApiRequest']('/actions/custom/calls','POST',_0x175757);return{'getStream':async()=>{const _0x1c8e9e=(await _0x247aa7['request'])['body'];return this['_getStreamReader'](_0x1c8e9e);},'abortController':_0x247aa7['abortController']};}['executeAction']({actionName:_0x41631d,content:_0x59e4c8,args:_0x58dd13}){const _0x3573a8={'content':[{'type':'text','content':_0x59e4c8}],'args':_0x58dd13},_0xca5197=this['_sendApiRequest']('/actions/system/'+_0x41631d+'/calls','POST',_0x3573a8);return{'getStream':async()=>{const _0x5f323e=(await _0xca5197['request'])['body'];return this['_getStreamReader'](_0x5f323e);},'abortController':_0xca5197['abortController']};}['uploadFile'](_0x19788c,_0x27fcfb,_0x2732f4){const _0x592fa2=new FormData();_0x592fa2['append']('file',_0x27fcfb,_0x27fcfb['name']),_0x2732f4&&_0x592fa2['append']('attributes',JSON['stringify'](_0x2732f4));const _0x174d18=this['_sendApiRequest']('/conversations/'+_0x19788c+'/files','POST',_0x592fa2);return{'getId':async()=>(await _0x174d18['request'])['json'](),'abortController':_0x174d18['abortController']};}['fetchDocument'](_0x10d3d8,_0x5777b7){const _0x3a52cf=this['_sendApiRequest']('/conversations/'+_0x10d3d8+'/documents/'+_0x5777b7,'GET');return{'getDocument':async()=>(await _0x3a52cf['request'])['json'](),'abortController':_0x3a52cf['abortController']};}['uploadDocument'](_0x1f0c83,_0x4b5ef9,_0x33a82e){const _0x2e3d8f={'content':_0x4b5ef9};_0x33a82e&&(_0x2e3d8f['attributes']=_0x33a82e);const _0x30aae6=this['_sendApiRequest']('/conversations/'+_0x1f0c83+'/documents','POST',_0x2e3d8f);return{'getId':async()=>(await _0x30aae6['request'])['json'](),'abortController':_0x30aae6['abortController']};}['fetchConversations'](_0x3109a9,_0x32a693={}){const _0x4823c2=new URLSearchParams();_0x4823c2['append']('group',_0x3109a9),_0x4823c2['append']('excludeEmpty',!0x1!==_0x32a693['excludeEmpty']?'true':'false'),_0x4823c2['append']('limit',_0x32a693['limit']?_0x32a693['limit']['toString']():'100'),_0x4823c2['append']('sortBy',_0x32a693['sortBy']?_0x32a693['sortBy']:'createdAt'),_0x4823c2['append']('order',_0x32a693['order']?_0x32a693['order']:'desc');const _0x2c6d06=this['_sendApiRequest']('/conversations?'+_0x4823c2['toString'](),'GET');return{'getConversations':async()=>{const _0x34e080=await _0x2c6d06['request'];return(await _0x34e080['json']())['items'];},'abortController':_0x2c6d06['abortController']};}['deleteConversation'](_0x5b123e){const _0x26f3bb=this['_sendApiRequest']('/conversations/'+_0x5b123e,'DELETE');return{'execute':async()=>{await _0x26f3bb['request'];},'abortController':_0x26f3bb['abortController']};}['updateConversation'](_0x42be59,_0x182969){const _0x1ae802=this['_sendApiRequest']('/conversations/'+_0x42be59,'PATCH',_0x182969);return{'getResult':async()=>(await _0x1ae802['request'],_0x182969),'abortController':_0x1ae802['abortController']};}['fetchConversation'](_0x5194be){const _0x420e81=this['_sendApiRequest']('/conversations/'+_0x5194be,'GET');return{'getConversation':async()=>(await _0x420e81['request'])['json'](),'abortController':_0x420e81['abortController']};}['fetchConversationMessages'](_0x4b3d3b){const _0x3a75a5=this['_sendApiRequest']('/conversations/'+_0x4b3d3b+'/messages','GET');return{'getMessages':async()=>{const _0x49f619=await _0x3a75a5['request'];return(await _0x49f619['json']())['items'];},'abortController':_0x3a75a5['abortController']};}['uploadUrl'](_0x22a013,_0x5db73a,_0x4ea6f8){const _0x539d23=this['_sendApiRequest']('/conversations/'+_0x22a013+'/web-resources','POST',{'url':_0x5db73a,'attributes':_0x4ea6f8});return{'getId':async()=>(await _0x539d23['request'])['json'](),'abortController':_0x539d23['abortController']};}['getModels'](_0x2d149f='en'){const _0x451f3d=new URLSearchParams();_0x451f3d['append']('language',_0x2d149f);const _0x4252f7='/models/1?'+_0x451f3d['toString'](),_0x85cbe5=this['_sendApiRequest'](_0x4252f7,'GET');return{'list':async()=>await(await _0x85cbe5['request'])['json'](),'abortController':_0x85cbe5['abortController']};}['deleteFile'](_0xfceb9e,_0x4e9981){const _0x48fe67=this['_sendApiRequest']('/conversations/'+_0xfceb9e+'/files/'+_0x4e9981,'DELETE');return{'execute':async()=>{await _0x48fe67['request'];},'abortController':_0x48fe67['abortController']};}['deleteDocument'](_0x3137b5,_0x13f8a9){const _0x48c4f9=this['_sendApiRequest']('/conversations/'+_0x3137b5+'/documents/'+_0x13f8a9,'DELETE');return{'execute':async()=>{await _0x48c4f9['request'];},'abortController':_0x48c4f9['abortController']};}['deleteWebResource'](_0x4f6d3b,_0x5866f6){const _0x4c8da0=this['_sendApiRequest']('/conversations/'+_0x4f6d3b+'/web-resources/'+_0x5866f6,'DELETE');return{'execute':async()=>{await _0x4c8da0['request'];},'abortController':_0x4c8da0['abortController']};}['callSystemReview']({reviewName:_0x45d6be,content:_0x1ad0cf,args:_0x2d3588}){const _0x51a6d1=this['_sendApiRequest']('/reviews/system/'+_0x45d6be+'/calls','POST',{'content':[{'type':'text','content':_0x1ad0cf}],'args':_0x2d3588});return{'getStream':async()=>{const _0x32f0de=(await _0x51a6d1['request'])['body'];return this['_getStreamReader'](_0x32f0de);},'abortController':_0x51a6d1['abortController']};}['callCustomReview']({content:_0xe4f081,prompt:_0x24c8e6,model:_0x2bf851}){const _0xa21c0f=this['_sendApiRequest']('/reviews/custom/calls','POST',{'content':[{'type':'text','content':_0xe4f081}],'prompt':_0x24c8e6,'model':_0x2bf851});return{'getStream':async()=>{const _0xf24813=(await _0xa21c0f['request'])['body'];return this['_getStreamReader'](_0xf24813);},'abortController':_0xa21c0f['abortController']};}['upsertAIChatRating'](_0x3e5054,_0x416dba,_0x274757){const _0x10ca93=this['_sendApiRequest']('/conversations/'+_0x3e5054+'/messages/'+_0x416dba+'/ratings','PUT',{'positiveCount':_0x274757['positiveCount'],'totalCount':_0x274757['totalCount'],'modificationId':_0x274757['modificationId']});return{'execute':async()=>{await _0x10ca93['request'];},'abortController':_0x10ca93['abortController']};}['upsertAIActionRating'](_0x5334e0,_0x85f741,_0x3d8a70){const _0x56f32d=this['_sendApiRequest']('/actions/system/'+_0x5334e0+'/calls/'+_0x85f741+'/ratings','PUT',{'positiveCount':_0x3d8a70['positiveCount'],'totalCount':_0x3d8a70['totalCount']});return{'execute':async()=>{await _0x56f32d['request'];},'abortController':_0x56f32d['abortController']};}['upsertCustomAIActionRating'](_0x589ebb,_0x4e6f4c){const _0xb1d43d=this['_sendApiRequest']('/actions/custom/calls/'+_0x589ebb+'/ratings','PUT',{'positiveCount':_0x4e6f4c['positiveCount'],'totalCount':_0x4e6f4c['totalCount']});return{'execute':async()=>{await _0xb1d43d['request'];},'abortController':_0xb1d43d['abortController']};}['upsertAIReviewRating'](_0x2e4e28,_0x8b97f8,_0x151ba7,_0x5a6ae6){const _0x53c00b=this['_sendApiRequest']('/reviews/system/'+_0x2e4e28+'/calls/'+_0x8b97f8+'/ratings','PUT',{'positiveCount':_0x151ba7['positiveCount'],'totalCount':_0x151ba7['totalCount'],'dataId':_0x5a6ae6});return{'execute':async()=>{await _0x53c00b['request'];},'abortController':_0x53c00b['abortController']};}['upsertCustomAIReviewRating'](_0x311d6f,_0x1d982a,_0x34b21d){const _0x5c44d9=this['_sendApiRequest']('/reviews/custom/calls/'+_0x311d6f+'/ratings','PUT',{'positiveCount':_0x1d982a['positiveCount'],'totalCount':_0x1d982a['totalCount'],'dataId':_0x34b21d});return{'execute':async()=>{await _0x5c44d9['request'];},'abortController':_0x5c44d9['abortController']};}['_sendApiRequest'](_0x3df665,_0x2ff277,_0x4927d4){const _0x42b500=new AbortController(),_0x58f4f9=_0x4927d4 instanceof FormData,_0x93aeb1={'Authorization':'Bearer\x20'+this['_token']?.['value']};_0x4927d4&&!_0x58f4f9&&(_0x93aeb1['Content-Type']='application/json');const _0x11fbb8={'method':_0x2ff277,'headers':_0x93aeb1,'signal':_0x42b500['signal']};return _0x4927d4&&(_0x11fbb8['body']=_0x58f4f9?_0x4927d4:JSON['stringify'](_0x4927d4)),{'request':fetch(''+this['_apiUrl']+_0x3df665,_0x11fbb8)['catch'](_0x1f70e0=>{this['_handleError'](_0x1f70e0);})['then'](_0x5ea8fc=>_0x5ea8fc['ok']?_0x5ea8fc:_0x5ea8fc['json']()['then'](_0x369fec=>{throw{'url':this['_apiUrl'],'path':_0x3df665,'method':_0x2ff277,'body':_0x4927d4,'status':(_0x5ea8fc||{})['status'],'statusText':(_0x5ea8fc||{})['statusText'],'code':_0x369fec['code'],'message':_0x369fec['message'],'traceId':_0x369fec['traceId']};})),'abortController':_0x42b500};}async*['_getStreamReader'](_0x15ae6e){const _0x5df930=[],_0xe67a54=_0x15ae6e['getReader'](),_0x7c836c=$t({'onError':_0x59ce7d=>{this['_handleError'](_0x59ce7d);},'onEvent':_0xff1d32=>{_0xff1d32['data']=JSON['parse'](_0xff1d32['data']),_0x5df930['push'](_0xff1d32);}});try{let _0x11de79=!0x1;for(;!_0x11de79;){const {done:_0x2d1fa4,value:_0xdc1800}=await _0xe67a54['read']();_0x2d1fa4&&(_0x11de79=!0x0),_0x7c836c['feed'](this['_decoder']['decode'](_0xdc1800,{'stream':!0x0})),yield*_0x5df930,_0x5df930['length']=0x0;}}catch(_0xb0df63){this['_handleError'](_0xb0df63);}finally{_0xe67a54['releaseLock'](),_0x7c836c['reset']();}}['_handleError'](_0x551951){if(_0x551951 instanceof _0x563e6a)throw _0x551951;if(_0x551951 instanceof Error&&'AbortError'===_0x551951['name'])throw new _0x563e6a('ai-request-aborted',this,{'originalError':_0x551951});throw new _0x563e6a('ai-request-failed',this,{'originalError':_0x551951});}}function i(_0x11a33f,_0xe77c5b,_0x41c25d){const t=_0x11a33f['t'];switch(_0xe77c5b){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'},_0x41c25d);case'AI_SUGGESTION_CONTENT_PART_REJECTED':return t({'id':'AI_SUGGESTION_CONTENT_PART_REJECTED','string':'Change\x20was\x20rejected'});case'AI_SUGGESTION_CONTENT_PART_OUTDATED':return t({'id':'AI_SUGGESTION_CONTENT_PART_OUTDATED','string':'Change\x20is\x20outdated'});case'AI_SUGGESTION_CONTENT_PART_ALREADY_APPLIED':return t({'id':'AI_SUGGESTION_CONTENT_PART_ALREADY_APPLIED','string':'Change\x20is\x20already\x20applied'});case'AI_SUGGESTION_CONTENT_PART_APPLY':return t({'id':'AI_SUGGESTION_CONTENT_PART_APPLY','string':'Apply\x20change'});case'AI_SUGGESTION_CONTENT_PART_ADD_SUGGESTION':return t({'id':'AI_SUGGESTION_CONTENT_PART_ADD_SUGGESTION','string':'Add\x20as\x20suggestion'});case'AI_SUGGESTION_CONTENT_PART_REJECT':return t({'id':'AI_SUGGESTION_CONTENT_PART_REJECT','string':'Reject\x20change'});case'AI_SUGGESTION_CONTENT_PART_REMOVED':return t({'id':'AI_SUGGESTION_CONTENT_PART_REMOVED','string':'Removed\x20content.\x20Use\x20\x22Show\x20details\x22\x20to\x20learn\x20more.'});case'AI_SUGGESTION_CONTENT_PART_STATE_ACCEPTED':return t({'id':'AI_SUGGESTION_CONTENT_PART_STATE_ACCEPTED','string':'Approved'});case'AI_SUGGESTION_CONTENT_PART_STATE_REJECTED':return t({'id':'AI_SUGGESTION_CONTENT_PART_STATE_REJECTED','string':'Rejected'});case'AI_SUGGESTION_CONTENT_PART_STATE_OUTDATED':return t({'id':'AI_SUGGESTION_CONTENT_PART_STATE_OUTDATED','string':'Outdated'});case'AI_DISCLAIMER_TEXT':return t({'id':'AI_DISCLAIMER_TEXT','string':'AI\x20can\x20make\x20mistakes.\x20Please\x20double-check\x20responses.'});case'AI_TABS_LABEL_MAXIMIZE':return t({'id':'AI_TABS_LABEL_MAXIMIZE','string':'Maximize'});case'AI_TABS_LABEL_MINIMIZE':return t({'id':'AI_TABS_LABEL_MINIMIZE','string':'Minimize'});case'AI_CHAT_HEADING':return t({'id':'AI_CHAT_HEADING','string':'Chat'});case'AI_CHAT_SOURCES_HEADER':return t({'id':'AI_CHAT_SOURCES_HEADER','string':'Sources'});case'AI_CHAT_UNTITLED_CONVERSATION':return t({'id':'AI_CHAT_UNTITLED_CONVERSATION','string':'Untitled\x20conversation'});case'AI_CHAT_LABEL_NEW_CHAT':return t({'id':'AI_CHAT_LABEL_NEW_CHAT','string':'New\x20chat'});case'AI_CHAT_STOP_GENERATING':return t({'id':'AI_CHAT_STOP_GENERATING','string':'Stop\x20generating'});case'AI_CHAT_IS_WRITING':return t({'id':'AI_CHAT_IS_WRITING','string':'AI\x20is\x20writing...'});case'AI_CHAT_PROMPT_EMPTY_ERROR':return t({'id':'AI_CHAT_PROMPT_EMPTY_ERROR','string':'This\x20field\x20cannot\x20be\x20empty.'});case'AI_CHAT_LABEL_SUBMIT':return t({'id':'AI_CHAT_LABEL_SUBMIT','string':'Submit'});case'AI_CHAT_WELCOME_MESSAGE':return t({'id':'AI_CHAT_WELCOME_MESSAGE','string':'Hi!\x20I\x20can\x20help\x20you\x20draft,\x20rewrite,\x20and\x20improve\x20your\x20text,\x20explore\x20ideas,\x20research\x20topics,\x20and\x20solve\x20problems.\x20How\x20can\x20I\x20help\x20right\x20now?'});case'AI_CHAT_ABORTED_MESSAGE':return t({'id':'AI_CHAT_ABORTED_MESSAGE','string':'The\x20request\x20was\x20aborted.'});case'AI_CHAT_GENERIC_ERROR':return t({'id':'AI_CHAT_GENERIC_ERROR','string':'Something\x20went\x20wrong\x20while\x20processing\x20your\x20request.\x20Please\x20try\x20again.'});case'AI_CHAT_UNABLE_TO_START_CONVERSATION':return t({'id':'AI_CHAT_UNABLE_TO_START_CONVERSATION','string':'Unable\x20to\x20start\x20conversation.\x20Please\x20make\x20sure\x20you\x20are\x20online\x20and\x20try\x20again.'});case'AI_CHAT_UNABLE_TO_LOAD_CONVERSATION':return t({'id':'AI_CHAT_UNABLE_TO_LOAD_CONVERSATION','string':'Unable\x20to\x20load\x20chosen\x20conversation.\x20Please\x20make\x20sure\x20you\x20are\x20online\x20and\x20try\x20again.'});case'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_FILE':return t({'id':'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_FILE','string':'Failed\x20to\x20upload\x20files:\x20%0.\x20Please\x20try\x20again.'},_0x41c25d);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.'},_0x41c25d);case'AI_CHAT_RESOURCE_LOAD_FAILED':return t({'id':'AI_CHAT_RESOURCE_LOAD_FAILED','string':'Failed\x20to\x20load\x20resource.\x20Please\x20try\x20again.'});case'AI_CHAT_CONTEXT_CURRENT_DOCUMENT':return t({'id':'AI_CHAT_CONTEXT_CURRENT_DOCUMENT','string':'Current\x20document'});case'AI_CHAT_CONTEXT_REMOVE_FROM_CONTEXT':return t({'id':'AI_CHAT_CONTEXT_REMOVE_FROM_CONTEXT','string':'Remove\x20from\x20context'});case'AI_CHAT_CONTEXT_ADD_CONTEXT':return t({'id':'AI_CHAT_CONTEXT_ADD_CONTEXT','string':'Add\x20context'});case'AI_CHAT_CONTEXT_URL_LABEL':return t({'id':'AI_CHAT_CONTEXT_URL_LABEL','string':'URL'});case'AI_CHAT_CONTEXT_FILE_LABEL':return t({'id':'AI_CHAT_CONTEXT_FILE_LABEL','string':'File'});case'AI_CHAT_CONTEXT_CURRENT_CONTEXT_LABEL':return t({'id':'AI_CHAT_CONTEXT_CURRENT_CONTEXT_LABEL','string':'Current\x20context'});case'AI_CHAT_CONTEXT_DOCUMENT_SELECTION_LABEL':return t({'id':'AI_CHAT_CONTEXT_DOCUMENT_SELECTION_LABEL','string':'Selected\x20content'});case'AI_CHAT_SEARCH_WEB':return t({'id':'AI_CHAT_SEARCH_WEB','string':'Web\x20search'});case'AI_CHAT_ENABLE_WEB_SEARCH':return t({'id':'AI_CHAT_ENABLE_WEB_SEARCH','string':'Enable\x20web\x20search'});case'AI_CHAT_DISABLE_WEB_SEARCH':return t({'id':'AI_CHAT_DISABLE_WEB_SEARCH','string':'Disable\x20web\x20search'});case'AI_CHAT_REASONING':return t({'id':'AI_CHAT_REASONING','string':'Reasoning'});case'AI_CHAT_ENABLE_REASONING':return t({'id':'AI_CHAT_ENABLE_REASONING','string':'Enable\x20reasoning'});case'AI_CHAT_DISABLE_REASONING':return t({'id':'AI_CHAT_DISABLE_REASONING','string':'Disable\x20reasoning'});case'AI_CHAT_COMMANDS':return t({'id':'AI_CHAT_COMMANDS','string':'Commands'});case'AI_CHAT_SEARCH_RESOURCES':return t({'id':'AI_CHAT_SEARCH_RESOURCES','string':'Search\x20resources'});case'AI_CHAT_CONTEXT_URL_BACK_TO_CONTEXT':return t({'id':'AI_CHAT_CONTEXT_URL_BACK_TO_CONTEXT','string':'Back\x20to\x20context\x20options'});case'AI_CHAT_CONTEXT_URL_ADD_URL':return t({'id':'AI_CHAT_CONTEXT_URL_ADD_URL','string':'Add\x20URL'});case'AI_CHAT_CONTEXT_URL_PLACEHOLDER':return t({'id':'AI_CHAT_CONTEXT_URL_PLACEHOLDER','string':'Add\x20URL...'});case'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_URL':return t({'id':'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_URL','string':'Failed\x20to\x20upload\x20URL:\x20%0.\x20Please\x20try\x20again.'},_0x41c25d);case'AI_CHAT_CONTEXT_INVALID_DATA':return t({'id':'AI_CHAT_CONTEXT_INVALID_DATA','string':'Invalid\x20context\x20data\x20type\x20for\x20the\x20selected\x20resource.'});case'AI_CHAT_CONTEXT_UNSUPPORTED_TYPE':return t({'id':'AI_CHAT_CONTEXT_UNSUPPORTED_TYPE','string':'Unsupported\x20resource\x20type.\x20Only\x20files\x20and\x20URLs\x20are\x20supported.'});case'AI_CHAT_CONTEXT_URL_EMPTY_ERROR':return t({'id':'AI_CHAT_CONTEXT_URL_EMPTY_ERROR','string':'URL\x20cannot\x20be\x20empty.'});case'AI_CHAT_CONTEXT_URL_INVALID_ERROR':return t({'id':'AI_CHAT_CONTEXT_URL_INVALID_ERROR','string':'Please\x20enter\x20a\x20valid\x20URL.'});case'AI_CHAT_INVALID_REQUEST':return t({'id':'AI_CHAT_INVALID_REQUEST','string':'Something\x20went\x20wrong\x20while\x20processing\x20your\x20request.\x20Please\x20try\x20again.'});case'AI_CHAT_CONTEXT_UNSUPPORTED_FILE_TYPE':return t({'id':'AI_CHAT_CONTEXT_UNSUPPORTED_FILE_TYPE','string':'The\x20file\x20type\x20is\x20not\x20supported.\x20Please\x20upload\x20a\x20different\x20file.'});case'AI_CHAT_CONTEXT_FILE_TOO_LARGE':return t({'id':'AI_CHAT_CONTEXT_FILE_TOO_LARGE','string':'The\x20file\x20is\x20too\x20large.\x20Please\x20upload\x20a\x20smaller\x20file.'});case'AI_CHAT_CONTEXT_FILE_TOO_MANY_PAGES':return t({'id':'AI_CHAT_CONTEXT_FILE_TOO_MANY_PAGES','string':'The\x20file\x20has\x20too\x20many\x20pages.\x20Please\x20upload\x20a\x20file\x20with\x20fewer\x20pages.'});case'AI_CHAT_CONTEXT_FORM_DATA_SIZE_LIMITS_EXCEEDED':return t({'id':'AI_CHAT_CONTEXT_FORM_DATA_SIZE_LIMITS_EXCEEDED','string':'The\x20form\x20data\x20size\x20limits\x20are\x20exceeded.\x20Please\x20upload\x20a\x20smaller\x20file.'});case'AI_CHAT_FEED_LOADING_MESSAGE_REGULAR':return t({'id':'AI_CHAT_FEED_LOADING_MESSAGE_REGULAR','string':'AI\x20is\x20preparing\x20a\x20response...'});case'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH':return t({'id':'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH','string':'AI\x20is\x20searching\x20the\x20web\x20to\x20provide\x20the\x20most\x20accurate\x20answer...'});case'AI_CHAT_FEED_LOADING_MESSAGE_REASONING':return t({'id':'AI_CHAT_FEED_LOADING_MESSAGE_REASONING','string':'AI\x20is\x20using\x20reasoning\x20to\x20provide\x20the\x20most\x20accurate\x20answer...'});case'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH_REASONING':return t({'id':'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH_REASONING','string':'AI\x20is\x20using\x20reasoning\x20and\x20searching\x20the\x20web\x20to\x20provide\x20the\x20most\x20accurate\x20answer...'});case'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH':return t({'id':'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH','string':'Scanned\x20the\x20internet\x20for\x20insights'});case'AI_CHAT_FEED_REPLY_ITEM_USED_REASONING':return t({'id':'AI_CHAT_FEED_REPLY_ITEM_USED_REASONING','string':'AI\x20used\x20reasoning\x20to\x20improve\x20the\x20response'});case'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH_REASONING':return t({'id':'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH_REASONING','string':'AI\x20used\x20search\x20and\x20reasoning\x20to\x20improve\x20the\x20response'});case'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REGULAR':return t({'id':'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REGULAR','string':'Ask\x20AI\x20anything...'});case'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH':return t({'id':'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH','string':'Ask\x20AI\x20anything\x20(web\x20search\x20enabled)...'});case'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REASONING':return t({'id':'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REASONING','string':'Ask\x20AI\x20anything\x20(reasoning\x20enabled)...'});case'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH_REASONING':return t({'id':'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH_REASONING','string':'Ask\x20AI\x20anything\x20(web\x20search\x20and\x20reasoning\x20enabled)...'});case'AI_CHAT_SUGGESTION_ACTION_SUGGEST_ALL':return t({'id':'AI_CHAT_SUGGESTION_ACTION_SUGGEST_ALL','string':'Suggest\x20all'},_0x41c25d);case'AI_CHAT_SUGGESTION_ACTION_SUGGEST':return t({'id':'AI_CHAT_SUGGESTION_ACTION_SUGGEST','string':'Suggest'},_0x41c25d);case'AI_CHAT_SUGGESTION_ACTION_APPLY_ALL':return t({'id':'AI_CHAT_SUGGESTION_ACTION_APPLY_ALL','string':'Apply\x20all'});case'AI_CHAT_SUGGESTION_ACTION_APPLY':return t({'id':'AI_CHAT_SUGGESTION_ACTION_APPLY','string':'Apply'});case'AI_CHAT_SUGGESTION_MORE_OPTIONS_TOOLTIP':return t({'id':'AI_CHAT_SUGGESTION_MORE_OPTIONS_TOOLTIP','string':'More\x20options'},_0x41c25d);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.'},_0x41c25d);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.'},_0x41c25d);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.'},_0x41c25d);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.'},_0x41c25d);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'},_0x41c25d);case'AI_BALLOON_APPLY_BUTTON':return t({'id':'AI_BALLOON_APPLY_BUTTON','string':'Apply'});case'AI_BALLOON_SUGGEST_BUTTON':return t({'id':'AI_BALLOON_SUGGEST_BUTTON','string':'Suggest'});case'AI_BALLOON_NEXT_LABEL':return t({'id':'AI_BALLOON_NEXT_LABEL','string':'Next'});case'AI_BALLOON_PREVIOUS_LABEL':return t({'id':'AI_BALLOON_PREVIOUS_LABEL','string':'Previous'});case'AI_SUGGESTION_NO_PARTS_WARNING':return t({'id':'AI_SUGGESTION_NO_PARTS_WARNING','string':'This\x20change\x20is\x20not\x20supported\x20by\x20the\x20editor\x20and\x20can\x27t\x20be\x20previewed\x20or\x20applied.'});case'AI_SUGGESTION_EMPTY_PART_WARNING':return t({'id':'AI_SUGGESTION_EMPTY_PART_WARNING','string':'Some\x20of\x20the\x20changes\x20are\x20not\x20supported\x20by\x20the\x20editor\x20and\x20can\x27t\x20be\x20previewed\x20or\x20applied.'});case'AI_ACTIONS_TRY_AGAIN':return t({'id':'AI_ACTIONS_TRY_AGAIN','string':'Retry'});case'AI_ACTIONS_PREVIOUS_INTERACTION':return t({'id':'AI_ACTIONS_PREVIOUS_INTERACTION','string':'Previous'});case'AI_ACTIONS_NEXT_INTERACTION':return t({'id':'AI_ACTIONS_NEXT_INTERACTION','string':'Next'});case'AI_MODEL_NAME_AUTO':return t({'id':'AI_MODEL_NAME_AUTO','string':'Auto'});case'AI_QUICK_ACTIONS_HEADING':return t({'id':'AI_QUICK_ACTIONS_HEADING','string':'AI\x20Quick\x20Actions'});case'AI_QUICK_ACTIONS_SEARCH':return t({'id':'AI_QUICK_ACTIONS_SEARCH','string':'Search\x20AI\x20commands'});case'AI_QUICK_ACTIONS_SEARCH_NOT_FOUND':return t({'id':'AI_QUICK_ACTIONS_SEARCH_NOT_FOUND','string':'No\x20AI\x20commands\x20found'});case'AI_QUICK_ACTIONS_ASK_AI':return t({'id':'AI_QUICK_ACTIONS_ASK_AI','string':'Ask\x20AI'});case'AI_QUICK_ACTIONS_CHAT_COMMANDS':return t({'id':'AI_QUICK_ACTIONS_CHAT_COMMANDS','string':'Chat\x20commands'});case'AI_QUICK_ACTIONS_IMPROVE_WRITING':return t({'id':'AI_QUICK_ACTIONS_IMPROVE_WRITING','string':'Improve\x20writing'});case'AI_QUICK_ACTIONS_CONTINUE_WRITING':return t({'id':'AI_QUICK_ACTIONS_CONTINUE_WRITING','string':'Continue\x20writing'});case'AI_QUICK_ACTIONS_FIX_GRAMMAR_SPELLING':return t({'id':'AI_QUICK_ACTIONS_FIX_GRAMMAR_SPELLING','string':'Fix\x20grammar\x20&\x20spelling'});case'AI_QUICK_ACTIONS_ADJUST_LENGTH':return t({'id':'AI_QUICK_ACTIONS_ADJUST_LENGTH','string':'Adjust\x20length'});case'AI_QUICK_ACTIONS_CHANGE_TONE':return t({'id':'AI_QUICK_ACTIONS_CHANGE_TONE','string':'Change\x20tone'});case'AI_QUICK_ACTIONS_TRANSLATE':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE','string':'Translate'});case'AI_QUICK_ACTIONS_EXPLAIN':return t({'id':'AI_QUICK_ACTIONS_EXPLAIN','string':'Explain'});case'AI_QUICK_ACTIONS_SUMMARIZE':return t({'id':'AI_QUICK_ACTIONS_SUMMARIZE','string':'Summarize'});case'AI_QUICK_ACTIONS_HIGHLIGHT_KEY_POINTS':return t({'id':'AI_QUICK_ACTIONS_HIGHLIGHT_KEY_POINTS','string':'Highlight\x20key\x20points'});case'AI_QUICK_ACTIONS_MAKE_SHORTER':return t({'id':'AI_QUICK_ACTIONS_MAKE_SHORTER','string':'Make\x20shorter'});case'AI_QUICK_ACTIONS_MAKE_LONGER':return t({'id':'AI_QUICK_ACTIONS_MAKE_LONGER','string':'Make\x20longer'});case'AI_QUICK_ACTIONS_MORE_CASUAL':return t({'id':'AI_QUICK_ACTIONS_MORE_CASUAL','string':'More\x20casual'});case'AI_QUICK_ACTIONS_MORE_DIRECT':return t({'id':'AI_QUICK_ACTIONS_MORE_DIRECT','string':'More\x20direct'});case'AI_QUICK_ACTIONS_MORE_FRIENDLY':return t({'id':'AI_QUICK_ACTIONS_MORE_FRIENDLY','string':'More\x20friendly'});case'AI_QUICK_ACTIONS_MORE_CONFIDENT':return t({'id':'AI_QUICK_ACTIONS_MORE_CONFIDENT','string':'More\x20confident'});case'AI_QUICK_ACTIONS_MORE_PROFESSIONAL':return t({'id':'AI_QUICK_ACTIONS_MORE_PROFESSIONAL','string':'More\x20professional'});case'AI_QUICK_ACTIONS_ADJUST_BASED_ON_DOCUMENT':return t({'id':'AI_QUICK_ACTIONS_ADJUST_BASED_ON_DOCUMENT','string':'Adjust\x20based\x20on\x20the\x20rest\x20of\x20the\x20document'});case'AI_QUICK_ACTIONS_TRANSLATE_ENGLISH':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_ENGLISH','string':'English'});case'AI_QUICK_ACTIONS_TRANSLATE_CHINESE':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_CHINESE','string':'Chinese\x20(Simplified)'});case'AI_QUICK_ACTIONS_TRANSLATE_FRENCH':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_FRENCH','string':'French'});case'AI_QUICK_ACTIONS_TRANSLATE_JAPANESE':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_JAPANESE','string':'Japanese'});case'AI_QUICK_ACTIONS_TRANSLATE_PORTUGUESE':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_PORTUGUESE','string':'Portuguese'});case'AI_QUICK_ACTIONS_TRANSLATE_KOREAN':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_KOREAN','string':'Korean'});case'AI_QUICK_ACTIONS_TRANSLATE_ITALIAN':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_ITALIAN','string':'Italian'});case'AI_QUICK_ACTIONS_TRANSLATE_RUSSIAN':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_RUSSIAN','string':'Russian'});case'AI_QUICK_ACTIONS_TRANSLATE_SPANISH':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_SPANISH','string':'Spanish'});case'AI_QUICK_ACTIONS_TRANSLATE_GERMAN':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_GERMAN','string':'German'});case'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND':return t({'id':'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND','string':'%0\x20plugin\x20is\x20required\x20but\x20not\x20found.'},_0x41c25d);case'AI_QUICK_ACTIONS_OTHER':return t({'id':'AI_QUICK_ACTIONS_OTHER','string':'Other'});case'AI_ACTIONS_GENERIC_ERROR':return t({'id':'AI_ACTIONS_GENERIC_ERROR','string':'Sorry,\x20we\x20couldn\x27t\x20generate\x20the\x20response.\x20Please\x20try\x20again\x20in\x20a\x20moment.'});case'AI_BALLOON_SELECTION_REMOVED_ERROR':return t({'id':'AI_BALLOON_SELECTION_REMOVED_ERROR','string':'Changes\x20cannot\x20be\x20applied.\x20The\x20original\x20content\x20no\x20longer\x20exists.'});case'AI_REVIEW_MODE_STOP_GENERATING':return t({'id':'AI_REVIEW_MODE_STOP_GENERATING','string':'Stop\x20generating'});case'AI_REVIEW_MODE_HIDE_CHANGES':return t({'id':'AI_REVIEW_MODE_HIDE_CHANGES','string':'Hide\x20changes'});case'AI_REVIEW_MODE_SHOW_CHANGES':return t({'id':'AI_REVIEW_MODE_SHOW_CHANGES','string':'Show\x20changes'});case'AI_REVIEW_MODE_ACCEPT_ALL':return t({'id':'AI_REVIEW_MODE_ACCEPT_ALL','string':'Accept\x20all'});case'AI_REVIEW_MODE_EXIT_REVIEW':return t({'id':'AI_REVIEW_MODE_EXIT_REVIEW','string':'Exit\x20review'});case'AI_REVIEW_MODE_ACCEPT_CHANGE':return t({'id':'AI_REVIEW_MODE_ACCEPT_CHANGE','string':'Accept'});case'AI_REVIEW_MODE_DISMISS_CHANGE':return t({'id':'AI_REVIEW_MODE_DISMISS_CHANGE','string':'Dismiss'});case'AI_REVIEW_MODE_LEARN_MORE':return t({'id':'AI_REVIEW_MODE_LEARN_MORE','string':'Learn\x20more'});case'AI_REVIEW_MODE_COMPLETED_TEXT':return t({'id':'AI_REVIEW_MODE_COMPLETED_TEXT','string':'There\x27s\x20nothing\x20left\x20to\x20review.'});case'AI_REVIEW_MODE_EMPTY_RESULTS_TEXT':return t({'id':'AI_REVIEW_MODE_EMPTY_RESULTS_TEXT','string':'There\x20are\x20no\x20changes\x20to\x20suggest.'});case'AI_REVIEW_MODE_FINISH_REVIEW_BUTTON_LABEL':return t({'id':'AI_REVIEW_MODE_FINISH_REVIEW_BUTTON_LABEL','string':'Finish\x20Review'});case'AI_REVIEW_MODE_FINISH_REVIEW_HEADER_TITLE':return t({'id':'AI_REVIEW_MODE_FINISH_REVIEW_HEADER_TITLE','string':'Review\x20complete.\x20Finish\x20when\x20ready.'});case'AI_REVIEW_INITIALIZATION_ERROR_MESSAGE':return t({'id':'AI_REVIEW_INITIALIZATION_ERROR_MESSAGE','string':'AI\x20Review\x20initialized\x20with\x20errors.\x20Some\x20features\x20may\x20not\x20be\x20available\x20or\x20work\x20properly.'});case'AI_REVIEW_MODE_GENERAL_ERROR_MESSAGE':return t({'id':'AI_REVIEW_MODE_GENERAL_ERROR_MESSAGE','string':'Sorry,\x20we\x20couldn\x27t\x20generate\x20the\x20whole\x20review\x20properly.\x20Please\x20try\x20again\x20in\x20a\x20moment.'});case'AI_REVIEW_MODE_CHUNK_ERROR_MESSAGE':return t({'id':'AI_REVIEW_MODE_CHUNK_ERROR_MESSAGE','string':'Not\x20everything\x20went\x20through,\x20but\x20the\x20completed\x20items\x20are\x20listed\x20below.'});case'AI_REVIEW_MODE':return t({'id':'AI_REVIEW_MODE','string':'Review'});case'AI_REVIEW_MODE_PROMPT_EMPTY_ERROR':return t({'id':'AI_REVIEW_MODE_PROMPT_EMPTY_ERROR','string':'Prompt\x20must\x20not\x20be\x20empty'});case'AI_REVIEW_CHECK_CUSTOM_TITLE':return t({'id':'AI_REVIEW_CHECK_CUSTOM_TITLE','string':'Custom\x20command'});case'AI_REVIEW_CHECK_CUSTOM_DESCRIPTION':return t({'id':'AI_REVIEW_CHECK_CUSTOM_DESCRIPTION','string':'Enter\x20a\x20custom\x20command\x20for\x20a\x20specific\x20review.'});case'AI_REVIEW_CHECK_CORRECTNESS_TITLE':return t({'id':'AI_REVIEW_CHECK_CORRECTNESS_TITLE','string':'Proofread'});case'AI_REVIEW_CHECK_CORRECTNESS_DESCRIPTION':return t({'id':'AI_REVIEW_CHECK_CORRECTNESS_DESCRIPTION','string':'Check\x20the\x20text\x20for\x20errors\x20in\x20grammar,\x20spelling,\x20and\x20punctuation.'});case'AI_REVIEW_CHECK_CLARITY_TITLE':return t({'id':'AI_REVIEW_CHECK_CLARITY_TITLE','string':'Improve\x20clarity'});case'AI_REVIEW_CHECK_CLARITY_DESCRIPTION':return t({'id':'AI_REVIEW_CHECK_CLARITY_DESCRIPTION','string':'Improve\x20the\x20logical\x20structure\x20and\x20precision\x20for\x20clearer\x20message.'});case'AI_REVIEW_CHECK_READABILITY_TITLE':return t({'id':'AI_REVIEW_CHECK_READABILITY_TITLE','string':'Improve\x20readability'});case'AI_REVIEW_CHECK_READABILITY_DESCRIPTION':return t({'id':'AI_REVIEW_CHECK_READABILITY_DESCRIPTION','string':'Adjust\x20sentence\x20structure\x20and\x20word\x20choice\x20for\x20an\x20easier\x20read.'});case'AI_REVIEW_CHECK_MAKE_TITLE':return t({'id':'AI_REVIEW_CHECK_MAKE_TITLE','string':'Adjust\x20length'});case'AI_REVIEW_CHECK_MAKE_DESCRIPTION':return t({'id':'AI_REVIEW_CHECK_MAKE_DESCRIPTION','string':'Shorten\x20or\x20lengthen\x20the\x20text\x20as\x20needed.'});case'AI_REVIEW_CHECK_MAKE_OPTIONS_LABEL':return t({'id':'AI_REVIEW_CHECK_MAKE_OPTIONS_LABEL','string':'Adjust\x20length'});case'AI_REVIEW_CHECK_MAKE_OPTIONS_DATA_LONGER':return t({'id':'AI_REVIEW_CHECK_MAKE_OPTIONS_DATA_LONGER','string':'Longer'});case'AI_REVIEW_CHECK_MAKE_OPTIONS_DATA_SHORTER':return t({'id':'AI_REVIEW_CHECK_MAKE_OPTIONS_DATA_SHORTER','string':'Shorter'});case'AI_REVIEW_CHECK_MAKE_TONE_TITLE':return t({'id':'AI_REVIEW_CHECK_MAKE_TONE_TITLE','string':'Adjust\x20tone\x20and\x20style'});case'AI_REVIEW_CHECK_MAKE_TONE_DESCRIPTION':return t({'id':'AI_REVIEW_CHECK_MAKE_TONE_DESCRIPTION','string':'Modify\x20the\x20text\x20to\x20a\x20desired\x20tone\x20and\x20style.'});case'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_LABEL':return t({'id':'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_LABEL','string':'Adjust\x20tone\x20and\x20style'});case'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_CASUAL':return t({'id':'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_CASUAL','string':'Casual'});case'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_DIRECT':return t({'id':'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_DIRECT','string':'Direct'});case'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_FRIENDLY':return t({'id':'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_FRIENDLY','string':'Friendly'});case'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_CONFIDENT':return t({'id':'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_CONFIDENT','string':'Confident'});case'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_PROFESSIONAL':return t({'id':'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_PROFESSIONAL','string':'Professional'});case'AI_REVIEW_CHECK_TRANSLATE_TITLE':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_TITLE','string':'Translate'});case'AI_REVIEW_CHECK_TRANSLATE_DESCRIPTION':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_DESCRIPTION','string':'Translate\x20the\x20text\x20into\x20another\x20language.'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_LABEL':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_LABEL','string':'Select\x20language'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_ENGLISH':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_ENGLISH','string':'English'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_SPANISH':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_SPANISH','string':'Spanish'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_FRENCH':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_FRENCH','string':'French'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_GERMAN':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_GERMAN','string':'German'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_CHINESE':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_CHINESE','string':'Chinese\x20(Simplified)'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_JAPANESE':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_JAPANESE','string':'Japanese'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_RUSSIAN':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_RUSSIAN','string':'Russian'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_PORTUGUESE':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_PORTUGUESE','string':'Portuguese'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_KOREAN':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_KOREAN','string':'Korean'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_ITALIAN':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_ITALIAN','string':'Italian'});case'AI_REVIEW_MODE_CHECK_STATUS_ACCEPTED':return t({'id':'AI_REVIEW_MODE_CHECK_STATUS_ACCEPTED','string':'Accepted'});case'AI_REVIEW_MODE_CHECK_STATUS_REJECTED':return t({'id':'AI_REVIEW_MODE_CHECK_STATUS_REJECTED','string':'Dismissed'});case'AI_REVIEW_MODE_CHECK_STATUS_OUTDATED':return t({'id':'AI_REVIEW_MODE_CHECK_STATUS_OUTDATED','string':'Outdated'});case'AI_TOGGLE_BUTTON_LABEL':return t({'id':'AI_TOGGLE_BUTTON_LABEL','string':'AI'});case'AI_TRANSLATE_ACCEPT_ALL':return t({'id':'AI_TRANSLATE_ACCEPT_ALL','string':'Accept\x20translation'});case'AI_TRANSLATE_FINISH_HEADER_TITLE':return t({'id':'AI_TRANSLATE_FINISH_HEADER_TITLE','string':'Translation\x20complete.\x20Finish\x20when\x20ready.'});case'AI_TRANSLATE_EMPTY_RESULTS_TEXT':return t({'id':'AI_TRANSLATE_EMPTY_RESULTS_TEXT','string':'There\x20are\x20no\x20translations\x20to\x20review.'});case'AI_TRANSLATE_FINISH_BUTTON_LABEL':return t({'id':'AI_TRANSLATE_FINISH_BUTTON_LABEL','string':'Finish\x20Translation'});case'AI_TRANSLATE_CHECK_LIST_HEADER_TITLE':return t({'id':'AI_TRANSLATE_CHECK_LIST_HEADER_TITLE','string':'Content\x20Translation'});case'AI_TRANSLATE_CHECK_LIST_HEADER_DESCRIPTION':return t({'id':'AI_TRANSLATE_CHECK_LIST_HEADER_DESCRIPTION','string':'A\x20dedicated\x20mode\x20for\x20translating\x20the\x20entire\x20text.'});case'AI_TRANSLATE_CHECK_RESULTS_LOADING_TITLE':return t({'id':'AI_TRANSLATE_CHECK_RESULTS_LOADING_TITLE','string':'Translating\x20to'});case'AI_TRANSLATE_CHECK_RESULTS_READY_TITLE':return t({'id':'AI_TRANSLATE_CHECK_RESULTS_READY_TITLE','string':'Translated\x20to'});case'AI_TRANSLATE_GENERAL_ERROR_MESSAGE':return t({'id':'AI_TRANSLATE_GENERAL_ERROR_MESSAGE','string':'Sorry,\x20we\x20couldn\x27t\x20generate\x20translations\x20properly.\x20Please\x20try\x20again\x20in\x20a\x20moment.'});case'AI_SUGGESTION_DISABLED_TOOLTIP_MESSAGE':return t({'id':'AI_SUGGESTION_DISABLED_TOOLTIP_MESSAGE','string':'This\x20conversation\x20is\x20loaded\x20from\x20chat\x20history\x20from\x20a\x20previous\x20session,\x20so\x20you\x20can’t\x20apply,\x20reject,\x20or\x20suggest\x20changes.'});case'AI_SUGGESTION_DISABLED_FEED_MESSAGE':return t({'id':'AI_SUGGESTION_DISABLED_FEED_MESSAGE','string':'Actions\x20aren’t\x20available\x20for\x20changes\x20from\x20a\x20previous\x20session.'});default:return _0xe77c5b;}}function us(_0x2c2328,_0x54021a){const _0x59d36c=new _0x2cf640(_0x2c2328),_0x5d414e=i(_0x2c2328,'AI_TABS_LABEL_MINIMIZE'),_0x3c522a=i(_0x2c2328,'AI_TABS_LABEL_MAXIMIZE');return _0x59d36c['set']({'withText':!0x1,'icon':_0x3ff106,'tooltip':!0x0,'class':'ck-ai-tabs__resize\x20ck-ai-button-tertiary'}),_0x59d36c['bind']('label')['to'](_0x54021a,'isMaximized',_0x1441fd=>_0x1441fd?_0x5d414e:_0x3c522a),_0x59d36c['bind']('icon')['to'](_0x54021a,'isMaximized',_0x32be05=>_0x32be05?_0x2e4568:_0x3ff106),_0x59d36c['bind']('isOn')['to'](_0x54021a,'isMaximized'),_0x59d36c['on']('execute',()=>{_0x54021a['fire']('resizeTabs');}),_0x59d36c;}function Wi(_0x3eddf8){return _0x4b17c9(_0x3eddf8);}function pt(_0x3aec94){return _0x17e525(_0x3aec94);}function It(_0x56014a,_0x21164e,_0x2eca3c){const _0x222191=null!==_0x21164e?_0x5979a0=>_0x5979a0['attribs'][_0x56014a]===_0x21164e:_0xe8824a=>Boolean(_0xe8824a['attribs'][_0x56014a]);return gt(_0x29e9b4=>_0x40e032(_0x29e9b4)&&_0x222191(_0x29e9b4),_0x2eca3c);}function Qi(_0x332aec,_0x78b9f1,_0x54b192){const _0x4720ec=null!==_0x78b9f1?_0x40a9f7=>_0x40a9f7['attribs'][_0x332aec]===_0x78b9f1:_0x2a75df=>Boolean(_0x2a75df['attribs'][_0x332aec]);return _0x4c7e33(_0x814e4a=>_0x40e032(_0x814e4a)&&_0x4720ec(_0x814e4a),_0x54b192);}function ut(_0x2ca81e,_0x41661a){return _0x2ca81e&&_0x40e032(_0x2ca81e)?_0x2ca81e['attribs'][_0x41661a]:null;}function Is(_0x114e87,_0x40e0f7,_0x4e3174){_0x40e032(_0x114e87)&&(null===_0x4e3174?delete _0x114e87['attribs'][_0x40e0f7]:_0x114e87['attribs'][_0x40e0f7]=_0x4e3174);}function $i(_0x3eac8a,_0x201e9d,_0x553415){const _0x21af26=_0x201e9d['cloneNode'](!0x0);'beforebegin'===_0x553415?_0x4856b5(_0x3eac8a,_0x21af26):'afterbegin'===_0x553415?_0x8342b6(_0x3eac8a,_0x21af26):'beforeend'===_0x553415?_0xadca60(_0x3eac8a,_0x21af26):'afterend'===_0x553415&&_0x43ba66(_0x3eac8a,_0x21af26);}function Ui(_0x3449d6){const _0x3e2ad6=[];let _0x2d5087=_0x3449d6;for(;_0x2d5087;)_0x2d5087=_0x4708b7(_0x2d5087),_0x2d5087&&_0x3e2ad6['push'](_0x2d5087);return _0x3e2ad6;}function Kn(_0x2f0eb1){return _0x2f0eb1['replace'](/^\s+/gm,'')['replace'](/\s+$/gm,'')['replace'](/\n*/g,'')['replace'](/\s+/g,'\x20')['replace'](/>\s*</g,'><');}function vs(_0x1e58f3){let _0x5ee200=0x0;for(;_0x1e58f3['parentNode'];)_0x1e58f3=_0x1e58f3['parentNode'],_0x5ee200++;return _0x5ee200;}function xs(_0x252524){const _0x5a2fcd=[];let _0x54dba4=_0x252524['nextSibling'];for(;_0x54dba4;)_0x5a2fcd['push'](_0x54dba4),_0x54dba4=_0x54dba4['nextSibling'];_0x5a2fcd['forEach'](_0x46d1e6=>{_0x12acc3(_0x46d1e6);});}class Fi 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(_0x444254){super(),this['_generateUid']=_0x444254||_0x48eb5e;}['merge'](_0x51359e,_0x5b5a1f,_0x1b1b56){const _0x4316af=_0x51359e['cloneNode'](!0x0);if(0x0===_0x5b5a1f['childNodes']['length']){const _0x5a7284=[];return Qi('data-id','new-element',_0x4316af)['forEach'](_0x4f0229=>{const _0x3eaff5=this['_generateUid']();Is(_0x4f0229,'data-id',_0x3eaff5),_0x5a7284['push'](_0x3eaff5);}),this['_removeSpecialComments'](_0x4316af),{'parsedContent':_0x4316af,'newNodeIds':_0x5a7284,'modifiedNodeIds':[],'removedNodeIds':[]};}_0x1b1b56&&_0x1b1b56['markUnstableElements']&&this['_markLastTagElementUnstable'](_0x4316af),this['_touchedNodesState']['newIds']=[],this['_touchedNodesState']['modifiedIds']=[],this['_touchedNodesState']['removedIds']=[],this['_touchedNodesState']['invalidIds']=[],this['_touchedNodesState']['lastTouchedId']=null,this['_existingDataIds']=new Set(Qi('data-id',null,_0x5b5a1f)['map'](_0x37b48b=>ut(_0x37b48b,'data-id'))['filter'](_0x3133f6=>!!_0x3133f6));let _0xbd8b1a=-0x1,_0x3240a4=!0x1;const _0x412d70=_0x4316af['childNodes'],_0x6f2399=Array['from'](_0x412d70)['filter'](_0x1b817e=>!(0x3===_0x1b817e['nodeType']&&''===pt(_0x1b817e)['trim']())),_0x506f59=_0x6f2399['length'];for(let _0x3818dc=0x0;_0x3818dc<_0x506f59;_0x3818dc++){const _0xf91065=_0x6f2399[_0x3818dc],_0x1fbd6e=_0x6f2399[_0x3818dc+0x1];if(this['_isNewNode'](_0xf91065)){if(-0x1===_0xbd8b1a&&(_0xbd8b1a=_0x3818dc),this['_markWrappedElements'](_0xf91065),!this['_isNewNode'](_0x1fbd6e)){const [_0x5baac6,_0x4465b0]=this['_findReferenceNode'](_0xf91065,_0x3240a4,_0x5b5a1f);if(_0x5baac6){const _0xd79d=Array['from'](_0x6f2399)['slice'](_0xbd8b1a,_0x3818dc+0x1);this['_insertNodes'](_0x5baac6,_0xd79d,_0x4465b0),_0xbd8b1a=-0x1;}}}else{if(this['_isExistingContentComment'](_0xf91065))_0x3240a4=!0x0;else{if(this['_isExistingNode'](_0xf91065)){const _0x4ec327=ut(_0xf91065,'data-id');if(_0x4ec327&&this['_existingDataIds']['has'](_0x4ec327)){const _0x45f949=It('data-id',_0x4ec327,_0x5b5a1f);this['_replaceNode'](_0x45f949,_0xf91065);}if(this['_touchedNodesState']['removedIds']['includes'](_0x4ec327)){const _0x27a872=this['_touchedNodesState']['removedIds']['indexOf'](_0x4ec327);this['_touchedNodesState']['removedIds']['splice'](_0x27a872,0x1);}}else{if(this['_isDelNode'](_0xf91065)){const _0xfdec83=ut(_0xf91065,'data-id');this['_touchedNodesState']['modifiedIds']['includes'](_0xfdec83)||this['_storeDeletedElementIds'](_0xf91065);}}}}}for(const _0x1c74f2 of this['_touchedNodesState']['removedIds']){const _0x1f9827=It('data-id',_0x1c74f2,_0x5b5a1f);if(_0x1f9827){if(_0x1b1b56&&_0x1b1b56['replaceRemovedWith']){this['_touchedNodesState']['lastTouchedId']=_0x1c74f2;const _0x1cc63d=_0x1b1b56['replaceRemovedWith']['cloneNode'](!0x0);Is(_0x1cc63d,'data-id',_0x1c74f2),Is(_0x1cc63d,'data-removed','true'),_0xd8634b(_0x1f9827,_0x1cc63d);}else _0x12acc3(_0x1f9827);}}if(Qi('data-wrapped-id',null,_0x5b5a1f)['forEach'](_0x104868=>{const _0x1b6324=It('data-id',ut(_0x104868,'data-wrapped-id'),_0x5b5a1f);var _0xbd90aa,_0x489877;_0x1b6324&&(_0x489877=_0x104868,_0x12acc3(_0xbd90aa=_0x1b6324),_0xd8634b(_0x489877,_0xbd90aa));}),Qi('data-id','new-element',_0x5b5a1f)['forEach'](_0x197f2b=>{const _0x3d2b82=this['_getUid'](_0x197f2b);Is(_0x197f2b,'data-id',_0x3d2b82),this['_touchedNodesState']['newIds']['push'](_0x3d2b82);}),this['_removeSpecialComments'](_0x5b5a1f),_0x1b1b56&&_0x1b1b56['markUnstableElements']&&this['_markUnstableElements'](_0x5b5a1f,_0x1b1b56['markUnstableElementsDepth']||0x0),_0x1b1b56&&_0x1b1b56['cutAfterLastChange']&&this['_touchedNodesState']['lastTouchedId']){let _0x47161e=It('data-id',this['_touchedNodesState']['lastTouchedId'],_0x5b5a1f);for(;_0x47161e;)xs(_0x47161e),_0x47161e=_0x47161e['parentNode'];}return{'parsedContent':_0x5b5a1f,'newNodeIds':this['_touchedNodesState']['newIds'],'modifiedNodeIds':this['_touchedNodesState']['modifiedIds'],'removedNodeIds':this['_touchedNodesState']['removedIds']};}['_insertNodes'](_0x263e13,_0x49c2d0,_0x24c2ff){for(const _0xa83ace of _0x49c2d0){const _0xbbba25=this['_getUid'](_0xa83ace);Is(_0xa83ace,'data-id',_0xbbba25),this['_touchedNodesState']['newIds']['push'](_0xbbba25),this['_touchedNodesState']['lastTouchedId']=_0xbbba25;}const _0x2ec5fe='afterbegin'===_0x24c2ff||'afterend'===_0x24c2ff?_0x49c2d0['reverse']():_0x49c2d0;for(const _0x4f4cfc of _0x2ec5fe)$i(_0x263e13,_0x4f4cfc,_0x24c2ff);}['_replaceNode'](_0x421a87,_0x2c43d5){if(!_0x421a87)return;if(_0x32badd=_0x2c43d5,Kn(pt(_0x421a87))===Kn(pt(_0x32badd)))return;var _0x32badd;const _0x1995a6=this['_getUid'](_0x421a87);Is(_0x2c43d5,'data-id',_0x1995a6),this['_touchedNodesState']['modifiedIds']['push'](_0x1995a6),this['_touchedNodesState']['lastTouchedId']=_0x1995a6,_0xd8634b(_0x421a87,_0x2c43d5['cloneNode'](!0x0));}['_findReferenceNode'](_0x2f6777,_0x9845ed,_0x25f21d){const _0x29b60c=this['_findPrevElementWithDataId'](_0x2f6777,!0x1);if(_0x29b60c){const _0x3863c7=this['_getNodeDataId'](_0x29b60c),_0x30e34a=It('data-id',_0x3863c7,_0x25f21d);if(_0x30e34a)return[_0x30e34a,'afterend'];this['_touchedNodesState']['invalidIds']['push'](_0x3863c7);}const _0x510d8b=this['_findNextElementWithDataId'](_0x2f6777,!0x1);if(_0x510d8b){const _0x52e680=this['_getNodeDataId'](_0x510d8b),_0x254a75=It('data-id',_0x52e680,_0x25f21d);if(_0x254a75)return[_0x254a75,'beforebegin'];this['_touchedNodesState']['invalidIds']['push'](_0x52e680);}return _0x9845ed?_0x2f6777['nextSibling']?this['_findFallbackReferenceNode'](_0x2f6777,_0x25f21d):[_0x25f21d['childNodes'][_0x25f21d['childNodes']['length']-0x1],'afterend']:[_0x25f21d['childNodes'][0x0],'beforebegin'];}['_findFallbackReferenceNode'](_0x3ca457,_0xb5f1f0){const _0x2f78b0=[],_0x3e00cf=this['_findPrevElementWithDataId'](_0x3ca457,!0x0);if(_0x3e00cf){const _0x48efa8=It('data-id',this['_getNodeDataId'](_0x3e00cf),_0xb5f1f0);_0x48efa8&&_0x2f78b0['push']([_0x48efa8,'afterend']);}const _0x568523=this['_findNextElementWithDataId'](_0x3ca457,!0x0);if(_0x568523){const _0x4d9162=It('data-id',this['_getNodeDataId'](_0x568523),_0xb5f1f0);_0x4d9162&&_0x2f78b0['push']([_0x4d9162,'beforebegin']);}if(_0x2f78b0['length']>0x1)return vs(_0x2f78b0[0x0][0x0])<=vs(_0x2f78b0[0x1][0x0])?_0x2f78b0[0x0]:_0x2f78b0[0x1];return 0x1===_0x2f78b0['length']?_0x2f78b0[0x0]:[_0xb5f1f0['lastChild'],'afterend'];}['_findNextElementWithDataId'](_0x5ebc99,_0x5142a4){let _0x575e35=_0x5ebc99['nextSibling'],_0x5d41fb=null,_0x3e9d44=!0x1;for(;_0x575e35;){if(_0x38b3c0(_0x575e35)){if(this['_isDelNode'](_0x575e35)&&(_0x5d41fb=_0x575e35),this['_isExistingContentComment'](_0x575e35)&&_0x5142a4&&!_0x3e9d44){_0x3e9d44=!0x0,_0x575e35=_0x575e35['nextSibling'];continue;}break;}const _0x184ba5=ut(_0x575e35,'data-id');if(_0x184ba5&&'new-element'!==_0x184ba5&&this['_existingDataIds']['has'](_0x184ba5)){_0x5d41fb=_0x575e35;break;}_0x575e35=_0x575e35['nextSibling'];}return _0x5d41fb;}['_findPrevElementWithDataId'](_0xdcc989,_0x5e4108){let _0x1b5dbf=_0xdcc989['previousSibling'],_0x2b844d=null,_0x3852f8=!0x1;for(;_0x1b5dbf;){if(_0x38b3c0(_0x1b5dbf)){if(this['_isDelNode'](_0x1b5dbf)&&(_0x2b844d=_0x1b5dbf),this['_isExistingContentComment'](_0x1b5dbf)&&_0x5e4108&&!_0x3852f8){_0x3852f8=!0x0,_0x1b5dbf=_0x1b5dbf['previousSibling'];continue;}break;}const _0x2e1c3b=ut(_0x1b5dbf,'data-id');if(_0x2e1c3b&&'new-element'!==_0x2e1c3b&&this['_existingDataIds']['has'](_0x2e1c3b)){_0x2b844d=_0x1b5dbf;break;}_0x1b5dbf=_0x1b5dbf['previousSibling'];}return _0x2b844d;}['_markWrappedElements'](_0x2d0bf0){_0x40e032(_0x2d0bf0)&&Qi('data-id',null,_0x2d0bf0)['forEach'](_0xd3fbc1=>{this['_isExistingNode'](_0xd3fbc1)&&!this['_hasWrappedParent'](_0xd3fbc1)&&(Is(_0xd3fbc1,'data-wrapped-id',ut(_0xd3fbc1,'data-id')),Is(_0xd3fbc1,'data-id',null));});}['_getNodeDataId'](_0x2c6d31){if(!_0x2c6d31)return null;if(_0x40e032(_0x2c6d31))return ut(_0x2c6d31,'data-id');if(_0x38b3c0(_0x2c6d31)){const _0x4ad792=pt(_0x2c6d31)['match'](/removed[\s*-]data-id="([^"]+)"/);if(_0x4ad792&&_0x4ad792[0x1])return _0x4ad792[0x1];}return null;}['_storeDeletedElementIds'](_0x5b34d3){if(_0x38b3c0(_0x5b34d3)){const _0x220144=pt(_0x5b34d3)['match'](/removed[\s*-]data-id="([^"]+)"/);_0x220144&&_0x220144[0x1]&&this['_touchedNodesState']['removedIds']['push'](_0x220144[0x1]);}}['_getUid'](_0x2d3d4f){return this['_isExistingNode'](_0x2d3d4f)?ut(_0x2d3d4f,'data-id'):this['_generateUid']();}['_removeSpecialComments'](_0x3bf488){(function(_0x939eab){return _0x284730(_0x16c7f8=>_0x38b3c0(_0x16c7f8),_0x939eab,!0x0,0x1/0x0);}(_0x3bf488)['filter'](_0x357b05=>this['_isDelNode'](_0x357b05)||this['_isExistingContentComment'](_0x357b05))['forEach'](_0x2fae43=>{_0x12acc3(_0x2fae43);}));}['_markLastTagElementUnstable'](_0x268821){const _0x54f92e=_0x268821['childNodes'],_0x28137b=_0x54f92e[_0x54f92e['length']-0x1];_0x28137b&&_0x40e032(_0x28137b)&&Is(_0x28137b,'data-unstable','true');}['_markUnstableElements'](_0x300a11,_0x547398){const _0xbad882=It('data-unstable','true',_0x300a11);if(!_0xbad882)return;const _0x326c17=Ui(_0xbad882)['slice'](0x0,-0x1),_0x1c3043=_0x326c17['length'];let _0x46c3a8=_0xbad882;if(_0x1c3043>_0x547398){let _0x248bc7=_0x1c3043,_0x93bb74=null;for(;_0x248bc7>_0x547398&&_0x248bc7>=0x0;)_0x248bc7--,_0x93bb74=_0x326c17[_0x248bc7];_0x93bb74&&(_0x46c3a8=_0x93bb74,Is(_0xbad882,'data-unstable',null),Is(_0x93bb74,'data-unstable','true'));}else{if(_0x1c3043<_0x547398){let _0x20b96b=_0x1c3043,_0x3ff617=_0xbad882;for(;_0x20b96b<_0x547398;){const _0xa8a0a0=_0x3ff617['childNodes']['filter'](_0x18457b=>_0x40e032(_0x18457b));if(0x0===_0xa8a0a0['length'])break;_0x20b96b++,_0x3ff617=_0xa8a0a0[_0xa8a0a0['length']-0x1];}_0x3ff617&&(_0x46c3a8=_0x3ff617,Is(_0xbad882,'data-unstable',null),Is(_0x3ff617,'data-unstable','true'));}}let _0x463150=_0x46c3a8;for(;_0x463150;){for(;_0x463150['nextSibling'];)_0x463150=_0x463150['nextSibling'],_0x40e032(_0x463150)&&Is(_0x463150,'data-unstable','true');_0x463150=_0x463150['parentNode'];}}['_isNewNode'](_0x4dce4a){return Boolean('new-element'===ut(_0x4dce4a,'data-id'));}['_isExistingNode'](_0x15ffc8){return Boolean((ut(_0x15ffc8,'data-id')||'')['length']>0x0&&'new-element'!==ut(_0x15ffc8,'data-id'));}['_isDelNode'](_0x11706b){return!!_0x11706b&&Boolean(_0x38b3c0(_0x11706b)&&pt(_0x11706b)['match'](/removed[\s*-]data-id="[^"]+"/));}['_hasWrappedParent'](_0x18b31a){let _0x498d06=_0x18b31a['parentNode'];for(;_0x498d06;){if(ut(_0x498d06,'data-wrapped-id'))return!0x0;_0x498d06=_0x498d06['parentNode'];}return!0x1;}['_isExistingContentComment'](_0xd12672){return Boolean(_0x38b3c0(_0xd12672)&&pt(_0xd12672)['match'](/\s*existing[\s*-](content|document)\s*/g));}}function wt({editor:_0x3fb891,changeGroups:_0x4b6bcb,documentContextContent:_0x25dfd8,showDiff:_0x1a9666,trimUnchanged:_0x3b4e7f=!0x0}){return _0x4b6bcb['map'](_0x71fcc4=>{const _0x3c1937=new _t([]),_0x2807d9=new _t([]);for(const _0x7e67ca of _0x71fcc4['changes'])if(_0x1a9666&&'removed'==_0x7e67ca['type']||_0x2807d9['children']['push'](_0x7e67ca['node']['cloneNode'](!0x0)),'new'!=_0x7e67ca['type']&&(_0x1a9666||'removed'!=_0x7e67ca['type'])){const _0x55589e=gt(_0x1cf36a=>ut(_0x1cf36a,'data-id')==_0x7e67ca['id'],_0x25dfd8,!0x0);_0x55589e&&_0x3c1937['children']['push'](_0x55589e['cloneNode'](!0x0));}const {content:_0x334843,hasChanges:_0x1ad524}=function(_0x3c6595,_0x95681b,_0x330388,_0x30128a,_0x24fb93=!0x0){const _0x4c371c=_0x3c6595['plugins']['get']('DocumentCompare'),_0xf22bef=pt(_0x95681b),_0xdadee1=pt(_0x330388),_0x6544ae=_0x3c6595['data']['parse'](_0xf22bef,'$root'),_0x2af3e9=_0x3c6595['model']['createPositionAt'](_0x6544ae,0x0),_0x504f1b=_0x4c371c['getDiff'](_0xf22bef,_0xdadee1,{'anchor':_0x2af3e9,'markDeletions':_0x30128a}),_0x555e0a=_0x504f1b['getOperations']();if(0x0==_0x555e0a['length'])return{'content':_0x95681b['cloneNode'](!0x0),'hasChanges':!0x1};_0x30128a?function(_0x223b12,_0x565a93,_0x555cd3){if(0x0==_0x223b12['length'])return;const _0x5c262b=_0x555cd3['plugins']['get']('DocumentCompare'),_0x1ec3ee=_0x555cd3['plugins']['get']('SuggestionsConversion');_0x555cd3['model']['change'](_0xb3a9e6=>{const _0x497150=new Set();for(let _0x56f2e0=0x0;_0x56f2e0<_0x223b12['length'];_0x56f2e0++){const _0x19a031=_0x223b12[_0x56f2e0];if(_0x19a031['baseVersion']=null,_0x19a031['isDocumentOperation']=!0x1,_0x5c262b['isMarkedRemoveOperation'](_0x19a031)){const _0x4f9f97=_0x5df738(_0x19a031['newRange'],_0x555cd3['model']),_0x3b7c6c='suggestion:deletion:'+_0x48eb5e()+':$aiSuggestion';_0x565a93['markers']['set'](_0x3b7c6c,_0x4f9f97);}else switch(_0x19a031['type']){case'rename':{if(_0x19a031['oldName']==_0x19a031['newName'])break;_0xb3a9e6['batch']['addOperation'](_0x19a031),_0x555cd3['model']['applyOperation'](_0x19a031);const _0x535147='$elementName',_0x4e8d30=_0x19a031['position'],_0x23c40b=_0x555cd3['model']['createRange'](_0x4e8d30,_0x555cd3['model']['createPositionAt'](_0x4e8d30['nodeAfter'],'end')),_0xcf177a='suggestion:attribute:'+_0x535147+':'+_0x48eb5e()+':$aiSuggestion';_0x565a93['markers']['set'](_0xcf177a,_0x23c40b);break;}case'addAttribute':case'removeAttribute':case'changeAttribute':{if(_0x19a031['oldValue']==_0x19a031['newValue'])break;_0xb3a9e6['batch']['addOperation'](_0x19a031),_0x555cd3['model']['applyOperation'](_0x19a031);const _0x55f8b8=_0x19a031['key'];if(!_0x1ec3ee['isRegisteredAttribute'](_0x55f8b8))break;const _0x22b201=_0x5df738(_0x19a031['range'],_0x555cd3['model']),_0x1eb97e='suggestion:attribute:'+_0x55f8b8+':'+_0x48eb5e()+':$aiSuggestion';_0x565a93['markers']['set'](_0x1eb97e,_0x22b201);break;}case'insert':{_0xb3a9e6['batch']['addOperation'](_0x19a031),_0x555cd3['model']['applyOperation'](_0x19a031);if(_0x223b12[_0x56f2e0+0x1]&&'move'==_0x223b12[_0x56f2e0+0x1]['type']){no(_0x565a93,_0x19a031);break;}const _0x10e704=_0x19a031['position'],_0x3bef1f=_0x19a031['howMany'],_0x59d9d0=_0x5df738(_0x555cd3['model']['createRange'](_0x10e704,_0x10e704['getShiftedBy'](_0x3bef1f)),_0x555cd3['model']),_0x37bf3f='suggestion:insertion:'+_0x48eb5e()+':$aiSuggestion';_0x565a93['markers']['set'](_0x37bf3f,_0x59d9d0);break;}case'split':{_0xb3a9e6['batch']['addOperation'](_0x19a031),_0x555cd3['model']['applyOperation'](_0x19a031);const _0x19046f=_0x19a031['splitPosition'],_0x192eb0=_0x19a031['moveTargetPosition'],_0x23381a=_0x555cd3['model']['createRange'](_0x19046f,_0x192eb0),_0x20d4cc='suggestion:insertion:'+_0x48eb5e()+':$aiSuggestion';_0x565a93['markers']['set'](_0x20d4cc,_0x23381a);break;}case'move':{_0xb3a9e6['batch']['addOperation'](_0x19a031),_0x555cd3['model']['applyOperation'](_0x19a031),_0x223b12[_0x56f2e0-0x1]&&'insert'==_0x223b12[_0x56f2e0-0x1]['type']&&no(_0x565a93,_0x19a031);const _0x52f4ce=_0x19a031['getMovedRangeStart'](),_0x3a0dca=_0x19a031['howMany'];for(let _0x3e897c=0x0;_0x3e897c<_0x3a0dca;_0x3e897c++){const _0x5f1a9c=_0x52f4ce['getShiftedBy'](_0x3e897c)['nodeAfter'];_0x497150['add'](_0x5f1a9c);}break;}case'remove':{const _0x70d7fa=_0x19a031['sourcePosition'],_0x5bf048=_0x19a031['howMany'],_0x15b9f7=new lt(_0x70d7fa,_0x5bf048);_0xb3a9e6['batch']['addOperation'](_0x15b9f7),_0x555cd3['model']['applyOperation'](_0x15b9f7);break;}}}for(const _0x9bca56 of _0x497150){const _0x4d28d6=_0x555cd3['model']['createRangeOn'](_0x9bca56),_0x28d5c9='suggestion:formatBlock:$fakeWrap:'+_0x48eb5e()+':$aiSuggestion';_0x565a93['markers']['set'](_0x28d5c9,_0x5df738(_0x4d28d6,_0x555cd3['model']));}});}(_0x555e0a,_0x6544ae,_0x3c6595):_0x3c6595['model']['change'](_0x26be09=>{for(const _0x151ea2 of _0x555e0a)if('remove'==_0x151ea2['type']){const _0x12564c=_0x151ea2['sourcePosition'],_0x46ed75=_0x151ea2['howMany'],_0x5b7987=new lt(_0x12564c,_0x46ed75);_0x26be09['batch']['addOperation'](_0x5b7987),_0x3c6595['model']['applyOperation'](_0x5b7987);}else{if('marker'==_0x151ea2['type']){const _0x3f2adb=_0x151ea2['name'],_0x10a1da=_0x151ea2['newRange'];null!==_0x10a1da?_0x6544ae['markers']['set'](_0x3f2adb,_0x10a1da):_0x6544ae['markers']['delete'](_0x3f2adb);}else _0x151ea2['baseVersion']=null,_0x151ea2['isDocumentOperation']=!0x1,_0x26be09['batch']['addOperation'](_0x151ea2),_0x3c6595['model']['applyOperation'](_0x151ea2);}});if(_0x24fb93){const _0x5b4c87=ct(_0x3c6595,_0x555e0a,_0x6544ae);ht(_0x3c6595['model'],_0x5b4c87),function(_0x4e32a4,_0x451619){const _0x12337f=_0x451619['getFirstRange']()['start'];let _0x74eea7=_0x451619['getFirstRange']()['end'];const _0x1bb5f7=_0x12337f['root'];(_0x74eea7['textNode']||_0x74eea7['nodeAfter']&&_0x74eea7['nodeAfter']['is']('$text'))&&(_0x296e10(_0x74eea7,'...'),_0x74eea7=_0x74eea7['getShiftedBy'](0x3)),(_0x12337f['textNode']||_0x12337f['nodeBefore']&&_0x12337f['nodeBefore']['is']('$text'))&&(_0x296e10(_0x12337f,'...'),function(_0xbb9cb,_0x6f8814,_0x58d446){for(let [_0x58eedd,_0x6de8b7]of _0xbb9cb['markers']){const _0x4311a9=_0x6de8b7['_getTransformedByInsertion'](_0x6f8814,_0x58d446,!0x1);_0x6de8b7=_0x4311a9[0x0],_0xbb9cb['markers']['set'](_0x58eedd,_0x6de8b7);}}(_0x1bb5f7,_0x12337f,0x3),_0x12337f['parent']==_0x74eea7['parent']&&(_0x74eea7=_0x74eea7['getShiftedBy'](0x3)));const _0x2bf604=_0x4e32a4['createRange'](_0x4e32a4['createPositionAt'](_0x1bb5f7,0x0),_0x12337f),_0x1b22a9=_0x4e32a4['createRange'](_0x74eea7,_0x4e32a4['createPositionAt'](_0x1bb5f7,'end')),_0x4f64df=[..._0x2bf604['getMinimalFlatRanges'](),..._0x1b22a9['getMinimalFlatRanges']()];_0x4f64df['reverse']();for(const _0x23226d of _0x4f64df)to(_0x23226d),Yn(_0x1bb5f7,_0x23226d);}(_0x3c6595['model'],_0x5b4c87);}const _0x1b72b7=_0x3c6595['data']['stringify'](_0x6544ae,{'showSuggestionHighlights':!0x0});return{'content':Wi(_0x1b72b7),'hasChanges':!0x0};}(_0x3fb891,_0x3c1937,_0x2807d9,_0x1a9666,_0x3b4e7f);return{'type':_0x71fcc4['changes'][0x0]['type'],'index':_0x71fcc4['index'],'content':_0x334843,'hasChanges':_0x1ad524};});}function no(_0x24257e,_0x1f2de5){for(const [_0x48ea29,_0x2a2d85]of _0x24257e['markers']){const _0x1f82a5=dt['_createFromRanges'](_0x2a2d85['getTransformedByOperation'](_0x1f2de5));_0x24257e['markers']['set'](_0x48ea29,_0x1f82a5);}}function ct(_0x229fba,_0x5219f9,_0x31406){const _0x1d9b3e=_0x229fba['plugins']['get']('DocumentCompare');let _0x13dcbb=_0x229fba['model']['createPositionAt'](_0x31406,Number['POSITIVE_INFINITY']),_0x3de301=_0x229fba['model']['createPositionAt'](_0x31406,0x0);for(const _0x1b4109 of _0x5219f9){let _0x467c4a,_0x499346;if(_0x1d9b3e['isMarkedRemoveOperation'](_0x1b4109))_0x467c4a=_0x1b4109['newRange']['start'],_0x499346=_0x1b4109['newRange']['end'];else switch(_0x13dcbb=_0x13dcbb['getTransformedByOperation'](_0x1b4109),_0x3de301=_0x3de301['getTransformedByOperation'](_0x1b4109),_0x1b4109['type']){case'rename':_0x467c4a=_0x1b4109['position'],_0x499346=_0x467c4a['getShiftedBy'](0x1);break;case'addAttribute':case'removeAttribute':case'changeAttribute':_0x467c4a=_0x1b4109['range']['start'],_0x499346=_0x1b4109['range']['end'];break;case'insert':_0x467c4a=_0x1b4109['position'],_0x499346=_0x467c4a['getShiftedBy'](_0x1b4109['howMany']);break;case'split':_0x467c4a=_0x1b4109['splitPosition'],_0x499346=_0x1b4109['moveTargetPosition'];break;case'merge':{const _0x4ed64e=_0x1b4109['targetPosition']['path']['slice'](0x0,-0x1);_0x467c4a=_0x229fba['model']['createPositionFromPath'](_0x31406,_0x4ed64e),_0x499346=_0x467c4a['getShiftedBy'](0x1);break;}case'remove':{const _0x164baa=_0x1b4109['howMany'],_0x3014fe=_0x1b4109['sourcePosition']['_getTransformedByInsertion'](_0x1b4109['targetPosition'],_0x164baa),_0xd7086d=_0x1b4109['getMovedRangeStart']();'remove'==_0x1b4109['type']?(_0x467c4a=_0x3014fe,_0x499346=_0x3014fe):(_0x467c4a=_0xd7086d,_0x499346=_0xd7086d['getShiftedBy'](_0x164baa));break;}}_0x467c4a&&_0x467c4a['isBefore'](_0x13dcbb)&&(_0x13dcbb=_0x467c4a['clone'](),_0x13dcbb['stickiness']='toNone'),_0x499346&&_0x499346['isAfter'](_0x3de301)&&(_0x3de301=_0x499346['clone'](),_0x3de301['stickiness']='toNone');}return _0x229fba['model']['createSelection'](_0x229fba['model']['createRange'](_0x13dcbb,_0x3de301));}function ht(_0x5bd301,_0x171f08){ro(_0x5bd301,_0x171f08,'forward');const _0xb512a3=_0x171f08['getFirstRange']();_0x171f08['setTo']([]),_0x171f08['setTo'](_0xb512a3,{'backward':!0x0}),ro(_0x5bd301,_0x171f08,'backward');}function ro(_0x3b75f3,_0x4a4f7a,_0x4716b4){let _0x37ee6a=0x14;for(;_0x37ee6a;){_0x3b75f3['modifySelection'](_0x4a4f7a,{'unit':'word','direction':_0x4716b4}),_0x37ee6a--;const _0x3d02ed=_0x4a4f7a['focus']['forward'==_0x4716b4?'nodeBefore':'nodeAfter'];if(_0x3d02ed&&_0x3d02ed['is']('element')&&_0x3b75f3['schema']['isBlock'](_0x3d02ed)&&_0x3b75f3['schema']['isObject'](_0x3d02ed))break;}}function Yn(_0x7d3e21,_0x9e7cfe){for(const [_0x2d2090,_0x4ccfc5]of _0x7d3e21['markers']){const _0x2f9030=_0x4ccfc5['_getTransformedByDeletion'](_0x9e7cfe['start'],_0x9e7cfe['end']['offset']-_0x9e7cfe['start']['offset']);null!=_0x2f9030?_0x7d3e21['markers']['set'](_0x2d2090,_0x2f9030):_0x7d3e21['markers']['delete'](_0x2d2090);}}class xi extends ts(){['id'];['interactionId'];['type'];['sources']=[];['parsedContent']=new _t([]);['parsedMergedContent']=new _t([]);['changeGroups']=[];['areActionsDisabled']=!0x1;['documentContextContent'];['aiResponseParser'];['aiResponseApplier'];['editor'];['cachedSuggestionContentParts']={'withDiff':[],'withoutDiff':[]};constructor({type:_0x570abe,content:_0x2345be='',isDone:_0xab0a6f=!0x1,interactionId:_0xbe2081,areActionsDisabled:_0x2a2766,documentContextContent:_0x2cf07c,editor:_0x3f0487,id:_0x357ef5}){super(),this['id']=_0x357ef5||_0x48eb5e(),this['interactionId']=_0xbe2081,this['type']=_0x570abe,this['areActionsDisabled']=!!_0x2a2766,this['editor']=_0x3f0487,this['aiResponseParser']=new Fi(),this['aiResponseApplier']=new Ji(),this['documentContextContent']=Wi(_0x2cf07c||''),this['set']('isDone',_0xab0a6f),this['on']('change:content',()=>{this['onContentChange']();}),this['set']('content',_0x2345be);}['appendContent'](_0x5fed21){this['set']('content',this['content']+_0x5fed21);}['done'](){this['isDone']||(this['set']('isDone',!0x0),this['onContentChange']());}['destroy'](){this['stopListening']();}['setChangeGroupState'](_0x5b0a49,_0x268473){this['changeGroups'][_0x5b0a49]['state']=_0x268473,this['fire']('replyChangeGroupStateUpdated',{'reply':this,'index':_0x5b0a49,'state':_0x268473});}['getContentParts']({showDiff:_0xdccea2,groupIndex:_0x2dd445}){if(!this['editor'])throw new _0x563e6a('ai-get-editor-from-context-no-editor',null,{'aiReply':this});const _0x1ff6ea=this['_getCachedContentParts'](_0xdccea2,_0x2dd445);if(_0x1ff6ea)return _0x1ff6ea;let _0x53688f=[];if(void 0x0===_0x2dd445)_0x53688f=this['changeGroups'];else{const _0x14ef30=this['changeGroups']['find'](({index:_0x11bd95})=>_0x11bd95===_0x2dd445);if(!_0x14ef30)throw new _0x563e6a('ai-reply-get-content-parts-group-not-found',null,{'aiReply':this,'groupIndex':_0x2dd445});_0x53688f=[_0x14ef30];}const _0x71480b=wt({'editor':this['editor'],'showDiff':_0xdccea2,'changeGroups':_0x53688f,'documentContextContent':this['documentContextContent']});return this['_setCachedContentParts'](_0xdccea2,_0x71480b),_0x71480b;}['_getCachedContentParts'](_0x295aa1,_0x16b45e){const _0x3791a6=_0x295aa1?'withDiff':'withoutDiff';if(!this['cachedSuggestionContentParts'][_0x3791a6]['length'])return null;const _0x32bd09=this['cachedSuggestionContentParts'][_0x3791a6];if(void 0x0===_0x16b45e)return _0x32bd09['length']>0x0&&_0x32bd09['length']!==this['changeGroups']['length']?(this['_setCachedContentParts'](_0x295aa1,null),null):_0x4f0e8d(_0x32bd09);{const _0x3f5e68=_0x32bd09['find'](({index:_0x2a25f4})=>_0x2a25f4===_0x16b45e);if(_0x3f5e68)return[_0x4f0e8d(_0x3f5e68)];}return null;}['_setCachedContentParts'](_0x114330,_0x423daa){const _0x3f1725=_0x114330?'withDiff':'withoutDiff';_0x423daa?_0x423daa['forEach'](_0x1c9ca8=>{const _0x37b22c=this['cachedSuggestionContentParts'][_0x3f1725],_0x34aa60=_0x37b22c['find'](({index:_0x47d7d1})=>_0x47d7d1===_0x1c9ca8['index']);if(_0x34aa60){const _0x2cae7e=_0x37b22c['indexOf'](_0x34aa60);_0x37b22c['splice'](_0x2cae7e,0x1,_0x1c9ca8);}else _0x37b22c['push'](_0x1c9ca8);}):this['cachedSuggestionContentParts'][_0x3f1725]['length']=0x0;}['onContentChange'](){if('modification'===this['type']){this['parsedContent']=this['aiResponseParser']['parseAndNormalizeHTML'](this['content']);const _0xd25def=this['changeGroups'];this['updateChangeGroups']();const _0xeb7b09=this['_getDifferentChangeGroups'](_0xd25def,this['changeGroups']);(_0xeb7b09['length']||this['isDone'])&&(this['fire']('replyContentUpdated',this,_0xeb7b09),this['cachedSuggestionContentParts']['withDiff']['length']=this['cachedSuggestionContentParts']['withoutDiff']['length']=0x0);}else this['parsedContent']=this['aiResponseParser']['convertMarkdownToHTML'](this['content']),this['fire']('replyContentUpdated',this);}['_getDifferentChangeGroups'](_0x1ed6e7,_0x435b8e){const _0x36bd78=[];for(const _0x2fb80e of _0x435b8e){const _0x17457e=_0x1ed6e7[_0x2fb80e['index']];_0x17457e?_0x17457e['changes']['length']!==_0x2fb80e['changes']['length']?_0x36bd78['push'](_0x2fb80e):_0x17457e['changes']['forEach']((_0x48f82b,_0x1f48f9)=>{const _0x2e30bb=_0x2fb80e['changes'][_0x1f48f9];_0x48f82b['id']!==_0x2e30bb['id']&&_0x36bd78['push'](_0x2fb80e);}):_0x36bd78['push'](_0x2fb80e);}return _0x36bd78;}['updateChangeGroups'](){const _0x262e92=new _0x504ef3('p',{},[new _0x504ef3('span',{'style':'color:\x20#808080;\x20font-style:\x20italic'},[new _0x201b94(i(this['editor']['locale'],'AI_SUGGESTION_CONTENT_PART_REMOVED'))])]),_0x30bc55=this['aiResponseApplier']['merge'](this['parsedContent'],this['documentContextContent']['cloneNode'](!0x0),{'markUnstableElements':!this['isDone'],'replaceRemovedWith':_0x262e92,'cutAfterLastChange':!this['isDone']});if(!_0x30bc55['modifiedNodeIds']['length']&&!this['isDone'])return;this['parsedMergedContent']=_0x30bc55['parsedContent'];let _0x23ce76=[];if(_0x4c7e33(_0x180a51=>{const _0x36d414=ut(_0x180a51,'data-id');if(!_0x36d414||!_0x3960c1(_0x36d414))return!0x1;const _0x203e26=[_0x180a51,...Ui(_0x180a51)]['at'](-0x2);if(_0x180a51!=_0x203e26){const _0x1d2a7f=ut(_0x203e26,'data-id');_0x3960c1(_0x1d2a7f)||(_0x23ce76['push']({'node':_0x203e26,'id':_0x1d2a7f,'type':'modified'}),_0x30bc55['modifiedNodeIds']['push'](_0x1d2a7f));}else _0x30bc55['modifiedNodeIds']['includes'](_0x36d414)?_0x23ce76['push']({'node':_0x180a51,'type':'modified','id':_0x36d414}):_0x30bc55['newNodeIds']['includes'](_0x36d414)?_0x23ce76['push']({'node':_0x180a51,'type':'new','id':_0x36d414,'anchorId':ut(_0x180a51['previousSibling'],'data-id')}):_0x23ce76['push']({'node':_0x180a51,'type':'removed','id':_0x36d414});return!0x0;},this['parsedMergedContent']),_0x23ce76=_0x23ce76['filter'](({node:_0x3443ea})=>[...Ui(_0x3443ea),_0x3443ea]['every'](_0x21eaf3=>!ut(_0x21eaf3,'data-unstable'))),0x0==_0x23ce76['length'])return;const _0x9278af=[[_0x23ce76[0x0]]];for(let _0xa503ac=0x1;_0xa503ac<_0x23ce76['length'];_0xa503ac++){const _0x48c2e4=_0x9278af[_0x9278af['length']-0x1],_0x35f9fa=_0x48c2e4[_0x48c2e4['length']-0x1];_0x23ce76[_0xa503ac]['node']['previousSibling']==_0x35f9fa['node']&&'modified'!=_0x23ce76[_0xa503ac]['type']&&'modified'!=_0x35f9fa['type']?_0x48c2e4['push'](_0x23ce76[_0xa503ac]):_0x9278af['push']([_0x23ce76[_0xa503ac]]);}for(const _0x3b8d3c of _0x9278af){const _0x6031fc=_0x3b8d3c[0x0],_0x1accf5=_0x3b8d3c[_0x3b8d3c['length']-0x1],_0x196f32=_0x23d0ed(_0x6031fc['node']['previousSibling']);_0x196f32&&_0x3b8d3c['unshift'](_0x196f32);const _0x249409=_0x23d0ed(_0x1accf5['node']['nextSibling']);_0x249409&&_0x3b8d3c['push'](_0x249409);}function _0x3960c1(_0x306132){return _0x30bc55['modifiedNodeIds']['includes'](_0x306132)||_0x30bc55['newNodeIds']['includes'](_0x306132)||_0x30bc55['removedNodeIds']['includes'](_0x306132);}function _0x23d0ed(_0x141f08){if(_0x141f08&&ut(_0x141f08,'data-id')&&!ut(_0x141f08,'data-unstable')){const _0x3ff0a2=ut(_0x141f08,'data-id');if(!_0x3960c1(_0x3ff0a2))return{'node':_0x141f08,'type':'context','id':_0x3ff0a2};}return null;}this['changeGroups']=_0x9278af['map']((_0x472923,_0x67968b)=>({'changes':_0x472923,'state':'pending','index':_0x67968b}));}}const De=['interactionCreated','interactionStarted','interactionStopped','interactionFinished','interactionDestroyed','replyCreated','replyContentUpdated','replyChangeGroupStateUpdated','setConversationTitle','webSearchStarted','webSearchFinished','reasoningStarted','reasoningFinished','toolDataReceived','error'];class os extends _0x5bd7c6(){['id'];['replies']=[];['currentReply'];['messageId'];['actionCallId'];['currentRequest'];['connector'];['isStopped']=!0x1;['isDestroyed']=!0x1;['editor'];['_isReasoning']=!0x1;['_isWebSearching']=!0x1;constructor({connector:_0x650124,editor:_0x13f1cf}){super(),this['id']=_0x48eb5e(),this['connector']=_0x650124,this['isStopped']=!0x0,this['editor']=_0x13f1cf;}async['start'](){const _0x899b75=[];let _0x2497de,_0x48a565,_0x4f3d99;this['isStopped']=!0x1;try{this['currentRequest']=await this['sendRequest'](),this['fire']('interactionStarted',this);const _0x4b4f58=await this['currentRequest']['getStream']();for await(const _0x1ddaae of _0x4b4f58){if(this['isStopped'])return;if('error'==_0x1ddaae['event'])return void this['fire']('error',{'error':new _0x563e6a('ai-chat-interaction-error',this)});switch(_0x1ddaae['event']){case'message-metadata':this['messageId']=_0x1ddaae['data']['messageId'];break;case'action-metadata':this['actionCallId']=_0x1ddaae['data']['callId'];break;case'conversation-title':this['setConversationTitle'](_0x1ddaae['data']['conversationTitle'],!0x0);break;case'source':_0x899b75['push'](_0x1ddaae['data']['source']);break;case'web-search':this['_isWebSearching']||(this['_isWebSearching']=!0x0,this['fire']('webSearchStarted',this));break;case'reasoning':this['_isReasoning']||(this['_isReasoning']=!0x0,this['fire']('reasoningStarted',this));break;case'modification-delta':case'text-delta':this['resetReasoningState'](),this['resetWebSearchState'](),_0x2497de='modification-delta'==_0x1ddaae['event']?'modification':'text',_0x48a565='modification-delta'==_0x1ddaae['event']?_0x1ddaae['data']['id']:void 0x0,this['currentReply']&&this['currentReply']['type']!=_0x2497de&&(this['currentReply']['done'](),this['currentReply']=void 0x0),this['currentReply']||(this['currentReply']=this['createReply']({'type':_0x2497de,'interactionId':this['id'],'id':_0x48a565}),'modification'==_0x2497de&&(this['currentReply']['sources']=_0x899b75['splice'](0x0))),this['currentReply']['appendContent'](_0x1ddaae['data']['textDelta']);break;case'mcp-tool-result':_0x4f3d99=JSON['parse'](_0x1ddaae['data']['result']),this['_handleToolResultData']({'toolName':_0x1ddaae['data']['toolName'],'data':_0x4f3d99['data'],'attributes':_0x4f3d99['attributes']});break;case'mcp-tool-notification':this['_handleToolNotificationData']({'toolName':_0x1ddaae['data']['toolName'],'data':_0x1ddaae['data']['data']});}}}finally{this['isStopped']||(this['currentReply']&&_0x899b75['length']>0x0&&(this['currentReply']['sources']=_0x899b75['splice'](0x0)),this['_finalizeInteraction'](),this['fire']('interactionFinished',this));}}['stop'](){this['isStopped']||(this['_finalizeInteraction'](),this['fire']('interactionStopped',this));}['getReply'](_0x4ba0ff){return this['replies']['find'](_0x48b9cd=>_0x48b9cd['id']===_0x4ba0ff);}['destroy'](){this['isDestroyed']||(this['stop'](),this['replies']['forEach'](_0x4642fd=>_0x4642fd['destroy']()),this['replies']=[],this['isDestroyed']=!0x0,this['fire']('interactionDestroyed',this),this['stopListening']());}['createReply'](_0x383a9a){const _0x369e98=new xi({'editor':this['editor'],'documentContextContent':this['getDocumentContext']()?.['content'],..._0x383a9a});return this['replies']['push'](_0x369e98),_0x369e98['delegate'](...De)['to'](this),this['fire']('replyCreated',_0x369e98),_0x369e98;}['setConversationTitle'](_0x42a942,_0x13556d=!0x1){this['fire']('setConversationTitle',_0x42a942,_0x13556d);}['resetWebSearchState'](){this['_isWebSearching']&&(this['_isWebSearching']=!0x1,this['fire']('webSearchFinished',this));}['resetReasoningState'](){this['_isReasoning']&&(this['_isReasoning']=!0x1,this['fire']('reasoningFinished',this));}['_handleToolResultData'](_0x123ec2){this['fire']('toolDataReceived',{'type':'result','toolName':_0x123ec2['toolName'],'data':structuredClone(_0x123ec2['data']||{}),'attributes':structuredClone(_0x123ec2['attributes']||{})},this);}['_handleToolNotificationData'](_0xde6209){this['fire']('toolDataReceived',{'type':'notification','toolName':_0xde6209['toolName'],'data':structuredClone(_0xde6209['data'])},this);}['_finalizeInteraction'](){this['isStopped']=!0x0,this['currentRequest']&&this['currentRequest']['abortController']['abort'](),this['currentReply']&&this['currentReply']['done'](),this['currentRequest']=this['currentReply']=void 0x0;}}var xe=function(_0x37e689){return _0x37e689['TOOL']='mcp-tool-context',_0x37e689['FILE']='file',_0x37e689['DOCUMENT']='document',_0x37e689['URL']='web-resource',_0x37e689['TEXT']='text',_0x37e689['SELECTION']='selection',_0x37e689;}({}),ye=function(_0x4dd990){return _0x4dd990['TEXT']='text',_0x4dd990['MARKDOWN']='markdown',_0x4dd990['HTML']='html',_0x4dd990;}({});const Oe=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']]),ze=['contextItemAdded','contextItemRemoved','contextItemLoadingEnded','contextSent','error','addContextOptionsChanged','sourceResourcesLoaded','resourceStateChanged','uploadProgressChanged'];class We extends ts(){['_connector'];['_config'];['_ownerId'];constructor({connector:_0x95dd63,config:_0x39e0f0,ownerId:_0x333a51}){super(),this['_connector']=_0x95dd63,this['_config']=_0x39e0f0,this['_ownerId']=_0x333a51;}['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'](_0x29bfcf){const _0x10d0a4=await this['_createContextItemFromContent'](_0x29bfcf);return this['_addToConversationContextItem'](_0x10d0a4),'current-document'===_0x10d0a4['uiId']&&this['_toggleAddCurrentDocumentOptionVisibility'](),_0x10d0a4;}async['_createContextItemFromContent'](_0x4aa1c6){if(_0x4aa1c6['type']===xe['DOCUMENT']){const _0x229de2=await this['_connector']['fetchDocument'](this['_ownerId'],_0x4aa1c6['id'])['getDocument']();return{'id':'current-document','uiId':'current-document','label':'Current\x20document','type':_0x4aa1c6['type'],'content':_0x229de2['content'],'hidden':this['_conversationContextItems']['has']('current-document'),'version':_0x229de2['attributes']?.['version'],'sessionId':_0x229de2['attributes']?.['sessionId']};}if(_0x4aa1c6['type']===xe['TOOL'])return{'id':_0x4aa1c6['id'],'uiId':_0x4aa1c6['id'],'label':_0x4aa1c6['data']?.['label']||_0x4aa1c6['id'],'type':xe['TOOL'],'mcpServerName':_0x4aa1c6['mcpServerName'],'toolName':_0x4aa1c6['toolName'],'data':_0x4aa1c6['data']||{}};return{'id':_0x4aa1c6['id'],'uiId':_0x4aa1c6['id'],'label':_0x4aa1c6['attributes']?.['label']||_0x4aa1c6['name']||_0x4aa1c6['url']||_0x4aa1c6['id'],'type':_0x4aa1c6['type'],..._0x4aa1c6?.['attributes']?.['resourceId']?{'resourceId':_0x4aa1c6['attributes']?.['resourceId']}:{}};}['getSentContextItems'](){return new Map(this['_conversationContextItems']);}['removeFromContext'](_0x180e3b){const _0x49f5fe=this['_pendingContextItems']['get'](_0x180e3b);_0x49f5fe?.['isReadOnly']||this['_removeContextItem'](_0x180e3b);}['clearPendingContextItems'](){if(0x0===this['_pendingContextItems']['size'])return;for(const _0x3145e7 of this['_pendingContextItems']['values']())this['_removeContextItem'](_0x3145e7['uiId']);const _0x3442d8=this['_conversationContextItems']['get']('current-document')||this['_pendingContextItems']['get']('current-document');_0x3442d8&&this['_addContextItem']({..._0x3442d8,'isReadOnly':!0x0,'hidden':!0x0});}['addToConversationContext'](_0x28b9f5){for(const _0x76356d of _0x28b9f5['values']())this['_addToConversationContextItem'](_0x76356d);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'](_0x4e69cf){return Array['from'](_0x4e69cf['values']())['map'](_0x3b6892=>this['_mapContextItemToRequestData'](_0x3b6892))['filter'](_0x11a0cb=>null!==_0x11a0cb);}async['addFilesToContext'](_0x38e973,_0x9da36b,_0x304241=xe['FILE']){const _0x3c9a35='files-'+_0x48eb5e();this['_startUploadOperation'](_0x3c9a35);try{await Promise['all'](_0x38e973['map'](async _0x2fe717=>{const _0x2d921d='file-'+_0x48eb5e(),_0x4fd561=_0x528e40(_0x2fe717['name']);try{this['_addContextItem']({'type':_0x304241,'label':_0x9da36b?.['label']||_0x4fd561,'uiId':_0x2d921d,'resourceId':_0x9da36b?.['resourceId']},!0x0);const _0x6f5c1f=this['_connector']['uploadFile'](this['_ownerId'],_0x2fe717,_0x9da36b);this['_ongoingUploads']['set'](_0x2d921d,_0x6f5c1f['abortController']);const {id:_0x25c653}=await _0x6f5c1f['getId']();this['_ongoingUploads']['delete'](_0x2d921d),this['_finishContextItemLoading']({'type':_0x304241,'id':_0x25c653,'label':_0x9da36b?.['label']||_0x4fd561,'uiId':_0x2d921d,'resourceId':_0x9da36b?.['resourceId']},!0x1);}catch(_0x283aa8){this['_ongoingUploads']['delete'](_0x2d921d);if(!(_0x283aa8 instanceof _0x563e6a&&_0x283aa8['message']['startsWith']('ai-request-aborted'))){const _0x3ebb3c=Oe['get'](_0x283aa8['code'])||'ai-chat-file-upload-failed',_0x39296c=new _0x563e6a(_0x3ebb3c,null,{'fileName':_0x4fd561,..._0x283aa8});_0x39296c['stack']=_0x283aa8['stack'],this['fire']('error',{'error':_0x39296c});}this['_removeContextItem'](_0x2d921d);}}));}finally{this['_finishUploadOperation'](_0x3c9a35);}}['addCurrentDocumentToContext'](_0x3e6019){if(this['isCurrentDocumentInContext']()||!this['_addContextOptionsState']['document']['enabled'])return;const _0x2dcde4={'type':xe['DOCUMENT'],'uiId':'current-document','label':_0x3e6019,'isReadOnly':this['_conversationContextItems']['has']('current-document'),'hidden':this['_conversationContextItems']['has']('current-document')};this['_addContextItem'](_0x2dcde4);}async['updateCurrentDocument'](_0x4d8edd,_0x2600aa,_0x558413,_0x544502){const _0x54a067=this['_pendingContextItems']['get']('current-document');if(_0x54a067&&_0x4d8edd){_0x54a067['selection']=_0x544502?_0x544502['map'](_0x12b4d7=>({'start':_0x12b4d7['start'],'end':_0x12b4d7['end']})):[];try{if(_0x54a067['version']===_0x2600aa)return;const {id:_0x47d4c5}=await this['_connector']['uploadDocument'](this['_ownerId'],_0x4d8edd,{'version':_0x2600aa,'sessionId':_0x558413})['getId']();_0x54a067['id']=_0x47d4c5,_0x54a067['content']=_0x4d8edd,_0x54a067['version']=_0x2600aa,_0x54a067['sessionId']=_0x558413;}catch(_0x292264){const _0x2bcf44=new _0x563e6a('ai-chat-document-upload-failed',null);_0x2bcf44['stack']=_0x292264['stack'],this['fire']('error',{'error':_0x2bcf44});}}}['addSelectionToContext'](_0x2df15e){this['_addContextItem']({'type':xe['SELECTION'],'label':_0x2df15e,'uiId':'selection','content':_0x2df15e});}['removeSelectionFromContext'](){this['_removeContextItem']('selection');}async['addUrlToContext'](_0x2096f2,_0x3c875d){const _0x115302='url-'+_0x48eb5e();this['_startUploadOperation'](_0x115302);const _0x4b0746='url-'+_0x48eb5e();try{this['_addContextItem']({'type':xe['URL'],'label':_0x3c875d?.['label']||_0x2096f2,'uiId':_0x4b0746,'resourceId':_0x3c875d?.['resourceId']},!0x0);const _0x2321d8=this['_connector']['uploadUrl'](this['_ownerId'],_0x2096f2,_0x3c875d);this['_ongoingUploads']['set'](_0x4b0746,_0x2321d8['abortController']);const {id:_0x541f05}=await _0x2321d8['getId']();this['_ongoingUploads']['delete'](_0x4b0746),this['_finishContextItemLoading']({'type':xe['URL'],'id':_0x541f05,'label':_0x3c875d?.['label']||_0x2096f2,'uiId':_0x4b0746,'resourceId':_0x3c875d?.['resourceId']},!0x1);}catch(_0x489c85){this['_ongoingUploads']['delete'](_0x4b0746),(_0x489c85['message']['startsWith']('ai-request-aborted')||this['fire']('error',{'error':new _0x563e6a('ai-chat-url-upload-failed',this,{'url':_0x2096f2,'originalError':_0x489c85}),'url':_0x2096f2}),this['_removeContextItem'](_0x4b0746));}finally{this['_finishUploadOperation'](_0x115302);}}['addToolItemToContext'](_0x552a58){_0x552a58['id']=_0x552a58['id']??_0x48eb5e()['substring'](0x0,0x15),this['_pendingContextItems']['set'](_0x552a58['uiId'],_0x552a58),this['fire']('contextItemAdded',{'contextItem':_0x552a58,'isLoading':!0x1});}async['loadSourceResources'](_0x53294b,_0x4b58be,_0x375a5e){const _0x1da920=this['_addContextOptionsState']['sources']['find'](_0x350bc2=>_0x350bc2['id']===_0x53294b);if(!_0x1da920)return this['fire']('error',{'error':new _0x563e6a('ai-chat-source-not-found',this,{'sourceId':_0x53294b}),'sourceId':_0x53294b}),[];try{const _0x38cde3=(await _0x1da920['getResources'](_0x4b58be))['map'](_0x5fa114=>{const _0x3639a3=this['_isResourceInContext'](_0x5fa114['id']);return{..._0x5fa114,'isInContext':_0x3639a3};});return _0x1da920['resources']=_0x38cde3,this['fire']('sourceResourcesLoaded',{'sourceId':_0x53294b,'source':_0x1da920,'resources':_0x38cde3,'uid':_0x375a5e}),_0x38cde3;}catch(_0x2b9f5e){return this['fire']('error',{'error':new _0x563e6a('ai-chat-source-resources-load-failed',this,{'sourceId':_0x53294b,'originalError':_0x2b9f5e}),'sourceId':_0x53294b,'sourceLabel':_0x1da920['label']}),[];}}async['addResourceToContext'](_0x378ca7,_0x3bec8b){if(this['_isResourceInContext'](_0x3bec8b['id']))return;let _0x1ac97f=_0x3bec8b['data'];if(!_0x1ac97f&&_0x378ca7['getData'])try{_0x1ac97f=await _0x378ca7['getData'](_0x3bec8b['id']);}catch(_0x5ae552){return void this['fire']('error',{'error':new _0x563e6a('ai-chat-resource-load-failed',this,{'resourceId':_0x3bec8b['id'],'sourceId':_0x378ca7['id'],'originalError':_0x5ae552}),'resourceId':_0x3bec8b['id'],'sourceId':_0x378ca7['id']});}if(_0x1ac97f)switch(_0x3bec8b['type']){case xe['URL']:if('string'!=typeof _0x1ac97f)return void this['fire']('error',{'error':new _0x563e6a('ai-chat-context-invalid-data',this,{'resourceId':_0x3bec8b['id'],'sourceId':_0x378ca7['id'],'expectedType':'string','actualType':typeof _0x1ac97f}),'resourceId':_0x3bec8b['id'],'sourceId':_0x378ca7['id']});await this['addUrlToContext'](_0x1ac97f,{'label':_0x3bec8b['label'],'resourceId':_0x3bec8b['id']});break;case xe['FILE']:if(!(_0x1ac97f instanceof File))return void this['fire']('error',{'error':new _0x563e6a('ai-chat-context-invalid-data',this,{'resourceId':_0x3bec8b['id'],'sourceId':_0x378ca7['id'],'expectedType':'File','actualType':typeof _0x1ac97f}),'resourceId':_0x3bec8b['id'],'sourceId':_0x378ca7['id']});await this['addFilesToContext']([_0x1ac97f],{'label':_0x3bec8b['label'],'resourceId':_0x3bec8b['id']});break;case xe['TEXT']:if('object'!=typeof _0x1ac97f||!('content'in _0x1ac97f)||!('type'in _0x1ac97f))return void this['fire']('error',{'error':new _0x563e6a('ai-chat-context-invalid-data',this,{'resourceId':_0x3bec8b['id'],'sourceId':_0x378ca7['id'],'expectedType':'object\x20with\x20content\x20and\x20type\x20properties','actualType':typeof _0x1ac97f}),'resourceId':_0x3bec8b['id'],'sourceId':_0x378ca7['id']});_0x1ac97f=We['_convertTextResourceToFile'](_0x1ac97f,_0x3bec8b['label']),await this['addFilesToContext']([_0x1ac97f],{'label':_0x3bec8b['label'],'resourceId':_0x3bec8b['id']},xe['TEXT']);break;case xe['TOOL']:break;default:this['fire']('error',{'error':new _0x563e6a('ai-chat-context-unsupported-type',this,{'resourceId':_0x3bec8b['id'],'sourceId':_0x378ca7['id'],'resourceType':_0x3bec8b['type']}),'resourceId':_0x3bec8b['id'],'sourceId':_0x378ca7['id']});}else this['fire']('error',{'error':new _0x563e6a('ai-chat-resource-no-data',this,{'resourceId':_0x3bec8b['id'],'sourceId':_0x378ca7['id']}),'resourceId':_0x3bec8b['id'],'sourceId':_0x378ca7['id']});}static['_convertTextResourceToFile'](_0xaddd44,_0xeb103c){switch(_0xaddd44['type']){case ye['MARKDOWN']:return new File([_0xaddd44['content']],_0xeb103c,{'type':'text/markdown'});case ye['HTML']:return new File([_0xaddd44['content']],_0xeb103c,{'type':'text/html'});default:return new File([_0xaddd44['content']],_0xeb103c,{'type':'text/plain'});}}static['_mapContextItemToRequestData'](_0x521cfc){switch(_0x521cfc['type']){case xe['FILE']:return{'type':xe['FILE'],'id':_0x521cfc['id']};case xe['URL']:return{'type':xe['URL'],'id':_0x521cfc['id']};case xe['DOCUMENT']:return{'type':xe['DOCUMENT'],'id':_0x521cfc['id'],..._0x521cfc['selection']?.['length']&&{'selection':_0x521cfc['selection']}};case xe['TEXT']:return{'type':xe['FILE'],'id':_0x521cfc['id']};case xe['TOOL']:{const _0x1a115c=_0x521cfc;return{'type':xe['TOOL'],'mcpServerName':_0x1a115c['mcpServerName'],'toolName':_0x1a115c['toolName'],'data':_0x1a115c['data'],'id':_0x1a115c['id']};}default:return null;}}['_addContextItem'](_0x5ef5b2,_0x3b6a68=!0x1){if(this['_pendingContextItems']['set'](_0x5ef5b2['uiId'],_0x5ef5b2),_0x5ef5b2['hidden']||this['fire']('contextItemAdded',{'contextItem':_0x5ef5b2,'isLoading':_0x3b6a68}),'current-document'===_0x5ef5b2['uiId']&&this['_toggleAddCurrentDocumentOptionVisibility'](),_0x5ef5b2['resourceId']){const _0x21f101=this['_findSourceIdsByResourceId'](_0x5ef5b2['resourceId']);_0x21f101&&_0x21f101['forEach'](_0x32a873=>{this['_updateResourceInContextState'](_0x32a873,_0x5ef5b2['resourceId'],!0x0);});}}['_removeContextItem'](_0x1b75be){const _0x2b8c91=this['_pendingContextItems']['get'](_0x1b75be),_0x515619=this['_ongoingUploads']['get'](_0x1b75be);if(_0x515619&&(_0x515619['abort'](),this['_ongoingUploads']['delete'](_0x1b75be)),_0x2b8c91?.['resourceId']){const _0x324c90=this['_findSourceIdsByResourceId'](_0x2b8c91['resourceId']);_0x324c90&&_0x324c90['forEach'](_0x243be=>{this['_updateResourceInContextState'](_0x243be,_0x2b8c91['resourceId'],!0x1);});}this['_pendingContextItems']['delete'](_0x1b75be),this['fire']('contextItemRemoved',{'uiId':_0x1b75be,'type':_0x2b8c91?.['type']}),'current-document'===_0x1b75be&&this['_toggleAddCurrentDocumentOptionVisibility']();}['_finishContextItemLoading'](_0x5e4ab4,_0x4ef090){if(this['_pendingContextItems']['has'](_0x5e4ab4['uiId'])&&(this['_pendingContextItems']['set'](_0x5e4ab4['uiId'],_0x5e4ab4),this['fire']('contextItemLoadingEnded',{'contextItem':_0x5e4ab4,'isLoading':_0x4ef090}),_0x5e4ab4['resourceId'])){const _0x54e97d=this['_findSourceIdsByResourceId'](_0x5e4ab4['resourceId']);_0x54e97d&&_0x54e97d['forEach'](_0x15f9e0=>{this['_updateResourceInContextState'](_0x15f9e0,_0x5e4ab4['resourceId'],!0x0);});}}['_addToConversationContextItem'](_0x71906e){this['_conversationContextItems']['set'](_0x71906e['uiId'],_0x71906e);}['_setAddContextOptionsDefaultState'](){this['_addContextOptionsState']={'document':{'enabled':!0x1!==this['_config']?.['document']?.['enabled'],'isHidden':!0x1},'urls':{'enabled':!0x1!==this['_config']?.['urls']?.['enabled']},'files':{'enabled':!0x1!==this['_config']?.['files']?.['enabled']},'sources':this['_getCustomSourcesInitialState'](),'customItems':this['_config']?.['customItems']?.['map'](_0x3bdca1=>({..._0x3bdca1,'enabled':!0x0}))??[]},this['fire']('addContextOptionsChanged',{'options':this['_addContextOptionsState']});}['_getCustomSourcesInitialState'](){return this['_config']?.['sources']?.['map'](_0x20b168=>({..._0x20b168,'resources':[]}))??[];}['_toggleAddCurrentDocumentOptionVisibility'](){const _0x217230=this['isCurrentDocumentInContext']()||this['isCurrentDocumentInConversation']();this['_addContextOptionsState']['document']['isHidden']=_0x217230,this['fire']('addContextOptionsChanged',{'options':this['_addContextOptionsState']});}['_isResourceInContext'](_0x1f8f59){for(const _0x1825af of this['_pendingContextItems']['values']())if(_0x1825af['resourceId']===_0x1f8f59)return!0x0;for(const _0x3c696d of this['_conversationContextItems']['values']())if(_0x3c696d['resourceId']===_0x1f8f59)return!0x0;return!0x1;}['_findSourceIdsByResourceId'](_0x43905e){const _0x433e58=[];for(const _0x5fbc76 of this['_addContextOptionsState']['sources']){_0x5fbc76['resources']['find'](_0x54e596=>_0x54e596['id']===_0x43905e)&&_0x433e58['push'](_0x5fbc76['id']);}return 0x0===_0x433e58['length']?null:_0x433e58;}['_updateResourceInContextState'](_0x6476dd,_0x33efe9,_0xddbf2f){const _0x512971=this['_addContextOptionsState']['sources']['find'](_0x8d3cae=>_0x8d3cae['id']===_0x6476dd);if(!_0x512971)return;const _0x272f9f=_0x512971['resources']['find'](_0xf8581e=>_0xf8581e['id']===_0x33efe9);_0x272f9f&&(_0x272f9f['isInContext']=_0xddbf2f,this['fire']('resourceStateChanged',{'sourceId':_0x6476dd,'resourceId':_0x33efe9,'isInContext':_0xddbf2f}));}['_startUploadOperation'](_0x5d775b){this['_ongoingUploadOperations']['set'](_0x5d775b,!0x0),this['_ongoingUploadOperations']['size']&&this['fire']('uploadProgressChanged',{'isUploadInProgress':!0x0});}['_finishUploadOperation'](_0x391cb6){this['_ongoingUploadOperations']['delete'](_0x391cb6),0x0===this['_ongoingUploadOperations']['size']&&this['fire']('uploadProgressChanged',{'isUploadInProgress':!0x1});}}const He=['capabilitiesUpdated'];class Ue extends _0x5bd7c6(){['_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'](_0x364fcd){const _0x5e9cb8={};return _0x364fcd&&_0x364fcd['isWebSearchEnabled']&&(_0x5e9cb8['webSearch']={}),_0x364fcd&&_0x364fcd['isReasoningEnabled']&&(_0x5e9cb8['reasoning']={}),_0x5e9cb8;}['toggleWebSearch'](){this['setWebSearch'](!this['_isWebSearchEnabled']);}['toggleReasoning'](){this['setReasoning'](!this['_isReasoningEnabled']);}['setWebSearch'](_0x5e48e3){_0x5e48e3!==this['_isWebSearchEnabled']&&(this['_isWebSearchEnabled']=_0x5e48e3,this['fire']('capabilitiesUpdated',this['getCapabilitiesConfig']()));}['setReasoning'](_0x18a2e7){_0x18a2e7!==this['_isReasoningEnabled']&&(this['_isReasoningEnabled']=_0x18a2e7,this['fire']('capabilitiesUpdated',this['getCapabilitiesConfig']()));}}class Je extends os{['userMessage'];['conversationId'];['contextItems']=new Map();['model'];['attributes'];constructor(_0x37248b){super(_0x37248b),this['conversationId']=_0x37248b['conversationId'],this['contextItems']=_0x37248b['contextItems'],this['capabilities']=_0x37248b['capabilities'],this['userMessage']=_0x37248b['userMessage'],this['model']=_0x37248b['model'],this['attributes']=_0x37248b['attributes'];}async['sendRequest'](){return this['connector']['queryAssistant']({'message':this['userMessage'],'conversationId':this['conversationId'],'parts':We['mapContextItemsToRequestData'](this['contextItems']),'capabilities':Ue['getCapabilitiesRequestData'](this['capabilities']),'model':this['model'],'attributes':this['attributes']});}['getDocumentContext'](){return this['contextItems']['get']('current-document');}}class st extends _0x5bd7c6(){['id'];['isStarted']=!0x1;['isFromHistory'];['interactions']=[];['currentInteraction'];['selectedModel'];['connector'];['options'];constructor(_0x12e3bc){super(),this['options']=_0x12e3bc,this['connector']=_0x12e3bc['connector'],this['chatModels']=_0x12e3bc['chatModels'],this['id']=_0x12e3bc['conversationId'],this['isFromHistory']=_0x12e3bc['isFromHistory'];}async['init'](_0x46de16){try{this['chatContext']=new We({'connector':this['connector'],'config':_0x46de16,'ownerId':this['id']}),this['chatContext']['delegate'](...ze)['to'](this),this['chatContext']['init'](),this['chatCapabilities']=new Ue(),this['chatCapabilities']['delegate'](...He)['to'](this),this['chatCapabilities']['init']();const _0x5a1f87=await this['chatModels']['getAvailableModels']();this['fire']('conversationInitialized',{'availableModels':_0x5a1f87});const _0x3cfeab=await this['chatModels']['getModel'](this['options']['selectedModelId']);_0x3cfeab&&await this['setModel'](_0x3cfeab);}catch(_0x383d9e){const _0x13444c=new _0x563e6a('ai-chat-conversation-init-failed',null,{'message':_0x383d9e['message']||_0x383d9e});_0x13444c['stack']=_0x383d9e['stack'],this['fire']('error',{'error':_0x13444c});}}async['start'](){if(this['isStarted'])throw new _0x563e6a('ai-chat-conversation-already-started',null,{'conversation':this});if(!this['selectedModel'])throw new _0x563e6a('ai-chat-conversation-start-no-model-selected',null,{'conversation':this});try{const {id:_0x33a346}=await this['connector']['startConversation'](this['id'],this['options']['group'])['getConversation']();this['id']=_0x33a346,this['isStarted']=!0x0,this['fire']('conversationStarted',{'conversationId':this['id'],'selectedModel':this['selectedModel']});}catch(_0x51bf83){const _0x48e8ee=new _0x563e6a('ai-chat-conversation-start-failed',null,{'message':_0x51bf83['message'],'conversationId':this['id']});throw _0x48e8ee['stack']=_0x51bf83['stack'],this['fire']('error',{'error':_0x48e8ee}),_0x48e8ee;}}async['load'](_0x4a98e4,_0x58a866){try{const _0xc639fa=await this['connector']['fetchConversation'](_0x4a98e4)['getConversation'](),_0x63e9de=await this['connector']['fetchConversationMessages'](_0x4a98e4)['getMessages'](),_0x5cc555=_0x63e9de[0x0]['model'];this['isStarted']=!0x0,this['id']=_0xc639fa['id'],'title'in _0xc639fa?this['fire']('setConversationTitle',_0xc639fa['title'],!0x0):this['fire']('setConversationTitle','',!0x0);const _0x31c781=(await this['chatModels']['getAll']())['find'](_0x3d1de8=>_0x3d1de8['id']['toLowerCase']()===_0x5cc555['toLowerCase']());return this['selectedModel']=_0x31c781,this['fire']('modelSelected',{'selectedModel':_0x31c781,'isDisabled':!0x0}),await this['_processMessagesToInteractions'](_0x63e9de,_0x58a866,_0x5cc555),this['currentInteraction']=void 0x0,this;}catch(_0x4505a0){const _0xeecc65=new _0x563e6a('ai-chat-conversation-init-from-id-failed',null,{'message':_0x4505a0['message'],'conversationId':_0x4a98e4});throw _0xeecc65['stack']=_0x4505a0['stack'],this['fire']('error',{'error':_0xeecc65}),_0xeecc65;}}async['_processMessagesToInteractions'](_0x29ac98,_0x40f5e5,_0x13b0bb){let _0x4ba82e;for(const _0x58d56a of _0x29ac98)if('user'===_0x58d56a['role']){const _0x364ffd=await this['_extractContextItems'](_0x58d56a),_0x5b5437={'isReasoningEnabled':Object['hasOwn'](_0x58d56a['capabilities'],'reasoning'),'isWebSearchEnabled':Object['hasOwn'](_0x58d56a['capabilities'],'webSearch')};_0x4ba82e=this['createInteraction']({'userMessage':_0x58d56a['prompt'],'contextItems':_0x364ffd,'capabilities':_0x5b5437,'modelId':_0x13b0bb,'attributes':_0x58d56a['attributes']}),this['currentInteraction']=_0x4ba82e,this['chatContext']['addToConversationContext'](this['currentInteraction']['contextItems']);}else{if('assistant'===_0x58d56a['role']&&_0x4ba82e){const _0x1bcc4e=[];for(const _0x50278e of _0x58d56a['content'])switch(_0x50278e['type']){case'text':case'modification':{const _0x3b4678=_0x4ba82e['getDocumentContext']()?.['sessionId']!==_0x40f5e5;_0x4ba82e['currentReply']=_0x4ba82e['createReply']({'type':_0x50278e['type'],'isDone':!0x0,'interactionId':_0x4ba82e['id'],'areActionsDisabled':_0x3b4678}),_0x4ba82e['currentReply']['appendContent'](_0x50278e['content']),_0x1bcc4e['length']>0x0&&(_0x4ba82e['currentReply']['sources']=_0x1bcc4e['splice'](0x0));break;}case'url':_0x1bcc4e['push'](_0x50278e);break;case'mcp-tool-result':{const {data:_0x1b37f8,attributes:_0x4e2efd}=JSON['parse'](_0x50278e['content']);_0x4ba82e['_handleToolResultData']({'toolName':_0x50278e['toolName'],'data':_0x1b37f8,'attributes':_0x4e2efd});break;}}}}}async['_extractContextItems'](_0x509e5b){const _0x14d699=new Map();if(!_0x509e5b['content'])return _0x14d699;for(const _0x4ead55 of _0x509e5b['content']){const _0x39b76d=await this['chatContext']['populateFromMessage'](_0x4ead55);_0x39b76d&&_0x14d699['set'](_0x39b76d['id'],_0x39b76d);}return _0x14d699;}async['handleUserInteraction']({userMessage:_0x5ea830,attributes:_0xe1c7c7}){if(!this['isStarted'])throw new _0x563e6a('ai-chat-handle-user-conversation-not-initialized',null,{'conversation':this});if(this['currentInteraction'])throw new _0x563e6a('ai-chat-handle-user-interaction-already-in-progress',null,{'conversation':this});try{const _0x1e7d86=this['chatContext']['getPendingContextItems'](),_0x1d0411=this['chatCapabilities']['getCapabilitiesConfig'](),_0x216b37=this['selectedModel']['id'];this['currentInteraction']=this['createInteraction']({'userMessage':_0x5ea830,'contextItems':_0x1e7d86,'capabilities':_0x1d0411,'modelId':_0x216b37,'attributes':_0xe1c7c7}),await this['currentInteraction']['start'](),this['chatContext']['addToConversationContext'](this['currentInteraction']['contextItems']);}catch(_0x5e7a47){if(_0x5e7a47 instanceof _0x563e6a)this['fire']('error',{'interactionId':this['currentInteraction']?this['currentInteraction']['id']:void 0x0,'error':_0x5e7a47});else{const _0x38c5c1=Oe['get'](_0x5e7a47['code'])||'ai-chat-handle-user-interaction-start-failed';this['fire']('error',{'interactionId':this['currentInteraction']?this['currentInteraction']['id']:void 0x0,'error':new _0x563e6a(_0x38c5c1,null,{'error':_0x5e7a47})});}}finally{this['currentInteraction']?.['stop'](),this['currentInteraction']=void 0x0;}}['createInteraction']({userMessage:_0x5a3825,contextItems:_0x5163ef,capabilities:_0x465eef,modelId:_0x2ce9f9,attributes:_0x562373}){const _0x2fc657=new Je({'userMessage':_0x5a3825,'contextItems':_0x5163ef,'capabilities':_0x465eef,'conversationId':this['id'],'connector':this['connector'],'editor':this['options']['getEditor']&&this['options']['getEditor'](),'model':_0x2ce9f9,'attributes':_0x562373});return _0x2fc657['delegate'](...De)['to'](this),this['interactions']['push'](_0x2fc657),this['fire']('interactionCreated',_0x2fc657),_0x2fc657;}['getInteraction'](_0x1226ab){return this['interactions']['find'](_0x19ffdc=>_0x19ffdc['id']===_0x1226ab);}['removeInteraction'](_0x1a4e1c){const _0x49431a=this['getInteraction'](_0x1a4e1c);_0x49431a&&(_0x49431a['destroy'](),this['interactions']['splice'](this['interactions']['indexOf'](_0x49431a),0x1));}get['lastInteraction'](){return this['interactions'][this['interactions']['length']-0x1];}['addCurrentDocumentToContext'](_0x50f0cc){this['chatContext']['addCurrentDocumentToContext'](_0x50f0cc);}async['updateCurrentDocumentInContext']({content:_0x2d87b3,version:_0x184bcf,sessionId:_0x2a0ade,selections:_0x266d34}){await this['chatContext']['updateCurrentDocument'](_0x2d87b3,_0x184bcf,_0x2a0ade,_0x266d34);}['getCurrentDocumentContext'](){return this['currentInteraction']?.['getDocumentContext']()?.['content']||'';}['addSelectionToContext'](_0xc460fb){this['chatContext']['addSelectionToContext'](_0xc460fb);}['removeSelectionFromContext'](){this['chatContext']['removeSelectionFromContext']();}['addFilesToContext'](_0x356bab){this['chatContext']['addFilesToContext'](_0x356bab);}['addUrlToContext'](_0x28ca42){this['chatContext']['addUrlToContext'](_0x28ca42);}['addToolItemToContext'](_0xd067f){this['chatContext']['addToolItemToContext'](_0xd067f);}['addResourceToContext'](_0x138ae8,_0x212262){this['chatContext']['addResourceToContext'](_0x138ae8,_0x212262);}['loadSourceResources'](_0xa5cac4,_0x18b348,_0x3ab3fb){return this['chatContext']['loadSourceResources'](_0xa5cac4,_0x18b348,_0x3ab3fb);}['removeFromContext'](_0x3012ec){this['chatContext']['removeFromContext'](_0x3012ec);}['setWebSearch'](_0x40869f){this['chatCapabilities']['setWebSearch'](_0x40869f);}['toggleWebSearch'](){this['chatCapabilities']['toggleWebSearch']();}['setReasoning'](_0x4a339c){this['chatCapabilities']['setReasoning'](_0x4a339c);}['toggleReasoning'](){this['chatCapabilities']['toggleReasoning']();}['isCurrentDocumentInContext'](){return this['chatContext']['isCurrentDocumentInContext']();}['isCurrentDocumentInConversation'](){return this['chatContext']['isCurrentDocumentInConversation']();}['isSelectionInContext'](){return this['chatContext']['isSelectionInContext']();}async['setModel'](_0x9a66f5){_0x9a66f5?!0x1===await this['chatModels']['isAvailable'](_0x9a66f5)&&(_0xa8aac2('ai-chat-conversation-set-model-not-available',{'conversation':this,'model':_0x9a66f5}),_0x9a66f5=(await this['chatModels']['getAvailableModels']())[0x0]):(_0xa8aac2('ai-chat-conversation-set-model-null',{'conversation':this}),_0x9a66f5=(await this['chatModels']['getAvailableModels']())[0x0]),_0x9a66f5['id']!==this['selectedModel']?.['id']&&(this['selectedModel']=_0x9a66f5,this['chatCapabilities']['reset'](),this['fire']('modelSelected',{'selectedModel':_0x9a66f5}));}}class et extends _0x5bd7c6(){['_connector'];['_config'];['_locale'];['_modelList']=[];['_modelsRequest']=null;constructor({connector:_0x3b449e,config:_0x44e2d8,locale:_0x41b86e}){super(),this['_connector']=_0x3b449e,this['_config']=_0x44e2d8,this['_locale']=_0x41b86e;}get['_availableModels'](){return this['_config']?.['displayedModels'];}get['_defaultModelId'](){return this['_config']?.['defaultModelId'];}async['getAll'](){return this['_modelsRequest']||(this['_modelsRequest']=this['_retrieveModels']()),this['_modelsRequest'];}async['getAvailableModels'](){const _0x4824f4=await this['getAll']();let _0xbd822b;return _0xbd822b=this['_availableModels']?this['_filterModels'](_0x4824f4,this['_availableModels']):_0x4824f4['filter'](_0xea34a1=>_0xea34a1['recommended']),_0xbd822b;}async['getModel'](_0x4863dc){const _0x559d4a=await this['getAll']();if(!_0x559d4a['length'])return null;if(_0x4863dc){const _0x54d95f=this['_getModelById'](_0x559d4a,_0x4863dc);if(_0x54d95f)return _0x54d95f;_0xa8aac2('ai-chat-model-id-unrecognized',{'modelId':_0x4863dc,'fallBackModelId':this['_defaultModelId']});}return this['getDefault']();}async['getDefault'](){const _0xc7d03d=await this['getAvailableModels']();if(!_0xc7d03d['length'])return null;if(this['_defaultModelId']){const _0x437eef=this['_getModelById'](_0xc7d03d,this['_defaultModelId']);if(_0x437eef)return _0x437eef;_0xa8aac2('ai-chat-default-model-id-unrecognized',{'defaultModelId':this['_defaultModelId'],'fallBackModelId':_0xc7d03d[0x0]['id']});}return _0xc7d03d[0x0];}async['isAvailable'](_0x256319){return(await this['getAvailableModels']())['some'](_0x2e62b2=>_0x2e62b2['name']===_0x256319['name']&&_0x2e62b2['provider']===_0x256319['provider']);}async['_retrieveModels'](){if(!this['_modelList']['length'])try{const _0x402e64=this['_locale']['uiLanguage']||'en',_0x2b168a=this['_connector']['getModels'](_0x402e64),_0x473551=await _0x2b168a['list']();this['_modelList']=_0x473551['items']['map'](_0x10b463=>Bi(_0x10b463)?{..._0x10b463,'name':i(this['_locale'],'AI_MODEL_NAME_AUTO')}:_0x10b463);}catch(_0x103285){throw _0x4e5dbd('ai-models-unable-to-retrieve',{'error':_0x103285}),_0x103285;}return[...this['_modelList']];}['_filterModels'](_0x583a46,_0x471cfa){let _0xeedd60;if(_0x471cfa){_0xeedd60=[];const _0xa135e4=new Set(),_0xe8c2d4='string'==typeof _0x471cfa?[_0x471cfa['toLocaleLowerCase']()]:_0x471cfa['map'](_0x5b4b24=>_0x5b4b24['toLocaleLowerCase']());for(const _0x560507 of _0xe8c2d4)for(const _0x5a1dc5 of _0x583a46)!_0xa135e4['has'](_0x5a1dc5['id'])&&this['_isMatchingFilter'](_0x5a1dc5,_0x560507)&&(_0xeedd60['push'](_0x5a1dc5),_0xa135e4['add'](_0x5a1dc5['id']));}else _0xeedd60=_0x583a46;return _0xeedd60;}['_isMatchingFilter'](_0x5d669a,_0x53ddf3){const _0x1ce6e8=_0x5d669a['id']['toLocaleLowerCase'](),_0x2a814a=_0x5d669a['name']['toLocaleLowerCase'](),_0x5f3eee=_0x5d669a['provider']['toLocaleLowerCase']();return _0x1ce6e8===_0x53ddf3||_0x2a814a===_0x53ddf3||Bi(_0x5d669a)&&'auto'===_0x53ddf3||_0x5f3eee===_0x53ddf3||_0x1ce6e8['startsWith'](_0x53ddf3);}['_getModelById'](_0x4ab46e,_0x488399){return _0x4ab46e['find'](_0x29bce8=>Bi(_0x29bce8)&&'auto'===_0x488399?_0x29bce8:_0x29bce8['id']===_0x488399)||null;}}function Bi(_0x34c9c2){return _0x34c9c2['id']['startsWith']('agent');}function T(_0x47efb2){if(_0x47efb2 instanceof _0x2cda04)return _0x47efb2;if(_0x47efb2?.['editors']&&_0x47efb2['editors']['get'](0x0))return _0x47efb2['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.'),_0x47efb2['editors']['get'](0x0);throw new _0x563e6a('ai-get-editor-from-context-no-editor');}function at({editor:_0x6d97bb,interaction:_0x43a49a,reply:_0x23f325,groups:_0x1e531d,transform:_0x2a2f87,documentCompare:_0x509572,documentCompareOptions:_0x14e857}){const _0x46ea19=_0x43a49a['getDocumentContext']();if(!_0x46ea19)return[];const _0x4dfd26=_0x46ea19['content'],_0x3d5824=_0x46ea19['version'],_0x46f130=_0x23f325['documentContextContent']['cloneNode'](!0x0);for(const {changes:_0x2eec37}of _0x1e531d){const _0x2686aa=_0x2eec37['filter'](_0x55a305=>'new'!=_0x55a305['type'])['map'](_0x18a343=>It('data-id',_0x18a343['id'],_0x46f130)),_0xec405b=_0x2eec37['filter'](_0x471cf1=>'removed'!=_0x471cf1['type'])['map'](_0x46974e=>_0x46974e['node']['cloneNode'](!0x0));let _0x1df039=null;if(_0x2686aa['length']){_0x1df039=_0x2686aa[0x0]['previousSibling'];for(let _0x3fd194=0x0;_0x3fd194<_0x2686aa['length'];_0x3fd194++)_0x12acc3(_0x2686aa[_0x3fd194]);}if(_0xec405b['length']){_0x1df039||(_0x2eec37[0x0]['anchorId']?_0x1df039=It('data-id',_0x2eec37[0x0]['anchorId'],_0x46f130):(_0x1df039=_0xec405b['shift'](),_0x8342b6(_0x46f130,_0x1df039)));for(let _0x11a35a=0x0;_0x11a35a<_0xec405b['length'];_0x11a35a++)_0x43ba66(_0x1df039,_0xec405b[_0x11a35a]),_0x1df039=_0xec405b[_0x11a35a];}}const _0x5d656c=pt(_0x46f130),_0x566fef=_0x509572['getDiff'](_0x4dfd26,_0x5d656c,_0x14e857)['getOperations']();if(_0x2a2f87){const _0x50a076=_0x6d97bb['model']['document']['history']['getOperations'](_0x3d5824),_0xc29ad2={'document':_0x6d97bb['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1};return kt(_0x566fef,_0x50a076,_0xc29ad2)['operationsA'];}return _0x566fef;}function rt(_0x2e18ec,_0x4a8074){if('marker'!=_0x4a8074['type'])return;const _0x3c66cb=_0x2e18ec['model']['markers']['get'](_0x4a8074['name']);_0x3c66cb&&(_0x4a8074['oldRange']=_0x3c66cb['getRange']());}class q extends _0x3a5602{['_aiEditing'];['_aiConnector'];['_aiChatUi'];['_aiChatModels'];['_aiChatBalloon'];['_batchToChanges']=new Map();['_currentPreviewedChangeGroup']=null;['_bodyCollection'];static get['requires'](){return[tt,ot];}static get['pluginName'](){return'AIChatController';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){this['_bodyCollection']=new _0x340c25(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 et({'connector':this['_aiConnector'],'config':this['context']['config']['get']('ai.models'),'locale':this['context']['locale']});const _0x279fdd=this['context']['plugins']['get']('AITabs');this['listenTo'](this['_aiChatUi'],'startConversation',()=>{this['_startConversationSafely']();}),this['listenTo'](this['_aiChatUi'],'sendUserMessage',(_0x39def7,_0x3f64c6)=>{this['_handleUIUserMessage']({'userMessage':_0x3f64c6});}),this['listenTo'](_0x279fdd,'resizedTabs',(_0x504357,_0x566a70)=>{this['_setIsMaximized'](_0x566a70);}),this['listenTo'](this['_aiChatUi'],'resizeTabs',()=>{_0x279fdd['resize']();}),this['listenTo'](this['_aiChatUi'],'abortPromptStream',async()=>{await this['_stopLastInteraction'](),await this['_flushLastInteractionUI'](),this['removeSelectionFromChatContext']();}),this['listenTo'](this['_aiChatUi'],'addDocumentToContext',()=>{this['addCurrentDocumentToChatContext']();}),this['listenTo'](this['_aiChatUi'],'addFileToContext',(_0x2710bd,_0x12b161)=>{this['activeConversation']?.['addFilesToContext'](Array['from'](_0x12b161));}),this['listenTo'](this['_aiChatUi'],'addUrlToContext',(_0x4d39d3,_0x5e21dd)=>{this['activeConversation']?.['addUrlToContext'](_0x5e21dd);}),this['listenTo'](this['_aiChatUi'],'executeCustomItemCallback',(_0x24288d,_0x1f275a)=>{_0x1f275a['callback'](this['context']);}),this['listenTo'](this['_aiChatUi'],'addResourceToContext',(_0x436b49,_0x4db57d)=>{this['activeConversation']?.['addResourceToContext'](_0x4db57d['source'],_0x4db57d['resource']);}),this['listenTo'](this['_aiChatUi'],'removeContextItem',(_0x5c702e,_0x3aa427)=>{this['_removeFromContext'](_0x3aa427);}),this['listenTo'](this['_aiChatUi'],'loadSourceResources',(_0x3387bd,_0x58bc67)=>{this['activeConversation']?.['loadSourceResources'](_0x58bc67['sourceId'],_0x58bc67['query'],_0x58bc67['uid']);}),this['listenTo'](this['_aiChatUi'],'toggleWebSearch',()=>{this['_toggleWebSearch']();}),this['listenTo'](this['_aiChatUi'],'toggleReasoning',()=>{this['_toggleReasoning']();}),this['listenTo'](this['_aiChatUi'],'selectModel',(_0xb4deb4,_0x2c68bc)=>{this['activeConversation']?.['setModel'](_0x2c68bc);}),this['listenTo'](this['_aiChatUi'],'like',(_0x4ecd66,{replyId:_0x5e71b1})=>{console['log']('Liked\x20response',_0x5e71b1);}),this['listenTo'](this['_aiChatUi'],'dislike',(_0x196a9e,{replyId:_0x4cacbe})=>{console['log']('Disliked\x20response',_0x4cacbe);}),this['listenTo'](this['_aiChatUi'],'insertSuggestion',(_0x366a84,_0x3da812)=>{this['_insertSuggestion'](_0x3da812);}),this['listenTo'](this['_aiChatUi'],'showChangeInText',(_0x40408d,{replyId:_0x1a82c2,partIndex:_0x426bfe})=>{this['_aiChatBalloonShowDiff']=this['_aiChatUi']['showDiff'],this['_openBalloonFor'](_0x1a82c2,_0x426bfe);}),this['listenTo'](this['_aiChatUi'],'mouseOverSuggestion',(_0x50683c,{replyId:_0x102cc7,partIndex:_0x376a25})=>{const _0x25a3b4=this['_getDocumentRangeForReplyChanges'](_0x102cc7,_0x376a25);_0x25a3b4&&'$graveyard'!=_0x25a3b4['range']['root']['rootName']&&this['_aiEditing']['showFakeVisualSelection']([_0x25a3b4['range']],'ai-chat-controller-mouse-over');}),this['listenTo'](this['_aiChatUi'],'mouseLeaveSuggestion',()=>{this['_aiEditing']['hideFakeVisualSelection']('ai-chat-controller-mouse-over');}),this['listenTo'](this['_aiChatUi'],'applySuggestion',(_0x489309,_0x18cddc)=>{this['_aiEditing']['hideFakeVisualSelection']('ai-chat-controller-mouse-over'),this['_applySuggestion'](_0x18cddc);}),this['listenTo'](this['_aiChatUi'],'toggleSuggestionDisplayMode',async(_0x333a55,{replyId:_0x628ef7,showDiff:_0x308c2d})=>{const {reply:_0x3c02c8}=this['getInteractionAndReplyById'](_0x628ef7),_0x437590=_0x3c02c8['getContentParts']({'showDiff':_0x308c2d});await this['_aiChatUi']['updateFeedItemAIReplySuggestionContent']({'id':_0x3c02c8['id'],'parts':_0x437590,'renderingStrategy':'static'});}),this['listenTo'](this['_aiChatUi'],'rejectSuggestion',(_0xb9c478,{replyId:_0x420681,partIndex:_0x4cd19f})=>{this['_rejectSuggestion']({'replyId':_0x420681,'partIndex':_0x4cd19f}),this['_aiEditing']['hideFakeVisualSelection']('ai-chat-controller-mouse-over');}),this['context']['plugins']['has']('AIChatBalloon')&&(this['_aiChatBalloon']=this['context']['plugins']['get']('AIChatBalloon'),this['set']('_aiChatBalloonShowDiff',!0x1),this['_aiChatBalloon']['bind']('showDiff')['to'](this,'_aiChatBalloonShowDiff'),this['listenTo'](this['_aiChatBalloon'],'toggleSuggestionDisplayMode',()=>{const {replyId:_0x2bb07f,partIndex:_0x550245}=this['_currentPreviewedChangeGroup'];this['_aiChatBalloonShowDiff']=!this['_aiChatBalloonShowDiff'];const {reply:_0x9bc463}=this['getInteractionAndReplyById'](_0x2bb07f),_0x90c906=_0x9bc463['getContentParts']({'showDiff':this['_aiChatBalloonShowDiff'],'groupIndex':_0x550245});this['_aiChatBalloon']['updateContent']({'part':_0x90c906[0x0],'renderingStrategy':'static','keepErrors':!0x0});}),this['listenTo'](this['_aiChatBalloon'],'applySuggestion',()=>{const {replyId:_0x252dc1,partIndex:_0x4b2682}=this['_currentPreviewedChangeGroup'];this['_applySuggestion']({'replyId':_0x252dc1,'partIndex':_0x4b2682}),this['_aiChatBalloon']['setState']('accepted');}),this['listenTo'](this['_aiChatBalloon'],'insertSuggestion',()=>{const {replyId:_0x56481f,partIndex:_0x2f5adc}=this['_currentPreviewedChangeGroup'];this['_insertSuggestion']({'replyId':_0x56481f,'partIndex':_0x2f5adc}),this['_aiChatBalloon']['setState']('accepted');}),this['listenTo'](this['_aiChatBalloon'],'rejectSuggestion',()=>{const {replyId:_0x4c3175,partIndex:_0x1d90cb}=this['_currentPreviewedChangeGroup'];this['_rejectSuggestion']({'replyId':_0x4c3175,'partIndex':_0x1d90cb}),this['_aiChatBalloon']['setState']('rejected');}),this['listenTo'](this['_aiChatBalloon'],'showNext',()=>{const {replyId:_0x1b69f0,partIndex:_0x4aca09}=this['_currentPreviewedChangeGroup'],_0x4d43bb=this['_getPresentableSiblingContentPartIndex'](_0x1b69f0,_0x4aca09,'next');null!==_0x4d43bb&&this['_openBalloonFor'](_0x1b69f0,_0x4d43bb);}),this['listenTo'](this['_aiChatBalloon'],'showPrevious',()=>{const {replyId:_0x588f67,partIndex:_0x23b40b}=this['_currentPreviewedChangeGroup'],_0x34cbff=this['_getPresentableSiblingContentPartIndex'](_0x588f67,_0x23b40b,'previous');null!==_0x34cbff&&this['_openBalloonFor'](_0x588f67,_0x34cbff);}),this['listenTo'](this['_aiChatBalloon'],'dialogClosed',(_0x514c22,{id:_0x41ce9a})=>{if('aiChatBalloon'!==_0x41ce9a)return;const {replyId:_0x3246dc,partIndex:_0x241e65}=this['_currentPreviewedChangeGroup'];this['_currentPreviewedChangeGroup']=null,this['_aiChatUi']['setFeedItemAIReplySuggestionPartActive']({'id':_0x3246dc,'index':_0x241e65,'isActive':!0x1});}));}async['afterInit'](){this['context']instanceof _0x2cda04?this['_integrateEditor'](this['context']):this['listenTo'](this['context']['editors'],'add',(_0x278f35,_0x15e469)=>{_0x15e469['on']('ready',()=>{this['_integrateEditor'](_0x15e469);});});const _0x5da10a=this['context']['config']['get']('ai.chat.initialConversation');let _0x3a1e9b=_0x5da10a;if('lastCreated'!=_0x5da10a||(_0x3a1e9b=await this['_getLastCreatedConversationId'](),_0x3a1e9b))return'new'==_0x3a1e9b?this['_startConversationSafely']():this['loadConversation'](_0x3a1e9b);}async['destroy'](){return await this['_stopLastInteraction'](),this['_bodyCollection']['detachFromDom'](),super['destroy']();}['_insertSuggestion'](_0x5e639a){const _0x4f948a=T(this['context']);if(!_0x4f948a['plugins']['has']('TrackChanges'))throw new _0x563e6a('ai-no-track-changes',null);const _0x439fa2=this['context']['plugins']['get']('DocumentCompare'),{reply:_0x181464,interaction:_0x5f23c1}=this['getInteractionAndReplyById'](_0x5e639a['replyId']),_0x483a33=this['_getDocumentRangeForReplyChanges'](_0x5e639a['replyId'],_0x5e639a['partIndex']),_0x52ba4c=void 0x0!==_0x5e639a['partIndex']?[_0x181464['changeGroups'][_0x5e639a['partIndex']]]:_0x181464['changeGroups']['filter'](_0x22df24=>'pending'==_0x22df24['state']),_0x3f3c71=_0x52ba4c['map'](_0x2ca1f8=>_0x181464['changeGroups']['indexOf'](_0x2ca1f8));if(!_0x483a33||'$graveyard'==_0x483a33['range']['root']['rootName'])return void _0x3f3c71['forEach'](_0x24782d=>_0x181464['setChangeGroupState'](_0x24782d,'outdated'));_0x3f3c71['forEach'](_0x2434e5=>_0x181464['setChangeGroupState'](_0x2434e5,'accepted'));const _0x3f2b3d=at({'editor':_0x4f948a,'reply':_0x181464,'interaction':_0x5f23c1,'groups':_0x52ba4c,'transform':!0x0,'documentCompare':_0x439fa2,'documentCompareOptions':{'anchor':'main','markDeletions':!0x0}});let _0x438df4;_0x483a33&&this['_scrollToSuggestionRange'](_0x483a33['range']),_0x4f948a['model']['change'](_0x1fa269=>{_0x438df4=_0x1fa269['batch'],_0x4f948a['plugins']['get']('TrackChangesEditing')['_applyOperationsAsSuggestions'](_0x3f2b3d),this['_aiEditing']['hideFakeVisualSelection']('ai-chat-controller-mouse-over');}),this['_batchToChanges']['set'](_0x438df4,{'interactionId':_0x5f23c1['id'],'replyId':_0x181464['id'],'indexes':_0x3f3c71['slice']()}),this['_updateRatings'](_0x181464);}['_applySuggestion'](_0x4f0063){const _0x475d96=T(this['context']),_0x5eb99e=this['context']['plugins']['get'](ot),{reply:_0x311600,interaction:_0x4fc0c8}=this['getInteractionAndReplyById'](_0x4f0063['replyId']),_0x4007de=this['_getDocumentRangeForReplyChanges'](_0x4f0063['replyId'],_0x4f0063['partIndex']),_0x487da8=void 0x0!==_0x4f0063['partIndex']?[_0x311600['changeGroups'][_0x4f0063['partIndex']]]:_0x311600['changeGroups']['filter'](_0x1253ee=>'pending'==_0x1253ee['state']),_0x33c4ba=_0x487da8['map'](_0x956c53=>_0x311600['changeGroups']['indexOf'](_0x956c53));if(!_0x4007de||'$graveyard'==_0x4007de['range']['root']['rootName'])return void _0x33c4ba['forEach'](_0x589c3a=>_0x311600['setChangeGroupState'](_0x589c3a,'outdated'));_0x33c4ba['forEach'](_0x2af0bf=>_0x311600['setChangeGroupState'](_0x2af0bf,'accepted'));const _0xbc28e2=at({'editor':_0x475d96,'reply':_0x311600,'interaction':_0x4fc0c8,'groups':_0x487da8,'transform':!0x0,'documentCompare':_0x5eb99e,'documentCompareOptions':{'anchor':'main','markDeletions':!0x1}});let _0x5f1fe2;_0x4007de&&this['_scrollToSuggestionRange'](_0x4007de['range']),_0x475d96['model']['change'](_0x2d7ba3=>{_0x5f1fe2=_0x2d7ba3['batch'];for(const _0x4e7766 of _0xbc28e2)_0x4e7766['baseVersion']=_0x475d96['model']['document']['version'],rt(_0x475d96,_0x4e7766),_0x2d7ba3['batch']['addOperation'](_0x4e7766),_0x475d96['model']['applyOperation'](_0x4e7766);}),this['_batchToChanges']['set'](_0x5f1fe2,{'interactionId':_0x4fc0c8['id'],'replyId':_0x311600['id'],'indexes':_0x33c4ba['slice']()}),this['_updateRatings'](_0x311600);}['_rejectSuggestion'](_0x1f89be){const {reply:_0x32779a}=this['getInteractionAndReplyById'](_0x1f89be['replyId']);_0x32779a['setChangeGroupState'](_0x1f89be['partIndex'],'rejected');}['_openBalloonFor'](_0x5110a6,_0x16e789){if(!this['_aiChatBalloon'])return;const {reply:_0x2f1eda}=this['getInteractionAndReplyById'](_0x5110a6),_0x6b2e7f=_0x2f1eda['getContentParts']({'showDiff':this['_aiChatBalloonShowDiff']});let _0x252347,_0x1d7ea7;if(void 0x0!==_0x16e789?(_0x1d7ea7=_0x6b2e7f['find'](_0x44b65e=>_0x44b65e['index']==_0x16e789),_0x252347=_0x1d7ea7?.['index']):(_0x1d7ea7=_0x6b2e7f[0x0],_0x252347=_0x1d7ea7['index']),this['_currentPreviewedChangeGroup']?.['replyId']==_0x5110a6&&this['_currentPreviewedChangeGroup']?.['partIndex']==_0x252347)return;const _0x372673=this['_getUserPresentableContentPartDocumentRange'](_0x5110a6,_0x2f1eda,_0x1d7ea7);if(!_0x372673)return void this['_aiChatBalloon']['close']();this['_currentPreviewedChangeGroup']={'replyId':_0x5110a6,'partIndex':_0x252347},this['_scrollToSuggestionRange'](_0x372673,!0x0);const _0x28a40d=this['_getPresentableSiblingContentPartIndex'](_0x5110a6,_0x252347,'next');this['_aiChatBalloon']['updateContent']({'part':_0x1d7ea7,'renderingStrategy':'static'}),this['_aiChatBalloon']['open']({'index':_0x252347,'title':i(this['context']['locale'],'AI_BALLOON_HEADER_TITLE',(_0x252347+0x1)['toString']()),'showRotator':null!==_0x28a40d,'ranges':[_0x372673],'areActionsDisabled':_0x2f1eda['areActionsDisabled']}),this['_aiChatBalloon']['setState']('pending'),this['_aiChatUi']['scrollFeedToSuggestion'](_0x5110a6,_0x252347),this['_aiChatUi']['setFeedItemAIReplySuggestionPartActive']({'id':_0x5110a6,'index':_0x252347,'isActive':!0x0});}['_getPresentableSiblingContentPartIndex'](_0x34935d,_0x59e971,_0x49f0ef){const {reply:_0x116af7}=this['getInteractionAndReplyById'](_0x34935d),_0x487941=_0x116af7['getContentParts']({'showDiff':this['_aiChatBalloonShowDiff']});if(0x1==_0x487941['length'])return null;const _0x28ad06=_0x487941['findIndex'](_0x1b2173=>_0x1b2173['index']==_0x59e971),_0x24bed0='next'==_0x49f0ef?0x1:-0x1;let _0xc17fef=_0x487941['at']((_0x28ad06+_0x24bed0)%_0x487941['length'])['index'],_0x5981aa=_0x487941[_0xc17fef];for(;!this['_getUserPresentableContentPartDocumentRange'](_0x34935d,_0x116af7,_0x5981aa);){if(_0xc17fef=_0x487941['at']((_0xc17fef+_0x24bed0)%_0x487941['length'])['index'],_0xc17fef===_0x28ad06)return null;_0x5981aa=_0x487941[_0xc17fef];}return _0xc17fef;}['_getUserPresentableContentPartDocumentRange'](_0x5e28c4,_0x557d52,_0x453398){const _0x1f0775=_0x557d52['changeGroups'];if(!_0x453398['hasChanges'])return null;const _0x3bf5df=_0x1f0775['find'](_0x1eaad1=>_0x1eaad1['index']==_0x453398['index']);if('pending'!==_0x3bf5df?.['state'])return null;const _0x36e069=this['_getDocumentRangeForReplyChanges'](_0x5e28c4,_0x453398['index']);if(!_0x36e069)return null;const {range:_0x49e3ea,currentIndex:_0x2d97c0}=_0x36e069;return'$graveyard'==_0x49e3ea['root']['rootName']?(_0x557d52['setChangeGroupState'](_0x2d97c0,'outdated'),null):_0x36e069['range'];}['_getDocumentRangeForReplyChanges'](_0xa0a9f7,_0x5cebf7){const _0x27cb32=T(this['context']),{reply:_0x589cfc,interaction:_0x6340d4}=this['getInteractionAndReplyById'](_0xa0a9f7),_0xb6879=_0x589cfc['changeGroups']['filter'](_0x1ce31f=>'pending'==_0x1ce31f['state']),_0x5ee2d5=_0xb6879['map'](_0x2cf728=>_0x589cfc['changeGroups']['indexOf'](_0x2cf728));void 0x0===_0x5cebf7&&(_0x5cebf7=_0x5ee2d5[0x0]);const _0x155a9f=_0x5ee2d5['indexOf'](_0x5cebf7);if(-0x1==_0x155a9f)return null;const _0x1099cc=_0xb6879[_0x155a9f],_0x1a9406=new _t([]),_0x29bad3=new _t([]);for(const _0x49985b of _0x1099cc['changes'])if('removed'!=_0x49985b['type']&&_0x29bad3['children']['push'](_0x49985b['node']['cloneNode'](!0x0)),'new'!=_0x49985b['type']){const _0x4f5b1b=gt(_0x28c31c=>ut(_0x28c31c,'data-id')==_0x49985b['id'],_0x589cfc['documentContextContent'],!0x0);_0x1a9406['children']['push'](_0x4f5b1b['cloneNode'](!0x0));}if(0x0==_0x1a9406['children']['length']){if(_0x1099cc['changes'][0x0]['anchorId']){const _0x2eeeea=It('data-id',_0x1099cc['changes'][0x0]['anchorId'],_0x589cfc['documentContextContent']);_0x1a9406['children']['unshift'](_0x2eeeea['cloneNode'](!0x0)),_0x29bad3['children']['unshift'](_0x2eeeea['cloneNode'](!0x0)),_0x2eeeea['nextSibling']&&(_0x1a9406['children']['push'](_0x2eeeea['nextSibling']['cloneNode'](!0x0)),_0x29bad3['children']['push'](_0x2eeeea['nextSibling']['cloneNode'](!0x0)));}else{const _0x1975f1=_0x589cfc['documentContextContent']['children'][0x0];if(!_0x1975f1)return null;_0x1a9406['children']['push'](_0x1975f1['cloneNode'](!0x0)),_0x29bad3['children']['push'](_0x1975f1['cloneNode'](!0x0));}}const _0x1c25c2=_0x6340d4['getDocumentContext'](),_0x58bc47=_0x27cb32['data']['parse'](_0x1c25c2['content']),_0x4a1a6e=pt(_0x1a9406),_0x35cef7=_0x27cb32['data']['parse'](_0x4a1a6e),_0x509320=_0x27cb32['data']['parse'](_0x4a1a6e),_0x1811f1=_0x27cb32['model']['createPositionAt'](_0x35cef7,0x0),_0x3a549a=pt(_0x29bad3),_0x519fdc={'anchor':_0x1811f1,'markDeletions':!0x1},_0x5d3bcf=_0x27cb32['plugins']['get'](ot)['getDiff'](_0x4a1a6e,_0x3a549a,_0x519fdc)['getOperations']();if(!_0x5d3bcf['length'])return null;_0x27cb32['model']['change'](_0x4683e3=>{for(const _0x31967a of _0x5d3bcf)if('remove'==_0x31967a['type']){const _0x12eb0a=_0x31967a['sourcePosition'],_0x12d0df=_0x31967a['howMany'],_0x469b3a=new lt(_0x12eb0a,_0x12d0df);_0x4683e3['batch']['addOperation'](_0x469b3a),_0x27cb32['model']['applyOperation'](_0x469b3a);}else'marker'!==_0x31967a['type']&&(_0x31967a['baseVersion']=null,_0x31967a['isDocumentOperation']=!0x1,_0x4683e3['batch']['addOperation'](_0x31967a),_0x27cb32['model']['applyOperation'](_0x31967a));});const _0x40f03d=ct(_0x27cb32,_0x5d3bcf,_0x35cef7);ht(_0x27cb32['model'],_0x40f03d);const _0x38aaa9=_0x40f03d['getFirstRange']()['start']['path']['slice'](),_0x3fa282=_0x40f03d['getFirstRange']()['end']['path']['slice'](),_0x1db5ba=[];let _0x15a404=_0x35cef7,_0x4297b0=_0x509320;for(let _0x27e2f5=0x0;_0x27e2f5<_0x3fa282['length'];_0x27e2f5++){const _0x377f7f=_0x15a404['maxOffset']-_0x3fa282[_0x27e2f5];_0x1db5ba[_0x27e2f5]=_0x4297b0['maxOffset']-_0x377f7f,_0x15a404=_0x15a404['getChildAtOffset'](_0x3fa282[_0x27e2f5]),_0x4297b0=_0x4297b0['getChildAtOffset'](_0x1db5ba[_0x27e2f5]);}const _0x1ffe30=_0x27cb32['model']['createRange'](_0x27cb32['model']['createPositionFromPath'](_0x509320,_0x38aaa9),_0x27cb32['model']['createPositionFromPath'](_0x509320,_0x1db5ba)),_0xed6af2=_0x509320['getChild'](0x0)['getAttribute'](nt),_0x20f740=Array['from'](_0x58bc47['getChildren']())['find'](_0x472a0d=>_0x472a0d['getAttribute'](nt)==_0xed6af2)['getPath'](),_0x516db7=_0x1ffe30['start']['path']['slice'](),_0x543564=_0x1ffe30['end']['path']['slice']();_0x516db7[0x0]=_0x20f740[0x0]+_0x516db7[0x0],_0x543564[0x0]=_0x20f740[0x0]+_0x543564[0x0];let _0x1aaeb0=_0x27cb32['model']['createRange'](_0x27cb32['model']['createPositionFromPath'](_0x27cb32['model']['document']['getRoot'](),_0x516db7),_0x27cb32['model']['createPositionFromPath'](_0x27cb32['model']['document']['getRoot'](),_0x543564));const _0x49b4c8=_0x27cb32['model']['document']['history']['getOperations'](_0x1c25c2['version']);for(const _0x390556 of _0x49b4c8)_0x1aaeb0=dt['_createFromRanges'](_0x1aaeb0['getTransformedByOperation'](_0x390556));return{'range':_0x1aaeb0,'currentIndex':_0x5cebf7};}['_integrateEditor'](_0x484849){if(!_0x484849['plugins']['has']('Undo'))return;const _0x5ee927=_0x484849['commands']['get']('undo'),_0x1331a3=_0x484849['commands']['get']('redo');this['listenTo'](_0x5ee927,'revert',(_0x540ac4,_0x4ed3c2,_0x1810b9)=>{const _0x59b1e4=this['_batchToChanges']['get'](_0x4ed3c2);if(!_0x59b1e4)return;const _0xf25f5=this['activeConversation']['getInteraction'](_0x59b1e4['interactionId'])['getReply'](_0x59b1e4['replyId']);_0x59b1e4['indexes']['forEach'](_0x1e77ab=>_0xf25f5['setChangeGroupState'](_0x1e77ab,'pending')),this['_batchToChanges']['delete'](_0x4ed3c2),this['_batchToChanges']['set'](_0x1810b9,_0x59b1e4);}),this['listenTo'](_0x1331a3,'revert',(_0x31e433,_0x5836c8,_0x377981)=>{const _0x597315=this['_batchToChanges']['get'](_0x5836c8);if(!_0x597315)return;const _0x5ddaf1=this['activeConversation']['getInteraction'](_0x597315['interactionId'])['getReply'](_0x597315['replyId']);_0x597315['indexes']['forEach'](_0x46e305=>_0x5ddaf1['setChangeGroupState'](_0x46e305,'accepted')),this['_batchToChanges']['delete'](_0x5836c8),this['_batchToChanges']['set'](_0x377981,_0x597315);});}async['loadConversation'](_0x32727d){this['context']['plugins']['has']('AIChatBalloon')&&this['context']['plugins']['get']('AIChatBalloon')['close'](),(this['context']['plugins']['get'](it)['view']['activateTab']('chat'),this['_aiChatUi']['setFeedItemRenderingStrategy']('static'),this['_aiChatUi']['toggleLoadingSkeleton'](!0x0),await this['_stopLastInteraction']());try{await this['_aiConnector']['fetchConversation'](_0x32727d)['getConversation'](),await this['_startConversationSafely'](_0x32727d),this['updateConversationTitle']('\x20'),await this['activeConversation']['load'](_0x32727d,this['_aiEditing']['sessionId']),this['activeConversation']['isCurrentDocumentInConversation']()&&this['addCurrentDocumentToChatContext']();}catch(_0x56fc17){this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_UNABLE_TO_LOAD_CONVERSATION'),'id':_0x32727d}),this['_logError'](new _0x563e6a('ai-chat-conversation-not-found',this,{'error':_0x56fc17}));}finally{this['_aiChatUi']['startAutoScroll'](),this['_aiChatUi']['setFeedItemRenderingStrategy']('streaming'),this['_aiChatUi']['toggleLoadingSkeleton'](!0x1);}}async['_getLastCreatedConversationId'](){const _0xfd29d0=this['_aiConnector']['fetchConversations'](this['getGroupId'](),{'limit':0x1,'sortBy':'createdAt'});try{const _0x5474c2=await _0xfd29d0['getConversations']();return _0x5474c2['length']?_0x5474c2[0x0]['id']:'new';}catch(_0x33aa4b){return this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_UNABLE_TO_LOAD_CONVERSATION'),'id':_0x48eb5e()}),this['_logError'](new _0x563e6a('ai-chat-conversation-init-failed',this,{'error':_0x33aa4b})),this['_aiChatUi']['toggleLoadingSkeleton'](!0x1),this['_aiChatUi']['disableControls'](),null;}}['handleRemovedConversation'](_0x4f167f){this['activeConversation']['id']===_0x4f167f&&this['_startConversationSafely']();}['addCurrentDocumentToChatContext'](){this['activeConversation']?.['addCurrentDocumentToContext'](i(this['context']['locale'],'AI_CHAT_CONTEXT_CURRENT_DOCUMENT'));}async['addSelectionToChatContext'](){const _0x519943=this['_aiEditing']['getSelectionText']();this['activeConversation']?.['addSelectionToContext'](_0x519943),this['addCurrentDocumentToChatContext']();}['removeSelectionFromChatContext'](){this['activeConversation']?.['removeSelectionFromContext']();}['focusPromptInput'](){this['_aiChatUi']['focusPromptInput']();}async['startConversation'](){await this['_startConversationSafely']();}async['sendMessage']({message:_0x1ed3c8,attributes:_0x37e7e1}){await this['_handleUIUserMessage']({'userMessage':_0x1ed3c8,'attributes':_0x37e7e1});}['getGroupId'](){const _0x3823b9=this['context']['config']['get']('collaboration.channelId');if(!_0x3823b9)throw new _0x563e6a('ai-chat-missing-channel-id',this);return _0x3823b9;}async['_startConversationSafely'](_0x56a56d){try{this['_aiChatUi']['enableControls'](),await this['_handleStartConversation'](_0x56a56d);}catch(_0x2ce40e){this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_UNABLE_TO_START_CONVERSATION'),'id':_0x56a56d||_0x48eb5e()}),console['error'](_0x2ce40e),this['activeConversation']=void 0x0,this['_aiChatUi']['disableControls']();}}async['_handleStartConversation'](_0xff69b7){let _0xd6993a;this['context']['plugins']['has']('AIChatBalloon')&&this['context']['plugins']['get']('AIChatBalloon')['close'](),_0xff69b7||!this['activeConversation']?_0xd6993a=this['context']['config']['get']('ai.models.defaultModelId'):this['_aiChatUi']['isModelAvailable']&&(_0xd6993a=this['activeConversation']['selectedModel']['id']),await this['_stopLastInteraction']();const _0x42711f=this['getGroupId'](),_0x17e846=_0xff69b7||_0x48eb5e();this['activeConversation']=new st({'connector':this['_aiConnector'],'chatModels':this['_aiChatModels'],'selectedModelId':_0xd6993a,'conversationId':_0x17e846,'group':_0x42711f,'getEditor':()=>T(this['context']),'isFromHistory':!!_0xff69b7}),this['activeConversation']['delegate']('toolDataReceived','interactionStarted')['to'](this),this['activeConversation']['on']('conversationInitialized',(_0x13ce60,_0x5f1613)=>{this['_aiChatUi']['createConversation'](_0x5f1613),this['_aiChatUi']['resetMessageInput'](),this['_aiChatUi']['clearPendingContextUI'](),this['_aiChatUi']['clearConversationContextUI'](),_0xff69b7||(this['_aiChatUi']['resetConversationTitle'](),this['addCurrentDocumentToChatContext']());}),this['activeConversation']['on']('uploadProgressChanged',(_0x5c0a44,_0x173307)=>{this['_aiChatUi']['setIsUploadInProgress'](_0x173307['isUploadInProgress']);}),this['activeConversation']['on']('interactionCreated',(_0x580d09,_0x4c6063)=>{this['_aiChatUi']['addFeedItemUserMessage'](_0x4c6063);}),this['activeConversation']['on']('webSearchStarted',()=>{const _0x89d751=this['_aiChatUi']['prepareLoadingMessage']({'isWebSearchEnabled':!0x0,'isReasoningEnabled':!0x1});this['_aiChatUi']['setLoadingMessage'](_0x89d751);}),this['activeConversation']['on']('reasoningStarted',()=>{const _0x3392f3=this['_aiChatUi']['prepareLoadingMessage']({'isWebSearchEnabled':!0x1,'isReasoningEnabled':!0x0});this['_aiChatUi']['setLoadingMessage'](_0x3392f3);}),this['activeConversation']['on']('webSearchFinished',(_0x13aed5,_0x3028be)=>{this['_aiChatUi']['addFeedInteractionHeader'](_0x3028be,{'isWebSearchEnabled':!0x0,'isReasoningEnabled':!0x1});}),this['activeConversation']['on']('reasoningFinished',(_0x3d5cb6,_0x4aa2f5)=>{this['_aiChatUi']['addFeedInteractionHeader'](_0x4aa2f5,{'isWebSearchEnabled':!0x1,'isReasoningEnabled':!0x0});}),this['activeConversation']['on']('interactionStarted',()=>{this['_aiChatUi']['startInteraction']();}),this['activeConversation']['on']('interactionFinished',async()=>{await this['_aiChatUi']['finishInteraction']();}),this['activeConversation']['on']('interactionDestroyed',(_0x3b069c,_0x204ddf)=>{this['_aiChatUi']['removeFeedInteraction'](_0x204ddf['id']);}),this['activeConversation']['on']('setConversationTitle',(_0x10ebd2,_0x46c734,_0x2164fd)=>{this['updateConversationTitle'](_0x46c734,_0x2164fd);}),this['activeConversation']['on']('replyCreated',(_0x352ab5,_0x5b4041)=>{'text'===_0x5b4041['type']?this['_aiChatUi']['addFeedItemAIReply'](_0x5b4041):this['_aiChatUi']['addFeedItemAISuggestion'](_0x5b4041);}),this['activeConversation']['on']('replyContentUpdated',async(_0x352b6f,_0x48e6ed)=>{await this['_updateReplyContent']({'reply':_0x48e6ed});}),this['activeConversation']['on']('replyChangeGroupStateUpdated',(_0x75ca05,{reply:_0x3c83bb,index:_0x35fb10,state:_0x4cb069})=>{this['_aiChatUi']['updateFeedItemAIReplySuggestionPartState']({'id':_0x3c83bb['id'],'index':_0x35fb10,'state':_0x4cb069}),this['_currentPreviewedChangeGroup']?.['replyId']['includes'](_0x3c83bb['id'])&&this['_currentPreviewedChangeGroup']?.['partIndex']==_0x35fb10&&this['_aiChatBalloon']?.['setState'](_0x4cb069);}),this['activeConversation']['on']('contextItemAdded',(_0x39933e,_0x5ee7e4)=>{if(this['_aiChatUi']['addContextItem'](_0x5ee7e4['contextItem'],_0x5ee7e4['isLoading']),'selection'===_0x5ee7e4['contextItem']['type']){const _0x55ac12=[...T(this['context'])['model']['document']['selection']['getRanges']()];this['_aiEditing']['showFakeVisualSelection'](_0x55ac12,'ai-conversation-'+this['activeConversation']?.['id']);}}),this['activeConversation']['on']('contextItemRemoved',(_0x128776,_0x413139)=>{this['_aiChatUi']['removeContextItem'](_0x413139['uiId']),'current-document'==_0x413139['uiId']&&this['removeSelectionFromChatContext'](),'selection'===_0x413139['type']&&this['_aiEditing']['hideFakeVisualSelection']('ai-conversation-'+this['activeConversation']?.['id']);}),this['activeConversation']['on']('contextItemLoadingEnded',(_0x2dc53c,_0x1bd9ee)=>{this['_aiChatUi']['setContextItemLoading'](_0x1bd9ee['contextItem']['uiId'],_0x1bd9ee['isLoading']);}),this['activeConversation']['on']('contextSent',(_0x374c97,_0x4dd0c8)=>{this['_aiChatUi']['setConversationContext'](_0x4dd0c8['contextItems']);}),this['activeConversation']['on']('addContextOptionsChanged',(_0x3ab97d,_0x514211)=>{this['_aiChatUi']['setAddContextOptions'](_0x514211['options']);}),this['activeConversation']['on']('sourceResourcesLoaded',(_0x4adac0,_0x1838cb)=>{this['_aiChatUi']['populateSourceResourceBalloon'](_0x1838cb['sourceId'],_0x1838cb['source'],_0x1838cb['resources'],_0x1838cb['uid']);}),this['activeConversation']['on']('resourceStateChanged',(_0x4cb160,_0x178fd3)=>{this['_aiChatUi']['updateResourceState'](_0x178fd3['sourceId'],_0x178fd3['resourceId'],_0x178fd3['isInContext']);}),this['activeConversation']['on']('capabilitiesUpdated',(_0x344661,_0x4b9654)=>{this['_aiChatUi']['updateCapabilities'](_0x4b9654);}),this['activeConversation']['on']('modelSelected',async(_0x4524dc,_0x16e8ad)=>{const _0x2e68aa=(await this['_aiChatModels']['getAll']())['find'](_0x299d7c=>_0x299d7c['id']===_0x16e8ad['selectedModel']?.['id'])||null;this['_aiChatUi']['setSelectedModel'](_0x2e68aa,_0x16e8ad['isDisabled']);}),this['activeConversation']['on']('error',(_0x3794b2,{error:_0x361988,interactionId:_0x56e57c,fileName:_0x7eefd5,url:_0x463ead,sourceId:_0x44260d,sourceLabel:_0xe108ce})=>{const _0x32339d=_0x56e57c?_0x56e57c+':'+_0x48eb5e():_0x48eb5e();_0x361988['message']['startsWith']('ai-request-aborted')?this['_aiChatUi']['addFeedItemStaticMessage']({'staticMessage':i(this['context']['locale'],'AI_CHAT_ABORTED_MESSAGE'),'id':_0x32339d}):_0x361988['message']['startsWith']('ai-chat-conversation-init-failed')||_0x361988['message']['startsWith']('ai-chat-conversation-start-failed')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_UNABLE_TO_START_CONVERSATION'),'id':_0x32339d}),this['_logError'](_0x361988)):_0x361988['message']['startsWith']('ai-chat-file-upload-failed')?this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_FILE',_0x7eefd5),'id':_0x32339d}):_0x361988['message']['startsWith']('ai-chat-url-upload-failed')?this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_URL',_0x463ead),'id':_0x32339d}):_0x361988['message']['startsWith']('ai-chat-context-invalid-data')?this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_CONTEXT_INVALID_DATA'),'id':_0x32339d}):_0x361988['message']['startsWith']('ai-chat-context-unsupported-type')?this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_CONTEXT_UNSUPPORTED_TYPE'),'id':_0x32339d}):_0x361988['message']['startsWith']('ai-chat-source-resources-load-failed')?(_0x44260d&&this['_aiChatUi']['closeSourceResourceBalloon'](_0x44260d),this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_LOAD_RESOURCES',_0xe108ce||'source'),'id':_0x32339d}),this['_logError'](_0x361988)):_0x361988['message']['startsWith']('ai-chat-resource-load-failed')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_RESOURCE_LOAD_FAILED'),'id':_0x32339d}),this['_logError'](_0x361988)):_0x361988['message']['startsWith']('ai-chat-invalid-request')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_INVALID_REQUEST'),'id':_0x32339d}),this['_logError'](_0x361988)):_0x361988['message']['startsWith']('ai-chat-context-unsupported-file-type')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_CONTEXT_UNSUPPORTED_FILE_TYPE'),'id':_0x32339d}),this['_logError'](_0x361988)):_0x361988['message']['startsWith']('ai-chat-context-file-too-large')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_CONTEXT_FILE_TOO_LARGE'),'id':_0x32339d}),this['_logError'](_0x361988)):_0x361988['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':_0x32339d}),this['_logError'](_0x361988)):_0x361988['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':_0x32339d}),this['_logError'](_0x361988)):(this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_GENERIC_ERROR'),'id':_0x32339d}),this['_logError'](_0x361988));}),await this['activeConversation']['init'](this['context']['config']['get']('ai.chat.context')),_0xff69b7||await this['activeConversation']['start']();}async['_handleUIUserMessage']({userMessage:_0x2fa790,attributes:_0x1ccb7b}){if(!this['activeConversation'])throw new _0x563e6a('ai-chat-controller-no-active-conversation');if(this['activeConversation']['isCurrentDocumentInContext']()){const _0x314245=await this['_aiEditing']['getDocumentData']();await this['activeConversation']['updateCurrentDocumentInContext'](_0x314245);}this['activeConversation']['id']&&this['activeConversation']['isStarted']&&await this['activeConversation']['handleUserInteraction']({'userMessage':_0x2fa790,'attributes':_0x1ccb7b});}['_showConversationHistory'](){console['log']('Showing\x20conversation\x20history...');}['_setIsMaximized'](_0x270615){this['_aiChatUi']['setIsMaximized'](_0x270615);}['_logError'](_0x529f62){_0x4e5dbd(_0x529f62['message']);}['_removeFromContext'](_0x2df217){this['activeConversation']?.['removeFromContext'](_0x2df217);}['_toggleWebSearch'](){this['activeConversation']?.['toggleWebSearch']();}['_toggleReasoning'](){this['activeConversation']?.['toggleReasoning']();}['getInteractionAndReplyById'](_0x10cff1){const [_0x560eee,_0x2c96ee]=_0x10cff1['split'](':'),_0x4588d3=this['activeConversation']['getInteraction'](_0x560eee),_0x2ff4b6=_0x4588d3['getReply'](_0x2c96ee);return{'interaction':_0x4588d3,'reply':_0x2ff4b6};}['_scrollToSuggestionRange'](_0x20ded6,_0x19b501=!0x1){const _0x495768=T(this['context']),_0x17cea5={'target':_0x495768['editing']['view']['domConverter']['viewRangeToDom'](_0x495768['editing']['mapper']['toViewRange'](_0x20ded6)),'viewportOffset':{'top':0x96,'left':0x0,'bottom':0x32,'right':0x0},'ancestorOffset':0x14,'alignToTop':_0x19b501};_0x19b501&&(_0x17cea5['alignToTop']=!0x0),_0x1fa956(_0x17cea5);}['updateConversationTitle'](_0x2d4e19,_0x41bcaa=!0x1){this['_aiChatUi']['setConversationTitle'](_0x2d4e19||i(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION'),_0x41bcaa);}async['_updateReplyContent']({reply:_0x3c2ded,renderingStrategy:_0x3ecd08}){const {id:_0x1a7a73,interactionId:_0x300cc2,isDone:_0x2e39ab,type:_0x1bf26f,parsedContent:_0x512af7}=_0x3c2ded,_0x10e0ae=_0x300cc2+':'+_0x1a7a73;if('modification'===_0x1bf26f){const _0x586853=_0x3c2ded['getContentParts']({'showDiff':this['_aiChatUi']['showDiff']});await this['_aiChatUi']['updateFeedItemAIReplySuggestionContent']({'id':_0x10e0ae,'parts':_0x586853,'renderingStrategy':_0x3ecd08,'isDone':_0x2e39ab});}else'text'===_0x1bf26f&&await this['_aiChatUi']['updateFeedItemAIReplyContent']({'id':_0x10e0ae,'parsedContent':_0x512af7,'renderingStrategy':_0x3ecd08,'isDone':_0x2e39ab});_0x2e39ab&&_0x3c2ded['sources']['length']>0x0&&this['_aiChatUi']['updateFeedItemAIReplySources'](_0x10e0ae,_0x3c2ded['sources']);}async['_stopLastInteraction'](){const _0x245da9=this['activeConversation']?.['lastInteraction'];_0x245da9&&(_0x245da9['stop'](),this['_aiChatUi']['stopInteraction'](_0x245da9));}async['_flushLastInteractionUI'](){const _0x18eac0=this['activeConversation']?.['lastInteraction'];if(_0x18eac0){for await(const _0x13bfef of _0x18eac0['replies'])await this['_updateReplyContent']({'reply':_0x13bfef,'renderingStrategy':'static'});}}['_updateRatings'](_0x3466eb){const _0x238c62={'positiveCount':_0x3466eb['changeGroups']['filter'](_0x204cb7=>'accepted'===_0x204cb7['state'])['length'],'totalCount':_0x3466eb['changeGroups']['length'],'modificationId':_0x3466eb['id']},_0x1b6673=this['activeConversation']['getInteraction'](_0x3466eb['interactionId'])['messageId'];_0x1b6673&&this['_aiConnector']['upsertAIChatRating'](this['activeConversation']['id'],_0x1b6673,_0x238c62);}['_registerToolDataCallback'](_0x2fce02){let _0x48dc28=null,_0x10de4d=null;this['on']('toolDataReceived',(_0x15e6c2,_0x473469,_0x3393b3)=>{_0x3393b3['id']!==_0x48dc28&&(_0x48dc28=_0x3393b3['id'],_0x10de4d=this['_getAIChatInteractionAPI'](_0x3393b3)),_0x2fce02(_0x473469,_0x10de4d);});}['_getAIChatInteractionAPI'](_0xb12623){const _0x19ab61=this['_aiChatUi'],_0x174f8d=()=>{_0xb12623['resetWebSearchState'](),_0xb12623['resetReasoningState'](),_0x19ab61['clearLoadingMessage']();},_0x1b0cec=()=>{_0xb12623['currentReply']&&(_0xb12623['currentReply']['done'](),_0xb12623['currentReply']=void 0x0);};return{'insertTextReply':(_0x120107,_0x1e30e7)=>{_0x1b0cec(),_0x174f8d();const _0x443bfc=_0xb12623['currentReply']=_0xb12623['createReply']({'type':'text','interactionId':_0xb12623['id'],'content':_0x120107,'id':_0x1e30e7||_0x48eb5e()});return _0x1b0cec(),_0x443bfc;},'insertCustomElement':async(_0x1bf2eb,_0x215d9e)=>(_0x1b0cec(),_0x174f8d(),_0x19ab61['addFeedItemCustomElement'](_0x1bf2eb,_0x215d9e||_0x48eb5e())),'setLoadingMessage':_0x407166=>{_0x19ab61['setLoadingMessage'](_0x407166);},'clearLoadingMessage':()=>{_0x19ab61['clearLoadingMessage']();}};}}const R='ai-selection';class D extends _0x3a5602{constructor(_0x5518bd){super(_0x5518bd),this['context']['config']['define']('ai.models.showModelSelector',!0x0);}['_outputDataProcessor'];['_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 _0x4386b6=T(this['context']),_0xcd5335=_0x4386b6['plugins']['has']('RealTimeCollaborationClient')&&_0x4386b6['plugins']['get']('RealTimeCollaborationClient')['sessionId'];this['_sessionId']=_0xcd5335||_0x48eb5e();}return this['_sessionId'];}async['getDocumentData'](){const _0xb5b1d5=T(this['context']),_0x323777=_0xb5b1d5['model'],_0x33df85=_0xb5b1d5['data']['toView'](_0x323777['document']['getRoot'](),{'convertAiChatSelectionMarker':!0x0}),_0x3d3827=new Dt(_0xb5b1d5['editing']['view']['document']);this['_setDataIdsOnChildren'](_0x33df85,_0x3d3827);let _0x4a2161=await this['_getDocumentDataStringFromView'](_0x33df85);const _0x4596ce=this['_getMarkersInDocumentOrder'](),_0x1cf69b=[];for(const _0x5697f8 of _0x4596ce){const _0x52937b='<'+_0x5697f8['name']+':start></'+_0x5697f8['name']+':start>',_0xd207e3=_0x4a2161['indexOf'](_0x52937b);_0x4a2161=_0x4a2161['substring'](0x0,_0xd207e3)+_0x4a2161['substring'](_0xd207e3+_0x52937b['length']);const _0x15e452='<'+_0x5697f8['name']+':end></'+_0x5697f8['name']+':end>',_0x4e071a=_0x4a2161['indexOf'](_0x15e452);_0x4a2161=_0x4a2161['substring'](0x0,_0x4e071a)+_0x4a2161['substring'](_0x4e071a+_0x15e452['length']),_0x1cf69b['push']({'markerName':_0x5697f8['name'],'start':_0xd207e3,'end':_0x4e071a,'htmlFragment':_0x4a2161['substring'](_0xd207e3,_0x4e071a)});}return{'content':_0x4a2161,'version':_0xb5b1d5['model']['document']['version'],'sessionId':this['sessionId'],'selections':_0x1cf69b};}async['afterInit'](){this['context']instanceof _0x2cda04?this['_integrateEditor'](this['context']):this['listenTo'](this['context']['editors'],'add',(_0x5cbf86,_0x330b36)=>{_0x330b36['on']('ready',()=>{this['_integrateEditor'](_0x330b36);});});}['_setOutputDataProcessor'](_0x2bae05){this['_outputDataProcessor']=_0x2bae05;}async['_getDocumentDataStringFromView'](_0x48133d){let _0x2e66cb;const _0x25e0eb=T(this['context']);if(this['_outputDataProcessor']){const _0x3f715d=_0x25e0eb['data']['processor']['domConverter']['viewToDom'](_0x48133d),_0x4bc2dc=await this['_outputDataProcessor'](_0x3f715d);_0x2e66cb=_0x25e0eb['data']['processor']['htmlWriter']['getHtml'](_0x4bc2dc);}else _0x2e66cb=_0x25e0eb['data']['processor']['toData'](_0x48133d);return _0x2e66cb;}['_integrateEditor'](_0x49d0d8){_0x49d0d8['conversion']['for']('editingDowncast')['markerToHighlight']({'model':R,'view':{'classes':['ck-fake-ai-selection','ck-ai-assistant-ui_theme'],'priority':0xc}}),_0x49d0d8['conversion']['for']('dataDowncast')['markerToElement']({'model':R,'view':(_0x22664b,{writer:_0x28ab47,options:_0x100988})=>_0x100988['convertAiChatSelectionMarker']?_0x28ab47['createUIElement'](_0x22664b['markerName']+':'+(_0x22664b['isOpening']?'start':'end')):null});}['showFakeVisualSelection'](_0x59e0db,_0x56626e,_0xcfed46=!0x1,_0x474df9=!0x1){if(this['_displayedFakeSelectionLocked']&&!_0x474df9)return!0x1;const _0x7c7abd=T(this['context'])['model'];return _0x7c7abd['change'](_0x40406e=>{this['_displayedFakeSelectionId']&&this['hideFakeVisualSelection'](this['_displayedFakeSelectionId']),this['_displayedFakeSelectionId']=_0x56626e,this['_displayedFakeSelectionLocked']=_0xcfed46;let _0x309037=0x0;for(let _0x1586a6 of _0x59e0db){const _0x16f7a7=R+':'+_0x309037;if(_0x1586a6['start']['isAtEnd']){const _0x491755=_0x1586a6['start']['getLastMatchingPosition'](({item:_0x19dc0f})=>!_0x7c7abd['schema']['isContent'](_0x19dc0f),{'boundaries':_0x1586a6});_0x1586a6=_0x40406e['createRange'](_0x491755,_0x1586a6['end']);}_0x40406e['addMarker'](_0x16f7a7,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x1586a6}),_0x309037++;}}),window['getSelection']()?.['removeAllRanges'](),!0x0;}['hideFakeVisualSelection'](_0x1d9c4e){if(this['_displayedFakeSelectionId']!=_0x1d9c4e)return!0x1;this['_displayedFakeSelectionId']=null,this['_displayedFakeSelectionLocked']=!0x1;const _0x29e24c=T(this['context']),_0x1c0113=_0x29e24c['model']['markers']['getMarkersGroup'](R);return _0x29e24c['model']['change'](_0x24ac11=>{for(const _0x3aaa62 of _0x1c0113)_0x24ac11['removeMarker'](_0x3aaa62);}),!0x0;}async['modelToDataWithIds'](_0x127ab9){const _0x25f290=T(this['context']),_0x48e1dc=_0x25f290['data']['toView'](_0x127ab9),_0x3e3f72=new Dt(_0x25f290['editing']['view']['document']);return this['_setDataIdsOnChildren'](_0x48e1dc,_0x3e3f72),this['_getDocumentDataStringFromView'](_0x48e1dc);}['_setDataIdsOnChildren'](_0x2d419b,_0x474fb8){let _0x3edf6a=!0x1;const _0x2b8fc1=new Set();for(const _0x5df101 of _0x2d419b['getChildren']()){const _0x40bca6=_0x5df101['is']('emptyElement')||_0x5df101['is']('containerElement');if(!_0x5df101['is']('element'))continue;(this['_setDataIdsOnChildren'](_0x5df101,_0x474fb8)||_0x40bca6)&&(_0x474fb8['setAttribute']('data-id',this['_nextDataId'](_0x2b8fc1),_0x5df101),_0x3edf6a=!0x0);}return _0x3edf6a;}['_nextDataId'](_0x367ccb){let _0x5d4dd3;do{_0x5d4dd3='';for(let _0x1f54ef=0x0;_0x1f54ef<0x4;_0x1f54ef++)_0x5d4dd3+=String['fromCharCode'](0x61+Math['floor'](0x1a*Math['random']()));}while(_0x367ccb['has'](_0x5d4dd3));return _0x367ccb['add'](_0x5d4dd3),_0x5d4dd3;}['getSelectionText'](){const {model:_0x5a411a}=T(this['context']),_0x408c6e=_0x5a411a['document']['selection'],_0x1ba024=[];for(const _0x99df91 of _0x408c6e['getRanges']())for(const _0x21255b of _0x99df91['getItems']())_0x21255b['is']('$textProxy')?_0x1ba024['push'](_0x21255b['data']):_0x21255b['is']('element')&&_0x1ba024['length']>0x0&&'\x20'!==_0x1ba024[_0x1ba024['length']-0x1]&&_0x1ba024['push']('\x20');return _0x1ba024['length']?'\x22'+_0x1ba024['join']('')['trim']()+'\x22':i(this['context']['locale'],'AI_CHAT_CONTEXT_DOCUMENT_SELECTION_LABEL');}['_getMarkersInDocumentOrder'](){const _0x15e40d=T(this['context'])['model'];return Array['from'](_0x15e40d['markers']['getMarkersGroup'](R))['sort']((_0x443077,_0x574af1)=>_0x443077['getStart']()['isBefore'](_0x574af1['getStart']())?-0x1:_0x443077['getStart']()['isAfter'](_0x574af1['getStart']())?0x1:0x0);}}const W=['showChangeInText','insertSuggestion','applySuggestion','rejectSuggestion','mouseOverSuggestion','mouseLeaveSuggestion','toggleSuggestionDisplayMode','like','dislike'],Rt=[...W,'startConversation','resizeTabs','sendUserMessage','abortPromptStream','addDocumentToContext','addFileToContext','addUrlToContext','executeCustomItemCallback','addResourceToContext','removeContextItem','loadSourceResources','toggleWebSearch','toggleReasoning','selectModel'];class ha{['options'];['isStreaming']=!0x1;['document']=null;['nodesList']=[];['currentIndex']=0x0;['timeoutAbortController']=null;['lastUpdateTime']=0x0;constructor(_0x365b5c){this['options']={'delay':_0x365b5c['delay']??0x14,'textNodeStyle':_0x365b5c['textNodeStyle'],'onStreamUpdate':_0x365b5c['onStreamUpdate']||(()=>{})};}async['stream']({document:_0x4030cc,targetElement:_0x477134,abortSignal:_0xf4fe89}){this['isStreaming']&&this['stop'](),_0xf4fe89?.['addEventListener']('abort',this['stop']['bind'](this)),this['document']=_0x38bb01(_0x4030cc,!0x0),this['nodesList']=this['getParsedDocumentNodeList'](),this['isStreaming']=!0x0,this['currentIndex']>this['nodesList']['length']&&(this['currentIndex']=this['nodesList']['length']);for(let _0x432da7=0x0;_0x432da7<this['currentIndex'];_0x432da7++)this['nodesList'][_0x432da7]['shouldBeStreamed']=!0x0;do{const _0x45ac59=Date['now'](),_0x2cc4fd=this['nodesList'][this['currentIndex']],_0x3e08be=_0x45ac59-this['lastUpdateTime'];if(_0x2cc4fd){_0x2cc4fd['shouldBeStreamed']=!0x0;let _0x4a82ed=_0x2cc4fd['parent'];for(;_0x4a82ed;)_0x4a82ed['shouldBeStreamed']=!0x0,_0x4a82ed=_0x4a82ed['parent'];}if(_0x3e08be<this['options']['delay'])try{const {promise:_0x2c4981,abortController:_0x3a88c8}=Cs(this['options']['delay']-_0x3e08be);this['timeoutAbortController']=_0x3a88c8,await _0x2c4981;}catch(_0x4d72e2){return;}_0x352e48(_0x477134,'<'+_0x477134['tagName']+'>'+this['renderNode'](this['document'])+'</'+_0x477134['tagName']+'>',{'childrenOnly':!0x0}),this['options']['onStreamUpdate']&&this['options']['onStreamUpdate'](),this['currentIndex']++,this['lastUpdateTime']=Date['now']();}while(this['currentIndex']<this['nodesList']['length']);this['currentIndex']=this['nodesList']['length'],this['isStreaming']=!0x1;}['reset'](){this['isStreaming']=!0x1,this['document']=null,this['nodesList']=[],this['currentIndex']=0x0,this['timeoutAbortController']=null;}['cleanUpAnimations']({targetElement:_0x41a659}){Array['from'](_0x41a659['querySelectorAll']('span[data-ck-html-streamer-word-chunk]'))['reverse']()['forEach'](_0x121f1b=>{_0x121f1b['replaceWith'](_0x121f1b['childNodes'][0x0]);});}['stop'](){this['isStreaming']=!0x1,this['timeoutAbortController']&&(this['timeoutAbortController']['abort'](),this['timeoutAbortController']=null);}['renderNode'](_0x62e4b9){let _0x323aab='';if(function(_0x221ef0){return _0x82e93c(_0x221ef0);}(_0x62e4b9)){for(const _0x5761d4 of _0x62e4b9['children'])_0x323aab+=this['renderNode'](_0x5761d4);}else{if(Ts(_0x62e4b9)){if(!_0x62e4b9['shouldBeStreamed'])return'';const _0x7ada32=_0x62e4b9,_0x3cc99e=Object['entries'](_0x7ada32['attribs'])['map'](([_0x1ae261,_0xcef3b3])=>_0x1ae261+'=\x22'+_0xcef3b3+'\x22')['join']('\x20');_0x323aab+='<'+_0x7ada32['tagName']+(_0x3cc99e?'\x20'+_0x3cc99e:'')+'>';for(const _0x58039c of _0x3a470b(_0x7ada32))_0x323aab+=this['renderNode'](_0x58039c);_0x323aab+='</'+_0x7ada32['tagName']+'>';}else{if(!Ss(_0x62e4b9))return'';if(!_0x62e4b9['shouldBeStreamed'])return'';!function(_0x21f8cb){if(!_0x21f8cb['parent']||!Ts(_0x21f8cb['parent']))return!0x1;if(!ys['includes'](_0x21f8cb['parent']['tagName']))return!0x1;return!_0x1099ea(_0x21f8cb)['match'](/^\s*[<>]\s*$/);}(_0x62e4b9)?_0x323aab+=_0x17e525(_0x62e4b9):_0x323aab+=_0x17e525(new _0x504ef3('span',{'data-ck-html-streamer-word-chunk':'','style':this['options']['textNodeStyle']},[_0x62e4b9]));}}return _0x323aab;}['getParsedDocumentNodeList'](){const _0x17ef8a=[];return function(_0x543cfa,_0x18b8df){const _0x8ce5a5=_0x4751a1=>{if(_0x18b8df(_0x4751a1),_0x4751a1 instanceof _0x409cd6)for(let _0x1da74e=0x0;_0x1da74e<_0x4751a1['children']['length'];_0x1da74e++){const _0x419288=_0x4751a1['children'][_0x1da74e];_0x8ce5a5(_0x419288);}};for(let _0x536a3b=0x0;_0x536a3b<_0x543cfa['children']['length'];_0x536a3b++)_0x8ce5a5(_0x543cfa['children'][_0x536a3b]);}(this['document'],_0x49586e=>{if(Ss(_0x49586e)){const _0x7788e0=this['splitTextNodeIntoWordNodes'](_0x49586e);_0x7788e0['length']&&_0x17ef8a['push'](..._0x7788e0);}_0x49586e['isWordSplitSource']||_0x49586e['isWordSplitResult']||_0x17ef8a['push'](_0x49586e);}),_0x17ef8a;}['splitTextNodeIntoWordNodes'](_0x25d855){if(_0x25d855['isWordSplitSource']||_0x25d855['isWordSplitResult'])return[];const _0x285621=_0x1099ea(_0x25d855)['match'](/(?:\s*\S+\s*)/g),_0x10b76b=[];if(_0x285621&&_0x285621['length']>0x1){for(const _0x4f1ee7 of _0x285621){const _0x2fa4a5=new _0x201b94(_0x4f1ee7);_0x2fa4a5['isWordSplitResult']=!0x0,_0x4856b5(_0x25d855,_0x2fa4a5),_0x10b76b['push'](_0x2fa4a5);}_0x25d855['isWordSplitSource']=!0x0,_0x12acc3(_0x25d855);}return _0x10b76b;}}const ys=['p','li','td','th','span','h1','h2','h3','h4','h5','h6','b','strong','i','em','mark','del','ins','sup','sub','a','code','div'];function Ss(_0x18b744){return _0x207546(_0x18b744);}function Ts(_0x1fe6cf){return _0x40e032(_0x1fe6cf);}function Cs(_0x48d47a){const _0x541820=new AbortController();return{'promise':new Promise((_0x243cc0,_0x449cc8)=>{const _0x3cb0ad=setTimeout(_0x243cc0,_0x48d47a);_0x541820['signal']['addEventListener']('abort',()=>{clearTimeout(_0x3cb0ad),_0x449cc8();});}),'abortController':_0x541820};}class Fr extends _0xc3e5b1{['options'];['content']='';['htmlStreamer'];['children'];constructor(_0x5ad6ac){super();const _0x6c3aab=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']=_0x5ad6ac,this['children']=this['createCollection'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__item',_0x6c3aab['if']('isDone','ck-ai-chat__feed__item_done'),_0x6c3aab['if']('isVisible','ck-hidden',_0x320f92=>!_0x320f92),'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'](_0x3ff700=>{_0x3ff700['removeAttribute']('data-id');}),this['isDone']=!0x0;}async['streamIntoElement'](_0x4755b9,_0x2d3d80,_0x5f3125){await this['htmlStreamer']['stream']({'document':_0x4755b9,'targetElement':_0x2d3d80,'abortSignal':_0x5f3125});}}class oa extends _0xc3e5b1{['showChangesToggleView'];constructor(_0x23811a,_0x521813){super(_0x23811a),this['set']('isShowChangesToggleVisible',!0x0),this['showChangesToggleView']=new ShowChangesToggleView(_0x23811a),this['showChangesToggleView']['set']({'class':'ck-ai-suggestion__header__show-changes-toggle\x20ck-ai-chat-controls-button','label':i(_0x23811a,'AI_SUGGESTION_BUTTON_SHOW_CHANGES'),'withText':!0x0}),this['showChangesToggleView']['isOn']=_0x521813['showDiff'],this['showChangesToggleView']['bind']('isVisible')['to'](this,'isShowChangesToggleVisible'),this['showChangesToggleView']['bind']('icon')['to'](this['showChangesToggleView'],'isOn',_0x96c591=>_0x96c591?_0x2f2c13:_0x189462),this['showChangesToggleView']['on']('execute',()=>{this['showChangesToggleView']['isOn']=!this['showChangesToggleView']['isOn'],this['fire']('toggleShowChanges',{'isOn':this['showChangesToggleView']['isOn']});});const _0x421a92=new _0x59b3d9();_0x421a92['content']=_0x53a0ad,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__header',!0x1===_0x521813['showHeader']?'ck-hidden':null]['filter'](Boolean)},'children':[_0x421a92,{'tag':'span','children':[i(_0x23811a,'AI_SUGGESTION_HEADER_TITLE')]},this['showChangesToggleView']]});}}class ShowChangesToggleView extends _0x2cf640{['render'](){super['render'](),this['children']['remove'](this['iconView']),this['children']['add'](this['iconView']);}}const $n={'accepted':_0x327ee4,'rejected':_0x1e26a1,'outdated':_0x1e26a1};class mi extends _0xc3e5b1{['stateIconView'];constructor(_0x18b52c){super(_0x18b52c);const _0x574aec=this['bindTemplate'];this['set']('state','accepted'),this['set']('isVisible',!0x0),this['stateIconView']=new StateIconView(),this['stateIconView']['bind']('state')['to'](this),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__content-part-state',_0x574aec['to']('state',_0x482f74=>'ck-ai-suggestion__content-part-state_'+_0x482f74),_0x574aec['if']('isVisible','ck-hidden',_0x5dae83=>!_0x5dae83)]},'children':[{'tag':'span','attributes':{'class':['ck-ai-suggestion__content-part-state__label']},'children':[{'text':_0x574aec['to']('state',_0x12806c=>{switch(_0x12806c){case'accepted':return i(_0x18b52c,'AI_SUGGESTION_CONTENT_PART_STATE_ACCEPTED');case'rejected':return i(_0x18b52c,'AI_SUGGESTION_CONTENT_PART_STATE_REJECTED');case'outdated':return i(_0x18b52c,'AI_SUGGESTION_CONTENT_PART_STATE_OUTDATED');}})}]},this['stateIconView']]});}['setState'](_0x3a6fce){this['state']=_0x3a6fce;}}class StateIconView extends _0x59b3d9{constructor(){super(),this['set']('state','accepted'),this['content']=$n[this['state']],this['on']('change:state',()=>{this['content']=$n[this['state']];});}}class gi extends _0x14c71e{['_applyButton'];['_suggestButton'];constructor(_0x341770,_0x2c90b2,_0x3e185e){super(_0x341770);const _0x8b124e=Boolean(_0x3e185e);this['set']('isEnabled',!_0x8b124e),this['set']('isVisible',!0x0),this['class']='ck-ai-suggestion-content-part-toolbar';const _0x4c9972=[];if(_0x8b124e){const _0x517c0a=new _0x2cf640(_0x341770);_0x517c0a['set']({'label':i(_0x341770,'AI_SUGGESTION_DISABLED_TOOLTIP_MESSAGE'),'tooltip':!0x0,'tooltipPosition':'n','withText':!0x1,'icon':_0x169d70}),_0x4c9972['push'](_0x517c0a);}else{_0x2c90b2['includes']('applySuggestion')&&(this['_applyButton']=new _0x2cf640(_0x341770),this['_applyButton']['set']({'label':i(_0x341770,'AI_SUGGESTION_CONTENT_PART_APPLY'),'tooltip':!0x0,'tooltipPosition':'n','withText':!0x1,'icon':_0x327ee4}),this['_applyButton']['bind']('isEnabled')['to'](this),this['_applyButton']['on']('execute',()=>{this['fire']('applySuggestion');}),_0x4c9972['push'](this['_applyButton'])),_0x2c90b2['includes']('insertSuggestion')&&(this['_suggestButton']=new _0x2cf640(_0x341770),this['_suggestButton']['set']({'label':i(_0x341770,'AI_SUGGESTION_CONTENT_PART_ADD_SUGGESTION'),'tooltip':!0x0,'tooltipPosition':'n','withText':!0x1,'icon':_0x40fbce}),this['_suggestButton']['bind']('isEnabled')['to'](this),this['_suggestButton']['on']('execute',()=>{this['fire']('insertSuggestion');}),_0x4c9972['push'](this['_suggestButton']));const _0x4b14e8=new _0x2cf640(_0x341770);_0x4b14e8['set']({'label':i(_0x341770,'AI_SUGGESTION_CONTENT_PART_REJECT'),'tooltip':!0x0,'tooltipPosition':'n','withText':!0x1,'icon':_0x1e26a1}),_0x4b14e8['bind']('isEnabled')['to'](this),_0x4b14e8['on']('execute',()=>{this['fire']('rejectSuggestion');}),_0x4c9972['push'](_0x4b14e8);}this['items']['addMany'](_0x4c9972);const _0x104cab=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':[_0x104cab['if']('isVisible','ck-hidden',_0x7f3cb1=>!_0x7f3cb1)]}});}['setButtonsVisibility']({showApplyButton:_0x11a217,showSuggestButton:_0x48619f}){this['_applyButton']&&(this['_applyButton']['isVisible']=_0x11a217),this['_suggestButton']&&(this['_suggestButton']['isVisible']=_0x48619f);}}class vn extends _0xc3e5b1{['toolbarView'];['stateView'];['titleLabelView'];['children'];constructor(_0x500072,{part:_0x58bb2c,uiIndex:_0x4c6484,availableActions:_0x288e9f,areActionsDisabled:_0x525e3b}){super(_0x500072),this['set']('isEnabled',!0x0),this['set']('state','pending'),this['toolbarView']=new gi(_0x500072,_0x288e9f,_0x525e3b),this['toolbarView']['on']('rejectSuggestion',()=>{this['fire']('rejectSuggestion',{'index':_0x58bb2c['index']});}),this['toolbarView']['on']('insertSuggestion',()=>{this['fire']('insertSuggestion',{'index':_0x58bb2c['index']});}),this['toolbarView']['on']('applySuggestion',()=>{this['fire']('applySuggestion',{'index':_0x58bb2c['index']});}),this['toolbarView']['bind']('isEnabled')['to'](this),this['stateView']=new mi(_0x500072),this['titleLabelView']=new AISuggestionBodyContentPartTitleLabelView(_0x500072,_0x4c6484),this['children']=this['createCollection'](),this['children']['addMany']([this['titleLabelView'],this['toolbarView']]),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all-excluded','ck-ai-suggestion__body__content-part__title']},'children':this['children']}),this['on']('change:state',(_0x3fee5f,_0x3eb841,_0x4b83d2,_0x1656d6)=>{'pending'===_0x1656d6?this['children']['remove'](this['toolbarView']):this['children']['remove'](this['stateView']),'pending'===_0x4b83d2?this['children']['add'](this['toolbarView']):(this['stateView']['setState'](_0x4b83d2),this['children']['add'](this['stateView']));});}}class AISuggestionBodyContentPartTitleLabelView extends _0xc3e5b1{constructor(_0x156a90,_0x520eb6){super(_0x156a90),this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-suggestion__body__content-part__title__label']},'children':[i(_0x156a90,'AI_SUGGESTION_CONTENT_PART_TITLE',_0x520eb6['toString']())]});}}class ui extends _0xc3e5b1{['htmlStreamer'];constructor(_0x427dfe){super(_0x427dfe),this['htmlStreamer']=new ha({'textNodeStyle':'animation:\x20ck-html-streamer-fade-in\x20.5s','delay':0x14}),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content','ck-reset_all-excluded','ck-ai-suggestion-streamable-content']}});}async['update']({part:_0x40d5e9,renderingStrategy:_0x262276,abortSignal:_0x24fe31}){'streaming'===_0x262276?await this['htmlStreamer']['stream']({'document':_0x40d5e9['content'],'targetElement':this['element'],'abortSignal':_0x24fe31}):this['element']['innerHTML']=pt(_0x40d5e9['content']);}['clear'](){this['htmlStreamer']['reset'](),this['element']['innerHTML']='';}}class na extends _0xc3e5b1{['_children'];['_headerView'];['_streamableContentView'];constructor(_0xbc28a9,{part:_0x2b1760,uiIndex:_0x14425f,areActionsDisabled:_0x563617,availableActions:_0x158087}){super(_0xbc28a9);const _0x3cb8ca=this['bindTemplate'];this['set']('state','pending'),this['set']('isDone',!0x1),this['set']('isVisible',!0x1),this['set']('isActive',!0x1),this['set']('isEnabled',!0x1);const _0x15a7a4=()=>{this['isEnabled']=this['isDone']&&'pending'==this['state']&&!_0x563617;};this['on']('change:state',_0x15a7a4),this['on']('change:isDone',_0x15a7a4),_0x15a7a4(),this['_children']=this['createCollection'](),this['_headerView']=new vn(_0xbc28a9,{'part':_0x2b1760,'uiIndex':_0x14425f,'availableActions':_0x158087,'areActionsDisabled':_0x563617}),this['_headerView']['bind']('isEnabled','state')['to'](this),this['_headerView']['delegate'](...W)['to'](this),this['_streamableContentView']=new ui(_0xbc28a9),this['_children']['addMany']([this['_headerView'],this['_streamableContentView']]),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__body__content-part',_0x3cb8ca['to']('state',_0x2bbf80=>'ck-ai-suggestion__body__content-part_'+_0x2bbf80),_0x3cb8ca['if']('isEnabled','ck-ai-suggestion__body__content-part_enabled'),_0x3cb8ca['if']('isActive','ck-ai-suggestion__body__content-part_active'),_0x3cb8ca['if']('isVisible','ck-hidden',_0x4c4b43=>!_0x4c4b43)]},'children':this['_children'],'on':{'mouseenter':_0x3cb8ca['to'](()=>{this['isEnabled']&&this['fire']('mouseOverSuggestion',{'index':_0x2b1760['index']});}),'mouseleave':_0x3cb8ca['to'](()=>{this['isEnabled']&&this['fire']('mouseLeaveSuggestion',{'index':_0x2b1760['index']});}),'click':_0x3cb8ca['to'](_0x438a6c=>{const _0x43d18e=_0x438a6c['target'];this['isEnabled']&&!this['_headerView']['toolbarView']['element']['contains'](_0x43d18e)&&this['fire']('showChangeInText',{'index':_0x2b1760['index']});})}});}async['updateContent']({part:_0x4abd6d,renderingStrategy:_0x44f2fd,showUnchangedParts:_0xbf0ae0=!0x1,abortSignal:_0x3d34b9}){this['partDefinition']=_0x4abd6d,this['isVisible']=this['partDefinition']['hasChanges']||_0xbf0ae0,this['isVisible']&&await this['_streamableContentView']['update']({'part':_0x4abd6d,'renderingStrategy':_0x44f2fd,'abortSignal':_0x3d34b9});}['markAsDone'](){this['isDone']=!0x0;}}class St extends _0x5bd7c6(){['queue']=[];['isProcessing']=!0x1;['_abortController'];async['enqueue'](_0x5042a6){const _0x2d58a7=this['createTask'](_0x5042a6);return this['queue']['push'](_0x2d58a7),this['_processQueue'](),_0x2d58a7['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(_0x593eb7=>{this['once']('_queueEmpty',()=>{_0x593eb7();});}):Promise['resolve']();}async['_processQueue'](){if(!this['isProcessing']){this['_abortController']=new AbortController(),this['isProcessing']=!0x0;try{for(;this['queue']['length']&&this['isProcessing'];){const _0x425428=this['queue']['shift']();try{await _0x425428['callback'](this['_abortController']['signal']),_0x425428['resolve']();}catch(_0x190278){_0x425428['reject'](_0x190278);}}}finally{this['isProcessing']=!0x1,this['_abortController']=void 0x0;}this['fire']('_queueEmpty');}}['createTask'](_0x1b445b){let _0x1272fd,_0x1e9995;const _0x3d5d5b=new Promise((_0x424fc1,_0x1a4218)=>{_0x1272fd=_0x424fc1,_0x1e9995=_0x1a4218;});return{'callback':_0x1b445b,'resolve':_0x1272fd,'reject':_0x1e9995,'completePromise':_0x3d5d5b};}}class Ke extends Fr{constructor(_0x3c48d2){super(_0x3c48d2),this['extendTemplate']({'attributes':{'class':['ck-ai-notification','warning'===_0x3c48d2['level']?'ck-ai-notification_warning':'ck-ai-notification_error']}});}['render'](){super['render'](),this['setContent'](this['options']['initialContent']),this['markAsDone']();}['setContent'](_0x260b86){this['element']['innerHTML']=_0x260b86;}}const J=['applySuggestion','insertSuggestion'];class ra extends _0xc3e5b1{['_applyChangesButton'];['_insertSuggestionsButton'];['children'];constructor(_0x5cd18a,_0xd652a0=[...J],_0x531441){super(_0x5cd18a);const _0x28c80d=this['bindTemplate'],_0xe1400b=Boolean(_0x531441);if(this['set']('isEnabled',!_0xe1400b),this['set']('isVisible',!0x1),this['set']('isTrackChangesOn',!0x1),this['children']=this['createCollection'](),_0xe1400b){const _0x1f211e=new _0x2cf640(_0x5cd18a);_0x1f211e['set']({'label':i(_0x5cd18a,'AI_SUGGESTION_DISABLED_TOOLTIP_MESSAGE'),'tooltip':!0x0,'tooltipPosition':'n','withText':!0x1,'icon':_0x169d70});const _0xf7cc9e=new _0xc3e5b1(_0x5cd18a);_0xf7cc9e['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-chat__feed__suggestion__actions__info'},'children':[{'tag':'p','children':[i(_0x5cd18a,'AI_SUGGESTION_DISABLED_FEED_MESSAGE'),_0x1f211e]}]}),this['children']['add'](_0xf7cc9e);}else this['_applyChangesButton']=new _0x2cf640(_0x5cd18a),this['_applyChangesButton']['set']({'label':i(_0x5cd18a,'AI_CHAT_SUGGESTION_ACTION_APPLY_ALL'),'withText':!0x0,'type':'button','isVisible':_0xd652a0['includes']('applySuggestion'),'class':'ck-ai-button-primary'}),this['_insertSuggestionsButton']=new _0x2cf640(_0x5cd18a),this['_insertSuggestionsButton']['set']({'label':i(_0x5cd18a,'AI_CHAT_SUGGESTION_ACTION_SUGGEST_ALL'),'withText':!0x0,'type':'button','isVisible':_0xd652a0['includes']('insertSuggestion'),'class':'ck-ai-button-secondary'}),this['_insertSuggestionsButton']['on']('execute',()=>{this['fire']('insertSuggestion');}),this['_applyChangesButton']['on']('execute',()=>{this['fire']('applySuggestion');}),[this['_applyChangesButton'],this['_insertSuggestionsButton']]['forEach'](_0x190cca=>{_0x190cca['bind']('isEnabled')['to'](this);}),this['children']['addMany']([this['_applyChangesButton'],this['_insertSuggestionsButton']]);this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__ai-suggestion__actions',_0x28c80d['if']('isVisible','ck-hidden',_0x3fea59=>!_0x3fea59)]},'children':this['children']}),this['on']('change:isTrackChangesOn',()=>{this['_applyChangesButton']&&(this['_applyChangesButton']['isVisible']=!this['isTrackChangesOn']);});}['updateVisibility'](_0x1829fa){this['isVisible']=_0x1829fa;}['_switchButtonLabelsPlurality'](_0x33b2d3){this['_applyChangesButton']&&this['_insertSuggestionsButton']&&(_0x33b2d3?(this['_applyChangesButton']['label']=i(this['locale'],'AI_CHAT_SUGGESTION_ACTION_APPLY_ALL'),this['_insertSuggestionsButton']['label']=i(this['locale'],'AI_CHAT_SUGGESTION_ACTION_SUGGEST_ALL')):(this['_applyChangesButton']['label']=i(this['locale'],'AI_CHAT_SUGGESTION_ACTION_APPLY'),this['_insertSuggestionsButton']['label']=i(this['locale'],'AI_CHAT_SUGGESTION_ACTION_SUGGEST')));}}class Sr extends _0xc3e5b1{['children'];['balloonPanelView'];['bodyCollection'];constructor(_0x2182e1,_0x3accb9){super(_0x2182e1),this['bodyCollection']=_0x3accb9,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',_0x156fda=>!_0x156fda)]},'children':this['children']});const _0x384079=new _0xc3e5b1(this['locale']),_0x34f21b=new _0x59b3d9();_0x34f21b['content']=_0xd8346c,_0x384079['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-web-sources__header']},'children':[_0x34f21b,{'tag':'span','children':[{'text':i(this['locale'],'AI_CHAT_SOURCES_HEADER')}]}]}),this['children']['add'](_0x384079),this['_setupBalloonPanel'](_0x2182e1);}['addSource'](_0x54d776){this['children']['add'](new qr(this['locale'],_0x54d776,this['balloonPanelView']));}['_setupBalloonPanel'](_0x302bf2){this['balloonPanelView']=new _0x5442ef(_0x302bf2),this['balloonPanelView']['extendTemplate']({'attributes':{'class':['ck-ai-web-source__tooltip-balloon']}}),this['bodyCollection']['add'](this['balloonPanelView']);}}class qr extends _0x2cf640{['balloonPanelView'];['source'];constructor(_0x2d7979,_0x4f3a6e,_0x5d9d89){super(_0x2d7979),this['source']=_0x4f3a6e,this['balloonPanelView']=_0x5d9d89,this['set']({'label':_0x4f3a6e['title'],'class':['ck\x20ck-ai-web-source'],'withText':!0x0});const _0x19f8b6=this['bindTemplate'];if(this['extendTemplate']({'on':{'click':_0x19f8b6['to'](()=>{window['open'](_0x4f3a6e['url'],'_blank');}),'mouseenter':_0x19f8b6['to'](()=>{this['_showTooltip']();}),'mouseleave':_0x19f8b6['to'](()=>{this['_hideTooltip']();})}}),_0x4f3a6e['favicon']){const _0x1e60b4=new _0xc3e5b1(_0x2d7979);_0x1e60b4['setTemplate']({'tag':'img','attributes':{'src':_0x4f3a6e['favicon']||_0xd8346c,'alt':_0x4f3a6e['title'],'class':['ck-ai-web-source__image']}}),this['children']['add'](_0x1e60b4);}else this['set']('icon',_0xd8346c);}['_createTooltipContentView'](_0x3a0dbe,_0x156f30){const _0x40e53a=new _0xc3e5b1(_0x3a0dbe),_0x59da62=[];let _0x5e1c30;_0x156f30?.['favicon']?(_0x5e1c30=new _0xc3e5b1(_0x3a0dbe),_0x5e1c30['setTemplate']({'tag':'img','attributes':{'src':_0x156f30['favicon'],'alt':_0x156f30['title'],'class':['ck-ai-web-source__tooltip-image']}})):(_0x5e1c30=new _0x59b3d9(),_0x5e1c30['content']=_0xd8346c,_0x5e1c30['extendTemplate']({'attributes':{'alt':_0x156f30['title'],'class':['ck-ai-web-source__tooltip-image']}})),_0x59da62['push'](_0x5e1c30);const _0x6756f5=new _0xc3e5b1(_0x3a0dbe);_0x6756f5['setTemplate']({'tag':'a','attributes':{'class':['ck-ai-web-source__tooltip-url'],'href':_0x156f30['url']},'children':[{'text':new URL(_0x156f30['url'])?.['hostname']}]}),_0x59da62['push'](_0x6756f5);const _0x36664f=new _0xc3e5b1(_0x3a0dbe);_0x36664f['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-web-source__tooltip-row']},'children':_0x59da62});const _0x4a2eca=new _0xc3e5b1(_0x3a0dbe);return _0x4a2eca['setTemplate']({'tag':'span','attributes':{'class':['ck-ai-web-source__tooltip-row','ck-ai-web-source__tooltip-title']},'children':[{'text':_0x156f30['title']['length']>0x190?_0x156f30['title']['substring'](0x0,0x190)+'...':_0x156f30['title']}]}),_0x40e53a['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-web-source__tooltip']},'children':[_0x36664f,_0x4a2eca]}),_0x40e53a;}['_showTooltip'](){this['_updateTooltipContent'](),this['balloonPanelView']['pin']({'target':this['element'],'positions':[_0x5442ef['defaultPositions']['northArrowSouth'],_0x5442ef['defaultPositions']['northArrowSouthWest'],_0x5442ef['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 _0x24721c=this['_createTooltipContentView'](this['locale'],this['source']);this['balloonPanelView']['content']['add'](_0x24721c);}}class ca extends _0xc3e5b1{['_actionsView'];['_sourcesView'];['_children'];['_areActionsDisabled'];['_showUnchangedParts'];['_updateContentPartsPromiseQueue'];['_emptyPartsWarningView'];['_availableActions'];['_cachedContentParts']=[];constructor(_0x45d769,_0x37e670){super(_0x45d769);const {areActionsDisabled:_0x57702f,showUnchangedParts:_0x51b3d3,availableActions:_0x4d2f55}=_0x37e670;this['_areActionsDisabled']=_0x57702f,this['_showUnchangedParts']=_0x51b3d3,this['_availableActions']=_0x4d2f55,this['set']('hasPendingParts',!0x1),this['set']('isTrackChangesOn',!0x1),this['_children']=this['createCollection'](),this['_updateContentPartsPromiseQueue']=new St(),this['_emptyPartsWarningView']=new Ke({'id':'empty-parts-warning','initialContent':i(_0x45d769,'AI_SUGGESTION_EMPTY_PART_WARNING'),'level':'warning'}),this['_emptyPartsWarningView']['isVisible']=!0x1,this['_actionsView']=new ra(_0x45d769,_0x37e670['availableActions'],this['_areActionsDisabled']),this['_actionsView']['bind']('isTrackChangesOn')['to'](this),this['_sourcesView']=new Sr(this['locale'],_0x37e670['bodyCollection']),_0x37e670['areActionsDisabled']?this['_actionsView']['isEnabled']=!0x1:this['_actionsView']['bind']('isEnabled')['to'](this,'hasPendingParts'),this['_actionsView']['delegate'](...W)['to'](this),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__body']},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__body__content-parts']},'children':this['_children']},this['_emptyPartsWarningView'],this['_actionsView'],this['_sourcesView']]});}get['partsCount'](){return this['_children']['length'];}async['updateContentParts']({parts:_0x3570c1,renderingStrategy:_0xedc685,abortSignal:_0x162321}){this['_children']['length']?_0x3570c1['forEach'](_0x52fcdc=>{const _0x294743=this['_cachedContentParts']['findIndex'](_0x289be9=>_0x289be9['index']==_0x52fcdc['index']);-0x1===_0x294743?this['_cachedContentParts']['push'](_0x52fcdc):this['_cachedContentParts'][_0x294743]=_0x52fcdc;}):this['_cachedContentParts']=_0x3570c1;const _0xcabc86=this['_showUnchangedParts']?_0x3570c1:_0x3570c1['filter'](_0x12237b=>_0x12237b['hasChanges']);this['_actionsView']['_switchButtonLabelsPlurality'](_0xcabc86['length']>0x1);for(const _0x4ecc12 of _0xcabc86)this['_updateContentPartsPromiseQueue']['enqueue'](async _0x13374c=>{let _0x4864a4=this['getPartView'](_0x4ecc12['index']);_0x4864a4||(_0x4864a4=new na(this['locale'],{'part':_0x4ecc12,'uiIndex':this['_children']['length']+0x1,'areActionsDisabled':this['_areActionsDisabled'],'availableActions':this['_availableActions']}),_0x4864a4['delegate'](...W)['to'](this),this['_children']['add'](_0x4864a4),this['hasPendingParts']=!0x0),await _0x4864a4['updateContent']({'part':_0x4ecc12,'renderingStrategy':_0xedc685,'showUnchangedParts':this['_showUnchangedParts'],'abortSignal':_0x13374c}),_0x4864a4['markAsDone']();});return _0x162321?.['addEventListener']('abort',()=>{this['_updateContentPartsPromiseQueue']['abort']();}),this['_updateContentPartsPromiseQueue']['queueEmptyPromise'];}['updatePartState'](_0x4d68f0,_0x9982eb){const _0x70a07f=this['getPartView'](_0x4d68f0);_0x70a07f&&(_0x70a07f['state']=_0x9982eb),this['hasPendingParts']='pending'==_0x9982eb||Array['from'](this['_children'])['some'](_0x3e0a2b=>'pending'==_0x3e0a2b['state']);}['setPartActive'](_0x4c913f,_0x115a4a){if(!0x1===_0x4c913f){for(const _0x5eb0d3 of this['_children'])_0x5eb0d3['isActive']=!0x1;}else{const _0x5c711e=this['getPartView'](_0x4c913f);_0x5c711e&&(_0x5c711e['isActive']=_0x115a4a);}}['updateSources'](_0x10444d){_0x10444d['forEach'](_0x2ce349=>this['_sourcesView']['addSource'](_0x2ce349)),this['_sourcesView']['isVisible']=!0x0;}['getPartView'](_0x115609){return this['_children']['find'](_0x4fbafb=>_0x4fbafb['partDefinition']['index']==_0x115609)??null;}['markAsDone'](){if(!this['_showUnchangedParts']){const _0x1bc851=!this['_cachedContentParts']['find'](({hasChanges:_0x3447dc})=>_0x3447dc),_0x1ac007=!!this['_cachedContentParts']['find'](({hasChanges:_0x2c396a})=>!_0x2c396a);this['_emptyPartsWarningView']['isVisible']=0x0==this['_children']['length']||_0x1ac007,_0x1bc851?this['_emptyPartsWarningView']['setContent'](i(this['locale'],'AI_SUGGESTION_NO_PARTS_WARNING')):this['_emptyPartsWarningView']['setContent'](i(this['locale'],'AI_SUGGESTION_EMPTY_PART_WARNING'));}this['_children']['forEach'](_0x1179df=>_0x1179df['markAsDone']()),this['_actionsView']['updateVisibility'](this['hasNonEmptyParts']);}get['hasNonEmptyParts'](){return this['_children']['filter'](_0x1b3d21=>_0x1b3d21['partDefinition']['hasChanges'])['length']>0x0;}}class gn extends _0xc3e5b1{['bodyView'];['children'];['headerView'];constructor(_0x1634dd,_0x5bb1fa,_0x439d2b){super(_0x1634dd);const {showDiff:_0x458d91,areActionsDisabled:_0x41f554,showUnchangedParts:_0x2f9fd5,availableActions:_0x48ff53}=_0x5bb1fa;this['set']('isTrackChangesOn',!0x1),this['set']('areChangesVisible',!0x1),this['children']=this['createCollection'](),this['headerView']=new oa(_0x1634dd,{'showDiff':_0x458d91}),this['headerView']['on']('toggleShowChanges',(_0xc2c474,_0x16c491)=>{this['areChangesVisible']=_0x16c491['isOn'],this['fire']('toggleSuggestionDisplayMode',{'showDiff':_0x16c491['isOn']});}),this['children']['add'](this['headerView']),this['bodyView']=new ca(_0x1634dd,{'areActionsDisabled':_0x41f554,'showUnchangedParts':!!_0x2f9fd5,'availableActions':_0x48ff53,'bodyCollection':_0x439d2b}),this['bodyView']['delegate'](...W)['to'](this),this['bodyView']['bind']('isTrackChangesOn')['to'](this),this['children']['add'](this['bodyView']),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__container','ck-rounded-corners']},'children':this['children']});}async['updateContent'](_0x52a8f1){await this['bodyView']['updateContentParts'](_0x52a8f1);}['updateSources'](_0x545852){this['bodyView']['updateSources'](_0x545852);}['markAsDone'](){this['bodyView']['markAsDone'](),this['headerView']&&(this['headerView']['isShowChangesToggleVisible']=this['bodyView']['hasNonEmptyParts']);}}class Be extends Fr{['containerView'];constructor(_0x31e95a,_0x3f0924,_0x49f86b){super(_0x3f0924),this['set']('isTrackChangesOn',!0x1),this['containerView']=new gn(_0x31e95a,{'showDiff':_0x3f0924['showDiff'],'areActionsDisabled':_0x3f0924['areActionsDisabled'],'availableActions':_0x3f0924['availableActions']},_0x49f86b),this['containerView']['on']('toggleSuggestionDisplayMode',(_0x18a7eb,_0x37634e)=>{this['fire']('toggleSuggestionDisplayMode',{'replyId':this['options']['id'],'showDiff':_0x37634e['showDiff']});}),this['containerView']['bind']('isTrackChangesOn')['to'](this),this['containerView']['on']('like',()=>{this['fire']('like',{'replyId':this['options']['id']});}),this['containerView']['on']('dislike',()=>{this['fire']('dislike',{'replyId':this['options']['id']});}),this['containerView']['on']('showChangeInText',(_0x373685,{index:_0xb26f})=>{this['fire']('showChangeInText',{'replyId':this['options']['id'],'partIndex':_0xb26f});}),this['containerView']['on']('applySuggestion',(_0x3550c5,{index:_0x3c86b0}={})=>{this['fire']('applySuggestion',{'replyId':this['options']['id'],'partIndex':_0x3c86b0});}),this['containerView']['on']('insertSuggestion',(_0x5909c4,{index:_0x26cd1c}={})=>{this['fire']('insertSuggestion',{'replyId':this['options']['id'],'partIndex':_0x26cd1c});}),this['containerView']['on']('rejectSuggestion',(_0x41c36a,{index:_0x3ab450})=>{this['fire']('rejectSuggestion',{'replyId':this['options']['id'],'partIndex':_0x3ab450});}),this['containerView']['on']('mouseOverSuggestion',(_0x5bc32b,{index:_0x164b53})=>{this['fire']('mouseOverSuggestion',{'replyId':this['options']['id'],'partIndex':_0x164b53});}),this['containerView']['on']('mouseLeaveSuggestion',(_0x2a817c,{index:_0x44a4b5})=>{this['fire']('mouseLeaveSuggestion',{'replyId':this['options']['id'],'partIndex':_0x44a4b5});}),this['children']['addMany']([this['containerView']]),this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__ai-suggestion']}});}async['updateContent'](_0x195231){await this['containerView']['updateContent'](_0x195231);}['updatePartState'](_0x30fd77,_0x327b35){this['containerView']['bodyView']['updatePartState'](_0x30fd77,_0x327b35);}['setPartActive'](_0x1be93a,_0x36d16b){!0x1===_0x1be93a?this['containerView']['bodyView']['setPartActive'](!0x1):this['containerView']['bodyView']['setPartActive'](_0x1be93a,_0x36d16b);}['updateSources'](_0x109313){this['containerView']['updateSources'](_0x109313);}['getPartView'](_0x12484c){return this['containerView']['bodyView']['getPartView'](_0x12484c);}['markAsDone'](){super['markAsDone'](),this['containerView']['markAsDone']();}}class qe extends Fr{['replyContainer'];['_bodyCollection'];constructor(_0x1a3666,_0x56159a,_0x11f031){super(_0x56159a),this['_bodyCollection']=_0x11f031,this['locale']=_0x1a3666,this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__ai-reply']}}),this['replyContainer']=new _0xc3e5b1(),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':Wi(this['options']['initialContent']),'renderingStrategy':'static'}),this['markAsDone']());}async['updateContent']({parsedContent:_0x32395e,renderingStrategy:_0x51281f,abortSignal:_0x4e30d4}){'streaming'===_0x51281f?await this['streamIntoElement'](_0x32395e,this['replyContainer']['element'],_0x4e30d4):this['replyContainer']['element']['innerHTML']=_0x17e525(_0x32395e);}['updateSources'](_0x19d54d){const _0x58459c=new Sr(this['locale'],this['_bodyCollection']);_0x58459c['children']['addMany'](_0x19d54d['map'](_0x20783d=>new qr(this['locale'],_0x20783d,_0x58459c['balloonPanelView']))),_0x58459c['isVisible']=!0x0,this['children']['add'](_0x58459c);}}class Ze extends _0x559c75{constructor(_0x20efd7=void 0x0){super();const _0x1b6e37=_0x20efd7?'ck-ai-spinner_'+_0x20efd7:'';this['extendTemplate']({'tag':'span','attributes':{'class':['ck-ai-spinner',_0x1b6e37]}});}}const xn={'file':_0x4d62fe,'document':_0x2ff8c2,'web-resource':_0xa0ac3e,'text':_0x4d62fe,'selection':_0x413c92,'mcp-tool-context':_0x2ff8c2},qn='ck-ai-chat-context-chip',Qn='ck-ai-chat-context-chip_wide',Xn='ck-ai-chat-context-chip_document',zn='ck-ai-chat-context-chip__label',Jn='ck-ai-chat-context-chip__type-icon',Zn='ck-ai-chat-context-controls__chip-tooltip',Cn='n';class vo extends _0x2cf640{constructor(_0x4cb9ea,_0xc869ac,_0x5b2971,_0x1cf2af,_0x41966f=!0x1){super(_0x4cb9ea),this['_isAnimationOnEnterEnabled']=_0x1cf2af,this['_initializeProperties'](_0xc869ac,_0x5b2971,_0x41966f),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'](_0x7e8983,_0x487c89,_0x1f3222){this['set']('label',_0x7e8983['label']),this['set']('tooltip',!0x0),this['set']('itemType',_0x7e8983['type']),this['set']('id',_0x7e8983['uiId']),this['set']('readonly',_0x487c89),this['set']('isLoading',_0x1f3222);}['_setupTemplate'](){const _0x26ef5c=this['_createIconView'](),_0x13c83f=this['_createRemoveButton'](),_0x23603f=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':this['_createTemplateAttributes'](_0x23603f),'children':this['_createTemplateChildren'](_0x26ef5c,_0x13c83f,_0x23603f)});}['_createTemplateAttributes'](_0xca3c48){return{'class':[qn,_0xca3c48['if']('itemType',Xn,_0x61dec1=>'document'==_0x61dec1),_0xca3c48['if']('itemType',Qn,_0x3cfbb9=>'selection'==_0x3cfbb9)],'data-cke-tooltip-text':_0xca3c48['to']('label',In),'data-cke-tooltip-position':Cn,'data-cke-tooltip-class':Zn};}['_createTemplateChildren'](_0x43014c,_0xc55fdc,_0x537bbd){const _0x466a2d=this['_createLabelElement'](_0x537bbd),_0x436511=this['_createLoaderIcon']();return this['readonly']?[_0x43014c,_0x466a2d]:[_0x43014c,_0x436511,_0x466a2d,_0xc55fdc];}['_createLabelElement'](_0x48c92e){return{'tag':'span','attributes':{'class':zn},'children':[{'text':_0x48c92e['to']('label')}]};}['_createRemoveButton'](){const _0x4e41cd=new _0x2cf640(this['locale']);return _0x4e41cd['set']({'label':i(this['locale'],'AI_CHAT_CONTEXT_REMOVE_FROM_CONTEXT'),'icon':_0x3daaaf}),this['_setupRemoveButtonEvent'](_0x4e41cd),_0x4e41cd;}['_setupRemoveButtonEvent'](_0x584c0c){_0x584c0c['on']('execute',()=>{this['fire']('removeContextItemChip',this['id']);});}['_createIconView'](){const _0x3bd552=this['bindTemplate'],_0x325f75=new _0x59b3d9();return _0x325f75['content']=xn[this['itemType']],_0x325f75['extendTemplate']({'attributes':{'class':[Jn,_0x3bd552['if']('isLoading','ck-hidden',_0x8e78ad=>_0x8e78ad)]}}),_0x325f75;}['_handleAnimationEndOnce'](_0x7df12,_0x5d54ec){if(!_0x7df12)return;const _0x18bd5e=()=>{_0x5d54ec(),_0x7df12['removeEventListener']('animationend',_0x18bd5e),_0x7df12['removeEventListener']('webkitAnimationEnd',_0x18bd5e);};_0x7df12['addEventListener']('animationend',_0x18bd5e),_0x7df12['addEventListener']('webkitAnimationEnd',_0x18bd5e);}['_createLoaderIcon'](){const _0x4e326b=new Ze('small');return _0x4e326b['bind']('isVisible')['to'](this,'isLoading',_0x4a8be7=>_0x4a8be7),_0x4e326b;}}function In(_0x70814f){if(!_0x70814f)return _0x70814f;if(_0x70814f['length']<=0x78)return _0x70814f;const _0xa3e229=_0x70814f['slice'](0x0,0x78),_0x44b50a=_0xa3e229['lastIndexOf']('\x20');return(_0x44b50a>0x0?_0xa3e229['slice'](0x0,_0x44b50a):_0xa3e229)+'…';}const hn={'maxVisibleRows':0x2,'rowDetectionTolerance':0x5,'showMoreLabelPrefix':'+\x20','viewportOffset':{'top':0x64,'bottom':0xa}},an='300px';class Io{['_locale'];['_config'];['_visibleChips'];['_overflowChips'];['_showMoreButtonView']=null;['_showMoreBalloonPanelView']=null;['_containerElement']=null;['_bodyCollection'];['_parentView']=null;['_intersectionObserver']=null;['_pendingCalculation']=!0x1;constructor(_0x55ee8b,_0x559355,_0x2c547e,_0x2cc194,_0x5aaf31){this['_locale']=_0x55ee8b,this['_visibleChips']=_0x559355,this['_config']={...hn,..._0x2c547e,'cssClasses':{'controlsButton':'','calculationContainer':'ck-calculation-container',..._0x2c547e['cssClasses']}},this['_overflowChips']=new _0x7916ba(),this['_bodyCollection']=_0x2cc194,this['_parentView']=_0x5aaf31||null;}['setContainerElement'](_0x2baf85){this['_intersectionObserver']&&(this['_intersectionObserver']['disconnect'](),this['_intersectionObserver']=null),this['_containerElement']=_0x2baf85,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 _0x3eb9ad=[...this['_visibleChips'],...this['_overflowChips']],_0x5d785c=this['_createCalculationContainer'](),_0x3dfd6a=this['_calculateOverflowInContainer'](_0x5d785c,_0x3eb9ad),_0x22a8b7=_0x5d785c['_ancestorsToRestore'];_0x22a8b7&&this['_restoreAncestorVisibility'](_0x22a8b7),_0x5d785c['remove'](),this['_applyOverflowResults'](_0x3eb9ad,_0x3dfd6a);}['_createShowMoreButton'](){this['_showMoreButtonView']=this['_createShowMoreButtonView'](),this['_showMoreBalloonPanelView']=this['_createShowMoreBalloonPanelView'](),this['_showMoreButtonView']['render'](),this['_containerElement']['appendChild'](this['_showMoreButtonView']['element']),this['_showMoreButtonView']['on']('execute',()=>{this['_handleShowMoreButtonClick']();}),_0x1d212b({'emitter':this['_showMoreBalloonPanelView'],'contextElements':[this['_showMoreBalloonPanelView']['element'],this['_showMoreButtonView']['element']],'callback':()=>this['hideBalloonPanel'](),'activator':()=>this['_showMoreButtonView']['isOn']});}['_createShowMoreButtonView'](){const _0xa509fa=new _0x2cf640(this['_locale']);_0xa509fa['set']({'label':'','withText':!0x0,'isToggleable':!0x0});const _0x5f4e3d=[this['_config']['cssClasses']['showMoreButton']];return this['_config']['cssClasses']['controlsButton']&&_0x5f4e3d['push'](this['_config']['cssClasses']['controlsButton']),_0xa509fa['extendTemplate']({'attributes':{'class':_0x5f4e3d}}),_0xa509fa;}['_createShowMoreBalloonPanelView'](){const _0x13dd96=new _0x5442ef(this['_locale']);return _0x13dd96['extendTemplate']({'attributes':{'class':this['_config']['cssClasses']['showMoreBalloon']}}),this['_bodyCollection']['add'](_0x13dd96),_0x13dd96;}['_updateBalloonContent'](){if(this['_showMoreBalloonPanelView']&&(this['_showMoreBalloonPanelView']['content']['clear'](),this['_overflowChips']['length']>0x0)){this['_overflowChips']['forEach'](_0x34a2c3=>{_0x34a2c3['disableAnimationOnEnter']();});const _0x406db6=new _0xc3e5b1(this['_locale']);_0x406db6['setTemplate']({'tag':'div','attributes':{'class':this['_config']['cssClasses']['overflowContainer']},'children':this['_overflowChips']}),this['_showMoreBalloonPanelView']['content']['add'](_0x406db6);}}['_handleShowMoreButtonClick'](){this['_showMoreButtonView']['isOn']?this['hideBalloonPanel']():this['showBalloonPanel']();}['_updateShowMoreButtonVisibility'](){const _0x3034a0=this['_overflowChips']['length']>0x0;this['_showMoreButtonView']?.['element']&&(this['_showMoreButtonView']['element']['style']['display']=_0x3034a0?'':'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'](_0x126909){const _0x331034=this['_containerElement']?.['tagName']['toLowerCase']()||'div',_0x3029ca=this['_containerElement']?.['classList'];if(_0x3029ca){const _0x2ca3e7=_0x3029ca[0x0]||'',_0x2476d4=_0x126909['querySelector']('.'+_0x2ca3e7),_0x428d3a=_0x126909['querySelector'](_0x331034);return _0x2476d4||_0x428d3a||_0x126909;}return _0x126909['querySelector'](_0x331034)||_0x126909;}['_calculateContainerWidth'](){const _0x3b9049=this['_parentView']?.['element']||this['_containerElement'];if(!_0x3b9049)return an;const _0x31233a=window['getComputedStyle'](_0x3b9049)['width'];if('auto'===_0x31233a||'0px'===_0x31233a||!_0x31233a){const _0x4ed139=_0x3b9049['parentElement'];if(_0x4ed139){const _0x50c440=window['getComputedStyle'](_0x4ed139);return'auto'!==_0x50c440['width']?_0x50c440['width']:an;}return an;}return _0x31233a;}['_applyCalculationStyles'](_0x4cad33,_0xf438b3){this['_config']['cssClasses']['calculationContainer']&&_0x4cad33['classList']['add'](this['_config']['cssClasses']['calculationContainer']),_0x4cad33['style']['width']=_0xf438b3,_0x4cad33['style']['position']='absolute',_0x4cad33['style']['top']='-9999px',_0x4cad33['style']['left']='-9999px',_0x4cad33['style']['opacity']='0',_0x4cad33['style']['pointerEvents']='none',_0x4cad33['style']['zIndex']='-1',_0x4cad33['style']['visibility']='visible\x20!important',_0x4cad33['style']['display']='block\x20!important',_0x4cad33['style']['boxSizing']='border-box';}['_restoreAncestorVisibility'](_0x137f19){_0x137f19['forEach'](({element:_0x53784d,originalDisplay:_0x533337,originalVisibility:_0x16cf31})=>{_0x53784d['style']['display']=_0x533337,_0x53784d['style']['visibility']=_0x16cf31;});}['_makeAncestorsVisible'](_0x4f49b7){const _0x4df9e8=[];let _0x34bb49=_0x4f49b7;for(;_0x34bb49&&_0x34bb49!==document['body'];){const _0x2e1489=window['getComputedStyle'](_0x34bb49);'none'!==_0x2e1489['display']&&'hidden'!==_0x2e1489['visibility']||(_0x4df9e8['push']({'element':_0x34bb49,'originalDisplay':_0x34bb49['style']['display'],'originalVisibility':_0x34bb49['style']['visibility']}),_0x34bb49['style']['display']='block',_0x34bb49['style']['visibility']='visible'),_0x34bb49=_0x34bb49['parentElement'];}return _0x4df9e8;}['_createContainerElements'](){let _0x4902d7,_0x365d41;return this['_parentView']?.['element']?(_0x4902d7=this['_parentView']['element']['cloneNode'](!0x0),_0x365d41=this['_findTargetContainer'](_0x4902d7)):(_0x4902d7=document['createElement']('div'),_0x365d41=_0x4902d7),{'calculationContainer':_0x4902d7,'targetContainer':_0x365d41};}['_createCalculationContainer'](){const {calculationContainer:_0x1e097c,targetContainer:_0x53b086}=this['_createContainerElements'](),_0x3327bb=this['_calculateContainerWidth']();this['_applyCalculationStyles'](_0x1e097c,_0x3327bb);const _0x49354c=this['_parentView']?.['element']||this['_containerElement'],_0x1df882=_0x49354c?.['parentElement'];_0x1df882?_0x1df882['appendChild'](_0x1e097c):document['body']['appendChild'](_0x1e097c),_0x1e097c['_targetContainer']=_0x53b086;const _0x3fe92d=this['_makeAncestorsVisible'](_0x1df882||null);return _0x1e097c['offsetWidth'],_0x1e097c['_ancestorsToRestore']=_0x3fe92d,_0x1e097c;}['_calculateOverflowInContainer'](_0x248f81,_0x56bb58){const _0x1faf11=_0x248f81['_targetContainer']||_0x248f81,_0x58f0a4=[],{rowCount:_0x50441b}=this['_renderChipsAndCountRows'](_0x1faf11,_0x56bb58);if(_0x50441b<=this['_config']['maxVisibleRows'])return _0x58f0a4;const _0x33cdfd=_0x56bb58['slice']();for(;_0x33cdfd['length']>0x0;){if(this['_testButtonFit'](_0x248f81,_0x1faf11,_0x33cdfd)){const _0x1f98c0=_0x56bb58['filter'](_0x2e1ee1=>!_0x33cdfd['includes'](_0x2e1ee1));_0x58f0a4['push'](..._0x1f98c0);break;}if(!_0x33cdfd['pop']())break;}return _0x58f0a4;}['_renderChipsAndCountRows'](_0x567480,_0x2ff4ba){_0x567480['innerHTML']='',_0x2ff4ba['forEach'](_0x27545f=>{if(_0x27545f['element']){const _0x22e54b=_0x27545f['element']['cloneNode'](!0x0);_0x567480['appendChild'](_0x22e54b);}}),_0x567480['offsetWidth'];const _0x3f1059=_0x567480['children'],_0x2c5d99=[];return Array['from'](_0x3f1059)['forEach'](_0x36d731=>{const _0x20edf4=_0x36d731['getBoundingClientRect']()['top'];_0x2c5d99['some'](_0x23d965=>Math['abs'](_0x23d965-_0x20edf4)<this['_config']['rowDetectionTolerance'])||_0x2c5d99['push'](_0x20edf4);}),{'rowCount':_0x2c5d99['length']};}['_createMockButton'](){const _0x5860db=document['createElement']('button');return _0x5860db['className']=this['_config']['cssClasses']['showMoreButton'],this['_config']['cssClasses']['controlsButton']&&_0x5860db['classList']['add'](this['_config']['cssClasses']['controlsButton']),_0x5860db['textContent']='+\x201',_0x5860db;}['_testButtonFit'](_0x86de32,_0x25bbaa,_0x46fc38){this['_renderChipsAndCountRows'](_0x25bbaa,_0x46fc38);const _0x254a9b=this['_createMockButton']();_0x86de32['appendChild'](_0x254a9b),_0x86de32['offsetWidth'];const _0x20fe1b=[..._0x25bbaa['children'],_0x254a9b],_0x250a27=[];_0x20fe1b['forEach'](_0x5512cd=>{const _0x15ff4c=_0x5512cd['getBoundingClientRect']()['top'];_0x250a27['some'](_0x1111a4=>Math['abs'](_0x1111a4-_0x15ff4c)<this['_config']['rowDetectionTolerance'])||_0x250a27['push'](_0x15ff4c);});const _0x4591d7=_0x250a27['length'];return _0x254a9b['remove'](),_0x4591d7<=this['_config']['maxVisibleRows'];}['_distributeChips'](_0x1d1904,_0x575bcd){this['_visibleChips']['clear'](),this['_overflowChips']['clear'](),_0x1d1904['forEach'](_0x4db0f0=>{_0x575bcd['includes'](_0x4db0f0)?this['_overflowChips']['add'](_0x4db0f0):this['_visibleChips']['add'](_0x4db0f0);});}['_updateOverflowUI'](_0x1d53af){if(_0x1d53af>0x0&&!this['_showMoreButtonView']&&this['_createShowMoreButton'](),_0x1d53af>0x0&&this['_showMoreButtonView']){const _0x324813=''+this['_config']['showMoreLabelPrefix']+(_0x1d53af<0x63?_0x1d53af:'99');this['_showMoreButtonView']['label']=_0x324813;}this['_updateBalloonContent'](),this['_updateShowMoreButtonVisibility'](),this['_repinBalloonPanel']();}['_applyOverflowResults'](_0x41e103,_0x2ded91){this['_distributeChips'](_0x41e103,_0x2ded91),this['_updateOverflowUI'](_0x2ded91['length']);}['_setupVisibilityObserver'](){this['_containerElement']&&'undefined'!=typeof IntersectionObserver&&(this['_intersectionObserver']=new IntersectionObserver(_0x123b95=>{_0x123b95[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 _0x9606f1=this['_containerElement']['getBoundingClientRect']();if(0x0===_0x9606f1['width']||0x0===_0x9606f1['height'])return!0x1;const _0x286d7e=window['innerHeight']||document['documentElement']['clientHeight'],_0x364459=window['innerWidth']||document['documentElement']['clientWidth'],_0x5b927b=0xc8;return _0x9606f1['bottom']>=-0xc8&&_0x9606f1['top']<=_0x286d7e+_0x5b927b&&_0x9606f1['right']>=-0xc8&&_0x9606f1['left']<=_0x364459+_0x5b927b;}}const Or='ck-ai-chat__feed__context-chips',Nr='ck-ai-chat-context-chips-wrapper',Ur='ck-ai-chat-context-chips-wrapper-balloon',Wr='ck-ai-chat-controls-button',Yr='ck-ai-chat-controls_context_show-more-button',$r='ck-ai-chat-context-controls__show-more-balloon-panel';class _h extends _0xc3e5b1{['_contextChips']=this['createCollection']();['_overflowManager'];['_bodyCollection'];constructor(_0x2f0fce,_0x45d302,_0x492cfe){super(_0x2f0fce),this['_bodyCollection']=_0x492cfe,this['_createContextChips'](_0x45d302);const _0x2b195b={'cssClasses':{'showMoreButton':Yr,'showMoreBalloon':$r,'overflowContainer':Ur,'controlsButton':Wr}};this['_overflowManager']=new Io(_0x2f0fce,this['_contextChips'],_0x2b195b,this['_bodyCollection'],this),this['setTemplate']({'tag':'div','attributes':{'class':[Or,'ck','ck-reset_all']},'children':[{'tag':'div','attributes':{'class':Nr},'children':this['_contextChips']}]});}['render'](){super['render']();const _0x32e04c=this['element']['querySelector']('.'+Nr);_0x32e04c&&(this['_overflowManager']['setContainerElement'](_0x32e04c),this['_overflowManager']['reorganizeChips']());}['destroy'](){super['destroy'](),this['_overflowManager']['destroy']();}['_createContextChips'](_0x5cbd3c){for(const _0x4f9105 of _0x5cbd3c){const _0x5c23f1=new vo(this['locale'],_0x4f9105,!0x0,!0x1);this['_contextChips']['add'](_0x5c23f1);}}}class Ge extends Fr{['_contextChipsView']=null;['_locale'];['_bodyCollection'];['_messageContentView'];constructor(_0x4b5e74,_0x107a47,_0x679bb4){super(_0x107a47),this['_locale']=_0x4b5e74,this['_bodyCollection']=_0x679bb4,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'](_0x18194b=>!_0x18194b['hidden']),this['_bodyCollection']),this['_contextChipsView']['extendTemplate']({'attributes':{'class':'ck-ai-chat__feed__context-chips'}}),this['children']['add'](this['_contextChipsView']));}['_createMessageContentView'](){this['_messageContentView']=new _0xc3e5b1(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 Ct extends Fr{['capabilities'];constructor(_0x5eecb5,_0x302648){super(_0x302648);const {isWebSearchEnabled:_0x5d733d,isReasoningEnabled:_0x14d26e}=_0x302648['capabilities'],_0x51fbd5=[];let _0x3975fb='';_0x5d733d&&_0x14d26e?(_0x3975fb=i(_0x5eecb5,'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH_REASONING'),_0x51fbd5['push'](aa(_0xd8346c)),_0x51fbd5['push'](aa(_0xd8dd72))):_0x5d733d?(_0x3975fb=i(_0x5eecb5,'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH'),_0x51fbd5['push'](aa(_0xd8346c))):_0x14d26e&&(_0x3975fb=i(_0x5eecb5,'AI_CHAT_FEED_REPLY_ITEM_USED_REASONING'),_0x51fbd5['push'](aa(_0xd8dd72))),this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__interaction-header',_0x3975fb?'':'ck-hidden']}});const _0x209698=new _0xc3e5b1();_0x209698['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__interaction-header__capabilities']},'children':[..._0x51fbd5,{'tag':'span','attributes':{'class':['ck-ai-chat__feed__interaction-header__capabilities__text']},'children':[_0x3975fb]}]}),this['children']['add'](_0x209698),this['capabilities']=_0x302648['capabilities'];}}function aa(_0x2e5f43){const _0x111bb4=new _0x59b3d9();return _0x111bb4['content']=_0x2e5f43,_0x111bb4;}const Fs=['wheel','touchstart','pointerdown','keydown'],Us=['ArrowUp','ArrowDown','PageUp','PageDown','Home','End','\x20'];class Qe{['element'];['animationFrameId'];['isRunning'];['abortController'];['isUserPaused'];constructor(_0x3fb3c0){this['element']=_0x3fb3c0,this['animationFrameId']=null,this['isRunning']=!0x1,this['abortController']=new AbortController(),this['isUserPaused']=!0x1;for(const _0x3f6a56 of Fs){const _0x518f72='keydown'!==_0x3f6a56;this['element']['addEventListener'](_0x3f6a56,this['_onUserEvent']['bind'](this),{'passive':_0x518f72,'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'](_0x2e0882){if(this['isRunning']){if('keydown'===_0x2e0882['type']){const _0x26b902=_0x2e0882['key'];if(!Us['includes'](_0x26b902))return;}_0x2e0882 instanceof WheelEvent?_0x2e0882['deltaY']<0x0?this['isUserPaused']=!0x0:this['isUserPaused']=!this['_isAtBottom']():this['isUserPaused']=!0x0;}}['_isAtBottom'](){const {scrollTop:_0x3681ed,scrollHeight:_0x33282b,clientHeight:_0x2989e0}=this['element'];return _0x33282b-_0x3681ed-_0x2989e0<=0x5;}['_rafUpdate'](){this['isRunning']&&(this['isUserPaused']||this['element']['scrollTo']({'top':this['element']['scrollHeight'],'behavior':'auto'}),this['animationFrameId']=requestAnimationFrame(this['_rafUpdate']['bind'](this)));}}class Xe extends _0xc3e5b1{constructor(_0x506561,_0x2f2294){super(_0x506561),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-skeleton']},'children':this['_createSkeletonItems'](_0x2f2294)});}['_createSkeletonItems'](_0x110212){const _0x45d924=['ck','ck-ai-skeleton__item'];return _0x110212['map'](_0x1052f8=>{let _0x145889='';switch(_0x1052f8['attributes']['align']){case'right':_0x145889='margin-left:\x20auto;\x20margin-right:\x200;\x20text-align:\x20right;';break;case'center':_0x145889='margin-left:\x20auto;\x20margin-right:\x20auto;\x20text-align:\x20center;';break;case'left':_0x145889='margin-left:\x200;\x20margin-right:\x20auto;\x20text-align:\x20left;';}return{'tag':_0x1052f8['tag'],'attributes':{'class':[..._0x45d924,_0x1052f8['attributes']['class']?_0x1052f8['attributes']['class']:''],'style':'width:\x20'+_0x1052f8['attributes']['width']+';\x20height:\x20'+_0x1052f8['attributes']['height']+';'+_0x145889}};});}}const Ye={'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(_0x4511e0,_0x565ddd,_0x3e49b6,_0x417c19){return new Array(_0x4511e0)['fill'](null)['map'](()=>({'tag':'div','attributes':{'width':_0x565ddd,'height':_0x3e49b6,'align':_0x417c19}}));}class $e extends Fr{constructor(_0x38efbf){super(_0x38efbf),this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__custom-element']}});}async['render'](){super['render'](),'string'==typeof this['options']['content']?this['element']['innerHTML']=this['options']['content']:this['element']['appendChild'](this['options']['content']);}}class di extends _0xc3e5b1{['children'];['scrollManager'];['_bodyCollection'];constructor(_0x4c25d1,_0x101320){super(_0x4c25d1),this['_bodyCollection']=_0x101320,this['set']('isPending',!0x1),this['set']('loadingMessage',''),this['set']('isLoadingSkeletonVisible',!0x1),this['set']('isTrackChangesOn',!0x1),this['children']=this['createCollection'](),this['children']['delegate'](...Rt)['to'](this),this['_setupTemplate']();}['render'](){super['render'](),this['scrollManager']=new Qe(this['element']);}['destroy'](){super['destroy'](),this['scrollManager']['destroy']();}['clear'](){this['children']['clear']();}['addItem'](_0x5e2f3c,_0x4d9bff){let _0x3a7246;return'ai-reply'===_0x5e2f3c?_0x3a7246=new qe(this['locale'],_0x4d9bff,this['_bodyCollection']):'ai-suggestion-reply'===_0x5e2f3c?(_0x3a7246=new Be(this['locale'],_0x4d9bff,this['_bodyCollection']),_0x3a7246['bind']('isTrackChangesOn')['to'](this)):_0x3a7246='user-message'===_0x5e2f3c?new Ge(this['locale'],_0x4d9bff,this['_bodyCollection']):'interaction-header'===_0x5e2f3c?new Ct(this['locale'],_0x4d9bff):'custom-element'===_0x5e2f3c?new $e(_0x4d9bff):new Ke(_0x4d9bff),this['children']['add'](_0x3a7246),_0x3a7246;}async['updateReplyItem']({id:_0x460e70,parsedContent:_0x27555b,renderingStrategy:_0x455a39,abortSignal:_0x27b087}){const _0x502e50=this['getItemById'](_0x460e70);if(!(_0x502e50 instanceof qe))throw new _0x563e6a('ai-chat-feed-view-item-not-a-reply-item',null,{'itemView':_0x502e50,'id':_0x460e70,'parsedContent':_0x27555b});await _0x502e50['updateContent']({'parsedContent':_0x27555b,'renderingStrategy':_0x455a39,'abortSignal':_0x27b087});}async['updateWebSources'](_0x190537,_0x305fb6){const _0x3793cd=this['getItemById'](_0x190537);if(_0x3793cd instanceof Be)_0x3793cd['updateSources'](_0x305fb6);else{if(!(_0x3793cd instanceof qe))throw new _0x563e6a('ai-chat-feed-view-item-not-a-suggestion-or-reply-item',null,{'itemView':_0x3793cd,'id':_0x190537,'sources':_0x305fb6});_0x3793cd['updateSources'](_0x305fb6);}}async['updateSuggestionItem']({id:_0x1e3906,parts:_0x46e941,renderingStrategy:_0x4b4735,abortSignal:_0x1f094f}){const _0x25fadf=this['getItemById'](_0x1e3906);if(!(_0x25fadf instanceof Be))throw new _0x563e6a('ai-chat-feed-view-item-not-a-suggestion-item',null,{'itemView':_0x25fadf,'id':_0x1e3906,'parts':_0x46e941});await _0x25fadf['updateContent']({'parts':_0x46e941,'renderingStrategy':_0x4b4735,'abortSignal':_0x1f094f});}['updateSuggestionPartState']({id:_0x2ea8a8,index:_0x3d1d83,state:_0x55b355}){const _0x242d5a=this['getItemById'](_0x2ea8a8);if(!(_0x242d5a instanceof Be))throw new _0x563e6a('ai-chat-feed-view-item-not-a-suggestion-item',this,{'id':_0x2ea8a8});_0x242d5a['updatePartState'](_0x3d1d83,_0x55b355);}['setSuggestionPartActive']({id:_0x5231e7,index:_0x219b9d,isActive:_0x190f9d}){const _0xc3241d=this['getItemById'](_0x5231e7);if(!(_0xc3241d instanceof Be))throw new _0x563e6a('ai-chat-feed-view-item-not-a-suggestion-item',this,{'id':_0x5231e7});this['children']['filter'](_0x2f98d1=>_0x2f98d1 instanceof Be)['forEach'](_0x5ea295=>{_0x5ea295['setPartActive'](!0x1);}),_0xc3241d['setPartActive'](_0x219b9d,_0x190f9d);}['markItemAsDone'](_0x18df6c){this['getItemById'](_0x18df6c)['markAsDone']();}['getItemIds'](){return this['children']['map'](_0x71740e=>_0x71740e['options']['id']);}['removeItem'](_0x5dba64){this['children']['remove'](this['getItemById'](_0x5dba64));}['hasItem'](_0x91283e){return!!this['children']['find'](_0x20bb64=>_0x20bb64['options']['id']['includes'](_0x91283e));}['scrollToSuggestion'](_0x3e5c13,_0x541af0){const _0x1c0125=this['getItemById'](_0x3e5c13);if(!(_0x1c0125 instanceof Be))return void _0xa8aac2('ck-ai-chat-feed-view-scroll-to-suggestion-invalid-item',{'replyId':_0x3e5c13,'partIndex':_0x541af0});const _0xa58dcf=_0x1c0125['getPartView'](_0x541af0);_0xa58dcf?_0x54a145(_0xa58dcf['element'],0x14,this['element']['parentElement'],!0x0,!0x0):_0xa8aac2('ck-ai-chat-feed-view-scroll-to-suggestion-part-view-not-found',{'replyId':_0x3e5c13,'partIndex':_0x541af0});}['_setupTemplate'](){this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed']},'children':this['_createTemplateChildren']()});}['_createTemplateChildren'](){const _0x407867=this['_createSkeletonLoader']();return[this['_createFeedItems'](),_0x407867,this['_createFeedLoader']()];}['_createSkeletonLoader'](){const _0x432923=new Xe(this['locale'],Ye['aiFeed']);return _0x432923['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isLoadingSkeletonVisible','ck-hidden',_0x5c4756=>!_0x5c4756)]}}),_0x432923;}['_createFeedItems'](){const _0x1be631=new _0xc3e5b1(this['locale']);return _0x1be631['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__items',this['bindTemplate']['if']('isLoadingSkeletonVisible','ck-hidden')]},'children':this['children']}),_0x1be631;}['_createFeedLoader'](){const _0x29fbd3=new _0xc3e5b1(this['locale']);return _0x29fbd3['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__loader',this['bindTemplate']['if']('isPending','ck-hidden',_0xc3d1d9=>!_0xc3d1d9)]},'children':this['_createLoaderChildren']()}),_0x29fbd3;}['_createLoaderChildren'](){const _0xd3b4e6=new Ze();return _0xd3b4e6['isVisible']=!0x0,[_0xd3b4e6,{'tag':'span','attributes':{'class':['ck','ck-ai-chat__loader-text']},'children':[{'text':this['bindTemplate']['to']('loadingMessage')}]}];}['getItemById'](_0x1473d5){const _0x516e75=this['children']['find'](_0x5f2c59=>_0x5f2c59['options']['id']['includes'](_0x1473d5));if(!_0x516e75)throw new _0x563e6a('ai-chat-feed-view-item-not-found',this,{'id':_0x1473d5});return _0x516e75;}['setLoadingMessage'](_0x51ad78){this['set']('loadingMessage',_0x51ad78);}['toggleLoadingSkeleton'](_0x2e2f30){this['set']('isLoadingSkeletonVisible',_0x2e2f30);}['startAutoScroll'](){this['scrollManager']['start']();}['stopAutoScroll'](){this['scrollManager']['stop']();}}class nh extends _0x163c9e{['filter'](){let _0x338b7c=0x0;for(const _0x52a697 of this['items'])_0x338b7c+=_0x52a697['items']['length'];return{'resultsCount':_0x338b7c,'totalItemsCount':_0x338b7c};}}const ah='ck-ai-chat__prompt-input_highlighted';class cs extends _0xf03a68{['submitButtonView'];static ['MIN_ROWS']=0x1;static ['MAX_ROWS']=0xc;['_addContextButtonView'];['_queryViewResizeObserver'];constructor(_0x5bea9b,_0x29ea1d){super(_0x5bea9b,{'queryView':{'label':'','creator':_0xbfd767,'showIcon':!0x1,'showResetButton':!0x1},'filteredView':new nh(_0x5bea9b),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1}),this['set']('isEmpty',!0x0),this['set']('isUploadInProgress',!0x1),this['_addContextButtonView']=_0x29ea1d,this['_queryViewResizeObserver']=null,this['queryView']['fieldView']['minRows']=cs['MIN_ROWS'],this['queryView']['fieldView']['maxRows']=cs['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',(_0x141ad6,_0x2ab647)=>!_0x141ad6&&!_0x2ab647),this['focusableChildren']['add'](this['submitButtonView']);}['render'](){super['render'](),this['queryView']['fieldWrapperChildren']['add'](this['submitButtonView']),this['keystrokes']['set']('enter',(_0x346729,_0x50d6b9)=>{this['isUploadInProgress']||this['isEmpty']||_0x346729['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0x50d6b9());}),this['queryView']['fieldView']['on']('update',()=>{this['isEmpty']=''===this['queryView']['fieldView']['element']['value']?.['trim']();});}['destroy'](){super['destroy'](),this['_queryViewResizeObserver']&&this['_queryViewResizeObserver']['destroy']();}['submit'](){const _0xc20a62=this['queryView']['fieldView']['element']['value']?.['trim']();if(!_0xc20a62)return this['queryView']['errorText']=i(this['locale'],'AI_CHAT_PROMPT_EMPTY_ERROR'),void(this['queryView']['fieldView']['hasError']=!0x0);this['queryView']['fieldView']['hasError']=!0x1;const _0x528b46=_0x528e40(_0xc20a62);this['fire']('sendUserMessage',_0x528b46),this['queryView']['fieldView']['reset']();}['setPlaceholderText'](_0x305882){this['queryView']['fieldView']['set']('placeholder',_0x305882);}['focus'](_0x228e8b=!0x1){super['focus'](),_0x228e8b&&(this['element']['classList']['contains'](ah)||(this['element']['classList']['add'](ah),setTimeout(()=>{this['element']['classList']['remove'](ah);},0x320)));}['_createSubmitButton'](){const _0x44377b=new _0x2cf640(this['locale']);return _0x44377b['set']({'icon':_0x40c783,'label':i(this['locale'],'AI_CHAT_LABEL_SUBMIT'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-chat__prompt-submit-button','isEnabled':!0x1}),_0x44377b['on']('execute',()=>{this['submit']();}),_0x44377b;}['setIsUploadInProgress'](_0x201d86){this['isUploadInProgress']=_0x201d86;}['_setUpAddContextButtonPositioning'](){const _0x30a01b=this['locale'],_0x5cceda=()=>{_0x44426a['window']['requestAnimationFrame'](()=>{if(_0x334b9e(this['element'])){const _0x54118d=new _0x4b725e(this['queryView']['fieldView']['element']),_0x3d60a7=new _0x4b725e(this['_addContextButtonView']['element']),_0x2e7d7d=_0x54118d['width'],_0x4b15ed='rtl'===_0x30a01b['uiLanguageDirection']?'right':'left';_0x54118d['excludeScrollbarsAndBorders']();const _0x2e2f0f=_0x2e7d7d-_0x54118d['width']+0x1;this['_addContextButtonView']['element']['style'][_0x4b15ed]='calc('+(_0x2e7d7d-_0x3d60a7['width']-_0x2e2f0f)+'px\x20-\x20var(--ck-spacing-tiny))';}});};this['queryView']['fieldView']['on']('update',_0x5cceda),this['on']('render',()=>{_0x5cceda(),this['_queryViewResizeObserver']=new _0x592694(this['queryView']['fieldView']['element'],()=>{_0x5cceda();});});}}const Qr='ck-ai-chat__prompt-capabilities',Xr='ck-ai-chat-controls-button',Zr='ck-ai-chat-controls-button--commands',la='ck-ai-button-tertiary',ua='ck-ai-chat-controls__model-selection',da='ck-ai-chat-controls__model-selection__item-name',_a='ck-ai-chat-controls__model-selection__item-description',Aa='ck-ai-chat-controls__model-selection__item-capabilities',Ia='n';class rs extends _0xc3e5b1{['_webSearchButton'];['_reasoningButton'];['_commandsButton'];['_modelSelectionDropdown'];['_modelSelectionDropdownItems'];['_modelNameView'];constructor(_0x42b47e){super(_0x42b47e),this['set']('webSearchActive',!0x1),this['set']('reasoningActive',!0x1),this['set']('modelDisplayMode','selector'),this['set']('modelSelectorEnabled',!0x0),this['set']('activeModelId',null),this['set']('activeModelName',null),this['_modelSelectionDropdown']=this['_createModelSelectionDropdown'](),this['_modelNameView']=this['_createModelNameView'](),this['_webSearchButton']=this['_createWebSearchButton'](),this['_reasoningButton']=this['_createReasoningButton'](),this['_commandsButton']=this['_createCommandsButton'](),this['_modelSelectionDropdown']['buttonView']['bind']('isVisible')['to'](this,'modelDisplayMode',_0x3d9a8b=>'selector'===_0x3d9a8b),this['_modelSelectionDropdown']['buttonView']['bind']('tooltip')['to'](this,'modelSelectorEnabled',_0x26bdbc=>_0x26bdbc?this['_modelSelectionDropdown']['buttonView']['label']:i(this['locale'],'AI_CHAT_MODEL_SELECTOR_DISABLED_TOOLTIP')),this['_modelSelectionDropdown']['bind']('isEnabled')['to'](this,'modelSelectorEnabled',_0x58eb25=>_0x58eb25),this['_webSearchButton']['bind']('isOn')['to'](this,'webSearchActive',_0x16bc75=>_0x16bc75),this['_webSearchButton']['bind']('tooltip')['to'](this,'webSearchActive',_0x12ef46=>i(this['locale'],_0x12ef46?'AI_CHAT_DISABLE_WEB_SEARCH':'AI_CHAT_ENABLE_WEB_SEARCH')),this['_reasoningButton']['bind']('isOn')['to'](this,'reasoningActive',_0x494ddc=>_0x494ddc),this['_reasoningButton']['bind']('tooltip')['to'](this,'reasoningActive',_0x424e0d=>i(this['locale'],_0x424e0d?'AI_CHAT_DISABLE_REASONING':'AI_CHAT_ENABLE_REASONING')),this['setTemplate']({'tag':'div','attributes':{'class':[Qr]},'children':[this['_modelSelectionDropdown'],this['_modelNameView'],this['_webSearchButton'],this['_reasoningButton'],this['_commandsButton']]}),this['_modelSelectionDropdownItems']=new _0x7916ba(),_0x5aa31c(this['_modelSelectionDropdown'],this['_modelSelectionDropdownItems']);}['setModelList'](_0x5790f2,_0x540848){if(_0x540848)this['set']('modelDisplayMode','hidden');else{const _0x3508b3=0x1===_0x5790f2['length'];this['set']('modelDisplayMode',_0x3508b3?'name':'selector');}if(this['_modelSelectionDropdownItems']['clear'](),_0x5790f2?.['length'])for(const _0x8259fa of _0x5790f2){const _0xbaaa0e=new _0x201273({'label':_0x8259fa['name'],'withText':!0x0,'role':'menuitemradio','id':_0x8259fa['id'],'model':_0x8259fa});_0xbaaa0e['bind']('isOn')['to'](this,'activeModelId',_0x3cdf4d=>_0x3cdf4d===_0x8259fa['id']),this['_modelSelectionDropdownItems']['add']({'type':'button','model':_0xbaaa0e,'labelView':new ga(this['locale'],_0x8259fa)});}}['setWebSearch'](_0x3a0225){this['set']('webSearchActive',_0x3a0225);}['setReasoning'](_0x48af50){this['set']('reasoningActive',_0x48af50);}['setModel'](_0x40e996){if(!_0x40e996)return;this['activeModelId']=_0x40e996['id'],this['activeModelName']=_0x40e996['name']||_0x40e996['id'],this['_modelSelectionDropdown']['buttonView']['set']('label',_0x40e996['name']),this['_modelSelectionDropdown']['buttonView']['set']('tooltip',_0x40e996['name']);const _0x23bf1b=_0x40e996['capabilities']['webSearch']?.['enabled']??!0x1;this['set']('webSearchActive',!0x1),this['_webSearchButton']['set']('isOn',!0x1),this['_webSearchButton']['set']('isEnabled',_0x23bf1b),this['_webSearchButton']['set']('isVisible',_0x23bf1b);const _0x866e0e=_0x40e996['capabilities']['reasoning']?.['enabled']??!0x1;this['set']('reasoningActive',!0x1),this['_reasoningButton']['set']('isOn',!0x1),this['_reasoningButton']['set']('isEnabled',_0x866e0e),this['_reasoningButton']['set']('isVisible',_0x866e0e);}['enableModelSelector'](){this['set']('modelSelectorEnabled',!0x0);}['disableModelSelector'](_0x421109){this['set']('modelSelectorEnabled',!0x1),_0x421109&&this['set']('modelDisplayMode','hidden');}['_createWebSearchButton'](){const _0x170fa6=new _0x2cf640();return _0x170fa6['set']({'label':i(this['locale'],'AI_CHAT_SEARCH_WEB'),'icon':_0xd8346c,'class':Xr,'isToggleable':!0x0,'tooltipPosition':Ia}),_0x170fa6['on']('execute',()=>{this['fire']('toggleWebSearch');}),_0x170fa6;}['_createReasoningButton'](){const _0x2f5b47=new _0x2cf640();return _0x2f5b47['set']({'label':i(this['locale'],'AI_CHAT_REASONING'),'icon':_0xd8dd72,'class':Xr,'isToggleable':!0x0,'tooltipPosition':Ia}),_0x2f5b47['on']('execute',()=>{this['fire']('toggleReasoning');}),_0x2f5b47;}['_createCommandsButton'](){const _0x5e8db7=new _0x2cf640();return _0x5e8db7['set']({'label':i(this['locale'],'AI_CHAT_COMMANDS'),'icon':_0x51d4bb,'withText':!0x0,'class':Xr,'isToggleable':!0x0,'tooltip':i(this['locale'],'AI_CHAT_COMMANDS'),'tooltipPosition':Ia}),_0x5e8db7['extendTemplate']({'attributes':{'class':[Zr]}}),_0x5e8db7['on']('execute',()=>{console['log']('Commands\x20are\x20not\x20implemented\x20yet.'),alert('Commands\x20are\x20not\x20implemented\x20yet.');}),_0x5e8db7;}['_createModelSelectionDropdown'](){const _0x95ca1b=_0x3e48f8(this['locale']);return _0x95ca1b['set']({'panelPosition':'ne','class':[ua]}),_0x95ca1b['buttonView']['set']({'label':i(this['locale'],'AI_CHAT_MODEL_SELECTOR_ENABLED_TOOLTIP'),'withText':!0x0,'tooltip':!0x0,'tooltipPosition':Ia,'class':la}),this['listenTo'](_0x95ca1b,'execute',_0x6c0523=>{this['fire']('selectModel',_0x6c0523['source']['model']);}),_0x95ca1b;}['_createModelNameView'](){const _0x45e4a2=new Ca(this['locale']);return _0x45e4a2['bind']('text')['to'](this,'activeModelName',_0x3a03d4=>_0x3a03d4??''),_0x45e4a2['bind']('isVisible')['to'](this,'modelDisplayMode',_0x14b0fb=>'name'===_0x14b0fb),_0x45e4a2;}}let ga=class ModelButtonLabelView extends _0x23a78e{constructor(_0x312a9d,_0x34be0b){super();const _0x1d0db2=this['bindTemplate'],_0x417416=this['createCollection']();this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-button__label'],'style':_0x1d0db2['to']('style'),'id':_0x1d0db2['to']('id')},'children':[{'tag':'div','attributes':{'class':[da]},'children':[{'text':_0x1d0db2['to']('text')}]},{'tag':'div','attributes':{'class':[_a]},'children':[{'tag':'span','children':[{'text':_0x34be0b['description']}]}]},{'tag':'div','attributes':{'class':[Aa]},'children':_0x417416}]}),_0x417416['addMany'](this['_getCapabilityParts'](_0x312a9d,_0xd8346c,'AI_CHAT_SEARCH_WEB',_0x34be0b['capabilities']['webSearch']?.['enabled']??!0x1)),_0x417416['addMany'](this['_getCapabilityParts'](_0x312a9d,_0xd8dd72,'AI_CHAT_REASONING',_0x34be0b['capabilities']['reasoning']?.['enabled']??!0x1));}['_getCapabilityParts'](_0x39ada6,_0x137287,_0x5e7468,_0x424852){const _0xd3abd1=new _0x59b3d9();_0xd3abd1['content']=_0x137287;const _0x8f875f=new _0xc3e5b1(_0x39ada6);_0x8f875f['setTemplate']({'tag':'span','children':[{'text':i(_0x39ada6,_0x5e7468)+':\x20'}]});const _0x5161d4=new _0xc3e5b1(_0x39ada6);return _0x5161d4['setTemplate']({'tag':'span','children':[{'text':i(_0x39ada6,_0x424852?'AI_CHAT_CAPABILITIES_YES':'AI_CHAT_CAPABILITIES_NO')}]}),[_0xd3abd1,_0x8f875f,_0x5161d4];}},Ca=class ModelNameView extends _0xc3e5b1{constructor(_0x210d1b){super(_0x210d1b),this['set']('text',void 0x0),this['set']('isVisible',!0x0);const _0x350b73=this['bindTemplate'];this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-chat-controls__model-name',_0x350b73['if']('isVisible','ck-hidden',_0x5d5041=>!_0x5d5041)]},'children':[{'text':_0x350b73['to']('text')}]});}};const Ea='ck-ai-chat-context-controls__url-form',pa='ck-ai-chat-context-controls__url-input-section';class Vo extends _0xc3e5b1{['focusTracker'];['keystrokes'];['_focusables'];['focusCycler'];['urlInputField'];['backButton'];['confirmButton'];constructor(_0x20495b){super(_0x20495b),this['focusTracker']=new _0x5f2dfb(),this['keystrokes']=new _0x15425(),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 _0x1af4a5({'focusables':this['_focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes'],'actions':{'focusPrevious':'shift+tab','focusNext':'tab'}}),this['set']('withBackButton',!0x0),this['_setupTemplate'](),this['_setupEventHandlers'](),this['_setupKeystrokes']();}['render'](){super['render'](),this['_focusables']['forEach'](_0x21daf4=>{this['focusTracker']['add'](_0x21daf4['element']),this['keystrokes']['listenTo'](_0x21daf4['element']);}),_0x28e7fc({'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'](_0xcb3ba6){this['urlInputField']['errorText']=_0xcb3ba6,this['_updateConfirmButtonState'](),this['fire']('refreshBalloon');}['clearError'](){this['urlInputField']['errorText']=null,this['_updateConfirmButtonState']();}['_createBackButton'](){const _0x15fce7=new _0x2cf640(this['locale']);return _0x15fce7['set']({'icon':_0x5d4f8c,'tooltip':i(this['locale'],'AI_CHAT_CONTEXT_URL_BACK_TO_CONTEXT'),'tooltipPosition':'n','class':['ck-button-icon\x20ck-button-back']}),this['on']('change:withBackButton',(_0x25c3a0,_0x6c2d11,_0x3020d4)=>{_0x15fce7['set']({'class':['ck-button-icon\x20ck-button-back'+(_0x3020d4?'':'\x20ck-hidden')]});}),_0x15fce7;}['_createUrlInputField'](){const _0x14cb80=new _0x16298f(this['locale'],th);return _0x14cb80['set']({'label':i(this['locale'],'AI_CHAT_CONTEXT_URL_LABEL'),'class':'ck-labeled-field-view_empty'}),_0x14cb80['fieldView']['set']({'placeholder':i(this['locale'],'AI_CHAT_CONTEXT_URL_PLACEHOLDER')}),_0x14cb80;}['_createConfirmButton'](){const _0x440b6=new _0x2cf640(this['locale']);return _0x440b6['set']({'icon':_0x2b7211,'tooltip':i(this['locale'],'AI_CHAT_CONTEXT_URL_ADD_URL'),'tooltipPosition':'n','class':'ck-button-icon','type':'submit','isEnabled':!0x1}),_0x440b6;}['_setupTemplate'](){const _0xfc8b85=new _0x1e299f(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'});_0xfc8b85['children']['add'](this['backButton'],0x0),this['setTemplate']({'tag':'form','attributes':{'class':Ea,'tabindex':'-1'},'children':[_0xfc8b85,{'tag':'div','attributes':{'class':pa},'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',_0x2cdf93=>{_0x2cdf93['stop'](),this['_handleSubmit']();});}['_setupKeystrokes'](){this['keystrokes']['set']('esc',(_0x4511f9,_0x2bec9b)=>{this['clear'](),this['fire']('cancel'),_0x2bec9b();});}['_handleSubmit'](){const _0x1970a5=this['getValue']()['trim']();_0x1970a5?this['_isValidUrl'](_0x1970a5)?(this['clearError'](),this['fire']('submitUrl',_0x1970a5)):this['setError'](i(this['locale'],'AI_CHAT_CONTEXT_URL_INVALID_ERROR')):this['setError'](i(this['locale'],'AI_CHAT_CONTEXT_URL_EMPTY_ERROR'));}['_updateConfirmButtonState'](){const _0xd01727=this['getValue']()['trim'](),_0x517796=!!this['urlInputField']['errorText'];this['confirmButton']['isEnabled']=_0xd01727['length']>0x0&&!_0x517796;}['_isValidUrl'](_0x54f4dc){try{return!!new URL(_0x54f4dc);}catch{return!0x1;}}}const Ta='ck-ai-chat-resources__item',ma='ck-ai-chat-resources__item--in-context',wa='ck-ai-chat-resources__item-title',fa='ck-ai-chat-resources__item__icon';class hc extends _0x663ac1{['resource'];['_titleView'];['_iconView'];constructor(_0x4995ee,_0x37a4e9){super(_0x4995ee),this['resource']=_0x37a4e9,this['set']('isInContext',!!_0x37a4e9['isInContext']),this['_titleView']=this['_createTitleView'](),this['_iconView']=this['_createIconView'](),this['_setupTemplate']();}['render'](){super['render']();}['getResourceIcon'](_0x36b4e6){if(_0x36b4e6['isInContext'])return _0x2b7211;switch(_0x36b4e6['type']){case xe['DOCUMENT']:return _0x2ff8c2;case xe['URL']:return _0xa0ac3e;case xe['FILE']:case xe['TEXT']:return _0x4d62fe;default:return _0x5313d0;}}['highlightText'](_0x961bbc){if(!_0x961bbc||''===_0x961bbc['trim']())return void this['_titleView']['highlightText'](null);const _0x383a55=new RegExp(_0x15b1ec(_0x961bbc),'gi');this['_titleView']['highlightText'](_0x383a55);}['updateResourceState'](_0xba2365){this['resource']['isInContext']=_0xba2365,this['isInContext']=_0xba2365,this['_updateIcon']();}['_createTitleView'](){const _0x1de1a0=new _0x19afdf();return _0x1de1a0['text']=this['resource']['label'],_0x1de1a0['extendTemplate']({'tag':'span','attributes':{'class':[wa]}}),_0x1de1a0;}['_createIconView'](){const _0x240cdc=new _0x59b3d9();return _0x240cdc['content']=this['getResourceIcon'](this['resource']),_0x240cdc;}['_setupTemplate'](){const _0x10d455=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':[Ta,_0x10d455['if']('isVisible','ck-hidden',_0x35bb7e=>!_0x35bb7e),_0x10d455['if']('isInContext',ma)]},'children':[{'tag':'div','attributes':{'class':[fa]},'children':[this['_iconView']]},this['_titleView']],'on':{'click':_0x10d455['to']('execute')}});}['_updateIcon'](){this['_iconView']['content']=this['getResourceIcon'](this['resource']);}}const Sa='ck-ai-chat-resources__list';class Lr extends _0x163c9e{['_source'];constructor(_0x44dd3a,_0x3ee963){super(_0x44dd3a),this['_source']=_0x3ee963,this['extendTemplate']({'attributes':{'class':[Sa]}});}['setResources'](_0xde6a10,_0x363790){this['items']['clear']();let _0x2c0da4=_0xde6a10;if(this['_source']['useDefaultFiltering']&&_0x363790&&''!==_0x363790['trim']()){const _0x5c3d03=new RegExp(_0x363790['replace'](/[.*+?^${}()|[\]\\]/g,'\x5c$&'),'gi');_0x2c0da4=_0xde6a10['filter'](_0x4f5bec=>_0x5c3d03['test'](_0x4f5bec['label']));}for(const _0x54cc9d of _0x2c0da4){const _0x50baae=new hc(this['locale'],_0x54cc9d);_0x50baae['on']('execute',()=>{this['_handleResourceSelection'](this['_source'],_0x54cc9d);}),this['items']['add'](_0x50baae);}this['_source']['useDefaultFiltering']&&this['highlightText'](_0x363790);}['highlightText'](_0x5a4c6e){this['_source']['useDefaultFiltering']&&this['items']['forEach'](_0x2b0694=>{_0x2b0694['highlightText'](_0x5a4c6e);});}['updateResourceState'](_0xf252e6,_0xce96d){for(const _0x51ca27 of this['items']){const _0xf550ff=_0x51ca27;_0xf550ff['resource']['id']===_0xf252e6&&_0xf550ff['updateResourceState'](_0xce96d);}}['_handleResourceSelection'](_0x50672d,_0x3e2757){this['fire']('addResourceToContext',{'source':_0x50672d,'resource':_0x3e2757});}}class Tr extends _0x16298f{['iconView'];['resetButtonView'];['_viewConfig'];constructor(_0x2a9731){const t=_0x2a9731['t'],_0x63be30={'showResetButton':!0x0,'showIcon':!0x0,'creator':th,'label':i(_0x2a9731,'AI_CHAT_SEARCH_RESOURCES')};super(_0x2a9731,_0x63be30['creator']),this['label']=_0x63be30['label'],this['_viewConfig']=_0x63be30,this['_viewConfig']['showIcon']&&this['_setupSearchIcon'](),this['_viewConfig']['showResetButton']&&this['_setupResetButton'](_0x2a9731,t),this['_setupEventListeners']();}['reset'](){this['fieldView']['reset'](),this['_viewConfig']['showResetButton']&&this['resetButtonView']&&(this['resetButtonView']['isVisible']=!0x1),this['search']('');}['search'](_0x15ea79){this['fire']('search',_0x15ea79);}['getQuery'](){return this['fieldView']['element']?.['value']||'';}['_setupSearchIcon'](){this['iconView']=new _0x59b3d9(),this['iconView']['content']=_0x4c94fe,this['fieldWrapperChildren']['add'](this['iconView'],0x0),this['extendTemplate']({'attributes':{'class':'ck-search__query_with-icon'}});}['_setupResetButton'](_0x64f4d2,t){this['resetButtonView']=new _0x2cf640(_0x64f4d2),this['resetButtonView']['set']({'label':t('Clear'),'icon':_0x4718d2,'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',_0x404878=>!_0x404878),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 lc extends _0xc3e5b1{['_searchView'];['_searchSection'];['_searchInputVisibleFrom'];['_resourcesListView'];['_skeletonLoader'];['_source'];['children'];['_latestLoadResourcesUid']=null;constructor(_0x55c3a6,_0xde1a7d){super(_0x55c3a6),this['_source']=_0xde1a7d['source'],this['_searchInputVisibleFrom']=_0xde1a7d['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 _0xf5a45d([this['_skeletonLoader'],this['_resourcesListView']]),this['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-chat-resources'},'children':this['children']});}['_createSearchView'](){return new Tr(this['locale']);}['_createSearchSection'](){const _0x4289b9=new _0xc3e5b1(this['locale']);return _0x4289b9['setTemplate']({'tag':'div','attributes':{'class':'ck\x20ck-search'},'children':[this['_searchView']]}),this['_searchView']['on']('search',(_0x55e9bc,_0x18a41f)=>{this['loadResources'](_0x18a41f),this['_source']['useDefaultFiltering']&&this['_resourcesListView']['highlightText'](_0x18a41f);}),_0x4289b9;}['_createResourcesListView'](){const _0x9c438b=new Lr(this['locale'],this['_source']);return _0x9c438b['delegate']('addResourceToContext')['to'](this),_0x9c438b['extendTemplate']({'attributes':{'class':this['bindTemplate']['if']('isLoading','ck-hidden')}}),_0x9c438b;}['_createSkeletonView'](){const _0x16be19=new Xe(this['locale'],Ye['aiChatResources']);return _0x16be19['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isLoading','ck-hidden',_0x2c8cd5=>!_0x2c8cd5)]}}),_0x16be19;}['render'](){super['render'](),this['loadResources']('');}['loadResources'](_0x275cfe){const _0x552196=_0x48eb5e();this['_latestLoadResourcesUid']=_0x552196,this['fire']('loadSourceResources',{'sourceId':this['_source']['id'],'query':_0x275cfe,'uid':_0x552196}),this['isLoading']=!0x0;}['setResources'](_0x202511,_0x3ef417){if(_0x3ef417&&_0x3ef417!==this['_latestLoadResourcesUid'])return;const _0x4e7f52=this['_source']['useDefaultFiltering']?this['_searchView']['getQuery']():'';this['_resourcesListView']['setResources'](_0x202511,_0x4e7f52),_0x202511['length']>=this['_searchInputVisibleFrom']&&!this['children']['has'](this['_searchSection'])&&this['children']['add'](this['_searchSection'],0x0),requestAnimationFrame(()=>{this['isLoading']=!0x1;});}['updateResourceState'](_0x5a18f3,_0x31a6ab){this['_resourcesListView']['updateResourceState'](_0x5a18f3,_0x31a6ab);}}const Ra='ck-ai-chat-context-controls__source-balloon-panel',ba='ck-button-icon\x20ck-button-back',Oa='ck-ai-header\x20ck-ai-header_small\x20ck-ai-header_source';class Po{['_sourceResourceBalloons']=new Map();['_bodyCollection'];['_locale'];['_config'];constructor(_0x107ec9,_0x3e7393,_0x33d77b){this['_locale']=_0x107ec9,this['_bodyCollection']=_0x3e7393,this['_config']=_0x33d77b;}['showSourceResourcesBalloon']({source:_0x5d459f,withBackButton:_0x50ba5c}){let _0x34fc48=this['_sourceResourceBalloons']['get'](_0x5d459f['id']);_0x34fc48||(_0x34fc48=this['_createSourceResourceBalloonPanel'](),this['_sourceResourceBalloons']['set'](_0x5d459f['id'],_0x34fc48),this['_setupSingleResourceBalloonClickOutsideHandler'](_0x34fc48)),this['_addSourceResourceContent']({'balloonPanel':_0x34fc48,'source':_0x5d459f,'withBackButton':_0x50ba5c}),_0x34fc48['show']();const _0xcf82fc=this['_config']['getTargetElement']();_0xcf82fc&&_0x34fc48['pin']({'target':_0xcf82fc,'limiter':this['_config']['getLimiterElement']()});}['populateSourceResourceBalloon'](_0x14a1e7,_0x4e0b13,_0x149c9f){const _0x405762=this['_sourceResourceBalloons']['get'](_0x14a1e7);if(!_0x405762)return;const _0x459fe6=this['_getResourcesViewFromBalloon'](_0x405762);_0x459fe6&&(_0x459fe6['setResources'](_0x4e0b13,_0x149c9f),_0x459fe6['once']('change:isLoading',()=>{_0x405762['pin']({'target':this['_config']['getTargetElement'](),'limiter':this['_config']['getLimiterElement']()});}));}['closeSourceResourceBalloon'](_0x403b4b){const _0x4cf3fa=this['_sourceResourceBalloons']['get'](_0x403b4b);_0x4cf3fa&&requestAnimationFrame(()=>{_0x4cf3fa['hide'](),this['_sourceResourceBalloons']['delete'](_0x403b4b),this['_config']['onBalloonClosed']();});}['isAnyResourceBalloonVisible'](){for(const _0x33e15a of this['_sourceResourceBalloons']['values']())if(_0x33e15a['isVisible'])return!0x0;return!0x1;}['updateResourceState'](_0x509de2,_0x50c630,_0x4e6cd0){const _0x171853=this['_sourceResourceBalloons']['get'](_0x509de2);if(!_0x171853||!_0x171853['isVisible'])return;const _0xde27c7=this['_config']['getTargetElement']();if(!_0xde27c7)return;_0x171853['pin']({'target':_0xde27c7,'limiter':this['_config']['getLimiterElement']()});const _0x39e3be=this['_getResourcesViewFromBalloon'](_0x171853);_0x39e3be&&_0x39e3be['updateResourceState'](_0x50c630,_0x4e6cd0);}['destroy'](){for(const _0xc53493 of this['_sourceResourceBalloons']['values']())_0xc53493['destroy']();this['_sourceResourceBalloons']['clear']();}['_createSourceResourceBalloonPanel'](){const _0x4bbd0d=new _0x5442ef(this['_locale']);return _0x4bbd0d['extendTemplate']({'attributes':{'class':Ra}}),this['_bodyCollection']['add'](_0x4bbd0d),_0x4bbd0d;}['_addSourceResourceContent']({balloonPanel:_0x539405,source:_0x3a5b0d,withBackButton:_0x1c0cb7}){_0x539405['content']['clear']();const _0x5100a2=this['_createBalloonHeader']({'balloonPanel':_0x539405,'source':_0x3a5b0d,'withBackButton':_0x1c0cb7});_0x539405['content']['add'](_0x5100a2);const _0x58b55e=this['_createBalloonResourcesView'](_0x3a5b0d);_0x539405['content']['add'](_0x58b55e);}['_createBalloonHeader']({balloonPanel:_0x54c178,source:_0x1c09a7,withBackButton:_0x580c35}){const _0x3bce9=new _0x1e299f(this['_locale'],{'label':_0x1c09a7['label'],'class':Oa});return _0x580c35&&_0x3bce9['children']['add'](this['_createBackButton'](_0x54c178),0x0),_0x3bce9;}['_createBackButton'](_0x545156){const _0x41fcf8=new _0x2cf640(this['_locale']);return _0x41fcf8['set']({'icon':_0x5d4f8c,'tooltip':i(this['_locale'],'AI_CHAT_CONTEXT_URL_BACK_TO_CONTEXT'),'tooltipPosition':'n','class':ba}),_0x41fcf8['on']('execute',()=>{_0x545156['hide'](),this['_config']['onBackToContext']();}),_0x41fcf8;}['_createBalloonResourcesView'](_0x20b59f){const _0x14304a=new lc(this['_locale'],{'source':_0x20b59f,'searchInputVisibleFrom':this['_config']['searchInputVisibleFrom']});return _0x14304a['on']('loadSourceResources',(_0x26c26f,_0x46337e)=>{this['_config']['onLoadSourceResources'](_0x46337e);}),_0x14304a['on']('addResourceToContext',(_0x2cac08,_0x3e5871)=>{this['_config']['onResourceSelected'](_0x3e5871['source'],_0x3e5871['resource']),this['closeSourceResourceBalloon'](_0x20b59f['id']);}),_0x14304a;}['_getResourcesViewFromBalloon'](_0x10a1a5){const _0x5af1b6=_0x10a1a5['content']['get'](0x1);return _0x5af1b6 instanceof lc?_0x5af1b6:null;}['_setupSingleResourceBalloonClickOutsideHandler'](_0x54b766){_0x1d212b({'emitter':_0x54b766,'contextElements':[_0x54b766['element']],'callback':()=>{_0x54b766['hide'](),this['_config']['onBalloonClosed']();},'activator':()=>_0x54b766['isVisible']});}}const ps=['addDocumentToContext','addFileToContext','addUrlToContext','addResourceToContext','removeContextItem','loadSourceResources','executeCustomItemCallback'],Ro='ck-ai-chat-context-controls',Oo='ck-ai-chat-context-controls__pending-contexts',Uo='ck-ai-chat-context-controls__add-context-balloon-panel',Lo='ck-ai-chat-context-controls__add-context-button',No='ck-ai-chat-context-controls__url-balloon-panel',Mo='ck-ai-chat-context-controls__balloon-button',Ho='ck-ai-chat-context-controls__balloon-button-source',jo='ck-ai-chat-controls-button',Fo='ck-ai-chat-context-chips-wrapper-balloon',Xo='ck-ai-chat-controls_context_show-more-button',yo='ck-ai-chat-context-controls__show-more-balloon-panel',Do='ck-ai-chat',$o=[_0x5442ef['defaultPositions']['northArrowSouthWest'],_0x5442ef['defaultPositions']['northArrowSouth'],_0x5442ef['defaultPositions']['northArrowSouthEast'],_0x5442ef['defaultPositions']['southArrowNorthWest'],_0x5442ef['defaultPositions']['southArrowNorth'],_0x5442ef['defaultPositions']['southArrowNorthEast']];class ls extends _0xc3e5b1{['addContextButtonView'];['_currentContextsChips']=this['createCollection']();['_conversationContextsChips']=this['createCollection']();['_overflowManager'];['_addContextBalloonPanelView'];['_urlBalloonPanelView'];['_urlInputView'];['_resourcesBalloonView'];['_addContextBalloonConfig'];['_hasExactlyOneSource']=!0x1;['bodyCollection'];constructor(_0x29d334,_0x1d70e6){super(_0x29d334),this['bodyCollection']=_0x1d70e6['bodyCollection'],this['_currentContextsChips']=this['createCollection'](),this['_conversationContextsChips']=this['createCollection'](),this['addContextButtonView']=this['_createAddContextButtonView'](_0x29d334),this['_addContextBalloonPanelView']=this['_createAddContextBalloonPanelView'](_0x29d334),this['_urlBalloonPanelView']=this['_createUrlBalloonPanelView'](_0x29d334),this['_resourcesBalloonView']=this['_createResourcesBalloonView'](_0x29d334,_0x1d70e6);const _0x5758b6={'cssClasses':{'showMoreButton':Xo,'showMoreBalloon':yo,'overflowContainer':Fo,'controlsButton':jo}};this['_overflowManager']=new Io(_0x29d334,this['_currentContextsChips'],_0x5758b6,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'](_0x47bec4,_0x592ff3){const _0x5c1c99=this['_createContextButton'](_0x47bec4,'current',!0x0,_0x592ff3);this['_addContextToCollection'](_0x5c1c99,this['_currentContextsChips']),this['_overflowManager']['reorganizeChips']();}['removeContextItem'](_0x2fd001){this['_removeContextFromCollection'](_0x2fd001,this['_currentContextsChips']),this['_removeContextFromCollection'](_0x2fd001,this['_overflowManager']['overflowChips']),this['_overflowManager']['reorganizeChips']();}['setContextItemLoading'](_0x9ae22d,_0x955346){let _0x7af6ea=this['_currentContextsChips']['find'](_0x53c82a=>_0x53c82a['id']===_0x9ae22d);_0x7af6ea||(_0x7af6ea=this['_overflowManager']['overflowChips']['find'](_0x2a3605=>_0x2a3605['id']===_0x9ae22d)),_0x7af6ea&&(_0x7af6ea['isLoading']=_0x955346);}['setConversationContext'](_0x3adc9c){this['_conversationContextsChips']['clear']();for(const _0x39f298 of _0x3adc9c){const _0x49eda0=this['_createContextButton'](_0x39f298,'conversation',!0x1,!0x1);this['_addContextToCollection'](_0x49eda0,this['_conversationContextsChips']);}}['clearCurrentContextItems'](){this['_currentContextsChips']['clear'](),this['_overflowManager']['clear']();}['clearConversationContextItems'](){this['_conversationContextsChips']['clear']();}['updateResourceState'](_0x854fab,_0x4e8587,_0x1b8ac1){this['_resourcesBalloonView']['updateResourceState'](_0x854fab,_0x4e8587,_0x1b8ac1);}['hideAddContextBalloonPanel'](){this['_toggleAddContextBalloon'](!0x1);}['showAddContextBalloonPanel'](){this['_toggleAddContextBalloon'](!0x0);}['hideUrlBalloonPanel'](){this['_urlBalloonPanelView']['hide'](),this['addContextButtonView']['isOn']=!0x1,this['_urlInputView']&&this['_urlInputView']['clear']();}['showUrlBalloonPanel'](){this['_urlBalloonPanelView']['show'](),this['addContextButtonView']['isOn']=!0x0;}['_showSourceResourcesBalloon']({source:_0x1c7ad8,withBackButton:_0x4a1133}){this['_resourcesBalloonView']['showSourceResourcesBalloon']({'source':_0x1c7ad8,'withBackButton':_0x4a1133}),this['addContextButtonView']['isOn']=!0x0;}['populateSourceResourceBalloon'](_0x75058d,_0x379420,_0x237a0d,_0x458b15){this['_resourcesBalloonView']['populateSourceResourceBalloon'](_0x75058d,_0x237a0d,_0x458b15);}['closeSourceResourceBalloon'](_0x2da6df){this['_resourcesBalloonView']['closeSourceResourceBalloon'](_0x2da6df),this['addContextButtonView']['isOn']=!0x1;}['setAddContextOptions'](_0x405a25){this['_setBalloonPanelContent'](this['_addContextBalloonPanelView'],this['locale'],_0x405a25),this['_setAddContextButtonEnabled'](_0x405a25);}['_setAddContextButtonEnabled'](_0x1265db){const _0x214172=!_0x1265db['document']['isHidden']&&_0x1265db['document']['enabled'],_0x4c940d=_0x1265db['urls']['enabled'],_0x448c7b=_0x1265db['files']['enabled'],_0x231ddb=_0x1265db['sources']['length']>0x0,_0x46118c=_0x1265db['customItems']&&_0x1265db['customItems']['length']>0x0;this['addContextButtonView']['isEnabled']=_0x214172||_0x4c940d||_0x448c7b||_0x231ddb||_0x46118c;}['_setupTemplate'](){this['setTemplate']({'tag':'div','attributes':{'class':[Ro,'ck-reset_all-excluded']},'children':[{'tag':'div','attributes':{'class':Oo},'children':this['_currentContextsChips']}]});}['_bindEventHandlers'](){this['addContextButtonView']['on']('execute',()=>{this['_handleAddContextButtonClick']();});}['_createAddContextButtonView'](_0x1054e6){const _0x55dfa6=new _0x2cf640(_0x1054e6);return _0x55dfa6['set']({'label':i(_0x1054e6,'AI_CHAT_CONTEXT_ADD_CONTEXT'),'class':jo+'\x20'+Lo,'icon':_0x3b2e9c,'isToggleable':!0x0,'tooltip':!0x0,'tooltipPosition':'sw'}),_0x55dfa6;}['_createAddContextBalloonPanelView'](_0x54c90a){return this['_createBaseBalloonPanel'](_0x54c90a,Uo);}['_createUrlBalloonPanelView'](_0x40294a){const _0x29a1d1=this['_createBaseBalloonPanel'](_0x40294a,No);return this['_addUrlContent'](_0x29a1d1,_0x40294a),_0x29a1d1;}['_createResourcesBalloonView'](_0x4ac093,_0x5243b6){const _0x2580a9={'searchInputVisibleFrom':_0x5243b6['searchInputVisibleFrom'],'onBackToContext':()=>{this['showAddContextBalloonPanel'](),this['_addContextBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':$o});},'onResourceSelected':(_0x5be715,_0x4c7445)=>{this['fire']('addResourceToContext',{'source':_0x5be715,'resource':_0x4c7445});},'onLoadSourceResources':_0x5803f0=>{this['fire']('loadSourceResources',_0x5803f0);},'onBalloonClosed':()=>{this['addContextButtonView']['isOn']=!0x1;},'getLimiterElement':()=>this['_getLimiterElement'](),'getTargetElement':()=>this['addContextButtonView']['element']};return new Po(_0x4ac093,_0x5243b6['bodyCollection'],_0x2580a9);}['_getLimiterElement'](){return this['element']?.['closest']('.'+Do)||document['body'];}['_createBaseBalloonPanel'](_0x1be3d2,_0x160e78){const _0xd42378=new _0x5442ef(_0x1be3d2);return _0xd42378['extendTemplate']({'attributes':{'class':_0x160e78}}),this['bodyCollection']['add'](_0xd42378),_0xd42378;}['_setBalloonPanelContent'](_0x3b2b4c,_0x22e88f,_0xcfdbfb){if(_0x3b2b4c['content']['clear'](),!_0xcfdbfb['document']['isHidden']&&_0xcfdbfb['document']['enabled']){const _0xb882a5=this['_createBalloonButton'](_0x22e88f,{'label':i(_0x22e88f,'AI_CHAT_CONTEXT_CURRENT_DOCUMENT'),'icon':_0x2ff8c2});_0xb882a5['on']('execute',()=>{this['fire']('addDocumentToContext'),this['hideAddContextBalloonPanel']();}),_0x3b2b4c['content']['add'](_0xb882a5);}if(_0xcfdbfb['urls']['enabled']){const _0x438511=this['_createBalloonButton'](_0x22e88f,{'label':i(_0x22e88f,'AI_CHAT_CONTEXT_URL_LABEL'),'icon':_0xa0ac3e});_0x438511['on']('execute',()=>{this['hideAddContextBalloonPanel'](),this['showUrlBalloonPanel'](),this['_urlBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':$o}),this['_urlInputView']['focus']();}),_0x3b2b4c['content']['add'](_0x438511);}if(_0xcfdbfb['files']['enabled']){const _0x139155=new _0x538cbe(_0x22e88f);_0x139155['set']({'label':i(_0x22e88f,'AI_CHAT_CONTEXT_FILE_LABEL'),'icon':_0x3e59fd,'withText':!0x0,'tooltip':!0x0,'class':Mo,'allowMultipleFiles':!0x0}),_0x139155['on']('execute',()=>{this['hideAddContextBalloonPanel']();}),_0x139155['on']('done',(_0x159190,_0x484350)=>{this['fire']('addFileToContext',_0x484350);}),_0x139155['tooltip']=!0x0,_0x3b2b4c['content']['add'](_0x139155);}for(const _0x57b513 of _0xcfdbfb['sources']){const _0x364f9f=this['_createBalloonButton'](_0x22e88f,{'label':_0x57b513['label'],'icon':_0x57b513['icon']||_0x5313d0,'type':'source'});_0x3b2b4c['content']['add'](_0x364f9f),_0x364f9f['on']('execute',()=>{this['hideAddContextBalloonPanel'](),this['_showSourceResourcesBalloon']({'source':_0x57b513,'withBackButton':!this['_hasExactlyOneSource']});});}for(const _0x49bdc0 of _0xcfdbfb['customItems']||[]){const _0x21ec86=this['_createBalloonButton'](_0x22e88f,{'label':_0x49bdc0['label'],'icon':_0x49bdc0['icon']||_0x5313d0,'type':'customItem'});_0x3b2b4c['content']['add'](_0x21ec86),_0x21ec86['on']('execute',()=>{this['hideAddContextBalloonPanel'](),this['fire']('executeCustomItemCallback',_0x49bdc0);});}this['_hasExactlyOneSource']=0x1===_0x3b2b4c['content']['length'],this['_urlInputView']['withBackButton']=!this['_hasExactlyOneSource'];}['_addUrlContent'](_0x3130fe,_0x39ad51){this['_urlInputView']=new Vo(_0x39ad51),this['_urlInputView']['on']('submitUrl',(_0x3adf81,_0x94ac52)=>{this['_handleUrlSubmit'](_0x94ac52);}),this['_urlInputView']['on']('cancel',()=>{this['hideUrlBalloonPanel'](),this['_hasExactlyOneSource']||(this['showAddContextBalloonPanel'](),this['_addContextBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':$o}));}),this['_urlInputView']['on']('refreshBalloon',()=>{this['_urlBalloonPanelView']['isVisible']&&this['_urlBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':$o});}),_0x3130fe['content']['add'](this['_urlInputView']);}['_createBalloonButton'](_0x3158eb,_0x5c9556){const _0x54de2='source'===_0x5c9556['type']?new SourcesBalloonButtonView(_0x3158eb):new _0x2cf640(_0x3158eb);return _0x54de2['set']({'label':_0x5c9556['label'],'icon':_0x5c9556['icon'],'withText':!0x0,'tooltip':!0x0,'tooltipPosition':'sw','class':Mo}),_0x54de2;}['_setupAllBalloonClickOutsideHandlers'](){this['_setupAddContextBalloonClickOutsideHandler'](),this['_setupUrlBalloonClickOutsideHandler']();}['_setupUrlBalloonClickOutsideHandler'](){_0x1d212b({'emitter':this['_urlBalloonPanelView'],'contextElements':[this['_urlBalloonPanelView']['element']],'callback':()=>{this['hideUrlBalloonPanel']();},'activator':()=>this['_urlBalloonPanelView']['isVisible']});}['_toggleAddContextBalloon'](_0x31b722){const _0x228404=this['_addContextBalloonConfig'];_0x228404['buttonView']['isOn']=_0x31b722,_0x31b722?_0x228404['balloonView']['show']():_0x228404['balloonView']['hide']();}['_setupAddContextBalloonClickOutsideHandler'](){const {balloonView:_0x935612,buttonView:_0x58c68b,hideMethod:_0x5ea1d4}=this['_addContextBalloonConfig'];_0x1d212b({'emitter':_0x935612,'contextElements':[_0x935612['element'],_0x58c68b['element']],'callback':()=>{_0x5ea1d4();},'activator':()=>_0x58c68b['isOn']&&!this['_urlBalloonPanelView']['isVisible']&&!this['_resourcesBalloonView']['isAnyResourceBalloonVisible']()});}['_createContextButton'](_0x14e662,_0x2609b3,_0x2401e6=!0x1,_0x3a6d1d=!0x1){const _0x1237d3='conversation'===_0x2609b3||!0x0===_0x14e662['isReadOnly'],_0x12ec18=new vo(this['locale'],_0x14e662,_0x1237d3,_0x2401e6,_0x3a6d1d);return _0x1237d3||_0x12ec18['on']('removeContextItemChip',()=>{this['fire']('removeContextItem',_0x12ec18['id']);}),_0x12ec18;}['_addContextToCollection'](_0x28a405,_0x138d67){_0x138d67['add'](_0x28a405,0x0);}['_removeContextFromCollection'](_0x253cd1,_0x44294a){const _0x1edb28=_0x44294a['find'](_0x1c4429=>_0x1c4429['id']===_0x253cd1);_0x1edb28&&_0x44294a['remove'](_0x1edb28);}['_handleAddContextButtonClick'](){this['addContextButtonView']['isOn']?this['hideAddContextBalloonPanel']():(this['showAddContextBalloonPanel'](),this['_addContextBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':$o}),this['_hasExactlyOneSource']&&this['_addContextBalloonPanelView']['content']['get'](0x0)?.['fire']('execute'));}['_handleUrlSubmit'](_0x2e578b){this['_urlInputView']['clear'](),this['hideUrlBalloonPanel'](),this['fire']('addUrlToContext',_0x2e578b);}}class SourcesBalloonButtonView extends _0x2cf640{['arrowView'];constructor(_0x517ee4){super(_0x517ee4),this['set']({'withText':!0x0,'role':'menuitem'}),this['arrowView']=this['_createArrowView'](),this['extendTemplate']({'attributes':{'class':[Ho]}});}['render'](){super['render'](),this['children']['add'](this['arrowView']);}['_createArrowView'](){const _0x5e4ca4=new _0x59b3d9();return _0x5e4ca4['content']=_0x468b06,_0x5e4ca4['extendTemplate']({'attributes':{'class':Ho+'__arrow'}}),_0x5e4ca4;}}class ds extends _0xc3e5b1{['_cancelButtonView'];['_loaderView'];constructor(_0x482c0c){super(_0x482c0c),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 _0x3f8f95=new _0x2cf640(this['locale']);return _0x3f8f95['set']({'label':i(this['locale'],'AI_CHAT_STOP_GENERATING'),'withText':!0x0,'class':'ck-ai-button-secondary\x20ck-ai-button-stop-generating','icon':_0x197784}),_0x3f8f95['on']('execute',()=>{this['fire']('abortPromptStream');}),_0x3f8f95;}['_createLoaderView'](){const _0x54a950=new _0xc3e5b1(this['locale']);return _0x54a950['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')}]}),_0x54a950;}}class ji extends _0xc3e5b1{['_contextPanelView'];['_promptInputView'];['_promptCapabilitiesView'];['_loaderView'];['_modelUnavailableMessageView'];['_shouldRestorePromptInputFocus'];constructor(_0x4720e1,_0x22755e){super(_0x4720e1),this['_contextPanelView']=this['_createContextPanelView'](_0x4720e1,{'bodyCollection':_0x22755e['bodyCollection'],'searchInputVisibleFrom':_0x22755e['contextResourcesSearchInputVisibleFrom']}),this['_promptInputView']=this['_createPromptInputView'](_0x4720e1),this['_promptCapabilitiesView']=this['_createPromptCapabilitiesView'](_0x4720e1),this['_loaderView']=this['_createLoaderView'](_0x4720e1),this['_modelUnavailableMessageView']=this['_createModelUnavailableMessageView'](_0x4720e1),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'](...ps)['to'](this),this['set']('isModelAvailable',!0x0),this['set']('isDisabled',!0x1);const _0x153b57=this['bindTemplate'];this['setTemplate']({'tag':'form','attributes':{'class':['ck','ck-ai-chat-controls',_0x153b57['if']('isDisabled','ck-ai-chat-controls-disabled')]},'children':[{'tag':'div','attributes':{'class':[_0x153b57['if']('isLoading','ck-hidden',_0x32c614=>_0x32c614||!this['isModelAvailable']),_0x153b57['if']('isModelAvailable','ck-hidden',_0x19290a=>!_0x19290a||this['isLoading'])]},'children':[this['_contextPanelView'],this['_promptInputView'],this['_promptCapabilitiesView']]},{'tag':'div','attributes':{'class':[_0x153b57['if']('isLoading','ck-hidden',_0x3331f1=>!_0x3331f1)]},'children':[this['_loaderView']]},{'tag':'div','attributes':{'class':[_0x153b57['if']('isModelAvailable','ck-hidden',_0x5dc297=>_0x5dc297)]},'children':[this['_modelUnavailableMessageView']]}]}),_0x1d212b({'emitter':this['_promptInputView'],'activator':()=>this['isLoading'],'contextElements':()=>[this['element']],'callback':()=>{this['_shouldRestorePromptInputFocus']=!0x1;}}),this['on']('change:isLoading',this['_handlePromptInputFocus'],{'priority':'low'});}['_createContextPanelView'](_0x280368,_0x21293a){return new ls(_0x280368,_0x21293a);}['_createPromptInputView'](_0x517fd2){return new cs(_0x517fd2,this['_contextPanelView']['addContextButtonView']);}['_createPromptCapabilitiesView'](_0x56f242){return new rs(_0x56f242);}['_createLoaderView'](_0x56f67b){return new ds(_0x56f67b);}['_createModelUnavailableMessageView'](_0x37f3fb){const _0x4702cd=new AIChatModelUnavailableMessageView(_0x37f3fb);return _0x4702cd['delegate']('startConversation')['to'](this),_0x4702cd;}['_handlePromptInputFocus'](_0x1ee248,_0x2397e9,_0x551039){_0x551039?this['_shouldRestorePromptInputFocus']=!0x0:this['_shouldRestorePromptInputFocus']&&this['_promptInputView']['focus']();}['addContextItem'](_0x1dd225,_0x569249){this['_contextPanelView']['addContextItem'](_0x1dd225,_0x569249);}['removeContextItem'](_0x9ff51){this['_contextPanelView']['removeContextItem'](_0x9ff51);}['setContextItemLoading'](_0x42efe0,_0x5eb45b){this['_contextPanelView']['setContextItemLoading'](_0x42efe0,_0x5eb45b);}['setIsUploadInProgress'](_0xc38dc4){this['_promptInputView']['setIsUploadInProgress'](_0xc38dc4);}['setConversationContext'](_0x1026aa){this['_contextPanelView']['setConversationContext'](_0x1026aa);}['clearPendingContextUI'](){this['_contextPanelView']['clearCurrentContextItems']();}['clearConversationContextUI'](){this['_contextPanelView']['clearConversationContextItems']();}['updateResourceState'](_0x2e1061,_0x40ef04,_0x327112){this['_contextPanelView']['updateResourceState'](_0x2e1061,_0x40ef04,_0x327112);}['setWebSearch'](_0x20ce8a){this['_promptCapabilitiesView']['setWebSearch'](_0x20ce8a);}['setReasoning'](_0x3d4745){this['_promptCapabilitiesView']['setReasoning'](_0x3d4745);}['resetMessageInput'](){this['_promptInputView']['reset']();}['setAddContextOptions'](_0x2bfec8){this['_contextPanelView']['setAddContextOptions'](_0x2bfec8);}['setInputPlaceholder'](_0x43b154){this['_promptInputView']['setPlaceholderText'](_0x43b154);}['setModelList'](_0x5ca2ce,_0x10fa88){this['_promptCapabilitiesView']['setModelList'](_0x5ca2ce,_0x10fa88);}['setModel'](_0x474f0b){_0x474f0b?(this['isModelAvailable']=!0x0,this['_promptCapabilitiesView']['setModel'](_0x474f0b)):this['isModelAvailable']=!0x1;}['enableModelSelector'](){this['_promptCapabilitiesView']['enableModelSelector']();}['disableModelSelector'](_0x503063){this['_promptCapabilitiesView']['disableModelSelector'](_0x503063);}['populateSourceResourceBalloon'](_0x46756f,_0x4344e1,_0x324600,_0x250358){this['_contextPanelView']['populateSourceResourceBalloon'](_0x46756f,_0x4344e1,_0x324600,_0x250358);}['closeSourceResourceBalloon'](_0x5e8acd){this['_contextPanelView']['closeSourceResourceBalloon'](_0x5e8acd);}['focusPromptInput'](_0x541354=!0x1){this['_promptInputView']['focus'](_0x541354);}['setPromptInputValue'](_0x20ffd8){this['_promptInputView']['queryView']['fieldView']['reset'](),this['_promptInputView']['queryView']['fieldView']['value']=_0x20ffd8;}}class AIChatModelUnavailableMessageView extends _0xc3e5b1{constructor(_0xb8b7c0){super(_0xb8b7c0);const _0x447b56=new _0x2cf640(_0xb8b7c0);_0x447b56['set']({'label':i(this['locale'],'AI_CHAT_MODEL_UNAVAILABLE_MESSAGE_BUTTON'),'withText':!0x0,'class':['ck-ai-chat-controls__start-new-chat-button'],'tooltip':''}),_0x447b56['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'},_0x447b56]}]});}}class ki extends _0x1e299f{['conversationStartButton'];['resizeButton'];constructor(_0x1ff210,_0x1d153f){super(_0x1ff210,{'label':i(_0x1ff210,'AI_CHAT_HEADING'),'class':'ck-ai-header\x20ck-ai-header_chat','icon':Et}),this['set']('isMaximized',!0x1),this['conversationStartButton']=this['_createStartConversationButton'](_0x1ff210),this['children']['add'](this['conversationStartButton']),_0x1d153f&&(this['resizeButton']=us(_0x1ff210,this),this['children']['add'](this['resizeButton']));}['_createStartConversationButton'](_0x5d825){const _0x3859b4=new _0x2cf640(_0x5d825);return _0x3859b4['set']({'label':i(this['locale'],'AI_CHAT_LABEL_NEW_CHAT'),'withText':!0x0,'icon':_0x1fce8d,'class':'ck-ai-chat__start-conversation'}),_0x3859b4['on']('execute',()=>{this['fire']('startConversation');}),_0x3859b4;}}class vi extends _0xc3e5b1{constructor(_0x3f874a){super(_0x3f874a),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-disclaimer']},'children':[{'tag':'p','attributes':{'class':['ck','ck-ai-disclaimer__content']},'children':[{'text':i(_0x3f874a,'AI_DISCLAIMER_TEXT')}]}]});}}class At extends _0xc3e5b1{['chatHeader'];['chatFeed'];['chatControls'];['chatDisclaimer'];['_bodyCollection'];constructor(_0x43637b,_0x5e56c4){super(_0x43637b),this['_bodyCollection']=new _0x340c25(_0x43637b),this['_bodyCollection']['attachToDom'](),this['chatHeader']=new ki(_0x43637b,_0x5e56c4['showResizeButton']),this['chatHeader']['delegate'](...Rt)['to'](this),this['chatFeed']=new di(_0x43637b,this['_bodyCollection']),this['chatFeed']['delegate'](...Rt)['to'](this),this['chatControls']=new ji(_0x43637b,{'bodyCollection':this['_bodyCollection'],'contextResourcesSearchInputVisibleFrom':_0x5e56c4['contextResourcesSearchInputVisibleFrom']}),this['chatControls']['delegate'](...Rt)['to'](this),this['chatDisclaimer']=new vi(_0x43637b),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-ai-chat','ck-rounded-corners'],'dir':_0x43637b['uiLanguageDirection']},'children':[this['chatHeader'],this['chatFeed'],this['chatControls'],this['chatDisclaimer']]});}['populateSourceResourceBalloon'](_0x5e3af8,_0x1b0e21,_0x583bb2,_0x17eac7){this['chatControls']['populateSourceResourceBalloon'](_0x5e3af8,_0x1b0e21,_0x583bb2,_0x17eac7);}['closeSourceResourceBalloon'](_0x58abd2){this['chatControls']['closeSourceResourceBalloon'](_0x58abd2);}['destroy'](){this['_bodyCollection']['detachFromDom'](),super['destroy']();}}class z extends _0x3a5602{static get['requires'](){return[it];}['_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(_0x42e474){super(_0x42e474);const _0x2e4db9=this['context']['plugins']['get']('AITabs');this['set']('isBusy',!0x1),this['_promiseQueue']=new St(),this['_view']=new At(this['context']['locale'],{'showResizeButton':_0x2e4db9['showResizeButton'],'contextResourcesSearchInputVisibleFrom':this['context']['config']['get']('ai.chat.context.searchInputVisibleFrom')}),this['_view']['delegate'](...Rt)['to'](this),this['_view']['on']('toggleSuggestionDisplayMode',(_0x3a7024,{showDiff:_0xdc2250})=>{this['showDiff']=_0xdc2250;}),_0x2e4db9['view']['addTab']({'id':'chat','buttonLabel':i(this['context']['locale'],'AI_CHAT_HEADING'),'buttonIcon':Et,'order':0x0,'content':this['_view']}),this['_view']['chatControls']['bind']('isLoading')['to'](this,'isBusy',_0x480a4e=>_0x480a4e),this['_view']['chatFeed']['bind']('isPending')['to'](this,'isBusy',_0x529fba=>_0x529fba),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder']()),this['bind']('isModelAvailable')['to'](this['_view']['chatControls'],'isModelAvailable');}['destroy'](){super['destroy'](),this['_titleAnimationInterval']&&clearInterval(this['_titleAnimationInterval']);}['createConversation'](_0x50b9f4){const _0x2411b9=this['context']['config']['get']('ai.chat.welcomeMessage')??i(this['context']['locale'],'AI_CHAT_WELCOME_MESSAGE');this['_view']['chatFeed']['clear'](),this['_view']['chatControls']['enableModelSelector'](),this['_view']['chatControls']['setModelList'](_0x50b9f4['availableModels'],!this['context']['config']['get']('ai.models.showModelSelector')),this['addFeedItemStaticMessage']({'id':'conversation-start','staticMessage':_0x2411b9}),this['fire']('conversationCreated');}['addFeedItemStaticMessage']({id:_0xa137f2,staticMessage:_0x2994bd}){this['_view']['chatFeed']['addItem']('ai-reply',{'id':_0xa137f2,'initialContent':'<p>'+_0x2994bd+'</p>'});}['addFeedItemUserMessage'](_0x509a43){const _0x2bc53b=_0x509a43['attributes']?.['displayedPrompt']||_0x509a43['userMessage'];this['_view']['chatFeed']['addItem']('user-message',{'contextItems':Array['from'](_0x509a43['contextItems']['values']()),'initialContent':'<p>'+_0x2bc53b+'</p>','id':_0x509a43['id']});}['addFeedItemError']({errorMessage:_0x27fcc6,id:_0x17eb8d}){this['_view']['chatFeed']['addItem']('error-message',{'initialContent':'<p>'+_0x27fcc6+'</p>','id':_0x17eb8d});}['addFeedItemAIReply'](_0x546ae6){return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('ai-reply',{'id':_0x546ae6['interactionId']+':'+_0x546ae6['id']}),this['clearLoadingMessage']();});}async['addFeedItemAISuggestion'](_0x4c0f61){const _0x5959a6=T(this['context']);let _0x43ac91=_0x5959a6['config']['get']('ai.availableReplyActions')||[...J];if(_0x5959a6['plugins']['has']('TrackChanges')){if(!this['_isTrackChangesCommandValueBound']){this['_isTrackChangesCommandValueBound']=!0x0;const _0x923eb4=_0x5959a6['commands']['get']('trackChanges');this['_view']['chatFeed']['bind']('isTrackChangesOn')['to'](_0x923eb4,'value');}}else _0x43ac91=_0x43ac91['filter'](_0xd8559a=>'insertSuggestion'!=_0xd8559a);return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('ai-suggestion-reply',{'id':_0x4c0f61['interactionId']+':'+_0x4c0f61['id'],'areActionsDisabled':_0x4c0f61['areActionsDisabled'],'showDiff':this['showDiff'],'availableActions':_0x43ac91}),this['clearLoadingMessage']();});}['addFeedInteractionHeader'](_0x58842c,_0x1045b6){const _0x4983d3=this['_view']['chatFeed']['children']['last'];if(_0x4983d3 instanceof Ct)return this['_view']['chatFeed']['children']['remove'](_0x4983d3),void this['_view']['chatFeed']['addItem']('interaction-header',{'id':_0x58842c['id'],'capabilities':{'isWebSearchEnabled':_0x4983d3['capabilities']['isWebSearchEnabled']||_0x1045b6['isWebSearchEnabled'],'isReasoningEnabled':_0x4983d3['capabilities']['isReasoningEnabled']||_0x1045b6['isReasoningEnabled']}});this['_view']['chatFeed']['addItem']('interaction-header',{'id':_0x58842c['id'],'capabilities':_0x1045b6});}async['addFeedItemCustomElement'](_0x5056d5,_0x1166f7){let _0xeb7ccf;return await this['_promiseQueue']['enqueue'](async()=>{_0xeb7ccf=this['_view']['chatFeed']['addItem']('custom-element',{'content':_0x5056d5,'id':_0x1166f7});}),_0xeb7ccf;}['removeFeedItem'](_0x22c391){this['_view']['chatFeed']['removeItem'](_0x22c391);}['hasFeedItem'](_0x344c6a){return this['_view']['chatFeed']['hasItem'](_0x344c6a);}['updateFeedInteractionHeader'](_0x2281a3){const _0x3a78a7=this['_view']['chatFeed']['children']['find'](_0x2c30de=>_0x2c30de['options']['id']==_0x2281a3['id']&&_0x2c30de instanceof Ct);_0x3a78a7&&_0x3a78a7['set']('isVisible',_0x2281a3['isVisible']);}async['updateFeedItemAIReplyContent'](_0x15c48e){const _0x3a858e=_0x15c48e['renderingStrategy']||this['feedItemRenderingStrategy'];return this['_promiseQueue']['enqueue'](async _0x384f0c=>{await this['_view']['chatFeed']['updateReplyItem']({..._0x15c48e,'abortSignal':_0x384f0c,'renderingStrategy':_0x3a858e}),_0x15c48e['isDone']&&this['markFeedItemAsDone'](_0x15c48e['id']);});}['updateFeedItemAIReplySources'](_0x5395d5,_0x5966a0){this['_view']['chatFeed']['updateWebSources'](_0x5395d5,_0x5966a0);}async['updateFeedItemAIReplySuggestionContent'](_0x321447){const _0x12acab=_0x321447['renderingStrategy']||this['feedItemRenderingStrategy'];return this['_promiseQueue']['enqueue'](async _0x4e962c=>{await this['_view']['chatFeed']['updateSuggestionItem']({..._0x321447,'abortSignal':_0x4e962c,'renderingStrategy':_0x12acab}),_0x321447['isDone']&&this['markFeedItemAsDone'](_0x321447['id']);});}['updateFeedItemAIReplySuggestionPartState'](_0x2cf78c){this['_view']['chatFeed']['updateSuggestionPartState'](_0x2cf78c);}['setFeedItemAIReplySuggestionPartActive'](_0x25d536){this['_view']['chatFeed']['setSuggestionPartActive'](_0x25d536);}['markFeedItemAsDone'](_0x2c9098){this['_view']['chatFeed']['markItemAsDone'](_0x2c9098);}['removeFeedInteraction'](_0xf67b72){this['_view']['chatFeed']['getItemIds']()['filter'](_0x55aca0=>_0x55aca0['startsWith'](_0xf67b72))['forEach'](_0x5252c7=>this['_view']['chatFeed']['removeItem'](_0x5252c7));}['startInteraction'](){const _0x5d8842=this['prepareLoadingMessage']({'isWebSearchEnabled':!0x1,'isReasoningEnabled':!0x1});this['setLoadingMessage'](_0x5d8842),this['_view']['chatControls']['disableModelSelector'](!this['context']['config']['get']('ai.models.showModelSelector')),this['isBusy']=!0x0,this['_view']['chatFeed']['startAutoScroll']();}['stopInteraction'](_0x3238f5){this['_promiseQueue']['abort'](),this['_view']['chatFeed']['getItemIds']()['filter'](_0x331da3=>_0x331da3['startsWith'](_0x3238f5['id']))['forEach'](_0x5a5de6=>this['markFeedItemAsDone'](_0x5a5de6)),this['isBusy']=!0x1,this['_view']['chatFeed']['stopAutoScroll']();}async['finishInteraction'](){return this['_promiseQueue']['queueEmptyPromise']['then'](()=>{this['isBusy']=!0x1,this['_view']['chatFeed']['stopAutoScroll']();});}['addContextItem'](_0x6da17a,_0x483a4a){this['_view']['chatControls']['addContextItem'](_0x6da17a,_0x483a4a);}['removeContextItem'](_0x5a5b7c){this['_view']['chatControls']['removeContextItem'](_0x5a5b7c);}['setContextItemLoading'](_0x1f65fd,_0x2c4e00){this['_view']['chatControls']['setContextItemLoading'](_0x1f65fd,_0x2c4e00);}['setIsUploadInProgress'](_0x3dc4de){this['_view']['chatControls']['setIsUploadInProgress'](_0x3dc4de);}['setConversationContext'](_0x9a3379){this['_view']['chatControls']['setConversationContext'](_0x9a3379);}['clearPendingContextUI'](){this['_view']['chatControls']['clearPendingContextUI']();}['clearConversationContextUI'](){this['_view']['chatControls']['clearConversationContextUI']();}['updateResourceState'](_0x2d7027,_0x543935,_0x6265dc){this['_view']['chatControls']['updateResourceState'](_0x2d7027,_0x543935,_0x6265dc);}['resetMessageInput'](){this['_view']['chatControls']['resetMessageInput'](),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder']());}['setAddContextOptions'](_0x1e192a){this['_view']['chatControls']['setAddContextOptions'](_0x1e192a);}['updateCapabilities'](_0x4e8c04){this['_view']['chatControls']['setWebSearch'](_0x4e8c04['isWebSearchEnabled']),this['_view']['chatControls']['setReasoning'](_0x4e8c04['isReasoningEnabled']),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder'](_0x4e8c04));}['setSelectedModel'](_0x3baf45,_0x12bbfa){this['_view']['chatControls']['setModel'](_0x3baf45),_0x12bbfa&&this['_view']['chatControls']['disableModelSelector'](!0x1);}['setFeedItemRenderingStrategy'](_0x1523d7){this['feedItemRenderingStrategy']=_0x1523d7;}['toggleLoadingSkeleton'](_0x5cc772){this['_view']['chatFeed']['toggleLoadingSkeleton'](_0x5cc772);}['resetConversationTitle'](){this['setConversationTitle'](i(this['context']['locale'],'AI_CHAT_HEADING'));}['setConversationTitle'](_0x2bfec3,_0x27c151=!0x1){if(_0x27c151&&!mt()&&_0x2bfec3['length'])return this['_view']['chatHeader']['label']='',void this['_animateConversationTitle'](_0x2bfec3);this['_view']['chatHeader']['label']=_0x2bfec3;}['setLoadingMessage'](_0x4498b4){this['_view']['chatFeed']['setLoadingMessage'](_0x4498b4);}['clearLoadingMessage'](){this['_view']['chatFeed']['setLoadingMessage']('');}['_animateConversationTitle'](_0x90b1a){let _0x4c3a28=0x0;clearInterval(this['_titleAnimationInterval']),this['_titleAnimationInterval']=setInterval(()=>{this['_view']['chatHeader']['label']=this['_view']['chatHeader']['label']+_0x90b1a[_0x4c3a28],_0x4c3a28++,_0x4c3a28===_0x90b1a['length']&&clearInterval(this['_titleAnimationInterval']);},0x1e);}['setIsMaximized'](_0x5c8af9){this['_view']['chatHeader']['isMaximized']=_0x5c8af9;}['prepareLoadingMessage'](_0x172432){return _0x172432['isWebSearchEnabled']&&_0x172432['isReasoningEnabled']?i(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH_REASONING'):_0x172432['isWebSearchEnabled']?i(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH'):_0x172432['isReasoningEnabled']?i(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_REASONING'):i(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_REGULAR');}['_getInputPlaceholder'](_0x7730b1){return _0x7730b1?_0x7730b1['isWebSearchEnabled']&&_0x7730b1['isReasoningEnabled']?i(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH_REASONING'):_0x7730b1['isWebSearchEnabled']?i(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH'):_0x7730b1['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'](_0x5f4cf6,_0x4c2be2,_0x18eba9,_0x1ab823){this['_view']['populateSourceResourceBalloon'](_0x5f4cf6,_0x4c2be2,_0x18eba9,_0x1ab823);}['closeSourceResourceBalloon'](_0x223c14){this['_view']['closeSourceResourceBalloon'](_0x223c14);}['setPromptInputValue'](_0x40c0f6){this['_view']['chatControls']['setPromptInputValue'](_0x40c0f6);}['focusPromptInput'](_0x2e8220=!0x1){this['_view']['chatControls']['focusPromptInput'](_0x2e8220);}['scrollFeedToSuggestion'](_0x4150c5,_0x22df87){this['_view']['chatFeed']['scrollToSuggestion'](_0x4150c5,_0x22df87);}['startAutoScroll'](){this['_view']['chatFeed']['startAutoScroll']();}['disableControls'](){this['_view']['chatControls']['isDisabled']=!0x0;}['enableControls'](){this['_view']['chatControls']['isDisabled']=!0x1;}}class Li extends _0x163c9e{['sections'];constructor(_0x51fd2a,_0x2a3d8c){super(_0x51fd2a),this['sections']=_0x2a3d8c,this['items']['addMany'](this['sections']),this['extendTemplate']({'attributes':{'class':['ck-ai-chat-history__sections']}});}['filter'](_0x8894bb){let _0x30d2a1=0x0,_0x5137a9=0x0;for(const _0x56613e of this['sections']){const {resultsCount:_0x3d48e5,totalItemsCount:_0x1d886a}=_0x56613e['filter'](_0x8894bb);_0x30d2a1+=_0x3d48e5,_0x5137a9+=_0x1d886a;}return{'resultsCount':_0x30d2a1,'totalItemsCount':_0x5137a9};}}class Yi extends _0x663ac1{['title'];['itemsViews'];['_itemsListView'];constructor(_0x543fc2,{title:_0x5b8e26,items:_0x4288ae}){super(_0x543fc2);const _0xa58407=this['bindTemplate'];this['set']('isVisible',!0x0),this['title']=_0x5b8e26,this['itemsViews']=_0x4288ae;const _0x5baeb3=new _0xc3e5b1(_0x543fc2);_0x5baeb3['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-history__section-title']},'children':[this['title']]}),this['_itemsListView']=new _0x163c9e(_0x543fc2),this['_itemsListView']['items']['addMany'](this['itemsViews']),this['setTemplate']({'tag':'li','attributes':{'class':['ck-ai-chat-history__section',_0xa58407['if']('isVisible','ck-hidden',_0x4e34dc=>!_0x4e34dc)]},'children':[_0x5baeb3,this['_itemsListView']]});}['filter'](_0x2c07a2){const _0x233ee5=this['itemsViews']['length'];let _0x8e01f9=0x0;for(const _0x359ac7 of this['itemsViews']){if(_0x2c07a2){const _0x174a1d=_0x359ac7['isMatching'](_0x2c07a2);_0x359ac7['isVisible']=!!_0x174a1d,_0x359ac7['highlightText'](_0x2c07a2);}else _0x359ac7['isVisible']=!0x0,_0x359ac7['highlightText'](null);_0x359ac7['isVisible']&&_0x8e01f9++;}return this['isVisible']=_0x8e01f9>0x0,{'resultsCount':_0x8e01f9,'totalItemsCount':_0x233ee5};}['getItem'](_0x27cd6f){return this['itemsViews']['find'](_0x29de0e=>_0x29de0e['id']===_0x27cd6f);}['removeItem'](_0x38c860){const _0xa9d9fa=this['itemsViews']['indexOf'](_0x38c860);-0x1!==_0xa9d9fa&&(this['itemsViews']['splice'](_0xa9d9fa,0x1),this['_itemsListView']['items']['remove'](_0x38c860));}}class Di extends/* #__PURE__ -- @preserve */
|
|
27
|
-
_0x28ab1a(_0x663ac1){['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(_0x413617,_0x3c116c){super(_0x413617);const _0x365678=this['bindTemplate'];this['set']('isEdit',!0x1),this['set']('isVisible',!0x0),this['set']('pinned',!!_0x3c116c['pinned']),this['set']('loadingState',null),this['id']=_0x3c116c['id'];const {title:_0x171abf,createdAt:_0x1d132e,active:_0x5509b4=!0x1}=_0x3c116c;this['_titleView']=new _0x19afdf(),this['_titleView']['text']=_0x171abf,this['_titleView']['extendTemplate']({'attributes':{'class':['ck-ai-chat-history__item-title']}});const _0x52ac5a=this['_createCheckView'](),_0x4e7591=this['_createPinButtonView'](_0x413617),_0x20ebf5=this['_createMenuDropdownView'](),_0x247ec2=this['_createEditInputView'](_0x413617,_0x171abf),_0x38baba=this['_createAcceptEditButtonView'](_0x413617,_0x247ec2),_0xeb2c47=this['_createCancelEditButtonView'](_0x413617,_0x247ec2);this['actions']=this['createCollection'](),this['mainContent']=this['createCollection'](),this['mainContent']['add'](this['_titleView']),this['actions']['add'](_0x4e7591),this['actions']['add'](_0x20ebf5),this['on']('change:isEdit',(_0x4ea3f6,_0x3e6c02,_0x448533)=>{this['actions']['clear'](),this['mainContent']['clear'](),_0x448533?(this['actions']['add'](_0x38baba),this['actions']['add'](_0xeb2c47),this['mainContent']['add'](_0x247ec2),_0x247ec2['element']['focus']()):(this['actions']['add'](_0x4e7591),this['actions']['add'](_0x20ebf5),this['mainContent']['add'](this['_titleView']));}),this['setTemplate']({'tag':'li','attributes':{'class':['ck-ai-chat-history__item',_0x5509b4?'ck-ai-chat-history__item--active':'',_0x365678['if']('isVisible','ck-hidden',_0x2e9b21=>!_0x2e9b21),_0x365678['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',_0x365678['if']('loadingState','ck-hidden',_0x8cdf24=>!!_0x8cdf24)]},'children':_0x5509b4?[_0x52ac5a]:[]},{'tag':'div','attributes':{'class':['ck-ai-loader',_0x365678['if']('loadingState','ck-hidden',_0x2182a9=>!_0x2182a9)]},'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',_0x365678['if']('loadingState','ck-hidden',_0x38f687=>!!_0x38f687)]},'children':this['mainContent']},{'tag':'div','attributes':{'class':['ck-ai-loader__text',_0x365678['if']('loadingState','ck-hidden',_0x283d9a=>!_0x283d9a)]},'children':[{'text':_0x365678['to']('loadingState',_0x2fd505=>_0x2fd505?i(this['locale'],Di['LOADING_LABELS'][_0x2fd505]):'')}]}]},{'tag':'span','attributes':{'class':['ck-ai-chat-history__item-date']},'children':[_0x1d132e]}]},{'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'](_0x3757a1){this['_titleView']['text']=_0x528e40(_0x3757a1);}['updateLoadingState'](_0x1c21c8,_0x31f21b){this['set']('loadingState',_0x31f21b?_0x1c21c8:null);}['_createCheckView'](){const _0x580e27=new _0x59b3d9();return _0x580e27['set']({'content':_0x24d29c}),_0x580e27;}['_createPinButtonView'](_0x41768d){const _0x5e5be0=new _0x2cf640(_0x41768d);return _0x5e5be0['set']({'label':i(_0x41768d,'AI_CHAT_HISTORY_PIN_BUTTON'),'icon':_0x404f94,'withText':!0x1,'tooltip':!0x0}),_0x5e5be0['bind']('isOn')['to'](this,'pinned'),_0x5e5be0['on']('execute',()=>{const _0xa6ae97=!this['pinned'];this['fire']('setConversationPinned',{'id':this['id'],'pinned':_0xa6ae97});}),_0x5e5be0;}['_createMenuDropdownView'](){const _0x37019b=_0x3e48f8(this['locale'],_0x3c46f6),_0x3992ba=_0x37019b['panelView']['children'];_0x37019b['buttonView']['set']({'label':i(this['locale'],'AI_CHAT_HISTORY_SHOW_MORE_ITEMS'),'icon':_0x214ca4}),_0x37019b['panelPosition']='sw';const _0x1eb028=new _0x2cf640(this['locale']);_0x1eb028['label']=i(this['locale'],'AI_CHAT_HISTORY_EDIT_NAME'),_0x1eb028['withText']=!0x0,_0x1eb028['on']('execute',()=>{this['isEdit']=!0x0;});const _0x3a2a1e=new _0x2cf640(this['locale']);_0x3a2a1e['label']=i(this['locale'],'AI_CHAT_HISTORY_REMOVE'),_0x3a2a1e['withText']=!0x0,_0x3a2a1e['on']('execute',()=>{this['showConfirm'](i(this['locale'],'AI_CHAT_HISTORY_REMOVE_CONFIRM'),this['element'])['then'](()=>{this['fire']('removeConversation',{'id':this['id']});});});const _0x5f04c5=new _0x163c9e(this['locale']),_0x145988=new _0x663ac1(this['locale']);_0x145988['children']['add'](_0x1eb028);const _0x420b17=new _0x663ac1(this['locale']);return _0x420b17['children']['add'](_0x3a2a1e),_0x5f04c5['items']['addMany']([_0x145988,_0x420b17]),_0x3992ba['add'](_0x5f04c5),_0x37019b;}['_createEditInputView'](_0x3963e1,_0x1c28a4){const _0x28a723=new _0x4a24d0(_0x3963e1),_0x3b0637=_0x28a723['bindTemplate'];return _0x28a723['value']=_0x1c28a4,_0x28a723['extendTemplate']({'on':{'keydown':_0x3b0637['to'](_0x7132d1=>{'Enter'==_0x7132d1['key']&&this['_commitEditInputValue'](_0x28a723);})}}),_0x28a723;}['_createAcceptEditButtonView'](_0x3fee94,_0x53bc3f){const _0xa07358=new _0x2cf640(_0x3fee94);return _0xa07358['set']({'icon':_0x24d29c,'withText':!0x1,'tooltip':i(_0x3fee94,'AI_CHAT_HISTORY_ACCEPT')}),_0xa07358['extendTemplate']({'attributes':{'class':['ck-confirm-view-submit']}}),_0xa07358['on']('execute',()=>{this['_commitEditInputValue'](_0x53bc3f);}),_0xa07358;}['_commitEditInputValue'](_0x11a1bb){const _0xfe55b6=_0x11a1bb['element']['value']||'';this['_titleView']['text']=_0xfe55b6,this['isEdit']=!0x1,this['fire']('editConversationTitle',{'id':this['id'],'title':_0xfe55b6});}['_createCancelEditButtonView'](_0xff322,_0x454c56){const _0x3d00cc=new _0x2cf640(_0xff322);return _0x3d00cc['set']({'icon':_0x4718d2,'withText':!0x1,'tooltip':i(_0xff322,'AI_CHAT_HISTORY_CANCEL')}),_0x3d00cc['extendTemplate']({'attributes':{'class':['ck-confirm-view-cancel']}}),_0x3d00cc['on']('execute',()=>{this['isEdit']=!0x1,_0x454c56['value']=this['_titleView']['text']||'',this['fire']('edit:cancel');}),_0x3d00cc;}['_createSpinnerView'](){const _0x43f5de=new Ze('tiny');return _0x43f5de['isVisible']=!0x0,_0x43f5de;}['isMatching'](_0x55b277){return this['_titleView']&&'string'==typeof this['_titleView']['text']&&this['_titleView']['text']['match'](_0x55b277)?{'title':!0x0}:null;}['highlightText'](_0x380e07){this['_titleView']['highlightText'](_0x380e07);}}class Ot extends _0xc3e5b1{['searchView'];['mainErrorView'];['skeletonView'];['emptyView'];['sectionsView'];['resizeButton'];constructor(_0x29914f,_0x5f171c){super(_0x29914f),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 _0x51d723=new _0x1e299f(_0x29914f,{'label':i(_0x29914f,'AI_CHAT_HISTORY_HEADING'),'icon':Nt,'class':'ck-ai-header\x20ck-ai-header_history'});_0x5f171c&&(this['resizeButton']=us(_0x29914f,this),_0x51d723['children']['add'](this['resizeButton'])),this['sectionsView']=new Li(_0x29914f,[]),this['sectionsView']['delegate'](...zi)['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',_0x3a6fd1=>!_0x3a6fd1)]}}),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':[_0x51d723,{'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 _0x3c121d=new _0x56da7a(this['locale'],{'filteredView':this['sectionsView'],'queryView':{'label':i(this['locale'],'AI_CHAT_HISTORY_SEARCH_LABEL')},'infoView':{'text':{'notFound':{'primary':_0x330494=>i(this['locale'],'AI_CHAT_HISTORY_SEARCH_NOT_FOUND_PRIMARY',_0x330494),'secondary':i(this['locale'],'AI_CHAT_HISTORY_SEARCH_NOT_FOUND_SECONDARY')}}}}),_0x28ecf8=this['_createErrorView']();return _0x28ecf8['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('errorMessage','ck-hidden',_0x560987=>!_0x560987)]}}),_0x3c121d['on']('render',()=>{_0x3c121d['children']['add'](_0x28ecf8,0x1);}),_0x3c121d['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isSearchViewVisible','ck-hidden',_0x4e0004=>!_0x4e0004)]}}),_0x3c121d;}['_createSkeletonView'](){const _0x48761a=new Xe(this['locale'],Ye['aiHistory']);return _0x48761a['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isLoading','ck-hidden',_0x8293ce=>!_0x8293ce)]}}),_0x48761a;}['_createErrorView'](){const _0x1c9b39=new _0xc3e5b1(this['locale']),_0x27e2fd=new _0x2cf640(this['locale']);_0x27e2fd['set']({'withText':!0x1,'icon':_0x4718d2,'class':'ck-ai-notification_error__dismiss-button'}),_0x27e2fd['bind']('isVisible')['to'](this,'hasItems',_0x17f565=>!!_0x17f565),_0x27e2fd['on']('execute',()=>{this['errorMessage']='';});const _0x46d483=this['bindTemplate'];return _0x1c9b39['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-notification','ck-ai-notification_error']},'children':[{'tag':'p','children':[{'text':_0x46d483['to']('errorMessage')}]},_0x27e2fd]}),_0x1c9b39;}['_createEmptyStateView'](){const _0x15c3f1=new _0x2cf640(this['locale']);_0x15c3f1['set']({'label':i(this['locale'],'AI_CHAT_LABEL_NEW_CHAT'),'withText':!0x0,'icon':_0x1fce8d,'class':'ck-ai-chat__start-conversation'}),_0x15c3f1['on']('execute',()=>{this['fire']('openChat');});const _0x20b9a5=new _0xc3e5b1(this['locale']);return _0x20b9a5['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-history__empty',this['bindTemplate']['if']('isEmptyViewVisible','ck-hidden',_0x33b3fd=>!_0x33b3fd)]},'children':[{'tag':'p','attributes':{'class':['ck-ai-chat-history__empty-message']},'children':[i(this['locale'],'AI_CHAT_HISTORY_EMPTY_MESSAGE')]},_0x15c3f1]}),_0x20b9a5;}['_createListItemViews'](_0x32eef8,_0x4f7ee8){const _0x1f0043=[];for(const _0x444499 of _0x32eef8){const _0x4fb005=new Di(_0x4f7ee8,_0x444499);_0x4fb005['delegate'](...zi)['to'](this),_0x1f0043['push'](_0x4fb005);}return _0x1f0043;}['updateHistoryItemsWithCategories'](_0x156866){const _0x4cca51=this['locale']||'en',_0x14ff93=[];for(const _0x2deb0c of _0x156866){const _0x5768a5=this['_createListItemViews'](_0x2deb0c['items'],_0x4cca51);_0x14ff93['push'](new Yi(_0x4cca51,{'title':_0x2deb0c['title'],'items':_0x5768a5}));}this['sectionsView']['sections']=_0x14ff93,this['sectionsView']['items']['clear'](),this['sectionsView']['items']['addMany'](_0x14ff93),this['hasItems']=_0x156866['some'](_0x532f6b=>_0x532f6b['items']['length']>0x0),this['_refreshSearch']();}['removeHistoryItem'](_0x3bf6cd){for(const _0x172a37 of this['sectionsView']['sections']){const _0x24dd8c=_0x172a37['getItem'](_0x3bf6cd);if(_0x24dd8c){if(_0x172a37['removeItem'](_0x24dd8c),0x0===_0x172a37['itemsViews']['length']){const _0x5643c3=this['sectionsView']['sections']['indexOf'](_0x172a37);-0x1!==_0x5643c3&&(this['sectionsView']['sections']['splice'](_0x5643c3,0x1),this['sectionsView']['items']['remove'](_0x172a37));}this['hasItems']=this['sectionsView']['sections']['length']>0x0,this['_refreshSearch']();break;}}}['updateItemTitle'](_0x90009d,_0x3c2556){for(const _0x5bcb6d of this['sectionsView']['sections']){const _0x3ce47b=_0x5bcb6d['getItem'](_0x90009d);if(_0x3ce47b){_0x3ce47b['updateTitle'](_0x3c2556);break;}}}['updateItemLoadingState'](_0x3f0a82,_0x3f8d42,_0x346590){for(const _0x3fc4ee of this['sectionsView']['sections']){const _0x5e32a2=_0x3fc4ee['getItem'](_0x3f0a82);if(_0x5e32a2){_0x5e32a2['updateLoadingState'](_0x3f8d42,_0x346590);break;}}}['_refreshSearch'](){if(this['hasItems']){const _0x2adf40=this['searchView']['queryView']['fieldView']?.['element']?.['value']||'';this['searchView']['search'](_0x2adf40);}}}const zi=['showConversationHistory','removeConversation','editConversationTitle','setConversationPinned','selectConversation','openChat','resizeTabs'];class xt extends _0x3a5602{static get['requires'](){return[it];}['_historyView'];static get['pluginName'](){return'AIChatHistoryUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x496e4d){super(_0x496e4d);const _0x2d6deb=this['context']['plugins']['get']('AITabs');this['_historyView']=new Ot(this['context']['locale'],_0x2d6deb['showResizeButton']),this['_historyView']['delegate'](...zi)['to'](this),_0x2d6deb['view']['addTab']({'id':'history','buttonLabel':i(this['context']['locale'],'AI_CHAT_HISTORY_HEADING'),'buttonIcon':Nt,'order':0x0,'content':this['_historyView']});}['removeHistoryItem'](_0x36ee68){this['_historyView']['removeHistoryItem'](_0x36ee68);}['updateItems'](_0x1548b5){this['_historyView']['updateHistoryItemsWithCategories'](_0x1548b5);}['updateItemTitle'](_0x1910fa,_0x88598f){this['_historyView']['updateItemTitle'](_0x1910fa,_0x88598f);}['updateItemLoadingState'](_0x531aec,_0x7888d7,_0x424f44){this['_historyView']['updateItemLoadingState'](_0x531aec,_0x7888d7,_0x424f44);}['setLoadingSkeleton'](_0x593142){this['_historyView']['isLoading']=_0x593142;}['showError'](_0x179065){this['_historyView']['errorMessage']=_0x179065;}['hideError'](){this['_historyView']['errorMessage']='';}['setIsMaximized'](_0x34902e){this['_historyView']['isMaximized']=_0x34902e;}}class nr extends ts(){['id'];['createdAt'];constructor({id:_0x10a3d1,title:_0x211fa5,createdAt:_0x2a39e8,updatedAt:_0x1983d7,pinned:_0x410eb4}){super(),this['id']=_0x10a3d1,this['createdAt']=new Date(_0x2a39e8),this['set']('title',_0x211fa5),this['set']('updatedAt',_0x1983d7?new Date(_0x1983d7):null),this['set']('pinned',_0x410eb4||!0x1);}['updateTitle'](_0xccdcb5){this['set']('title',_0x528e40(_0xccdcb5)),this['updatedAt']=new Date();}['updatePinned'](_0x26f2e9){this['set']('pinned',_0x26f2e9),this['updatedAt']=new Date();}}class Ht extends _0x5bd7c6(){['items']=[];['connector'];['group'];constructor({connector:_0x2d49a5,group:_0x4efb62}){super(),this['connector']=_0x2d49a5,this['group']=_0x4efb62;}async['init'](){try{const _0x395cc8=this['connector']['fetchConversations'](this['group']),_0xc0d375=await _0x395cc8['getConversations']();this['loadItems'](_0xc0d375);}catch(_0x15ed98){this['fire']('error',{'error':_0x15ed98,'operation':'init'});}}['addItem'](_0x16427f){this['items']['push'](_0x16427f);}async['removeItem'](_0x859e8c){const _0x166b0f=this['items']['findIndex'](_0x2ede3e=>_0x2ede3e['id']===_0x859e8c);if(-0x1===_0x166b0f)return!0x1;try{return await this['connector']['deleteConversation'](_0x859e8c)['execute'](),this['items']['splice'](_0x166b0f,0x1),this['fire']('itemRemoved',{'itemId':_0x859e8c}),!0x0;}catch(_0x17c02d){return this['fire']('error',{'error':_0x17c02d,'operation':'removeItem','itemId':_0x859e8c}),!0x1;}}['getItem'](_0x407d0f){return this['items']['find'](_0x1ca105=>_0x1ca105['id']===_0x407d0f);}async['updateItemTitle'](_0x43fd99,_0x2e726f){const _0x1342b4=this['getItem'](_0x43fd99);if(!_0x1342b4)return!0x1;try{return await this['connector']['updateConversation'](_0x43fd99,{'title':_0x2e726f})['getResult'](),_0x1342b4['updateTitle'](_0x2e726f),this['fire']('itemUpdated',{'itemId':_0x43fd99,'updates':{'title':_0x2e726f}}),!0x0;}catch(_0x41c085){return this['fire']('error',{'error':_0x41c085,'operation':'updateItemTitle','itemId':_0x43fd99}),!0x1;}}async['updateItemPinned'](_0xd76156,_0x33f25f){const _0x4a5241=this['getItem'](_0xd76156);if(!_0x4a5241)return!0x1;try{return await this['connector']['updateConversation'](_0xd76156,{'pinned':_0x33f25f})['getResult'](),_0x4a5241['updatePinned'](_0x33f25f),this['fire']('itemUpdated',{'itemId':_0xd76156,'updates':{'pinned':_0x33f25f}}),!0x0;}catch(_0x58d175){return this['fire']('error',{'error':_0x58d175,'operation':'updateItemPinned','itemId':_0xd76156}),!0x1;}}['loadItems'](_0x4c9b11){try{this['items']=[],_0x4c9b11['map'](_0x561ad0=>{this['addItem'](new nr(_0x561ad0));}),this['fire']('itemsLoaded',{'items':[...this['items']]});}catch(_0x4307ac){this['fire']('error',{'error':_0x4307ac,'operation':'loadItems'});}}['getItems'](_0x58bfe9={}){const _0x2849af=void 0x0!==_0x58bfe9['pinned']&&_0x58bfe9['pinned'],_0x5caac8=_0x58bfe9['from']?new Date(_0x58bfe9['from']['getFullYear'](),_0x58bfe9['from']['getMonth'](),_0x58bfe9['from']['getDate']()):null,_0x52754f=_0x58bfe9['to']?new Date(_0x58bfe9['to']['getFullYear'](),_0x58bfe9['to']['getMonth'](),_0x58bfe9['to']['getDate']()):null;return this['items']['filter'](_0x1e7442=>{if(_0x1e7442['pinned']!==_0x2849af)return!0x1;if(_0x52754f){const _0x5c531d=new Date(_0x1e7442['createdAt']['getFullYear'](),_0x1e7442['createdAt']['getMonth'](),_0x1e7442['createdAt']['getDate']());return _0x5caac8?_0x5caac8['getTime']()===_0x52754f['getTime']()?_0x5c531d['getTime']()===_0x5caac8['getTime']():_0x5c531d<_0x52754f&&_0x5c531d>=_0x5caac8:_0x5c531d<_0x52754f;}return!0x0;});}}class jt extends _0x3a5602{['_aiConnector'];['_aiChatHistoryUi'];['_aiChatController'];static get['requires'](){return[tt,q,xt,it];}static get['pluginName'](){return'AIChatHistoryController';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){this['_aiConnector']=this['context']['plugins']['get'](tt),this['_aiChatHistoryUi']=this['context']['plugins']['get'](xt),this['_aiChatController']=this['context']['plugins']['get'](q);const _0x2f2c9c=this['context']['plugins']['get'](it);try{const _0xfb7f14=this['_aiChatController']['getGroupId']();this['history']=new Ht({'connector':this['_aiConnector'],'group':_0xfb7f14}),this['listenTo'](this['_aiChatHistoryUi'],'removeConversation',(_0x3ea6ee,_0x221ae9)=>{this['_setItemLoading'](_0x221ae9['id'],'remove'),this['_handleRemove'](_0x221ae9['id']);}),this['listenTo'](this['_aiChatHistoryUi'],'editConversationTitle',(_0x928c02,_0x2662e4)=>{this['_setItemLoading'](_0x2662e4['id'],'rename'),this['_handleEditTitle'](_0x2662e4['id'],_0x2662e4['title']);}),this['listenTo'](this['history'],'itemUpdated',(_0x542ced,_0xfb7310)=>{void 0x0!==_0xfb7310['updates']['title']&&this['_aiChatHistoryUi']['updateItemTitle'](_0xfb7310['itemId'],_0xfb7310['updates']['title']),void 0x0!==_0xfb7310['updates']['pinned']&&this['_updateHistoryItemsUI'](),this['_clearItemLoading'](_0xfb7310['itemId']);}),this['listenTo'](this['history'],'itemRemoved',(_0x5cd81b,_0x242d4b)=>{this['_aiChatController']['handleRemovedConversation'](_0x242d4b['itemId']),this['_aiChatHistoryUi']['removeHistoryItem'](_0x242d4b['itemId']),this['_clearItemLoading'](_0x242d4b['itemId']);}),this['listenTo'](this['history'],'itemsLoaded',()=>{this['_updateHistoryItemsUI']();}),this['listenTo'](this['history'],'error',(_0x3900cb,_0x3c7dcb)=>{this['_handleHistoryErrorUI'](_0x3c7dcb['error'],_0x3c7dcb['operation'],_0x3c7dcb['itemId']);}),this['listenTo'](this['_aiChatHistoryUi'],'selectConversation',(_0xf69c3e,_0x9a8b47)=>{this['_handleSelectConversation'](_0x9a8b47['id']);}),this['listenTo'](this['_aiChatHistoryUi'],'setConversationPinned',(_0x2aecfb,_0x48c538)=>{const _0x14fdf3=_0x48c538['pinned']?'pin':'unpin';this['_setItemLoading'](_0x48c538['id'],_0x14fdf3),this['_handleTogglePin'](_0x48c538['id'],_0x48c538['pinned']);}),this['listenTo'](this['_aiChatHistoryUi'],'openChat',()=>{_0x2f2c9c['view']['activateTab']('chat');}),this['listenTo'](this['_aiChatController'],'change:activeConversation',()=>{this['_updateHistoryItemsUI']();}),_0x2f2c9c['view']['on']('activateTab:history',()=>{this['_showConversationHistory']();}),this['listenTo'](_0x2f2c9c,'resizedTabs',(_0x6837dd,_0x2decfc)=>{this['_setIsMaximized'](_0x2decfc);}),this['listenTo'](this['_aiChatHistoryUi'],'resizeTabs',()=>{_0x2f2c9c['resize']();});}catch(_0x7ca17b){this['_handleHistoryErrorUI'](_0x7ca17b,'init');}}async['_handleEditTitle'](_0x2cff7f,_0x1d9691){await this['history']['updateItemTitle'](_0x2cff7f,_0x1d9691);}async['_handleTogglePin'](_0x4297cd,_0x46c5d7){await this['history']['updateItemPinned'](_0x4297cd,_0x46c5d7);}async['_handleRemove'](_0x5420c6){await this['history']['removeItem'](_0x5420c6);}async['_handleSelectConversation'](_0x4c2b56){await this['_aiChatController']['loadConversation'](_0x4c2b56);}async['_showConversationHistory'](){this['_aiChatHistoryUi']['showError'](''),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x0),await this['history']['init'](),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x1);}['_updateHistoryItemsUI'](){const _0x205048=this['_aiChatController']['activeConversation']?.['id'],_0x967bc8=this['_getCategorizedItems']()['map'](_0x3f04fd=>({'title':_0x3f04fd['title'],'items':_0x3f04fd['items']['map'](_0x4f33de=>({'id':_0x4f33de['id'],'title':_0x4f33de['title']||i(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION'),'createdAt':new Date(_0x4f33de['createdAt'])['toLocaleDateString'](),'active':_0x4f33de['id']===_0x205048,'pinned':_0x4f33de['pinned']}))}));this['_aiChatHistoryUi']['updateItems'](_0x967bc8);}['_setItemLoading'](_0x10d157,_0x16bdb8){this['_aiChatHistoryUi']['updateItemLoadingState'](_0x10d157,_0x16bdb8,!0x0);}['_clearItemLoading'](_0x38e496){this['_aiChatHistoryUi']['updateItemLoadingState'](_0x38e496,null,!0x1);}['_handleHistoryErrorUI'](_0x17c06a,_0x49024a,_0x27e9d3){const _0x5d4fc1=this['_generateErrorMessage'](_0x49024a,_0x27e9d3);this['_aiChatHistoryUi']['showError'](_0x5d4fc1),_0x27e9d3&&this['_clearItemLoading'](_0x27e9d3),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x1);}['_generateErrorMessage'](_0x43f132,_0x447d7d){const _0x1996b4=_0x447d7d?this['history']['getItem'](_0x447d7d):null,_0x3f9c50=_0x1996b4?.['title']||i(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION');switch(_0x43f132){case'updateItemTitle':return i(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_UPDATE_TITLE',_0x3f9c50);case'updateItemPinned':{const _0x349907=i(this['context']['locale'],_0x1996b4?.['pinned']?'AI_CHAT_HISTORY_UNPIN_ACTION':'AI_CHAT_HISTORY_PIN_ACTION');return i(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_UPDATE_PINNED',[_0x349907,_0x3f9c50]);}case'removeItem':return i(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_REMOVE_ITEM',_0x3f9c50);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 _0x53c852=new Date(),_0x5591d8=new Date(_0x53c852['getFullYear'](),_0x53c852['getMonth'](),_0x53c852['getDate']()),_0x3b7597=new Date(_0x5591d8);_0x3b7597['setDate'](_0x3b7597['getDate']()-0x1);const _0x1bb199=new Date(_0x5591d8);_0x1bb199['setDate'](_0x1bb199['getDate']()-0xe);const _0x316328=this['history']['getItems']({'pinned':!0x0}),_0x11209d=this['history']['getItems']({'from':_0x5591d8,'to':_0x5591d8}),_0x4747e7=this['history']['getItems']({'from':_0x3b7597,'to':_0x3b7597}),_0x223e34=this['history']['getItems']({'from':_0x1bb199,'to':_0x3b7597}),_0x2410dc=this['history']['getItems']({'to':_0x1bb199}),_0x46b217=[];return _0x316328['length']>0x0&&_0x46b217['push']({'title':i(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_PINNED'),'items':_0x316328}),_0x11209d['length']>0x0&&_0x46b217['push']({'title':i(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_TODAY'),'items':_0x11209d}),_0x4747e7['length']>0x0&&_0x46b217['push']({'title':i(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_YESTERDAY'),'items':_0x4747e7}),_0x223e34['length']>0x0&&_0x46b217['push']({'title':i(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_LAST_14_DAYS'),'items':_0x223e34}),_0x2410dc['length']>0x0&&_0x46b217['push']({'title':i(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_LATER'),'items':_0x2410dc}),_0x46b217;}['_setIsMaximized'](_0x1cdc87){this['_aiChatHistoryUi']['setIsMaximized'](_0x1cdc87);}}class G extends _0x3a5602{static get['requires'](){return[jt,xt];}static get['pluginName'](){return'AIChatHistory';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class AIChat extends _0x3a5602{static get['requires'](){return[q,D,z,G];}static get['pluginName'](){return'AIChat';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x41542c){super(_0x41542c),this['context']['config']['define']('ai.chat.context',{'document':{'enabled':!0x0},'urls':{'enabled':!0x0},'files':{'enabled':!0x0},'sources':[]}),this['context']['config']['define']('ai.chat.initialConversation','new');}async['addSelectionToChatContext'](){await this['context']['plugins']['get'](q)['addSelectionToChatContext']();}async['startConversation'](){await this['context']['plugins']['get'](q)['startConversation']();}async['sendMessage']({message:_0x2bad14,attributes:_0x3ba2a8}){await this['context']['plugins']['get'](q)['sendMessage']({'message':_0x2bad14,'attributes':_0x3ba2a8});}['removeSelectionFromChatContext'](){this['context']['plugins']['get'](q)['removeSelectionFromChatContext']();}['focusPromptInput'](){this['context']['plugins']['get'](q)['focusPromptInput']();}['registerToolDataCallback'](_0x3b7b51){this['context']['plugins']['get'](q)['_registerToolDataCallback'](_0x3b7b51);}}class ws extends _0x2cf640{['id'];constructor(_0x4b6acb,_0x430800){super(_0x4b6acb);const {id:_0x42c59e,type:_0x4c72a8,icon:_0x826ea5}=_0x430800;this['id']=_0x42c59e,this['set']({'label':_0x430800['label'],'withText':!0x0,'class':'ck-ai-chat-shortcut'}),this['extendTemplate']({'attributes':{'data-cke-ai-shortcut-id':_0x430800['id']}}),_0x826ea5?this['icon']=_0x826ea5:'chat'===_0x4c72a8?this['icon']=_0x382801:'review'===_0x4c72a8?this['icon']=_0x17e3b2:'translate'===_0x4c72a8&&(this['icon']=Vt);}}class Mt extends _0xc3e5b1{['listView'];constructor(_0x36dc40,_0x38a5b4){super(_0x36dc40);const _0x1d234a=_0x38a5b4['map'](_0x160daa=>{const _0x5e7226=new _0x663ac1(this['locale']),_0x101be9=new ws(this['locale'],_0x160daa);return _0x5e7226['children']['add'](_0x101be9),_0x101be9['delegate']('execute')['to'](this),_0x5e7226;});this['listView']=new _0x163c9e(this['locale']),this['listView']['items']['addMany'](_0x1d234a),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat-shortcuts']},'children':[this['listView']]});}}const Ut='chat-shortcuts';var ka=function(_0x2d5486){return _0x2d5486['CHAT']='chat',_0x2d5486['REVIEW']='review',_0x2d5486['TRANSLATE']='translate',_0x2d5486;}({});class AIChatShortcuts extends _0x3a5602{['_shortcuts'];['_shortcutsView'];['_aiChatUI'];static get['requires'](){return[z];}static get['pluginName'](){return'AIChatShortcuts';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){this['_aiChatUI']=this['context']['plugins']['get'](z),this['_shortcuts']=this['context']['config']['get']('ai.chat.shortcuts')??[];const _0x20e50d=this['context']['plugins']['get']('AIChatController');this['_shortcuts']['length']&&(this['_validateShortcuts'](),this['_aiChatUI']['on']('conversationCreated',()=>{_0x20e50d['activeConversation']['isFromHistory']||this['_injectShortcuts']();}),this['listenTo'](_0x20e50d,'interactionStarted',()=>{this['_removeShortcuts']();}));}['_validateShortcuts'](){const _0x3d9dfc=Object['values'](ka);this['_shortcuts']['forEach'](_0x242f98=>{let _0x169d25=!0x0;if(_0x242f98['id']&&_0x242f98['label']&&_0x3d9dfc['includes'](_0x242f98['type'])?'chat'===_0x242f98['type']&&(_0x169d25='string'==typeof _0x242f98['prompt']):_0x169d25=!0x1,!_0x169d25)throw new _0x563e6a('ai-chat-shortcuts-invalid-config',this['context'],{'shortcut':_0x242f98});});}['_injectShortcuts'](){const _0x1d90af=this['context']['plugins']['get'](z);this['_shortcutsView']=new Mt(this['context']['locale'],this['_shortcuts']),this['_shortcutsView']['render'](),_0x1d90af['addFeedItemCustomElement'](this['_shortcutsView']['element'],Ut),this['_shortcutsView']['on']('execute',_0xa63d35=>{const _0x56bb18=_0xa63d35['source']['id'];this['_executeShortcut'](_0x56bb18);});}['_removeShortcuts'](){const _0x30407b=this['context']['plugins']['get'](z);_0x30407b['hasFeedItem'](Ut)&&_0x30407b['removeFeedItem'](Ut),this['_shortcutsView']?.['destroy']();}['_executeShortcut'](_0x4b000f){const _0x781ca9=this['_shortcuts']['find'](_0x504919=>_0x504919['id']===_0x4b000f),_0x3b5230=_0x781ca9['type'];'chat'===_0x3b5230?this['_runChatShortcut'](_0x781ca9):'review'===_0x3b5230?_0x781ca9['check']?this['_runReviewShortcut'](_0x781ca9):this['_switchTab']('reviewMode'):'translate'===_0x3b5230&&(_0x781ca9['language']?this['_runTranslateShortcut'](_0x781ca9):this['_switchTab']('translate'));}['_switchTab'](_0x2ca6f6){if(!this['context']['plugins']['has']('AITabs'))throw new _0x563e6a('ai-chat-shortcuts-ai-tabs-not-found',this['context'],{'tabName':_0x2ca6f6});this['context']['plugins']['get']('AITabs')['view']['activateTab'](_0x2ca6f6);}async['_runChatShortcut']({prompt:_0x2a35f4,draftMode:_0x4e94e3,useWebSearch:_0x5ab1f1=!0x1,useReasoning:_0x5c9fae=!0x1,model:_0x5e2803}){const _0x419bb8=this['context']['plugins']['get']('AIChat'),_0x2f9f91=this['context']['plugins']['get']('AIChatController'),_0x43765b=_0x2f9f91['activeConversation'];let _0x3d1eef;_0x3d1eef=_0x5e2803?await _0x43765b['chatModels']['getModel'](_0x5e2803):await _0x43765b['chatModels']['getDefault'](),_0x3d1eef&&await _0x43765b['setModel'](_0x3d1eef),_0x43765b['setWebSearch'](_0x5ab1f1),_0x43765b['setReasoning'](_0x5c9fae),_0x2f9f91['addCurrentDocumentToChatContext'](),_0x4e94e3?(this['_aiChatUI']['setPromptInputValue'](_0x2a35f4),this['_aiChatUI']['focusPromptInput'](!0x0)):_0x419bb8['sendMessage']({'message':_0x2a35f4});}['_runReviewShortcut']({check:_0x14c37f,model:_0x5dae70,prompt:_0x5cc038,params:_0x1c517e}){if(!this['context']['plugins']['has']('AIReviewModeUI'))throw new _0x563e6a('ai-chat-shortcuts-review-mode-not-found',this['context']);this['_switchTab']('reviewMode');const _0x150dab={'id':_0x14c37f,'isCustom':'custom'===_0x14c37f};_0x5dae70&&_0x5cc038&&(_0x150dab['args']={'model':_0x5dae70,'prompt':_0x5cc038}),_0x1c517e&&(_0x150dab['params']=_0x1c517e),this['context']['plugins']['get']('AIReviewModeUI')['fire']('runReviewCheck',_0x150dab);}['_runTranslateShortcut']({language:_0x54a7dd}){if(!this['context']['plugins']['has']('AITranslateUI'))throw new _0x563e6a('ai-chat-shortcuts-translate-not-found',this['context']);this['_switchTab']('translate'),this['context']['plugins']['get']('AITranslateUI')['fire']('runReviewCheck',{'id':_0x54a7dd,'args':{'language':_0x54a7dd}});}}class io extends Lt{constructor(_0xdfa794){super(_0xdfa794);const _0x3d4a78=_0xdfa794['plugins']['get']('AITabs')['view'];this['bind']('value')['to'](_0x3d4a78,'isVisible'),this['isEnabled']=!0x0;}['execute'](){const _0x33399b=this['editor']['plugins']['get']('AITabs')['view'];_0x33399b['isVisible']=!_0x33399b['isVisible'];}}class Pt extends _0x361c0d{static get['requires'](){return[it];}static get['pluginName'](){return'AIToggleButtonUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x1dea3c=this['editor'];_0x1dea3c['commands']['add']('toggleAi',new io(_0x1dea3c)),_0x1dea3c['ui']['componentFactory']['add']('toggleAi',()=>{const _0x4ecce9=this['_createAIUIButton'](_0x2cf640);return _0x4ecce9['set']({'tooltip':!0x0,'class':'ck-ai-toggle-button'}),_0x4ecce9;}),_0x1dea3c['ui']['componentFactory']['add']('menuBar:toggleAi',()=>{const _0x1239a6=this['_createAIUIButton'](_0x226c2e);return _0x1239a6['set']({'role':'menuitemcheckbox'}),_0x1239a6;});}['_createAIUIButton'](_0x1f6eb7){const _0x545b4e=this['editor'],_0x2a8b9f=_0x545b4e['commands']['get']('toggleAi'),_0x49d3bc=new _0x1f6eb7(_0x545b4e['locale']);return _0x49d3bc['set']({'label':i(_0x545b4e['locale'],'AI_TOGGLE_BUTTON_LABEL'),'icon':_0x2ab699,'isToggleable':!0x0}),_0x49d3bc['bind']('isEnabled')['to'](_0x2a8b9f),_0x49d3bc['bind']('isOn')['to'](_0x2a8b9f,'value',_0x490a31=>!!_0x490a31),this['listenTo'](_0x49d3bc,'execute',()=>{_0x2a8b9f['execute']();}),_0x49d3bc;}}const F=['applySuggestion','insertSuggestion','showNext','showPrevious'];class pi extends _0xc3e5b1{['_errorView'];constructor(_0x103fd8){super(_0x103fd8),this['set']('_errorMessage',''),this['set']('_isErrorVisible',!0x1);}['showBlockingError'](_0x16d3bd){this['showError'](_0x16d3bd);}['showError'](_0xb1c343){this['_errorView']||(this['_errorView']=this['_createErrorView']()),this['_errorMessage']=_0xb1c343,this['_isErrorVisible']=!0x0;}['hideError'](){this['_isErrorVisible']=!0x1;}['_createErrorView'](){const _0x21ef9f=new _0xc3e5b1(this['locale']),_0x3c4557=new _0xc3e5b1(this['locale']);return _0x3c4557['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-suggestion__error-text']},'children':[{'text':this['bindTemplate']['to']('_errorMessage')}]}),_0x21ef9f['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__error','ck-ai-balloon-error',this['bindTemplate']['if']('_isErrorVisible','ck-hidden',_0x461677=>!_0x461677)]},'children':[_0x3c4557]}),_0x21ef9f;}}const $=0xa;class H extends _0x3a5602{static get['requires'](){return[D];}static get['pluginName'](){return'AIBalloon';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['isOpen']=!0x1;['_currentConfig'];['_isUpdatingMarkers']=!0x1;['open'](_0x407c82){const {id:_0x1c49d7}=this['_currentConfig']??{};this['_currentConfig']=_0x407c82;const {id:_0x2813aa}=this['_currentConfig'];this['isOpen']&&_0x1c49d7===_0x2813aa?this['_updateDialog']():this['_showDialog']();}['close'](){const _0x1eff3c=T(this['context'])['plugins']['get']('Dialog');_0x1eff3c['isOpen']&&this['_currentConfig']&&_0x1eff3c['id']===this['_currentConfig']['id']&&_0x1eff3c['hide']();}['_updateDialog'](){const _0x55f730=T(this['context'])['plugins']['get']('Dialog'),{icon:_0x118734,title:_0x2707d2}=this['_currentConfig'];_0x55f730['view']?.['headerView']&&(_0x55f730['view']['headerView']['label']=_0x2707d2,_0x55f730['view']['headerView']['iconView']&&_0x118734&&(_0x55f730['view']['headerView']['iconView']['content']=_0x118734)),this['_isUpdatingMarkers']=!0x0,this['_showFakeVisualSelection'](),this['_isUpdatingMarkers']=!0x1,_0x55f730['view']?.['updatePosition']();}['_showFakeVisualSelection'](){this['context']['plugins']['get'](D)['showFakeVisualSelection'](this['_currentConfig']['ranges'],'ai-balloon-'+this['_currentConfig']['index'],!0x0,!0x0);}['_hideFakeVisualSelection'](_0x861d8c){this['context']['plugins']['get'](D)['hideFakeVisualSelection']('ai-balloon-'+_0x861d8c);}['_showDialog'](){const _0x29df73=T(this['context'])['plugins']['get']('Dialog'),{id:_0x47729f,title:_0x5ea44b,icon:_0x4ca317,class:_0x389a7c,mainView:_0x3e21ad}=this['_currentConfig'];_0x3e21ad['delegate'](...F)['to'](this),_0x29df73['show']({'title':_0x5ea44b,'icon':_0x4ca317,'hasCloseButton':!0x0,'id':_0x47729f,'position':this['_calculateDialogPosition']['bind'](this),'className':'ck-ai-balloon\x20'+(_0x389a7c||''),'content':_0x3e21ad,'onShow':_0x1f6434=>{this['_showFakeVisualSelection'](),this['_setupFakeVisualSelectionMarkerRemovalListener']();const _0x5b1f19=this['_getSelectionElements']();_0x5b1f19&&_0x5b1f19[0x0]&&_0x1fa956({'target':_0x5b1f19[0x0],'ancestorOffset':0x14,'alignToTop':!0x0,'viewportOffset':{'top':0x14,'bottom':0x14,'left':0x0,'right':0x0}}),this['isOpen']=!0x0,_0x1f6434['once']('hide',()=>{this['fire']('beforeDialogClosed',{'id':_0x47729f});},{'priority':'high'});},'onHide':()=>{this['_hideFakeVisualSelection'](this['_currentConfig']['index']),this['_cleanupFakeVisualSelectionMarkerRemovalListener'](),this['fire']('dialogClosed',{'id':_0x47729f}),this['isOpen']=!0x1;}});}['_calculateDialogPosition'](_0x47b804,_0x3f28f6){if(!_0x3f28f6)return null;const _0x434406=this['_getSelectionElements']();if(!_0x434406||0x0===_0x434406['length'])return{'left':Math['round'](_0x3f28f6['left']+_0x3f28f6['width']/0x2-_0x47b804['width']/0x2),'top':Math['round'](_0x3f28f6['top']+_0x3f28f6['height']/0x2-_0x47b804['height']/0x2)};const _0x5346a0=Math['round'](_0x3f28f6['left']+_0x3f28f6['width']/0x2-_0x47b804['width']/0x2),_0x4cde34=_0x434406['map'](_0x240969=>new _0x4b725e(_0x240969)),_0x473a9a=_0x47b804['height'];return{'left':_0x5346a0,'top':this['_calculateOptimalTopPosition'](_0x4cde34,_0x473a9a,_0x3f28f6)};}['_calculateOptimalTopPosition'](_0x20eb3a,_0x2b0d16,_0x7c880e){const _0x3e36c9=new _0x4b725e(_0x44426a['window']),_0x57e27f=_0x20eb3a['map'](_0x4162a9=>_0x4162a9['getVisible']())['filter'](_0xadecb9=>_0xadecb9),_0x17a8cd=_0x4b725e['getBoundingRect'](_0x57e27f);if(!_0x17a8cd)return Math['round'](_0x7c880e['top']+_0x7c880e['height']/0x2);const _0x406f0d=_0x3e36c9['getIntersection'](_0x17a8cd);if(!_0x406f0d)return Math['round'](_0x7c880e['top']+_0x7c880e['height']/0x2);const _0x494129=_0x7c880e['getVisible'](),_0x34e6a0=_0x494129&&_0x17a8cd['height']>_0x494129['height'],_0x517751=_0x406f0d['top'],_0x4b770a=_0x406f0d['bottom'];if(_0x34e6a0){const _0x3ac14b=(_0x494129||_0x3e36c9)['height']/0x2-_0x2b0d16/0x2,_0x24cd5a=_0x517751-$-_0x7c880e['top'],_0x154d52=_0x7c880e['bottom']-_0x4b770a-$;return _0x24cd5a>=_0x2b0d16?Math['max']($,_0x517751-_0x2b0d16-$):_0x154d52>=_0x2b0d16?_0x4b770a+$:Math['max']($,_0x3ac14b);}const _0x3a4612=_0x517751-_0x2b0d16,_0xa87e72=_0x7c880e['bottom']-_0x4b770a-$,_0x4a9c53=_0x517751-$-_0x7c880e['top'];let _0xdcce1b;if(_0xa87e72>=_0x2b0d16)_0xdcce1b=_0x4b770a+$;else{if(_0x4a9c53>=_0x2b0d16)_0xdcce1b=_0x3a4612-$;else _0xdcce1b=_0x517751+_0x17a8cd['height']/0x2-_0x2b0d16/0x2;}return _0xdcce1b;}['_setupFakeVisualSelectionMarkerRemovalListener'](){const _0x2d9125=T(this['context']);this['listenTo'](_0x2d9125['model']['document'],'change',()=>{if(!this['_isUpdatingMarkers']){for(const {name:_0xeb823c,data:{newRange:_0x12154a}}of _0x2d9125['model']['document']['differ']['getChangedMarkers']())if(_0xeb823c['startsWith'](R+':')&&(_0x12154a&&(_0x12154a['start']['isEqual'](_0x12154a['end'])||'$graveyard'==_0x12154a['root']['rootName'])||null==_0x12154a)){const _0xb70d2b=i(this['context']['locale'],'AI_BALLOON_SELECTION_REMOVED_ERROR');this['_currentConfig']['mainView']['showBlockingError'](_0xb70d2b),this['fire']('selectionRemoved');}}});}['_cleanupFakeVisualSelectionMarkerRemovalListener'](){const _0x14008e=T(this['context']);this['_currentConfig']['mainView']['hideError'](),this['stopListening'](_0x14008e['model']['document']);}['_getSelectionElements'](){const _0x3aa7ab=T(this['context']);return _0x18a8b5(_0x3aa7ab['editing'],[..._0x3aa7ab['model']['markers']['getMarkersGroup']('ai-selection'),..._0x3aa7ab['model']['markers']['getMarkersGroup']('ai-balloon-selection')]);}}class wi extends _0x14c71e{['copyButton'];['likeButton'];['dislikeButton'];['showChangesButton'];['_config'];constructor(_0x548633,_0x3b1d6f={}){super(_0x548633),this['set']('isEnabled',!0x0),this['set']('isShowChangesOn',!0x1),this['_config']={'showCopy':!0x1,'showLike':!0x1,'showDislike':!0x1,..._0x3b1d6f};const _0x283781=!(this['_config']['showCopy']||this['_config']['showChanges']||this['_config']['showLike']||this['_config']['showDislike']||this['_config']['customView']?.['length']);this['class']=_0x283781?'ck-ai-mini-toolbar\x20ck-hidden':'ck-ai-mini-toolbar',this['_config']['showCopy']&&(this['_setupCopyButton'](),this['items']['add'](this['copyButton'])),this['_config']['showChanges']&&(this['_setupShowChangesButton'](),this['items']['add'](this['showChangesButton'])),this['_setupRatingButtons'](),this['_config']['showLike']&&this['items']['add'](this['likeButton']),this['_config']['showDislike']&&this['items']['add'](this['dislikeButton']),this['_config']['customView']&&this['items']['addMany'](this['_config']['customView']);}['toggleShowChangesEnabled'](_0x5aa6b7){this['showChangesButton']['isEnabled']=_0x5aa6b7;}['_setupRatingButtons'](){this['likeButton']=new _0x2cf640(this['locale']),this['likeButton']['set']({'icon':_0x2ea5c6,'label':i(this['locale'],'AI_MINI_TOOLBAR_LIKE'),'tooltip':!0x0}),this['likeButton']['bind']('isEnabled')['to'](this),this['likeButton']['on']('execute',()=>{this['fire']('like');}),this['dislikeButton']=new _0x2cf640(this['locale']),this['dislikeButton']['set']({'icon':_0x427eb3,'label':i(this['locale'],'AI_MINI_TOOLBAR_DISLIKE'),'tooltip':!0x0}),this['dislikeButton']['bind']('isEnabled')['to'](this),this['dislikeButton']['on']('execute',()=>{this['fire']('dislike');});}['_setupCopyButton'](){this['copyButton']=new _0x2cf640(this['locale']),this['copyButton']['set']({'icon':_0x571e92,'label':i(this['locale'],'AI_MINI_TOOLBAR_COPY'),'class':'ck-ai-mini-toolbar-copy-button','tooltip':!0x0}),this['copyButton']['bind']('isEnabled')['to'](this);const _0x2805de=new _0x59b3d9();_0x2805de['set']({'content':_0x2b7211}),_0x2805de['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'](_0x2805de);}['_setupShowChangesButton'](){this['showChangesButton']=new _0x2cf640(this['locale']),this['showChangesButton']['set']({'icon':_0x1c481d,'label':i(this['locale'],'AI_SUGGESTION_BUTTON_SHOW_CHANGES'),'withText':'full'==this['_config']['showChanges'],'tooltip':'full'!=this['_config']['showChanges'],'class':'ck-ai-button-tertiary'}),this['showChangesButton']['bind']('isOn')['to'](this,'isShowChangesOn'),this['showChangesButton']['bind']('isEnabled')['to'](this),this['showChangesButton']['bind']('icon')['to'](this,'isShowChangesOn',_0x32735b=>_0x32735b?_0x339447:_0x1c481d),this['showChangesButton']['on']('execute',()=>{this['fire']('toggleShowChanges');});}}class Q extends pi{['children'];['nextButtonView'];['previousButtonView'];['focusCycler'];['_focusables'];['_focusTracker'];['_keystrokes'];['_config'];['_streamableContentView'];['_toolbarContainerView'];['_partToolbarView'];['_stateView'];['_miniToolbarView'];constructor(_0xf247af,_0xdd6ce2){super(_0xf247af);const _0x509870=this['bindTemplate'];this['set']('showDiff',!0x1),this['set']('_state','pending'),this['_focusTracker']=new _0x5f2dfb(),this['_keystrokes']=new _0x15425(),this['_focusables']=this['createCollection'](),this['focusCycler']=new _0x1af4a5({'focusables':this['_focusables'],'focusTracker':this['_focusTracker'],'keystrokeHandler':this['_keystrokes'],'actions':{'focusPrevious':'shift\x20+\x20tab','focusNext':'tab'}}),this['_config']=_0xdd6ce2,this['nextButtonView']=this['_createNextButtonView'](),this['previousButtonView']=this['_createPreviousButtonView'](),this['_streamableContentView']=new ui(_0xf247af),this['_partToolbarView']=new gi(_0xf247af,_0xdd6ce2['availableActions']),this['_partToolbarView']['delegate']('applySuggestion','insertSuggestion','rejectSuggestion')['to'](this),this['_togglePartToolbarButtonsVisibility'](_0xdd6ce2),this['_stateView']=new mi(_0xf247af),this['_stateView']['isVisible']=!0x1,this['_miniToolbarView']=new wi(_0xf247af,{'showChanges':'full'}),this['_miniToolbarView']['bind']('isShowChangesOn')['to'](this,'showDiff'),this['_miniToolbarView']['on']('toggleShowChanges',()=>{this['fire']('toggleSuggestionDisplayMode');}),this['_toolbarContainerView']=new AIChatBalloonToolbarContainerView(_0xf247af,[this['_partToolbarView'],this['_stateView'],this['_miniToolbarView']]),this['children']=this['createCollection']([this['_streamableContentView'],this['_toolbarContainerView']]),this['on']('change:_state',(_0x3cf55e,_0x5dcb3d,_0x24620a,_0x135757)=>{let _0x4e5026,_0x2b035c;'pending'===_0x135757?(_0x4e5026=this['_partToolbarView'],_0x2b035c=this['_stateView']):(_0x4e5026=this['_stateView'],_0x2b035c=this['_partToolbarView']),this['_stateView']['setState'](_0x24620a),_0x4e5026['isVisible']=!0x1,_0x2b035c['isVisible']=!0x0;}),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat-balloon-main',_0x509870['to']('_state',_0x578c8a=>'ck-ai-chat-balloon-main_state_'+_0x578c8a)]},'children':this['children']}),this['on']('change:isTrackChangesOn',()=>{this['_togglePartToolbarButtonsVisibility'](_0xdd6ce2);});}['render'](){super['render'](),this['nextButtonView']['render'](),this['previousButtonView']['render'](),this['_focusTracker']['add'](this['element']),this['_focusTracker']['add'](this['nextButtonView']),this['_focusTracker']['add'](this['previousButtonView']),this['_focusTracker']['add'](this['_miniToolbarView']),this['_focusTracker']['add'](this['_partToolbarView']),this['_keystrokes']['listenTo'](this['element']),this['_keystrokes']['listenTo'](this['nextButtonView']['element']),this['_keystrokes']['listenTo'](this['previousButtonView']['element']),this['_focusables']['addMany']([this['nextButtonView'],this['previousButtonView'],this['_partToolbarView'],this['_miniToolbarView']]);}['destroy'](){super['destroy'](),this['previousButtonView']['destroy'](),this['nextButtonView']['destroy']();}['focus'](){this['focusCycler']['focusFirst']();}['focusLast'](){this['focusCycler']['focusLast']();}async['updateContent'](_0x44944b){_0x44944b?.['keepErrors']||this['hideError'](),await this['_streamableContentView']['update'](_0x44944b);}['setState'](_0x4990c1){this['_state']=_0x4990c1;}['showError'](_0x19d038){super['showError'](_0x19d038),this['children']['has'](this['_errorView'])||this['children']['add'](this['_errorView'],0x0);}['hideError'](){this['_isErrorVisible']&&(super['hideError'](),this['togglePartToolbarEnabled'](!0x0));}['showBlockingError'](_0x1d5db1){super['showBlockingError'](_0x1d5db1),this['togglePartToolbarEnabled'](!0x1);}['toggleRotatorButtonsVisibility'](_0x4eb942){this['nextButtonView']['isVisible']=this['previousButtonView']['isVisible']=_0x4eb942;}['togglePartToolbarEnabled'](_0x2f2e72){this['_partToolbarView']['isEnabled']=_0x2f2e72;}['_togglePartToolbarButtonsVisibility']({showApplyButton:_0x167706,showSuggestButton:_0x4da5f6}){_0x167706=_0x167706&&!this['isTrackChangesOn']&&this['_config']['availableActions']['includes']('applySuggestion'),_0x4da5f6=_0x4da5f6&&this['_config']['availableActions']['includes']('insertSuggestion'),this['_partToolbarView']['setButtonsVisibility']({'showApplyButton':_0x167706,'showSuggestButton':_0x4da5f6});}['_createNextButtonView'](){const _0x5edaf1=new _0x2cf640(this['locale']);return _0x5edaf1['set']({'icon':_0x179898,'label':i(this['locale'],'AI_BALLOON_NEXT_LABEL'),'isVisible':!0x0}),_0x5edaf1['on']('execute',()=>{this['fire']('showNext');}),_0x5edaf1;}['_createPreviousButtonView'](){const _0x3c0577=new _0x2cf640(this['locale']);return _0x3c0577['set']({'icon':_0x2ca36b,'label':i(this['locale'],'AI_BALLOON_PREVIOUS_LABEL'),'isVisible':!0x0}),_0x3c0577['on']('execute',()=>{this['fire']('showPrevious');}),_0x3c0577;}}class AIChatBalloonToolbarContainerView extends _0xc3e5b1{constructor(_0x5c9354,_0x3a386d){super(_0x5c9354),this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-balloon__toolbar-container']},'children':_0x3a386d});}}class qt extends _0x361c0d{static get['requires'](){return[_0x3a1450,H];}static get['pluginName'](){return'AIChatBalloon';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['_chatBalloonView'];constructor(_0x603eae){super(_0x603eae),this['set']('showDiff',!0x1);}['open'](_0x23edb5){const _0x5a6004=this['editor'];this['_chatBalloonView']||(this['_chatBalloonView']=this['_createChatBalloonView']()),_0x5a6004['plugins']['get']('AIBalloon')['open']({..._0x23edb5,'id':'aiChatBalloon','class':'ck-ai-chat-balloon','mainView':this['_chatBalloonView']}),this['_toggleRotatorButtonsInDialogHeader'](_0x23edb5['showRotator']),this['_chatBalloonView']['togglePartToolbarEnabled'](!_0x23edb5['areActionsDisabled']),this['_restoreDefaultViewFocus']();}['close'](){this['editor']['plugins']['get']('AIBalloon')['close']();}['updateContent'](_0xa7d7c5){return this['_chatBalloonView']||(this['_chatBalloonView']=this['_createChatBalloonView']()),this['_chatBalloonView']['updateContent'](_0xa7d7c5);}['setState'](_0x17509c){this['_chatBalloonView']&&this['_chatBalloonView']['setState'](_0x17509c);}['_createChatBalloonView'](){const _0x4e9af3=this['editor'],_0x452fad=_0x4e9af3['plugins']['get']('AIBalloon'),_0x2bf02c=_0x4e9af3['commands']['get']('trackChanges');let _0x5ee80=_0x4e9af3['config']['get']('ai.availableReplyActions')||[...J];_0x4e9af3['plugins']['has']('TrackChanges')||(_0x5ee80=_0x5ee80['filter'](_0x2c4259=>'insertSuggestion'!=_0x2c4259));const _0x28de5f=new Q(_0x4e9af3['locale'],{'availableActions':_0x5ee80,'showApplyButton':!0x0,'showSuggestButton':!!_0x2bf02c});return _0x28de5f['bind']('showDiff')['to'](this),_0x28de5f['delegate'](...W)['to'](this),_0x28de5f['delegate']('showPrevious','showNext')['to'](this),_0x452fad['delegate']('dialogClosed')['to'](this),_0x28de5f['on']('applySuggestion',this['_restoreDefaultViewFocus']['bind'](this)),_0x28de5f['on']('insertSuggestion',this['_restoreDefaultViewFocus']['bind'](this)),_0x28de5f['on']('rejectSuggestion',this['_restoreDefaultViewFocus']['bind'](this)),_0x2bf02c&&_0x28de5f['bind']('isTrackChangesOn')['to'](_0x2bf02c,'value'),_0x28de5f['render'](),_0x28de5f;}['_toggleRotatorButtonsInDialogHeader'](_0x22a8b4){const _0x145099=this['editor'],_0x49040b=_0x145099['plugins']['get']('Dialog')['view']['headerView']['children'];this['_chatBalloonView']['toggleRotatorButtonsVisibility'](_0x22a8b4),_0x49040b['has'](this['_chatBalloonView']['previousButtonView'])||(_0x49040b['addMany']([this['_chatBalloonView']['previousButtonView'],this['_chatBalloonView']['nextButtonView']],0x0),_0x145099['plugins']['get']('AIBalloon')['once']('beforeDialogClosed',()=>{_0x49040b['remove'](this['_chatBalloonView']['previousButtonView']),_0x49040b['remove'](this['_chatBalloonView']['nextButtonView']);}));}['_restoreDefaultViewFocus'](){this['_chatBalloonView']['focus']();}}class AIEditorIntegration extends _0x361c0d{static get['requires'](){return[Pt,qt,zt];}static get['pluginName'](){return'AIEditorIntegration';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}function Zt(_0x46b734){const {editor:_0x5a83b6,action:_0xc822ad,withText:_0x3b5700=!0x1,withIcon:_0x50bd81=!0x0,isInDropdown:_0x144280=!0x0,shouldPreventFocus:_0x1097b6=!0x1}=_0x46b734;return()=>{const _0x55dee1=_0x5a83b6['locale'],_0x54610b=new _0x2cf640(_0x55dee1),_0x308e17=_0x54610b['bindTemplate'];_0x144280&&_0x54610b['extendTemplate']({'on':{'mouseenter':_0x308e17['to'](()=>{_0x1097b6&&_0x1097b6()||_0x54610b['focus']();})}});const _0x2943df=_0xc822ad['icon']??_0xc822ad['parent']?.['icon'];return _0x54610b['set']({'label':_0xc822ad['displayedPrompt'],'withText':_0x3b5700,'role':'menuitem','icon':_0x50bd81?_0x2943df??yt:void 0x0,'tooltip':!_0x3b5700,'class':'ck-ai-quick-actions-button','isEnabled':_0xc822ad['isEnabled']}),_0x54610b['on']('execute',()=>{_0x5a83b6['editing']['view']['focus'](),_0x5a83b6['commands']['execute']('aiQuickAction',_0xc822ad);}),_0x54610b;};}class Ps extends _0x4e6947{['arrowView'];constructor(_0x401c71,_0x705e26){super(_0x401c71,_0x705e26);const _0x3473c5=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',_0x34f9c8=>String(_0x34f9c8)),'data-cke-tooltip-disabled':_0x3473c5['to']('isOn')},'on':{'mouseenter':_0x3473c5['to']('mouseenter')}});}['render'](){super['render'](),this['children']['add'](this['arrowView']);}['_createArrowView'](){const _0xe69d46=new _0x59b3d9();return _0xe69d46['content']=_0x468b06,_0xe69d46['extendTemplate']({'attributes':{'class':'ck-dropdown-menu-list__nested-menu__button__arrow'}}),_0xe69d46;}}class Ls extends _0x163c9e{['_allListItems'];['_allSearchableItems'];constructor(_0x4c9aa3,_0x45ce8d,_0x302c8e){super(_0x4c9aa3),this['_allListItems']=_0x45ce8d,this['_allSearchableItems']=_0x302c8e;}['filter'](_0x5baf7f){if(!_0x5baf7f)return this['items']['clear'](),this['items']['addMany'](this['_allListItems']),this['_clearHighlight'](),{'resultsCount':this['_allListItems']['length'],'totalItemsCount':this['_allListItems']['length']};const _0x512e3b=_0x5baf7f['source']['toLowerCase']()['trim'](),_0x1b1cbd=this['_allSearchableItems']['filter'](_0x1d81b2=>(_0x1d81b2['groupLabel']?_0x1d81b2['label']+'\x20('+_0x1d81b2['groupLabel']+')':_0x1d81b2['label'])['toLowerCase']()['includes'](_0x512e3b));return this['items']['clear'](),this['items']['addMany'](_0x1b1cbd['sort']((_0x58d713,_0x302cf9)=>{const _0x1a82c7=_0x58d713['groupLabel'],_0x7bab25=_0x302cf9['groupLabel'];return _0x1a82c7||_0x7bab25?_0x1a82c7?0x1:-0x1:0x0;})['map'](_0x1d0226=>_0x1d0226['item'])),this['_highlightQuery'](_0x512e3b,_0x1b1cbd),{'resultsCount':_0x1b1cbd['length'],'totalItemsCount':this['_allSearchableItems']['length']};}['_highlightQuery'](_0x205719,_0x328c29){if(!_0x205719)return;const _0x317ca1=new RegExp(_0x15b1ec(_0x205719),'gi');_0x328c29['forEach'](_0x1b220a=>{_0x1b220a['highlightViews']&&_0x1b220a['highlightViews']['forEach'](_0x372eb9=>{'function'==typeof _0x372eb9['highlightText']&&_0x372eb9['highlightText'](_0x317ca1);});});}['_clearHighlight'](){this['_allSearchableItems']['forEach'](_0xc7e70=>{_0xc7e70['highlightViews']&&_0xc7e70['highlightViews']['forEach'](_0x317d49=>{'function'==typeof _0x317d49['highlightText']&&_0x317d49['highlightText'](null);});});}}const Qs='menu',Gs='menuitem';class co extends _0xc3e5b1{['_bodyCollection'];['optionsListView'];['_searchTextView']=null;['_allSearchableItems']=[];['children'];['focusTracker'];['keystrokes'];['_focusables'];['focusCycler'];['_openNestedPanels']=new Set();['_hasSearch'];constructor(_0x1b99a0,_0x4a17a3,_0x407546,_0x3be597,_0x4889a3=!0x1){const _0x1955ac=_0x1b99a0['locale'];super(_0x1955ac),this['_bodyCollection']=_0x3be597,this['_hasSearch']=_0x4889a3;const _0x2525ec=this['_createListItems'](_0x1b99a0,_0x4a17a3,_0x407546);this['optionsListView']=new Ls(_0x1955ac,_0x2525ec,this['_allSearchableItems']),this['optionsListView']['role']=Qs,this['optionsListView']['items']['addMany'](_0x2525ec),this['focusTracker']=new _0x5f2dfb(),this['keystrokes']=new _0x15425(),_0x4889a3&&(this['_searchTextView']=this['_createSearchTextView']()),this['_focusables']=_0x2525ec,this['focusCycler']=new _0x1af4a5({'focusables':this['_focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes']}),_0x4889a3&&this['_searchTextView']&&this['focusCycler']['chain'](this['_searchTextView']['focusCycler']);const _0xb7e9=_0x4889a3&&this['_searchTextView']?[this['_searchTextView']]:[this['optionsListView']];this['children']=new _0xf5a45d(_0xb7e9),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-ai-quick-actions','ck-rounded-corners'],'dir':_0x1955ac['uiLanguageDirection']},'children':this['children']});}['_createSearchTextView'](){return new _0x56da7a(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 _0x213036=this['_searchTextView']['queryView']['fieldView']['element']['ownerDocument']?.['activeElement'];return this['_searchTextView']['queryView']['fieldView']['element']['contains'](_0x213036);}['_createListItems'](_0x1e3d4b,_0x41f0d4,_0x30e576){const _0x30bfab=new _0xf5a45d();return _0x41f0d4['forEach'](_0x506acd=>{if('actions'in _0x506acd){const {listItem:_0x59ad6e}=this['_createActionGroupButton'](_0x1e3d4b,_0x506acd,_0x30e576);_0x30bfab['add'](_0x59ad6e),_0x506acd['actions']['forEach'](_0x6db175=>{this['_createActionButton'](_0x1e3d4b,_0x6db175,_0x506acd['label'],_0x506acd['icon']);const {listItem:_0x19f4aa,highlightViews:_0x36f3e8}=this['_createSearchResultActionButton'](_0x1e3d4b,_0x6db175,_0x506acd['label'],_0x506acd['icon']);this['_allSearchableItems']['push']({'item':_0x19f4aa,'label':_0x6db175['displayedPrompt'],'groupLabel':_0x506acd['label'],'highlightViews':_0x36f3e8});});}else{const {listItem:_0x350128}=this['_createActionButton'](_0x1e3d4b,_0x506acd);_0x30bfab['add'](_0x350128);const _0x54d369=_0x350128['children']['first'];if(_0x54d369){const {listItem:_0x42319d,highlightViews:_0x3381ab}=this['_createSearchResultActionButton'](_0x1e3d4b,_0x506acd);this['_allSearchableItems']['push']({'item':_0x42319d,'label':_0x54d369['label']||'','highlightViews':_0x3381ab});}}}),_0x30bfab;}['_createActionButton'](_0xa5c8f3,_0x26f572,_0x808dc,_0x2c8ef4){const _0x763dd2=new _0x663ac1(this['locale']);if(_0x808dc&&_0x2c8ef4){const _0x452815=new _0x2cf640(this['locale']),_0xbdd418=_0x452815['bindTemplate'],_0x3e47d6=new _0x19afdf();_0x3e47d6['text']=_0x26f572['displayedPrompt'];const _0x3d43c1=new _0x19afdf();_0x3d43c1['text']=_0x808dc;const _0x5e23aa=new _0x59b3d9();_0x5e23aa['content']=_0x2c8ef4,_0x5e23aa['extendTemplate']({'attributes':{'class':'ck-ai-quick-actions-button__group-icon'}});const _0x19521a=new _0xc3e5b1(this['locale']);_0x19521a['setTemplate']({'tag':'span','attributes':{'class':'ck-ai-quick-actions-button_with-group__open-paren'},'children':[{'text':'\x20('}]});const _0x4f718f=new _0xc3e5b1(this['locale']);return _0x4f718f['setTemplate']({'tag':'span','attributes':{'class':'ck-ai-quick-actions-button_with-group__close-paren'},'children':[{'text':')'}]}),_0x452815['set']({'label':_0x26f572['displayedPrompt']+'\x20('+_0x808dc+')','withText':!0x0,'role':'menuitem','class':'ck-ai-quick-actions-button\x20ck-ai-quick-actions-button_with-group','tooltip':!0x1}),_0x452815['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':[_0x3e47d6,_0x19521a,_0x5e23aa,_0x3d43c1,_0x4f718f],'on':{'mouseenter':_0xbdd418['to'](()=>{this['_isSearchFocused']()||_0x452815['focus']();}),'click':_0xbdd418['to'](()=>{_0x452815['fire']('execute');})}}),_0x452815['on']('execute',()=>{_0xa5c8f3['editing']['view']['focus'](),_0xa5c8f3['commands']['execute']('aiQuickAction',_0x26f572);}),_0x763dd2['children']['add'](_0x452815),{'listItem':_0x763dd2,'highlightViews':[_0x3e47d6,_0x3d43c1]};}{const _0x4f00ef=new _0x49352c(),_0x25f354=new _0x2cf640(this['locale'],_0x4f00ef),_0x539849=_0x25f354['bindTemplate'],_0x4115e5=_0x26f572['icon']??_0x26f572['parent']?.['icon'],_0x553bc2=void 0x0!==_0x26f572['icon'];return _0x25f354['set']({'label':_0x26f572['displayedPrompt'],'withText':!0x0,'role':'menuitem','icon':_0x553bc2?_0x4115e5??yt:void 0x0,'tooltip':!0x1,'class':'ck-ai-quick-actions-button'}),_0x25f354['extendTemplate']({'on':{'mouseenter':_0x539849['to'](()=>{this['_isSearchFocused']()||_0x25f354['focus']();})}}),_0x25f354['on']('execute',()=>{_0xa5c8f3['editing']['view']['focus'](),_0xa5c8f3['commands']['execute']('aiQuickAction',_0x26f572);}),_0x763dd2['children']['add'](_0x25f354),{'listItem':_0x763dd2,'highlightViews':[_0x4f00ef]};}}['_createSearchResultActionButton'](_0x4495ad,_0x35a78c,_0x42eb1e,_0x13031b){return _0x42eb1e&&_0x13031b?this['_createSearchResultGroupedActionButton'](_0x4495ad,_0x35a78c,_0x42eb1e,_0x13031b):this['_createSearchResultIndividualActionButton'](_0x4495ad,_0x35a78c);}['_createSearchResultGroupedActionButton'](_0x3270c6,_0x470f83,_0x293b95,_0x201a72){const _0x18782c=new _0x663ac1(this['locale']),_0x267d9e=new _0x2cf640(this['locale']),_0x11a5ea=_0x267d9e['bindTemplate'],{view:_0xc6109d,highlightView:_0x5527ac}=this['_createSearchResultGroupRow'](_0x293b95,_0x201a72),{view:_0x148700,highlightView:_0x534066}=this['_createSearchResultActionRow'](_0x470f83['displayedPrompt']),_0x5da2dc=this['_createSearchResultContentView'](_0xc6109d,_0x148700);return _0x267d9e['set']({'label':_0x470f83['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}),_0x267d9e['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':[_0x5da2dc],'on':{'mouseenter':_0x11a5ea['to'](()=>{this['_isSearchFocused']()||_0x267d9e['focus']();}),'click':_0x11a5ea['to'](()=>{this['_handleSearchResultButtonClick'](_0x267d9e);})}}),this['_setupActionButtonExecution'](_0x267d9e,_0x3270c6,_0x470f83),_0x18782c['children']['add'](_0x267d9e),{'listItem':_0x18782c,'highlightViews':[_0x5527ac,_0x534066]};}['_createSearchResultIndividualActionButton'](_0x158acc,_0x133cbd){const _0xdd610=new _0x663ac1(this['locale']),_0x5565c5=new _0x49352c(),_0x1e9d35=new _0x2cf640(this['locale'],_0x5565c5),_0x317233=_0x1e9d35['bindTemplate'];return _0x1e9d35['set']({'label':_0x133cbd['displayedPrompt'],'withText':!0x0,'role':'menuitem','icon':void 0x0,'tooltip':!0x1,'class':'ck-ai-quick-actions-button\x20ck-ai-quick-actions-search-result-button'}),_0x1e9d35['extendTemplate']({'on':{'mouseenter':_0x317233['to'](()=>{this['_isSearchFocused']()||_0x1e9d35['focus']();})}}),this['_setupActionButtonExecution'](_0x1e9d35,_0x158acc,_0x133cbd),_0xdd610['children']['add'](_0x1e9d35),{'listItem':_0xdd610,'highlightViews':[_0x5565c5]};}['_createSearchResultGroupRow'](_0x56fb92,_0x11f3c1){const _0x579709=new _0xc3e5b1(this['locale']),_0x33fcd5=new _0x59b3d9();_0x33fcd5['content']=_0x11f3c1,_0x33fcd5['extendTemplate']({'attributes':{'class':'ck-ai-quick-actions-button__group-icon'}});const _0x25be7c=new _0x19afdf();return _0x25be7c['text']=_0x56fb92,_0x579709['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-quick-actions-search-result__group-row'},'children':[_0x33fcd5,_0x25be7c]}),{'view':_0x579709,'highlightView':_0x25be7c};}['_createSearchResultActionRow'](_0x18429e){const _0xf9c7eb=new _0xc3e5b1(this['locale']),_0x3a017f=new _0x19afdf();return _0x3a017f['text']=_0x18429e,_0xf9c7eb['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-quick-actions-search-result__action-row'},'children':[_0x3a017f]}),{'view':_0xf9c7eb,'highlightView':_0x3a017f};}['_createSearchResultContentView'](_0x525ae7,_0x8a9c15){const _0x3e3cf8=new _0xc3e5b1(this['locale']);return _0x3e3cf8['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-quick-actions-search-result__content'},'children':[_0x525ae7,_0x8a9c15]}),_0x3e3cf8;}['_setupActionButtonExecution'](_0x18d183,_0x5817cf,_0x3d7ca0){_0x18d183['on']('execute',()=>{_0x5817cf['editing']['view']['focus'](),_0x5817cf['commands']['execute']('aiQuickAction',_0x3d7ca0);});}['_createActionGroupButton'](_0x5b9471,_0x5a5f51,_0xa299c7){const _0x2922a7=new _0x663ac1(this['locale']),_0x57bf85=new _0x49352c(),_0x4971aa=new Ps(this['locale'],_0x57bf85),_0x233216=_0x4971aa['bindTemplate'],_0x5f47f3=this['_getPanelKeystroke'](_0xa299c7),_0x516cc3=this['_createGroupActionsList'](_0x5b9471,_0x5a5f51['actions'],_0xa299c7);_0x4971aa['set']({'label':_0x5a5f51['label'],'withText':!0x0,'role':Gs,'icon':_0x5a5f51['icon']??yt,'isEnabled':_0x5a5f51['actions']['some'](_0x586a30=>_0x586a30['isEnabled'])}),_0x4971aa['extendTemplate']({'on':{'mouseenter':_0x233216['to'](()=>{this['_isSearchFocused']()||_0x4971aa['focus']();})}});const _0x24416c=new _0x5442ef(this['locale']);return _0x24416c['extendTemplate']({'attributes':{'class':['ck','ck-reset_all','ck-ai-quick-actions-group-panel','ck-dropdown-menu__nested-menu__panel']},'on':{'keydown':_0x233216['to'](_0x7758e3=>{this['_handlePanelKeydown'](_0x7758e3,_0x5f47f3,_0x4971aa,_0x24416c);})}}),_0x4971aa['bind']('isOn')['to'](_0x24416c,'isVisible'),this['_bodyCollection']['add'](_0x24416c),_0x24416c['content']['add'](_0x516cc3),this['_setupGroupMenuBehavior'](_0x4971aa,_0x24416c),_0x2922a7['children']['add'](_0x4971aa),{'listItem':_0x2922a7,'highlightView':_0x57bf85};}['_createGroupActionsList'](_0xa7c351,_0x5d7c9c,_0x241123){const _0x4690b0=new _0x163c9e(this['locale']);return _0x4690b0['extendTemplate']({'attributes':{'class':['ck','ck-reset_all','ck-ai-quick-actions-group-list','ck-dropdown-menu-list']}}),_0x5d7c9c['forEach'](_0x37dfaa=>{const _0x2b5921=new _0x663ac1(this['locale']),_0x41ad67=Zt({'editor':_0xa7c351,'action':_0x37dfaa,'withText':!0x0,'withIcon':!0x1,'isInDropdown':!0x0,'shouldPreventFocus':()=>this['_isSearchFocused']()})();_0x2b5921['children']['add'](_0x41ad67),_0x241123['focusTracker']['add'](_0x41ad67),_0x4690b0['items']['add'](_0x2b5921);}),_0x4690b0;}['_setupGroupMenuBehavior'](_0x6c065d,_0x242177){const _0x36db90=_0x6c065d['bindTemplate'],_0x38045e=this['_getButtonKeystroke'](_0x6c065d);_0x6c065d['extendTemplate']({'attributes':{'class':['ck-ai-quick-actions-group-button']},'on':{'mouseenter':_0x36db90['to'](()=>{this['_showNestedPanel'](_0x242177,_0x6c065d);}),'mouseleave':_0x36db90['to'](_0x12ffdb=>{const _0xd364f1=_0x12ffdb['relatedTarget'];this['_isMovingToNestedMenu'](_0xd364f1,_0x242177)||this['_hideNestedPanel'](_0x242177);}),'keydown':_0x36db90['to'](_0x3f5b32=>{_0x3f5b32['key']==_0x38045e&&(this['_showNestedPanel'](_0x242177,_0x6c065d),_0x242177['content']['get'](0x0)['focus']());})}}),_0x242177['on']('render',()=>{_0x242177['element']?.['addEventListener']('mouseleave',_0x260204=>{const _0x3976bb=_0x260204['relatedTarget'];_0x6c065d['element']?.['contains'](_0x3976bb)||this['_isMovingToNestedMenu'](_0x3976bb,_0x242177)||this['_hideNestedPanel'](_0x242177);});});}['_showNestedPanel'](_0x4bb850,_0x45f4cf){this['_openNestedPanels']['forEach'](_0xc1da15=>{_0xc1da15!==_0x4bb850&&_0xc1da15['isVisible']&&_0xc1da15['hide']();}),_0x4bb850['show'](),_0x4bb850['pin']({'positions':[_0x3770f5['eastSouth']],'target':_0x45f4cf['element'],'fitInViewport':!0x0}),this['_openNestedPanels']['add'](_0x4bb850);}['_hideNestedPanel'](_0x17240a){_0x17240a['hide'](),this['_openNestedPanels']['delete'](_0x17240a);}['_hideAllNestedPanels'](){this['_openNestedPanels']['forEach'](_0x79b9b9=>_0x79b9b9['hide']()),this['_openNestedPanels']['clear']();}['_isMovingToNestedMenu'](_0x46eca2,_0x1facf7){if(!_0x46eca2)return!0x1;if(_0x1facf7['element']?.['contains'](_0x46eca2))return!0x0;const _0x1c4eb8=_0x46eca2;return _0x1c4eb8['closest']&&(null!==_0x1c4eb8['closest']('.ck-ai-quick-actions-group-panel')||null!==_0x1c4eb8['closest']('.ck-ai-quick-actions-group-list')||null!==_0x1c4eb8['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'](_0x3dc55e){return'rtl'===_0x3dc55e['locale']['uiLanguageDirection']?'ArrowRight':'ArrowLeft';}['_getButtonKeystroke'](_0x4e2265){return'rtl'===_0x4e2265['locale']['uiLanguageDirection']?'ArrowLeft':'ArrowRight';}['_handlePanelKeydown'](_0x21b517,_0x36e23f,_0x5e65f0,_0x30209c){_0x21b517['key']==_0x36e23f&&(_0x5e65f0['focus'](),this['_hideNestedPanel'](_0x30209c));}['_handleSearchResultButtonClick'](_0x46c3ce){_0x46c3ce['fire']('execute');}}function Xt(_0x2a2ee4){const {editor:_0x43ff24,content:_0x203d34,buttonDefinition:_0x56f59a,bodyCollection:_0x58c06c,hasSearch:_0xb071bb=!0x1}=_0x2a2ee4;return()=>{const _0x50decf=_0x43ff24['locale'],_0x4222be=_0x3e48f8(_0x50decf);_0x4222be['buttonView']['set']({'icon':_0x56f59a['icon']??yt,'label':_0x56f59a['label'],'tooltip':!0x0}),_0x4222be['set']({'class':'ck-ai-quick-actions-dropdown'});const _0x4e59d1=new co(_0x43ff24,_0x203d34,_0x4222be,_0x58c06c,_0xb071bb);if(_0x4222be['panelView']['children']['add'](_0x4e59d1),_0xb071bb){const _0x32c25e='ai-quick-actions-dropdown-selection';_0x4222be['on']('change:isOpen',(_0x210ce7,_0x5a74fc,_0x2bd892)=>{if(_0x2bd892){if(_0x43ff24['plugins']['has']('AIEditing')){const _0x48101c=_0x43ff24['plugins']['get'](D),_0x4fa74c=_0x43ff24['model']['document']['selection'],_0xbc72b9=Array['from'](_0x4fa74c['getRanges']());_0xbc72b9['length']>0x0&&_0x48101c['showFakeVisualSelection'](_0xbc72b9,_0x32c25e,!0x1,!0x0);}}else _0x43ff24['plugins']['has']('AIEditing')&&_0x43ff24['plugins']['get'](D)['hideFakeVisualSelection'](_0x32c25e),_0x4e59d1['resetSearch']();});}return _0x4222be;};}const ee='<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>',ie='<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>',ne='<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 Qt=function(_0xe40bcd){return _0xe40bcd['CHAT']='CHAT',_0xe40bcd['ACTION']='ACTION',_0xe40bcd['REVIEW']='REVIEW',_0xe40bcd;}({}),va=function(_0x2d8fb0){return _0x2d8fb0['CHAT']='AIChat',_0x2d8fb0['ACTION']='AIActions',_0x2d8fb0['REVIEW']='AIReviewMode',_0x2d8fb0;}({});class ii extends _0x361c0d{static get['requires'](){return[te,tt];}static get['pluginName'](){return'AIQuickActionsUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}async['init'](){const _0x5f56a1=await this['_getDefaultAndCustomActions']();this['_prepareQuickActionsDefinition'](_0x5f56a1),this['_initializeQuickActionsComponentsAndCommands']();}static['getDefaultQuickActions'](_0x5e96fd){return function(_0x2696b3){const _0x307a29=new Intl['DisplayNames'](['en'],{'type':'language'})['of'](_0x2696b3['uiLanguage']),_0x16d77a=_0x307a29||'English',_0x10bcee=[{'id':'ask-ai','displayedPrompt':i(_0x2696b3,'AI_QUICK_ACTIONS_ASK_AI'),'type':'CHAT','icon':Gt},{'id':'chat-commands','label':i(_0x2696b3,'AI_QUICK_ACTIONS_CHAT_COMMANDS'),'icon':Gt,'actions':[{'id':'explain','displayedPrompt':i(_0x2696b3,'AI_QUICK_ACTIONS_EXPLAIN'),'prompt':ee['replace']('%0',_0x16d77a),'type':'CHAT'},{'id':'summarize','displayedPrompt':i(_0x2696b3,'AI_QUICK_ACTIONS_SUMMARIZE'),'prompt':ie['replace']('%0',_0x16d77a),'type':'CHAT'},{'id':'highlight-key-points','displayedPrompt':i(_0x2696b3,'AI_QUICK_ACTIONS_HIGHLIGHT_KEY_POINTS'),'prompt':ne['replace']('%0',_0x16d77a),'type':'CHAT'}]},{'id':'improve-writing','displayedPrompt':i(_0x2696b3,'AI_QUICK_ACTIONS_IMPROVE_WRITING'),'type':'ACTION','icon':Bt},{'id':'continue','displayedPrompt':i(_0x2696b3,'AI_QUICK_ACTIONS_CONTINUE_WRITING'),'type':'ACTION','icon':Ft},{'id':'fix-grammar','displayedPrompt':i(_0x2696b3,'AI_QUICK_ACTIONS_FIX_GRAMMAR_SPELLING'),'type':'ACTION','icon':Wt},{'id':'adjust-length','label':i(_0x2696b3,'AI_QUICK_ACTIONS_ADJUST_LENGTH'),'icon':Kt,'actions':[{'id':'make-shorter','displayedPrompt':i(_0x2696b3,'AI_QUICK_ACTIONS_MAKE_SHORTER'),'type':'ACTION'},{'id':'make-longer','displayedPrompt':i(_0x2696b3,'AI_QUICK_ACTIONS_MAKE_LONGER'),'type':'ACTION'}]},{'id':'change-tone','label':i(_0x2696b3,'AI_QUICK_ACTIONS_CHANGE_TONE'),'icon':Yt,'actions':[{'id':'make-tone-casual','displayedPrompt':i(_0x2696b3,'AI_QUICK_ACTIONS_MORE_CASUAL'),'type':'ACTION'},{'id':'make-tone-direct','displayedPrompt':i(_0x2696b3,'AI_QUICK_ACTIONS_MORE_DIRECT'),'type':'ACTION'},{'id':'make-tone-friendly','displayedPrompt':i(_0x2696b3,'AI_QUICK_ACTIONS_MORE_FRIENDLY'),'type':'ACTION'},{'id':'make-tone-confident','displayedPrompt':i(_0x2696b3,'AI_QUICK_ACTIONS_MORE_CONFIDENT'),'type':'ACTION'},{'id':'make-tone-professional','displayedPrompt':i(_0x2696b3,'AI_QUICK_ACTIONS_MORE_PROFESSIONAL'),'type':'ACTION'}]},{'id':'translate','label':i(_0x2696b3,'AI_QUICK_ACTIONS_TRANSLATE'),'icon':Vt,'actions':[{'id':'translate-to-english','displayedPrompt':i(_0x2696b3,'AI_QUICK_ACTIONS_TRANSLATE_ENGLISH'),'type':'ACTION','actionName':'translate','args':{'language':'english'}},{'id':'translate-to-chinese','displayedPrompt':i(_0x2696b3,'AI_QUICK_ACTIONS_TRANSLATE_CHINESE'),'type':'ACTION','actionName':'translate','args':{'language':'chinese'}},{'id':'translate-to-spanish','displayedPrompt':i(_0x2696b3,'AI_QUICK_ACTIONS_TRANSLATE_SPANISH'),'type':'ACTION','actionName':'translate','args':{'language':'spanish'}},{'id':'translate-to-german','displayedPrompt':i(_0x2696b3,'AI_QUICK_ACTIONS_TRANSLATE_GERMAN'),'type':'ACTION','actionName':'translate','args':{'language':'german'}},{'id':'translate-to-french','displayedPrompt':i(_0x2696b3,'AI_QUICK_ACTIONS_TRANSLATE_FRENCH'),'type':'ACTION','actionName':'translate','args':{'language':'french'}},{'id':'translate-to-japanese','displayedPrompt':i(_0x2696b3,'AI_QUICK_ACTIONS_TRANSLATE_JAPANESE'),'type':'ACTION','actionName':'translate','args':{'language':'japanese'}},{'id':'translate-to-portuguese','displayedPrompt':i(_0x2696b3,'AI_QUICK_ACTIONS_TRANSLATE_PORTUGUESE'),'type':'ACTION','actionName':'translate','args':{'language':'portuguese'}},{'id':'translate-to-korean','displayedPrompt':i(_0x2696b3,'AI_QUICK_ACTIONS_TRANSLATE_KOREAN'),'type':'ACTION','actionName':'translate','args':{'language':'korean'}},{'id':'translate-to-italian','displayedPrompt':i(_0x2696b3,'AI_QUICK_ACTIONS_TRANSLATE_ITALIAN'),'type':'ACTION','actionName':'translate','args':{'language':'italian'}},{'id':'translate-to-russian','displayedPrompt':i(_0x2696b3,'AI_QUICK_ACTIONS_TRANSLATE_RUSSIAN'),'type':'ACTION','actionName':'translate','args':{'language':'russian'}}]},{'id':'other','label':i(_0x2696b3,'AI_QUICK_ACTIONS_OTHER'),'icon':Jt,'actions':[]}];return _0x10bcee;}(_0x5e96fd);}async['_getDefaultAndCustomActions'](){const _0x32ff41=ii['getDefaultQuickActions'](this['editor']['locale']),_0x2db346=this['editor']['config']['get']('ai.quickActions.extraCommands')||[];let _0x42d863=[];try{_0x42d863=await new et({'connector':this['editor']['plugins']['get']('AIConnector'),'locale':this['editor']['locale']})['getAll']();}catch(_0x173d6a){const _0xad54aa=new _0x563e6a('ai-quick-actions-models-unable-to-retrieve',this,{'error':_0x173d6a});_0x4e5dbd(_0xad54aa['message']);}finally{const _0xe191f4=_0x2db346['map'](_0xaef8bc=>({..._0xaef8bc,'icon':void 0x0}));_0x32ff41['find'](_0x528f7b=>'other'===_0x528f7b['id'])['actions']['push'](..._0xe191f4),_0x32ff41['forEach'](_0x1438b1=>{if('actions'in _0x1438b1)_0x1438b1['actions']['forEach'](_0x1fd2fd=>{if(_0x1fd2fd['isEnabled']=!!_0x42d863['find'](_0x17c046=>_0x17c046['id']===_0x1fd2fd['model'])||void 0x0===_0x1fd2fd['model'],!_0x1fd2fd['isEnabled']){const _0xe15711=new _0x563e6a('ai-quick-actions-unavailable-model',this,{'actionId':_0x1fd2fd['id'],'modelId':_0x1fd2fd['model']});_0x4e5dbd(_0xe15711['message']);}});else{if(_0x1438b1['isEnabled']=!!_0x42d863['find'](_0x2b4cb7=>_0x2b4cb7['id']===_0x1438b1['model'])||void 0x0===_0x1438b1['model'],!_0x1438b1['isEnabled']){const _0x4c63e1=new _0x563e6a('ai-quick-actions-unavailable-model',this,{'actionId':_0x1438b1['id'],'modelId':_0x1438b1['model']});_0x4e5dbd(_0x4c63e1['message']);}}});}return _0x32ff41;}['_initializeQuickActionsComponentsAndCommands'](){const _0x689a0=new _0x340c25(this['editor']['locale']);_0x689a0['attachToDom'](),this['_initializeQuickActionsDropdown'](_0x689a0),this['_initializeQuickActionsMenuBar'](),this['_initializeQuickActionsComponents'](_0x689a0);}['_initializeQuickActionsDropdown'](_0x21e35f){const _0x43d17f=this['editor']['config']['get']('ai.quickActions.isSearchEnabled')??!0x0;this['editor']['ui']['componentFactory']['add']('aiQuickActions',Xt({'editor':this['editor'],'content':this['_quickActionsDefinition'],'buttonDefinition':{'icon':yt,'label':i(this['editor']['locale'],'AI_QUICK_ACTIONS_HEADING')},'bodyCollection':_0x21e35f,'hasSearch':_0x43d17f}));}['_prepareQuickActionsDefinition'](_0x3f7009){this['_quickActionsDefinition']=_0x3f7009['map'](_0x295004=>{if('actions'in _0x295004){const _0x395cd2=_0x295004;return{..._0x395cd2,'actions':_0x395cd2['actions']['map'](_0x1d5828=>{const {actions:_0x88eaf4,..._0x41cc81}=_0x395cd2;return{..._0x1d5828,'parent':_0x41cc81};})['filter'](_0xb1549d=>this['_shouldIncludeAction'](_0xb1549d))};}return _0x295004;})['filter'](_0x2de977=>'actions'in _0x2de977?_0x2de977['actions']['length']>0x0:this['_shouldIncludeAction'](_0x2de977));}['_shouldIncludeAction'](_0x1265eb){const _0xc21b=this['editor']['config']['get']('ai.quickActions.removeCommands')||[];return this['editor']['plugins']['has'](va[_0x1265eb['type']])&&!_0xc21b['includes'](_0x1265eb['id'])&&!('CHAT'===_0x1265eb['type']&&!0x1===this['editor']['config']['get']('ai.chat.context.document.enabled'));}['_initializeQuickActionsComponents'](_0x4d3361){this['_quickActionsDefinition']['forEach'](_0x2fb7aa=>{if('actions'in _0x2fb7aa){const _0x50692e=Xt({'editor':this['editor'],'content':_0x2fb7aa['actions'],'buttonDefinition':_0x2fb7aa,'bodyCollection':_0x4d3361});this['editor']['ui']['componentFactory']['add'](_0x2fb7aa['id'],_0x50692e),_0x2fb7aa['actions']['forEach'](_0x4572d2=>{const _0x36d179=Zt({'editor':this['editor'],'action':_0x4572d2});this['editor']['ui']['componentFactory']['add'](_0x4572d2['id'],_0x36d179);});}else{const _0x5d9c84=Zt({'editor':this['editor'],'action':_0x2fb7aa,'withText':!0x1,'withIcon':!0x0,'isInDropdown':!0x1});this['editor']['ui']['componentFactory']['add'](_0x2fb7aa['id'],_0x5d9c84);}});}['_initializeQuickActionsMenuBar'](){this['editor']['ui']['componentFactory']['add']('menuBar:aiQuickActions',_0x586367=>{const _0x37ef7b=new _0x580086(_0x586367),_0x4b2ac1=i(_0x586367,'AI_QUICK_ACTIONS_HEADING');_0x37ef7b['buttonView']['set']({'label':_0x4b2ac1,'icon':yt});const _0x171431=new _0x3dd394(_0x586367);_0x171431['set']({'ariaLabel':_0x4b2ac1,'role':'menu'}),this['_quickActionsDefinition']['forEach'](_0x27653e=>{if('actions'in _0x27653e){const _0x426d0f=_0x27653e,_0x4f5ecf=new _0x30af6d(_0x586367,_0x37ef7b),_0x38ce47=new _0x580086(_0x586367),_0x285163=new _0x3dd394(_0x586367);_0x38ce47['buttonView']['set']({'label':_0x426d0f['label'],'icon':_0x426d0f['icon']}),_0x426d0f['actions']['forEach'](_0x2ad858=>{const _0x263384=new _0x30af6d(_0x586367,_0x38ce47),_0x3448b8=new _0x226c2e(_0x586367);_0x3448b8['set']({'label':_0x2ad858['displayedPrompt'],'icon':_0x2ad858['icon'],'role':'menuitem','isEnabled':_0x2ad858['isEnabled']}),_0x3448b8['on']('execute',()=>{this['_executeQuickAction'](_0x2ad858);}),_0x3448b8['delegate']('execute')['to'](_0x38ce47),_0x263384['children']['add'](_0x3448b8),_0x285163['items']['add'](_0x263384);}),_0x38ce47['panelView']['children']['add'](_0x285163),_0x4f5ecf['children']['add'](_0x38ce47),_0x171431['items']['add'](_0x4f5ecf);}else{const _0x60e745=_0x27653e,_0xf6397f=new _0x30af6d(_0x586367,_0x37ef7b),_0x23e568=new _0x226c2e(_0x586367);_0x23e568['set']({'label':_0x60e745['displayedPrompt'],'icon':_0x60e745['icon'],'role':'menuitem','isEnabled':_0x60e745['isEnabled']}),_0x23e568['on']('execute',()=>{this['_executeQuickAction'](_0x60e745);}),_0x23e568['delegate']('execute')['to'](_0x37ef7b),_0xf6397f['children']['add'](_0x23e568),_0x171431['items']['add'](_0xf6397f);}});const _0x4f95d1=Object['values'](va)['some'](_0x1a2514=>this['editor']['plugins']['has'](_0x1a2514));return _0x37ef7b['set']({'isEnabled':_0x4f95d1}),_0x37ef7b['panelView']['children']['add'](_0x171431),_0x37ef7b;});}['_executeQuickAction'](_0x5e4a8a){const _0x34930c=this['editor'];_0x34930c['editing']['view']['focus'](),_0x34930c['commands']['execute']('aiQuickAction',_0x5e4a8a);const _0x3f855a=_0x34930c['ui']['view']['menuBarView'];_0x3f855a&&_0x3f855a['close']&&_0x3f855a['close']();}}class ci extends Lt{['execute'](_0x43c141){switch(this['_expandSelectionIfCollapsed'](),_0x43c141['type']){case Qt['CHAT']:if(!this['editor']['plugins']['has']('AIChat')){const _0x5bf322=i(this['editor']['locale'],'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND','AIChat');throw new _0x563e6a('ai-quick-actions-plugin-not-found',this['editor'],{'errorMessage':_0x5bf322});}this['_handleAIChatAction'](_0x43c141);break;case Qt['ACTION']:if(!this['editor']['plugins']['has']('AIActions')){const _0x47e110=i(this['editor']['locale'],'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND','AIActions');throw new _0x563e6a('ai-quick-actions-plugin-not-found',this['editor'],{'errorMessage':_0x47e110});}this['_handleAIActionsAction'](_0x43c141);break;case Qt['REVIEW']:if(!this['editor']['plugins']['has']('AIReviewMode')){const _0x6cb88e=i(this['editor']['locale'],'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND','AIReviewMode');throw new _0x563e6a('ai-quick-actions-plugin-not-found',this['editor'],{'errorMessage':_0x6cb88e});}this['_handleAIReviewAction'](_0x43c141);}}async['_handleAIChatAction'](_0x52ad2e){const _0x5e3c04=this['editor']['plugins']['get']('AIChat'),_0x2f5e10=this['editor']['plugins']['get']('AIChatController'),_0x557572=this['editor']['plugins']['get']('AITabs')['view'];if(_0x557572['isVisible']||(_0x557572['isVisible']=!0x0),'chat'!==_0x557572['activeTab']&&_0x557572['activateTab']('chat'),'ask-ai'===_0x52ad2e['id'])_0x2f5e10['removeSelectionFromChatContext'](),await _0x5e3c04['addSelectionToChatContext'](),_0x5e3c04['focusPromptInput']();else await _0x5e3c04['startConversation'](),_0x2f5e10['removeSelectionFromChatContext'](),await _0x5e3c04['addSelectionToChatContext'](),_0x5e3c04['focusPromptInput'](),await _0x5e3c04['sendMessage']({'message':_0x52ad2e['prompt']||_0x52ad2e['displayedPrompt'],'attributes':{'quickActionData':{'id':_0x52ad2e['id']},'displayedPrompt':_0x52ad2e['displayedPrompt']}});}['_expandSelectionIfCollapsed'](){const _0x2de3da=this['editor'],_0x135595=_0x2de3da['model']['document']['selection'];if(!_0x135595['isCollapsed'])return;const _0x74579c=_0x42aa06(_0x135595['getSelectedBlocks']())||_0x2de3da['model']['schema']['getLimitElement'](_0x135595);_0x2de3da['model']['change'](_0x5c8601=>{_0x5c8601['setSelection'](_0x74579c,'in');});}['_handleAIActionsActionLabel'](_0x59fbcb){return _0x59fbcb['parent']?.['label']&&'other'!==_0x59fbcb['parent']?.['id']?_0x59fbcb['parent']['label']+':\x20'+_0x59fbcb['displayedPrompt']:_0x59fbcb['displayedPrompt'];}async['_handleAIActionsAction'](_0x500d6e){const _0x487e64=this['editor']['plugins']['get']('AIActions'),_0xa1f8c3=_0x500d6e['prompt']?{'userMessage':_0x500d6e['prompt'],'model':_0x500d6e['model']}:{'actionName':_0x500d6e['actionName']||_0x500d6e['id'],'args':_0x500d6e['args']},_0x47e271=this['_handleAIActionsActionLabel'](_0x500d6e);await _0x487e64['executeAction'](_0xa1f8c3,_0x47e271,_0x500d6e['icon']);}async['_handleAIReviewAction'](_0x29ad2d){console['log']('handleAIReviewAction',_0x29ad2d);}}class ti extends _0x361c0d{static get['pluginName'](){return'AIQuickActionsEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x327d7d=this['editor'],_0x17867f=new ci(this['editor']);if(_0x327d7d['commands']['add']('aiQuickAction',_0x17867f),_0x327d7d['plugins']['has']('AIChat')){const _0x1ad575=this['editor']['plugins']['get']('AIChat');_0x327d7d['model']['document']['selection']['on']('change:range',(_0x13fc09,_0x4e31f2)=>{_0x4e31f2['directChange']&&_0x1ad575['removeSelectionFromChatContext']();});}}}class gs extends xi{['updateChangeGroups'](){if(this['parsedMergedContent']=this['parsedContent']['cloneNode'](!0x0),0x0==this['parsedMergedContent']['childNodes']['length'])return void(this['changeGroups']=[]);const _0x5ed329=this['documentContextContent']['children']['map'](_0x1e0138=>({'node':_0x1e0138,'id':ut(_0x1e0138,'data-id')})),_0x40f9bb=this['parsedMergedContent']['children']['map'](_0x13b29b=>({'node':_0x13b29b,'id':ut(_0x13b29b,'data-id')||_0x48eb5e()})),_0x1af15b=_0x411a1f(_0x5ed329,_0x40f9bb,{'comparator':(_0x59f3e5,_0x57072b)=>_0x59f3e5['id']==_0x57072b['id'],'oneChangePerToken':!0x0});if(!this['isDone']){for(;_0x1af15b['length']&&_0x1af15b[_0x1af15b['length']-0x1]['removed'];)_0x1af15b['pop']();}const _0x857260=_0x1af15b['map'](_0x5146bd=>{const _0x473733=_0x5146bd['added']?'new':_0x5146bd['removed']?'removed':'modified';return{'node':_0x5146bd['value'][0x0]['node'],'type':_0x473733,'id':_0x5146bd['value'][0x0]['id']};});this['changeGroups']=[{'changes':_0x857260,'state':'pending','index':0x0}];}['_getDifferentChangeGroups'](_0x566509,_0x52a27c){return _0x52a27c;}}class ft extends os{['content'];['version'];['actionName'];['args'];['userMessage'];['model'];['hasError']=!0x1;constructor(_0x2330d8){super(_0x2330d8),this['content']=_0x2330d8['content'],this['version']=_0x2330d8['version'],this['actionName']=_0x2330d8['actionName'],this['args']=_0x2330d8['args'],this['userMessage']=_0x2330d8['userMessage'],this['model']=_0x2330d8['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':xe['TEXT'],'content':this['content'],'version':this['version'],'label':'Current\x20document','uiId':'current-document'};}['createReply'](_0x5a4959){const _0x93d611=new gs({'editor':this['editor'],'documentContextContent':this['content'],..._0x5a4959});return this['replies']['push'](_0x93d611),_0x93d611['delegate'](...De)['to'](this),this['fire']('replyCreated',_0x93d611),_0x93d611;}}class Bn extends _0x14c71e{constructor(_0x4b0f1a,_0x9ac714=!0x0,_0x2a6768=!0x0){super(_0x4b0f1a),this['set']('isEnabled',!0x1),_0x9ac714&&(this['applyButton']=this['_createButton'](i(_0x4b0f1a,'AI_BALLOON_APPLY_BUTTON'),'ck-ai-button-primary'),this['applyButton']['bind']('isEnabled')['to'](this),this['items']['add'](this['applyButton'])),_0x2a6768&&(this['suggestButton']=this['_createButton'](i(_0x4b0f1a,'AI_BALLOON_SUGGEST_BUTTON'),_0x9ac714?'ck-ai-button-secondary':'ck-ai-button-primary'),this['suggestButton']['bind']('isEnabled')['to'](this),this['items']['add'](this['suggestButton'])),this['setButtonsVisibility']({'showApplyButton':_0x9ac714,'showSuggestButton':_0x2a6768}),this['extendTemplate']({'attributes':{'class':['ck-ai-balloon__toolbar']}});}['setButtonsVisibility']({showApplyButton:_0x3f0a4e,showSuggestButton:_0x3ff4fe}){this['applyButton']&&(this['applyButton']['isVisible']=_0x3f0a4e),this['suggestButton']&&(this['suggestButton']['isVisible']=_0x3ff4fe);}['_createButton'](_0xd5209d,_0xd67b98){const _0x64226b=new _0x2cf640(this['locale']);return _0x64226b['set']({'label':_0xd5209d,'class':_0xd67b98,'isVisible':!0x0,'withText':!0x0}),_0x64226b;}}class yn extends _0xc3e5b1{constructor(_0x53d478){super(_0x53d478),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(_0x53d478,'AI_DISCLAIMER_TEXT')}]}]});}}class Nn extends _0xc3e5b1{constructor(_0x112b89){super(_0x112b89),this['set']('isVisible',!0x0);const _0x27ef00=new Ze('small');_0x27ef00['isVisible']=!0x0;const _0x12146c=new _0xc3e5b1(this['locale']);_0x12146c['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-suggestion__loader-text']},'children':[i(this['locale'],'AI_CHAT_IS_WRITING')]}),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__loader',this['bindTemplate']['if']('isVisible','ck-hidden',_0x40efbb=>!_0x40efbb)]},'children':[_0x27ef00,_0x12146c]});}}class Tt extends pi{['focusCycler'];['_config'];['_contentWrapper'];['_streamableContentView'];['_toolbarView'];['_miniToolbarView'];['_loaderView'];['_disclaimerView'];['_focusTracker'];['_keystrokes'];['_dialogContent'];['_focusables'];['_scrollManager'];['_navigationPreviousButton'];['_navigationNextButton'];['_navigationTryAgainButton'];['_navigationCounter'];constructor(_0xf7bf0d,_0x384af7){super(_0xf7bf0d),this['set']('isBusy',!0x1),this['set']('isTrackChangesOn',!0x1),this['set']('_isLoading',!0x1),this['set']('_hasError',!0x1),this['_config']=_0x384af7,this['_focusTracker']=new _0x5f2dfb(),this['_keystrokes']=new _0x15425(),this['_focusables']=this['createCollection'](),this['focusCycler']=new _0x1af4a5({'focusables':this['_focusables'],'focusTracker':this['_focusTracker'],'keystrokeHandler':this['_keystrokes'],'actions':{'focusPrevious':'shift\x20+\x20tab','focusNext':'tab'}}),this['_dialogContent']=new _0xf5a45d(),this['_addContentWrapper'](_0x384af7),this['_addDisclaimerView'](),this['_addToolbar'](_0x384af7),this['_focusables']['clear'](),this['_focusables']['addMany']([this['_toolbarView']]),this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-actions-balloon-main']},'children':this['_dialogContent']}),this['on']('change:isTrackChangesOn',()=>{this['_toggleToolbarButtonsVisibility'](_0x384af7);});}['render'](){super['render']();for(const _0x248ca2 of this['_focusables'])this['_focusTracker']['add'](_0x248ca2['element']);this['_keystrokes']['listenTo'](this['element']),this['_initializeScrollManager']();}['destroy'](){super['destroy'](),this['_scrollManager']&&this['_scrollManager']['destroy']();}['focus'](_0x140cab){-0x1===_0x140cab?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}['setIsLoading'](_0x20418b){this['_isLoading']=_0x20418b;}['setErrorState'](){this['_hasError']=!0x0,this['_miniToolbarView']['toggleShowChangesEnabled'](!0x1);}['clearErrorState'](){this['_hasError']=!0x1,this['_miniToolbarView']['toggleShowChangesEnabled'](!0x0);}['showError'](_0x130398){super['showError'](_0x130398),this['_dialogContent']['has'](this['_errorView'])||this['_dialogContent']['add'](this['_errorView'],0x0);}['hideError'](){super['hideError'](),this['clearErrorState']();}['showBlockingError'](_0x699e57){super['showBlockingError'](_0x699e57),this['setErrorState']();}['addMiniToolbarItem'](_0x59174c){this['_miniToolbarView']['items']['has'](_0x59174c)||this['_miniToolbarView']['items']['add'](_0x59174c);}['removeMiniToolbarItem'](_0x174d17){this['_miniToolbarView']['items']['has'](_0x174d17)&&this['_miniToolbarView']['items']['remove'](_0x174d17);}['showLoader'](){this['_loaderView']&&(this['_isLoading']=!0x0);}['hideLoader'](){this['_loaderView']&&(this['_isLoading']=!0x1);}['_toggleToolbarButtonsVisibility']({showApplyButton:_0x46db8a,showSuggestButton:_0x2d797f}){_0x46db8a=_0x46db8a&&!this['isTrackChangesOn']&&this['_config']['availableActions']['includes']('applySuggestion'),_0x2d797f=_0x2d797f&&this['_config']['availableActions']['includes']('insertSuggestion'),this['_toolbarView']['setButtonsVisibility']({'showApplyButton':_0x46db8a,'showSuggestButton':_0x2d797f});}async['updateContent'](_0x270ab4){await this['_streamableContentView']['update'](_0x270ab4);}['clearContent'](){this['_streamableContentView']['clear']();}['_addContentWrapper'](_0x46c4d8){this['_contentWrapper']=new _0xc3e5b1(this['locale']),this['_contentWrapper']['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-actions-balloon-content']},'children':[{'tag':'div','attributes':{'class':['ck-ai-actions-balloon-content-wrapper']},'children':[this['_createLoaderView'](),this['_createStreamableContentView']()]},this['_createMiniToolbar'](_0x46c4d8['miniToolbarConfig'])]}),this['_dialogContent']['add'](this['_contentWrapper']);}['_addDisclaimerView'](){this['_disclaimerView']=new yn(this['locale']),this['_dialogContent']['add'](this['_disclaimerView']);}['_addToolbar']({showApplyButton:_0x449065,showSuggestButton:_0x3abbfa}){this['_toolbarView']=new Bn(this['locale'],_0x449065,_0x3abbfa),this['_toolbarView']['applyButton']?.['on']('execute',()=>{this['fire']('applySuggestion');}),this['_toolbarView']['suggestButton']?.['on']('execute',()=>{this['fire']('insertSuggestion');}),this['_toolbarView']['bind']('isEnabled')['to'](this,'isBusy',this,'_isLoading',this,'_hasError',(_0x2a7633,_0x161b62,_0x3b32e4)=>!(_0x2a7633||_0x161b62||_0x3b32e4)),this['_toggleToolbarButtonsVisibility']({'showApplyButton':_0x449065,'showSuggestButton':_0x3abbfa}),this['_dialogContent']['add'](this['_toolbarView']);}['_createMiniToolbar'](_0x91c38d){return this['_miniToolbarView']=new wi(this['locale'],_0x91c38d),this['_miniToolbarView']['delegate'](...W)['to'](this),this['_miniToolbarView']['on']('toggleShowChanges',()=>{this['_miniToolbarView']['isShowChangesOn']=!this['_miniToolbarView']['isShowChangesOn'],this['fire']('toggleSuggestionDisplayMode',{'showDiff':this['_miniToolbarView']['isShowChangesOn']});}),this['_miniToolbarView']['bind']('isEnabled')['to'](this,'isBusy',this,'_isLoading',(_0x5e28e2,_0x211a1d)=>!(_0x5e28e2||_0x211a1d)),this['_miniToolbarView'];}['_createLoaderView'](){return this['_loaderView']=new Nn(this['locale']),this['_loaderView']['bind']('isVisible')['to'](this,'_isLoading'),this['_loaderView'];}['_createStreamableContentView'](){return this['_streamableContentView']=new ui(this['locale']),this['_streamableContentView'];}['_setupMiniToolbarButtons'](){const _0x5a3620=new _0x2cf640(this['locale']),_0x2480e8=new _0x2cf640(this['locale']),_0x2fdff9=new AIActionsBalloonNavigationCounterView(this['locale']),_0x3f564=new _0x2cf640(this['locale']);_0x5a3620['set']({'icon':_0x42e42d,'label':i(this['locale'],'AI_ACTIONS_TRY_AGAIN'),'tooltip':!0x0,'class':'ck-ai-custom-action-button'}),_0x2480e8['set']({'icon':_0x5d4f8c,'tooltip':i(this['locale'],'AI_ACTIONS_PREVIOUS_INTERACTION'),'class':'ck-ai-navigation-button\x20ck-ai-previous-button'}),_0x3f564['set']({'icon':_0x254ba8,'tooltip':i(this['locale'],'AI_ACTIONS_NEXT_INTERACTION'),'class':'ck-ai-navigation-button\x20ck-ai-next-button'}),_0x5a3620['bind']('isEnabled')['to'](this,'isBusy',_0x37b23a=>!_0x37b23a),_0x5a3620['on']('execute',()=>{this['fire']('tryAgain');}),_0x2480e8['bind']('isEnabled')['to'](this,'isBusy',_0x36e150=>!_0x36e150),_0x2480e8['on']('execute',()=>{this['fire']('showPrevious');}),_0x3f564['bind']('isEnabled')['to'](this,'isBusy',_0x4c4f09=>!_0x4c4f09),_0x3f564['on']('execute',()=>{this['fire']('showNext');}),this['_navigationPreviousButton']=_0x2480e8,this['_navigationCounter']=_0x2fdff9,this['_navigationNextButton']=_0x3f564,this['_navigationTryAgainButton']=_0x5a3620;}['updateMiniToolbarButtons'](_0x5af9c7,_0x17d5ba){this['_navigationPreviousButton']||this['_setupMiniToolbarButtons']();const _0x40c8dd=_0x5af9c7>0x1;if(this['addMiniToolbarItem'](this['_navigationTryAgainButton']),_0x40c8dd){this['addMiniToolbarItem'](this['_navigationPreviousButton']),this['addMiniToolbarItem'](this['_navigationCounter']),this['addMiniToolbarItem'](this['_navigationNextButton']);const _0x1d8e0f=_0x5af9c7-_0x17d5ba;this['_navigationCounter']['setInteractionCount'](_0x1d8e0f+'/'+_0x5af9c7),this['_navigationPreviousButton']['isEnabled']=_0x17d5ba<_0x5af9c7-0x1,this['_navigationNextButton']['isEnabled']=_0x17d5ba>0x0;}else this['removeMiniToolbarItem'](this['_navigationPreviousButton']),this['removeMiniToolbarItem'](this['_navigationCounter']),this['removeMiniToolbarItem'](this['_navigationNextButton']);}['disableMiniToolbarButtons'](){this['_navigationTryAgainButton']['isEnabled']=!0x1,this['_navigationPreviousButton']['isEnabled']=!0x1,this['_navigationNextButton']['isEnabled']=!0x1;}['startAutoScroll'](){this['_initializeScrollManager'](),this['_scrollManager']&&this['_scrollManager']['start']();}['stopAutoScroll'](){this['_scrollManager']&&this['_scrollManager']['stop']();}['toggleIsLoading'](_0x1c1950){this['_isLoading']=_0x1c1950;}['resetShowChangesButton'](){this['_miniToolbarView']['isShowChangesOn']=!0x1;}['_initializeScrollManager'](){const _0x24b7b4=this['_getScrollableElement']();_0x24b7b4&&!this['_scrollManager']&&(this['_scrollManager']=new Qe(_0x24b7b4));}['_getScrollableElement'](){return this['_streamableContentView']['element'];}}class AIActionsBalloonNavigationCounterView extends _0xc3e5b1{constructor(_0x28280e){super(_0x28280e);const _0x1778aa=this['bindTemplate'];this['set']('interactionCount','1/1'),this['setTemplate']({'tag':'span','attributes':{'class':['ck-ai-interaction-counter']},'children':[{'text':_0x1778aa['to']('interactionCount')}]});}['setInteractionCount'](_0x6e8e99){this['set']('interactionCount',_0x6e8e99);}}class ri extends _0x361c0d{static get['requires'](){return[tt,_0x3a1450,D,H,ot];}static get['pluginName'](){return'AIActions';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['_aiConnector'];['_interactions']=[];['_currentInteractionIndex']=0x0;['_interactionParams'];['_balloonShowDiff']=!0x1;['_promiseQueue'];['_bodyCollection'];get['_interaction'](){return this['_interactions'][this['_interactions']['length']-0x1];}['_actionsBalloonView'];constructor(_0x44927d){super(_0x44927d),this['_bodyCollection']=new _0x340c25(this['editor']['locale']),this['_bodyCollection']['attachToDom'](),this['_aiConnector']=this['editor']['plugins']['get']('AIConnector'),this['set']('isBusy',!0x1),this['_promiseQueue']=new St();}['stopInteraction'](){this['_stopInteraction']();}async['executeAction'](_0x5ce5ad,_0x309b9c,_0x2175af){if(this['_stopInteraction'](),this['editor']['plugins']['has']('TableSelection')){if(this['editor']['plugins']['get']('TableSelection')['getSelectedTableCells']()){const {modelFragment:_0x47d2a9,anchorData:_0x4e381f}=this['_getExecuteDataInTable']();return this['_executeAction'](_0x5ce5ad,_0x47d2a9,_0x4e381f,_0x309b9c,_0x2175af);}}const {modelFragment:_0x349672,anchorData:_0x2fc015}=this['_getExecuteDataRegular']();return this['_executeAction'](_0x5ce5ad,_0x349672,_0x2fc015,_0x309b9c,_0x2175af);}async['destroy'](){return this['_stopInteraction'](),this['_bodyCollection']['detachFromDom'](),super['destroy']();}['_createActionsBalloonView'](){const _0x2d909d=this['editor']['plugins']['has']('TrackChanges');let _0x1b2637=this['editor']['config']['get']('ai.availableReplyActions')||[...J];_0x2d909d||(_0x1b2637=_0x1b2637['filter'](_0x35865c=>'insertSuggestion'!=_0x35865c));const _0x147ca4=this['editor']['commands']['get']('trackChanges'),_0x5d3b38=new Tt(this['editor']['locale'],{'showApplyButton':!0x0,'showSuggestButton':_0x2d909d,'miniToolbarConfig':{'showChanges':'icon'},'availableActions':_0x1b2637});return _0x5d3b38['bind']('isBusy')['to'](this),_0x147ca4&&_0x5d3b38['bind']('isTrackChangesOn')['to'](_0x147ca4,'value'),_0x5d3b38['on']('tryAgain',()=>{this['_refreshInteraction']();}),_0x5d3b38['on']('showPrevious',()=>{this['_navigateToPrevious']();}),_0x5d3b38['on']('showNext',()=>{this['_navigateToNext']();}),_0x5d3b38;}['_getExecuteDataRegular'](){const _0xcd128a=this['editor']['model']['document']['selection'];if(_0xcd128a['isCollapsed']){const _0x4ccfb7=_0x42aa06(_0xcd128a['getSelectedBlocks']())||this['editor']['model']['schema']['getLimitElement'](_0xcd128a);this['editor']['model']['change'](_0x32a840=>{_0x32a840['setSelection'](_0x4ccfb7,'in');});}const _0x4f8228=_0xcd128a['getFirstRange'](),_0x3eb8fe=this['_wrapWithCommonAncestors'](this['editor']['model']['getSelectedContent'](_0xcd128a),_0x4f8228['start'],_0x4f8228['end']);this['_copyMarkersToFragment'](_0x3eb8fe,_0xcd128a,{'isTableSelection':!0x1});const _0x5677dc=_0xcd128a['getFirstRange']()['start'],_0x4512ec=new Map();let _0x5a9cf7=_0x3eb8fe;for(let _0x445646=0x0;_0x445646<_0x5677dc['path']['length'];_0x445646++)_0x4512ec['set'](_0x5a9cf7,_0x5677dc['path'][_0x445646]),_0x5a9cf7=_0x5a9cf7['getChild'](0x0);return{'modelFragment':_0x3eb8fe,'anchorData':_0x4512ec};}['_getExecuteDataInTable'](){const _0x1e2d8c=this['editor']['model']['document']['selection'],_0x4fd866=this['editor']['plugins']['get']('TableSelection')['getSelectionAsFragment'](),_0xb7d20e=_0x1e2d8c['getFirstRange']()['start']['parent']['parent'],_0x59fa84=this['editor']['model']['createRange'](this['editor']['model']['createPositionBefore'](_0xb7d20e),this['editor']['model']['createPositionAfter'](_0xb7d20e)),_0x5779e9=this['_wrapWithCommonAncestors'](_0x4fd866,_0x59fa84['start'],_0x59fa84['end']);this['_copyMarkersToFragment'](_0x5779e9,_0x1e2d8c,{'isTableSelection':!0x0});const _0x402685=_0x1e2d8c['getFirstRange']()['start'],_0x22f60c=new Map();let _0x5e4ae2=_0x5779e9;for(let _0x12f94d=0x0;_0x12f94d<_0x402685['path']['length'];_0x12f94d++)if(_0x22f60c['set'](_0x5e4ae2,_0x402685['path'][_0x12f94d]),_0x12f94d<_0x402685['path']['length']-0x1)_0x5e4ae2=_0x5e4ae2['getChild'](0x0);else{let _0x5f4030=_0x5e4ae2['nextSibling'];for(;_0x5f4030;)_0x22f60c['set'](_0x5f4030,_0x402685['path'][_0x12f94d]),_0x5f4030=_0x5f4030['nextSibling'];}return{'modelFragment':_0x5779e9,'anchorData':_0x22f60c};}async['_executeAction'](_0x53c330,_0x11a0be,_0x27ea7c,_0x380795,_0x490d09){const _0x2aae89=this['editor']['plugins']['get'](D),_0x30df0d=this['editor']['plugins']['get'](H),_0xcf83c7=this['editor']['model']['document']['selection'],_0x25be3d=await _0x2aae89['modelToDataWithIds'](_0x11a0be),_0x311669=this['editor']['model']['document']['version'],_0x4f6906=[..._0xcf83c7['getRanges']()];return this['_actionsBalloonView']||(this['_actionsBalloonView']=this['_createActionsBalloonView']()),this['_clearInteractionHistory'](),this['_clearErrorState'](),this['_actionsBalloonView']['clearContent'](),_0x30df0d['open']({'index':0x3e8*Math['random']()%0x3e8,'title':_0x380795,'icon':_0x490d09||yt,'mainView':this['_actionsBalloonView'],'class':'ck-ai-actions-balloon','ranges':_0x4f6906,'id':'aiActionsBalloon'}),this['_setLoadingState'](),this['stopListening'](this['_actionsBalloonView']),this['stopListening'](_0x30df0d),this['_interactionParams']={'action':_0x53c330,'content':_0x25be3d,'version':_0x311669,'aiBalloon':_0x30df0d,'modelFragment':_0x11a0be,'anchorData':_0x27ea7c},this['_setupApplyListeners'](),this['listenTo'](_0x30df0d,'selectionRemoved',()=>{this['_stopInteraction'](),this['_actionsBalloonView']['disableMiniToolbarButtons']();}),this['listenTo'](_0x30df0d,'dialogClosed',(_0x56c444,{id:_0x5bef28})=>{if('aiActionsBalloon'===_0x5bef28){if(this['_interaction']&&this['_interaction']['replies']['length']>0x0){const _0x427ef0=this['_interaction']['replies'][this['_interaction']['replies']['length']-0x1],_0x215ae6=_0x427ef0['changeGroups'][0x0];_0x215ae6&&'pending'===_0x215ae6['state']&&_0x427ef0['setChangeGroupState'](0x0,'rejected');}this['_stopInteraction'](),this['_clearInteractionHistory'](),this['stopListening'](this['_actionsBalloonView']),this['stopListening'](_0x30df0d);}}),this['_createInteraction'](_0x25be3d,_0x311669,_0x30df0d,_0x53c330);}['_setupApplyListeners'](){if(!this['_interactionParams'])return;const {modelFragment:_0x2ac4f2,anchorData:_0x48b73c}=this['_interactionParams'];this['listenTo'](this['_actionsBalloonView'],'applySuggestion',()=>{this['_applyChanges'](_0x2ac4f2,_0x48b73c,!0x1);}),this['listenTo'](this['_actionsBalloonView'],'insertSuggestion',()=>{this['_applyChanges'](_0x2ac4f2,_0x48b73c,!0x0);});}['_wrapWithCommonAncestors'](_0x5b08f6,_0x72d138,_0x48ae3a){const _0x19338d=this['editor']['model']['createRange'](_0x72d138,_0x48ae3a)['getCommonAncestor'](),_0xac423c=_0x19338d['is']('documentFragment')?[]:_0x19338d['getAncestors']({'includeSelf':!0x0})['slice'](0x1);if(_0xac423c['length']){const _0x4e5b13=_0xac423c['map'](_0x4819ec=>_0x4819ec['_clone'](!0x1));for(let _0x432e29=0x1;_0x432e29<_0x4e5b13['length'];_0x432e29++)_0x4e5b13[_0x432e29-0x1]['_appendChild'](_0x4e5b13[_0x432e29]);return _0x4e5b13[_0x4e5b13['length']-0x1]['_appendChild'](_0x5b08f6),new bt(_0x4e5b13[0x0]);}return _0x5b08f6;}['_copyMarkersToFragment'](_0x34352a,_0x3a5ace,_0x5b2609={'isTableSelection':!0x1}){const _0x3b9265=this['editor']['model'],_0x228775=Array['from'](_0x3a5ace['getRanges']()),_0x491e8f=_0x3a5ace['getFirstRange']()['start'];for(const _0x1c5a2b of _0x3b9265['markers']){if(_0x1c5a2b['name']['startsWith'](R)||!_0x1c5a2b['affectsData'])continue;const _0x4ff181=_0x1c5a2b['getRange']();if(!_0x228775['some'](_0x37fae0=>_0x37fae0['containsRange'](_0x4ff181,!0x0)))continue;const _0x174a37=this['_regularCalculateMarkerPath'](_0x4ff181['start'],_0x491e8f,_0x5b2609['isTableSelection']),_0x5b4f96=this['_regularCalculateMarkerPath'](_0x4ff181['end'],_0x491e8f,_0x5b2609['isTableSelection']),_0x2e5e4d=_0x3b9265['createPositionFromPath'](_0x34352a,_0x174a37),_0xfaaf61=_0x3b9265['createPositionFromPath'](_0x34352a,_0x5b4f96);if(!_0x2e5e4d['isEqual'](_0xfaaf61)){const _0x29bbf8=_0x3b9265['createRange'](_0x2e5e4d,_0xfaaf61);_0x34352a['markers']['set'](_0x1c5a2b['name'],_0x29bbf8);}}}['_regularCalculateMarkerPath'](_0x57a5bb,_0x146a4a,_0x20fb5e=!0x1){const _0x3e8d45=[..._0x57a5bb['path']['slice']()];for(let _0x571c8c=0x0;_0x571c8c<Math['max'](_0x146a4a['path']['length'],_0x57a5bb['path']['length']);_0x571c8c++){const _0x52f1f6=_0x146a4a['path'][_0x571c8c]||0x0,_0x2aed4c=(_0x57a5bb['path'][_0x571c8c]||0x0)-_0x52f1f6;if(_0x3e8d45[_0x571c8c]=_0x2aed4c,0x0!==_0x2aed4c&&!_0x20fb5e)break;}return _0x3e8d45;}async['_createInteraction'](_0x2c9739,_0x3a2b61,_0x535cf3,_0x267f6e){const _0x4f9c95=this['editor'];this['_interactionParams']||(this['_interactionParams']={'action':_0x267f6e,'content':_0x2c9739,'version':_0x3a2b61,'aiBalloon':_0x535cf3,'modelFragment':this['editor']['model']['getSelectedContent'](this['editor']['model']['document']['selection']),'anchorData':new Map()});const _0x5ca080=new ft({'connector':this['_aiConnector'],'editor':_0x4f9c95,'content':_0x2c9739,'version':_0x3a2b61,..._0x267f6e});this['_interactions']['push'](_0x5ca080);const _0x23443c=(_0x4e65ce,_0x4d542d=!0x1,_0x3bdaa1='streaming')=>this['_promiseQueue']['enqueue'](async _0x4d8274=>{try{const _0xf7b426=wt({'editor':_0x4f9c95,'changeGroups':_0x4e65ce['changeGroups'],'documentContextContent':_0x4e65ce['documentContextContent'],'showDiff':_0x4d542d,'trimUnchanged':!0x1});_0xf7b426['length']&&await this['_actionsBalloonView']['updateContent']({'part':_0xf7b426[0x0],'renderingStrategy':_0x3bdaa1,'abortSignal':_0x4d8274});}catch(_0x381fd2){if(this['_isAbortError'](_0x381fd2))return;throw _0x381fd2;}});this['_interaction']['on']('replyCreated',(_0x469806,_0x21af90)=>{this['_actionsBalloonView']['hideLoader'](),this['_actionsBalloonView']['startAutoScroll'](),_0x23443c(_0x21af90)['catch'](_0xad27a5=>{this['_isAbortError'](_0xad27a5)||(console['error']('Error\x20updating\x20content\x20in\x20replyCreated:',_0xad27a5),this['_setErrorState'](_0x5ca080));});}),this['_interaction']['on']('replyContentUpdated',(_0x222638,_0x541f39)=>{_0x23443c(_0x541f39)['catch'](_0x4f234a=>{this['_isAbortError'](_0x4f234a)||(console['error']('Error\x20updating\x20content\x20in\x20replyContentUpdated:',_0x4f234a),this['_setErrorState'](_0x5ca080));});}),this['_interaction']['on']('interactionFinished',async()=>{try{await this['_clearLoadingState'](),this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']),await this['_promiseQueue']['queueEmptyPromise'];}catch(_0x5d6861){this['_isAbortError'](_0x5d6861)||(console['error']('Error\x20clearing\x20loading\x20state\x20in\x20interactionFinished:',_0x5d6861),this['_setErrorState'](_0x5ca080));}finally{this['_actionsBalloonView']['stopAutoScroll']();}}),this['listenTo'](this['_actionsBalloonView'],'toggleSuggestionDisplayMode',async(_0x16434a,{showDiff:_0x462154})=>{try{this['_balloonShowDiff']=_0x462154;const _0x4e4476=this['_interaction']['replies'][this['_interaction']['replies']['length']-0x1];_0x4e4476&&await _0x23443c(_0x4e4476,_0x462154,'static');}catch(_0x2c23de){this['_isAbortError'](_0x2c23de)||(console['error']('Error\x20updating\x20content\x20in\x20toggleSuggestionDisplayMode:',_0x2c23de),this['_setErrorState'](_0x5ca080));}}),this['_interaction']['on']('replyChangeGroupStateUpdated',(_0x133fa3,{reply:_0x3e8eb0})=>{const _0x3df1c2={'positiveCount':_0x3e8eb0['changeGroups']['filter'](_0x5ca5ae=>'accepted'===_0x5ca5ae['state'])['length'],'totalCount':_0x3e8eb0['changeGroups']['length']},_0x441ec4=this['_interaction']['actionCallId'],_0x234870=this['_interaction']['actionName'];_0x234870?this['_aiConnector']['upsertAIActionRating'](_0x234870,_0x441ec4,_0x3df1c2):this['_aiConnector']['upsertCustomAIActionRating'](_0x441ec4,_0x3df1c2);}),this['_setLoadingState']();try{const _0x522e75=await this['_interaction']['start']();return this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']),_0x522e75;}catch(_0x4d8d70){if(this['_isAbortError'](_0x4d8d70))return;this['_actionsBalloonView']['hideLoader'](),this['_setErrorState'](_0x5ca080);}}['_applyChanges'](_0x46fa4c,_0x418567,_0x4e4908){const _0x584e71=this['editor'];if(_0x4e4908&&!_0x584e71['plugins']['has']('TrackChanges'))throw new _0x563e6a('ai-no-track-changes',null);const _0x2511d1=this['editor']['plugins']['get'](ot),_0x4d5d3d=this['_interactions'][this['_interactions']['length']-0x1-this['_currentInteractionIndex']];if(!_0x4d5d3d||!_0x4d5d3d['replies']['length'])return;const _0x38a9d5=_0x4d5d3d['replies'][_0x4d5d3d['replies']['length']-0x1],_0x5f2666=_0x38a9d5['changeGroups'];_0x38a9d5['setChangeGroupState'](0x0,'accepted');let _0x519df1=at({'editor':_0x584e71,'reply':_0x38a9d5,'interaction':_0x4d5d3d,'groups':_0x5f2666,'transform':!0x1,'documentCompare':_0x2511d1,'documentCompareOptions':{'anchor':_0x584e71['model']['createPositionAt'](_0x46fa4c,0x0),'markDeletions':_0x4e4908}});_0x519df1=this['_filterOperationsOutsideRange'](_0x519df1,_0x418567);for(const _0x1a6fc6 of _0x519df1)this['_anchorOperation'](_0x418567,_0x1a6fc6,_0x584e71['model']['document']['getRoot']());const _0x34ef35=_0x4d5d3d['getDocumentContext']()['version'],_0x190633=_0x584e71['model']['document']['history']['getOperations'](_0x34ef35),_0x45febd={'document':_0x584e71['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1},_0xfd69c1=kt(_0x519df1,_0x190633,_0x45febd)['operationsA'];_0x584e71['model']['change'](_0x44739a=>{if(_0x44739a['setSelection'](_0x584e71['model']['document']['selection']['focus']),_0x4e4908)_0x584e71['plugins']['get']('TrackChangesEditing')['_applyOperationsAsSuggestions'](_0xfd69c1);else{for(const _0x174842 of _0xfd69c1)_0x174842['baseVersion']=_0x584e71['model']['document']['version'],rt(_0x584e71,_0x174842),_0x44739a['batch']['addOperation'](_0x174842),_0x584e71['model']['applyOperation'](_0x174842);}}),this['editor']['plugins']['get']('AIBalloon')['close']();}['_filterOperationsOutsideRange'](_0x53c8b9,_0x483a58){return _0x53c8b9['filter'](_0x16fea7=>{if('rename'==_0x16fea7['type']){const _0x5c5a4e=_0x16fea7['position']['nodeAfter'];return!_0x483a58['has'](_0x5c5a4e);}if(_0x16fea7['type']['indexOf']('Attribute')>-0x1){const _0x60661e=_0x16fea7['range']['start']['nodeAfter'];return!_0x483a58['has'](_0x60661e);}return!0x0;});}['_anchorOperation'](_0x2258e5,_0x61d3b8,_0x32f2be){const _0x5a5443=_0x61d3b8['clone']();for(const _0x396151 in _0x61d3b8){const _0x56e8cb=_0x61d3b8[_0x396151];_0x56e8cb instanceof dt?_0x61d3b8[_0x396151]=new dt(_0x5d42bb(_0x56e8cb['start']),_0x5d42bb(_0x56e8cb['end'])):_0x56e8cb instanceof vt&&(_0x61d3b8[_0x396151]=_0x5d42bb(_0x56e8cb));}if(['insert','move','remove','reinsert','split','merge']['includes'](_0x5a5443['type'])){if(_0x5a5443['isDocumentOperation']=!0x1,_0x5a5443['baseVersion']=null,'remove'==_0x5a5443['type']){const _0x3aaabc=_0x5a5443['sourcePosition'],_0x4e96b9=_0x5a5443['howMany'];new lt(_0x3aaabc,_0x4e96b9)['_execute']();}else _0x5a5443['_execute']();}function _0x5d42bb(_0x26f033){if('$graveyard'==_0x26f033['root']['rootName'])return _0x26f033;const _0x1470b9=[];let _0x5ba2f3=_0x26f033['root'];for(let _0x3915a3=0x0;_0x3915a3<_0x26f033['path']['length'];_0x3915a3++){const _0x1f1c61=_0x2258e5['get'](_0x5ba2f3)||0x0;_0x1470b9[_0x3915a3]=_0x26f033['path'][_0x3915a3]+_0x1f1c61,_0x5ba2f3=_0x5ba2f3['getChildAtOffset'](_0x26f033['path'][_0x3915a3]);}return new vt(_0x32f2be,_0x1470b9,_0x26f033['stickiness']);}}['_refreshInteraction'](){if(!this['_interactionParams'])return;this['_interactions']['length']>0x0&&this['_stopInteraction'](),this['_currentInteractionIndex']=0x0,this['_balloonShowDiff']=!0x1;const {action:_0x4b70ae,content:_0xd89bda,version:_0x58fe8c,aiBalloon:_0x47080e}=this['_interactionParams'];this['_clearErrorState'](),this['_actionsBalloonView']['clearContent'](),this['_actionsBalloonView']['showLoader'](),this['_actionsBalloonView']['resetShowChangesButton'](),this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']),this['stopListening'](this['_actionsBalloonView']),this['_setupApplyListeners'](),this['_createInteraction'](_0xd89bda,_0x58fe8c,_0x47080e,_0x4b70ae)['catch'](_0x5b96e8=>{this['_isAbortError'](_0x5b96e8)||console['error']('Error\x20refreshing\x20interaction:',_0x5b96e8);});}['_isAbortError'](_0x4af103){return!!_0x4af103['message']&&_0x4af103['message']['startsWith']('ai-request-aborted');}['_clearInteractionHistory'](){this['_interactions']=[],this['_interactionParams']=void 0x0,this['_currentInteractionIndex']=0x0,this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']);}['_stopInteraction'](){this['_interaction']&&this['_interaction']['stop'](),this['_promiseQueue']['abort'](),this['isBusy']=!0x1,this['_interactionParams']&&this['_actionsBalloonView']['stopAutoScroll']();}['_navigateToPrevious'](){const _0x36f719=this['_interactions']['length'];this['_currentInteractionIndex']<_0x36f719-0x1&&this['_displayInteractionAtIndex'](this['_currentInteractionIndex']+0x1);}['_navigateToNext'](){this['_currentInteractionIndex']>0x0&&this['_displayInteractionAtIndex'](this['_currentInteractionIndex']-0x1);}async['_displayInteractionAtIndex'](_0x40464f){if(!this['_interactionParams'])return;this['_currentInteractionIndex']=_0x40464f;const _0x5284a7=this['_interactions'][this['_interactions']['length']-0x1-this['_currentInteractionIndex']];if(!_0x5284a7)return;if(_0x5284a7['hasError'])return this['_setErrorState'](_0x5284a7),void this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']);if(!_0x5284a7['replies']['length'])return;this['_actionsBalloonView']['hideError'](),this['_interactionParams']&&this['_clearErrorState']();const _0x10018f=_0x5284a7['replies'][_0x5284a7['replies']['length']-0x1];if(_0x10018f){const _0x28bb96=this['editor'];try{const _0x4a57d2=wt({'editor':_0x28bb96,'changeGroups':_0x10018f['changeGroups'],'documentContextContent':_0x10018f['documentContextContent'],'showDiff':this['_balloonShowDiff'],'trimUnchanged':!0x1});await new Promise(_0x3a7b13=>setTimeout(_0x3a7b13,0x32)),await this['_actionsBalloonView']['updateContent']({'part':_0x4a57d2[0x0],'renderingStrategy':'static','abortSignal':new AbortController()['signal']});}catch(_0xb1a739){this['_isAbortError'](_0xb1a739)||console['error']('Error\x20updating\x20content\x20during\x20navigation:',_0xb1a739);}}this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']);}['_setLoadingState'](){this['_actionsBalloonView']['setIsLoading'](!0x0),this['isBusy']=!0x0;}async['_setErrorState'](_0x572dff){const _0x183419=i(this['editor']['locale'],'AI_ACTIONS_GENERIC_ERROR');this['_actionsBalloonView']['showError'](_0x183419),_0x572dff['hasError']=!0x0,await this['_promiseQueue']['queueEmptyPromise'],this['_actionsBalloonView']['setErrorState'](),this['_actionsBalloonView']['toggleIsLoading'](!0x0);}['_clearErrorState'](){this['_actionsBalloonView']['hideError'](),this['_actionsBalloonView']['toggleIsLoading'](!0x1);}async['_clearLoadingState'](){await this['_promiseQueue']['queueEmptyPromise'],this['isBusy']=!0x1,this['_actionsBalloonView']['setIsLoading'](!0x1);}}class AIQuickActions extends _0x361c0d{static get['requires'](){return[ii,ti,ri];}static get['pluginName'](){return'AIQuickActions';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x1771bc){super(_0x1771bc),_0x1771bc['config']['define']('ai.quickActions',{'extraCommands':[],'removeCommands':[],'isSearchEnabled':!0x0});}}class Ws extends _0xc3e5b1{['resultResponseView'];['acceptButtonView'];['dismissButtonView'];['infoButtonView'];['outdatedButtonView'];constructor(_0x9955c3,_0x4508a0){super(_0x9955c3),this['id']=_0x4508a0,this['set']('status','pending'),this['set']('changeId',_0x4508a0),this['resultResponseView']=this['_createResultResponseView'](),this['acceptButtonView']=this['_createAcceptButtonView'](),this['dismissButtonView']=this['_createDismissButtonView'](),this['infoButtonView']=this['_createInfoButtonView'](),this['outdatedButtonView']=this['_createOutdatedButtonView'](),this['set']('isInfoToggleOn',!0x1),this['set']('isActive',!0x1),this['set']('showDiff',!0x0),this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-result',this['bindTemplate']['if']('isActive','ck-ai_review__check-run-result_active')]},'on':{'click':this['bindTemplate']['to']('click'),'mouseover':this['bindTemplate']['to']('mouseover'),'mouseout':this['bindTemplate']['to']('mouseout')},'children':[this['resultResponseView'],{'tag':'div','attributes':{'class':['ck-ai_review__check-run-result-footer']},'children':[{'tag':'div','attributes':{'class':['ck-ai_review__check-run-result-action-buttons']},'children':[this['acceptButtonView'],this['dismissButtonView'],this['outdatedButtonView']]},this['infoButtonView']]}]}),this['on']('click',(_0xd45693,_0xe44a6f)=>{_0xe44a6f&&_0xe44a6f['target']&&'A'===_0xe44a6f['target']['tagName']&&_0xe44a6f['preventDefault'](),this['fire']('activateChange',{'id':_0x4508a0,'source':this,'uiInteraction':'click'});}),this['on']('mouseover',()=>{this['fire']('activateChange',{'id':_0x4508a0,'source':this,'uiInteraction':'hover'});}),this['on']('mouseout',()=>{this['fire']('deactivateChange',{'origin':'panel','id':_0x4508a0,'source':this});});}['setItemAsActive'](){this['isActive']=!0x0;}['setItemAsInactive'](){this['isActive']=!0x1;}['_createResultResponseView'](){const _0x1b63c0=new _0xc3e5b1(this['locale']);return _0x1b63c0['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content','ck-reset_all-excluded','ck-ai_review__check-run-result-response',this['bindTemplate']['if']('showDiff','ck-hidden',_0x1d02c5=>!_0x1d02c5)]}}),_0x1b63c0;}['_createAcceptButtonView'](){const _0x3b3f73=new _0x2cf640(this['locale']);return _0x3b3f73['set']({'label':i(this['locale'],'AI_REVIEW_MODE_ACCEPT_CHANGE'),'withText':!0x0}),_0x3b3f73['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x513494=>{this['fire']('acceptChange',{'id':this['changeId']}),_0x513494['stopPropagation']();})},'attributes':{'class':['ck-ai-button-secondary','ck-ai_review__check-run-result-accept-button',this['bindTemplate']['if']('status','ck-hidden',_0x37c590=>'pending'!==_0x37c590&&'accepted'!==_0x37c590),this['bindTemplate']['if']('status','ck-ai_review__check-run-result-accept-button',_0x5df6ec=>'pending'===_0x5df6ec),this['bindTemplate']['if']('status','ck-ai_review__check-run-result-status-button',_0x3f3675=>'accepted'===_0x3f3675)]}}),this['on']('change:status',(_0x17a0f6,_0x14fc0c,_0x497532)=>{_0x3b3f73['isEnabled']='pending'===_0x497532,'accepted'===_0x497532&&(_0x3b3f73['label']=i(this['locale'],'AI_REVIEW_MODE_CHECK_STATUS_ACCEPTED'),_0x3b3f73['icon']=_0x24d29c);}),_0x3b3f73;}['_createDismissButtonView'](){const _0x8bc189=new _0x2cf640(this['locale']);return _0x8bc189['set']({'label':i(this['locale'],'AI_REVIEW_MODE_DISMISS_CHANGE'),'withText':!0x0}),_0x8bc189['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x21020a=>{this['fire']('dismissChange',{'id':this['changeId']}),_0x21020a['stopPropagation']();})},'attributes':{'class':['ck-ai-button-tertiary',this['bindTemplate']['if']('status','ck-hidden',_0x599e14=>'pending'!==_0x599e14&&'rejected'!==_0x599e14),this['bindTemplate']['if']('status','ck-ai_review__check-run-result-dismiss-button',_0x14fbc9=>'pending'===_0x14fbc9),this['bindTemplate']['if']('status','ck-ai_review__check-run-result-status-button',_0x42ee49=>'rejected'===_0x42ee49)]}}),this['on']('change:status',(_0x2ee46a,_0x41691e,_0x40369e)=>{_0x8bc189['isEnabled']='pending'===_0x40369e,'rejected'===_0x40369e&&(_0x8bc189['label']=i(this['locale'],'AI_REVIEW_MODE_CHECK_STATUS_REJECTED'),_0x8bc189['icon']=_0x4718d2);}),_0x8bc189;}['_createInfoButtonView'](){const _0x7ca6ca=new _0x2cf640(this['locale']);return _0x7ca6ca['set']({'label':i(this['locale'],'AI_REVIEW_MODE_LEARN_MORE'),'icon':_0x169d70,'tooltip':!0x0,'isToggleable':!0x0,'role':'menuitemcheckbox','class':'ck-ai-button-tertiary\x20ck-ai_review__check-run-result-info-button\x20ck-hidden'}),_0x7ca6ca['bind']('isOn')['to'](this,'isInfoToggleOn',_0x372ab9=>_0x372ab9),_0x7ca6ca['on']('execute',()=>{this['isInfoToggleOn']=!this['isInfoToggleOn'];}),_0x7ca6ca;}['_createOutdatedButtonView'](){const _0x35d218=new _0x2cf640(this['locale']);return _0x35d218['set']({'label':i(this['locale'],'AI_REVIEW_MODE_CHECK_STATUS_OUTDATED'),'icon':_0x42666d,'withText':!0x0,'isEnabled':!0x1}),_0x35d218['extendTemplate']({'attributes':{'class':['ck-ai-button-secondary','ck-ai_review__check-run-result-status-button',this['bindTemplate']['if']('status','ck-hidden',_0x4c28d6=>'outdated'!==_0x4c28d6)],'disabled':'disabled'}}),_0x35d218;}}class me extends _0x5442ef{['resultItemView'];['_pinnedRectIndex']=void 0x0;['_pinnedTargetElement']=void 0x0;['_pinnedTargetChangeId']=void 0x0;constructor(_0x445864,_0x5b1b85){super(_0x445864),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']()),_0x5b1b85['add'](this);}['render'](){super['render'](),this['_setupClickOutsideHandler']();}['updateContent'](_0x409839){this['resultItemView']['changeId']=_0x409839['id'],this['resultItemView']['resultResponseView']['element']['innerHTML']=_0x409839['contentDiffed'];}['showBalloon'](_0x27b679,_0x1b2b1d,_0x4a6ab8,_0x3b8760,_0x1ccb5b,_0x387cbd){const _0x5eab9a=_0x1b2b1d();if(!_0x5eab9a)return;this['updateContent'](_0x27b679),this['show']();const _0x276b39=Array['from'](_0x5eab9a['getClientRects']())['reverse'](),_0x4b9283=this['_getPointedRectIndexFromEvent'](_0x4a6ab8,_0x276b39),_0x3e6539=_0x276b39[_0x4b9283??0x0];'click'===_0x3b8760?(this['isDiffActive']=!0x0,this['pin']({'target':()=>this['_getBestRectPositionOnClick'](_0x1b2b1d(),_0x4b9283,_0x27b679['id'],_0x1ccb5b,_0x387cbd)||_0x3e6539})):'hover'===_0x3b8760&&(this['isDiffActive']=!0x1,this['pin']({'target':()=>this['_getBestRectPositionOnHover'](_0x1b2b1d(),_0x4b9283,_0x27b679['id'])||_0x3e6539}));}['hideBalloon'](){this['hide'](),this['unpin'](),this['_pinnedRectIndex']=void 0x0,this['_pinnedTargetElement']=void 0x0,this['_pinnedTargetChangeId']=void 0x0;}['hideDiffInBalloon'](){this['resultItemView']['showDiff']=!0x1;}['showDiffInBalloon'](){this['resultItemView']['showDiff']=!0x0;}['deactivateChange'](){this['fire']('deactivateChange',{'origin':'balloon'});}['_setupClickOutsideHandler'](){_0x1d212b({'emitter':this,'activator':()=>this['isVisible'],'contextElements':()=>{const _0x1bab4e=[this['element']];return this['_pinnedTargetElement']&&_0x1bab4e['push'](this['_pinnedTargetElement']),_0x1bab4e;},'callback':()=>{this['hide'](),this['unpin'](),this['deactivateChange'](),this['_pinnedTargetElement']=void 0x0,this['_pinnedRectIndex']=void 0x0,this['_pinnedTargetChangeId']=void 0x0;}});}['_createContentView'](){const _0x46bb4b=new _0xc3e5b1();return this['resultItemView']=new Ws(this['locale'],''),this['resultItemView']['resultResponseView']['extendTemplate']({'attributes':{'class':['ck-content']}}),this['resultItemView']['delegate']('acceptChange','dismissChange')['to'](this),_0x46bb4b['setTemplate']({'tag':'div','attributes':{'class':['ck-reset','ck-ai_review-balloon-panel-suggestion',this['bindTemplate']['if']('isDiffActive','ck-ai_review-balloon-panel-suggestion_diff-active')]},'children':[{'tag':'p','attributes':{'class':['ck-ai_review__suggestion-text']},'children':[this['resultItemView']]}]}),_0x46bb4b;}['_getBestRectPositionOnClick'](_0x54011a,_0x4e41e6,_0x49d815,_0x341c50,_0x30c860){if(!_0x54011a)return null;const _0x5d4195=this['position']['replace']('arrow_',''),_0x541f76=Array['from'](_0x54011a['getClientRects']());let _0x1c4cfa,_0x11a27e=_0x541f76['reverse']();return void 0x0!==_0x4e41e6&&this['_isPinnedRectVisible'](_0x11a27e[_0x4e41e6],_0x341c50,_0x30c860)?(_0x1c4cfa=_0x11a27e[_0x4e41e6],this['_pinnedRectIndex']=_0x4e41e6):this['_isPinnedRectVisible'](_0x11a27e[0x0],_0x341c50,_0x30c860)&&void 0x0===_0x4e41e6?_0x1c4cfa=_0x11a27e[0x0]:(_0x11a27e='s'==_0x5d4195[0x0]?[..._0x541f76]['reverse']():_0x541f76,_0x11a27e['forEach'](_0x1e0b4e=>{this['_isPinnedRectVisible'](_0x1e0b4e,_0x341c50,_0x30c860)&&(_0x1c4cfa=_0x1e0b4e);})),this['_pinnedTargetChangeId']=_0x49d815,this['_pinnedTargetElement']=_0x54011a,_0x1c4cfa||_0x54011a['getBoundingClientRect']();}['_getBestRectPositionOnHover'](_0x35c6d6,_0x7fd629,_0x1c43ad){if(!_0x35c6d6)return null;const _0x3e287a=Array['from'](_0x35c6d6['getClientRects']())['reverse']();if(void 0x0===this['_pinnedRectIndex']&&void 0x0!==_0x7fd629&&this['_pinnedTargetChangeId']!==_0x1c43ad)return this['_pinnedRectIndex']=_0x7fd629,this['_pinnedTargetElement']=_0x35c6d6,this['_pinnedTargetChangeId']=_0x1c43ad,_0x3e287a[_0x7fd629];if(void 0x0!==this['_pinnedRectIndex']&&this['_pinnedTargetChangeId']===_0x1c43ad){if(_0x35c6d6!==this['_pinnedTargetElement'])return Array['from'](this['_pinnedTargetElement']['getClientRects']())['reverse']()[this['_pinnedRectIndex']];return _0x3e287a[this['_pinnedRectIndex']];}return void 0x0!==_0x7fd629&&this['_pinnedTargetChangeId']!==_0x1c43ad?(this['_pinnedRectIndex']=_0x7fd629,this['_pinnedTargetElement']=_0x35c6d6,this['_pinnedTargetChangeId']=_0x1c43ad,_0x3e287a[_0x7fd629]):_0x35c6d6['getBoundingClientRect']();}['_getPointedRectIndexFromEvent'](_0x171f9c,_0x19d418){if(_0x171f9c)for(let _0x398aae=0x0;_0x398aae<_0x19d418['length'];_0x398aae++){const _0x22c356=_0x19d418[_0x398aae];if(_0x171f9c['clientX']>=_0x22c356['left']-0x3&&_0x171f9c['clientX']<=_0x22c356['right']+0x3&&_0x171f9c['clientY']>=_0x22c356['top']-0x3&&_0x171f9c['clientY']<=_0x22c356['bottom']+0x3)return _0x398aae;}}['_isPinnedRectVisible'](_0x18aa90,_0x3e6d6d,_0x2f85b5){const _0xb7715=new _0x4b725e(_0x18aa90),_0x5a3a56=_0x3e6d6d||document['documentElement'],_0x359946=_0xb7715['getIntersection'](_0x117236(_0x2f85b5)),_0x794fb1=new _0x4b725e(_0x5a3a56)['getIntersection'](_0xb7715);return!!(_0x359946&&_0x794fb1&&_0xb7715['width']>0x0);}}const ih=['getReviewCheckList','runReviewCheck','abortReviewStream','toggleDiff','acceptAllChanges','leaveReviewCoreResultList','activateChange','deactivateChange','acceptChange','dismissChange','learnMore','finishReview','retryReview'];class Me extends _0x3a5602{['_mainView'];['_balloonSuggestionView'];['_bodyCollection'];static get['requires'](){return[it];}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x30add6){super(_0x30add6),this['_bodyCollection']=new _0x340c25(this['context']['locale']),this['_bodyCollection']['attachToDom'](),this['_mainView']=this['createMainView'](),this['_mainView']['delegate'](...ih)['to'](this),this['_balloonSuggestionView']=new me(this['context']['locale'],this['_bodyCollection']),this['_balloonSuggestionView']['delegate']('acceptChange','dismissChange','deactivateChange')['to'](this);}['init'](){const _0x4d308f=this['context']['plugins']['get']('AITabs');this['registerTab'](_0x4d308f);}['destroy'](){this['_bodyCollection']['detachFromDom'](),super['destroy']();}['setAvailableChecks'](_0xd43695){if(!this['_mainView']['reviewCheckListView']['hasChecks']()){const _0x399cba=!this['context']['config']['get']('ai.models.showModelSelector');this['_mainView']['reviewCheckListView']['setChecks'](_0xd43695,_0x399cba);}this['_mainView']['showReviewCheckListView']();}['showReviewCheckList'](){this['fire']('getReviewCheckList');}['showCheckRunResults'](_0x59f013){_0x59f013&&('error-general'!==_0x59f013['status']?'error-chunk'!==_0x59f013['status']?this['_mainView']['showReviewCheckResultsView']():this['showChunkErrorView']():this['showGeneralResultsErrorView']());}['showCheckRunResult'](_0x374d73){this['_mainView']['addCheckRunResult'](_0x374d73);}['showGeneralResultsErrorView'](){this['_mainView']['showGeneralResultsErrorView']();}['showGeneralReviewCoreErrorView'](_0x2c4b40){this['_mainView']['showGeneralReviewCoreErrorView'](_0x2c4b40??i(this['context']['locale'],'AI_REVIEW_INITIALIZATION_ERROR_MESSAGE'));}['showChunkErrorView'](){this['_mainView']['showChunkErrorView']();}['setCheckResultTitle'](_0x19d4ac,_0x53c87f){this['_mainView']['reviewCheckResultsView']['setTitle'](_0x19d4ac,_0x53c87f);}['setActiveStateInResults'](_0x58ddc2){this['_mainView']['reviewCheckResultsView']['getResults']()['forEach'](_0x1f61da=>{_0x1f61da['id']===_0x58ddc2&&_0x1f61da['setItemAsActive']();});}['resetActiveStateInResults'](){this['_mainView']['reviewCheckResultsView']['getResults']()['forEach'](_0x4c8381=>_0x4c8381['setItemAsInactive']());}['updateChangeState'](_0x47f780,_0x371a44){'accepted'===_0x371a44||'rejected'===_0x371a44||'outdated'===_0x371a44?this['_mainView']['reviewCheckResultsView']['hideResult'](_0x47f780,_0x371a44):this['_mainView']['reviewCheckResultsView']['showResult'](_0x47f780,_0x371a44);}['showReviewCompletedView'](){this['_mainView']['showReviewCompletedView']();}['showActionsWhenResultIsReady'](){this['_mainView']['showActionsWhenResultIsReady']();}['showNoChangesView'](){this['_mainView']['showNoChangesView']();}['hideActionsWhenResultIsReady'](){this['_mainView']['hideActionsWhenResultIsReady']();}['showChangeBalloon'](_0x223196,_0x5a10f,_0x3c3906,_0x38c665,_0x2bf4c9,_0x26a534){this['_balloonSuggestionView']['showBalloon'](_0x223196,_0x5a10f,_0x3c3906,_0x38c665,_0x2bf4c9,_0x26a534);}['hideChangeBalloon'](){this['_balloonSuggestionView']['hideBalloon']();}['hideDiffInBalloon'](){this['_balloonSuggestionView']['hideDiffInBalloon']();}['showDiffInBalloon'](){this['_balloonSuggestionView']['showDiffInBalloon']();}['getChangeElement'](_0x54e96c){const _0x46ab32=this['_mainView']['reviewCheckResultsView']['getResults']()['find'](_0x274198=>_0x274198['id']===_0x54e96c);return _0x46ab32?_0x46ab32['element']:null;}['deactivateChange'](){this['_balloonSuggestionView']['deactivateChange']();}}class sh extends _0xc3e5b1{constructor(_0x40d4e6){super(_0x40d4e6),this['set']('isVisible',!0x1),this['set']('errorMessage','');const _0x125219=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai_review__general-error-container',_0x125219['if']('isVisible','ck-hidden',_0x57f780=>!_0x57f780)]},'children':[{'tag':'p','attributes':{'class':'ck\x20ck-ai-notification\x20ck-ai-notification_error'},'children':[{'text':_0x125219['to']('errorMessage')}]}]});}}class Ae extends _0xc3e5b1{['reviewCoreHeader'];['generalErrorView'];['reviewCheckListView'];['reviewCheckResultsView'];['reviewCompletedView'];constructor(_0x2c1ed3,_0x470a29){super(_0x2c1ed3),this['reviewCoreHeader']=_0x470a29['header'],this['generalErrorView']=new sh(_0x2c1ed3),this['reviewCheckListView']=_0x470a29['list'],this['reviewCheckListView']['delegate'](...ih)['to'](this),this['reviewCheckResultsView']=_0x470a29['results'],this['reviewCheckResultsView']['delegate'](...ih)['to'](this),this['reviewCompletedView']=_0x470a29['completed'],this['reviewCompletedView']['delegate']('finishReview')['to'](this),this['reviewCheckListView']['set']('isVisible',!0x1),this['reviewCheckResultsView']['set']('isVisible',!0x1),this['reviewCheckResultsView']['set']('isLoading',!0x1),this['reviewCheckResultsView']['set']('isResultReady',!0x1),this['reviewCompletedView']['set']('isVisible',!0x1),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-ai-review','ck-rounded-corners'],'dir':'ltr'},'children':[this['reviewCoreHeader'],this['generalErrorView'],this['reviewCheckListView'],this['reviewCheckResultsView'],this['reviewCompletedView']]});}['showReviewCheckListView'](){this['reviewCheckListView']['resetAllParameterizedChecks'](),this['reviewCheckListView']['set']('isVisible',!0x0),this['reviewCheckResultsView']['set']('isVisible',!0x1),this['reviewCompletedView']['set']('isVisible',!0x1);}['showReviewCheckResultsView'](){this['hideActionsWhenResultIsReady'](),this['reviewCheckResultsView']['resetErrorState'](),this['reviewCheckListView']['set']('isVisible',!0x1),this['reviewCheckResultsView']['set']('isVisible',!0x0),this['reviewCheckResultsView']['clearResults'](),this['reviewCheckResultsView']['set']('isLoading',!0x0),this['reviewCheckResultsView']['set']('isCompleted',!0x1);}['addCheckRunResult'](_0x4baba7){this['reviewCheckResultsView']['addResult'](_0x4baba7),this['reviewCheckResultsView']['set']('isLoading',!0x1);}['showReviewCompletedView'](){this['reviewCheckResultsView']['set']('isVisible',!0x0),this['reviewCompletedView']['set']('isVisible',!0x1),this['reviewCheckResultsView']['set']('isCompleted',!0x0),this['reviewCheckListView']['set']('isVisible',!0x1);}['showActionsWhenResultIsReady'](){this['reviewCheckResultsView']['isResultReady']?(this['reviewCheckListView']['set']('isVisible',!0x1),this['reviewCheckResultsView']['set']('isVisible',!0x0),this['reviewCompletedView']['set']('isVisible',!0x1)):this['reviewCheckResultsView']['isResultReady']=!0x0;}['showNoChangesView'](){this['reviewCheckListView']['set']('isVisible',!0x1),this['reviewCheckResultsView']['set']('isVisible',!0x1),this['reviewCompletedView']['set']('isVisible',!0x0);}['hideActionsWhenResultIsReady'](){this['reviewCheckResultsView']['isResultReady']=!0x1;}['showGeneralReviewCoreErrorView'](_0x5d129c){this['generalErrorView']['set']('isVisible',!0x0),this['generalErrorView']['errorMessage']=_0x5d129c;}['showGeneralResultsErrorView'](){this['reviewCheckResultsView']['set']('isLoading',!0x1),this['showActionsWhenResultIsReady'](),this['reviewCheckResultsView']['showGeneralErrorMessage']();}['showChunkErrorView'](){this['reviewCheckResultsView']['set']('isLoading',!0x1),this['showActionsWhenResultIsReady'](),this['reviewCheckResultsView']['showChunkErrorMessage']();}}class vr extends _0x2cf640{constructor(_0x381f58,_0x427530){super(_0x427530),this['set']({'label':_0x381f58,'withText':!0x0,'class':'ck-ai-button-primary'}),this['on']('execute',()=>{this['fire']('finishReview');});}}class Ve extends _0x663ac1{['_resultViews'];['_resultsHeader'];['reviewDisclaimer'];['_cancelButtonView'];['_acceptAllButtonView'];['_exitReviewButtonView'];['_toggleDiffButtonView'];['_errorMessageView'];['_finishReviewButtonView'];['_contents'];constructor(_0x1ea600,_0x1b5ad7){super(_0x1ea600),this['_contents']=_0x1b5ad7,this['_resultViews']=new _0xf5a45d(),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 vi(_0x1ea600),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 _0x49415a=this['_createCombinedSkeletonLoader'](),_0x28bf8b=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run',_0x28bf8b['if']('isLoading','ck-ai_review__check-run_loading',_0x4e4228=>_0x4e4228),_0x28bf8b['if']('isResultReady','ck-ai_review__check-run_ready',_0x537021=>_0x537021),_0x28bf8b['if']('isVisible','ck-hidden',_0x31824b=>!_0x31824b)]},'children':[this['_resultsHeader'],{'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-wrapper']},'children':[this['_errorMessageView'],{'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-container','ck-reset_all-excluded',this['bindTemplate']['if']('isLoading','ck-hidden',_0x3b685f=>_0x3b685f)]},'children':this['_resultViews']},_0x49415a]},this['reviewDisclaimer']]});}['clearResults'](){this['_resultViews']['clear']();}['getResults'](){return this['_resultViews'];}['addResult'](_0x2e5f3f){const _0x2c9a24=new Ws(this['locale'],_0x2e5f3f['id']);_0x2c9a24['delegate']('acceptChange','dismissChange','activateChange','deactivateChange')['to'](this),this['_resultViews']['add'](_0x2c9a24),_0x2c9a24['resultResponseView']['element']['innerHTML']=_0x2e5f3f['contentDiffed'];}['hideResult'](_0xe51d41,_0x2a924c){if('pending'===_0x2a924c)return;const _0x5ee87d=this['_resultViews']['find'](_0x2090f1=>_0x2090f1['id']===_0xe51d41);_0x5ee87d&&(_0x5ee87d['status']=_0x2a924c,_0x5ee87d['element']?.['classList']['add']('ck-ai_review__check-run-result_grayout'));}['showResult'](_0x28f995,_0xc91c1){if('pending'!==_0xc91c1)return;const _0xb23ef9=this['_resultViews']['find'](_0x3f5e5d=>_0x3f5e5d['id']===_0x28f995);_0xb23ef9&&(_0xb23ef9['status']=_0xc91c1,_0xb23ef9['element']?.['classList']['remove']('ck-ai_review__check-run-result_grayout'));}['setTitle'](_0x42de15,_0x2e9324){this['headerTitle']=_0x42de15,this['headerSubtitle']=_0x2e9324||'';}['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 Xe(this['locale'],Ye['aiReviewChecks']);}['_createCombinedSkeletonLoader'](){const _0x3a8048=new _0xc3e5b1(this['locale']),_0x39fc10=[];for(let _0x149900=0x0;_0x149900<0x10;_0x149900++){const _0x5b5298=this['_createSkeletonLoader']();_0x5b5298['extendTemplate']({'attributes':{'class':['ck-ai_review__check-run-skeleton-item']}}),_0x39fc10['push'](_0x5b5298);}return _0x3a8048['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-skeleton-container',this['bindTemplate']['if']('isLoading','ck-hidden',_0x418f9a=>!_0x418f9a)]},'children':_0x39fc10}),_0x3a8048;}['_createErrorView'](){const _0x4c4996=new _0xc3e5b1(this['locale']),_0x271679=new _0x2cf640(this['locale']),t=this['locale']['t'];return _0x4c4996['delegate']('retryReview')['to'](this),_0x271679['set']({'label':t('Try\x20again'),'withText':!0x0,'class':'ck-ai-button-secondary\x20ck-ai_review__check-run-error-retry-button'}),_0x271679['on']('execute',()=>{this['fire']('retryReview');}),_0x4c4996['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-error-container',this['bindTemplate']['if']('showErrorMessage','ck-hidden',_0x51033b=>!_0x51033b),this['bindTemplate']['if']('errorType','ck-ai_review__check-run-error-container_border-bottom',_0x388c6f=>'chunk'===_0x388c6f)]},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-notification','ck-ai-notification_error','ck-ai-notification__full-width','ck-ai_review__check-run-error-message',this['bindTemplate']['if']('errorType','ck-ai-notification_warning',_0x3fdc7f=>'chunk'===_0x3fdc7f)]},'children':[{'tag':'p','attributes':{'class':['ck-ai-notification__content',this['bindTemplate']['if']('errorType','ck-hidden',_0x295bcd=>'general'!==_0x295bcd)]},'children':[{'text':this['_contents']['generalErrorText']}]},{'tag':'p','attributes':{'class':['ck-ai-notification__content',this['bindTemplate']['if']('errorType','ck-hidden',_0x4c3561=>'chunk'!==_0x4c3561)]},'children':[{'text':i(this['locale'],'AI_REVIEW_MODE_CHUNK_ERROR_MESSAGE')}]}]},_0x271679]}),_0x4c4996;}['_createCancelButtonView'](){const _0x2f27e4=new _0x2cf640(this['locale']);return _0x2f27e4['set']({'label':i(this['locale'],'AI_REVIEW_MODE_STOP_GENERATING'),'withText':!0x0,'class':['ck-ai-button-secondary\x20ck-ai-button-stop-generating'],'icon':_0x197784}),_0x2f27e4['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isResultReady','ck-hidden',_0x4674c0=>_0x4674c0),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x315905=>_0x315905)]}}),_0x2f27e4['on']('execute',()=>{this['fire']('abortReviewStream');}),_0x2f27e4;}['_createToggleDiffButtonView'](){const _0x3a6b51=new _0x2cf640(this['locale']);_0x3a6b51['set']({'tooltip':!0x0,'isToggleable':!0x0,'role':'menuitemcheckbox'}),_0x3a6b51['bind']('isEnabled')['to'](this,'isError',_0x242d59=>!_0x242d59),_0x3a6b51['extendTemplate']({'attributes':{'class':['ck-ai-button-secondary','ck-ai_review__check-run-toggle-diff-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0x332a9f=>!_0x332a9f),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x3775c1=>_0x3775c1)]}});const _0x79717c=i(this['locale'],'AI_REVIEW_MODE_HIDE_CHANGES'),_0x2856ec=i(this['locale'],'AI_REVIEW_MODE_SHOW_CHANGES');return _0x3a6b51['bind']('isOn')['to'](this,'isToggleDiffOn',_0x27cc5d=>_0x27cc5d),_0x3a6b51['bind']('icon')['to'](this,'isToggleDiffOn',_0x384ad2=>_0x384ad2?_0x59f2c5:_0x359228),_0x3a6b51['bind']('label')['to'](this,'isToggleDiffOn',_0x131f2b=>_0x131f2b?_0x79717c:_0x2856ec),_0x3a6b51['on']('execute',()=>{this['isToggleDiffOn']=!this['isToggleDiffOn'],this['fire']('toggleDiff',{'on':this['isToggleDiffOn']});}),_0x3a6b51;}['_createAcceptAllButtonView'](){const _0x4a2025=new _0x2cf640(this['locale']);return _0x4a2025['set']({'label':i(this['locale'],'AI_REVIEW_MODE_ACCEPT_ALL'),'withText':!0x0}),_0x4a2025['bind']('isEnabled')['to'](this,'isError',_0x1758c4=>!_0x1758c4),_0x4a2025['extendTemplate']({'attributes':{'class':['ck-ai-button-primary','ck-ai_review__check-run-accept-all-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0x24f0a8=>!_0x24f0a8),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x4e5f0d=>_0x4e5f0d)]}}),_0x4a2025['on']('execute',()=>{this['fire']('acceptAllChanges');}),_0x4a2025;}['_createExitReviewButtonView'](){const _0x4f1dd5=new _0x2cf640(this['locale']);return _0x4f1dd5['set']({'label':i(this['locale'],'AI_REVIEW_MODE_EXIT_REVIEW'),'withText':!0x0}),_0x4f1dd5['extendTemplate']({'attributes':{'class':['ck-ai-button-tertiary','ck-ai_review__check-run-exit-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0x3cf9fc=>!_0x3cf9fc),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x3b705f=>_0x3b705f)]}}),_0x4f1dd5['on']('execute',()=>{this['fire']('leaveReviewCoreResultList');}),_0x4f1dd5;}['_createResultHeaderView'](){const _0x6f2edf=new _0xc3e5b1(this['locale']),_0x5d190c=this['_createTitleView']();return _0x6f2edf['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-header',this['bindTemplate']['if']('isCompleted','ck-ai_review__review-completed-header',_0x5d51d3=>_0x5d51d3)]},'children':[_0x5d190c,{'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-header-buttons']},'children':[this['_cancelButtonView'],this['_acceptAllButtonView'],this['_exitReviewButtonView'],this['_toggleDiffButtonView'],this['_finishReviewButtonView']]}]}),_0x6f2edf;}['_createTitleView'](){const _0xa0da5b=new _0xc3e5b1(this['locale']),_0x2cc273=new Ze();return _0x2cc273['bind']('isVisible')['to'](this,'isResultReady',_0x114f17=>!_0x114f17),_0xa0da5b['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-header-title-wrapper']},'children':[_0x2cc273,{'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-header-title-content',this['bindTemplate']['if']('isCompleted','ck-hidden',_0x1f60da=>_0x1f60da)]},'children':[{'tag':'span','attributes':{'class':['ck-ai_review__check-run-results-header-title']},'children':[{'text':this['bindTemplate']['to']('headerTitle')}]},{'tag':'span','attributes':{'class':['ck-ai_review__check-run-results-header-subtitle']},'children':[{'text':this['bindTemplate']['to']('headerSubtitle')}]}]},{'tag':'span','attributes':{'class':['ck-ai_review__review-completed-header-title',this['bindTemplate']['if']('isCompleted','ck-hidden',_0x1638ab=>!_0x1638ab)]},'children':[{'text':i(this['locale'],'AI_REVIEW_MODE_FINISH_REVIEW_HEADER_TITLE')}]}]}),_0xa0da5b;}['_createFinishReviewButtonView'](){const _0x3b99ab=new vr(i(this['locale'],'AI_REVIEW_MODE_FINISH_REVIEW_BUTTON_LABEL'),this['locale']);return _0x3b99ab['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isCompleted','ck-hidden',_0x2f32a2=>!_0x2f32a2)]}}),_0x3b99ab['delegate']('finishReview')['to'](this),_0x3b99ab;}}class be extends _0x663ac1{['_resultsHeader'];['_finishReviewButtonView'];constructor(_0x81aaa1,_0x9c482f){super(_0x81aaa1),this['_finishReviewButtonView']=this['_createFinishReviewButtonView'](_0x9c482f['buttonText']),this['_resultsHeader']=this['_createResultHeaderView'](_0x9c482f['headerText']);const _0x9a62b5=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__review-completed',_0x9a62b5['if']('isVisible','ck-hidden',_0x55f576=>!_0x55f576)]},'children':[this['_resultsHeader'],{'tag':'div','attributes':{'class':['ck-ai_review__review-completed-content']},'children':[{'tag':'span','attributes':{'class':['ck-ai_review__review-completed-content-icon']},'children':[{'text':'👍'}]},{'tag':'p','attributes':{'class':['ck-ai_review__review-completed-content-text']},'children':[{'text':_0x9c482f['emptyResultsText']}]}]}]});}['_createFinishReviewButtonView'](_0x3791de){const _0x33378c=new vr(_0x3791de,this['locale']);return _0x33378c['delegate']('finishReview')['to'](this),_0x33378c;}['_createResultHeaderView'](_0x51c95f){const _0x45ff60=new _0xc3e5b1(this['locale']);return _0x45ff60['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__review-completed-header']},'children':[{'tag':'span','attributes':{'class':['ck-ai_review__review-completed-header-title']},'children':[{'text':_0x51c95f}]},{'tag':'div','attributes':{'class':['ck-ai_review__review-completed-header-buttons']},'children':[this['_finishReviewButtonView']]}]}),_0x45ff60;}}class Dr extends _0xc3e5b1{['_dropdownView'];['_defaultValue'];['_defaultLabel'];constructor(_0x53b102,_0x345248){super(_0x53b102),this['_defaultValue']=_0x345248['default']||(_0x345248['data']['length']>0x0?_0x345248['data'][0x0]['id']:''),this['_defaultLabel']=_0x345248['data']['find'](_0x2920fe=>_0x2920fe['id']===this['_defaultValue'])?.['label']||'',this['set']('formValue',''),this['_dropdownView']=_0x3e48f8(this['locale']);const _0x458bc6=this['_prepareListOptions'](_0x345248['data']);_0x5aa31c(this['_dropdownView'],_0x458bc6,{'role':'menu','ariaLabel':_0x345248['label']}),this['_dropdownView']['buttonView']['set']({'label':this['_defaultLabel'],'withText':!0x0}),this['_dropdownView']['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x28bf2f=>{_0x28bf2f['stopPropagation']();})}}),this['listenTo'](this['_dropdownView'],'execute',_0x4d863d=>{this['formValue']=_0x4d863d['source']['model']['id'],this['_dropdownView']['buttonView']['label']=_0x4d863d['source']['model']['label'];}),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-ai_review__check-list-item-parameterized-form-element','ck-ai_review__check-list-item-parameterized-form-element_dropdown']},'children':[this['_dropdownView']]});}['resetToDefault'](){this['formValue']=this['_defaultValue'],this['_dropdownView']['buttonView']['label']=this['_defaultLabel'];}['_prepareListOptions'](_0x533a23=[]){const _0x2f3c09=new _0x7916ba();this['resetToDefault']();for(const _0x5e2d6e of _0x533a23){const _0x1fb2e4=new _0x201273({'label':_0x5e2d6e['label'],'withText':!0x0,'role':'menuitemradio','id':_0x5e2d6e['id'],'model':_0x5e2d6e});_0x1fb2e4['bind']('isOn')['to'](this,'formValue',_0x193c27=>_0x193c27===_0x1fb2e4['id']);const _0x5a7132={'type':'button','model':_0x1fb2e4};_0x2f3c09['add'](_0x5a7132);}return _0x2f3c09;}}class tc extends _0x663ac1{['_formItem']=null;constructor(_0x565811,_0x1847ae,_0x29909c){super(_0x565811),this['argsKey']=_0x1847ae?.['argsKey'];if('dropdown'===_0x1847ae['formType'])this['_formItem']=new Dr(this['locale'],_0x1847ae);this['set']('value',''),this['bind']('value')['to'](this['_formItem'],'formValue');const _0x28e5ff=new _0x42755e(this['locale'],{'children':[this['_formItem']],'class':[_0x29909c?'ck-form__row_with-submit':'']});_0x29909c&&_0x28e5ff['children']['add'](_0x29909c),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai_review__form-item','ck-reset_all']},'children':[_0x28e5ff]});}['resetToDefault'](){this['_formItem']['resetToDefault']();}}class wo extends _0x2fe62a{['keystrokes'];static ['MIN_ROWS']=0x1;static ['MAX_ROWS']=0xc;constructor(_0x2ca56e){super(_0x2ca56e),this['set']('isEmpty',!0x0),this['keystrokes']=new _0x15425(),this['minRows']=wo['MIN_ROWS'],this['maxRows']=wo['MAX_ROWS'],this['extendTemplate']({'attributes':{'id':'ai-review-prompt-input','class':['ck','ck-review__prompt-input']}});}['render'](){super['render'](),this['on']('update',()=>{this['isEmpty']=''===this['element']['value']?.['trim']();}),this['keystrokes']['listenTo'](this['element']);}}class sc extends _0xc3e5b1{['focusTracker']=new _0x5f2dfb();['keystrokes']=new _0x15425();['focusCycler'];['_focusables']=new _0xf5a45d();['submitButtonView'];['cancelButtonView'];['promptInputView'];['actionsFooterView'];['_modelSelectionDropdown'];['_modelNameView'];['_modelSelectionDropdownItems'];['_check'];['_defaultValue'];['_defaultLabel'];constructor(_0x3a6030,_0xa59078,_0x22c2fd=!0x1){super(_0x3a6030),this['_check']=_0xa59078,this['set']('prompt',''),this['set']('modelId',''),this['set']('modelDisplayMode','selector'),this['set']('activeModelName',null),this['_defaultValue']=_0xa59078['defaultModel']?_0xa59078['defaultModel']['id']:'',this['_defaultLabel']=_0xa59078['defaultModel']?_0xa59078['defaultModel']['name']:'',this['submitButtonView']=this['_createSubmitButtonView'](),this['cancelButtonView']=this['_createCancelButtonView'](),(this['promptInputView']=new _0x16298f(this['locale'],()=>new wo(_0x3a6030)),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 _0x7916ba(),this['_modelNameView']=this['_createModelNameView'](),this['_setModelList'](_0x22c2fd),_0x5aa31c(this['_modelSelectionDropdown'],this['_modelSelectionDropdownItems']),this['actionsFooterView']=this['_createActionsFooterView'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-custom-actions']},'children':[new _0x42755e(this['locale'],{'children':[this['promptInputView']]}),new _0x42755e(this['locale'],{'children':[this['actionsFooterView']]})]}),this['promptInputView']['fieldView']['keystrokes']['set']('Enter',(_0x16daa4,_0x408866)=>{this['_isValid']()?(this['fire']('runReviewCheck',{'id':'custom','args':{'prompt':this['prompt'],'model':this['modelId']},'isCustom':!0x0}),_0x408866()):_0x408866();}),this['focusCycler']=new _0x1af4a5({'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'](_0x314834=>{this['_focusables']['add'](_0x314834),this['focusTracker']['add'](_0x314834['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 _0x2f1437 of this['_getFormValidators']()){const _0x48a5ae=_0x2f1437();if(_0x48a5ae)return this['promptInputView']['errorText']=_0x48a5ae,!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 _0x16e051=new _0x2cf640(this['locale']),t=this['locale']['t'];return _0x16e051['set']({'label':t('Submit'),'withText':!0x0,'class':'ck-ai-button-primary'}),_0x16e051['on']('execute',()=>{this['_isValid']()&&this['fire']('runReviewCheck',{'id':'custom','args':{'prompt':this['prompt'],'model':this['modelId']},'isCustom':!0x0});}),_0x16e051;}['_createCancelButtonView'](){const _0x1901d3=new _0x2cf640(this['locale']),t=this['locale']['t'];return _0x1901d3['set']({'label':t('Cancel'),'withText':!0x0,'class':'ck-ai-button-tertiary'}),_0x1901d3['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x45c602=>{_0x45c602['stopPropagation']();})}}),_0x1901d3['on']('execute',()=>{this['resetToDefault'](),this['fire']('closeCustomCheck');}),_0x1901d3;}['_setModelList'](_0x49b723){this['_modelSelectionDropdownItems']['clear']();const _0x28021a=this['_check']['models'];if(_0x49b723)this['set']('modelDisplayMode','hidden');else{const _0x5cdcf1=0x1===_0x28021a['length'];this['set']('modelDisplayMode',_0x5cdcf1?'name':'selector');}if(this['resetToDefault'](),_0x28021a?.['length']){0x1===_0x28021a['length']&&this['set']('activeModelName',_0x28021a[0x0]['name']||_0x28021a[0x0]['id']);for(const _0x591f2d of _0x28021a){const _0xe5db87=new _0x201273({'label':_0x591f2d['name'],'withText':!0x0,'role':'menuitemradio','id':_0x591f2d['id'],'model':_0x591f2d});_0xe5db87['bind']('isOn')['to'](this,'modelId',_0x5a48b0=>_0x5a48b0===_0x591f2d['id']),this['_modelSelectionDropdownItems']['add']({'type':'button','model':_0xe5db87,'labelView':new ModelButtonLabelView(this['locale'],_0x591f2d)});}}}['_createModelSelectionDropdown'](){const _0x6cc730=_0x3e48f8(this['locale']);return _0x6cc730['set']({'panelPosition':'se','class':'ck-ai_review__check-list-item-model-dropdown'}),_0x6cc730['buttonView']['set']({'label':this['_defaultLabel'],'withText':!0x0,'tooltip':!0x0}),_0x6cc730['buttonView']['bind']('isVisible')['to'](this,'modelDisplayMode',_0x4f46ce=>'selector'===_0x4f46ce),this['listenTo'](_0x6cc730,'execute',_0x3aad2f=>{this['modelId']=_0x3aad2f['source']['model']['id'],_0x6cc730['buttonView']['label']=_0x3aad2f['source']['label'];}),_0x6cc730;}['_createModelNameView'](){const _0xca5d2c=new ModelNameView(this['locale']);return _0xca5d2c['bind']('text')['to'](this,'activeModelName',_0x1335c8=>_0x1335c8??''),_0xca5d2c['bind']('isVisible')['to'](this,'modelDisplayMode',_0x49fd5e=>'name'===_0x49fd5e),_0xca5d2c;}['_createActionsFooterView'](){const _0x3fadac=new _0xc3e5b1(this['locale']);return _0x3fadac['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-custom-actions-footer']},'children':[this['_modelSelectionDropdown'],this['_modelNameView'],{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-parameterized-custom-actions-buttons']},'children':[this['cancelButtonView'],this['submitButtonView']]}]}),_0x3fadac;}}class ModelNameView extends _0xc3e5b1{constructor(_0x45c91b){super(_0x45c91b),this['set']('text',void 0x0),this['set']('isVisible',!0x0);const _0x13b832=this['bindTemplate'];this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai_review__check-list-item-model-name',_0x13b832['if']('isVisible','ck-hidden',_0x38ce37=>!_0x38ce37)]},'children':[{'text':_0x13b832['to']('text')}]});}}class ModelButtonLabelView extends _0x23a78e{constructor(_0x44bb35,_0x3efd7e){super();const _0x1bfd09=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-button__label'],'style':_0x1bfd09['to']('style'),'id':_0x1bfd09['to']('id')},'children':[{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-model-dropdown-name']},'children':[{'tag':'span','children':[{'text':_0x1bfd09['to']('text')}]}]},{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-model-dropdown-description']},'children':[{'tag':'span','children':[_0x3efd7e['description']||'']}]}]});}}class ec extends _0x663ac1{['_formItemsCollection']=new _0xf5a45d();['_customCheckView']=null;['_hideModels']=!0x1;constructor(_0x55ba4f,_0x1d531e,_0x10b515,_0x4f52b5=!0x1){super(_0x55ba4f),this['_hideModels']=_0x4f52b5,this['set']('isParametrizedViewOpen',!0x1),this['set']('isListItemRendered',!0x1),this['set']('isItemParametrized',_0x1d531e['isParameterized']);const _0x422ad6=this['_createIconView']();this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list-item',this['bindTemplate']['if']('isParametrizedViewOpen','ck-ai_review__check-list-item_selected',_0x2ab9bb=>_0x2ab9bb),this['bindTemplate']['if']('isListItemRendered','ck-ai_review__check-list-item_rendered',_0x515294=>_0x515294)],'style':{'--ck-ai-review-check-list-item-index':_0x10b515}},'on':{'click':this['bindTemplate']['to']('click')},'children':[{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-content']},'children':[{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-main-content']},'children':[{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-title']},'children':[{'tag':'span','attributes':{'class':['ck-ai_review__check-list-item-title-text']},'children':[{'text':_0x1d531e['title']}]},_0x422ad6]},{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-description']},'children':_0x1d531e['description']?[{'text':_0x1d531e['description']}]:[]}]}]},..._0x1d531e['isParameterized']?[this['_createParameterizedView'](_0x1d531e)]:[],...'custom'===_0x1d531e['id']?[this['_createCustomView'](_0x1d531e,this['_hideModels'])]:[]]}),this['on']('click',()=>{_0x1d531e['isParameterized']?this['isParametrizedViewOpen']=!0x0:this['fire']('runReviewCheck',{'id':_0x1d531e['id'],'args':_0x1d531e['useArgs']?_0x1d531e['args']:void 0x0});}),requestAnimationFrame(()=>{this['isListItemRendered']=!0x0;});}['render'](){super['render'](),this['isItemParametrized']&&_0x1d212b({'emitter':this,'activator':()=>!0x0===this['isParametrizedViewOpen'],'contextElements':[this['element']],'callback':()=>{this['isParametrizedViewOpen']=!0x1;}});}['resetToDefault'](){this['isParametrizedViewOpen']=!0x1,this['_formItemsCollection']['forEach'](_0xfefc0f=>{_0xfefc0f['resetToDefault']();}),this['_customCheckView']&&this['_customCheckView']['resetToDefault']();}['_createIconView'](){const _0x493c3c=new _0x59b3d9();return _0x493c3c['content']=_0x215c94,_0x493c3c['extendTemplate']({'attributes':{'class':['ck-ai_review__check-list-item-title-icon']}}),_0x493c3c;}['_createParameterizedView'](_0x42bfca){const _0x57d56e=new _0xc3e5b1(),_0x5ae5f4=this['_createFormView'](_0x42bfca);return _0x57d56e['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-parameterized',this['bindTemplate']['if']('isParametrizedViewOpen','ck-hidden',_0x5ce014=>!_0x5ce014)]},'children':[_0x5ae5f4]}),_0x57d56e;}['_createFormView'](_0x57750d){const _0x50229b=new _0xc3e5b1(),_0x4179a1=Array['isArray'](_0x57750d['options'])?_0x57750d['options']:[],_0x18bbff=new _0x2cf640(this['locale']),t=this['locale']['t'];_0x18bbff['set']({'label':t('Submit'),'withText':!0x0,'class':'ck-ai-button-primary'}),_0x18bbff['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x2b754c=>{_0x2b754c['stopPropagation']();})}}),_0x18bbff['on']('execute',()=>{const _0x3b8057=[],_0x597e78={};this['_formItemsCollection']['forEach'](_0x1c9292=>{_0x3b8057['push'](_0x1c9292['value']),_0x57750d['useArgs']&&_0x57750d['options']&&(_0x597e78[_0x1c9292['argsKey']]=_0x1c9292['value']);}),this['fire']('runReviewCheck',{'id':_0x57750d['id'],'params':_0x3b8057['length']?_0x3b8057:void 0x0,'args':Object['keys'](_0x597e78)['length']?_0x597e78:void 0x0});});const _0x18362f=_0x4179a1['length'];return _0x4179a1['forEach']((_0x50d469,_0x5038fa)=>{const _0x1ff311=_0x5038fa===_0x18362f-0x1;this['_formItemsCollection']['add'](new tc(this['locale'],_0x50d469,_0x1ff311?_0x18bbff:null));}),_0x50229b['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-parameterized-form']},'children':this['_formItemsCollection']}),_0x50229b;}['_createCustomView'](_0x2e4897,_0x479826=!0x1){return this['_customCheckView']=new sc(this['locale'],_0x2e4897,_0x479826),this['_customCheckView']['extendTemplate']({'attributes':{'class':['ck-ai_review__check-list-item-parameterized','ck-ai_review__check-list-item-parameterized_custom',this['bindTemplate']['if']('isParametrizedViewOpen','ck-hidden',_0xbe2e6d=>!_0xbe2e6d)]}}),this['_customCheckView']['delegate']('runReviewCheck')['to'](this),this['listenTo'](this['_customCheckView'],'closeCustomCheck',()=>{this['isParametrizedViewOpen']=!0x1;}),this['on']('change:isParametrizedViewOpen',(_0x95e05f,_0x17e583,_0x57dcee)=>{_0x57dcee||this['_customCheckView']['resetFormValidationStatus']();}),this['_customCheckView'];}}class je extends _0x663ac1{['_checkViews'];constructor(_0x27ec6f){super(_0x27ec6f),this['_checkViews']=new _0xf5a45d(),this['_setupTemplate']();}['setChecks'](_0x440de8,_0xe5be6d=!0x1){this['_checkViews']['clear']();for(const [_0x502d51,_0x2dadec]of _0x440de8['entries']()){const _0x5800cb=new ec(this['locale'],_0x2dadec,_0x502d51,_0xe5be6d);_0x5800cb['delegate']('runReviewCheck')['to'](this),this['_checkViews']['add'](_0x5800cb);}}['hasChecks'](){return this['_checkViews']['length']>0x0;}['resetAllParameterizedChecks'](){for(const _0x32e3dc of this['_checkViews'])_0x32e3dc instanceof ec&&_0x32e3dc['resetToDefault']();}['_setupTemplate'](){const _0x4cb18e=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list',_0x4cb18e['if']('isVisible','ck-hidden',_0x22e425=>!_0x22e425)]},'children':this['_checkViews']});}}class ge extends Me{static get['pluginName'](){return'AIReviewModeUI';}['createMainView'](){const _0x28c302=this['context']['locale'],_0x48cc47=new _0x1e299f(_0x28c302,{'label':i(_0x28c302,'AI_REVIEW_MODE'),'icon':_0x4081d8,'class':'ck-ai-header\x20ck-ai-header_review'});return new Ae(this['context']['locale'],{'header':_0x48cc47,'list':new je(_0x28c302),'results':new Ve(_0x28c302,{'generalErrorText':i(_0x28c302,'AI_REVIEW_MODE_GENERAL_ERROR_MESSAGE')}),'completed':new be(_0x28c302,{'headerText':i(_0x28c302,'AI_REVIEW_MODE_FINISH_REVIEW_HEADER_TITLE'),'emptyResultsText':i(_0x28c302,'AI_REVIEW_MODE_EMPTY_RESULTS_TEXT'),'buttonText':i(_0x28c302,'AI_REVIEW_MODE_FINISH_REVIEW_BUTTON_LABEL')})});}['registerTab'](){const _0x12f5dd=this['context']['plugins']['get']('AITabs');_0x12f5dd['view']['on']('activateTab',(_0x40e2c3,_0x291611)=>{'reviewMode'===_0x291611?this['fire']('getReviewCheckList'):this['fire']('leaveReview');}),_0x12f5dd['view']['addTab']({'id':'reviewMode','buttonLabel':i(this['context']['locale'],'AI_REVIEW_MODE'),'buttonIcon':_0x4081d8,'order':0x0,'content':this['_mainView']});}}const fe='review-';class de extends _0x3a5602{static get['requires'](){return[ot,D];}static get['pluginName'](){return'AIReviewCoreEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['_markers']=new Map();['_activeMarkers']=new Set();['_domEmitter'];['_eventEmitter'];constructor(_0x5ca19c){super(_0x5ca19c),this['_domEmitter']=new(_0x3423db())(),this['_eventEmitter']=new(_0x5bd7c6())();}get['emitter'](){return this['_eventEmitter'];}['afterInit'](){const _0xbda1d2=T(this['context']);_0xbda1d2['conversion']['for']('editingDowncast')['markerToElement']({'model':fe+'insert','view':(_0x39ff71,{writer:_0x5b503c})=>{const _0x3b45c1=this['_markers']['get'](_0x39ff71['markerName']),_0x26c4d4={'class':'ck-ai_review-marker_add'+(this['_activeMarkers']['has'](_0x3b45c1?.['id']||'')?'\x20ck-ai_review__change_active':''),'data-marker-id':_0x39ff71['markerName']};return _0x5b503c['createUIElement']('span',_0x26c4d4,function(_0x3067df){const _0x5d58e5=this['toDomElement'](_0x3067df);return _0x5d58e5['innerHTML']=_0x3b45c1?.['content']?.['asString']||'',_0x5d58e5;});}}),_0xbda1d2['conversion']['for']('editingDowncast')['markerToHighlight']({'model':fe+'remove-only','view':_0x1b0b24=>{const _0x3fcf97=this['_markers']['get'](_0x1b0b24['markerName']),_0x51f874=['ck-ai_review-marker_strikethrough'];return this['_activeMarkers']['has'](_0x3fcf97?.['id']||'')&&_0x51f874['push']('ck-ai_review__change_active'),{'classes':_0x51f874,'attributes':{'data-marker-id':_0x1b0b24['markerName']}};}}),_0xbda1d2['conversion']['for']('editingDowncast')['markerToHighlight']({'model':fe+'remove-context','view':_0xed934e=>{const _0x5ebee6=this['_markers']['get'](_0xed934e['markerName']),_0x2c1ff3=['ck-ai_review-marker_underline'];return this['_activeMarkers']['has'](_0x5ebee6?.['id']||'')&&_0x2c1ff3['push']('ck-ai_review__change_active'),{'classes':_0x2c1ff3,'attributes':{'data-marker-id':_0xed934e['markerName']}};}}),_0xbda1d2['conversion']['for']('editingDowncast')['markerToHighlight']({'model':fe+'remove-text','view':_0x2d3c1b=>{const _0x29c2df=this['_markers']['get'](_0x2d3c1b['markerName']),_0xaae9d3=['ck-ai_review-marker_hide'];return this['_activeMarkers']['has'](_0x29c2df?.['id']||'')&&_0xaae9d3['push']('ck-ai_review__change_active'),{'classes':_0xaae9d3,'attributes':{'data-marker-id':_0x2d3c1b['markerName']}};}}),_0xbda1d2['conversion']['for']('dataDowncast')['markerToElement']({'model':fe+'suggestion-context','view':(_0x83c0ae,{writer:_0x22ec98})=>_0x22ec98['createRawElement']('span',{'class':'ck-ai_review-marker_context-'+(_0x83c0ae['isOpening']?'start':'end')})}),_0xbda1d2['conversion']['for']('downcast')['attributeToAttribute']({'model':nt,'view':_0x5b56f8});const _0x23e5e0=_0xbda1d2['ui']['getEditableElement']()||document['body'];this['_domEmitter']['listenTo'](_0x23e5e0,'mouseup',(_0x3fcda4,_0x1434da)=>{const _0x1c5ce1=_0x1434da['target'],_0x4be22f=this['_findMarkerElement'](_0x1c5ce1);if(!_0x4be22f)return;const _0x216ad3=_0x4be22f['getAttribute']('data-marker-id'),_0x2ec452=_0x216ad3['split'](':')['pop']()?.['split']('_')[0x0];this['_eventEmitter']['fire']('changeMarkerClicked',{'markerId':_0x216ad3,'changeId':_0x2ec452,'markerElement':()=>this['_findMarkerElementById'](_0x216ad3),'domEvent':_0x1434da});},{'usePassive':!0x0,'priority':'highest'}),this['_domEmitter']['listenTo'](_0x23e5e0,'mouseover',(_0x53a328,_0x421fb0)=>{const _0x34e187=_0x421fb0['target'],_0x21d21a=_0x421fb0['relatedTarget'];let _0xe71331=this['_findMarkerElement'](_0x34e187);if(!_0xe71331&&_0x21d21a&&(_0xe71331=this['_findMarkerElement'](_0x21d21a)),!_0xe71331)return;const _0x57f325=_0xe71331['getAttribute']('data-marker-id'),_0x52d272=_0x57f325['split'](':')['pop']()?.['split']('_')[0x0];this['_eventEmitter']['fire']('changeMarkerHovered',{'changeId':_0x52d272,'markerElement':()=>this['_findMarkerElementById'](_0x57f325),'domEvent':_0x421fb0});}),this['_domEmitter']['listenTo'](document,'mouseover',_0x49634e((_0x3dda20,_0x316843)=>{const _0x24644c=_0x316843['target'];if(this['_findMarkerElement'](_0x24644c))return;_0x24644c['closest']('.ck-reset.ck-ai_review-balloon-panel-suggestion')||this['_eventEmitter']['fire']('changeMarkerBlurred');},0xc8)),_0xbda1d2['model']['document']['registerPostFixer'](_0x567983=>this['_validateMarkers'](_0xbda1d2,_0x567983)),_0xbda1d2['model']['document']['on']('change',()=>this['_handleMarkerChanges'](_0xbda1d2));}['getDocumentData'](){const _0x229f00=this['context']['plugins']['get']('AIEditing'),_0x531437=T(this['context']),_0x31f385=_0x531437['model'],_0x1f82d8=new bt();for(const _0x8d0aaa of _0x31f385['document']['getRoot']()['getChildren']()){const _0x25ab32=_0x8d0aaa['_clone'](!0x0);_0x1f82d8['_appendChild'](_0x25ab32);}for(const _0x50c370 of _0x31f385['markers'])_0x1f82d8['markers']['set'](_0x50c370['name'],this['_changeRangeOwnerDocument'](_0x50c370['getRange']()['clone'](),_0x1f82d8));const _0x2bc3d5=new _0x1f3d99({'ignoreElementEnd':!0x0,'startPosition':_0x31f385['createPositionAt'](_0x1f82d8,0x0)}),_0x1331ac=new Set(),_0x568598=new Map();for(const {item:_0x4c840a}of _0x2bc3d5){if(!_0x4c840a['is']('$textProxy'))continue;const _0x3ac31d=_0x4c840a['parent'];if(_0x3ac31d&&_0x3ac31d['is']('element')){const _0x475ab8=this['_upsertDataId'](_0x3ac31d,()=>_0x229f00['_nextDataId'](_0x1331ac));_0x1331ac['add'](_0x475ab8);for(const _0x193943 of _0x3ac31d['getChildren']())_0x193943['is']('element')&&_0x1331ac['add'](this['_upsertDataId'](_0x193943,()=>_0x229f00['_nextDataId'](_0x1331ac)));let _0x2ed68f=_0x3ac31d;for(;_0x2ed68f['parent']&&!_0x2ed68f['parent']['is']('documentFragment');)_0x2ed68f=_0x2ed68f['parent'],_0x2ed68f['hasAttribute'](nt)&&_0x2ed68f['_removeAttribute'](nt);_0x568598['set'](_0x475ab8,{'path':_0x3ac31d['getPath'](),'getContent':this['_createGetContentUsingDataIdFn'](_0x2ed68f['_clone'](!0x0),_0x475ab8,_0x531437['data'])}),_0x2bc3d5['jumpTo'](_0x31f385['createPositionAfter'](_0x3ac31d));}}return{'content':_0x531437['data']['processor']['toData'](_0x531437['data']['toView'](_0x1f82d8)),'version':_0x531437['model']['document']['version'],'elements':_0x568598};}['diffContent'](_0x5b9d90,_0x502630,_0x38ae07=!0x1){const _0x5883a8=[],_0x441157=T(this['context']),_0x4659cd=_0x441157['data']['parse'](_0x502630,'$documentFragment'),_0x5269b3=_0x441157['data']['parse'](_0x5b9d90,'$documentFragment'),_0x4c07cf=_0x441157['model']['createPositionAt'](_0x5269b3,0x0);if(this['_haveSingleTopLevelElement'](_0x4659cd)){if(!this['_hasSameTopLevelElement'](_0x5269b3,_0x4659cd))return _0x5883a8;}else{const _0x3cfacf=_0x441157['model']['schema'];if(!this['_haveOnlyInlineContent'](_0x5269b3,_0x3cfacf)||!this['_haveOnlyInlineContent'](_0x4659cd,_0x3cfacf))return _0x5883a8;}const _0x522a3b=this['context']['plugins']['get']('DocumentCompare')['getDiff'](_0x5b9d90,_0x502630,{'anchor':_0x4c07cf,'markDeletions':!0x0})['getOperations']()['filter'](_0x1fdc11=>'insert'===_0x1fdc11['type']||'marker'===_0x1fdc11['type']&&_0x1fdc11['name']['startsWith']('$markedRemove')),_0x38b62e=this['_groupAdjacentOperations'](_0x522a3b),_0x20935e=[];if(_0x38ae07){if(_0x38b62e['length']){const _0x43b6b5=_0x38b62e[0x0]['operations'][0x0],_0x128f37='insert'===_0x43b6b5['type']?_0x43b6b5['position']:_0x43b6b5['newRange']['start'],_0x42ebc6=this['_getPositionLimitingRange'](_0x128f37,_0x441157,'inside'),_0x2c0c56=_0x42ebc6?_0x4659cd['getChild'](0x0)['getChildren']():_0x4659cd['getChildren'](),_0x375e27=_0x42ebc6||_0x441157['model']['createRangeIn'](_0x5269b3),_0x2e5126=[new _0x2a897f('$markedRemove:synthetic'+_0x48eb5e(),null,_0x375e27,_0x441157['model']['document']['model']['markers'],!0x0,_0x441157['model']['document']['version']+0x1),new _0x4675cd(_0x375e27['end'],_0x2c0c56,_0x441157['model']['document']['version']+0x2)];_0x20935e['push']({'operations':_0x2e5126,'operationsIsolated':_0x2e5126,'groupOffset':0x0});}}else _0x20935e['push'](..._0x38b62e);let _0x3ab0a6=0x0;return _0x441157['model']['change'](_0x3b4bb1=>{for(let _0x460123=0x0;_0x460123<_0x20935e['length'];_0x460123++){const _0x3c2374=_0x20935e[_0x460123],_0x35a6b5=_0x3b4bb1['createDocumentFragment']();for(const _0x378dc0 of _0x5269b3['getChildren']())_0x3b4bb1['append'](_0x378dc0['_clone'](!0x0),_0x35a6b5);for(const _0x407a6f of _0x3c2374['operationsIsolated'])if('insert'===_0x407a6f['type']){const _0x436122=_0x407a6f;_0x436122['baseVersion']=null,_0x436122['isDocumentOperation']=!0x1,this['_changeOperationOwnerDocument'](_0x436122,_0x35a6b5),_0x3b4bb1['batch']['addOperation'](_0x407a6f),_0x441157['model']['applyOperation'](_0x407a6f);const _0x4ec7f9='suggestion:insertion:id:authorId:'+_0x3ab0a6++,_0x5225a8=_0x441157['model']['createRange'](_0x436122['position'],_0x436122['position']['getShiftedBy'](_0x436122['howMany']));_0x35a6b5['markers']['set'](_0x4ec7f9,_0x5225a8);}else{if('marker'===_0x407a6f['type']&&_0x407a6f['name']['startsWith']('$markedRemove')){const _0x4dccaa=_0x407a6f,_0x344d22='suggestion:deletion:id:authorId:'+_0x3ab0a6++;this['_changeOperationOwnerDocument'](_0x4dccaa,_0x35a6b5),_0x35a6b5['markers']['set'](_0x344d22,_0x4dccaa['newRange']);}}if(_0x38ae07)_0x5883a8['push']({..._0x3c2374,'context':this['_createGetContentFn'](_0x5269b3,_0x441157['data']),'content':this['_createGetContentFn'](_0x5269b3,_0x441157['data'])});else{const _0x59aa60=this['_getChangeContext'](this['_changePositionOwnerDocument'](this['_getOperationStart'](_0x3c2374['operationsIsolated'][0x0]),_0x35a6b5),this['_changePositionOwnerDocument'](this['_getOperationEnd'](_0x3c2374['operationsIsolated'][_0x3c2374['operationsIsolated']['length']-0x1]),_0x35a6b5));_0x35a6b5['markers']['set'](fe+'suggestion-context',new dt(_0x59aa60['start'],_0x59aa60['end'])),_0x5883a8['push']({..._0x3c2374,'context':this['_createGetContextFn'](_0x35a6b5,_0x441157['data'],{'ellipsisBefore':_0x59aa60['hasContentBefore'],'ellipsisAfter':_0x59aa60['hasContentAfter']}),'content':this['_createGetContentFn'](_0x35a6b5,_0x441157['data'])});}}}),_0x5883a8;}['markChangePositionInEditorContent'](_0x5be518,_0x3a2c54){if(!_0x5be518['length'])return;const _0x14b491=_0x5be518[0x0]['parent']['id'],_0x4cba6c=_0x3a2c54['elements']['get'](_0x14b491);if(!_0x4cba6c)return void console['warn']('No\x20element\x20found\x20for\x20ID:\x20'+_0x14b491);const _0x329548=_0x4cba6c['path'],_0x13ed3d=T(this['context']),_0x289ecc=_0x13ed3d['model']['document']['history']['getOperations'](_0x3a2c54['version']),_0x314b61=[];for(const _0x20ffa5 of _0x5be518){const _0x1c8ef7=_0x20ffa5['operationsIsolated']['map'](_0x44cc5d=>this['_translateOperationToEditorContent'](_0x44cc5d,_0x329548,_0x13ed3d['model']['document']['getRoots']()[0x0]));if(!_0x1c8ef7||!_0x1c8ef7['length'])continue;const _0x427d0e=_0x1c8ef7['every'](_0x356db2=>'marker'===_0x356db2['type']&&_0x356db2['name']['startsWith']('$markedRemove')),_0x3aefb2={'document':_0x13ed3d['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1},_0x236643=kt(_0x1c8ef7,_0x289ecc,_0x3aefb2)['operationsA'];for(const _0x1ad196 of _0x236643)if('insert'===_0x1ad196['type']){const _0x1934e5=_0x1ad196,_0x5afc3e=_0x1934e5['nodes'];_0x13ed3d['model']['change'](_0x5138dc=>{const _0x28fa68=_0x5138dc['createDocumentFragment']();for(const _0x34936a of _0x5afc3e)_0x5138dc['append'](_0x34936a['_clone'](!0x0),_0x28fa68);_0x314b61['push']({'start':_0x1934e5['position'],'end':_0x1934e5['position'],'type':'insert','groupId':_0x20ffa5['id'],'content':{'asString':this['_createGetContentFn'](_0x28fa68,_0x13ed3d['data'])(),'asFragment':_0x28fa68}});});}else{if('marker'===_0x1ad196['type']&&_0x1ad196['name']['startsWith']('$markedRemove')){const _0x28d463=_0x1ad196;let _0x5752c4='remove-text';if(_0x427d0e){const _0x5a12b9=this['_findAdjacentContextDistance'](_0x28d463['newRange']['start'],'backward',_0x13ed3d['model']['schema']),_0x236acd=this['_findAdjacentContextDistance'](_0x28d463['newRange']['end'],'forward',_0x13ed3d['model']['schema']);if(_0x5a12b9||_0x236acd){const _0x4d847b=_0x28d463['newRange']['start']['getShiftedBy'](-_0x5a12b9),_0x3c1419=_0x28d463['newRange']['end']['getShiftedBy'](_0x236acd);_0x314b61['push']({'start':_0x4d847b,'end':_0x3c1419,'groupId':_0x20ffa5['id'],'type':'remove-context'});}else _0x5752c4='remove-only';}_0x314b61['push']({'start':_0x28d463['newRange']['start'],'end':_0x28d463['newRange']['end'],'groupId':_0x20ffa5['id'],'type':_0x5752c4});}}}this['_insertMarkers'](_0x314b61);}['clearAllMarkers'](){const _0x528517=T(this['context']);_0x528517['model']['change'](_0x54147e=>{for(const _0x1f30d1 of this['_markers']['keys']())_0x528517['model']['markers']['get'](_0x1f30d1)&&_0x54147e['removeMarker'](_0x1f30d1);}),this['_markers']['clear'](),this['_activeMarkers']['clear']();}['switchToReadOnly'](){T(this['context'])['enableReadOnlyMode']('ai-review');}['switchToEdit'](){T(this['context'])['disableReadOnlyMode']('ai-review');}['applyChange'](_0x133e40){const _0x1a31e0=T(this['context']),_0x3240f9=_0x1a31e0['model'],_0x2805b1=_0x133e40['map'](_0x100c68=>this['_getMarkersDataForGroup'](_0x100c68))['flat']();_0x3240f9['change'](_0x21d31e=>{for(const _0x2ba3e9 of _0x2805b1){const _0x538204=_0x1a31e0['model']['markers']['get'](_0x2ba3e9['id']);if(_0x538204){if('insert'===_0x2ba3e9['type']){if(!_0x2ba3e9['content'])continue;_0x3240f9['insertContent'](_0x2ba3e9['content']['asFragment']||null,_0x538204['getRange']()['start']);}else'remove-text'!==_0x2ba3e9['type']&&'remove-only'!==_0x2ba3e9['type']||_0x3240f9['deleteContent'](_0x3240f9['createSelection'](_0x538204['getRange']()));_0x21d31e['removeMarker'](_0x2ba3e9['id']),this['_markers']['delete'](_0x2ba3e9['id']);}}});}['rejectChange'](_0x342f9e){const _0x2dd22d=T(this['context']),_0x1879ef=this['_getMarkersDataForGroup'](_0x342f9e);_0x2dd22d['model']['change'](_0x5cb9ca=>{for(const _0x27eb0e of _0x1879ef)_0x5cb9ca['removeMarker'](_0x27eb0e['id']),this['_markers']['delete'](_0x27eb0e['id']);});}['getEditor'](){return T(this['context']);}['getMarkerElementForChange'](_0x28e3f0){const _0x3c8e61=Array['from'](this['_markers']['values']())['filter'](_0x4baaa2=>_0x4baaa2['groupId']===_0x28e3f0);if(!_0x3c8e61['length'])return null;const _0x561218=0x1===_0x3c8e61['length']?_0x3c8e61[0x0]:this['_sortMarkers'](_0x3c8e61)[0x0],_0xd10a3a=T(this['context'])['model']['markers']['get'](_0x561218['id']);if(!_0xd10a3a)return null;return{'modelRange':_0xd10a3a['getRange'](),'getElement':()=>this['_findMarkerElementById'](_0x561218['id'])};}['getContentElementForChange'](_0x43a03f){const _0x1aa7cb=Array['from'](this['_markers']['values']())['filter'](_0x11b513=>_0x11b513['groupId']===_0x43a03f);if(!_0x1aa7cb['length'])return null;const _0x209226=0x1===_0x1aa7cb['length']?_0x1aa7cb[0x0]:this['_sortMarkers'](_0x1aa7cb)[0x0],_0x165816=T(this['context']),_0x76d05a=_0x165816['model']['markers']['get'](_0x209226['id']);if(!_0x76d05a)return null;const _0x314604=_0x76d05a['getRange'](),_0x327fe9=_0x165816['editing']['view']['getDomRoot']();if(!_0x327fe9||!_0x314604)return null;let _0x125be9=_0x314604['start']['parent'];for(;_0x125be9['parent']&&'$root'!==_0x125be9['parent']['name'];)_0x125be9=_0x125be9['parent'];if(!_0x125be9||!_0x125be9['name'])return null;const _0x110c78=_0x327fe9['querySelector']('[data-marker-id=\x22'+_0x209226['id']+'\x22]');if(!_0x110c78)return null;let _0x12ef88=null;_0x165816['model']['change'](_0xe8ec5=>{_0x12ef88=_0xe8ec5['createDocumentFragment'](),_0xe8ec5['append'](_0x125be9['_clone'](!0x0),_0x12ef88);});const _0x5a89da=_0x165816['data']['toView'](_0x12ef88)['getChild'](0x0);return _0x110c78['closest'](_0x5a89da['name']);}['reactivateMarkers'](_0x39182f){const _0x587f1f=this['_getMarkersDataForGroup'](_0x39182f);if(!_0x587f1f['length'])return;const _0x189a2e=Array['from'](this['_activeMarkers'])['sort'](),_0x748ad5=Array['from'](new Set(_0x587f1f['map'](_0x17168f=>_0x17168f['id'])))['sort']();_0x189a2e['join']('|')!==_0x748ad5['join']('|')&&(this['setAllMarkersAsInactive'](),this['setMarkersInElementAsActive'](_0x39182f));}['setMarkersInElementAsActive'](_0x204767){const _0x42843c=this['_getMarkersDataForGroup'](_0x204767);if(!_0x42843c['length'])return;const _0x3df55a=T(this['context']),_0x1f2bd1=new Set(_0x42843c['map'](_0x3280b5=>_0x3280b5['id'])),_0x5dcaff=Array['from'](_0x1f2bd1['values']())['map'](_0x3931fb=>_0x3df55a['model']['markers']['get'](_0x3931fb))['filter'](_0x9bc136=>!!_0x9bc136);_0x1f2bd1['forEach'](_0x5ec832=>{this['_activeMarkers']['add'](_0x5ec832);}),_0x3df55a['model']['change'](()=>{_0x5dcaff['forEach'](_0x30a4b8=>{_0x3df55a['editing']['reconvertMarker'](_0x30a4b8);});});}['setAllMarkersAsInactive'](){const _0xf4af1=Array['from'](this['_activeMarkers']);if(!_0xf4af1['length'])return;this['_activeMarkers']['clear']();const _0x201562=T(this['context']),_0x5b7649=_0xf4af1['map'](_0x5f3489=>_0x201562['model']['markers']['get'](_0x5f3489))['filter'](_0x40a23e=>!!_0x40a23e);_0x201562['model']['change'](()=>{_0x5b7649['forEach'](_0x96e86d=>{_0x201562['editing']['reconvertMarker'](_0x96e86d);});});}['_getPositionLimitingRange'](_0x429e79,_0x35322b,_0x373661='outside'){if(!_0x429e79)return null;let _0x3e37cd=_0x429e79['parent'];for(;_0x3e37cd&&_0x3e37cd['parent']&&'$root'!==_0x3e37cd['parent']['name']&&!_0x35322b['model']['schema']['isLimit'](_0x3e37cd)&&!_0x35322b['model']['schema']['isBlock'](_0x3e37cd);)_0x3e37cd=_0x3e37cd['parent'];if(!_0x3e37cd||!_0x3e37cd['name']||'$root'===_0x3e37cd['name'])return null;let _0x3cf867=null;return _0x35322b['model']['change'](_0x2bebd3=>{_0x3cf867='inside'===_0x373661?_0x2bebd3['createRangeIn'](_0x3e37cd):_0x2bebd3['createRangeOn'](_0x3e37cd);}),_0x3cf867;}['_validateMarkers'](_0x4d0e73,_0x3c9a47){const _0x823dc8=Array['from'](this['_markers']['keys']()),_0x3aba87=new Map();for(const _0x2533f4 of _0x823dc8){const _0x2c989d=_0x4d0e73['model']['markers']['get'](_0x2533f4);if(!_0x2c989d)continue;const _0xfd944c=_0x2c989d['getStart']()['path'][0x0];_0x3aba87['has'](_0xfd944c)||_0x3aba87['set'](_0xfd944c,[]),_0x3aba87['get'](_0xfd944c)['push'](_0x2c989d);}const _0xeb3f97=new Set();for(const _0x522833 of _0x4d0e73['model']['document']['differ']['getChanges']()){let _0xde98fe=-0x1,_0x1b6ea8=null;if('insert'===_0x522833['type'])_0x1b6ea8=new dt(_0x522833['position'],_0x522833['position']['getShiftedBy'](_0x522833['length'])),_0xde98fe=_0x522833['position']['path'][0x0];else{if('remove'!==_0x522833['type'])continue;_0x1b6ea8=new dt(_0x522833['position']),_0xde98fe=_0x522833['position']['path'][0x0];}const _0x152409=_0x3aba87['get'](_0xde98fe)||[];if(_0x152409['length']){for(const _0x468a39 of _0x152409)if(_0x1b6ea8['root']['rootName']===_0x468a39['getRange']()['root']['rootName']&&('insert'!==_0x522833['type']||!_0x1b6ea8['containsRange'](_0x468a39['getRange']()))&&(_0x1b6ea8['isIntersecting'](_0x468a39['getRange']())||_0x1b6ea8['start']['isTouching'](_0x468a39['getRange']()['end'])||_0x1b6ea8['end']['isTouching'](_0x468a39['getRange']()['start']))){const _0x452129=this['_parseMarkerName'](_0x468a39['name']);Array['from'](this['_markers']['values']())['filter'](_0x353781=>_0x353781['groupId']===_0x452129['groupId'])['forEach'](_0x294980=>_0xeb3f97['add'](_0x294980['id']));}}}if(_0xeb3f97['size']){for(const _0x255bf4 of _0xeb3f97)_0x3c9a47['removeMarker'](_0x255bf4);return!0x0;}return!0x1;}['_handleMarkerChanges'](_0x39130d){for(const {name:_0x148209,data:_0xbb8117}of _0x39130d['model']['document']['differ']['getChangedMarkers']()){if(!_0x148209['startsWith'](fe))continue;const _0x351e8e=_0xbb8117['oldRange'],_0x3e9756=_0xbb8117['newRange'],_0x18bca1=_0x351e8e&&'$graveyard'===_0x351e8e['root']['rootName'],_0x5bb75a=_0x3e9756&&'$graveyard'===_0x3e9756['root']['rootName'];if(_0x18bca1&&_0x5bb75a)continue;const _0x338fe6=this['_parseMarkerName'](_0x148209);this['_markers']['get'](_0x148209)&&(_0x5bb75a||!_0x3e9756?this['_eventEmitter']['fire']('changeMarkerRemoved',{'markerId':_0x148209,'changeId':_0x338fe6['groupId']}):_0x18bca1&&_0x3e9756&&this['_eventEmitter']['fire']('changeMarkerRestored',{'markerId':_0x148209,'changeId':_0x338fe6['groupId']}));}}['_parseMarkerName'](_0x2001ac){const _0x43a8b9=_0x2001ac['split'](':'),_0x39185c=(_0x43a8b9[0x1]||'')['split']('_');return{'prefix':_0x43a8b9[0x0],'groupId':_0x39185c[0x0],'suffix':_0x39185c[0x1]};}['_translateOperationToEditorContent'](_0x3a2101,_0x13ddbc,_0x38fba6){if('insert'===_0x3a2101['type']){const _0x56137c=_0x3a2101;return new _0x4675cd(this['_changePosition'](_0x13ddbc['concat'](_0x56137c['position']['offset']),_0x38fba6),_0x56137c['nodes'],_0x56137c['baseVersion']);}if('marker'===_0x3a2101['type']&&_0x3a2101['name']['startsWith']('$markedRemove')){const _0x5e4a40=_0x3a2101;return new _0x2a897f(_0x5e4a40['name'],_0x5e4a40['oldRange'],this['_changeRange'](_0x5e4a40['newRange'],_0x13ddbc['concat'](_0x5e4a40['newRange']['start']['offset']),_0x13ddbc['concat'](_0x5e4a40['newRange']['end']['offset']),_0x38fba6),_0x5e4a40['_markers'],_0x5e4a40['affectsData'],_0x5e4a40['baseVersion']);}return _0x3a2101;}['_groupAdjacentOperations'](_0x50702c){if(!_0x50702c['length'])return[];const _0xcea915=[];let _0x118105=0x0,_0x56fae0=0x0,_0x3fea21=[];for(let _0x25aec1=0x0;_0x25aec1<=_0x50702c['length'];_0x25aec1++){const _0x286f2c=_0x50702c[_0x25aec1],_0x3621ea=_0x50702c[_0x25aec1-0x1];!_0x286f2c||_0x3621ea&&!this['_getOperationEnd'](_0x3621ea)['isTouching'](this['_getOperationStart'](_0x286f2c))?(_0xcea915['push']({'operations':_0x3fea21,'operationsIsolated':_0x3fea21['map'](_0x1678d8=>this['_shiftOperation'](_0x1678d8['clone'](),-_0x56fae0)),'groupOffset':_0x118105}),_0x3fea21=_0x286f2c?[_0x286f2c]:[],_0x56fae0+=_0x118105,_0x118105=0x0):_0x3fea21['push'](_0x286f2c),_0x286f2c&&'insert'===_0x286f2c['type']&&(_0x118105+=_0x286f2c['howMany']);}return _0xcea915;}['_findAdjacentContextDistance'](_0x52acde,_0x14f496,_0x26a714,_0x396eb2=0x1){const _0x5e986a=new _0x1f3d99({'startPosition':_0x52acde,'direction':_0x14f496});let _0x126e11=0x0;for(let _0x3225eb=0x0;_0x3225eb<_0x396eb2;_0x3225eb++){let _0x5c9b33=0x0,_0x18fcbd=!0x1,_0x2f4f22='forward'===_0x14f496?/^\W*\w+/:/\w+\W*$/;for(const {item:_0x240246}of _0x5e986a)if(_0x240246['is']('$textProxy')){const _0x5c04da=_0x2f4f22['exec'](_0x240246['data']);if(_0x5c04da&&_0x5c04da['length']){if(_0x5c9b33+='forward'===_0x14f496?_0x5c04da['index']+_0x5c04da[0x0]['length']:_0x240246['data']['length']-_0x5c04da['index'],_0x5c04da[0x0]['length']!==_0x240246['data']['length'])break;_0x18fcbd=!0x0,_0x2f4f22='forward'===_0x14f496?/^\w+/:/\w+$/;}else{if(_0x18fcbd)break;_0x5c9b33+=_0x240246['offsetSize'];}}else{if(_0x240246['is']('element')){_0x26a714['isInline'](_0x240246)&&!_0x18fcbd&&(_0x5c9b33+=0x1);break;}}_0x126e11+=_0x5c9b33,_0x5e986a['jumpTo'](_0x52acde['getShiftedBy']('forward'===_0x14f496?_0x126e11:-_0x126e11));}return _0x126e11;}['_getChangeContext'](_0x11189b,_0xc6b5ed){const _0x5b40a2=T(this['context'])['model']['schema'],_0x1681bb=this['_findAdjacentContextDistance'](_0x11189b,'backward',_0x5b40a2,0x6),_0x430f5f=this['_findAdjacentContextDistance'](_0xc6b5ed,'forward',_0x5b40a2,0x6),_0x1bf9a8=_0x11189b['getShiftedBy'](-_0x1681bb),_0x215894=_0xc6b5ed['getShiftedBy'](_0x430f5f);return{'start':_0x1bf9a8,'end':_0x215894,'hasContentBefore':!_0x1bf9a8['isAtStart'],'hasContentAfter':!_0x215894['isAtEnd']};}['_insertMarkers'](_0x2bda01){const _0x58337a=this['context']['plugins']['get']('AIEditing'),_0x221492=new Set();T(this['context'])['model']['change'](_0x537ff7=>{for(const _0x2cb3fe of _0x2bda01){const _0x52f2d9=''+fe+_0x2cb3fe['type']+':'+_0x2cb3fe['groupId']+'_'+_0x58337a['_nextDataId'](_0x221492);this['_markers']['set'](_0x52f2d9,{'id':_0x52f2d9,'groupId':_0x2cb3fe['groupId'],'type':_0x2cb3fe['type'],'content':_0x2cb3fe['content']}),_0x537ff7['addMarker'](_0x52f2d9,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x537ff7['createRange'](_0x2cb3fe['start'],_0x2cb3fe['end'])});}});}['_createGetContextFn'](_0x520038,_0xda4e9b,_0x233e1c){let _0x179c2d='';return()=>{if(!_0x179c2d){const _0x51a567=_0xda4e9b['toView'](_0x520038,{'showSuggestionHighlights':!0x0});let _0x67af03=_0x51a567['getChild'](0x0);if(_0x67af03['is']('containerElement')||(_0x67af03=_0x51a567),!_0x67af03)return'';let _0x11d55c=!0x1;const _0x476ff3=[];for(const _0x16b5bc of _0x67af03['getChildren']())_0x16b5bc['is']('element','span')&&_0x16b5bc['hasClass']('ck-ai_review-marker_context-end')&&(_0x11d55c=!0x1),_0x11d55c&&_0x476ff3['push'](_0x16b5bc),_0x16b5bc['is']('element','span')&&_0x16b5bc['hasClass']('ck-ai_review-marker_context-start')&&(_0x11d55c=!0x0);_0x67af03['_removeChildren'](0x0,_0x67af03['childCount']),_0x233e1c?.['ellipsisBefore']&&_0x67af03['_appendChild']('…'),_0x67af03['_appendChild'](_0x476ff3),_0x233e1c?.['ellipsisAfter']&&_0x67af03['_appendChild']('…');const _0x1ba116=_0xda4e9b['htmlProcessor']['domConverter']['viewToDom'](_0x51a567),_0x373936=_0xda4e9b['htmlProcessor']['htmlWriter']['getHtml'](_0x1ba116);_0x179c2d=_0x373936;}return _0x179c2d;};}['_createGetContentFn'](_0x1d913b,_0x13d411){let _0xecd8c5='';return()=>(_0xecd8c5||(_0xecd8c5=_0x13d411['stringify'](_0x1d913b,{'showSuggestionHighlights':!0x0})),_0xecd8c5);}['_createGetContentUsingDataIdFn'](_0xde4a46,_0x3460df,_0xf6b8ab){let _0x164373='';return()=>{if(!_0x164373){const _0x1e6574=_0xf6b8ab['toView'](new bt(_0xde4a46)),_0x371799=_0xf6b8ab['htmlProcessor']['domConverter']['viewToDom'](_0x1e6574)['querySelector']('[data-id=\x22'+_0x3460df+'\x22]');_0x164373=_0x371799?.['outerHTML']||'';}return _0x164373;};}['_findMarkerElement'](_0x4d530c,_0x258566=0x5){let _0x21c9e9=_0x4d530c,_0x3de4f3=null;for(let _0x2ab434=0x0;_0x2ab434<_0x258566&&_0x21c9e9;_0x2ab434++){if(!_0x21c9e9['className']){_0x21c9e9=_0x21c9e9['parentElement'];continue;}if(!(''+_0x21c9e9['className'])['includes']('ck-ai_review-marker_')){_0x21c9e9=_0x21c9e9['parentElement'];continue;}if(!_0x21c9e9['getAttribute']('data-marker-id'))break;_0x3de4f3=_0x21c9e9;break;}return _0x3de4f3;}['_findMarkerElementById'](_0x4353d9){const _0x11a196=T(this['context']),_0x50a0a2=_0x11a196['model']['markers']['get'](_0x4353d9);return _0x50a0a2?_0xce5e3b(_0x11a196['editing'],_0x50a0a2):null;}['_getMarkersDataForGroup'](_0x8e40f8){return Array['from'](this['_markers']['values']())['filter'](_0x4b4318=>_0x4b4318['groupId']===_0x8e40f8);}['_getOperationStart'](_0x195b74){return'insert'===_0x195b74['type']?_0x195b74['position']:_0x195b74['newRange']['start'];}['_getOperationEnd'](_0x310c92,_0x101561=!0x1){return'insert'===_0x310c92['type']?_0x101561?_0x310c92['position']:_0x310c92['position']['getShiftedBy'](_0x310c92['howMany']):_0x310c92['newRange']['end'];}['_shiftOperation'](_0x1bc0ef,_0x319d3f){return'insert'===_0x1bc0ef['type']?_0x1bc0ef['position']=_0x1bc0ef['position']['getShiftedBy'](_0x319d3f):'marker'===_0x1bc0ef['type']&&_0x1bc0ef['newRange']&&(_0x1bc0ef['newRange']=new dt(_0x1bc0ef['newRange']['start']['getShiftedBy'](_0x319d3f),_0x1bc0ef['newRange']['end']['getShiftedBy'](_0x319d3f))),_0x1bc0ef;}['_changeOperationOwnerDocument'](_0x820e4e,_0x3079f4){'insert'===_0x820e4e['type']?_0x820e4e['position']=this['_changePositionOwnerDocument'](_0x820e4e['position'],_0x3079f4):'marker'===_0x820e4e['type']&&_0x820e4e['newRange']&&(_0x820e4e['newRange']=this['_changeRangeOwnerDocument'](_0x820e4e['newRange'],_0x3079f4));}['_changePositionOwnerDocument'](_0x2b069e,_0x142ac7){return new vt(_0x142ac7,_0x2b069e['path']);}['_changeRangeOwnerDocument'](_0x10dbd9,_0x3633c5){return new dt(this['_changePositionOwnerDocument'](_0x10dbd9['start'],_0x3633c5),this['_changePositionOwnerDocument'](_0x10dbd9['end'],_0x3633c5));}['_changePosition'](_0x135ce0,_0x437840){return new vt(_0x437840,[..._0x135ce0]);}['_changeRange'](_0x195866,_0x525cd2,_0xff3fd0,_0x332086){return new dt(this['_changePosition'](_0x525cd2,_0x332086),this['_changePosition'](_0xff3fd0,_0x332086));}['_sortMarkers'](_0x1de88e){const _0x394651=_0x2ab5a0=>{switch(_0x2ab5a0){case'insert':return 0x0;case'remove-context':return 0x1;case'remove-only':return 0x2;case'remove-text':return 0x3;}};return _0x1de88e['sort']((_0xf21889,_0x1b6bd8)=>_0x394651(_0xf21889['type'])-_0x394651(_0x1b6bd8['type']));}['_hasSameTopLevelElement'](_0x4b7be0,_0x147c4d){const _0x403226=_0x4b7be0['getChild'](0x0),_0x2ca8dd=_0x147c4d['getChild'](0x0);return!(!_0x403226||!_0x2ca8dd)&&((!_0x403226['is']('element')||!_0x2ca8dd['is']('element')||_0x403226['name']===_0x2ca8dd['name'])&&!(_0x403226['is']('element')&&!_0x2ca8dd['is']('element')||!_0x403226['is']('element')&&_0x2ca8dd['is']('element')));}['_haveSingleTopLevelElement'](_0x2cafd8){return 0x1===_0x2cafd8['childCount'];}['_haveOnlyInlineContent'](_0xeff190,_0x12978b){for(const _0x101381 of _0xeff190['getChildren']())if(_0x101381['is']('element')&&!_0x12978b['isInline'](_0x101381))return!0x1;return!0x0;}['_upsertDataId'](_0x115a23,_0x28dc23){let _0x487618=_0x115a23['getAttribute'](nt);return _0x487618||(_0x487618=_0x28dc23(),_0x115a23['_setAttribute'](nt,_0x487618)),_0x487618;}}class Ms extends _0x5bd7c6(){['id'];['contentNew'];['contentInitial'];['documentVersion'];constructor({id:_0xe4c636,contentNew:_0x6428dd,contentInitial:_0x1b6ffc,documentVersion:_0x2f4a36}){super(),this['id']=_0xe4c636,this['contentNew']=_0x6428dd,this['contentInitial']=_0x1b6ffc,this['documentVersion']=_0x2f4a36;}}class Os extends ts(){['id'];['parent'];['_data'];['_editorOperations']=[];constructor(_0x1d7cc9,_0x14baf1,_0x2c9f0a){super(),this['id']=_0x1d7cc9,this['parent']=_0x2c9f0a,this['_data']=_0x14baf1,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 Js extends ts(){['id']=_0x48eb5e();['callId'];['_results']=new Map();['_changes']=[];['_sourceCheck'];['_documentData'];['_aiConnector'];['_reviewParams'];['_reviewArgs'];['_activeRequest']=null;['_currentError'];['_wasAborted']=!0x1;constructor(_0x5e04ca,_0x52e982,_0x11e5e8,_0x3acd14,_0x5701f2){super(),this['_sourceCheck']=_0x52e982,this['_documentData']=_0x5e04ca,this['_aiConnector']=_0x11e5e8,this['_reviewParams']=_0x3acd14,this['_reviewArgs']=_0x5701f2,this['on']('change:status',(_0xd3b665,_0x285ef7,_0x5619d9)=>{'aborted'==_0x5619d9&&(this['_wasAborted']=!0x0),this['fire']('reviewCheckRunUpdated',{'status':_0x5619d9,'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'](_0x5108dd=>'pending'===_0x5108dd['status']);}get['currentError'](){return this['_currentError'];}['updateDocumentData'](_0x2d06bc){this['_documentData']=_0x2d06bc;}async['start'](){this['status']='loading',this['_currentError']=void 0x0;try{this['_activeRequest']=this['_createApiRequest']();const _0x4d4771=await this['_activeRequest']['getStream']();this['status']='data';for await(const _0x50169c of _0x4d4771)'unmodified'!==_0x50169c['data']['operation']&&('error'!==_0x50169c['data']['operation']?'review-metadata'!==_0x50169c['event']?this['_addReviewCheckResult'](_0x50169c['data']['dataId'],_0x50169c['data']['textDelta']):this['callId']=_0x50169c['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(_0x31e00f){this['_currentError']=_0x31e00f,_0x31e00f instanceof Error&&_0x31e00f['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'](_0x47733d,_0x51a746){const _0x58b678=this['_results']['get'](_0x47733d);if(!_0x58b678)return;if(0x0===_0x51a746['length'])return;const _0x26037e=[];_0x51a746['forEach']((_0x33d6e2,_0xeeb3cd)=>{const _0x41e7a9=new Os(_0x58b678['id']+'-'+_0xeeb3cd,_0x33d6e2,_0x58b678);_0x41e7a9['on']('change:status',()=>{this['fire']('reviewCheckResultChangeStatusUpdated',{'change':_0x41e7a9,'status':_0x41e7a9['status']});}),_0x41e7a9['on']('change:isActivated',()=>{_0x41e7a9['isActivated']?this['fire']('reviewCheckResultActivated',{'change':_0x41e7a9}):this['fire']('reviewCheckResultDeactivated',{'change':_0x41e7a9});}),this['_changes']['push'](_0x41e7a9),_0x26037e['push'](_0x41e7a9);}),this['fire']('reviewCheckResultReady',{'changes':_0x26037e,'result':_0x58b678,'source':this});}['abort'](){this['_activeRequest']&&(this['_activeRequest']['abortController']['abort'](),this['_activeRequest']=null,this['status']='aborted');}['isChangeActive'](_0x83c651){const _0xe65eba=this['_changes']['find'](_0x83be17=>_0x83be17['id']===_0x83c651);return!(!_0xe65eba||'pending'!==_0xe65eba['status']);}['isAnyChangeActivated'](){return this['_changes']['some'](_0x19162b=>!0x0===_0x19162b['isActivated']);}['getActiveChanges'](){return this['_changes']['filter'](_0x52f4c6=>'pending'===_0x52f4c6['status']);}['getChangeById'](_0xddfddd){return this['_changes']['find'](_0x14dc01=>_0x14dc01['id']===_0xddfddd);}['markAllChangesAsAccepted'](){for(const _0x449ccf of this['_changes'])'pending'===_0x449ccf['status']&&(_0x449ccf['status']='accepted');this['_checkIfFinished']();}['markChangeAsAccepted'](_0x38c440){const _0x4445b2=this['_changes']['find'](_0x269b05=>_0x269b05['id']===_0x38c440);_0x4445b2&&'pending'===_0x4445b2['status']&&(_0x4445b2['status']='accepted'),this['_checkIfFinished']();}['markChangeAsRejected'](_0x16947b){const _0x4be4b8=this['_changes']['find'](_0x231c45=>_0x231c45['id']===_0x16947b);_0x4be4b8&&'pending'===_0x4be4b8['status']&&(_0x4be4b8['status']='rejected'),this['_checkIfFinished']();}['markChangeAsOutdated'](_0x91082c){const _0x31089f=this['_changes']['find'](_0xffe695=>_0xffe695['id']===_0x91082c);_0x31089f&&'pending'===_0x31089f['status']&&(_0x31089f['status']='outdated'),this['_checkIfFinished']();}['markChangeAsPending'](_0x379dbe){const _0x2cd9e9=this['_changes']['find'](_0x24dfbc=>_0x24dfbc['id']===_0x379dbe);_0x2cd9e9&&'outdated'===_0x2cd9e9['status']&&(_0x2cd9e9['status']='pending'),this['_checkIfFinished']();}['activateChange'](_0x26bfa1){this['_changes']['filter'](_0x2b3e9d=>_0x2b3e9d['isActivated']&&_0x2b3e9d['id']!==_0x26bfa1)['forEach'](_0xdd5160=>{_0xdd5160['isActivated']=!0x1;});const _0x4edb82=this['_changes']['find'](_0x4472f9=>_0x4472f9['id']===_0x26bfa1);_0x4edb82&&'pending'===_0x4edb82['status']&&(_0x4edb82['isActivated']=!0x0);}['deactivateChange'](){this['_changes']['filter'](_0x1b67b1=>_0x1b67b1['isActivated'])['forEach'](_0x128839=>{_0x128839['isActivated']=!0x1;});}['forceReadyState'](){this['status']='ready';}async['sendRating'](_0x4bdd19){if('initialized'===this['status']||'loading'===this['status']||'data'===this['status']||this['_wasAborted'])return;if(!this['callId']||0x0===this['_changes']['length'])return;let _0x7309b8;if(_0x4bdd19){const _0x2f050b=this['_changes']['find'](_0x4e72e0=>_0x4e72e0['id']===_0x4bdd19);if(_0x2f050b&&_0x2f050b['isRated'])return;_0x2f050b&&(_0x7309b8=_0x2f050b['parent']['id'],_0x2f050b['isRated']=!0x0);}const _0x55b4f5={'positiveCount':this['_changes']['filter'](_0x5495a9=>'accepted'===_0x5495a9['status'])['length'],'totalCount':this['_changes']['length']};this['_sendRatingRequest'](_0x55b4f5,this['callId'],_0x7309b8);}['_addReviewCheckResult'](_0x12b2ac,_0x54bac1){const _0x51713c=this['_documentData']['elements']['get'](_0x12b2ac);if(!_0x51713c)return;const _0x37d586=_0x51713c['getContent']();if(_0x37d586===_0x54bac1)return;const _0x1b7940=new Ms({'id':_0x12b2ac,'contentInitial':_0x37d586,'contentNew':_0x54bac1,'documentVersion':this['_documentData']['version']});this['_results']['set'](_0x1b7940['id'],_0x1b7940),this['fire']('reviewCheckResultAdded',{'result':_0x1b7940,'source':this});}['_checkIfFinished'](){'finished'===this['status']&&(this['_changes']['filter'](_0x574d8f=>'pending'===_0x574d8f['status'])['length']>0x0&&(this['status']='ready')),'ready'===this['status']&&(0x0===this['_changes']['filter'](_0x37ff5c=>'pending'===_0x37ff5c['status'])['length']&&(this['status']='finished'));}}class si extends Js{get['subTitle'](){if(!this['_reviewParams']||0x0===this['_reviewParams']['length'])return'';const _0xe77f8c=[];if(this['_reviewParams']['length']>0x0&&this['_sourceCheck']['options'])for(let _0x172257=0x0;_0x172257<this['_reviewParams']['length'];_0x172257++){if(!this['_reviewParams'][_0x172257]||!this['_sourceCheck']['options'][_0x172257])continue;const _0xcb4ff4=this['_sourceCheck']['options'][_0x172257],_0x12d477=_0xcb4ff4['data']?.['find'](_0x21e5a5=>_0x21e5a5['id']===this['_reviewParams'][_0x172257]);_0x12d477&&_0xe77f8c['push'](_0x12d477['label']);}return _0xe77f8c['join'](',\x20');}get['reviewName'](){return this['_composeReviewName']();}['_createApiRequest'](){return this['_aiConnector']['callSystemReview']({'reviewName':this['_composeReviewName'](),'content':this['_documentData']['content'],'args':this['_reviewArgs']});}['_sendRatingRequest'](_0x2f4dca,_0x149c14,_0x49e3f1){return this['_aiConnector']['upsertAIReviewRating'](this['reviewName'],_0x149c14,_0x2f4dca,_0x49e3f1);}['_composeReviewName'](){return!this['_reviewParams']||0x0===this['_reviewParams']['length']||this['_sourceCheck']['useArgs']?this['_sourceCheck']['apiId']:[this['_sourceCheck']['apiId'],...this['_reviewParams']]['join']('-');}}class ve extends _0x3a5602{['_aiConnector'];['_aiReviewCoreUi'];['_aiReviewCoreEditing'];['_aiReviewCheckList'];['_currentReviewCheckRun'];['_changeActivationSource']=null;static get['requires'](){return[tt];}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}async['init'](){this['_initRequiredPlugins'](),this['_aiReviewCheckList']=await this['_getChecksList'](),this['listenTo'](this['_aiReviewCoreUi'],'getReviewCheckList',()=>{this['_aiReviewCoreUi']['setAvailableChecks'](this['_aiReviewCheckList']['checks']);}),this['listenTo'](this['_aiReviewCoreUi'],'runReviewCheck',async(_0x8f717d,_0x368ba3)=>{const _0x233b38=this['_aiReviewCheckList']['getCheckById'](_0x368ba3['id']);if(_0x233b38){this['_onReviewCheckRun'](_0x368ba3),this['_aiReviewCoreEditing']['switchToReadOnly'](),this['_currentReviewCheckRun']=this['_createReviewCheckRun'](_0x368ba3,_0x233b38),this['_aiReviewCoreUi']['setCheckResultTitle'](this['_currentReviewCheckRun']['title'],this['_currentReviewCheckRun']['subTitle']),this['_currentReviewCheckRun']['on']('reviewCheckRunUpdated',(_0x49ca2b,_0xf9939)=>{switch(_0xf9939['status']){case'data':case'loading':this['_aiReviewCoreUi']['showCheckRunResults'](_0xf9939);break;case'finished':this['_onCheckRunFinished']();break;case'ready':this['_aiReviewCoreUi']['showActionsWhenResultIsReady']();break;case'unmodified':this['_aiReviewCoreUi']['showNoChangesView']();break;case'error-general':this['_aiReviewCoreUi']['showGeneralResultsErrorView'](),this['_logError'](new _0x563e6a('ai-review-mode-check-run-general-error',this,void 0x0,this['_currentReviewCheckRun']?.['currentError']));break;case'error-chunk':this['_aiReviewCoreUi']['showChunkErrorView'](),this['_logError'](new _0x563e6a('ai-review-mode-check-run-chunk-error',this,void 0x0,this['_currentReviewCheckRun']?.['currentError']));break;case'aborted':this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['processedResultsCount']>0x0?setTimeout(()=>{this['_currentReviewCheckRun']?.['forceReadyState']();},0x0):this['_onReviewRunLeave'](!0x0);}'ready'!==_0xf9939['status']&&'error-chunk'!==_0xf9939['status']&&'error-general'!==_0xf9939['status']||this['_currentReviewCheckRun']?.['sendRating']();}),this['_currentReviewCheckRun']['on']('reviewCheckResultAdded',(_0x710dff,_0x43d28b)=>{if(!this['_currentReviewCheckRun'])throw new _0x563e6a('ai-review-mode-no-current-check-run',this);const _0x38d3a1=this['_diffContent'](_0x43d28b['result']['contentInitial'],_0x43d28b['result']['contentNew']);_0x43d28b['source']['addResultChanges'](_0x43d28b['result']['id'],_0x38d3a1);}),this['_currentReviewCheckRun']['on']('reviewCheckResultReady',(_0x3bf9d6,_0x9b102d)=>{for(const _0xf565c2 of _0x9b102d['changes'])this['_aiReviewCoreUi']['showCheckRunResult'](_0xf565c2);this['_markChangePositionInEditorContent'](_0x9b102d['changes'],_0x9b102d['source']['documentData']);}),this['_currentReviewCheckRun']['on']('reviewCheckResultChangeStatusUpdated',(_0x127414,_0x7cb648)=>{this['_aiReviewCoreUi']['updateChangeState'](_0x7cb648['change']['id'],_0x7cb648['status']);}),this['_currentReviewCheckRun']['on']('reviewCheckResultActivated',(_0x37b5b4,_0x5485f3)=>{this['_onReviewCheckResultActivated'](_0x5485f3);}),this['_currentReviewCheckRun']['on']('reviewCheckResultDeactivated',()=>{this['_onReviewCheckResultDeactivated']();});try{await this['_currentReviewCheckRun']['start']();}catch(_0x4a7e81){_0x4a7e81 instanceof Error&&_0x4a7e81['message']['includes']('ai-request-aborted')||(_0x4a7e81 instanceof _0x563e6a?this['_logError'](_0x4a7e81):this['_logError'](new _0x563e6a('ai-review-mode-check-run-failed',this,void 0x0,_0x4a7e81)));}}else this['_logError'](new _0x563e6a('ai-review-mode-source-check-not-found',this,{'checkId':_0x368ba3['id']}));}),this['listenTo'](this['_aiReviewCoreUi'],'leaveReview',()=>{this['_onReviewRunLeave']();}),this['listenTo'](this['_aiReviewCoreUi'],'leaveReviewCoreResultList',()=>{this['_onReviewRunLeave'](!0x0);}),this['listenTo'](this['_aiReviewCoreUi'],'abortReviewStream',()=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['abort']();}),this['listenTo'](this['_aiReviewCoreUi'],'finishReview',()=>{this['_onReviewRunLeave'](!0x0);}),this['listenTo'](this['_aiReviewCoreUi'],'acceptAllChanges',()=>{if(!this['_currentReviewCheckRun'])return;const _0x1cda1b=this['_currentReviewCheckRun']['getActiveChanges']();if(!_0x1cda1b['length'])return;this['_aiReviewCoreEditing']['applyChange'](_0x1cda1b['map'](_0x7fb44e=>_0x7fb44e['id']));const _0x51d24f=this['_currentReviewCheckRun'];_0x51d24f['markAllChangesAsAccepted'](),_0x51d24f['sendRating']();}),this['listenTo'](this['_aiReviewCoreUi'],'acceptChange',(_0x14ece4,_0x38c6a3)=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['isChangeActive'](_0x38c6a3['id'])&&(this['_aiReviewCoreEditing']['applyChange']([_0x38c6a3['id']]),this['_currentReviewCheckRun']['markChangeAsAccepted'](_0x38c6a3['id']),this['_aiReviewCoreUi']['hideChangeBalloon'](),this['_currentReviewCheckRun']['sendRating'](_0x38c6a3['id']));}),this['listenTo'](this['_aiReviewCoreUi'],'dismissChange',(_0x47f046,_0x4c68af)=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['isChangeActive'](_0x4c68af['id'])&&(this['_aiReviewCoreEditing']['rejectChange'](_0x4c68af['id']),this['_currentReviewCheckRun']['markChangeAsRejected'](_0x4c68af['id']),this['_aiReviewCoreUi']['hideChangeBalloon'](),this['_currentReviewCheckRun']['sendRating'](_0x4c68af['id']));}),this['listenTo'](this['_aiReviewCoreUi'],'retryReview',async()=>{this['_currentReviewCheckRun']&&(this['_aiReviewCoreEditing']['clearAllMarkers'](),this['_currentReviewCheckRun']['updateDocumentData'](this['_aiReviewCoreEditing']['getDocumentData']()),await this['_currentReviewCheckRun']['restart']());}),this['listenTo'](this['_aiReviewCoreUi'],'activateChange',(_0x5d6a48,_0x264368)=>{this['_onActivateChange'](_0x264368);}),this['listenTo'](this['_aiReviewCoreUi'],'deactivateChange',(_0x89a650,_0x11c693)=>{this['_onDeactivateChange'](_0x11c693);}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerClicked',(_0x376614,_0x5588c1)=>{this['_onChangeMarkerClicked'](_0x376614,_0x5588c1);}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerHovered',(_0x4cdc77,_0x441a04)=>{this['_onChangeMarkerHovered'](_0x4cdc77,_0x441a04);}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerBlurred',()=>{this['_onChangeMarkerBlurred']();}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerRemoved',(_0xa00ce1,_0x3c787f)=>{this['_onChangeMarkerRemoved'](_0xa00ce1,_0x3c787f);}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerRestored',(_0xdf0f5e,_0x1746ab)=>{this['_onChangeMarkerRestored'](_0xdf0f5e,_0x1746ab);});}['_createReviewCheckRun'](_0x1d9345,_0x3b6394){return new si(this['_aiReviewCoreEditing']['getDocumentData'](),_0x3b6394,this['_aiConnector'],_0x1d9345['params'],_0x1d9345['args']);}['_onChangeMarkerRemoved'](_0x547aed,_0x2fa5bc){this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['markChangeAsOutdated'](_0x2fa5bc['changeId']);}['_onChangeMarkerRestored'](_0x49acfb,_0x1c640f){this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['markChangeAsPending'](_0x1c640f['changeId']);}['_onCheckRunFinished'](){this['_aiReviewCoreUi']['showReviewCompletedView']();}['_initRequiredPlugins'](){this['_aiConnector']=this['context']['plugins']['get']('AIConnector');}['_onReviewRunLeave'](_0x3799da=!0x1){this['_currentReviewCheckRun']&&(this['_currentReviewCheckRun']['hasModifications']||this['_currentReviewCheckRun']['sendRating'](),this['_currentReviewCheckRun']['stopListening'](),this['_currentReviewCheckRun']['abort'](),this['_currentReviewCheckRun']=void 0x0),_0x3799da&&this['_aiReviewCoreUi']['showReviewCheckList'](),this['_aiReviewCoreEditing']['clearAllMarkers'](),this['_aiReviewCoreEditing']['switchToEdit'](),this['_changeActivationSource']=null;const _0x585abf=this['_aiReviewCoreEditing']['getEditor']();_0x585abf&&_0x585abf['editing']['view']['change'](_0x397f47=>{const _0x126b6b=_0x585abf['editing']['view']['document']['getRoot']();_0x397f47['removeClass']('ck-ai_review-diff',_0x126b6b),_0x397f47['removeClass']('ck-ai_review-highlights',_0x126b6b),_0x397f47['removeClass']('ck-ai-translate-mode-content',_0x126b6b);});}['_getTranslationWithDefault'](_0x282f88,_0x43bb35){const _0x58e076=i(this['context']['locale'],_0x282f88);return _0x58e076===_0x282f88?_0x43bb35:_0x58e076;}['_logError'](_0x31b711,_0x591ff6=!0x1){_0x4e5dbd(_0x31b711['message']),_0x591ff6||(_0x31b711['message']['startsWith']('ai-review-mode-models-unable-to-retrieve')?this['_aiReviewCoreUi']['showGeneralReviewCoreErrorView']():this['_aiReviewCoreUi']['showGeneralResultsErrorView']());}['_scrollToChange'](_0x4cb74c){if('content'===this['_changeActivationSource']){const _0xfcc3d6=this['_aiReviewCoreUi']['getChangeElement'](_0x4cb74c);_0xfcc3d6&&_0x54a145(_0xfcc3d6['closest']('.ck-ai_review__check-run-result')||_0xfcc3d6);}else{if('panel'===this['_changeActivationSource']){const _0x45cd3d=this['_getChangeContentElement'](_0x4cb74c);if(!_0x45cd3d)return;_0x1fa956({'target':_0x45cd3d,'viewportOffset':{'top':0x55,'left':0x0,'bottom':0x0,'right':0x0},'ancestorOffset':0x14,'alignToTop':!0x0});}}}}const we=[{'id':'custom','commandId':'custom','title':'Custom\x20command','description':'Type\x20a\x20custom\x20command\x20to\x20review\x20the\x20content\x20exactly\x20as\x20you\x20need.','isParameterized':!0x0},{'id':'correctness','commandId':'correctness','title':'Correctness','description':'Ensure\x20the\x20text\x20is\x20factually\x20accurate\x20and\x20free\x20of\x20errors.','isParameterized':!0x1},{'id':'clarity','commandId':'clarity','title':'Clarity','description':'Improve\x20the\x20clarity\x20and\x20readability\x20of\x20the\x20text.','isParameterized':!0x1},{'id':'readability','commandId':'readability','title':'Readability','description':'Enhance\x20the\x20overall\x20readability\x20of\x20the\x20text.','isParameterized':!0x1},{'id':'length','commandId':'make','title':'Adjust\x20length','description':'Refine\x20text\x20length\x20to\x20match\x20your\x20needs.','isParameterized':!0x0,'options':[{'formType':'dropdown','label':'Adjust\x20length','default':'longer','data':[{'label':'Longer','id':'longer'},{'label':'Shorter','id':'shorter'}]}]},{'id':'tone','commandId':'make-tone','title':'Adjust\x20tone\x20and\x20style','description':'Choose\x20tone\x20and\x20style\x20to\x20change\x20content\x20as\x20you\x20need.','isParameterized':!0x0,'options':[{'formType':'dropdown','label':'Adjust\x20tone\x20and\x20style','default':'casual','data':[{'label':'Casual','id':'casual'},{'label':'Direct','id':'direct'},{'label':'Friendly','id':'friendly'},{'label':'Confident','id':'confident'},{'label':'Professional','id':'professional'}]}]}];class Ds{['id'];['commandId'];['title'];['description'];['isParameterized'];['useArgs'];['options'];['args'];get['apiId'](){return this['commandId'];}constructor(_0x8586ea){this['id']=_0x8586ea['id'],this['commandId']=_0x8586ea['commandId'],this['title']=_0x8586ea['title'],this['description']=_0x8586ea['description'],this['isParameterized']=_0x8586ea['isParameterized'],this['useArgs']=_0x8586ea['useArgs'],this['options']=_0x8586ea['options'],this['args']=_0x8586ea['args'];}}class po extends ts(){['_checks']=[];['setupChecks'](_0x1237ba){this['_checks']=_0x1237ba['map'](_0x599ca2=>new Ds(_0x599ca2));}get['checks'](){return this['_checks'];}['getCheckById'](_0x57b9c8){return this['checks']['find'](_0x12a742=>_0x12a742['id']===_0x57b9c8);}['removeCheckById'](_0x57b88c){this['_checks']=this['_checks']['filter'](_0x4302c2=>_0x4302c2['id']!==_0x57b88c);}}class ke extends Ds{['_models']=[];['_defaultModel']=null;constructor(_0x46f5d1,_0x4fb78b,_0x3c04cb){super(_0x46f5d1),this['_models']=_0x4fb78b,this['_defaultModel']=_0x3c04cb;}get['models'](){return this['_models'];}get['defaultModel'](){return this['_defaultModel'];}}class Ie extends Ds{['isExtra']=!0x0;['prompt'];['model'];['_defaultModel']=null;constructor(_0x4ffceb,_0x2ad203,_0x29567c){super(_0x4ffceb),this['prompt']=_0x4ffceb['prompt'],this['model']=_0x4ffceb['model'],this['model']?this['_defaultModel']=_0x2ad203['find'](_0xf2be51=>_0xf2be51['id']===this['model'])||null:this['_defaultModel']=_0x29567c;}get['defaultModel'](){return this['_defaultModel'];}}class _e extends po{['_allModels']=[];['_recommendedModels']=[];['_defaultModel']=null;constructor(_0x28173c,_0xcdd2f0,_0x4342d2){super(),this['_allModels']=_0x28173c,this['_recommendedModels']=_0xcdd2f0,this['_defaultModel']=_0x4342d2;}['setupChecks'](_0x56ab64){this['_checks']=_0x56ab64['map'](_0x5a8cd6=>!0x0===_0x5a8cd6['isExtra']?new Ie(_0x5a8cd6,this['_allModels'],this['_defaultModel']):'custom'===_0x5a8cd6['id']?new ke(_0x5a8cd6,this['_recommendedModels'],this['_defaultModel']):new Ds(_0x5a8cd6));}}class Ce extends Js{['_prompt'];['_model'];constructor(_0x304524,_0x594f2d,_0x4b8660,_0x5161b0,_0x56c167){super(_0x4b8660,_0x5161b0,_0x56c167),this['_prompt']=_0x304524,this['_model']=_0x594f2d;}get['subTitle'](){return this['_prompt'];}['_createApiRequest'](){return this['_aiConnector']['callCustomReview']({'content':this['_documentData']['content'],'prompt':this['_prompt'],'model':this['_model']});}['_sendRatingRequest'](_0x224826,_0x1846e1,_0xfb980d){return this['_aiConnector']['upsertCustomAIReviewRating'](_0x1846e1,_0x224826,_0xfb980d);}}class Re extends Ce{get['subTitle'](){return'';}set['prompt'](_0x4d32bf){this['_prompt']=_0x4d32bf;}set['model'](_0x2b1f6f){this['_model']=_0x2b1f6f;}}class pe extends ve{static get['pluginName'](){return'AIReviewModeController';}['_isDiffOn']=!0x1;['_hasDefaultAvailableCommands']=!0x1;constructor(_0x394279){super(_0x394279),this['_hasDefaultAvailableCommands']=!this['context']['config']['get']('ai.review.availableCommands'),this['context']['config']['define']('ai.review.availableCommands',we['map'](_0x46a402=>_0x46a402['id'])),this['context']['config']['define']('ai.review.extraCommands',[]);}async['init'](){await super['init'](),this['listenTo'](this['_aiReviewCoreUi'],'toggleDiff',(_0x798a96,_0x9e7858)=>{this['_isDiffOn']=_0x9e7858['on'],this['_onDiffChange'](this['_isDiffOn']);});}['_initRequiredPlugins'](){super['_initRequiredPlugins'](),this['_aiReviewCoreUi']=this['context']['plugins']['get']('AIReviewModeUI'),this['_aiReviewCoreEditing']=this['context']['plugins']['get']('AIReviewCoreEditing');}['_createReviewCheckRun'](_0x308012,_0x5392d6){return _0x308012['isCustom']?new Ce(_0x308012['args']['prompt'],_0x308012['args']['model'],this['_aiReviewCoreEditing']['getDocumentData'](),_0x5392d6,this['_aiConnector']):_0x5392d6['isExtra']?new Re(_0x5392d6['prompt'],_0x5392d6['defaultModel']['id'],this['_aiReviewCoreEditing']['getDocumentData'](),_0x5392d6,this['_aiConnector']):new si(this['_aiReviewCoreEditing']['getDocumentData'](),_0x5392d6,this['_aiConnector'],_0x308012['params'],_0x308012['args']);}['_onReviewCheckResultActivated'](_0x297926){this['_aiReviewCoreUi']['setActiveStateInResults'](_0x297926['change']['id']),this['_scrollToChange'](_0x297926['change']['id']);const _0x28d761=this['_aiReviewCoreEditing']['getMarkerElementForChange'](_0x297926['change']['id']);if(!_0x28d761)return;const _0xe4199d=this['_aiReviewCoreEditing']['getEditor']();this['_aiReviewCoreUi']['showChangeBalloon'](_0x297926['change'],()=>_0x28d761['getElement'](),void 0x0,'click',_0xe4199d?.['editing']?.['view']?.['getDomRoot'](),_0xe4199d?.['ui']?.['viewportOffset']),this['_aiReviewCoreEditing']['setMarkersInElementAsActive'](_0x297926['change']['id']);}['_onReviewCheckResultDeactivated'](){this['_aiReviewCoreUi']['resetActiveStateInResults'](),this['_aiReviewCoreUi']['hideChangeBalloon'](),this['_aiReviewCoreEditing']['setAllMarkersAsInactive']();}['_onActivateChange'](_0x10603a){this['_currentReviewCheckRun']&&'click'===_0x10603a['uiInteraction']&&(this['_changeActivationSource']='panel',this['_currentReviewCheckRun']['activateChange'](_0x10603a['id']));}['_onDeactivateChange'](_0x271d37){this['_currentReviewCheckRun']&&'balloon'===_0x271d37['origin']&&this['_currentReviewCheckRun']['deactivateChange']();}['_onChangeMarkerClicked'](_0x11e906,_0x441404){if(!this['_currentReviewCheckRun'])return;this['_changeActivationSource']='content',this['_currentReviewCheckRun']['activateChange'](_0x441404['changeId']);const _0x18b226=this['_currentReviewCheckRun']['getChangeById'](_0x441404['changeId']);if(!_0x18b226)return;const _0x59db7f=this['_aiReviewCoreEditing']['getEditor']();this['_aiReviewCoreUi']['showChangeBalloon'](_0x18b226,_0x441404['markerElement'],_0x441404['domEvent'],'click',_0x59db7f?.['editing']?.['view']?.['getDomRoot'](),_0x59db7f?.['ui']?.['viewportOffset']);}['_onChangeMarkerHovered'](_0x8995a0,_0x573a2b){if(!this['_currentReviewCheckRun'])return;if(this['_currentReviewCheckRun']['isAnyChangeActivated']())return;const _0x415bf9=this['_currentReviewCheckRun']['getChangeById'](_0x573a2b['changeId']);if(!_0x415bf9)return;const _0x111326=this['_aiReviewCoreEditing']['getEditor']();this['_aiReviewCoreUi']['showChangeBalloon'](_0x415bf9,_0x573a2b['markerElement'],_0x573a2b['domEvent'],'hover',_0x111326?.['editing']?.['view']?.['getDomRoot'](),_0x111326?.['ui']?.['viewportOffset']);}['_onChangeMarkerBlurred'](){if(!this['_currentReviewCheckRun'])return;this['_currentReviewCheckRun']['isAnyChangeActivated']()||this['_aiReviewCoreUi']['hideChangeBalloon']();}['_getChangeContentElement'](_0x2e018f){const _0x40da54=this['_aiReviewCoreEditing']['getMarkerElementForChange'](_0x2e018f);return _0x40da54?_0x40da54['getElement']():null;}['_markChangePositionInEditorContent'](_0x15eb24,_0x598933){this['_aiReviewCoreEditing']['markChangePositionInEditorContent'](_0x15eb24,_0x598933);}['_diffContent'](_0x3afb1f,_0x4c1b3c){return this['_aiReviewCoreEditing']['diffContent'](_0x3afb1f,_0x4c1b3c);}['_onReviewCheckRun'](){this['_onDiffChange'](this['_isDiffOn']);}['_onDiffChange'](_0x582c29){const _0x4a8196=this['_aiReviewCoreEditing']['getEditor']();_0x582c29?this['_aiReviewCoreUi']['hideDiffInBalloon']():this['_aiReviewCoreUi']['showDiffInBalloon'](),_0x4a8196&&_0x4a8196['editing']['view']['change'](_0x56d74d=>{const _0x4f0131=_0x4a8196['editing']['view']['document']['getRoot']();for(const _0x3aa9f3 of _0x4f0131['getClassNames']())_0x3aa9f3['startsWith']('ck-ai_review-')&&_0x56d74d['removeClass'](_0x3aa9f3,_0x4f0131);_0x56d74d['addClass'](_0x582c29?'ck-ai_review-diff':'ck-ai_review-highlights',_0x4f0131);});}async['_getChecksList'](){const _0x408bf9=[...we,...this['_getExtraChecks']()],_0x2cce87=this['context']['config']['get']('ai.review.availableCommands')||[];this['_logErrorForNonExistentChecks'](_0x2cce87,_0x408bf9);let _0x17335d=_0x408bf9;this['_hasDefaultAvailableCommands']||(_0x17335d=_0x2cce87['map'](_0x5c9c11=>_0x408bf9['find'](_0x10d51a=>_0x10d51a['id']===_0x5c9c11))['filter'](_0x54745f=>!!_0x54745f)),_0x17335d=_0x17335d['map'](_0x312937=>_0x312937['isExtra']?_0x312937:this['_translateReviewCheck'](_0x312937));const _0x3aa875=_0x17335d['some'](_0x156b81=>_0x156b81['isExtra']||'custom'===_0x156b81['id']);let _0x367611=[],_0x2b28b4=[],_0x14be59=null;if(_0x3aa875){const _0x11c6b8=await this['_getModels']();_0x367611=_0x11c6b8['all'],_0x2b28b4=_0x11c6b8['recommended'],_0x14be59=_0x11c6b8['default'];}const _0x19067e=new _e(_0x367611,_0x2b28b4,_0x14be59);return _0x19067e['setupChecks'](_0x17335d),_0x3aa875&&this['_filterChecksWithMissingModel'](_0x19067e),_0x19067e;}['_getExtraChecks'](){return(this['context']['config']['get']('ai.review.extraCommands')||[])['map'](_0x41805e=>({'id':_0x41805e['id'],'commandId':_0x41805e['id'],'title':_0x41805e['label'],'description':_0x41805e['description'],'isParameterized':!0x1,'isExtra':!0x0,'prompt':_0x41805e['prompt'],'model':_0x41805e['model']}));}['_logErrorForNonExistentChecks'](_0x3c8f6b,_0x565814){const _0x4ed4fb=_0x3c8f6b['filter'](_0x309d40=>!_0x565814['some'](_0x39143b=>_0x39143b['id']===_0x309d40));_0x4ed4fb['length']&&this['_logError'](new _0x563e6a('ai-review-mode-non-existent-commands-used',this,{'commandIds':_0x4ed4fb['join'](',\x20')}),!0x0);}async['_getModels'](){try{const _0x3ff680=new et({'connector':this['_aiConnector'],'config':this['context']['config']['get']('ai.models'),'locale':this['context']['locale']});return{'all':await _0x3ff680['getAll'](),'recommended':await _0x3ff680['getAvailableModels'](),'default':await _0x3ff680['getDefault']()};}catch(_0x5c516c){return this['_logError'](new _0x563e6a('ai-review-mode-models-unable-to-retrieve',this,void 0x0,_0x5c516c)),{'all':[],'recommended':[],'default':null};}}['_translateReviewCheck'](_0x2a8d10){const _0x339ce0='AI_REVIEW_CHECK_'+_0x2a8d10['id']['toUpperCase']()['replaceAll']('-','_'),_0x103f43={..._0x2a8d10,'title':this['_getTranslationWithDefault'](_0x339ce0+'_TITLE',_0x2a8d10['title']),'description':this['_getTranslationWithDefault'](_0x339ce0+'_DESCRIPTION',_0x2a8d10['description'])};return _0x2a8d10['options']&&(_0x103f43['options']=_0x2a8d10['options']['map'](_0xccf7c7=>({..._0xccf7c7,'label':this['_getTranslationWithDefault'](_0x339ce0+'_OPTIONS_LABEL',_0xccf7c7['label']||''),'data':_0xccf7c7['data']?_0xccf7c7['data']['map'](_0x446e19=>({..._0x446e19,'label':this['_getTranslationWithDefault'](_0x339ce0+'_OPTIONS_DATA_'+_0x446e19['id']['toUpperCase'](),_0x446e19['label'])})):void 0x0}))),_0x103f43;}['_filterChecksWithMissingModel'](_0x2b91d0){const _0x4f05ee=[];_0x2b91d0['checks']['forEach'](_0x152905=>{(_0x152905 instanceof Ie&&!_0x152905['defaultModel']||_0x152905 instanceof ke&&!_0x152905['models']['length'])&&_0x4f05ee['push'](_0x152905['id']);}),_0x4f05ee['length']&&_0x4f05ee['forEach'](_0x4e8685=>{_0x2b91d0['removeCheckById'](_0x4e8685),this['_logError'](new _0x563e6a('ai-review-mode-command-unavailable-due-to-missing-model',this,{'commandId':_0x4e8685}),!0x0);});}}class AIReviewMode extends _0x3a5602{static get['requires'](){return[pe,ge,de];}static get['pluginName'](){return'AIReviewMode';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class jr extends Ds{get['apiId'](){return'translate';}}class Pe extends po{['setupChecks'](_0x159e82){this['_checks']=_0x159e82['map'](_0x5670e=>new jr(_0x5670e));}}class Se extends si{['_title'];constructor(_0x55e1e5,_0x554016,_0x36e9b7,_0x3a9394,_0x577479,_0x44ef87){super(_0x55e1e5,_0x554016,_0x36e9b7,_0x577479,_0x44ef87),this['_title']=_0x3a9394;}get['title'](){return this['_title'];}get['subTitle'](){return this['_sourceCheck']['title'];}}class rr extends ve{static get['pluginName'](){return'AITranslateController';}constructor(_0x42083e){super(_0x42083e),this['context']['config']['define']('ai.translate.languages',[{'label':'English','id':'english'},{'label':'Spanish','id':'spanish'},{'label':'French','id':'french'},{'label':'German','id':'german'},{'label':'Chinese\x20(Simplified)','id':'chinese'},{'label':'Japanese','id':'japanese'},{'label':'Russian','id':'russian'},{'label':'Portuguese','id':'portuguese'},{'label':'Korean','id':'korean'},{'label':'Italian','id':'italian'}]);}['_onCheckRunFinished'](){this['_onReviewRunLeave'](!0x0);}['_initRequiredPlugins'](){super['_initRequiredPlugins'](),this['_aiReviewCoreUi']=this['context']['plugins']['get']('AITranslateUI'),this['_aiReviewCoreEditing']=this['context']['plugins']['get']('AIReviewCoreEditing');}['_createReviewCheckRun'](_0x282308,_0x3b3f05){return new Se(this['_aiReviewCoreEditing']['getDocumentData'](),_0x3b3f05,this['_aiConnector'],i(this['context']['locale'],'AI_REVIEW_CHECK_TRANSLATE_TITLE'),_0x282308['params'],_0x282308['args']);}['_onReviewCheckResultActivated'](_0xb5bb5f){this['_aiReviewCoreUi']['setActiveStateInResults'](_0xb5bb5f['change']['id']),this['_aiReviewCoreEditing']['setMarkersInElementAsActive'](_0xb5bb5f['change']['id']);}['_onReviewCheckResultDeactivated'](){this['_aiReviewCoreEditing']['setAllMarkersAsInactive'](),this['_aiReviewCoreUi']['resetActiveStateInResults']();}['_onActivateChange'](_0x3dbffe){this['_currentReviewCheckRun']&&('hover'===_0x3dbffe['uiInteraction']&&(this['_changeActivationSource']='panel',this['_currentReviewCheckRun']['activateChange'](_0x3dbffe['id'])),'click'===_0x3dbffe['uiInteraction']&&this['_scrollToChange'](_0x3dbffe['id']));}['_onDeactivateChange'](_0x4d2c21){this['_currentReviewCheckRun']&&'panel'===_0x4d2c21['origin']&&this['_currentReviewCheckRun']['deactivateChange']();}['_onChangeMarkerClicked'](_0x190d74,_0x1fe837){this['_currentReviewCheckRun']&&(this['_changeActivationSource']='content',this['_currentReviewCheckRun']['activateChange'](_0x1fe837['changeId']),this['_scrollToChange'](_0x1fe837['changeId']));}['_onChangeMarkerHovered'](_0xbb9df,_0x3ec9f1){this['_currentReviewCheckRun']&&(this['_changeActivationSource']='content',this['_currentReviewCheckRun']['activateChange'](_0x3ec9f1['changeId']),this['_aiReviewCoreEditing']['reactivateMarkers'](_0x3ec9f1['changeId']));}['_onChangeMarkerBlurred'](){this['_currentReviewCheckRun']&&'content'===this['_changeActivationSource']&&(this['_currentReviewCheckRun']['deactivateChange'](),this['_aiReviewCoreEditing']['setAllMarkersAsInactive']());}['_getChangeContentElement'](_0x51934b){return this['_aiReviewCoreEditing']['getContentElementForChange'](_0x51934b);}['_markChangePositionInEditorContent'](_0x3d5ecd,_0x9bab64){this['_aiReviewCoreEditing']['markChangePositionInEditorContent'](_0x3d5ecd,_0x9bab64);}['_diffContent'](_0x5bfa4d,_0x3aec26){return this['_aiReviewCoreEditing']['diffContent'](_0x5bfa4d,_0x3aec26,!0x0);}['_onReviewCheckRun'](){const _0x148417=this['_aiReviewCoreEditing']['getEditor']();_0x148417&&_0x148417['editing']['view']['change'](_0xe4b745=>{const _0x3727f2=_0x148417['editing']['view']['document']['getRoot']();for(const _0x5152cb of _0x3727f2['getClassNames']())(_0x5152cb['startsWith']('ck-ai-review-')||'ck-ai-translate-'===_0x5152cb)&&_0xe4b745['removeClass'](_0x5152cb,_0x3727f2);_0xe4b745['addClass']('ck-ai-translate-mode-content',_0x3727f2);});}async['_getChecksList'](){const _0x5a860b=[],_0x10c653=this['context']['config']['get']('ai.translate.languages')||[];for(const _0x2be335 of _0x10c653)_0x5a860b['push']({'title':_0x2be335['label'],'id':_0x2be335['id'],'commandId':_0x2be335['id'],'description':'','isParameterized':!0x1,'useArgs':!0x0,'args':{'language':_0x2be335['id']}});const _0x2b6874=new Pe();return _0x2b6874['setupChecks'](this['_translateChecks'](_0x5a860b)),_0x2b6874;}['_translateChecks'](_0x3a8ea3){return _0x3a8ea3['map'](_0x383d03=>{const _0x70679e='AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_'+_0x383d03['title']['toUpperCase']()['replaceAll']('-','_');return{..._0x383d03,'title':this['_getTranslationWithDefault'](_0x70679e,_0x383d03['title'])};});}}class Le extends Ve{constructor(_0x296769,_0x290d92){super(_0x296769,_0x290d92),this['on']('set:isLoading',(_0x5baaa5,_0x13c0f7,_0x27dcc7)=>{_0x27dcc7&&(this['headerTitle']=i(this['locale'],'AI_TRANSLATE_CHECK_RESULTS_LOADING_TITLE'));}),this['on']('set:isResultReady',(_0x2e4c25,_0x3fb283,_0x243509)=>{_0x243509&&(this['headerTitle']=i(this['locale'],'AI_TRANSLATE_CHECK_RESULTS_READY_TITLE'));});}['_createAcceptAllButtonView'](){const _0x12b61c=super['_createAcceptAllButtonView']();return _0x12b61c['set']('label',i(this['locale'],'AI_TRANSLATE_ACCEPT_ALL')),_0x12b61c;}['_createExitReviewButtonView'](){const _0x5baa50=super['_createExitReviewButtonView']();return _0x5baa50['set']('label',i(this['locale'],'AI_CHAT_HISTORY_CANCEL')),_0x5baa50;}}class Ne extends je{['_setupTemplate'](){const _0x347623=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-translate__check-list-wrapper',_0x347623['if']('isVisible','ck-hidden',_0x1bec6f=>!_0x1bec6f)]},'children':[{'tag':'div','attributes':{'class':['ck-ai-translate__check-list-header']},'children':[{'tag':'h2','children':[{'text':i(this['locale'],'AI_TRANSLATE_CHECK_LIST_HEADER_TITLE')}]},{'tag':'p','children':[{'text':i(this['locale'],'AI_TRANSLATE_CHECK_LIST_HEADER_DESCRIPTION')}]}]},{'tag':'div','attributes':{'class':['ck-ai_review__check-list',_0x347623['if']('isVisible','ck-hidden',_0x4651bf=>!_0x4651bf)]},'children':this['_checkViews']}]});}}class tr extends Me{static get['pluginName'](){return'AITranslateUI';}['createMainView'](){const _0x213c13=this['context']['locale'],_0x55bb7d=new _0x1e299f(_0x213c13,{'label':i(_0x213c13,'AI_REVIEW_CHECK_TRANSLATE_TITLE'),'icon':_0x20e0a0,'class':'ck-ai-header\x20ck-ai-header_review-translate'}),_0x3ea4af=new Ae(_0x213c13,{'header':_0x55bb7d,'list':new Ne(_0x213c13),'results':new Le(_0x213c13,{'generalErrorText':i(_0x213c13,'AI_TRANSLATE_GENERAL_ERROR_MESSAGE')}),'completed':new be(_0x213c13,{'headerText':i(_0x213c13,'AI_TRANSLATE_FINISH_HEADER_TITLE'),'emptyResultsText':i(_0x213c13,'AI_TRANSLATE_EMPTY_RESULTS_TEXT'),'buttonText':i(_0x213c13,'AI_TRANSLATE_FINISH_BUTTON_LABEL')})});return _0x3ea4af['extendTemplate']({'attributes':{'class':'ck-ai-translate-mode'}}),_0x3ea4af;}['registerTab'](){const _0x268913=this['context']['plugins']['get']('AITabs');_0x268913['view']['on']('activateTab',(_0x5dc725,_0x5de284)=>{'translate'===_0x5de284?this['fire']('getReviewCheckList'):this['fire']('leaveReview');}),_0x268913['view']['addTab']({'id':'translate','buttonLabel':i(this['context']['locale'],'AI_REVIEW_CHECK_TRANSLATE_TITLE'),'buttonIcon':_0x20e0a0,'order':0x0,'content':this['_mainView']});}}class AITranslate extends _0x3a5602{static get['requires'](){return[rr,tr,de];}static get['pluginName'](){return'AITranslate';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}export{ri as AIActions,K as AIAdapter,AIAssistant,n as AIAssistantUI,H as AIBalloon,AIChat,q as AIChatController,G as AIChatHistory,jt as AIChatHistoryController,xt as AIChatHistoryUI,AIChatShortcuts,z as AIChatUI,tt as AIConnector,D as AIEditing,AIEditorIntegration,Qt as AIQuickActionType,AIQuickActions,ii as AIQuickActionsUI,er as AIRequestError,Ds as AIReviewCheck,Ms as AIReviewCheckResult,Js as AIReviewCheckRun,AIReviewMode,ve as AIReviewModeController,de as AIReviewModeEditing,ge as AIReviewModeUI,it as AITabs,ar as AITextAdapter,Pt as AIToggleButtonUI,AITranslate,rr as AITranslateController,tr as AITranslateUI,AWSTextAdapter,OpenAITextAdapter,E as ShowAIAssistantCommand,io as ToggleAICommand,us as createResizeButton,Wn as getDefaultAICommands};
|
|
23
|
+
import{Plugin as _0x2b80c4,Command as Lt,ContextPlugin as _0x3b66f2,Editor as dt}from'@ckeditor/ckeditor5-core/dist/index.js';import{IconCopy as _0x1563af,IconCheck as _0x42c617,IconError as _0x21c5dc,IconSubmit as _0x470f9c,IconAIHistory as Nt,IconMagicWand as _0x4525b7,IconRobotPencil as _0x13a90c,IconMaximize as _0x435d1e,IconMinimize as _0x194a62,IconShowChangesOn as _0x206735,IconShowChangesOff as _0x256676,IconDocument as _0x2f76a7,IconBoxWithCross as _0x5a6b5c,IconBoxWithCheck as _0x297052,IconBoxWithMarker as _0x3bd052,IconInfo as _0x1eb394,IconLoupe as _0x30e34c,IconCancel as _0x3cff34,IconStop as _0x8718cf,IconAIChat as vt,IconPlus as _0x56e5bc,IconPin as _0x4cf526,IconThreeHorizontalDots as _0x510a1e,IconChevronDown as _0x4d05c9,IconChevronUp as _0x520810,IconOutdated as _0x43b82b,IconEye as _0x1cbbeb,IconEyeCrossedOut as _0xa9cc50,IconChevronRight as _0x3e5c1f,IconAIReview as _0x4bbb25,IconAITranslate as _0x458a75}from'@ckeditor/ckeditor5-icons/dist/index.js';import{uid as _0x56075e,CKEditorError as _0x2ae61f,ObservableMixin as ts,global as _0x18348f,isVisible as _0x215009,Rect as _0x4fa19a,Collection as _0x285958,FocusTracker as _0x5675ac,KeystrokeHandler as _0x51df97,first as _0x382588,logWarning as _0x4bc23b,logError as gt,toArray as _0x34cea5,EmitterMixin as _0x428ca4,scrollViewportToShowTarget as _0x3a4ed0,scrollAncestorsToShowTarget as _0x3daeed,ResizeObserver as _0x129579,_isMotionReduced as Rt,getConstrainedViewportRect as _0xf2e492,DomEmitterMixin as _0x5d778d}from'@ckeditor/ckeditor5-utils/dist/index.js';import{ToolbarView as _0x5be165,ButtonView as _0x4421de,View as _0x3ddefc,SpinnerView as _0x52a320,IconView as _0x2fc344,AutocompleteView as _0x49b978,ListView as _0x4bb2ce,ListItemGroupView as _0x59d248,ListItemView as _0x23b8c1,ButtonLabelView as _0x481114,FocusCycler as _0x125535,createLabeledTextarea as _0x4f1919,Dialog as _0x5ef991,createDropdown as _0x336a05,addMenuToDropdown as _0xe16080,MenuBarMenuView as _0x18d714,MenuBarMenuListItemButtonView as _0x2a3f0d,DialogViewPosition as _0x5b2f5d,MenuBarMenuListView as _0x582101,MenuBarMenuListItemView as _0x3da97b,BodyCollection as _0x6c121d,BalloonPanelView as _0x435ccf,clickOutsideHandler as _0xa9d580,addListToDropdown as _0x590b3b,UIModel as _0xc76b09,submitHandler as _0x4d7d6f,LabeledFieldView as _0x7014be,createLabeledInputText as th,FormHeaderView as _0xa16c5,HighlightedTextView as _0x5bd3a5,ViewCollection as _0xdb22e9,FileDialogButtonView as _0x6117a4,InputTextView as _0x38b367,SearchTextView as _0x4b2da7,ListItemButtonView as _0x570448,ButtonLabelWithHighlightView as _0x5c72a5,DropdownMenuPanelPositioningFunctions as _0x3939df,BalloonToolbar as te,FormRowView as _0x5da68c,TextareaView as _0x3d7aa3}from'@ckeditor/ckeditor5-ui/dist/index.js';import{ClipboardPipeline as _0x26e9f0,ClipboardMarkersUtils as _0x430d97}from'@ckeditor/ckeditor5-clipboard/dist/index.js';import{ViewDocumentDomEventData as _0x3e1b6b,ViewDataTransfer as _0x4ecc50,ViewUpcastWriter as _0x234ee8,Matcher as _0x5dee2b,_DetachOperation as et,_insertIntoModelNodeList as _0x2d6e6c,_removeFromModelNodeList as to,ModelRange as it,transformOperationSets as nt,ViewDowncastWriter as Dt,ModelDocumentFragment as tt,ModelPosition as st,ModelTreeWalker as _0x2ab43c,MarkerOperation as _0x37f637,InsertOperation as _0x598ec8}from'@ckeditor/ckeditor5-engine/dist/index.js';import{unescape as _0x173d15,escape as _0x2fa641,escapeRegExp as _0x518f64,debounce as _0x1d2bab}from'es-toolkit/compat';import{createParser as $t}from'eventsource-parser';import{parseDocument as _0x533d50}from'htmlparser2';import{isTag as _0x239cab,findOne as yt,getParent as _0x65a7ae,findAll as _0x30053d,removeElement as _0x3c7927,replaceElement as _0xd8ffa2,prepend as _0xb261c2,prependChild as _0x1317c8,appendChild as _0x3ba989,append as _0x2d333e,find as _0x4183c0,isComment as _0x10543b,getChildren as _0x9c3c,textContent as _0x29622c}from'domutils';import _0xb61cdf from'dom-serializer';import{Document as Et,Element as _0x44dddb,Text as _0x389e0a,cloneNode as _0x125b95,isDocument as _0x75aa83,isText as _0x1d859a,NodeWithChildren as _0x4fe0b3}from'domhandler';import{MarkdownGfmMdToHtml as _0x469116}from'@ckeditor/ckeditor5-markdown-gfm/dist/index.js';import{fixElementSuggestionRange as _0x257910,DocumentCompare as _0x5b4177,DATA_ID_MODEL_ATTRIBUTE as Ct,ConfirmMixin as _0xac3e4d,LateFocusDropdownButtonView as _0x52ce4c,getAllMarkersDomElementsSorted as _0x2e47e4,SuggestionsConversion as zt,DATA_ID_VIEW_ATTRIBUTE as _0x26fea3,getMarkerDomElement as _0x1e1130}from'ckeditor5-collaboration/dist/index.js';import{cloneDeep as _0x2e8fe2}from'es-toolkit';import _0x2c83f5 from'morphdom';import{IconWeb as _0x103426,IconClose as _0x598c1b,IconDocument as _0x13ab44,IconSelection as _0x31b18a,IconFileUpload as _0x5f22ac,IconLink as _0x4aa87f,IconBulb as _0x5a3f04,IconAI as _0x591aa5,IconPreviousArrow as _0x135ef3,IconCheck as _0x4b7da9,IconDocumentOutline as _0x4dcc38,IconPaperClip as _0xb91038,IconBrowseFiles as _0x1db179,IconDropdownArrow as _0x5e0145,IconAIChat as _0x32ec39,IconAIReview as _0x58872b,IconAITranslate as Vt,IconAIAskAI as _0x5f5820,IconThumbUp as _0xd3e5b2,IconThumbDown as _0x5e1792,IconCopy as _0x254446,IconShowChangesOff as _0x7022a4,IconShowChangesOn as _0x46b010,IconAIQuickActions as _0x291361,IconAIChatCommands as Gt,IconAIImproveWriting as Bt,IconAIContinueWriting as Ft,IconAIGrammarCheck as Wt,IconAIAdjustLength as Kt,IconAIChangeTone as Yt,IconAIOther as Jt,IconRefresh as _0xe187e6,IconNextArrow as _0x43eeb7}from'@ckeditor/ckeditor5-icons/dist/index.js';import{diffArrays as _0x1f7ab4}from'diff';const x='_ungrouppedCommands';function o(_0x16e5eb,_0x59216e){const _0x3f0497=(0x0,_0x59216e['t'])('Other');return _0x16e5eb['length']?'groupId'in _0x16e5eb[0x0]?_0x16e5eb:[{'groupId':x,'groupLabel':_0x3f0497,'order':0x1/0x0,'commands':_0x16e5eb}]:[{'groupId':x,'groupLabel':_0x3f0497,'order':0x1/0x0,'commands':[]}];}const Gn=globalThis['DataTransfer'],f='ai-ui';class a extends _0x2b80c4{static get['pluginName'](){return'AIAssistantEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const {editor:_0x800de6}=this,_0x12441d=['ck-fake-ai-selection'];_0x800de6['config']['get']('ai.assistant.useTheme')&&_0x12441d['push']('ck-ai-assistant-ui_theme'),_0x800de6['conversion']['for']('editingDowncast')['markerToHighlight']({'model':f,'view':{'classes':_0x12441d,'priority':0xc}}),_0x800de6['conversion']['for']('editingDowncast')['markerToElement']({'model':f,'view':(_0x2313c2,{writer:_0x527b96})=>{if(!_0x2313c2['markerRange']['isCollapsed'])return null;const _0x3b73ac=_0x527b96['createUIElement']('span');return _0x527b96['addClass'](['ck-fake-ai-selection','ck-fake-ai-selection_collapsed'],_0x3b73ac),_0x3b73ac;}});}['afterInit'](){!async function(_0x4a967c){const _0x15046d=_0x1be7af([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]),_0x3de0bb=0x3dffc4e1,_0x19b593=0x3df84b21^_0x3de0bb,_0x3b8bd6=window[_0x1be7af([0x44,0x61,0x74,0x65])][_0x1be7af([0x6e,0x6f,0x77])](),_0x3050d9=_0x4a967c[_0x1be7af([0x65,0x64,0x69,0x74,0x6f,0x72])],_0x238d44=new window[(_0x1be7af([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x201ce6=>{_0x3050d9[_0x1be7af([0x6f,0x6e,0x63,0x65])](_0x1be7af([0x72,0x65,0x61,0x64,0x79]),_0x201ce6);}),_0x3faae7={[_0x1be7af([0x6b,0x74,0x79])]:_0x1be7af([0x45,0x43]),[_0x1be7af([0x75,0x73,0x65])]:_0x1be7af([0x73,0x69,0x67]),[_0x1be7af([0x63,0x72,0x76])]:_0x1be7af([0x50,0x2d,0x32,0x35,0x36]),[_0x1be7af([0x78])]:_0x1be7af([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]),[_0x1be7af([0x79])]:_0x1be7af([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]),[_0x1be7af([0x61,0x6c,0x67])]:_0x1be7af([0x45,0x53,0x32,0x35,0x36])},_0x1b3f84=_0x3050d9[_0x1be7af([0x63,0x6f,0x6e,0x66,0x69,0x67])][_0x1be7af([0x67,0x65,0x74])](_0x1be7af([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79]));async function _0x1c3899(){let _0x57b1bf,_0x484509=null,_0x3fc644=null;try{if(_0x1b3f84==_0x1be7af([0x47,0x50,0x4c]))return _0x1be7af([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]);if(_0x57b1bf=_0x38e62c(),!_0x57b1bf)return _0x1be7af([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);return _0x57b1bf[_0x1be7af([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])]&&(_0x3fc644=_0xf4abd(_0x57b1bf[_0x1be7af([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])],_0x57b1bf[_0x1be7af([0x6a,0x74,0x69])])),await _0xd1a393()?_0x52e7ee()?_0x3968ca()?_0x1be7af([0x45,0x78,0x70,0x69,0x72,0x65,0x64]):_0x21aaf8()?(_0x57b1bf[_0x1be7af([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x1be7af([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e])&&(_0x484509=_0x4c639f(_0x1be7af([0x45,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e,0x4c,0x69,0x6d,0x69,0x74]))),await _0x486588()):_0x1be7af([0x44,0x6f,0x6d,0x61,0x69,0x6e,0x4c,0x69,0x6d,0x69,0x74]):_0x1be7af([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]):_0x1be7af([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}catch{return _0x1be7af([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}function _0x3968ca(){const _0x53de08=[_0x1be7af([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e]),_0x1be7af([0x74,0x72,0x69,0x61,0x6c])][_0x1be7af([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x57b1bf[_0x1be7af([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])])?_0x3b8bd6/0x3e8:0xe10*_0x19b593;return _0x57b1bf[_0x1be7af([0x65,0x78,0x70])]<_0x53de08;}function _0x52e7ee(){const _0x119c6d=_0x57b1bf[_0x1be7af([0x66,0x65,0x61,0x74,0x75,0x72,0x65,0x73])];return!!_0x119c6d&&(!!_0x119c6d[_0x1be7af([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x1be7af([0x2a]))||!!_0x119c6d[_0x1be7af([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x1be7af([0x41,0x49])));}function _0x21aaf8(){const _0x440e2b=_0x57b1bf[_0x1be7af([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x64,0x48,0x6f,0x73,0x74,0x73])];if(!_0x440e2b||0x0==_0x440e2b[_0x1be7af([0x6c,0x65,0x6e,0x67,0x74,0x68])])return!0x0;const {hostname:_0x92ccc1}=new URL(window[_0x1be7af([0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e])]['href']);if(_0x440e2b[_0x1be7af([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x92ccc1))return!0x0;const _0x2e4930=_0x92ccc1[_0x1be7af([0x73,0x70,0x6c,0x69,0x74])](_0x1be7af([0x2e]));return _0x440e2b[_0x1be7af([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x219bdc=>_0x219bdc[_0x1be7af([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x1be7af([0x2a])))[_0x1be7af([0x6d,0x61,0x70])](_0x59f1f5=>_0x59f1f5[_0x1be7af([0x73,0x70,0x6c,0x69,0x74])](_0x1be7af([0x2e])))[_0x1be7af([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x595f4a=>_0x595f4a[_0x1be7af([0x6c,0x65,0x6e,0x67,0x74,0x68])]<=_0x2e4930[_0x1be7af([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0x1be7af([0x6d,0x61,0x70])](_0xd0d157=>Array(_0x2e4930[_0x1be7af([0x6c,0x65,0x6e,0x67,0x74,0x68])]-_0xd0d157[_0x1be7af([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0x1be7af([0x66,0x69,0x6c,0x6c])](_0xd0d157[0x0]===_0x1be7af([0x2a])?_0x1be7af([0x2a]):'')[_0x1be7af([0x63,0x6f,0x6e,0x63,0x61,0x74])](_0xd0d157))[_0x1be7af([0x73,0x6f,0x6d,0x65])](_0x238172=>_0x2e4930[_0x1be7af([0x65,0x76,0x65,0x72,0x79])]((_0xf28c1e,_0x249e3a)=>_0x238172[_0x249e3a]===_0xf28c1e||_0x238172[_0x249e3a]===_0x1be7af([0x2a])));}function _0x486588(){return _0x484509&&_0x3fc644?new window[(_0x1be7af([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x4f6c5c,_0x162fc1)=>{_0x484509[_0x1be7af([0x74,0x68,0x65,0x6e])](_0x4f6c5c,_0x162fc1),_0x3fc644[_0x1be7af([0x74,0x68,0x65,0x6e])](_0x547fbd=>{_0x547fbd!=_0x1be7af([0x56,0x61,0x6c,0x69,0x64])&&_0x4f6c5c(_0x547fbd);},_0x162fc1);}):_0x484509||_0x3fc644||_0x1be7af([0x56,0x61,0x6c,0x69,0x64]);}}function _0xf4abd(_0x1f4ed3,_0x3644ec){return new window[(_0x1be7af([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x2eae89=>{if(_0x26d5da())return _0x2eae89(_0x1be7af([0x56,0x61,0x6c,0x69,0x64]));_0x35b846(),_0x3050d9[_0x1be7af([0x64,0x65,0x63,0x6f,0x72,0x61,0x74,0x65])](_0x1be7af([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]));let _0x2a46ca=!0x1;const _0x9f7e5=_0x56075e();function _0x30067c(_0x32945b){return!!_0x32945b&&(typeof _0x32945b===_0x1be7af([0x6f,0x62,0x6a,0x65,0x63,0x74])||typeof _0x32945b===_0x1be7af([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]))&&typeof _0x32945b[_0x1be7af([0x74,0x68,0x65,0x6e])]===_0x1be7af([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e])&&typeof _0x32945b[_0x1be7af([0x63,0x61,0x74,0x63,0x68])]===_0x1be7af([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]);}function _0x22cc7b(_0x1841e5){_0xf487b(_0x1841e5)[_0x1be7af([0x74,0x68,0x65,0x6e])](_0xf9c7c2=>{if(!_0xf9c7c2||_0xf9c7c2[_0x1be7af([0x73,0x74,0x61,0x74,0x75,0x73])]!=_0x1be7af([0x6f,0x6b]))return _0x1be7af([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]);return _0x59efe7(_0x31cfd1(_0x9f7e5+_0x3644ec))!=_0xf9c7c2[_0x1be7af([0x76,0x65,0x72,0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6f,0x6e])]?_0x1be7af([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]):_0x1be7af([0x56,0x61,0x6c,0x69,0x64]);})[_0x1be7af([0x74,0x68,0x65,0x6e])](_0x1d3dbd=>(_0x53727c(),_0x1d3dbd),()=>{const _0x309516=_0x57cca2();return null==_0x309516?(_0x53727c(),_0x1be7af([0x56,0x61,0x6c,0x69,0x64])):_0x1be7af(_0x3b8bd6-_0x309516>(0x19f340e1^_0x3de0bb)?[0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]:[0x56,0x61,0x6c,0x69,0x64]);})[_0x1be7af([0x74,0x68,0x65,0x6e])](_0x2eae89)[_0x1be7af([0x63,0x61,0x74,0x63,0x68])](()=>{_0x2eae89(_0x1be7af([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});const _0x5ba827=0x3dc92a61^_0x3de0bb;function _0x53727c(){const _0x27aa8a=_0x1be7af([0x6c,0x6c,0x63,0x74,0x2d])+_0x59efe7(_0x31cfd1(_0x1f4ed3)),_0x574250=_0xcfaf54(_0x59efe7(window[_0x1be7af([0x4d,0x61,0x74,0x68])][_0x1be7af([0x63,0x65,0x69,0x6c])](_0x3b8bd6/_0x5ba827)));window[_0x1be7af([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x1be7af([0x73,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x27aa8a,_0x574250);}function _0x57cca2(){const _0x549c18=_0x1be7af([0x6c,0x6c,0x63,0x74,0x2d])+_0x59efe7(_0x31cfd1(_0x1f4ed3)),_0x755441=window[_0x1be7af([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x1be7af([0x67,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x549c18);return _0x755441?window[_0x1be7af([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0xcfaf54(_0x755441),0x10)*_0x5ba827:null;}function _0xf487b(_0x1b04c5){return new window[(_0x1be7af([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x52694c,_0x1356d1)=>{_0x1b04c5[_0x1be7af([0x74,0x68,0x65,0x6e])](_0x52694c,_0x1356d1),window[_0x1be7af([0x73,0x65,0x74,0x54,0x69,0x6d,0x65,0x6f,0x75,0x74])](_0x1356d1,0x3dfe1021^_0x3de0bb);});}}_0x3050d9[_0x1be7af([0x6f,0x6e])](_0x1be7af([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),(_0x37d725,_0x3835a8)=>{if(_0x3835a8[0x0]!=_0x1f4ed3)return _0x2eae89(_0x1be7af([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));_0x3835a8[0x1]={..._0x3835a8[0x1],[_0x1be7af([0x72,0x65,0x71,0x75,0x65,0x73,0x74,0x49,0x64])]:_0x9f7e5};},{[_0x1be7af([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x1be7af([0x68,0x69,0x67,0x68])}),_0x3050d9[_0x1be7af([0x6f,0x6e])](_0x1be7af([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),_0x2327bb=>{_0x30067c(_0x2327bb[_0x1be7af([0x72,0x65,0x74,0x75,0x72,0x6e])])&&(_0x2a46ca=!0x0,_0x22cc7b(_0x2327bb[_0x1be7af([0x72,0x65,0x74,0x75,0x72,0x6e])]));},{[_0x1be7af([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x1be7af([0x6c,0x6f,0x77])}),_0x238d44[_0x1be7af([0x74,0x68,0x65,0x6e])](()=>{_0x2a46ca||_0x2eae89(_0x1be7af([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});});function _0x26d5da(){return _0x3050d9[_0x1be7af([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x1be7af([0x76,0x69,0x65,0x77])][_0x1be7af([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]==_0x1be7af([0x61,0x75,0x74,0x6f]);}function _0x35b846(){_0x3050d9[_0x1be7af([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x1be7af([0x76,0x69,0x65,0x77])][_0x1be7af([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]=_0x1be7af([0x61,0x75,0x74,0x6f]);}}function _0x4c639f(_0x14a542){const _0x1f0cce=[new window[(_0x1be7af([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x619978=>setTimeout(_0x619978,0x3df6fa2d^_0x3de0bb)),_0x238d44[_0x1be7af([0x74,0x68,0x65,0x6e])](()=>new window[(_0x1be7af([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x3be0ca=>{let _0x446949=0x0;_0x3050d9[_0x1be7af([0x6d,0x6f,0x64,0x65,0x6c])][_0x1be7af([0x6f,0x6e])](_0x1be7af([0x61,0x70,0x70,0x6c,0x79,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e]),(_0x3cdd55,_0x16761b)=>{_0x16761b[0x0][_0x1be7af([0x69,0x73,0x44,0x6f,0x63,0x75,0x6d,0x65,0x6e,0x74,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e])]&&_0x446949++,_0x446949==(0x3dffc109^_0x3de0bb)&&(_0x3be0ca(),_0x3cdd55[_0x1be7af([0x6f,0x66,0x66])]());});}))];return window[_0x1be7af([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65])][_0x1be7af([0x72,0x61,0x63,0x65])](_0x1f0cce)[_0x1be7af([0x74,0x68,0x65,0x6e])](()=>_0x14a542);}async function _0x36f82e(){await _0x238d44,_0x3050d9[_0x1be7af([0x6d,0x6f,0x64,0x65,0x6c])][_0x1be7af([0x63,0x68,0x61,0x6e,0x67,0x65])]=_0x120b24,_0x3050d9[_0x1be7af([0x6d,0x6f,0x64,0x65,0x6c])][_0x1be7af([0x65,0x6e,0x71,0x75,0x65,0x75,0x65,0x43,0x68,0x61,0x6e,0x67,0x65])]=_0x120b24,_0x3050d9[_0x1be7af([0x65,0x6e,0x61,0x62,0x6c,0x65,0x52,0x65,0x61,0x64,0x4f,0x6e,0x6c,0x79,0x4d,0x6f,0x64,0x65])](_0x1be7af([0x6d,0x6f,0x64,0x65,0x6c]));}function _0x4c4f75(_0x54eb1a){const _0x316df5=_0x47ea87();_0x3050d9[_0x316df5]=_0x1be7af([0x61,0x69,0x4c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79])+_0x54eb1a,_0x54eb1a!=_0x1be7af([0x56,0x61,0x6c,0x69,0x64])&&_0x36f82e();}function _0x47ea87(){const _0x570848=window[_0x1be7af([0x53,0x74,0x72,0x69,0x6e,0x67])](window[_0x1be7af([0x70,0x65,0x72,0x66,0x6f,0x72,0x6d,0x61,0x6e,0x63,0x65])][_0x1be7af([0x6e,0x6f,0x77])]())[_0x1be7af([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](_0x1be7af([0x2e]),'');let _0x1573b9=_0x1be7af([0x6e]);for(let _0x18e4e1=0x0;_0x18e4e1<_0x570848[_0x1be7af([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x18e4e1+=0x2){let _0x211745=window[_0x1be7af([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x570848[_0x1be7af([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x18e4e1,_0x18e4e1+0x2));_0x211745>=_0x15046d[_0x1be7af([0x6c,0x65,0x6e,0x67,0x74,0x68])]&&(_0x211745-=_0x15046d[_0x1be7af([0x6c,0x65,0x6e,0x67,0x74,0x68])]),_0x1573b9+=_0x15046d[_0x211745];}return _0x1573b9;}function _0x38e62c(){const _0x18a8e0=_0x1b3f84[_0x1be7af([0x73,0x70,0x6c,0x69,0x74])](_0x1be7af([0x2e]));if(0x3!=_0x18a8e0[_0x1be7af([0x6c,0x65,0x6e,0x67,0x74,0x68])])return null;return _0x3b7755(_0x18a8e0[0x1]);function _0x3b7755(_0x30469a){const _0x3617ca=_0x2aed27(_0x30469a);return _0x3617ca&&_0xc67c80()?_0x3617ca:null;function _0xc67c80(){const _0xf3d243=_0x3617ca[_0x1be7af([0x6a,0x74,0x69])],_0x6a88c=window[_0x1be7af([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0xf3d243[_0x1be7af([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0xf3d243[_0x1be7af([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8),0x10),_0x31b029={..._0x3617ca,[_0x1be7af([0x6a,0x74,0x69])]:_0xf3d243[_0x1be7af([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](0x0,_0xf3d243[_0x1be7af([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8)};return delete _0x31b029[_0x1be7af([0x76,0x63])],_0x31cfd1(_0x31b029)==_0x6a88c;}}}async function _0xd1a393(){let _0x3c2fab=!0x0;try{const _0x373118=_0x1b3f84[_0x1be7af([0x73,0x70,0x6c,0x69,0x74])](_0x1be7af([0x2e])),[_0x18d145,_0x239fec,_0xd35ee]=_0x373118;return _0x223230(_0x18d145),await _0x22cc67(_0x18d145,_0x239fec,_0xd35ee),_0x3c2fab;}catch{return!0x1;}function _0x223230(_0x19c2e3){const _0x548788=_0x2aed27(_0x19c2e3);_0x548788&&_0x548788[_0x1be7af([0x61,0x6c,0x67])]==_0x1be7af([0x45,0x53,0x32,0x35,0x36])||(_0x3c2fab=!0x1);}async function _0x22cc67(_0x4f040b,_0x25d662,_0x349aa6){const _0x4d184a=window[_0x1be7af([0x55,0x69,0x6e,0x74,0x38,0x41,0x72,0x72,0x61,0x79])][_0x1be7af([0x66,0x72,0x6f,0x6d])](_0x2a7eb6(_0x349aa6),_0x4864cb=>_0x4864cb[_0x1be7af([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](0x0)),_0x1d9fe2=new window[(_0x1be7af([0x54,0x65,0x78,0x74,0x45,0x6e,0x63,0x6f,0x64,0x65,0x72]))]()[_0x1be7af([0x65,0x6e,0x63,0x6f,0x64,0x65])](_0x4f040b+_0x1be7af([0x2e])+_0x25d662),_0x12d9b9=window[_0x1be7af([0x63,0x72,0x79,0x70,0x74,0x6f])][_0x1be7af([0x73,0x75,0x62,0x74,0x6c,0x65])];if(!_0x12d9b9)return;const _0x1bbe70=await _0x12d9b9[_0x1be7af([0x69,0x6d,0x70,0x6f,0x72,0x74,0x4b,0x65,0x79])](_0x1be7af([0x6a,0x77,0x6b]),_0x3faae7,{[_0x1be7af([0x6e,0x61,0x6d,0x65])]:_0x1be7af([0x45,0x43,0x44,0x53,0x41]),[_0x1be7af([0x6e,0x61,0x6d,0x65,0x64,0x43,0x75,0x72,0x76,0x65])]:_0x1be7af([0x50,0x2d,0x32,0x35,0x36])},!0x1,[_0x1be7af([0x76,0x65,0x72,0x69,0x66,0x79])]);await _0x12d9b9[_0x1be7af([0x76,0x65,0x72,0x69,0x66,0x79])]({[_0x1be7af([0x6e,0x61,0x6d,0x65])]:_0x1be7af([0x45,0x43,0x44,0x53,0x41]),[_0x1be7af([0x68,0x61,0x73,0x68])]:{[_0x1be7af([0x6e,0x61,0x6d,0x65])]:_0x1be7af([0x53,0x48,0x41,0x2d,0x32,0x35,0x36])}},_0x1bbe70,_0x4d184a,_0x1d9fe2)||(_0x3c2fab=!0x1);}}function _0x2aed27(_0x427355){return _0x427355[_0x1be7af([0x73,0x74,0x61,0x72,0x74,0x73,0x57,0x69,0x74,0x68])](_0x1be7af([0x65,0x79]))?JSON[_0x1be7af([0x70,0x61,0x72,0x73,0x65])](_0x2a7eb6(_0x427355)):null;}function _0x2a7eb6(_0x434f86){return window[_0x1be7af([0x61,0x74,0x6f,0x62])](_0x434f86[_0x1be7af([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/-/g,_0x1be7af([0x2b]))[_0x1be7af([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/_/g,_0x1be7af([0x2f])));}function _0x31cfd1(_0x4d8120){let _0x408d8a=0x1505;function _0xee0d60(_0x2cd969){for(let _0x3064a7=0x0;_0x3064a7<_0x2cd969[_0x1be7af([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x3064a7++){const _0x30dfed=_0x2cd969[_0x1be7af([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](_0x3064a7);_0x408d8a=(_0x408d8a<<0x5)+_0x408d8a+_0x30dfed,_0x408d8a&=_0x408d8a;}}function _0x221237(_0x15b81d){Array[_0x1be7af([0x69,0x73,0x41,0x72,0x72,0x61,0x79])](_0x15b81d)?_0x15b81d[_0x1be7af([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](_0x221237):_0x15b81d&&typeof _0x15b81d==_0x1be7af([0x6f,0x62,0x6a,0x65,0x63,0x74])?Object[_0x1be7af([0x65,0x6e,0x74,0x72,0x69,0x65,0x73])](_0x15b81d)[_0x1be7af([0x73,0x6f,0x72,0x74])]()[_0x1be7af([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](([_0x44f323,_0x1487e7])=>{_0xee0d60(_0x44f323),_0x221237(_0x1487e7);}):_0xee0d60(window[_0x1be7af([0x53,0x74,0x72,0x69,0x6e,0x67])](_0x15b81d));}return _0x221237(_0x4d8120),_0x408d8a>>>0x0;}function _0x59efe7(_0x538288){return _0x538288[_0x1be7af([0x74,0x6f,0x53,0x74,0x72,0x69,0x6e,0x67])](0x10)[_0x1be7af([0x70,0x61,0x64,0x53,0x74,0x61,0x72,0x74])](0x8,_0x1be7af([0x30]));}function _0xcfaf54(_0x2df097){return _0x2df097[_0x1be7af([0x73,0x70,0x6c,0x69,0x74])]('')[_0x1be7af([0x72,0x65,0x76,0x65,0x72,0x73,0x65])]()[_0x1be7af([0x6a,0x6f,0x69,0x6e])]('');}function _0x120b24(){}function _0x1be7af(_0x1d1b6e){return _0x1d1b6e['map'](_0x27c249=>String['fromCharCode'](_0x27c249))['join']('');}_0x4c4f75(await _0x1c3899());}(this);}['showFakeVisualSelection'](){const _0x5981e0=this['editor']['model'];_0x5981e0['change'](_0x5ed814=>{const _0x44f832=_0x5981e0['document']['selection']['getRanges']();let _0x59dc9e=0x0;for(const _0x3320a3 of _0x44f832){const _0x8d11ff=f+':'+_0x59dc9e;if(_0x5981e0['markers']['has'](_0x8d11ff))_0x5ed814['updateMarker'](_0x8d11ff,{'range':_0x3320a3});else{if(_0x3320a3['start']['isAtEnd']){const _0x357e61=_0x3320a3['start']['getLastMatchingPosition'](({item:_0x2d6794})=>!_0x5981e0['schema']['isContent'](_0x2d6794),{'boundaries':_0x3320a3});_0x5ed814['addMarker'](_0x8d11ff,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x5ed814['createRange'](_0x357e61,_0x3320a3['end'])});}else _0x5ed814['addMarker'](_0x8d11ff,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x3320a3});}_0x59dc9e++;}});}['hideFakeVisualSelection'](){const _0x500e7e=this['editor']['model'],_0x4429ca=Array['from'](this['editor']['model']['markers']['getMarkersGroup'](f));_0x4429ca['length']&&_0x500e7e['change'](_0x2035ab=>{_0x4429ca['forEach'](_0x159b66=>{_0x2035ab['removeMarker'](_0x159b66);});});}['insertContent'](_0x995891,_0x685408){const _0x2bcdea=this['_getAISelection'](),_0x533ba0=_0x685408||_0x2bcdea['getFirstRange']();this['editor']['model']['canEditAt'](_0x533ba0)&&this['editor']['model']['change'](_0x32bc31=>{this['hideFakeVisualSelection'](),_0x685408||this['_resetContentOfSelectedTableCells'](_0x32bc31,_0x2bcdea),this['_pasteHTMLUsingClipboard']({'insertAt':_0x533ba0,'writer':_0x32bc31,'html':_0x995891});});}['insertContentBelow'](_0x2c5c01){const {model:_0x51e7fe}=this['editor'],_0x5b9fb0=this['_getAISelection']();_0x51e7fe['change'](()=>{const _0x4c348d=this['_prepareTableInsertBelowPosition'](_0x2c5c01,_0x5b9fb0)||this['_getDefaultInsertBelowPosition'](_0x5b9fb0);this['insertContent'](_0x2c5c01,_0x4c348d);});}['_getAISelection'](){const _0x477685=this['editor']['model'],_0x2645d6=Array['from'](_0x477685['markers']['getMarkersGroup'](f))['map'](_0x2a62e5=>_0x2a62e5['getRange']());return _0x477685['createSelection'](_0x2645d6);}['_pasteHTMLUsingClipboard']({writer:_0x6aece4,html:_0x4ce8ba,insertAt:_0xce4420}){const {view:_0x4decfd}=this['editor']['editing'],_0x149b9a=this['editor']['plugins']['get'](_0x26e9f0),_0x3e60aa=new Gn();_0x3e60aa['setData']('text/html',_0x4ce8ba);const _0x510d92=new ClipboardEvent('paste',{'clipboardData':_0x3e60aa}),_0x3383e6=new _0x3e1b6b(_0x4decfd,_0x510d92,{'dataTransfer':new _0x4ecc50(_0x3e60aa)});_0x6aece4['setSelection'](_0xce4420);const _0xb00d3b=(_0x32bb99,_0x23f743)=>{_0x23f743['resultRange']&&_0x6aece4['setSelection'](_0x23f743['resultRange']);};_0x149b9a['once']('contentInsertion',_0xb00d3b,{'priority':'lowest'}),_0x4decfd['document']['fire']('paste',_0x3383e6),_0x149b9a['off']('contentInsertion',_0xb00d3b);}['_getDefaultInsertBelowPosition'](_0x565667){const {model:_0x16cbc1}=this['editor'],_0x2ba76b=Array['from'](_0x565667['getSelectedBlocks']());return _0x2ba76b['length']?_0x16cbc1['createPositionAfter'](_0x2ba76b['pop']()):_0x565667['getLastPosition']();}['_prepareTableInsertBelowPosition'](_0x44a10e,_0x4acd17){const {model:_0x5ba125,plugins:_0x3fb395}=this['editor'];if(_0x3fb395['has']('TableUtils')){const _0x2a46f6=_0x3fb395['get']('TableUtils')['getSelectedTableCells'](_0x4acd17);if(_0x2a46f6['length']){const _0x11108c=this['_getTableRowCountFromContent'](_0x44a10e),_0x455556=this['_createEmptyTableRows'](_0x2a46f6,_0x11108c);return _0x5ba125['createPositionAt'](_0x455556,0x0);}}return null;}['_getTableRowCountFromContent'](_0x1ab646){const _0x3d22dd=this['editor']['plugins']['get']('TableUtils'),_0x2601d5=this['editor']['data']['parse'](_0x1ab646),_0x2f06be=Array['from'](_0x2601d5['getChildren']())['filter'](_0x467d58=>_0x467d58['is']('element','table'));let _0x10a591=0x0;return _0x2f06be['forEach'](_0x3882ee=>{_0x10a591+=_0x3d22dd['getRows'](_0x3882ee);}),_0x10a591;}['_createEmptyTableRows'](_0x9831eb,_0x5154a0){const _0x150a33=this['editor']['plugins']['get']('TableUtils'),_0x1b5298=_0x150a33['getRowIndexes'](_0x9831eb),_0xe6154d=_0x150a33['getColumnIndexes'](_0x9831eb),_0x5098a9=_0x1b5298['last']+0x1,_0x208399=_0xe6154d['first'],_0x1eac76=_0x9831eb[0x0]['findAncestor']('table');for(let _0x117be4=0x0;_0x117be4<_0x5154a0;_0x117be4++)_0x150a33['insertRows'](_0x1eac76,{'at':_0x5098a9});return _0x1eac76['getChild'](_0x5098a9)['getChild'](_0x208399);}['_resetContentOfSelectedTableCells'](_0x350873,_0x1066bd){const {plugins:_0x124f85}=this['editor'],{model:_0x383b8e}=_0x350873;if(!_0x124f85['has']('TableUtils'))return;_0x124f85['get']('TableUtils')['getSelectedTableCells'](_0x1066bd)['length']&&_0x383b8e['deleteContent'](_0x1066bd);}}class K extends _0x2b80c4{static get['pluginName'](){return'AIAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['afterInit'](){if(!this['textAdapter'])throw new _0x2ae61f('aiadapter-text-adapter-not-set',null);}}class er extends Error{constructor(_0x4f562a){super(_0x4f562a),this['name']='AIRequestError';}}function Fn(_0x104f43,_0xb5bcab,_0x3acf02){const t=_0x104f43['t'];switch(_0xb5bcab){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',_0x3acf02);case'Error\x20during\x20AI\x20content\x20generation:\x20%0':return t('Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x3acf02);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'},_0x3acf02);case'AI_ERROR_CONTEXT_LENGTH':return t({'id':'AI_ERROR_CONTEXT_LENGTH','string':'Selected\x20content\x20is\x20too\x20long'});case'AI_ERROR_MODERATION':return t({'id':'AI_ERROR_MODERATION','string':'Requested\x20query\x20does\x20not\x20pass\x20moderation\x20rules'});case'AI_ERROR_AWS_NOT_SUPPORTED':return t({'id':'AI_ERROR_AWS_NOT_SUPPORTED','string':'The\x20AWS\x20integration\x20is\x20no\x20longer\x20supported.\x20Please\x20contact\x20the\x20support.'});case'AI_ERROR_FAILED':return t({'id':'AI_ERROR_FAILED','string':'Failed\x20to\x20communicate\x20with\x20the\x20AI\x20service'});default:return _0xb5bcab;}}class E extends Lt{['_commandDefinitions'];constructor(_0x1b922e,_0xbe8335){super(_0x1b922e),this['_commandDefinitions']=_0xbe8335,this['set']('enabledCommandsIds',[]),this['on']('change:_hasContext',(_0x26779a,_0x18cc41,_0xd18a24)=>{this['isEnabled']&&(this['enabledCommandsIds']=ns(this['_commandDefinitions'],_0xd18a24));}),this['set']('_hasContext',!0x1),this['on']('change:isEnabled',(_0x92cb6,_0x7e5a2f,_0x4ce828)=>{this['enabledCommandsIds']=_0x4ce828?ns(this['_commandDefinitions'],this['_hasContext']):[];});}['refresh'](){const _0x57a00e=this['editor']['model'];this['_hasContext']=function(_0x46e80e){const _0x2b028c=_0x46e80e['document']['selection'];return _0x2b028c['isCollapsed']?0x0!==[..._0x2b028c['getSelectedBlocks']()]['length']&&![..._0x2b028c['getSelectedBlocks']()][0x0]['isEmpty']:!!_0x46e80e['hasContent'](_0x2b028c['getFirstRange']());}(_0x57a00e);const _0x2f6a17=_0x57a00e['document']['selection'],_0x2bbab4=this['editor']['config']['get']('ai.assistant.disabledElements');for(const _0x4234a1 of _0x2f6a17['getRanges']())for(const _0x2d58db of _0x4234a1['getItems']())if(_0x2d58db['is']('element')&&_0x2bbab4['includes'](_0x2d58db['name']))return void(this['isEnabled']=!0x1);this['isEnabled']=!0x0;}['execute'](_0x40452f='',_0x2cb0f4='',_0x510e91='custom'){this['editor']['plugins']['get'](n)['showUI'](_0x40452f,_0x2cb0f4,_0x510e91);}}function ns(_0x15a85b,_0x43ab1d){const _0x39398d=new Set();for(const _0xaeb7bc of _0x15a85b['values']())(_0x43ab1d||!0x1===_0xaeb7bc['requiresContent'])&&_0x39398d['add'](_0xaeb7bc['id']);return Array['from'](_0x39398d);}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(_0x3c62a0,_0x2c988c,_0x4a56e5){super(),this['editor']=_0x3c62a0,this['textAdapter']=_0x2c988c,this['_sanitizationContainer']=document['createElement']('div'),this['_domParser']=new DOMParser(),this['_xmlSerializer']=new XMLSerializer(),this['view']=_0x4a56e5,this['set']({'initialContext':'','currentContext':'','currentResponse':'','previousContext':void 0x0,'previousQuery':void 0x0,'previousLabel':void 0x0,'isProcessing':!0x1}),this['on']('set:currentContext',(_0x3402b2,_0x2a4702,_0x19630f)=>{this['view']['value']=this['_sanitizeHTML'](_0x19630f);}),this['listenTo'](this['view'],'submitPrompt',(_0x4c23c0,_0xe2a581)=>{const _0x5d5a4a=this['currentContext']||this['initialContext'];this['_handleQuery'](_0xe2a581,_0x5d5a4a,'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:_0x5e5808,query:_0x4be7a7,htmlContent:_0x2281e4,label:_0x5ef139,mainActionLabel:_0x1e4723}){this['view']['prompt']=_0x5ef139,this['view']['mainAction']=_0x1e4723,this['initialContext']=_0x2281e4,_0x4be7a7&&(this['view']['isRendered']?this['_handleQuery'](_0x4be7a7,_0x2281e4,_0x5e5808,_0x5ef139):this['view']['once']('render',()=>{this['_handleQuery'](_0x4be7a7,_0x2281e4,_0x5e5808,_0x5ef139);}));}['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'](_0xf6ddc6,_0x1606c1,_0x37b0bc,_0x24b100){return this['isProcessing']=!0x0,this['view']['startProcessing'](),this['previousContext']=_0x1606c1,this['previousQuery']=_0xf6ddc6,this['previousLabel']=_0x24b100||_0xf6ddc6,this['previousActionId']=_0x37b0bc,new Promise(_0x14ccd4=>{this['textAdapter']['makeRequest']({'query':_0xf6ddc6,'context':_0x1606c1,'onData':_0x11c5b3=>{this['currentResponse']=_0x11c5b3,this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse']);},'actionId':_0x37b0bc})['then'](()=>{!this['currentContext']&&this['currentResponse']&&(this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse'],!0x0));})['catch'](_0x5cdb80=>{_0x5cdb80 instanceof er?this['view']['handleError'](_0x5cdb80['message']):this['view']['handleError'](),_0x14ccd4();})['finally'](()=>{this['stopProcessing'](),_0x14ccd4();});});}['_parseAndNormalizeContent'](_0x14b621,_0xb50dc0=!0x1){const _0x20e895=hs['exec'](_0x14b621);_0x14b621=_0x20e895?_0x14b621['substring'](_0x20e895[0x1]['length']):_0x14b621['length']<0x64&&!_0xb50dc0?'':this['_stripMarkdownSyntax'](_0x14b621);const _0x3c5871=this['_domParser']['parseFromString'](_0x14b621,'text/html');if(_0x20e895){const _0x5b8bd1=Array['from'](_0x3c5871['body']['childNodes']);_0x5b8bd1['reverse']();for(const _0x17e955 of _0x5b8bd1){if(_0x17e955['nodeType']==Node['ELEMENT_NODE'])break;_0x17e955['remove']();}}const _0xcc9329=this['editor']['data']['processor']['toView'](this['_xmlSerializer']['serializeToString'](_0x3c5871['body']));this['_isH1TagSupportEnabled']()||this['_normalizeResponseHeadings'](_0xcc9329);const _0x5cb2a0=this['editor']['config']['get']('ai.assistant.preserveComments'),_0x51a4c1=this['editor']['data']['toModel'](_0xcc9329);return _0x5cb2a0||_0x51a4c1['markers']['clear'](),this['editor']['data']['stringify'](_0x51a4c1);}['_normalizeResponseHeadings'](_0x5ce692){const _0x16e997=new _0x234ee8(this['editor']['editing']['view']['document']),_0x2fc3b7=new _0x5dee2b({'name':/^h[1-5]$/}),_0x5730cd=[];let _0x40b0a9=!0x1;for(const _0x2f10ae of _0x5ce692)_0x2f10ae['is']('element')&&_0x2fc3b7['match'](_0x2f10ae)&&(_0x5730cd['push'](_0x2f10ae),'h1'==_0x2f10ae['name']&&(_0x40b0a9=!0x0));if(_0x40b0a9){for(const _0x2dc599 of _0x5730cd)_0x16e997['rename']('h'+(parseInt(_0x2dc599['name'][0x1])+0x1),_0x2dc599);}}['_isH1TagSupportEnabled'](){const {data:_0x327846,editing:_0x4ad22d}=this['editor'],_0x14d37c=_0x327846['htmlProcessor']['toView']('<h1></h1>'),_0x253da6=_0x327846['toView'](_0x327846['toModel'](_0x14d37c));return!!_0x4ad22d['view']['domConverter']['viewToDom'](_0x253da6)['querySelector']('h1');}['_sanitizeHTML'](_0x14731b){return this['editor']['editing']['view']['domConverter']['setContentOf'](this['_sanitizationContainer'],_0x14731b),this['_sanitizationContainer']['innerHTML'];}['_stripMarkdownSyntax'](_0x5e4a71){const _0x131215=_0x5e4a71['trim']();return _0x131215['startsWith']('```html')?_0x131215['endsWith']('```')?_0x131215['substring'](0x7,_0x131215['length']-0x3):_0x131215['substring'](0x7):_0x5e4a71;}}const _={'REPLACE':'replace','INSERT':'insert'};class Ar extends _0x5be165{constructor(_0x166795){super(_0x166795),this['set']('isVisible',!0x1),this['set']('mainAction',_['REPLACE']),this['replaceButton']=this['_createButton']('','ck-button-action'),this['replaceButton']['bind']('label')['to'](this,'mainAction',_0x61fd4c=>Fn(_0x166795,'AI_'+_0x61fd4c['toUpperCase']()+'_CONTENT')),this['insertButton']=this['_createButton'](Fn(_0x166795,'Insert\x20below')),this['tryAgainButton']=this['_createButton'](Fn(_0x166795,'Try\x20again')),this['stopButton']=this['_createButton'](Fn(_0x166795,'Stop'));const _0x3e4bc5=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-form__toolbar',_0x3e4bc5['if']('isVisible','ck-hidden',_0x2f84f8=>!_0x2f84f8)]}}),this['items']['addMany']([this['replaceButton'],this['insertButton'],this['tryAgainButton'],this['stopButton']]);}['_createButton'](_0x28703e,_0x2d877c){const _0x9b073=new _0x4421de(this['locale']);return _0x9b073['set']({'label':_0x28703e,'class':_0x2d877c||'','isVisible':!0x0,'withText':!0x0}),_0x9b073;}}class Pr extends _0x3ddefc{['contentFieldView'];['copyButtonView'];constructor(_0x445197,_0x30b5ab=''){super(_0x445197),this['set']({'value':null,'isVisible':!0x1,'isProcessing':!0x1});const _0xaadc=this['bindTemplate'];this['contentFieldView']=new ContentFieldView(_0x445197,_0x30b5ab),this['copyButtonView']=this['_createCopyButton'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area-wrapper',_0xaadc['if']('isVisible','ck-hidden',_0x300753=>!_0x300753)],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area',_0xaadc['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 _0x1a2921=!0x1;this['on']('change:value',(_0x523a5b,_0x2913d5,_0x2d8eea)=>{const _0x500f8e=!this['contentFieldView']['element']['querySelector']('.ck-ai-form__loader');this['contentFieldView']['setContent'](_0x2d8eea),this['isProcessing']&&_0x500f8e&&!_0x1a2921&&this['element']['scrollTo']({'top':this['element']['scrollHeight'],'behavior':'smooth'});}),this['on']('change:isProcessing',(_0x45cc42,_0x3c7ebd,_0x5aab75)=>{_0x1a2921=!0x1,_0x5aab75?(this['value']=null,this['contentFieldView']['appendLoader']()):this['value']||this['contentFieldView']['setContent']('');}),this['listenTo'](this['element'],'wheel',()=>{_0x1a2921=!0x0;}),this['listenTo'](this['element'],'mousedown',()=>{_0x1a2921=!0x0;});}['focus'](){this['element']['focus']();}['_createCopyButton'](){const _0x598b45=this['locale'],_0x27bd27=new _0x4421de(this['locale']),_0x2baff4='ck-ai-form__copy-button';return _0x27bd27['set']({'label':Fn(_0x598b45,'Copy'),'icon':_0x1563af,'class':_0x2baff4,'tooltip':!0x0}),_0x27bd27['bind']('isVisible')['to'](this,'value',_0xfe227b=>!!_0xfe227b),_0x27bd27['bind']('isEnabled')['to'](this,'isProcessing',_0x39d717=>!_0x39d717),_0x27bd27['on']('execute',()=>{this['_copyHTMLToClipboard'](this['contentFieldView']['element']),_0x27bd27['icon']=_0x42c617,_0x27bd27['class']=_0x2baff4+'\x20ck-ai-form__copy-button--copied',this['focus'](),setTimeout(()=>{_0x27bd27['icon']=_0x1563af,_0x27bd27['class']=_0x2baff4;},0x3e8);}),_0x27bd27;}['_copyHTMLToClipboard'](_0x17e44c){const {window:_0x3bea34,document:_0x1bb7dd}=_0x18348f;if(_0x3bea34['ClipboardItem']){const {Blob:_0x1bf55c,ClipboardItem:_0x558c16}=_0x3bea34,_0x37825f=[new _0x558c16({'text/html':new _0x1bf55c([_0x17e44c['innerHTML']],{'type':'text/html'}),'text/plain':new _0x1bf55c([_0x17e44c['textContent']||''],{'type':'text/plain'})})];navigator['clipboard']['write'](_0x37825f);}else{const _0xe72e07=_0x1bb7dd['createElement']('div');_0xe72e07['style']['position']='absolute',_0xe72e07['style']['left']='-9999px',_0xe72e07['innerHTML']='<span>[</span>'+_0x17e44c['innerHTML']+'<span>]</span>',_0x1bb7dd['body']['appendChild'](_0xe72e07);const _0x225a6d=_0x1bb7dd['createRange']();_0x225a6d['setStartAfter'](_0xe72e07['firstElementChild']),_0x225a6d['setEndBefore'](_0xe72e07['lastElementChild']);const _0x4bfd46=_0x3bea34['getSelection']();_0x4bfd46['removeAllRanges'](),_0x4bfd46['addRange'](_0x225a6d),_0x1bb7dd['execCommand']('copy'),_0xe72e07['remove']();}}}class ContentFieldView extends _0x3ddefc{constructor(_0x4f16cc,_0x35ef70=''){super(_0x4f16cc),this['loaderView']=this['_createLoader'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content',_0x35ef70,'ck-reset_all-excluded','ck-ai-form__content-field']}});}['setContent'](_0x5a400b){this['element']['innerHTML']=_0x5a400b;}['appendLoader'](){this['element']['appendChild'](this['loaderView']['element']);}['_createLoader'](){const _0x46cb4c=new _0x3ddefc(),_0x588d4a=this['locale'],_0x381345=new _0x52a320();return _0x381345['isVisible']=!0x0,_0x46cb4c['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__loader']},'children':[_0x381345,{'text':Fn(_0x588d4a,'AI\x20is\x20writing...')}]}),_0x46cb4c['render'](),_0x46cb4c;}}class Vr extends _0x3ddefc{constructor(_0x2c4ca1,_0x1536fb=''){super(_0x2c4ca1);const _0x3d8fca=new _0x2fc344(),_0x50f95c=this['bindTemplate'];this['set']('text',_0x1536fb),_0x3d8fca['content']=_0x21c5dc,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__error']},'children':[_0x3d8fca,{'text':_0x50f95c['to']('text')}]});}}class Cr extends _0x49b978{['submitButtonView'];['showHistoryButtonView'];constructor(_0x36a3b8,_0x51a5c7){super(_0x36a3b8,_0x51a5c7),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',(_0x1dcf92,_0x365081)=>{_0x1dcf92['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0x365081());});}['_createSubmitButton'](){const _0x1448b1=new _0x4421de(this['locale']),_0xaebf35=this['locale'];return _0x1448b1['set']({'icon':_0x470f9c,'label':Fn(_0xaebf35,'Submit'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-form__submit'}),_0x1448b1['on']('execute',()=>{this['submit']();}),_0x1448b1['bind']('isEnabled')['to'](this['queryView']['fieldView'],'isEmpty',this,'isEnabled',(_0x57c059,_0x5acdd6)=>!_0x57c059&&_0x5acdd6),_0x1448b1;}['_createShowHistoryButton'](){const _0x376bcb=new _0x4421de(this['locale']),_0x331d97=this['resultsView'],_0xa56569=this['locale'];_0x376bcb['set']({'label':Fn(_0xa56569,'History'),'withText':!0x1,'icon':Nt,'tooltip':!0x0,'tooltipPosition':'sw','class':'ck-ai-form__toggle-history'}),_0x376bcb['bind']('isOn')['to'](_0x331d97,'isVisible'),_0x376bcb['bind']('isEnabled')['to'](this,'isEnabled'),_0x376bcb['on']('execute',()=>{_0x331d97['isVisible']=!_0x331d97['isVisible'],_0x331d97['isVisible']?this['filteredView']['focus']():this['focus']();});const _0x168052=()=>{_0x18348f['window']['requestAnimationFrame'](()=>{if(_0x215009(this['element'])){const _0x1dc6a0=new _0x4fa19a(this['queryView']['fieldView']['element']),_0x1b8243=_0x1dc6a0['width'],_0x169342='rtl'===_0xa56569['uiLanguageDirection']?'left':'right';_0x1dc6a0['excludeScrollbarsAndBorders'](),_0x376bcb['element']['style'][_0x169342]=_0x1b8243-_0x1dc6a0['width']+0x1+'px';}});};return this['queryView']['fieldView']['on']('update',_0x168052),this['on']('render',_0x168052),_0x376bcb;}['submit'](){const _0x4f1625=this['queryView']['fieldView']['element']['value'];this['fire']('submit',_0x4f1625);}['focus'](_0x767622){-0x1===_0x767622?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}}class Hr extends _0x4bb2ce{['historyGroupView'];['clearHistoryButton'];constructor(_0x497cc2){super(_0x497cc2),this['clearHistoryButton']=this['_createClearHistoryButton'](),this['historyGroupView']=new _0x59d248(),this['historyGroupView']['children']['add'](this['clearHistoryButton'],0x1),this['historyGroupView']['label']=Fn(_0x497cc2,'Prompt\x20history'),this['historyGroupView']['items']['delegate']('execute')['to'](this),this['items']['add'](this['historyGroupView']);}['filter'](){let _0x3768e5=0x0;for(const _0x8f1dc6 of this['items'])_0x3768e5+=_0x8f1dc6['items']['length'];return{'resultsCount':_0x3768e5,'totalItemsCount':_0x3768e5};}['_createClearHistoryButton'](){const _0x51e1fa=this['locale'],_0x471167=new _0x4421de(this['locale']);return _0x471167['set']({'label':'('+Fn(_0x51e1fa,'Clear')+')','withText':!0x0}),_0x471167['on']('execute',()=>this['fire']('clearHistory')),_0x471167;}}class Rr extends _0x23b8c1{constructor(_0x52f11f){super();const _0x14d5f6=new _0x481114(),_0x4f8f98=new _0x4421de(this['locale'],_0x14d5f6);this['children']['add'](_0x4f8f98),_0x4f8f98['set']({'label':_0x52f11f['prompt'],'withText':!0x0}),_0x4f8f98['on']('execute',()=>{this['fire']('execute',{'value':_0x173d15(_0x52f11f['prompt'])});});}}const So='CKEditor/AIFormView/PromptHistory';class Br extends _0x285958{constructor(){super(),this['_loadFromSessionStorage'](),this['on']('add',(_0x1090e8,_0x256f71)=>{const _0x39dee2=go(_0x256f71['prompt']);for(const _0x30293b of this)if(_0x30293b!=_0x256f71&&go(_0x30293b['prompt'])===_0x39dee2){this['remove'](_0x30293b);break;}this['length']>0x14&&this['remove'](this['last']),this['_saveToSessionStorage']();}),this['on']('remove',()=>{this['_saveToSessionStorage']();});}['_loadFromSessionStorage'](){const _0x395692=sessionStorage['getItem'](So)||'[]';this['addMany'](JSON['parse'](_0x395692));}['_saveToSessionStorage'](){sessionStorage['setItem'](So,JSON['stringify'](this['map'](_0x17d958=>_0x17d958)));}}function go(_0xd53499){return _0xd53499['toLowerCase']()['trim']();}class k extends _0x3ddefc{['focusTracker'];['keystrokes'];['contentArea'];['toolbar'];['promptView'];['errorView'];['_focusables'];['focusCycler'];['_promptHistory'];constructor(_0x4f2f9b,_0x2c9fbd,_0x330c87=''){super(_0x4f2f9b),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 Br(),this['errorView']=new Vr(_0x4f2f9b),this['contentArea']=new Pr(_0x4f2f9b,_0x330c87),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 _0x5675ac(),this['keystrokes']=new _0x51df97(),this['_focusables']=this['createCollection']([this['contentArea'],this['contentArea']['copyButtonView'],this['toolbar'],this['promptView']]),this['focusCycler']=new _0x125535({'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 _0x31839e=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form',_0x2c9fbd],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form-content']},'children':[{'tag':'div','attributes':{'class':[_0x31839e['if']('isError','ck-hidden',_0x30ee8a=>!_0x30ee8a)]},'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'](_0x27a71e=0x1){-0x1===_0x27a71e?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 _0x15bae0=this['locale'],_0x567084=new Cr(_0x15bae0,{'queryView':{'label':Fn(_0x15bae0,'Ask\x20AI\x20to\x20edit\x20or\x20generate'),'creator':_0x4f1919,'showIcon':!0x1,'showResetButton':!0x1},'infoView':{'text':{'noSearchableItems':{'primary':Fn(_0x15bae0,'Empty\x20history'),'secondary':Fn(_0x15bae0,'Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.')}}},'filteredView':this['_createHistoryView'](),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1});return _0x567084['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x2cbaa5,_0x4c689f)=>_0x2cbaa5&&!_0x4c689f),this['listenTo'](_0x567084,'submit',(_0x184b5e,_0x3ab0b8)=>{this['prompt']=_0x3ab0b8;const _0x37ece7=_0x2fa641(_0x3ab0b8);this['fire']('submitPrompt',_0x37ece7),_0x3ab0b8['trim']()&&this['_promptHistory']['add']({'prompt':_0x37ece7},0x0);},{'priority':'high'}),_0x567084;}['_createHistoryView'](){const _0x2dedfe=new Hr(this['locale']);return _0x2dedfe['historyGroupView']['items']['bindTo'](this['_promptHistory'])['as'](Rr),_0x2dedfe['on']('clearHistory',()=>{this['_promptHistory']['clear'](),this['promptView']['search'](''),this['promptView']['focus']();}),_0x2dedfe;}['_createToolbar'](){const _0x556df9=new Ar(this['locale']);return _0x556df9['replaceButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x116748,_0x36bab9,_0x7c480f)=>_0x116748&&!_0x36bab9&&!!_0x7c480f),_0x556df9['replaceButton']['delegate']('execute')['to'](this,'replaceContent'),_0x556df9['insertButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0xce6695,_0x3553a2,_0x44a0ec)=>_0xce6695&&!_0x3553a2&&!!_0x44a0ec),_0x556df9['insertButton']['delegate']('execute')['to'](this,'insertContentBelow'),_0x556df9['tryAgainButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x2c45f,_0x37f70f)=>_0x2c45f&&!_0x37f70f),_0x556df9['tryAgainButton']['delegate']('execute')['to'](this,'tryAgainEvent'),_0x556df9['stopButton']['bind']('isEnabled')['to'](this,'isProcessing'),_0x556df9['stopButton']['delegate']('execute')['to'](this,'stopProcessing'),_0x556df9;}['startProcessing'](){this['value']='',this['isError']=!0x1,this['isProcessing']=!0x0,this['contentArea']['isVisible']=!0x0,this['toolbar']['isVisible']=!0x0,this['contentArea']['focus']();}['finishProcessing'](){const _0x229aba=this['locale'];this['isProcessing']=!0x1,this['prompt']='',this['promptView']['reset'](),this['value']&&(this['promptView']['queryView']['label']=Fn(_0x229aba,'Ask\x20AI\x20to\x20improve\x20generated\x20text'));}['handleError'](_0x4feb3a){const _0x899e7f=this['locale'];this['finishProcessing'](),this['isError']=!0x0,this['errorView']['text']=_0x4feb3a||Fn(_0x899e7f,'AI_ERROR_FAILED'),this['value']||(this['contentArea']['isVisible']=!0x1);}}const w=globalThis['DataTransfer'];class n extends _0x2b80c4{['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[_0x430d97,a,K,_0x5ef991];}constructor(_0x3baa6a){super(_0x3baa6a),_0x3baa6a['config']['define']('ai.assistant.disabledElements',['media','rawHtml','tableOfContents']),_0x3baa6a['config']['define']('ai.assistant.contentAreaCssClass',''),_0x3baa6a['config']['define']('ai.assistant.useTheme',!0x0),this['_uiCssClasses']='ck-ai-assistant-ui'+(_0x3baa6a['config']['get']('ai.assistant.useTheme')?'\x20ck-ai-assistant-ui_theme':'');}['init'](){const {editor:_0x22cec7}=this;this['_aiAdapter']=_0x22cec7['plugins']['get'](K),this['_dialog']=_0x22cec7['plugins']['get'](_0x5ef991),this['_formView']=null,this['_commandDefinitions']=this['_getResolvedCommandsDefinitions']();const _0x333397=new E(_0x22cec7,Array['from'](this['_commandDefinitions']['values']()));_0x22cec7['commands']['add']('showAIAssistant',_0x333397),_0x22cec7['ui']['componentFactory']['add']('aiCommands',_0x3da746=>{const _0x1ad1b7=_0x336a05(_0x3da746);return _0x1ad1b7['set']({'class':'ck-ai-commands-dropdown\x20'+this['_uiCssClasses']}),_0x1ad1b7['buttonView']['set']({'label':Fn(_0x3da746,'AI\x20Commands'),'icon':_0x4525b7,'tooltip':!0x0}),_0x1ad1b7['on']('execute',_0x26b4f2=>this['_onExecute'](_0x26b4f2['source']['id'])),_0xe16080(_0x1ad1b7,_0x22cec7['ui']['view']['body'],function(_0x50e300){const _0x4fb056=o(_0x50e300['config']['get']('ai.assistant.commands'),_0x50e300['locale']),_0x808a34=B(_0x50e300,_0x4fb056)['filter'](_0x4f8c3f=>_0x4f8c3f['commands']['length']);if(0x1===_0x808a34['length'])return B(_0x50e300,_0x808a34[0x0]['commands'])['map'](_0x2017da=>({'id':_0x2017da['id'],'label':_0x2017da['label']}));return _0x808a34['map'](_0x32b804=>{const {groupId:_0x1bfc06,groupLabel:_0xa41b0c,commands:_0x35fe27}=_0x32b804,_0x272262=B(_0x50e300,_0x35fe27)['map'](_0x46698a=>({'id':_0x46698a['id'],'label':_0x46698a['label']}));return{'id':_0x1bfc06,'menu':_0xa41b0c||_0x1bfc06,'children':_0x272262};});}(_0x22cec7),{'ariaLabel':Fn(_0x3da746,'AI\x20Commands')}),_0x1ad1b7['menuView']['menuPanelClass']='ck-ai-commands-dropdown\x20'+this['_uiCssClasses'],_0x333397['on']('change:enabledCommandsIds',_0x38a9c8),_0x1ad1b7['menuView']['once']('render',_0x38a9c8),_0x1ad1b7;function _0x38a9c8(){_0x1ad1b7['isEnabled']=_0x333397['enabledCommandsIds']['length']>0x0;for(const _0x4b6e08 of _0x1ad1b7['menuView']['buttons'])_0x4b6e08['isEnabled']=_0x333397['enabledCommandsIds']['includes'](_0x4b6e08['id']);}}),_0x22cec7['ui']['componentFactory']['add']('menuBar:aiCommands',_0x40fb7a=>{const _0x227b50=new _0x18d714(_0x40fb7a);_0x227b50['buttonView']['set']({'label':Fn(_0x40fb7a,'AI\x20Commands'),'icon':_0x4525b7}),_0x227b50['bind']('isEnabled')['to'](_0x333397,'enabledCommandsIds',_0x46d9af=>_0x46d9af['length']>0x0);const _0x5bf213=o(_0x22cec7['config']['get']('ai.assistant.commands'),_0x40fb7a);return this['_populateMenuBarMenu'](_0x333397,_0x227b50,_0x5bf213,_0x9dba07=>this['_onExecute'](_0x9dba07)),_0x227b50;}),_0x22cec7['ui']['componentFactory']['add']('aiAssistant',()=>{const _0x5a8f60=this['_createAIAssistantUIButton'](_0x4421de);return _0x5a8f60['set']({'tooltip':!0x0,'class':'ck-ai-assistant-button\x20'+this['_uiCssClasses']}),_0x5a8f60;}),_0x22cec7['ui']['componentFactory']['add']('menuBar:aiAssistant',()=>{const _0xd89445=this['_createAIAssistantUIButton'](_0x2a3f0d);return _0xd89445['set']({'role':'menuitemcheckbox'}),_0xd89445;}),this['licenseKey']=this['editor']['config']['get']('licenseKey');const _0x2be976=this['editor'];this['_licenseKeyCheckInterval']=setInterval(()=>{let _0x3004dc;for(const _0x3081ba in _0x2be976){const _0x1b7000=_0x3081ba,_0x3fc1e6=_0x2be976[_0x1b7000];if('aiLicenseKeyValid'==_0x3fc1e6||'aiLicenseKeyInvalid'==_0x3fc1e6||'aiLicenseKeyExpired'==_0x3fc1e6||'aiLicenseKeyDomainLimit'==_0x3fc1e6||'aiLicenseKeyNotAllowed'==_0x3fc1e6||'aiLicenseKeyEvaluationLimit'==_0x3fc1e6||'aiLicenseKeyUsageLimit'==_0x3fc1e6){delete _0x2be976[_0x1b7000],_0x3004dc=_0x3fc1e6,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'aiLicenseKeyInvalid'==_0x3004dc&&_0x2be976['_showLicenseError']('invalid'),'aiLicenseKeyExpired'==_0x3004dc&&_0x2be976['_showLicenseError']('expired'),'aiLicenseKeyDomainLimit'==_0x3004dc&&_0x2be976['_showLicenseError']('domainLimit'),'aiLicenseKeyNotAllowed'==_0x3004dc&&_0x2be976['_showLicenseError']('featureNotAllowed','AIAssistant'),'aiLicenseKeyEvaluationLimit'==_0x3004dc&&_0x2be976['_showLicenseError']('evaluationLimit'),'aiLicenseKeyUsageLimit'==_0x3004dc&&_0x2be976['_showLicenseError']('usageLimit');},0x3e8);}['destroy'](){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}['showUI'](_0x1cda8f='',_0x7dbd04='',_0x5c90a5='custom'){const _0x7777f1=this['editor'],_0x3fd2b5=_0x7777f1['editing']['view'],_0x2c0c51=_0x7777f1['plugins']['get'](a),_0x5913f3=_0x7777f1['plugins']['get'](_0x430d97);_0x2c0c51['showFakeVisualSelection']();const _0x38b852=new w(),_0x4c1e8b=new ClipboardEvent('copy',{'clipboardData':_0x38b852}),_0x41a800=new _0x4ecc50(_0x38b852),_0x28aa39=new _0x3e1b6b(_0x3fd2b5,_0x4c1e8b,{'dataTransfer':_0x41a800});_0x5913f3['_forceMarkersCopy']('comment',()=>{_0x3fd2b5['document']['fire']('copy',_0x28aa39);}),this['_formView']||(this['_initView'](),this['_aiAssistantController']=new j(_0x7777f1,this['_aiAdapter']['textAdapter'],this['_formView']));let _0x14db94=_0x41a800['getData']('text/html');const _0x108aa0=_0x7777f1['model']['document']['selection'],_0x28d99c=Array['from'](_0x108aa0['getRanges']());0x1===_0x28d99c['length']&&_0x28d99c[0x0]['isFlat']&&!_0x108aa0['getSelectedElement']()&&''!==_0x14db94['replace'](/ /g,'')['trim']()&&(_0x14db94='<p>'+_0x14db94+'</p>'),this['_aiAssistantController']['updateView']({'actionId':_0x5c90a5,'query':_0x1cda8f,'htmlContent':_0x14db94,'label':_0x7dbd04,'mainActionLabel':_[_0x7777f1['model']['document']['selection']['isCollapsed']?'INSERT':'REPLACE']}),'aiAssistant'!==this['_dialog']['id']?this['_dialog']['show']({'id':'aiAssistant','icon':_0x13a90c,'title':Fn(this['editor']['locale'],'AI\x20Assistant'),'content':this['_formView'],'position':_0x5b2f5d['EDITOR_TOP_SIDE'],'onShow':()=>{this['_formView']['focus']();},'onHide':()=>{this['_aiAssistantController']['reset'](),_0x2c0c51['hideFakeVisualSelection']();}}):this['_dialog']['view']['wasMoved']||this['_dialog']['view']['updatePosition']();}['hideUI'](){this['_dialog']['hide']();}['_getResolvedCommandsDefinitions'](){const _0x57a207=new Map(),_0x2094ea=o(this['editor']['config']['get']('ai.assistant.commands'),this['editor']['locale']);for(const _0x1ee27c of _0x2094ea)for(const _0x5a9a20 of _0x1ee27c['commands'])_0x57a207['set'](_0x5a9a20['id'],{..._0x5a9a20,'groupId':_0x1ee27c['groupId'],'groupLabel':_0x1ee27c['groupLabel']||_0x1ee27c['groupId']});return _0x57a207;}['_createAIAssistantUIButton'](_0x32e32a){const _0x45685f=this['editor'],_0x51c9e5=_0x45685f['commands']['get']('showAIAssistant'),_0x1f2c98=new _0x32e32a(_0x45685f['locale']);return _0x1f2c98['set']({'label':Fn(_0x45685f['locale'],'AI\x20Assistant'),'icon':_0x13a90c,'isToggleable':!0x0}),_0x1f2c98['bind']('isEnabled')['to'](_0x51c9e5),_0x1f2c98['bind']('isOn')['to'](this['_dialog'],'id',_0x2ae5e4=>'aiAssistant'===_0x2ae5e4),this['listenTo'](_0x1f2c98,'execute',()=>{_0x1f2c98['isOn']?this['hideUI']():_0x51c9e5['execute']();}),_0x1f2c98;}['_initView'](){const _0x87b29=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',()=>{_0x87b29['insertContent'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['listenTo'](this['_formView'],'insertContentBelow',()=>{_0x87b29['insertContentBelow'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['_initAriaAiStatusChangeAnnouncements']();}['_initAriaAiStatusChangeAnnouncements'](){const {locale:_0x1837d0,ui:{ariaLiveAnnouncer:_0x3db80f}}=this['editor'];this['_formView']['contentArea']['on']('change:isProcessing',(_0x4b2191,_0x188986,_0x43b2de)=>{const _0x30a2f1=this['_aiAssistantController']['currentContext'];_0x43b2de?_0x3db80f['announce'](Fn(_0x1837d0,'AI\x20is\x20writing')):_0x30a2f1&&_0x3db80f['announce'](Fn(_0x1837d0,'Generated\x20content:\x20%0',_0x30a2f1),{'politeness':'polite','isUnsafeHTML':!0x0});}),this['_formView']['on']('change:isError',(_0x25d18a,_0x2519ed,_0x218d86)=>{if(_0x218d86){const _0x11c5ec=this['_formView']['errorView']['text'];_0x3db80f['announce'](Fn(_0x1837d0,'Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x11c5ec));}});}['_onExecute'](_0x497f16){const _0xedf7c8=this['_commandDefinitions']['get'](_0x497f16),_0x90c4e5=this['editor'],_0x40b243=_0x90c4e5['model']['document']['selection'],_0x27ee72=_0x90c4e5['commands']['get']('showAIAssistant'),_0x10b19b=_0x90c4e5['plugins']['get'](a),_0x261519=''+(_0xedf7c8['groupId']!==x?_0xedf7c8['groupLabel']+':\x20':'')+_0xedf7c8['label'];if(!0x1!==_0xedf7c8['requiresContent']&&_0x40b243['isCollapsed']){const _0x5004c8=_0x382588(_0x40b243['getSelectedBlocks']())||_0x90c4e5['model']['schema']['getLimitElement'](_0x40b243);_0x90c4e5['model']['change'](_0x6d40c7=>{_0x6d40c7['setSelection'](_0x5004c8,'in');});}_0x10b19b['showFakeVisualSelection'](),_0x27ee72['execute'](_0xedf7c8['prompt'],_0x261519,'command:'+_0x497f16);}['_populateMenuBarMenu'](_0x5ac65b,_0x2dc3c3,_0x161b50,_0x7e8295){const _0x2cf712=this['editor'],_0x25c4c9=_0x2cf712['locale'],_0x425b81=new _0x582101(_0x25c4c9),_0x3afdd9=B(_0x2cf712,_0x161b50)['filter'](_0x2e4796=>_0x2e4796['commands']['length']);0x1===_0x3afdd9['length']?this['_getMenuBarGroupButtons']({'command':_0x5ac65b,'commands':_0x3afdd9[0x0]['commands'],'parentMenuView':_0x2dc3c3,'onExecute':_0x7e8295})['forEach'](_0x210702=>_0x425b81['items']['add'](_0x210702)):_0x3afdd9['forEach'](({groupId:_0x1702e3,groupLabel:_0x1935ba,commands:_0x54bd5f})=>{const _0x38815a=new _0x3da97b(_0x25c4c9,_0x2dc3c3),_0x5f339f=new _0x18d714(_0x25c4c9),_0x2bc2a2=new _0x582101(_0x25c4c9),_0x3e7c9b=this['_getMenuBarGroupButtons']({'command':_0x5ac65b,'commands':_0x54bd5f,'parentMenuView':_0x5f339f,'onExecute':_0x7e8295});_0x5f339f['buttonView']['set']({'label':_0x1935ba||_0x1702e3}),_0x5f339f['delegate']('execute')['to'](_0x2dc3c3),_0x2bc2a2['items']['addMany'](_0x3e7c9b),_0x5f339f['panelView']['children']['add'](_0x2bc2a2),_0x38815a['children']['add'](_0x5f339f),_0x425b81['items']['add'](_0x38815a);}),_0x2dc3c3['panelView']['children']['add'](_0x425b81);}['_getMenuBarGroupButtons']({command:_0x5a8c84,commands:_0x44ed41,parentMenuView:_0x32d88e,onExecute:_0x3b9602}){const _0x27e375=this['editor'],_0x1f382c=_0x27e375['locale'];return B(_0x27e375,_0x44ed41)['map'](_0x46a12c=>{const _0x5a75da=new _0x3da97b(_0x1f382c,_0x32d88e),_0x1976a1=new _0x2a3f0d(_0x1f382c);return _0x1976a1['set']({'label':_0x46a12c['label']}),_0x1976a1['delegate']('execute')['to'](_0x32d88e),_0x1976a1['on']('execute',()=>_0x3b9602(_0x46a12c['id'])),_0x1976a1['bind']('isEnabled')['to'](_0x5a8c84,'enabledCommandsIds',_0x2ff374=>_0x2ff374['includes'](_0x46a12c['id'])),_0x5a75da['children']['add'](_0x1976a1),_0x5a75da;});}}function U(_0x260198,_0x1014c9){return void 0x0!==_0x260198['order']&&void 0x0===_0x1014c9['order']?0x1:void 0x0===_0x260198['order']&&void 0x0!==_0x1014c9['order']?-0x1:void 0x0!==_0x260198['order']&&void 0x0!==_0x1014c9['order']?_0x260198['order']-_0x1014c9['order']:0x0;}function B(_0xf35ddb,_0x59e7b1){_0x59e7b1['sort'](U);const _0x384fac={},_0x4b8b6d=[];for(const _0x31cd76 of _0x59e7b1)if(void 0x0!==_0x31cd76['order']){if(_0x31cd76['order']in _0x384fac)throw new _0x2ae61f('ai-commands-config-order-collision',_0xf35ddb,{'conflictingDefinitions':[_0x31cd76,_0x384fac[_0x31cd76['order']]]});_0x384fac[_0x31cd76['order']]=_0x31cd76,_0x4b8b6d['splice'](_0x31cd76['order'],0x0,_0x31cd76);}else _0x4b8b6d['push'](_0x31cd76);return _0x4b8b6d;}class AIAssistant extends _0x2b80c4{static get['requires'](){return[n,a];}static get['pluginName'](){return'AIAssistant';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x3ba450){super(_0x3ba450);const _0x5600c9=_0x3ba450['config'],_0x53bf21=_0x3ba450['locale'];_0x5600c9['define']('ai.assistant.preserveComments',!0x0),_0x5600c9['define']('ai.assistant.commands',Wn(_0x53bf21)),_0x5600c9['define']('ai.assistant.extraCommandGroups',[]),_0x5600c9['define']('ai.assistant.removeCommands',[]);let _0x4b35d1=o(_0x5600c9['get']('ai.assistant.commands'),_0x53bf21);const _0x153eda=_0x5600c9['get']('ai.assistant.extraCommandGroups'),_0x53a94c=_0x5600c9['get']('ai.assistant.removeCommands');_0x153eda['forEach'](_0x23bbc4=>{const _0x4b8fc0=_0x4b35d1['find'](_0x136244=>_0x136244['groupId']===_0x23bbc4['groupId']);_0x4b8fc0?_0x4b8fc0['commands']=_0x4b8fc0['commands']['concat'](_0x23bbc4['commands']):_0x4b35d1['push'](_0x23bbc4);}),_0x4b35d1=_0x4b35d1['filter'](_0x89434a=>!_0x53a94c['includes'](_0x89434a['groupId'])),_0x4b35d1['forEach'](_0x4e526b=>{_0x4e526b['commands']=_0x4e526b['commands']['filter'](_0x587bde=>!_0x53a94c['includes'](_0x587bde['id']));}),_0x5600c9['set']('ai.assistant.commands',_0x4b35d1);}}function Wn(_0x45b7de){return[{'groupId':'editOrReview','groupLabel':Fn(_0x45b7de,'Edit\x20or\x20review'),'commands':[{'id':'improveWriting','label':Fn(_0x45b7de,'Improve\x20writing'),'prompt':'Fix\x20spelling\x20mistakes,\x20use\x20proper\x20grammar\x20and\x20apply\x20good\x20writing\x20practices.\x20Do\x20not\x20lose\x20the\x20original\x20meaning.'},{'id':'makeShorter','label':Fn(_0x45b7de,'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(_0x45b7de,'Make\x20longer'),'prompt':'Improve\x20this\x20content\x20by\x20using\x20descriptive\x20language\x20and\x20inserting\x20more\x20information\x20and\x20more\x20detailed\x20explanations.'},{'id':'simplifyLanguage','label':Fn(_0x45b7de,'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(_0x45b7de,'Generate\x20from\x20selection'),'commands':[{'id':'summarize','label':Fn(_0x45b7de,'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(_0x45b7de,'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(_0x45b7de,'Change\x20tone'),'commands':[{'id':'professional','label':Fn(_0x45b7de,'Professional'),'prompt':'Improve\x20using\x20polished,\x20formal,\x20and\x20respectful\x20language\x20to\x20convey\x20professional\x20expertise\x20and\x20competence.'},{'id':'casual','label':Fn(_0x45b7de,'Casual'),'prompt':'Improve\x20using\x20casual,\x20informal\x20language\x20to\x20convey\x20a\x20casual\x20conversation\x20with\x20a\x20real\x20person.'},{'id':'direct','label':Fn(_0x45b7de,'Direct'),'prompt':'Improve\x20using\x20direct\x20language,\x20using\x20only\x20the\x20essential\x20information.'},{'id':'confident','label':Fn(_0x45b7de,'Confident'),'prompt':'Improve\x20using\x20compelling,\x20optimistic\x20language\x20to\x20convey\x20confidence\x20in\x20the\x20writing.'},{'id':'friendly','label':Fn(_0x45b7de,'Friendly'),'prompt':'Improve\x20using\x20friendly,\x20comforting\x20language,\x20to\x20convey\x20understanding\x20and\x20empathy.'}]},{'groupId':'changeStyle','groupLabel':Fn(_0x45b7de,'Change\x20style'),'commands':[{'id':'business','label':Fn(_0x45b7de,'Business'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20business\x20professional\x20with\x20formal\x20language.'},{'id':'legal','label':Fn(_0x45b7de,'Legal'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20legal\x20professional\x20using\x20valid\x20legal\x20terminology.'},{'id':'journalism','label':Fn(_0x45b7de,'Journalism'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20journalist\x20using\x20engaging\x20language\x20to\x20convey\x20the\x20importance\x20of\x20the\x20information.'},{'id':'poetic','label':Fn(_0x45b7de,'Poetic'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20poem\x20using\x20poetic\x20techniques\x20without\x20losing\x20the\x20original\x20meaning.'}]},{'groupId':'translate','groupLabel':Fn(_0x45b7de,'Translate'),'commands':[{'id':'translateEnglish','label':Fn(_0x45b7de,'English'),'prompt':'Translate\x20the\x20content\x20to\x20English\x20language.'},{'id':'translateSpanish','label':Fn(_0x45b7de,'Spanish'),'prompt':'Translate\x20the\x20content\x20to\x20Spanish\x20language.'},{'id':'translatePortuguese','label':Fn(_0x45b7de,'Portuguese'),'prompt':'Translate\x20the\x20content\x20to\x20Portuguese\x20language.'},{'id':'translateGerman','label':Fn(_0x45b7de,'German'),'prompt':'Translate\x20the\x20content\x20to\x20German\x20language.'},{'id':'translateFrench','label':Fn(_0x45b7de,'French'),'prompt':'Translate\x20the\x20content\x20to\x20French\x20language.'},{'id':'translateChinese','label':Fn(_0x45b7de,'Simplified\x20Chinese'),'prompt':'Translate\x20the\x20content\x20to\x20Simplified\x20Chinese\x20language.'},{'id':'translateHindi','label':Fn(_0x45b7de,'Hindi'),'prompt':'Translate\x20the\x20content\x20to\x20Hindi\x20language.'},{'id':'translateArabic','label':Fn(_0x45b7de,'Arabic'),'prompt':'Translate\x20the\x20content\x20to\x20Arabic\x20language.'}]}];}class ar extends _0x2b80c4{['abortController'];static get['requires'](){return[K];}constructor(_0xbd8dc1){super(_0xbd8dc1),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'](_0x4d6df1){return this['sendRequest'](_0x4d6df1)['catch'](_0x5431fb=>{if(_0x5431fb instanceof er)return Promise['reject'](_0x5431fb);if('AbortError'==_0x5431fb['name'])return Promise['resolve']();throw console['error'](_0x5431fb),new _0x2ae61f('aitextadapter-send-request-failed',null);});}async['_prepareRequestHeaders'](_0x4eeb26,_0x34968e){const _0x2bd466=this['editor']['locale'],_0x53ce60={'Content-Type':'application/json'};if('object'==typeof _0x4eeb26)Object['assign'](_0x53ce60,_0x4eeb26);else{if(_0x4eeb26)try{const _0x3474c4=await _0x4eeb26(_0x34968e);Object['assign'](_0x53ce60,_0x3474c4);}catch{return Promise['reject'](new er(Fn(_0x2bd466,'AI_ERROR_GET_HEADERS')));}}return _0x53ce60;}async['_prepareRequestParameters'](_0x425a9,_0x138247){const _0x444255=this['editor']['locale'];if('object'==typeof _0x425a9)return _0x425a9;try{return await _0x425a9(_0x138247);}catch{return Promise['reject'](new er(Fn(_0x444255,'AI_ERROR_GET_PARAMETERS')));}}}class OpenAITextAdapter extends ar{['_apiUrl'];['_requestHeaders'];['_requestParameters'];static get['pluginName'](){return'OpenAITextAdapter';}constructor(_0x103513){super(_0x103513),_0x103513['config']['define']('ai.assistant.adapter.openAI.apiUrl','https://api.openai.com/v1/chat/completions'),_0x103513['config']['get']('ai.assistant.adapter.openAI.requestParameters')||_0x103513['config']['define']('ai.assistant.adapter.openAI.requestParameters',{'model':'gpt-4o','temperature':0x1,'top_p':0x1,'stream':!0x0}),this['_apiUrl']=_0x103513['config']['get']('ai.assistant.adapter.openAI.apiUrl'),this['_requestHeaders']=_0x103513['config']['get']('ai.assistant.adapter.openAI.requestHeaders')||{},this['_requestParameters']=_0x103513['config']['get']('ai.assistant.adapter.openAI.requestParameters');}async['sendRequest']({query:_0x2d97d1,context:_0x270ecd,onData:_0x252ae2,actionId:_0x5941c7}){const _0x269c16=this['editor']['locale'],_0x516f47=await this['prepareMessages'](_0x2d97d1,_0x270ecd,_0x5941c7),_0x30276e=await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x5941c7),_0xc33d88=await this['_prepareRequestParameters'](this['_requestParameters'],_0x5941c7),_0x3384a5={'messages':_0x516f47,..._0xc33d88},_0x2e3f4a={'method':'POST','headers':_0x30276e,'body':JSON['stringify'](_0x3384a5),'signal':this['abortController']['signal']},_0x30e3d8=await fetch(this['_apiUrl'],_0x2e3f4a);if(_0x30e3d8['ok'])return _0xc33d88['stream']?await this['_readStreamableResponse'](_0x30e3d8,_0x252ae2):await this['_readStaticResponse'](_0x30e3d8,_0x252ae2),Promise['resolve']();{const _0x5dccd9=await _0x30e3d8['text']();return _0x5dccd9['includes']('context_length_exceeded')?Promise['reject'](new er(Fn(_0x269c16,'AI_ERROR_CONTEXT_LENGTH'))):_0x5dccd9['includes']('Moderation')?Promise['reject'](new er(Fn(_0x269c16,'AI_ERROR_MODERATION'))):Promise['reject'](new Error(_0x5dccd9));}}async['prepareMessages'](_0x36d625,_0xf0b126,_0xe98cec){let _0x5c897a,_0xde4662;return _0xf0b126?(_0x5c897a='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.',_0xde4662='Instruction:\x0a'+_0x36d625+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0xf0b126):(_0x5c897a='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.',_0xde4662=_0x36d625),[{'role':'system','content':_0x5c897a},{'role':'user','content':_0xde4662}];}async['_readStreamableResponse'](_0x481c05,_0x561c44){const _0x1c7c01=_0x481c05['body']['getReader'](),_0x210237=new TextDecoder();let _0x16754a='',_0x4e92b0='',_0x4d2d67='',_0x1e9047=!0x1;for(;!_0x1e9047;){const {done:_0x1b1b90,value:_0x56abca}=await _0x1c7c01['read'](),_0x2fa0df=_0x16754a+_0x210237['decode'](_0x56abca);let _0xcd0803='';_0x1e9047=_0x1b1b90;try{_0xcd0803=this['_cleanUpData'](_0x2fa0df),_0x16754a='';}catch{_0x16754a=_0x2fa0df;continue;}_0x4e92b0+=_0xcd0803,!_0x1e9047&&this['_isBufferIncomplete'](_0x4e92b0)||_0x4e92b0&&(_0x4d2d67+=_0x4e92b0,_0x4e92b0='',_0x561c44(_0x4d2d67));}return Promise['resolve']();}async['_readStaticResponse'](_0x2e5407,_0x23261f){return _0x23261f((await _0x2e5407['json']())['choices'][0x0]['message']['content']),Promise['resolve']();}['_isBufferIncomplete'](_0x46e2ff){const _0x533c7e=_0x46e2ff['split']('<')['length']!==_0x46e2ff['split']('>')['length'],_0x47dbc2=_0x46e2ff['length']<0x1e;return _0x533c7e&&_0x47dbc2;}['_cleanUpData'](_0x708ebf){return _0x708ebf['split'](/\n(?![^{]*\})/g)['map'](_0x4fe69a=>_0x4fe69a['replace']('data:\x20',''))['filter'](_0x53da1a=>_0x53da1a&&_0x53da1a['length']>0x0&&'[DONE]'!==_0x53da1a)['map'](_0x18dbd4=>{const {choices:_0x474fc2}=JSON['parse'](_0x18dbd4);if(_0x474fc2[0x0]?.['delta']?.['content'])return _0x474fc2[0x0]['delta']['content'];})['filter'](_0x5a4f34=>_0x5a4f34)['join']('');}}class AWSTextAdapter extends ar{static get['pluginName'](){return'AWSTextAdapter';}['init'](){super['init'](),_0x4bc23b('ai-aws-adapter-not-supported');}async['sendRequest'](_0x4e3404){throw gt('ai-aws-adapter-not-supported'),new er(Fn(this['editor']['locale'],'AI_ERROR_AWS_NOT_SUPPORTED'));}}class ia extends _0x4421de{constructor(_0x32e2d2,_0x1b08db={}){super(_0x32e2d2),this['isToggleable']=!0x0,this['set']('side',_0x1b08db['side']||'top');const _0x10faa9=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-tab-button',..._0x34cea5(_0x1b08db['class']||[]),_0x10faa9['to']('side',_0x10873a=>'ck-tab-button_'+_0x10873a),_0x10faa9['to']('class')]}});}['show'](){this['set']('isVisible',!0x0);}['hide'](){this['set']('isVisible',!0x1);}}class ea extends _0x3ddefc{['children'];constructor(_0x1e93c6,_0x3ae2ca={}){super(_0x1e93c6);const _0x998a9c=this['bindTemplate'];this['set']('isVisible',!0x1),this['set']('class',''),this['children']=this['createCollection'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck-tab-panel',..._0x34cea5(_0x3ae2ca['class']||[]),_0x998a9c['to']('class'),_0x998a9c['if']('isVisible','ck-hidden',_0x5842a8=>!_0x5842a8)]},'children':this['children']});}['show'](){this['set']('isVisible',!0x0);}['hide'](){this['set']('isVisible',!0x1);}}class ss extends _0x3ddefc{['buttonViews']=this['createCollection']();['panelViews']=this['createCollection']();['_tabs']=new Map();constructor(_0x2e5402,_0x45dce3={}){super(_0x2e5402),this['set']('class',void 0x0),this['set']('activeTab',null),this['set']('side',_0x45dce3['side']||'top'),this['set']('isMaximized',!0x1);const _0x2142f9=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset','ck-tabs',..._0x34cea5(_0x45dce3['class']||[]),_0x2142f9['to']('side',_0x1017ee=>'ck-tabs_'+_0x1017ee),_0x2142f9['to']('class'),_0x2142f9['to']('isMaximized',_0x468802=>_0x468802?'ck-ai-tabs_maximized':'')],'tabindex':'0'},'children':[{'tag':'div','attributes':{'class':['ck','ck-tabs__buttons-container',_0x2142f9['to']('side',_0x3bec40=>'ck-tabs__buttons-container_'+_0x3bec40)]},'children':this['buttonViews']},{'tag':'div','attributes':{'class':['ck','ck-tabs__panels-container',_0x2142f9['to']('side',_0xb86998=>'ck-tabs__panels-container_'+_0xb86998)]},'children':this['panelViews']},..._0x34cea5(_0x45dce3['children']||[])]});}['getTabIds'](){return[...this['_tabs']['keys']()];}['getTab'](_0x10ca4a){const _0x497dc4=this['_tabs']['get'](_0x10ca4a);return _0x497dc4||null;}['addTab'](_0x23c2d8){const _0x3443=this['_setupButton']({'id':_0x23c2d8['id'],'label':_0x23c2d8['buttonLabel'],'icon':_0x23c2d8['buttonIcon'],'order':_0x23c2d8['order']}),_0x173cc0=new ea(this['locale']);return _0x173cc0['render'](),_0x23c2d8['content']&&_0x173cc0['children']['add'](_0x23c2d8['content']),this['panelViews']['add'](_0x173cc0),this['_tabs']['set'](_0x23c2d8['id'],{'button':_0x3443,'panel':_0x173cc0,'order':void 0x0!==_0x23c2d8['order']?_0x23c2d8['order']:null}),this['fire']('addTab:'+_0x23c2d8['id'],{'id':_0x23c2d8['id'],'button':_0x3443,'panel':_0x173cc0}),null===this['activeTab']?this['activateTab'](_0x23c2d8['id']):this['_hidePanel'](_0x23c2d8['id']),{'button':_0x3443,'panel':_0x173cc0};}['activateTab'](_0x778426){if(null!==_0x778426&&!this['getTab'](_0x778426))throw new _0x2ae61f('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0x778426});this['activeTab']!==_0x778426&&(this['activeTab']&&this['_hidePanel'](this['activeTab']),this['activeTab']=_0x778426,_0x778426&&this['_showPanel'](_0x778426),this['fire']('activateTab:'+_0x778426,_0x778426));}['showTab'](_0x41f872){if(!this['getTab'](_0x41f872))throw new _0x2ae61f('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0x41f872});this['_showPanel'](_0x41f872),this['_showButton'](_0x41f872),this['fire']('show:'+_0x41f872,_0x41f872);}['hideTab'](_0x343821){if(!this['getTab'](_0x343821))throw new _0x2ae61f('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0x343821});const _0x186c5d=this['activeTab'];this['_hidePanel'](_0x343821),this['_hideButton'](_0x343821);const _0x2b0ae7=this['getTabIds']();_0x186c5d===_0x343821&&_0x2b0ae7['length']>0x1&&this['activateTab'](_0x2b0ae7['find'](_0x1d2fa2=>_0x1d2fa2!==_0x343821)),this['fire']('hide:'+_0x343821,_0x343821);}['_getPanel'](_0xdaf69e){const _0x5466f2=this['_tabs']['get'](_0xdaf69e);return _0x5466f2?_0x5466f2['panel']:null;}['_showPanel'](_0x3b6d09){null!==this['activeTab']&&this['activeTab']!==_0x3b6d09||this['_getPanel'](_0x3b6d09)['show']();}['_hidePanel'](_0x3dd58f){const _0x128197=this['_getPanel'](_0x3dd58f);_0x128197['isVisible']&&(this['activeTab']===_0x3dd58f&&(this['activeTab']=null),_0x128197['hide']());}['_getButton'](_0x380835){const _0x58682d=this['_tabs']['get'](_0x380835);return _0x58682d?_0x58682d['button']:null;}['_showButton'](_0x28f2a6){this['_getButton'](_0x28f2a6)['show']();}['_hideButton'](_0x23b420){this['_getButton'](_0x23b420)['hide']();}['_setupButton'](_0x1616dd){const _0x2c1424=new ia(this['locale'],{'side':this['side']}),_0x204276=this['buttonViews'];if(_0x2c1424['set']({'label':_0x1616dd['label'],'icon':_0x1616dd['icon'],'tooltip':!0x0,'withText':!0x0}),_0x2c1424['bind']('isOn')['to'](this,'activeTab',_0x4d2184=>_0x4d2184===_0x1616dd['id']),_0x2c1424['bind']('side')['to'](this,'side'),_0x1616dd['order']){const _0x5efd25=[...this['_tabs']]['reduce']((_0x3b0d50,_0x55abb3)=>{const _0x2422fc=_0x55abb3[0x0],{order:_0x570632}=_0x55abb3[0x1];return!_0x570632||_0x570632>_0x1616dd['order']?_0x3b0d50:_0x570632>=_0x3b0d50['order']?{'id':_0x2422fc,'order':_0x570632}:_0x3b0d50;},{'id':'','order':0x0}),_0x2bfbba=_0x204276['getIndex'](this['_getButton'](_0x5efd25['id']));_0x204276['add'](_0x2c1424,_0x2bfbba+0x1);}else _0x204276['add'](_0x2c1424);return _0x2c1424['on']('execute',()=>{this['activateTab'](_0x1616dd['id']);}),_0x2c1424;}}const ni=['overlay','sidebar','custom'],oi=['left','right'];class hi extends ss{constructor(_0x22e867,_0x8a1845={}){super(_0x22e867,_0x8a1845),this['set']('type',_0x8a1845['type']||'sidebar'),this['set']('side',_0x8a1845['side']||'right'),this['set']('isVisible',_0x8a1845['visibleByDefault']??!0x0);const _0x2fbea8=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-tabs',_0x2fbea8['if']('type','ck-ai-tabs__overlay',_0x4d8c1e=>'overlay'===_0x4d8c1e),_0x2fbea8['if']('type','ck-ai-tabs__sidebar',_0x484997=>'sidebar'===_0x484997),_0x2fbea8['if']('isVisible','ck-hidden',_0x531a57=>!_0x531a57)]}}),this['buttonViews']['on']('add',(_0x350b6f,_0x163907)=>{_0x163907['set']('withText',!0x1);});}}class pt extends _0x3b66f2{['view'];['container']=null;['showResizeButton']=!0x0;static get['pluginName'](){return'AITabs';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x5b7501){super(_0x5b7501);const _0x36108b=this['context']['config']['get']('ai.container');if(this['set']('side','right'),!_0x36108b)throw new _0x2ae61f('ai-tabs-configuration-not-found');if(void 0x0!==_0x36108b['showResizeButton']&&(this['showResizeButton']=_0x36108b['showResizeButton']),'sidebar'!==_0x36108b['type']&&'overlay'!==_0x36108b['type']||_0x36108b['side']&&(this['side']=_0x36108b['side']),'sidebar'===_0x36108b['type']){if(this['container']=_0x36108b['element'],this['set']('type','sidebar'),!this['container'])throw new _0x2ae61f('ai-tabs-sidebar-container-element-not-found');}else'overlay'===_0x36108b['type']?(this['container']=document['body'],this['set']('type','overlay')):(this['container']=null,this['set']('type','custom'));this['view']=new hi(this['context']['locale'],{'side':this['side'],'type':this['type'],'visibleByDefault':void 0x0===_0x36108b['visibleByDefault']||_0x36108b['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 dt&&this['context']['ui']['focusTracker']['add'](this['view']['element']);}['switchType'](_0x2dd693){if(_0x2dd693&&this['type']!==_0x2dd693){if(!ni['includes'](_0x2dd693))throw new _0x2ae61f('ai-tabs-unsupported-ui-type');this['type']=_0x2dd693;}}['switchSide'](_0x397828){if(_0x397828&&this['side']!==_0x397828){if(!oi['includes'](_0x397828))throw new _0x2ae61f('ai-tabs-unsupported-ui-side');this['side']=_0x397828;}}['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 q extends _0x3b66f2{['_apiUrl'];['_token'];['_decoder'];static get['requires'](){return['CloudServices'];}static get['pluginName'](){return'AIConnector';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0xcc0d77){super(_0xcc0d77),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 _0xc5981=this['context']['plugins']['get']('CloudServices');if(!_0xc5981['token'])throw new _0x2ae61f('ai-missing-token',this);this['_token']=_0xc5981['token'];}['startConversation'](_0x19de0f,_0x312d1d){const _0x4840ad=this['_sendApiRequest']('/conversations','POST',{'id':_0x19de0f,'group':_0x312d1d});return{'getConversation':async()=>(await _0x4840ad['request'])['json'](),'abortController':_0x4840ad['abortController']};}['queryAssistant']({message:_0xb8f895,conversationId:_0x5583e6,parts:_0x2fe955,capabilities:_0x4dc62d,model:_0x581be4,attributes:_0x4ec782}){const _0x15def0={'prompt':_0xb8f895,'content':_0x2fe955,'model':_0x581be4,..._0x4dc62d&&{'capabilities':_0x4dc62d},..._0x4ec782&&{'attributes':_0x4ec782}},_0x40063a=this['_sendApiRequest']('/conversations/'+_0x5583e6+'/messages','POST',_0x15def0);return{'getStream':async()=>{const _0x613b9a=(await _0x40063a['request'])['body'];return this['_getStreamReader'](_0x613b9a);},'abortController':_0x40063a['abortController']};}['executeCustomAction']({content:_0x11b1d0,message:_0x1007c7,model:_0x50d37c,outputFormat:_0x3e66ce}){const _0x3a1102={'content':[{'type':'text','content':_0x11b1d0}],'prompt':_0x1007c7,'model':_0x50d37c,'outputFormat':_0x3e66ce},_0xbf69f7=this['_sendApiRequest']('/actions/custom/calls','POST',_0x3a1102);return{'getStream':async()=>{const _0x46ad74=(await _0xbf69f7['request'])['body'];return this['_getStreamReader'](_0x46ad74);},'abortController':_0xbf69f7['abortController']};}['executeAction']({actionName:_0x1b0074,content:_0x592fc9,args:_0x1e82ce}){const _0x504c83={'content':[{'type':'text','content':_0x592fc9}],'args':_0x1e82ce},_0x28b3b1=this['_sendApiRequest']('/actions/system/'+_0x1b0074+'/calls','POST',_0x504c83);return{'getStream':async()=>{const _0x1d26c7=(await _0x28b3b1['request'])['body'];return this['_getStreamReader'](_0x1d26c7);},'abortController':_0x28b3b1['abortController']};}['uploadFile'](_0x809be3,_0x334742,_0xb23281){const _0x7b15cb=new FormData();_0x7b15cb['append']('file',_0x334742,_0x334742['name']),_0xb23281&&_0x7b15cb['append']('attributes',JSON['stringify'](_0xb23281));const _0x209713=this['_sendApiRequest']('/conversations/'+_0x809be3+'/files','POST',_0x7b15cb);return{'getId':async()=>(await _0x209713['request'])['json'](),'abortController':_0x209713['abortController']};}['fetchDocument'](_0x2ec487,_0xc110dd){const _0x16b319=this['_sendApiRequest']('/conversations/'+_0x2ec487+'/documents/'+_0xc110dd,'GET');return{'getDocument':async()=>(await _0x16b319['request'])['json'](),'abortController':_0x16b319['abortController']};}['uploadDocument'](_0x2801db,_0x570675,_0xe514ae){const _0x5bbad6={'content':_0x570675};_0xe514ae&&(_0x5bbad6['attributes']=_0xe514ae);const _0x2f4dc1=this['_sendApiRequest']('/conversations/'+_0x2801db+'/documents','POST',_0x5bbad6);return{'getId':async()=>(await _0x2f4dc1['request'])['json'](),'abortController':_0x2f4dc1['abortController']};}['fetchConversations'](_0x14881c,_0x22b25c={}){const _0x5f1acc=new URLSearchParams();_0x5f1acc['append']('group',_0x14881c),_0x5f1acc['append']('excludeEmpty',!0x1!==_0x22b25c['excludeEmpty']?'true':'false'),_0x5f1acc['append']('limit',_0x22b25c['limit']?_0x22b25c['limit']['toString']():'100'),_0x5f1acc['append']('sortBy',_0x22b25c['sortBy']?_0x22b25c['sortBy']:'createdAt'),_0x5f1acc['append']('order',_0x22b25c['order']?_0x22b25c['order']:'desc');const _0xec1b9e=this['_sendApiRequest']('/conversations?'+_0x5f1acc['toString'](),'GET');return{'getConversations':async()=>{const _0x36ee3=await _0xec1b9e['request'];return(await _0x36ee3['json']())['items'];},'abortController':_0xec1b9e['abortController']};}['deleteConversation'](_0x2b8483){const _0x2c7aa7=this['_sendApiRequest']('/conversations/'+_0x2b8483,'DELETE');return{'execute':async()=>{await _0x2c7aa7['request'];},'abortController':_0x2c7aa7['abortController']};}['updateConversation'](_0xc53dfd,_0x4eee64){const _0x263eaf=this['_sendApiRequest']('/conversations/'+_0xc53dfd,'PATCH',_0x4eee64);return{'getResult':async()=>(await _0x263eaf['request'],_0x4eee64),'abortController':_0x263eaf['abortController']};}['fetchConversation'](_0x3d09a8){const _0xf8cd9b=this['_sendApiRequest']('/conversations/'+_0x3d09a8,'GET');return{'getConversation':async()=>(await _0xf8cd9b['request'])['json'](),'abortController':_0xf8cd9b['abortController']};}['fetchConversationMessages'](_0x2d21c8){const _0x46151a=this['_sendApiRequest']('/conversations/'+_0x2d21c8+'/messages','GET');return{'getMessages':async()=>{const _0x2e4bf9=await _0x46151a['request'];return(await _0x2e4bf9['json']())['items'];},'abortController':_0x46151a['abortController']};}['uploadUrl'](_0x38ccd7,_0x206b63,_0x48109d){const _0x4249c2=this['_sendApiRequest']('/conversations/'+_0x38ccd7+'/web-resources','POST',{'url':_0x206b63,'attributes':_0x48109d});return{'getId':async()=>(await _0x4249c2['request'])['json'](),'abortController':_0x4249c2['abortController']};}['getModels'](_0x4aa379='en'){const _0x4e0254=new URLSearchParams();_0x4e0254['append']('language',_0x4aa379);const _0x4697a5='/models/1?'+_0x4e0254['toString'](),_0x34154b=this['_sendApiRequest'](_0x4697a5,'GET');return{'list':async()=>await(await _0x34154b['request'])['json'](),'abortController':_0x34154b['abortController']};}['deleteFile'](_0x57ea4c,_0x3174a6){const _0x5a105e=this['_sendApiRequest']('/conversations/'+_0x57ea4c+'/files/'+_0x3174a6,'DELETE');return{'execute':async()=>{await _0x5a105e['request'];},'abortController':_0x5a105e['abortController']};}['deleteDocument'](_0x3a1b26,_0x4ebfde){const _0xcca96f=this['_sendApiRequest']('/conversations/'+_0x3a1b26+'/documents/'+_0x4ebfde,'DELETE');return{'execute':async()=>{await _0xcca96f['request'];},'abortController':_0xcca96f['abortController']};}['deleteWebResource'](_0x14631a,_0x106b6d){const _0x56d337=this['_sendApiRequest']('/conversations/'+_0x14631a+'/web-resources/'+_0x106b6d,'DELETE');return{'execute':async()=>{await _0x56d337['request'];},'abortController':_0x56d337['abortController']};}['callSystemReview']({reviewName:_0x54746f,content:_0x263747,args:_0x3cbd23}){const _0x3b1e90=this['_sendApiRequest']('/reviews/system/'+_0x54746f+'/calls','POST',{'content':[{'type':'text','content':_0x263747}],'args':_0x3cbd23});return{'getStream':async()=>{const _0x150d85=(await _0x3b1e90['request'])['body'];return this['_getStreamReader'](_0x150d85);},'abortController':_0x3b1e90['abortController']};}['callCustomReview']({content:_0xb4e54f,prompt:_0x3ba391,model:_0x142cff}){const _0x2f902d=this['_sendApiRequest']('/reviews/custom/calls','POST',{'content':[{'type':'text','content':_0xb4e54f}],'prompt':_0x3ba391,'model':_0x142cff});return{'getStream':async()=>{const _0x104527=(await _0x2f902d['request'])['body'];return this['_getStreamReader'](_0x104527);},'abortController':_0x2f902d['abortController']};}['upsertAIChatRating'](_0x5c0be6,_0x18ab3f,_0x365b62){const _0x4ce281=this['_sendApiRequest']('/conversations/'+_0x5c0be6+'/messages/'+_0x18ab3f+'/ratings','PUT',{'positiveCount':_0x365b62['positiveCount'],'totalCount':_0x365b62['totalCount'],'modificationId':_0x365b62['modificationId']});return{'execute':async()=>{await _0x4ce281['request'];},'abortController':_0x4ce281['abortController']};}['upsertAIActionRating'](_0x280e84,_0x6ae338,_0x4143c4){const _0x4483d6=this['_sendApiRequest']('/actions/system/'+_0x280e84+'/calls/'+_0x6ae338+'/ratings','PUT',{'positiveCount':_0x4143c4['positiveCount'],'totalCount':_0x4143c4['totalCount']});return{'execute':async()=>{await _0x4483d6['request'];},'abortController':_0x4483d6['abortController']};}['upsertCustomAIActionRating'](_0x5c643d,_0x72c7e7){const _0x103396=this['_sendApiRequest']('/actions/custom/calls/'+_0x5c643d+'/ratings','PUT',{'positiveCount':_0x72c7e7['positiveCount'],'totalCount':_0x72c7e7['totalCount']});return{'execute':async()=>{await _0x103396['request'];},'abortController':_0x103396['abortController']};}['upsertAIReviewRating'](_0x196325,_0x41c39d,_0x2b55bf,_0xb464c0){const _0x25b25c=this['_sendApiRequest']('/reviews/system/'+_0x196325+'/calls/'+_0x41c39d+'/ratings','PUT',{'positiveCount':_0x2b55bf['positiveCount'],'totalCount':_0x2b55bf['totalCount'],'dataId':_0xb464c0});return{'execute':async()=>{await _0x25b25c['request'];},'abortController':_0x25b25c['abortController']};}['upsertCustomAIReviewRating'](_0x377f62,_0x4cd7bf,_0x57eb9d){const _0x1185fa=this['_sendApiRequest']('/reviews/custom/calls/'+_0x377f62+'/ratings','PUT',{'positiveCount':_0x4cd7bf['positiveCount'],'totalCount':_0x4cd7bf['totalCount'],'dataId':_0x57eb9d});return{'execute':async()=>{await _0x1185fa['request'];},'abortController':_0x1185fa['abortController']};}['_sendApiRequest'](_0x137efb,_0x47fa91,_0x4ea41d){const _0x5481ff=new AbortController(),_0x3428cf=_0x4ea41d instanceof FormData,_0x2cf36c={'Authorization':'Bearer\x20'+this['_token']?.['value']};_0x4ea41d&&!_0x3428cf&&(_0x2cf36c['Content-Type']='application/json');const _0x1a97a6={'method':_0x47fa91,'headers':_0x2cf36c,'signal':_0x5481ff['signal']};return _0x4ea41d&&(_0x1a97a6['body']=_0x3428cf?_0x4ea41d:JSON['stringify'](_0x4ea41d)),{'request':fetch(''+this['_apiUrl']+_0x137efb,_0x1a97a6)['catch'](_0x335c4a=>{this['_handleError'](_0x335c4a);})['then'](_0x5bf06b=>_0x5bf06b['ok']?_0x5bf06b:_0x5bf06b['json']()['then'](_0x448a60=>{throw{'url':this['_apiUrl'],'path':_0x137efb,'method':_0x47fa91,'body':_0x4ea41d,'status':(_0x5bf06b||{})['status'],'statusText':(_0x5bf06b||{})['statusText'],'code':_0x448a60['code'],'message':_0x448a60['message'],'traceId':_0x448a60['traceId']};})),'abortController':_0x5481ff};}async*['_getStreamReader'](_0x226670){const _0x1f34c1=[],_0x35a52b=_0x226670['getReader'](),_0x176216=$t({'onError':_0x2a0ef1=>{this['_handleError'](_0x2a0ef1);},'onEvent':_0x286c9=>{_0x286c9['data']=JSON['parse'](_0x286c9['data']),_0x1f34c1['push'](_0x286c9);}});try{let _0x38b7c4=!0x1;for(;!_0x38b7c4;){const {done:_0x179a20,value:_0x3afef0}=await _0x35a52b['read']();_0x179a20&&(_0x38b7c4=!0x0),_0x176216['feed'](this['_decoder']['decode'](_0x3afef0,{'stream':!0x0})),yield*_0x1f34c1,_0x1f34c1['length']=0x0;}}catch(_0x3305c2){this['_handleError'](_0x3305c2);}finally{_0x35a52b['releaseLock'](),_0x176216['reset']();}}['_handleError'](_0x43e1cb){if(_0x43e1cb instanceof _0x2ae61f)throw _0x43e1cb;if(_0x43e1cb instanceof Error&&'AbortError'===_0x43e1cb['name'])throw new _0x2ae61f('ai-request-aborted',this,{'originalError':_0x43e1cb});throw new _0x2ae61f('ai-request-failed',this,{'originalError':_0x43e1cb});}}function i(_0x36551a,_0x3f490c,_0xfe05c4){const t=_0x36551a['t'];switch(_0x3f490c){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'},_0xfe05c4);case'AI_SUGGESTION_CONTENT_PART_REJECTED':return t({'id':'AI_SUGGESTION_CONTENT_PART_REJECTED','string':'Change\x20was\x20rejected'});case'AI_SUGGESTION_CONTENT_PART_OUTDATED':return t({'id':'AI_SUGGESTION_CONTENT_PART_OUTDATED','string':'Change\x20is\x20outdated'});case'AI_SUGGESTION_CONTENT_PART_ALREADY_APPLIED':return t({'id':'AI_SUGGESTION_CONTENT_PART_ALREADY_APPLIED','string':'Change\x20is\x20already\x20applied'});case'AI_SUGGESTION_CONTENT_PART_APPLY':return t({'id':'AI_SUGGESTION_CONTENT_PART_APPLY','string':'Apply\x20change'});case'AI_SUGGESTION_CONTENT_PART_ADD_SUGGESTION':return t({'id':'AI_SUGGESTION_CONTENT_PART_ADD_SUGGESTION','string':'Add\x20as\x20suggestion'});case'AI_SUGGESTION_CONTENT_PART_REJECT':return t({'id':'AI_SUGGESTION_CONTENT_PART_REJECT','string':'Reject\x20change'});case'AI_SUGGESTION_CONTENT_PART_REMOVED':return t({'id':'AI_SUGGESTION_CONTENT_PART_REMOVED','string':'Removed\x20content.\x20Use\x20\x22Show\x20details\x22\x20to\x20learn\x20more.'});case'AI_SUGGESTION_CONTENT_PART_STATE_ACCEPTED':return t({'id':'AI_SUGGESTION_CONTENT_PART_STATE_ACCEPTED','string':'Approved'});case'AI_SUGGESTION_CONTENT_PART_STATE_REJECTED':return t({'id':'AI_SUGGESTION_CONTENT_PART_STATE_REJECTED','string':'Rejected'});case'AI_SUGGESTION_CONTENT_PART_STATE_OUTDATED':return t({'id':'AI_SUGGESTION_CONTENT_PART_STATE_OUTDATED','string':'Outdated'});case'AI_DISCLAIMER_TEXT':return t({'id':'AI_DISCLAIMER_TEXT','string':'AI\x20can\x20make\x20mistakes.\x20Please\x20double-check\x20responses.'});case'AI_TABS_LABEL_MAXIMIZE':return t({'id':'AI_TABS_LABEL_MAXIMIZE','string':'Maximize'});case'AI_TABS_LABEL_MINIMIZE':return t({'id':'AI_TABS_LABEL_MINIMIZE','string':'Minimize'});case'AI_CHAT_HEADING':return t({'id':'AI_CHAT_HEADING','string':'Chat'});case'AI_CHAT_SOURCES_HEADER':return t({'id':'AI_CHAT_SOURCES_HEADER','string':'Sources'});case'AI_CHAT_UNTITLED_CONVERSATION':return t({'id':'AI_CHAT_UNTITLED_CONVERSATION','string':'Untitled\x20conversation'});case'AI_CHAT_LABEL_NEW_CHAT':return t({'id':'AI_CHAT_LABEL_NEW_CHAT','string':'New\x20chat'});case'AI_CHAT_STOP_GENERATING':return t({'id':'AI_CHAT_STOP_GENERATING','string':'Stop\x20generating'});case'AI_CHAT_IS_WRITING':return t({'id':'AI_CHAT_IS_WRITING','string':'AI\x20is\x20writing...'});case'AI_CHAT_PROMPT_EMPTY_ERROR':return t({'id':'AI_CHAT_PROMPT_EMPTY_ERROR','string':'This\x20field\x20cannot\x20be\x20empty.'});case'AI_CHAT_LABEL_SUBMIT':return t({'id':'AI_CHAT_LABEL_SUBMIT','string':'Submit'});case'AI_CHAT_WELCOME_MESSAGE':return t({'id':'AI_CHAT_WELCOME_MESSAGE','string':'Hi!\x20I\x20can\x20help\x20you\x20draft,\x20rewrite,\x20and\x20improve\x20your\x20text,\x20explore\x20ideas,\x20research\x20topics,\x20and\x20solve\x20problems.\x20How\x20can\x20I\x20help\x20right\x20now?'});case'AI_CHAT_ABORTED_MESSAGE':return t({'id':'AI_CHAT_ABORTED_MESSAGE','string':'The\x20request\x20was\x20aborted.'});case'AI_CHAT_GENERIC_ERROR':return t({'id':'AI_CHAT_GENERIC_ERROR','string':'Something\x20went\x20wrong\x20while\x20processing\x20your\x20request.\x20Please\x20try\x20again.'});case'AI_CHAT_UNABLE_TO_START_CONVERSATION':return t({'id':'AI_CHAT_UNABLE_TO_START_CONVERSATION','string':'Unable\x20to\x20start\x20conversation.\x20Please\x20make\x20sure\x20you\x20are\x20online\x20and\x20try\x20again.'});case'AI_CHAT_UNABLE_TO_LOAD_CONVERSATION':return t({'id':'AI_CHAT_UNABLE_TO_LOAD_CONVERSATION','string':'Unable\x20to\x20load\x20chosen\x20conversation.\x20Please\x20make\x20sure\x20you\x20are\x20online\x20and\x20try\x20again.'});case'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_FILE':return t({'id':'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_FILE','string':'Failed\x20to\x20upload\x20files:\x20%0.\x20Please\x20try\x20again.'},_0xfe05c4);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.'},_0xfe05c4);case'AI_CHAT_RESOURCE_LOAD_FAILED':return t({'id':'AI_CHAT_RESOURCE_LOAD_FAILED','string':'Failed\x20to\x20load\x20resource.\x20Please\x20try\x20again.'});case'AI_CHAT_CONTEXT_CURRENT_DOCUMENT':return t({'id':'AI_CHAT_CONTEXT_CURRENT_DOCUMENT','string':'Current\x20document'});case'AI_CHAT_CONTEXT_REMOVE_FROM_CONTEXT':return t({'id':'AI_CHAT_CONTEXT_REMOVE_FROM_CONTEXT','string':'Remove\x20from\x20context'});case'AI_CHAT_CONTEXT_ADD_CONTEXT':return t({'id':'AI_CHAT_CONTEXT_ADD_CONTEXT','string':'Add\x20context'});case'AI_CHAT_CONTEXT_URL_LABEL':return t({'id':'AI_CHAT_CONTEXT_URL_LABEL','string':'URL'});case'AI_CHAT_CONTEXT_FILE_LABEL':return t({'id':'AI_CHAT_CONTEXT_FILE_LABEL','string':'File'});case'AI_CHAT_CONTEXT_CURRENT_CONTEXT_LABEL':return t({'id':'AI_CHAT_CONTEXT_CURRENT_CONTEXT_LABEL','string':'Current\x20context'});case'AI_CHAT_CONTEXT_DOCUMENT_SELECTION_LABEL':return t({'id':'AI_CHAT_CONTEXT_DOCUMENT_SELECTION_LABEL','string':'Selected\x20content'});case'AI_CHAT_SEARCH_WEB':return t({'id':'AI_CHAT_SEARCH_WEB','string':'Web\x20search'});case'AI_CHAT_ENABLE_WEB_SEARCH':return t({'id':'AI_CHAT_ENABLE_WEB_SEARCH','string':'Enable\x20web\x20search'});case'AI_CHAT_DISABLE_WEB_SEARCH':return t({'id':'AI_CHAT_DISABLE_WEB_SEARCH','string':'Disable\x20web\x20search'});case'AI_CHAT_REASONING':return t({'id':'AI_CHAT_REASONING','string':'Reasoning'});case'AI_CHAT_ENABLE_REASONING':return t({'id':'AI_CHAT_ENABLE_REASONING','string':'Enable\x20reasoning'});case'AI_CHAT_DISABLE_REASONING':return t({'id':'AI_CHAT_DISABLE_REASONING','string':'Disable\x20reasoning'});case'AI_CHAT_COMMANDS':return t({'id':'AI_CHAT_COMMANDS','string':'Commands'});case'AI_CHAT_SEARCH_RESOURCES':return t({'id':'AI_CHAT_SEARCH_RESOURCES','string':'Search\x20resources'});case'AI_CHAT_CONTEXT_URL_BACK_TO_CONTEXT':return t({'id':'AI_CHAT_CONTEXT_URL_BACK_TO_CONTEXT','string':'Back\x20to\x20context\x20options'});case'AI_CHAT_CONTEXT_URL_ADD_URL':return t({'id':'AI_CHAT_CONTEXT_URL_ADD_URL','string':'Add\x20URL'});case'AI_CHAT_CONTEXT_URL_PLACEHOLDER':return t({'id':'AI_CHAT_CONTEXT_URL_PLACEHOLDER','string':'Add\x20URL...'});case'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_URL':return t({'id':'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_URL','string':'Failed\x20to\x20upload\x20URL:\x20%0.\x20Please\x20try\x20again.'},_0xfe05c4);case'AI_CHAT_CONTEXT_INVALID_DATA':return t({'id':'AI_CHAT_CONTEXT_INVALID_DATA','string':'Invalid\x20context\x20data\x20type\x20for\x20the\x20selected\x20resource.'});case'AI_CHAT_CONTEXT_UNSUPPORTED_TYPE':return t({'id':'AI_CHAT_CONTEXT_UNSUPPORTED_TYPE','string':'Unsupported\x20resource\x20type.\x20Only\x20files\x20and\x20URLs\x20are\x20supported.'});case'AI_CHAT_CONTEXT_URL_EMPTY_ERROR':return t({'id':'AI_CHAT_CONTEXT_URL_EMPTY_ERROR','string':'URL\x20cannot\x20be\x20empty.'});case'AI_CHAT_CONTEXT_URL_INVALID_ERROR':return t({'id':'AI_CHAT_CONTEXT_URL_INVALID_ERROR','string':'Please\x20enter\x20a\x20valid\x20URL.'});case'AI_CHAT_INVALID_REQUEST':return t({'id':'AI_CHAT_INVALID_REQUEST','string':'Something\x20went\x20wrong\x20while\x20processing\x20your\x20request.\x20Please\x20try\x20again.'});case'AI_CHAT_CONTEXT_UNSUPPORTED_FILE_TYPE':return t({'id':'AI_CHAT_CONTEXT_UNSUPPORTED_FILE_TYPE','string':'The\x20file\x20type\x20is\x20not\x20supported.\x20Please\x20upload\x20a\x20different\x20file.'});case'AI_CHAT_CONTEXT_FILE_TOO_LARGE':return t({'id':'AI_CHAT_CONTEXT_FILE_TOO_LARGE','string':'The\x20file\x20is\x20too\x20large.\x20Please\x20upload\x20a\x20smaller\x20file.'});case'AI_CHAT_CONTEXT_FILE_TOO_MANY_PAGES':return t({'id':'AI_CHAT_CONTEXT_FILE_TOO_MANY_PAGES','string':'The\x20file\x20has\x20too\x20many\x20pages.\x20Please\x20upload\x20a\x20file\x20with\x20fewer\x20pages.'});case'AI_CHAT_CONTEXT_FORM_DATA_SIZE_LIMITS_EXCEEDED':return t({'id':'AI_CHAT_CONTEXT_FORM_DATA_SIZE_LIMITS_EXCEEDED','string':'The\x20form\x20data\x20size\x20limits\x20are\x20exceeded.\x20Please\x20upload\x20a\x20smaller\x20file.'});case'AI_CHAT_FEED_LOADING_MESSAGE_REGULAR':return t({'id':'AI_CHAT_FEED_LOADING_MESSAGE_REGULAR','string':'AI\x20is\x20preparing\x20a\x20response...'});case'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH':return t({'id':'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH','string':'AI\x20is\x20searching\x20the\x20web\x20to\x20provide\x20the\x20most\x20accurate\x20answer...'});case'AI_CHAT_FEED_LOADING_MESSAGE_REASONING':return t({'id':'AI_CHAT_FEED_LOADING_MESSAGE_REASONING','string':'AI\x20is\x20using\x20reasoning\x20to\x20provide\x20the\x20most\x20accurate\x20answer...'});case'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH_REASONING':return t({'id':'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH_REASONING','string':'AI\x20is\x20using\x20reasoning\x20and\x20searching\x20the\x20web\x20to\x20provide\x20the\x20most\x20accurate\x20answer...'});case'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH':return t({'id':'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH','string':'Scanned\x20the\x20internet\x20for\x20insights'});case'AI_CHAT_FEED_REPLY_ITEM_USED_REASONING':return t({'id':'AI_CHAT_FEED_REPLY_ITEM_USED_REASONING','string':'AI\x20used\x20reasoning\x20to\x20improve\x20the\x20response'});case'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH_REASONING':return t({'id':'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH_REASONING','string':'AI\x20used\x20search\x20and\x20reasoning\x20to\x20improve\x20the\x20response'});case'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REGULAR':return t({'id':'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REGULAR','string':'Ask\x20AI\x20anything...'});case'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH':return t({'id':'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH','string':'Ask\x20AI\x20anything\x20(web\x20search\x20enabled)...'});case'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REASONING':return t({'id':'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REASONING','string':'Ask\x20AI\x20anything\x20(reasoning\x20enabled)...'});case'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH_REASONING':return t({'id':'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH_REASONING','string':'Ask\x20AI\x20anything\x20(web\x20search\x20and\x20reasoning\x20enabled)...'});case'AI_CHAT_SUGGESTION_ACTION_SUGGEST_ALL':return t({'id':'AI_CHAT_SUGGESTION_ACTION_SUGGEST_ALL','string':'Suggest\x20all'},_0xfe05c4);case'AI_CHAT_SUGGESTION_ACTION_SUGGEST':return t({'id':'AI_CHAT_SUGGESTION_ACTION_SUGGEST','string':'Suggest'},_0xfe05c4);case'AI_CHAT_SUGGESTION_ACTION_APPLY_ALL':return t({'id':'AI_CHAT_SUGGESTION_ACTION_APPLY_ALL','string':'Apply\x20all'});case'AI_CHAT_SUGGESTION_ACTION_APPLY':return t({'id':'AI_CHAT_SUGGESTION_ACTION_APPLY','string':'Apply'});case'AI_CHAT_SUGGESTION_MORE_OPTIONS_TOOLTIP':return t({'id':'AI_CHAT_SUGGESTION_MORE_OPTIONS_TOOLTIP','string':'More\x20options'},_0xfe05c4);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.'},_0xfe05c4);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.'},_0xfe05c4);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.'},_0xfe05c4);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.'},_0xfe05c4);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'},_0xfe05c4);case'AI_BALLOON_APPLY_BUTTON':return t({'id':'AI_BALLOON_APPLY_BUTTON','string':'Apply'});case'AI_BALLOON_SUGGEST_BUTTON':return t({'id':'AI_BALLOON_SUGGEST_BUTTON','string':'Suggest'});case'AI_BALLOON_NEXT_LABEL':return t({'id':'AI_BALLOON_NEXT_LABEL','string':'Next'});case'AI_BALLOON_PREVIOUS_LABEL':return t({'id':'AI_BALLOON_PREVIOUS_LABEL','string':'Previous'});case'AI_SUGGESTION_NO_PARTS_WARNING':return t({'id':'AI_SUGGESTION_NO_PARTS_WARNING','string':'This\x20change\x20is\x20not\x20supported\x20by\x20the\x20editor\x20and\x20can\x27t\x20be\x20previewed\x20or\x20applied.'});case'AI_SUGGESTION_EMPTY_PART_WARNING':return t({'id':'AI_SUGGESTION_EMPTY_PART_WARNING','string':'Some\x20of\x20the\x20changes\x20are\x20not\x20supported\x20by\x20the\x20editor\x20and\x20can\x27t\x20be\x20previewed\x20or\x20applied.'});case'AI_ACTIONS_TRY_AGAIN':return t({'id':'AI_ACTIONS_TRY_AGAIN','string':'Retry'});case'AI_ACTIONS_PREVIOUS_INTERACTION':return t({'id':'AI_ACTIONS_PREVIOUS_INTERACTION','string':'Previous'});case'AI_ACTIONS_NEXT_INTERACTION':return t({'id':'AI_ACTIONS_NEXT_INTERACTION','string':'Next'});case'AI_MODEL_NAME_AUTO':return t({'id':'AI_MODEL_NAME_AUTO','string':'Auto'});case'AI_QUICK_ACTIONS_HEADING':return t({'id':'AI_QUICK_ACTIONS_HEADING','string':'AI\x20Quick\x20Actions'});case'AI_QUICK_ACTIONS_SEARCH':return t({'id':'AI_QUICK_ACTIONS_SEARCH','string':'Search\x20AI\x20commands'});case'AI_QUICK_ACTIONS_SEARCH_NOT_FOUND':return t({'id':'AI_QUICK_ACTIONS_SEARCH_NOT_FOUND','string':'No\x20AI\x20commands\x20found'});case'AI_QUICK_ACTIONS_ASK_AI':return t({'id':'AI_QUICK_ACTIONS_ASK_AI','string':'Ask\x20AI'});case'AI_QUICK_ACTIONS_CHAT_COMMANDS':return t({'id':'AI_QUICK_ACTIONS_CHAT_COMMANDS','string':'Chat\x20commands'});case'AI_QUICK_ACTIONS_IMPROVE_WRITING':return t({'id':'AI_QUICK_ACTIONS_IMPROVE_WRITING','string':'Improve\x20writing'});case'AI_QUICK_ACTIONS_CONTINUE_WRITING':return t({'id':'AI_QUICK_ACTIONS_CONTINUE_WRITING','string':'Continue\x20writing'});case'AI_QUICK_ACTIONS_FIX_GRAMMAR_SPELLING':return t({'id':'AI_QUICK_ACTIONS_FIX_GRAMMAR_SPELLING','string':'Fix\x20grammar\x20&\x20spelling'});case'AI_QUICK_ACTIONS_ADJUST_LENGTH':return t({'id':'AI_QUICK_ACTIONS_ADJUST_LENGTH','string':'Adjust\x20length'});case'AI_QUICK_ACTIONS_CHANGE_TONE':return t({'id':'AI_QUICK_ACTIONS_CHANGE_TONE','string':'Change\x20tone'});case'AI_QUICK_ACTIONS_TRANSLATE':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE','string':'Translate'});case'AI_QUICK_ACTIONS_EXPLAIN':return t({'id':'AI_QUICK_ACTIONS_EXPLAIN','string':'Explain'});case'AI_QUICK_ACTIONS_SUMMARIZE':return t({'id':'AI_QUICK_ACTIONS_SUMMARIZE','string':'Summarize'});case'AI_QUICK_ACTIONS_HIGHLIGHT_KEY_POINTS':return t({'id':'AI_QUICK_ACTIONS_HIGHLIGHT_KEY_POINTS','string':'Highlight\x20key\x20points'});case'AI_QUICK_ACTIONS_MAKE_SHORTER':return t({'id':'AI_QUICK_ACTIONS_MAKE_SHORTER','string':'Make\x20shorter'});case'AI_QUICK_ACTIONS_MAKE_LONGER':return t({'id':'AI_QUICK_ACTIONS_MAKE_LONGER','string':'Make\x20longer'});case'AI_QUICK_ACTIONS_MORE_CASUAL':return t({'id':'AI_QUICK_ACTIONS_MORE_CASUAL','string':'More\x20casual'});case'AI_QUICK_ACTIONS_MORE_DIRECT':return t({'id':'AI_QUICK_ACTIONS_MORE_DIRECT','string':'More\x20direct'});case'AI_QUICK_ACTIONS_MORE_FRIENDLY':return t({'id':'AI_QUICK_ACTIONS_MORE_FRIENDLY','string':'More\x20friendly'});case'AI_QUICK_ACTIONS_MORE_CONFIDENT':return t({'id':'AI_QUICK_ACTIONS_MORE_CONFIDENT','string':'More\x20confident'});case'AI_QUICK_ACTIONS_MORE_PROFESSIONAL':return t({'id':'AI_QUICK_ACTIONS_MORE_PROFESSIONAL','string':'More\x20professional'});case'AI_QUICK_ACTIONS_ADJUST_BASED_ON_DOCUMENT':return t({'id':'AI_QUICK_ACTIONS_ADJUST_BASED_ON_DOCUMENT','string':'Adjust\x20based\x20on\x20the\x20rest\x20of\x20the\x20document'});case'AI_QUICK_ACTIONS_TRANSLATE_ENGLISH':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_ENGLISH','string':'English'});case'AI_QUICK_ACTIONS_TRANSLATE_CHINESE':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_CHINESE','string':'Chinese\x20(Simplified)'});case'AI_QUICK_ACTIONS_TRANSLATE_FRENCH':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_FRENCH','string':'French'});case'AI_QUICK_ACTIONS_TRANSLATE_JAPANESE':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_JAPANESE','string':'Japanese'});case'AI_QUICK_ACTIONS_TRANSLATE_PORTUGUESE':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_PORTUGUESE','string':'Portuguese'});case'AI_QUICK_ACTIONS_TRANSLATE_KOREAN':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_KOREAN','string':'Korean'});case'AI_QUICK_ACTIONS_TRANSLATE_ITALIAN':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_ITALIAN','string':'Italian'});case'AI_QUICK_ACTIONS_TRANSLATE_RUSSIAN':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_RUSSIAN','string':'Russian'});case'AI_QUICK_ACTIONS_TRANSLATE_SPANISH':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_SPANISH','string':'Spanish'});case'AI_QUICK_ACTIONS_TRANSLATE_GERMAN':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_GERMAN','string':'German'});case'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND':return t({'id':'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND','string':'%0\x20plugin\x20is\x20required\x20but\x20not\x20found.'},_0xfe05c4);case'AI_QUICK_ACTIONS_OTHER':return t({'id':'AI_QUICK_ACTIONS_OTHER','string':'Other'});case'AI_ACTIONS_GENERIC_ERROR':return t({'id':'AI_ACTIONS_GENERIC_ERROR','string':'Sorry,\x20we\x20couldn\x27t\x20generate\x20the\x20response.\x20Please\x20try\x20again\x20in\x20a\x20moment.'});case'AI_BALLOON_SELECTION_REMOVED_ERROR':return t({'id':'AI_BALLOON_SELECTION_REMOVED_ERROR','string':'Changes\x20cannot\x20be\x20applied.\x20The\x20original\x20content\x20no\x20longer\x20exists.'});case'AI_REVIEW_MODE_STOP_GENERATING':return t({'id':'AI_REVIEW_MODE_STOP_GENERATING','string':'Stop\x20generating'});case'AI_REVIEW_MODE_HIDE_CHANGES':return t({'id':'AI_REVIEW_MODE_HIDE_CHANGES','string':'Hide\x20changes'});case'AI_REVIEW_MODE_SHOW_CHANGES':return t({'id':'AI_REVIEW_MODE_SHOW_CHANGES','string':'Show\x20changes'});case'AI_REVIEW_MODE_ACCEPT_ALL':return t({'id':'AI_REVIEW_MODE_ACCEPT_ALL','string':'Accept\x20all'});case'AI_REVIEW_MODE_EXIT_REVIEW':return t({'id':'AI_REVIEW_MODE_EXIT_REVIEW','string':'Exit\x20review'});case'AI_REVIEW_MODE_ACCEPT_CHANGE':return t({'id':'AI_REVIEW_MODE_ACCEPT_CHANGE','string':'Accept'});case'AI_REVIEW_MODE_DISMISS_CHANGE':return t({'id':'AI_REVIEW_MODE_DISMISS_CHANGE','string':'Dismiss'});case'AI_REVIEW_MODE_LEARN_MORE':return t({'id':'AI_REVIEW_MODE_LEARN_MORE','string':'Learn\x20more'});case'AI_REVIEW_MODE_COMPLETED_TEXT':return t({'id':'AI_REVIEW_MODE_COMPLETED_TEXT','string':'There\x27s\x20nothing\x20left\x20to\x20review.'});case'AI_REVIEW_MODE_EMPTY_RESULTS_TEXT':return t({'id':'AI_REVIEW_MODE_EMPTY_RESULTS_TEXT','string':'There\x20are\x20no\x20changes\x20to\x20suggest.'});case'AI_REVIEW_MODE_FINISH_REVIEW_BUTTON_LABEL':return t({'id':'AI_REVIEW_MODE_FINISH_REVIEW_BUTTON_LABEL','string':'Finish\x20Review'});case'AI_REVIEW_MODE_FINISH_REVIEW_HEADER_TITLE':return t({'id':'AI_REVIEW_MODE_FINISH_REVIEW_HEADER_TITLE','string':'Review\x20complete.\x20Finish\x20when\x20ready.'});case'AI_REVIEW_INITIALIZATION_ERROR_MESSAGE':return t({'id':'AI_REVIEW_INITIALIZATION_ERROR_MESSAGE','string':'AI\x20Review\x20initialized\x20with\x20errors.\x20Some\x20features\x20may\x20not\x20be\x20available\x20or\x20work\x20properly.'});case'AI_REVIEW_MODE_GENERAL_ERROR_MESSAGE':return t({'id':'AI_REVIEW_MODE_GENERAL_ERROR_MESSAGE','string':'Sorry,\x20we\x20couldn\x27t\x20generate\x20the\x20whole\x20review\x20properly.\x20Please\x20try\x20again\x20in\x20a\x20moment.'});case'AI_REVIEW_MODE_CHUNK_ERROR_MESSAGE':return t({'id':'AI_REVIEW_MODE_CHUNK_ERROR_MESSAGE','string':'Not\x20everything\x20went\x20through,\x20but\x20the\x20completed\x20items\x20are\x20listed\x20below.'});case'AI_REVIEW_MODE':return t({'id':'AI_REVIEW_MODE','string':'Review'});case'AI_REVIEW_MODE_PROMPT_EMPTY_ERROR':return t({'id':'AI_REVIEW_MODE_PROMPT_EMPTY_ERROR','string':'Prompt\x20must\x20not\x20be\x20empty'});case'AI_REVIEW_CHECK_CUSTOM_TITLE':return t({'id':'AI_REVIEW_CHECK_CUSTOM_TITLE','string':'Custom\x20command'});case'AI_REVIEW_CHECK_CUSTOM_DESCRIPTION':return t({'id':'AI_REVIEW_CHECK_CUSTOM_DESCRIPTION','string':'Enter\x20a\x20custom\x20command\x20for\x20a\x20specific\x20review.'});case'AI_REVIEW_CHECK_CORRECTNESS_TITLE':return t({'id':'AI_REVIEW_CHECK_CORRECTNESS_TITLE','string':'Proofread'});case'AI_REVIEW_CHECK_CORRECTNESS_DESCRIPTION':return t({'id':'AI_REVIEW_CHECK_CORRECTNESS_DESCRIPTION','string':'Check\x20the\x20text\x20for\x20errors\x20in\x20grammar,\x20spelling,\x20and\x20punctuation.'});case'AI_REVIEW_CHECK_CLARITY_TITLE':return t({'id':'AI_REVIEW_CHECK_CLARITY_TITLE','string':'Improve\x20clarity'});case'AI_REVIEW_CHECK_CLARITY_DESCRIPTION':return t({'id':'AI_REVIEW_CHECK_CLARITY_DESCRIPTION','string':'Improve\x20the\x20logical\x20structure\x20and\x20precision\x20for\x20clearer\x20message.'});case'AI_REVIEW_CHECK_READABILITY_TITLE':return t({'id':'AI_REVIEW_CHECK_READABILITY_TITLE','string':'Improve\x20readability'});case'AI_REVIEW_CHECK_READABILITY_DESCRIPTION':return t({'id':'AI_REVIEW_CHECK_READABILITY_DESCRIPTION','string':'Adjust\x20sentence\x20structure\x20and\x20word\x20choice\x20for\x20an\x20easier\x20read.'});case'AI_REVIEW_CHECK_MAKE_TITLE':return t({'id':'AI_REVIEW_CHECK_MAKE_TITLE','string':'Adjust\x20length'});case'AI_REVIEW_CHECK_MAKE_DESCRIPTION':return t({'id':'AI_REVIEW_CHECK_MAKE_DESCRIPTION','string':'Shorten\x20or\x20lengthen\x20the\x20text\x20as\x20needed.'});case'AI_REVIEW_CHECK_MAKE_OPTIONS_LABEL':return t({'id':'AI_REVIEW_CHECK_MAKE_OPTIONS_LABEL','string':'Adjust\x20length'});case'AI_REVIEW_CHECK_MAKE_OPTIONS_DATA_LONGER':return t({'id':'AI_REVIEW_CHECK_MAKE_OPTIONS_DATA_LONGER','string':'Longer'});case'AI_REVIEW_CHECK_MAKE_OPTIONS_DATA_SHORTER':return t({'id':'AI_REVIEW_CHECK_MAKE_OPTIONS_DATA_SHORTER','string':'Shorter'});case'AI_REVIEW_CHECK_MAKE_TONE_TITLE':return t({'id':'AI_REVIEW_CHECK_MAKE_TONE_TITLE','string':'Adjust\x20tone\x20and\x20style'});case'AI_REVIEW_CHECK_MAKE_TONE_DESCRIPTION':return t({'id':'AI_REVIEW_CHECK_MAKE_TONE_DESCRIPTION','string':'Modify\x20the\x20text\x20to\x20a\x20desired\x20tone\x20and\x20style.'});case'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_LABEL':return t({'id':'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_LABEL','string':'Adjust\x20tone\x20and\x20style'});case'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_CASUAL':return t({'id':'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_CASUAL','string':'Casual'});case'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_DIRECT':return t({'id':'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_DIRECT','string':'Direct'});case'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_FRIENDLY':return t({'id':'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_FRIENDLY','string':'Friendly'});case'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_CONFIDENT':return t({'id':'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_CONFIDENT','string':'Confident'});case'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_PROFESSIONAL':return t({'id':'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_PROFESSIONAL','string':'Professional'});case'AI_REVIEW_CHECK_TRANSLATE_TITLE':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_TITLE','string':'Translate'});case'AI_REVIEW_CHECK_TRANSLATE_DESCRIPTION':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_DESCRIPTION','string':'Translate\x20the\x20text\x20into\x20another\x20language.'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_LABEL':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_LABEL','string':'Select\x20language'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_ENGLISH':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_ENGLISH','string':'English'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_SPANISH':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_SPANISH','string':'Spanish'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_FRENCH':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_FRENCH','string':'French'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_GERMAN':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_GERMAN','string':'German'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_CHINESE':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_CHINESE','string':'Chinese\x20(Simplified)'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_JAPANESE':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_JAPANESE','string':'Japanese'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_RUSSIAN':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_RUSSIAN','string':'Russian'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_PORTUGUESE':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_PORTUGUESE','string':'Portuguese'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_KOREAN':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_KOREAN','string':'Korean'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_ITALIAN':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_ITALIAN','string':'Italian'});case'AI_REVIEW_MODE_CHECK_STATUS_ACCEPTED':return t({'id':'AI_REVIEW_MODE_CHECK_STATUS_ACCEPTED','string':'Accepted'});case'AI_REVIEW_MODE_CHECK_STATUS_REJECTED':return t({'id':'AI_REVIEW_MODE_CHECK_STATUS_REJECTED','string':'Dismissed'});case'AI_REVIEW_MODE_CHECK_STATUS_OUTDATED':return t({'id':'AI_REVIEW_MODE_CHECK_STATUS_OUTDATED','string':'Outdated'});case'AI_TOGGLE_BUTTON_LABEL':return t({'id':'AI_TOGGLE_BUTTON_LABEL','string':'AI'});case'AI_TRANSLATE_ACCEPT_ALL':return t({'id':'AI_TRANSLATE_ACCEPT_ALL','string':'Accept\x20translation'});case'AI_TRANSLATE_FINISH_HEADER_TITLE':return t({'id':'AI_TRANSLATE_FINISH_HEADER_TITLE','string':'Translation\x20complete.\x20Finish\x20when\x20ready.'});case'AI_TRANSLATE_EMPTY_RESULTS_TEXT':return t({'id':'AI_TRANSLATE_EMPTY_RESULTS_TEXT','string':'There\x20are\x20no\x20translations\x20to\x20review.'});case'AI_TRANSLATE_FINISH_BUTTON_LABEL':return t({'id':'AI_TRANSLATE_FINISH_BUTTON_LABEL','string':'Finish\x20Translation'});case'AI_TRANSLATE_CHECK_LIST_HEADER_TITLE':return t({'id':'AI_TRANSLATE_CHECK_LIST_HEADER_TITLE','string':'Content\x20Translation'});case'AI_TRANSLATE_CHECK_LIST_HEADER_DESCRIPTION':return t({'id':'AI_TRANSLATE_CHECK_LIST_HEADER_DESCRIPTION','string':'A\x20dedicated\x20mode\x20for\x20translating\x20the\x20entire\x20text.'});case'AI_TRANSLATE_CHECK_RESULTS_LOADING_TITLE':return t({'id':'AI_TRANSLATE_CHECK_RESULTS_LOADING_TITLE','string':'Translating\x20to'});case'AI_TRANSLATE_CHECK_RESULTS_READY_TITLE':return t({'id':'AI_TRANSLATE_CHECK_RESULTS_READY_TITLE','string':'Translated\x20to'});case'AI_TRANSLATE_GENERAL_ERROR_MESSAGE':return t({'id':'AI_TRANSLATE_GENERAL_ERROR_MESSAGE','string':'Sorry,\x20we\x20couldn\x27t\x20generate\x20translations\x20properly.\x20Please\x20try\x20again\x20in\x20a\x20moment.'});case'AI_SUGGESTION_DISABLED_TOOLTIP_MESSAGE':return t({'id':'AI_SUGGESTION_DISABLED_TOOLTIP_MESSAGE','string':'This\x20conversation\x20is\x20loaded\x20from\x20chat\x20history\x20from\x20a\x20previous\x20session,\x20so\x20you\x20can’t\x20apply,\x20reject,\x20or\x20suggest\x20changes.'});case'AI_SUGGESTION_DISABLED_FEED_MESSAGE':return t({'id':'AI_SUGGESTION_DISABLED_FEED_MESSAGE','string':'Actions\x20aren’t\x20available\x20for\x20changes\x20from\x20a\x20previous\x20session.'});default:return _0x3f490c;}}function us(_0x48acc2,_0x1bbfd8){const _0x595588=new _0x4421de(_0x48acc2),_0x9d0f9a=i(_0x48acc2,'AI_TABS_LABEL_MINIMIZE'),_0x53c262=i(_0x48acc2,'AI_TABS_LABEL_MAXIMIZE');return _0x595588['set']({'withText':!0x1,'icon':_0x435d1e,'tooltip':!0x0,'class':'ck-ai-tabs__resize\x20ck-ai-button-tertiary'}),_0x595588['bind']('label')['to'](_0x1bbfd8,'isMaximized',_0x31ceb3=>_0x31ceb3?_0x9d0f9a:_0x53c262),_0x595588['bind']('icon')['to'](_0x1bbfd8,'isMaximized',_0x5dfd15=>_0x5dfd15?_0x194a62:_0x435d1e),_0x595588['bind']('isOn')['to'](_0x1bbfd8,'isMaximized'),_0x595588['on']('execute',()=>{_0x1bbfd8['fire']('resizeTabs');}),_0x595588;}function Wi(_0x30de8b){return _0x533d50(_0x30de8b);}function Tt(_0x21bf71){return _0xb61cdf(_0x21bf71);}function St(_0x512f54,_0x1ad816,_0x40f4e9){const _0xf08ee9=null!==_0x1ad816?_0x2ac144=>_0x2ac144['attribs'][_0x512f54]===_0x1ad816:_0x2bf9a4=>Boolean(_0x2bf9a4['attribs'][_0x512f54]);return yt(_0x41c4b6=>_0x239cab(_0x41c4b6)&&_0xf08ee9(_0x41c4b6),_0x40f4e9);}function Zi(_0x7acd1,_0x39b7a9,_0x14b0b9){const _0x35f3ba=null!==_0x39b7a9?_0x303bf0=>_0x303bf0['attribs'][_0x7acd1]===_0x39b7a9:_0x313be2=>Boolean(_0x313be2['attribs'][_0x7acd1]);return _0x30053d(_0x245532=>_0x239cab(_0x245532)&&_0x35f3ba(_0x245532),_0x14b0b9);}function At(_0x423cdf,_0xe77368){return _0x423cdf&&_0x239cab(_0x423cdf)?_0x423cdf['attribs'][_0xe77368]:null;}function Ns(_0x34fef4,_0x3d228c,_0x2fedda){_0x239cab(_0x34fef4)&&(null===_0x2fedda?delete _0x34fef4['attribs'][_0x3d228c]:_0x34fef4['attribs'][_0x3d228c]=_0x2fedda);}function fs(_0x32d0fb,_0x391694,_0x101946){const _0x46aba7=_0x391694['cloneNode'](!0x0);'beforebegin'===_0x101946?_0xb261c2(_0x32d0fb,_0x46aba7):'afterbegin'===_0x101946?_0x1317c8(_0x32d0fb,_0x46aba7):'beforeend'===_0x101946?_0x3ba989(_0x32d0fb,_0x46aba7):'afterend'===_0x101946&&_0x2d333e(_0x32d0fb,_0x46aba7);}function Ui(_0x2aae17){const _0x5cc327=[];let _0x17b121=_0x2aae17;for(;_0x17b121;)_0x17b121=_0x65a7ae(_0x17b121),_0x17b121&&_0x5cc327['push'](_0x17b121);return _0x5cc327;}function Kn(_0x48203c){return _0x48203c['replace'](/^\s+/gm,'')['replace'](/\s+$/gm,'')['replace'](/\n*/g,'')['replace'](/\s+/g,'\x20')['replace'](/>\s*</g,'><');}function vs(_0x2605fb){let _0x14f50e=0x0;for(;_0x2605fb['parentNode'];)_0x2605fb=_0x2605fb['parentNode'],_0x14f50e++;return _0x14f50e;}function xs(_0x11c972){const _0x5ebb53=[];let _0x572223=_0x11c972['nextSibling'];for(;_0x572223;)_0x5ebb53['push'](_0x572223),_0x572223=_0x572223['nextSibling'];_0x5ebb53['forEach'](_0x3de9b3=>{_0x3c7927(_0x3de9b3);});}class Ki extends/* #__PURE__ -- @preserve */
|
|
25
|
+
ts(){['_m2html'];constructor(){super(),this['_m2html']=new _0x469116();}['convertMarkdownToHTML'](_0x330349){const _0x101da3=this['_m2html']['parse'](_0x330349);return this['parseAndNormalizeHTML'](_0x101da3);}['parseAndNormalizeHTML'](_0x5a6898){return this['_parseHTML'](_0x5a6898);}['_parseHTML'](_0x4d6b35){const _0x13c6b2=Wi('<dummy>'+_0x4d6b35['replace'](/^\t+/gm,'\x20')['replace'](/\n*/g,'')['replace'](/\s+/g,'\x20')['replace'](/<[^>]*?$/g,'')+'</dummy>');return _0x13c6b2['children']=_0x13c6b2['children'][0x0]['children'],_0x13c6b2;}}class Qi extends/* #__PURE__ -- @preserve */
|
|
26
|
+
ts(){['_generateUid'];['_touchedNodesState']={'newIds':[],'modifiedIds':[],'removedIds':[],'invalidIds':[],'lastTouchedId':null};['_existingDataIds']=new Set();constructor(_0x52691b){super(),this['_generateUid']=_0x52691b||_0x56075e;}['merge'](_0x30244f,_0x106305,_0x30dd7b){const _0x1db4bb=_0x30244f['cloneNode'](!0x0);if(0x0===_0x106305['childNodes']['length']){const _0xb07a42=[];return Zi('data-id','new-element',_0x1db4bb)['forEach'](_0x42661a=>{const _0x386f09=this['_generateUid']();Ns(_0x42661a,'data-id',_0x386f09),_0xb07a42['push'](_0x386f09);}),this['_removeSpecialComments'](_0x1db4bb),{'parsedContent':_0x1db4bb,'newNodeIds':_0xb07a42,'modifiedNodeIds':[],'removedNodeIds':[]};}_0x30dd7b&&_0x30dd7b['markUnstableElements']&&this['_markLastTagElementUnstable'](_0x1db4bb),this['_touchedNodesState']['newIds']=[],this['_touchedNodesState']['modifiedIds']=[],this['_touchedNodesState']['removedIds']=[],this['_touchedNodesState']['invalidIds']=[],this['_touchedNodesState']['lastTouchedId']=null,this['_existingDataIds']=new Set(Zi('data-id',null,_0x106305)['map'](_0x389229=>At(_0x389229,'data-id'))['filter'](_0x41069e=>!!_0x41069e));let _0x528663=-0x1,_0x4fe8bb=!0x1;const _0x1e58e3=_0x1db4bb['childNodes'],_0x3a61fa=Array['from'](_0x1e58e3)['filter'](_0x81403d=>!(0x3===_0x81403d['nodeType']&&''===Tt(_0x81403d)['trim']())),_0x1a4b3c=_0x3a61fa['length'];for(let _0x2f0705=0x0;_0x2f0705<_0x1a4b3c;_0x2f0705++){const _0x223aa1=_0x3a61fa[_0x2f0705],_0x31f52a=_0x3a61fa[_0x2f0705+0x1];if(this['_isNewNode'](_0x223aa1)){if(-0x1===_0x528663&&(_0x528663=_0x2f0705),this['_markWrappedElements'](_0x223aa1),!this['_isNewNode'](_0x31f52a)){const [_0x554c9d,_0x33ea4d]=this['_findReferenceNode'](_0x223aa1,_0x4fe8bb,_0x106305);if(_0x554c9d){const _0x18e9ba=Array['from'](_0x3a61fa)['slice'](_0x528663,_0x2f0705+0x1);this['_insertNodes'](_0x554c9d,_0x18e9ba,_0x33ea4d),_0x528663=-0x1;}}}else{if(this['_isExistingContentComment'](_0x223aa1))_0x4fe8bb=!0x0;else{if(this['_isExistingNode'](_0x223aa1)){const _0x4e7fbc=At(_0x223aa1,'data-id');if(_0x4e7fbc&&this['_existingDataIds']['has'](_0x4e7fbc)){const _0xb44c0=St('data-id',_0x4e7fbc,_0x106305);this['_replaceNode'](_0xb44c0,_0x223aa1);}if(this['_touchedNodesState']['removedIds']['includes'](_0x4e7fbc)){const _0x45971d=this['_touchedNodesState']['removedIds']['indexOf'](_0x4e7fbc);this['_touchedNodesState']['removedIds']['splice'](_0x45971d,0x1);}}else{if(this['_isDelNode'](_0x223aa1)){const _0x5a3b92=At(_0x223aa1,'data-id');this['_touchedNodesState']['modifiedIds']['includes'](_0x5a3b92)||this['_storeDeletedElementIds'](_0x223aa1);}}}}}for(const _0x4e3b77 of this['_touchedNodesState']['removedIds']){const _0x23976c=St('data-id',_0x4e3b77,_0x106305);if(_0x23976c){if(_0x30dd7b&&_0x30dd7b['replaceRemovedWith']){this['_touchedNodesState']['lastTouchedId']=_0x4e3b77;const _0x2873a8=_0x30dd7b['replaceRemovedWith']['cloneNode'](!0x0);Ns(_0x2873a8,'data-id',_0x4e3b77),Ns(_0x2873a8,'data-removed','true'),_0xd8ffa2(_0x23976c,_0x2873a8);}else _0x3c7927(_0x23976c);}}if(Zi('data-wrapped-id',null,_0x106305)['forEach'](_0x4b9f00=>{const _0x4f983e=St('data-id',At(_0x4b9f00,'data-wrapped-id'),_0x106305);var _0x852599,_0x250ac6;_0x4f983e&&(_0x250ac6=_0x4b9f00,_0x3c7927(_0x852599=_0x4f983e),_0xd8ffa2(_0x250ac6,_0x852599));}),Zi('data-id','new-element',_0x106305)['forEach'](_0x4dfdec=>{const _0x2a1261=this['_getUid'](_0x4dfdec);Ns(_0x4dfdec,'data-id',_0x2a1261),this['_touchedNodesState']['newIds']['push'](_0x2a1261);}),this['_removeSpecialComments'](_0x106305),_0x30dd7b&&_0x30dd7b['markUnstableElements']&&this['_markUnstableElements'](_0x106305,_0x30dd7b['markUnstableElementsDepth']||0x0),_0x30dd7b&&_0x30dd7b['cutAfterLastChange']&&this['_touchedNodesState']['lastTouchedId']){let _0x5cd8be=St('data-id',this['_touchedNodesState']['lastTouchedId'],_0x106305);for(;_0x5cd8be;)xs(_0x5cd8be),_0x5cd8be=_0x5cd8be['parentNode'];}return{'parsedContent':_0x106305,'newNodeIds':this['_touchedNodesState']['newIds'],'modifiedNodeIds':this['_touchedNodesState']['modifiedIds'],'removedNodeIds':this['_touchedNodesState']['removedIds']};}['_insertNodes'](_0x3d9ef5,_0x41f911,_0x50bd20){for(const _0x390530 of _0x41f911){const _0x105623=this['_getUid'](_0x390530);Ns(_0x390530,'data-id',_0x105623),this['_touchedNodesState']['newIds']['push'](_0x105623),this['_touchedNodesState']['lastTouchedId']=_0x105623;}const _0x46ed6a='afterbegin'===_0x50bd20||'afterend'===_0x50bd20?_0x41f911['reverse']():_0x41f911;for(const _0x13b4c9 of _0x46ed6a)fs(_0x3d9ef5,_0x13b4c9,_0x50bd20);}['_replaceNode'](_0x379a27,_0x41e940){if(!_0x379a27)return;if(_0x285fd2=_0x41e940,Kn(Tt(_0x379a27))===Kn(Tt(_0x285fd2)))return;var _0x285fd2;const _0xe0549c=this['_getUid'](_0x379a27);Ns(_0x41e940,'data-id',_0xe0549c),this['_touchedNodesState']['modifiedIds']['push'](_0xe0549c),this['_touchedNodesState']['lastTouchedId']=_0xe0549c,_0xd8ffa2(_0x379a27,_0x41e940['cloneNode'](!0x0));}['_findReferenceNode'](_0x9d3a55,_0x3354a7,_0x3f43e5){const _0x3a7850=this['_findPrevElementWithDataId'](_0x9d3a55,!0x1);if(_0x3a7850){const _0x4e414d=this['_getNodeDataId'](_0x3a7850),_0x50123c=St('data-id',_0x4e414d,_0x3f43e5);if(_0x50123c)return[_0x50123c,'afterend'];this['_touchedNodesState']['invalidIds']['push'](_0x4e414d);}const _0x1f7d2f=this['_findNextElementWithDataId'](_0x9d3a55,!0x1);if(_0x1f7d2f){const _0x43d11a=this['_getNodeDataId'](_0x1f7d2f),_0x4e891f=St('data-id',_0x43d11a,_0x3f43e5);if(_0x4e891f)return[_0x4e891f,'beforebegin'];this['_touchedNodesState']['invalidIds']['push'](_0x43d11a);}return _0x3354a7?_0x9d3a55['nextSibling']?this['_findFallbackReferenceNode'](_0x9d3a55,_0x3f43e5):[_0x3f43e5['childNodes'][_0x3f43e5['childNodes']['length']-0x1],'afterend']:[_0x3f43e5['childNodes'][0x0],'beforebegin'];}['_findFallbackReferenceNode'](_0x28f579,_0x94a128){const _0x380310=[],_0x187fda=this['_findPrevElementWithDataId'](_0x28f579,!0x0);if(_0x187fda){const _0x383f80=St('data-id',this['_getNodeDataId'](_0x187fda),_0x94a128);_0x383f80&&_0x380310['push']([_0x383f80,'afterend']);}const _0x36f5af=this['_findNextElementWithDataId'](_0x28f579,!0x0);if(_0x36f5af){const _0x1e8ec2=St('data-id',this['_getNodeDataId'](_0x36f5af),_0x94a128);_0x1e8ec2&&_0x380310['push']([_0x1e8ec2,'beforebegin']);}if(_0x380310['length']>0x1)return vs(_0x380310[0x0][0x0])<=vs(_0x380310[0x1][0x0])?_0x380310[0x0]:_0x380310[0x1];return 0x1===_0x380310['length']?_0x380310[0x0]:[_0x94a128['lastChild'],'afterend'];}['_findNextElementWithDataId'](_0x21b206,_0x40e929){let _0x59f3f3=_0x21b206['nextSibling'],_0x241e9d=null,_0x595bf=!0x1;for(;_0x59f3f3;){if(_0x10543b(_0x59f3f3)){if(this['_isDelNode'](_0x59f3f3)&&(_0x241e9d=_0x59f3f3),this['_isExistingContentComment'](_0x59f3f3)&&_0x40e929&&!_0x595bf){_0x595bf=!0x0,_0x59f3f3=_0x59f3f3['nextSibling'];continue;}break;}const _0x36be93=At(_0x59f3f3,'data-id');if(_0x36be93&&'new-element'!==_0x36be93&&this['_existingDataIds']['has'](_0x36be93)){_0x241e9d=_0x59f3f3;break;}_0x59f3f3=_0x59f3f3['nextSibling'];}return _0x241e9d;}['_findPrevElementWithDataId'](_0x23f0cb,_0x3a332f){let _0x2b5875=_0x23f0cb['previousSibling'],_0x380149=null,_0x2e3e2a=!0x1;for(;_0x2b5875;){if(_0x10543b(_0x2b5875)){if(this['_isDelNode'](_0x2b5875)&&(_0x380149=_0x2b5875),this['_isExistingContentComment'](_0x2b5875)&&_0x3a332f&&!_0x2e3e2a){_0x2e3e2a=!0x0,_0x2b5875=_0x2b5875['previousSibling'];continue;}break;}const _0x45b202=At(_0x2b5875,'data-id');if(_0x45b202&&'new-element'!==_0x45b202&&this['_existingDataIds']['has'](_0x45b202)){_0x380149=_0x2b5875;break;}_0x2b5875=_0x2b5875['previousSibling'];}return _0x380149;}['_markWrappedElements'](_0x4e4237){_0x239cab(_0x4e4237)&&Zi('data-id',null,_0x4e4237)['forEach'](_0x4563f5=>{this['_isExistingNode'](_0x4563f5)&&!this['_hasWrappedParent'](_0x4563f5)&&(Ns(_0x4563f5,'data-wrapped-id',At(_0x4563f5,'data-id')),Ns(_0x4563f5,'data-id',null));});}['_getNodeDataId'](_0x210096){if(!_0x210096)return null;if(_0x239cab(_0x210096))return At(_0x210096,'data-id');if(_0x10543b(_0x210096)){const _0x3d5a84=Tt(_0x210096)['match'](/removed[\s*-]data-id="([^"]+)"/);if(_0x3d5a84&&_0x3d5a84[0x1])return _0x3d5a84[0x1];}return null;}['_storeDeletedElementIds'](_0x3cc7f2){if(_0x10543b(_0x3cc7f2)){const _0x2402a5=Tt(_0x3cc7f2)['match'](/removed[\s*-]data-id="([^"]+)"/);_0x2402a5&&_0x2402a5[0x1]&&this['_touchedNodesState']['removedIds']['push'](_0x2402a5[0x1]);}}['_getUid'](_0x39da44){return this['_isExistingNode'](_0x39da44)?At(_0x39da44,'data-id'):this['_generateUid']();}['_removeSpecialComments'](_0x18d011){(function(_0x4df68d){return _0x4183c0(_0x75f766=>_0x10543b(_0x75f766),_0x4df68d,!0x0,0x1/0x0);}(_0x18d011)['filter'](_0x1c462c=>this['_isDelNode'](_0x1c462c)||this['_isExistingContentComment'](_0x1c462c))['forEach'](_0x543a80=>{_0x3c7927(_0x543a80);}));}['_markLastTagElementUnstable'](_0xfbba84){const _0x32c876=_0xfbba84['childNodes'],_0x5eb86b=_0x32c876[_0x32c876['length']-0x1];_0x5eb86b&&_0x239cab(_0x5eb86b)&&Ns(_0x5eb86b,'data-unstable','true');}['_markUnstableElements'](_0x34e793,_0x47439e){const _0x142138=St('data-unstable','true',_0x34e793);if(!_0x142138)return;const _0x25aef7=Ui(_0x142138)['slice'](0x0,-0x1),_0x475fe3=_0x25aef7['length'];let _0x2cfa4d=_0x142138;if(_0x475fe3>_0x47439e){let _0x3a9db0=_0x475fe3,_0x15bb1e=null;for(;_0x3a9db0>_0x47439e&&_0x3a9db0>=0x0;)_0x3a9db0--,_0x15bb1e=_0x25aef7[_0x3a9db0];_0x15bb1e&&(_0x2cfa4d=_0x15bb1e,Ns(_0x142138,'data-unstable',null),Ns(_0x15bb1e,'data-unstable','true'));}else{if(_0x475fe3<_0x47439e){let _0x306cf1=_0x475fe3,_0x5ab681=_0x142138;for(;_0x306cf1<_0x47439e;){const _0x119802=_0x5ab681['childNodes']['filter'](_0x43253d=>_0x239cab(_0x43253d));if(0x0===_0x119802['length'])break;_0x306cf1++,_0x5ab681=_0x119802[_0x119802['length']-0x1];}_0x5ab681&&(_0x2cfa4d=_0x5ab681,Ns(_0x142138,'data-unstable',null),Ns(_0x5ab681,'data-unstable','true'));}}let _0x5b2c45=_0x2cfa4d;for(;_0x5b2c45;){for(;_0x5b2c45['nextSibling'];)_0x5b2c45=_0x5b2c45['nextSibling'],_0x239cab(_0x5b2c45)&&Ns(_0x5b2c45,'data-unstable','true');_0x5b2c45=_0x5b2c45['parentNode'];}}['_isNewNode'](_0x225c77){return Boolean('new-element'===At(_0x225c77,'data-id'));}['_isExistingNode'](_0x301186){return Boolean((At(_0x301186,'data-id')||'')['length']>0x0&&'new-element'!==At(_0x301186,'data-id'));}['_isDelNode'](_0x19e7dc){return!!_0x19e7dc&&Boolean(_0x10543b(_0x19e7dc)&&Tt(_0x19e7dc)['match'](/removed[\s*-]data-id="[^"]+"/));}['_hasWrappedParent'](_0x116f3d){let _0x9134e7=_0x116f3d['parentNode'];for(;_0x9134e7;){if(At(_0x9134e7,'data-wrapped-id'))return!0x0;_0x9134e7=_0x9134e7['parentNode'];}return!0x1;}['_isExistingContentComment'](_0x14b1c2){return Boolean(_0x10543b(_0x14b1c2)&&Tt(_0x14b1c2)['match'](/\s*existing[\s*-](content|document)\s*/g));}}function J({editor:_0x12a270,changeGroups:_0x29d2af,documentContextContent:_0x445aa6,showDiff:_0xfc8a2f,trimUnchanged:_0x457be6=!0x0}){return _0x29d2af['map'](_0x3cbff7=>{const _0x5897b5=new Et([]),_0x505b41=new Et([]);for(const _0x559c68 of _0x3cbff7['changes'])if(_0xfc8a2f&&'removed'==_0x559c68['type']||_0x505b41['children']['push'](_0x559c68['node']['cloneNode'](!0x0)),'new'!=_0x559c68['type']&&(_0xfc8a2f||'removed'!=_0x559c68['type'])){const _0x353878=yt(_0x5dd9bf=>At(_0x5dd9bf,'data-id')==_0x559c68['id'],_0x445aa6,!0x0);_0x353878&&_0x5897b5['children']['push'](_0x353878['cloneNode'](!0x0));}const {content:_0x57c705,hasChanges:_0x3fa671}=function(_0x36ef34,_0x535c3d,_0x1506df,_0x394d9b,_0x3aaac2=!0x0){const _0x19b7e4=_0x36ef34['plugins']['get']('DocumentCompare'),_0x2bcf4e=Tt(_0x535c3d),_0x1c92e8=Tt(_0x1506df),_0x525f28=_0x36ef34['data']['parse'](_0x2bcf4e,'$root'),_0x49d936=_0x36ef34['model']['createPositionAt'](_0x525f28,0x0),_0x25c265=_0x19b7e4['getDiff'](_0x2bcf4e,_0x1c92e8,{'anchor':_0x49d936,'markDeletions':_0x394d9b}),_0x452823=_0x25c265['getOperations']();if(0x0==_0x452823['length'])return{'content':_0x535c3d['cloneNode'](!0x0),'hasChanges':!0x1};_0x394d9b?function(_0x1a70a9,_0x591d30,_0x4718d6){if(0x0==_0x1a70a9['length'])return;const _0x4d27b3=_0x4718d6['plugins']['get']('DocumentCompare'),_0x41365f=_0x4718d6['plugins']['get']('SuggestionsConversion');_0x4718d6['model']['change'](_0x286d3a=>{const _0x43bb91=new Set();for(let _0x38b5c5=0x0;_0x38b5c5<_0x1a70a9['length'];_0x38b5c5++){const _0x1c5814=_0x1a70a9[_0x38b5c5];if(_0x1c5814['baseVersion']=null,_0x1c5814['isDocumentOperation']=!0x1,_0x4d27b3['isMarkedRemoveOperation'](_0x1c5814)){const _0x14f157=_0x257910(_0x1c5814['newRange'],_0x4718d6['model']),_0x145543='suggestion:deletion:'+_0x56075e()+':$aiSuggestion';_0x591d30['markers']['set'](_0x145543,_0x14f157);}else switch(_0x1c5814['type']){case'rename':{if(_0x1c5814['oldName']==_0x1c5814['newName'])break;_0x286d3a['batch']['addOperation'](_0x1c5814),_0x4718d6['model']['applyOperation'](_0x1c5814);const _0xbb85a2='$elementName',_0x14563e=_0x1c5814['position'],_0x5563fc=_0x4718d6['model']['createRange'](_0x14563e,_0x4718d6['model']['createPositionAt'](_0x14563e['nodeAfter'],'end')),_0x1bf365='suggestion:attribute:'+_0xbb85a2+':'+_0x56075e()+':$aiSuggestion';_0x591d30['markers']['set'](_0x1bf365,_0x5563fc);break;}case'addAttribute':case'removeAttribute':case'changeAttribute':{if(_0x1c5814['oldValue']==_0x1c5814['newValue'])break;_0x286d3a['batch']['addOperation'](_0x1c5814),_0x4718d6['model']['applyOperation'](_0x1c5814);const _0x5edbaa=_0x1c5814['key'];if(!_0x41365f['isRegisteredAttribute'](_0x5edbaa))break;const _0x47e36d=_0x257910(_0x1c5814['range'],_0x4718d6['model']),_0x15605a='suggestion:attribute:'+_0x5edbaa+':'+_0x56075e()+':$aiSuggestion';_0x591d30['markers']['set'](_0x15605a,_0x47e36d);break;}case'insert':{_0x286d3a['batch']['addOperation'](_0x1c5814),_0x4718d6['model']['applyOperation'](_0x1c5814);if(_0x1a70a9[_0x38b5c5+0x1]&&'move'==_0x1a70a9[_0x38b5c5+0x1]['type']){no(_0x591d30,_0x1c5814);break;}const _0x2340bf=_0x1c5814['position'],_0x131d29=_0x1c5814['howMany'],_0x563d7f=_0x257910(_0x4718d6['model']['createRange'](_0x2340bf,_0x2340bf['getShiftedBy'](_0x131d29)),_0x4718d6['model']),_0x1b88d3='suggestion:insertion:'+_0x56075e()+':$aiSuggestion';_0x591d30['markers']['set'](_0x1b88d3,_0x563d7f);break;}case'split':{_0x286d3a['batch']['addOperation'](_0x1c5814),_0x4718d6['model']['applyOperation'](_0x1c5814);const _0x1c9fcd=_0x1c5814['splitPosition'],_0x1ecf45=_0x1c5814['moveTargetPosition'],_0x56a12a=_0x4718d6['model']['createRange'](_0x1c9fcd,_0x1ecf45),_0x17dcb4='suggestion:insertion:'+_0x56075e()+':$aiSuggestion';_0x591d30['markers']['set'](_0x17dcb4,_0x56a12a);break;}case'move':{_0x286d3a['batch']['addOperation'](_0x1c5814),_0x4718d6['model']['applyOperation'](_0x1c5814),_0x1a70a9[_0x38b5c5-0x1]&&'insert'==_0x1a70a9[_0x38b5c5-0x1]['type']&&no(_0x591d30,_0x1c5814);const _0x388454=_0x1c5814['getMovedRangeStart'](),_0x68959e=_0x1c5814['howMany'];for(let _0x2951ee=0x0;_0x2951ee<_0x68959e;_0x2951ee++){const _0x1425c5=_0x388454['getShiftedBy'](_0x2951ee)['nodeAfter'];_0x43bb91['add'](_0x1425c5);}break;}case'remove':{const _0x15c36b=_0x1c5814['sourcePosition'],_0x5b5696=_0x1c5814['howMany'],_0x1502fb=new et(_0x15c36b,_0x5b5696);_0x286d3a['batch']['addOperation'](_0x1502fb),_0x4718d6['model']['applyOperation'](_0x1502fb);break;}}}for(const _0x3ca256 of _0x43bb91){const _0xebcc73=_0x4718d6['model']['createRangeOn'](_0x3ca256),_0x2c63ae='suggestion:formatBlock:$fakeWrap:'+_0x56075e()+':$aiSuggestion';_0x591d30['markers']['set'](_0x2c63ae,_0x257910(_0xebcc73,_0x4718d6['model']));}});}(_0x452823,_0x525f28,_0x36ef34):_0x36ef34['model']['change'](_0x2dc573=>{for(const _0x45e5ce of _0x452823)if('remove'==_0x45e5ce['type']){const _0x3be795=_0x45e5ce['sourcePosition'],_0x5162c7=_0x45e5ce['howMany'],_0x36f60b=new et(_0x3be795,_0x5162c7);_0x2dc573['batch']['addOperation'](_0x36f60b),_0x36ef34['model']['applyOperation'](_0x36f60b);}else{if('marker'==_0x45e5ce['type']){const _0x154e33=_0x45e5ce['name'],_0x198f8c=_0x45e5ce['newRange'];null!==_0x198f8c?_0x525f28['markers']['set'](_0x154e33,_0x198f8c):_0x525f28['markers']['delete'](_0x154e33);}else _0x45e5ce['baseVersion']=null,_0x45e5ce['isDocumentOperation']=!0x1,_0x2dc573['batch']['addOperation'](_0x45e5ce),_0x36ef34['model']['applyOperation'](_0x45e5ce);}});if(_0x3aaac2){const _0x21d999=mt(_0x36ef34,_0x452823,_0x525f28);ft(_0x36ef34['model'],_0x21d999),function(_0x77ce48,_0x395cef){const _0x59cdb1=_0x395cef['getFirstRange']()['start'];let _0x3b2a62=_0x395cef['getFirstRange']()['end'];const _0x5a96c0=_0x59cdb1['root'];(_0x3b2a62['textNode']||_0x3b2a62['nodeAfter']&&_0x3b2a62['nodeAfter']['is']('$text'))&&(_0x2d6e6c(_0x3b2a62,'...'),_0x3b2a62=_0x3b2a62['getShiftedBy'](0x3)),(_0x59cdb1['textNode']||_0x59cdb1['nodeBefore']&&_0x59cdb1['nodeBefore']['is']('$text'))&&(_0x2d6e6c(_0x59cdb1,'...'),function(_0x3e8188,_0x5e1e81,_0x7ff428){for(let [_0x43025c,_0x57bc35]of _0x3e8188['markers']){const _0x111919=_0x57bc35['_getTransformedByInsertion'](_0x5e1e81,_0x7ff428,!0x1);_0x57bc35=_0x111919[0x0],_0x3e8188['markers']['set'](_0x43025c,_0x57bc35);}}(_0x5a96c0,_0x59cdb1,0x3),_0x59cdb1['parent']==_0x3b2a62['parent']&&(_0x3b2a62=_0x3b2a62['getShiftedBy'](0x3)));const _0xb8d2a5=_0x77ce48['createRange'](_0x77ce48['createPositionAt'](_0x5a96c0,0x0),_0x59cdb1),_0x395fb2=_0x77ce48['createRange'](_0x3b2a62,_0x77ce48['createPositionAt'](_0x5a96c0,'end')),_0x1dc646=[..._0xb8d2a5['getMinimalFlatRanges'](),..._0x395fb2['getMinimalFlatRanges']()];_0x1dc646['reverse']();for(const _0x51758d of _0x1dc646)to(_0x51758d),Yn(_0x5a96c0,_0x51758d);}(_0x36ef34['model'],_0x21d999);}const _0x48bcf9=_0x36ef34['data']['stringify'](_0x525f28,{'showSuggestionHighlights':!0x0});return{'content':Wi(_0x48bcf9),'hasChanges':!0x0};}(_0x12a270,_0x5897b5,_0x505b41,_0xfc8a2f,_0x457be6);return{'type':_0x3cbff7['changes'][0x0]['type'],'index':_0x3cbff7['index'],'content':_0x57c705,'hasChanges':_0x3fa671};});}function no(_0x4d9c5f,_0x1b106a){for(const [_0x48e26a,_0x42038d]of _0x4d9c5f['markers']){const _0x1d3183=it['_createFromRanges'](_0x42038d['getTransformedByOperation'](_0x1b106a));_0x4d9c5f['markers']['set'](_0x48e26a,_0x1d3183);}}function mt(_0x54b6b5,_0x140f93,_0x378c6e){const _0x24a9f3=_0x54b6b5['plugins']['get']('DocumentCompare');let _0xe8e7ca=_0x54b6b5['model']['createPositionAt'](_0x378c6e,Number['POSITIVE_INFINITY']),_0xf45ed8=_0x54b6b5['model']['createPositionAt'](_0x378c6e,0x0);for(const _0x5cbe2a of _0x140f93){let _0x12f5dc,_0x25ca8c;if(_0x24a9f3['isMarkedRemoveOperation'](_0x5cbe2a))_0x12f5dc=_0x5cbe2a['newRange']['start'],_0x25ca8c=_0x5cbe2a['newRange']['end'];else switch(_0xe8e7ca=_0xe8e7ca['getTransformedByOperation'](_0x5cbe2a),_0xf45ed8=_0xf45ed8['getTransformedByOperation'](_0x5cbe2a),_0x5cbe2a['type']){case'rename':_0x12f5dc=_0x5cbe2a['position'],_0x25ca8c=_0x12f5dc['getShiftedBy'](0x1);break;case'addAttribute':case'removeAttribute':case'changeAttribute':_0x12f5dc=_0x5cbe2a['range']['start'],_0x25ca8c=_0x5cbe2a['range']['end'];break;case'insert':_0x12f5dc=_0x5cbe2a['position'],_0x25ca8c=_0x12f5dc['getShiftedBy'](_0x5cbe2a['howMany']);break;case'split':_0x12f5dc=_0x5cbe2a['splitPosition'],_0x25ca8c=_0x5cbe2a['moveTargetPosition'];break;case'merge':{const _0x372853=_0x5cbe2a['targetPosition']['path']['slice'](0x0,-0x1);_0x12f5dc=_0x54b6b5['model']['createPositionFromPath'](_0x378c6e,_0x372853),_0x25ca8c=_0x12f5dc['getShiftedBy'](0x1);break;}case'remove':{const _0x4cbbad=_0x5cbe2a['howMany'],_0x179056=_0x5cbe2a['sourcePosition']['_getTransformedByInsertion'](_0x5cbe2a['targetPosition'],_0x4cbbad),_0x104015=_0x5cbe2a['getMovedRangeStart']();'remove'==_0x5cbe2a['type']?(_0x12f5dc=_0x179056,_0x25ca8c=_0x179056):(_0x12f5dc=_0x104015,_0x25ca8c=_0x104015['getShiftedBy'](_0x4cbbad));break;}}_0x12f5dc&&_0x12f5dc['isBefore'](_0xe8e7ca)&&(_0xe8e7ca=_0x12f5dc['clone'](),_0xe8e7ca['stickiness']='toNone'),_0x25ca8c&&_0x25ca8c['isAfter'](_0xf45ed8)&&(_0xf45ed8=_0x25ca8c['clone'](),_0xf45ed8['stickiness']='toNone');}return _0x54b6b5['model']['createSelection'](_0x54b6b5['model']['createRange'](_0xe8e7ca,_0xf45ed8));}function ft(_0x27a80a,_0x2565d6){ro(_0x27a80a,_0x2565d6,'forward');const _0x573e55=_0x2565d6['getFirstRange']();_0x2565d6['setTo']([]),_0x2565d6['setTo'](_0x573e55,{'backward':!0x0}),ro(_0x27a80a,_0x2565d6,'backward');}function ro(_0x3882a9,_0x262d21,_0x42f0ea){let _0x36f541=0x14;for(;_0x36f541;){_0x3882a9['modifySelection'](_0x262d21,{'unit':'word','direction':_0x42f0ea}),_0x36f541--;const _0x2c661d=_0x262d21['focus']['forward'==_0x42f0ea?'nodeBefore':'nodeAfter'];if(_0x2c661d&&_0x2c661d['is']('element')&&_0x3882a9['schema']['isBlock'](_0x2c661d)&&_0x3882a9['schema']['isObject'](_0x2c661d))break;}}function Yn(_0x2861ad,_0x1d5730){for(const [_0x2caf85,_0x54113a]of _0x2861ad['markers']){const _0x43ea48=_0x54113a['_getTransformedByDeletion'](_0x1d5730['start'],_0x1d5730['end']['offset']-_0x1d5730['start']['offset']);null!=_0x43ea48?_0x2861ad['markers']['set'](_0x2caf85,_0x43ea48):_0x2861ad['markers']['delete'](_0x2caf85);}}class Ge extends ts(){['id'];['interactionId'];['type'];['sources']=[];['parsedContent']=new Et([]);['parsedMergedContent']=new Et([]);['changeGroups']=[];['areActionsDisabled']=!0x1;['documentContextContent'];['aiResponseParser'];['aiResponseApplier'];['editor'];['cachedSuggestionContentParts']={'withDiff':[],'withoutDiff':[]};constructor({type:_0x479eb0,content:_0x508b46='',isDone:_0x3c9df5=!0x1,interactionId:_0x12dea2,areActionsDisabled:_0x2d8ea9,documentContextContent:_0x3aa0af,editor:_0x538bf4,id:_0x8870d3}){super(),this['id']=_0x8870d3||_0x56075e(),this['interactionId']=_0x12dea2,this['type']=_0x479eb0,this['areActionsDisabled']=!!_0x2d8ea9,this['editor']=_0x538bf4,this['aiResponseParser']=new Ki(),this['aiResponseApplier']=new Qi(),this['documentContextContent']=Wi(_0x3aa0af||''),this['set']('isDone',_0x3c9df5),this['on']('change:content',()=>{this['onContentChange']();}),this['set']('content',_0x508b46);}['appendContent'](_0x3bef25){this['set']('content',this['content']+_0x3bef25);}['done'](){this['isDone']||(this['set']('isDone',!0x0),this['onContentChange']());}['destroy'](){this['stopListening']();}['setChangeGroupState'](_0x143e97,_0x3b74dd){this['changeGroups'][_0x143e97]['state']=_0x3b74dd,this['fire']('replyChangeGroupStateUpdated',{'reply':this,'index':_0x143e97,'state':_0x3b74dd});}['getContentParts']({showDiff:_0x240e49,groupIndex:_0x3dd633}){if(!this['editor'])throw new _0x2ae61f('ai-get-editor-from-context-no-editor',null,{'aiReply':this});const _0x3d84f8=this['_getCachedContentParts'](_0x240e49,_0x3dd633);if(_0x3d84f8)return _0x3d84f8;let _0x394fa9=[];if(void 0x0===_0x3dd633)_0x394fa9=this['changeGroups'];else{const _0x266cc9=this['changeGroups']['find'](({index:_0x5219ce})=>_0x5219ce===_0x3dd633);if(!_0x266cc9)throw new _0x2ae61f('ai-reply-get-content-parts-group-not-found',null,{'aiReply':this,'groupIndex':_0x3dd633});_0x394fa9=[_0x266cc9];}const _0x44553c=J({'editor':this['editor'],'showDiff':_0x240e49,'changeGroups':_0x394fa9,'documentContextContent':this['documentContextContent']});return this['_setCachedContentParts'](_0x240e49,_0x44553c),_0x44553c;}['_getCachedContentParts'](_0x1a649e,_0x152678){const _0x4298e4=_0x1a649e?'withDiff':'withoutDiff';if(!this['cachedSuggestionContentParts'][_0x4298e4]['length'])return null;const _0x34db41=this['cachedSuggestionContentParts'][_0x4298e4];if(void 0x0===_0x152678)return _0x34db41['length']>0x0&&_0x34db41['length']!==this['changeGroups']['length']?(this['_setCachedContentParts'](_0x1a649e,null),null):_0x2e8fe2(_0x34db41);{const _0x52e7a8=_0x34db41['find'](({index:_0x29dad2})=>_0x29dad2===_0x152678);if(_0x52e7a8)return[_0x2e8fe2(_0x52e7a8)];}return null;}['_setCachedContentParts'](_0x338fa7,_0x54755c){const _0x460ee7=_0x338fa7?'withDiff':'withoutDiff';_0x54755c?_0x54755c['forEach'](_0x19354c=>{const _0x16f7bd=this['cachedSuggestionContentParts'][_0x460ee7],_0x52323d=_0x16f7bd['find'](({index:_0x1cd5a9})=>_0x1cd5a9===_0x19354c['index']);if(_0x52323d){const _0x5741a6=_0x16f7bd['indexOf'](_0x52323d);_0x16f7bd['splice'](_0x5741a6,0x1,_0x19354c);}else _0x16f7bd['push'](_0x19354c);}):this['cachedSuggestionContentParts'][_0x460ee7]['length']=0x0;}['onContentChange'](){if('modification'===this['type']){this['parsedContent']=this['aiResponseParser']['parseAndNormalizeHTML'](this['content']);const _0x4675c5=this['changeGroups'];this['updateChangeGroups']();const _0x547e85=this['_getDifferentChangeGroups'](_0x4675c5,this['changeGroups']);(_0x547e85['length']||this['isDone'])&&(this['fire']('replyContentUpdated',this,_0x547e85),this['cachedSuggestionContentParts']['withDiff']['length']=this['cachedSuggestionContentParts']['withoutDiff']['length']=0x0);}else this['parsedContent']=this['aiResponseParser']['convertMarkdownToHTML'](this['content']),this['fire']('replyContentUpdated',this);}['_getDifferentChangeGroups'](_0x24b1cd,_0x431a4b){const _0x4a4a82=[];for(const _0x55e8d0 of _0x431a4b){const _0x290c6f=_0x24b1cd[_0x55e8d0['index']];_0x290c6f?_0x290c6f['changes']['length']!==_0x55e8d0['changes']['length']?_0x4a4a82['push'](_0x55e8d0):_0x290c6f['changes']['forEach']((_0x164bad,_0x3f23fc)=>{const _0x2647fe=_0x55e8d0['changes'][_0x3f23fc];_0x164bad['id']!==_0x2647fe['id']&&_0x4a4a82['push'](_0x55e8d0);}):_0x4a4a82['push'](_0x55e8d0);}return _0x4a4a82;}['updateChangeGroups'](){const _0x9a71e9=new _0x44dddb('p',{},[new _0x44dddb('span',{'style':'color:\x20#808080;\x20font-style:\x20italic'},[new _0x389e0a(i(this['editor']['locale'],'AI_SUGGESTION_CONTENT_PART_REMOVED'))])]),_0x124ac8=this['aiResponseApplier']['merge'](this['parsedContent'],this['documentContextContent']['cloneNode'](!0x0),{'markUnstableElements':!this['isDone'],'replaceRemovedWith':_0x9a71e9,'cutAfterLastChange':!this['isDone']});if(!_0x124ac8['modifiedNodeIds']['length']&&!this['isDone'])return;this['parsedMergedContent']=_0x124ac8['parsedContent'];let _0xe7a2ba=[];if(_0x30053d(_0x1b1ca4=>{const _0x209a4e=At(_0x1b1ca4,'data-id');if(!_0x209a4e||!_0x1649db(_0x209a4e))return!0x1;const _0x1bc622=[_0x1b1ca4,...Ui(_0x1b1ca4)]['at'](-0x2);if(_0x1b1ca4!=_0x1bc622){const _0x2abfe8=At(_0x1bc622,'data-id');_0x1649db(_0x2abfe8)||(_0xe7a2ba['push']({'node':_0x1bc622,'id':_0x2abfe8,'type':'modified'}),_0x124ac8['modifiedNodeIds']['push'](_0x2abfe8));}else _0x124ac8['modifiedNodeIds']['includes'](_0x209a4e)?_0xe7a2ba['push']({'node':_0x1b1ca4,'type':'modified','id':_0x209a4e}):_0x124ac8['newNodeIds']['includes'](_0x209a4e)?_0xe7a2ba['push']({'node':_0x1b1ca4,'type':'new','id':_0x209a4e,'anchorId':At(_0x1b1ca4['previousSibling'],'data-id')}):_0xe7a2ba['push']({'node':_0x1b1ca4,'type':'removed','id':_0x209a4e});return!0x0;},this['parsedMergedContent']),_0xe7a2ba=_0xe7a2ba['filter'](({node:_0x283444})=>[...Ui(_0x283444),_0x283444]['every'](_0x57e42a=>!At(_0x57e42a,'data-unstable'))),0x0==_0xe7a2ba['length'])return;const _0x3dbb70=[[_0xe7a2ba[0x0]]];for(let _0x3dfc87=0x1;_0x3dfc87<_0xe7a2ba['length'];_0x3dfc87++){const _0x4d5b45=_0x3dbb70[_0x3dbb70['length']-0x1],_0x20a56f=_0x4d5b45[_0x4d5b45['length']-0x1];_0xe7a2ba[_0x3dfc87]['node']['previousSibling']==_0x20a56f['node']&&'modified'!=_0xe7a2ba[_0x3dfc87]['type']&&'modified'!=_0x20a56f['type']?_0x4d5b45['push'](_0xe7a2ba[_0x3dfc87]):_0x3dbb70['push']([_0xe7a2ba[_0x3dfc87]]);}for(const _0x1183c3 of _0x3dbb70){const _0x1bcdce=_0x1183c3[0x0],_0x3d9767=_0x1183c3[_0x1183c3['length']-0x1],_0x328d75=_0x24c9fc(_0x1bcdce['node']['previousSibling']);_0x328d75&&_0x1183c3['unshift'](_0x328d75);const _0x3ca31e=_0x24c9fc(_0x3d9767['node']['nextSibling']);_0x3ca31e&&_0x1183c3['push'](_0x3ca31e);}function _0x1649db(_0x450340){return _0x124ac8['modifiedNodeIds']['includes'](_0x450340)||_0x124ac8['newNodeIds']['includes'](_0x450340)||_0x124ac8['removedNodeIds']['includes'](_0x450340);}function _0x24c9fc(_0x31806f){if(_0x31806f&&At(_0x31806f,'data-id')&&!At(_0x31806f,'data-unstable')){const _0x58c666=At(_0x31806f,'data-id');if(!_0x1649db(_0x58c666))return{'node':_0x31806f,'type':'context','id':_0x58c666};}return null;}this['changeGroups']=_0x3dbb70['map']((_0x585488,_0x263612)=>({'changes':_0x585488,'state':'pending','index':_0x263612}));}}const ye=['interactionCreated','interactionStarted','interactionStopped','interactionFinished','interactionDestroyed','replyCreated','replyContentUpdated','replyChangeGroupStateUpdated','setConversationTitle','webSearchStarted','webSearchFinished','reasoningStarted','reasoningFinished','toolDataReceived','error'];class xe extends _0x428ca4(){['id'];['replies']=[];['currentReply'];['messageId'];['actionCallId'];['currentRequest'];['connector'];['isStopped']=!0x1;['isDestroyed']=!0x1;['editor'];['_isReasoning']=!0x1;['_isWebSearching']=!0x1;constructor({connector:_0x4f2177,editor:_0x1a7a96}){super(),this['id']=_0x56075e(),this['connector']=_0x4f2177,this['isStopped']=!0x0,this['editor']=_0x1a7a96;}async['start'](){const _0x2cba49=[];let _0x54a7bf,_0x35089f,_0x14f005;this['isStopped']=!0x1;try{this['currentRequest']=await this['sendRequest'](),this['fire']('interactionStarted',this);const _0xc10fde=await this['currentRequest']['getStream']();for await(const _0x2019bf of _0xc10fde){if(this['isStopped'])return;if('error'==_0x2019bf['event'])return void this['fire']('error',{'error':new _0x2ae61f('ai-chat-interaction-error',this)});switch(_0x2019bf['event']){case'message-metadata':this['messageId']=_0x2019bf['data']['messageId'];break;case'action-metadata':this['actionCallId']=_0x2019bf['data']['callId'];break;case'conversation-title':this['setConversationTitle'](_0x2019bf['data']['conversationTitle'],!0x0);break;case'source':_0x2cba49['push'](_0x2019bf['data']['source']);break;case'web-search':this['_isWebSearching']||(this['_isWebSearching']=!0x0,this['fire']('webSearchStarted',this));break;case'reasoning':this['_isReasoning']||(this['_isReasoning']=!0x0,this['fire']('reasoningStarted',this));break;case'modification-delta':case'text-delta':this['resetReasoningState'](),this['resetWebSearchState'](),_0x54a7bf='modification-delta'==_0x2019bf['event']?'modification':'text',_0x35089f='modification-delta'==_0x2019bf['event']?_0x2019bf['data']['id']:void 0x0,this['currentReply']&&this['currentReply']['type']!=_0x54a7bf&&(this['currentReply']['done'](),this['currentReply']=void 0x0),this['currentReply']||(this['currentReply']=this['createReply']({'type':_0x54a7bf,'interactionId':this['id'],'id':_0x35089f}),'modification'==_0x54a7bf&&(this['currentReply']['sources']=_0x2cba49['splice'](0x0))),this['currentReply']['appendContent'](_0x2019bf['data']['textDelta']);break;case'mcp-tool-result':_0x14f005=JSON['parse'](_0x2019bf['data']['result']),this['_handleToolResultData']({'toolName':_0x2019bf['data']['toolName'],'data':_0x14f005['data'],'attributes':_0x14f005['attributes']});break;case'mcp-tool-notification':this['_handleToolNotificationData']({'toolName':_0x2019bf['data']['toolName'],'data':_0x2019bf['data']['data']});}}}finally{this['isStopped']||(this['currentReply']&&_0x2cba49['length']>0x0&&(this['currentReply']['sources']=_0x2cba49['splice'](0x0)),this['_finalizeInteraction'](),this['fire']('interactionFinished',this));}}['stop'](){this['isStopped']||(this['_finalizeInteraction'](),this['fire']('interactionStopped',this));}['getReply'](_0x5b9bda){return this['replies']['find'](_0x50cba9=>_0x50cba9['id']===_0x5b9bda);}['destroy'](){this['isDestroyed']||(this['stop'](),this['replies']['forEach'](_0x42c5af=>_0x42c5af['destroy']()),this['replies']=[],this['isDestroyed']=!0x0,this['fire']('interactionDestroyed',this),this['stopListening']());}['createReply'](_0x412740){const _0x2fe969=new Ge({'editor':this['editor'],'documentContextContent':this['getDocumentContext']()?.['content'],..._0x412740});return this['replies']['push'](_0x2fe969),_0x2fe969['delegate'](...ye)['to'](this),this['fire']('replyCreated',_0x2fe969),_0x2fe969;}['setConversationTitle'](_0x109dc4,_0x1ec4ed=!0x1){this['fire']('setConversationTitle',_0x109dc4,_0x1ec4ed);}['resetWebSearchState'](){this['_isWebSearching']&&(this['_isWebSearching']=!0x1,this['fire']('webSearchFinished',this));}['resetReasoningState'](){this['_isReasoning']&&(this['_isReasoning']=!0x1,this['fire']('reasoningFinished',this));}['_handleToolResultData'](_0x389942){this['fire']('toolDataReceived',{'type':'result','toolName':_0x389942['toolName'],'data':structuredClone(_0x389942['data']||{}),'attributes':structuredClone(_0x389942['attributes']||{})},this);}['_handleToolNotificationData'](_0x42ea80){this['fire']('toolDataReceived',{'type':'notification','toolName':_0x42ea80['toolName'],'data':structuredClone(_0x42ea80['data'])},this);}['_finalizeInteraction'](){this['isStopped']=!0x0,this['currentRequest']&&this['currentRequest']['abortController']['abort'](),this['currentReply']&&this['currentReply']['done'](),this['currentRequest']=this['currentReply']=void 0x0;}}var qe=function(_0x1fb51c){return _0x1fb51c['TOOL']='mcp-tool-context',_0x1fb51c['FILE']='file',_0x1fb51c['DOCUMENT']='document',_0x1fb51c['URL']='web-resource',_0x1fb51c['TEXT']='text',_0x1fb51c['SELECTION']='selection',_0x1fb51c;}({}),Fe=function(_0x51c632){return _0x51c632['TEXT']='text',_0x51c632['MARKDOWN']='markdown',_0x51c632['HTML']='html',_0x51c632;}({});const Ue=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']]),He=['contextItemAdded','contextItemRemoved','contextItemLoadingEnded','contextSent','error','addContextOptionsChanged','sourceResourcesLoaded','resourceStateChanged','uploadProgressChanged'];class We extends ts(){['_connector'];['_config'];['_ownerId'];constructor({connector:_0x24b150,config:_0x30eb23,ownerId:_0x3d5e54}){super(),this['_connector']=_0x24b150,this['_config']=_0x30eb23,this['_ownerId']=_0x3d5e54;}['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'](_0x5c1de4){const _0x307408=await this['_createContextItemFromContent'](_0x5c1de4);return this['_addToConversationContextItem'](_0x307408),'current-document'===_0x307408['uiId']&&this['_toggleAddCurrentDocumentOptionVisibility'](),_0x307408;}async['_createContextItemFromContent'](_0x5a6c26){if(_0x5a6c26['type']===qe['DOCUMENT']){const _0x5accdf=await this['_connector']['fetchDocument'](this['_ownerId'],_0x5a6c26['id'])['getDocument']();return{'id':'current-document','uiId':'current-document','label':'Current\x20document','type':_0x5a6c26['type'],'content':_0x5accdf['content'],'hidden':this['_conversationContextItems']['has']('current-document'),'version':_0x5accdf['attributes']?.['version'],'sessionId':_0x5accdf['attributes']?.['sessionId']};}if(_0x5a6c26['type']===qe['TOOL'])return{'id':_0x5a6c26['id'],'uiId':_0x5a6c26['id'],'label':_0x5a6c26['data']?.['label']||_0x5a6c26['id'],'type':qe['TOOL'],'mcpServerName':_0x5a6c26['mcpServerName'],'toolName':_0x5a6c26['toolName'],'data':_0x5a6c26['data']||{}};return{'id':_0x5a6c26['id'],'uiId':_0x5a6c26['id'],'label':_0x5a6c26['attributes']?.['label']||_0x5a6c26['name']||_0x5a6c26['url']||_0x5a6c26['id'],'type':_0x5a6c26['type'],..._0x5a6c26?.['attributes']?.['resourceId']?{'resourceId':_0x5a6c26['attributes']?.['resourceId']}:{}};}['getSentContextItems'](){return new Map(this['_conversationContextItems']);}['removeFromContext'](_0x3d39f3){const _0x3433f2=this['_pendingContextItems']['get'](_0x3d39f3);_0x3433f2?.['isReadOnly']||this['_removeContextItem'](_0x3d39f3);}['clearPendingContextItems'](){if(0x0===this['_pendingContextItems']['size'])return;for(const _0x29b1d7 of this['_pendingContextItems']['values']())this['_removeContextItem'](_0x29b1d7['uiId']);const _0x4c48b8=this['_conversationContextItems']['get']('current-document')||this['_pendingContextItems']['get']('current-document');_0x4c48b8&&this['_addContextItem']({..._0x4c48b8,'isReadOnly':!0x0,'hidden':!0x0});}['addToConversationContext'](_0x2e9bad){for(const _0x170050 of _0x2e9bad['values']())this['_addToConversationContextItem'](_0x170050);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'](_0x29adda){return Array['from'](_0x29adda['values']())['map'](_0x47dc96=>this['_mapContextItemToRequestData'](_0x47dc96))['filter'](_0x49fe43=>null!==_0x49fe43);}async['addFilesToContext'](_0x1ab657,_0x1c8ef5,_0x5bdd9d=qe['FILE']){const _0x38b9a3='files-'+_0x56075e();this['_startUploadOperation'](_0x38b9a3);try{await Promise['all'](_0x1ab657['map'](async _0x9d8f53=>{const _0x2cd2de='file-'+_0x56075e(),_0x29dcaa=_0x2fa641(_0x9d8f53['name']);try{this['_addContextItem']({'type':_0x5bdd9d,'label':_0x1c8ef5?.['label']||_0x29dcaa,'uiId':_0x2cd2de,'resourceId':_0x1c8ef5?.['resourceId']},!0x0);const _0x5e9e50=this['_connector']['uploadFile'](this['_ownerId'],_0x9d8f53,_0x1c8ef5);this['_ongoingUploads']['set'](_0x2cd2de,_0x5e9e50['abortController']);const {id:_0x4c3084}=await _0x5e9e50['getId']();this['_ongoingUploads']['delete'](_0x2cd2de),this['_finishContextItemLoading']({'type':_0x5bdd9d,'id':_0x4c3084,'label':_0x1c8ef5?.['label']||_0x29dcaa,'uiId':_0x2cd2de,'resourceId':_0x1c8ef5?.['resourceId']},!0x1);}catch(_0x53f5d4){this['_ongoingUploads']['delete'](_0x2cd2de);if(!(_0x53f5d4 instanceof _0x2ae61f&&_0x53f5d4['message']['startsWith']('ai-request-aborted'))){const _0x51c939=Ue['get'](_0x53f5d4['code'])||'ai-chat-file-upload-failed',_0x24ee63=new _0x2ae61f(_0x51c939,null,{'fileName':_0x29dcaa,..._0x53f5d4});_0x24ee63['stack']=_0x53f5d4['stack'],this['fire']('error',{'error':_0x24ee63});}this['_removeContextItem'](_0x2cd2de);}}));}finally{this['_finishUploadOperation'](_0x38b9a3);}}['addCurrentDocumentToContext'](_0x4daddd){if(this['isCurrentDocumentInContext']()||!this['_addContextOptionsState']['document']['enabled'])return;const _0x24d1b1={'type':qe['DOCUMENT'],'uiId':'current-document','label':_0x4daddd,'isReadOnly':this['_conversationContextItems']['has']('current-document'),'hidden':this['_conversationContextItems']['has']('current-document')};this['_addContextItem'](_0x24d1b1);}async['updateCurrentDocument'](_0x299ea1,_0x5a5b5d,_0x439f12,_0x3ca074){const _0x2c6bf5=this['_pendingContextItems']['get']('current-document');if(_0x2c6bf5&&_0x299ea1){_0x2c6bf5['selection']=_0x3ca074?_0x3ca074['map'](_0x407024=>({'start':_0x407024['start'],'end':_0x407024['end']})):[];try{if(_0x2c6bf5['version']===_0x5a5b5d)return;const {id:_0x22dd46}=await this['_connector']['uploadDocument'](this['_ownerId'],_0x299ea1,{'version':_0x5a5b5d,'sessionId':_0x439f12})['getId']();_0x2c6bf5['id']=_0x22dd46,_0x2c6bf5['content']=_0x299ea1,_0x2c6bf5['version']=_0x5a5b5d,_0x2c6bf5['sessionId']=_0x439f12;}catch(_0x69be14){const _0x575a60=new _0x2ae61f('ai-chat-document-upload-failed',null);_0x575a60['stack']=_0x69be14['stack'],this['fire']('error',{'error':_0x575a60});}}}['addSelectionToContext'](_0x19c823){this['_addContextItem']({'type':qe['SELECTION'],'label':_0x19c823,'uiId':'selection','content':_0x19c823});}['removeSelectionFromContext'](){this['_removeContextItem']('selection');}async['addUrlToContext'](_0x37714c,_0x528f50){const _0x26d96f='url-'+_0x56075e();this['_startUploadOperation'](_0x26d96f);const _0x40064f='url-'+_0x56075e();try{this['_addContextItem']({'type':qe['URL'],'label':_0x528f50?.['label']||_0x37714c,'uiId':_0x40064f,'resourceId':_0x528f50?.['resourceId']},!0x0);const _0x3bda60=this['_connector']['uploadUrl'](this['_ownerId'],_0x37714c,_0x528f50);this['_ongoingUploads']['set'](_0x40064f,_0x3bda60['abortController']);const {id:_0x177328}=await _0x3bda60['getId']();this['_ongoingUploads']['delete'](_0x40064f),this['_finishContextItemLoading']({'type':qe['URL'],'id':_0x177328,'label':_0x528f50?.['label']||_0x37714c,'uiId':_0x40064f,'resourceId':_0x528f50?.['resourceId']},!0x1);}catch(_0x247e65){this['_ongoingUploads']['delete'](_0x40064f),(_0x247e65['message']['startsWith']('ai-request-aborted')||this['fire']('error',{'error':new _0x2ae61f('ai-chat-url-upload-failed',this,{'url':_0x37714c,'originalError':_0x247e65}),'url':_0x37714c}),this['_removeContextItem'](_0x40064f));}finally{this['_finishUploadOperation'](_0x26d96f);}}['addToolItemToContext'](_0x37ea05){_0x37ea05['id']=_0x37ea05['id']??_0x56075e()['substring'](0x0,0x15),this['_pendingContextItems']['set'](_0x37ea05['uiId'],_0x37ea05),this['fire']('contextItemAdded',{'contextItem':_0x37ea05,'isLoading':!0x1});}async['loadSourceResources'](_0x5d95e8,_0x197785,_0x449779){const _0x39a576=this['_addContextOptionsState']['sources']['find'](_0x3054cc=>_0x3054cc['id']===_0x5d95e8);if(!_0x39a576)return this['fire']('error',{'error':new _0x2ae61f('ai-chat-source-not-found',this,{'sourceId':_0x5d95e8}),'sourceId':_0x5d95e8}),[];try{const _0x572237=(await _0x39a576['getResources'](_0x197785))['map'](_0x8eb8f5=>{const _0x5094c0=this['_isResourceInContext'](_0x8eb8f5['id']);return{..._0x8eb8f5,'isInContext':_0x5094c0};});return _0x39a576['resources']=_0x572237,this['fire']('sourceResourcesLoaded',{'sourceId':_0x5d95e8,'source':_0x39a576,'resources':_0x572237,'uid':_0x449779}),_0x572237;}catch(_0x4e78a1){return this['fire']('error',{'error':new _0x2ae61f('ai-chat-source-resources-load-failed',this,{'sourceId':_0x5d95e8,'originalError':_0x4e78a1}),'sourceId':_0x5d95e8,'sourceLabel':_0x39a576['label']}),[];}}async['addResourceToContext'](_0x1448ee,_0x26af6a){if(this['_isResourceInContext'](_0x26af6a['id']))return;let _0x2c23c6=_0x26af6a['data'];if(!_0x2c23c6&&_0x1448ee['getData'])try{_0x2c23c6=await _0x1448ee['getData'](_0x26af6a['id']);}catch(_0xf5411a){return void this['fire']('error',{'error':new _0x2ae61f('ai-chat-resource-load-failed',this,{'resourceId':_0x26af6a['id'],'sourceId':_0x1448ee['id'],'originalError':_0xf5411a}),'resourceId':_0x26af6a['id'],'sourceId':_0x1448ee['id']});}if(_0x2c23c6)switch(_0x26af6a['type']){case qe['URL']:if('string'!=typeof _0x2c23c6)return void this['fire']('error',{'error':new _0x2ae61f('ai-chat-context-invalid-data',this,{'resourceId':_0x26af6a['id'],'sourceId':_0x1448ee['id'],'expectedType':'string','actualType':typeof _0x2c23c6}),'resourceId':_0x26af6a['id'],'sourceId':_0x1448ee['id']});await this['addUrlToContext'](_0x2c23c6,{'label':_0x26af6a['label'],'resourceId':_0x26af6a['id']});break;case qe['FILE']:if(!(_0x2c23c6 instanceof File))return void this['fire']('error',{'error':new _0x2ae61f('ai-chat-context-invalid-data',this,{'resourceId':_0x26af6a['id'],'sourceId':_0x1448ee['id'],'expectedType':'File','actualType':typeof _0x2c23c6}),'resourceId':_0x26af6a['id'],'sourceId':_0x1448ee['id']});await this['addFilesToContext']([_0x2c23c6],{'label':_0x26af6a['label'],'resourceId':_0x26af6a['id']});break;case qe['TEXT']:if('object'!=typeof _0x2c23c6||!('content'in _0x2c23c6)||!('type'in _0x2c23c6))return void this['fire']('error',{'error':new _0x2ae61f('ai-chat-context-invalid-data',this,{'resourceId':_0x26af6a['id'],'sourceId':_0x1448ee['id'],'expectedType':'object\x20with\x20content\x20and\x20type\x20properties','actualType':typeof _0x2c23c6}),'resourceId':_0x26af6a['id'],'sourceId':_0x1448ee['id']});_0x2c23c6=We['_convertTextResourceToFile'](_0x2c23c6,_0x26af6a['label']),await this['addFilesToContext']([_0x2c23c6],{'label':_0x26af6a['label'],'resourceId':_0x26af6a['id']},qe['TEXT']);break;case qe['TOOL']:break;default:this['fire']('error',{'error':new _0x2ae61f('ai-chat-context-unsupported-type',this,{'resourceId':_0x26af6a['id'],'sourceId':_0x1448ee['id'],'resourceType':_0x26af6a['type']}),'resourceId':_0x26af6a['id'],'sourceId':_0x1448ee['id']});}else this['fire']('error',{'error':new _0x2ae61f('ai-chat-resource-no-data',this,{'resourceId':_0x26af6a['id'],'sourceId':_0x1448ee['id']}),'resourceId':_0x26af6a['id'],'sourceId':_0x1448ee['id']});}static['_convertTextResourceToFile'](_0x33f70b,_0x1094c7){switch(_0x33f70b['type']){case Fe['MARKDOWN']:return new File([_0x33f70b['content']],_0x1094c7,{'type':'text/markdown'});case Fe['HTML']:return new File([_0x33f70b['content']],_0x1094c7,{'type':'text/html'});default:return new File([_0x33f70b['content']],_0x1094c7,{'type':'text/plain'});}}static['_mapContextItemToRequestData'](_0x3e40e9){switch(_0x3e40e9['type']){case qe['FILE']:return{'type':qe['FILE'],'id':_0x3e40e9['id']};case qe['URL']:return{'type':qe['URL'],'id':_0x3e40e9['id']};case qe['DOCUMENT']:return{'type':qe['DOCUMENT'],'id':_0x3e40e9['id'],..._0x3e40e9['selection']?.['length']&&{'selection':_0x3e40e9['selection']}};case qe['TEXT']:return{'type':qe['FILE'],'id':_0x3e40e9['id']};case qe['TOOL']:{const _0x370ece=_0x3e40e9;return{'type':qe['TOOL'],'mcpServerName':_0x370ece['mcpServerName'],'toolName':_0x370ece['toolName'],'data':_0x370ece['data'],'id':_0x370ece['id']};}default:return null;}}['_addContextItem'](_0x371712,_0x3bbdfa=!0x1){if(this['_pendingContextItems']['set'](_0x371712['uiId'],_0x371712),_0x371712['hidden']||this['fire']('contextItemAdded',{'contextItem':_0x371712,'isLoading':_0x3bbdfa}),'current-document'===_0x371712['uiId']&&this['_toggleAddCurrentDocumentOptionVisibility'](),_0x371712['resourceId']){const _0x378259=this['_findSourceIdsByResourceId'](_0x371712['resourceId']);_0x378259&&_0x378259['forEach'](_0x5da242=>{this['_updateResourceInContextState'](_0x5da242,_0x371712['resourceId'],!0x0);});}}['_removeContextItem'](_0x399e44){const _0x12d5a7=this['_pendingContextItems']['get'](_0x399e44),_0x38c8f0=this['_ongoingUploads']['get'](_0x399e44);if(_0x38c8f0&&(_0x38c8f0['abort'](),this['_ongoingUploads']['delete'](_0x399e44)),_0x12d5a7?.['resourceId']){const _0x35c82=this['_findSourceIdsByResourceId'](_0x12d5a7['resourceId']);_0x35c82&&_0x35c82['forEach'](_0x5bc906=>{this['_updateResourceInContextState'](_0x5bc906,_0x12d5a7['resourceId'],!0x1);});}this['_pendingContextItems']['delete'](_0x399e44),this['fire']('contextItemRemoved',{'uiId':_0x399e44,'type':_0x12d5a7?.['type']}),'current-document'===_0x399e44&&this['_toggleAddCurrentDocumentOptionVisibility']();}['_finishContextItemLoading'](_0x2e4186,_0x3ebdd4){if(this['_pendingContextItems']['has'](_0x2e4186['uiId'])&&(this['_pendingContextItems']['set'](_0x2e4186['uiId'],_0x2e4186),this['fire']('contextItemLoadingEnded',{'contextItem':_0x2e4186,'isLoading':_0x3ebdd4}),_0x2e4186['resourceId'])){const _0x40cb78=this['_findSourceIdsByResourceId'](_0x2e4186['resourceId']);_0x40cb78&&_0x40cb78['forEach'](_0x24871c=>{this['_updateResourceInContextState'](_0x24871c,_0x2e4186['resourceId'],!0x0);});}}['_addToConversationContextItem'](_0x38b545){this['_conversationContextItems']['set'](_0x38b545['uiId'],_0x38b545);}['_setAddContextOptionsDefaultState'](){this['_addContextOptionsState']={'document':{'enabled':!0x1!==this['_config']?.['document']?.['enabled'],'isHidden':!0x1},'urls':{'enabled':!0x1!==this['_config']?.['urls']?.['enabled']},'files':{'enabled':!0x1!==this['_config']?.['files']?.['enabled']},'sources':this['_getCustomSourcesInitialState'](),'customItems':this['_config']?.['customItems']?.['map'](_0x1a17e7=>({..._0x1a17e7,'enabled':!0x0}))??[]},this['fire']('addContextOptionsChanged',{'options':this['_addContextOptionsState']});}['_getCustomSourcesInitialState'](){return this['_config']?.['sources']?.['map'](_0x10c505=>({..._0x10c505,'resources':[]}))??[];}['_toggleAddCurrentDocumentOptionVisibility'](){const _0x4c90b7=this['isCurrentDocumentInContext']()||this['isCurrentDocumentInConversation']();this['_addContextOptionsState']['document']['isHidden']=_0x4c90b7,this['fire']('addContextOptionsChanged',{'options':this['_addContextOptionsState']});}['_isResourceInContext'](_0x32839c){for(const _0x71399c of this['_pendingContextItems']['values']())if(_0x71399c['resourceId']===_0x32839c)return!0x0;for(const _0x613359 of this['_conversationContextItems']['values']())if(_0x613359['resourceId']===_0x32839c)return!0x0;return!0x1;}['_findSourceIdsByResourceId'](_0x1c1687){const _0x21748c=[];for(const _0x4e06a2 of this['_addContextOptionsState']['sources']){_0x4e06a2['resources']['find'](_0x4d9436=>_0x4d9436['id']===_0x1c1687)&&_0x21748c['push'](_0x4e06a2['id']);}return 0x0===_0x21748c['length']?null:_0x21748c;}['_updateResourceInContextState'](_0x332ce5,_0x31fc6f,_0x3631cd){const _0x3a1769=this['_addContextOptionsState']['sources']['find'](_0x2c3e0b=>_0x2c3e0b['id']===_0x332ce5);if(!_0x3a1769)return;const _0xe61b4d=_0x3a1769['resources']['find'](_0x8c7db4=>_0x8c7db4['id']===_0x31fc6f);_0xe61b4d&&(_0xe61b4d['isInContext']=_0x3631cd,this['fire']('resourceStateChanged',{'sourceId':_0x332ce5,'resourceId':_0x31fc6f,'isInContext':_0x3631cd}));}['_startUploadOperation'](_0x52bce4){this['_ongoingUploadOperations']['set'](_0x52bce4,!0x0),this['_ongoingUploadOperations']['size']&&this['fire']('uploadProgressChanged',{'isUploadInProgress':!0x0});}['_finishUploadOperation'](_0x25e157){this['_ongoingUploadOperations']['delete'](_0x25e157),0x0===this['_ongoingUploadOperations']['size']&&this['fire']('uploadProgressChanged',{'isUploadInProgress':!0x1});}}const Be=['capabilitiesUpdated'];class Je extends _0x428ca4(){['_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'](_0x46d4d5){const _0x5188cc={};return _0x46d4d5&&_0x46d4d5['isWebSearchEnabled']&&(_0x5188cc['webSearch']={}),_0x46d4d5&&_0x46d4d5['isReasoningEnabled']&&(_0x5188cc['reasoning']={}),_0x5188cc;}['toggleWebSearch'](){this['setWebSearch'](!this['_isWebSearchEnabled']);}['toggleReasoning'](){this['setReasoning'](!this['_isReasoningEnabled']);}['setWebSearch'](_0x41a7d3){_0x41a7d3!==this['_isWebSearchEnabled']&&(this['_isWebSearchEnabled']=_0x41a7d3,this['fire']('capabilitiesUpdated',this['getCapabilitiesConfig']()));}['setReasoning'](_0x2a8ddb){_0x2a8ddb!==this['_isReasoningEnabled']&&(this['_isReasoningEnabled']=_0x2a8ddb,this['fire']('capabilitiesUpdated',this['getCapabilitiesConfig']()));}}class Ke extends xe{['userMessage'];['conversationId'];['contextItems']=new Map();['model'];['attributes'];constructor(_0x530c57){super(_0x530c57),this['conversationId']=_0x530c57['conversationId'],this['contextItems']=_0x530c57['contextItems'],this['capabilities']=_0x530c57['capabilities'],this['userMessage']=_0x530c57['userMessage'],this['model']=_0x530c57['model'],this['attributes']=_0x530c57['attributes'];}async['sendRequest'](){return this['connector']['queryAssistant']({'message':this['userMessage'],'conversationId':this['conversationId'],'parts':We['mapContextItemsToRequestData'](this['contextItems']),'capabilities':Je['getCapabilitiesRequestData'](this['capabilities']),'model':this['model'],'attributes':this['attributes']});}['getDocumentContext'](){return this['contextItems']['get']('current-document');}}class _t extends _0x428ca4(){['id'];['isStarted']=!0x1;['isFromHistory'];['interactions']=[];['currentInteraction'];['selectedModel'];['connector'];['options'];constructor(_0x864c60){super(),this['options']=_0x864c60,this['connector']=_0x864c60['connector'],this['chatModels']=_0x864c60['chatModels'],this['id']=_0x864c60['conversationId'],this['isFromHistory']=_0x864c60['isFromHistory'];}async['init'](_0x54656d){try{this['chatContext']=new We({'connector':this['connector'],'config':_0x54656d,'ownerId':this['id']}),this['chatContext']['delegate'](...He)['to'](this),this['chatContext']['init'](),this['chatCapabilities']=new Je(),this['chatCapabilities']['delegate'](...Be)['to'](this),this['chatCapabilities']['init']();const _0x292ab1=await this['chatModels']['getAvailableModels']();this['fire']('conversationInitialized',{'availableModels':_0x292ab1});const _0x4c71ea=await this['chatModels']['getModel'](this['options']['selectedModelId']);_0x4c71ea&&await this['setModel'](_0x4c71ea);}catch(_0x37f1eb){const _0x52798b=new _0x2ae61f('ai-chat-conversation-init-failed',null,{'message':_0x37f1eb['message']||_0x37f1eb});_0x52798b['stack']=_0x37f1eb['stack'],this['fire']('error',{'error':_0x52798b});}}async['start'](){if(this['isStarted'])throw new _0x2ae61f('ai-chat-conversation-already-started',null,{'conversation':this});if(!this['selectedModel'])throw new _0x2ae61f('ai-chat-conversation-start-no-model-selected',null,{'conversation':this});try{const {id:_0x1be028}=await this['connector']['startConversation'](this['id'],this['options']['group'])['getConversation']();this['id']=_0x1be028,this['isStarted']=!0x0,this['fire']('conversationStarted',{'conversationId':this['id'],'selectedModel':this['selectedModel']});}catch(_0xd4e489){const _0x248063=new _0x2ae61f('ai-chat-conversation-start-failed',null,{'message':_0xd4e489['message'],'conversationId':this['id']});throw _0x248063['stack']=_0xd4e489['stack'],this['fire']('error',{'error':_0x248063}),_0x248063;}}async['load'](_0x334adb,_0x16788b){try{const _0x101652=await this['connector']['fetchConversation'](_0x334adb)['getConversation'](),_0x42cf16=await this['connector']['fetchConversationMessages'](_0x334adb)['getMessages'](),_0xfebbf9=_0x42cf16[0x0]['model'];this['isStarted']=!0x0,this['id']=_0x101652['id'],'title'in _0x101652?this['fire']('setConversationTitle',_0x101652['title'],!0x0):this['fire']('setConversationTitle','',!0x0);const _0x59813d=(await this['chatModels']['getAll']())['find'](_0x3b8183=>_0x3b8183['id']['toLowerCase']()===_0xfebbf9['toLowerCase']());return this['selectedModel']=_0x59813d,this['fire']('modelSelected',{'selectedModel':_0x59813d,'isDisabled':!0x0}),await this['_processMessagesToInteractions'](_0x42cf16,_0x16788b,_0xfebbf9),this['currentInteraction']=void 0x0,this;}catch(_0x3c8ce0){const _0x5b3dba=new _0x2ae61f('ai-chat-conversation-init-from-id-failed',null,{'message':_0x3c8ce0['message'],'conversationId':_0x334adb});throw _0x5b3dba['stack']=_0x3c8ce0['stack'],this['fire']('error',{'error':_0x5b3dba}),_0x5b3dba;}}async['_processMessagesToInteractions'](_0x274d13,_0xfd2044,_0x36305a){let _0x908d50;for(const _0x45e715 of _0x274d13)if('user'===_0x45e715['role']){const _0x35feba=await this['_extractContextItems'](_0x45e715),_0x43ca5b={'isReasoningEnabled':Object['hasOwn'](_0x45e715['capabilities'],'reasoning'),'isWebSearchEnabled':Object['hasOwn'](_0x45e715['capabilities'],'webSearch')};_0x908d50=this['createInteraction']({'userMessage':_0x45e715['prompt'],'contextItems':_0x35feba,'capabilities':_0x43ca5b,'modelId':_0x36305a,'attributes':_0x45e715['attributes']}),this['currentInteraction']=_0x908d50,this['chatContext']['addToConversationContext'](this['currentInteraction']['contextItems']);}else{if('assistant'===_0x45e715['role']&&_0x908d50){const _0x3ebabb=[];for(const _0x326e72 of _0x45e715['content'])switch(_0x326e72['type']){case'text':case'modification':{const _0x19cbb8=_0x908d50['getDocumentContext']()?.['sessionId']!==_0xfd2044;_0x908d50['currentReply']=_0x908d50['createReply']({'type':_0x326e72['type'],'isDone':!0x0,'interactionId':_0x908d50['id'],'areActionsDisabled':_0x19cbb8}),_0x908d50['currentReply']['appendContent'](_0x326e72['content']),_0x3ebabb['length']>0x0&&(_0x908d50['currentReply']['sources']=_0x3ebabb['splice'](0x0));break;}case'url':_0x3ebabb['push'](_0x326e72);break;case'mcp-tool-result':{const {data:_0x3e6758,attributes:_0x4a008f}=JSON['parse'](_0x326e72['content']);_0x908d50['_handleToolResultData']({'toolName':_0x326e72['toolName'],'data':_0x3e6758,'attributes':_0x4a008f});break;}}}}}async['_extractContextItems'](_0x386061){const _0x277fd4=new Map();if(!_0x386061['content'])return _0x277fd4;for(const _0x114a61 of _0x386061['content']){const _0x311bc7=await this['chatContext']['populateFromMessage'](_0x114a61);_0x311bc7&&_0x277fd4['set'](_0x311bc7['id'],_0x311bc7);}return _0x277fd4;}async['handleUserInteraction']({userMessage:_0x130752,attributes:_0x187c07}){if(!this['isStarted'])throw new _0x2ae61f('ai-chat-handle-user-conversation-not-initialized',null,{'conversation':this});if(this['currentInteraction'])throw new _0x2ae61f('ai-chat-handle-user-interaction-already-in-progress',null,{'conversation':this});try{const _0x243844=this['chatContext']['getPendingContextItems'](),_0x1020a9=this['chatCapabilities']['getCapabilitiesConfig'](),_0x1e0bf3=this['selectedModel']['id'];this['currentInteraction']=this['createInteraction']({'userMessage':_0x130752,'contextItems':_0x243844,'capabilities':_0x1020a9,'modelId':_0x1e0bf3,'attributes':_0x187c07}),await this['currentInteraction']['start'](),this['chatContext']['addToConversationContext'](this['currentInteraction']['contextItems']);}catch(_0x436b1c){if(_0x436b1c instanceof _0x2ae61f)this['fire']('error',{'interactionId':this['currentInteraction']?this['currentInteraction']['id']:void 0x0,'error':_0x436b1c});else{const _0x540fd3=Ue['get'](_0x436b1c['code'])||'ai-chat-handle-user-interaction-start-failed';this['fire']('error',{'interactionId':this['currentInteraction']?this['currentInteraction']['id']:void 0x0,'error':new _0x2ae61f(_0x540fd3,null,{'error':_0x436b1c})});}}finally{this['currentInteraction']?.['stop'](),this['currentInteraction']=void 0x0;}}['createInteraction']({userMessage:_0x259e11,contextItems:_0x3b5465,capabilities:_0x3e6c97,modelId:_0x3fba41,attributes:_0x3de473}){const _0xebfaf6=new Ke({'userMessage':_0x259e11,'contextItems':_0x3b5465,'capabilities':_0x3e6c97,'conversationId':this['id'],'connector':this['connector'],'editor':this['options']['getEditor']&&this['options']['getEditor'](),'model':_0x3fba41,'attributes':_0x3de473});return _0xebfaf6['delegate'](...ye)['to'](this),this['interactions']['push'](_0xebfaf6),this['fire']('interactionCreated',_0xebfaf6),_0xebfaf6;}['getInteraction'](_0x39b914){return this['interactions']['find'](_0x4e5f35=>_0x4e5f35['id']===_0x39b914);}['removeInteraction'](_0x5a8e4f){const _0x594709=this['getInteraction'](_0x5a8e4f);_0x594709&&(_0x594709['destroy'](),this['interactions']['splice'](this['interactions']['indexOf'](_0x594709),0x1));}get['lastInteraction'](){return this['interactions'][this['interactions']['length']-0x1];}['addCurrentDocumentToContext'](_0x1ea798){this['chatContext']['addCurrentDocumentToContext'](_0x1ea798);}async['updateCurrentDocumentInContext']({content:_0x2d9e55,version:_0x5bfd4e,sessionId:_0x4c4ce7,selections:_0x41d69d}){await this['chatContext']['updateCurrentDocument'](_0x2d9e55,_0x5bfd4e,_0x4c4ce7,_0x41d69d);}['getCurrentDocumentContext'](){return this['currentInteraction']?.['getDocumentContext']()?.['content']||'';}['addSelectionToContext'](_0x460d40){this['chatContext']['addSelectionToContext'](_0x460d40);}['removeSelectionFromContext'](){this['chatContext']['removeSelectionFromContext']();}['addFilesToContext'](_0x581d30){this['chatContext']['addFilesToContext'](_0x581d30);}['addUrlToContext'](_0x23d03b){this['chatContext']['addUrlToContext'](_0x23d03b);}['addToolItemToContext'](_0x285b51){this['chatContext']['addToolItemToContext'](_0x285b51);}['addResourceToContext'](_0x1b1708,_0x50ea5c){this['chatContext']['addResourceToContext'](_0x1b1708,_0x50ea5c);}['loadSourceResources'](_0x491900,_0x2bc600,_0x2b743a){return this['chatContext']['loadSourceResources'](_0x491900,_0x2bc600,_0x2b743a);}['removeFromContext'](_0x5d9aa3){this['chatContext']['removeFromContext'](_0x5d9aa3);}['setWebSearch'](_0x4d8fc1){this['chatCapabilities']['setWebSearch'](_0x4d8fc1);}['toggleWebSearch'](){this['chatCapabilities']['toggleWebSearch']();}['setReasoning'](_0x367c00){this['chatCapabilities']['setReasoning'](_0x367c00);}['toggleReasoning'](){this['chatCapabilities']['toggleReasoning']();}['isCurrentDocumentInContext'](){return this['chatContext']['isCurrentDocumentInContext']();}['isCurrentDocumentInConversation'](){return this['chatContext']['isCurrentDocumentInConversation']();}['isSelectionInContext'](){return this['chatContext']['isSelectionInContext']();}async['setModel'](_0x3d1de9){_0x3d1de9?!0x1===await this['chatModels']['isAvailable'](_0x3d1de9)&&(_0x4bc23b('ai-chat-conversation-set-model-not-available',{'conversation':this,'model':_0x3d1de9}),_0x3d1de9=(await this['chatModels']['getAvailableModels']())[0x0]):(_0x4bc23b('ai-chat-conversation-set-model-null',{'conversation':this}),_0x3d1de9=(await this['chatModels']['getAvailableModels']())[0x0]),_0x3d1de9['id']!==this['selectedModel']?.['id']&&(this['selectedModel']=_0x3d1de9,this['chatCapabilities']['reset'](),this['fire']('modelSelected',{'selectedModel':_0x3d1de9}));}}class It extends _0x428ca4(){['_connector'];['_config'];['_locale'];['_modelList']=[];['_modelsRequest']=null;constructor({connector:_0x2b8304,config:_0x5805eb,locale:_0x1a63b5}){super(),this['_connector']=_0x2b8304,this['_config']=_0x5805eb,this['_locale']=_0x1a63b5;}get['_availableModels'](){return this['_config']?.['displayedModels'];}get['_defaultModelId'](){return this['_config']?.['defaultModelId'];}async['getAll'](){return this['_modelsRequest']||(this['_modelsRequest']=this['_retrieveModels']()),this['_modelsRequest'];}async['getAvailableModels'](){const _0xe99981=await this['getAll']();let _0x5918b6;return _0x5918b6=this['_availableModels']?this['_filterModels'](_0xe99981,this['_availableModels']):_0xe99981['filter'](_0x118bfc=>_0x118bfc['recommended']),_0x5918b6;}async['getModel'](_0x1a0e9f){const _0x19de16=await this['getAll']();if(!_0x19de16['length'])return null;if(_0x1a0e9f){const _0x336b16=this['_getModelById'](_0x19de16,_0x1a0e9f);if(_0x336b16)return _0x336b16;_0x4bc23b('ai-chat-model-id-unrecognized',{'modelId':_0x1a0e9f,'fallBackModelId':this['_defaultModelId']});}return this['getDefault']();}async['getDefault'](){const _0x163e78=await this['getAvailableModels']();if(!_0x163e78['length'])return null;if(this['_defaultModelId']){const _0x7d54da=this['_getModelById'](_0x163e78,this['_defaultModelId']);if(_0x7d54da)return _0x7d54da;_0x4bc23b('ai-chat-default-model-id-unrecognized',{'defaultModelId':this['_defaultModelId'],'fallBackModelId':_0x163e78[0x0]['id']});}return _0x163e78[0x0];}async['isAvailable'](_0x19dbf8){return(await this['getAvailableModels']())['some'](_0x53ae35=>_0x53ae35['name']===_0x19dbf8['name']&&_0x53ae35['provider']===_0x19dbf8['provider']);}async['_retrieveModels'](){if(!this['_modelList']['length'])try{const _0x291093=this['_locale']['uiLanguage']||'en',_0x4866b8=this['_connector']['getModels'](_0x291093),_0x5ac02e=await _0x4866b8['list']();this['_modelList']=_0x5ac02e['items']['map'](_0x4ecbb2=>qi(_0x4ecbb2)?{..._0x4ecbb2,'name':i(this['_locale'],'AI_MODEL_NAME_AUTO')}:_0x4ecbb2);}catch(_0x170b9f){throw gt('ai-models-unable-to-retrieve',{'error':_0x170b9f}),_0x170b9f;}return[...this['_modelList']];}['_filterModels'](_0x2435ae,_0x1fcfb1){let _0x5d5938;if(_0x1fcfb1){_0x5d5938=[];const _0x34b181=new Set(),_0xbb0a3b='string'==typeof _0x1fcfb1?[_0x1fcfb1['toLocaleLowerCase']()]:_0x1fcfb1['map'](_0x16ba60=>_0x16ba60['toLocaleLowerCase']());for(const _0x53e286 of _0xbb0a3b)for(const _0x3035e5 of _0x2435ae)!_0x34b181['has'](_0x3035e5['id'])&&this['_isMatchingFilter'](_0x3035e5,_0x53e286)&&(_0x5d5938['push'](_0x3035e5),_0x34b181['add'](_0x3035e5['id']));}else _0x5d5938=_0x2435ae;return _0x5d5938;}['_isMatchingFilter'](_0x4be75d,_0x4e0d98){const _0x30d064=_0x4be75d['id']['toLocaleLowerCase'](),_0x7ec279=_0x4be75d['name']['toLocaleLowerCase'](),_0x1778a0=_0x4be75d['provider']['toLocaleLowerCase']();return _0x30d064===_0x4e0d98||_0x7ec279===_0x4e0d98||qi(_0x4be75d)&&'auto'===_0x4e0d98||_0x1778a0===_0x4e0d98||_0x30d064['startsWith'](_0x4e0d98);}['_getModelById'](_0x136fc6,_0x7fd534){return _0x136fc6['find'](_0x2c01b5=>qi(_0x2c01b5)&&'auto'===_0x7fd534?_0x2c01b5:_0x2c01b5['id']===_0x7fd534)||null;}}function qi(_0x18539d){return _0x18539d['id']['startsWith']('agent');}function T(_0x366828){if(_0x366828 instanceof dt)return _0x366828;if(_0x366828?.['editors']&&_0x366828['editors']['get'](0x0))return _0x366828['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.'),_0x366828['editors']['get'](0x0);throw new _0x2ae61f('ai-get-editor-from-context-no-editor');}function Z({editor:_0x4122ae,interaction:_0x1934aa,reply:_0x26f7d2,groups:_0x1995e1,transform:_0x2ff91e,documentCompare:_0x33eae5,documentCompareOptions:_0x3bf906}){const _0xe13791=_0x1934aa['getDocumentContext']();if(!_0xe13791)return[];const _0x5d80bf=_0xe13791['content'],_0xf9e6cc=_0xe13791['version'],_0x29aa44=_0x26f7d2['documentContextContent']['cloneNode'](!0x0);for(const {changes:_0xca65c1}of _0x1995e1){const _0x3f0e1c=_0xca65c1['filter'](_0x560b8a=>'new'!=_0x560b8a['type'])['map'](_0x514714=>St('data-id',_0x514714['id'],_0x29aa44)),_0x3e8cf0=_0xca65c1['filter'](_0x5823b5=>'removed'!=_0x5823b5['type'])['map'](_0x1b4b25=>_0x1b4b25['node']['cloneNode'](!0x0));let _0x3d28e4=null;if(_0x3f0e1c['length']){_0x3d28e4=_0x3f0e1c[0x0]['previousSibling'];for(let _0x56ae6c=0x0;_0x56ae6c<_0x3f0e1c['length'];_0x56ae6c++)_0x3c7927(_0x3f0e1c[_0x56ae6c]);}if(_0x3e8cf0['length']){_0x3d28e4||(_0xca65c1[0x0]['anchorId']?_0x3d28e4=St('data-id',_0xca65c1[0x0]['anchorId'],_0x29aa44):(_0x3d28e4=_0x3e8cf0['shift'](),_0x1317c8(_0x29aa44,_0x3d28e4)));for(let _0x48a796=0x0;_0x48a796<_0x3e8cf0['length'];_0x48a796++)_0x2d333e(_0x3d28e4,_0x3e8cf0[_0x48a796]),_0x3d28e4=_0x3e8cf0[_0x48a796];}}const _0x29df62=Tt(_0x29aa44),_0x1d23da=_0x33eae5['getDiff'](_0x5d80bf,_0x29df62,_0x3bf906)['getOperations']();if(_0x2ff91e){const _0x313354=_0x4122ae['model']['document']['history']['getOperations'](_0xf9e6cc),_0x59a884={'document':_0x4122ae['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1};return nt(_0x1d23da,_0x313354,_0x59a884)['operationsA'];}return _0x1d23da;}function Y(_0x225bde,_0x597c2b){if('marker'!=_0x597c2b['type'])return;const _0x23f828=_0x225bde['model']['markers']['get'](_0x597c2b['name']);_0x23f828&&(_0x597c2b['oldRange']=_0x23f828['getRange']());}class at extends _0x3b66f2{['_aiEditing'];['_aiConnector'];['_aiChatUi'];['_aiChatModels'];['_aiChatBalloon'];['_batchToChanges']=new Map();['_currentPreviewedChangeGroup']=null;['_bodyCollection'];static get['requires'](){return[q,_0x5b4177];}static get['pluginName'](){return'AIChatController';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){this['_bodyCollection']=new _0x6c121d(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 It({'connector':this['_aiConnector'],'config':this['context']['config']['get']('ai.models'),'locale':this['context']['locale']});const _0x1e85e1=this['context']['plugins']['get']('AITabs');this['listenTo'](this['_aiChatUi'],'startConversation',()=>{this['_startConversationSafely']();}),this['listenTo'](this['_aiChatUi'],'sendUserMessage',(_0x3fdd37,_0x3ffa52)=>{this['_handleUIUserMessage']({'userMessage':_0x3ffa52});}),this['listenTo'](_0x1e85e1,'resizedTabs',(_0x52e6be,_0x592999)=>{this['_setIsMaximized'](_0x592999);}),this['listenTo'](this['_aiChatUi'],'resizeTabs',()=>{_0x1e85e1['resize']();}),this['listenTo'](this['_aiChatUi'],'abortPromptStream',async()=>{await this['_stopLastInteraction'](),await this['_flushLastInteractionUI'](),this['removeSelectionFromChatContext']();}),this['listenTo'](this['_aiChatUi'],'addDocumentToContext',()=>{this['addCurrentDocumentToChatContext']();}),this['listenTo'](this['_aiChatUi'],'addFileToContext',(_0x11040d,_0x244227)=>{this['activeConversation']?.['addFilesToContext'](Array['from'](_0x244227));}),this['listenTo'](this['_aiChatUi'],'addUrlToContext',(_0xa6cac2,_0x4bdfb0)=>{this['activeConversation']?.['addUrlToContext'](_0x4bdfb0);}),this['listenTo'](this['_aiChatUi'],'executeCustomItemCallback',(_0x4c1266,_0x225e81)=>{_0x225e81['callback'](this['context']);}),this['listenTo'](this['_aiChatUi'],'addResourceToContext',(_0x2bc6b7,_0x4022b1)=>{this['activeConversation']?.['addResourceToContext'](_0x4022b1['source'],_0x4022b1['resource']);}),this['listenTo'](this['_aiChatUi'],'removeContextItem',(_0x55a281,_0x2da3e0)=>{this['_removeFromContext'](_0x2da3e0);}),this['listenTo'](this['_aiChatUi'],'loadSourceResources',(_0x3f45e5,_0x562699)=>{this['activeConversation']?.['loadSourceResources'](_0x562699['sourceId'],_0x562699['query'],_0x562699['uid']);}),this['listenTo'](this['_aiChatUi'],'toggleWebSearch',()=>{this['_toggleWebSearch']();}),this['listenTo'](this['_aiChatUi'],'toggleReasoning',()=>{this['_toggleReasoning']();}),this['listenTo'](this['_aiChatUi'],'selectModel',(_0x536d3c,_0x457085)=>{this['activeConversation']?.['setModel'](_0x457085);}),this['listenTo'](this['_aiChatUi'],'like',(_0x33de32,{replyId:_0x368689})=>{console['log']('Liked\x20response',_0x368689);}),this['listenTo'](this['_aiChatUi'],'dislike',(_0x3ce4c1,{replyId:_0x3008fe})=>{console['log']('Disliked\x20response',_0x3008fe);}),this['listenTo'](this['_aiChatUi'],'insertSuggestion',(_0xfe1f85,_0x2e6253)=>{this['_insertSuggestion'](_0x2e6253);}),this['listenTo'](this['_aiChatUi'],'showChangeInText',(_0x3b8099,{replyId:_0x4cfbb8,partIndex:_0x3ee677})=>{this['_aiChatBalloonShowDiff']=this['_aiChatUi']['showDiff'],this['_openBalloonFor'](_0x4cfbb8,_0x3ee677);}),this['listenTo'](this['_aiChatUi'],'mouseOverSuggestion',(_0x120177,{replyId:_0x25a83b,partIndex:_0x5167eb})=>{const _0x24ca29=this['_getDocumentRangeForReplyChanges'](_0x25a83b,_0x5167eb);_0x24ca29&&'$graveyard'!=_0x24ca29['range']['root']['rootName']&&this['_aiEditing']['showFakeVisualSelection']([_0x24ca29['range']],'ai-chat-controller-mouse-over');}),this['listenTo'](this['_aiChatUi'],'mouseLeaveSuggestion',()=>{this['_aiEditing']['hideFakeVisualSelection']('ai-chat-controller-mouse-over');}),this['listenTo'](this['_aiChatUi'],'applySuggestion',(_0x442995,_0x1516d4)=>{this['_aiEditing']['hideFakeVisualSelection']('ai-chat-controller-mouse-over'),this['_applySuggestion'](_0x1516d4);}),this['listenTo'](this['_aiChatUi'],'toggleSuggestionDisplayMode',async(_0x37a5e5,{replyId:_0x435fc9,showDiff:_0x1a54d5})=>{const {reply:_0x50c86b}=this['getInteractionAndReplyById'](_0x435fc9),_0x244364=_0x50c86b['getContentParts']({'showDiff':_0x1a54d5});await this['_aiChatUi']['updateFeedItemAIReplySuggestionContent']({'id':_0x50c86b['id'],'parts':_0x244364,'renderingStrategy':'static'});}),this['listenTo'](this['_aiChatUi'],'rejectSuggestion',(_0x13ae88,{replyId:_0x4003ca,partIndex:_0x1c6bb5})=>{this['_rejectSuggestion']({'replyId':_0x4003ca,'partIndex':_0x1c6bb5}),this['_aiEditing']['hideFakeVisualSelection']('ai-chat-controller-mouse-over');}),this['context']['plugins']['has']('AIChatBalloon')&&(this['_aiChatBalloon']=this['context']['plugins']['get']('AIChatBalloon'),this['set']('_aiChatBalloonShowDiff',!0x1),this['_aiChatBalloon']['bind']('showDiff')['to'](this,'_aiChatBalloonShowDiff'),this['listenTo'](this['_aiChatBalloon'],'toggleSuggestionDisplayMode',()=>{const {replyId:_0x323b25,partIndex:_0x2620a8}=this['_currentPreviewedChangeGroup'];this['_aiChatBalloonShowDiff']=!this['_aiChatBalloonShowDiff'];const {reply:_0xf27a43}=this['getInteractionAndReplyById'](_0x323b25),_0x6ab260=_0xf27a43['getContentParts']({'showDiff':this['_aiChatBalloonShowDiff'],'groupIndex':_0x2620a8});this['_aiChatBalloon']['updateContent']({'part':_0x6ab260[0x0],'renderingStrategy':'static','keepErrors':!0x0});}),this['listenTo'](this['_aiChatBalloon'],'applySuggestion',()=>{const {replyId:_0xe06cf4,partIndex:_0xfba7c6}=this['_currentPreviewedChangeGroup'];this['_applySuggestion']({'replyId':_0xe06cf4,'partIndex':_0xfba7c6}),this['_aiChatBalloon']['setState']('accepted');}),this['listenTo'](this['_aiChatBalloon'],'insertSuggestion',()=>{const {replyId:_0x256824,partIndex:_0x366c8f}=this['_currentPreviewedChangeGroup'];this['_insertSuggestion']({'replyId':_0x256824,'partIndex':_0x366c8f}),this['_aiChatBalloon']['setState']('accepted');}),this['listenTo'](this['_aiChatBalloon'],'rejectSuggestion',()=>{const {replyId:_0x522dc3,partIndex:_0x422263}=this['_currentPreviewedChangeGroup'];this['_rejectSuggestion']({'replyId':_0x522dc3,'partIndex':_0x422263}),this['_aiChatBalloon']['setState']('rejected');}),this['listenTo'](this['_aiChatBalloon'],'showNext',()=>{const {replyId:_0x1b8b20,partIndex:_0x380ee7}=this['_currentPreviewedChangeGroup'],_0x590476=this['_getPresentableSiblingContentPartIndex'](_0x1b8b20,_0x380ee7,'next');null!==_0x590476&&this['_openBalloonFor'](_0x1b8b20,_0x590476);}),this['listenTo'](this['_aiChatBalloon'],'showPrevious',()=>{const {replyId:_0x2944a5,partIndex:_0x5e26a9}=this['_currentPreviewedChangeGroup'],_0x3958ef=this['_getPresentableSiblingContentPartIndex'](_0x2944a5,_0x5e26a9,'previous');null!==_0x3958ef&&this['_openBalloonFor'](_0x2944a5,_0x3958ef);}),this['listenTo'](this['_aiChatBalloon'],'dialogClosed',(_0x40bd1b,{id:_0x15af71})=>{if('aiChatBalloon'!==_0x15af71)return;const {replyId:_0x5bdd38,partIndex:_0x3b1d1b}=this['_currentPreviewedChangeGroup'];this['_currentPreviewedChangeGroup']=null,this['_aiChatUi']['setFeedItemAIReplySuggestionPartActive']({'id':_0x5bdd38,'index':_0x3b1d1b,'isActive':!0x1});}));}async['afterInit'](){this['context']instanceof dt?this['_integrateEditor'](this['context']):this['listenTo'](this['context']['editors'],'add',(_0x33f39d,_0x16ae61)=>{_0x16ae61['on']('ready',()=>{this['_integrateEditor'](_0x16ae61);});});const _0x5c59b0=this['context']['config']['get']('ai.chat.initialConversation');let _0xb48706=_0x5c59b0;if('lastCreated'!=_0x5c59b0||(_0xb48706=await this['_getLastCreatedConversationId'](),_0xb48706))return'new'==_0xb48706?this['_startConversationSafely']():this['loadConversation'](_0xb48706);}async['destroy'](){return await this['_stopLastInteraction'](),this['_bodyCollection']['detachFromDom'](),super['destroy']();}['_insertSuggestion'](_0x23054a){const _0x2994d7=T(this['context']);if(!_0x2994d7['plugins']['has']('TrackChanges'))throw new _0x2ae61f('ai-no-track-changes',null);const _0x112bf8=this['context']['plugins']['get']('DocumentCompare'),{reply:_0xc2a618,interaction:_0x5bb442}=this['getInteractionAndReplyById'](_0x23054a['replyId']),_0x348cd2=this['_getDocumentRangeForReplyChanges'](_0x23054a['replyId'],_0x23054a['partIndex']),_0x1bab8f=void 0x0!==_0x23054a['partIndex']?[_0xc2a618['changeGroups'][_0x23054a['partIndex']]]:_0xc2a618['changeGroups']['filter'](_0x5d8371=>'pending'==_0x5d8371['state']),_0x411b31=_0x1bab8f['map'](_0xb14acc=>_0xc2a618['changeGroups']['indexOf'](_0xb14acc));if(!_0x348cd2||'$graveyard'==_0x348cd2['range']['root']['rootName'])return void _0x411b31['forEach'](_0x330ef1=>_0xc2a618['setChangeGroupState'](_0x330ef1,'outdated'));_0x411b31['forEach'](_0x4daf81=>_0xc2a618['setChangeGroupState'](_0x4daf81,'accepted'));const _0x4212e1=Z({'editor':_0x2994d7,'reply':_0xc2a618,'interaction':_0x5bb442,'groups':_0x1bab8f,'transform':!0x0,'documentCompare':_0x112bf8,'documentCompareOptions':{'anchor':'main','markDeletions':!0x0}});let _0x147485;_0x348cd2&&this['_scrollToSuggestionRange'](_0x348cd2['range']),_0x2994d7['model']['change'](_0x334be4=>{_0x147485=_0x334be4['batch'],_0x2994d7['plugins']['get']('TrackChangesEditing')['_applyOperationsAsSuggestions'](_0x4212e1),this['_aiEditing']['hideFakeVisualSelection']('ai-chat-controller-mouse-over');}),this['_batchToChanges']['set'](_0x147485,{'interactionId':_0x5bb442['id'],'replyId':_0xc2a618['id'],'indexes':_0x411b31['slice']()}),this['_updateRatings'](_0xc2a618);}['_applySuggestion'](_0x1439d1){const _0x1f61c1=T(this['context']),_0x53479d=this['context']['plugins']['get'](_0x5b4177),{reply:_0x59cdb0,interaction:_0x2d837d}=this['getInteractionAndReplyById'](_0x1439d1['replyId']),_0x10970f=this['_getDocumentRangeForReplyChanges'](_0x1439d1['replyId'],_0x1439d1['partIndex']),_0x102cb3=void 0x0!==_0x1439d1['partIndex']?[_0x59cdb0['changeGroups'][_0x1439d1['partIndex']]]:_0x59cdb0['changeGroups']['filter'](_0x386a37=>'pending'==_0x386a37['state']),_0x9d3858=_0x102cb3['map'](_0x413502=>_0x59cdb0['changeGroups']['indexOf'](_0x413502));if(!_0x10970f||'$graveyard'==_0x10970f['range']['root']['rootName'])return void _0x9d3858['forEach'](_0x34aa7e=>_0x59cdb0['setChangeGroupState'](_0x34aa7e,'outdated'));_0x9d3858['forEach'](_0x578247=>_0x59cdb0['setChangeGroupState'](_0x578247,'accepted'));const _0x202f2d=Z({'editor':_0x1f61c1,'reply':_0x59cdb0,'interaction':_0x2d837d,'groups':_0x102cb3,'transform':!0x0,'documentCompare':_0x53479d,'documentCompareOptions':{'anchor':'main','markDeletions':!0x1}});let _0x2001ff;_0x10970f&&this['_scrollToSuggestionRange'](_0x10970f['range']),_0x1f61c1['model']['change'](_0x2e3e8b=>{_0x2001ff=_0x2e3e8b['batch'];for(const _0x40b825 of _0x202f2d)_0x40b825['baseVersion']=_0x1f61c1['model']['document']['version'],Y(_0x1f61c1,_0x40b825),_0x2e3e8b['batch']['addOperation'](_0x40b825),_0x1f61c1['model']['applyOperation'](_0x40b825);}),this['_batchToChanges']['set'](_0x2001ff,{'interactionId':_0x2d837d['id'],'replyId':_0x59cdb0['id'],'indexes':_0x9d3858['slice']()}),this['_updateRatings'](_0x59cdb0);}['_rejectSuggestion'](_0x3a70ce){const {reply:_0x2cc807}=this['getInteractionAndReplyById'](_0x3a70ce['replyId']);_0x2cc807['setChangeGroupState'](_0x3a70ce['partIndex'],'rejected');}['_openBalloonFor'](_0x3fb186,_0x2eee3b){if(!this['_aiChatBalloon'])return;const {reply:_0x176b2a}=this['getInteractionAndReplyById'](_0x3fb186),_0x528190=_0x176b2a['getContentParts']({'showDiff':this['_aiChatBalloonShowDiff']});let _0x5594a4,_0x1df9a8;if(void 0x0!==_0x2eee3b?(_0x1df9a8=_0x528190['find'](_0x128140=>_0x128140['index']==_0x2eee3b),_0x5594a4=_0x1df9a8?.['index']):(_0x1df9a8=_0x528190[0x0],_0x5594a4=_0x1df9a8['index']),this['_currentPreviewedChangeGroup']?.['replyId']==_0x3fb186&&this['_currentPreviewedChangeGroup']?.['partIndex']==_0x5594a4)return;const _0x2ecf8c=this['_getUserPresentableContentPartDocumentRange'](_0x3fb186,_0x176b2a,_0x1df9a8);if(!_0x2ecf8c)return void this['_aiChatBalloon']['close']();this['_currentPreviewedChangeGroup']={'replyId':_0x3fb186,'partIndex':_0x5594a4},this['_scrollToSuggestionRange'](_0x2ecf8c,!0x0);const _0x292138=this['_getPresentableSiblingContentPartIndex'](_0x3fb186,_0x5594a4,'next');this['_aiChatBalloon']['updateContent']({'part':_0x1df9a8,'renderingStrategy':'static'}),this['_aiChatBalloon']['open']({'index':_0x5594a4,'title':i(this['context']['locale'],'AI_BALLOON_HEADER_TITLE',(_0x5594a4+0x1)['toString']()),'showRotator':null!==_0x292138,'ranges':[_0x2ecf8c],'areActionsDisabled':_0x176b2a['areActionsDisabled']}),this['_aiChatBalloon']['setState']('pending'),this['_aiChatUi']['scrollFeedToSuggestion'](_0x3fb186,_0x5594a4),this['_aiChatUi']['setFeedItemAIReplySuggestionPartActive']({'id':_0x3fb186,'index':_0x5594a4,'isActive':!0x0});}['_getPresentableSiblingContentPartIndex'](_0x43f69c,_0x2dbca3,_0x343d4b){const {reply:_0x5efbf5}=this['getInteractionAndReplyById'](_0x43f69c),_0x105613=_0x5efbf5['getContentParts']({'showDiff':this['_aiChatBalloonShowDiff']});if(0x1==_0x105613['length'])return null;const _0x490aa6=_0x105613['findIndex'](_0x31b12f=>_0x31b12f['index']==_0x2dbca3),_0x112335='next'==_0x343d4b?0x1:-0x1;let _0x5507df=_0x105613['at']((_0x490aa6+_0x112335)%_0x105613['length'])['index'],_0xb7322d=_0x105613[_0x5507df];for(;!this['_getUserPresentableContentPartDocumentRange'](_0x43f69c,_0x5efbf5,_0xb7322d);){if(_0x5507df=_0x105613['at']((_0x5507df+_0x112335)%_0x105613['length'])['index'],_0x5507df===_0x490aa6)return null;_0xb7322d=_0x105613[_0x5507df];}return _0x5507df;}['_getUserPresentableContentPartDocumentRange'](_0x4ed057,_0xc19a3c,_0x3c05ef){const _0x20f2ea=_0xc19a3c['changeGroups'];if(!_0x3c05ef['hasChanges'])return null;const _0x56c1b2=_0x20f2ea['find'](_0x22723e=>_0x22723e['index']==_0x3c05ef['index']);if('pending'!==_0x56c1b2?.['state'])return null;const _0x2be815=this['_getDocumentRangeForReplyChanges'](_0x4ed057,_0x3c05ef['index']);if(!_0x2be815)return null;const {range:_0x127f88,currentIndex:_0x25b66e}=_0x2be815;return'$graveyard'==_0x127f88['root']['rootName']?(_0xc19a3c['setChangeGroupState'](_0x25b66e,'outdated'),null):_0x2be815['range'];}['_getDocumentRangeForReplyChanges'](_0x34baa9,_0x778a08){const _0x14d0fa=T(this['context']),{reply:_0x493c57,interaction:_0x504bb9}=this['getInteractionAndReplyById'](_0x34baa9),_0x4c693a=_0x493c57['changeGroups']['filter'](_0x1068d6=>'pending'==_0x1068d6['state']),_0x4f6b63=_0x4c693a['map'](_0x1932be=>_0x493c57['changeGroups']['indexOf'](_0x1932be));void 0x0===_0x778a08&&(_0x778a08=_0x4f6b63[0x0]);const _0x147c2e=_0x4f6b63['indexOf'](_0x778a08);if(-0x1==_0x147c2e)return null;const _0x4e8684=_0x4c693a[_0x147c2e],_0xacafe9=new Et([]),_0x2652b9=new Et([]);for(const _0x26c9ac of _0x4e8684['changes'])if('removed'!=_0x26c9ac['type']&&_0x2652b9['children']['push'](_0x26c9ac['node']['cloneNode'](!0x0)),'new'!=_0x26c9ac['type']){const _0x44de42=yt(_0x3514bd=>At(_0x3514bd,'data-id')==_0x26c9ac['id'],_0x493c57['documentContextContent'],!0x0);_0xacafe9['children']['push'](_0x44de42['cloneNode'](!0x0));}if(0x0==_0xacafe9['children']['length']){if(_0x4e8684['changes'][0x0]['anchorId']){const _0x3d191e=St('data-id',_0x4e8684['changes'][0x0]['anchorId'],_0x493c57['documentContextContent']);_0xacafe9['children']['unshift'](_0x3d191e['cloneNode'](!0x0)),_0x2652b9['children']['unshift'](_0x3d191e['cloneNode'](!0x0)),_0x3d191e['nextSibling']&&(_0xacafe9['children']['push'](_0x3d191e['nextSibling']['cloneNode'](!0x0)),_0x2652b9['children']['push'](_0x3d191e['nextSibling']['cloneNode'](!0x0)));}else{const _0x458977=_0x493c57['documentContextContent']['children'][0x0];if(!_0x458977)return null;_0xacafe9['children']['push'](_0x458977['cloneNode'](!0x0)),_0x2652b9['children']['push'](_0x458977['cloneNode'](!0x0));}}const _0x3c01fb=_0x504bb9['getDocumentContext'](),_0x4334ae=_0x14d0fa['data']['parse'](_0x3c01fb['content']),_0x580f7f=Tt(_0xacafe9),_0x15ee82=_0x14d0fa['data']['parse'](_0x580f7f),_0x5067ac=_0x14d0fa['data']['parse'](_0x580f7f),_0x978518=_0x14d0fa['model']['createPositionAt'](_0x15ee82,0x0),_0x29d7d6=Tt(_0x2652b9),_0x35fc10={'anchor':_0x978518,'markDeletions':!0x1},_0x2eb966=_0x14d0fa['plugins']['get'](_0x5b4177)['getDiff'](_0x580f7f,_0x29d7d6,_0x35fc10)['getOperations']();if(!_0x2eb966['length'])return null;_0x14d0fa['model']['change'](_0x23034b=>{for(const _0x441ee9 of _0x2eb966)if('remove'==_0x441ee9['type']){const _0x37a014=_0x441ee9['sourcePosition'],_0x111534=_0x441ee9['howMany'],_0x33d857=new et(_0x37a014,_0x111534);_0x23034b['batch']['addOperation'](_0x33d857),_0x14d0fa['model']['applyOperation'](_0x33d857);}else'marker'!==_0x441ee9['type']&&(_0x441ee9['baseVersion']=null,_0x441ee9['isDocumentOperation']=!0x1,_0x23034b['batch']['addOperation'](_0x441ee9),_0x14d0fa['model']['applyOperation'](_0x441ee9));});const _0x55f53a=mt(_0x14d0fa,_0x2eb966,_0x15ee82);ft(_0x14d0fa['model'],_0x55f53a);const _0x4f9698=_0x55f53a['getFirstRange']()['start']['path']['slice'](),_0x49609f=_0x55f53a['getFirstRange']()['end']['path']['slice'](),_0x5ed682=[];let _0x3ee843=_0x15ee82,_0x4278d0=_0x5067ac;for(let _0x492b4a=0x0;_0x492b4a<_0x49609f['length'];_0x492b4a++){const _0x42ae0d=_0x3ee843['maxOffset']-_0x49609f[_0x492b4a];_0x5ed682[_0x492b4a]=_0x4278d0['maxOffset']-_0x42ae0d,_0x3ee843=_0x3ee843['getChildAtOffset'](_0x49609f[_0x492b4a]),_0x4278d0=_0x4278d0['getChildAtOffset'](_0x5ed682[_0x492b4a]);}const _0x5770c5=_0x14d0fa['model']['createRange'](_0x14d0fa['model']['createPositionFromPath'](_0x5067ac,_0x4f9698),_0x14d0fa['model']['createPositionFromPath'](_0x5067ac,_0x5ed682)),_0x598c17=_0x5067ac['getChild'](0x0)['getAttribute'](Ct),_0x391ae8=Array['from'](_0x4334ae['getChildren']())['find'](_0x45ef11=>_0x45ef11['getAttribute'](Ct)==_0x598c17)['getPath'](),_0x335529=_0x5770c5['start']['path']['slice'](),_0xe6b375=_0x5770c5['end']['path']['slice']();_0x335529[0x0]=_0x391ae8[0x0]+_0x335529[0x0],_0xe6b375[0x0]=_0x391ae8[0x0]+_0xe6b375[0x0];let _0x4a4724=_0x14d0fa['model']['createRange'](_0x14d0fa['model']['createPositionFromPath'](_0x14d0fa['model']['document']['getRoot'](),_0x335529),_0x14d0fa['model']['createPositionFromPath'](_0x14d0fa['model']['document']['getRoot'](),_0xe6b375));const _0x1f857a=_0x14d0fa['model']['document']['history']['getOperations'](_0x3c01fb['version']);for(const _0x980b3d of _0x1f857a)_0x4a4724=it['_createFromRanges'](_0x4a4724['getTransformedByOperation'](_0x980b3d));return{'range':_0x4a4724,'currentIndex':_0x778a08};}['_integrateEditor'](_0x37533c){if(!_0x37533c['plugins']['has']('Undo'))return;const _0x244749=_0x37533c['commands']['get']('undo'),_0x220b02=_0x37533c['commands']['get']('redo');this['listenTo'](_0x244749,'revert',(_0x2614b3,_0x55c026,_0x1c621f)=>{const _0x4d51f9=this['_batchToChanges']['get'](_0x55c026);if(!_0x4d51f9)return;const _0x1efa5e=this['activeConversation']['getInteraction'](_0x4d51f9['interactionId'])['getReply'](_0x4d51f9['replyId']);_0x4d51f9['indexes']['forEach'](_0x1cb77c=>_0x1efa5e['setChangeGroupState'](_0x1cb77c,'pending')),this['_batchToChanges']['delete'](_0x55c026),this['_batchToChanges']['set'](_0x1c621f,_0x4d51f9);}),this['listenTo'](_0x220b02,'revert',(_0x6c181f,_0x4bc220,_0x15db98)=>{const _0x1dfca4=this['_batchToChanges']['get'](_0x4bc220);if(!_0x1dfca4)return;const _0x444140=this['activeConversation']['getInteraction'](_0x1dfca4['interactionId'])['getReply'](_0x1dfca4['replyId']);_0x1dfca4['indexes']['forEach'](_0x595482=>_0x444140['setChangeGroupState'](_0x595482,'accepted')),this['_batchToChanges']['delete'](_0x4bc220),this['_batchToChanges']['set'](_0x15db98,_0x1dfca4);});}async['loadConversation'](_0x2a3420){this['context']['plugins']['has']('AIChatBalloon')&&this['context']['plugins']['get']('AIChatBalloon')['close'](),(this['context']['plugins']['get'](pt)['view']['activateTab']('chat'),this['_aiChatUi']['setFeedItemRenderingStrategy']('static'),this['_aiChatUi']['toggleLoadingSkeleton'](!0x0),await this['_stopLastInteraction']());try{await this['_aiConnector']['fetchConversation'](_0x2a3420)['getConversation'](),await this['_startConversationSafely'](_0x2a3420),this['updateConversationTitle']('\x20'),await this['activeConversation']['load'](_0x2a3420,this['_aiEditing']['sessionId']),this['activeConversation']['isCurrentDocumentInConversation']()&&this['addCurrentDocumentToChatContext']();}catch(_0x5ba758){this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_UNABLE_TO_LOAD_CONVERSATION'),'id':_0x2a3420}),this['_logError'](new _0x2ae61f('ai-chat-conversation-not-found',this,{'error':_0x5ba758}));}finally{this['_aiChatUi']['startAutoScroll'](),this['_aiChatUi']['setFeedItemRenderingStrategy']('streaming'),this['_aiChatUi']['toggleLoadingSkeleton'](!0x1);}}async['_getLastCreatedConversationId'](){const _0x244e6a=this['_aiConnector']['fetchConversations'](this['getGroupId'](),{'limit':0x1,'sortBy':'createdAt'});try{const _0x309c0f=await _0x244e6a['getConversations']();return _0x309c0f['length']?_0x309c0f[0x0]['id']:'new';}catch(_0x1005e8){return this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_UNABLE_TO_LOAD_CONVERSATION'),'id':_0x56075e()}),this['_logError'](new _0x2ae61f('ai-chat-conversation-init-failed',this,{'error':_0x1005e8})),this['_aiChatUi']['toggleLoadingSkeleton'](!0x1),this['_aiChatUi']['disableControls'](),null;}}['handleRemovedConversation'](_0x566fbb){this['activeConversation']['id']===_0x566fbb&&this['_startConversationSafely']();}['addCurrentDocumentToChatContext'](){this['activeConversation']?.['addCurrentDocumentToContext'](i(this['context']['locale'],'AI_CHAT_CONTEXT_CURRENT_DOCUMENT'));}async['addSelectionToChatContext'](){const _0x5277a0=this['_aiEditing']['getSelectionText']();this['activeConversation']?.['addSelectionToContext'](_0x5277a0),this['addCurrentDocumentToChatContext']();}['removeSelectionFromChatContext'](){this['activeConversation']?.['removeSelectionFromContext']();}['focusPromptInput'](){this['_aiChatUi']['focusPromptInput']();}async['startConversation'](){await this['_startConversationSafely']();}async['sendMessage']({message:_0xb49726,attributes:_0xc5fbd3}){await this['_handleUIUserMessage']({'userMessage':_0xb49726,'attributes':_0xc5fbd3});}['getGroupId'](){const _0x3508c3=this['context']['config']['get']('collaboration.channelId');if(!_0x3508c3)throw new _0x2ae61f('ai-chat-missing-channel-id',this);return _0x3508c3;}async['_startConversationSafely'](_0x41e903){try{this['_aiChatUi']['enableControls'](),await this['_handleStartConversation'](_0x41e903);}catch(_0x571995){this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_UNABLE_TO_START_CONVERSATION'),'id':_0x41e903||_0x56075e()}),console['error'](_0x571995),this['activeConversation']=void 0x0,this['_aiChatUi']['disableControls']();}}async['_handleStartConversation'](_0x266ced){let _0x19b06c;this['context']['plugins']['has']('AIChatBalloon')&&this['context']['plugins']['get']('AIChatBalloon')['close'](),_0x266ced||!this['activeConversation']?_0x19b06c=this['context']['config']['get']('ai.models.defaultModelId'):this['_aiChatUi']['isModelAvailable']&&(_0x19b06c=this['activeConversation']['selectedModel']['id']),await this['_stopLastInteraction']();const _0x39a104=this['getGroupId'](),_0x4854c7=_0x266ced||_0x56075e();this['activeConversation']=new _t({'connector':this['_aiConnector'],'chatModels':this['_aiChatModels'],'selectedModelId':_0x19b06c,'conversationId':_0x4854c7,'group':_0x39a104,'getEditor':()=>T(this['context']),'isFromHistory':!!_0x266ced}),this['activeConversation']['delegate']('toolDataReceived','interactionStarted')['to'](this),this['activeConversation']['on']('conversationInitialized',(_0x4c043c,_0x19f460)=>{this['_aiChatUi']['createConversation'](_0x19f460),this['_aiChatUi']['resetMessageInput'](),this['_aiChatUi']['clearPendingContextUI'](),this['_aiChatUi']['clearConversationContextUI'](),_0x266ced||(this['_aiChatUi']['resetConversationTitle'](),this['addCurrentDocumentToChatContext']());}),this['activeConversation']['on']('uploadProgressChanged',(_0x1b5aea,_0x5a204c)=>{this['_aiChatUi']['setIsUploadInProgress'](_0x5a204c['isUploadInProgress']);}),this['activeConversation']['on']('interactionCreated',(_0x4dac7,_0x440770)=>{this['_aiChatUi']['addFeedItemUserMessage'](_0x440770);}),this['activeConversation']['on']('webSearchStarted',()=>{const _0x56b0e9=this['_aiChatUi']['prepareLoadingMessage']({'isWebSearchEnabled':!0x0,'isReasoningEnabled':!0x1});this['_aiChatUi']['setLoadingMessage'](_0x56b0e9);}),this['activeConversation']['on']('reasoningStarted',()=>{const _0x579504=this['_aiChatUi']['prepareLoadingMessage']({'isWebSearchEnabled':!0x1,'isReasoningEnabled':!0x0});this['_aiChatUi']['setLoadingMessage'](_0x579504);}),this['activeConversation']['on']('webSearchFinished',(_0x3ca559,_0x4b91c2)=>{this['_aiChatUi']['addFeedInteractionHeader'](_0x4b91c2,{'isWebSearchEnabled':!0x0,'isReasoningEnabled':!0x1});}),this['activeConversation']['on']('reasoningFinished',(_0x580534,_0x136bf0)=>{this['_aiChatUi']['addFeedInteractionHeader'](_0x136bf0,{'isWebSearchEnabled':!0x1,'isReasoningEnabled':!0x0});}),this['activeConversation']['on']('interactionStarted',()=>{this['_aiChatUi']['startInteraction']();}),this['activeConversation']['on']('interactionFinished',async()=>{await this['_aiChatUi']['finishInteraction']();}),this['activeConversation']['on']('interactionDestroyed',(_0x268340,_0x491758)=>{this['_aiChatUi']['removeFeedInteraction'](_0x491758['id']);}),this['activeConversation']['on']('setConversationTitle',(_0x2c59df,_0x5668ca,_0x2dc891)=>{this['updateConversationTitle'](_0x5668ca,_0x2dc891);}),this['activeConversation']['on']('replyCreated',(_0x259a39,_0x25858e)=>{'text'===_0x25858e['type']?this['_aiChatUi']['addFeedItemAIReply'](_0x25858e):this['_aiChatUi']['addFeedItemAISuggestion'](_0x25858e);}),this['activeConversation']['on']('replyContentUpdated',async(_0x201006,_0x34759f)=>{await this['_updateReplyContent']({'reply':_0x34759f});}),this['activeConversation']['on']('replyChangeGroupStateUpdated',(_0x1b4e2c,{reply:_0x59e723,index:_0x5529f6,state:_0x16b2a0})=>{this['_aiChatUi']['updateFeedItemAIReplySuggestionPartState']({'id':_0x59e723['id'],'index':_0x5529f6,'state':_0x16b2a0}),this['_currentPreviewedChangeGroup']?.['replyId']['includes'](_0x59e723['id'])&&this['_currentPreviewedChangeGroup']?.['partIndex']==_0x5529f6&&this['_aiChatBalloon']?.['setState'](_0x16b2a0);}),this['activeConversation']['on']('contextItemAdded',(_0x261678,_0x57323a)=>{if(this['_aiChatUi']['addContextItem'](_0x57323a['contextItem'],_0x57323a['isLoading']),'selection'===_0x57323a['contextItem']['type']){const _0xdab4b0=[...T(this['context'])['model']['document']['selection']['getRanges']()];this['_aiEditing']['showFakeVisualSelection'](_0xdab4b0,'ai-conversation-'+this['activeConversation']?.['id']);}}),this['activeConversation']['on']('contextItemRemoved',(_0x47dbb7,_0x5b4ee9)=>{this['_aiChatUi']['removeContextItem'](_0x5b4ee9['uiId']),'current-document'==_0x5b4ee9['uiId']&&this['removeSelectionFromChatContext'](),'selection'===_0x5b4ee9['type']&&this['_aiEditing']['hideFakeVisualSelection']('ai-conversation-'+this['activeConversation']?.['id']);}),this['activeConversation']['on']('contextItemLoadingEnded',(_0x308523,_0x1da137)=>{this['_aiChatUi']['setContextItemLoading'](_0x1da137['contextItem']['uiId'],_0x1da137['isLoading']);}),this['activeConversation']['on']('contextSent',(_0x3bc5cc,_0x4a43c8)=>{this['_aiChatUi']['setConversationContext'](_0x4a43c8['contextItems']);}),this['activeConversation']['on']('addContextOptionsChanged',(_0x20e432,_0x295fb5)=>{this['_aiChatUi']['setAddContextOptions'](_0x295fb5['options']);}),this['activeConversation']['on']('sourceResourcesLoaded',(_0x539e5a,_0x477622)=>{this['_aiChatUi']['populateSourceResourceBalloon'](_0x477622['sourceId'],_0x477622['source'],_0x477622['resources'],_0x477622['uid']);}),this['activeConversation']['on']('resourceStateChanged',(_0x383412,_0xa3edf6)=>{this['_aiChatUi']['updateResourceState'](_0xa3edf6['sourceId'],_0xa3edf6['resourceId'],_0xa3edf6['isInContext']);}),this['activeConversation']['on']('capabilitiesUpdated',(_0x10bbcb,_0xfb8dc5)=>{this['_aiChatUi']['updateCapabilities'](_0xfb8dc5);}),this['activeConversation']['on']('modelSelected',async(_0x25b22b,_0x288173)=>{const _0x4ce12d=(await this['_aiChatModels']['getAll']())['find'](_0x24cae6=>_0x24cae6['id']===_0x288173['selectedModel']?.['id'])||null;this['_aiChatUi']['setSelectedModel'](_0x4ce12d,_0x288173['isDisabled']);}),this['activeConversation']['on']('error',(_0x204aa7,{error:_0x57aca8,interactionId:_0x83319f,fileName:_0x5dd123,url:_0x5d6ab7,sourceId:_0x4de0ca,sourceLabel:_0x12b430})=>{const _0x307ecc=_0x83319f?_0x83319f+':'+_0x56075e():_0x56075e();_0x57aca8['message']['startsWith']('ai-request-aborted')?this['_aiChatUi']['addFeedItemStaticMessage']({'staticMessage':i(this['context']['locale'],'AI_CHAT_ABORTED_MESSAGE'),'id':_0x307ecc}):_0x57aca8['message']['startsWith']('ai-chat-conversation-init-failed')||_0x57aca8['message']['startsWith']('ai-chat-conversation-start-failed')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_UNABLE_TO_START_CONVERSATION'),'id':_0x307ecc}),this['_logError'](_0x57aca8)):_0x57aca8['message']['startsWith']('ai-chat-file-upload-failed')?this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_FILE',_0x5dd123),'id':_0x307ecc}):_0x57aca8['message']['startsWith']('ai-chat-url-upload-failed')?this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_URL',_0x5d6ab7),'id':_0x307ecc}):_0x57aca8['message']['startsWith']('ai-chat-context-invalid-data')?this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_CONTEXT_INVALID_DATA'),'id':_0x307ecc}):_0x57aca8['message']['startsWith']('ai-chat-context-unsupported-type')?this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_CONTEXT_UNSUPPORTED_TYPE'),'id':_0x307ecc}):_0x57aca8['message']['startsWith']('ai-chat-source-resources-load-failed')?(_0x4de0ca&&this['_aiChatUi']['closeSourceResourceBalloon'](_0x4de0ca),this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_LOAD_RESOURCES',_0x12b430||'source'),'id':_0x307ecc}),this['_logError'](_0x57aca8)):_0x57aca8['message']['startsWith']('ai-chat-resource-load-failed')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_RESOURCE_LOAD_FAILED'),'id':_0x307ecc}),this['_logError'](_0x57aca8)):_0x57aca8['message']['startsWith']('ai-chat-invalid-request')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_INVALID_REQUEST'),'id':_0x307ecc}),this['_logError'](_0x57aca8)):_0x57aca8['message']['startsWith']('ai-chat-context-unsupported-file-type')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_CONTEXT_UNSUPPORTED_FILE_TYPE'),'id':_0x307ecc}),this['_logError'](_0x57aca8)):_0x57aca8['message']['startsWith']('ai-chat-context-file-too-large')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_CONTEXT_FILE_TOO_LARGE'),'id':_0x307ecc}),this['_logError'](_0x57aca8)):_0x57aca8['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':_0x307ecc}),this['_logError'](_0x57aca8)):_0x57aca8['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':_0x307ecc}),this['_logError'](_0x57aca8)):(this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_GENERIC_ERROR'),'id':_0x307ecc}),this['_logError'](_0x57aca8));}),await this['activeConversation']['init'](this['context']['config']['get']('ai.chat.context')),_0x266ced||await this['activeConversation']['start']();}async['_handleUIUserMessage']({userMessage:_0x6e74c6,attributes:_0x47c999}){if(!this['activeConversation'])throw new _0x2ae61f('ai-chat-controller-no-active-conversation');if(this['activeConversation']['isCurrentDocumentInContext']()){const _0x562658=await this['_aiEditing']['getDocumentData']();await this['activeConversation']['updateCurrentDocumentInContext'](_0x562658);}this['activeConversation']['id']&&this['activeConversation']['isStarted']&&await this['activeConversation']['handleUserInteraction']({'userMessage':_0x6e74c6,'attributes':_0x47c999});}['_showConversationHistory'](){console['log']('Showing\x20conversation\x20history...');}['_setIsMaximized'](_0x2e5aea){this['_aiChatUi']['setIsMaximized'](_0x2e5aea);}['_logError'](_0x2a534d){gt(_0x2a534d['message']);}['_removeFromContext'](_0x4f46c6){this['activeConversation']?.['removeFromContext'](_0x4f46c6);}['_toggleWebSearch'](){this['activeConversation']?.['toggleWebSearch']();}['_toggleReasoning'](){this['activeConversation']?.['toggleReasoning']();}['getInteractionAndReplyById'](_0x2a0227){const [_0x1d0b3f,_0x49ff26]=_0x2a0227['split'](':'),_0x2db69d=this['activeConversation']['getInteraction'](_0x1d0b3f),_0x497ba1=_0x2db69d['getReply'](_0x49ff26);return{'interaction':_0x2db69d,'reply':_0x497ba1};}['_scrollToSuggestionRange'](_0x71a5f5,_0x5d92b9=!0x1){const _0x165d00=T(this['context']),_0x29945a={'target':_0x165d00['editing']['view']['domConverter']['viewRangeToDom'](_0x165d00['editing']['mapper']['toViewRange'](_0x71a5f5)),'viewportOffset':{'top':0x96,'left':0x0,'bottom':0x32,'right':0x0},'ancestorOffset':0x14,'alignToTop':_0x5d92b9};_0x5d92b9&&(_0x29945a['alignToTop']=!0x0),_0x3a4ed0(_0x29945a);}['updateConversationTitle'](_0x180945,_0x198881=!0x1){this['_aiChatUi']['setConversationTitle'](_0x180945||i(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION'),_0x198881);}async['_updateReplyContent']({reply:_0x58ea37,renderingStrategy:_0x329485}){const {id:_0x218567,interactionId:_0xb25ca8,isDone:_0x5d9b52,type:_0x20d1ab,parsedContent:_0x244bc9}=_0x58ea37,_0x1a0931=_0xb25ca8+':'+_0x218567;if('modification'===_0x20d1ab){const _0x5ebd3a=_0x58ea37['getContentParts']({'showDiff':this['_aiChatUi']['showDiff']});await this['_aiChatUi']['updateFeedItemAIReplySuggestionContent']({'id':_0x1a0931,'parts':_0x5ebd3a,'renderingStrategy':_0x329485,'isDone':_0x5d9b52});}else'text'===_0x20d1ab&&await this['_aiChatUi']['updateFeedItemAIReplyContent']({'id':_0x1a0931,'parsedContent':_0x244bc9,'renderingStrategy':_0x329485,'isDone':_0x5d9b52});_0x5d9b52&&_0x58ea37['sources']['length']>0x0&&this['_aiChatUi']['updateFeedItemAIReplySources'](_0x1a0931,_0x58ea37['sources']);}async['_stopLastInteraction'](){const _0x5b3c97=this['activeConversation']?.['lastInteraction'];_0x5b3c97&&(_0x5b3c97['stop'](),this['_aiChatUi']['stopInteraction'](_0x5b3c97));}async['_flushLastInteractionUI'](){const _0x4b57c6=this['activeConversation']?.['lastInteraction'];if(_0x4b57c6){for await(const _0x31a63f of _0x4b57c6['replies'])await this['_updateReplyContent']({'reply':_0x31a63f,'renderingStrategy':'static'});}}['_updateRatings'](_0x30432a){const _0x194c96={'positiveCount':_0x30432a['changeGroups']['filter'](_0x5dbdbf=>'accepted'===_0x5dbdbf['state'])['length'],'totalCount':_0x30432a['changeGroups']['length'],'modificationId':_0x30432a['id']},_0x2c172d=this['activeConversation']['getInteraction'](_0x30432a['interactionId'])['messageId'];_0x2c172d&&this['_aiConnector']['upsertAIChatRating'](this['activeConversation']['id'],_0x2c172d,_0x194c96);}['_registerToolDataCallback'](_0x8325b){let _0x4a91c9=null,_0x28e0ce=null;this['on']('toolDataReceived',(_0x3b7e0b,_0xbcb095,_0x23e95d)=>{_0x23e95d['id']!==_0x4a91c9&&(_0x4a91c9=_0x23e95d['id'],_0x28e0ce=this['_getAIChatInteractionAPI'](_0x23e95d)),_0x8325b(_0xbcb095,_0x28e0ce);});}['_getAIChatInteractionAPI'](_0x54ed7f){const _0x13769e=this['_aiChatUi'],_0x59a20a=()=>{_0x54ed7f['resetWebSearchState'](),_0x54ed7f['resetReasoningState'](),_0x13769e['clearLoadingMessage']();},_0xf1a457=()=>{_0x54ed7f['currentReply']&&(_0x54ed7f['currentReply']['done'](),_0x54ed7f['currentReply']=void 0x0);};return{'insertTextReply':(_0x2f0247,_0xb90291)=>{_0xf1a457(),_0x59a20a();const _0x2796a5=_0x54ed7f['currentReply']=_0x54ed7f['createReply']({'type':'text','interactionId':_0x54ed7f['id'],'content':_0x2f0247,'id':_0xb90291||_0x56075e()});return _0xf1a457(),_0x2796a5;},'insertCustomElement':async(_0x511959,_0xf16264)=>(_0xf1a457(),_0x59a20a(),_0x13769e['addFeedItemCustomElement'](_0x511959,_0xf16264||_0x56075e())),'setLoadingMessage':_0x4d9881=>{_0x13769e['setLoadingMessage'](_0x4d9881);},'clearLoadingMessage':()=>{_0x13769e['clearLoadingMessage']();}};}}const R='ai-selection';class D extends _0x3b66f2{constructor(_0x5a2537){super(_0x5a2537),this['context']['config']['define']('ai.models.showModelSelector',!0x0);}['_outputDataProcessor'];['_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 _0x2ea1c2=T(this['context']),_0x248951=_0x2ea1c2['plugins']['has']('RealTimeCollaborationClient')&&_0x2ea1c2['plugins']['get']('RealTimeCollaborationClient')['sessionId'];this['_sessionId']=_0x248951||_0x56075e();}return this['_sessionId'];}async['getDocumentData'](){const _0x2bb7d6=T(this['context']),_0x1a90c0=_0x2bb7d6['model'],_0x3fcc79=_0x2bb7d6['data']['toView'](_0x1a90c0['document']['getRoot'](),{'convertAiChatSelectionMarker':!0x0}),_0x59ddb1=new Dt(_0x2bb7d6['editing']['view']['document']);this['_setDataIdsOnChildren'](_0x3fcc79,_0x59ddb1);let _0x21749a=await this['_getDocumentDataStringFromView'](_0x3fcc79);const _0x1749e1=this['_getMarkersInDocumentOrder'](),_0x559fea=[];for(const _0x11f052 of _0x1749e1){const _0x523446='<'+_0x11f052['name']+':start></'+_0x11f052['name']+':start>',_0x2fafeb=_0x21749a['indexOf'](_0x523446);_0x21749a=_0x21749a['substring'](0x0,_0x2fafeb)+_0x21749a['substring'](_0x2fafeb+_0x523446['length']);const _0x1ee692='<'+_0x11f052['name']+':end></'+_0x11f052['name']+':end>',_0x396a32=_0x21749a['indexOf'](_0x1ee692);_0x21749a=_0x21749a['substring'](0x0,_0x396a32)+_0x21749a['substring'](_0x396a32+_0x1ee692['length']),_0x559fea['push']({'markerName':_0x11f052['name'],'start':_0x2fafeb,'end':_0x396a32,'htmlFragment':_0x21749a['substring'](_0x2fafeb,_0x396a32)});}return{'content':_0x21749a,'version':_0x2bb7d6['model']['document']['version'],'sessionId':this['sessionId'],'selections':_0x559fea};}async['afterInit'](){this['context']instanceof dt?this['_integrateEditor'](this['context']):this['listenTo'](this['context']['editors'],'add',(_0x2781e8,_0x31db12)=>{_0x31db12['on']('ready',()=>{this['_integrateEditor'](_0x31db12);});});}['_setOutputDataProcessor'](_0x268191){this['_outputDataProcessor']=_0x268191;}async['_getDocumentDataStringFromView'](_0x5cb2b0){let _0x342b4d;const _0x5382cf=T(this['context']);if(this['_outputDataProcessor']){const _0x58fb2a=_0x5382cf['data']['processor']['domConverter']['viewToDom'](_0x5cb2b0),_0x583d5d=await this['_outputDataProcessor'](_0x58fb2a);_0x342b4d=_0x5382cf['data']['processor']['htmlWriter']['getHtml'](_0x583d5d);}else _0x342b4d=_0x5382cf['data']['processor']['toData'](_0x5cb2b0);return _0x342b4d;}['_integrateEditor'](_0x24ebfc){_0x24ebfc['conversion']['for']('editingDowncast')['markerToHighlight']({'model':R,'view':{'classes':['ck-fake-ai-selection','ck-ai-assistant-ui_theme'],'priority':0xc}}),_0x24ebfc['conversion']['for']('dataDowncast')['markerToElement']({'model':R,'view':(_0x2d9293,{writer:_0x5e151b,options:_0x5c5edd})=>_0x5c5edd['convertAiChatSelectionMarker']?_0x5e151b['createUIElement'](_0x2d9293['markerName']+':'+(_0x2d9293['isOpening']?'start':'end')):null});}['showFakeVisualSelection'](_0x106669,_0x5f1690,_0x18c78c=!0x1,_0xad0eba=!0x1){if(this['_displayedFakeSelectionLocked']&&!_0xad0eba)return!0x1;const _0x5d6cfd=T(this['context'])['model'];return _0x5d6cfd['change'](_0x388942=>{this['_displayedFakeSelectionId']&&this['hideFakeVisualSelection'](this['_displayedFakeSelectionId']),this['_displayedFakeSelectionId']=_0x5f1690,this['_displayedFakeSelectionLocked']=_0x18c78c;let _0x21d9cd=0x0;for(let _0x3be7bb of _0x106669){const _0x5325d7=R+':'+_0x21d9cd;if(_0x3be7bb['start']['isAtEnd']){const _0x5cba6f=_0x3be7bb['start']['getLastMatchingPosition'](({item:_0x3c0458})=>!_0x5d6cfd['schema']['isContent'](_0x3c0458),{'boundaries':_0x3be7bb});_0x3be7bb=_0x388942['createRange'](_0x5cba6f,_0x3be7bb['end']);}_0x388942['addMarker'](_0x5325d7,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x3be7bb}),_0x21d9cd++;}}),window['getSelection']()?.['removeAllRanges'](),!0x0;}['hideFakeVisualSelection'](_0x3717a2){if(this['_displayedFakeSelectionId']!=_0x3717a2)return!0x1;this['_displayedFakeSelectionId']=null,this['_displayedFakeSelectionLocked']=!0x1;const _0x23c5b3=T(this['context']),_0x71c85e=_0x23c5b3['model']['markers']['getMarkersGroup'](R);return _0x23c5b3['model']['change'](_0x1e9b0f=>{for(const _0x5542a5 of _0x71c85e)_0x1e9b0f['removeMarker'](_0x5542a5);}),!0x0;}async['modelToDataWithIds'](_0x22038e){const _0x9fa9a=T(this['context']),_0xd566eb=_0x9fa9a['data']['toView'](_0x22038e),_0x4ceb6a=new Dt(_0x9fa9a['editing']['view']['document']);return this['_setDataIdsOnChildren'](_0xd566eb,_0x4ceb6a),this['_getDocumentDataStringFromView'](_0xd566eb);}['_setDataIdsOnChildren'](_0x44d235,_0x11ac6a){let _0x4813f5=!0x1;const _0x4b68e7=new Set();for(const _0x180690 of _0x44d235['getChildren']()){const _0x445b6f=_0x180690['is']('emptyElement')||_0x180690['is']('containerElement');if(!_0x180690['is']('element'))continue;(this['_setDataIdsOnChildren'](_0x180690,_0x11ac6a)||_0x445b6f)&&(_0x11ac6a['setAttribute']('data-id',this['_nextDataId'](_0x4b68e7),_0x180690),_0x4813f5=!0x0);}return _0x4813f5;}['_nextDataId'](_0x3b4380){let _0x5ab11d;do{_0x5ab11d='';for(let _0x64172e=0x0;_0x64172e<0x4;_0x64172e++)_0x5ab11d+=String['fromCharCode'](0x61+Math['floor'](0x1a*Math['random']()));}while(_0x3b4380['has'](_0x5ab11d));return _0x3b4380['add'](_0x5ab11d),_0x5ab11d;}['getSelectionText'](){const {model:_0x24081e}=T(this['context']),_0x51a746=_0x24081e['document']['selection'],_0x52ea1d=[];for(const _0x257624 of _0x51a746['getRanges']())for(const _0x9bb1db of _0x257624['getItems']())_0x9bb1db['is']('$textProxy')?_0x52ea1d['push'](_0x9bb1db['data']):_0x9bb1db['is']('element')&&_0x52ea1d['length']>0x0&&'\x20'!==_0x52ea1d[_0x52ea1d['length']-0x1]&&_0x52ea1d['push']('\x20');return _0x52ea1d['length']?'\x22'+_0x52ea1d['join']('')['trim']()+'\x22':i(this['context']['locale'],'AI_CHAT_CONTEXT_DOCUMENT_SELECTION_LABEL');}['_getMarkersInDocumentOrder'](){const _0x47d353=T(this['context'])['model'];return Array['from'](_0x47d353['markers']['getMarkersGroup'](R))['sort']((_0x4dc68d,_0x56d0bd)=>_0x4dc68d['getStart']()['isBefore'](_0x56d0bd['getStart']())?-0x1:_0x4dc68d['getStart']()['isAfter'](_0x56d0bd['getStart']())?0x1:0x0);}}const ut=['showChangeInText','insertSuggestion','applySuggestion','rejectSuggestion','mouseOverSuggestion','mouseLeaveSuggestion','toggleSuggestionDisplayMode','like','dislike'],bt=[...ut,'startConversation','resizeTabs','sendUserMessage','abortPromptStream','addDocumentToContext','addFileToContext','addUrlToContext','executeCustomItemCallback','addResourceToContext','removeContextItem','loadSourceResources','toggleWebSearch','toggleReasoning','selectModel'];class ha{['options'];['isStreaming']=!0x1;['document']=null;['nodesList']=[];['currentIndex']=0x0;['timeoutAbortController']=null;['lastUpdateTime']=0x0;constructor(_0x478b5b){this['options']={'delay':_0x478b5b['delay']??0x14,'textNodeStyle':_0x478b5b['textNodeStyle'],'onStreamUpdate':_0x478b5b['onStreamUpdate']||(()=>{})};}async['stream']({document:_0x2f446d,targetElement:_0x3853d2,abortSignal:_0x436594}){this['isStreaming']&&this['stop'](),_0x436594?.['addEventListener']('abort',this['stop']['bind'](this)),this['document']=_0x125b95(_0x2f446d,!0x0),this['nodesList']=this['getParsedDocumentNodeList'](),this['isStreaming']=!0x0,this['currentIndex']>this['nodesList']['length']&&(this['currentIndex']=this['nodesList']['length']);for(let _0x4cf1e1=0x0;_0x4cf1e1<this['currentIndex'];_0x4cf1e1++)this['nodesList'][_0x4cf1e1]['shouldBeStreamed']=!0x0;do{const _0x207896=Date['now'](),_0xe507ca=this['nodesList'][this['currentIndex']],_0x4d1bd2=_0x207896-this['lastUpdateTime'];if(_0xe507ca){_0xe507ca['shouldBeStreamed']=!0x0;let _0x5f184b=_0xe507ca['parent'];for(;_0x5f184b;)_0x5f184b['shouldBeStreamed']=!0x0,_0x5f184b=_0x5f184b['parent'];}if(_0x4d1bd2<this['options']['delay'])try{const {promise:_0x1a0306,abortController:_0x67fc6f}=Cs(this['options']['delay']-_0x4d1bd2);this['timeoutAbortController']=_0x67fc6f,await _0x1a0306;}catch(_0x31b094){return;}_0x2c83f5(_0x3853d2,'<'+_0x3853d2['tagName']+'>'+this['renderNode'](this['document'])+'</'+_0x3853d2['tagName']+'>',{'childrenOnly':!0x0}),this['options']['onStreamUpdate']&&this['options']['onStreamUpdate'](),this['currentIndex']++,this['lastUpdateTime']=Date['now']();}while(this['currentIndex']<this['nodesList']['length']);this['currentIndex']=this['nodesList']['length'],this['isStreaming']=!0x1;}['reset'](){this['isStreaming']=!0x1,this['document']=null,this['nodesList']=[],this['currentIndex']=0x0,this['timeoutAbortController']=null;}['cleanUpAnimations']({targetElement:_0x4dd4b5}){Array['from'](_0x4dd4b5['querySelectorAll']('span[data-ck-html-streamer-word-chunk]'))['reverse']()['forEach'](_0x48be8a=>{_0x48be8a['replaceWith'](_0x48be8a['childNodes'][0x0]);});}['stop'](){this['isStreaming']=!0x1,this['timeoutAbortController']&&(this['timeoutAbortController']['abort'](),this['timeoutAbortController']=null);}['renderNode'](_0x1c82f3){let _0x319c7e='';if(function(_0x447dd1){return _0x75aa83(_0x447dd1);}(_0x1c82f3)){for(const _0x36abf2 of _0x1c82f3['children'])_0x319c7e+=this['renderNode'](_0x36abf2);}else{if(Ts(_0x1c82f3)){if(!_0x1c82f3['shouldBeStreamed'])return'';const _0xa286bc=_0x1c82f3,_0x262ac8=Object['entries'](_0xa286bc['attribs'])['map'](([_0xfe66b7,_0x12eef9])=>_0xfe66b7+'=\x22'+_0x12eef9+'\x22')['join']('\x20');_0x319c7e+='<'+_0xa286bc['tagName']+(_0x262ac8?'\x20'+_0x262ac8:'')+'>';for(const _0x4a2c2d of _0x9c3c(_0xa286bc))_0x319c7e+=this['renderNode'](_0x4a2c2d);_0x319c7e+='</'+_0xa286bc['tagName']+'>';}else{if(!Ss(_0x1c82f3))return'';if(!_0x1c82f3['shouldBeStreamed'])return'';!function(_0x3ad068){if(!_0x3ad068['parent']||!Ts(_0x3ad068['parent']))return!0x1;if(!ys['includes'](_0x3ad068['parent']['tagName']))return!0x1;return!_0x29622c(_0x3ad068)['match'](/^\s*[<>]\s*$/);}(_0x1c82f3)?_0x319c7e+=_0xb61cdf(_0x1c82f3):_0x319c7e+=_0xb61cdf(new _0x44dddb('span',{'data-ck-html-streamer-word-chunk':'','style':this['options']['textNodeStyle']},[_0x1c82f3]));}}return _0x319c7e;}['getParsedDocumentNodeList'](){const _0x157464=[];return function(_0x3a4262,_0x4cd2f8){const _0x46ea3f=_0x2a4692=>{if(_0x4cd2f8(_0x2a4692),_0x2a4692 instanceof _0x4fe0b3)for(let _0x33e684=0x0;_0x33e684<_0x2a4692['children']['length'];_0x33e684++){const _0x228983=_0x2a4692['children'][_0x33e684];_0x46ea3f(_0x228983);}};for(let _0xf731fc=0x0;_0xf731fc<_0x3a4262['children']['length'];_0xf731fc++)_0x46ea3f(_0x3a4262['children'][_0xf731fc]);}(this['document'],_0x7edbf8=>{if(Ss(_0x7edbf8)){const _0x263201=this['splitTextNodeIntoWordNodes'](_0x7edbf8);_0x263201['length']&&_0x157464['push'](..._0x263201);}_0x7edbf8['isWordSplitSource']||_0x7edbf8['isWordSplitResult']||_0x157464['push'](_0x7edbf8);}),_0x157464;}['splitTextNodeIntoWordNodes'](_0x3f2aaa){if(_0x3f2aaa['isWordSplitSource']||_0x3f2aaa['isWordSplitResult'])return[];const _0x27e830=_0x29622c(_0x3f2aaa)['match'](/(?:\s*\S+\s*)/g),_0x548875=[];if(_0x27e830&&_0x27e830['length']>0x1){for(const _0x25f65f of _0x27e830){const _0x166fae=new _0x389e0a(_0x25f65f);_0x166fae['isWordSplitResult']=!0x0,_0xb261c2(_0x3f2aaa,_0x166fae),_0x548875['push'](_0x166fae);}_0x3f2aaa['isWordSplitSource']=!0x0,_0x3c7927(_0x3f2aaa);}return _0x548875;}}const ys=['p','li','td','th','span','h1','h2','h3','h4','h5','h6','b','strong','i','em','mark','del','ins','sup','sub','a','code','div'];function Ss(_0x45b41f){return _0x1d859a(_0x45b41f);}function Ts(_0x3e5637){return _0x239cab(_0x3e5637);}function Cs(_0x1e7829){const _0x197da4=new AbortController();return{'promise':new Promise((_0x335c0b,_0xf8fd66)=>{const _0x189624=setTimeout(_0x335c0b,_0x1e7829);_0x197da4['signal']['addEventListener']('abort',()=>{clearTimeout(_0x189624),_0xf8fd66();});}),'abortController':_0x197da4};}class Fr extends _0x3ddefc{['options'];['content']='';['htmlStreamer'];['children'];constructor(_0x5b6a2d){super();const _0x42eaaa=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']=_0x5b6a2d,this['children']=this['createCollection'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__item',_0x42eaaa['if']('isDone','ck-ai-chat__feed__item_done'),_0x42eaaa['if']('isVisible','ck-hidden',_0x4af310=>!_0x4af310),'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'](_0x544481=>{_0x544481['removeAttribute']('data-id');}),this['isDone']=!0x0;}async['streamIntoElement'](_0x1443b9,_0x1f3ca3,_0x147dee){await this['htmlStreamer']['stream']({'document':_0x1443b9,'targetElement':_0x1f3ca3,'abortSignal':_0x147dee});}}class oa extends _0x3ddefc{['showChangesToggleView'];constructor(_0x8ce82e,_0x1b34a6){super(_0x8ce82e),this['set']('isShowChangesToggleVisible',!0x0),this['showChangesToggleView']=new ShowChangesToggleView(_0x8ce82e),this['showChangesToggleView']['set']({'class':'ck-ai-suggestion__header__show-changes-toggle\x20ck-ai-chat-controls-button','label':i(_0x8ce82e,'AI_SUGGESTION_BUTTON_SHOW_CHANGES'),'withText':!0x0}),this['showChangesToggleView']['isOn']=_0x1b34a6['showDiff'],this['showChangesToggleView']['bind']('isVisible')['to'](this,'isShowChangesToggleVisible'),this['showChangesToggleView']['bind']('icon')['to'](this['showChangesToggleView'],'isOn',_0x14ce15=>_0x14ce15?_0x206735:_0x256676),this['showChangesToggleView']['on']('execute',()=>{this['showChangesToggleView']['isOn']=!this['showChangesToggleView']['isOn'],this['fire']('toggleShowChanges',{'isOn':this['showChangesToggleView']['isOn']});});const _0x221a8c=new _0x2fc344();_0x221a8c['content']=_0x2f76a7,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__header',!0x1===_0x1b34a6['showHeader']?'ck-hidden':null]['filter'](Boolean)},'children':[_0x221a8c,{'tag':'span','children':[i(_0x8ce82e,'AI_SUGGESTION_HEADER_TITLE')]},this['showChangesToggleView']]});}}class ShowChangesToggleView extends _0x4421de{['render'](){super['render'](),this['children']['remove'](this['iconView']),this['children']['add'](this['iconView']);}}const $n={'accepted':_0x297052,'rejected':_0x5a6b5c,'outdated':_0x5a6b5c};class mi extends _0x3ddefc{['stateIconView'];constructor(_0x32658d){super(_0x32658d);const _0x328066=this['bindTemplate'];this['set']('state','accepted'),this['set']('isVisible',!0x0),this['stateIconView']=new StateIconView(),this['stateIconView']['bind']('state')['to'](this),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__content-part-state',_0x328066['to']('state',_0x244d85=>'ck-ai-suggestion__content-part-state_'+_0x244d85),_0x328066['if']('isVisible','ck-hidden',_0x12eee6=>!_0x12eee6)]},'children':[{'tag':'span','attributes':{'class':['ck-ai-suggestion__content-part-state__label']},'children':[{'text':_0x328066['to']('state',_0x40bac0=>{switch(_0x40bac0){case'accepted':return i(_0x32658d,'AI_SUGGESTION_CONTENT_PART_STATE_ACCEPTED');case'rejected':return i(_0x32658d,'AI_SUGGESTION_CONTENT_PART_STATE_REJECTED');case'outdated':return i(_0x32658d,'AI_SUGGESTION_CONTENT_PART_STATE_OUTDATED');}})}]},this['stateIconView']]});}['setState'](_0x3815e9){this['state']=_0x3815e9;}}class StateIconView extends _0x2fc344{constructor(){super(),this['set']('state','accepted'),this['content']=$n[this['state']],this['on']('change:state',()=>{this['content']=$n[this['state']];});}}class gi extends _0x5be165{['_applyButton'];['_suggestButton'];constructor(_0x15a54b,_0xc22634,_0x40a2e6){super(_0x15a54b);const _0x68eb4d=Boolean(_0x40a2e6);this['set']('isEnabled',!_0x68eb4d),this['set']('isVisible',!0x0),this['class']='ck-ai-suggestion-content-part-toolbar';const _0x3069f8=[];if(_0x68eb4d){const _0x3b9831=new _0x4421de(_0x15a54b);_0x3b9831['set']({'label':i(_0x15a54b,'AI_SUGGESTION_DISABLED_TOOLTIP_MESSAGE'),'tooltip':!0x0,'tooltipPosition':'n','withText':!0x1,'icon':_0x1eb394}),_0x3069f8['push'](_0x3b9831);}else{_0xc22634['includes']('applySuggestion')&&(this['_applyButton']=new _0x4421de(_0x15a54b),this['_applyButton']['set']({'label':i(_0x15a54b,'AI_SUGGESTION_CONTENT_PART_APPLY'),'tooltip':!0x0,'tooltipPosition':'n','withText':!0x1,'icon':_0x297052}),this['_applyButton']['bind']('isEnabled')['to'](this),this['_applyButton']['on']('execute',()=>{this['fire']('applySuggestion');}),_0x3069f8['push'](this['_applyButton'])),_0xc22634['includes']('insertSuggestion')&&(this['_suggestButton']=new _0x4421de(_0x15a54b),this['_suggestButton']['set']({'label':i(_0x15a54b,'AI_SUGGESTION_CONTENT_PART_ADD_SUGGESTION'),'tooltip':!0x0,'tooltipPosition':'n','withText':!0x1,'icon':_0x3bd052}),this['_suggestButton']['bind']('isEnabled')['to'](this),this['_suggestButton']['on']('execute',()=>{this['fire']('insertSuggestion');}),_0x3069f8['push'](this['_suggestButton']));const _0x500277=new _0x4421de(_0x15a54b);_0x500277['set']({'label':i(_0x15a54b,'AI_SUGGESTION_CONTENT_PART_REJECT'),'tooltip':!0x0,'tooltipPosition':'n','withText':!0x1,'icon':_0x5a6b5c}),_0x500277['bind']('isEnabled')['to'](this),_0x500277['on']('execute',()=>{this['fire']('rejectSuggestion');}),_0x3069f8['push'](_0x500277);}this['items']['addMany'](_0x3069f8);const _0x14dd40=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':[_0x14dd40['if']('isVisible','ck-hidden',_0x1bdf44=>!_0x1bdf44)]}});}['setButtonsVisibility']({showApplyButton:_0x4235c0,showSuggestButton:_0x1d472f}){this['_applyButton']&&(this['_applyButton']['isVisible']=_0x4235c0),this['_suggestButton']&&(this['_suggestButton']['isVisible']=_0x1d472f);}}class vn extends _0x3ddefc{['toolbarView'];['stateView'];['titleLabelView'];['children'];constructor(_0x530ccf,{part:_0x445db5,uiIndex:_0x4be2fc,availableActions:_0x5ac1ed,areActionsDisabled:_0x6420f0}){super(_0x530ccf),this['set']('isEnabled',!0x0),this['set']('state','pending'),this['toolbarView']=new gi(_0x530ccf,_0x5ac1ed,_0x6420f0),this['toolbarView']['on']('rejectSuggestion',()=>{this['fire']('rejectSuggestion',{'index':_0x445db5['index']});}),this['toolbarView']['on']('insertSuggestion',()=>{this['fire']('insertSuggestion',{'index':_0x445db5['index']});}),this['toolbarView']['on']('applySuggestion',()=>{this['fire']('applySuggestion',{'index':_0x445db5['index']});}),this['toolbarView']['bind']('isEnabled')['to'](this),this['stateView']=new mi(_0x530ccf),this['titleLabelView']=new AISuggestionBodyContentPartTitleLabelView(_0x530ccf,_0x4be2fc),this['children']=this['createCollection'](),this['children']['addMany']([this['titleLabelView'],this['toolbarView']]),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all-excluded','ck-ai-suggestion__body__content-part__title']},'children':this['children']}),this['on']('change:state',(_0x242beb,_0x591b72,_0x43c87d,_0x151924)=>{'pending'===_0x151924?this['children']['remove'](this['toolbarView']):this['children']['remove'](this['stateView']),'pending'===_0x43c87d?this['children']['add'](this['toolbarView']):(this['stateView']['setState'](_0x43c87d),this['children']['add'](this['stateView']));});}}class AISuggestionBodyContentPartTitleLabelView extends _0x3ddefc{constructor(_0x4df78f,_0x49b161){super(_0x4df78f),this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-suggestion__body__content-part__title__label']},'children':[i(_0x4df78f,'AI_SUGGESTION_CONTENT_PART_TITLE',_0x49b161['toString']())]});}}class ui extends _0x3ddefc{['htmlStreamer'];constructor(_0x4ee876){super(_0x4ee876),this['htmlStreamer']=new ha({'textNodeStyle':'animation:\x20ck-html-streamer-fade-in\x20.5s','delay':0x14}),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content','ck-reset_all-excluded','ck-ai-suggestion-streamable-content']}});}async['update']({part:_0x870e1,renderingStrategy:_0x2f3cb8,abortSignal:_0x576e33}){'streaming'===_0x2f3cb8?await this['htmlStreamer']['stream']({'document':_0x870e1['content'],'targetElement':this['element'],'abortSignal':_0x576e33}):this['element']['innerHTML']=Tt(_0x870e1['content']);}['clear'](){this['htmlStreamer']['reset'](),this['element']['innerHTML']='';}}class na extends _0x3ddefc{['_children'];['_headerView'];['_streamableContentView'];constructor(_0x24928d,{part:_0x52861d,uiIndex:_0x1f8a5f,areActionsDisabled:_0xb446c3,availableActions:_0xbc246a}){super(_0x24928d);const _0xf5efac=this['bindTemplate'];this['set']('state','pending'),this['set']('isDone',!0x1),this['set']('isVisible',!0x1),this['set']('isActive',!0x1),this['set']('isEnabled',!0x1);const _0x410d76=()=>{this['isEnabled']=this['isDone']&&'pending'==this['state']&&!_0xb446c3;};this['on']('change:state',_0x410d76),this['on']('change:isDone',_0x410d76),_0x410d76(),this['_children']=this['createCollection'](),this['_headerView']=new vn(_0x24928d,{'part':_0x52861d,'uiIndex':_0x1f8a5f,'availableActions':_0xbc246a,'areActionsDisabled':_0xb446c3}),this['_headerView']['bind']('isEnabled','state')['to'](this),this['_headerView']['delegate'](...ut)['to'](this),this['_streamableContentView']=new ui(_0x24928d),this['_children']['addMany']([this['_headerView'],this['_streamableContentView']]),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__body__content-part',_0xf5efac['to']('state',_0x327b68=>'ck-ai-suggestion__body__content-part_'+_0x327b68),_0xf5efac['if']('isEnabled','ck-ai-suggestion__body__content-part_enabled'),_0xf5efac['if']('isActive','ck-ai-suggestion__body__content-part_active'),_0xf5efac['if']('isVisible','ck-hidden',_0x465bb4=>!_0x465bb4)]},'children':this['_children'],'on':{'mouseenter':_0xf5efac['to'](()=>{this['isEnabled']&&this['fire']('mouseOverSuggestion',{'index':_0x52861d['index']});}),'mouseleave':_0xf5efac['to'](()=>{this['isEnabled']&&this['fire']('mouseLeaveSuggestion',{'index':_0x52861d['index']});}),'click':_0xf5efac['to'](_0x172d2b=>{const _0x27b03d=_0x172d2b['target'];this['isEnabled']&&!this['_headerView']['toolbarView']['element']['contains'](_0x27b03d)&&this['fire']('showChangeInText',{'index':_0x52861d['index']});})}});}async['updateContent']({part:_0x4e99c7,renderingStrategy:_0x5c4776,showUnchangedParts:_0x26b21a=!0x1,abortSignal:_0x342194}){this['partDefinition']=_0x4e99c7,this['isVisible']=this['partDefinition']['hasChanges']||_0x26b21a,this['isVisible']&&await this['_streamableContentView']['update']({'part':_0x4e99c7,'renderingStrategy':_0x5c4776,'abortSignal':_0x342194});}['markAsDone'](){this['isDone']=!0x0;}}class z extends _0x428ca4(){['queue']=[];['isProcessing']=!0x1;['_abortController'];async['enqueue'](_0x118263){const _0x49d3cc=this['createTask'](_0x118263);return this['queue']['push'](_0x49d3cc),this['_processQueue'](),_0x49d3cc['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(_0x51f9dd=>{this['once']('_queueEmpty',()=>{_0x51f9dd();});}):Promise['resolve']();}async['_processQueue'](){if(!this['isProcessing']){this['_abortController']=new AbortController(),this['isProcessing']=!0x0;try{for(;this['queue']['length']&&this['isProcessing'];){const _0x514948=this['queue']['shift']();try{await _0x514948['callback'](this['_abortController']['signal']),_0x514948['resolve']();}catch(_0x28331e){_0x514948['reject'](_0x28331e);}}}finally{this['isProcessing']=!0x1,this['_abortController']=void 0x0;}this['fire']('_queueEmpty');}}['createTask'](_0x430426){let _0x19a5d0,_0x584f80;const _0x8442e0=new Promise((_0x142578,_0xc0116d)=>{_0x19a5d0=_0x142578,_0x584f80=_0xc0116d;});return{'callback':_0x430426,'resolve':_0x19a5d0,'reject':_0x584f80,'completePromise':_0x8442e0};}}class Ze extends Fr{constructor(_0x11b464){super(_0x11b464),this['extendTemplate']({'attributes':{'class':['ck-ai-notification','warning'===_0x11b464['level']?'ck-ai-notification_warning':'ck-ai-notification_error']}});}['render'](){super['render'](),this['setContent'](this['options']['initialContent']),this['markAsDone']();}['setContent'](_0x37931f){this['element']['innerHTML']=_0x37931f;}}const ot=['applySuggestion','insertSuggestion'];class ra extends _0x3ddefc{['_applyChangesButton'];['_insertSuggestionsButton'];['children'];constructor(_0x2ecf87,_0x47479e=[...ot],_0x43a1f3){super(_0x2ecf87);const _0xbc8517=this['bindTemplate'],_0x53c641=Boolean(_0x43a1f3);if(this['set']('isEnabled',!_0x53c641),this['set']('isVisible',!0x1),this['set']('isTrackChangesOn',!0x1),this['children']=this['createCollection'](),_0x53c641){const _0x2da816=new _0x4421de(_0x2ecf87);_0x2da816['set']({'label':i(_0x2ecf87,'AI_SUGGESTION_DISABLED_TOOLTIP_MESSAGE'),'tooltip':!0x0,'tooltipPosition':'n','withText':!0x1,'icon':_0x1eb394});const _0x2830c4=new _0x3ddefc(_0x2ecf87);_0x2830c4['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-chat__feed__suggestion__actions__info'},'children':[{'tag':'p','children':[i(_0x2ecf87,'AI_SUGGESTION_DISABLED_FEED_MESSAGE'),_0x2da816]}]}),this['children']['add'](_0x2830c4);}else this['_applyChangesButton']=new _0x4421de(_0x2ecf87),this['_applyChangesButton']['set']({'label':i(_0x2ecf87,'AI_CHAT_SUGGESTION_ACTION_APPLY_ALL'),'withText':!0x0,'type':'button','isVisible':_0x47479e['includes']('applySuggestion'),'class':'ck-ai-button-primary'}),this['_insertSuggestionsButton']=new _0x4421de(_0x2ecf87),this['_insertSuggestionsButton']['set']({'label':i(_0x2ecf87,'AI_CHAT_SUGGESTION_ACTION_SUGGEST_ALL'),'withText':!0x0,'type':'button','isVisible':_0x47479e['includes']('insertSuggestion'),'class':'ck-ai-button-secondary'}),this['_insertSuggestionsButton']['on']('execute',()=>{this['fire']('insertSuggestion');}),this['_applyChangesButton']['on']('execute',()=>{this['fire']('applySuggestion');}),[this['_applyChangesButton'],this['_insertSuggestionsButton']]['forEach'](_0x3dde09=>{_0x3dde09['bind']('isEnabled')['to'](this);}),this['children']['addMany']([this['_applyChangesButton'],this['_insertSuggestionsButton']]);this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__ai-suggestion__actions',_0xbc8517['if']('isVisible','ck-hidden',_0xd19fca=>!_0xd19fca)]},'children':this['children']}),this['on']('change:isTrackChangesOn',()=>{this['_applyChangesButton']&&(this['_applyChangesButton']['isVisible']=!this['isTrackChangesOn']);});}['updateVisibility'](_0x57e3e8){this['isVisible']=_0x57e3e8;}['_switchButtonLabelsPlurality'](_0x8cc1e8){this['_applyChangesButton']&&this['_insertSuggestionsButton']&&(_0x8cc1e8?(this['_applyChangesButton']['label']=i(this['locale'],'AI_CHAT_SUGGESTION_ACTION_APPLY_ALL'),this['_insertSuggestionsButton']['label']=i(this['locale'],'AI_CHAT_SUGGESTION_ACTION_SUGGEST_ALL')):(this['_applyChangesButton']['label']=i(this['locale'],'AI_CHAT_SUGGESTION_ACTION_APPLY'),this['_insertSuggestionsButton']['label']=i(this['locale'],'AI_CHAT_SUGGESTION_ACTION_SUGGEST')));}}class Sr extends _0x3ddefc{['children'];['balloonPanelView'];['bodyCollection'];constructor(_0x4bae29,_0x458957){super(_0x4bae29),this['bodyCollection']=_0x458957,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',_0x32b028=>!_0x32b028)]},'children':this['children']});const _0x1ea174=new _0x3ddefc(this['locale']),_0x1d6867=new _0x2fc344();_0x1d6867['content']=_0x103426,_0x1ea174['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-web-sources__header']},'children':[_0x1d6867,{'tag':'span','children':[{'text':i(this['locale'],'AI_CHAT_SOURCES_HEADER')}]}]}),this['children']['add'](_0x1ea174),this['_setupBalloonPanel'](_0x4bae29);}['addSource'](_0x59d194){this['children']['add'](new qr(this['locale'],_0x59d194,this['balloonPanelView']));}['_setupBalloonPanel'](_0xeaf02){this['balloonPanelView']=new _0x435ccf(_0xeaf02),this['balloonPanelView']['extendTemplate']({'attributes':{'class':['ck-ai-web-source__tooltip-balloon']}}),this['bodyCollection']['add'](this['balloonPanelView']);}}class qr extends _0x4421de{['balloonPanelView'];['source'];constructor(_0x50adbf,_0x335aaf,_0x46f7f3){super(_0x50adbf),this['source']=_0x335aaf,this['balloonPanelView']=_0x46f7f3,this['set']({'label':_0x335aaf['title'],'class':['ck\x20ck-ai-web-source'],'withText':!0x0});const _0x448ce3=this['bindTemplate'];if(this['extendTemplate']({'on':{'click':_0x448ce3['to'](()=>{window['open'](_0x335aaf['url'],'_blank');}),'mouseenter':_0x448ce3['to'](()=>{this['_showTooltip']();}),'mouseleave':_0x448ce3['to'](()=>{this['_hideTooltip']();})}}),_0x335aaf['favicon']){const _0x53c581=new _0x3ddefc(_0x50adbf);_0x53c581['setTemplate']({'tag':'img','attributes':{'src':_0x335aaf['favicon']||_0x103426,'alt':_0x335aaf['title'],'class':['ck-ai-web-source__image']}}),this['children']['add'](_0x53c581);}else this['set']('icon',_0x103426);}['_createTooltipContentView'](_0x45c1e3,_0x595989){const _0x272064=new _0x3ddefc(_0x45c1e3),_0x4417ae=[];let _0x349cc3;_0x595989?.['favicon']?(_0x349cc3=new _0x3ddefc(_0x45c1e3),_0x349cc3['setTemplate']({'tag':'img','attributes':{'src':_0x595989['favicon'],'alt':_0x595989['title'],'class':['ck-ai-web-source__tooltip-image']}})):(_0x349cc3=new _0x2fc344(),_0x349cc3['content']=_0x103426,_0x349cc3['extendTemplate']({'attributes':{'alt':_0x595989['title'],'class':['ck-ai-web-source__tooltip-image']}})),_0x4417ae['push'](_0x349cc3);const _0x133ff8=new _0x3ddefc(_0x45c1e3);_0x133ff8['setTemplate']({'tag':'a','attributes':{'class':['ck-ai-web-source__tooltip-url'],'href':_0x595989['url']},'children':[{'text':new URL(_0x595989['url'])?.['hostname']}]}),_0x4417ae['push'](_0x133ff8);const _0x2b71d3=new _0x3ddefc(_0x45c1e3);_0x2b71d3['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-web-source__tooltip-row']},'children':_0x4417ae});const _0x454e25=new _0x3ddefc(_0x45c1e3);return _0x454e25['setTemplate']({'tag':'span','attributes':{'class':['ck-ai-web-source__tooltip-row','ck-ai-web-source__tooltip-title']},'children':[{'text':_0x595989['title']['length']>0x190?_0x595989['title']['substring'](0x0,0x190)+'...':_0x595989['title']}]}),_0x272064['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-web-source__tooltip']},'children':[_0x2b71d3,_0x454e25]}),_0x272064;}['_showTooltip'](){this['_updateTooltipContent'](),this['balloonPanelView']['pin']({'target':this['element'],'positions':[_0x435ccf['defaultPositions']['northArrowSouth'],_0x435ccf['defaultPositions']['northArrowSouthWest'],_0x435ccf['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 _0x1e046e=this['_createTooltipContentView'](this['locale'],this['source']);this['balloonPanelView']['content']['add'](_0x1e046e);}}class ca extends _0x3ddefc{['_actionsView'];['_sourcesView'];['_children'];['_areActionsDisabled'];['_showUnchangedParts'];['_updateContentPartsPromiseQueue'];['_emptyPartsWarningView'];['_availableActions'];['_cachedContentParts']=[];constructor(_0x19f8c5,_0x11366e){super(_0x19f8c5);const {areActionsDisabled:_0x7dab88,showUnchangedParts:_0x14d2a7,availableActions:_0xb649b6}=_0x11366e;this['_areActionsDisabled']=_0x7dab88,this['_showUnchangedParts']=_0x14d2a7,this['_availableActions']=_0xb649b6,this['set']('hasPendingParts',!0x1),this['set']('isTrackChangesOn',!0x1),this['_children']=this['createCollection'](),this['_updateContentPartsPromiseQueue']=new z(),this['_emptyPartsWarningView']=new Ze({'id':'empty-parts-warning','initialContent':i(_0x19f8c5,'AI_SUGGESTION_EMPTY_PART_WARNING'),'level':'warning'}),this['_emptyPartsWarningView']['isVisible']=!0x1,this['_actionsView']=new ra(_0x19f8c5,_0x11366e['availableActions'],this['_areActionsDisabled']),this['_actionsView']['bind']('isTrackChangesOn')['to'](this),this['_sourcesView']=new Sr(this['locale'],_0x11366e['bodyCollection']),_0x11366e['areActionsDisabled']?this['_actionsView']['isEnabled']=!0x1:this['_actionsView']['bind']('isEnabled')['to'](this,'hasPendingParts'),this['_actionsView']['delegate'](...ut)['to'](this),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__body']},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__body__content-parts']},'children':this['_children']},this['_emptyPartsWarningView'],this['_actionsView'],this['_sourcesView']]});}get['partsCount'](){return this['_children']['length'];}async['updateContentParts']({parts:_0xc73a3f,renderingStrategy:_0x1b35f7,abortSignal:_0x26713a}){this['_children']['length']?_0xc73a3f['forEach'](_0x156bdf=>{const _0x220ebe=this['_cachedContentParts']['findIndex'](_0x3cbdef=>_0x3cbdef['index']==_0x156bdf['index']);-0x1===_0x220ebe?this['_cachedContentParts']['push'](_0x156bdf):this['_cachedContentParts'][_0x220ebe]=_0x156bdf;}):this['_cachedContentParts']=_0xc73a3f;const _0x1aeb87=this['_showUnchangedParts']?_0xc73a3f:_0xc73a3f['filter'](_0x5083c8=>_0x5083c8['hasChanges']);this['_actionsView']['_switchButtonLabelsPlurality'](_0x1aeb87['length']>0x1);for(const _0x127559 of _0x1aeb87)this['_updateContentPartsPromiseQueue']['enqueue'](async _0x49df14=>{let _0x387843=this['getPartView'](_0x127559['index']);_0x387843||(_0x387843=new na(this['locale'],{'part':_0x127559,'uiIndex':this['_children']['length']+0x1,'areActionsDisabled':this['_areActionsDisabled'],'availableActions':this['_availableActions']}),_0x387843['delegate'](...ut)['to'](this),this['_children']['add'](_0x387843),this['hasPendingParts']=!0x0),await _0x387843['updateContent']({'part':_0x127559,'renderingStrategy':_0x1b35f7,'showUnchangedParts':this['_showUnchangedParts'],'abortSignal':_0x49df14}),_0x387843['markAsDone']();});return _0x26713a?.['addEventListener']('abort',()=>{this['_updateContentPartsPromiseQueue']['abort']();}),this['_updateContentPartsPromiseQueue']['queueEmptyPromise'];}['updatePartState'](_0xc7e008,_0xc20799){const _0x76be4f=this['getPartView'](_0xc7e008);_0x76be4f&&(_0x76be4f['state']=_0xc20799),this['hasPendingParts']='pending'==_0xc20799||Array['from'](this['_children'])['some'](_0x22eae4=>'pending'==_0x22eae4['state']);}['setPartActive'](_0x5e9e6c,_0x4b20a3){if(!0x1===_0x5e9e6c){for(const _0x364495 of this['_children'])_0x364495['isActive']=!0x1;}else{const _0x5eb538=this['getPartView'](_0x5e9e6c);_0x5eb538&&(_0x5eb538['isActive']=_0x4b20a3);}}['updateSources'](_0x343b37){_0x343b37['forEach'](_0x283bea=>this['_sourcesView']['addSource'](_0x283bea)),this['_sourcesView']['isVisible']=!0x0;}['getPartView'](_0x4e9beb){return this['_children']['find'](_0x59b70b=>_0x59b70b['partDefinition']['index']==_0x4e9beb)??null;}['markAsDone'](){if(!this['_showUnchangedParts']){const _0x328643=!this['_cachedContentParts']['find'](({hasChanges:_0x312cb4})=>_0x312cb4),_0x463423=!!this['_cachedContentParts']['find'](({hasChanges:_0x1bd47b})=>!_0x1bd47b);this['_emptyPartsWarningView']['isVisible']=0x0==this['_children']['length']||_0x463423,_0x328643?this['_emptyPartsWarningView']['setContent'](i(this['locale'],'AI_SUGGESTION_NO_PARTS_WARNING')):this['_emptyPartsWarningView']['setContent'](i(this['locale'],'AI_SUGGESTION_EMPTY_PART_WARNING'));}this['_children']['forEach'](_0x24780b=>_0x24780b['markAsDone']()),this['_actionsView']['updateVisibility'](this['hasNonEmptyParts']);}get['hasNonEmptyParts'](){return this['_children']['filter'](_0x4ee006=>_0x4ee006['partDefinition']['hasChanges'])['length']>0x0;}}class gn extends _0x3ddefc{['bodyView'];['children'];['headerView'];constructor(_0x56b47d,_0x517906,_0x569098){super(_0x56b47d);const {showDiff:_0x16afab,areActionsDisabled:_0x1ca69e,showUnchangedParts:_0x237a92,availableActions:_0x476955}=_0x517906;this['set']('isTrackChangesOn',!0x1),this['set']('areChangesVisible',!0x1),this['children']=this['createCollection'](),this['headerView']=new oa(_0x56b47d,{'showDiff':_0x16afab}),this['headerView']['on']('toggleShowChanges',(_0x5a8289,_0x52db94)=>{this['areChangesVisible']=_0x52db94['isOn'],this['fire']('toggleSuggestionDisplayMode',{'showDiff':_0x52db94['isOn']});}),this['children']['add'](this['headerView']),this['bodyView']=new ca(_0x56b47d,{'areActionsDisabled':_0x1ca69e,'showUnchangedParts':!!_0x237a92,'availableActions':_0x476955,'bodyCollection':_0x569098}),this['bodyView']['delegate'](...ut)['to'](this),this['bodyView']['bind']('isTrackChangesOn')['to'](this),this['children']['add'](this['bodyView']),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__container','ck-rounded-corners']},'children':this['children']});}async['updateContent'](_0x476848){await this['bodyView']['updateContentParts'](_0x476848);}['updateSources'](_0x14aa53){this['bodyView']['updateSources'](_0x14aa53);}['markAsDone'](){this['bodyView']['markAsDone'](),this['headerView']&&(this['headerView']['isShowChangesToggleVisible']=this['bodyView']['hasNonEmptyParts']);}}class Qe extends Fr{['containerView'];constructor(_0x37fb10,_0x38db49,_0x437a09){super(_0x38db49),this['set']('isTrackChangesOn',!0x1),this['containerView']=new gn(_0x37fb10,{'showDiff':_0x38db49['showDiff'],'areActionsDisabled':_0x38db49['areActionsDisabled'],'availableActions':_0x38db49['availableActions']},_0x437a09),this['containerView']['on']('toggleSuggestionDisplayMode',(_0x5e09cd,_0x2a1169)=>{this['fire']('toggleSuggestionDisplayMode',{'replyId':this['options']['id'],'showDiff':_0x2a1169['showDiff']});}),this['containerView']['bind']('isTrackChangesOn')['to'](this),this['containerView']['on']('like',()=>{this['fire']('like',{'replyId':this['options']['id']});}),this['containerView']['on']('dislike',()=>{this['fire']('dislike',{'replyId':this['options']['id']});}),this['containerView']['on']('showChangeInText',(_0x1e8dc1,{index:_0x3139eb})=>{this['fire']('showChangeInText',{'replyId':this['options']['id'],'partIndex':_0x3139eb});}),this['containerView']['on']('applySuggestion',(_0x131b62,{index:_0x5ace94}={})=>{this['fire']('applySuggestion',{'replyId':this['options']['id'],'partIndex':_0x5ace94});}),this['containerView']['on']('insertSuggestion',(_0x452b9e,{index:_0x4484b7}={})=>{this['fire']('insertSuggestion',{'replyId':this['options']['id'],'partIndex':_0x4484b7});}),this['containerView']['on']('rejectSuggestion',(_0xcf5a,{index:_0x3b568a})=>{this['fire']('rejectSuggestion',{'replyId':this['options']['id'],'partIndex':_0x3b568a});}),this['containerView']['on']('mouseOverSuggestion',(_0xfe146f,{index:_0x2dfb4d})=>{this['fire']('mouseOverSuggestion',{'replyId':this['options']['id'],'partIndex':_0x2dfb4d});}),this['containerView']['on']('mouseLeaveSuggestion',(_0x2eefa2,{index:_0x58cbf})=>{this['fire']('mouseLeaveSuggestion',{'replyId':this['options']['id'],'partIndex':_0x58cbf});}),this['children']['addMany']([this['containerView']]),this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__ai-suggestion']}});}async['updateContent'](_0x5875b5){await this['containerView']['updateContent'](_0x5875b5);}['updatePartState'](_0x54455a,_0x254955){this['containerView']['bodyView']['updatePartState'](_0x54455a,_0x254955);}['setPartActive'](_0x25c97b,_0x229a6e){!0x1===_0x25c97b?this['containerView']['bodyView']['setPartActive'](!0x1):this['containerView']['bodyView']['setPartActive'](_0x25c97b,_0x229a6e);}['updateSources'](_0x5208b0){this['containerView']['updateSources'](_0x5208b0);}['getPartView'](_0x134f49){return this['containerView']['bodyView']['getPartView'](_0x134f49);}['markAsDone'](){super['markAsDone'](),this['containerView']['markAsDone']();}}class Xe extends Fr{['replyContainer'];['_bodyCollection'];constructor(_0x9d3e77,_0xd3c975,_0x333132){super(_0xd3c975),this['_bodyCollection']=_0x333132,this['locale']=_0x9d3e77,this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__ai-reply']}}),this['replyContainer']=new _0x3ddefc(),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':Wi(this['options']['initialContent']),'renderingStrategy':'static'}),this['markAsDone']());}async['updateContent']({parsedContent:_0x416b47,renderingStrategy:_0x11af06,abortSignal:_0x57dfa7}){'streaming'===_0x11af06?await this['streamIntoElement'](_0x416b47,this['replyContainer']['element'],_0x57dfa7):this['replyContainer']['element']['innerHTML']=_0xb61cdf(_0x416b47);}['updateSources'](_0x4537fb){const _0x52aeef=new Sr(this['locale'],this['_bodyCollection']);_0x52aeef['children']['addMany'](_0x4537fb['map'](_0x339f26=>new qr(this['locale'],_0x339f26,_0x52aeef['balloonPanelView']))),_0x52aeef['isVisible']=!0x0,this['children']['add'](_0x52aeef);}}class vi extends _0x52a320{constructor(_0x1e5885=void 0x0){super();const _0x368499=_0x1e5885?'ck-ai-spinner_'+_0x1e5885:'';this['extendTemplate']({'tag':'span','attributes':{'class':['ck-ai-spinner',_0x368499]}});}}const xn={'file':_0x5f22ac,'document':_0x13ab44,'web-resource':_0x4aa87f,'text':_0x5f22ac,'selection':_0x31b18a,'mcp-tool-context':_0x13ab44},qn='ck-ai-chat-context-chip',Qn='ck-ai-chat-context-chip_wide',Xn='ck-ai-chat-context-chip_document',zn='ck-ai-chat-context-chip__label',Jn='ck-ai-chat-context-chip__type-icon',Zn='ck-ai-chat-context-controls__chip-tooltip',Cn='n';class vo extends _0x4421de{constructor(_0x31c7a1,_0x33a69d,_0x1df45d,_0x334883,_0x19e882=!0x1){super(_0x31c7a1),this['_isAnimationOnEnterEnabled']=_0x334883,this['_initializeProperties'](_0x33a69d,_0x1df45d,_0x19e882),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'](_0xf0ee8b,_0x55e7c1,_0x25540e){this['set']('label',_0xf0ee8b['label']),this['set']('tooltip',!0x0),this['set']('itemType',_0xf0ee8b['type']),this['set']('id',_0xf0ee8b['uiId']),this['set']('readonly',_0x55e7c1),this['set']('isLoading',_0x25540e);}['_setupTemplate'](){const _0x28e955=this['_createIconView'](),_0x579185=this['_createRemoveButton'](),_0x227465=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':this['_createTemplateAttributes'](_0x227465),'children':this['_createTemplateChildren'](_0x28e955,_0x579185,_0x227465)});}['_createTemplateAttributes'](_0x5127d3){return{'class':[qn,_0x5127d3['if']('itemType',Xn,_0x1dc457=>'document'==_0x1dc457),_0x5127d3['if']('itemType',Qn,_0x149a9a=>'selection'==_0x149a9a)],'data-cke-tooltip-text':_0x5127d3['to']('label',In),'data-cke-tooltip-position':Cn,'data-cke-tooltip-class':Zn};}['_createTemplateChildren'](_0x347c79,_0x311427,_0x35291b){const _0x43560d=this['_createLabelElement'](_0x35291b),_0x51168b=this['_createLoaderIcon']();return this['readonly']?[_0x347c79,_0x43560d]:[_0x347c79,_0x51168b,_0x43560d,_0x311427];}['_createLabelElement'](_0x5d52da){return{'tag':'span','attributes':{'class':zn},'children':[{'text':_0x5d52da['to']('label')}]};}['_createRemoveButton'](){const _0x1acb40=new _0x4421de(this['locale']);return _0x1acb40['set']({'label':i(this['locale'],'AI_CHAT_CONTEXT_REMOVE_FROM_CONTEXT'),'icon':_0x598c1b}),this['_setupRemoveButtonEvent'](_0x1acb40),_0x1acb40;}['_setupRemoveButtonEvent'](_0x201559){_0x201559['on']('execute',()=>{this['fire']('removeContextItemChip',this['id']);});}['_createIconView'](){const _0x57befc=this['bindTemplate'],_0x5359a1=new _0x2fc344();return _0x5359a1['content']=xn[this['itemType']],_0x5359a1['extendTemplate']({'attributes':{'class':[Jn,_0x57befc['if']('isLoading','ck-hidden',_0x30f125=>_0x30f125)]}}),_0x5359a1;}['_handleAnimationEndOnce'](_0x4b51f1,_0x4d31f4){if(!_0x4b51f1)return;const _0x395379=()=>{_0x4d31f4(),_0x4b51f1['removeEventListener']('animationend',_0x395379),_0x4b51f1['removeEventListener']('webkitAnimationEnd',_0x395379);};_0x4b51f1['addEventListener']('animationend',_0x395379),_0x4b51f1['addEventListener']('webkitAnimationEnd',_0x395379);}['_createLoaderIcon'](){const _0x5bb4dc=new vi('small');return _0x5bb4dc['bind']('isVisible')['to'](this,'isLoading',_0x48e3b9=>_0x48e3b9),_0x5bb4dc;}}function In(_0x7529d1){if(!_0x7529d1)return _0x7529d1;if(_0x7529d1['length']<=0x78)return _0x7529d1;const _0x1a581b=_0x7529d1['slice'](0x0,0x78),_0x1f887b=_0x1a581b['lastIndexOf']('\x20');return(_0x1f887b>0x0?_0x1a581b['slice'](0x0,_0x1f887b):_0x1a581b)+'…';}const hn={'maxVisibleRows':0x2,'rowDetectionTolerance':0x5,'showMoreLabelPrefix':'+\x20','viewportOffset':{'top':0x64,'bottom':0xa}},an='300px';class Io{['_locale'];['_config'];['_visibleChips'];['_overflowChips'];['_showMoreButtonView']=null;['_showMoreBalloonPanelView']=null;['_containerElement']=null;['_bodyCollection'];['_parentView']=null;['_intersectionObserver']=null;['_pendingCalculation']=!0x1;constructor(_0x38d675,_0x4ebec2,_0xb300be,_0x16075e,_0x4881ae){this['_locale']=_0x38d675,this['_visibleChips']=_0x4ebec2,this['_config']={...hn,..._0xb300be,'cssClasses':{'controlsButton':'','calculationContainer':'ck-calculation-container',..._0xb300be['cssClasses']}},this['_overflowChips']=new _0x285958(),this['_bodyCollection']=_0x16075e,this['_parentView']=_0x4881ae||null;}['setContainerElement'](_0x5df7a9){this['_intersectionObserver']&&(this['_intersectionObserver']['disconnect'](),this['_intersectionObserver']=null),this['_containerElement']=_0x5df7a9,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 _0x801de3=[...this['_visibleChips'],...this['_overflowChips']],_0x30fdfb=this['_createCalculationContainer'](),_0x49c39=this['_calculateOverflowInContainer'](_0x30fdfb,_0x801de3),_0xb11e20=_0x30fdfb['_ancestorsToRestore'];_0xb11e20&&this['_restoreAncestorVisibility'](_0xb11e20),_0x30fdfb['remove'](),this['_applyOverflowResults'](_0x801de3,_0x49c39);}['_createShowMoreButton'](){this['_showMoreButtonView']=this['_createShowMoreButtonView'](),this['_showMoreBalloonPanelView']=this['_createShowMoreBalloonPanelView'](),this['_showMoreButtonView']['render'](),this['_containerElement']['appendChild'](this['_showMoreButtonView']['element']),this['_showMoreButtonView']['on']('execute',()=>{this['_handleShowMoreButtonClick']();}),_0xa9d580({'emitter':this['_showMoreBalloonPanelView'],'contextElements':[this['_showMoreBalloonPanelView']['element'],this['_showMoreButtonView']['element']],'callback':()=>this['hideBalloonPanel'](),'activator':()=>this['_showMoreButtonView']['isOn']});}['_createShowMoreButtonView'](){const _0x2a5ce6=new _0x4421de(this['_locale']);_0x2a5ce6['set']({'label':'','withText':!0x0,'isToggleable':!0x0});const _0x4fe76f=[this['_config']['cssClasses']['showMoreButton']];return this['_config']['cssClasses']['controlsButton']&&_0x4fe76f['push'](this['_config']['cssClasses']['controlsButton']),_0x2a5ce6['extendTemplate']({'attributes':{'class':_0x4fe76f}}),_0x2a5ce6;}['_createShowMoreBalloonPanelView'](){const _0x1ecde0=new _0x435ccf(this['_locale']);return _0x1ecde0['extendTemplate']({'attributes':{'class':this['_config']['cssClasses']['showMoreBalloon']}}),this['_bodyCollection']['add'](_0x1ecde0),_0x1ecde0;}['_updateBalloonContent'](){if(this['_showMoreBalloonPanelView']&&(this['_showMoreBalloonPanelView']['content']['clear'](),this['_overflowChips']['length']>0x0)){this['_overflowChips']['forEach'](_0x593bac=>{_0x593bac['disableAnimationOnEnter']();});const _0xb5ac0c=new _0x3ddefc(this['_locale']);_0xb5ac0c['setTemplate']({'tag':'div','attributes':{'class':this['_config']['cssClasses']['overflowContainer']},'children':this['_overflowChips']}),this['_showMoreBalloonPanelView']['content']['add'](_0xb5ac0c);}}['_handleShowMoreButtonClick'](){this['_showMoreButtonView']['isOn']?this['hideBalloonPanel']():this['showBalloonPanel']();}['_updateShowMoreButtonVisibility'](){const _0x306c88=this['_overflowChips']['length']>0x0;this['_showMoreButtonView']?.['element']&&(this['_showMoreButtonView']['element']['style']['display']=_0x306c88?'':'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'](_0x15fe86){const _0x122ef3=this['_containerElement']?.['tagName']['toLowerCase']()||'div',_0x2f04a8=this['_containerElement']?.['classList'];if(_0x2f04a8){const _0x385a1a=_0x2f04a8[0x0]||'',_0xc5e2cb=_0x15fe86['querySelector']('.'+_0x385a1a),_0x51fd34=_0x15fe86['querySelector'](_0x122ef3);return _0xc5e2cb||_0x51fd34||_0x15fe86;}return _0x15fe86['querySelector'](_0x122ef3)||_0x15fe86;}['_calculateContainerWidth'](){const _0xf26910=this['_parentView']?.['element']||this['_containerElement'];if(!_0xf26910)return an;const _0x57aa7b=window['getComputedStyle'](_0xf26910)['width'];if('auto'===_0x57aa7b||'0px'===_0x57aa7b||!_0x57aa7b){const _0x946f76=_0xf26910['parentElement'];if(_0x946f76){const _0x4d6e53=window['getComputedStyle'](_0x946f76);return'auto'!==_0x4d6e53['width']?_0x4d6e53['width']:an;}return an;}return _0x57aa7b;}['_applyCalculationStyles'](_0x105a05,_0x466c2c){this['_config']['cssClasses']['calculationContainer']&&_0x105a05['classList']['add'](this['_config']['cssClasses']['calculationContainer']),_0x105a05['style']['width']=_0x466c2c,_0x105a05['style']['position']='absolute',_0x105a05['style']['top']='-9999px',_0x105a05['style']['left']='-9999px',_0x105a05['style']['opacity']='0',_0x105a05['style']['pointerEvents']='none',_0x105a05['style']['zIndex']='-1',_0x105a05['style']['visibility']='visible\x20!important',_0x105a05['style']['display']='block\x20!important',_0x105a05['style']['boxSizing']='border-box';}['_restoreAncestorVisibility'](_0x59c388){_0x59c388['forEach'](({element:_0xb452a1,originalDisplay:_0x108baa,originalVisibility:_0x35df59})=>{_0xb452a1['style']['display']=_0x108baa,_0xb452a1['style']['visibility']=_0x35df59;});}['_makeAncestorsVisible'](_0x5eefa8){const _0x328fc7=[];let _0x2e41a4=_0x5eefa8;for(;_0x2e41a4&&_0x2e41a4!==document['body'];){const _0x1ec58c=window['getComputedStyle'](_0x2e41a4);'none'!==_0x1ec58c['display']&&'hidden'!==_0x1ec58c['visibility']||(_0x328fc7['push']({'element':_0x2e41a4,'originalDisplay':_0x2e41a4['style']['display'],'originalVisibility':_0x2e41a4['style']['visibility']}),_0x2e41a4['style']['display']='block',_0x2e41a4['style']['visibility']='visible'),_0x2e41a4=_0x2e41a4['parentElement'];}return _0x328fc7;}['_createContainerElements'](){let _0x359fa4,_0x4b69a8;return this['_parentView']?.['element']?(_0x359fa4=this['_parentView']['element']['cloneNode'](!0x0),_0x4b69a8=this['_findTargetContainer'](_0x359fa4)):(_0x359fa4=document['createElement']('div'),_0x4b69a8=_0x359fa4),{'calculationContainer':_0x359fa4,'targetContainer':_0x4b69a8};}['_createCalculationContainer'](){const {calculationContainer:_0x124154,targetContainer:_0x3d6223}=this['_createContainerElements'](),_0x1b9476=this['_calculateContainerWidth']();this['_applyCalculationStyles'](_0x124154,_0x1b9476);const _0x253497=this['_parentView']?.['element']||this['_containerElement'],_0x425a98=_0x253497?.['parentElement'];_0x425a98?_0x425a98['appendChild'](_0x124154):document['body']['appendChild'](_0x124154),_0x124154['_targetContainer']=_0x3d6223;const _0x9e8a2a=this['_makeAncestorsVisible'](_0x425a98||null);return _0x124154['offsetWidth'],_0x124154['_ancestorsToRestore']=_0x9e8a2a,_0x124154;}['_calculateOverflowInContainer'](_0x2bc1ae,_0x51a9ce){const _0x392d73=_0x2bc1ae['_targetContainer']||_0x2bc1ae,_0x24a07d=[],{rowCount:_0x5f2236}=this['_renderChipsAndCountRows'](_0x392d73,_0x51a9ce);if(_0x5f2236<=this['_config']['maxVisibleRows'])return _0x24a07d;const _0x3d9496=_0x51a9ce['slice']();for(;_0x3d9496['length']>0x0;){if(this['_testButtonFit'](_0x2bc1ae,_0x392d73,_0x3d9496)){const _0x247a4b=_0x51a9ce['filter'](_0x44100e=>!_0x3d9496['includes'](_0x44100e));_0x24a07d['push'](..._0x247a4b);break;}if(!_0x3d9496['pop']())break;}return _0x24a07d;}['_renderChipsAndCountRows'](_0x41b07d,_0x4cc0d4){_0x41b07d['innerHTML']='',_0x4cc0d4['forEach'](_0x26b6ee=>{if(_0x26b6ee['element']){const _0x4a4fbc=_0x26b6ee['element']['cloneNode'](!0x0);_0x41b07d['appendChild'](_0x4a4fbc);}}),_0x41b07d['offsetWidth'];const _0xaca657=_0x41b07d['children'],_0x51556a=[];return Array['from'](_0xaca657)['forEach'](_0xa018c=>{const _0x297c8b=_0xa018c['getBoundingClientRect']()['top'];_0x51556a['some'](_0x59e921=>Math['abs'](_0x59e921-_0x297c8b)<this['_config']['rowDetectionTolerance'])||_0x51556a['push'](_0x297c8b);}),{'rowCount':_0x51556a['length']};}['_createMockButton'](){const _0x40fda1=document['createElement']('button');return _0x40fda1['className']=this['_config']['cssClasses']['showMoreButton'],this['_config']['cssClasses']['controlsButton']&&_0x40fda1['classList']['add'](this['_config']['cssClasses']['controlsButton']),_0x40fda1['textContent']='+\x201',_0x40fda1;}['_testButtonFit'](_0x2b4a75,_0x4e9b73,_0x55a767){this['_renderChipsAndCountRows'](_0x4e9b73,_0x55a767);const _0x21f6a9=this['_createMockButton']();_0x2b4a75['appendChild'](_0x21f6a9),_0x2b4a75['offsetWidth'];const _0x18f7a0=[..._0x4e9b73['children'],_0x21f6a9],_0x3ae4f1=[];_0x18f7a0['forEach'](_0x46458=>{const _0x377a37=_0x46458['getBoundingClientRect']()['top'];_0x3ae4f1['some'](_0x5a9eb6=>Math['abs'](_0x5a9eb6-_0x377a37)<this['_config']['rowDetectionTolerance'])||_0x3ae4f1['push'](_0x377a37);});const _0x42f9f8=_0x3ae4f1['length'];return _0x21f6a9['remove'](),_0x42f9f8<=this['_config']['maxVisibleRows'];}['_distributeChips'](_0x46b0c7,_0xbcbae1){this['_visibleChips']['clear'](),this['_overflowChips']['clear'](),_0x46b0c7['forEach'](_0x466ac0=>{_0xbcbae1['includes'](_0x466ac0)?this['_overflowChips']['add'](_0x466ac0):this['_visibleChips']['add'](_0x466ac0);});}['_updateOverflowUI'](_0x4cdc2d){if(_0x4cdc2d>0x0&&!this['_showMoreButtonView']&&this['_createShowMoreButton'](),_0x4cdc2d>0x0&&this['_showMoreButtonView']){const _0x597cc4=''+this['_config']['showMoreLabelPrefix']+(_0x4cdc2d<0x63?_0x4cdc2d:'99');this['_showMoreButtonView']['label']=_0x597cc4;}this['_updateBalloonContent'](),this['_updateShowMoreButtonVisibility'](),this['_repinBalloonPanel']();}['_applyOverflowResults'](_0x12d5e3,_0x4cbf9c){this['_distributeChips'](_0x12d5e3,_0x4cbf9c),this['_updateOverflowUI'](_0x4cbf9c['length']);}['_setupVisibilityObserver'](){this['_containerElement']&&'undefined'!=typeof IntersectionObserver&&(this['_intersectionObserver']=new IntersectionObserver(_0x4b1fc7=>{_0x4b1fc7[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 _0x124464=this['_containerElement']['getBoundingClientRect']();if(0x0===_0x124464['width']||0x0===_0x124464['height'])return!0x1;const _0x35744f=window['innerHeight']||document['documentElement']['clientHeight'],_0x133a0e=window['innerWidth']||document['documentElement']['clientWidth'],_0x433689=0xc8;return _0x124464['bottom']>=-0xc8&&_0x124464['top']<=_0x35744f+_0x433689&&_0x124464['right']>=-0xc8&&_0x124464['left']<=_0x133a0e+_0x433689;}}const Or='ck-ai-chat__feed__context-chips',Nr='ck-ai-chat-context-chips-wrapper',Ur='ck-ai-chat-context-chips-wrapper-balloon',Wr='ck-ai-chat-controls-button',Yr='ck-ai-chat-controls_context_show-more-button',$r='ck-ai-chat-context-controls__show-more-balloon-panel';class _h extends _0x3ddefc{['_contextChips']=this['createCollection']();['_overflowManager'];['_bodyCollection'];constructor(_0x126046,_0x92ecbd,_0x25b606){super(_0x126046),this['_bodyCollection']=_0x25b606,this['_createContextChips'](_0x92ecbd);const _0x488e1b={'cssClasses':{'showMoreButton':Yr,'showMoreBalloon':$r,'overflowContainer':Ur,'controlsButton':Wr}};this['_overflowManager']=new Io(_0x126046,this['_contextChips'],_0x488e1b,this['_bodyCollection'],this),this['setTemplate']({'tag':'div','attributes':{'class':[Or,'ck','ck-reset_all']},'children':[{'tag':'div','attributes':{'class':Nr},'children':this['_contextChips']}]});}['render'](){super['render']();const _0x2745df=this['element']['querySelector']('.'+Nr);_0x2745df&&(this['_overflowManager']['setContainerElement'](_0x2745df),this['_overflowManager']['reorganizeChips']());}['destroy'](){super['destroy'](),this['_overflowManager']['destroy']();}['_createContextChips'](_0x59d852){for(const _0x59424b of _0x59d852){const _0x18f2ed=new vo(this['locale'],_0x59424b,!0x0,!0x1);this['_contextChips']['add'](_0x18f2ed);}}}class Ye extends Fr{['_contextChipsView']=null;['_locale'];['_bodyCollection'];['_messageContentView'];constructor(_0x2667ca,_0x3b72b3,_0x397c4a){super(_0x3b72b3),this['_locale']=_0x2667ca,this['_bodyCollection']=_0x397c4a,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'](_0x59190f=>!_0x59190f['hidden']),this['_bodyCollection']),this['_contextChipsView']['extendTemplate']({'attributes':{'class':'ck-ai-chat__feed__context-chips'}}),this['children']['add'](this['_contextChipsView']));}['_createMessageContentView'](){this['_messageContentView']=new _0x3ddefc(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 Mt extends Fr{['capabilities'];constructor(_0x19787d,_0x8ab04a){super(_0x8ab04a);const {isWebSearchEnabled:_0x388c40,isReasoningEnabled:_0x502775}=_0x8ab04a['capabilities'],_0x5cd92b=[];let _0x5b8952='';_0x388c40&&_0x502775?(_0x5b8952=i(_0x19787d,'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH_REASONING'),_0x5cd92b['push'](aa(_0x103426)),_0x5cd92b['push'](aa(_0x5a3f04))):_0x388c40?(_0x5b8952=i(_0x19787d,'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH'),_0x5cd92b['push'](aa(_0x103426))):_0x502775&&(_0x5b8952=i(_0x19787d,'AI_CHAT_FEED_REPLY_ITEM_USED_REASONING'),_0x5cd92b['push'](aa(_0x5a3f04))),this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__interaction-header',_0x5b8952?'':'ck-hidden']}});const _0x1a938f=new _0x3ddefc();_0x1a938f['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__interaction-header__capabilities']},'children':[..._0x5cd92b,{'tag':'span','attributes':{'class':['ck-ai-chat__feed__interaction-header__capabilities__text']},'children':[_0x5b8952]}]}),this['children']['add'](_0x1a938f),this['capabilities']=_0x8ab04a['capabilities'];}}function aa(_0x306eb2){const _0x1b88e0=new _0x2fc344();return _0x1b88e0['content']=_0x306eb2,_0x1b88e0;}const Fs=['wheel','touchstart','pointerdown','keydown'],Us=['ArrowUp','ArrowDown','PageUp','PageDown','Home','End','\x20'];class $e{['element'];['animationFrameId'];['isRunning'];['abortController'];['isUserPaused'];constructor(_0x2a4075){this['element']=_0x2a4075,this['animationFrameId']=null,this['isRunning']=!0x1,this['abortController']=new AbortController(),this['isUserPaused']=!0x1;for(const _0x21e03f of Fs){const _0x345630='keydown'!==_0x21e03f;this['element']['addEventListener'](_0x21e03f,this['_onUserEvent']['bind'](this),{'passive':_0x345630,'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'](_0x2f7785){if(this['isRunning']){if('keydown'===_0x2f7785['type']){const _0x586994=_0x2f7785['key'];if(!Us['includes'](_0x586994))return;}_0x2f7785 instanceof WheelEvent?_0x2f7785['deltaY']<0x0?this['isUserPaused']=!0x0:this['isUserPaused']=!this['_isAtBottom']():this['isUserPaused']=!0x0;}}['_isAtBottom'](){const {scrollTop:_0x1792e8,scrollHeight:_0x47b9b3,clientHeight:_0x1e2096}=this['element'];return _0x47b9b3-_0x1792e8-_0x1e2096<=0x5;}['_rafUpdate'](){this['isRunning']&&(this['isUserPaused']||this['element']['scrollTo']({'top':this['element']['scrollHeight'],'behavior':'auto'}),this['animationFrameId']=requestAnimationFrame(this['_rafUpdate']['bind'](this)));}}class di extends _0x3ddefc{constructor(_0x1c4dcb,_0x164fe1){super(_0x1c4dcb),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-skeleton']},'children':this['_createSkeletonItems'](_0x164fe1)});}['_createSkeletonItems'](_0xe54da2){const _0x300d23=['ck','ck-ai-skeleton__item'];return _0xe54da2['map'](_0x435cc8=>{let _0x59075f='';switch(_0x435cc8['attributes']['align']){case'right':_0x59075f='margin-left:\x20auto;\x20margin-right:\x200;\x20text-align:\x20right;';break;case'center':_0x59075f='margin-left:\x20auto;\x20margin-right:\x20auto;\x20text-align:\x20center;';break;case'left':_0x59075f='margin-left:\x200;\x20margin-right:\x20auto;\x20text-align:\x20left;';}return{'tag':_0x435cc8['tag'],'attributes':{'class':[..._0x300d23,_0x435cc8['attributes']['class']?_0x435cc8['attributes']['class']:''],'style':'width:\x20'+_0x435cc8['attributes']['width']+';\x20height:\x20'+_0x435cc8['attributes']['height']+';'+_0x59075f}};});}}const ki={'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(_0x473922,_0x1c26c4,_0x4352a9,_0x983f44){return new Array(_0x473922)['fill'](null)['map'](()=>({'tag':'div','attributes':{'width':_0x1c26c4,'height':_0x4352a9,'align':_0x983f44}}));}class Si extends Fr{constructor(_0x3fdd83){super(_0x3fdd83),this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__custom-element']}});}async['render'](){super['render'](),'string'==typeof this['options']['content']?this['element']['innerHTML']=this['options']['content']:this['element']['appendChild'](this['options']['content']);}}class ji extends _0x3ddefc{['children'];['scrollManager'];['_bodyCollection'];constructor(_0x40f3d5,_0x51648c){super(_0x40f3d5),this['_bodyCollection']=_0x51648c,this['set']('isPending',!0x1),this['set']('loadingMessage',''),this['set']('isLoadingSkeletonVisible',!0x1),this['set']('isTrackChangesOn',!0x1),this['children']=this['createCollection'](),this['children']['delegate'](...bt)['to'](this),this['_setupTemplate']();}['render'](){super['render'](),this['scrollManager']=new $e(this['element']);}['destroy'](){super['destroy'](),this['scrollManager']['destroy']();}['clear'](){this['children']['clear']();}['addItem'](_0xb63597,_0x150125){let _0x4b2fdd;return'ai-reply'===_0xb63597?_0x4b2fdd=new Xe(this['locale'],_0x150125,this['_bodyCollection']):'ai-suggestion-reply'===_0xb63597?(_0x4b2fdd=new Qe(this['locale'],_0x150125,this['_bodyCollection']),_0x4b2fdd['bind']('isTrackChangesOn')['to'](this)):_0x4b2fdd='user-message'===_0xb63597?new Ye(this['locale'],_0x150125,this['_bodyCollection']):'interaction-header'===_0xb63597?new Mt(this['locale'],_0x150125):'custom-element'===_0xb63597?new Si(_0x150125):new Ze(_0x150125),this['children']['add'](_0x4b2fdd),_0x4b2fdd;}async['updateReplyItem']({id:_0x4e1bbe,parsedContent:_0x5f4adb,renderingStrategy:_0x306db2,abortSignal:_0x5db553}){const _0x1df89a=this['getItemById'](_0x4e1bbe);if(!(_0x1df89a instanceof Xe))throw new _0x2ae61f('ai-chat-feed-view-item-not-a-reply-item',null,{'itemView':_0x1df89a,'id':_0x4e1bbe,'parsedContent':_0x5f4adb});await _0x1df89a['updateContent']({'parsedContent':_0x5f4adb,'renderingStrategy':_0x306db2,'abortSignal':_0x5db553});}async['updateWebSources'](_0x22326d,_0x34adf2){const _0x4dc736=this['getItemById'](_0x22326d);if(_0x4dc736 instanceof Qe)_0x4dc736['updateSources'](_0x34adf2);else{if(!(_0x4dc736 instanceof Xe))throw new _0x2ae61f('ai-chat-feed-view-item-not-a-suggestion-or-reply-item',null,{'itemView':_0x4dc736,'id':_0x22326d,'sources':_0x34adf2});_0x4dc736['updateSources'](_0x34adf2);}}async['updateSuggestionItem']({id:_0x37d656,parts:_0x369386,renderingStrategy:_0x1ec14c,abortSignal:_0x4d6513}){const _0x2ad9cb=this['getItemById'](_0x37d656);if(!(_0x2ad9cb instanceof Qe))throw new _0x2ae61f('ai-chat-feed-view-item-not-a-suggestion-item',null,{'itemView':_0x2ad9cb,'id':_0x37d656,'parts':_0x369386});await _0x2ad9cb['updateContent']({'parts':_0x369386,'renderingStrategy':_0x1ec14c,'abortSignal':_0x4d6513});}['updateSuggestionPartState']({id:_0x481a92,index:_0x18f462,state:_0x2600b4}){const _0xa47199=this['getItemById'](_0x481a92);if(!(_0xa47199 instanceof Qe))throw new _0x2ae61f('ai-chat-feed-view-item-not-a-suggestion-item',this,{'id':_0x481a92});_0xa47199['updatePartState'](_0x18f462,_0x2600b4);}['setSuggestionPartActive']({id:_0x10cb64,index:_0x18461d,isActive:_0x5e08af}){const _0x590b5c=this['getItemById'](_0x10cb64);if(!(_0x590b5c instanceof Qe))throw new _0x2ae61f('ai-chat-feed-view-item-not-a-suggestion-item',this,{'id':_0x10cb64});this['children']['filter'](_0x63c595=>_0x63c595 instanceof Qe)['forEach'](_0x16839f=>{_0x16839f['setPartActive'](!0x1);}),_0x590b5c['setPartActive'](_0x18461d,_0x5e08af);}['markItemAsDone'](_0x83d40f){this['getItemById'](_0x83d40f)['markAsDone']();}['getItemIds'](){return this['children']['map'](_0x3191b0=>_0x3191b0['options']['id']);}['removeItem'](_0x3e16ec){this['children']['remove'](this['getItemById'](_0x3e16ec));}['hasItem'](_0x702b5d){return!!this['children']['find'](_0x597542=>_0x597542['options']['id']['includes'](_0x702b5d));}['scrollToSuggestion'](_0x2ace8a,_0x303fb0){const _0xe0a61a=this['getItemById'](_0x2ace8a);if(!(_0xe0a61a instanceof Qe))return void _0x4bc23b('ck-ai-chat-feed-view-scroll-to-suggestion-invalid-item',{'replyId':_0x2ace8a,'partIndex':_0x303fb0});const _0x4eddcd=_0xe0a61a['getPartView'](_0x303fb0);_0x4eddcd?_0x3daeed(_0x4eddcd['element'],0x14,this['element']['parentElement'],!0x0,!0x0):_0x4bc23b('ck-ai-chat-feed-view-scroll-to-suggestion-part-view-not-found',{'replyId':_0x2ace8a,'partIndex':_0x303fb0});}['_setupTemplate'](){this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed']},'children':this['_createTemplateChildren']()});}['_createTemplateChildren'](){const _0x16b4cc=this['_createSkeletonLoader']();return[this['_createFeedItems'](),_0x16b4cc,this['_createFeedLoader']()];}['_createSkeletonLoader'](){const _0x5f41c9=new di(this['locale'],ki['aiFeed']);return _0x5f41c9['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isLoadingSkeletonVisible','ck-hidden',_0x59a699=>!_0x59a699)]}}),_0x5f41c9;}['_createFeedItems'](){const _0x4d05a3=new _0x3ddefc(this['locale']);return _0x4d05a3['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__items',this['bindTemplate']['if']('isLoadingSkeletonVisible','ck-hidden')]},'children':this['children']}),_0x4d05a3;}['_createFeedLoader'](){const _0x322a72=new _0x3ddefc(this['locale']);return _0x322a72['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__loader',this['bindTemplate']['if']('isPending','ck-hidden',_0x491661=>!_0x491661)]},'children':this['_createLoaderChildren']()}),_0x322a72;}['_createLoaderChildren'](){const _0x150eb8=new vi();return _0x150eb8['isVisible']=!0x0,[_0x150eb8,{'tag':'span','attributes':{'class':['ck','ck-ai-chat__loader-text']},'children':[{'text':this['bindTemplate']['to']('loadingMessage')}]}];}['getItemById'](_0xa81e92){const _0x31d1a8=this['children']['find'](_0x407cb9=>_0x407cb9['options']['id']['includes'](_0xa81e92));if(!_0x31d1a8)throw new _0x2ae61f('ai-chat-feed-view-item-not-found',this,{'id':_0xa81e92});return _0x31d1a8;}['setLoadingMessage'](_0x1ca60b){this['set']('loadingMessage',_0x1ca60b);}['toggleLoadingSkeleton'](_0x17644c){this['set']('isLoadingSkeletonVisible',_0x17644c);}['startAutoScroll'](){this['scrollManager']['start']();}['stopAutoScroll'](){this['scrollManager']['stop']();}}class nh extends _0x4bb2ce{['filter'](){let _0x286416=0x0;for(const _0x3ed4b8 of this['items'])_0x286416+=_0x3ed4b8['items']['length'];return{'resultsCount':_0x286416,'totalItemsCount':_0x286416};}}const ah='ck-ai-chat__prompt-input_highlighted';class os extends _0x49b978{['submitButtonView'];static ['MIN_ROWS']=0x1;static ['MAX_ROWS']=0xc;['_addContextButtonView'];['_queryViewResizeObserver'];constructor(_0x17b4c9,_0x5bd73a){super(_0x17b4c9,{'queryView':{'label':'','creator':_0x4f1919,'showIcon':!0x1,'showResetButton':!0x1},'filteredView':new nh(_0x17b4c9),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1}),this['set']('isEmpty',!0x0),this['set']('isUploadInProgress',!0x1),this['_addContextButtonView']=_0x5bd73a,this['_queryViewResizeObserver']=null,this['queryView']['fieldView']['minRows']=os['MIN_ROWS'],this['queryView']['fieldView']['maxRows']=os['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',(_0xe5344,_0x371e30)=>!_0xe5344&&!_0x371e30),this['focusableChildren']['add'](this['submitButtonView']);}['render'](){super['render'](),this['queryView']['fieldWrapperChildren']['add'](this['submitButtonView']),this['keystrokes']['set']('enter',(_0x155eda,_0x281de4)=>{this['isUploadInProgress']||this['isEmpty']||_0x155eda['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0x281de4());}),this['queryView']['fieldView']['on']('update',()=>{this['isEmpty']=''===this['queryView']['fieldView']['element']['value']?.['trim']();});}['destroy'](){super['destroy'](),this['_queryViewResizeObserver']&&this['_queryViewResizeObserver']['destroy']();}['submit'](){const _0x370c52=this['queryView']['fieldView']['element']['value']?.['trim']();if(!_0x370c52)return this['queryView']['errorText']=i(this['locale'],'AI_CHAT_PROMPT_EMPTY_ERROR'),void(this['queryView']['fieldView']['hasError']=!0x0);this['queryView']['fieldView']['hasError']=!0x1;const _0x11f291=_0x2fa641(_0x370c52);this['fire']('sendUserMessage',_0x11f291),this['queryView']['fieldView']['reset']();}['setPlaceholderText'](_0x37fbce){this['queryView']['fieldView']['set']('placeholder',_0x37fbce);}['focus'](_0x199084=!0x1){super['focus'](),_0x199084&&(this['element']['classList']['contains'](ah)||(this['element']['classList']['add'](ah),setTimeout(()=>{this['element']['classList']['remove'](ah);},0x320)));}['_createSubmitButton'](){const _0x4fc654=new _0x4421de(this['locale']);return _0x4fc654['set']({'icon':_0x470f9c,'label':i(this['locale'],'AI_CHAT_LABEL_SUBMIT'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-chat__prompt-submit-button','isEnabled':!0x1}),_0x4fc654['on']('execute',()=>{this['submit']();}),_0x4fc654;}['setIsUploadInProgress'](_0x2a9b74){this['isUploadInProgress']=_0x2a9b74;}['_setUpAddContextButtonPositioning'](){const _0x46106a=this['locale'],_0x40c357=()=>{_0x18348f['window']['requestAnimationFrame'](()=>{if(_0x215009(this['element'])){const _0x296559=new _0x4fa19a(this['queryView']['fieldView']['element']),_0x64344c=new _0x4fa19a(this['_addContextButtonView']['element']),_0x4eb851=_0x296559['width'],_0xd837f4='rtl'===_0x46106a['uiLanguageDirection']?'right':'left';_0x296559['excludeScrollbarsAndBorders']();const _0x296b86=_0x4eb851-_0x296559['width']+0x1;this['_addContextButtonView']['element']['style'][_0xd837f4]='calc('+(_0x4eb851-_0x64344c['width']-_0x296b86)+'px\x20-\x20var(--ck-spacing-tiny))';}});};this['queryView']['fieldView']['on']('update',_0x40c357),this['on']('render',()=>{_0x40c357(),this['_queryViewResizeObserver']=new _0x129579(this['queryView']['fieldView']['element'],()=>{_0x40c357();});});}}const Qr='ck-ai-chat__prompt-capabilities',Xr='ck-ai-chat-controls-button',Zr='ck-ai-chat-controls-button--commands',la='ck-ai-button-tertiary',ua='ck-ai-chat-controls__model-selection',da='ck-ai-chat-controls__model-selection__item-name',_a='ck-ai-chat-controls__model-selection__item-description',Aa='ck-ai-chat-controls__model-selection__item-capabilities',Ia='n';class cs extends _0x3ddefc{['_webSearchButton'];['_reasoningButton'];['_commandsButton'];['_modelSelectionDropdown'];['_modelSelectionDropdownItems'];['_modelNameView'];constructor(_0x175c2c){super(_0x175c2c),this['set']('webSearchActive',!0x1),this['set']('reasoningActive',!0x1),this['set']('modelDisplayMode','selector'),this['set']('modelSelectorEnabled',!0x0),this['set']('activeModelId',null),this['set']('activeModelName',null),this['_modelSelectionDropdown']=this['_createModelSelectionDropdown'](),this['_modelNameView']=this['_createModelNameView'](),this['_webSearchButton']=this['_createWebSearchButton'](),this['_reasoningButton']=this['_createReasoningButton'](),this['_commandsButton']=this['_createCommandsButton'](),this['_modelSelectionDropdown']['buttonView']['bind']('isVisible')['to'](this,'modelDisplayMode',_0xd100bc=>'selector'===_0xd100bc),this['_modelSelectionDropdown']['buttonView']['bind']('tooltip')['to'](this,'modelSelectorEnabled',_0x2d2845=>_0x2d2845?this['_modelSelectionDropdown']['buttonView']['label']:i(this['locale'],'AI_CHAT_MODEL_SELECTOR_DISABLED_TOOLTIP')),this['_modelSelectionDropdown']['bind']('isEnabled')['to'](this,'modelSelectorEnabled',_0x4d0164=>_0x4d0164),this['_webSearchButton']['bind']('isOn')['to'](this,'webSearchActive',_0x6ebd2b=>_0x6ebd2b),this['_webSearchButton']['bind']('tooltip')['to'](this,'webSearchActive',_0x1b3bbf=>i(this['locale'],_0x1b3bbf?'AI_CHAT_DISABLE_WEB_SEARCH':'AI_CHAT_ENABLE_WEB_SEARCH')),this['_reasoningButton']['bind']('isOn')['to'](this,'reasoningActive',_0x1dc2f7=>_0x1dc2f7),this['_reasoningButton']['bind']('tooltip')['to'](this,'reasoningActive',_0x556e70=>i(this['locale'],_0x556e70?'AI_CHAT_DISABLE_REASONING':'AI_CHAT_ENABLE_REASONING')),this['setTemplate']({'tag':'div','attributes':{'class':[Qr]},'children':[this['_modelSelectionDropdown'],this['_modelNameView'],this['_webSearchButton'],this['_reasoningButton'],this['_commandsButton']]}),this['_modelSelectionDropdownItems']=new _0x285958(),_0x590b3b(this['_modelSelectionDropdown'],this['_modelSelectionDropdownItems']);}['setModelList'](_0x942f93,_0x115ead){if(_0x115ead)this['set']('modelDisplayMode','hidden');else{const _0x275838=0x1===_0x942f93['length'];this['set']('modelDisplayMode',_0x275838?'name':'selector');}if(this['_modelSelectionDropdownItems']['clear'](),_0x942f93?.['length'])for(const _0x4d5efc of _0x942f93){const _0xbf5caa=new _0xc76b09({'label':_0x4d5efc['name'],'withText':!0x0,'role':'menuitemradio','id':_0x4d5efc['id'],'model':_0x4d5efc});_0xbf5caa['bind']('isOn')['to'](this,'activeModelId',_0x1c802f=>_0x1c802f===_0x4d5efc['id']),this['_modelSelectionDropdownItems']['add']({'type':'button','model':_0xbf5caa,'labelView':new ga(this['locale'],_0x4d5efc)});}}['setWebSearch'](_0x7c64f6){this['set']('webSearchActive',_0x7c64f6);}['setReasoning'](_0x691305){this['set']('reasoningActive',_0x691305);}['setModel'](_0x28ecd8){if(!_0x28ecd8)return;this['activeModelId']=_0x28ecd8['id'],this['activeModelName']=_0x28ecd8['name']||_0x28ecd8['id'],this['_modelSelectionDropdown']['buttonView']['set']('label',_0x28ecd8['name']),this['_modelSelectionDropdown']['buttonView']['set']('tooltip',_0x28ecd8['name']);const _0x2ef45f=_0x28ecd8['capabilities']['webSearch']?.['enabled']??!0x1;this['set']('webSearchActive',!0x1),this['_webSearchButton']['set']('isOn',!0x1),this['_webSearchButton']['set']('isEnabled',_0x2ef45f),this['_webSearchButton']['set']('isVisible',_0x2ef45f);const _0x38ff3f=_0x28ecd8['capabilities']['reasoning']?.['enabled']??!0x1;this['set']('reasoningActive',!0x1),this['_reasoningButton']['set']('isOn',!0x1),this['_reasoningButton']['set']('isEnabled',_0x38ff3f),this['_reasoningButton']['set']('isVisible',_0x38ff3f);}['enableModelSelector'](){this['set']('modelSelectorEnabled',!0x0);}['disableModelSelector'](_0x122a39){this['set']('modelSelectorEnabled',!0x1),_0x122a39&&this['set']('modelDisplayMode','hidden');}['_createWebSearchButton'](){const _0x2fdc0a=new _0x4421de();return _0x2fdc0a['set']({'label':i(this['locale'],'AI_CHAT_SEARCH_WEB'),'icon':_0x103426,'class':Xr,'isToggleable':!0x0,'tooltipPosition':Ia}),_0x2fdc0a['on']('execute',()=>{this['fire']('toggleWebSearch');}),_0x2fdc0a;}['_createReasoningButton'](){const _0x578a73=new _0x4421de();return _0x578a73['set']({'label':i(this['locale'],'AI_CHAT_REASONING'),'icon':_0x5a3f04,'class':Xr,'isToggleable':!0x0,'tooltipPosition':Ia}),_0x578a73['on']('execute',()=>{this['fire']('toggleReasoning');}),_0x578a73;}['_createCommandsButton'](){const _0x3367b0=new _0x4421de();return _0x3367b0['set']({'label':i(this['locale'],'AI_CHAT_COMMANDS'),'icon':_0x591aa5,'withText':!0x0,'class':Xr,'isToggleable':!0x0,'tooltip':i(this['locale'],'AI_CHAT_COMMANDS'),'tooltipPosition':Ia}),_0x3367b0['extendTemplate']({'attributes':{'class':[Zr]}}),_0x3367b0['on']('execute',()=>{console['log']('Commands\x20are\x20not\x20implemented\x20yet.'),alert('Commands\x20are\x20not\x20implemented\x20yet.');}),_0x3367b0;}['_createModelSelectionDropdown'](){const _0x2d230f=_0x336a05(this['locale']);return _0x2d230f['set']({'panelPosition':'ne','class':[ua]}),_0x2d230f['buttonView']['set']({'label':i(this['locale'],'AI_CHAT_MODEL_SELECTOR_ENABLED_TOOLTIP'),'withText':!0x0,'tooltip':!0x0,'tooltipPosition':Ia,'class':la}),this['listenTo'](_0x2d230f,'execute',_0x3fef8f=>{this['fire']('selectModel',_0x3fef8f['source']['model']);}),_0x2d230f;}['_createModelNameView'](){const _0x2113fc=new Ca(this['locale']);return _0x2113fc['bind']('text')['to'](this,'activeModelName',_0x5d0af4=>_0x5d0af4??''),_0x2113fc['bind']('isVisible')['to'](this,'modelDisplayMode',_0x129f9f=>'name'===_0x129f9f),_0x2113fc;}}let ga=class ModelButtonLabelView extends _0x481114{constructor(_0x1f97e8,_0x170d81){super();const _0x1c95a9=this['bindTemplate'],_0x3e45ee=this['createCollection']();this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-button__label'],'style':_0x1c95a9['to']('style'),'id':_0x1c95a9['to']('id')},'children':[{'tag':'div','attributes':{'class':[da]},'children':[{'text':_0x1c95a9['to']('text')}]},{'tag':'div','attributes':{'class':[_a]},'children':[{'tag':'span','children':[{'text':_0x170d81['description']}]}]},{'tag':'div','attributes':{'class':[Aa]},'children':_0x3e45ee}]}),_0x3e45ee['addMany'](this['_getCapabilityParts'](_0x1f97e8,_0x103426,'AI_CHAT_SEARCH_WEB',_0x170d81['capabilities']['webSearch']?.['enabled']??!0x1)),_0x3e45ee['addMany'](this['_getCapabilityParts'](_0x1f97e8,_0x5a3f04,'AI_CHAT_REASONING',_0x170d81['capabilities']['reasoning']?.['enabled']??!0x1));}['_getCapabilityParts'](_0x1893c8,_0x85131,_0x242e19,_0x48dba3){const _0x8e996=new _0x2fc344();_0x8e996['content']=_0x85131;const _0x39d0ce=new _0x3ddefc(_0x1893c8);_0x39d0ce['setTemplate']({'tag':'span','children':[{'text':i(_0x1893c8,_0x242e19)+':\x20'}]});const _0x2da21e=new _0x3ddefc(_0x1893c8);return _0x2da21e['setTemplate']({'tag':'span','children':[{'text':i(_0x1893c8,_0x48dba3?'AI_CHAT_CAPABILITIES_YES':'AI_CHAT_CAPABILITIES_NO')}]}),[_0x8e996,_0x39d0ce,_0x2da21e];}},Ca=class ModelNameView extends _0x3ddefc{constructor(_0x47be40){super(_0x47be40),this['set']('text',void 0x0),this['set']('isVisible',!0x0);const _0x1b50ac=this['bindTemplate'];this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-chat-controls__model-name',_0x1b50ac['if']('isVisible','ck-hidden',_0x44e7c2=>!_0x44e7c2)]},'children':[{'text':_0x1b50ac['to']('text')}]});}};const Ea='ck-ai-chat-context-controls__url-form',pa='ck-ai-chat-context-controls__url-input-section';class Vo extends _0x3ddefc{['focusTracker'];['keystrokes'];['_focusables'];['focusCycler'];['urlInputField'];['backButton'];['confirmButton'];constructor(_0x19d44a){super(_0x19d44a),this['focusTracker']=new _0x5675ac(),this['keystrokes']=new _0x51df97(),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 _0x125535({'focusables':this['_focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes'],'actions':{'focusPrevious':'shift+tab','focusNext':'tab'}}),this['set']('withBackButton',!0x0),this['_setupTemplate'](),this['_setupEventHandlers'](),this['_setupKeystrokes']();}['render'](){super['render'](),this['_focusables']['forEach'](_0x269431=>{this['focusTracker']['add'](_0x269431['element']),this['keystrokes']['listenTo'](_0x269431['element']);}),_0x4d7d6f({'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'](_0x1d5f54){this['urlInputField']['errorText']=_0x1d5f54,this['_updateConfirmButtonState'](),this['fire']('refreshBalloon');}['clearError'](){this['urlInputField']['errorText']=null,this['_updateConfirmButtonState']();}['_createBackButton'](){const _0x47b4c5=new _0x4421de(this['locale']);return _0x47b4c5['set']({'icon':_0x135ef3,'tooltip':i(this['locale'],'AI_CHAT_CONTEXT_URL_BACK_TO_CONTEXT'),'tooltipPosition':'n','class':['ck-button-icon\x20ck-button-back']}),this['on']('change:withBackButton',(_0x924272,_0x3f839b,_0x511ea3)=>{_0x47b4c5['set']({'class':['ck-button-icon\x20ck-button-back'+(_0x511ea3?'':'\x20ck-hidden')]});}),_0x47b4c5;}['_createUrlInputField'](){const _0x2ebf43=new _0x7014be(this['locale'],th);return _0x2ebf43['set']({'label':i(this['locale'],'AI_CHAT_CONTEXT_URL_LABEL'),'class':'ck-labeled-field-view_empty'}),_0x2ebf43['fieldView']['set']({'placeholder':i(this['locale'],'AI_CHAT_CONTEXT_URL_PLACEHOLDER')}),_0x2ebf43;}['_createConfirmButton'](){const _0x23b9d4=new _0x4421de(this['locale']);return _0x23b9d4['set']({'icon':_0x4b7da9,'tooltip':i(this['locale'],'AI_CHAT_CONTEXT_URL_ADD_URL'),'tooltipPosition':'n','class':'ck-button-icon','type':'submit','isEnabled':!0x1}),_0x23b9d4;}['_setupTemplate'](){const _0x4848bb=new _0xa16c5(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'});_0x4848bb['children']['add'](this['backButton'],0x0),this['setTemplate']({'tag':'form','attributes':{'class':Ea,'tabindex':'-1'},'children':[_0x4848bb,{'tag':'div','attributes':{'class':pa},'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',_0x489492=>{_0x489492['stop'](),this['_handleSubmit']();});}['_setupKeystrokes'](){this['keystrokes']['set']('esc',(_0x218d1a,_0x39a1be)=>{this['clear'](),this['fire']('cancel'),_0x39a1be();});}['_handleSubmit'](){const _0x78af4f=this['getValue']()['trim']();_0x78af4f?this['_isValidUrl'](_0x78af4f)?(this['clearError'](),this['fire']('submitUrl',_0x78af4f)):this['setError'](i(this['locale'],'AI_CHAT_CONTEXT_URL_INVALID_ERROR')):this['setError'](i(this['locale'],'AI_CHAT_CONTEXT_URL_EMPTY_ERROR'));}['_updateConfirmButtonState'](){const _0x449191=this['getValue']()['trim'](),_0x1d0b96=!!this['urlInputField']['errorText'];this['confirmButton']['isEnabled']=_0x449191['length']>0x0&&!_0x1d0b96;}['_isValidUrl'](_0x48ea91){try{return!!new URL(_0x48ea91);}catch{return!0x1;}}}const Ta='ck-ai-chat-resources__item',ma='ck-ai-chat-resources__item--in-context',wa='ck-ai-chat-resources__item-title',fa='ck-ai-chat-resources__item__icon';class hc extends _0x23b8c1{['resource'];['_titleView'];['_iconView'];constructor(_0x75c064,_0x511ad5){super(_0x75c064),this['resource']=_0x511ad5,this['set']('isInContext',!!_0x511ad5['isInContext']),this['_titleView']=this['_createTitleView'](),this['_iconView']=this['_createIconView'](),this['_setupTemplate']();}['render'](){super['render']();}['getResourceIcon'](_0x5dacf3){if(_0x5dacf3['isInContext'])return _0x4b7da9;switch(_0x5dacf3['type']){case qe['DOCUMENT']:return _0x13ab44;case qe['URL']:return _0x4aa87f;case qe['FILE']:case qe['TEXT']:return _0x5f22ac;default:return _0x4dcc38;}}['highlightText'](_0x419512){if(!_0x419512||''===_0x419512['trim']())return void this['_titleView']['highlightText'](null);const _0x1975d1=new RegExp(_0x518f64(_0x419512),'gi');this['_titleView']['highlightText'](_0x1975d1);}['updateResourceState'](_0x26bac7){this['resource']['isInContext']=_0x26bac7,this['isInContext']=_0x26bac7,this['_updateIcon']();}['_createTitleView'](){const _0x58173b=new _0x5bd3a5();return _0x58173b['text']=this['resource']['label'],_0x58173b['extendTemplate']({'tag':'span','attributes':{'class':[wa]}}),_0x58173b;}['_createIconView'](){const _0x431da0=new _0x2fc344();return _0x431da0['content']=this['getResourceIcon'](this['resource']),_0x431da0;}['_setupTemplate'](){const _0x6cd77a=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':[Ta,_0x6cd77a['if']('isVisible','ck-hidden',_0x5d339c=>!_0x5d339c),_0x6cd77a['if']('isInContext',ma)]},'children':[{'tag':'div','attributes':{'class':[fa]},'children':[this['_iconView']]},this['_titleView']],'on':{'click':_0x6cd77a['to']('execute')}});}['_updateIcon'](){this['_iconView']['content']=this['getResourceIcon'](this['resource']);}}const Sa='ck-ai-chat-resources__list';class Lr extends _0x4bb2ce{['_source'];constructor(_0x52efa7,_0x47f7b6){super(_0x52efa7),this['_source']=_0x47f7b6,this['extendTemplate']({'attributes':{'class':[Sa]}});}['setResources'](_0xe89106,_0x50ca38){this['items']['clear']();let _0x5d491d=_0xe89106;if(this['_source']['useDefaultFiltering']&&_0x50ca38&&''!==_0x50ca38['trim']()){const _0x49913a=new RegExp(_0x50ca38['replace'](/[.*+?^${}()|[\]\\]/g,'\x5c$&'),'gi');_0x5d491d=_0xe89106['filter'](_0x25c917=>_0x49913a['test'](_0x25c917['label']));}for(const _0x1c1281 of _0x5d491d){const _0x413259=new hc(this['locale'],_0x1c1281);_0x413259['on']('execute',()=>{this['_handleResourceSelection'](this['_source'],_0x1c1281);}),this['items']['add'](_0x413259);}this['_source']['useDefaultFiltering']&&this['highlightText'](_0x50ca38);}['highlightText'](_0x42ce53){this['_source']['useDefaultFiltering']&&this['items']['forEach'](_0x1b2dd6=>{_0x1b2dd6['highlightText'](_0x42ce53);});}['updateResourceState'](_0x2214bf,_0xc303d7){for(const _0x51d2bd of this['items']){const _0x455705=_0x51d2bd;_0x455705['resource']['id']===_0x2214bf&&_0x455705['updateResourceState'](_0xc303d7);}}['_handleResourceSelection'](_0x4c1cca,_0x564111){this['fire']('addResourceToContext',{'source':_0x4c1cca,'resource':_0x564111});}}class Tr extends _0x7014be{['iconView'];['resetButtonView'];['_viewConfig'];constructor(_0x2b7586){const t=_0x2b7586['t'],_0x5a4565={'showResetButton':!0x0,'showIcon':!0x0,'creator':th,'label':i(_0x2b7586,'AI_CHAT_SEARCH_RESOURCES')};super(_0x2b7586,_0x5a4565['creator']),this['label']=_0x5a4565['label'],this['_viewConfig']=_0x5a4565,this['_viewConfig']['showIcon']&&this['_setupSearchIcon'](),this['_viewConfig']['showResetButton']&&this['_setupResetButton'](_0x2b7586,t),this['_setupEventListeners']();}['reset'](){this['fieldView']['reset'](),this['_viewConfig']['showResetButton']&&this['resetButtonView']&&(this['resetButtonView']['isVisible']=!0x1),this['search']('');}['search'](_0x2eeeb9){this['fire']('search',_0x2eeeb9);}['getQuery'](){return this['fieldView']['element']?.['value']||'';}['_setupSearchIcon'](){this['iconView']=new _0x2fc344(),this['iconView']['content']=_0x30e34c,this['fieldWrapperChildren']['add'](this['iconView'],0x0),this['extendTemplate']({'attributes':{'class':'ck-search__query_with-icon'}});}['_setupResetButton'](_0x278726,t){this['resetButtonView']=new _0x4421de(_0x278726),this['resetButtonView']['set']({'label':t('Clear'),'icon':_0x3cff34,'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',_0x26fd07=>!_0x26fd07),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 lc extends _0x3ddefc{['_searchView'];['_searchSection'];['_searchInputVisibleFrom'];['_resourcesListView'];['_skeletonLoader'];['_source'];['children'];['_latestLoadResourcesUid']=null;constructor(_0x48a622,_0x14cfc2){super(_0x48a622),this['_source']=_0x14cfc2['source'],this['_searchInputVisibleFrom']=_0x14cfc2['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 _0xdb22e9([this['_skeletonLoader'],this['_resourcesListView']]),this['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-chat-resources'},'children':this['children']});}['_createSearchView'](){return new Tr(this['locale']);}['_createSearchSection'](){const _0x37b327=new _0x3ddefc(this['locale']);return _0x37b327['setTemplate']({'tag':'div','attributes':{'class':'ck\x20ck-search'},'children':[this['_searchView']]}),this['_searchView']['on']('search',(_0x1e6982,_0x109780)=>{this['loadResources'](_0x109780),this['_source']['useDefaultFiltering']&&this['_resourcesListView']['highlightText'](_0x109780);}),_0x37b327;}['_createResourcesListView'](){const _0x3d8059=new Lr(this['locale'],this['_source']);return _0x3d8059['delegate']('addResourceToContext')['to'](this),_0x3d8059['extendTemplate']({'attributes':{'class':this['bindTemplate']['if']('isLoading','ck-hidden')}}),_0x3d8059;}['_createSkeletonView'](){const _0x41c58a=new di(this['locale'],ki['aiChatResources']);return _0x41c58a['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isLoading','ck-hidden',_0x4b11d3=>!_0x4b11d3)]}}),_0x41c58a;}['render'](){super['render'](),this['loadResources']('');}['loadResources'](_0xb38c42){const _0x44bfdd=_0x56075e();this['_latestLoadResourcesUid']=_0x44bfdd,this['fire']('loadSourceResources',{'sourceId':this['_source']['id'],'query':_0xb38c42,'uid':_0x44bfdd}),this['isLoading']=!0x0;}['setResources'](_0x5582d1,_0x3f8a13){if(_0x3f8a13&&_0x3f8a13!==this['_latestLoadResourcesUid'])return;const _0x99574a=this['_source']['useDefaultFiltering']?this['_searchView']['getQuery']():'';this['_resourcesListView']['setResources'](_0x5582d1,_0x99574a),_0x5582d1['length']>=this['_searchInputVisibleFrom']&&!this['children']['has'](this['_searchSection'])&&this['children']['add'](this['_searchSection'],0x0),requestAnimationFrame(()=>{this['isLoading']=!0x1;});}['updateResourceState'](_0x1cf75d,_0x36f20a){this['_resourcesListView']['updateResourceState'](_0x1cf75d,_0x36f20a);}}const Ra='ck-ai-chat-context-controls__source-balloon-panel',ba='ck-button-icon\x20ck-button-back',Oa='ck-ai-header\x20ck-ai-header_small\x20ck-ai-header_source';class Po{['_sourceResourceBalloons']=new Map();['_bodyCollection'];['_locale'];['_config'];constructor(_0x4244b9,_0x4dc90b,_0x21d1e8){this['_locale']=_0x4244b9,this['_bodyCollection']=_0x4dc90b,this['_config']=_0x21d1e8;}['showSourceResourcesBalloon']({source:_0xbc85f4,withBackButton:_0x4d7b60}){let _0x279dc6=this['_sourceResourceBalloons']['get'](_0xbc85f4['id']);_0x279dc6||(_0x279dc6=this['_createSourceResourceBalloonPanel'](),this['_sourceResourceBalloons']['set'](_0xbc85f4['id'],_0x279dc6),this['_setupSingleResourceBalloonClickOutsideHandler'](_0x279dc6)),this['_addSourceResourceContent']({'balloonPanel':_0x279dc6,'source':_0xbc85f4,'withBackButton':_0x4d7b60}),_0x279dc6['show']();const _0x16f5dd=this['_config']['getTargetElement']();_0x16f5dd&&_0x279dc6['pin']({'target':_0x16f5dd,'limiter':this['_config']['getLimiterElement']()});}['populateSourceResourceBalloon'](_0x142e5e,_0xa3c7eb,_0x1458f7){const _0x2c9c35=this['_sourceResourceBalloons']['get'](_0x142e5e);if(!_0x2c9c35)return;const _0x4c8d8a=this['_getResourcesViewFromBalloon'](_0x2c9c35);_0x4c8d8a&&(_0x4c8d8a['setResources'](_0xa3c7eb,_0x1458f7),_0x4c8d8a['once']('change:isLoading',()=>{_0x2c9c35['pin']({'target':this['_config']['getTargetElement'](),'limiter':this['_config']['getLimiterElement']()});}));}['closeSourceResourceBalloon'](_0x13a428){const _0x4fac8c=this['_sourceResourceBalloons']['get'](_0x13a428);_0x4fac8c&&requestAnimationFrame(()=>{_0x4fac8c['hide'](),this['_sourceResourceBalloons']['delete'](_0x13a428),this['_config']['onBalloonClosed']();});}['isAnyResourceBalloonVisible'](){for(const _0x41fb30 of this['_sourceResourceBalloons']['values']())if(_0x41fb30['isVisible'])return!0x0;return!0x1;}['updateResourceState'](_0x5ca8c3,_0x3f064a,_0x40427a){const _0x2a88de=this['_sourceResourceBalloons']['get'](_0x5ca8c3);if(!_0x2a88de||!_0x2a88de['isVisible'])return;const _0x4bf334=this['_config']['getTargetElement']();if(!_0x4bf334)return;_0x2a88de['pin']({'target':_0x4bf334,'limiter':this['_config']['getLimiterElement']()});const _0x21f0ea=this['_getResourcesViewFromBalloon'](_0x2a88de);_0x21f0ea&&_0x21f0ea['updateResourceState'](_0x3f064a,_0x40427a);}['destroy'](){for(const _0x5c3791 of this['_sourceResourceBalloons']['values']())_0x5c3791['destroy']();this['_sourceResourceBalloons']['clear']();}['_createSourceResourceBalloonPanel'](){const _0x45018e=new _0x435ccf(this['_locale']);return _0x45018e['extendTemplate']({'attributes':{'class':Ra}}),this['_bodyCollection']['add'](_0x45018e),_0x45018e;}['_addSourceResourceContent']({balloonPanel:_0x375c89,source:_0xe6b735,withBackButton:_0x4e24d4}){_0x375c89['content']['clear']();const _0x29054a=this['_createBalloonHeader']({'balloonPanel':_0x375c89,'source':_0xe6b735,'withBackButton':_0x4e24d4});_0x375c89['content']['add'](_0x29054a);const _0x2df746=this['_createBalloonResourcesView'](_0xe6b735);_0x375c89['content']['add'](_0x2df746);}['_createBalloonHeader']({balloonPanel:_0x205290,source:_0x55a3f5,withBackButton:_0x2b15b8}){const _0x4e5878=new _0xa16c5(this['_locale'],{'label':_0x55a3f5['label'],'class':Oa});return _0x2b15b8&&_0x4e5878['children']['add'](this['_createBackButton'](_0x205290),0x0),_0x4e5878;}['_createBackButton'](_0x2d2905){const _0x734e5c=new _0x4421de(this['_locale']);return _0x734e5c['set']({'icon':_0x135ef3,'tooltip':i(this['_locale'],'AI_CHAT_CONTEXT_URL_BACK_TO_CONTEXT'),'tooltipPosition':'n','class':ba}),_0x734e5c['on']('execute',()=>{_0x2d2905['hide'](),this['_config']['onBackToContext']();}),_0x734e5c;}['_createBalloonResourcesView'](_0x1583ad){const _0x583df7=new lc(this['_locale'],{'source':_0x1583ad,'searchInputVisibleFrom':this['_config']['searchInputVisibleFrom']});return _0x583df7['on']('loadSourceResources',(_0x1edade,_0x45a725)=>{this['_config']['onLoadSourceResources'](_0x45a725);}),_0x583df7['on']('addResourceToContext',(_0x340ffd,_0x2eb598)=>{this['_config']['onResourceSelected'](_0x2eb598['source'],_0x2eb598['resource']),this['closeSourceResourceBalloon'](_0x1583ad['id']);}),_0x583df7;}['_getResourcesViewFromBalloon'](_0x125379){const _0x3e2a46=_0x125379['content']['get'](0x1);return _0x3e2a46 instanceof lc?_0x3e2a46:null;}['_setupSingleResourceBalloonClickOutsideHandler'](_0x3d1718){_0xa9d580({'emitter':_0x3d1718,'contextElements':[_0x3d1718['element']],'callback':()=>{_0x3d1718['hide'](),this['_config']['onBalloonClosed']();},'activator':()=>_0x3d1718['isVisible']});}}const ls=['addDocumentToContext','addFileToContext','addUrlToContext','addResourceToContext','removeContextItem','loadSourceResources','executeCustomItemCallback'],Ro='ck-ai-chat-context-controls',Oo='ck-ai-chat-context-controls__pending-contexts',Uo='ck-ai-chat-context-controls__add-context-balloon-panel',Lo='ck-ai-chat-context-controls__add-context-button',No='ck-ai-chat-context-controls__url-balloon-panel',Mo='ck-ai-chat-context-controls__balloon-button',Ho='ck-ai-chat-context-controls__balloon-button-source',jo='ck-ai-chat-controls-button',Fo='ck-ai-chat-context-chips-wrapper-balloon',Xo='ck-ai-chat-controls_context_show-more-button',yo='ck-ai-chat-context-controls__show-more-balloon-panel',Do='ck-ai-chat',$o=[_0x435ccf['defaultPositions']['northArrowSouthWest'],_0x435ccf['defaultPositions']['northArrowSouth'],_0x435ccf['defaultPositions']['northArrowSouthEast'],_0x435ccf['defaultPositions']['southArrowNorthWest'],_0x435ccf['defaultPositions']['southArrowNorth'],_0x435ccf['defaultPositions']['southArrowNorthEast']];class rs extends _0x3ddefc{['addContextButtonView'];['_currentContextsChips']=this['createCollection']();['_conversationContextsChips']=this['createCollection']();['_overflowManager'];['_addContextBalloonPanelView'];['_urlBalloonPanelView'];['_urlInputView'];['_resourcesBalloonView'];['_addContextBalloonConfig'];['_hasExactlyOneSource']=!0x1;['bodyCollection'];constructor(_0x39bd78,_0x480fe3){super(_0x39bd78),this['bodyCollection']=_0x480fe3['bodyCollection'],this['_currentContextsChips']=this['createCollection'](),this['_conversationContextsChips']=this['createCollection'](),this['addContextButtonView']=this['_createAddContextButtonView'](_0x39bd78),this['_addContextBalloonPanelView']=this['_createAddContextBalloonPanelView'](_0x39bd78),this['_urlBalloonPanelView']=this['_createUrlBalloonPanelView'](_0x39bd78),this['_resourcesBalloonView']=this['_createResourcesBalloonView'](_0x39bd78,_0x480fe3);const _0x506ba6={'cssClasses':{'showMoreButton':Xo,'showMoreBalloon':yo,'overflowContainer':Fo,'controlsButton':jo}};this['_overflowManager']=new Io(_0x39bd78,this['_currentContextsChips'],_0x506ba6,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'](_0x5c4aa2,_0x4f32f6){const _0x3e2901=this['_createContextButton'](_0x5c4aa2,'current',!0x0,_0x4f32f6);this['_addContextToCollection'](_0x3e2901,this['_currentContextsChips']),this['_overflowManager']['reorganizeChips']();}['removeContextItem'](_0x2d5e0f){this['_removeContextFromCollection'](_0x2d5e0f,this['_currentContextsChips']),this['_removeContextFromCollection'](_0x2d5e0f,this['_overflowManager']['overflowChips']),this['_overflowManager']['reorganizeChips']();}['setContextItemLoading'](_0x21322d,_0x3fa565){let _0x5e70ea=this['_currentContextsChips']['find'](_0x3ab6b4=>_0x3ab6b4['id']===_0x21322d);_0x5e70ea||(_0x5e70ea=this['_overflowManager']['overflowChips']['find'](_0x307061=>_0x307061['id']===_0x21322d)),_0x5e70ea&&(_0x5e70ea['isLoading']=_0x3fa565);}['setConversationContext'](_0x73f63d){this['_conversationContextsChips']['clear']();for(const _0x7d5246 of _0x73f63d){const _0xf0c98=this['_createContextButton'](_0x7d5246,'conversation',!0x1,!0x1);this['_addContextToCollection'](_0xf0c98,this['_conversationContextsChips']);}}['clearCurrentContextItems'](){this['_currentContextsChips']['clear'](),this['_overflowManager']['clear']();}['clearConversationContextItems'](){this['_conversationContextsChips']['clear']();}['updateResourceState'](_0x27c2b0,_0x9e7601,_0x124309){this['_resourcesBalloonView']['updateResourceState'](_0x27c2b0,_0x9e7601,_0x124309);}['hideAddContextBalloonPanel'](){this['_toggleAddContextBalloon'](!0x1);}['showAddContextBalloonPanel'](){this['_toggleAddContextBalloon'](!0x0);}['hideUrlBalloonPanel'](){this['_urlBalloonPanelView']['hide'](),this['addContextButtonView']['isOn']=!0x1,this['_urlInputView']&&this['_urlInputView']['clear']();}['showUrlBalloonPanel'](){this['_urlBalloonPanelView']['show'](),this['addContextButtonView']['isOn']=!0x0;}['_showSourceResourcesBalloon']({source:_0x4e638b,withBackButton:_0x3f8c43}){this['_resourcesBalloonView']['showSourceResourcesBalloon']({'source':_0x4e638b,'withBackButton':_0x3f8c43}),this['addContextButtonView']['isOn']=!0x0;}['populateSourceResourceBalloon'](_0x54d32c,_0x1e443f,_0x4c713a,_0x5e4fad){this['_resourcesBalloonView']['populateSourceResourceBalloon'](_0x54d32c,_0x4c713a,_0x5e4fad);}['closeSourceResourceBalloon'](_0x10a76f){this['_resourcesBalloonView']['closeSourceResourceBalloon'](_0x10a76f),this['addContextButtonView']['isOn']=!0x1;}['setAddContextOptions'](_0x5a169f){this['_setBalloonPanelContent'](this['_addContextBalloonPanelView'],this['locale'],_0x5a169f),this['_setAddContextButtonEnabled'](_0x5a169f);}['_setAddContextButtonEnabled'](_0x9917e1){const _0x282b7e=!_0x9917e1['document']['isHidden']&&_0x9917e1['document']['enabled'],_0x837760=_0x9917e1['urls']['enabled'],_0x28f1f1=_0x9917e1['files']['enabled'],_0x165c4c=_0x9917e1['sources']['length']>0x0,_0x1edec8=_0x9917e1['customItems']&&_0x9917e1['customItems']['length']>0x0;this['addContextButtonView']['isEnabled']=_0x282b7e||_0x837760||_0x28f1f1||_0x165c4c||_0x1edec8;}['_setupTemplate'](){this['setTemplate']({'tag':'div','attributes':{'class':[Ro,'ck-reset_all-excluded']},'children':[{'tag':'div','attributes':{'class':Oo},'children':this['_currentContextsChips']}]});}['_bindEventHandlers'](){this['addContextButtonView']['on']('execute',()=>{this['_handleAddContextButtonClick']();});}['_createAddContextButtonView'](_0xb3c479){const _0x4d7f5d=new _0x4421de(_0xb3c479);return _0x4d7f5d['set']({'label':i(_0xb3c479,'AI_CHAT_CONTEXT_ADD_CONTEXT'),'class':jo+'\x20'+Lo,'icon':_0xb91038,'isToggleable':!0x0,'tooltip':!0x0,'tooltipPosition':'sw'}),_0x4d7f5d;}['_createAddContextBalloonPanelView'](_0x3c0b66){return this['_createBaseBalloonPanel'](_0x3c0b66,Uo);}['_createUrlBalloonPanelView'](_0x34b939){const _0x45c54a=this['_createBaseBalloonPanel'](_0x34b939,No);return this['_addUrlContent'](_0x45c54a,_0x34b939),_0x45c54a;}['_createResourcesBalloonView'](_0x5a53c8,_0xcf3b2d){const _0x49dc9b={'searchInputVisibleFrom':_0xcf3b2d['searchInputVisibleFrom'],'onBackToContext':()=>{this['showAddContextBalloonPanel'](),this['_addContextBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':$o});},'onResourceSelected':(_0x208448,_0x5d7fca)=>{this['fire']('addResourceToContext',{'source':_0x208448,'resource':_0x5d7fca});},'onLoadSourceResources':_0x323d57=>{this['fire']('loadSourceResources',_0x323d57);},'onBalloonClosed':()=>{this['addContextButtonView']['isOn']=!0x1;},'getLimiterElement':()=>this['_getLimiterElement'](),'getTargetElement':()=>this['addContextButtonView']['element']};return new Po(_0x5a53c8,_0xcf3b2d['bodyCollection'],_0x49dc9b);}['_getLimiterElement'](){return this['element']?.['closest']('.'+Do)||document['body'];}['_createBaseBalloonPanel'](_0xe5f42d,_0x2d3af7){const _0x12d018=new _0x435ccf(_0xe5f42d);return _0x12d018['extendTemplate']({'attributes':{'class':_0x2d3af7}}),this['bodyCollection']['add'](_0x12d018),_0x12d018;}['_setBalloonPanelContent'](_0x3e9f8b,_0x1cad10,_0x5c1dfd){if(_0x3e9f8b['content']['clear'](),!_0x5c1dfd['document']['isHidden']&&_0x5c1dfd['document']['enabled']){const _0x591044=this['_createBalloonButton'](_0x1cad10,{'label':i(_0x1cad10,'AI_CHAT_CONTEXT_CURRENT_DOCUMENT'),'icon':_0x13ab44});_0x591044['on']('execute',()=>{this['fire']('addDocumentToContext'),this['hideAddContextBalloonPanel']();}),_0x3e9f8b['content']['add'](_0x591044);}if(_0x5c1dfd['urls']['enabled']){const _0x2558bb=this['_createBalloonButton'](_0x1cad10,{'label':i(_0x1cad10,'AI_CHAT_CONTEXT_URL_LABEL'),'icon':_0x4aa87f});_0x2558bb['on']('execute',()=>{this['hideAddContextBalloonPanel'](),this['showUrlBalloonPanel'](),this['_urlBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':$o}),this['_urlInputView']['focus']();}),_0x3e9f8b['content']['add'](_0x2558bb);}if(_0x5c1dfd['files']['enabled']){const _0x9ed403=new _0x6117a4(_0x1cad10);_0x9ed403['set']({'label':i(_0x1cad10,'AI_CHAT_CONTEXT_FILE_LABEL'),'icon':_0x1db179,'withText':!0x0,'tooltip':!0x0,'class':Mo,'allowMultipleFiles':!0x0}),_0x9ed403['on']('execute',()=>{this['hideAddContextBalloonPanel']();}),_0x9ed403['on']('done',(_0x45e64d,_0x36fd98)=>{this['fire']('addFileToContext',_0x36fd98);}),_0x9ed403['tooltip']=!0x0,_0x3e9f8b['content']['add'](_0x9ed403);}for(const _0x3dc557 of _0x5c1dfd['sources']){const _0x531ac4=this['_createBalloonButton'](_0x1cad10,{'label':_0x3dc557['label'],'icon':_0x3dc557['icon']||_0x4dcc38,'type':'source'});_0x3e9f8b['content']['add'](_0x531ac4),_0x531ac4['on']('execute',()=>{this['hideAddContextBalloonPanel'](),this['_showSourceResourcesBalloon']({'source':_0x3dc557,'withBackButton':!this['_hasExactlyOneSource']});});}for(const _0x1d7745 of _0x5c1dfd['customItems']||[]){const _0x577b92=this['_createBalloonButton'](_0x1cad10,{'label':_0x1d7745['label'],'icon':_0x1d7745['icon']||_0x4dcc38,'type':'customItem'});_0x3e9f8b['content']['add'](_0x577b92),_0x577b92['on']('execute',()=>{this['hideAddContextBalloonPanel'](),this['fire']('executeCustomItemCallback',_0x1d7745);});}this['_hasExactlyOneSource']=0x1===_0x3e9f8b['content']['length'],this['_urlInputView']['withBackButton']=!this['_hasExactlyOneSource'];}['_addUrlContent'](_0x501c3a,_0x2b4ea0){this['_urlInputView']=new Vo(_0x2b4ea0),this['_urlInputView']['on']('submitUrl',(_0x401321,_0x3d2790)=>{this['_handleUrlSubmit'](_0x3d2790);}),this['_urlInputView']['on']('cancel',()=>{this['hideUrlBalloonPanel'](),this['_hasExactlyOneSource']||(this['showAddContextBalloonPanel'](),this['_addContextBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':$o}));}),this['_urlInputView']['on']('refreshBalloon',()=>{this['_urlBalloonPanelView']['isVisible']&&this['_urlBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':$o});}),_0x501c3a['content']['add'](this['_urlInputView']);}['_createBalloonButton'](_0xdcd4f6,_0x22bf7f){const _0x378943='source'===_0x22bf7f['type']?new SourcesBalloonButtonView(_0xdcd4f6):new _0x4421de(_0xdcd4f6);return _0x378943['set']({'label':_0x22bf7f['label'],'icon':_0x22bf7f['icon'],'withText':!0x0,'tooltip':!0x0,'tooltipPosition':'sw','class':Mo}),_0x378943;}['_setupAllBalloonClickOutsideHandlers'](){this['_setupAddContextBalloonClickOutsideHandler'](),this['_setupUrlBalloonClickOutsideHandler']();}['_setupUrlBalloonClickOutsideHandler'](){_0xa9d580({'emitter':this['_urlBalloonPanelView'],'contextElements':[this['_urlBalloonPanelView']['element']],'callback':()=>{this['hideUrlBalloonPanel']();},'activator':()=>this['_urlBalloonPanelView']['isVisible']});}['_toggleAddContextBalloon'](_0x282706){const _0x2b1574=this['_addContextBalloonConfig'];_0x2b1574['buttonView']['isOn']=_0x282706,_0x282706?_0x2b1574['balloonView']['show']():_0x2b1574['balloonView']['hide']();}['_setupAddContextBalloonClickOutsideHandler'](){const {balloonView:_0xc1acac,buttonView:_0x4dfabf,hideMethod:_0x2b0b4f}=this['_addContextBalloonConfig'];_0xa9d580({'emitter':_0xc1acac,'contextElements':[_0xc1acac['element'],_0x4dfabf['element']],'callback':()=>{_0x2b0b4f();},'activator':()=>_0x4dfabf['isOn']&&!this['_urlBalloonPanelView']['isVisible']&&!this['_resourcesBalloonView']['isAnyResourceBalloonVisible']()});}['_createContextButton'](_0x3a1d32,_0x439f0c,_0x49f8c1=!0x1,_0x52549c=!0x1){const _0x396b0e='conversation'===_0x439f0c||!0x0===_0x3a1d32['isReadOnly'],_0x35e4db=new vo(this['locale'],_0x3a1d32,_0x396b0e,_0x49f8c1,_0x52549c);return _0x396b0e||_0x35e4db['on']('removeContextItemChip',()=>{this['fire']('removeContextItem',_0x35e4db['id']);}),_0x35e4db;}['_addContextToCollection'](_0x1fb24e,_0x5e9ddb){_0x5e9ddb['add'](_0x1fb24e,0x0);}['_removeContextFromCollection'](_0x46a70d,_0x31cfc9){const _0x532d37=_0x31cfc9['find'](_0x5d116c=>_0x5d116c['id']===_0x46a70d);_0x532d37&&_0x31cfc9['remove'](_0x532d37);}['_handleAddContextButtonClick'](){this['addContextButtonView']['isOn']?this['hideAddContextBalloonPanel']():(this['showAddContextBalloonPanel'](),this['_addContextBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':$o}),this['_hasExactlyOneSource']&&this['_addContextBalloonPanelView']['content']['get'](0x0)?.['fire']('execute'));}['_handleUrlSubmit'](_0x2dd2f3){this['_urlInputView']['clear'](),this['hideUrlBalloonPanel'](),this['fire']('addUrlToContext',_0x2dd2f3);}}class SourcesBalloonButtonView extends _0x4421de{['arrowView'];constructor(_0x7b07b4){super(_0x7b07b4),this['set']({'withText':!0x0,'role':'menuitem'}),this['arrowView']=this['_createArrowView'](),this['extendTemplate']({'attributes':{'class':[Ho]}});}['render'](){super['render'](),this['children']['add'](this['arrowView']);}['_createArrowView'](){const _0x147701=new _0x2fc344();return _0x147701['content']=_0x5e0145,_0x147701['extendTemplate']({'attributes':{'class':Ho+'__arrow'}}),_0x147701;}}class ps extends _0x3ddefc{['_cancelButtonView'];['_loaderView'];constructor(_0x427023){super(_0x427023),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 _0x92d930=new _0x4421de(this['locale']);return _0x92d930['set']({'label':i(this['locale'],'AI_CHAT_STOP_GENERATING'),'withText':!0x0,'class':'ck-ai-button-secondary\x20ck-ai-button-stop-generating','icon':_0x8718cf}),_0x92d930['on']('execute',()=>{this['fire']('abortPromptStream');}),_0x92d930;}['_createLoaderView'](){const _0x10fa9c=new _0x3ddefc(this['locale']);return _0x10fa9c['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')}]}),_0x10fa9c;}}class Ci extends _0x3ddefc{['_contextPanelView'];['_promptInputView'];['_promptCapabilitiesView'];['_loaderView'];['_modelUnavailableMessageView'];['_shouldRestorePromptInputFocus'];constructor(_0x4b1d40,_0x4151c6){super(_0x4b1d40),this['_contextPanelView']=this['_createContextPanelView'](_0x4b1d40,{'bodyCollection':_0x4151c6['bodyCollection'],'searchInputVisibleFrom':_0x4151c6['contextResourcesSearchInputVisibleFrom']}),this['_promptInputView']=this['_createPromptInputView'](_0x4b1d40),this['_promptCapabilitiesView']=this['_createPromptCapabilitiesView'](_0x4b1d40),this['_loaderView']=this['_createLoaderView'](_0x4b1d40),this['_modelUnavailableMessageView']=this['_createModelUnavailableMessageView'](_0x4b1d40),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'](...ls)['to'](this),this['set']('isModelAvailable',!0x0),this['set']('isDisabled',!0x1);const _0x49b595=this['bindTemplate'];this['setTemplate']({'tag':'form','attributes':{'class':['ck','ck-ai-chat-controls',_0x49b595['if']('isDisabled','ck-ai-chat-controls-disabled')]},'children':[{'tag':'div','attributes':{'class':[_0x49b595['if']('isLoading','ck-hidden',_0x299ec4=>_0x299ec4||!this['isModelAvailable']),_0x49b595['if']('isModelAvailable','ck-hidden',_0xdf368f=>!_0xdf368f||this['isLoading'])]},'children':[this['_contextPanelView'],this['_promptInputView'],this['_promptCapabilitiesView']]},{'tag':'div','attributes':{'class':[_0x49b595['if']('isLoading','ck-hidden',_0x546e2f=>!_0x546e2f)]},'children':[this['_loaderView']]},{'tag':'div','attributes':{'class':[_0x49b595['if']('isModelAvailable','ck-hidden',_0x271fc9=>_0x271fc9)]},'children':[this['_modelUnavailableMessageView']]}]}),_0xa9d580({'emitter':this['_promptInputView'],'activator':()=>this['isLoading'],'contextElements':()=>[this['element']],'callback':()=>{this['_shouldRestorePromptInputFocus']=!0x1;}}),this['on']('change:isLoading',this['_handlePromptInputFocus'],{'priority':'low'});}['_createContextPanelView'](_0x49d2ad,_0x23090a){return new rs(_0x49d2ad,_0x23090a);}['_createPromptInputView'](_0xc9127a){return new os(_0xc9127a,this['_contextPanelView']['addContextButtonView']);}['_createPromptCapabilitiesView'](_0x2b0590){return new cs(_0x2b0590);}['_createLoaderView'](_0x68a76f){return new ps(_0x68a76f);}['_createModelUnavailableMessageView'](_0x26555f){const _0x14e813=new AIChatModelUnavailableMessageView(_0x26555f);return _0x14e813['delegate']('startConversation')['to'](this),_0x14e813;}['_handlePromptInputFocus'](_0x2a23e8,_0x1c3f48,_0x3d6168){_0x3d6168?this['_shouldRestorePromptInputFocus']=!0x0:this['_shouldRestorePromptInputFocus']&&this['_promptInputView']['focus']();}['addContextItem'](_0x14e0e1,_0xe489c9){this['_contextPanelView']['addContextItem'](_0x14e0e1,_0xe489c9);}['removeContextItem'](_0x3da17d){this['_contextPanelView']['removeContextItem'](_0x3da17d);}['setContextItemLoading'](_0x3eef8c,_0x283987){this['_contextPanelView']['setContextItemLoading'](_0x3eef8c,_0x283987);}['setIsUploadInProgress'](_0x1ca892){this['_promptInputView']['setIsUploadInProgress'](_0x1ca892);}['setConversationContext'](_0xc13597){this['_contextPanelView']['setConversationContext'](_0xc13597);}['clearPendingContextUI'](){this['_contextPanelView']['clearCurrentContextItems']();}['clearConversationContextUI'](){this['_contextPanelView']['clearConversationContextItems']();}['updateResourceState'](_0x56d8c3,_0x4455c4,_0x21a861){this['_contextPanelView']['updateResourceState'](_0x56d8c3,_0x4455c4,_0x21a861);}['setWebSearch'](_0x3c2c2b){this['_promptCapabilitiesView']['setWebSearch'](_0x3c2c2b);}['setReasoning'](_0x275c32){this['_promptCapabilitiesView']['setReasoning'](_0x275c32);}['resetMessageInput'](){this['_promptInputView']['reset']();}['setAddContextOptions'](_0x381059){this['_contextPanelView']['setAddContextOptions'](_0x381059);}['setInputPlaceholder'](_0x1789b5){this['_promptInputView']['setPlaceholderText'](_0x1789b5);}['setModelList'](_0x2fb364,_0x46866f){this['_promptCapabilitiesView']['setModelList'](_0x2fb364,_0x46866f);}['setModel'](_0x403956){_0x403956?(this['isModelAvailable']=!0x0,this['_promptCapabilitiesView']['setModel'](_0x403956)):this['isModelAvailable']=!0x1;}['enableModelSelector'](){this['_promptCapabilitiesView']['enableModelSelector']();}['disableModelSelector'](_0x8ffbbc){this['_promptCapabilitiesView']['disableModelSelector'](_0x8ffbbc);}['populateSourceResourceBalloon'](_0x22fad8,_0x176fb6,_0x1cb506,_0x2bfe5f){this['_contextPanelView']['populateSourceResourceBalloon'](_0x22fad8,_0x176fb6,_0x1cb506,_0x2bfe5f);}['closeSourceResourceBalloon'](_0x43facb){this['_contextPanelView']['closeSourceResourceBalloon'](_0x43facb);}['focusPromptInput'](_0x48f05e=!0x1){this['_promptInputView']['focus'](_0x48f05e);}['setPromptInputValue'](_0x38bc6f){this['_promptInputView']['queryView']['fieldView']['reset'](),this['_promptInputView']['queryView']['fieldView']['value']=_0x38bc6f;}}class AIChatModelUnavailableMessageView extends _0x3ddefc{constructor(_0x5379e8){super(_0x5379e8);const _0x2b0dc2=new _0x4421de(_0x5379e8);_0x2b0dc2['set']({'label':i(this['locale'],'AI_CHAT_MODEL_UNAVAILABLE_MESSAGE_BUTTON'),'withText':!0x0,'class':['ck-ai-chat-controls__start-new-chat-button'],'tooltip':''}),_0x2b0dc2['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'},_0x2b0dc2]}]});}}class xi extends _0xa16c5{['conversationStartButton'];['resizeButton'];constructor(_0x3aafd5,_0x3741d4){super(_0x3aafd5,{'label':i(_0x3aafd5,'AI_CHAT_HEADING'),'class':'ck-ai-header\x20ck-ai-header_chat','icon':vt}),this['set']('isMaximized',!0x1),this['conversationStartButton']=this['_createStartConversationButton'](_0x3aafd5),this['children']['add'](this['conversationStartButton']),_0x3741d4&&(this['resizeButton']=us(_0x3aafd5,this),this['children']['add'](this['resizeButton']));}['_createStartConversationButton'](_0x1656b0){const _0x4b52dd=new _0x4421de(_0x1656b0);return _0x4b52dd['set']({'label':i(this['locale'],'AI_CHAT_LABEL_NEW_CHAT'),'withText':!0x0,'icon':_0x56e5bc,'class':'ck-ai-chat__start-conversation'}),_0x4b52dd['on']('execute',()=>{this['fire']('startConversation');}),_0x4b52dd;}}class yi extends _0x3ddefc{constructor(_0x2239f6){super(_0x2239f6),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-disclaimer']},'children':[{'tag':'p','attributes':{'class':['ck','ck-ai-disclaimer__content']},'children':[{'text':i(_0x2239f6,'AI_DISCLAIMER_TEXT')}]}]});}}class Pt extends _0x3ddefc{['chatHeader'];['chatFeed'];['chatControls'];['chatDisclaimer'];['_bodyCollection'];constructor(_0x15a0d1,_0x48ff96){super(_0x15a0d1),this['_bodyCollection']=new _0x6c121d(_0x15a0d1),this['_bodyCollection']['attachToDom'](),this['chatHeader']=new xi(_0x15a0d1,_0x48ff96['showResizeButton']),this['chatHeader']['delegate'](...bt)['to'](this),this['chatFeed']=new ji(_0x15a0d1,this['_bodyCollection']),this['chatFeed']['delegate'](...bt)['to'](this),this['chatControls']=new Ci(_0x15a0d1,{'bodyCollection':this['_bodyCollection'],'contextResourcesSearchInputVisibleFrom':_0x48ff96['contextResourcesSearchInputVisibleFrom']}),this['chatControls']['delegate'](...bt)['to'](this),this['chatDisclaimer']=new yi(_0x15a0d1),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-ai-chat','ck-rounded-corners'],'dir':_0x15a0d1['uiLanguageDirection']},'children':[this['chatHeader'],this['chatFeed'],this['chatControls'],this['chatDisclaimer']]});}['populateSourceResourceBalloon'](_0x32b091,_0x1a3d89,_0x25ac67,_0x428b57){this['chatControls']['populateSourceResourceBalloon'](_0x32b091,_0x1a3d89,_0x25ac67,_0x428b57);}['closeSourceResourceBalloon'](_0xd105a7){this['chatControls']['closeSourceResourceBalloon'](_0xd105a7);}['destroy'](){this['_bodyCollection']['detachFromDom'](),super['destroy']();}}class ct extends _0x3b66f2{static get['requires'](){return[pt];}['_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(_0x2caa76){super(_0x2caa76);const _0x384402=this['context']['plugins']['get']('AITabs');this['set']('isBusy',!0x1),this['_promiseQueue']=new z(),this['_view']=new Pt(this['context']['locale'],{'showResizeButton':_0x384402['showResizeButton'],'contextResourcesSearchInputVisibleFrom':this['context']['config']['get']('ai.chat.context.searchInputVisibleFrom')}),this['_view']['delegate'](...bt)['to'](this),this['_view']['on']('toggleSuggestionDisplayMode',(_0x535e1d,{showDiff:_0x4e5d36})=>{this['showDiff']=_0x4e5d36;}),_0x384402['view']['addTab']({'id':'chat','buttonLabel':i(this['context']['locale'],'AI_CHAT_HEADING'),'buttonIcon':vt,'order':0x0,'content':this['_view']}),this['_view']['chatControls']['bind']('isLoading')['to'](this,'isBusy',_0x1199cb=>_0x1199cb),this['_view']['chatFeed']['bind']('isPending')['to'](this,'isBusy',_0x9ca5fc=>_0x9ca5fc),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder']()),this['bind']('isModelAvailable')['to'](this['_view']['chatControls'],'isModelAvailable');}['destroy'](){super['destroy'](),this['_titleAnimationInterval']&&clearInterval(this['_titleAnimationInterval']);}['createConversation'](_0x12c67a){const _0x4855bf=this['context']['config']['get']('ai.chat.welcomeMessage')??i(this['context']['locale'],'AI_CHAT_WELCOME_MESSAGE');this['_view']['chatFeed']['clear'](),this['_view']['chatControls']['enableModelSelector'](),this['_view']['chatControls']['setModelList'](_0x12c67a['availableModels'],!this['context']['config']['get']('ai.models.showModelSelector')),this['addFeedItemStaticMessage']({'id':'conversation-start','staticMessage':_0x4855bf}),this['fire']('conversationCreated');}['addFeedItemStaticMessage']({id:_0x3b93d5,staticMessage:_0x15f811}){this['_view']['chatFeed']['addItem']('ai-reply',{'id':_0x3b93d5,'initialContent':'<p>'+_0x15f811+'</p>'});}['addFeedItemUserMessage'](_0x3e8414){const _0x2f1031=_0x3e8414['attributes']?.['displayedPrompt']||_0x3e8414['userMessage'];this['_view']['chatFeed']['addItem']('user-message',{'contextItems':Array['from'](_0x3e8414['contextItems']['values']()),'initialContent':'<p>'+_0x2f1031+'</p>','id':_0x3e8414['id']});}['addFeedItemError']({errorMessage:_0x472ab0,id:_0x5e34b6}){this['_view']['chatFeed']['addItem']('error-message',{'initialContent':'<p>'+_0x472ab0+'</p>','id':_0x5e34b6});}['addFeedItemAIReply'](_0x385b3b){return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('ai-reply',{'id':_0x385b3b['interactionId']+':'+_0x385b3b['id']}),this['clearLoadingMessage']();});}async['addFeedItemAISuggestion'](_0x37d876){const _0x599f91=T(this['context']);let _0x4e5b0d=_0x599f91['config']['get']('ai.availableReplyActions')||[...ot];if(_0x599f91['plugins']['has']('TrackChanges')){if(!this['_isTrackChangesCommandValueBound']){this['_isTrackChangesCommandValueBound']=!0x0;const _0x58c324=_0x599f91['commands']['get']('trackChanges');this['_view']['chatFeed']['bind']('isTrackChangesOn')['to'](_0x58c324,'value');}}else _0x4e5b0d=_0x4e5b0d['filter'](_0x2b654b=>'insertSuggestion'!=_0x2b654b);return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('ai-suggestion-reply',{'id':_0x37d876['interactionId']+':'+_0x37d876['id'],'areActionsDisabled':_0x37d876['areActionsDisabled'],'showDiff':this['showDiff'],'availableActions':_0x4e5b0d}),this['clearLoadingMessage']();});}['addFeedInteractionHeader'](_0x5718d0,_0x13cc86){const _0x7afcd9=this['_view']['chatFeed']['children']['last'];if(_0x7afcd9 instanceof Mt)return this['_view']['chatFeed']['children']['remove'](_0x7afcd9),void this['_view']['chatFeed']['addItem']('interaction-header',{'id':_0x5718d0['id'],'capabilities':{'isWebSearchEnabled':_0x7afcd9['capabilities']['isWebSearchEnabled']||_0x13cc86['isWebSearchEnabled'],'isReasoningEnabled':_0x7afcd9['capabilities']['isReasoningEnabled']||_0x13cc86['isReasoningEnabled']}});this['_view']['chatFeed']['addItem']('interaction-header',{'id':_0x5718d0['id'],'capabilities':_0x13cc86});}async['addFeedItemCustomElement'](_0x55cf55,_0x52b9d2){let _0x121af9;return await this['_promiseQueue']['enqueue'](async()=>{_0x121af9=this['_view']['chatFeed']['addItem']('custom-element',{'content':_0x55cf55,'id':_0x52b9d2});}),_0x121af9;}['removeFeedItem'](_0x2cffc9){this['_view']['chatFeed']['removeItem'](_0x2cffc9);}['hasFeedItem'](_0x15e248){return this['_view']['chatFeed']['hasItem'](_0x15e248);}['updateFeedInteractionHeader'](_0x568ed8){const _0x49536f=this['_view']['chatFeed']['children']['find'](_0x3c9808=>_0x3c9808['options']['id']==_0x568ed8['id']&&_0x3c9808 instanceof Mt);_0x49536f&&_0x49536f['set']('isVisible',_0x568ed8['isVisible']);}async['updateFeedItemAIReplyContent'](_0x1034ab){const _0x3ce40a=_0x1034ab['renderingStrategy']||this['feedItemRenderingStrategy'];return this['_promiseQueue']['enqueue'](async _0x157bfd=>{await this['_view']['chatFeed']['updateReplyItem']({..._0x1034ab,'abortSignal':_0x157bfd,'renderingStrategy':_0x3ce40a}),_0x1034ab['isDone']&&this['markFeedItemAsDone'](_0x1034ab['id']);});}['updateFeedItemAIReplySources'](_0x4014b0,_0x22d7a4){this['_view']['chatFeed']['updateWebSources'](_0x4014b0,_0x22d7a4);}async['updateFeedItemAIReplySuggestionContent'](_0x4a57cf){const _0x202299=_0x4a57cf['renderingStrategy']||this['feedItemRenderingStrategy'];return this['_promiseQueue']['enqueue'](async _0x282f4e=>{await this['_view']['chatFeed']['updateSuggestionItem']({..._0x4a57cf,'abortSignal':_0x282f4e,'renderingStrategy':_0x202299}),_0x4a57cf['isDone']&&this['markFeedItemAsDone'](_0x4a57cf['id']);});}['updateFeedItemAIReplySuggestionPartState'](_0x1829f4){this['_view']['chatFeed']['updateSuggestionPartState'](_0x1829f4);}['setFeedItemAIReplySuggestionPartActive'](_0x430118){this['_view']['chatFeed']['setSuggestionPartActive'](_0x430118);}['markFeedItemAsDone'](_0x25fe96){this['_view']['chatFeed']['markItemAsDone'](_0x25fe96);}['removeFeedInteraction'](_0x581123){this['_view']['chatFeed']['getItemIds']()['filter'](_0x41ef91=>_0x41ef91['startsWith'](_0x581123))['forEach'](_0x30bc0d=>this['_view']['chatFeed']['removeItem'](_0x30bc0d));}['startInteraction'](){const _0x18dac1=this['prepareLoadingMessage']({'isWebSearchEnabled':!0x1,'isReasoningEnabled':!0x1});this['setLoadingMessage'](_0x18dac1),this['_view']['chatControls']['disableModelSelector'](!this['context']['config']['get']('ai.models.showModelSelector')),this['isBusy']=!0x0,this['_view']['chatFeed']['startAutoScroll']();}['stopInteraction'](_0x4ddf25){this['_promiseQueue']['abort'](),this['_view']['chatFeed']['getItemIds']()['filter'](_0x2803f9=>_0x2803f9['startsWith'](_0x4ddf25['id']))['forEach'](_0x4dc39d=>this['markFeedItemAsDone'](_0x4dc39d)),this['isBusy']=!0x1,this['_view']['chatFeed']['stopAutoScroll']();}async['finishInteraction'](){return this['_promiseQueue']['queueEmptyPromise']['then'](()=>{this['isBusy']=!0x1,this['_view']['chatFeed']['stopAutoScroll']();});}['addContextItem'](_0x332bf2,_0x477603){this['_view']['chatControls']['addContextItem'](_0x332bf2,_0x477603);}['removeContextItem'](_0x2a055e){this['_view']['chatControls']['removeContextItem'](_0x2a055e);}['setContextItemLoading'](_0x31fccb,_0x232073){this['_view']['chatControls']['setContextItemLoading'](_0x31fccb,_0x232073);}['setIsUploadInProgress'](_0x339110){this['_view']['chatControls']['setIsUploadInProgress'](_0x339110);}['setConversationContext'](_0x5d2a51){this['_view']['chatControls']['setConversationContext'](_0x5d2a51);}['clearPendingContextUI'](){this['_view']['chatControls']['clearPendingContextUI']();}['clearConversationContextUI'](){this['_view']['chatControls']['clearConversationContextUI']();}['updateResourceState'](_0x5a6060,_0x178e95,_0x57c1e6){this['_view']['chatControls']['updateResourceState'](_0x5a6060,_0x178e95,_0x57c1e6);}['resetMessageInput'](){this['_view']['chatControls']['resetMessageInput'](),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder']());}['setAddContextOptions'](_0x14461f){this['_view']['chatControls']['setAddContextOptions'](_0x14461f);}['updateCapabilities'](_0x1395c3){this['_view']['chatControls']['setWebSearch'](_0x1395c3['isWebSearchEnabled']),this['_view']['chatControls']['setReasoning'](_0x1395c3['isReasoningEnabled']),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder'](_0x1395c3));}['setSelectedModel'](_0x13cee3,_0x55f9ef){this['_view']['chatControls']['setModel'](_0x13cee3),_0x55f9ef&&this['_view']['chatControls']['disableModelSelector'](!0x1);}['setFeedItemRenderingStrategy'](_0x32adb6){this['feedItemRenderingStrategy']=_0x32adb6;}['toggleLoadingSkeleton'](_0xf07250){this['_view']['chatFeed']['toggleLoadingSkeleton'](_0xf07250);}['resetConversationTitle'](){this['setConversationTitle'](i(this['context']['locale'],'AI_CHAT_HEADING'));}['setConversationTitle'](_0x2c1f06,_0x2a3983=!0x1){if(_0x2a3983&&!Rt()&&_0x2c1f06['length'])return this['_view']['chatHeader']['label']='',void this['_animateConversationTitle'](_0x2c1f06);this['_view']['chatHeader']['label']=_0x2c1f06;}['setLoadingMessage'](_0x6e37eb){this['_view']['chatFeed']['setLoadingMessage'](_0x6e37eb);}['clearLoadingMessage'](){this['_view']['chatFeed']['setLoadingMessage']('');}['_animateConversationTitle'](_0x1e7eed){let _0x3e0a22=0x0;clearInterval(this['_titleAnimationInterval']),this['_titleAnimationInterval']=setInterval(()=>{this['_view']['chatHeader']['label']=this['_view']['chatHeader']['label']+_0x1e7eed[_0x3e0a22],_0x3e0a22++,_0x3e0a22===_0x1e7eed['length']&&clearInterval(this['_titleAnimationInterval']);},0x1e);}['setIsMaximized'](_0x1576d1){this['_view']['chatHeader']['isMaximized']=_0x1576d1;}['prepareLoadingMessage'](_0x308636){return _0x308636['isWebSearchEnabled']&&_0x308636['isReasoningEnabled']?i(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH_REASONING'):_0x308636['isWebSearchEnabled']?i(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH'):_0x308636['isReasoningEnabled']?i(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_REASONING'):i(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_REGULAR');}['_getInputPlaceholder'](_0xf184e0){return _0xf184e0?_0xf184e0['isWebSearchEnabled']&&_0xf184e0['isReasoningEnabled']?i(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH_REASONING'):_0xf184e0['isWebSearchEnabled']?i(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH'):_0xf184e0['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'](_0xfda97c,_0x5beb48,_0x451752,_0x1bc591){this['_view']['populateSourceResourceBalloon'](_0xfda97c,_0x5beb48,_0x451752,_0x1bc591);}['closeSourceResourceBalloon'](_0x100799){this['_view']['closeSourceResourceBalloon'](_0x100799);}['setPromptInputValue'](_0x3fdb05){this['_view']['chatControls']['setPromptInputValue'](_0x3fdb05);}['focusPromptInput'](_0x6584d9=!0x1){this['_view']['chatControls']['focusPromptInput'](_0x6584d9);}['scrollFeedToSuggestion'](_0x317f53,_0x2988b0){this['_view']['chatFeed']['scrollToSuggestion'](_0x317f53,_0x2988b0);}['startAutoScroll'](){this['_view']['chatFeed']['startAutoScroll']();}['disableControls'](){this['_view']['chatControls']['isDisabled']=!0x0;}['enableControls'](){this['_view']['chatControls']['isDisabled']=!0x1;}}class Di extends _0x4bb2ce{['sections'];constructor(_0x266009,_0x3ba6f1){super(_0x266009),this['sections']=_0x3ba6f1,this['items']['addMany'](this['sections']),this['extendTemplate']({'attributes':{'class':['ck-ai-chat-history__sections']}});}['filter'](_0x5403ab){let _0x917438=0x0,_0x29b204=0x0;for(const _0x4d637f of this['sections']){const {resultsCount:_0x1cdf6d,totalItemsCount:_0x29f108}=_0x4d637f['filter'](_0x5403ab);_0x917438+=_0x1cdf6d,_0x29b204+=_0x29f108;}return{'resultsCount':_0x917438,'totalItemsCount':_0x29b204};}}class zi extends _0x23b8c1{['title'];['itemsViews'];['_itemsListView'];constructor(_0x8c02e4,{title:_0x20f7ab,items:_0x4407be}){super(_0x8c02e4);const _0x1f76ac=this['bindTemplate'];this['set']('isVisible',!0x0),this['title']=_0x20f7ab,this['itemsViews']=_0x4407be;const _0x1cea34=new _0x3ddefc(_0x8c02e4);_0x1cea34['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-history__section-title']},'children':[this['title']]}),this['_itemsListView']=new _0x4bb2ce(_0x8c02e4),this['_itemsListView']['items']['addMany'](this['itemsViews']),this['setTemplate']({'tag':'li','attributes':{'class':['ck-ai-chat-history__section',_0x1f76ac['if']('isVisible','ck-hidden',_0x30ee04=>!_0x30ee04)]},'children':[_0x1cea34,this['_itemsListView']]});}['filter'](_0x3324c9){const _0x42e982=this['itemsViews']['length'];let _0x24cef1=0x0;for(const _0x368764 of this['itemsViews']){if(_0x3324c9){const _0x5626b0=_0x368764['isMatching'](_0x3324c9);_0x368764['isVisible']=!!_0x5626b0,_0x368764['highlightText'](_0x3324c9);}else _0x368764['isVisible']=!0x0,_0x368764['highlightText'](null);_0x368764['isVisible']&&_0x24cef1++;}return this['isVisible']=_0x24cef1>0x0,{'resultsCount':_0x24cef1,'totalItemsCount':_0x42e982};}['getItem'](_0x415d7d){return this['itemsViews']['find'](_0x37dcde=>_0x37dcde['id']===_0x415d7d);}['removeItem'](_0x5b401d){const _0x24578a=this['itemsViews']['indexOf'](_0x5b401d);-0x1!==_0x24578a&&(this['itemsViews']['splice'](_0x24578a,0x1),this['_itemsListView']['items']['remove'](_0x5b401d));}}class Bi extends/* #__PURE__ -- @preserve */
|
|
27
|
+
_0xac3e4d(_0x23b8c1){['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(_0x52df22,_0xbc61ae){super(_0x52df22);const _0x2ec7b1=this['bindTemplate'];this['set']('isEdit',!0x1),this['set']('isVisible',!0x0),this['set']('pinned',!!_0xbc61ae['pinned']),this['set']('loadingState',null),this['id']=_0xbc61ae['id'];const {title:_0x4e34a1,createdAt:_0x1dd494,active:_0x3c0c43=!0x1}=_0xbc61ae;this['_titleView']=new _0x5bd3a5(),this['_titleView']['text']=_0x4e34a1,this['_titleView']['extendTemplate']({'attributes':{'class':['ck-ai-chat-history__item-title']}});const _0x5d4bfb=this['_createCheckView'](),_0x3b8d83=this['_createPinButtonView'](_0x52df22),_0x5d4231=this['_createMenuDropdownView'](),_0xafbddc=this['_createEditInputView'](_0x52df22,_0x4e34a1),_0x2394b6=this['_createAcceptEditButtonView'](_0x52df22,_0xafbddc),_0x555abb=this['_createCancelEditButtonView'](_0x52df22,_0xafbddc);this['actions']=this['createCollection'](),this['mainContent']=this['createCollection'](),this['mainContent']['add'](this['_titleView']),this['actions']['add'](_0x3b8d83),this['actions']['add'](_0x5d4231),this['on']('change:isEdit',(_0x41a1a2,_0x4a36b3,_0x137f51)=>{this['actions']['clear'](),this['mainContent']['clear'](),_0x137f51?(this['actions']['add'](_0x2394b6),this['actions']['add'](_0x555abb),this['mainContent']['add'](_0xafbddc),_0xafbddc['element']['focus']()):(this['actions']['add'](_0x3b8d83),this['actions']['add'](_0x5d4231),this['mainContent']['add'](this['_titleView']));}),this['setTemplate']({'tag':'li','attributes':{'class':['ck-ai-chat-history__item',_0x3c0c43?'ck-ai-chat-history__item--active':'',_0x2ec7b1['if']('isVisible','ck-hidden',_0x3d4664=>!_0x3d4664),_0x2ec7b1['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',_0x2ec7b1['if']('loadingState','ck-hidden',_0x476ab0=>!!_0x476ab0)]},'children':_0x3c0c43?[_0x5d4bfb]:[]},{'tag':'div','attributes':{'class':['ck-ai-loader',_0x2ec7b1['if']('loadingState','ck-hidden',_0xc91b0a=>!_0xc91b0a)]},'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',_0x2ec7b1['if']('loadingState','ck-hidden',_0x27f6c1=>!!_0x27f6c1)]},'children':this['mainContent']},{'tag':'div','attributes':{'class':['ck-ai-loader__text',_0x2ec7b1['if']('loadingState','ck-hidden',_0x3917ec=>!_0x3917ec)]},'children':[{'text':_0x2ec7b1['to']('loadingState',_0xdad255=>_0xdad255?i(this['locale'],Bi['LOADING_LABELS'][_0xdad255]):'')}]}]},{'tag':'span','attributes':{'class':['ck-ai-chat-history__item-date']},'children':[_0x1dd494]}]},{'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'](_0x160546){this['_titleView']['text']=_0x2fa641(_0x160546);}['updateLoadingState'](_0x3864b6,_0x13e896){this['set']('loadingState',_0x13e896?_0x3864b6:null);}['_createCheckView'](){const _0x4aabf2=new _0x2fc344();return _0x4aabf2['set']({'content':_0x42c617}),_0x4aabf2;}['_createPinButtonView'](_0x5491ff){const _0x2a33da=new _0x4421de(_0x5491ff);return _0x2a33da['set']({'label':i(_0x5491ff,'AI_CHAT_HISTORY_PIN_BUTTON'),'icon':_0x4cf526,'withText':!0x1,'tooltip':!0x0}),_0x2a33da['bind']('isOn')['to'](this,'pinned'),_0x2a33da['on']('execute',()=>{const _0x4c00d9=!this['pinned'];this['fire']('setConversationPinned',{'id':this['id'],'pinned':_0x4c00d9});}),_0x2a33da;}['_createMenuDropdownView'](){const _0x5188dc=_0x336a05(this['locale'],_0x52ce4c),_0x2a265f=_0x5188dc['panelView']['children'];_0x5188dc['buttonView']['set']({'label':i(this['locale'],'AI_CHAT_HISTORY_SHOW_MORE_ITEMS'),'icon':_0x510a1e}),_0x5188dc['panelPosition']='sw';const _0x151458=new _0x4421de(this['locale']);_0x151458['label']=i(this['locale'],'AI_CHAT_HISTORY_EDIT_NAME'),_0x151458['withText']=!0x0,_0x151458['on']('execute',()=>{this['isEdit']=!0x0;});const _0x28d031=new _0x4421de(this['locale']);_0x28d031['label']=i(this['locale'],'AI_CHAT_HISTORY_REMOVE'),_0x28d031['withText']=!0x0,_0x28d031['on']('execute',()=>{this['showConfirm'](i(this['locale'],'AI_CHAT_HISTORY_REMOVE_CONFIRM'),this['element'])['then'](()=>{this['fire']('removeConversation',{'id':this['id']});});});const _0x4123d3=new _0x4bb2ce(this['locale']),_0x229b13=new _0x23b8c1(this['locale']);_0x229b13['children']['add'](_0x151458);const _0x201033=new _0x23b8c1(this['locale']);return _0x201033['children']['add'](_0x28d031),_0x4123d3['items']['addMany']([_0x229b13,_0x201033]),_0x2a265f['add'](_0x4123d3),_0x5188dc;}['_createEditInputView'](_0x5cd0c6,_0x5968a2){const _0x2469a8=new _0x38b367(_0x5cd0c6),_0x18164b=_0x2469a8['bindTemplate'];return _0x2469a8['value']=_0x5968a2,_0x2469a8['extendTemplate']({'on':{'keydown':_0x18164b['to'](_0x29fa6f=>{'Enter'==_0x29fa6f['key']&&this['_commitEditInputValue'](_0x2469a8);})}}),_0x2469a8;}['_createAcceptEditButtonView'](_0x33d681,_0x32c327){const _0x4b5426=new _0x4421de(_0x33d681);return _0x4b5426['set']({'icon':_0x42c617,'withText':!0x1,'tooltip':i(_0x33d681,'AI_CHAT_HISTORY_ACCEPT')}),_0x4b5426['extendTemplate']({'attributes':{'class':['ck-confirm-view-submit']}}),_0x4b5426['on']('execute',()=>{this['_commitEditInputValue'](_0x32c327);}),_0x4b5426;}['_commitEditInputValue'](_0x1d945a){const _0x3afa96=_0x1d945a['element']['value']||'';this['_titleView']['text']=_0x3afa96,this['isEdit']=!0x1,this['fire']('editConversationTitle',{'id':this['id'],'title':_0x3afa96});}['_createCancelEditButtonView'](_0xff5c53,_0x241c0c){const _0xb68e7f=new _0x4421de(_0xff5c53);return _0xb68e7f['set']({'icon':_0x3cff34,'withText':!0x1,'tooltip':i(_0xff5c53,'AI_CHAT_HISTORY_CANCEL')}),_0xb68e7f['extendTemplate']({'attributes':{'class':['ck-confirm-view-cancel']}}),_0xb68e7f['on']('execute',()=>{this['isEdit']=!0x1,_0x241c0c['value']=this['_titleView']['text']||'',this['fire']('edit:cancel');}),_0xb68e7f;}['_createSpinnerView'](){const _0x10e1ba=new vi('tiny');return _0x10e1ba['isVisible']=!0x0,_0x10e1ba;}['isMatching'](_0x43484b){return this['_titleView']&&'string'==typeof this['_titleView']['text']&&this['_titleView']['text']['match'](_0x43484b)?{'title':!0x0}:null;}['highlightText'](_0x5b3115){this['_titleView']['highlightText'](_0x5b3115);}}class wt extends _0x3ddefc{['searchView'];['mainErrorView'];['skeletonView'];['emptyView'];['sectionsView'];['resizeButton'];constructor(_0x13afbf,_0x4bfc4c){super(_0x13afbf),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 _0xb800ab=new _0xa16c5(_0x13afbf,{'label':i(_0x13afbf,'AI_CHAT_HISTORY_HEADING'),'icon':Nt,'class':'ck-ai-header\x20ck-ai-header_history'});_0x4bfc4c&&(this['resizeButton']=us(_0x13afbf,this),_0xb800ab['children']['add'](this['resizeButton'])),this['sectionsView']=new Di(_0x13afbf,[]),this['sectionsView']['delegate'](...Fi)['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',_0x255f23=>!_0x255f23)]}}),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':[_0xb800ab,{'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 _0xe8230f=new _0x4b2da7(this['locale'],{'filteredView':this['sectionsView'],'queryView':{'label':i(this['locale'],'AI_CHAT_HISTORY_SEARCH_LABEL')},'infoView':{'text':{'notFound':{'primary':_0x48927a=>i(this['locale'],'AI_CHAT_HISTORY_SEARCH_NOT_FOUND_PRIMARY',_0x48927a),'secondary':i(this['locale'],'AI_CHAT_HISTORY_SEARCH_NOT_FOUND_SECONDARY')}}}}),_0x567f74=this['_createErrorView']();return _0x567f74['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('errorMessage','ck-hidden',_0xa2a24=>!_0xa2a24)]}}),_0xe8230f['on']('render',()=>{_0xe8230f['children']['add'](_0x567f74,0x1);}),_0xe8230f['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isSearchViewVisible','ck-hidden',_0x4a9052=>!_0x4a9052)]}}),_0xe8230f;}['_createSkeletonView'](){const _0x18d146=new di(this['locale'],ki['aiHistory']);return _0x18d146['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isLoading','ck-hidden',_0x22eb82=>!_0x22eb82)]}}),_0x18d146;}['_createErrorView'](){const _0x15ecfe=new _0x3ddefc(this['locale']),_0x4345af=new _0x4421de(this['locale']);_0x4345af['set']({'withText':!0x1,'icon':_0x3cff34,'class':'ck-ai-notification_error__dismiss-button'}),_0x4345af['bind']('isVisible')['to'](this,'hasItems',_0x59d4e3=>!!_0x59d4e3),_0x4345af['on']('execute',()=>{this['errorMessage']='';});const _0x1a1299=this['bindTemplate'];return _0x15ecfe['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-notification','ck-ai-notification_error']},'children':[{'tag':'p','children':[{'text':_0x1a1299['to']('errorMessage')}]},_0x4345af]}),_0x15ecfe;}['_createEmptyStateView'](){const _0x2da8e7=new _0x4421de(this['locale']);_0x2da8e7['set']({'label':i(this['locale'],'AI_CHAT_LABEL_NEW_CHAT'),'withText':!0x0,'icon':_0x56e5bc,'class':'ck-ai-chat__start-conversation'}),_0x2da8e7['on']('execute',()=>{this['fire']('openChat');});const _0x277dae=new _0x3ddefc(this['locale']);return _0x277dae['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-history__empty',this['bindTemplate']['if']('isEmptyViewVisible','ck-hidden',_0x266ebb=>!_0x266ebb)]},'children':[{'tag':'p','attributes':{'class':['ck-ai-chat-history__empty-message']},'children':[i(this['locale'],'AI_CHAT_HISTORY_EMPTY_MESSAGE')]},_0x2da8e7]}),_0x277dae;}['_createListItemViews'](_0x3c1a93,_0x25d5fa){const _0x338cfd=[];for(const _0x1ea795 of _0x3c1a93){const _0x1f68ee=new Bi(_0x25d5fa,_0x1ea795);_0x1f68ee['delegate'](...Fi)['to'](this),_0x338cfd['push'](_0x1f68ee);}return _0x338cfd;}['updateHistoryItemsWithCategories'](_0x37347e){const _0x497d83=this['locale']||'en',_0x30161a=[];for(const _0x1e487e of _0x37347e){const _0x297acd=this['_createListItemViews'](_0x1e487e['items'],_0x497d83);_0x30161a['push'](new zi(_0x497d83,{'title':_0x1e487e['title'],'items':_0x297acd}));}this['sectionsView']['sections']=_0x30161a,this['sectionsView']['items']['clear'](),this['sectionsView']['items']['addMany'](_0x30161a),this['hasItems']=_0x37347e['some'](_0x2ddee8=>_0x2ddee8['items']['length']>0x0),this['_refreshSearch']();}['removeHistoryItem'](_0x2b1414){for(const _0xb5987e of this['sectionsView']['sections']){const _0x3109bc=_0xb5987e['getItem'](_0x2b1414);if(_0x3109bc){if(_0xb5987e['removeItem'](_0x3109bc),0x0===_0xb5987e['itemsViews']['length']){const _0x5a8392=this['sectionsView']['sections']['indexOf'](_0xb5987e);-0x1!==_0x5a8392&&(this['sectionsView']['sections']['splice'](_0x5a8392,0x1),this['sectionsView']['items']['remove'](_0xb5987e));}this['hasItems']=this['sectionsView']['sections']['length']>0x0,this['_refreshSearch']();break;}}}['updateItemTitle'](_0x2cf5e3,_0x4135f5){for(const _0x40e423 of this['sectionsView']['sections']){const _0x384d01=_0x40e423['getItem'](_0x2cf5e3);if(_0x384d01){_0x384d01['updateTitle'](_0x4135f5);break;}}}['updateItemLoadingState'](_0x522711,_0x532932,_0x22474c){for(const _0x1861c1 of this['sectionsView']['sections']){const _0x47066f=_0x1861c1['getItem'](_0x522711);if(_0x47066f){_0x47066f['updateLoadingState'](_0x532932,_0x22474c);break;}}}['_refreshSearch'](){if(this['hasItems']){const _0x2f33b7=this['searchView']['queryView']['fieldView']?.['element']?.['value']||'';this['searchView']['search'](_0x2f33b7);}}}const Fi=['showConversationHistory','removeConversation','editConversationTitle','setConversationPinned','selectConversation','openChat','resizeTabs'];class xt extends _0x3b66f2{static get['requires'](){return[pt];}['_historyView'];static get['pluginName'](){return'AIChatHistoryUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x519942){super(_0x519942);const _0x53e6ba=this['context']['plugins']['get']('AITabs');this['_historyView']=new wt(this['context']['locale'],_0x53e6ba['showResizeButton']),this['_historyView']['delegate'](...Fi)['to'](this),_0x53e6ba['view']['addTab']({'id':'history','buttonLabel':i(this['context']['locale'],'AI_CHAT_HISTORY_HEADING'),'buttonIcon':Nt,'order':0x0,'content':this['_historyView']});}['removeHistoryItem'](_0x21d938){this['_historyView']['removeHistoryItem'](_0x21d938);}['updateItems'](_0x51168e){this['_historyView']['updateHistoryItemsWithCategories'](_0x51168e);}['updateItemTitle'](_0x48e4e9,_0x49a127){this['_historyView']['updateItemTitle'](_0x48e4e9,_0x49a127);}['updateItemLoadingState'](_0x4d3b99,_0x951dfd,_0x10e0e8){this['_historyView']['updateItemLoadingState'](_0x4d3b99,_0x951dfd,_0x10e0e8);}['setLoadingSkeleton'](_0x35976d){this['_historyView']['isLoading']=_0x35976d;}['showError'](_0x148cf7){this['_historyView']['errorMessage']=_0x148cf7;}['hideError'](){this['_historyView']['errorMessage']='';}['setIsMaximized'](_0xbc0e65){this['_historyView']['isMaximized']=_0xbc0e65;}}class nr extends ts(){['id'];['createdAt'];constructor({id:_0x828cda,title:_0x2da6ee,createdAt:_0xe75abf,updatedAt:_0x276ced,pinned:_0xfdf76c}){super(),this['id']=_0x828cda,this['createdAt']=new Date(_0xe75abf),this['set']('title',_0x2da6ee),this['set']('updatedAt',_0x276ced?new Date(_0x276ced):null),this['set']('pinned',_0xfdf76c||!0x1);}['updateTitle'](_0x17f717){this['set']('title',_0x2fa641(_0x17f717)),this['updatedAt']=new Date();}['updatePinned'](_0x59e692){this['set']('pinned',_0x59e692),this['updatedAt']=new Date();}}class Ht extends _0x428ca4(){['items']=[];['connector'];['group'];constructor({connector:_0x15024a,group:_0x4e66bc}){super(),this['connector']=_0x15024a,this['group']=_0x4e66bc;}async['init'](){try{const _0x5f2614=this['connector']['fetchConversations'](this['group']),_0x44341d=await _0x5f2614['getConversations']();this['loadItems'](_0x44341d);}catch(_0x3c60e1){this['fire']('error',{'error':_0x3c60e1,'operation':'init'});}}['addItem'](_0x244bf5){this['items']['push'](_0x244bf5);}async['removeItem'](_0x2e3e33){const _0x2b873d=this['items']['findIndex'](_0x427316=>_0x427316['id']===_0x2e3e33);if(-0x1===_0x2b873d)return!0x1;try{return await this['connector']['deleteConversation'](_0x2e3e33)['execute'](),this['items']['splice'](_0x2b873d,0x1),this['fire']('itemRemoved',{'itemId':_0x2e3e33}),!0x0;}catch(_0x1a9db0){return this['fire']('error',{'error':_0x1a9db0,'operation':'removeItem','itemId':_0x2e3e33}),!0x1;}}['getItem'](_0x247c94){return this['items']['find'](_0x1e008f=>_0x1e008f['id']===_0x247c94);}async['updateItemTitle'](_0x229205,_0x405eca){const _0x572e73=this['getItem'](_0x229205);if(!_0x572e73)return!0x1;try{return await this['connector']['updateConversation'](_0x229205,{'title':_0x405eca})['getResult'](),_0x572e73['updateTitle'](_0x405eca),this['fire']('itemUpdated',{'itemId':_0x229205,'updates':{'title':_0x405eca}}),!0x0;}catch(_0x11f4bd){return this['fire']('error',{'error':_0x11f4bd,'operation':'updateItemTitle','itemId':_0x229205}),!0x1;}}async['updateItemPinned'](_0x4624ed,_0x1127b8){const _0x13eac3=this['getItem'](_0x4624ed);if(!_0x13eac3)return!0x1;try{return await this['connector']['updateConversation'](_0x4624ed,{'pinned':_0x1127b8})['getResult'](),_0x13eac3['updatePinned'](_0x1127b8),this['fire']('itemUpdated',{'itemId':_0x4624ed,'updates':{'pinned':_0x1127b8}}),!0x0;}catch(_0x1ccaa4){return this['fire']('error',{'error':_0x1ccaa4,'operation':'updateItemPinned','itemId':_0x4624ed}),!0x1;}}['loadItems'](_0x27dfe2){try{this['items']=[],_0x27dfe2['map'](_0x3c5014=>{this['addItem'](new nr(_0x3c5014));}),this['fire']('itemsLoaded',{'items':[...this['items']]});}catch(_0x43f75f){this['fire']('error',{'error':_0x43f75f,'operation':'loadItems'});}}['getItems'](_0x5cd7d7={}){const _0x201da6=void 0x0!==_0x5cd7d7['pinned']&&_0x5cd7d7['pinned'],_0x427943=_0x5cd7d7['from']?new Date(_0x5cd7d7['from']['getFullYear'](),_0x5cd7d7['from']['getMonth'](),_0x5cd7d7['from']['getDate']()):null,_0x5e922e=_0x5cd7d7['to']?new Date(_0x5cd7d7['to']['getFullYear'](),_0x5cd7d7['to']['getMonth'](),_0x5cd7d7['to']['getDate']()):null;return this['items']['filter'](_0x4ebd1a=>{if(_0x4ebd1a['pinned']!==_0x201da6)return!0x1;if(_0x5e922e){const _0x883100=new Date(_0x4ebd1a['createdAt']['getFullYear'](),_0x4ebd1a['createdAt']['getMonth'](),_0x4ebd1a['createdAt']['getDate']());return _0x427943?_0x427943['getTime']()===_0x5e922e['getTime']()?_0x883100['getTime']()===_0x427943['getTime']():_0x883100<_0x5e922e&&_0x883100>=_0x427943:_0x883100<_0x5e922e;}return!0x0;});}}class jt extends _0x3b66f2{['_aiConnector'];['_aiChatHistoryUi'];['_aiChatController'];static get['requires'](){return[q,at,xt,pt];}static get['pluginName'](){return'AIChatHistoryController';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){this['_aiConnector']=this['context']['plugins']['get'](q),this['_aiChatHistoryUi']=this['context']['plugins']['get'](xt),this['_aiChatController']=this['context']['plugins']['get'](at);const _0x97b958=this['context']['plugins']['get'](pt);try{const _0x349249=this['_aiChatController']['getGroupId']();this['history']=new Ht({'connector':this['_aiConnector'],'group':_0x349249}),this['listenTo'](this['_aiChatHistoryUi'],'removeConversation',(_0x3b93d1,_0x2ba383)=>{this['_setItemLoading'](_0x2ba383['id'],'remove'),this['_handleRemove'](_0x2ba383['id']);}),this['listenTo'](this['_aiChatHistoryUi'],'editConversationTitle',(_0x4de9c5,_0x460c97)=>{this['_setItemLoading'](_0x460c97['id'],'rename'),this['_handleEditTitle'](_0x460c97['id'],_0x460c97['title']);}),this['listenTo'](this['history'],'itemUpdated',(_0x27a9ad,_0x3f27da)=>{void 0x0!==_0x3f27da['updates']['title']&&this['_aiChatHistoryUi']['updateItemTitle'](_0x3f27da['itemId'],_0x3f27da['updates']['title']),void 0x0!==_0x3f27da['updates']['pinned']&&this['_updateHistoryItemsUI'](),this['_clearItemLoading'](_0x3f27da['itemId']);}),this['listenTo'](this['history'],'itemRemoved',(_0xcbd153,_0xd991b7)=>{this['_aiChatController']['handleRemovedConversation'](_0xd991b7['itemId']),this['_aiChatHistoryUi']['removeHistoryItem'](_0xd991b7['itemId']),this['_clearItemLoading'](_0xd991b7['itemId']);}),this['listenTo'](this['history'],'itemsLoaded',()=>{this['_updateHistoryItemsUI']();}),this['listenTo'](this['history'],'error',(_0x2c73bd,_0x219b49)=>{this['_handleHistoryErrorUI'](_0x219b49['error'],_0x219b49['operation'],_0x219b49['itemId']);}),this['listenTo'](this['_aiChatHistoryUi'],'selectConversation',(_0x37964e,_0x1da65b)=>{this['_handleSelectConversation'](_0x1da65b['id']);}),this['listenTo'](this['_aiChatHistoryUi'],'setConversationPinned',(_0x4a64f8,_0x1dee1e)=>{const _0x330a4b=_0x1dee1e['pinned']?'pin':'unpin';this['_setItemLoading'](_0x1dee1e['id'],_0x330a4b),this['_handleTogglePin'](_0x1dee1e['id'],_0x1dee1e['pinned']);}),this['listenTo'](this['_aiChatHistoryUi'],'openChat',()=>{_0x97b958['view']['activateTab']('chat');}),this['listenTo'](this['_aiChatController'],'change:activeConversation',()=>{this['_updateHistoryItemsUI']();}),_0x97b958['view']['on']('activateTab:history',()=>{this['_showConversationHistory']();}),this['listenTo'](_0x97b958,'resizedTabs',(_0x5b46f7,_0x2c9f20)=>{this['_setIsMaximized'](_0x2c9f20);}),this['listenTo'](this['_aiChatHistoryUi'],'resizeTabs',()=>{_0x97b958['resize']();});}catch(_0x10fbe4){this['_handleHistoryErrorUI'](_0x10fbe4,'init');}}async['_handleEditTitle'](_0x27f9e3,_0x37bad7){await this['history']['updateItemTitle'](_0x27f9e3,_0x37bad7);}async['_handleTogglePin'](_0x3c5f74,_0x1545ab){await this['history']['updateItemPinned'](_0x3c5f74,_0x1545ab);}async['_handleRemove'](_0x5d3a8e){await this['history']['removeItem'](_0x5d3a8e);}async['_handleSelectConversation'](_0x58babd){await this['_aiChatController']['loadConversation'](_0x58babd);}async['_showConversationHistory'](){this['_aiChatHistoryUi']['showError'](''),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x0),await this['history']['init'](),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x1);}['_updateHistoryItemsUI'](){const _0x315115=this['_aiChatController']['activeConversation']?.['id'],_0x2d31a9=this['_getCategorizedItems']()['map'](_0x496481=>({'title':_0x496481['title'],'items':_0x496481['items']['map'](_0x50f43b=>({'id':_0x50f43b['id'],'title':_0x50f43b['title']||i(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION'),'createdAt':new Date(_0x50f43b['createdAt'])['toLocaleDateString'](),'active':_0x50f43b['id']===_0x315115,'pinned':_0x50f43b['pinned']}))}));this['_aiChatHistoryUi']['updateItems'](_0x2d31a9);}['_setItemLoading'](_0x2c06a3,_0x25af76){this['_aiChatHistoryUi']['updateItemLoadingState'](_0x2c06a3,_0x25af76,!0x0);}['_clearItemLoading'](_0xd20b0a){this['_aiChatHistoryUi']['updateItemLoadingState'](_0xd20b0a,null,!0x1);}['_handleHistoryErrorUI'](_0x428b4e,_0x3168ed,_0x16bf95){const _0x1a4df6=this['_generateErrorMessage'](_0x3168ed,_0x16bf95);this['_aiChatHistoryUi']['showError'](_0x1a4df6),_0x16bf95&&this['_clearItemLoading'](_0x16bf95),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x1);}['_generateErrorMessage'](_0x18decd,_0x4f1ab7){const _0x270cf7=_0x4f1ab7?this['history']['getItem'](_0x4f1ab7):null,_0x5e5cda=_0x270cf7?.['title']||i(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION');switch(_0x18decd){case'updateItemTitle':return i(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_UPDATE_TITLE',_0x5e5cda);case'updateItemPinned':{const _0x310cca=i(this['context']['locale'],_0x270cf7?.['pinned']?'AI_CHAT_HISTORY_UNPIN_ACTION':'AI_CHAT_HISTORY_PIN_ACTION');return i(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_UPDATE_PINNED',[_0x310cca,_0x5e5cda]);}case'removeItem':return i(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_REMOVE_ITEM',_0x5e5cda);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 _0xbd564f=new Date(),_0x394e6e=new Date(_0xbd564f['getFullYear'](),_0xbd564f['getMonth'](),_0xbd564f['getDate']()),_0x59ab34=new Date(_0x394e6e);_0x59ab34['setDate'](_0x59ab34['getDate']()-0x1);const _0x178427=new Date(_0x394e6e);_0x178427['setDate'](_0x178427['getDate']()-0xe);const _0x17f876=this['history']['getItems']({'pinned':!0x0}),_0x2e2fa7=this['history']['getItems']({'from':_0x394e6e,'to':_0x394e6e}),_0x559e91=this['history']['getItems']({'from':_0x59ab34,'to':_0x59ab34}),_0x5491ab=this['history']['getItems']({'from':_0x178427,'to':_0x59ab34}),_0x3f548b=this['history']['getItems']({'to':_0x178427}),_0x4afe40=[];return _0x17f876['length']>0x0&&_0x4afe40['push']({'title':i(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_PINNED'),'items':_0x17f876}),_0x2e2fa7['length']>0x0&&_0x4afe40['push']({'title':i(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_TODAY'),'items':_0x2e2fa7}),_0x559e91['length']>0x0&&_0x4afe40['push']({'title':i(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_YESTERDAY'),'items':_0x559e91}),_0x5491ab['length']>0x0&&_0x4afe40['push']({'title':i(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_LAST_14_DAYS'),'items':_0x5491ab}),_0x3f548b['length']>0x0&&_0x4afe40['push']({'title':i(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_LATER'),'items':_0x3f548b}),_0x4afe40;}['_setIsMaximized'](_0x195dd4){this['_aiChatHistoryUi']['setIsMaximized'](_0x195dd4);}}class ht extends _0x3b66f2{static get['requires'](){return[jt,xt];}static get['pluginName'](){return'AIChatHistory';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class AIChat extends _0x3b66f2{static get['requires'](){return[at,D,ct,ht];}static get['pluginName'](){return'AIChat';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x4a38af){super(_0x4a38af),this['context']['config']['define']('ai.chat.context',{'document':{'enabled':!0x0},'urls':{'enabled':!0x0},'files':{'enabled':!0x0},'sources':[]}),this['context']['config']['define']('ai.chat.initialConversation','new');}async['addSelectionToChatContext'](){await this['context']['plugins']['get'](at)['addSelectionToChatContext']();}async['startConversation'](){await this['context']['plugins']['get'](at)['startConversation']();}async['sendMessage']({message:_0x56afcb,attributes:_0x2b5eac}){await this['context']['plugins']['get'](at)['sendMessage']({'message':_0x56afcb,'attributes':_0x2b5eac});}['removeSelectionFromChatContext'](){this['context']['plugins']['get'](at)['removeSelectionFromChatContext']();}['focusPromptInput'](){this['context']['plugins']['get'](at)['focusPromptInput']();}['registerToolDataCallback'](_0x19ce92){this['context']['plugins']['get'](at)['_registerToolDataCallback'](_0x19ce92);}}class ws extends _0x4421de{['id'];constructor(_0x2dda0f,_0x9af6e4){super(_0x2dda0f);const {id:_0x1f2b69,type:_0x9242a1,icon:_0x57b618}=_0x9af6e4;this['id']=_0x1f2b69,this['set']({'label':_0x9af6e4['label'],'withText':!0x0,'class':'ck-ai-chat-shortcut'}),this['extendTemplate']({'attributes':{'data-cke-ai-shortcut-id':_0x9af6e4['id']}}),_0x57b618?this['icon']=_0x57b618:'chat'===_0x9242a1?this['icon']=_0x32ec39:'review'===_0x9242a1?this['icon']=_0x58872b:'translate'===_0x9242a1&&(this['icon']=Vt);}}class kt extends _0x3ddefc{['listView'];constructor(_0x351605,_0x53d90a){super(_0x351605);const _0x3816cb=_0x53d90a['map'](_0x4b8343=>{const _0x3e4799=new _0x23b8c1(this['locale']),_0x204863=new ws(this['locale'],_0x4b8343);return _0x3e4799['children']['add'](_0x204863),_0x204863['delegate']('execute')['to'](this),_0x3e4799;});this['listView']=new _0x4bb2ce(this['locale']),this['listView']['items']['addMany'](_0x3816cb),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat-shortcuts']},'children':[this['listView']]});}}const Ut='chat-shortcuts';var ka=function(_0x2e4c8a){return _0x2e4c8a['CHAT']='chat',_0x2e4c8a['REVIEW']='review',_0x2e4c8a['TRANSLATE']='translate',_0x2e4c8a;}({});class AIChatShortcuts extends _0x3b66f2{['_shortcuts'];['_shortcutsView'];['_aiChatUI'];static get['requires'](){return[ct];}static get['pluginName'](){return'AIChatShortcuts';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){this['_aiChatUI']=this['context']['plugins']['get'](ct),this['_shortcuts']=this['context']['config']['get']('ai.chat.shortcuts')??[];const _0xbc25ed=this['context']['plugins']['get']('AIChatController');this['_shortcuts']['length']&&(this['_validateShortcuts'](),this['_aiChatUI']['on']('conversationCreated',()=>{_0xbc25ed['activeConversation']['isFromHistory']||this['_injectShortcuts']();}),this['listenTo'](_0xbc25ed,'interactionStarted',()=>{this['_removeShortcuts']();}));}['_validateShortcuts'](){const _0x383fe7=Object['values'](ka);this['_shortcuts']['forEach'](_0x264367=>{let _0x16b997=!0x0;if(_0x264367['id']&&_0x264367['label']&&_0x383fe7['includes'](_0x264367['type'])?'chat'===_0x264367['type']&&(_0x16b997='string'==typeof _0x264367['prompt']):_0x16b997=!0x1,!_0x16b997)throw new _0x2ae61f('ai-chat-shortcuts-invalid-config',this['context'],{'shortcut':_0x264367});});}['_injectShortcuts'](){const _0x3b6266=this['context']['plugins']['get'](ct);this['_shortcutsView']=new kt(this['context']['locale'],this['_shortcuts']),this['_shortcutsView']['render'](),_0x3b6266['addFeedItemCustomElement'](this['_shortcutsView']['element'],Ut),this['_shortcutsView']['on']('execute',_0x23851c=>{const _0x120266=_0x23851c['source']['id'];this['_executeShortcut'](_0x120266);});}['_removeShortcuts'](){const _0x292815=this['context']['plugins']['get'](ct);_0x292815['hasFeedItem'](Ut)&&_0x292815['removeFeedItem'](Ut),this['_shortcutsView']?.['destroy']();}['_executeShortcut'](_0x47cc1f){const _0x2ed9cf=this['_shortcuts']['find'](_0x21930c=>_0x21930c['id']===_0x47cc1f),_0x53c23d=_0x2ed9cf['type'];'chat'===_0x53c23d?this['_runChatShortcut'](_0x2ed9cf):'review'===_0x53c23d?_0x2ed9cf['check']?this['_runReviewShortcut'](_0x2ed9cf):this['_switchTab']('reviewMode'):'translate'===_0x53c23d&&(_0x2ed9cf['language']?this['_runTranslateShortcut'](_0x2ed9cf):this['_switchTab']('translate'));}['_switchTab'](_0x3426f9){if(!this['context']['plugins']['has']('AITabs'))throw new _0x2ae61f('ai-chat-shortcuts-ai-tabs-not-found',this['context'],{'tabName':_0x3426f9});this['context']['plugins']['get']('AITabs')['view']['activateTab'](_0x3426f9);}async['_runChatShortcut']({prompt:_0x3d0556,draftMode:_0x3137d1,useWebSearch:_0x2f18d9=!0x1,useReasoning:_0x21cf6c=!0x1,model:_0x389934}){const _0x2aa1e6=this['context']['plugins']['get']('AIChat'),_0x265f1a=this['context']['plugins']['get']('AIChatController'),_0x1cc357=_0x265f1a['activeConversation'];let _0x5bbc9d;_0x5bbc9d=_0x389934?await _0x1cc357['chatModels']['getModel'](_0x389934):await _0x1cc357['chatModels']['getDefault'](),_0x5bbc9d&&await _0x1cc357['setModel'](_0x5bbc9d),_0x1cc357['setWebSearch'](_0x2f18d9),_0x1cc357['setReasoning'](_0x21cf6c),_0x265f1a['addCurrentDocumentToChatContext'](),_0x3137d1?(this['_aiChatUI']['setPromptInputValue'](_0x3d0556),this['_aiChatUI']['focusPromptInput'](!0x0)):_0x2aa1e6['sendMessage']({'message':_0x3d0556});}['_runReviewShortcut']({check:_0x8e42a2,model:_0x813dbc,prompt:_0x4c6898,params:_0x34962a}){if(!this['context']['plugins']['has']('AIReviewModeUI'))throw new _0x2ae61f('ai-chat-shortcuts-review-mode-not-found',this['context']);this['_switchTab']('reviewMode');const _0x13cde0={'id':_0x8e42a2,'isCustom':'custom'===_0x8e42a2};_0x813dbc&&_0x4c6898&&(_0x13cde0['args']={'model':_0x813dbc,'prompt':_0x4c6898}),_0x34962a&&(_0x13cde0['params']=_0x34962a),this['context']['plugins']['get']('AIReviewModeUI')['fire']('runReviewCheck',_0x13cde0);}['_runTranslateShortcut']({language:_0xd2133c}){if(!this['context']['plugins']['has']('AITranslateUI'))throw new _0x2ae61f('ai-chat-shortcuts-translate-not-found',this['context']);this['_switchTab']('translate'),this['context']['plugins']['get']('AITranslateUI')['fire']('runReviewCheck',{'id':_0xd2133c,'args':{'language':_0xd2133c}});}}class io extends Lt{constructor(_0x53378b){super(_0x53378b);const _0xf868e6=_0x53378b['plugins']['get']('AITabs')['view'];this['bind']('value')['to'](_0xf868e6,'isVisible'),this['isEnabled']=!0x0;}['execute'](){const _0x2dc2a2=this['editor']['plugins']['get']('AITabs')['view'];_0x2dc2a2['isVisible']=!_0x2dc2a2['isVisible'];}}class qt extends _0x2b80c4{static get['requires'](){return[pt];}static get['pluginName'](){return'AIToggleButtonUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x4d2001=this['editor'];_0x4d2001['commands']['add']('toggleAi',new io(_0x4d2001)),_0x4d2001['ui']['componentFactory']['add']('toggleAi',()=>{const _0x298dff=this['_createAIUIButton'](_0x4421de);return _0x298dff['set']({'tooltip':!0x0,'class':'ck-ai-toggle-button'}),_0x298dff;}),_0x4d2001['ui']['componentFactory']['add']('menuBar:toggleAi',()=>{const _0x431292=this['_createAIUIButton'](_0x2a3f0d);return _0x431292['set']({'role':'menuitemcheckbox'}),_0x431292;});}['_createAIUIButton'](_0x3d53c5){const _0x3e537a=this['editor'],_0x39b165=_0x3e537a['commands']['get']('toggleAi'),_0x35d435=new _0x3d53c5(_0x3e537a['locale']);return _0x35d435['set']({'label':i(_0x3e537a['locale'],'AI_TOGGLE_BUTTON_LABEL'),'icon':_0x5f5820,'isToggleable':!0x0}),_0x35d435['bind']('isEnabled')['to'](_0x39b165),_0x35d435['bind']('isOn')['to'](_0x39b165,'value',_0x820c36=>!!_0x820c36),this['listenTo'](_0x35d435,'execute',()=>{_0x39b165['execute']();}),_0x35d435;}}const F=['applySuggestion','insertSuggestion','showNext','showPrevious'];class pi extends _0x3ddefc{['_errorView'];constructor(_0x1e77fc){super(_0x1e77fc),this['set']('_errorMessage',''),this['set']('_isErrorVisible',!0x1);}['showBlockingError'](_0x1026f3){this['showError'](_0x1026f3);}['showError'](_0x3752bb){this['_errorView']||(this['_errorView']=this['_createErrorView']()),this['_errorMessage']=_0x3752bb,this['_isErrorVisible']=!0x0;}['hideError'](){this['_isErrorVisible']=!0x1;}['_createErrorView'](){const _0x15a46d=new _0x3ddefc(this['locale']),_0x140bd7=new _0x3ddefc(this['locale']);return _0x140bd7['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-suggestion__error-text']},'children':[{'text':this['bindTemplate']['to']('_errorMessage')}]}),_0x15a46d['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__error','ck-ai-balloon-error',this['bindTemplate']['if']('_isErrorVisible','ck-hidden',_0x1dcc72=>!_0x1dcc72)]},'children':[_0x140bd7]}),_0x15a46d;}}const $=0xa;class Q extends _0x3b66f2{static get['requires'](){return[D];}static get['pluginName'](){return'AIBalloon';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['isOpen']=!0x1;['_currentConfig'];['_isUpdatingMarkers']=!0x1;['open'](_0x13cc5e){const {id:_0x468475}=this['_currentConfig']??{};this['_currentConfig']=_0x13cc5e;const {id:_0x4bf12c}=this['_currentConfig'];this['isOpen']&&_0x468475===_0x4bf12c?this['_updateDialog']():this['_showDialog']();}['close'](){const _0x231ec4=T(this['context'])['plugins']['get']('Dialog');_0x231ec4['isOpen']&&this['_currentConfig']&&_0x231ec4['id']===this['_currentConfig']['id']&&_0x231ec4['hide']();}['_updateDialog'](){const _0x31c7f9=T(this['context'])['plugins']['get']('Dialog'),{icon:_0x36d1d3,title:_0x5822af}=this['_currentConfig'];_0x31c7f9['view']?.['headerView']&&(_0x31c7f9['view']['headerView']['label']=_0x5822af,_0x31c7f9['view']['headerView']['iconView']&&_0x36d1d3&&(_0x31c7f9['view']['headerView']['iconView']['content']=_0x36d1d3)),this['_isUpdatingMarkers']=!0x0,this['_showFakeVisualSelection'](),this['_isUpdatingMarkers']=!0x1,_0x31c7f9['view']?.['updatePosition']();}['_showFakeVisualSelection'](){this['context']['plugins']['get'](D)['showFakeVisualSelection'](this['_currentConfig']['ranges'],'ai-balloon-'+this['_currentConfig']['index'],!0x0,!0x0);}['_hideFakeVisualSelection'](_0x5bb23d){this['context']['plugins']['get'](D)['hideFakeVisualSelection']('ai-balloon-'+_0x5bb23d);}['_showDialog'](){const _0x306815=T(this['context'])['plugins']['get']('Dialog'),{id:_0x52dd3c,title:_0x2d5fad,icon:_0x57c35e,class:_0x10c41c,mainView:_0x52b9da}=this['_currentConfig'];_0x52b9da['delegate'](...F)['to'](this),_0x306815['show']({'title':_0x2d5fad,'icon':_0x57c35e,'hasCloseButton':!0x0,'id':_0x52dd3c,'position':this['_calculateDialogPosition']['bind'](this),'className':'ck-ai-balloon\x20'+(_0x10c41c||''),'content':_0x52b9da,'onShow':_0x36e8f1=>{this['_showFakeVisualSelection'](),this['_setupFakeVisualSelectionMarkerRemovalListener']();const _0x412480=this['_getSelectionElements']();_0x412480&&_0x412480[0x0]&&_0x3a4ed0({'target':_0x412480[0x0],'ancestorOffset':0x14,'alignToTop':!0x0,'viewportOffset':{'top':0x14,'bottom':0x14,'left':0x0,'right':0x0}}),this['isOpen']=!0x0,_0x36e8f1['once']('hide',()=>{this['fire']('beforeDialogClosed',{'id':_0x52dd3c});},{'priority':'high'});},'onHide':()=>{this['_hideFakeVisualSelection'](this['_currentConfig']['index']),this['_cleanupFakeVisualSelectionMarkerRemovalListener'](),this['fire']('dialogClosed',{'id':_0x52dd3c}),this['isOpen']=!0x1;}});}['_calculateDialogPosition'](_0x3fb43c,_0x2c1d53){if(!_0x2c1d53)return null;const _0x5539a1=this['_getSelectionElements']();if(!_0x5539a1||0x0===_0x5539a1['length'])return{'left':Math['round'](_0x2c1d53['left']+_0x2c1d53['width']/0x2-_0x3fb43c['width']/0x2),'top':Math['round'](_0x2c1d53['top']+_0x2c1d53['height']/0x2-_0x3fb43c['height']/0x2)};const _0x3e1f41=Math['round'](_0x2c1d53['left']+_0x2c1d53['width']/0x2-_0x3fb43c['width']/0x2),_0x499dd9=_0x5539a1['map'](_0x45283c=>new _0x4fa19a(_0x45283c)),_0x3321da=_0x3fb43c['height'];return{'left':_0x3e1f41,'top':this['_calculateOptimalTopPosition'](_0x499dd9,_0x3321da,_0x2c1d53)};}['_calculateOptimalTopPosition'](_0x4871a6,_0x52eda5,_0x2b83e4){const _0x3a0ff5=new _0x4fa19a(_0x18348f['window']),_0x151683=_0x4871a6['map'](_0x4f6f1e=>_0x4f6f1e['getVisible']())['filter'](_0x26310a=>_0x26310a),_0xa96ea0=_0x4fa19a['getBoundingRect'](_0x151683);if(!_0xa96ea0)return Math['round'](_0x2b83e4['top']+_0x2b83e4['height']/0x2);const _0x3a212e=_0x3a0ff5['getIntersection'](_0xa96ea0);if(!_0x3a212e)return Math['round'](_0x2b83e4['top']+_0x2b83e4['height']/0x2);const _0x4d733d=_0x2b83e4['getVisible'](),_0x214ba8=_0x4d733d&&_0xa96ea0['height']>_0x4d733d['height'],_0x506bb6=_0x3a212e['top'],_0x16ec8f=_0x3a212e['bottom'];if(_0x214ba8){const _0x7ce7ed=(_0x4d733d||_0x3a0ff5)['height']/0x2-_0x52eda5/0x2,_0x1f124a=_0x506bb6-$-_0x2b83e4['top'],_0x707573=_0x2b83e4['bottom']-_0x16ec8f-$;return _0x1f124a>=_0x52eda5?Math['max']($,_0x506bb6-_0x52eda5-$):_0x707573>=_0x52eda5?_0x16ec8f+$:Math['max']($,_0x7ce7ed);}const _0x1c0887=_0x506bb6-_0x52eda5,_0x12973b=_0x2b83e4['bottom']-_0x16ec8f-$,_0x5de2a2=_0x506bb6-$-_0x2b83e4['top'];let _0x3db283;if(_0x12973b>=_0x52eda5)_0x3db283=_0x16ec8f+$;else{if(_0x5de2a2>=_0x52eda5)_0x3db283=_0x1c0887-$;else _0x3db283=_0x506bb6+_0xa96ea0['height']/0x2-_0x52eda5/0x2;}return _0x3db283;}['_setupFakeVisualSelectionMarkerRemovalListener'](){const _0x5202fd=T(this['context']);this['listenTo'](_0x5202fd['model']['document'],'change',()=>{if(!this['_isUpdatingMarkers']){for(const {name:_0x490ce8,data:{newRange:_0x51fad8}}of _0x5202fd['model']['document']['differ']['getChangedMarkers']())if(_0x490ce8['startsWith'](R+':')&&(_0x51fad8&&(_0x51fad8['start']['isEqual'](_0x51fad8['end'])||'$graveyard'==_0x51fad8['root']['rootName'])||null==_0x51fad8)){const _0x475a51=i(this['context']['locale'],'AI_BALLOON_SELECTION_REMOVED_ERROR');this['_currentConfig']['mainView']['showBlockingError'](_0x475a51),this['fire']('selectionRemoved');}}});}['_cleanupFakeVisualSelectionMarkerRemovalListener'](){const _0x525ac7=T(this['context']);this['_currentConfig']['mainView']['hideError'](),this['stopListening'](_0x525ac7['model']['document']);}['_getSelectionElements'](){const _0x47623e=T(this['context']);return _0x2e47e4(_0x47623e['editing'],[..._0x47623e['model']['markers']['getMarkersGroup']('ai-selection'),..._0x47623e['model']['markers']['getMarkersGroup']('ai-balloon-selection')]);}}class wi extends _0x5be165{['copyButton'];['likeButton'];['dislikeButton'];['showChangesButton'];['_config'];constructor(_0x3df093,_0x3be00f={}){super(_0x3df093),this['set']('isEnabled',!0x0),this['set']('isShowChangesOn',!0x1),this['_config']={'showCopy':!0x1,'showLike':!0x1,'showDislike':!0x1,..._0x3be00f};const _0x2cb9dd=!(this['_config']['showCopy']||this['_config']['showChanges']||this['_config']['showLike']||this['_config']['showDislike']||this['_config']['customView']?.['length']);this['class']=_0x2cb9dd?'ck-ai-mini-toolbar\x20ck-hidden':'ck-ai-mini-toolbar',this['_config']['showCopy']&&(this['_setupCopyButton'](),this['items']['add'](this['copyButton'])),this['_config']['showChanges']&&(this['_setupShowChangesButton'](),this['items']['add'](this['showChangesButton'])),this['_setupRatingButtons'](),this['_config']['showLike']&&this['items']['add'](this['likeButton']),this['_config']['showDislike']&&this['items']['add'](this['dislikeButton']),this['_config']['customView']&&this['items']['addMany'](this['_config']['customView']);}['toggleShowChangesEnabled'](_0x2ef005){this['showChangesButton']['isEnabled']=_0x2ef005;}['_setupRatingButtons'](){this['likeButton']=new _0x4421de(this['locale']),this['likeButton']['set']({'icon':_0xd3e5b2,'label':i(this['locale'],'AI_MINI_TOOLBAR_LIKE'),'tooltip':!0x0}),this['likeButton']['bind']('isEnabled')['to'](this),this['likeButton']['on']('execute',()=>{this['fire']('like');}),this['dislikeButton']=new _0x4421de(this['locale']),this['dislikeButton']['set']({'icon':_0x5e1792,'label':i(this['locale'],'AI_MINI_TOOLBAR_DISLIKE'),'tooltip':!0x0}),this['dislikeButton']['bind']('isEnabled')['to'](this),this['dislikeButton']['on']('execute',()=>{this['fire']('dislike');});}['_setupCopyButton'](){this['copyButton']=new _0x4421de(this['locale']),this['copyButton']['set']({'icon':_0x254446,'label':i(this['locale'],'AI_MINI_TOOLBAR_COPY'),'class':'ck-ai-mini-toolbar-copy-button','tooltip':!0x0}),this['copyButton']['bind']('isEnabled')['to'](this);const _0x442614=new _0x2fc344();_0x442614['set']({'content':_0x4b7da9}),_0x442614['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'](_0x442614);}['_setupShowChangesButton'](){this['showChangesButton']=new _0x4421de(this['locale']),this['showChangesButton']['set']({'icon':_0x7022a4,'label':i(this['locale'],'AI_SUGGESTION_BUTTON_SHOW_CHANGES'),'withText':'full'==this['_config']['showChanges'],'tooltip':'full'!=this['_config']['showChanges'],'class':'ck-ai-button-tertiary'}),this['showChangesButton']['bind']('isOn')['to'](this,'isShowChangesOn'),this['showChangesButton']['bind']('isEnabled')['to'](this),this['showChangesButton']['bind']('icon')['to'](this,'isShowChangesOn',_0x136703=>_0x136703?_0x46b010:_0x7022a4),this['showChangesButton']['on']('execute',()=>{this['fire']('toggleShowChanges');});}}class lt extends pi{['children'];['nextButtonView'];['previousButtonView'];['focusCycler'];['_focusables'];['_focusTracker'];['_keystrokes'];['_config'];['_streamableContentView'];['_toolbarContainerView'];['_partToolbarView'];['_stateView'];['_miniToolbarView'];constructor(_0x3d08be,_0x581122){super(_0x3d08be);const _0x279aa1=this['bindTemplate'];this['set']('showDiff',!0x1),this['set']('_state','pending'),this['_focusTracker']=new _0x5675ac(),this['_keystrokes']=new _0x51df97(),this['_focusables']=this['createCollection'](),this['focusCycler']=new _0x125535({'focusables':this['_focusables'],'focusTracker':this['_focusTracker'],'keystrokeHandler':this['_keystrokes'],'actions':{'focusPrevious':'shift\x20+\x20tab','focusNext':'tab'}}),this['_config']=_0x581122,this['nextButtonView']=this['_createNextButtonView'](),this['previousButtonView']=this['_createPreviousButtonView'](),this['_streamableContentView']=new ui(_0x3d08be),this['_partToolbarView']=new gi(_0x3d08be,_0x581122['availableActions']),this['_partToolbarView']['delegate']('applySuggestion','insertSuggestion','rejectSuggestion')['to'](this),this['_togglePartToolbarButtonsVisibility'](_0x581122),this['_stateView']=new mi(_0x3d08be),this['_stateView']['isVisible']=!0x1,this['_miniToolbarView']=new wi(_0x3d08be,{'showChanges':'full'}),this['_miniToolbarView']['bind']('isShowChangesOn')['to'](this,'showDiff'),this['_miniToolbarView']['on']('toggleShowChanges',()=>{this['fire']('toggleSuggestionDisplayMode');}),this['_toolbarContainerView']=new AIChatBalloonToolbarContainerView(_0x3d08be,[this['_partToolbarView'],this['_stateView'],this['_miniToolbarView']]),this['children']=this['createCollection']([this['_streamableContentView'],this['_toolbarContainerView']]),this['on']('change:_state',(_0x4a7933,_0x42b295,_0x3dcb76,_0x3db8e9)=>{let _0x361b07,_0x3b7d98;'pending'===_0x3db8e9?(_0x361b07=this['_partToolbarView'],_0x3b7d98=this['_stateView']):(_0x361b07=this['_stateView'],_0x3b7d98=this['_partToolbarView']),this['_stateView']['setState'](_0x3dcb76),_0x361b07['isVisible']=!0x1,_0x3b7d98['isVisible']=!0x0;}),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat-balloon-main',_0x279aa1['to']('_state',_0x448cc1=>'ck-ai-chat-balloon-main_state_'+_0x448cc1)]},'children':this['children']}),this['on']('change:isTrackChangesOn',()=>{this['_togglePartToolbarButtonsVisibility'](_0x581122);});}['render'](){super['render'](),this['nextButtonView']['render'](),this['previousButtonView']['render'](),this['_focusTracker']['add'](this['element']),this['_focusTracker']['add'](this['nextButtonView']),this['_focusTracker']['add'](this['previousButtonView']),this['_focusTracker']['add'](this['_miniToolbarView']),this['_focusTracker']['add'](this['_partToolbarView']),this['_keystrokes']['listenTo'](this['element']),this['_keystrokes']['listenTo'](this['nextButtonView']['element']),this['_keystrokes']['listenTo'](this['previousButtonView']['element']),this['_focusables']['addMany']([this['nextButtonView'],this['previousButtonView'],this['_partToolbarView'],this['_miniToolbarView']]);}['destroy'](){super['destroy'](),this['previousButtonView']['destroy'](),this['nextButtonView']['destroy']();}['focus'](){this['focusCycler']['focusFirst']();}['focusLast'](){this['focusCycler']['focusLast']();}async['updateContent'](_0x272c7c){_0x272c7c?.['keepErrors']||this['hideError'](),await this['_streamableContentView']['update'](_0x272c7c);}['setState'](_0x51d941){this['_state']=_0x51d941;}['showError'](_0x2e95a7){super['showError'](_0x2e95a7),this['children']['has'](this['_errorView'])||this['children']['add'](this['_errorView'],0x0);}['hideError'](){this['_isErrorVisible']&&(super['hideError'](),this['togglePartToolbarEnabled'](!0x0));}['showBlockingError'](_0x279ac0){super['showBlockingError'](_0x279ac0),this['togglePartToolbarEnabled'](!0x1);}['toggleRotatorButtonsVisibility'](_0x4e7f79){this['nextButtonView']['isVisible']=this['previousButtonView']['isVisible']=_0x4e7f79;}['togglePartToolbarEnabled'](_0x4f7de4){this['_partToolbarView']['isEnabled']=_0x4f7de4;}['_togglePartToolbarButtonsVisibility']({showApplyButton:_0x535978,showSuggestButton:_0x118def}){_0x535978=_0x535978&&!this['isTrackChangesOn']&&this['_config']['availableActions']['includes']('applySuggestion'),_0x118def=_0x118def&&this['_config']['availableActions']['includes']('insertSuggestion'),this['_partToolbarView']['setButtonsVisibility']({'showApplyButton':_0x535978,'showSuggestButton':_0x118def});}['_createNextButtonView'](){const _0x5ce109=new _0x4421de(this['locale']);return _0x5ce109['set']({'icon':_0x4d05c9,'label':i(this['locale'],'AI_BALLOON_NEXT_LABEL'),'isVisible':!0x0}),_0x5ce109['on']('execute',()=>{this['fire']('showNext');}),_0x5ce109;}['_createPreviousButtonView'](){const _0x254963=new _0x4421de(this['locale']);return _0x254963['set']({'icon':_0x520810,'label':i(this['locale'],'AI_BALLOON_PREVIOUS_LABEL'),'isVisible':!0x0}),_0x254963['on']('execute',()=>{this['fire']('showPrevious');}),_0x254963;}}class AIChatBalloonToolbarContainerView extends _0x3ddefc{constructor(_0x1ac16b,_0x1c9344){super(_0x1ac16b),this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-balloon__toolbar-container']},'children':_0x1c9344});}}class Ot extends _0x2b80c4{static get['requires'](){return[_0x5ef991,Q];}static get['pluginName'](){return'AIChatBalloon';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['_chatBalloonView'];constructor(_0x392e18){super(_0x392e18),this['set']('showDiff',!0x1);}['open'](_0x2f08c1){const _0x3c0b5c=this['editor'];this['_chatBalloonView']||(this['_chatBalloonView']=this['_createChatBalloonView']()),_0x3c0b5c['plugins']['get']('AIBalloon')['open']({..._0x2f08c1,'id':'aiChatBalloon','class':'ck-ai-chat-balloon','mainView':this['_chatBalloonView']}),this['_toggleRotatorButtonsInDialogHeader'](_0x2f08c1['showRotator']),this['_chatBalloonView']['togglePartToolbarEnabled'](!_0x2f08c1['areActionsDisabled']),this['_restoreDefaultViewFocus']();}['close'](){this['editor']['plugins']['get']('AIBalloon')['close']();}['updateContent'](_0x1cefbe){return this['_chatBalloonView']||(this['_chatBalloonView']=this['_createChatBalloonView']()),this['_chatBalloonView']['updateContent'](_0x1cefbe);}['setState'](_0x55c38a){this['_chatBalloonView']&&this['_chatBalloonView']['setState'](_0x55c38a);}['_createChatBalloonView'](){const _0x5c132b=this['editor'],_0x17d6a0=_0x5c132b['plugins']['get']('AIBalloon'),_0x50bdcc=_0x5c132b['commands']['get']('trackChanges');let _0x119109=_0x5c132b['config']['get']('ai.availableReplyActions')||[...ot];_0x5c132b['plugins']['has']('TrackChanges')||(_0x119109=_0x119109['filter'](_0x43a2f7=>'insertSuggestion'!=_0x43a2f7));const _0x12fc2b=new lt(_0x5c132b['locale'],{'availableActions':_0x119109,'showApplyButton':!0x0,'showSuggestButton':!!_0x50bdcc});return _0x12fc2b['bind']('showDiff')['to'](this),_0x12fc2b['delegate'](...ut)['to'](this),_0x12fc2b['delegate']('showPrevious','showNext')['to'](this),_0x17d6a0['delegate']('dialogClosed')['to'](this),_0x12fc2b['on']('applySuggestion',this['_restoreDefaultViewFocus']['bind'](this)),_0x12fc2b['on']('insertSuggestion',this['_restoreDefaultViewFocus']['bind'](this)),_0x12fc2b['on']('rejectSuggestion',this['_restoreDefaultViewFocus']['bind'](this)),_0x50bdcc&&_0x12fc2b['bind']('isTrackChangesOn')['to'](_0x50bdcc,'value'),_0x12fc2b['render'](),_0x12fc2b;}['_toggleRotatorButtonsInDialogHeader'](_0x431214){const _0x3028fc=this['editor'],_0x46b6ec=_0x3028fc['plugins']['get']('Dialog')['view']['headerView']['children'];this['_chatBalloonView']['toggleRotatorButtonsVisibility'](_0x431214),_0x46b6ec['has'](this['_chatBalloonView']['previousButtonView'])||(_0x46b6ec['addMany']([this['_chatBalloonView']['previousButtonView'],this['_chatBalloonView']['nextButtonView']],0x0),_0x3028fc['plugins']['get']('AIBalloon')['once']('beforeDialogClosed',()=>{_0x46b6ec['remove'](this['_chatBalloonView']['previousButtonView']),_0x46b6ec['remove'](this['_chatBalloonView']['nextButtonView']);}));}['_restoreDefaultViewFocus'](){this['_chatBalloonView']['focus']();}}class AIEditorIntegration extends _0x2b80c4{static get['requires'](){return[qt,Ot,zt];}static get['pluginName'](){return'AIEditorIntegration';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}function Zt(_0x541a17){const {editor:_0x39f34d,action:_0x713a1c,withText:_0x12da82=!0x1,withIcon:_0x1ddab9=!0x0,isInDropdown:_0x3d064f=!0x0,shouldPreventFocus:_0x3eeade=!0x1}=_0x541a17;return()=>{const _0x51b948=_0x39f34d['locale'],_0x3dd030=new _0x4421de(_0x51b948),_0x25d1bf=_0x3dd030['bindTemplate'];_0x3d064f&&_0x3dd030['extendTemplate']({'on':{'mouseenter':_0x25d1bf['to'](()=>{_0x3eeade&&_0x3eeade()||_0x3dd030['focus']();})}});const _0x46ba47=_0x713a1c['icon']??_0x713a1c['parent']?.['icon'];return _0x3dd030['set']({'label':_0x713a1c['displayedPrompt'],'withText':_0x12da82,'role':'menuitem','icon':_0x1ddab9?_0x46ba47??_0x291361:void 0x0,'tooltip':!_0x12da82,'class':'ck-ai-quick-actions-button','isEnabled':_0x713a1c['isEnabled']}),_0x3dd030['on']('execute',()=>{_0x39f34d['editing']['view']['focus'](),_0x39f34d['commands']['execute']('aiQuickAction',_0x713a1c);}),_0x3dd030;};}class Ps extends _0x570448{['arrowView'];constructor(_0x2760f7,_0x5c6bf0){super(_0x2760f7,_0x5c6bf0);const _0x3efa12=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',_0x4f1b45=>String(_0x4f1b45)),'data-cke-tooltip-disabled':_0x3efa12['to']('isOn')},'on':{'mouseenter':_0x3efa12['to']('mouseenter')}});}['render'](){super['render'](),this['children']['add'](this['arrowView']);}['_createArrowView'](){const _0x134064=new _0x2fc344();return _0x134064['content']=_0x5e0145,_0x134064['extendTemplate']({'attributes':{'class':'ck-dropdown-menu-list__nested-menu__button__arrow'}}),_0x134064;}}class Ls extends _0x4bb2ce{['_allListItems'];['_allSearchableItems'];constructor(_0x32f5f4,_0xf8dd4a,_0x4da4f4){super(_0x32f5f4),this['_allListItems']=_0xf8dd4a,this['_allSearchableItems']=_0x4da4f4;}['filter'](_0xa88a56){if(!_0xa88a56)return this['items']['clear'](),this['items']['addMany'](this['_allListItems']),this['_clearHighlight'](),{'resultsCount':this['_allListItems']['length'],'totalItemsCount':this['_allListItems']['length']};const _0x2e04bd=_0xa88a56['source']['toLowerCase']()['trim'](),_0x490a8b=this['_allSearchableItems']['filter'](_0x22fd83=>(_0x22fd83['groupLabel']?_0x22fd83['label']+'\x20('+_0x22fd83['groupLabel']+')':_0x22fd83['label'])['toLowerCase']()['includes'](_0x2e04bd));return this['items']['clear'](),this['items']['addMany'](_0x490a8b['sort']((_0x45ef28,_0x2b811b)=>{const _0x205d31=_0x45ef28['groupLabel'],_0x291cac=_0x2b811b['groupLabel'];return _0x205d31||_0x291cac?_0x205d31?0x1:-0x1:0x0;})['map'](_0x125c75=>_0x125c75['item'])),this['_highlightQuery'](_0x2e04bd,_0x490a8b),{'resultsCount':_0x490a8b['length'],'totalItemsCount':this['_allSearchableItems']['length']};}['_highlightQuery'](_0x2e62ec,_0x5d9619){if(!_0x2e62ec)return;const _0x61072f=new RegExp(_0x518f64(_0x2e62ec),'gi');_0x5d9619['forEach'](_0x41557c=>{_0x41557c['highlightViews']&&_0x41557c['highlightViews']['forEach'](_0x4c741b=>{'function'==typeof _0x4c741b['highlightText']&&_0x4c741b['highlightText'](_0x61072f);});});}['_clearHighlight'](){this['_allSearchableItems']['forEach'](_0x31d021=>{_0x31d021['highlightViews']&&_0x31d021['highlightViews']['forEach'](_0x3134e6=>{'function'==typeof _0x3134e6['highlightText']&&_0x3134e6['highlightText'](null);});});}}const Qs='menu',Gs='menuitem';class co extends _0x3ddefc{['_bodyCollection'];['optionsListView'];['_searchTextView']=null;['_allSearchableItems']=[];['children'];['focusTracker'];['keystrokes'];['_focusables'];['focusCycler'];['_openNestedPanels']=new Set();['_hasSearch'];constructor(_0x4e9cc1,_0x1c5f42,_0x19be6a,_0x205238,_0x593cc0=!0x1){const _0x2047a6=_0x4e9cc1['locale'];super(_0x2047a6),this['_bodyCollection']=_0x205238,this['_hasSearch']=_0x593cc0;const _0x2e6555=this['_createListItems'](_0x4e9cc1,_0x1c5f42,_0x19be6a);this['optionsListView']=new Ls(_0x2047a6,_0x2e6555,this['_allSearchableItems']),this['optionsListView']['role']=Qs,this['optionsListView']['items']['addMany'](_0x2e6555),this['focusTracker']=new _0x5675ac(),this['keystrokes']=new _0x51df97(),_0x593cc0&&(this['_searchTextView']=this['_createSearchTextView']()),this['_focusables']=_0x2e6555,this['focusCycler']=new _0x125535({'focusables':this['_focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes']}),_0x593cc0&&this['_searchTextView']&&this['focusCycler']['chain'](this['_searchTextView']['focusCycler']);const _0x4b135a=_0x593cc0&&this['_searchTextView']?[this['_searchTextView']]:[this['optionsListView']];this['children']=new _0xdb22e9(_0x4b135a),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-ai-quick-actions','ck-rounded-corners'],'dir':_0x2047a6['uiLanguageDirection']},'children':this['children']});}['_createSearchTextView'](){return new _0x4b2da7(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 _0x30dc34=this['_searchTextView']['queryView']['fieldView']['element']['ownerDocument']?.['activeElement'];return this['_searchTextView']['queryView']['fieldView']['element']['contains'](_0x30dc34);}['_createListItems'](_0x2a6204,_0x93d023,_0x3f12bb){const _0x4efb42=new _0xdb22e9();return _0x93d023['forEach'](_0x2cfb43=>{if('actions'in _0x2cfb43){const {listItem:_0x246dad}=this['_createActionGroupButton'](_0x2a6204,_0x2cfb43,_0x3f12bb);_0x4efb42['add'](_0x246dad),_0x2cfb43['actions']['forEach'](_0x142a70=>{this['_createActionButton'](_0x2a6204,_0x142a70,_0x2cfb43['label'],_0x2cfb43['icon']);const {listItem:_0x2b1ad0,highlightViews:_0x45eedf}=this['_createSearchResultActionButton'](_0x2a6204,_0x142a70,_0x2cfb43['label'],_0x2cfb43['icon']);this['_allSearchableItems']['push']({'item':_0x2b1ad0,'label':_0x142a70['displayedPrompt'],'groupLabel':_0x2cfb43['label'],'highlightViews':_0x45eedf});});}else{const {listItem:_0x3965ec}=this['_createActionButton'](_0x2a6204,_0x2cfb43);_0x4efb42['add'](_0x3965ec);const _0x5019a1=_0x3965ec['children']['first'];if(_0x5019a1){const {listItem:_0x3f1ccd,highlightViews:_0x33aa5b}=this['_createSearchResultActionButton'](_0x2a6204,_0x2cfb43);this['_allSearchableItems']['push']({'item':_0x3f1ccd,'label':_0x5019a1['label']||'','highlightViews':_0x33aa5b});}}}),_0x4efb42;}['_createActionButton'](_0x522200,_0x3771d1,_0x43d4b5,_0x3659fe){const _0x439728=new _0x23b8c1(this['locale']);if(_0x43d4b5&&_0x3659fe){const _0x120fe6=new _0x4421de(this['locale']),_0x1a8762=_0x120fe6['bindTemplate'],_0x56d0d1=new _0x5bd3a5();_0x56d0d1['text']=_0x3771d1['displayedPrompt'];const _0x5596bb=new _0x5bd3a5();_0x5596bb['text']=_0x43d4b5;const _0x3bb876=new _0x2fc344();_0x3bb876['content']=_0x3659fe,_0x3bb876['extendTemplate']({'attributes':{'class':'ck-ai-quick-actions-button__group-icon'}});const _0x20f365=new _0x3ddefc(this['locale']);_0x20f365['setTemplate']({'tag':'span','attributes':{'class':'ck-ai-quick-actions-button_with-group__open-paren'},'children':[{'text':'\x20('}]});const _0x4e88f4=new _0x3ddefc(this['locale']);return _0x4e88f4['setTemplate']({'tag':'span','attributes':{'class':'ck-ai-quick-actions-button_with-group__close-paren'},'children':[{'text':')'}]}),_0x120fe6['set']({'label':_0x3771d1['displayedPrompt']+'\x20('+_0x43d4b5+')','withText':!0x0,'role':'menuitem','class':'ck-ai-quick-actions-button\x20ck-ai-quick-actions-button_with-group','tooltip':!0x1}),_0x120fe6['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':[_0x56d0d1,_0x20f365,_0x3bb876,_0x5596bb,_0x4e88f4],'on':{'mouseenter':_0x1a8762['to'](()=>{this['_isSearchFocused']()||_0x120fe6['focus']();}),'click':_0x1a8762['to'](()=>{_0x120fe6['fire']('execute');})}}),_0x120fe6['on']('execute',()=>{_0x522200['editing']['view']['focus'](),_0x522200['commands']['execute']('aiQuickAction',_0x3771d1);}),_0x439728['children']['add'](_0x120fe6),{'listItem':_0x439728,'highlightViews':[_0x56d0d1,_0x5596bb]};}{const _0x2d5faf=new _0x5c72a5(),_0x36a056=new _0x4421de(this['locale'],_0x2d5faf),_0x50fb85=_0x36a056['bindTemplate'],_0x2c9fba=_0x3771d1['icon']??_0x3771d1['parent']?.['icon'],_0x55d7ab=void 0x0!==_0x3771d1['icon'];return _0x36a056['set']({'label':_0x3771d1['displayedPrompt'],'withText':!0x0,'role':'menuitem','icon':_0x55d7ab?_0x2c9fba??_0x291361:void 0x0,'tooltip':!0x1,'class':'ck-ai-quick-actions-button'}),_0x36a056['extendTemplate']({'on':{'mouseenter':_0x50fb85['to'](()=>{this['_isSearchFocused']()||_0x36a056['focus']();})}}),_0x36a056['on']('execute',()=>{_0x522200['editing']['view']['focus'](),_0x522200['commands']['execute']('aiQuickAction',_0x3771d1);}),_0x439728['children']['add'](_0x36a056),{'listItem':_0x439728,'highlightViews':[_0x2d5faf]};}}['_createSearchResultActionButton'](_0x181292,_0x189560,_0x24009c,_0x4cb799){return _0x24009c&&_0x4cb799?this['_createSearchResultGroupedActionButton'](_0x181292,_0x189560,_0x24009c,_0x4cb799):this['_createSearchResultIndividualActionButton'](_0x181292,_0x189560);}['_createSearchResultGroupedActionButton'](_0x45d147,_0x198a73,_0x578b0a,_0x177c85){const _0x1b62b1=new _0x23b8c1(this['locale']),_0x5620a7=new _0x4421de(this['locale']),_0x1d8b68=_0x5620a7['bindTemplate'],{view:_0x5715d1,highlightView:_0x1417a6}=this['_createSearchResultGroupRow'](_0x578b0a,_0x177c85),{view:_0x53bde0,highlightView:_0x1c4800}=this['_createSearchResultActionRow'](_0x198a73['displayedPrompt']),_0x31cb10=this['_createSearchResultContentView'](_0x5715d1,_0x53bde0);return _0x5620a7['set']({'label':_0x198a73['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}),_0x5620a7['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':[_0x31cb10],'on':{'mouseenter':_0x1d8b68['to'](()=>{this['_isSearchFocused']()||_0x5620a7['focus']();}),'click':_0x1d8b68['to'](()=>{this['_handleSearchResultButtonClick'](_0x5620a7);})}}),this['_setupActionButtonExecution'](_0x5620a7,_0x45d147,_0x198a73),_0x1b62b1['children']['add'](_0x5620a7),{'listItem':_0x1b62b1,'highlightViews':[_0x1417a6,_0x1c4800]};}['_createSearchResultIndividualActionButton'](_0x1649d2,_0x451c40){const _0x1e2311=new _0x23b8c1(this['locale']),_0x1865c5=new _0x5c72a5(),_0x55e6b7=new _0x4421de(this['locale'],_0x1865c5),_0x317aa9=_0x55e6b7['bindTemplate'];return _0x55e6b7['set']({'label':_0x451c40['displayedPrompt'],'withText':!0x0,'role':'menuitem','icon':void 0x0,'tooltip':!0x1,'class':'ck-ai-quick-actions-button\x20ck-ai-quick-actions-search-result-button'}),_0x55e6b7['extendTemplate']({'on':{'mouseenter':_0x317aa9['to'](()=>{this['_isSearchFocused']()||_0x55e6b7['focus']();})}}),this['_setupActionButtonExecution'](_0x55e6b7,_0x1649d2,_0x451c40),_0x1e2311['children']['add'](_0x55e6b7),{'listItem':_0x1e2311,'highlightViews':[_0x1865c5]};}['_createSearchResultGroupRow'](_0x3e6b05,_0x572c77){const _0x213546=new _0x3ddefc(this['locale']),_0x4d7b26=new _0x2fc344();_0x4d7b26['content']=_0x572c77,_0x4d7b26['extendTemplate']({'attributes':{'class':'ck-ai-quick-actions-button__group-icon'}});const _0x4a4812=new _0x5bd3a5();return _0x4a4812['text']=_0x3e6b05,_0x213546['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-quick-actions-search-result__group-row'},'children':[_0x4d7b26,_0x4a4812]}),{'view':_0x213546,'highlightView':_0x4a4812};}['_createSearchResultActionRow'](_0x44087e){const _0x2e7126=new _0x3ddefc(this['locale']),_0x205e7f=new _0x5bd3a5();return _0x205e7f['text']=_0x44087e,_0x2e7126['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-quick-actions-search-result__action-row'},'children':[_0x205e7f]}),{'view':_0x2e7126,'highlightView':_0x205e7f};}['_createSearchResultContentView'](_0x3fe42d,_0x74184b){const _0x148e78=new _0x3ddefc(this['locale']);return _0x148e78['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-quick-actions-search-result__content'},'children':[_0x3fe42d,_0x74184b]}),_0x148e78;}['_setupActionButtonExecution'](_0x390476,_0x198d8e,_0x42cfc7){_0x390476['on']('execute',()=>{_0x198d8e['editing']['view']['focus'](),_0x198d8e['commands']['execute']('aiQuickAction',_0x42cfc7);});}['_createActionGroupButton'](_0x474833,_0x399d6c,_0x189335){const _0x27acaf=new _0x23b8c1(this['locale']),_0x814384=new _0x5c72a5(),_0x1b9b74=new Ps(this['locale'],_0x814384),_0x4294cc=_0x1b9b74['bindTemplate'],_0x47edf3=this['_getPanelKeystroke'](_0x189335),_0x4a2284=this['_createGroupActionsList'](_0x474833,_0x399d6c['actions'],_0x189335);_0x1b9b74['set']({'label':_0x399d6c['label'],'withText':!0x0,'role':Gs,'icon':_0x399d6c['icon']??_0x291361,'isEnabled':_0x399d6c['actions']['some'](_0x3e284e=>_0x3e284e['isEnabled'])}),_0x1b9b74['extendTemplate']({'on':{'mouseenter':_0x4294cc['to'](()=>{this['_isSearchFocused']()||_0x1b9b74['focus']();})}});const _0x92f5f5=new _0x435ccf(this['locale']);return _0x92f5f5['extendTemplate']({'attributes':{'class':['ck','ck-reset_all','ck-ai-quick-actions-group-panel','ck-dropdown-menu__nested-menu__panel']},'on':{'keydown':_0x4294cc['to'](_0x3ec04d=>{this['_handlePanelKeydown'](_0x3ec04d,_0x47edf3,_0x1b9b74,_0x92f5f5);})}}),_0x1b9b74['bind']('isOn')['to'](_0x92f5f5,'isVisible'),this['_bodyCollection']['add'](_0x92f5f5),_0x92f5f5['content']['add'](_0x4a2284),this['_setupGroupMenuBehavior'](_0x1b9b74,_0x92f5f5),_0x27acaf['children']['add'](_0x1b9b74),{'listItem':_0x27acaf,'highlightView':_0x814384};}['_createGroupActionsList'](_0x5953ba,_0x57e15e,_0x552336){const _0xba571=new _0x4bb2ce(this['locale']);return _0xba571['extendTemplate']({'attributes':{'class':['ck','ck-reset_all','ck-ai-quick-actions-group-list','ck-dropdown-menu-list']}}),_0x57e15e['forEach'](_0x426396=>{const _0x1aaf1f=new _0x23b8c1(this['locale']),_0xd9dbd2=Zt({'editor':_0x5953ba,'action':_0x426396,'withText':!0x0,'withIcon':!0x1,'isInDropdown':!0x0,'shouldPreventFocus':()=>this['_isSearchFocused']()})();_0x1aaf1f['children']['add'](_0xd9dbd2),_0x552336['focusTracker']['add'](_0xd9dbd2),_0xba571['items']['add'](_0x1aaf1f);}),_0xba571;}['_setupGroupMenuBehavior'](_0x29fea5,_0x1bc9cb){const _0x3a8f09=_0x29fea5['bindTemplate'],_0x3ade50=this['_getButtonKeystroke'](_0x29fea5);_0x29fea5['extendTemplate']({'attributes':{'class':['ck-ai-quick-actions-group-button']},'on':{'mouseenter':_0x3a8f09['to'](()=>{this['_showNestedPanel'](_0x1bc9cb,_0x29fea5);}),'mouseleave':_0x3a8f09['to'](_0x5ae1c5=>{const _0x341401=_0x5ae1c5['relatedTarget'];this['_isMovingToNestedMenu'](_0x341401,_0x1bc9cb)||this['_hideNestedPanel'](_0x1bc9cb);}),'keydown':_0x3a8f09['to'](_0x59ef5c=>{_0x59ef5c['key']==_0x3ade50&&(this['_showNestedPanel'](_0x1bc9cb,_0x29fea5),_0x1bc9cb['content']['get'](0x0)['focus']());})}}),_0x1bc9cb['on']('render',()=>{_0x1bc9cb['element']?.['addEventListener']('mouseleave',_0x45c1fe=>{const _0x4be2df=_0x45c1fe['relatedTarget'];_0x29fea5['element']?.['contains'](_0x4be2df)||this['_isMovingToNestedMenu'](_0x4be2df,_0x1bc9cb)||this['_hideNestedPanel'](_0x1bc9cb);});});}['_showNestedPanel'](_0x46c670,_0x3a7282){this['_openNestedPanels']['forEach'](_0xce4542=>{_0xce4542!==_0x46c670&&_0xce4542['isVisible']&&_0xce4542['hide']();}),_0x46c670['show'](),_0x46c670['pin']({'positions':[_0x3939df['eastSouth']],'target':_0x3a7282['element'],'fitInViewport':!0x0}),this['_openNestedPanels']['add'](_0x46c670);}['_hideNestedPanel'](_0x50ffc3){_0x50ffc3['hide'](),this['_openNestedPanels']['delete'](_0x50ffc3);}['_hideAllNestedPanels'](){this['_openNestedPanels']['forEach'](_0x337475=>_0x337475['hide']()),this['_openNestedPanels']['clear']();}['_isMovingToNestedMenu'](_0x365743,_0x18db59){if(!_0x365743)return!0x1;if(_0x18db59['element']?.['contains'](_0x365743))return!0x0;const _0x51f870=_0x365743;return _0x51f870['closest']&&(null!==_0x51f870['closest']('.ck-ai-quick-actions-group-panel')||null!==_0x51f870['closest']('.ck-ai-quick-actions-group-list')||null!==_0x51f870['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'](_0x4c7a62){return'rtl'===_0x4c7a62['locale']['uiLanguageDirection']?'ArrowRight':'ArrowLeft';}['_getButtonKeystroke'](_0x3115c5){return'rtl'===_0x3115c5['locale']['uiLanguageDirection']?'ArrowLeft':'ArrowRight';}['_handlePanelKeydown'](_0x4b921b,_0x35da69,_0x3d0853,_0x50cbe0){_0x4b921b['key']==_0x35da69&&(_0x3d0853['focus'](),this['_hideNestedPanel'](_0x50cbe0));}['_handleSearchResultButtonClick'](_0x373ae8){_0x373ae8['fire']('execute');}}function Xt(_0x4bf624){const {editor:_0x214aa0,content:_0x4451db,buttonDefinition:_0x10b226,bodyCollection:_0x2600bd,hasSearch:_0x340040=!0x1}=_0x4bf624;return()=>{const _0x5d1ad9=_0x214aa0['locale'],_0x4eb5b7=_0x336a05(_0x5d1ad9);_0x4eb5b7['buttonView']['set']({'icon':_0x10b226['icon']??_0x291361,'label':_0x10b226['label'],'tooltip':!0x0}),_0x4eb5b7['set']({'class':'ck-ai-quick-actions-dropdown'});const _0x56515c=new co(_0x214aa0,_0x4451db,_0x4eb5b7,_0x2600bd,_0x340040);if(_0x4eb5b7['panelView']['children']['add'](_0x56515c),_0x340040){const _0x360bb0='ai-quick-actions-dropdown-selection';_0x4eb5b7['on']('change:isOpen',(_0x5d8330,_0x237aa0,_0x5ee9df)=>{if(_0x5ee9df){if(_0x214aa0['plugins']['has']('AIEditing')){const _0x79ce3a=_0x214aa0['plugins']['get'](D),_0x1056e9=_0x214aa0['model']['document']['selection'],_0x7448a9=Array['from'](_0x1056e9['getRanges']());_0x7448a9['length']>0x0&&_0x79ce3a['showFakeVisualSelection'](_0x7448a9,_0x360bb0,!0x1,!0x0);}}else _0x214aa0['plugins']['has']('AIEditing')&&_0x214aa0['plugins']['get'](D)['hideFakeVisualSelection'](_0x360bb0),_0x56515c['resetSearch']();});}return _0x4eb5b7;};}const ee='<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>',ie='<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>',ne='<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 Qt=function(_0x30ca94){return _0x30ca94['CHAT']='CHAT',_0x30ca94['ACTION']='ACTION',_0x30ca94['REVIEW']='REVIEW',_0x30ca94;}({}),va=function(_0x271d60){return _0x271d60['CHAT']='AIChat',_0x271d60['ACTION']='AIActions',_0x271d60['REVIEW']='AIReviewMode',_0x271d60;}({});class ii extends _0x2b80c4{static get['requires'](){return[te,q];}static get['pluginName'](){return'AIQuickActionsUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}async['init'](){const _0x357911=await this['_getDefaultAndCustomActions']();this['_prepareQuickActionsDefinition'](_0x357911),this['_initializeQuickActionsComponentsAndCommands']();}static['getDefaultQuickActions'](_0x25138c){return function(_0x579675){const _0x39807d=new Intl['DisplayNames'](['en'],{'type':'language'})['of'](_0x579675['uiLanguage']),_0x25535a=_0x39807d||'English',_0x45b13b=[{'id':'ask-ai','displayedPrompt':i(_0x579675,'AI_QUICK_ACTIONS_ASK_AI'),'type':'CHAT','icon':Gt},{'id':'chat-commands','label':i(_0x579675,'AI_QUICK_ACTIONS_CHAT_COMMANDS'),'icon':Gt,'actions':[{'id':'explain','displayedPrompt':i(_0x579675,'AI_QUICK_ACTIONS_EXPLAIN'),'prompt':ee['replace']('%0',_0x25535a),'type':'CHAT'},{'id':'summarize','displayedPrompt':i(_0x579675,'AI_QUICK_ACTIONS_SUMMARIZE'),'prompt':ie['replace']('%0',_0x25535a),'type':'CHAT'},{'id':'highlight-key-points','displayedPrompt':i(_0x579675,'AI_QUICK_ACTIONS_HIGHLIGHT_KEY_POINTS'),'prompt':ne['replace']('%0',_0x25535a),'type':'CHAT'}]},{'id':'improve-writing','displayedPrompt':i(_0x579675,'AI_QUICK_ACTIONS_IMPROVE_WRITING'),'type':'ACTION','icon':Bt},{'id':'continue','displayedPrompt':i(_0x579675,'AI_QUICK_ACTIONS_CONTINUE_WRITING'),'type':'ACTION','icon':Ft},{'id':'fix-grammar','displayedPrompt':i(_0x579675,'AI_QUICK_ACTIONS_FIX_GRAMMAR_SPELLING'),'type':'ACTION','icon':Wt},{'id':'adjust-length','label':i(_0x579675,'AI_QUICK_ACTIONS_ADJUST_LENGTH'),'icon':Kt,'actions':[{'id':'make-shorter','displayedPrompt':i(_0x579675,'AI_QUICK_ACTIONS_MAKE_SHORTER'),'type':'ACTION'},{'id':'make-longer','displayedPrompt':i(_0x579675,'AI_QUICK_ACTIONS_MAKE_LONGER'),'type':'ACTION'}]},{'id':'change-tone','label':i(_0x579675,'AI_QUICK_ACTIONS_CHANGE_TONE'),'icon':Yt,'actions':[{'id':'make-tone-casual','displayedPrompt':i(_0x579675,'AI_QUICK_ACTIONS_MORE_CASUAL'),'type':'ACTION'},{'id':'make-tone-direct','displayedPrompt':i(_0x579675,'AI_QUICK_ACTIONS_MORE_DIRECT'),'type':'ACTION'},{'id':'make-tone-friendly','displayedPrompt':i(_0x579675,'AI_QUICK_ACTIONS_MORE_FRIENDLY'),'type':'ACTION'},{'id':'make-tone-confident','displayedPrompt':i(_0x579675,'AI_QUICK_ACTIONS_MORE_CONFIDENT'),'type':'ACTION'},{'id':'make-tone-professional','displayedPrompt':i(_0x579675,'AI_QUICK_ACTIONS_MORE_PROFESSIONAL'),'type':'ACTION'}]},{'id':'translate','label':i(_0x579675,'AI_QUICK_ACTIONS_TRANSLATE'),'icon':Vt,'actions':[{'id':'translate-to-english','displayedPrompt':i(_0x579675,'AI_QUICK_ACTIONS_TRANSLATE_ENGLISH'),'type':'ACTION','actionName':'translate','args':{'language':'english'}},{'id':'translate-to-chinese','displayedPrompt':i(_0x579675,'AI_QUICK_ACTIONS_TRANSLATE_CHINESE'),'type':'ACTION','actionName':'translate','args':{'language':'chinese'}},{'id':'translate-to-spanish','displayedPrompt':i(_0x579675,'AI_QUICK_ACTIONS_TRANSLATE_SPANISH'),'type':'ACTION','actionName':'translate','args':{'language':'spanish'}},{'id':'translate-to-german','displayedPrompt':i(_0x579675,'AI_QUICK_ACTIONS_TRANSLATE_GERMAN'),'type':'ACTION','actionName':'translate','args':{'language':'german'}},{'id':'translate-to-french','displayedPrompt':i(_0x579675,'AI_QUICK_ACTIONS_TRANSLATE_FRENCH'),'type':'ACTION','actionName':'translate','args':{'language':'french'}},{'id':'translate-to-japanese','displayedPrompt':i(_0x579675,'AI_QUICK_ACTIONS_TRANSLATE_JAPANESE'),'type':'ACTION','actionName':'translate','args':{'language':'japanese'}},{'id':'translate-to-portuguese','displayedPrompt':i(_0x579675,'AI_QUICK_ACTIONS_TRANSLATE_PORTUGUESE'),'type':'ACTION','actionName':'translate','args':{'language':'portuguese'}},{'id':'translate-to-korean','displayedPrompt':i(_0x579675,'AI_QUICK_ACTIONS_TRANSLATE_KOREAN'),'type':'ACTION','actionName':'translate','args':{'language':'korean'}},{'id':'translate-to-italian','displayedPrompt':i(_0x579675,'AI_QUICK_ACTIONS_TRANSLATE_ITALIAN'),'type':'ACTION','actionName':'translate','args':{'language':'italian'}},{'id':'translate-to-russian','displayedPrompt':i(_0x579675,'AI_QUICK_ACTIONS_TRANSLATE_RUSSIAN'),'type':'ACTION','actionName':'translate','args':{'language':'russian'}}]},{'id':'other','label':i(_0x579675,'AI_QUICK_ACTIONS_OTHER'),'icon':Jt,'actions':[]}];return _0x45b13b;}(_0x25138c);}async['_getDefaultAndCustomActions'](){const _0x1c768c=ii['getDefaultQuickActions'](this['editor']['locale']),_0x4c05c8=this['editor']['config']['get']('ai.quickActions.extraCommands')||[];let _0xc436e7=[];try{_0xc436e7=await new It({'connector':this['editor']['plugins']['get']('AIConnector'),'locale':this['editor']['locale']})['getAll']();}catch(_0x58a583){const _0x3b413c=new _0x2ae61f('ai-quick-actions-models-unable-to-retrieve',this,{'error':_0x58a583});gt(_0x3b413c['message']);}finally{const _0x20c498=_0x4c05c8['map'](_0x3ef404=>({..._0x3ef404,'icon':void 0x0}));_0x1c768c['find'](_0x33c8e8=>'other'===_0x33c8e8['id'])['actions']['push'](..._0x20c498),_0x1c768c['forEach'](_0xfccdd9=>{if('actions'in _0xfccdd9)_0xfccdd9['actions']['forEach'](_0x47dd22=>{if(_0x47dd22['isEnabled']=!!_0xc436e7['find'](_0x301ef4=>_0x301ef4['id']===_0x47dd22['model'])||void 0x0===_0x47dd22['model'],!_0x47dd22['isEnabled']){const _0x3f9b84=new _0x2ae61f('ai-quick-actions-unavailable-model',this,{'actionId':_0x47dd22['id'],'modelId':_0x47dd22['model']});gt(_0x3f9b84['message']);}});else{if(_0xfccdd9['isEnabled']=!!_0xc436e7['find'](_0x55d64e=>_0x55d64e['id']===_0xfccdd9['model'])||void 0x0===_0xfccdd9['model'],!_0xfccdd9['isEnabled']){const _0x4cb1af=new _0x2ae61f('ai-quick-actions-unavailable-model',this,{'actionId':_0xfccdd9['id'],'modelId':_0xfccdd9['model']});gt(_0x4cb1af['message']);}}});}return _0x1c768c;}['_initializeQuickActionsComponentsAndCommands'](){const _0x967dfc=new _0x6c121d(this['editor']['locale']);_0x967dfc['attachToDom'](),this['_initializeQuickActionsDropdown'](_0x967dfc),this['_initializeQuickActionsMenuBar'](),this['_initializeQuickActionsComponents'](_0x967dfc);}['_initializeQuickActionsDropdown'](_0x5144b4){const _0x481ed8=this['editor']['config']['get']('ai.quickActions.isSearchEnabled')??!0x0;this['editor']['ui']['componentFactory']['add']('aiQuickActions',Xt({'editor':this['editor'],'content':this['_quickActionsDefinition'],'buttonDefinition':{'icon':_0x291361,'label':i(this['editor']['locale'],'AI_QUICK_ACTIONS_HEADING')},'bodyCollection':_0x5144b4,'hasSearch':_0x481ed8}));}['_prepareQuickActionsDefinition'](_0x4d4a7a){this['_quickActionsDefinition']=_0x4d4a7a['map'](_0x3a8bd5=>{if('actions'in _0x3a8bd5){const _0x456b89=_0x3a8bd5;return{..._0x456b89,'actions':_0x456b89['actions']['map'](_0x1b2660=>{const {actions:_0xffecfc,..._0x899a86}=_0x456b89;return{..._0x1b2660,'parent':_0x899a86};})['filter'](_0x50ef0d=>this['_shouldIncludeAction'](_0x50ef0d))};}return _0x3a8bd5;})['filter'](_0x319f94=>'actions'in _0x319f94?_0x319f94['actions']['length']>0x0:this['_shouldIncludeAction'](_0x319f94));}['_shouldIncludeAction'](_0x27d0c2){const _0x24c38e=this['editor']['config']['get']('ai.quickActions.removeCommands')||[];return this['editor']['plugins']['has'](va[_0x27d0c2['type']])&&!_0x24c38e['includes'](_0x27d0c2['id'])&&!('CHAT'===_0x27d0c2['type']&&!0x1===this['editor']['config']['get']('ai.chat.context.document.enabled'));}['_initializeQuickActionsComponents'](_0xed6212){this['_quickActionsDefinition']['forEach'](_0x1d8e2b=>{if('actions'in _0x1d8e2b){const _0x5bc575=Xt({'editor':this['editor'],'content':_0x1d8e2b['actions'],'buttonDefinition':_0x1d8e2b,'bodyCollection':_0xed6212});this['editor']['ui']['componentFactory']['add'](_0x1d8e2b['id'],_0x5bc575),_0x1d8e2b['actions']['forEach'](_0x13e56e=>{const _0x2f93e0=Zt({'editor':this['editor'],'action':_0x13e56e});this['editor']['ui']['componentFactory']['add'](_0x13e56e['id'],_0x2f93e0);});}else{const _0x5dd185=Zt({'editor':this['editor'],'action':_0x1d8e2b,'withText':!0x1,'withIcon':!0x0,'isInDropdown':!0x1});this['editor']['ui']['componentFactory']['add'](_0x1d8e2b['id'],_0x5dd185);}});}['_initializeQuickActionsMenuBar'](){this['editor']['ui']['componentFactory']['add']('menuBar:aiQuickActions',_0x2ecf3d=>{const _0x36d171=new _0x18d714(_0x2ecf3d),_0xe0432f=i(_0x2ecf3d,'AI_QUICK_ACTIONS_HEADING');_0x36d171['buttonView']['set']({'label':_0xe0432f,'icon':_0x291361});const _0x58136d=new _0x582101(_0x2ecf3d);_0x58136d['set']({'ariaLabel':_0xe0432f,'role':'menu'}),this['_quickActionsDefinition']['forEach'](_0x31cbea=>{if('actions'in _0x31cbea){const _0xa5d645=_0x31cbea,_0x511dc2=new _0x3da97b(_0x2ecf3d,_0x36d171),_0x2d78a6=new _0x18d714(_0x2ecf3d),_0x29c11c=new _0x582101(_0x2ecf3d);_0x2d78a6['buttonView']['set']({'label':_0xa5d645['label'],'icon':_0xa5d645['icon']}),_0xa5d645['actions']['forEach'](_0x31c91d=>{const _0x454b69=new _0x3da97b(_0x2ecf3d,_0x2d78a6),_0x52a69c=new _0x2a3f0d(_0x2ecf3d);_0x52a69c['set']({'label':_0x31c91d['displayedPrompt'],'icon':_0x31c91d['icon'],'role':'menuitem','isEnabled':_0x31c91d['isEnabled']}),_0x52a69c['on']('execute',()=>{this['_executeQuickAction'](_0x31c91d);}),_0x52a69c['delegate']('execute')['to'](_0x2d78a6),_0x454b69['children']['add'](_0x52a69c),_0x29c11c['items']['add'](_0x454b69);}),_0x2d78a6['panelView']['children']['add'](_0x29c11c),_0x511dc2['children']['add'](_0x2d78a6),_0x58136d['items']['add'](_0x511dc2);}else{const _0x426573=_0x31cbea,_0x23e3ba=new _0x3da97b(_0x2ecf3d,_0x36d171),_0x1c647d=new _0x2a3f0d(_0x2ecf3d);_0x1c647d['set']({'label':_0x426573['displayedPrompt'],'icon':_0x426573['icon'],'role':'menuitem','isEnabled':_0x426573['isEnabled']}),_0x1c647d['on']('execute',()=>{this['_executeQuickAction'](_0x426573);}),_0x1c647d['delegate']('execute')['to'](_0x36d171),_0x23e3ba['children']['add'](_0x1c647d),_0x58136d['items']['add'](_0x23e3ba);}});const _0x375a24=Object['values'](va)['some'](_0x100765=>this['editor']['plugins']['has'](_0x100765));return _0x36d171['set']({'isEnabled':_0x375a24}),_0x36d171['panelView']['children']['add'](_0x58136d),_0x36d171;});}['_executeQuickAction'](_0x414bc1){const _0x330ce5=this['editor'];_0x330ce5['editing']['view']['focus'](),_0x330ce5['commands']['execute']('aiQuickAction',_0x414bc1);const _0x1c4ea5=_0x330ce5['ui']['view']['menuBarView'];_0x1c4ea5&&_0x1c4ea5['close']&&_0x1c4ea5['close']();}}class ci extends Lt{['execute'](_0x3e245d){switch(this['_expandSelectionIfCollapsed'](),_0x3e245d['type']){case Qt['CHAT']:if(!this['editor']['plugins']['has']('AIChat')){const _0x5cf4d9=i(this['editor']['locale'],'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND','AIChat');throw new _0x2ae61f('ai-quick-actions-plugin-not-found',this['editor'],{'errorMessage':_0x5cf4d9});}this['_handleAIChatAction'](_0x3e245d);break;case Qt['ACTION']:if(!this['editor']['plugins']['has']('AIActions')){const _0x52fa87=i(this['editor']['locale'],'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND','AIActions');throw new _0x2ae61f('ai-quick-actions-plugin-not-found',this['editor'],{'errorMessage':_0x52fa87});}this['_handleAIActionsAction'](_0x3e245d);break;case Qt['REVIEW']:if(!this['editor']['plugins']['has']('AIReviewMode')){const _0x5305a7=i(this['editor']['locale'],'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND','AIReviewMode');throw new _0x2ae61f('ai-quick-actions-plugin-not-found',this['editor'],{'errorMessage':_0x5305a7});}this['_handleAIReviewAction'](_0x3e245d);}}async['_handleAIChatAction'](_0x53c94c){const _0xc94d18=this['editor']['plugins']['get']('AIChat'),_0x593499=this['editor']['plugins']['get']('AIChatController'),_0x32d15c=this['editor']['plugins']['get']('AITabs')['view'];if(_0x32d15c['isVisible']||(_0x32d15c['isVisible']=!0x0),'chat'!==_0x32d15c['activeTab']&&_0x32d15c['activateTab']('chat'),'ask-ai'===_0x53c94c['id'])_0x593499['removeSelectionFromChatContext'](),await _0xc94d18['addSelectionToChatContext'](),_0xc94d18['focusPromptInput']();else await _0xc94d18['startConversation'](),_0x593499['removeSelectionFromChatContext'](),await _0xc94d18['addSelectionToChatContext'](),_0xc94d18['focusPromptInput'](),await _0xc94d18['sendMessage']({'message':_0x53c94c['prompt']||_0x53c94c['displayedPrompt'],'attributes':{'quickActionData':{'id':_0x53c94c['id']},'displayedPrompt':_0x53c94c['displayedPrompt']}});}['_expandSelectionIfCollapsed'](){const _0x1a1e6a=this['editor'],_0x3422f8=_0x1a1e6a['model']['document']['selection'];if(!_0x3422f8['isCollapsed'])return;const _0x18af08=_0x382588(_0x3422f8['getSelectedBlocks']())||_0x1a1e6a['model']['schema']['getLimitElement'](_0x3422f8);_0x1a1e6a['model']['change'](_0x58beed=>{_0x58beed['setSelection'](_0x18af08,'in');});}['_handleAIActionsActionLabel'](_0x45deac){return _0x45deac['parent']?.['label']&&'other'!==_0x45deac['parent']?.['id']?_0x45deac['parent']['label']+':\x20'+_0x45deac['displayedPrompt']:_0x45deac['displayedPrompt'];}async['_handleAIActionsAction'](_0x48bbb8){const _0x15ada5=this['editor']['plugins']['get']('AIActions'),_0xba89a9=_0x48bbb8['prompt']?{'userMessage':_0x48bbb8['prompt'],'model':_0x48bbb8['model']}:{'actionName':_0x48bbb8['actionName']||_0x48bbb8['id'],'args':_0x48bbb8['args']},_0x2851e9=this['_handleAIActionsActionLabel'](_0x48bbb8);await _0x15ada5['executeAction'](_0xba89a9,_0x2851e9,_0x48bbb8['icon']);}async['_handleAIReviewAction'](_0x25b175){console['log']('handleAIReviewAction',_0x25b175);}}class ti extends _0x2b80c4{static get['pluginName'](){return'AIQuickActionsEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x4d0e1d=this['editor'],_0x1b6305=new ci(this['editor']);if(_0x4d0e1d['commands']['add']('aiQuickAction',_0x1b6305),_0x4d0e1d['plugins']['has']('AIChat')){const _0x1c3eaf=this['editor']['plugins']['get']('AIChat');_0x4d0e1d['model']['document']['selection']['on']('change:range',(_0x583518,_0x15fd06)=>{_0x15fd06['directChange']&&_0x1c3eaf['removeSelectionFromChatContext']();});}}}class De extends Ge{['updateChangeGroups'](){if(this['parsedMergedContent']=this['parsedContent']['cloneNode'](!0x0),0x0==this['parsedMergedContent']['childNodes']['length'])return void(this['changeGroups']=[]);const _0x524cb8=this['documentContextContent']['children']['map'](_0x1703f2=>({'node':_0x1703f2,'id':At(_0x1703f2,'data-id')})),_0x184b8f=this['parsedMergedContent']['children']['map'](_0x395d5b=>({'node':_0x395d5b,'id':At(_0x395d5b,'data-id')||_0x56075e()})),_0x197b49=_0x1f7ab4(_0x524cb8,_0x184b8f,{'comparator':(_0x3b3b37,_0xf7627a)=>_0x3b3b37['id']==_0xf7627a['id'],'oneChangePerToken':!0x0});if(!this['isDone']){for(;_0x197b49['length']&&_0x197b49[_0x197b49['length']-0x1]['removed'];)_0x197b49['pop']();}const _0x51aee2=_0x197b49['map'](_0x3505f7=>{const _0x2703f7=_0x3505f7['added']?'new':_0x3505f7['removed']?'removed':'modified';return{'node':_0x3505f7['value'][0x0]['node'],'type':_0x2703f7,'id':_0x3505f7['value'][0x0]['id']};});this['changeGroups']=[{'changes':_0x51aee2,'state':'pending','index':0x0}];}['_getDifferentChangeGroups'](_0x547642,_0x19e51c){return _0x19e51c;}}class W extends xe{['content'];['version'];['actionName'];['args'];['userMessage'];['model'];['hasError']=!0x1;constructor(_0x1e8a24){super(_0x1e8a24),this['content']=_0x1e8a24['content'],this['version']=_0x1e8a24['version'],this['actionName']=_0x1e8a24['actionName'],this['args']=_0x1e8a24['args'],this['userMessage']=_0x1e8a24['userMessage'],this['model']=_0x1e8a24['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':qe['TEXT'],'content':this['content'],'version':this['version'],'label':'Current\x20document','uiId':'current-document'};}['createReply'](_0x563afa){const _0x58a016=new De({'editor':this['editor'],'documentContextContent':this['content'],..._0x563afa});return this['replies']['push'](_0x58a016),_0x58a016['delegate'](...ye)['to'](this),this['fire']('replyCreated',_0x58a016),_0x58a016;}}class Bn extends _0x5be165{constructor(_0x533050,_0x4a10d3=!0x0,_0x42e38c=!0x0){super(_0x533050),this['set']('isEnabled',!0x1),_0x4a10d3&&(this['applyButton']=this['_createButton'](i(_0x533050,'AI_BALLOON_APPLY_BUTTON'),'ck-ai-button-primary'),this['applyButton']['bind']('isEnabled')['to'](this),this['items']['add'](this['applyButton'])),_0x42e38c&&(this['suggestButton']=this['_createButton'](i(_0x533050,'AI_BALLOON_SUGGEST_BUTTON'),_0x4a10d3?'ck-ai-button-secondary':'ck-ai-button-primary'),this['suggestButton']['bind']('isEnabled')['to'](this),this['items']['add'](this['suggestButton'])),this['setButtonsVisibility']({'showApplyButton':_0x4a10d3,'showSuggestButton':_0x42e38c}),this['extendTemplate']({'attributes':{'class':['ck-ai-balloon__toolbar']}});}['setButtonsVisibility']({showApplyButton:_0x3681ac,showSuggestButton:_0x2554db}){this['applyButton']&&(this['applyButton']['isVisible']=_0x3681ac),this['suggestButton']&&(this['suggestButton']['isVisible']=_0x2554db);}['_createButton'](_0xf28671,_0x159379){const _0x4aa680=new _0x4421de(this['locale']);return _0x4aa680['set']({'label':_0xf28671,'class':_0x159379,'isVisible':!0x0,'withText':!0x0}),_0x4aa680;}}class yn extends _0x3ddefc{constructor(_0x266329){super(_0x266329),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(_0x266329,'AI_DISCLAIMER_TEXT')}]}]});}}class Nn extends _0x3ddefc{constructor(_0x5d66b9){super(_0x5d66b9),this['set']('isVisible',!0x0);const _0x140288=new vi('small');_0x140288['isVisible']=!0x0;const _0x24e069=new _0x3ddefc(this['locale']);_0x24e069['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-suggestion__loader-text']},'children':[i(this['locale'],'AI_CHAT_IS_WRITING')]}),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__loader',this['bindTemplate']['if']('isVisible','ck-hidden',_0x21b464=>!_0x21b464)]},'children':[_0x140288,_0x24e069]});}}class rt extends pi{['focusCycler'];['_config'];['_contentWrapper'];['_streamableContentView'];['_toolbarView'];['_miniToolbarView'];['_loaderView'];['_disclaimerView'];['_focusTracker'];['_keystrokes'];['_dialogContent'];['_focusables'];['_scrollManager'];['_navigationPreviousButton'];['_navigationNextButton'];['_navigationTryAgainButton'];['_navigationCounter'];constructor(_0x3c19d4,_0x3b4125){super(_0x3c19d4),this['set']('isBusy',!0x1),this['set']('isTrackChangesOn',!0x1),this['set']('_isLoading',!0x1),this['set']('_hasError',!0x1),this['_config']=_0x3b4125,this['_focusTracker']=new _0x5675ac(),this['_keystrokes']=new _0x51df97(),this['_focusables']=this['createCollection'](),this['focusCycler']=new _0x125535({'focusables':this['_focusables'],'focusTracker':this['_focusTracker'],'keystrokeHandler':this['_keystrokes'],'actions':{'focusPrevious':'shift\x20+\x20tab','focusNext':'tab'}}),this['_dialogContent']=new _0xdb22e9(),this['_addContentWrapper'](_0x3b4125),this['_addDisclaimerView'](),this['_addToolbar'](_0x3b4125),this['_focusables']['clear'](),this['_focusables']['addMany']([this['_toolbarView']]),this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-actions-balloon-main']},'children':this['_dialogContent']}),this['on']('change:isTrackChangesOn',()=>{this['_toggleToolbarButtonsVisibility'](_0x3b4125);});}['render'](){super['render']();for(const _0x18717e of this['_focusables'])this['_focusTracker']['add'](_0x18717e['element']);this['_keystrokes']['listenTo'](this['element']),this['_initializeScrollManager']();}['destroy'](){super['destroy'](),this['_scrollManager']&&this['_scrollManager']['destroy']();}['focus'](_0x4c3d70){-0x1===_0x4c3d70?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}['setIsLoading'](_0x1c7035){this['_isLoading']=_0x1c7035;}['setErrorState'](){this['_hasError']=!0x0,this['_miniToolbarView']['toggleShowChangesEnabled'](!0x1);}['clearErrorState'](){this['_hasError']=!0x1,this['_miniToolbarView']['toggleShowChangesEnabled'](!0x0);}['showError'](_0x3f8b1b){super['showError'](_0x3f8b1b),this['_dialogContent']['has'](this['_errorView'])||this['_dialogContent']['add'](this['_errorView'],0x0);}['hideError'](){super['hideError'](),this['clearErrorState']();}['showBlockingError'](_0x5d82bf){super['showBlockingError'](_0x5d82bf),this['setErrorState']();}['addMiniToolbarItem'](_0x368d1d){this['_miniToolbarView']['items']['has'](_0x368d1d)||this['_miniToolbarView']['items']['add'](_0x368d1d);}['removeMiniToolbarItem'](_0x4099e2){this['_miniToolbarView']['items']['has'](_0x4099e2)&&this['_miniToolbarView']['items']['remove'](_0x4099e2);}['showLoader'](){this['_loaderView']&&(this['_isLoading']=!0x0);}['hideLoader'](){this['_loaderView']&&(this['_isLoading']=!0x1);}['_toggleToolbarButtonsVisibility']({showApplyButton:_0x3422cd,showSuggestButton:_0x2c0b82}){_0x3422cd=_0x3422cd&&!this['isTrackChangesOn']&&this['_config']['availableActions']['includes']('applySuggestion'),_0x2c0b82=_0x2c0b82&&this['_config']['availableActions']['includes']('insertSuggestion'),this['_toolbarView']['setButtonsVisibility']({'showApplyButton':_0x3422cd,'showSuggestButton':_0x2c0b82});}async['updateContent'](_0x6245a2){await this['_streamableContentView']['update'](_0x6245a2);}['clearContent'](){this['_streamableContentView']['clear']();}['_addContentWrapper'](_0x210bdf){this['_contentWrapper']=new _0x3ddefc(this['locale']),this['_contentWrapper']['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-actions-balloon-content']},'children':[{'tag':'div','attributes':{'class':['ck-ai-actions-balloon-content-wrapper']},'children':[this['_createLoaderView'](),this['_createStreamableContentView']()]},this['_createMiniToolbar'](_0x210bdf['miniToolbarConfig'])]}),this['_dialogContent']['add'](this['_contentWrapper']);}['_addDisclaimerView'](){this['_disclaimerView']=new yn(this['locale']),this['_dialogContent']['add'](this['_disclaimerView']);}['_addToolbar']({showApplyButton:_0x51c419,showSuggestButton:_0x31a68f}){this['_toolbarView']=new Bn(this['locale'],_0x51c419,_0x31a68f),this['_toolbarView']['applyButton']?.['on']('execute',()=>{this['fire']('applySuggestion');}),this['_toolbarView']['suggestButton']?.['on']('execute',()=>{this['fire']('insertSuggestion');}),this['_toolbarView']['bind']('isEnabled')['to'](this,'isBusy',this,'_isLoading',this,'_hasError',(_0x545fa6,_0x3f2d8a,_0xff5576)=>!(_0x545fa6||_0x3f2d8a||_0xff5576)),this['_toggleToolbarButtonsVisibility']({'showApplyButton':_0x51c419,'showSuggestButton':_0x31a68f}),this['_dialogContent']['add'](this['_toolbarView']);}['_createMiniToolbar'](_0x508745){return this['_miniToolbarView']=new wi(this['locale'],_0x508745),this['_miniToolbarView']['delegate'](...ut)['to'](this),this['_miniToolbarView']['on']('toggleShowChanges',()=>{this['_miniToolbarView']['isShowChangesOn']=!this['_miniToolbarView']['isShowChangesOn'],this['fire']('toggleSuggestionDisplayMode',{'showDiff':this['_miniToolbarView']['isShowChangesOn']});}),this['_miniToolbarView']['bind']('isEnabled')['to'](this,'isBusy',this,'_isLoading',(_0x1b4ae5,_0x33f938)=>!(_0x1b4ae5||_0x33f938)),this['_miniToolbarView'];}['_createLoaderView'](){return this['_loaderView']=new Nn(this['locale']),this['_loaderView']['bind']('isVisible')['to'](this,'_isLoading'),this['_loaderView'];}['_createStreamableContentView'](){return this['_streamableContentView']=new ui(this['locale']),this['_streamableContentView'];}['_setupMiniToolbarButtons'](){const _0x2869da=new _0x4421de(this['locale']),_0x511054=new _0x4421de(this['locale']),_0x329725=new AIActionsBalloonNavigationCounterView(this['locale']),_0x4fbda5=new _0x4421de(this['locale']);_0x2869da['set']({'icon':_0xe187e6,'label':i(this['locale'],'AI_ACTIONS_TRY_AGAIN'),'tooltip':!0x0,'class':'ck-ai-custom-action-button'}),_0x511054['set']({'icon':_0x135ef3,'tooltip':i(this['locale'],'AI_ACTIONS_PREVIOUS_INTERACTION'),'class':'ck-ai-navigation-button\x20ck-ai-previous-button'}),_0x4fbda5['set']({'icon':_0x43eeb7,'tooltip':i(this['locale'],'AI_ACTIONS_NEXT_INTERACTION'),'class':'ck-ai-navigation-button\x20ck-ai-next-button'}),_0x2869da['bind']('isEnabled')['to'](this,'isBusy',_0x30dd60=>!_0x30dd60),_0x2869da['on']('execute',()=>{this['fire']('tryAgain');}),_0x511054['bind']('isEnabled')['to'](this,'isBusy',_0xbbbbfa=>!_0xbbbbfa),_0x511054['on']('execute',()=>{this['fire']('showPrevious');}),_0x4fbda5['bind']('isEnabled')['to'](this,'isBusy',_0x3e30a4=>!_0x3e30a4),_0x4fbda5['on']('execute',()=>{this['fire']('showNext');}),this['_navigationPreviousButton']=_0x511054,this['_navigationCounter']=_0x329725,this['_navigationNextButton']=_0x4fbda5,this['_navigationTryAgainButton']=_0x2869da;}['updateMiniToolbarButtons'](_0x2d2a07,_0x2614d2){this['_navigationPreviousButton']||this['_setupMiniToolbarButtons']();const _0x11e842=_0x2d2a07>0x1;if(this['addMiniToolbarItem'](this['_navigationTryAgainButton']),_0x11e842){this['addMiniToolbarItem'](this['_navigationPreviousButton']),this['addMiniToolbarItem'](this['_navigationCounter']),this['addMiniToolbarItem'](this['_navigationNextButton']);const _0xe53a75=_0x2d2a07-_0x2614d2;this['_navigationCounter']['setInteractionCount'](_0xe53a75+'/'+_0x2d2a07),this['_navigationPreviousButton']['isEnabled']=_0x2614d2<_0x2d2a07-0x1,this['_navigationNextButton']['isEnabled']=_0x2614d2>0x0;}else this['removeMiniToolbarItem'](this['_navigationPreviousButton']),this['removeMiniToolbarItem'](this['_navigationCounter']),this['removeMiniToolbarItem'](this['_navigationNextButton']);}['disableMiniToolbarButtons'](){this['_navigationTryAgainButton']['isEnabled']=!0x1,this['_navigationPreviousButton']['isEnabled']=!0x1,this['_navigationNextButton']['isEnabled']=!0x1;}['startAutoScroll'](){this['_initializeScrollManager'](),this['_scrollManager']&&this['_scrollManager']['start']();}['stopAutoScroll'](){this['_scrollManager']&&this['_scrollManager']['stop']();}['toggleIsLoading'](_0x2c926d){this['_isLoading']=_0x2c926d;}['resetShowChangesButton'](){this['_miniToolbarView']['isShowChangesOn']=!0x1;}['_initializeScrollManager'](){const _0xebd491=this['_getScrollableElement']();_0xebd491&&!this['_scrollManager']&&(this['_scrollManager']=new $e(_0xebd491));}['_getScrollableElement'](){return this['_streamableContentView']['element'];}}class AIActionsBalloonNavigationCounterView extends _0x3ddefc{constructor(_0x1d0847){super(_0x1d0847);const _0x49f122=this['bindTemplate'];this['set']('interactionCount','1/1'),this['setTemplate']({'tag':'span','attributes':{'class':['ck-ai-interaction-counter']},'children':[{'text':_0x49f122['to']('interactionCount')}]});}['setInteractionCount'](_0x46b163){this['set']('interactionCount',_0x46b163);}}class ri extends _0x2b80c4{static get['requires'](){return[q,_0x5ef991,D,Q,_0x5b4177];}static get['pluginName'](){return'AIActions';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['_aiConnector'];['_interactions']=[];['_currentInteractionIndex']=0x0;['_interactionParams'];['_balloonShowDiff']=!0x1;['_promiseQueue'];['_bodyCollection'];get['_interaction'](){return this['_interactions'][this['_interactions']['length']-0x1];}['_actionsBalloonView'];constructor(_0x2cfdc1){super(_0x2cfdc1),this['_bodyCollection']=new _0x6c121d(this['editor']['locale']),this['_bodyCollection']['attachToDom'](),this['_aiConnector']=this['editor']['plugins']['get']('AIConnector'),this['set']('isBusy',!0x1),this['_promiseQueue']=new z();}['stopInteraction'](){this['_stopInteraction']();}async['executeAction'](_0x51e7b6,_0x216bed,_0x14d46f){if(this['_stopInteraction'](),this['editor']['plugins']['has']('TableSelection')){if(this['editor']['plugins']['get']('TableSelection')['getSelectedTableCells']()){const {modelFragment:_0x59ee64,anchorData:_0x346b1d}=this['_getExecuteDataInTable']();return this['_executeAction'](_0x51e7b6,_0x59ee64,_0x346b1d,_0x216bed,_0x14d46f);}}const {modelFragment:_0x15288f,anchorData:_0x3b06ba}=this['_getExecuteDataRegular']();return this['_executeAction'](_0x51e7b6,_0x15288f,_0x3b06ba,_0x216bed,_0x14d46f);}async['destroy'](){return this['_stopInteraction'](),this['_bodyCollection']['detachFromDom'](),super['destroy']();}['_createActionsBalloonView'](){const _0x47ccc0=this['editor']['plugins']['has']('TrackChanges');let _0x1b214c=this['editor']['config']['get']('ai.availableReplyActions')||[...ot];_0x47ccc0||(_0x1b214c=_0x1b214c['filter'](_0x25d45d=>'insertSuggestion'!=_0x25d45d));const _0x316620=this['editor']['commands']['get']('trackChanges'),_0x1ed5c0=new rt(this['editor']['locale'],{'showApplyButton':!0x0,'showSuggestButton':_0x47ccc0,'miniToolbarConfig':{'showChanges':'icon'},'availableActions':_0x1b214c});return _0x1ed5c0['bind']('isBusy')['to'](this),_0x316620&&_0x1ed5c0['bind']('isTrackChangesOn')['to'](_0x316620,'value'),_0x1ed5c0['on']('tryAgain',()=>{this['_refreshInteraction']();}),_0x1ed5c0['on']('showPrevious',()=>{this['_navigateToPrevious']();}),_0x1ed5c0['on']('showNext',()=>{this['_navigateToNext']();}),_0x1ed5c0;}['_getExecuteDataRegular'](){const _0x87dfd0=this['editor']['model']['document']['selection'];if(_0x87dfd0['isCollapsed']){const _0x1da299=_0x382588(_0x87dfd0['getSelectedBlocks']())||this['editor']['model']['schema']['getLimitElement'](_0x87dfd0);this['editor']['model']['change'](_0x4bc946=>{_0x4bc946['setSelection'](_0x1da299,'in');});}const _0x4dc186=_0x87dfd0['getFirstRange'](),_0x15f433=this['_wrapWithCommonAncestors'](this['editor']['model']['getSelectedContent'](_0x87dfd0),_0x4dc186['start'],_0x4dc186['end']);this['_copyMarkersToFragment'](_0x15f433,_0x87dfd0,{'isTableSelection':!0x1});const _0x34fc98=_0x87dfd0['getFirstRange']()['start'],_0x44bd5a=new Map();let _0x36882b=_0x15f433;for(let _0x467478=0x0;_0x467478<_0x34fc98['path']['length'];_0x467478++)_0x44bd5a['set'](_0x36882b,_0x34fc98['path'][_0x467478]),_0x36882b=_0x36882b['getChild'](0x0);return{'modelFragment':_0x15f433,'anchorData':_0x44bd5a};}['_getExecuteDataInTable'](){const _0x3ca209=this['editor']['model']['document']['selection'],_0x5171ac=this['editor']['plugins']['get']('TableSelection')['getSelectionAsFragment'](),_0x590b74=_0x3ca209['getFirstRange']()['start']['parent']['parent'],_0x17f78b=this['editor']['model']['createRange'](this['editor']['model']['createPositionBefore'](_0x590b74),this['editor']['model']['createPositionAfter'](_0x590b74)),_0x1e2370=this['_wrapWithCommonAncestors'](_0x5171ac,_0x17f78b['start'],_0x17f78b['end']);this['_copyMarkersToFragment'](_0x1e2370,_0x3ca209,{'isTableSelection':!0x0});const _0x3c0320=_0x3ca209['getFirstRange']()['start'],_0x3a0496=new Map();let _0x494934=_0x1e2370;for(let _0x5e2b1c=0x0;_0x5e2b1c<_0x3c0320['path']['length'];_0x5e2b1c++)if(_0x3a0496['set'](_0x494934,_0x3c0320['path'][_0x5e2b1c]),_0x5e2b1c<_0x3c0320['path']['length']-0x1)_0x494934=_0x494934['getChild'](0x0);else{let _0x530577=_0x494934['nextSibling'];for(;_0x530577;)_0x3a0496['set'](_0x530577,_0x3c0320['path'][_0x5e2b1c]),_0x530577=_0x530577['nextSibling'];}return{'modelFragment':_0x1e2370,'anchorData':_0x3a0496};}async['_executeAction'](_0x3f8332,_0x55dbb4,_0x4dbaa8,_0x66017f,_0x3d9ec5){const _0x26b1a8=this['editor']['plugins']['get'](D),_0x193bd5=this['editor']['plugins']['get'](Q),_0x51eaef=this['editor']['model']['document']['selection'],_0x40c07e=await _0x26b1a8['modelToDataWithIds'](_0x55dbb4),_0x4e88a6=this['editor']['model']['document']['version'],_0x56bb30=[..._0x51eaef['getRanges']()];return this['_actionsBalloonView']||(this['_actionsBalloonView']=this['_createActionsBalloonView']()),this['_clearInteractionHistory'](),this['_clearErrorState'](),this['_actionsBalloonView']['clearContent'](),_0x193bd5['open']({'index':0x3e8*Math['random']()%0x3e8,'title':_0x66017f,'icon':_0x3d9ec5||_0x291361,'mainView':this['_actionsBalloonView'],'class':'ck-ai-actions-balloon','ranges':_0x56bb30,'id':'aiActionsBalloon'}),this['_setLoadingState'](),this['stopListening'](this['_actionsBalloonView']),this['stopListening'](_0x193bd5),this['_interactionParams']={'action':_0x3f8332,'content':_0x40c07e,'version':_0x4e88a6,'aiBalloon':_0x193bd5,'modelFragment':_0x55dbb4,'anchorData':_0x4dbaa8},this['_setupApplyListeners'](),this['listenTo'](_0x193bd5,'selectionRemoved',()=>{this['_stopInteraction'](),this['_actionsBalloonView']['disableMiniToolbarButtons']();}),this['listenTo'](_0x193bd5,'dialogClosed',(_0x3ff555,{id:_0x43ee58})=>{if('aiActionsBalloon'===_0x43ee58){if(this['_interaction']&&this['_interaction']['replies']['length']>0x0){const _0x3ba39b=this['_interaction']['replies'][this['_interaction']['replies']['length']-0x1],_0x5d60b8=_0x3ba39b['changeGroups'][0x0];_0x5d60b8&&'pending'===_0x5d60b8['state']&&_0x3ba39b['setChangeGroupState'](0x0,'rejected');}this['_stopInteraction'](),this['_clearInteractionHistory'](),this['stopListening'](this['_actionsBalloonView']),this['stopListening'](_0x193bd5);}}),this['_createInteraction'](_0x40c07e,_0x4e88a6,_0x193bd5,_0x3f8332);}['_setupApplyListeners'](){if(!this['_interactionParams'])return;const {modelFragment:_0x52ae2c,anchorData:_0x43d417}=this['_interactionParams'];this['listenTo'](this['_actionsBalloonView'],'applySuggestion',()=>{this['_applyChanges'](_0x52ae2c,_0x43d417,!0x1);}),this['listenTo'](this['_actionsBalloonView'],'insertSuggestion',()=>{this['_applyChanges'](_0x52ae2c,_0x43d417,!0x0);});}['_wrapWithCommonAncestors'](_0x1b2166,_0x35f174,_0x38f2c4){const _0x2ca04f=this['editor']['model']['createRange'](_0x35f174,_0x38f2c4)['getCommonAncestor'](),_0x2ff6b0=_0x2ca04f['is']('documentFragment')?[]:_0x2ca04f['getAncestors']({'includeSelf':!0x0})['slice'](0x1);if(_0x2ff6b0['length']){const _0x46f156=_0x2ff6b0['map'](_0x30ce4b=>_0x30ce4b['_clone'](!0x1));for(let _0x27ab9d=0x1;_0x27ab9d<_0x46f156['length'];_0x27ab9d++)_0x46f156[_0x27ab9d-0x1]['_appendChild'](_0x46f156[_0x27ab9d]);return _0x46f156[_0x46f156['length']-0x1]['_appendChild'](_0x1b2166),new tt(_0x46f156[0x0]);}return _0x1b2166;}['_copyMarkersToFragment'](_0x150e93,_0x58ce54,_0x548b49={'isTableSelection':!0x1}){const _0x1aa4a5=this['editor']['model'],_0x533806=Array['from'](_0x58ce54['getRanges']()),_0x2e2fd9=_0x58ce54['getFirstRange']()['start'];for(const _0x345ffe of _0x1aa4a5['markers']){if(_0x345ffe['name']['startsWith'](R)||!_0x345ffe['affectsData'])continue;const _0x4743cf=_0x345ffe['getRange']();if(!_0x533806['some'](_0x5837e1=>_0x5837e1['containsRange'](_0x4743cf,!0x0)))continue;const _0x4261ee=this['_regularCalculateMarkerPath'](_0x4743cf['start'],_0x2e2fd9,_0x548b49['isTableSelection']),_0x4fc1ff=this['_regularCalculateMarkerPath'](_0x4743cf['end'],_0x2e2fd9,_0x548b49['isTableSelection']),_0x4a0001=_0x1aa4a5['createPositionFromPath'](_0x150e93,_0x4261ee),_0x1377a5=_0x1aa4a5['createPositionFromPath'](_0x150e93,_0x4fc1ff);if(!_0x4a0001['isEqual'](_0x1377a5)){const _0x595fc4=_0x1aa4a5['createRange'](_0x4a0001,_0x1377a5);_0x150e93['markers']['set'](_0x345ffe['name'],_0x595fc4);}}}['_regularCalculateMarkerPath'](_0x1b9665,_0xa8a84a,_0x266351=!0x1){const _0x4e52ab=[..._0x1b9665['path']['slice']()];for(let _0x411a3f=0x0;_0x411a3f<Math['max'](_0xa8a84a['path']['length'],_0x1b9665['path']['length']);_0x411a3f++){const _0xf17301=_0xa8a84a['path'][_0x411a3f]||0x0,_0x34935d=(_0x1b9665['path'][_0x411a3f]||0x0)-_0xf17301;if(_0x4e52ab[_0x411a3f]=_0x34935d,0x0!==_0x34935d&&!_0x266351)break;}return _0x4e52ab;}async['_createInteraction'](_0x339fe9,_0x5c1c7b,_0xf840c9,_0x5afc36){const _0x67c173=this['editor'];this['_interactionParams']||(this['_interactionParams']={'action':_0x5afc36,'content':_0x339fe9,'version':_0x5c1c7b,'aiBalloon':_0xf840c9,'modelFragment':this['editor']['model']['getSelectedContent'](this['editor']['model']['document']['selection']),'anchorData':new Map()});const _0x5990cb=new W({'connector':this['_aiConnector'],'editor':_0x67c173,'content':_0x339fe9,'version':_0x5c1c7b,..._0x5afc36});this['_interactions']['push'](_0x5990cb);const _0xbc6569=(_0x290493,_0x553dbf=!0x1,_0x4f37aa='streaming')=>this['_promiseQueue']['enqueue'](async _0x6aea72=>{try{const _0x17c2bd=J({'editor':_0x67c173,'changeGroups':_0x290493['changeGroups'],'documentContextContent':_0x290493['documentContextContent'],'showDiff':_0x553dbf,'trimUnchanged':!0x1});_0x17c2bd['length']&&await this['_actionsBalloonView']['updateContent']({'part':_0x17c2bd[0x0],'renderingStrategy':_0x4f37aa,'abortSignal':_0x6aea72});}catch(_0x4547fc){if(this['_isAbortError'](_0x4547fc))return;throw _0x4547fc;}});this['_interaction']['on']('replyCreated',(_0x50ee0a,_0xca0259)=>{this['_actionsBalloonView']['hideLoader'](),this['_actionsBalloonView']['startAutoScroll'](),_0xbc6569(_0xca0259)['catch'](_0xe745b5=>{this['_isAbortError'](_0xe745b5)||(console['error']('Error\x20updating\x20content\x20in\x20replyCreated:',_0xe745b5),this['_setErrorState'](_0x5990cb));});}),this['_interaction']['on']('replyContentUpdated',(_0x18665d,_0x14c9c5)=>{_0xbc6569(_0x14c9c5)['catch'](_0x19ff4e=>{this['_isAbortError'](_0x19ff4e)||(console['error']('Error\x20updating\x20content\x20in\x20replyContentUpdated:',_0x19ff4e),this['_setErrorState'](_0x5990cb));});}),this['_interaction']['on']('interactionFinished',async()=>{try{await this['_clearLoadingState'](),this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']),await this['_promiseQueue']['queueEmptyPromise'];}catch(_0x3d8a5a){this['_isAbortError'](_0x3d8a5a)||(console['error']('Error\x20clearing\x20loading\x20state\x20in\x20interactionFinished:',_0x3d8a5a),this['_setErrorState'](_0x5990cb));}finally{this['_actionsBalloonView']['stopAutoScroll']();}}),this['listenTo'](this['_actionsBalloonView'],'toggleSuggestionDisplayMode',async(_0x2d7636,{showDiff:_0x427a63})=>{try{this['_balloonShowDiff']=_0x427a63;const _0xf41767=this['_interaction']['replies'][this['_interaction']['replies']['length']-0x1];_0xf41767&&await _0xbc6569(_0xf41767,_0x427a63,'static');}catch(_0x3e08d7){this['_isAbortError'](_0x3e08d7)||(console['error']('Error\x20updating\x20content\x20in\x20toggleSuggestionDisplayMode:',_0x3e08d7),this['_setErrorState'](_0x5990cb));}}),this['_interaction']['on']('replyChangeGroupStateUpdated',(_0xf85df3,{reply:_0x2055e3})=>{const _0x3758ac={'positiveCount':_0x2055e3['changeGroups']['filter'](_0x1b72ca=>'accepted'===_0x1b72ca['state'])['length'],'totalCount':_0x2055e3['changeGroups']['length']},_0x2ca77c=this['_interaction']['actionCallId'],_0x3760df=this['_interaction']['actionName'];_0x3760df?this['_aiConnector']['upsertAIActionRating'](_0x3760df,_0x2ca77c,_0x3758ac):this['_aiConnector']['upsertCustomAIActionRating'](_0x2ca77c,_0x3758ac);}),this['_setLoadingState']();try{const _0xbadaee=await this['_interaction']['start']();return this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']),_0xbadaee;}catch(_0x3b130c){if(this['_isAbortError'](_0x3b130c))return;this['_actionsBalloonView']['hideLoader'](),this['_setErrorState'](_0x5990cb);}}['_applyChanges'](_0x3ea734,_0x3240fa,_0x232c1e){const _0x572479=this['editor'];if(_0x232c1e&&!_0x572479['plugins']['has']('TrackChanges'))throw new _0x2ae61f('ai-no-track-changes',null);const _0x4e5edf=this['editor']['plugins']['get'](_0x5b4177),_0xe07f95=this['_interactions'][this['_interactions']['length']-0x1-this['_currentInteractionIndex']];if(!_0xe07f95||!_0xe07f95['replies']['length'])return;const _0x525070=_0xe07f95['replies'][_0xe07f95['replies']['length']-0x1],_0x3e969a=_0x525070['changeGroups'];_0x525070['setChangeGroupState'](0x0,'accepted');let _0x4d4ea7=Z({'editor':_0x572479,'reply':_0x525070,'interaction':_0xe07f95,'groups':_0x3e969a,'transform':!0x1,'documentCompare':_0x4e5edf,'documentCompareOptions':{'anchor':_0x572479['model']['createPositionAt'](_0x3ea734,0x0),'markDeletions':_0x232c1e}});_0x4d4ea7=this['_filterOperationsOutsideRange'](_0x4d4ea7,_0x3240fa);for(const _0xfcc79 of _0x4d4ea7)this['_anchorOperation'](_0x3240fa,_0xfcc79,_0x572479['model']['document']['getRoot']());const _0x74b810=_0xe07f95['getDocumentContext']()['version'],_0xd86c8e=_0x572479['model']['document']['history']['getOperations'](_0x74b810),_0x5c8589={'document':_0x572479['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1},_0xe07fec=nt(_0x4d4ea7,_0xd86c8e,_0x5c8589)['operationsA'];_0x572479['model']['change'](_0xcd8d55=>{if(_0xcd8d55['setSelection'](_0x572479['model']['document']['selection']['focus']),_0x232c1e)_0x572479['plugins']['get']('TrackChangesEditing')['_applyOperationsAsSuggestions'](_0xe07fec);else{for(const _0x24e8f8 of _0xe07fec)_0x24e8f8['baseVersion']=_0x572479['model']['document']['version'],Y(_0x572479,_0x24e8f8),_0xcd8d55['batch']['addOperation'](_0x24e8f8),_0x572479['model']['applyOperation'](_0x24e8f8);}}),this['editor']['plugins']['get']('AIBalloon')['close']();}['_filterOperationsOutsideRange'](_0x4964de,_0xa532e8){return _0x4964de['filter'](_0x125894=>{if('rename'==_0x125894['type']){const _0x513783=_0x125894['position']['nodeAfter'];return!_0xa532e8['has'](_0x513783);}if(_0x125894['type']['indexOf']('Attribute')>-0x1){const _0x57bda5=_0x125894['range']['start']['nodeAfter'];return!_0xa532e8['has'](_0x57bda5);}return!0x0;});}['_anchorOperation'](_0x68649,_0x1087b4,_0x116276){const _0x55e26c=_0x1087b4['clone']();for(const _0xfc6e1e in _0x1087b4){const _0xc64e2c=_0x1087b4[_0xfc6e1e];_0xc64e2c instanceof it?_0x1087b4[_0xfc6e1e]=new it(_0x2aa6e4(_0xc64e2c['start']),_0x2aa6e4(_0xc64e2c['end'])):_0xc64e2c instanceof st&&(_0x1087b4[_0xfc6e1e]=_0x2aa6e4(_0xc64e2c));}if(['insert','move','remove','reinsert','split','merge']['includes'](_0x55e26c['type'])){if(_0x55e26c['isDocumentOperation']=!0x1,_0x55e26c['baseVersion']=null,'remove'==_0x55e26c['type']){const _0x288fe0=_0x55e26c['sourcePosition'],_0x57cc05=_0x55e26c['howMany'];new et(_0x288fe0,_0x57cc05)['_execute']();}else _0x55e26c['_execute']();}function _0x2aa6e4(_0x34b6ee){if('$graveyard'==_0x34b6ee['root']['rootName'])return _0x34b6ee;const _0x28d6ee=[];let _0x5c50fc=_0x34b6ee['root'];for(let _0x1556db=0x0;_0x1556db<_0x34b6ee['path']['length'];_0x1556db++){const _0x2a9ad0=_0x68649['get'](_0x5c50fc)||0x0;_0x28d6ee[_0x1556db]=_0x34b6ee['path'][_0x1556db]+_0x2a9ad0,_0x5c50fc=_0x5c50fc['getChildAtOffset'](_0x34b6ee['path'][_0x1556db]);}return new st(_0x116276,_0x28d6ee,_0x34b6ee['stickiness']);}}['_refreshInteraction'](){if(!this['_interactionParams'])return;this['_interactions']['length']>0x0&&this['_stopInteraction'](),this['_currentInteractionIndex']=0x0,this['_balloonShowDiff']=!0x1;const {action:_0x1b30fc,content:_0x13e0eb,version:_0x25e9b3,aiBalloon:_0x2f77fc}=this['_interactionParams'];this['_clearErrorState'](),this['_actionsBalloonView']['clearContent'](),this['_actionsBalloonView']['showLoader'](),this['_actionsBalloonView']['resetShowChangesButton'](),this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']),this['stopListening'](this['_actionsBalloonView']),this['_setupApplyListeners'](),this['_createInteraction'](_0x13e0eb,_0x25e9b3,_0x2f77fc,_0x1b30fc)['catch'](_0x4f2acd=>{this['_isAbortError'](_0x4f2acd)||console['error']('Error\x20refreshing\x20interaction:',_0x4f2acd);});}['_isAbortError'](_0x2dd7fa){return!!_0x2dd7fa['message']&&_0x2dd7fa['message']['startsWith']('ai-request-aborted');}['_clearInteractionHistory'](){this['_interactions']=[],this['_interactionParams']=void 0x0,this['_currentInteractionIndex']=0x0,this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']);}['_stopInteraction'](){this['_interaction']&&this['_interaction']['stop'](),this['_promiseQueue']['abort'](),this['isBusy']=!0x1,this['_interactionParams']&&this['_actionsBalloonView']['stopAutoScroll']();}['_navigateToPrevious'](){const _0x2ae3be=this['_interactions']['length'];this['_currentInteractionIndex']<_0x2ae3be-0x1&&this['_displayInteractionAtIndex'](this['_currentInteractionIndex']+0x1);}['_navigateToNext'](){this['_currentInteractionIndex']>0x0&&this['_displayInteractionAtIndex'](this['_currentInteractionIndex']-0x1);}async['_displayInteractionAtIndex'](_0x210ee2){if(!this['_interactionParams'])return;this['_currentInteractionIndex']=_0x210ee2;const _0x5280c0=this['_interactions'][this['_interactions']['length']-0x1-this['_currentInteractionIndex']];if(!_0x5280c0)return;if(_0x5280c0['hasError'])return this['_setErrorState'](_0x5280c0),void this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']);if(!_0x5280c0['replies']['length'])return;this['_actionsBalloonView']['hideError'](),this['_interactionParams']&&this['_clearErrorState']();const _0x23278f=_0x5280c0['replies'][_0x5280c0['replies']['length']-0x1];if(_0x23278f){const _0x199155=this['editor'];try{const _0x20dd3c=J({'editor':_0x199155,'changeGroups':_0x23278f['changeGroups'],'documentContextContent':_0x23278f['documentContextContent'],'showDiff':this['_balloonShowDiff'],'trimUnchanged':!0x1});await new Promise(_0xe9b1=>setTimeout(_0xe9b1,0x32)),await this['_actionsBalloonView']['updateContent']({'part':_0x20dd3c[0x0],'renderingStrategy':'static','abortSignal':new AbortController()['signal']});}catch(_0x513206){this['_isAbortError'](_0x513206)||console['error']('Error\x20updating\x20content\x20during\x20navigation:',_0x513206);}}this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']);}['_setLoadingState'](){this['_actionsBalloonView']['setIsLoading'](!0x0),this['isBusy']=!0x0;}async['_setErrorState'](_0x1f3d5d){const _0x47db61=i(this['editor']['locale'],'AI_ACTIONS_GENERIC_ERROR');this['_actionsBalloonView']['showError'](_0x47db61),_0x1f3d5d['hasError']=!0x0,await this['_promiseQueue']['queueEmptyPromise'],this['_actionsBalloonView']['setErrorState'](),this['_actionsBalloonView']['toggleIsLoading'](!0x0);}['_clearErrorState'](){this['_actionsBalloonView']['hideError'](),this['_actionsBalloonView']['toggleIsLoading'](!0x1);}async['_clearLoadingState'](){await this['_promiseQueue']['queueEmptyPromise'],this['isBusy']=!0x1,this['_actionsBalloonView']['setIsLoading'](!0x1);}}class AIQuickActions extends _0x2b80c4{static get['requires'](){return[ii,ti,ri];}static get['pluginName'](){return'AIQuickActions';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0xdef41){super(_0xdef41),_0xdef41['config']['define']('ai.quickActions',{'extraCommands':[],'removeCommands':[],'isSearchEnabled':!0x0});}}class Ws extends _0x3ddefc{['resultResponseView'];['acceptButtonView'];['dismissButtonView'];['infoButtonView'];['outdatedButtonView'];constructor(_0x41bff6,_0x1371fb){super(_0x41bff6),this['id']=_0x1371fb,this['set']('status','pending'),this['set']('changeId',_0x1371fb),this['resultResponseView']=this['_createResultResponseView'](),this['acceptButtonView']=this['_createAcceptButtonView'](),this['dismissButtonView']=this['_createDismissButtonView'](),this['infoButtonView']=this['_createInfoButtonView'](),this['outdatedButtonView']=this['_createOutdatedButtonView'](),this['set']('isInfoToggleOn',!0x1),this['set']('isActive',!0x1),this['set']('showDiff',!0x0),this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-result',this['bindTemplate']['if']('isActive','ck-ai_review__check-run-result_active')]},'on':{'click':this['bindTemplate']['to']('click'),'mouseover':this['bindTemplate']['to']('mouseover'),'mouseout':this['bindTemplate']['to']('mouseout')},'children':[this['resultResponseView'],{'tag':'div','attributes':{'class':['ck-ai_review__check-run-result-footer']},'children':[{'tag':'div','attributes':{'class':['ck-ai_review__check-run-result-action-buttons']},'children':[this['acceptButtonView'],this['dismissButtonView'],this['outdatedButtonView']]},this['infoButtonView']]}]}),this['on']('click',(_0x1358a7,_0x312f0c)=>{_0x312f0c&&_0x312f0c['target']&&'A'===_0x312f0c['target']['tagName']&&_0x312f0c['preventDefault'](),this['fire']('activateChange',{'id':_0x1371fb,'source':this,'uiInteraction':'click'});}),this['on']('mouseover',()=>{this['fire']('activateChange',{'id':_0x1371fb,'source':this,'uiInteraction':'hover'});}),this['on']('mouseout',()=>{this['fire']('deactivateChange',{'origin':'panel','id':_0x1371fb,'source':this});});}['setItemAsActive'](){this['isActive']=!0x0;}['setItemAsInactive'](){this['isActive']=!0x1;}['_createResultResponseView'](){const _0x14127f=new _0x3ddefc(this['locale']);return _0x14127f['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content','ck-reset_all-excluded','ck-ai_review__check-run-result-response',this['bindTemplate']['if']('showDiff','ck-hidden',_0x5ed3c1=>!_0x5ed3c1)]}}),_0x14127f;}['_createAcceptButtonView'](){const _0xc649ed=new _0x4421de(this['locale']);return _0xc649ed['set']({'label':i(this['locale'],'AI_REVIEW_MODE_ACCEPT_CHANGE'),'withText':!0x0}),_0xc649ed['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x543613=>{this['fire']('acceptChange',{'id':this['changeId']}),_0x543613['stopPropagation']();})},'attributes':{'class':['ck-ai-button-secondary','ck-ai_review__check-run-result-accept-button',this['bindTemplate']['if']('status','ck-hidden',_0x3d2918=>'pending'!==_0x3d2918&&'accepted'!==_0x3d2918),this['bindTemplate']['if']('status','ck-ai_review__check-run-result-accept-button',_0x468503=>'pending'===_0x468503),this['bindTemplate']['if']('status','ck-ai_review__check-run-result-status-button',_0x4c7818=>'accepted'===_0x4c7818)]}}),this['on']('change:status',(_0xda7906,_0x400641,_0x2fa590)=>{_0xc649ed['isEnabled']='pending'===_0x2fa590,'accepted'===_0x2fa590&&(_0xc649ed['label']=i(this['locale'],'AI_REVIEW_MODE_CHECK_STATUS_ACCEPTED'),_0xc649ed['icon']=_0x42c617);}),_0xc649ed;}['_createDismissButtonView'](){const _0x330a75=new _0x4421de(this['locale']);return _0x330a75['set']({'label':i(this['locale'],'AI_REVIEW_MODE_DISMISS_CHANGE'),'withText':!0x0}),_0x330a75['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x9b4541=>{this['fire']('dismissChange',{'id':this['changeId']}),_0x9b4541['stopPropagation']();})},'attributes':{'class':['ck-ai-button-tertiary',this['bindTemplate']['if']('status','ck-hidden',_0x4d748f=>'pending'!==_0x4d748f&&'rejected'!==_0x4d748f),this['bindTemplate']['if']('status','ck-ai_review__check-run-result-dismiss-button',_0x4ce6eb=>'pending'===_0x4ce6eb),this['bindTemplate']['if']('status','ck-ai_review__check-run-result-status-button',_0x1d9df7=>'rejected'===_0x1d9df7)]}}),this['on']('change:status',(_0x5cd854,_0x4c6e84,_0x156ecb)=>{_0x330a75['isEnabled']='pending'===_0x156ecb,'rejected'===_0x156ecb&&(_0x330a75['label']=i(this['locale'],'AI_REVIEW_MODE_CHECK_STATUS_REJECTED'),_0x330a75['icon']=_0x3cff34);}),_0x330a75;}['_createInfoButtonView'](){const _0x45510c=new _0x4421de(this['locale']);return _0x45510c['set']({'label':i(this['locale'],'AI_REVIEW_MODE_LEARN_MORE'),'icon':_0x1eb394,'tooltip':!0x0,'isToggleable':!0x0,'role':'menuitemcheckbox','class':'ck-ai-button-tertiary\x20ck-ai_review__check-run-result-info-button\x20ck-hidden'}),_0x45510c['bind']('isOn')['to'](this,'isInfoToggleOn',_0x5edb3c=>_0x5edb3c),_0x45510c['on']('execute',()=>{this['isInfoToggleOn']=!this['isInfoToggleOn'];}),_0x45510c;}['_createOutdatedButtonView'](){const _0x342e59=new _0x4421de(this['locale']);return _0x342e59['set']({'label':i(this['locale'],'AI_REVIEW_MODE_CHECK_STATUS_OUTDATED'),'icon':_0x43b82b,'withText':!0x0,'isEnabled':!0x1}),_0x342e59['extendTemplate']({'attributes':{'class':['ck-ai-button-secondary','ck-ai_review__check-run-result-status-button',this['bindTemplate']['if']('status','ck-hidden',_0x2f6567=>'outdated'!==_0x2f6567)],'disabled':'disabled'}}),_0x342e59;}}class me extends _0x435ccf{['resultItemView'];['_pinnedRectIndex']=void 0x0;['_pinnedTargetElement']=void 0x0;['_pinnedTargetChangeId']=void 0x0;constructor(_0x3c9078,_0x3a626a){super(_0x3c9078),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']()),_0x3a626a['add'](this);}['render'](){super['render'](),this['_setupClickOutsideHandler']();}['updateContent'](_0x1d00c2){this['resultItemView']['changeId']=_0x1d00c2['id'],this['resultItemView']['resultResponseView']['element']['innerHTML']=_0x1d00c2['contentDiffed'];}['showBalloon'](_0x10d088,_0x310cf4,_0xd00cca,_0x4e2c56,_0x26f862,_0x1f8ba2){const _0x3643dc=_0x310cf4();if(!_0x3643dc)return;this['updateContent'](_0x10d088),this['show']();const _0x339968=Array['from'](_0x3643dc['getClientRects']())['reverse'](),_0x31b750=this['_getPointedRectIndexFromEvent'](_0xd00cca,_0x339968),_0xfd2556=_0x339968[_0x31b750??0x0];'click'===_0x4e2c56?(this['isDiffActive']=!0x0,this['pin']({'target':()=>this['_getBestRectPositionOnClick'](_0x310cf4(),_0x31b750,_0x10d088['id'],_0x26f862,_0x1f8ba2)||_0xfd2556})):'hover'===_0x4e2c56&&(this['isDiffActive']=!0x1,this['pin']({'target':()=>this['_getBestRectPositionOnHover'](_0x310cf4(),_0x31b750,_0x10d088['id'])||_0xfd2556}));}['hideBalloon'](){this['hide'](),this['unpin'](),this['_pinnedRectIndex']=void 0x0,this['_pinnedTargetElement']=void 0x0,this['_pinnedTargetChangeId']=void 0x0;}['hideDiffInBalloon'](){this['resultItemView']['showDiff']=!0x1;}['showDiffInBalloon'](){this['resultItemView']['showDiff']=!0x0;}['deactivateChange'](){this['fire']('deactivateChange',{'origin':'balloon'});}['_setupClickOutsideHandler'](){_0xa9d580({'emitter':this,'activator':()=>this['isVisible'],'contextElements':()=>{const _0x2183c6=[this['element']];return this['_pinnedTargetElement']&&_0x2183c6['push'](this['_pinnedTargetElement']),_0x2183c6;},'callback':()=>{this['hide'](),this['unpin'](),this['deactivateChange'](),this['_pinnedTargetElement']=void 0x0,this['_pinnedRectIndex']=void 0x0,this['_pinnedTargetChangeId']=void 0x0;}});}['_createContentView'](){const _0x35c0dc=new _0x3ddefc();return this['resultItemView']=new Ws(this['locale'],''),this['resultItemView']['resultResponseView']['extendTemplate']({'attributes':{'class':['ck-content']}}),this['resultItemView']['delegate']('acceptChange','dismissChange')['to'](this),_0x35c0dc['setTemplate']({'tag':'div','attributes':{'class':['ck-reset','ck-ai_review-balloon-panel-suggestion',this['bindTemplate']['if']('isDiffActive','ck-ai_review-balloon-panel-suggestion_diff-active')]},'children':[{'tag':'p','attributes':{'class':['ck-ai_review__suggestion-text']},'children':[this['resultItemView']]}]}),_0x35c0dc;}['_getBestRectPositionOnClick'](_0x4639d3,_0x3fd53e,_0x4e7f1b,_0x4abdf4,_0x4587e8){if(!_0x4639d3)return null;const _0x5beaad=this['position']['replace']('arrow_',''),_0x16c96a=Array['from'](_0x4639d3['getClientRects']());let _0x629b21,_0x22c5bb=_0x16c96a['reverse']();return void 0x0!==_0x3fd53e&&this['_isPinnedRectVisible'](_0x22c5bb[_0x3fd53e],_0x4abdf4,_0x4587e8)?(_0x629b21=_0x22c5bb[_0x3fd53e],this['_pinnedRectIndex']=_0x3fd53e):this['_isPinnedRectVisible'](_0x22c5bb[0x0],_0x4abdf4,_0x4587e8)&&void 0x0===_0x3fd53e?_0x629b21=_0x22c5bb[0x0]:(_0x22c5bb='s'==_0x5beaad[0x0]?[..._0x16c96a]['reverse']():_0x16c96a,_0x22c5bb['forEach'](_0x361ee6=>{this['_isPinnedRectVisible'](_0x361ee6,_0x4abdf4,_0x4587e8)&&(_0x629b21=_0x361ee6);})),this['_pinnedTargetChangeId']=_0x4e7f1b,this['_pinnedTargetElement']=_0x4639d3,_0x629b21||_0x4639d3['getBoundingClientRect']();}['_getBestRectPositionOnHover'](_0x1199df,_0x689595,_0x2742d7){if(!_0x1199df)return null;const _0x9482b0=Array['from'](_0x1199df['getClientRects']())['reverse']();if(void 0x0===this['_pinnedRectIndex']&&void 0x0!==_0x689595&&this['_pinnedTargetChangeId']!==_0x2742d7)return this['_pinnedRectIndex']=_0x689595,this['_pinnedTargetElement']=_0x1199df,this['_pinnedTargetChangeId']=_0x2742d7,_0x9482b0[_0x689595];if(void 0x0!==this['_pinnedRectIndex']&&this['_pinnedTargetChangeId']===_0x2742d7){if(_0x1199df!==this['_pinnedTargetElement'])return Array['from'](this['_pinnedTargetElement']['getClientRects']())['reverse']()[this['_pinnedRectIndex']];return _0x9482b0[this['_pinnedRectIndex']];}return void 0x0!==_0x689595&&this['_pinnedTargetChangeId']!==_0x2742d7?(this['_pinnedRectIndex']=_0x689595,this['_pinnedTargetElement']=_0x1199df,this['_pinnedTargetChangeId']=_0x2742d7,_0x9482b0[_0x689595]):_0x1199df['getBoundingClientRect']();}['_getPointedRectIndexFromEvent'](_0x2ae70a,_0x51d2f1){if(_0x2ae70a)for(let _0x3ecfad=0x0;_0x3ecfad<_0x51d2f1['length'];_0x3ecfad++){const _0xd96577=_0x51d2f1[_0x3ecfad];if(_0x2ae70a['clientX']>=_0xd96577['left']-0x3&&_0x2ae70a['clientX']<=_0xd96577['right']+0x3&&_0x2ae70a['clientY']>=_0xd96577['top']-0x3&&_0x2ae70a['clientY']<=_0xd96577['bottom']+0x3)return _0x3ecfad;}}['_isPinnedRectVisible'](_0x2c2b68,_0x4d1e6a,_0x4fc4e0){const _0x4da9e5=new _0x4fa19a(_0x2c2b68),_0x5347ab=_0x4d1e6a||document['documentElement'],_0x211d82=_0x4da9e5['getIntersection'](_0xf2e492(_0x4fc4e0)),_0x27c4bb=new _0x4fa19a(_0x5347ab)['getIntersection'](_0x4da9e5);return!!(_0x211d82&&_0x27c4bb&&_0x4da9e5['width']>0x0);}}const ih=['getReviewCheckList','runReviewCheck','abortReviewStream','toggleDiff','acceptAllChanges','leaveReviewCoreResultList','activateChange','deactivateChange','acceptChange','dismissChange','learnMore','finishReview','retryReview'];class Me extends _0x3b66f2{['_mainView'];['_balloonSuggestionView'];['_bodyCollection'];static get['requires'](){return[pt];}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x284f84){super(_0x284f84),this['_bodyCollection']=new _0x6c121d(this['context']['locale']),this['_bodyCollection']['attachToDom'](),this['_mainView']=this['createMainView'](),this['_mainView']['delegate'](...ih)['to'](this),this['_balloonSuggestionView']=new me(this['context']['locale'],this['_bodyCollection']),this['_balloonSuggestionView']['delegate']('acceptChange','dismissChange','deactivateChange')['to'](this);}['init'](){const _0xf93dde=this['context']['plugins']['get']('AITabs');this['registerTab'](_0xf93dde);}['destroy'](){this['_bodyCollection']['detachFromDom'](),super['destroy']();}['setAvailableChecks'](_0x1110cd){if(!this['_mainView']['reviewCheckListView']['hasChecks']()){const _0x50eb78=!this['context']['config']['get']('ai.models.showModelSelector');this['_mainView']['reviewCheckListView']['setChecks'](_0x1110cd,_0x50eb78);}this['_mainView']['showReviewCheckListView']();}['showReviewCheckList'](){this['fire']('getReviewCheckList');}['showCheckRunResults'](_0x54c6f0){_0x54c6f0&&('error-general'!==_0x54c6f0['status']?'error-chunk'!==_0x54c6f0['status']?this['_mainView']['showReviewCheckResultsView']():this['showChunkErrorView']():this['showGeneralResultsErrorView']());}['showCheckRunResult'](_0x18947c){this['_mainView']['addCheckRunResult'](_0x18947c);}['showGeneralResultsErrorView'](){this['_mainView']['showGeneralResultsErrorView']();}['showGeneralReviewCoreErrorView'](_0x4c825b){this['_mainView']['showGeneralReviewCoreErrorView'](_0x4c825b??i(this['context']['locale'],'AI_REVIEW_INITIALIZATION_ERROR_MESSAGE'));}['showChunkErrorView'](){this['_mainView']['showChunkErrorView']();}['setCheckResultTitle'](_0x2ea9cf,_0x5eac9e){this['_mainView']['reviewCheckResultsView']['setTitle'](_0x2ea9cf,_0x5eac9e);}['setActiveStateInResults'](_0x2a29c0){this['_mainView']['reviewCheckResultsView']['getResults']()['forEach'](_0x56ad59=>{_0x56ad59['id']===_0x2a29c0&&_0x56ad59['setItemAsActive']();});}['resetActiveStateInResults'](){this['_mainView']['reviewCheckResultsView']['getResults']()['forEach'](_0x220923=>_0x220923['setItemAsInactive']());}['updateChangeState'](_0x48bb7d,_0x4ee6bd){'accepted'===_0x4ee6bd||'rejected'===_0x4ee6bd||'outdated'===_0x4ee6bd?this['_mainView']['reviewCheckResultsView']['hideResult'](_0x48bb7d,_0x4ee6bd):this['_mainView']['reviewCheckResultsView']['showResult'](_0x48bb7d,_0x4ee6bd);}['showReviewCompletedView'](){this['_mainView']['showReviewCompletedView']();}['showActionsWhenResultIsReady'](){this['_mainView']['showActionsWhenResultIsReady']();}['showNoChangesView'](){this['_mainView']['showNoChangesView']();}['hideActionsWhenResultIsReady'](){this['_mainView']['hideActionsWhenResultIsReady']();}['showChangeBalloon'](_0x324d56,_0x4971c0,_0x4ba4d6,_0x5b3e61,_0x328b17,_0x205ec4){this['_balloonSuggestionView']['showBalloon'](_0x324d56,_0x4971c0,_0x4ba4d6,_0x5b3e61,_0x328b17,_0x205ec4);}['hideChangeBalloon'](){this['_balloonSuggestionView']['hideBalloon']();}['hideDiffInBalloon'](){this['_balloonSuggestionView']['hideDiffInBalloon']();}['showDiffInBalloon'](){this['_balloonSuggestionView']['showDiffInBalloon']();}['getChangeElement'](_0x4ecee3){const _0x17b5d6=this['_mainView']['reviewCheckResultsView']['getResults']()['find'](_0x4494ca=>_0x4494ca['id']===_0x4ecee3);return _0x17b5d6?_0x17b5d6['element']:null;}['deactivateChange'](){this['_balloonSuggestionView']['deactivateChange']();}}class sh extends _0x3ddefc{constructor(_0x4e4e25){super(_0x4e4e25),this['set']('isVisible',!0x1),this['set']('errorMessage','');const _0xa34108=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai_review__general-error-container',_0xa34108['if']('isVisible','ck-hidden',_0x5dda9f=>!_0x5dda9f)]},'children':[{'tag':'p','attributes':{'class':'ck\x20ck-ai-notification\x20ck-ai-notification_error'},'children':[{'text':_0xa34108['to']('errorMessage')}]}]});}}class Ae extends _0x3ddefc{['reviewCoreHeader'];['generalErrorView'];['reviewCheckListView'];['reviewCheckResultsView'];['reviewCompletedView'];constructor(_0x258a00,_0xaba05b){super(_0x258a00),this['reviewCoreHeader']=_0xaba05b['header'],this['generalErrorView']=new sh(_0x258a00),this['reviewCheckListView']=_0xaba05b['list'],this['reviewCheckListView']['delegate'](...ih)['to'](this),this['reviewCheckResultsView']=_0xaba05b['results'],this['reviewCheckResultsView']['delegate'](...ih)['to'](this),this['reviewCompletedView']=_0xaba05b['completed'],this['reviewCompletedView']['delegate']('finishReview')['to'](this),this['reviewCheckListView']['set']('isVisible',!0x1),this['reviewCheckResultsView']['set']('isVisible',!0x1),this['reviewCheckResultsView']['set']('isLoading',!0x1),this['reviewCheckResultsView']['set']('isResultReady',!0x1),this['reviewCompletedView']['set']('isVisible',!0x1),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-ai-review','ck-rounded-corners'],'dir':'ltr'},'children':[this['reviewCoreHeader'],this['generalErrorView'],this['reviewCheckListView'],this['reviewCheckResultsView'],this['reviewCompletedView']]});}['showReviewCheckListView'](){this['reviewCheckListView']['resetAllParameterizedChecks'](),this['reviewCheckListView']['set']('isVisible',!0x0),this['reviewCheckResultsView']['set']('isVisible',!0x1),this['reviewCompletedView']['set']('isVisible',!0x1);}['showReviewCheckResultsView'](){this['hideActionsWhenResultIsReady'](),this['reviewCheckResultsView']['resetErrorState'](),this['reviewCheckListView']['set']('isVisible',!0x1),this['reviewCheckResultsView']['set']('isVisible',!0x0),this['reviewCheckResultsView']['clearResults'](),this['reviewCheckResultsView']['set']('isLoading',!0x0),this['reviewCheckResultsView']['set']('isCompleted',!0x1);}['addCheckRunResult'](_0x3e9b0e){this['reviewCheckResultsView']['addResult'](_0x3e9b0e),this['reviewCheckResultsView']['set']('isLoading',!0x1);}['showReviewCompletedView'](){this['reviewCheckResultsView']['set']('isVisible',!0x0),this['reviewCompletedView']['set']('isVisible',!0x1),this['reviewCheckResultsView']['set']('isCompleted',!0x0),this['reviewCheckListView']['set']('isVisible',!0x1);}['showActionsWhenResultIsReady'](){this['reviewCheckResultsView']['isResultReady']?(this['reviewCheckListView']['set']('isVisible',!0x1),this['reviewCheckResultsView']['set']('isVisible',!0x0),this['reviewCompletedView']['set']('isVisible',!0x1)):this['reviewCheckResultsView']['isResultReady']=!0x0;}['showNoChangesView'](){this['reviewCheckListView']['set']('isVisible',!0x1),this['reviewCheckResultsView']['set']('isVisible',!0x1),this['reviewCompletedView']['set']('isVisible',!0x0);}['hideActionsWhenResultIsReady'](){this['reviewCheckResultsView']['isResultReady']=!0x1;}['showGeneralReviewCoreErrorView'](_0x2c6b84){this['generalErrorView']['set']('isVisible',!0x0),this['generalErrorView']['errorMessage']=_0x2c6b84;}['showGeneralResultsErrorView'](){this['reviewCheckResultsView']['set']('isLoading',!0x1),this['showActionsWhenResultIsReady'](),this['reviewCheckResultsView']['showGeneralErrorMessage']();}['showChunkErrorView'](){this['reviewCheckResultsView']['set']('isLoading',!0x1),this['showActionsWhenResultIsReady'](),this['reviewCheckResultsView']['showChunkErrorMessage']();}}class vr extends _0x4421de{constructor(_0xb721cb,_0x414ca2){super(_0x414ca2),this['set']({'label':_0xb721cb,'withText':!0x0,'class':'ck-ai-button-primary'}),this['on']('execute',()=>{this['fire']('finishReview');});}}class Ve extends _0x23b8c1{['_resultViews'];['_resultsHeader'];['reviewDisclaimer'];['_cancelButtonView'];['_acceptAllButtonView'];['_exitReviewButtonView'];['_toggleDiffButtonView'];['_errorMessageView'];['_finishReviewButtonView'];['_contents'];constructor(_0x42d8e9,_0x47a835){super(_0x42d8e9),this['_contents']=_0x47a835,this['_resultViews']=new _0xdb22e9(),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 yi(_0x42d8e9),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 _0x2a660a=this['_createCombinedSkeletonLoader'](),_0x3670e9=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run',_0x3670e9['if']('isLoading','ck-ai_review__check-run_loading',_0x433397=>_0x433397),_0x3670e9['if']('isResultReady','ck-ai_review__check-run_ready',_0x2fe3a8=>_0x2fe3a8),_0x3670e9['if']('isVisible','ck-hidden',_0x4cf042=>!_0x4cf042)]},'children':[this['_resultsHeader'],{'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-wrapper']},'children':[this['_errorMessageView'],{'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-container','ck-reset_all-excluded',this['bindTemplate']['if']('isLoading','ck-hidden',_0x5f118d=>_0x5f118d)]},'children':this['_resultViews']},_0x2a660a]},this['reviewDisclaimer']]});}['clearResults'](){this['_resultViews']['clear']();}['getResults'](){return this['_resultViews'];}['addResult'](_0x64fc51){const _0x2b6a51=new Ws(this['locale'],_0x64fc51['id']);_0x2b6a51['delegate']('acceptChange','dismissChange','activateChange','deactivateChange')['to'](this),this['_resultViews']['add'](_0x2b6a51),_0x2b6a51['resultResponseView']['element']['innerHTML']=_0x64fc51['contentDiffed'];}['hideResult'](_0x2e8030,_0x396f0f){if('pending'===_0x396f0f)return;const _0x4cd352=this['_resultViews']['find'](_0xd7edc0=>_0xd7edc0['id']===_0x2e8030);_0x4cd352&&(_0x4cd352['status']=_0x396f0f,_0x4cd352['element']?.['classList']['add']('ck-ai_review__check-run-result_grayout'));}['showResult'](_0x4dfb7b,_0x1442ee){if('pending'!==_0x1442ee)return;const _0x382331=this['_resultViews']['find'](_0x34aed6=>_0x34aed6['id']===_0x4dfb7b);_0x382331&&(_0x382331['status']=_0x1442ee,_0x382331['element']?.['classList']['remove']('ck-ai_review__check-run-result_grayout'));}['setTitle'](_0x30dea3,_0x58f5a0){this['headerTitle']=_0x30dea3,this['headerSubtitle']=_0x58f5a0||'';}['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 di(this['locale'],ki['aiReviewChecks']);}['_createCombinedSkeletonLoader'](){const _0x47d6a9=new _0x3ddefc(this['locale']),_0x4d0c27=[];for(let _0x58bf3a=0x0;_0x58bf3a<0x10;_0x58bf3a++){const _0x5e113e=this['_createSkeletonLoader']();_0x5e113e['extendTemplate']({'attributes':{'class':['ck-ai_review__check-run-skeleton-item']}}),_0x4d0c27['push'](_0x5e113e);}return _0x47d6a9['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-skeleton-container',this['bindTemplate']['if']('isLoading','ck-hidden',_0x572aed=>!_0x572aed)]},'children':_0x4d0c27}),_0x47d6a9;}['_createErrorView'](){const _0x50169e=new _0x3ddefc(this['locale']),_0x5f318d=new _0x4421de(this['locale']),t=this['locale']['t'];return _0x50169e['delegate']('retryReview')['to'](this),_0x5f318d['set']({'label':t('Try\x20again'),'withText':!0x0,'class':'ck-ai-button-secondary\x20ck-ai_review__check-run-error-retry-button'}),_0x5f318d['on']('execute',()=>{this['fire']('retryReview');}),_0x50169e['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-error-container',this['bindTemplate']['if']('showErrorMessage','ck-hidden',_0x3c8cd3=>!_0x3c8cd3),this['bindTemplate']['if']('errorType','ck-ai_review__check-run-error-container_border-bottom',_0xf02ca8=>'chunk'===_0xf02ca8)]},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-notification','ck-ai-notification_error','ck-ai-notification__full-width','ck-ai_review__check-run-error-message',this['bindTemplate']['if']('errorType','ck-ai-notification_warning',_0xbec1b7=>'chunk'===_0xbec1b7)]},'children':[{'tag':'p','attributes':{'class':['ck-ai-notification__content',this['bindTemplate']['if']('errorType','ck-hidden',_0x4c733f=>'general'!==_0x4c733f)]},'children':[{'text':this['_contents']['generalErrorText']}]},{'tag':'p','attributes':{'class':['ck-ai-notification__content',this['bindTemplate']['if']('errorType','ck-hidden',_0x32929d=>'chunk'!==_0x32929d)]},'children':[{'text':i(this['locale'],'AI_REVIEW_MODE_CHUNK_ERROR_MESSAGE')}]}]},_0x5f318d]}),_0x50169e;}['_createCancelButtonView'](){const _0x345430=new _0x4421de(this['locale']);return _0x345430['set']({'label':i(this['locale'],'AI_REVIEW_MODE_STOP_GENERATING'),'withText':!0x0,'class':['ck-ai-button-secondary\x20ck-ai-button-stop-generating'],'icon':_0x8718cf}),_0x345430['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isResultReady','ck-hidden',_0x19cdf8=>_0x19cdf8),this['bindTemplate']['if']('isCompleted','ck-hidden',_0xc4ab1=>_0xc4ab1)]}}),_0x345430['on']('execute',()=>{this['fire']('abortReviewStream');}),_0x345430;}['_createToggleDiffButtonView'](){const _0x5d3717=new _0x4421de(this['locale']);_0x5d3717['set']({'tooltip':!0x0,'isToggleable':!0x0,'role':'menuitemcheckbox'}),_0x5d3717['bind']('isEnabled')['to'](this,'isError',_0x509c00=>!_0x509c00),_0x5d3717['extendTemplate']({'attributes':{'class':['ck-ai-button-secondary','ck-ai_review__check-run-toggle-diff-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0x336bda=>!_0x336bda),this['bindTemplate']['if']('isCompleted','ck-hidden',_0xad03db=>_0xad03db)]}});const _0x467e46=i(this['locale'],'AI_REVIEW_MODE_HIDE_CHANGES'),_0xc43708=i(this['locale'],'AI_REVIEW_MODE_SHOW_CHANGES');return _0x5d3717['bind']('isOn')['to'](this,'isToggleDiffOn',_0x51202e=>_0x51202e),_0x5d3717['bind']('icon')['to'](this,'isToggleDiffOn',_0x16179b=>_0x16179b?_0x1cbbeb:_0xa9cc50),_0x5d3717['bind']('label')['to'](this,'isToggleDiffOn',_0x1fb068=>_0x1fb068?_0x467e46:_0xc43708),_0x5d3717['on']('execute',()=>{this['isToggleDiffOn']=!this['isToggleDiffOn'],this['fire']('toggleDiff',{'on':this['isToggleDiffOn']});}),_0x5d3717;}['_createAcceptAllButtonView'](){const _0x2af0b1=new _0x4421de(this['locale']);return _0x2af0b1['set']({'label':i(this['locale'],'AI_REVIEW_MODE_ACCEPT_ALL'),'withText':!0x0}),_0x2af0b1['bind']('isEnabled')['to'](this,'isError',_0xd46b5b=>!_0xd46b5b),_0x2af0b1['extendTemplate']({'attributes':{'class':['ck-ai-button-primary','ck-ai_review__check-run-accept-all-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0x42cb79=>!_0x42cb79),this['bindTemplate']['if']('isCompleted','ck-hidden',_0xf52646=>_0xf52646)]}}),_0x2af0b1['on']('execute',()=>{this['fire']('acceptAllChanges');}),_0x2af0b1;}['_createExitReviewButtonView'](){const _0xa46adf=new _0x4421de(this['locale']);return _0xa46adf['set']({'label':i(this['locale'],'AI_REVIEW_MODE_EXIT_REVIEW'),'withText':!0x0}),_0xa46adf['extendTemplate']({'attributes':{'class':['ck-ai-button-tertiary','ck-ai_review__check-run-exit-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0x18079c=>!_0x18079c),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x2fc0be=>_0x2fc0be)]}}),_0xa46adf['on']('execute',()=>{this['fire']('leaveReviewCoreResultList');}),_0xa46adf;}['_createResultHeaderView'](){const _0x43b6f4=new _0x3ddefc(this['locale']),_0x1c32b3=this['_createTitleView']();return _0x43b6f4['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-header',this['bindTemplate']['if']('isCompleted','ck-ai_review__review-completed-header',_0x4b4544=>_0x4b4544)]},'children':[_0x1c32b3,{'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-header-buttons']},'children':[this['_cancelButtonView'],this['_acceptAllButtonView'],this['_exitReviewButtonView'],this['_toggleDiffButtonView'],this['_finishReviewButtonView']]}]}),_0x43b6f4;}['_createTitleView'](){const _0x4d501f=new _0x3ddefc(this['locale']),_0x3a9e70=new vi();return _0x3a9e70['bind']('isVisible')['to'](this,'isResultReady',_0x4e3e34=>!_0x4e3e34),_0x4d501f['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-header-title-wrapper']},'children':[_0x3a9e70,{'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-header-title-content',this['bindTemplate']['if']('isCompleted','ck-hidden',_0xdaa151=>_0xdaa151)]},'children':[{'tag':'span','attributes':{'class':['ck-ai_review__check-run-results-header-title']},'children':[{'text':this['bindTemplate']['to']('headerTitle')}]},{'tag':'span','attributes':{'class':['ck-ai_review__check-run-results-header-subtitle']},'children':[{'text':this['bindTemplate']['to']('headerSubtitle')}]}]},{'tag':'span','attributes':{'class':['ck-ai_review__review-completed-header-title',this['bindTemplate']['if']('isCompleted','ck-hidden',_0x3ca1f1=>!_0x3ca1f1)]},'children':[{'text':i(this['locale'],'AI_REVIEW_MODE_FINISH_REVIEW_HEADER_TITLE')}]}]}),_0x4d501f;}['_createFinishReviewButtonView'](){const _0x38b074=new vr(i(this['locale'],'AI_REVIEW_MODE_FINISH_REVIEW_BUTTON_LABEL'),this['locale']);return _0x38b074['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isCompleted','ck-hidden',_0x55001=>!_0x55001)]}}),_0x38b074['delegate']('finishReview')['to'](this),_0x38b074;}}class be extends _0x23b8c1{['_resultsHeader'];['_finishReviewButtonView'];constructor(_0x2a42f9,_0x21d15f){super(_0x2a42f9),this['_finishReviewButtonView']=this['_createFinishReviewButtonView'](_0x21d15f['buttonText']),this['_resultsHeader']=this['_createResultHeaderView'](_0x21d15f['headerText']);const _0x3ecef6=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__review-completed',_0x3ecef6['if']('isVisible','ck-hidden',_0x2a1ff1=>!_0x2a1ff1)]},'children':[this['_resultsHeader'],{'tag':'div','attributes':{'class':['ck-ai_review__review-completed-content']},'children':[{'tag':'span','attributes':{'class':['ck-ai_review__review-completed-content-icon']},'children':[{'text':'👍'}]},{'tag':'p','attributes':{'class':['ck-ai_review__review-completed-content-text']},'children':[{'text':_0x21d15f['emptyResultsText']}]}]}]});}['_createFinishReviewButtonView'](_0x443a36){const _0x3b02b4=new vr(_0x443a36,this['locale']);return _0x3b02b4['delegate']('finishReview')['to'](this),_0x3b02b4;}['_createResultHeaderView'](_0x57c184){const _0x44d06d=new _0x3ddefc(this['locale']);return _0x44d06d['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__review-completed-header']},'children':[{'tag':'span','attributes':{'class':['ck-ai_review__review-completed-header-title']},'children':[{'text':_0x57c184}]},{'tag':'div','attributes':{'class':['ck-ai_review__review-completed-header-buttons']},'children':[this['_finishReviewButtonView']]}]}),_0x44d06d;}}class Dr extends _0x3ddefc{['_dropdownView'];['_defaultValue'];['_defaultLabel'];constructor(_0x187d3e,_0x4e1f61){super(_0x187d3e),this['_defaultValue']=_0x4e1f61['default']||(_0x4e1f61['data']['length']>0x0?_0x4e1f61['data'][0x0]['id']:''),this['_defaultLabel']=_0x4e1f61['data']['find'](_0x19de41=>_0x19de41['id']===this['_defaultValue'])?.['label']||'',this['set']('formValue',''),this['_dropdownView']=_0x336a05(this['locale']);const _0x5f21ea=this['_prepareListOptions'](_0x4e1f61['data']);_0x590b3b(this['_dropdownView'],_0x5f21ea,{'role':'menu','ariaLabel':_0x4e1f61['label']}),this['_dropdownView']['buttonView']['set']({'label':this['_defaultLabel'],'withText':!0x0}),this['_dropdownView']['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x5a4e46=>{_0x5a4e46['stopPropagation']();})}}),this['listenTo'](this['_dropdownView'],'execute',_0x38c7da=>{this['formValue']=_0x38c7da['source']['model']['id'],this['_dropdownView']['buttonView']['label']=_0x38c7da['source']['model']['label'];}),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-ai_review__check-list-item-parameterized-form-element','ck-ai_review__check-list-item-parameterized-form-element_dropdown']},'children':[this['_dropdownView']]});}['resetToDefault'](){this['formValue']=this['_defaultValue'],this['_dropdownView']['buttonView']['label']=this['_defaultLabel'];}['_prepareListOptions'](_0x4a8aa5=[]){const _0x1f6639=new _0x285958();this['resetToDefault']();for(const _0x67f224 of _0x4a8aa5){const _0xaf5b3e=new _0xc76b09({'label':_0x67f224['label'],'withText':!0x0,'role':'menuitemradio','id':_0x67f224['id'],'model':_0x67f224});_0xaf5b3e['bind']('isOn')['to'](this,'formValue',_0x180ea3=>_0x180ea3===_0xaf5b3e['id']);const _0x38836d={'type':'button','model':_0xaf5b3e};_0x1f6639['add'](_0x38836d);}return _0x1f6639;}}class tc extends _0x23b8c1{['_formItem']=null;constructor(_0xa51ae6,_0x61c475,_0xca0cd9){super(_0xa51ae6),this['argsKey']=_0x61c475?.['argsKey'];if('dropdown'===_0x61c475['formType'])this['_formItem']=new Dr(this['locale'],_0x61c475);this['set']('value',''),this['bind']('value')['to'](this['_formItem'],'formValue');const _0x8af1f9=new _0x5da68c(this['locale'],{'children':[this['_formItem']],'class':[_0xca0cd9?'ck-form__row_with-submit':'']});_0xca0cd9&&_0x8af1f9['children']['add'](_0xca0cd9),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai_review__form-item','ck-reset_all']},'children':[_0x8af1f9]});}['resetToDefault'](){this['_formItem']['resetToDefault']();}}class wo extends _0x3d7aa3{['keystrokes'];static ['MIN_ROWS']=0x1;static ['MAX_ROWS']=0xc;constructor(_0x375423){super(_0x375423),this['set']('isEmpty',!0x0),this['keystrokes']=new _0x51df97(),this['minRows']=wo['MIN_ROWS'],this['maxRows']=wo['MAX_ROWS'],this['extendTemplate']({'attributes':{'id':'ai-review-prompt-input','class':['ck','ck-review__prompt-input']}});}['render'](){super['render'](),this['on']('update',()=>{this['isEmpty']=''===this['element']['value']?.['trim']();}),this['keystrokes']['listenTo'](this['element']);}}class sc extends _0x3ddefc{['focusTracker']=new _0x5675ac();['keystrokes']=new _0x51df97();['focusCycler'];['_focusables']=new _0xdb22e9();['submitButtonView'];['cancelButtonView'];['promptInputView'];['actionsFooterView'];['_modelSelectionDropdown'];['_modelNameView'];['_modelSelectionDropdownItems'];['_check'];['_defaultValue'];['_defaultLabel'];constructor(_0x10e678,_0x4c1b03,_0x5f1219=!0x1){super(_0x10e678),this['_check']=_0x4c1b03,this['set']('prompt',''),this['set']('modelId',''),this['set']('modelDisplayMode','selector'),this['set']('activeModelName',null),this['_defaultValue']=_0x4c1b03['defaultModel']?_0x4c1b03['defaultModel']['id']:'',this['_defaultLabel']=_0x4c1b03['defaultModel']?_0x4c1b03['defaultModel']['name']:'',this['submitButtonView']=this['_createSubmitButtonView'](),this['cancelButtonView']=this['_createCancelButtonView'](),(this['promptInputView']=new _0x7014be(this['locale'],()=>new wo(_0x10e678)),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 _0x285958(),this['_modelNameView']=this['_createModelNameView'](),this['_setModelList'](_0x5f1219),_0x590b3b(this['_modelSelectionDropdown'],this['_modelSelectionDropdownItems']),this['actionsFooterView']=this['_createActionsFooterView'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-custom-actions']},'children':[new _0x5da68c(this['locale'],{'children':[this['promptInputView']]}),new _0x5da68c(this['locale'],{'children':[this['actionsFooterView']]})]}),this['promptInputView']['fieldView']['keystrokes']['set']('Enter',(_0x17a2e5,_0x2a181f)=>{this['_isValid']()?(this['fire']('runReviewCheck',{'id':'custom','args':{'prompt':this['prompt'],'model':this['modelId']},'isCustom':!0x0}),_0x2a181f()):_0x2a181f();}),this['focusCycler']=new _0x125535({'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'](_0x2bf03=>{this['_focusables']['add'](_0x2bf03),this['focusTracker']['add'](_0x2bf03['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 _0xf06a56 of this['_getFormValidators']()){const _0x179735=_0xf06a56();if(_0x179735)return this['promptInputView']['errorText']=_0x179735,!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 _0x5b4b05=new _0x4421de(this['locale']),t=this['locale']['t'];return _0x5b4b05['set']({'label':t('Submit'),'withText':!0x0,'class':'ck-ai-button-primary'}),_0x5b4b05['on']('execute',()=>{this['_isValid']()&&this['fire']('runReviewCheck',{'id':'custom','args':{'prompt':this['prompt'],'model':this['modelId']},'isCustom':!0x0});}),_0x5b4b05;}['_createCancelButtonView'](){const _0x3a6b0c=new _0x4421de(this['locale']),t=this['locale']['t'];return _0x3a6b0c['set']({'label':t('Cancel'),'withText':!0x0,'class':'ck-ai-button-tertiary'}),_0x3a6b0c['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x4ca278=>{_0x4ca278['stopPropagation']();})}}),_0x3a6b0c['on']('execute',()=>{this['resetToDefault'](),this['fire']('closeCustomCheck');}),_0x3a6b0c;}['_setModelList'](_0x2ed76d){this['_modelSelectionDropdownItems']['clear']();const _0xabe38=this['_check']['models'];if(_0x2ed76d)this['set']('modelDisplayMode','hidden');else{const _0xaeb696=0x1===_0xabe38['length'];this['set']('modelDisplayMode',_0xaeb696?'name':'selector');}if(this['resetToDefault'](),_0xabe38?.['length']){0x1===_0xabe38['length']&&this['set']('activeModelName',_0xabe38[0x0]['name']||_0xabe38[0x0]['id']);for(const _0x1c4a76 of _0xabe38){const _0x3c588b=new _0xc76b09({'label':_0x1c4a76['name'],'withText':!0x0,'role':'menuitemradio','id':_0x1c4a76['id'],'model':_0x1c4a76});_0x3c588b['bind']('isOn')['to'](this,'modelId',_0x2d3943=>_0x2d3943===_0x1c4a76['id']),this['_modelSelectionDropdownItems']['add']({'type':'button','model':_0x3c588b,'labelView':new ModelButtonLabelView(this['locale'],_0x1c4a76)});}}}['_createModelSelectionDropdown'](){const _0x57a80a=_0x336a05(this['locale']);return _0x57a80a['set']({'panelPosition':'se','class':'ck-ai_review__check-list-item-model-dropdown'}),_0x57a80a['buttonView']['set']({'label':this['_defaultLabel'],'withText':!0x0,'tooltip':!0x0}),_0x57a80a['buttonView']['bind']('isVisible')['to'](this,'modelDisplayMode',_0x1bd063=>'selector'===_0x1bd063),this['listenTo'](_0x57a80a,'execute',_0x3359dc=>{this['modelId']=_0x3359dc['source']['model']['id'],_0x57a80a['buttonView']['label']=_0x3359dc['source']['label'];}),_0x57a80a;}['_createModelNameView'](){const _0x411503=new ModelNameView(this['locale']);return _0x411503['bind']('text')['to'](this,'activeModelName',_0x2771ad=>_0x2771ad??''),_0x411503['bind']('isVisible')['to'](this,'modelDisplayMode',_0x5e1f33=>'name'===_0x5e1f33),_0x411503;}['_createActionsFooterView'](){const _0x53c988=new _0x3ddefc(this['locale']);return _0x53c988['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-custom-actions-footer']},'children':[this['_modelSelectionDropdown'],this['_modelNameView'],{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-parameterized-custom-actions-buttons']},'children':[this['cancelButtonView'],this['submitButtonView']]}]}),_0x53c988;}}class ModelNameView extends _0x3ddefc{constructor(_0x79ad43){super(_0x79ad43),this['set']('text',void 0x0),this['set']('isVisible',!0x0);const _0x349a2f=this['bindTemplate'];this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai_review__check-list-item-model-name',_0x349a2f['if']('isVisible','ck-hidden',_0x199ab8=>!_0x199ab8)]},'children':[{'text':_0x349a2f['to']('text')}]});}}class ModelButtonLabelView extends _0x481114{constructor(_0x56f0ac,_0x3605e4){super();const _0x8e542=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-button__label'],'style':_0x8e542['to']('style'),'id':_0x8e542['to']('id')},'children':[{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-model-dropdown-name']},'children':[{'tag':'span','children':[{'text':_0x8e542['to']('text')}]}]},{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-model-dropdown-description']},'children':[{'tag':'span','children':[_0x3605e4['description']||'']}]}]});}}class ec extends _0x23b8c1{['_formItemsCollection']=new _0xdb22e9();['_customCheckView']=null;['_hideModels']=!0x1;constructor(_0x4ec078,_0xbbf0e0,_0x291ea3,_0x5d5966=!0x1){super(_0x4ec078),this['_hideModels']=_0x5d5966,this['set']('isParametrizedViewOpen',!0x1),this['set']('isListItemRendered',!0x1),this['set']('isItemParametrized',_0xbbf0e0['isParameterized']);const _0x1c4cd2=this['_createIconView']();this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list-item',this['bindTemplate']['if']('isParametrizedViewOpen','ck-ai_review__check-list-item_selected',_0x5a37da=>_0x5a37da),this['bindTemplate']['if']('isListItemRendered','ck-ai_review__check-list-item_rendered',_0x1b61c1=>_0x1b61c1)],'style':{'--ck-ai-review-check-list-item-index':_0x291ea3}},'on':{'click':this['bindTemplate']['to']('click')},'children':[{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-content']},'children':[{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-main-content']},'children':[{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-title']},'children':[{'tag':'span','attributes':{'class':['ck-ai_review__check-list-item-title-text']},'children':[{'text':_0xbbf0e0['title']}]},_0x1c4cd2]},{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-description']},'children':_0xbbf0e0['description']?[{'text':_0xbbf0e0['description']}]:[]}]}]},..._0xbbf0e0['isParameterized']?[this['_createParameterizedView'](_0xbbf0e0)]:[],...'custom'===_0xbbf0e0['id']?[this['_createCustomView'](_0xbbf0e0,this['_hideModels'])]:[]]}),this['on']('click',()=>{_0xbbf0e0['isParameterized']?this['isParametrizedViewOpen']=!0x0:this['fire']('runReviewCheck',{'id':_0xbbf0e0['id'],'args':_0xbbf0e0['useArgs']?_0xbbf0e0['args']:void 0x0});}),requestAnimationFrame(()=>{this['isListItemRendered']=!0x0;});}['render'](){super['render'](),this['isItemParametrized']&&_0xa9d580({'emitter':this,'activator':()=>!0x0===this['isParametrizedViewOpen'],'contextElements':[this['element']],'callback':()=>{this['isParametrizedViewOpen']=!0x1;}});}['resetToDefault'](){this['isParametrizedViewOpen']=!0x1,this['_formItemsCollection']['forEach'](_0x7284a9=>{_0x7284a9['resetToDefault']();}),this['_customCheckView']&&this['_customCheckView']['resetToDefault']();}['_createIconView'](){const _0x433af7=new _0x2fc344();return _0x433af7['content']=_0x3e5c1f,_0x433af7['extendTemplate']({'attributes':{'class':['ck-ai_review__check-list-item-title-icon']}}),_0x433af7;}['_createParameterizedView'](_0xaf6e9f){const _0x192410=new _0x3ddefc(),_0x48ff76=this['_createFormView'](_0xaf6e9f);return _0x192410['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-parameterized',this['bindTemplate']['if']('isParametrizedViewOpen','ck-hidden',_0x3398a2=>!_0x3398a2)]},'children':[_0x48ff76]}),_0x192410;}['_createFormView'](_0x2189d1){const _0x27aada=new _0x3ddefc(),_0x5ea5b1=Array['isArray'](_0x2189d1['options'])?_0x2189d1['options']:[],_0x25e7b4=new _0x4421de(this['locale']),t=this['locale']['t'];_0x25e7b4['set']({'label':t('Submit'),'withText':!0x0,'class':'ck-ai-button-primary'}),_0x25e7b4['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x41b8b6=>{_0x41b8b6['stopPropagation']();})}}),_0x25e7b4['on']('execute',()=>{const _0x54b6f2=[],_0x2f8e97={};this['_formItemsCollection']['forEach'](_0x5391ae=>{_0x54b6f2['push'](_0x5391ae['value']),_0x2189d1['useArgs']&&_0x2189d1['options']&&(_0x2f8e97[_0x5391ae['argsKey']]=_0x5391ae['value']);}),this['fire']('runReviewCheck',{'id':_0x2189d1['id'],'params':_0x54b6f2['length']?_0x54b6f2:void 0x0,'args':Object['keys'](_0x2f8e97)['length']?_0x2f8e97:void 0x0});});const _0x29f9dd=_0x5ea5b1['length'];return _0x5ea5b1['forEach']((_0x323779,_0x5b14e3)=>{const _0x28d63b=_0x5b14e3===_0x29f9dd-0x1;this['_formItemsCollection']['add'](new tc(this['locale'],_0x323779,_0x28d63b?_0x25e7b4:null));}),_0x27aada['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-parameterized-form']},'children':this['_formItemsCollection']}),_0x27aada;}['_createCustomView'](_0x317c63,_0x1fde10=!0x1){return this['_customCheckView']=new sc(this['locale'],_0x317c63,_0x1fde10),this['_customCheckView']['extendTemplate']({'attributes':{'class':['ck-ai_review__check-list-item-parameterized','ck-ai_review__check-list-item-parameterized_custom',this['bindTemplate']['if']('isParametrizedViewOpen','ck-hidden',_0x589487=>!_0x589487)]}}),this['_customCheckView']['delegate']('runReviewCheck')['to'](this),this['listenTo'](this['_customCheckView'],'closeCustomCheck',()=>{this['isParametrizedViewOpen']=!0x1;}),this['on']('change:isParametrizedViewOpen',(_0x3f03ce,_0x1186c7,_0x3f0015)=>{_0x3f0015||this['_customCheckView']['resetFormValidationStatus']();}),this['_customCheckView'];}}class je extends _0x23b8c1{['_checkViews'];constructor(_0x14216f){super(_0x14216f),this['_checkViews']=new _0xdb22e9(),this['_setupTemplate']();}['setChecks'](_0x5db943,_0x516ecc=!0x1){this['_checkViews']['clear']();for(const [_0x433050,_0x39709b]of _0x5db943['entries']()){const _0x43991f=new ec(this['locale'],_0x39709b,_0x433050,_0x516ecc);_0x43991f['delegate']('runReviewCheck')['to'](this),this['_checkViews']['add'](_0x43991f);}}['hasChecks'](){return this['_checkViews']['length']>0x0;}['resetAllParameterizedChecks'](){for(const _0x527ad6 of this['_checkViews'])_0x527ad6 instanceof ec&&_0x527ad6['resetToDefault']();}['_setupTemplate'](){const _0x41fa43=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list',_0x41fa43['if']('isVisible','ck-hidden',_0x49664f=>!_0x49664f)]},'children':this['_checkViews']});}}class ge extends Me{static get['pluginName'](){return'AIReviewModeUI';}['createMainView'](){const _0x492f31=this['context']['locale'],_0x1b4d60=new _0xa16c5(_0x492f31,{'label':i(_0x492f31,'AI_REVIEW_MODE'),'icon':_0x4bbb25,'class':'ck-ai-header\x20ck-ai-header_review'});return new Ae(this['context']['locale'],{'header':_0x1b4d60,'list':new je(_0x492f31),'results':new Ve(_0x492f31,{'generalErrorText':i(_0x492f31,'AI_REVIEW_MODE_GENERAL_ERROR_MESSAGE')}),'completed':new be(_0x492f31,{'headerText':i(_0x492f31,'AI_REVIEW_MODE_FINISH_REVIEW_HEADER_TITLE'),'emptyResultsText':i(_0x492f31,'AI_REVIEW_MODE_EMPTY_RESULTS_TEXT'),'buttonText':i(_0x492f31,'AI_REVIEW_MODE_FINISH_REVIEW_BUTTON_LABEL')})});}['registerTab'](){const _0xbd3be6=this['context']['plugins']['get']('AITabs');_0xbd3be6['view']['on']('activateTab',(_0x1cdec5,_0x2aa08c)=>{'reviewMode'===_0x2aa08c?this['fire']('getReviewCheckList'):this['fire']('leaveReview');}),_0xbd3be6['view']['addTab']({'id':'reviewMode','buttonLabel':i(this['context']['locale'],'AI_REVIEW_MODE'),'buttonIcon':_0x4bbb25,'order':0x0,'content':this['_mainView']});}}const fe='review-';class de extends _0x3b66f2{static get['requires'](){return[_0x5b4177,D];}static get['pluginName'](){return'AIReviewCoreEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['_markers']=new Map();['_activeMarkers']=new Set();['_domEmitter'];['_eventEmitter'];constructor(_0x322033){super(_0x322033),this['_domEmitter']=new(_0x5d778d())(),this['_eventEmitter']=new(_0x428ca4())();}get['emitter'](){return this['_eventEmitter'];}['afterInit'](){const _0x4623c8=T(this['context']);_0x4623c8['conversion']['for']('editingDowncast')['markerToElement']({'model':fe+'insert','view':(_0x2c5aa6,{writer:_0x5dbb88})=>{const _0x387620=this['_markers']['get'](_0x2c5aa6['markerName']),_0x63ec5d={'class':'ck-ai_review-marker_add'+(this['_activeMarkers']['has'](_0x387620?.['id']||'')?'\x20ck-ai_review__change_active':''),'data-marker-id':_0x2c5aa6['markerName']};return _0x5dbb88['createUIElement']('span',_0x63ec5d,function(_0x5ea842){const _0x217fad=this['toDomElement'](_0x5ea842);return _0x217fad['innerHTML']=_0x387620?.['content']?.['asString']||'',_0x217fad;});}}),_0x4623c8['conversion']['for']('editingDowncast')['markerToHighlight']({'model':fe+'remove-only','view':_0x36a0c4=>{const _0x70525f=this['_markers']['get'](_0x36a0c4['markerName']),_0x52f41f=['ck-ai_review-marker_strikethrough'];return this['_activeMarkers']['has'](_0x70525f?.['id']||'')&&_0x52f41f['push']('ck-ai_review__change_active'),{'classes':_0x52f41f,'attributes':{'data-marker-id':_0x36a0c4['markerName']}};}}),_0x4623c8['conversion']['for']('editingDowncast')['markerToHighlight']({'model':fe+'remove-context','view':_0x2a7342=>{const _0x315e98=this['_markers']['get'](_0x2a7342['markerName']),_0x3be0a7=['ck-ai_review-marker_underline'];return this['_activeMarkers']['has'](_0x315e98?.['id']||'')&&_0x3be0a7['push']('ck-ai_review__change_active'),{'classes':_0x3be0a7,'attributes':{'data-marker-id':_0x2a7342['markerName']}};}}),_0x4623c8['conversion']['for']('editingDowncast')['markerToHighlight']({'model':fe+'remove-text','view':_0x1c6c72=>{const _0x130529=this['_markers']['get'](_0x1c6c72['markerName']),_0x34ea2b=['ck-ai_review-marker_hide'];return this['_activeMarkers']['has'](_0x130529?.['id']||'')&&_0x34ea2b['push']('ck-ai_review__change_active'),{'classes':_0x34ea2b,'attributes':{'data-marker-id':_0x1c6c72['markerName']}};}}),_0x4623c8['conversion']['for']('dataDowncast')['markerToElement']({'model':fe+'suggestion-context','view':(_0x487911,{writer:_0x317d8c})=>_0x317d8c['createRawElement']('span',{'class':'ck-ai_review-marker_context-'+(_0x487911['isOpening']?'start':'end')})}),_0x4623c8['conversion']['for']('downcast')['attributeToAttribute']({'model':Ct,'view':_0x26fea3});const _0x10f2b6=_0x4623c8['ui']['getEditableElement']()||document['body'];this['_domEmitter']['listenTo'](_0x10f2b6,'mouseup',(_0x43ceab,_0x5e5ca8)=>{const _0x4a9be9=_0x5e5ca8['target'],_0x471985=this['_findMarkerElement'](_0x4a9be9);if(!_0x471985)return;const _0xd5fd8c=_0x471985['getAttribute']('data-marker-id'),_0x306fff=_0xd5fd8c['split'](':')['pop']()?.['split']('_')[0x0];this['_eventEmitter']['fire']('changeMarkerClicked',{'markerId':_0xd5fd8c,'changeId':_0x306fff,'markerElement':()=>this['_findMarkerElementById'](_0xd5fd8c),'domEvent':_0x5e5ca8});},{'usePassive':!0x0,'priority':'highest'}),this['_domEmitter']['listenTo'](_0x10f2b6,'mouseover',(_0x23874f,_0x9c3dc9)=>{const _0x4f283a=_0x9c3dc9['target'],_0x20c384=_0x9c3dc9['relatedTarget'];let _0x56113b=this['_findMarkerElement'](_0x4f283a);if(!_0x56113b&&_0x20c384&&(_0x56113b=this['_findMarkerElement'](_0x20c384)),!_0x56113b)return;const _0x5b2e68=_0x56113b['getAttribute']('data-marker-id'),_0xe06101=_0x5b2e68['split'](':')['pop']()?.['split']('_')[0x0];this['_eventEmitter']['fire']('changeMarkerHovered',{'changeId':_0xe06101,'markerElement':()=>this['_findMarkerElementById'](_0x5b2e68),'domEvent':_0x9c3dc9});}),this['_domEmitter']['listenTo'](document,'mouseover',_0x1d2bab((_0x59e99c,_0xe780c1)=>{const _0x5e5239=_0xe780c1['target'];if(this['_findMarkerElement'](_0x5e5239))return;_0x5e5239['closest']('.ck-reset.ck-ai_review-balloon-panel-suggestion')||this['_eventEmitter']['fire']('changeMarkerBlurred');},0xc8)),_0x4623c8['model']['document']['registerPostFixer'](_0xb86385=>this['_validateMarkers'](_0x4623c8,_0xb86385)),_0x4623c8['model']['document']['on']('change',()=>this['_handleMarkerChanges'](_0x4623c8));}['getDocumentData'](){const _0x4ba134=this['context']['plugins']['get']('AIEditing'),_0x1add13=T(this['context']),_0x3a6bcd=_0x1add13['model'],_0x48fea8=new tt();for(const _0x1262c4 of _0x3a6bcd['document']['getRoot']()['getChildren']()){const _0x5c1358=_0x1262c4['_clone'](!0x0);_0x48fea8['_appendChild'](_0x5c1358);}for(const _0x2eb117 of _0x3a6bcd['markers'])_0x48fea8['markers']['set'](_0x2eb117['name'],this['_changeRangeOwnerDocument'](_0x2eb117['getRange']()['clone'](),_0x48fea8));const _0x12193f=new _0x2ab43c({'ignoreElementEnd':!0x0,'startPosition':_0x3a6bcd['createPositionAt'](_0x48fea8,0x0)}),_0x1e77df=new Set(),_0x14ef40=new Map();for(const {item:_0x2e557e}of _0x12193f){if(!_0x2e557e['is']('$textProxy'))continue;const _0x341106=_0x2e557e['parent'];if(_0x341106&&_0x341106['is']('element')){const _0x41b7c3=this['_upsertDataId'](_0x341106,()=>_0x4ba134['_nextDataId'](_0x1e77df));_0x1e77df['add'](_0x41b7c3);for(const _0x1e1ba3 of _0x341106['getChildren']())_0x1e1ba3['is']('element')&&_0x1e77df['add'](this['_upsertDataId'](_0x1e1ba3,()=>_0x4ba134['_nextDataId'](_0x1e77df)));let _0x343a04=_0x341106;for(;_0x343a04['parent']&&!_0x343a04['parent']['is']('documentFragment');)_0x343a04=_0x343a04['parent'],_0x343a04['hasAttribute'](Ct)&&_0x343a04['_removeAttribute'](Ct);_0x14ef40['set'](_0x41b7c3,{'path':_0x341106['getPath'](),'getContent':this['_createGetContentUsingDataIdFn'](_0x343a04['_clone'](!0x0),_0x41b7c3,_0x1add13['data'])}),_0x12193f['jumpTo'](_0x3a6bcd['createPositionAfter'](_0x341106));}}return{'content':_0x1add13['data']['processor']['toData'](_0x1add13['data']['toView'](_0x48fea8)),'version':_0x1add13['model']['document']['version'],'elements':_0x14ef40};}['diffContent'](_0x2356de,_0x3e939d,_0x79636=!0x1){const _0x78e509=[],_0x259a28=T(this['context']),_0xfd0ac8=_0x259a28['data']['parse'](_0x3e939d,'$documentFragment'),_0x48e3c0=_0x259a28['data']['parse'](_0x2356de,'$documentFragment'),_0x511970=_0x259a28['model']['createPositionAt'](_0x48e3c0,0x0);if(this['_haveSingleTopLevelElement'](_0xfd0ac8)){if(!this['_hasSameTopLevelElement'](_0x48e3c0,_0xfd0ac8))return _0x78e509;}else{const _0x488ce2=_0x259a28['model']['schema'];if(!this['_haveOnlyInlineContent'](_0x48e3c0,_0x488ce2)||!this['_haveOnlyInlineContent'](_0xfd0ac8,_0x488ce2))return _0x78e509;}const _0x384efc=this['context']['plugins']['get']('DocumentCompare')['getDiff'](_0x2356de,_0x3e939d,{'anchor':_0x511970,'markDeletions':!0x0})['getOperations']()['filter'](_0x5c3d25=>'insert'===_0x5c3d25['type']||'marker'===_0x5c3d25['type']&&_0x5c3d25['name']['startsWith']('$markedRemove')),_0x267860=this['_groupAdjacentOperations'](_0x384efc),_0x120f90=[];if(_0x79636){if(_0x267860['length']){const _0x269d93=_0x267860[0x0]['operations'][0x0],_0x286ebf='insert'===_0x269d93['type']?_0x269d93['position']:_0x269d93['newRange']['start'],_0xf9c0f2=this['_getPositionLimitingRange'](_0x286ebf,_0x259a28,'inside'),_0x563453=_0xf9c0f2?_0xfd0ac8['getChild'](0x0)['getChildren']():_0xfd0ac8['getChildren'](),_0x236f14=_0xf9c0f2||_0x259a28['model']['createRangeIn'](_0x48e3c0),_0x1cf5e7=[new _0x37f637('$markedRemove:synthetic'+_0x56075e(),null,_0x236f14,_0x259a28['model']['document']['model']['markers'],!0x0,_0x259a28['model']['document']['version']+0x1),new _0x598ec8(_0x236f14['end'],_0x563453,_0x259a28['model']['document']['version']+0x2)];_0x120f90['push']({'operations':_0x1cf5e7,'operationsIsolated':_0x1cf5e7,'groupOffset':0x0});}}else _0x120f90['push'](..._0x267860);let _0x57596=0x0;return _0x259a28['model']['change'](_0x2514b6=>{for(let _0xd949b2=0x0;_0xd949b2<_0x120f90['length'];_0xd949b2++){const _0xad1f72=_0x120f90[_0xd949b2],_0x98e992=_0x2514b6['createDocumentFragment']();for(const _0x322ec9 of _0x48e3c0['getChildren']())_0x2514b6['append'](_0x322ec9['_clone'](!0x0),_0x98e992);for(const _0x256026 of _0xad1f72['operationsIsolated'])if('insert'===_0x256026['type']){const _0x272d73=_0x256026;_0x272d73['baseVersion']=null,_0x272d73['isDocumentOperation']=!0x1,this['_changeOperationOwnerDocument'](_0x272d73,_0x98e992),_0x2514b6['batch']['addOperation'](_0x256026),_0x259a28['model']['applyOperation'](_0x256026);const _0x382a45='suggestion:insertion:id:authorId:'+_0x57596++,_0x28f58a=_0x259a28['model']['createRange'](_0x272d73['position'],_0x272d73['position']['getShiftedBy'](_0x272d73['howMany']));_0x98e992['markers']['set'](_0x382a45,_0x28f58a);}else{if('marker'===_0x256026['type']&&_0x256026['name']['startsWith']('$markedRemove')){const _0x7e2ee5=_0x256026,_0x4789a3='suggestion:deletion:id:authorId:'+_0x57596++;this['_changeOperationOwnerDocument'](_0x7e2ee5,_0x98e992),_0x98e992['markers']['set'](_0x4789a3,_0x7e2ee5['newRange']);}}if(_0x79636)_0x78e509['push']({..._0xad1f72,'context':this['_createGetContentFn'](_0x48e3c0,_0x259a28['data']),'content':this['_createGetContentFn'](_0x48e3c0,_0x259a28['data'])});else{const _0x178006=this['_getChangeContext'](this['_changePositionOwnerDocument'](this['_getOperationStart'](_0xad1f72['operationsIsolated'][0x0]),_0x98e992),this['_changePositionOwnerDocument'](this['_getOperationEnd'](_0xad1f72['operationsIsolated'][_0xad1f72['operationsIsolated']['length']-0x1]),_0x98e992));_0x98e992['markers']['set'](fe+'suggestion-context',new it(_0x178006['start'],_0x178006['end'])),_0x78e509['push']({..._0xad1f72,'context':this['_createGetContextFn'](_0x98e992,_0x259a28['data'],{'ellipsisBefore':_0x178006['hasContentBefore'],'ellipsisAfter':_0x178006['hasContentAfter']}),'content':this['_createGetContentFn'](_0x98e992,_0x259a28['data'])});}}}),_0x78e509;}['markChangePositionInEditorContent'](_0x3d6d76,_0x2345d5){if(!_0x3d6d76['length'])return;const _0x226583=_0x3d6d76[0x0]['parent']['id'],_0x56bb7d=_0x2345d5['elements']['get'](_0x226583);if(!_0x56bb7d)return void console['warn']('No\x20element\x20found\x20for\x20ID:\x20'+_0x226583);const _0x50c81d=_0x56bb7d['path'],_0x237809=T(this['context']),_0x2a2de4=_0x237809['model']['document']['history']['getOperations'](_0x2345d5['version']),_0x3a67e5=[];for(const _0x32ee3a of _0x3d6d76){const _0x5a5b2e=_0x32ee3a['operationsIsolated']['map'](_0x105a2c=>this['_translateOperationToEditorContent'](_0x105a2c,_0x50c81d,_0x237809['model']['document']['getRoots']()[0x0]));if(!_0x5a5b2e||!_0x5a5b2e['length'])continue;const _0x39904e=_0x5a5b2e['every'](_0x1e5462=>'marker'===_0x1e5462['type']&&_0x1e5462['name']['startsWith']('$markedRemove')),_0x1d7f3c={'document':_0x237809['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1},_0x39a7f7=nt(_0x5a5b2e,_0x2a2de4,_0x1d7f3c)['operationsA'];for(const _0x231391 of _0x39a7f7)if('insert'===_0x231391['type']){const _0x1b91d=_0x231391,_0x33b6b2=_0x1b91d['nodes'];_0x237809['model']['change'](_0x25e620=>{const _0x453482=_0x25e620['createDocumentFragment']();for(const _0x511c5d of _0x33b6b2)_0x25e620['append'](_0x511c5d['_clone'](!0x0),_0x453482);_0x3a67e5['push']({'start':_0x1b91d['position'],'end':_0x1b91d['position'],'type':'insert','groupId':_0x32ee3a['id'],'content':{'asString':this['_createGetContentFn'](_0x453482,_0x237809['data'])(),'asFragment':_0x453482}});});}else{if('marker'===_0x231391['type']&&_0x231391['name']['startsWith']('$markedRemove')){const _0x4344b=_0x231391;let _0x312eab='remove-text';if(_0x39904e){const _0x3e56b3=this['_findAdjacentContextDistance'](_0x4344b['newRange']['start'],'backward',_0x237809['model']['schema']),_0x5d0b26=this['_findAdjacentContextDistance'](_0x4344b['newRange']['end'],'forward',_0x237809['model']['schema']);if(_0x3e56b3||_0x5d0b26){const _0x39b5ad=_0x4344b['newRange']['start']['getShiftedBy'](-_0x3e56b3),_0x5535d8=_0x4344b['newRange']['end']['getShiftedBy'](_0x5d0b26);_0x3a67e5['push']({'start':_0x39b5ad,'end':_0x5535d8,'groupId':_0x32ee3a['id'],'type':'remove-context'});}else _0x312eab='remove-only';}_0x3a67e5['push']({'start':_0x4344b['newRange']['start'],'end':_0x4344b['newRange']['end'],'groupId':_0x32ee3a['id'],'type':_0x312eab});}}}this['_insertMarkers'](_0x3a67e5);}['clearAllMarkers'](){const _0x16d4e2=T(this['context']);_0x16d4e2['model']['change'](_0x4d3911=>{for(const _0x4df8bb of this['_markers']['keys']())_0x16d4e2['model']['markers']['get'](_0x4df8bb)&&_0x4d3911['removeMarker'](_0x4df8bb);}),this['_markers']['clear'](),this['_activeMarkers']['clear']();}['switchToReadOnly'](){T(this['context'])['enableReadOnlyMode']('ai-review');}['switchToEdit'](){T(this['context'])['disableReadOnlyMode']('ai-review');}['applyChange'](_0x434077){const _0xb3d416=T(this['context']),_0x225c33=_0xb3d416['model'],_0x2daaf0=_0x434077['map'](_0xb53d9b=>this['_getMarkersDataForGroup'](_0xb53d9b))['flat']();_0x225c33['change'](_0x4fc825=>{for(const _0x41ecbb of _0x2daaf0){const _0x25521a=_0xb3d416['model']['markers']['get'](_0x41ecbb['id']);if(_0x25521a){if('insert'===_0x41ecbb['type']){if(!_0x41ecbb['content'])continue;_0x225c33['insertContent'](_0x41ecbb['content']['asFragment']||null,_0x25521a['getRange']()['start']);}else'remove-text'!==_0x41ecbb['type']&&'remove-only'!==_0x41ecbb['type']||_0x225c33['deleteContent'](_0x225c33['createSelection'](_0x25521a['getRange']()));_0x4fc825['removeMarker'](_0x41ecbb['id']),this['_markers']['delete'](_0x41ecbb['id']);}}});}['rejectChange'](_0x4fcc64){const _0x4933b9=T(this['context']),_0x534819=this['_getMarkersDataForGroup'](_0x4fcc64);_0x4933b9['model']['change'](_0x3436b7=>{for(const _0x595e77 of _0x534819)_0x3436b7['removeMarker'](_0x595e77['id']),this['_markers']['delete'](_0x595e77['id']);});}['getEditor'](){return T(this['context']);}['getMarkerElementForChange'](_0x1e0a23){const _0xef97f3=Array['from'](this['_markers']['values']())['filter'](_0x3f37e1=>_0x3f37e1['groupId']===_0x1e0a23);if(!_0xef97f3['length'])return null;const _0x2e578f=0x1===_0xef97f3['length']?_0xef97f3[0x0]:this['_sortMarkers'](_0xef97f3)[0x0],_0x32b7c9=T(this['context'])['model']['markers']['get'](_0x2e578f['id']);if(!_0x32b7c9)return null;return{'modelRange':_0x32b7c9['getRange'](),'getElement':()=>this['_findMarkerElementById'](_0x2e578f['id'])};}['getContentElementForChange'](_0x9ed50d){const _0x5865a8=Array['from'](this['_markers']['values']())['filter'](_0x2ccab7=>_0x2ccab7['groupId']===_0x9ed50d);if(!_0x5865a8['length'])return null;const _0x4d1ada=0x1===_0x5865a8['length']?_0x5865a8[0x0]:this['_sortMarkers'](_0x5865a8)[0x0],_0x66376d=T(this['context']),_0x488772=_0x66376d['model']['markers']['get'](_0x4d1ada['id']);if(!_0x488772)return null;const _0x11d335=_0x488772['getRange'](),_0x447a26=_0x66376d['editing']['view']['getDomRoot']();if(!_0x447a26||!_0x11d335)return null;let _0x1920ba=_0x11d335['start']['parent'];for(;_0x1920ba['parent']&&'$root'!==_0x1920ba['parent']['name'];)_0x1920ba=_0x1920ba['parent'];if(!_0x1920ba||!_0x1920ba['name'])return null;const _0x155ccf=_0x447a26['querySelector']('[data-marker-id=\x22'+_0x4d1ada['id']+'\x22]');if(!_0x155ccf)return null;let _0x1a22c7=null;_0x66376d['model']['change'](_0x328863=>{_0x1a22c7=_0x328863['createDocumentFragment'](),_0x328863['append'](_0x1920ba['_clone'](!0x0),_0x1a22c7);});const _0x1dba09=_0x66376d['data']['toView'](_0x1a22c7)['getChild'](0x0);return _0x155ccf['closest'](_0x1dba09['name']);}['reactivateMarkers'](_0x405f32){const _0x5a9468=this['_getMarkersDataForGroup'](_0x405f32);if(!_0x5a9468['length'])return;const _0x106414=Array['from'](this['_activeMarkers'])['sort'](),_0x56efca=Array['from'](new Set(_0x5a9468['map'](_0x339601=>_0x339601['id'])))['sort']();_0x106414['join']('|')!==_0x56efca['join']('|')&&(this['setAllMarkersAsInactive'](),this['setMarkersInElementAsActive'](_0x405f32));}['setMarkersInElementAsActive'](_0x3fb684){const _0x5ed54e=this['_getMarkersDataForGroup'](_0x3fb684);if(!_0x5ed54e['length'])return;const _0x3f1347=T(this['context']),_0xc4182e=new Set(_0x5ed54e['map'](_0x788082=>_0x788082['id'])),_0xaff971=Array['from'](_0xc4182e['values']())['map'](_0xfbcc21=>_0x3f1347['model']['markers']['get'](_0xfbcc21))['filter'](_0x3d040b=>!!_0x3d040b);_0xc4182e['forEach'](_0x291c66=>{this['_activeMarkers']['add'](_0x291c66);}),_0x3f1347['model']['change'](()=>{_0xaff971['forEach'](_0x3f2c1a=>{_0x3f1347['editing']['reconvertMarker'](_0x3f2c1a);});});}['setAllMarkersAsInactive'](){const _0x538382=Array['from'](this['_activeMarkers']);if(!_0x538382['length'])return;this['_activeMarkers']['clear']();const _0x478d5a=T(this['context']),_0x315b40=_0x538382['map'](_0x1f562a=>_0x478d5a['model']['markers']['get'](_0x1f562a))['filter'](_0x3c17b0=>!!_0x3c17b0);_0x478d5a['model']['change'](()=>{_0x315b40['forEach'](_0xbbfea6=>{_0x478d5a['editing']['reconvertMarker'](_0xbbfea6);});});}['_getPositionLimitingRange'](_0x13a427,_0x219a26,_0x31706b='outside'){if(!_0x13a427)return null;let _0x53fac5=_0x13a427['parent'];for(;_0x53fac5&&_0x53fac5['parent']&&'$root'!==_0x53fac5['parent']['name']&&!_0x219a26['model']['schema']['isLimit'](_0x53fac5)&&!_0x219a26['model']['schema']['isBlock'](_0x53fac5);)_0x53fac5=_0x53fac5['parent'];if(!_0x53fac5||!_0x53fac5['name']||'$root'===_0x53fac5['name'])return null;let _0x1b770d=null;return _0x219a26['model']['change'](_0x3e324e=>{_0x1b770d='inside'===_0x31706b?_0x3e324e['createRangeIn'](_0x53fac5):_0x3e324e['createRangeOn'](_0x53fac5);}),_0x1b770d;}['_validateMarkers'](_0x4d3a8e,_0x33305d){const _0x593b1a=Array['from'](this['_markers']['keys']()),_0xcb7d1c=new Map();for(const _0x719f4c of _0x593b1a){const _0x1248b8=_0x4d3a8e['model']['markers']['get'](_0x719f4c);if(!_0x1248b8)continue;const _0x10ff6c=_0x1248b8['getStart']()['path'][0x0];_0xcb7d1c['has'](_0x10ff6c)||_0xcb7d1c['set'](_0x10ff6c,[]),_0xcb7d1c['get'](_0x10ff6c)['push'](_0x1248b8);}const _0x5e6b57=new Set();for(const _0x2c01f3 of _0x4d3a8e['model']['document']['differ']['getChanges']()){let _0x2ffc40=-0x1,_0x20adff=null;if('insert'===_0x2c01f3['type'])_0x20adff=new it(_0x2c01f3['position'],_0x2c01f3['position']['getShiftedBy'](_0x2c01f3['length'])),_0x2ffc40=_0x2c01f3['position']['path'][0x0];else{if('remove'!==_0x2c01f3['type'])continue;_0x20adff=new it(_0x2c01f3['position']),_0x2ffc40=_0x2c01f3['position']['path'][0x0];}const _0x3ec6d6=_0xcb7d1c['get'](_0x2ffc40)||[];if(_0x3ec6d6['length']){for(const _0x17252a of _0x3ec6d6)if(_0x20adff['root']['rootName']===_0x17252a['getRange']()['root']['rootName']&&('insert'!==_0x2c01f3['type']||!_0x20adff['containsRange'](_0x17252a['getRange']()))&&(_0x20adff['isIntersecting'](_0x17252a['getRange']())||_0x20adff['start']['isTouching'](_0x17252a['getRange']()['end'])||_0x20adff['end']['isTouching'](_0x17252a['getRange']()['start']))){const _0x4b66ac=this['_parseMarkerName'](_0x17252a['name']);Array['from'](this['_markers']['values']())['filter'](_0x2d1473=>_0x2d1473['groupId']===_0x4b66ac['groupId'])['forEach'](_0x2e4914=>_0x5e6b57['add'](_0x2e4914['id']));}}}if(_0x5e6b57['size']){for(const _0x4aa15f of _0x5e6b57)_0x33305d['removeMarker'](_0x4aa15f);return!0x0;}return!0x1;}['_handleMarkerChanges'](_0x3f2a61){for(const {name:_0x3ac897,data:_0x47918e}of _0x3f2a61['model']['document']['differ']['getChangedMarkers']()){if(!_0x3ac897['startsWith'](fe))continue;const _0x2cdec9=_0x47918e['oldRange'],_0x233325=_0x47918e['newRange'],_0x1fca91=_0x2cdec9&&'$graveyard'===_0x2cdec9['root']['rootName'],_0xe3aace=_0x233325&&'$graveyard'===_0x233325['root']['rootName'];if(_0x1fca91&&_0xe3aace)continue;const _0x44984d=this['_parseMarkerName'](_0x3ac897);this['_markers']['get'](_0x3ac897)&&(_0xe3aace||!_0x233325?this['_eventEmitter']['fire']('changeMarkerRemoved',{'markerId':_0x3ac897,'changeId':_0x44984d['groupId']}):_0x1fca91&&_0x233325&&this['_eventEmitter']['fire']('changeMarkerRestored',{'markerId':_0x3ac897,'changeId':_0x44984d['groupId']}));}}['_parseMarkerName'](_0x39526a){const _0x344140=_0x39526a['split'](':'),_0x1d50e2=(_0x344140[0x1]||'')['split']('_');return{'prefix':_0x344140[0x0],'groupId':_0x1d50e2[0x0],'suffix':_0x1d50e2[0x1]};}['_translateOperationToEditorContent'](_0x3627bb,_0x184499,_0x1a7698){if('insert'===_0x3627bb['type']){const _0x4e6f76=_0x3627bb;return new _0x598ec8(this['_changePosition'](_0x184499['concat'](_0x4e6f76['position']['offset']),_0x1a7698),_0x4e6f76['nodes'],_0x4e6f76['baseVersion']);}if('marker'===_0x3627bb['type']&&_0x3627bb['name']['startsWith']('$markedRemove')){const _0x2c1240=_0x3627bb;return new _0x37f637(_0x2c1240['name'],_0x2c1240['oldRange'],this['_changeRange'](_0x2c1240['newRange'],_0x184499['concat'](_0x2c1240['newRange']['start']['offset']),_0x184499['concat'](_0x2c1240['newRange']['end']['offset']),_0x1a7698),_0x2c1240['_markers'],_0x2c1240['affectsData'],_0x2c1240['baseVersion']);}return _0x3627bb;}['_groupAdjacentOperations'](_0xff360){if(!_0xff360['length'])return[];const _0x450e17=[];let _0x4728c7=0x0,_0x2fbc83=0x0,_0xc00e64=[];for(let _0x23cab6=0x0;_0x23cab6<=_0xff360['length'];_0x23cab6++){const _0x407faa=_0xff360[_0x23cab6],_0x545467=_0xff360[_0x23cab6-0x1];!_0x407faa||_0x545467&&!this['_getOperationEnd'](_0x545467)['isTouching'](this['_getOperationStart'](_0x407faa))?(_0x450e17['push']({'operations':_0xc00e64,'operationsIsolated':_0xc00e64['map'](_0x2fdf28=>this['_shiftOperation'](_0x2fdf28['clone'](),-_0x2fbc83)),'groupOffset':_0x4728c7}),_0xc00e64=_0x407faa?[_0x407faa]:[],_0x2fbc83+=_0x4728c7,_0x4728c7=0x0):_0xc00e64['push'](_0x407faa),_0x407faa&&'insert'===_0x407faa['type']&&(_0x4728c7+=_0x407faa['howMany']);}return _0x450e17;}['_findAdjacentContextDistance'](_0x317da1,_0x30e9ac,_0x1e21ed,_0x394e4e=0x1){const _0x600b32=new _0x2ab43c({'startPosition':_0x317da1,'direction':_0x30e9ac});let _0x2c54aa=0x0;for(let _0x349020=0x0;_0x349020<_0x394e4e;_0x349020++){let _0x39167c=0x0,_0x5c48b9=!0x1,_0x150858='forward'===_0x30e9ac?/^\W*\w+/:/\w+\W*$/;for(const {item:_0x2d515e}of _0x600b32)if(_0x2d515e['is']('$textProxy')){const _0x58ae0a=_0x150858['exec'](_0x2d515e['data']);if(_0x58ae0a&&_0x58ae0a['length']){if(_0x39167c+='forward'===_0x30e9ac?_0x58ae0a['index']+_0x58ae0a[0x0]['length']:_0x2d515e['data']['length']-_0x58ae0a['index'],_0x58ae0a[0x0]['length']!==_0x2d515e['data']['length'])break;_0x5c48b9=!0x0,_0x150858='forward'===_0x30e9ac?/^\w+/:/\w+$/;}else{if(_0x5c48b9)break;_0x39167c+=_0x2d515e['offsetSize'];}}else{if(_0x2d515e['is']('element')){_0x1e21ed['isInline'](_0x2d515e)&&!_0x5c48b9&&(_0x39167c+=0x1);break;}}_0x2c54aa+=_0x39167c,_0x600b32['jumpTo'](_0x317da1['getShiftedBy']('forward'===_0x30e9ac?_0x2c54aa:-_0x2c54aa));}return _0x2c54aa;}['_getChangeContext'](_0x4889d2,_0x5ee24d){const _0x357ab0=T(this['context'])['model']['schema'],_0x4f443e=this['_findAdjacentContextDistance'](_0x4889d2,'backward',_0x357ab0,0x6),_0x563e4d=this['_findAdjacentContextDistance'](_0x5ee24d,'forward',_0x357ab0,0x6),_0x7bd387=_0x4889d2['getShiftedBy'](-_0x4f443e),_0x3d2250=_0x5ee24d['getShiftedBy'](_0x563e4d);return{'start':_0x7bd387,'end':_0x3d2250,'hasContentBefore':!_0x7bd387['isAtStart'],'hasContentAfter':!_0x3d2250['isAtEnd']};}['_insertMarkers'](_0x5b6ec5){const _0x4a8a76=this['context']['plugins']['get']('AIEditing'),_0xbfcdaa=new Set();T(this['context'])['model']['change'](_0x3c8150=>{for(const _0x328d90 of _0x5b6ec5){const _0x36ea3=''+fe+_0x328d90['type']+':'+_0x328d90['groupId']+'_'+_0x4a8a76['_nextDataId'](_0xbfcdaa);this['_markers']['set'](_0x36ea3,{'id':_0x36ea3,'groupId':_0x328d90['groupId'],'type':_0x328d90['type'],'content':_0x328d90['content']}),_0x3c8150['addMarker'](_0x36ea3,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x3c8150['createRange'](_0x328d90['start'],_0x328d90['end'])});}});}['_createGetContextFn'](_0x4d62d5,_0x28fdb9,_0x1fd96e){let _0x154439='';return()=>{if(!_0x154439){const _0x8e3189=_0x28fdb9['toView'](_0x4d62d5,{'showSuggestionHighlights':!0x0});let _0x44f7c2=_0x8e3189['getChild'](0x0);if(_0x44f7c2['is']('containerElement')||(_0x44f7c2=_0x8e3189),!_0x44f7c2)return'';let _0xc34404=!0x1;const _0x20b62e=[];for(const _0x1bf678 of _0x44f7c2['getChildren']())_0x1bf678['is']('element','span')&&_0x1bf678['hasClass']('ck-ai_review-marker_context-end')&&(_0xc34404=!0x1),_0xc34404&&_0x20b62e['push'](_0x1bf678),_0x1bf678['is']('element','span')&&_0x1bf678['hasClass']('ck-ai_review-marker_context-start')&&(_0xc34404=!0x0);_0x44f7c2['_removeChildren'](0x0,_0x44f7c2['childCount']),_0x1fd96e?.['ellipsisBefore']&&_0x44f7c2['_appendChild']('…'),_0x44f7c2['_appendChild'](_0x20b62e),_0x1fd96e?.['ellipsisAfter']&&_0x44f7c2['_appendChild']('…');const _0x1b3a57=_0x28fdb9['htmlProcessor']['domConverter']['viewToDom'](_0x8e3189),_0x41f863=_0x28fdb9['htmlProcessor']['htmlWriter']['getHtml'](_0x1b3a57);_0x154439=_0x41f863;}return _0x154439;};}['_createGetContentFn'](_0x4a3ef6,_0x2bf8e5){let _0x1a597c='';return()=>(_0x1a597c||(_0x1a597c=_0x2bf8e5['stringify'](_0x4a3ef6,{'showSuggestionHighlights':!0x0})),_0x1a597c);}['_createGetContentUsingDataIdFn'](_0xf292f9,_0x2ca53a,_0xd2abb8){let _0x4444af='';return()=>{if(!_0x4444af){const _0x16fa0f=_0xd2abb8['toView'](new tt(_0xf292f9)),_0x1c8f50=_0xd2abb8['htmlProcessor']['domConverter']['viewToDom'](_0x16fa0f)['querySelector']('[data-id=\x22'+_0x2ca53a+'\x22]');_0x4444af=_0x1c8f50?.['outerHTML']||'';}return _0x4444af;};}['_findMarkerElement'](_0x5e55f,_0x3fbe27=0x5){let _0x3a730d=_0x5e55f,_0x4e66e8=null;for(let _0x55a390=0x0;_0x55a390<_0x3fbe27&&_0x3a730d;_0x55a390++){if(!_0x3a730d['className']){_0x3a730d=_0x3a730d['parentElement'];continue;}if(!(''+_0x3a730d['className'])['includes']('ck-ai_review-marker_')){_0x3a730d=_0x3a730d['parentElement'];continue;}if(!_0x3a730d['getAttribute']('data-marker-id'))break;_0x4e66e8=_0x3a730d;break;}return _0x4e66e8;}['_findMarkerElementById'](_0x522cee){const _0x13d532=T(this['context']),_0x27a8a1=_0x13d532['model']['markers']['get'](_0x522cee);return _0x27a8a1?_0x1e1130(_0x13d532['editing'],_0x27a8a1):null;}['_getMarkersDataForGroup'](_0x44e1a8){return Array['from'](this['_markers']['values']())['filter'](_0x39eefe=>_0x39eefe['groupId']===_0x44e1a8);}['_getOperationStart'](_0x326f96){return'insert'===_0x326f96['type']?_0x326f96['position']:_0x326f96['newRange']['start'];}['_getOperationEnd'](_0x550802,_0x580a23=!0x1){return'insert'===_0x550802['type']?_0x580a23?_0x550802['position']:_0x550802['position']['getShiftedBy'](_0x550802['howMany']):_0x550802['newRange']['end'];}['_shiftOperation'](_0x26a39f,_0x484f59){return'insert'===_0x26a39f['type']?_0x26a39f['position']=_0x26a39f['position']['getShiftedBy'](_0x484f59):'marker'===_0x26a39f['type']&&_0x26a39f['newRange']&&(_0x26a39f['newRange']=new it(_0x26a39f['newRange']['start']['getShiftedBy'](_0x484f59),_0x26a39f['newRange']['end']['getShiftedBy'](_0x484f59))),_0x26a39f;}['_changeOperationOwnerDocument'](_0x323ebc,_0x5cbae0){'insert'===_0x323ebc['type']?_0x323ebc['position']=this['_changePositionOwnerDocument'](_0x323ebc['position'],_0x5cbae0):'marker'===_0x323ebc['type']&&_0x323ebc['newRange']&&(_0x323ebc['newRange']=this['_changeRangeOwnerDocument'](_0x323ebc['newRange'],_0x5cbae0));}['_changePositionOwnerDocument'](_0x4db78d,_0xf1063f){return new st(_0xf1063f,_0x4db78d['path']);}['_changeRangeOwnerDocument'](_0xa6355e,_0x5372bd){return new it(this['_changePositionOwnerDocument'](_0xa6355e['start'],_0x5372bd),this['_changePositionOwnerDocument'](_0xa6355e['end'],_0x5372bd));}['_changePosition'](_0x26be6b,_0x9a1389){return new st(_0x9a1389,[..._0x26be6b]);}['_changeRange'](_0x15bf71,_0x152f73,_0x146404,_0x5264ac){return new it(this['_changePosition'](_0x152f73,_0x5264ac),this['_changePosition'](_0x146404,_0x5264ac));}['_sortMarkers'](_0x580e7e){const _0x347418=_0x26df8f=>{switch(_0x26df8f){case'insert':return 0x0;case'remove-context':return 0x1;case'remove-only':return 0x2;case'remove-text':return 0x3;}};return _0x580e7e['sort']((_0x246da9,_0xbd5270)=>_0x347418(_0x246da9['type'])-_0x347418(_0xbd5270['type']));}['_hasSameTopLevelElement'](_0x118228,_0xab2816){const _0x18361b=_0x118228['getChild'](0x0),_0x12fce9=_0xab2816['getChild'](0x0);return!(!_0x18361b||!_0x12fce9)&&((!_0x18361b['is']('element')||!_0x12fce9['is']('element')||_0x18361b['name']===_0x12fce9['name'])&&!(_0x18361b['is']('element')&&!_0x12fce9['is']('element')||!_0x18361b['is']('element')&&_0x12fce9['is']('element')));}['_haveSingleTopLevelElement'](_0x411fd8){return 0x1===_0x411fd8['childCount'];}['_haveOnlyInlineContent'](_0x564d1c,_0xbc24c6){for(const _0x2ad7cb of _0x564d1c['getChildren']())if(_0x2ad7cb['is']('element')&&!_0xbc24c6['isInline'](_0x2ad7cb))return!0x1;return!0x0;}['_upsertDataId'](_0x2ad5dc,_0x4629e0){let _0x67c129=_0x2ad5dc['getAttribute'](Ct);return _0x67c129||(_0x67c129=_0x4629e0(),_0x2ad5dc['_setAttribute'](Ct,_0x67c129)),_0x67c129;}}class Ms extends _0x428ca4(){['id'];['contentNew'];['contentInitial'];['documentVersion'];constructor({id:_0x270f7e,contentNew:_0x4cf1be,contentInitial:_0x46ddc3,documentVersion:_0x1a8f8e}){super(),this['id']=_0x270f7e,this['contentNew']=_0x4cf1be,this['contentInitial']=_0x46ddc3,this['documentVersion']=_0x1a8f8e;}}class Os extends ts(){['id'];['parent'];['_data'];['_editorOperations']=[];constructor(_0x191cf8,_0x4c20e9,_0x217a04){super(),this['id']=_0x191cf8,this['parent']=_0x217a04,this['_data']=_0x4c20e9,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 Js extends ts(){['id']=_0x56075e();['callId'];['_results']=new Map();['_changes']=[];['_sourceCheck'];['_documentData'];['_aiConnector'];['_reviewParams'];['_reviewArgs'];['_activeRequest']=null;['_currentError'];['_wasAborted']=!0x1;constructor(_0x16e1ee,_0x11c948,_0x2ea089,_0x3bd5d4,_0x44fcae){super(),this['_sourceCheck']=_0x11c948,this['_documentData']=_0x16e1ee,this['_aiConnector']=_0x2ea089,this['_reviewParams']=_0x3bd5d4,this['_reviewArgs']=_0x44fcae,this['on']('change:status',(_0x362e19,_0x140bcb,_0x187d68)=>{'aborted'==_0x187d68&&(this['_wasAborted']=!0x0),this['fire']('reviewCheckRunUpdated',{'status':_0x187d68,'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'](_0x53e10a=>'pending'===_0x53e10a['status']);}get['currentError'](){return this['_currentError'];}['updateDocumentData'](_0x18d96a){this['_documentData']=_0x18d96a;}async['start'](){this['status']='loading',this['_currentError']=void 0x0;try{this['_activeRequest']=this['_createApiRequest']();const _0xad7230=await this['_activeRequest']['getStream']();this['status']='data';for await(const _0x59f222 of _0xad7230)'unmodified'!==_0x59f222['data']['operation']&&('error'!==_0x59f222['data']['operation']?'review-metadata'!==_0x59f222['event']?this['_addReviewCheckResult'](_0x59f222['data']['dataId'],_0x59f222['data']['textDelta']):this['callId']=_0x59f222['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(_0x320928){this['_currentError']=_0x320928,_0x320928 instanceof Error&&_0x320928['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'](_0x3be556,_0x78155e){const _0x30c62d=this['_results']['get'](_0x3be556);if(!_0x30c62d)return;if(0x0===_0x78155e['length'])return;const _0x2c47e3=[];_0x78155e['forEach']((_0x25d560,_0x155c5a)=>{const _0x4a9dd2=new Os(_0x30c62d['id']+'-'+_0x155c5a,_0x25d560,_0x30c62d);_0x4a9dd2['on']('change:status',()=>{this['fire']('reviewCheckResultChangeStatusUpdated',{'change':_0x4a9dd2,'status':_0x4a9dd2['status']});}),_0x4a9dd2['on']('change:isActivated',()=>{_0x4a9dd2['isActivated']?this['fire']('reviewCheckResultActivated',{'change':_0x4a9dd2}):this['fire']('reviewCheckResultDeactivated',{'change':_0x4a9dd2});}),this['_changes']['push'](_0x4a9dd2),_0x2c47e3['push'](_0x4a9dd2);}),this['fire']('reviewCheckResultReady',{'changes':_0x2c47e3,'result':_0x30c62d,'source':this});}['abort'](){this['_activeRequest']&&(this['_activeRequest']['abortController']['abort'](),this['_activeRequest']=null,this['status']='aborted');}['isChangeActive'](_0x5244ba){const _0xec55a4=this['_changes']['find'](_0x37ee38=>_0x37ee38['id']===_0x5244ba);return!(!_0xec55a4||'pending'!==_0xec55a4['status']);}['isAnyChangeActivated'](){return this['_changes']['some'](_0x4516c2=>!0x0===_0x4516c2['isActivated']);}['getActiveChanges'](){return this['_changes']['filter'](_0x2c9eb1=>'pending'===_0x2c9eb1['status']);}['getChangeById'](_0x575780){return this['_changes']['find'](_0x305255=>_0x305255['id']===_0x575780);}['markAllChangesAsAccepted'](){for(const _0x4e2abd of this['_changes'])'pending'===_0x4e2abd['status']&&(_0x4e2abd['status']='accepted');this['_checkIfFinished']();}['markChangeAsAccepted'](_0x459163){const _0x3828fa=this['_changes']['find'](_0x1f009f=>_0x1f009f['id']===_0x459163);_0x3828fa&&'pending'===_0x3828fa['status']&&(_0x3828fa['status']='accepted'),this['_checkIfFinished']();}['markChangeAsRejected'](_0x1948b2){const _0x14c8f8=this['_changes']['find'](_0x197959=>_0x197959['id']===_0x1948b2);_0x14c8f8&&'pending'===_0x14c8f8['status']&&(_0x14c8f8['status']='rejected'),this['_checkIfFinished']();}['markChangeAsOutdated'](_0x5a3890){const _0x3725a8=this['_changes']['find'](_0x533225=>_0x533225['id']===_0x5a3890);_0x3725a8&&'pending'===_0x3725a8['status']&&(_0x3725a8['status']='outdated'),this['_checkIfFinished']();}['markChangeAsPending'](_0x20326f){const _0xc862c8=this['_changes']['find'](_0xe1cdc8=>_0xe1cdc8['id']===_0x20326f);_0xc862c8&&'outdated'===_0xc862c8['status']&&(_0xc862c8['status']='pending'),this['_checkIfFinished']();}['activateChange'](_0x198376){this['_changes']['filter'](_0xcd949d=>_0xcd949d['isActivated']&&_0xcd949d['id']!==_0x198376)['forEach'](_0x458703=>{_0x458703['isActivated']=!0x1;});const _0x5b2aa8=this['_changes']['find'](_0xc9dd2=>_0xc9dd2['id']===_0x198376);_0x5b2aa8&&'pending'===_0x5b2aa8['status']&&(_0x5b2aa8['isActivated']=!0x0);}['deactivateChange'](){this['_changes']['filter'](_0x32413b=>_0x32413b['isActivated'])['forEach'](_0x3cafd7=>{_0x3cafd7['isActivated']=!0x1;});}['forceReadyState'](){this['status']='ready';}async['sendRating'](_0x4286be){if('initialized'===this['status']||'loading'===this['status']||'data'===this['status']||this['_wasAborted'])return;if(!this['callId']||0x0===this['_changes']['length'])return;let _0x1bbbe4;if(_0x4286be){const _0x88e4bb=this['_changes']['find'](_0x4f9b1b=>_0x4f9b1b['id']===_0x4286be);if(_0x88e4bb&&_0x88e4bb['isRated'])return;_0x88e4bb&&(_0x1bbbe4=_0x88e4bb['parent']['id'],_0x88e4bb['isRated']=!0x0);}const _0x5645fe={'positiveCount':this['_changes']['filter'](_0x1a25c7=>'accepted'===_0x1a25c7['status'])['length'],'totalCount':this['_changes']['length']};this['_sendRatingRequest'](_0x5645fe,this['callId'],_0x1bbbe4);}['_addReviewCheckResult'](_0x3f693d,_0x5234a0){const _0x2a7d3d=this['_documentData']['elements']['get'](_0x3f693d);if(!_0x2a7d3d)return;const _0x5ed909=_0x2a7d3d['getContent']();if(_0x5ed909===_0x5234a0)return;const _0x29ebb9=new Ms({'id':_0x3f693d,'contentInitial':_0x5ed909,'contentNew':_0x5234a0,'documentVersion':this['_documentData']['version']});this['_results']['set'](_0x29ebb9['id'],_0x29ebb9),this['fire']('reviewCheckResultAdded',{'result':_0x29ebb9,'source':this});}['_checkIfFinished'](){'finished'===this['status']&&(this['_changes']['filter'](_0x200c66=>'pending'===_0x200c66['status'])['length']>0x0&&(this['status']='ready')),'ready'===this['status']&&(0x0===this['_changes']['filter'](_0x261e7e=>'pending'===_0x261e7e['status'])['length']&&(this['status']='finished'));}}class si extends Js{get['subTitle'](){if(!this['_reviewParams']||0x0===this['_reviewParams']['length'])return'';const _0x487126=[];if(this['_reviewParams']['length']>0x0&&this['_sourceCheck']['options'])for(let _0x3cbdf0=0x0;_0x3cbdf0<this['_reviewParams']['length'];_0x3cbdf0++){if(!this['_reviewParams'][_0x3cbdf0]||!this['_sourceCheck']['options'][_0x3cbdf0])continue;const _0x3c8116=this['_sourceCheck']['options'][_0x3cbdf0],_0x1fb910=_0x3c8116['data']?.['find'](_0x10528a=>_0x10528a['id']===this['_reviewParams'][_0x3cbdf0]);_0x1fb910&&_0x487126['push'](_0x1fb910['label']);}return _0x487126['join'](',\x20');}get['reviewName'](){return this['_composeReviewName']();}['_createApiRequest'](){return this['_aiConnector']['callSystemReview']({'reviewName':this['_composeReviewName'](),'content':this['_documentData']['content'],'args':this['_reviewArgs']});}['_sendRatingRequest'](_0x3770f1,_0x2358c1,_0x5e882a){return this['_aiConnector']['upsertAIReviewRating'](this['reviewName'],_0x2358c1,_0x3770f1,_0x5e882a);}['_composeReviewName'](){return!this['_reviewParams']||0x0===this['_reviewParams']['length']||this['_sourceCheck']['useArgs']?this['_sourceCheck']['apiId']:[this['_sourceCheck']['apiId'],...this['_reviewParams']]['join']('-');}}class ve extends _0x3b66f2{['_aiConnector'];['_aiReviewCoreUi'];['_aiReviewCoreEditing'];['_aiReviewCheckList'];['_currentReviewCheckRun'];['_changeActivationSource']=null;static get['requires'](){return[q];}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}async['init'](){this['_initRequiredPlugins'](),this['_aiReviewCheckList']=await this['_getChecksList'](),this['listenTo'](this['_aiReviewCoreUi'],'getReviewCheckList',()=>{this['_aiReviewCoreUi']['setAvailableChecks'](this['_aiReviewCheckList']['checks']);}),this['listenTo'](this['_aiReviewCoreUi'],'runReviewCheck',async(_0x55f13d,_0x5c1fcd)=>{const _0x15d066=this['_aiReviewCheckList']['getCheckById'](_0x5c1fcd['id']);if(_0x15d066){this['_onReviewCheckRun'](_0x5c1fcd),this['_aiReviewCoreEditing']['switchToReadOnly'](),this['_currentReviewCheckRun']=this['_createReviewCheckRun'](_0x5c1fcd,_0x15d066),this['_aiReviewCoreUi']['setCheckResultTitle'](this['_currentReviewCheckRun']['title'],this['_currentReviewCheckRun']['subTitle']),this['_currentReviewCheckRun']['on']('reviewCheckRunUpdated',(_0x2e4aa6,_0x236cfd)=>{switch(_0x236cfd['status']){case'data':case'loading':this['_aiReviewCoreUi']['showCheckRunResults'](_0x236cfd);break;case'finished':this['_onCheckRunFinished']();break;case'ready':this['_aiReviewCoreUi']['showActionsWhenResultIsReady']();break;case'unmodified':this['_aiReviewCoreUi']['showNoChangesView']();break;case'error-general':this['_aiReviewCoreUi']['showGeneralResultsErrorView'](),this['_logError'](new _0x2ae61f('ai-review-mode-check-run-general-error',this,void 0x0,this['_currentReviewCheckRun']?.['currentError']));break;case'error-chunk':this['_aiReviewCoreUi']['showChunkErrorView'](),this['_logError'](new _0x2ae61f('ai-review-mode-check-run-chunk-error',this,void 0x0,this['_currentReviewCheckRun']?.['currentError']));break;case'aborted':this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['processedResultsCount']>0x0?setTimeout(()=>{this['_currentReviewCheckRun']?.['forceReadyState']();},0x0):this['_onReviewRunLeave'](!0x0);}'ready'!==_0x236cfd['status']&&'error-chunk'!==_0x236cfd['status']&&'error-general'!==_0x236cfd['status']||this['_currentReviewCheckRun']?.['sendRating']();}),this['_currentReviewCheckRun']['on']('reviewCheckResultAdded',(_0x518bca,_0x4f5dcb)=>{if(!this['_currentReviewCheckRun'])throw new _0x2ae61f('ai-review-mode-no-current-check-run',this);const _0x12fa4f=this['_diffContent'](_0x4f5dcb['result']['contentInitial'],_0x4f5dcb['result']['contentNew']);_0x4f5dcb['source']['addResultChanges'](_0x4f5dcb['result']['id'],_0x12fa4f);}),this['_currentReviewCheckRun']['on']('reviewCheckResultReady',(_0x338d3a,_0xfab200)=>{for(const _0xd6cf0f of _0xfab200['changes'])this['_aiReviewCoreUi']['showCheckRunResult'](_0xd6cf0f);this['_markChangePositionInEditorContent'](_0xfab200['changes'],_0xfab200['source']['documentData']);}),this['_currentReviewCheckRun']['on']('reviewCheckResultChangeStatusUpdated',(_0x44a157,_0x45591a)=>{this['_aiReviewCoreUi']['updateChangeState'](_0x45591a['change']['id'],_0x45591a['status']);}),this['_currentReviewCheckRun']['on']('reviewCheckResultActivated',(_0x516520,_0x31436e)=>{this['_onReviewCheckResultActivated'](_0x31436e);}),this['_currentReviewCheckRun']['on']('reviewCheckResultDeactivated',()=>{this['_onReviewCheckResultDeactivated']();});try{await this['_currentReviewCheckRun']['start']();}catch(_0x4e07fd){_0x4e07fd instanceof Error&&_0x4e07fd['message']['includes']('ai-request-aborted')||(_0x4e07fd instanceof _0x2ae61f?this['_logError'](_0x4e07fd):this['_logError'](new _0x2ae61f('ai-review-mode-check-run-failed',this,void 0x0,_0x4e07fd)));}}else this['_logError'](new _0x2ae61f('ai-review-mode-source-check-not-found',this,{'checkId':_0x5c1fcd['id']}));}),this['listenTo'](this['_aiReviewCoreUi'],'leaveReview',()=>{this['_onReviewRunLeave']();}),this['listenTo'](this['_aiReviewCoreUi'],'leaveReviewCoreResultList',()=>{this['_onReviewRunLeave'](!0x0);}),this['listenTo'](this['_aiReviewCoreUi'],'abortReviewStream',()=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['abort']();}),this['listenTo'](this['_aiReviewCoreUi'],'finishReview',()=>{this['_onReviewRunLeave'](!0x0);}),this['listenTo'](this['_aiReviewCoreUi'],'acceptAllChanges',()=>{if(!this['_currentReviewCheckRun'])return;const _0x50fd6f=this['_currentReviewCheckRun']['getActiveChanges']();if(!_0x50fd6f['length'])return;this['_aiReviewCoreEditing']['applyChange'](_0x50fd6f['map'](_0x238ab6=>_0x238ab6['id']));const _0x14857e=this['_currentReviewCheckRun'];_0x14857e['markAllChangesAsAccepted'](),_0x14857e['sendRating']();}),this['listenTo'](this['_aiReviewCoreUi'],'acceptChange',(_0xd56612,_0x5b9e8e)=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['isChangeActive'](_0x5b9e8e['id'])&&(this['_aiReviewCoreEditing']['applyChange']([_0x5b9e8e['id']]),this['_currentReviewCheckRun']['markChangeAsAccepted'](_0x5b9e8e['id']),this['_aiReviewCoreUi']['hideChangeBalloon'](),this['_currentReviewCheckRun']['sendRating'](_0x5b9e8e['id']));}),this['listenTo'](this['_aiReviewCoreUi'],'dismissChange',(_0x5a648b,_0x3e7d2f)=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['isChangeActive'](_0x3e7d2f['id'])&&(this['_aiReviewCoreEditing']['rejectChange'](_0x3e7d2f['id']),this['_currentReviewCheckRun']['markChangeAsRejected'](_0x3e7d2f['id']),this['_aiReviewCoreUi']['hideChangeBalloon'](),this['_currentReviewCheckRun']['sendRating'](_0x3e7d2f['id']));}),this['listenTo'](this['_aiReviewCoreUi'],'retryReview',async()=>{this['_currentReviewCheckRun']&&(this['_aiReviewCoreEditing']['clearAllMarkers'](),this['_currentReviewCheckRun']['updateDocumentData'](this['_aiReviewCoreEditing']['getDocumentData']()),await this['_currentReviewCheckRun']['restart']());}),this['listenTo'](this['_aiReviewCoreUi'],'activateChange',(_0x2cafd3,_0x34bd78)=>{this['_onActivateChange'](_0x34bd78);}),this['listenTo'](this['_aiReviewCoreUi'],'deactivateChange',(_0x497ca0,_0x5b97c7)=>{this['_onDeactivateChange'](_0x5b97c7);}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerClicked',(_0x3fdc58,_0x18b78a)=>{this['_onChangeMarkerClicked'](_0x3fdc58,_0x18b78a);}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerHovered',(_0x316463,_0x2cdf9d)=>{this['_onChangeMarkerHovered'](_0x316463,_0x2cdf9d);}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerBlurred',()=>{this['_onChangeMarkerBlurred']();}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerRemoved',(_0xfc0c94,_0x51cd95)=>{this['_onChangeMarkerRemoved'](_0xfc0c94,_0x51cd95);}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerRestored',(_0x5683a2,_0x4abd29)=>{this['_onChangeMarkerRestored'](_0x5683a2,_0x4abd29);});}['_createReviewCheckRun'](_0x326379,_0x5ae31c){return new si(this['_aiReviewCoreEditing']['getDocumentData'](),_0x5ae31c,this['_aiConnector'],_0x326379['params'],_0x326379['args']);}['_onChangeMarkerRemoved'](_0x484723,_0x30a537){this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['markChangeAsOutdated'](_0x30a537['changeId']);}['_onChangeMarkerRestored'](_0x5e7639,_0x16c745){this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['markChangeAsPending'](_0x16c745['changeId']);}['_onCheckRunFinished'](){this['_aiReviewCoreUi']['showReviewCompletedView']();}['_initRequiredPlugins'](){this['_aiConnector']=this['context']['plugins']['get']('AIConnector');}['_onReviewRunLeave'](_0x26e474=!0x1){this['_currentReviewCheckRun']&&(this['_currentReviewCheckRun']['hasModifications']||this['_currentReviewCheckRun']['sendRating'](),this['_currentReviewCheckRun']['stopListening'](),this['_currentReviewCheckRun']['abort'](),this['_currentReviewCheckRun']=void 0x0),_0x26e474&&this['_aiReviewCoreUi']['showReviewCheckList'](),this['_aiReviewCoreEditing']['clearAllMarkers'](),this['_aiReviewCoreEditing']['switchToEdit'](),this['_changeActivationSource']=null;const _0x54083b=this['_aiReviewCoreEditing']['getEditor']();_0x54083b&&_0x54083b['editing']['view']['change'](_0x795b1b=>{const _0x12c4dd=_0x54083b['editing']['view']['document']['getRoot']();_0x795b1b['removeClass']('ck-ai_review-diff',_0x12c4dd),_0x795b1b['removeClass']('ck-ai_review-highlights',_0x12c4dd),_0x795b1b['removeClass']('ck-ai-translate-mode-content',_0x12c4dd);});}['_getTranslationWithDefault'](_0x4bbf59,_0x24cdf3){const _0x131d42=i(this['context']['locale'],_0x4bbf59);return _0x131d42===_0x4bbf59?_0x24cdf3:_0x131d42;}['_logError'](_0x6af0f5,_0x3386bc=!0x1){gt(_0x6af0f5['message']),_0x3386bc||(_0x6af0f5['message']['startsWith']('ai-review-mode-models-unable-to-retrieve')?this['_aiReviewCoreUi']['showGeneralReviewCoreErrorView']():this['_aiReviewCoreUi']['showGeneralResultsErrorView']());}['_scrollToChange'](_0x33fa8a){if('content'===this['_changeActivationSource']){const _0x4d7038=this['_aiReviewCoreUi']['getChangeElement'](_0x33fa8a);_0x4d7038&&_0x3daeed(_0x4d7038['closest']('.ck-ai_review__check-run-result')||_0x4d7038);}else{if('panel'===this['_changeActivationSource']){const _0x58346b=this['_getChangeContentElement'](_0x33fa8a);if(!_0x58346b)return;_0x3a4ed0({'target':_0x58346b,'viewportOffset':{'top':0x55,'left':0x0,'bottom':0x0,'right':0x0},'ancestorOffset':0x14,'alignToTop':!0x0});}}}}const we=[{'id':'custom','commandId':'custom','title':'Custom\x20command','description':'Type\x20a\x20custom\x20command\x20to\x20review\x20the\x20content\x20exactly\x20as\x20you\x20need.','isParameterized':!0x0},{'id':'correctness','commandId':'correctness','title':'Correctness','description':'Ensure\x20the\x20text\x20is\x20factually\x20accurate\x20and\x20free\x20of\x20errors.','isParameterized':!0x1},{'id':'clarity','commandId':'clarity','title':'Clarity','description':'Improve\x20the\x20clarity\x20and\x20readability\x20of\x20the\x20text.','isParameterized':!0x1},{'id':'readability','commandId':'readability','title':'Readability','description':'Enhance\x20the\x20overall\x20readability\x20of\x20the\x20text.','isParameterized':!0x1},{'id':'length','commandId':'make','title':'Adjust\x20length','description':'Refine\x20text\x20length\x20to\x20match\x20your\x20needs.','isParameterized':!0x0,'options':[{'formType':'dropdown','label':'Adjust\x20length','default':'longer','data':[{'label':'Longer','id':'longer'},{'label':'Shorter','id':'shorter'}]}]},{'id':'tone','commandId':'make-tone','title':'Adjust\x20tone\x20and\x20style','description':'Choose\x20tone\x20and\x20style\x20to\x20change\x20content\x20as\x20you\x20need.','isParameterized':!0x0,'options':[{'formType':'dropdown','label':'Adjust\x20tone\x20and\x20style','default':'casual','data':[{'label':'Casual','id':'casual'},{'label':'Direct','id':'direct'},{'label':'Friendly','id':'friendly'},{'label':'Confident','id':'confident'},{'label':'Professional','id':'professional'}]}]}];class Ds{['id'];['commandId'];['title'];['description'];['isParameterized'];['useArgs'];['options'];['args'];get['apiId'](){return this['commandId'];}constructor(_0x22725b){this['id']=_0x22725b['id'],this['commandId']=_0x22725b['commandId'],this['title']=_0x22725b['title'],this['description']=_0x22725b['description'],this['isParameterized']=_0x22725b['isParameterized'],this['useArgs']=_0x22725b['useArgs'],this['options']=_0x22725b['options'],this['args']=_0x22725b['args'];}}class po extends ts(){['_checks']=[];['setupChecks'](_0x47f680){this['_checks']=_0x47f680['map'](_0x2e7874=>new Ds(_0x2e7874));}get['checks'](){return this['_checks'];}['getCheckById'](_0xd71d54){return this['checks']['find'](_0x1994b8=>_0x1994b8['id']===_0xd71d54);}['removeCheckById'](_0xabf816){this['_checks']=this['_checks']['filter'](_0x3f13a8=>_0x3f13a8['id']!==_0xabf816);}}class ke extends Ds{['_models']=[];['_defaultModel']=null;constructor(_0x33ac1e,_0xa9465c,_0x2a2992){super(_0x33ac1e),this['_models']=_0xa9465c,this['_defaultModel']=_0x2a2992;}get['models'](){return this['_models'];}get['defaultModel'](){return this['_defaultModel'];}}class Ie extends Ds{['isExtra']=!0x0;['prompt'];['model'];['_defaultModel']=null;constructor(_0xdd0c,_0x1089ee,_0x4bde11){super(_0xdd0c),this['prompt']=_0xdd0c['prompt'],this['model']=_0xdd0c['model'],this['model']?this['_defaultModel']=_0x1089ee['find'](_0x69a120=>_0x69a120['id']===this['model'])||null:this['_defaultModel']=_0x4bde11;}get['defaultModel'](){return this['_defaultModel'];}}class _e extends po{['_allModels']=[];['_recommendedModels']=[];['_defaultModel']=null;constructor(_0xac4b12,_0x1662f7,_0x3f1bae){super(),this['_allModels']=_0xac4b12,this['_recommendedModels']=_0x1662f7,this['_defaultModel']=_0x3f1bae;}['setupChecks'](_0x489f8){this['_checks']=_0x489f8['map'](_0xa95550=>!0x0===_0xa95550['isExtra']?new Ie(_0xa95550,this['_allModels'],this['_defaultModel']):'custom'===_0xa95550['id']?new ke(_0xa95550,this['_recommendedModels'],this['_defaultModel']):new Ds(_0xa95550));}}class Ce extends Js{['_prompt'];['_model'];constructor(_0x54d334,_0x4d10a4,_0x30b275,_0x5df3a2,_0x25bd98){super(_0x30b275,_0x5df3a2,_0x25bd98),this['_prompt']=_0x54d334,this['_model']=_0x4d10a4;}get['subTitle'](){return this['_prompt'];}['_createApiRequest'](){return this['_aiConnector']['callCustomReview']({'content':this['_documentData']['content'],'prompt':this['_prompt'],'model':this['_model']});}['_sendRatingRequest'](_0x5d2f10,_0x1fe687,_0x2f1f6c){return this['_aiConnector']['upsertCustomAIReviewRating'](_0x1fe687,_0x5d2f10,_0x2f1f6c);}}class Re extends Ce{get['subTitle'](){return'';}set['prompt'](_0x52e9cf){this['_prompt']=_0x52e9cf;}set['model'](_0x43af76){this['_model']=_0x43af76;}}class pe extends ve{static get['pluginName'](){return'AIReviewModeController';}['_isDiffOn']=!0x1;['_hasDefaultAvailableCommands']=!0x1;constructor(_0x30dbae){super(_0x30dbae),this['_hasDefaultAvailableCommands']=!this['context']['config']['get']('ai.review.availableCommands'),this['context']['config']['define']('ai.review.availableCommands',we['map'](_0x35d361=>_0x35d361['id'])),this['context']['config']['define']('ai.review.extraCommands',[]);}async['init'](){await super['init'](),this['listenTo'](this['_aiReviewCoreUi'],'toggleDiff',(_0x527fcd,_0x297577)=>{this['_isDiffOn']=_0x297577['on'],this['_onDiffChange'](this['_isDiffOn']);});}['_initRequiredPlugins'](){super['_initRequiredPlugins'](),this['_aiReviewCoreUi']=this['context']['plugins']['get']('AIReviewModeUI'),this['_aiReviewCoreEditing']=this['context']['plugins']['get']('AIReviewCoreEditing');}['_createReviewCheckRun'](_0x3cf605,_0x4e1d36){return _0x3cf605['isCustom']?new Ce(_0x3cf605['args']['prompt'],_0x3cf605['args']['model'],this['_aiReviewCoreEditing']['getDocumentData'](),_0x4e1d36,this['_aiConnector']):_0x4e1d36['isExtra']?new Re(_0x4e1d36['prompt'],_0x4e1d36['defaultModel']['id'],this['_aiReviewCoreEditing']['getDocumentData'](),_0x4e1d36,this['_aiConnector']):new si(this['_aiReviewCoreEditing']['getDocumentData'](),_0x4e1d36,this['_aiConnector'],_0x3cf605['params'],_0x3cf605['args']);}['_onReviewCheckResultActivated'](_0x33bcc8){this['_aiReviewCoreUi']['setActiveStateInResults'](_0x33bcc8['change']['id']),this['_scrollToChange'](_0x33bcc8['change']['id']);const _0xaeffc6=this['_aiReviewCoreEditing']['getMarkerElementForChange'](_0x33bcc8['change']['id']);if(!_0xaeffc6)return;const _0x585ba4=this['_aiReviewCoreEditing']['getEditor']();this['_aiReviewCoreUi']['showChangeBalloon'](_0x33bcc8['change'],()=>_0xaeffc6['getElement'](),void 0x0,'click',_0x585ba4?.['editing']?.['view']?.['getDomRoot'](),_0x585ba4?.['ui']?.['viewportOffset']),this['_aiReviewCoreEditing']['setMarkersInElementAsActive'](_0x33bcc8['change']['id']);}['_onReviewCheckResultDeactivated'](){this['_aiReviewCoreUi']['resetActiveStateInResults'](),this['_aiReviewCoreUi']['hideChangeBalloon'](),this['_aiReviewCoreEditing']['setAllMarkersAsInactive']();}['_onActivateChange'](_0xf2b8f3){this['_currentReviewCheckRun']&&'click'===_0xf2b8f3['uiInteraction']&&(this['_changeActivationSource']='panel',this['_currentReviewCheckRun']['activateChange'](_0xf2b8f3['id']));}['_onDeactivateChange'](_0x1ee720){this['_currentReviewCheckRun']&&'balloon'===_0x1ee720['origin']&&this['_currentReviewCheckRun']['deactivateChange']();}['_onChangeMarkerClicked'](_0x460c47,_0x1cae05){if(!this['_currentReviewCheckRun'])return;this['_changeActivationSource']='content',this['_currentReviewCheckRun']['activateChange'](_0x1cae05['changeId']);const _0xb154e3=this['_currentReviewCheckRun']['getChangeById'](_0x1cae05['changeId']);if(!_0xb154e3)return;const _0x28ce1d=this['_aiReviewCoreEditing']['getEditor']();this['_aiReviewCoreUi']['showChangeBalloon'](_0xb154e3,_0x1cae05['markerElement'],_0x1cae05['domEvent'],'click',_0x28ce1d?.['editing']?.['view']?.['getDomRoot'](),_0x28ce1d?.['ui']?.['viewportOffset']);}['_onChangeMarkerHovered'](_0x1c9188,_0x31f9db){if(!this['_currentReviewCheckRun'])return;if(this['_currentReviewCheckRun']['isAnyChangeActivated']())return;const _0x457694=this['_currentReviewCheckRun']['getChangeById'](_0x31f9db['changeId']);if(!_0x457694)return;const _0x20e9b7=this['_aiReviewCoreEditing']['getEditor']();this['_aiReviewCoreUi']['showChangeBalloon'](_0x457694,_0x31f9db['markerElement'],_0x31f9db['domEvent'],'hover',_0x20e9b7?.['editing']?.['view']?.['getDomRoot'](),_0x20e9b7?.['ui']?.['viewportOffset']);}['_onChangeMarkerBlurred'](){if(!this['_currentReviewCheckRun'])return;this['_currentReviewCheckRun']['isAnyChangeActivated']()||this['_aiReviewCoreUi']['hideChangeBalloon']();}['_getChangeContentElement'](_0x3ce329){const _0x432330=this['_aiReviewCoreEditing']['getMarkerElementForChange'](_0x3ce329);return _0x432330?_0x432330['getElement']():null;}['_markChangePositionInEditorContent'](_0x18df60,_0x3162c5){this['_aiReviewCoreEditing']['markChangePositionInEditorContent'](_0x18df60,_0x3162c5);}['_diffContent'](_0x5ca7ac,_0x57b13b){return this['_aiReviewCoreEditing']['diffContent'](_0x5ca7ac,_0x57b13b);}['_onReviewCheckRun'](){this['_onDiffChange'](this['_isDiffOn']);}['_onDiffChange'](_0x5b4aa7){const _0x3923cf=this['_aiReviewCoreEditing']['getEditor']();_0x5b4aa7?this['_aiReviewCoreUi']['hideDiffInBalloon']():this['_aiReviewCoreUi']['showDiffInBalloon'](),_0x3923cf&&_0x3923cf['editing']['view']['change'](_0x4f01ff=>{const _0x59e160=_0x3923cf['editing']['view']['document']['getRoot']();for(const _0x4cde17 of _0x59e160['getClassNames']())_0x4cde17['startsWith']('ck-ai_review-')&&_0x4f01ff['removeClass'](_0x4cde17,_0x59e160);_0x4f01ff['addClass'](_0x5b4aa7?'ck-ai_review-diff':'ck-ai_review-highlights',_0x59e160);});}async['_getChecksList'](){const _0x208c37=[...we,...this['_getExtraChecks']()],_0x19e2c3=this['context']['config']['get']('ai.review.availableCommands')||[];this['_logErrorForNonExistentChecks'](_0x19e2c3,_0x208c37);let _0x433b8d=_0x208c37;this['_hasDefaultAvailableCommands']||(_0x433b8d=_0x19e2c3['map'](_0xdf070f=>_0x208c37['find'](_0xce9f14=>_0xce9f14['id']===_0xdf070f))['filter'](_0x5102e4=>!!_0x5102e4)),_0x433b8d=_0x433b8d['map'](_0x513898=>_0x513898['isExtra']?_0x513898:this['_translateReviewCheck'](_0x513898));const _0x4f81cb=_0x433b8d['some'](_0x261f9f=>_0x261f9f['isExtra']||'custom'===_0x261f9f['id']);let _0x2ae030=[],_0x38e797=[],_0x4c0aaf=null;if(_0x4f81cb){const _0x439492=await this['_getModels']();_0x2ae030=_0x439492['all'],_0x38e797=_0x439492['recommended'],_0x4c0aaf=_0x439492['default'];}const _0x572d4b=new _e(_0x2ae030,_0x38e797,_0x4c0aaf);return _0x572d4b['setupChecks'](_0x433b8d),_0x4f81cb&&this['_filterChecksWithMissingModel'](_0x572d4b),_0x572d4b;}['_getExtraChecks'](){return(this['context']['config']['get']('ai.review.extraCommands')||[])['map'](_0x49da57=>({'id':_0x49da57['id'],'commandId':_0x49da57['id'],'title':_0x49da57['label'],'description':_0x49da57['description'],'isParameterized':!0x1,'isExtra':!0x0,'prompt':_0x49da57['prompt'],'model':_0x49da57['model']}));}['_logErrorForNonExistentChecks'](_0x80bd39,_0x159300){const _0x2459e7=_0x80bd39['filter'](_0x1cbd53=>!_0x159300['some'](_0x29dd39=>_0x29dd39['id']===_0x1cbd53));_0x2459e7['length']&&this['_logError'](new _0x2ae61f('ai-review-mode-non-existent-commands-used',this,{'commandIds':_0x2459e7['join'](',\x20')}),!0x0);}async['_getModels'](){try{const _0x5d6055=new It({'connector':this['_aiConnector'],'config':this['context']['config']['get']('ai.models'),'locale':this['context']['locale']});return{'all':await _0x5d6055['getAll'](),'recommended':await _0x5d6055['getAvailableModels'](),'default':await _0x5d6055['getDefault']()};}catch(_0x19b938){return this['_logError'](new _0x2ae61f('ai-review-mode-models-unable-to-retrieve',this,void 0x0,_0x19b938)),{'all':[],'recommended':[],'default':null};}}['_translateReviewCheck'](_0x5e26d4){const _0x452834='AI_REVIEW_CHECK_'+_0x5e26d4['id']['toUpperCase']()['replaceAll']('-','_'),_0x2ca302={..._0x5e26d4,'title':this['_getTranslationWithDefault'](_0x452834+'_TITLE',_0x5e26d4['title']),'description':this['_getTranslationWithDefault'](_0x452834+'_DESCRIPTION',_0x5e26d4['description'])};return _0x5e26d4['options']&&(_0x2ca302['options']=_0x5e26d4['options']['map'](_0x1a8036=>({..._0x1a8036,'label':this['_getTranslationWithDefault'](_0x452834+'_OPTIONS_LABEL',_0x1a8036['label']||''),'data':_0x1a8036['data']?_0x1a8036['data']['map'](_0x100b9e=>({..._0x100b9e,'label':this['_getTranslationWithDefault'](_0x452834+'_OPTIONS_DATA_'+_0x100b9e['id']['toUpperCase'](),_0x100b9e['label'])})):void 0x0}))),_0x2ca302;}['_filterChecksWithMissingModel'](_0x1c7bbe){const _0x574458=[];_0x1c7bbe['checks']['forEach'](_0x179bfe=>{(_0x179bfe instanceof Ie&&!_0x179bfe['defaultModel']||_0x179bfe instanceof ke&&!_0x179bfe['models']['length'])&&_0x574458['push'](_0x179bfe['id']);}),_0x574458['length']&&_0x574458['forEach'](_0x46ada2=>{_0x1c7bbe['removeCheckById'](_0x46ada2),this['_logError'](new _0x2ae61f('ai-review-mode-command-unavailable-due-to-missing-model',this,{'commandId':_0x46ada2}),!0x0);});}}class AIReviewMode extends _0x3b66f2{static get['requires'](){return[pe,ge,de];}static get['pluginName'](){return'AIReviewMode';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class jr extends Ds{get['apiId'](){return'translate';}}class Pe extends po{['setupChecks'](_0x328c38){this['_checks']=_0x328c38['map'](_0x12a336=>new jr(_0x12a336));}}class Se extends si{['_title'];constructor(_0x427b18,_0x578f98,_0x32120f,_0x4f7077,_0x11af26,_0xbe9326){super(_0x427b18,_0x578f98,_0x32120f,_0x11af26,_0xbe9326),this['_title']=_0x4f7077;}get['title'](){return this['_title'];}get['subTitle'](){return this['_sourceCheck']['title'];}}class rr extends ve{static get['pluginName'](){return'AITranslateController';}constructor(_0x30a739){super(_0x30a739),this['context']['config']['define']('ai.translate.languages',[{'label':'English','id':'english'},{'label':'Spanish','id':'spanish'},{'label':'French','id':'french'},{'label':'German','id':'german'},{'label':'Chinese\x20(Simplified)','id':'chinese'},{'label':'Japanese','id':'japanese'},{'label':'Russian','id':'russian'},{'label':'Portuguese','id':'portuguese'},{'label':'Korean','id':'korean'},{'label':'Italian','id':'italian'}]);}['_onCheckRunFinished'](){this['_onReviewRunLeave'](!0x0);}['_initRequiredPlugins'](){super['_initRequiredPlugins'](),this['_aiReviewCoreUi']=this['context']['plugins']['get']('AITranslateUI'),this['_aiReviewCoreEditing']=this['context']['plugins']['get']('AIReviewCoreEditing');}['_createReviewCheckRun'](_0x47461f,_0x12f9cb){return new Se(this['_aiReviewCoreEditing']['getDocumentData'](),_0x12f9cb,this['_aiConnector'],i(this['context']['locale'],'AI_REVIEW_CHECK_TRANSLATE_TITLE'),_0x47461f['params'],_0x47461f['args']);}['_onReviewCheckResultActivated'](_0x462dbe){this['_aiReviewCoreUi']['setActiveStateInResults'](_0x462dbe['change']['id']),this['_aiReviewCoreEditing']['setMarkersInElementAsActive'](_0x462dbe['change']['id']);}['_onReviewCheckResultDeactivated'](){this['_aiReviewCoreEditing']['setAllMarkersAsInactive'](),this['_aiReviewCoreUi']['resetActiveStateInResults']();}['_onActivateChange'](_0x12a2c9){this['_currentReviewCheckRun']&&('hover'===_0x12a2c9['uiInteraction']&&(this['_changeActivationSource']='panel',this['_currentReviewCheckRun']['activateChange'](_0x12a2c9['id'])),'click'===_0x12a2c9['uiInteraction']&&this['_scrollToChange'](_0x12a2c9['id']));}['_onDeactivateChange'](_0x59aa59){this['_currentReviewCheckRun']&&'panel'===_0x59aa59['origin']&&this['_currentReviewCheckRun']['deactivateChange']();}['_onChangeMarkerClicked'](_0x3b228d,_0x39a734){this['_currentReviewCheckRun']&&(this['_changeActivationSource']='content',this['_currentReviewCheckRun']['activateChange'](_0x39a734['changeId']),this['_scrollToChange'](_0x39a734['changeId']));}['_onChangeMarkerHovered'](_0x339745,_0x2067bd){this['_currentReviewCheckRun']&&(this['_changeActivationSource']='content',this['_currentReviewCheckRun']['activateChange'](_0x2067bd['changeId']),this['_aiReviewCoreEditing']['reactivateMarkers'](_0x2067bd['changeId']));}['_onChangeMarkerBlurred'](){this['_currentReviewCheckRun']&&'content'===this['_changeActivationSource']&&(this['_currentReviewCheckRun']['deactivateChange'](),this['_aiReviewCoreEditing']['setAllMarkersAsInactive']());}['_getChangeContentElement'](_0x13294e){return this['_aiReviewCoreEditing']['getContentElementForChange'](_0x13294e);}['_markChangePositionInEditorContent'](_0x1b29ae,_0x53cb5f){this['_aiReviewCoreEditing']['markChangePositionInEditorContent'](_0x1b29ae,_0x53cb5f);}['_diffContent'](_0x59337c,_0x3d664e){return this['_aiReviewCoreEditing']['diffContent'](_0x59337c,_0x3d664e,!0x0);}['_onReviewCheckRun'](){const _0xd88464=this['_aiReviewCoreEditing']['getEditor']();_0xd88464&&_0xd88464['editing']['view']['change'](_0x1f5291=>{const _0x593552=_0xd88464['editing']['view']['document']['getRoot']();for(const _0x3298a4 of _0x593552['getClassNames']())(_0x3298a4['startsWith']('ck-ai-review-')||'ck-ai-translate-'===_0x3298a4)&&_0x1f5291['removeClass'](_0x3298a4,_0x593552);_0x1f5291['addClass']('ck-ai-translate-mode-content',_0x593552);});}async['_getChecksList'](){const _0x477cef=[],_0x77370e=this['context']['config']['get']('ai.translate.languages')||[];for(const _0x228a65 of _0x77370e)_0x477cef['push']({'title':_0x228a65['label'],'id':_0x228a65['id'],'commandId':_0x228a65['id'],'description':'','isParameterized':!0x1,'useArgs':!0x0,'args':{'language':_0x228a65['id']}});const _0x4880d9=new Pe();return _0x4880d9['setupChecks'](this['_translateChecks'](_0x477cef)),_0x4880d9;}['_translateChecks'](_0xc89432){return _0xc89432['map'](_0x539e81=>{const _0x48d41f='AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_'+_0x539e81['title']['toUpperCase']()['replaceAll']('-','_');return{..._0x539e81,'title':this['_getTranslationWithDefault'](_0x48d41f,_0x539e81['title'])};});}}class Le extends Ve{constructor(_0x30d1f3,_0x3efe6b){super(_0x30d1f3,_0x3efe6b),this['on']('set:isLoading',(_0x9bd821,_0x3ca336,_0x1e0a37)=>{_0x1e0a37&&(this['headerTitle']=i(this['locale'],'AI_TRANSLATE_CHECK_RESULTS_LOADING_TITLE'));}),this['on']('set:isResultReady',(_0x4fa0bf,_0x1f7c36,_0x5a7d66)=>{_0x5a7d66&&(this['headerTitle']=i(this['locale'],'AI_TRANSLATE_CHECK_RESULTS_READY_TITLE'));});}['_createAcceptAllButtonView'](){const _0x5eac28=super['_createAcceptAllButtonView']();return _0x5eac28['set']('label',i(this['locale'],'AI_TRANSLATE_ACCEPT_ALL')),_0x5eac28;}['_createExitReviewButtonView'](){const _0x12c55b=super['_createExitReviewButtonView']();return _0x12c55b['set']('label',i(this['locale'],'AI_CHAT_HISTORY_CANCEL')),_0x12c55b;}}class Ne extends je{['_setupTemplate'](){const _0x549acc=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-translate__check-list-wrapper',_0x549acc['if']('isVisible','ck-hidden',_0x38cdb0=>!_0x38cdb0)]},'children':[{'tag':'div','attributes':{'class':['ck-ai-translate__check-list-header']},'children':[{'tag':'h2','children':[{'text':i(this['locale'],'AI_TRANSLATE_CHECK_LIST_HEADER_TITLE')}]},{'tag':'p','children':[{'text':i(this['locale'],'AI_TRANSLATE_CHECK_LIST_HEADER_DESCRIPTION')}]}]},{'tag':'div','attributes':{'class':['ck-ai_review__check-list',_0x549acc['if']('isVisible','ck-hidden',_0x160cdf=>!_0x160cdf)]},'children':this['_checkViews']}]});}}class tr extends Me{static get['pluginName'](){return'AITranslateUI';}['createMainView'](){const _0x53f54c=this['context']['locale'],_0x3f280f=new _0xa16c5(_0x53f54c,{'label':i(_0x53f54c,'AI_REVIEW_CHECK_TRANSLATE_TITLE'),'icon':_0x458a75,'class':'ck-ai-header\x20ck-ai-header_review-translate'}),_0x48ad56=new Ae(_0x53f54c,{'header':_0x3f280f,'list':new Ne(_0x53f54c),'results':new Le(_0x53f54c,{'generalErrorText':i(_0x53f54c,'AI_TRANSLATE_GENERAL_ERROR_MESSAGE')}),'completed':new be(_0x53f54c,{'headerText':i(_0x53f54c,'AI_TRANSLATE_FINISH_HEADER_TITLE'),'emptyResultsText':i(_0x53f54c,'AI_TRANSLATE_EMPTY_RESULTS_TEXT'),'buttonText':i(_0x53f54c,'AI_TRANSLATE_FINISH_BUTTON_LABEL')})});return _0x48ad56['extendTemplate']({'attributes':{'class':'ck-ai-translate-mode'}}),_0x48ad56;}['registerTab'](){const _0xbf3894=this['context']['plugins']['get']('AITabs');_0xbf3894['view']['on']('activateTab',(_0x24ecad,_0x7fbee4)=>{'translate'===_0x7fbee4?this['fire']('getReviewCheckList'):this['fire']('leaveReview');}),_0xbf3894['view']['addTab']({'id':'translate','buttonLabel':i(this['context']['locale'],'AI_REVIEW_CHECK_TRANSLATE_TITLE'),'buttonIcon':_0x458a75,'order':0x0,'content':this['_mainView']});}}class AITranslate extends _0x3b66f2{static get['requires'](){return[rr,tr,de];}static get['pluginName'](){return'AITranslate';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}export{ri as AIActions,K as AIAdapter,AIAssistant,n as AIAssistantUI,Q as AIBalloon,AIChat,at as AIChatController,ht as AIChatHistory,jt as AIChatHistoryController,xt as AIChatHistoryUI,AIChatShortcuts,ct as AIChatUI,q as AIConnector,D as AIEditing,AIEditorIntegration,Qt as AIQuickActionType,AIQuickActions,ii as AIQuickActionsUI,er as AIRequestError,Ds as AIReviewCheck,Ms as AIReviewCheckResult,Js as AIReviewCheckRun,AIReviewMode,ve as AIReviewModeController,de as AIReviewModeEditing,ge as AIReviewModeUI,pt as AITabs,ar as AITextAdapter,qt as AIToggleButtonUI,AITranslate,rr as AITranslateController,tr as AITranslateUI,AWSTextAdapter,OpenAITextAdapter,E as ShowAIAssistantCommand,io as ToggleAICommand,us as createResizeButton,Wn as getDefaultAICommands};
|