@ckeditor/ckeditor5-ai 47.6.0 → 47.6.1-alpha.1
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.d.ts +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 _0x53f6d2,Command as Lt,ContextPlugin as _0x5dcf5b,Editor as _0x39b2a6}from'@ckeditor/ckeditor5-core/dist/index.js';import{IconCopy as _0x1c808a,IconCheck as _0x386c9f,IconError as _0x27052d,IconSubmit as _0x4d010f,IconAIHistory as Ht,IconMagicWand as _0x5a8842,IconRobotPencil as _0x22be60,IconMaximize as _0x58d6c6,IconMinimize as _0xd6b3a0,IconShowChangesOn as _0x576a77,IconShowChangesOff as _0x47ae5e,IconDocument as _0x545232,IconBoxWithCross as _0x37bcd5,IconBoxWithCheck as _0x32af33,IconBoxWithMarker as _0x3cb7ec,IconInfo as tc,IconLoupe as _0x3d0ec3,IconCancel as _0x12f0df,IconStop as _0x45f60c,IconAIChat as Et,IconPlus as _0x18a571,IconPin as _0x1d01b4,IconThreeHorizontalDots as _0x36ac21,IconChevronDown as _0x5ef844,IconChevronUp as _0x57c1ba,IconOutdated as _0x4ea3ef,IconEye as _0x3f74ad,IconEyeCrossedOut as _0x442060,IconChevronRight as _0x2a08e8,IconAIReview as _0x31c506,IconAITranslate as _0x4cfcba}from'@ckeditor/ckeditor5-icons/dist/index.js';import{uid as _0x677d44,CKEditorError as _0x25c351,ObservableMixin as ts,global as _0x1385df,isVisible as _0x3e9e44,Rect as _0x5002e3,Collection as _0x405f09,FocusTracker as _0x50d771,KeystrokeHandler as _0x407d91,first as _0x22aa77,toArray as _0x5453e9,EmitterMixin as _0xa7ecb2,logWarning as _0x1c9a23,logError as _0x2d18bd,scrollViewportToShowTarget as _0x517478,scrollAncestorsToShowTarget as _0x2d39e3,ResizeObserver as _0x54df55,_isMotionReduced as mt,getConstrainedViewportRect as _0x3e4f1d,DomEmitterMixin as _0x30e617}from'@ckeditor/ckeditor5-utils/dist/index.js';import{ToolbarView as _0x50bbb8,ButtonView as _0x1d1b95,View as _0x1f054a,SpinnerView as _0x17fe29,IconView as _0x152087,AutocompleteView as _0x9be194,ListView as _0xc6bdf6,ListItemGroupView as _0x2b2d84,ListItemView as _0x2a0bb9,ButtonLabelView as _0x34171b,FocusCycler as _0x18b3f0,createLabeledTextarea as _0x2dda8d,Dialog as _0x2dc660,createDropdown as _0x290605,addMenuToDropdown as _0x51e2e4,MenuBarMenuView as _0x36bad0,MenuBarMenuListItemButtonView as _0x229d28,DialogViewPosition as _0x22ba1a,MenuBarMenuListView as _0x1388e9,MenuBarMenuListItemView as _0x134620,BodyCollection as _0x1c4f1c,BalloonPanelView as _0x10e1b3,clickOutsideHandler as _0x1d6ed3,addListToDropdown as _0x46fef8,UIModel as _0x53ecce,submitHandler as _0x5b1132,LabeledFieldView as _0x1e4591,createLabeledInputText as _0x4b3e4e,FormHeaderView as _0x337d54,HighlightedTextView as _0x5ecd8f,ViewCollection as _0x44a698,FileDialogButtonView as _0x34ca85,InputTextView as _0x3ca17d,SearchTextView as _0x1877d1,ListItemButtonView as _0x3abefb,ButtonLabelWithHighlightView as _0x5707f9,DropdownMenuPanelPositioningFunctions as _0x7bd7ce,BalloonToolbar as te,FormRowView as _0x57479f,TextareaView as _0x380d9b}from'@ckeditor/ckeditor5-ui/dist/index.js';import{ClipboardPipeline as _0x293bc2,ClipboardMarkersUtils as _0x36cf6}from'@ckeditor/ckeditor5-clipboard/dist/index.js';import{ViewDocumentDomEventData as _0x1d6dc5,ViewDataTransfer as _0x3d063b,ViewUpcastWriter as _0x3e9e59,Matcher as _0x3839bf,_DetachOperation as lt,_insertIntoModelNodeList as _0x2aeeda,_removeFromModelNodeList as to,ModelRange as dt,transformOperationSets as xt,ViewDowncastWriter as Ot,ModelDocumentFragment as jt,ModelPosition as Dt,ModelTreeWalker as _0x31a869,MarkerOperation as _0x1c5019,InsertOperation as _0x23db8e}from'@ckeditor/ckeditor5-engine/dist/index.js';import{unescape as _0x419c4b,escape as _0x4ae586,escapeRegExp as _0x1afc1d,debounce as _0x21c87d}from'es-toolkit/compat';import{BedrockRuntimeClient as _0x251854,InvokeModelWithResponseStreamCommand as _0x62fa9,InvokeModelCommand as _0x43fbb4}from'@aws-sdk/client-bedrock-runtime';import{createParser as $t}from'eventsource-parser';import{parseDocument as _0x296793}from'htmlparser2';import{isTag as _0x441935,findOne as gt,getParent as _0x2c5477,findAll as _0x5b5fc9,removeElement as _0x210a44,replaceElement as _0x46022b,prepend as _0x45d87d,prependChild as _0x2cb06e,appendChild as _0x1854ba,append as _0x40b605,find as _0x408f6d,isComment as _0x2a0cb6,getChildren as _0xf7fac1,textContent as _0x593e8e}from'domutils';import _0xc63f4e from'dom-serializer';import{Document as _t,Element as _0x38e3db,Text as _0x4fdfd5,cloneNode as _0x26f51,isDocument as _0x528e78,isText as _0x99d146,NodeWithChildren as _0x513cab}from'domhandler';import{MarkdownGfmMdToHtml as _0x52cc6d}from'@ckeditor/ckeditor5-markdown-gfm/dist/index.js';import{fixElementSuggestionRange as _0x783893,DocumentCompare as ot,DATA_ID_MODEL_ATTRIBUTE as nt,ConfirmMixin as _0x25cea9,LateFocusDropdownButtonView as _0x36a822,getAllMarkersDomElementsSorted as _0x19636f,SuggestionsConversion as Nt,DATA_ID_VIEW_ATTRIBUTE as _0xfbb69e,getMarkerDomElement as _0x470cd1}from'ckeditor5-collaboration/dist/index.js';import{cloneDeep as _0x2b41ab}from'es-toolkit';import _0x4c0a39 from'morphdom';import{IconWeb as _0x26bf07,IconClose as _0x186d14,IconDocument as _0x1ef80c,IconSelection as _0x1f3474,IconFileUpload as _0x107670,IconLink as _0x9a2128,IconBulb as _0x782cf1,IconAI as _0x2e776a,IconPreviousArrow as _0x37ead0,IconCheck as _0xa99da,IconDocumentOutline as _0x4791e0,IconPaperClip as _0x4db22d,IconBrowseFiles as _0x1c54d4,IconDropdownArrow as _0x264f12,IconAIChat as _0x315ea9,IconAIReview as _0x1a4041,IconAITranslate as Vt,IconAIAskAI as _0x5591e5,IconThumbUp as _0x4d8f3a,IconThumbDown as _0x23728d,IconCopy as _0x353d3e,IconShowChangesOff as _0x44ac4f,IconShowChangesOn as _0x42f8e1,IconAIQuickActions as bt,IconAIChatCommands as Gt,IconAIImproveWriting as Wt,IconAIContinueWriting as zt,IconAIGrammarCheck as Ft,IconAIAdjustLength as Kt,IconAIChangeTone as Yt,IconAIOther as Jt,IconRefresh as _0x1b9a26,IconNextArrow as _0xa5f5aa}from'@ckeditor/ckeditor5-icons/dist/index.js';import{diffArrays as _0x36b77a}from'diff';const V='_ungrouppedCommands';function f(_0x3c2777,_0x28a553){const _0x130f13=(0x0,_0x28a553['t'])('Other');return _0x3c2777['length']?'groupId'in _0x3c2777[0x0]?_0x3c2777:[{'groupId':V,'groupLabel':_0x130f13,'order':0x1/0x0,'commands':_0x3c2777}]:[{'groupId':V,'groupLabel':_0x130f13,'order':0x1/0x0,'commands':[]}];}const Kn=globalThis['DataTransfer'],A='ai-ui';class d extends _0x53f6d2{static get['pluginName'](){return'AIAssistantEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const {editor:_0x2c1d3f}=this,_0x5799d1=['ck-fake-ai-selection'];_0x2c1d3f['config']['get']('ai.assistant.useTheme')&&_0x5799d1['push']('ck-ai-assistant-ui_theme'),_0x2c1d3f['conversion']['for']('editingDowncast')['markerToHighlight']({'model':A,'view':{'classes':_0x5799d1,'priority':0xc}}),_0x2c1d3f['conversion']['for']('editingDowncast')['markerToElement']({'model':A,'view':(_0x12e730,{writer:_0x313ac0})=>{if(!_0x12e730['markerRange']['isCollapsed'])return null;const _0x21636b=_0x313ac0['createUIElement']('span');return _0x313ac0['addClass'](['ck-fake-ai-selection','ck-fake-ai-selection_collapsed'],_0x21636b),_0x21636b;}});}['afterInit'](){!async function(_0x55830f){const _0x4a8f0e=_0x4dff35([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]),_0x51b5c4=0x3dffc4e1,_0x2b13d5=0x3df84781^_0x51b5c4,_0x276af6=window[_0x4dff35([0x44,0x61,0x74,0x65])][_0x4dff35([0x6e,0x6f,0x77])](),_0x4d2c08=_0x55830f[_0x4dff35([0x65,0x64,0x69,0x74,0x6f,0x72])],_0x242f1a=new window[(_0x4dff35([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x24788b=>{_0x4d2c08[_0x4dff35([0x6f,0x6e,0x63,0x65])](_0x4dff35([0x72,0x65,0x61,0x64,0x79]),_0x24788b);}),_0x51c3af={[_0x4dff35([0x6b,0x74,0x79])]:_0x4dff35([0x45,0x43]),[_0x4dff35([0x75,0x73,0x65])]:_0x4dff35([0x73,0x69,0x67]),[_0x4dff35([0x63,0x72,0x76])]:_0x4dff35([0x50,0x2d,0x32,0x35,0x36]),[_0x4dff35([0x78])]:_0x4dff35([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]),[_0x4dff35([0x79])]:_0x4dff35([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]),[_0x4dff35([0x61,0x6c,0x67])]:_0x4dff35([0x45,0x53,0x32,0x35,0x36])},_0x232d99=_0x4d2c08[_0x4dff35([0x63,0x6f,0x6e,0x66,0x69,0x67])][_0x4dff35([0x67,0x65,0x74])](_0x4dff35([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79]));async function _0x30c844(){let _0x53d6f2,_0x4a6628=null,_0xf09f6e=null;try{if(_0x232d99==_0x4dff35([0x47,0x50,0x4c]))return _0x4dff35([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]);if(_0x53d6f2=_0x2a9b1b(),!_0x53d6f2)return _0x4dff35([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);return _0x53d6f2[_0x4dff35([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])]&&(_0xf09f6e=_0x3a8285(_0x53d6f2[_0x4dff35([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])],_0x53d6f2[_0x4dff35([0x6a,0x74,0x69])])),await _0x407ece()?_0xf06ce8()?_0x5e1d5b()?_0x4dff35([0x45,0x78,0x70,0x69,0x72,0x65,0x64]):_0x52888f()?(_0x53d6f2[_0x4dff35([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x4dff35([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e])&&(_0x4a6628=_0x4f1669(_0x4dff35([0x45,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e,0x4c,0x69,0x6d,0x69,0x74]))),await _0x6cecc4()):_0x4dff35([0x44,0x6f,0x6d,0x61,0x69,0x6e,0x4c,0x69,0x6d,0x69,0x74]):_0x4dff35([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]):_0x4dff35([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}catch{return _0x4dff35([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}function _0x5e1d5b(){const _0xb71cf5=[_0x4dff35([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e]),_0x4dff35([0x74,0x72,0x69,0x61,0x6c])][_0x4dff35([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x53d6f2[_0x4dff35([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])])?_0x276af6/0x3e8:0xe10*_0x2b13d5;return _0x53d6f2[_0x4dff35([0x65,0x78,0x70])]<_0xb71cf5;}function _0xf06ce8(){const _0x4fbd08=_0x53d6f2[_0x4dff35([0x66,0x65,0x61,0x74,0x75,0x72,0x65,0x73])];return!!_0x4fbd08&&(!!_0x4fbd08[_0x4dff35([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x4dff35([0x2a]))||!!_0x4fbd08[_0x4dff35([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x4dff35([0x41,0x49])));}function _0x52888f(){const _0x17093b=_0x53d6f2[_0x4dff35([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x64,0x48,0x6f,0x73,0x74,0x73])];if(!_0x17093b||0x0==_0x17093b[_0x4dff35([0x6c,0x65,0x6e,0x67,0x74,0x68])])return!0x0;const {hostname:_0x17c09b}=new URL(window[_0x4dff35([0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e])]['href']);if(_0x17093b[_0x4dff35([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x17c09b))return!0x0;const _0x12aaaa=_0x17c09b[_0x4dff35([0x73,0x70,0x6c,0x69,0x74])](_0x4dff35([0x2e]));return _0x17093b[_0x4dff35([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x1393c0=>_0x1393c0[_0x4dff35([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x4dff35([0x2a])))[_0x4dff35([0x6d,0x61,0x70])](_0x265eeb=>_0x265eeb[_0x4dff35([0x73,0x70,0x6c,0x69,0x74])](_0x4dff35([0x2e])))[_0x4dff35([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x6b6c42=>_0x6b6c42[_0x4dff35([0x6c,0x65,0x6e,0x67,0x74,0x68])]<=_0x12aaaa[_0x4dff35([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0x4dff35([0x6d,0x61,0x70])](_0x52245f=>Array(_0x12aaaa[_0x4dff35([0x6c,0x65,0x6e,0x67,0x74,0x68])]-_0x52245f[_0x4dff35([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0x4dff35([0x66,0x69,0x6c,0x6c])](_0x52245f[0x0]===_0x4dff35([0x2a])?_0x4dff35([0x2a]):'')[_0x4dff35([0x63,0x6f,0x6e,0x63,0x61,0x74])](_0x52245f))[_0x4dff35([0x73,0x6f,0x6d,0x65])](_0x1e2755=>_0x12aaaa[_0x4dff35([0x65,0x76,0x65,0x72,0x79])]((_0x3bd8e0,_0x16f910)=>_0x1e2755[_0x16f910]===_0x3bd8e0||_0x1e2755[_0x16f910]===_0x4dff35([0x2a])));}function _0x6cecc4(){return _0x4a6628&&_0xf09f6e?new window[(_0x4dff35([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x301d3e,_0x160bff)=>{_0x4a6628[_0x4dff35([0x74,0x68,0x65,0x6e])](_0x301d3e,_0x160bff),_0xf09f6e[_0x4dff35([0x74,0x68,0x65,0x6e])](_0x5c4350=>{_0x5c4350!=_0x4dff35([0x56,0x61,0x6c,0x69,0x64])&&_0x301d3e(_0x5c4350);},_0x160bff);}):_0x4a6628||_0xf09f6e||_0x4dff35([0x56,0x61,0x6c,0x69,0x64]);}}function _0x3a8285(_0x3b8cb7,_0x2f1a50){return new window[(_0x4dff35([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x27f365=>{if(_0x103fe8())return _0x27f365(_0x4dff35([0x56,0x61,0x6c,0x69,0x64]));_0x41d381(),_0x4d2c08[_0x4dff35([0x64,0x65,0x63,0x6f,0x72,0x61,0x74,0x65])](_0x4dff35([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]));let _0x1f8c59=!0x1;const _0x1023f2=_0x677d44();function _0x52df2e(_0x3af977){return!!_0x3af977&&(typeof _0x3af977===_0x4dff35([0x6f,0x62,0x6a,0x65,0x63,0x74])||typeof _0x3af977===_0x4dff35([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]))&&typeof _0x3af977[_0x4dff35([0x74,0x68,0x65,0x6e])]===_0x4dff35([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e])&&typeof _0x3af977[_0x4dff35([0x63,0x61,0x74,0x63,0x68])]===_0x4dff35([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]);}function _0x5197a6(_0x42a814){_0x2bd694(_0x42a814)[_0x4dff35([0x74,0x68,0x65,0x6e])](_0x2559d9=>{if(!_0x2559d9||_0x2559d9[_0x4dff35([0x73,0x74,0x61,0x74,0x75,0x73])]!=_0x4dff35([0x6f,0x6b]))return _0x4dff35([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]);return _0x59573a(_0x5c23f2(_0x1023f2+_0x2f1a50))!=_0x2559d9[_0x4dff35([0x76,0x65,0x72,0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6f,0x6e])]?_0x4dff35([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]):_0x4dff35([0x56,0x61,0x6c,0x69,0x64]);})[_0x4dff35([0x74,0x68,0x65,0x6e])](_0x49002f=>(_0x230b9c(),_0x49002f),()=>{const _0x3e6407=_0x59acda();return null==_0x3e6407?(_0x230b9c(),_0x4dff35([0x56,0x61,0x6c,0x69,0x64])):_0x4dff35(_0x276af6-_0x3e6407>(0x19f340e1^_0x51b5c4)?[0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]:[0x56,0x61,0x6c,0x69,0x64]);})[_0x4dff35([0x74,0x68,0x65,0x6e])](_0x27f365)[_0x4dff35([0x63,0x61,0x74,0x63,0x68])](()=>{_0x27f365(_0x4dff35([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});const _0x2304d6=0x3dc92a61^_0x51b5c4;function _0x230b9c(){const _0x937f5b=_0x4dff35([0x6c,0x6c,0x63,0x74,0x2d])+_0x59573a(_0x5c23f2(_0x3b8cb7)),_0xd0498=_0x47edcc(_0x59573a(window[_0x4dff35([0x4d,0x61,0x74,0x68])][_0x4dff35([0x63,0x65,0x69,0x6c])](_0x276af6/_0x2304d6)));window[_0x4dff35([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x4dff35([0x73,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x937f5b,_0xd0498);}function _0x59acda(){const _0x4d417a=_0x4dff35([0x6c,0x6c,0x63,0x74,0x2d])+_0x59573a(_0x5c23f2(_0x3b8cb7)),_0x58789e=window[_0x4dff35([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x4dff35([0x67,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x4d417a);return _0x58789e?window[_0x4dff35([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x47edcc(_0x58789e),0x10)*_0x2304d6:null;}function _0x2bd694(_0x243723){return new window[(_0x4dff35([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x55a3dc,_0x32e5c5)=>{_0x243723[_0x4dff35([0x74,0x68,0x65,0x6e])](_0x55a3dc,_0x32e5c5),window[_0x4dff35([0x73,0x65,0x74,0x54,0x69,0x6d,0x65,0x6f,0x75,0x74])](_0x32e5c5,0x3dfe1021^_0x51b5c4);});}}_0x4d2c08[_0x4dff35([0x6f,0x6e])](_0x4dff35([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),(_0x61fcf6,_0x233ce2)=>{if(_0x233ce2[0x0]!=_0x3b8cb7)return _0x27f365(_0x4dff35([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));_0x233ce2[0x1]={..._0x233ce2[0x1],[_0x4dff35([0x72,0x65,0x71,0x75,0x65,0x73,0x74,0x49,0x64])]:_0x1023f2};},{[_0x4dff35([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x4dff35([0x68,0x69,0x67,0x68])}),_0x4d2c08[_0x4dff35([0x6f,0x6e])](_0x4dff35([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),_0x49b178=>{_0x52df2e(_0x49b178[_0x4dff35([0x72,0x65,0x74,0x75,0x72,0x6e])])&&(_0x1f8c59=!0x0,_0x5197a6(_0x49b178[_0x4dff35([0x72,0x65,0x74,0x75,0x72,0x6e])]));},{[_0x4dff35([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x4dff35([0x6c,0x6f,0x77])}),_0x242f1a[_0x4dff35([0x74,0x68,0x65,0x6e])](()=>{_0x1f8c59||_0x27f365(_0x4dff35([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});});function _0x103fe8(){return _0x4d2c08[_0x4dff35([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x4dff35([0x76,0x69,0x65,0x77])][_0x4dff35([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]==_0x4dff35([0x61,0x75,0x74,0x6f]);}function _0x41d381(){_0x4d2c08[_0x4dff35([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x4dff35([0x76,0x69,0x65,0x77])][_0x4dff35([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]=_0x4dff35([0x61,0x75,0x74,0x6f]);}}function _0x4f1669(_0x4af0f1){const _0x43b235=[new window[(_0x4dff35([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x3330e0=>setTimeout(_0x3330e0,0x3df6fa2d^_0x51b5c4)),_0x242f1a[_0x4dff35([0x74,0x68,0x65,0x6e])](()=>new window[(_0x4dff35([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x3b27fa=>{let _0x3dc79b=0x0;_0x4d2c08[_0x4dff35([0x6d,0x6f,0x64,0x65,0x6c])][_0x4dff35([0x6f,0x6e])](_0x4dff35([0x61,0x70,0x70,0x6c,0x79,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e]),(_0x48c8bb,_0x34c33a)=>{_0x34c33a[0x0][_0x4dff35([0x69,0x73,0x44,0x6f,0x63,0x75,0x6d,0x65,0x6e,0x74,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e])]&&_0x3dc79b++,_0x3dc79b==(0x3dffc109^_0x51b5c4)&&(_0x3b27fa(),_0x48c8bb[_0x4dff35([0x6f,0x66,0x66])]());});}))];return window[_0x4dff35([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65])][_0x4dff35([0x72,0x61,0x63,0x65])](_0x43b235)[_0x4dff35([0x74,0x68,0x65,0x6e])](()=>_0x4af0f1);}async function _0x1cb707(){await _0x242f1a,_0x4d2c08[_0x4dff35([0x6d,0x6f,0x64,0x65,0x6c])][_0x4dff35([0x63,0x68,0x61,0x6e,0x67,0x65])]=_0x108418,_0x4d2c08[_0x4dff35([0x6d,0x6f,0x64,0x65,0x6c])][_0x4dff35([0x65,0x6e,0x71,0x75,0x65,0x75,0x65,0x43,0x68,0x61,0x6e,0x67,0x65])]=_0x108418,_0x4d2c08[_0x4dff35([0x65,0x6e,0x61,0x62,0x6c,0x65,0x52,0x65,0x61,0x64,0x4f,0x6e,0x6c,0x79,0x4d,0x6f,0x64,0x65])](_0x4dff35([0x6d,0x6f,0x64,0x65,0x6c]));}function _0xda49d5(_0x30401d){const _0x39db6b=_0x53efd2();_0x4d2c08[_0x39db6b]=_0x4dff35([0x61,0x69,0x4c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79])+_0x30401d,_0x30401d!=_0x4dff35([0x56,0x61,0x6c,0x69,0x64])&&_0x1cb707();}function _0x53efd2(){const _0x3cb100=window[_0x4dff35([0x53,0x74,0x72,0x69,0x6e,0x67])](window[_0x4dff35([0x70,0x65,0x72,0x66,0x6f,0x72,0x6d,0x61,0x6e,0x63,0x65])][_0x4dff35([0x6e,0x6f,0x77])]())[_0x4dff35([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](_0x4dff35([0x2e]),'');let _0x356a2f=_0x4dff35([0x6e]);for(let _0x5615d5=0x0;_0x5615d5<_0x3cb100[_0x4dff35([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x5615d5+=0x2){let _0x5be6c6=window[_0x4dff35([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x3cb100[_0x4dff35([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x5615d5,_0x5615d5+0x2));_0x5be6c6>=_0x4a8f0e[_0x4dff35([0x6c,0x65,0x6e,0x67,0x74,0x68])]&&(_0x5be6c6-=_0x4a8f0e[_0x4dff35([0x6c,0x65,0x6e,0x67,0x74,0x68])]),_0x356a2f+=_0x4a8f0e[_0x5be6c6];}return _0x356a2f;}function _0x2a9b1b(){const _0x38adcd=_0x232d99[_0x4dff35([0x73,0x70,0x6c,0x69,0x74])](_0x4dff35([0x2e]));if(0x3!=_0x38adcd[_0x4dff35([0x6c,0x65,0x6e,0x67,0x74,0x68])])return null;return _0x5d92e1(_0x38adcd[0x1]);function _0x5d92e1(_0x1504a2){const _0x24a573=_0x5171ff(_0x1504a2);return _0x24a573&&_0x290168()?_0x24a573:null;function _0x290168(){const _0x29b6af=_0x24a573[_0x4dff35([0x6a,0x74,0x69])],_0x422075=window[_0x4dff35([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x29b6af[_0x4dff35([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x29b6af[_0x4dff35([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8),0x10),_0x2df9f2={..._0x24a573,[_0x4dff35([0x6a,0x74,0x69])]:_0x29b6af[_0x4dff35([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](0x0,_0x29b6af[_0x4dff35([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8)};return delete _0x2df9f2[_0x4dff35([0x76,0x63])],_0x5c23f2(_0x2df9f2)==_0x422075;}}}async function _0x407ece(){let _0x32b360=!0x0;try{const _0x1a5be0=_0x232d99[_0x4dff35([0x73,0x70,0x6c,0x69,0x74])](_0x4dff35([0x2e])),[_0x3fec85,_0x579823,_0x20a4b0]=_0x1a5be0;return _0x5e4f94(_0x3fec85),await _0x4f9bbc(_0x3fec85,_0x579823,_0x20a4b0),_0x32b360;}catch{return!0x1;}function _0x5e4f94(_0x504d19){const _0x40ce10=_0x5171ff(_0x504d19);_0x40ce10&&_0x40ce10[_0x4dff35([0x61,0x6c,0x67])]==_0x4dff35([0x45,0x53,0x32,0x35,0x36])||(_0x32b360=!0x1);}async function _0x4f9bbc(_0x4b3e08,_0x4a2397,_0x36651f){const _0x1854d6=window[_0x4dff35([0x55,0x69,0x6e,0x74,0x38,0x41,0x72,0x72,0x61,0x79])][_0x4dff35([0x66,0x72,0x6f,0x6d])](_0x375b43(_0x36651f),_0xbcf6f1=>_0xbcf6f1[_0x4dff35([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](0x0)),_0x583eff=new window[(_0x4dff35([0x54,0x65,0x78,0x74,0x45,0x6e,0x63,0x6f,0x64,0x65,0x72]))]()[_0x4dff35([0x65,0x6e,0x63,0x6f,0x64,0x65])](_0x4b3e08+_0x4dff35([0x2e])+_0x4a2397),_0x2c57bc=window[_0x4dff35([0x63,0x72,0x79,0x70,0x74,0x6f])][_0x4dff35([0x73,0x75,0x62,0x74,0x6c,0x65])];if(!_0x2c57bc)return;const _0x5a61e4=await _0x2c57bc[_0x4dff35([0x69,0x6d,0x70,0x6f,0x72,0x74,0x4b,0x65,0x79])](_0x4dff35([0x6a,0x77,0x6b]),_0x51c3af,{[_0x4dff35([0x6e,0x61,0x6d,0x65])]:_0x4dff35([0x45,0x43,0x44,0x53,0x41]),[_0x4dff35([0x6e,0x61,0x6d,0x65,0x64,0x43,0x75,0x72,0x76,0x65])]:_0x4dff35([0x50,0x2d,0x32,0x35,0x36])},!0x1,[_0x4dff35([0x76,0x65,0x72,0x69,0x66,0x79])]);await _0x2c57bc[_0x4dff35([0x76,0x65,0x72,0x69,0x66,0x79])]({[_0x4dff35([0x6e,0x61,0x6d,0x65])]:_0x4dff35([0x45,0x43,0x44,0x53,0x41]),[_0x4dff35([0x68,0x61,0x73,0x68])]:{[_0x4dff35([0x6e,0x61,0x6d,0x65])]:_0x4dff35([0x53,0x48,0x41,0x2d,0x32,0x35,0x36])}},_0x5a61e4,_0x1854d6,_0x583eff)||(_0x32b360=!0x1);}}function _0x5171ff(_0xcc576e){return _0xcc576e[_0x4dff35([0x73,0x74,0x61,0x72,0x74,0x73,0x57,0x69,0x74,0x68])](_0x4dff35([0x65,0x79]))?JSON[_0x4dff35([0x70,0x61,0x72,0x73,0x65])](_0x375b43(_0xcc576e)):null;}function _0x375b43(_0x92b5c6){return window[_0x4dff35([0x61,0x74,0x6f,0x62])](_0x92b5c6[_0x4dff35([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/-/g,_0x4dff35([0x2b]))[_0x4dff35([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/_/g,_0x4dff35([0x2f])));}function _0x5c23f2(_0x406c3f){let _0x32a97d=0x1505;function _0x2bf04b(_0x503e9a){for(let _0x12573d=0x0;_0x12573d<_0x503e9a[_0x4dff35([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x12573d++){const _0x34b044=_0x503e9a[_0x4dff35([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](_0x12573d);_0x32a97d=(_0x32a97d<<0x5)+_0x32a97d+_0x34b044,_0x32a97d&=_0x32a97d;}}function _0x378707(_0x57b085){Array[_0x4dff35([0x69,0x73,0x41,0x72,0x72,0x61,0x79])](_0x57b085)?_0x57b085[_0x4dff35([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](_0x378707):_0x57b085&&typeof _0x57b085==_0x4dff35([0x6f,0x62,0x6a,0x65,0x63,0x74])?Object[_0x4dff35([0x65,0x6e,0x74,0x72,0x69,0x65,0x73])](_0x57b085)[_0x4dff35([0x73,0x6f,0x72,0x74])]()[_0x4dff35([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](([_0x48870c,_0x3d20cf])=>{_0x2bf04b(_0x48870c),_0x378707(_0x3d20cf);}):_0x2bf04b(window[_0x4dff35([0x53,0x74,0x72,0x69,0x6e,0x67])](_0x57b085));}return _0x378707(_0x406c3f),_0x32a97d>>>0x0;}function _0x59573a(_0x3bd00f){return _0x3bd00f[_0x4dff35([0x74,0x6f,0x53,0x74,0x72,0x69,0x6e,0x67])](0x10)[_0x4dff35([0x70,0x61,0x64,0x53,0x74,0x61,0x72,0x74])](0x8,_0x4dff35([0x30]));}function _0x47edcc(_0x12bc35){return _0x12bc35[_0x4dff35([0x73,0x70,0x6c,0x69,0x74])]('')[_0x4dff35([0x72,0x65,0x76,0x65,0x72,0x73,0x65])]()[_0x4dff35([0x6a,0x6f,0x69,0x6e])]('');}function _0x108418(){}function _0x4dff35(_0x56f7d5){return _0x56f7d5['map'](_0x14c4c5=>String['fromCharCode'](_0x14c4c5))['join']('');}_0xda49d5(await _0x30c844());}(this);}['showFakeVisualSelection'](){const _0x2d3df5=this['editor']['model'];_0x2d3df5['change'](_0x10d437=>{const _0x12c92a=_0x2d3df5['document']['selection']['getRanges']();let _0x2680a6=0x0;for(const _0x3dd47a of _0x12c92a){const _0x23c185=A+':'+_0x2680a6;if(_0x2d3df5['markers']['has'](_0x23c185))_0x10d437['updateMarker'](_0x23c185,{'range':_0x3dd47a});else{if(_0x3dd47a['start']['isAtEnd']){const _0x1dd374=_0x3dd47a['start']['getLastMatchingPosition'](({item:_0x1a85be})=>!_0x2d3df5['schema']['isContent'](_0x1a85be),{'boundaries':_0x3dd47a});_0x10d437['addMarker'](_0x23c185,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x10d437['createRange'](_0x1dd374,_0x3dd47a['end'])});}else _0x10d437['addMarker'](_0x23c185,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x3dd47a});}_0x2680a6++;}});}['hideFakeVisualSelection'](){const _0x1eed33=this['editor']['model'],_0x370065=Array['from'](this['editor']['model']['markers']['getMarkersGroup'](A));_0x370065['length']&&_0x1eed33['change'](_0x5f1bd3=>{_0x370065['forEach'](_0x30c7fb=>{_0x5f1bd3['removeMarker'](_0x30c7fb);});});}['insertContent'](_0x596008,_0x14f7fa){const _0x511181=this['_getAISelection'](),_0x2d37e4=_0x14f7fa||_0x511181['getFirstRange']();this['editor']['model']['canEditAt'](_0x2d37e4)&&this['editor']['model']['change'](_0x5b2b1c=>{this['hideFakeVisualSelection'](),_0x14f7fa||this['_resetContentOfSelectedTableCells'](_0x5b2b1c,_0x511181),this['_pasteHTMLUsingClipboard']({'insertAt':_0x2d37e4,'writer':_0x5b2b1c,'html':_0x596008});});}['insertContentBelow'](_0xb1891f){const {model:_0x5513f6}=this['editor'],_0x51b079=this['_getAISelection']();_0x5513f6['change'](()=>{const _0x2be0dc=this['_prepareTableInsertBelowPosition'](_0xb1891f,_0x51b079)||this['_getDefaultInsertBelowPosition'](_0x51b079);this['insertContent'](_0xb1891f,_0x2be0dc);});}['_getAISelection'](){const _0x459efb=this['editor']['model'],_0x476da4=Array['from'](_0x459efb['markers']['getMarkersGroup'](A))['map'](_0x56e993=>_0x56e993['getRange']());return _0x459efb['createSelection'](_0x476da4);}['_pasteHTMLUsingClipboard']({writer:_0x40440b,html:_0x3bed48,insertAt:_0xe28855}){const {view:_0x20b212}=this['editor']['editing'],_0x525430=this['editor']['plugins']['get'](_0x293bc2),_0x13d8c9=new Kn();_0x13d8c9['setData']('text/html',_0x3bed48);const _0x575be8=new ClipboardEvent('paste',{'clipboardData':_0x13d8c9}),_0x119c2a=new _0x1d6dc5(_0x20b212,_0x575be8,{'dataTransfer':new _0x3d063b(_0x13d8c9)});_0x40440b['setSelection'](_0xe28855);const _0x5ab8cb=(_0x121cc,_0x458e92)=>{_0x458e92['resultRange']&&_0x40440b['setSelection'](_0x458e92['resultRange']);};_0x525430['once']('contentInsertion',_0x5ab8cb,{'priority':'lowest'}),_0x20b212['document']['fire']('paste',_0x119c2a),_0x525430['off']('contentInsertion',_0x5ab8cb);}['_getDefaultInsertBelowPosition'](_0x17ba37){const {model:_0xa86bc2}=this['editor'],_0x14ce7e=Array['from'](_0x17ba37['getSelectedBlocks']());return _0x14ce7e['length']?_0xa86bc2['createPositionAfter'](_0x14ce7e['pop']()):_0x17ba37['getLastPosition']();}['_prepareTableInsertBelowPosition'](_0x486b54,_0x380912){const {model:_0x446122,plugins:_0x45f53a}=this['editor'];if(_0x45f53a['has']('TableUtils')){const _0x1bb44c=_0x45f53a['get']('TableUtils')['getSelectedTableCells'](_0x380912);if(_0x1bb44c['length']){const _0x4238fe=this['_getTableRowCountFromContent'](_0x486b54),_0x419edc=this['_createEmptyTableRows'](_0x1bb44c,_0x4238fe);return _0x446122['createPositionAt'](_0x419edc,0x0);}}return null;}['_getTableRowCountFromContent'](_0x58850f){const _0x4f28eb=this['editor']['plugins']['get']('TableUtils'),_0xcc4976=this['editor']['data']['parse'](_0x58850f),_0x220c84=Array['from'](_0xcc4976['getChildren']())['filter'](_0x3b8790=>_0x3b8790['is']('element','table'));let _0x417a6e=0x0;return _0x220c84['forEach'](_0x1ee85b=>{_0x417a6e+=_0x4f28eb['getRows'](_0x1ee85b);}),_0x417a6e;}['_createEmptyTableRows'](_0x3f261c,_0x14b3b5){const _0x1153cc=this['editor']['plugins']['get']('TableUtils'),_0x443a1c=_0x1153cc['getRowIndexes'](_0x3f261c),_0x3b9a71=_0x1153cc['getColumnIndexes'](_0x3f261c),_0x2dc2a7=_0x443a1c['last']+0x1,_0x49c1a4=_0x3b9a71['first'],_0x490feb=_0x3f261c[0x0]['findAncestor']('table');for(let _0x45afbb=0x0;_0x45afbb<_0x14b3b5;_0x45afbb++)_0x1153cc['insertRows'](_0x490feb,{'at':_0x2dc2a7});return _0x490feb['getChild'](_0x2dc2a7)['getChild'](_0x49c1a4);}['_resetContentOfSelectedTableCells'](_0x4b9738,_0x162ad9){const {plugins:_0x552eaf}=this['editor'],{model:_0x1893f2}=_0x4b9738;if(!_0x552eaf['has']('TableUtils'))return;_0x552eaf['get']('TableUtils')['getSelectedTableCells'](_0x162ad9)['length']&&_0x1893f2['deleteContent'](_0x162ad9);}}class $ extends _0x53f6d2{static get['pluginName'](){return'AIAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['afterInit'](){if(!this['textAdapter'])throw new _0x25c351('aiadapter-text-adapter-not-set',null);}}class er extends Error{constructor(_0x129770){super(_0x129770),this['name']='AIRequestError';}}function Wn(_0x255c0c,_0x588424,_0x4a51d1){const t=_0x255c0c['t'];switch(_0x588424){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',_0x4a51d1);case'Error\x20during\x20AI\x20content\x20generation:\x20%0':return t('Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x4a51d1);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'},_0x4a51d1);case'AI_ERROR_CONTEXT_LENGTH':return t({'id':'AI_ERROR_CONTEXT_LENGTH','string':'Selected\x20content\x20is\x20too\x20long'});case'AI_ERROR_MODERATION':return t({'id':'AI_ERROR_MODERATION','string':'Requested\x20query\x20does\x20not\x20pass\x20moderation\x20rules'});case'AI_ERROR_FAILED':return t({'id':'AI_ERROR_FAILED','string':'Failed\x20to\x20communicate\x20with\x20the\x20AI\x20service'});default:return _0x588424;}}class D extends Lt{['_commandDefinitions'];constructor(_0x5f5285,_0x411e66){super(_0x5f5285),this['_commandDefinitions']=_0x411e66,this['set']('enabledCommandsIds',[]),this['on']('change:_hasContext',(_0x330e19,_0x3ccc7f,_0x432e3b)=>{this['isEnabled']&&(this['enabledCommandsIds']=ns(this['_commandDefinitions'],_0x432e3b));}),this['set']('_hasContext',!0x1),this['on']('change:isEnabled',(_0x116605,_0x58bf81,_0x3636f1)=>{this['enabledCommandsIds']=_0x3636f1?ns(this['_commandDefinitions'],this['_hasContext']):[];});}['refresh'](){const _0x307c85=this['editor']['model'];this['_hasContext']=function(_0x395e8f){const _0x3319ca=_0x395e8f['document']['selection'];return _0x3319ca['isCollapsed']?0x0!==[..._0x3319ca['getSelectedBlocks']()]['length']&&![..._0x3319ca['getSelectedBlocks']()][0x0]['isEmpty']:!!_0x395e8f['hasContent'](_0x3319ca['getFirstRange']());}(_0x307c85);const _0x495e72=_0x307c85['document']['selection'],_0x565da2=this['editor']['config']['get']('ai.assistant.disabledElements');for(const _0x4ab921 of _0x495e72['getRanges']())for(const _0x47f4f6 of _0x4ab921['getItems']())if(_0x47f4f6['is']('element')&&_0x565da2['includes'](_0x47f4f6['name']))return void(this['isEnabled']=!0x1);this['isEnabled']=!0x0;}['execute'](_0x22ac2e='',_0x5c84f5='',_0x572f13='custom'){this['editor']['plugins']['get'](g)['showUI'](_0x22ac2e,_0x5c84f5,_0x572f13);}}function ns(_0x44a5af,_0x30732b){const _0x1e9fb4=new Set();for(const _0x4d982f of _0x44a5af['values']())(_0x30732b||!0x1===_0x4d982f['requiresContent'])&&_0x1e9fb4['add'](_0x4d982f['id']);return Array['from'](_0x1e9fb4);}const hs=new RegExp(/^(.*?)<[a-zA-Z][a-zA-Z0-9_\-.]*[ >]/,'is');class N extends/* #__PURE__ -- @preserve */
|
|
24
|
-
ts(){['editor'];['textAdapter'];['view'];['_sanitizationContainer'];['_domParser'];['_xmlSerializer'];constructor(_0x386a82,_0x3c6eda,_0x14b3dd){super(),this['editor']=_0x386a82,this['textAdapter']=_0x3c6eda,this['_sanitizationContainer']=document['createElement']('div'),this['_domParser']=new DOMParser(),this['_xmlSerializer']=new XMLSerializer(),this['view']=_0x14b3dd,this['set']({'initialContext':'','currentContext':'','currentResponse':'','previousContext':void 0x0,'previousQuery':void 0x0,'previousLabel':void 0x0,'isProcessing':!0x1}),this['on']('set:currentContext',(_0x4c77c0,_0x35f7b3,_0x4cdf6a)=>{this['view']['value']=this['_sanitizeHTML'](_0x4cdf6a);}),this['listenTo'](this['view'],'submitPrompt',(_0x58ee73,_0x2abd88)=>{const _0x2b38e2=this['currentContext']||this['initialContext'];this['_handleQuery'](_0x2abd88,_0x2b38e2,'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:_0x4aa6dc,query:_0x4cfe17,htmlContent:_0x1cd3b1,label:_0x567ae,mainActionLabel:_0x2c6018}){this['view']['prompt']=_0x567ae,this['view']['mainAction']=_0x2c6018,this['initialContext']=_0x1cd3b1,_0x4cfe17&&(this['view']['isRendered']?this['_handleQuery'](_0x4cfe17,_0x1cd3b1,_0x4aa6dc,_0x567ae):this['view']['once']('render',()=>{this['_handleQuery'](_0x4cfe17,_0x1cd3b1,_0x4aa6dc,_0x567ae);}));}['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'](_0x29e00f,_0x5c1514,_0x1fb68f,_0x3ca8dc){return this['isProcessing']=!0x0,this['view']['startProcessing'](),this['previousContext']=_0x5c1514,this['previousQuery']=_0x29e00f,this['previousLabel']=_0x3ca8dc||_0x29e00f,this['previousActionId']=_0x1fb68f,new Promise(_0x2de23c=>{this['textAdapter']['makeRequest']({'query':_0x29e00f,'context':_0x5c1514,'onData':_0x46f6e7=>{this['currentResponse']=_0x46f6e7,this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse']);},'actionId':_0x1fb68f})['then'](()=>{!this['currentContext']&&this['currentResponse']&&(this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse'],!0x0));})['catch'](_0x167040=>{_0x167040 instanceof er?this['view']['handleError'](_0x167040['message']):this['view']['handleError'](),_0x2de23c();})['finally'](()=>{this['stopProcessing'](),_0x2de23c();});});}['_parseAndNormalizeContent'](_0x218bf1,_0x542ada=!0x1){const _0x276f08=hs['exec'](_0x218bf1);_0x218bf1=_0x276f08?_0x218bf1['substring'](_0x276f08[0x1]['length']):_0x218bf1['length']<0x64&&!_0x542ada?'':this['_stripMarkdownSyntax'](_0x218bf1);const _0x1fabcc=this['_domParser']['parseFromString'](_0x218bf1,'text/html');if(_0x276f08){const _0x431fc7=Array['from'](_0x1fabcc['body']['childNodes']);_0x431fc7['reverse']();for(const _0x228181 of _0x431fc7){if(_0x228181['nodeType']==Node['ELEMENT_NODE'])break;_0x228181['remove']();}}const _0x1bac21=this['editor']['data']['processor']['toView'](this['_xmlSerializer']['serializeToString'](_0x1fabcc['body']));this['_isH1TagSupportEnabled']()||this['_normalizeResponseHeadings'](_0x1bac21);const _0x21331e=this['editor']['config']['get']('ai.assistant.preserveComments'),_0x22c1ff=this['editor']['data']['toModel'](_0x1bac21);return _0x21331e||_0x22c1ff['markers']['clear'](),this['editor']['data']['stringify'](_0x22c1ff);}['_normalizeResponseHeadings'](_0x207bd3){const _0x3b4820=new _0x3e9e59(this['editor']['editing']['view']['document']),_0x36f6c4=new _0x3839bf({'name':/^h[1-5]$/}),_0x12c2e5=[];let _0x8300ed=!0x1;for(const _0x639eac of _0x207bd3)_0x639eac['is']('element')&&_0x36f6c4['match'](_0x639eac)&&(_0x12c2e5['push'](_0x639eac),'h1'==_0x639eac['name']&&(_0x8300ed=!0x0));if(_0x8300ed){for(const _0x5189c3 of _0x12c2e5)_0x3b4820['rename']('h'+(parseInt(_0x5189c3['name'][0x1])+0x1),_0x5189c3);}}['_isH1TagSupportEnabled'](){const {data:_0x296784,editing:_0x3fa6bc}=this['editor'],_0x4413b8=_0x296784['htmlProcessor']['toView']('<h1></h1>'),_0x5c9f6f=_0x296784['toView'](_0x296784['toModel'](_0x4413b8));return!!_0x3fa6bc['view']['domConverter']['viewToDom'](_0x5c9f6f)['querySelector']('h1');}['_sanitizeHTML'](_0x321951){return this['editor']['editing']['view']['domConverter']['setContentOf'](this['_sanitizationContainer'],_0x321951),this['_sanitizationContainer']['innerHTML'];}['_stripMarkdownSyntax'](_0x429f75){const _0xe31999=_0x429f75['trim']();return _0xe31999['startsWith']('```html')?_0xe31999['endsWith']('```')?_0xe31999['substring'](0x7,_0xe31999['length']-0x3):_0xe31999['substring'](0x7):_0x429f75;}}const H={'REPLACE':'replace','INSERT':'insert'};class Pr extends _0x50bbb8{constructor(_0x4a0243){super(_0x4a0243),this['set']('isVisible',!0x1),this['set']('mainAction',H['REPLACE']),this['replaceButton']=this['_createButton']('','ck-button-action'),this['replaceButton']['bind']('label')['to'](this,'mainAction',_0xade139=>Wn(_0x4a0243,'AI_'+_0xade139['toUpperCase']()+'_CONTENT')),this['insertButton']=this['_createButton'](Wn(_0x4a0243,'Insert\x20below')),this['tryAgainButton']=this['_createButton'](Wn(_0x4a0243,'Try\x20again')),this['stopButton']=this['_createButton'](Wn(_0x4a0243,'Stop'));const _0x3c382d=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-form__toolbar',_0x3c382d['if']('isVisible','ck-hidden',_0x224116=>!_0x224116)]}}),this['items']['addMany']([this['replaceButton'],this['insertButton'],this['tryAgainButton'],this['stopButton']]);}['_createButton'](_0x583eb4,_0x4e7421){const _0x48878c=new _0x1d1b95(this['locale']);return _0x48878c['set']({'label':_0x583eb4,'class':_0x4e7421||'','isVisible':!0x0,'withText':!0x0}),_0x48878c;}}class Ir extends _0x1f054a{['contentFieldView'];['copyButtonView'];constructor(_0x4ea038,_0x229677=''){super(_0x4ea038),this['set']({'value':null,'isVisible':!0x1,'isProcessing':!0x1});const _0x56b9e0=this['bindTemplate'];this['contentFieldView']=new Yn(_0x4ea038,_0x229677),this['copyButtonView']=this['_createCopyButton'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area-wrapper',_0x56b9e0['if']('isVisible','ck-hidden',_0x33cc56=>!_0x33cc56)],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area',_0x56b9e0['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 _0x3952f2=!0x1;this['on']('change:value',(_0xc1742c,_0x57c85f,_0x4a7414)=>{const _0x7d8001=!this['contentFieldView']['element']['querySelector']('.ck-ai-form__loader');this['contentFieldView']['setContent'](_0x4a7414),this['isProcessing']&&_0x7d8001&&!_0x3952f2&&this['element']['scrollTo']({'top':this['element']['scrollHeight'],'behavior':'smooth'});}),this['on']('change:isProcessing',(_0x58afe2,_0x15d5f7,_0x21aa94)=>{_0x3952f2=!0x1,_0x21aa94?(this['value']=null,this['contentFieldView']['appendLoader']()):this['value']||this['contentFieldView']['setContent']('');}),this['listenTo'](this['element'],'wheel',()=>{_0x3952f2=!0x0;}),this['listenTo'](this['element'],'mousedown',()=>{_0x3952f2=!0x0;});}['focus'](){this['element']['focus']();}['_createCopyButton'](){const _0x1b30bb=this['locale'],_0x4eb9cf=new _0x1d1b95(this['locale']),_0x2d3c4b='ck-ai-form__copy-button';return _0x4eb9cf['set']({'label':Wn(_0x1b30bb,'Copy'),'icon':_0x1c808a,'class':_0x2d3c4b,'tooltip':!0x0}),_0x4eb9cf['bind']('isVisible')['to'](this,'value',_0xa2a356=>!!_0xa2a356),_0x4eb9cf['bind']('isEnabled')['to'](this,'isProcessing',_0x1dea2d=>!_0x1dea2d),_0x4eb9cf['on']('execute',()=>{this['_copyHTMLToClipboard'](this['contentFieldView']['element']),_0x4eb9cf['icon']=_0x386c9f,_0x4eb9cf['class']=_0x2d3c4b+'\x20ck-ai-form__copy-button--copied',this['focus'](),setTimeout(()=>{_0x4eb9cf['icon']=_0x1c808a,_0x4eb9cf['class']=_0x2d3c4b;},0x3e8);}),_0x4eb9cf;}['_copyHTMLToClipboard'](_0x5a1c76){const {window:_0x261551,document:_0x52576c}=_0x1385df;if(_0x261551['ClipboardItem']){const {Blob:_0x4e0ec9,ClipboardItem:_0x2f36a2}=_0x261551,_0x5215e8=[new _0x2f36a2({'text/html':new _0x4e0ec9([_0x5a1c76['innerHTML']],{'type':'text/html'}),'text/plain':new _0x4e0ec9([_0x5a1c76['textContent']||''],{'type':'text/plain'})})];navigator['clipboard']['write'](_0x5215e8);}else{const _0x47b689=_0x52576c['createElement']('div');_0x47b689['style']['position']='absolute',_0x47b689['style']['left']='-9999px',_0x47b689['innerHTML']='<span>[</span>'+_0x5a1c76['innerHTML']+'<span>]</span>',_0x52576c['body']['appendChild'](_0x47b689);const _0x1253d7=_0x52576c['createRange']();_0x1253d7['setStartAfter'](_0x47b689['firstElementChild']),_0x1253d7['setEndBefore'](_0x47b689['lastElementChild']);const _0x12801e=_0x261551['getSelection']();_0x12801e['removeAllRanges'](),_0x12801e['addRange'](_0x1253d7),_0x52576c['execCommand']('copy'),_0x47b689['remove']();}}}class Yn extends _0x1f054a{constructor(_0x33eecd,_0x5b4f03=''){super(_0x33eecd),this['loaderView']=this['_createLoader'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content',_0x5b4f03,'ck-reset_all-excluded','ck-ai-form__content-field']}});}['setContent'](_0x569817){this['element']['innerHTML']=_0x569817;}['appendLoader'](){this['element']['appendChild'](this['loaderView']['element']);}['_createLoader'](){const _0xa01d8c=new _0x1f054a(),_0x3b67a5=this['locale'],_0x230c41=new _0x17fe29();return _0x230c41['isVisible']=!0x0,_0xa01d8c['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__loader']},'children':[_0x230c41,{'text':Wn(_0x3b67a5,'AI\x20is\x20writing...')}]}),_0xa01d8c['render'](),_0xa01d8c;}}class Vr extends _0x1f054a{constructor(_0x3fbbf7,_0x378cf2=''){super(_0x3fbbf7);const _0x5ab4b0=new _0x152087(),_0x50fea4=this['bindTemplate'];this['set']('text',_0x378cf2),_0x5ab4b0['content']=_0x27052d,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__error']},'children':[_0x5ab4b0,{'text':_0x50fea4['to']('text')}]});}}class Cr extends _0x9be194{['submitButtonView'];['showHistoryButtonView'];constructor(_0xba567c,_0x1a32d2){super(_0xba567c,_0x1a32d2),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',(_0x4c3628,_0x931905)=>{_0x4c3628['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0x931905());});}['_createSubmitButton'](){const _0x264407=new _0x1d1b95(this['locale']),_0x161dee=this['locale'];return _0x264407['set']({'icon':_0x4d010f,'label':Wn(_0x161dee,'Submit'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-form__submit'}),_0x264407['on']('execute',()=>{this['submit']();}),_0x264407['bind']('isEnabled')['to'](this['queryView']['fieldView'],'isEmpty',this,'isEnabled',(_0x3b16cd,_0x338dae)=>!_0x3b16cd&&_0x338dae),_0x264407;}['_createShowHistoryButton'](){const _0xe69e58=new _0x1d1b95(this['locale']),_0x571bde=this['resultsView'],_0x5a567c=this['locale'];_0xe69e58['set']({'label':Wn(_0x5a567c,'History'),'withText':!0x1,'icon':Ht,'tooltip':!0x0,'tooltipPosition':'sw','class':'ck-ai-form__toggle-history'}),_0xe69e58['bind']('isOn')['to'](_0x571bde,'isVisible'),_0xe69e58['bind']('isEnabled')['to'](this,'isEnabled'),_0xe69e58['on']('execute',()=>{_0x571bde['isVisible']=!_0x571bde['isVisible'],_0x571bde['isVisible']?this['filteredView']['focus']():this['focus']();});const _0x2ccd04=()=>{_0x1385df['window']['requestAnimationFrame'](()=>{if(_0x3e9e44(this['element'])){const _0x304bd8=new _0x5002e3(this['queryView']['fieldView']['element']),_0x523643=_0x304bd8['width'],_0x21691a='rtl'===_0x5a567c['uiLanguageDirection']?'left':'right';_0x304bd8['excludeScrollbarsAndBorders'](),_0xe69e58['element']['style'][_0x21691a]=_0x523643-_0x304bd8['width']+0x1+'px';}});};return this['queryView']['fieldView']['on']('update',_0x2ccd04),this['on']('render',_0x2ccd04),_0xe69e58;}['submit'](){const _0xffd4f9=this['queryView']['fieldView']['element']['value'];this['fire']('submit',_0xffd4f9);}['focus'](_0x2270dd){-0x1===_0x2270dd?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}}class Hr extends _0xc6bdf6{['historyGroupView'];['clearHistoryButton'];constructor(_0x57d876){super(_0x57d876),this['clearHistoryButton']=this['_createClearHistoryButton'](),this['historyGroupView']=new _0x2b2d84(),this['historyGroupView']['children']['add'](this['clearHistoryButton'],0x1),this['historyGroupView']['label']=Wn(_0x57d876,'Prompt\x20history'),this['historyGroupView']['items']['delegate']('execute')['to'](this),this['items']['add'](this['historyGroupView']);}['filter'](){let _0x553c9a=0x0;for(const _0xda6e95 of this['items'])_0x553c9a+=_0xda6e95['items']['length'];return{'resultsCount':_0x553c9a,'totalItemsCount':_0x553c9a};}['_createClearHistoryButton'](){const _0x5cb440=this['locale'],_0x2b5cd2=new _0x1d1b95(this['locale']);return _0x2b5cd2['set']({'label':'('+Wn(_0x5cb440,'Clear')+')','withText':!0x0}),_0x2b5cd2['on']('execute',()=>this['fire']('clearHistory')),_0x2b5cd2;}}class Rr extends _0x2a0bb9{constructor(_0x1cc2ba){super();const _0x27a748=new _0x34171b(),_0x2d7fbd=new _0x1d1b95(this['locale'],_0x27a748);this['children']['add'](_0x2d7fbd),_0x2d7fbd['set']({'label':_0x1cc2ba['prompt'],'withText':!0x0}),_0x2d7fbd['on']('execute',()=>{this['fire']('execute',{'value':_0x419c4b(_0x1cc2ba['prompt'])});});}}const So='CKEditor/AIFormView/PromptHistory';class Br extends _0x405f09{constructor(){super(),this['_loadFromSessionStorage'](),this['on']('add',(_0x3a6e61,_0x47edfa)=>{const _0x96fef3=go(_0x47edfa['prompt']);for(const _0x4fb880 of this)if(_0x4fb880!=_0x47edfa&&go(_0x4fb880['prompt'])===_0x96fef3){this['remove'](_0x4fb880);break;}this['length']>0x14&&this['remove'](this['last']),this['_saveToSessionStorage']();}),this['on']('remove',()=>{this['_saveToSessionStorage']();});}['_loadFromSessionStorage'](){const _0x221f09=sessionStorage['getItem'](So)||'[]';this['addMany'](JSON['parse'](_0x221f09));}['_saveToSessionStorage'](){sessionStorage['setItem'](So,JSON['stringify'](this['map'](_0x3d790e=>_0x3d790e)));}}function go(_0x2ec383){return _0x2ec383['toLowerCase']()['trim']();}class P extends _0x1f054a{['focusTracker'];['keystrokes'];['contentArea'];['toolbar'];['promptView'];['errorView'];['_focusables'];['focusCycler'];['_promptHistory'];constructor(_0x1ba538,_0x2099b8,_0x4b9b03=''){super(_0x1ba538),this['set']('isEnabled',!0x0),this['set']('isProcessing',!0x1),this['set']('prompt',''),this['set']('value',''),this['set']('isError',!0x1),this['set']('mainAction',H['REPLACE']),this['_promptHistory']=new Br(),this['errorView']=new Vr(_0x1ba538),this['contentArea']=new Ir(_0x1ba538,_0x4b9b03),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 _0x50d771(),this['keystrokes']=new _0x407d91(),this['_focusables']=this['createCollection']([this['contentArea'],this['contentArea']['copyButtonView'],this['toolbar'],this['promptView']]),this['focusCycler']=new _0x18b3f0({'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 _0x175fe0=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form',_0x2099b8],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form-content']},'children':[{'tag':'div','attributes':{'class':[_0x175fe0['if']('isError','ck-hidden',_0xc15907=>!_0xc15907)]},'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'](_0x16d6a4=0x1){-0x1===_0x16d6a4?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 _0x1d5d38=this['locale'],_0x311729=new Cr(_0x1d5d38,{'queryView':{'label':Wn(_0x1d5d38,'Ask\x20AI\x20to\x20edit\x20or\x20generate'),'creator':_0x2dda8d,'showIcon':!0x1,'showResetButton':!0x1},'infoView':{'text':{'noSearchableItems':{'primary':Wn(_0x1d5d38,'Empty\x20history'),'secondary':Wn(_0x1d5d38,'Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.')}}},'filteredView':this['_createHistoryView'](),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1});return _0x311729['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x1dbd0d,_0x1b1e11)=>_0x1dbd0d&&!_0x1b1e11),this['listenTo'](_0x311729,'submit',(_0x27aed0,_0x546f29)=>{this['prompt']=_0x546f29;const _0x50f24e=_0x4ae586(_0x546f29);this['fire']('submitPrompt',_0x50f24e),_0x546f29['trim']()&&this['_promptHistory']['add']({'prompt':_0x50f24e},0x0);},{'priority':'high'}),_0x311729;}['_createHistoryView'](){const _0x3c6af2=new Hr(this['locale']);return _0x3c6af2['historyGroupView']['items']['bindTo'](this['_promptHistory'])['as'](Rr),_0x3c6af2['on']('clearHistory',()=>{this['_promptHistory']['clear'](),this['promptView']['search'](''),this['promptView']['focus']();}),_0x3c6af2;}['_createToolbar'](){const _0x517b06=new Pr(this['locale']);return _0x517b06['replaceButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x4641a7,_0x409094,_0x567b52)=>_0x4641a7&&!_0x409094&&!!_0x567b52),_0x517b06['replaceButton']['delegate']('execute')['to'](this,'replaceContent'),_0x517b06['insertButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x365995,_0x375b45,_0x573780)=>_0x365995&&!_0x375b45&&!!_0x573780),_0x517b06['insertButton']['delegate']('execute')['to'](this,'insertContentBelow'),_0x517b06['tryAgainButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x1511be,_0x34b6f9)=>_0x1511be&&!_0x34b6f9),_0x517b06['tryAgainButton']['delegate']('execute')['to'](this,'tryAgainEvent'),_0x517b06['stopButton']['bind']('isEnabled')['to'](this,'isProcessing'),_0x517b06['stopButton']['delegate']('execute')['to'](this,'stopProcessing'),_0x517b06;}['startProcessing'](){this['value']='',this['isError']=!0x1,this['isProcessing']=!0x0,this['contentArea']['isVisible']=!0x0,this['toolbar']['isVisible']=!0x0,this['contentArea']['focus']();}['finishProcessing'](){const _0x5ca0c5=this['locale'];this['isProcessing']=!0x1,this['prompt']='',this['promptView']['reset'](),this['value']&&(this['promptView']['queryView']['label']=Wn(_0x5ca0c5,'Ask\x20AI\x20to\x20improve\x20generated\x20text'));}['handleError'](_0x15282d){const _0x2ac650=this['locale'];this['finishProcessing'](),this['isError']=!0x0,this['errorView']['text']=_0x15282d||Wn(_0x2ac650,'AI_ERROR_FAILED'),this['value']||(this['contentArea']['isVisible']=!0x1);}}const k=globalThis['DataTransfer'];class g extends _0x53f6d2{['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[_0x36cf6,d,$,_0x2dc660];}constructor(_0x2757a3){super(_0x2757a3),_0x2757a3['config']['define']('ai.assistant.disabledElements',['media','rawHtml','tableOfContents']),_0x2757a3['config']['define']('ai.assistant.contentAreaCssClass',''),_0x2757a3['config']['define']('ai.assistant.useTheme',!0x0),this['_uiCssClasses']='ck-ai-assistant-ui'+(_0x2757a3['config']['get']('ai.assistant.useTheme')?'\x20ck-ai-assistant-ui_theme':'');}['init'](){const {editor:_0x5978b1}=this;this['_aiAdapter']=_0x5978b1['plugins']['get']($),this['_dialog']=_0x5978b1['plugins']['get'](_0x2dc660),this['_formView']=null,this['_commandDefinitions']=this['_getResolvedCommandsDefinitions']();const _0x3183b2=new D(_0x5978b1,Array['from'](this['_commandDefinitions']['values']()));_0x5978b1['commands']['add']('showAIAssistant',_0x3183b2),_0x5978b1['ui']['componentFactory']['add']('aiCommands',_0x27497e=>{const _0x28342c=_0x290605(_0x27497e);return _0x28342c['set']({'class':'ck-ai-commands-dropdown\x20'+this['_uiCssClasses']}),_0x28342c['buttonView']['set']({'label':Wn(_0x27497e,'AI\x20Commands'),'icon':_0x5a8842,'tooltip':!0x0}),_0x28342c['on']('execute',_0x4609c2=>this['_onExecute'](_0x4609c2['source']['id'])),_0x51e2e4(_0x28342c,_0x5978b1['ui']['view']['body'],function(_0x3e470e){const _0xb772c6=f(_0x3e470e['config']['get']('ai.assistant.commands'),_0x3e470e['locale']),_0xbb535f=G(_0x3e470e,_0xb772c6)['filter'](_0x3287a8=>_0x3287a8['commands']['length']);if(0x1===_0xbb535f['length'])return G(_0x3e470e,_0xbb535f[0x0]['commands'])['map'](_0x2a0808=>({'id':_0x2a0808['id'],'label':_0x2a0808['label']}));return _0xbb535f['map'](_0x4c939f=>{const {groupId:_0x20819f,groupLabel:_0x2739d0,commands:_0x27a0f5}=_0x4c939f,_0x50ecbb=G(_0x3e470e,_0x27a0f5)['map'](_0x47ace8=>({'id':_0x47ace8['id'],'label':_0x47ace8['label']}));return{'id':_0x20819f,'menu':_0x2739d0||_0x20819f,'children':_0x50ecbb};});}(_0x5978b1),{'ariaLabel':Wn(_0x27497e,'AI\x20Commands')}),_0x28342c['menuView']['menuPanelClass']='ck-ai-commands-dropdown\x20'+this['_uiCssClasses'],_0x3183b2['on']('change:enabledCommandsIds',_0x3683ef),_0x28342c['menuView']['once']('render',_0x3683ef),_0x28342c;function _0x3683ef(){_0x28342c['isEnabled']=_0x3183b2['enabledCommandsIds']['length']>0x0;for(const _0x1f80dc of _0x28342c['menuView']['buttons'])_0x1f80dc['isEnabled']=_0x3183b2['enabledCommandsIds']['includes'](_0x1f80dc['id']);}}),_0x5978b1['ui']['componentFactory']['add']('menuBar:aiCommands',_0x4aeb38=>{const _0x11bdfa=new _0x36bad0(_0x4aeb38);_0x11bdfa['buttonView']['set']({'label':Wn(_0x4aeb38,'AI\x20Commands'),'icon':_0x5a8842}),_0x11bdfa['bind']('isEnabled')['to'](_0x3183b2,'enabledCommandsIds',_0x57a970=>_0x57a970['length']>0x0);const _0x372dd6=f(_0x5978b1['config']['get']('ai.assistant.commands'),_0x4aeb38);return this['_populateMenuBarMenu'](_0x3183b2,_0x11bdfa,_0x372dd6,_0x4d30f3=>this['_onExecute'](_0x4d30f3)),_0x11bdfa;}),_0x5978b1['ui']['componentFactory']['add']('aiAssistant',()=>{const _0x36fd34=this['_createAIAssistantUIButton'](_0x1d1b95);return _0x36fd34['set']({'tooltip':!0x0,'class':'ck-ai-assistant-button\x20'+this['_uiCssClasses']}),_0x36fd34;}),_0x5978b1['ui']['componentFactory']['add']('menuBar:aiAssistant',()=>{const _0x138afb=this['_createAIAssistantUIButton'](_0x229d28);return _0x138afb['set']({'role':'menuitemcheckbox'}),_0x138afb;}),this['licenseKey']=this['editor']['config']['get']('licenseKey');const _0x338f95=this['editor'];this['_licenseKeyCheckInterval']=setInterval(()=>{let _0xafcf44;for(const _0x155753 in _0x338f95){const _0x53cc21=_0x155753,_0x469750=_0x338f95[_0x53cc21];if('aiLicenseKeyValid'==_0x469750||'aiLicenseKeyInvalid'==_0x469750||'aiLicenseKeyExpired'==_0x469750||'aiLicenseKeyDomainLimit'==_0x469750||'aiLicenseKeyNotAllowed'==_0x469750||'aiLicenseKeyEvaluationLimit'==_0x469750||'aiLicenseKeyUsageLimit'==_0x469750){delete _0x338f95[_0x53cc21],_0xafcf44=_0x469750,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'aiLicenseKeyInvalid'==_0xafcf44&&_0x338f95['_showLicenseError']('invalid'),'aiLicenseKeyExpired'==_0xafcf44&&_0x338f95['_showLicenseError']('expired'),'aiLicenseKeyDomainLimit'==_0xafcf44&&_0x338f95['_showLicenseError']('domainLimit'),'aiLicenseKeyNotAllowed'==_0xafcf44&&_0x338f95['_showLicenseError']('featureNotAllowed','AIAssistant'),'aiLicenseKeyEvaluationLimit'==_0xafcf44&&_0x338f95['_showLicenseError']('evaluationLimit'),'aiLicenseKeyUsageLimit'==_0xafcf44&&_0x338f95['_showLicenseError']('usageLimit');},0x3e8);}['destroy'](){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}['showUI'](_0x1ff097='',_0x118658='',_0x7fc26b='custom'){const _0x461544=this['editor'],_0x3b774a=_0x461544['editing']['view'],_0x105c3f=_0x461544['plugins']['get'](d),_0x276e30=_0x461544['plugins']['get'](_0x36cf6);_0x105c3f['showFakeVisualSelection']();const _0x31dfe3=new k(),_0x3587f7=new ClipboardEvent('copy',{'clipboardData':_0x31dfe3}),_0x442394=new _0x3d063b(_0x31dfe3),_0x1121be=new _0x1d6dc5(_0x3b774a,_0x3587f7,{'dataTransfer':_0x442394});_0x276e30['_forceMarkersCopy']('comment',()=>{_0x3b774a['document']['fire']('copy',_0x1121be);}),this['_formView']||(this['_initView'](),this['_aiAssistantController']=new N(_0x461544,this['_aiAdapter']['textAdapter'],this['_formView']));let _0x5b59d8=_0x442394['getData']('text/html');const _0x5ef09c=_0x461544['model']['document']['selection'],_0x2bcc4b=Array['from'](_0x5ef09c['getRanges']());0x1===_0x2bcc4b['length']&&_0x2bcc4b[0x0]['isFlat']&&!_0x5ef09c['getSelectedElement']()&&''!==_0x5b59d8['replace'](/ /g,'')['trim']()&&(_0x5b59d8='<p>'+_0x5b59d8+'</p>'),this['_aiAssistantController']['updateView']({'actionId':_0x7fc26b,'query':_0x1ff097,'htmlContent':_0x5b59d8,'label':_0x118658,'mainActionLabel':H[_0x461544['model']['document']['selection']['isCollapsed']?'INSERT':'REPLACE']}),'aiAssistant'!==this['_dialog']['id']?this['_dialog']['show']({'id':'aiAssistant','icon':_0x22be60,'title':Wn(this['editor']['locale'],'AI\x20Assistant'),'content':this['_formView'],'position':_0x22ba1a['EDITOR_TOP_SIDE'],'onShow':()=>{this['_formView']['focus']();},'onHide':()=>{this['_aiAssistantController']['reset'](),_0x105c3f['hideFakeVisualSelection']();}}):this['_dialog']['view']['wasMoved']||this['_dialog']['view']['updatePosition']();}['hideUI'](){this['_dialog']['hide']();}['_getResolvedCommandsDefinitions'](){const _0x459672=new Map(),_0x3b099e=f(this['editor']['config']['get']('ai.assistant.commands'),this['editor']['locale']);for(const _0x28681e of _0x3b099e)for(const _0x2a510f of _0x28681e['commands'])_0x459672['set'](_0x2a510f['id'],{..._0x2a510f,'groupId':_0x28681e['groupId'],'groupLabel':_0x28681e['groupLabel']||_0x28681e['groupId']});return _0x459672;}['_createAIAssistantUIButton'](_0x3747d8){const _0x7f3768=this['editor'],_0x5460de=_0x7f3768['commands']['get']('showAIAssistant'),_0x2ebe5c=new _0x3747d8(_0x7f3768['locale']);return _0x2ebe5c['set']({'label':Wn(_0x7f3768['locale'],'AI\x20Assistant'),'icon':_0x22be60,'isToggleable':!0x0}),_0x2ebe5c['bind']('isEnabled')['to'](_0x5460de),_0x2ebe5c['bind']('isOn')['to'](this['_dialog'],'id',_0x5c98e1=>'aiAssistant'===_0x5c98e1),this['listenTo'](_0x2ebe5c,'execute',()=>{_0x2ebe5c['isOn']?this['hideUI']():_0x5460de['execute']();}),_0x2ebe5c;}['_initView'](){const _0x3e8feb=this['editor']['plugins']['get'](d);this['_formView']=new P(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',()=>{_0x3e8feb['insertContent'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['listenTo'](this['_formView'],'insertContentBelow',()=>{_0x3e8feb['insertContentBelow'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['_initAriaAiStatusChangeAnnouncements']();}['_initAriaAiStatusChangeAnnouncements'](){const {locale:_0x37063c,ui:{ariaLiveAnnouncer:_0x57d00b}}=this['editor'];this['_formView']['contentArea']['on']('change:isProcessing',(_0x5bb915,_0x5b74ae,_0x482407)=>{const _0x96f591=this['_aiAssistantController']['currentContext'];_0x482407?_0x57d00b['announce'](Wn(_0x37063c,'AI\x20is\x20writing')):_0x96f591&&_0x57d00b['announce'](Wn(_0x37063c,'Generated\x20content:\x20%0',_0x96f591),{'politeness':'polite','isUnsafeHTML':!0x0});}),this['_formView']['on']('change:isError',(_0x15eee0,_0x440dd8,_0x57d247)=>{if(_0x57d247){const _0x1559af=this['_formView']['errorView']['text'];_0x57d00b['announce'](Wn(_0x37063c,'Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x1559af));}});}['_onExecute'](_0x393e5a){const _0x5809a9=this['_commandDefinitions']['get'](_0x393e5a),_0x49738c=this['editor'],_0xa1f46d=_0x49738c['model']['document']['selection'],_0x2b235f=_0x49738c['commands']['get']('showAIAssistant'),_0x16ef8d=_0x49738c['plugins']['get'](d),_0x17d869=''+(_0x5809a9['groupId']!==V?_0x5809a9['groupLabel']+':\x20':'')+_0x5809a9['label'];if(!0x1!==_0x5809a9['requiresContent']&&_0xa1f46d['isCollapsed']){const _0x22b7e9=_0x22aa77(_0xa1f46d['getSelectedBlocks']())||_0x49738c['model']['schema']['getLimitElement'](_0xa1f46d);_0x49738c['model']['change'](_0x11ba05=>{_0x11ba05['setSelection'](_0x22b7e9,'in');});}_0x16ef8d['showFakeVisualSelection'](),_0x2b235f['execute'](_0x5809a9['prompt'],_0x17d869,'command:'+_0x393e5a);}['_populateMenuBarMenu'](_0x1ffd98,_0x1c654d,_0x468ad9,_0x55c341){const _0x3d5d7b=this['editor'],_0x263551=_0x3d5d7b['locale'],_0x489027=new _0x1388e9(_0x263551),_0x457be6=G(_0x3d5d7b,_0x468ad9)['filter'](_0x5caabc=>_0x5caabc['commands']['length']);0x1===_0x457be6['length']?this['_getMenuBarGroupButtons']({'command':_0x1ffd98,'commands':_0x457be6[0x0]['commands'],'parentMenuView':_0x1c654d,'onExecute':_0x55c341})['forEach'](_0x59733c=>_0x489027['items']['add'](_0x59733c)):_0x457be6['forEach'](({groupId:_0x185aa9,groupLabel:_0x2ca877,commands:_0x987f91})=>{const _0x1e0efa=new _0x134620(_0x263551,_0x1c654d),_0x2a15d8=new _0x36bad0(_0x263551),_0xb90eb5=new _0x1388e9(_0x263551),_0x33c37f=this['_getMenuBarGroupButtons']({'command':_0x1ffd98,'commands':_0x987f91,'parentMenuView':_0x2a15d8,'onExecute':_0x55c341});_0x2a15d8['buttonView']['set']({'label':_0x2ca877||_0x185aa9}),_0x2a15d8['delegate']('execute')['to'](_0x1c654d),_0xb90eb5['items']['addMany'](_0x33c37f),_0x2a15d8['panelView']['children']['add'](_0xb90eb5),_0x1e0efa['children']['add'](_0x2a15d8),_0x489027['items']['add'](_0x1e0efa);}),_0x1c654d['panelView']['children']['add'](_0x489027);}['_getMenuBarGroupButtons']({command:_0x388c2a,commands:_0x1ec3ea,parentMenuView:_0x3cd484,onExecute:_0xa41b6d}){const _0x54b270=this['editor'],_0x2e6895=_0x54b270['locale'];return G(_0x54b270,_0x1ec3ea)['map'](_0x27fd00=>{const _0xd4e562=new _0x134620(_0x2e6895,_0x3cd484),_0x375bba=new _0x229d28(_0x2e6895);return _0x375bba['set']({'label':_0x27fd00['label']}),_0x375bba['delegate']('execute')['to'](_0x3cd484),_0x375bba['on']('execute',()=>_0xa41b6d(_0x27fd00['id'])),_0x375bba['bind']('isEnabled')['to'](_0x388c2a,'enabledCommandsIds',_0x4dad85=>_0x4dad85['includes'](_0x27fd00['id'])),_0xd4e562['children']['add'](_0x375bba),_0xd4e562;});}}function q(_0x1d0eee,_0x218b42){return void 0x0!==_0x1d0eee['order']&&void 0x0===_0x218b42['order']?0x1:void 0x0===_0x1d0eee['order']&&void 0x0!==_0x218b42['order']?-0x1:void 0x0!==_0x1d0eee['order']&&void 0x0!==_0x218b42['order']?_0x1d0eee['order']-_0x218b42['order']:0x0;}function G(_0x138053,_0x104abc){_0x104abc['sort'](q);const _0x50e70b={},_0x1903d7=[];for(const _0x4f48c0 of _0x104abc)if(void 0x0!==_0x4f48c0['order']){if(_0x4f48c0['order']in _0x50e70b)throw new _0x25c351('ai-commands-config-order-collision',_0x138053,{'conflictingDefinitions':[_0x4f48c0,_0x50e70b[_0x4f48c0['order']]]});_0x50e70b[_0x4f48c0['order']]=_0x4f48c0,_0x1903d7['splice'](_0x4f48c0['order'],0x0,_0x4f48c0);}else _0x1903d7['push'](_0x4f48c0);return _0x1903d7;}class $n extends _0x53f6d2{static get['requires'](){return[g,d];}static get['pluginName'](){return'AIAssistant';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x29a4ae){super(_0x29a4ae);const _0x51e5ea=_0x29a4ae['config'],_0x24ea81=_0x29a4ae['locale'];_0x51e5ea['define']('ai.assistant.preserveComments',!0x0),_0x51e5ea['define']('ai.assistant.commands',qn(_0x24ea81)),_0x51e5ea['define']('ai.assistant.extraCommandGroups',[]),_0x51e5ea['define']('ai.assistant.removeCommands',[]);let _0x45d853=f(_0x51e5ea['get']('ai.assistant.commands'),_0x24ea81);const _0x26acfe=_0x51e5ea['get']('ai.assistant.extraCommandGroups'),_0x5840e2=_0x51e5ea['get']('ai.assistant.removeCommands');_0x26acfe['forEach'](_0x10931c=>{const _0x591d5c=_0x45d853['find'](_0x4683b1=>_0x4683b1['groupId']===_0x10931c['groupId']);_0x591d5c?_0x591d5c['commands']=_0x591d5c['commands']['concat'](_0x10931c['commands']):_0x45d853['push'](_0x10931c);}),_0x45d853=_0x45d853['filter'](_0x19d4e1=>!_0x5840e2['includes'](_0x19d4e1['groupId'])),_0x45d853['forEach'](_0x408815=>{_0x408815['commands']=_0x408815['commands']['filter'](_0x4bffed=>!_0x5840e2['includes'](_0x4bffed['id']));}),_0x51e5ea['set']('ai.assistant.commands',_0x45d853);}}function qn(_0x470269){return[{'groupId':'editOrReview','groupLabel':Wn(_0x470269,'Edit\x20or\x20review'),'commands':[{'id':'improveWriting','label':Wn(_0x470269,'Improve\x20writing'),'prompt':'Fix\x20spelling\x20mistakes,\x20use\x20proper\x20grammar\x20and\x20apply\x20good\x20writing\x20practices.\x20Do\x20not\x20lose\x20the\x20original\x20meaning.'},{'id':'makeShorter','label':Wn(_0x470269,'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':Wn(_0x470269,'Make\x20longer'),'prompt':'Improve\x20this\x20content\x20by\x20using\x20descriptive\x20language\x20and\x20inserting\x20more\x20information\x20and\x20more\x20detailed\x20explanations.'},{'id':'simplifyLanguage','label':Wn(_0x470269,'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':Wn(_0x470269,'Generate\x20from\x20selection'),'commands':[{'id':'summarize','label':Wn(_0x470269,'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':Wn(_0x470269,'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':Wn(_0x470269,'Change\x20tone'),'commands':[{'id':'professional','label':Wn(_0x470269,'Professional'),'prompt':'Improve\x20using\x20polished,\x20formal,\x20and\x20respectful\x20language\x20to\x20convey\x20professional\x20expertise\x20and\x20competence.'},{'id':'casual','label':Wn(_0x470269,'Casual'),'prompt':'Improve\x20using\x20casual,\x20informal\x20language\x20to\x20convey\x20a\x20casual\x20conversation\x20with\x20a\x20real\x20person.'},{'id':'direct','label':Wn(_0x470269,'Direct'),'prompt':'Improve\x20using\x20direct\x20language,\x20using\x20only\x20the\x20essential\x20information.'},{'id':'confident','label':Wn(_0x470269,'Confident'),'prompt':'Improve\x20using\x20compelling,\x20optimistic\x20language\x20to\x20convey\x20confidence\x20in\x20the\x20writing.'},{'id':'friendly','label':Wn(_0x470269,'Friendly'),'prompt':'Improve\x20using\x20friendly,\x20comforting\x20language,\x20to\x20convey\x20understanding\x20and\x20empathy.'}]},{'groupId':'changeStyle','groupLabel':Wn(_0x470269,'Change\x20style'),'commands':[{'id':'business','label':Wn(_0x470269,'Business'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20business\x20professional\x20with\x20formal\x20language.'},{'id':'legal','label':Wn(_0x470269,'Legal'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20legal\x20professional\x20using\x20valid\x20legal\x20terminology.'},{'id':'journalism','label':Wn(_0x470269,'Journalism'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20journalist\x20using\x20engaging\x20language\x20to\x20convey\x20the\x20importance\x20of\x20the\x20information.'},{'id':'poetic','label':Wn(_0x470269,'Poetic'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20poem\x20using\x20poetic\x20techniques\x20without\x20losing\x20the\x20original\x20meaning.'}]},{'groupId':'translate','groupLabel':Wn(_0x470269,'Translate'),'commands':[{'id':'translateEnglish','label':Wn(_0x470269,'English'),'prompt':'Translate\x20the\x20content\x20to\x20English\x20language.'},{'id':'translateSpanish','label':Wn(_0x470269,'Spanish'),'prompt':'Translate\x20the\x20content\x20to\x20Spanish\x20language.'},{'id':'translatePortuguese','label':Wn(_0x470269,'Portuguese'),'prompt':'Translate\x20the\x20content\x20to\x20Portuguese\x20language.'},{'id':'translateGerman','label':Wn(_0x470269,'German'),'prompt':'Translate\x20the\x20content\x20to\x20German\x20language.'},{'id':'translateFrench','label':Wn(_0x470269,'French'),'prompt':'Translate\x20the\x20content\x20to\x20French\x20language.'},{'id':'translateChinese','label':Wn(_0x470269,'Simplified\x20Chinese'),'prompt':'Translate\x20the\x20content\x20to\x20Simplified\x20Chinese\x20language.'},{'id':'translateHindi','label':Wn(_0x470269,'Hindi'),'prompt':'Translate\x20the\x20content\x20to\x20Hindi\x20language.'},{'id':'translateArabic','label':Wn(_0x470269,'Arabic'),'prompt':'Translate\x20the\x20content\x20to\x20Arabic\x20language.'}]}];}class ye extends _0x53f6d2{['abortController'];static get['requires'](){return[$];}constructor(_0x533a20){super(_0x533a20),this['abortController']=new AbortController();}['init'](){this['editor']['plugins']['get']($)['textAdapter']=this;}['abort'](){this['abortController']['signal']['aborted']||(this['abortController']['abort'](),this['abortController']=new AbortController());}async['makeRequest'](_0x4c8c6d){return this['sendRequest'](_0x4c8c6d)['catch'](_0x48905c=>{if(_0x48905c instanceof er)return Promise['reject'](_0x48905c);if('AbortError'==_0x48905c['name'])return Promise['resolve']();throw console['error'](_0x48905c),new _0x25c351('aitextadapter-send-request-failed',null);});}async['_prepareRequestHeaders'](_0x3d1608,_0x29ba2d){const _0x5d725f=this['editor']['locale'],_0x3960d0={'Content-Type':'application/json'};if('object'==typeof _0x3d1608)Object['assign'](_0x3960d0,_0x3d1608);else{if(_0x3d1608)try{const _0x139835=await _0x3d1608(_0x29ba2d);Object['assign'](_0x3960d0,_0x139835);}catch{return Promise['reject'](new er(Wn(_0x5d725f,'AI_ERROR_GET_HEADERS')));}}return _0x3960d0;}async['_prepareRequestParameters'](_0x13e7a7,_0x3531a0){const _0x13cc82=this['editor']['locale'];if('object'==typeof _0x13e7a7)return _0x13e7a7;try{return await _0x13e7a7(_0x3531a0);}catch{return Promise['reject'](new er(Wn(_0x13cc82,'AI_ERROR_GET_PARAMETERS')));}}}class Qn extends ye{['_apiUrl'];['_requestHeaders'];['_requestParameters'];static get['pluginName'](){return'OpenAITextAdapter';}constructor(_0x113e9b){super(_0x113e9b),_0x113e9b['config']['define']('ai.assistant.adapter.openAI.apiUrl','https://api.openai.com/v1/chat/completions'),_0x113e9b['config']['get']('ai.assistant.adapter.openAI.requestParameters')||_0x113e9b['config']['define']('ai.assistant.adapter.openAI.requestParameters',{'model':'gpt-4o','temperature':0x1,'top_p':0x1,'stream':!0x0}),this['_apiUrl']=_0x113e9b['config']['get']('ai.assistant.adapter.openAI.apiUrl'),this['_requestHeaders']=_0x113e9b['config']['get']('ai.assistant.adapter.openAI.requestHeaders')||{},this['_requestParameters']=_0x113e9b['config']['get']('ai.assistant.adapter.openAI.requestParameters');}async['sendRequest']({query:_0x43051b,context:_0x579425,onData:_0x48584b,actionId:_0x5517e2}){const _0x2d3cc8=this['editor']['locale'],_0x38bfa9=await this['prepareMessages'](_0x43051b,_0x579425,_0x5517e2),_0x47f0af=await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x5517e2),_0xb1e29a=await this['_prepareRequestParameters'](this['_requestParameters'],_0x5517e2),_0x5dcac7={'messages':_0x38bfa9,..._0xb1e29a},_0x2fd6b5={'method':'POST','headers':_0x47f0af,'body':JSON['stringify'](_0x5dcac7),'signal':this['abortController']['signal']},_0x100db3=await fetch(this['_apiUrl'],_0x2fd6b5);if(_0x100db3['ok'])return _0xb1e29a['stream']?await this['_readStreamableResponse'](_0x100db3,_0x48584b):await this['_readStaticResponse'](_0x100db3,_0x48584b),Promise['resolve']();{const _0x416092=await _0x100db3['text']();return _0x416092['includes']('context_length_exceeded')?Promise['reject'](new er(Wn(_0x2d3cc8,'AI_ERROR_CONTEXT_LENGTH'))):_0x416092['includes']('Moderation')?Promise['reject'](new er(Wn(_0x2d3cc8,'AI_ERROR_MODERATION'))):Promise['reject'](new Error(_0x416092));}}async['prepareMessages'](_0x5f0667,_0x3f5786,_0x4a32f8){let _0x48c0f0,_0x5ec8bc;return _0x3f5786?(_0x48c0f0='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.',_0x5ec8bc='Instruction:\x0a'+_0x5f0667+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x3f5786):(_0x48c0f0='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.',_0x5ec8bc=_0x5f0667),[{'role':'system','content':_0x48c0f0},{'role':'user','content':_0x5ec8bc}];}async['_readStreamableResponse'](_0x59fb90,_0x7ec06c){const _0x2a0c3c=_0x59fb90['body']['getReader'](),_0x3916f7=new TextDecoder();let _0x103690='',_0x361023='',_0x27b56c='',_0x4d7b49=!0x1;for(;!_0x4d7b49;){const {done:_0x210620,value:_0x379128}=await _0x2a0c3c['read'](),_0x5cbe11=_0x103690+_0x3916f7['decode'](_0x379128);let _0x23164b='';_0x4d7b49=_0x210620;try{_0x23164b=this['_cleanUpData'](_0x5cbe11),_0x103690='';}catch{_0x103690=_0x5cbe11;continue;}_0x361023+=_0x23164b,!_0x4d7b49&&this['_isBufferIncomplete'](_0x361023)||_0x361023&&(_0x27b56c+=_0x361023,_0x361023='',_0x7ec06c(_0x27b56c));}return Promise['resolve']();}async['_readStaticResponse'](_0x43a54a,_0xc6a82d){return _0xc6a82d((await _0x43a54a['json']())['choices'][0x0]['message']['content']),Promise['resolve']();}['_isBufferIncomplete'](_0x326010){const _0x54b2e5=_0x326010['split']('<')['length']!==_0x326010['split']('>')['length'],_0x2eba58=_0x326010['length']<0x1e;return _0x54b2e5&&_0x2eba58;}['_cleanUpData'](_0x4938ac){return _0x4938ac['split'](/\n(?![^{]*\})/g)['map'](_0x4ad448=>_0x4ad448['replace']('data:\x20',''))['filter'](_0x3a8132=>_0x3a8132&&_0x3a8132['length']>0x0&&'[DONE]'!==_0x3a8132)['map'](_0x2f7777=>{const {choices:_0x535a70}=JSON['parse'](_0x2f7777);if(_0x535a70[0x0]?.['delta']?.['content'])return _0x535a70[0x0]['delta']['content'];})['filter'](_0x41f0c7=>_0x41f0c7)['join']('');}}class Xn extends ye{['_apiUrl'];['_requestHeaders'];['_bedrockClientConfig'];['_requestParameters'];static get['pluginName'](){return'AWSTextAdapter';}constructor(_0x30c07d){super(_0x30c07d),_0x30c07d['config']['get']('ai.assistant.adapter.aws.requestParameters')||_0x30c07d['config']['define']('ai.assistant.adapter.aws.requestParameters',{'model':'anthropic.claude-v2','max_tokens_to_sample':0x7d0,'temperature':0x1,'top_p':0x1,'top_k':0xfa,'anthropic_version':'bedrock-2023-05-31','stream':!0x0}),this['_apiUrl']=_0x30c07d['config']['get']('ai.assistant.adapter.aws.apiUrl'),this['_bedrockClientConfig']=_0x30c07d['config']['get']('ai.assistant.adapter.aws.bedrockClientConfig'),this['_requestHeaders']=_0x30c07d['config']['get']('ai.assistant.adapter.aws.requestHeaders'),this['_requestParameters']=_0x30c07d['config']['get']('ai.assistant.adapter.aws.requestParameters');}async['sendRequest']({query:_0x4371d9,context:_0x5c33e5,onData:_0x518b65,actionId:_0x172248}){const {model:_0x49dcfa,stream:_0x1f6c54,..._0xec3a24}=await this['_prepareRequestParameters'](this['_requestParameters'],_0x172248),_0x1f6ab9={'prompt':await this['preparePrompt'](_0x4371d9,_0x5c33e5,_0x49dcfa,_0x172248),..._0xec3a24};this['_apiUrl']?await this['_processProxyRequest'](_0x1f6ab9,_0x49dcfa,_0x1f6c54,_0x518b65,_0x172248):await this['_processAWSRequest'](_0x1f6ab9,_0x49dcfa,_0x1f6c54,_0x518b65);}async['preparePrompt'](_0x463ac4,_0x3e95dd,_0x64b7e3,_0x827936){let _0x2d324a,_0x2c9107;return _0x3e95dd?(_0x2d324a='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.',_0x2c9107='Instruction:\x0a'+_0x463ac4+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x3e95dd):(_0x2d324a='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.',_0x2c9107=_0x463ac4),'meta.llama'==this['getModelFamily'](_0x64b7e3)?'<<SYS>>\x0a'+_0x2d324a+'\x0a<</SYS>>\x0a[INST]\x0a'+_0x2c9107+'\x0a[/INST]':'Human:\x0a'+_0x2d324a+'\x0a'+_0x2c9107+'\x0a\x0aAssistant:';}['getModelFamily'](_0x48a128){if(/^anthropic\.claude/['test'](_0x48a128))return'anthropic.claude';if(/^ai21\.j2/['test'](_0x48a128))return'ai21.j2';if(/^cohere\.command/['test'](_0x48a128))return'cohere.command';if(/^meta\.llama/['test'](_0x48a128))return'meta.llama';throw new er(Wn(this['editor']['locale'],'AI_ERROR_UNSUPPORTED_MODEL',_0x48a128));}async['_processProxyRequest'](_0x46b708,_0x214676,_0x208213,_0x195316,_0x506faa){const _0xbf8e50={'method':'POST','headers':await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x506faa),'body':JSON['stringify']({..._0x46b708,'model':_0x214676,'stream':_0x208213}),'signal':this['abortController']['signal']},_0x23e890=await fetch(this['_apiUrl'],_0xbf8e50);_0x208213?await this['_readStreamableResponse'](_0x23e890,_0x214676,_0x195316):await this['_readStaticResponse'](_0x23e890,_0x214676,_0x195316);}async['_processAWSRequest'](_0x58f810,_0x22fa61,_0xe6dfb9,_0xe642d8){const _0x46f538=new _0x251854(this['_bedrockClientConfig']),_0x1f3e1b={'body':JSON['stringify'](_0x58f810),'contentType':'application/json','accept':'application/json','modelId':_0x22fa61};let _0x5ad226;if(_0xe6dfb9){const _0x560cec=new _0x62fa9(_0x1f3e1b);_0x5ad226=await _0x46f538['send'](_0x560cec,{'abortSignal':this['abortController']['signal']}),await this['_readAsyncIterableResponse'](_0x5ad226,_0x22fa61,_0xe642d8);}else{const _0x4e44e0=new _0x43fbb4(_0x1f3e1b);_0x5ad226=await _0x46f538['send'](_0x4e44e0,{'abortSignal':this['abortController']['signal']}),await this['_readStaticResponse'](_0x5ad226,_0x22fa61,_0xe642d8);}}async['_readAsyncIterableResponse'](_0x33fc8b,_0x4157f6,_0x589952){const _0x33a98e=_0x33fc8b['body'],_0x2c5495=new TextDecoder('utf-8');let _0x21fef1='';for await(const _0x14dc00 of _0x33a98e)if(_0x14dc00['chunk']){const _0x2ae1fa=_0x2c5495['decode'](_0x14dc00['chunk']['bytes']),_0x4867a2=JSON['parse'](_0x2ae1fa);_0x21fef1+=this['_getGeneratedText'](_0x4867a2,_0x4157f6),_0x589952(_0x21fef1);}return Promise['resolve']();}async['_readStreamableResponse'](_0x5ef8cb,_0x13ce87,_0x570a7f){const _0x53ad34=_0x5ef8cb['body'],_0x4e466d=new TextDecoder('utf-8'),_0x11fe8e=_0x53ad34['getReader']();let _0x509f2b='',_0x116f41='',_0x270a1b=!0x1;for(;!_0x270a1b;){const {done:_0x1e4bb8,value:_0x6f28b7}=await _0x11fe8e['read']();if(_0x270a1b=_0x1e4bb8,_0x270a1b)break;const _0x330a15=(_0x509f2b+_0x4e466d['decode'](_0x6f28b7))['split']('\x0a')['map'](_0x5cd764=>{try{return _0x509f2b='',JSON['parse'](_0x5cd764);}catch{return _0x509f2b=_0x5cd764,null;}})['filter'](_0x5271ce=>null!==_0x5271ce);_0x330a15['length']&&(_0x116f41+=_0x330a15['map'](_0x143eaf=>this['_getGeneratedText'](_0x143eaf,_0x13ce87))['join'](''),_0x570a7f(_0x116f41));}return Promise['resolve']();}async['_readStaticResponse'](_0x1abdb5,_0x34a7f1,_0x5bc730){let _0x4c8fa2;return _0x4c8fa2=_0x1abdb5 instanceof Response?await _0x1abdb5['json']():JSON['parse'](new TextDecoder('utf-8')['decode'](_0x1abdb5['body'])),(_0x5bc730(this['_getGeneratedText'](_0x4c8fa2,_0x34a7f1)),Promise['resolve']());}['_getGeneratedText'](_0x37002b,_0x66e1f0){switch(this['getModelFamily'](_0x66e1f0)){case'anthropic.claude':return _0x37002b['completion'];case'ai21.j2':return _0x37002b['completions'][0x0]['data']['text'];case'cohere.command':return _0x37002b['generations'][0x0]['text'];case'meta.llama':return _0x37002b['generation'];}}}class ia extends _0x1d1b95{constructor(_0x313f64,_0x184712={}){super(_0x313f64),this['isToggleable']=!0x0,this['set']('side',_0x184712['side']||'top');const _0x16435b=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-tab-button',..._0x5453e9(_0x184712['class']||[]),_0x16435b['to']('side',_0x25e38c=>'ck-tab-button_'+_0x25e38c),_0x16435b['to']('class')]}});}['show'](){this['set']('isVisible',!0x0);}['hide'](){this['set']('isVisible',!0x1);}}class ea extends _0x1f054a{['children'];constructor(_0x455f66,_0x435b3c={}){super(_0x455f66);const _0x2dc611=this['bindTemplate'];this['set']('isVisible',!0x1),this['set']('class',''),this['children']=this['createCollection'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck-tab-panel',..._0x5453e9(_0x435b3c['class']||[]),_0x2dc611['to']('class'),_0x2dc611['if']('isVisible','ck-hidden',_0xb79a73=>!_0xb79a73)]},'children':this['children']});}['show'](){this['set']('isVisible',!0x0);}['hide'](){this['set']('isVisible',!0x1);}}class ss extends _0x1f054a{['buttonViews']=this['createCollection']();['panelViews']=this['createCollection']();['_tabs']=new Map();constructor(_0x2463c0,_0x532c30={}){super(_0x2463c0),this['set']('class',void 0x0),this['set']('activeTab',null),this['set']('side',_0x532c30['side']||'top'),this['set']('isMaximized',!0x1);const _0x2d3f29=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset','ck-tabs',..._0x5453e9(_0x532c30['class']||[]),_0x2d3f29['to']('side',_0x8deb32=>'ck-tabs_'+_0x8deb32),_0x2d3f29['to']('class'),_0x2d3f29['to']('isMaximized',_0x5dee31=>_0x5dee31?'ck-ai-tabs_maximized':'')],'tabindex':'0'},'children':[{'tag':'div','attributes':{'class':['ck','ck-tabs__buttons-container',_0x2d3f29['to']('side',_0x367cf3=>'ck-tabs__buttons-container_'+_0x367cf3)]},'children':this['buttonViews']},{'tag':'div','attributes':{'class':['ck','ck-tabs__panels-container',_0x2d3f29['to']('side',_0x46974f=>'ck-tabs__panels-container_'+_0x46974f)]},'children':this['panelViews']},..._0x5453e9(_0x532c30['children']||[])]});}['getTabIds'](){return[...this['_tabs']['keys']()];}['getTab'](_0x1132ad){const _0x47024f=this['_tabs']['get'](_0x1132ad);return _0x47024f||null;}['addTab'](_0x339fab){const _0x1689c5=this['_setupButton']({'id':_0x339fab['id'],'label':_0x339fab['buttonLabel'],'icon':_0x339fab['buttonIcon'],'order':_0x339fab['order']}),_0x2e6c11=new ea(this['locale']);return _0x2e6c11['render'](),_0x339fab['content']&&_0x2e6c11['children']['add'](_0x339fab['content']),this['panelViews']['add'](_0x2e6c11),this['_tabs']['set'](_0x339fab['id'],{'button':_0x1689c5,'panel':_0x2e6c11,'order':void 0x0!==_0x339fab['order']?_0x339fab['order']:null}),this['fire']('addTab:'+_0x339fab['id'],{'id':_0x339fab['id'],'button':_0x1689c5,'panel':_0x2e6c11}),null===this['activeTab']?this['activateTab'](_0x339fab['id']):this['_hidePanel'](_0x339fab['id']),{'button':_0x1689c5,'panel':_0x2e6c11};}['activateTab'](_0x100472){if(null!==_0x100472&&!this['getTab'](_0x100472))throw new _0x25c351('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0x100472});this['activeTab']!==_0x100472&&(this['activeTab']&&this['_hidePanel'](this['activeTab']),this['activeTab']=_0x100472,_0x100472&&this['_showPanel'](_0x100472),this['fire']('activateTab:'+_0x100472,_0x100472));}['showTab'](_0x5815a4){if(!this['getTab'](_0x5815a4))throw new _0x25c351('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0x5815a4});this['_showPanel'](_0x5815a4),this['_showButton'](_0x5815a4),this['fire']('show:'+_0x5815a4,_0x5815a4);}['hideTab'](_0x77b13c){if(!this['getTab'](_0x77b13c))throw new _0x25c351('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0x77b13c});const _0x34d22c=this['activeTab'];this['_hidePanel'](_0x77b13c),this['_hideButton'](_0x77b13c);const _0x5f068b=this['getTabIds']();_0x34d22c===_0x77b13c&&_0x5f068b['length']>0x1&&this['activateTab'](_0x5f068b['find'](_0x593e87=>_0x593e87!==_0x77b13c)),this['fire']('hide:'+_0x77b13c,_0x77b13c);}['_getPanel'](_0x4d381a){const _0x4b2c14=this['_tabs']['get'](_0x4d381a);return _0x4b2c14?_0x4b2c14['panel']:null;}['_showPanel'](_0x2aab56){null!==this['activeTab']&&this['activeTab']!==_0x2aab56||this['_getPanel'](_0x2aab56)['show']();}['_hidePanel'](_0x52e285){const _0x2413bc=this['_getPanel'](_0x52e285);_0x2413bc['isVisible']&&(this['activeTab']===_0x52e285&&(this['activeTab']=null),_0x2413bc['hide']());}['_getButton'](_0x3bfc93){const _0x4b5502=this['_tabs']['get'](_0x3bfc93);return _0x4b5502?_0x4b5502['button']:null;}['_showButton'](_0x3db3eb){this['_getButton'](_0x3db3eb)['show']();}['_hideButton'](_0xe2c901){this['_getButton'](_0xe2c901)['hide']();}['_setupButton'](_0x30dc1d){const _0x2ddceb=new ia(this['locale'],{'side':this['side']}),_0xdc418c=this['buttonViews'];if(_0x2ddceb['set']({'label':_0x30dc1d['label'],'icon':_0x30dc1d['icon'],'tooltip':!0x0,'withText':!0x0}),_0x2ddceb['bind']('isOn')['to'](this,'activeTab',_0x5c905a=>_0x5c905a===_0x30dc1d['id']),_0x2ddceb['bind']('side')['to'](this,'side'),_0x30dc1d['order']){const _0x12c06a=[...this['_tabs']]['reduce']((_0x1c5a40,_0x17517e)=>{const _0x133a1e=_0x17517e[0x0],{order:_0x17ddf1}=_0x17517e[0x1];return!_0x17ddf1||_0x17ddf1>_0x30dc1d['order']?_0x1c5a40:_0x17ddf1>=_0x1c5a40['order']?{'id':_0x133a1e,'order':_0x17ddf1}:_0x1c5a40;},{'id':'','order':0x0}),_0x5cb823=_0xdc418c['getIndex'](this['_getButton'](_0x12c06a['id']));_0xdc418c['add'](_0x2ddceb,_0x5cb823+0x1);}else _0xdc418c['add'](_0x2ddceb);return _0x2ddceb['on']('execute',()=>{this['activateTab'](_0x30dc1d['id']);}),_0x2ddceb;}}const ni=['overlay','sidebar','custom'],oi=['left','right'];class hi extends ss{constructor(_0xa25e2f,_0x588476={}){super(_0xa25e2f,_0x588476),this['set']('type',_0x588476['type']||'sidebar'),this['set']('side',_0x588476['side']||'right'),this['set']('isVisible',_0x588476['visibleByDefault']??!0x0);const _0x11ed6a=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-tabs',_0x11ed6a['if']('type','ck-ai-tabs__overlay',_0x575fd9=>'overlay'===_0x575fd9),_0x11ed6a['if']('type','ck-ai-tabs__sidebar',_0x1af938=>'sidebar'===_0x1af938),_0x11ed6a['if']('isVisible','ck-hidden',_0x3168d8=>!_0x3168d8)]}}),this['buttonViews']['on']('add',(_0x219a1d,_0x40c377)=>{_0x40c377['set']('withText',!0x1);});}}class it extends _0x5dcf5b{['view'];['container']=null;['showResizeButton']=!0x0;static get['pluginName'](){return'AITabs';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x77f7ff){super(_0x77f7ff);const _0x3c288b=this['context']['config']['get']('ai.container');if(this['set']('side','right'),!_0x3c288b)throw new _0x25c351('ai-tabs-configuration-not-found');if(void 0x0!==_0x3c288b['showResizeButton']&&(this['showResizeButton']=_0x3c288b['showResizeButton']),'sidebar'!==_0x3c288b['type']&&'overlay'!==_0x3c288b['type']||_0x3c288b['side']&&(this['side']=_0x3c288b['side']),'sidebar'===_0x3c288b['type']){if(this['container']=_0x3c288b['element'],this['set']('type','sidebar'),!this['container'])throw new _0x25c351('ai-tabs-sidebar-container-element-not-found');}else'overlay'===_0x3c288b['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===_0x3c288b['visibleByDefault']||_0x3c288b['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 _0x39b2a6&&this['context']['ui']['focusTracker']['add'](this['view']['element']);}['switchType'](_0x5dff08){if(_0x5dff08&&this['type']!==_0x5dff08){if(!ni['includes'](_0x5dff08))throw new _0x25c351('ai-tabs-unsupported-ui-type');this['type']=_0x5dff08;}}['switchSide'](_0x415fb0){if(_0x415fb0&&this['side']!==_0x415fb0){if(!oi['includes'](_0x415fb0))throw new _0x25c351('ai-tabs-unsupported-ui-side');this['side']=_0x415fb0;}}['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 _0x5dcf5b{['_apiUrl'];['_token'];['_decoder'];static get['requires'](){return['CloudServices'];}static get['pluginName'](){return'AIConnector';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x4b3708){super(_0x4b3708),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 _0x4f1a33=this['context']['plugins']['get']('CloudServices');if(!_0x4f1a33['token'])throw new _0x25c351('ai-missing-token',this);this['_token']=_0x4f1a33['token'];}['startConversation'](_0x11cbaf,_0x864ea){const _0xe9c216=this['_sendApiRequest']('/conversations','POST',{'id':_0x11cbaf,'group':_0x864ea});return{'getConversation':async()=>(await _0xe9c216['request'])['json'](),'abortController':_0xe9c216['abortController']};}['queryAssistant']({message:_0x5725a5,conversationId:_0x36c1aa,parts:_0x21b452,capabilities:_0x4cd695,model:_0x2052c7,attributes:_0x9b87e6}){const _0x346929={'prompt':_0x5725a5,'content':_0x21b452,'model':_0x2052c7,..._0x4cd695&&{'capabilities':_0x4cd695},..._0x9b87e6&&{'attributes':_0x9b87e6}},_0x47099d=this['_sendApiRequest']('/conversations/'+_0x36c1aa+'/messages','POST',_0x346929);return{'getStream':async()=>{const _0x279cfa=(await _0x47099d['request'])['body'];return this['_getStreamReader'](_0x279cfa);},'abortController':_0x47099d['abortController']};}['executeCustomAction']({content:_0x468a85,message:_0x26983c,model:_0x427ac2,outputFormat:_0x35fa37}){const _0x2697a5={'content':[{'type':'text','content':_0x468a85}],'prompt':_0x26983c,'model':_0x427ac2,'outputFormat':_0x35fa37},_0x3faf7c=this['_sendApiRequest']('/actions/custom/calls','POST',_0x2697a5);return{'getStream':async()=>{const _0x21534e=(await _0x3faf7c['request'])['body'];return this['_getStreamReader'](_0x21534e);},'abortController':_0x3faf7c['abortController']};}['executeAction']({actionName:_0x2568ca,content:_0x570766,args:_0x14085c}){const _0x193158={'content':[{'type':'text','content':_0x570766}],'args':_0x14085c},_0x26704c=this['_sendApiRequest']('/actions/system/'+_0x2568ca+'/calls','POST',_0x193158);return{'getStream':async()=>{const _0x3edac2=(await _0x26704c['request'])['body'];return this['_getStreamReader'](_0x3edac2);},'abortController':_0x26704c['abortController']};}['uploadFile'](_0x4f2e93,_0x17d1ec,_0x40867d){const _0x19e52b=new FormData();_0x19e52b['append']('file',_0x17d1ec,_0x17d1ec['name']),_0x40867d&&_0x19e52b['append']('attributes',JSON['stringify'](_0x40867d));const _0x325223=this['_sendApiRequest']('/conversations/'+_0x4f2e93+'/files','POST',_0x19e52b);return{'getId':async()=>(await _0x325223['request'])['json'](),'abortController':_0x325223['abortController']};}['fetchDocument'](_0x4c9839,_0x305a12){const _0x57fdf0=this['_sendApiRequest']('/conversations/'+_0x4c9839+'/documents/'+_0x305a12,'GET');return{'getDocument':async()=>(await _0x57fdf0['request'])['json'](),'abortController':_0x57fdf0['abortController']};}['uploadDocument'](_0x414836,_0x1d327d,_0x11610a){const _0x4d869c={'content':_0x1d327d};_0x11610a&&(_0x4d869c['attributes']=_0x11610a);const _0x501a31=this['_sendApiRequest']('/conversations/'+_0x414836+'/documents','POST',_0x4d869c);return{'getId':async()=>(await _0x501a31['request'])['json'](),'abortController':_0x501a31['abortController']};}['fetchConversations'](_0x382923,_0x4bc395={}){const _0x7ebd8f=new URLSearchParams();_0x7ebd8f['append']('group',_0x382923),_0x7ebd8f['append']('excludeEmpty',!0x1!==_0x4bc395['excludeEmpty']?'true':'false'),_0x7ebd8f['append']('limit',_0x4bc395['limit']?_0x4bc395['limit']['toString']():'100'),_0x7ebd8f['append']('sortBy',_0x4bc395['sortBy']?_0x4bc395['sortBy']:'createdAt'),_0x7ebd8f['append']('order',_0x4bc395['order']?_0x4bc395['order']:'desc');const _0x50d5e3=this['_sendApiRequest']('/conversations?'+_0x7ebd8f['toString'](),'GET');return{'getConversations':async()=>{const _0x2fdd68=await _0x50d5e3['request'];return(await _0x2fdd68['json']())['items'];},'abortController':_0x50d5e3['abortController']};}['deleteConversation'](_0x5ea35d){const _0x43e840=this['_sendApiRequest']('/conversations/'+_0x5ea35d,'DELETE');return{'execute':async()=>{await _0x43e840['request'];},'abortController':_0x43e840['abortController']};}['updateConversation'](_0xfebc04,_0x5d2fe1){const _0x2d92c9=this['_sendApiRequest']('/conversations/'+_0xfebc04,'PATCH',_0x5d2fe1);return{'getResult':async()=>(await _0x2d92c9['request'],_0x5d2fe1),'abortController':_0x2d92c9['abortController']};}['fetchConversation'](_0x5d84a1){const _0x2778a1=this['_sendApiRequest']('/conversations/'+_0x5d84a1,'GET');return{'getConversation':async()=>(await _0x2778a1['request'])['json'](),'abortController':_0x2778a1['abortController']};}['fetchConversationMessages'](_0x561ae9){const _0x54fa1f=this['_sendApiRequest']('/conversations/'+_0x561ae9+'/messages','GET');return{'getMessages':async()=>{const _0x3a8553=await _0x54fa1f['request'];return(await _0x3a8553['json']())['items'];},'abortController':_0x54fa1f['abortController']};}['uploadUrl'](_0x2c04d3,_0x82a8c8,_0x56b9b9){const _0x125c14=this['_sendApiRequest']('/conversations/'+_0x2c04d3+'/web-resources','POST',{'url':_0x82a8c8,'attributes':_0x56b9b9});return{'getId':async()=>(await _0x125c14['request'])['json'](),'abortController':_0x125c14['abortController']};}['getModels'](_0x4d2a54='en'){const _0x130c6e=new URLSearchParams();_0x130c6e['append']('language',_0x4d2a54);const _0x4ed64d='/models/1?'+_0x130c6e['toString'](),_0x42408e=this['_sendApiRequest'](_0x4ed64d,'GET');return{'list':async()=>await(await _0x42408e['request'])['json'](),'abortController':_0x42408e['abortController']};}['deleteFile'](_0x1e572c,_0x4a4570){const _0x55e331=this['_sendApiRequest']('/conversations/'+_0x1e572c+'/files/'+_0x4a4570,'DELETE');return{'execute':async()=>{await _0x55e331['request'];},'abortController':_0x55e331['abortController']};}['deleteDocument'](_0x30e020,_0x1a6e1c){const _0x4e244a=this['_sendApiRequest']('/conversations/'+_0x30e020+'/documents/'+_0x1a6e1c,'DELETE');return{'execute':async()=>{await _0x4e244a['request'];},'abortController':_0x4e244a['abortController']};}['deleteWebResource'](_0x22952c,_0x28a3d){const _0x4ddb63=this['_sendApiRequest']('/conversations/'+_0x22952c+'/web-resources/'+_0x28a3d,'DELETE');return{'execute':async()=>{await _0x4ddb63['request'];},'abortController':_0x4ddb63['abortController']};}['callSystemReview']({reviewName:_0xe9a3df,content:_0x3a403b,args:_0x193261}){const _0x2639d6=this['_sendApiRequest']('/reviews/system/'+_0xe9a3df+'/calls','POST',{'content':[{'type':'text','content':_0x3a403b}],'args':_0x193261});return{'getStream':async()=>{const _0xd4430c=(await _0x2639d6['request'])['body'];return this['_getStreamReader'](_0xd4430c);},'abortController':_0x2639d6['abortController']};}['callCustomReview']({content:_0x3fc8a7,prompt:_0x506ae8,model:_0x2d9d22}){const _0x431f27=this['_sendApiRequest']('/reviews/custom/calls','POST',{'content':[{'type':'text','content':_0x3fc8a7}],'prompt':_0x506ae8,'model':_0x2d9d22});return{'getStream':async()=>{const _0x5b286a=(await _0x431f27['request'])['body'];return this['_getStreamReader'](_0x5b286a);},'abortController':_0x431f27['abortController']};}['upsertAIChatRating'](_0x1a0d2d,_0x49f690,_0x5d07f2){const _0x5be8c8=this['_sendApiRequest']('/conversations/'+_0x1a0d2d+'/messages/'+_0x49f690+'/ratings','PUT',{'positiveCount':_0x5d07f2['positiveCount'],'totalCount':_0x5d07f2['totalCount'],'modificationId':_0x5d07f2['modificationId']});return{'execute':async()=>{await _0x5be8c8['request'];},'abortController':_0x5be8c8['abortController']};}['upsertAIActionRating'](_0x5a5a82,_0x49cd64,_0x44ba4d){const _0x3cc655=this['_sendApiRequest']('/actions/system/'+_0x5a5a82+'/calls/'+_0x49cd64+'/ratings','PUT',{'positiveCount':_0x44ba4d['positiveCount'],'totalCount':_0x44ba4d['totalCount']});return{'execute':async()=>{await _0x3cc655['request'];},'abortController':_0x3cc655['abortController']};}['upsertCustomAIActionRating'](_0x2fdb2e,_0x2d7adc){const _0x42e00a=this['_sendApiRequest']('/actions/custom/calls/'+_0x2fdb2e+'/ratings','PUT',{'positiveCount':_0x2d7adc['positiveCount'],'totalCount':_0x2d7adc['totalCount']});return{'execute':async()=>{await _0x42e00a['request'];},'abortController':_0x42e00a['abortController']};}['upsertAIReviewRating'](_0x5e19ba,_0x54b6e0,_0x2e4c50,_0x473f14){const _0x32c17d=this['_sendApiRequest']('/reviews/system/'+_0x5e19ba+'/calls/'+_0x54b6e0+'/ratings','PUT',{'positiveCount':_0x2e4c50['positiveCount'],'totalCount':_0x2e4c50['totalCount'],'dataId':_0x473f14});return{'execute':async()=>{await _0x32c17d['request'];},'abortController':_0x32c17d['abortController']};}['upsertCustomAIReviewRating'](_0x33b7dc,_0x279efa,_0x31ae5b){const _0x4fde50=this['_sendApiRequest']('/reviews/custom/calls/'+_0x33b7dc+'/ratings','PUT',{'positiveCount':_0x279efa['positiveCount'],'totalCount':_0x279efa['totalCount'],'dataId':_0x31ae5b});return{'execute':async()=>{await _0x4fde50['request'];},'abortController':_0x4fde50['abortController']};}['_sendApiRequest'](_0x35b77e,_0x469678,_0x5601fa){const _0x35c460=new AbortController(),_0x5f3907=_0x5601fa instanceof FormData,_0x4b9584={'Authorization':'Bearer\x20'+this['_token']?.['value']};_0x5601fa&&!_0x5f3907&&(_0x4b9584['Content-Type']='application/json');const _0x21e9a4={'method':_0x469678,'headers':_0x4b9584,'signal':_0x35c460['signal']};return _0x5601fa&&(_0x21e9a4['body']=_0x5f3907?_0x5601fa:JSON['stringify'](_0x5601fa)),{'request':fetch(''+this['_apiUrl']+_0x35b77e,_0x21e9a4)['catch'](_0x5d5199=>{this['_handleError'](_0x5d5199);})['then'](_0x2138c2=>_0x2138c2['ok']?_0x2138c2:_0x2138c2['json']()['then'](_0x3e6f2e=>{throw{'url':this['_apiUrl'],'path':_0x35b77e,'method':_0x469678,'body':_0x5601fa,'status':(_0x2138c2||{})['status'],'statusText':(_0x2138c2||{})['statusText'],'code':_0x3e6f2e['code'],'message':_0x3e6f2e['message'],'traceId':_0x3e6f2e['traceId']};})),'abortController':_0x35c460};}async*['_getStreamReader'](_0x4e6514){const _0x301092=[],_0x1d8f5e=_0x4e6514['getReader'](),_0xbda487=$t({'onError':_0x11168e=>{this['_handleError'](_0x11168e);},'onEvent':_0x56042d=>{_0x56042d['data']=JSON['parse'](_0x56042d['data']),_0x301092['push'](_0x56042d);}});try{let _0x34e092=!0x1;for(;!_0x34e092;){const {done:_0x22d804,value:_0x74e135}=await _0x1d8f5e['read']();_0x22d804&&(_0x34e092=!0x0),_0xbda487['feed'](this['_decoder']['decode'](_0x74e135,{'stream':!0x0})),yield*_0x301092,_0x301092['length']=0x0;}}catch(_0x4f0d48){this['_handleError'](_0x4f0d48);}finally{_0x1d8f5e['releaseLock'](),_0xbda487['reset']();}}['_handleError'](_0x5e63e7){if(_0x5e63e7 instanceof _0x25c351)throw _0x5e63e7;if(_0x5e63e7 instanceof Error&&'AbortError'===_0x5e63e7['name'])throw new _0x25c351('ai-request-aborted',this,{'originalError':_0x5e63e7});throw new _0x25c351('ai-request-failed',this,{'originalError':_0x5e63e7});}}function h(_0x2cd485,_0x49ab7d,_0x4297f3){const t=_0x2cd485['t'];switch(_0x49ab7d){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'},_0x4297f3);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.'},_0x4297f3);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.'},_0x4297f3);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.'},_0x4297f3);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'},_0x4297f3);case'AI_CHAT_SUGGESTION_ACTION_SUGGEST':return t({'id':'AI_CHAT_SUGGESTION_ACTION_SUGGEST','string':'Suggest'},_0x4297f3);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'},_0x4297f3);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.'},_0x4297f3);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.'},_0x4297f3);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.'},_0x4297f3);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.'},_0x4297f3);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'},_0x4297f3);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.'},_0x4297f3);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 _0x49ab7d;}}function Hs(_0x2862dc,_0x3bc5fb){const _0x57cd5e=new _0x1d1b95(_0x2862dc),_0x5e0772=h(_0x2862dc,'AI_TABS_LABEL_MINIMIZE'),_0x278070=h(_0x2862dc,'AI_TABS_LABEL_MAXIMIZE');return _0x57cd5e['set']({'withText':!0x1,'icon':_0x58d6c6,'tooltip':!0x0,'class':'ck-ai-tabs__resize\x20ck-ai-button-tertiary'}),_0x57cd5e['bind']('label')['to'](_0x3bc5fb,'isMaximized',_0x1d515e=>_0x1d515e?_0x5e0772:_0x278070),_0x57cd5e['bind']('icon')['to'](_0x3bc5fb,'isMaximized',_0x249974=>_0x249974?_0xd6b3a0:_0x58d6c6),_0x57cd5e['bind']('isOn')['to'](_0x3bc5fb,'isMaximized'),_0x57cd5e['on']('execute',()=>{_0x3bc5fb['fire']('resizeTabs');}),_0x57cd5e;}function Ui(_0x4039fb){return _0x296793(_0x4039fb);}function pt(_0x32ff60){return _0xc63f4e(_0x32ff60);}function It(_0x25babc,_0x25e912,_0x4ac9ba){const _0x3f5231=null!==_0x25e912?_0x3f2b18=>_0x3f2b18['attribs'][_0x25babc]===_0x25e912:_0x4b5562=>Boolean(_0x4b5562['attribs'][_0x25babc]);return gt(_0x315ad8=>_0x441935(_0x315ad8)&&_0x3f5231(_0x315ad8),_0x4ac9ba);}function Fi(_0x4dd307,_0xf02569,_0x791169){const _0x96f015=null!==_0xf02569?_0x223acc=>_0x223acc['attribs'][_0x4dd307]===_0xf02569:_0x680a9e=>Boolean(_0x680a9e['attribs'][_0x4dd307]);return _0x5b5fc9(_0x537c9d=>_0x441935(_0x537c9d)&&_0x96f015(_0x537c9d),_0x791169);}function ut(_0x11456e,_0x1e1793){return _0x11456e&&_0x441935(_0x11456e)?_0x11456e['attribs'][_0x1e1793]:null;}function Zi(_0x34cebe,_0x5358c6,_0x1217e4){_0x441935(_0x34cebe)&&(null===_0x1217e4?delete _0x34cebe['attribs'][_0x5358c6]:_0x34cebe['attribs'][_0x5358c6]=_0x1217e4);}function Ki(_0x29a790,_0xdbfe60,_0x522cc3){const _0x1c48b5=_0xdbfe60['cloneNode'](!0x0);'beforebegin'===_0x522cc3?_0x45d87d(_0x29a790,_0x1c48b5):'afterbegin'===_0x522cc3?_0x2cb06e(_0x29a790,_0x1c48b5):'beforeend'===_0x522cc3?_0x1854ba(_0x29a790,_0x1c48b5):'afterend'===_0x522cc3&&_0x40b605(_0x29a790,_0x1c48b5);}function Pi(_0x15c9c6){const _0x2dc4d7=[];let _0xafe620=_0x15c9c6;for(;_0xafe620;)_0xafe620=_0x2c5477(_0xafe620),_0xafe620&&_0x2dc4d7['push'](_0xafe620);return _0x2dc4d7;}function zn(_0x13ea87){return _0x13ea87['replace'](/^\s+/gm,'')['replace'](/\s+$/gm,'')['replace'](/\n*/g,'')['replace'](/\s+/g,'\x20')['replace'](/>\s*</g,'><');}function Es(_0x524b37){let _0x1c2fb6=0x0;for(;_0x524b37['parentNode'];)_0x524b37=_0x524b37['parentNode'],_0x1c2fb6++;return _0x1c2fb6;}function Bs(_0x16daf0){const _0x42bd2d=[];let _0x137ddc=_0x16daf0['nextSibling'];for(;_0x137ddc;)_0x42bd2d['push'](_0x137ddc),_0x137ddc=_0x137ddc['nextSibling'];_0x42bd2d['forEach'](_0xbe9d7f=>{_0x210a44(_0xbe9d7f);});}class Li 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(_0x4b5a72){super(),this['_generateUid']=_0x4b5a72||_0x677d44;}['merge'](_0x190ec9,_0x4b27f2,_0x1d9f5b){const _0x3ac277=_0x190ec9['cloneNode'](!0x0);if(0x0===_0x4b27f2['childNodes']['length']){const _0x3e5e1d=[];return Fi('data-id','new-element',_0x3ac277)['forEach'](_0x2f88c0=>{const _0x484cbd=this['_generateUid']();Zi(_0x2f88c0,'data-id',_0x484cbd),_0x3e5e1d['push'](_0x484cbd);}),this['_removeSpecialComments'](_0x3ac277),{'parsedContent':_0x3ac277,'newNodeIds':_0x3e5e1d,'modifiedNodeIds':[],'removedNodeIds':[]};}_0x1d9f5b&&_0x1d9f5b['markUnstableElements']&&this['_markLastTagElementUnstable'](_0x3ac277),this['_touchedNodesState']['newIds']=[],this['_touchedNodesState']['modifiedIds']=[],this['_touchedNodesState']['removedIds']=[],this['_touchedNodesState']['invalidIds']=[],this['_touchedNodesState']['lastTouchedId']=null,this['_existingDataIds']=new Set(Fi('data-id',null,_0x4b27f2)['map'](_0x1e7c49=>ut(_0x1e7c49,'data-id'))['filter'](_0x2f4dfd=>!!_0x2f4dfd));let _0x5b2136=-0x1,_0x30d025=!0x1;const _0x51d8c0=_0x3ac277['childNodes'],_0x3228a7=Array['from'](_0x51d8c0)['filter'](_0x57afdd=>!(0x3===_0x57afdd['nodeType']&&''===pt(_0x57afdd)['trim']())),_0x3e2610=_0x3228a7['length'];for(let _0x54d5c9=0x0;_0x54d5c9<_0x3e2610;_0x54d5c9++){const _0x15d72e=_0x3228a7[_0x54d5c9],_0x51be83=_0x3228a7[_0x54d5c9+0x1];if(this['_isNewNode'](_0x15d72e)){if(-0x1===_0x5b2136&&(_0x5b2136=_0x54d5c9),this['_markWrappedElements'](_0x15d72e),!this['_isNewNode'](_0x51be83)){const [_0x341061,_0x433e22]=this['_findReferenceNode'](_0x15d72e,_0x30d025,_0x4b27f2);if(_0x341061){const _0x5ec900=Array['from'](_0x3228a7)['slice'](_0x5b2136,_0x54d5c9+0x1);this['_insertNodes'](_0x341061,_0x5ec900,_0x433e22),_0x5b2136=-0x1;}}}else{if(this['_isExistingContentComment'](_0x15d72e))_0x30d025=!0x0;else{if(this['_isExistingNode'](_0x15d72e)){const _0x270330=ut(_0x15d72e,'data-id');if(_0x270330&&this['_existingDataIds']['has'](_0x270330)){const _0x365cb5=It('data-id',_0x270330,_0x4b27f2);this['_replaceNode'](_0x365cb5,_0x15d72e);}if(this['_touchedNodesState']['removedIds']['includes'](_0x270330)){const _0x51aa73=this['_touchedNodesState']['removedIds']['indexOf'](_0x270330);this['_touchedNodesState']['removedIds']['splice'](_0x51aa73,0x1);}}else{if(this['_isDelNode'](_0x15d72e)){const _0x16fd7b=ut(_0x15d72e,'data-id');this['_touchedNodesState']['modifiedIds']['includes'](_0x16fd7b)||this['_storeDeletedElementIds'](_0x15d72e);}}}}}for(const _0x67257e of this['_touchedNodesState']['removedIds']){const _0x3015f3=It('data-id',_0x67257e,_0x4b27f2);if(_0x3015f3){if(_0x1d9f5b&&_0x1d9f5b['replaceRemovedWith']){this['_touchedNodesState']['lastTouchedId']=_0x67257e;const _0x38cf6f=_0x1d9f5b['replaceRemovedWith']['cloneNode'](!0x0);Zi(_0x38cf6f,'data-id',_0x67257e),Zi(_0x38cf6f,'data-removed','true'),_0x46022b(_0x3015f3,_0x38cf6f);}else _0x210a44(_0x3015f3);}}if(Fi('data-wrapped-id',null,_0x4b27f2)['forEach'](_0x18e4f1=>{const _0x163787=It('data-id',ut(_0x18e4f1,'data-wrapped-id'),_0x4b27f2);var _0x13ed3b,_0x2a1b01;_0x163787&&(_0x2a1b01=_0x18e4f1,_0x210a44(_0x13ed3b=_0x163787),_0x46022b(_0x2a1b01,_0x13ed3b));}),Fi('data-id','new-element',_0x4b27f2)['forEach'](_0x5a7792=>{const _0x1a5cb7=this['_getUid'](_0x5a7792);Zi(_0x5a7792,'data-id',_0x1a5cb7),this['_touchedNodesState']['newIds']['push'](_0x1a5cb7);}),this['_removeSpecialComments'](_0x4b27f2),_0x1d9f5b&&_0x1d9f5b['markUnstableElements']&&this['_markUnstableElements'](_0x4b27f2,_0x1d9f5b['markUnstableElementsDepth']||0x0),_0x1d9f5b&&_0x1d9f5b['cutAfterLastChange']&&this['_touchedNodesState']['lastTouchedId']){let _0x4d0193=It('data-id',this['_touchedNodesState']['lastTouchedId'],_0x4b27f2);for(;_0x4d0193;)Bs(_0x4d0193),_0x4d0193=_0x4d0193['parentNode'];}return{'parsedContent':_0x4b27f2,'newNodeIds':this['_touchedNodesState']['newIds'],'modifiedNodeIds':this['_touchedNodesState']['modifiedIds'],'removedNodeIds':this['_touchedNodesState']['removedIds']};}['_insertNodes'](_0x381ac2,_0x3c9d8b,_0x346ab8){for(const _0x58572a of _0x3c9d8b){const _0x174aaf=this['_getUid'](_0x58572a);Zi(_0x58572a,'data-id',_0x174aaf),this['_touchedNodesState']['newIds']['push'](_0x174aaf),this['_touchedNodesState']['lastTouchedId']=_0x174aaf;}const _0x1422f3='afterbegin'===_0x346ab8||'afterend'===_0x346ab8?_0x3c9d8b['reverse']():_0x3c9d8b;for(const _0x588e27 of _0x1422f3)Ki(_0x381ac2,_0x588e27,_0x346ab8);}['_replaceNode'](_0x549516,_0x3ba126){if(!_0x549516)return;if(_0x414b47=_0x3ba126,zn(pt(_0x549516))===zn(pt(_0x414b47)))return;var _0x414b47;const _0x52fb3c=this['_getUid'](_0x549516);Zi(_0x3ba126,'data-id',_0x52fb3c),this['_touchedNodesState']['modifiedIds']['push'](_0x52fb3c),this['_touchedNodesState']['lastTouchedId']=_0x52fb3c,_0x46022b(_0x549516,_0x3ba126['cloneNode'](!0x0));}['_findReferenceNode'](_0x18ead5,_0x1b82f4,_0xd7777f){const _0x430f14=this['_findPrevElementWithDataId'](_0x18ead5,!0x1);if(_0x430f14){const _0x206822=this['_getNodeDataId'](_0x430f14),_0xb12810=It('data-id',_0x206822,_0xd7777f);if(_0xb12810)return[_0xb12810,'afterend'];this['_touchedNodesState']['invalidIds']['push'](_0x206822);}const _0x152a35=this['_findNextElementWithDataId'](_0x18ead5,!0x1);if(_0x152a35){const _0x4e9d9d=this['_getNodeDataId'](_0x152a35),_0x473c1d=It('data-id',_0x4e9d9d,_0xd7777f);if(_0x473c1d)return[_0x473c1d,'beforebegin'];this['_touchedNodesState']['invalidIds']['push'](_0x4e9d9d);}return _0x1b82f4?_0x18ead5['nextSibling']?this['_findFallbackReferenceNode'](_0x18ead5,_0xd7777f):[_0xd7777f['childNodes'][_0xd7777f['childNodes']['length']-0x1],'afterend']:[_0xd7777f['childNodes'][0x0],'beforebegin'];}['_findFallbackReferenceNode'](_0x1d5173,_0x13a42a){const _0x3eac28=[],_0x47cd1d=this['_findPrevElementWithDataId'](_0x1d5173,!0x0);if(_0x47cd1d){const _0x1afce7=It('data-id',this['_getNodeDataId'](_0x47cd1d),_0x13a42a);_0x1afce7&&_0x3eac28['push']([_0x1afce7,'afterend']);}const _0x4c037b=this['_findNextElementWithDataId'](_0x1d5173,!0x0);if(_0x4c037b){const _0x571cb7=It('data-id',this['_getNodeDataId'](_0x4c037b),_0x13a42a);_0x571cb7&&_0x3eac28['push']([_0x571cb7,'beforebegin']);}if(_0x3eac28['length']>0x1)return Es(_0x3eac28[0x0][0x0])<=Es(_0x3eac28[0x1][0x0])?_0x3eac28[0x0]:_0x3eac28[0x1];return 0x1===_0x3eac28['length']?_0x3eac28[0x0]:[_0x13a42a['lastChild'],'afterend'];}['_findNextElementWithDataId'](_0x575973,_0x1260d0){let _0x56f87b=_0x575973['nextSibling'],_0x21bfee=null,_0x50a9d1=!0x1;for(;_0x56f87b;){if(_0x2a0cb6(_0x56f87b)){if(this['_isDelNode'](_0x56f87b)&&(_0x21bfee=_0x56f87b),this['_isExistingContentComment'](_0x56f87b)&&_0x1260d0&&!_0x50a9d1){_0x50a9d1=!0x0,_0x56f87b=_0x56f87b['nextSibling'];continue;}break;}const _0x2fc1ff=ut(_0x56f87b,'data-id');if(_0x2fc1ff&&'new-element'!==_0x2fc1ff&&this['_existingDataIds']['has'](_0x2fc1ff)){_0x21bfee=_0x56f87b;break;}_0x56f87b=_0x56f87b['nextSibling'];}return _0x21bfee;}['_findPrevElementWithDataId'](_0x51549d,_0x131789){let _0xc6fd07=_0x51549d['previousSibling'],_0x54adf0=null,_0xda1029=!0x1;for(;_0xc6fd07;){if(_0x2a0cb6(_0xc6fd07)){if(this['_isDelNode'](_0xc6fd07)&&(_0x54adf0=_0xc6fd07),this['_isExistingContentComment'](_0xc6fd07)&&_0x131789&&!_0xda1029){_0xda1029=!0x0,_0xc6fd07=_0xc6fd07['previousSibling'];continue;}break;}const _0x38773e=ut(_0xc6fd07,'data-id');if(_0x38773e&&'new-element'!==_0x38773e&&this['_existingDataIds']['has'](_0x38773e)){_0x54adf0=_0xc6fd07;break;}_0xc6fd07=_0xc6fd07['previousSibling'];}return _0x54adf0;}['_markWrappedElements'](_0x5e0b11){_0x441935(_0x5e0b11)&&Fi('data-id',null,_0x5e0b11)['forEach'](_0x260384=>{this['_isExistingNode'](_0x260384)&&!this['_hasWrappedParent'](_0x260384)&&(Zi(_0x260384,'data-wrapped-id',ut(_0x260384,'data-id')),Zi(_0x260384,'data-id',null));});}['_getNodeDataId'](_0x2b464e){if(!_0x2b464e)return null;if(_0x441935(_0x2b464e))return ut(_0x2b464e,'data-id');if(_0x2a0cb6(_0x2b464e)){const _0x2ca602=pt(_0x2b464e)['match'](/removed[\s*-]data-id="([^"]+)"/);if(_0x2ca602&&_0x2ca602[0x1])return _0x2ca602[0x1];}return null;}['_storeDeletedElementIds'](_0x5425c3){if(_0x2a0cb6(_0x5425c3)){const _0x25603b=pt(_0x5425c3)['match'](/removed[\s*-]data-id="([^"]+)"/);_0x25603b&&_0x25603b[0x1]&&this['_touchedNodesState']['removedIds']['push'](_0x25603b[0x1]);}}['_getUid'](_0x3894d4){return this['_isExistingNode'](_0x3894d4)?ut(_0x3894d4,'data-id'):this['_generateUid']();}['_removeSpecialComments'](_0x4701a6){(function(_0x44eef6){return _0x408f6d(_0x3f5018=>_0x2a0cb6(_0x3f5018),_0x44eef6,!0x0,0x1/0x0);}(_0x4701a6)['filter'](_0x3c9c84=>this['_isDelNode'](_0x3c9c84)||this['_isExistingContentComment'](_0x3c9c84))['forEach'](_0x378e19=>{_0x210a44(_0x378e19);}));}['_markLastTagElementUnstable'](_0x16637d){const _0x302c72=_0x16637d['childNodes'],_0x1aa1c2=_0x302c72[_0x302c72['length']-0x1];_0x1aa1c2&&_0x441935(_0x1aa1c2)&&Zi(_0x1aa1c2,'data-unstable','true');}['_markUnstableElements'](_0x28685d,_0x3244b7){const _0x35f2ce=It('data-unstable','true',_0x28685d);if(!_0x35f2ce)return;const _0xca2a37=Pi(_0x35f2ce)['slice'](0x0,-0x1),_0x1a75c8=_0xca2a37['length'];let _0x142690=_0x35f2ce;if(_0x1a75c8>_0x3244b7){let _0x3f497b=_0x1a75c8,_0x4dc3c8=null;for(;_0x3f497b>_0x3244b7&&_0x3f497b>=0x0;)_0x3f497b--,_0x4dc3c8=_0xca2a37[_0x3f497b];_0x4dc3c8&&(_0x142690=_0x4dc3c8,Zi(_0x35f2ce,'data-unstable',null),Zi(_0x4dc3c8,'data-unstable','true'));}else{if(_0x1a75c8<_0x3244b7){let _0x3d0450=_0x1a75c8,_0x2e13e8=_0x35f2ce;for(;_0x3d0450<_0x3244b7;){const _0x17ea96=_0x2e13e8['childNodes']['filter'](_0x50914a=>_0x441935(_0x50914a));if(0x0===_0x17ea96['length'])break;_0x3d0450++,_0x2e13e8=_0x17ea96[_0x17ea96['length']-0x1];}_0x2e13e8&&(_0x142690=_0x2e13e8,Zi(_0x35f2ce,'data-unstable',null),Zi(_0x2e13e8,'data-unstable','true'));}}let _0x4a81b7=_0x142690;for(;_0x4a81b7;){for(;_0x4a81b7['nextSibling'];)_0x4a81b7=_0x4a81b7['nextSibling'],_0x441935(_0x4a81b7)&&Zi(_0x4a81b7,'data-unstable','true');_0x4a81b7=_0x4a81b7['parentNode'];}}['_isNewNode'](_0x2f429e){return Boolean('new-element'===ut(_0x2f429e,'data-id'));}['_isExistingNode'](_0x2283bf){return Boolean((ut(_0x2283bf,'data-id')||'')['length']>0x0&&'new-element'!==ut(_0x2283bf,'data-id'));}['_isDelNode'](_0x319faa){return!!_0x319faa&&Boolean(_0x2a0cb6(_0x319faa)&&pt(_0x319faa)['match'](/removed[\s*-]data-id="[^"]+"/));}['_hasWrappedParent'](_0x65f58){let _0x13e5b9=_0x65f58['parentNode'];for(;_0x13e5b9;){if(ut(_0x13e5b9,'data-wrapped-id'))return!0x0;_0x13e5b9=_0x13e5b9['parentNode'];}return!0x1;}['_isExistingContentComment'](_0x4cffc2){return Boolean(_0x2a0cb6(_0x4cffc2)&&pt(_0x4cffc2)['match'](/\s*existing[\s*-](content|document)\s*/g));}}function kt({editor:_0x2544de,changeGroups:_0x207690,documentContextContent:_0x2683c8,showDiff:_0x57417a,trimUnchanged:_0x24591a=!0x0}){return _0x207690['map'](_0x271355=>{const _0x3284ad=new _t([]),_0x5f471a=new _t([]);for(const _0x114d32 of _0x271355['changes'])if(_0x57417a&&'removed'==_0x114d32['type']||_0x5f471a['children']['push'](_0x114d32['node']['cloneNode'](!0x0)),'new'!=_0x114d32['type']&&(_0x57417a||'removed'!=_0x114d32['type'])){const _0x4fbdfc=gt(_0x31d69a=>ut(_0x31d69a,'data-id')==_0x114d32['id'],_0x2683c8,!0x0);_0x4fbdfc&&_0x3284ad['children']['push'](_0x4fbdfc['cloneNode'](!0x0));}const {content:_0x69fa3e,hasChanges:_0x22b829}=function(_0x5cb73d,_0x4f1ec0,_0x339316,_0x254b46,_0x132e61=!0x0){const _0x86e196=_0x5cb73d['plugins']['get']('DocumentCompare'),_0x37530e=pt(_0x4f1ec0),_0xec5c90=pt(_0x339316),_0x172696=_0x5cb73d['data']['parse'](_0x37530e,'$root'),_0x546260=_0x5cb73d['model']['createPositionAt'](_0x172696,0x0),_0x51f7da=_0x86e196['getDiff'](_0x37530e,_0xec5c90,{'anchor':_0x546260,'markDeletions':_0x254b46}),_0x103338=_0x51f7da['getOperations']();if(0x0==_0x103338['length'])return{'content':_0x4f1ec0['cloneNode'](!0x0),'hasChanges':!0x1};_0x254b46?function(_0x4860a3,_0x19cc75,_0x33e59f){if(0x0==_0x4860a3['length'])return;const _0x55f7b2=_0x33e59f['plugins']['get']('DocumentCompare'),_0x5283a0=_0x33e59f['plugins']['get']('SuggestionsConversion');_0x33e59f['model']['change'](_0x442792=>{const _0x5ab74b=new Set();for(let _0x15c8e2=0x0;_0x15c8e2<_0x4860a3['length'];_0x15c8e2++){const _0x1b4ab5=_0x4860a3[_0x15c8e2];if(_0x1b4ab5['baseVersion']=null,_0x1b4ab5['isDocumentOperation']=!0x1,_0x55f7b2['isMarkedRemoveOperation'](_0x1b4ab5)){const _0x43f651=_0x783893(_0x1b4ab5['newRange'],_0x33e59f['model']),_0x479b13='suggestion:deletion:'+_0x677d44()+':$aiSuggestion';_0x19cc75['markers']['set'](_0x479b13,_0x43f651);}else switch(_0x1b4ab5['type']){case'rename':{if(_0x1b4ab5['oldName']==_0x1b4ab5['newName'])break;_0x442792['batch']['addOperation'](_0x1b4ab5),_0x33e59f['model']['applyOperation'](_0x1b4ab5);const _0x590842='$elementName',_0x3789a1=_0x1b4ab5['position'],_0x3dedba=_0x33e59f['model']['createRange'](_0x3789a1,_0x33e59f['model']['createPositionAt'](_0x3789a1['nodeAfter'],'end')),_0x380669='suggestion:attribute:'+_0x590842+':'+_0x677d44()+':$aiSuggestion';_0x19cc75['markers']['set'](_0x380669,_0x3dedba);break;}case'addAttribute':case'removeAttribute':case'changeAttribute':{if(_0x1b4ab5['oldValue']==_0x1b4ab5['newValue'])break;_0x442792['batch']['addOperation'](_0x1b4ab5),_0x33e59f['model']['applyOperation'](_0x1b4ab5);const _0xb81ec=_0x1b4ab5['key'];if(!_0x5283a0['isRegisteredAttribute'](_0xb81ec))break;const _0x52b7fb=_0x783893(_0x1b4ab5['range'],_0x33e59f['model']),_0x1e9d85='suggestion:attribute:'+_0xb81ec+':'+_0x677d44()+':$aiSuggestion';_0x19cc75['markers']['set'](_0x1e9d85,_0x52b7fb);break;}case'insert':{_0x442792['batch']['addOperation'](_0x1b4ab5),_0x33e59f['model']['applyOperation'](_0x1b4ab5);if(_0x4860a3[_0x15c8e2+0x1]&&'move'==_0x4860a3[_0x15c8e2+0x1]['type']){no(_0x19cc75,_0x1b4ab5);break;}const _0x572809=_0x1b4ab5['position'],_0xb3727c=_0x1b4ab5['howMany'],_0x370bb3=_0x783893(_0x33e59f['model']['createRange'](_0x572809,_0x572809['getShiftedBy'](_0xb3727c)),_0x33e59f['model']),_0x1bc0ac='suggestion:insertion:'+_0x677d44()+':$aiSuggestion';_0x19cc75['markers']['set'](_0x1bc0ac,_0x370bb3);break;}case'split':{_0x442792['batch']['addOperation'](_0x1b4ab5),_0x33e59f['model']['applyOperation'](_0x1b4ab5);const _0x57a9e6=_0x1b4ab5['splitPosition'],_0xf3139c=_0x1b4ab5['moveTargetPosition'],_0x1fedd5=_0x33e59f['model']['createRange'](_0x57a9e6,_0xf3139c),_0x146718='suggestion:insertion:'+_0x677d44()+':$aiSuggestion';_0x19cc75['markers']['set'](_0x146718,_0x1fedd5);break;}case'move':{_0x442792['batch']['addOperation'](_0x1b4ab5),_0x33e59f['model']['applyOperation'](_0x1b4ab5),_0x4860a3[_0x15c8e2-0x1]&&'insert'==_0x4860a3[_0x15c8e2-0x1]['type']&&no(_0x19cc75,_0x1b4ab5);const _0x596b9c=_0x1b4ab5['getMovedRangeStart'](),_0x2e014f=_0x1b4ab5['howMany'];for(let _0x388cca=0x0;_0x388cca<_0x2e014f;_0x388cca++){const _0x491ba6=_0x596b9c['getShiftedBy'](_0x388cca)['nodeAfter'];_0x5ab74b['add'](_0x491ba6);}break;}case'remove':{const _0x402d8d=_0x1b4ab5['sourcePosition'],_0xe263af=_0x1b4ab5['howMany'],_0x4c6d57=new lt(_0x402d8d,_0xe263af);_0x442792['batch']['addOperation'](_0x4c6d57),_0x33e59f['model']['applyOperation'](_0x4c6d57);break;}}}for(const _0x5b8d61 of _0x5ab74b){const _0x5cc21a=_0x33e59f['model']['createRangeOn'](_0x5b8d61),_0x66a157='suggestion:formatBlock:$fakeWrap:'+_0x677d44()+':$aiSuggestion';_0x19cc75['markers']['set'](_0x66a157,_0x783893(_0x5cc21a,_0x33e59f['model']));}});}(_0x103338,_0x172696,_0x5cb73d):_0x5cb73d['model']['change'](_0x58b7b2=>{for(const _0x7d1fd4 of _0x103338)if('remove'==_0x7d1fd4['type']){const _0x4022e8=_0x7d1fd4['sourcePosition'],_0x530c22=_0x7d1fd4['howMany'],_0x124fed=new lt(_0x4022e8,_0x530c22);_0x58b7b2['batch']['addOperation'](_0x124fed),_0x5cb73d['model']['applyOperation'](_0x124fed);}else{if('marker'==_0x7d1fd4['type']){const _0xbccddb=_0x7d1fd4['name'],_0x328a7e=_0x7d1fd4['newRange'];null!==_0x328a7e?_0x172696['markers']['set'](_0xbccddb,_0x328a7e):_0x172696['markers']['delete'](_0xbccddb);}else _0x7d1fd4['baseVersion']=null,_0x7d1fd4['isDocumentOperation']=!0x1,_0x58b7b2['batch']['addOperation'](_0x7d1fd4),_0x5cb73d['model']['applyOperation'](_0x7d1fd4);}});if(_0x132e61){const _0x24fb4c=ct(_0x5cb73d,_0x103338,_0x172696);ht(_0x5cb73d['model'],_0x24fb4c),function(_0x5d3ea6,_0xd85127){const _0x39e100=_0xd85127['getFirstRange']()['start'];let _0x5d76f8=_0xd85127['getFirstRange']()['end'];const _0x527a40=_0x39e100['root'];(_0x5d76f8['textNode']||_0x5d76f8['nodeAfter']&&_0x5d76f8['nodeAfter']['is']('$text'))&&(_0x2aeeda(_0x5d76f8,'...'),_0x5d76f8=_0x5d76f8['getShiftedBy'](0x3)),(_0x39e100['textNode']||_0x39e100['nodeBefore']&&_0x39e100['nodeBefore']['is']('$text'))&&(_0x2aeeda(_0x39e100,'...'),function(_0x17bcb1,_0x22daba,_0x34cc6f){for(let [_0x31fec5,_0xb207bb]of _0x17bcb1['markers']){const _0x41140a=_0xb207bb['_getTransformedByInsertion'](_0x22daba,_0x34cc6f,!0x1);_0xb207bb=_0x41140a[0x0],_0x17bcb1['markers']['set'](_0x31fec5,_0xb207bb);}}(_0x527a40,_0x39e100,0x3),_0x39e100['parent']==_0x5d76f8['parent']&&(_0x5d76f8=_0x5d76f8['getShiftedBy'](0x3)));const _0x2fd4c3=_0x5d3ea6['createRange'](_0x5d3ea6['createPositionAt'](_0x527a40,0x0),_0x39e100),_0x591b07=_0x5d3ea6['createRange'](_0x5d76f8,_0x5d3ea6['createPositionAt'](_0x527a40,'end')),_0x1f9d98=[..._0x2fd4c3['getMinimalFlatRanges'](),..._0x591b07['getMinimalFlatRanges']()];_0x1f9d98['reverse']();for(const _0x3b5c26 of _0x1f9d98)to(_0x3b5c26),Jn(_0x527a40,_0x3b5c26);}(_0x5cb73d['model'],_0x24fb4c);}const _0x917e9b=_0x5cb73d['data']['stringify'](_0x172696,{'showSuggestionHighlights':!0x0});return{'content':Ui(_0x917e9b),'hasChanges':!0x0};}(_0x2544de,_0x3284ad,_0x5f471a,_0x57417a,_0x24591a);return{'type':_0x271355['changes'][0x0]['type'],'index':_0x271355['index'],'content':_0x69fa3e,'hasChanges':_0x22b829};});}function no(_0x43f8d7,_0x467736){for(const [_0x11dfe8,_0x5f080c]of _0x43f8d7['markers']){const _0xc5a6d3=dt['_createFromRanges'](_0x5f080c['getTransformedByOperation'](_0x467736));_0x43f8d7['markers']['set'](_0x11dfe8,_0xc5a6d3);}}function ct(_0x31c51d,_0x4119ae,_0x3d379c){const _0x4c985a=_0x31c51d['plugins']['get']('DocumentCompare');let _0x2ba13c=_0x31c51d['model']['createPositionAt'](_0x3d379c,Number['POSITIVE_INFINITY']),_0xe3d778=_0x31c51d['model']['createPositionAt'](_0x3d379c,0x0);for(const _0x52cd7f of _0x4119ae){let _0x3bcd54,_0xb9d8b4;if(_0x4c985a['isMarkedRemoveOperation'](_0x52cd7f))_0x3bcd54=_0x52cd7f['newRange']['start'],_0xb9d8b4=_0x52cd7f['newRange']['end'];else switch(_0x2ba13c=_0x2ba13c['getTransformedByOperation'](_0x52cd7f),_0xe3d778=_0xe3d778['getTransformedByOperation'](_0x52cd7f),_0x52cd7f['type']){case'rename':_0x3bcd54=_0x52cd7f['position'],_0xb9d8b4=_0x3bcd54['getShiftedBy'](0x1);break;case'addAttribute':case'removeAttribute':case'changeAttribute':_0x3bcd54=_0x52cd7f['range']['start'],_0xb9d8b4=_0x52cd7f['range']['end'];break;case'insert':_0x3bcd54=_0x52cd7f['position'],_0xb9d8b4=_0x3bcd54['getShiftedBy'](_0x52cd7f['howMany']);break;case'split':_0x3bcd54=_0x52cd7f['splitPosition'],_0xb9d8b4=_0x52cd7f['moveTargetPosition'];break;case'merge':{const _0x347e3e=_0x52cd7f['targetPosition']['path']['slice'](0x0,-0x1);_0x3bcd54=_0x31c51d['model']['createPositionFromPath'](_0x3d379c,_0x347e3e),_0xb9d8b4=_0x3bcd54['getShiftedBy'](0x1);break;}case'remove':{const _0x10fcc0=_0x52cd7f['howMany'],_0x3249eb=_0x52cd7f['sourcePosition']['_getTransformedByInsertion'](_0x52cd7f['targetPosition'],_0x10fcc0),_0x44c9d3=_0x52cd7f['getMovedRangeStart']();'remove'==_0x52cd7f['type']?(_0x3bcd54=_0x3249eb,_0xb9d8b4=_0x3249eb):(_0x3bcd54=_0x44c9d3,_0xb9d8b4=_0x44c9d3['getShiftedBy'](_0x10fcc0));break;}}_0x3bcd54&&_0x3bcd54['isBefore'](_0x2ba13c)&&(_0x2ba13c=_0x3bcd54['clone'](),_0x2ba13c['stickiness']='toNone'),_0xb9d8b4&&_0xb9d8b4['isAfter'](_0xe3d778)&&(_0xe3d778=_0xb9d8b4['clone'](),_0xe3d778['stickiness']='toNone');}return _0x31c51d['model']['createSelection'](_0x31c51d['model']['createRange'](_0x2ba13c,_0xe3d778));}function ht(_0x286ead,_0x19ef4a){ro(_0x286ead,_0x19ef4a,'forward');const _0x2082fa=_0x19ef4a['getFirstRange']();_0x19ef4a['setTo']([]),_0x19ef4a['setTo'](_0x2082fa,{'backward':!0x0}),ro(_0x286ead,_0x19ef4a,'backward');}function ro(_0x362390,_0x4f75fa,_0x56bba8){let _0x59c393=0x14;for(;_0x59c393;){_0x362390['modifySelection'](_0x4f75fa,{'unit':'word','direction':_0x56bba8}),_0x59c393--;const _0x2aecce=_0x4f75fa['focus']['forward'==_0x56bba8?'nodeBefore':'nodeAfter'];if(_0x2aecce&&_0x2aecce['is']('element')&&_0x362390['schema']['isBlock'](_0x2aecce)&&_0x362390['schema']['isObject'](_0x2aecce))break;}}function Jn(_0x4dc337,_0x43895c){for(const [_0x3b9802,_0x126b62]of _0x4dc337['markers']){const _0x3c1301=_0x126b62['_getTransformedByDeletion'](_0x43895c['start'],_0x43895c['end']['offset']-_0x43895c['start']['offset']);null!=_0x3c1301?_0x4dc337['markers']['set'](_0x3b9802,_0x3c1301):_0x4dc337['markers']['delete'](_0x3b9802);}}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:_0x1e5025,content:_0x118e33='',isDone:_0x443131=!0x1,interactionId:_0x5f4694,areActionsDisabled:_0x36a1e0,documentContextContent:_0x5317f3,editor:_0x4d94a4,id:_0x23ee1d}){super(),this['id']=_0x23ee1d||_0x677d44(),this['interactionId']=_0x5f4694,this['type']=_0x1e5025,this['areActionsDisabled']=!!_0x36a1e0,this['editor']=_0x4d94a4,this['aiResponseParser']=new Li(),this['aiResponseApplier']=new Wi(),this['documentContextContent']=Ui(_0x5317f3||''),this['set']('isDone',_0x443131),this['on']('change:content',()=>{this['onContentChange']();}),this['set']('content',_0x118e33);}['appendContent'](_0x3d8030){this['set']('content',this['content']+_0x3d8030);}['done'](){this['isDone']||(this['set']('isDone',!0x0),this['onContentChange']());}['destroy'](){this['stopListening']();}['setChangeGroupState'](_0x37c68a,_0x1f4998){this['changeGroups'][_0x37c68a]['state']=_0x1f4998,this['fire']('replyChangeGroupStateUpdated',{'reply':this,'index':_0x37c68a,'state':_0x1f4998});}['getContentParts']({showDiff:_0xa23cc1,groupIndex:_0xe3b4be}){if(!this['editor'])throw new _0x25c351('ai-get-editor-from-context-no-editor',null,{'aiReply':this});const _0x41b5a3=this['_getCachedContentParts'](_0xa23cc1,_0xe3b4be);if(_0x41b5a3)return _0x41b5a3;let _0x4a993a=[];if(void 0x0===_0xe3b4be)_0x4a993a=this['changeGroups'];else{const _0x3d090b=this['changeGroups']['find'](({index:_0x304144})=>_0x304144===_0xe3b4be);if(!_0x3d090b)throw new _0x25c351('ai-reply-get-content-parts-group-not-found',null,{'aiReply':this,'groupIndex':_0xe3b4be});_0x4a993a=[_0x3d090b];}const _0x356ff4=kt({'editor':this['editor'],'showDiff':_0xa23cc1,'changeGroups':_0x4a993a,'documentContextContent':this['documentContextContent']});return this['_setCachedContentParts'](_0xa23cc1,_0x356ff4),_0x356ff4;}['_getCachedContentParts'](_0x2149c0,_0x3bf652){const _0x3ba59e=_0x2149c0?'withDiff':'withoutDiff';if(!this['cachedSuggestionContentParts'][_0x3ba59e]['length'])return null;const _0x290949=this['cachedSuggestionContentParts'][_0x3ba59e];if(void 0x0===_0x3bf652)return _0x290949['length']>0x0&&_0x290949['length']!==this['changeGroups']['length']?(this['_setCachedContentParts'](_0x2149c0,null),null):_0x2b41ab(_0x290949);{const _0xc12044=_0x290949['find'](({index:_0x311e37})=>_0x311e37===_0x3bf652);if(_0xc12044)return[_0x2b41ab(_0xc12044)];}return null;}['_setCachedContentParts'](_0x3e8b61,_0x5a7854){const _0x55797b=_0x3e8b61?'withDiff':'withoutDiff';_0x5a7854?_0x5a7854['forEach'](_0x5f1402=>{const _0x1012fd=this['cachedSuggestionContentParts'][_0x55797b],_0xc47819=_0x1012fd['find'](({index:_0x4292fa})=>_0x4292fa===_0x5f1402['index']);if(_0xc47819){const _0xbdfe5e=_0x1012fd['indexOf'](_0xc47819);_0x1012fd['splice'](_0xbdfe5e,0x1,_0x5f1402);}else _0x1012fd['push'](_0x5f1402);}):this['cachedSuggestionContentParts'][_0x55797b]['length']=0x0;}['onContentChange'](){if('modification'===this['type']){this['parsedContent']=this['aiResponseParser']['parseAndNormalizeHTML'](this['content']);const _0x5e3ae9=this['changeGroups'];this['updateChangeGroups']();const _0x37f96b=this['_getDifferentChangeGroups'](_0x5e3ae9,this['changeGroups']);(_0x37f96b['length']||this['isDone'])&&(this['fire']('replyContentUpdated',this,_0x37f96b),this['cachedSuggestionContentParts']['withDiff']['length']=this['cachedSuggestionContentParts']['withoutDiff']['length']=0x0);}else this['parsedContent']=this['aiResponseParser']['convertMarkdownToHTML'](this['content']),this['fire']('replyContentUpdated',this);}['_getDifferentChangeGroups'](_0x13156e,_0x50d2a4){const _0x2de2f5=[];for(const _0xf2e49e of _0x50d2a4){const _0x58fe4d=_0x13156e[_0xf2e49e['index']];_0x58fe4d?_0x58fe4d['changes']['length']!==_0xf2e49e['changes']['length']?_0x2de2f5['push'](_0xf2e49e):_0x58fe4d['changes']['forEach']((_0x150d62,_0x27bfa8)=>{const _0x1b4ba4=_0xf2e49e['changes'][_0x27bfa8];_0x150d62['id']!==_0x1b4ba4['id']&&_0x2de2f5['push'](_0xf2e49e);}):_0x2de2f5['push'](_0xf2e49e);}return _0x2de2f5;}['updateChangeGroups'](){const _0x468759=new _0x38e3db('p',{},[new _0x38e3db('span',{'style':'color:\x20#808080;\x20font-style:\x20italic'},[new _0x4fdfd5(h(this['editor']['locale'],'AI_SUGGESTION_CONTENT_PART_REMOVED'))])]),_0x1d5fe8=this['aiResponseApplier']['merge'](this['parsedContent'],this['documentContextContent']['cloneNode'](!0x0),{'markUnstableElements':!this['isDone'],'replaceRemovedWith':_0x468759,'cutAfterLastChange':!this['isDone']});if(!_0x1d5fe8['modifiedNodeIds']['length']&&!this['isDone'])return;this['parsedMergedContent']=_0x1d5fe8['parsedContent'];let _0x58b1f2=[];if(_0x5b5fc9(_0x4473c5=>{const _0x3b39ee=ut(_0x4473c5,'data-id');if(!_0x3b39ee||!_0x1207d5(_0x3b39ee))return!0x1;const _0x342eb6=[_0x4473c5,...Pi(_0x4473c5)]['at'](-0x2);if(_0x4473c5!=_0x342eb6){const _0x4155f1=ut(_0x342eb6,'data-id');_0x1207d5(_0x4155f1)||(_0x58b1f2['push']({'node':_0x342eb6,'id':_0x4155f1,'type':'modified'}),_0x1d5fe8['modifiedNodeIds']['push'](_0x4155f1));}else _0x1d5fe8['modifiedNodeIds']['includes'](_0x3b39ee)?_0x58b1f2['push']({'node':_0x4473c5,'type':'modified','id':_0x3b39ee}):_0x1d5fe8['newNodeIds']['includes'](_0x3b39ee)?_0x58b1f2['push']({'node':_0x4473c5,'type':'new','id':_0x3b39ee,'anchorId':ut(_0x4473c5['previousSibling'],'data-id')}):_0x58b1f2['push']({'node':_0x4473c5,'type':'removed','id':_0x3b39ee});return!0x0;},this['parsedMergedContent']),_0x58b1f2=_0x58b1f2['filter'](({node:_0x19d86d})=>[...Pi(_0x19d86d),_0x19d86d]['every'](_0x1b6bec=>!ut(_0x1b6bec,'data-unstable'))),0x0==_0x58b1f2['length'])return;const _0x354cca=[[_0x58b1f2[0x0]]];for(let _0x3703b6=0x1;_0x3703b6<_0x58b1f2['length'];_0x3703b6++){const _0x2ebaaf=_0x354cca[_0x354cca['length']-0x1],_0x386a1c=_0x2ebaaf[_0x2ebaaf['length']-0x1];_0x58b1f2[_0x3703b6]['node']['previousSibling']==_0x386a1c['node']&&'modified'!=_0x58b1f2[_0x3703b6]['type']&&'modified'!=_0x386a1c['type']?_0x2ebaaf['push'](_0x58b1f2[_0x3703b6]):_0x354cca['push']([_0x58b1f2[_0x3703b6]]);}for(const _0x1adeaf of _0x354cca){const _0x32da46=_0x1adeaf[0x0],_0x30bc9d=_0x1adeaf[_0x1adeaf['length']-0x1],_0x23d8e2=_0x3c6c02(_0x32da46['node']['previousSibling']);_0x23d8e2&&_0x1adeaf['unshift'](_0x23d8e2);const _0x353455=_0x3c6c02(_0x30bc9d['node']['nextSibling']);_0x353455&&_0x1adeaf['push'](_0x353455);}function _0x1207d5(_0x652775){return _0x1d5fe8['modifiedNodeIds']['includes'](_0x652775)||_0x1d5fe8['newNodeIds']['includes'](_0x652775)||_0x1d5fe8['removedNodeIds']['includes'](_0x652775);}function _0x3c6c02(_0x2a017f){if(_0x2a017f&&ut(_0x2a017f,'data-id')&&!ut(_0x2a017f,'data-unstable')){const _0x368775=ut(_0x2a017f,'data-id');if(!_0x1207d5(_0x368775))return{'node':_0x2a017f,'type':'context','id':_0x368775};}return null;}this['changeGroups']=_0x354cca['map']((_0x2f03d9,_0x4727eb)=>({'changes':_0x2f03d9,'state':'pending','index':_0x4727eb}));}}const ze=['interactionCreated','interactionStarted','interactionStopped','interactionFinished','interactionDestroyed','replyCreated','replyContentUpdated','replyChangeGroupStateUpdated','setConversationTitle','webSearchStarted','webSearchFinished','reasoningStarted','reasoningFinished','toolDataReceived','error'];class os extends _0xa7ecb2(){['id'];['replies']=[];['currentReply'];['messageId'];['actionCallId'];['currentRequest'];['connector'];['isStopped']=!0x1;['isDestroyed']=!0x1;['editor'];['_isReasoning']=!0x1;['_isWebSearching']=!0x1;constructor({connector:_0x3ff4f6,editor:_0x22081b}){super(),this['id']=_0x677d44(),this['connector']=_0x3ff4f6,this['isStopped']=!0x0,this['editor']=_0x22081b;}async['start'](){const _0x10693d=[];let _0x774d7e,_0xc88c67,_0x182ca4;this['isStopped']=!0x1;try{this['currentRequest']=await this['sendRequest'](),this['fire']('interactionStarted',this);const _0x2d9416=await this['currentRequest']['getStream']();for await(const _0x602d82 of _0x2d9416){if(this['isStopped'])return;if('error'==_0x602d82['event'])return void this['fire']('error',{'error':new _0x25c351('ai-chat-interaction-error',this)});switch(_0x602d82['event']){case'message-metadata':this['messageId']=_0x602d82['data']['messageId'];break;case'action-metadata':this['actionCallId']=_0x602d82['data']['callId'];break;case'conversation-title':this['setConversationTitle'](_0x602d82['data']['conversationTitle'],!0x0);break;case'source':_0x10693d['push'](_0x602d82['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'](),_0x774d7e='modification-delta'==_0x602d82['event']?'modification':'text',_0xc88c67='modification-delta'==_0x602d82['event']?_0x602d82['data']['id']:void 0x0,this['currentReply']&&this['currentReply']['type']!=_0x774d7e&&(this['currentReply']['done'](),this['currentReply']=void 0x0),this['currentReply']||(this['currentReply']=this['createReply']({'type':_0x774d7e,'interactionId':this['id'],'id':_0xc88c67}),'modification'==_0x774d7e&&(this['currentReply']['sources']=_0x10693d['splice'](0x0))),this['currentReply']['appendContent'](_0x602d82['data']['textDelta']);break;case'mcp-tool-result':_0x182ca4=JSON['parse'](_0x602d82['data']['result']),this['_handleToolResultData']({'toolName':_0x602d82['data']['toolName'],'data':_0x182ca4['data'],'attributes':_0x182ca4['attributes']});break;case'mcp-tool-notification':this['_handleToolNotificationData']({'toolName':_0x602d82['data']['toolName'],'data':_0x602d82['data']['data']});}}}finally{this['isStopped']||(this['currentReply']&&_0x10693d['length']>0x0&&(this['currentReply']['sources']=_0x10693d['splice'](0x0)),this['_finalizeInteraction'](),this['fire']('interactionFinished',this));}}['stop'](){this['isStopped']||(this['_finalizeInteraction'](),this['fire']('interactionStopped',this));}['getReply'](_0x3db956){return this['replies']['find'](_0x6830a5=>_0x6830a5['id']===_0x3db956);}['destroy'](){this['isDestroyed']||(this['stop'](),this['replies']['forEach'](_0x21fb1b=>_0x21fb1b['destroy']()),this['replies']=[],this['isDestroyed']=!0x0,this['fire']('interactionDestroyed',this),this['stopListening']());}['createReply'](_0x1d39b7){const _0x478f24=new xi({'editor':this['editor'],'documentContextContent':this['getDocumentContext']()?.['content'],..._0x1d39b7});return this['replies']['push'](_0x478f24),_0x478f24['delegate'](...ze)['to'](this),this['fire']('replyCreated',_0x478f24),_0x478f24;}['setConversationTitle'](_0x644b0c,_0x3e485a=!0x1){this['fire']('setConversationTitle',_0x644b0c,_0x3e485a);}['resetWebSearchState'](){this['_isWebSearching']&&(this['_isWebSearching']=!0x1,this['fire']('webSearchFinished',this));}['resetReasoningState'](){this['_isReasoning']&&(this['_isReasoning']=!0x1,this['fire']('reasoningFinished',this));}['_handleToolResultData'](_0xa9f3e0){this['fire']('toolDataReceived',{'type':'result','toolName':_0xa9f3e0['toolName'],'data':structuredClone(_0xa9f3e0['data']||{}),'attributes':structuredClone(_0xa9f3e0['attributes']||{})},this);}['_handleToolNotificationData'](_0x7c5063){this['fire']('toolDataReceived',{'type':'notification','toolName':_0x7c5063['toolName'],'data':structuredClone(_0x7c5063['data'])},this);}['_finalizeInteraction'](){this['isStopped']=!0x0,this['currentRequest']&&this['currentRequest']['abortController']['abort'](),this['currentReply']&&this['currentReply']['done'](),this['currentRequest']=this['currentReply']=void 0x0;}}var Fe=function(_0x3726ce){return _0x3726ce['TOOL']='mcp-tool-context',_0x3726ce['FILE']='file',_0x3726ce['DOCUMENT']='document',_0x3726ce['URL']='web-resource',_0x3726ce['TEXT']='text',_0x3726ce['SELECTION']='selection',_0x3726ce;}({}),Oe=function(_0x1d12ef){return _0x1d12ef['TEXT']='text',_0x1d12ef['MARKDOWN']='markdown',_0x1d12ef['HTML']='html',_0x1d12ef;}({});const $e=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']]),Je=['contextItemAdded','contextItemRemoved','contextItemLoadingEnded','contextSent','error','addContextOptionsChanged','sourceResourcesLoaded','resourceStateChanged','uploadProgressChanged'];class He extends ts(){['_connector'];['_config'];['_ownerId'];constructor({connector:_0x402377,config:_0x39acaa,ownerId:_0x125bce}){super(),this['_connector']=_0x402377,this['_config']=_0x39acaa,this['_ownerId']=_0x125bce;}['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'](_0x512563){const _0x119370=await this['_createContextItemFromContent'](_0x512563);return this['_addToConversationContextItem'](_0x119370),'current-document'===_0x119370['uiId']&&this['_toggleAddCurrentDocumentOptionVisibility'](),_0x119370;}async['_createContextItemFromContent'](_0x5e11b8){if(_0x5e11b8['type']===Fe['DOCUMENT']){const _0x378f76=await this['_connector']['fetchDocument'](this['_ownerId'],_0x5e11b8['id'])['getDocument']();return{'id':'current-document','uiId':'current-document','label':'Current\x20document','type':_0x5e11b8['type'],'content':_0x378f76['content'],'hidden':this['_conversationContextItems']['has']('current-document'),'version':_0x378f76['attributes']?.['version'],'sessionId':_0x378f76['attributes']?.['sessionId']};}if(_0x5e11b8['type']===Fe['TOOL'])return{'id':_0x5e11b8['id'],'uiId':_0x5e11b8['id'],'label':_0x5e11b8['data']?.['label']||_0x5e11b8['id'],'type':Fe['TOOL'],'mcpServerName':_0x5e11b8['mcpServerName'],'toolName':_0x5e11b8['toolName'],'data':_0x5e11b8['data']||{}};return{'id':_0x5e11b8['id'],'uiId':_0x5e11b8['id'],'label':_0x5e11b8['attributes']?.['label']||_0x5e11b8['name']||_0x5e11b8['url']||_0x5e11b8['id'],'type':_0x5e11b8['type'],..._0x5e11b8?.['attributes']?.['resourceId']?{'resourceId':_0x5e11b8['attributes']?.['resourceId']}:{}};}['getSentContextItems'](){return new Map(this['_conversationContextItems']);}['removeFromContext'](_0x839a){const _0x12f2d1=this['_pendingContextItems']['get'](_0x839a);_0x12f2d1?.['isReadOnly']||this['_removeContextItem'](_0x839a);}['clearPendingContextItems'](){if(0x0===this['_pendingContextItems']['size'])return;for(const _0x58a8f5 of this['_pendingContextItems']['values']())this['_removeContextItem'](_0x58a8f5['uiId']);const _0x4f5331=this['_conversationContextItems']['get']('current-document')||this['_pendingContextItems']['get']('current-document');_0x4f5331&&this['_addContextItem']({..._0x4f5331,'isReadOnly':!0x0,'hidden':!0x0});}['addToConversationContext'](_0x1c4a0a){for(const _0x6d520f of _0x1c4a0a['values']())this['_addToConversationContextItem'](_0x6d520f);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'](_0x5c4bfe){return Array['from'](_0x5c4bfe['values']())['map'](_0x584cbc=>this['_mapContextItemToRequestData'](_0x584cbc))['filter'](_0x2bd831=>null!==_0x2bd831);}async['addFilesToContext'](_0x214453,_0x45bc8e,_0x317935=Fe['FILE']){const _0x2bc8c8='files-'+_0x677d44();this['_startUploadOperation'](_0x2bc8c8);try{await Promise['all'](_0x214453['map'](async _0x1977b7=>{const _0x496cbe='file-'+_0x677d44(),_0x1f1822=_0x4ae586(_0x1977b7['name']);try{this['_addContextItem']({'type':_0x317935,'label':_0x45bc8e?.['label']||_0x1f1822,'uiId':_0x496cbe,'resourceId':_0x45bc8e?.['resourceId']},!0x0);const _0x1a1999=this['_connector']['uploadFile'](this['_ownerId'],_0x1977b7,_0x45bc8e);this['_ongoingUploads']['set'](_0x496cbe,_0x1a1999['abortController']);const {id:_0x47778d}=await _0x1a1999['getId']();this['_ongoingUploads']['delete'](_0x496cbe),this['_finishContextItemLoading']({'type':_0x317935,'id':_0x47778d,'label':_0x45bc8e?.['label']||_0x1f1822,'uiId':_0x496cbe,'resourceId':_0x45bc8e?.['resourceId']},!0x1);}catch(_0xdad72e){this['_ongoingUploads']['delete'](_0x496cbe);if(!(_0xdad72e instanceof _0x25c351&&_0xdad72e['message']['startsWith']('ai-request-aborted'))){const _0xd90706=$e['get'](_0xdad72e['code'])||'ai-chat-file-upload-failed',_0x120676=new _0x25c351(_0xd90706,null,{'fileName':_0x1f1822,..._0xdad72e});_0x120676['stack']=_0xdad72e['stack'],this['fire']('error',{'error':_0x120676});}this['_removeContextItem'](_0x496cbe);}}));}finally{this['_finishUploadOperation'](_0x2bc8c8);}}['addCurrentDocumentToContext'](_0x5d23b9){if(this['isCurrentDocumentInContext']()||!this['_addContextOptionsState']['document']['enabled'])return;const _0x3df0bb={'type':Fe['DOCUMENT'],'uiId':'current-document','label':_0x5d23b9,'isReadOnly':this['_conversationContextItems']['has']('current-document'),'hidden':this['_conversationContextItems']['has']('current-document')};this['_addContextItem'](_0x3df0bb);}async['updateCurrentDocument'](_0x38f5c0,_0x307f11,_0x4a35a6,_0x3eb5bf){const _0x3816b1=this['_pendingContextItems']['get']('current-document');if(_0x3816b1&&_0x38f5c0){_0x3816b1['selection']=_0x3eb5bf?_0x3eb5bf['map'](_0x11b76f=>({'start':_0x11b76f['start'],'end':_0x11b76f['end']})):[];try{if(_0x3816b1['version']===_0x307f11)return;const {id:_0x2f1ea9}=await this['_connector']['uploadDocument'](this['_ownerId'],_0x38f5c0,{'version':_0x307f11,'sessionId':_0x4a35a6})['getId']();_0x3816b1['id']=_0x2f1ea9,_0x3816b1['content']=_0x38f5c0,_0x3816b1['version']=_0x307f11,_0x3816b1['sessionId']=_0x4a35a6;}catch(_0x354112){const _0x859fa0=new _0x25c351('ai-chat-document-upload-failed',null);_0x859fa0['stack']=_0x354112['stack'],this['fire']('error',{'error':_0x859fa0});}}}['addSelectionToContext'](_0x2bffa6){this['_addContextItem']({'type':Fe['SELECTION'],'label':_0x2bffa6,'uiId':'selection','content':_0x2bffa6});}['removeSelectionFromContext'](){this['_removeContextItem']('selection');}async['addUrlToContext'](_0x36e9ed,_0x4ae064){const _0x2debf2='url-'+_0x677d44();this['_startUploadOperation'](_0x2debf2);const _0x69a65b='url-'+_0x677d44();try{this['_addContextItem']({'type':Fe['URL'],'label':_0x4ae064?.['label']||_0x36e9ed,'uiId':_0x69a65b,'resourceId':_0x4ae064?.['resourceId']},!0x0);const _0x33acca=this['_connector']['uploadUrl'](this['_ownerId'],_0x36e9ed,_0x4ae064);this['_ongoingUploads']['set'](_0x69a65b,_0x33acca['abortController']);const {id:_0x573f41}=await _0x33acca['getId']();this['_ongoingUploads']['delete'](_0x69a65b),this['_finishContextItemLoading']({'type':Fe['URL'],'id':_0x573f41,'label':_0x4ae064?.['label']||_0x36e9ed,'uiId':_0x69a65b,'resourceId':_0x4ae064?.['resourceId']},!0x1);}catch(_0x2f14c2){this['_ongoingUploads']['delete'](_0x69a65b),(_0x2f14c2['message']['startsWith']('ai-request-aborted')||this['fire']('error',{'error':new _0x25c351('ai-chat-url-upload-failed',this,{'url':_0x36e9ed,'originalError':_0x2f14c2}),'url':_0x36e9ed}),this['_removeContextItem'](_0x69a65b));}finally{this['_finishUploadOperation'](_0x2debf2);}}['addToolItemToContext'](_0x1181df){_0x1181df['id']=_0x1181df['id']??_0x677d44()['substring'](0x0,0x15),this['_pendingContextItems']['set'](_0x1181df['uiId'],_0x1181df),this['fire']('contextItemAdded',{'contextItem':_0x1181df,'isLoading':!0x1});}async['loadSourceResources'](_0x552fe8,_0x2b5493,_0x397ee7){const _0x30f58c=this['_addContextOptionsState']['sources']['find'](_0x1ad02c=>_0x1ad02c['id']===_0x552fe8);if(!_0x30f58c)return this['fire']('error',{'error':new _0x25c351('ai-chat-source-not-found',this,{'sourceId':_0x552fe8}),'sourceId':_0x552fe8}),[];try{const _0x3cede5=(await _0x30f58c['getResources'](_0x2b5493))['map'](_0x20c9be=>{const _0x24cef8=this['_isResourceInContext'](_0x20c9be['id']);return{..._0x20c9be,'isInContext':_0x24cef8};});return _0x30f58c['resources']=_0x3cede5,this['fire']('sourceResourcesLoaded',{'sourceId':_0x552fe8,'source':_0x30f58c,'resources':_0x3cede5,'uid':_0x397ee7}),_0x3cede5;}catch(_0x2aeb06){return this['fire']('error',{'error':new _0x25c351('ai-chat-source-resources-load-failed',this,{'sourceId':_0x552fe8,'originalError':_0x2aeb06}),'sourceId':_0x552fe8,'sourceLabel':_0x30f58c['label']}),[];}}async['addResourceToContext'](_0x1a368f,_0x3f2ae5){if(this['_isResourceInContext'](_0x3f2ae5['id']))return;let _0x377cc7=_0x3f2ae5['data'];if(!_0x377cc7&&_0x1a368f['getData'])try{_0x377cc7=await _0x1a368f['getData'](_0x3f2ae5['id']);}catch(_0x882358){return void this['fire']('error',{'error':new _0x25c351('ai-chat-resource-load-failed',this,{'resourceId':_0x3f2ae5['id'],'sourceId':_0x1a368f['id'],'originalError':_0x882358}),'resourceId':_0x3f2ae5['id'],'sourceId':_0x1a368f['id']});}if(_0x377cc7)switch(_0x3f2ae5['type']){case Fe['URL']:if('string'!=typeof _0x377cc7)return void this['fire']('error',{'error':new _0x25c351('ai-chat-context-invalid-data',this,{'resourceId':_0x3f2ae5['id'],'sourceId':_0x1a368f['id'],'expectedType':'string','actualType':typeof _0x377cc7}),'resourceId':_0x3f2ae5['id'],'sourceId':_0x1a368f['id']});await this['addUrlToContext'](_0x377cc7,{'label':_0x3f2ae5['label'],'resourceId':_0x3f2ae5['id']});break;case Fe['FILE']:if(!(_0x377cc7 instanceof File))return void this['fire']('error',{'error':new _0x25c351('ai-chat-context-invalid-data',this,{'resourceId':_0x3f2ae5['id'],'sourceId':_0x1a368f['id'],'expectedType':'File','actualType':typeof _0x377cc7}),'resourceId':_0x3f2ae5['id'],'sourceId':_0x1a368f['id']});await this['addFilesToContext']([_0x377cc7],{'label':_0x3f2ae5['label'],'resourceId':_0x3f2ae5['id']});break;case Fe['TEXT']:if('object'!=typeof _0x377cc7||!('content'in _0x377cc7)||!('type'in _0x377cc7))return void this['fire']('error',{'error':new _0x25c351('ai-chat-context-invalid-data',this,{'resourceId':_0x3f2ae5['id'],'sourceId':_0x1a368f['id'],'expectedType':'object\x20with\x20content\x20and\x20type\x20properties','actualType':typeof _0x377cc7}),'resourceId':_0x3f2ae5['id'],'sourceId':_0x1a368f['id']});_0x377cc7=He['_convertTextResourceToFile'](_0x377cc7,_0x3f2ae5['label']),await this['addFilesToContext']([_0x377cc7],{'label':_0x3f2ae5['label'],'resourceId':_0x3f2ae5['id']},Fe['TEXT']);break;case Fe['TOOL']:break;default:this['fire']('error',{'error':new _0x25c351('ai-chat-context-unsupported-type',this,{'resourceId':_0x3f2ae5['id'],'sourceId':_0x1a368f['id'],'resourceType':_0x3f2ae5['type']}),'resourceId':_0x3f2ae5['id'],'sourceId':_0x1a368f['id']});}else this['fire']('error',{'error':new _0x25c351('ai-chat-resource-no-data',this,{'resourceId':_0x3f2ae5['id'],'sourceId':_0x1a368f['id']}),'resourceId':_0x3f2ae5['id'],'sourceId':_0x1a368f['id']});}static['_convertTextResourceToFile'](_0x2b5c90,_0x4cdc97){switch(_0x2b5c90['type']){case Oe['MARKDOWN']:return new File([_0x2b5c90['content']],_0x4cdc97,{'type':'text/markdown'});case Oe['HTML']:return new File([_0x2b5c90['content']],_0x4cdc97,{'type':'text/html'});default:return new File([_0x2b5c90['content']],_0x4cdc97,{'type':'text/plain'});}}static['_mapContextItemToRequestData'](_0x38d5b6){switch(_0x38d5b6['type']){case Fe['FILE']:return{'type':Fe['FILE'],'id':_0x38d5b6['id']};case Fe['URL']:return{'type':Fe['URL'],'id':_0x38d5b6['id']};case Fe['DOCUMENT']:return{'type':Fe['DOCUMENT'],'id':_0x38d5b6['id'],..._0x38d5b6['selection']?.['length']&&{'selection':_0x38d5b6['selection']}};case Fe['TEXT']:return{'type':Fe['FILE'],'id':_0x38d5b6['id']};case Fe['TOOL']:{const _0x6b9f16=_0x38d5b6;return{'type':Fe['TOOL'],'mcpServerName':_0x6b9f16['mcpServerName'],'toolName':_0x6b9f16['toolName'],'data':_0x6b9f16['data'],'id':_0x6b9f16['id']};}default:return null;}}['_addContextItem'](_0x9c58d3,_0xbc8db2=!0x1){if(this['_pendingContextItems']['set'](_0x9c58d3['uiId'],_0x9c58d3),_0x9c58d3['hidden']||this['fire']('contextItemAdded',{'contextItem':_0x9c58d3,'isLoading':_0xbc8db2}),'current-document'===_0x9c58d3['uiId']&&this['_toggleAddCurrentDocumentOptionVisibility'](),_0x9c58d3['resourceId']){const _0x1aea47=this['_findSourceIdsByResourceId'](_0x9c58d3['resourceId']);_0x1aea47&&_0x1aea47['forEach'](_0x500866=>{this['_updateResourceInContextState'](_0x500866,_0x9c58d3['resourceId'],!0x0);});}}['_removeContextItem'](_0x539141){const _0x2090b5=this['_pendingContextItems']['get'](_0x539141),_0xe0a648=this['_ongoingUploads']['get'](_0x539141);if(_0xe0a648&&(_0xe0a648['abort'](),this['_ongoingUploads']['delete'](_0x539141)),_0x2090b5?.['resourceId']){const _0x1068f3=this['_findSourceIdsByResourceId'](_0x2090b5['resourceId']);_0x1068f3&&_0x1068f3['forEach'](_0xe9f6b=>{this['_updateResourceInContextState'](_0xe9f6b,_0x2090b5['resourceId'],!0x1);});}this['_pendingContextItems']['delete'](_0x539141),this['fire']('contextItemRemoved',{'uiId':_0x539141,'type':_0x2090b5?.['type']}),'current-document'===_0x539141&&this['_toggleAddCurrentDocumentOptionVisibility']();}['_finishContextItemLoading'](_0x29d1a8,_0x1ff0d3){if(this['_pendingContextItems']['has'](_0x29d1a8['uiId'])&&(this['_pendingContextItems']['set'](_0x29d1a8['uiId'],_0x29d1a8),this['fire']('contextItemLoadingEnded',{'contextItem':_0x29d1a8,'isLoading':_0x1ff0d3}),_0x29d1a8['resourceId'])){const _0x1d669f=this['_findSourceIdsByResourceId'](_0x29d1a8['resourceId']);_0x1d669f&&_0x1d669f['forEach'](_0x301d0=>{this['_updateResourceInContextState'](_0x301d0,_0x29d1a8['resourceId'],!0x0);});}}['_addToConversationContextItem'](_0x395657){this['_conversationContextItems']['set'](_0x395657['uiId'],_0x395657);}['_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'](_0x1ff5ed=>({..._0x1ff5ed,'enabled':!0x0}))??[]},this['fire']('addContextOptionsChanged',{'options':this['_addContextOptionsState']});}['_getCustomSourcesInitialState'](){return this['_config']?.['sources']?.['map'](_0x1e9829=>({..._0x1e9829,'resources':[]}))??[];}['_toggleAddCurrentDocumentOptionVisibility'](){const _0x3df7f3=this['isCurrentDocumentInContext']()||this['isCurrentDocumentInConversation']();this['_addContextOptionsState']['document']['isHidden']=_0x3df7f3,this['fire']('addContextOptionsChanged',{'options':this['_addContextOptionsState']});}['_isResourceInContext'](_0x44b619){for(const _0x5cecbf of this['_pendingContextItems']['values']())if(_0x5cecbf['resourceId']===_0x44b619)return!0x0;for(const _0x436f83 of this['_conversationContextItems']['values']())if(_0x436f83['resourceId']===_0x44b619)return!0x0;return!0x1;}['_findSourceIdsByResourceId'](_0x4b17ab){const _0x438985=[];for(const _0x5e6f19 of this['_addContextOptionsState']['sources']){_0x5e6f19['resources']['find'](_0xe46925=>_0xe46925['id']===_0x4b17ab)&&_0x438985['push'](_0x5e6f19['id']);}return 0x0===_0x438985['length']?null:_0x438985;}['_updateResourceInContextState'](_0x5415be,_0x736ca9,_0x5cf437){const _0x16b8b9=this['_addContextOptionsState']['sources']['find'](_0x2aa112=>_0x2aa112['id']===_0x5415be);if(!_0x16b8b9)return;const _0x1f1850=_0x16b8b9['resources']['find'](_0xcf790c=>_0xcf790c['id']===_0x736ca9);_0x1f1850&&(_0x1f1850['isInContext']=_0x5cf437,this['fire']('resourceStateChanged',{'sourceId':_0x5415be,'resourceId':_0x736ca9,'isInContext':_0x5cf437}));}['_startUploadOperation'](_0x3ed64e){this['_ongoingUploadOperations']['set'](_0x3ed64e,!0x0),this['_ongoingUploadOperations']['size']&&this['fire']('uploadProgressChanged',{'isUploadInProgress':!0x0});}['_finishUploadOperation'](_0x26903f){this['_ongoingUploadOperations']['delete'](_0x26903f),0x0===this['_ongoingUploadOperations']['size']&&this['fire']('uploadProgressChanged',{'isUploadInProgress':!0x1});}}const Ge=['capabilitiesUpdated'];class Be extends _0xa7ecb2(){['_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'](_0x42e77d){const _0x56bfb6={};return _0x42e77d&&_0x42e77d['isWebSearchEnabled']&&(_0x56bfb6['webSearch']={}),_0x42e77d&&_0x42e77d['isReasoningEnabled']&&(_0x56bfb6['reasoning']={}),_0x56bfb6;}['toggleWebSearch'](){this['setWebSearch'](!this['_isWebSearchEnabled']);}['toggleReasoning'](){this['setReasoning'](!this['_isReasoningEnabled']);}['setWebSearch'](_0x529482){_0x529482!==this['_isWebSearchEnabled']&&(this['_isWebSearchEnabled']=_0x529482,this['fire']('capabilitiesUpdated',this['getCapabilitiesConfig']()));}['setReasoning'](_0x2ad146){_0x2ad146!==this['_isReasoningEnabled']&&(this['_isReasoningEnabled']=_0x2ad146,this['fire']('capabilitiesUpdated',this['getCapabilitiesConfig']()));}}class Ke extends os{['userMessage'];['conversationId'];['contextItems']=new Map();['model'];['attributes'];constructor(_0x5cb419){super(_0x5cb419),this['conversationId']=_0x5cb419['conversationId'],this['contextItems']=_0x5cb419['contextItems'],this['capabilities']=_0x5cb419['capabilities'],this['userMessage']=_0x5cb419['userMessage'],this['model']=_0x5cb419['model'],this['attributes']=_0x5cb419['attributes'];}async['sendRequest'](){return this['connector']['queryAssistant']({'message':this['userMessage'],'conversationId':this['conversationId'],'parts':He['mapContextItemsToRequestData'](this['contextItems']),'capabilities':Be['getCapabilitiesRequestData'](this['capabilities']),'model':this['model'],'attributes':this['attributes']});}['getDocumentContext'](){return this['contextItems']['get']('current-document');}}class st extends _0xa7ecb2(){['id'];['isStarted']=!0x1;['isFromHistory'];['interactions']=[];['currentInteraction'];['selectedModel'];['connector'];['options'];constructor(_0x55aa90){super(),this['options']=_0x55aa90,this['connector']=_0x55aa90['connector'],this['chatModels']=_0x55aa90['chatModels'],this['id']=_0x55aa90['conversationId'],this['isFromHistory']=_0x55aa90['isFromHistory'];}async['init'](_0x1187d5){try{this['chatContext']=new He({'connector':this['connector'],'config':_0x1187d5,'ownerId':this['id']}),this['chatContext']['delegate'](...Je)['to'](this),this['chatContext']['init'](),this['chatCapabilities']=new Be(),this['chatCapabilities']['delegate'](...Ge)['to'](this),this['chatCapabilities']['init']();const _0x1783f1=await this['chatModels']['getAvailableModels']();this['fire']('conversationInitialized',{'availableModels':_0x1783f1});const _0x4f6310=await this['chatModels']['getModel'](this['options']['selectedModelId']);_0x4f6310&&await this['setModel'](_0x4f6310);}catch(_0x5acb18){const _0x262b0b=new _0x25c351('ai-chat-conversation-init-failed',null,{'message':_0x5acb18['message']||_0x5acb18});_0x262b0b['stack']=_0x5acb18['stack'],this['fire']('error',{'error':_0x262b0b});}}async['start'](){if(this['isStarted'])throw new _0x25c351('ai-chat-conversation-already-started',null,{'conversation':this});if(!this['selectedModel'])throw new _0x25c351('ai-chat-conversation-start-no-model-selected',null,{'conversation':this});try{const {id:_0x35739d}=await this['connector']['startConversation'](this['id'],this['options']['group'])['getConversation']();this['id']=_0x35739d,this['isStarted']=!0x0,this['fire']('conversationStarted',{'conversationId':this['id'],'selectedModel':this['selectedModel']});}catch(_0x1aa9ce){const _0x10e6bd=new _0x25c351('ai-chat-conversation-start-failed',null,{'message':_0x1aa9ce['message'],'conversationId':this['id']});throw _0x10e6bd['stack']=_0x1aa9ce['stack'],this['fire']('error',{'error':_0x10e6bd}),_0x10e6bd;}}async['load'](_0x21dac5,_0x45c67e){try{const _0x34b369=await this['connector']['fetchConversation'](_0x21dac5)['getConversation'](),_0xea10fe=await this['connector']['fetchConversationMessages'](_0x21dac5)['getMessages'](),_0x16f2de=_0xea10fe[0x0]['model'];this['isStarted']=!0x0,this['id']=_0x34b369['id'],'title'in _0x34b369?this['fire']('setConversationTitle',_0x34b369['title'],!0x0):this['fire']('setConversationTitle','',!0x0);const _0x2caa61=(await this['chatModels']['getAll']())['find'](_0x28bd83=>_0x28bd83['id']['toLowerCase']()===_0x16f2de['toLowerCase']());return this['selectedModel']=_0x2caa61,this['fire']('modelSelected',{'selectedModel':_0x2caa61,'isDisabled':!0x0}),await this['_processMessagesToInteractions'](_0xea10fe,_0x45c67e,_0x16f2de),this['currentInteraction']=void 0x0,this;}catch(_0x3e7ea0){const _0x320d71=new _0x25c351('ai-chat-conversation-init-from-id-failed',null,{'message':_0x3e7ea0['message'],'conversationId':_0x21dac5});throw _0x320d71['stack']=_0x3e7ea0['stack'],this['fire']('error',{'error':_0x320d71}),_0x320d71;}}async['_processMessagesToInteractions'](_0x361842,_0x4cc86a,_0x178428){let _0xb39702;for(const _0x3a006e of _0x361842)if('user'===_0x3a006e['role']){const _0x207083=await this['_extractContextItems'](_0x3a006e),_0x299295={'isReasoningEnabled':Object['hasOwn'](_0x3a006e['capabilities'],'reasoning'),'isWebSearchEnabled':Object['hasOwn'](_0x3a006e['capabilities'],'webSearch')};_0xb39702=this['createInteraction']({'userMessage':_0x3a006e['prompt'],'contextItems':_0x207083,'capabilities':_0x299295,'modelId':_0x178428,'attributes':_0x3a006e['attributes']}),this['currentInteraction']=_0xb39702,this['chatContext']['addToConversationContext'](this['currentInteraction']['contextItems']);}else{if('assistant'===_0x3a006e['role']&&_0xb39702){const _0x30dfe9=[];for(const _0xf10248 of _0x3a006e['content'])switch(_0xf10248['type']){case'text':case'modification':{const _0x52f96d=_0xb39702['getDocumentContext']()?.['sessionId']!==_0x4cc86a;_0xb39702['currentReply']=_0xb39702['createReply']({'type':_0xf10248['type'],'isDone':!0x0,'interactionId':_0xb39702['id'],'areActionsDisabled':_0x52f96d}),_0xb39702['currentReply']['appendContent'](_0xf10248['content']),_0x30dfe9['length']>0x0&&(_0xb39702['currentReply']['sources']=_0x30dfe9['splice'](0x0));break;}case'url':_0x30dfe9['push'](_0xf10248);break;case'mcp-tool-result':{const {data:_0x190b48,attributes:_0x526bb2}=JSON['parse'](_0xf10248['content']);_0xb39702['_handleToolResultData']({'toolName':_0xf10248['toolName'],'data':_0x190b48,'attributes':_0x526bb2});break;}}}}}async['_extractContextItems'](_0xfc65ae){const _0x2c82b6=new Map();if(!_0xfc65ae['content'])return _0x2c82b6;for(const _0x3bce62 of _0xfc65ae['content']){const _0x17c98c=await this['chatContext']['populateFromMessage'](_0x3bce62);_0x17c98c&&_0x2c82b6['set'](_0x17c98c['id'],_0x17c98c);}return _0x2c82b6;}async['handleUserInteraction']({userMessage:_0x2207af,attributes:_0x50bc59}){if(!this['isStarted'])throw new _0x25c351('ai-chat-handle-user-conversation-not-initialized',null,{'conversation':this});if(this['currentInteraction'])throw new _0x25c351('ai-chat-handle-user-interaction-already-in-progress',null,{'conversation':this});try{const _0x16bade=this['chatContext']['getPendingContextItems'](),_0x51171b=this['chatCapabilities']['getCapabilitiesConfig'](),_0x42f0e6=this['selectedModel']['id'];this['currentInteraction']=this['createInteraction']({'userMessage':_0x2207af,'contextItems':_0x16bade,'capabilities':_0x51171b,'modelId':_0x42f0e6,'attributes':_0x50bc59}),await this['currentInteraction']['start'](),this['chatContext']['addToConversationContext'](this['currentInteraction']['contextItems']);}catch(_0x55d0e8){if(_0x55d0e8 instanceof _0x25c351)this['fire']('error',{'interactionId':this['currentInteraction']?this['currentInteraction']['id']:void 0x0,'error':_0x55d0e8});else{const _0x53f995=$e['get'](_0x55d0e8['code'])||'ai-chat-handle-user-interaction-start-failed';this['fire']('error',{'interactionId':this['currentInteraction']?this['currentInteraction']['id']:void 0x0,'error':new _0x25c351(_0x53f995,null,{'error':_0x55d0e8})});}}finally{this['currentInteraction']?.['stop'](),this['currentInteraction']=void 0x0;}}['createInteraction']({userMessage:_0xea7fc1,contextItems:_0x5af465,capabilities:_0x16a1c9,modelId:_0x557a9f,attributes:_0x48d92e}){const _0x547a29=new Ke({'userMessage':_0xea7fc1,'contextItems':_0x5af465,'capabilities':_0x16a1c9,'conversationId':this['id'],'connector':this['connector'],'editor':this['options']['getEditor']&&this['options']['getEditor'](),'model':_0x557a9f,'attributes':_0x48d92e});return _0x547a29['delegate'](...ze)['to'](this),this['interactions']['push'](_0x547a29),this['fire']('interactionCreated',_0x547a29),_0x547a29;}['getInteraction'](_0x42c326){return this['interactions']['find'](_0x197f88=>_0x197f88['id']===_0x42c326);}['removeInteraction'](_0x36b724){const _0x261695=this['getInteraction'](_0x36b724);_0x261695&&(_0x261695['destroy'](),this['interactions']['splice'](this['interactions']['indexOf'](_0x261695),0x1));}get['lastInteraction'](){return this['interactions'][this['interactions']['length']-0x1];}['addCurrentDocumentToContext'](_0x1cdc4a){this['chatContext']['addCurrentDocumentToContext'](_0x1cdc4a);}async['updateCurrentDocumentInContext']({content:_0x17699e,version:_0x2fb1ec,sessionId:_0x29ec9e,selections:_0xb70b64}){await this['chatContext']['updateCurrentDocument'](_0x17699e,_0x2fb1ec,_0x29ec9e,_0xb70b64);}['getCurrentDocumentContext'](){return this['currentInteraction']?.['getDocumentContext']()?.['content']||'';}['addSelectionToContext'](_0x2a462f){this['chatContext']['addSelectionToContext'](_0x2a462f);}['removeSelectionFromContext'](){this['chatContext']['removeSelectionFromContext']();}['addFilesToContext'](_0xe73299){this['chatContext']['addFilesToContext'](_0xe73299);}['addUrlToContext'](_0x3aefdd){this['chatContext']['addUrlToContext'](_0x3aefdd);}['addToolItemToContext'](_0x3c33f0){this['chatContext']['addToolItemToContext'](_0x3c33f0);}['addResourceToContext'](_0x5da821,_0x29e946){this['chatContext']['addResourceToContext'](_0x5da821,_0x29e946);}['loadSourceResources'](_0x21519b,_0x54103,_0x217d55){return this['chatContext']['loadSourceResources'](_0x21519b,_0x54103,_0x217d55);}['removeFromContext'](_0xf53298){this['chatContext']['removeFromContext'](_0xf53298);}['setWebSearch'](_0x84c0d7){this['chatCapabilities']['setWebSearch'](_0x84c0d7);}['toggleWebSearch'](){this['chatCapabilities']['toggleWebSearch']();}['setReasoning'](_0x123fe2){this['chatCapabilities']['setReasoning'](_0x123fe2);}['toggleReasoning'](){this['chatCapabilities']['toggleReasoning']();}['isCurrentDocumentInContext'](){return this['chatContext']['isCurrentDocumentInContext']();}['isCurrentDocumentInConversation'](){return this['chatContext']['isCurrentDocumentInConversation']();}['isSelectionInContext'](){return this['chatContext']['isSelectionInContext']();}async['setModel'](_0x49b0c5){_0x49b0c5?!0x1===await this['chatModels']['isAvailable'](_0x49b0c5)&&(_0x1c9a23('ai-chat-conversation-set-model-not-available',{'conversation':this,'model':_0x49b0c5}),_0x49b0c5=(await this['chatModels']['getAvailableModels']())[0x0]):(_0x1c9a23('ai-chat-conversation-set-model-null',{'conversation':this}),_0x49b0c5=(await this['chatModels']['getAvailableModels']())[0x0]),_0x49b0c5['id']!==this['selectedModel']?.['id']&&(this['selectedModel']=_0x49b0c5,this['chatCapabilities']['reset'](),this['fire']('modelSelected',{'selectedModel':_0x49b0c5}));}}class et extends _0xa7ecb2(){['_connector'];['_config'];['_locale'];['_modelList']=[];['_modelsRequest']=null;constructor({connector:_0x52ed3f,config:_0x33b300,locale:_0x4393ef}){super(),this['_connector']=_0x52ed3f,this['_config']=_0x33b300,this['_locale']=_0x4393ef;}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 _0x1cb3df=await this['getAll']();let _0x40f703;return _0x40f703=this['_availableModels']?this['_filterModels'](_0x1cb3df,this['_availableModels']):_0x1cb3df['filter'](_0x54e235=>_0x54e235['recommended']),_0x40f703;}async['getModel'](_0x2d5acb){const _0xd8c862=await this['getAll']();if(!_0xd8c862['length'])return null;if(_0x2d5acb){const _0x192db8=this['_getModelById'](_0xd8c862,_0x2d5acb);if(_0x192db8)return _0x192db8;_0x1c9a23('ai-chat-model-id-unrecognized',{'modelId':_0x2d5acb,'fallBackModelId':this['_defaultModelId']});}return this['getDefault']();}async['getDefault'](){const _0xeec13e=await this['getAvailableModels']();if(!_0xeec13e['length'])return null;if(this['_defaultModelId']){const _0x3463d6=this['_getModelById'](_0xeec13e,this['_defaultModelId']);if(_0x3463d6)return _0x3463d6;_0x1c9a23('ai-chat-default-model-id-unrecognized',{'defaultModelId':this['_defaultModelId'],'fallBackModelId':_0xeec13e[0x0]['id']});}return _0xeec13e[0x0];}async['isAvailable'](_0x151a2d){return(await this['getAvailableModels']())['some'](_0x2a13ae=>_0x2a13ae['name']===_0x151a2d['name']&&_0x2a13ae['provider']===_0x151a2d['provider']);}async['_retrieveModels'](){if(!this['_modelList']['length'])try{const _0xeb0f37=this['_locale']['uiLanguage']||'en',_0x5f1fc9=this['_connector']['getModels'](_0xeb0f37),_0x47c7a2=await _0x5f1fc9['list']();this['_modelList']=_0x47c7a2['items']['map'](_0x2f1a77=>Bi(_0x2f1a77)?{..._0x2f1a77,'name':h(this['_locale'],'AI_MODEL_NAME_AUTO')}:_0x2f1a77);}catch(_0x5b79bb){throw _0x2d18bd('ai-models-unable-to-retrieve',{'error':_0x5b79bb}),_0x5b79bb;}return[...this['_modelList']];}['_filterModels'](_0x52e404,_0x193a85){let _0x11ea09;if(_0x193a85){_0x11ea09=[];const _0xc6961a=new Set(),_0x4cc9e0='string'==typeof _0x193a85?[_0x193a85['toLocaleLowerCase']()]:_0x193a85['map'](_0x443d17=>_0x443d17['toLocaleLowerCase']());for(const _0x5d9237 of _0x4cc9e0)for(const _0x4ce499 of _0x52e404)!_0xc6961a['has'](_0x4ce499['id'])&&this['_isMatchingFilter'](_0x4ce499,_0x5d9237)&&(_0x11ea09['push'](_0x4ce499),_0xc6961a['add'](_0x4ce499['id']));}else _0x11ea09=_0x52e404;return _0x11ea09;}['_isMatchingFilter'](_0x5a0a3d,_0x3fa534){const _0x2b856d=_0x5a0a3d['id']['toLocaleLowerCase'](),_0x51285e=_0x5a0a3d['name']['toLocaleLowerCase'](),_0x1e14a1=_0x5a0a3d['provider']['toLocaleLowerCase']();return _0x2b856d===_0x3fa534||_0x51285e===_0x3fa534||Bi(_0x5a0a3d)&&'auto'===_0x3fa534||_0x1e14a1===_0x3fa534||_0x2b856d['startsWith'](_0x3fa534);}['_getModelById'](_0xf3075a,_0x2ab44c){return _0xf3075a['find'](_0x495161=>Bi(_0x495161)&&'auto'===_0x2ab44c?_0x495161:_0x495161['id']===_0x2ab44c)||null;}}function Bi(_0xbf70a4){return _0xbf70a4['id']['startsWith']('agent');}function c(_0x1e1388){if(_0x1e1388 instanceof _0x39b2a6)return _0x1e1388;if(_0x1e1388?.['editors']&&_0x1e1388['editors']['get'](0x0))return _0x1e1388['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.'),_0x1e1388['editors']['get'](0x0);throw new _0x25c351('ai-get-editor-from-context-no-editor');}function at({editor:_0x42e2ca,interaction:_0x46cbb0,reply:_0x52f478,groups:_0x2328d7,transform:_0xb42ecd,documentCompare:_0x224cc5,documentCompareOptions:_0x10b788}){const _0x5c8cc7=_0x46cbb0['getDocumentContext']();if(!_0x5c8cc7)return[];const _0xf8ebfc=_0x5c8cc7['content'],_0x978f=_0x5c8cc7['version'],_0x16847b=_0x52f478['documentContextContent']['cloneNode'](!0x0);for(const {changes:_0x504e90}of _0x2328d7){const _0x1f311b=_0x504e90['filter'](_0x30e1ff=>'new'!=_0x30e1ff['type'])['map'](_0x1c1ab3=>It('data-id',_0x1c1ab3['id'],_0x16847b)),_0x86a592=_0x504e90['filter'](_0x44070d=>'removed'!=_0x44070d['type'])['map'](_0x45add1=>_0x45add1['node']['cloneNode'](!0x0));let _0x24fa8e=null;if(_0x1f311b['length']){_0x24fa8e=_0x1f311b[0x0]['previousSibling'];for(let _0x571fe6=0x0;_0x571fe6<_0x1f311b['length'];_0x571fe6++)_0x210a44(_0x1f311b[_0x571fe6]);}if(_0x86a592['length']){_0x24fa8e||(_0x504e90[0x0]['anchorId']?_0x24fa8e=It('data-id',_0x504e90[0x0]['anchorId'],_0x16847b):(_0x24fa8e=_0x86a592['shift'](),_0x2cb06e(_0x16847b,_0x24fa8e)));for(let _0x2056c0=0x0;_0x2056c0<_0x86a592['length'];_0x2056c0++)_0x40b605(_0x24fa8e,_0x86a592[_0x2056c0]),_0x24fa8e=_0x86a592[_0x2056c0];}}const _0x57add7=pt(_0x16847b),_0x5b7c4a=_0x224cc5['getDiff'](_0xf8ebfc,_0x57add7,_0x10b788)['getOperations']();if(_0xb42ecd){const _0x378a93=_0x42e2ca['model']['document']['history']['getOperations'](_0x978f),_0x157f86={'document':_0x42e2ca['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1};return xt(_0x5b7c4a,_0x378a93,_0x157f86)['operationsA'];}return _0x5b7c4a;}function rt(_0x5eaec8,_0x58047f){if('marker'!=_0x58047f['type'])return;const _0x4f4ba7=_0x5eaec8['model']['markers']['get'](_0x58047f['name']);_0x4f4ba7&&(_0x58047f['oldRange']=_0x4f4ba7['getRange']());}class S extends _0x5dcf5b{['_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 _0x1c4f1c(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 _0x540ae9=this['context']['plugins']['get']('AITabs');this['listenTo'](this['_aiChatUi'],'startConversation',()=>{this['_startConversationSafely']();}),this['listenTo'](this['_aiChatUi'],'sendUserMessage',(_0x41666a,_0x501aad)=>{this['_handleUIUserMessage']({'userMessage':_0x501aad});}),this['listenTo'](_0x540ae9,'resizedTabs',(_0x49d779,_0xaf3f6c)=>{this['_setIsMaximized'](_0xaf3f6c);}),this['listenTo'](this['_aiChatUi'],'resizeTabs',()=>{_0x540ae9['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',(_0x2bd943,_0x47d151)=>{this['activeConversation']?.['addFilesToContext'](Array['from'](_0x47d151));}),this['listenTo'](this['_aiChatUi'],'addUrlToContext',(_0x5781f0,_0x54c9b3)=>{this['activeConversation']?.['addUrlToContext'](_0x54c9b3);}),this['listenTo'](this['_aiChatUi'],'executeCustomItemCallback',(_0x266c0b,_0x56196f)=>{_0x56196f['callback'](this['context']);}),this['listenTo'](this['_aiChatUi'],'addResourceToContext',(_0x161586,_0x3531e2)=>{this['activeConversation']?.['addResourceToContext'](_0x3531e2['source'],_0x3531e2['resource']);}),this['listenTo'](this['_aiChatUi'],'removeContextItem',(_0x2dc175,_0x2fef0a)=>{this['_removeFromContext'](_0x2fef0a);}),this['listenTo'](this['_aiChatUi'],'loadSourceResources',(_0x39f967,_0x4296e2)=>{this['activeConversation']?.['loadSourceResources'](_0x4296e2['sourceId'],_0x4296e2['query'],_0x4296e2['uid']);}),this['listenTo'](this['_aiChatUi'],'toggleWebSearch',()=>{this['_toggleWebSearch']();}),this['listenTo'](this['_aiChatUi'],'toggleReasoning',()=>{this['_toggleReasoning']();}),this['listenTo'](this['_aiChatUi'],'selectModel',(_0x51cb54,_0x1854c8)=>{this['activeConversation']?.['setModel'](_0x1854c8);}),this['listenTo'](this['_aiChatUi'],'like',(_0x1d162b,{replyId:_0x3444a7})=>{console['log']('Liked\x20response',_0x3444a7);}),this['listenTo'](this['_aiChatUi'],'dislike',(_0xad7715,{replyId:_0x5aa59a})=>{console['log']('Disliked\x20response',_0x5aa59a);}),this['listenTo'](this['_aiChatUi'],'insertSuggestion',(_0x4dc4c8,_0x3f7b4c)=>{this['_insertSuggestion'](_0x3f7b4c);}),this['listenTo'](this['_aiChatUi'],'showChangeInText',(_0x35c5c1,{replyId:_0xaf9715,partIndex:_0x3b41c9})=>{this['_aiChatBalloonShowDiff']=this['_aiChatUi']['showDiff'],this['_openBalloonFor'](_0xaf9715,_0x3b41c9);}),this['listenTo'](this['_aiChatUi'],'mouseOverSuggestion',(_0x2f48b9,{replyId:_0x2e1d42,partIndex:_0x51ec9f})=>{const _0x34138a=this['_getDocumentRangeForReplyChanges'](_0x2e1d42,_0x51ec9f);_0x34138a&&'$graveyard'!=_0x34138a['range']['root']['rootName']&&this['_aiEditing']['showFakeVisualSelection']([_0x34138a['range']],'ai-chat-controller-mouse-over');}),this['listenTo'](this['_aiChatUi'],'mouseLeaveSuggestion',()=>{this['_aiEditing']['hideFakeVisualSelection']('ai-chat-controller-mouse-over');}),this['listenTo'](this['_aiChatUi'],'applySuggestion',(_0x5b622c,_0x598448)=>{this['_aiEditing']['hideFakeVisualSelection']('ai-chat-controller-mouse-over'),this['_applySuggestion'](_0x598448);}),this['listenTo'](this['_aiChatUi'],'toggleSuggestionDisplayMode',async(_0x269a8a,{replyId:_0x32eaf6,showDiff:_0x4e265f})=>{const {reply:_0xdd31ca}=this['getInteractionAndReplyById'](_0x32eaf6),_0x32305a=_0xdd31ca['getContentParts']({'showDiff':_0x4e265f});await this['_aiChatUi']['updateFeedItemAIReplySuggestionContent']({'id':_0xdd31ca['id'],'parts':_0x32305a,'renderingStrategy':'static'});}),this['listenTo'](this['_aiChatUi'],'rejectSuggestion',(_0x4a4de6,{replyId:_0x21034d,partIndex:_0x147409})=>{this['_rejectSuggestion']({'replyId':_0x21034d,'partIndex':_0x147409}),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:_0x4d2a34,partIndex:_0x1ed686}=this['_currentPreviewedChangeGroup'];this['_aiChatBalloonShowDiff']=!this['_aiChatBalloonShowDiff'];const {reply:_0x55d986}=this['getInteractionAndReplyById'](_0x4d2a34),_0x57f8a2=_0x55d986['getContentParts']({'showDiff':this['_aiChatBalloonShowDiff'],'groupIndex':_0x1ed686});this['_aiChatBalloon']['updateContent']({'part':_0x57f8a2[0x0],'renderingStrategy':'static','keepErrors':!0x0});}),this['listenTo'](this['_aiChatBalloon'],'applySuggestion',()=>{const {replyId:_0x1c7c7b,partIndex:_0xdc3b25}=this['_currentPreviewedChangeGroup'];this['_applySuggestion']({'replyId':_0x1c7c7b,'partIndex':_0xdc3b25}),this['_aiChatBalloon']['setState']('accepted');}),this['listenTo'](this['_aiChatBalloon'],'insertSuggestion',()=>{const {replyId:_0x3b46d0,partIndex:_0x2de61d}=this['_currentPreviewedChangeGroup'];this['_insertSuggestion']({'replyId':_0x3b46d0,'partIndex':_0x2de61d}),this['_aiChatBalloon']['setState']('accepted');}),this['listenTo'](this['_aiChatBalloon'],'rejectSuggestion',()=>{const {replyId:_0x443f98,partIndex:_0x572e2e}=this['_currentPreviewedChangeGroup'];this['_rejectSuggestion']({'replyId':_0x443f98,'partIndex':_0x572e2e}),this['_aiChatBalloon']['setState']('rejected');}),this['listenTo'](this['_aiChatBalloon'],'showNext',()=>{const {replyId:_0x1b83ec,partIndex:_0x57834a}=this['_currentPreviewedChangeGroup'],_0x451d08=this['_getPresentableSiblingContentPartIndex'](_0x1b83ec,_0x57834a,'next');null!==_0x451d08&&this['_openBalloonFor'](_0x1b83ec,_0x451d08);}),this['listenTo'](this['_aiChatBalloon'],'showPrevious',()=>{const {replyId:_0x11a29a,partIndex:_0x5e3e64}=this['_currentPreviewedChangeGroup'],_0x543396=this['_getPresentableSiblingContentPartIndex'](_0x11a29a,_0x5e3e64,'previous');null!==_0x543396&&this['_openBalloonFor'](_0x11a29a,_0x543396);}),this['listenTo'](this['_aiChatBalloon'],'dialogClosed',(_0x11b15e,{id:_0x36ed29})=>{if('aiChatBalloon'!==_0x36ed29)return;const {replyId:_0x5aa8dd,partIndex:_0x39b4b0}=this['_currentPreviewedChangeGroup'];this['_currentPreviewedChangeGroup']=null,this['_aiChatUi']['setFeedItemAIReplySuggestionPartActive']({'id':_0x5aa8dd,'index':_0x39b4b0,'isActive':!0x1});}));}async['afterInit'](){this['context']instanceof _0x39b2a6?this['_integrateEditor'](this['context']):this['listenTo'](this['context']['editors'],'add',(_0xedc983,_0x310f72)=>{_0x310f72['on']('ready',()=>{this['_integrateEditor'](_0x310f72);});});const _0x57a168=this['context']['config']['get']('ai.chat.initialConversation');let _0x2f0ebe=_0x57a168;if('lastCreated'!=_0x57a168||(_0x2f0ebe=await this['_getLastCreatedConversationId'](),_0x2f0ebe))return'new'==_0x2f0ebe?this['_startConversationSafely']():this['loadConversation'](_0x2f0ebe);}async['destroy'](){return await this['_stopLastInteraction'](),this['_bodyCollection']['detachFromDom'](),super['destroy']();}['_insertSuggestion'](_0x38aea5){const _0x3e2eec=c(this['context']);if(!_0x3e2eec['plugins']['has']('TrackChanges'))throw new _0x25c351('ai-no-track-changes',null);const _0x106c8c=this['context']['plugins']['get']('DocumentCompare'),{reply:_0x43f03b,interaction:_0x3f1323}=this['getInteractionAndReplyById'](_0x38aea5['replyId']),_0xaa91d9=this['_getDocumentRangeForReplyChanges'](_0x38aea5['replyId'],_0x38aea5['partIndex']),_0x530cf4=void 0x0!==_0x38aea5['partIndex']?[_0x43f03b['changeGroups'][_0x38aea5['partIndex']]]:_0x43f03b['changeGroups']['filter'](_0xe51dca=>'pending'==_0xe51dca['state']),_0x70b7d4=_0x530cf4['map'](_0x120c53=>_0x43f03b['changeGroups']['indexOf'](_0x120c53));if(!_0xaa91d9||'$graveyard'==_0xaa91d9['range']['root']['rootName'])return void _0x70b7d4['forEach'](_0x134fd1=>_0x43f03b['setChangeGroupState'](_0x134fd1,'outdated'));_0x70b7d4['forEach'](_0x1e5bf8=>_0x43f03b['setChangeGroupState'](_0x1e5bf8,'accepted'));const _0x5917a3=at({'editor':_0x3e2eec,'reply':_0x43f03b,'interaction':_0x3f1323,'groups':_0x530cf4,'transform':!0x0,'documentCompare':_0x106c8c,'documentCompareOptions':{'anchor':'main','markDeletions':!0x0}});let _0x1b469f;_0xaa91d9&&this['_scrollToSuggestionRange'](_0xaa91d9['range']),_0x3e2eec['model']['change'](_0x5e5d4f=>{_0x1b469f=_0x5e5d4f['batch'],_0x3e2eec['plugins']['get']('TrackChangesEditing')['_applyOperationsAsSuggestions'](_0x5917a3),this['_aiEditing']['hideFakeVisualSelection']('ai-chat-controller-mouse-over');}),this['_batchToChanges']['set'](_0x1b469f,{'interactionId':_0x3f1323['id'],'replyId':_0x43f03b['id'],'indexes':_0x70b7d4['slice']()}),this['_updateRatings'](_0x43f03b);}['_applySuggestion'](_0x1d8c94){const _0x40b534=c(this['context']),_0x455ec9=this['context']['plugins']['get'](ot),{reply:_0x16fabe,interaction:_0x27b026}=this['getInteractionAndReplyById'](_0x1d8c94['replyId']),_0x348aab=this['_getDocumentRangeForReplyChanges'](_0x1d8c94['replyId'],_0x1d8c94['partIndex']),_0x47c2e8=void 0x0!==_0x1d8c94['partIndex']?[_0x16fabe['changeGroups'][_0x1d8c94['partIndex']]]:_0x16fabe['changeGroups']['filter'](_0x4d9304=>'pending'==_0x4d9304['state']),_0x1036a0=_0x47c2e8['map'](_0x261e5a=>_0x16fabe['changeGroups']['indexOf'](_0x261e5a));if(!_0x348aab||'$graveyard'==_0x348aab['range']['root']['rootName'])return void _0x1036a0['forEach'](_0x31e025=>_0x16fabe['setChangeGroupState'](_0x31e025,'outdated'));_0x1036a0['forEach'](_0x239e13=>_0x16fabe['setChangeGroupState'](_0x239e13,'accepted'));const _0x58dc4d=at({'editor':_0x40b534,'reply':_0x16fabe,'interaction':_0x27b026,'groups':_0x47c2e8,'transform':!0x0,'documentCompare':_0x455ec9,'documentCompareOptions':{'anchor':'main','markDeletions':!0x1}});let _0x54ad6d;_0x348aab&&this['_scrollToSuggestionRange'](_0x348aab['range']),_0x40b534['model']['change'](_0x3a1011=>{_0x54ad6d=_0x3a1011['batch'];for(const _0x11a93b of _0x58dc4d)_0x11a93b['baseVersion']=_0x40b534['model']['document']['version'],rt(_0x40b534,_0x11a93b),_0x3a1011['batch']['addOperation'](_0x11a93b),_0x40b534['model']['applyOperation'](_0x11a93b);}),this['_batchToChanges']['set'](_0x54ad6d,{'interactionId':_0x27b026['id'],'replyId':_0x16fabe['id'],'indexes':_0x1036a0['slice']()}),this['_updateRatings'](_0x16fabe);}['_rejectSuggestion'](_0x1b6af5){const {reply:_0x5de01c}=this['getInteractionAndReplyById'](_0x1b6af5['replyId']);_0x5de01c['setChangeGroupState'](_0x1b6af5['partIndex'],'rejected');}['_openBalloonFor'](_0x55d187,_0x5690a2){if(!this['_aiChatBalloon'])return;const {reply:_0x5c1a07}=this['getInteractionAndReplyById'](_0x55d187),_0x49b82e=_0x5c1a07['getContentParts']({'showDiff':this['_aiChatBalloonShowDiff']});let _0x19e50a,_0x4bd5a6;if(void 0x0!==_0x5690a2?(_0x4bd5a6=_0x49b82e['find'](_0x5a25ed=>_0x5a25ed['index']==_0x5690a2),_0x19e50a=_0x4bd5a6?.['index']):(_0x4bd5a6=_0x49b82e[0x0],_0x19e50a=_0x4bd5a6['index']),this['_currentPreviewedChangeGroup']?.['replyId']==_0x55d187&&this['_currentPreviewedChangeGroup']?.['partIndex']==_0x19e50a)return;const _0x4caebf=this['_getUserPresentableContentPartDocumentRange'](_0x55d187,_0x5c1a07,_0x4bd5a6);if(!_0x4caebf)return void this['_aiChatBalloon']['close']();this['_currentPreviewedChangeGroup']={'replyId':_0x55d187,'partIndex':_0x19e50a},this['_scrollToSuggestionRange'](_0x4caebf,!0x0);const _0x10f092=this['_getPresentableSiblingContentPartIndex'](_0x55d187,_0x19e50a,'next');this['_aiChatBalloon']['updateContent']({'part':_0x4bd5a6,'renderingStrategy':'static'}),this['_aiChatBalloon']['open']({'index':_0x19e50a,'title':h(this['context']['locale'],'AI_BALLOON_HEADER_TITLE',(_0x19e50a+0x1)['toString']()),'showRotator':null!==_0x10f092,'ranges':[_0x4caebf],'areActionsDisabled':_0x5c1a07['areActionsDisabled']}),this['_aiChatBalloon']['setState']('pending'),this['_aiChatUi']['scrollFeedToSuggestion'](_0x55d187,_0x19e50a),this['_aiChatUi']['setFeedItemAIReplySuggestionPartActive']({'id':_0x55d187,'index':_0x19e50a,'isActive':!0x0});}['_getPresentableSiblingContentPartIndex'](_0x3f528c,_0x38b958,_0x4567d5){const {reply:_0x4643fb}=this['getInteractionAndReplyById'](_0x3f528c),_0x552f61=_0x4643fb['getContentParts']({'showDiff':this['_aiChatBalloonShowDiff']});if(0x1==_0x552f61['length'])return null;const _0x2db74c=_0x552f61['findIndex'](_0x4be2b1=>_0x4be2b1['index']==_0x38b958),_0x4c3b8b='next'==_0x4567d5?0x1:-0x1;let _0x16e229=_0x552f61['at']((_0x2db74c+_0x4c3b8b)%_0x552f61['length'])['index'],_0x3c8d4f=_0x552f61[_0x16e229];for(;!this['_getUserPresentableContentPartDocumentRange'](_0x3f528c,_0x4643fb,_0x3c8d4f);){if(_0x16e229=_0x552f61['at']((_0x16e229+_0x4c3b8b)%_0x552f61['length'])['index'],_0x16e229===_0x2db74c)return null;_0x3c8d4f=_0x552f61[_0x16e229];}return _0x16e229;}['_getUserPresentableContentPartDocumentRange'](_0x3499bb,_0x2ea043,_0x2d253b){const _0x227224=_0x2ea043['changeGroups'];if(!_0x2d253b['hasChanges'])return null;const _0x49590c=_0x227224['find'](_0x4fd885=>_0x4fd885['index']==_0x2d253b['index']);if('pending'!==_0x49590c?.['state'])return null;const _0x139d16=this['_getDocumentRangeForReplyChanges'](_0x3499bb,_0x2d253b['index']);if(!_0x139d16)return null;const {range:_0x2db6de,currentIndex:_0x112944}=_0x139d16;return'$graveyard'==_0x2db6de['root']['rootName']?(_0x2ea043['setChangeGroupState'](_0x112944,'outdated'),null):_0x139d16['range'];}['_getDocumentRangeForReplyChanges'](_0x2eb181,_0x217218){const _0xb0d7d8=c(this['context']),{reply:_0x40a2f0,interaction:_0x294b1b}=this['getInteractionAndReplyById'](_0x2eb181),_0x3380fa=_0x40a2f0['changeGroups']['filter'](_0x50cd80=>'pending'==_0x50cd80['state']),_0x198760=_0x3380fa['map'](_0x1474c9=>_0x40a2f0['changeGroups']['indexOf'](_0x1474c9));void 0x0===_0x217218&&(_0x217218=_0x198760[0x0]);const _0x187e1b=_0x198760['indexOf'](_0x217218);if(-0x1==_0x187e1b)return null;const _0x2b55c3=_0x3380fa[_0x187e1b],_0x410c9b=new _t([]),_0x3c8cda=new _t([]);for(const _0x4d2c8a of _0x2b55c3['changes'])if('removed'!=_0x4d2c8a['type']&&_0x3c8cda['children']['push'](_0x4d2c8a['node']['cloneNode'](!0x0)),'new'!=_0x4d2c8a['type']){const _0x161152=gt(_0x4859ea=>ut(_0x4859ea,'data-id')==_0x4d2c8a['id'],_0x40a2f0['documentContextContent'],!0x0);_0x410c9b['children']['push'](_0x161152['cloneNode'](!0x0));}if(0x0==_0x410c9b['children']['length']){if(_0x2b55c3['changes'][0x0]['anchorId']){const _0x33b104=It('data-id',_0x2b55c3['changes'][0x0]['anchorId'],_0x40a2f0['documentContextContent']);_0x410c9b['children']['unshift'](_0x33b104['cloneNode'](!0x0)),_0x3c8cda['children']['unshift'](_0x33b104['cloneNode'](!0x0)),_0x33b104['nextSibling']&&(_0x410c9b['children']['push'](_0x33b104['nextSibling']['cloneNode'](!0x0)),_0x3c8cda['children']['push'](_0x33b104['nextSibling']['cloneNode'](!0x0)));}else{const _0x2d74b2=_0x40a2f0['documentContextContent']['children'][0x0];if(!_0x2d74b2)return null;_0x410c9b['children']['push'](_0x2d74b2['cloneNode'](!0x0)),_0x3c8cda['children']['push'](_0x2d74b2['cloneNode'](!0x0));}}const _0x33f058=_0x294b1b['getDocumentContext'](),_0x46d0ac=_0xb0d7d8['data']['parse'](_0x33f058['content']),_0x4f1dae=pt(_0x410c9b),_0x39a699=_0xb0d7d8['data']['parse'](_0x4f1dae),_0x5b0e1e=_0xb0d7d8['data']['parse'](_0x4f1dae),_0x37c6a8=_0xb0d7d8['model']['createPositionAt'](_0x39a699,0x0),_0x1fa4a3=pt(_0x3c8cda),_0x5c0254={'anchor':_0x37c6a8,'markDeletions':!0x1},_0x5bf455=_0xb0d7d8['plugins']['get'](ot)['getDiff'](_0x4f1dae,_0x1fa4a3,_0x5c0254)['getOperations']();if(!_0x5bf455['length'])return null;_0xb0d7d8['model']['change'](_0x2439b1=>{for(const _0x109e2c of _0x5bf455)if('remove'==_0x109e2c['type']){const _0x9d39f6=_0x109e2c['sourcePosition'],_0x544694=_0x109e2c['howMany'],_0x3d2acf=new lt(_0x9d39f6,_0x544694);_0x2439b1['batch']['addOperation'](_0x3d2acf),_0xb0d7d8['model']['applyOperation'](_0x3d2acf);}else'marker'!==_0x109e2c['type']&&(_0x109e2c['baseVersion']=null,_0x109e2c['isDocumentOperation']=!0x1,_0x2439b1['batch']['addOperation'](_0x109e2c),_0xb0d7d8['model']['applyOperation'](_0x109e2c));});const _0x300e61=ct(_0xb0d7d8,_0x5bf455,_0x39a699);ht(_0xb0d7d8['model'],_0x300e61);const _0x4a2e10=_0x300e61['getFirstRange']()['start']['path']['slice'](),_0x166955=_0x300e61['getFirstRange']()['end']['path']['slice'](),_0x509be1=[];let _0x5997bf=_0x39a699,_0x3031e7=_0x5b0e1e;for(let _0x574d60=0x0;_0x574d60<_0x166955['length'];_0x574d60++){const _0x23cf5f=_0x5997bf['maxOffset']-_0x166955[_0x574d60];_0x509be1[_0x574d60]=_0x3031e7['maxOffset']-_0x23cf5f,_0x5997bf=_0x5997bf['getChildAtOffset'](_0x166955[_0x574d60]),_0x3031e7=_0x3031e7['getChildAtOffset'](_0x509be1[_0x574d60]);}const _0x4467da=_0xb0d7d8['model']['createRange'](_0xb0d7d8['model']['createPositionFromPath'](_0x5b0e1e,_0x4a2e10),_0xb0d7d8['model']['createPositionFromPath'](_0x5b0e1e,_0x509be1)),_0x17400c=_0x5b0e1e['getChild'](0x0)['getAttribute'](nt),_0x66b07a=Array['from'](_0x46d0ac['getChildren']())['find'](_0x409b3c=>_0x409b3c['getAttribute'](nt)==_0x17400c)['getPath'](),_0x51128a=_0x4467da['start']['path']['slice'](),_0x32d8ad=_0x4467da['end']['path']['slice']();_0x51128a[0x0]=_0x66b07a[0x0]+_0x51128a[0x0],_0x32d8ad[0x0]=_0x66b07a[0x0]+_0x32d8ad[0x0];let _0x340489=_0xb0d7d8['model']['createRange'](_0xb0d7d8['model']['createPositionFromPath'](_0xb0d7d8['model']['document']['getRoot'](),_0x51128a),_0xb0d7d8['model']['createPositionFromPath'](_0xb0d7d8['model']['document']['getRoot'](),_0x32d8ad));const _0x4ac660=_0xb0d7d8['model']['document']['history']['getOperations'](_0x33f058['version']);for(const _0x5d07cc of _0x4ac660)_0x340489=dt['_createFromRanges'](_0x340489['getTransformedByOperation'](_0x5d07cc));return{'range':_0x340489,'currentIndex':_0x217218};}['_integrateEditor'](_0xcd2065){if(!_0xcd2065['plugins']['has']('Undo'))return;const _0x2af199=_0xcd2065['commands']['get']('undo'),_0x1daaf7=_0xcd2065['commands']['get']('redo');this['listenTo'](_0x2af199,'revert',(_0x34863c,_0x1ecb71,_0x282d2b)=>{const _0x3d93d0=this['_batchToChanges']['get'](_0x1ecb71);if(!_0x3d93d0)return;const _0x3baf46=this['activeConversation']['getInteraction'](_0x3d93d0['interactionId'])['getReply'](_0x3d93d0['replyId']);_0x3d93d0['indexes']['forEach'](_0x1145a0=>_0x3baf46['setChangeGroupState'](_0x1145a0,'pending')),this['_batchToChanges']['delete'](_0x1ecb71),this['_batchToChanges']['set'](_0x282d2b,_0x3d93d0);}),this['listenTo'](_0x1daaf7,'revert',(_0x3d32a6,_0xb26ba6,_0x219136)=>{const _0x450305=this['_batchToChanges']['get'](_0xb26ba6);if(!_0x450305)return;const _0x49a3d8=this['activeConversation']['getInteraction'](_0x450305['interactionId'])['getReply'](_0x450305['replyId']);_0x450305['indexes']['forEach'](_0x3e093e=>_0x49a3d8['setChangeGroupState'](_0x3e093e,'accepted')),this['_batchToChanges']['delete'](_0xb26ba6),this['_batchToChanges']['set'](_0x219136,_0x450305);});}async['loadConversation'](_0x2c9445){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'](_0x2c9445)['getConversation'](),await this['_startConversationSafely'](_0x2c9445),this['updateConversationTitle']('\x20'),await this['activeConversation']['load'](_0x2c9445,this['_aiEditing']['sessionId']),this['activeConversation']['isCurrentDocumentInConversation']()&&this['addCurrentDocumentToChatContext']();}catch(_0x1492c5){this['_aiChatUi']['addFeedItemError']({'errorMessage':h(this['context']['locale'],'AI_CHAT_UNABLE_TO_LOAD_CONVERSATION'),'id':_0x2c9445}),this['_logError'](new _0x25c351('ai-chat-conversation-not-found',this,{'error':_0x1492c5}));}finally{this['_aiChatUi']['startAutoScroll'](),this['_aiChatUi']['setFeedItemRenderingStrategy']('streaming'),this['_aiChatUi']['toggleLoadingSkeleton'](!0x1);}}async['_getLastCreatedConversationId'](){const _0x4aba3e=this['_aiConnector']['fetchConversations'](this['getGroupId'](),{'limit':0x1,'sortBy':'createdAt'});try{const _0x8fe66e=await _0x4aba3e['getConversations']();return _0x8fe66e['length']?_0x8fe66e[0x0]['id']:'new';}catch(_0x234c7c){return this['_aiChatUi']['addFeedItemError']({'errorMessage':h(this['context']['locale'],'AI_CHAT_UNABLE_TO_LOAD_CONVERSATION'),'id':_0x677d44()}),this['_logError'](new _0x25c351('ai-chat-conversation-init-failed',this,{'error':_0x234c7c})),this['_aiChatUi']['toggleLoadingSkeleton'](!0x1),this['_aiChatUi']['disableControls'](),null;}}['handleRemovedConversation'](_0x49bbda){this['activeConversation']['id']===_0x49bbda&&this['_startConversationSafely']();}['addCurrentDocumentToChatContext'](){this['activeConversation']?.['addCurrentDocumentToContext'](h(this['context']['locale'],'AI_CHAT_CONTEXT_CURRENT_DOCUMENT'));}async['addSelectionToChatContext'](){const _0x566313=this['_aiEditing']['getSelectionText']();this['activeConversation']?.['addSelectionToContext'](_0x566313),this['addCurrentDocumentToChatContext']();}['removeSelectionFromChatContext'](){this['activeConversation']?.['removeSelectionFromContext']();}['focusPromptInput'](){this['_aiChatUi']['focusPromptInput']();}async['startConversation'](){await this['_startConversationSafely']();}async['sendMessage']({message:_0x3275d0,attributes:_0x17a4cf}){await this['_handleUIUserMessage']({'userMessage':_0x3275d0,'attributes':_0x17a4cf});}['getGroupId'](){const _0x260ed4=this['context']['config']['get']('collaboration.channelId');if(!_0x260ed4)throw new _0x25c351('ai-chat-missing-channel-id',this);return _0x260ed4;}async['_startConversationSafely'](_0xc18b94){try{this['_aiChatUi']['enableControls'](),await this['_handleStartConversation'](_0xc18b94);}catch(_0xdd571b){this['_aiChatUi']['addFeedItemError']({'errorMessage':h(this['context']['locale'],'AI_CHAT_UNABLE_TO_START_CONVERSATION'),'id':_0xc18b94||_0x677d44()}),console['error'](_0xdd571b),this['activeConversation']=void 0x0,this['_aiChatUi']['disableControls']();}}async['_handleStartConversation'](_0x5a824c){let _0x2c1a33;this['context']['plugins']['has']('AIChatBalloon')&&this['context']['plugins']['get']('AIChatBalloon')['close'](),_0x5a824c||!this['activeConversation']?_0x2c1a33=this['context']['config']['get']('ai.models.defaultModelId'):this['_aiChatUi']['isModelAvailable']&&(_0x2c1a33=this['activeConversation']['selectedModel']['id']),await this['_stopLastInteraction']();const _0x2405c2=this['getGroupId'](),_0x40438f=_0x5a824c||_0x677d44();this['activeConversation']=new st({'connector':this['_aiConnector'],'chatModels':this['_aiChatModels'],'selectedModelId':_0x2c1a33,'conversationId':_0x40438f,'group':_0x2405c2,'getEditor':()=>c(this['context']),'isFromHistory':!!_0x5a824c}),this['activeConversation']['delegate']('toolDataReceived','interactionStarted')['to'](this),this['activeConversation']['on']('conversationInitialized',(_0x8b5007,_0x169a28)=>{this['_aiChatUi']['createConversation'](_0x169a28),this['_aiChatUi']['resetMessageInput'](),this['_aiChatUi']['clearPendingContextUI'](),this['_aiChatUi']['clearConversationContextUI'](),_0x5a824c||(this['_aiChatUi']['resetConversationTitle'](),this['addCurrentDocumentToChatContext']());}),this['activeConversation']['on']('uploadProgressChanged',(_0x21404f,_0x1cf1fd)=>{this['_aiChatUi']['setIsUploadInProgress'](_0x1cf1fd['isUploadInProgress']);}),this['activeConversation']['on']('interactionCreated',(_0x13576b,_0x3a0a85)=>{this['_aiChatUi']['addFeedItemUserMessage'](_0x3a0a85);}),this['activeConversation']['on']('webSearchStarted',()=>{const _0x161eeb=this['_aiChatUi']['prepareLoadingMessage']({'isWebSearchEnabled':!0x0,'isReasoningEnabled':!0x1});this['_aiChatUi']['setLoadingMessage'](_0x161eeb);}),this['activeConversation']['on']('reasoningStarted',()=>{const _0x4e2732=this['_aiChatUi']['prepareLoadingMessage']({'isWebSearchEnabled':!0x1,'isReasoningEnabled':!0x0});this['_aiChatUi']['setLoadingMessage'](_0x4e2732);}),this['activeConversation']['on']('webSearchFinished',(_0x18f4d3,_0x26d20b)=>{this['_aiChatUi']['addFeedInteractionHeader'](_0x26d20b,{'isWebSearchEnabled':!0x0,'isReasoningEnabled':!0x1});}),this['activeConversation']['on']('reasoningFinished',(_0x1c9036,_0x213fb7)=>{this['_aiChatUi']['addFeedInteractionHeader'](_0x213fb7,{'isWebSearchEnabled':!0x1,'isReasoningEnabled':!0x0});}),this['activeConversation']['on']('interactionStarted',()=>{this['_aiChatUi']['startInteraction']();}),this['activeConversation']['on']('interactionFinished',async()=>{await this['_aiChatUi']['finishInteraction']();}),this['activeConversation']['on']('interactionDestroyed',(_0x4a89d4,_0x133df0)=>{this['_aiChatUi']['removeFeedInteraction'](_0x133df0['id']);}),this['activeConversation']['on']('setConversationTitle',(_0x14c18f,_0x4aeff1,_0x2f7c79)=>{this['updateConversationTitle'](_0x4aeff1,_0x2f7c79);}),this['activeConversation']['on']('replyCreated',(_0x23f101,_0x515c88)=>{'text'===_0x515c88['type']?this['_aiChatUi']['addFeedItemAIReply'](_0x515c88):this['_aiChatUi']['addFeedItemAISuggestion'](_0x515c88);}),this['activeConversation']['on']('replyContentUpdated',async(_0x90c63e,_0x27198f)=>{await this['_updateReplyContent']({'reply':_0x27198f});}),this['activeConversation']['on']('replyChangeGroupStateUpdated',(_0x32af7c,{reply:_0x57439a,index:_0x4ed220,state:_0x2b6557})=>{this['_aiChatUi']['updateFeedItemAIReplySuggestionPartState']({'id':_0x57439a['id'],'index':_0x4ed220,'state':_0x2b6557}),this['_currentPreviewedChangeGroup']?.['replyId']['includes'](_0x57439a['id'])&&this['_currentPreviewedChangeGroup']?.['partIndex']==_0x4ed220&&this['_aiChatBalloon']?.['setState'](_0x2b6557);}),this['activeConversation']['on']('contextItemAdded',(_0x35f367,_0x1c9052)=>{if(this['_aiChatUi']['addContextItem'](_0x1c9052['contextItem'],_0x1c9052['isLoading']),'selection'===_0x1c9052['contextItem']['type']){const _0x46a8e4=[...c(this['context'])['model']['document']['selection']['getRanges']()];this['_aiEditing']['showFakeVisualSelection'](_0x46a8e4,'ai-conversation-'+this['activeConversation']?.['id']);}}),this['activeConversation']['on']('contextItemRemoved',(_0x54751a,_0x3fc7e7)=>{this['_aiChatUi']['removeContextItem'](_0x3fc7e7['uiId']),'current-document'==_0x3fc7e7['uiId']&&this['removeSelectionFromChatContext'](),'selection'===_0x3fc7e7['type']&&this['_aiEditing']['hideFakeVisualSelection']('ai-conversation-'+this['activeConversation']?.['id']);}),this['activeConversation']['on']('contextItemLoadingEnded',(_0x3c44c9,_0x59ef08)=>{this['_aiChatUi']['setContextItemLoading'](_0x59ef08['contextItem']['uiId'],_0x59ef08['isLoading']);}),this['activeConversation']['on']('contextSent',(_0x18ca7d,_0x24a65f)=>{this['_aiChatUi']['setConversationContext'](_0x24a65f['contextItems']);}),this['activeConversation']['on']('addContextOptionsChanged',(_0x423402,_0x5b5bb8)=>{this['_aiChatUi']['setAddContextOptions'](_0x5b5bb8['options']);}),this['activeConversation']['on']('sourceResourcesLoaded',(_0x1771d1,_0x2da1f5)=>{this['_aiChatUi']['populateSourceResourceBalloon'](_0x2da1f5['sourceId'],_0x2da1f5['source'],_0x2da1f5['resources'],_0x2da1f5['uid']);}),this['activeConversation']['on']('resourceStateChanged',(_0x648c48,_0x204c37)=>{this['_aiChatUi']['updateResourceState'](_0x204c37['sourceId'],_0x204c37['resourceId'],_0x204c37['isInContext']);}),this['activeConversation']['on']('capabilitiesUpdated',(_0x12e388,_0x273099)=>{this['_aiChatUi']['updateCapabilities'](_0x273099);}),this['activeConversation']['on']('modelSelected',async(_0x3e5533,_0x51892c)=>{const _0x3939d3=(await this['_aiChatModels']['getAll']())['find'](_0x111f5e=>_0x111f5e['id']===_0x51892c['selectedModel']['id'])||null;this['_aiChatUi']['setSelectedModel'](_0x3939d3,_0x51892c['isDisabled']);}),this['activeConversation']['on']('error',(_0x2a45f9,{error:_0x31e257,interactionId:_0x17c5e8,fileName:_0x40d2ed,url:_0x5b83b3,sourceId:_0x3ced76,sourceLabel:_0x51560f})=>{const _0x27d5f3=_0x17c5e8?_0x17c5e8+':'+_0x677d44():_0x677d44();_0x31e257['message']['startsWith']('ai-request-aborted')?this['_aiChatUi']['addFeedItemStaticMessage']({'staticMessage':h(this['context']['locale'],'AI_CHAT_ABORTED_MESSAGE'),'id':_0x27d5f3}):_0x31e257['message']['startsWith']('ai-chat-conversation-init-failed')||_0x31e257['message']['startsWith']('ai-chat-conversation-start-failed')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':h(this['context']['locale'],'AI_CHAT_UNABLE_TO_START_CONVERSATION'),'id':_0x27d5f3}),this['_logError'](_0x31e257)):_0x31e257['message']['startsWith']('ai-chat-file-upload-failed')?this['_aiChatUi']['addFeedItemError']({'errorMessage':h(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_FILE',_0x40d2ed),'id':_0x27d5f3}):_0x31e257['message']['startsWith']('ai-chat-url-upload-failed')?this['_aiChatUi']['addFeedItemError']({'errorMessage':h(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_URL',_0x5b83b3),'id':_0x27d5f3}):_0x31e257['message']['startsWith']('ai-chat-context-invalid-data')?this['_aiChatUi']['addFeedItemError']({'errorMessage':h(this['context']['locale'],'AI_CHAT_CONTEXT_INVALID_DATA'),'id':_0x27d5f3}):_0x31e257['message']['startsWith']('ai-chat-context-unsupported-type')?this['_aiChatUi']['addFeedItemError']({'errorMessage':h(this['context']['locale'],'AI_CHAT_CONTEXT_UNSUPPORTED_TYPE'),'id':_0x27d5f3}):_0x31e257['message']['startsWith']('ai-chat-source-resources-load-failed')?(_0x3ced76&&this['_aiChatUi']['closeSourceResourceBalloon'](_0x3ced76),this['_aiChatUi']['addFeedItemError']({'errorMessage':h(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_LOAD_RESOURCES',_0x51560f||'source'),'id':_0x27d5f3}),this['_logError'](_0x31e257)):_0x31e257['message']['startsWith']('ai-chat-resource-load-failed')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':h(this['context']['locale'],'AI_CHAT_RESOURCE_LOAD_FAILED'),'id':_0x27d5f3}),this['_logError'](_0x31e257)):_0x31e257['message']['startsWith']('ai-chat-invalid-request')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':h(this['context']['locale'],'AI_CHAT_INVALID_REQUEST'),'id':_0x27d5f3}),this['_logError'](_0x31e257)):_0x31e257['message']['startsWith']('ai-chat-context-unsupported-file-type')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':h(this['context']['locale'],'AI_CHAT_CONTEXT_UNSUPPORTED_FILE_TYPE'),'id':_0x27d5f3}),this['_logError'](_0x31e257)):_0x31e257['message']['startsWith']('ai-chat-context-file-too-large')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':h(this['context']['locale'],'AI_CHAT_CONTEXT_FILE_TOO_LARGE'),'id':_0x27d5f3}),this['_logError'](_0x31e257)):_0x31e257['message']['startsWith']('ai-chat-context-file-too-many-pages')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':h(this['context']['locale'],'AI_CHAT_CONTEXT_FILE_TOO_MANY_PAGES'),'id':_0x27d5f3}),this['_logError'](_0x31e257)):_0x31e257['message']['startsWith']('ai-chat-context-form-data-size-limits-exceeded')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':h(this['context']['locale'],'AI_CHAT_CONTEXT_FORM_DATA_SIZE_LIMITS_EXCEEDED'),'id':_0x27d5f3}),this['_logError'](_0x31e257)):(this['_aiChatUi']['addFeedItemError']({'errorMessage':h(this['context']['locale'],'AI_CHAT_GENERIC_ERROR'),'id':_0x27d5f3}),this['_logError'](_0x31e257));}),await this['activeConversation']['init'](this['context']['config']['get']('ai.chat.context')),_0x5a824c||await this['activeConversation']['start']();}async['_handleUIUserMessage']({userMessage:_0x456ff5,attributes:_0x3e0e6d}){if(!this['activeConversation'])throw new _0x25c351('ai-chat-controller-no-active-conversation');if(this['activeConversation']['isCurrentDocumentInContext']()){const _0x497224=await this['_aiEditing']['getDocumentData']();await this['activeConversation']['updateCurrentDocumentInContext'](_0x497224);}this['activeConversation']['id']&&this['activeConversation']['isStarted']&&await this['activeConversation']['handleUserInteraction']({'userMessage':_0x456ff5,'attributes':_0x3e0e6d});}['_showConversationHistory'](){console['log']('Showing\x20conversation\x20history...');}['_setIsMaximized'](_0x42cac7){this['_aiChatUi']['setIsMaximized'](_0x42cac7);}['_logError'](_0x30d153){_0x2d18bd(_0x30d153['message']);}['_removeFromContext'](_0x560ddd){this['activeConversation']?.['removeFromContext'](_0x560ddd);}['_toggleWebSearch'](){this['activeConversation']?.['toggleWebSearch']();}['_toggleReasoning'](){this['activeConversation']?.['toggleReasoning']();}['getInteractionAndReplyById'](_0x455ece){const [_0xd8d7f2,_0x1355e0]=_0x455ece['split'](':'),_0x5ce0ee=this['activeConversation']['getInteraction'](_0xd8d7f2),_0x1a422a=_0x5ce0ee['getReply'](_0x1355e0);return{'interaction':_0x5ce0ee,'reply':_0x1a422a};}['_scrollToSuggestionRange'](_0x4185fa,_0x125b97=!0x1){const _0x3bdc6b=c(this['context']),_0x74a5b2={'target':_0x3bdc6b['editing']['view']['domConverter']['viewRangeToDom'](_0x3bdc6b['editing']['mapper']['toViewRange'](_0x4185fa)),'viewportOffset':{'top':0x96,'left':0x0,'bottom':0x32,'right':0x0},'ancestorOffset':0x14,'alignToTop':_0x125b97};_0x125b97&&(_0x74a5b2['alignToTop']=!0x0),_0x517478(_0x74a5b2);}['updateConversationTitle'](_0x1862ff,_0x1872d2=!0x1){this['_aiChatUi']['setConversationTitle'](_0x1862ff||h(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION'),_0x1872d2);}async['_updateReplyContent']({reply:_0x7b47f1,renderingStrategy:_0xa74464}){const {id:_0x5b0052,interactionId:_0xc7eb0d,isDone:_0x47fc56,type:_0x657d0c,parsedContent:_0x12a82d}=_0x7b47f1,_0x38f942=_0xc7eb0d+':'+_0x5b0052;if('modification'===_0x657d0c){const _0x449124=_0x7b47f1['getContentParts']({'showDiff':this['_aiChatUi']['showDiff']});await this['_aiChatUi']['updateFeedItemAIReplySuggestionContent']({'id':_0x38f942,'parts':_0x449124,'renderingStrategy':_0xa74464,'isDone':_0x47fc56});}else'text'===_0x657d0c&&await this['_aiChatUi']['updateFeedItemAIReplyContent']({'id':_0x38f942,'parsedContent':_0x12a82d,'renderingStrategy':_0xa74464,'isDone':_0x47fc56});_0x47fc56&&_0x7b47f1['sources']['length']>0x0&&this['_aiChatUi']['updateFeedItemAIReplySources'](_0x38f942,_0x7b47f1['sources']);}async['_stopLastInteraction'](){const _0x36d3cb=this['activeConversation']?.['lastInteraction'];_0x36d3cb&&(_0x36d3cb['stop'](),this['_aiChatUi']['stopInteraction'](_0x36d3cb));}async['_flushLastInteractionUI'](){const _0x3604d0=this['activeConversation']?.['lastInteraction'];if(_0x3604d0){for await(const _0x4730f2 of _0x3604d0['replies'])await this['_updateReplyContent']({'reply':_0x4730f2,'renderingStrategy':'static'});}}['_updateRatings'](_0x5ddf24){const _0x5f465d={'positiveCount':_0x5ddf24['changeGroups']['filter'](_0x44123e=>'accepted'===_0x44123e['state'])['length'],'totalCount':_0x5ddf24['changeGroups']['length'],'modificationId':_0x5ddf24['id']},_0x3d8885=this['activeConversation']['getInteraction'](_0x5ddf24['interactionId'])['messageId'];_0x3d8885&&this['_aiConnector']['upsertAIChatRating'](this['activeConversation']['id'],_0x3d8885,_0x5f465d);}['_registerToolDataCallback'](_0x50f2b1){let _0x323a2c=null,_0x41493a=null;this['on']('toolDataReceived',(_0x4b2ac3,_0x110cda,_0x2cb15c)=>{_0x2cb15c['id']!==_0x323a2c&&(_0x323a2c=_0x2cb15c['id'],_0x41493a=this['_getAIChatInteractionAPI'](_0x2cb15c)),_0x50f2b1(_0x110cda,_0x41493a);});}['_getAIChatInteractionAPI'](_0x5e1d2a){const _0x2f1f73=this['_aiChatUi'],_0x213d98=()=>{_0x5e1d2a['resetWebSearchState'](),_0x5e1d2a['resetReasoningState'](),_0x2f1f73['clearLoadingMessage']();},_0x45a928=()=>{_0x5e1d2a['currentReply']&&(_0x5e1d2a['currentReply']['done'](),_0x5e1d2a['currentReply']=void 0x0);};return{'insertTextReply':(_0x428a05,_0x141c9e)=>{_0x45a928(),_0x213d98();const _0x2c1e01=_0x5e1d2a['currentReply']=_0x5e1d2a['createReply']({'type':'text','interactionId':_0x5e1d2a['id'],'content':_0x428a05,'id':_0x141c9e||_0x677d44()});return _0x45a928(),_0x2c1e01;},'insertCustomElement':async(_0x45227d,_0xee401f)=>(_0x45a928(),_0x213d98(),_0x2f1f73['addFeedItemCustomElement'](_0x45227d,_0xee401f||_0x677d44())),'setLoadingMessage':_0x375982=>{_0x2f1f73['setLoadingMessage'](_0x375982);},'clearLoadingMessage':()=>{_0x2f1f73['clearLoadingMessage']();}};}}const o='ai-selection';class s extends _0x5dcf5b{constructor(_0x505de9){super(_0x505de9),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 _0x18d87e=c(this['context']),_0x298d54=_0x18d87e['plugins']['has']('RealTimeCollaborationClient')&&_0x18d87e['plugins']['get']('RealTimeCollaborationClient')['sessionId'];this['_sessionId']=_0x298d54||_0x677d44();}return this['_sessionId'];}async['getDocumentData'](){const _0xd5d954=c(this['context']),_0x124dd8=_0xd5d954['model'],_0x552821=_0xd5d954['data']['toView'](_0x124dd8['document']['getRoot'](),{'convertAiChatSelectionMarker':!0x0}),_0x577d87=new Ot(_0xd5d954['editing']['view']['document']);this['_setDataIdsOnChildren'](_0x552821,_0x577d87);let _0x40eb37=await this['_getDocumentDataStringFromView'](_0x552821);const _0x408f58=this['_getMarkersInDocumentOrder'](),_0x669e8c=[];for(const _0x23a0be of _0x408f58){const _0x257942='<'+_0x23a0be['name']+':start></'+_0x23a0be['name']+':start>',_0x4f71f8=_0x40eb37['indexOf'](_0x257942);_0x40eb37=_0x40eb37['substring'](0x0,_0x4f71f8)+_0x40eb37['substring'](_0x4f71f8+_0x257942['length']);const _0x2d6458='<'+_0x23a0be['name']+':end></'+_0x23a0be['name']+':end>',_0x1c0cd0=_0x40eb37['indexOf'](_0x2d6458);_0x40eb37=_0x40eb37['substring'](0x0,_0x1c0cd0)+_0x40eb37['substring'](_0x1c0cd0+_0x2d6458['length']),_0x669e8c['push']({'markerName':_0x23a0be['name'],'start':_0x4f71f8,'end':_0x1c0cd0,'htmlFragment':_0x40eb37['substring'](_0x4f71f8,_0x1c0cd0)});}return{'content':_0x40eb37,'version':_0xd5d954['model']['document']['version'],'sessionId':this['sessionId'],'selections':_0x669e8c};}async['afterInit'](){this['context']instanceof _0x39b2a6?this['_integrateEditor'](this['context']):this['listenTo'](this['context']['editors'],'add',(_0x12c0a3,_0x2aa621)=>{_0x2aa621['on']('ready',()=>{this['_integrateEditor'](_0x2aa621);});});}['_setOutputDataProcessor'](_0x1bea76){this['_outputDataProcessor']=_0x1bea76;}async['_getDocumentDataStringFromView'](_0x45d9f6){let _0x22bf1b;const _0x4141ff=c(this['context']);if(this['_outputDataProcessor']){const _0x136f3b=_0x4141ff['data']['processor']['domConverter']['viewToDom'](_0x45d9f6),_0x3e994e=await this['_outputDataProcessor'](_0x136f3b);_0x22bf1b=_0x4141ff['data']['processor']['htmlWriter']['getHtml'](_0x3e994e);}else _0x22bf1b=_0x4141ff['data']['processor']['toData'](_0x45d9f6);return _0x22bf1b;}['_integrateEditor'](_0xf88211){_0xf88211['conversion']['for']('editingDowncast')['markerToHighlight']({'model':o,'view':{'classes':['ck-fake-ai-selection','ck-ai-assistant-ui_theme'],'priority':0xc}}),_0xf88211['conversion']['for']('dataDowncast')['markerToElement']({'model':o,'view':(_0x40e7c3,{writer:_0x52deef,options:_0xe4ed8b})=>_0xe4ed8b['convertAiChatSelectionMarker']?_0x52deef['createUIElement'](_0x40e7c3['markerName']+':'+(_0x40e7c3['isOpening']?'start':'end')):null});}['showFakeVisualSelection'](_0x473c69,_0x59c7c3,_0x48bb0a=!0x1,_0x29ed0e=!0x1){if(this['_displayedFakeSelectionLocked']&&!_0x29ed0e)return!0x1;const _0x27f4d4=c(this['context'])['model'];return _0x27f4d4['change'](_0x47401a=>{this['_displayedFakeSelectionId']&&this['hideFakeVisualSelection'](this['_displayedFakeSelectionId']),this['_displayedFakeSelectionId']=_0x59c7c3,this['_displayedFakeSelectionLocked']=_0x48bb0a;let _0xe901b6=0x0;for(let _0x5c7f54 of _0x473c69){const _0x47e21e=o+':'+_0xe901b6;if(_0x5c7f54['start']['isAtEnd']){const _0x22b50b=_0x5c7f54['start']['getLastMatchingPosition'](({item:_0x429123})=>!_0x27f4d4['schema']['isContent'](_0x429123),{'boundaries':_0x5c7f54});_0x5c7f54=_0x47401a['createRange'](_0x22b50b,_0x5c7f54['end']);}_0x47401a['addMarker'](_0x47e21e,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x5c7f54}),_0xe901b6++;}}),window['getSelection']()?.['removeAllRanges'](),!0x0;}['hideFakeVisualSelection'](_0x4f2937){if(this['_displayedFakeSelectionId']!=_0x4f2937)return!0x1;this['_displayedFakeSelectionId']=null,this['_displayedFakeSelectionLocked']=!0x1;const _0x3c4be1=c(this['context']),_0x1630ff=_0x3c4be1['model']['markers']['getMarkersGroup'](o);return _0x3c4be1['model']['change'](_0x182e4b=>{for(const _0x224dce of _0x1630ff)_0x182e4b['removeMarker'](_0x224dce);}),!0x0;}async['modelToDataWithIds'](_0x2705f5){const _0x498dc4=c(this['context']),_0x2d9f39=_0x498dc4['data']['toView'](_0x2705f5),_0x310cf4=new Ot(_0x498dc4['editing']['view']['document']);return this['_setDataIdsOnChildren'](_0x2d9f39,_0x310cf4),this['_getDocumentDataStringFromView'](_0x2d9f39);}['_setDataIdsOnChildren'](_0xd2ba1,_0xed47ac){let _0x45c445=!0x1;const _0x2a63b6=new Set();for(const _0x1b2263 of _0xd2ba1['getChildren']()){const _0x3792ac=_0x1b2263['is']('emptyElement')||_0x1b2263['is']('containerElement');if(!_0x1b2263['is']('element'))continue;(this['_setDataIdsOnChildren'](_0x1b2263,_0xed47ac)||_0x3792ac)&&(_0xed47ac['setAttribute']('data-id',this['_nextDataId'](_0x2a63b6),_0x1b2263),_0x45c445=!0x0);}return _0x45c445;}['_nextDataId'](_0x29dbd8){let _0x9a435e;do{_0x9a435e='';for(let _0x15052b=0x0;_0x15052b<0x4;_0x15052b++)_0x9a435e+=String['fromCharCode'](0x61+Math['floor'](0x1a*Math['random']()));}while(_0x29dbd8['has'](_0x9a435e));return _0x29dbd8['add'](_0x9a435e),_0x9a435e;}['getSelectionText'](){const {model:_0x404fbd}=c(this['context']),_0x1ec88e=_0x404fbd['document']['selection'],_0x2251a5=[];for(const _0x4fde61 of _0x1ec88e['getRanges']())for(const _0x2c721a of _0x4fde61['getItems']())_0x2c721a['is']('$textProxy')?_0x2251a5['push'](_0x2c721a['data']):_0x2c721a['is']('element')&&_0x2251a5['length']>0x0&&'\x20'!==_0x2251a5[_0x2251a5['length']-0x1]&&_0x2251a5['push']('\x20');return _0x2251a5['length']?'\x22'+_0x2251a5['join']('')['trim']()+'\x22':h(this['context']['locale'],'AI_CHAT_CONTEXT_DOCUMENT_SELECTION_LABEL');}['_getMarkersInDocumentOrder'](){const _0x3d0e97=c(this['context'])['model'];return Array['from'](_0x3d0e97['markers']['getMarkersGroup'](o))['sort']((_0x195cb0,_0x412e26)=>_0x195cb0['getStart']()['isBefore'](_0x412e26['getStart']())?-0x1:_0x195cb0['getStart']()['isAfter'](_0x412e26['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(_0x364607){this['options']={'delay':_0x364607['delay']??0x14,'textNodeStyle':_0x364607['textNodeStyle'],'onStreamUpdate':_0x364607['onStreamUpdate']||(()=>{})};}async['stream']({document:_0x4b88be,targetElement:_0x3a8233,abortSignal:_0x234d66}){this['isStreaming']&&this['stop'](),_0x234d66?.['addEventListener']('abort',this['stop']['bind'](this)),this['document']=_0x26f51(_0x4b88be,!0x0),this['nodesList']=this['getParsedDocumentNodeList'](),this['isStreaming']=!0x0,this['currentIndex']>this['nodesList']['length']&&(this['currentIndex']=this['nodesList']['length']);for(let _0x2c38b1=0x0;_0x2c38b1<this['currentIndex'];_0x2c38b1++)this['nodesList'][_0x2c38b1]['shouldBeStreamed']=!0x0;do{const _0x32623b=Date['now'](),_0x5e9c52=this['nodesList'][this['currentIndex']],_0x1f0e1e=_0x32623b-this['lastUpdateTime'];if(_0x5e9c52){_0x5e9c52['shouldBeStreamed']=!0x0;let _0x53ae15=_0x5e9c52['parent'];for(;_0x53ae15;)_0x53ae15['shouldBeStreamed']=!0x0,_0x53ae15=_0x53ae15['parent'];}if(_0x1f0e1e<this['options']['delay'])try{const {promise:_0x23101b,abortController:_0x2ed545}=Os(this['options']['delay']-_0x1f0e1e);this['timeoutAbortController']=_0x2ed545,await _0x23101b;}catch(_0x4eb604){return;}_0x4c0a39(_0x3a8233,'<'+_0x3a8233['tagName']+'>'+this['renderNode'](this['document'])+'</'+_0x3a8233['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:_0x384bbf}){Array['from'](_0x384bbf['querySelectorAll']('span[data-ck-html-streamer-word-chunk]'))['reverse']()['forEach'](_0x570190=>{_0x570190['replaceWith'](_0x570190['childNodes'][0x0]);});}['stop'](){this['isStreaming']=!0x1,this['timeoutAbortController']&&(this['timeoutAbortController']['abort'](),this['timeoutAbortController']=null);}['renderNode'](_0x13cbe4){let _0x20ec3f='';if(function(_0xa947b1){return _0x528e78(_0xa947b1);}(_0x13cbe4)){for(const _0x3b8470 of _0x13cbe4['children'])_0x20ec3f+=this['renderNode'](_0x3b8470);}else{if(Us(_0x13cbe4)){if(!_0x13cbe4['shouldBeStreamed'])return'';const _0x1efed7=_0x13cbe4,_0xdf61a1=Object['entries'](_0x1efed7['attribs'])['map'](([_0x2e53d5,_0x3cb5d3])=>_0x2e53d5+'=\x22'+_0x3cb5d3+'\x22')['join']('\x20');_0x20ec3f+='<'+_0x1efed7['tagName']+(_0xdf61a1?'\x20'+_0xdf61a1:'')+'>';for(const _0x292cdf of _0xf7fac1(_0x1efed7))_0x20ec3f+=this['renderNode'](_0x292cdf);_0x20ec3f+='</'+_0x1efed7['tagName']+'>';}else{if(!Ls(_0x13cbe4))return'';if(!_0x13cbe4['shouldBeStreamed'])return'';!function(_0xa87972){if(!_0xa87972['parent']||!Us(_0xa87972['parent']))return!0x1;if(!Ts['includes'](_0xa87972['parent']['tagName']))return!0x1;return!_0x593e8e(_0xa87972)['match'](/^\s*[<>]\s*$/);}(_0x13cbe4)?_0x20ec3f+=_0xc63f4e(_0x13cbe4):_0x20ec3f+=_0xc63f4e(new _0x38e3db('span',{'data-ck-html-streamer-word-chunk':'','style':this['options']['textNodeStyle']},[_0x13cbe4]));}}return _0x20ec3f;}['getParsedDocumentNodeList'](){const _0x1162a2=[];return function(_0x5449ce,_0x3a01cf){const _0x382871=_0x4f2305=>{if(_0x3a01cf(_0x4f2305),_0x4f2305 instanceof _0x513cab)for(let _0x15fb8e=0x0;_0x15fb8e<_0x4f2305['children']['length'];_0x15fb8e++){const _0x447087=_0x4f2305['children'][_0x15fb8e];_0x382871(_0x447087);}};for(let _0x5dd36e=0x0;_0x5dd36e<_0x5449ce['children']['length'];_0x5dd36e++)_0x382871(_0x5449ce['children'][_0x5dd36e]);}(this['document'],_0x6c5f91=>{if(Ls(_0x6c5f91)){const _0x56b05d=this['splitTextNodeIntoWordNodes'](_0x6c5f91);_0x56b05d['length']&&_0x1162a2['push'](..._0x56b05d);}_0x6c5f91['isWordSplitSource']||_0x6c5f91['isWordSplitResult']||_0x1162a2['push'](_0x6c5f91);}),_0x1162a2;}['splitTextNodeIntoWordNodes'](_0x1f134d){if(_0x1f134d['isWordSplitSource']||_0x1f134d['isWordSplitResult'])return[];const _0x28ab87=_0x593e8e(_0x1f134d)['match'](/(?:\s*\S+\s*)/g),_0x542cfa=[];if(_0x28ab87&&_0x28ab87['length']>0x1){for(const _0x34af38 of _0x28ab87){const _0x609ac0=new _0x4fdfd5(_0x34af38);_0x609ac0['isWordSplitResult']=!0x0,_0x45d87d(_0x1f134d,_0x609ac0),_0x542cfa['push'](_0x609ac0);}_0x1f134d['isWordSplitSource']=!0x0,_0x210a44(_0x1f134d);}return _0x542cfa;}}const Ts=['p','li','td','th','span','h1','h2','h3','h4','h5','h6','b','strong','i','em','mark','del','ins','sup','sub','a','code','div'];function Ls(_0x23557b){return _0x99d146(_0x23557b);}function Us(_0x59e2ae){return _0x441935(_0x59e2ae);}function Os(_0x3b1c75){const _0x2077f6=new AbortController();return{'promise':new Promise((_0x492745,_0x8c7301)=>{const _0x125342=setTimeout(_0x492745,_0x3b1c75);_0x2077f6['signal']['addEventListener']('abort',()=>{clearTimeout(_0x125342),_0x8c7301();});}),'abortController':_0x2077f6};}class Fr extends _0x1f054a{['options'];['content']='';['htmlStreamer'];['children'];constructor(_0x23b6e9){super();const _0x4d9878=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']=_0x23b6e9,this['children']=this['createCollection'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__item',_0x4d9878['if']('isDone','ck-ai-chat__feed__item_done'),_0x4d9878['if']('isVisible','ck-hidden',_0x3e9558=>!_0x3e9558),'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'](_0x63ba15=>{_0x63ba15['removeAttribute']('data-id');}),this['isDone']=!0x0;}async['streamIntoElement'](_0x79f6a3,_0x2d6c8a,_0x288a9a){await this['htmlStreamer']['stream']({'document':_0x79f6a3,'targetElement':_0x2d6c8a,'abortSignal':_0x288a9a});}}class oa extends _0x1f054a{['showChangesToggleView'];constructor(_0x4cc094,_0x5165ee){super(_0x4cc094),this['set']('isShowChangesToggleVisible',!0x0),this['showChangesToggleView']=new Zn(_0x4cc094),this['showChangesToggleView']['set']({'class':'ck-ai-suggestion__header__show-changes-toggle\x20ck-ai-chat-controls-button','label':h(_0x4cc094,'AI_SUGGESTION_BUTTON_SHOW_CHANGES'),'withText':!0x0}),this['showChangesToggleView']['isOn']=_0x5165ee['showDiff'],this['showChangesToggleView']['bind']('isVisible')['to'](this,'isShowChangesToggleVisible'),this['showChangesToggleView']['bind']('icon')['to'](this['showChangesToggleView'],'isOn',_0x22b59b=>_0x22b59b?_0x576a77:_0x47ae5e),this['showChangesToggleView']['on']('execute',()=>{this['showChangesToggleView']['isOn']=!this['showChangesToggleView']['isOn'],this['fire']('toggleShowChanges',{'isOn':this['showChangesToggleView']['isOn']});});const _0xa69641=new _0x152087();_0xa69641['content']=_0x545232,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__header',!0x1===_0x5165ee['showHeader']?'ck-hidden':null]['filter'](Boolean)},'children':[_0xa69641,{'tag':'span','children':[h(_0x4cc094,'AI_SUGGESTION_HEADER_TITLE')]},this['showChangesToggleView']]});}}class Zn extends _0x1d1b95{['render'](){super['render'](),this['children']['remove'](this['iconView']),this['children']['add'](this['iconView']);}}const Or={'accepted':_0x32af33,'rejected':_0x37bcd5,'outdated':_0x37bcd5};class ps extends _0x1f054a{['stateIconView'];constructor(_0x421f63){super(_0x421f63);const _0x110254=this['bindTemplate'];this['set']('state','accepted'),this['set']('isVisible',!0x0),this['stateIconView']=new Nr(),this['stateIconView']['bind']('state')['to'](this),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__content-part-state',_0x110254['to']('state',_0x3fcb25=>'ck-ai-suggestion__content-part-state_'+_0x3fcb25),_0x110254['if']('isVisible','ck-hidden',_0x4af13f=>!_0x4af13f)]},'children':[{'tag':'span','attributes':{'class':['ck-ai-suggestion__content-part-state__label']},'children':[{'text':_0x110254['to']('state',_0x504f30=>{switch(_0x504f30){case'accepted':return h(_0x421f63,'AI_SUGGESTION_CONTENT_PART_STATE_ACCEPTED');case'rejected':return h(_0x421f63,'AI_SUGGESTION_CONTENT_PART_STATE_REJECTED');case'outdated':return h(_0x421f63,'AI_SUGGESTION_CONTENT_PART_STATE_OUTDATED');}})}]},this['stateIconView']]});}['setState'](_0x332a8c){this['state']=_0x332a8c;}}class Nr extends _0x152087{constructor(){super(),this['set']('state','accepted'),this['content']=Or[this['state']],this['on']('change:state',()=>{this['content']=Or[this['state']];});}}class us extends _0x50bbb8{['_applyButton'];['_suggestButton'];constructor(_0x31658a,_0x50cc68,_0x3e86d7){super(_0x31658a);const _0x666fdc=Boolean(_0x3e86d7);this['set']('isEnabled',!_0x666fdc),this['set']('isVisible',!0x0),this['class']='ck-ai-suggestion-content-part-toolbar';const _0x3212ee=[];if(_0x666fdc){const _0x1efdb4=new _0x1d1b95(_0x31658a);_0x1efdb4['set']({'label':h(_0x31658a,'AI_SUGGESTION_DISABLED_TOOLTIP_MESSAGE'),'tooltip':!0x0,'tooltipPosition':'n','withText':!0x1,'icon':tc}),_0x3212ee['push'](_0x1efdb4);}else{_0x50cc68['includes']('applySuggestion')&&(this['_applyButton']=new _0x1d1b95(_0x31658a),this['_applyButton']['set']({'label':h(_0x31658a,'AI_SUGGESTION_CONTENT_PART_APPLY'),'tooltip':!0x0,'tooltipPosition':'n','withText':!0x1,'icon':_0x32af33}),this['_applyButton']['bind']('isEnabled')['to'](this),this['_applyButton']['on']('execute',()=>{this['fire']('applySuggestion');}),_0x3212ee['push'](this['_applyButton'])),_0x50cc68['includes']('insertSuggestion')&&(this['_suggestButton']=new _0x1d1b95(_0x31658a),this['_suggestButton']['set']({'label':h(_0x31658a,'AI_SUGGESTION_CONTENT_PART_ADD_SUGGESTION'),'tooltip':!0x0,'tooltipPosition':'n','withText':!0x1,'icon':_0x3cb7ec}),this['_suggestButton']['bind']('isEnabled')['to'](this),this['_suggestButton']['on']('execute',()=>{this['fire']('insertSuggestion');}),_0x3212ee['push'](this['_suggestButton']));const _0xabde53=new _0x1d1b95(_0x31658a);_0xabde53['set']({'label':h(_0x31658a,'AI_SUGGESTION_CONTENT_PART_REJECT'),'tooltip':!0x0,'tooltipPosition':'n','withText':!0x1,'icon':_0x37bcd5}),_0xabde53['bind']('isEnabled')['to'](this),_0xabde53['on']('execute',()=>{this['fire']('rejectSuggestion');}),_0x3212ee['push'](_0xabde53);}this['items']['addMany'](_0x3212ee);const _0x2c6150=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':[_0x2c6150['if']('isVisible','ck-hidden',_0x59d5ae=>!_0x59d5ae)]}});}['setButtonsVisibility']({showApplyButton:_0x34fb7d,showSuggestButton:_0x4df64f}){this['_applyButton']&&(this['_applyButton']['isVisible']=_0x34fb7d),this['_suggestButton']&&(this['_suggestButton']['isVisible']=_0x4df64f);}}class vn extends _0x1f054a{['toolbarView'];['stateView'];['titleLabelView'];['children'];constructor(_0x2584c2,{part:_0x30d365,uiIndex:_0x2f264d,availableActions:_0x216fcc,areActionsDisabled:_0x99a506}){super(_0x2584c2),this['set']('isEnabled',!0x0),this['set']('state','pending'),this['toolbarView']=new us(_0x2584c2,_0x216fcc,_0x99a506),this['toolbarView']['on']('rejectSuggestion',()=>{this['fire']('rejectSuggestion',{'index':_0x30d365['index']});}),this['toolbarView']['on']('insertSuggestion',()=>{this['fire']('insertSuggestion',{'index':_0x30d365['index']});}),this['toolbarView']['on']('applySuggestion',()=>{this['fire']('applySuggestion',{'index':_0x30d365['index']});}),this['toolbarView']['bind']('isEnabled')['to'](this),this['stateView']=new ps(_0x2584c2),this['titleLabelView']=new Sn(_0x2584c2,_0x2f264d),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',(_0x1247b4,_0x429fee,_0x5bce95,_0x5dedb5)=>{'pending'===_0x5dedb5?this['children']['remove'](this['toolbarView']):this['children']['remove'](this['stateView']),'pending'===_0x5bce95?this['children']['add'](this['toolbarView']):(this['stateView']['setState'](_0x5bce95),this['children']['add'](this['stateView']));});}}class Sn extends _0x1f054a{constructor(_0x44343a,_0x1017b9){super(_0x44343a),this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-suggestion__body__content-part__title__label']},'children':[h(_0x44343a,'AI_SUGGESTION_CONTENT_PART_TITLE',_0x1017b9['toString']())]});}}class cs extends _0x1f054a{['htmlStreamer'];constructor(_0x141dcc){super(_0x141dcc),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:_0x505a96,renderingStrategy:_0x1b63c7,abortSignal:_0x4509a7}){'streaming'===_0x1b63c7?await this['htmlStreamer']['stream']({'document':_0x505a96['content'],'targetElement':this['element'],'abortSignal':_0x4509a7}):this['element']['innerHTML']=pt(_0x505a96['content']);}['clear'](){this['htmlStreamer']['reset'](),this['element']['innerHTML']='';}}class na extends _0x1f054a{['_children'];['_headerView'];['_streamableContentView'];constructor(_0x397934,{part:_0xd9ad4e,uiIndex:_0x5a6bd5,areActionsDisabled:_0x44cae6,availableActions:_0x2c5e17}){super(_0x397934);const _0x4a6ee5=this['bindTemplate'];this['set']('state','pending'),this['set']('isDone',!0x1),this['set']('isVisible',!0x1),this['set']('isActive',!0x1),this['set']('isEnabled',!0x1);const _0x528729=()=>{this['isEnabled']=this['isDone']&&'pending'==this['state']&&!_0x44cae6;};this['on']('change:state',_0x528729),this['on']('change:isDone',_0x528729),_0x528729(),this['_children']=this['createCollection'](),this['_headerView']=new vn(_0x397934,{'part':_0xd9ad4e,'uiIndex':_0x5a6bd5,'availableActions':_0x2c5e17,'areActionsDisabled':_0x44cae6}),this['_headerView']['bind']('isEnabled','state')['to'](this),this['_headerView']['delegate'](...W)['to'](this),this['_streamableContentView']=new cs(_0x397934),this['_children']['addMany']([this['_headerView'],this['_streamableContentView']]),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__body__content-part',_0x4a6ee5['to']('state',_0x2f785d=>'ck-ai-suggestion__body__content-part_'+_0x2f785d),_0x4a6ee5['if']('isEnabled','ck-ai-suggestion__body__content-part_enabled'),_0x4a6ee5['if']('isActive','ck-ai-suggestion__body__content-part_active'),_0x4a6ee5['if']('isVisible','ck-hidden',_0x52feea=>!_0x52feea)]},'children':this['_children'],'on':{'mouseenter':_0x4a6ee5['to'](()=>{this['isEnabled']&&this['fire']('mouseOverSuggestion',{'index':_0xd9ad4e['index']});}),'mouseleave':_0x4a6ee5['to'](()=>{this['isEnabled']&&this['fire']('mouseLeaveSuggestion',{'index':_0xd9ad4e['index']});}),'click':_0x4a6ee5['to'](_0x1b6798=>{const _0x8462c2=_0x1b6798['target'];this['isEnabled']&&!this['_headerView']['toolbarView']['element']['contains'](_0x8462c2)&&this['fire']('showChangeInText',{'index':_0xd9ad4e['index']});})}});}async['updateContent']({part:_0x4cf443,renderingStrategy:_0x3f02b1,showUnchangedParts:_0x52892b=!0x1,abortSignal:_0x5aa816}){this['partDefinition']=_0x4cf443,this['isVisible']=this['partDefinition']['hasChanges']||_0x52892b,this['isVisible']&&await this['_streamableContentView']['update']({'part':_0x4cf443,'renderingStrategy':_0x3f02b1,'abortSignal':_0x5aa816});}['markAsDone'](){this['isDone']=!0x0;}}class St extends _0xa7ecb2(){['queue']=[];['isProcessing']=!0x1;['_abortController'];async['enqueue'](_0x5bc66f){const _0xbd1e41=this['createTask'](_0x5bc66f);return this['queue']['push'](_0xbd1e41),this['_processQueue'](),_0xbd1e41['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(_0x3f4af5=>{this['once']('_queueEmpty',()=>{_0x3f4af5();});}):Promise['resolve']();}async['_processQueue'](){if(!this['isProcessing']){this['_abortController']=new AbortController(),this['isProcessing']=!0x0;try{for(;this['queue']['length']&&this['isProcessing'];){const _0x20f41e=this['queue']['shift']();try{await _0x20f41e['callback'](this['_abortController']['signal']),_0x20f41e['resolve']();}catch(_0x36283a){_0x20f41e['reject'](_0x36283a);}}}finally{this['isProcessing']=!0x1,this['_abortController']=void 0x0;}this['fire']('_queueEmpty');}}['createTask'](_0x53a3a4){let _0x7d6bdc,_0x341879;const _0x42447a=new Promise((_0x50b81c,_0x4fc8b0)=>{_0x7d6bdc=_0x50b81c,_0x341879=_0x4fc8b0;});return{'callback':_0x53a3a4,'resolve':_0x7d6bdc,'reject':_0x341879,'completePromise':_0x42447a};}}class Ze extends Fr{constructor(_0x124230){super(_0x124230),this['extendTemplate']({'attributes':{'class':['ck-ai-notification','warning'===_0x124230['level']?'ck-ai-notification_warning':'ck-ai-notification_error']}});}['render'](){super['render'](),this['setContent'](this['options']['initialContent']),this['markAsDone']();}['setContent'](_0x4d5e07){this['element']['innerHTML']=_0x4d5e07;}}const J=['applySuggestion','insertSuggestion'];class ra extends _0x1f054a{['_applyChangesButton'];['_insertSuggestionsButton'];['children'];constructor(_0x385848,_0x2279f6=[...J],_0x1c6798){super(_0x385848);const _0x5df8c1=this['bindTemplate'],_0xfeda=Boolean(_0x1c6798);if(this['set']('isEnabled',!_0xfeda),this['set']('isVisible',!0x1),this['set']('isTrackChangesOn',!0x1),this['children']=this['createCollection'](),_0xfeda){const _0x526667=new _0x1d1b95(_0x385848);_0x526667['set']({'label':h(_0x385848,'AI_SUGGESTION_DISABLED_TOOLTIP_MESSAGE'),'tooltip':!0x0,'tooltipPosition':'n','withText':!0x1,'icon':tc});const _0x4aa903=new _0x1f054a(_0x385848);_0x4aa903['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-chat__feed__suggestion__actions__info'},'children':[{'tag':'p','children':[h(_0x385848,'AI_SUGGESTION_DISABLED_FEED_MESSAGE'),_0x526667]}]}),this['children']['add'](_0x4aa903);}else this['_applyChangesButton']=new _0x1d1b95(_0x385848),this['_applyChangesButton']['set']({'label':h(_0x385848,'AI_CHAT_SUGGESTION_ACTION_APPLY_ALL'),'withText':!0x0,'type':'button','isVisible':_0x2279f6['includes']('applySuggestion'),'class':'ck-ai-button-primary'}),this['_insertSuggestionsButton']=new _0x1d1b95(_0x385848),this['_insertSuggestionsButton']['set']({'label':h(_0x385848,'AI_CHAT_SUGGESTION_ACTION_SUGGEST_ALL'),'withText':!0x0,'type':'button','isVisible':_0x2279f6['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'](_0x4bc786=>{_0x4bc786['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',_0x5df8c1['if']('isVisible','ck-hidden',_0x543f01=>!_0x543f01)]},'children':this['children']}),this['on']('change:isTrackChangesOn',()=>{this['_applyChangesButton']&&(this['_applyChangesButton']['isVisible']=!this['isTrackChangesOn']);});}['updateVisibility'](_0x4b503e){this['isVisible']=_0x4b503e;}['_switchButtonLabelsPlurality'](_0x72d58){this['_applyChangesButton']&&this['_insertSuggestionsButton']&&(_0x72d58?(this['_applyChangesButton']['label']=h(this['locale'],'AI_CHAT_SUGGESTION_ACTION_APPLY_ALL'),this['_insertSuggestionsButton']['label']=h(this['locale'],'AI_CHAT_SUGGESTION_ACTION_SUGGEST_ALL')):(this['_applyChangesButton']['label']=h(this['locale'],'AI_CHAT_SUGGESTION_ACTION_APPLY'),this['_insertSuggestionsButton']['label']=h(this['locale'],'AI_CHAT_SUGGESTION_ACTION_SUGGEST')));}}class Sr extends _0x1f054a{['children'];['balloonPanelView'];['bodyCollection'];constructor(_0x57c985,_0x5bd41c){super(_0x57c985),this['bodyCollection']=_0x5bd41c,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',_0x49d87a=>!_0x49d87a)]},'children':this['children']});const _0x5408c4=new _0x1f054a(this['locale']),_0x409fdf=new _0x152087();_0x409fdf['content']=_0x26bf07,_0x5408c4['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-web-sources__header']},'children':[_0x409fdf,{'tag':'span','children':[{'text':h(this['locale'],'AI_CHAT_SOURCES_HEADER')}]}]}),this['children']['add'](_0x5408c4),this['_setupBalloonPanel'](_0x57c985);}['addSource'](_0x53020f){this['children']['add'](new qr(this['locale'],_0x53020f,this['balloonPanelView']));}['_setupBalloonPanel'](_0x5c69ae){this['balloonPanelView']=new _0x10e1b3(_0x5c69ae),this['balloonPanelView']['extendTemplate']({'attributes':{'class':['ck-ai-web-source__tooltip-balloon']}}),this['bodyCollection']['add'](this['balloonPanelView']);}}class qr extends _0x1d1b95{['balloonPanelView'];['source'];constructor(_0x7d2ca4,_0x5cfda6,_0x1eb16d){super(_0x7d2ca4),this['source']=_0x5cfda6,this['balloonPanelView']=_0x1eb16d,this['set']({'label':_0x5cfda6['title'],'class':['ck\x20ck-ai-web-source'],'withText':!0x0});const _0x1cfdf5=this['bindTemplate'];if(this['extendTemplate']({'on':{'click':_0x1cfdf5['to'](()=>{window['open'](_0x5cfda6['url'],'_blank');}),'mouseenter':_0x1cfdf5['to'](()=>{this['_showTooltip']();}),'mouseleave':_0x1cfdf5['to'](()=>{this['_hideTooltip']();})}}),_0x5cfda6['favicon']){const _0x2bb444=new _0x1f054a(_0x7d2ca4);_0x2bb444['setTemplate']({'tag':'img','attributes':{'src':_0x5cfda6['favicon']||_0x26bf07,'alt':_0x5cfda6['title'],'class':['ck-ai-web-source__image']}}),this['children']['add'](_0x2bb444);}else this['set']('icon',_0x26bf07);}['_createTooltipContentView'](_0x16e417,_0x9e81b0){const _0x12ab68=new _0x1f054a(_0x16e417),_0x4d0e3c=[];let _0xab99c2;_0x9e81b0?.['favicon']?(_0xab99c2=new _0x1f054a(_0x16e417),_0xab99c2['setTemplate']({'tag':'img','attributes':{'src':_0x9e81b0['favicon'],'alt':_0x9e81b0['title'],'class':['ck-ai-web-source__tooltip-image']}})):(_0xab99c2=new _0x152087(),_0xab99c2['content']=_0x26bf07,_0xab99c2['extendTemplate']({'attributes':{'alt':_0x9e81b0['title'],'class':['ck-ai-web-source__tooltip-image']}})),_0x4d0e3c['push'](_0xab99c2);const _0x25ede8=new _0x1f054a(_0x16e417);_0x25ede8['setTemplate']({'tag':'a','attributes':{'class':['ck-ai-web-source__tooltip-url'],'href':_0x9e81b0['url']},'children':[{'text':new URL(_0x9e81b0['url'])?.['hostname']}]}),_0x4d0e3c['push'](_0x25ede8);const _0x2edf96=new _0x1f054a(_0x16e417);_0x2edf96['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-web-source__tooltip-row']},'children':_0x4d0e3c});const _0x4bf864=new _0x1f054a(_0x16e417);return _0x4bf864['setTemplate']({'tag':'span','attributes':{'class':['ck-ai-web-source__tooltip-row','ck-ai-web-source__tooltip-title']},'children':[{'text':_0x9e81b0['title']['length']>0x190?_0x9e81b0['title']['substring'](0x0,0x190)+'...':_0x9e81b0['title']}]}),_0x12ab68['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-web-source__tooltip']},'children':[_0x2edf96,_0x4bf864]}),_0x12ab68;}['_showTooltip'](){this['_updateTooltipContent'](),this['balloonPanelView']['pin']({'target':this['element'],'positions':[_0x10e1b3['defaultPositions']['northArrowSouth'],_0x10e1b3['defaultPositions']['northArrowSouthWest'],_0x10e1b3['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 _0x11e0e8=this['_createTooltipContentView'](this['locale'],this['source']);this['balloonPanelView']['content']['add'](_0x11e0e8);}}class ca extends _0x1f054a{['_actionsView'];['_sourcesView'];['_children'];['_areActionsDisabled'];['_showUnchangedParts'];['_updateContentPartsPromiseQueue'];['_emptyPartsWarningView'];['_availableActions'];['_cachedContentParts']=[];constructor(_0x3b67f7,_0x43362f){super(_0x3b67f7);const {areActionsDisabled:_0x140f65,showUnchangedParts:_0x2d1726,availableActions:_0x41e78f}=_0x43362f;this['_areActionsDisabled']=_0x140f65,this['_showUnchangedParts']=_0x2d1726,this['_availableActions']=_0x41e78f,this['set']('hasPendingParts',!0x1),this['set']('isTrackChangesOn',!0x1),this['_children']=this['createCollection'](),this['_updateContentPartsPromiseQueue']=new St(),this['_emptyPartsWarningView']=new Ze({'id':'empty-parts-warning','initialContent':h(_0x3b67f7,'AI_SUGGESTION_EMPTY_PART_WARNING'),'level':'warning'}),this['_emptyPartsWarningView']['isVisible']=!0x1,this['_actionsView']=new ra(_0x3b67f7,_0x43362f['availableActions'],this['_areActionsDisabled']),this['_actionsView']['bind']('isTrackChangesOn')['to'](this),this['_sourcesView']=new Sr(this['locale'],_0x43362f['bodyCollection']),_0x43362f['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:_0x38d69f,renderingStrategy:_0x2f2b48,abortSignal:_0x45ff7c}){this['_children']['length']?_0x38d69f['forEach'](_0xa7d82a=>{const _0x224aef=this['_cachedContentParts']['findIndex'](_0x201d30=>_0x201d30['index']==_0xa7d82a['index']);-0x1===_0x224aef?this['_cachedContentParts']['push'](_0xa7d82a):this['_cachedContentParts'][_0x224aef]=_0xa7d82a;}):this['_cachedContentParts']=_0x38d69f;const _0x2c1352=this['_showUnchangedParts']?_0x38d69f:_0x38d69f['filter'](_0x75b0a2=>_0x75b0a2['hasChanges']);this['_actionsView']['_switchButtonLabelsPlurality'](_0x2c1352['length']>0x1);for(const _0x2b9c7e of _0x2c1352)this['_updateContentPartsPromiseQueue']['enqueue'](async _0x441aaf=>{let _0x47d399=this['getPartView'](_0x2b9c7e['index']);_0x47d399||(_0x47d399=new na(this['locale'],{'part':_0x2b9c7e,'uiIndex':this['_children']['length']+0x1,'areActionsDisabled':this['_areActionsDisabled'],'availableActions':this['_availableActions']}),_0x47d399['delegate'](...W)['to'](this),this['_children']['add'](_0x47d399),this['hasPendingParts']=!0x0),await _0x47d399['updateContent']({'part':_0x2b9c7e,'renderingStrategy':_0x2f2b48,'showUnchangedParts':this['_showUnchangedParts'],'abortSignal':_0x441aaf}),_0x47d399['markAsDone']();});return _0x45ff7c?.['addEventListener']('abort',()=>{this['_updateContentPartsPromiseQueue']['abort']();}),this['_updateContentPartsPromiseQueue']['queueEmptyPromise'];}['updatePartState'](_0x4e0293,_0x3453c7){const _0x4b4631=this['getPartView'](_0x4e0293);_0x4b4631&&(_0x4b4631['state']=_0x3453c7),this['hasPendingParts']='pending'==_0x3453c7||Array['from'](this['_children'])['some'](_0x1937c9=>'pending'==_0x1937c9['state']);}['setPartActive'](_0x18da6a,_0x13688e){if(!0x1===_0x18da6a){for(const _0x27b9e8 of this['_children'])_0x27b9e8['isActive']=!0x1;}else{const _0x2c12a6=this['getPartView'](_0x18da6a);_0x2c12a6&&(_0x2c12a6['isActive']=_0x13688e);}}['updateSources'](_0x3f0172){_0x3f0172['forEach'](_0x2b578c=>this['_sourcesView']['addSource'](_0x2b578c)),this['_sourcesView']['isVisible']=!0x0;}['getPartView'](_0x363dad){return this['_children']['find'](_0xda2f93=>_0xda2f93['partDefinition']['index']==_0x363dad)??null;}['markAsDone'](){if(!this['_showUnchangedParts']){const _0x37bd4d=!this['_cachedContentParts']['find'](({hasChanges:_0xe3f892})=>_0xe3f892),_0x401850=!!this['_cachedContentParts']['find'](({hasChanges:_0x25e7a2})=>!_0x25e7a2);this['_emptyPartsWarningView']['isVisible']=0x0==this['_children']['length']||_0x401850,_0x37bd4d?this['_emptyPartsWarningView']['setContent'](h(this['locale'],'AI_SUGGESTION_NO_PARTS_WARNING')):this['_emptyPartsWarningView']['setContent'](h(this['locale'],'AI_SUGGESTION_EMPTY_PART_WARNING'));}this['_children']['forEach'](_0x111494=>_0x111494['markAsDone']()),this['_actionsView']['updateVisibility'](this['hasNonEmptyParts']);}get['hasNonEmptyParts'](){return this['_children']['filter'](_0x88b4b8=>_0x88b4b8['partDefinition']['hasChanges'])['length']>0x0;}}class gn extends _0x1f054a{['bodyView'];['children'];['headerView'];constructor(_0x448005,_0x40c895,_0x3e3c5e){super(_0x448005);const {showDiff:_0x7346d8,areActionsDisabled:_0x1d0ef6,showUnchangedParts:_0x525ef8,availableActions:_0xcb90b9}=_0x40c895;this['set']('isTrackChangesOn',!0x1),this['set']('areChangesVisible',!0x1),this['children']=this['createCollection'](),this['headerView']=new oa(_0x448005,{'showDiff':_0x7346d8}),this['headerView']['on']('toggleShowChanges',(_0x43b1fc,_0x57592c)=>{this['areChangesVisible']=_0x57592c['isOn'],this['fire']('toggleSuggestionDisplayMode',{'showDiff':_0x57592c['isOn']});}),this['children']['add'](this['headerView']),this['bodyView']=new ca(_0x448005,{'areActionsDisabled':_0x1d0ef6,'showUnchangedParts':!!_0x525ef8,'availableActions':_0xcb90b9,'bodyCollection':_0x3e3c5e}),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'](_0xe2fc27){await this['bodyView']['updateContentParts'](_0xe2fc27);}['updateSources'](_0x32f8e3){this['bodyView']['updateSources'](_0x32f8e3);}['markAsDone'](){this['bodyView']['markAsDone'](),this['headerView']&&(this['headerView']['isShowChangesToggleVisible']=this['bodyView']['hasNonEmptyParts']);}}class Qe extends Fr{['containerView'];constructor(_0x3aafa8,_0x6d767,_0x194f4d){super(_0x6d767),this['set']('isTrackChangesOn',!0x1),this['containerView']=new gn(_0x3aafa8,{'showDiff':_0x6d767['showDiff'],'areActionsDisabled':_0x6d767['areActionsDisabled'],'availableActions':_0x6d767['availableActions']},_0x194f4d),this['containerView']['on']('toggleSuggestionDisplayMode',(_0x3798a5,_0x45a488)=>{this['fire']('toggleSuggestionDisplayMode',{'replyId':this['options']['id'],'showDiff':_0x45a488['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',(_0x6275b,{index:_0x4254b3})=>{this['fire']('showChangeInText',{'replyId':this['options']['id'],'partIndex':_0x4254b3});}),this['containerView']['on']('applySuggestion',(_0x1d15f1,{index:_0x5ebe52}={})=>{this['fire']('applySuggestion',{'replyId':this['options']['id'],'partIndex':_0x5ebe52});}),this['containerView']['on']('insertSuggestion',(_0x4d2c64,{index:_0x51d813}={})=>{this['fire']('insertSuggestion',{'replyId':this['options']['id'],'partIndex':_0x51d813});}),this['containerView']['on']('rejectSuggestion',(_0x465853,{index:_0x35d2f1})=>{this['fire']('rejectSuggestion',{'replyId':this['options']['id'],'partIndex':_0x35d2f1});}),this['containerView']['on']('mouseOverSuggestion',(_0x53ce37,{index:_0x1674bc})=>{this['fire']('mouseOverSuggestion',{'replyId':this['options']['id'],'partIndex':_0x1674bc});}),this['containerView']['on']('mouseLeaveSuggestion',(_0x2fcfb3,{index:_0x2577c0})=>{this['fire']('mouseLeaveSuggestion',{'replyId':this['options']['id'],'partIndex':_0x2577c0});}),this['children']['addMany']([this['containerView']]),this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__ai-suggestion']}});}async['updateContent'](_0x53f03f){await this['containerView']['updateContent'](_0x53f03f);}['updatePartState'](_0x240d23,_0x4a98d4){this['containerView']['bodyView']['updatePartState'](_0x240d23,_0x4a98d4);}['setPartActive'](_0xeeb7d6,_0xa0c1a5){!0x1===_0xeeb7d6?this['containerView']['bodyView']['setPartActive'](!0x1):this['containerView']['bodyView']['setPartActive'](_0xeeb7d6,_0xa0c1a5);}['updateSources'](_0x780a2b){this['containerView']['updateSources'](_0x780a2b);}['getPartView'](_0x44a42b){return this['containerView']['bodyView']['getPartView'](_0x44a42b);}['markAsDone'](){super['markAsDone'](),this['containerView']['markAsDone']();}}class Xe extends Fr{['replyContainer'];['_bodyCollection'];constructor(_0x182ce5,_0x391b90,_0x14aa92){super(_0x391b90),this['_bodyCollection']=_0x14aa92,this['locale']=_0x182ce5,this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__ai-reply']}}),this['replyContainer']=new _0x1f054a(),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':Ui(this['options']['initialContent']),'renderingStrategy':'static'}),this['markAsDone']());}async['updateContent']({parsedContent:_0x75f12c,renderingStrategy:_0x423dc8,abortSignal:_0x575f60}){'streaming'===_0x423dc8?await this['streamIntoElement'](_0x75f12c,this['replyContainer']['element'],_0x575f60):this['replyContainer']['element']['innerHTML']=_0xc63f4e(_0x75f12c);}['updateSources'](_0x7a2ce3){const _0x5a74f2=new Sr(this['locale'],this['_bodyCollection']);_0x5a74f2['children']['addMany'](_0x7a2ce3['map'](_0x5f4fb0=>new qr(this['locale'],_0x5f4fb0,_0x5a74f2['balloonPanelView']))),_0x5a74f2['isVisible']=!0x0,this['children']['add'](_0x5a74f2);}}class mi extends _0x17fe29{constructor(_0x22df11=void 0x0){super();const _0x1c494b=_0x22df11?'ck-ai-spinner_'+_0x22df11:'';this['extendTemplate']({'tag':'span','attributes':{'class':['ck-ai-spinner',_0x1c494b]}});}}const xn={'file':_0x107670,'document':_0x1ef80c,'web-resource':_0x9a2128,'text':_0x107670,'selection':_0x1f3474,'mcp-tool-context':_0x1ef80c},Ur='ck-ai-chat-context-chip',Wr='ck-ai-chat-context-chip_wide',Yr='ck-ai-chat-context-chip_document',$r='ck-ai-chat-context-chip__label',Qr='ck-ai-chat-context-chip__type-icon',Xr='ck-ai-chat-context-controls__chip-tooltip',Cn='n';class Vo extends _0x1d1b95{constructor(_0x4ba266,_0x3bdb8a,_0x95dc33,_0x5d7f15,_0x5e45cf=!0x1){super(_0x4ba266),this['_isAnimationOnEnterEnabled']=_0x5d7f15,this['_initializeProperties'](_0x3bdb8a,_0x95dc33,_0x5e45cf),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'](_0x248a5b,_0x49af7b,_0x4fb3bc){this['set']('label',_0x248a5b['label']),this['set']('tooltip',!0x0),this['set']('itemType',_0x248a5b['type']),this['set']('id',_0x248a5b['uiId']),this['set']('readonly',_0x49af7b),this['set']('isLoading',_0x4fb3bc);}['_setupTemplate'](){const _0x3656f2=this['_createIconView'](),_0x1c67ac=this['_createRemoveButton'](),_0x45e2a4=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':this['_createTemplateAttributes'](_0x45e2a4),'children':this['_createTemplateChildren'](_0x3656f2,_0x1c67ac,_0x45e2a4)});}['_createTemplateAttributes'](_0x3c5798){return{'class':[Ur,_0x3c5798['if']('itemType',Yr,_0x500938=>'document'==_0x500938),_0x3c5798['if']('itemType',Wr,_0x39c2b2=>'selection'==_0x39c2b2)],'data-cke-tooltip-text':_0x3c5798['to']('label',In),'data-cke-tooltip-position':Cn,'data-cke-tooltip-class':Xr};}['_createTemplateChildren'](_0x513573,_0x33e04f,_0x23f7cc){const _0x15fc39=this['_createLabelElement'](_0x23f7cc),_0x1d6894=this['_createLoaderIcon']();return this['readonly']?[_0x513573,_0x15fc39]:[_0x513573,_0x1d6894,_0x15fc39,_0x33e04f];}['_createLabelElement'](_0x2124ff){return{'tag':'span','attributes':{'class':$r},'children':[{'text':_0x2124ff['to']('label')}]};}['_createRemoveButton'](){const _0x2db379=new _0x1d1b95(this['locale']);return _0x2db379['set']({'label':h(this['locale'],'AI_CHAT_CONTEXT_REMOVE_FROM_CONTEXT'),'icon':_0x186d14}),this['_setupRemoveButtonEvent'](_0x2db379),_0x2db379;}['_setupRemoveButtonEvent'](_0x532fbb){_0x532fbb['on']('execute',()=>{this['fire']('removeContextItemChip',this['id']);});}['_createIconView'](){const _0x593624=this['bindTemplate'],_0x4077ec=new _0x152087();return _0x4077ec['content']=xn[this['itemType']],_0x4077ec['extendTemplate']({'attributes':{'class':[Qr,_0x593624['if']('isLoading','ck-hidden',_0x2f540c=>_0x2f540c)]}}),_0x4077ec;}['_handleAnimationEndOnce'](_0x2f8cd8,_0xa6a807){if(!_0x2f8cd8)return;const _0x563e42=()=>{_0xa6a807(),_0x2f8cd8['removeEventListener']('animationend',_0x563e42),_0x2f8cd8['removeEventListener']('webkitAnimationEnd',_0x563e42);};_0x2f8cd8['addEventListener']('animationend',_0x563e42),_0x2f8cd8['addEventListener']('webkitAnimationEnd',_0x563e42);}['_createLoaderIcon'](){const _0xb3f8af=new mi('small');return _0xb3f8af['bind']('isVisible')['to'](this,'isLoading',_0xd94bd=>_0xd94bd),_0xb3f8af;}}function In(_0x217834){if(!_0x217834)return _0x217834;if(_0x217834['length']<=0x78)return _0x217834;const _0x3c4633=_0x217834['slice'](0x0,0x78),_0x5267e4=_0x3c4633['lastIndexOf']('\x20');return(_0x5267e4>0x0?_0x3c4633['slice'](0x0,_0x5267e4):_0x3c4633)+'…';}const hn={'maxVisibleRows':0x2,'rowDetectionTolerance':0x5,'showMoreLabelPrefix':'+\x20','viewportOffset':{'top':0x64,'bottom':0xa}},an='300px';class Ro{['_locale'];['_config'];['_visibleChips'];['_overflowChips'];['_showMoreButtonView']=null;['_showMoreBalloonPanelView']=null;['_containerElement']=null;['_bodyCollection'];['_parentView']=null;['_intersectionObserver']=null;['_pendingCalculation']=!0x1;constructor(_0x4a53f3,_0x4f6758,_0x525fba,_0x5997da,_0xd6211a){this['_locale']=_0x4a53f3,this['_visibleChips']=_0x4f6758,this['_config']={...hn,..._0x525fba,'cssClasses':{'controlsButton':'','calculationContainer':'ck-calculation-container',..._0x525fba['cssClasses']}},this['_overflowChips']=new _0x405f09(),this['_bodyCollection']=_0x5997da,this['_parentView']=_0xd6211a||null;}['setContainerElement'](_0x558875){this['_intersectionObserver']&&(this['_intersectionObserver']['disconnect'](),this['_intersectionObserver']=null),this['_containerElement']=_0x558875,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 _0x2895d5=[...this['_visibleChips'],...this['_overflowChips']],_0x3850f8=this['_createCalculationContainer'](),_0x1088d7=this['_calculateOverflowInContainer'](_0x3850f8,_0x2895d5),_0x361b01=_0x3850f8['_ancestorsToRestore'];_0x361b01&&this['_restoreAncestorVisibility'](_0x361b01),_0x3850f8['remove'](),this['_applyOverflowResults'](_0x2895d5,_0x1088d7);}['_createShowMoreButton'](){this['_showMoreButtonView']=this['_createShowMoreButtonView'](),this['_showMoreBalloonPanelView']=this['_createShowMoreBalloonPanelView'](),this['_showMoreButtonView']['render'](),this['_containerElement']['appendChild'](this['_showMoreButtonView']['element']),this['_showMoreButtonView']['on']('execute',()=>{this['_handleShowMoreButtonClick']();}),_0x1d6ed3({'emitter':this['_showMoreBalloonPanelView'],'contextElements':[this['_showMoreBalloonPanelView']['element'],this['_showMoreButtonView']['element']],'callback':()=>this['hideBalloonPanel'](),'activator':()=>this['_showMoreButtonView']['isOn']});}['_createShowMoreButtonView'](){const _0x4131cc=new _0x1d1b95(this['_locale']);_0x4131cc['set']({'label':'','withText':!0x0,'isToggleable':!0x0});const _0x5ab5ae=[this['_config']['cssClasses']['showMoreButton']];return this['_config']['cssClasses']['controlsButton']&&_0x5ab5ae['push'](this['_config']['cssClasses']['controlsButton']),_0x4131cc['extendTemplate']({'attributes':{'class':_0x5ab5ae}}),_0x4131cc;}['_createShowMoreBalloonPanelView'](){const _0x10f8b4=new _0x10e1b3(this['_locale']);return _0x10f8b4['extendTemplate']({'attributes':{'class':this['_config']['cssClasses']['showMoreBalloon']}}),this['_bodyCollection']['add'](_0x10f8b4),_0x10f8b4;}['_updateBalloonContent'](){if(this['_showMoreBalloonPanelView']&&(this['_showMoreBalloonPanelView']['content']['clear'](),this['_overflowChips']['length']>0x0)){this['_overflowChips']['forEach'](_0x110677=>{_0x110677['disableAnimationOnEnter']();});const _0x4a4015=new _0x1f054a(this['_locale']);_0x4a4015['setTemplate']({'tag':'div','attributes':{'class':this['_config']['cssClasses']['overflowContainer']},'children':this['_overflowChips']}),this['_showMoreBalloonPanelView']['content']['add'](_0x4a4015);}}['_handleShowMoreButtonClick'](){this['_showMoreButtonView']['isOn']?this['hideBalloonPanel']():this['showBalloonPanel']();}['_updateShowMoreButtonVisibility'](){const _0x3b17be=this['_overflowChips']['length']>0x0;this['_showMoreButtonView']?.['element']&&(this['_showMoreButtonView']['element']['style']['display']=_0x3b17be?'':'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'](_0x31cf67){const _0x372769=this['_containerElement']?.['tagName']['toLowerCase']()||'div',_0x5c9104=this['_containerElement']?.['classList'];if(_0x5c9104){const _0x4e9c11=_0x5c9104[0x0]||'',_0x1da53e=_0x31cf67['querySelector']('.'+_0x4e9c11),_0x439568=_0x31cf67['querySelector'](_0x372769);return _0x1da53e||_0x439568||_0x31cf67;}return _0x31cf67['querySelector'](_0x372769)||_0x31cf67;}['_calculateContainerWidth'](){const _0x53b7e4=this['_parentView']?.['element']||this['_containerElement'];if(!_0x53b7e4)return an;const _0x5b26d3=window['getComputedStyle'](_0x53b7e4)['width'];if('auto'===_0x5b26d3||'0px'===_0x5b26d3||!_0x5b26d3){const _0x3338ba=_0x53b7e4['parentElement'];if(_0x3338ba){const _0x222e00=window['getComputedStyle'](_0x3338ba);return'auto'!==_0x222e00['width']?_0x222e00['width']:an;}return an;}return _0x5b26d3;}['_applyCalculationStyles'](_0x1d2408,_0x4af56b){this['_config']['cssClasses']['calculationContainer']&&_0x1d2408['classList']['add'](this['_config']['cssClasses']['calculationContainer']),_0x1d2408['style']['width']=_0x4af56b,_0x1d2408['style']['position']='absolute',_0x1d2408['style']['top']='-9999px',_0x1d2408['style']['left']='-9999px',_0x1d2408['style']['opacity']='0',_0x1d2408['style']['pointerEvents']='none',_0x1d2408['style']['zIndex']='-1',_0x1d2408['style']['visibility']='visible\x20!important',_0x1d2408['style']['display']='block\x20!important',_0x1d2408['style']['boxSizing']='border-box';}['_restoreAncestorVisibility'](_0x1bddcf){_0x1bddcf['forEach'](({element:_0xcfb6e2,originalDisplay:_0x21ece8,originalVisibility:_0x4f8ee7})=>{_0xcfb6e2['style']['display']=_0x21ece8,_0xcfb6e2['style']['visibility']=_0x4f8ee7;});}['_makeAncestorsVisible'](_0xaaa2c0){const _0x94fc6=[];let _0xe598d7=_0xaaa2c0;for(;_0xe598d7&&_0xe598d7!==document['body'];){const _0xc35ed4=window['getComputedStyle'](_0xe598d7);'none'!==_0xc35ed4['display']&&'hidden'!==_0xc35ed4['visibility']||(_0x94fc6['push']({'element':_0xe598d7,'originalDisplay':_0xe598d7['style']['display'],'originalVisibility':_0xe598d7['style']['visibility']}),_0xe598d7['style']['display']='block',_0xe598d7['style']['visibility']='visible'),_0xe598d7=_0xe598d7['parentElement'];}return _0x94fc6;}['_createContainerElements'](){let _0x1c9576,_0x2a6098;return this['_parentView']?.['element']?(_0x1c9576=this['_parentView']['element']['cloneNode'](!0x0),_0x2a6098=this['_findTargetContainer'](_0x1c9576)):(_0x1c9576=document['createElement']('div'),_0x2a6098=_0x1c9576),{'calculationContainer':_0x1c9576,'targetContainer':_0x2a6098};}['_createCalculationContainer'](){const {calculationContainer:_0x395ae1,targetContainer:_0x5cc557}=this['_createContainerElements'](),_0x3b9b57=this['_calculateContainerWidth']();this['_applyCalculationStyles'](_0x395ae1,_0x3b9b57);const _0x3a68f1=this['_parentView']?.['element']||this['_containerElement'],_0x4a584d=_0x3a68f1?.['parentElement'];_0x4a584d?_0x4a584d['appendChild'](_0x395ae1):document['body']['appendChild'](_0x395ae1),_0x395ae1['_targetContainer']=_0x5cc557;const _0xf220c7=this['_makeAncestorsVisible'](_0x4a584d||null);return _0x395ae1['offsetWidth'],_0x395ae1['_ancestorsToRestore']=_0xf220c7,_0x395ae1;}['_calculateOverflowInContainer'](_0x4e2d36,_0xc775c4){const _0x1ee522=_0x4e2d36['_targetContainer']||_0x4e2d36,_0x3e7473=[],{rowCount:_0x301fa2}=this['_renderChipsAndCountRows'](_0x1ee522,_0xc775c4);if(_0x301fa2<=this['_config']['maxVisibleRows'])return _0x3e7473;const _0x52e2a6=_0xc775c4['slice']();for(;_0x52e2a6['length']>0x0;){if(this['_testButtonFit'](_0x4e2d36,_0x1ee522,_0x52e2a6)){const _0xbec10f=_0xc775c4['filter'](_0x5192d8=>!_0x52e2a6['includes'](_0x5192d8));_0x3e7473['push'](..._0xbec10f);break;}if(!_0x52e2a6['pop']())break;}return _0x3e7473;}['_renderChipsAndCountRows'](_0x332ee9,_0x5ce798){_0x332ee9['innerHTML']='',_0x5ce798['forEach'](_0x5d1231=>{if(_0x5d1231['element']){const _0x10d813=_0x5d1231['element']['cloneNode'](!0x0);_0x332ee9['appendChild'](_0x10d813);}}),_0x332ee9['offsetWidth'];const _0x978305=_0x332ee9['children'],_0x595ea8=[];return Array['from'](_0x978305)['forEach'](_0x3126c5=>{const _0x2215d0=_0x3126c5['getBoundingClientRect']()['top'];_0x595ea8['some'](_0x463143=>Math['abs'](_0x463143-_0x2215d0)<this['_config']['rowDetectionTolerance'])||_0x595ea8['push'](_0x2215d0);}),{'rowCount':_0x595ea8['length']};}['_createMockButton'](){const _0x1f85db=document['createElement']('button');return _0x1f85db['className']=this['_config']['cssClasses']['showMoreButton'],this['_config']['cssClasses']['controlsButton']&&_0x1f85db['classList']['add'](this['_config']['cssClasses']['controlsButton']),_0x1f85db['textContent']='+\x201',_0x1f85db;}['_testButtonFit'](_0x5d779c,_0x314963,_0x7a79f4){this['_renderChipsAndCountRows'](_0x314963,_0x7a79f4);const _0x704a6d=this['_createMockButton']();_0x5d779c['appendChild'](_0x704a6d),_0x5d779c['offsetWidth'];const _0x4a7fee=[..._0x314963['children'],_0x704a6d],_0x26e849=[];_0x4a7fee['forEach'](_0x4f2b42=>{const _0xe0efe7=_0x4f2b42['getBoundingClientRect']()['top'];_0x26e849['some'](_0x305141=>Math['abs'](_0x305141-_0xe0efe7)<this['_config']['rowDetectionTolerance'])||_0x26e849['push'](_0xe0efe7);});const _0x2e161f=_0x26e849['length'];return _0x704a6d['remove'](),_0x2e161f<=this['_config']['maxVisibleRows'];}['_distributeChips'](_0x461ec0,_0x1412ae){this['_visibleChips']['clear'](),this['_overflowChips']['clear'](),_0x461ec0['forEach'](_0x2f7417=>{_0x1412ae['includes'](_0x2f7417)?this['_overflowChips']['add'](_0x2f7417):this['_visibleChips']['add'](_0x2f7417);});}['_updateOverflowUI'](_0x182f3d){if(_0x182f3d>0x0&&!this['_showMoreButtonView']&&this['_createShowMoreButton'](),_0x182f3d>0x0&&this['_showMoreButtonView']){const _0xee9d92=''+this['_config']['showMoreLabelPrefix']+(_0x182f3d<0x63?_0x182f3d:'99');this['_showMoreButtonView']['label']=_0xee9d92;}this['_updateBalloonContent'](),this['_updateShowMoreButtonVisibility'](),this['_repinBalloonPanel']();}['_applyOverflowResults'](_0x517cc0,_0x4ba99f){this['_distributeChips'](_0x517cc0,_0x4ba99f),this['_updateOverflowUI'](_0x4ba99f['length']);}['_setupVisibilityObserver'](){this['_containerElement']&&'undefined'!=typeof IntersectionObserver&&(this['_intersectionObserver']=new IntersectionObserver(_0x27d05c=>{_0x27d05c[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 _0x2e2d12=this['_containerElement']['getBoundingClientRect']();if(0x0===_0x2e2d12['width']||0x0===_0x2e2d12['height'])return!0x1;const _0x261040=window['innerHeight']||document['documentElement']['clientHeight'],_0x3326be=window['innerWidth']||document['documentElement']['clientWidth'],_0x5b0612=0xc8;return _0x2e2d12['bottom']>=-0xc8&&_0x2e2d12['top']<=_0x261040+_0x5b0612&&_0x2e2d12['right']>=-0xc8&&_0x2e2d12['left']<=_0x3326be+_0x5b0612;}}const Zr='ck-ai-chat__feed__context-chips',la='ck-ai-chat-context-chips-wrapper',ua='ck-ai-chat-context-chips-wrapper-balloon',da='ck-ai-chat-controls-button',_a='ck-ai-chat-controls_context_show-more-button',Aa='ck-ai-chat-context-controls__show-more-balloon-panel';class _h extends _0x1f054a{['_contextChips']=this['createCollection']();['_overflowManager'];['_bodyCollection'];constructor(_0x5e4412,_0x5d5d96,_0x11607a){super(_0x5e4412),this['_bodyCollection']=_0x11607a,this['_createContextChips'](_0x5d5d96);const _0x5f5578={'cssClasses':{'showMoreButton':_a,'showMoreBalloon':Aa,'overflowContainer':ua,'controlsButton':da}};this['_overflowManager']=new Ro(_0x5e4412,this['_contextChips'],_0x5f5578,this['_bodyCollection'],this),this['setTemplate']({'tag':'div','attributes':{'class':[Zr,'ck','ck-reset_all']},'children':[{'tag':'div','attributes':{'class':la},'children':this['_contextChips']}]});}['render'](){super['render']();const _0x5691f5=this['element']['querySelector']('.'+la);_0x5691f5&&(this['_overflowManager']['setContainerElement'](_0x5691f5),this['_overflowManager']['reorganizeChips']());}['destroy'](){super['destroy'](),this['_overflowManager']['destroy']();}['_createContextChips'](_0x223305){for(const _0x29ad66 of _0x223305){const _0x2dc326=new Vo(this['locale'],_0x29ad66,!0x0,!0x1);this['_contextChips']['add'](_0x2dc326);}}}class Ye extends Fr{['_contextChipsView']=null;['_locale'];['_bodyCollection'];['_messageContentView'];constructor(_0x2a4943,_0x445616,_0xf66ca1){super(_0x445616),this['_locale']=_0x2a4943,this['_bodyCollection']=_0xf66ca1,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'](_0x5d9c3d=>!_0x5d9c3d['hidden']),this['_bodyCollection']),this['_contextChipsView']['extendTemplate']({'attributes':{'class':'ck-ai-chat__feed__context-chips'}}),this['children']['add'](this['_contextChipsView']));}['_createMessageContentView'](){this['_messageContentView']=new _0x1f054a(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(_0x228470,_0x5e0e7f){super(_0x5e0e7f);const {isWebSearchEnabled:_0x5c09a8,isReasoningEnabled:_0x5bfd25}=_0x5e0e7f['capabilities'],_0x3fec2b=[];let _0x6d636d='';_0x5c09a8&&_0x5bfd25?(_0x6d636d=h(_0x228470,'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH_REASONING'),_0x3fec2b['push'](aa(_0x26bf07)),_0x3fec2b['push'](aa(_0x782cf1))):_0x5c09a8?(_0x6d636d=h(_0x228470,'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH'),_0x3fec2b['push'](aa(_0x26bf07))):_0x5bfd25&&(_0x6d636d=h(_0x228470,'AI_CHAT_FEED_REPLY_ITEM_USED_REASONING'),_0x3fec2b['push'](aa(_0x782cf1))),this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__interaction-header',_0x6d636d?'':'ck-hidden']}});const _0x147724=new _0x1f054a();_0x147724['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__interaction-header__capabilities']},'children':[..._0x3fec2b,{'tag':'span','attributes':{'class':['ck-ai-chat__feed__interaction-header__capabilities__text']},'children':[_0x6d636d]}]}),this['children']['add'](_0x147724),this['capabilities']=_0x5e0e7f['capabilities'];}}function aa(_0x52d613){const _0x3d3bb0=new _0x152087();return _0x3d3bb0['content']=_0x52d613,_0x3d3bb0;}const Fs=['wheel','touchstart','pointerdown','keydown'],qs=['ArrowUp','ArrowDown','PageUp','PageDown','Home','End','\x20'];class ai{['element'];['animationFrameId'];['isRunning'];['abortController'];['isUserPaused'];constructor(_0x4e6457){this['element']=_0x4e6457,this['animationFrameId']=null,this['isRunning']=!0x1,this['abortController']=new AbortController(),this['isUserPaused']=!0x1;for(const _0x51e075 of Fs){const _0x529c2a='keydown'!==_0x51e075;this['element']['addEventListener'](_0x51e075,this['_onUserEvent']['bind'](this),{'passive':_0x529c2a,'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'](_0x1e7ca7){if(this['isRunning']){if('keydown'===_0x1e7ca7['type']){const _0xb21d86=_0x1e7ca7['key'];if(!qs['includes'](_0xb21d86))return;}_0x1e7ca7 instanceof WheelEvent?_0x1e7ca7['deltaY']<0x0?this['isUserPaused']=!0x0:this['isUserPaused']=!this['_isAtBottom']():this['isUserPaused']=!0x0;}}['_isAtBottom'](){const {scrollTop:_0x292ecc,scrollHeight:_0xbaee0c,clientHeight:_0x1afecd}=this['element'];return _0xbaee0c-_0x292ecc-_0x1afecd<=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 _0x1f054a{constructor(_0x27d478,_0x1bba17){super(_0x27d478),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-skeleton']},'children':this['_createSkeletonItems'](_0x1bba17)});}['_createSkeletonItems'](_0x16d078){const _0x2ee84f=['ck','ck-ai-skeleton__item'];return _0x16d078['map'](_0x5418e6=>{let _0x14bcdb='';switch(_0x5418e6['attributes']['align']){case'right':_0x14bcdb='margin-left:\x20auto;\x20margin-right:\x200;\x20text-align:\x20right;';break;case'center':_0x14bcdb='margin-left:\x20auto;\x20margin-right:\x20auto;\x20text-align:\x20center;';break;case'left':_0x14bcdb='margin-left:\x200;\x20margin-right:\x20auto;\x20text-align:\x20left;';}return{'tag':_0x5418e6['tag'],'attributes':{'class':[..._0x2ee84f,_0x5418e6['attributes']['class']?_0x5418e6['attributes']['class']:''],'style':'width:\x20'+_0x5418e6['attributes']['width']+';\x20height:\x20'+_0x5418e6['attributes']['height']+';'+_0x14bcdb}};});}}const li={'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(_0x15e804,_0x29b245,_0x570d55,_0x56021a){return new Array(_0x15e804)['fill'](null)['map'](()=>({'tag':'div','attributes':{'width':_0x29b245,'height':_0x570d55,'align':_0x56021a}}));}class gi extends Fr{constructor(_0x323fec){super(_0x323fec),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 ui extends _0x1f054a{['children'];['scrollManager'];['_bodyCollection'];constructor(_0x1e12b8,_0x34c0fa){super(_0x1e12b8),this['_bodyCollection']=_0x34c0fa,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 ai(this['element']);}['destroy'](){super['destroy'](),this['scrollManager']['destroy']();}['clear'](){this['children']['clear']();}['addItem'](_0x1e3edd,_0x2e4fcb){let _0x1a5d88;return'ai-reply'===_0x1e3edd?_0x1a5d88=new Xe(this['locale'],_0x2e4fcb,this['_bodyCollection']):'ai-suggestion-reply'===_0x1e3edd?(_0x1a5d88=new Qe(this['locale'],_0x2e4fcb,this['_bodyCollection']),_0x1a5d88['bind']('isTrackChangesOn')['to'](this)):_0x1a5d88='user-message'===_0x1e3edd?new Ye(this['locale'],_0x2e4fcb,this['_bodyCollection']):'interaction-header'===_0x1e3edd?new Ct(this['locale'],_0x2e4fcb):'custom-element'===_0x1e3edd?new gi(_0x2e4fcb):new Ze(_0x2e4fcb),this['children']['add'](_0x1a5d88),_0x1a5d88;}async['updateReplyItem']({id:_0x50d7c7,parsedContent:_0x3fccfb,renderingStrategy:_0x4c1b48,abortSignal:_0x131c6e}){const _0x5bc6ce=this['getItemById'](_0x50d7c7);if(!(_0x5bc6ce instanceof Xe))throw new _0x25c351('ai-chat-feed-view-item-not-a-reply-item',null,{'itemView':_0x5bc6ce,'id':_0x50d7c7,'parsedContent':_0x3fccfb});await _0x5bc6ce['updateContent']({'parsedContent':_0x3fccfb,'renderingStrategy':_0x4c1b48,'abortSignal':_0x131c6e});}async['updateWebSources'](_0x3bfe78,_0x1c597d){const _0x5d01ac=this['getItemById'](_0x3bfe78);if(_0x5d01ac instanceof Qe)_0x5d01ac['updateSources'](_0x1c597d);else{if(!(_0x5d01ac instanceof Xe))throw new _0x25c351('ai-chat-feed-view-item-not-a-suggestion-or-reply-item',null,{'itemView':_0x5d01ac,'id':_0x3bfe78,'sources':_0x1c597d});_0x5d01ac['updateSources'](_0x1c597d);}}async['updateSuggestionItem']({id:_0x32f62b,parts:_0x5a367c,renderingStrategy:_0x43c7a7,abortSignal:_0x540c3b}){const _0x1fd417=this['getItemById'](_0x32f62b);if(!(_0x1fd417 instanceof Qe))throw new _0x25c351('ai-chat-feed-view-item-not-a-suggestion-item',null,{'itemView':_0x1fd417,'id':_0x32f62b,'parts':_0x5a367c});await _0x1fd417['updateContent']({'parts':_0x5a367c,'renderingStrategy':_0x43c7a7,'abortSignal':_0x540c3b});}['updateSuggestionPartState']({id:_0x24f3b0,index:_0x15f140,state:_0x3271ca}){const _0x5760c9=this['getItemById'](_0x24f3b0);if(!(_0x5760c9 instanceof Qe))throw new _0x25c351('ai-chat-feed-view-item-not-a-suggestion-item',this,{'id':_0x24f3b0});_0x5760c9['updatePartState'](_0x15f140,_0x3271ca);}['setSuggestionPartActive']({id:_0x362e9f,index:_0x4d4cc6,isActive:_0x4aa0de}){const _0x494516=this['getItemById'](_0x362e9f);if(!(_0x494516 instanceof Qe))throw new _0x25c351('ai-chat-feed-view-item-not-a-suggestion-item',this,{'id':_0x362e9f});this['children']['filter'](_0x3ae1b8=>_0x3ae1b8 instanceof Qe)['forEach'](_0x5d7dfa=>{_0x5d7dfa['setPartActive'](!0x1);}),_0x494516['setPartActive'](_0x4d4cc6,_0x4aa0de);}['markItemAsDone'](_0x46621f){this['getItemById'](_0x46621f)['markAsDone']();}['getItemIds'](){return this['children']['map'](_0x286bc1=>_0x286bc1['options']['id']);}['removeItem'](_0x47e8fa){this['children']['remove'](this['getItemById'](_0x47e8fa));}['hasItem'](_0x120ff9){return!!this['children']['find'](_0xaeaf84=>_0xaeaf84['options']['id']['includes'](_0x120ff9));}['scrollToSuggestion'](_0x426fef,_0x1543f6){const _0x4153c2=this['getItemById'](_0x426fef);if(!(_0x4153c2 instanceof Qe))return void _0x1c9a23('ck-ai-chat-feed-view-scroll-to-suggestion-invalid-item',{'replyId':_0x426fef,'partIndex':_0x1543f6});const _0x1f702e=_0x4153c2['getPartView'](_0x1543f6);_0x1f702e?_0x2d39e3(_0x1f702e['element'],0x14,this['element']['parentElement'],!0x0,!0x0):_0x1c9a23('ck-ai-chat-feed-view-scroll-to-suggestion-part-view-not-found',{'replyId':_0x426fef,'partIndex':_0x1543f6});}['_setupTemplate'](){this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed']},'children':this['_createTemplateChildren']()});}['_createTemplateChildren'](){const _0x1f5c6b=this['_createSkeletonLoader']();return[this['_createFeedItems'](),_0x1f5c6b,this['_createFeedLoader']()];}['_createSkeletonLoader'](){const _0x339fef=new di(this['locale'],li['aiFeed']);return _0x339fef['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isLoadingSkeletonVisible','ck-hidden',_0x1a4d8e=>!_0x1a4d8e)]}}),_0x339fef;}['_createFeedItems'](){const _0x552032=new _0x1f054a(this['locale']);return _0x552032['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__items',this['bindTemplate']['if']('isLoadingSkeletonVisible','ck-hidden')]},'children':this['children']}),_0x552032;}['_createFeedLoader'](){const _0x3fe236=new _0x1f054a(this['locale']);return _0x3fe236['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__loader',this['bindTemplate']['if']('isPending','ck-hidden',_0x5d4a68=>!_0x5d4a68)]},'children':this['_createLoaderChildren']()}),_0x3fe236;}['_createLoaderChildren'](){const _0x19d7ec=new mi();return _0x19d7ec['isVisible']=!0x0,[_0x19d7ec,{'tag':'span','attributes':{'class':['ck','ck-ai-chat__loader-text']},'children':[{'text':this['bindTemplate']['to']('loadingMessage')}]}];}['getItemById'](_0x4adfe3){const _0x1ad52f=this['children']['find'](_0x14f514=>_0x14f514['options']['id']['includes'](_0x4adfe3));if(!_0x1ad52f)throw new _0x25c351('ai-chat-feed-view-item-not-found',this,{'id':_0x4adfe3});return _0x1ad52f;}['setLoadingMessage'](_0x5a27e6){this['set']('loadingMessage',_0x5a27e6);}['toggleLoadingSkeleton'](_0x1e3abf){this['set']('isLoadingSkeletonVisible',_0x1e3abf);}['startAutoScroll'](){this['scrollManager']['start']();}['stopAutoScroll'](){this['scrollManager']['stop']();}}class ph extends _0xc6bdf6{['filter'](){let _0x33ce36=0x0;for(const _0x2e1bb4 of this['items'])_0x33ce36+=_0x2e1bb4['items']['length'];return{'resultsCount':_0x33ce36,'totalItemsCount':_0x33ce36};}}const uh='ck-ai-chat__prompt-input_highlighted';class _s extends _0x9be194{['submitButtonView'];static ['MIN_ROWS']=0x1;static ['MAX_ROWS']=0xc;['_addContextButtonView'];['_queryViewResizeObserver'];constructor(_0x27d531,_0xb20f34){super(_0x27d531,{'queryView':{'label':'','creator':_0x2dda8d,'showIcon':!0x1,'showResetButton':!0x1},'filteredView':new ph(_0x27d531),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1}),this['set']('isEmpty',!0x0),this['set']('isUploadInProgress',!0x1),this['_addContextButtonView']=_0xb20f34,this['_queryViewResizeObserver']=null,this['queryView']['fieldView']['minRows']=_s['MIN_ROWS'],this['queryView']['fieldView']['maxRows']=_s['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',(_0x452f0e,_0x172a2d)=>!_0x452f0e&&!_0x172a2d),this['focusableChildren']['add'](this['submitButtonView']);}['render'](){super['render'](),this['queryView']['fieldWrapperChildren']['add'](this['submitButtonView']),this['keystrokes']['set']('enter',(_0x5b502c,_0x280655)=>{this['isUploadInProgress']||this['isEmpty']||_0x5b502c['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0x280655());}),this['queryView']['fieldView']['on']('update',()=>{this['isEmpty']=''===this['queryView']['fieldView']['element']['value']?.['trim']();});}['destroy'](){super['destroy'](),this['_queryViewResizeObserver']&&this['_queryViewResizeObserver']['destroy']();}['submit'](){const _0x5a7483=this['queryView']['fieldView']['element']['value']?.['trim']();if(!_0x5a7483)return this['queryView']['errorText']=h(this['locale'],'AI_CHAT_PROMPT_EMPTY_ERROR'),void(this['queryView']['fieldView']['hasError']=!0x0);this['queryView']['fieldView']['hasError']=!0x1;const _0x374f13=_0x4ae586(_0x5a7483);this['fire']('sendUserMessage',_0x374f13),this['queryView']['fieldView']['reset']();}['setPlaceholderText'](_0xb7e5a){this['queryView']['fieldView']['set']('placeholder',_0xb7e5a);}['focus'](_0x5e26c8=!0x1){super['focus'](),_0x5e26c8&&(this['element']['classList']['contains'](uh)||(this['element']['classList']['add'](uh),setTimeout(()=>{this['element']['classList']['remove'](uh);},0x320)));}['_createSubmitButton'](){const _0x1ed820=new _0x1d1b95(this['locale']);return _0x1ed820['set']({'icon':_0x4d010f,'label':h(this['locale'],'AI_CHAT_LABEL_SUBMIT'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-chat__prompt-submit-button','isEnabled':!0x1}),_0x1ed820['on']('execute',()=>{this['submit']();}),_0x1ed820;}['setIsUploadInProgress'](_0x2ce79b){this['isUploadInProgress']=_0x2ce79b;}['_setUpAddContextButtonPositioning'](){const _0x223e03=this['locale'],_0x50d711=()=>{_0x1385df['window']['requestAnimationFrame'](()=>{if(_0x3e9e44(this['element'])){const _0x446e40=new _0x5002e3(this['queryView']['fieldView']['element']),_0x2f6a9a=new _0x5002e3(this['_addContextButtonView']['element']),_0x45cd54=_0x446e40['width'],_0x5d5c5e='rtl'===_0x223e03['uiLanguageDirection']?'right':'left';_0x446e40['excludeScrollbarsAndBorders']();const _0x50ea1d=_0x45cd54-_0x446e40['width']+0x1;this['_addContextButtonView']['element']['style'][_0x5d5c5e]='calc('+(_0x45cd54-_0x2f6a9a['width']-_0x50ea1d)+'px\x20-\x20var(--ck-spacing-tiny))';}});};this['queryView']['fieldView']['on']('update',_0x50d711),this['on']('render',()=>{_0x50d711(),this['_queryViewResizeObserver']=new _0x54df55(this['queryView']['fieldView']['element'],()=>{_0x50d711();});});}}const ga='ck-ai-chat__prompt-capabilities',Ia='ck-ai-chat-controls-button',Ea='ck-ai-chat-controls-button--commands',pa='ck-ai-button-tertiary',Ta='ck-ai-chat-controls__model-selection',ma='ck-ai-chat-controls__model-selection__item-name',Ca='ck-ai-chat-controls__model-selection__item-description',wa='ck-ai-chat-controls__model-selection__item-capabilities',fa='n';class vs extends _0x1f054a{['_webSearchButton'];['_reasoningButton'];['_commandsButton'];['_modelSelectionDropdown'];['_modelSelectionDropdownItems'];['_modelNameView'];constructor(_0x5bb09b){super(_0x5bb09b),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',_0x4fa0ea=>'selector'===_0x4fa0ea),this['_modelSelectionDropdown']['buttonView']['bind']('tooltip')['to'](this,'modelSelectorEnabled',_0xedf1e9=>_0xedf1e9?this['_modelSelectionDropdown']['buttonView']['label']:h(this['locale'],'AI_CHAT_MODEL_SELECTOR_DISABLED_TOOLTIP')),this['_modelSelectionDropdown']['bind']('isEnabled')['to'](this,'modelSelectorEnabled',_0x3862dd=>_0x3862dd),this['_webSearchButton']['bind']('isOn')['to'](this,'webSearchActive',_0x5f2808=>_0x5f2808),this['_webSearchButton']['bind']('tooltip')['to'](this,'webSearchActive',_0x4be189=>h(this['locale'],_0x4be189?'AI_CHAT_DISABLE_WEB_SEARCH':'AI_CHAT_ENABLE_WEB_SEARCH')),this['_reasoningButton']['bind']('isOn')['to'](this,'reasoningActive',_0x18bde1=>_0x18bde1),this['_reasoningButton']['bind']('tooltip')['to'](this,'reasoningActive',_0x164f72=>h(this['locale'],_0x164f72?'AI_CHAT_DISABLE_REASONING':'AI_CHAT_ENABLE_REASONING')),this['setTemplate']({'tag':'div','attributes':{'class':[ga]},'children':[this['_modelSelectionDropdown'],this['_modelNameView'],this['_webSearchButton'],this['_reasoningButton'],this['_commandsButton']]}),this['_modelSelectionDropdownItems']=new _0x405f09(),_0x46fef8(this['_modelSelectionDropdown'],this['_modelSelectionDropdownItems']);}['setModelList'](_0xe0c378,_0x2bfa2e){if(_0x2bfa2e)this['set']('modelDisplayMode','hidden');else{const _0x4068af=0x1===_0xe0c378['length'];this['set']('modelDisplayMode',_0x4068af?'name':'selector');}if(this['_modelSelectionDropdownItems']['clear'](),_0xe0c378?.['length'])for(const _0x2d68aa of _0xe0c378){const _0x509351=new _0x53ecce({'label':_0x2d68aa['name'],'withText':!0x0,'role':'menuitemradio','id':_0x2d68aa['id'],'model':_0x2d68aa});_0x509351['bind']('isOn')['to'](this,'activeModelId',_0x51a162=>_0x51a162===_0x2d68aa['id']),this['_modelSelectionDropdownItems']['add']({'type':'button','model':_0x509351,'labelView':new Sa(this['locale'],_0x2d68aa)});}}['setWebSearch'](_0x86887){this['set']('webSearchActive',_0x86887);}['setReasoning'](_0x3c9623){this['set']('reasoningActive',_0x3c9623);}['setModel'](_0x16f1f5){if(!_0x16f1f5)return;this['activeModelId']=_0x16f1f5['id'],this['activeModelName']=_0x16f1f5['name']||_0x16f1f5['id'],this['_modelSelectionDropdown']['buttonView']['set']('label',_0x16f1f5['name']),this['_modelSelectionDropdown']['buttonView']['set']('tooltip',_0x16f1f5['name']);const _0x482dfb=_0x16f1f5['capabilities']['webSearch']?.['enabled']??!0x1;this['set']('webSearchActive',!0x1),this['_webSearchButton']['set']('isOn',!0x1),this['_webSearchButton']['set']('isEnabled',_0x482dfb),this['_webSearchButton']['set']('isVisible',_0x482dfb);const _0x1301a4=_0x16f1f5['capabilities']['reasoning']?.['enabled']??!0x1;this['set']('reasoningActive',!0x1),this['_reasoningButton']['set']('isOn',!0x1),this['_reasoningButton']['set']('isEnabled',_0x1301a4),this['_reasoningButton']['set']('isVisible',_0x1301a4);}['enableModelSelector'](){this['set']('modelSelectorEnabled',!0x0);}['disableModelSelector'](_0x32bb74){this['set']('modelSelectorEnabled',!0x1),_0x32bb74&&this['set']('modelDisplayMode','hidden');}['_createWebSearchButton'](){const _0xdc8f7=new _0x1d1b95();return _0xdc8f7['set']({'label':h(this['locale'],'AI_CHAT_SEARCH_WEB'),'icon':_0x26bf07,'class':Ia,'isToggleable':!0x0,'tooltipPosition':fa}),_0xdc8f7['on']('execute',()=>{this['fire']('toggleWebSearch');}),_0xdc8f7;}['_createReasoningButton'](){const _0x188f98=new _0x1d1b95();return _0x188f98['set']({'label':h(this['locale'],'AI_CHAT_REASONING'),'icon':_0x782cf1,'class':Ia,'isToggleable':!0x0,'tooltipPosition':fa}),_0x188f98['on']('execute',()=>{this['fire']('toggleReasoning');}),_0x188f98;}['_createCommandsButton'](){const _0x129b6b=new _0x1d1b95();return _0x129b6b['set']({'label':h(this['locale'],'AI_CHAT_COMMANDS'),'icon':_0x2e776a,'withText':!0x0,'class':Ia,'isToggleable':!0x0,'tooltip':h(this['locale'],'AI_CHAT_COMMANDS'),'tooltipPosition':fa}),_0x129b6b['extendTemplate']({'attributes':{'class':[Ea]}}),_0x129b6b['on']('execute',()=>{console['log']('Commands\x20are\x20not\x20implemented\x20yet.'),alert('Commands\x20are\x20not\x20implemented\x20yet.');}),_0x129b6b;}['_createModelSelectionDropdown'](){const _0x24ca20=_0x290605(this['locale']);return _0x24ca20['set']({'panelPosition':'ne','class':[Ta]}),_0x24ca20['buttonView']['set']({'label':h(this['locale'],'AI_CHAT_MODEL_SELECTOR_ENABLED_TOOLTIP'),'withText':!0x0,'tooltip':!0x0,'tooltipPosition':fa,'class':pa}),this['listenTo'](_0x24ca20,'execute',_0x474c52=>{this['fire']('selectModel',_0x474c52['source']['model']);}),_0x24ca20;}['_createModelNameView'](){const _0x3f7a1a=new ba(this['locale']);return _0x3f7a1a['bind']('text')['to'](this,'activeModelName',_0x5b719a=>_0x5b719a??''),_0x3f7a1a['bind']('isVisible')['to'](this,'modelDisplayMode',_0x5cad43=>'name'===_0x5cad43),_0x3f7a1a;}}let Sa=class extends _0x34171b{constructor(_0x1b4ba6,_0x333a1d){super();const _0x5c835a=this['bindTemplate'],_0x34491c=this['createCollection']();this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-button__label'],'style':_0x5c835a['to']('style'),'id':_0x5c835a['to']('id')},'children':[{'tag':'div','attributes':{'class':[ma]},'children':[{'text':_0x5c835a['to']('text')}]},{'tag':'div','attributes':{'class':[Ca]},'children':[{'tag':'span','children':[{'text':_0x333a1d['description']}]}]},{'tag':'div','attributes':{'class':[wa]},'children':_0x34491c}]}),_0x34491c['addMany'](this['_getCapabilityParts'](_0x1b4ba6,_0x26bf07,'AI_CHAT_SEARCH_WEB',_0x333a1d['capabilities']['webSearch']?.['enabled']??!0x1)),_0x34491c['addMany'](this['_getCapabilityParts'](_0x1b4ba6,_0x782cf1,'AI_CHAT_REASONING',_0x333a1d['capabilities']['reasoning']?.['enabled']??!0x1));}['_getCapabilityParts'](_0x126ea1,_0x289018,_0x4ff4a1,_0x4fa9d4){const _0x1d40f4=new _0x152087();_0x1d40f4['content']=_0x289018;const _0x4ab420=new _0x1f054a(_0x126ea1);_0x4ab420['setTemplate']({'tag':'span','children':[{'text':h(_0x126ea1,_0x4ff4a1)+':\x20'}]});const _0x1b37f7=new _0x1f054a(_0x126ea1);return _0x1b37f7['setTemplate']({'tag':'span','children':[{'text':h(_0x126ea1,_0x4fa9d4?'AI_CHAT_CAPABILITIES_YES':'AI_CHAT_CAPABILITIES_NO')}]}),[_0x1d40f4,_0x4ab420,_0x1b37f7];}},ba=class extends _0x1f054a{constructor(_0x4cf3c0){super(_0x4cf3c0),this['set']('text',void 0x0),this['set']('isVisible',!0x0);const _0x3e85fc=this['bindTemplate'];this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-chat-controls__model-name',_0x3e85fc['if']('isVisible','ck-hidden',_0x2f4d32=>!_0x2f4d32)]},'children':[{'text':_0x3e85fc['to']('text')}]});}};const Ra='ck-ai-chat-context-controls__url-form',Oa='ck-ai-chat-context-controls__url-input-section';class Po extends _0x1f054a{['focusTracker'];['keystrokes'];['_focusables'];['focusCycler'];['urlInputField'];['backButton'];['confirmButton'];constructor(_0x5444f4){super(_0x5444f4),this['focusTracker']=new _0x50d771(),this['keystrokes']=new _0x407d91(),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 _0x18b3f0({'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'](_0x2b47ee=>{this['focusTracker']['add'](_0x2b47ee['element']),this['keystrokes']['listenTo'](_0x2b47ee['element']);}),_0x5b1132({'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'](_0x3722d9){this['urlInputField']['errorText']=_0x3722d9,this['_updateConfirmButtonState'](),this['fire']('refreshBalloon');}['clearError'](){this['urlInputField']['errorText']=null,this['_updateConfirmButtonState']();}['_createBackButton'](){const _0x2ab844=new _0x1d1b95(this['locale']);return _0x2ab844['set']({'icon':_0x37ead0,'tooltip':h(this['locale'],'AI_CHAT_CONTEXT_URL_BACK_TO_CONTEXT'),'tooltipPosition':'n','class':['ck-button-icon\x20ck-button-back']}),this['on']('change:withBackButton',(_0x349b12,_0x5f165c,_0x23e08c)=>{_0x2ab844['set']({'class':['ck-button-icon\x20ck-button-back'+(_0x23e08c?'':'\x20ck-hidden')]});}),_0x2ab844;}['_createUrlInputField'](){const _0x244aba=new _0x1e4591(this['locale'],_0x4b3e4e);return _0x244aba['set']({'label':h(this['locale'],'AI_CHAT_CONTEXT_URL_LABEL'),'class':'ck-labeled-field-view_empty'}),_0x244aba['fieldView']['set']({'placeholder':h(this['locale'],'AI_CHAT_CONTEXT_URL_PLACEHOLDER')}),_0x244aba;}['_createConfirmButton'](){const _0x9a2c31=new _0x1d1b95(this['locale']);return _0x9a2c31['set']({'icon':_0xa99da,'tooltip':h(this['locale'],'AI_CHAT_CONTEXT_URL_ADD_URL'),'tooltipPosition':'n','class':'ck-button-icon','type':'submit','isEnabled':!0x1}),_0x9a2c31;}['_setupTemplate'](){const _0x5028d8=new _0x337d54(this['locale'],{'label':h(this['locale'],'AI_CHAT_CONTEXT_URL_ADD_URL'),'class':'ck-ai-header\x20ck-ai-header_small\x20ck-ai-header_context-url'});_0x5028d8['children']['add'](this['backButton'],0x0),this['setTemplate']({'tag':'form','attributes':{'class':Ra,'tabindex':'-1'},'children':[_0x5028d8,{'tag':'div','attributes':{'class':Oa},'children':[this['urlInputField'],this['confirmButton']]}]});}['_setupEventHandlers'](){this['backButton']['on']('execute',()=>{this['clear'](),this['fire']('cancel');}),this['urlInputField']['fieldView']['on']('input',()=>{this['clearError'](),this['_updateConfirmButtonState'](),this['fire']('refreshBalloon');}),this['on']('submit',_0xad9357=>{_0xad9357['stop'](),this['_handleSubmit']();});}['_setupKeystrokes'](){this['keystrokes']['set']('esc',(_0x48bab7,_0x4ac738)=>{this['clear'](),this['fire']('cancel'),_0x4ac738();});}['_handleSubmit'](){const _0x2ef8ac=this['getValue']()['trim']();_0x2ef8ac?this['_isValidUrl'](_0x2ef8ac)?(this['clearError'](),this['fire']('submitUrl',_0x2ef8ac)):this['setError'](h(this['locale'],'AI_CHAT_CONTEXT_URL_INVALID_ERROR')):this['setError'](h(this['locale'],'AI_CHAT_CONTEXT_URL_EMPTY_ERROR'));}['_updateConfirmButtonState'](){const _0x5ce6af=this['getValue']()['trim'](),_0x1f9bbe=!!this['urlInputField']['errorText'];this['confirmButton']['isEnabled']=_0x5ce6af['length']>0x0&&!_0x1f9bbe;}['_isValidUrl'](_0x44df3f){try{return!!new URL(_0x44df3f);}catch{return!0x1;}}}const ka='ck-ai-chat-resources__item',Na='ck-ai-chat-resources__item--in-context',ya='ck-ai-chat-resources__item-title',va='ck-ai-chat-resources__item__icon';class hc extends _0x2a0bb9{['resource'];['_titleView'];['_iconView'];constructor(_0x5bef28,_0x4ef596){super(_0x5bef28),this['resource']=_0x4ef596,this['set']('isInContext',!!_0x4ef596['isInContext']),this['_titleView']=this['_createTitleView'](),this['_iconView']=this['_createIconView'](),this['_setupTemplate']();}['render'](){super['render']();}['getResourceIcon'](_0x4fe102){if(_0x4fe102['isInContext'])return _0xa99da;switch(_0x4fe102['type']){case Fe['DOCUMENT']:return _0x1ef80c;case Fe['URL']:return _0x9a2128;case Fe['FILE']:case Fe['TEXT']:return _0x107670;default:return _0x4791e0;}}['highlightText'](_0x5e80b6){if(!_0x5e80b6||''===_0x5e80b6['trim']())return void this['_titleView']['highlightText'](null);const _0xfefece=new RegExp(_0x1afc1d(_0x5e80b6),'gi');this['_titleView']['highlightText'](_0xfefece);}['updateResourceState'](_0x4ee534){this['resource']['isInContext']=_0x4ee534,this['isInContext']=_0x4ee534,this['_updateIcon']();}['_createTitleView'](){const _0x542559=new _0x5ecd8f();return _0x542559['text']=this['resource']['label'],_0x542559['extendTemplate']({'tag':'span','attributes':{'class':[ya]}}),_0x542559;}['_createIconView'](){const _0x545fad=new _0x152087();return _0x545fad['content']=this['getResourceIcon'](this['resource']),_0x545fad;}['_setupTemplate'](){const _0x2a7547=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':[ka,_0x2a7547['if']('isVisible','ck-hidden',_0x4e5b0a=>!_0x4e5b0a),_0x2a7547['if']('isInContext',Na)]},'children':[{'tag':'div','attributes':{'class':[va]},'children':[this['_iconView']]},this['_titleView']],'on':{'click':_0x2a7547['to']('execute')}});}['_updateIcon'](){this['_iconView']['content']=this['getResourceIcon'](this['resource']);}}const xa='ck-ai-chat-resources__list';class Lr extends _0xc6bdf6{['_source'];constructor(_0x36bc95,_0x48a84f){super(_0x36bc95),this['_source']=_0x48a84f,this['extendTemplate']({'attributes':{'class':[xa]}});}['setResources'](_0x354a7a,_0x221d7d){this['items']['clear']();let _0x26b24a=_0x354a7a;if(this['_source']['useDefaultFiltering']&&_0x221d7d&&''!==_0x221d7d['trim']()){const _0x4513f7=new RegExp(_0x221d7d['replace'](/[.*+?^${}()|[\]\\]/g,'\x5c$&'),'gi');_0x26b24a=_0x354a7a['filter'](_0x35890a=>_0x4513f7['test'](_0x35890a['label']));}for(const _0x514229 of _0x26b24a){const _0xeed780=new hc(this['locale'],_0x514229);_0xeed780['on']('execute',()=>{this['_handleResourceSelection'](this['_source'],_0x514229);}),this['items']['add'](_0xeed780);}this['_source']['useDefaultFiltering']&&this['highlightText'](_0x221d7d);}['highlightText'](_0x53d22b){this['_source']['useDefaultFiltering']&&this['items']['forEach'](_0x103250=>{_0x103250['highlightText'](_0x53d22b);});}['updateResourceState'](_0x11257a,_0x2e2854){for(const _0x2f240d of this['items']){const _0x182059=_0x2f240d;_0x182059['resource']['id']===_0x11257a&&_0x182059['updateResourceState'](_0x2e2854);}}['_handleResourceSelection'](_0x27d0bb,_0x293f74){this['fire']('addResourceToContext',{'source':_0x27d0bb,'resource':_0x293f74});}}class Tr extends _0x1e4591{['iconView'];['resetButtonView'];['_viewConfig'];constructor(_0x138e97){const t=_0x138e97['t'],_0x365f35={'showResetButton':!0x0,'showIcon':!0x0,'creator':_0x4b3e4e,'label':h(_0x138e97,'AI_CHAT_SEARCH_RESOURCES')};super(_0x138e97,_0x365f35['creator']),this['label']=_0x365f35['label'],this['_viewConfig']=_0x365f35,this['_viewConfig']['showIcon']&&this['_setupSearchIcon'](),this['_viewConfig']['showResetButton']&&this['_setupResetButton'](_0x138e97,t),this['_setupEventListeners']();}['reset'](){this['fieldView']['reset'](),this['_viewConfig']['showResetButton']&&this['resetButtonView']&&(this['resetButtonView']['isVisible']=!0x1),this['search']('');}['search'](_0x25035d){this['fire']('search',_0x25035d);}['getQuery'](){return this['fieldView']['element']?.['value']||'';}['_setupSearchIcon'](){this['iconView']=new _0x152087(),this['iconView']['content']=_0x3d0ec3,this['fieldWrapperChildren']['add'](this['iconView'],0x0),this['extendTemplate']({'attributes':{'class':'ck-search__query_with-icon'}});}['_setupResetButton'](_0xe0210a,t){this['resetButtonView']=new _0x1d1b95(_0xe0210a),this['resetButtonView']['set']({'label':t('Clear'),'icon':_0x12f0df,'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',_0x1e5861=>!_0x1e5861),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 _0x1f054a{['_searchView'];['_searchSection'];['_searchInputVisibleFrom'];['_resourcesListView'];['_skeletonLoader'];['_source'];['children'];['_latestLoadResourcesUid']=null;constructor(_0x5debd0,_0xb92ae1){super(_0x5debd0),this['_source']=_0xb92ae1['source'],this['_searchInputVisibleFrom']=_0xb92ae1['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 _0x44a698([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 _0x4341b9=new _0x1f054a(this['locale']);return _0x4341b9['setTemplate']({'tag':'div','attributes':{'class':'ck\x20ck-search'},'children':[this['_searchView']]}),this['_searchView']['on']('search',(_0x2b5f69,_0x3c8615)=>{this['loadResources'](_0x3c8615),this['_source']['useDefaultFiltering']&&this['_resourcesListView']['highlightText'](_0x3c8615);}),_0x4341b9;}['_createResourcesListView'](){const _0x207a3b=new Lr(this['locale'],this['_source']);return _0x207a3b['delegate']('addResourceToContext')['to'](this),_0x207a3b['extendTemplate']({'attributes':{'class':this['bindTemplate']['if']('isLoading','ck-hidden')}}),_0x207a3b;}['_createSkeletonView'](){const _0x4eae4a=new di(this['locale'],li['aiChatResources']);return _0x4eae4a['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isLoading','ck-hidden',_0x3a9ada=>!_0x3a9ada)]}}),_0x4eae4a;}['render'](){super['render'](),this['loadResources']('');}['loadResources'](_0xc65b9c){const _0x792e4d=_0x677d44();this['_latestLoadResourcesUid']=_0x792e4d,this['fire']('loadSourceResources',{'sourceId':this['_source']['id'],'query':_0xc65b9c,'uid':_0x792e4d}),this['isLoading']=!0x0;}['setResources'](_0x5d876e,_0x39f435){if(_0x39f435&&_0x39f435!==this['_latestLoadResourcesUid'])return;const _0x521f7c=this['_source']['useDefaultFiltering']?this['_searchView']['getQuery']():'';this['_resourcesListView']['setResources'](_0x5d876e,_0x521f7c),_0x5d876e['length']>=this['_searchInputVisibleFrom']&&!this['children']['has'](this['_searchSection'])&&this['children']['add'](this['_searchSection'],0x0),requestAnimationFrame(()=>{this['isLoading']=!0x1;});}['updateResourceState'](_0x5bfab1,_0x3d9c09){this['_resourcesListView']['updateResourceState'](_0x5bfab1,_0x3d9c09);}}const La='ck-ai-chat-context-controls__source-balloon-panel',Da='ck-button-icon\x20ck-button-back',Pa='ck-ai-header\x20ck-ai-header_small\x20ck-ai-header_source';class Oo{['_sourceResourceBalloons']=new Map();['_bodyCollection'];['_locale'];['_config'];constructor(_0x45eddc,_0x5b47fe,_0x48701a){this['_locale']=_0x45eddc,this['_bodyCollection']=_0x5b47fe,this['_config']=_0x48701a;}['showSourceResourcesBalloon']({source:_0x3bb9cf,withBackButton:_0x37b4af}){let _0x348a74=this['_sourceResourceBalloons']['get'](_0x3bb9cf['id']);_0x348a74||(_0x348a74=this['_createSourceResourceBalloonPanel'](),this['_sourceResourceBalloons']['set'](_0x3bb9cf['id'],_0x348a74),this['_setupSingleResourceBalloonClickOutsideHandler'](_0x348a74)),this['_addSourceResourceContent']({'balloonPanel':_0x348a74,'source':_0x3bb9cf,'withBackButton':_0x37b4af}),_0x348a74['show']();const _0x5e2f70=this['_config']['getTargetElement']();_0x5e2f70&&_0x348a74['pin']({'target':_0x5e2f70,'limiter':this['_config']['getLimiterElement']()});}['populateSourceResourceBalloon'](_0x4283ec,_0x436e6d,_0x1bc8a7){const _0x4d958e=this['_sourceResourceBalloons']['get'](_0x4283ec);if(!_0x4d958e)return;const _0x55d8b2=this['_getResourcesViewFromBalloon'](_0x4d958e);_0x55d8b2&&(_0x55d8b2['setResources'](_0x436e6d,_0x1bc8a7),_0x55d8b2['once']('change:isLoading',()=>{_0x4d958e['pin']({'target':this['_config']['getTargetElement'](),'limiter':this['_config']['getLimiterElement']()});}));}['closeSourceResourceBalloon'](_0x520772){const _0x2ba434=this['_sourceResourceBalloons']['get'](_0x520772);_0x2ba434&&requestAnimationFrame(()=>{_0x2ba434['hide'](),this['_sourceResourceBalloons']['delete'](_0x520772),this['_config']['onBalloonClosed']();});}['isAnyResourceBalloonVisible'](){for(const _0x4e32d3 of this['_sourceResourceBalloons']['values']())if(_0x4e32d3['isVisible'])return!0x0;return!0x1;}['updateResourceState'](_0x6b4b2b,_0x4c9559,_0x119b51){const _0x26d2f4=this['_sourceResourceBalloons']['get'](_0x6b4b2b);if(!_0x26d2f4||!_0x26d2f4['isVisible'])return;const _0x589f13=this['_config']['getTargetElement']();if(!_0x589f13)return;_0x26d2f4['pin']({'target':_0x589f13,'limiter':this['_config']['getLimiterElement']()});const _0xd4cb73=this['_getResourcesViewFromBalloon'](_0x26d2f4);_0xd4cb73&&_0xd4cb73['updateResourceState'](_0x4c9559,_0x119b51);}['destroy'](){for(const _0x45b447 of this['_sourceResourceBalloons']['values']())_0x45b447['destroy']();this['_sourceResourceBalloons']['clear']();}['_createSourceResourceBalloonPanel'](){const _0x4b0d49=new _0x10e1b3(this['_locale']);return _0x4b0d49['extendTemplate']({'attributes':{'class':La}}),this['_bodyCollection']['add'](_0x4b0d49),_0x4b0d49;}['_addSourceResourceContent']({balloonPanel:_0x53cec4,source:_0x885b66,withBackButton:_0x42e05c}){_0x53cec4['content']['clear']();const _0x1e8c12=this['_createBalloonHeader']({'balloonPanel':_0x53cec4,'source':_0x885b66,'withBackButton':_0x42e05c});_0x53cec4['content']['add'](_0x1e8c12);const _0xa8c6cf=this['_createBalloonResourcesView'](_0x885b66);_0x53cec4['content']['add'](_0xa8c6cf);}['_createBalloonHeader']({balloonPanel:_0x39754f,source:_0x4b4ca5,withBackButton:_0x1c7257}){const _0x130936=new _0x337d54(this['_locale'],{'label':_0x4b4ca5['label'],'class':Pa});return _0x1c7257&&_0x130936['children']['add'](this['_createBackButton'](_0x39754f),0x0),_0x130936;}['_createBackButton'](_0x122448){const _0x34665b=new _0x1d1b95(this['_locale']);return _0x34665b['set']({'icon':_0x37ead0,'tooltip':h(this['_locale'],'AI_CHAT_CONTEXT_URL_BACK_TO_CONTEXT'),'tooltipPosition':'n','class':Da}),_0x34665b['on']('execute',()=>{_0x122448['hide'](),this['_config']['onBackToContext']();}),_0x34665b;}['_createBalloonResourcesView'](_0x5ed75e){const _0x21bfb6=new lc(this['_locale'],{'source':_0x5ed75e,'searchInputVisibleFrom':this['_config']['searchInputVisibleFrom']});return _0x21bfb6['on']('loadSourceResources',(_0x818b99,_0x45832b)=>{this['_config']['onLoadSourceResources'](_0x45832b);}),_0x21bfb6['on']('addResourceToContext',(_0x1198ce,_0x5dcf72)=>{this['_config']['onResourceSelected'](_0x5dcf72['source'],_0x5dcf72['resource']),this['closeSourceResourceBalloon'](_0x5ed75e['id']);}),_0x21bfb6;}['_getResourcesViewFromBalloon'](_0x4f9ab8){const _0x70c71e=_0x4f9ab8['content']['get'](0x1);return _0x70c71e instanceof lc?_0x70c71e:null;}['_setupSingleResourceBalloonClickOutsideHandler'](_0x5f2554){_0x1d6ed3({'emitter':_0x5f2554,'contextElements':[_0x5f2554['element']],'callback':()=>{_0x5f2554['hide'](),this['_config']['onBalloonClosed']();},'activator':()=>_0x5f2554['isVisible']});}}const xs=['addDocumentToContext','addFileToContext','addUrlToContext','addResourceToContext','removeContextItem','loadSourceResources','executeCustomItemCallback'],Uo='ck-ai-chat-context-controls',Lo='ck-ai-chat-context-controls__pending-contexts',No='ck-ai-chat-context-controls__add-context-balloon-panel',Mo='ck-ai-chat-context-controls__add-context-button',Ho='ck-ai-chat-context-controls__url-balloon-panel',jo='ck-ai-chat-context-controls__balloon-button',Fo='ck-ai-chat-context-controls__balloon-button-source',Xo='ck-ai-chat-controls-button',Do='ck-ai-chat-context-chips-wrapper-balloon',$o='ck-ai-chat-controls_context_show-more-button',Wo='ck-ai-chat-context-controls__show-more-balloon-panel',qo='ck-ai-chat',zo=[_0x10e1b3['defaultPositions']['northArrowSouthWest'],_0x10e1b3['defaultPositions']['northArrowSouth'],_0x10e1b3['defaultPositions']['northArrowSouthEast'],_0x10e1b3['defaultPositions']['southArrowNorthWest'],_0x10e1b3['defaultPositions']['southArrowNorth'],_0x10e1b3['defaultPositions']['southArrowNorthEast']];class Is extends _0x1f054a{['addContextButtonView'];['_currentContextsChips']=this['createCollection']();['_conversationContextsChips']=this['createCollection']();['_overflowManager'];['_addContextBalloonPanelView'];['_urlBalloonPanelView'];['_urlInputView'];['_resourcesBalloonView'];['_addContextBalloonConfig'];['_hasExactlyOneSource']=!0x1;['bodyCollection'];constructor(_0x431470,_0x58a6ee){super(_0x431470),this['bodyCollection']=_0x58a6ee['bodyCollection'],this['_currentContextsChips']=this['createCollection'](),this['_conversationContextsChips']=this['createCollection'](),this['addContextButtonView']=this['_createAddContextButtonView'](_0x431470),this['_addContextBalloonPanelView']=this['_createAddContextBalloonPanelView'](_0x431470),this['_urlBalloonPanelView']=this['_createUrlBalloonPanelView'](_0x431470),this['_resourcesBalloonView']=this['_createResourcesBalloonView'](_0x431470,_0x58a6ee);const _0x1aa651={'cssClasses':{'showMoreButton':$o,'showMoreBalloon':Wo,'overflowContainer':Do,'controlsButton':Xo}};this['_overflowManager']=new Ro(_0x431470,this['_currentContextsChips'],_0x1aa651,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'](_0x19f696,_0xff8076){const _0x27afeb=this['_createContextButton'](_0x19f696,'current',!0x0,_0xff8076);this['_addContextToCollection'](_0x27afeb,this['_currentContextsChips']),this['_overflowManager']['reorganizeChips']();}['removeContextItem'](_0x18d70f){this['_removeContextFromCollection'](_0x18d70f,this['_currentContextsChips']),this['_removeContextFromCollection'](_0x18d70f,this['_overflowManager']['overflowChips']),this['_overflowManager']['reorganizeChips']();}['setContextItemLoading'](_0x2f3241,_0x12cab0){let _0xd74405=this['_currentContextsChips']['find'](_0x2495ac=>_0x2495ac['id']===_0x2f3241);_0xd74405||(_0xd74405=this['_overflowManager']['overflowChips']['find'](_0x34f252=>_0x34f252['id']===_0x2f3241)),_0xd74405&&(_0xd74405['isLoading']=_0x12cab0);}['setConversationContext'](_0x4d06aa){this['_conversationContextsChips']['clear']();for(const _0x44dcd2 of _0x4d06aa){const _0x3d3f11=this['_createContextButton'](_0x44dcd2,'conversation',!0x1,!0x1);this['_addContextToCollection'](_0x3d3f11,this['_conversationContextsChips']);}}['clearCurrentContextItems'](){this['_currentContextsChips']['clear'](),this['_overflowManager']['clear']();}['clearConversationContextItems'](){this['_conversationContextsChips']['clear']();}['updateResourceState'](_0xff60fc,_0x101e6b,_0x397c24){this['_resourcesBalloonView']['updateResourceState'](_0xff60fc,_0x101e6b,_0x397c24);}['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:_0x3384ec,withBackButton:_0x442f5e}){this['_resourcesBalloonView']['showSourceResourcesBalloon']({'source':_0x3384ec,'withBackButton':_0x442f5e}),this['addContextButtonView']['isOn']=!0x0;}['populateSourceResourceBalloon'](_0x465907,_0x3d4113,_0x185be4,_0x1073c7){this['_resourcesBalloonView']['populateSourceResourceBalloon'](_0x465907,_0x185be4,_0x1073c7);}['closeSourceResourceBalloon'](_0x2a5803){this['_resourcesBalloonView']['closeSourceResourceBalloon'](_0x2a5803),this['addContextButtonView']['isOn']=!0x1;}['setAddContextOptions'](_0x5da9bf){this['_setBalloonPanelContent'](this['_addContextBalloonPanelView'],this['locale'],_0x5da9bf),this['_setAddContextButtonEnabled'](_0x5da9bf);}['_setAddContextButtonEnabled'](_0x1dd66c){const _0x9c0a92=!_0x1dd66c['document']['isHidden']&&_0x1dd66c['document']['enabled'],_0x534004=_0x1dd66c['urls']['enabled'],_0x252b1e=_0x1dd66c['files']['enabled'],_0x31d086=_0x1dd66c['sources']['length']>0x0,_0x41176b=_0x1dd66c['customItems']&&_0x1dd66c['customItems']['length']>0x0;this['addContextButtonView']['isEnabled']=_0x9c0a92||_0x534004||_0x252b1e||_0x31d086||_0x41176b;}['_setupTemplate'](){this['setTemplate']({'tag':'div','attributes':{'class':[Uo,'ck-reset_all-excluded']},'children':[{'tag':'div','attributes':{'class':Lo},'children':this['_currentContextsChips']}]});}['_bindEventHandlers'](){this['addContextButtonView']['on']('execute',()=>{this['_handleAddContextButtonClick']();});}['_createAddContextButtonView'](_0x18cd82){const _0x43cdce=new _0x1d1b95(_0x18cd82);return _0x43cdce['set']({'label':h(_0x18cd82,'AI_CHAT_CONTEXT_ADD_CONTEXT'),'class':Xo+'\x20'+Mo,'icon':_0x4db22d,'isToggleable':!0x0,'tooltip':!0x0,'tooltipPosition':'sw'}),_0x43cdce;}['_createAddContextBalloonPanelView'](_0x58c713){return this['_createBaseBalloonPanel'](_0x58c713,No);}['_createUrlBalloonPanelView'](_0x806de4){const _0x16db6a=this['_createBaseBalloonPanel'](_0x806de4,Ho);return this['_addUrlContent'](_0x16db6a,_0x806de4),_0x16db6a;}['_createResourcesBalloonView'](_0x320980,_0x4250fa){const _0x66afd5={'searchInputVisibleFrom':_0x4250fa['searchInputVisibleFrom'],'onBackToContext':()=>{this['showAddContextBalloonPanel'](),this['_addContextBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':zo});},'onResourceSelected':(_0x54dcbc,_0x2e14d3)=>{this['fire']('addResourceToContext',{'source':_0x54dcbc,'resource':_0x2e14d3});},'onLoadSourceResources':_0x1535a4=>{this['fire']('loadSourceResources',_0x1535a4);},'onBalloonClosed':()=>{this['addContextButtonView']['isOn']=!0x1;},'getLimiterElement':()=>this['_getLimiterElement'](),'getTargetElement':()=>this['addContextButtonView']['element']};return new Oo(_0x320980,_0x4250fa['bodyCollection'],_0x66afd5);}['_getLimiterElement'](){return this['element']?.['closest']('.'+qo)||document['body'];}['_createBaseBalloonPanel'](_0x424e71,_0x850625){const _0x53353b=new _0x10e1b3(_0x424e71);return _0x53353b['extendTemplate']({'attributes':{'class':_0x850625}}),this['bodyCollection']['add'](_0x53353b),_0x53353b;}['_setBalloonPanelContent'](_0x38eb91,_0xc0a5b3,_0x3d929a){if(_0x38eb91['content']['clear'](),!_0x3d929a['document']['isHidden']&&_0x3d929a['document']['enabled']){const _0x8ad515=this['_createBalloonButton'](_0xc0a5b3,{'label':h(_0xc0a5b3,'AI_CHAT_CONTEXT_CURRENT_DOCUMENT'),'icon':_0x1ef80c});_0x8ad515['on']('execute',()=>{this['fire']('addDocumentToContext'),this['hideAddContextBalloonPanel']();}),_0x38eb91['content']['add'](_0x8ad515);}if(_0x3d929a['urls']['enabled']){const _0x31df20=this['_createBalloonButton'](_0xc0a5b3,{'label':h(_0xc0a5b3,'AI_CHAT_CONTEXT_URL_LABEL'),'icon':_0x9a2128});_0x31df20['on']('execute',()=>{this['hideAddContextBalloonPanel'](),this['showUrlBalloonPanel'](),this['_urlBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':zo}),this['_urlInputView']['focus']();}),_0x38eb91['content']['add'](_0x31df20);}if(_0x3d929a['files']['enabled']){const _0x51fd81=new _0x34ca85(_0xc0a5b3);_0x51fd81['set']({'label':h(_0xc0a5b3,'AI_CHAT_CONTEXT_FILE_LABEL'),'icon':_0x1c54d4,'withText':!0x0,'tooltip':!0x0,'class':jo,'allowMultipleFiles':!0x0}),_0x51fd81['on']('execute',()=>{this['hideAddContextBalloonPanel']();}),_0x51fd81['on']('done',(_0x3e24ce,_0x35b6a2)=>{this['fire']('addFileToContext',_0x35b6a2);}),_0x51fd81['tooltip']=!0x0,_0x38eb91['content']['add'](_0x51fd81);}for(const _0x2274b9 of _0x3d929a['sources']){const _0x429b6e=this['_createBalloonButton'](_0xc0a5b3,{'label':_0x2274b9['label'],'icon':_0x2274b9['icon']||_0x4791e0,'type':'source'});_0x38eb91['content']['add'](_0x429b6e),_0x429b6e['on']('execute',()=>{this['hideAddContextBalloonPanel'](),this['_showSourceResourcesBalloon']({'source':_0x2274b9,'withBackButton':!this['_hasExactlyOneSource']});});}for(const _0x2f147b of _0x3d929a['customItems']||[]){const _0x7606e4=this['_createBalloonButton'](_0xc0a5b3,{'label':_0x2f147b['label'],'icon':_0x2f147b['icon']||_0x4791e0,'type':'customItem'});_0x38eb91['content']['add'](_0x7606e4),_0x7606e4['on']('execute',()=>{this['hideAddContextBalloonPanel'](),this['fire']('executeCustomItemCallback',_0x2f147b);});}this['_hasExactlyOneSource']=0x1===_0x38eb91['content']['length'],this['_urlInputView']['withBackButton']=!this['_hasExactlyOneSource'];}['_addUrlContent'](_0x13f6fc,_0x5416a9){this['_urlInputView']=new Po(_0x5416a9),this['_urlInputView']['on']('submitUrl',(_0x58cae7,_0x5bd8ea)=>{this['_handleUrlSubmit'](_0x5bd8ea);}),this['_urlInputView']['on']('cancel',()=>{this['hideUrlBalloonPanel'](),this['_hasExactlyOneSource']||(this['showAddContextBalloonPanel'](),this['_addContextBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':zo}));}),this['_urlInputView']['on']('refreshBalloon',()=>{this['_urlBalloonPanelView']['isVisible']&&this['_urlBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':zo});}),_0x13f6fc['content']['add'](this['_urlInputView']);}['_createBalloonButton'](_0x20777a,_0x42186a){const _0x2b609f='source'===_0x42186a['type']?new Ha(_0x20777a):new _0x1d1b95(_0x20777a);return _0x2b609f['set']({'label':_0x42186a['label'],'icon':_0x42186a['icon'],'withText':!0x0,'tooltip':!0x0,'tooltipPosition':'sw','class':jo}),_0x2b609f;}['_setupAllBalloonClickOutsideHandlers'](){this['_setupAddContextBalloonClickOutsideHandler'](),this['_setupUrlBalloonClickOutsideHandler']();}['_setupUrlBalloonClickOutsideHandler'](){_0x1d6ed3({'emitter':this['_urlBalloonPanelView'],'contextElements':[this['_urlBalloonPanelView']['element']],'callback':()=>{this['hideUrlBalloonPanel']();},'activator':()=>this['_urlBalloonPanelView']['isVisible']});}['_toggleAddContextBalloon'](_0x1fc49a){const _0x2b5345=this['_addContextBalloonConfig'];_0x2b5345['buttonView']['isOn']=_0x1fc49a,_0x1fc49a?_0x2b5345['balloonView']['show']():_0x2b5345['balloonView']['hide']();}['_setupAddContextBalloonClickOutsideHandler'](){const {balloonView:_0x1a20ae,buttonView:_0x164dd3,hideMethod:_0x21afd2}=this['_addContextBalloonConfig'];_0x1d6ed3({'emitter':_0x1a20ae,'contextElements':[_0x1a20ae['element'],_0x164dd3['element']],'callback':()=>{_0x21afd2();},'activator':()=>_0x164dd3['isOn']&&!this['_urlBalloonPanelView']['isVisible']&&!this['_resourcesBalloonView']['isAnyResourceBalloonVisible']()});}['_createContextButton'](_0x4394fc,_0x3bdcbd,_0x1cd855=!0x1,_0x225fc4=!0x1){const _0x248cab='conversation'===_0x3bdcbd||!0x0===_0x4394fc['isReadOnly'],_0x3490de=new Vo(this['locale'],_0x4394fc,_0x248cab,_0x1cd855,_0x225fc4);return _0x248cab||_0x3490de['on']('removeContextItemChip',()=>{this['fire']('removeContextItem',_0x3490de['id']);}),_0x3490de;}['_addContextToCollection'](_0x529766,_0xd70623){_0xd70623['add'](_0x529766,0x0);}['_removeContextFromCollection'](_0x5ee98c,_0x5655f5){const _0x53c865=_0x5655f5['find'](_0x593d92=>_0x593d92['id']===_0x5ee98c);_0x53c865&&_0x5655f5['remove'](_0x53c865);}['_handleAddContextButtonClick'](){this['addContextButtonView']['isOn']?this['hideAddContextBalloonPanel']():(this['showAddContextBalloonPanel'](),this['_addContextBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':zo}),this['_hasExactlyOneSource']&&this['_addContextBalloonPanelView']['content']['get'](0x0)?.['fire']('execute'));}['_handleUrlSubmit'](_0x231ba5){this['_urlInputView']['clear'](),this['hideUrlBalloonPanel'](),this['fire']('addUrlToContext',_0x231ba5);}}class Ha extends _0x1d1b95{['arrowView'];constructor(_0x293ed1){super(_0x293ed1),this['set']({'withText':!0x0,'role':'menuitem'}),this['arrowView']=this['_createArrowView'](),this['extendTemplate']({'attributes':{'class':[Fo]}});}['render'](){super['render'](),this['children']['add'](this['arrowView']);}['_createArrowView'](){const _0x275982=new _0x152087();return _0x275982['content']=_0x264f12,_0x275982['extendTemplate']({'attributes':{'class':Fo+'__arrow'}}),_0x275982;}}class Cs extends _0x1f054a{['_cancelButtonView'];['_loaderView'];constructor(_0x5161df){super(_0x5161df),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 _0x552116=new _0x1d1b95(this['locale']);return _0x552116['set']({'label':h(this['locale'],'AI_CHAT_STOP_GENERATING'),'withText':!0x0,'class':'ck-ai-button-secondary\x20ck-ai-button-stop-generating','icon':_0x45f60c}),_0x552116['on']('execute',()=>{this['fire']('abortPromptStream');}),_0x552116;}['_createLoaderView'](){const _0x33285c=new _0x1f054a(this['locale']);return _0x33285c['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':h(this['locale'],'AI_CHAT_IS_WRITING')}]}),_0x33285c;}}class pi extends _0x1f054a{['_contextPanelView'];['_promptInputView'];['_promptCapabilitiesView'];['_loaderView'];['_modelUnavailableMessageView'];['_shouldRestorePromptInputFocus'];constructor(_0x334a01,_0x380c13){super(_0x334a01),this['_contextPanelView']=this['_createContextPanelView'](_0x334a01,{'bodyCollection':_0x380c13['bodyCollection'],'searchInputVisibleFrom':_0x380c13['contextResourcesSearchInputVisibleFrom']}),this['_promptInputView']=this['_createPromptInputView'](_0x334a01),this['_promptCapabilitiesView']=this['_createPromptCapabilitiesView'](_0x334a01),this['_loaderView']=this['_createLoaderView'](_0x334a01),this['_modelUnavailableMessageView']=this['_createModelUnavailableMessageView'](_0x334a01),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'](...xs)['to'](this),this['set']('isModelAvailable',!0x0),this['set']('isDisabled',!0x1);const _0xa85ec6=this['bindTemplate'];this['setTemplate']({'tag':'form','attributes':{'class':['ck','ck-ai-chat-controls',_0xa85ec6['if']('isDisabled','ck-ai-chat-controls-disabled')]},'children':[{'tag':'div','attributes':{'class':[_0xa85ec6['if']('isLoading','ck-hidden',_0x4e9083=>_0x4e9083||!this['isModelAvailable']),_0xa85ec6['if']('isModelAvailable','ck-hidden',_0x3c81ad=>!_0x3c81ad||this['isLoading'])]},'children':[this['_contextPanelView'],this['_promptInputView'],this['_promptCapabilitiesView']]},{'tag':'div','attributes':{'class':[_0xa85ec6['if']('isLoading','ck-hidden',_0x25f57d=>!_0x25f57d)]},'children':[this['_loaderView']]},{'tag':'div','attributes':{'class':[_0xa85ec6['if']('isModelAvailable','ck-hidden',_0xebdd90=>_0xebdd90)]},'children':[this['_modelUnavailableMessageView']]}]}),_0x1d6ed3({'emitter':this['_promptInputView'],'activator':()=>this['isLoading'],'contextElements':()=>[this['element']],'callback':()=>{this['_shouldRestorePromptInputFocus']=!0x1;}}),this['on']('change:isLoading',this['_handlePromptInputFocus'],{'priority':'low'});}['_createContextPanelView'](_0x50b4df,_0x458e30){return new Is(_0x50b4df,_0x458e30);}['_createPromptInputView'](_0x4bdbff){return new _s(_0x4bdbff,this['_contextPanelView']['addContextButtonView']);}['_createPromptCapabilitiesView'](_0x343289){return new vs(_0x343289);}['_createLoaderView'](_0x5966c3){return new Cs(_0x5966c3);}['_createModelUnavailableMessageView'](_0x59b355){const _0x1a9195=new As(_0x59b355);return _0x1a9195['delegate']('startConversation')['to'](this),_0x1a9195;}['_handlePromptInputFocus'](_0x16a583,_0x19e778,_0x324be3){_0x324be3?this['_shouldRestorePromptInputFocus']=!0x0:this['_shouldRestorePromptInputFocus']&&this['_promptInputView']['focus']();}['addContextItem'](_0x1a74ca,_0x5b5d8d){this['_contextPanelView']['addContextItem'](_0x1a74ca,_0x5b5d8d);}['removeContextItem'](_0x39e1b5){this['_contextPanelView']['removeContextItem'](_0x39e1b5);}['setContextItemLoading'](_0x29b725,_0x2ab756){this['_contextPanelView']['setContextItemLoading'](_0x29b725,_0x2ab756);}['setIsUploadInProgress'](_0x47284){this['_promptInputView']['setIsUploadInProgress'](_0x47284);}['setConversationContext'](_0x1b9534){this['_contextPanelView']['setConversationContext'](_0x1b9534);}['clearPendingContextUI'](){this['_contextPanelView']['clearCurrentContextItems']();}['clearConversationContextUI'](){this['_contextPanelView']['clearConversationContextItems']();}['updateResourceState'](_0x11b896,_0x1fec49,_0x9ec86a){this['_contextPanelView']['updateResourceState'](_0x11b896,_0x1fec49,_0x9ec86a);}['setWebSearch'](_0x4438ef){this['_promptCapabilitiesView']['setWebSearch'](_0x4438ef);}['setReasoning'](_0x213b3a){this['_promptCapabilitiesView']['setReasoning'](_0x213b3a);}['resetMessageInput'](){this['_promptInputView']['reset']();}['setAddContextOptions'](_0x55dc42){this['_contextPanelView']['setAddContextOptions'](_0x55dc42);}['setInputPlaceholder'](_0xb0ebe){this['_promptInputView']['setPlaceholderText'](_0xb0ebe);}['setModelList'](_0x36c3bf,_0x2c6cd){this['_promptCapabilitiesView']['setModelList'](_0x36c3bf,_0x2c6cd);}['setModel'](_0x49367d){_0x49367d?(this['isModelAvailable']=!0x0,this['_promptCapabilitiesView']['setModel'](_0x49367d)):this['isModelAvailable']=!0x1;}['enableModelSelector'](){this['_promptCapabilitiesView']['enableModelSelector']();}['disableModelSelector'](_0x511faf){this['_promptCapabilitiesView']['disableModelSelector'](_0x511faf);}['populateSourceResourceBalloon'](_0x3722e0,_0x2996b6,_0x45eae3,_0x4f5197){this['_contextPanelView']['populateSourceResourceBalloon'](_0x3722e0,_0x2996b6,_0x45eae3,_0x4f5197);}['closeSourceResourceBalloon'](_0xdea1cb){this['_contextPanelView']['closeSourceResourceBalloon'](_0xdea1cb);}['focusPromptInput'](_0x3a8f02=!0x1){this['_promptInputView']['focus'](_0x3a8f02);}['setPromptInputValue'](_0x404ef4){this['_promptInputView']['queryView']['fieldView']['reset'](),this['_promptInputView']['queryView']['fieldView']['value']=_0x404ef4;}}class As extends _0x1f054a{constructor(_0x22734d){super(_0x22734d);const _0x1ae3ca=new _0x1d1b95(_0x22734d);_0x1ae3ca['set']({'label':h(this['locale'],'AI_CHAT_MODEL_UNAVAILABLE_MESSAGE_BUTTON'),'withText':!0x0,'class':['ck-ai-chat-controls__start-new-chat-button'],'tooltip':''}),_0x1ae3ca['delegate']('execute')['to'](this,'startConversation'),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat-controls-model-unavailable-message']},'children':[{'tag':'p','children':[{'text':h(this['locale'],'AI_CHAT_MODEL_UNAVAILABLE_MESSAGE_TEXT')+'\x20'},_0x1ae3ca]}]});}}class wi extends _0x337d54{['conversationStartButton'];['resizeButton'];constructor(_0x3945b3,_0x1dc67e){super(_0x3945b3,{'label':h(_0x3945b3,'AI_CHAT_HEADING'),'class':'ck-ai-header\x20ck-ai-header_chat','icon':Et}),this['set']('isMaximized',!0x1),this['conversationStartButton']=this['_createStartConversationButton'](_0x3945b3),this['children']['add'](this['conversationStartButton']),_0x1dc67e&&(this['resizeButton']=Hs(_0x3945b3,this),this['children']['add'](this['resizeButton']));}['_createStartConversationButton'](_0x1ee981){const _0x56a5d4=new _0x1d1b95(_0x1ee981);return _0x56a5d4['set']({'label':h(this['locale'],'AI_CHAT_LABEL_NEW_CHAT'),'withText':!0x0,'icon':_0x18a571,'class':'ck-ai-chat__start-conversation'}),_0x56a5d4['on']('execute',()=>{this['fire']('startConversation');}),_0x56a5d4;}}class fi extends _0x1f054a{constructor(_0xef8686){super(_0xef8686),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-disclaimer']},'children':[{'tag':'p','attributes':{'class':['ck','ck-ai-disclaimer__content']},'children':[{'text':h(_0xef8686,'AI_DISCLAIMER_TEXT')}]}]});}}class At extends _0x1f054a{['chatHeader'];['chatFeed'];['chatControls'];['chatDisclaimer'];['_bodyCollection'];constructor(_0x3c1986,_0x990f28){super(_0x3c1986),this['_bodyCollection']=new _0x1c4f1c(_0x3c1986),this['_bodyCollection']['attachToDom'](),this['chatHeader']=new wi(_0x3c1986,_0x990f28['showResizeButton']),this['chatHeader']['delegate'](...Rt)['to'](this),this['chatFeed']=new ui(_0x3c1986,this['_bodyCollection']),this['chatFeed']['delegate'](...Rt)['to'](this),this['chatControls']=new pi(_0x3c1986,{'bodyCollection':this['_bodyCollection'],'contextResourcesSearchInputVisibleFrom':_0x990f28['contextResourcesSearchInputVisibleFrom']}),this['chatControls']['delegate'](...Rt)['to'](this),this['chatDisclaimer']=new fi(_0x3c1986),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-ai-chat','ck-rounded-corners'],'dir':_0x3c1986['uiLanguageDirection']},'children':[this['chatHeader'],this['chatFeed'],this['chatControls'],this['chatDisclaimer']]});}['populateSourceResourceBalloon'](_0x360078,_0x16a6c8,_0x41814b,_0x1cb3e4){this['chatControls']['populateSourceResourceBalloon'](_0x360078,_0x16a6c8,_0x41814b,_0x1cb3e4);}['closeSourceResourceBalloon'](_0x4a6cfd){this['chatControls']['closeSourceResourceBalloon'](_0x4a6cfd);}['destroy'](){this['_bodyCollection']['detachFromDom'](),super['destroy']();}}class F extends _0x5dcf5b{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(_0x371a68){super(_0x371a68);const _0x3a5a40=this['context']['plugins']['get']('AITabs');this['set']('isBusy',!0x1),this['_promiseQueue']=new St(),this['_view']=new At(this['context']['locale'],{'showResizeButton':_0x3a5a40['showResizeButton'],'contextResourcesSearchInputVisibleFrom':this['context']['config']['get']('ai.chat.context.searchInputVisibleFrom')}),this['_view']['delegate'](...Rt)['to'](this),this['_view']['on']('toggleSuggestionDisplayMode',(_0x478dbc,{showDiff:_0x58bf28})=>{this['showDiff']=_0x58bf28;}),_0x3a5a40['view']['addTab']({'id':'chat','buttonLabel':h(this['context']['locale'],'AI_CHAT_HEADING'),'buttonIcon':Et,'order':0x0,'content':this['_view']}),this['_view']['chatControls']['bind']('isLoading')['to'](this,'isBusy',_0x72d81c=>_0x72d81c),this['_view']['chatFeed']['bind']('isPending')['to'](this,'isBusy',_0x24c7bb=>_0x24c7bb),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder']()),this['bind']('isModelAvailable')['to'](this['_view']['chatControls'],'isModelAvailable');}['destroy'](){super['destroy'](),this['_titleAnimationInterval']&&clearInterval(this['_titleAnimationInterval']);}['createConversation'](_0x1d6e3c){const _0x459496=this['context']['config']['get']('ai.chat.welcomeMessage')??h(this['context']['locale'],'AI_CHAT_WELCOME_MESSAGE');this['_view']['chatFeed']['clear'](),this['_view']['chatControls']['enableModelSelector'](),this['_view']['chatControls']['setModelList'](_0x1d6e3c['availableModels'],!this['context']['config']['get']('ai.models.showModelSelector')),this['addFeedItemStaticMessage']({'id':'conversation-start','staticMessage':_0x459496}),this['fire']('conversationCreated');}['addFeedItemStaticMessage']({id:_0x34ed54,staticMessage:_0x2aca58}){this['_view']['chatFeed']['addItem']('ai-reply',{'id':_0x34ed54,'initialContent':'<p>'+_0x2aca58+'</p>'});}['addFeedItemUserMessage'](_0x5621b3){const _0x368673=_0x5621b3['attributes']?.['displayedPrompt']||_0x5621b3['userMessage'];this['_view']['chatFeed']['addItem']('user-message',{'contextItems':Array['from'](_0x5621b3['contextItems']['values']()),'initialContent':'<p>'+_0x368673+'</p>','id':_0x5621b3['id']});}['addFeedItemError']({errorMessage:_0x3477c3,id:_0x5a61fc}){this['_view']['chatFeed']['addItem']('error-message',{'initialContent':'<p>'+_0x3477c3+'</p>','id':_0x5a61fc});}['addFeedItemAIReply'](_0x544afd){return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('ai-reply',{'id':_0x544afd['interactionId']+':'+_0x544afd['id']}),this['clearLoadingMessage']();});}async['addFeedItemAISuggestion'](_0x5080d8){const _0x48c2e2=c(this['context']);let _0x117814=_0x48c2e2['config']['get']('ai.availableReplyActions')||[...J];if(_0x48c2e2['plugins']['has']('TrackChanges')){if(!this['_isTrackChangesCommandValueBound']){this['_isTrackChangesCommandValueBound']=!0x0;const _0x2cac6b=_0x48c2e2['commands']['get']('trackChanges');this['_view']['chatFeed']['bind']('isTrackChangesOn')['to'](_0x2cac6b,'value');}}else _0x117814=_0x117814['filter'](_0x321607=>'insertSuggestion'!=_0x321607);return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('ai-suggestion-reply',{'id':_0x5080d8['interactionId']+':'+_0x5080d8['id'],'areActionsDisabled':_0x5080d8['areActionsDisabled'],'showDiff':this['showDiff'],'availableActions':_0x117814}),this['clearLoadingMessage']();});}['addFeedInteractionHeader'](_0x5b2ff6,_0x2f387d){const _0x1e2603=this['_view']['chatFeed']['children']['last'];if(_0x1e2603 instanceof Ct)return this['_view']['chatFeed']['children']['remove'](_0x1e2603),void this['_view']['chatFeed']['addItem']('interaction-header',{'id':_0x5b2ff6['id'],'capabilities':{'isWebSearchEnabled':_0x1e2603['capabilities']['isWebSearchEnabled']||_0x2f387d['isWebSearchEnabled'],'isReasoningEnabled':_0x1e2603['capabilities']['isReasoningEnabled']||_0x2f387d['isReasoningEnabled']}});this['_view']['chatFeed']['addItem']('interaction-header',{'id':_0x5b2ff6['id'],'capabilities':_0x2f387d});}async['addFeedItemCustomElement'](_0x80b842,_0x595718){let _0x3fd3a7;return await this['_promiseQueue']['enqueue'](async()=>{_0x3fd3a7=this['_view']['chatFeed']['addItem']('custom-element',{'content':_0x80b842,'id':_0x595718});}),_0x3fd3a7;}['removeFeedItem'](_0x526918){this['_view']['chatFeed']['removeItem'](_0x526918);}['hasFeedItem'](_0x28d3d2){return this['_view']['chatFeed']['hasItem'](_0x28d3d2);}['updateFeedInteractionHeader'](_0x2fd24d){const _0x8784c4=this['_view']['chatFeed']['children']['find'](_0xb8dc80=>_0xb8dc80['options']['id']==_0x2fd24d['id']&&_0xb8dc80 instanceof Ct);_0x8784c4&&_0x8784c4['set']('isVisible',_0x2fd24d['isVisible']);}async['updateFeedItemAIReplyContent'](_0x4f5396){const _0x2099ec=_0x4f5396['renderingStrategy']||this['feedItemRenderingStrategy'];return this['_promiseQueue']['enqueue'](async _0x63a21e=>{await this['_view']['chatFeed']['updateReplyItem']({..._0x4f5396,'abortSignal':_0x63a21e,'renderingStrategy':_0x2099ec}),_0x4f5396['isDone']&&this['markFeedItemAsDone'](_0x4f5396['id']);});}['updateFeedItemAIReplySources'](_0x1ff26b,_0x34dcc5){this['_view']['chatFeed']['updateWebSources'](_0x1ff26b,_0x34dcc5);}async['updateFeedItemAIReplySuggestionContent'](_0x195ed2){const _0x2bf66d=_0x195ed2['renderingStrategy']||this['feedItemRenderingStrategy'];return this['_promiseQueue']['enqueue'](async _0x1e1e13=>{await this['_view']['chatFeed']['updateSuggestionItem']({..._0x195ed2,'abortSignal':_0x1e1e13,'renderingStrategy':_0x2bf66d}),_0x195ed2['isDone']&&this['markFeedItemAsDone'](_0x195ed2['id']);});}['updateFeedItemAIReplySuggestionPartState'](_0x1503c4){this['_view']['chatFeed']['updateSuggestionPartState'](_0x1503c4);}['setFeedItemAIReplySuggestionPartActive'](_0x50c7b4){this['_view']['chatFeed']['setSuggestionPartActive'](_0x50c7b4);}['markFeedItemAsDone'](_0x53ea38){this['_view']['chatFeed']['markItemAsDone'](_0x53ea38);}['removeFeedInteraction'](_0x3791e4){this['_view']['chatFeed']['getItemIds']()['filter'](_0x53f23c=>_0x53f23c['startsWith'](_0x3791e4))['forEach'](_0xc77438=>this['_view']['chatFeed']['removeItem'](_0xc77438));}['startInteraction'](){const _0x16fe95=this['prepareLoadingMessage']({'isWebSearchEnabled':!0x1,'isReasoningEnabled':!0x1});this['setLoadingMessage'](_0x16fe95),this['_view']['chatControls']['disableModelSelector'](!this['context']['config']['get']('ai.models.showModelSelector')),this['isBusy']=!0x0,this['_view']['chatFeed']['startAutoScroll']();}['stopInteraction'](_0x495574){this['_promiseQueue']['abort'](),this['_view']['chatFeed']['getItemIds']()['filter'](_0x12dee1=>_0x12dee1['startsWith'](_0x495574['id']))['forEach'](_0x4267e5=>this['markFeedItemAsDone'](_0x4267e5)),this['isBusy']=!0x1,this['_view']['chatFeed']['stopAutoScroll']();}async['finishInteraction'](){return this['_promiseQueue']['queueEmptyPromise']['then'](()=>{this['isBusy']=!0x1,this['_view']['chatFeed']['stopAutoScroll']();});}['addContextItem'](_0x2b66eb,_0x30fbd2){this['_view']['chatControls']['addContextItem'](_0x2b66eb,_0x30fbd2);}['removeContextItem'](_0x28cc15){this['_view']['chatControls']['removeContextItem'](_0x28cc15);}['setContextItemLoading'](_0x229a06,_0x2dbf58){this['_view']['chatControls']['setContextItemLoading'](_0x229a06,_0x2dbf58);}['setIsUploadInProgress'](_0x1213fb){this['_view']['chatControls']['setIsUploadInProgress'](_0x1213fb);}['setConversationContext'](_0x41f5b6){this['_view']['chatControls']['setConversationContext'](_0x41f5b6);}['clearPendingContextUI'](){this['_view']['chatControls']['clearPendingContextUI']();}['clearConversationContextUI'](){this['_view']['chatControls']['clearConversationContextUI']();}['updateResourceState'](_0x65c5d9,_0x37b06d,_0x13d712){this['_view']['chatControls']['updateResourceState'](_0x65c5d9,_0x37b06d,_0x13d712);}['resetMessageInput'](){this['_view']['chatControls']['resetMessageInput'](),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder']());}['setAddContextOptions'](_0xaaf78){this['_view']['chatControls']['setAddContextOptions'](_0xaaf78);}['updateCapabilities'](_0x35e309){this['_view']['chatControls']['setWebSearch'](_0x35e309['isWebSearchEnabled']),this['_view']['chatControls']['setReasoning'](_0x35e309['isReasoningEnabled']),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder'](_0x35e309));}['setSelectedModel'](_0x2809a3,_0x24f8c7){this['_view']['chatControls']['setModel'](_0x2809a3),_0x24f8c7&&this['_view']['chatControls']['disableModelSelector'](!0x1);}['setFeedItemRenderingStrategy'](_0x5195d6){this['feedItemRenderingStrategy']=_0x5195d6;}['toggleLoadingSkeleton'](_0x16ea86){this['_view']['chatFeed']['toggleLoadingSkeleton'](_0x16ea86);}['resetConversationTitle'](){this['setConversationTitle'](h(this['context']['locale'],'AI_CHAT_HEADING'));}['setConversationTitle'](_0x36265c,_0x1565a4=!0x1){if(_0x1565a4&&!mt()&&_0x36265c['length'])return this['_view']['chatHeader']['label']='',void this['_animateConversationTitle'](_0x36265c);this['_view']['chatHeader']['label']=_0x36265c;}['setLoadingMessage'](_0x1c7255){this['_view']['chatFeed']['setLoadingMessage'](_0x1c7255);}['clearLoadingMessage'](){this['_view']['chatFeed']['setLoadingMessage']('');}['_animateConversationTitle'](_0x360ff9){let _0x526a14=0x0;clearInterval(this['_titleAnimationInterval']),this['_titleAnimationInterval']=setInterval(()=>{this['_view']['chatHeader']['label']=this['_view']['chatHeader']['label']+_0x360ff9[_0x526a14],_0x526a14++,_0x526a14===_0x360ff9['length']&&clearInterval(this['_titleAnimationInterval']);},0x1e);}['setIsMaximized'](_0x25c3dc){this['_view']['chatHeader']['isMaximized']=_0x25c3dc;}['prepareLoadingMessage'](_0x5843cd){return _0x5843cd['isWebSearchEnabled']&&_0x5843cd['isReasoningEnabled']?h(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH_REASONING'):_0x5843cd['isWebSearchEnabled']?h(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH'):_0x5843cd['isReasoningEnabled']?h(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_REASONING'):h(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_REGULAR');}['_getInputPlaceholder'](_0x345e9f){return _0x345e9f?_0x345e9f['isWebSearchEnabled']&&_0x345e9f['isReasoningEnabled']?h(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH_REASONING'):_0x345e9f['isWebSearchEnabled']?h(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH'):_0x345e9f['isReasoningEnabled']?h(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REASONING'):h(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REGULAR'):h(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REGULAR');}['populateSourceResourceBalloon'](_0x8bbe41,_0x1ca392,_0x330d31,_0x4e2e14){this['_view']['populateSourceResourceBalloon'](_0x8bbe41,_0x1ca392,_0x330d31,_0x4e2e14);}['closeSourceResourceBalloon'](_0x54762f){this['_view']['closeSourceResourceBalloon'](_0x54762f);}['setPromptInputValue'](_0x2f0493){this['_view']['chatControls']['setPromptInputValue'](_0x2f0493);}['focusPromptInput'](_0x272a90=!0x1){this['_view']['chatControls']['focusPromptInput'](_0x272a90);}['scrollFeedToSuggestion'](_0x1d2c41,_0x2566be){this['_view']['chatFeed']['scrollToSuggestion'](_0x1d2c41,_0x2566be);}['startAutoScroll'](){this['_view']['chatFeed']['startAutoScroll']();}['disableControls'](){this['_view']['chatControls']['isDisabled']=!0x0;}['enableControls'](){this['_view']['chatControls']['isDisabled']=!0x1;}}class yi extends _0xc6bdf6{['sections'];constructor(_0x1cc9d9,_0xce5108){super(_0x1cc9d9),this['sections']=_0xce5108,this['items']['addMany'](this['sections']),this['extendTemplate']({'attributes':{'class':['ck-ai-chat-history__sections']}});}['filter'](_0x1dd18d){let _0x467928=0x0,_0x365691=0x0;for(const _0x5ae5dc of this['sections']){const {resultsCount:_0x15c6e1,totalItemsCount:_0x5669a5}=_0x5ae5dc['filter'](_0x1dd18d);_0x467928+=_0x15c6e1,_0x365691+=_0x5669a5;}return{'resultsCount':_0x467928,'totalItemsCount':_0x365691};}}class Ri extends _0x2a0bb9{['title'];['itemsViews'];['_itemsListView'];constructor(_0x27ba6a,{title:_0x233ce6,items:_0x61fcef}){super(_0x27ba6a);const _0x587f69=this['bindTemplate'];this['set']('isVisible',!0x0),this['title']=_0x233ce6,this['itemsViews']=_0x61fcef;const _0x50a16=new _0x1f054a(_0x27ba6a);_0x50a16['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-history__section-title']},'children':[this['title']]}),this['_itemsListView']=new _0xc6bdf6(_0x27ba6a),this['_itemsListView']['items']['addMany'](this['itemsViews']),this['setTemplate']({'tag':'li','attributes':{'class':['ck-ai-chat-history__section',_0x587f69['if']('isVisible','ck-hidden',_0x51204d=>!_0x51204d)]},'children':[_0x50a16,this['_itemsListView']]});}['filter'](_0xb5535f){const _0x60947f=this['itemsViews']['length'];let _0x46bc03=0x0;for(const _0x549c3e of this['itemsViews']){if(_0xb5535f){const _0x398f45=_0x549c3e['isMatching'](_0xb5535f);_0x549c3e['isVisible']=!!_0x398f45,_0x549c3e['highlightText'](_0xb5535f);}else _0x549c3e['isVisible']=!0x0,_0x549c3e['highlightText'](null);_0x549c3e['isVisible']&&_0x46bc03++;}return this['isVisible']=_0x46bc03>0x0,{'resultsCount':_0x46bc03,'totalItemsCount':_0x60947f};}['getItem'](_0x11acdc){return this['itemsViews']['find'](_0x397f38=>_0x397f38['id']===_0x11acdc);}['removeItem'](_0x26b368){const _0x39ebcd=this['itemsViews']['indexOf'](_0x26b368);-0x1!==_0x39ebcd&&(this['itemsViews']['splice'](_0x39ebcd,0x1),this['_itemsListView']['items']['remove'](_0x26b368));}}class Mi extends/* #__PURE__ -- @preserve */
|
|
27
|
-
_0x25cea9(_0x2a0bb9){['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(_0x4ea12b,_0x3486ed){super(_0x4ea12b);const _0x2f04c9=this['bindTemplate'];this['set']('isEdit',!0x1),this['set']('isVisible',!0x0),this['set']('pinned',!!_0x3486ed['pinned']),this['set']('loadingState',null),this['id']=_0x3486ed['id'];const {title:_0xabf734,createdAt:_0x1df724,active:_0x1b59b4=!0x1}=_0x3486ed;this['_titleView']=new _0x5ecd8f(),this['_titleView']['text']=_0xabf734,this['_titleView']['extendTemplate']({'attributes':{'class':['ck-ai-chat-history__item-title']}});const _0x5f472c=this['_createCheckView'](),_0x3f2709=this['_createPinButtonView'](_0x4ea12b),_0x31e86d=this['_createMenuDropdownView'](),_0x521238=this['_createEditInputView'](_0x4ea12b,_0xabf734),_0x3caa3c=this['_createAcceptEditButtonView'](_0x4ea12b,_0x521238),_0x5a7586=this['_createCancelEditButtonView'](_0x4ea12b,_0x521238);this['actions']=this['createCollection'](),this['mainContent']=this['createCollection'](),this['mainContent']['add'](this['_titleView']),this['actions']['add'](_0x3f2709),this['actions']['add'](_0x31e86d),this['on']('change:isEdit',(_0x593672,_0x18cdf7,_0x3367d2)=>{this['actions']['clear'](),this['mainContent']['clear'](),_0x3367d2?(this['actions']['add'](_0x3caa3c),this['actions']['add'](_0x5a7586),this['mainContent']['add'](_0x521238),_0x521238['element']['focus']()):(this['actions']['add'](_0x3f2709),this['actions']['add'](_0x31e86d),this['mainContent']['add'](this['_titleView']));}),this['setTemplate']({'tag':'li','attributes':{'class':['ck-ai-chat-history__item',_0x1b59b4?'ck-ai-chat-history__item--active':'',_0x2f04c9['if']('isVisible','ck-hidden',_0x49208f=>!_0x49208f),_0x2f04c9['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',_0x2f04c9['if']('loadingState','ck-hidden',_0x58b1cc=>!!_0x58b1cc)]},'children':_0x1b59b4?[_0x5f472c]:[]},{'tag':'div','attributes':{'class':['ck-ai-loader',_0x2f04c9['if']('loadingState','ck-hidden',_0x39487b=>!_0x39487b)]},'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',_0x2f04c9['if']('loadingState','ck-hidden',_0x3c9ba3=>!!_0x3c9ba3)]},'children':this['mainContent']},{'tag':'div','attributes':{'class':['ck-ai-loader__text',_0x2f04c9['if']('loadingState','ck-hidden',_0x140bdf=>!_0x140bdf)]},'children':[{'text':_0x2f04c9['to']('loadingState',_0x1ebdbf=>_0x1ebdbf?h(this['locale'],Mi['LOADING_LABELS'][_0x1ebdbf]):'')}]}]},{'tag':'span','attributes':{'class':['ck-ai-chat-history__item-date']},'children':[_0x1df724]}]},{'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'](_0x5936a0){this['_titleView']['text']=_0x4ae586(_0x5936a0);}['updateLoadingState'](_0x35eaa8,_0x1757f2){this['set']('loadingState',_0x1757f2?_0x35eaa8:null);}['_createCheckView'](){const _0xddff4e=new _0x152087();return _0xddff4e['set']({'content':_0x386c9f}),_0xddff4e;}['_createPinButtonView'](_0x42e631){const _0x5ac9b9=new _0x1d1b95(_0x42e631);return _0x5ac9b9['set']({'label':h(_0x42e631,'AI_CHAT_HISTORY_PIN_BUTTON'),'icon':_0x1d01b4,'withText':!0x1,'tooltip':!0x0}),_0x5ac9b9['bind']('isOn')['to'](this,'pinned'),_0x5ac9b9['on']('execute',()=>{const _0x458004=!this['pinned'];this['fire']('setConversationPinned',{'id':this['id'],'pinned':_0x458004});}),_0x5ac9b9;}['_createMenuDropdownView'](){const _0x26370a=_0x290605(this['locale'],_0x36a822),_0x3cf524=_0x26370a['panelView']['children'];_0x26370a['buttonView']['set']({'label':h(this['locale'],'AI_CHAT_HISTORY_SHOW_MORE_ITEMS'),'icon':_0x36ac21}),_0x26370a['panelPosition']='sw';const _0x20e055=new _0x1d1b95(this['locale']);_0x20e055['label']=h(this['locale'],'AI_CHAT_HISTORY_EDIT_NAME'),_0x20e055['withText']=!0x0,_0x20e055['on']('execute',()=>{this['isEdit']=!0x0;});const _0x451c38=new _0x1d1b95(this['locale']);_0x451c38['label']=h(this['locale'],'AI_CHAT_HISTORY_REMOVE'),_0x451c38['withText']=!0x0,_0x451c38['on']('execute',()=>{this['showConfirm'](h(this['locale'],'AI_CHAT_HISTORY_REMOVE_CONFIRM'),this['element'])['then'](()=>{this['fire']('removeConversation',{'id':this['id']});});});const _0x41023d=new _0xc6bdf6(this['locale']),_0x289cf2=new _0x2a0bb9(this['locale']);_0x289cf2['children']['add'](_0x20e055);const _0x1cefae=new _0x2a0bb9(this['locale']);return _0x1cefae['children']['add'](_0x451c38),_0x41023d['items']['addMany']([_0x289cf2,_0x1cefae]),_0x3cf524['add'](_0x41023d),_0x26370a;}['_createEditInputView'](_0x3cfc98,_0xdce3ac){const _0x4f0373=new _0x3ca17d(_0x3cfc98),_0x15c2fc=_0x4f0373['bindTemplate'];return _0x4f0373['value']=_0xdce3ac,_0x4f0373['extendTemplate']({'on':{'keydown':_0x15c2fc['to'](_0x52599b=>{'Enter'==_0x52599b['key']&&this['_commitEditInputValue'](_0x4f0373);})}}),_0x4f0373;}['_createAcceptEditButtonView'](_0x2b3e64,_0x90c78a){const _0x3705ee=new _0x1d1b95(_0x2b3e64);return _0x3705ee['set']({'icon':_0x386c9f,'withText':!0x1,'tooltip':h(_0x2b3e64,'AI_CHAT_HISTORY_ACCEPT')}),_0x3705ee['extendTemplate']({'attributes':{'class':['ck-confirm-view-submit']}}),_0x3705ee['on']('execute',()=>{this['_commitEditInputValue'](_0x90c78a);}),_0x3705ee;}['_commitEditInputValue'](_0x3c4465){const _0x5c6425=_0x3c4465['element']['value']||'';this['_titleView']['text']=_0x5c6425,this['isEdit']=!0x1,this['fire']('editConversationTitle',{'id':this['id'],'title':_0x5c6425});}['_createCancelEditButtonView'](_0x156a0a,_0x157849){const _0x36e954=new _0x1d1b95(_0x156a0a);return _0x36e954['set']({'icon':_0x12f0df,'withText':!0x1,'tooltip':h(_0x156a0a,'AI_CHAT_HISTORY_CANCEL')}),_0x36e954['extendTemplate']({'attributes':{'class':['ck-confirm-view-cancel']}}),_0x36e954['on']('execute',()=>{this['isEdit']=!0x1,_0x157849['value']=this['_titleView']['text']||'',this['fire']('edit:cancel');}),_0x36e954;}['_createSpinnerView'](){const _0xc8ded1=new mi('tiny');return _0xc8ded1['isVisible']=!0x0,_0xc8ded1;}['isMatching'](_0x78c704){return this['_titleView']&&'string'==typeof this['_titleView']['text']&&this['_titleView']['text']['match'](_0x78c704)?{'title':!0x0}:null;}['highlightText'](_0x1c064b){this['_titleView']['highlightText'](_0x1c064b);}}class vt extends _0x1f054a{['searchView'];['mainErrorView'];['skeletonView'];['emptyView'];['sectionsView'];['resizeButton'];constructor(_0x2bdd34,_0x460eea){super(_0x2bdd34),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 _0x24c297=new _0x337d54(_0x2bdd34,{'label':h(_0x2bdd34,'AI_CHAT_HISTORY_HEADING'),'icon':Ht,'class':'ck-ai-header\x20ck-ai-header_history'});_0x460eea&&(this['resizeButton']=Hs(_0x2bdd34,this),_0x24c297['children']['add'](this['resizeButton'])),this['sectionsView']=new yi(_0x2bdd34,[]),this['sectionsView']['delegate'](...ji)['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',_0x3c72a3=>!_0x3c72a3)]}}),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':[_0x24c297,{'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 _0x18794c=new _0x1877d1(this['locale'],{'filteredView':this['sectionsView'],'queryView':{'label':h(this['locale'],'AI_CHAT_HISTORY_SEARCH_LABEL')},'infoView':{'text':{'notFound':{'primary':_0x2c2996=>h(this['locale'],'AI_CHAT_HISTORY_SEARCH_NOT_FOUND_PRIMARY',_0x2c2996),'secondary':h(this['locale'],'AI_CHAT_HISTORY_SEARCH_NOT_FOUND_SECONDARY')}}}}),_0x2f2b40=this['_createErrorView']();return _0x2f2b40['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('errorMessage','ck-hidden',_0x427d2a=>!_0x427d2a)]}}),_0x18794c['on']('render',()=>{_0x18794c['children']['add'](_0x2f2b40,0x1);}),_0x18794c['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isSearchViewVisible','ck-hidden',_0x582401=>!_0x582401)]}}),_0x18794c;}['_createSkeletonView'](){const _0xd8473f=new di(this['locale'],li['aiHistory']);return _0xd8473f['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isLoading','ck-hidden',_0x26deb2=>!_0x26deb2)]}}),_0xd8473f;}['_createErrorView'](){const _0x3ba1fd=new _0x1f054a(this['locale']),_0x326581=new _0x1d1b95(this['locale']);_0x326581['set']({'withText':!0x1,'icon':_0x12f0df,'class':'ck-ai-notification_error__dismiss-button'}),_0x326581['bind']('isVisible')['to'](this,'hasItems',_0x3fe011=>!!_0x3fe011),_0x326581['on']('execute',()=>{this['errorMessage']='';});const _0x16e081=this['bindTemplate'];return _0x3ba1fd['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-notification','ck-ai-notification_error']},'children':[{'tag':'p','children':[{'text':_0x16e081['to']('errorMessage')}]},_0x326581]}),_0x3ba1fd;}['_createEmptyStateView'](){const _0x3c13fc=new _0x1d1b95(this['locale']);_0x3c13fc['set']({'label':h(this['locale'],'AI_CHAT_LABEL_NEW_CHAT'),'withText':!0x0,'icon':_0x18a571,'class':'ck-ai-chat__start-conversation'}),_0x3c13fc['on']('execute',()=>{this['fire']('openChat');});const _0x17340e=new _0x1f054a(this['locale']);return _0x17340e['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-history__empty',this['bindTemplate']['if']('isEmptyViewVisible','ck-hidden',_0x6be2db=>!_0x6be2db)]},'children':[{'tag':'p','attributes':{'class':['ck-ai-chat-history__empty-message']},'children':[h(this['locale'],'AI_CHAT_HISTORY_EMPTY_MESSAGE')]},_0x3c13fc]}),_0x17340e;}['_createListItemViews'](_0x3fc313,_0x581d96){const _0x52ed40=[];for(const _0x568c6f of _0x3fc313){const _0x224249=new Mi(_0x581d96,_0x568c6f);_0x224249['delegate'](...ji)['to'](this),_0x52ed40['push'](_0x224249);}return _0x52ed40;}['updateHistoryItemsWithCategories'](_0x131103){const _0x244751=this['locale']||'en',_0x582165=[];for(const _0x5b5c66 of _0x131103){const _0x1a9c8b=this['_createListItemViews'](_0x5b5c66['items'],_0x244751);_0x582165['push'](new Ri(_0x244751,{'title':_0x5b5c66['title'],'items':_0x1a9c8b}));}this['sectionsView']['sections']=_0x582165,this['sectionsView']['items']['clear'](),this['sectionsView']['items']['addMany'](_0x582165),this['hasItems']=_0x131103['some'](_0x3db5ff=>_0x3db5ff['items']['length']>0x0),this['_refreshSearch']();}['removeHistoryItem'](_0x2db331){for(const _0x29c62b of this['sectionsView']['sections']){const _0x540e76=_0x29c62b['getItem'](_0x2db331);if(_0x540e76){if(_0x29c62b['removeItem'](_0x540e76),0x0===_0x29c62b['itemsViews']['length']){const _0x1de9da=this['sectionsView']['sections']['indexOf'](_0x29c62b);-0x1!==_0x1de9da&&(this['sectionsView']['sections']['splice'](_0x1de9da,0x1),this['sectionsView']['items']['remove'](_0x29c62b));}this['hasItems']=this['sectionsView']['sections']['length']>0x0,this['_refreshSearch']();break;}}}['updateItemTitle'](_0x5e4c15,_0xfebf0f){for(const _0x3425d7 of this['sectionsView']['sections']){const _0x1707a7=_0x3425d7['getItem'](_0x5e4c15);if(_0x1707a7){_0x1707a7['updateTitle'](_0xfebf0f);break;}}}['updateItemLoadingState'](_0x58cb4e,_0x5625ad,_0x45c270){for(const _0x1d0ede of this['sectionsView']['sections']){const _0x1444ea=_0x1d0ede['getItem'](_0x58cb4e);if(_0x1444ea){_0x1444ea['updateLoadingState'](_0x5625ad,_0x45c270);break;}}}['_refreshSearch'](){if(this['hasItems']){const _0x15d7d4=this['searchView']['queryView']['fieldView']?.['element']?.['value']||'';this['searchView']['search'](_0x15d7d4);}}}const ji=['showConversationHistory','removeConversation','editConversationTitle','setConversationPinned','selectConversation','openChat','resizeTabs'];class yt extends _0x5dcf5b{static get['requires'](){return[it];}['_historyView'];static get['pluginName'](){return'AIChatHistoryUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x3dcb1d){super(_0x3dcb1d);const _0x5487df=this['context']['plugins']['get']('AITabs');this['_historyView']=new vt(this['context']['locale'],_0x5487df['showResizeButton']),this['_historyView']['delegate'](...ji)['to'](this),_0x5487df['view']['addTab']({'id':'history','buttonLabel':h(this['context']['locale'],'AI_CHAT_HISTORY_HEADING'),'buttonIcon':Ht,'order':0x0,'content':this['_historyView']});}['removeHistoryItem'](_0x3c4fdc){this['_historyView']['removeHistoryItem'](_0x3c4fdc);}['updateItems'](_0x40315d){this['_historyView']['updateHistoryItemsWithCategories'](_0x40315d);}['updateItemTitle'](_0x1e50c0,_0x56eae6){this['_historyView']['updateItemTitle'](_0x1e50c0,_0x56eae6);}['updateItemLoadingState'](_0x3bbcdb,_0x134091,_0x4dd262){this['_historyView']['updateItemLoadingState'](_0x3bbcdb,_0x134091,_0x4dd262);}['setLoadingSkeleton'](_0x42aeb6){this['_historyView']['isLoading']=_0x42aeb6;}['showError'](_0x3b01ea){this['_historyView']['errorMessage']=_0x3b01ea;}['hideError'](){this['_historyView']['errorMessage']='';}['setIsMaximized'](_0x1e5842){this['_historyView']['isMaximized']=_0x1e5842;}}class ir extends ts(){['id'];['createdAt'];constructor({id:_0x2f1b2e,title:_0x37af14,createdAt:_0x322624,updatedAt:_0x324d75,pinned:_0x12f9a2}){super(),this['id']=_0x2f1b2e,this['createdAt']=new Date(_0x322624),this['set']('title',_0x37af14),this['set']('updatedAt',_0x324d75?new Date(_0x324d75):null),this['set']('pinned',_0x12f9a2||!0x1);}['updateTitle'](_0x5cc891){this['set']('title',_0x4ae586(_0x5cc891)),this['updatedAt']=new Date();}['updatePinned'](_0x371522){this['set']('pinned',_0x371522),this['updatedAt']=new Date();}}class Tt extends _0xa7ecb2(){['items']=[];['connector'];['group'];constructor({connector:_0x2ec5d4,group:_0x3e654b}){super(),this['connector']=_0x2ec5d4,this['group']=_0x3e654b;}async['init'](){try{const _0x21292c=this['connector']['fetchConversations'](this['group']),_0x55267c=await _0x21292c['getConversations']();this['loadItems'](_0x55267c);}catch(_0x44a8e9){this['fire']('error',{'error':_0x44a8e9,'operation':'init'});}}['addItem'](_0x3722db){this['items']['push'](_0x3722db);}async['removeItem'](_0x4be48c){const _0x49fafa=this['items']['findIndex'](_0x3952f0=>_0x3952f0['id']===_0x4be48c);if(-0x1===_0x49fafa)return!0x1;try{return await this['connector']['deleteConversation'](_0x4be48c)['execute'](),this['items']['splice'](_0x49fafa,0x1),this['fire']('itemRemoved',{'itemId':_0x4be48c}),!0x0;}catch(_0x16b639){return this['fire']('error',{'error':_0x16b639,'operation':'removeItem','itemId':_0x4be48c}),!0x1;}}['getItem'](_0x336501){return this['items']['find'](_0x242914=>_0x242914['id']===_0x336501);}async['updateItemTitle'](_0x545fe9,_0x6209b){const _0x4c4381=this['getItem'](_0x545fe9);if(!_0x4c4381)return!0x1;try{return await this['connector']['updateConversation'](_0x545fe9,{'title':_0x6209b})['getResult'](),_0x4c4381['updateTitle'](_0x6209b),this['fire']('itemUpdated',{'itemId':_0x545fe9,'updates':{'title':_0x6209b}}),!0x0;}catch(_0x100518){return this['fire']('error',{'error':_0x100518,'operation':'updateItemTitle','itemId':_0x545fe9}),!0x1;}}async['updateItemPinned'](_0xe78bc8,_0x1d2e51){const _0x5de32d=this['getItem'](_0xe78bc8);if(!_0x5de32d)return!0x1;try{return await this['connector']['updateConversation'](_0xe78bc8,{'pinned':_0x1d2e51})['getResult'](),_0x5de32d['updatePinned'](_0x1d2e51),this['fire']('itemUpdated',{'itemId':_0xe78bc8,'updates':{'pinned':_0x1d2e51}}),!0x0;}catch(_0x37ad96){return this['fire']('error',{'error':_0x37ad96,'operation':'updateItemPinned','itemId':_0xe78bc8}),!0x1;}}['loadItems'](_0xd01ec7){try{this['items']=[],_0xd01ec7['map'](_0x13d637=>{this['addItem'](new ir(_0x13d637));}),this['fire']('itemsLoaded',{'items':[...this['items']]});}catch(_0x297d32){this['fire']('error',{'error':_0x297d32,'operation':'loadItems'});}}['getItems'](_0x2ca95f={}){const _0x3a66d4=void 0x0!==_0x2ca95f['pinned']&&_0x2ca95f['pinned'],_0x10fe77=_0x2ca95f['from']?new Date(_0x2ca95f['from']['getFullYear'](),_0x2ca95f['from']['getMonth'](),_0x2ca95f['from']['getDate']()):null,_0x2b27aa=_0x2ca95f['to']?new Date(_0x2ca95f['to']['getFullYear'](),_0x2ca95f['to']['getMonth'](),_0x2ca95f['to']['getDate']()):null;return this['items']['filter'](_0xff4175=>{if(_0xff4175['pinned']!==_0x3a66d4)return!0x1;if(_0x2b27aa){const _0x415a0b=new Date(_0xff4175['createdAt']['getFullYear'](),_0xff4175['createdAt']['getMonth'](),_0xff4175['createdAt']['getDate']());return _0x10fe77?_0x10fe77['getTime']()===_0x2b27aa['getTime']()?_0x415a0b['getTime']()===_0x10fe77['getTime']():_0x415a0b<_0x2b27aa&&_0x415a0b>=_0x10fe77:_0x415a0b<_0x2b27aa;}return!0x0;});}}class ft extends _0x5dcf5b{['_aiConnector'];['_aiChatHistoryUi'];['_aiChatController'];static get['requires'](){return[tt,S,yt,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'](yt),this['_aiChatController']=this['context']['plugins']['get'](S);const _0x43dd2a=this['context']['plugins']['get'](it);try{const _0x21e793=this['_aiChatController']['getGroupId']();this['history']=new Tt({'connector':this['_aiConnector'],'group':_0x21e793}),this['listenTo'](this['_aiChatHistoryUi'],'removeConversation',(_0x527146,_0x9745ba)=>{this['_setItemLoading'](_0x9745ba['id'],'remove'),this['_handleRemove'](_0x9745ba['id']);}),this['listenTo'](this['_aiChatHistoryUi'],'editConversationTitle',(_0x1c004a,_0x4c884e)=>{this['_setItemLoading'](_0x4c884e['id'],'rename'),this['_handleEditTitle'](_0x4c884e['id'],_0x4c884e['title']);}),this['listenTo'](this['history'],'itemUpdated',(_0x4beddc,_0x24aab7)=>{void 0x0!==_0x24aab7['updates']['title']&&this['_aiChatHistoryUi']['updateItemTitle'](_0x24aab7['itemId'],_0x24aab7['updates']['title']),void 0x0!==_0x24aab7['updates']['pinned']&&this['_updateHistoryItemsUI'](),this['_clearItemLoading'](_0x24aab7['itemId']);}),this['listenTo'](this['history'],'itemRemoved',(_0x4f89ff,_0x581c6b)=>{this['_aiChatController']['handleRemovedConversation'](_0x581c6b['itemId']),this['_aiChatHistoryUi']['removeHistoryItem'](_0x581c6b['itemId']),this['_clearItemLoading'](_0x581c6b['itemId']);}),this['listenTo'](this['history'],'itemsLoaded',()=>{this['_updateHistoryItemsUI']();}),this['listenTo'](this['history'],'error',(_0xd2fbc9,_0x53391d)=>{this['_handleHistoryErrorUI'](_0x53391d['error'],_0x53391d['operation'],_0x53391d['itemId']);}),this['listenTo'](this['_aiChatHistoryUi'],'selectConversation',(_0x597048,_0x50aff5)=>{this['_handleSelectConversation'](_0x50aff5['id']);}),this['listenTo'](this['_aiChatHistoryUi'],'setConversationPinned',(_0x57a9c7,_0x428e74)=>{const _0xc94f44=_0x428e74['pinned']?'pin':'unpin';this['_setItemLoading'](_0x428e74['id'],_0xc94f44),this['_handleTogglePin'](_0x428e74['id'],_0x428e74['pinned']);}),this['listenTo'](this['_aiChatHistoryUi'],'openChat',()=>{_0x43dd2a['view']['activateTab']('chat');}),this['listenTo'](this['_aiChatController'],'change:activeConversation',()=>{this['_updateHistoryItemsUI']();}),_0x43dd2a['view']['on']('activateTab:history',()=>{this['_showConversationHistory']();}),this['listenTo'](_0x43dd2a,'resizedTabs',(_0x3937be,_0x28984f)=>{this['_setIsMaximized'](_0x28984f);}),this['listenTo'](this['_aiChatHistoryUi'],'resizeTabs',()=>{_0x43dd2a['resize']();});}catch(_0xa8db57){this['_handleHistoryErrorUI'](_0xa8db57,'init');}}async['_handleEditTitle'](_0x3a8413,_0x3e57ff){await this['history']['updateItemTitle'](_0x3a8413,_0x3e57ff);}async['_handleTogglePin'](_0x59ef31,_0x436fa1){await this['history']['updateItemPinned'](_0x59ef31,_0x436fa1);}async['_handleRemove'](_0x73ca89){await this['history']['removeItem'](_0x73ca89);}async['_handleSelectConversation'](_0x2e5394){await this['_aiChatController']['loadConversation'](_0x2e5394);}async['_showConversationHistory'](){this['_aiChatHistoryUi']['showError'](''),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x0),await this['history']['init'](),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x1);}['_updateHistoryItemsUI'](){const _0x124973=this['_aiChatController']['activeConversation']?.['id'],_0x2fd19a=this['_getCategorizedItems']()['map'](_0x2d7e3b=>({'title':_0x2d7e3b['title'],'items':_0x2d7e3b['items']['map'](_0x57d831=>({'id':_0x57d831['id'],'title':_0x57d831['title']||h(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION'),'createdAt':new Date(_0x57d831['createdAt'])['toLocaleDateString'](),'active':_0x57d831['id']===_0x124973,'pinned':_0x57d831['pinned']}))}));this['_aiChatHistoryUi']['updateItems'](_0x2fd19a);}['_setItemLoading'](_0x46c21f,_0x59a705){this['_aiChatHistoryUi']['updateItemLoadingState'](_0x46c21f,_0x59a705,!0x0);}['_clearItemLoading'](_0x2c7255){this['_aiChatHistoryUi']['updateItemLoadingState'](_0x2c7255,null,!0x1);}['_handleHistoryErrorUI'](_0x46202a,_0x2400bd,_0x5c356e){const _0x490e=this['_generateErrorMessage'](_0x2400bd,_0x5c356e);this['_aiChatHistoryUi']['showError'](_0x490e),_0x5c356e&&this['_clearItemLoading'](_0x5c356e),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x1);}['_generateErrorMessage'](_0x34b1f2,_0x38d52a){const _0x4a718b=_0x38d52a?this['history']['getItem'](_0x38d52a):null,_0x22c39d=_0x4a718b?.['title']||h(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION');switch(_0x34b1f2){case'updateItemTitle':return h(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_UPDATE_TITLE',_0x22c39d);case'updateItemPinned':{const _0x4c3f38=h(this['context']['locale'],_0x4a718b?.['pinned']?'AI_CHAT_HISTORY_UNPIN_ACTION':'AI_CHAT_HISTORY_PIN_ACTION');return h(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_UPDATE_PINNED',[_0x4c3f38,_0x22c39d]);}case'removeItem':return h(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_REMOVE_ITEM',_0x22c39d);case'init':case'loadItems':return h(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_LOAD_ITEMS');default:return h(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_GENERIC');}}['_getCategorizedItems'](){const _0xef6e96=new Date(),_0x4e4d72=new Date(_0xef6e96['getFullYear'](),_0xef6e96['getMonth'](),_0xef6e96['getDate']()),_0x4395d2=new Date(_0x4e4d72);_0x4395d2['setDate'](_0x4395d2['getDate']()-0x1);const _0x36d0c9=new Date(_0x4e4d72);_0x36d0c9['setDate'](_0x36d0c9['getDate']()-0xe);const _0x5c99b9=this['history']['getItems']({'pinned':!0x0}),_0x2af87d=this['history']['getItems']({'from':_0x4e4d72,'to':_0x4e4d72}),_0x19e45f=this['history']['getItems']({'from':_0x4395d2,'to':_0x4395d2}),_0x2e3f85=this['history']['getItems']({'from':_0x36d0c9,'to':_0x4395d2}),_0xc35140=this['history']['getItems']({'to':_0x36d0c9}),_0x439fe7=[];return _0x5c99b9['length']>0x0&&_0x439fe7['push']({'title':h(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_PINNED'),'items':_0x5c99b9}),_0x2af87d['length']>0x0&&_0x439fe7['push']({'title':h(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_TODAY'),'items':_0x2af87d}),_0x19e45f['length']>0x0&&_0x439fe7['push']({'title':h(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_YESTERDAY'),'items':_0x19e45f}),_0x2e3f85['length']>0x0&&_0x439fe7['push']({'title':h(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_LAST_14_DAYS'),'items':_0x2e3f85}),_0xc35140['length']>0x0&&_0x439fe7['push']({'title':h(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_LATER'),'items':_0xc35140}),_0x439fe7;}['_setIsMaximized'](_0x3c914f){this['_aiChatHistoryUi']['setIsMaximized'](_0x3c914f);}}class z extends _0x5dcf5b{static get['requires'](){return[ft,yt];}static get['pluginName'](){return'AIChatHistory';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class Ma extends _0x5dcf5b{static get['requires'](){return[S,s,F,z];}static get['pluginName'](){return'AIChat';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x39ed0c){super(_0x39ed0c),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'](S)['addSelectionToChatContext']();}async['startConversation'](){await this['context']['plugins']['get'](S)['startConversation']();}async['sendMessage']({message:_0x595f4a,attributes:_0x5c1c6e}){await this['context']['plugins']['get'](S)['sendMessage']({'message':_0x595f4a,'attributes':_0x5c1c6e});}['removeSelectionFromChatContext'](){this['context']['plugins']['get'](S)['removeSelectionFromChatContext']();}['focusPromptInput'](){this['context']['plugins']['get'](S)['focusPromptInput']();}['registerToolDataCallback'](_0x35362d){this['context']['plugins']['get'](S)['_registerToolDataCallback'](_0x35362d);}}class js extends _0x1d1b95{['id'];constructor(_0x5d90a2,_0x8e47b8){super(_0x5d90a2);const {id:_0x2a91ae,type:_0x437c41,icon:_0x361fb1}=_0x8e47b8;this['id']=_0x2a91ae,this['set']({'label':_0x8e47b8['label'],'withText':!0x0,'class':'ck-ai-chat-shortcut'}),this['extendTemplate']({'attributes':{'data-cke-ai-shortcut-id':_0x8e47b8['id']}}),_0x361fb1?this['icon']=_0x361fb1:'chat'===_0x437c41?this['icon']=_0x315ea9:'review'===_0x437c41?this['icon']=_0x1a4041:'translate'===_0x437c41&&(this['icon']=Vt);}}class Mt extends _0x1f054a{['listView'];constructor(_0x4489bb,_0x4adaf0){super(_0x4489bb);const _0x20132b=_0x4adaf0['map'](_0x13542c=>{const _0x59fc8e=new _0x2a0bb9(this['locale']),_0x58de79=new js(this['locale'],_0x13542c);return _0x59fc8e['children']['add'](_0x58de79),_0x58de79['delegate']('execute')['to'](this),_0x59fc8e;});this['listView']=new _0xc6bdf6(this['locale']),this['listView']['items']['addMany'](_0x20132b),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat-shortcuts']},'children':[this['listView']]});}}const Ut='chat-shortcuts';var Ua=function(_0xfc97ae){return _0xfc97ae['CHAT']='chat',_0xfc97ae['REVIEW']='review',_0xfc97ae['TRANSLATE']='translate',_0xfc97ae;}({});class Va extends _0x5dcf5b{['_shortcuts'];['_shortcutsView'];['_aiChatUI'];static get['requires'](){return[F];}static get['pluginName'](){return'AIChatShortcuts';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){this['_aiChatUI']=this['context']['plugins']['get'](F),this['_shortcuts']=this['context']['config']['get']('ai.chat.shortcuts')??[];const _0x4d7132=this['context']['plugins']['get']('AIChatController');this['_shortcuts']['length']&&(this['_validateShortcuts'](),this['_aiChatUI']['on']('conversationCreated',()=>{_0x4d7132['activeConversation']['isFromHistory']||this['_injectShortcuts']();}),this['listenTo'](_0x4d7132,'interactionStarted',()=>{this['_removeShortcuts']();}));}['_validateShortcuts'](){const _0xa8324=Object['values'](Ua);this['_shortcuts']['forEach'](_0x441e5d=>{let _0x16ea5a=!0x0;if(_0x441e5d['id']&&_0x441e5d['label']&&_0xa8324['includes'](_0x441e5d['type'])?'chat'===_0x441e5d['type']&&(_0x16ea5a='string'==typeof _0x441e5d['prompt']):_0x16ea5a=!0x1,!_0x16ea5a)throw new _0x25c351('ai-chat-shortcuts-invalid-config',this['context'],{'shortcut':_0x441e5d});});}['_injectShortcuts'](){const _0x1ce98a=this['context']['plugins']['get'](F);this['_shortcutsView']=new Mt(this['context']['locale'],this['_shortcuts']),this['_shortcutsView']['render'](),_0x1ce98a['addFeedItemCustomElement'](this['_shortcutsView']['element'],Ut),this['_shortcutsView']['on']('execute',_0x569ac3=>{const _0x26bf40=_0x569ac3['source']['id'];this['_executeShortcut'](_0x26bf40);});}['_removeShortcuts'](){const _0x5c5df3=this['context']['plugins']['get'](F);_0x5c5df3['hasFeedItem'](Ut)&&_0x5c5df3['removeFeedItem'](Ut),this['_shortcutsView']?.['destroy']();}['_executeShortcut'](_0x2edd4b){const _0x4eb102=this['_shortcuts']['find'](_0x54252f=>_0x54252f['id']===_0x2edd4b),_0x39ad44=_0x4eb102['type'];'chat'===_0x39ad44?this['_runChatShortcut'](_0x4eb102):'review'===_0x39ad44?_0x4eb102['check']?this['_runReviewShortcut'](_0x4eb102):this['_switchTab']('reviewMode'):'translate'===_0x39ad44&&(_0x4eb102['language']?this['_runTranslateShortcut'](_0x4eb102):this['_switchTab']('translate'));}['_switchTab'](_0x57d348){if(!this['context']['plugins']['has']('AITabs'))throw new _0x25c351('ai-chat-shortcuts-ai-tabs-not-found',this['context'],{'tabName':_0x57d348});this['context']['plugins']['get']('AITabs')['view']['activateTab'](_0x57d348);}async['_runChatShortcut']({prompt:_0x373fb9,draftMode:_0x2dfc37,useWebSearch:_0x5440e1=!0x1,useReasoning:_0x36bf5b=!0x1,model:_0x53fd14}){const _0x2af908=this['context']['plugins']['get']('AIChat'),_0x1ae151=this['context']['plugins']['get']('AIChatController'),_0xea52e1=_0x1ae151['activeConversation'];let _0x188d55;_0x188d55=_0x53fd14?await _0xea52e1['chatModels']['getModel'](_0x53fd14):await _0xea52e1['chatModels']['getDefault'](),_0x188d55&&await _0xea52e1['setModel'](_0x188d55),_0xea52e1['setWebSearch'](_0x5440e1),_0xea52e1['setReasoning'](_0x36bf5b),_0x1ae151['addCurrentDocumentToChatContext'](),_0x2dfc37?(this['_aiChatUI']['setPromptInputValue'](_0x373fb9),this['_aiChatUI']['focusPromptInput'](!0x0)):_0x2af908['sendMessage']({'message':_0x373fb9});}['_runReviewShortcut']({check:_0x320ee2,model:_0x30eec0,prompt:_0x50ef27,params:_0x1ad2fe}){if(!this['context']['plugins']['has']('AIReviewModeUI'))throw new _0x25c351('ai-chat-shortcuts-review-mode-not-found',this['context']);this['_switchTab']('reviewMode');const _0x4fd3f3={'id':_0x320ee2,'isCustom':'custom'===_0x320ee2};_0x30eec0&&_0x50ef27&&(_0x4fd3f3['args']={'model':_0x30eec0,'prompt':_0x50ef27}),_0x1ad2fe&&(_0x4fd3f3['params']=_0x1ad2fe),this['context']['plugins']['get']('AIReviewModeUI')['fire']('runReviewCheck',_0x4fd3f3);}['_runTranslateShortcut']({language:_0x1f8b4a}){if(!this['context']['plugins']['has']('AITranslateUI'))throw new _0x25c351('ai-chat-shortcuts-translate-not-found',this['context']);this['_switchTab']('translate'),this['context']['plugins']['get']('AITranslateUI')['fire']('runReviewCheck',{'id':_0x1f8b4a,'args':{'language':_0x1f8b4a}});}}class io extends Lt{constructor(_0x23a219){super(_0x23a219);const _0x3228bd=_0x23a219['plugins']['get']('AITabs')['view'];this['bind']('value')['to'](_0x3228bd,'isVisible'),this['isEnabled']=!0x0;}['execute'](){const _0x312fc9=this['editor']['plugins']['get']('AITabs')['view'];_0x312fc9['isVisible']=!_0x312fc9['isVisible'];}}class Pt extends _0x53f6d2{static get['requires'](){return[it];}static get['pluginName'](){return'AIToggleButtonUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x1a3610=this['editor'];_0x1a3610['commands']['add']('toggleAi',new io(_0x1a3610)),_0x1a3610['ui']['componentFactory']['add']('toggleAi',()=>{const _0xa4d986=this['_createAIUIButton'](_0x1d1b95);return _0xa4d986['set']({'tooltip':!0x0,'class':'ck-ai-toggle-button'}),_0xa4d986;}),_0x1a3610['ui']['componentFactory']['add']('menuBar:toggleAi',()=>{const _0x47f8e2=this['_createAIUIButton'](_0x229d28);return _0x47f8e2['set']({'role':'menuitemcheckbox'}),_0x47f8e2;});}['_createAIUIButton'](_0x2c19b1){const _0x734230=this['editor'],_0x281b45=_0x734230['commands']['get']('toggleAi'),_0x574cdf=new _0x2c19b1(_0x734230['locale']);return _0x574cdf['set']({'label':h(_0x734230['locale'],'AI_TOGGLE_BUTTON_LABEL'),'icon':_0x5591e5,'isToggleable':!0x0}),_0x574cdf['bind']('isEnabled')['to'](_0x281b45),_0x574cdf['bind']('isOn')['to'](_0x281b45,'value',_0x547a46=>!!_0x547a46),this['listenTo'](_0x574cdf,'execute',()=>{_0x281b45['execute']();}),_0x574cdf;}}const u=['applySuggestion','insertSuggestion','showNext','showPrevious'];class gs extends _0x1f054a{['_errorView'];constructor(_0x1453b9){super(_0x1453b9),this['set']('_errorMessage',''),this['set']('_isErrorVisible',!0x1);}['showBlockingError'](_0x3a9b0d){this['showError'](_0x3a9b0d);}['showError'](_0x354c70){this['_errorView']||(this['_errorView']=this['_createErrorView']()),this['_errorMessage']=_0x354c70,this['_isErrorVisible']=!0x0;}['hideError'](){this['_isErrorVisible']=!0x1;}['_createErrorView'](){const _0x5a2ece=new _0x1f054a(this['locale']),_0x13a2dd=new _0x1f054a(this['locale']);return _0x13a2dd['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-suggestion__error-text']},'children':[{'text':this['bindTemplate']['to']('_errorMessage')}]}),_0x5a2ece['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__error','ck-ai-balloon-error',this['bindTemplate']['if']('_isErrorVisible','ck-hidden',_0x38a312=>!_0x38a312)]},'children':[_0x13a2dd]}),_0x5a2ece;}}const m=0xa;class R extends _0x5dcf5b{static get['requires'](){return[s];}static get['pluginName'](){return'AIBalloon';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['isOpen']=!0x1;['_currentConfig'];['_isUpdatingMarkers']=!0x1;['open'](_0x1733f0){const {id:_0x3b0217}=this['_currentConfig']??{};this['_currentConfig']=_0x1733f0;const {id:_0x43bc82}=this['_currentConfig'];this['isOpen']&&_0x3b0217===_0x43bc82?this['_updateDialog']():this['_showDialog']();}['close'](){const _0x2c9f93=c(this['context'])['plugins']['get']('Dialog');_0x2c9f93['isOpen']&&this['_currentConfig']&&_0x2c9f93['id']===this['_currentConfig']['id']&&_0x2c9f93['hide']();}['_updateDialog'](){const _0x1b9ec7=c(this['context'])['plugins']['get']('Dialog'),{icon:_0x24c25b,title:_0x2837ca}=this['_currentConfig'];_0x1b9ec7['view']?.['headerView']&&(_0x1b9ec7['view']['headerView']['label']=_0x2837ca,_0x1b9ec7['view']['headerView']['iconView']&&_0x24c25b&&(_0x1b9ec7['view']['headerView']['iconView']['content']=_0x24c25b)),this['_isUpdatingMarkers']=!0x0,this['_showFakeVisualSelection'](),this['_isUpdatingMarkers']=!0x1,_0x1b9ec7['view']?.['updatePosition']();}['_showFakeVisualSelection'](){this['context']['plugins']['get'](s)['showFakeVisualSelection'](this['_currentConfig']['ranges'],'ai-balloon-'+this['_currentConfig']['index'],!0x0,!0x0);}['_hideFakeVisualSelection'](_0x20bfa1){this['context']['plugins']['get'](s)['hideFakeVisualSelection']('ai-balloon-'+_0x20bfa1);}['_showDialog'](){const _0x546988=c(this['context'])['plugins']['get']('Dialog'),{id:_0xf2dbc3,title:_0x4efc0e,icon:_0x216a1f,class:_0x45126d,mainView:_0x156b48}=this['_currentConfig'];_0x156b48['delegate'](...u)['to'](this),_0x546988['show']({'title':_0x4efc0e,'icon':_0x216a1f,'hasCloseButton':!0x0,'id':_0xf2dbc3,'position':this['_calculateDialogPosition']['bind'](this),'className':'ck-ai-balloon\x20'+(_0x45126d||''),'content':_0x156b48,'onShow':_0x28f483=>{this['_showFakeVisualSelection'](),this['_setupFakeVisualSelectionMarkerRemovalListener']();const _0x5cfe5d=this['_getSelectionElements']();_0x5cfe5d&&_0x5cfe5d[0x0]&&_0x517478({'target':_0x5cfe5d[0x0],'ancestorOffset':0x14,'alignToTop':!0x0,'viewportOffset':{'top':0x14,'bottom':0x14,'left':0x0,'right':0x0}}),this['isOpen']=!0x0,_0x28f483['once']('hide',()=>{this['fire']('beforeDialogClosed',{'id':_0xf2dbc3});},{'priority':'high'});},'onHide':()=>{this['_hideFakeVisualSelection'](this['_currentConfig']['index']),this['_cleanupFakeVisualSelectionMarkerRemovalListener'](),this['fire']('dialogClosed',{'id':_0xf2dbc3}),this['isOpen']=!0x1;}});}['_calculateDialogPosition'](_0x152181,_0x3cfc9f){if(!_0x3cfc9f)return null;const _0x550a53=this['_getSelectionElements']();if(!_0x550a53||0x0===_0x550a53['length'])return{'left':Math['round'](_0x3cfc9f['left']+_0x3cfc9f['width']/0x2-_0x152181['width']/0x2),'top':Math['round'](_0x3cfc9f['top']+_0x3cfc9f['height']/0x2-_0x152181['height']/0x2)};const _0x260a42=Math['round'](_0x3cfc9f['left']+_0x3cfc9f['width']/0x2-_0x152181['width']/0x2),_0x1d9c2f=_0x550a53['map'](_0x1cfbf6=>new _0x5002e3(_0x1cfbf6)),_0x220671=_0x152181['height'];return{'left':_0x260a42,'top':this['_calculateOptimalTopPosition'](_0x1d9c2f,_0x220671,_0x3cfc9f)};}['_calculateOptimalTopPosition'](_0x56dd0d,_0x217825,_0x2d6c7f){const _0x240d62=new _0x5002e3(_0x1385df['window']),_0x6f0947=_0x56dd0d['map'](_0x32c84f=>_0x32c84f['getVisible']())['filter'](_0x54f6b6=>_0x54f6b6),_0x210b21=_0x5002e3['getBoundingRect'](_0x6f0947);if(!_0x210b21)return Math['round'](_0x2d6c7f['top']+_0x2d6c7f['height']/0x2);const _0x3123ba=_0x240d62['getIntersection'](_0x210b21);if(!_0x3123ba)return Math['round'](_0x2d6c7f['top']+_0x2d6c7f['height']/0x2);const _0xc38260=_0x2d6c7f['getVisible'](),_0x4b8a41=_0xc38260&&_0x210b21['height']>_0xc38260['height'],_0x55fed1=_0x3123ba['top'],_0x1dee06=_0x3123ba['bottom'];if(_0x4b8a41){const _0x5893ab=(_0xc38260||_0x240d62)['height']/0x2-_0x217825/0x2,_0x5ab73d=_0x55fed1-m-_0x2d6c7f['top'],_0xd040cc=_0x2d6c7f['bottom']-_0x1dee06-m;return _0x5ab73d>=_0x217825?Math['max'](m,_0x55fed1-_0x217825-m):_0xd040cc>=_0x217825?_0x1dee06+m:Math['max'](m,_0x5893ab);}const _0x4e0f62=_0x55fed1-_0x217825,_0x33a28b=_0x2d6c7f['bottom']-_0x1dee06-m,_0xf3ef56=_0x55fed1-m-_0x2d6c7f['top'];let _0x5ba3cb;if(_0x33a28b>=_0x217825)_0x5ba3cb=_0x1dee06+m;else{if(_0xf3ef56>=_0x217825)_0x5ba3cb=_0x4e0f62-m;else _0x5ba3cb=_0x55fed1+_0x210b21['height']/0x2-_0x217825/0x2;}return _0x5ba3cb;}['_setupFakeVisualSelectionMarkerRemovalListener'](){const _0x2330f6=c(this['context']);this['listenTo'](_0x2330f6['model']['document'],'change',()=>{if(!this['_isUpdatingMarkers']){for(const {name:_0xcf2e4,data:{newRange:_0x586b88}}of _0x2330f6['model']['document']['differ']['getChangedMarkers']())if(_0xcf2e4['startsWith'](o+':')&&(_0x586b88&&(_0x586b88['start']['isEqual'](_0x586b88['end'])||'$graveyard'==_0x586b88['root']['rootName'])||null==_0x586b88)){const _0x51f17a=h(this['context']['locale'],'AI_BALLOON_SELECTION_REMOVED_ERROR');this['_currentConfig']['mainView']['showBlockingError'](_0x51f17a),this['fire']('selectionRemoved');}}});}['_cleanupFakeVisualSelectionMarkerRemovalListener'](){const _0x58b123=c(this['context']);this['_currentConfig']['mainView']['hideError'](),this['stopListening'](_0x58b123['model']['document']);}['_getSelectionElements'](){const _0x43e3ca=c(this['context']);return _0x19636f(_0x43e3ca['editing'],[..._0x43e3ca['model']['markers']['getMarkersGroup']('ai-selection'),..._0x43e3ca['model']['markers']['getMarkersGroup']('ai-balloon-selection')]);}}class ls extends _0x50bbb8{['copyButton'];['likeButton'];['dislikeButton'];['showChangesButton'];['_config'];constructor(_0x215d4c,_0x122296={}){super(_0x215d4c),this['set']('isEnabled',!0x0),this['set']('isShowChangesOn',!0x1),this['_config']={'showCopy':!0x1,'showLike':!0x1,'showDislike':!0x1,..._0x122296};const _0x49e8de=!(this['_config']['showCopy']||this['_config']['showChanges']||this['_config']['showLike']||this['_config']['showDislike']||this['_config']['customView']?.['length']);this['class']=_0x49e8de?'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'](_0x7b041b){this['showChangesButton']['isEnabled']=_0x7b041b;}['_setupRatingButtons'](){this['likeButton']=new _0x1d1b95(this['locale']),this['likeButton']['set']({'icon':_0x4d8f3a,'label':h(this['locale'],'AI_MINI_TOOLBAR_LIKE'),'tooltip':!0x0}),this['likeButton']['bind']('isEnabled')['to'](this),this['likeButton']['on']('execute',()=>{this['fire']('like');}),this['dislikeButton']=new _0x1d1b95(this['locale']),this['dislikeButton']['set']({'icon':_0x23728d,'label':h(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 _0x1d1b95(this['locale']),this['copyButton']['set']({'icon':_0x353d3e,'label':h(this['locale'],'AI_MINI_TOOLBAR_COPY'),'class':'ck-ai-mini-toolbar-copy-button','tooltip':!0x0}),this['copyButton']['bind']('isEnabled')['to'](this);const _0x35ddbc=new _0x152087();_0x35ddbc['set']({'content':_0xa99da}),_0x35ddbc['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'](_0x35ddbc);}['_setupShowChangesButton'](){this['showChangesButton']=new _0x1d1b95(this['locale']),this['showChangesButton']['set']({'icon':_0x44ac4f,'label':h(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',_0x68a76f=>_0x68a76f?_0x42f8e1:_0x44ac4f),this['showChangesButton']['on']('execute',()=>{this['fire']('toggleShowChanges');});}}class Q extends gs{['children'];['nextButtonView'];['previousButtonView'];['focusCycler'];['_focusables'];['_focusTracker'];['_keystrokes'];['_config'];['_streamableContentView'];['_toolbarContainerView'];['_partToolbarView'];['_stateView'];['_miniToolbarView'];constructor(_0x489f8c,_0x246075){super(_0x489f8c);const _0x447357=this['bindTemplate'];this['set']('showDiff',!0x1),this['set']('_state','pending'),this['_focusTracker']=new _0x50d771(),this['_keystrokes']=new _0x407d91(),this['_focusables']=this['createCollection'](),this['focusCycler']=new _0x18b3f0({'focusables':this['_focusables'],'focusTracker':this['_focusTracker'],'keystrokeHandler':this['_keystrokes'],'actions':{'focusPrevious':'shift\x20+\x20tab','focusNext':'tab'}}),this['_config']=_0x246075,this['nextButtonView']=this['_createNextButtonView'](),this['previousButtonView']=this['_createPreviousButtonView'](),this['_streamableContentView']=new cs(_0x489f8c),this['_partToolbarView']=new us(_0x489f8c,_0x246075['availableActions']),this['_partToolbarView']['delegate']('applySuggestion','insertSuggestion','rejectSuggestion')['to'](this),this['_togglePartToolbarButtonsVisibility'](_0x246075),this['_stateView']=new ps(_0x489f8c),this['_stateView']['isVisible']=!0x1,this['_miniToolbarView']=new ls(_0x489f8c,{'showChanges':'full'}),this['_miniToolbarView']['bind']('isShowChangesOn')['to'](this,'showDiff'),this['_miniToolbarView']['on']('toggleShowChanges',()=>{this['fire']('toggleSuggestionDisplayMode');}),this['_toolbarContainerView']=new fs(_0x489f8c,[this['_partToolbarView'],this['_stateView'],this['_miniToolbarView']]),this['children']=this['createCollection']([this['_streamableContentView'],this['_toolbarContainerView']]),this['on']('change:_state',(_0xb68871,_0x53b36d,_0x4e34ef,_0x24551f)=>{let _0x5615f5,_0x5f1b76;'pending'===_0x24551f?(_0x5615f5=this['_partToolbarView'],_0x5f1b76=this['_stateView']):(_0x5615f5=this['_stateView'],_0x5f1b76=this['_partToolbarView']),this['_stateView']['setState'](_0x4e34ef),_0x5615f5['isVisible']=!0x1,_0x5f1b76['isVisible']=!0x0;}),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat-balloon-main',_0x447357['to']('_state',_0x5e6696=>'ck-ai-chat-balloon-main_state_'+_0x5e6696)]},'children':this['children']}),this['on']('change:isTrackChangesOn',()=>{this['_togglePartToolbarButtonsVisibility'](_0x246075);});}['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'](_0x637936){_0x637936?.['keepErrors']||this['hideError'](),await this['_streamableContentView']['update'](_0x637936);}['setState'](_0x180d2c){this['_state']=_0x180d2c;}['showError'](_0x23d5b2){super['showError'](_0x23d5b2),this['children']['has'](this['_errorView'])||this['children']['add'](this['_errorView'],0x0);}['hideError'](){this['_isErrorVisible']&&(super['hideError'](),this['togglePartToolbarEnabled'](!0x0));}['showBlockingError'](_0x17f86b){super['showBlockingError'](_0x17f86b),this['togglePartToolbarEnabled'](!0x1);}['toggleRotatorButtonsVisibility'](_0x1d51f8){this['nextButtonView']['isVisible']=this['previousButtonView']['isVisible']=_0x1d51f8;}['togglePartToolbarEnabled'](_0x2c22ab){this['_partToolbarView']['isEnabled']=_0x2c22ab;}['_togglePartToolbarButtonsVisibility']({showApplyButton:_0x39bcef,showSuggestButton:_0xbbf42d}){_0x39bcef=_0x39bcef&&!this['isTrackChangesOn']&&this['_config']['availableActions']['includes']('applySuggestion'),_0xbbf42d=_0xbbf42d&&this['_config']['availableActions']['includes']('insertSuggestion'),this['_partToolbarView']['setButtonsVisibility']({'showApplyButton':_0x39bcef,'showSuggestButton':_0xbbf42d});}['_createNextButtonView'](){const _0x777ae7=new _0x1d1b95(this['locale']);return _0x777ae7['set']({'icon':_0x5ef844,'label':h(this['locale'],'AI_BALLOON_NEXT_LABEL'),'isVisible':!0x0}),_0x777ae7['on']('execute',()=>{this['fire']('showNext');}),_0x777ae7;}['_createPreviousButtonView'](){const _0x5aa7bb=new _0x1d1b95(this['locale']);return _0x5aa7bb['set']({'icon':_0x57c1ba,'label':h(this['locale'],'AI_BALLOON_PREVIOUS_LABEL'),'isVisible':!0x0}),_0x5aa7bb['on']('execute',()=>{this['fire']('showPrevious');}),_0x5aa7bb;}}class fs extends _0x1f054a{constructor(_0x219ea6,_0x1ee6e2){super(_0x219ea6),this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-balloon__toolbar-container']},'children':_0x1ee6e2});}}class qt extends _0x53f6d2{static get['requires'](){return[_0x2dc660,R];}static get['pluginName'](){return'AIChatBalloon';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['_chatBalloonView'];constructor(_0x4dfd55){super(_0x4dfd55),this['set']('showDiff',!0x1);}['open'](_0x5f4ed0){const _0x2ef75a=this['editor'];this['_chatBalloonView']||(this['_chatBalloonView']=this['_createChatBalloonView']()),_0x2ef75a['plugins']['get']('AIBalloon')['open']({..._0x5f4ed0,'id':'aiChatBalloon','class':'ck-ai-chat-balloon','mainView':this['_chatBalloonView']}),this['_toggleRotatorButtonsInDialogHeader'](_0x5f4ed0['showRotator']),this['_chatBalloonView']['togglePartToolbarEnabled'](!_0x5f4ed0['areActionsDisabled']),this['_restoreDefaultViewFocus']();}['close'](){this['editor']['plugins']['get']('AIBalloon')['close']();}['updateContent'](_0x520f1d){return this['_chatBalloonView']||(this['_chatBalloonView']=this['_createChatBalloonView']()),this['_chatBalloonView']['updateContent'](_0x520f1d);}['setState'](_0x49ef63){this['_chatBalloonView']&&this['_chatBalloonView']['setState'](_0x49ef63);}['_createChatBalloonView'](){const _0x5845f5=this['editor'],_0x2b0dc4=_0x5845f5['plugins']['get']('AIBalloon'),_0x2ab5b0=_0x5845f5['commands']['get']('trackChanges');let _0x32155b=_0x5845f5['config']['get']('ai.availableReplyActions')||[...J];_0x5845f5['plugins']['has']('TrackChanges')||(_0x32155b=_0x32155b['filter'](_0x1fac3c=>'insertSuggestion'!=_0x1fac3c));const _0x20ef26=new Q(_0x5845f5['locale'],{'availableActions':_0x32155b,'showApplyButton':!0x0,'showSuggestButton':!!_0x2ab5b0});return _0x20ef26['bind']('showDiff')['to'](this),_0x20ef26['delegate'](...W)['to'](this),_0x20ef26['delegate']('showPrevious','showNext')['to'](this),_0x2b0dc4['delegate']('dialogClosed')['to'](this),_0x20ef26['on']('applySuggestion',this['_restoreDefaultViewFocus']['bind'](this)),_0x20ef26['on']('insertSuggestion',this['_restoreDefaultViewFocus']['bind'](this)),_0x20ef26['on']('rejectSuggestion',this['_restoreDefaultViewFocus']['bind'](this)),_0x2ab5b0&&_0x20ef26['bind']('isTrackChangesOn')['to'](_0x2ab5b0,'value'),_0x20ef26['render'](),_0x20ef26;}['_toggleRotatorButtonsInDialogHeader'](_0x2bf26f){const _0x59ea6e=this['editor'],_0x30379f=_0x59ea6e['plugins']['get']('Dialog')['view']['headerView']['children'];this['_chatBalloonView']['toggleRotatorButtonsVisibility'](_0x2bf26f),_0x30379f['has'](this['_chatBalloonView']['previousButtonView'])||(_0x30379f['addMany']([this['_chatBalloonView']['previousButtonView'],this['_chatBalloonView']['nextButtonView']],0x0),_0x59ea6e['plugins']['get']('AIBalloon')['once']('beforeDialogClosed',()=>{_0x30379f['remove'](this['_chatBalloonView']['previousButtonView']),_0x30379f['remove'](this['_chatBalloonView']['nextButtonView']);}));}['_restoreDefaultViewFocus'](){this['_chatBalloonView']['focus']();}}class Ba extends _0x53f6d2{static get['requires'](){return[Pt,qt,Nt];}static get['pluginName'](){return'AIEditorIntegration';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}function Zt(_0x3ebe08){const {editor:_0x1258e1,action:_0xeb27d0,withText:_0x3d54e7=!0x1,withIcon:_0x4d5bfd=!0x0,isInDropdown:_0x6a4978=!0x0,shouldPreventFocus:_0x341ae6=!0x1}=_0x3ebe08;return()=>{const _0x7e3735=_0x1258e1['locale'],_0x5d09b0=new _0x1d1b95(_0x7e3735),_0x545c0e=_0x5d09b0['bindTemplate'];_0x6a4978&&_0x5d09b0['extendTemplate']({'on':{'mouseenter':_0x545c0e['to'](()=>{_0x341ae6&&_0x341ae6()||_0x5d09b0['focus']();})}});const _0x546a19=_0xeb27d0['icon']??_0xeb27d0['parent']?.['icon'];return _0x5d09b0['set']({'label':_0xeb27d0['displayedPrompt'],'withText':_0x3d54e7,'role':'menuitem','icon':_0x4d5bfd?_0x546a19??bt:void 0x0,'tooltip':!_0x3d54e7,'class':'ck-ai-quick-actions-button','isEnabled':_0xeb27d0['isEnabled']}),_0x5d09b0['on']('execute',()=>{_0x1258e1['editing']['view']['focus'](),_0x1258e1['commands']['execute']('aiQuickAction',_0xeb27d0);}),_0x5d09b0;};}class Gs extends _0x3abefb{['arrowView'];constructor(_0x24eef4,_0x2f9636){super(_0x24eef4,_0x2f9636);const _0x4355b2=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',_0x411a22=>String(_0x411a22)),'data-cke-tooltip-disabled':_0x4355b2['to']('isOn')},'on':{'mouseenter':_0x4355b2['to']('mouseenter')}});}['render'](){super['render'](),this['children']['add'](this['arrowView']);}['_createArrowView'](){const _0x3df051=new _0x152087();return _0x3df051['content']=_0x264f12,_0x3df051['extendTemplate']({'attributes':{'class':'ck-dropdown-menu-list__nested-menu__button__arrow'}}),_0x3df051;}}class Ks extends _0xc6bdf6{['_allListItems'];['_allSearchableItems'];constructor(_0x59f89d,_0x15a2c6,_0x41887a){super(_0x59f89d),this['_allListItems']=_0x15a2c6,this['_allSearchableItems']=_0x41887a;}['filter'](_0x131306){if(!_0x131306)return this['items']['clear'](),this['items']['addMany'](this['_allListItems']),this['_clearHighlight'](),{'resultsCount':this['_allListItems']['length'],'totalItemsCount':this['_allListItems']['length']};const _0x4e5580=_0x131306['source']['toLowerCase']()['trim'](),_0x5671e7=this['_allSearchableItems']['filter'](_0x3734c8=>(_0x3734c8['groupLabel']?_0x3734c8['label']+'\x20('+_0x3734c8['groupLabel']+')':_0x3734c8['label'])['toLowerCase']()['includes'](_0x4e5580));return this['items']['clear'](),this['items']['addMany'](_0x5671e7['sort']((_0x595fa5,_0x41b807)=>{const _0x58b995=_0x595fa5['groupLabel'],_0x1e88ef=_0x41b807['groupLabel'];return _0x58b995||_0x1e88ef?_0x58b995?0x1:-0x1:0x0;})['map'](_0x1eeb0a=>_0x1eeb0a['item'])),this['_highlightQuery'](_0x4e5580,_0x5671e7),{'resultsCount':_0x5671e7['length'],'totalItemsCount':this['_allSearchableItems']['length']};}['_highlightQuery'](_0x64af76,_0x34ef2a){if(!_0x64af76)return;const _0x5b93a7=new RegExp(_0x1afc1d(_0x64af76),'gi');_0x34ef2a['forEach'](_0x16ce1b=>{_0x16ce1b['highlightViews']&&_0x16ce1b['highlightViews']['forEach'](_0x2ccaa1=>{'function'==typeof _0x2ccaa1['highlightText']&&_0x2ccaa1['highlightText'](_0x5b93a7);});});}['_clearHighlight'](){this['_allSearchableItems']['forEach'](_0x3248fd=>{_0x3248fd['highlightViews']&&_0x3248fd['highlightViews']['forEach'](_0x4d80f5=>{'function'==typeof _0x4d80f5['highlightText']&&_0x4d80f5['highlightText'](null);});});}}const Js='menu',Ws='menuitem';class co extends _0x1f054a{['_bodyCollection'];['optionsListView'];['_searchTextView']=null;['_allSearchableItems']=[];['children'];['focusTracker'];['keystrokes'];['_focusables'];['focusCycler'];['_openNestedPanels']=new Set();['_hasSearch'];constructor(_0x312b44,_0x1d3850,_0x2d5ce4,_0x51ffaf,_0xbed93d=!0x1){const _0x19cc79=_0x312b44['locale'];super(_0x19cc79),this['_bodyCollection']=_0x51ffaf,this['_hasSearch']=_0xbed93d;const _0x139dfc=this['_createListItems'](_0x312b44,_0x1d3850,_0x2d5ce4);this['optionsListView']=new Ks(_0x19cc79,_0x139dfc,this['_allSearchableItems']),this['optionsListView']['role']=Js,this['optionsListView']['items']['addMany'](_0x139dfc),this['focusTracker']=new _0x50d771(),this['keystrokes']=new _0x407d91(),_0xbed93d&&(this['_searchTextView']=this['_createSearchTextView']()),this['_focusables']=_0x139dfc,this['focusCycler']=new _0x18b3f0({'focusables':this['_focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes']}),_0xbed93d&&this['_searchTextView']&&this['focusCycler']['chain'](this['_searchTextView']['focusCycler']);const _0x14979d=_0xbed93d&&this['_searchTextView']?[this['_searchTextView']]:[this['optionsListView']];this['children']=new _0x44a698(_0x14979d),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-ai-quick-actions','ck-rounded-corners'],'dir':_0x19cc79['uiLanguageDirection']},'children':this['children']});}['_createSearchTextView'](){return new _0x1877d1(this['locale'],{'filteredView':this['optionsListView'],'queryView':{'label':h(this['locale'],'AI_QUICK_ACTIONS_SEARCH')},'class':'ck-ai-quick-actions-search','infoView':{'text':{'notFound':{'primary':h(this['locale'],'AI_QUICK_ACTIONS_SEARCH_NOT_FOUND')}}}});}['_isSearchFocused'](){if(!this['_hasSearch']||!this['_searchTextView']||!this['_searchTextView']['queryView']['fieldView']['element'])return!0x1;const _0xa7af51=this['_searchTextView']['queryView']['fieldView']['element']['ownerDocument']?.['activeElement'];return this['_searchTextView']['queryView']['fieldView']['element']['contains'](_0xa7af51);}['_createListItems'](_0x49d298,_0x5e1eed,_0x1c09e1){const _0x10d096=new _0x44a698();return _0x5e1eed['forEach'](_0x106fe5=>{if('actions'in _0x106fe5){const {listItem:_0x17cc7c}=this['_createActionGroupButton'](_0x49d298,_0x106fe5,_0x1c09e1);_0x10d096['add'](_0x17cc7c),_0x106fe5['actions']['forEach'](_0x532843=>{this['_createActionButton'](_0x49d298,_0x532843,_0x106fe5['label'],_0x106fe5['icon']);const {listItem:_0x546b2a,highlightViews:_0x4614ce}=this['_createSearchResultActionButton'](_0x49d298,_0x532843,_0x106fe5['label'],_0x106fe5['icon']);this['_allSearchableItems']['push']({'item':_0x546b2a,'label':_0x532843['displayedPrompt'],'groupLabel':_0x106fe5['label'],'highlightViews':_0x4614ce});});}else{const {listItem:_0x7b3d33}=this['_createActionButton'](_0x49d298,_0x106fe5);_0x10d096['add'](_0x7b3d33);const _0x11a74a=_0x7b3d33['children']['first'];if(_0x11a74a){const {listItem:_0x8b91cc,highlightViews:_0x4c34ee}=this['_createSearchResultActionButton'](_0x49d298,_0x106fe5);this['_allSearchableItems']['push']({'item':_0x8b91cc,'label':_0x11a74a['label']||'','highlightViews':_0x4c34ee});}}}),_0x10d096;}['_createActionButton'](_0x5c9b25,_0x538e69,_0xe01934,_0xfff2ff){const _0x2ff26a=new _0x2a0bb9(this['locale']);if(_0xe01934&&_0xfff2ff){const _0x10b254=new _0x1d1b95(this['locale']),_0x1e8d9c=_0x10b254['bindTemplate'],_0x194287=new _0x5ecd8f();_0x194287['text']=_0x538e69['displayedPrompt'];const _0x5226a1=new _0x5ecd8f();_0x5226a1['text']=_0xe01934;const _0x1de67e=new _0x152087();_0x1de67e['content']=_0xfff2ff,_0x1de67e['extendTemplate']({'attributes':{'class':'ck-ai-quick-actions-button__group-icon'}});const _0x248428=new _0x1f054a(this['locale']);_0x248428['setTemplate']({'tag':'span','attributes':{'class':'ck-ai-quick-actions-button_with-group__open-paren'},'children':[{'text':'\x20('}]});const _0x1fe6fb=new _0x1f054a(this['locale']);return _0x1fe6fb['setTemplate']({'tag':'span','attributes':{'class':'ck-ai-quick-actions-button_with-group__close-paren'},'children':[{'text':')'}]}),_0x10b254['set']({'label':_0x538e69['displayedPrompt']+'\x20('+_0xe01934+')','withText':!0x0,'role':'menuitem','class':'ck-ai-quick-actions-button\x20ck-ai-quick-actions-button_with-group','tooltip':!0x1}),_0x10b254['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':[_0x194287,_0x248428,_0x1de67e,_0x5226a1,_0x1fe6fb],'on':{'mouseenter':_0x1e8d9c['to'](()=>{this['_isSearchFocused']()||_0x10b254['focus']();}),'click':_0x1e8d9c['to'](()=>{_0x10b254['fire']('execute');})}}),_0x10b254['on']('execute',()=>{_0x5c9b25['editing']['view']['focus'](),_0x5c9b25['commands']['execute']('aiQuickAction',_0x538e69);}),_0x2ff26a['children']['add'](_0x10b254),{'listItem':_0x2ff26a,'highlightViews':[_0x194287,_0x5226a1]};}{const _0xb0fd9b=new _0x5707f9(),_0xaeab64=new _0x1d1b95(this['locale'],_0xb0fd9b),_0x41110a=_0xaeab64['bindTemplate'],_0x416adf=_0x538e69['icon']??_0x538e69['parent']?.['icon'],_0x1443da=void 0x0!==_0x538e69['icon'];return _0xaeab64['set']({'label':_0x538e69['displayedPrompt'],'withText':!0x0,'role':'menuitem','icon':_0x1443da?_0x416adf??bt:void 0x0,'tooltip':!0x1,'class':'ck-ai-quick-actions-button'}),_0xaeab64['extendTemplate']({'on':{'mouseenter':_0x41110a['to'](()=>{this['_isSearchFocused']()||_0xaeab64['focus']();})}}),_0xaeab64['on']('execute',()=>{_0x5c9b25['editing']['view']['focus'](),_0x5c9b25['commands']['execute']('aiQuickAction',_0x538e69);}),_0x2ff26a['children']['add'](_0xaeab64),{'listItem':_0x2ff26a,'highlightViews':[_0xb0fd9b]};}}['_createSearchResultActionButton'](_0x44c73f,_0x4600bd,_0x155411,_0x2f4a56){return _0x155411&&_0x2f4a56?this['_createSearchResultGroupedActionButton'](_0x44c73f,_0x4600bd,_0x155411,_0x2f4a56):this['_createSearchResultIndividualActionButton'](_0x44c73f,_0x4600bd);}['_createSearchResultGroupedActionButton'](_0x49146a,_0x229d9a,_0x4c4002,_0xff5347){const _0x5cca6a=new _0x2a0bb9(this['locale']),_0x3fc44e=new _0x1d1b95(this['locale']),_0x20e28b=_0x3fc44e['bindTemplate'],{view:_0x229b4e,highlightView:_0x46ad61}=this['_createSearchResultGroupRow'](_0x4c4002,_0xff5347),{view:_0x2995d0,highlightView:_0x529212}=this['_createSearchResultActionRow'](_0x229d9a['displayedPrompt']),_0x43f52f=this['_createSearchResultContentView'](_0x229b4e,_0x2995d0);return _0x3fc44e['set']({'label':_0x229d9a['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}),_0x3fc44e['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':[_0x43f52f],'on':{'mouseenter':_0x20e28b['to'](()=>{this['_isSearchFocused']()||_0x3fc44e['focus']();}),'click':_0x20e28b['to'](()=>{this['_handleSearchResultButtonClick'](_0x3fc44e);})}}),this['_setupActionButtonExecution'](_0x3fc44e,_0x49146a,_0x229d9a),_0x5cca6a['children']['add'](_0x3fc44e),{'listItem':_0x5cca6a,'highlightViews':[_0x46ad61,_0x529212]};}['_createSearchResultIndividualActionButton'](_0x3479ec,_0x545c98){const _0x3bf42f=new _0x2a0bb9(this['locale']),_0x2e1448=new _0x5707f9(),_0x39b339=new _0x1d1b95(this['locale'],_0x2e1448),_0x1b5c15=_0x39b339['bindTemplate'];return _0x39b339['set']({'label':_0x545c98['displayedPrompt'],'withText':!0x0,'role':'menuitem','icon':void 0x0,'tooltip':!0x1,'class':'ck-ai-quick-actions-button\x20ck-ai-quick-actions-search-result-button'}),_0x39b339['extendTemplate']({'on':{'mouseenter':_0x1b5c15['to'](()=>{this['_isSearchFocused']()||_0x39b339['focus']();})}}),this['_setupActionButtonExecution'](_0x39b339,_0x3479ec,_0x545c98),_0x3bf42f['children']['add'](_0x39b339),{'listItem':_0x3bf42f,'highlightViews':[_0x2e1448]};}['_createSearchResultGroupRow'](_0x55edc8,_0x41d601){const _0x2c2329=new _0x1f054a(this['locale']),_0xcd8d22=new _0x152087();_0xcd8d22['content']=_0x41d601,_0xcd8d22['extendTemplate']({'attributes':{'class':'ck-ai-quick-actions-button__group-icon'}});const _0xb19caf=new _0x5ecd8f();return _0xb19caf['text']=_0x55edc8,_0x2c2329['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-quick-actions-search-result__group-row'},'children':[_0xcd8d22,_0xb19caf]}),{'view':_0x2c2329,'highlightView':_0xb19caf};}['_createSearchResultActionRow'](_0x42f648){const _0x151116=new _0x1f054a(this['locale']),_0xde0a51=new _0x5ecd8f();return _0xde0a51['text']=_0x42f648,_0x151116['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-quick-actions-search-result__action-row'},'children':[_0xde0a51]}),{'view':_0x151116,'highlightView':_0xde0a51};}['_createSearchResultContentView'](_0x26a990,_0x416f45){const _0x453a15=new _0x1f054a(this['locale']);return _0x453a15['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-quick-actions-search-result__content'},'children':[_0x26a990,_0x416f45]}),_0x453a15;}['_setupActionButtonExecution'](_0x89e3b,_0x56590b,_0x54fe98){_0x89e3b['on']('execute',()=>{_0x56590b['editing']['view']['focus'](),_0x56590b['commands']['execute']('aiQuickAction',_0x54fe98);});}['_createActionGroupButton'](_0xc277b4,_0x408b16,_0x2dc7a8){const _0x280915=new _0x2a0bb9(this['locale']),_0x324f87=new _0x5707f9(),_0x447c5d=new Gs(this['locale'],_0x324f87),_0x5cca98=_0x447c5d['bindTemplate'],_0x2a8ee3=this['_getPanelKeystroke'](_0x2dc7a8),_0x3bcc3f=this['_createGroupActionsList'](_0xc277b4,_0x408b16['actions'],_0x2dc7a8);_0x447c5d['set']({'label':_0x408b16['label'],'withText':!0x0,'role':Ws,'icon':_0x408b16['icon']??bt,'isEnabled':_0x408b16['actions']['some'](_0x3031ba=>_0x3031ba['isEnabled'])}),_0x447c5d['extendTemplate']({'on':{'mouseenter':_0x5cca98['to'](()=>{this['_isSearchFocused']()||_0x447c5d['focus']();})}});const _0x1f6701=new _0x10e1b3(this['locale']);return _0x1f6701['extendTemplate']({'attributes':{'class':['ck','ck-reset_all','ck-ai-quick-actions-group-panel','ck-dropdown-menu__nested-menu__panel']},'on':{'keydown':_0x5cca98['to'](_0x40683d=>{this['_handlePanelKeydown'](_0x40683d,_0x2a8ee3,_0x447c5d,_0x1f6701);})}}),_0x447c5d['bind']('isOn')['to'](_0x1f6701,'isVisible'),this['_bodyCollection']['add'](_0x1f6701),_0x1f6701['content']['add'](_0x3bcc3f),this['_setupGroupMenuBehavior'](_0x447c5d,_0x1f6701),_0x280915['children']['add'](_0x447c5d),{'listItem':_0x280915,'highlightView':_0x324f87};}['_createGroupActionsList'](_0x41a4d2,_0x1d1319,_0x3dd946){const _0x460001=new _0xc6bdf6(this['locale']);return _0x460001['extendTemplate']({'attributes':{'class':['ck','ck-reset_all','ck-ai-quick-actions-group-list','ck-dropdown-menu-list']}}),_0x1d1319['forEach'](_0x2d51f8=>{const _0x5480c7=new _0x2a0bb9(this['locale']),_0x1cd404=Zt({'editor':_0x41a4d2,'action':_0x2d51f8,'withText':!0x0,'withIcon':!0x1,'isInDropdown':!0x0,'shouldPreventFocus':()=>this['_isSearchFocused']()})();_0x5480c7['children']['add'](_0x1cd404),_0x3dd946['focusTracker']['add'](_0x1cd404),_0x460001['items']['add'](_0x5480c7);}),_0x460001;}['_setupGroupMenuBehavior'](_0x245113,_0x1ae2d1){const _0x4a45fe=_0x245113['bindTemplate'],_0x541e83=this['_getButtonKeystroke'](_0x245113);_0x245113['extendTemplate']({'attributes':{'class':['ck-ai-quick-actions-group-button']},'on':{'mouseenter':_0x4a45fe['to'](()=>{this['_showNestedPanel'](_0x1ae2d1,_0x245113);}),'mouseleave':_0x4a45fe['to'](_0x7096f=>{const _0x310e4d=_0x7096f['relatedTarget'];this['_isMovingToNestedMenu'](_0x310e4d,_0x1ae2d1)||this['_hideNestedPanel'](_0x1ae2d1);}),'keydown':_0x4a45fe['to'](_0x148f2d=>{_0x148f2d['key']==_0x541e83&&(this['_showNestedPanel'](_0x1ae2d1,_0x245113),_0x1ae2d1['content']['get'](0x0)['focus']());})}}),_0x1ae2d1['on']('render',()=>{_0x1ae2d1['element']?.['addEventListener']('mouseleave',_0x3d5e94=>{const _0x4b100c=_0x3d5e94['relatedTarget'];_0x245113['element']?.['contains'](_0x4b100c)||this['_isMovingToNestedMenu'](_0x4b100c,_0x1ae2d1)||this['_hideNestedPanel'](_0x1ae2d1);});});}['_showNestedPanel'](_0x49e90e,_0x4b4981){this['_openNestedPanels']['forEach'](_0x3cfd7e=>{_0x3cfd7e!==_0x49e90e&&_0x3cfd7e['isVisible']&&_0x3cfd7e['hide']();}),_0x49e90e['show'](),_0x49e90e['pin']({'positions':[_0x7bd7ce['eastSouth']],'target':_0x4b4981['element'],'fitInViewport':!0x0}),this['_openNestedPanels']['add'](_0x49e90e);}['_hideNestedPanel'](_0x4c3b2e){_0x4c3b2e['hide'](),this['_openNestedPanels']['delete'](_0x4c3b2e);}['_hideAllNestedPanels'](){this['_openNestedPanels']['forEach'](_0x514eac=>_0x514eac['hide']()),this['_openNestedPanels']['clear']();}['_isMovingToNestedMenu'](_0xaad68d,_0x3a800f){if(!_0xaad68d)return!0x1;if(_0x3a800f['element']?.['contains'](_0xaad68d))return!0x0;const _0x8a5e5=_0xaad68d;return _0x8a5e5['closest']&&(null!==_0x8a5e5['closest']('.ck-ai-quick-actions-group-panel')||null!==_0x8a5e5['closest']('.ck-ai-quick-actions-group-list')||null!==_0x8a5e5['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'](_0x5a3803){return'rtl'===_0x5a3803['locale']['uiLanguageDirection']?'ArrowRight':'ArrowLeft';}['_getButtonKeystroke'](_0x454cfe){return'rtl'===_0x454cfe['locale']['uiLanguageDirection']?'ArrowLeft':'ArrowRight';}['_handlePanelKeydown'](_0x3b527c,_0x28e17f,_0x21312c,_0x31f8d7){_0x3b527c['key']==_0x28e17f&&(_0x21312c['focus'](),this['_hideNestedPanel'](_0x31f8d7));}['_handleSearchResultButtonClick'](_0x3a2499){_0x3a2499['fire']('execute');}}function Xt(_0x585f4a){const {editor:_0x1d0419,content:_0x38ac1b,buttonDefinition:_0x1b6894,bodyCollection:_0x5e01f4,hasSearch:_0x5abf2c=!0x1}=_0x585f4a;return()=>{const _0x50ac3a=_0x1d0419['locale'],_0xcbcdc8=_0x290605(_0x50ac3a);_0xcbcdc8['buttonView']['set']({'icon':_0x1b6894['icon']??bt,'label':_0x1b6894['label'],'tooltip':!0x0}),_0xcbcdc8['set']({'class':'ck-ai-quick-actions-dropdown'});const _0x52ef04=new co(_0x1d0419,_0x38ac1b,_0xcbcdc8,_0x5e01f4,_0x5abf2c);if(_0xcbcdc8['panelView']['children']['add'](_0x52ef04),_0x5abf2c){const _0x357722='ai-quick-actions-dropdown-selection';_0xcbcdc8['on']('change:isOpen',(_0x64407f,_0x5aa267,_0x5cc555)=>{if(_0x5cc555){if(_0x1d0419['plugins']['has']('AIEditing')){const _0x12176a=_0x1d0419['plugins']['get'](s),_0x4e08a1=_0x1d0419['model']['document']['selection'],_0x558286=Array['from'](_0x4e08a1['getRanges']());_0x558286['length']>0x0&&_0x12176a['showFakeVisualSelection'](_0x558286,_0x357722,!0x1,!0x0);}}else _0x1d0419['plugins']['has']('AIEditing')&&_0x1d0419['plugins']['get'](s)['hideFakeVisualSelection'](_0x357722),_0x52ef04['resetSearch']();});}return _0xcbcdc8;};}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(_0x45afe8){return _0x45afe8['CHAT']='CHAT',_0x45afe8['ACTION']='ACTION',_0x45afe8['REVIEW']='REVIEW',_0x45afe8;}({}),Ga=function(_0x527cf6){return _0x527cf6['CHAT']='AIChat',_0x527cf6['ACTION']='AIActions',_0x527cf6['REVIEW']='AIReviewMode',_0x527cf6;}({});class ii extends _0x53f6d2{static get['requires'](){return[te,tt];}static get['pluginName'](){return'AIQuickActionsUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}async['init'](){const _0x79027b=await this['_getDefaultAndCustomActions']();this['_prepareQuickActionsDefinition'](_0x79027b),this['_initializeQuickActionsComponentsAndCommands']();}static['getDefaultQuickActions'](_0x35c904){return function(_0x278232){const _0x42d96e=new Intl['DisplayNames'](['en'],{'type':'language'})['of'](_0x278232['uiLanguage']),_0x4e8aab=_0x42d96e||'English',_0x4856d8=[{'id':'ask-ai','displayedPrompt':h(_0x278232,'AI_QUICK_ACTIONS_ASK_AI'),'type':'CHAT','icon':Gt},{'id':'chat-commands','label':h(_0x278232,'AI_QUICK_ACTIONS_CHAT_COMMANDS'),'icon':Gt,'actions':[{'id':'explain','displayedPrompt':h(_0x278232,'AI_QUICK_ACTIONS_EXPLAIN'),'prompt':ee['replace']('%0',_0x4e8aab),'type':'CHAT'},{'id':'summarize','displayedPrompt':h(_0x278232,'AI_QUICK_ACTIONS_SUMMARIZE'),'prompt':ie['replace']('%0',_0x4e8aab),'type':'CHAT'},{'id':'highlight-key-points','displayedPrompt':h(_0x278232,'AI_QUICK_ACTIONS_HIGHLIGHT_KEY_POINTS'),'prompt':ne['replace']('%0',_0x4e8aab),'type':'CHAT'}]},{'id':'improve-writing','displayedPrompt':h(_0x278232,'AI_QUICK_ACTIONS_IMPROVE_WRITING'),'type':'ACTION','icon':Wt},{'id':'continue','displayedPrompt':h(_0x278232,'AI_QUICK_ACTIONS_CONTINUE_WRITING'),'type':'ACTION','icon':zt},{'id':'fix-grammar','displayedPrompt':h(_0x278232,'AI_QUICK_ACTIONS_FIX_GRAMMAR_SPELLING'),'type':'ACTION','icon':Ft},{'id':'adjust-length','label':h(_0x278232,'AI_QUICK_ACTIONS_ADJUST_LENGTH'),'icon':Kt,'actions':[{'id':'make-shorter','displayedPrompt':h(_0x278232,'AI_QUICK_ACTIONS_MAKE_SHORTER'),'type':'ACTION'},{'id':'make-longer','displayedPrompt':h(_0x278232,'AI_QUICK_ACTIONS_MAKE_LONGER'),'type':'ACTION'}]},{'id':'change-tone','label':h(_0x278232,'AI_QUICK_ACTIONS_CHANGE_TONE'),'icon':Yt,'actions':[{'id':'make-tone-casual','displayedPrompt':h(_0x278232,'AI_QUICK_ACTIONS_MORE_CASUAL'),'type':'ACTION'},{'id':'make-tone-direct','displayedPrompt':h(_0x278232,'AI_QUICK_ACTIONS_MORE_DIRECT'),'type':'ACTION'},{'id':'make-tone-friendly','displayedPrompt':h(_0x278232,'AI_QUICK_ACTIONS_MORE_FRIENDLY'),'type':'ACTION'},{'id':'make-tone-confident','displayedPrompt':h(_0x278232,'AI_QUICK_ACTIONS_MORE_CONFIDENT'),'type':'ACTION'},{'id':'make-tone-professional','displayedPrompt':h(_0x278232,'AI_QUICK_ACTIONS_MORE_PROFESSIONAL'),'type':'ACTION'}]},{'id':'translate','label':h(_0x278232,'AI_QUICK_ACTIONS_TRANSLATE'),'icon':Vt,'actions':[{'id':'translate-to-english','displayedPrompt':h(_0x278232,'AI_QUICK_ACTIONS_TRANSLATE_ENGLISH'),'type':'ACTION','actionName':'translate','args':{'language':'english'}},{'id':'translate-to-chinese','displayedPrompt':h(_0x278232,'AI_QUICK_ACTIONS_TRANSLATE_CHINESE'),'type':'ACTION','actionName':'translate','args':{'language':'chinese'}},{'id':'translate-to-spanish','displayedPrompt':h(_0x278232,'AI_QUICK_ACTIONS_TRANSLATE_SPANISH'),'type':'ACTION','actionName':'translate','args':{'language':'spanish'}},{'id':'translate-to-german','displayedPrompt':h(_0x278232,'AI_QUICK_ACTIONS_TRANSLATE_GERMAN'),'type':'ACTION','actionName':'translate','args':{'language':'german'}},{'id':'translate-to-french','displayedPrompt':h(_0x278232,'AI_QUICK_ACTIONS_TRANSLATE_FRENCH'),'type':'ACTION','actionName':'translate','args':{'language':'french'}},{'id':'translate-to-japanese','displayedPrompt':h(_0x278232,'AI_QUICK_ACTIONS_TRANSLATE_JAPANESE'),'type':'ACTION','actionName':'translate','args':{'language':'japanese'}},{'id':'translate-to-portuguese','displayedPrompt':h(_0x278232,'AI_QUICK_ACTIONS_TRANSLATE_PORTUGUESE'),'type':'ACTION','actionName':'translate','args':{'language':'portuguese'}},{'id':'translate-to-korean','displayedPrompt':h(_0x278232,'AI_QUICK_ACTIONS_TRANSLATE_KOREAN'),'type':'ACTION','actionName':'translate','args':{'language':'korean'}},{'id':'translate-to-italian','displayedPrompt':h(_0x278232,'AI_QUICK_ACTIONS_TRANSLATE_ITALIAN'),'type':'ACTION','actionName':'translate','args':{'language':'italian'}},{'id':'translate-to-russian','displayedPrompt':h(_0x278232,'AI_QUICK_ACTIONS_TRANSLATE_RUSSIAN'),'type':'ACTION','actionName':'translate','args':{'language':'russian'}}]},{'id':'other','label':h(_0x278232,'AI_QUICK_ACTIONS_OTHER'),'icon':Jt,'actions':[]}];return _0x4856d8;}(_0x35c904);}async['_getDefaultAndCustomActions'](){const _0x1e2a82=ii['getDefaultQuickActions'](this['editor']['locale']),_0x482be2=this['editor']['config']['get']('ai.quickActions.extraCommands')||[];let _0x21a7fb=[];try{_0x21a7fb=await new et({'connector':this['editor']['plugins']['get']('AIConnector'),'locale':this['editor']['locale']})['getAll']();}catch(_0x410ae1){const _0x3c25d9=new _0x25c351('ai-quick-actions-models-unable-to-retrieve',this,{'error':_0x410ae1});_0x2d18bd(_0x3c25d9['message']);}finally{const _0x42b4c8=_0x482be2['map'](_0xeff9cc=>({..._0xeff9cc,'icon':void 0x0}));_0x1e2a82['find'](_0x67d305=>'other'===_0x67d305['id'])['actions']['push'](..._0x42b4c8),_0x1e2a82['forEach'](_0xb14389=>{if('actions'in _0xb14389)_0xb14389['actions']['forEach'](_0x4ebeeb=>{if(_0x4ebeeb['isEnabled']=!!_0x21a7fb['find'](_0x2a86fa=>_0x2a86fa['id']===_0x4ebeeb['model'])||void 0x0===_0x4ebeeb['model'],!_0x4ebeeb['isEnabled']){const _0xdf8c46=new _0x25c351('ai-quick-actions-unavailable-model',this,{'actionId':_0x4ebeeb['id'],'modelId':_0x4ebeeb['model']});_0x2d18bd(_0xdf8c46['message']);}});else{if(_0xb14389['isEnabled']=!!_0x21a7fb['find'](_0x1a62a1=>_0x1a62a1['id']===_0xb14389['model'])||void 0x0===_0xb14389['model'],!_0xb14389['isEnabled']){const _0x2a3a6b=new _0x25c351('ai-quick-actions-unavailable-model',this,{'actionId':_0xb14389['id'],'modelId':_0xb14389['model']});_0x2d18bd(_0x2a3a6b['message']);}}});}return _0x1e2a82;}['_initializeQuickActionsComponentsAndCommands'](){const _0x4d7152=new _0x1c4f1c(this['editor']['locale']);_0x4d7152['attachToDom'](),this['_initializeQuickActionsDropdown'](_0x4d7152),this['_initializeQuickActionsMenuBar'](),this['_initializeQuickActionsComponents'](_0x4d7152);}['_initializeQuickActionsDropdown'](_0x471d69){const _0x1563f2=this['editor']['config']['get']('ai.quickActions.isSearchEnabled')??!0x0;this['editor']['ui']['componentFactory']['add']('aiQuickActions',Xt({'editor':this['editor'],'content':this['_quickActionsDefinition'],'buttonDefinition':{'icon':bt,'label':h(this['editor']['locale'],'AI_QUICK_ACTIONS_HEADING')},'bodyCollection':_0x471d69,'hasSearch':_0x1563f2}));}['_prepareQuickActionsDefinition'](_0x1c05c5){this['_quickActionsDefinition']=_0x1c05c5['map'](_0x3f2ae2=>{if('actions'in _0x3f2ae2){const _0x48bb3e=_0x3f2ae2;return{..._0x48bb3e,'actions':_0x48bb3e['actions']['map'](_0x230cec=>{const {actions:_0x25e268,..._0x4810c4}=_0x48bb3e;return{..._0x230cec,'parent':_0x4810c4};})['filter'](_0x166eb0=>this['_shouldIncludeAction'](_0x166eb0))};}return _0x3f2ae2;})['filter'](_0x33b5d1=>'actions'in _0x33b5d1?_0x33b5d1['actions']['length']>0x0:this['_shouldIncludeAction'](_0x33b5d1));}['_shouldIncludeAction'](_0x5e4bd5){const _0x394419=this['editor']['config']['get']('ai.quickActions.removeCommands')||[];return this['editor']['plugins']['has'](Ga[_0x5e4bd5['type']])&&!_0x394419['includes'](_0x5e4bd5['id'])&&!('CHAT'===_0x5e4bd5['type']&&!0x1===this['editor']['config']['get']('ai.chat.context.document.enabled'));}['_initializeQuickActionsComponents'](_0x364e7d){this['_quickActionsDefinition']['forEach'](_0x35b710=>{if('actions'in _0x35b710){const _0x59ee0f=Xt({'editor':this['editor'],'content':_0x35b710['actions'],'buttonDefinition':_0x35b710,'bodyCollection':_0x364e7d});this['editor']['ui']['componentFactory']['add'](_0x35b710['id'],_0x59ee0f),_0x35b710['actions']['forEach'](_0x281c19=>{const _0x43dbb0=Zt({'editor':this['editor'],'action':_0x281c19});this['editor']['ui']['componentFactory']['add'](_0x281c19['id'],_0x43dbb0);});}else{const _0x164002=Zt({'editor':this['editor'],'action':_0x35b710,'withText':!0x1,'withIcon':!0x0,'isInDropdown':!0x1});this['editor']['ui']['componentFactory']['add'](_0x35b710['id'],_0x164002);}});}['_initializeQuickActionsMenuBar'](){this['editor']['ui']['componentFactory']['add']('menuBar:aiQuickActions',_0x3dd241=>{const _0x363f25=new _0x36bad0(_0x3dd241),_0x167c28=h(_0x3dd241,'AI_QUICK_ACTIONS_HEADING');_0x363f25['buttonView']['set']({'label':_0x167c28,'icon':bt});const _0x3f2318=new _0x1388e9(_0x3dd241);_0x3f2318['set']({'ariaLabel':_0x167c28,'role':'menu'}),this['_quickActionsDefinition']['forEach'](_0x5ea56d=>{if('actions'in _0x5ea56d){const _0x5ce784=_0x5ea56d,_0x11769b=new _0x134620(_0x3dd241,_0x363f25),_0x5e9f65=new _0x36bad0(_0x3dd241),_0x265aa2=new _0x1388e9(_0x3dd241);_0x5e9f65['buttonView']['set']({'label':_0x5ce784['label'],'icon':_0x5ce784['icon']}),_0x5ce784['actions']['forEach'](_0x3a299d=>{const _0x498cd8=new _0x134620(_0x3dd241,_0x5e9f65),_0x22ec4c=new _0x229d28(_0x3dd241);_0x22ec4c['set']({'label':_0x3a299d['displayedPrompt'],'icon':_0x3a299d['icon'],'role':'menuitem','isEnabled':_0x3a299d['isEnabled']}),_0x22ec4c['on']('execute',()=>{this['_executeQuickAction'](_0x3a299d);}),_0x22ec4c['delegate']('execute')['to'](_0x5e9f65),_0x498cd8['children']['add'](_0x22ec4c),_0x265aa2['items']['add'](_0x498cd8);}),_0x5e9f65['panelView']['children']['add'](_0x265aa2),_0x11769b['children']['add'](_0x5e9f65),_0x3f2318['items']['add'](_0x11769b);}else{const _0x5524cc=_0x5ea56d,_0x6ca2c6=new _0x134620(_0x3dd241,_0x363f25),_0x41542f=new _0x229d28(_0x3dd241);_0x41542f['set']({'label':_0x5524cc['displayedPrompt'],'icon':_0x5524cc['icon'],'role':'menuitem','isEnabled':_0x5524cc['isEnabled']}),_0x41542f['on']('execute',()=>{this['_executeQuickAction'](_0x5524cc);}),_0x41542f['delegate']('execute')['to'](_0x363f25),_0x6ca2c6['children']['add'](_0x41542f),_0x3f2318['items']['add'](_0x6ca2c6);}});const _0x586ba9=Object['values'](Ga)['some'](_0x52ab51=>this['editor']['plugins']['has'](_0x52ab51));return _0x363f25['set']({'isEnabled':_0x586ba9}),_0x363f25['panelView']['children']['add'](_0x3f2318),_0x363f25;});}['_executeQuickAction'](_0x195929){const _0x45c97d=this['editor'];_0x45c97d['editing']['view']['focus'](),_0x45c97d['commands']['execute']('aiQuickAction',_0x195929);const _0x386b8c=_0x45c97d['ui']['view']['menuBarView'];_0x386b8c&&_0x386b8c['close']&&_0x386b8c['close']();}}class ci extends Lt{['execute'](_0x3b680a){switch(this['_expandSelectionIfCollapsed'](),_0x3b680a['type']){case Qt['CHAT']:if(!this['editor']['plugins']['has']('AIChat')){const _0x5424e0=h(this['editor']['locale'],'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND','AIChat');throw new _0x25c351('ai-quick-actions-plugin-not-found',this['editor'],{'errorMessage':_0x5424e0});}this['_handleAIChatAction'](_0x3b680a);break;case Qt['ACTION']:if(!this['editor']['plugins']['has']('AIActions')){const _0x2f8ad4=h(this['editor']['locale'],'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND','AIActions');throw new _0x25c351('ai-quick-actions-plugin-not-found',this['editor'],{'errorMessage':_0x2f8ad4});}this['_handleAIActionsAction'](_0x3b680a);break;case Qt['REVIEW']:if(!this['editor']['plugins']['has']('AIReviewMode')){const _0x306a44=h(this['editor']['locale'],'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND','AIReviewMode');throw new _0x25c351('ai-quick-actions-plugin-not-found',this['editor'],{'errorMessage':_0x306a44});}this['_handleAIReviewAction'](_0x3b680a);}}async['_handleAIChatAction'](_0x3b47a){const _0x3013d0=this['editor']['plugins']['get']('AIChat'),_0x424f65=this['editor']['plugins']['get']('AIChatController'),_0x1c1261=this['editor']['plugins']['get']('AITabs')['view'];if(_0x1c1261['isVisible']||(_0x1c1261['isVisible']=!0x0),'chat'!==_0x1c1261['activeTab']&&_0x1c1261['activateTab']('chat'),'ask-ai'===_0x3b47a['id'])_0x424f65['removeSelectionFromChatContext'](),await _0x3013d0['addSelectionToChatContext'](),_0x3013d0['focusPromptInput']();else await _0x3013d0['startConversation'](),_0x424f65['removeSelectionFromChatContext'](),await _0x3013d0['addSelectionToChatContext'](),_0x3013d0['focusPromptInput'](),await _0x3013d0['sendMessage']({'message':_0x3b47a['prompt']||_0x3b47a['displayedPrompt'],'attributes':{'quickActionData':{'id':_0x3b47a['id']},'displayedPrompt':_0x3b47a['displayedPrompt']}});}['_expandSelectionIfCollapsed'](){const _0x2f3301=this['editor'],_0x356d05=_0x2f3301['model']['document']['selection'];if(!_0x356d05['isCollapsed'])return;const _0x13528c=_0x22aa77(_0x356d05['getSelectedBlocks']())||_0x2f3301['model']['schema']['getLimitElement'](_0x356d05);_0x2f3301['model']['change'](_0x49498b=>{_0x49498b['setSelection'](_0x13528c,'in');});}['_handleAIActionsActionLabel'](_0x448cc1){return _0x448cc1['parent']?.['label']&&'other'!==_0x448cc1['parent']?.['id']?_0x448cc1['parent']['label']+':\x20'+_0x448cc1['displayedPrompt']:_0x448cc1['displayedPrompt'];}async['_handleAIActionsAction'](_0x25a067){const _0x5a686c=this['editor']['plugins']['get']('AIActions'),_0x2432d1=_0x25a067['prompt']?{'userMessage':_0x25a067['prompt'],'model':_0x25a067['model']}:{'actionName':_0x25a067['actionName']||_0x25a067['id'],'args':_0x25a067['args']},_0x34c788=this['_handleAIActionsActionLabel'](_0x25a067);await _0x5a686c['executeAction'](_0x2432d1,_0x34c788,_0x25a067['icon']);}async['_handleAIReviewAction'](_0x10abd4){console['log']('handleAIReviewAction',_0x10abd4);}}class ti extends _0x53f6d2{static get['pluginName'](){return'AIQuickActionsEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x2e1227=this['editor'],_0x50ef21=new ci(this['editor']);if(_0x2e1227['commands']['add']('aiQuickAction',_0x50ef21),_0x2e1227['plugins']['has']('AIChat')){const _0x378133=this['editor']['plugins']['get']('AIChat');_0x2e1227['model']['document']['selection']['on']('change:range',(_0x54c1ab,_0x106583)=>{_0x106583['directChange']&&_0x378133['removeSelectionFromChatContext']();});}}}class ys extends xi{['updateChangeGroups'](){if(this['parsedMergedContent']=this['parsedContent']['cloneNode'](!0x0),0x0==this['parsedMergedContent']['childNodes']['length'])return void(this['changeGroups']=[]);const _0x35b202=this['documentContextContent']['children']['map'](_0x45de7d=>({'node':_0x45de7d,'id':ut(_0x45de7d,'data-id')})),_0x5ecb46=this['parsedMergedContent']['children']['map'](_0x25fc42=>({'node':_0x25fc42,'id':ut(_0x25fc42,'data-id')||_0x677d44()})),_0xd051d5=_0x36b77a(_0x35b202,_0x5ecb46,{'comparator':(_0x1b76e1,_0x33f416)=>_0x1b76e1['id']==_0x33f416['id'],'oneChangePerToken':!0x0});if(!this['isDone']){for(;_0xd051d5['length']&&_0xd051d5[_0xd051d5['length']-0x1]['removed'];)_0xd051d5['pop']();}const _0x5099df=_0xd051d5['map'](_0xc4afdc=>{const _0x5b033f=_0xc4afdc['added']?'new':_0xc4afdc['removed']?'removed':'modified';return{'node':_0xc4afdc['value'][0x0]['node'],'type':_0x5b033f,'id':_0xc4afdc['value'][0x0]['id']};});this['changeGroups']=[{'changes':_0x5099df,'state':'pending','index':0x0}];}['_getDifferentChangeGroups'](_0x5ca3af,_0x4583e8){return _0x4583e8;}}class wt extends os{['content'];['version'];['actionName'];['args'];['userMessage'];['model'];['hasError']=!0x1;constructor(_0x54db3e){super(_0x54db3e),this['content']=_0x54db3e['content'],this['version']=_0x54db3e['version'],this['actionName']=_0x54db3e['actionName'],this['args']=_0x54db3e['args'],this['userMessage']=_0x54db3e['userMessage'],this['model']=_0x54db3e['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':Fe['TEXT'],'content':this['content'],'version':this['version'],'label':'Current\x20document','uiId':'current-document'};}['createReply'](_0x28ceb1){const _0x2583a7=new ys({'editor':this['editor'],'documentContextContent':this['content'],..._0x28ceb1});return this['replies']['push'](_0x2583a7),_0x2583a7['delegate'](...ze)['to'](this),this['fire']('replyCreated',_0x2583a7),_0x2583a7;}}class Bn extends _0x50bbb8{constructor(_0x41f6b9,_0x10d64b=!0x0,_0x18ba4d=!0x0){super(_0x41f6b9),this['set']('isEnabled',!0x1),_0x10d64b&&(this['applyButton']=this['_createButton'](h(_0x41f6b9,'AI_BALLOON_APPLY_BUTTON'),'ck-ai-button-primary'),this['applyButton']['bind']('isEnabled')['to'](this),this['items']['add'](this['applyButton'])),_0x18ba4d&&(this['suggestButton']=this['_createButton'](h(_0x41f6b9,'AI_BALLOON_SUGGEST_BUTTON'),_0x10d64b?'ck-ai-button-secondary':'ck-ai-button-primary'),this['suggestButton']['bind']('isEnabled')['to'](this),this['items']['add'](this['suggestButton'])),this['setButtonsVisibility']({'showApplyButton':_0x10d64b,'showSuggestButton':_0x18ba4d}),this['extendTemplate']({'attributes':{'class':['ck-ai-balloon__toolbar']}});}['setButtonsVisibility']({showApplyButton:_0x5d2aa3,showSuggestButton:_0x17d5f5}){this['applyButton']&&(this['applyButton']['isVisible']=_0x5d2aa3),this['suggestButton']&&(this['suggestButton']['isVisible']=_0x17d5f5);}['_createButton'](_0x2ef69e,_0x3bc240){const _0x4230bd=new _0x1d1b95(this['locale']);return _0x4230bd['set']({'label':_0x2ef69e,'class':_0x3bc240,'isVisible':!0x0,'withText':!0x0}),_0x4230bd;}}class yn extends _0x1f054a{constructor(_0x379162){super(_0x379162),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-balloon__disclaimer']},'children':[{'tag':'p','attributes':{'class':['ck','ck-ai-balloon__disclaimer-content']},'children':[{'text':h(_0x379162,'AI_DISCLAIMER_TEXT')}]}]});}}class Nn extends _0x1f054a{constructor(_0x2946bd){super(_0x2946bd),this['set']('isVisible',!0x0);const _0xec9f06=new mi('small');_0xec9f06['isVisible']=!0x0;const _0x5c2240=new _0x1f054a(this['locale']);_0x5c2240['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-suggestion__loader-text']},'children':[h(this['locale'],'AI_CHAT_IS_WRITING')]}),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__loader',this['bindTemplate']['if']('isVisible','ck-hidden',_0x1306e5=>!_0x1306e5)]},'children':[_0xec9f06,_0x5c2240]});}}class Bt extends gs{['focusCycler'];['_config'];['_contentWrapper'];['_streamableContentView'];['_toolbarView'];['_miniToolbarView'];['_loaderView'];['_disclaimerView'];['_focusTracker'];['_keystrokes'];['_dialogContent'];['_focusables'];['_scrollManager'];['_navigationPreviousButton'];['_navigationNextButton'];['_navigationTryAgainButton'];['_navigationCounter'];constructor(_0x24cd9c,_0x5c3a63){super(_0x24cd9c),this['set']('isBusy',!0x1),this['set']('isTrackChangesOn',!0x1),this['set']('_isLoading',!0x1),this['set']('_hasError',!0x1),this['_config']=_0x5c3a63,this['_focusTracker']=new _0x50d771(),this['_keystrokes']=new _0x407d91(),this['_focusables']=this['createCollection'](),this['focusCycler']=new _0x18b3f0({'focusables':this['_focusables'],'focusTracker':this['_focusTracker'],'keystrokeHandler':this['_keystrokes'],'actions':{'focusPrevious':'shift\x20+\x20tab','focusNext':'tab'}}),this['_dialogContent']=new _0x44a698(),this['_addContentWrapper'](_0x5c3a63),this['_addDisclaimerView'](),this['_addToolbar'](_0x5c3a63),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'](_0x5c3a63);});}['render'](){super['render']();for(const _0x380e08 of this['_focusables'])this['_focusTracker']['add'](_0x380e08['element']);this['_keystrokes']['listenTo'](this['element']),this['_initializeScrollManager']();}['destroy'](){super['destroy'](),this['_scrollManager']&&this['_scrollManager']['destroy']();}['focus'](_0x1853d2){-0x1===_0x1853d2?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}['setIsLoading'](_0x2b2479){this['_isLoading']=_0x2b2479;}['setErrorState'](){this['_hasError']=!0x0,this['_miniToolbarView']['toggleShowChangesEnabled'](!0x1);}['clearErrorState'](){this['_hasError']=!0x1,this['_miniToolbarView']['toggleShowChangesEnabled'](!0x0);}['showError'](_0xe8c310){super['showError'](_0xe8c310),this['_dialogContent']['has'](this['_errorView'])||this['_dialogContent']['add'](this['_errorView'],0x0);}['hideError'](){super['hideError'](),this['clearErrorState']();}['showBlockingError'](_0x12ab05){super['showBlockingError'](_0x12ab05),this['setErrorState']();}['addMiniToolbarItem'](_0x12845d){this['_miniToolbarView']['items']['has'](_0x12845d)||this['_miniToolbarView']['items']['add'](_0x12845d);}['removeMiniToolbarItem'](_0x37aae4){this['_miniToolbarView']['items']['has'](_0x37aae4)&&this['_miniToolbarView']['items']['remove'](_0x37aae4);}['showLoader'](){this['_loaderView']&&(this['_isLoading']=!0x0);}['hideLoader'](){this['_loaderView']&&(this['_isLoading']=!0x1);}['_toggleToolbarButtonsVisibility']({showApplyButton:_0x53218a,showSuggestButton:_0x49557a}){_0x53218a=_0x53218a&&!this['isTrackChangesOn']&&this['_config']['availableActions']['includes']('applySuggestion'),_0x49557a=_0x49557a&&this['_config']['availableActions']['includes']('insertSuggestion'),this['_toolbarView']['setButtonsVisibility']({'showApplyButton':_0x53218a,'showSuggestButton':_0x49557a});}async['updateContent'](_0x2f6a09){await this['_streamableContentView']['update'](_0x2f6a09);}['clearContent'](){this['_streamableContentView']['clear']();}['_addContentWrapper'](_0x29411d){this['_contentWrapper']=new _0x1f054a(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'](_0x29411d['miniToolbarConfig'])]}),this['_dialogContent']['add'](this['_contentWrapper']);}['_addDisclaimerView'](){this['_disclaimerView']=new yn(this['locale']),this['_dialogContent']['add'](this['_disclaimerView']);}['_addToolbar']({showApplyButton:_0x5efb89,showSuggestButton:_0x3692b0}){this['_toolbarView']=new Bn(this['locale'],_0x5efb89,_0x3692b0),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',(_0x105a20,_0x432b53,_0x1bfed6)=>!(_0x105a20||_0x432b53||_0x1bfed6)),this['_toggleToolbarButtonsVisibility']({'showApplyButton':_0x5efb89,'showSuggestButton':_0x3692b0}),this['_dialogContent']['add'](this['_toolbarView']);}['_createMiniToolbar'](_0x59bcf4){return this['_miniToolbarView']=new ls(this['locale'],_0x59bcf4),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',(_0x1cab78,_0x3610da)=>!(_0x1cab78||_0x3610da)),this['_miniToolbarView'];}['_createLoaderView'](){return this['_loaderView']=new Nn(this['locale']),this['_loaderView']['bind']('isVisible')['to'](this,'_isLoading'),this['_loaderView'];}['_createStreamableContentView'](){return this['_streamableContentView']=new cs(this['locale']),this['_streamableContentView'];}['_setupMiniToolbarButtons'](){const _0x21cb1f=new _0x1d1b95(this['locale']),_0x1f5065=new _0x1d1b95(this['locale']),_0x36293d=new Ln(this['locale']),_0x20c9b2=new _0x1d1b95(this['locale']);_0x21cb1f['set']({'icon':_0x1b9a26,'label':h(this['locale'],'AI_ACTIONS_TRY_AGAIN'),'tooltip':!0x0,'class':'ck-ai-custom-action-button'}),_0x1f5065['set']({'icon':_0x37ead0,'tooltip':h(this['locale'],'AI_ACTIONS_PREVIOUS_INTERACTION'),'class':'ck-ai-navigation-button\x20ck-ai-previous-button'}),_0x20c9b2['set']({'icon':_0xa5f5aa,'tooltip':h(this['locale'],'AI_ACTIONS_NEXT_INTERACTION'),'class':'ck-ai-navigation-button\x20ck-ai-next-button'}),_0x21cb1f['bind']('isEnabled')['to'](this,'isBusy',_0x12c56d=>!_0x12c56d),_0x21cb1f['on']('execute',()=>{this['fire']('tryAgain');}),_0x1f5065['bind']('isEnabled')['to'](this,'isBusy',_0xa5b024=>!_0xa5b024),_0x1f5065['on']('execute',()=>{this['fire']('showPrevious');}),_0x20c9b2['bind']('isEnabled')['to'](this,'isBusy',_0x57ece2=>!_0x57ece2),_0x20c9b2['on']('execute',()=>{this['fire']('showNext');}),this['_navigationPreviousButton']=_0x1f5065,this['_navigationCounter']=_0x36293d,this['_navigationNextButton']=_0x20c9b2,this['_navigationTryAgainButton']=_0x21cb1f;}['updateMiniToolbarButtons'](_0x4fe748,_0x108bc5){this['_navigationPreviousButton']||this['_setupMiniToolbarButtons']();const _0x2c9d58=_0x4fe748>0x1;if(this['addMiniToolbarItem'](this['_navigationTryAgainButton']),_0x2c9d58){this['addMiniToolbarItem'](this['_navigationPreviousButton']),this['addMiniToolbarItem'](this['_navigationCounter']),this['addMiniToolbarItem'](this['_navigationNextButton']);const _0xe2f4a=_0x4fe748-_0x108bc5;this['_navigationCounter']['setInteractionCount'](_0xe2f4a+'/'+_0x4fe748),this['_navigationPreviousButton']['isEnabled']=_0x108bc5<_0x4fe748-0x1,this['_navigationNextButton']['isEnabled']=_0x108bc5>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'](_0x40f2b7){this['_isLoading']=_0x40f2b7;}['resetShowChangesButton'](){this['_miniToolbarView']['isShowChangesOn']=!0x1;}['_initializeScrollManager'](){const _0x12c2e2=this['_getScrollableElement']();_0x12c2e2&&!this['_scrollManager']&&(this['_scrollManager']=new ai(_0x12c2e2));}['_getScrollableElement'](){return this['_streamableContentView']['element'];}}class Ln extends _0x1f054a{constructor(_0x4d9cc4){super(_0x4d9cc4);const _0x43b688=this['bindTemplate'];this['set']('interactionCount','1/1'),this['setTemplate']({'tag':'span','attributes':{'class':['ck-ai-interaction-counter']},'children':[{'text':_0x43b688['to']('interactionCount')}]});}['setInteractionCount'](_0x5c8bb0){this['set']('interactionCount',_0x5c8bb0);}}class ri extends _0x53f6d2{static get['requires'](){return[tt,_0x2dc660,s,R,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(_0x100a28){super(_0x100a28),this['_bodyCollection']=new _0x1c4f1c(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'](_0x112eae,_0x1dc561,_0x5702b2){if(this['_stopInteraction'](),this['editor']['plugins']['has']('TableSelection')){if(this['editor']['plugins']['get']('TableSelection')['getSelectedTableCells']()){const {modelFragment:_0xc6bbb0,anchorData:_0x3bebe7}=this['_getExecuteDataInTable']();return this['_executeAction'](_0x112eae,_0xc6bbb0,_0x3bebe7,_0x1dc561,_0x5702b2);}}const {modelFragment:_0x4855e5,anchorData:_0x4630af}=this['_getExecuteDataRegular']();return this['_executeAction'](_0x112eae,_0x4855e5,_0x4630af,_0x1dc561,_0x5702b2);}async['destroy'](){return this['_stopInteraction'](),this['_bodyCollection']['detachFromDom'](),super['destroy']();}['_createActionsBalloonView'](){const _0x107ba8=this['editor']['plugins']['has']('TrackChanges');let _0x4c2253=this['editor']['config']['get']('ai.availableReplyActions')||[...J];_0x107ba8||(_0x4c2253=_0x4c2253['filter'](_0x328eb1=>'insertSuggestion'!=_0x328eb1));const _0x39cd36=this['editor']['commands']['get']('trackChanges'),_0xdb1bf4=new Bt(this['editor']['locale'],{'showApplyButton':!0x0,'showSuggestButton':_0x107ba8,'miniToolbarConfig':{'showChanges':'icon'},'availableActions':_0x4c2253});return _0xdb1bf4['bind']('isBusy')['to'](this),_0x39cd36&&_0xdb1bf4['bind']('isTrackChangesOn')['to'](_0x39cd36,'value'),_0xdb1bf4['on']('tryAgain',()=>{this['_refreshInteraction']();}),_0xdb1bf4['on']('showPrevious',()=>{this['_navigateToPrevious']();}),_0xdb1bf4['on']('showNext',()=>{this['_navigateToNext']();}),_0xdb1bf4;}['_getExecuteDataRegular'](){const _0x57dbfe=this['editor']['model']['document']['selection'];if(_0x57dbfe['isCollapsed']){const _0x5db566=_0x22aa77(_0x57dbfe['getSelectedBlocks']())||this['editor']['model']['schema']['getLimitElement'](_0x57dbfe);this['editor']['model']['change'](_0x45bff3=>{_0x45bff3['setSelection'](_0x5db566,'in');});}const _0x400b6d=_0x57dbfe['getFirstRange'](),_0xaa7363=this['_wrapWithCommonAncestors'](this['editor']['model']['getSelectedContent'](_0x57dbfe),_0x400b6d['start'],_0x400b6d['end']);this['_copyMarkersToFragment'](_0xaa7363,_0x57dbfe,{'isTableSelection':!0x1});const _0x213ca4=_0x57dbfe['getFirstRange']()['start'],_0x163d28=new Map();let _0x30d81b=_0xaa7363;for(let _0x2cd970=0x0;_0x2cd970<_0x213ca4['path']['length'];_0x2cd970++)_0x163d28['set'](_0x30d81b,_0x213ca4['path'][_0x2cd970]),_0x30d81b=_0x30d81b['getChild'](0x0);return{'modelFragment':_0xaa7363,'anchorData':_0x163d28};}['_getExecuteDataInTable'](){const _0x3a3491=this['editor']['model']['document']['selection'],_0x3d18dd=this['editor']['plugins']['get']('TableSelection')['getSelectionAsFragment'](),_0x3ecfb8=_0x3a3491['getFirstRange']()['start']['parent']['parent'],_0x294897=this['editor']['model']['createRange'](this['editor']['model']['createPositionBefore'](_0x3ecfb8),this['editor']['model']['createPositionAfter'](_0x3ecfb8)),_0x23ce40=this['_wrapWithCommonAncestors'](_0x3d18dd,_0x294897['start'],_0x294897['end']);this['_copyMarkersToFragment'](_0x23ce40,_0x3a3491,{'isTableSelection':!0x0});const _0x473d47=_0x3a3491['getFirstRange']()['start'],_0x8196f=new Map();let _0x5c6b31=_0x23ce40;for(let _0x4fe88b=0x0;_0x4fe88b<_0x473d47['path']['length'];_0x4fe88b++)if(_0x8196f['set'](_0x5c6b31,_0x473d47['path'][_0x4fe88b]),_0x4fe88b<_0x473d47['path']['length']-0x1)_0x5c6b31=_0x5c6b31['getChild'](0x0);else{let _0x2bff56=_0x5c6b31['nextSibling'];for(;_0x2bff56;)_0x8196f['set'](_0x2bff56,_0x473d47['path'][_0x4fe88b]),_0x2bff56=_0x2bff56['nextSibling'];}return{'modelFragment':_0x23ce40,'anchorData':_0x8196f};}async['_executeAction'](_0x51a82a,_0x4e1674,_0x52240b,_0x440efd,_0xc49488){const _0x203ff6=this['editor']['plugins']['get'](s),_0xfbcdbe=this['editor']['plugins']['get'](R),_0x3cb3a4=this['editor']['model']['document']['selection'],_0x5c90f8=await _0x203ff6['modelToDataWithIds'](_0x4e1674),_0x34433b=this['editor']['model']['document']['version'],_0x4d894d=[..._0x3cb3a4['getRanges']()];return this['_actionsBalloonView']||(this['_actionsBalloonView']=this['_createActionsBalloonView']()),this['_clearInteractionHistory'](),this['_clearErrorState'](),this['_actionsBalloonView']['clearContent'](),_0xfbcdbe['open']({'index':0x3e8*Math['random']()%0x3e8,'title':_0x440efd,'icon':_0xc49488||bt,'mainView':this['_actionsBalloonView'],'class':'ck-ai-actions-balloon','ranges':_0x4d894d,'id':'aiActionsBalloon'}),this['_setLoadingState'](),this['stopListening'](this['_actionsBalloonView']),this['stopListening'](_0xfbcdbe),this['_interactionParams']={'action':_0x51a82a,'content':_0x5c90f8,'version':_0x34433b,'aiBalloon':_0xfbcdbe,'modelFragment':_0x4e1674,'anchorData':_0x52240b},this['_setupApplyListeners'](),this['listenTo'](_0xfbcdbe,'selectionRemoved',()=>{this['_stopInteraction'](),this['_actionsBalloonView']['disableMiniToolbarButtons']();}),this['listenTo'](_0xfbcdbe,'dialogClosed',(_0x2543dc,{id:_0x1af4e5})=>{if('aiActionsBalloon'===_0x1af4e5){if(this['_interaction']&&this['_interaction']['replies']['length']>0x0){const _0x226d3f=this['_interaction']['replies'][this['_interaction']['replies']['length']-0x1],_0x2a8c30=_0x226d3f['changeGroups'][0x0];_0x2a8c30&&'pending'===_0x2a8c30['state']&&_0x226d3f['setChangeGroupState'](0x0,'rejected');}this['_stopInteraction'](),this['_clearInteractionHistory'](),this['stopListening'](this['_actionsBalloonView']),this['stopListening'](_0xfbcdbe);}}),this['_createInteraction'](_0x5c90f8,_0x34433b,_0xfbcdbe,_0x51a82a);}['_setupApplyListeners'](){if(!this['_interactionParams'])return;const {modelFragment:_0x513dd7,anchorData:_0x3d458b}=this['_interactionParams'];this['listenTo'](this['_actionsBalloonView'],'applySuggestion',()=>{this['_applyChanges'](_0x513dd7,_0x3d458b,!0x1);}),this['listenTo'](this['_actionsBalloonView'],'insertSuggestion',()=>{this['_applyChanges'](_0x513dd7,_0x3d458b,!0x0);});}['_wrapWithCommonAncestors'](_0x3686ec,_0x5bfa4a,_0x24f1cc){const _0x3bce2e=this['editor']['model']['createRange'](_0x5bfa4a,_0x24f1cc)['getCommonAncestor'](),_0x5ae1b7=_0x3bce2e['is']('documentFragment')?[]:_0x3bce2e['getAncestors']({'includeSelf':!0x0})['slice'](0x1);if(_0x5ae1b7['length']){const _0x366ce4=_0x5ae1b7['map'](_0x36f187=>_0x36f187['_clone'](!0x1));for(let _0x1ee097=0x1;_0x1ee097<_0x366ce4['length'];_0x1ee097++)_0x366ce4[_0x1ee097-0x1]['_appendChild'](_0x366ce4[_0x1ee097]);return _0x366ce4[_0x366ce4['length']-0x1]['_appendChild'](_0x3686ec),new jt(_0x366ce4[0x0]);}return _0x3686ec;}['_copyMarkersToFragment'](_0x3e0a2e,_0x3edb95,_0x3ea966={'isTableSelection':!0x1}){const _0x533d54=this['editor']['model'],_0xdcd0cd=Array['from'](_0x3edb95['getRanges']()),_0x28406d=_0x3edb95['getFirstRange']()['start'];for(const _0x48f5ae of _0x533d54['markers']){if(_0x48f5ae['name']['startsWith'](o)||!_0x48f5ae['affectsData'])continue;const _0x335597=_0x48f5ae['getRange']();if(!_0xdcd0cd['some'](_0x57c1e9=>_0x57c1e9['containsRange'](_0x335597,!0x0)))continue;const _0x44e938=this['_regularCalculateMarkerPath'](_0x335597['start'],_0x28406d,_0x3ea966['isTableSelection']),_0x3236e3=this['_regularCalculateMarkerPath'](_0x335597['end'],_0x28406d,_0x3ea966['isTableSelection']),_0x516fc2=_0x533d54['createPositionFromPath'](_0x3e0a2e,_0x44e938),_0x5cf55a=_0x533d54['createPositionFromPath'](_0x3e0a2e,_0x3236e3);if(!_0x516fc2['isEqual'](_0x5cf55a)){const _0x1ea445=_0x533d54['createRange'](_0x516fc2,_0x5cf55a);_0x3e0a2e['markers']['set'](_0x48f5ae['name'],_0x1ea445);}}}['_regularCalculateMarkerPath'](_0x1d1e0b,_0x478ad1,_0x1c6822=!0x1){const _0x4b125b=[..._0x1d1e0b['path']['slice']()];for(let _0x4a70e6=0x0;_0x4a70e6<Math['max'](_0x478ad1['path']['length'],_0x1d1e0b['path']['length']);_0x4a70e6++){const _0x13cb44=_0x478ad1['path'][_0x4a70e6]||0x0,_0x1f5106=(_0x1d1e0b['path'][_0x4a70e6]||0x0)-_0x13cb44;if(_0x4b125b[_0x4a70e6]=_0x1f5106,0x0!==_0x1f5106&&!_0x1c6822)break;}return _0x4b125b;}async['_createInteraction'](_0x562efc,_0x3f5595,_0x33a898,_0x55bc72){const _0x510f3d=this['editor'];this['_interactionParams']||(this['_interactionParams']={'action':_0x55bc72,'content':_0x562efc,'version':_0x3f5595,'aiBalloon':_0x33a898,'modelFragment':this['editor']['model']['getSelectedContent'](this['editor']['model']['document']['selection']),'anchorData':new Map()});const _0x2ace5f=new wt({'connector':this['_aiConnector'],'editor':_0x510f3d,'content':_0x562efc,'version':_0x3f5595,..._0x55bc72});this['_interactions']['push'](_0x2ace5f);const _0x4010fc=(_0x22acb7,_0x29d234=!0x1,_0x255357='streaming')=>this['_promiseQueue']['enqueue'](async _0x324092=>{try{const _0x4a7332=kt({'editor':_0x510f3d,'changeGroups':_0x22acb7['changeGroups'],'documentContextContent':_0x22acb7['documentContextContent'],'showDiff':_0x29d234,'trimUnchanged':!0x1});_0x4a7332['length']&&await this['_actionsBalloonView']['updateContent']({'part':_0x4a7332[0x0],'renderingStrategy':_0x255357,'abortSignal':_0x324092});}catch(_0x2b8ec5){if(this['_isAbortError'](_0x2b8ec5))return;throw _0x2b8ec5;}});this['_interaction']['on']('replyCreated',(_0x174f91,_0x307cec)=>{this['_actionsBalloonView']['hideLoader'](),this['_actionsBalloonView']['startAutoScroll'](),_0x4010fc(_0x307cec)['catch'](_0x219661=>{this['_isAbortError'](_0x219661)||(console['error']('Error\x20updating\x20content\x20in\x20replyCreated:',_0x219661),this['_setErrorState'](_0x2ace5f));});}),this['_interaction']['on']('replyContentUpdated',(_0x3f031f,_0x456dae)=>{_0x4010fc(_0x456dae)['catch'](_0x742bdb=>{this['_isAbortError'](_0x742bdb)||(console['error']('Error\x20updating\x20content\x20in\x20replyContentUpdated:',_0x742bdb),this['_setErrorState'](_0x2ace5f));});}),this['_interaction']['on']('interactionFinished',async()=>{try{await this['_clearLoadingState'](),this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']),await this['_promiseQueue']['queueEmptyPromise'];}catch(_0x1ed99f){this['_isAbortError'](_0x1ed99f)||(console['error']('Error\x20clearing\x20loading\x20state\x20in\x20interactionFinished:',_0x1ed99f),this['_setErrorState'](_0x2ace5f));}finally{this['_actionsBalloonView']['stopAutoScroll']();}}),this['listenTo'](this['_actionsBalloonView'],'toggleSuggestionDisplayMode',async(_0x2decdb,{showDiff:_0x58e084})=>{try{this['_balloonShowDiff']=_0x58e084;const _0x7ef9a6=this['_interaction']['replies'][this['_interaction']['replies']['length']-0x1];_0x7ef9a6&&await _0x4010fc(_0x7ef9a6,_0x58e084,'static');}catch(_0x3ea0a3){this['_isAbortError'](_0x3ea0a3)||(console['error']('Error\x20updating\x20content\x20in\x20toggleSuggestionDisplayMode:',_0x3ea0a3),this['_setErrorState'](_0x2ace5f));}}),this['_interaction']['on']('replyChangeGroupStateUpdated',(_0x56586b,{reply:_0x1014e4})=>{const _0x7b2d05={'positiveCount':_0x1014e4['changeGroups']['filter'](_0x2f7330=>'accepted'===_0x2f7330['state'])['length'],'totalCount':_0x1014e4['changeGroups']['length']},_0x469c8e=this['_interaction']['actionCallId'],_0x23c794=this['_interaction']['actionName'];_0x23c794?this['_aiConnector']['upsertAIActionRating'](_0x23c794,_0x469c8e,_0x7b2d05):this['_aiConnector']['upsertCustomAIActionRating'](_0x469c8e,_0x7b2d05);}),this['_setLoadingState']();try{const _0x49122e=await this['_interaction']['start']();return this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']),_0x49122e;}catch(_0x2b2d7d){if(this['_isAbortError'](_0x2b2d7d))return;this['_actionsBalloonView']['hideLoader'](),this['_setErrorState'](_0x2ace5f);}}['_applyChanges'](_0x2dd2c6,_0x9f6abc,_0x167bb3){const _0x2d0b54=this['editor'];if(_0x167bb3&&!_0x2d0b54['plugins']['has']('TrackChanges'))throw new _0x25c351('ai-no-track-changes',null);const _0x13fb04=this['editor']['plugins']['get'](ot),_0x892f76=this['_interactions'][this['_interactions']['length']-0x1-this['_currentInteractionIndex']];if(!_0x892f76||!_0x892f76['replies']['length'])return;const _0x59e53d=_0x892f76['replies'][_0x892f76['replies']['length']-0x1],_0x971225=_0x59e53d['changeGroups'];_0x59e53d['setChangeGroupState'](0x0,'accepted');let _0x169677=at({'editor':_0x2d0b54,'reply':_0x59e53d,'interaction':_0x892f76,'groups':_0x971225,'transform':!0x1,'documentCompare':_0x13fb04,'documentCompareOptions':{'anchor':_0x2d0b54['model']['createPositionAt'](_0x2dd2c6,0x0),'markDeletions':_0x167bb3}});_0x169677=this['_filterOperationsOutsideRange'](_0x169677,_0x9f6abc);for(const _0x1d9867 of _0x169677)this['_anchorOperation'](_0x9f6abc,_0x1d9867,_0x2d0b54['model']['document']['getRoot']());const _0x5550bb=_0x892f76['getDocumentContext']()['version'],_0x201b25=_0x2d0b54['model']['document']['history']['getOperations'](_0x5550bb),_0x36245f={'document':_0x2d0b54['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1},_0x3d74f8=xt(_0x169677,_0x201b25,_0x36245f)['operationsA'];_0x2d0b54['model']['change'](_0x3e0426=>{if(_0x3e0426['setSelection'](_0x2d0b54['model']['document']['selection']['focus']),_0x167bb3)_0x2d0b54['plugins']['get']('TrackChangesEditing')['_applyOperationsAsSuggestions'](_0x3d74f8);else{for(const _0x3efef0 of _0x3d74f8)_0x3efef0['baseVersion']=_0x2d0b54['model']['document']['version'],rt(_0x2d0b54,_0x3efef0),_0x3e0426['batch']['addOperation'](_0x3efef0),_0x2d0b54['model']['applyOperation'](_0x3efef0);}}),this['editor']['plugins']['get']('AIBalloon')['close']();}['_filterOperationsOutsideRange'](_0x5026bc,_0x414b04){return _0x5026bc['filter'](_0x1209aa=>{if('rename'==_0x1209aa['type']){const _0x464ca6=_0x1209aa['position']['nodeAfter'];return!_0x414b04['has'](_0x464ca6);}if(_0x1209aa['type']['indexOf']('Attribute')>-0x1){const _0x39eee5=_0x1209aa['range']['start']['nodeAfter'];return!_0x414b04['has'](_0x39eee5);}return!0x0;});}['_anchorOperation'](_0x147aa2,_0x3fb8f6,_0x356c37){const _0x186676=_0x3fb8f6['clone']();for(const _0x36daa6 in _0x3fb8f6){const _0x4df1d9=_0x3fb8f6[_0x36daa6];_0x4df1d9 instanceof dt?_0x3fb8f6[_0x36daa6]=new dt(_0x16dc9b(_0x4df1d9['start']),_0x16dc9b(_0x4df1d9['end'])):_0x4df1d9 instanceof Dt&&(_0x3fb8f6[_0x36daa6]=_0x16dc9b(_0x4df1d9));}if(['insert','move','remove','reinsert','split','merge']['includes'](_0x186676['type'])){if(_0x186676['isDocumentOperation']=!0x1,_0x186676['baseVersion']=null,'remove'==_0x186676['type']){const _0x31289b=_0x186676['sourcePosition'],_0x118d71=_0x186676['howMany'];new lt(_0x31289b,_0x118d71)['_execute']();}else _0x186676['_execute']();}function _0x16dc9b(_0x234ccd){if('$graveyard'==_0x234ccd['root']['rootName'])return _0x234ccd;const _0x836ec8=[];let _0x1228df=_0x234ccd['root'];for(let _0x12b154=0x0;_0x12b154<_0x234ccd['path']['length'];_0x12b154++){const _0x566d8e=_0x147aa2['get'](_0x1228df)||0x0;_0x836ec8[_0x12b154]=_0x234ccd['path'][_0x12b154]+_0x566d8e,_0x1228df=_0x1228df['getChildAtOffset'](_0x234ccd['path'][_0x12b154]);}return new Dt(_0x356c37,_0x836ec8,_0x234ccd['stickiness']);}}['_refreshInteraction'](){if(!this['_interactionParams'])return;this['_interactions']['length']>0x0&&this['_stopInteraction'](),this['_currentInteractionIndex']=0x0,this['_balloonShowDiff']=!0x1;const {action:_0x5a6364,content:_0x5d7fce,version:_0x2f8c0e,aiBalloon:_0x62e3a}=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'](_0x5d7fce,_0x2f8c0e,_0x62e3a,_0x5a6364)['catch'](_0x58c1fd=>{this['_isAbortError'](_0x58c1fd)||console['error']('Error\x20refreshing\x20interaction:',_0x58c1fd);});}['_isAbortError'](_0x73df73){return!!_0x73df73['message']&&_0x73df73['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 _0x1101b6=this['_interactions']['length'];this['_currentInteractionIndex']<_0x1101b6-0x1&&this['_displayInteractionAtIndex'](this['_currentInteractionIndex']+0x1);}['_navigateToNext'](){this['_currentInteractionIndex']>0x0&&this['_displayInteractionAtIndex'](this['_currentInteractionIndex']-0x1);}async['_displayInteractionAtIndex'](_0x4c2633){if(!this['_interactionParams'])return;this['_currentInteractionIndex']=_0x4c2633;const _0x2b1455=this['_interactions'][this['_interactions']['length']-0x1-this['_currentInteractionIndex']];if(!_0x2b1455)return;if(_0x2b1455['hasError'])return this['_setErrorState'](_0x2b1455),void this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']);if(!_0x2b1455['replies']['length'])return;this['_actionsBalloonView']['hideError'](),this['_interactionParams']&&this['_clearErrorState']();const _0x2c38c5=_0x2b1455['replies'][_0x2b1455['replies']['length']-0x1];if(_0x2c38c5){const _0x828aa2=this['editor'];try{const _0x37db48=kt({'editor':_0x828aa2,'changeGroups':_0x2c38c5['changeGroups'],'documentContextContent':_0x2c38c5['documentContextContent'],'showDiff':this['_balloonShowDiff'],'trimUnchanged':!0x1});await new Promise(_0x28ee1a=>setTimeout(_0x28ee1a,0x32)),await this['_actionsBalloonView']['updateContent']({'part':_0x37db48[0x0],'renderingStrategy':'static','abortSignal':new AbortController()['signal']});}catch(_0x3f1011){this['_isAbortError'](_0x3f1011)||console['error']('Error\x20updating\x20content\x20during\x20navigation:',_0x3f1011);}}this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']);}['_setLoadingState'](){this['_actionsBalloonView']['setIsLoading'](!0x0),this['isBusy']=!0x0;}async['_setErrorState'](_0x5ef813){const _0xb5d73a=h(this['editor']['locale'],'AI_ACTIONS_GENERIC_ERROR');this['_actionsBalloonView']['showError'](_0xb5d73a),_0x5ef813['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 Fa extends _0x53f6d2{static get['requires'](){return[ii,ti,ri];}static get['pluginName'](){return'AIQuickActions';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x40db47){super(_0x40db47),_0x40db47['config']['define']('ai.quickActions',{'extraCommands':[],'removeCommands':[],'isSearchEnabled':!0x0});}}class gr extends _0x1f054a{['resultResponseView'];['acceptButtonView'];['dismissButtonView'];['infoButtonView'];['outdatedButtonView'];constructor(_0x260167,_0x14732c){super(_0x260167),this['id']=_0x14732c,this['set']('status','pending'),this['set']('changeId',_0x14732c),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',(_0x236341,_0x2467c0)=>{_0x2467c0&&_0x2467c0['target']&&'A'===_0x2467c0['target']['tagName']&&_0x2467c0['preventDefault'](),this['fire']('activateChange',{'id':_0x14732c,'source':this,'uiInteraction':'click'});}),this['on']('mouseover',()=>{this['fire']('activateChange',{'id':_0x14732c,'source':this,'uiInteraction':'hover'});}),this['on']('mouseout',()=>{this['fire']('deactivateChange',{'origin':'panel','id':_0x14732c,'source':this});});}['setItemAsActive'](){this['isActive']=!0x0;}['setItemAsInactive'](){this['isActive']=!0x1;}['_createResultResponseView'](){const _0x4546bc=new _0x1f054a(this['locale']);return _0x4546bc['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',_0x3f1120=>!_0x3f1120)]}}),_0x4546bc;}['_createAcceptButtonView'](){const _0x2c167b=new _0x1d1b95(this['locale']);return _0x2c167b['set']({'label':h(this['locale'],'AI_REVIEW_MODE_ACCEPT_CHANGE'),'withText':!0x0}),_0x2c167b['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x5bc59c=>{this['fire']('acceptChange',{'id':this['changeId']}),_0x5bc59c['stopPropagation']();})},'attributes':{'class':['ck-ai-button-secondary','ck-ai_review__check-run-result-accept-button',this['bindTemplate']['if']('status','ck-hidden',_0x3e2209=>'pending'!==_0x3e2209&&'accepted'!==_0x3e2209),this['bindTemplate']['if']('status','ck-ai_review__check-run-result-accept-button',_0x4a425d=>'pending'===_0x4a425d),this['bindTemplate']['if']('status','ck-ai_review__check-run-result-status-button',_0x26a7da=>'accepted'===_0x26a7da)]}}),this['on']('change:status',(_0x13f7ea,_0x250a1e,_0x5ab90d)=>{_0x2c167b['isEnabled']='pending'===_0x5ab90d,'accepted'===_0x5ab90d&&(_0x2c167b['label']=h(this['locale'],'AI_REVIEW_MODE_CHECK_STATUS_ACCEPTED'),_0x2c167b['icon']=_0x386c9f);}),_0x2c167b;}['_createDismissButtonView'](){const _0x1ad06d=new _0x1d1b95(this['locale']);return _0x1ad06d['set']({'label':h(this['locale'],'AI_REVIEW_MODE_DISMISS_CHANGE'),'withText':!0x0}),_0x1ad06d['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x3d9b1e=>{this['fire']('dismissChange',{'id':this['changeId']}),_0x3d9b1e['stopPropagation']();})},'attributes':{'class':['ck-ai-button-tertiary',this['bindTemplate']['if']('status','ck-hidden',_0x20c1aa=>'pending'!==_0x20c1aa&&'rejected'!==_0x20c1aa),this['bindTemplate']['if']('status','ck-ai_review__check-run-result-dismiss-button',_0x30aa3e=>'pending'===_0x30aa3e),this['bindTemplate']['if']('status','ck-ai_review__check-run-result-status-button',_0x4c4b99=>'rejected'===_0x4c4b99)]}}),this['on']('change:status',(_0x25fed2,_0x300133,_0x38a717)=>{_0x1ad06d['isEnabled']='pending'===_0x38a717,'rejected'===_0x38a717&&(_0x1ad06d['label']=h(this['locale'],'AI_REVIEW_MODE_CHECK_STATUS_REJECTED'),_0x1ad06d['icon']=_0x12f0df);}),_0x1ad06d;}['_createInfoButtonView'](){const _0x177b3a=new _0x1d1b95(this['locale']);return _0x177b3a['set']({'label':h(this['locale'],'AI_REVIEW_MODE_LEARN_MORE'),'icon':tc,'tooltip':!0x0,'isToggleable':!0x0,'role':'menuitemcheckbox','class':'ck-ai-button-tertiary\x20ck-ai_review__check-run-result-info-button\x20ck-hidden'}),_0x177b3a['bind']('isOn')['to'](this,'isInfoToggleOn',_0x28fbb7=>_0x28fbb7),_0x177b3a['on']('execute',()=>{this['isInfoToggleOn']=!this['isInfoToggleOn'];}),_0x177b3a;}['_createOutdatedButtonView'](){const _0x4aa87d=new _0x1d1b95(this['locale']);return _0x4aa87d['set']({'label':h(this['locale'],'AI_REVIEW_MODE_CHECK_STATUS_OUTDATED'),'icon':_0x4ea3ef,'withText':!0x0,'isEnabled':!0x1}),_0x4aa87d['extendTemplate']({'attributes':{'class':['ck-ai-button-secondary','ck-ai_review__check-run-result-status-button',this['bindTemplate']['if']('status','ck-hidden',_0x5d7a15=>'outdated'!==_0x5d7a15)],'disabled':'disabled'}}),_0x4aa87d;}}class me extends _0x10e1b3{['resultItemView'];['_pinnedRectIndex']=void 0x0;['_pinnedTargetElement']=void 0x0;['_pinnedTargetChangeId']=void 0x0;constructor(_0x1395e1,_0x4082d2){super(_0x1395e1),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']()),_0x4082d2['add'](this);}['render'](){super['render'](),this['_setupClickOutsideHandler']();}['updateContent'](_0x515079){this['resultItemView']['changeId']=_0x515079['id'],this['resultItemView']['resultResponseView']['element']['innerHTML']=_0x515079['contentDiffed'];}['showBalloon'](_0x51543e,_0x20defb,_0x5d9f02,_0x4606ac,_0x223bba,_0x41cb24){const _0x16a106=_0x20defb();if(!_0x16a106)return;this['updateContent'](_0x51543e),this['show']();const _0x5dacef=Array['from'](_0x16a106['getClientRects']())['reverse'](),_0x2d2cf3=this['_getPointedRectIndexFromEvent'](_0x5d9f02,_0x5dacef),_0x59261a=_0x5dacef[_0x2d2cf3??0x0];'click'===_0x4606ac?(this['isDiffActive']=!0x0,this['pin']({'target':()=>this['_getBestRectPositionOnClick'](_0x20defb(),_0x2d2cf3,_0x51543e['id'],_0x223bba,_0x41cb24)||_0x59261a})):'hover'===_0x4606ac&&(this['isDiffActive']=!0x1,this['pin']({'target':()=>this['_getBestRectPositionOnHover'](_0x20defb(),_0x2d2cf3,_0x51543e['id'])||_0x59261a}));}['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'](){_0x1d6ed3({'emitter':this,'activator':()=>this['isVisible'],'contextElements':()=>{const _0x27149d=[this['element']];return this['_pinnedTargetElement']&&_0x27149d['push'](this['_pinnedTargetElement']),_0x27149d;},'callback':()=>{this['hide'](),this['unpin'](),this['deactivateChange'](),this['_pinnedTargetElement']=void 0x0,this['_pinnedRectIndex']=void 0x0,this['_pinnedTargetChangeId']=void 0x0;}});}['_createContentView'](){const _0x1020d7=new _0x1f054a();return this['resultItemView']=new gr(this['locale'],''),this['resultItemView']['resultResponseView']['extendTemplate']({'attributes':{'class':['ck-content']}}),this['resultItemView']['delegate']('acceptChange','dismissChange')['to'](this),_0x1020d7['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']]}]}),_0x1020d7;}['_getBestRectPositionOnClick'](_0x59e0c9,_0x2e5e46,_0x9ac008,_0x5f4eb3,_0x353a04){if(!_0x59e0c9)return null;const _0xa386a1=this['position']['replace']('arrow_',''),_0x3934e0=Array['from'](_0x59e0c9['getClientRects']());let _0x58523c,_0x4407db=_0x3934e0['reverse']();return void 0x0!==_0x2e5e46&&this['_isPinnedRectVisible'](_0x4407db[_0x2e5e46],_0x5f4eb3,_0x353a04)?(_0x58523c=_0x4407db[_0x2e5e46],this['_pinnedRectIndex']=_0x2e5e46):this['_isPinnedRectVisible'](_0x4407db[0x0],_0x5f4eb3,_0x353a04)&&void 0x0===_0x2e5e46?_0x58523c=_0x4407db[0x0]:(_0x4407db='s'==_0xa386a1[0x0]?[..._0x3934e0]['reverse']():_0x3934e0,_0x4407db['forEach'](_0x42575a=>{this['_isPinnedRectVisible'](_0x42575a,_0x5f4eb3,_0x353a04)&&(_0x58523c=_0x42575a);})),this['_pinnedTargetChangeId']=_0x9ac008,this['_pinnedTargetElement']=_0x59e0c9,_0x58523c||_0x59e0c9['getBoundingClientRect']();}['_getBestRectPositionOnHover'](_0x33be07,_0x1db9de,_0x1f2965){if(!_0x33be07)return null;const _0x562393=Array['from'](_0x33be07['getClientRects']())['reverse']();if(void 0x0===this['_pinnedRectIndex']&&void 0x0!==_0x1db9de&&this['_pinnedTargetChangeId']!==_0x1f2965)return this['_pinnedRectIndex']=_0x1db9de,this['_pinnedTargetElement']=_0x33be07,this['_pinnedTargetChangeId']=_0x1f2965,_0x562393[_0x1db9de];if(void 0x0!==this['_pinnedRectIndex']&&this['_pinnedTargetChangeId']===_0x1f2965){if(_0x33be07!==this['_pinnedTargetElement'])return Array['from'](this['_pinnedTargetElement']['getClientRects']())['reverse']()[this['_pinnedRectIndex']];return _0x562393[this['_pinnedRectIndex']];}return void 0x0!==_0x1db9de&&this['_pinnedTargetChangeId']!==_0x1f2965?(this['_pinnedRectIndex']=_0x1db9de,this['_pinnedTargetElement']=_0x33be07,this['_pinnedTargetChangeId']=_0x1f2965,_0x562393[_0x1db9de]):_0x33be07['getBoundingClientRect']();}['_getPointedRectIndexFromEvent'](_0x42f757,_0x422dcf){if(_0x42f757)for(let _0x472abf=0x0;_0x472abf<_0x422dcf['length'];_0x472abf++){const _0x2d8dd6=_0x422dcf[_0x472abf];if(_0x42f757['clientX']>=_0x2d8dd6['left']-0x3&&_0x42f757['clientX']<=_0x2d8dd6['right']+0x3&&_0x42f757['clientY']>=_0x2d8dd6['top']-0x3&&_0x42f757['clientY']<=_0x2d8dd6['bottom']+0x3)return _0x472abf;}}['_isPinnedRectVisible'](_0x340519,_0x326ab6,_0x56d137){const _0x4e28fc=new _0x5002e3(_0x340519),_0x531fcd=_0x326ab6||document['documentElement'],_0xcaedc2=_0x4e28fc['getIntersection'](_0x3e4f1d(_0x56d137)),_0x1613db=new _0x5002e3(_0x531fcd)['getIntersection'](_0x4e28fc);return!!(_0xcaedc2&&_0x1613db&&_0x4e28fc['width']>0x0);}}const ih=['getReviewCheckList','runReviewCheck','abortReviewStream','toggleDiff','acceptAllChanges','leaveReviewCoreResultList','activateChange','deactivateChange','acceptChange','dismissChange','learnMore','finishReview','retryReview'];class Me extends _0x5dcf5b{['_mainView'];['_balloonSuggestionView'];['_bodyCollection'];static get['requires'](){return[it];}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x395706){super(_0x395706),this['_bodyCollection']=new _0x1c4f1c(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 _0x4ef064=this['context']['plugins']['get']('AITabs');this['registerTab'](_0x4ef064);}['destroy'](){this['_bodyCollection']['detachFromDom'](),super['destroy']();}['setAvailableChecks'](_0x582491){if(!this['_mainView']['reviewCheckListView']['hasChecks']()){const _0x4ce87a=!this['context']['config']['get']('ai.models.showModelSelector');this['_mainView']['reviewCheckListView']['setChecks'](_0x582491,_0x4ce87a);}this['_mainView']['showReviewCheckListView']();}['showReviewCheckList'](){this['fire']('getReviewCheckList');}['showCheckRunResults'](_0x159e58){_0x159e58&&('error-general'!==_0x159e58['status']?'error-chunk'!==_0x159e58['status']?this['_mainView']['showReviewCheckResultsView']():this['showChunkErrorView']():this['showGeneralResultsErrorView']());}['showCheckRunResult'](_0x46a711){this['_mainView']['addCheckRunResult'](_0x46a711);}['showGeneralResultsErrorView'](){this['_mainView']['showGeneralResultsErrorView']();}['showGeneralReviewCoreErrorView'](_0x38d0d5){this['_mainView']['showGeneralReviewCoreErrorView'](_0x38d0d5??h(this['context']['locale'],'AI_REVIEW_INITIALIZATION_ERROR_MESSAGE'));}['showChunkErrorView'](){this['_mainView']['showChunkErrorView']();}['setCheckResultTitle'](_0x15d936,_0x36b42b){this['_mainView']['reviewCheckResultsView']['setTitle'](_0x15d936,_0x36b42b);}['setActiveStateInResults'](_0x49a779){this['_mainView']['reviewCheckResultsView']['getResults']()['forEach'](_0x488f8d=>{_0x488f8d['id']===_0x49a779&&_0x488f8d['setItemAsActive']();});}['resetActiveStateInResults'](){this['_mainView']['reviewCheckResultsView']['getResults']()['forEach'](_0x405022=>_0x405022['setItemAsInactive']());}['updateChangeState'](_0x6634d7,_0x154884){'accepted'===_0x154884||'rejected'===_0x154884||'outdated'===_0x154884?this['_mainView']['reviewCheckResultsView']['hideResult'](_0x6634d7,_0x154884):this['_mainView']['reviewCheckResultsView']['showResult'](_0x6634d7,_0x154884);}['showReviewCompletedView'](){this['_mainView']['showReviewCompletedView']();}['showActionsWhenResultIsReady'](){this['_mainView']['showActionsWhenResultIsReady']();}['showNoChangesView'](){this['_mainView']['showNoChangesView']();}['hideActionsWhenResultIsReady'](){this['_mainView']['hideActionsWhenResultIsReady']();}['showChangeBalloon'](_0x4e584b,_0x1e00c5,_0xb045d0,_0x28acc1,_0x1126ac,_0x5384b0){this['_balloonSuggestionView']['showBalloon'](_0x4e584b,_0x1e00c5,_0xb045d0,_0x28acc1,_0x1126ac,_0x5384b0);}['hideChangeBalloon'](){this['_balloonSuggestionView']['hideBalloon']();}['hideDiffInBalloon'](){this['_balloonSuggestionView']['hideDiffInBalloon']();}['showDiffInBalloon'](){this['_balloonSuggestionView']['showDiffInBalloon']();}['getChangeElement'](_0x11e97f){const _0x503c08=this['_mainView']['reviewCheckResultsView']['getResults']()['find'](_0x52b771=>_0x52b771['id']===_0x11e97f);return _0x503c08?_0x503c08['element']:null;}['deactivateChange'](){this['_balloonSuggestionView']['deactivateChange']();}}class sh extends _0x1f054a{constructor(_0x3f1098){super(_0x3f1098),this['set']('isVisible',!0x1),this['set']('errorMessage','');const _0x3db65b=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai_review__general-error-container',_0x3db65b['if']('isVisible','ck-hidden',_0x52cc03=>!_0x52cc03)]},'children':[{'tag':'p','attributes':{'class':'ck\x20ck-ai-notification\x20ck-ai-notification_error'},'children':[{'text':_0x3db65b['to']('errorMessage')}]}]});}}class Ae extends _0x1f054a{['reviewCoreHeader'];['generalErrorView'];['reviewCheckListView'];['reviewCheckResultsView'];['reviewCompletedView'];constructor(_0x110a31,_0x12b867){super(_0x110a31),this['reviewCoreHeader']=_0x12b867['header'],this['generalErrorView']=new sh(_0x110a31),this['reviewCheckListView']=_0x12b867['list'],this['reviewCheckListView']['delegate'](...ih)['to'](this),this['reviewCheckResultsView']=_0x12b867['results'],this['reviewCheckResultsView']['delegate'](...ih)['to'](this),this['reviewCompletedView']=_0x12b867['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'](_0x5904ec){this['reviewCheckResultsView']['addResult'](_0x5904ec),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'](_0x5e3416){this['generalErrorView']['set']('isVisible',!0x0),this['generalErrorView']['errorMessage']=_0x5e3416;}['showGeneralResultsErrorView'](){this['reviewCheckResultsView']['set']('isLoading',!0x1),this['showActionsWhenResultIsReady'](),this['reviewCheckResultsView']['showGeneralErrorMessage']();}['showChunkErrorView'](){this['reviewCheckResultsView']['set']('isLoading',!0x1),this['showActionsWhenResultIsReady'](),this['reviewCheckResultsView']['showChunkErrorMessage']();}}class _r extends _0x1d1b95{constructor(_0xffc168,_0x59c832){super(_0x59c832),this['set']({'label':_0xffc168,'withText':!0x0,'class':'ck-ai-button-primary'}),this['on']('execute',()=>{this['fire']('finishReview');});}}class Ve extends _0x2a0bb9{['_resultViews'];['_resultsHeader'];['reviewDisclaimer'];['_cancelButtonView'];['_acceptAllButtonView'];['_exitReviewButtonView'];['_toggleDiffButtonView'];['_errorMessageView'];['_finishReviewButtonView'];['_contents'];constructor(_0x4f489e,_0x54f4e0){super(_0x4f489e),this['_contents']=_0x54f4e0,this['_resultViews']=new _0x44a698(),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 fi(_0x4f489e),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 _0x4fa3cd=this['_createCombinedSkeletonLoader'](),_0x18c054=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run',_0x18c054['if']('isLoading','ck-ai_review__check-run_loading',_0x53fe35=>_0x53fe35),_0x18c054['if']('isResultReady','ck-ai_review__check-run_ready',_0x52b7a7=>_0x52b7a7),_0x18c054['if']('isVisible','ck-hidden',_0x2a5828=>!_0x2a5828)]},'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',_0x2dddec=>_0x2dddec)]},'children':this['_resultViews']},_0x4fa3cd]},this['reviewDisclaimer']]});}['clearResults'](){this['_resultViews']['clear']();}['getResults'](){return this['_resultViews'];}['addResult'](_0x29c263){const _0x5e6363=new gr(this['locale'],_0x29c263['id']);_0x5e6363['delegate']('acceptChange','dismissChange','activateChange','deactivateChange')['to'](this),this['_resultViews']['add'](_0x5e6363),_0x5e6363['resultResponseView']['element']['innerHTML']=_0x29c263['contentDiffed'];}['hideResult'](_0x4c05cd,_0x7e716a){if('pending'===_0x7e716a)return;const _0x306ee3=this['_resultViews']['find'](_0x2ac7be=>_0x2ac7be['id']===_0x4c05cd);_0x306ee3&&(_0x306ee3['status']=_0x7e716a,_0x306ee3['element']?.['classList']['add']('ck-ai_review__check-run-result_grayout'));}['showResult'](_0x26ee3,_0x3bc920){if('pending'!==_0x3bc920)return;const _0x293fd4=this['_resultViews']['find'](_0x4f5b17=>_0x4f5b17['id']===_0x26ee3);_0x293fd4&&(_0x293fd4['status']=_0x3bc920,_0x293fd4['element']?.['classList']['remove']('ck-ai_review__check-run-result_grayout'));}['setTitle'](_0x261663,_0xbbf7cb){this['headerTitle']=_0x261663,this['headerSubtitle']=_0xbbf7cb||'';}['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'],li['aiReviewChecks']);}['_createCombinedSkeletonLoader'](){const _0x54d319=new _0x1f054a(this['locale']),_0x43186b=[];for(let _0x5b91bc=0x0;_0x5b91bc<0x10;_0x5b91bc++){const _0x4a7bbd=this['_createSkeletonLoader']();_0x4a7bbd['extendTemplate']({'attributes':{'class':['ck-ai_review__check-run-skeleton-item']}}),_0x43186b['push'](_0x4a7bbd);}return _0x54d319['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-skeleton-container',this['bindTemplate']['if']('isLoading','ck-hidden',_0x207d74=>!_0x207d74)]},'children':_0x43186b}),_0x54d319;}['_createErrorView'](){const _0x14ad55=new _0x1f054a(this['locale']),_0x201171=new _0x1d1b95(this['locale']),t=this['locale']['t'];return _0x14ad55['delegate']('retryReview')['to'](this),_0x201171['set']({'label':t('Try\x20again'),'withText':!0x0,'class':'ck-ai-button-secondary\x20ck-ai_review__check-run-error-retry-button'}),_0x201171['on']('execute',()=>{this['fire']('retryReview');}),_0x14ad55['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-error-container',this['bindTemplate']['if']('showErrorMessage','ck-hidden',_0x4d9ffb=>!_0x4d9ffb),this['bindTemplate']['if']('errorType','ck-ai_review__check-run-error-container_border-bottom',_0x736c35=>'chunk'===_0x736c35)]},'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',_0x3ea730=>'chunk'===_0x3ea730)]},'children':[{'tag':'p','attributes':{'class':['ck-ai-notification__content',this['bindTemplate']['if']('errorType','ck-hidden',_0x18403a=>'general'!==_0x18403a)]},'children':[{'text':this['_contents']['generalErrorText']}]},{'tag':'p','attributes':{'class':['ck-ai-notification__content',this['bindTemplate']['if']('errorType','ck-hidden',_0x1d06b9=>'chunk'!==_0x1d06b9)]},'children':[{'text':h(this['locale'],'AI_REVIEW_MODE_CHUNK_ERROR_MESSAGE')}]}]},_0x201171]}),_0x14ad55;}['_createCancelButtonView'](){const _0x58acb0=new _0x1d1b95(this['locale']);return _0x58acb0['set']({'label':h(this['locale'],'AI_REVIEW_MODE_STOP_GENERATING'),'withText':!0x0,'class':['ck-ai-button-secondary\x20ck-ai-button-stop-generating'],'icon':_0x45f60c}),_0x58acb0['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isResultReady','ck-hidden',_0x53af2e=>_0x53af2e),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x3c815a=>_0x3c815a)]}}),_0x58acb0['on']('execute',()=>{this['fire']('abortReviewStream');}),_0x58acb0;}['_createToggleDiffButtonView'](){const _0xf1f1d3=new _0x1d1b95(this['locale']);_0xf1f1d3['set']({'tooltip':!0x0,'isToggleable':!0x0,'role':'menuitemcheckbox'}),_0xf1f1d3['bind']('isEnabled')['to'](this,'isError',_0x42c171=>!_0x42c171),_0xf1f1d3['extendTemplate']({'attributes':{'class':['ck-ai-button-secondary','ck-ai_review__check-run-toggle-diff-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0x2aca63=>!_0x2aca63),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x2f0559=>_0x2f0559)]}});const _0x551f6a=h(this['locale'],'AI_REVIEW_MODE_HIDE_CHANGES'),_0xa3f041=h(this['locale'],'AI_REVIEW_MODE_SHOW_CHANGES');return _0xf1f1d3['bind']('isOn')['to'](this,'isToggleDiffOn',_0x703f29=>_0x703f29),_0xf1f1d3['bind']('icon')['to'](this,'isToggleDiffOn',_0x447826=>_0x447826?_0x3f74ad:_0x442060),_0xf1f1d3['bind']('label')['to'](this,'isToggleDiffOn',_0x412a52=>_0x412a52?_0x551f6a:_0xa3f041),_0xf1f1d3['on']('execute',()=>{this['isToggleDiffOn']=!this['isToggleDiffOn'],this['fire']('toggleDiff',{'on':this['isToggleDiffOn']});}),_0xf1f1d3;}['_createAcceptAllButtonView'](){const _0x36356e=new _0x1d1b95(this['locale']);return _0x36356e['set']({'label':h(this['locale'],'AI_REVIEW_MODE_ACCEPT_ALL'),'withText':!0x0}),_0x36356e['bind']('isEnabled')['to'](this,'isError',_0x4acf90=>!_0x4acf90),_0x36356e['extendTemplate']({'attributes':{'class':['ck-ai-button-primary','ck-ai_review__check-run-accept-all-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0x1f6623=>!_0x1f6623),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x3233ab=>_0x3233ab)]}}),_0x36356e['on']('execute',()=>{this['fire']('acceptAllChanges');}),_0x36356e;}['_createExitReviewButtonView'](){const _0x30d2c7=new _0x1d1b95(this['locale']);return _0x30d2c7['set']({'label':h(this['locale'],'AI_REVIEW_MODE_EXIT_REVIEW'),'withText':!0x0}),_0x30d2c7['extendTemplate']({'attributes':{'class':['ck-ai-button-tertiary','ck-ai_review__check-run-exit-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0x2b309f=>!_0x2b309f),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x276840=>_0x276840)]}}),_0x30d2c7['on']('execute',()=>{this['fire']('leaveReviewCoreResultList');}),_0x30d2c7;}['_createResultHeaderView'](){const _0x5be509=new _0x1f054a(this['locale']),_0x4254ab=this['_createTitleView']();return _0x5be509['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-header',this['bindTemplate']['if']('isCompleted','ck-ai_review__review-completed-header',_0x4eee81=>_0x4eee81)]},'children':[_0x4254ab,{'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-header-buttons']},'children':[this['_cancelButtonView'],this['_acceptAllButtonView'],this['_exitReviewButtonView'],this['_toggleDiffButtonView'],this['_finishReviewButtonView']]}]}),_0x5be509;}['_createTitleView'](){const _0x584ff2=new _0x1f054a(this['locale']),_0xda9c2b=new mi();return _0xda9c2b['bind']('isVisible')['to'](this,'isResultReady',_0x4feae5=>!_0x4feae5),_0x584ff2['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-header-title-wrapper']},'children':[_0xda9c2b,{'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-header-title-content',this['bindTemplate']['if']('isCompleted','ck-hidden',_0x580677=>_0x580677)]},'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',_0x21dc14=>!_0x21dc14)]},'children':[{'text':h(this['locale'],'AI_REVIEW_MODE_FINISH_REVIEW_HEADER_TITLE')}]}]}),_0x584ff2;}['_createFinishReviewButtonView'](){const _0x46436a=new _r(h(this['locale'],'AI_REVIEW_MODE_FINISH_REVIEW_BUTTON_LABEL'),this['locale']);return _0x46436a['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isCompleted','ck-hidden',_0x29e5e1=>!_0x29e5e1)]}}),_0x46436a['delegate']('finishReview')['to'](this),_0x46436a;}}class be extends _0x2a0bb9{['_resultsHeader'];['_finishReviewButtonView'];constructor(_0x388305,_0x532d2d){super(_0x388305),this['_finishReviewButtonView']=this['_createFinishReviewButtonView'](_0x532d2d['buttonText']),this['_resultsHeader']=this['_createResultHeaderView'](_0x532d2d['headerText']);const _0x2e63e7=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__review-completed',_0x2e63e7['if']('isVisible','ck-hidden',_0x4afc00=>!_0x4afc00)]},'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':_0x532d2d['emptyResultsText']}]}]}]});}['_createFinishReviewButtonView'](_0x32c816){const _0x337ef5=new _r(_0x32c816,this['locale']);return _0x337ef5['delegate']('finishReview')['to'](this),_0x337ef5;}['_createResultHeaderView'](_0x3511d4){const _0x1aabb5=new _0x1f054a(this['locale']);return _0x1aabb5['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':_0x3511d4}]},{'tag':'div','attributes':{'class':['ck-ai_review__review-completed-header-buttons']},'children':[this['_finishReviewButtonView']]}]}),_0x1aabb5;}}class Dr extends _0x1f054a{['_dropdownView'];['_defaultValue'];['_defaultLabel'];constructor(_0x50696b,_0x513aa8){super(_0x50696b),this['_defaultValue']=_0x513aa8['default']||(_0x513aa8['data']['length']>0x0?_0x513aa8['data'][0x0]['id']:''),this['_defaultLabel']=_0x513aa8['data']['find'](_0x322901=>_0x322901['id']===this['_defaultValue'])?.['label']||'',this['set']('formValue',''),this['_dropdownView']=_0x290605(this['locale']);const _0x2e5615=this['_prepareListOptions'](_0x513aa8['data']);_0x46fef8(this['_dropdownView'],_0x2e5615,{'role':'menu','ariaLabel':_0x513aa8['label']}),this['_dropdownView']['buttonView']['set']({'label':this['_defaultLabel'],'withText':!0x0}),this['_dropdownView']['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x1a301c=>{_0x1a301c['stopPropagation']();})}}),this['listenTo'](this['_dropdownView'],'execute',_0xe00685=>{this['formValue']=_0xe00685['source']['model']['id'],this['_dropdownView']['buttonView']['label']=_0xe00685['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'](_0x2881d9=[]){const _0x4728f4=new _0x405f09();this['resetToDefault']();for(const _0x5b7e76 of _0x2881d9){const _0x4da989=new _0x53ecce({'label':_0x5b7e76['label'],'withText':!0x0,'role':'menuitemradio','id':_0x5b7e76['id'],'model':_0x5b7e76});_0x4da989['bind']('isOn')['to'](this,'formValue',_0xa4feb7=>_0xa4feb7===_0x4da989['id']);const _0xbf0702={'type':'button','model':_0x4da989};_0x4728f4['add'](_0xbf0702);}return _0x4728f4;}}class cc extends _0x2a0bb9{['_formItem']=null;constructor(_0x231729,_0x23df3e,_0x11b4e5){super(_0x231729),this['argsKey']=_0x23df3e?.['argsKey'];if('dropdown'===_0x23df3e['formType'])this['_formItem']=new Dr(this['locale'],_0x23df3e);this['set']('value',''),this['bind']('value')['to'](this['_formItem'],'formValue');const _0x157784=new _0x57479f(this['locale'],{'children':[this['_formItem']],'class':[_0x11b4e5?'ck-form__row_with-submit':'']});_0x11b4e5&&_0x157784['children']['add'](_0x11b4e5),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai_review__form-item','ck-reset_all']},'children':[_0x157784]});}['resetToDefault'](){this['_formItem']['resetToDefault']();}}class po extends _0x380d9b{['keystrokes'];static ['MIN_ROWS']=0x1;static ['MAX_ROWS']=0xc;constructor(_0x1dc915){super(_0x1dc915),this['set']('isEmpty',!0x0),this['keystrokes']=new _0x407d91(),this['minRows']=po['MIN_ROWS'],this['maxRows']=po['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 rc extends _0x1f054a{['focusTracker']=new _0x50d771();['keystrokes']=new _0x407d91();['focusCycler'];['_focusables']=new _0x44a698();['submitButtonView'];['cancelButtonView'];['promptInputView'];['actionsFooterView'];['_modelSelectionDropdown'];['_modelNameView'];['_modelSelectionDropdownItems'];['_check'];['_defaultValue'];['_defaultLabel'];constructor(_0x18a7f4,_0x2025f3,_0x70aa6b=!0x1){super(_0x18a7f4),this['_check']=_0x2025f3,this['set']('prompt',''),this['set']('modelId',''),this['set']('modelDisplayMode','selector'),this['set']('activeModelName',null),this['_defaultValue']=_0x2025f3['defaultModel']?_0x2025f3['defaultModel']['id']:'',this['_defaultLabel']=_0x2025f3['defaultModel']?_0x2025f3['defaultModel']['name']:'',this['submitButtonView']=this['_createSubmitButtonView'](),this['cancelButtonView']=this['_createCancelButtonView'](),(this['promptInputView']=new _0x1e4591(this['locale'],()=>new po(_0x18a7f4)),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 _0x405f09(),this['_modelNameView']=this['_createModelNameView'](),this['_setModelList'](_0x70aa6b),_0x46fef8(this['_modelSelectionDropdown'],this['_modelSelectionDropdownItems']),this['actionsFooterView']=this['_createActionsFooterView'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-custom-actions']},'children':[new _0x57479f(this['locale'],{'children':[this['promptInputView']]}),new _0x57479f(this['locale'],{'children':[this['actionsFooterView']]})]}),this['promptInputView']['fieldView']['keystrokes']['set']('Enter',(_0x464402,_0x5588fc)=>{this['_isValid']()?(this['fire']('runReviewCheck',{'id':'custom','args':{'prompt':this['prompt'],'model':this['modelId']},'isCustom':!0x0}),_0x5588fc()):_0x5588fc();}),this['focusCycler']=new _0x18b3f0({'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'](_0xb9e4f7=>{this['_focusables']['add'](_0xb9e4f7),this['focusTracker']['add'](_0xb9e4f7['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 _0x46bcd8 of this['_getFormValidators']()){const _0x44543b=_0x46bcd8();if(_0x44543b)return this['promptInputView']['errorText']=_0x44543b,!0x1;}return!0x0;}['_getFormValidators'](){return[()=>{if(0x0===this['promptInputView']['fieldView']['value']?.['trim']()['length'])return h(this['locale'],'AI_REVIEW_MODE_PROMPT_EMPTY_ERROR');}];}['_createSubmitButtonView'](){const _0x4dbb87=new _0x1d1b95(this['locale']),t=this['locale']['t'];return _0x4dbb87['set']({'label':t('Submit'),'withText':!0x0,'class':'ck-ai-button-primary'}),_0x4dbb87['on']('execute',()=>{this['_isValid']()&&this['fire']('runReviewCheck',{'id':'custom','args':{'prompt':this['prompt'],'model':this['modelId']},'isCustom':!0x0});}),_0x4dbb87;}['_createCancelButtonView'](){const _0x5eeecf=new _0x1d1b95(this['locale']),t=this['locale']['t'];return _0x5eeecf['set']({'label':t('Cancel'),'withText':!0x0,'class':'ck-ai-button-tertiary'}),_0x5eeecf['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0xaa22e6=>{_0xaa22e6['stopPropagation']();})}}),_0x5eeecf['on']('execute',()=>{this['resetToDefault'](),this['fire']('closeCustomCheck');}),_0x5eeecf;}['_setModelList'](_0x42d51e){this['_modelSelectionDropdownItems']['clear']();const _0x1025e0=this['_check']['models'];if(_0x42d51e)this['set']('modelDisplayMode','hidden');else{const _0x591c98=0x1===_0x1025e0['length'];this['set']('modelDisplayMode',_0x591c98?'name':'selector');}if(this['resetToDefault'](),_0x1025e0?.['length']){0x1===_0x1025e0['length']&&this['set']('activeModelName',_0x1025e0[0x0]['name']||_0x1025e0[0x0]['id']);for(const _0x2d51ce of _0x1025e0){const _0x33f454=new _0x53ecce({'label':_0x2d51ce['name'],'withText':!0x0,'role':'menuitemradio','id':_0x2d51ce['id'],'model':_0x2d51ce});_0x33f454['bind']('isOn')['to'](this,'modelId',_0x186cf5=>_0x186cf5===_0x2d51ce['id']),this['_modelSelectionDropdownItems']['add']({'type':'button','model':_0x33f454,'labelView':new ko(this['locale'],_0x2d51ce)});}}}['_createModelSelectionDropdown'](){const _0x41db80=_0x290605(this['locale']);return _0x41db80['set']({'panelPosition':'se','class':'ck-ai_review__check-list-item-model-dropdown'}),_0x41db80['buttonView']['set']({'label':this['_defaultLabel'],'withText':!0x0,'tooltip':!0x0}),_0x41db80['buttonView']['bind']('isVisible')['to'](this,'modelDisplayMode',_0x20db49=>'selector'===_0x20db49),this['listenTo'](_0x41db80,'execute',_0xfdbb23=>{this['modelId']=_0xfdbb23['source']['model']['id'],_0x41db80['buttonView']['label']=_0xfdbb23['source']['label'];}),_0x41db80;}['_createModelNameView'](){const _0x13a22d=new _o(this['locale']);return _0x13a22d['bind']('text')['to'](this,'activeModelName',_0x4aabdd=>_0x4aabdd??''),_0x13a22d['bind']('isVisible')['to'](this,'modelDisplayMode',_0x1f7ecf=>'name'===_0x1f7ecf),_0x13a22d;}['_createActionsFooterView'](){const _0x5983b4=new _0x1f054a(this['locale']);return _0x5983b4['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']]}]}),_0x5983b4;}}class _o extends _0x1f054a{constructor(_0x62fe34){super(_0x62fe34),this['set']('text',void 0x0),this['set']('isVisible',!0x0);const _0x9a9b7f=this['bindTemplate'];this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai_review__check-list-item-model-name',_0x9a9b7f['if']('isVisible','ck-hidden',_0x88c9b7=>!_0x88c9b7)]},'children':[{'text':_0x9a9b7f['to']('text')}]});}}class ko extends _0x34171b{constructor(_0x2f87b2,_0x49bd1c){super();const _0x2c17e1=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-button__label'],'style':_0x2c17e1['to']('style'),'id':_0x2c17e1['to']('id')},'children':[{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-model-dropdown-name']},'children':[{'tag':'span','children':[{'text':_0x2c17e1['to']('text')}]}]},{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-model-dropdown-description']},'children':[{'tag':'span','children':[_0x49bd1c['description']||'']}]}]});}}class ic extends _0x2a0bb9{['_formItemsCollection']=new _0x44a698();['_customCheckView']=null;['_hideModels']=!0x1;constructor(_0xcfc409,_0x18e7fd,_0x4269a1,_0x12c906=!0x1){super(_0xcfc409),this['_hideModels']=_0x12c906,this['set']('isParametrizedViewOpen',!0x1),this['set']('isListItemRendered',!0x1),this['set']('isItemParametrized',_0x18e7fd['isParameterized']);const _0x2fcc5f=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',_0x20244b=>_0x20244b),this['bindTemplate']['if']('isListItemRendered','ck-ai_review__check-list-item_rendered',_0x51c955=>_0x51c955)],'style':{'--ck-ai-review-check-list-item-index':_0x4269a1}},'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':_0x18e7fd['title']}]},_0x2fcc5f]},{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-description']},'children':_0x18e7fd['description']?[{'text':_0x18e7fd['description']}]:[]}]}]},..._0x18e7fd['isParameterized']?[this['_createParameterizedView'](_0x18e7fd)]:[],...'custom'===_0x18e7fd['id']?[this['_createCustomView'](_0x18e7fd,this['_hideModels'])]:[]]}),this['on']('click',()=>{_0x18e7fd['isParameterized']?this['isParametrizedViewOpen']=!0x0:this['fire']('runReviewCheck',{'id':_0x18e7fd['id'],'args':_0x18e7fd['useArgs']?_0x18e7fd['args']:void 0x0});}),requestAnimationFrame(()=>{this['isListItemRendered']=!0x0;});}['render'](){super['render'](),this['isItemParametrized']&&_0x1d6ed3({'emitter':this,'activator':()=>!0x0===this['isParametrizedViewOpen'],'contextElements':[this['element']],'callback':()=>{this['isParametrizedViewOpen']=!0x1;}});}['resetToDefault'](){this['isParametrizedViewOpen']=!0x1,this['_formItemsCollection']['forEach'](_0x3864d3=>{_0x3864d3['resetToDefault']();}),this['_customCheckView']&&this['_customCheckView']['resetToDefault']();}['_createIconView'](){const _0x2696c3=new _0x152087();return _0x2696c3['content']=_0x2a08e8,_0x2696c3['extendTemplate']({'attributes':{'class':['ck-ai_review__check-list-item-title-icon']}}),_0x2696c3;}['_createParameterizedView'](_0x83cb93){const _0x58853f=new _0x1f054a(),_0x2396ee=this['_createFormView'](_0x83cb93);return _0x58853f['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-parameterized',this['bindTemplate']['if']('isParametrizedViewOpen','ck-hidden',_0xcdfc9f=>!_0xcdfc9f)]},'children':[_0x2396ee]}),_0x58853f;}['_createFormView'](_0x236788){const _0x13bd75=new _0x1f054a(),_0x489513=Array['isArray'](_0x236788['options'])?_0x236788['options']:[],_0x54817e=new _0x1d1b95(this['locale']),t=this['locale']['t'];_0x54817e['set']({'label':t('Submit'),'withText':!0x0,'class':'ck-ai-button-primary'}),_0x54817e['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x1e8e86=>{_0x1e8e86['stopPropagation']();})}}),_0x54817e['on']('execute',()=>{const _0x559d5b=[],_0x594f74={};this['_formItemsCollection']['forEach'](_0x2a3fdb=>{_0x559d5b['push'](_0x2a3fdb['value']),_0x236788['useArgs']&&_0x236788['options']&&(_0x594f74[_0x2a3fdb['argsKey']]=_0x2a3fdb['value']);}),this['fire']('runReviewCheck',{'id':_0x236788['id'],'params':_0x559d5b['length']?_0x559d5b:void 0x0,'args':Object['keys'](_0x594f74)['length']?_0x594f74:void 0x0});});const _0x51a2db=_0x489513['length'];return _0x489513['forEach']((_0x3fde6c,_0x2da00d)=>{const _0x130451=_0x2da00d===_0x51a2db-0x1;this['_formItemsCollection']['add'](new cc(this['locale'],_0x3fde6c,_0x130451?_0x54817e:null));}),_0x13bd75['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-parameterized-form']},'children':this['_formItemsCollection']}),_0x13bd75;}['_createCustomView'](_0x5e0f45,_0x549f5a=!0x1){return this['_customCheckView']=new rc(this['locale'],_0x5e0f45,_0x549f5a),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',_0x3e0836=>!_0x3e0836)]}}),this['_customCheckView']['delegate']('runReviewCheck')['to'](this),this['listenTo'](this['_customCheckView'],'closeCustomCheck',()=>{this['isParametrizedViewOpen']=!0x1;}),this['on']('change:isParametrizedViewOpen',(_0x36dd23,_0xd24aae,_0x13df94)=>{_0x13df94||this['_customCheckView']['resetFormValidationStatus']();}),this['_customCheckView'];}}class je extends _0x2a0bb9{['_checkViews'];constructor(_0x34b76b){super(_0x34b76b),this['_checkViews']=new _0x44a698(),this['_setupTemplate']();}['setChecks'](_0x57146d,_0x80560f=!0x1){this['_checkViews']['clear']();for(const [_0x3ba20f,_0x559e9c]of _0x57146d['entries']()){const _0x4dfbe5=new ic(this['locale'],_0x559e9c,_0x3ba20f,_0x80560f);_0x4dfbe5['delegate']('runReviewCheck')['to'](this),this['_checkViews']['add'](_0x4dfbe5);}}['hasChecks'](){return this['_checkViews']['length']>0x0;}['resetAllParameterizedChecks'](){for(const _0x21673d of this['_checkViews'])_0x21673d instanceof ic&&_0x21673d['resetToDefault']();}['_setupTemplate'](){const _0x395f92=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list',_0x395f92['if']('isVisible','ck-hidden',_0x4e56f1=>!_0x4e56f1)]},'children':this['_checkViews']});}}class ge extends Me{static get['pluginName'](){return'AIReviewModeUI';}['createMainView'](){const _0x2a930d=this['context']['locale'],_0x3cf04f=new _0x337d54(_0x2a930d,{'label':h(_0x2a930d,'AI_REVIEW_MODE'),'icon':_0x31c506,'class':'ck-ai-header\x20ck-ai-header_review'});return new Ae(this['context']['locale'],{'header':_0x3cf04f,'list':new je(_0x2a930d),'results':new Ve(_0x2a930d,{'generalErrorText':h(_0x2a930d,'AI_REVIEW_MODE_GENERAL_ERROR_MESSAGE')}),'completed':new be(_0x2a930d,{'headerText':h(_0x2a930d,'AI_REVIEW_MODE_FINISH_REVIEW_HEADER_TITLE'),'emptyResultsText':h(_0x2a930d,'AI_REVIEW_MODE_EMPTY_RESULTS_TEXT'),'buttonText':h(_0x2a930d,'AI_REVIEW_MODE_FINISH_REVIEW_BUTTON_LABEL')})});}['registerTab'](){const _0x49c26f=this['context']['plugins']['get']('AITabs');_0x49c26f['view']['on']('activateTab',(_0x435ea9,_0x45bc3f)=>{'reviewMode'===_0x45bc3f?this['fire']('getReviewCheckList'):this['fire']('leaveReview');}),_0x49c26f['view']['addTab']({'id':'reviewMode','buttonLabel':h(this['context']['locale'],'AI_REVIEW_MODE'),'buttonIcon':_0x31c506,'order':0x0,'content':this['_mainView']});}}const fe='review-';class de extends _0x5dcf5b{static get['requires'](){return[ot,s];}static get['pluginName'](){return'AIReviewCoreEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['_markers']=new Map();['_activeMarkers']=new Set();['_domEmitter'];['_eventEmitter'];constructor(_0x25164a){super(_0x25164a),this['_domEmitter']=new(_0x30e617())(),this['_eventEmitter']=new(_0xa7ecb2())();}get['emitter'](){return this['_eventEmitter'];}['afterInit'](){const _0x390669=c(this['context']);_0x390669['conversion']['for']('editingDowncast')['markerToElement']({'model':fe+'insert','view':(_0xa42dfa,{writer:_0x251ba2})=>{const _0x1d1b86=this['_markers']['get'](_0xa42dfa['markerName']),_0x32e34b={'class':'ck-ai_review-marker_add'+(this['_activeMarkers']['has'](_0x1d1b86?.['id']||'')?'\x20ck-ai_review__change_active':''),'data-marker-id':_0xa42dfa['markerName']};return _0x251ba2['createUIElement']('span',_0x32e34b,function(_0x38edf3){const _0x313153=this['toDomElement'](_0x38edf3);return _0x313153['innerHTML']=_0x1d1b86?.['content']?.['asString']||'',_0x313153;});}}),_0x390669['conversion']['for']('editingDowncast')['markerToHighlight']({'model':fe+'remove-only','view':_0x1582a1=>{const _0x44e8a2=this['_markers']['get'](_0x1582a1['markerName']),_0x34bed4=['ck-ai_review-marker_strikethrough'];return this['_activeMarkers']['has'](_0x44e8a2?.['id']||'')&&_0x34bed4['push']('ck-ai_review__change_active'),{'classes':_0x34bed4,'attributes':{'data-marker-id':_0x1582a1['markerName']}};}}),_0x390669['conversion']['for']('editingDowncast')['markerToHighlight']({'model':fe+'remove-context','view':_0x5ccf3d=>{const _0x4abef7=this['_markers']['get'](_0x5ccf3d['markerName']),_0x31528a=['ck-ai_review-marker_underline'];return this['_activeMarkers']['has'](_0x4abef7?.['id']||'')&&_0x31528a['push']('ck-ai_review__change_active'),{'classes':_0x31528a,'attributes':{'data-marker-id':_0x5ccf3d['markerName']}};}}),_0x390669['conversion']['for']('editingDowncast')['markerToHighlight']({'model':fe+'remove-text','view':_0x580b37=>{const _0x3e6477=this['_markers']['get'](_0x580b37['markerName']),_0x27022c=['ck-ai_review-marker_hide'];return this['_activeMarkers']['has'](_0x3e6477?.['id']||'')&&_0x27022c['push']('ck-ai_review__change_active'),{'classes':_0x27022c,'attributes':{'data-marker-id':_0x580b37['markerName']}};}}),_0x390669['conversion']['for']('dataDowncast')['markerToElement']({'model':fe+'suggestion-context','view':(_0x55653d,{writer:_0x44a9d9})=>_0x44a9d9['createRawElement']('span',{'class':'ck-ai_review-marker_context-'+(_0x55653d['isOpening']?'start':'end')})}),_0x390669['conversion']['for']('downcast')['attributeToAttribute']({'model':nt,'view':_0xfbb69e});const _0x95a70a=_0x390669['ui']['getEditableElement']()||document['body'];this['_domEmitter']['listenTo'](_0x95a70a,'mouseup',(_0x2e65c9,_0x3a14e4)=>{const _0x38f3c2=_0x3a14e4['target'],_0x48505e=this['_findMarkerElement'](_0x38f3c2);if(!_0x48505e)return;const _0x5716ce=_0x48505e['getAttribute']('data-marker-id'),_0x45e122=_0x5716ce['split'](':')['pop']()?.['split']('_')[0x0];this['_eventEmitter']['fire']('changeMarkerClicked',{'markerId':_0x5716ce,'changeId':_0x45e122,'markerElement':()=>this['_findMarkerElementById'](_0x5716ce),'domEvent':_0x3a14e4});},{'usePassive':!0x0,'priority':'highest'}),this['_domEmitter']['listenTo'](_0x95a70a,'mouseover',(_0x4baff5,_0x32890f)=>{const _0x1c8b4d=_0x32890f['target'],_0xfb7eef=_0x32890f['relatedTarget'];let _0x1435db=this['_findMarkerElement'](_0x1c8b4d);if(!_0x1435db&&_0xfb7eef&&(_0x1435db=this['_findMarkerElement'](_0xfb7eef)),!_0x1435db)return;const _0x5b17ff=_0x1435db['getAttribute']('data-marker-id'),_0x55fd00=_0x5b17ff['split'](':')['pop']()?.['split']('_')[0x0];this['_eventEmitter']['fire']('changeMarkerHovered',{'changeId':_0x55fd00,'markerElement':()=>this['_findMarkerElementById'](_0x5b17ff),'domEvent':_0x32890f});}),this['_domEmitter']['listenTo'](document,'mouseover',_0x21c87d((_0x5037d6,_0x3c60a5)=>{const _0x491f2c=_0x3c60a5['target'];if(this['_findMarkerElement'](_0x491f2c))return;_0x491f2c['closest']('.ck-reset.ck-ai_review-balloon-panel-suggestion')||this['_eventEmitter']['fire']('changeMarkerBlurred');},0xc8)),_0x390669['model']['document']['registerPostFixer'](_0x2faf64=>this['_validateMarkers'](_0x390669,_0x2faf64)),_0x390669['model']['document']['on']('change',()=>this['_handleMarkerChanges'](_0x390669));}['getDocumentData'](){const _0xf88105=this['context']['plugins']['get']('AIEditing'),_0x24d1df=c(this['context']),_0x5cb57b=_0x24d1df['model'],_0x31c3aa=new jt();for(const _0x11279d of _0x5cb57b['document']['getRoot']()['getChildren']()){const _0x10c0a0=_0x11279d['_clone'](!0x0);_0x31c3aa['_appendChild'](_0x10c0a0);}for(const _0x5d77c0 of _0x5cb57b['markers'])_0x31c3aa['markers']['set'](_0x5d77c0['name'],this['_changeRangeOwnerDocument'](_0x5d77c0['getRange']()['clone'](),_0x31c3aa));const _0x16c62b=new _0x31a869({'ignoreElementEnd':!0x0,'startPosition':_0x5cb57b['createPositionAt'](_0x31c3aa,0x0)}),_0x1c3ff4=new Set(),_0x1c5674=new Map();for(const {item:_0xf98628}of _0x16c62b){if(!_0xf98628['is']('$textProxy'))continue;const _0x2dfedd=_0xf98628['parent'];if(_0x2dfedd&&_0x2dfedd['is']('element')){const _0x4f666a=this['_upsertDataId'](_0x2dfedd,()=>_0xf88105['_nextDataId'](_0x1c3ff4));_0x1c3ff4['add'](_0x4f666a);for(const _0xfd4ee1 of _0x2dfedd['getChildren']())_0xfd4ee1['is']('element')&&_0x1c3ff4['add'](this['_upsertDataId'](_0xfd4ee1,()=>_0xf88105['_nextDataId'](_0x1c3ff4)));let _0x49c68d=_0x2dfedd;for(;_0x49c68d['parent']&&!_0x49c68d['parent']['is']('documentFragment');)_0x49c68d=_0x49c68d['parent'],_0x49c68d['hasAttribute'](nt)&&_0x49c68d['_removeAttribute'](nt);_0x1c5674['set'](_0x4f666a,{'path':_0x2dfedd['getPath'](),'getContent':this['_createGetContentUsingDataIdFn'](_0x49c68d['_clone'](!0x0),_0x4f666a,_0x24d1df['data'])}),_0x16c62b['jumpTo'](_0x5cb57b['createPositionAfter'](_0x2dfedd));}}return{'content':_0x24d1df['data']['processor']['toData'](_0x24d1df['data']['toView'](_0x31c3aa)),'version':_0x24d1df['model']['document']['version'],'elements':_0x1c5674};}['diffContent'](_0x5f0244,_0xde390f,_0xb0d895=!0x1){const _0x2f4bc0=[],_0x37bae8=c(this['context']),_0x475be5=_0x37bae8['data']['parse'](_0xde390f,'$documentFragment'),_0x26172c=_0x37bae8['data']['parse'](_0x5f0244,'$documentFragment'),_0x5a0fa0=_0x37bae8['model']['createPositionAt'](_0x26172c,0x0);if(this['_haveSingleTopLevelElement'](_0x475be5)){if(!this['_hasSameTopLevelElement'](_0x26172c,_0x475be5))return _0x2f4bc0;}else{const _0x46b973=_0x37bae8['model']['schema'];if(!this['_haveOnlyInlineContent'](_0x26172c,_0x46b973)||!this['_haveOnlyInlineContent'](_0x475be5,_0x46b973))return _0x2f4bc0;}const _0x50dfc1=this['context']['plugins']['get']('DocumentCompare')['getDiff'](_0x5f0244,_0xde390f,{'anchor':_0x5a0fa0,'markDeletions':!0x0})['getOperations']()['filter'](_0x29f181=>'insert'===_0x29f181['type']||'marker'===_0x29f181['type']&&_0x29f181['name']['startsWith']('$markedRemove')),_0x56a691=this['_groupAdjacentOperations'](_0x50dfc1),_0x4e65e6=[];if(_0xb0d895){if(_0x56a691['length']){const _0x36a6b5=_0x56a691[0x0]['operations'][0x0],_0x46728d='insert'===_0x36a6b5['type']?_0x36a6b5['position']:_0x36a6b5['newRange']['start'],_0x282ccd=this['_getPositionLimitingRange'](_0x46728d,_0x37bae8,'inside'),_0x5e907c=_0x282ccd?_0x475be5['getChild'](0x0)['getChildren']():_0x475be5['getChildren'](),_0x42cb96=_0x282ccd||_0x37bae8['model']['createRangeIn'](_0x26172c),_0xac0077=[new _0x1c5019('$markedRemove:synthetic'+_0x677d44(),null,_0x42cb96,_0x37bae8['model']['document']['model']['markers'],!0x0,_0x37bae8['model']['document']['version']+0x1),new _0x23db8e(_0x42cb96['end'],_0x5e907c,_0x37bae8['model']['document']['version']+0x2)];_0x4e65e6['push']({'operations':_0xac0077,'operationsIsolated':_0xac0077,'groupOffset':0x0});}}else _0x4e65e6['push'](..._0x56a691);let _0x2f2ece=0x0;return _0x37bae8['model']['change'](_0x3d0c6a=>{for(let _0x5cf3ac=0x0;_0x5cf3ac<_0x4e65e6['length'];_0x5cf3ac++){const _0x187164=_0x4e65e6[_0x5cf3ac],_0x528570=_0x3d0c6a['createDocumentFragment']();for(const _0x444d27 of _0x26172c['getChildren']())_0x3d0c6a['append'](_0x444d27['_clone'](!0x0),_0x528570);for(const _0x131092 of _0x187164['operationsIsolated'])if('insert'===_0x131092['type']){const _0x2acc7d=_0x131092;_0x2acc7d['baseVersion']=null,_0x2acc7d['isDocumentOperation']=!0x1,this['_changeOperationOwnerDocument'](_0x2acc7d,_0x528570),_0x3d0c6a['batch']['addOperation'](_0x131092),_0x37bae8['model']['applyOperation'](_0x131092);const _0x5eb7f2='suggestion:insertion:id:authorId:'+_0x2f2ece++,_0x1ba11b=_0x37bae8['model']['createRange'](_0x2acc7d['position'],_0x2acc7d['position']['getShiftedBy'](_0x2acc7d['howMany']));_0x528570['markers']['set'](_0x5eb7f2,_0x1ba11b);}else{if('marker'===_0x131092['type']&&_0x131092['name']['startsWith']('$markedRemove')){const _0xe1af52=_0x131092,_0x5b0089='suggestion:deletion:id:authorId:'+_0x2f2ece++;this['_changeOperationOwnerDocument'](_0xe1af52,_0x528570),_0x528570['markers']['set'](_0x5b0089,_0xe1af52['newRange']);}}if(_0xb0d895)_0x2f4bc0['push']({..._0x187164,'context':this['_createGetContentFn'](_0x26172c,_0x37bae8['data']),'content':this['_createGetContentFn'](_0x26172c,_0x37bae8['data'])});else{const _0x49ec7a=this['_getChangeContext'](this['_changePositionOwnerDocument'](this['_getOperationStart'](_0x187164['operationsIsolated'][0x0]),_0x528570),this['_changePositionOwnerDocument'](this['_getOperationEnd'](_0x187164['operationsIsolated'][_0x187164['operationsIsolated']['length']-0x1]),_0x528570));_0x528570['markers']['set'](fe+'suggestion-context',new dt(_0x49ec7a['start'],_0x49ec7a['end'])),_0x2f4bc0['push']({..._0x187164,'context':this['_createGetContextFn'](_0x528570,_0x37bae8['data'],{'ellipsisBefore':_0x49ec7a['hasContentBefore'],'ellipsisAfter':_0x49ec7a['hasContentAfter']}),'content':this['_createGetContentFn'](_0x528570,_0x37bae8['data'])});}}}),_0x2f4bc0;}['markChangePositionInEditorContent'](_0x32682b,_0x21a887){if(!_0x32682b['length'])return;const _0x58d133=_0x32682b[0x0]['parent']['id'],_0x3f949b=_0x21a887['elements']['get'](_0x58d133);if(!_0x3f949b)return void console['warn']('No\x20element\x20found\x20for\x20ID:\x20'+_0x58d133);const _0x4cfeb7=_0x3f949b['path'],_0x1a138f=c(this['context']),_0x3f1798=_0x1a138f['model']['document']['history']['getOperations'](_0x21a887['version']),_0x3a6f2c=[];for(const _0x237484 of _0x32682b){const _0x51b70f=_0x237484['operationsIsolated']['map'](_0x2d6912=>this['_translateOperationToEditorContent'](_0x2d6912,_0x4cfeb7,_0x1a138f['model']['document']['getRoots']()[0x0]));if(!_0x51b70f||!_0x51b70f['length'])continue;const _0x5716b9=_0x51b70f['every'](_0xc85055=>'marker'===_0xc85055['type']&&_0xc85055['name']['startsWith']('$markedRemove')),_0x3459b0={'document':_0x1a138f['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1},_0x56f78c=xt(_0x51b70f,_0x3f1798,_0x3459b0)['operationsA'];for(const _0x23ad97 of _0x56f78c)if('insert'===_0x23ad97['type']){const _0x1aef0f=_0x23ad97,_0x7c2396=_0x1aef0f['nodes'];_0x1a138f['model']['change'](_0x5dee83=>{const _0x2cbd48=_0x5dee83['createDocumentFragment']();for(const _0x48e20e of _0x7c2396)_0x5dee83['append'](_0x48e20e['_clone'](!0x0),_0x2cbd48);_0x3a6f2c['push']({'start':_0x1aef0f['position'],'end':_0x1aef0f['position'],'type':'insert','groupId':_0x237484['id'],'content':{'asString':this['_createGetContentFn'](_0x2cbd48,_0x1a138f['data'])(),'asFragment':_0x2cbd48}});});}else{if('marker'===_0x23ad97['type']&&_0x23ad97['name']['startsWith']('$markedRemove')){const _0x16d940=_0x23ad97;let _0x2a8b85='remove-text';if(_0x5716b9){const _0x551168=this['_findAdjacentContextDistance'](_0x16d940['newRange']['start'],'backward',_0x1a138f['model']['schema']),_0xb99d1d=this['_findAdjacentContextDistance'](_0x16d940['newRange']['end'],'forward',_0x1a138f['model']['schema']);if(_0x551168||_0xb99d1d){const _0x5b169d=_0x16d940['newRange']['start']['getShiftedBy'](-_0x551168),_0x393eff=_0x16d940['newRange']['end']['getShiftedBy'](_0xb99d1d);_0x3a6f2c['push']({'start':_0x5b169d,'end':_0x393eff,'groupId':_0x237484['id'],'type':'remove-context'});}else _0x2a8b85='remove-only';}_0x3a6f2c['push']({'start':_0x16d940['newRange']['start'],'end':_0x16d940['newRange']['end'],'groupId':_0x237484['id'],'type':_0x2a8b85});}}}this['_insertMarkers'](_0x3a6f2c);}['clearAllMarkers'](){const _0x274692=c(this['context']);_0x274692['model']['change'](_0x18d084=>{for(const _0x474917 of this['_markers']['keys']())_0x274692['model']['markers']['get'](_0x474917)&&_0x18d084['removeMarker'](_0x474917);}),this['_markers']['clear'](),this['_activeMarkers']['clear']();}['switchToReadOnly'](){c(this['context'])['enableReadOnlyMode']('ai-review');}['switchToEdit'](){c(this['context'])['disableReadOnlyMode']('ai-review');}['applyChange'](_0x1e7bb6){const _0x32707d=c(this['context']),_0x581f7b=_0x32707d['model'],_0x2b6def=_0x1e7bb6['map'](_0x203082=>this['_getMarkersDataForGroup'](_0x203082))['flat']();_0x581f7b['change'](_0x2b0b21=>{for(const _0x5eb20c of _0x2b6def){const _0x20f0c2=_0x32707d['model']['markers']['get'](_0x5eb20c['id']);if(_0x20f0c2){if('insert'===_0x5eb20c['type']){if(!_0x5eb20c['content'])continue;_0x581f7b['insertContent'](_0x5eb20c['content']['asFragment']||null,_0x20f0c2['getRange']()['start']);}else'remove-text'!==_0x5eb20c['type']&&'remove-only'!==_0x5eb20c['type']||_0x581f7b['deleteContent'](_0x581f7b['createSelection'](_0x20f0c2['getRange']()));_0x2b0b21['removeMarker'](_0x5eb20c['id']),this['_markers']['delete'](_0x5eb20c['id']);}}});}['rejectChange'](_0x139808){const _0x23e202=c(this['context']),_0x69c4b=this['_getMarkersDataForGroup'](_0x139808);_0x23e202['model']['change'](_0x42dd93=>{for(const _0x343b02 of _0x69c4b)_0x42dd93['removeMarker'](_0x343b02['id']),this['_markers']['delete'](_0x343b02['id']);});}['getEditor'](){return c(this['context']);}['getMarkerElementForChange'](_0x1aeda9){const _0xdbedc5=Array['from'](this['_markers']['values']())['filter'](_0x3e59a4=>_0x3e59a4['groupId']===_0x1aeda9);if(!_0xdbedc5['length'])return null;const _0x2df0ec=0x1===_0xdbedc5['length']?_0xdbedc5[0x0]:this['_sortMarkers'](_0xdbedc5)[0x0],_0x19c53f=c(this['context'])['model']['markers']['get'](_0x2df0ec['id']);if(!_0x19c53f)return null;return{'modelRange':_0x19c53f['getRange'](),'getElement':()=>this['_findMarkerElementById'](_0x2df0ec['id'])};}['getContentElementForChange'](_0x1ffb2d){const _0x316317=Array['from'](this['_markers']['values']())['filter'](_0x520696=>_0x520696['groupId']===_0x1ffb2d);if(!_0x316317['length'])return null;const _0x504f3b=0x1===_0x316317['length']?_0x316317[0x0]:this['_sortMarkers'](_0x316317)[0x0],_0x2678d8=c(this['context']),_0x2782db=_0x2678d8['model']['markers']['get'](_0x504f3b['id']);if(!_0x2782db)return null;const _0x497df0=_0x2782db['getRange'](),_0x3394e5=_0x2678d8['editing']['view']['getDomRoot']();if(!_0x3394e5||!_0x497df0)return null;let _0x1047d2=_0x497df0['start']['parent'];for(;_0x1047d2['parent']&&'$root'!==_0x1047d2['parent']['name'];)_0x1047d2=_0x1047d2['parent'];if(!_0x1047d2||!_0x1047d2['name'])return null;const _0x13a716=_0x3394e5['querySelector']('[data-marker-id=\x22'+_0x504f3b['id']+'\x22]');if(!_0x13a716)return null;let _0x384278=null;_0x2678d8['model']['change'](_0x215a73=>{_0x384278=_0x215a73['createDocumentFragment'](),_0x215a73['append'](_0x1047d2['_clone'](!0x0),_0x384278);});const _0x4f031c=_0x2678d8['data']['toView'](_0x384278)['getChild'](0x0);return _0x13a716['closest'](_0x4f031c['name']);}['reactivateMarkers'](_0x431a1d){const _0x27a58b=this['_getMarkersDataForGroup'](_0x431a1d);if(!_0x27a58b['length'])return;const _0xddf46a=Array['from'](this['_activeMarkers'])['sort'](),_0x1f74b4=Array['from'](new Set(_0x27a58b['map'](_0x2f4fe6=>_0x2f4fe6['id'])))['sort']();_0xddf46a['join']('|')!==_0x1f74b4['join']('|')&&(this['setAllMarkersAsInactive'](),this['setMarkersInElementAsActive'](_0x431a1d));}['setMarkersInElementAsActive'](_0xbbd307){const _0x41d1b0=this['_getMarkersDataForGroup'](_0xbbd307);if(!_0x41d1b0['length'])return;const _0xa2618e=c(this['context']),_0x10918f=new Set(_0x41d1b0['map'](_0x5be085=>_0x5be085['id'])),_0x5f4ddd=Array['from'](_0x10918f['values']())['map'](_0x2c7c7e=>_0xa2618e['model']['markers']['get'](_0x2c7c7e))['filter'](_0xdc81be=>!!_0xdc81be);_0x10918f['forEach'](_0x49c276=>{this['_activeMarkers']['add'](_0x49c276);}),_0xa2618e['model']['change'](()=>{_0x5f4ddd['forEach'](_0x6a4607=>{_0xa2618e['editing']['reconvertMarker'](_0x6a4607);});});}['setAllMarkersAsInactive'](){const _0x28d14c=Array['from'](this['_activeMarkers']);if(!_0x28d14c['length'])return;this['_activeMarkers']['clear']();const _0x83a11d=c(this['context']),_0x39202a=_0x28d14c['map'](_0x4baf8f=>_0x83a11d['model']['markers']['get'](_0x4baf8f))['filter'](_0x37696a=>!!_0x37696a);_0x83a11d['model']['change'](()=>{_0x39202a['forEach'](_0x1922cb=>{_0x83a11d['editing']['reconvertMarker'](_0x1922cb);});});}['_getPositionLimitingRange'](_0x47329a,_0x164053,_0x237b39='outside'){if(!_0x47329a)return null;let _0x3927f5=_0x47329a['parent'];for(;_0x3927f5&&_0x3927f5['parent']&&'$root'!==_0x3927f5['parent']['name']&&!_0x164053['model']['schema']['isLimit'](_0x3927f5)&&!_0x164053['model']['schema']['isBlock'](_0x3927f5);)_0x3927f5=_0x3927f5['parent'];if(!_0x3927f5||!_0x3927f5['name']||'$root'===_0x3927f5['name'])return null;let _0x33702f=null;return _0x164053['model']['change'](_0x2a9d41=>{_0x33702f='inside'===_0x237b39?_0x2a9d41['createRangeIn'](_0x3927f5):_0x2a9d41['createRangeOn'](_0x3927f5);}),_0x33702f;}['_validateMarkers'](_0x427062,_0x562bd9){const _0x5ab0b1=Array['from'](this['_markers']['keys']()),_0x5a0990=new Map();for(const _0x188adf of _0x5ab0b1){const _0x42b62a=_0x427062['model']['markers']['get'](_0x188adf);if(!_0x42b62a)continue;const _0x3e59bf=_0x42b62a['getStart']()['path'][0x0];_0x5a0990['has'](_0x3e59bf)||_0x5a0990['set'](_0x3e59bf,[]),_0x5a0990['get'](_0x3e59bf)['push'](_0x42b62a);}const _0x24a686=new Set();for(const _0x1ddd50 of _0x427062['model']['document']['differ']['getChanges']()){let _0xdbd78d=-0x1,_0x5c8005=null;if('insert'===_0x1ddd50['type'])_0x5c8005=new dt(_0x1ddd50['position'],_0x1ddd50['position']['getShiftedBy'](_0x1ddd50['length'])),_0xdbd78d=_0x1ddd50['position']['path'][0x0];else{if('remove'!==_0x1ddd50['type'])continue;_0x5c8005=new dt(_0x1ddd50['position']),_0xdbd78d=_0x1ddd50['position']['path'][0x0];}const _0x1a5041=_0x5a0990['get'](_0xdbd78d)||[];if(_0x1a5041['length']){for(const _0x332072 of _0x1a5041)if(_0x5c8005['root']['rootName']===_0x332072['getRange']()['root']['rootName']&&('insert'!==_0x1ddd50['type']||!_0x5c8005['containsRange'](_0x332072['getRange']()))&&(_0x5c8005['isIntersecting'](_0x332072['getRange']())||_0x5c8005['start']['isTouching'](_0x332072['getRange']()['end'])||_0x5c8005['end']['isTouching'](_0x332072['getRange']()['start']))){const _0x60818a=this['_parseMarkerName'](_0x332072['name']);Array['from'](this['_markers']['values']())['filter'](_0x677bde=>_0x677bde['groupId']===_0x60818a['groupId'])['forEach'](_0x4786e9=>_0x24a686['add'](_0x4786e9['id']));}}}if(_0x24a686['size']){for(const _0x686a54 of _0x24a686)_0x562bd9['removeMarker'](_0x686a54);return!0x0;}return!0x1;}['_handleMarkerChanges'](_0x189429){for(const {name:_0x1724bd,data:_0x162b6f}of _0x189429['model']['document']['differ']['getChangedMarkers']()){if(!_0x1724bd['startsWith'](fe))continue;const _0x103f54=_0x162b6f['oldRange'],_0x3cdd46=_0x162b6f['newRange'],_0x388b05=_0x103f54&&'$graveyard'===_0x103f54['root']['rootName'],_0x1e7298=_0x3cdd46&&'$graveyard'===_0x3cdd46['root']['rootName'];if(_0x388b05&&_0x1e7298)continue;const _0x3f8047=this['_parseMarkerName'](_0x1724bd);this['_markers']['get'](_0x1724bd)&&(_0x1e7298||!_0x3cdd46?this['_eventEmitter']['fire']('changeMarkerRemoved',{'markerId':_0x1724bd,'changeId':_0x3f8047['groupId']}):_0x388b05&&_0x3cdd46&&this['_eventEmitter']['fire']('changeMarkerRestored',{'markerId':_0x1724bd,'changeId':_0x3f8047['groupId']}));}}['_parseMarkerName'](_0x2e858e){const _0x47e7ea=_0x2e858e['split'](':'),_0x423108=(_0x47e7ea[0x1]||'')['split']('_');return{'prefix':_0x47e7ea[0x0],'groupId':_0x423108[0x0],'suffix':_0x423108[0x1]};}['_translateOperationToEditorContent'](_0x17f6bc,_0x46bfa3,_0xa8774){if('insert'===_0x17f6bc['type']){const _0xaa3c33=_0x17f6bc;return new _0x23db8e(this['_changePosition'](_0x46bfa3['concat'](_0xaa3c33['position']['offset']),_0xa8774),_0xaa3c33['nodes'],_0xaa3c33['baseVersion']);}if('marker'===_0x17f6bc['type']&&_0x17f6bc['name']['startsWith']('$markedRemove')){const _0x413c2f=_0x17f6bc;return new _0x1c5019(_0x413c2f['name'],_0x413c2f['oldRange'],this['_changeRange'](_0x413c2f['newRange'],_0x46bfa3['concat'](_0x413c2f['newRange']['start']['offset']),_0x46bfa3['concat'](_0x413c2f['newRange']['end']['offset']),_0xa8774),_0x413c2f['_markers'],_0x413c2f['affectsData'],_0x413c2f['baseVersion']);}return _0x17f6bc;}['_groupAdjacentOperations'](_0x1feda9){if(!_0x1feda9['length'])return[];const _0x45bc5d=[];let _0x46b2c9=0x0,_0x3d50dd=0x0,_0x5d0d6b=[];for(let _0x10b194=0x0;_0x10b194<=_0x1feda9['length'];_0x10b194++){const _0x385d4b=_0x1feda9[_0x10b194],_0x4d19ed=_0x1feda9[_0x10b194-0x1];!_0x385d4b||_0x4d19ed&&!this['_getOperationEnd'](_0x4d19ed)['isTouching'](this['_getOperationStart'](_0x385d4b))?(_0x45bc5d['push']({'operations':_0x5d0d6b,'operationsIsolated':_0x5d0d6b['map'](_0x312445=>this['_shiftOperation'](_0x312445['clone'](),-_0x3d50dd)),'groupOffset':_0x46b2c9}),_0x5d0d6b=_0x385d4b?[_0x385d4b]:[],_0x3d50dd+=_0x46b2c9,_0x46b2c9=0x0):_0x5d0d6b['push'](_0x385d4b),_0x385d4b&&'insert'===_0x385d4b['type']&&(_0x46b2c9+=_0x385d4b['howMany']);}return _0x45bc5d;}['_findAdjacentContextDistance'](_0x3a1655,_0x5f5648,_0x1cb66d,_0x4be503=0x1){const _0x2fda76=new _0x31a869({'startPosition':_0x3a1655,'direction':_0x5f5648});let _0x782404=0x0;for(let _0x219a93=0x0;_0x219a93<_0x4be503;_0x219a93++){let _0xbc2db0=0x0,_0x2db6fa=!0x1,_0x2f5d2a='forward'===_0x5f5648?/^\W*\w+/:/\w+\W*$/;for(const {item:_0x264a96}of _0x2fda76)if(_0x264a96['is']('$textProxy')){const _0x24e938=_0x2f5d2a['exec'](_0x264a96['data']);if(_0x24e938&&_0x24e938['length']){if(_0xbc2db0+='forward'===_0x5f5648?_0x24e938['index']+_0x24e938[0x0]['length']:_0x264a96['data']['length']-_0x24e938['index'],_0x24e938[0x0]['length']!==_0x264a96['data']['length'])break;_0x2db6fa=!0x0,_0x2f5d2a='forward'===_0x5f5648?/^\w+/:/\w+$/;}else{if(_0x2db6fa)break;_0xbc2db0+=_0x264a96['offsetSize'];}}else{if(_0x264a96['is']('element')){_0x1cb66d['isInline'](_0x264a96)&&!_0x2db6fa&&(_0xbc2db0+=0x1);break;}}_0x782404+=_0xbc2db0,_0x2fda76['jumpTo'](_0x3a1655['getShiftedBy']('forward'===_0x5f5648?_0x782404:-_0x782404));}return _0x782404;}['_getChangeContext'](_0x241d81,_0x3e3e3f){const _0xec4257=c(this['context'])['model']['schema'],_0x54f576=this['_findAdjacentContextDistance'](_0x241d81,'backward',_0xec4257,0x6),_0x55f2e8=this['_findAdjacentContextDistance'](_0x3e3e3f,'forward',_0xec4257,0x6),_0x2e9d5c=_0x241d81['getShiftedBy'](-_0x54f576),_0x18e18c=_0x3e3e3f['getShiftedBy'](_0x55f2e8);return{'start':_0x2e9d5c,'end':_0x18e18c,'hasContentBefore':!_0x2e9d5c['isAtStart'],'hasContentAfter':!_0x18e18c['isAtEnd']};}['_insertMarkers'](_0x764525){const _0xcb089c=this['context']['plugins']['get']('AIEditing'),_0x7f42d=new Set();c(this['context'])['model']['change'](_0x38f822=>{for(const _0x4ba34e of _0x764525){const _0x1303ff=''+fe+_0x4ba34e['type']+':'+_0x4ba34e['groupId']+'_'+_0xcb089c['_nextDataId'](_0x7f42d);this['_markers']['set'](_0x1303ff,{'id':_0x1303ff,'groupId':_0x4ba34e['groupId'],'type':_0x4ba34e['type'],'content':_0x4ba34e['content']}),_0x38f822['addMarker'](_0x1303ff,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x38f822['createRange'](_0x4ba34e['start'],_0x4ba34e['end'])});}});}['_createGetContextFn'](_0x2e4f66,_0x11c292,_0x3d36ea){let _0x1508fa='';return()=>{if(!_0x1508fa){const _0x19c3a3=_0x11c292['toView'](_0x2e4f66,{'showSuggestionHighlights':!0x0});let _0x2818bc=_0x19c3a3['getChild'](0x0);if(_0x2818bc['is']('containerElement')||(_0x2818bc=_0x19c3a3),!_0x2818bc)return'';let _0x2a6e2e=!0x1;const _0x3cb538=[];for(const _0x4b9e3c of _0x2818bc['getChildren']())_0x4b9e3c['is']('element','span')&&_0x4b9e3c['hasClass']('ck-ai_review-marker_context-end')&&(_0x2a6e2e=!0x1),_0x2a6e2e&&_0x3cb538['push'](_0x4b9e3c),_0x4b9e3c['is']('element','span')&&_0x4b9e3c['hasClass']('ck-ai_review-marker_context-start')&&(_0x2a6e2e=!0x0);_0x2818bc['_removeChildren'](0x0,_0x2818bc['childCount']),_0x3d36ea?.['ellipsisBefore']&&_0x2818bc['_appendChild']('…'),_0x2818bc['_appendChild'](_0x3cb538),_0x3d36ea?.['ellipsisAfter']&&_0x2818bc['_appendChild']('…');const _0x197e1a=_0x11c292['htmlProcessor']['domConverter']['viewToDom'](_0x19c3a3),_0xa06d0d=_0x11c292['htmlProcessor']['htmlWriter']['getHtml'](_0x197e1a);_0x1508fa=_0xa06d0d;}return _0x1508fa;};}['_createGetContentFn'](_0x8a8f2d,_0x3c74f8){let _0x1e317b='';return()=>(_0x1e317b||(_0x1e317b=_0x3c74f8['stringify'](_0x8a8f2d,{'showSuggestionHighlights':!0x0})),_0x1e317b);}['_createGetContentUsingDataIdFn'](_0x24903f,_0x5d414c,_0x381fd1){let _0xde5b85='';return()=>{if(!_0xde5b85){const _0xe6ee67=_0x381fd1['toView'](new jt(_0x24903f)),_0x43e4ee=_0x381fd1['htmlProcessor']['domConverter']['viewToDom'](_0xe6ee67)['querySelector']('[data-id=\x22'+_0x5d414c+'\x22]');_0xde5b85=_0x43e4ee?.['outerHTML']||'';}return _0xde5b85;};}['_findMarkerElement'](_0x4f77c1,_0x361012=0x5){let _0x2bec87=_0x4f77c1,_0x531992=null;for(let _0x52f09b=0x0;_0x52f09b<_0x361012&&_0x2bec87;_0x52f09b++){if(!_0x2bec87['className']){_0x2bec87=_0x2bec87['parentElement'];continue;}if(!(''+_0x2bec87['className'])['includes']('ck-ai_review-marker_')){_0x2bec87=_0x2bec87['parentElement'];continue;}if(!_0x2bec87['getAttribute']('data-marker-id'))break;_0x531992=_0x2bec87;break;}return _0x531992;}['_findMarkerElementById'](_0x257581){const _0x4aa751=c(this['context']),_0x3540fb=_0x4aa751['model']['markers']['get'](_0x257581);return _0x3540fb?_0x470cd1(_0x4aa751['editing'],_0x3540fb):null;}['_getMarkersDataForGroup'](_0x52f526){return Array['from'](this['_markers']['values']())['filter'](_0x1daea6=>_0x1daea6['groupId']===_0x52f526);}['_getOperationStart'](_0x298179){return'insert'===_0x298179['type']?_0x298179['position']:_0x298179['newRange']['start'];}['_getOperationEnd'](_0x34bfe6,_0x2e4300=!0x1){return'insert'===_0x34bfe6['type']?_0x2e4300?_0x34bfe6['position']:_0x34bfe6['position']['getShiftedBy'](_0x34bfe6['howMany']):_0x34bfe6['newRange']['end'];}['_shiftOperation'](_0x43f508,_0x4f4711){return'insert'===_0x43f508['type']?_0x43f508['position']=_0x43f508['position']['getShiftedBy'](_0x4f4711):'marker'===_0x43f508['type']&&_0x43f508['newRange']&&(_0x43f508['newRange']=new dt(_0x43f508['newRange']['start']['getShiftedBy'](_0x4f4711),_0x43f508['newRange']['end']['getShiftedBy'](_0x4f4711))),_0x43f508;}['_changeOperationOwnerDocument'](_0x5f57b1,_0x33774f){'insert'===_0x5f57b1['type']?_0x5f57b1['position']=this['_changePositionOwnerDocument'](_0x5f57b1['position'],_0x33774f):'marker'===_0x5f57b1['type']&&_0x5f57b1['newRange']&&(_0x5f57b1['newRange']=this['_changeRangeOwnerDocument'](_0x5f57b1['newRange'],_0x33774f));}['_changePositionOwnerDocument'](_0x470829,_0x3008a0){return new Dt(_0x3008a0,_0x470829['path']);}['_changeRangeOwnerDocument'](_0x2f4774,_0x466d1f){return new dt(this['_changePositionOwnerDocument'](_0x2f4774['start'],_0x466d1f),this['_changePositionOwnerDocument'](_0x2f4774['end'],_0x466d1f));}['_changePosition'](_0x440785,_0x44de7b){return new Dt(_0x44de7b,[..._0x440785]);}['_changeRange'](_0x5e1835,_0x108b95,_0x810d5c,_0x2836a8){return new dt(this['_changePosition'](_0x108b95,_0x2836a8),this['_changePosition'](_0x810d5c,_0x2836a8));}['_sortMarkers'](_0x2b9450){const _0x156acd=_0x534ca3=>{switch(_0x534ca3){case'insert':return 0x0;case'remove-context':return 0x1;case'remove-only':return 0x2;case'remove-text':return 0x3;}};return _0x2b9450['sort']((_0x2188ba,_0x2306a0)=>_0x156acd(_0x2188ba['type'])-_0x156acd(_0x2306a0['type']));}['_hasSameTopLevelElement'](_0x3096cf,_0xd9b219){const _0x911fd7=_0x3096cf['getChild'](0x0),_0x42a125=_0xd9b219['getChild'](0x0);return!(!_0x911fd7||!_0x42a125)&&((!_0x911fd7['is']('element')||!_0x42a125['is']('element')||_0x911fd7['name']===_0x42a125['name'])&&!(_0x911fd7['is']('element')&&!_0x42a125['is']('element')||!_0x911fd7['is']('element')&&_0x42a125['is']('element')));}['_haveSingleTopLevelElement'](_0x4683d2){return 0x1===_0x4683d2['childCount'];}['_haveOnlyInlineContent'](_0x500c31,_0x22b57b){for(const _0x3d4a1b of _0x500c31['getChildren']())if(_0x3d4a1b['is']('element')&&!_0x22b57b['isInline'](_0x3d4a1b))return!0x1;return!0x0;}['_upsertDataId'](_0x4caa3e,_0x18f55c){let _0x400f98=_0x4caa3e['getAttribute'](nt);return _0x400f98||(_0x400f98=_0x18f55c(),_0x4caa3e['_setAttribute'](nt,_0x400f98)),_0x400f98;}}class Zs extends _0xa7ecb2(){['id'];['contentNew'];['contentInitial'];['documentVersion'];constructor({id:_0x34f639,contentNew:_0x583af9,contentInitial:_0x765780,documentVersion:_0x5751a3}){super(),this['id']=_0x34f639,this['contentNew']=_0x583af9,this['contentInitial']=_0x765780,this['documentVersion']=_0x5751a3;}}class th extends ts(){['id'];['parent'];['_data'];['_editorOperations']=[];constructor(_0x240c22,_0x40f21f,_0x46d467){super(),this['id']=_0x240c22,this['parent']=_0x46d467,this['_data']=_0x40f21f,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 eh extends ts(){['id']=_0x677d44();['callId'];['_results']=new Map();['_changes']=[];['_sourceCheck'];['_documentData'];['_aiConnector'];['_reviewParams'];['_reviewArgs'];['_activeRequest']=null;['_currentError'];['_wasAborted']=!0x1;constructor(_0x39da42,_0x334c8b,_0x4e31a8,_0x15e1a2,_0x237f5b){super(),this['_sourceCheck']=_0x334c8b,this['_documentData']=_0x39da42,this['_aiConnector']=_0x4e31a8,this['_reviewParams']=_0x15e1a2,this['_reviewArgs']=_0x237f5b,this['on']('change:status',(_0x3ef572,_0x82921e,_0x42b6ab)=>{'aborted'==_0x42b6ab&&(this['_wasAborted']=!0x0),this['fire']('reviewCheckRunUpdated',{'status':_0x42b6ab,'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'](_0x524434=>'pending'===_0x524434['status']);}get['currentError'](){return this['_currentError'];}['updateDocumentData'](_0x30d23b){this['_documentData']=_0x30d23b;}async['start'](){this['status']='loading',this['_currentError']=void 0x0;try{this['_activeRequest']=this['_createApiRequest']();const _0x3554cf=await this['_activeRequest']['getStream']();this['status']='data';for await(const _0x4a3db3 of _0x3554cf)'unmodified'!==_0x4a3db3['data']['operation']&&('error'!==_0x4a3db3['data']['operation']?'review-metadata'!==_0x4a3db3['event']?this['_addReviewCheckResult'](_0x4a3db3['data']['dataId'],_0x4a3db3['data']['textDelta']):this['callId']=_0x4a3db3['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(_0x5585b7){this['_currentError']=_0x5585b7,_0x5585b7 instanceof Error&&_0x5585b7['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'](_0x83de70,_0x4385c3){const _0x2a626a=this['_results']['get'](_0x83de70);if(!_0x2a626a)return;if(0x0===_0x4385c3['length'])return;const _0x3c73df=[];_0x4385c3['forEach']((_0x4b0515,_0x7eb897)=>{const _0x558974=new th(_0x2a626a['id']+'-'+_0x7eb897,_0x4b0515,_0x2a626a);_0x558974['on']('change:status',()=>{this['fire']('reviewCheckResultChangeStatusUpdated',{'change':_0x558974,'status':_0x558974['status']});}),_0x558974['on']('change:isActivated',()=>{_0x558974['isActivated']?this['fire']('reviewCheckResultActivated',{'change':_0x558974}):this['fire']('reviewCheckResultDeactivated',{'change':_0x558974});}),this['_changes']['push'](_0x558974),_0x3c73df['push'](_0x558974);}),this['fire']('reviewCheckResultReady',{'changes':_0x3c73df,'result':_0x2a626a,'source':this});}['abort'](){this['_activeRequest']&&(this['_activeRequest']['abortController']['abort'](),this['_activeRequest']=null,this['status']='aborted');}['isChangeActive'](_0x3dc984){const _0x1cdaa3=this['_changes']['find'](_0x300373=>_0x300373['id']===_0x3dc984);return!(!_0x1cdaa3||'pending'!==_0x1cdaa3['status']);}['isAnyChangeActivated'](){return this['_changes']['some'](_0x69f29f=>!0x0===_0x69f29f['isActivated']);}['getActiveChanges'](){return this['_changes']['filter'](_0x4ee95f=>'pending'===_0x4ee95f['status']);}['getChangeById'](_0x133bb9){return this['_changes']['find'](_0x4790b6=>_0x4790b6['id']===_0x133bb9);}['markAllChangesAsAccepted'](){for(const _0x30576b of this['_changes'])'pending'===_0x30576b['status']&&(_0x30576b['status']='accepted');this['_checkIfFinished']();}['markChangeAsAccepted'](_0xfa97ae){const _0xab2a86=this['_changes']['find'](_0x3c23ad=>_0x3c23ad['id']===_0xfa97ae);_0xab2a86&&'pending'===_0xab2a86['status']&&(_0xab2a86['status']='accepted'),this['_checkIfFinished']();}['markChangeAsRejected'](_0xa4225a){const _0x2993bf=this['_changes']['find'](_0x2df6fe=>_0x2df6fe['id']===_0xa4225a);_0x2993bf&&'pending'===_0x2993bf['status']&&(_0x2993bf['status']='rejected'),this['_checkIfFinished']();}['markChangeAsOutdated'](_0x35008c){const _0x29fd99=this['_changes']['find'](_0x1b7566=>_0x1b7566['id']===_0x35008c);_0x29fd99&&'pending'===_0x29fd99['status']&&(_0x29fd99['status']='outdated'),this['_checkIfFinished']();}['markChangeAsPending'](_0x105449){const _0x853354=this['_changes']['find'](_0xc25f8a=>_0xc25f8a['id']===_0x105449);_0x853354&&'outdated'===_0x853354['status']&&(_0x853354['status']='pending'),this['_checkIfFinished']();}['activateChange'](_0x55e5ca){this['_changes']['filter'](_0x3633ba=>_0x3633ba['isActivated']&&_0x3633ba['id']!==_0x55e5ca)['forEach'](_0x26ae45=>{_0x26ae45['isActivated']=!0x1;});const _0xfa1592=this['_changes']['find'](_0x39d29b=>_0x39d29b['id']===_0x55e5ca);_0xfa1592&&'pending'===_0xfa1592['status']&&(_0xfa1592['isActivated']=!0x0);}['deactivateChange'](){this['_changes']['filter'](_0x38d5fd=>_0x38d5fd['isActivated'])['forEach'](_0x5d1b7a=>{_0x5d1b7a['isActivated']=!0x1;});}['forceReadyState'](){this['status']='ready';}async['sendRating'](_0x1407b2){if('initialized'===this['status']||'loading'===this['status']||'data'===this['status']||this['_wasAborted'])return;if(!this['callId']||0x0===this['_changes']['length'])return;let _0x3b9853;if(_0x1407b2){const _0x2675d5=this['_changes']['find'](_0xba4d21=>_0xba4d21['id']===_0x1407b2);if(_0x2675d5&&_0x2675d5['isRated'])return;_0x2675d5&&(_0x3b9853=_0x2675d5['parent']['id'],_0x2675d5['isRated']=!0x0);}const _0x221dd2={'positiveCount':this['_changes']['filter'](_0x4a1a02=>'accepted'===_0x4a1a02['status'])['length'],'totalCount':this['_changes']['length']};this['_sendRatingRequest'](_0x221dd2,this['callId'],_0x3b9853);}['_addReviewCheckResult'](_0x45fa3e,_0x1a0d6c){const _0x4f7480=this['_documentData']['elements']['get'](_0x45fa3e);if(!_0x4f7480)return;const _0x3b7e60=_0x4f7480['getContent']();if(_0x3b7e60===_0x1a0d6c)return;const _0x1220fb=new Zs({'id':_0x45fa3e,'contentInitial':_0x3b7e60,'contentNew':_0x1a0d6c,'documentVersion':this['_documentData']['version']});this['_results']['set'](_0x1220fb['id'],_0x1220fb),this['fire']('reviewCheckResultAdded',{'result':_0x1220fb,'source':this});}['_checkIfFinished'](){'finished'===this['status']&&(this['_changes']['filter'](_0x5103a1=>'pending'===_0x5103a1['status'])['length']>0x0&&(this['status']='ready')),'ready'===this['status']&&(0x0===this['_changes']['filter'](_0x909e63=>'pending'===_0x909e63['status'])['length']&&(this['status']='finished'));}}class si extends eh{get['subTitle'](){if(!this['_reviewParams']||0x0===this['_reviewParams']['length'])return'';const _0x26173c=[];if(this['_reviewParams']['length']>0x0&&this['_sourceCheck']['options'])for(let _0x21d964=0x0;_0x21d964<this['_reviewParams']['length'];_0x21d964++){if(!this['_reviewParams'][_0x21d964]||!this['_sourceCheck']['options'][_0x21d964])continue;const _0x4cac36=this['_sourceCheck']['options'][_0x21d964],_0x5a7c8c=_0x4cac36['data']?.['find'](_0x8a0b75=>_0x8a0b75['id']===this['_reviewParams'][_0x21d964]);_0x5a7c8c&&_0x26173c['push'](_0x5a7c8c['label']);}return _0x26173c['join'](',\x20');}get['reviewName'](){return this['_composeReviewName']();}['_createApiRequest'](){return this['_aiConnector']['callSystemReview']({'reviewName':this['_composeReviewName'](),'content':this['_documentData']['content'],'args':this['_reviewArgs']});}['_sendRatingRequest'](_0x476aee,_0xf434ee,_0x4c4464){return this['_aiConnector']['upsertAIReviewRating'](this['reviewName'],_0xf434ee,_0x476aee,_0x4c4464);}['_composeReviewName'](){return!this['_reviewParams']||0x0===this['_reviewParams']['length']||this['_sourceCheck']['useArgs']?this['_sourceCheck']['apiId']:[this['_sourceCheck']['apiId'],...this['_reviewParams']]['join']('-');}}class ve extends _0x5dcf5b{['_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(_0x5f055c,_0x43d9ee)=>{const _0x3f57de=this['_aiReviewCheckList']['getCheckById'](_0x43d9ee['id']);if(_0x3f57de){this['_onReviewCheckRun'](_0x43d9ee),this['_aiReviewCoreEditing']['switchToReadOnly'](),this['_currentReviewCheckRun']=this['_createReviewCheckRun'](_0x43d9ee,_0x3f57de),this['_aiReviewCoreUi']['setCheckResultTitle'](this['_currentReviewCheckRun']['title'],this['_currentReviewCheckRun']['subTitle']),this['_currentReviewCheckRun']['on']('reviewCheckRunUpdated',(_0x313a9d,_0x105487)=>{switch(_0x105487['status']){case'data':case'loading':this['_aiReviewCoreUi']['showCheckRunResults'](_0x105487);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 _0x25c351('ai-review-mode-check-run-general-error',this,void 0x0,this['_currentReviewCheckRun']?.['currentError']));break;case'error-chunk':this['_aiReviewCoreUi']['showChunkErrorView'](),this['_logError'](new _0x25c351('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'!==_0x105487['status']&&'error-chunk'!==_0x105487['status']&&'error-general'!==_0x105487['status']||this['_currentReviewCheckRun']?.['sendRating']();}),this['_currentReviewCheckRun']['on']('reviewCheckResultAdded',(_0x30d5aa,_0x4aa11b)=>{if(!this['_currentReviewCheckRun'])throw new _0x25c351('ai-review-mode-no-current-check-run',this);const _0x3d4f08=this['_diffContent'](_0x4aa11b['result']['contentInitial'],_0x4aa11b['result']['contentNew']);_0x4aa11b['source']['addResultChanges'](_0x4aa11b['result']['id'],_0x3d4f08);}),this['_currentReviewCheckRun']['on']('reviewCheckResultReady',(_0xbb4a01,_0x1b394f)=>{for(const _0x203cce of _0x1b394f['changes'])this['_aiReviewCoreUi']['showCheckRunResult'](_0x203cce);this['_markChangePositionInEditorContent'](_0x1b394f['changes'],_0x1b394f['source']['documentData']);}),this['_currentReviewCheckRun']['on']('reviewCheckResultChangeStatusUpdated',(_0x19cbbd,_0x43d2a2)=>{this['_aiReviewCoreUi']['updateChangeState'](_0x43d2a2['change']['id'],_0x43d2a2['status']);}),this['_currentReviewCheckRun']['on']('reviewCheckResultActivated',(_0x2bcbdf,_0x4e0958)=>{this['_onReviewCheckResultActivated'](_0x4e0958);}),this['_currentReviewCheckRun']['on']('reviewCheckResultDeactivated',()=>{this['_onReviewCheckResultDeactivated']();});try{await this['_currentReviewCheckRun']['start']();}catch(_0xa579b8){_0xa579b8 instanceof Error&&_0xa579b8['message']['includes']('ai-request-aborted')||(_0xa579b8 instanceof _0x25c351?this['_logError'](_0xa579b8):this['_logError'](new _0x25c351('ai-review-mode-check-run-failed',this,void 0x0,_0xa579b8)));}}else this['_logError'](new _0x25c351('ai-review-mode-source-check-not-found',this,{'checkId':_0x43d9ee['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 _0x2c428c=this['_currentReviewCheckRun']['getActiveChanges']();if(!_0x2c428c['length'])return;this['_aiReviewCoreEditing']['applyChange'](_0x2c428c['map'](_0x37f143=>_0x37f143['id']));const _0x5a4ea4=this['_currentReviewCheckRun'];_0x5a4ea4['markAllChangesAsAccepted'](),_0x5a4ea4['sendRating']();}),this['listenTo'](this['_aiReviewCoreUi'],'acceptChange',(_0x3fdb5e,_0x37151e)=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['isChangeActive'](_0x37151e['id'])&&(this['_aiReviewCoreEditing']['applyChange']([_0x37151e['id']]),this['_currentReviewCheckRun']['markChangeAsAccepted'](_0x37151e['id']),this['_aiReviewCoreUi']['hideChangeBalloon'](),this['_currentReviewCheckRun']['sendRating'](_0x37151e['id']));}),this['listenTo'](this['_aiReviewCoreUi'],'dismissChange',(_0x2fd826,_0x4dc964)=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['isChangeActive'](_0x4dc964['id'])&&(this['_aiReviewCoreEditing']['rejectChange'](_0x4dc964['id']),this['_currentReviewCheckRun']['markChangeAsRejected'](_0x4dc964['id']),this['_aiReviewCoreUi']['hideChangeBalloon'](),this['_currentReviewCheckRun']['sendRating'](_0x4dc964['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',(_0x33a141,_0x284846)=>{this['_onActivateChange'](_0x284846);}),this['listenTo'](this['_aiReviewCoreUi'],'deactivateChange',(_0x4765b9,_0x1c788a)=>{this['_onDeactivateChange'](_0x1c788a);}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerClicked',(_0x234bbb,_0x3c99c1)=>{this['_onChangeMarkerClicked'](_0x234bbb,_0x3c99c1);}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerHovered',(_0x477499,_0x3c7373)=>{this['_onChangeMarkerHovered'](_0x477499,_0x3c7373);}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerBlurred',()=>{this['_onChangeMarkerBlurred']();}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerRemoved',(_0x361235,_0x2db361)=>{this['_onChangeMarkerRemoved'](_0x361235,_0x2db361);}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerRestored',(_0xb97ce2,_0x2d106f)=>{this['_onChangeMarkerRestored'](_0xb97ce2,_0x2d106f);});}['_createReviewCheckRun'](_0xd68e3c,_0xbbe431){return new si(this['_aiReviewCoreEditing']['getDocumentData'](),_0xbbe431,this['_aiConnector'],_0xd68e3c['params'],_0xd68e3c['args']);}['_onChangeMarkerRemoved'](_0x42d2c0,_0x324292){this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['markChangeAsOutdated'](_0x324292['changeId']);}['_onChangeMarkerRestored'](_0x2471db,_0x23f4f9){this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['markChangeAsPending'](_0x23f4f9['changeId']);}['_onCheckRunFinished'](){this['_aiReviewCoreUi']['showReviewCompletedView']();}['_initRequiredPlugins'](){this['_aiConnector']=this['context']['plugins']['get']('AIConnector');}['_onReviewRunLeave'](_0x2f5cc7=!0x1){this['_currentReviewCheckRun']&&(this['_currentReviewCheckRun']['hasModifications']||this['_currentReviewCheckRun']['sendRating'](),this['_currentReviewCheckRun']['stopListening'](),this['_currentReviewCheckRun']['abort'](),this['_currentReviewCheckRun']=void 0x0),_0x2f5cc7&&this['_aiReviewCoreUi']['showReviewCheckList'](),this['_aiReviewCoreEditing']['clearAllMarkers'](),this['_aiReviewCoreEditing']['switchToEdit'](),this['_changeActivationSource']=null;const _0x5030b1=this['_aiReviewCoreEditing']['getEditor']();_0x5030b1&&_0x5030b1['editing']['view']['change'](_0x1260e9=>{const _0x3844ee=_0x5030b1['editing']['view']['document']['getRoot']();_0x1260e9['removeClass']('ck-ai_review-diff',_0x3844ee),_0x1260e9['removeClass']('ck-ai_review-highlights',_0x3844ee),_0x1260e9['removeClass']('ck-ai-translate-mode-content',_0x3844ee);});}['_getTranslationWithDefault'](_0x36db25,_0x3b66ed){const _0x258c8c=h(this['context']['locale'],_0x36db25);return _0x258c8c===_0x36db25?_0x3b66ed:_0x258c8c;}['_logError'](_0x854468,_0x1b7603=!0x1){_0x2d18bd(_0x854468['message']),_0x1b7603||(_0x854468['message']['startsWith']('ai-review-mode-models-unable-to-retrieve')?this['_aiReviewCoreUi']['showGeneralReviewCoreErrorView']():this['_aiReviewCoreUi']['showGeneralResultsErrorView']());}['_scrollToChange'](_0x12a4b9){if('content'===this['_changeActivationSource']){const _0x5e8bcb=this['_aiReviewCoreUi']['getChangeElement'](_0x12a4b9);_0x5e8bcb&&_0x2d39e3(_0x5e8bcb['closest']('.ck-ai_review__check-run-result')||_0x5e8bcb);}else{if('panel'===this['_changeActivationSource']){const _0x524756=this['_getChangeContentElement'](_0x12a4b9);if(!_0x524756)return;_0x517478({'target':_0x524756,'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 Ys{['id'];['commandId'];['title'];['description'];['isParameterized'];['useArgs'];['options'];['args'];get['apiId'](){return this['commandId'];}constructor(_0x26a772){this['id']=_0x26a772['id'],this['commandId']=_0x26a772['commandId'],this['title']=_0x26a772['title'],this['description']=_0x26a772['description'],this['isParameterized']=_0x26a772['isParameterized'],this['useArgs']=_0x26a772['useArgs'],this['options']=_0x26a772['options'],this['args']=_0x26a772['args'];}}class vo extends ts(){['_checks']=[];['setupChecks'](_0x114956){this['_checks']=_0x114956['map'](_0x30fcc3=>new Ys(_0x30fcc3));}get['checks'](){return this['_checks'];}['getCheckById'](_0x127bf4){return this['checks']['find'](_0x56ba06=>_0x56ba06['id']===_0x127bf4);}['removeCheckById'](_0x1b1679){this['_checks']=this['_checks']['filter'](_0x33cf3a=>_0x33cf3a['id']!==_0x1b1679);}}class ke extends Ys{['_models']=[];['_defaultModel']=null;constructor(_0x4d6136,_0x5a71b3,_0x2d28ce){super(_0x4d6136),this['_models']=_0x5a71b3,this['_defaultModel']=_0x2d28ce;}get['models'](){return this['_models'];}get['defaultModel'](){return this['_defaultModel'];}}class Ie extends Ys{['isExtra']=!0x0;['prompt'];['model'];['_defaultModel']=null;constructor(_0x5b16,_0x31cff7,_0x2e707b){super(_0x5b16),this['prompt']=_0x5b16['prompt'],this['model']=_0x5b16['model'],this['model']?this['_defaultModel']=_0x31cff7['find'](_0x1318d2=>_0x1318d2['id']===this['model'])||null:this['_defaultModel']=_0x2e707b;}get['defaultModel'](){return this['_defaultModel'];}}class _e extends vo{['_allModels']=[];['_recommendedModels']=[];['_defaultModel']=null;constructor(_0x369ff9,_0x27568a,_0x58f43f){super(),this['_allModels']=_0x369ff9,this['_recommendedModels']=_0x27568a,this['_defaultModel']=_0x58f43f;}['setupChecks'](_0x58ddde){this['_checks']=_0x58ddde['map'](_0x1b2752=>!0x0===_0x1b2752['isExtra']?new Ie(_0x1b2752,this['_allModels'],this['_defaultModel']):'custom'===_0x1b2752['id']?new ke(_0x1b2752,this['_recommendedModels'],this['_defaultModel']):new Ys(_0x1b2752));}}class Ce extends eh{['_prompt'];['_model'];constructor(_0x2bd119,_0x59e936,_0x1cdf7c,_0x7a31f0,_0x29f9d0){super(_0x1cdf7c,_0x7a31f0,_0x29f9d0),this['_prompt']=_0x2bd119,this['_model']=_0x59e936;}get['subTitle'](){return this['_prompt'];}['_createApiRequest'](){return this['_aiConnector']['callCustomReview']({'content':this['_documentData']['content'],'prompt':this['_prompt'],'model':this['_model']});}['_sendRatingRequest'](_0x3189fb,_0x38dd83,_0x2eb9c7){return this['_aiConnector']['upsertCustomAIReviewRating'](_0x38dd83,_0x3189fb,_0x2eb9c7);}}class Re extends Ce{get['subTitle'](){return'';}set['prompt'](_0x58ec75){this['_prompt']=_0x58ec75;}set['model'](_0x352505){this['_model']=_0x352505;}}class pe extends ve{static get['pluginName'](){return'AIReviewModeController';}['_isDiffOn']=!0x1;['_hasDefaultAvailableCommands']=!0x1;constructor(_0x110b20){super(_0x110b20),this['_hasDefaultAvailableCommands']=!this['context']['config']['get']('ai.review.availableCommands'),this['context']['config']['define']('ai.review.availableCommands',we['map'](_0x50bb91=>_0x50bb91['id'])),this['context']['config']['define']('ai.review.extraCommands',[]);}async['init'](){await super['init'](),this['listenTo'](this['_aiReviewCoreUi'],'toggleDiff',(_0x4184cb,_0x5e5cd9)=>{this['_isDiffOn']=_0x5e5cd9['on'],this['_onDiffChange'](this['_isDiffOn']);});}['_initRequiredPlugins'](){super['_initRequiredPlugins'](),this['_aiReviewCoreUi']=this['context']['plugins']['get']('AIReviewModeUI'),this['_aiReviewCoreEditing']=this['context']['plugins']['get']('AIReviewCoreEditing');}['_createReviewCheckRun'](_0x49ce83,_0xa791e3){return _0x49ce83['isCustom']?new Ce(_0x49ce83['args']['prompt'],_0x49ce83['args']['model'],this['_aiReviewCoreEditing']['getDocumentData'](),_0xa791e3,this['_aiConnector']):_0xa791e3['isExtra']?new Re(_0xa791e3['prompt'],_0xa791e3['defaultModel']['id'],this['_aiReviewCoreEditing']['getDocumentData'](),_0xa791e3,this['_aiConnector']):new si(this['_aiReviewCoreEditing']['getDocumentData'](),_0xa791e3,this['_aiConnector'],_0x49ce83['params'],_0x49ce83['args']);}['_onReviewCheckResultActivated'](_0x1469f9){this['_aiReviewCoreUi']['setActiveStateInResults'](_0x1469f9['change']['id']),this['_scrollToChange'](_0x1469f9['change']['id']);const _0x2af859=this['_aiReviewCoreEditing']['getMarkerElementForChange'](_0x1469f9['change']['id']);if(!_0x2af859)return;const _0x1aff86=this['_aiReviewCoreEditing']['getEditor']();this['_aiReviewCoreUi']['showChangeBalloon'](_0x1469f9['change'],()=>_0x2af859['getElement'](),void 0x0,'click',_0x1aff86?.['editing']?.['view']?.['getDomRoot'](),_0x1aff86?.['ui']?.['viewportOffset']),this['_aiReviewCoreEditing']['setMarkersInElementAsActive'](_0x1469f9['change']['id']);}['_onReviewCheckResultDeactivated'](){this['_aiReviewCoreUi']['resetActiveStateInResults'](),this['_aiReviewCoreUi']['hideChangeBalloon'](),this['_aiReviewCoreEditing']['setAllMarkersAsInactive']();}['_onActivateChange'](_0x37cc8c){this['_currentReviewCheckRun']&&'click'===_0x37cc8c['uiInteraction']&&(this['_changeActivationSource']='panel',this['_currentReviewCheckRun']['activateChange'](_0x37cc8c['id']));}['_onDeactivateChange'](_0xec506c){this['_currentReviewCheckRun']&&'balloon'===_0xec506c['origin']&&this['_currentReviewCheckRun']['deactivateChange']();}['_onChangeMarkerClicked'](_0xbc543f,_0x52f743){if(!this['_currentReviewCheckRun'])return;this['_changeActivationSource']='content',this['_currentReviewCheckRun']['activateChange'](_0x52f743['changeId']);const _0x188476=this['_currentReviewCheckRun']['getChangeById'](_0x52f743['changeId']);if(!_0x188476)return;const _0x5e9f5b=this['_aiReviewCoreEditing']['getEditor']();this['_aiReviewCoreUi']['showChangeBalloon'](_0x188476,_0x52f743['markerElement'],_0x52f743['domEvent'],'click',_0x5e9f5b?.['editing']?.['view']?.['getDomRoot'](),_0x5e9f5b?.['ui']?.['viewportOffset']);}['_onChangeMarkerHovered'](_0x578684,_0x422166){if(!this['_currentReviewCheckRun'])return;if(this['_currentReviewCheckRun']['isAnyChangeActivated']())return;const _0x3a19f2=this['_currentReviewCheckRun']['getChangeById'](_0x422166['changeId']);if(!_0x3a19f2)return;const _0x49f099=this['_aiReviewCoreEditing']['getEditor']();this['_aiReviewCoreUi']['showChangeBalloon'](_0x3a19f2,_0x422166['markerElement'],_0x422166['domEvent'],'hover',_0x49f099?.['editing']?.['view']?.['getDomRoot'](),_0x49f099?.['ui']?.['viewportOffset']);}['_onChangeMarkerBlurred'](){if(!this['_currentReviewCheckRun'])return;this['_currentReviewCheckRun']['isAnyChangeActivated']()||this['_aiReviewCoreUi']['hideChangeBalloon']();}['_getChangeContentElement'](_0x57f9c1){const _0x464bb8=this['_aiReviewCoreEditing']['getMarkerElementForChange'](_0x57f9c1);return _0x464bb8?_0x464bb8['getElement']():null;}['_markChangePositionInEditorContent'](_0x27657c,_0x12f77a){this['_aiReviewCoreEditing']['markChangePositionInEditorContent'](_0x27657c,_0x12f77a);}['_diffContent'](_0x382d93,_0x4b2dfe){return this['_aiReviewCoreEditing']['diffContent'](_0x382d93,_0x4b2dfe);}['_onReviewCheckRun'](){this['_onDiffChange'](this['_isDiffOn']);}['_onDiffChange'](_0x3f184a){const _0x41536c=this['_aiReviewCoreEditing']['getEditor']();_0x3f184a?this['_aiReviewCoreUi']['hideDiffInBalloon']():this['_aiReviewCoreUi']['showDiffInBalloon'](),_0x41536c&&_0x41536c['editing']['view']['change'](_0x497acc=>{const _0x4bba2f=_0x41536c['editing']['view']['document']['getRoot']();for(const _0x3542cc of _0x4bba2f['getClassNames']())_0x3542cc['startsWith']('ck-ai_review-')&&_0x497acc['removeClass'](_0x3542cc,_0x4bba2f);_0x497acc['addClass'](_0x3f184a?'ck-ai_review-diff':'ck-ai_review-highlights',_0x4bba2f);});}async['_getChecksList'](){const _0x35f7a6=[...we,...this['_getExtraChecks']()],_0x5a0da3=this['context']['config']['get']('ai.review.availableCommands')||[];this['_logErrorForNonExistentChecks'](_0x5a0da3,_0x35f7a6);let _0x85e0bd=_0x35f7a6;this['_hasDefaultAvailableCommands']||(_0x85e0bd=_0x5a0da3['map'](_0x1390f5=>_0x35f7a6['find'](_0x5bd1be=>_0x5bd1be['id']===_0x1390f5))['filter'](_0x453c78=>!!_0x453c78)),_0x85e0bd=_0x85e0bd['map'](_0x1ff485=>_0x1ff485['isExtra']?_0x1ff485:this['_translateReviewCheck'](_0x1ff485));const _0x9e0669=_0x85e0bd['some'](_0x1633ed=>_0x1633ed['isExtra']||'custom'===_0x1633ed['id']);let _0xc2ebec=[],_0x3216cd=[],_0x5ca8e3=null;if(_0x9e0669){const _0x3250a1=await this['_getModels']();_0xc2ebec=_0x3250a1['all'],_0x3216cd=_0x3250a1['recommended'],_0x5ca8e3=_0x3250a1['default'];}const _0x4d3a3a=new _e(_0xc2ebec,_0x3216cd,_0x5ca8e3);return _0x4d3a3a['setupChecks'](_0x85e0bd),_0x9e0669&&this['_filterChecksWithMissingModel'](_0x4d3a3a),_0x4d3a3a;}['_getExtraChecks'](){return(this['context']['config']['get']('ai.review.extraCommands')||[])['map'](_0x178938=>({'id':_0x178938['id'],'commandId':_0x178938['id'],'title':_0x178938['label'],'description':_0x178938['description'],'isParameterized':!0x1,'isExtra':!0x0,'prompt':_0x178938['prompt'],'model':_0x178938['model']}));}['_logErrorForNonExistentChecks'](_0x18b6a4,_0x4df08c){const _0x5a7654=_0x18b6a4['filter'](_0x5f4f08=>!_0x4df08c['some'](_0x3811bf=>_0x3811bf['id']===_0x5f4f08));_0x5a7654['length']&&this['_logError'](new _0x25c351('ai-review-mode-non-existent-commands-used',this,{'commandIds':_0x5a7654['join'](',\x20')}),!0x0);}async['_getModels'](){try{const _0x54816c=new et({'connector':this['_aiConnector'],'config':this['context']['config']['get']('ai.models'),'locale':this['context']['locale']});return{'all':await _0x54816c['getAll'](),'recommended':await _0x54816c['getAvailableModels'](),'default':await _0x54816c['getDefault']()};}catch(_0x8853e6){return this['_logError'](new _0x25c351('ai-review-mode-models-unable-to-retrieve',this,void 0x0,_0x8853e6)),{'all':[],'recommended':[],'default':null};}}['_translateReviewCheck'](_0x262f56){const _0x2311a1='AI_REVIEW_CHECK_'+_0x262f56['id']['toUpperCase']()['replaceAll']('-','_'),_0x4e34fd={..._0x262f56,'title':this['_getTranslationWithDefault'](_0x2311a1+'_TITLE',_0x262f56['title']),'description':this['_getTranslationWithDefault'](_0x2311a1+'_DESCRIPTION',_0x262f56['description'])};return _0x262f56['options']&&(_0x4e34fd['options']=_0x262f56['options']['map'](_0x2a8b2a=>({..._0x2a8b2a,'label':this['_getTranslationWithDefault'](_0x2311a1+'_OPTIONS_LABEL',_0x2a8b2a['label']||''),'data':_0x2a8b2a['data']?_0x2a8b2a['data']['map'](_0x489026=>({..._0x489026,'label':this['_getTranslationWithDefault'](_0x2311a1+'_OPTIONS_DATA_'+_0x489026['id']['toUpperCase'](),_0x489026['label'])})):void 0x0}))),_0x4e34fd;}['_filterChecksWithMissingModel'](_0x488a3b){const _0x5d75eb=[];_0x488a3b['checks']['forEach'](_0x641c5b=>{(_0x641c5b instanceof Ie&&!_0x641c5b['defaultModel']||_0x641c5b instanceof ke&&!_0x641c5b['models']['length'])&&_0x5d75eb['push'](_0x641c5b['id']);}),_0x5d75eb['length']&&_0x5d75eb['forEach'](_0x202f5b=>{_0x488a3b['removeCheckById'](_0x202f5b),this['_logError'](new _0x25c351('ai-review-mode-command-unavailable-due-to-missing-model',this,{'commandId':_0x202f5b}),!0x0);});}}class Ka extends _0x5dcf5b{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 Ys{get['apiId'](){return'translate';}}class Pe extends vo{['setupChecks'](_0x3bf9c5){this['_checks']=_0x3bf9c5['map'](_0x1bdc76=>new jr(_0x1bdc76));}}class Se extends si{['_title'];constructor(_0x1f1c2c,_0x2f1a78,_0x3ca925,_0x59e8d3,_0x105e4c,_0xfd4741){super(_0x1f1c2c,_0x2f1a78,_0x3ca925,_0x105e4c,_0xfd4741),this['_title']=_0x59e8d3;}get['title'](){return this['_title'];}get['subTitle'](){return this['_sourceCheck']['title'];}}class rr extends ve{static get['pluginName'](){return'AITranslateController';}constructor(_0x55ff5f){super(_0x55ff5f),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'](_0x482473,_0x3775f6){return new Se(this['_aiReviewCoreEditing']['getDocumentData'](),_0x3775f6,this['_aiConnector'],h(this['context']['locale'],'AI_REVIEW_CHECK_TRANSLATE_TITLE'),_0x482473['params'],_0x482473['args']);}['_onReviewCheckResultActivated'](_0x5897eb){this['_aiReviewCoreUi']['setActiveStateInResults'](_0x5897eb['change']['id']),this['_aiReviewCoreEditing']['setMarkersInElementAsActive'](_0x5897eb['change']['id']);}['_onReviewCheckResultDeactivated'](){this['_aiReviewCoreEditing']['setAllMarkersAsInactive'](),this['_aiReviewCoreUi']['resetActiveStateInResults']();}['_onActivateChange'](_0x8d4f70){this['_currentReviewCheckRun']&&('hover'===_0x8d4f70['uiInteraction']&&(this['_changeActivationSource']='panel',this['_currentReviewCheckRun']['activateChange'](_0x8d4f70['id'])),'click'===_0x8d4f70['uiInteraction']&&this['_scrollToChange'](_0x8d4f70['id']));}['_onDeactivateChange'](_0x4d1e9e){this['_currentReviewCheckRun']&&'panel'===_0x4d1e9e['origin']&&this['_currentReviewCheckRun']['deactivateChange']();}['_onChangeMarkerClicked'](_0x3b4b55,_0x4929c4){this['_currentReviewCheckRun']&&(this['_changeActivationSource']='content',this['_currentReviewCheckRun']['activateChange'](_0x4929c4['changeId']),this['_scrollToChange'](_0x4929c4['changeId']));}['_onChangeMarkerHovered'](_0x916d,_0x58af42){this['_currentReviewCheckRun']&&(this['_changeActivationSource']='content',this['_currentReviewCheckRun']['activateChange'](_0x58af42['changeId']),this['_aiReviewCoreEditing']['reactivateMarkers'](_0x58af42['changeId']));}['_onChangeMarkerBlurred'](){this['_currentReviewCheckRun']&&'content'===this['_changeActivationSource']&&(this['_currentReviewCheckRun']['deactivateChange'](),this['_aiReviewCoreEditing']['setAllMarkersAsInactive']());}['_getChangeContentElement'](_0x5d22be){return this['_aiReviewCoreEditing']['getContentElementForChange'](_0x5d22be);}['_markChangePositionInEditorContent'](_0x2a69b7,_0x3cd908){this['_aiReviewCoreEditing']['markChangePositionInEditorContent'](_0x2a69b7,_0x3cd908);}['_diffContent'](_0x3d6a7b,_0x1619d5){return this['_aiReviewCoreEditing']['diffContent'](_0x3d6a7b,_0x1619d5,!0x0);}['_onReviewCheckRun'](){const _0x587e55=this['_aiReviewCoreEditing']['getEditor']();_0x587e55&&_0x587e55['editing']['view']['change'](_0x8a539f=>{const _0x3dbfa4=_0x587e55['editing']['view']['document']['getRoot']();for(const _0x26a1da of _0x3dbfa4['getClassNames']())(_0x26a1da['startsWith']('ck-ai-review-')||'ck-ai-translate-'===_0x26a1da)&&_0x8a539f['removeClass'](_0x26a1da,_0x3dbfa4);_0x8a539f['addClass']('ck-ai-translate-mode-content',_0x3dbfa4);});}async['_getChecksList'](){const _0x21cd9e=[],_0x3f3b53=this['context']['config']['get']('ai.translate.languages')||[];for(const _0x29afa1 of _0x3f3b53)_0x21cd9e['push']({'title':_0x29afa1['label'],'id':_0x29afa1['id'],'commandId':_0x29afa1['id'],'description':'','isParameterized':!0x1,'useArgs':!0x0,'args':{'language':_0x29afa1['id']}});const _0x2ba717=new Pe();return _0x2ba717['setupChecks'](this['_translateChecks'](_0x21cd9e)),_0x2ba717;}['_translateChecks'](_0x267ba4){return _0x267ba4['map'](_0x4d2d15=>{const _0x1f5c53='AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_'+_0x4d2d15['title']['toUpperCase']()['replaceAll']('-','_');return{..._0x4d2d15,'title':this['_getTranslationWithDefault'](_0x1f5c53,_0x4d2d15['title'])};});}}class Le extends Ve{constructor(_0x5e4fc2,_0x44af0b){super(_0x5e4fc2,_0x44af0b),this['on']('set:isLoading',(_0x5743c8,_0x12dad3,_0x551398)=>{_0x551398&&(this['headerTitle']=h(this['locale'],'AI_TRANSLATE_CHECK_RESULTS_LOADING_TITLE'));}),this['on']('set:isResultReady',(_0x5b57b5,_0xe178f5,_0x4ed8bb)=>{_0x4ed8bb&&(this['headerTitle']=h(this['locale'],'AI_TRANSLATE_CHECK_RESULTS_READY_TITLE'));});}['_createAcceptAllButtonView'](){const _0x4f1e77=super['_createAcceptAllButtonView']();return _0x4f1e77['set']('label',h(this['locale'],'AI_TRANSLATE_ACCEPT_ALL')),_0x4f1e77;}['_createExitReviewButtonView'](){const _0x41da7a=super['_createExitReviewButtonView']();return _0x41da7a['set']('label',h(this['locale'],'AI_CHAT_HISTORY_CANCEL')),_0x41da7a;}}class Ne extends je{['_setupTemplate'](){const _0x2f379a=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-translate__check-list-wrapper',_0x2f379a['if']('isVisible','ck-hidden',_0x2cd368=>!_0x2cd368)]},'children':[{'tag':'div','attributes':{'class':['ck-ai-translate__check-list-header']},'children':[{'tag':'h2','children':[{'text':h(this['locale'],'AI_TRANSLATE_CHECK_LIST_HEADER_TITLE')}]},{'tag':'p','children':[{'text':h(this['locale'],'AI_TRANSLATE_CHECK_LIST_HEADER_DESCRIPTION')}]}]},{'tag':'div','attributes':{'class':['ck-ai_review__check-list',_0x2f379a['if']('isVisible','ck-hidden',_0x5c5eaf=>!_0x5c5eaf)]},'children':this['_checkViews']}]});}}class tr extends Me{static get['pluginName'](){return'AITranslateUI';}['createMainView'](){const _0x28b135=this['context']['locale'],_0x342cc8=new _0x337d54(_0x28b135,{'label':h(_0x28b135,'AI_REVIEW_CHECK_TRANSLATE_TITLE'),'icon':_0x4cfcba,'class':'ck-ai-header\x20ck-ai-header_review-translate'}),_0x8f257e=new Ae(_0x28b135,{'header':_0x342cc8,'list':new Ne(_0x28b135),'results':new Le(_0x28b135,{'generalErrorText':h(_0x28b135,'AI_TRANSLATE_GENERAL_ERROR_MESSAGE')}),'completed':new be(_0x28b135,{'headerText':h(_0x28b135,'AI_TRANSLATE_FINISH_HEADER_TITLE'),'emptyResultsText':h(_0x28b135,'AI_TRANSLATE_EMPTY_RESULTS_TEXT'),'buttonText':h(_0x28b135,'AI_TRANSLATE_FINISH_BUTTON_LABEL')})});return _0x8f257e['extendTemplate']({'attributes':{'class':'ck-ai-translate-mode'}}),_0x8f257e;}['registerTab'](){const _0x141ef6=this['context']['plugins']['get']('AITabs');_0x141ef6['view']['on']('activateTab',(_0x1bcaf5,_0x4b4722)=>{'translate'===_0x4b4722?this['fire']('getReviewCheckList'):this['fire']('leaveReview');}),_0x141ef6['view']['addTab']({'id':'translate','buttonLabel':h(this['context']['locale'],'AI_REVIEW_CHECK_TRANSLATE_TITLE'),'buttonIcon':_0x4cfcba,'order':0x0,'content':this['_mainView']});}}class Wa extends _0x5dcf5b{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,$ as AIAdapter,$n as AIAssistant,g as AIAssistantUI,R as AIBalloon,Ma as AIChat,S as AIChatController,z as AIChatHistory,ft as AIChatHistoryController,yt as AIChatHistoryUI,Va as AIChatShortcuts,F as AIChatUI,tt as AIConnector,s as AIEditing,Ba as AIEditorIntegration,Qt as AIQuickActionType,Fa as AIQuickActions,ii as AIQuickActionsUI,er as AIRequestError,Ys as AIReviewCheck,Zs as AIReviewCheckResult,eh as AIReviewCheckRun,Ka as AIReviewMode,ve as AIReviewModeController,de as AIReviewModeEditing,ge as AIReviewModeUI,it as AITabs,ye as AITextAdapter,Pt as AIToggleButtonUI,Wa as AITranslate,rr as AITranslateController,tr as AITranslateUI,Xn as AWSTextAdapter,Qn as OpenAITextAdapter,D as ShowAIAssistantCommand,io as ToggleAICommand,Hs as createResizeButton,qn as getDefaultAICommands};
|
|
23
|
+
import{Plugin as _0x364f16,Command as Lt,ContextPlugin as _0x34a98c,Editor as dt}from'@ckeditor/ckeditor5-core/dist/index.js';import{IconCopy as _0x1def7a,IconCheck as _0x4b3b54,IconError as _0x224bea,IconSubmit as _0x1c6079,IconAIHistory as Nt,IconMagicWand as _0x5cb001,IconRobotPencil as _0x473155,IconMaximize as _0x1d93df,IconMinimize as _0x72fd7b,IconShowChangesOn as _0x28a25c,IconShowChangesOff as _0x45b280,IconDocument as _0x55eb18,IconBoxWithCross as _0x243c50,IconBoxWithCheck as _0x1b690b,IconBoxWithMarker as _0x4cb165,IconInfo as tc,IconLoupe as _0x3ccd4e,IconCancel as _0x35d8e1,IconStop as _0x21bbec,IconAIChat as vt,IconPlus as _0xa9fd1f,IconPin as _0x5cb4cf,IconThreeHorizontalDots as _0x2e88d6,IconChevronDown as _0x4ad6c8,IconChevronUp as _0x46d9af,IconOutdated as _0x2157fc,IconEye as _0x45731c,IconEyeCrossedOut as _0x577dff,IconChevronRight as _0x12ad23,IconAIReview as _0x49b99c,IconAITranslate as _0x3a5ed3}from'@ckeditor/ckeditor5-icons/dist/index.js';import{uid as _0x3dbf6d,CKEditorError as _0x509ee0,ObservableMixin as ts,global as _0x595889,isVisible as _0x49efe1,Rect as _0x227dc7,Collection as _0x397f6f,FocusTracker as _0x534506,KeystrokeHandler as _0x33f2cf,first as _0x48a97f,toArray as _0x41ecdd,EmitterMixin as _0x17d663,logWarning as _0x1c4b5f,logError as gt,scrollViewportToShowTarget as _0x48dd33,scrollAncestorsToShowTarget as _0x480036,ResizeObserver as _0x47b3bb,_isMotionReduced as Rt,getConstrainedViewportRect as _0x3bd2e8,DomEmitterMixin as _0x91e897}from'@ckeditor/ckeditor5-utils/dist/index.js';import{ToolbarView as _0x1b53e3,ButtonView as _0x599e60,View as _0x5eeb09,SpinnerView as _0x1650c8,IconView as _0x528adc,AutocompleteView as _0x491401,ListView as _0x20d034,ListItemGroupView as _0x5742ce,ListItemView as _0x8981d2,ButtonLabelView as _0x512e7d,FocusCycler as _0x45d025,createLabeledTextarea as _0x29faf8,Dialog as _0x1aff54,createDropdown as _0xace15,addMenuToDropdown as _0x44e784,MenuBarMenuView as _0x3a7b62,MenuBarMenuListItemButtonView as _0x2d1f80,DialogViewPosition as _0x1ae636,MenuBarMenuListView as _0x47b040,MenuBarMenuListItemView as _0x4ae876,BodyCollection as _0x2f55eb,BalloonPanelView as _0x88aaab,clickOutsideHandler as _0x5e5264,addListToDropdown as _0x37db59,UIModel as _0x137bc3,submitHandler as _0xd2d1ba,LabeledFieldView as _0x22aa6a,createLabeledInputText as _0x56e4b8,FormHeaderView as _0x156476,HighlightedTextView as _0x26b973,ViewCollection as _0xa460cb,FileDialogButtonView as _0x1fb784,InputTextView as _0x34d93c,SearchTextView as _0x4837ac,ListItemButtonView as _0x2668dc,ButtonLabelWithHighlightView as _0xbb56c,DropdownMenuPanelPositioningFunctions as _0xa1b8a3,BalloonToolbar as te,FormRowView as _0x2a0a84,TextareaView as _0x18e641}from'@ckeditor/ckeditor5-ui/dist/index.js';import{ClipboardPipeline as _0x2a3673,ClipboardMarkersUtils as _0x50d817}from'@ckeditor/ckeditor5-clipboard/dist/index.js';import{ViewDocumentDomEventData as _0x4da45d,ViewDataTransfer as _0x7e8156,ViewUpcastWriter as _0x4b5652,Matcher as _0x4292fa,_DetachOperation as et,_insertIntoModelNodeList as _0x4c8c27,_removeFromModelNodeList as to,ModelRange as it,transformOperationSets as nt,ViewDowncastWriter as Dt,ModelDocumentFragment as tt,ModelPosition as st,ModelTreeWalker as _0x22aa1e,MarkerOperation as _0x3bab2e,InsertOperation as _0x546415}from'@ckeditor/ckeditor5-engine/dist/index.js';import{unescape as _0xcc4704,escape as _0x497439,escapeRegExp as _0x201462,debounce as _0x1365a0}from'es-toolkit/compat';import{BedrockRuntimeClient as _0x609a6e,InvokeModelWithResponseStreamCommand as _0x12d576,InvokeModelCommand as _0x57a54b}from'@aws-sdk/client-bedrock-runtime';import{createParser as $t}from'eventsource-parser';import{parseDocument as _0x30c511}from'htmlparser2';import{isTag as _0x26bfdf,findOne as yt,getParent as _0x29d3c3,findAll as _0x52a524,removeElement as _0x3d1b0b,replaceElement as _0xa5e35f,prepend as _0x5355a0,prependChild as _0xf59167,appendChild as _0x43295e,append as _0x517396,find as _0x50b699,isComment as _0x440dc4,getChildren as _0x9c6907,textContent as _0x44a2c9}from'domutils';import _0x9860e5 from'dom-serializer';import{Document as Et,Element as _0x4279d7,Text as _0x28fe50,cloneNode as _0x5768f4,isDocument as _0x38cc0a,isText as _0x400b0b,NodeWithChildren as _0x17a2d5}from'domhandler';import{MarkdownGfmMdToHtml as _0x490e8d}from'@ckeditor/ckeditor5-markdown-gfm/dist/index.js';import{fixElementSuggestionRange as _0x4dc946,DocumentCompare as _0x31d190,DATA_ID_MODEL_ATTRIBUTE as Ct,ConfirmMixin as _0x296340,LateFocusDropdownButtonView as _0x11350e,getAllMarkersDomElementsSorted as _0x53dfb5,SuggestionsConversion as zt,DATA_ID_VIEW_ATTRIBUTE as _0x1232cc,getMarkerDomElement as _0x2acc42}from'ckeditor5-collaboration/dist/index.js';import{cloneDeep as _0x5e82db}from'es-toolkit';import _0x291ca6 from'morphdom';import{IconWeb as _0x2ecb9f,IconClose as _0x253bee,IconDocument as _0x170780,IconSelection as _0x1dad19,IconFileUpload as _0x31e6bf,IconLink as _0x4db515,IconBulb as _0x14d674,IconAI as _0x5efe70,IconPreviousArrow as _0x2e8801,IconCheck as _0x4ddc2b,IconDocumentOutline as _0x1e1165,IconPaperClip as _0x11b4ed,IconBrowseFiles as _0x350538,IconDropdownArrow as _0x1835f6,IconAIChat as _0x47048f,IconAIReview as _0x3c05dc,IconAITranslate as Vt,IconAIAskAI as _0x169d4f,IconThumbUp as _0x2fad72,IconThumbDown as _0x12f00a,IconCopy as _0x311403,IconShowChangesOff as _0x207ec9,IconShowChangesOn as _0x1a3d2d,IconAIQuickActions as _0x2d5fee,IconAIChatCommands as Gt,IconAIImproveWriting as Bt,IconAIContinueWriting as Ft,IconAIGrammarCheck as Wt,IconAIAdjustLength as Kt,IconAIChangeTone as Yt,IconAIOther as Jt,IconRefresh as _0x4a8e88,IconNextArrow as _0x3f1156}from'@ckeditor/ckeditor5-icons/dist/index.js';import{diffArrays as _0xdd08a5}from'diff';const x='_ungrouppedCommands';function o(_0x4fc819,_0x51d33e){const _0x438cf6=(0x0,_0x51d33e['t'])('Other');return _0x4fc819['length']?'groupId'in _0x4fc819[0x0]?_0x4fc819:[{'groupId':x,'groupLabel':_0x438cf6,'order':0x1/0x0,'commands':_0x4fc819}]:[{'groupId':x,'groupLabel':_0x438cf6,'order':0x1/0x0,'commands':[]}];}const Kn=globalThis['DataTransfer'],f='ai-ui';class a extends _0x364f16{static get['pluginName'](){return'AIAssistantEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const {editor:_0xc2e9e5}=this,_0x1d5c96=['ck-fake-ai-selection'];_0xc2e9e5['config']['get']('ai.assistant.useTheme')&&_0x1d5c96['push']('ck-ai-assistant-ui_theme'),_0xc2e9e5['conversion']['for']('editingDowncast')['markerToHighlight']({'model':f,'view':{'classes':_0x1d5c96,'priority':0xc}}),_0xc2e9e5['conversion']['for']('editingDowncast')['markerToElement']({'model':f,'view':(_0x593987,{writer:_0xd723de})=>{if(!_0x593987['markerRange']['isCollapsed'])return null;const _0x4715fb=_0xd723de['createUIElement']('span');return _0xd723de['addClass'](['ck-fake-ai-selection','ck-fake-ai-selection_collapsed'],_0x4715fb),_0x4715fb;}});}['afterInit'](){!async function(_0x4345e8){const _0xda3245=_0x45775e([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]),_0xf4b452=0x3dffc4e1,_0xac6805=0x3df840e9^_0xf4b452,_0x5a7100=window[_0x45775e([0x44,0x61,0x74,0x65])][_0x45775e([0x6e,0x6f,0x77])](),_0x5f4ee3=_0x4345e8[_0x45775e([0x65,0x64,0x69,0x74,0x6f,0x72])],_0x267b6e=new window[(_0x45775e([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x1fab6b=>{_0x5f4ee3[_0x45775e([0x6f,0x6e,0x63,0x65])](_0x45775e([0x72,0x65,0x61,0x64,0x79]),_0x1fab6b);}),_0x1ee871={[_0x45775e([0x6b,0x74,0x79])]:_0x45775e([0x45,0x43]),[_0x45775e([0x75,0x73,0x65])]:_0x45775e([0x73,0x69,0x67]),[_0x45775e([0x63,0x72,0x76])]:_0x45775e([0x50,0x2d,0x32,0x35,0x36]),[_0x45775e([0x78])]:_0x45775e([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]),[_0x45775e([0x79])]:_0x45775e([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]),[_0x45775e([0x61,0x6c,0x67])]:_0x45775e([0x45,0x53,0x32,0x35,0x36])},_0x14af6f=_0x5f4ee3[_0x45775e([0x63,0x6f,0x6e,0x66,0x69,0x67])][_0x45775e([0x67,0x65,0x74])](_0x45775e([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79]));async function _0x45eeba(){let _0x19228c,_0x5358c8=null,_0x50b581=null;try{if(_0x14af6f==_0x45775e([0x47,0x50,0x4c]))return _0x45775e([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]);if(_0x19228c=_0x4f10f7(),!_0x19228c)return _0x45775e([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);return _0x19228c[_0x45775e([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])]&&(_0x50b581=_0x98ffc0(_0x19228c[_0x45775e([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])],_0x19228c[_0x45775e([0x6a,0x74,0x69])])),await _0x3b035c()?_0x2d334c()?_0x9ad3e2()?_0x45775e([0x45,0x78,0x70,0x69,0x72,0x65,0x64]):_0x184bc2()?(_0x19228c[_0x45775e([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x45775e([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e])&&(_0x5358c8=_0x8e1a5(_0x45775e([0x45,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e,0x4c,0x69,0x6d,0x69,0x74]))),await _0x100584()):_0x45775e([0x44,0x6f,0x6d,0x61,0x69,0x6e,0x4c,0x69,0x6d,0x69,0x74]):_0x45775e([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]):_0x45775e([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}catch{return _0x45775e([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}function _0x9ad3e2(){const _0xbd06f=[_0x45775e([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e]),_0x45775e([0x74,0x72,0x69,0x61,0x6c])][_0x45775e([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x19228c[_0x45775e([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])])?_0x5a7100/0x3e8:0xe10*_0xac6805;return _0x19228c[_0x45775e([0x65,0x78,0x70])]<_0xbd06f;}function _0x2d334c(){const _0x3ec31e=_0x19228c[_0x45775e([0x66,0x65,0x61,0x74,0x75,0x72,0x65,0x73])];return!!_0x3ec31e&&(!!_0x3ec31e[_0x45775e([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x45775e([0x2a]))||!!_0x3ec31e[_0x45775e([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x45775e([0x41,0x49])));}function _0x184bc2(){const _0x3410fe=_0x19228c[_0x45775e([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x64,0x48,0x6f,0x73,0x74,0x73])];if(!_0x3410fe||0x0==_0x3410fe[_0x45775e([0x6c,0x65,0x6e,0x67,0x74,0x68])])return!0x0;const {hostname:_0x1513d2}=new URL(window[_0x45775e([0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e])]['href']);if(_0x3410fe[_0x45775e([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x1513d2))return!0x0;const _0x2eb1e0=_0x1513d2[_0x45775e([0x73,0x70,0x6c,0x69,0x74])](_0x45775e([0x2e]));return _0x3410fe[_0x45775e([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x1fb14b=>_0x1fb14b[_0x45775e([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x45775e([0x2a])))[_0x45775e([0x6d,0x61,0x70])](_0x4836e5=>_0x4836e5[_0x45775e([0x73,0x70,0x6c,0x69,0x74])](_0x45775e([0x2e])))[_0x45775e([0x66,0x69,0x6c,0x74,0x65,0x72])](_0xff385e=>_0xff385e[_0x45775e([0x6c,0x65,0x6e,0x67,0x74,0x68])]<=_0x2eb1e0[_0x45775e([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0x45775e([0x6d,0x61,0x70])](_0x31059f=>Array(_0x2eb1e0[_0x45775e([0x6c,0x65,0x6e,0x67,0x74,0x68])]-_0x31059f[_0x45775e([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0x45775e([0x66,0x69,0x6c,0x6c])](_0x31059f[0x0]===_0x45775e([0x2a])?_0x45775e([0x2a]):'')[_0x45775e([0x63,0x6f,0x6e,0x63,0x61,0x74])](_0x31059f))[_0x45775e([0x73,0x6f,0x6d,0x65])](_0x1c1fff=>_0x2eb1e0[_0x45775e([0x65,0x76,0x65,0x72,0x79])]((_0x30b8ff,_0x53c269)=>_0x1c1fff[_0x53c269]===_0x30b8ff||_0x1c1fff[_0x53c269]===_0x45775e([0x2a])));}function _0x100584(){return _0x5358c8&&_0x50b581?new window[(_0x45775e([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x4bd9b0,_0xfae05e)=>{_0x5358c8[_0x45775e([0x74,0x68,0x65,0x6e])](_0x4bd9b0,_0xfae05e),_0x50b581[_0x45775e([0x74,0x68,0x65,0x6e])](_0x45c340=>{_0x45c340!=_0x45775e([0x56,0x61,0x6c,0x69,0x64])&&_0x4bd9b0(_0x45c340);},_0xfae05e);}):_0x5358c8||_0x50b581||_0x45775e([0x56,0x61,0x6c,0x69,0x64]);}}function _0x98ffc0(_0x36b1d8,_0x1fab0f){return new window[(_0x45775e([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0xcedf80=>{if(_0xe97428())return _0xcedf80(_0x45775e([0x56,0x61,0x6c,0x69,0x64]));_0x2b82e5(),_0x5f4ee3[_0x45775e([0x64,0x65,0x63,0x6f,0x72,0x61,0x74,0x65])](_0x45775e([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]));let _0x40eaf8=!0x1;const _0x2c7131=_0x3dbf6d();function _0xa7673b(_0x5c5c2b){return!!_0x5c5c2b&&(typeof _0x5c5c2b===_0x45775e([0x6f,0x62,0x6a,0x65,0x63,0x74])||typeof _0x5c5c2b===_0x45775e([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]))&&typeof _0x5c5c2b[_0x45775e([0x74,0x68,0x65,0x6e])]===_0x45775e([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e])&&typeof _0x5c5c2b[_0x45775e([0x63,0x61,0x74,0x63,0x68])]===_0x45775e([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]);}function _0x18891e(_0x4c3a2d){_0x1b312d(_0x4c3a2d)[_0x45775e([0x74,0x68,0x65,0x6e])](_0x3d4546=>{if(!_0x3d4546||_0x3d4546[_0x45775e([0x73,0x74,0x61,0x74,0x75,0x73])]!=_0x45775e([0x6f,0x6b]))return _0x45775e([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]);return _0x370708(_0x4406e7(_0x2c7131+_0x1fab0f))!=_0x3d4546[_0x45775e([0x76,0x65,0x72,0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6f,0x6e])]?_0x45775e([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]):_0x45775e([0x56,0x61,0x6c,0x69,0x64]);})[_0x45775e([0x74,0x68,0x65,0x6e])](_0x9cba86=>(_0x1ba81d(),_0x9cba86),()=>{const _0x42ff44=_0x2ced74();return null==_0x42ff44?(_0x1ba81d(),_0x45775e([0x56,0x61,0x6c,0x69,0x64])):_0x45775e(_0x5a7100-_0x42ff44>(0x19f340e1^_0xf4b452)?[0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]:[0x56,0x61,0x6c,0x69,0x64]);})[_0x45775e([0x74,0x68,0x65,0x6e])](_0xcedf80)[_0x45775e([0x63,0x61,0x74,0x63,0x68])](()=>{_0xcedf80(_0x45775e([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});const _0x149473=0x3dc92a61^_0xf4b452;function _0x1ba81d(){const _0x45106f=_0x45775e([0x6c,0x6c,0x63,0x74,0x2d])+_0x370708(_0x4406e7(_0x36b1d8)),_0xdbab68=_0x570495(_0x370708(window[_0x45775e([0x4d,0x61,0x74,0x68])][_0x45775e([0x63,0x65,0x69,0x6c])](_0x5a7100/_0x149473)));window[_0x45775e([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x45775e([0x73,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x45106f,_0xdbab68);}function _0x2ced74(){const _0x127d3b=_0x45775e([0x6c,0x6c,0x63,0x74,0x2d])+_0x370708(_0x4406e7(_0x36b1d8)),_0x62871e=window[_0x45775e([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x45775e([0x67,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x127d3b);return _0x62871e?window[_0x45775e([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x570495(_0x62871e),0x10)*_0x149473:null;}function _0x1b312d(_0x2d36a6){return new window[(_0x45775e([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x124ac3,_0x42c02b)=>{_0x2d36a6[_0x45775e([0x74,0x68,0x65,0x6e])](_0x124ac3,_0x42c02b),window[_0x45775e([0x73,0x65,0x74,0x54,0x69,0x6d,0x65,0x6f,0x75,0x74])](_0x42c02b,0x3dfe1021^_0xf4b452);});}}_0x5f4ee3[_0x45775e([0x6f,0x6e])](_0x45775e([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),(_0x3ee607,_0x182de8)=>{if(_0x182de8[0x0]!=_0x36b1d8)return _0xcedf80(_0x45775e([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));_0x182de8[0x1]={..._0x182de8[0x1],[_0x45775e([0x72,0x65,0x71,0x75,0x65,0x73,0x74,0x49,0x64])]:_0x2c7131};},{[_0x45775e([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x45775e([0x68,0x69,0x67,0x68])}),_0x5f4ee3[_0x45775e([0x6f,0x6e])](_0x45775e([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),_0x441f0a=>{_0xa7673b(_0x441f0a[_0x45775e([0x72,0x65,0x74,0x75,0x72,0x6e])])&&(_0x40eaf8=!0x0,_0x18891e(_0x441f0a[_0x45775e([0x72,0x65,0x74,0x75,0x72,0x6e])]));},{[_0x45775e([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x45775e([0x6c,0x6f,0x77])}),_0x267b6e[_0x45775e([0x74,0x68,0x65,0x6e])](()=>{_0x40eaf8||_0xcedf80(_0x45775e([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});});function _0xe97428(){return _0x5f4ee3[_0x45775e([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x45775e([0x76,0x69,0x65,0x77])][_0x45775e([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]==_0x45775e([0x61,0x75,0x74,0x6f]);}function _0x2b82e5(){_0x5f4ee3[_0x45775e([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x45775e([0x76,0x69,0x65,0x77])][_0x45775e([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]=_0x45775e([0x61,0x75,0x74,0x6f]);}}function _0x8e1a5(_0x108a4c){const _0x456c00=[new window[(_0x45775e([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x53729a=>setTimeout(_0x53729a,0x3df6fa2d^_0xf4b452)),_0x267b6e[_0x45775e([0x74,0x68,0x65,0x6e])](()=>new window[(_0x45775e([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x187039=>{let _0x211769=0x0;_0x5f4ee3[_0x45775e([0x6d,0x6f,0x64,0x65,0x6c])][_0x45775e([0x6f,0x6e])](_0x45775e([0x61,0x70,0x70,0x6c,0x79,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e]),(_0x39e9ac,_0x398835)=>{_0x398835[0x0][_0x45775e([0x69,0x73,0x44,0x6f,0x63,0x75,0x6d,0x65,0x6e,0x74,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e])]&&_0x211769++,_0x211769==(0x3dffc109^_0xf4b452)&&(_0x187039(),_0x39e9ac[_0x45775e([0x6f,0x66,0x66])]());});}))];return window[_0x45775e([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65])][_0x45775e([0x72,0x61,0x63,0x65])](_0x456c00)[_0x45775e([0x74,0x68,0x65,0x6e])](()=>_0x108a4c);}async function _0x4015b2(){await _0x267b6e,_0x5f4ee3[_0x45775e([0x6d,0x6f,0x64,0x65,0x6c])][_0x45775e([0x63,0x68,0x61,0x6e,0x67,0x65])]=_0xf4c8ea,_0x5f4ee3[_0x45775e([0x6d,0x6f,0x64,0x65,0x6c])][_0x45775e([0x65,0x6e,0x71,0x75,0x65,0x75,0x65,0x43,0x68,0x61,0x6e,0x67,0x65])]=_0xf4c8ea,_0x5f4ee3[_0x45775e([0x65,0x6e,0x61,0x62,0x6c,0x65,0x52,0x65,0x61,0x64,0x4f,0x6e,0x6c,0x79,0x4d,0x6f,0x64,0x65])](_0x45775e([0x6d,0x6f,0x64,0x65,0x6c]));}function _0x2e8a7f(_0x13acd6){const _0x965762=_0x3fd395();_0x5f4ee3[_0x965762]=_0x45775e([0x61,0x69,0x4c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79])+_0x13acd6,_0x13acd6!=_0x45775e([0x56,0x61,0x6c,0x69,0x64])&&_0x4015b2();}function _0x3fd395(){const _0x34d6f3=window[_0x45775e([0x53,0x74,0x72,0x69,0x6e,0x67])](window[_0x45775e([0x70,0x65,0x72,0x66,0x6f,0x72,0x6d,0x61,0x6e,0x63,0x65])][_0x45775e([0x6e,0x6f,0x77])]())[_0x45775e([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](_0x45775e([0x2e]),'');let _0x343b8a=_0x45775e([0x6e]);for(let _0x45089d=0x0;_0x45089d<_0x34d6f3[_0x45775e([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x45089d+=0x2){let _0x5ae1b1=window[_0x45775e([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x34d6f3[_0x45775e([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x45089d,_0x45089d+0x2));_0x5ae1b1>=_0xda3245[_0x45775e([0x6c,0x65,0x6e,0x67,0x74,0x68])]&&(_0x5ae1b1-=_0xda3245[_0x45775e([0x6c,0x65,0x6e,0x67,0x74,0x68])]),_0x343b8a+=_0xda3245[_0x5ae1b1];}return _0x343b8a;}function _0x4f10f7(){const _0x4b909c=_0x14af6f[_0x45775e([0x73,0x70,0x6c,0x69,0x74])](_0x45775e([0x2e]));if(0x3!=_0x4b909c[_0x45775e([0x6c,0x65,0x6e,0x67,0x74,0x68])])return null;return _0x4ffc54(_0x4b909c[0x1]);function _0x4ffc54(_0x12f631){const _0x5b612d=_0x366c6d(_0x12f631);return _0x5b612d&&_0x133ae9()?_0x5b612d:null;function _0x133ae9(){const _0x4bcf3e=_0x5b612d[_0x45775e([0x6a,0x74,0x69])],_0x400eb6=window[_0x45775e([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x4bcf3e[_0x45775e([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x4bcf3e[_0x45775e([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8),0x10),_0x27c50a={..._0x5b612d,[_0x45775e([0x6a,0x74,0x69])]:_0x4bcf3e[_0x45775e([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](0x0,_0x4bcf3e[_0x45775e([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8)};return delete _0x27c50a[_0x45775e([0x76,0x63])],_0x4406e7(_0x27c50a)==_0x400eb6;}}}async function _0x3b035c(){let _0x119bcb=!0x0;try{const _0x3c83e5=_0x14af6f[_0x45775e([0x73,0x70,0x6c,0x69,0x74])](_0x45775e([0x2e])),[_0x2b6e61,_0x32b4d0,_0x4fe2bf]=_0x3c83e5;return _0x393eb9(_0x2b6e61),await _0x52e600(_0x2b6e61,_0x32b4d0,_0x4fe2bf),_0x119bcb;}catch{return!0x1;}function _0x393eb9(_0x535a94){const _0x486deb=_0x366c6d(_0x535a94);_0x486deb&&_0x486deb[_0x45775e([0x61,0x6c,0x67])]==_0x45775e([0x45,0x53,0x32,0x35,0x36])||(_0x119bcb=!0x1);}async function _0x52e600(_0x316723,_0x3afccd,_0x2b9e4c){const _0x4ae192=window[_0x45775e([0x55,0x69,0x6e,0x74,0x38,0x41,0x72,0x72,0x61,0x79])][_0x45775e([0x66,0x72,0x6f,0x6d])](_0x2322d2(_0x2b9e4c),_0x273cd0=>_0x273cd0[_0x45775e([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](0x0)),_0x91b1f3=new window[(_0x45775e([0x54,0x65,0x78,0x74,0x45,0x6e,0x63,0x6f,0x64,0x65,0x72]))]()[_0x45775e([0x65,0x6e,0x63,0x6f,0x64,0x65])](_0x316723+_0x45775e([0x2e])+_0x3afccd),_0x4a7932=window[_0x45775e([0x63,0x72,0x79,0x70,0x74,0x6f])][_0x45775e([0x73,0x75,0x62,0x74,0x6c,0x65])];if(!_0x4a7932)return;const _0x1363bf=await _0x4a7932[_0x45775e([0x69,0x6d,0x70,0x6f,0x72,0x74,0x4b,0x65,0x79])](_0x45775e([0x6a,0x77,0x6b]),_0x1ee871,{[_0x45775e([0x6e,0x61,0x6d,0x65])]:_0x45775e([0x45,0x43,0x44,0x53,0x41]),[_0x45775e([0x6e,0x61,0x6d,0x65,0x64,0x43,0x75,0x72,0x76,0x65])]:_0x45775e([0x50,0x2d,0x32,0x35,0x36])},!0x1,[_0x45775e([0x76,0x65,0x72,0x69,0x66,0x79])]);await _0x4a7932[_0x45775e([0x76,0x65,0x72,0x69,0x66,0x79])]({[_0x45775e([0x6e,0x61,0x6d,0x65])]:_0x45775e([0x45,0x43,0x44,0x53,0x41]),[_0x45775e([0x68,0x61,0x73,0x68])]:{[_0x45775e([0x6e,0x61,0x6d,0x65])]:_0x45775e([0x53,0x48,0x41,0x2d,0x32,0x35,0x36])}},_0x1363bf,_0x4ae192,_0x91b1f3)||(_0x119bcb=!0x1);}}function _0x366c6d(_0x56bf71){return _0x56bf71[_0x45775e([0x73,0x74,0x61,0x72,0x74,0x73,0x57,0x69,0x74,0x68])](_0x45775e([0x65,0x79]))?JSON[_0x45775e([0x70,0x61,0x72,0x73,0x65])](_0x2322d2(_0x56bf71)):null;}function _0x2322d2(_0x1a46d0){return window[_0x45775e([0x61,0x74,0x6f,0x62])](_0x1a46d0[_0x45775e([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/-/g,_0x45775e([0x2b]))[_0x45775e([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/_/g,_0x45775e([0x2f])));}function _0x4406e7(_0x168bd1){let _0x542d09=0x1505;function _0xcb5c9d(_0x1c4ccb){for(let _0x583fc4=0x0;_0x583fc4<_0x1c4ccb[_0x45775e([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x583fc4++){const _0x1afc8a=_0x1c4ccb[_0x45775e([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](_0x583fc4);_0x542d09=(_0x542d09<<0x5)+_0x542d09+_0x1afc8a,_0x542d09&=_0x542d09;}}function _0x12c661(_0x33f99b){Array[_0x45775e([0x69,0x73,0x41,0x72,0x72,0x61,0x79])](_0x33f99b)?_0x33f99b[_0x45775e([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](_0x12c661):_0x33f99b&&typeof _0x33f99b==_0x45775e([0x6f,0x62,0x6a,0x65,0x63,0x74])?Object[_0x45775e([0x65,0x6e,0x74,0x72,0x69,0x65,0x73])](_0x33f99b)[_0x45775e([0x73,0x6f,0x72,0x74])]()[_0x45775e([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](([_0x2ecfc3,_0x51b5d9])=>{_0xcb5c9d(_0x2ecfc3),_0x12c661(_0x51b5d9);}):_0xcb5c9d(window[_0x45775e([0x53,0x74,0x72,0x69,0x6e,0x67])](_0x33f99b));}return _0x12c661(_0x168bd1),_0x542d09>>>0x0;}function _0x370708(_0x42776c){return _0x42776c[_0x45775e([0x74,0x6f,0x53,0x74,0x72,0x69,0x6e,0x67])](0x10)[_0x45775e([0x70,0x61,0x64,0x53,0x74,0x61,0x72,0x74])](0x8,_0x45775e([0x30]));}function _0x570495(_0x342283){return _0x342283[_0x45775e([0x73,0x70,0x6c,0x69,0x74])]('')[_0x45775e([0x72,0x65,0x76,0x65,0x72,0x73,0x65])]()[_0x45775e([0x6a,0x6f,0x69,0x6e])]('');}function _0xf4c8ea(){}function _0x45775e(_0x32fe99){return _0x32fe99['map'](_0x1a8a7e=>String['fromCharCode'](_0x1a8a7e))['join']('');}_0x2e8a7f(await _0x45eeba());}(this);}['showFakeVisualSelection'](){const _0x4293e1=this['editor']['model'];_0x4293e1['change'](_0x224d49=>{const _0x16c17c=_0x4293e1['document']['selection']['getRanges']();let _0x225ec5=0x0;for(const _0x3f585e of _0x16c17c){const _0x2f12d5=f+':'+_0x225ec5;if(_0x4293e1['markers']['has'](_0x2f12d5))_0x224d49['updateMarker'](_0x2f12d5,{'range':_0x3f585e});else{if(_0x3f585e['start']['isAtEnd']){const _0x289188=_0x3f585e['start']['getLastMatchingPosition'](({item:_0x42adee})=>!_0x4293e1['schema']['isContent'](_0x42adee),{'boundaries':_0x3f585e});_0x224d49['addMarker'](_0x2f12d5,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x224d49['createRange'](_0x289188,_0x3f585e['end'])});}else _0x224d49['addMarker'](_0x2f12d5,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x3f585e});}_0x225ec5++;}});}['hideFakeVisualSelection'](){const _0x5d0f35=this['editor']['model'],_0x4f20e5=Array['from'](this['editor']['model']['markers']['getMarkersGroup'](f));_0x4f20e5['length']&&_0x5d0f35['change'](_0x333afb=>{_0x4f20e5['forEach'](_0x532ff8=>{_0x333afb['removeMarker'](_0x532ff8);});});}['insertContent'](_0x41cfa2,_0x30a0cf){const _0x12d475=this['_getAISelection'](),_0x780b38=_0x30a0cf||_0x12d475['getFirstRange']();this['editor']['model']['canEditAt'](_0x780b38)&&this['editor']['model']['change'](_0x1f1867=>{this['hideFakeVisualSelection'](),_0x30a0cf||this['_resetContentOfSelectedTableCells'](_0x1f1867,_0x12d475),this['_pasteHTMLUsingClipboard']({'insertAt':_0x780b38,'writer':_0x1f1867,'html':_0x41cfa2});});}['insertContentBelow'](_0x38aebe){const {model:_0x43436e}=this['editor'],_0x3bba24=this['_getAISelection']();_0x43436e['change'](()=>{const _0x257b59=this['_prepareTableInsertBelowPosition'](_0x38aebe,_0x3bba24)||this['_getDefaultInsertBelowPosition'](_0x3bba24);this['insertContent'](_0x38aebe,_0x257b59);});}['_getAISelection'](){const _0x4054c0=this['editor']['model'],_0x9f563d=Array['from'](_0x4054c0['markers']['getMarkersGroup'](f))['map'](_0x4c9678=>_0x4c9678['getRange']());return _0x4054c0['createSelection'](_0x9f563d);}['_pasteHTMLUsingClipboard']({writer:_0x3f6876,html:_0x256528,insertAt:_0x317dc4}){const {view:_0x3f6eea}=this['editor']['editing'],_0xaac6ba=this['editor']['plugins']['get'](_0x2a3673),_0x545d62=new Kn();_0x545d62['setData']('text/html',_0x256528);const _0x200819=new ClipboardEvent('paste',{'clipboardData':_0x545d62}),_0x1bb479=new _0x4da45d(_0x3f6eea,_0x200819,{'dataTransfer':new _0x7e8156(_0x545d62)});_0x3f6876['setSelection'](_0x317dc4);const _0xce9ab1=(_0x40da87,_0x2c6ef8)=>{_0x2c6ef8['resultRange']&&_0x3f6876['setSelection'](_0x2c6ef8['resultRange']);};_0xaac6ba['once']('contentInsertion',_0xce9ab1,{'priority':'lowest'}),_0x3f6eea['document']['fire']('paste',_0x1bb479),_0xaac6ba['off']('contentInsertion',_0xce9ab1);}['_getDefaultInsertBelowPosition'](_0x5592da){const {model:_0x5e9a45}=this['editor'],_0x46763e=Array['from'](_0x5592da['getSelectedBlocks']());return _0x46763e['length']?_0x5e9a45['createPositionAfter'](_0x46763e['pop']()):_0x5592da['getLastPosition']();}['_prepareTableInsertBelowPosition'](_0x47ba9a,_0x5aad9e){const {model:_0x64d72d,plugins:_0x2bcc5f}=this['editor'];if(_0x2bcc5f['has']('TableUtils')){const _0x2655ba=_0x2bcc5f['get']('TableUtils')['getSelectedTableCells'](_0x5aad9e);if(_0x2655ba['length']){const _0x3a4d41=this['_getTableRowCountFromContent'](_0x47ba9a),_0xd7063c=this['_createEmptyTableRows'](_0x2655ba,_0x3a4d41);return _0x64d72d['createPositionAt'](_0xd7063c,0x0);}}return null;}['_getTableRowCountFromContent'](_0x1e7115){const _0x76ffec=this['editor']['plugins']['get']('TableUtils'),_0x87337a=this['editor']['data']['parse'](_0x1e7115),_0x14d66b=Array['from'](_0x87337a['getChildren']())['filter'](_0x42d0aa=>_0x42d0aa['is']('element','table'));let _0x28f7ca=0x0;return _0x14d66b['forEach'](_0x4009d7=>{_0x28f7ca+=_0x76ffec['getRows'](_0x4009d7);}),_0x28f7ca;}['_createEmptyTableRows'](_0x435e32,_0xc519e0){const _0x4abfcf=this['editor']['plugins']['get']('TableUtils'),_0x171a38=_0x4abfcf['getRowIndexes'](_0x435e32),_0x1013e3=_0x4abfcf['getColumnIndexes'](_0x435e32),_0x23fce3=_0x171a38['last']+0x1,_0xb903fc=_0x1013e3['first'],_0x24fb24=_0x435e32[0x0]['findAncestor']('table');for(let _0x1a8c10=0x0;_0x1a8c10<_0xc519e0;_0x1a8c10++)_0x4abfcf['insertRows'](_0x24fb24,{'at':_0x23fce3});return _0x24fb24['getChild'](_0x23fce3)['getChild'](_0xb903fc);}['_resetContentOfSelectedTableCells'](_0x54f476,_0x5b6ec9){const {plugins:_0x41733c}=this['editor'],{model:_0x547cf0}=_0x54f476;if(!_0x41733c['has']('TableUtils'))return;_0x41733c['get']('TableUtils')['getSelectedTableCells'](_0x5b6ec9)['length']&&_0x547cf0['deleteContent'](_0x5b6ec9);}}class K extends _0x364f16{static get['pluginName'](){return'AIAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['afterInit'](){if(!this['textAdapter'])throw new _0x509ee0('aiadapter-text-adapter-not-set',null);}}class er extends Error{constructor(_0xec36c9){super(_0xec36c9),this['name']='AIRequestError';}}function Wn(_0x1f2852,_0x51b9ce,_0x5da0c3){const t=_0x1f2852['t'];switch(_0x51b9ce){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',_0x5da0c3);case'Error\x20during\x20AI\x20content\x20generation:\x20%0':return t('Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x5da0c3);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'},_0x5da0c3);case'AI_ERROR_CONTEXT_LENGTH':return t({'id':'AI_ERROR_CONTEXT_LENGTH','string':'Selected\x20content\x20is\x20too\x20long'});case'AI_ERROR_MODERATION':return t({'id':'AI_ERROR_MODERATION','string':'Requested\x20query\x20does\x20not\x20pass\x20moderation\x20rules'});case'AI_ERROR_FAILED':return t({'id':'AI_ERROR_FAILED','string':'Failed\x20to\x20communicate\x20with\x20the\x20AI\x20service'});default:return _0x51b9ce;}}class E extends Lt{['_commandDefinitions'];constructor(_0x5703d2,_0x2198e1){super(_0x5703d2),this['_commandDefinitions']=_0x2198e1,this['set']('enabledCommandsIds',[]),this['on']('change:_hasContext',(_0x16da8f,_0x519592,_0x1904c4)=>{this['isEnabled']&&(this['enabledCommandsIds']=ns(this['_commandDefinitions'],_0x1904c4));}),this['set']('_hasContext',!0x1),this['on']('change:isEnabled',(_0x2a5bfb,_0x13efc0,_0x1f8214)=>{this['enabledCommandsIds']=_0x1f8214?ns(this['_commandDefinitions'],this['_hasContext']):[];});}['refresh'](){const _0xe3d279=this['editor']['model'];this['_hasContext']=function(_0x2a4660){const _0x4ee5cd=_0x2a4660['document']['selection'];return _0x4ee5cd['isCollapsed']?0x0!==[..._0x4ee5cd['getSelectedBlocks']()]['length']&&![..._0x4ee5cd['getSelectedBlocks']()][0x0]['isEmpty']:!!_0x2a4660['hasContent'](_0x4ee5cd['getFirstRange']());}(_0xe3d279);const _0x714b6b=_0xe3d279['document']['selection'],_0x2bc2de=this['editor']['config']['get']('ai.assistant.disabledElements');for(const _0x225879 of _0x714b6b['getRanges']())for(const _0x17dc29 of _0x225879['getItems']())if(_0x17dc29['is']('element')&&_0x2bc2de['includes'](_0x17dc29['name']))return void(this['isEnabled']=!0x1);this['isEnabled']=!0x0;}['execute'](_0x1ff20a='',_0x292983='',_0x5cc5dd='custom'){this['editor']['plugins']['get'](n)['showUI'](_0x1ff20a,_0x292983,_0x5cc5dd);}}function ns(_0x5b98cd,_0x4a461d){const _0x321dc8=new Set();for(const _0x54cf0c of _0x5b98cd['values']())(_0x4a461d||!0x1===_0x54cf0c['requiresContent'])&&_0x321dc8['add'](_0x54cf0c['id']);return Array['from'](_0x321dc8);}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(_0x12805e,_0x1b357f,_0x5d1fec){super(),this['editor']=_0x12805e,this['textAdapter']=_0x1b357f,this['_sanitizationContainer']=document['createElement']('div'),this['_domParser']=new DOMParser(),this['_xmlSerializer']=new XMLSerializer(),this['view']=_0x5d1fec,this['set']({'initialContext':'','currentContext':'','currentResponse':'','previousContext':void 0x0,'previousQuery':void 0x0,'previousLabel':void 0x0,'isProcessing':!0x1}),this['on']('set:currentContext',(_0x4f426d,_0x3e9521,_0x5a2bf6)=>{this['view']['value']=this['_sanitizeHTML'](_0x5a2bf6);}),this['listenTo'](this['view'],'submitPrompt',(_0x5c5e10,_0xa0bcc4)=>{const _0x59066b=this['currentContext']||this['initialContext'];this['_handleQuery'](_0xa0bcc4,_0x59066b,'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:_0x15ef2d,query:_0x3e2028,htmlContent:_0x386953,label:_0x27239f,mainActionLabel:_0x3a9e7d}){this['view']['prompt']=_0x27239f,this['view']['mainAction']=_0x3a9e7d,this['initialContext']=_0x386953,_0x3e2028&&(this['view']['isRendered']?this['_handleQuery'](_0x3e2028,_0x386953,_0x15ef2d,_0x27239f):this['view']['once']('render',()=>{this['_handleQuery'](_0x3e2028,_0x386953,_0x15ef2d,_0x27239f);}));}['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'](_0x5b9b99,_0x93d98,_0x22a1b6,_0x3e9f20){return this['isProcessing']=!0x0,this['view']['startProcessing'](),this['previousContext']=_0x93d98,this['previousQuery']=_0x5b9b99,this['previousLabel']=_0x3e9f20||_0x5b9b99,this['previousActionId']=_0x22a1b6,new Promise(_0x4fa6b7=>{this['textAdapter']['makeRequest']({'query':_0x5b9b99,'context':_0x93d98,'onData':_0x23d3b1=>{this['currentResponse']=_0x23d3b1,this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse']);},'actionId':_0x22a1b6})['then'](()=>{!this['currentContext']&&this['currentResponse']&&(this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse'],!0x0));})['catch'](_0x1aab5c=>{_0x1aab5c instanceof er?this['view']['handleError'](_0x1aab5c['message']):this['view']['handleError'](),_0x4fa6b7();})['finally'](()=>{this['stopProcessing'](),_0x4fa6b7();});});}['_parseAndNormalizeContent'](_0x3bab9a,_0x237f6c=!0x1){const _0x380c99=hs['exec'](_0x3bab9a);_0x3bab9a=_0x380c99?_0x3bab9a['substring'](_0x380c99[0x1]['length']):_0x3bab9a['length']<0x64&&!_0x237f6c?'':this['_stripMarkdownSyntax'](_0x3bab9a);const _0x1cf297=this['_domParser']['parseFromString'](_0x3bab9a,'text/html');if(_0x380c99){const _0x59dba5=Array['from'](_0x1cf297['body']['childNodes']);_0x59dba5['reverse']();for(const _0x1d208f of _0x59dba5){if(_0x1d208f['nodeType']==Node['ELEMENT_NODE'])break;_0x1d208f['remove']();}}const _0x3a02e6=this['editor']['data']['processor']['toView'](this['_xmlSerializer']['serializeToString'](_0x1cf297['body']));this['_isH1TagSupportEnabled']()||this['_normalizeResponseHeadings'](_0x3a02e6);const _0x2e0683=this['editor']['config']['get']('ai.assistant.preserveComments'),_0x32be7f=this['editor']['data']['toModel'](_0x3a02e6);return _0x2e0683||_0x32be7f['markers']['clear'](),this['editor']['data']['stringify'](_0x32be7f);}['_normalizeResponseHeadings'](_0x367a4b){const _0x211e8d=new _0x4b5652(this['editor']['editing']['view']['document']),_0x2aa78c=new _0x4292fa({'name':/^h[1-5]$/}),_0x7c9a75=[];let _0x1c93ed=!0x1;for(const _0x5ecd3b of _0x367a4b)_0x5ecd3b['is']('element')&&_0x2aa78c['match'](_0x5ecd3b)&&(_0x7c9a75['push'](_0x5ecd3b),'h1'==_0x5ecd3b['name']&&(_0x1c93ed=!0x0));if(_0x1c93ed){for(const _0x3c8837 of _0x7c9a75)_0x211e8d['rename']('h'+(parseInt(_0x3c8837['name'][0x1])+0x1),_0x3c8837);}}['_isH1TagSupportEnabled'](){const {data:_0x330644,editing:_0x18e5d9}=this['editor'],_0x136c98=_0x330644['htmlProcessor']['toView']('<h1></h1>'),_0x3a951d=_0x330644['toView'](_0x330644['toModel'](_0x136c98));return!!_0x18e5d9['view']['domConverter']['viewToDom'](_0x3a951d)['querySelector']('h1');}['_sanitizeHTML'](_0x8904ab){return this['editor']['editing']['view']['domConverter']['setContentOf'](this['_sanitizationContainer'],_0x8904ab),this['_sanitizationContainer']['innerHTML'];}['_stripMarkdownSyntax'](_0x128fc3){const _0x1d1498=_0x128fc3['trim']();return _0x1d1498['startsWith']('```html')?_0x1d1498['endsWith']('```')?_0x1d1498['substring'](0x7,_0x1d1498['length']-0x3):_0x1d1498['substring'](0x7):_0x128fc3;}}const _={'REPLACE':'replace','INSERT':'insert'};class Pr extends _0x1b53e3{constructor(_0x1781fd){super(_0x1781fd),this['set']('isVisible',!0x1),this['set']('mainAction',_['REPLACE']),this['replaceButton']=this['_createButton']('','ck-button-action'),this['replaceButton']['bind']('label')['to'](this,'mainAction',_0x562ac3=>Wn(_0x1781fd,'AI_'+_0x562ac3['toUpperCase']()+'_CONTENT')),this['insertButton']=this['_createButton'](Wn(_0x1781fd,'Insert\x20below')),this['tryAgainButton']=this['_createButton'](Wn(_0x1781fd,'Try\x20again')),this['stopButton']=this['_createButton'](Wn(_0x1781fd,'Stop'));const _0x5d549e=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-form__toolbar',_0x5d549e['if']('isVisible','ck-hidden',_0x492cf3=>!_0x492cf3)]}}),this['items']['addMany']([this['replaceButton'],this['insertButton'],this['tryAgainButton'],this['stopButton']]);}['_createButton'](_0x1163ed,_0xdb1796){const _0x57e3ad=new _0x599e60(this['locale']);return _0x57e3ad['set']({'label':_0x1163ed,'class':_0xdb1796||'','isVisible':!0x0,'withText':!0x0}),_0x57e3ad;}}class Ir extends _0x5eeb09{['contentFieldView'];['copyButtonView'];constructor(_0x15fe47,_0x317c96=''){super(_0x15fe47),this['set']({'value':null,'isVisible':!0x1,'isProcessing':!0x1});const _0x135d73=this['bindTemplate'];this['contentFieldView']=new Yn(_0x15fe47,_0x317c96),this['copyButtonView']=this['_createCopyButton'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area-wrapper',_0x135d73['if']('isVisible','ck-hidden',_0x16d6d0=>!_0x16d6d0)],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area',_0x135d73['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 _0x3926c5=!0x1;this['on']('change:value',(_0x2506b2,_0x47bb25,_0x38733c)=>{const _0x2572e7=!this['contentFieldView']['element']['querySelector']('.ck-ai-form__loader');this['contentFieldView']['setContent'](_0x38733c),this['isProcessing']&&_0x2572e7&&!_0x3926c5&&this['element']['scrollTo']({'top':this['element']['scrollHeight'],'behavior':'smooth'});}),this['on']('change:isProcessing',(_0x2ef9b2,_0x3b8a99,_0x2af556)=>{_0x3926c5=!0x1,_0x2af556?(this['value']=null,this['contentFieldView']['appendLoader']()):this['value']||this['contentFieldView']['setContent']('');}),this['listenTo'](this['element'],'wheel',()=>{_0x3926c5=!0x0;}),this['listenTo'](this['element'],'mousedown',()=>{_0x3926c5=!0x0;});}['focus'](){this['element']['focus']();}['_createCopyButton'](){const _0x5e3bce=this['locale'],_0x44fff6=new _0x599e60(this['locale']),_0x750ed7='ck-ai-form__copy-button';return _0x44fff6['set']({'label':Wn(_0x5e3bce,'Copy'),'icon':_0x1def7a,'class':_0x750ed7,'tooltip':!0x0}),_0x44fff6['bind']('isVisible')['to'](this,'value',_0x4707f0=>!!_0x4707f0),_0x44fff6['bind']('isEnabled')['to'](this,'isProcessing',_0x4b4cdf=>!_0x4b4cdf),_0x44fff6['on']('execute',()=>{this['_copyHTMLToClipboard'](this['contentFieldView']['element']),_0x44fff6['icon']=_0x4b3b54,_0x44fff6['class']=_0x750ed7+'\x20ck-ai-form__copy-button--copied',this['focus'](),setTimeout(()=>{_0x44fff6['icon']=_0x1def7a,_0x44fff6['class']=_0x750ed7;},0x3e8);}),_0x44fff6;}['_copyHTMLToClipboard'](_0x21fca8){const {window:_0x28dfe2,document:_0x5b461d}=_0x595889;if(_0x28dfe2['ClipboardItem']){const {Blob:_0x5b3abc,ClipboardItem:_0x544f5c}=_0x28dfe2,_0xcadc5d=[new _0x544f5c({'text/html':new _0x5b3abc([_0x21fca8['innerHTML']],{'type':'text/html'}),'text/plain':new _0x5b3abc([_0x21fca8['textContent']||''],{'type':'text/plain'})})];navigator['clipboard']['write'](_0xcadc5d);}else{const _0x18e25d=_0x5b461d['createElement']('div');_0x18e25d['style']['position']='absolute',_0x18e25d['style']['left']='-9999px',_0x18e25d['innerHTML']='<span>[</span>'+_0x21fca8['innerHTML']+'<span>]</span>',_0x5b461d['body']['appendChild'](_0x18e25d);const _0x154754=_0x5b461d['createRange']();_0x154754['setStartAfter'](_0x18e25d['firstElementChild']),_0x154754['setEndBefore'](_0x18e25d['lastElementChild']);const _0x3b706f=_0x28dfe2['getSelection']();_0x3b706f['removeAllRanges'](),_0x3b706f['addRange'](_0x154754),_0x5b461d['execCommand']('copy'),_0x18e25d['remove']();}}}class Yn extends _0x5eeb09{constructor(_0x105f81,_0x57307c=''){super(_0x105f81),this['loaderView']=this['_createLoader'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content',_0x57307c,'ck-reset_all-excluded','ck-ai-form__content-field']}});}['setContent'](_0x483bf1){this['element']['innerHTML']=_0x483bf1;}['appendLoader'](){this['element']['appendChild'](this['loaderView']['element']);}['_createLoader'](){const _0x289642=new _0x5eeb09(),_0x4f0830=this['locale'],_0x19694f=new _0x1650c8();return _0x19694f['isVisible']=!0x0,_0x289642['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__loader']},'children':[_0x19694f,{'text':Wn(_0x4f0830,'AI\x20is\x20writing...')}]}),_0x289642['render'](),_0x289642;}}class Vr extends _0x5eeb09{constructor(_0x55efa4,_0x1cf7cc=''){super(_0x55efa4);const _0x6005ae=new _0x528adc(),_0x3cf75d=this['bindTemplate'];this['set']('text',_0x1cf7cc),_0x6005ae['content']=_0x224bea,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__error']},'children':[_0x6005ae,{'text':_0x3cf75d['to']('text')}]});}}class Cr extends _0x491401{['submitButtonView'];['showHistoryButtonView'];constructor(_0x35e7d7,_0x43229d){super(_0x35e7d7,_0x43229d),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',(_0x431fb7,_0x332cae)=>{_0x431fb7['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0x332cae());});}['_createSubmitButton'](){const _0x4a73e2=new _0x599e60(this['locale']),_0x5ba8c3=this['locale'];return _0x4a73e2['set']({'icon':_0x1c6079,'label':Wn(_0x5ba8c3,'Submit'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-form__submit'}),_0x4a73e2['on']('execute',()=>{this['submit']();}),_0x4a73e2['bind']('isEnabled')['to'](this['queryView']['fieldView'],'isEmpty',this,'isEnabled',(_0x588feb,_0x40dec3)=>!_0x588feb&&_0x40dec3),_0x4a73e2;}['_createShowHistoryButton'](){const _0xaa5552=new _0x599e60(this['locale']),_0xe5cb3d=this['resultsView'],_0x3dde6b=this['locale'];_0xaa5552['set']({'label':Wn(_0x3dde6b,'History'),'withText':!0x1,'icon':Nt,'tooltip':!0x0,'tooltipPosition':'sw','class':'ck-ai-form__toggle-history'}),_0xaa5552['bind']('isOn')['to'](_0xe5cb3d,'isVisible'),_0xaa5552['bind']('isEnabled')['to'](this,'isEnabled'),_0xaa5552['on']('execute',()=>{_0xe5cb3d['isVisible']=!_0xe5cb3d['isVisible'],_0xe5cb3d['isVisible']?this['filteredView']['focus']():this['focus']();});const _0x406e3c=()=>{_0x595889['window']['requestAnimationFrame'](()=>{if(_0x49efe1(this['element'])){const _0x747971=new _0x227dc7(this['queryView']['fieldView']['element']),_0x2cbd8e=_0x747971['width'],_0x2e01fb='rtl'===_0x3dde6b['uiLanguageDirection']?'left':'right';_0x747971['excludeScrollbarsAndBorders'](),_0xaa5552['element']['style'][_0x2e01fb]=_0x2cbd8e-_0x747971['width']+0x1+'px';}});};return this['queryView']['fieldView']['on']('update',_0x406e3c),this['on']('render',_0x406e3c),_0xaa5552;}['submit'](){const _0x87f117=this['queryView']['fieldView']['element']['value'];this['fire']('submit',_0x87f117);}['focus'](_0x11d0a5){-0x1===_0x11d0a5?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}}class Hr extends _0x20d034{['historyGroupView'];['clearHistoryButton'];constructor(_0x3ce68a){super(_0x3ce68a),this['clearHistoryButton']=this['_createClearHistoryButton'](),this['historyGroupView']=new _0x5742ce(),this['historyGroupView']['children']['add'](this['clearHistoryButton'],0x1),this['historyGroupView']['label']=Wn(_0x3ce68a,'Prompt\x20history'),this['historyGroupView']['items']['delegate']('execute')['to'](this),this['items']['add'](this['historyGroupView']);}['filter'](){let _0x3b1efe=0x0;for(const _0x6a2fc5 of this['items'])_0x3b1efe+=_0x6a2fc5['items']['length'];return{'resultsCount':_0x3b1efe,'totalItemsCount':_0x3b1efe};}['_createClearHistoryButton'](){const _0x5e7ef5=this['locale'],_0x3e62ad=new _0x599e60(this['locale']);return _0x3e62ad['set']({'label':'('+Wn(_0x5e7ef5,'Clear')+')','withText':!0x0}),_0x3e62ad['on']('execute',()=>this['fire']('clearHistory')),_0x3e62ad;}}class Rr extends _0x8981d2{constructor(_0x3f8f9d){super();const _0x30aa64=new _0x512e7d(),_0x8d2277=new _0x599e60(this['locale'],_0x30aa64);this['children']['add'](_0x8d2277),_0x8d2277['set']({'label':_0x3f8f9d['prompt'],'withText':!0x0}),_0x8d2277['on']('execute',()=>{this['fire']('execute',{'value':_0xcc4704(_0x3f8f9d['prompt'])});});}}const So='CKEditor/AIFormView/PromptHistory';class Br extends _0x397f6f{constructor(){super(),this['_loadFromSessionStorage'](),this['on']('add',(_0x204569,_0x4fd57c)=>{const _0x3b6696=go(_0x4fd57c['prompt']);for(const _0x4cafff of this)if(_0x4cafff!=_0x4fd57c&&go(_0x4cafff['prompt'])===_0x3b6696){this['remove'](_0x4cafff);break;}this['length']>0x14&&this['remove'](this['last']),this['_saveToSessionStorage']();}),this['on']('remove',()=>{this['_saveToSessionStorage']();});}['_loadFromSessionStorage'](){const _0x59ce98=sessionStorage['getItem'](So)||'[]';this['addMany'](JSON['parse'](_0x59ce98));}['_saveToSessionStorage'](){sessionStorage['setItem'](So,JSON['stringify'](this['map'](_0x44bcce=>_0x44bcce)));}}function go(_0x4e1f55){return _0x4e1f55['toLowerCase']()['trim']();}class k extends _0x5eeb09{['focusTracker'];['keystrokes'];['contentArea'];['toolbar'];['promptView'];['errorView'];['_focusables'];['focusCycler'];['_promptHistory'];constructor(_0x25852a,_0x2128a8,_0x4ac047=''){super(_0x25852a),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(_0x25852a),this['contentArea']=new Ir(_0x25852a,_0x4ac047),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 _0x534506(),this['keystrokes']=new _0x33f2cf(),this['_focusables']=this['createCollection']([this['contentArea'],this['contentArea']['copyButtonView'],this['toolbar'],this['promptView']]),this['focusCycler']=new _0x45d025({'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 _0xce6500=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form',_0x2128a8],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form-content']},'children':[{'tag':'div','attributes':{'class':[_0xce6500['if']('isError','ck-hidden',_0x2e6d20=>!_0x2e6d20)]},'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'](_0x20c302=0x1){-0x1===_0x20c302?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 _0x51a3d9=this['locale'],_0x5d0dbd=new Cr(_0x51a3d9,{'queryView':{'label':Wn(_0x51a3d9,'Ask\x20AI\x20to\x20edit\x20or\x20generate'),'creator':_0x29faf8,'showIcon':!0x1,'showResetButton':!0x1},'infoView':{'text':{'noSearchableItems':{'primary':Wn(_0x51a3d9,'Empty\x20history'),'secondary':Wn(_0x51a3d9,'Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.')}}},'filteredView':this['_createHistoryView'](),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1});return _0x5d0dbd['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x5554a0,_0x491403)=>_0x5554a0&&!_0x491403),this['listenTo'](_0x5d0dbd,'submit',(_0x17b950,_0x55abfc)=>{this['prompt']=_0x55abfc;const _0x5d2037=_0x497439(_0x55abfc);this['fire']('submitPrompt',_0x5d2037),_0x55abfc['trim']()&&this['_promptHistory']['add']({'prompt':_0x5d2037},0x0);},{'priority':'high'}),_0x5d0dbd;}['_createHistoryView'](){const _0x475de2=new Hr(this['locale']);return _0x475de2['historyGroupView']['items']['bindTo'](this['_promptHistory'])['as'](Rr),_0x475de2['on']('clearHistory',()=>{this['_promptHistory']['clear'](),this['promptView']['search'](''),this['promptView']['focus']();}),_0x475de2;}['_createToolbar'](){const _0x4d0c4d=new Pr(this['locale']);return _0x4d0c4d['replaceButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x5d4f9e,_0x1fb8cf,_0x50a61f)=>_0x5d4f9e&&!_0x1fb8cf&&!!_0x50a61f),_0x4d0c4d['replaceButton']['delegate']('execute')['to'](this,'replaceContent'),_0x4d0c4d['insertButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x300f88,_0x36911e,_0x3c76dd)=>_0x300f88&&!_0x36911e&&!!_0x3c76dd),_0x4d0c4d['insertButton']['delegate']('execute')['to'](this,'insertContentBelow'),_0x4d0c4d['tryAgainButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x2416b6,_0x83c987)=>_0x2416b6&&!_0x83c987),_0x4d0c4d['tryAgainButton']['delegate']('execute')['to'](this,'tryAgainEvent'),_0x4d0c4d['stopButton']['bind']('isEnabled')['to'](this,'isProcessing'),_0x4d0c4d['stopButton']['delegate']('execute')['to'](this,'stopProcessing'),_0x4d0c4d;}['startProcessing'](){this['value']='',this['isError']=!0x1,this['isProcessing']=!0x0,this['contentArea']['isVisible']=!0x0,this['toolbar']['isVisible']=!0x0,this['contentArea']['focus']();}['finishProcessing'](){const _0x37fbf0=this['locale'];this['isProcessing']=!0x1,this['prompt']='',this['promptView']['reset'](),this['value']&&(this['promptView']['queryView']['label']=Wn(_0x37fbf0,'Ask\x20AI\x20to\x20improve\x20generated\x20text'));}['handleError'](_0x2e093e){const _0x10d5f2=this['locale'];this['finishProcessing'](),this['isError']=!0x0,this['errorView']['text']=_0x2e093e||Wn(_0x10d5f2,'AI_ERROR_FAILED'),this['value']||(this['contentArea']['isVisible']=!0x1);}}const w=globalThis['DataTransfer'];class n extends _0x364f16{['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[_0x50d817,a,K,_0x1aff54];}constructor(_0x309701){super(_0x309701),_0x309701['config']['define']('ai.assistant.disabledElements',['media','rawHtml','tableOfContents']),_0x309701['config']['define']('ai.assistant.contentAreaCssClass',''),_0x309701['config']['define']('ai.assistant.useTheme',!0x0),this['_uiCssClasses']='ck-ai-assistant-ui'+(_0x309701['config']['get']('ai.assistant.useTheme')?'\x20ck-ai-assistant-ui_theme':'');}['init'](){const {editor:_0x32c2d5}=this;this['_aiAdapter']=_0x32c2d5['plugins']['get'](K),this['_dialog']=_0x32c2d5['plugins']['get'](_0x1aff54),this['_formView']=null,this['_commandDefinitions']=this['_getResolvedCommandsDefinitions']();const _0x4bb6e3=new E(_0x32c2d5,Array['from'](this['_commandDefinitions']['values']()));_0x32c2d5['commands']['add']('showAIAssistant',_0x4bb6e3),_0x32c2d5['ui']['componentFactory']['add']('aiCommands',_0x36d783=>{const _0x55adf2=_0xace15(_0x36d783);return _0x55adf2['set']({'class':'ck-ai-commands-dropdown\x20'+this['_uiCssClasses']}),_0x55adf2['buttonView']['set']({'label':Wn(_0x36d783,'AI\x20Commands'),'icon':_0x5cb001,'tooltip':!0x0}),_0x55adf2['on']('execute',_0x1050ad=>this['_onExecute'](_0x1050ad['source']['id'])),_0x44e784(_0x55adf2,_0x32c2d5['ui']['view']['body'],function(_0x51e10c){const _0x4ef4bb=o(_0x51e10c['config']['get']('ai.assistant.commands'),_0x51e10c['locale']),_0xaa1c07=B(_0x51e10c,_0x4ef4bb)['filter'](_0x3fd397=>_0x3fd397['commands']['length']);if(0x1===_0xaa1c07['length'])return B(_0x51e10c,_0xaa1c07[0x0]['commands'])['map'](_0x3606e4=>({'id':_0x3606e4['id'],'label':_0x3606e4['label']}));return _0xaa1c07['map'](_0x2532d8=>{const {groupId:_0x15a219,groupLabel:_0x479a1f,commands:_0x5800d0}=_0x2532d8,_0x2f37d6=B(_0x51e10c,_0x5800d0)['map'](_0x50fe9e=>({'id':_0x50fe9e['id'],'label':_0x50fe9e['label']}));return{'id':_0x15a219,'menu':_0x479a1f||_0x15a219,'children':_0x2f37d6};});}(_0x32c2d5),{'ariaLabel':Wn(_0x36d783,'AI\x20Commands')}),_0x55adf2['menuView']['menuPanelClass']='ck-ai-commands-dropdown\x20'+this['_uiCssClasses'],_0x4bb6e3['on']('change:enabledCommandsIds',_0x3e16d6),_0x55adf2['menuView']['once']('render',_0x3e16d6),_0x55adf2;function _0x3e16d6(){_0x55adf2['isEnabled']=_0x4bb6e3['enabledCommandsIds']['length']>0x0;for(const _0x62be3c of _0x55adf2['menuView']['buttons'])_0x62be3c['isEnabled']=_0x4bb6e3['enabledCommandsIds']['includes'](_0x62be3c['id']);}}),_0x32c2d5['ui']['componentFactory']['add']('menuBar:aiCommands',_0x4d53e2=>{const _0x4cf58b=new _0x3a7b62(_0x4d53e2);_0x4cf58b['buttonView']['set']({'label':Wn(_0x4d53e2,'AI\x20Commands'),'icon':_0x5cb001}),_0x4cf58b['bind']('isEnabled')['to'](_0x4bb6e3,'enabledCommandsIds',_0x542163=>_0x542163['length']>0x0);const _0x4034e6=o(_0x32c2d5['config']['get']('ai.assistant.commands'),_0x4d53e2);return this['_populateMenuBarMenu'](_0x4bb6e3,_0x4cf58b,_0x4034e6,_0x42d070=>this['_onExecute'](_0x42d070)),_0x4cf58b;}),_0x32c2d5['ui']['componentFactory']['add']('aiAssistant',()=>{const _0x59a5a6=this['_createAIAssistantUIButton'](_0x599e60);return _0x59a5a6['set']({'tooltip':!0x0,'class':'ck-ai-assistant-button\x20'+this['_uiCssClasses']}),_0x59a5a6;}),_0x32c2d5['ui']['componentFactory']['add']('menuBar:aiAssistant',()=>{const _0xa69393=this['_createAIAssistantUIButton'](_0x2d1f80);return _0xa69393['set']({'role':'menuitemcheckbox'}),_0xa69393;}),this['licenseKey']=this['editor']['config']['get']('licenseKey');const _0x420919=this['editor'];this['_licenseKeyCheckInterval']=setInterval(()=>{let _0xd03e17;for(const _0xb63a0 in _0x420919){const _0x3c1984=_0xb63a0,_0x42088c=_0x420919[_0x3c1984];if('aiLicenseKeyValid'==_0x42088c||'aiLicenseKeyInvalid'==_0x42088c||'aiLicenseKeyExpired'==_0x42088c||'aiLicenseKeyDomainLimit'==_0x42088c||'aiLicenseKeyNotAllowed'==_0x42088c||'aiLicenseKeyEvaluationLimit'==_0x42088c||'aiLicenseKeyUsageLimit'==_0x42088c){delete _0x420919[_0x3c1984],_0xd03e17=_0x42088c,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'aiLicenseKeyInvalid'==_0xd03e17&&_0x420919['_showLicenseError']('invalid'),'aiLicenseKeyExpired'==_0xd03e17&&_0x420919['_showLicenseError']('expired'),'aiLicenseKeyDomainLimit'==_0xd03e17&&_0x420919['_showLicenseError']('domainLimit'),'aiLicenseKeyNotAllowed'==_0xd03e17&&_0x420919['_showLicenseError']('featureNotAllowed','AIAssistant'),'aiLicenseKeyEvaluationLimit'==_0xd03e17&&_0x420919['_showLicenseError']('evaluationLimit'),'aiLicenseKeyUsageLimit'==_0xd03e17&&_0x420919['_showLicenseError']('usageLimit');},0x3e8);}['destroy'](){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}['showUI'](_0x31fc9e='',_0x40ffd7='',_0x414bbf='custom'){const _0x41a53a=this['editor'],_0x5d9986=_0x41a53a['editing']['view'],_0x50309b=_0x41a53a['plugins']['get'](a),_0x5ed012=_0x41a53a['plugins']['get'](_0x50d817);_0x50309b['showFakeVisualSelection']();const _0x226ea8=new w(),_0x394c61=new ClipboardEvent('copy',{'clipboardData':_0x226ea8}),_0x237e95=new _0x7e8156(_0x226ea8),_0x3bc6ce=new _0x4da45d(_0x5d9986,_0x394c61,{'dataTransfer':_0x237e95});_0x5ed012['_forceMarkersCopy']('comment',()=>{_0x5d9986['document']['fire']('copy',_0x3bc6ce);}),this['_formView']||(this['_initView'](),this['_aiAssistantController']=new j(_0x41a53a,this['_aiAdapter']['textAdapter'],this['_formView']));let _0x528f7a=_0x237e95['getData']('text/html');const _0x5efab1=_0x41a53a['model']['document']['selection'],_0x418d17=Array['from'](_0x5efab1['getRanges']());0x1===_0x418d17['length']&&_0x418d17[0x0]['isFlat']&&!_0x5efab1['getSelectedElement']()&&''!==_0x528f7a['replace'](/ /g,'')['trim']()&&(_0x528f7a='<p>'+_0x528f7a+'</p>'),this['_aiAssistantController']['updateView']({'actionId':_0x414bbf,'query':_0x31fc9e,'htmlContent':_0x528f7a,'label':_0x40ffd7,'mainActionLabel':_[_0x41a53a['model']['document']['selection']['isCollapsed']?'INSERT':'REPLACE']}),'aiAssistant'!==this['_dialog']['id']?this['_dialog']['show']({'id':'aiAssistant','icon':_0x473155,'title':Wn(this['editor']['locale'],'AI\x20Assistant'),'content':this['_formView'],'position':_0x1ae636['EDITOR_TOP_SIDE'],'onShow':()=>{this['_formView']['focus']();},'onHide':()=>{this['_aiAssistantController']['reset'](),_0x50309b['hideFakeVisualSelection']();}}):this['_dialog']['view']['wasMoved']||this['_dialog']['view']['updatePosition']();}['hideUI'](){this['_dialog']['hide']();}['_getResolvedCommandsDefinitions'](){const _0xe0c9a1=new Map(),_0x136065=o(this['editor']['config']['get']('ai.assistant.commands'),this['editor']['locale']);for(const _0x39c9c1 of _0x136065)for(const _0x4ca7f3 of _0x39c9c1['commands'])_0xe0c9a1['set'](_0x4ca7f3['id'],{..._0x4ca7f3,'groupId':_0x39c9c1['groupId'],'groupLabel':_0x39c9c1['groupLabel']||_0x39c9c1['groupId']});return _0xe0c9a1;}['_createAIAssistantUIButton'](_0x213b09){const _0x1046e1=this['editor'],_0x3b0d77=_0x1046e1['commands']['get']('showAIAssistant'),_0x10e41e=new _0x213b09(_0x1046e1['locale']);return _0x10e41e['set']({'label':Wn(_0x1046e1['locale'],'AI\x20Assistant'),'icon':_0x473155,'isToggleable':!0x0}),_0x10e41e['bind']('isEnabled')['to'](_0x3b0d77),_0x10e41e['bind']('isOn')['to'](this['_dialog'],'id',_0xe868f4=>'aiAssistant'===_0xe868f4),this['listenTo'](_0x10e41e,'execute',()=>{_0x10e41e['isOn']?this['hideUI']():_0x3b0d77['execute']();}),_0x10e41e;}['_initView'](){const _0x2442f6=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',()=>{_0x2442f6['insertContent'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['listenTo'](this['_formView'],'insertContentBelow',()=>{_0x2442f6['insertContentBelow'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['_initAriaAiStatusChangeAnnouncements']();}['_initAriaAiStatusChangeAnnouncements'](){const {locale:_0x1d3d51,ui:{ariaLiveAnnouncer:_0x421879}}=this['editor'];this['_formView']['contentArea']['on']('change:isProcessing',(_0x2cfac5,_0x4b04d2,_0x5cbaf7)=>{const _0x551e9c=this['_aiAssistantController']['currentContext'];_0x5cbaf7?_0x421879['announce'](Wn(_0x1d3d51,'AI\x20is\x20writing')):_0x551e9c&&_0x421879['announce'](Wn(_0x1d3d51,'Generated\x20content:\x20%0',_0x551e9c),{'politeness':'polite','isUnsafeHTML':!0x0});}),this['_formView']['on']('change:isError',(_0x38b32e,_0x9430ec,_0x4f5793)=>{if(_0x4f5793){const _0x1f3545=this['_formView']['errorView']['text'];_0x421879['announce'](Wn(_0x1d3d51,'Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x1f3545));}});}['_onExecute'](_0x55ed53){const _0x141c62=this['_commandDefinitions']['get'](_0x55ed53),_0xf122ca=this['editor'],_0x21f4bb=_0xf122ca['model']['document']['selection'],_0x2aa41c=_0xf122ca['commands']['get']('showAIAssistant'),_0xf3b2a2=_0xf122ca['plugins']['get'](a),_0x4e40e7=''+(_0x141c62['groupId']!==x?_0x141c62['groupLabel']+':\x20':'')+_0x141c62['label'];if(!0x1!==_0x141c62['requiresContent']&&_0x21f4bb['isCollapsed']){const _0x2026ef=_0x48a97f(_0x21f4bb['getSelectedBlocks']())||_0xf122ca['model']['schema']['getLimitElement'](_0x21f4bb);_0xf122ca['model']['change'](_0x2ca9df=>{_0x2ca9df['setSelection'](_0x2026ef,'in');});}_0xf3b2a2['showFakeVisualSelection'](),_0x2aa41c['execute'](_0x141c62['prompt'],_0x4e40e7,'command:'+_0x55ed53);}['_populateMenuBarMenu'](_0x45739b,_0x2c7a68,_0x56fe4b,_0x583923){const _0x14a9e2=this['editor'],_0x58e278=_0x14a9e2['locale'],_0x413d78=new _0x47b040(_0x58e278),_0x186251=B(_0x14a9e2,_0x56fe4b)['filter'](_0x49bb03=>_0x49bb03['commands']['length']);0x1===_0x186251['length']?this['_getMenuBarGroupButtons']({'command':_0x45739b,'commands':_0x186251[0x0]['commands'],'parentMenuView':_0x2c7a68,'onExecute':_0x583923})['forEach'](_0xc5c884=>_0x413d78['items']['add'](_0xc5c884)):_0x186251['forEach'](({groupId:_0x269466,groupLabel:_0x20112d,commands:_0x40cece})=>{const _0x23f985=new _0x4ae876(_0x58e278,_0x2c7a68),_0x3b7657=new _0x3a7b62(_0x58e278),_0x1e8ca9=new _0x47b040(_0x58e278),_0x1cfdc5=this['_getMenuBarGroupButtons']({'command':_0x45739b,'commands':_0x40cece,'parentMenuView':_0x3b7657,'onExecute':_0x583923});_0x3b7657['buttonView']['set']({'label':_0x20112d||_0x269466}),_0x3b7657['delegate']('execute')['to'](_0x2c7a68),_0x1e8ca9['items']['addMany'](_0x1cfdc5),_0x3b7657['panelView']['children']['add'](_0x1e8ca9),_0x23f985['children']['add'](_0x3b7657),_0x413d78['items']['add'](_0x23f985);}),_0x2c7a68['panelView']['children']['add'](_0x413d78);}['_getMenuBarGroupButtons']({command:_0x1f5391,commands:_0x5e6c01,parentMenuView:_0x502a25,onExecute:_0x11d7f5}){const _0x48290a=this['editor'],_0x307b4f=_0x48290a['locale'];return B(_0x48290a,_0x5e6c01)['map'](_0x3f97c4=>{const _0x45d959=new _0x4ae876(_0x307b4f,_0x502a25),_0xdf51f3=new _0x2d1f80(_0x307b4f);return _0xdf51f3['set']({'label':_0x3f97c4['label']}),_0xdf51f3['delegate']('execute')['to'](_0x502a25),_0xdf51f3['on']('execute',()=>_0x11d7f5(_0x3f97c4['id'])),_0xdf51f3['bind']('isEnabled')['to'](_0x1f5391,'enabledCommandsIds',_0x5522fd=>_0x5522fd['includes'](_0x3f97c4['id'])),_0x45d959['children']['add'](_0xdf51f3),_0x45d959;});}}function U(_0x28640d,_0x26467f){return void 0x0!==_0x28640d['order']&&void 0x0===_0x26467f['order']?0x1:void 0x0===_0x28640d['order']&&void 0x0!==_0x26467f['order']?-0x1:void 0x0!==_0x28640d['order']&&void 0x0!==_0x26467f['order']?_0x28640d['order']-_0x26467f['order']:0x0;}function B(_0x3f8a73,_0x20fbd2){_0x20fbd2['sort'](U);const _0x4f5bd2={},_0x37228e=[];for(const _0x4f7034 of _0x20fbd2)if(void 0x0!==_0x4f7034['order']){if(_0x4f7034['order']in _0x4f5bd2)throw new _0x509ee0('ai-commands-config-order-collision',_0x3f8a73,{'conflictingDefinitions':[_0x4f7034,_0x4f5bd2[_0x4f7034['order']]]});_0x4f5bd2[_0x4f7034['order']]=_0x4f7034,_0x37228e['splice'](_0x4f7034['order'],0x0,_0x4f7034);}else _0x37228e['push'](_0x4f7034);return _0x37228e;}class $n extends _0x364f16{static get['requires'](){return[n,a];}static get['pluginName'](){return'AIAssistant';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x119572){super(_0x119572);const _0x51e4a8=_0x119572['config'],_0x296e58=_0x119572['locale'];_0x51e4a8['define']('ai.assistant.preserveComments',!0x0),_0x51e4a8['define']('ai.assistant.commands',qn(_0x296e58)),_0x51e4a8['define']('ai.assistant.extraCommandGroups',[]),_0x51e4a8['define']('ai.assistant.removeCommands',[]);let _0x3bd50e=o(_0x51e4a8['get']('ai.assistant.commands'),_0x296e58);const _0x4d5b86=_0x51e4a8['get']('ai.assistant.extraCommandGroups'),_0x201901=_0x51e4a8['get']('ai.assistant.removeCommands');_0x4d5b86['forEach'](_0x338b7e=>{const _0x3e4c41=_0x3bd50e['find'](_0x28f5cc=>_0x28f5cc['groupId']===_0x338b7e['groupId']);_0x3e4c41?_0x3e4c41['commands']=_0x3e4c41['commands']['concat'](_0x338b7e['commands']):_0x3bd50e['push'](_0x338b7e);}),_0x3bd50e=_0x3bd50e['filter'](_0x5397ad=>!_0x201901['includes'](_0x5397ad['groupId'])),_0x3bd50e['forEach'](_0x158f8f=>{_0x158f8f['commands']=_0x158f8f['commands']['filter'](_0x3118e9=>!_0x201901['includes'](_0x3118e9['id']));}),_0x51e4a8['set']('ai.assistant.commands',_0x3bd50e);}}function qn(_0x21a421){return[{'groupId':'editOrReview','groupLabel':Wn(_0x21a421,'Edit\x20or\x20review'),'commands':[{'id':'improveWriting','label':Wn(_0x21a421,'Improve\x20writing'),'prompt':'Fix\x20spelling\x20mistakes,\x20use\x20proper\x20grammar\x20and\x20apply\x20good\x20writing\x20practices.\x20Do\x20not\x20lose\x20the\x20original\x20meaning.'},{'id':'makeShorter','label':Wn(_0x21a421,'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':Wn(_0x21a421,'Make\x20longer'),'prompt':'Improve\x20this\x20content\x20by\x20using\x20descriptive\x20language\x20and\x20inserting\x20more\x20information\x20and\x20more\x20detailed\x20explanations.'},{'id':'simplifyLanguage','label':Wn(_0x21a421,'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':Wn(_0x21a421,'Generate\x20from\x20selection'),'commands':[{'id':'summarize','label':Wn(_0x21a421,'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':Wn(_0x21a421,'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':Wn(_0x21a421,'Change\x20tone'),'commands':[{'id':'professional','label':Wn(_0x21a421,'Professional'),'prompt':'Improve\x20using\x20polished,\x20formal,\x20and\x20respectful\x20language\x20to\x20convey\x20professional\x20expertise\x20and\x20competence.'},{'id':'casual','label':Wn(_0x21a421,'Casual'),'prompt':'Improve\x20using\x20casual,\x20informal\x20language\x20to\x20convey\x20a\x20casual\x20conversation\x20with\x20a\x20real\x20person.'},{'id':'direct','label':Wn(_0x21a421,'Direct'),'prompt':'Improve\x20using\x20direct\x20language,\x20using\x20only\x20the\x20essential\x20information.'},{'id':'confident','label':Wn(_0x21a421,'Confident'),'prompt':'Improve\x20using\x20compelling,\x20optimistic\x20language\x20to\x20convey\x20confidence\x20in\x20the\x20writing.'},{'id':'friendly','label':Wn(_0x21a421,'Friendly'),'prompt':'Improve\x20using\x20friendly,\x20comforting\x20language,\x20to\x20convey\x20understanding\x20and\x20empathy.'}]},{'groupId':'changeStyle','groupLabel':Wn(_0x21a421,'Change\x20style'),'commands':[{'id':'business','label':Wn(_0x21a421,'Business'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20business\x20professional\x20with\x20formal\x20language.'},{'id':'legal','label':Wn(_0x21a421,'Legal'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20legal\x20professional\x20using\x20valid\x20legal\x20terminology.'},{'id':'journalism','label':Wn(_0x21a421,'Journalism'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20journalist\x20using\x20engaging\x20language\x20to\x20convey\x20the\x20importance\x20of\x20the\x20information.'},{'id':'poetic','label':Wn(_0x21a421,'Poetic'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20poem\x20using\x20poetic\x20techniques\x20without\x20losing\x20the\x20original\x20meaning.'}]},{'groupId':'translate','groupLabel':Wn(_0x21a421,'Translate'),'commands':[{'id':'translateEnglish','label':Wn(_0x21a421,'English'),'prompt':'Translate\x20the\x20content\x20to\x20English\x20language.'},{'id':'translateSpanish','label':Wn(_0x21a421,'Spanish'),'prompt':'Translate\x20the\x20content\x20to\x20Spanish\x20language.'},{'id':'translatePortuguese','label':Wn(_0x21a421,'Portuguese'),'prompt':'Translate\x20the\x20content\x20to\x20Portuguese\x20language.'},{'id':'translateGerman','label':Wn(_0x21a421,'German'),'prompt':'Translate\x20the\x20content\x20to\x20German\x20language.'},{'id':'translateFrench','label':Wn(_0x21a421,'French'),'prompt':'Translate\x20the\x20content\x20to\x20French\x20language.'},{'id':'translateChinese','label':Wn(_0x21a421,'Simplified\x20Chinese'),'prompt':'Translate\x20the\x20content\x20to\x20Simplified\x20Chinese\x20language.'},{'id':'translateHindi','label':Wn(_0x21a421,'Hindi'),'prompt':'Translate\x20the\x20content\x20to\x20Hindi\x20language.'},{'id':'translateArabic','label':Wn(_0x21a421,'Arabic'),'prompt':'Translate\x20the\x20content\x20to\x20Arabic\x20language.'}]}];}class ye extends _0x364f16{['abortController'];static get['requires'](){return[K];}constructor(_0x3fc395){super(_0x3fc395),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'](_0x3f24a6){return this['sendRequest'](_0x3f24a6)['catch'](_0x2ef72f=>{if(_0x2ef72f instanceof er)return Promise['reject'](_0x2ef72f);if('AbortError'==_0x2ef72f['name'])return Promise['resolve']();throw console['error'](_0x2ef72f),new _0x509ee0('aitextadapter-send-request-failed',null);});}async['_prepareRequestHeaders'](_0x37c9d6,_0x54e26d){const _0x4ca872=this['editor']['locale'],_0x418107={'Content-Type':'application/json'};if('object'==typeof _0x37c9d6)Object['assign'](_0x418107,_0x37c9d6);else{if(_0x37c9d6)try{const _0x3bd3d8=await _0x37c9d6(_0x54e26d);Object['assign'](_0x418107,_0x3bd3d8);}catch{return Promise['reject'](new er(Wn(_0x4ca872,'AI_ERROR_GET_HEADERS')));}}return _0x418107;}async['_prepareRequestParameters'](_0x4f501a,_0x528a1c){const _0x544a49=this['editor']['locale'];if('object'==typeof _0x4f501a)return _0x4f501a;try{return await _0x4f501a(_0x528a1c);}catch{return Promise['reject'](new er(Wn(_0x544a49,'AI_ERROR_GET_PARAMETERS')));}}}class Qn extends ye{['_apiUrl'];['_requestHeaders'];['_requestParameters'];static get['pluginName'](){return'OpenAITextAdapter';}constructor(_0x2148a8){super(_0x2148a8),_0x2148a8['config']['define']('ai.assistant.adapter.openAI.apiUrl','https://api.openai.com/v1/chat/completions'),_0x2148a8['config']['get']('ai.assistant.adapter.openAI.requestParameters')||_0x2148a8['config']['define']('ai.assistant.adapter.openAI.requestParameters',{'model':'gpt-4o','temperature':0x1,'top_p':0x1,'stream':!0x0}),this['_apiUrl']=_0x2148a8['config']['get']('ai.assistant.adapter.openAI.apiUrl'),this['_requestHeaders']=_0x2148a8['config']['get']('ai.assistant.adapter.openAI.requestHeaders')||{},this['_requestParameters']=_0x2148a8['config']['get']('ai.assistant.adapter.openAI.requestParameters');}async['sendRequest']({query:_0x2b0377,context:_0x41e9fa,onData:_0x53764a,actionId:_0x13649f}){const _0x544c6e=this['editor']['locale'],_0x52e078=await this['prepareMessages'](_0x2b0377,_0x41e9fa,_0x13649f),_0x1b5a7c=await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x13649f),_0x42cb2b=await this['_prepareRequestParameters'](this['_requestParameters'],_0x13649f),_0x4f4b78={'messages':_0x52e078,..._0x42cb2b},_0x1fd615={'method':'POST','headers':_0x1b5a7c,'body':JSON['stringify'](_0x4f4b78),'signal':this['abortController']['signal']},_0x504b01=await fetch(this['_apiUrl'],_0x1fd615);if(_0x504b01['ok'])return _0x42cb2b['stream']?await this['_readStreamableResponse'](_0x504b01,_0x53764a):await this['_readStaticResponse'](_0x504b01,_0x53764a),Promise['resolve']();{const _0x3539ed=await _0x504b01['text']();return _0x3539ed['includes']('context_length_exceeded')?Promise['reject'](new er(Wn(_0x544c6e,'AI_ERROR_CONTEXT_LENGTH'))):_0x3539ed['includes']('Moderation')?Promise['reject'](new er(Wn(_0x544c6e,'AI_ERROR_MODERATION'))):Promise['reject'](new Error(_0x3539ed));}}async['prepareMessages'](_0x1f3119,_0x15576f,_0x2691cd){let _0x5e8a53,_0x55b8bb;return _0x15576f?(_0x5e8a53='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.',_0x55b8bb='Instruction:\x0a'+_0x1f3119+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x15576f):(_0x5e8a53='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.',_0x55b8bb=_0x1f3119),[{'role':'system','content':_0x5e8a53},{'role':'user','content':_0x55b8bb}];}async['_readStreamableResponse'](_0x4c9b66,_0x2ddf50){const _0x272e13=_0x4c9b66['body']['getReader'](),_0x23646f=new TextDecoder();let _0x81a453='',_0x1de3cc='',_0x3a95ec='',_0x16467f=!0x1;for(;!_0x16467f;){const {done:_0x4dc447,value:_0x4159df}=await _0x272e13['read'](),_0x471d25=_0x81a453+_0x23646f['decode'](_0x4159df);let _0x2632f6='';_0x16467f=_0x4dc447;try{_0x2632f6=this['_cleanUpData'](_0x471d25),_0x81a453='';}catch{_0x81a453=_0x471d25;continue;}_0x1de3cc+=_0x2632f6,!_0x16467f&&this['_isBufferIncomplete'](_0x1de3cc)||_0x1de3cc&&(_0x3a95ec+=_0x1de3cc,_0x1de3cc='',_0x2ddf50(_0x3a95ec));}return Promise['resolve']();}async['_readStaticResponse'](_0x1eda15,_0x5ddcd6){return _0x5ddcd6((await _0x1eda15['json']())['choices'][0x0]['message']['content']),Promise['resolve']();}['_isBufferIncomplete'](_0x1f0c74){const _0x2837b6=_0x1f0c74['split']('<')['length']!==_0x1f0c74['split']('>')['length'],_0x457e77=_0x1f0c74['length']<0x1e;return _0x2837b6&&_0x457e77;}['_cleanUpData'](_0x3bb183){return _0x3bb183['split'](/\n(?![^{]*\})/g)['map'](_0xa2d2e1=>_0xa2d2e1['replace']('data:\x20',''))['filter'](_0x4d88e9=>_0x4d88e9&&_0x4d88e9['length']>0x0&&'[DONE]'!==_0x4d88e9)['map'](_0x565c2d=>{const {choices:_0x568023}=JSON['parse'](_0x565c2d);if(_0x568023[0x0]?.['delta']?.['content'])return _0x568023[0x0]['delta']['content'];})['filter'](_0x3d0e87=>_0x3d0e87)['join']('');}}class Xn extends ye{['_apiUrl'];['_requestHeaders'];['_bedrockClientConfig'];['_requestParameters'];static get['pluginName'](){return'AWSTextAdapter';}constructor(_0x3f1557){super(_0x3f1557),_0x3f1557['config']['get']('ai.assistant.adapter.aws.requestParameters')||_0x3f1557['config']['define']('ai.assistant.adapter.aws.requestParameters',{'model':'anthropic.claude-v2','max_tokens_to_sample':0x7d0,'temperature':0x1,'top_p':0x1,'top_k':0xfa,'anthropic_version':'bedrock-2023-05-31','stream':!0x0}),this['_apiUrl']=_0x3f1557['config']['get']('ai.assistant.adapter.aws.apiUrl'),this['_bedrockClientConfig']=_0x3f1557['config']['get']('ai.assistant.adapter.aws.bedrockClientConfig'),this['_requestHeaders']=_0x3f1557['config']['get']('ai.assistant.adapter.aws.requestHeaders'),this['_requestParameters']=_0x3f1557['config']['get']('ai.assistant.adapter.aws.requestParameters');}async['sendRequest']({query:_0x419731,context:_0x48e608,onData:_0x1b7239,actionId:_0x460d88}){const {model:_0x1cbdc7,stream:_0x5c577b,..._0x258cc4}=await this['_prepareRequestParameters'](this['_requestParameters'],_0x460d88),_0x366566={'prompt':await this['preparePrompt'](_0x419731,_0x48e608,_0x1cbdc7,_0x460d88),..._0x258cc4};this['_apiUrl']?await this['_processProxyRequest'](_0x366566,_0x1cbdc7,_0x5c577b,_0x1b7239,_0x460d88):await this['_processAWSRequest'](_0x366566,_0x1cbdc7,_0x5c577b,_0x1b7239);}async['preparePrompt'](_0x1b4308,_0xc37ade,_0x1166ea,_0x553bd4){let _0x28d32a,_0x58646f;return _0xc37ade?(_0x28d32a='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.',_0x58646f='Instruction:\x0a'+_0x1b4308+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0xc37ade):(_0x28d32a='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.',_0x58646f=_0x1b4308),'meta.llama'==this['getModelFamily'](_0x1166ea)?'<<SYS>>\x0a'+_0x28d32a+'\x0a<</SYS>>\x0a[INST]\x0a'+_0x58646f+'\x0a[/INST]':'Human:\x0a'+_0x28d32a+'\x0a'+_0x58646f+'\x0a\x0aAssistant:';}['getModelFamily'](_0x3864ee){if(/^anthropic\.claude/['test'](_0x3864ee))return'anthropic.claude';if(/^ai21\.j2/['test'](_0x3864ee))return'ai21.j2';if(/^cohere\.command/['test'](_0x3864ee))return'cohere.command';if(/^meta\.llama/['test'](_0x3864ee))return'meta.llama';throw new er(Wn(this['editor']['locale'],'AI_ERROR_UNSUPPORTED_MODEL',_0x3864ee));}async['_processProxyRequest'](_0x155c40,_0x129755,_0x376a4d,_0x1fa28a,_0x130e1e){const _0x75d6ce={'method':'POST','headers':await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x130e1e),'body':JSON['stringify']({..._0x155c40,'model':_0x129755,'stream':_0x376a4d}),'signal':this['abortController']['signal']},_0x3580ac=await fetch(this['_apiUrl'],_0x75d6ce);_0x376a4d?await this['_readStreamableResponse'](_0x3580ac,_0x129755,_0x1fa28a):await this['_readStaticResponse'](_0x3580ac,_0x129755,_0x1fa28a);}async['_processAWSRequest'](_0x11220f,_0x45f6bb,_0x4aca95,_0x45818e){const _0x3cff12=new _0x609a6e(this['_bedrockClientConfig']),_0x4ac6ea={'body':JSON['stringify'](_0x11220f),'contentType':'application/json','accept':'application/json','modelId':_0x45f6bb};let _0x10ff11;if(_0x4aca95){const _0x3273df=new _0x12d576(_0x4ac6ea);_0x10ff11=await _0x3cff12['send'](_0x3273df,{'abortSignal':this['abortController']['signal']}),await this['_readAsyncIterableResponse'](_0x10ff11,_0x45f6bb,_0x45818e);}else{const _0x5ef5b5=new _0x57a54b(_0x4ac6ea);_0x10ff11=await _0x3cff12['send'](_0x5ef5b5,{'abortSignal':this['abortController']['signal']}),await this['_readStaticResponse'](_0x10ff11,_0x45f6bb,_0x45818e);}}async['_readAsyncIterableResponse'](_0x50de34,_0x5a25f7,_0x4c335c){const _0x53da32=_0x50de34['body'],_0x71bc6b=new TextDecoder('utf-8');let _0x287233='';for await(const _0x40eadb of _0x53da32)if(_0x40eadb['chunk']){const _0x169c2f=_0x71bc6b['decode'](_0x40eadb['chunk']['bytes']),_0x209cc=JSON['parse'](_0x169c2f);_0x287233+=this['_getGeneratedText'](_0x209cc,_0x5a25f7),_0x4c335c(_0x287233);}return Promise['resolve']();}async['_readStreamableResponse'](_0x326472,_0x3094cf,_0x3f7391){const _0x502328=_0x326472['body'],_0x46ebc7=new TextDecoder('utf-8'),_0x4819b4=_0x502328['getReader']();let _0x5d1361='',_0x5f2626='',_0x1e87dc=!0x1;for(;!_0x1e87dc;){const {done:_0x22db9d,value:_0x1b4ed4}=await _0x4819b4['read']();if(_0x1e87dc=_0x22db9d,_0x1e87dc)break;const _0x545942=(_0x5d1361+_0x46ebc7['decode'](_0x1b4ed4))['split']('\x0a')['map'](_0x142fbd=>{try{return _0x5d1361='',JSON['parse'](_0x142fbd);}catch{return _0x5d1361=_0x142fbd,null;}})['filter'](_0x3a11c3=>null!==_0x3a11c3);_0x545942['length']&&(_0x5f2626+=_0x545942['map'](_0x10bde9=>this['_getGeneratedText'](_0x10bde9,_0x3094cf))['join'](''),_0x3f7391(_0x5f2626));}return Promise['resolve']();}async['_readStaticResponse'](_0x38c300,_0x458a3f,_0x583e3e){let _0x52614a;return _0x52614a=_0x38c300 instanceof Response?await _0x38c300['json']():JSON['parse'](new TextDecoder('utf-8')['decode'](_0x38c300['body'])),(_0x583e3e(this['_getGeneratedText'](_0x52614a,_0x458a3f)),Promise['resolve']());}['_getGeneratedText'](_0x262a0f,_0x2656d7){switch(this['getModelFamily'](_0x2656d7)){case'anthropic.claude':return _0x262a0f['completion'];case'ai21.j2':return _0x262a0f['completions'][0x0]['data']['text'];case'cohere.command':return _0x262a0f['generations'][0x0]['text'];case'meta.llama':return _0x262a0f['generation'];}}}class ia extends _0x599e60{constructor(_0x1a1b78,_0x51a6cb={}){super(_0x1a1b78),this['isToggleable']=!0x0,this['set']('side',_0x51a6cb['side']||'top');const _0x5ac683=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-tab-button',..._0x41ecdd(_0x51a6cb['class']||[]),_0x5ac683['to']('side',_0x2210fa=>'ck-tab-button_'+_0x2210fa),_0x5ac683['to']('class')]}});}['show'](){this['set']('isVisible',!0x0);}['hide'](){this['set']('isVisible',!0x1);}}class ea extends _0x5eeb09{['children'];constructor(_0x18d316,_0x2ebd25={}){super(_0x18d316);const _0x2fb731=this['bindTemplate'];this['set']('isVisible',!0x1),this['set']('class',''),this['children']=this['createCollection'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck-tab-panel',..._0x41ecdd(_0x2ebd25['class']||[]),_0x2fb731['to']('class'),_0x2fb731['if']('isVisible','ck-hidden',_0x5f1797=>!_0x5f1797)]},'children':this['children']});}['show'](){this['set']('isVisible',!0x0);}['hide'](){this['set']('isVisible',!0x1);}}class ss extends _0x5eeb09{['buttonViews']=this['createCollection']();['panelViews']=this['createCollection']();['_tabs']=new Map();constructor(_0x5750d4,_0xb58f91={}){super(_0x5750d4),this['set']('class',void 0x0),this['set']('activeTab',null),this['set']('side',_0xb58f91['side']||'top'),this['set']('isMaximized',!0x1);const _0x17a4c0=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset','ck-tabs',..._0x41ecdd(_0xb58f91['class']||[]),_0x17a4c0['to']('side',_0x331564=>'ck-tabs_'+_0x331564),_0x17a4c0['to']('class'),_0x17a4c0['to']('isMaximized',_0x445323=>_0x445323?'ck-ai-tabs_maximized':'')],'tabindex':'0'},'children':[{'tag':'div','attributes':{'class':['ck','ck-tabs__buttons-container',_0x17a4c0['to']('side',_0x3b4cde=>'ck-tabs__buttons-container_'+_0x3b4cde)]},'children':this['buttonViews']},{'tag':'div','attributes':{'class':['ck','ck-tabs__panels-container',_0x17a4c0['to']('side',_0x23a991=>'ck-tabs__panels-container_'+_0x23a991)]},'children':this['panelViews']},..._0x41ecdd(_0xb58f91['children']||[])]});}['getTabIds'](){return[...this['_tabs']['keys']()];}['getTab'](_0x326d8b){const _0x398e5f=this['_tabs']['get'](_0x326d8b);return _0x398e5f||null;}['addTab'](_0x54a843){const _0x1a7200=this['_setupButton']({'id':_0x54a843['id'],'label':_0x54a843['buttonLabel'],'icon':_0x54a843['buttonIcon'],'order':_0x54a843['order']}),_0x230ff8=new ea(this['locale']);return _0x230ff8['render'](),_0x54a843['content']&&_0x230ff8['children']['add'](_0x54a843['content']),this['panelViews']['add'](_0x230ff8),this['_tabs']['set'](_0x54a843['id'],{'button':_0x1a7200,'panel':_0x230ff8,'order':void 0x0!==_0x54a843['order']?_0x54a843['order']:null}),this['fire']('addTab:'+_0x54a843['id'],{'id':_0x54a843['id'],'button':_0x1a7200,'panel':_0x230ff8}),null===this['activeTab']?this['activateTab'](_0x54a843['id']):this['_hidePanel'](_0x54a843['id']),{'button':_0x1a7200,'panel':_0x230ff8};}['activateTab'](_0x318fcb){if(null!==_0x318fcb&&!this['getTab'](_0x318fcb))throw new _0x509ee0('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0x318fcb});this['activeTab']!==_0x318fcb&&(this['activeTab']&&this['_hidePanel'](this['activeTab']),this['activeTab']=_0x318fcb,_0x318fcb&&this['_showPanel'](_0x318fcb),this['fire']('activateTab:'+_0x318fcb,_0x318fcb));}['showTab'](_0x446cde){if(!this['getTab'](_0x446cde))throw new _0x509ee0('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0x446cde});this['_showPanel'](_0x446cde),this['_showButton'](_0x446cde),this['fire']('show:'+_0x446cde,_0x446cde);}['hideTab'](_0xcd16b9){if(!this['getTab'](_0xcd16b9))throw new _0x509ee0('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0xcd16b9});const _0x165cd8=this['activeTab'];this['_hidePanel'](_0xcd16b9),this['_hideButton'](_0xcd16b9);const _0x2655f8=this['getTabIds']();_0x165cd8===_0xcd16b9&&_0x2655f8['length']>0x1&&this['activateTab'](_0x2655f8['find'](_0x3a2983=>_0x3a2983!==_0xcd16b9)),this['fire']('hide:'+_0xcd16b9,_0xcd16b9);}['_getPanel'](_0x2e74ec){const _0x2e1fe0=this['_tabs']['get'](_0x2e74ec);return _0x2e1fe0?_0x2e1fe0['panel']:null;}['_showPanel'](_0x21e5ed){null!==this['activeTab']&&this['activeTab']!==_0x21e5ed||this['_getPanel'](_0x21e5ed)['show']();}['_hidePanel'](_0x247ba2){const _0x5d314d=this['_getPanel'](_0x247ba2);_0x5d314d['isVisible']&&(this['activeTab']===_0x247ba2&&(this['activeTab']=null),_0x5d314d['hide']());}['_getButton'](_0x236031){const _0x18f7e9=this['_tabs']['get'](_0x236031);return _0x18f7e9?_0x18f7e9['button']:null;}['_showButton'](_0x553bba){this['_getButton'](_0x553bba)['show']();}['_hideButton'](_0x590b6f){this['_getButton'](_0x590b6f)['hide']();}['_setupButton'](_0x474118){const _0x40438d=new ia(this['locale'],{'side':this['side']}),_0x23111b=this['buttonViews'];if(_0x40438d['set']({'label':_0x474118['label'],'icon':_0x474118['icon'],'tooltip':!0x0,'withText':!0x0}),_0x40438d['bind']('isOn')['to'](this,'activeTab',_0x9a9ba6=>_0x9a9ba6===_0x474118['id']),_0x40438d['bind']('side')['to'](this,'side'),_0x474118['order']){const _0x14ddd6=[...this['_tabs']]['reduce']((_0x3f53a0,_0x5b3c90)=>{const _0x13ae67=_0x5b3c90[0x0],{order:_0x4a2321}=_0x5b3c90[0x1];return!_0x4a2321||_0x4a2321>_0x474118['order']?_0x3f53a0:_0x4a2321>=_0x3f53a0['order']?{'id':_0x13ae67,'order':_0x4a2321}:_0x3f53a0;},{'id':'','order':0x0}),_0x3e4c59=_0x23111b['getIndex'](this['_getButton'](_0x14ddd6['id']));_0x23111b['add'](_0x40438d,_0x3e4c59+0x1);}else _0x23111b['add'](_0x40438d);return _0x40438d['on']('execute',()=>{this['activateTab'](_0x474118['id']);}),_0x40438d;}}const ni=['overlay','sidebar','custom'],oi=['left','right'];class hi extends ss{constructor(_0x8b4d0,_0xfc4599={}){super(_0x8b4d0,_0xfc4599),this['set']('type',_0xfc4599['type']||'sidebar'),this['set']('side',_0xfc4599['side']||'right'),this['set']('isVisible',_0xfc4599['visibleByDefault']??!0x0);const _0x31d6e2=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-tabs',_0x31d6e2['if']('type','ck-ai-tabs__overlay',_0x5bcbad=>'overlay'===_0x5bcbad),_0x31d6e2['if']('type','ck-ai-tabs__sidebar',_0x5ee929=>'sidebar'===_0x5ee929),_0x31d6e2['if']('isVisible','ck-hidden',_0x17a1c2=>!_0x17a1c2)]}}),this['buttonViews']['on']('add',(_0x5462ac,_0x405ac0)=>{_0x405ac0['set']('withText',!0x1);});}}class pt extends _0x34a98c{['view'];['container']=null;['showResizeButton']=!0x0;static get['pluginName'](){return'AITabs';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x4936c2){super(_0x4936c2);const _0x5ce712=this['context']['config']['get']('ai.container');if(this['set']('side','right'),!_0x5ce712)throw new _0x509ee0('ai-tabs-configuration-not-found');if(void 0x0!==_0x5ce712['showResizeButton']&&(this['showResizeButton']=_0x5ce712['showResizeButton']),'sidebar'!==_0x5ce712['type']&&'overlay'!==_0x5ce712['type']||_0x5ce712['side']&&(this['side']=_0x5ce712['side']),'sidebar'===_0x5ce712['type']){if(this['container']=_0x5ce712['element'],this['set']('type','sidebar'),!this['container'])throw new _0x509ee0('ai-tabs-sidebar-container-element-not-found');}else'overlay'===_0x5ce712['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===_0x5ce712['visibleByDefault']||_0x5ce712['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'](_0x3a1117){if(_0x3a1117&&this['type']!==_0x3a1117){if(!ni['includes'](_0x3a1117))throw new _0x509ee0('ai-tabs-unsupported-ui-type');this['type']=_0x3a1117;}}['switchSide'](_0x4e1822){if(_0x4e1822&&this['side']!==_0x4e1822){if(!oi['includes'](_0x4e1822))throw new _0x509ee0('ai-tabs-unsupported-ui-side');this['side']=_0x4e1822;}}['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 _0x34a98c{['_apiUrl'];['_token'];['_decoder'];static get['requires'](){return['CloudServices'];}static get['pluginName'](){return'AIConnector';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x59ca91){super(_0x59ca91),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 _0x12a80a=this['context']['plugins']['get']('CloudServices');if(!_0x12a80a['token'])throw new _0x509ee0('ai-missing-token',this);this['_token']=_0x12a80a['token'];}['startConversation'](_0x5bb021,_0x2f0e07){const _0x4e016c=this['_sendApiRequest']('/conversations','POST',{'id':_0x5bb021,'group':_0x2f0e07});return{'getConversation':async()=>(await _0x4e016c['request'])['json'](),'abortController':_0x4e016c['abortController']};}['queryAssistant']({message:_0x2e64c0,conversationId:_0x46c776,parts:_0x3b2d09,capabilities:_0x3c7e54,model:_0x48a3b0,attributes:_0x13cd57}){const _0x3b3bc7={'prompt':_0x2e64c0,'content':_0x3b2d09,'model':_0x48a3b0,..._0x3c7e54&&{'capabilities':_0x3c7e54},..._0x13cd57&&{'attributes':_0x13cd57}},_0x44fe3c=this['_sendApiRequest']('/conversations/'+_0x46c776+'/messages','POST',_0x3b3bc7);return{'getStream':async()=>{const _0x158cce=(await _0x44fe3c['request'])['body'];return this['_getStreamReader'](_0x158cce);},'abortController':_0x44fe3c['abortController']};}['executeCustomAction']({content:_0x28736e,message:_0x3c431d,model:_0x23b81e,outputFormat:_0x17bfa2}){const _0x3c9e46={'content':[{'type':'text','content':_0x28736e}],'prompt':_0x3c431d,'model':_0x23b81e,'outputFormat':_0x17bfa2},_0x296824=this['_sendApiRequest']('/actions/custom/calls','POST',_0x3c9e46);return{'getStream':async()=>{const _0x582ee7=(await _0x296824['request'])['body'];return this['_getStreamReader'](_0x582ee7);},'abortController':_0x296824['abortController']};}['executeAction']({actionName:_0x3750d5,content:_0x25cecb,args:_0x3f2d3a}){const _0x32a2e6={'content':[{'type':'text','content':_0x25cecb}],'args':_0x3f2d3a},_0x2e2830=this['_sendApiRequest']('/actions/system/'+_0x3750d5+'/calls','POST',_0x32a2e6);return{'getStream':async()=>{const _0xd48300=(await _0x2e2830['request'])['body'];return this['_getStreamReader'](_0xd48300);},'abortController':_0x2e2830['abortController']};}['uploadFile'](_0x22693b,_0x5c6e7f,_0xd93814){const _0x23f378=new FormData();_0x23f378['append']('file',_0x5c6e7f,_0x5c6e7f['name']),_0xd93814&&_0x23f378['append']('attributes',JSON['stringify'](_0xd93814));const _0x651207=this['_sendApiRequest']('/conversations/'+_0x22693b+'/files','POST',_0x23f378);return{'getId':async()=>(await _0x651207['request'])['json'](),'abortController':_0x651207['abortController']};}['fetchDocument'](_0x5be0c4,_0x3c6e6f){const _0x4418aa=this['_sendApiRequest']('/conversations/'+_0x5be0c4+'/documents/'+_0x3c6e6f,'GET');return{'getDocument':async()=>(await _0x4418aa['request'])['json'](),'abortController':_0x4418aa['abortController']};}['uploadDocument'](_0x22dc23,_0x1d5c8d,_0x3c8b02){const _0x99837c={'content':_0x1d5c8d};_0x3c8b02&&(_0x99837c['attributes']=_0x3c8b02);const _0x492a4a=this['_sendApiRequest']('/conversations/'+_0x22dc23+'/documents','POST',_0x99837c);return{'getId':async()=>(await _0x492a4a['request'])['json'](),'abortController':_0x492a4a['abortController']};}['fetchConversations'](_0x107606,_0x44078b={}){const _0x28f992=new URLSearchParams();_0x28f992['append']('group',_0x107606),_0x28f992['append']('excludeEmpty',!0x1!==_0x44078b['excludeEmpty']?'true':'false'),_0x28f992['append']('limit',_0x44078b['limit']?_0x44078b['limit']['toString']():'100'),_0x28f992['append']('sortBy',_0x44078b['sortBy']?_0x44078b['sortBy']:'createdAt'),_0x28f992['append']('order',_0x44078b['order']?_0x44078b['order']:'desc');const _0x4e7121=this['_sendApiRequest']('/conversations?'+_0x28f992['toString'](),'GET');return{'getConversations':async()=>{const _0x2c12b2=await _0x4e7121['request'];return(await _0x2c12b2['json']())['items'];},'abortController':_0x4e7121['abortController']};}['deleteConversation'](_0x5076d9){const _0x41f09d=this['_sendApiRequest']('/conversations/'+_0x5076d9,'DELETE');return{'execute':async()=>{await _0x41f09d['request'];},'abortController':_0x41f09d['abortController']};}['updateConversation'](_0x1bf7f9,_0xa1bf22){const _0x13b436=this['_sendApiRequest']('/conversations/'+_0x1bf7f9,'PATCH',_0xa1bf22);return{'getResult':async()=>(await _0x13b436['request'],_0xa1bf22),'abortController':_0x13b436['abortController']};}['fetchConversation'](_0x2dc49c){const _0x2797a7=this['_sendApiRequest']('/conversations/'+_0x2dc49c,'GET');return{'getConversation':async()=>(await _0x2797a7['request'])['json'](),'abortController':_0x2797a7['abortController']};}['fetchConversationMessages'](_0x39c518){const _0x25c119=this['_sendApiRequest']('/conversations/'+_0x39c518+'/messages','GET');return{'getMessages':async()=>{const _0x39a047=await _0x25c119['request'];return(await _0x39a047['json']())['items'];},'abortController':_0x25c119['abortController']};}['uploadUrl'](_0x2fecc4,_0x26dab2,_0x1a2aad){const _0x421635=this['_sendApiRequest']('/conversations/'+_0x2fecc4+'/web-resources','POST',{'url':_0x26dab2,'attributes':_0x1a2aad});return{'getId':async()=>(await _0x421635['request'])['json'](),'abortController':_0x421635['abortController']};}['getModels'](_0x373621='en'){const _0x240c68=new URLSearchParams();_0x240c68['append']('language',_0x373621);const _0x143d82='/models/1?'+_0x240c68['toString'](),_0x3fcde9=this['_sendApiRequest'](_0x143d82,'GET');return{'list':async()=>await(await _0x3fcde9['request'])['json'](),'abortController':_0x3fcde9['abortController']};}['deleteFile'](_0x384095,_0x4df495){const _0x430ce7=this['_sendApiRequest']('/conversations/'+_0x384095+'/files/'+_0x4df495,'DELETE');return{'execute':async()=>{await _0x430ce7['request'];},'abortController':_0x430ce7['abortController']};}['deleteDocument'](_0x5b7a86,_0x2a4a68){const _0x4d494a=this['_sendApiRequest']('/conversations/'+_0x5b7a86+'/documents/'+_0x2a4a68,'DELETE');return{'execute':async()=>{await _0x4d494a['request'];},'abortController':_0x4d494a['abortController']};}['deleteWebResource'](_0x3e3e36,_0x1e5381){const _0x395094=this['_sendApiRequest']('/conversations/'+_0x3e3e36+'/web-resources/'+_0x1e5381,'DELETE');return{'execute':async()=>{await _0x395094['request'];},'abortController':_0x395094['abortController']};}['callSystemReview']({reviewName:_0x5ac984,content:_0x4dfec3,args:_0x18c9c3}){const _0x45aabe=this['_sendApiRequest']('/reviews/system/'+_0x5ac984+'/calls','POST',{'content':[{'type':'text','content':_0x4dfec3}],'args':_0x18c9c3});return{'getStream':async()=>{const _0x400a56=(await _0x45aabe['request'])['body'];return this['_getStreamReader'](_0x400a56);},'abortController':_0x45aabe['abortController']};}['callCustomReview']({content:_0x23b8d1,prompt:_0x4f4f3f,model:_0x148d07}){const _0x59a1cf=this['_sendApiRequest']('/reviews/custom/calls','POST',{'content':[{'type':'text','content':_0x23b8d1}],'prompt':_0x4f4f3f,'model':_0x148d07});return{'getStream':async()=>{const _0x3ce0d6=(await _0x59a1cf['request'])['body'];return this['_getStreamReader'](_0x3ce0d6);},'abortController':_0x59a1cf['abortController']};}['upsertAIChatRating'](_0x438291,_0x35092d,_0x525b2b){const _0x2e06d5=this['_sendApiRequest']('/conversations/'+_0x438291+'/messages/'+_0x35092d+'/ratings','PUT',{'positiveCount':_0x525b2b['positiveCount'],'totalCount':_0x525b2b['totalCount'],'modificationId':_0x525b2b['modificationId']});return{'execute':async()=>{await _0x2e06d5['request'];},'abortController':_0x2e06d5['abortController']};}['upsertAIActionRating'](_0x577b49,_0x4f92a4,_0xcf3285){const _0x572225=this['_sendApiRequest']('/actions/system/'+_0x577b49+'/calls/'+_0x4f92a4+'/ratings','PUT',{'positiveCount':_0xcf3285['positiveCount'],'totalCount':_0xcf3285['totalCount']});return{'execute':async()=>{await _0x572225['request'];},'abortController':_0x572225['abortController']};}['upsertCustomAIActionRating'](_0x752970,_0x55f847){const _0x48467a=this['_sendApiRequest']('/actions/custom/calls/'+_0x752970+'/ratings','PUT',{'positiveCount':_0x55f847['positiveCount'],'totalCount':_0x55f847['totalCount']});return{'execute':async()=>{await _0x48467a['request'];},'abortController':_0x48467a['abortController']};}['upsertAIReviewRating'](_0x2fc16c,_0x206de1,_0x56c957,_0x2e6b2a){const _0x143ae9=this['_sendApiRequest']('/reviews/system/'+_0x2fc16c+'/calls/'+_0x206de1+'/ratings','PUT',{'positiveCount':_0x56c957['positiveCount'],'totalCount':_0x56c957['totalCount'],'dataId':_0x2e6b2a});return{'execute':async()=>{await _0x143ae9['request'];},'abortController':_0x143ae9['abortController']};}['upsertCustomAIReviewRating'](_0x560847,_0x2fe26e,_0x33824c){const _0x104e8d=this['_sendApiRequest']('/reviews/custom/calls/'+_0x560847+'/ratings','PUT',{'positiveCount':_0x2fe26e['positiveCount'],'totalCount':_0x2fe26e['totalCount'],'dataId':_0x33824c});return{'execute':async()=>{await _0x104e8d['request'];},'abortController':_0x104e8d['abortController']};}['_sendApiRequest'](_0x21a290,_0x84d140,_0x3c9a5b){const _0x3cc614=new AbortController(),_0x550f81=_0x3c9a5b instanceof FormData,_0x18b316={'Authorization':'Bearer\x20'+this['_token']?.['value']};_0x3c9a5b&&!_0x550f81&&(_0x18b316['Content-Type']='application/json');const _0xe6fb53={'method':_0x84d140,'headers':_0x18b316,'signal':_0x3cc614['signal']};return _0x3c9a5b&&(_0xe6fb53['body']=_0x550f81?_0x3c9a5b:JSON['stringify'](_0x3c9a5b)),{'request':fetch(''+this['_apiUrl']+_0x21a290,_0xe6fb53)['catch'](_0x5d8e25=>{this['_handleError'](_0x5d8e25);})['then'](_0x461a09=>_0x461a09['ok']?_0x461a09:_0x461a09['json']()['then'](_0x550025=>{throw{'url':this['_apiUrl'],'path':_0x21a290,'method':_0x84d140,'body':_0x3c9a5b,'status':(_0x461a09||{})['status'],'statusText':(_0x461a09||{})['statusText'],'code':_0x550025['code'],'message':_0x550025['message'],'traceId':_0x550025['traceId']};})),'abortController':_0x3cc614};}async*['_getStreamReader'](_0x324123){const _0x1e10a8=[],_0x4833a1=_0x324123['getReader'](),_0x4ef261=$t({'onError':_0x45225b=>{this['_handleError'](_0x45225b);},'onEvent':_0x4b425a=>{_0x4b425a['data']=JSON['parse'](_0x4b425a['data']),_0x1e10a8['push'](_0x4b425a);}});try{let _0x208ca5=!0x1;for(;!_0x208ca5;){const {done:_0x32774c,value:_0x586b92}=await _0x4833a1['read']();_0x32774c&&(_0x208ca5=!0x0),_0x4ef261['feed'](this['_decoder']['decode'](_0x586b92,{'stream':!0x0})),yield*_0x1e10a8,_0x1e10a8['length']=0x0;}}catch(_0x38addb){this['_handleError'](_0x38addb);}finally{_0x4833a1['releaseLock'](),_0x4ef261['reset']();}}['_handleError'](_0x4acb0b){if(_0x4acb0b instanceof _0x509ee0)throw _0x4acb0b;if(_0x4acb0b instanceof Error&&'AbortError'===_0x4acb0b['name'])throw new _0x509ee0('ai-request-aborted',this,{'originalError':_0x4acb0b});throw new _0x509ee0('ai-request-failed',this,{'originalError':_0x4acb0b});}}function i(_0x5f5bb7,_0x1ab46a,_0x5aa075){const t=_0x5f5bb7['t'];switch(_0x1ab46a){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'},_0x5aa075);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.'},_0x5aa075);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.'},_0x5aa075);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.'},_0x5aa075);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'},_0x5aa075);case'AI_CHAT_SUGGESTION_ACTION_SUGGEST':return t({'id':'AI_CHAT_SUGGESTION_ACTION_SUGGEST','string':'Suggest'},_0x5aa075);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'},_0x5aa075);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.'},_0x5aa075);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.'},_0x5aa075);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.'},_0x5aa075);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.'},_0x5aa075);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'},_0x5aa075);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.'},_0x5aa075);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 _0x1ab46a;}}function Hs(_0x49ff78,_0x40e287){const _0x602050=new _0x599e60(_0x49ff78),_0x3006ad=i(_0x49ff78,'AI_TABS_LABEL_MINIMIZE'),_0x182a73=i(_0x49ff78,'AI_TABS_LABEL_MAXIMIZE');return _0x602050['set']({'withText':!0x1,'icon':_0x1d93df,'tooltip':!0x0,'class':'ck-ai-tabs__resize\x20ck-ai-button-tertiary'}),_0x602050['bind']('label')['to'](_0x40e287,'isMaximized',_0x223127=>_0x223127?_0x3006ad:_0x182a73),_0x602050['bind']('icon')['to'](_0x40e287,'isMaximized',_0x7a0ec8=>_0x7a0ec8?_0x72fd7b:_0x1d93df),_0x602050['bind']('isOn')['to'](_0x40e287,'isMaximized'),_0x602050['on']('execute',()=>{_0x40e287['fire']('resizeTabs');}),_0x602050;}function Ui(_0x3a6e63){return _0x30c511(_0x3a6e63);}function Tt(_0x4e3b05){return _0x9860e5(_0x4e3b05);}function St(_0x596164,_0x54ead2,_0x5283bb){const _0x49693e=null!==_0x54ead2?_0x14df6a=>_0x14df6a['attribs'][_0x596164]===_0x54ead2:_0x1e8b70=>Boolean(_0x1e8b70['attribs'][_0x596164]);return yt(_0x322904=>_0x26bfdf(_0x322904)&&_0x49693e(_0x322904),_0x5283bb);}function Ji(_0x124202,_0x1ebf9c,_0x1e5153){const _0x2bb407=null!==_0x1ebf9c?_0x55f3f0=>_0x55f3f0['attribs'][_0x124202]===_0x1ebf9c:_0x14a602=>Boolean(_0x14a602['attribs'][_0x124202]);return _0x52a524(_0x3ffc1e=>_0x26bfdf(_0x3ffc1e)&&_0x2bb407(_0x3ffc1e),_0x1e5153);}function At(_0x1efcb9,_0x3acadf){return _0x1efcb9&&_0x26bfdf(_0x1efcb9)?_0x1efcb9['attribs'][_0x3acadf]:null;}function Ns(_0x157bca,_0x4ccfa8,_0x23824c){_0x26bfdf(_0x157bca)&&(null===_0x23824c?delete _0x157bca['attribs'][_0x4ccfa8]:_0x157bca['attribs'][_0x4ccfa8]=_0x23824c);}function Xi(_0xffe05e,_0x1c25a0,_0x1bd4e9){const _0x2e1de6=_0x1c25a0['cloneNode'](!0x0);'beforebegin'===_0x1bd4e9?_0x5355a0(_0xffe05e,_0x2e1de6):'afterbegin'===_0x1bd4e9?_0xf59167(_0xffe05e,_0x2e1de6):'beforeend'===_0x1bd4e9?_0x43295e(_0xffe05e,_0x2e1de6):'afterend'===_0x1bd4e9&&_0x517396(_0xffe05e,_0x2e1de6);}function Pi(_0x43f70e){const _0x53eae5=[];let _0x287e0f=_0x43f70e;for(;_0x287e0f;)_0x287e0f=_0x29d3c3(_0x287e0f),_0x287e0f&&_0x53eae5['push'](_0x287e0f);return _0x53eae5;}function zn(_0x53d303){return _0x53d303['replace'](/^\s+/gm,'')['replace'](/\s+$/gm,'')['replace'](/\n*/g,'')['replace'](/\s+/g,'\x20')['replace'](/>\s*</g,'><');}function Bs(_0x1a370a){let _0x4612e2=0x0;for(;_0x1a370a['parentNode'];)_0x1a370a=_0x1a370a['parentNode'],_0x4612e2++;return _0x4612e2;}function Us(_0x8e98ab){const _0x55559=[];let _0xd88603=_0x8e98ab['nextSibling'];for(;_0xd88603;)_0x55559['push'](_0xd88603),_0xd88603=_0xd88603['nextSibling'];_0x55559['forEach'](_0x1e6182=>{_0x3d1b0b(_0x1e6182);});}class qi extends/* #__PURE__ -- @preserve */
|
|
25
|
+
ts(){['_m2html'];constructor(){super(),this['_m2html']=new _0x490e8d();}['convertMarkdownToHTML'](_0x2224a4){const _0x45eff2=this['_m2html']['parse'](_0x2224a4);return this['parseAndNormalizeHTML'](_0x45eff2);}['parseAndNormalizeHTML'](_0x376070){return this['_parseHTML'](_0x376070);}['_parseHTML'](_0x489786){const _0x2f76b9=Ui('<dummy>'+_0x489786['replace'](/^\t+/gm,'\x20')['replace'](/\n*/g,'')['replace'](/\s+/g,'\x20')['replace'](/<[^>]*?$/g,'')+'</dummy>');return _0x2f76b9['children']=_0x2f76b9['children'][0x0]['children'],_0x2f76b9;}}class zi extends/* #__PURE__ -- @preserve */
|
|
26
|
+
ts(){['_generateUid'];['_touchedNodesState']={'newIds':[],'modifiedIds':[],'removedIds':[],'invalidIds':[],'lastTouchedId':null};['_existingDataIds']=new Set();constructor(_0x4d550a){super(),this['_generateUid']=_0x4d550a||_0x3dbf6d;}['merge'](_0x23093c,_0xa83719,_0x3b9357){const _0x5389cd=_0x23093c['cloneNode'](!0x0);if(0x0===_0xa83719['childNodes']['length']){const _0x184f88=[];return Ji('data-id','new-element',_0x5389cd)['forEach'](_0x40a469=>{const _0x4c4220=this['_generateUid']();Ns(_0x40a469,'data-id',_0x4c4220),_0x184f88['push'](_0x4c4220);}),this['_removeSpecialComments'](_0x5389cd),{'parsedContent':_0x5389cd,'newNodeIds':_0x184f88,'modifiedNodeIds':[],'removedNodeIds':[]};}_0x3b9357&&_0x3b9357['markUnstableElements']&&this['_markLastTagElementUnstable'](_0x5389cd),this['_touchedNodesState']['newIds']=[],this['_touchedNodesState']['modifiedIds']=[],this['_touchedNodesState']['removedIds']=[],this['_touchedNodesState']['invalidIds']=[],this['_touchedNodesState']['lastTouchedId']=null,this['_existingDataIds']=new Set(Ji('data-id',null,_0xa83719)['map'](_0x5c162d=>At(_0x5c162d,'data-id'))['filter'](_0x3444f6=>!!_0x3444f6));let _0x517ae5=-0x1,_0x1326c9=!0x1;const _0xa34435=_0x5389cd['childNodes'],_0x5c76d8=Array['from'](_0xa34435)['filter'](_0x241ea2=>!(0x3===_0x241ea2['nodeType']&&''===Tt(_0x241ea2)['trim']())),_0x22894c=_0x5c76d8['length'];for(let _0x3f107b=0x0;_0x3f107b<_0x22894c;_0x3f107b++){const _0x21feaf=_0x5c76d8[_0x3f107b],_0x10249a=_0x5c76d8[_0x3f107b+0x1];if(this['_isNewNode'](_0x21feaf)){if(-0x1===_0x517ae5&&(_0x517ae5=_0x3f107b),this['_markWrappedElements'](_0x21feaf),!this['_isNewNode'](_0x10249a)){const [_0x1a702e,_0x314532]=this['_findReferenceNode'](_0x21feaf,_0x1326c9,_0xa83719);if(_0x1a702e){const _0x25dd01=Array['from'](_0x5c76d8)['slice'](_0x517ae5,_0x3f107b+0x1);this['_insertNodes'](_0x1a702e,_0x25dd01,_0x314532),_0x517ae5=-0x1;}}}else{if(this['_isExistingContentComment'](_0x21feaf))_0x1326c9=!0x0;else{if(this['_isExistingNode'](_0x21feaf)){const _0x50eea3=At(_0x21feaf,'data-id');if(_0x50eea3&&this['_existingDataIds']['has'](_0x50eea3)){const _0x185cd7=St('data-id',_0x50eea3,_0xa83719);this['_replaceNode'](_0x185cd7,_0x21feaf);}if(this['_touchedNodesState']['removedIds']['includes'](_0x50eea3)){const _0x58c8e3=this['_touchedNodesState']['removedIds']['indexOf'](_0x50eea3);this['_touchedNodesState']['removedIds']['splice'](_0x58c8e3,0x1);}}else{if(this['_isDelNode'](_0x21feaf)){const _0x55546a=At(_0x21feaf,'data-id');this['_touchedNodesState']['modifiedIds']['includes'](_0x55546a)||this['_storeDeletedElementIds'](_0x21feaf);}}}}}for(const _0x4048d0 of this['_touchedNodesState']['removedIds']){const _0x57ae77=St('data-id',_0x4048d0,_0xa83719);if(_0x57ae77){if(_0x3b9357&&_0x3b9357['replaceRemovedWith']){this['_touchedNodesState']['lastTouchedId']=_0x4048d0;const _0x152f38=_0x3b9357['replaceRemovedWith']['cloneNode'](!0x0);Ns(_0x152f38,'data-id',_0x4048d0),Ns(_0x152f38,'data-removed','true'),_0xa5e35f(_0x57ae77,_0x152f38);}else _0x3d1b0b(_0x57ae77);}}if(Ji('data-wrapped-id',null,_0xa83719)['forEach'](_0x33d14b=>{const _0x544073=St('data-id',At(_0x33d14b,'data-wrapped-id'),_0xa83719);var _0x4285ec,_0x37be67;_0x544073&&(_0x37be67=_0x33d14b,_0x3d1b0b(_0x4285ec=_0x544073),_0xa5e35f(_0x37be67,_0x4285ec));}),Ji('data-id','new-element',_0xa83719)['forEach'](_0x29b335=>{const _0x44c111=this['_getUid'](_0x29b335);Ns(_0x29b335,'data-id',_0x44c111),this['_touchedNodesState']['newIds']['push'](_0x44c111);}),this['_removeSpecialComments'](_0xa83719),_0x3b9357&&_0x3b9357['markUnstableElements']&&this['_markUnstableElements'](_0xa83719,_0x3b9357['markUnstableElementsDepth']||0x0),_0x3b9357&&_0x3b9357['cutAfterLastChange']&&this['_touchedNodesState']['lastTouchedId']){let _0x10c8c8=St('data-id',this['_touchedNodesState']['lastTouchedId'],_0xa83719);for(;_0x10c8c8;)Us(_0x10c8c8),_0x10c8c8=_0x10c8c8['parentNode'];}return{'parsedContent':_0xa83719,'newNodeIds':this['_touchedNodesState']['newIds'],'modifiedNodeIds':this['_touchedNodesState']['modifiedIds'],'removedNodeIds':this['_touchedNodesState']['removedIds']};}['_insertNodes'](_0x311323,_0x33e24f,_0x57d538){for(const _0x27f603 of _0x33e24f){const _0xe997bd=this['_getUid'](_0x27f603);Ns(_0x27f603,'data-id',_0xe997bd),this['_touchedNodesState']['newIds']['push'](_0xe997bd),this['_touchedNodesState']['lastTouchedId']=_0xe997bd;}const _0x331b13='afterbegin'===_0x57d538||'afterend'===_0x57d538?_0x33e24f['reverse']():_0x33e24f;for(const _0x179c48 of _0x331b13)Xi(_0x311323,_0x179c48,_0x57d538);}['_replaceNode'](_0x41e40b,_0x32db14){if(!_0x41e40b)return;if(_0x99c588=_0x32db14,zn(Tt(_0x41e40b))===zn(Tt(_0x99c588)))return;var _0x99c588;const _0xc7fe86=this['_getUid'](_0x41e40b);Ns(_0x32db14,'data-id',_0xc7fe86),this['_touchedNodesState']['modifiedIds']['push'](_0xc7fe86),this['_touchedNodesState']['lastTouchedId']=_0xc7fe86,_0xa5e35f(_0x41e40b,_0x32db14['cloneNode'](!0x0));}['_findReferenceNode'](_0x5eec0f,_0x2bf6ed,_0x1378c2){const _0x353e59=this['_findPrevElementWithDataId'](_0x5eec0f,!0x1);if(_0x353e59){const _0x52f8df=this['_getNodeDataId'](_0x353e59),_0x486f26=St('data-id',_0x52f8df,_0x1378c2);if(_0x486f26)return[_0x486f26,'afterend'];this['_touchedNodesState']['invalidIds']['push'](_0x52f8df);}const _0x3f5d90=this['_findNextElementWithDataId'](_0x5eec0f,!0x1);if(_0x3f5d90){const _0x3b5ed9=this['_getNodeDataId'](_0x3f5d90),_0x31f7b4=St('data-id',_0x3b5ed9,_0x1378c2);if(_0x31f7b4)return[_0x31f7b4,'beforebegin'];this['_touchedNodesState']['invalidIds']['push'](_0x3b5ed9);}return _0x2bf6ed?_0x5eec0f['nextSibling']?this['_findFallbackReferenceNode'](_0x5eec0f,_0x1378c2):[_0x1378c2['childNodes'][_0x1378c2['childNodes']['length']-0x1],'afterend']:[_0x1378c2['childNodes'][0x0],'beforebegin'];}['_findFallbackReferenceNode'](_0x5ce489,_0x4525bd){const _0x3ac377=[],_0x36d31a=this['_findPrevElementWithDataId'](_0x5ce489,!0x0);if(_0x36d31a){const _0x255807=St('data-id',this['_getNodeDataId'](_0x36d31a),_0x4525bd);_0x255807&&_0x3ac377['push']([_0x255807,'afterend']);}const _0x4f876c=this['_findNextElementWithDataId'](_0x5ce489,!0x0);if(_0x4f876c){const _0x1e95a7=St('data-id',this['_getNodeDataId'](_0x4f876c),_0x4525bd);_0x1e95a7&&_0x3ac377['push']([_0x1e95a7,'beforebegin']);}if(_0x3ac377['length']>0x1)return Bs(_0x3ac377[0x0][0x0])<=Bs(_0x3ac377[0x1][0x0])?_0x3ac377[0x0]:_0x3ac377[0x1];return 0x1===_0x3ac377['length']?_0x3ac377[0x0]:[_0x4525bd['lastChild'],'afterend'];}['_findNextElementWithDataId'](_0x446bf0,_0x1dbad7){let _0x412f35=_0x446bf0['nextSibling'],_0x576ea5=null,_0x4ff767=!0x1;for(;_0x412f35;){if(_0x440dc4(_0x412f35)){if(this['_isDelNode'](_0x412f35)&&(_0x576ea5=_0x412f35),this['_isExistingContentComment'](_0x412f35)&&_0x1dbad7&&!_0x4ff767){_0x4ff767=!0x0,_0x412f35=_0x412f35['nextSibling'];continue;}break;}const _0x538fe1=At(_0x412f35,'data-id');if(_0x538fe1&&'new-element'!==_0x538fe1&&this['_existingDataIds']['has'](_0x538fe1)){_0x576ea5=_0x412f35;break;}_0x412f35=_0x412f35['nextSibling'];}return _0x576ea5;}['_findPrevElementWithDataId'](_0x537aeb,_0x4d91d8){let _0x4d345e=_0x537aeb['previousSibling'],_0x47b4c8=null,_0x459cf3=!0x1;for(;_0x4d345e;){if(_0x440dc4(_0x4d345e)){if(this['_isDelNode'](_0x4d345e)&&(_0x47b4c8=_0x4d345e),this['_isExistingContentComment'](_0x4d345e)&&_0x4d91d8&&!_0x459cf3){_0x459cf3=!0x0,_0x4d345e=_0x4d345e['previousSibling'];continue;}break;}const _0x2c6ee7=At(_0x4d345e,'data-id');if(_0x2c6ee7&&'new-element'!==_0x2c6ee7&&this['_existingDataIds']['has'](_0x2c6ee7)){_0x47b4c8=_0x4d345e;break;}_0x4d345e=_0x4d345e['previousSibling'];}return _0x47b4c8;}['_markWrappedElements'](_0x788d48){_0x26bfdf(_0x788d48)&&Ji('data-id',null,_0x788d48)['forEach'](_0x2cc94f=>{this['_isExistingNode'](_0x2cc94f)&&!this['_hasWrappedParent'](_0x2cc94f)&&(Ns(_0x2cc94f,'data-wrapped-id',At(_0x2cc94f,'data-id')),Ns(_0x2cc94f,'data-id',null));});}['_getNodeDataId'](_0x42571b){if(!_0x42571b)return null;if(_0x26bfdf(_0x42571b))return At(_0x42571b,'data-id');if(_0x440dc4(_0x42571b)){const _0x32c8f3=Tt(_0x42571b)['match'](/removed[\s*-]data-id="([^"]+)"/);if(_0x32c8f3&&_0x32c8f3[0x1])return _0x32c8f3[0x1];}return null;}['_storeDeletedElementIds'](_0x50c993){if(_0x440dc4(_0x50c993)){const _0x352030=Tt(_0x50c993)['match'](/removed[\s*-]data-id="([^"]+)"/);_0x352030&&_0x352030[0x1]&&this['_touchedNodesState']['removedIds']['push'](_0x352030[0x1]);}}['_getUid'](_0xeea041){return this['_isExistingNode'](_0xeea041)?At(_0xeea041,'data-id'):this['_generateUid']();}['_removeSpecialComments'](_0x5401d7){(function(_0x5214a8){return _0x50b699(_0x3de298=>_0x440dc4(_0x3de298),_0x5214a8,!0x0,0x1/0x0);}(_0x5401d7)['filter'](_0x12f95a=>this['_isDelNode'](_0x12f95a)||this['_isExistingContentComment'](_0x12f95a))['forEach'](_0x3c2c33=>{_0x3d1b0b(_0x3c2c33);}));}['_markLastTagElementUnstable'](_0x4d2eec){const _0x438c15=_0x4d2eec['childNodes'],_0x4c66ac=_0x438c15[_0x438c15['length']-0x1];_0x4c66ac&&_0x26bfdf(_0x4c66ac)&&Ns(_0x4c66ac,'data-unstable','true');}['_markUnstableElements'](_0x4a0338,_0x1c0075){const _0x562118=St('data-unstable','true',_0x4a0338);if(!_0x562118)return;const _0x37cdee=Pi(_0x562118)['slice'](0x0,-0x1),_0x48576a=_0x37cdee['length'];let _0x100188=_0x562118;if(_0x48576a>_0x1c0075){let _0x1ded1a=_0x48576a,_0x4934b3=null;for(;_0x1ded1a>_0x1c0075&&_0x1ded1a>=0x0;)_0x1ded1a--,_0x4934b3=_0x37cdee[_0x1ded1a];_0x4934b3&&(_0x100188=_0x4934b3,Ns(_0x562118,'data-unstable',null),Ns(_0x4934b3,'data-unstable','true'));}else{if(_0x48576a<_0x1c0075){let _0x174f54=_0x48576a,_0x63c904=_0x562118;for(;_0x174f54<_0x1c0075;){const _0xa4d2c5=_0x63c904['childNodes']['filter'](_0x3e8ac5=>_0x26bfdf(_0x3e8ac5));if(0x0===_0xa4d2c5['length'])break;_0x174f54++,_0x63c904=_0xa4d2c5[_0xa4d2c5['length']-0x1];}_0x63c904&&(_0x100188=_0x63c904,Ns(_0x562118,'data-unstable',null),Ns(_0x63c904,'data-unstable','true'));}}let _0x168a4f=_0x100188;for(;_0x168a4f;){for(;_0x168a4f['nextSibling'];)_0x168a4f=_0x168a4f['nextSibling'],_0x26bfdf(_0x168a4f)&&Ns(_0x168a4f,'data-unstable','true');_0x168a4f=_0x168a4f['parentNode'];}}['_isNewNode'](_0x1fdbcf){return Boolean('new-element'===At(_0x1fdbcf,'data-id'));}['_isExistingNode'](_0x452287){return Boolean((At(_0x452287,'data-id')||'')['length']>0x0&&'new-element'!==At(_0x452287,'data-id'));}['_isDelNode'](_0x51fc90){return!!_0x51fc90&&Boolean(_0x440dc4(_0x51fc90)&&Tt(_0x51fc90)['match'](/removed[\s*-]data-id="[^"]+"/));}['_hasWrappedParent'](_0x5a5ce8){let _0x44f8f7=_0x5a5ce8['parentNode'];for(;_0x44f8f7;){if(At(_0x44f8f7,'data-wrapped-id'))return!0x0;_0x44f8f7=_0x44f8f7['parentNode'];}return!0x1;}['_isExistingContentComment'](_0xe39fae){return Boolean(_0x440dc4(_0xe39fae)&&Tt(_0xe39fae)['match'](/\s*existing[\s*-](content|document)\s*/g));}}function J({editor:_0x1e8af6,changeGroups:_0x4b858b,documentContextContent:_0x2ecde2,showDiff:_0x4b943c,trimUnchanged:_0x514eaa=!0x0}){return _0x4b858b['map'](_0x4efc55=>{const _0x4c9ba0=new Et([]),_0xe2c345=new Et([]);for(const _0x25b493 of _0x4efc55['changes'])if(_0x4b943c&&'removed'==_0x25b493['type']||_0xe2c345['children']['push'](_0x25b493['node']['cloneNode'](!0x0)),'new'!=_0x25b493['type']&&(_0x4b943c||'removed'!=_0x25b493['type'])){const _0x585607=yt(_0x4ebe1e=>At(_0x4ebe1e,'data-id')==_0x25b493['id'],_0x2ecde2,!0x0);_0x585607&&_0x4c9ba0['children']['push'](_0x585607['cloneNode'](!0x0));}const {content:_0x345688,hasChanges:_0xdf6277}=function(_0x31d76e,_0x14ad25,_0x345bee,_0x3fa15e,_0xdd16eb=!0x0){const _0x1111aa=_0x31d76e['plugins']['get']('DocumentCompare'),_0x53392f=Tt(_0x14ad25),_0x38c468=Tt(_0x345bee),_0x5e555c=_0x31d76e['data']['parse'](_0x53392f,'$root'),_0x576674=_0x31d76e['model']['createPositionAt'](_0x5e555c,0x0),_0x10a54c=_0x1111aa['getDiff'](_0x53392f,_0x38c468,{'anchor':_0x576674,'markDeletions':_0x3fa15e}),_0x3a6946=_0x10a54c['getOperations']();if(0x0==_0x3a6946['length'])return{'content':_0x14ad25['cloneNode'](!0x0),'hasChanges':!0x1};_0x3fa15e?function(_0x3da35b,_0x2ede97,_0x42007b){if(0x0==_0x3da35b['length'])return;const _0x1ecf71=_0x42007b['plugins']['get']('DocumentCompare'),_0x2c80fa=_0x42007b['plugins']['get']('SuggestionsConversion');_0x42007b['model']['change'](_0x2d3982=>{const _0x52b596=new Set();for(let _0x410133=0x0;_0x410133<_0x3da35b['length'];_0x410133++){const _0x270949=_0x3da35b[_0x410133];if(_0x270949['baseVersion']=null,_0x270949['isDocumentOperation']=!0x1,_0x1ecf71['isMarkedRemoveOperation'](_0x270949)){const _0xab60ba=_0x4dc946(_0x270949['newRange'],_0x42007b['model']),_0x43526d='suggestion:deletion:'+_0x3dbf6d()+':$aiSuggestion';_0x2ede97['markers']['set'](_0x43526d,_0xab60ba);}else switch(_0x270949['type']){case'rename':{if(_0x270949['oldName']==_0x270949['newName'])break;_0x2d3982['batch']['addOperation'](_0x270949),_0x42007b['model']['applyOperation'](_0x270949);const _0x3aa46d='$elementName',_0x42c6f2=_0x270949['position'],_0x5a3f18=_0x42007b['model']['createRange'](_0x42c6f2,_0x42007b['model']['createPositionAt'](_0x42c6f2['nodeAfter'],'end')),_0x1ef56f='suggestion:attribute:'+_0x3aa46d+':'+_0x3dbf6d()+':$aiSuggestion';_0x2ede97['markers']['set'](_0x1ef56f,_0x5a3f18);break;}case'addAttribute':case'removeAttribute':case'changeAttribute':{if(_0x270949['oldValue']==_0x270949['newValue'])break;_0x2d3982['batch']['addOperation'](_0x270949),_0x42007b['model']['applyOperation'](_0x270949);const _0x5227c2=_0x270949['key'];if(!_0x2c80fa['isRegisteredAttribute'](_0x5227c2))break;const _0x31c3db=_0x4dc946(_0x270949['range'],_0x42007b['model']),_0x3eff9a='suggestion:attribute:'+_0x5227c2+':'+_0x3dbf6d()+':$aiSuggestion';_0x2ede97['markers']['set'](_0x3eff9a,_0x31c3db);break;}case'insert':{_0x2d3982['batch']['addOperation'](_0x270949),_0x42007b['model']['applyOperation'](_0x270949);if(_0x3da35b[_0x410133+0x1]&&'move'==_0x3da35b[_0x410133+0x1]['type']){no(_0x2ede97,_0x270949);break;}const _0x485b1a=_0x270949['position'],_0x565dc4=_0x270949['howMany'],_0x5e6dae=_0x4dc946(_0x42007b['model']['createRange'](_0x485b1a,_0x485b1a['getShiftedBy'](_0x565dc4)),_0x42007b['model']),_0x2b48cc='suggestion:insertion:'+_0x3dbf6d()+':$aiSuggestion';_0x2ede97['markers']['set'](_0x2b48cc,_0x5e6dae);break;}case'split':{_0x2d3982['batch']['addOperation'](_0x270949),_0x42007b['model']['applyOperation'](_0x270949);const _0x46c5d7=_0x270949['splitPosition'],_0x301194=_0x270949['moveTargetPosition'],_0x53a421=_0x42007b['model']['createRange'](_0x46c5d7,_0x301194),_0x1ae967='suggestion:insertion:'+_0x3dbf6d()+':$aiSuggestion';_0x2ede97['markers']['set'](_0x1ae967,_0x53a421);break;}case'move':{_0x2d3982['batch']['addOperation'](_0x270949),_0x42007b['model']['applyOperation'](_0x270949),_0x3da35b[_0x410133-0x1]&&'insert'==_0x3da35b[_0x410133-0x1]['type']&&no(_0x2ede97,_0x270949);const _0x1c4091=_0x270949['getMovedRangeStart'](),_0x3e129c=_0x270949['howMany'];for(let _0x243e1f=0x0;_0x243e1f<_0x3e129c;_0x243e1f++){const _0x3ecc89=_0x1c4091['getShiftedBy'](_0x243e1f)['nodeAfter'];_0x52b596['add'](_0x3ecc89);}break;}case'remove':{const _0x4858a0=_0x270949['sourcePosition'],_0x31fae4=_0x270949['howMany'],_0x5d3e2f=new et(_0x4858a0,_0x31fae4);_0x2d3982['batch']['addOperation'](_0x5d3e2f),_0x42007b['model']['applyOperation'](_0x5d3e2f);break;}}}for(const _0x55f1fd of _0x52b596){const _0x1e1700=_0x42007b['model']['createRangeOn'](_0x55f1fd),_0x171c07='suggestion:formatBlock:$fakeWrap:'+_0x3dbf6d()+':$aiSuggestion';_0x2ede97['markers']['set'](_0x171c07,_0x4dc946(_0x1e1700,_0x42007b['model']));}});}(_0x3a6946,_0x5e555c,_0x31d76e):_0x31d76e['model']['change'](_0x567257=>{for(const _0x505325 of _0x3a6946)if('remove'==_0x505325['type']){const _0x310f79=_0x505325['sourcePosition'],_0x187517=_0x505325['howMany'],_0x5cd92d=new et(_0x310f79,_0x187517);_0x567257['batch']['addOperation'](_0x5cd92d),_0x31d76e['model']['applyOperation'](_0x5cd92d);}else{if('marker'==_0x505325['type']){const _0x535082=_0x505325['name'],_0x427c70=_0x505325['newRange'];null!==_0x427c70?_0x5e555c['markers']['set'](_0x535082,_0x427c70):_0x5e555c['markers']['delete'](_0x535082);}else _0x505325['baseVersion']=null,_0x505325['isDocumentOperation']=!0x1,_0x567257['batch']['addOperation'](_0x505325),_0x31d76e['model']['applyOperation'](_0x505325);}});if(_0xdd16eb){const _0xddb3eb=mt(_0x31d76e,_0x3a6946,_0x5e555c);ft(_0x31d76e['model'],_0xddb3eb),function(_0x19f8d3,_0x3d806f){const _0x1d4114=_0x3d806f['getFirstRange']()['start'];let _0x3e1f04=_0x3d806f['getFirstRange']()['end'];const _0x45d946=_0x1d4114['root'];(_0x3e1f04['textNode']||_0x3e1f04['nodeAfter']&&_0x3e1f04['nodeAfter']['is']('$text'))&&(_0x4c8c27(_0x3e1f04,'...'),_0x3e1f04=_0x3e1f04['getShiftedBy'](0x3)),(_0x1d4114['textNode']||_0x1d4114['nodeBefore']&&_0x1d4114['nodeBefore']['is']('$text'))&&(_0x4c8c27(_0x1d4114,'...'),function(_0x13ce05,_0x5cb15b,_0x451064){for(let [_0xf359b9,_0x444412]of _0x13ce05['markers']){const _0x49ab83=_0x444412['_getTransformedByInsertion'](_0x5cb15b,_0x451064,!0x1);_0x444412=_0x49ab83[0x0],_0x13ce05['markers']['set'](_0xf359b9,_0x444412);}}(_0x45d946,_0x1d4114,0x3),_0x1d4114['parent']==_0x3e1f04['parent']&&(_0x3e1f04=_0x3e1f04['getShiftedBy'](0x3)));const _0x52d44a=_0x19f8d3['createRange'](_0x19f8d3['createPositionAt'](_0x45d946,0x0),_0x1d4114),_0x55e852=_0x19f8d3['createRange'](_0x3e1f04,_0x19f8d3['createPositionAt'](_0x45d946,'end')),_0x495492=[..._0x52d44a['getMinimalFlatRanges'](),..._0x55e852['getMinimalFlatRanges']()];_0x495492['reverse']();for(const _0x505f34 of _0x495492)to(_0x505f34),Jn(_0x45d946,_0x505f34);}(_0x31d76e['model'],_0xddb3eb);}const _0x3c8476=_0x31d76e['data']['stringify'](_0x5e555c,{'showSuggestionHighlights':!0x0});return{'content':Ui(_0x3c8476),'hasChanges':!0x0};}(_0x1e8af6,_0x4c9ba0,_0xe2c345,_0x4b943c,_0x514eaa);return{'type':_0x4efc55['changes'][0x0]['type'],'index':_0x4efc55['index'],'content':_0x345688,'hasChanges':_0xdf6277};});}function no(_0x455a58,_0x31d37d){for(const [_0x110c85,_0x3b1492]of _0x455a58['markers']){const _0x4b7666=it['_createFromRanges'](_0x3b1492['getTransformedByOperation'](_0x31d37d));_0x455a58['markers']['set'](_0x110c85,_0x4b7666);}}function mt(_0x3fb4a3,_0x5cc8b0,_0xfdbad0){const _0x231e86=_0x3fb4a3['plugins']['get']('DocumentCompare');let _0x4dd037=_0x3fb4a3['model']['createPositionAt'](_0xfdbad0,Number['POSITIVE_INFINITY']),_0x23d391=_0x3fb4a3['model']['createPositionAt'](_0xfdbad0,0x0);for(const _0x473e17 of _0x5cc8b0){let _0x22a63f,_0x4c06d4;if(_0x231e86['isMarkedRemoveOperation'](_0x473e17))_0x22a63f=_0x473e17['newRange']['start'],_0x4c06d4=_0x473e17['newRange']['end'];else switch(_0x4dd037=_0x4dd037['getTransformedByOperation'](_0x473e17),_0x23d391=_0x23d391['getTransformedByOperation'](_0x473e17),_0x473e17['type']){case'rename':_0x22a63f=_0x473e17['position'],_0x4c06d4=_0x22a63f['getShiftedBy'](0x1);break;case'addAttribute':case'removeAttribute':case'changeAttribute':_0x22a63f=_0x473e17['range']['start'],_0x4c06d4=_0x473e17['range']['end'];break;case'insert':_0x22a63f=_0x473e17['position'],_0x4c06d4=_0x22a63f['getShiftedBy'](_0x473e17['howMany']);break;case'split':_0x22a63f=_0x473e17['splitPosition'],_0x4c06d4=_0x473e17['moveTargetPosition'];break;case'merge':{const _0x57205e=_0x473e17['targetPosition']['path']['slice'](0x0,-0x1);_0x22a63f=_0x3fb4a3['model']['createPositionFromPath'](_0xfdbad0,_0x57205e),_0x4c06d4=_0x22a63f['getShiftedBy'](0x1);break;}case'remove':{const _0x1be744=_0x473e17['howMany'],_0x3c3028=_0x473e17['sourcePosition']['_getTransformedByInsertion'](_0x473e17['targetPosition'],_0x1be744),_0x5166bc=_0x473e17['getMovedRangeStart']();'remove'==_0x473e17['type']?(_0x22a63f=_0x3c3028,_0x4c06d4=_0x3c3028):(_0x22a63f=_0x5166bc,_0x4c06d4=_0x5166bc['getShiftedBy'](_0x1be744));break;}}_0x22a63f&&_0x22a63f['isBefore'](_0x4dd037)&&(_0x4dd037=_0x22a63f['clone'](),_0x4dd037['stickiness']='toNone'),_0x4c06d4&&_0x4c06d4['isAfter'](_0x23d391)&&(_0x23d391=_0x4c06d4['clone'](),_0x23d391['stickiness']='toNone');}return _0x3fb4a3['model']['createSelection'](_0x3fb4a3['model']['createRange'](_0x4dd037,_0x23d391));}function ft(_0x38c917,_0x4de204){ro(_0x38c917,_0x4de204,'forward');const _0x1a17b4=_0x4de204['getFirstRange']();_0x4de204['setTo']([]),_0x4de204['setTo'](_0x1a17b4,{'backward':!0x0}),ro(_0x38c917,_0x4de204,'backward');}function ro(_0x5843b2,_0x5eca70,_0xe6c03e){let _0x4925b0=0x14;for(;_0x4925b0;){_0x5843b2['modifySelection'](_0x5eca70,{'unit':'word','direction':_0xe6c03e}),_0x4925b0--;const _0x3795ac=_0x5eca70['focus']['forward'==_0xe6c03e?'nodeBefore':'nodeAfter'];if(_0x3795ac&&_0x3795ac['is']('element')&&_0x5843b2['schema']['isBlock'](_0x3795ac)&&_0x5843b2['schema']['isObject'](_0x3795ac))break;}}function Jn(_0x3d416e,_0x3c5977){for(const [_0x1c7c48,_0x2753fa]of _0x3d416e['markers']){const _0x21d9b9=_0x2753fa['_getTransformedByDeletion'](_0x3c5977['start'],_0x3c5977['end']['offset']-_0x3c5977['start']['offset']);null!=_0x21d9b9?_0x3d416e['markers']['set'](_0x1c7c48,_0x21d9b9):_0x3d416e['markers']['delete'](_0x1c7c48);}}class He extends ts(){['id'];['interactionId'];['type'];['sources']=[];['parsedContent']=new Et([]);['parsedMergedContent']=new Et([]);['changeGroups']=[];['areActionsDisabled']=!0x1;['documentContextContent'];['aiResponseParser'];['aiResponseApplier'];['editor'];['cachedSuggestionContentParts']={'withDiff':[],'withoutDiff':[]};constructor({type:_0x191323,content:_0xa3c825='',isDone:_0x4156c7=!0x1,interactionId:_0x242e08,areActionsDisabled:_0x3332b8,documentContextContent:_0x58e2a0,editor:_0x3a38e4,id:_0x43335e}){super(),this['id']=_0x43335e||_0x3dbf6d(),this['interactionId']=_0x242e08,this['type']=_0x191323,this['areActionsDisabled']=!!_0x3332b8,this['editor']=_0x3a38e4,this['aiResponseParser']=new qi(),this['aiResponseApplier']=new zi(),this['documentContextContent']=Ui(_0x58e2a0||''),this['set']('isDone',_0x4156c7),this['on']('change:content',()=>{this['onContentChange']();}),this['set']('content',_0xa3c825);}['appendContent'](_0x346f82){this['set']('content',this['content']+_0x346f82);}['done'](){this['isDone']||(this['set']('isDone',!0x0),this['onContentChange']());}['destroy'](){this['stopListening']();}['setChangeGroupState'](_0x14733c,_0x4b3c26){this['changeGroups'][_0x14733c]['state']=_0x4b3c26,this['fire']('replyChangeGroupStateUpdated',{'reply':this,'index':_0x14733c,'state':_0x4b3c26});}['getContentParts']({showDiff:_0x35641f,groupIndex:_0x63e55}){if(!this['editor'])throw new _0x509ee0('ai-get-editor-from-context-no-editor',null,{'aiReply':this});const _0x3f1d4f=this['_getCachedContentParts'](_0x35641f,_0x63e55);if(_0x3f1d4f)return _0x3f1d4f;let _0x2b5b2c=[];if(void 0x0===_0x63e55)_0x2b5b2c=this['changeGroups'];else{const _0x509c00=this['changeGroups']['find'](({index:_0x98fc30})=>_0x98fc30===_0x63e55);if(!_0x509c00)throw new _0x509ee0('ai-reply-get-content-parts-group-not-found',null,{'aiReply':this,'groupIndex':_0x63e55});_0x2b5b2c=[_0x509c00];}const _0x491f88=J({'editor':this['editor'],'showDiff':_0x35641f,'changeGroups':_0x2b5b2c,'documentContextContent':this['documentContextContent']});return this['_setCachedContentParts'](_0x35641f,_0x491f88),_0x491f88;}['_getCachedContentParts'](_0x350b1d,_0x3215fe){const _0x2be4b5=_0x350b1d?'withDiff':'withoutDiff';if(!this['cachedSuggestionContentParts'][_0x2be4b5]['length'])return null;const _0x1f4963=this['cachedSuggestionContentParts'][_0x2be4b5];if(void 0x0===_0x3215fe)return _0x1f4963['length']>0x0&&_0x1f4963['length']!==this['changeGroups']['length']?(this['_setCachedContentParts'](_0x350b1d,null),null):_0x5e82db(_0x1f4963);{const _0x19d77e=_0x1f4963['find'](({index:_0x97515a})=>_0x97515a===_0x3215fe);if(_0x19d77e)return[_0x5e82db(_0x19d77e)];}return null;}['_setCachedContentParts'](_0xd31861,_0x5b79ea){const _0x256ebd=_0xd31861?'withDiff':'withoutDiff';_0x5b79ea?_0x5b79ea['forEach'](_0x5da0c1=>{const _0x413704=this['cachedSuggestionContentParts'][_0x256ebd],_0x37ce51=_0x413704['find'](({index:_0x4a34e7})=>_0x4a34e7===_0x5da0c1['index']);if(_0x37ce51){const _0x57b7c1=_0x413704['indexOf'](_0x37ce51);_0x413704['splice'](_0x57b7c1,0x1,_0x5da0c1);}else _0x413704['push'](_0x5da0c1);}):this['cachedSuggestionContentParts'][_0x256ebd]['length']=0x0;}['onContentChange'](){if('modification'===this['type']){this['parsedContent']=this['aiResponseParser']['parseAndNormalizeHTML'](this['content']);const _0x228d75=this['changeGroups'];this['updateChangeGroups']();const _0x12ad14=this['_getDifferentChangeGroups'](_0x228d75,this['changeGroups']);(_0x12ad14['length']||this['isDone'])&&(this['fire']('replyContentUpdated',this,_0x12ad14),this['cachedSuggestionContentParts']['withDiff']['length']=this['cachedSuggestionContentParts']['withoutDiff']['length']=0x0);}else this['parsedContent']=this['aiResponseParser']['convertMarkdownToHTML'](this['content']),this['fire']('replyContentUpdated',this);}['_getDifferentChangeGroups'](_0x530fef,_0x5c0596){const _0x3956a3=[];for(const _0x5e14a9 of _0x5c0596){const _0x3aaf5b=_0x530fef[_0x5e14a9['index']];_0x3aaf5b?_0x3aaf5b['changes']['length']!==_0x5e14a9['changes']['length']?_0x3956a3['push'](_0x5e14a9):_0x3aaf5b['changes']['forEach']((_0x1a54b0,_0x353781)=>{const _0x484685=_0x5e14a9['changes'][_0x353781];_0x1a54b0['id']!==_0x484685['id']&&_0x3956a3['push'](_0x5e14a9);}):_0x3956a3['push'](_0x5e14a9);}return _0x3956a3;}['updateChangeGroups'](){const _0x997d3b=new _0x4279d7('p',{},[new _0x4279d7('span',{'style':'color:\x20#808080;\x20font-style:\x20italic'},[new _0x28fe50(i(this['editor']['locale'],'AI_SUGGESTION_CONTENT_PART_REMOVED'))])]),_0x292c47=this['aiResponseApplier']['merge'](this['parsedContent'],this['documentContextContent']['cloneNode'](!0x0),{'markUnstableElements':!this['isDone'],'replaceRemovedWith':_0x997d3b,'cutAfterLastChange':!this['isDone']});if(!_0x292c47['modifiedNodeIds']['length']&&!this['isDone'])return;this['parsedMergedContent']=_0x292c47['parsedContent'];let _0x39a843=[];if(_0x52a524(_0x3b2736=>{const _0x92d197=At(_0x3b2736,'data-id');if(!_0x92d197||!_0xd5db3c(_0x92d197))return!0x1;const _0x207fb8=[_0x3b2736,...Pi(_0x3b2736)]['at'](-0x2);if(_0x3b2736!=_0x207fb8){const _0x36f529=At(_0x207fb8,'data-id');_0xd5db3c(_0x36f529)||(_0x39a843['push']({'node':_0x207fb8,'id':_0x36f529,'type':'modified'}),_0x292c47['modifiedNodeIds']['push'](_0x36f529));}else _0x292c47['modifiedNodeIds']['includes'](_0x92d197)?_0x39a843['push']({'node':_0x3b2736,'type':'modified','id':_0x92d197}):_0x292c47['newNodeIds']['includes'](_0x92d197)?_0x39a843['push']({'node':_0x3b2736,'type':'new','id':_0x92d197,'anchorId':At(_0x3b2736['previousSibling'],'data-id')}):_0x39a843['push']({'node':_0x3b2736,'type':'removed','id':_0x92d197});return!0x0;},this['parsedMergedContent']),_0x39a843=_0x39a843['filter'](({node:_0x30426e})=>[...Pi(_0x30426e),_0x30426e]['every'](_0x40d78d=>!At(_0x40d78d,'data-unstable'))),0x0==_0x39a843['length'])return;const _0x556150=[[_0x39a843[0x0]]];for(let _0x59284e=0x1;_0x59284e<_0x39a843['length'];_0x59284e++){const _0x1f78c6=_0x556150[_0x556150['length']-0x1],_0x5bc844=_0x1f78c6[_0x1f78c6['length']-0x1];_0x39a843[_0x59284e]['node']['previousSibling']==_0x5bc844['node']&&'modified'!=_0x39a843[_0x59284e]['type']&&'modified'!=_0x5bc844['type']?_0x1f78c6['push'](_0x39a843[_0x59284e]):_0x556150['push']([_0x39a843[_0x59284e]]);}for(const _0x2a4e57 of _0x556150){const _0x1d43ce=_0x2a4e57[0x0],_0x2f8198=_0x2a4e57[_0x2a4e57['length']-0x1],_0x12cb6c=_0x181353(_0x1d43ce['node']['previousSibling']);_0x12cb6c&&_0x2a4e57['unshift'](_0x12cb6c);const _0x734fe4=_0x181353(_0x2f8198['node']['nextSibling']);_0x734fe4&&_0x2a4e57['push'](_0x734fe4);}function _0xd5db3c(_0x504698){return _0x292c47['modifiedNodeIds']['includes'](_0x504698)||_0x292c47['newNodeIds']['includes'](_0x504698)||_0x292c47['removedNodeIds']['includes'](_0x504698);}function _0x181353(_0x4d4ea9){if(_0x4d4ea9&&At(_0x4d4ea9,'data-id')&&!At(_0x4d4ea9,'data-unstable')){const _0x3ee50d=At(_0x4d4ea9,'data-id');if(!_0xd5db3c(_0x3ee50d))return{'node':_0x4d4ea9,'type':'context','id':_0x3ee50d};}return null;}this['changeGroups']=_0x556150['map']((_0x55b58f,_0x1d199d)=>({'changes':_0x55b58f,'state':'pending','index':_0x1d199d}));}}const ze=['interactionCreated','interactionStarted','interactionStopped','interactionFinished','interactionDestroyed','replyCreated','replyContentUpdated','replyChangeGroupStateUpdated','setConversationTitle','webSearchStarted','webSearchFinished','reasoningStarted','reasoningFinished','toolDataReceived','error'];class Fe extends _0x17d663(){['id'];['replies']=[];['currentReply'];['messageId'];['actionCallId'];['currentRequest'];['connector'];['isStopped']=!0x1;['isDestroyed']=!0x1;['editor'];['_isReasoning']=!0x1;['_isWebSearching']=!0x1;constructor({connector:_0x447926,editor:_0x53c4ed}){super(),this['id']=_0x3dbf6d(),this['connector']=_0x447926,this['isStopped']=!0x0,this['editor']=_0x53c4ed;}async['start'](){const _0x31c348=[];let _0x40a9c6,_0xbd8e8c,_0x5c1a7c;this['isStopped']=!0x1;try{this['currentRequest']=await this['sendRequest'](),this['fire']('interactionStarted',this);const _0x1756dc=await this['currentRequest']['getStream']();for await(const _0x5a9e66 of _0x1756dc){if(this['isStopped'])return;if('error'==_0x5a9e66['event'])return void this['fire']('error',{'error':new _0x509ee0('ai-chat-interaction-error',this)});switch(_0x5a9e66['event']){case'message-metadata':this['messageId']=_0x5a9e66['data']['messageId'];break;case'action-metadata':this['actionCallId']=_0x5a9e66['data']['callId'];break;case'conversation-title':this['setConversationTitle'](_0x5a9e66['data']['conversationTitle'],!0x0);break;case'source':_0x31c348['push'](_0x5a9e66['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'](),_0x40a9c6='modification-delta'==_0x5a9e66['event']?'modification':'text',_0xbd8e8c='modification-delta'==_0x5a9e66['event']?_0x5a9e66['data']['id']:void 0x0,this['currentReply']&&this['currentReply']['type']!=_0x40a9c6&&(this['currentReply']['done'](),this['currentReply']=void 0x0),this['currentReply']||(this['currentReply']=this['createReply']({'type':_0x40a9c6,'interactionId':this['id'],'id':_0xbd8e8c}),'modification'==_0x40a9c6&&(this['currentReply']['sources']=_0x31c348['splice'](0x0))),this['currentReply']['appendContent'](_0x5a9e66['data']['textDelta']);break;case'mcp-tool-result':_0x5c1a7c=JSON['parse'](_0x5a9e66['data']['result']),this['_handleToolResultData']({'toolName':_0x5a9e66['data']['toolName'],'data':_0x5c1a7c['data'],'attributes':_0x5c1a7c['attributes']});break;case'mcp-tool-notification':this['_handleToolNotificationData']({'toolName':_0x5a9e66['data']['toolName'],'data':_0x5a9e66['data']['data']});}}}finally{this['isStopped']||(this['currentReply']&&_0x31c348['length']>0x0&&(this['currentReply']['sources']=_0x31c348['splice'](0x0)),this['_finalizeInteraction'](),this['fire']('interactionFinished',this));}}['stop'](){this['isStopped']||(this['_finalizeInteraction'](),this['fire']('interactionStopped',this));}['getReply'](_0x6edf68){return this['replies']['find'](_0x1934bd=>_0x1934bd['id']===_0x6edf68);}['destroy'](){this['isDestroyed']||(this['stop'](),this['replies']['forEach'](_0x31e0c7=>_0x31e0c7['destroy']()),this['replies']=[],this['isDestroyed']=!0x0,this['fire']('interactionDestroyed',this),this['stopListening']());}['createReply'](_0x3316e7){const _0x3f77b0=new He({'editor':this['editor'],'documentContextContent':this['getDocumentContext']()?.['content'],..._0x3316e7});return this['replies']['push'](_0x3f77b0),_0x3f77b0['delegate'](...ze)['to'](this),this['fire']('replyCreated',_0x3f77b0),_0x3f77b0;}['setConversationTitle'](_0x8be572,_0x4ba648=!0x1){this['fire']('setConversationTitle',_0x8be572,_0x4ba648);}['resetWebSearchState'](){this['_isWebSearching']&&(this['_isWebSearching']=!0x1,this['fire']('webSearchFinished',this));}['resetReasoningState'](){this['_isReasoning']&&(this['_isReasoning']=!0x1,this['fire']('reasoningFinished',this));}['_handleToolResultData'](_0x48cc0f){this['fire']('toolDataReceived',{'type':'result','toolName':_0x48cc0f['toolName'],'data':structuredClone(_0x48cc0f['data']||{}),'attributes':structuredClone(_0x48cc0f['attributes']||{})},this);}['_handleToolNotificationData'](_0x5981d1){this['fire']('toolDataReceived',{'type':'notification','toolName':_0x5981d1['toolName'],'data':structuredClone(_0x5981d1['data'])},this);}['_finalizeInteraction'](){this['isStopped']=!0x0,this['currentRequest']&&this['currentRequest']['abortController']['abort'](),this['currentReply']&&this['currentReply']['done'](),this['currentRequest']=this['currentReply']=void 0x0;}}var Be=function(_0x4557f2){return _0x4557f2['TOOL']='mcp-tool-context',_0x4557f2['FILE']='file',_0x4557f2['DOCUMENT']='document',_0x4557f2['URL']='web-resource',_0x4557f2['TEXT']='text',_0x4557f2['SELECTION']='selection',_0x4557f2;}({}),Oe=function(_0x45787e){return _0x45787e['TEXT']='text',_0x45787e['MARKDOWN']='markdown',_0x45787e['HTML']='html',_0x45787e;}({});const $e=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']]),Qe=['contextItemAdded','contextItemRemoved','contextItemLoadingEnded','contextSent','error','addContextOptionsChanged','sourceResourcesLoaded','resourceStateChanged','uploadProgressChanged'];class Ke extends ts(){['_connector'];['_config'];['_ownerId'];constructor({connector:_0x833e76,config:_0x525362,ownerId:_0x3b1f7f}){super(),this['_connector']=_0x833e76,this['_config']=_0x525362,this['_ownerId']=_0x3b1f7f;}['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'](_0x111d96){const _0x26b0bc=await this['_createContextItemFromContent'](_0x111d96);return this['_addToConversationContextItem'](_0x26b0bc),'current-document'===_0x26b0bc['uiId']&&this['_toggleAddCurrentDocumentOptionVisibility'](),_0x26b0bc;}async['_createContextItemFromContent'](_0x8c9e3c){if(_0x8c9e3c['type']===Be['DOCUMENT']){const _0x20d4d7=await this['_connector']['fetchDocument'](this['_ownerId'],_0x8c9e3c['id'])['getDocument']();return{'id':'current-document','uiId':'current-document','label':'Current\x20document','type':_0x8c9e3c['type'],'content':_0x20d4d7['content'],'hidden':this['_conversationContextItems']['has']('current-document'),'version':_0x20d4d7['attributes']?.['version'],'sessionId':_0x20d4d7['attributes']?.['sessionId']};}if(_0x8c9e3c['type']===Be['TOOL'])return{'id':_0x8c9e3c['id'],'uiId':_0x8c9e3c['id'],'label':_0x8c9e3c['data']?.['label']||_0x8c9e3c['id'],'type':Be['TOOL'],'mcpServerName':_0x8c9e3c['mcpServerName'],'toolName':_0x8c9e3c['toolName'],'data':_0x8c9e3c['data']||{}};return{'id':_0x8c9e3c['id'],'uiId':_0x8c9e3c['id'],'label':_0x8c9e3c['attributes']?.['label']||_0x8c9e3c['name']||_0x8c9e3c['url']||_0x8c9e3c['id'],'type':_0x8c9e3c['type'],..._0x8c9e3c?.['attributes']?.['resourceId']?{'resourceId':_0x8c9e3c['attributes']?.['resourceId']}:{}};}['getSentContextItems'](){return new Map(this['_conversationContextItems']);}['removeFromContext'](_0x3ca506){const _0x1838a4=this['_pendingContextItems']['get'](_0x3ca506);_0x1838a4?.['isReadOnly']||this['_removeContextItem'](_0x3ca506);}['clearPendingContextItems'](){if(0x0===this['_pendingContextItems']['size'])return;for(const _0xa885a1 of this['_pendingContextItems']['values']())this['_removeContextItem'](_0xa885a1['uiId']);const _0x5f4c05=this['_conversationContextItems']['get']('current-document')||this['_pendingContextItems']['get']('current-document');_0x5f4c05&&this['_addContextItem']({..._0x5f4c05,'isReadOnly':!0x0,'hidden':!0x0});}['addToConversationContext'](_0x2dd148){for(const _0x1be212 of _0x2dd148['values']())this['_addToConversationContextItem'](_0x1be212);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'](_0x575cee){return Array['from'](_0x575cee['values']())['map'](_0x465b1d=>this['_mapContextItemToRequestData'](_0x465b1d))['filter'](_0x5deb8d=>null!==_0x5deb8d);}async['addFilesToContext'](_0x40d3db,_0x11190b,_0x36dae6=Be['FILE']){const _0x349310='files-'+_0x3dbf6d();this['_startUploadOperation'](_0x349310);try{await Promise['all'](_0x40d3db['map'](async _0x41d04c=>{const _0x5c1239='file-'+_0x3dbf6d(),_0x47bcca=_0x497439(_0x41d04c['name']);try{this['_addContextItem']({'type':_0x36dae6,'label':_0x11190b?.['label']||_0x47bcca,'uiId':_0x5c1239,'resourceId':_0x11190b?.['resourceId']},!0x0);const _0x455117=this['_connector']['uploadFile'](this['_ownerId'],_0x41d04c,_0x11190b);this['_ongoingUploads']['set'](_0x5c1239,_0x455117['abortController']);const {id:_0xa51011}=await _0x455117['getId']();this['_ongoingUploads']['delete'](_0x5c1239),this['_finishContextItemLoading']({'type':_0x36dae6,'id':_0xa51011,'label':_0x11190b?.['label']||_0x47bcca,'uiId':_0x5c1239,'resourceId':_0x11190b?.['resourceId']},!0x1);}catch(_0x31a9a1){this['_ongoingUploads']['delete'](_0x5c1239);if(!(_0x31a9a1 instanceof _0x509ee0&&_0x31a9a1['message']['startsWith']('ai-request-aborted'))){const _0x389bae=$e['get'](_0x31a9a1['code'])||'ai-chat-file-upload-failed',_0x2bd003=new _0x509ee0(_0x389bae,null,{'fileName':_0x47bcca,..._0x31a9a1});_0x2bd003['stack']=_0x31a9a1['stack'],this['fire']('error',{'error':_0x2bd003});}this['_removeContextItem'](_0x5c1239);}}));}finally{this['_finishUploadOperation'](_0x349310);}}['addCurrentDocumentToContext'](_0x41a8f7){if(this['isCurrentDocumentInContext']()||!this['_addContextOptionsState']['document']['enabled'])return;const _0x231516={'type':Be['DOCUMENT'],'uiId':'current-document','label':_0x41a8f7,'isReadOnly':this['_conversationContextItems']['has']('current-document'),'hidden':this['_conversationContextItems']['has']('current-document')};this['_addContextItem'](_0x231516);}async['updateCurrentDocument'](_0x4efe54,_0x51970a,_0x1b81f2,_0x382c21){const _0xc16d15=this['_pendingContextItems']['get']('current-document');if(_0xc16d15&&_0x4efe54){_0xc16d15['selection']=_0x382c21?_0x382c21['map'](_0x38d2c6=>({'start':_0x38d2c6['start'],'end':_0x38d2c6['end']})):[];try{if(_0xc16d15['version']===_0x51970a)return;const {id:_0x31c42f}=await this['_connector']['uploadDocument'](this['_ownerId'],_0x4efe54,{'version':_0x51970a,'sessionId':_0x1b81f2})['getId']();_0xc16d15['id']=_0x31c42f,_0xc16d15['content']=_0x4efe54,_0xc16d15['version']=_0x51970a,_0xc16d15['sessionId']=_0x1b81f2;}catch(_0x2de59b){const _0x353298=new _0x509ee0('ai-chat-document-upload-failed',null);_0x353298['stack']=_0x2de59b['stack'],this['fire']('error',{'error':_0x353298});}}}['addSelectionToContext'](_0x357f25){this['_addContextItem']({'type':Be['SELECTION'],'label':_0x357f25,'uiId':'selection','content':_0x357f25});}['removeSelectionFromContext'](){this['_removeContextItem']('selection');}async['addUrlToContext'](_0x7bfac3,_0x459ed0){const _0x1836e8='url-'+_0x3dbf6d();this['_startUploadOperation'](_0x1836e8);const _0x37b104='url-'+_0x3dbf6d();try{this['_addContextItem']({'type':Be['URL'],'label':_0x459ed0?.['label']||_0x7bfac3,'uiId':_0x37b104,'resourceId':_0x459ed0?.['resourceId']},!0x0);const _0x5d51f7=this['_connector']['uploadUrl'](this['_ownerId'],_0x7bfac3,_0x459ed0);this['_ongoingUploads']['set'](_0x37b104,_0x5d51f7['abortController']);const {id:_0x40677a}=await _0x5d51f7['getId']();this['_ongoingUploads']['delete'](_0x37b104),this['_finishContextItemLoading']({'type':Be['URL'],'id':_0x40677a,'label':_0x459ed0?.['label']||_0x7bfac3,'uiId':_0x37b104,'resourceId':_0x459ed0?.['resourceId']},!0x1);}catch(_0x3da1c1){this['_ongoingUploads']['delete'](_0x37b104),(_0x3da1c1['message']['startsWith']('ai-request-aborted')||this['fire']('error',{'error':new _0x509ee0('ai-chat-url-upload-failed',this,{'url':_0x7bfac3,'originalError':_0x3da1c1}),'url':_0x7bfac3}),this['_removeContextItem'](_0x37b104));}finally{this['_finishUploadOperation'](_0x1836e8);}}['addToolItemToContext'](_0x133898){_0x133898['id']=_0x133898['id']??_0x3dbf6d()['substring'](0x0,0x15),this['_pendingContextItems']['set'](_0x133898['uiId'],_0x133898),this['fire']('contextItemAdded',{'contextItem':_0x133898,'isLoading':!0x1});}async['loadSourceResources'](_0x5e51cd,_0x2ceb6b,_0x58ab46){const _0x26f40d=this['_addContextOptionsState']['sources']['find'](_0x2e5beb=>_0x2e5beb['id']===_0x5e51cd);if(!_0x26f40d)return this['fire']('error',{'error':new _0x509ee0('ai-chat-source-not-found',this,{'sourceId':_0x5e51cd}),'sourceId':_0x5e51cd}),[];try{const _0x741e9a=(await _0x26f40d['getResources'](_0x2ceb6b))['map'](_0x1d9ac8=>{const _0x4bccf6=this['_isResourceInContext'](_0x1d9ac8['id']);return{..._0x1d9ac8,'isInContext':_0x4bccf6};});return _0x26f40d['resources']=_0x741e9a,this['fire']('sourceResourcesLoaded',{'sourceId':_0x5e51cd,'source':_0x26f40d,'resources':_0x741e9a,'uid':_0x58ab46}),_0x741e9a;}catch(_0x2edb4c){return this['fire']('error',{'error':new _0x509ee0('ai-chat-source-resources-load-failed',this,{'sourceId':_0x5e51cd,'originalError':_0x2edb4c}),'sourceId':_0x5e51cd,'sourceLabel':_0x26f40d['label']}),[];}}async['addResourceToContext'](_0x141305,_0x342cfd){if(this['_isResourceInContext'](_0x342cfd['id']))return;let _0x364b37=_0x342cfd['data'];if(!_0x364b37&&_0x141305['getData'])try{_0x364b37=await _0x141305['getData'](_0x342cfd['id']);}catch(_0x46a4f6){return void this['fire']('error',{'error':new _0x509ee0('ai-chat-resource-load-failed',this,{'resourceId':_0x342cfd['id'],'sourceId':_0x141305['id'],'originalError':_0x46a4f6}),'resourceId':_0x342cfd['id'],'sourceId':_0x141305['id']});}if(_0x364b37)switch(_0x342cfd['type']){case Be['URL']:if('string'!=typeof _0x364b37)return void this['fire']('error',{'error':new _0x509ee0('ai-chat-context-invalid-data',this,{'resourceId':_0x342cfd['id'],'sourceId':_0x141305['id'],'expectedType':'string','actualType':typeof _0x364b37}),'resourceId':_0x342cfd['id'],'sourceId':_0x141305['id']});await this['addUrlToContext'](_0x364b37,{'label':_0x342cfd['label'],'resourceId':_0x342cfd['id']});break;case Be['FILE']:if(!(_0x364b37 instanceof File))return void this['fire']('error',{'error':new _0x509ee0('ai-chat-context-invalid-data',this,{'resourceId':_0x342cfd['id'],'sourceId':_0x141305['id'],'expectedType':'File','actualType':typeof _0x364b37}),'resourceId':_0x342cfd['id'],'sourceId':_0x141305['id']});await this['addFilesToContext']([_0x364b37],{'label':_0x342cfd['label'],'resourceId':_0x342cfd['id']});break;case Be['TEXT']:if('object'!=typeof _0x364b37||!('content'in _0x364b37)||!('type'in _0x364b37))return void this['fire']('error',{'error':new _0x509ee0('ai-chat-context-invalid-data',this,{'resourceId':_0x342cfd['id'],'sourceId':_0x141305['id'],'expectedType':'object\x20with\x20content\x20and\x20type\x20properties','actualType':typeof _0x364b37}),'resourceId':_0x342cfd['id'],'sourceId':_0x141305['id']});_0x364b37=Ke['_convertTextResourceToFile'](_0x364b37,_0x342cfd['label']),await this['addFilesToContext']([_0x364b37],{'label':_0x342cfd['label'],'resourceId':_0x342cfd['id']},Be['TEXT']);break;case Be['TOOL']:break;default:this['fire']('error',{'error':new _0x509ee0('ai-chat-context-unsupported-type',this,{'resourceId':_0x342cfd['id'],'sourceId':_0x141305['id'],'resourceType':_0x342cfd['type']}),'resourceId':_0x342cfd['id'],'sourceId':_0x141305['id']});}else this['fire']('error',{'error':new _0x509ee0('ai-chat-resource-no-data',this,{'resourceId':_0x342cfd['id'],'sourceId':_0x141305['id']}),'resourceId':_0x342cfd['id'],'sourceId':_0x141305['id']});}static['_convertTextResourceToFile'](_0x342fd9,_0x1ba69a){switch(_0x342fd9['type']){case Oe['MARKDOWN']:return new File([_0x342fd9['content']],_0x1ba69a,{'type':'text/markdown'});case Oe['HTML']:return new File([_0x342fd9['content']],_0x1ba69a,{'type':'text/html'});default:return new File([_0x342fd9['content']],_0x1ba69a,{'type':'text/plain'});}}static['_mapContextItemToRequestData'](_0x2140c8){switch(_0x2140c8['type']){case Be['FILE']:return{'type':Be['FILE'],'id':_0x2140c8['id']};case Be['URL']:return{'type':Be['URL'],'id':_0x2140c8['id']};case Be['DOCUMENT']:return{'type':Be['DOCUMENT'],'id':_0x2140c8['id'],..._0x2140c8['selection']?.['length']&&{'selection':_0x2140c8['selection']}};case Be['TEXT']:return{'type':Be['FILE'],'id':_0x2140c8['id']};case Be['TOOL']:{const _0x51e09d=_0x2140c8;return{'type':Be['TOOL'],'mcpServerName':_0x51e09d['mcpServerName'],'toolName':_0x51e09d['toolName'],'data':_0x51e09d['data'],'id':_0x51e09d['id']};}default:return null;}}['_addContextItem'](_0x2a15ec,_0x3e19cb=!0x1){if(this['_pendingContextItems']['set'](_0x2a15ec['uiId'],_0x2a15ec),_0x2a15ec['hidden']||this['fire']('contextItemAdded',{'contextItem':_0x2a15ec,'isLoading':_0x3e19cb}),'current-document'===_0x2a15ec['uiId']&&this['_toggleAddCurrentDocumentOptionVisibility'](),_0x2a15ec['resourceId']){const _0x192f2b=this['_findSourceIdsByResourceId'](_0x2a15ec['resourceId']);_0x192f2b&&_0x192f2b['forEach'](_0x2e49dc=>{this['_updateResourceInContextState'](_0x2e49dc,_0x2a15ec['resourceId'],!0x0);});}}['_removeContextItem'](_0x24eb54){const _0x32ef88=this['_pendingContextItems']['get'](_0x24eb54),_0x200ecd=this['_ongoingUploads']['get'](_0x24eb54);if(_0x200ecd&&(_0x200ecd['abort'](),this['_ongoingUploads']['delete'](_0x24eb54)),_0x32ef88?.['resourceId']){const _0x45d73b=this['_findSourceIdsByResourceId'](_0x32ef88['resourceId']);_0x45d73b&&_0x45d73b['forEach'](_0x47671b=>{this['_updateResourceInContextState'](_0x47671b,_0x32ef88['resourceId'],!0x1);});}this['_pendingContextItems']['delete'](_0x24eb54),this['fire']('contextItemRemoved',{'uiId':_0x24eb54,'type':_0x32ef88?.['type']}),'current-document'===_0x24eb54&&this['_toggleAddCurrentDocumentOptionVisibility']();}['_finishContextItemLoading'](_0x2db9a5,_0x16eaa0){if(this['_pendingContextItems']['has'](_0x2db9a5['uiId'])&&(this['_pendingContextItems']['set'](_0x2db9a5['uiId'],_0x2db9a5),this['fire']('contextItemLoadingEnded',{'contextItem':_0x2db9a5,'isLoading':_0x16eaa0}),_0x2db9a5['resourceId'])){const _0x468256=this['_findSourceIdsByResourceId'](_0x2db9a5['resourceId']);_0x468256&&_0x468256['forEach'](_0x4617ee=>{this['_updateResourceInContextState'](_0x4617ee,_0x2db9a5['resourceId'],!0x0);});}}['_addToConversationContextItem'](_0x1c74b0){this['_conversationContextItems']['set'](_0x1c74b0['uiId'],_0x1c74b0);}['_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'](_0x4a3e77=>({..._0x4a3e77,'enabled':!0x0}))??[]},this['fire']('addContextOptionsChanged',{'options':this['_addContextOptionsState']});}['_getCustomSourcesInitialState'](){return this['_config']?.['sources']?.['map'](_0x2eea4c=>({..._0x2eea4c,'resources':[]}))??[];}['_toggleAddCurrentDocumentOptionVisibility'](){const _0x372fac=this['isCurrentDocumentInContext']()||this['isCurrentDocumentInConversation']();this['_addContextOptionsState']['document']['isHidden']=_0x372fac,this['fire']('addContextOptionsChanged',{'options':this['_addContextOptionsState']});}['_isResourceInContext'](_0x37a3bf){for(const _0x358127 of this['_pendingContextItems']['values']())if(_0x358127['resourceId']===_0x37a3bf)return!0x0;for(const _0x4c5ece of this['_conversationContextItems']['values']())if(_0x4c5ece['resourceId']===_0x37a3bf)return!0x0;return!0x1;}['_findSourceIdsByResourceId'](_0x3ffd11){const _0x4f1901=[];for(const _0x223996 of this['_addContextOptionsState']['sources']){_0x223996['resources']['find'](_0xcca9e0=>_0xcca9e0['id']===_0x3ffd11)&&_0x4f1901['push'](_0x223996['id']);}return 0x0===_0x4f1901['length']?null:_0x4f1901;}['_updateResourceInContextState'](_0x30f58e,_0x2d7c4f,_0x53d1ac){const _0x7c491c=this['_addContextOptionsState']['sources']['find'](_0x612b5e=>_0x612b5e['id']===_0x30f58e);if(!_0x7c491c)return;const _0x529d90=_0x7c491c['resources']['find'](_0x3ed6f2=>_0x3ed6f2['id']===_0x2d7c4f);_0x529d90&&(_0x529d90['isInContext']=_0x53d1ac,this['fire']('resourceStateChanged',{'sourceId':_0x30f58e,'resourceId':_0x2d7c4f,'isInContext':_0x53d1ac}));}['_startUploadOperation'](_0x25e4f0){this['_ongoingUploadOperations']['set'](_0x25e4f0,!0x0),this['_ongoingUploadOperations']['size']&&this['fire']('uploadProgressChanged',{'isUploadInProgress':!0x0});}['_finishUploadOperation'](_0x4e0adf){this['_ongoingUploadOperations']['delete'](_0x4e0adf),0x0===this['_ongoingUploadOperations']['size']&&this['fire']('uploadProgressChanged',{'isUploadInProgress':!0x1});}}const Ye=['capabilitiesUpdated'];class Xe extends _0x17d663(){['_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'](_0x585ad3){const _0x2f924d={};return _0x585ad3&&_0x585ad3['isWebSearchEnabled']&&(_0x2f924d['webSearch']={}),_0x585ad3&&_0x585ad3['isReasoningEnabled']&&(_0x2f924d['reasoning']={}),_0x2f924d;}['toggleWebSearch'](){this['setWebSearch'](!this['_isWebSearchEnabled']);}['toggleReasoning'](){this['setReasoning'](!this['_isReasoningEnabled']);}['setWebSearch'](_0x5d73a9){_0x5d73a9!==this['_isWebSearchEnabled']&&(this['_isWebSearchEnabled']=_0x5d73a9,this['fire']('capabilitiesUpdated',this['getCapabilitiesConfig']()));}['setReasoning'](_0x5e95a9){_0x5e95a9!==this['_isReasoningEnabled']&&(this['_isReasoningEnabled']=_0x5e95a9,this['fire']('capabilitiesUpdated',this['getCapabilitiesConfig']()));}}class Ze extends Fe{['userMessage'];['conversationId'];['contextItems']=new Map();['model'];['attributes'];constructor(_0x85d7ef){super(_0x85d7ef),this['conversationId']=_0x85d7ef['conversationId'],this['contextItems']=_0x85d7ef['contextItems'],this['capabilities']=_0x85d7ef['capabilities'],this['userMessage']=_0x85d7ef['userMessage'],this['model']=_0x85d7ef['model'],this['attributes']=_0x85d7ef['attributes'];}async['sendRequest'](){return this['connector']['queryAssistant']({'message':this['userMessage'],'conversationId':this['conversationId'],'parts':Ke['mapContextItemsToRequestData'](this['contextItems']),'capabilities':Xe['getCapabilitiesRequestData'](this['capabilities']),'model':this['model'],'attributes':this['attributes']});}['getDocumentContext'](){return this['contextItems']['get']('current-document');}}class _t extends _0x17d663(){['id'];['isStarted']=!0x1;['isFromHistory'];['interactions']=[];['currentInteraction'];['selectedModel'];['connector'];['options'];constructor(_0xb1a83e){super(),this['options']=_0xb1a83e,this['connector']=_0xb1a83e['connector'],this['chatModels']=_0xb1a83e['chatModels'],this['id']=_0xb1a83e['conversationId'],this['isFromHistory']=_0xb1a83e['isFromHistory'];}async['init'](_0x407ec9){try{this['chatContext']=new Ke({'connector':this['connector'],'config':_0x407ec9,'ownerId':this['id']}),this['chatContext']['delegate'](...Qe)['to'](this),this['chatContext']['init'](),this['chatCapabilities']=new Xe(),this['chatCapabilities']['delegate'](...Ye)['to'](this),this['chatCapabilities']['init']();const _0x5d2d9d=await this['chatModels']['getAvailableModels']();this['fire']('conversationInitialized',{'availableModels':_0x5d2d9d});const _0x5b847b=await this['chatModels']['getModel'](this['options']['selectedModelId']);_0x5b847b&&await this['setModel'](_0x5b847b);}catch(_0x1b0698){const _0x33de2c=new _0x509ee0('ai-chat-conversation-init-failed',null,{'message':_0x1b0698['message']||_0x1b0698});_0x33de2c['stack']=_0x1b0698['stack'],this['fire']('error',{'error':_0x33de2c});}}async['start'](){if(this['isStarted'])throw new _0x509ee0('ai-chat-conversation-already-started',null,{'conversation':this});if(!this['selectedModel'])throw new _0x509ee0('ai-chat-conversation-start-no-model-selected',null,{'conversation':this});try{const {id:_0x44f46c}=await this['connector']['startConversation'](this['id'],this['options']['group'])['getConversation']();this['id']=_0x44f46c,this['isStarted']=!0x0,this['fire']('conversationStarted',{'conversationId':this['id'],'selectedModel':this['selectedModel']});}catch(_0x644f4e){const _0x466269=new _0x509ee0('ai-chat-conversation-start-failed',null,{'message':_0x644f4e['message'],'conversationId':this['id']});throw _0x466269['stack']=_0x644f4e['stack'],this['fire']('error',{'error':_0x466269}),_0x466269;}}async['load'](_0xe84b5c,_0x35e16b){try{const _0x12bedb=await this['connector']['fetchConversation'](_0xe84b5c)['getConversation'](),_0x413cf4=await this['connector']['fetchConversationMessages'](_0xe84b5c)['getMessages'](),_0x11ed70=_0x413cf4[0x0]['model'];this['isStarted']=!0x0,this['id']=_0x12bedb['id'],'title'in _0x12bedb?this['fire']('setConversationTitle',_0x12bedb['title'],!0x0):this['fire']('setConversationTitle','',!0x0);const _0x2eb845=(await this['chatModels']['getAll']())['find'](_0x27f928=>_0x27f928['id']['toLowerCase']()===_0x11ed70['toLowerCase']());return this['selectedModel']=_0x2eb845,this['fire']('modelSelected',{'selectedModel':_0x2eb845,'isDisabled':!0x0}),await this['_processMessagesToInteractions'](_0x413cf4,_0x35e16b,_0x11ed70),this['currentInteraction']=void 0x0,this;}catch(_0x567e9a){const _0x495dc4=new _0x509ee0('ai-chat-conversation-init-from-id-failed',null,{'message':_0x567e9a['message'],'conversationId':_0xe84b5c});throw _0x495dc4['stack']=_0x567e9a['stack'],this['fire']('error',{'error':_0x495dc4}),_0x495dc4;}}async['_processMessagesToInteractions'](_0x4eb24b,_0x5257d2,_0x4a1e6c){let _0x85af0a;for(const _0x35e853 of _0x4eb24b)if('user'===_0x35e853['role']){const _0x5b4c61=await this['_extractContextItems'](_0x35e853),_0x2af183={'isReasoningEnabled':Object['hasOwn'](_0x35e853['capabilities'],'reasoning'),'isWebSearchEnabled':Object['hasOwn'](_0x35e853['capabilities'],'webSearch')};_0x85af0a=this['createInteraction']({'userMessage':_0x35e853['prompt'],'contextItems':_0x5b4c61,'capabilities':_0x2af183,'modelId':_0x4a1e6c,'attributes':_0x35e853['attributes']}),this['currentInteraction']=_0x85af0a,this['chatContext']['addToConversationContext'](this['currentInteraction']['contextItems']);}else{if('assistant'===_0x35e853['role']&&_0x85af0a){const _0x33cdf0=[];for(const _0x701497 of _0x35e853['content'])switch(_0x701497['type']){case'text':case'modification':{const _0x1ed407=_0x85af0a['getDocumentContext']()?.['sessionId']!==_0x5257d2;_0x85af0a['currentReply']=_0x85af0a['createReply']({'type':_0x701497['type'],'isDone':!0x0,'interactionId':_0x85af0a['id'],'areActionsDisabled':_0x1ed407}),_0x85af0a['currentReply']['appendContent'](_0x701497['content']),_0x33cdf0['length']>0x0&&(_0x85af0a['currentReply']['sources']=_0x33cdf0['splice'](0x0));break;}case'url':_0x33cdf0['push'](_0x701497);break;case'mcp-tool-result':{const {data:_0x467e08,attributes:_0x378a6a}=JSON['parse'](_0x701497['content']);_0x85af0a['_handleToolResultData']({'toolName':_0x701497['toolName'],'data':_0x467e08,'attributes':_0x378a6a});break;}}}}}async['_extractContextItems'](_0x3cba85){const _0x1037f0=new Map();if(!_0x3cba85['content'])return _0x1037f0;for(const _0x2da930 of _0x3cba85['content']){const _0x5b3803=await this['chatContext']['populateFromMessage'](_0x2da930);_0x5b3803&&_0x1037f0['set'](_0x5b3803['id'],_0x5b3803);}return _0x1037f0;}async['handleUserInteraction']({userMessage:_0x5bce46,attributes:_0x1f3534}){if(!this['isStarted'])throw new _0x509ee0('ai-chat-handle-user-conversation-not-initialized',null,{'conversation':this});if(this['currentInteraction'])throw new _0x509ee0('ai-chat-handle-user-interaction-already-in-progress',null,{'conversation':this});try{const _0x3e7ffc=this['chatContext']['getPendingContextItems'](),_0x56396d=this['chatCapabilities']['getCapabilitiesConfig'](),_0x504bf1=this['selectedModel']['id'];this['currentInteraction']=this['createInteraction']({'userMessage':_0x5bce46,'contextItems':_0x3e7ffc,'capabilities':_0x56396d,'modelId':_0x504bf1,'attributes':_0x1f3534}),await this['currentInteraction']['start'](),this['chatContext']['addToConversationContext'](this['currentInteraction']['contextItems']);}catch(_0x240b4a){if(_0x240b4a instanceof _0x509ee0)this['fire']('error',{'interactionId':this['currentInteraction']?this['currentInteraction']['id']:void 0x0,'error':_0x240b4a});else{const _0x3594d2=$e['get'](_0x240b4a['code'])||'ai-chat-handle-user-interaction-start-failed';this['fire']('error',{'interactionId':this['currentInteraction']?this['currentInteraction']['id']:void 0x0,'error':new _0x509ee0(_0x3594d2,null,{'error':_0x240b4a})});}}finally{this['currentInteraction']?.['stop'](),this['currentInteraction']=void 0x0;}}['createInteraction']({userMessage:_0x5f2c3d,contextItems:_0x341ba3,capabilities:_0x133803,modelId:_0x28858b,attributes:_0x4d66e0}){const _0x43b88a=new Ze({'userMessage':_0x5f2c3d,'contextItems':_0x341ba3,'capabilities':_0x133803,'conversationId':this['id'],'connector':this['connector'],'editor':this['options']['getEditor']&&this['options']['getEditor'](),'model':_0x28858b,'attributes':_0x4d66e0});return _0x43b88a['delegate'](...ze)['to'](this),this['interactions']['push'](_0x43b88a),this['fire']('interactionCreated',_0x43b88a),_0x43b88a;}['getInteraction'](_0x58979e){return this['interactions']['find'](_0x4c3c15=>_0x4c3c15['id']===_0x58979e);}['removeInteraction'](_0x350a7d){const _0x26d61b=this['getInteraction'](_0x350a7d);_0x26d61b&&(_0x26d61b['destroy'](),this['interactions']['splice'](this['interactions']['indexOf'](_0x26d61b),0x1));}get['lastInteraction'](){return this['interactions'][this['interactions']['length']-0x1];}['addCurrentDocumentToContext'](_0xd5b9ad){this['chatContext']['addCurrentDocumentToContext'](_0xd5b9ad);}async['updateCurrentDocumentInContext']({content:_0x4ff1d3,version:_0x35bf61,sessionId:_0x4ac5f2,selections:_0x229a61}){await this['chatContext']['updateCurrentDocument'](_0x4ff1d3,_0x35bf61,_0x4ac5f2,_0x229a61);}['getCurrentDocumentContext'](){return this['currentInteraction']?.['getDocumentContext']()?.['content']||'';}['addSelectionToContext'](_0x16a399){this['chatContext']['addSelectionToContext'](_0x16a399);}['removeSelectionFromContext'](){this['chatContext']['removeSelectionFromContext']();}['addFilesToContext'](_0x1d3ccf){this['chatContext']['addFilesToContext'](_0x1d3ccf);}['addUrlToContext'](_0x5d670e){this['chatContext']['addUrlToContext'](_0x5d670e);}['addToolItemToContext'](_0x187a45){this['chatContext']['addToolItemToContext'](_0x187a45);}['addResourceToContext'](_0xdfbe2c,_0x1a0841){this['chatContext']['addResourceToContext'](_0xdfbe2c,_0x1a0841);}['loadSourceResources'](_0x2f2a90,_0x280a56,_0x5a9b85){return this['chatContext']['loadSourceResources'](_0x2f2a90,_0x280a56,_0x5a9b85);}['removeFromContext'](_0x4244b5){this['chatContext']['removeFromContext'](_0x4244b5);}['setWebSearch'](_0x56d420){this['chatCapabilities']['setWebSearch'](_0x56d420);}['toggleWebSearch'](){this['chatCapabilities']['toggleWebSearch']();}['setReasoning'](_0x38037a){this['chatCapabilities']['setReasoning'](_0x38037a);}['toggleReasoning'](){this['chatCapabilities']['toggleReasoning']();}['isCurrentDocumentInContext'](){return this['chatContext']['isCurrentDocumentInContext']();}['isCurrentDocumentInConversation'](){return this['chatContext']['isCurrentDocumentInConversation']();}['isSelectionInContext'](){return this['chatContext']['isSelectionInContext']();}async['setModel'](_0x5cf454){_0x5cf454?!0x1===await this['chatModels']['isAvailable'](_0x5cf454)&&(_0x1c4b5f('ai-chat-conversation-set-model-not-available',{'conversation':this,'model':_0x5cf454}),_0x5cf454=(await this['chatModels']['getAvailableModels']())[0x0]):(_0x1c4b5f('ai-chat-conversation-set-model-null',{'conversation':this}),_0x5cf454=(await this['chatModels']['getAvailableModels']())[0x0]),_0x5cf454['id']!==this['selectedModel']?.['id']&&(this['selectedModel']=_0x5cf454,this['chatCapabilities']['reset'](),this['fire']('modelSelected',{'selectedModel':_0x5cf454}));}}class It extends _0x17d663(){['_connector'];['_config'];['_locale'];['_modelList']=[];['_modelsRequest']=null;constructor({connector:_0x1758d4,config:_0x284f5f,locale:_0x2b492e}){super(),this['_connector']=_0x1758d4,this['_config']=_0x284f5f,this['_locale']=_0x2b492e;}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 _0x47a70e=await this['getAll']();let _0x4882fb;return _0x4882fb=this['_availableModels']?this['_filterModels'](_0x47a70e,this['_availableModels']):_0x47a70e['filter'](_0x26b5e8=>_0x26b5e8['recommended']),_0x4882fb;}async['getModel'](_0x7e890f){const _0x4edb1e=await this['getAll']();if(!_0x4edb1e['length'])return null;if(_0x7e890f){const _0x24497c=this['_getModelById'](_0x4edb1e,_0x7e890f);if(_0x24497c)return _0x24497c;_0x1c4b5f('ai-chat-model-id-unrecognized',{'modelId':_0x7e890f,'fallBackModelId':this['_defaultModelId']});}return this['getDefault']();}async['getDefault'](){const _0x555c50=await this['getAvailableModels']();if(!_0x555c50['length'])return null;if(this['_defaultModelId']){const _0x353e98=this['_getModelById'](_0x555c50,this['_defaultModelId']);if(_0x353e98)return _0x353e98;_0x1c4b5f('ai-chat-default-model-id-unrecognized',{'defaultModelId':this['_defaultModelId'],'fallBackModelId':_0x555c50[0x0]['id']});}return _0x555c50[0x0];}async['isAvailable'](_0x1b634b){return(await this['getAvailableModels']())['some'](_0x1ef2f6=>_0x1ef2f6['name']===_0x1b634b['name']&&_0x1ef2f6['provider']===_0x1b634b['provider']);}async['_retrieveModels'](){if(!this['_modelList']['length'])try{const _0x351d60=this['_locale']['uiLanguage']||'en',_0x299749=this['_connector']['getModels'](_0x351d60),_0x6e9fd7=await _0x299749['list']();this['_modelList']=_0x6e9fd7['items']['map'](_0x48a119=>Bi(_0x48a119)?{..._0x48a119,'name':i(this['_locale'],'AI_MODEL_NAME_AUTO')}:_0x48a119);}catch(_0x4a543c){throw gt('ai-models-unable-to-retrieve',{'error':_0x4a543c}),_0x4a543c;}return[...this['_modelList']];}['_filterModels'](_0x149233,_0x2b0eed){let _0x454e48;if(_0x2b0eed){_0x454e48=[];const _0x992577=new Set(),_0x156009='string'==typeof _0x2b0eed?[_0x2b0eed['toLocaleLowerCase']()]:_0x2b0eed['map'](_0x5280ff=>_0x5280ff['toLocaleLowerCase']());for(const _0x3a0c27 of _0x156009)for(const _0x5bfaf4 of _0x149233)!_0x992577['has'](_0x5bfaf4['id'])&&this['_isMatchingFilter'](_0x5bfaf4,_0x3a0c27)&&(_0x454e48['push'](_0x5bfaf4),_0x992577['add'](_0x5bfaf4['id']));}else _0x454e48=_0x149233;return _0x454e48;}['_isMatchingFilter'](_0x1d696b,_0x14d248){const _0xe35a9d=_0x1d696b['id']['toLocaleLowerCase'](),_0x45c631=_0x1d696b['name']['toLocaleLowerCase'](),_0x1bccd2=_0x1d696b['provider']['toLocaleLowerCase']();return _0xe35a9d===_0x14d248||_0x45c631===_0x14d248||Bi(_0x1d696b)&&'auto'===_0x14d248||_0x1bccd2===_0x14d248||_0xe35a9d['startsWith'](_0x14d248);}['_getModelById'](_0x34c4fd,_0x2fd595){return _0x34c4fd['find'](_0x200f84=>Bi(_0x200f84)&&'auto'===_0x2fd595?_0x200f84:_0x200f84['id']===_0x2fd595)||null;}}function Bi(_0x528e3c){return _0x528e3c['id']['startsWith']('agent');}function T(_0x4e66ac){if(_0x4e66ac instanceof dt)return _0x4e66ac;if(_0x4e66ac?.['editors']&&_0x4e66ac['editors']['get'](0x0))return _0x4e66ac['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.'),_0x4e66ac['editors']['get'](0x0);throw new _0x509ee0('ai-get-editor-from-context-no-editor');}function Z({editor:_0x5ce5b4,interaction:_0x19b7dd,reply:_0x36458c,groups:_0x3a5706,transform:_0x482233,documentCompare:_0x2d800f,documentCompareOptions:_0x21a92c}){const _0x26e8d9=_0x19b7dd['getDocumentContext']();if(!_0x26e8d9)return[];const _0xc474db=_0x26e8d9['content'],_0x5d0458=_0x26e8d9['version'],_0x16070c=_0x36458c['documentContextContent']['cloneNode'](!0x0);for(const {changes:_0x15d225}of _0x3a5706){const _0x360383=_0x15d225['filter'](_0x20f25c=>'new'!=_0x20f25c['type'])['map'](_0x5033e1=>St('data-id',_0x5033e1['id'],_0x16070c)),_0x5ed31e=_0x15d225['filter'](_0x26e39d=>'removed'!=_0x26e39d['type'])['map'](_0x206833=>_0x206833['node']['cloneNode'](!0x0));let _0xcc4308=null;if(_0x360383['length']){_0xcc4308=_0x360383[0x0]['previousSibling'];for(let _0x55e3f9=0x0;_0x55e3f9<_0x360383['length'];_0x55e3f9++)_0x3d1b0b(_0x360383[_0x55e3f9]);}if(_0x5ed31e['length']){_0xcc4308||(_0x15d225[0x0]['anchorId']?_0xcc4308=St('data-id',_0x15d225[0x0]['anchorId'],_0x16070c):(_0xcc4308=_0x5ed31e['shift'](),_0xf59167(_0x16070c,_0xcc4308)));for(let _0x3a91ec=0x0;_0x3a91ec<_0x5ed31e['length'];_0x3a91ec++)_0x517396(_0xcc4308,_0x5ed31e[_0x3a91ec]),_0xcc4308=_0x5ed31e[_0x3a91ec];}}const _0x1d1bcf=Tt(_0x16070c),_0x24bf90=_0x2d800f['getDiff'](_0xc474db,_0x1d1bcf,_0x21a92c)['getOperations']();if(_0x482233){const _0x1892e4=_0x5ce5b4['model']['document']['history']['getOperations'](_0x5d0458),_0x4d4772={'document':_0x5ce5b4['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1};return nt(_0x24bf90,_0x1892e4,_0x4d4772)['operationsA'];}return _0x24bf90;}function Y(_0x150cea,_0x26bb24){if('marker'!=_0x26bb24['type'])return;const _0x4ef48e=_0x150cea['model']['markers']['get'](_0x26bb24['name']);_0x4ef48e&&(_0x26bb24['oldRange']=_0x4ef48e['getRange']());}class at extends _0x34a98c{['_aiEditing'];['_aiConnector'];['_aiChatUi'];['_aiChatModels'];['_aiChatBalloon'];['_batchToChanges']=new Map();['_currentPreviewedChangeGroup']=null;['_bodyCollection'];static get['requires'](){return[q,_0x31d190];}static get['pluginName'](){return'AIChatController';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){this['_bodyCollection']=new _0x2f55eb(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 _0x35541a=this['context']['plugins']['get']('AITabs');this['listenTo'](this['_aiChatUi'],'startConversation',()=>{this['_startConversationSafely']();}),this['listenTo'](this['_aiChatUi'],'sendUserMessage',(_0x2a327a,_0x5a26a8)=>{this['_handleUIUserMessage']({'userMessage':_0x5a26a8});}),this['listenTo'](_0x35541a,'resizedTabs',(_0x25c6a1,_0x52a286)=>{this['_setIsMaximized'](_0x52a286);}),this['listenTo'](this['_aiChatUi'],'resizeTabs',()=>{_0x35541a['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',(_0x27a4fb,_0x20a6f3)=>{this['activeConversation']?.['addFilesToContext'](Array['from'](_0x20a6f3));}),this['listenTo'](this['_aiChatUi'],'addUrlToContext',(_0x3a969e,_0x4d36d9)=>{this['activeConversation']?.['addUrlToContext'](_0x4d36d9);}),this['listenTo'](this['_aiChatUi'],'executeCustomItemCallback',(_0x20df9f,_0x736913)=>{_0x736913['callback'](this['context']);}),this['listenTo'](this['_aiChatUi'],'addResourceToContext',(_0x12bb64,_0x1a141c)=>{this['activeConversation']?.['addResourceToContext'](_0x1a141c['source'],_0x1a141c['resource']);}),this['listenTo'](this['_aiChatUi'],'removeContextItem',(_0x333edb,_0x355553)=>{this['_removeFromContext'](_0x355553);}),this['listenTo'](this['_aiChatUi'],'loadSourceResources',(_0x42a4b3,_0x1a6086)=>{this['activeConversation']?.['loadSourceResources'](_0x1a6086['sourceId'],_0x1a6086['query'],_0x1a6086['uid']);}),this['listenTo'](this['_aiChatUi'],'toggleWebSearch',()=>{this['_toggleWebSearch']();}),this['listenTo'](this['_aiChatUi'],'toggleReasoning',()=>{this['_toggleReasoning']();}),this['listenTo'](this['_aiChatUi'],'selectModel',(_0x536bd4,_0x23a77d)=>{this['activeConversation']?.['setModel'](_0x23a77d);}),this['listenTo'](this['_aiChatUi'],'like',(_0x5a2b45,{replyId:_0x221886})=>{console['log']('Liked\x20response',_0x221886);}),this['listenTo'](this['_aiChatUi'],'dislike',(_0x24e4d4,{replyId:_0x4b9e9d})=>{console['log']('Disliked\x20response',_0x4b9e9d);}),this['listenTo'](this['_aiChatUi'],'insertSuggestion',(_0x188b08,_0x2f6cba)=>{this['_insertSuggestion'](_0x2f6cba);}),this['listenTo'](this['_aiChatUi'],'showChangeInText',(_0x2f462d,{replyId:_0x515654,partIndex:_0x535dc3})=>{this['_aiChatBalloonShowDiff']=this['_aiChatUi']['showDiff'],this['_openBalloonFor'](_0x515654,_0x535dc3);}),this['listenTo'](this['_aiChatUi'],'mouseOverSuggestion',(_0x2b28c4,{replyId:_0x340d40,partIndex:_0x49dfe8})=>{const _0x39ee29=this['_getDocumentRangeForReplyChanges'](_0x340d40,_0x49dfe8);_0x39ee29&&'$graveyard'!=_0x39ee29['range']['root']['rootName']&&this['_aiEditing']['showFakeVisualSelection']([_0x39ee29['range']],'ai-chat-controller-mouse-over');}),this['listenTo'](this['_aiChatUi'],'mouseLeaveSuggestion',()=>{this['_aiEditing']['hideFakeVisualSelection']('ai-chat-controller-mouse-over');}),this['listenTo'](this['_aiChatUi'],'applySuggestion',(_0x3d42a5,_0xfd5088)=>{this['_aiEditing']['hideFakeVisualSelection']('ai-chat-controller-mouse-over'),this['_applySuggestion'](_0xfd5088);}),this['listenTo'](this['_aiChatUi'],'toggleSuggestionDisplayMode',async(_0x3851dc,{replyId:_0x18bfe0,showDiff:_0x44933b})=>{const {reply:_0x4a4596}=this['getInteractionAndReplyById'](_0x18bfe0),_0x1a9d71=_0x4a4596['getContentParts']({'showDiff':_0x44933b});await this['_aiChatUi']['updateFeedItemAIReplySuggestionContent']({'id':_0x4a4596['id'],'parts':_0x1a9d71,'renderingStrategy':'static'});}),this['listenTo'](this['_aiChatUi'],'rejectSuggestion',(_0x399950,{replyId:_0x21a8a3,partIndex:_0x2c84a9})=>{this['_rejectSuggestion']({'replyId':_0x21a8a3,'partIndex':_0x2c84a9}),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:_0x3ea099,partIndex:_0x33cc40}=this['_currentPreviewedChangeGroup'];this['_aiChatBalloonShowDiff']=!this['_aiChatBalloonShowDiff'];const {reply:_0x17301a}=this['getInteractionAndReplyById'](_0x3ea099),_0x1350cb=_0x17301a['getContentParts']({'showDiff':this['_aiChatBalloonShowDiff'],'groupIndex':_0x33cc40});this['_aiChatBalloon']['updateContent']({'part':_0x1350cb[0x0],'renderingStrategy':'static','keepErrors':!0x0});}),this['listenTo'](this['_aiChatBalloon'],'applySuggestion',()=>{const {replyId:_0x2002c8,partIndex:_0x4dc589}=this['_currentPreviewedChangeGroup'];this['_applySuggestion']({'replyId':_0x2002c8,'partIndex':_0x4dc589}),this['_aiChatBalloon']['setState']('accepted');}),this['listenTo'](this['_aiChatBalloon'],'insertSuggestion',()=>{const {replyId:_0x11ca2b,partIndex:_0x25cccc}=this['_currentPreviewedChangeGroup'];this['_insertSuggestion']({'replyId':_0x11ca2b,'partIndex':_0x25cccc}),this['_aiChatBalloon']['setState']('accepted');}),this['listenTo'](this['_aiChatBalloon'],'rejectSuggestion',()=>{const {replyId:_0x15cc14,partIndex:_0x316f60}=this['_currentPreviewedChangeGroup'];this['_rejectSuggestion']({'replyId':_0x15cc14,'partIndex':_0x316f60}),this['_aiChatBalloon']['setState']('rejected');}),this['listenTo'](this['_aiChatBalloon'],'showNext',()=>{const {replyId:_0x42701e,partIndex:_0xdcc3bb}=this['_currentPreviewedChangeGroup'],_0x517019=this['_getPresentableSiblingContentPartIndex'](_0x42701e,_0xdcc3bb,'next');null!==_0x517019&&this['_openBalloonFor'](_0x42701e,_0x517019);}),this['listenTo'](this['_aiChatBalloon'],'showPrevious',()=>{const {replyId:_0x5a1e22,partIndex:_0x26d0ae}=this['_currentPreviewedChangeGroup'],_0x47c2dc=this['_getPresentableSiblingContentPartIndex'](_0x5a1e22,_0x26d0ae,'previous');null!==_0x47c2dc&&this['_openBalloonFor'](_0x5a1e22,_0x47c2dc);}),this['listenTo'](this['_aiChatBalloon'],'dialogClosed',(_0x1cb169,{id:_0x40b2de})=>{if('aiChatBalloon'!==_0x40b2de)return;const {replyId:_0x5b45eb,partIndex:_0x450884}=this['_currentPreviewedChangeGroup'];this['_currentPreviewedChangeGroup']=null,this['_aiChatUi']['setFeedItemAIReplySuggestionPartActive']({'id':_0x5b45eb,'index':_0x450884,'isActive':!0x1});}));}async['afterInit'](){this['context']instanceof dt?this['_integrateEditor'](this['context']):this['listenTo'](this['context']['editors'],'add',(_0x2f04a1,_0x471ba8)=>{_0x471ba8['on']('ready',()=>{this['_integrateEditor'](_0x471ba8);});});const _0x20fbe8=this['context']['config']['get']('ai.chat.initialConversation');let _0x1909fa=_0x20fbe8;if('lastCreated'!=_0x20fbe8||(_0x1909fa=await this['_getLastCreatedConversationId'](),_0x1909fa))return'new'==_0x1909fa?this['_startConversationSafely']():this['loadConversation'](_0x1909fa);}async['destroy'](){return await this['_stopLastInteraction'](),this['_bodyCollection']['detachFromDom'](),super['destroy']();}['_insertSuggestion'](_0x2e4245){const _0x1d74db=T(this['context']);if(!_0x1d74db['plugins']['has']('TrackChanges'))throw new _0x509ee0('ai-no-track-changes',null);const _0x2dc2f3=this['context']['plugins']['get']('DocumentCompare'),{reply:_0x111435,interaction:_0x1ee20a}=this['getInteractionAndReplyById'](_0x2e4245['replyId']),_0x258a63=this['_getDocumentRangeForReplyChanges'](_0x2e4245['replyId'],_0x2e4245['partIndex']),_0x2af2a0=void 0x0!==_0x2e4245['partIndex']?[_0x111435['changeGroups'][_0x2e4245['partIndex']]]:_0x111435['changeGroups']['filter'](_0x409574=>'pending'==_0x409574['state']),_0x58b505=_0x2af2a0['map'](_0x2aa0e6=>_0x111435['changeGroups']['indexOf'](_0x2aa0e6));if(!_0x258a63||'$graveyard'==_0x258a63['range']['root']['rootName'])return void _0x58b505['forEach'](_0x1c64ce=>_0x111435['setChangeGroupState'](_0x1c64ce,'outdated'));_0x58b505['forEach'](_0x4c0424=>_0x111435['setChangeGroupState'](_0x4c0424,'accepted'));const _0x238c8c=Z({'editor':_0x1d74db,'reply':_0x111435,'interaction':_0x1ee20a,'groups':_0x2af2a0,'transform':!0x0,'documentCompare':_0x2dc2f3,'documentCompareOptions':{'anchor':'main','markDeletions':!0x0}});let _0x52d788;_0x258a63&&this['_scrollToSuggestionRange'](_0x258a63['range']),_0x1d74db['model']['change'](_0x58eccb=>{_0x52d788=_0x58eccb['batch'],_0x1d74db['plugins']['get']('TrackChangesEditing')['_applyOperationsAsSuggestions'](_0x238c8c),this['_aiEditing']['hideFakeVisualSelection']('ai-chat-controller-mouse-over');}),this['_batchToChanges']['set'](_0x52d788,{'interactionId':_0x1ee20a['id'],'replyId':_0x111435['id'],'indexes':_0x58b505['slice']()}),this['_updateRatings'](_0x111435);}['_applySuggestion'](_0xf37373){const _0x2bc7a8=T(this['context']),_0x1fb38d=this['context']['plugins']['get'](_0x31d190),{reply:_0x4cba7b,interaction:_0x2bb9f7}=this['getInteractionAndReplyById'](_0xf37373['replyId']),_0x2a5b79=this['_getDocumentRangeForReplyChanges'](_0xf37373['replyId'],_0xf37373['partIndex']),_0xbe2ba7=void 0x0!==_0xf37373['partIndex']?[_0x4cba7b['changeGroups'][_0xf37373['partIndex']]]:_0x4cba7b['changeGroups']['filter'](_0x6b3e4c=>'pending'==_0x6b3e4c['state']),_0x41e8bf=_0xbe2ba7['map'](_0xb4b401=>_0x4cba7b['changeGroups']['indexOf'](_0xb4b401));if(!_0x2a5b79||'$graveyard'==_0x2a5b79['range']['root']['rootName'])return void _0x41e8bf['forEach'](_0x266191=>_0x4cba7b['setChangeGroupState'](_0x266191,'outdated'));_0x41e8bf['forEach'](_0x45ea1d=>_0x4cba7b['setChangeGroupState'](_0x45ea1d,'accepted'));const _0x395cf1=Z({'editor':_0x2bc7a8,'reply':_0x4cba7b,'interaction':_0x2bb9f7,'groups':_0xbe2ba7,'transform':!0x0,'documentCompare':_0x1fb38d,'documentCompareOptions':{'anchor':'main','markDeletions':!0x1}});let _0x420b51;_0x2a5b79&&this['_scrollToSuggestionRange'](_0x2a5b79['range']),_0x2bc7a8['model']['change'](_0x3aa195=>{_0x420b51=_0x3aa195['batch'];for(const _0x3e97cf of _0x395cf1)_0x3e97cf['baseVersion']=_0x2bc7a8['model']['document']['version'],Y(_0x2bc7a8,_0x3e97cf),_0x3aa195['batch']['addOperation'](_0x3e97cf),_0x2bc7a8['model']['applyOperation'](_0x3e97cf);}),this['_batchToChanges']['set'](_0x420b51,{'interactionId':_0x2bb9f7['id'],'replyId':_0x4cba7b['id'],'indexes':_0x41e8bf['slice']()}),this['_updateRatings'](_0x4cba7b);}['_rejectSuggestion'](_0x50bbe1){const {reply:_0x48914f}=this['getInteractionAndReplyById'](_0x50bbe1['replyId']);_0x48914f['setChangeGroupState'](_0x50bbe1['partIndex'],'rejected');}['_openBalloonFor'](_0x883dc8,_0x21de12){if(!this['_aiChatBalloon'])return;const {reply:_0x2ab6be}=this['getInteractionAndReplyById'](_0x883dc8),_0x29f552=_0x2ab6be['getContentParts']({'showDiff':this['_aiChatBalloonShowDiff']});let _0x3ebaae,_0x42842c;if(void 0x0!==_0x21de12?(_0x42842c=_0x29f552['find'](_0x4df4db=>_0x4df4db['index']==_0x21de12),_0x3ebaae=_0x42842c?.['index']):(_0x42842c=_0x29f552[0x0],_0x3ebaae=_0x42842c['index']),this['_currentPreviewedChangeGroup']?.['replyId']==_0x883dc8&&this['_currentPreviewedChangeGroup']?.['partIndex']==_0x3ebaae)return;const _0x3e9fd6=this['_getUserPresentableContentPartDocumentRange'](_0x883dc8,_0x2ab6be,_0x42842c);if(!_0x3e9fd6)return void this['_aiChatBalloon']['close']();this['_currentPreviewedChangeGroup']={'replyId':_0x883dc8,'partIndex':_0x3ebaae},this['_scrollToSuggestionRange'](_0x3e9fd6,!0x0);const _0x3e3a41=this['_getPresentableSiblingContentPartIndex'](_0x883dc8,_0x3ebaae,'next');this['_aiChatBalloon']['updateContent']({'part':_0x42842c,'renderingStrategy':'static'}),this['_aiChatBalloon']['open']({'index':_0x3ebaae,'title':i(this['context']['locale'],'AI_BALLOON_HEADER_TITLE',(_0x3ebaae+0x1)['toString']()),'showRotator':null!==_0x3e3a41,'ranges':[_0x3e9fd6],'areActionsDisabled':_0x2ab6be['areActionsDisabled']}),this['_aiChatBalloon']['setState']('pending'),this['_aiChatUi']['scrollFeedToSuggestion'](_0x883dc8,_0x3ebaae),this['_aiChatUi']['setFeedItemAIReplySuggestionPartActive']({'id':_0x883dc8,'index':_0x3ebaae,'isActive':!0x0});}['_getPresentableSiblingContentPartIndex'](_0x3c8246,_0x48f58f,_0x37d9da){const {reply:_0x4a6bf0}=this['getInteractionAndReplyById'](_0x3c8246),_0x16f188=_0x4a6bf0['getContentParts']({'showDiff':this['_aiChatBalloonShowDiff']});if(0x1==_0x16f188['length'])return null;const _0x53eea6=_0x16f188['findIndex'](_0x533b59=>_0x533b59['index']==_0x48f58f),_0x3b7c44='next'==_0x37d9da?0x1:-0x1;let _0x23cd5e=_0x16f188['at']((_0x53eea6+_0x3b7c44)%_0x16f188['length'])['index'],_0x536b49=_0x16f188[_0x23cd5e];for(;!this['_getUserPresentableContentPartDocumentRange'](_0x3c8246,_0x4a6bf0,_0x536b49);){if(_0x23cd5e=_0x16f188['at']((_0x23cd5e+_0x3b7c44)%_0x16f188['length'])['index'],_0x23cd5e===_0x53eea6)return null;_0x536b49=_0x16f188[_0x23cd5e];}return _0x23cd5e;}['_getUserPresentableContentPartDocumentRange'](_0x5810ae,_0x40be98,_0x2cca52){const _0x2fd1e6=_0x40be98['changeGroups'];if(!_0x2cca52['hasChanges'])return null;const _0x17b8b1=_0x2fd1e6['find'](_0x3d9aa9=>_0x3d9aa9['index']==_0x2cca52['index']);if('pending'!==_0x17b8b1?.['state'])return null;const _0x4f2f69=this['_getDocumentRangeForReplyChanges'](_0x5810ae,_0x2cca52['index']);if(!_0x4f2f69)return null;const {range:_0x124f8f,currentIndex:_0x2c9f9b}=_0x4f2f69;return'$graveyard'==_0x124f8f['root']['rootName']?(_0x40be98['setChangeGroupState'](_0x2c9f9b,'outdated'),null):_0x4f2f69['range'];}['_getDocumentRangeForReplyChanges'](_0x186902,_0x282401){const _0x959466=T(this['context']),{reply:_0x413464,interaction:_0x575a5b}=this['getInteractionAndReplyById'](_0x186902),_0x1b49ef=_0x413464['changeGroups']['filter'](_0x3fe9a6=>'pending'==_0x3fe9a6['state']),_0x14a184=_0x1b49ef['map'](_0x366cae=>_0x413464['changeGroups']['indexOf'](_0x366cae));void 0x0===_0x282401&&(_0x282401=_0x14a184[0x0]);const _0x47f8d0=_0x14a184['indexOf'](_0x282401);if(-0x1==_0x47f8d0)return null;const _0x2ac145=_0x1b49ef[_0x47f8d0],_0x4c3de3=new Et([]),_0x190d43=new Et([]);for(const _0x393cb9 of _0x2ac145['changes'])if('removed'!=_0x393cb9['type']&&_0x190d43['children']['push'](_0x393cb9['node']['cloneNode'](!0x0)),'new'!=_0x393cb9['type']){const _0x51abd8=yt(_0x11b584=>At(_0x11b584,'data-id')==_0x393cb9['id'],_0x413464['documentContextContent'],!0x0);_0x4c3de3['children']['push'](_0x51abd8['cloneNode'](!0x0));}if(0x0==_0x4c3de3['children']['length']){if(_0x2ac145['changes'][0x0]['anchorId']){const _0x2c197e=St('data-id',_0x2ac145['changes'][0x0]['anchorId'],_0x413464['documentContextContent']);_0x4c3de3['children']['unshift'](_0x2c197e['cloneNode'](!0x0)),_0x190d43['children']['unshift'](_0x2c197e['cloneNode'](!0x0)),_0x2c197e['nextSibling']&&(_0x4c3de3['children']['push'](_0x2c197e['nextSibling']['cloneNode'](!0x0)),_0x190d43['children']['push'](_0x2c197e['nextSibling']['cloneNode'](!0x0)));}else{const _0x1aed0e=_0x413464['documentContextContent']['children'][0x0];if(!_0x1aed0e)return null;_0x4c3de3['children']['push'](_0x1aed0e['cloneNode'](!0x0)),_0x190d43['children']['push'](_0x1aed0e['cloneNode'](!0x0));}}const _0x16032e=_0x575a5b['getDocumentContext'](),_0x587eab=_0x959466['data']['parse'](_0x16032e['content']),_0x2ce782=Tt(_0x4c3de3),_0x4a0b24=_0x959466['data']['parse'](_0x2ce782),_0x3a985b=_0x959466['data']['parse'](_0x2ce782),_0x178cdb=_0x959466['model']['createPositionAt'](_0x4a0b24,0x0),_0x4115f1=Tt(_0x190d43),_0x5341c4={'anchor':_0x178cdb,'markDeletions':!0x1},_0x1f8ffc=_0x959466['plugins']['get'](_0x31d190)['getDiff'](_0x2ce782,_0x4115f1,_0x5341c4)['getOperations']();if(!_0x1f8ffc['length'])return null;_0x959466['model']['change'](_0x364fea=>{for(const _0x268f0c of _0x1f8ffc)if('remove'==_0x268f0c['type']){const _0x13fea6=_0x268f0c['sourcePosition'],_0x3870a3=_0x268f0c['howMany'],_0x597737=new et(_0x13fea6,_0x3870a3);_0x364fea['batch']['addOperation'](_0x597737),_0x959466['model']['applyOperation'](_0x597737);}else'marker'!==_0x268f0c['type']&&(_0x268f0c['baseVersion']=null,_0x268f0c['isDocumentOperation']=!0x1,_0x364fea['batch']['addOperation'](_0x268f0c),_0x959466['model']['applyOperation'](_0x268f0c));});const _0x18beea=mt(_0x959466,_0x1f8ffc,_0x4a0b24);ft(_0x959466['model'],_0x18beea);const _0x580aba=_0x18beea['getFirstRange']()['start']['path']['slice'](),_0x5949b7=_0x18beea['getFirstRange']()['end']['path']['slice'](),_0x3275b3=[];let _0x5dbfce=_0x4a0b24,_0x42135a=_0x3a985b;for(let _0x3f2980=0x0;_0x3f2980<_0x5949b7['length'];_0x3f2980++){const _0x1cae0a=_0x5dbfce['maxOffset']-_0x5949b7[_0x3f2980];_0x3275b3[_0x3f2980]=_0x42135a['maxOffset']-_0x1cae0a,_0x5dbfce=_0x5dbfce['getChildAtOffset'](_0x5949b7[_0x3f2980]),_0x42135a=_0x42135a['getChildAtOffset'](_0x3275b3[_0x3f2980]);}const _0x5a67c3=_0x959466['model']['createRange'](_0x959466['model']['createPositionFromPath'](_0x3a985b,_0x580aba),_0x959466['model']['createPositionFromPath'](_0x3a985b,_0x3275b3)),_0x90cb43=_0x3a985b['getChild'](0x0)['getAttribute'](Ct),_0x4dfb75=Array['from'](_0x587eab['getChildren']())['find'](_0x22ec4d=>_0x22ec4d['getAttribute'](Ct)==_0x90cb43)['getPath'](),_0x9d78f=_0x5a67c3['start']['path']['slice'](),_0x2de6ab=_0x5a67c3['end']['path']['slice']();_0x9d78f[0x0]=_0x4dfb75[0x0]+_0x9d78f[0x0],_0x2de6ab[0x0]=_0x4dfb75[0x0]+_0x2de6ab[0x0];let _0x3c8e6c=_0x959466['model']['createRange'](_0x959466['model']['createPositionFromPath'](_0x959466['model']['document']['getRoot'](),_0x9d78f),_0x959466['model']['createPositionFromPath'](_0x959466['model']['document']['getRoot'](),_0x2de6ab));const _0x447cd0=_0x959466['model']['document']['history']['getOperations'](_0x16032e['version']);for(const _0x3571d6 of _0x447cd0)_0x3c8e6c=it['_createFromRanges'](_0x3c8e6c['getTransformedByOperation'](_0x3571d6));return{'range':_0x3c8e6c,'currentIndex':_0x282401};}['_integrateEditor'](_0x3001d8){if(!_0x3001d8['plugins']['has']('Undo'))return;const _0x2c8b74=_0x3001d8['commands']['get']('undo'),_0x3c8d61=_0x3001d8['commands']['get']('redo');this['listenTo'](_0x2c8b74,'revert',(_0x4e4beb,_0x4c8171,_0x41ea54)=>{const _0x37a876=this['_batchToChanges']['get'](_0x4c8171);if(!_0x37a876)return;const _0x5951ea=this['activeConversation']['getInteraction'](_0x37a876['interactionId'])['getReply'](_0x37a876['replyId']);_0x37a876['indexes']['forEach'](_0x7cda67=>_0x5951ea['setChangeGroupState'](_0x7cda67,'pending')),this['_batchToChanges']['delete'](_0x4c8171),this['_batchToChanges']['set'](_0x41ea54,_0x37a876);}),this['listenTo'](_0x3c8d61,'revert',(_0x2c5055,_0x5b051d,_0xbe5940)=>{const _0x4c7442=this['_batchToChanges']['get'](_0x5b051d);if(!_0x4c7442)return;const _0x8ccb7c=this['activeConversation']['getInteraction'](_0x4c7442['interactionId'])['getReply'](_0x4c7442['replyId']);_0x4c7442['indexes']['forEach'](_0x115c06=>_0x8ccb7c['setChangeGroupState'](_0x115c06,'accepted')),this['_batchToChanges']['delete'](_0x5b051d),this['_batchToChanges']['set'](_0xbe5940,_0x4c7442);});}async['loadConversation'](_0x39a77){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'](_0x39a77)['getConversation'](),await this['_startConversationSafely'](_0x39a77),this['updateConversationTitle']('\x20'),await this['activeConversation']['load'](_0x39a77,this['_aiEditing']['sessionId']),this['activeConversation']['isCurrentDocumentInConversation']()&&this['addCurrentDocumentToChatContext']();}catch(_0x3cfde6){this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_UNABLE_TO_LOAD_CONVERSATION'),'id':_0x39a77}),this['_logError'](new _0x509ee0('ai-chat-conversation-not-found',this,{'error':_0x3cfde6}));}finally{this['_aiChatUi']['startAutoScroll'](),this['_aiChatUi']['setFeedItemRenderingStrategy']('streaming'),this['_aiChatUi']['toggleLoadingSkeleton'](!0x1);}}async['_getLastCreatedConversationId'](){const _0x4f2c80=this['_aiConnector']['fetchConversations'](this['getGroupId'](),{'limit':0x1,'sortBy':'createdAt'});try{const _0x25d8e3=await _0x4f2c80['getConversations']();return _0x25d8e3['length']?_0x25d8e3[0x0]['id']:'new';}catch(_0x33f9fe){return this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_UNABLE_TO_LOAD_CONVERSATION'),'id':_0x3dbf6d()}),this['_logError'](new _0x509ee0('ai-chat-conversation-init-failed',this,{'error':_0x33f9fe})),this['_aiChatUi']['toggleLoadingSkeleton'](!0x1),this['_aiChatUi']['disableControls'](),null;}}['handleRemovedConversation'](_0x204cf8){this['activeConversation']['id']===_0x204cf8&&this['_startConversationSafely']();}['addCurrentDocumentToChatContext'](){this['activeConversation']?.['addCurrentDocumentToContext'](i(this['context']['locale'],'AI_CHAT_CONTEXT_CURRENT_DOCUMENT'));}async['addSelectionToChatContext'](){const _0xa0e53d=this['_aiEditing']['getSelectionText']();this['activeConversation']?.['addSelectionToContext'](_0xa0e53d),this['addCurrentDocumentToChatContext']();}['removeSelectionFromChatContext'](){this['activeConversation']?.['removeSelectionFromContext']();}['focusPromptInput'](){this['_aiChatUi']['focusPromptInput']();}async['startConversation'](){await this['_startConversationSafely']();}async['sendMessage']({message:_0x4eb033,attributes:_0x5d2abc}){await this['_handleUIUserMessage']({'userMessage':_0x4eb033,'attributes':_0x5d2abc});}['getGroupId'](){const _0x43a82f=this['context']['config']['get']('collaboration.channelId');if(!_0x43a82f)throw new _0x509ee0('ai-chat-missing-channel-id',this);return _0x43a82f;}async['_startConversationSafely'](_0x4fc1f6){try{this['_aiChatUi']['enableControls'](),await this['_handleStartConversation'](_0x4fc1f6);}catch(_0x1173f4){this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_UNABLE_TO_START_CONVERSATION'),'id':_0x4fc1f6||_0x3dbf6d()}),console['error'](_0x1173f4),this['activeConversation']=void 0x0,this['_aiChatUi']['disableControls']();}}async['_handleStartConversation'](_0x3f8840){let _0xf6476a;this['context']['plugins']['has']('AIChatBalloon')&&this['context']['plugins']['get']('AIChatBalloon')['close'](),_0x3f8840||!this['activeConversation']?_0xf6476a=this['context']['config']['get']('ai.models.defaultModelId'):this['_aiChatUi']['isModelAvailable']&&(_0xf6476a=this['activeConversation']['selectedModel']['id']),await this['_stopLastInteraction']();const _0x48cb06=this['getGroupId'](),_0x189170=_0x3f8840||_0x3dbf6d();this['activeConversation']=new _t({'connector':this['_aiConnector'],'chatModels':this['_aiChatModels'],'selectedModelId':_0xf6476a,'conversationId':_0x189170,'group':_0x48cb06,'getEditor':()=>T(this['context']),'isFromHistory':!!_0x3f8840}),this['activeConversation']['delegate']('toolDataReceived','interactionStarted')['to'](this),this['activeConversation']['on']('conversationInitialized',(_0x172b53,_0x2d1052)=>{this['_aiChatUi']['createConversation'](_0x2d1052),this['_aiChatUi']['resetMessageInput'](),this['_aiChatUi']['clearPendingContextUI'](),this['_aiChatUi']['clearConversationContextUI'](),_0x3f8840||(this['_aiChatUi']['resetConversationTitle'](),this['addCurrentDocumentToChatContext']());}),this['activeConversation']['on']('uploadProgressChanged',(_0x370d2a,_0x5263c1)=>{this['_aiChatUi']['setIsUploadInProgress'](_0x5263c1['isUploadInProgress']);}),this['activeConversation']['on']('interactionCreated',(_0x135d87,_0x2a29e5)=>{this['_aiChatUi']['addFeedItemUserMessage'](_0x2a29e5);}),this['activeConversation']['on']('webSearchStarted',()=>{const _0x3efcf1=this['_aiChatUi']['prepareLoadingMessage']({'isWebSearchEnabled':!0x0,'isReasoningEnabled':!0x1});this['_aiChatUi']['setLoadingMessage'](_0x3efcf1);}),this['activeConversation']['on']('reasoningStarted',()=>{const _0x4e33ba=this['_aiChatUi']['prepareLoadingMessage']({'isWebSearchEnabled':!0x1,'isReasoningEnabled':!0x0});this['_aiChatUi']['setLoadingMessage'](_0x4e33ba);}),this['activeConversation']['on']('webSearchFinished',(_0x5dbce9,_0x4150f4)=>{this['_aiChatUi']['addFeedInteractionHeader'](_0x4150f4,{'isWebSearchEnabled':!0x0,'isReasoningEnabled':!0x1});}),this['activeConversation']['on']('reasoningFinished',(_0x596797,_0xbdf15b)=>{this['_aiChatUi']['addFeedInteractionHeader'](_0xbdf15b,{'isWebSearchEnabled':!0x1,'isReasoningEnabled':!0x0});}),this['activeConversation']['on']('interactionStarted',()=>{this['_aiChatUi']['startInteraction']();}),this['activeConversation']['on']('interactionFinished',async()=>{await this['_aiChatUi']['finishInteraction']();}),this['activeConversation']['on']('interactionDestroyed',(_0x577baf,_0xd2edfb)=>{this['_aiChatUi']['removeFeedInteraction'](_0xd2edfb['id']);}),this['activeConversation']['on']('setConversationTitle',(_0x5bb63c,_0x55c663,_0x522e49)=>{this['updateConversationTitle'](_0x55c663,_0x522e49);}),this['activeConversation']['on']('replyCreated',(_0x423c0a,_0x36dccd)=>{'text'===_0x36dccd['type']?this['_aiChatUi']['addFeedItemAIReply'](_0x36dccd):this['_aiChatUi']['addFeedItemAISuggestion'](_0x36dccd);}),this['activeConversation']['on']('replyContentUpdated',async(_0x2a4544,_0x5a8d70)=>{await this['_updateReplyContent']({'reply':_0x5a8d70});}),this['activeConversation']['on']('replyChangeGroupStateUpdated',(_0x570564,{reply:_0x3519b6,index:_0x3241e8,state:_0x4eaf62})=>{this['_aiChatUi']['updateFeedItemAIReplySuggestionPartState']({'id':_0x3519b6['id'],'index':_0x3241e8,'state':_0x4eaf62}),this['_currentPreviewedChangeGroup']?.['replyId']['includes'](_0x3519b6['id'])&&this['_currentPreviewedChangeGroup']?.['partIndex']==_0x3241e8&&this['_aiChatBalloon']?.['setState'](_0x4eaf62);}),this['activeConversation']['on']('contextItemAdded',(_0x56aade,_0x376a9a)=>{if(this['_aiChatUi']['addContextItem'](_0x376a9a['contextItem'],_0x376a9a['isLoading']),'selection'===_0x376a9a['contextItem']['type']){const _0x26f4e2=[...T(this['context'])['model']['document']['selection']['getRanges']()];this['_aiEditing']['showFakeVisualSelection'](_0x26f4e2,'ai-conversation-'+this['activeConversation']?.['id']);}}),this['activeConversation']['on']('contextItemRemoved',(_0x5258fd,_0x186fcb)=>{this['_aiChatUi']['removeContextItem'](_0x186fcb['uiId']),'current-document'==_0x186fcb['uiId']&&this['removeSelectionFromChatContext'](),'selection'===_0x186fcb['type']&&this['_aiEditing']['hideFakeVisualSelection']('ai-conversation-'+this['activeConversation']?.['id']);}),this['activeConversation']['on']('contextItemLoadingEnded',(_0x31b9fd,_0x2a7005)=>{this['_aiChatUi']['setContextItemLoading'](_0x2a7005['contextItem']['uiId'],_0x2a7005['isLoading']);}),this['activeConversation']['on']('contextSent',(_0x366c7f,_0x3b2a0f)=>{this['_aiChatUi']['setConversationContext'](_0x3b2a0f['contextItems']);}),this['activeConversation']['on']('addContextOptionsChanged',(_0x77fe80,_0x100a6b)=>{this['_aiChatUi']['setAddContextOptions'](_0x100a6b['options']);}),this['activeConversation']['on']('sourceResourcesLoaded',(_0x32f8f6,_0x4649c9)=>{this['_aiChatUi']['populateSourceResourceBalloon'](_0x4649c9['sourceId'],_0x4649c9['source'],_0x4649c9['resources'],_0x4649c9['uid']);}),this['activeConversation']['on']('resourceStateChanged',(_0x4d32c3,_0x337b7d)=>{this['_aiChatUi']['updateResourceState'](_0x337b7d['sourceId'],_0x337b7d['resourceId'],_0x337b7d['isInContext']);}),this['activeConversation']['on']('capabilitiesUpdated',(_0x506f01,_0x26a6b2)=>{this['_aiChatUi']['updateCapabilities'](_0x26a6b2);}),this['activeConversation']['on']('modelSelected',async(_0x22202f,_0xdd3d28)=>{const _0x3e93c9=(await this['_aiChatModels']['getAll']())['find'](_0x1fadc4=>_0x1fadc4['id']===_0xdd3d28['selectedModel']?.['id'])||null;this['_aiChatUi']['setSelectedModel'](_0x3e93c9,_0xdd3d28['isDisabled']);}),this['activeConversation']['on']('error',(_0xfccb90,{error:_0x1945de,interactionId:_0x5db741,fileName:_0x593395,url:_0x1b7f89,sourceId:_0x3a4325,sourceLabel:_0x5d8afe})=>{const _0x1badf1=_0x5db741?_0x5db741+':'+_0x3dbf6d():_0x3dbf6d();_0x1945de['message']['startsWith']('ai-request-aborted')?this['_aiChatUi']['addFeedItemStaticMessage']({'staticMessage':i(this['context']['locale'],'AI_CHAT_ABORTED_MESSAGE'),'id':_0x1badf1}):_0x1945de['message']['startsWith']('ai-chat-conversation-init-failed')||_0x1945de['message']['startsWith']('ai-chat-conversation-start-failed')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_UNABLE_TO_START_CONVERSATION'),'id':_0x1badf1}),this['_logError'](_0x1945de)):_0x1945de['message']['startsWith']('ai-chat-file-upload-failed')?this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_FILE',_0x593395),'id':_0x1badf1}):_0x1945de['message']['startsWith']('ai-chat-url-upload-failed')?this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_URL',_0x1b7f89),'id':_0x1badf1}):_0x1945de['message']['startsWith']('ai-chat-context-invalid-data')?this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_CONTEXT_INVALID_DATA'),'id':_0x1badf1}):_0x1945de['message']['startsWith']('ai-chat-context-unsupported-type')?this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_CONTEXT_UNSUPPORTED_TYPE'),'id':_0x1badf1}):_0x1945de['message']['startsWith']('ai-chat-source-resources-load-failed')?(_0x3a4325&&this['_aiChatUi']['closeSourceResourceBalloon'](_0x3a4325),this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_LOAD_RESOURCES',_0x5d8afe||'source'),'id':_0x1badf1}),this['_logError'](_0x1945de)):_0x1945de['message']['startsWith']('ai-chat-resource-load-failed')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_RESOURCE_LOAD_FAILED'),'id':_0x1badf1}),this['_logError'](_0x1945de)):_0x1945de['message']['startsWith']('ai-chat-invalid-request')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_INVALID_REQUEST'),'id':_0x1badf1}),this['_logError'](_0x1945de)):_0x1945de['message']['startsWith']('ai-chat-context-unsupported-file-type')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_CONTEXT_UNSUPPORTED_FILE_TYPE'),'id':_0x1badf1}),this['_logError'](_0x1945de)):_0x1945de['message']['startsWith']('ai-chat-context-file-too-large')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_CONTEXT_FILE_TOO_LARGE'),'id':_0x1badf1}),this['_logError'](_0x1945de)):_0x1945de['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':_0x1badf1}),this['_logError'](_0x1945de)):_0x1945de['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':_0x1badf1}),this['_logError'](_0x1945de)):(this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_GENERIC_ERROR'),'id':_0x1badf1}),this['_logError'](_0x1945de));}),await this['activeConversation']['init'](this['context']['config']['get']('ai.chat.context')),_0x3f8840||await this['activeConversation']['start']();}async['_handleUIUserMessage']({userMessage:_0x5adad8,attributes:_0x3dfe40}){if(!this['activeConversation'])throw new _0x509ee0('ai-chat-controller-no-active-conversation');if(this['activeConversation']['isCurrentDocumentInContext']()){const _0x3e2ef9=await this['_aiEditing']['getDocumentData']();await this['activeConversation']['updateCurrentDocumentInContext'](_0x3e2ef9);}this['activeConversation']['id']&&this['activeConversation']['isStarted']&&await this['activeConversation']['handleUserInteraction']({'userMessage':_0x5adad8,'attributes':_0x3dfe40});}['_showConversationHistory'](){console['log']('Showing\x20conversation\x20history...');}['_setIsMaximized'](_0x29818e){this['_aiChatUi']['setIsMaximized'](_0x29818e);}['_logError'](_0x6566f4){gt(_0x6566f4['message']);}['_removeFromContext'](_0x24cb5c){this['activeConversation']?.['removeFromContext'](_0x24cb5c);}['_toggleWebSearch'](){this['activeConversation']?.['toggleWebSearch']();}['_toggleReasoning'](){this['activeConversation']?.['toggleReasoning']();}['getInteractionAndReplyById'](_0x57df5c){const [_0x81273f,_0x17a4b9]=_0x57df5c['split'](':'),_0x130cd1=this['activeConversation']['getInteraction'](_0x81273f),_0x47f2c8=_0x130cd1['getReply'](_0x17a4b9);return{'interaction':_0x130cd1,'reply':_0x47f2c8};}['_scrollToSuggestionRange'](_0x8d0acd,_0x596bb3=!0x1){const _0x509bde=T(this['context']),_0x13e7b1={'target':_0x509bde['editing']['view']['domConverter']['viewRangeToDom'](_0x509bde['editing']['mapper']['toViewRange'](_0x8d0acd)),'viewportOffset':{'top':0x96,'left':0x0,'bottom':0x32,'right':0x0},'ancestorOffset':0x14,'alignToTop':_0x596bb3};_0x596bb3&&(_0x13e7b1['alignToTop']=!0x0),_0x48dd33(_0x13e7b1);}['updateConversationTitle'](_0x187f85,_0x3782f4=!0x1){this['_aiChatUi']['setConversationTitle'](_0x187f85||i(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION'),_0x3782f4);}async['_updateReplyContent']({reply:_0x230133,renderingStrategy:_0x3c8835}){const {id:_0x2d6d39,interactionId:_0x5e47af,isDone:_0x581dc9,type:_0x27bf45,parsedContent:_0x272614}=_0x230133,_0x4069af=_0x5e47af+':'+_0x2d6d39;if('modification'===_0x27bf45){const _0xd00caf=_0x230133['getContentParts']({'showDiff':this['_aiChatUi']['showDiff']});await this['_aiChatUi']['updateFeedItemAIReplySuggestionContent']({'id':_0x4069af,'parts':_0xd00caf,'renderingStrategy':_0x3c8835,'isDone':_0x581dc9});}else'text'===_0x27bf45&&await this['_aiChatUi']['updateFeedItemAIReplyContent']({'id':_0x4069af,'parsedContent':_0x272614,'renderingStrategy':_0x3c8835,'isDone':_0x581dc9});_0x581dc9&&_0x230133['sources']['length']>0x0&&this['_aiChatUi']['updateFeedItemAIReplySources'](_0x4069af,_0x230133['sources']);}async['_stopLastInteraction'](){const _0x3e9e3e=this['activeConversation']?.['lastInteraction'];_0x3e9e3e&&(_0x3e9e3e['stop'](),this['_aiChatUi']['stopInteraction'](_0x3e9e3e));}async['_flushLastInteractionUI'](){const _0x1227c8=this['activeConversation']?.['lastInteraction'];if(_0x1227c8){for await(const _0x19fe44 of _0x1227c8['replies'])await this['_updateReplyContent']({'reply':_0x19fe44,'renderingStrategy':'static'});}}['_updateRatings'](_0x18e706){const _0x1592d0={'positiveCount':_0x18e706['changeGroups']['filter'](_0x2bfed4=>'accepted'===_0x2bfed4['state'])['length'],'totalCount':_0x18e706['changeGroups']['length'],'modificationId':_0x18e706['id']},_0x153fb8=this['activeConversation']['getInteraction'](_0x18e706['interactionId'])['messageId'];_0x153fb8&&this['_aiConnector']['upsertAIChatRating'](this['activeConversation']['id'],_0x153fb8,_0x1592d0);}['_registerToolDataCallback'](_0x3f78e6){let _0x5840f8=null,_0x38b71e=null;this['on']('toolDataReceived',(_0x37f26b,_0x44e7d3,_0x48bbad)=>{_0x48bbad['id']!==_0x5840f8&&(_0x5840f8=_0x48bbad['id'],_0x38b71e=this['_getAIChatInteractionAPI'](_0x48bbad)),_0x3f78e6(_0x44e7d3,_0x38b71e);});}['_getAIChatInteractionAPI'](_0x313dd7){const _0x14aa76=this['_aiChatUi'],_0x1774e2=()=>{_0x313dd7['resetWebSearchState'](),_0x313dd7['resetReasoningState'](),_0x14aa76['clearLoadingMessage']();},_0x2e4a9a=()=>{_0x313dd7['currentReply']&&(_0x313dd7['currentReply']['done'](),_0x313dd7['currentReply']=void 0x0);};return{'insertTextReply':(_0x215365,_0x362e4d)=>{_0x2e4a9a(),_0x1774e2();const _0x58f581=_0x313dd7['currentReply']=_0x313dd7['createReply']({'type':'text','interactionId':_0x313dd7['id'],'content':_0x215365,'id':_0x362e4d||_0x3dbf6d()});return _0x2e4a9a(),_0x58f581;},'insertCustomElement':async(_0x6e4f35,_0x4aa611)=>(_0x2e4a9a(),_0x1774e2(),_0x14aa76['addFeedItemCustomElement'](_0x6e4f35,_0x4aa611||_0x3dbf6d())),'setLoadingMessage':_0x2fc5e7=>{_0x14aa76['setLoadingMessage'](_0x2fc5e7);},'clearLoadingMessage':()=>{_0x14aa76['clearLoadingMessage']();}};}}const R='ai-selection';class D extends _0x34a98c{constructor(_0x420235){super(_0x420235),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 _0x591c7a=T(this['context']),_0x52d144=_0x591c7a['plugins']['has']('RealTimeCollaborationClient')&&_0x591c7a['plugins']['get']('RealTimeCollaborationClient')['sessionId'];this['_sessionId']=_0x52d144||_0x3dbf6d();}return this['_sessionId'];}async['getDocumentData'](){const _0x26d413=T(this['context']),_0x4a23b2=_0x26d413['model'],_0x6c4e5=_0x26d413['data']['toView'](_0x4a23b2['document']['getRoot'](),{'convertAiChatSelectionMarker':!0x0}),_0x444484=new Dt(_0x26d413['editing']['view']['document']);this['_setDataIdsOnChildren'](_0x6c4e5,_0x444484);let _0x586922=await this['_getDocumentDataStringFromView'](_0x6c4e5);const _0x6a74cd=this['_getMarkersInDocumentOrder'](),_0x4e433a=[];for(const _0x327896 of _0x6a74cd){const _0x4adcd5='<'+_0x327896['name']+':start></'+_0x327896['name']+':start>',_0x5537e0=_0x586922['indexOf'](_0x4adcd5);_0x586922=_0x586922['substring'](0x0,_0x5537e0)+_0x586922['substring'](_0x5537e0+_0x4adcd5['length']);const _0x4416e2='<'+_0x327896['name']+':end></'+_0x327896['name']+':end>',_0xd25c18=_0x586922['indexOf'](_0x4416e2);_0x586922=_0x586922['substring'](0x0,_0xd25c18)+_0x586922['substring'](_0xd25c18+_0x4416e2['length']),_0x4e433a['push']({'markerName':_0x327896['name'],'start':_0x5537e0,'end':_0xd25c18,'htmlFragment':_0x586922['substring'](_0x5537e0,_0xd25c18)});}return{'content':_0x586922,'version':_0x26d413['model']['document']['version'],'sessionId':this['sessionId'],'selections':_0x4e433a};}async['afterInit'](){this['context']instanceof dt?this['_integrateEditor'](this['context']):this['listenTo'](this['context']['editors'],'add',(_0x3f424e,_0x83318b)=>{_0x83318b['on']('ready',()=>{this['_integrateEditor'](_0x83318b);});});}['_setOutputDataProcessor'](_0x1af476){this['_outputDataProcessor']=_0x1af476;}async['_getDocumentDataStringFromView'](_0x39247b){let _0x49d83f;const _0x5e7dd9=T(this['context']);if(this['_outputDataProcessor']){const _0x3f902d=_0x5e7dd9['data']['processor']['domConverter']['viewToDom'](_0x39247b),_0x195132=await this['_outputDataProcessor'](_0x3f902d);_0x49d83f=_0x5e7dd9['data']['processor']['htmlWriter']['getHtml'](_0x195132);}else _0x49d83f=_0x5e7dd9['data']['processor']['toData'](_0x39247b);return _0x49d83f;}['_integrateEditor'](_0x3322b1){_0x3322b1['conversion']['for']('editingDowncast')['markerToHighlight']({'model':R,'view':{'classes':['ck-fake-ai-selection','ck-ai-assistant-ui_theme'],'priority':0xc}}),_0x3322b1['conversion']['for']('dataDowncast')['markerToElement']({'model':R,'view':(_0x5dbc5a,{writer:_0x7a6ee5,options:_0x22a1c8})=>_0x22a1c8['convertAiChatSelectionMarker']?_0x7a6ee5['createUIElement'](_0x5dbc5a['markerName']+':'+(_0x5dbc5a['isOpening']?'start':'end')):null});}['showFakeVisualSelection'](_0x52234f,_0x1c8e9e,_0x3e1b9a=!0x1,_0x3d6950=!0x1){if(this['_displayedFakeSelectionLocked']&&!_0x3d6950)return!0x1;const _0xb4004a=T(this['context'])['model'];return _0xb4004a['change'](_0x57af84=>{this['_displayedFakeSelectionId']&&this['hideFakeVisualSelection'](this['_displayedFakeSelectionId']),this['_displayedFakeSelectionId']=_0x1c8e9e,this['_displayedFakeSelectionLocked']=_0x3e1b9a;let _0x2b4b8c=0x0;for(let _0xea852a of _0x52234f){const _0x1fc2f7=R+':'+_0x2b4b8c;if(_0xea852a['start']['isAtEnd']){const _0x31c6e2=_0xea852a['start']['getLastMatchingPosition'](({item:_0x22b8f8})=>!_0xb4004a['schema']['isContent'](_0x22b8f8),{'boundaries':_0xea852a});_0xea852a=_0x57af84['createRange'](_0x31c6e2,_0xea852a['end']);}_0x57af84['addMarker'](_0x1fc2f7,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0xea852a}),_0x2b4b8c++;}}),window['getSelection']()?.['removeAllRanges'](),!0x0;}['hideFakeVisualSelection'](_0x12cf2a){if(this['_displayedFakeSelectionId']!=_0x12cf2a)return!0x1;this['_displayedFakeSelectionId']=null,this['_displayedFakeSelectionLocked']=!0x1;const _0x3ffca3=T(this['context']),_0x372d3d=_0x3ffca3['model']['markers']['getMarkersGroup'](R);return _0x3ffca3['model']['change'](_0x17b948=>{for(const _0x3c525e of _0x372d3d)_0x17b948['removeMarker'](_0x3c525e);}),!0x0;}async['modelToDataWithIds'](_0x2c69e8){const _0x59391e=T(this['context']),_0x7ded1=_0x59391e['data']['toView'](_0x2c69e8),_0x137809=new Dt(_0x59391e['editing']['view']['document']);return this['_setDataIdsOnChildren'](_0x7ded1,_0x137809),this['_getDocumentDataStringFromView'](_0x7ded1);}['_setDataIdsOnChildren'](_0x55c3c5,_0x42f57f){let _0x4a8438=!0x1;const _0x3c03c5=new Set();for(const _0x2bf691 of _0x55c3c5['getChildren']()){const _0x237f0d=_0x2bf691['is']('emptyElement')||_0x2bf691['is']('containerElement');if(!_0x2bf691['is']('element'))continue;(this['_setDataIdsOnChildren'](_0x2bf691,_0x42f57f)||_0x237f0d)&&(_0x42f57f['setAttribute']('data-id',this['_nextDataId'](_0x3c03c5),_0x2bf691),_0x4a8438=!0x0);}return _0x4a8438;}['_nextDataId'](_0x285176){let _0x7dfd9f;do{_0x7dfd9f='';for(let _0x3ffa2b=0x0;_0x3ffa2b<0x4;_0x3ffa2b++)_0x7dfd9f+=String['fromCharCode'](0x61+Math['floor'](0x1a*Math['random']()));}while(_0x285176['has'](_0x7dfd9f));return _0x285176['add'](_0x7dfd9f),_0x7dfd9f;}['getSelectionText'](){const {model:_0x5ce8ea}=T(this['context']),_0x4bbd3e=_0x5ce8ea['document']['selection'],_0x2e2478=[];for(const _0x4f0680 of _0x4bbd3e['getRanges']())for(const _0x58a0db of _0x4f0680['getItems']())_0x58a0db['is']('$textProxy')?_0x2e2478['push'](_0x58a0db['data']):_0x58a0db['is']('element')&&_0x2e2478['length']>0x0&&'\x20'!==_0x2e2478[_0x2e2478['length']-0x1]&&_0x2e2478['push']('\x20');return _0x2e2478['length']?'\x22'+_0x2e2478['join']('')['trim']()+'\x22':i(this['context']['locale'],'AI_CHAT_CONTEXT_DOCUMENT_SELECTION_LABEL');}['_getMarkersInDocumentOrder'](){const _0x425b9b=T(this['context'])['model'];return Array['from'](_0x425b9b['markers']['getMarkersGroup'](R))['sort']((_0x5b29db,_0x4d9b82)=>_0x5b29db['getStart']()['isBefore'](_0x4d9b82['getStart']())?-0x1:_0x5b29db['getStart']()['isAfter'](_0x4d9b82['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(_0x5e2139){this['options']={'delay':_0x5e2139['delay']??0x14,'textNodeStyle':_0x5e2139['textNodeStyle'],'onStreamUpdate':_0x5e2139['onStreamUpdate']||(()=>{})};}async['stream']({document:_0x39229c,targetElement:_0x2e171d,abortSignal:_0x1c8456}){this['isStreaming']&&this['stop'](),_0x1c8456?.['addEventListener']('abort',this['stop']['bind'](this)),this['document']=_0x5768f4(_0x39229c,!0x0),this['nodesList']=this['getParsedDocumentNodeList'](),this['isStreaming']=!0x0,this['currentIndex']>this['nodesList']['length']&&(this['currentIndex']=this['nodesList']['length']);for(let _0x37ee56=0x0;_0x37ee56<this['currentIndex'];_0x37ee56++)this['nodesList'][_0x37ee56]['shouldBeStreamed']=!0x0;do{const _0x19443c=Date['now'](),_0x5456fc=this['nodesList'][this['currentIndex']],_0xe46c3=_0x19443c-this['lastUpdateTime'];if(_0x5456fc){_0x5456fc['shouldBeStreamed']=!0x0;let _0x2acce1=_0x5456fc['parent'];for(;_0x2acce1;)_0x2acce1['shouldBeStreamed']=!0x0,_0x2acce1=_0x2acce1['parent'];}if(_0xe46c3<this['options']['delay'])try{const {promise:_0x3f69cb,abortController:_0xb8983}=Os(this['options']['delay']-_0xe46c3);this['timeoutAbortController']=_0xb8983,await _0x3f69cb;}catch(_0x52e367){return;}_0x291ca6(_0x2e171d,'<'+_0x2e171d['tagName']+'>'+this['renderNode'](this['document'])+'</'+_0x2e171d['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:_0x4ead9b}){Array['from'](_0x4ead9b['querySelectorAll']('span[data-ck-html-streamer-word-chunk]'))['reverse']()['forEach'](_0x29913f=>{_0x29913f['replaceWith'](_0x29913f['childNodes'][0x0]);});}['stop'](){this['isStreaming']=!0x1,this['timeoutAbortController']&&(this['timeoutAbortController']['abort'](),this['timeoutAbortController']=null);}['renderNode'](_0x13e19e){let _0x5ba1c7='';if(function(_0x28c446){return _0x38cc0a(_0x28c446);}(_0x13e19e)){for(const _0x45db65 of _0x13e19e['children'])_0x5ba1c7+=this['renderNode'](_0x45db65);}else{if(Ls(_0x13e19e)){if(!_0x13e19e['shouldBeStreamed'])return'';const _0x53a81f=_0x13e19e,_0x41f488=Object['entries'](_0x53a81f['attribs'])['map'](([_0x58ac8b,_0x578f0c])=>_0x58ac8b+'=\x22'+_0x578f0c+'\x22')['join']('\x20');_0x5ba1c7+='<'+_0x53a81f['tagName']+(_0x41f488?'\x20'+_0x41f488:'')+'>';for(const _0x38f412 of _0x9c6907(_0x53a81f))_0x5ba1c7+=this['renderNode'](_0x38f412);_0x5ba1c7+='</'+_0x53a81f['tagName']+'>';}else{if(!Ts(_0x13e19e))return'';if(!_0x13e19e['shouldBeStreamed'])return'';!function(_0xfa88a8){if(!_0xfa88a8['parent']||!Ls(_0xfa88a8['parent']))return!0x1;if(!ys['includes'](_0xfa88a8['parent']['tagName']))return!0x1;return!_0x44a2c9(_0xfa88a8)['match'](/^\s*[<>]\s*$/);}(_0x13e19e)?_0x5ba1c7+=_0x9860e5(_0x13e19e):_0x5ba1c7+=_0x9860e5(new _0x4279d7('span',{'data-ck-html-streamer-word-chunk':'','style':this['options']['textNodeStyle']},[_0x13e19e]));}}return _0x5ba1c7;}['getParsedDocumentNodeList'](){const _0x10e782=[];return function(_0x26ba88,_0x2fae3e){const _0x17497e=_0x2f4bb3=>{if(_0x2fae3e(_0x2f4bb3),_0x2f4bb3 instanceof _0x17a2d5)for(let _0x48d72b=0x0;_0x48d72b<_0x2f4bb3['children']['length'];_0x48d72b++){const _0x3675ea=_0x2f4bb3['children'][_0x48d72b];_0x17497e(_0x3675ea);}};for(let _0x3fffd2=0x0;_0x3fffd2<_0x26ba88['children']['length'];_0x3fffd2++)_0x17497e(_0x26ba88['children'][_0x3fffd2]);}(this['document'],_0x1b619e=>{if(Ts(_0x1b619e)){const _0x2c90c9=this['splitTextNodeIntoWordNodes'](_0x1b619e);_0x2c90c9['length']&&_0x10e782['push'](..._0x2c90c9);}_0x1b619e['isWordSplitSource']||_0x1b619e['isWordSplitResult']||_0x10e782['push'](_0x1b619e);}),_0x10e782;}['splitTextNodeIntoWordNodes'](_0x1b612d){if(_0x1b612d['isWordSplitSource']||_0x1b612d['isWordSplitResult'])return[];const _0x236822=_0x44a2c9(_0x1b612d)['match'](/(?:\s*\S+\s*)/g),_0x36db4=[];if(_0x236822&&_0x236822['length']>0x1){for(const _0x1386cd of _0x236822){const _0x22e96b=new _0x28fe50(_0x1386cd);_0x22e96b['isWordSplitResult']=!0x0,_0x5355a0(_0x1b612d,_0x22e96b),_0x36db4['push'](_0x22e96b);}_0x1b612d['isWordSplitSource']=!0x0,_0x3d1b0b(_0x1b612d);}return _0x36db4;}}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 Ts(_0x5be8ea){return _0x400b0b(_0x5be8ea);}function Ls(_0x29aa90){return _0x26bfdf(_0x29aa90);}function Os(_0x3fcc0d){const _0x58e998=new AbortController();return{'promise':new Promise((_0x42f79,_0x26647a)=>{const _0x142261=setTimeout(_0x42f79,_0x3fcc0d);_0x58e998['signal']['addEventListener']('abort',()=>{clearTimeout(_0x142261),_0x26647a();});}),'abortController':_0x58e998};}class Fr extends _0x5eeb09{['options'];['content']='';['htmlStreamer'];['children'];constructor(_0x34ebb0){super();const _0x5432e7=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']=_0x34ebb0,this['children']=this['createCollection'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__item',_0x5432e7['if']('isDone','ck-ai-chat__feed__item_done'),_0x5432e7['if']('isVisible','ck-hidden',_0x32cb9a=>!_0x32cb9a),'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'](_0x106686=>{_0x106686['removeAttribute']('data-id');}),this['isDone']=!0x0;}async['streamIntoElement'](_0x3baf2a,_0x33c985,_0x2b31ee){await this['htmlStreamer']['stream']({'document':_0x3baf2a,'targetElement':_0x33c985,'abortSignal':_0x2b31ee});}}class oa extends _0x5eeb09{['showChangesToggleView'];constructor(_0x38df75,_0x13e9b3){super(_0x38df75),this['set']('isShowChangesToggleVisible',!0x0),this['showChangesToggleView']=new Zn(_0x38df75),this['showChangesToggleView']['set']({'class':'ck-ai-suggestion__header__show-changes-toggle\x20ck-ai-chat-controls-button','label':i(_0x38df75,'AI_SUGGESTION_BUTTON_SHOW_CHANGES'),'withText':!0x0}),this['showChangesToggleView']['isOn']=_0x13e9b3['showDiff'],this['showChangesToggleView']['bind']('isVisible')['to'](this,'isShowChangesToggleVisible'),this['showChangesToggleView']['bind']('icon')['to'](this['showChangesToggleView'],'isOn',_0x2396a6=>_0x2396a6?_0x28a25c:_0x45b280),this['showChangesToggleView']['on']('execute',()=>{this['showChangesToggleView']['isOn']=!this['showChangesToggleView']['isOn'],this['fire']('toggleShowChanges',{'isOn':this['showChangesToggleView']['isOn']});});const _0x3e1693=new _0x528adc();_0x3e1693['content']=_0x55eb18,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__header',!0x1===_0x13e9b3['showHeader']?'ck-hidden':null]['filter'](Boolean)},'children':[_0x3e1693,{'tag':'span','children':[i(_0x38df75,'AI_SUGGESTION_HEADER_TITLE')]},this['showChangesToggleView']]});}}class Zn extends _0x599e60{['render'](){super['render'](),this['children']['remove'](this['iconView']),this['children']['add'](this['iconView']);}}const Or={'accepted':_0x1b690b,'rejected':_0x243c50,'outdated':_0x243c50};class ws extends _0x5eeb09{['stateIconView'];constructor(_0x22446b){super(_0x22446b);const _0x5a93d9=this['bindTemplate'];this['set']('state','accepted'),this['set']('isVisible',!0x0),this['stateIconView']=new Nr(),this['stateIconView']['bind']('state')['to'](this),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__content-part-state',_0x5a93d9['to']('state',_0x31c096=>'ck-ai-suggestion__content-part-state_'+_0x31c096),_0x5a93d9['if']('isVisible','ck-hidden',_0x19713a=>!_0x19713a)]},'children':[{'tag':'span','attributes':{'class':['ck-ai-suggestion__content-part-state__label']},'children':[{'text':_0x5a93d9['to']('state',_0x54124b=>{switch(_0x54124b){case'accepted':return i(_0x22446b,'AI_SUGGESTION_CONTENT_PART_STATE_ACCEPTED');case'rejected':return i(_0x22446b,'AI_SUGGESTION_CONTENT_PART_STATE_REJECTED');case'outdated':return i(_0x22446b,'AI_SUGGESTION_CONTENT_PART_STATE_OUTDATED');}})}]},this['stateIconView']]});}['setState'](_0x110dc4){this['state']=_0x110dc4;}}class Nr extends _0x528adc{constructor(){super(),this['set']('state','accepted'),this['content']=Or[this['state']],this['on']('change:state',()=>{this['content']=Or[this['state']];});}}class cs extends _0x1b53e3{['_applyButton'];['_suggestButton'];constructor(_0x6a150c,_0x3ee3f3,_0x460d14){super(_0x6a150c);const _0x4dd470=Boolean(_0x460d14);this['set']('isEnabled',!_0x4dd470),this['set']('isVisible',!0x0),this['class']='ck-ai-suggestion-content-part-toolbar';const _0x427ad8=[];if(_0x4dd470){const _0xcc2a37=new _0x599e60(_0x6a150c);_0xcc2a37['set']({'label':i(_0x6a150c,'AI_SUGGESTION_DISABLED_TOOLTIP_MESSAGE'),'tooltip':!0x0,'tooltipPosition':'n','withText':!0x1,'icon':tc}),_0x427ad8['push'](_0xcc2a37);}else{_0x3ee3f3['includes']('applySuggestion')&&(this['_applyButton']=new _0x599e60(_0x6a150c),this['_applyButton']['set']({'label':i(_0x6a150c,'AI_SUGGESTION_CONTENT_PART_APPLY'),'tooltip':!0x0,'tooltipPosition':'n','withText':!0x1,'icon':_0x1b690b}),this['_applyButton']['bind']('isEnabled')['to'](this),this['_applyButton']['on']('execute',()=>{this['fire']('applySuggestion');}),_0x427ad8['push'](this['_applyButton'])),_0x3ee3f3['includes']('insertSuggestion')&&(this['_suggestButton']=new _0x599e60(_0x6a150c),this['_suggestButton']['set']({'label':i(_0x6a150c,'AI_SUGGESTION_CONTENT_PART_ADD_SUGGESTION'),'tooltip':!0x0,'tooltipPosition':'n','withText':!0x1,'icon':_0x4cb165}),this['_suggestButton']['bind']('isEnabled')['to'](this),this['_suggestButton']['on']('execute',()=>{this['fire']('insertSuggestion');}),_0x427ad8['push'](this['_suggestButton']));const _0x17874e=new _0x599e60(_0x6a150c);_0x17874e['set']({'label':i(_0x6a150c,'AI_SUGGESTION_CONTENT_PART_REJECT'),'tooltip':!0x0,'tooltipPosition':'n','withText':!0x1,'icon':_0x243c50}),_0x17874e['bind']('isEnabled')['to'](this),_0x17874e['on']('execute',()=>{this['fire']('rejectSuggestion');}),_0x427ad8['push'](_0x17874e);}this['items']['addMany'](_0x427ad8);const _0x2e78c8=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':[_0x2e78c8['if']('isVisible','ck-hidden',_0x508039=>!_0x508039)]}});}['setButtonsVisibility']({showApplyButton:_0x5728ac,showSuggestButton:_0x142ec3}){this['_applyButton']&&(this['_applyButton']['isVisible']=_0x5728ac),this['_suggestButton']&&(this['_suggestButton']['isVisible']=_0x142ec3);}}class vn extends _0x5eeb09{['toolbarView'];['stateView'];['titleLabelView'];['children'];constructor(_0x59283e,{part:_0x1a65cd,uiIndex:_0x42c41a,availableActions:_0x4a98e9,areActionsDisabled:_0x11bcad}){super(_0x59283e),this['set']('isEnabled',!0x0),this['set']('state','pending'),this['toolbarView']=new cs(_0x59283e,_0x4a98e9,_0x11bcad),this['toolbarView']['on']('rejectSuggestion',()=>{this['fire']('rejectSuggestion',{'index':_0x1a65cd['index']});}),this['toolbarView']['on']('insertSuggestion',()=>{this['fire']('insertSuggestion',{'index':_0x1a65cd['index']});}),this['toolbarView']['on']('applySuggestion',()=>{this['fire']('applySuggestion',{'index':_0x1a65cd['index']});}),this['toolbarView']['bind']('isEnabled')['to'](this),this['stateView']=new ws(_0x59283e),this['titleLabelView']=new Sn(_0x59283e,_0x42c41a),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',(_0x2f6971,_0x88cae,_0x490b81,_0x433044)=>{'pending'===_0x433044?this['children']['remove'](this['toolbarView']):this['children']['remove'](this['stateView']),'pending'===_0x490b81?this['children']['add'](this['toolbarView']):(this['stateView']['setState'](_0x490b81),this['children']['add'](this['stateView']));});}}class Sn extends _0x5eeb09{constructor(_0x175024,_0x50125b){super(_0x175024),this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-suggestion__body__content-part__title__label']},'children':[i(_0x175024,'AI_SUGGESTION_CONTENT_PART_TITLE',_0x50125b['toString']())]});}}class as extends _0x5eeb09{['htmlStreamer'];constructor(_0x5be1b5){super(_0x5be1b5),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:_0x28aa7b,renderingStrategy:_0x51e179,abortSignal:_0x1838e3}){'streaming'===_0x51e179?await this['htmlStreamer']['stream']({'document':_0x28aa7b['content'],'targetElement':this['element'],'abortSignal':_0x1838e3}):this['element']['innerHTML']=Tt(_0x28aa7b['content']);}['clear'](){this['htmlStreamer']['reset'](),this['element']['innerHTML']='';}}class na extends _0x5eeb09{['_children'];['_headerView'];['_streamableContentView'];constructor(_0x34b5b3,{part:_0x52b004,uiIndex:_0x521251,areActionsDisabled:_0x28f10a,availableActions:_0x4a5a49}){super(_0x34b5b3);const _0x17e892=this['bindTemplate'];this['set']('state','pending'),this['set']('isDone',!0x1),this['set']('isVisible',!0x1),this['set']('isActive',!0x1),this['set']('isEnabled',!0x1);const _0x308a36=()=>{this['isEnabled']=this['isDone']&&'pending'==this['state']&&!_0x28f10a;};this['on']('change:state',_0x308a36),this['on']('change:isDone',_0x308a36),_0x308a36(),this['_children']=this['createCollection'](),this['_headerView']=new vn(_0x34b5b3,{'part':_0x52b004,'uiIndex':_0x521251,'availableActions':_0x4a5a49,'areActionsDisabled':_0x28f10a}),this['_headerView']['bind']('isEnabled','state')['to'](this),this['_headerView']['delegate'](...ut)['to'](this),this['_streamableContentView']=new as(_0x34b5b3),this['_children']['addMany']([this['_headerView'],this['_streamableContentView']]),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__body__content-part',_0x17e892['to']('state',_0x112e9e=>'ck-ai-suggestion__body__content-part_'+_0x112e9e),_0x17e892['if']('isEnabled','ck-ai-suggestion__body__content-part_enabled'),_0x17e892['if']('isActive','ck-ai-suggestion__body__content-part_active'),_0x17e892['if']('isVisible','ck-hidden',_0x259197=>!_0x259197)]},'children':this['_children'],'on':{'mouseenter':_0x17e892['to'](()=>{this['isEnabled']&&this['fire']('mouseOverSuggestion',{'index':_0x52b004['index']});}),'mouseleave':_0x17e892['to'](()=>{this['isEnabled']&&this['fire']('mouseLeaveSuggestion',{'index':_0x52b004['index']});}),'click':_0x17e892['to'](_0x46cee8=>{const _0x480c5c=_0x46cee8['target'];this['isEnabled']&&!this['_headerView']['toolbarView']['element']['contains'](_0x480c5c)&&this['fire']('showChangeInText',{'index':_0x52b004['index']});})}});}async['updateContent']({part:_0x135787,renderingStrategy:_0x368ca8,showUnchangedParts:_0x3192c0=!0x1,abortSignal:_0x2c87ea}){this['partDefinition']=_0x135787,this['isVisible']=this['partDefinition']['hasChanges']||_0x3192c0,this['isVisible']&&await this['_streamableContentView']['update']({'part':_0x135787,'renderingStrategy':_0x368ca8,'abortSignal':_0x2c87ea});}['markAsDone'](){this['isDone']=!0x0;}}class z extends _0x17d663(){['queue']=[];['isProcessing']=!0x1;['_abortController'];async['enqueue'](_0x40d337){const _0x2d581e=this['createTask'](_0x40d337);return this['queue']['push'](_0x2d581e),this['_processQueue'](),_0x2d581e['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(_0x1a775a=>{this['once']('_queueEmpty',()=>{_0x1a775a();});}):Promise['resolve']();}async['_processQueue'](){if(!this['isProcessing']){this['_abortController']=new AbortController(),this['isProcessing']=!0x0;try{for(;this['queue']['length']&&this['isProcessing'];){const _0x1affd6=this['queue']['shift']();try{await _0x1affd6['callback'](this['_abortController']['signal']),_0x1affd6['resolve']();}catch(_0x4ce620){_0x1affd6['reject'](_0x4ce620);}}}finally{this['isProcessing']=!0x1,this['_abortController']=void 0x0;}this['fire']('_queueEmpty');}}['createTask'](_0x574102){let _0x3d93d9,_0x28783c;const _0x11a1fc=new Promise((_0x4673bf,_0x32b17a)=>{_0x3d93d9=_0x4673bf,_0x28783c=_0x32b17a;});return{'callback':_0x574102,'resolve':_0x3d93d9,'reject':_0x28783c,'completePromise':_0x11a1fc};}}class mi extends Fr{constructor(_0xb97608){super(_0xb97608),this['extendTemplate']({'attributes':{'class':['ck-ai-notification','warning'===_0xb97608['level']?'ck-ai-notification_warning':'ck-ai-notification_error']}});}['render'](){super['render'](),this['setContent'](this['options']['initialContent']),this['markAsDone']();}['setContent'](_0x2a4556){this['element']['innerHTML']=_0x2a4556;}}const ot=['applySuggestion','insertSuggestion'];class ra extends _0x5eeb09{['_applyChangesButton'];['_insertSuggestionsButton'];['children'];constructor(_0x4e3f06,_0x334ab5=[...ot],_0x4cc31f){super(_0x4e3f06);const _0x5c7804=this['bindTemplate'],_0x4fd0e0=Boolean(_0x4cc31f);if(this['set']('isEnabled',!_0x4fd0e0),this['set']('isVisible',!0x1),this['set']('isTrackChangesOn',!0x1),this['children']=this['createCollection'](),_0x4fd0e0){const _0x2a508c=new _0x599e60(_0x4e3f06);_0x2a508c['set']({'label':i(_0x4e3f06,'AI_SUGGESTION_DISABLED_TOOLTIP_MESSAGE'),'tooltip':!0x0,'tooltipPosition':'n','withText':!0x1,'icon':tc});const _0x3aa178=new _0x5eeb09(_0x4e3f06);_0x3aa178['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-chat__feed__suggestion__actions__info'},'children':[{'tag':'p','children':[i(_0x4e3f06,'AI_SUGGESTION_DISABLED_FEED_MESSAGE'),_0x2a508c]}]}),this['children']['add'](_0x3aa178);}else this['_applyChangesButton']=new _0x599e60(_0x4e3f06),this['_applyChangesButton']['set']({'label':i(_0x4e3f06,'AI_CHAT_SUGGESTION_ACTION_APPLY_ALL'),'withText':!0x0,'type':'button','isVisible':_0x334ab5['includes']('applySuggestion'),'class':'ck-ai-button-primary'}),this['_insertSuggestionsButton']=new _0x599e60(_0x4e3f06),this['_insertSuggestionsButton']['set']({'label':i(_0x4e3f06,'AI_CHAT_SUGGESTION_ACTION_SUGGEST_ALL'),'withText':!0x0,'type':'button','isVisible':_0x334ab5['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'](_0x3fa601=>{_0x3fa601['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',_0x5c7804['if']('isVisible','ck-hidden',_0x572b44=>!_0x572b44)]},'children':this['children']}),this['on']('change:isTrackChangesOn',()=>{this['_applyChangesButton']&&(this['_applyChangesButton']['isVisible']=!this['isTrackChangesOn']);});}['updateVisibility'](_0x10b867){this['isVisible']=_0x10b867;}['_switchButtonLabelsPlurality'](_0x4822e6){this['_applyChangesButton']&&this['_insertSuggestionsButton']&&(_0x4822e6?(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 _0x5eeb09{['children'];['balloonPanelView'];['bodyCollection'];constructor(_0x1842cf,_0x1e9013){super(_0x1842cf),this['bodyCollection']=_0x1e9013,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',_0x48a3a0=>!_0x48a3a0)]},'children':this['children']});const _0x4bd57e=new _0x5eeb09(this['locale']),_0x1ddbdb=new _0x528adc();_0x1ddbdb['content']=_0x2ecb9f,_0x4bd57e['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-web-sources__header']},'children':[_0x1ddbdb,{'tag':'span','children':[{'text':i(this['locale'],'AI_CHAT_SOURCES_HEADER')}]}]}),this['children']['add'](_0x4bd57e),this['_setupBalloonPanel'](_0x1842cf);}['addSource'](_0x1fae8f){this['children']['add'](new qr(this['locale'],_0x1fae8f,this['balloonPanelView']));}['_setupBalloonPanel'](_0x1bf4d5){this['balloonPanelView']=new _0x88aaab(_0x1bf4d5),this['balloonPanelView']['extendTemplate']({'attributes':{'class':['ck-ai-web-source__tooltip-balloon']}}),this['bodyCollection']['add'](this['balloonPanelView']);}}class qr extends _0x599e60{['balloonPanelView'];['source'];constructor(_0x35ba0e,_0x573eb3,_0x145dff){super(_0x35ba0e),this['source']=_0x573eb3,this['balloonPanelView']=_0x145dff,this['set']({'label':_0x573eb3['title'],'class':['ck\x20ck-ai-web-source'],'withText':!0x0});const _0x2695d6=this['bindTemplate'];if(this['extendTemplate']({'on':{'click':_0x2695d6['to'](()=>{window['open'](_0x573eb3['url'],'_blank');}),'mouseenter':_0x2695d6['to'](()=>{this['_showTooltip']();}),'mouseleave':_0x2695d6['to'](()=>{this['_hideTooltip']();})}}),_0x573eb3['favicon']){const _0x1f019d=new _0x5eeb09(_0x35ba0e);_0x1f019d['setTemplate']({'tag':'img','attributes':{'src':_0x573eb3['favicon']||_0x2ecb9f,'alt':_0x573eb3['title'],'class':['ck-ai-web-source__image']}}),this['children']['add'](_0x1f019d);}else this['set']('icon',_0x2ecb9f);}['_createTooltipContentView'](_0x35aa10,_0x26558f){const _0x51f5a7=new _0x5eeb09(_0x35aa10),_0x8bbaaf=[];let _0x3d2fef;_0x26558f?.['favicon']?(_0x3d2fef=new _0x5eeb09(_0x35aa10),_0x3d2fef['setTemplate']({'tag':'img','attributes':{'src':_0x26558f['favicon'],'alt':_0x26558f['title'],'class':['ck-ai-web-source__tooltip-image']}})):(_0x3d2fef=new _0x528adc(),_0x3d2fef['content']=_0x2ecb9f,_0x3d2fef['extendTemplate']({'attributes':{'alt':_0x26558f['title'],'class':['ck-ai-web-source__tooltip-image']}})),_0x8bbaaf['push'](_0x3d2fef);const _0x5be37c=new _0x5eeb09(_0x35aa10);_0x5be37c['setTemplate']({'tag':'a','attributes':{'class':['ck-ai-web-source__tooltip-url'],'href':_0x26558f['url']},'children':[{'text':new URL(_0x26558f['url'])?.['hostname']}]}),_0x8bbaaf['push'](_0x5be37c);const _0xcbe5fc=new _0x5eeb09(_0x35aa10);_0xcbe5fc['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-web-source__tooltip-row']},'children':_0x8bbaaf});const _0x57ba37=new _0x5eeb09(_0x35aa10);return _0x57ba37['setTemplate']({'tag':'span','attributes':{'class':['ck-ai-web-source__tooltip-row','ck-ai-web-source__tooltip-title']},'children':[{'text':_0x26558f['title']['length']>0x190?_0x26558f['title']['substring'](0x0,0x190)+'...':_0x26558f['title']}]}),_0x51f5a7['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-web-source__tooltip']},'children':[_0xcbe5fc,_0x57ba37]}),_0x51f5a7;}['_showTooltip'](){this['_updateTooltipContent'](),this['balloonPanelView']['pin']({'target':this['element'],'positions':[_0x88aaab['defaultPositions']['northArrowSouth'],_0x88aaab['defaultPositions']['northArrowSouthWest'],_0x88aaab['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 _0x34c2ac=this['_createTooltipContentView'](this['locale'],this['source']);this['balloonPanelView']['content']['add'](_0x34c2ac);}}class ca extends _0x5eeb09{['_actionsView'];['_sourcesView'];['_children'];['_areActionsDisabled'];['_showUnchangedParts'];['_updateContentPartsPromiseQueue'];['_emptyPartsWarningView'];['_availableActions'];['_cachedContentParts']=[];constructor(_0x47fc0e,_0x2f1284){super(_0x47fc0e);const {areActionsDisabled:_0x31791c,showUnchangedParts:_0x56f1f6,availableActions:_0x15e89e}=_0x2f1284;this['_areActionsDisabled']=_0x31791c,this['_showUnchangedParts']=_0x56f1f6,this['_availableActions']=_0x15e89e,this['set']('hasPendingParts',!0x1),this['set']('isTrackChangesOn',!0x1),this['_children']=this['createCollection'](),this['_updateContentPartsPromiseQueue']=new z(),this['_emptyPartsWarningView']=new mi({'id':'empty-parts-warning','initialContent':i(_0x47fc0e,'AI_SUGGESTION_EMPTY_PART_WARNING'),'level':'warning'}),this['_emptyPartsWarningView']['isVisible']=!0x1,this['_actionsView']=new ra(_0x47fc0e,_0x2f1284['availableActions'],this['_areActionsDisabled']),this['_actionsView']['bind']('isTrackChangesOn')['to'](this),this['_sourcesView']=new Sr(this['locale'],_0x2f1284['bodyCollection']),_0x2f1284['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:_0x22a413,renderingStrategy:_0x157291,abortSignal:_0x159afc}){this['_children']['length']?_0x22a413['forEach'](_0x29ce3a=>{const _0x414127=this['_cachedContentParts']['findIndex'](_0x48f2ed=>_0x48f2ed['index']==_0x29ce3a['index']);-0x1===_0x414127?this['_cachedContentParts']['push'](_0x29ce3a):this['_cachedContentParts'][_0x414127]=_0x29ce3a;}):this['_cachedContentParts']=_0x22a413;const _0x684088=this['_showUnchangedParts']?_0x22a413:_0x22a413['filter'](_0x2dc1ca=>_0x2dc1ca['hasChanges']);this['_actionsView']['_switchButtonLabelsPlurality'](_0x684088['length']>0x1);for(const _0x18dd3f of _0x684088)this['_updateContentPartsPromiseQueue']['enqueue'](async _0x265fe9=>{let _0x3711fa=this['getPartView'](_0x18dd3f['index']);_0x3711fa||(_0x3711fa=new na(this['locale'],{'part':_0x18dd3f,'uiIndex':this['_children']['length']+0x1,'areActionsDisabled':this['_areActionsDisabled'],'availableActions':this['_availableActions']}),_0x3711fa['delegate'](...ut)['to'](this),this['_children']['add'](_0x3711fa),this['hasPendingParts']=!0x0),await _0x3711fa['updateContent']({'part':_0x18dd3f,'renderingStrategy':_0x157291,'showUnchangedParts':this['_showUnchangedParts'],'abortSignal':_0x265fe9}),_0x3711fa['markAsDone']();});return _0x159afc?.['addEventListener']('abort',()=>{this['_updateContentPartsPromiseQueue']['abort']();}),this['_updateContentPartsPromiseQueue']['queueEmptyPromise'];}['updatePartState'](_0x48f355,_0x206054){const _0x15e4de=this['getPartView'](_0x48f355);_0x15e4de&&(_0x15e4de['state']=_0x206054),this['hasPendingParts']='pending'==_0x206054||Array['from'](this['_children'])['some'](_0x4c7368=>'pending'==_0x4c7368['state']);}['setPartActive'](_0x150f9e,_0x4b8064){if(!0x1===_0x150f9e){for(const _0x1f5040 of this['_children'])_0x1f5040['isActive']=!0x1;}else{const _0x2e2b97=this['getPartView'](_0x150f9e);_0x2e2b97&&(_0x2e2b97['isActive']=_0x4b8064);}}['updateSources'](_0x10d085){_0x10d085['forEach'](_0x4fdd20=>this['_sourcesView']['addSource'](_0x4fdd20)),this['_sourcesView']['isVisible']=!0x0;}['getPartView'](_0x1d3179){return this['_children']['find'](_0x7e70ba=>_0x7e70ba['partDefinition']['index']==_0x1d3179)??null;}['markAsDone'](){if(!this['_showUnchangedParts']){const _0x4c0313=!this['_cachedContentParts']['find'](({hasChanges:_0x321832})=>_0x321832),_0x27f966=!!this['_cachedContentParts']['find'](({hasChanges:_0xcddb42})=>!_0xcddb42);this['_emptyPartsWarningView']['isVisible']=0x0==this['_children']['length']||_0x27f966,_0x4c0313?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'](_0x126196=>_0x126196['markAsDone']()),this['_actionsView']['updateVisibility'](this['hasNonEmptyParts']);}get['hasNonEmptyParts'](){return this['_children']['filter'](_0x1af8f7=>_0x1af8f7['partDefinition']['hasChanges'])['length']>0x0;}}class gn extends _0x5eeb09{['bodyView'];['children'];['headerView'];constructor(_0x45ded2,_0x314bca,_0x35bbae){super(_0x45ded2);const {showDiff:_0x5e35f7,areActionsDisabled:_0x1e3dfb,showUnchangedParts:_0x4ceb5a,availableActions:_0x472630}=_0x314bca;this['set']('isTrackChangesOn',!0x1),this['set']('areChangesVisible',!0x1),this['children']=this['createCollection'](),this['headerView']=new oa(_0x45ded2,{'showDiff':_0x5e35f7}),this['headerView']['on']('toggleShowChanges',(_0x33e8c3,_0x358c12)=>{this['areChangesVisible']=_0x358c12['isOn'],this['fire']('toggleSuggestionDisplayMode',{'showDiff':_0x358c12['isOn']});}),this['children']['add'](this['headerView']),this['bodyView']=new ca(_0x45ded2,{'areActionsDisabled':_0x1e3dfb,'showUnchangedParts':!!_0x4ceb5a,'availableActions':_0x472630,'bodyCollection':_0x35bbae}),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'](_0x1350b0){await this['bodyView']['updateContentParts'](_0x1350b0);}['updateSources'](_0x3ea4e0){this['bodyView']['updateSources'](_0x3ea4e0);}['markAsDone'](){this['bodyView']['markAsDone'](),this['headerView']&&(this['headerView']['isShowChangesToggleVisible']=this['bodyView']['hasNonEmptyParts']);}}class ai extends Fr{['containerView'];constructor(_0x2b6532,_0x310741,_0x1032f5){super(_0x310741),this['set']('isTrackChangesOn',!0x1),this['containerView']=new gn(_0x2b6532,{'showDiff':_0x310741['showDiff'],'areActionsDisabled':_0x310741['areActionsDisabled'],'availableActions':_0x310741['availableActions']},_0x1032f5),this['containerView']['on']('toggleSuggestionDisplayMode',(_0x3ec01a,_0x3037af)=>{this['fire']('toggleSuggestionDisplayMode',{'replyId':this['options']['id'],'showDiff':_0x3037af['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',(_0x4593cf,{index:_0x451747})=>{this['fire']('showChangeInText',{'replyId':this['options']['id'],'partIndex':_0x451747});}),this['containerView']['on']('applySuggestion',(_0x5da7cf,{index:_0x24c09f}={})=>{this['fire']('applySuggestion',{'replyId':this['options']['id'],'partIndex':_0x24c09f});}),this['containerView']['on']('insertSuggestion',(_0x3be170,{index:_0x11bcde}={})=>{this['fire']('insertSuggestion',{'replyId':this['options']['id'],'partIndex':_0x11bcde});}),this['containerView']['on']('rejectSuggestion',(_0x377f0c,{index:_0x50f256})=>{this['fire']('rejectSuggestion',{'replyId':this['options']['id'],'partIndex':_0x50f256});}),this['containerView']['on']('mouseOverSuggestion',(_0x7d6d2,{index:_0x235eaf})=>{this['fire']('mouseOverSuggestion',{'replyId':this['options']['id'],'partIndex':_0x235eaf});}),this['containerView']['on']('mouseLeaveSuggestion',(_0x3d9f4c,{index:_0x1a8f0c})=>{this['fire']('mouseLeaveSuggestion',{'replyId':this['options']['id'],'partIndex':_0x1a8f0c});}),this['children']['addMany']([this['containerView']]),this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__ai-suggestion']}});}async['updateContent'](_0xc4e5fd){await this['containerView']['updateContent'](_0xc4e5fd);}['updatePartState'](_0x2412db,_0x547271){this['containerView']['bodyView']['updatePartState'](_0x2412db,_0x547271);}['setPartActive'](_0x28ca68,_0x5adf9d){!0x1===_0x28ca68?this['containerView']['bodyView']['setPartActive'](!0x1):this['containerView']['bodyView']['setPartActive'](_0x28ca68,_0x5adf9d);}['updateSources'](_0x4e6778){this['containerView']['updateSources'](_0x4e6778);}['getPartView'](_0x54c170){return this['containerView']['bodyView']['getPartView'](_0x54c170);}['markAsDone'](){super['markAsDone'](),this['containerView']['markAsDone']();}}class di extends Fr{['replyContainer'];['_bodyCollection'];constructor(_0x2d48bb,_0x28391b,_0xa42323){super(_0x28391b),this['_bodyCollection']=_0xa42323,this['locale']=_0x2d48bb,this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__ai-reply']}}),this['replyContainer']=new _0x5eeb09(),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':Ui(this['options']['initialContent']),'renderingStrategy':'static'}),this['markAsDone']());}async['updateContent']({parsedContent:_0xdd3d07,renderingStrategy:_0x39cadd,abortSignal:_0x49454d}){'streaming'===_0x39cadd?await this['streamIntoElement'](_0xdd3d07,this['replyContainer']['element'],_0x49454d):this['replyContainer']['element']['innerHTML']=_0x9860e5(_0xdd3d07);}['updateSources'](_0x35a42e){const _0x2ee0da=new Sr(this['locale'],this['_bodyCollection']);_0x2ee0da['children']['addMany'](_0x35a42e['map'](_0x372148=>new qr(this['locale'],_0x372148,_0x2ee0da['balloonPanelView']))),_0x2ee0da['isVisible']=!0x0,this['children']['add'](_0x2ee0da);}}class pi extends _0x1650c8{constructor(_0x1bff41=void 0x0){super();const _0x504b32=_0x1bff41?'ck-ai-spinner_'+_0x1bff41:'';this['extendTemplate']({'tag':'span','attributes':{'class':['ck-ai-spinner',_0x504b32]}});}}const xn={'file':_0x31e6bf,'document':_0x170780,'web-resource':_0x4db515,'text':_0x31e6bf,'selection':_0x1dad19,'mcp-tool-context':_0x170780},Ur='ck-ai-chat-context-chip',Wr='ck-ai-chat-context-chip_wide',Yr='ck-ai-chat-context-chip_document',$r='ck-ai-chat-context-chip__label',Qr='ck-ai-chat-context-chip__type-icon',Xr='ck-ai-chat-context-controls__chip-tooltip',Cn='n';class Vo extends _0x599e60{constructor(_0x1d45ce,_0x8e69d3,_0x1fd197,_0x40acab,_0x27bd19=!0x1){super(_0x1d45ce),this['_isAnimationOnEnterEnabled']=_0x40acab,this['_initializeProperties'](_0x8e69d3,_0x1fd197,_0x27bd19),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'](_0x30b00e,_0x329095,_0x4b308){this['set']('label',_0x30b00e['label']),this['set']('tooltip',!0x0),this['set']('itemType',_0x30b00e['type']),this['set']('id',_0x30b00e['uiId']),this['set']('readonly',_0x329095),this['set']('isLoading',_0x4b308);}['_setupTemplate'](){const _0x5ea060=this['_createIconView'](),_0x37c57c=this['_createRemoveButton'](),_0x41588c=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':this['_createTemplateAttributes'](_0x41588c),'children':this['_createTemplateChildren'](_0x5ea060,_0x37c57c,_0x41588c)});}['_createTemplateAttributes'](_0x4e1d8c){return{'class':[Ur,_0x4e1d8c['if']('itemType',Yr,_0x4a6045=>'document'==_0x4a6045),_0x4e1d8c['if']('itemType',Wr,_0x240e37=>'selection'==_0x240e37)],'data-cke-tooltip-text':_0x4e1d8c['to']('label',In),'data-cke-tooltip-position':Cn,'data-cke-tooltip-class':Xr};}['_createTemplateChildren'](_0x18de79,_0x33c1a0,_0x558748){const _0x167558=this['_createLabelElement'](_0x558748),_0x5a920f=this['_createLoaderIcon']();return this['readonly']?[_0x18de79,_0x167558]:[_0x18de79,_0x5a920f,_0x167558,_0x33c1a0];}['_createLabelElement'](_0x4d2414){return{'tag':'span','attributes':{'class':$r},'children':[{'text':_0x4d2414['to']('label')}]};}['_createRemoveButton'](){const _0x2b2b61=new _0x599e60(this['locale']);return _0x2b2b61['set']({'label':i(this['locale'],'AI_CHAT_CONTEXT_REMOVE_FROM_CONTEXT'),'icon':_0x253bee}),this['_setupRemoveButtonEvent'](_0x2b2b61),_0x2b2b61;}['_setupRemoveButtonEvent'](_0x30bc35){_0x30bc35['on']('execute',()=>{this['fire']('removeContextItemChip',this['id']);});}['_createIconView'](){const _0x57030c=this['bindTemplate'],_0x14eb0d=new _0x528adc();return _0x14eb0d['content']=xn[this['itemType']],_0x14eb0d['extendTemplate']({'attributes':{'class':[Qr,_0x57030c['if']('isLoading','ck-hidden',_0x520d64=>_0x520d64)]}}),_0x14eb0d;}['_handleAnimationEndOnce'](_0x2fd556,_0x130508){if(!_0x2fd556)return;const _0x2fabb9=()=>{_0x130508(),_0x2fd556['removeEventListener']('animationend',_0x2fabb9),_0x2fd556['removeEventListener']('webkitAnimationEnd',_0x2fabb9);};_0x2fd556['addEventListener']('animationend',_0x2fabb9),_0x2fd556['addEventListener']('webkitAnimationEnd',_0x2fabb9);}['_createLoaderIcon'](){const _0x4a2bce=new pi('small');return _0x4a2bce['bind']('isVisible')['to'](this,'isLoading',_0x271803=>_0x271803),_0x4a2bce;}}function In(_0x1fc814){if(!_0x1fc814)return _0x1fc814;if(_0x1fc814['length']<=0x78)return _0x1fc814;const _0x2fe21d=_0x1fc814['slice'](0x0,0x78),_0xd34b4=_0x2fe21d['lastIndexOf']('\x20');return(_0xd34b4>0x0?_0x2fe21d['slice'](0x0,_0xd34b4):_0x2fe21d)+'…';}const hn={'maxVisibleRows':0x2,'rowDetectionTolerance':0x5,'showMoreLabelPrefix':'+\x20','viewportOffset':{'top':0x64,'bottom':0xa}},an='300px';class Ro{['_locale'];['_config'];['_visibleChips'];['_overflowChips'];['_showMoreButtonView']=null;['_showMoreBalloonPanelView']=null;['_containerElement']=null;['_bodyCollection'];['_parentView']=null;['_intersectionObserver']=null;['_pendingCalculation']=!0x1;constructor(_0x4c9019,_0x576e3e,_0x534d78,_0x1cc046,_0x49614d){this['_locale']=_0x4c9019,this['_visibleChips']=_0x576e3e,this['_config']={...hn,..._0x534d78,'cssClasses':{'controlsButton':'','calculationContainer':'ck-calculation-container',..._0x534d78['cssClasses']}},this['_overflowChips']=new _0x397f6f(),this['_bodyCollection']=_0x1cc046,this['_parentView']=_0x49614d||null;}['setContainerElement'](_0x138104){this['_intersectionObserver']&&(this['_intersectionObserver']['disconnect'](),this['_intersectionObserver']=null),this['_containerElement']=_0x138104,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 _0x5513aa=[...this['_visibleChips'],...this['_overflowChips']],_0x41a88e=this['_createCalculationContainer'](),_0x1aa9d9=this['_calculateOverflowInContainer'](_0x41a88e,_0x5513aa),_0x106b27=_0x41a88e['_ancestorsToRestore'];_0x106b27&&this['_restoreAncestorVisibility'](_0x106b27),_0x41a88e['remove'](),this['_applyOverflowResults'](_0x5513aa,_0x1aa9d9);}['_createShowMoreButton'](){this['_showMoreButtonView']=this['_createShowMoreButtonView'](),this['_showMoreBalloonPanelView']=this['_createShowMoreBalloonPanelView'](),this['_showMoreButtonView']['render'](),this['_containerElement']['appendChild'](this['_showMoreButtonView']['element']),this['_showMoreButtonView']['on']('execute',()=>{this['_handleShowMoreButtonClick']();}),_0x5e5264({'emitter':this['_showMoreBalloonPanelView'],'contextElements':[this['_showMoreBalloonPanelView']['element'],this['_showMoreButtonView']['element']],'callback':()=>this['hideBalloonPanel'](),'activator':()=>this['_showMoreButtonView']['isOn']});}['_createShowMoreButtonView'](){const _0x1ba532=new _0x599e60(this['_locale']);_0x1ba532['set']({'label':'','withText':!0x0,'isToggleable':!0x0});const _0x5d9770=[this['_config']['cssClasses']['showMoreButton']];return this['_config']['cssClasses']['controlsButton']&&_0x5d9770['push'](this['_config']['cssClasses']['controlsButton']),_0x1ba532['extendTemplate']({'attributes':{'class':_0x5d9770}}),_0x1ba532;}['_createShowMoreBalloonPanelView'](){const _0x4639b0=new _0x88aaab(this['_locale']);return _0x4639b0['extendTemplate']({'attributes':{'class':this['_config']['cssClasses']['showMoreBalloon']}}),this['_bodyCollection']['add'](_0x4639b0),_0x4639b0;}['_updateBalloonContent'](){if(this['_showMoreBalloonPanelView']&&(this['_showMoreBalloonPanelView']['content']['clear'](),this['_overflowChips']['length']>0x0)){this['_overflowChips']['forEach'](_0x3da5f2=>{_0x3da5f2['disableAnimationOnEnter']();});const _0x3fc79d=new _0x5eeb09(this['_locale']);_0x3fc79d['setTemplate']({'tag':'div','attributes':{'class':this['_config']['cssClasses']['overflowContainer']},'children':this['_overflowChips']}),this['_showMoreBalloonPanelView']['content']['add'](_0x3fc79d);}}['_handleShowMoreButtonClick'](){this['_showMoreButtonView']['isOn']?this['hideBalloonPanel']():this['showBalloonPanel']();}['_updateShowMoreButtonVisibility'](){const _0x45447d=this['_overflowChips']['length']>0x0;this['_showMoreButtonView']?.['element']&&(this['_showMoreButtonView']['element']['style']['display']=_0x45447d?'':'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'](_0x3f285f){const _0x35c72d=this['_containerElement']?.['tagName']['toLowerCase']()||'div',_0x47c0ff=this['_containerElement']?.['classList'];if(_0x47c0ff){const _0x42acb1=_0x47c0ff[0x0]||'',_0x51a04c=_0x3f285f['querySelector']('.'+_0x42acb1),_0x35d93e=_0x3f285f['querySelector'](_0x35c72d);return _0x51a04c||_0x35d93e||_0x3f285f;}return _0x3f285f['querySelector'](_0x35c72d)||_0x3f285f;}['_calculateContainerWidth'](){const _0x520429=this['_parentView']?.['element']||this['_containerElement'];if(!_0x520429)return an;const _0x3b3c0b=window['getComputedStyle'](_0x520429)['width'];if('auto'===_0x3b3c0b||'0px'===_0x3b3c0b||!_0x3b3c0b){const _0x59b280=_0x520429['parentElement'];if(_0x59b280){const _0x2ab910=window['getComputedStyle'](_0x59b280);return'auto'!==_0x2ab910['width']?_0x2ab910['width']:an;}return an;}return _0x3b3c0b;}['_applyCalculationStyles'](_0x190ea8,_0x352055){this['_config']['cssClasses']['calculationContainer']&&_0x190ea8['classList']['add'](this['_config']['cssClasses']['calculationContainer']),_0x190ea8['style']['width']=_0x352055,_0x190ea8['style']['position']='absolute',_0x190ea8['style']['top']='-9999px',_0x190ea8['style']['left']='-9999px',_0x190ea8['style']['opacity']='0',_0x190ea8['style']['pointerEvents']='none',_0x190ea8['style']['zIndex']='-1',_0x190ea8['style']['visibility']='visible\x20!important',_0x190ea8['style']['display']='block\x20!important',_0x190ea8['style']['boxSizing']='border-box';}['_restoreAncestorVisibility'](_0x4133c7){_0x4133c7['forEach'](({element:_0x4b5688,originalDisplay:_0x112190,originalVisibility:_0x19e67e})=>{_0x4b5688['style']['display']=_0x112190,_0x4b5688['style']['visibility']=_0x19e67e;});}['_makeAncestorsVisible'](_0x5f1d00){const _0xed7d15=[];let _0x596789=_0x5f1d00;for(;_0x596789&&_0x596789!==document['body'];){const _0x53b5dd=window['getComputedStyle'](_0x596789);'none'!==_0x53b5dd['display']&&'hidden'!==_0x53b5dd['visibility']||(_0xed7d15['push']({'element':_0x596789,'originalDisplay':_0x596789['style']['display'],'originalVisibility':_0x596789['style']['visibility']}),_0x596789['style']['display']='block',_0x596789['style']['visibility']='visible'),_0x596789=_0x596789['parentElement'];}return _0xed7d15;}['_createContainerElements'](){let _0x31c0a4,_0x4eb74c;return this['_parentView']?.['element']?(_0x31c0a4=this['_parentView']['element']['cloneNode'](!0x0),_0x4eb74c=this['_findTargetContainer'](_0x31c0a4)):(_0x31c0a4=document['createElement']('div'),_0x4eb74c=_0x31c0a4),{'calculationContainer':_0x31c0a4,'targetContainer':_0x4eb74c};}['_createCalculationContainer'](){const {calculationContainer:_0x4c1223,targetContainer:_0x432776}=this['_createContainerElements'](),_0x202b19=this['_calculateContainerWidth']();this['_applyCalculationStyles'](_0x4c1223,_0x202b19);const _0x39cc26=this['_parentView']?.['element']||this['_containerElement'],_0x565988=_0x39cc26?.['parentElement'];_0x565988?_0x565988['appendChild'](_0x4c1223):document['body']['appendChild'](_0x4c1223),_0x4c1223['_targetContainer']=_0x432776;const _0x340450=this['_makeAncestorsVisible'](_0x565988||null);return _0x4c1223['offsetWidth'],_0x4c1223['_ancestorsToRestore']=_0x340450,_0x4c1223;}['_calculateOverflowInContainer'](_0x24dc3e,_0x254187){const _0x4072a8=_0x24dc3e['_targetContainer']||_0x24dc3e,_0x1329ea=[],{rowCount:_0x5695b3}=this['_renderChipsAndCountRows'](_0x4072a8,_0x254187);if(_0x5695b3<=this['_config']['maxVisibleRows'])return _0x1329ea;const _0x57f1f0=_0x254187['slice']();for(;_0x57f1f0['length']>0x0;){if(this['_testButtonFit'](_0x24dc3e,_0x4072a8,_0x57f1f0)){const _0x4e8446=_0x254187['filter'](_0x3da050=>!_0x57f1f0['includes'](_0x3da050));_0x1329ea['push'](..._0x4e8446);break;}if(!_0x57f1f0['pop']())break;}return _0x1329ea;}['_renderChipsAndCountRows'](_0x5c5d5f,_0x203c15){_0x5c5d5f['innerHTML']='',_0x203c15['forEach'](_0x5172dc=>{if(_0x5172dc['element']){const _0x3862b0=_0x5172dc['element']['cloneNode'](!0x0);_0x5c5d5f['appendChild'](_0x3862b0);}}),_0x5c5d5f['offsetWidth'];const _0x1a3881=_0x5c5d5f['children'],_0x52f51e=[];return Array['from'](_0x1a3881)['forEach'](_0x16d6eb=>{const _0x5820fb=_0x16d6eb['getBoundingClientRect']()['top'];_0x52f51e['some'](_0x5e7df8=>Math['abs'](_0x5e7df8-_0x5820fb)<this['_config']['rowDetectionTolerance'])||_0x52f51e['push'](_0x5820fb);}),{'rowCount':_0x52f51e['length']};}['_createMockButton'](){const _0x4a97fd=document['createElement']('button');return _0x4a97fd['className']=this['_config']['cssClasses']['showMoreButton'],this['_config']['cssClasses']['controlsButton']&&_0x4a97fd['classList']['add'](this['_config']['cssClasses']['controlsButton']),_0x4a97fd['textContent']='+\x201',_0x4a97fd;}['_testButtonFit'](_0x73a589,_0x2fe2a5,_0x60de5a){this['_renderChipsAndCountRows'](_0x2fe2a5,_0x60de5a);const _0x545793=this['_createMockButton']();_0x73a589['appendChild'](_0x545793),_0x73a589['offsetWidth'];const _0x3683c0=[..._0x2fe2a5['children'],_0x545793],_0x17a641=[];_0x3683c0['forEach'](_0x3996ec=>{const _0x456a47=_0x3996ec['getBoundingClientRect']()['top'];_0x17a641['some'](_0x3447c9=>Math['abs'](_0x3447c9-_0x456a47)<this['_config']['rowDetectionTolerance'])||_0x17a641['push'](_0x456a47);});const _0x30aac3=_0x17a641['length'];return _0x545793['remove'](),_0x30aac3<=this['_config']['maxVisibleRows'];}['_distributeChips'](_0x315cb7,_0x55bd92){this['_visibleChips']['clear'](),this['_overflowChips']['clear'](),_0x315cb7['forEach'](_0x5efa69=>{_0x55bd92['includes'](_0x5efa69)?this['_overflowChips']['add'](_0x5efa69):this['_visibleChips']['add'](_0x5efa69);});}['_updateOverflowUI'](_0x5b89d2){if(_0x5b89d2>0x0&&!this['_showMoreButtonView']&&this['_createShowMoreButton'](),_0x5b89d2>0x0&&this['_showMoreButtonView']){const _0x22825a=''+this['_config']['showMoreLabelPrefix']+(_0x5b89d2<0x63?_0x5b89d2:'99');this['_showMoreButtonView']['label']=_0x22825a;}this['_updateBalloonContent'](),this['_updateShowMoreButtonVisibility'](),this['_repinBalloonPanel']();}['_applyOverflowResults'](_0x1c2085,_0x3f47df){this['_distributeChips'](_0x1c2085,_0x3f47df),this['_updateOverflowUI'](_0x3f47df['length']);}['_setupVisibilityObserver'](){this['_containerElement']&&'undefined'!=typeof IntersectionObserver&&(this['_intersectionObserver']=new IntersectionObserver(_0x27d341=>{_0x27d341[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 _0x260712=this['_containerElement']['getBoundingClientRect']();if(0x0===_0x260712['width']||0x0===_0x260712['height'])return!0x1;const _0x5ae069=window['innerHeight']||document['documentElement']['clientHeight'],_0x5c210a=window['innerWidth']||document['documentElement']['clientWidth'],_0x4507da=0xc8;return _0x260712['bottom']>=-0xc8&&_0x260712['top']<=_0x5ae069+_0x4507da&&_0x260712['right']>=-0xc8&&_0x260712['left']<=_0x5c210a+_0x4507da;}}const Zr='ck-ai-chat__feed__context-chips',la='ck-ai-chat-context-chips-wrapper',ua='ck-ai-chat-context-chips-wrapper-balloon',da='ck-ai-chat-controls-button',_a='ck-ai-chat-controls_context_show-more-button',Aa='ck-ai-chat-context-controls__show-more-balloon-panel';class _h extends _0x5eeb09{['_contextChips']=this['createCollection']();['_overflowManager'];['_bodyCollection'];constructor(_0x13caad,_0x359e62,_0x3c9baa){super(_0x13caad),this['_bodyCollection']=_0x3c9baa,this['_createContextChips'](_0x359e62);const _0x56b6e9={'cssClasses':{'showMoreButton':_a,'showMoreBalloon':Aa,'overflowContainer':ua,'controlsButton':da}};this['_overflowManager']=new Ro(_0x13caad,this['_contextChips'],_0x56b6e9,this['_bodyCollection'],this),this['setTemplate']({'tag':'div','attributes':{'class':[Zr,'ck','ck-reset_all']},'children':[{'tag':'div','attributes':{'class':la},'children':this['_contextChips']}]});}['render'](){super['render']();const _0x408b10=this['element']['querySelector']('.'+la);_0x408b10&&(this['_overflowManager']['setContainerElement'](_0x408b10),this['_overflowManager']['reorganizeChips']());}['destroy'](){super['destroy'](),this['_overflowManager']['destroy']();}['_createContextChips'](_0x1c4b1b){for(const _0x55c242 of _0x1c4b1b){const _0x3b0ffd=new Vo(this['locale'],_0x55c242,!0x0,!0x1);this['_contextChips']['add'](_0x3b0ffd);}}}class li extends Fr{['_contextChipsView']=null;['_locale'];['_bodyCollection'];['_messageContentView'];constructor(_0x103872,_0x3d8348,_0x1c0979){super(_0x3d8348),this['_locale']=_0x103872,this['_bodyCollection']=_0x1c0979,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'](_0x57b980=>!_0x57b980['hidden']),this['_bodyCollection']),this['_contextChipsView']['extendTemplate']({'attributes':{'class':'ck-ai-chat__feed__context-chips'}}),this['children']['add'](this['_contextChipsView']));}['_createMessageContentView'](){this['_messageContentView']=new _0x5eeb09(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(_0x366cce,_0x2d9556){super(_0x2d9556);const {isWebSearchEnabled:_0x5b229c,isReasoningEnabled:_0x4ddf6e}=_0x2d9556['capabilities'],_0x242fb2=[];let _0x226a0d='';_0x5b229c&&_0x4ddf6e?(_0x226a0d=i(_0x366cce,'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH_REASONING'),_0x242fb2['push'](aa(_0x2ecb9f)),_0x242fb2['push'](aa(_0x14d674))):_0x5b229c?(_0x226a0d=i(_0x366cce,'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH'),_0x242fb2['push'](aa(_0x2ecb9f))):_0x4ddf6e&&(_0x226a0d=i(_0x366cce,'AI_CHAT_FEED_REPLY_ITEM_USED_REASONING'),_0x242fb2['push'](aa(_0x14d674))),this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__interaction-header',_0x226a0d?'':'ck-hidden']}});const _0x44aef4=new _0x5eeb09();_0x44aef4['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__interaction-header__capabilities']},'children':[..._0x242fb2,{'tag':'span','attributes':{'class':['ck-ai-chat__feed__interaction-header__capabilities__text']},'children':[_0x226a0d]}]}),this['children']['add'](_0x44aef4),this['capabilities']=_0x2d9556['capabilities'];}}function aa(_0x20ab11){const _0x5a6a49=new _0x528adc();return _0x5a6a49['content']=_0x20ab11,_0x5a6a49;}const Fs=['wheel','touchstart','pointerdown','keydown'],qs=['ArrowUp','ArrowDown','PageUp','PageDown','Home','End','\x20'];class gi{['element'];['animationFrameId'];['isRunning'];['abortController'];['isUserPaused'];constructor(_0x3104ef){this['element']=_0x3104ef,this['animationFrameId']=null,this['isRunning']=!0x1,this['abortController']=new AbortController(),this['isUserPaused']=!0x1;for(const _0x880b48 of Fs){const _0x55b421='keydown'!==_0x880b48;this['element']['addEventListener'](_0x880b48,this['_onUserEvent']['bind'](this),{'passive':_0x55b421,'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'](_0x594a40){if(this['isRunning']){if('keydown'===_0x594a40['type']){const _0x443c0a=_0x594a40['key'];if(!qs['includes'](_0x443c0a))return;}_0x594a40 instanceof WheelEvent?_0x594a40['deltaY']<0x0?this['isUserPaused']=!0x0:this['isUserPaused']=!this['_isAtBottom']():this['isUserPaused']=!0x0;}}['_isAtBottom'](){const {scrollTop:_0x4e1e58,scrollHeight:_0x5b867f,clientHeight:_0x2c80fb}=this['element'];return _0x5b867f-_0x4e1e58-_0x2c80fb<=0x5;}['_rafUpdate'](){this['isRunning']&&(this['isUserPaused']||this['element']['scrollTo']({'top':this['element']['scrollHeight'],'behavior':'auto'}),this['animationFrameId']=requestAnimationFrame(this['_rafUpdate']['bind'](this)));}}class ui extends _0x5eeb09{constructor(_0x8f5461,_0x2c0f26){super(_0x8f5461),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-skeleton']},'children':this['_createSkeletonItems'](_0x2c0f26)});}['_createSkeletonItems'](_0x398d89){const _0x3513ec=['ck','ck-ai-skeleton__item'];return _0x398d89['map'](_0x16c7c5=>{let _0x445109='';switch(_0x16c7c5['attributes']['align']){case'right':_0x445109='margin-left:\x20auto;\x20margin-right:\x200;\x20text-align:\x20right;';break;case'center':_0x445109='margin-left:\x20auto;\x20margin-right:\x20auto;\x20text-align:\x20center;';break;case'left':_0x445109='margin-left:\x200;\x20margin-right:\x20auto;\x20text-align:\x20left;';}return{'tag':_0x16c7c5['tag'],'attributes':{'class':[..._0x3513ec,_0x16c7c5['attributes']['class']?_0x16c7c5['attributes']['class']:''],'style':'width:\x20'+_0x16c7c5['attributes']['width']+';\x20height:\x20'+_0x16c7c5['attributes']['height']+';'+_0x445109}};});}}const fi={'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(_0x391550,_0x3e641a,_0x22ec6c,_0x29e074){return new Array(_0x391550)['fill'](null)['map'](()=>({'tag':'div','attributes':{'width':_0x3e641a,'height':_0x22ec6c,'align':_0x29e074}}));}class wi extends Fr{constructor(_0x100e3f){super(_0x100e3f),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 _0x5eeb09{['children'];['scrollManager'];['_bodyCollection'];constructor(_0x2daad5,_0x9f1c53){super(_0x2daad5),this['_bodyCollection']=_0x9f1c53,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 gi(this['element']);}['destroy'](){super['destroy'](),this['scrollManager']['destroy']();}['clear'](){this['children']['clear']();}['addItem'](_0x11e557,_0x2530d3){let _0x44b3ea;return'ai-reply'===_0x11e557?_0x44b3ea=new di(this['locale'],_0x2530d3,this['_bodyCollection']):'ai-suggestion-reply'===_0x11e557?(_0x44b3ea=new ai(this['locale'],_0x2530d3,this['_bodyCollection']),_0x44b3ea['bind']('isTrackChangesOn')['to'](this)):_0x44b3ea='user-message'===_0x11e557?new li(this['locale'],_0x2530d3,this['_bodyCollection']):'interaction-header'===_0x11e557?new Mt(this['locale'],_0x2530d3):'custom-element'===_0x11e557?new wi(_0x2530d3):new mi(_0x2530d3),this['children']['add'](_0x44b3ea),_0x44b3ea;}async['updateReplyItem']({id:_0x53a076,parsedContent:_0xa8ab4f,renderingStrategy:_0x44f054,abortSignal:_0x126327}){const _0x141a58=this['getItemById'](_0x53a076);if(!(_0x141a58 instanceof di))throw new _0x509ee0('ai-chat-feed-view-item-not-a-reply-item',null,{'itemView':_0x141a58,'id':_0x53a076,'parsedContent':_0xa8ab4f});await _0x141a58['updateContent']({'parsedContent':_0xa8ab4f,'renderingStrategy':_0x44f054,'abortSignal':_0x126327});}async['updateWebSources'](_0x3e2879,_0x106e51){const _0x5a716c=this['getItemById'](_0x3e2879);if(_0x5a716c instanceof ai)_0x5a716c['updateSources'](_0x106e51);else{if(!(_0x5a716c instanceof di))throw new _0x509ee0('ai-chat-feed-view-item-not-a-suggestion-or-reply-item',null,{'itemView':_0x5a716c,'id':_0x3e2879,'sources':_0x106e51});_0x5a716c['updateSources'](_0x106e51);}}async['updateSuggestionItem']({id:_0x46c435,parts:_0x380f0e,renderingStrategy:_0x390f82,abortSignal:_0x39d06c}){const _0x203249=this['getItemById'](_0x46c435);if(!(_0x203249 instanceof ai))throw new _0x509ee0('ai-chat-feed-view-item-not-a-suggestion-item',null,{'itemView':_0x203249,'id':_0x46c435,'parts':_0x380f0e});await _0x203249['updateContent']({'parts':_0x380f0e,'renderingStrategy':_0x390f82,'abortSignal':_0x39d06c});}['updateSuggestionPartState']({id:_0x3ff9ec,index:_0x159e6c,state:_0x33bae3}){const _0x3b294b=this['getItemById'](_0x3ff9ec);if(!(_0x3b294b instanceof ai))throw new _0x509ee0('ai-chat-feed-view-item-not-a-suggestion-item',this,{'id':_0x3ff9ec});_0x3b294b['updatePartState'](_0x159e6c,_0x33bae3);}['setSuggestionPartActive']({id:_0x56fd19,index:_0x5f5c4d,isActive:_0xb1283f}){const _0xd8098b=this['getItemById'](_0x56fd19);if(!(_0xd8098b instanceof ai))throw new _0x509ee0('ai-chat-feed-view-item-not-a-suggestion-item',this,{'id':_0x56fd19});this['children']['filter'](_0x38ca05=>_0x38ca05 instanceof ai)['forEach'](_0x4f75b6=>{_0x4f75b6['setPartActive'](!0x1);}),_0xd8098b['setPartActive'](_0x5f5c4d,_0xb1283f);}['markItemAsDone'](_0xe2fb63){this['getItemById'](_0xe2fb63)['markAsDone']();}['getItemIds'](){return this['children']['map'](_0x4eeef2=>_0x4eeef2['options']['id']);}['removeItem'](_0x31a7c5){this['children']['remove'](this['getItemById'](_0x31a7c5));}['hasItem'](_0x2f5195){return!!this['children']['find'](_0x29c555=>_0x29c555['options']['id']['includes'](_0x2f5195));}['scrollToSuggestion'](_0x30e4e9,_0x455416){const _0x582d2c=this['getItemById'](_0x30e4e9);if(!(_0x582d2c instanceof ai))return void _0x1c4b5f('ck-ai-chat-feed-view-scroll-to-suggestion-invalid-item',{'replyId':_0x30e4e9,'partIndex':_0x455416});const _0x510c2e=_0x582d2c['getPartView'](_0x455416);_0x510c2e?_0x480036(_0x510c2e['element'],0x14,this['element']['parentElement'],!0x0,!0x0):_0x1c4b5f('ck-ai-chat-feed-view-scroll-to-suggestion-part-view-not-found',{'replyId':_0x30e4e9,'partIndex':_0x455416});}['_setupTemplate'](){this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed']},'children':this['_createTemplateChildren']()});}['_createTemplateChildren'](){const _0x587b0c=this['_createSkeletonLoader']();return[this['_createFeedItems'](),_0x587b0c,this['_createFeedLoader']()];}['_createSkeletonLoader'](){const _0x2bc8b1=new ui(this['locale'],fi['aiFeed']);return _0x2bc8b1['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isLoadingSkeletonVisible','ck-hidden',_0x57c7a5=>!_0x57c7a5)]}}),_0x2bc8b1;}['_createFeedItems'](){const _0x41e39a=new _0x5eeb09(this['locale']);return _0x41e39a['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__items',this['bindTemplate']['if']('isLoadingSkeletonVisible','ck-hidden')]},'children':this['children']}),_0x41e39a;}['_createFeedLoader'](){const _0x5502ca=new _0x5eeb09(this['locale']);return _0x5502ca['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__loader',this['bindTemplate']['if']('isPending','ck-hidden',_0xb851f0=>!_0xb851f0)]},'children':this['_createLoaderChildren']()}),_0x5502ca;}['_createLoaderChildren'](){const _0x1333c5=new pi();return _0x1333c5['isVisible']=!0x0,[_0x1333c5,{'tag':'span','attributes':{'class':['ck','ck-ai-chat__loader-text']},'children':[{'text':this['bindTemplate']['to']('loadingMessage')}]}];}['getItemById'](_0x3686fa){const _0x2788f1=this['children']['find'](_0x3d1730=>_0x3d1730['options']['id']['includes'](_0x3686fa));if(!_0x2788f1)throw new _0x509ee0('ai-chat-feed-view-item-not-found',this,{'id':_0x3686fa});return _0x2788f1;}['setLoadingMessage'](_0x271c78){this['set']('loadingMessage',_0x271c78);}['toggleLoadingSkeleton'](_0x59a08c){this['set']('isLoadingSkeletonVisible',_0x59a08c);}['startAutoScroll'](){this['scrollManager']['start']();}['stopAutoScroll'](){this['scrollManager']['stop']();}}class ph extends _0x20d034{['filter'](){let _0x1ddc30=0x0;for(const _0x58169d of this['items'])_0x1ddc30+=_0x58169d['items']['length'];return{'resultsCount':_0x1ddc30,'totalItemsCount':_0x1ddc30};}}const uh='ck-ai-chat__prompt-input_highlighted';class _s extends _0x491401{['submitButtonView'];static ['MIN_ROWS']=0x1;static ['MAX_ROWS']=0xc;['_addContextButtonView'];['_queryViewResizeObserver'];constructor(_0x1e20f7,_0x171aae){super(_0x1e20f7,{'queryView':{'label':'','creator':_0x29faf8,'showIcon':!0x1,'showResetButton':!0x1},'filteredView':new ph(_0x1e20f7),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1}),this['set']('isEmpty',!0x0),this['set']('isUploadInProgress',!0x1),this['_addContextButtonView']=_0x171aae,this['_queryViewResizeObserver']=null,this['queryView']['fieldView']['minRows']=_s['MIN_ROWS'],this['queryView']['fieldView']['maxRows']=_s['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',(_0x1c83c5,_0x4ff427)=>!_0x1c83c5&&!_0x4ff427),this['focusableChildren']['add'](this['submitButtonView']);}['render'](){super['render'](),this['queryView']['fieldWrapperChildren']['add'](this['submitButtonView']),this['keystrokes']['set']('enter',(_0x267a65,_0x29c5dc)=>{this['isUploadInProgress']||this['isEmpty']||_0x267a65['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0x29c5dc());}),this['queryView']['fieldView']['on']('update',()=>{this['isEmpty']=''===this['queryView']['fieldView']['element']['value']?.['trim']();});}['destroy'](){super['destroy'](),this['_queryViewResizeObserver']&&this['_queryViewResizeObserver']['destroy']();}['submit'](){const _0x284283=this['queryView']['fieldView']['element']['value']?.['trim']();if(!_0x284283)return this['queryView']['errorText']=i(this['locale'],'AI_CHAT_PROMPT_EMPTY_ERROR'),void(this['queryView']['fieldView']['hasError']=!0x0);this['queryView']['fieldView']['hasError']=!0x1;const _0x32cf10=_0x497439(_0x284283);this['fire']('sendUserMessage',_0x32cf10),this['queryView']['fieldView']['reset']();}['setPlaceholderText'](_0xd1e4e3){this['queryView']['fieldView']['set']('placeholder',_0xd1e4e3);}['focus'](_0x1c858a=!0x1){super['focus'](),_0x1c858a&&(this['element']['classList']['contains'](uh)||(this['element']['classList']['add'](uh),setTimeout(()=>{this['element']['classList']['remove'](uh);},0x320)));}['_createSubmitButton'](){const _0x190193=new _0x599e60(this['locale']);return _0x190193['set']({'icon':_0x1c6079,'label':i(this['locale'],'AI_CHAT_LABEL_SUBMIT'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-chat__prompt-submit-button','isEnabled':!0x1}),_0x190193['on']('execute',()=>{this['submit']();}),_0x190193;}['setIsUploadInProgress'](_0x4ef540){this['isUploadInProgress']=_0x4ef540;}['_setUpAddContextButtonPositioning'](){const _0x53eb7c=this['locale'],_0x11e53d=()=>{_0x595889['window']['requestAnimationFrame'](()=>{if(_0x49efe1(this['element'])){const _0x70c467=new _0x227dc7(this['queryView']['fieldView']['element']),_0x94cdd9=new _0x227dc7(this['_addContextButtonView']['element']),_0x2f47d3=_0x70c467['width'],_0x481f91='rtl'===_0x53eb7c['uiLanguageDirection']?'right':'left';_0x70c467['excludeScrollbarsAndBorders']();const _0x160d3c=_0x2f47d3-_0x70c467['width']+0x1;this['_addContextButtonView']['element']['style'][_0x481f91]='calc('+(_0x2f47d3-_0x94cdd9['width']-_0x160d3c)+'px\x20-\x20var(--ck-spacing-tiny))';}});};this['queryView']['fieldView']['on']('update',_0x11e53d),this['on']('render',()=>{_0x11e53d(),this['_queryViewResizeObserver']=new _0x47b3bb(this['queryView']['fieldView']['element'],()=>{_0x11e53d();});});}}const ga='ck-ai-chat__prompt-capabilities',Ia='ck-ai-chat-controls-button',Ea='ck-ai-chat-controls-button--commands',pa='ck-ai-button-tertiary',Ta='ck-ai-chat-controls__model-selection',ma='ck-ai-chat-controls__model-selection__item-name',Ca='ck-ai-chat-controls__model-selection__item-description',wa='ck-ai-chat-controls__model-selection__item-capabilities',fa='n';class vs extends _0x5eeb09{['_webSearchButton'];['_reasoningButton'];['_commandsButton'];['_modelSelectionDropdown'];['_modelSelectionDropdownItems'];['_modelNameView'];constructor(_0x4edf64){super(_0x4edf64),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',_0x1b6dfc=>'selector'===_0x1b6dfc),this['_modelSelectionDropdown']['buttonView']['bind']('tooltip')['to'](this,'modelSelectorEnabled',_0x516c36=>_0x516c36?this['_modelSelectionDropdown']['buttonView']['label']:i(this['locale'],'AI_CHAT_MODEL_SELECTOR_DISABLED_TOOLTIP')),this['_modelSelectionDropdown']['bind']('isEnabled')['to'](this,'modelSelectorEnabled',_0x41dd99=>_0x41dd99),this['_webSearchButton']['bind']('isOn')['to'](this,'webSearchActive',_0x28dc4f=>_0x28dc4f),this['_webSearchButton']['bind']('tooltip')['to'](this,'webSearchActive',_0x4f9819=>i(this['locale'],_0x4f9819?'AI_CHAT_DISABLE_WEB_SEARCH':'AI_CHAT_ENABLE_WEB_SEARCH')),this['_reasoningButton']['bind']('isOn')['to'](this,'reasoningActive',_0x14a17d=>_0x14a17d),this['_reasoningButton']['bind']('tooltip')['to'](this,'reasoningActive',_0x180b07=>i(this['locale'],_0x180b07?'AI_CHAT_DISABLE_REASONING':'AI_CHAT_ENABLE_REASONING')),this['setTemplate']({'tag':'div','attributes':{'class':[ga]},'children':[this['_modelSelectionDropdown'],this['_modelNameView'],this['_webSearchButton'],this['_reasoningButton'],this['_commandsButton']]}),this['_modelSelectionDropdownItems']=new _0x397f6f(),_0x37db59(this['_modelSelectionDropdown'],this['_modelSelectionDropdownItems']);}['setModelList'](_0x3c26b7,_0x361a8d){if(_0x361a8d)this['set']('modelDisplayMode','hidden');else{const _0x306ad9=0x1===_0x3c26b7['length'];this['set']('modelDisplayMode',_0x306ad9?'name':'selector');}if(this['_modelSelectionDropdownItems']['clear'](),_0x3c26b7?.['length'])for(const _0x1b7096 of _0x3c26b7){const _0x35ee81=new _0x137bc3({'label':_0x1b7096['name'],'withText':!0x0,'role':'menuitemradio','id':_0x1b7096['id'],'model':_0x1b7096});_0x35ee81['bind']('isOn')['to'](this,'activeModelId',_0x15704f=>_0x15704f===_0x1b7096['id']),this['_modelSelectionDropdownItems']['add']({'type':'button','model':_0x35ee81,'labelView':new Sa(this['locale'],_0x1b7096)});}}['setWebSearch'](_0x2e391f){this['set']('webSearchActive',_0x2e391f);}['setReasoning'](_0x12e8fb){this['set']('reasoningActive',_0x12e8fb);}['setModel'](_0x59a628){if(!_0x59a628)return;this['activeModelId']=_0x59a628['id'],this['activeModelName']=_0x59a628['name']||_0x59a628['id'],this['_modelSelectionDropdown']['buttonView']['set']('label',_0x59a628['name']),this['_modelSelectionDropdown']['buttonView']['set']('tooltip',_0x59a628['name']);const _0x5dedd2=_0x59a628['capabilities']['webSearch']?.['enabled']??!0x1;this['set']('webSearchActive',!0x1),this['_webSearchButton']['set']('isOn',!0x1),this['_webSearchButton']['set']('isEnabled',_0x5dedd2),this['_webSearchButton']['set']('isVisible',_0x5dedd2);const _0x490eb1=_0x59a628['capabilities']['reasoning']?.['enabled']??!0x1;this['set']('reasoningActive',!0x1),this['_reasoningButton']['set']('isOn',!0x1),this['_reasoningButton']['set']('isEnabled',_0x490eb1),this['_reasoningButton']['set']('isVisible',_0x490eb1);}['enableModelSelector'](){this['set']('modelSelectorEnabled',!0x0);}['disableModelSelector'](_0x57bdab){this['set']('modelSelectorEnabled',!0x1),_0x57bdab&&this['set']('modelDisplayMode','hidden');}['_createWebSearchButton'](){const _0x5e9442=new _0x599e60();return _0x5e9442['set']({'label':i(this['locale'],'AI_CHAT_SEARCH_WEB'),'icon':_0x2ecb9f,'class':Ia,'isToggleable':!0x0,'tooltipPosition':fa}),_0x5e9442['on']('execute',()=>{this['fire']('toggleWebSearch');}),_0x5e9442;}['_createReasoningButton'](){const _0x219b72=new _0x599e60();return _0x219b72['set']({'label':i(this['locale'],'AI_CHAT_REASONING'),'icon':_0x14d674,'class':Ia,'isToggleable':!0x0,'tooltipPosition':fa}),_0x219b72['on']('execute',()=>{this['fire']('toggleReasoning');}),_0x219b72;}['_createCommandsButton'](){const _0x2ab6f8=new _0x599e60();return _0x2ab6f8['set']({'label':i(this['locale'],'AI_CHAT_COMMANDS'),'icon':_0x5efe70,'withText':!0x0,'class':Ia,'isToggleable':!0x0,'tooltip':i(this['locale'],'AI_CHAT_COMMANDS'),'tooltipPosition':fa}),_0x2ab6f8['extendTemplate']({'attributes':{'class':[Ea]}}),_0x2ab6f8['on']('execute',()=>{console['log']('Commands\x20are\x20not\x20implemented\x20yet.'),alert('Commands\x20are\x20not\x20implemented\x20yet.');}),_0x2ab6f8;}['_createModelSelectionDropdown'](){const _0x2084b1=_0xace15(this['locale']);return _0x2084b1['set']({'panelPosition':'ne','class':[Ta]}),_0x2084b1['buttonView']['set']({'label':i(this['locale'],'AI_CHAT_MODEL_SELECTOR_ENABLED_TOOLTIP'),'withText':!0x0,'tooltip':!0x0,'tooltipPosition':fa,'class':pa}),this['listenTo'](_0x2084b1,'execute',_0x4c48af=>{this['fire']('selectModel',_0x4c48af['source']['model']);}),_0x2084b1;}['_createModelNameView'](){const _0x107362=new ba(this['locale']);return _0x107362['bind']('text')['to'](this,'activeModelName',_0x40c8d6=>_0x40c8d6??''),_0x107362['bind']('isVisible')['to'](this,'modelDisplayMode',_0x404cb8=>'name'===_0x404cb8),_0x107362;}}let Sa=class extends _0x512e7d{constructor(_0x287d1f,_0x3bb018){super();const _0x33814f=this['bindTemplate'],_0x369889=this['createCollection']();this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-button__label'],'style':_0x33814f['to']('style'),'id':_0x33814f['to']('id')},'children':[{'tag':'div','attributes':{'class':[ma]},'children':[{'text':_0x33814f['to']('text')}]},{'tag':'div','attributes':{'class':[Ca]},'children':[{'tag':'span','children':[{'text':_0x3bb018['description']}]}]},{'tag':'div','attributes':{'class':[wa]},'children':_0x369889}]}),_0x369889['addMany'](this['_getCapabilityParts'](_0x287d1f,_0x2ecb9f,'AI_CHAT_SEARCH_WEB',_0x3bb018['capabilities']['webSearch']?.['enabled']??!0x1)),_0x369889['addMany'](this['_getCapabilityParts'](_0x287d1f,_0x14d674,'AI_CHAT_REASONING',_0x3bb018['capabilities']['reasoning']?.['enabled']??!0x1));}['_getCapabilityParts'](_0x1d7e2a,_0x532530,_0x4823b9,_0x1420cf){const _0x190a3a=new _0x528adc();_0x190a3a['content']=_0x532530;const _0x5e1ab4=new _0x5eeb09(_0x1d7e2a);_0x5e1ab4['setTemplate']({'tag':'span','children':[{'text':i(_0x1d7e2a,_0x4823b9)+':\x20'}]});const _0x4394d0=new _0x5eeb09(_0x1d7e2a);return _0x4394d0['setTemplate']({'tag':'span','children':[{'text':i(_0x1d7e2a,_0x1420cf?'AI_CHAT_CAPABILITIES_YES':'AI_CHAT_CAPABILITIES_NO')}]}),[_0x190a3a,_0x5e1ab4,_0x4394d0];}},ba=class extends _0x5eeb09{constructor(_0x11c0fc){super(_0x11c0fc),this['set']('text',void 0x0),this['set']('isVisible',!0x0);const _0x252123=this['bindTemplate'];this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-chat-controls__model-name',_0x252123['if']('isVisible','ck-hidden',_0x30a13f=>!_0x30a13f)]},'children':[{'text':_0x252123['to']('text')}]});}};const Ra='ck-ai-chat-context-controls__url-form',Oa='ck-ai-chat-context-controls__url-input-section';class Po extends _0x5eeb09{['focusTracker'];['keystrokes'];['_focusables'];['focusCycler'];['urlInputField'];['backButton'];['confirmButton'];constructor(_0x1e6ad1){super(_0x1e6ad1),this['focusTracker']=new _0x534506(),this['keystrokes']=new _0x33f2cf(),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 _0x45d025({'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'](_0xf8d0cb=>{this['focusTracker']['add'](_0xf8d0cb['element']),this['keystrokes']['listenTo'](_0xf8d0cb['element']);}),_0xd2d1ba({'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'](_0x4c8a06){this['urlInputField']['errorText']=_0x4c8a06,this['_updateConfirmButtonState'](),this['fire']('refreshBalloon');}['clearError'](){this['urlInputField']['errorText']=null,this['_updateConfirmButtonState']();}['_createBackButton'](){const _0x5817aa=new _0x599e60(this['locale']);return _0x5817aa['set']({'icon':_0x2e8801,'tooltip':i(this['locale'],'AI_CHAT_CONTEXT_URL_BACK_TO_CONTEXT'),'tooltipPosition':'n','class':['ck-button-icon\x20ck-button-back']}),this['on']('change:withBackButton',(_0x33bf23,_0xfc55b4,_0x179c1a)=>{_0x5817aa['set']({'class':['ck-button-icon\x20ck-button-back'+(_0x179c1a?'':'\x20ck-hidden')]});}),_0x5817aa;}['_createUrlInputField'](){const _0x379d36=new _0x22aa6a(this['locale'],_0x56e4b8);return _0x379d36['set']({'label':i(this['locale'],'AI_CHAT_CONTEXT_URL_LABEL'),'class':'ck-labeled-field-view_empty'}),_0x379d36['fieldView']['set']({'placeholder':i(this['locale'],'AI_CHAT_CONTEXT_URL_PLACEHOLDER')}),_0x379d36;}['_createConfirmButton'](){const _0x394762=new _0x599e60(this['locale']);return _0x394762['set']({'icon':_0x4ddc2b,'tooltip':i(this['locale'],'AI_CHAT_CONTEXT_URL_ADD_URL'),'tooltipPosition':'n','class':'ck-button-icon','type':'submit','isEnabled':!0x1}),_0x394762;}['_setupTemplate'](){const _0x1b779c=new _0x156476(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'});_0x1b779c['children']['add'](this['backButton'],0x0),this['setTemplate']({'tag':'form','attributes':{'class':Ra,'tabindex':'-1'},'children':[_0x1b779c,{'tag':'div','attributes':{'class':Oa},'children':[this['urlInputField'],this['confirmButton']]}]});}['_setupEventHandlers'](){this['backButton']['on']('execute',()=>{this['clear'](),this['fire']('cancel');}),this['urlInputField']['fieldView']['on']('input',()=>{this['clearError'](),this['_updateConfirmButtonState'](),this['fire']('refreshBalloon');}),this['on']('submit',_0x54b26b=>{_0x54b26b['stop'](),this['_handleSubmit']();});}['_setupKeystrokes'](){this['keystrokes']['set']('esc',(_0x3f382c,_0x14b3ec)=>{this['clear'](),this['fire']('cancel'),_0x14b3ec();});}['_handleSubmit'](){const _0x180143=this['getValue']()['trim']();_0x180143?this['_isValidUrl'](_0x180143)?(this['clearError'](),this['fire']('submitUrl',_0x180143)):this['setError'](i(this['locale'],'AI_CHAT_CONTEXT_URL_INVALID_ERROR')):this['setError'](i(this['locale'],'AI_CHAT_CONTEXT_URL_EMPTY_ERROR'));}['_updateConfirmButtonState'](){const _0x373815=this['getValue']()['trim'](),_0xad51ff=!!this['urlInputField']['errorText'];this['confirmButton']['isEnabled']=_0x373815['length']>0x0&&!_0xad51ff;}['_isValidUrl'](_0x52123f){try{return!!new URL(_0x52123f);}catch{return!0x1;}}}const ka='ck-ai-chat-resources__item',Na='ck-ai-chat-resources__item--in-context',ya='ck-ai-chat-resources__item-title',va='ck-ai-chat-resources__item__icon';class hc extends _0x8981d2{['resource'];['_titleView'];['_iconView'];constructor(_0x2f1731,_0x139d13){super(_0x2f1731),this['resource']=_0x139d13,this['set']('isInContext',!!_0x139d13['isInContext']),this['_titleView']=this['_createTitleView'](),this['_iconView']=this['_createIconView'](),this['_setupTemplate']();}['render'](){super['render']();}['getResourceIcon'](_0x3d18d9){if(_0x3d18d9['isInContext'])return _0x4ddc2b;switch(_0x3d18d9['type']){case Be['DOCUMENT']:return _0x170780;case Be['URL']:return _0x4db515;case Be['FILE']:case Be['TEXT']:return _0x31e6bf;default:return _0x1e1165;}}['highlightText'](_0x12a99f){if(!_0x12a99f||''===_0x12a99f['trim']())return void this['_titleView']['highlightText'](null);const _0x18b1ab=new RegExp(_0x201462(_0x12a99f),'gi');this['_titleView']['highlightText'](_0x18b1ab);}['updateResourceState'](_0x2e805b){this['resource']['isInContext']=_0x2e805b,this['isInContext']=_0x2e805b,this['_updateIcon']();}['_createTitleView'](){const _0x1a7577=new _0x26b973();return _0x1a7577['text']=this['resource']['label'],_0x1a7577['extendTemplate']({'tag':'span','attributes':{'class':[ya]}}),_0x1a7577;}['_createIconView'](){const _0x222048=new _0x528adc();return _0x222048['content']=this['getResourceIcon'](this['resource']),_0x222048;}['_setupTemplate'](){const _0x5b1118=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':[ka,_0x5b1118['if']('isVisible','ck-hidden',_0x517852=>!_0x517852),_0x5b1118['if']('isInContext',Na)]},'children':[{'tag':'div','attributes':{'class':[va]},'children':[this['_iconView']]},this['_titleView']],'on':{'click':_0x5b1118['to']('execute')}});}['_updateIcon'](){this['_iconView']['content']=this['getResourceIcon'](this['resource']);}}const xa='ck-ai-chat-resources__list';class Lr extends _0x20d034{['_source'];constructor(_0x4564c1,_0x413e02){super(_0x4564c1),this['_source']=_0x413e02,this['extendTemplate']({'attributes':{'class':[xa]}});}['setResources'](_0x20a9c8,_0x452e17){this['items']['clear']();let _0x5ed7b9=_0x20a9c8;if(this['_source']['useDefaultFiltering']&&_0x452e17&&''!==_0x452e17['trim']()){const _0x3c8210=new RegExp(_0x452e17['replace'](/[.*+?^${}()|[\]\\]/g,'\x5c$&'),'gi');_0x5ed7b9=_0x20a9c8['filter'](_0x485679=>_0x3c8210['test'](_0x485679['label']));}for(const _0x4ad41c of _0x5ed7b9){const _0x4fd731=new hc(this['locale'],_0x4ad41c);_0x4fd731['on']('execute',()=>{this['_handleResourceSelection'](this['_source'],_0x4ad41c);}),this['items']['add'](_0x4fd731);}this['_source']['useDefaultFiltering']&&this['highlightText'](_0x452e17);}['highlightText'](_0x1d1675){this['_source']['useDefaultFiltering']&&this['items']['forEach'](_0xc59a44=>{_0xc59a44['highlightText'](_0x1d1675);});}['updateResourceState'](_0x475099,_0x45c3ff){for(const _0x433357 of this['items']){const _0x10d7be=_0x433357;_0x10d7be['resource']['id']===_0x475099&&_0x10d7be['updateResourceState'](_0x45c3ff);}}['_handleResourceSelection'](_0x3ef2e1,_0x4e1a87){this['fire']('addResourceToContext',{'source':_0x3ef2e1,'resource':_0x4e1a87});}}class Tr extends _0x22aa6a{['iconView'];['resetButtonView'];['_viewConfig'];constructor(_0x274fc7){const t=_0x274fc7['t'],_0xd34e55={'showResetButton':!0x0,'showIcon':!0x0,'creator':_0x56e4b8,'label':i(_0x274fc7,'AI_CHAT_SEARCH_RESOURCES')};super(_0x274fc7,_0xd34e55['creator']),this['label']=_0xd34e55['label'],this['_viewConfig']=_0xd34e55,this['_viewConfig']['showIcon']&&this['_setupSearchIcon'](),this['_viewConfig']['showResetButton']&&this['_setupResetButton'](_0x274fc7,t),this['_setupEventListeners']();}['reset'](){this['fieldView']['reset'](),this['_viewConfig']['showResetButton']&&this['resetButtonView']&&(this['resetButtonView']['isVisible']=!0x1),this['search']('');}['search'](_0x5ba933){this['fire']('search',_0x5ba933);}['getQuery'](){return this['fieldView']['element']?.['value']||'';}['_setupSearchIcon'](){this['iconView']=new _0x528adc(),this['iconView']['content']=_0x3ccd4e,this['fieldWrapperChildren']['add'](this['iconView'],0x0),this['extendTemplate']({'attributes':{'class':'ck-search__query_with-icon'}});}['_setupResetButton'](_0x2b0f6c,t){this['resetButtonView']=new _0x599e60(_0x2b0f6c),this['resetButtonView']['set']({'label':t('Clear'),'icon':_0x35d8e1,'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',_0x3453ea=>!_0x3453ea),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 _0x5eeb09{['_searchView'];['_searchSection'];['_searchInputVisibleFrom'];['_resourcesListView'];['_skeletonLoader'];['_source'];['children'];['_latestLoadResourcesUid']=null;constructor(_0x169115,_0x17155d){super(_0x169115),this['_source']=_0x17155d['source'],this['_searchInputVisibleFrom']=_0x17155d['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 _0xa460cb([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 _0x37e490=new _0x5eeb09(this['locale']);return _0x37e490['setTemplate']({'tag':'div','attributes':{'class':'ck\x20ck-search'},'children':[this['_searchView']]}),this['_searchView']['on']('search',(_0x1b7634,_0x1b6005)=>{this['loadResources'](_0x1b6005),this['_source']['useDefaultFiltering']&&this['_resourcesListView']['highlightText'](_0x1b6005);}),_0x37e490;}['_createResourcesListView'](){const _0x39793a=new Lr(this['locale'],this['_source']);return _0x39793a['delegate']('addResourceToContext')['to'](this),_0x39793a['extendTemplate']({'attributes':{'class':this['bindTemplate']['if']('isLoading','ck-hidden')}}),_0x39793a;}['_createSkeletonView'](){const _0x2e8868=new ui(this['locale'],fi['aiChatResources']);return _0x2e8868['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isLoading','ck-hidden',_0x3db970=>!_0x3db970)]}}),_0x2e8868;}['render'](){super['render'](),this['loadResources']('');}['loadResources'](_0x1043ce){const _0x457ac0=_0x3dbf6d();this['_latestLoadResourcesUid']=_0x457ac0,this['fire']('loadSourceResources',{'sourceId':this['_source']['id'],'query':_0x1043ce,'uid':_0x457ac0}),this['isLoading']=!0x0;}['setResources'](_0x49d993,_0x2bd2d6){if(_0x2bd2d6&&_0x2bd2d6!==this['_latestLoadResourcesUid'])return;const _0x900591=this['_source']['useDefaultFiltering']?this['_searchView']['getQuery']():'';this['_resourcesListView']['setResources'](_0x49d993,_0x900591),_0x49d993['length']>=this['_searchInputVisibleFrom']&&!this['children']['has'](this['_searchSection'])&&this['children']['add'](this['_searchSection'],0x0),requestAnimationFrame(()=>{this['isLoading']=!0x1;});}['updateResourceState'](_0x1dc0c0,_0x300917){this['_resourcesListView']['updateResourceState'](_0x1dc0c0,_0x300917);}}const La='ck-ai-chat-context-controls__source-balloon-panel',Da='ck-button-icon\x20ck-button-back',Pa='ck-ai-header\x20ck-ai-header_small\x20ck-ai-header_source';class Oo{['_sourceResourceBalloons']=new Map();['_bodyCollection'];['_locale'];['_config'];constructor(_0x10f8dc,_0x3592a1,_0x4f4b56){this['_locale']=_0x10f8dc,this['_bodyCollection']=_0x3592a1,this['_config']=_0x4f4b56;}['showSourceResourcesBalloon']({source:_0xf6a0b5,withBackButton:_0x3e9ad4}){let _0x1c061a=this['_sourceResourceBalloons']['get'](_0xf6a0b5['id']);_0x1c061a||(_0x1c061a=this['_createSourceResourceBalloonPanel'](),this['_sourceResourceBalloons']['set'](_0xf6a0b5['id'],_0x1c061a),this['_setupSingleResourceBalloonClickOutsideHandler'](_0x1c061a)),this['_addSourceResourceContent']({'balloonPanel':_0x1c061a,'source':_0xf6a0b5,'withBackButton':_0x3e9ad4}),_0x1c061a['show']();const _0x598213=this['_config']['getTargetElement']();_0x598213&&_0x1c061a['pin']({'target':_0x598213,'limiter':this['_config']['getLimiterElement']()});}['populateSourceResourceBalloon'](_0x276647,_0x5f145f,_0x1e183a){const _0x26fc8d=this['_sourceResourceBalloons']['get'](_0x276647);if(!_0x26fc8d)return;const _0x4b1604=this['_getResourcesViewFromBalloon'](_0x26fc8d);_0x4b1604&&(_0x4b1604['setResources'](_0x5f145f,_0x1e183a),_0x4b1604['once']('change:isLoading',()=>{_0x26fc8d['pin']({'target':this['_config']['getTargetElement'](),'limiter':this['_config']['getLimiterElement']()});}));}['closeSourceResourceBalloon'](_0x2c919e){const _0x626063=this['_sourceResourceBalloons']['get'](_0x2c919e);_0x626063&&requestAnimationFrame(()=>{_0x626063['hide'](),this['_sourceResourceBalloons']['delete'](_0x2c919e),this['_config']['onBalloonClosed']();});}['isAnyResourceBalloonVisible'](){for(const _0x10b5c1 of this['_sourceResourceBalloons']['values']())if(_0x10b5c1['isVisible'])return!0x0;return!0x1;}['updateResourceState'](_0x543dd4,_0x22f31d,_0x543ff3){const _0x4e6073=this['_sourceResourceBalloons']['get'](_0x543dd4);if(!_0x4e6073||!_0x4e6073['isVisible'])return;const _0x5e4e1e=this['_config']['getTargetElement']();if(!_0x5e4e1e)return;_0x4e6073['pin']({'target':_0x5e4e1e,'limiter':this['_config']['getLimiterElement']()});const _0xa6913f=this['_getResourcesViewFromBalloon'](_0x4e6073);_0xa6913f&&_0xa6913f['updateResourceState'](_0x22f31d,_0x543ff3);}['destroy'](){for(const _0x49181d of this['_sourceResourceBalloons']['values']())_0x49181d['destroy']();this['_sourceResourceBalloons']['clear']();}['_createSourceResourceBalloonPanel'](){const _0xe94bb9=new _0x88aaab(this['_locale']);return _0xe94bb9['extendTemplate']({'attributes':{'class':La}}),this['_bodyCollection']['add'](_0xe94bb9),_0xe94bb9;}['_addSourceResourceContent']({balloonPanel:_0x184815,source:_0x2a507c,withBackButton:_0x2b917e}){_0x184815['content']['clear']();const _0x48c802=this['_createBalloonHeader']({'balloonPanel':_0x184815,'source':_0x2a507c,'withBackButton':_0x2b917e});_0x184815['content']['add'](_0x48c802);const _0x4a82f6=this['_createBalloonResourcesView'](_0x2a507c);_0x184815['content']['add'](_0x4a82f6);}['_createBalloonHeader']({balloonPanel:_0x897bd,source:_0x4a782b,withBackButton:_0xf37253}){const _0x23417a=new _0x156476(this['_locale'],{'label':_0x4a782b['label'],'class':Pa});return _0xf37253&&_0x23417a['children']['add'](this['_createBackButton'](_0x897bd),0x0),_0x23417a;}['_createBackButton'](_0xcd1800){const _0x4080e0=new _0x599e60(this['_locale']);return _0x4080e0['set']({'icon':_0x2e8801,'tooltip':i(this['_locale'],'AI_CHAT_CONTEXT_URL_BACK_TO_CONTEXT'),'tooltipPosition':'n','class':Da}),_0x4080e0['on']('execute',()=>{_0xcd1800['hide'](),this['_config']['onBackToContext']();}),_0x4080e0;}['_createBalloonResourcesView'](_0x4b0f06){const _0x50a51b=new lc(this['_locale'],{'source':_0x4b0f06,'searchInputVisibleFrom':this['_config']['searchInputVisibleFrom']});return _0x50a51b['on']('loadSourceResources',(_0x3fdb46,_0x3ad6fd)=>{this['_config']['onLoadSourceResources'](_0x3ad6fd);}),_0x50a51b['on']('addResourceToContext',(_0x24cb69,_0x33c8b2)=>{this['_config']['onResourceSelected'](_0x33c8b2['source'],_0x33c8b2['resource']),this['closeSourceResourceBalloon'](_0x4b0f06['id']);}),_0x50a51b;}['_getResourcesViewFromBalloon'](_0x13ada7){const _0xef79bc=_0x13ada7['content']['get'](0x1);return _0xef79bc instanceof lc?_0xef79bc:null;}['_setupSingleResourceBalloonClickOutsideHandler'](_0x58f326){_0x5e5264({'emitter':_0x58f326,'contextElements':[_0x58f326['element']],'callback':()=>{_0x58f326['hide'](),this['_config']['onBalloonClosed']();},'activator':()=>_0x58f326['isVisible']});}}const xs=['addDocumentToContext','addFileToContext','addUrlToContext','addResourceToContext','removeContextItem','loadSourceResources','executeCustomItemCallback'],Uo='ck-ai-chat-context-controls',Lo='ck-ai-chat-context-controls__pending-contexts',No='ck-ai-chat-context-controls__add-context-balloon-panel',Mo='ck-ai-chat-context-controls__add-context-button',Ho='ck-ai-chat-context-controls__url-balloon-panel',jo='ck-ai-chat-context-controls__balloon-button',Fo='ck-ai-chat-context-controls__balloon-button-source',Xo='ck-ai-chat-controls-button',Do='ck-ai-chat-context-chips-wrapper-balloon',$o='ck-ai-chat-controls_context_show-more-button',Wo='ck-ai-chat-context-controls__show-more-balloon-panel',qo='ck-ai-chat',zo=[_0x88aaab['defaultPositions']['northArrowSouthWest'],_0x88aaab['defaultPositions']['northArrowSouth'],_0x88aaab['defaultPositions']['northArrowSouthEast'],_0x88aaab['defaultPositions']['southArrowNorthWest'],_0x88aaab['defaultPositions']['southArrowNorth'],_0x88aaab['defaultPositions']['southArrowNorthEast']];class Is extends _0x5eeb09{['addContextButtonView'];['_currentContextsChips']=this['createCollection']();['_conversationContextsChips']=this['createCollection']();['_overflowManager'];['_addContextBalloonPanelView'];['_urlBalloonPanelView'];['_urlInputView'];['_resourcesBalloonView'];['_addContextBalloonConfig'];['_hasExactlyOneSource']=!0x1;['bodyCollection'];constructor(_0x5a5884,_0x2b20f9){super(_0x5a5884),this['bodyCollection']=_0x2b20f9['bodyCollection'],this['_currentContextsChips']=this['createCollection'](),this['_conversationContextsChips']=this['createCollection'](),this['addContextButtonView']=this['_createAddContextButtonView'](_0x5a5884),this['_addContextBalloonPanelView']=this['_createAddContextBalloonPanelView'](_0x5a5884),this['_urlBalloonPanelView']=this['_createUrlBalloonPanelView'](_0x5a5884),this['_resourcesBalloonView']=this['_createResourcesBalloonView'](_0x5a5884,_0x2b20f9);const _0x3b468b={'cssClasses':{'showMoreButton':$o,'showMoreBalloon':Wo,'overflowContainer':Do,'controlsButton':Xo}};this['_overflowManager']=new Ro(_0x5a5884,this['_currentContextsChips'],_0x3b468b,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'](_0x37f227,_0x396720){const _0x4c301c=this['_createContextButton'](_0x37f227,'current',!0x0,_0x396720);this['_addContextToCollection'](_0x4c301c,this['_currentContextsChips']),this['_overflowManager']['reorganizeChips']();}['removeContextItem'](_0x58f23f){this['_removeContextFromCollection'](_0x58f23f,this['_currentContextsChips']),this['_removeContextFromCollection'](_0x58f23f,this['_overflowManager']['overflowChips']),this['_overflowManager']['reorganizeChips']();}['setContextItemLoading'](_0x92edf4,_0x4c920d){let _0x42d422=this['_currentContextsChips']['find'](_0x3d1340=>_0x3d1340['id']===_0x92edf4);_0x42d422||(_0x42d422=this['_overflowManager']['overflowChips']['find'](_0x3d5edf=>_0x3d5edf['id']===_0x92edf4)),_0x42d422&&(_0x42d422['isLoading']=_0x4c920d);}['setConversationContext'](_0x24a7a8){this['_conversationContextsChips']['clear']();for(const _0x5494cc of _0x24a7a8){const _0x6eecf2=this['_createContextButton'](_0x5494cc,'conversation',!0x1,!0x1);this['_addContextToCollection'](_0x6eecf2,this['_conversationContextsChips']);}}['clearCurrentContextItems'](){this['_currentContextsChips']['clear'](),this['_overflowManager']['clear']();}['clearConversationContextItems'](){this['_conversationContextsChips']['clear']();}['updateResourceState'](_0x10f70c,_0x5b8bae,_0x1ec3bd){this['_resourcesBalloonView']['updateResourceState'](_0x10f70c,_0x5b8bae,_0x1ec3bd);}['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:_0xd93db2,withBackButton:_0x597dac}){this['_resourcesBalloonView']['showSourceResourcesBalloon']({'source':_0xd93db2,'withBackButton':_0x597dac}),this['addContextButtonView']['isOn']=!0x0;}['populateSourceResourceBalloon'](_0x23626b,_0x2f4a9a,_0x197481,_0x53b232){this['_resourcesBalloonView']['populateSourceResourceBalloon'](_0x23626b,_0x197481,_0x53b232);}['closeSourceResourceBalloon'](_0x1112cb){this['_resourcesBalloonView']['closeSourceResourceBalloon'](_0x1112cb),this['addContextButtonView']['isOn']=!0x1;}['setAddContextOptions'](_0x4d13b1){this['_setBalloonPanelContent'](this['_addContextBalloonPanelView'],this['locale'],_0x4d13b1),this['_setAddContextButtonEnabled'](_0x4d13b1);}['_setAddContextButtonEnabled'](_0x2c2fa1){const _0x1614b4=!_0x2c2fa1['document']['isHidden']&&_0x2c2fa1['document']['enabled'],_0x4166eb=_0x2c2fa1['urls']['enabled'],_0x385558=_0x2c2fa1['files']['enabled'],_0x23c390=_0x2c2fa1['sources']['length']>0x0,_0x297281=_0x2c2fa1['customItems']&&_0x2c2fa1['customItems']['length']>0x0;this['addContextButtonView']['isEnabled']=_0x1614b4||_0x4166eb||_0x385558||_0x23c390||_0x297281;}['_setupTemplate'](){this['setTemplate']({'tag':'div','attributes':{'class':[Uo,'ck-reset_all-excluded']},'children':[{'tag':'div','attributes':{'class':Lo},'children':this['_currentContextsChips']}]});}['_bindEventHandlers'](){this['addContextButtonView']['on']('execute',()=>{this['_handleAddContextButtonClick']();});}['_createAddContextButtonView'](_0x2510b0){const _0x3d3c66=new _0x599e60(_0x2510b0);return _0x3d3c66['set']({'label':i(_0x2510b0,'AI_CHAT_CONTEXT_ADD_CONTEXT'),'class':Xo+'\x20'+Mo,'icon':_0x11b4ed,'isToggleable':!0x0,'tooltip':!0x0,'tooltipPosition':'sw'}),_0x3d3c66;}['_createAddContextBalloonPanelView'](_0x113cb4){return this['_createBaseBalloonPanel'](_0x113cb4,No);}['_createUrlBalloonPanelView'](_0x4ed28){const _0xc17454=this['_createBaseBalloonPanel'](_0x4ed28,Ho);return this['_addUrlContent'](_0xc17454,_0x4ed28),_0xc17454;}['_createResourcesBalloonView'](_0x3d9623,_0x488c11){const _0x3d0f86={'searchInputVisibleFrom':_0x488c11['searchInputVisibleFrom'],'onBackToContext':()=>{this['showAddContextBalloonPanel'](),this['_addContextBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':zo});},'onResourceSelected':(_0x4156dd,_0xf6d08f)=>{this['fire']('addResourceToContext',{'source':_0x4156dd,'resource':_0xf6d08f});},'onLoadSourceResources':_0x201bd4=>{this['fire']('loadSourceResources',_0x201bd4);},'onBalloonClosed':()=>{this['addContextButtonView']['isOn']=!0x1;},'getLimiterElement':()=>this['_getLimiterElement'](),'getTargetElement':()=>this['addContextButtonView']['element']};return new Oo(_0x3d9623,_0x488c11['bodyCollection'],_0x3d0f86);}['_getLimiterElement'](){return this['element']?.['closest']('.'+qo)||document['body'];}['_createBaseBalloonPanel'](_0x2ad4c6,_0x73d445){const _0x181f7f=new _0x88aaab(_0x2ad4c6);return _0x181f7f['extendTemplate']({'attributes':{'class':_0x73d445}}),this['bodyCollection']['add'](_0x181f7f),_0x181f7f;}['_setBalloonPanelContent'](_0x7eba9,_0x39f0ee,_0x155d5a){if(_0x7eba9['content']['clear'](),!_0x155d5a['document']['isHidden']&&_0x155d5a['document']['enabled']){const _0x7932d0=this['_createBalloonButton'](_0x39f0ee,{'label':i(_0x39f0ee,'AI_CHAT_CONTEXT_CURRENT_DOCUMENT'),'icon':_0x170780});_0x7932d0['on']('execute',()=>{this['fire']('addDocumentToContext'),this['hideAddContextBalloonPanel']();}),_0x7eba9['content']['add'](_0x7932d0);}if(_0x155d5a['urls']['enabled']){const _0x2723d4=this['_createBalloonButton'](_0x39f0ee,{'label':i(_0x39f0ee,'AI_CHAT_CONTEXT_URL_LABEL'),'icon':_0x4db515});_0x2723d4['on']('execute',()=>{this['hideAddContextBalloonPanel'](),this['showUrlBalloonPanel'](),this['_urlBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':zo}),this['_urlInputView']['focus']();}),_0x7eba9['content']['add'](_0x2723d4);}if(_0x155d5a['files']['enabled']){const _0x4aeefd=new _0x1fb784(_0x39f0ee);_0x4aeefd['set']({'label':i(_0x39f0ee,'AI_CHAT_CONTEXT_FILE_LABEL'),'icon':_0x350538,'withText':!0x0,'tooltip':!0x0,'class':jo,'allowMultipleFiles':!0x0}),_0x4aeefd['on']('execute',()=>{this['hideAddContextBalloonPanel']();}),_0x4aeefd['on']('done',(_0x41b531,_0x316f02)=>{this['fire']('addFileToContext',_0x316f02);}),_0x4aeefd['tooltip']=!0x0,_0x7eba9['content']['add'](_0x4aeefd);}for(const _0x39724a of _0x155d5a['sources']){const _0x45c2aa=this['_createBalloonButton'](_0x39f0ee,{'label':_0x39724a['label'],'icon':_0x39724a['icon']||_0x1e1165,'type':'source'});_0x7eba9['content']['add'](_0x45c2aa),_0x45c2aa['on']('execute',()=>{this['hideAddContextBalloonPanel'](),this['_showSourceResourcesBalloon']({'source':_0x39724a,'withBackButton':!this['_hasExactlyOneSource']});});}for(const _0x3aa9ef of _0x155d5a['customItems']||[]){const _0x10525f=this['_createBalloonButton'](_0x39f0ee,{'label':_0x3aa9ef['label'],'icon':_0x3aa9ef['icon']||_0x1e1165,'type':'customItem'});_0x7eba9['content']['add'](_0x10525f),_0x10525f['on']('execute',()=>{this['hideAddContextBalloonPanel'](),this['fire']('executeCustomItemCallback',_0x3aa9ef);});}this['_hasExactlyOneSource']=0x1===_0x7eba9['content']['length'],this['_urlInputView']['withBackButton']=!this['_hasExactlyOneSource'];}['_addUrlContent'](_0x5a2fad,_0x71e73c){this['_urlInputView']=new Po(_0x71e73c),this['_urlInputView']['on']('submitUrl',(_0x2f7214,_0x4bebbd)=>{this['_handleUrlSubmit'](_0x4bebbd);}),this['_urlInputView']['on']('cancel',()=>{this['hideUrlBalloonPanel'](),this['_hasExactlyOneSource']||(this['showAddContextBalloonPanel'](),this['_addContextBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':zo}));}),this['_urlInputView']['on']('refreshBalloon',()=>{this['_urlBalloonPanelView']['isVisible']&&this['_urlBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':zo});}),_0x5a2fad['content']['add'](this['_urlInputView']);}['_createBalloonButton'](_0x19e7dc,_0xa3af12){const _0xdcb240='source'===_0xa3af12['type']?new Ha(_0x19e7dc):new _0x599e60(_0x19e7dc);return _0xdcb240['set']({'label':_0xa3af12['label'],'icon':_0xa3af12['icon'],'withText':!0x0,'tooltip':!0x0,'tooltipPosition':'sw','class':jo}),_0xdcb240;}['_setupAllBalloonClickOutsideHandlers'](){this['_setupAddContextBalloonClickOutsideHandler'](),this['_setupUrlBalloonClickOutsideHandler']();}['_setupUrlBalloonClickOutsideHandler'](){_0x5e5264({'emitter':this['_urlBalloonPanelView'],'contextElements':[this['_urlBalloonPanelView']['element']],'callback':()=>{this['hideUrlBalloonPanel']();},'activator':()=>this['_urlBalloonPanelView']['isVisible']});}['_toggleAddContextBalloon'](_0x5a2bdf){const _0x27c549=this['_addContextBalloonConfig'];_0x27c549['buttonView']['isOn']=_0x5a2bdf,_0x5a2bdf?_0x27c549['balloonView']['show']():_0x27c549['balloonView']['hide']();}['_setupAddContextBalloonClickOutsideHandler'](){const {balloonView:_0x32c77d,buttonView:_0x5b369c,hideMethod:_0x4b67bd}=this['_addContextBalloonConfig'];_0x5e5264({'emitter':_0x32c77d,'contextElements':[_0x32c77d['element'],_0x5b369c['element']],'callback':()=>{_0x4b67bd();},'activator':()=>_0x5b369c['isOn']&&!this['_urlBalloonPanelView']['isVisible']&&!this['_resourcesBalloonView']['isAnyResourceBalloonVisible']()});}['_createContextButton'](_0x5b3495,_0x15c4e5,_0x3bf9c3=!0x1,_0x2f6f5f=!0x1){const _0x446b46='conversation'===_0x15c4e5||!0x0===_0x5b3495['isReadOnly'],_0x19abc4=new Vo(this['locale'],_0x5b3495,_0x446b46,_0x3bf9c3,_0x2f6f5f);return _0x446b46||_0x19abc4['on']('removeContextItemChip',()=>{this['fire']('removeContextItem',_0x19abc4['id']);}),_0x19abc4;}['_addContextToCollection'](_0x4724b6,_0x432ed3){_0x432ed3['add'](_0x4724b6,0x0);}['_removeContextFromCollection'](_0x93d1a5,_0x221e84){const _0x14ebd5=_0x221e84['find'](_0x47399c=>_0x47399c['id']===_0x93d1a5);_0x14ebd5&&_0x221e84['remove'](_0x14ebd5);}['_handleAddContextButtonClick'](){this['addContextButtonView']['isOn']?this['hideAddContextBalloonPanel']():(this['showAddContextBalloonPanel'](),this['_addContextBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':zo}),this['_hasExactlyOneSource']&&this['_addContextBalloonPanelView']['content']['get'](0x0)?.['fire']('execute'));}['_handleUrlSubmit'](_0x5ea5eb){this['_urlInputView']['clear'](),this['hideUrlBalloonPanel'](),this['fire']('addUrlToContext',_0x5ea5eb);}}class Ha extends _0x599e60{['arrowView'];constructor(_0x41e210){super(_0x41e210),this['set']({'withText':!0x0,'role':'menuitem'}),this['arrowView']=this['_createArrowView'](),this['extendTemplate']({'attributes':{'class':[Fo]}});}['render'](){super['render'](),this['children']['add'](this['arrowView']);}['_createArrowView'](){const _0x961736=new _0x528adc();return _0x961736['content']=_0x1835f6,_0x961736['extendTemplate']({'attributes':{'class':Fo+'__arrow'}}),_0x961736;}}class Cs extends _0x5eeb09{['_cancelButtonView'];['_loaderView'];constructor(_0x391751){super(_0x391751),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 _0x27ea17=new _0x599e60(this['locale']);return _0x27ea17['set']({'label':i(this['locale'],'AI_CHAT_STOP_GENERATING'),'withText':!0x0,'class':'ck-ai-button-secondary\x20ck-ai-button-stop-generating','icon':_0x21bbec}),_0x27ea17['on']('execute',()=>{this['fire']('abortPromptStream');}),_0x27ea17;}['_createLoaderView'](){const _0x270507=new _0x5eeb09(this['locale']);return _0x270507['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')}]}),_0x270507;}}class ki extends _0x5eeb09{['_contextPanelView'];['_promptInputView'];['_promptCapabilitiesView'];['_loaderView'];['_modelUnavailableMessageView'];['_shouldRestorePromptInputFocus'];constructor(_0x5a7fe2,_0x27b941){super(_0x5a7fe2),this['_contextPanelView']=this['_createContextPanelView'](_0x5a7fe2,{'bodyCollection':_0x27b941['bodyCollection'],'searchInputVisibleFrom':_0x27b941['contextResourcesSearchInputVisibleFrom']}),this['_promptInputView']=this['_createPromptInputView'](_0x5a7fe2),this['_promptCapabilitiesView']=this['_createPromptCapabilitiesView'](_0x5a7fe2),this['_loaderView']=this['_createLoaderView'](_0x5a7fe2),this['_modelUnavailableMessageView']=this['_createModelUnavailableMessageView'](_0x5a7fe2),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'](...xs)['to'](this),this['set']('isModelAvailable',!0x0),this['set']('isDisabled',!0x1);const _0x219df7=this['bindTemplate'];this['setTemplate']({'tag':'form','attributes':{'class':['ck','ck-ai-chat-controls',_0x219df7['if']('isDisabled','ck-ai-chat-controls-disabled')]},'children':[{'tag':'div','attributes':{'class':[_0x219df7['if']('isLoading','ck-hidden',_0x554c89=>_0x554c89||!this['isModelAvailable']),_0x219df7['if']('isModelAvailable','ck-hidden',_0x522510=>!_0x522510||this['isLoading'])]},'children':[this['_contextPanelView'],this['_promptInputView'],this['_promptCapabilitiesView']]},{'tag':'div','attributes':{'class':[_0x219df7['if']('isLoading','ck-hidden',_0xc1aa5c=>!_0xc1aa5c)]},'children':[this['_loaderView']]},{'tag':'div','attributes':{'class':[_0x219df7['if']('isModelAvailable','ck-hidden',_0x40c865=>_0x40c865)]},'children':[this['_modelUnavailableMessageView']]}]}),_0x5e5264({'emitter':this['_promptInputView'],'activator':()=>this['isLoading'],'contextElements':()=>[this['element']],'callback':()=>{this['_shouldRestorePromptInputFocus']=!0x1;}}),this['on']('change:isLoading',this['_handlePromptInputFocus'],{'priority':'low'});}['_createContextPanelView'](_0x33925e,_0x34474d){return new Is(_0x33925e,_0x34474d);}['_createPromptInputView'](_0x311d3a){return new _s(_0x311d3a,this['_contextPanelView']['addContextButtonView']);}['_createPromptCapabilitiesView'](_0x2ba05d){return new vs(_0x2ba05d);}['_createLoaderView'](_0x42c67e){return new Cs(_0x42c67e);}['_createModelUnavailableMessageView'](_0x5540a8){const _0x2e6435=new As(_0x5540a8);return _0x2e6435['delegate']('startConversation')['to'](this),_0x2e6435;}['_handlePromptInputFocus'](_0x336ec1,_0x328fa8,_0x1867de){_0x1867de?this['_shouldRestorePromptInputFocus']=!0x0:this['_shouldRestorePromptInputFocus']&&this['_promptInputView']['focus']();}['addContextItem'](_0x245fa7,_0x420041){this['_contextPanelView']['addContextItem'](_0x245fa7,_0x420041);}['removeContextItem'](_0x36e15f){this['_contextPanelView']['removeContextItem'](_0x36e15f);}['setContextItemLoading'](_0x15fe8d,_0x53bc68){this['_contextPanelView']['setContextItemLoading'](_0x15fe8d,_0x53bc68);}['setIsUploadInProgress'](_0xc4da1a){this['_promptInputView']['setIsUploadInProgress'](_0xc4da1a);}['setConversationContext'](_0x3dcbfb){this['_contextPanelView']['setConversationContext'](_0x3dcbfb);}['clearPendingContextUI'](){this['_contextPanelView']['clearCurrentContextItems']();}['clearConversationContextUI'](){this['_contextPanelView']['clearConversationContextItems']();}['updateResourceState'](_0x165b1c,_0x3353a5,_0x4fb347){this['_contextPanelView']['updateResourceState'](_0x165b1c,_0x3353a5,_0x4fb347);}['setWebSearch'](_0x4a8a5f){this['_promptCapabilitiesView']['setWebSearch'](_0x4a8a5f);}['setReasoning'](_0x2b081b){this['_promptCapabilitiesView']['setReasoning'](_0x2b081b);}['resetMessageInput'](){this['_promptInputView']['reset']();}['setAddContextOptions'](_0x241fc7){this['_contextPanelView']['setAddContextOptions'](_0x241fc7);}['setInputPlaceholder'](_0x350ca5){this['_promptInputView']['setPlaceholderText'](_0x350ca5);}['setModelList'](_0x21f7c0,_0x5120a9){this['_promptCapabilitiesView']['setModelList'](_0x21f7c0,_0x5120a9);}['setModel'](_0xf32aea){_0xf32aea?(this['isModelAvailable']=!0x0,this['_promptCapabilitiesView']['setModel'](_0xf32aea)):this['isModelAvailable']=!0x1;}['enableModelSelector'](){this['_promptCapabilitiesView']['enableModelSelector']();}['disableModelSelector'](_0x1947a6){this['_promptCapabilitiesView']['disableModelSelector'](_0x1947a6);}['populateSourceResourceBalloon'](_0x1f6785,_0x47b634,_0x4ff6f4,_0x178090){this['_contextPanelView']['populateSourceResourceBalloon'](_0x1f6785,_0x47b634,_0x4ff6f4,_0x178090);}['closeSourceResourceBalloon'](_0x2527ec){this['_contextPanelView']['closeSourceResourceBalloon'](_0x2527ec);}['focusPromptInput'](_0x34a6ad=!0x1){this['_promptInputView']['focus'](_0x34a6ad);}['setPromptInputValue'](_0x38004c){this['_promptInputView']['queryView']['fieldView']['reset'](),this['_promptInputView']['queryView']['fieldView']['value']=_0x38004c;}}class As extends _0x5eeb09{constructor(_0x5254e8){super(_0x5254e8);const _0x53ae99=new _0x599e60(_0x5254e8);_0x53ae99['set']({'label':i(this['locale'],'AI_CHAT_MODEL_UNAVAILABLE_MESSAGE_BUTTON'),'withText':!0x0,'class':['ck-ai-chat-controls__start-new-chat-button'],'tooltip':''}),_0x53ae99['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'},_0x53ae99]}]});}}class vi extends _0x156476{['conversationStartButton'];['resizeButton'];constructor(_0x17e85e,_0x282ba4){super(_0x17e85e,{'label':i(_0x17e85e,'AI_CHAT_HEADING'),'class':'ck-ai-header\x20ck-ai-header_chat','icon':vt}),this['set']('isMaximized',!0x1),this['conversationStartButton']=this['_createStartConversationButton'](_0x17e85e),this['children']['add'](this['conversationStartButton']),_0x282ba4&&(this['resizeButton']=Hs(_0x17e85e,this),this['children']['add'](this['resizeButton']));}['_createStartConversationButton'](_0x216505){const _0x2dc802=new _0x599e60(_0x216505);return _0x2dc802['set']({'label':i(this['locale'],'AI_CHAT_LABEL_NEW_CHAT'),'withText':!0x0,'icon':_0xa9fd1f,'class':'ck-ai-chat__start-conversation'}),_0x2dc802['on']('execute',()=>{this['fire']('startConversation');}),_0x2dc802;}}class bi extends _0x5eeb09{constructor(_0x2fe52d){super(_0x2fe52d),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-disclaimer']},'children':[{'tag':'p','attributes':{'class':['ck','ck-ai-disclaimer__content']},'children':[{'text':i(_0x2fe52d,'AI_DISCLAIMER_TEXT')}]}]});}}class Pt extends _0x5eeb09{['chatHeader'];['chatFeed'];['chatControls'];['chatDisclaimer'];['_bodyCollection'];constructor(_0x2d5895,_0x3a82b1){super(_0x2d5895),this['_bodyCollection']=new _0x2f55eb(_0x2d5895),this['_bodyCollection']['attachToDom'](),this['chatHeader']=new vi(_0x2d5895,_0x3a82b1['showResizeButton']),this['chatHeader']['delegate'](...bt)['to'](this),this['chatFeed']=new ji(_0x2d5895,this['_bodyCollection']),this['chatFeed']['delegate'](...bt)['to'](this),this['chatControls']=new ki(_0x2d5895,{'bodyCollection':this['_bodyCollection'],'contextResourcesSearchInputVisibleFrom':_0x3a82b1['contextResourcesSearchInputVisibleFrom']}),this['chatControls']['delegate'](...bt)['to'](this),this['chatDisclaimer']=new bi(_0x2d5895),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-ai-chat','ck-rounded-corners'],'dir':_0x2d5895['uiLanguageDirection']},'children':[this['chatHeader'],this['chatFeed'],this['chatControls'],this['chatDisclaimer']]});}['populateSourceResourceBalloon'](_0x54543e,_0x696530,_0x126ae4,_0x5956f7){this['chatControls']['populateSourceResourceBalloon'](_0x54543e,_0x696530,_0x126ae4,_0x5956f7);}['closeSourceResourceBalloon'](_0x50fe27){this['chatControls']['closeSourceResourceBalloon'](_0x50fe27);}['destroy'](){this['_bodyCollection']['detachFromDom'](),super['destroy']();}}class ct extends _0x34a98c{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(_0x3752df){super(_0x3752df);const _0x2dd100=this['context']['plugins']['get']('AITabs');this['set']('isBusy',!0x1),this['_promiseQueue']=new z(),this['_view']=new Pt(this['context']['locale'],{'showResizeButton':_0x2dd100['showResizeButton'],'contextResourcesSearchInputVisibleFrom':this['context']['config']['get']('ai.chat.context.searchInputVisibleFrom')}),this['_view']['delegate'](...bt)['to'](this),this['_view']['on']('toggleSuggestionDisplayMode',(_0x38d145,{showDiff:_0x2b0982})=>{this['showDiff']=_0x2b0982;}),_0x2dd100['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',_0x1653cc=>_0x1653cc),this['_view']['chatFeed']['bind']('isPending')['to'](this,'isBusy',_0x4a38e9=>_0x4a38e9),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder']()),this['bind']('isModelAvailable')['to'](this['_view']['chatControls'],'isModelAvailable');}['destroy'](){super['destroy'](),this['_titleAnimationInterval']&&clearInterval(this['_titleAnimationInterval']);}['createConversation'](_0x52dc9b){const _0x40f941=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'](_0x52dc9b['availableModels'],!this['context']['config']['get']('ai.models.showModelSelector')),this['addFeedItemStaticMessage']({'id':'conversation-start','staticMessage':_0x40f941}),this['fire']('conversationCreated');}['addFeedItemStaticMessage']({id:_0x3d6555,staticMessage:_0x10572f}){this['_view']['chatFeed']['addItem']('ai-reply',{'id':_0x3d6555,'initialContent':'<p>'+_0x10572f+'</p>'});}['addFeedItemUserMessage'](_0x26edb1){const _0x1cb443=_0x26edb1['attributes']?.['displayedPrompt']||_0x26edb1['userMessage'];this['_view']['chatFeed']['addItem']('user-message',{'contextItems':Array['from'](_0x26edb1['contextItems']['values']()),'initialContent':'<p>'+_0x1cb443+'</p>','id':_0x26edb1['id']});}['addFeedItemError']({errorMessage:_0x5090be,id:_0x309a3d}){this['_view']['chatFeed']['addItem']('error-message',{'initialContent':'<p>'+_0x5090be+'</p>','id':_0x309a3d});}['addFeedItemAIReply'](_0x5cba0f){return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('ai-reply',{'id':_0x5cba0f['interactionId']+':'+_0x5cba0f['id']}),this['clearLoadingMessage']();});}async['addFeedItemAISuggestion'](_0x52bd54){const _0x164db0=T(this['context']);let _0x111430=_0x164db0['config']['get']('ai.availableReplyActions')||[...ot];if(_0x164db0['plugins']['has']('TrackChanges')){if(!this['_isTrackChangesCommandValueBound']){this['_isTrackChangesCommandValueBound']=!0x0;const _0x45e6b2=_0x164db0['commands']['get']('trackChanges');this['_view']['chatFeed']['bind']('isTrackChangesOn')['to'](_0x45e6b2,'value');}}else _0x111430=_0x111430['filter'](_0x2f166d=>'insertSuggestion'!=_0x2f166d);return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('ai-suggestion-reply',{'id':_0x52bd54['interactionId']+':'+_0x52bd54['id'],'areActionsDisabled':_0x52bd54['areActionsDisabled'],'showDiff':this['showDiff'],'availableActions':_0x111430}),this['clearLoadingMessage']();});}['addFeedInteractionHeader'](_0x32b1d0,_0x413bbb){const _0x464ea3=this['_view']['chatFeed']['children']['last'];if(_0x464ea3 instanceof Mt)return this['_view']['chatFeed']['children']['remove'](_0x464ea3),void this['_view']['chatFeed']['addItem']('interaction-header',{'id':_0x32b1d0['id'],'capabilities':{'isWebSearchEnabled':_0x464ea3['capabilities']['isWebSearchEnabled']||_0x413bbb['isWebSearchEnabled'],'isReasoningEnabled':_0x464ea3['capabilities']['isReasoningEnabled']||_0x413bbb['isReasoningEnabled']}});this['_view']['chatFeed']['addItem']('interaction-header',{'id':_0x32b1d0['id'],'capabilities':_0x413bbb});}async['addFeedItemCustomElement'](_0x47b96c,_0x312b8f){let _0xb70653;return await this['_promiseQueue']['enqueue'](async()=>{_0xb70653=this['_view']['chatFeed']['addItem']('custom-element',{'content':_0x47b96c,'id':_0x312b8f});}),_0xb70653;}['removeFeedItem'](_0x4f0ac2){this['_view']['chatFeed']['removeItem'](_0x4f0ac2);}['hasFeedItem'](_0x3cd4ae){return this['_view']['chatFeed']['hasItem'](_0x3cd4ae);}['updateFeedInteractionHeader'](_0xc55f8b){const _0x381432=this['_view']['chatFeed']['children']['find'](_0x4a3b7e=>_0x4a3b7e['options']['id']==_0xc55f8b['id']&&_0x4a3b7e instanceof Mt);_0x381432&&_0x381432['set']('isVisible',_0xc55f8b['isVisible']);}async['updateFeedItemAIReplyContent'](_0x410db2){const _0x55f94c=_0x410db2['renderingStrategy']||this['feedItemRenderingStrategy'];return this['_promiseQueue']['enqueue'](async _0x2b4a42=>{await this['_view']['chatFeed']['updateReplyItem']({..._0x410db2,'abortSignal':_0x2b4a42,'renderingStrategy':_0x55f94c}),_0x410db2['isDone']&&this['markFeedItemAsDone'](_0x410db2['id']);});}['updateFeedItemAIReplySources'](_0x39d956,_0x553d9d){this['_view']['chatFeed']['updateWebSources'](_0x39d956,_0x553d9d);}async['updateFeedItemAIReplySuggestionContent'](_0x32e99a){const _0x47c3bd=_0x32e99a['renderingStrategy']||this['feedItemRenderingStrategy'];return this['_promiseQueue']['enqueue'](async _0x5cd336=>{await this['_view']['chatFeed']['updateSuggestionItem']({..._0x32e99a,'abortSignal':_0x5cd336,'renderingStrategy':_0x47c3bd}),_0x32e99a['isDone']&&this['markFeedItemAsDone'](_0x32e99a['id']);});}['updateFeedItemAIReplySuggestionPartState'](_0x4d5ddf){this['_view']['chatFeed']['updateSuggestionPartState'](_0x4d5ddf);}['setFeedItemAIReplySuggestionPartActive'](_0x3ecad9){this['_view']['chatFeed']['setSuggestionPartActive'](_0x3ecad9);}['markFeedItemAsDone'](_0x44384b){this['_view']['chatFeed']['markItemAsDone'](_0x44384b);}['removeFeedInteraction'](_0x183d2d){this['_view']['chatFeed']['getItemIds']()['filter'](_0x3d06fa=>_0x3d06fa['startsWith'](_0x183d2d))['forEach'](_0x314a48=>this['_view']['chatFeed']['removeItem'](_0x314a48));}['startInteraction'](){const _0x2f2412=this['prepareLoadingMessage']({'isWebSearchEnabled':!0x1,'isReasoningEnabled':!0x1});this['setLoadingMessage'](_0x2f2412),this['_view']['chatControls']['disableModelSelector'](!this['context']['config']['get']('ai.models.showModelSelector')),this['isBusy']=!0x0,this['_view']['chatFeed']['startAutoScroll']();}['stopInteraction'](_0x27f80b){this['_promiseQueue']['abort'](),this['_view']['chatFeed']['getItemIds']()['filter'](_0x3074b8=>_0x3074b8['startsWith'](_0x27f80b['id']))['forEach'](_0x8cf06e=>this['markFeedItemAsDone'](_0x8cf06e)),this['isBusy']=!0x1,this['_view']['chatFeed']['stopAutoScroll']();}async['finishInteraction'](){return this['_promiseQueue']['queueEmptyPromise']['then'](()=>{this['isBusy']=!0x1,this['_view']['chatFeed']['stopAutoScroll']();});}['addContextItem'](_0x26652c,_0x3cb82d){this['_view']['chatControls']['addContextItem'](_0x26652c,_0x3cb82d);}['removeContextItem'](_0xe2cb76){this['_view']['chatControls']['removeContextItem'](_0xe2cb76);}['setContextItemLoading'](_0x30859f,_0x137aea){this['_view']['chatControls']['setContextItemLoading'](_0x30859f,_0x137aea);}['setIsUploadInProgress'](_0x3cc05d){this['_view']['chatControls']['setIsUploadInProgress'](_0x3cc05d);}['setConversationContext'](_0x310bdd){this['_view']['chatControls']['setConversationContext'](_0x310bdd);}['clearPendingContextUI'](){this['_view']['chatControls']['clearPendingContextUI']();}['clearConversationContextUI'](){this['_view']['chatControls']['clearConversationContextUI']();}['updateResourceState'](_0x41ca92,_0x2b23a2,_0x144763){this['_view']['chatControls']['updateResourceState'](_0x41ca92,_0x2b23a2,_0x144763);}['resetMessageInput'](){this['_view']['chatControls']['resetMessageInput'](),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder']());}['setAddContextOptions'](_0x31cb36){this['_view']['chatControls']['setAddContextOptions'](_0x31cb36);}['updateCapabilities'](_0xc1c76b){this['_view']['chatControls']['setWebSearch'](_0xc1c76b['isWebSearchEnabled']),this['_view']['chatControls']['setReasoning'](_0xc1c76b['isReasoningEnabled']),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder'](_0xc1c76b));}['setSelectedModel'](_0x3127b2,_0x4c54f4){this['_view']['chatControls']['setModel'](_0x3127b2),_0x4c54f4&&this['_view']['chatControls']['disableModelSelector'](!0x1);}['setFeedItemRenderingStrategy'](_0xcd69f1){this['feedItemRenderingStrategy']=_0xcd69f1;}['toggleLoadingSkeleton'](_0x2de83c){this['_view']['chatFeed']['toggleLoadingSkeleton'](_0x2de83c);}['resetConversationTitle'](){this['setConversationTitle'](i(this['context']['locale'],'AI_CHAT_HEADING'));}['setConversationTitle'](_0x5e1b27,_0x53e338=!0x1){if(_0x53e338&&!Rt()&&_0x5e1b27['length'])return this['_view']['chatHeader']['label']='',void this['_animateConversationTitle'](_0x5e1b27);this['_view']['chatHeader']['label']=_0x5e1b27;}['setLoadingMessage'](_0x2e34c0){this['_view']['chatFeed']['setLoadingMessage'](_0x2e34c0);}['clearLoadingMessage'](){this['_view']['chatFeed']['setLoadingMessage']('');}['_animateConversationTitle'](_0x536f64){let _0x11b155=0x0;clearInterval(this['_titleAnimationInterval']),this['_titleAnimationInterval']=setInterval(()=>{this['_view']['chatHeader']['label']=this['_view']['chatHeader']['label']+_0x536f64[_0x11b155],_0x11b155++,_0x11b155===_0x536f64['length']&&clearInterval(this['_titleAnimationInterval']);},0x1e);}['setIsMaximized'](_0x2e8b39){this['_view']['chatHeader']['isMaximized']=_0x2e8b39;}['prepareLoadingMessage'](_0x376feb){return _0x376feb['isWebSearchEnabled']&&_0x376feb['isReasoningEnabled']?i(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH_REASONING'):_0x376feb['isWebSearchEnabled']?i(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH'):_0x376feb['isReasoningEnabled']?i(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_REASONING'):i(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_REGULAR');}['_getInputPlaceholder'](_0x20a18d){return _0x20a18d?_0x20a18d['isWebSearchEnabled']&&_0x20a18d['isReasoningEnabled']?i(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH_REASONING'):_0x20a18d['isWebSearchEnabled']?i(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH'):_0x20a18d['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'](_0x466343,_0x1daa7d,_0x51cf8f,_0x204837){this['_view']['populateSourceResourceBalloon'](_0x466343,_0x1daa7d,_0x51cf8f,_0x204837);}['closeSourceResourceBalloon'](_0x553f66){this['_view']['closeSourceResourceBalloon'](_0x553f66);}['setPromptInputValue'](_0x8d959f){this['_view']['chatControls']['setPromptInputValue'](_0x8d959f);}['focusPromptInput'](_0x51d50d=!0x1){this['_view']['chatControls']['focusPromptInput'](_0x51d50d);}['scrollFeedToSuggestion'](_0x96f48c,_0x261291){this['_view']['chatFeed']['scrollToSuggestion'](_0x96f48c,_0x261291);}['startAutoScroll'](){this['_view']['chatFeed']['startAutoScroll']();}['disableControls'](){this['_view']['chatControls']['isDisabled']=!0x0;}['enableControls'](){this['_view']['chatControls']['isDisabled']=!0x1;}}class Ri extends _0x20d034{['sections'];constructor(_0x3b0456,_0x1a49bc){super(_0x3b0456),this['sections']=_0x1a49bc,this['items']['addMany'](this['sections']),this['extendTemplate']({'attributes':{'class':['ck-ai-chat-history__sections']}});}['filter'](_0x1f387e){let _0x309237=0x0,_0xdfa6cd=0x0;for(const _0x20dbf0 of this['sections']){const {resultsCount:_0x5d08a7,totalItemsCount:_0x11ca35}=_0x20dbf0['filter'](_0x1f387e);_0x309237+=_0x5d08a7,_0xdfa6cd+=_0x11ca35;}return{'resultsCount':_0x309237,'totalItemsCount':_0xdfa6cd};}}class Mi extends _0x8981d2{['title'];['itemsViews'];['_itemsListView'];constructor(_0x49bccd,{title:_0x1980ba,items:_0x20109f}){super(_0x49bccd);const _0x31f37f=this['bindTemplate'];this['set']('isVisible',!0x0),this['title']=_0x1980ba,this['itemsViews']=_0x20109f;const _0x47791b=new _0x5eeb09(_0x49bccd);_0x47791b['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-history__section-title']},'children':[this['title']]}),this['_itemsListView']=new _0x20d034(_0x49bccd),this['_itemsListView']['items']['addMany'](this['itemsViews']),this['setTemplate']({'tag':'li','attributes':{'class':['ck-ai-chat-history__section',_0x31f37f['if']('isVisible','ck-hidden',_0x501eb5=>!_0x501eb5)]},'children':[_0x47791b,this['_itemsListView']]});}['filter'](_0x5a46d5){const _0x1ce2dd=this['itemsViews']['length'];let _0x4865a7=0x0;for(const _0x24f7bf of this['itemsViews']){if(_0x5a46d5){const _0x160047=_0x24f7bf['isMatching'](_0x5a46d5);_0x24f7bf['isVisible']=!!_0x160047,_0x24f7bf['highlightText'](_0x5a46d5);}else _0x24f7bf['isVisible']=!0x0,_0x24f7bf['highlightText'](null);_0x24f7bf['isVisible']&&_0x4865a7++;}return this['isVisible']=_0x4865a7>0x0,{'resultsCount':_0x4865a7,'totalItemsCount':_0x1ce2dd};}['getItem'](_0xb410c9){return this['itemsViews']['find'](_0x39346b=>_0x39346b['id']===_0xb410c9);}['removeItem'](_0x9e291c){const _0x1f71f8=this['itemsViews']['indexOf'](_0x9e291c);-0x1!==_0x1f71f8&&(this['itemsViews']['splice'](_0x1f71f8,0x1),this['_itemsListView']['items']['remove'](_0x9e291c));}}class xi extends/* #__PURE__ -- @preserve */
|
|
27
|
+
_0x296340(_0x8981d2){['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(_0x3bf74c,_0x5ec180){super(_0x3bf74c);const _0x2f9ab9=this['bindTemplate'];this['set']('isEdit',!0x1),this['set']('isVisible',!0x0),this['set']('pinned',!!_0x5ec180['pinned']),this['set']('loadingState',null),this['id']=_0x5ec180['id'];const {title:_0x38a782,createdAt:_0x210e29,active:_0x2a5aa6=!0x1}=_0x5ec180;this['_titleView']=new _0x26b973(),this['_titleView']['text']=_0x38a782,this['_titleView']['extendTemplate']({'attributes':{'class':['ck-ai-chat-history__item-title']}});const _0x120fc7=this['_createCheckView'](),_0x3f648a=this['_createPinButtonView'](_0x3bf74c),_0x625473=this['_createMenuDropdownView'](),_0x9f7936=this['_createEditInputView'](_0x3bf74c,_0x38a782),_0x191ba1=this['_createAcceptEditButtonView'](_0x3bf74c,_0x9f7936),_0x55ffca=this['_createCancelEditButtonView'](_0x3bf74c,_0x9f7936);this['actions']=this['createCollection'](),this['mainContent']=this['createCollection'](),this['mainContent']['add'](this['_titleView']),this['actions']['add'](_0x3f648a),this['actions']['add'](_0x625473),this['on']('change:isEdit',(_0x47f797,_0x1c340f,_0xee2ddd)=>{this['actions']['clear'](),this['mainContent']['clear'](),_0xee2ddd?(this['actions']['add'](_0x191ba1),this['actions']['add'](_0x55ffca),this['mainContent']['add'](_0x9f7936),_0x9f7936['element']['focus']()):(this['actions']['add'](_0x3f648a),this['actions']['add'](_0x625473),this['mainContent']['add'](this['_titleView']));}),this['setTemplate']({'tag':'li','attributes':{'class':['ck-ai-chat-history__item',_0x2a5aa6?'ck-ai-chat-history__item--active':'',_0x2f9ab9['if']('isVisible','ck-hidden',_0x32330f=>!_0x32330f),_0x2f9ab9['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',_0x2f9ab9['if']('loadingState','ck-hidden',_0x4f8708=>!!_0x4f8708)]},'children':_0x2a5aa6?[_0x120fc7]:[]},{'tag':'div','attributes':{'class':['ck-ai-loader',_0x2f9ab9['if']('loadingState','ck-hidden',_0x502f76=>!_0x502f76)]},'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',_0x2f9ab9['if']('loadingState','ck-hidden',_0xfb9c22=>!!_0xfb9c22)]},'children':this['mainContent']},{'tag':'div','attributes':{'class':['ck-ai-loader__text',_0x2f9ab9['if']('loadingState','ck-hidden',_0x1b7ff1=>!_0x1b7ff1)]},'children':[{'text':_0x2f9ab9['to']('loadingState',_0xdf2dc7=>_0xdf2dc7?i(this['locale'],xi['LOADING_LABELS'][_0xdf2dc7]):'')}]}]},{'tag':'span','attributes':{'class':['ck-ai-chat-history__item-date']},'children':[_0x210e29]}]},{'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'](_0x2b6f03){this['_titleView']['text']=_0x497439(_0x2b6f03);}['updateLoadingState'](_0x219dbe,_0x249b5d){this['set']('loadingState',_0x249b5d?_0x219dbe:null);}['_createCheckView'](){const _0x2bdebc=new _0x528adc();return _0x2bdebc['set']({'content':_0x4b3b54}),_0x2bdebc;}['_createPinButtonView'](_0x2e3631){const _0xcb87c8=new _0x599e60(_0x2e3631);return _0xcb87c8['set']({'label':i(_0x2e3631,'AI_CHAT_HISTORY_PIN_BUTTON'),'icon':_0x5cb4cf,'withText':!0x1,'tooltip':!0x0}),_0xcb87c8['bind']('isOn')['to'](this,'pinned'),_0xcb87c8['on']('execute',()=>{const _0x287e98=!this['pinned'];this['fire']('setConversationPinned',{'id':this['id'],'pinned':_0x287e98});}),_0xcb87c8;}['_createMenuDropdownView'](){const _0x4729b2=_0xace15(this['locale'],_0x11350e),_0x2b4292=_0x4729b2['panelView']['children'];_0x4729b2['buttonView']['set']({'label':i(this['locale'],'AI_CHAT_HISTORY_SHOW_MORE_ITEMS'),'icon':_0x2e88d6}),_0x4729b2['panelPosition']='sw';const _0x39d2b0=new _0x599e60(this['locale']);_0x39d2b0['label']=i(this['locale'],'AI_CHAT_HISTORY_EDIT_NAME'),_0x39d2b0['withText']=!0x0,_0x39d2b0['on']('execute',()=>{this['isEdit']=!0x0;});const _0x5d18b3=new _0x599e60(this['locale']);_0x5d18b3['label']=i(this['locale'],'AI_CHAT_HISTORY_REMOVE'),_0x5d18b3['withText']=!0x0,_0x5d18b3['on']('execute',()=>{this['showConfirm'](i(this['locale'],'AI_CHAT_HISTORY_REMOVE_CONFIRM'),this['element'])['then'](()=>{this['fire']('removeConversation',{'id':this['id']});});});const _0x1cfa0b=new _0x20d034(this['locale']),_0x103c3a=new _0x8981d2(this['locale']);_0x103c3a['children']['add'](_0x39d2b0);const _0xa5870d=new _0x8981d2(this['locale']);return _0xa5870d['children']['add'](_0x5d18b3),_0x1cfa0b['items']['addMany']([_0x103c3a,_0xa5870d]),_0x2b4292['add'](_0x1cfa0b),_0x4729b2;}['_createEditInputView'](_0x48a632,_0x534d3d){const _0x269adb=new _0x34d93c(_0x48a632),_0x5c9dc0=_0x269adb['bindTemplate'];return _0x269adb['value']=_0x534d3d,_0x269adb['extendTemplate']({'on':{'keydown':_0x5c9dc0['to'](_0x507d7a=>{'Enter'==_0x507d7a['key']&&this['_commitEditInputValue'](_0x269adb);})}}),_0x269adb;}['_createAcceptEditButtonView'](_0x11a32c,_0x23df76){const _0x5bb1c1=new _0x599e60(_0x11a32c);return _0x5bb1c1['set']({'icon':_0x4b3b54,'withText':!0x1,'tooltip':i(_0x11a32c,'AI_CHAT_HISTORY_ACCEPT')}),_0x5bb1c1['extendTemplate']({'attributes':{'class':['ck-confirm-view-submit']}}),_0x5bb1c1['on']('execute',()=>{this['_commitEditInputValue'](_0x23df76);}),_0x5bb1c1;}['_commitEditInputValue'](_0x38482f){const _0x50725a=_0x38482f['element']['value']||'';this['_titleView']['text']=_0x50725a,this['isEdit']=!0x1,this['fire']('editConversationTitle',{'id':this['id'],'title':_0x50725a});}['_createCancelEditButtonView'](_0x4846e5,_0x2b3ecd){const _0x5e0917=new _0x599e60(_0x4846e5);return _0x5e0917['set']({'icon':_0x35d8e1,'withText':!0x1,'tooltip':i(_0x4846e5,'AI_CHAT_HISTORY_CANCEL')}),_0x5e0917['extendTemplate']({'attributes':{'class':['ck-confirm-view-cancel']}}),_0x5e0917['on']('execute',()=>{this['isEdit']=!0x1,_0x2b3ecd['value']=this['_titleView']['text']||'',this['fire']('edit:cancel');}),_0x5e0917;}['_createSpinnerView'](){const _0x4f4247=new pi('tiny');return _0x4f4247['isVisible']=!0x0,_0x4f4247;}['isMatching'](_0x4a69c3){return this['_titleView']&&'string'==typeof this['_titleView']['text']&&this['_titleView']['text']['match'](_0x4a69c3)?{'title':!0x0}:null;}['highlightText'](_0xe2775){this['_titleView']['highlightText'](_0xe2775);}}class wt extends _0x5eeb09{['searchView'];['mainErrorView'];['skeletonView'];['emptyView'];['sectionsView'];['resizeButton'];constructor(_0x1695c1,_0x511f85){super(_0x1695c1),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 _0x31e543=new _0x156476(_0x1695c1,{'label':i(_0x1695c1,'AI_CHAT_HISTORY_HEADING'),'icon':Nt,'class':'ck-ai-header\x20ck-ai-header_history'});_0x511f85&&(this['resizeButton']=Hs(_0x1695c1,this),_0x31e543['children']['add'](this['resizeButton'])),this['sectionsView']=new Ri(_0x1695c1,[]),this['sectionsView']['delegate'](...Li)['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',_0x15a072=>!_0x15a072)]}}),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':[_0x31e543,{'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 _0x4ed2dd=new _0x4837ac(this['locale'],{'filteredView':this['sectionsView'],'queryView':{'label':i(this['locale'],'AI_CHAT_HISTORY_SEARCH_LABEL')},'infoView':{'text':{'notFound':{'primary':_0x4fc5c7=>i(this['locale'],'AI_CHAT_HISTORY_SEARCH_NOT_FOUND_PRIMARY',_0x4fc5c7),'secondary':i(this['locale'],'AI_CHAT_HISTORY_SEARCH_NOT_FOUND_SECONDARY')}}}}),_0x48df01=this['_createErrorView']();return _0x48df01['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('errorMessage','ck-hidden',_0x5b29d3=>!_0x5b29d3)]}}),_0x4ed2dd['on']('render',()=>{_0x4ed2dd['children']['add'](_0x48df01,0x1);}),_0x4ed2dd['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isSearchViewVisible','ck-hidden',_0x31d83e=>!_0x31d83e)]}}),_0x4ed2dd;}['_createSkeletonView'](){const _0x2fabc6=new ui(this['locale'],fi['aiHistory']);return _0x2fabc6['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isLoading','ck-hidden',_0x5c4e99=>!_0x5c4e99)]}}),_0x2fabc6;}['_createErrorView'](){const _0x267cb2=new _0x5eeb09(this['locale']),_0xf90530=new _0x599e60(this['locale']);_0xf90530['set']({'withText':!0x1,'icon':_0x35d8e1,'class':'ck-ai-notification_error__dismiss-button'}),_0xf90530['bind']('isVisible')['to'](this,'hasItems',_0xfd6c75=>!!_0xfd6c75),_0xf90530['on']('execute',()=>{this['errorMessage']='';});const _0x3991a1=this['bindTemplate'];return _0x267cb2['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-notification','ck-ai-notification_error']},'children':[{'tag':'p','children':[{'text':_0x3991a1['to']('errorMessage')}]},_0xf90530]}),_0x267cb2;}['_createEmptyStateView'](){const _0x217962=new _0x599e60(this['locale']);_0x217962['set']({'label':i(this['locale'],'AI_CHAT_LABEL_NEW_CHAT'),'withText':!0x0,'icon':_0xa9fd1f,'class':'ck-ai-chat__start-conversation'}),_0x217962['on']('execute',()=>{this['fire']('openChat');});const _0x230cd9=new _0x5eeb09(this['locale']);return _0x230cd9['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-history__empty',this['bindTemplate']['if']('isEmptyViewVisible','ck-hidden',_0x3163a3=>!_0x3163a3)]},'children':[{'tag':'p','attributes':{'class':['ck-ai-chat-history__empty-message']},'children':[i(this['locale'],'AI_CHAT_HISTORY_EMPTY_MESSAGE')]},_0x217962]}),_0x230cd9;}['_createListItemViews'](_0x59943f,_0x483e87){const _0x22e536=[];for(const _0x3e0a48 of _0x59943f){const _0x30f507=new xi(_0x483e87,_0x3e0a48);_0x30f507['delegate'](...Li)['to'](this),_0x22e536['push'](_0x30f507);}return _0x22e536;}['updateHistoryItemsWithCategories'](_0x159341){const _0x422712=this['locale']||'en',_0x2bc5e5=[];for(const _0x28b9ed of _0x159341){const _0x65348c=this['_createListItemViews'](_0x28b9ed['items'],_0x422712);_0x2bc5e5['push'](new Mi(_0x422712,{'title':_0x28b9ed['title'],'items':_0x65348c}));}this['sectionsView']['sections']=_0x2bc5e5,this['sectionsView']['items']['clear'](),this['sectionsView']['items']['addMany'](_0x2bc5e5),this['hasItems']=_0x159341['some'](_0x50e397=>_0x50e397['items']['length']>0x0),this['_refreshSearch']();}['removeHistoryItem'](_0x4de268){for(const _0x407b10 of this['sectionsView']['sections']){const _0x462e85=_0x407b10['getItem'](_0x4de268);if(_0x462e85){if(_0x407b10['removeItem'](_0x462e85),0x0===_0x407b10['itemsViews']['length']){const _0x404279=this['sectionsView']['sections']['indexOf'](_0x407b10);-0x1!==_0x404279&&(this['sectionsView']['sections']['splice'](_0x404279,0x1),this['sectionsView']['items']['remove'](_0x407b10));}this['hasItems']=this['sectionsView']['sections']['length']>0x0,this['_refreshSearch']();break;}}}['updateItemTitle'](_0x2b57f0,_0x306658){for(const _0x4dcf70 of this['sectionsView']['sections']){const _0x9579b9=_0x4dcf70['getItem'](_0x2b57f0);if(_0x9579b9){_0x9579b9['updateTitle'](_0x306658);break;}}}['updateItemLoadingState'](_0xa65422,_0x587f1e,_0x51ae8b){for(const _0x4e09dc of this['sectionsView']['sections']){const _0x21609a=_0x4e09dc['getItem'](_0xa65422);if(_0x21609a){_0x21609a['updateLoadingState'](_0x587f1e,_0x51ae8b);break;}}}['_refreshSearch'](){if(this['hasItems']){const _0x2ff2e2=this['searchView']['queryView']['fieldView']?.['element']?.['value']||'';this['searchView']['search'](_0x2ff2e2);}}}const Li=['showConversationHistory','removeConversation','editConversationTitle','setConversationPinned','selectConversation','openChat','resizeTabs'];class xt extends _0x34a98c{static get['requires'](){return[pt];}['_historyView'];static get['pluginName'](){return'AIChatHistoryUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x28bc1d){super(_0x28bc1d);const _0x307afd=this['context']['plugins']['get']('AITabs');this['_historyView']=new wt(this['context']['locale'],_0x307afd['showResizeButton']),this['_historyView']['delegate'](...Li)['to'](this),_0x307afd['view']['addTab']({'id':'history','buttonLabel':i(this['context']['locale'],'AI_CHAT_HISTORY_HEADING'),'buttonIcon':Nt,'order':0x0,'content':this['_historyView']});}['removeHistoryItem'](_0x434c2e){this['_historyView']['removeHistoryItem'](_0x434c2e);}['updateItems'](_0x103ba6){this['_historyView']['updateHistoryItemsWithCategories'](_0x103ba6);}['updateItemTitle'](_0x573d45,_0x15628d){this['_historyView']['updateItemTitle'](_0x573d45,_0x15628d);}['updateItemLoadingState'](_0x53bf76,_0x30b165,_0x4f4aa0){this['_historyView']['updateItemLoadingState'](_0x53bf76,_0x30b165,_0x4f4aa0);}['setLoadingSkeleton'](_0x491a73){this['_historyView']['isLoading']=_0x491a73;}['showError'](_0x38359f){this['_historyView']['errorMessage']=_0x38359f;}['hideError'](){this['_historyView']['errorMessage']='';}['setIsMaximized'](_0x5bc546){this['_historyView']['isMaximized']=_0x5bc546;}}class ir extends ts(){['id'];['createdAt'];constructor({id:_0x9e00a3,title:_0x10e3fa,createdAt:_0x2a883f,updatedAt:_0x1cb750,pinned:_0x239c41}){super(),this['id']=_0x9e00a3,this['createdAt']=new Date(_0x2a883f),this['set']('title',_0x10e3fa),this['set']('updatedAt',_0x1cb750?new Date(_0x1cb750):null),this['set']('pinned',_0x239c41||!0x1);}['updateTitle'](_0x46dc70){this['set']('title',_0x497439(_0x46dc70)),this['updatedAt']=new Date();}['updatePinned'](_0x19efe4){this['set']('pinned',_0x19efe4),this['updatedAt']=new Date();}}class Ht extends _0x17d663(){['items']=[];['connector'];['group'];constructor({connector:_0x65810c,group:_0x4ebcfd}){super(),this['connector']=_0x65810c,this['group']=_0x4ebcfd;}async['init'](){try{const _0x6eb3ff=this['connector']['fetchConversations'](this['group']),_0x1ca4c3=await _0x6eb3ff['getConversations']();this['loadItems'](_0x1ca4c3);}catch(_0x23b915){this['fire']('error',{'error':_0x23b915,'operation':'init'});}}['addItem'](_0x11b8d6){this['items']['push'](_0x11b8d6);}async['removeItem'](_0x1674ba){const _0x2326d3=this['items']['findIndex'](_0x27fb7f=>_0x27fb7f['id']===_0x1674ba);if(-0x1===_0x2326d3)return!0x1;try{return await this['connector']['deleteConversation'](_0x1674ba)['execute'](),this['items']['splice'](_0x2326d3,0x1),this['fire']('itemRemoved',{'itemId':_0x1674ba}),!0x0;}catch(_0x2420bd){return this['fire']('error',{'error':_0x2420bd,'operation':'removeItem','itemId':_0x1674ba}),!0x1;}}['getItem'](_0x28ce3f){return this['items']['find'](_0x3ea845=>_0x3ea845['id']===_0x28ce3f);}async['updateItemTitle'](_0x511251,_0x27b7ac){const _0x332ce5=this['getItem'](_0x511251);if(!_0x332ce5)return!0x1;try{return await this['connector']['updateConversation'](_0x511251,{'title':_0x27b7ac})['getResult'](),_0x332ce5['updateTitle'](_0x27b7ac),this['fire']('itemUpdated',{'itemId':_0x511251,'updates':{'title':_0x27b7ac}}),!0x0;}catch(_0x58d562){return this['fire']('error',{'error':_0x58d562,'operation':'updateItemTitle','itemId':_0x511251}),!0x1;}}async['updateItemPinned'](_0x4c100d,_0x48acc7){const _0x1100eb=this['getItem'](_0x4c100d);if(!_0x1100eb)return!0x1;try{return await this['connector']['updateConversation'](_0x4c100d,{'pinned':_0x48acc7})['getResult'](),_0x1100eb['updatePinned'](_0x48acc7),this['fire']('itemUpdated',{'itemId':_0x4c100d,'updates':{'pinned':_0x48acc7}}),!0x0;}catch(_0x203435){return this['fire']('error',{'error':_0x203435,'operation':'updateItemPinned','itemId':_0x4c100d}),!0x1;}}['loadItems'](_0x339718){try{this['items']=[],_0x339718['map'](_0x3dc22b=>{this['addItem'](new ir(_0x3dc22b));}),this['fire']('itemsLoaded',{'items':[...this['items']]});}catch(_0x3b0a8e){this['fire']('error',{'error':_0x3b0a8e,'operation':'loadItems'});}}['getItems'](_0x3f6a36={}){const _0x32e962=void 0x0!==_0x3f6a36['pinned']&&_0x3f6a36['pinned'],_0x499662=_0x3f6a36['from']?new Date(_0x3f6a36['from']['getFullYear'](),_0x3f6a36['from']['getMonth'](),_0x3f6a36['from']['getDate']()):null,_0x4536b9=_0x3f6a36['to']?new Date(_0x3f6a36['to']['getFullYear'](),_0x3f6a36['to']['getMonth'](),_0x3f6a36['to']['getDate']()):null;return this['items']['filter'](_0xe8129=>{if(_0xe8129['pinned']!==_0x32e962)return!0x1;if(_0x4536b9){const _0x3d111b=new Date(_0xe8129['createdAt']['getFullYear'](),_0xe8129['createdAt']['getMonth'](),_0xe8129['createdAt']['getDate']());return _0x499662?_0x499662['getTime']()===_0x4536b9['getTime']()?_0x3d111b['getTime']()===_0x499662['getTime']():_0x3d111b<_0x4536b9&&_0x3d111b>=_0x499662:_0x3d111b<_0x4536b9;}return!0x0;});}}class jt extends _0x34a98c{['_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 _0x4ae46e=this['context']['plugins']['get'](pt);try{const _0x274a62=this['_aiChatController']['getGroupId']();this['history']=new Ht({'connector':this['_aiConnector'],'group':_0x274a62}),this['listenTo'](this['_aiChatHistoryUi'],'removeConversation',(_0x208a5b,_0x3dc62e)=>{this['_setItemLoading'](_0x3dc62e['id'],'remove'),this['_handleRemove'](_0x3dc62e['id']);}),this['listenTo'](this['_aiChatHistoryUi'],'editConversationTitle',(_0x35ae47,_0x37f51a)=>{this['_setItemLoading'](_0x37f51a['id'],'rename'),this['_handleEditTitle'](_0x37f51a['id'],_0x37f51a['title']);}),this['listenTo'](this['history'],'itemUpdated',(_0x2a5465,_0x4aa598)=>{void 0x0!==_0x4aa598['updates']['title']&&this['_aiChatHistoryUi']['updateItemTitle'](_0x4aa598['itemId'],_0x4aa598['updates']['title']),void 0x0!==_0x4aa598['updates']['pinned']&&this['_updateHistoryItemsUI'](),this['_clearItemLoading'](_0x4aa598['itemId']);}),this['listenTo'](this['history'],'itemRemoved',(_0x350d9b,_0x3f9b7d)=>{this['_aiChatController']['handleRemovedConversation'](_0x3f9b7d['itemId']),this['_aiChatHistoryUi']['removeHistoryItem'](_0x3f9b7d['itemId']),this['_clearItemLoading'](_0x3f9b7d['itemId']);}),this['listenTo'](this['history'],'itemsLoaded',()=>{this['_updateHistoryItemsUI']();}),this['listenTo'](this['history'],'error',(_0x4f4e61,_0x1f35b8)=>{this['_handleHistoryErrorUI'](_0x1f35b8['error'],_0x1f35b8['operation'],_0x1f35b8['itemId']);}),this['listenTo'](this['_aiChatHistoryUi'],'selectConversation',(_0x43ed52,_0x58009b)=>{this['_handleSelectConversation'](_0x58009b['id']);}),this['listenTo'](this['_aiChatHistoryUi'],'setConversationPinned',(_0x2faa6a,_0x31cbc2)=>{const _0x479eef=_0x31cbc2['pinned']?'pin':'unpin';this['_setItemLoading'](_0x31cbc2['id'],_0x479eef),this['_handleTogglePin'](_0x31cbc2['id'],_0x31cbc2['pinned']);}),this['listenTo'](this['_aiChatHistoryUi'],'openChat',()=>{_0x4ae46e['view']['activateTab']('chat');}),this['listenTo'](this['_aiChatController'],'change:activeConversation',()=>{this['_updateHistoryItemsUI']();}),_0x4ae46e['view']['on']('activateTab:history',()=>{this['_showConversationHistory']();}),this['listenTo'](_0x4ae46e,'resizedTabs',(_0x543394,_0x5d4a27)=>{this['_setIsMaximized'](_0x5d4a27);}),this['listenTo'](this['_aiChatHistoryUi'],'resizeTabs',()=>{_0x4ae46e['resize']();});}catch(_0x20d316){this['_handleHistoryErrorUI'](_0x20d316,'init');}}async['_handleEditTitle'](_0x2c3ccc,_0x44d438){await this['history']['updateItemTitle'](_0x2c3ccc,_0x44d438);}async['_handleTogglePin'](_0x3a1059,_0x2a9ee7){await this['history']['updateItemPinned'](_0x3a1059,_0x2a9ee7);}async['_handleRemove'](_0x3ad968){await this['history']['removeItem'](_0x3ad968);}async['_handleSelectConversation'](_0xacb719){await this['_aiChatController']['loadConversation'](_0xacb719);}async['_showConversationHistory'](){this['_aiChatHistoryUi']['showError'](''),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x0),await this['history']['init'](),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x1);}['_updateHistoryItemsUI'](){const _0x10f9d8=this['_aiChatController']['activeConversation']?.['id'],_0x50b3a0=this['_getCategorizedItems']()['map'](_0xf0f37d=>({'title':_0xf0f37d['title'],'items':_0xf0f37d['items']['map'](_0x43e283=>({'id':_0x43e283['id'],'title':_0x43e283['title']||i(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION'),'createdAt':new Date(_0x43e283['createdAt'])['toLocaleDateString'](),'active':_0x43e283['id']===_0x10f9d8,'pinned':_0x43e283['pinned']}))}));this['_aiChatHistoryUi']['updateItems'](_0x50b3a0);}['_setItemLoading'](_0x23bd26,_0x14d0f0){this['_aiChatHistoryUi']['updateItemLoadingState'](_0x23bd26,_0x14d0f0,!0x0);}['_clearItemLoading'](_0xae2ddc){this['_aiChatHistoryUi']['updateItemLoadingState'](_0xae2ddc,null,!0x1);}['_handleHistoryErrorUI'](_0x4e82a8,_0x2752e3,_0x2fc83f){const _0x5b99ba=this['_generateErrorMessage'](_0x2752e3,_0x2fc83f);this['_aiChatHistoryUi']['showError'](_0x5b99ba),_0x2fc83f&&this['_clearItemLoading'](_0x2fc83f),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x1);}['_generateErrorMessage'](_0xfd3e79,_0x48ffe9){const _0x1906ed=_0x48ffe9?this['history']['getItem'](_0x48ffe9):null,_0x3f2e71=_0x1906ed?.['title']||i(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION');switch(_0xfd3e79){case'updateItemTitle':return i(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_UPDATE_TITLE',_0x3f2e71);case'updateItemPinned':{const _0x2676ef=i(this['context']['locale'],_0x1906ed?.['pinned']?'AI_CHAT_HISTORY_UNPIN_ACTION':'AI_CHAT_HISTORY_PIN_ACTION');return i(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_UPDATE_PINNED',[_0x2676ef,_0x3f2e71]);}case'removeItem':return i(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_REMOVE_ITEM',_0x3f2e71);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 _0x36ecff=new Date(),_0x538473=new Date(_0x36ecff['getFullYear'](),_0x36ecff['getMonth'](),_0x36ecff['getDate']()),_0x5537cd=new Date(_0x538473);_0x5537cd['setDate'](_0x5537cd['getDate']()-0x1);const _0x57cbf8=new Date(_0x538473);_0x57cbf8['setDate'](_0x57cbf8['getDate']()-0xe);const _0x236c31=this['history']['getItems']({'pinned':!0x0}),_0x121aca=this['history']['getItems']({'from':_0x538473,'to':_0x538473}),_0x289a5d=this['history']['getItems']({'from':_0x5537cd,'to':_0x5537cd}),_0x24e7a8=this['history']['getItems']({'from':_0x57cbf8,'to':_0x5537cd}),_0x2c8ae9=this['history']['getItems']({'to':_0x57cbf8}),_0x2df3b0=[];return _0x236c31['length']>0x0&&_0x2df3b0['push']({'title':i(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_PINNED'),'items':_0x236c31}),_0x121aca['length']>0x0&&_0x2df3b0['push']({'title':i(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_TODAY'),'items':_0x121aca}),_0x289a5d['length']>0x0&&_0x2df3b0['push']({'title':i(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_YESTERDAY'),'items':_0x289a5d}),_0x24e7a8['length']>0x0&&_0x2df3b0['push']({'title':i(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_LAST_14_DAYS'),'items':_0x24e7a8}),_0x2c8ae9['length']>0x0&&_0x2df3b0['push']({'title':i(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_LATER'),'items':_0x2c8ae9}),_0x2df3b0;}['_setIsMaximized'](_0x5b1601){this['_aiChatHistoryUi']['setIsMaximized'](_0x5b1601);}}class ht extends _0x34a98c{static get['requires'](){return[jt,xt];}static get['pluginName'](){return'AIChatHistory';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class Ma extends _0x34a98c{static get['requires'](){return[at,D,ct,ht];}static get['pluginName'](){return'AIChat';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x4ddea8){super(_0x4ddea8),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:_0x127309,attributes:_0x19531c}){await this['context']['plugins']['get'](at)['sendMessage']({'message':_0x127309,'attributes':_0x19531c});}['removeSelectionFromChatContext'](){this['context']['plugins']['get'](at)['removeSelectionFromChatContext']();}['focusPromptInput'](){this['context']['plugins']['get'](at)['focusPromptInput']();}['registerToolDataCallback'](_0x1f022b){this['context']['plugins']['get'](at)['_registerToolDataCallback'](_0x1f022b);}}class fs extends _0x599e60{['id'];constructor(_0x2d41d9,_0x18dea2){super(_0x2d41d9);const {id:_0x528c6a,type:_0x2b3db4,icon:_0x27dd91}=_0x18dea2;this['id']=_0x528c6a,this['set']({'label':_0x18dea2['label'],'withText':!0x0,'class':'ck-ai-chat-shortcut'}),this['extendTemplate']({'attributes':{'data-cke-ai-shortcut-id':_0x18dea2['id']}}),_0x27dd91?this['icon']=_0x27dd91:'chat'===_0x2b3db4?this['icon']=_0x47048f:'review'===_0x2b3db4?this['icon']=_0x3c05dc:'translate'===_0x2b3db4&&(this['icon']=Vt);}}class kt extends _0x5eeb09{['listView'];constructor(_0x4c660f,_0x1bb230){super(_0x4c660f);const _0x2e9c11=_0x1bb230['map'](_0x146f66=>{const _0x410e23=new _0x8981d2(this['locale']),_0x3e77c2=new fs(this['locale'],_0x146f66);return _0x410e23['children']['add'](_0x3e77c2),_0x3e77c2['delegate']('execute')['to'](this),_0x410e23;});this['listView']=new _0x20d034(this['locale']),this['listView']['items']['addMany'](_0x2e9c11),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat-shortcuts']},'children':[this['listView']]});}}const Ut='chat-shortcuts';var Ua=function(_0x100819){return _0x100819['CHAT']='chat',_0x100819['REVIEW']='review',_0x100819['TRANSLATE']='translate',_0x100819;}({});class Va extends _0x34a98c{['_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 _0x1d484e=this['context']['plugins']['get']('AIChatController');this['_shortcuts']['length']&&(this['_validateShortcuts'](),this['_aiChatUI']['on']('conversationCreated',()=>{_0x1d484e['activeConversation']['isFromHistory']||this['_injectShortcuts']();}),this['listenTo'](_0x1d484e,'interactionStarted',()=>{this['_removeShortcuts']();}));}['_validateShortcuts'](){const _0x27433d=Object['values'](Ua);this['_shortcuts']['forEach'](_0xe38e5d=>{let _0x5ae20c=!0x0;if(_0xe38e5d['id']&&_0xe38e5d['label']&&_0x27433d['includes'](_0xe38e5d['type'])?'chat'===_0xe38e5d['type']&&(_0x5ae20c='string'==typeof _0xe38e5d['prompt']):_0x5ae20c=!0x1,!_0x5ae20c)throw new _0x509ee0('ai-chat-shortcuts-invalid-config',this['context'],{'shortcut':_0xe38e5d});});}['_injectShortcuts'](){const _0x2e4d16=this['context']['plugins']['get'](ct);this['_shortcutsView']=new kt(this['context']['locale'],this['_shortcuts']),this['_shortcutsView']['render'](),_0x2e4d16['addFeedItemCustomElement'](this['_shortcutsView']['element'],Ut),this['_shortcutsView']['on']('execute',_0x29459c=>{const _0x3e35f5=_0x29459c['source']['id'];this['_executeShortcut'](_0x3e35f5);});}['_removeShortcuts'](){const _0x3fd94c=this['context']['plugins']['get'](ct);_0x3fd94c['hasFeedItem'](Ut)&&_0x3fd94c['removeFeedItem'](Ut),this['_shortcutsView']?.['destroy']();}['_executeShortcut'](_0x36435c){const _0x787186=this['_shortcuts']['find'](_0x35c6a0=>_0x35c6a0['id']===_0x36435c),_0x90687f=_0x787186['type'];'chat'===_0x90687f?this['_runChatShortcut'](_0x787186):'review'===_0x90687f?_0x787186['check']?this['_runReviewShortcut'](_0x787186):this['_switchTab']('reviewMode'):'translate'===_0x90687f&&(_0x787186['language']?this['_runTranslateShortcut'](_0x787186):this['_switchTab']('translate'));}['_switchTab'](_0x429f10){if(!this['context']['plugins']['has']('AITabs'))throw new _0x509ee0('ai-chat-shortcuts-ai-tabs-not-found',this['context'],{'tabName':_0x429f10});this['context']['plugins']['get']('AITabs')['view']['activateTab'](_0x429f10);}async['_runChatShortcut']({prompt:_0x1cbf8d,draftMode:_0x16b7dd,useWebSearch:_0x191f30=!0x1,useReasoning:_0x42167a=!0x1,model:_0x198624}){const _0x220825=this['context']['plugins']['get']('AIChat'),_0x13e966=this['context']['plugins']['get']('AIChatController'),_0x35df17=_0x13e966['activeConversation'];let _0x5723bd;_0x5723bd=_0x198624?await _0x35df17['chatModels']['getModel'](_0x198624):await _0x35df17['chatModels']['getDefault'](),_0x5723bd&&await _0x35df17['setModel'](_0x5723bd),_0x35df17['setWebSearch'](_0x191f30),_0x35df17['setReasoning'](_0x42167a),_0x13e966['addCurrentDocumentToChatContext'](),_0x16b7dd?(this['_aiChatUI']['setPromptInputValue'](_0x1cbf8d),this['_aiChatUI']['focusPromptInput'](!0x0)):_0x220825['sendMessage']({'message':_0x1cbf8d});}['_runReviewShortcut']({check:_0x1c6689,model:_0x562eed,prompt:_0x3f74da,params:_0x733b44}){if(!this['context']['plugins']['has']('AIReviewModeUI'))throw new _0x509ee0('ai-chat-shortcuts-review-mode-not-found',this['context']);this['_switchTab']('reviewMode');const _0x5e8627={'id':_0x1c6689,'isCustom':'custom'===_0x1c6689};_0x562eed&&_0x3f74da&&(_0x5e8627['args']={'model':_0x562eed,'prompt':_0x3f74da}),_0x733b44&&(_0x5e8627['params']=_0x733b44),this['context']['plugins']['get']('AIReviewModeUI')['fire']('runReviewCheck',_0x5e8627);}['_runTranslateShortcut']({language:_0x2d614c}){if(!this['context']['plugins']['has']('AITranslateUI'))throw new _0x509ee0('ai-chat-shortcuts-translate-not-found',this['context']);this['_switchTab']('translate'),this['context']['plugins']['get']('AITranslateUI')['fire']('runReviewCheck',{'id':_0x2d614c,'args':{'language':_0x2d614c}});}}class io extends Lt{constructor(_0x200574){super(_0x200574);const _0x4f500c=_0x200574['plugins']['get']('AITabs')['view'];this['bind']('value')['to'](_0x4f500c,'isVisible'),this['isEnabled']=!0x0;}['execute'](){const _0x129dab=this['editor']['plugins']['get']('AITabs')['view'];_0x129dab['isVisible']=!_0x129dab['isVisible'];}}class qt extends _0x364f16{static get['requires'](){return[pt];}static get['pluginName'](){return'AIToggleButtonUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x3a94e4=this['editor'];_0x3a94e4['commands']['add']('toggleAi',new io(_0x3a94e4)),_0x3a94e4['ui']['componentFactory']['add']('toggleAi',()=>{const _0x3e362e=this['_createAIUIButton'](_0x599e60);return _0x3e362e['set']({'tooltip':!0x0,'class':'ck-ai-toggle-button'}),_0x3e362e;}),_0x3a94e4['ui']['componentFactory']['add']('menuBar:toggleAi',()=>{const _0x4b7730=this['_createAIUIButton'](_0x2d1f80);return _0x4b7730['set']({'role':'menuitemcheckbox'}),_0x4b7730;});}['_createAIUIButton'](_0x33b92d){const _0x260db5=this['editor'],_0x3a1f63=_0x260db5['commands']['get']('toggleAi'),_0x5c829f=new _0x33b92d(_0x260db5['locale']);return _0x5c829f['set']({'label':i(_0x260db5['locale'],'AI_TOGGLE_BUTTON_LABEL'),'icon':_0x169d4f,'isToggleable':!0x0}),_0x5c829f['bind']('isEnabled')['to'](_0x3a1f63),_0x5c829f['bind']('isOn')['to'](_0x3a1f63,'value',_0x2b00d3=>!!_0x2b00d3),this['listenTo'](_0x5c829f,'execute',()=>{_0x3a1f63['execute']();}),_0x5c829f;}}const F=['applySuggestion','insertSuggestion','showNext','showPrevious'];class ls extends _0x5eeb09{['_errorView'];constructor(_0x172401){super(_0x172401),this['set']('_errorMessage',''),this['set']('_isErrorVisible',!0x1);}['showBlockingError'](_0x398023){this['showError'](_0x398023);}['showError'](_0x449c0b){this['_errorView']||(this['_errorView']=this['_createErrorView']()),this['_errorMessage']=_0x449c0b,this['_isErrorVisible']=!0x0;}['hideError'](){this['_isErrorVisible']=!0x1;}['_createErrorView'](){const _0x42ebac=new _0x5eeb09(this['locale']),_0x1bdaab=new _0x5eeb09(this['locale']);return _0x1bdaab['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-suggestion__error-text']},'children':[{'text':this['bindTemplate']['to']('_errorMessage')}]}),_0x42ebac['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__error','ck-ai-balloon-error',this['bindTemplate']['if']('_isErrorVisible','ck-hidden',_0x279e20=>!_0x279e20)]},'children':[_0x1bdaab]}),_0x42ebac;}}const $=0xa;class Q extends _0x34a98c{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'](_0x4e328e){const {id:_0x5e4b03}=this['_currentConfig']??{};this['_currentConfig']=_0x4e328e;const {id:_0x2a9416}=this['_currentConfig'];this['isOpen']&&_0x5e4b03===_0x2a9416?this['_updateDialog']():this['_showDialog']();}['close'](){const _0x2132c2=T(this['context'])['plugins']['get']('Dialog');_0x2132c2['isOpen']&&this['_currentConfig']&&_0x2132c2['id']===this['_currentConfig']['id']&&_0x2132c2['hide']();}['_updateDialog'](){const _0x4244de=T(this['context'])['plugins']['get']('Dialog'),{icon:_0x3a02ee,title:_0x3f6eab}=this['_currentConfig'];_0x4244de['view']?.['headerView']&&(_0x4244de['view']['headerView']['label']=_0x3f6eab,_0x4244de['view']['headerView']['iconView']&&_0x3a02ee&&(_0x4244de['view']['headerView']['iconView']['content']=_0x3a02ee)),this['_isUpdatingMarkers']=!0x0,this['_showFakeVisualSelection'](),this['_isUpdatingMarkers']=!0x1,_0x4244de['view']?.['updatePosition']();}['_showFakeVisualSelection'](){this['context']['plugins']['get'](D)['showFakeVisualSelection'](this['_currentConfig']['ranges'],'ai-balloon-'+this['_currentConfig']['index'],!0x0,!0x0);}['_hideFakeVisualSelection'](_0x30e30f){this['context']['plugins']['get'](D)['hideFakeVisualSelection']('ai-balloon-'+_0x30e30f);}['_showDialog'](){const _0x45f9b0=T(this['context'])['plugins']['get']('Dialog'),{id:_0x525a91,title:_0xdd844b,icon:_0x12a6f4,class:_0x166142,mainView:_0x49abe5}=this['_currentConfig'];_0x49abe5['delegate'](...F)['to'](this),_0x45f9b0['show']({'title':_0xdd844b,'icon':_0x12a6f4,'hasCloseButton':!0x0,'id':_0x525a91,'position':this['_calculateDialogPosition']['bind'](this),'className':'ck-ai-balloon\x20'+(_0x166142||''),'content':_0x49abe5,'onShow':_0x47bed1=>{this['_showFakeVisualSelection'](),this['_setupFakeVisualSelectionMarkerRemovalListener']();const _0x4cc072=this['_getSelectionElements']();_0x4cc072&&_0x4cc072[0x0]&&_0x48dd33({'target':_0x4cc072[0x0],'ancestorOffset':0x14,'alignToTop':!0x0,'viewportOffset':{'top':0x14,'bottom':0x14,'left':0x0,'right':0x0}}),this['isOpen']=!0x0,_0x47bed1['once']('hide',()=>{this['fire']('beforeDialogClosed',{'id':_0x525a91});},{'priority':'high'});},'onHide':()=>{this['_hideFakeVisualSelection'](this['_currentConfig']['index']),this['_cleanupFakeVisualSelectionMarkerRemovalListener'](),this['fire']('dialogClosed',{'id':_0x525a91}),this['isOpen']=!0x1;}});}['_calculateDialogPosition'](_0x56295f,_0x1451fd){if(!_0x1451fd)return null;const _0x2cc44a=this['_getSelectionElements']();if(!_0x2cc44a||0x0===_0x2cc44a['length'])return{'left':Math['round'](_0x1451fd['left']+_0x1451fd['width']/0x2-_0x56295f['width']/0x2),'top':Math['round'](_0x1451fd['top']+_0x1451fd['height']/0x2-_0x56295f['height']/0x2)};const _0x931b03=Math['round'](_0x1451fd['left']+_0x1451fd['width']/0x2-_0x56295f['width']/0x2),_0x100d97=_0x2cc44a['map'](_0x43d5a3=>new _0x227dc7(_0x43d5a3)),_0x1b3dac=_0x56295f['height'];return{'left':_0x931b03,'top':this['_calculateOptimalTopPosition'](_0x100d97,_0x1b3dac,_0x1451fd)};}['_calculateOptimalTopPosition'](_0x464c26,_0x4dab30,_0xa6b65d){const _0x48f36c=new _0x227dc7(_0x595889['window']),_0x2a458a=_0x464c26['map'](_0x323419=>_0x323419['getVisible']())['filter'](_0x3e6695=>_0x3e6695),_0x4dd41d=_0x227dc7['getBoundingRect'](_0x2a458a);if(!_0x4dd41d)return Math['round'](_0xa6b65d['top']+_0xa6b65d['height']/0x2);const _0x50db05=_0x48f36c['getIntersection'](_0x4dd41d);if(!_0x50db05)return Math['round'](_0xa6b65d['top']+_0xa6b65d['height']/0x2);const _0x1f0150=_0xa6b65d['getVisible'](),_0x5f503a=_0x1f0150&&_0x4dd41d['height']>_0x1f0150['height'],_0x178729=_0x50db05['top'],_0x502a13=_0x50db05['bottom'];if(_0x5f503a){const _0x528cd7=(_0x1f0150||_0x48f36c)['height']/0x2-_0x4dab30/0x2,_0x27324d=_0x178729-$-_0xa6b65d['top'],_0x5c8de6=_0xa6b65d['bottom']-_0x502a13-$;return _0x27324d>=_0x4dab30?Math['max']($,_0x178729-_0x4dab30-$):_0x5c8de6>=_0x4dab30?_0x502a13+$:Math['max']($,_0x528cd7);}const _0x2c7177=_0x178729-_0x4dab30,_0xe42295=_0xa6b65d['bottom']-_0x502a13-$,_0x17bb4a=_0x178729-$-_0xa6b65d['top'];let _0x30808f;if(_0xe42295>=_0x4dab30)_0x30808f=_0x502a13+$;else{if(_0x17bb4a>=_0x4dab30)_0x30808f=_0x2c7177-$;else _0x30808f=_0x178729+_0x4dd41d['height']/0x2-_0x4dab30/0x2;}return _0x30808f;}['_setupFakeVisualSelectionMarkerRemovalListener'](){const _0x17c7f9=T(this['context']);this['listenTo'](_0x17c7f9['model']['document'],'change',()=>{if(!this['_isUpdatingMarkers']){for(const {name:_0x158647,data:{newRange:_0x124147}}of _0x17c7f9['model']['document']['differ']['getChangedMarkers']())if(_0x158647['startsWith'](R+':')&&(_0x124147&&(_0x124147['start']['isEqual'](_0x124147['end'])||'$graveyard'==_0x124147['root']['rootName'])||null==_0x124147)){const _0x2adb4d=i(this['context']['locale'],'AI_BALLOON_SELECTION_REMOVED_ERROR');this['_currentConfig']['mainView']['showBlockingError'](_0x2adb4d),this['fire']('selectionRemoved');}}});}['_cleanupFakeVisualSelectionMarkerRemovalListener'](){const _0x55d288=T(this['context']);this['_currentConfig']['mainView']['hideError'](),this['stopListening'](_0x55d288['model']['document']);}['_getSelectionElements'](){const _0x57dbf0=T(this['context']);return _0x53dfb5(_0x57dbf0['editing'],[..._0x57dbf0['model']['markers']['getMarkersGroup']('ai-selection'),..._0x57dbf0['model']['markers']['getMarkersGroup']('ai-balloon-selection')]);}}class us extends _0x1b53e3{['copyButton'];['likeButton'];['dislikeButton'];['showChangesButton'];['_config'];constructor(_0x9399e0,_0x5561a7={}){super(_0x9399e0),this['set']('isEnabled',!0x0),this['set']('isShowChangesOn',!0x1),this['_config']={'showCopy':!0x1,'showLike':!0x1,'showDislike':!0x1,..._0x5561a7};const _0x43cae0=!(this['_config']['showCopy']||this['_config']['showChanges']||this['_config']['showLike']||this['_config']['showDislike']||this['_config']['customView']?.['length']);this['class']=_0x43cae0?'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'](_0x50a452){this['showChangesButton']['isEnabled']=_0x50a452;}['_setupRatingButtons'](){this['likeButton']=new _0x599e60(this['locale']),this['likeButton']['set']({'icon':_0x2fad72,'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 _0x599e60(this['locale']),this['dislikeButton']['set']({'icon':_0x12f00a,'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 _0x599e60(this['locale']),this['copyButton']['set']({'icon':_0x311403,'label':i(this['locale'],'AI_MINI_TOOLBAR_COPY'),'class':'ck-ai-mini-toolbar-copy-button','tooltip':!0x0}),this['copyButton']['bind']('isEnabled')['to'](this);const _0x319794=new _0x528adc();_0x319794['set']({'content':_0x4ddc2b}),_0x319794['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'](_0x319794);}['_setupShowChangesButton'](){this['showChangesButton']=new _0x599e60(this['locale']),this['showChangesButton']['set']({'icon':_0x207ec9,'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',_0x5a7987=>_0x5a7987?_0x1a3d2d:_0x207ec9),this['showChangesButton']['on']('execute',()=>{this['fire']('toggleShowChanges');});}}class lt extends ls{['children'];['nextButtonView'];['previousButtonView'];['focusCycler'];['_focusables'];['_focusTracker'];['_keystrokes'];['_config'];['_streamableContentView'];['_toolbarContainerView'];['_partToolbarView'];['_stateView'];['_miniToolbarView'];constructor(_0x29dcdc,_0x55c6ac){super(_0x29dcdc);const _0x1da8cd=this['bindTemplate'];this['set']('showDiff',!0x1),this['set']('_state','pending'),this['_focusTracker']=new _0x534506(),this['_keystrokes']=new _0x33f2cf(),this['_focusables']=this['createCollection'](),this['focusCycler']=new _0x45d025({'focusables':this['_focusables'],'focusTracker':this['_focusTracker'],'keystrokeHandler':this['_keystrokes'],'actions':{'focusPrevious':'shift\x20+\x20tab','focusNext':'tab'}}),this['_config']=_0x55c6ac,this['nextButtonView']=this['_createNextButtonView'](),this['previousButtonView']=this['_createPreviousButtonView'](),this['_streamableContentView']=new as(_0x29dcdc),this['_partToolbarView']=new cs(_0x29dcdc,_0x55c6ac['availableActions']),this['_partToolbarView']['delegate']('applySuggestion','insertSuggestion','rejectSuggestion')['to'](this),this['_togglePartToolbarButtonsVisibility'](_0x55c6ac),this['_stateView']=new ws(_0x29dcdc),this['_stateView']['isVisible']=!0x1,this['_miniToolbarView']=new us(_0x29dcdc,{'showChanges':'full'}),this['_miniToolbarView']['bind']('isShowChangesOn')['to'](this,'showDiff'),this['_miniToolbarView']['on']('toggleShowChanges',()=>{this['fire']('toggleSuggestionDisplayMode');}),this['_toolbarContainerView']=new ms(_0x29dcdc,[this['_partToolbarView'],this['_stateView'],this['_miniToolbarView']]),this['children']=this['createCollection']([this['_streamableContentView'],this['_toolbarContainerView']]),this['on']('change:_state',(_0x26dbc8,_0x2b239b,_0x4555dc,_0x9afeba)=>{let _0x50b28f,_0x269469;'pending'===_0x9afeba?(_0x50b28f=this['_partToolbarView'],_0x269469=this['_stateView']):(_0x50b28f=this['_stateView'],_0x269469=this['_partToolbarView']),this['_stateView']['setState'](_0x4555dc),_0x50b28f['isVisible']=!0x1,_0x269469['isVisible']=!0x0;}),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat-balloon-main',_0x1da8cd['to']('_state',_0x50c1ba=>'ck-ai-chat-balloon-main_state_'+_0x50c1ba)]},'children':this['children']}),this['on']('change:isTrackChangesOn',()=>{this['_togglePartToolbarButtonsVisibility'](_0x55c6ac);});}['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'](_0x28d4e6){_0x28d4e6?.['keepErrors']||this['hideError'](),await this['_streamableContentView']['update'](_0x28d4e6);}['setState'](_0x22aaec){this['_state']=_0x22aaec;}['showError'](_0x7c9d42){super['showError'](_0x7c9d42),this['children']['has'](this['_errorView'])||this['children']['add'](this['_errorView'],0x0);}['hideError'](){this['_isErrorVisible']&&(super['hideError'](),this['togglePartToolbarEnabled'](!0x0));}['showBlockingError'](_0x56cf2a){super['showBlockingError'](_0x56cf2a),this['togglePartToolbarEnabled'](!0x1);}['toggleRotatorButtonsVisibility'](_0x26bdf4){this['nextButtonView']['isVisible']=this['previousButtonView']['isVisible']=_0x26bdf4;}['togglePartToolbarEnabled'](_0x2fdd10){this['_partToolbarView']['isEnabled']=_0x2fdd10;}['_togglePartToolbarButtonsVisibility']({showApplyButton:_0x29c8df,showSuggestButton:_0x2e0c28}){_0x29c8df=_0x29c8df&&!this['isTrackChangesOn']&&this['_config']['availableActions']['includes']('applySuggestion'),_0x2e0c28=_0x2e0c28&&this['_config']['availableActions']['includes']('insertSuggestion'),this['_partToolbarView']['setButtonsVisibility']({'showApplyButton':_0x29c8df,'showSuggestButton':_0x2e0c28});}['_createNextButtonView'](){const _0x43e208=new _0x599e60(this['locale']);return _0x43e208['set']({'icon':_0x4ad6c8,'label':i(this['locale'],'AI_BALLOON_NEXT_LABEL'),'isVisible':!0x0}),_0x43e208['on']('execute',()=>{this['fire']('showNext');}),_0x43e208;}['_createPreviousButtonView'](){const _0x360f51=new _0x599e60(this['locale']);return _0x360f51['set']({'icon':_0x46d9af,'label':i(this['locale'],'AI_BALLOON_PREVIOUS_LABEL'),'isVisible':!0x0}),_0x360f51['on']('execute',()=>{this['fire']('showPrevious');}),_0x360f51;}}class ms extends _0x5eeb09{constructor(_0x55080e,_0x342dbe){super(_0x55080e),this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-balloon__toolbar-container']},'children':_0x342dbe});}}class Ot extends _0x364f16{static get['requires'](){return[_0x1aff54,Q];}static get['pluginName'](){return'AIChatBalloon';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['_chatBalloonView'];constructor(_0xcfa8a9){super(_0xcfa8a9),this['set']('showDiff',!0x1);}['open'](_0x3980b2){const _0x55ff14=this['editor'];this['_chatBalloonView']||(this['_chatBalloonView']=this['_createChatBalloonView']()),_0x55ff14['plugins']['get']('AIBalloon')['open']({..._0x3980b2,'id':'aiChatBalloon','class':'ck-ai-chat-balloon','mainView':this['_chatBalloonView']}),this['_toggleRotatorButtonsInDialogHeader'](_0x3980b2['showRotator']),this['_chatBalloonView']['togglePartToolbarEnabled'](!_0x3980b2['areActionsDisabled']),this['_restoreDefaultViewFocus']();}['close'](){this['editor']['plugins']['get']('AIBalloon')['close']();}['updateContent'](_0x499851){return this['_chatBalloonView']||(this['_chatBalloonView']=this['_createChatBalloonView']()),this['_chatBalloonView']['updateContent'](_0x499851);}['setState'](_0x4fe879){this['_chatBalloonView']&&this['_chatBalloonView']['setState'](_0x4fe879);}['_createChatBalloonView'](){const _0x325b44=this['editor'],_0x9c5194=_0x325b44['plugins']['get']('AIBalloon'),_0x32675e=_0x325b44['commands']['get']('trackChanges');let _0x50f191=_0x325b44['config']['get']('ai.availableReplyActions')||[...ot];_0x325b44['plugins']['has']('TrackChanges')||(_0x50f191=_0x50f191['filter'](_0xabbb9a=>'insertSuggestion'!=_0xabbb9a));const _0x126290=new lt(_0x325b44['locale'],{'availableActions':_0x50f191,'showApplyButton':!0x0,'showSuggestButton':!!_0x32675e});return _0x126290['bind']('showDiff')['to'](this),_0x126290['delegate'](...ut)['to'](this),_0x126290['delegate']('showPrevious','showNext')['to'](this),_0x9c5194['delegate']('dialogClosed')['to'](this),_0x126290['on']('applySuggestion',this['_restoreDefaultViewFocus']['bind'](this)),_0x126290['on']('insertSuggestion',this['_restoreDefaultViewFocus']['bind'](this)),_0x126290['on']('rejectSuggestion',this['_restoreDefaultViewFocus']['bind'](this)),_0x32675e&&_0x126290['bind']('isTrackChangesOn')['to'](_0x32675e,'value'),_0x126290['render'](),_0x126290;}['_toggleRotatorButtonsInDialogHeader'](_0x378105){const _0x24d06f=this['editor'],_0x5ab2b2=_0x24d06f['plugins']['get']('Dialog')['view']['headerView']['children'];this['_chatBalloonView']['toggleRotatorButtonsVisibility'](_0x378105),_0x5ab2b2['has'](this['_chatBalloonView']['previousButtonView'])||(_0x5ab2b2['addMany']([this['_chatBalloonView']['previousButtonView'],this['_chatBalloonView']['nextButtonView']],0x0),_0x24d06f['plugins']['get']('AIBalloon')['once']('beforeDialogClosed',()=>{_0x5ab2b2['remove'](this['_chatBalloonView']['previousButtonView']),_0x5ab2b2['remove'](this['_chatBalloonView']['nextButtonView']);}));}['_restoreDefaultViewFocus'](){this['_chatBalloonView']['focus']();}}class Ba extends _0x364f16{static get['requires'](){return[qt,Ot,zt];}static get['pluginName'](){return'AIEditorIntegration';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}function Zt(_0x4266b7){const {editor:_0x6d406e,action:_0x34e8e9,withText:_0x15b250=!0x1,withIcon:_0x394dbc=!0x0,isInDropdown:_0x5b6b2b=!0x0,shouldPreventFocus:_0x3fd931=!0x1}=_0x4266b7;return()=>{const _0x5daa43=_0x6d406e['locale'],_0x5f009d=new _0x599e60(_0x5daa43),_0x3ea963=_0x5f009d['bindTemplate'];_0x5b6b2b&&_0x5f009d['extendTemplate']({'on':{'mouseenter':_0x3ea963['to'](()=>{_0x3fd931&&_0x3fd931()||_0x5f009d['focus']();})}});const _0x47e401=_0x34e8e9['icon']??_0x34e8e9['parent']?.['icon'];return _0x5f009d['set']({'label':_0x34e8e9['displayedPrompt'],'withText':_0x15b250,'role':'menuitem','icon':_0x394dbc?_0x47e401??_0x2d5fee:void 0x0,'tooltip':!_0x15b250,'class':'ck-ai-quick-actions-button','isEnabled':_0x34e8e9['isEnabled']}),_0x5f009d['on']('execute',()=>{_0x6d406e['editing']['view']['focus'](),_0x6d406e['commands']['execute']('aiQuickAction',_0x34e8e9);}),_0x5f009d;};}class Gs extends _0x2668dc{['arrowView'];constructor(_0x1bc028,_0x2fb69d){super(_0x1bc028,_0x2fb69d);const _0x30e690=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',_0x3416f6=>String(_0x3416f6)),'data-cke-tooltip-disabled':_0x30e690['to']('isOn')},'on':{'mouseenter':_0x30e690['to']('mouseenter')}});}['render'](){super['render'](),this['children']['add'](this['arrowView']);}['_createArrowView'](){const _0x55f4ae=new _0x528adc();return _0x55f4ae['content']=_0x1835f6,_0x55f4ae['extendTemplate']({'attributes':{'class':'ck-dropdown-menu-list__nested-menu__button__arrow'}}),_0x55f4ae;}}class Ks extends _0x20d034{['_allListItems'];['_allSearchableItems'];constructor(_0x24a365,_0xff9e66,_0x1e8d5c){super(_0x24a365),this['_allListItems']=_0xff9e66,this['_allSearchableItems']=_0x1e8d5c;}['filter'](_0x332e1c){if(!_0x332e1c)return this['items']['clear'](),this['items']['addMany'](this['_allListItems']),this['_clearHighlight'](),{'resultsCount':this['_allListItems']['length'],'totalItemsCount':this['_allListItems']['length']};const _0x382716=_0x332e1c['source']['toLowerCase']()['trim'](),_0x6ea25=this['_allSearchableItems']['filter'](_0x7abbc9=>(_0x7abbc9['groupLabel']?_0x7abbc9['label']+'\x20('+_0x7abbc9['groupLabel']+')':_0x7abbc9['label'])['toLowerCase']()['includes'](_0x382716));return this['items']['clear'](),this['items']['addMany'](_0x6ea25['sort']((_0x7bb003,_0x182acf)=>{const _0x137ed6=_0x7bb003['groupLabel'],_0x2a8a05=_0x182acf['groupLabel'];return _0x137ed6||_0x2a8a05?_0x137ed6?0x1:-0x1:0x0;})['map'](_0x1c70c3=>_0x1c70c3['item'])),this['_highlightQuery'](_0x382716,_0x6ea25),{'resultsCount':_0x6ea25['length'],'totalItemsCount':this['_allSearchableItems']['length']};}['_highlightQuery'](_0x298e78,_0x50e15f){if(!_0x298e78)return;const _0x285b8b=new RegExp(_0x201462(_0x298e78),'gi');_0x50e15f['forEach'](_0x2e43f4=>{_0x2e43f4['highlightViews']&&_0x2e43f4['highlightViews']['forEach'](_0x1297ac=>{'function'==typeof _0x1297ac['highlightText']&&_0x1297ac['highlightText'](_0x285b8b);});});}['_clearHighlight'](){this['_allSearchableItems']['forEach'](_0x48f40f=>{_0x48f40f['highlightViews']&&_0x48f40f['highlightViews']['forEach'](_0x5159f7=>{'function'==typeof _0x5159f7['highlightText']&&_0x5159f7['highlightText'](null);});});}}const Js='menu',Ws='menuitem';class co extends _0x5eeb09{['_bodyCollection'];['optionsListView'];['_searchTextView']=null;['_allSearchableItems']=[];['children'];['focusTracker'];['keystrokes'];['_focusables'];['focusCycler'];['_openNestedPanels']=new Set();['_hasSearch'];constructor(_0x183a69,_0x59a5b4,_0x2a2f5e,_0x47e867,_0x41f238=!0x1){const _0x54b62b=_0x183a69['locale'];super(_0x54b62b),this['_bodyCollection']=_0x47e867,this['_hasSearch']=_0x41f238;const _0x2e77f3=this['_createListItems'](_0x183a69,_0x59a5b4,_0x2a2f5e);this['optionsListView']=new Ks(_0x54b62b,_0x2e77f3,this['_allSearchableItems']),this['optionsListView']['role']=Js,this['optionsListView']['items']['addMany'](_0x2e77f3),this['focusTracker']=new _0x534506(),this['keystrokes']=new _0x33f2cf(),_0x41f238&&(this['_searchTextView']=this['_createSearchTextView']()),this['_focusables']=_0x2e77f3,this['focusCycler']=new _0x45d025({'focusables':this['_focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes']}),_0x41f238&&this['_searchTextView']&&this['focusCycler']['chain'](this['_searchTextView']['focusCycler']);const _0x170aa3=_0x41f238&&this['_searchTextView']?[this['_searchTextView']]:[this['optionsListView']];this['children']=new _0xa460cb(_0x170aa3),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-ai-quick-actions','ck-rounded-corners'],'dir':_0x54b62b['uiLanguageDirection']},'children':this['children']});}['_createSearchTextView'](){return new _0x4837ac(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 _0x25e7fe=this['_searchTextView']['queryView']['fieldView']['element']['ownerDocument']?.['activeElement'];return this['_searchTextView']['queryView']['fieldView']['element']['contains'](_0x25e7fe);}['_createListItems'](_0x1c3e95,_0x47ea0f,_0x4c0444){const _0x1b250c=new _0xa460cb();return _0x47ea0f['forEach'](_0x496e9e=>{if('actions'in _0x496e9e){const {listItem:_0x2c6764}=this['_createActionGroupButton'](_0x1c3e95,_0x496e9e,_0x4c0444);_0x1b250c['add'](_0x2c6764),_0x496e9e['actions']['forEach'](_0x2d719d=>{this['_createActionButton'](_0x1c3e95,_0x2d719d,_0x496e9e['label'],_0x496e9e['icon']);const {listItem:_0x4a6e61,highlightViews:_0x634030}=this['_createSearchResultActionButton'](_0x1c3e95,_0x2d719d,_0x496e9e['label'],_0x496e9e['icon']);this['_allSearchableItems']['push']({'item':_0x4a6e61,'label':_0x2d719d['displayedPrompt'],'groupLabel':_0x496e9e['label'],'highlightViews':_0x634030});});}else{const {listItem:_0x3992f9}=this['_createActionButton'](_0x1c3e95,_0x496e9e);_0x1b250c['add'](_0x3992f9);const _0x4bdc31=_0x3992f9['children']['first'];if(_0x4bdc31){const {listItem:_0x5ea6da,highlightViews:_0x3225b9}=this['_createSearchResultActionButton'](_0x1c3e95,_0x496e9e);this['_allSearchableItems']['push']({'item':_0x5ea6da,'label':_0x4bdc31['label']||'','highlightViews':_0x3225b9});}}}),_0x1b250c;}['_createActionButton'](_0x5f2f5f,_0x39bc15,_0x344178,_0x578313){const _0x26e395=new _0x8981d2(this['locale']);if(_0x344178&&_0x578313){const _0x168be2=new _0x599e60(this['locale']),_0x3682ab=_0x168be2['bindTemplate'],_0x20a98f=new _0x26b973();_0x20a98f['text']=_0x39bc15['displayedPrompt'];const _0x3b092e=new _0x26b973();_0x3b092e['text']=_0x344178;const _0x263dfd=new _0x528adc();_0x263dfd['content']=_0x578313,_0x263dfd['extendTemplate']({'attributes':{'class':'ck-ai-quick-actions-button__group-icon'}});const _0x415bc1=new _0x5eeb09(this['locale']);_0x415bc1['setTemplate']({'tag':'span','attributes':{'class':'ck-ai-quick-actions-button_with-group__open-paren'},'children':[{'text':'\x20('}]});const _0x1d6528=new _0x5eeb09(this['locale']);return _0x1d6528['setTemplate']({'tag':'span','attributes':{'class':'ck-ai-quick-actions-button_with-group__close-paren'},'children':[{'text':')'}]}),_0x168be2['set']({'label':_0x39bc15['displayedPrompt']+'\x20('+_0x344178+')','withText':!0x0,'role':'menuitem','class':'ck-ai-quick-actions-button\x20ck-ai-quick-actions-button_with-group','tooltip':!0x1}),_0x168be2['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':[_0x20a98f,_0x415bc1,_0x263dfd,_0x3b092e,_0x1d6528],'on':{'mouseenter':_0x3682ab['to'](()=>{this['_isSearchFocused']()||_0x168be2['focus']();}),'click':_0x3682ab['to'](()=>{_0x168be2['fire']('execute');})}}),_0x168be2['on']('execute',()=>{_0x5f2f5f['editing']['view']['focus'](),_0x5f2f5f['commands']['execute']('aiQuickAction',_0x39bc15);}),_0x26e395['children']['add'](_0x168be2),{'listItem':_0x26e395,'highlightViews':[_0x20a98f,_0x3b092e]};}{const _0xac3e32=new _0xbb56c(),_0x3a5eab=new _0x599e60(this['locale'],_0xac3e32),_0x38f7ce=_0x3a5eab['bindTemplate'],_0x36361a=_0x39bc15['icon']??_0x39bc15['parent']?.['icon'],_0x457072=void 0x0!==_0x39bc15['icon'];return _0x3a5eab['set']({'label':_0x39bc15['displayedPrompt'],'withText':!0x0,'role':'menuitem','icon':_0x457072?_0x36361a??_0x2d5fee:void 0x0,'tooltip':!0x1,'class':'ck-ai-quick-actions-button'}),_0x3a5eab['extendTemplate']({'on':{'mouseenter':_0x38f7ce['to'](()=>{this['_isSearchFocused']()||_0x3a5eab['focus']();})}}),_0x3a5eab['on']('execute',()=>{_0x5f2f5f['editing']['view']['focus'](),_0x5f2f5f['commands']['execute']('aiQuickAction',_0x39bc15);}),_0x26e395['children']['add'](_0x3a5eab),{'listItem':_0x26e395,'highlightViews':[_0xac3e32]};}}['_createSearchResultActionButton'](_0x2a839d,_0x3441a4,_0x2bcf0b,_0xde958b){return _0x2bcf0b&&_0xde958b?this['_createSearchResultGroupedActionButton'](_0x2a839d,_0x3441a4,_0x2bcf0b,_0xde958b):this['_createSearchResultIndividualActionButton'](_0x2a839d,_0x3441a4);}['_createSearchResultGroupedActionButton'](_0x578ab1,_0x25fdd5,_0x5621ff,_0x3360e9){const _0x3d519e=new _0x8981d2(this['locale']),_0x30fc84=new _0x599e60(this['locale']),_0x45e537=_0x30fc84['bindTemplate'],{view:_0x44bef9,highlightView:_0x17b978}=this['_createSearchResultGroupRow'](_0x5621ff,_0x3360e9),{view:_0x57eede,highlightView:_0x89ad5e}=this['_createSearchResultActionRow'](_0x25fdd5['displayedPrompt']),_0x53405d=this['_createSearchResultContentView'](_0x44bef9,_0x57eede);return _0x30fc84['set']({'label':_0x25fdd5['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}),_0x30fc84['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':[_0x53405d],'on':{'mouseenter':_0x45e537['to'](()=>{this['_isSearchFocused']()||_0x30fc84['focus']();}),'click':_0x45e537['to'](()=>{this['_handleSearchResultButtonClick'](_0x30fc84);})}}),this['_setupActionButtonExecution'](_0x30fc84,_0x578ab1,_0x25fdd5),_0x3d519e['children']['add'](_0x30fc84),{'listItem':_0x3d519e,'highlightViews':[_0x17b978,_0x89ad5e]};}['_createSearchResultIndividualActionButton'](_0x20541c,_0x18ff15){const _0x4f22be=new _0x8981d2(this['locale']),_0x2b3a8f=new _0xbb56c(),_0x4a777d=new _0x599e60(this['locale'],_0x2b3a8f),_0x5ed3ef=_0x4a777d['bindTemplate'];return _0x4a777d['set']({'label':_0x18ff15['displayedPrompt'],'withText':!0x0,'role':'menuitem','icon':void 0x0,'tooltip':!0x1,'class':'ck-ai-quick-actions-button\x20ck-ai-quick-actions-search-result-button'}),_0x4a777d['extendTemplate']({'on':{'mouseenter':_0x5ed3ef['to'](()=>{this['_isSearchFocused']()||_0x4a777d['focus']();})}}),this['_setupActionButtonExecution'](_0x4a777d,_0x20541c,_0x18ff15),_0x4f22be['children']['add'](_0x4a777d),{'listItem':_0x4f22be,'highlightViews':[_0x2b3a8f]};}['_createSearchResultGroupRow'](_0x50c388,_0x28acc8){const _0x52bdc0=new _0x5eeb09(this['locale']),_0x359687=new _0x528adc();_0x359687['content']=_0x28acc8,_0x359687['extendTemplate']({'attributes':{'class':'ck-ai-quick-actions-button__group-icon'}});const _0x21b9c9=new _0x26b973();return _0x21b9c9['text']=_0x50c388,_0x52bdc0['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-quick-actions-search-result__group-row'},'children':[_0x359687,_0x21b9c9]}),{'view':_0x52bdc0,'highlightView':_0x21b9c9};}['_createSearchResultActionRow'](_0x4a8275){const _0x2ffb27=new _0x5eeb09(this['locale']),_0x2e34ec=new _0x26b973();return _0x2e34ec['text']=_0x4a8275,_0x2ffb27['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-quick-actions-search-result__action-row'},'children':[_0x2e34ec]}),{'view':_0x2ffb27,'highlightView':_0x2e34ec};}['_createSearchResultContentView'](_0x23e5c9,_0x6412ce){const _0x4212f7=new _0x5eeb09(this['locale']);return _0x4212f7['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-quick-actions-search-result__content'},'children':[_0x23e5c9,_0x6412ce]}),_0x4212f7;}['_setupActionButtonExecution'](_0x583518,_0x5951b6,_0x4b1141){_0x583518['on']('execute',()=>{_0x5951b6['editing']['view']['focus'](),_0x5951b6['commands']['execute']('aiQuickAction',_0x4b1141);});}['_createActionGroupButton'](_0x52ed0e,_0x48a0bb,_0x2883e9){const _0x43c21b=new _0x8981d2(this['locale']),_0x2b2d4e=new _0xbb56c(),_0x246a0c=new Gs(this['locale'],_0x2b2d4e),_0x2e7404=_0x246a0c['bindTemplate'],_0xaac360=this['_getPanelKeystroke'](_0x2883e9),_0x331f7e=this['_createGroupActionsList'](_0x52ed0e,_0x48a0bb['actions'],_0x2883e9);_0x246a0c['set']({'label':_0x48a0bb['label'],'withText':!0x0,'role':Ws,'icon':_0x48a0bb['icon']??_0x2d5fee,'isEnabled':_0x48a0bb['actions']['some'](_0x8c0c72=>_0x8c0c72['isEnabled'])}),_0x246a0c['extendTemplate']({'on':{'mouseenter':_0x2e7404['to'](()=>{this['_isSearchFocused']()||_0x246a0c['focus']();})}});const _0x128d68=new _0x88aaab(this['locale']);return _0x128d68['extendTemplate']({'attributes':{'class':['ck','ck-reset_all','ck-ai-quick-actions-group-panel','ck-dropdown-menu__nested-menu__panel']},'on':{'keydown':_0x2e7404['to'](_0x28cc96=>{this['_handlePanelKeydown'](_0x28cc96,_0xaac360,_0x246a0c,_0x128d68);})}}),_0x246a0c['bind']('isOn')['to'](_0x128d68,'isVisible'),this['_bodyCollection']['add'](_0x128d68),_0x128d68['content']['add'](_0x331f7e),this['_setupGroupMenuBehavior'](_0x246a0c,_0x128d68),_0x43c21b['children']['add'](_0x246a0c),{'listItem':_0x43c21b,'highlightView':_0x2b2d4e};}['_createGroupActionsList'](_0x5dc6b9,_0x2d6586,_0x20f312){const _0x4f2100=new _0x20d034(this['locale']);return _0x4f2100['extendTemplate']({'attributes':{'class':['ck','ck-reset_all','ck-ai-quick-actions-group-list','ck-dropdown-menu-list']}}),_0x2d6586['forEach'](_0x5a64b4=>{const _0x14a148=new _0x8981d2(this['locale']),_0x16b338=Zt({'editor':_0x5dc6b9,'action':_0x5a64b4,'withText':!0x0,'withIcon':!0x1,'isInDropdown':!0x0,'shouldPreventFocus':()=>this['_isSearchFocused']()})();_0x14a148['children']['add'](_0x16b338),_0x20f312['focusTracker']['add'](_0x16b338),_0x4f2100['items']['add'](_0x14a148);}),_0x4f2100;}['_setupGroupMenuBehavior'](_0x24f5db,_0x5da86b){const _0x3e70f2=_0x24f5db['bindTemplate'],_0x324ba9=this['_getButtonKeystroke'](_0x24f5db);_0x24f5db['extendTemplate']({'attributes':{'class':['ck-ai-quick-actions-group-button']},'on':{'mouseenter':_0x3e70f2['to'](()=>{this['_showNestedPanel'](_0x5da86b,_0x24f5db);}),'mouseleave':_0x3e70f2['to'](_0x30cae0=>{const _0x132c4e=_0x30cae0['relatedTarget'];this['_isMovingToNestedMenu'](_0x132c4e,_0x5da86b)||this['_hideNestedPanel'](_0x5da86b);}),'keydown':_0x3e70f2['to'](_0x2ce76c=>{_0x2ce76c['key']==_0x324ba9&&(this['_showNestedPanel'](_0x5da86b,_0x24f5db),_0x5da86b['content']['get'](0x0)['focus']());})}}),_0x5da86b['on']('render',()=>{_0x5da86b['element']?.['addEventListener']('mouseleave',_0xb65cd9=>{const _0x1964e3=_0xb65cd9['relatedTarget'];_0x24f5db['element']?.['contains'](_0x1964e3)||this['_isMovingToNestedMenu'](_0x1964e3,_0x5da86b)||this['_hideNestedPanel'](_0x5da86b);});});}['_showNestedPanel'](_0x36617c,_0x37c674){this['_openNestedPanels']['forEach'](_0x58b1e1=>{_0x58b1e1!==_0x36617c&&_0x58b1e1['isVisible']&&_0x58b1e1['hide']();}),_0x36617c['show'](),_0x36617c['pin']({'positions':[_0xa1b8a3['eastSouth']],'target':_0x37c674['element'],'fitInViewport':!0x0}),this['_openNestedPanels']['add'](_0x36617c);}['_hideNestedPanel'](_0x32d92a){_0x32d92a['hide'](),this['_openNestedPanels']['delete'](_0x32d92a);}['_hideAllNestedPanels'](){this['_openNestedPanels']['forEach'](_0x31afb6=>_0x31afb6['hide']()),this['_openNestedPanels']['clear']();}['_isMovingToNestedMenu'](_0x167b5b,_0x3b7f55){if(!_0x167b5b)return!0x1;if(_0x3b7f55['element']?.['contains'](_0x167b5b))return!0x0;const _0x417516=_0x167b5b;return _0x417516['closest']&&(null!==_0x417516['closest']('.ck-ai-quick-actions-group-panel')||null!==_0x417516['closest']('.ck-ai-quick-actions-group-list')||null!==_0x417516['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'](_0x16f06f){return'rtl'===_0x16f06f['locale']['uiLanguageDirection']?'ArrowRight':'ArrowLeft';}['_getButtonKeystroke'](_0x2d4713){return'rtl'===_0x2d4713['locale']['uiLanguageDirection']?'ArrowLeft':'ArrowRight';}['_handlePanelKeydown'](_0x3cdc60,_0x1d7162,_0x1ca53d,_0x54c8f1){_0x3cdc60['key']==_0x1d7162&&(_0x1ca53d['focus'](),this['_hideNestedPanel'](_0x54c8f1));}['_handleSearchResultButtonClick'](_0x250c8b){_0x250c8b['fire']('execute');}}function Xt(_0x2e0169){const {editor:_0x422d0c,content:_0x99faa8,buttonDefinition:_0xe0ad05,bodyCollection:_0x292b6b,hasSearch:_0x41ffd5=!0x1}=_0x2e0169;return()=>{const _0x298090=_0x422d0c['locale'],_0x3739d0=_0xace15(_0x298090);_0x3739d0['buttonView']['set']({'icon':_0xe0ad05['icon']??_0x2d5fee,'label':_0xe0ad05['label'],'tooltip':!0x0}),_0x3739d0['set']({'class':'ck-ai-quick-actions-dropdown'});const _0xe62ffa=new co(_0x422d0c,_0x99faa8,_0x3739d0,_0x292b6b,_0x41ffd5);if(_0x3739d0['panelView']['children']['add'](_0xe62ffa),_0x41ffd5){const _0x310519='ai-quick-actions-dropdown-selection';_0x3739d0['on']('change:isOpen',(_0xa90119,_0x5c2e89,_0x4491c2)=>{if(_0x4491c2){if(_0x422d0c['plugins']['has']('AIEditing')){const _0x2e6667=_0x422d0c['plugins']['get'](D),_0x4dedb0=_0x422d0c['model']['document']['selection'],_0x59930e=Array['from'](_0x4dedb0['getRanges']());_0x59930e['length']>0x0&&_0x2e6667['showFakeVisualSelection'](_0x59930e,_0x310519,!0x1,!0x0);}}else _0x422d0c['plugins']['has']('AIEditing')&&_0x422d0c['plugins']['get'](D)['hideFakeVisualSelection'](_0x310519),_0xe62ffa['resetSearch']();});}return _0x3739d0;};}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(_0x4ab788){return _0x4ab788['CHAT']='CHAT',_0x4ab788['ACTION']='ACTION',_0x4ab788['REVIEW']='REVIEW',_0x4ab788;}({}),Ga=function(_0x12d895){return _0x12d895['CHAT']='AIChat',_0x12d895['ACTION']='AIActions',_0x12d895['REVIEW']='AIReviewMode',_0x12d895;}({});class ii extends _0x364f16{static get['requires'](){return[te,q];}static get['pluginName'](){return'AIQuickActionsUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}async['init'](){const _0x2f0181=await this['_getDefaultAndCustomActions']();this['_prepareQuickActionsDefinition'](_0x2f0181),this['_initializeQuickActionsComponentsAndCommands']();}static['getDefaultQuickActions'](_0xd5714c){return function(_0x2c2915){const _0x436d63=new Intl['DisplayNames'](['en'],{'type':'language'})['of'](_0x2c2915['uiLanguage']),_0x518085=_0x436d63||'English',_0x364778=[{'id':'ask-ai','displayedPrompt':i(_0x2c2915,'AI_QUICK_ACTIONS_ASK_AI'),'type':'CHAT','icon':Gt},{'id':'chat-commands','label':i(_0x2c2915,'AI_QUICK_ACTIONS_CHAT_COMMANDS'),'icon':Gt,'actions':[{'id':'explain','displayedPrompt':i(_0x2c2915,'AI_QUICK_ACTIONS_EXPLAIN'),'prompt':ee['replace']('%0',_0x518085),'type':'CHAT'},{'id':'summarize','displayedPrompt':i(_0x2c2915,'AI_QUICK_ACTIONS_SUMMARIZE'),'prompt':ie['replace']('%0',_0x518085),'type':'CHAT'},{'id':'highlight-key-points','displayedPrompt':i(_0x2c2915,'AI_QUICK_ACTIONS_HIGHLIGHT_KEY_POINTS'),'prompt':ne['replace']('%0',_0x518085),'type':'CHAT'}]},{'id':'improve-writing','displayedPrompt':i(_0x2c2915,'AI_QUICK_ACTIONS_IMPROVE_WRITING'),'type':'ACTION','icon':Bt},{'id':'continue','displayedPrompt':i(_0x2c2915,'AI_QUICK_ACTIONS_CONTINUE_WRITING'),'type':'ACTION','icon':Ft},{'id':'fix-grammar','displayedPrompt':i(_0x2c2915,'AI_QUICK_ACTIONS_FIX_GRAMMAR_SPELLING'),'type':'ACTION','icon':Wt},{'id':'adjust-length','label':i(_0x2c2915,'AI_QUICK_ACTIONS_ADJUST_LENGTH'),'icon':Kt,'actions':[{'id':'make-shorter','displayedPrompt':i(_0x2c2915,'AI_QUICK_ACTIONS_MAKE_SHORTER'),'type':'ACTION'},{'id':'make-longer','displayedPrompt':i(_0x2c2915,'AI_QUICK_ACTIONS_MAKE_LONGER'),'type':'ACTION'}]},{'id':'change-tone','label':i(_0x2c2915,'AI_QUICK_ACTIONS_CHANGE_TONE'),'icon':Yt,'actions':[{'id':'make-tone-casual','displayedPrompt':i(_0x2c2915,'AI_QUICK_ACTIONS_MORE_CASUAL'),'type':'ACTION'},{'id':'make-tone-direct','displayedPrompt':i(_0x2c2915,'AI_QUICK_ACTIONS_MORE_DIRECT'),'type':'ACTION'},{'id':'make-tone-friendly','displayedPrompt':i(_0x2c2915,'AI_QUICK_ACTIONS_MORE_FRIENDLY'),'type':'ACTION'},{'id':'make-tone-confident','displayedPrompt':i(_0x2c2915,'AI_QUICK_ACTIONS_MORE_CONFIDENT'),'type':'ACTION'},{'id':'make-tone-professional','displayedPrompt':i(_0x2c2915,'AI_QUICK_ACTIONS_MORE_PROFESSIONAL'),'type':'ACTION'}]},{'id':'translate','label':i(_0x2c2915,'AI_QUICK_ACTIONS_TRANSLATE'),'icon':Vt,'actions':[{'id':'translate-to-english','displayedPrompt':i(_0x2c2915,'AI_QUICK_ACTIONS_TRANSLATE_ENGLISH'),'type':'ACTION','actionName':'translate','args':{'language':'english'}},{'id':'translate-to-chinese','displayedPrompt':i(_0x2c2915,'AI_QUICK_ACTIONS_TRANSLATE_CHINESE'),'type':'ACTION','actionName':'translate','args':{'language':'chinese'}},{'id':'translate-to-spanish','displayedPrompt':i(_0x2c2915,'AI_QUICK_ACTIONS_TRANSLATE_SPANISH'),'type':'ACTION','actionName':'translate','args':{'language':'spanish'}},{'id':'translate-to-german','displayedPrompt':i(_0x2c2915,'AI_QUICK_ACTIONS_TRANSLATE_GERMAN'),'type':'ACTION','actionName':'translate','args':{'language':'german'}},{'id':'translate-to-french','displayedPrompt':i(_0x2c2915,'AI_QUICK_ACTIONS_TRANSLATE_FRENCH'),'type':'ACTION','actionName':'translate','args':{'language':'french'}},{'id':'translate-to-japanese','displayedPrompt':i(_0x2c2915,'AI_QUICK_ACTIONS_TRANSLATE_JAPANESE'),'type':'ACTION','actionName':'translate','args':{'language':'japanese'}},{'id':'translate-to-portuguese','displayedPrompt':i(_0x2c2915,'AI_QUICK_ACTIONS_TRANSLATE_PORTUGUESE'),'type':'ACTION','actionName':'translate','args':{'language':'portuguese'}},{'id':'translate-to-korean','displayedPrompt':i(_0x2c2915,'AI_QUICK_ACTIONS_TRANSLATE_KOREAN'),'type':'ACTION','actionName':'translate','args':{'language':'korean'}},{'id':'translate-to-italian','displayedPrompt':i(_0x2c2915,'AI_QUICK_ACTIONS_TRANSLATE_ITALIAN'),'type':'ACTION','actionName':'translate','args':{'language':'italian'}},{'id':'translate-to-russian','displayedPrompt':i(_0x2c2915,'AI_QUICK_ACTIONS_TRANSLATE_RUSSIAN'),'type':'ACTION','actionName':'translate','args':{'language':'russian'}}]},{'id':'other','label':i(_0x2c2915,'AI_QUICK_ACTIONS_OTHER'),'icon':Jt,'actions':[]}];return _0x364778;}(_0xd5714c);}async['_getDefaultAndCustomActions'](){const _0x4a8db2=ii['getDefaultQuickActions'](this['editor']['locale']),_0x546c39=this['editor']['config']['get']('ai.quickActions.extraCommands')||[];let _0x1d1c3d=[];try{_0x1d1c3d=await new It({'connector':this['editor']['plugins']['get']('AIConnector'),'locale':this['editor']['locale']})['getAll']();}catch(_0x215a0e){const _0x36982a=new _0x509ee0('ai-quick-actions-models-unable-to-retrieve',this,{'error':_0x215a0e});gt(_0x36982a['message']);}finally{const _0x35a3c4=_0x546c39['map'](_0x33470b=>({..._0x33470b,'icon':void 0x0}));_0x4a8db2['find'](_0x1e8cac=>'other'===_0x1e8cac['id'])['actions']['push'](..._0x35a3c4),_0x4a8db2['forEach'](_0xbee086=>{if('actions'in _0xbee086)_0xbee086['actions']['forEach'](_0x3a503a=>{if(_0x3a503a['isEnabled']=!!_0x1d1c3d['find'](_0x4ee252=>_0x4ee252['id']===_0x3a503a['model'])||void 0x0===_0x3a503a['model'],!_0x3a503a['isEnabled']){const _0x31c55a=new _0x509ee0('ai-quick-actions-unavailable-model',this,{'actionId':_0x3a503a['id'],'modelId':_0x3a503a['model']});gt(_0x31c55a['message']);}});else{if(_0xbee086['isEnabled']=!!_0x1d1c3d['find'](_0x15d26e=>_0x15d26e['id']===_0xbee086['model'])||void 0x0===_0xbee086['model'],!_0xbee086['isEnabled']){const _0x13fb47=new _0x509ee0('ai-quick-actions-unavailable-model',this,{'actionId':_0xbee086['id'],'modelId':_0xbee086['model']});gt(_0x13fb47['message']);}}});}return _0x4a8db2;}['_initializeQuickActionsComponentsAndCommands'](){const _0x5273ae=new _0x2f55eb(this['editor']['locale']);_0x5273ae['attachToDom'](),this['_initializeQuickActionsDropdown'](_0x5273ae),this['_initializeQuickActionsMenuBar'](),this['_initializeQuickActionsComponents'](_0x5273ae);}['_initializeQuickActionsDropdown'](_0x38cb64){const _0x42eaf3=this['editor']['config']['get']('ai.quickActions.isSearchEnabled')??!0x0;this['editor']['ui']['componentFactory']['add']('aiQuickActions',Xt({'editor':this['editor'],'content':this['_quickActionsDefinition'],'buttonDefinition':{'icon':_0x2d5fee,'label':i(this['editor']['locale'],'AI_QUICK_ACTIONS_HEADING')},'bodyCollection':_0x38cb64,'hasSearch':_0x42eaf3}));}['_prepareQuickActionsDefinition'](_0x5ac0f0){this['_quickActionsDefinition']=_0x5ac0f0['map'](_0x44e513=>{if('actions'in _0x44e513){const _0x1f7549=_0x44e513;return{..._0x1f7549,'actions':_0x1f7549['actions']['map'](_0x263d4b=>{const {actions:_0x4bbcb3,..._0x1300b5}=_0x1f7549;return{..._0x263d4b,'parent':_0x1300b5};})['filter'](_0x8dcb2b=>this['_shouldIncludeAction'](_0x8dcb2b))};}return _0x44e513;})['filter'](_0xabf8ac=>'actions'in _0xabf8ac?_0xabf8ac['actions']['length']>0x0:this['_shouldIncludeAction'](_0xabf8ac));}['_shouldIncludeAction'](_0x227847){const _0x4a0912=this['editor']['config']['get']('ai.quickActions.removeCommands')||[];return this['editor']['plugins']['has'](Ga[_0x227847['type']])&&!_0x4a0912['includes'](_0x227847['id'])&&!('CHAT'===_0x227847['type']&&!0x1===this['editor']['config']['get']('ai.chat.context.document.enabled'));}['_initializeQuickActionsComponents'](_0xf78988){this['_quickActionsDefinition']['forEach'](_0x51065e=>{if('actions'in _0x51065e){const _0xf7cfe0=Xt({'editor':this['editor'],'content':_0x51065e['actions'],'buttonDefinition':_0x51065e,'bodyCollection':_0xf78988});this['editor']['ui']['componentFactory']['add'](_0x51065e['id'],_0xf7cfe0),_0x51065e['actions']['forEach'](_0x1556b8=>{const _0x4c3d3b=Zt({'editor':this['editor'],'action':_0x1556b8});this['editor']['ui']['componentFactory']['add'](_0x1556b8['id'],_0x4c3d3b);});}else{const _0x4f04ce=Zt({'editor':this['editor'],'action':_0x51065e,'withText':!0x1,'withIcon':!0x0,'isInDropdown':!0x1});this['editor']['ui']['componentFactory']['add'](_0x51065e['id'],_0x4f04ce);}});}['_initializeQuickActionsMenuBar'](){this['editor']['ui']['componentFactory']['add']('menuBar:aiQuickActions',_0x1edb95=>{const _0x489feb=new _0x3a7b62(_0x1edb95),_0x13f77f=i(_0x1edb95,'AI_QUICK_ACTIONS_HEADING');_0x489feb['buttonView']['set']({'label':_0x13f77f,'icon':_0x2d5fee});const _0x5498fe=new _0x47b040(_0x1edb95);_0x5498fe['set']({'ariaLabel':_0x13f77f,'role':'menu'}),this['_quickActionsDefinition']['forEach'](_0x412380=>{if('actions'in _0x412380){const _0x5c16a5=_0x412380,_0x459a3c=new _0x4ae876(_0x1edb95,_0x489feb),_0x21e632=new _0x3a7b62(_0x1edb95),_0x454365=new _0x47b040(_0x1edb95);_0x21e632['buttonView']['set']({'label':_0x5c16a5['label'],'icon':_0x5c16a5['icon']}),_0x5c16a5['actions']['forEach'](_0x512a86=>{const _0x29e97d=new _0x4ae876(_0x1edb95,_0x21e632),_0x20c7be=new _0x2d1f80(_0x1edb95);_0x20c7be['set']({'label':_0x512a86['displayedPrompt'],'icon':_0x512a86['icon'],'role':'menuitem','isEnabled':_0x512a86['isEnabled']}),_0x20c7be['on']('execute',()=>{this['_executeQuickAction'](_0x512a86);}),_0x20c7be['delegate']('execute')['to'](_0x21e632),_0x29e97d['children']['add'](_0x20c7be),_0x454365['items']['add'](_0x29e97d);}),_0x21e632['panelView']['children']['add'](_0x454365),_0x459a3c['children']['add'](_0x21e632),_0x5498fe['items']['add'](_0x459a3c);}else{const _0x5bb5dc=_0x412380,_0x5f58b0=new _0x4ae876(_0x1edb95,_0x489feb),_0x4095be=new _0x2d1f80(_0x1edb95);_0x4095be['set']({'label':_0x5bb5dc['displayedPrompt'],'icon':_0x5bb5dc['icon'],'role':'menuitem','isEnabled':_0x5bb5dc['isEnabled']}),_0x4095be['on']('execute',()=>{this['_executeQuickAction'](_0x5bb5dc);}),_0x4095be['delegate']('execute')['to'](_0x489feb),_0x5f58b0['children']['add'](_0x4095be),_0x5498fe['items']['add'](_0x5f58b0);}});const _0x54db12=Object['values'](Ga)['some'](_0x2e2766=>this['editor']['plugins']['has'](_0x2e2766));return _0x489feb['set']({'isEnabled':_0x54db12}),_0x489feb['panelView']['children']['add'](_0x5498fe),_0x489feb;});}['_executeQuickAction'](_0x38036d){const _0x166b38=this['editor'];_0x166b38['editing']['view']['focus'](),_0x166b38['commands']['execute']('aiQuickAction',_0x38036d);const _0x1d60ee=_0x166b38['ui']['view']['menuBarView'];_0x1d60ee&&_0x1d60ee['close']&&_0x1d60ee['close']();}}class ci extends Lt{['execute'](_0x367135){switch(this['_expandSelectionIfCollapsed'](),_0x367135['type']){case Qt['CHAT']:if(!this['editor']['plugins']['has']('AIChat')){const _0x4163f1=i(this['editor']['locale'],'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND','AIChat');throw new _0x509ee0('ai-quick-actions-plugin-not-found',this['editor'],{'errorMessage':_0x4163f1});}this['_handleAIChatAction'](_0x367135);break;case Qt['ACTION']:if(!this['editor']['plugins']['has']('AIActions')){const _0x231b5b=i(this['editor']['locale'],'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND','AIActions');throw new _0x509ee0('ai-quick-actions-plugin-not-found',this['editor'],{'errorMessage':_0x231b5b});}this['_handleAIActionsAction'](_0x367135);break;case Qt['REVIEW']:if(!this['editor']['plugins']['has']('AIReviewMode')){const _0x363b1b=i(this['editor']['locale'],'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND','AIReviewMode');throw new _0x509ee0('ai-quick-actions-plugin-not-found',this['editor'],{'errorMessage':_0x363b1b});}this['_handleAIReviewAction'](_0x367135);}}async['_handleAIChatAction'](_0xad9960){const _0x415493=this['editor']['plugins']['get']('AIChat'),_0x2cdfa4=this['editor']['plugins']['get']('AIChatController'),_0x240504=this['editor']['plugins']['get']('AITabs')['view'];if(_0x240504['isVisible']||(_0x240504['isVisible']=!0x0),'chat'!==_0x240504['activeTab']&&_0x240504['activateTab']('chat'),'ask-ai'===_0xad9960['id'])_0x2cdfa4['removeSelectionFromChatContext'](),await _0x415493['addSelectionToChatContext'](),_0x415493['focusPromptInput']();else await _0x415493['startConversation'](),_0x2cdfa4['removeSelectionFromChatContext'](),await _0x415493['addSelectionToChatContext'](),_0x415493['focusPromptInput'](),await _0x415493['sendMessage']({'message':_0xad9960['prompt']||_0xad9960['displayedPrompt'],'attributes':{'quickActionData':{'id':_0xad9960['id']},'displayedPrompt':_0xad9960['displayedPrompt']}});}['_expandSelectionIfCollapsed'](){const _0x551f7a=this['editor'],_0x4b1ad9=_0x551f7a['model']['document']['selection'];if(!_0x4b1ad9['isCollapsed'])return;const _0x3172b7=_0x48a97f(_0x4b1ad9['getSelectedBlocks']())||_0x551f7a['model']['schema']['getLimitElement'](_0x4b1ad9);_0x551f7a['model']['change'](_0xc3d58d=>{_0xc3d58d['setSelection'](_0x3172b7,'in');});}['_handleAIActionsActionLabel'](_0x23ec66){return _0x23ec66['parent']?.['label']&&'other'!==_0x23ec66['parent']?.['id']?_0x23ec66['parent']['label']+':\x20'+_0x23ec66['displayedPrompt']:_0x23ec66['displayedPrompt'];}async['_handleAIActionsAction'](_0x73728a){const _0x4ceb7a=this['editor']['plugins']['get']('AIActions'),_0x3dcaca=_0x73728a['prompt']?{'userMessage':_0x73728a['prompt'],'model':_0x73728a['model']}:{'actionName':_0x73728a['actionName']||_0x73728a['id'],'args':_0x73728a['args']},_0x1cb038=this['_handleAIActionsActionLabel'](_0x73728a);await _0x4ceb7a['executeAction'](_0x3dcaca,_0x1cb038,_0x73728a['icon']);}async['_handleAIReviewAction'](_0x427f08){console['log']('handleAIReviewAction',_0x427f08);}}class ti extends _0x364f16{static get['pluginName'](){return'AIQuickActionsEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0xb00f73=this['editor'],_0x421f69=new ci(this['editor']);if(_0xb00f73['commands']['add']('aiQuickAction',_0x421f69),_0xb00f73['plugins']['has']('AIChat')){const _0x2e4a26=this['editor']['plugins']['get']('AIChat');_0xb00f73['model']['document']['selection']['on']('change:range',(_0x4b4cd6,_0x28f4c7)=>{_0x28f4c7['directChange']&&_0x2e4a26['removeSelectionFromChatContext']();});}}}class Ge extends He{['updateChangeGroups'](){if(this['parsedMergedContent']=this['parsedContent']['cloneNode'](!0x0),0x0==this['parsedMergedContent']['childNodes']['length'])return void(this['changeGroups']=[]);const _0x3d84b3=this['documentContextContent']['children']['map'](_0x459d27=>({'node':_0x459d27,'id':At(_0x459d27,'data-id')})),_0x50cc74=this['parsedMergedContent']['children']['map'](_0xa6ef24=>({'node':_0xa6ef24,'id':At(_0xa6ef24,'data-id')||_0x3dbf6d()})),_0x50287a=_0xdd08a5(_0x3d84b3,_0x50cc74,{'comparator':(_0x1b86db,_0x1bb5df)=>_0x1b86db['id']==_0x1bb5df['id'],'oneChangePerToken':!0x0});if(!this['isDone']){for(;_0x50287a['length']&&_0x50287a[_0x50287a['length']-0x1]['removed'];)_0x50287a['pop']();}const _0x393c21=_0x50287a['map'](_0x556b56=>{const _0x37a609=_0x556b56['added']?'new':_0x556b56['removed']?'removed':'modified';return{'node':_0x556b56['value'][0x0]['node'],'type':_0x37a609,'id':_0x556b56['value'][0x0]['id']};});this['changeGroups']=[{'changes':_0x393c21,'state':'pending','index':0x0}];}['_getDifferentChangeGroups'](_0x52f407,_0x3d051c){return _0x3d051c;}}class W extends Fe{['content'];['version'];['actionName'];['args'];['userMessage'];['model'];['hasError']=!0x1;constructor(_0x2fed3a){super(_0x2fed3a),this['content']=_0x2fed3a['content'],this['version']=_0x2fed3a['version'],this['actionName']=_0x2fed3a['actionName'],this['args']=_0x2fed3a['args'],this['userMessage']=_0x2fed3a['userMessage'],this['model']=_0x2fed3a['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':Be['TEXT'],'content':this['content'],'version':this['version'],'label':'Current\x20document','uiId':'current-document'};}['createReply'](_0x231b5d){const _0x205117=new Ge({'editor':this['editor'],'documentContextContent':this['content'],..._0x231b5d});return this['replies']['push'](_0x205117),_0x205117['delegate'](...ze)['to'](this),this['fire']('replyCreated',_0x205117),_0x205117;}}class Bn extends _0x1b53e3{constructor(_0x3aab67,_0x454afc=!0x0,_0x393130=!0x0){super(_0x3aab67),this['set']('isEnabled',!0x1),_0x454afc&&(this['applyButton']=this['_createButton'](i(_0x3aab67,'AI_BALLOON_APPLY_BUTTON'),'ck-ai-button-primary'),this['applyButton']['bind']('isEnabled')['to'](this),this['items']['add'](this['applyButton'])),_0x393130&&(this['suggestButton']=this['_createButton'](i(_0x3aab67,'AI_BALLOON_SUGGEST_BUTTON'),_0x454afc?'ck-ai-button-secondary':'ck-ai-button-primary'),this['suggestButton']['bind']('isEnabled')['to'](this),this['items']['add'](this['suggestButton'])),this['setButtonsVisibility']({'showApplyButton':_0x454afc,'showSuggestButton':_0x393130}),this['extendTemplate']({'attributes':{'class':['ck-ai-balloon__toolbar']}});}['setButtonsVisibility']({showApplyButton:_0x345547,showSuggestButton:_0x95968d}){this['applyButton']&&(this['applyButton']['isVisible']=_0x345547),this['suggestButton']&&(this['suggestButton']['isVisible']=_0x95968d);}['_createButton'](_0x5ba4db,_0x282390){const _0x29c1f9=new _0x599e60(this['locale']);return _0x29c1f9['set']({'label':_0x5ba4db,'class':_0x282390,'isVisible':!0x0,'withText':!0x0}),_0x29c1f9;}}class yn extends _0x5eeb09{constructor(_0x3881c9){super(_0x3881c9),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(_0x3881c9,'AI_DISCLAIMER_TEXT')}]}]});}}class Nn extends _0x5eeb09{constructor(_0x16888e){super(_0x16888e),this['set']('isVisible',!0x0);const _0x4cb5f9=new pi('small');_0x4cb5f9['isVisible']=!0x0;const _0x18667e=new _0x5eeb09(this['locale']);_0x18667e['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',_0x2344d3=>!_0x2344d3)]},'children':[_0x4cb5f9,_0x18667e]});}}class rt extends ls{['focusCycler'];['_config'];['_contentWrapper'];['_streamableContentView'];['_toolbarView'];['_miniToolbarView'];['_loaderView'];['_disclaimerView'];['_focusTracker'];['_keystrokes'];['_dialogContent'];['_focusables'];['_scrollManager'];['_navigationPreviousButton'];['_navigationNextButton'];['_navigationTryAgainButton'];['_navigationCounter'];constructor(_0xe9157c,_0x1279e7){super(_0xe9157c),this['set']('isBusy',!0x1),this['set']('isTrackChangesOn',!0x1),this['set']('_isLoading',!0x1),this['set']('_hasError',!0x1),this['_config']=_0x1279e7,this['_focusTracker']=new _0x534506(),this['_keystrokes']=new _0x33f2cf(),this['_focusables']=this['createCollection'](),this['focusCycler']=new _0x45d025({'focusables':this['_focusables'],'focusTracker':this['_focusTracker'],'keystrokeHandler':this['_keystrokes'],'actions':{'focusPrevious':'shift\x20+\x20tab','focusNext':'tab'}}),this['_dialogContent']=new _0xa460cb(),this['_addContentWrapper'](_0x1279e7),this['_addDisclaimerView'](),this['_addToolbar'](_0x1279e7),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'](_0x1279e7);});}['render'](){super['render']();for(const _0x267853 of this['_focusables'])this['_focusTracker']['add'](_0x267853['element']);this['_keystrokes']['listenTo'](this['element']),this['_initializeScrollManager']();}['destroy'](){super['destroy'](),this['_scrollManager']&&this['_scrollManager']['destroy']();}['focus'](_0x2dc31c){-0x1===_0x2dc31c?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}['setIsLoading'](_0x470caf){this['_isLoading']=_0x470caf;}['setErrorState'](){this['_hasError']=!0x0,this['_miniToolbarView']['toggleShowChangesEnabled'](!0x1);}['clearErrorState'](){this['_hasError']=!0x1,this['_miniToolbarView']['toggleShowChangesEnabled'](!0x0);}['showError'](_0x4bac46){super['showError'](_0x4bac46),this['_dialogContent']['has'](this['_errorView'])||this['_dialogContent']['add'](this['_errorView'],0x0);}['hideError'](){super['hideError'](),this['clearErrorState']();}['showBlockingError'](_0x3893af){super['showBlockingError'](_0x3893af),this['setErrorState']();}['addMiniToolbarItem'](_0x2d89d7){this['_miniToolbarView']['items']['has'](_0x2d89d7)||this['_miniToolbarView']['items']['add'](_0x2d89d7);}['removeMiniToolbarItem'](_0x2c98be){this['_miniToolbarView']['items']['has'](_0x2c98be)&&this['_miniToolbarView']['items']['remove'](_0x2c98be);}['showLoader'](){this['_loaderView']&&(this['_isLoading']=!0x0);}['hideLoader'](){this['_loaderView']&&(this['_isLoading']=!0x1);}['_toggleToolbarButtonsVisibility']({showApplyButton:_0x3fdf5c,showSuggestButton:_0x48a23a}){_0x3fdf5c=_0x3fdf5c&&!this['isTrackChangesOn']&&this['_config']['availableActions']['includes']('applySuggestion'),_0x48a23a=_0x48a23a&&this['_config']['availableActions']['includes']('insertSuggestion'),this['_toolbarView']['setButtonsVisibility']({'showApplyButton':_0x3fdf5c,'showSuggestButton':_0x48a23a});}async['updateContent'](_0x2a7cf7){await this['_streamableContentView']['update'](_0x2a7cf7);}['clearContent'](){this['_streamableContentView']['clear']();}['_addContentWrapper'](_0x55d9d8){this['_contentWrapper']=new _0x5eeb09(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'](_0x55d9d8['miniToolbarConfig'])]}),this['_dialogContent']['add'](this['_contentWrapper']);}['_addDisclaimerView'](){this['_disclaimerView']=new yn(this['locale']),this['_dialogContent']['add'](this['_disclaimerView']);}['_addToolbar']({showApplyButton:_0x4cff9f,showSuggestButton:_0x3f0719}){this['_toolbarView']=new Bn(this['locale'],_0x4cff9f,_0x3f0719),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',(_0x1342a9,_0x16c32a,_0x9c7b0b)=>!(_0x1342a9||_0x16c32a||_0x9c7b0b)),this['_toggleToolbarButtonsVisibility']({'showApplyButton':_0x4cff9f,'showSuggestButton':_0x3f0719}),this['_dialogContent']['add'](this['_toolbarView']);}['_createMiniToolbar'](_0x2d53fd){return this['_miniToolbarView']=new us(this['locale'],_0x2d53fd),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',(_0x24a282,_0x39d1b2)=>!(_0x24a282||_0x39d1b2)),this['_miniToolbarView'];}['_createLoaderView'](){return this['_loaderView']=new Nn(this['locale']),this['_loaderView']['bind']('isVisible')['to'](this,'_isLoading'),this['_loaderView'];}['_createStreamableContentView'](){return this['_streamableContentView']=new as(this['locale']),this['_streamableContentView'];}['_setupMiniToolbarButtons'](){const _0x55b364=new _0x599e60(this['locale']),_0x5b7625=new _0x599e60(this['locale']),_0x1f2778=new Ln(this['locale']),_0x12ae59=new _0x599e60(this['locale']);_0x55b364['set']({'icon':_0x4a8e88,'label':i(this['locale'],'AI_ACTIONS_TRY_AGAIN'),'tooltip':!0x0,'class':'ck-ai-custom-action-button'}),_0x5b7625['set']({'icon':_0x2e8801,'tooltip':i(this['locale'],'AI_ACTIONS_PREVIOUS_INTERACTION'),'class':'ck-ai-navigation-button\x20ck-ai-previous-button'}),_0x12ae59['set']({'icon':_0x3f1156,'tooltip':i(this['locale'],'AI_ACTIONS_NEXT_INTERACTION'),'class':'ck-ai-navigation-button\x20ck-ai-next-button'}),_0x55b364['bind']('isEnabled')['to'](this,'isBusy',_0x35e600=>!_0x35e600),_0x55b364['on']('execute',()=>{this['fire']('tryAgain');}),_0x5b7625['bind']('isEnabled')['to'](this,'isBusy',_0x5cbf3c=>!_0x5cbf3c),_0x5b7625['on']('execute',()=>{this['fire']('showPrevious');}),_0x12ae59['bind']('isEnabled')['to'](this,'isBusy',_0x543d3e=>!_0x543d3e),_0x12ae59['on']('execute',()=>{this['fire']('showNext');}),this['_navigationPreviousButton']=_0x5b7625,this['_navigationCounter']=_0x1f2778,this['_navigationNextButton']=_0x12ae59,this['_navigationTryAgainButton']=_0x55b364;}['updateMiniToolbarButtons'](_0x4db89c,_0x4a252f){this['_navigationPreviousButton']||this['_setupMiniToolbarButtons']();const _0x4f789d=_0x4db89c>0x1;if(this['addMiniToolbarItem'](this['_navigationTryAgainButton']),_0x4f789d){this['addMiniToolbarItem'](this['_navigationPreviousButton']),this['addMiniToolbarItem'](this['_navigationCounter']),this['addMiniToolbarItem'](this['_navigationNextButton']);const _0x269865=_0x4db89c-_0x4a252f;this['_navigationCounter']['setInteractionCount'](_0x269865+'/'+_0x4db89c),this['_navigationPreviousButton']['isEnabled']=_0x4a252f<_0x4db89c-0x1,this['_navigationNextButton']['isEnabled']=_0x4a252f>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'](_0x5c0aca){this['_isLoading']=_0x5c0aca;}['resetShowChangesButton'](){this['_miniToolbarView']['isShowChangesOn']=!0x1;}['_initializeScrollManager'](){const _0x4470b6=this['_getScrollableElement']();_0x4470b6&&!this['_scrollManager']&&(this['_scrollManager']=new gi(_0x4470b6));}['_getScrollableElement'](){return this['_streamableContentView']['element'];}}class Ln extends _0x5eeb09{constructor(_0x278f94){super(_0x278f94);const _0x519ee1=this['bindTemplate'];this['set']('interactionCount','1/1'),this['setTemplate']({'tag':'span','attributes':{'class':['ck-ai-interaction-counter']},'children':[{'text':_0x519ee1['to']('interactionCount')}]});}['setInteractionCount'](_0x25eddb){this['set']('interactionCount',_0x25eddb);}}class ri extends _0x364f16{static get['requires'](){return[q,_0x1aff54,D,Q,_0x31d190];}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(_0xd95595){super(_0xd95595),this['_bodyCollection']=new _0x2f55eb(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'](_0x613477,_0x4bac3e,_0x1001be){if(this['_stopInteraction'](),this['editor']['plugins']['has']('TableSelection')){if(this['editor']['plugins']['get']('TableSelection')['getSelectedTableCells']()){const {modelFragment:_0x5aca1b,anchorData:_0x5195ce}=this['_getExecuteDataInTable']();return this['_executeAction'](_0x613477,_0x5aca1b,_0x5195ce,_0x4bac3e,_0x1001be);}}const {modelFragment:_0x1966ce,anchorData:_0x293779}=this['_getExecuteDataRegular']();return this['_executeAction'](_0x613477,_0x1966ce,_0x293779,_0x4bac3e,_0x1001be);}async['destroy'](){return this['_stopInteraction'](),this['_bodyCollection']['detachFromDom'](),super['destroy']();}['_createActionsBalloonView'](){const _0x374a00=this['editor']['plugins']['has']('TrackChanges');let _0x536ed2=this['editor']['config']['get']('ai.availableReplyActions')||[...ot];_0x374a00||(_0x536ed2=_0x536ed2['filter'](_0x17c02d=>'insertSuggestion'!=_0x17c02d));const _0x4b1a5c=this['editor']['commands']['get']('trackChanges'),_0x3c5c5b=new rt(this['editor']['locale'],{'showApplyButton':!0x0,'showSuggestButton':_0x374a00,'miniToolbarConfig':{'showChanges':'icon'},'availableActions':_0x536ed2});return _0x3c5c5b['bind']('isBusy')['to'](this),_0x4b1a5c&&_0x3c5c5b['bind']('isTrackChangesOn')['to'](_0x4b1a5c,'value'),_0x3c5c5b['on']('tryAgain',()=>{this['_refreshInteraction']();}),_0x3c5c5b['on']('showPrevious',()=>{this['_navigateToPrevious']();}),_0x3c5c5b['on']('showNext',()=>{this['_navigateToNext']();}),_0x3c5c5b;}['_getExecuteDataRegular'](){const _0x52d9be=this['editor']['model']['document']['selection'];if(_0x52d9be['isCollapsed']){const _0x1ef078=_0x48a97f(_0x52d9be['getSelectedBlocks']())||this['editor']['model']['schema']['getLimitElement'](_0x52d9be);this['editor']['model']['change'](_0x5dcb31=>{_0x5dcb31['setSelection'](_0x1ef078,'in');});}const _0x3e5116=_0x52d9be['getFirstRange'](),_0x1573b0=this['_wrapWithCommonAncestors'](this['editor']['model']['getSelectedContent'](_0x52d9be),_0x3e5116['start'],_0x3e5116['end']);this['_copyMarkersToFragment'](_0x1573b0,_0x52d9be,{'isTableSelection':!0x1});const _0x22775b=_0x52d9be['getFirstRange']()['start'],_0x2772d5=new Map();let _0x3d8430=_0x1573b0;for(let _0x1071a9=0x0;_0x1071a9<_0x22775b['path']['length'];_0x1071a9++)_0x2772d5['set'](_0x3d8430,_0x22775b['path'][_0x1071a9]),_0x3d8430=_0x3d8430['getChild'](0x0);return{'modelFragment':_0x1573b0,'anchorData':_0x2772d5};}['_getExecuteDataInTable'](){const _0x22415f=this['editor']['model']['document']['selection'],_0x57dd04=this['editor']['plugins']['get']('TableSelection')['getSelectionAsFragment'](),_0x701c2f=_0x22415f['getFirstRange']()['start']['parent']['parent'],_0x11d36a=this['editor']['model']['createRange'](this['editor']['model']['createPositionBefore'](_0x701c2f),this['editor']['model']['createPositionAfter'](_0x701c2f)),_0x41d13e=this['_wrapWithCommonAncestors'](_0x57dd04,_0x11d36a['start'],_0x11d36a['end']);this['_copyMarkersToFragment'](_0x41d13e,_0x22415f,{'isTableSelection':!0x0});const _0x4ca31f=_0x22415f['getFirstRange']()['start'],_0x27f6f3=new Map();let _0x5162fa=_0x41d13e;for(let _0x53ea60=0x0;_0x53ea60<_0x4ca31f['path']['length'];_0x53ea60++)if(_0x27f6f3['set'](_0x5162fa,_0x4ca31f['path'][_0x53ea60]),_0x53ea60<_0x4ca31f['path']['length']-0x1)_0x5162fa=_0x5162fa['getChild'](0x0);else{let _0x4ff1e2=_0x5162fa['nextSibling'];for(;_0x4ff1e2;)_0x27f6f3['set'](_0x4ff1e2,_0x4ca31f['path'][_0x53ea60]),_0x4ff1e2=_0x4ff1e2['nextSibling'];}return{'modelFragment':_0x41d13e,'anchorData':_0x27f6f3};}async['_executeAction'](_0x426abf,_0x45aae2,_0x463064,_0x168d3b,_0x127325){const _0x2a140b=this['editor']['plugins']['get'](D),_0x5982e1=this['editor']['plugins']['get'](Q),_0x1760c4=this['editor']['model']['document']['selection'],_0x270ad6=await _0x2a140b['modelToDataWithIds'](_0x45aae2),_0x4bda25=this['editor']['model']['document']['version'],_0x534099=[..._0x1760c4['getRanges']()];return this['_actionsBalloonView']||(this['_actionsBalloonView']=this['_createActionsBalloonView']()),this['_clearInteractionHistory'](),this['_clearErrorState'](),this['_actionsBalloonView']['clearContent'](),_0x5982e1['open']({'index':0x3e8*Math['random']()%0x3e8,'title':_0x168d3b,'icon':_0x127325||_0x2d5fee,'mainView':this['_actionsBalloonView'],'class':'ck-ai-actions-balloon','ranges':_0x534099,'id':'aiActionsBalloon'}),this['_setLoadingState'](),this['stopListening'](this['_actionsBalloonView']),this['stopListening'](_0x5982e1),this['_interactionParams']={'action':_0x426abf,'content':_0x270ad6,'version':_0x4bda25,'aiBalloon':_0x5982e1,'modelFragment':_0x45aae2,'anchorData':_0x463064},this['_setupApplyListeners'](),this['listenTo'](_0x5982e1,'selectionRemoved',()=>{this['_stopInteraction'](),this['_actionsBalloonView']['disableMiniToolbarButtons']();}),this['listenTo'](_0x5982e1,'dialogClosed',(_0x3048be,{id:_0xab7236})=>{if('aiActionsBalloon'===_0xab7236){if(this['_interaction']&&this['_interaction']['replies']['length']>0x0){const _0x2da207=this['_interaction']['replies'][this['_interaction']['replies']['length']-0x1],_0x39e2e3=_0x2da207['changeGroups'][0x0];_0x39e2e3&&'pending'===_0x39e2e3['state']&&_0x2da207['setChangeGroupState'](0x0,'rejected');}this['_stopInteraction'](),this['_clearInteractionHistory'](),this['stopListening'](this['_actionsBalloonView']),this['stopListening'](_0x5982e1);}}),this['_createInteraction'](_0x270ad6,_0x4bda25,_0x5982e1,_0x426abf);}['_setupApplyListeners'](){if(!this['_interactionParams'])return;const {modelFragment:_0x49d64a,anchorData:_0x358344}=this['_interactionParams'];this['listenTo'](this['_actionsBalloonView'],'applySuggestion',()=>{this['_applyChanges'](_0x49d64a,_0x358344,!0x1);}),this['listenTo'](this['_actionsBalloonView'],'insertSuggestion',()=>{this['_applyChanges'](_0x49d64a,_0x358344,!0x0);});}['_wrapWithCommonAncestors'](_0x5357ac,_0x39bd0b,_0x1112d8){const _0x485d7b=this['editor']['model']['createRange'](_0x39bd0b,_0x1112d8)['getCommonAncestor'](),_0x20647=_0x485d7b['is']('documentFragment')?[]:_0x485d7b['getAncestors']({'includeSelf':!0x0})['slice'](0x1);if(_0x20647['length']){const _0x804ed4=_0x20647['map'](_0x3e4226=>_0x3e4226['_clone'](!0x1));for(let _0x3b41b7=0x1;_0x3b41b7<_0x804ed4['length'];_0x3b41b7++)_0x804ed4[_0x3b41b7-0x1]['_appendChild'](_0x804ed4[_0x3b41b7]);return _0x804ed4[_0x804ed4['length']-0x1]['_appendChild'](_0x5357ac),new tt(_0x804ed4[0x0]);}return _0x5357ac;}['_copyMarkersToFragment'](_0x502f09,_0x1fb746,_0x1daf5f={'isTableSelection':!0x1}){const _0x14896f=this['editor']['model'],_0x5aa5d3=Array['from'](_0x1fb746['getRanges']()),_0x4ff3c6=_0x1fb746['getFirstRange']()['start'];for(const _0x431f52 of _0x14896f['markers']){if(_0x431f52['name']['startsWith'](R)||!_0x431f52['affectsData'])continue;const _0x140507=_0x431f52['getRange']();if(!_0x5aa5d3['some'](_0x3d7b5c=>_0x3d7b5c['containsRange'](_0x140507,!0x0)))continue;const _0x137b74=this['_regularCalculateMarkerPath'](_0x140507['start'],_0x4ff3c6,_0x1daf5f['isTableSelection']),_0x4369cf=this['_regularCalculateMarkerPath'](_0x140507['end'],_0x4ff3c6,_0x1daf5f['isTableSelection']),_0x4c51ca=_0x14896f['createPositionFromPath'](_0x502f09,_0x137b74),_0x21a2b5=_0x14896f['createPositionFromPath'](_0x502f09,_0x4369cf);if(!_0x4c51ca['isEqual'](_0x21a2b5)){const _0x389a48=_0x14896f['createRange'](_0x4c51ca,_0x21a2b5);_0x502f09['markers']['set'](_0x431f52['name'],_0x389a48);}}}['_regularCalculateMarkerPath'](_0x30a029,_0x1eda57,_0x520032=!0x1){const _0x47000d=[..._0x30a029['path']['slice']()];for(let _0x2f1d43=0x0;_0x2f1d43<Math['max'](_0x1eda57['path']['length'],_0x30a029['path']['length']);_0x2f1d43++){const _0x5a79d5=_0x1eda57['path'][_0x2f1d43]||0x0,_0x90fbc4=(_0x30a029['path'][_0x2f1d43]||0x0)-_0x5a79d5;if(_0x47000d[_0x2f1d43]=_0x90fbc4,0x0!==_0x90fbc4&&!_0x520032)break;}return _0x47000d;}async['_createInteraction'](_0x443f87,_0x2fe48d,_0x2365db,_0x598d3c){const _0x29faa4=this['editor'];this['_interactionParams']||(this['_interactionParams']={'action':_0x598d3c,'content':_0x443f87,'version':_0x2fe48d,'aiBalloon':_0x2365db,'modelFragment':this['editor']['model']['getSelectedContent'](this['editor']['model']['document']['selection']),'anchorData':new Map()});const _0x3b3345=new W({'connector':this['_aiConnector'],'editor':_0x29faa4,'content':_0x443f87,'version':_0x2fe48d,..._0x598d3c});this['_interactions']['push'](_0x3b3345);const _0x103989=(_0xae95cc,_0x352882=!0x1,_0x25f875='streaming')=>this['_promiseQueue']['enqueue'](async _0x1c55ca=>{try{const _0x5d0f4d=J({'editor':_0x29faa4,'changeGroups':_0xae95cc['changeGroups'],'documentContextContent':_0xae95cc['documentContextContent'],'showDiff':_0x352882,'trimUnchanged':!0x1});_0x5d0f4d['length']&&await this['_actionsBalloonView']['updateContent']({'part':_0x5d0f4d[0x0],'renderingStrategy':_0x25f875,'abortSignal':_0x1c55ca});}catch(_0xed9ea){if(this['_isAbortError'](_0xed9ea))return;throw _0xed9ea;}});this['_interaction']['on']('replyCreated',(_0x45efe4,_0x5f48b5)=>{this['_actionsBalloonView']['hideLoader'](),this['_actionsBalloonView']['startAutoScroll'](),_0x103989(_0x5f48b5)['catch'](_0x244b08=>{this['_isAbortError'](_0x244b08)||(console['error']('Error\x20updating\x20content\x20in\x20replyCreated:',_0x244b08),this['_setErrorState'](_0x3b3345));});}),this['_interaction']['on']('replyContentUpdated',(_0x3c8386,_0x2fe46c)=>{_0x103989(_0x2fe46c)['catch'](_0x46daf8=>{this['_isAbortError'](_0x46daf8)||(console['error']('Error\x20updating\x20content\x20in\x20replyContentUpdated:',_0x46daf8),this['_setErrorState'](_0x3b3345));});}),this['_interaction']['on']('interactionFinished',async()=>{try{await this['_clearLoadingState'](),this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']),await this['_promiseQueue']['queueEmptyPromise'];}catch(_0x4ae6ea){this['_isAbortError'](_0x4ae6ea)||(console['error']('Error\x20clearing\x20loading\x20state\x20in\x20interactionFinished:',_0x4ae6ea),this['_setErrorState'](_0x3b3345));}finally{this['_actionsBalloonView']['stopAutoScroll']();}}),this['listenTo'](this['_actionsBalloonView'],'toggleSuggestionDisplayMode',async(_0x5cc7e4,{showDiff:_0x17472c})=>{try{this['_balloonShowDiff']=_0x17472c;const _0x2e24f0=this['_interaction']['replies'][this['_interaction']['replies']['length']-0x1];_0x2e24f0&&await _0x103989(_0x2e24f0,_0x17472c,'static');}catch(_0x4a5282){this['_isAbortError'](_0x4a5282)||(console['error']('Error\x20updating\x20content\x20in\x20toggleSuggestionDisplayMode:',_0x4a5282),this['_setErrorState'](_0x3b3345));}}),this['_interaction']['on']('replyChangeGroupStateUpdated',(_0x7282db,{reply:_0x2c493a})=>{const _0x24cfc8={'positiveCount':_0x2c493a['changeGroups']['filter'](_0x514a21=>'accepted'===_0x514a21['state'])['length'],'totalCount':_0x2c493a['changeGroups']['length']},_0xef91b8=this['_interaction']['actionCallId'],_0x1f6c70=this['_interaction']['actionName'];_0x1f6c70?this['_aiConnector']['upsertAIActionRating'](_0x1f6c70,_0xef91b8,_0x24cfc8):this['_aiConnector']['upsertCustomAIActionRating'](_0xef91b8,_0x24cfc8);}),this['_setLoadingState']();try{const _0x2ea1da=await this['_interaction']['start']();return this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']),_0x2ea1da;}catch(_0x539c5b){if(this['_isAbortError'](_0x539c5b))return;this['_actionsBalloonView']['hideLoader'](),this['_setErrorState'](_0x3b3345);}}['_applyChanges'](_0x1bcdbf,_0x18b1bc,_0x1ff060){const _0x7084f4=this['editor'];if(_0x1ff060&&!_0x7084f4['plugins']['has']('TrackChanges'))throw new _0x509ee0('ai-no-track-changes',null);const _0x397fa5=this['editor']['plugins']['get'](_0x31d190),_0x311af4=this['_interactions'][this['_interactions']['length']-0x1-this['_currentInteractionIndex']];if(!_0x311af4||!_0x311af4['replies']['length'])return;const _0x47364b=_0x311af4['replies'][_0x311af4['replies']['length']-0x1],_0x363871=_0x47364b['changeGroups'];_0x47364b['setChangeGroupState'](0x0,'accepted');let _0x51a3bf=Z({'editor':_0x7084f4,'reply':_0x47364b,'interaction':_0x311af4,'groups':_0x363871,'transform':!0x1,'documentCompare':_0x397fa5,'documentCompareOptions':{'anchor':_0x7084f4['model']['createPositionAt'](_0x1bcdbf,0x0),'markDeletions':_0x1ff060}});_0x51a3bf=this['_filterOperationsOutsideRange'](_0x51a3bf,_0x18b1bc);for(const _0x58a12c of _0x51a3bf)this['_anchorOperation'](_0x18b1bc,_0x58a12c,_0x7084f4['model']['document']['getRoot']());const _0x29aabc=_0x311af4['getDocumentContext']()['version'],_0x9235f9=_0x7084f4['model']['document']['history']['getOperations'](_0x29aabc),_0x5a1c66={'document':_0x7084f4['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1},_0x2240a0=nt(_0x51a3bf,_0x9235f9,_0x5a1c66)['operationsA'];_0x7084f4['model']['change'](_0x29e16f=>{if(_0x29e16f['setSelection'](_0x7084f4['model']['document']['selection']['focus']),_0x1ff060)_0x7084f4['plugins']['get']('TrackChangesEditing')['_applyOperationsAsSuggestions'](_0x2240a0);else{for(const _0x541f5a of _0x2240a0)_0x541f5a['baseVersion']=_0x7084f4['model']['document']['version'],Y(_0x7084f4,_0x541f5a),_0x29e16f['batch']['addOperation'](_0x541f5a),_0x7084f4['model']['applyOperation'](_0x541f5a);}}),this['editor']['plugins']['get']('AIBalloon')['close']();}['_filterOperationsOutsideRange'](_0x18c690,_0x334446){return _0x18c690['filter'](_0x5c2d40=>{if('rename'==_0x5c2d40['type']){const _0x3106cd=_0x5c2d40['position']['nodeAfter'];return!_0x334446['has'](_0x3106cd);}if(_0x5c2d40['type']['indexOf']('Attribute')>-0x1){const _0x150cfe=_0x5c2d40['range']['start']['nodeAfter'];return!_0x334446['has'](_0x150cfe);}return!0x0;});}['_anchorOperation'](_0x2c9c9e,_0x7ab911,_0x2c0cdd){const _0xc0188e=_0x7ab911['clone']();for(const _0x310887 in _0x7ab911){const _0x19e47f=_0x7ab911[_0x310887];_0x19e47f instanceof it?_0x7ab911[_0x310887]=new it(_0x580c08(_0x19e47f['start']),_0x580c08(_0x19e47f['end'])):_0x19e47f instanceof st&&(_0x7ab911[_0x310887]=_0x580c08(_0x19e47f));}if(['insert','move','remove','reinsert','split','merge']['includes'](_0xc0188e['type'])){if(_0xc0188e['isDocumentOperation']=!0x1,_0xc0188e['baseVersion']=null,'remove'==_0xc0188e['type']){const _0x5f24d0=_0xc0188e['sourcePosition'],_0x1c38c4=_0xc0188e['howMany'];new et(_0x5f24d0,_0x1c38c4)['_execute']();}else _0xc0188e['_execute']();}function _0x580c08(_0x2d6d71){if('$graveyard'==_0x2d6d71['root']['rootName'])return _0x2d6d71;const _0x53b336=[];let _0x18d300=_0x2d6d71['root'];for(let _0x2c2181=0x0;_0x2c2181<_0x2d6d71['path']['length'];_0x2c2181++){const _0x4c810f=_0x2c9c9e['get'](_0x18d300)||0x0;_0x53b336[_0x2c2181]=_0x2d6d71['path'][_0x2c2181]+_0x4c810f,_0x18d300=_0x18d300['getChildAtOffset'](_0x2d6d71['path'][_0x2c2181]);}return new st(_0x2c0cdd,_0x53b336,_0x2d6d71['stickiness']);}}['_refreshInteraction'](){if(!this['_interactionParams'])return;this['_interactions']['length']>0x0&&this['_stopInteraction'](),this['_currentInteractionIndex']=0x0,this['_balloonShowDiff']=!0x1;const {action:_0x59d4ba,content:_0x279e46,version:_0x1ffd44,aiBalloon:_0x1082c1}=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'](_0x279e46,_0x1ffd44,_0x1082c1,_0x59d4ba)['catch'](_0xf49400=>{this['_isAbortError'](_0xf49400)||console['error']('Error\x20refreshing\x20interaction:',_0xf49400);});}['_isAbortError'](_0x142788){return!!_0x142788['message']&&_0x142788['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 _0x24ab1d=this['_interactions']['length'];this['_currentInteractionIndex']<_0x24ab1d-0x1&&this['_displayInteractionAtIndex'](this['_currentInteractionIndex']+0x1);}['_navigateToNext'](){this['_currentInteractionIndex']>0x0&&this['_displayInteractionAtIndex'](this['_currentInteractionIndex']-0x1);}async['_displayInteractionAtIndex'](_0x37a01b){if(!this['_interactionParams'])return;this['_currentInteractionIndex']=_0x37a01b;const _0xb199ec=this['_interactions'][this['_interactions']['length']-0x1-this['_currentInteractionIndex']];if(!_0xb199ec)return;if(_0xb199ec['hasError'])return this['_setErrorState'](_0xb199ec),void this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']);if(!_0xb199ec['replies']['length'])return;this['_actionsBalloonView']['hideError'](),this['_interactionParams']&&this['_clearErrorState']();const _0x40389a=_0xb199ec['replies'][_0xb199ec['replies']['length']-0x1];if(_0x40389a){const _0xa94ff0=this['editor'];try{const _0x1c6add=J({'editor':_0xa94ff0,'changeGroups':_0x40389a['changeGroups'],'documentContextContent':_0x40389a['documentContextContent'],'showDiff':this['_balloonShowDiff'],'trimUnchanged':!0x1});await new Promise(_0x4f700c=>setTimeout(_0x4f700c,0x32)),await this['_actionsBalloonView']['updateContent']({'part':_0x1c6add[0x0],'renderingStrategy':'static','abortSignal':new AbortController()['signal']});}catch(_0x1c7f57){this['_isAbortError'](_0x1c7f57)||console['error']('Error\x20updating\x20content\x20during\x20navigation:',_0x1c7f57);}}this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']);}['_setLoadingState'](){this['_actionsBalloonView']['setIsLoading'](!0x0),this['isBusy']=!0x0;}async['_setErrorState'](_0x3b2d22){const _0x920256=i(this['editor']['locale'],'AI_ACTIONS_GENERIC_ERROR');this['_actionsBalloonView']['showError'](_0x920256),_0x3b2d22['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 Fa extends _0x364f16{static get['requires'](){return[ii,ti,ri];}static get['pluginName'](){return'AIQuickActions';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x29d835){super(_0x29d835),_0x29d835['config']['define']('ai.quickActions',{'extraCommands':[],'removeCommands':[],'isSearchEnabled':!0x0});}}class gr extends _0x5eeb09{['resultResponseView'];['acceptButtonView'];['dismissButtonView'];['infoButtonView'];['outdatedButtonView'];constructor(_0x2c67ef,_0x225b15){super(_0x2c67ef),this['id']=_0x225b15,this['set']('status','pending'),this['set']('changeId',_0x225b15),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',(_0x1995f7,_0x150ac2)=>{_0x150ac2&&_0x150ac2['target']&&'A'===_0x150ac2['target']['tagName']&&_0x150ac2['preventDefault'](),this['fire']('activateChange',{'id':_0x225b15,'source':this,'uiInteraction':'click'});}),this['on']('mouseover',()=>{this['fire']('activateChange',{'id':_0x225b15,'source':this,'uiInteraction':'hover'});}),this['on']('mouseout',()=>{this['fire']('deactivateChange',{'origin':'panel','id':_0x225b15,'source':this});});}['setItemAsActive'](){this['isActive']=!0x0;}['setItemAsInactive'](){this['isActive']=!0x1;}['_createResultResponseView'](){const _0x42afac=new _0x5eeb09(this['locale']);return _0x42afac['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',_0x5dcf22=>!_0x5dcf22)]}}),_0x42afac;}['_createAcceptButtonView'](){const _0x1b68a2=new _0x599e60(this['locale']);return _0x1b68a2['set']({'label':i(this['locale'],'AI_REVIEW_MODE_ACCEPT_CHANGE'),'withText':!0x0}),_0x1b68a2['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x38a730=>{this['fire']('acceptChange',{'id':this['changeId']}),_0x38a730['stopPropagation']();})},'attributes':{'class':['ck-ai-button-secondary','ck-ai_review__check-run-result-accept-button',this['bindTemplate']['if']('status','ck-hidden',_0x541320=>'pending'!==_0x541320&&'accepted'!==_0x541320),this['bindTemplate']['if']('status','ck-ai_review__check-run-result-accept-button',_0x27aed0=>'pending'===_0x27aed0),this['bindTemplate']['if']('status','ck-ai_review__check-run-result-status-button',_0x46e018=>'accepted'===_0x46e018)]}}),this['on']('change:status',(_0x5e733a,_0x2c419b,_0x16a5e3)=>{_0x1b68a2['isEnabled']='pending'===_0x16a5e3,'accepted'===_0x16a5e3&&(_0x1b68a2['label']=i(this['locale'],'AI_REVIEW_MODE_CHECK_STATUS_ACCEPTED'),_0x1b68a2['icon']=_0x4b3b54);}),_0x1b68a2;}['_createDismissButtonView'](){const _0x21067c=new _0x599e60(this['locale']);return _0x21067c['set']({'label':i(this['locale'],'AI_REVIEW_MODE_DISMISS_CHANGE'),'withText':!0x0}),_0x21067c['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x19c2a5=>{this['fire']('dismissChange',{'id':this['changeId']}),_0x19c2a5['stopPropagation']();})},'attributes':{'class':['ck-ai-button-tertiary',this['bindTemplate']['if']('status','ck-hidden',_0x19bc02=>'pending'!==_0x19bc02&&'rejected'!==_0x19bc02),this['bindTemplate']['if']('status','ck-ai_review__check-run-result-dismiss-button',_0x15825d=>'pending'===_0x15825d),this['bindTemplate']['if']('status','ck-ai_review__check-run-result-status-button',_0x21e980=>'rejected'===_0x21e980)]}}),this['on']('change:status',(_0x129f1f,_0x491943,_0x4275c7)=>{_0x21067c['isEnabled']='pending'===_0x4275c7,'rejected'===_0x4275c7&&(_0x21067c['label']=i(this['locale'],'AI_REVIEW_MODE_CHECK_STATUS_REJECTED'),_0x21067c['icon']=_0x35d8e1);}),_0x21067c;}['_createInfoButtonView'](){const _0x58d9d1=new _0x599e60(this['locale']);return _0x58d9d1['set']({'label':i(this['locale'],'AI_REVIEW_MODE_LEARN_MORE'),'icon':tc,'tooltip':!0x0,'isToggleable':!0x0,'role':'menuitemcheckbox','class':'ck-ai-button-tertiary\x20ck-ai_review__check-run-result-info-button\x20ck-hidden'}),_0x58d9d1['bind']('isOn')['to'](this,'isInfoToggleOn',_0x312ac4=>_0x312ac4),_0x58d9d1['on']('execute',()=>{this['isInfoToggleOn']=!this['isInfoToggleOn'];}),_0x58d9d1;}['_createOutdatedButtonView'](){const _0x25598e=new _0x599e60(this['locale']);return _0x25598e['set']({'label':i(this['locale'],'AI_REVIEW_MODE_CHECK_STATUS_OUTDATED'),'icon':_0x2157fc,'withText':!0x0,'isEnabled':!0x1}),_0x25598e['extendTemplate']({'attributes':{'class':['ck-ai-button-secondary','ck-ai_review__check-run-result-status-button',this['bindTemplate']['if']('status','ck-hidden',_0x4192d2=>'outdated'!==_0x4192d2)],'disabled':'disabled'}}),_0x25598e;}}class me extends _0x88aaab{['resultItemView'];['_pinnedRectIndex']=void 0x0;['_pinnedTargetElement']=void 0x0;['_pinnedTargetChangeId']=void 0x0;constructor(_0x133cfb,_0x2aeb4c){super(_0x133cfb),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']()),_0x2aeb4c['add'](this);}['render'](){super['render'](),this['_setupClickOutsideHandler']();}['updateContent'](_0x228a68){this['resultItemView']['changeId']=_0x228a68['id'],this['resultItemView']['resultResponseView']['element']['innerHTML']=_0x228a68['contentDiffed'];}['showBalloon'](_0x3b0c35,_0x590cc5,_0x4ab339,_0x3b5d98,_0x208ed7,_0x17388a){const _0x9c6d5b=_0x590cc5();if(!_0x9c6d5b)return;this['updateContent'](_0x3b0c35),this['show']();const _0x1e6155=Array['from'](_0x9c6d5b['getClientRects']())['reverse'](),_0x2c56d0=this['_getPointedRectIndexFromEvent'](_0x4ab339,_0x1e6155),_0x349a3a=_0x1e6155[_0x2c56d0??0x0];'click'===_0x3b5d98?(this['isDiffActive']=!0x0,this['pin']({'target':()=>this['_getBestRectPositionOnClick'](_0x590cc5(),_0x2c56d0,_0x3b0c35['id'],_0x208ed7,_0x17388a)||_0x349a3a})):'hover'===_0x3b5d98&&(this['isDiffActive']=!0x1,this['pin']({'target':()=>this['_getBestRectPositionOnHover'](_0x590cc5(),_0x2c56d0,_0x3b0c35['id'])||_0x349a3a}));}['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'](){_0x5e5264({'emitter':this,'activator':()=>this['isVisible'],'contextElements':()=>{const _0x22d9fe=[this['element']];return this['_pinnedTargetElement']&&_0x22d9fe['push'](this['_pinnedTargetElement']),_0x22d9fe;},'callback':()=>{this['hide'](),this['unpin'](),this['deactivateChange'](),this['_pinnedTargetElement']=void 0x0,this['_pinnedRectIndex']=void 0x0,this['_pinnedTargetChangeId']=void 0x0;}});}['_createContentView'](){const _0x9bec34=new _0x5eeb09();return this['resultItemView']=new gr(this['locale'],''),this['resultItemView']['resultResponseView']['extendTemplate']({'attributes':{'class':['ck-content']}}),this['resultItemView']['delegate']('acceptChange','dismissChange')['to'](this),_0x9bec34['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']]}]}),_0x9bec34;}['_getBestRectPositionOnClick'](_0x4e6947,_0x5cd8e1,_0x3d923c,_0x18c76c,_0x17baa6){if(!_0x4e6947)return null;const _0x2da8c2=this['position']['replace']('arrow_',''),_0x27db05=Array['from'](_0x4e6947['getClientRects']());let _0x2d666a,_0x111397=_0x27db05['reverse']();return void 0x0!==_0x5cd8e1&&this['_isPinnedRectVisible'](_0x111397[_0x5cd8e1],_0x18c76c,_0x17baa6)?(_0x2d666a=_0x111397[_0x5cd8e1],this['_pinnedRectIndex']=_0x5cd8e1):this['_isPinnedRectVisible'](_0x111397[0x0],_0x18c76c,_0x17baa6)&&void 0x0===_0x5cd8e1?_0x2d666a=_0x111397[0x0]:(_0x111397='s'==_0x2da8c2[0x0]?[..._0x27db05]['reverse']():_0x27db05,_0x111397['forEach'](_0x96e72d=>{this['_isPinnedRectVisible'](_0x96e72d,_0x18c76c,_0x17baa6)&&(_0x2d666a=_0x96e72d);})),this['_pinnedTargetChangeId']=_0x3d923c,this['_pinnedTargetElement']=_0x4e6947,_0x2d666a||_0x4e6947['getBoundingClientRect']();}['_getBestRectPositionOnHover'](_0x9ce5cc,_0x52b1b0,_0x10a4a6){if(!_0x9ce5cc)return null;const _0x2ff3af=Array['from'](_0x9ce5cc['getClientRects']())['reverse']();if(void 0x0===this['_pinnedRectIndex']&&void 0x0!==_0x52b1b0&&this['_pinnedTargetChangeId']!==_0x10a4a6)return this['_pinnedRectIndex']=_0x52b1b0,this['_pinnedTargetElement']=_0x9ce5cc,this['_pinnedTargetChangeId']=_0x10a4a6,_0x2ff3af[_0x52b1b0];if(void 0x0!==this['_pinnedRectIndex']&&this['_pinnedTargetChangeId']===_0x10a4a6){if(_0x9ce5cc!==this['_pinnedTargetElement'])return Array['from'](this['_pinnedTargetElement']['getClientRects']())['reverse']()[this['_pinnedRectIndex']];return _0x2ff3af[this['_pinnedRectIndex']];}return void 0x0!==_0x52b1b0&&this['_pinnedTargetChangeId']!==_0x10a4a6?(this['_pinnedRectIndex']=_0x52b1b0,this['_pinnedTargetElement']=_0x9ce5cc,this['_pinnedTargetChangeId']=_0x10a4a6,_0x2ff3af[_0x52b1b0]):_0x9ce5cc['getBoundingClientRect']();}['_getPointedRectIndexFromEvent'](_0xd1af71,_0x112eee){if(_0xd1af71)for(let _0x7178ee=0x0;_0x7178ee<_0x112eee['length'];_0x7178ee++){const _0x5f4a3b=_0x112eee[_0x7178ee];if(_0xd1af71['clientX']>=_0x5f4a3b['left']-0x3&&_0xd1af71['clientX']<=_0x5f4a3b['right']+0x3&&_0xd1af71['clientY']>=_0x5f4a3b['top']-0x3&&_0xd1af71['clientY']<=_0x5f4a3b['bottom']+0x3)return _0x7178ee;}}['_isPinnedRectVisible'](_0x39af50,_0xebd820,_0x37d591){const _0x2de4d5=new _0x227dc7(_0x39af50),_0x26070f=_0xebd820||document['documentElement'],_0x97d7fd=_0x2de4d5['getIntersection'](_0x3bd2e8(_0x37d591)),_0x5cfae2=new _0x227dc7(_0x26070f)['getIntersection'](_0x2de4d5);return!!(_0x97d7fd&&_0x5cfae2&&_0x2de4d5['width']>0x0);}}const ih=['getReviewCheckList','runReviewCheck','abortReviewStream','toggleDiff','acceptAllChanges','leaveReviewCoreResultList','activateChange','deactivateChange','acceptChange','dismissChange','learnMore','finishReview','retryReview'];class Me extends _0x34a98c{['_mainView'];['_balloonSuggestionView'];['_bodyCollection'];static get['requires'](){return[pt];}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x441a98){super(_0x441a98),this['_bodyCollection']=new _0x2f55eb(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 _0x25c50b=this['context']['plugins']['get']('AITabs');this['registerTab'](_0x25c50b);}['destroy'](){this['_bodyCollection']['detachFromDom'](),super['destroy']();}['setAvailableChecks'](_0x156596){if(!this['_mainView']['reviewCheckListView']['hasChecks']()){const _0x220ed2=!this['context']['config']['get']('ai.models.showModelSelector');this['_mainView']['reviewCheckListView']['setChecks'](_0x156596,_0x220ed2);}this['_mainView']['showReviewCheckListView']();}['showReviewCheckList'](){this['fire']('getReviewCheckList');}['showCheckRunResults'](_0x26f095){_0x26f095&&('error-general'!==_0x26f095['status']?'error-chunk'!==_0x26f095['status']?this['_mainView']['showReviewCheckResultsView']():this['showChunkErrorView']():this['showGeneralResultsErrorView']());}['showCheckRunResult'](_0x33179a){this['_mainView']['addCheckRunResult'](_0x33179a);}['showGeneralResultsErrorView'](){this['_mainView']['showGeneralResultsErrorView']();}['showGeneralReviewCoreErrorView'](_0x471500){this['_mainView']['showGeneralReviewCoreErrorView'](_0x471500??i(this['context']['locale'],'AI_REVIEW_INITIALIZATION_ERROR_MESSAGE'));}['showChunkErrorView'](){this['_mainView']['showChunkErrorView']();}['setCheckResultTitle'](_0x2396eb,_0x483178){this['_mainView']['reviewCheckResultsView']['setTitle'](_0x2396eb,_0x483178);}['setActiveStateInResults'](_0x160c69){this['_mainView']['reviewCheckResultsView']['getResults']()['forEach'](_0xb2e528=>{_0xb2e528['id']===_0x160c69&&_0xb2e528['setItemAsActive']();});}['resetActiveStateInResults'](){this['_mainView']['reviewCheckResultsView']['getResults']()['forEach'](_0x330014=>_0x330014['setItemAsInactive']());}['updateChangeState'](_0x20aec2,_0x138d0d){'accepted'===_0x138d0d||'rejected'===_0x138d0d||'outdated'===_0x138d0d?this['_mainView']['reviewCheckResultsView']['hideResult'](_0x20aec2,_0x138d0d):this['_mainView']['reviewCheckResultsView']['showResult'](_0x20aec2,_0x138d0d);}['showReviewCompletedView'](){this['_mainView']['showReviewCompletedView']();}['showActionsWhenResultIsReady'](){this['_mainView']['showActionsWhenResultIsReady']();}['showNoChangesView'](){this['_mainView']['showNoChangesView']();}['hideActionsWhenResultIsReady'](){this['_mainView']['hideActionsWhenResultIsReady']();}['showChangeBalloon'](_0x4a0b3b,_0x44a665,_0xfeeb88,_0x3dfcfe,_0x569443,_0x385fc4){this['_balloonSuggestionView']['showBalloon'](_0x4a0b3b,_0x44a665,_0xfeeb88,_0x3dfcfe,_0x569443,_0x385fc4);}['hideChangeBalloon'](){this['_balloonSuggestionView']['hideBalloon']();}['hideDiffInBalloon'](){this['_balloonSuggestionView']['hideDiffInBalloon']();}['showDiffInBalloon'](){this['_balloonSuggestionView']['showDiffInBalloon']();}['getChangeElement'](_0x406323){const _0x3dd415=this['_mainView']['reviewCheckResultsView']['getResults']()['find'](_0x1d8421=>_0x1d8421['id']===_0x406323);return _0x3dd415?_0x3dd415['element']:null;}['deactivateChange'](){this['_balloonSuggestionView']['deactivateChange']();}}class sh extends _0x5eeb09{constructor(_0x89568f){super(_0x89568f),this['set']('isVisible',!0x1),this['set']('errorMessage','');const _0xee0ad1=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai_review__general-error-container',_0xee0ad1['if']('isVisible','ck-hidden',_0xf857d6=>!_0xf857d6)]},'children':[{'tag':'p','attributes':{'class':'ck\x20ck-ai-notification\x20ck-ai-notification_error'},'children':[{'text':_0xee0ad1['to']('errorMessage')}]}]});}}class Ae extends _0x5eeb09{['reviewCoreHeader'];['generalErrorView'];['reviewCheckListView'];['reviewCheckResultsView'];['reviewCompletedView'];constructor(_0x45110c,_0x54cc28){super(_0x45110c),this['reviewCoreHeader']=_0x54cc28['header'],this['generalErrorView']=new sh(_0x45110c),this['reviewCheckListView']=_0x54cc28['list'],this['reviewCheckListView']['delegate'](...ih)['to'](this),this['reviewCheckResultsView']=_0x54cc28['results'],this['reviewCheckResultsView']['delegate'](...ih)['to'](this),this['reviewCompletedView']=_0x54cc28['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'](_0x41f1b6){this['reviewCheckResultsView']['addResult'](_0x41f1b6),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'](_0x3556a1){this['generalErrorView']['set']('isVisible',!0x0),this['generalErrorView']['errorMessage']=_0x3556a1;}['showGeneralResultsErrorView'](){this['reviewCheckResultsView']['set']('isLoading',!0x1),this['showActionsWhenResultIsReady'](),this['reviewCheckResultsView']['showGeneralErrorMessage']();}['showChunkErrorView'](){this['reviewCheckResultsView']['set']('isLoading',!0x1),this['showActionsWhenResultIsReady'](),this['reviewCheckResultsView']['showChunkErrorMessage']();}}class _r extends _0x599e60{constructor(_0x3d0662,_0x5e6a35){super(_0x5e6a35),this['set']({'label':_0x3d0662,'withText':!0x0,'class':'ck-ai-button-primary'}),this['on']('execute',()=>{this['fire']('finishReview');});}}class Ve extends _0x8981d2{['_resultViews'];['_resultsHeader'];['reviewDisclaimer'];['_cancelButtonView'];['_acceptAllButtonView'];['_exitReviewButtonView'];['_toggleDiffButtonView'];['_errorMessageView'];['_finishReviewButtonView'];['_contents'];constructor(_0x1c9e88,_0x1b7ba1){super(_0x1c9e88),this['_contents']=_0x1b7ba1,this['_resultViews']=new _0xa460cb(),this['_cancelButtonView']=this['_createCancelButtonView'](),this['_acceptAllButtonView']=this['_createAcceptAllButtonView'](),this['_exitReviewButtonView']=this['_createExitReviewButtonView'](),this['_toggleDiffButtonView']=this['_createToggleDiffButtonView'](),this['_finishReviewButtonView']=this['_createFinishReviewButtonView'](),this['_resultsHeader']=this['_createResultHeaderView'](),this['_errorMessageView']=this['_createErrorView'](),this['reviewDisclaimer']=new bi(_0x1c9e88),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 _0x3d66f9=this['_createCombinedSkeletonLoader'](),_0x3419e4=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run',_0x3419e4['if']('isLoading','ck-ai_review__check-run_loading',_0x2304b2=>_0x2304b2),_0x3419e4['if']('isResultReady','ck-ai_review__check-run_ready',_0x435a87=>_0x435a87),_0x3419e4['if']('isVisible','ck-hidden',_0x148149=>!_0x148149)]},'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',_0x58f4fb=>_0x58f4fb)]},'children':this['_resultViews']},_0x3d66f9]},this['reviewDisclaimer']]});}['clearResults'](){this['_resultViews']['clear']();}['getResults'](){return this['_resultViews'];}['addResult'](_0x2d1367){const _0x25c7d7=new gr(this['locale'],_0x2d1367['id']);_0x25c7d7['delegate']('acceptChange','dismissChange','activateChange','deactivateChange')['to'](this),this['_resultViews']['add'](_0x25c7d7),_0x25c7d7['resultResponseView']['element']['innerHTML']=_0x2d1367['contentDiffed'];}['hideResult'](_0x57e934,_0xeb0273){if('pending'===_0xeb0273)return;const _0x4ceb55=this['_resultViews']['find'](_0x2908b3=>_0x2908b3['id']===_0x57e934);_0x4ceb55&&(_0x4ceb55['status']=_0xeb0273,_0x4ceb55['element']?.['classList']['add']('ck-ai_review__check-run-result_grayout'));}['showResult'](_0x4d89a6,_0x19b054){if('pending'!==_0x19b054)return;const _0x499703=this['_resultViews']['find'](_0x3ad01f=>_0x3ad01f['id']===_0x4d89a6);_0x499703&&(_0x499703['status']=_0x19b054,_0x499703['element']?.['classList']['remove']('ck-ai_review__check-run-result_grayout'));}['setTitle'](_0x47439f,_0x19a8a7){this['headerTitle']=_0x47439f,this['headerSubtitle']=_0x19a8a7||'';}['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 ui(this['locale'],fi['aiReviewChecks']);}['_createCombinedSkeletonLoader'](){const _0x11b4d6=new _0x5eeb09(this['locale']),_0x560114=[];for(let _0x537f38=0x0;_0x537f38<0x10;_0x537f38++){const _0x3c908d=this['_createSkeletonLoader']();_0x3c908d['extendTemplate']({'attributes':{'class':['ck-ai_review__check-run-skeleton-item']}}),_0x560114['push'](_0x3c908d);}return _0x11b4d6['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-skeleton-container',this['bindTemplate']['if']('isLoading','ck-hidden',_0x1c2c91=>!_0x1c2c91)]},'children':_0x560114}),_0x11b4d6;}['_createErrorView'](){const _0x3e7eaf=new _0x5eeb09(this['locale']),_0x3742a8=new _0x599e60(this['locale']),t=this['locale']['t'];return _0x3e7eaf['delegate']('retryReview')['to'](this),_0x3742a8['set']({'label':t('Try\x20again'),'withText':!0x0,'class':'ck-ai-button-secondary\x20ck-ai_review__check-run-error-retry-button'}),_0x3742a8['on']('execute',()=>{this['fire']('retryReview');}),_0x3e7eaf['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-error-container',this['bindTemplate']['if']('showErrorMessage','ck-hidden',_0x35c48e=>!_0x35c48e),this['bindTemplate']['if']('errorType','ck-ai_review__check-run-error-container_border-bottom',_0x3e4e55=>'chunk'===_0x3e4e55)]},'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',_0x594ca3=>'chunk'===_0x594ca3)]},'children':[{'tag':'p','attributes':{'class':['ck-ai-notification__content',this['bindTemplate']['if']('errorType','ck-hidden',_0x1becba=>'general'!==_0x1becba)]},'children':[{'text':this['_contents']['generalErrorText']}]},{'tag':'p','attributes':{'class':['ck-ai-notification__content',this['bindTemplate']['if']('errorType','ck-hidden',_0x217adc=>'chunk'!==_0x217adc)]},'children':[{'text':i(this['locale'],'AI_REVIEW_MODE_CHUNK_ERROR_MESSAGE')}]}]},_0x3742a8]}),_0x3e7eaf;}['_createCancelButtonView'](){const _0x338ea2=new _0x599e60(this['locale']);return _0x338ea2['set']({'label':i(this['locale'],'AI_REVIEW_MODE_STOP_GENERATING'),'withText':!0x0,'class':['ck-ai-button-secondary\x20ck-ai-button-stop-generating'],'icon':_0x21bbec}),_0x338ea2['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isResultReady','ck-hidden',_0x392d9f=>_0x392d9f),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x32ba78=>_0x32ba78)]}}),_0x338ea2['on']('execute',()=>{this['fire']('abortReviewStream');}),_0x338ea2;}['_createToggleDiffButtonView'](){const _0x4f5c7d=new _0x599e60(this['locale']);_0x4f5c7d['set']({'tooltip':!0x0,'isToggleable':!0x0,'role':'menuitemcheckbox'}),_0x4f5c7d['bind']('isEnabled')['to'](this,'isError',_0x20c0b0=>!_0x20c0b0),_0x4f5c7d['extendTemplate']({'attributes':{'class':['ck-ai-button-secondary','ck-ai_review__check-run-toggle-diff-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0x3bdbd2=>!_0x3bdbd2),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x591de8=>_0x591de8)]}});const _0x58a90e=i(this['locale'],'AI_REVIEW_MODE_HIDE_CHANGES'),_0x40d83b=i(this['locale'],'AI_REVIEW_MODE_SHOW_CHANGES');return _0x4f5c7d['bind']('isOn')['to'](this,'isToggleDiffOn',_0x1fa91b=>_0x1fa91b),_0x4f5c7d['bind']('icon')['to'](this,'isToggleDiffOn',_0x2d63aa=>_0x2d63aa?_0x45731c:_0x577dff),_0x4f5c7d['bind']('label')['to'](this,'isToggleDiffOn',_0x20b4aa=>_0x20b4aa?_0x58a90e:_0x40d83b),_0x4f5c7d['on']('execute',()=>{this['isToggleDiffOn']=!this['isToggleDiffOn'],this['fire']('toggleDiff',{'on':this['isToggleDiffOn']});}),_0x4f5c7d;}['_createAcceptAllButtonView'](){const _0x23978b=new _0x599e60(this['locale']);return _0x23978b['set']({'label':i(this['locale'],'AI_REVIEW_MODE_ACCEPT_ALL'),'withText':!0x0}),_0x23978b['bind']('isEnabled')['to'](this,'isError',_0x554bbc=>!_0x554bbc),_0x23978b['extendTemplate']({'attributes':{'class':['ck-ai-button-primary','ck-ai_review__check-run-accept-all-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0xfc0d1d=>!_0xfc0d1d),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x3c9b8a=>_0x3c9b8a)]}}),_0x23978b['on']('execute',()=>{this['fire']('acceptAllChanges');}),_0x23978b;}['_createExitReviewButtonView'](){const _0xaff2dd=new _0x599e60(this['locale']);return _0xaff2dd['set']({'label':i(this['locale'],'AI_REVIEW_MODE_EXIT_REVIEW'),'withText':!0x0}),_0xaff2dd['extendTemplate']({'attributes':{'class':['ck-ai-button-tertiary','ck-ai_review__check-run-exit-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0x544cf2=>!_0x544cf2),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x3e9c8f=>_0x3e9c8f)]}}),_0xaff2dd['on']('execute',()=>{this['fire']('leaveReviewCoreResultList');}),_0xaff2dd;}['_createResultHeaderView'](){const _0x20bad0=new _0x5eeb09(this['locale']),_0x1e760e=this['_createTitleView']();return _0x20bad0['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-header',this['bindTemplate']['if']('isCompleted','ck-ai_review__review-completed-header',_0x30187a=>_0x30187a)]},'children':[_0x1e760e,{'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-header-buttons']},'children':[this['_cancelButtonView'],this['_acceptAllButtonView'],this['_exitReviewButtonView'],this['_toggleDiffButtonView'],this['_finishReviewButtonView']]}]}),_0x20bad0;}['_createTitleView'](){const _0x45a220=new _0x5eeb09(this['locale']),_0x52af96=new pi();return _0x52af96['bind']('isVisible')['to'](this,'isResultReady',_0x2d6c7d=>!_0x2d6c7d),_0x45a220['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-header-title-wrapper']},'children':[_0x52af96,{'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-header-title-content',this['bindTemplate']['if']('isCompleted','ck-hidden',_0x44ce3b=>_0x44ce3b)]},'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',_0x1d8879=>!_0x1d8879)]},'children':[{'text':i(this['locale'],'AI_REVIEW_MODE_FINISH_REVIEW_HEADER_TITLE')}]}]}),_0x45a220;}['_createFinishReviewButtonView'](){const _0x48732b=new _r(i(this['locale'],'AI_REVIEW_MODE_FINISH_REVIEW_BUTTON_LABEL'),this['locale']);return _0x48732b['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isCompleted','ck-hidden',_0x5890a2=>!_0x5890a2)]}}),_0x48732b['delegate']('finishReview')['to'](this),_0x48732b;}}class be extends _0x8981d2{['_resultsHeader'];['_finishReviewButtonView'];constructor(_0x32ddd3,_0x22be90){super(_0x32ddd3),this['_finishReviewButtonView']=this['_createFinishReviewButtonView'](_0x22be90['buttonText']),this['_resultsHeader']=this['_createResultHeaderView'](_0x22be90['headerText']);const _0x11d4c7=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__review-completed',_0x11d4c7['if']('isVisible','ck-hidden',_0x43eb23=>!_0x43eb23)]},'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':_0x22be90['emptyResultsText']}]}]}]});}['_createFinishReviewButtonView'](_0x3b735){const _0x1b694f=new _r(_0x3b735,this['locale']);return _0x1b694f['delegate']('finishReview')['to'](this),_0x1b694f;}['_createResultHeaderView'](_0x4dbb45){const _0x96be15=new _0x5eeb09(this['locale']);return _0x96be15['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':_0x4dbb45}]},{'tag':'div','attributes':{'class':['ck-ai_review__review-completed-header-buttons']},'children':[this['_finishReviewButtonView']]}]}),_0x96be15;}}class Dr extends _0x5eeb09{['_dropdownView'];['_defaultValue'];['_defaultLabel'];constructor(_0xdc3576,_0x16470b){super(_0xdc3576),this['_defaultValue']=_0x16470b['default']||(_0x16470b['data']['length']>0x0?_0x16470b['data'][0x0]['id']:''),this['_defaultLabel']=_0x16470b['data']['find'](_0x5ef643=>_0x5ef643['id']===this['_defaultValue'])?.['label']||'',this['set']('formValue',''),this['_dropdownView']=_0xace15(this['locale']);const _0x2dabfa=this['_prepareListOptions'](_0x16470b['data']);_0x37db59(this['_dropdownView'],_0x2dabfa,{'role':'menu','ariaLabel':_0x16470b['label']}),this['_dropdownView']['buttonView']['set']({'label':this['_defaultLabel'],'withText':!0x0}),this['_dropdownView']['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x5e7617=>{_0x5e7617['stopPropagation']();})}}),this['listenTo'](this['_dropdownView'],'execute',_0x1a9c4a=>{this['formValue']=_0x1a9c4a['source']['model']['id'],this['_dropdownView']['buttonView']['label']=_0x1a9c4a['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'](_0x2a5162=[]){const _0x406ee3=new _0x397f6f();this['resetToDefault']();for(const _0x244f9e of _0x2a5162){const _0x2ad401=new _0x137bc3({'label':_0x244f9e['label'],'withText':!0x0,'role':'menuitemradio','id':_0x244f9e['id'],'model':_0x244f9e});_0x2ad401['bind']('isOn')['to'](this,'formValue',_0x19b15a=>_0x19b15a===_0x2ad401['id']);const _0x147f10={'type':'button','model':_0x2ad401};_0x406ee3['add'](_0x147f10);}return _0x406ee3;}}class cc extends _0x8981d2{['_formItem']=null;constructor(_0x1ad972,_0x32a4d1,_0x26acaf){super(_0x1ad972),this['argsKey']=_0x32a4d1?.['argsKey'];if('dropdown'===_0x32a4d1['formType'])this['_formItem']=new Dr(this['locale'],_0x32a4d1);this['set']('value',''),this['bind']('value')['to'](this['_formItem'],'formValue');const _0x5ee29a=new _0x2a0a84(this['locale'],{'children':[this['_formItem']],'class':[_0x26acaf?'ck-form__row_with-submit':'']});_0x26acaf&&_0x5ee29a['children']['add'](_0x26acaf),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai_review__form-item','ck-reset_all']},'children':[_0x5ee29a]});}['resetToDefault'](){this['_formItem']['resetToDefault']();}}class po extends _0x18e641{['keystrokes'];static ['MIN_ROWS']=0x1;static ['MAX_ROWS']=0xc;constructor(_0x205043){super(_0x205043),this['set']('isEmpty',!0x0),this['keystrokes']=new _0x33f2cf(),this['minRows']=po['MIN_ROWS'],this['maxRows']=po['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 rc extends _0x5eeb09{['focusTracker']=new _0x534506();['keystrokes']=new _0x33f2cf();['focusCycler'];['_focusables']=new _0xa460cb();['submitButtonView'];['cancelButtonView'];['promptInputView'];['actionsFooterView'];['_modelSelectionDropdown'];['_modelNameView'];['_modelSelectionDropdownItems'];['_check'];['_defaultValue'];['_defaultLabel'];constructor(_0x4b342b,_0x314903,_0x331908=!0x1){super(_0x4b342b),this['_check']=_0x314903,this['set']('prompt',''),this['set']('modelId',''),this['set']('modelDisplayMode','selector'),this['set']('activeModelName',null),this['_defaultValue']=_0x314903['defaultModel']?_0x314903['defaultModel']['id']:'',this['_defaultLabel']=_0x314903['defaultModel']?_0x314903['defaultModel']['name']:'',this['submitButtonView']=this['_createSubmitButtonView'](),this['cancelButtonView']=this['_createCancelButtonView'](),(this['promptInputView']=new _0x22aa6a(this['locale'],()=>new po(_0x4b342b)),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 _0x397f6f(),this['_modelNameView']=this['_createModelNameView'](),this['_setModelList'](_0x331908),_0x37db59(this['_modelSelectionDropdown'],this['_modelSelectionDropdownItems']),this['actionsFooterView']=this['_createActionsFooterView'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-custom-actions']},'children':[new _0x2a0a84(this['locale'],{'children':[this['promptInputView']]}),new _0x2a0a84(this['locale'],{'children':[this['actionsFooterView']]})]}),this['promptInputView']['fieldView']['keystrokes']['set']('Enter',(_0x5a5b49,_0x5f05b4)=>{this['_isValid']()?(this['fire']('runReviewCheck',{'id':'custom','args':{'prompt':this['prompt'],'model':this['modelId']},'isCustom':!0x0}),_0x5f05b4()):_0x5f05b4();}),this['focusCycler']=new _0x45d025({'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'](_0x1e52a4=>{this['_focusables']['add'](_0x1e52a4),this['focusTracker']['add'](_0x1e52a4['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 _0x1d620f of this['_getFormValidators']()){const _0xf15e84=_0x1d620f();if(_0xf15e84)return this['promptInputView']['errorText']=_0xf15e84,!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 _0x57755b=new _0x599e60(this['locale']),t=this['locale']['t'];return _0x57755b['set']({'label':t('Submit'),'withText':!0x0,'class':'ck-ai-button-primary'}),_0x57755b['on']('execute',()=>{this['_isValid']()&&this['fire']('runReviewCheck',{'id':'custom','args':{'prompt':this['prompt'],'model':this['modelId']},'isCustom':!0x0});}),_0x57755b;}['_createCancelButtonView'](){const _0x14608e=new _0x599e60(this['locale']),t=this['locale']['t'];return _0x14608e['set']({'label':t('Cancel'),'withText':!0x0,'class':'ck-ai-button-tertiary'}),_0x14608e['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x516f17=>{_0x516f17['stopPropagation']();})}}),_0x14608e['on']('execute',()=>{this['resetToDefault'](),this['fire']('closeCustomCheck');}),_0x14608e;}['_setModelList'](_0x26ec41){this['_modelSelectionDropdownItems']['clear']();const _0xc6aeed=this['_check']['models'];if(_0x26ec41)this['set']('modelDisplayMode','hidden');else{const _0x537676=0x1===_0xc6aeed['length'];this['set']('modelDisplayMode',_0x537676?'name':'selector');}if(this['resetToDefault'](),_0xc6aeed?.['length']){0x1===_0xc6aeed['length']&&this['set']('activeModelName',_0xc6aeed[0x0]['name']||_0xc6aeed[0x0]['id']);for(const _0x196827 of _0xc6aeed){const _0x319967=new _0x137bc3({'label':_0x196827['name'],'withText':!0x0,'role':'menuitemradio','id':_0x196827['id'],'model':_0x196827});_0x319967['bind']('isOn')['to'](this,'modelId',_0x4f66ec=>_0x4f66ec===_0x196827['id']),this['_modelSelectionDropdownItems']['add']({'type':'button','model':_0x319967,'labelView':new ko(this['locale'],_0x196827)});}}}['_createModelSelectionDropdown'](){const _0x35cfb0=_0xace15(this['locale']);return _0x35cfb0['set']({'panelPosition':'se','class':'ck-ai_review__check-list-item-model-dropdown'}),_0x35cfb0['buttonView']['set']({'label':this['_defaultLabel'],'withText':!0x0,'tooltip':!0x0}),_0x35cfb0['buttonView']['bind']('isVisible')['to'](this,'modelDisplayMode',_0x13a140=>'selector'===_0x13a140),this['listenTo'](_0x35cfb0,'execute',_0x3b28bc=>{this['modelId']=_0x3b28bc['source']['model']['id'],_0x35cfb0['buttonView']['label']=_0x3b28bc['source']['label'];}),_0x35cfb0;}['_createModelNameView'](){const _0x1b5693=new _o(this['locale']);return _0x1b5693['bind']('text')['to'](this,'activeModelName',_0x2a1e44=>_0x2a1e44??''),_0x1b5693['bind']('isVisible')['to'](this,'modelDisplayMode',_0x14d96b=>'name'===_0x14d96b),_0x1b5693;}['_createActionsFooterView'](){const _0x28a0d1=new _0x5eeb09(this['locale']);return _0x28a0d1['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']]}]}),_0x28a0d1;}}class _o extends _0x5eeb09{constructor(_0x298ea7){super(_0x298ea7),this['set']('text',void 0x0),this['set']('isVisible',!0x0);const _0x350022=this['bindTemplate'];this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai_review__check-list-item-model-name',_0x350022['if']('isVisible','ck-hidden',_0x226376=>!_0x226376)]},'children':[{'text':_0x350022['to']('text')}]});}}class ko extends _0x512e7d{constructor(_0x3b2f1c,_0x402acc){super();const _0x4756fb=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-button__label'],'style':_0x4756fb['to']('style'),'id':_0x4756fb['to']('id')},'children':[{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-model-dropdown-name']},'children':[{'tag':'span','children':[{'text':_0x4756fb['to']('text')}]}]},{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-model-dropdown-description']},'children':[{'tag':'span','children':[_0x402acc['description']||'']}]}]});}}class ic extends _0x8981d2{['_formItemsCollection']=new _0xa460cb();['_customCheckView']=null;['_hideModels']=!0x1;constructor(_0x4956aa,_0x26535a,_0x172161,_0x2132f9=!0x1){super(_0x4956aa),this['_hideModels']=_0x2132f9,this['set']('isParametrizedViewOpen',!0x1),this['set']('isListItemRendered',!0x1),this['set']('isItemParametrized',_0x26535a['isParameterized']);const _0x175480=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',_0x269e21=>_0x269e21),this['bindTemplate']['if']('isListItemRendered','ck-ai_review__check-list-item_rendered',_0x417818=>_0x417818)],'style':{'--ck-ai-review-check-list-item-index':_0x172161}},'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':_0x26535a['title']}]},_0x175480]},{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-description']},'children':_0x26535a['description']?[{'text':_0x26535a['description']}]:[]}]}]},..._0x26535a['isParameterized']?[this['_createParameterizedView'](_0x26535a)]:[],...'custom'===_0x26535a['id']?[this['_createCustomView'](_0x26535a,this['_hideModels'])]:[]]}),this['on']('click',()=>{_0x26535a['isParameterized']?this['isParametrizedViewOpen']=!0x0:this['fire']('runReviewCheck',{'id':_0x26535a['id'],'args':_0x26535a['useArgs']?_0x26535a['args']:void 0x0});}),requestAnimationFrame(()=>{this['isListItemRendered']=!0x0;});}['render'](){super['render'](),this['isItemParametrized']&&_0x5e5264({'emitter':this,'activator':()=>!0x0===this['isParametrizedViewOpen'],'contextElements':[this['element']],'callback':()=>{this['isParametrizedViewOpen']=!0x1;}});}['resetToDefault'](){this['isParametrizedViewOpen']=!0x1,this['_formItemsCollection']['forEach'](_0x197029=>{_0x197029['resetToDefault']();}),this['_customCheckView']&&this['_customCheckView']['resetToDefault']();}['_createIconView'](){const _0x26c1db=new _0x528adc();return _0x26c1db['content']=_0x12ad23,_0x26c1db['extendTemplate']({'attributes':{'class':['ck-ai_review__check-list-item-title-icon']}}),_0x26c1db;}['_createParameterizedView'](_0x4e51e4){const _0x4beb8d=new _0x5eeb09(),_0x52a841=this['_createFormView'](_0x4e51e4);return _0x4beb8d['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-parameterized',this['bindTemplate']['if']('isParametrizedViewOpen','ck-hidden',_0x37486c=>!_0x37486c)]},'children':[_0x52a841]}),_0x4beb8d;}['_createFormView'](_0x2f25ab){const _0x241485=new _0x5eeb09(),_0x572278=Array['isArray'](_0x2f25ab['options'])?_0x2f25ab['options']:[],_0x2f533d=new _0x599e60(this['locale']),t=this['locale']['t'];_0x2f533d['set']({'label':t('Submit'),'withText':!0x0,'class':'ck-ai-button-primary'}),_0x2f533d['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x596a53=>{_0x596a53['stopPropagation']();})}}),_0x2f533d['on']('execute',()=>{const _0x26a8f8=[],_0x6b51ad={};this['_formItemsCollection']['forEach'](_0x3e4e0c=>{_0x26a8f8['push'](_0x3e4e0c['value']),_0x2f25ab['useArgs']&&_0x2f25ab['options']&&(_0x6b51ad[_0x3e4e0c['argsKey']]=_0x3e4e0c['value']);}),this['fire']('runReviewCheck',{'id':_0x2f25ab['id'],'params':_0x26a8f8['length']?_0x26a8f8:void 0x0,'args':Object['keys'](_0x6b51ad)['length']?_0x6b51ad:void 0x0});});const _0x218ff8=_0x572278['length'];return _0x572278['forEach']((_0x493d2e,_0x43c5a7)=>{const _0x8729cc=_0x43c5a7===_0x218ff8-0x1;this['_formItemsCollection']['add'](new cc(this['locale'],_0x493d2e,_0x8729cc?_0x2f533d:null));}),_0x241485['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-parameterized-form']},'children':this['_formItemsCollection']}),_0x241485;}['_createCustomView'](_0x20f2c5,_0x36c137=!0x1){return this['_customCheckView']=new rc(this['locale'],_0x20f2c5,_0x36c137),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',_0x4af5cf=>!_0x4af5cf)]}}),this['_customCheckView']['delegate']('runReviewCheck')['to'](this),this['listenTo'](this['_customCheckView'],'closeCustomCheck',()=>{this['isParametrizedViewOpen']=!0x1;}),this['on']('change:isParametrizedViewOpen',(_0x35bbe0,_0x251147,_0x237e5f)=>{_0x237e5f||this['_customCheckView']['resetFormValidationStatus']();}),this['_customCheckView'];}}class je extends _0x8981d2{['_checkViews'];constructor(_0x41ed36){super(_0x41ed36),this['_checkViews']=new _0xa460cb(),this['_setupTemplate']();}['setChecks'](_0x2f90ec,_0x46c972=!0x1){this['_checkViews']['clear']();for(const [_0x461028,_0x350833]of _0x2f90ec['entries']()){const _0x5eaf31=new ic(this['locale'],_0x350833,_0x461028,_0x46c972);_0x5eaf31['delegate']('runReviewCheck')['to'](this),this['_checkViews']['add'](_0x5eaf31);}}['hasChecks'](){return this['_checkViews']['length']>0x0;}['resetAllParameterizedChecks'](){for(const _0x4567d4 of this['_checkViews'])_0x4567d4 instanceof ic&&_0x4567d4['resetToDefault']();}['_setupTemplate'](){const _0x44f2d5=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list',_0x44f2d5['if']('isVisible','ck-hidden',_0x532e78=>!_0x532e78)]},'children':this['_checkViews']});}}class ge extends Me{static get['pluginName'](){return'AIReviewModeUI';}['createMainView'](){const _0x268ad9=this['context']['locale'],_0x4876ba=new _0x156476(_0x268ad9,{'label':i(_0x268ad9,'AI_REVIEW_MODE'),'icon':_0x49b99c,'class':'ck-ai-header\x20ck-ai-header_review'});return new Ae(this['context']['locale'],{'header':_0x4876ba,'list':new je(_0x268ad9),'results':new Ve(_0x268ad9,{'generalErrorText':i(_0x268ad9,'AI_REVIEW_MODE_GENERAL_ERROR_MESSAGE')}),'completed':new be(_0x268ad9,{'headerText':i(_0x268ad9,'AI_REVIEW_MODE_FINISH_REVIEW_HEADER_TITLE'),'emptyResultsText':i(_0x268ad9,'AI_REVIEW_MODE_EMPTY_RESULTS_TEXT'),'buttonText':i(_0x268ad9,'AI_REVIEW_MODE_FINISH_REVIEW_BUTTON_LABEL')})});}['registerTab'](){const _0x4a173b=this['context']['plugins']['get']('AITabs');_0x4a173b['view']['on']('activateTab',(_0x57eec2,_0x339bfa)=>{'reviewMode'===_0x339bfa?this['fire']('getReviewCheckList'):this['fire']('leaveReview');}),_0x4a173b['view']['addTab']({'id':'reviewMode','buttonLabel':i(this['context']['locale'],'AI_REVIEW_MODE'),'buttonIcon':_0x49b99c,'order':0x0,'content':this['_mainView']});}}const fe='review-';class de extends _0x34a98c{static get['requires'](){return[_0x31d190,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(_0x443010){super(_0x443010),this['_domEmitter']=new(_0x91e897())(),this['_eventEmitter']=new(_0x17d663())();}get['emitter'](){return this['_eventEmitter'];}['afterInit'](){const _0x338f0=T(this['context']);_0x338f0['conversion']['for']('editingDowncast')['markerToElement']({'model':fe+'insert','view':(_0x56ba77,{writer:_0x206f77})=>{const _0x18bee4=this['_markers']['get'](_0x56ba77['markerName']),_0x569dbe={'class':'ck-ai_review-marker_add'+(this['_activeMarkers']['has'](_0x18bee4?.['id']||'')?'\x20ck-ai_review__change_active':''),'data-marker-id':_0x56ba77['markerName']};return _0x206f77['createUIElement']('span',_0x569dbe,function(_0x1e60ba){const _0x209b31=this['toDomElement'](_0x1e60ba);return _0x209b31['innerHTML']=_0x18bee4?.['content']?.['asString']||'',_0x209b31;});}}),_0x338f0['conversion']['for']('editingDowncast')['markerToHighlight']({'model':fe+'remove-only','view':_0x359541=>{const _0x3a4d3a=this['_markers']['get'](_0x359541['markerName']),_0x2f3aa8=['ck-ai_review-marker_strikethrough'];return this['_activeMarkers']['has'](_0x3a4d3a?.['id']||'')&&_0x2f3aa8['push']('ck-ai_review__change_active'),{'classes':_0x2f3aa8,'attributes':{'data-marker-id':_0x359541['markerName']}};}}),_0x338f0['conversion']['for']('editingDowncast')['markerToHighlight']({'model':fe+'remove-context','view':_0x213da5=>{const _0x36625e=this['_markers']['get'](_0x213da5['markerName']),_0x4b58df=['ck-ai_review-marker_underline'];return this['_activeMarkers']['has'](_0x36625e?.['id']||'')&&_0x4b58df['push']('ck-ai_review__change_active'),{'classes':_0x4b58df,'attributes':{'data-marker-id':_0x213da5['markerName']}};}}),_0x338f0['conversion']['for']('editingDowncast')['markerToHighlight']({'model':fe+'remove-text','view':_0x1987af=>{const _0x11265c=this['_markers']['get'](_0x1987af['markerName']),_0x2b77cc=['ck-ai_review-marker_hide'];return this['_activeMarkers']['has'](_0x11265c?.['id']||'')&&_0x2b77cc['push']('ck-ai_review__change_active'),{'classes':_0x2b77cc,'attributes':{'data-marker-id':_0x1987af['markerName']}};}}),_0x338f0['conversion']['for']('dataDowncast')['markerToElement']({'model':fe+'suggestion-context','view':(_0x16d32b,{writer:_0x1e7aff})=>_0x1e7aff['createRawElement']('span',{'class':'ck-ai_review-marker_context-'+(_0x16d32b['isOpening']?'start':'end')})}),_0x338f0['conversion']['for']('downcast')['attributeToAttribute']({'model':Ct,'view':_0x1232cc});const _0x3fc550=_0x338f0['ui']['getEditableElement']()||document['body'];this['_domEmitter']['listenTo'](_0x3fc550,'mouseup',(_0x558a28,_0x3fa8c5)=>{const _0x524b14=_0x3fa8c5['target'],_0x1240f6=this['_findMarkerElement'](_0x524b14);if(!_0x1240f6)return;const _0x2e758c=_0x1240f6['getAttribute']('data-marker-id'),_0x3841d4=_0x2e758c['split'](':')['pop']()?.['split']('_')[0x0];this['_eventEmitter']['fire']('changeMarkerClicked',{'markerId':_0x2e758c,'changeId':_0x3841d4,'markerElement':()=>this['_findMarkerElementById'](_0x2e758c),'domEvent':_0x3fa8c5});},{'usePassive':!0x0,'priority':'highest'}),this['_domEmitter']['listenTo'](_0x3fc550,'mouseover',(_0x578cab,_0x1c94c5)=>{const _0x123c50=_0x1c94c5['target'],_0x2917cf=_0x1c94c5['relatedTarget'];let _0x2976b7=this['_findMarkerElement'](_0x123c50);if(!_0x2976b7&&_0x2917cf&&(_0x2976b7=this['_findMarkerElement'](_0x2917cf)),!_0x2976b7)return;const _0x2cbdd5=_0x2976b7['getAttribute']('data-marker-id'),_0x283695=_0x2cbdd5['split'](':')['pop']()?.['split']('_')[0x0];this['_eventEmitter']['fire']('changeMarkerHovered',{'changeId':_0x283695,'markerElement':()=>this['_findMarkerElementById'](_0x2cbdd5),'domEvent':_0x1c94c5});}),this['_domEmitter']['listenTo'](document,'mouseover',_0x1365a0((_0xeac89f,_0x701af)=>{const _0x13bb52=_0x701af['target'];if(this['_findMarkerElement'](_0x13bb52))return;_0x13bb52['closest']('.ck-reset.ck-ai_review-balloon-panel-suggestion')||this['_eventEmitter']['fire']('changeMarkerBlurred');},0xc8)),_0x338f0['model']['document']['registerPostFixer'](_0x3a7aa3=>this['_validateMarkers'](_0x338f0,_0x3a7aa3)),_0x338f0['model']['document']['on']('change',()=>this['_handleMarkerChanges'](_0x338f0));}['getDocumentData'](){const _0x4deed1=this['context']['plugins']['get']('AIEditing'),_0x11bb1a=T(this['context']),_0x5cd088=_0x11bb1a['model'],_0x176b1a=new tt();for(const _0x55d9ae of _0x5cd088['document']['getRoot']()['getChildren']()){const _0x39e29d=_0x55d9ae['_clone'](!0x0);_0x176b1a['_appendChild'](_0x39e29d);}for(const _0x31756e of _0x5cd088['markers'])_0x176b1a['markers']['set'](_0x31756e['name'],this['_changeRangeOwnerDocument'](_0x31756e['getRange']()['clone'](),_0x176b1a));const _0x1a557b=new _0x22aa1e({'ignoreElementEnd':!0x0,'startPosition':_0x5cd088['createPositionAt'](_0x176b1a,0x0)}),_0x35dc37=new Set(),_0x303549=new Map();for(const {item:_0x3d1b8c}of _0x1a557b){if(!_0x3d1b8c['is']('$textProxy'))continue;const _0xbe3da8=_0x3d1b8c['parent'];if(_0xbe3da8&&_0xbe3da8['is']('element')){const _0x529f71=this['_upsertDataId'](_0xbe3da8,()=>_0x4deed1['_nextDataId'](_0x35dc37));_0x35dc37['add'](_0x529f71);for(const _0x5d26f5 of _0xbe3da8['getChildren']())_0x5d26f5['is']('element')&&_0x35dc37['add'](this['_upsertDataId'](_0x5d26f5,()=>_0x4deed1['_nextDataId'](_0x35dc37)));let _0x8b0dfb=_0xbe3da8;for(;_0x8b0dfb['parent']&&!_0x8b0dfb['parent']['is']('documentFragment');)_0x8b0dfb=_0x8b0dfb['parent'],_0x8b0dfb['hasAttribute'](Ct)&&_0x8b0dfb['_removeAttribute'](Ct);_0x303549['set'](_0x529f71,{'path':_0xbe3da8['getPath'](),'getContent':this['_createGetContentUsingDataIdFn'](_0x8b0dfb['_clone'](!0x0),_0x529f71,_0x11bb1a['data'])}),_0x1a557b['jumpTo'](_0x5cd088['createPositionAfter'](_0xbe3da8));}}return{'content':_0x11bb1a['data']['processor']['toData'](_0x11bb1a['data']['toView'](_0x176b1a)),'version':_0x11bb1a['model']['document']['version'],'elements':_0x303549};}['diffContent'](_0x393b92,_0x4f399f,_0x14d3f0=!0x1){const _0x49836e=[],_0x18969b=T(this['context']),_0x55ca8f=_0x18969b['data']['parse'](_0x4f399f,'$documentFragment'),_0x4b8b2a=_0x18969b['data']['parse'](_0x393b92,'$documentFragment'),_0x3abb21=_0x18969b['model']['createPositionAt'](_0x4b8b2a,0x0);if(this['_haveSingleTopLevelElement'](_0x55ca8f)){if(!this['_hasSameTopLevelElement'](_0x4b8b2a,_0x55ca8f))return _0x49836e;}else{const _0x22b20a=_0x18969b['model']['schema'];if(!this['_haveOnlyInlineContent'](_0x4b8b2a,_0x22b20a)||!this['_haveOnlyInlineContent'](_0x55ca8f,_0x22b20a))return _0x49836e;}const _0x25970e=this['context']['plugins']['get']('DocumentCompare')['getDiff'](_0x393b92,_0x4f399f,{'anchor':_0x3abb21,'markDeletions':!0x0})['getOperations']()['filter'](_0x579abb=>'insert'===_0x579abb['type']||'marker'===_0x579abb['type']&&_0x579abb['name']['startsWith']('$markedRemove')),_0x4dd9d2=this['_groupAdjacentOperations'](_0x25970e),_0x5c7efe=[];if(_0x14d3f0){if(_0x4dd9d2['length']){const _0x18d25a=_0x4dd9d2[0x0]['operations'][0x0],_0x5518a5='insert'===_0x18d25a['type']?_0x18d25a['position']:_0x18d25a['newRange']['start'],_0x2486f8=this['_getPositionLimitingRange'](_0x5518a5,_0x18969b,'inside'),_0x391db0=_0x2486f8?_0x55ca8f['getChild'](0x0)['getChildren']():_0x55ca8f['getChildren'](),_0x5288ad=_0x2486f8||_0x18969b['model']['createRangeIn'](_0x4b8b2a),_0x2a18f7=[new _0x3bab2e('$markedRemove:synthetic'+_0x3dbf6d(),null,_0x5288ad,_0x18969b['model']['document']['model']['markers'],!0x0,_0x18969b['model']['document']['version']+0x1),new _0x546415(_0x5288ad['end'],_0x391db0,_0x18969b['model']['document']['version']+0x2)];_0x5c7efe['push']({'operations':_0x2a18f7,'operationsIsolated':_0x2a18f7,'groupOffset':0x0});}}else _0x5c7efe['push'](..._0x4dd9d2);let _0x197602=0x0;return _0x18969b['model']['change'](_0xb72132=>{for(let _0x2f3473=0x0;_0x2f3473<_0x5c7efe['length'];_0x2f3473++){const _0x435eb4=_0x5c7efe[_0x2f3473],_0x2a86b3=_0xb72132['createDocumentFragment']();for(const _0x1ac1d6 of _0x4b8b2a['getChildren']())_0xb72132['append'](_0x1ac1d6['_clone'](!0x0),_0x2a86b3);for(const _0x5cb868 of _0x435eb4['operationsIsolated'])if('insert'===_0x5cb868['type']){const _0x51874e=_0x5cb868;_0x51874e['baseVersion']=null,_0x51874e['isDocumentOperation']=!0x1,this['_changeOperationOwnerDocument'](_0x51874e,_0x2a86b3),_0xb72132['batch']['addOperation'](_0x5cb868),_0x18969b['model']['applyOperation'](_0x5cb868);const _0x3c199b='suggestion:insertion:id:authorId:'+_0x197602++,_0x5c68c0=_0x18969b['model']['createRange'](_0x51874e['position'],_0x51874e['position']['getShiftedBy'](_0x51874e['howMany']));_0x2a86b3['markers']['set'](_0x3c199b,_0x5c68c0);}else{if('marker'===_0x5cb868['type']&&_0x5cb868['name']['startsWith']('$markedRemove')){const _0xc84eb2=_0x5cb868,_0x4e5266='suggestion:deletion:id:authorId:'+_0x197602++;this['_changeOperationOwnerDocument'](_0xc84eb2,_0x2a86b3),_0x2a86b3['markers']['set'](_0x4e5266,_0xc84eb2['newRange']);}}if(_0x14d3f0)_0x49836e['push']({..._0x435eb4,'context':this['_createGetContentFn'](_0x4b8b2a,_0x18969b['data']),'content':this['_createGetContentFn'](_0x4b8b2a,_0x18969b['data'])});else{const _0x3ab339=this['_getChangeContext'](this['_changePositionOwnerDocument'](this['_getOperationStart'](_0x435eb4['operationsIsolated'][0x0]),_0x2a86b3),this['_changePositionOwnerDocument'](this['_getOperationEnd'](_0x435eb4['operationsIsolated'][_0x435eb4['operationsIsolated']['length']-0x1]),_0x2a86b3));_0x2a86b3['markers']['set'](fe+'suggestion-context',new it(_0x3ab339['start'],_0x3ab339['end'])),_0x49836e['push']({..._0x435eb4,'context':this['_createGetContextFn'](_0x2a86b3,_0x18969b['data'],{'ellipsisBefore':_0x3ab339['hasContentBefore'],'ellipsisAfter':_0x3ab339['hasContentAfter']}),'content':this['_createGetContentFn'](_0x2a86b3,_0x18969b['data'])});}}}),_0x49836e;}['markChangePositionInEditorContent'](_0x3eef7a,_0x5ed175){if(!_0x3eef7a['length'])return;const _0x486a4e=_0x3eef7a[0x0]['parent']['id'],_0x571660=_0x5ed175['elements']['get'](_0x486a4e);if(!_0x571660)return void console['warn']('No\x20element\x20found\x20for\x20ID:\x20'+_0x486a4e);const _0x48d722=_0x571660['path'],_0x21c6e7=T(this['context']),_0xa31058=_0x21c6e7['model']['document']['history']['getOperations'](_0x5ed175['version']),_0x3e117d=[];for(const _0x57fafa of _0x3eef7a){const _0x426d9f=_0x57fafa['operationsIsolated']['map'](_0x295d91=>this['_translateOperationToEditorContent'](_0x295d91,_0x48d722,_0x21c6e7['model']['document']['getRoots']()[0x0]));if(!_0x426d9f||!_0x426d9f['length'])continue;const _0x44ed3a=_0x426d9f['every'](_0x1afac3=>'marker'===_0x1afac3['type']&&_0x1afac3['name']['startsWith']('$markedRemove')),_0xaea2c={'document':_0x21c6e7['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1},_0x1bc1a3=nt(_0x426d9f,_0xa31058,_0xaea2c)['operationsA'];for(const _0x3497c7 of _0x1bc1a3)if('insert'===_0x3497c7['type']){const _0x5ae628=_0x3497c7,_0x47d3a9=_0x5ae628['nodes'];_0x21c6e7['model']['change'](_0x3b2333=>{const _0x677e5=_0x3b2333['createDocumentFragment']();for(const _0x11b7a8 of _0x47d3a9)_0x3b2333['append'](_0x11b7a8['_clone'](!0x0),_0x677e5);_0x3e117d['push']({'start':_0x5ae628['position'],'end':_0x5ae628['position'],'type':'insert','groupId':_0x57fafa['id'],'content':{'asString':this['_createGetContentFn'](_0x677e5,_0x21c6e7['data'])(),'asFragment':_0x677e5}});});}else{if('marker'===_0x3497c7['type']&&_0x3497c7['name']['startsWith']('$markedRemove')){const _0x26a351=_0x3497c7;let _0x1097b0='remove-text';if(_0x44ed3a){const _0x342f7e=this['_findAdjacentContextDistance'](_0x26a351['newRange']['start'],'backward',_0x21c6e7['model']['schema']),_0x52adc1=this['_findAdjacentContextDistance'](_0x26a351['newRange']['end'],'forward',_0x21c6e7['model']['schema']);if(_0x342f7e||_0x52adc1){const _0x1730e1=_0x26a351['newRange']['start']['getShiftedBy'](-_0x342f7e),_0x444bee=_0x26a351['newRange']['end']['getShiftedBy'](_0x52adc1);_0x3e117d['push']({'start':_0x1730e1,'end':_0x444bee,'groupId':_0x57fafa['id'],'type':'remove-context'});}else _0x1097b0='remove-only';}_0x3e117d['push']({'start':_0x26a351['newRange']['start'],'end':_0x26a351['newRange']['end'],'groupId':_0x57fafa['id'],'type':_0x1097b0});}}}this['_insertMarkers'](_0x3e117d);}['clearAllMarkers'](){const _0x587953=T(this['context']);_0x587953['model']['change'](_0x41074f=>{for(const _0x26f761 of this['_markers']['keys']())_0x587953['model']['markers']['get'](_0x26f761)&&_0x41074f['removeMarker'](_0x26f761);}),this['_markers']['clear'](),this['_activeMarkers']['clear']();}['switchToReadOnly'](){T(this['context'])['enableReadOnlyMode']('ai-review');}['switchToEdit'](){T(this['context'])['disableReadOnlyMode']('ai-review');}['applyChange'](_0xf7566f){const _0x411e20=T(this['context']),_0x204562=_0x411e20['model'],_0x1ec47e=_0xf7566f['map'](_0x5a4da4=>this['_getMarkersDataForGroup'](_0x5a4da4))['flat']();_0x204562['change'](_0x517a74=>{for(const _0x251b8c of _0x1ec47e){const _0x35a8ca=_0x411e20['model']['markers']['get'](_0x251b8c['id']);if(_0x35a8ca){if('insert'===_0x251b8c['type']){if(!_0x251b8c['content'])continue;_0x204562['insertContent'](_0x251b8c['content']['asFragment']||null,_0x35a8ca['getRange']()['start']);}else'remove-text'!==_0x251b8c['type']&&'remove-only'!==_0x251b8c['type']||_0x204562['deleteContent'](_0x204562['createSelection'](_0x35a8ca['getRange']()));_0x517a74['removeMarker'](_0x251b8c['id']),this['_markers']['delete'](_0x251b8c['id']);}}});}['rejectChange'](_0x34e6ba){const _0x2bd777=T(this['context']),_0xb28402=this['_getMarkersDataForGroup'](_0x34e6ba);_0x2bd777['model']['change'](_0x4cf884=>{for(const _0x5c6fa1 of _0xb28402)_0x4cf884['removeMarker'](_0x5c6fa1['id']),this['_markers']['delete'](_0x5c6fa1['id']);});}['getEditor'](){return T(this['context']);}['getMarkerElementForChange'](_0x153834){const _0x572c7b=Array['from'](this['_markers']['values']())['filter'](_0x2f8600=>_0x2f8600['groupId']===_0x153834);if(!_0x572c7b['length'])return null;const _0x22dd5d=0x1===_0x572c7b['length']?_0x572c7b[0x0]:this['_sortMarkers'](_0x572c7b)[0x0],_0x21dda9=T(this['context'])['model']['markers']['get'](_0x22dd5d['id']);if(!_0x21dda9)return null;return{'modelRange':_0x21dda9['getRange'](),'getElement':()=>this['_findMarkerElementById'](_0x22dd5d['id'])};}['getContentElementForChange'](_0x357f1a){const _0x255041=Array['from'](this['_markers']['values']())['filter'](_0x2f1786=>_0x2f1786['groupId']===_0x357f1a);if(!_0x255041['length'])return null;const _0x4a3d0e=0x1===_0x255041['length']?_0x255041[0x0]:this['_sortMarkers'](_0x255041)[0x0],_0x1cfaf8=T(this['context']),_0x50037a=_0x1cfaf8['model']['markers']['get'](_0x4a3d0e['id']);if(!_0x50037a)return null;const _0x193469=_0x50037a['getRange'](),_0x3bb122=_0x1cfaf8['editing']['view']['getDomRoot']();if(!_0x3bb122||!_0x193469)return null;let _0x34c723=_0x193469['start']['parent'];for(;_0x34c723['parent']&&'$root'!==_0x34c723['parent']['name'];)_0x34c723=_0x34c723['parent'];if(!_0x34c723||!_0x34c723['name'])return null;const _0x4cbb9f=_0x3bb122['querySelector']('[data-marker-id=\x22'+_0x4a3d0e['id']+'\x22]');if(!_0x4cbb9f)return null;let _0x5f3957=null;_0x1cfaf8['model']['change'](_0x3848e9=>{_0x5f3957=_0x3848e9['createDocumentFragment'](),_0x3848e9['append'](_0x34c723['_clone'](!0x0),_0x5f3957);});const _0x127ca3=_0x1cfaf8['data']['toView'](_0x5f3957)['getChild'](0x0);return _0x4cbb9f['closest'](_0x127ca3['name']);}['reactivateMarkers'](_0x2ac718){const _0x2cb21e=this['_getMarkersDataForGroup'](_0x2ac718);if(!_0x2cb21e['length'])return;const _0x32069b=Array['from'](this['_activeMarkers'])['sort'](),_0x2eb350=Array['from'](new Set(_0x2cb21e['map'](_0xb4f070=>_0xb4f070['id'])))['sort']();_0x32069b['join']('|')!==_0x2eb350['join']('|')&&(this['setAllMarkersAsInactive'](),this['setMarkersInElementAsActive'](_0x2ac718));}['setMarkersInElementAsActive'](_0x488ee7){const _0x1f6918=this['_getMarkersDataForGroup'](_0x488ee7);if(!_0x1f6918['length'])return;const _0x4253d9=T(this['context']),_0x26f096=new Set(_0x1f6918['map'](_0x318e81=>_0x318e81['id'])),_0x110470=Array['from'](_0x26f096['values']())['map'](_0x2d446e=>_0x4253d9['model']['markers']['get'](_0x2d446e))['filter'](_0x4664a3=>!!_0x4664a3);_0x26f096['forEach'](_0x25c69e=>{this['_activeMarkers']['add'](_0x25c69e);}),_0x4253d9['model']['change'](()=>{_0x110470['forEach'](_0x278e7c=>{_0x4253d9['editing']['reconvertMarker'](_0x278e7c);});});}['setAllMarkersAsInactive'](){const _0x2bdafd=Array['from'](this['_activeMarkers']);if(!_0x2bdafd['length'])return;this['_activeMarkers']['clear']();const _0x50cdb9=T(this['context']),_0x222c21=_0x2bdafd['map'](_0x577f48=>_0x50cdb9['model']['markers']['get'](_0x577f48))['filter'](_0x558ac6=>!!_0x558ac6);_0x50cdb9['model']['change'](()=>{_0x222c21['forEach'](_0x32416a=>{_0x50cdb9['editing']['reconvertMarker'](_0x32416a);});});}['_getPositionLimitingRange'](_0x3c1eeb,_0x5ad2d2,_0x3514ae='outside'){if(!_0x3c1eeb)return null;let _0x111bad=_0x3c1eeb['parent'];for(;_0x111bad&&_0x111bad['parent']&&'$root'!==_0x111bad['parent']['name']&&!_0x5ad2d2['model']['schema']['isLimit'](_0x111bad)&&!_0x5ad2d2['model']['schema']['isBlock'](_0x111bad);)_0x111bad=_0x111bad['parent'];if(!_0x111bad||!_0x111bad['name']||'$root'===_0x111bad['name'])return null;let _0x54d706=null;return _0x5ad2d2['model']['change'](_0x49436b=>{_0x54d706='inside'===_0x3514ae?_0x49436b['createRangeIn'](_0x111bad):_0x49436b['createRangeOn'](_0x111bad);}),_0x54d706;}['_validateMarkers'](_0x44e66f,_0x48de8b){const _0x773761=Array['from'](this['_markers']['keys']()),_0x4ea55d=new Map();for(const _0x3e7780 of _0x773761){const _0x5118a2=_0x44e66f['model']['markers']['get'](_0x3e7780);if(!_0x5118a2)continue;const _0x6d26b8=_0x5118a2['getStart']()['path'][0x0];_0x4ea55d['has'](_0x6d26b8)||_0x4ea55d['set'](_0x6d26b8,[]),_0x4ea55d['get'](_0x6d26b8)['push'](_0x5118a2);}const _0x3ded68=new Set();for(const _0x3a9e27 of _0x44e66f['model']['document']['differ']['getChanges']()){let _0x179749=-0x1,_0x3b05f8=null;if('insert'===_0x3a9e27['type'])_0x3b05f8=new it(_0x3a9e27['position'],_0x3a9e27['position']['getShiftedBy'](_0x3a9e27['length'])),_0x179749=_0x3a9e27['position']['path'][0x0];else{if('remove'!==_0x3a9e27['type'])continue;_0x3b05f8=new it(_0x3a9e27['position']),_0x179749=_0x3a9e27['position']['path'][0x0];}const _0x10da37=_0x4ea55d['get'](_0x179749)||[];if(_0x10da37['length']){for(const _0x5038d6 of _0x10da37)if(_0x3b05f8['root']['rootName']===_0x5038d6['getRange']()['root']['rootName']&&('insert'!==_0x3a9e27['type']||!_0x3b05f8['containsRange'](_0x5038d6['getRange']()))&&(_0x3b05f8['isIntersecting'](_0x5038d6['getRange']())||_0x3b05f8['start']['isTouching'](_0x5038d6['getRange']()['end'])||_0x3b05f8['end']['isTouching'](_0x5038d6['getRange']()['start']))){const _0xae1501=this['_parseMarkerName'](_0x5038d6['name']);Array['from'](this['_markers']['values']())['filter'](_0x1bf895=>_0x1bf895['groupId']===_0xae1501['groupId'])['forEach'](_0xde512a=>_0x3ded68['add'](_0xde512a['id']));}}}if(_0x3ded68['size']){for(const _0x167110 of _0x3ded68)_0x48de8b['removeMarker'](_0x167110);return!0x0;}return!0x1;}['_handleMarkerChanges'](_0x5f4fe0){for(const {name:_0x1d39b0,data:_0x5e1604}of _0x5f4fe0['model']['document']['differ']['getChangedMarkers']()){if(!_0x1d39b0['startsWith'](fe))continue;const _0x3e77e8=_0x5e1604['oldRange'],_0x51813b=_0x5e1604['newRange'],_0x33d129=_0x3e77e8&&'$graveyard'===_0x3e77e8['root']['rootName'],_0x433925=_0x51813b&&'$graveyard'===_0x51813b['root']['rootName'];if(_0x33d129&&_0x433925)continue;const _0x13db70=this['_parseMarkerName'](_0x1d39b0);this['_markers']['get'](_0x1d39b0)&&(_0x433925||!_0x51813b?this['_eventEmitter']['fire']('changeMarkerRemoved',{'markerId':_0x1d39b0,'changeId':_0x13db70['groupId']}):_0x33d129&&_0x51813b&&this['_eventEmitter']['fire']('changeMarkerRestored',{'markerId':_0x1d39b0,'changeId':_0x13db70['groupId']}));}}['_parseMarkerName'](_0x4e8d02){const _0x3c92ed=_0x4e8d02['split'](':'),_0x268834=(_0x3c92ed[0x1]||'')['split']('_');return{'prefix':_0x3c92ed[0x0],'groupId':_0x268834[0x0],'suffix':_0x268834[0x1]};}['_translateOperationToEditorContent'](_0x3828b0,_0x38fd95,_0x47c8db){if('insert'===_0x3828b0['type']){const _0x311629=_0x3828b0;return new _0x546415(this['_changePosition'](_0x38fd95['concat'](_0x311629['position']['offset']),_0x47c8db),_0x311629['nodes'],_0x311629['baseVersion']);}if('marker'===_0x3828b0['type']&&_0x3828b0['name']['startsWith']('$markedRemove')){const _0x1ead69=_0x3828b0;return new _0x3bab2e(_0x1ead69['name'],_0x1ead69['oldRange'],this['_changeRange'](_0x1ead69['newRange'],_0x38fd95['concat'](_0x1ead69['newRange']['start']['offset']),_0x38fd95['concat'](_0x1ead69['newRange']['end']['offset']),_0x47c8db),_0x1ead69['_markers'],_0x1ead69['affectsData'],_0x1ead69['baseVersion']);}return _0x3828b0;}['_groupAdjacentOperations'](_0x3cb02e){if(!_0x3cb02e['length'])return[];const _0x5b770c=[];let _0x5467c8=0x0,_0x44b2e9=0x0,_0x1dacf3=[];for(let _0x3bb742=0x0;_0x3bb742<=_0x3cb02e['length'];_0x3bb742++){const _0x5d526b=_0x3cb02e[_0x3bb742],_0x19f511=_0x3cb02e[_0x3bb742-0x1];!_0x5d526b||_0x19f511&&!this['_getOperationEnd'](_0x19f511)['isTouching'](this['_getOperationStart'](_0x5d526b))?(_0x5b770c['push']({'operations':_0x1dacf3,'operationsIsolated':_0x1dacf3['map'](_0x5e2b0a=>this['_shiftOperation'](_0x5e2b0a['clone'](),-_0x44b2e9)),'groupOffset':_0x5467c8}),_0x1dacf3=_0x5d526b?[_0x5d526b]:[],_0x44b2e9+=_0x5467c8,_0x5467c8=0x0):_0x1dacf3['push'](_0x5d526b),_0x5d526b&&'insert'===_0x5d526b['type']&&(_0x5467c8+=_0x5d526b['howMany']);}return _0x5b770c;}['_findAdjacentContextDistance'](_0x316bea,_0x4ba317,_0x4577db,_0x2bf5ae=0x1){const _0x39f625=new _0x22aa1e({'startPosition':_0x316bea,'direction':_0x4ba317});let _0x41ed9f=0x0;for(let _0x1a1278=0x0;_0x1a1278<_0x2bf5ae;_0x1a1278++){let _0x227cb0=0x0,_0x5a664a=!0x1,_0x13018a='forward'===_0x4ba317?/^\W*\w+/:/\w+\W*$/;for(const {item:_0x5041d8}of _0x39f625)if(_0x5041d8['is']('$textProxy')){const _0x328b59=_0x13018a['exec'](_0x5041d8['data']);if(_0x328b59&&_0x328b59['length']){if(_0x227cb0+='forward'===_0x4ba317?_0x328b59['index']+_0x328b59[0x0]['length']:_0x5041d8['data']['length']-_0x328b59['index'],_0x328b59[0x0]['length']!==_0x5041d8['data']['length'])break;_0x5a664a=!0x0,_0x13018a='forward'===_0x4ba317?/^\w+/:/\w+$/;}else{if(_0x5a664a)break;_0x227cb0+=_0x5041d8['offsetSize'];}}else{if(_0x5041d8['is']('element')){_0x4577db['isInline'](_0x5041d8)&&!_0x5a664a&&(_0x227cb0+=0x1);break;}}_0x41ed9f+=_0x227cb0,_0x39f625['jumpTo'](_0x316bea['getShiftedBy']('forward'===_0x4ba317?_0x41ed9f:-_0x41ed9f));}return _0x41ed9f;}['_getChangeContext'](_0x3beedf,_0x2f6fdc){const _0x32ef96=T(this['context'])['model']['schema'],_0x510bf3=this['_findAdjacentContextDistance'](_0x3beedf,'backward',_0x32ef96,0x6),_0x377a5f=this['_findAdjacentContextDistance'](_0x2f6fdc,'forward',_0x32ef96,0x6),_0x3034ee=_0x3beedf['getShiftedBy'](-_0x510bf3),_0x28fdc9=_0x2f6fdc['getShiftedBy'](_0x377a5f);return{'start':_0x3034ee,'end':_0x28fdc9,'hasContentBefore':!_0x3034ee['isAtStart'],'hasContentAfter':!_0x28fdc9['isAtEnd']};}['_insertMarkers'](_0x3ffaae){const _0x49f83b=this['context']['plugins']['get']('AIEditing'),_0x1fabe7=new Set();T(this['context'])['model']['change'](_0x2635d9=>{for(const _0x3dba61 of _0x3ffaae){const _0x1659c6=''+fe+_0x3dba61['type']+':'+_0x3dba61['groupId']+'_'+_0x49f83b['_nextDataId'](_0x1fabe7);this['_markers']['set'](_0x1659c6,{'id':_0x1659c6,'groupId':_0x3dba61['groupId'],'type':_0x3dba61['type'],'content':_0x3dba61['content']}),_0x2635d9['addMarker'](_0x1659c6,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x2635d9['createRange'](_0x3dba61['start'],_0x3dba61['end'])});}});}['_createGetContextFn'](_0x2a8ead,_0x448d86,_0x121541){let _0x14ab7b='';return()=>{if(!_0x14ab7b){const _0x5eeccd=_0x448d86['toView'](_0x2a8ead,{'showSuggestionHighlights':!0x0});let _0x21e5cb=_0x5eeccd['getChild'](0x0);if(_0x21e5cb['is']('containerElement')||(_0x21e5cb=_0x5eeccd),!_0x21e5cb)return'';let _0x2c1841=!0x1;const _0x587e6c=[];for(const _0x5cfc76 of _0x21e5cb['getChildren']())_0x5cfc76['is']('element','span')&&_0x5cfc76['hasClass']('ck-ai_review-marker_context-end')&&(_0x2c1841=!0x1),_0x2c1841&&_0x587e6c['push'](_0x5cfc76),_0x5cfc76['is']('element','span')&&_0x5cfc76['hasClass']('ck-ai_review-marker_context-start')&&(_0x2c1841=!0x0);_0x21e5cb['_removeChildren'](0x0,_0x21e5cb['childCount']),_0x121541?.['ellipsisBefore']&&_0x21e5cb['_appendChild']('…'),_0x21e5cb['_appendChild'](_0x587e6c),_0x121541?.['ellipsisAfter']&&_0x21e5cb['_appendChild']('…');const _0x429d90=_0x448d86['htmlProcessor']['domConverter']['viewToDom'](_0x5eeccd),_0x4c9bc3=_0x448d86['htmlProcessor']['htmlWriter']['getHtml'](_0x429d90);_0x14ab7b=_0x4c9bc3;}return _0x14ab7b;};}['_createGetContentFn'](_0x3ae777,_0x1cca14){let _0xe8e617='';return()=>(_0xe8e617||(_0xe8e617=_0x1cca14['stringify'](_0x3ae777,{'showSuggestionHighlights':!0x0})),_0xe8e617);}['_createGetContentUsingDataIdFn'](_0x45f38c,_0x31e68f,_0x17cbfc){let _0x5bd910='';return()=>{if(!_0x5bd910){const _0x26125d=_0x17cbfc['toView'](new tt(_0x45f38c)),_0x59674e=_0x17cbfc['htmlProcessor']['domConverter']['viewToDom'](_0x26125d)['querySelector']('[data-id=\x22'+_0x31e68f+'\x22]');_0x5bd910=_0x59674e?.['outerHTML']||'';}return _0x5bd910;};}['_findMarkerElement'](_0x1ef486,_0x5aed63=0x5){let _0x4f516d=_0x1ef486,_0x5ba106=null;for(let _0x2e03a6=0x0;_0x2e03a6<_0x5aed63&&_0x4f516d;_0x2e03a6++){if(!_0x4f516d['className']){_0x4f516d=_0x4f516d['parentElement'];continue;}if(!(''+_0x4f516d['className'])['includes']('ck-ai_review-marker_')){_0x4f516d=_0x4f516d['parentElement'];continue;}if(!_0x4f516d['getAttribute']('data-marker-id'))break;_0x5ba106=_0x4f516d;break;}return _0x5ba106;}['_findMarkerElementById'](_0xd39dd9){const _0x33699e=T(this['context']),_0x4d35dc=_0x33699e['model']['markers']['get'](_0xd39dd9);return _0x4d35dc?_0x2acc42(_0x33699e['editing'],_0x4d35dc):null;}['_getMarkersDataForGroup'](_0x3cf96d){return Array['from'](this['_markers']['values']())['filter'](_0xcd41a2=>_0xcd41a2['groupId']===_0x3cf96d);}['_getOperationStart'](_0xbde048){return'insert'===_0xbde048['type']?_0xbde048['position']:_0xbde048['newRange']['start'];}['_getOperationEnd'](_0x343a4b,_0x29feb4=!0x1){return'insert'===_0x343a4b['type']?_0x29feb4?_0x343a4b['position']:_0x343a4b['position']['getShiftedBy'](_0x343a4b['howMany']):_0x343a4b['newRange']['end'];}['_shiftOperation'](_0x22b481,_0x2cb582){return'insert'===_0x22b481['type']?_0x22b481['position']=_0x22b481['position']['getShiftedBy'](_0x2cb582):'marker'===_0x22b481['type']&&_0x22b481['newRange']&&(_0x22b481['newRange']=new it(_0x22b481['newRange']['start']['getShiftedBy'](_0x2cb582),_0x22b481['newRange']['end']['getShiftedBy'](_0x2cb582))),_0x22b481;}['_changeOperationOwnerDocument'](_0x3ce840,_0x2c2ac0){'insert'===_0x3ce840['type']?_0x3ce840['position']=this['_changePositionOwnerDocument'](_0x3ce840['position'],_0x2c2ac0):'marker'===_0x3ce840['type']&&_0x3ce840['newRange']&&(_0x3ce840['newRange']=this['_changeRangeOwnerDocument'](_0x3ce840['newRange'],_0x2c2ac0));}['_changePositionOwnerDocument'](_0x6c930b,_0x36a231){return new st(_0x36a231,_0x6c930b['path']);}['_changeRangeOwnerDocument'](_0xc24f95,_0x1adec7){return new it(this['_changePositionOwnerDocument'](_0xc24f95['start'],_0x1adec7),this['_changePositionOwnerDocument'](_0xc24f95['end'],_0x1adec7));}['_changePosition'](_0x4a92d0,_0x117e2d){return new st(_0x117e2d,[..._0x4a92d0]);}['_changeRange'](_0x5292e6,_0x3b249a,_0x3e04e0,_0x3bce48){return new it(this['_changePosition'](_0x3b249a,_0x3bce48),this['_changePosition'](_0x3e04e0,_0x3bce48));}['_sortMarkers'](_0x452f02){const _0x1e585b=_0x342e92=>{switch(_0x342e92){case'insert':return 0x0;case'remove-context':return 0x1;case'remove-only':return 0x2;case'remove-text':return 0x3;}};return _0x452f02['sort']((_0x22a0da,_0x2652a5)=>_0x1e585b(_0x22a0da['type'])-_0x1e585b(_0x2652a5['type']));}['_hasSameTopLevelElement'](_0x1bcfd7,_0x419574){const _0x24745a=_0x1bcfd7['getChild'](0x0),_0xa24528=_0x419574['getChild'](0x0);return!(!_0x24745a||!_0xa24528)&&((!_0x24745a['is']('element')||!_0xa24528['is']('element')||_0x24745a['name']===_0xa24528['name'])&&!(_0x24745a['is']('element')&&!_0xa24528['is']('element')||!_0x24745a['is']('element')&&_0xa24528['is']('element')));}['_haveSingleTopLevelElement'](_0x4d29b1){return 0x1===_0x4d29b1['childCount'];}['_haveOnlyInlineContent'](_0x4fa8b4,_0x2f7b06){for(const _0x53a2d7 of _0x4fa8b4['getChildren']())if(_0x53a2d7['is']('element')&&!_0x2f7b06['isInline'](_0x53a2d7))return!0x1;return!0x0;}['_upsertDataId'](_0x419ad9,_0xe1abff){let _0x2eae5c=_0x419ad9['getAttribute'](Ct);return _0x2eae5c||(_0x2eae5c=_0xe1abff(),_0x419ad9['_setAttribute'](Ct,_0x2eae5c)),_0x2eae5c;}}class Zs extends _0x17d663(){['id'];['contentNew'];['contentInitial'];['documentVersion'];constructor({id:_0x4071b5,contentNew:_0x124bc1,contentInitial:_0x217c8e,documentVersion:_0x29d039}){super(),this['id']=_0x4071b5,this['contentNew']=_0x124bc1,this['contentInitial']=_0x217c8e,this['documentVersion']=_0x29d039;}}class th extends ts(){['id'];['parent'];['_data'];['_editorOperations']=[];constructor(_0x3c8ce4,_0xfdea2e,_0x2cefd6){super(),this['id']=_0x3c8ce4,this['parent']=_0x2cefd6,this['_data']=_0xfdea2e,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 eh extends ts(){['id']=_0x3dbf6d();['callId'];['_results']=new Map();['_changes']=[];['_sourceCheck'];['_documentData'];['_aiConnector'];['_reviewParams'];['_reviewArgs'];['_activeRequest']=null;['_currentError'];['_wasAborted']=!0x1;constructor(_0xd6bd42,_0x31030a,_0x55dace,_0x4ca01b,_0x2a7f6d){super(),this['_sourceCheck']=_0x31030a,this['_documentData']=_0xd6bd42,this['_aiConnector']=_0x55dace,this['_reviewParams']=_0x4ca01b,this['_reviewArgs']=_0x2a7f6d,this['on']('change:status',(_0x5a7d09,_0x23ba75,_0x46b7f9)=>{'aborted'==_0x46b7f9&&(this['_wasAborted']=!0x0),this['fire']('reviewCheckRunUpdated',{'status':_0x46b7f9,'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'](_0x48d94b=>'pending'===_0x48d94b['status']);}get['currentError'](){return this['_currentError'];}['updateDocumentData'](_0x3c3e65){this['_documentData']=_0x3c3e65;}async['start'](){this['status']='loading',this['_currentError']=void 0x0;try{this['_activeRequest']=this['_createApiRequest']();const _0x49bcef=await this['_activeRequest']['getStream']();this['status']='data';for await(const _0x14bc91 of _0x49bcef)'unmodified'!==_0x14bc91['data']['operation']&&('error'!==_0x14bc91['data']['operation']?'review-metadata'!==_0x14bc91['event']?this['_addReviewCheckResult'](_0x14bc91['data']['dataId'],_0x14bc91['data']['textDelta']):this['callId']=_0x14bc91['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(_0x439c75){this['_currentError']=_0x439c75,_0x439c75 instanceof Error&&_0x439c75['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'](_0x5115f4,_0x3e02ac){const _0x462cea=this['_results']['get'](_0x5115f4);if(!_0x462cea)return;if(0x0===_0x3e02ac['length'])return;const _0x37a750=[];_0x3e02ac['forEach']((_0x3723c5,_0x23867)=>{const _0x444fca=new th(_0x462cea['id']+'-'+_0x23867,_0x3723c5,_0x462cea);_0x444fca['on']('change:status',()=>{this['fire']('reviewCheckResultChangeStatusUpdated',{'change':_0x444fca,'status':_0x444fca['status']});}),_0x444fca['on']('change:isActivated',()=>{_0x444fca['isActivated']?this['fire']('reviewCheckResultActivated',{'change':_0x444fca}):this['fire']('reviewCheckResultDeactivated',{'change':_0x444fca});}),this['_changes']['push'](_0x444fca),_0x37a750['push'](_0x444fca);}),this['fire']('reviewCheckResultReady',{'changes':_0x37a750,'result':_0x462cea,'source':this});}['abort'](){this['_activeRequest']&&(this['_activeRequest']['abortController']['abort'](),this['_activeRequest']=null,this['status']='aborted');}['isChangeActive'](_0x6ac0d4){const _0x1ece75=this['_changes']['find'](_0x3b34bd=>_0x3b34bd['id']===_0x6ac0d4);return!(!_0x1ece75||'pending'!==_0x1ece75['status']);}['isAnyChangeActivated'](){return this['_changes']['some'](_0x4d446=>!0x0===_0x4d446['isActivated']);}['getActiveChanges'](){return this['_changes']['filter'](_0x5c9446=>'pending'===_0x5c9446['status']);}['getChangeById'](_0x5ded29){return this['_changes']['find'](_0x382afc=>_0x382afc['id']===_0x5ded29);}['markAllChangesAsAccepted'](){for(const _0x6e7b07 of this['_changes'])'pending'===_0x6e7b07['status']&&(_0x6e7b07['status']='accepted');this['_checkIfFinished']();}['markChangeAsAccepted'](_0x5d0b74){const _0xb85b11=this['_changes']['find'](_0x3a88e3=>_0x3a88e3['id']===_0x5d0b74);_0xb85b11&&'pending'===_0xb85b11['status']&&(_0xb85b11['status']='accepted'),this['_checkIfFinished']();}['markChangeAsRejected'](_0xd32ddd){const _0x25e167=this['_changes']['find'](_0x4085e5=>_0x4085e5['id']===_0xd32ddd);_0x25e167&&'pending'===_0x25e167['status']&&(_0x25e167['status']='rejected'),this['_checkIfFinished']();}['markChangeAsOutdated'](_0x4facb4){const _0x5dc000=this['_changes']['find'](_0x30a4b5=>_0x30a4b5['id']===_0x4facb4);_0x5dc000&&'pending'===_0x5dc000['status']&&(_0x5dc000['status']='outdated'),this['_checkIfFinished']();}['markChangeAsPending'](_0x4bcd0b){const _0x27786c=this['_changes']['find'](_0x494f59=>_0x494f59['id']===_0x4bcd0b);_0x27786c&&'outdated'===_0x27786c['status']&&(_0x27786c['status']='pending'),this['_checkIfFinished']();}['activateChange'](_0x4b53d3){this['_changes']['filter'](_0x30745b=>_0x30745b['isActivated']&&_0x30745b['id']!==_0x4b53d3)['forEach'](_0x3089f4=>{_0x3089f4['isActivated']=!0x1;});const _0x50e387=this['_changes']['find'](_0x2176a4=>_0x2176a4['id']===_0x4b53d3);_0x50e387&&'pending'===_0x50e387['status']&&(_0x50e387['isActivated']=!0x0);}['deactivateChange'](){this['_changes']['filter'](_0x31253a=>_0x31253a['isActivated'])['forEach'](_0x21141a=>{_0x21141a['isActivated']=!0x1;});}['forceReadyState'](){this['status']='ready';}async['sendRating'](_0x10db10){if('initialized'===this['status']||'loading'===this['status']||'data'===this['status']||this['_wasAborted'])return;if(!this['callId']||0x0===this['_changes']['length'])return;let _0x4e2519;if(_0x10db10){const _0x407698=this['_changes']['find'](_0x26ede5=>_0x26ede5['id']===_0x10db10);if(_0x407698&&_0x407698['isRated'])return;_0x407698&&(_0x4e2519=_0x407698['parent']['id'],_0x407698['isRated']=!0x0);}const _0x601c9c={'positiveCount':this['_changes']['filter'](_0x471ca2=>'accepted'===_0x471ca2['status'])['length'],'totalCount':this['_changes']['length']};this['_sendRatingRequest'](_0x601c9c,this['callId'],_0x4e2519);}['_addReviewCheckResult'](_0x38dea1,_0x3289dc){const _0x1f7c2c=this['_documentData']['elements']['get'](_0x38dea1);if(!_0x1f7c2c)return;const _0x5e8143=_0x1f7c2c['getContent']();if(_0x5e8143===_0x3289dc)return;const _0xeb4179=new Zs({'id':_0x38dea1,'contentInitial':_0x5e8143,'contentNew':_0x3289dc,'documentVersion':this['_documentData']['version']});this['_results']['set'](_0xeb4179['id'],_0xeb4179),this['fire']('reviewCheckResultAdded',{'result':_0xeb4179,'source':this});}['_checkIfFinished'](){'finished'===this['status']&&(this['_changes']['filter'](_0x55cac1=>'pending'===_0x55cac1['status'])['length']>0x0&&(this['status']='ready')),'ready'===this['status']&&(0x0===this['_changes']['filter'](_0x293648=>'pending'===_0x293648['status'])['length']&&(this['status']='finished'));}}class si extends eh{get['subTitle'](){if(!this['_reviewParams']||0x0===this['_reviewParams']['length'])return'';const _0xbb7501=[];if(this['_reviewParams']['length']>0x0&&this['_sourceCheck']['options'])for(let _0x282e45=0x0;_0x282e45<this['_reviewParams']['length'];_0x282e45++){if(!this['_reviewParams'][_0x282e45]||!this['_sourceCheck']['options'][_0x282e45])continue;const _0x32d07c=this['_sourceCheck']['options'][_0x282e45],_0x1c20c9=_0x32d07c['data']?.['find'](_0xb8d463=>_0xb8d463['id']===this['_reviewParams'][_0x282e45]);_0x1c20c9&&_0xbb7501['push'](_0x1c20c9['label']);}return _0xbb7501['join'](',\x20');}get['reviewName'](){return this['_composeReviewName']();}['_createApiRequest'](){return this['_aiConnector']['callSystemReview']({'reviewName':this['_composeReviewName'](),'content':this['_documentData']['content'],'args':this['_reviewArgs']});}['_sendRatingRequest'](_0x428cd3,_0xd7254b,_0x5780a0){return this['_aiConnector']['upsertAIReviewRating'](this['reviewName'],_0xd7254b,_0x428cd3,_0x5780a0);}['_composeReviewName'](){return!this['_reviewParams']||0x0===this['_reviewParams']['length']||this['_sourceCheck']['useArgs']?this['_sourceCheck']['apiId']:[this['_sourceCheck']['apiId'],...this['_reviewParams']]['join']('-');}}class ve extends _0x34a98c{['_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(_0x11d908,_0x3de8a9)=>{const _0x23c0be=this['_aiReviewCheckList']['getCheckById'](_0x3de8a9['id']);if(_0x23c0be){this['_onReviewCheckRun'](_0x3de8a9),this['_aiReviewCoreEditing']['switchToReadOnly'](),this['_currentReviewCheckRun']=this['_createReviewCheckRun'](_0x3de8a9,_0x23c0be),this['_aiReviewCoreUi']['setCheckResultTitle'](this['_currentReviewCheckRun']['title'],this['_currentReviewCheckRun']['subTitle']),this['_currentReviewCheckRun']['on']('reviewCheckRunUpdated',(_0x2dcf5a,_0x14037d)=>{switch(_0x14037d['status']){case'data':case'loading':this['_aiReviewCoreUi']['showCheckRunResults'](_0x14037d);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 _0x509ee0('ai-review-mode-check-run-general-error',this,void 0x0,this['_currentReviewCheckRun']?.['currentError']));break;case'error-chunk':this['_aiReviewCoreUi']['showChunkErrorView'](),this['_logError'](new _0x509ee0('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'!==_0x14037d['status']&&'error-chunk'!==_0x14037d['status']&&'error-general'!==_0x14037d['status']||this['_currentReviewCheckRun']?.['sendRating']();}),this['_currentReviewCheckRun']['on']('reviewCheckResultAdded',(_0x3d498b,_0x58b179)=>{if(!this['_currentReviewCheckRun'])throw new _0x509ee0('ai-review-mode-no-current-check-run',this);const _0x43722a=this['_diffContent'](_0x58b179['result']['contentInitial'],_0x58b179['result']['contentNew']);_0x58b179['source']['addResultChanges'](_0x58b179['result']['id'],_0x43722a);}),this['_currentReviewCheckRun']['on']('reviewCheckResultReady',(_0x374ff0,_0xc7e2d8)=>{for(const _0x39f1b7 of _0xc7e2d8['changes'])this['_aiReviewCoreUi']['showCheckRunResult'](_0x39f1b7);this['_markChangePositionInEditorContent'](_0xc7e2d8['changes'],_0xc7e2d8['source']['documentData']);}),this['_currentReviewCheckRun']['on']('reviewCheckResultChangeStatusUpdated',(_0x516556,_0x404bf8)=>{this['_aiReviewCoreUi']['updateChangeState'](_0x404bf8['change']['id'],_0x404bf8['status']);}),this['_currentReviewCheckRun']['on']('reviewCheckResultActivated',(_0x38911e,_0x3ab363)=>{this['_onReviewCheckResultActivated'](_0x3ab363);}),this['_currentReviewCheckRun']['on']('reviewCheckResultDeactivated',()=>{this['_onReviewCheckResultDeactivated']();});try{await this['_currentReviewCheckRun']['start']();}catch(_0xe2654){_0xe2654 instanceof Error&&_0xe2654['message']['includes']('ai-request-aborted')||(_0xe2654 instanceof _0x509ee0?this['_logError'](_0xe2654):this['_logError'](new _0x509ee0('ai-review-mode-check-run-failed',this,void 0x0,_0xe2654)));}}else this['_logError'](new _0x509ee0('ai-review-mode-source-check-not-found',this,{'checkId':_0x3de8a9['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 _0x535e38=this['_currentReviewCheckRun']['getActiveChanges']();if(!_0x535e38['length'])return;this['_aiReviewCoreEditing']['applyChange'](_0x535e38['map'](_0x35777a=>_0x35777a['id']));const _0x3b4df4=this['_currentReviewCheckRun'];_0x3b4df4['markAllChangesAsAccepted'](),_0x3b4df4['sendRating']();}),this['listenTo'](this['_aiReviewCoreUi'],'acceptChange',(_0x18d89b,_0x5a16dc)=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['isChangeActive'](_0x5a16dc['id'])&&(this['_aiReviewCoreEditing']['applyChange']([_0x5a16dc['id']]),this['_currentReviewCheckRun']['markChangeAsAccepted'](_0x5a16dc['id']),this['_aiReviewCoreUi']['hideChangeBalloon'](),this['_currentReviewCheckRun']['sendRating'](_0x5a16dc['id']));}),this['listenTo'](this['_aiReviewCoreUi'],'dismissChange',(_0x12d2ac,_0x14f0c2)=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['isChangeActive'](_0x14f0c2['id'])&&(this['_aiReviewCoreEditing']['rejectChange'](_0x14f0c2['id']),this['_currentReviewCheckRun']['markChangeAsRejected'](_0x14f0c2['id']),this['_aiReviewCoreUi']['hideChangeBalloon'](),this['_currentReviewCheckRun']['sendRating'](_0x14f0c2['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',(_0x4725fe,_0x3b4ecc)=>{this['_onActivateChange'](_0x3b4ecc);}),this['listenTo'](this['_aiReviewCoreUi'],'deactivateChange',(_0x4538d1,_0x45d476)=>{this['_onDeactivateChange'](_0x45d476);}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerClicked',(_0x3f88d0,_0x5e42d0)=>{this['_onChangeMarkerClicked'](_0x3f88d0,_0x5e42d0);}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerHovered',(_0x225844,_0x2448b6)=>{this['_onChangeMarkerHovered'](_0x225844,_0x2448b6);}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerBlurred',()=>{this['_onChangeMarkerBlurred']();}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerRemoved',(_0xa6582a,_0x4b6cda)=>{this['_onChangeMarkerRemoved'](_0xa6582a,_0x4b6cda);}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerRestored',(_0x23029a,_0x5a7bf8)=>{this['_onChangeMarkerRestored'](_0x23029a,_0x5a7bf8);});}['_createReviewCheckRun'](_0x5d642a,_0x304602){return new si(this['_aiReviewCoreEditing']['getDocumentData'](),_0x304602,this['_aiConnector'],_0x5d642a['params'],_0x5d642a['args']);}['_onChangeMarkerRemoved'](_0x130406,_0x2c68e1){this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['markChangeAsOutdated'](_0x2c68e1['changeId']);}['_onChangeMarkerRestored'](_0x4830af,_0x3aab54){this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['markChangeAsPending'](_0x3aab54['changeId']);}['_onCheckRunFinished'](){this['_aiReviewCoreUi']['showReviewCompletedView']();}['_initRequiredPlugins'](){this['_aiConnector']=this['context']['plugins']['get']('AIConnector');}['_onReviewRunLeave'](_0x5b5303=!0x1){this['_currentReviewCheckRun']&&(this['_currentReviewCheckRun']['hasModifications']||this['_currentReviewCheckRun']['sendRating'](),this['_currentReviewCheckRun']['stopListening'](),this['_currentReviewCheckRun']['abort'](),this['_currentReviewCheckRun']=void 0x0),_0x5b5303&&this['_aiReviewCoreUi']['showReviewCheckList'](),this['_aiReviewCoreEditing']['clearAllMarkers'](),this['_aiReviewCoreEditing']['switchToEdit'](),this['_changeActivationSource']=null;const _0xda5e3c=this['_aiReviewCoreEditing']['getEditor']();_0xda5e3c&&_0xda5e3c['editing']['view']['change'](_0x5867c3=>{const _0x311abc=_0xda5e3c['editing']['view']['document']['getRoot']();_0x5867c3['removeClass']('ck-ai_review-diff',_0x311abc),_0x5867c3['removeClass']('ck-ai_review-highlights',_0x311abc),_0x5867c3['removeClass']('ck-ai-translate-mode-content',_0x311abc);});}['_getTranslationWithDefault'](_0x4365b2,_0x40d4fb){const _0x40c258=i(this['context']['locale'],_0x4365b2);return _0x40c258===_0x4365b2?_0x40d4fb:_0x40c258;}['_logError'](_0x4c0119,_0x5e5a1b=!0x1){gt(_0x4c0119['message']),_0x5e5a1b||(_0x4c0119['message']['startsWith']('ai-review-mode-models-unable-to-retrieve')?this['_aiReviewCoreUi']['showGeneralReviewCoreErrorView']():this['_aiReviewCoreUi']['showGeneralResultsErrorView']());}['_scrollToChange'](_0x5578b7){if('content'===this['_changeActivationSource']){const _0x4cfc17=this['_aiReviewCoreUi']['getChangeElement'](_0x5578b7);_0x4cfc17&&_0x480036(_0x4cfc17['closest']('.ck-ai_review__check-run-result')||_0x4cfc17);}else{if('panel'===this['_changeActivationSource']){const _0x4b2d91=this['_getChangeContentElement'](_0x5578b7);if(!_0x4b2d91)return;_0x48dd33({'target':_0x4b2d91,'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 Ys{['id'];['commandId'];['title'];['description'];['isParameterized'];['useArgs'];['options'];['args'];get['apiId'](){return this['commandId'];}constructor(_0x43543f){this['id']=_0x43543f['id'],this['commandId']=_0x43543f['commandId'],this['title']=_0x43543f['title'],this['description']=_0x43543f['description'],this['isParameterized']=_0x43543f['isParameterized'],this['useArgs']=_0x43543f['useArgs'],this['options']=_0x43543f['options'],this['args']=_0x43543f['args'];}}class vo extends ts(){['_checks']=[];['setupChecks'](_0x1d2dd3){this['_checks']=_0x1d2dd3['map'](_0xecceec=>new Ys(_0xecceec));}get['checks'](){return this['_checks'];}['getCheckById'](_0x204a72){return this['checks']['find'](_0x3b749f=>_0x3b749f['id']===_0x204a72);}['removeCheckById'](_0x2359d3){this['_checks']=this['_checks']['filter'](_0x26813e=>_0x26813e['id']!==_0x2359d3);}}class ke extends Ys{['_models']=[];['_defaultModel']=null;constructor(_0x13492b,_0x565679,_0x3bb706){super(_0x13492b),this['_models']=_0x565679,this['_defaultModel']=_0x3bb706;}get['models'](){return this['_models'];}get['defaultModel'](){return this['_defaultModel'];}}class Ie extends Ys{['isExtra']=!0x0;['prompt'];['model'];['_defaultModel']=null;constructor(_0x45d2a6,_0x26005c,_0x3c3bea){super(_0x45d2a6),this['prompt']=_0x45d2a6['prompt'],this['model']=_0x45d2a6['model'],this['model']?this['_defaultModel']=_0x26005c['find'](_0x4cc3f5=>_0x4cc3f5['id']===this['model'])||null:this['_defaultModel']=_0x3c3bea;}get['defaultModel'](){return this['_defaultModel'];}}class _e extends vo{['_allModels']=[];['_recommendedModels']=[];['_defaultModel']=null;constructor(_0xbd421e,_0xc489bd,_0x526626){super(),this['_allModels']=_0xbd421e,this['_recommendedModels']=_0xc489bd,this['_defaultModel']=_0x526626;}['setupChecks'](_0x23bbb3){this['_checks']=_0x23bbb3['map'](_0x1b0bd9=>!0x0===_0x1b0bd9['isExtra']?new Ie(_0x1b0bd9,this['_allModels'],this['_defaultModel']):'custom'===_0x1b0bd9['id']?new ke(_0x1b0bd9,this['_recommendedModels'],this['_defaultModel']):new Ys(_0x1b0bd9));}}class Ce extends eh{['_prompt'];['_model'];constructor(_0x30bf9e,_0x4acdf1,_0x394911,_0x51c112,_0x11496e){super(_0x394911,_0x51c112,_0x11496e),this['_prompt']=_0x30bf9e,this['_model']=_0x4acdf1;}get['subTitle'](){return this['_prompt'];}['_createApiRequest'](){return this['_aiConnector']['callCustomReview']({'content':this['_documentData']['content'],'prompt':this['_prompt'],'model':this['_model']});}['_sendRatingRequest'](_0x11ca0b,_0x281e47,_0x5ee08c){return this['_aiConnector']['upsertCustomAIReviewRating'](_0x281e47,_0x11ca0b,_0x5ee08c);}}class Re extends Ce{get['subTitle'](){return'';}set['prompt'](_0x4e9f87){this['_prompt']=_0x4e9f87;}set['model'](_0x61a7e9){this['_model']=_0x61a7e9;}}class pe extends ve{static get['pluginName'](){return'AIReviewModeController';}['_isDiffOn']=!0x1;['_hasDefaultAvailableCommands']=!0x1;constructor(_0x5ad41e){super(_0x5ad41e),this['_hasDefaultAvailableCommands']=!this['context']['config']['get']('ai.review.availableCommands'),this['context']['config']['define']('ai.review.availableCommands',we['map'](_0x4832e0=>_0x4832e0['id'])),this['context']['config']['define']('ai.review.extraCommands',[]);}async['init'](){await super['init'](),this['listenTo'](this['_aiReviewCoreUi'],'toggleDiff',(_0x446481,_0x2fc7b1)=>{this['_isDiffOn']=_0x2fc7b1['on'],this['_onDiffChange'](this['_isDiffOn']);});}['_initRequiredPlugins'](){super['_initRequiredPlugins'](),this['_aiReviewCoreUi']=this['context']['plugins']['get']('AIReviewModeUI'),this['_aiReviewCoreEditing']=this['context']['plugins']['get']('AIReviewCoreEditing');}['_createReviewCheckRun'](_0x4d6693,_0x3105c9){return _0x4d6693['isCustom']?new Ce(_0x4d6693['args']['prompt'],_0x4d6693['args']['model'],this['_aiReviewCoreEditing']['getDocumentData'](),_0x3105c9,this['_aiConnector']):_0x3105c9['isExtra']?new Re(_0x3105c9['prompt'],_0x3105c9['defaultModel']['id'],this['_aiReviewCoreEditing']['getDocumentData'](),_0x3105c9,this['_aiConnector']):new si(this['_aiReviewCoreEditing']['getDocumentData'](),_0x3105c9,this['_aiConnector'],_0x4d6693['params'],_0x4d6693['args']);}['_onReviewCheckResultActivated'](_0x243ae1){this['_aiReviewCoreUi']['setActiveStateInResults'](_0x243ae1['change']['id']),this['_scrollToChange'](_0x243ae1['change']['id']);const _0x2ca858=this['_aiReviewCoreEditing']['getMarkerElementForChange'](_0x243ae1['change']['id']);if(!_0x2ca858)return;const _0x1bbac9=this['_aiReviewCoreEditing']['getEditor']();this['_aiReviewCoreUi']['showChangeBalloon'](_0x243ae1['change'],()=>_0x2ca858['getElement'](),void 0x0,'click',_0x1bbac9?.['editing']?.['view']?.['getDomRoot'](),_0x1bbac9?.['ui']?.['viewportOffset']),this['_aiReviewCoreEditing']['setMarkersInElementAsActive'](_0x243ae1['change']['id']);}['_onReviewCheckResultDeactivated'](){this['_aiReviewCoreUi']['resetActiveStateInResults'](),this['_aiReviewCoreUi']['hideChangeBalloon'](),this['_aiReviewCoreEditing']['setAllMarkersAsInactive']();}['_onActivateChange'](_0x23d047){this['_currentReviewCheckRun']&&'click'===_0x23d047['uiInteraction']&&(this['_changeActivationSource']='panel',this['_currentReviewCheckRun']['activateChange'](_0x23d047['id']));}['_onDeactivateChange'](_0x6b7da3){this['_currentReviewCheckRun']&&'balloon'===_0x6b7da3['origin']&&this['_currentReviewCheckRun']['deactivateChange']();}['_onChangeMarkerClicked'](_0x1ed964,_0x350e98){if(!this['_currentReviewCheckRun'])return;this['_changeActivationSource']='content',this['_currentReviewCheckRun']['activateChange'](_0x350e98['changeId']);const _0x2a93a9=this['_currentReviewCheckRun']['getChangeById'](_0x350e98['changeId']);if(!_0x2a93a9)return;const _0x35c2d0=this['_aiReviewCoreEditing']['getEditor']();this['_aiReviewCoreUi']['showChangeBalloon'](_0x2a93a9,_0x350e98['markerElement'],_0x350e98['domEvent'],'click',_0x35c2d0?.['editing']?.['view']?.['getDomRoot'](),_0x35c2d0?.['ui']?.['viewportOffset']);}['_onChangeMarkerHovered'](_0x5742d1,_0x10dcf6){if(!this['_currentReviewCheckRun'])return;if(this['_currentReviewCheckRun']['isAnyChangeActivated']())return;const _0x2800cd=this['_currentReviewCheckRun']['getChangeById'](_0x10dcf6['changeId']);if(!_0x2800cd)return;const _0x2217c3=this['_aiReviewCoreEditing']['getEditor']();this['_aiReviewCoreUi']['showChangeBalloon'](_0x2800cd,_0x10dcf6['markerElement'],_0x10dcf6['domEvent'],'hover',_0x2217c3?.['editing']?.['view']?.['getDomRoot'](),_0x2217c3?.['ui']?.['viewportOffset']);}['_onChangeMarkerBlurred'](){if(!this['_currentReviewCheckRun'])return;this['_currentReviewCheckRun']['isAnyChangeActivated']()||this['_aiReviewCoreUi']['hideChangeBalloon']();}['_getChangeContentElement'](_0xe5c433){const _0x5d2df1=this['_aiReviewCoreEditing']['getMarkerElementForChange'](_0xe5c433);return _0x5d2df1?_0x5d2df1['getElement']():null;}['_markChangePositionInEditorContent'](_0x5ee930,_0x4ff698){this['_aiReviewCoreEditing']['markChangePositionInEditorContent'](_0x5ee930,_0x4ff698);}['_diffContent'](_0x4a8d2f,_0x26f482){return this['_aiReviewCoreEditing']['diffContent'](_0x4a8d2f,_0x26f482);}['_onReviewCheckRun'](){this['_onDiffChange'](this['_isDiffOn']);}['_onDiffChange'](_0x4e3c14){const _0x48ad26=this['_aiReviewCoreEditing']['getEditor']();_0x4e3c14?this['_aiReviewCoreUi']['hideDiffInBalloon']():this['_aiReviewCoreUi']['showDiffInBalloon'](),_0x48ad26&&_0x48ad26['editing']['view']['change'](_0x36053c=>{const _0x59fb7e=_0x48ad26['editing']['view']['document']['getRoot']();for(const _0x137022 of _0x59fb7e['getClassNames']())_0x137022['startsWith']('ck-ai_review-')&&_0x36053c['removeClass'](_0x137022,_0x59fb7e);_0x36053c['addClass'](_0x4e3c14?'ck-ai_review-diff':'ck-ai_review-highlights',_0x59fb7e);});}async['_getChecksList'](){const _0xe8c476=[...we,...this['_getExtraChecks']()],_0x1400a4=this['context']['config']['get']('ai.review.availableCommands')||[];this['_logErrorForNonExistentChecks'](_0x1400a4,_0xe8c476);let _0x46dc2f=_0xe8c476;this['_hasDefaultAvailableCommands']||(_0x46dc2f=_0x1400a4['map'](_0x36ec54=>_0xe8c476['find'](_0x15b61c=>_0x15b61c['id']===_0x36ec54))['filter'](_0x45f94f=>!!_0x45f94f)),_0x46dc2f=_0x46dc2f['map'](_0x4ad057=>_0x4ad057['isExtra']?_0x4ad057:this['_translateReviewCheck'](_0x4ad057));const _0x338810=_0x46dc2f['some'](_0x5eb30b=>_0x5eb30b['isExtra']||'custom'===_0x5eb30b['id']);let _0x45e336=[],_0x492ba4=[],_0x7a2c06=null;if(_0x338810){const _0x4715f6=await this['_getModels']();_0x45e336=_0x4715f6['all'],_0x492ba4=_0x4715f6['recommended'],_0x7a2c06=_0x4715f6['default'];}const _0x140f3c=new _e(_0x45e336,_0x492ba4,_0x7a2c06);return _0x140f3c['setupChecks'](_0x46dc2f),_0x338810&&this['_filterChecksWithMissingModel'](_0x140f3c),_0x140f3c;}['_getExtraChecks'](){return(this['context']['config']['get']('ai.review.extraCommands')||[])['map'](_0x448efe=>({'id':_0x448efe['id'],'commandId':_0x448efe['id'],'title':_0x448efe['label'],'description':_0x448efe['description'],'isParameterized':!0x1,'isExtra':!0x0,'prompt':_0x448efe['prompt'],'model':_0x448efe['model']}));}['_logErrorForNonExistentChecks'](_0x146c16,_0x3a9407){const _0x302439=_0x146c16['filter'](_0x344ff0=>!_0x3a9407['some'](_0x462ba3=>_0x462ba3['id']===_0x344ff0));_0x302439['length']&&this['_logError'](new _0x509ee0('ai-review-mode-non-existent-commands-used',this,{'commandIds':_0x302439['join'](',\x20')}),!0x0);}async['_getModels'](){try{const _0x5a0b0d=new It({'connector':this['_aiConnector'],'config':this['context']['config']['get']('ai.models'),'locale':this['context']['locale']});return{'all':await _0x5a0b0d['getAll'](),'recommended':await _0x5a0b0d['getAvailableModels'](),'default':await _0x5a0b0d['getDefault']()};}catch(_0xde70c9){return this['_logError'](new _0x509ee0('ai-review-mode-models-unable-to-retrieve',this,void 0x0,_0xde70c9)),{'all':[],'recommended':[],'default':null};}}['_translateReviewCheck'](_0x3d8a0c){const _0x40f5da='AI_REVIEW_CHECK_'+_0x3d8a0c['id']['toUpperCase']()['replaceAll']('-','_'),_0x5e176b={..._0x3d8a0c,'title':this['_getTranslationWithDefault'](_0x40f5da+'_TITLE',_0x3d8a0c['title']),'description':this['_getTranslationWithDefault'](_0x40f5da+'_DESCRIPTION',_0x3d8a0c['description'])};return _0x3d8a0c['options']&&(_0x5e176b['options']=_0x3d8a0c['options']['map'](_0x2f258f=>({..._0x2f258f,'label':this['_getTranslationWithDefault'](_0x40f5da+'_OPTIONS_LABEL',_0x2f258f['label']||''),'data':_0x2f258f['data']?_0x2f258f['data']['map'](_0x1cf4f7=>({..._0x1cf4f7,'label':this['_getTranslationWithDefault'](_0x40f5da+'_OPTIONS_DATA_'+_0x1cf4f7['id']['toUpperCase'](),_0x1cf4f7['label'])})):void 0x0}))),_0x5e176b;}['_filterChecksWithMissingModel'](_0xda378){const _0x41d340=[];_0xda378['checks']['forEach'](_0x556a91=>{(_0x556a91 instanceof Ie&&!_0x556a91['defaultModel']||_0x556a91 instanceof ke&&!_0x556a91['models']['length'])&&_0x41d340['push'](_0x556a91['id']);}),_0x41d340['length']&&_0x41d340['forEach'](_0x1c9319=>{_0xda378['removeCheckById'](_0x1c9319),this['_logError'](new _0x509ee0('ai-review-mode-command-unavailable-due-to-missing-model',this,{'commandId':_0x1c9319}),!0x0);});}}class Ka extends _0x34a98c{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 Ys{get['apiId'](){return'translate';}}class Pe extends vo{['setupChecks'](_0x39a90a){this['_checks']=_0x39a90a['map'](_0x2deb6a=>new jr(_0x2deb6a));}}class Se extends si{['_title'];constructor(_0x3d84ef,_0x5222d7,_0x658766,_0x9b4ffa,_0x58903e,_0x20883f){super(_0x3d84ef,_0x5222d7,_0x658766,_0x58903e,_0x20883f),this['_title']=_0x9b4ffa;}get['title'](){return this['_title'];}get['subTitle'](){return this['_sourceCheck']['title'];}}class rr extends ve{static get['pluginName'](){return'AITranslateController';}constructor(_0x3ad149){super(_0x3ad149),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'](_0x25bbbc,_0x4dd2e1){return new Se(this['_aiReviewCoreEditing']['getDocumentData'](),_0x4dd2e1,this['_aiConnector'],i(this['context']['locale'],'AI_REVIEW_CHECK_TRANSLATE_TITLE'),_0x25bbbc['params'],_0x25bbbc['args']);}['_onReviewCheckResultActivated'](_0x5947e3){this['_aiReviewCoreUi']['setActiveStateInResults'](_0x5947e3['change']['id']),this['_aiReviewCoreEditing']['setMarkersInElementAsActive'](_0x5947e3['change']['id']);}['_onReviewCheckResultDeactivated'](){this['_aiReviewCoreEditing']['setAllMarkersAsInactive'](),this['_aiReviewCoreUi']['resetActiveStateInResults']();}['_onActivateChange'](_0x1acdf1){this['_currentReviewCheckRun']&&('hover'===_0x1acdf1['uiInteraction']&&(this['_changeActivationSource']='panel',this['_currentReviewCheckRun']['activateChange'](_0x1acdf1['id'])),'click'===_0x1acdf1['uiInteraction']&&this['_scrollToChange'](_0x1acdf1['id']));}['_onDeactivateChange'](_0x4ad0a8){this['_currentReviewCheckRun']&&'panel'===_0x4ad0a8['origin']&&this['_currentReviewCheckRun']['deactivateChange']();}['_onChangeMarkerClicked'](_0x540b9f,_0x4acfdb){this['_currentReviewCheckRun']&&(this['_changeActivationSource']='content',this['_currentReviewCheckRun']['activateChange'](_0x4acfdb['changeId']),this['_scrollToChange'](_0x4acfdb['changeId']));}['_onChangeMarkerHovered'](_0x27a7e4,_0x5ec34c){this['_currentReviewCheckRun']&&(this['_changeActivationSource']='content',this['_currentReviewCheckRun']['activateChange'](_0x5ec34c['changeId']),this['_aiReviewCoreEditing']['reactivateMarkers'](_0x5ec34c['changeId']));}['_onChangeMarkerBlurred'](){this['_currentReviewCheckRun']&&'content'===this['_changeActivationSource']&&(this['_currentReviewCheckRun']['deactivateChange'](),this['_aiReviewCoreEditing']['setAllMarkersAsInactive']());}['_getChangeContentElement'](_0x421868){return this['_aiReviewCoreEditing']['getContentElementForChange'](_0x421868);}['_markChangePositionInEditorContent'](_0x7b2a63,_0x45d98a){this['_aiReviewCoreEditing']['markChangePositionInEditorContent'](_0x7b2a63,_0x45d98a);}['_diffContent'](_0x4a3d12,_0x4a6392){return this['_aiReviewCoreEditing']['diffContent'](_0x4a3d12,_0x4a6392,!0x0);}['_onReviewCheckRun'](){const _0x4795a8=this['_aiReviewCoreEditing']['getEditor']();_0x4795a8&&_0x4795a8['editing']['view']['change'](_0x1442a3=>{const _0x573175=_0x4795a8['editing']['view']['document']['getRoot']();for(const _0x5d98c0 of _0x573175['getClassNames']())(_0x5d98c0['startsWith']('ck-ai-review-')||'ck-ai-translate-'===_0x5d98c0)&&_0x1442a3['removeClass'](_0x5d98c0,_0x573175);_0x1442a3['addClass']('ck-ai-translate-mode-content',_0x573175);});}async['_getChecksList'](){const _0x31111b=[],_0x28ed41=this['context']['config']['get']('ai.translate.languages')||[];for(const _0x1ace51 of _0x28ed41)_0x31111b['push']({'title':_0x1ace51['label'],'id':_0x1ace51['id'],'commandId':_0x1ace51['id'],'description':'','isParameterized':!0x1,'useArgs':!0x0,'args':{'language':_0x1ace51['id']}});const _0x463c8b=new Pe();return _0x463c8b['setupChecks'](this['_translateChecks'](_0x31111b)),_0x463c8b;}['_translateChecks'](_0x43e285){return _0x43e285['map'](_0x1d740a=>{const _0x5e64d2='AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_'+_0x1d740a['title']['toUpperCase']()['replaceAll']('-','_');return{..._0x1d740a,'title':this['_getTranslationWithDefault'](_0x5e64d2,_0x1d740a['title'])};});}}class Le extends Ve{constructor(_0x4f2c3a,_0x19d23a){super(_0x4f2c3a,_0x19d23a),this['on']('set:isLoading',(_0x17ba6a,_0x3a4474,_0x46aa1a)=>{_0x46aa1a&&(this['headerTitle']=i(this['locale'],'AI_TRANSLATE_CHECK_RESULTS_LOADING_TITLE'));}),this['on']('set:isResultReady',(_0x57a60f,_0x8a7013,_0x565734)=>{_0x565734&&(this['headerTitle']=i(this['locale'],'AI_TRANSLATE_CHECK_RESULTS_READY_TITLE'));});}['_createAcceptAllButtonView'](){const _0x2f667f=super['_createAcceptAllButtonView']();return _0x2f667f['set']('label',i(this['locale'],'AI_TRANSLATE_ACCEPT_ALL')),_0x2f667f;}['_createExitReviewButtonView'](){const _0x39e230=super['_createExitReviewButtonView']();return _0x39e230['set']('label',i(this['locale'],'AI_CHAT_HISTORY_CANCEL')),_0x39e230;}}class Ne extends je{['_setupTemplate'](){const _0x26eb7c=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-translate__check-list-wrapper',_0x26eb7c['if']('isVisible','ck-hidden',_0x48e620=>!_0x48e620)]},'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',_0x26eb7c['if']('isVisible','ck-hidden',_0x1b6363=>!_0x1b6363)]},'children':this['_checkViews']}]});}}class tr extends Me{static get['pluginName'](){return'AITranslateUI';}['createMainView'](){const _0x3d6993=this['context']['locale'],_0xe1b9bd=new _0x156476(_0x3d6993,{'label':i(_0x3d6993,'AI_REVIEW_CHECK_TRANSLATE_TITLE'),'icon':_0x3a5ed3,'class':'ck-ai-header\x20ck-ai-header_review-translate'}),_0x51ca8b=new Ae(_0x3d6993,{'header':_0xe1b9bd,'list':new Ne(_0x3d6993),'results':new Le(_0x3d6993,{'generalErrorText':i(_0x3d6993,'AI_TRANSLATE_GENERAL_ERROR_MESSAGE')}),'completed':new be(_0x3d6993,{'headerText':i(_0x3d6993,'AI_TRANSLATE_FINISH_HEADER_TITLE'),'emptyResultsText':i(_0x3d6993,'AI_TRANSLATE_EMPTY_RESULTS_TEXT'),'buttonText':i(_0x3d6993,'AI_TRANSLATE_FINISH_BUTTON_LABEL')})});return _0x51ca8b['extendTemplate']({'attributes':{'class':'ck-ai-translate-mode'}}),_0x51ca8b;}['registerTab'](){const _0x1d8b0c=this['context']['plugins']['get']('AITabs');_0x1d8b0c['view']['on']('activateTab',(_0x1b66ce,_0x4aebab)=>{'translate'===_0x4aebab?this['fire']('getReviewCheckList'):this['fire']('leaveReview');}),_0x1d8b0c['view']['addTab']({'id':'translate','buttonLabel':i(this['context']['locale'],'AI_REVIEW_CHECK_TRANSLATE_TITLE'),'buttonIcon':_0x3a5ed3,'order':0x0,'content':this['_mainView']});}}class Wa extends _0x34a98c{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,$n as AIAssistant,n as AIAssistantUI,Q as AIBalloon,Ma as AIChat,at as AIChatController,ht as AIChatHistory,jt as AIChatHistoryController,xt as AIChatHistoryUI,Va as AIChatShortcuts,ct as AIChatUI,q as AIConnector,D as AIEditing,Ba as AIEditorIntegration,Qt as AIQuickActionType,Fa as AIQuickActions,ii as AIQuickActionsUI,er as AIRequestError,Ys as AIReviewCheck,Zs as AIReviewCheckResult,eh as AIReviewCheckRun,Ka as AIReviewMode,ve as AIReviewModeController,de as AIReviewModeEditing,ge as AIReviewModeUI,pt as AITabs,ye as AITextAdapter,qt as AIToggleButtonUI,Wa as AITranslate,rr as AITranslateController,tr as AITranslateUI,Xn as AWSTextAdapter,Qn as OpenAITextAdapter,E as ShowAIAssistantCommand,io as ToggleAICommand,Hs as createResizeButton,qn as getDefaultAICommands};
|